@kodaeditor/core 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/license.d.ts CHANGED
@@ -44,20 +44,6 @@ export interface LicenseOptions {
44
44
  * the code of every license issued.
45
45
  */
46
46
  export declare const DEFAULT_ENDPOINT = "https://api.kodaeditor.com/validate";
47
- /**
48
- * Validates a license key.
49
- *
50
- * Order of play: a fresh cache (less than a day old) answers at once and is
51
- * refreshed in the background; otherwise the service is asked; if it cannot
52
- * be reached, the cache keeps the installation clean for the grace period;
53
- * only after that does the editor fall back to trial mode. It keeps working
54
- * either way - nothing is switched off.
55
- *
56
- * There is deliberately no exception for a first install while the service is
57
- * unreachable: at that point the key has never been confirmed, and such a
58
- * window would mean any string in the license attribute plus a blocked domain
59
- * yields an unmarked editor.
60
- */
61
47
  export declare function validateLicense(opts: LicenseOptions): Promise<LicenseResult>;
62
48
  export interface OfflineLicenseOptions {
63
49
  /**
@@ -137,7 +137,7 @@ export declare class KodaEditorElement extends ElementBase {
137
137
  private buildPropsDialog;
138
138
  private openTablePropsDialog;
139
139
  private openCellPropsDialog;
140
- private getMergeFields;
140
+ private builtinMergeFields;
141
141
  private openMergeFieldPicker;
142
142
  /** Inserts a merge field programmatically. */
143
143
  insertMergeField(key: string, label?: string): void;
@@ -215,13 +215,28 @@ export declare class KodaEditorElement extends ElementBase {
215
215
  private openFilePicker;
216
216
  private handleImportedFile;
217
217
  private pickImportFile;
218
+ /**
219
+ * Template fields present in the document, in order - the same list the
220
+ * editor returns. Ask before submitting a form or exporting: a field still
221
+ * standing here means a blank left unfilled.
222
+ *
223
+ * `stable: false` means the key depends on the ORDER of fields: editing the
224
+ * template shifts it, and a saved «this key is the tax ID» mapping will put
225
+ * the tax ID somewhere else, silently.
226
+ */
227
+ getMergeFields(): Array<{
228
+ key: string;
229
+ label: string;
230
+ hint: string | null;
231
+ context: string | null;
232
+ stable: boolean;
233
+ }>;
218
234
  /**
219
235
  * Imports a .docx programmatically (File or ArrayBuffer) and returns the
220
236
  * converter's warnings - unsupported styles, text inside shapes and the
221
237
  * like. Show them to the user or ignore them, as suits your application.
222
238
  */
223
239
  importDocx(source: File | ArrayBuffer): Promise<DocxImportResult | undefined>;
224
- /** Imports a file (.docx, .csv, .txt, .md or an image), detecting the type. */
225
240
  importFile(file: File): Promise<void>;
226
241
  /** Exports to Markdown and downloads the .md file. */
227
242
  exportMarkdown(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kodaeditor/core",
3
- "version": "1.0.3",
4
- "description": "WYSIWYG rich-text editor as a web component. Pastes Word, Excel and Google Docs content without losing tables, lists or formatting. Self-hosted, framework-agnostic.",
3
+ "version": "1.0.5",
4
+ "description": "WYSIWYG rich-text editor as a web component. Brings tables, lists and formatting across when users paste from Word, Excel and Google Docs. Self-hosted, framework-agnostic.",
5
5
  "keywords": [
6
6
  "wysiwyg",
7
7
  "rich-text-editor",
@@ -9,7 +9,6 @@
9
9
  "word-paste",
10
10
  "docx",
11
11
  "html-editor",
12
- "prosemirror",
13
12
  "web-component",
14
13
  "custom-element",
15
14
  "xlsx",
@@ -47,40 +46,5 @@
47
46
  "THIRD-PARTY-LICENSES.txt",
48
47
  "LICENSE.md"
49
48
  ],
50
- "scripts": {
51
- "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
52
- "build": "npm run clean && tsc -p tsconfig.json && node ../../scripts/strip-private-docs.mjs dist && node ../../scripts/prune-internal-types.mjs dist && vite build",
53
- "build:split": "vite build --config vite.config.split.ts && node ../../scripts/copy-vendor.mjs",
54
- "build:protected": "npm run build:split && node ../../scripts/obfuscate.mjs dist/kodaeditor-core.umd.cjs dist/kodaeditor-core.obf.umd.cjs",
55
- "build:standalone-protected": "npm run build && node ../../scripts/obfuscate.mjs dist/kodaeditor.js dist/kodaeditor.js && node ../../scripts/obfuscate.mjs dist/kodaeditor.umd.cjs dist/kodaeditor.umd.cjs",
56
- "typecheck": "tsc --noEmit",
57
- "test": "vitest run",
58
- "prepack": "npm run build:standalone-protected && npm run build:split && node ../../scripts/obfuscate.mjs dist/kodaeditor-core.umd.cjs dist/kodaeditor-core.umd.cjs && node -e \"require('fs').copyFileSync('../../LICENSE.md','LICENSE.md')\" && node ../../scripts/check-ssr-import.mjs",
59
- "postpack": "npm run build && npm run build:split"
60
- },
61
- "devDependencies": {
62
- "@types/turndown": "^5.0.6",
63
- "dompurify": "^3.4.15",
64
- "javascript-obfuscator": "^5.7.0",
65
- "jsdom": "^29.1.1",
66
- "jszip": "^3.10.2",
67
- "mammoth": "^1.12.0",
68
- "marked": "^18.0.12",
69
- "pdfjs-dist": "^6.0.227",
70
- "prosemirror-commands": "^1.6.0",
71
- "prosemirror-history": "^1.4.1",
72
- "prosemirror-keymap": "^1.2.2",
73
- "prosemirror-model": "^1.23.0",
74
- "prosemirror-schema-basic": "^1.2.3",
75
- "prosemirror-schema-list": "^1.4.1",
76
- "prosemirror-state": "^1.4.3",
77
- "prosemirror-tables": "^1.8.5",
78
- "prosemirror-view": "^1.34.3",
79
- "turndown": "^7.2.4",
80
- "turndown-plugin-gfm": "^1.0.2",
81
- "typescript": "^7.0.2",
82
- "vitest": "^5.0.0",
83
- "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
84
- },
85
49
  "license": "SEE LICENSE IN LICENSE.md"
86
50
  }