mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(text): set up license key for development
This commit is contained in:
parent
26ad428b24
commit
507fc17701
4
apps/client/.env.development
Normal file
4
apps/client/.env.development
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# The development license key for premium CKEditor features.
|
||||||
|
# Note: This key is for development purposes only and should not be used in production.
|
||||||
|
# Expires on: 2025-09-13
|
||||||
|
VITE_CKEDITOR_KEY=eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NTc3MjE1OTksImp0aSI6IjRmMjdkYmYxLTcwOTEtNDYwZi04ZDZmLTc0NzBiZjQwNjg2MCIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsic2giLCJkcnVwYWwiXSwid2hpdGVMYWJlbCI6dHJ1ZSwibGljZW5zZVR5cGUiOiJkZXZlbG9wbWVudCIsImZlYXR1cmVzIjpbIkRSVVAiLCJDTVQiLCJETyIsIkZQIiwiU0MiLCJUT0MiLCJUUEwiLCJQT0UiLCJDQyIsIk1GIiwiU0VFIiwiRUNIIiwiRUlTIl0sInZjIjoiMjMxYzMwNTEifQ.9Ct5lIKbioC3dM8EFatDTmimEIVOdItE3Uh_ICHlS_A_8ueqIfkZpsN3L4_EqprvteNki9yqbuZVGpZTaQ51xg
|
14
apps/client/src/vite-env.d.ts
vendored
Normal file
14
apps/client/src/vite-env.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
interface ViteTypeOptions {
|
||||||
|
strictImportMetaEnv: unknown
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
/** The license key for CKEditor premium features. */
|
||||||
|
readonly VITE_CKEDITOR_KEY?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv
|
||||||
|
}
|
@ -203,7 +203,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
classes: true,
|
classes: true,
|
||||||
attributes: true
|
attributes: true
|
||||||
},
|
},
|
||||||
licenseKey: "GPL"
|
licenseKey: getLicenseKey()
|
||||||
};
|
};
|
||||||
|
|
||||||
const contentLanguage = this.note?.getLabelValue("language");
|
const contentLanguage = this.note?.getLabelValue("language");
|
||||||
@ -640,3 +640,13 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLicenseKey() {
|
||||||
|
const premiumLicenseKey = import.meta.env.VITE_CKEDITOR_KEY;
|
||||||
|
if (!premiumLicenseKey) {
|
||||||
|
logError("CKEditor license key is not set, premium features will not be available.");
|
||||||
|
return "GPL";
|
||||||
|
}
|
||||||
|
|
||||||
|
return premiumLicenseKey;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user