mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
feat(text): set up license key for development
This commit is contained in:
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,
|
||||
attributes: true
|
||||
},
|
||||
licenseKey: "GPL"
|
||||
licenseKey: getLicenseKey()
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user