@kodaeditor/core 1.0.2 → 1.0.4

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/editor.d.ts CHANGED
@@ -15,6 +15,15 @@ export interface EditorOptions {
15
15
  strings?: Strings;
16
16
  /** Called on every change to the document. */
17
17
  onChange?: (html: string) => void;
18
+ onImportError?: (message: string) => void;
19
+ onImportWarnings?: (warnings: string[]) => void;
20
+ onUnfilledFields?: (fields: Array<{
21
+ key: string;
22
+ label: string;
23
+ hint: string | null;
24
+ context: string | null;
25
+ stable: boolean;
26
+ }>) => void;
18
27
  /** Hooks for the floating table toolbar, so a host can open its own dialog. */
19
28
  tableCallbacks?: {
20
29
  onSplitCell?: () => void;
@@ -40,6 +49,9 @@ export interface TableProps {
40
49
  export declare class Editor {
41
50
  readonly view: EditorView;
42
51
  private readonly onChange?;
52
+ private readonly onImportError?;
53
+ private readonly onImportWarnings?;
54
+ private readonly onUnfilledFields?;
43
55
  private licensed;
44
56
  private licenseCheck;
45
57
  private readonly strings;
@@ -233,6 +245,19 @@ export declare class Editor {
233
245
  insertImage(src: string, alt?: string): void;
234
246
  /** Inserts a merge field: an inline chip replaced by a real value later. */
235
247
  insertMergeField(key: string, label?: string): void;
248
+ /**
249
+ * Merge fields present in the document, in order - including the ones that
250
+ * came from Word template placeholders. Ask before submitting a form or
251
+ * exporting: a field still standing here means a blank left unfilled.
252
+ */
253
+ getMergeFields(): Array<{
254
+ key: string;
255
+ label: string;
256
+ hint: string | null;
257
+ context: string | null;
258
+ stable: boolean;
259
+ }>;
260
+ private htmlForExport;
236
261
  /**
237
262
  * The document's HTML with merge fields expanded to {{key}} placeholders,
238
263
  * for systems that substitute values by {{...}} rather than by data
package/dist/i18n.d.ts CHANGED
@@ -110,6 +110,9 @@ export interface Strings {
110
110
  toolbarHint: string;
111
111
  trialExportNotice: string;
112
112
  importFailed: string;
113
+ importNothingImported: string;
114
+ importPartialLoss: string;
115
+ exportUnfilledFields: string;
113
116
  imageTooBig: string;
114
117
  imageWrongType: string;
115
118
  imageUploadFailed: string;