feat(text): set up license key for development

This commit is contained in:
Elian Doran
2025-06-16 18:38:06 +03:00
parent 26ad428b24
commit 507fc17701
3 changed files with 29 additions and 1 deletions

14
apps/client/src/vite-env.d.ts vendored Normal file
View 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
}

View File

@@ -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;
}