@editora/plugins 1.0.7 → 1.0.9

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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -4
  3. package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
  4. package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
  5. package/dist/anchor.cjs.js +11 -11
  6. package/dist/anchor.esm.js +130 -107
  7. package/dist/anchoredPopover-BzqGPOAE.js +1 -0
  8. package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
  9. package/dist/approval-workflow.cjs.js +447 -0
  10. package/dist/approval-workflow.esm.js +1070 -0
  11. package/dist/background-color.cjs.js +3 -3
  12. package/dist/background-color.esm.js +116 -119
  13. package/dist/blocks-library.cjs.js +442 -0
  14. package/dist/blocks-library.esm.js +1317 -0
  15. package/dist/citations.cjs.js +548 -0
  16. package/dist/citations.esm.js +1457 -0
  17. package/dist/code.cjs.js +82 -102
  18. package/dist/code.esm.js +1172 -662
  19. package/dist/comments.cjs.js +10 -10
  20. package/dist/comments.esm.js +195 -177
  21. package/dist/conditional-content.cjs.js +626 -0
  22. package/dist/conditional-content.esm.js +1360 -0
  23. package/dist/content-rules.cjs.js +408 -0
  24. package/dist/content-rules.esm.js +1093 -0
  25. package/dist/data-binding.cjs.js +321 -0
  26. package/dist/data-binding.esm.js +913 -0
  27. package/dist/doc-schema.cjs.js +398 -0
  28. package/dist/doc-schema.esm.js +1310 -0
  29. package/dist/document-manager.cjs.js +1 -1
  30. package/dist/document-manager.esm.js +1 -1
  31. package/dist/documentManager-CTqRftU8.mjs +8369 -0
  32. package/dist/documentManager-Jf0RbSks.js +17 -0
  33. package/dist/embed-iframe.cjs.js +2 -2
  34. package/dist/embed-iframe.esm.js +8 -5
  35. package/dist/emojis.cjs.js +64 -39
  36. package/dist/emojis.esm.js +133 -104
  37. package/dist/enterprise.cjs.js +1 -0
  38. package/dist/enterprise.esm.js +56 -0
  39. package/dist/html2canvas.esm-B5qzocYs.js +5 -0
  40. package/dist/html2canvas.esm-BWVIUcAF.mjs +4802 -0
  41. package/dist/{index-Bskk414V.mjs → index-BFsKNTTj.mjs} +50 -50
  42. package/dist/index-CvJk4DKa.js +221 -0
  43. package/dist/index-D3CycEFU.mjs +16543 -0
  44. package/dist/index-tqLTHcO6.js +1 -0
  45. package/dist/index.cjs.js +1 -1
  46. package/dist/{index.es-Cz1qItab.js → index.es-CE_A4QSm.js} +5 -5
  47. package/dist/{index.es-DEcRmSTY.mjs → index.es-DQ78mYYo.mjs} +4 -3
  48. package/dist/index.esm.js +111 -75
  49. package/dist/jspdf.es.min-BoS80556.js +77 -0
  50. package/dist/jspdf.es.min-DQCoX5yh.mjs +7889 -0
  51. package/dist/link.cjs.js +6 -6
  52. package/dist/link.esm.js +41 -39
  53. package/dist/math.cjs.js +21 -21
  54. package/dist/math.esm.js +151 -112
  55. package/dist/media-manager.cjs.js +15 -15
  56. package/dist/media-manager.esm.js +227 -206
  57. package/dist/mentions.cjs.js +105 -0
  58. package/dist/mentions.esm.js +726 -0
  59. package/dist/merge-tag.cjs.js +44 -12
  60. package/dist/merge-tag.esm.js +368 -241
  61. package/dist/page-break.cjs.js +2 -2
  62. package/dist/page-break.esm.js +85 -77
  63. package/dist/pii-redaction.cjs.js +436 -0
  64. package/dist/pii-redaction.esm.js +1377 -0
  65. package/dist/preview.cjs.js +3 -3
  66. package/dist/preview.esm.js +29 -29
  67. package/dist/slash-commands.cjs.js +90 -0
  68. package/dist/slash-commands.esm.js +752 -0
  69. package/dist/smart-paste.cjs.js +398 -0
  70. package/dist/smart-paste.esm.js +1388 -0
  71. package/dist/special-characters.cjs.js +83 -45
  72. package/dist/special-characters.esm.js +149 -100
  73. package/dist/spell-check.cjs.js +9 -9
  74. package/dist/spell-check.esm.js +235 -216
  75. package/dist/template.cjs.js +14 -14
  76. package/dist/template.esm.js +157 -131
  77. package/dist/text-color.cjs.js +9 -9
  78. package/dist/text-color.esm.js +131 -115
  79. package/dist/track-changes.cjs.js +77 -0
  80. package/dist/track-changes.esm.js +755 -0
  81. package/dist/translation-workflow.cjs.js +626 -0
  82. package/dist/translation-workflow.esm.js +1718 -0
  83. package/dist/version-diff.cjs.js +362 -0
  84. package/dist/version-diff.esm.js +768 -0
  85. package/index.d.ts +849 -1
  86. package/package.json +105 -6
  87. package/dist/colorSelectionApply-C0iOfMWb.js +0 -1
  88. package/dist/colorSelectionApply-D8r_gV32.mjs +0 -63
  89. package/dist/documentManager-DRUc1-Cs.mjs +0 -37581
  90. package/dist/documentManager-_tQQfQi9.js +0 -317
  91. package/dist/index-D3pJyAsj.js +0 -1
package/index.d.ts CHANGED
@@ -8,6 +8,832 @@ export interface ApiConfig {
8
8
  export type MediaManagerConfig = Record<string, unknown>;
9
9
  export type DocumentManagerConfig = Record<string, unknown>;
10
10
 
11
+ export interface MergeTagItem {
12
+ key?: string;
13
+ label: string;
14
+ category?: string;
15
+ preview?: string;
16
+ description?: string;
17
+ value?: string;
18
+ }
19
+
20
+ export interface MergeTagCategory {
21
+ id?: string;
22
+ name: string;
23
+ tags: MergeTagItem[];
24
+ }
25
+
26
+ export interface MergeTagDialogOptions {
27
+ title?: string;
28
+ searchPlaceholder?: string;
29
+ emptyStateText?: string;
30
+ cancelText?: string;
31
+ insertText?: string;
32
+ showPreview?: boolean;
33
+ }
34
+
35
+ export interface MergeTagPluginOptions {
36
+ tags?: MergeTagItem[];
37
+ categories?: MergeTagCategory[];
38
+ defaultCategory?: string;
39
+ dialog?: MergeTagDialogOptions;
40
+ tokenTemplate?: string | ((tag: MergeTagItem & { key: string; category: string }) => string);
41
+ }
42
+
43
+ export interface TrackChangesPluginOptions {
44
+ author?: string;
45
+ enabledByDefault?: boolean;
46
+ includeTimestamp?: boolean;
47
+ }
48
+
49
+ export type VersionDiffMode = "word" | "line";
50
+
51
+ export interface VersionDiffLabels {
52
+ title?: string;
53
+ baseline?: string;
54
+ current?: string;
55
+ noChanges?: string;
56
+ loading?: string;
57
+ tabInline?: string;
58
+ tabSideBySide?: string;
59
+ refresh?: string;
60
+ setBaseline?: string;
61
+ close?: string;
62
+ mode?: string;
63
+ ignoreWhitespace?: string;
64
+ largeDocFallback?: string;
65
+ }
66
+
67
+ export interface VersionDiffOpenArgs {
68
+ baselineHtml?: string;
69
+ mode?: VersionDiffMode;
70
+ ignoreWhitespace?: boolean;
71
+ }
72
+
73
+ export interface VersionDiffPluginOptions {
74
+ baselineHtml?: string;
75
+ getBaselineHtml?: (context: { editor: HTMLElement; editorRoot: HTMLElement }) => string | Promise<string>;
76
+ mode?: VersionDiffMode;
77
+ ignoreWhitespace?: boolean;
78
+ maxTokens?: number;
79
+ maxMatrixSize?: number;
80
+ labels?: VersionDiffLabels;
81
+ }
82
+
83
+ export interface ConditionalContentLabels {
84
+ dialogTitleInsert?: string;
85
+ dialogTitleEdit?: string;
86
+ conditionLabel?: string;
87
+ conditionPlaceholder?: string;
88
+ audienceLabel?: string;
89
+ audiencePlaceholder?: string;
90
+ localeLabel?: string;
91
+ localePlaceholder?: string;
92
+ elseLabel?: string;
93
+ saveText?: string;
94
+ cancelText?: string;
95
+ blockIfLabel?: string;
96
+ blockElseLabel?: string;
97
+ allAudiencesText?: string;
98
+ allLocalesText?: string;
99
+ }
100
+
101
+ export interface ConditionalBlockConfig {
102
+ condition?: string;
103
+ audience?: string[];
104
+ locale?: string[];
105
+ hasElse?: boolean;
106
+ }
107
+
108
+ export interface ConditionalContentDialogArgs extends ConditionalBlockConfig {
109
+ target?: "insert" | "edit";
110
+ }
111
+
112
+ export interface ConditionalContentPluginOptions {
113
+ defaultCondition?: string;
114
+ defaultAudience?: string[];
115
+ defaultLocale?: string[];
116
+ enableElseByDefault?: boolean;
117
+ labels?: ConditionalContentLabels;
118
+ context?: Record<string, unknown> | (() => Record<string, unknown>);
119
+ getContext?: (context: { editor: HTMLElement; editorRoot: HTMLElement }) => Record<string, unknown> | Promise<Record<string, unknown>>;
120
+ currentAudience?: string | string[];
121
+ currentLocale?: string | string[];
122
+ evaluateCondition?: (condition: string, context: Record<string, unknown>) => boolean;
123
+ }
124
+
125
+ export type DataBindingFormat = "text" | "number" | "currency" | "date" | "json";
126
+
127
+ export interface DataBindingLabels {
128
+ dialogTitleInsert?: string;
129
+ dialogTitleEdit?: string;
130
+ keyLabel?: string;
131
+ keyPlaceholder?: string;
132
+ fallbackLabel?: string;
133
+ fallbackPlaceholder?: string;
134
+ formatLabel?: string;
135
+ currencyLabel?: string;
136
+ currencyPlaceholder?: string;
137
+ saveText?: string;
138
+ cancelText?: string;
139
+ previewOnText?: string;
140
+ previewOffText?: string;
141
+ tokenAriaPrefix?: string;
142
+ }
143
+
144
+ export interface DataBindingTokenConfig {
145
+ key: string;
146
+ fallback?: string;
147
+ format?: DataBindingFormat;
148
+ currency?: string;
149
+ }
150
+
151
+ export interface DataBindingDialogArgs extends Partial<DataBindingTokenConfig> {
152
+ target?: "insert" | "edit";
153
+ }
154
+
155
+ export interface DataBindingApiRequestContext {
156
+ editor: HTMLElement;
157
+ editorRoot: HTMLElement;
158
+ signal: AbortSignal;
159
+ }
160
+
161
+ export interface DataBindingApiConfig {
162
+ url: string;
163
+ method?: string;
164
+ headers?: Record<string, string> | ((ctx: DataBindingApiRequestContext) => Record<string, string>);
165
+ credentials?: RequestCredentials;
166
+ mode?: RequestMode;
167
+ cache?: RequestCache;
168
+ params?: Record<string, string> | ((ctx: DataBindingApiRequestContext) => Record<string, string>);
169
+ body?:
170
+ | Record<string, unknown>
171
+ | BodyInit
172
+ | ((ctx: DataBindingApiRequestContext) => Record<string, unknown> | BodyInit | undefined);
173
+ buildRequest?: (ctx: DataBindingApiRequestContext) => { url: string; init?: RequestInit };
174
+ responseType?: "json" | "text";
175
+ responsePath?: string;
176
+ transformResponse?: (response: unknown, ctx: DataBindingApiRequestContext) => Record<string, unknown>;
177
+ timeoutMs?: number;
178
+ onError?: (error: unknown, ctx: DataBindingApiRequestContext) => void;
179
+ }
180
+
181
+ export interface DataBindingPluginOptions {
182
+ data?: Record<string, unknown> | (() => Record<string, unknown> | Promise<Record<string, unknown>>);
183
+ getData?: (context: { editor: HTMLElement; editorRoot: HTMLElement }) => Record<string, unknown> | Promise<Record<string, unknown>>;
184
+ api?: DataBindingApiConfig;
185
+ cacheTtlMs?: number;
186
+ labels?: DataBindingLabels;
187
+ defaultFormat?: DataBindingFormat;
188
+ defaultFallback?: string;
189
+ locale?: string;
190
+ numberFormatOptions?: Intl.NumberFormatOptions;
191
+ dateFormatOptions?: Intl.DateTimeFormatOptions;
192
+ }
193
+
194
+ export type ContentRulesSeverity = "error" | "warning" | "info";
195
+
196
+ export interface ContentRuleIssue {
197
+ id: string;
198
+ ruleId: string;
199
+ severity: ContentRulesSeverity;
200
+ message: string;
201
+ excerpt?: string;
202
+ suggestion?: string;
203
+ locateText?: string;
204
+ selector?: string;
205
+ }
206
+
207
+ export interface ContentRulesLabels {
208
+ panelTitle?: string;
209
+ panelAriaLabel?: string;
210
+ runAuditText?: string;
211
+ realtimeOnText?: string;
212
+ realtimeOffText?: string;
213
+ closeText?: string;
214
+ noIssuesText?: string;
215
+ summaryPrefix?: string;
216
+ locateText?: string;
217
+ bannedWordMessage?: string;
218
+ requiredHeadingMessage?: string;
219
+ sentenceLengthMessage?: string;
220
+ readabilityMessage?: string;
221
+ }
222
+
223
+ export interface ContentRulesContext {
224
+ editor: HTMLElement;
225
+ editorRoot: HTMLElement;
226
+ text: string;
227
+ html: string;
228
+ wordCount: number;
229
+ sentenceCount: number;
230
+ readabilityScore: number;
231
+ }
232
+
233
+ export interface ContentRuleDefinition {
234
+ id: string;
235
+ severity?: ContentRulesSeverity;
236
+ evaluate: (context: ContentRulesContext) => ContentRuleIssue[] | Promise<ContentRuleIssue[]>;
237
+ }
238
+
239
+ export interface ContentRulesPluginOptions {
240
+ bannedWords?: string[];
241
+ requiredHeadings?: string[];
242
+ maxSentenceWords?: number;
243
+ minReadabilityScore?: number;
244
+ maxIssues?: number;
245
+ debounceMs?: number;
246
+ enableRealtime?: boolean;
247
+ labels?: ContentRulesLabels;
248
+ normalizeText?: (value: string) => string;
249
+ customRules?: ContentRuleDefinition[];
250
+ }
251
+
252
+ export type CitationStyle = "apa" | "mla" | "chicago";
253
+
254
+ export interface CitationRecord {
255
+ id: string;
256
+ author: string;
257
+ year?: string;
258
+ title: string;
259
+ source?: string;
260
+ url?: string;
261
+ note?: string;
262
+ }
263
+
264
+ export interface CitationInput {
265
+ id?: string;
266
+ author: string;
267
+ year?: string;
268
+ title: string;
269
+ source?: string;
270
+ url?: string;
271
+ note?: string;
272
+ }
273
+
274
+ export interface CitationsLabels {
275
+ panelTitle?: string;
276
+ panelAriaLabel?: string;
277
+ styleLabel?: string;
278
+ authorLabel?: string;
279
+ yearLabel?: string;
280
+ titleLabel?: string;
281
+ sourceLabel?: string;
282
+ urlLabel?: string;
283
+ noteLabel?: string;
284
+ insertText?: string;
285
+ refreshText?: string;
286
+ closeText?: string;
287
+ bibliographyTitle?: string;
288
+ footnotesTitle?: string;
289
+ noCitationsText?: string;
290
+ styleButtonPrefix?: string;
291
+ recentHeading?: string;
292
+ deleteRecentText?: string;
293
+ summaryPrefix?: string;
294
+ invalidMessage?: string;
295
+ }
296
+
297
+ export interface CitationsPluginOptions {
298
+ defaultStyle?: CitationStyle;
299
+ enableFootnoteSync?: boolean;
300
+ debounceMs?: number;
301
+ maxRecentCitations?: number;
302
+ labels?: CitationsLabels;
303
+ normalizeText?: (value: string) => string;
304
+ generateCitationId?: (context: { editor: HTMLElement; index: number }) => string;
305
+ }
306
+
307
+ export type ApprovalStatus = "draft" | "review" | "approved";
308
+
309
+ export interface ApprovalComment {
310
+ id: string;
311
+ author: string;
312
+ message: string;
313
+ kind: "comment" | "system";
314
+ createdAt: string;
315
+ }
316
+
317
+ export interface ApprovalSignoff {
318
+ id: string;
319
+ author: string;
320
+ comment?: string;
321
+ createdAt: string;
322
+ }
323
+
324
+ export interface ApprovalWorkflowState {
325
+ status: ApprovalStatus;
326
+ locked: boolean;
327
+ comments: ApprovalComment[];
328
+ signoffs: ApprovalSignoff[];
329
+ updatedAt: string;
330
+ }
331
+
332
+ export interface ApprovalWorkflowLabels {
333
+ panelTitle?: string;
334
+ panelAriaLabel?: string;
335
+ statusLabel?: string;
336
+ statusDraftText?: string;
337
+ statusReviewText?: string;
338
+ statusApprovedText?: string;
339
+ requestReviewText?: string;
340
+ approveText?: string;
341
+ reopenDraftText?: string;
342
+ addCommentText?: string;
343
+ actorLabel?: string;
344
+ actorPlaceholder?: string;
345
+ commentLabel?: string;
346
+ commentPlaceholder?: string;
347
+ closeText?: string;
348
+ commentsHeading?: string;
349
+ signoffsHeading?: string;
350
+ noCommentsText?: string;
351
+ noSignoffsText?: string;
352
+ summaryPrefix?: string;
353
+ lockedSuffix?: string;
354
+ shortcutText?: string;
355
+ approveCommentRequiredText?: string;
356
+ }
357
+
358
+ export interface ApprovalWorkflowPluginOptions {
359
+ defaultStatus?: ApprovalStatus;
360
+ lockOnApproval?: boolean;
361
+ maxHistoryEntries?: number;
362
+ requireCommentOnApprove?: boolean;
363
+ defaultActor?: string;
364
+ labels?: ApprovalWorkflowLabels;
365
+ normalizeText?: (value: string) => string;
366
+ }
367
+
368
+ export type PIIRedactionType = "email" | "phone" | "ssn" | "credit-card" | "ipv4" | "api-key" | "jwt";
369
+ export type PIIRedactionSeverity = "high" | "medium" | "low";
370
+ export type PIIRedactionMode = "token" | "mask";
371
+
372
+ export interface PIIFinding {
373
+ id: string;
374
+ type: PIIRedactionType;
375
+ severity: PIIRedactionSeverity;
376
+ match: string;
377
+ masked: string;
378
+ occurrence: number;
379
+ excerpt?: string;
380
+ suggestion?: string;
381
+ }
382
+
383
+ export interface PIIRedactionStats {
384
+ total: number;
385
+ high: number;
386
+ medium: number;
387
+ low: number;
388
+ redactedCount: number;
389
+ byType: Record<PIIRedactionType, number>;
390
+ }
391
+
392
+ export interface PIIRedactionLabels {
393
+ panelTitle?: string;
394
+ panelAriaLabel?: string;
395
+ scanText?: string;
396
+ redactAllText?: string;
397
+ redactText?: string;
398
+ locateText?: string;
399
+ realtimeOnText?: string;
400
+ realtimeOffText?: string;
401
+ closeText?: string;
402
+ noFindingsText?: string;
403
+ summaryPrefix?: string;
404
+ shortcutText?: string;
405
+ readonlyRedactionText?: string;
406
+ matchLabel?: string;
407
+ maskedLabel?: string;
408
+ excerptLabel?: string;
409
+ }
410
+
411
+ export interface PIIRedactionDetectorConfig {
412
+ enabled?: boolean;
413
+ severity?: PIIRedactionSeverity;
414
+ pattern?: RegExp;
415
+ }
416
+
417
+ export interface PIIRedactionPluginOptions {
418
+ enableRealtime?: boolean;
419
+ debounceMs?: number;
420
+ maxFindings?: number;
421
+ maskChar?: string;
422
+ revealStart?: number;
423
+ revealEnd?: number;
424
+ redactionMode?: PIIRedactionMode;
425
+ redactionToken?: string;
426
+ detectors?: Partial<Record<PIIRedactionType, boolean | PIIRedactionDetectorConfig>>;
427
+ labels?: PIIRedactionLabels;
428
+ normalizeText?: (value: string) => string;
429
+ skipInCodeBlocks?: boolean;
430
+ }
431
+
432
+ export type SmartPasteProfile = "fidelity" | "balanced" | "plain";
433
+ export type SmartPasteSource = "word" | "google-docs" | "html" | "plain";
434
+
435
+ export interface SmartPasteLabels {
436
+ panelTitle?: string;
437
+ panelAriaLabel?: string;
438
+ enabledText?: string;
439
+ disabledText?: string;
440
+ toggleOnText?: string;
441
+ toggleOffText?: string;
442
+ cycleProfileText?: string;
443
+ profileLabel?: string;
444
+ fidelityText?: string;
445
+ balancedText?: string;
446
+ plainText?: string;
447
+ lastPasteHeading?: string;
448
+ lastPasteEmptyText?: string;
449
+ lastPasteSourceLabel?: string;
450
+ lastPasteProfileLabel?: string;
451
+ lastPasteRemovedLabel?: string;
452
+ lastPasteCharsLabel?: string;
453
+ closeText?: string;
454
+ shortcutText?: string;
455
+ readonlyMessage?: string;
456
+ }
457
+
458
+ export interface SmartPasteProfileOptions {
459
+ keepStyles?: boolean;
460
+ keepClasses?: boolean;
461
+ keepDataAttributes?: boolean;
462
+ preserveTables?: boolean;
463
+ }
464
+
465
+ export interface SmartPastePluginOptions {
466
+ enabled?: boolean;
467
+ defaultProfile?: SmartPasteProfile;
468
+ maxHtmlLength?: number;
469
+ removeComments?: boolean;
470
+ normalizeWhitespace?: boolean;
471
+ profileOptions?: Partial<Record<SmartPasteProfile, SmartPasteProfileOptions>>;
472
+ labels?: SmartPasteLabels;
473
+ normalizeText?: (value: string) => string;
474
+ }
475
+
476
+ export interface SmartPasteReport {
477
+ source: SmartPasteSource;
478
+ profile: SmartPasteProfile;
479
+ inputHtmlLength: number;
480
+ outputHtmlLength: number;
481
+ outputTextLength: number;
482
+ removedElements: number;
483
+ removedAttributes: number;
484
+ removedComments: number;
485
+ normalizedStyles: number;
486
+ createdAt: string;
487
+ }
488
+
489
+ export interface BlocksLibraryItem {
490
+ id: string;
491
+ label: string;
492
+ html: string;
493
+ description?: string;
494
+ category?: string;
495
+ tags?: string[];
496
+ keywords?: string[];
497
+ }
498
+
499
+ export interface BlocksLibraryItemInput {
500
+ id?: string;
501
+ label: string;
502
+ html: string;
503
+ description?: string;
504
+ category?: string;
505
+ tags?: string[];
506
+ keywords?: string[];
507
+ }
508
+
509
+ export interface BlocksLibraryLabels {
510
+ panelTitle?: string;
511
+ panelAriaLabel?: string;
512
+ searchLabel?: string;
513
+ searchPlaceholder?: string;
514
+ categoryLabel?: string;
515
+ allCategoriesText?: string;
516
+ recentHeading?: string;
517
+ insertText?: string;
518
+ closeText?: string;
519
+ noResultsText?: string;
520
+ summaryPrefix?: string;
521
+ loadingText?: string;
522
+ loadErrorText?: string;
523
+ readonlyMessage?: string;
524
+ shortcutText?: string;
525
+ helperText?: string;
526
+ lastInsertedPrefix?: string;
527
+ resultsListLabel?: string;
528
+ }
529
+
530
+ export interface BlocksLibraryRequestContext {
531
+ editor: HTMLElement;
532
+ editorRoot: HTMLElement;
533
+ signal: AbortSignal;
534
+ }
535
+
536
+ export interface BlocksLibraryPluginOptions {
537
+ blocks?: BlocksLibraryItemInput[];
538
+ defaultCategory?: string;
539
+ maxResults?: number;
540
+ maxRecentBlocks?: number;
541
+ debounceMs?: number;
542
+ cacheTtlMs?: number;
543
+ labels?: BlocksLibraryLabels;
544
+ normalizeText?: (value: string) => string;
545
+ sanitizeBlockHtml?: (html: string, block: BlocksLibraryItemInput) => string;
546
+ getBlocks?: (
547
+ context: BlocksLibraryRequestContext,
548
+ ) => BlocksLibraryItemInput[] | Promise<BlocksLibraryItemInput[]>;
549
+ }
550
+
551
+ export interface BlocksLibraryRuntimeState {
552
+ query: string;
553
+ category: string;
554
+ selectedBlockId: string | null;
555
+ totalMatches: number;
556
+ visibleMatches: number;
557
+ recentBlockIds: string[];
558
+ lastInsertedBlockId: string | null;
559
+ loading: boolean;
560
+ loadError: string | null;
561
+ }
562
+
563
+ export type DocSchemaIssueType = "missing-section" | "duplicate-section" | "out-of-order" | "unknown-heading";
564
+ export type DocSchemaIssueSeverity = "error" | "warning" | "info";
565
+
566
+ export interface DocSchemaIssue {
567
+ id: string;
568
+ type: DocSchemaIssueType;
569
+ severity: DocSchemaIssueSeverity;
570
+ message: string;
571
+ sectionId?: string;
572
+ sectionTitle?: string;
573
+ headingText?: string;
574
+ suggestion?: string;
575
+ }
576
+
577
+ export interface DocSchemaSection {
578
+ id?: string;
579
+ title: string;
580
+ aliases?: string[];
581
+ minOccurrences?: number;
582
+ maxOccurrences?: number;
583
+ placeholder?: string;
584
+ }
585
+
586
+ export interface DocSchemaDefinition {
587
+ id?: string;
588
+ label: string;
589
+ description?: string;
590
+ strictOrder?: boolean;
591
+ allowUnknownHeadings?: boolean;
592
+ sections: DocSchemaSection[];
593
+ }
594
+
595
+ export interface DocSchemaLabels {
596
+ panelTitle?: string;
597
+ panelAriaLabel?: string;
598
+ schemaLabel?: string;
599
+ schemaDescriptionPrefix?: string;
600
+ validateText?: string;
601
+ insertMissingText?: string;
602
+ realtimeOnText?: string;
603
+ realtimeOffText?: string;
604
+ closeText?: string;
605
+ noIssuesText?: string;
606
+ summaryPrefix?: string;
607
+ issueListLabel?: string;
608
+ shortcutText?: string;
609
+ helperText?: string;
610
+ readonlyMessage?: string;
611
+ defaultPlaceholderText?: string;
612
+ missingSectionMessage?: string;
613
+ duplicateSectionMessage?: string;
614
+ outOfOrderMessage?: string;
615
+ unknownHeadingMessage?: string;
616
+ insertedSummaryPrefix?: string;
617
+ }
618
+
619
+ export interface DocSchemaPluginOptions {
620
+ schemas?: DocSchemaDefinition[];
621
+ defaultSchemaId?: string;
622
+ enableRealtime?: boolean;
623
+ debounceMs?: number;
624
+ maxIssues?: number;
625
+ labels?: DocSchemaLabels;
626
+ normalizeText?: (value: string) => string;
627
+ }
628
+
629
+ export interface DocSchemaRuntimeState {
630
+ activeSchemaId: string | null;
631
+ activeSchemaLabel: string | null;
632
+ realtimeEnabled: boolean;
633
+ issues: DocSchemaIssue[];
634
+ headingCount: number;
635
+ recognizedHeadingCount: number;
636
+ missingCount: number;
637
+ lastRunAt: string | null;
638
+ }
639
+
640
+ export type TranslationWorkflowIssueType =
641
+ | "missing-target"
642
+ | "token-mismatch"
643
+ | "untranslated"
644
+ | "length-out-of-range";
645
+ export type TranslationWorkflowIssueSeverity = "error" | "warning" | "info";
646
+
647
+ export interface TranslationWorkflowIssue {
648
+ id: string;
649
+ type: TranslationWorkflowIssueType;
650
+ severity: TranslationWorkflowIssueSeverity;
651
+ message: string;
652
+ segmentId?: string;
653
+ sourceText?: string;
654
+ targetText?: string;
655
+ suggestion?: string;
656
+ }
657
+
658
+ export interface TranslationWorkflowSegment {
659
+ id: string;
660
+ tagName: string;
661
+ index: number;
662
+ text: string;
663
+ sourceText: string;
664
+ locked: boolean;
665
+ }
666
+
667
+ export interface TranslationWorkflowSegmentState {
668
+ id: string;
669
+ tagName: string;
670
+ index: number;
671
+ sourceLength: number;
672
+ targetLength: number;
673
+ locked: boolean;
674
+ }
675
+
676
+ export interface TranslationWorkflowLocaleRule {
677
+ locale: string;
678
+ label?: string;
679
+ minLengthRatio?: number;
680
+ maxLengthRatio?: number;
681
+ requireDifferentFromSource?: boolean;
682
+ preserveTokens?: boolean;
683
+ }
684
+
685
+ export interface TranslationWorkflowLabels {
686
+ panelTitle?: string;
687
+ panelAriaLabel?: string;
688
+ sourceLocaleLabel?: string;
689
+ targetLocaleLabel?: string;
690
+ validateText?: string;
691
+ captureSourceText?: string;
692
+ lockSelectedText?: string;
693
+ unlockSelectedText?: string;
694
+ lockSegmentAriaLabel?: string;
695
+ unlockSegmentAriaLabel?: string;
696
+ realtimeOnText?: string;
697
+ realtimeOffText?: string;
698
+ closeText?: string;
699
+ summaryPrefix?: string;
700
+ noIssuesText?: string;
701
+ issuesLabel?: string;
702
+ segmentsLabel?: string;
703
+ sourcePreviewLabel?: string;
704
+ targetPreviewLabel?: string;
705
+ helperText?: string;
706
+ shortcutText?: string;
707
+ readonlySegmentMessage?: string;
708
+ sourceCapturedMessage?: string;
709
+ selectedSegmentPrefix?: string;
710
+ missingTargetMessage?: string;
711
+ tokenMismatchMessage?: string;
712
+ untranslatedMessage?: string;
713
+ lengthOutOfRangeMessage?: string;
714
+ }
715
+
716
+ export interface TranslationWorkflowPluginOptions {
717
+ sourceLocale?: string;
718
+ targetLocale?: string;
719
+ locales?: string[];
720
+ localeRules?: TranslationWorkflowLocaleRule[];
721
+ enableRealtime?: boolean;
722
+ debounceMs?: number;
723
+ maxIssues?: number;
724
+ maxSegments?: number;
725
+ minSourceLengthForRatio?: number;
726
+ segmentSelector?: string;
727
+ labels?: TranslationWorkflowLabels;
728
+ normalizeText?: (value: string) => string;
729
+ }
730
+
731
+ export interface TranslationWorkflowRuntimeState {
732
+ sourceLocale: string;
733
+ targetLocale: string;
734
+ realtimeEnabled: boolean;
735
+ selectedSegmentId: string | null;
736
+ segmentCount: number;
737
+ lockedSegmentCount: number;
738
+ issues: TranslationWorkflowIssue[];
739
+ segments: TranslationWorkflowSegmentState[];
740
+ lastRunAt: string | null;
741
+ }
742
+
743
+ export interface MentionItem {
744
+ id: string;
745
+ label: string;
746
+ value?: string;
747
+ meta?: string;
748
+ }
749
+
750
+ export interface MentionApiRequestContext {
751
+ query: string;
752
+ trigger: string;
753
+ limit: number;
754
+ signal: AbortSignal;
755
+ }
756
+
757
+ export interface MentionApiConfig {
758
+ url: string;
759
+ method?: string;
760
+ headers?: Record<string, string> | ((ctx: MentionApiRequestContext) => Record<string, string>);
761
+ credentials?: RequestCredentials;
762
+ mode?: RequestMode;
763
+ cache?: RequestCache;
764
+ queryParam?: string;
765
+ triggerParam?: string;
766
+ limitParam?: string;
767
+ staticParams?: Record<string, string>;
768
+ body?: Record<string, unknown> | BodyInit | ((ctx: MentionApiRequestContext) => Record<string, unknown> | BodyInit | undefined);
769
+ buildRequest?: (ctx: MentionApiRequestContext) => { url: string; init?: RequestInit };
770
+ responseType?: "json" | "text";
771
+ responsePath?: string;
772
+ mapItem?: (raw: unknown, index: number) => MentionItem | null;
773
+ transformResponse?: (response: unknown, ctx: MentionApiRequestContext) => MentionItem[];
774
+ debounceMs?: number;
775
+ timeoutMs?: number;
776
+ onError?: (error: unknown, ctx: MentionApiRequestContext) => void;
777
+ }
778
+
779
+ export interface MentionPluginOptions {
780
+ triggerChars?: string[];
781
+ minChars?: number;
782
+ maxQueryLength?: number;
783
+ maxSuggestions?: number;
784
+ items?: MentionItem[];
785
+ api?: MentionApiConfig;
786
+ search?: (query: string, trigger: string) => MentionItem[] | Promise<MentionItem[]>;
787
+ itemRenderer?: (item: MentionItem, query: string) => string;
788
+ emptyStateText?: string;
789
+ noResultsText?: string;
790
+ loadingText?: string;
791
+ insertSpaceAfterMention?: boolean;
792
+ }
793
+
794
+ export interface SlashCommandActionContext {
795
+ editor: HTMLElement;
796
+ editorRoot: HTMLElement;
797
+ query: string;
798
+ trigger: string;
799
+ executeCommand: (command: string, value?: any) => boolean;
800
+ insertHTML: (html: string) => boolean;
801
+ }
802
+
803
+ export interface SlashCommandItem {
804
+ id: string;
805
+ label: string;
806
+ description?: string;
807
+ keywords?: string[];
808
+ command?: string;
809
+ commandValue?: any;
810
+ insertHTML?: string;
811
+ action?: (context: SlashCommandActionContext) => boolean | void | Promise<boolean | void>;
812
+ }
813
+
814
+ export interface SlashCommandsPluginOptions {
815
+ triggerChar?: string;
816
+ minChars?: number;
817
+ maxQueryLength?: number;
818
+ maxSuggestions?: number;
819
+ requireBoundary?: boolean;
820
+ includeDefaultItems?: boolean;
821
+ items?: SlashCommandItem[];
822
+ itemRenderer?: (item: SlashCommandItem, query: string) => string;
823
+ emptyStateText?: string;
824
+ panelLabel?: string;
825
+ }
826
+
827
+ export interface Template {
828
+ id: string;
829
+ name: string;
830
+ category: string;
831
+ html: string;
832
+ description?: string;
833
+ preview?: string;
834
+ tags?: string[];
835
+ }
836
+
11
837
  export function HeadingPlugin(): Plugin;
12
838
  export function BoldPlugin(): Plugin;
13
839
  export function ItalicPlugin(): Plugin;
@@ -35,6 +861,20 @@ export function SpecialCharactersPlugin(): Plugin;
35
861
  export function EmojisPlugin(): Plugin;
36
862
  export function EmbedIframePlugin(): Plugin;
37
863
  export function AnchorPlugin(): Plugin;
864
+ export function MentionPlugin(options?: MentionPluginOptions): Plugin;
865
+ export function TrackChangesPlugin(options?: TrackChangesPluginOptions): Plugin;
866
+ export function VersionDiffPlugin(options?: VersionDiffPluginOptions): Plugin;
867
+ export function ConditionalContentPlugin(options?: ConditionalContentPluginOptions): Plugin;
868
+ export function DataBindingPlugin(options?: DataBindingPluginOptions): Plugin;
869
+ export function ContentRulesPlugin(options?: ContentRulesPluginOptions): Plugin;
870
+ export function CitationsPlugin(options?: CitationsPluginOptions): Plugin;
871
+ export function ApprovalWorkflowPlugin(options?: ApprovalWorkflowPluginOptions): Plugin;
872
+ export function PIIRedactionPlugin(options?: PIIRedactionPluginOptions): Plugin;
873
+ export function SmartPastePlugin(options?: SmartPastePluginOptions): Plugin;
874
+ export function BlocksLibraryPlugin(options?: BlocksLibraryPluginOptions): Plugin;
875
+ export function DocSchemaPlugin(options?: DocSchemaPluginOptions): Plugin;
876
+ export function TranslationWorkflowPlugin(options?: TranslationWorkflowPluginOptions): Plugin;
877
+ export function SlashCommandsPlugin(options?: SlashCommandsPluginOptions): Plugin;
38
878
 
39
879
  export function MediaManagerPlugin(): Plugin;
40
880
  export function setMediaManagerConfig(config: Partial<MediaManagerConfig>): void;
@@ -50,8 +890,16 @@ export function PrintPlugin(): Plugin;
50
890
  export function PageBreakPlugin(): Plugin;
51
891
  export function FootnotePlugin(): Plugin;
52
892
  export function CodeSamplePlugin(): Plugin;
53
- export function MergeTagPlugin(): Plugin;
893
+ export function MergeTagPlugin(options?: MergeTagPluginOptions): Plugin;
54
894
  export function TemplatePlugin(): Plugin;
895
+ export const PREDEFINED_TEMPLATES: Template[];
896
+ export function addCustomTemplate(template: Template): boolean;
897
+ export function getAllTemplates(): Template[];
898
+ export function getTemplatesByCategory(category: string): Template[];
899
+ export function getTemplateCategories(): string[];
900
+ export function searchTemplates(query: string): Template[];
901
+ export function sanitizeTemplate(html: string): string;
902
+ export function validateTemplate(template: Template): boolean;
55
903
  export function CommentsPlugin(): Plugin;
56
904
  export function SpellCheckPlugin(): Plugin;
57
905
  export function A11yCheckerPlugin(): Plugin;