@thescaffold/editor-addons 0.0.0

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.
@@ -0,0 +1,864 @@
1
+ import { AddonDefinition, EditorContext, AddonInstance, SchemaContext, CollabConfig, Addon } from '@thescaffold/editor-core';
2
+
3
+ declare function CommandsAddon(): AddonDefinition;
4
+ declare const CommandsAddonImpl: {
5
+ id: string;
6
+ init(ctx: EditorContext): AddonInstance;
7
+ };
8
+
9
+ declare function HistoryAddon(): AddonDefinition;
10
+ declare const HistoryAddonImpl: {
11
+ id: string;
12
+ init(ctx: EditorContext): AddonInstance;
13
+ };
14
+
15
+ declare function InputRulesAddon(): AddonDefinition;
16
+ declare const InputRulesAddonImpl: {
17
+ id: string;
18
+ init(_ctx: EditorContext): AddonInstance;
19
+ };
20
+
21
+ interface KeymapAddonConfig {
22
+ overrides?: Record<string, string>;
23
+ disabled?: string[];
24
+ }
25
+ declare function KeymapAddon(config?: KeymapAddonConfig): AddonDefinition<KeymapAddonConfig>;
26
+ declare const KeymapAddonImpl: {
27
+ id: string;
28
+ init(ctx: EditorContext, config?: KeymapAddonConfig): AddonInstance;
29
+ };
30
+
31
+ interface SchemaAddonConfig {
32
+ nodes?: string[];
33
+ marks?: string[];
34
+ }
35
+ declare function SchemaAddon(config?: SchemaAddonConfig): AddonDefinition<SchemaAddonConfig>;
36
+ declare const SchemaAddonImpl: {
37
+ id: string;
38
+ initSchema(ctx: SchemaContext, _config?: SchemaAddonConfig): void;
39
+ init(_ctx: EditorContext, _config?: SchemaAddonConfig): AddonInstance;
40
+ };
41
+
42
+ declare function BoldAddon(): AddonDefinition;
43
+ declare const BoldAddonImpl: {
44
+ id: string;
45
+ initSchema(ctx: SchemaContext): void;
46
+ init(ctx: EditorContext): AddonInstance;
47
+ };
48
+ declare function ItalicAddon(): AddonDefinition;
49
+ declare const ItalicAddonImpl: {
50
+ id: string;
51
+ initSchema(ctx: SchemaContext): void;
52
+ init(ctx: EditorContext): AddonInstance;
53
+ };
54
+ declare function UnderlineAddon(): AddonDefinition;
55
+ declare const UnderlineAddonImpl: {
56
+ id: string;
57
+ initSchema(ctx: SchemaContext): void;
58
+ init(ctx: EditorContext): AddonInstance;
59
+ };
60
+ declare function StrikethroughAddon(): AddonDefinition;
61
+ declare const StrikethroughAddonImpl: {
62
+ id: string;
63
+ initSchema(ctx: SchemaContext): void;
64
+ init(ctx: EditorContext): AddonInstance;
65
+ };
66
+ declare function InlineCodeAddon(): AddonDefinition;
67
+ declare const InlineCodeAddonImpl: {
68
+ id: string;
69
+ initSchema(ctx: SchemaContext): void;
70
+ init(ctx: EditorContext): AddonInstance;
71
+ };
72
+ declare function SubscriptAddon(): AddonDefinition;
73
+ declare const SubscriptAddonImpl: {
74
+ id: string;
75
+ initSchema(ctx: SchemaContext): void;
76
+ init(ctx: EditorContext): AddonInstance;
77
+ };
78
+ declare function SuperscriptAddon(): AddonDefinition;
79
+ declare const SuperscriptAddonImpl: {
80
+ id: string;
81
+ initSchema(ctx: SchemaContext): void;
82
+ init(ctx: EditorContext): AddonInstance;
83
+ };
84
+ interface HighlightAddonConfig {
85
+ colors?: string[];
86
+ defaultColor?: string;
87
+ }
88
+ declare function HighlightAddon(config?: HighlightAddonConfig): AddonDefinition<HighlightAddonConfig>;
89
+ declare const HighlightAddonImpl: {
90
+ id: string;
91
+ initSchema(ctx: SchemaContext): void;
92
+ init(ctx: EditorContext, config?: HighlightAddonConfig): AddonInstance;
93
+ };
94
+ interface TextColorAddonConfig {
95
+ colors?: string[];
96
+ defaultColor?: string;
97
+ }
98
+ declare function TextColorAddon(config?: TextColorAddonConfig): AddonDefinition<TextColorAddonConfig>;
99
+ declare const TextColorAddonImpl: {
100
+ id: string;
101
+ initSchema(ctx: SchemaContext): void;
102
+ init(ctx: EditorContext, config?: TextColorAddonConfig): AddonInstance;
103
+ };
104
+ interface FontFamilyAddonConfig {
105
+ families: {
106
+ label: string;
107
+ value: string;
108
+ }[];
109
+ }
110
+ declare function FontFamilyAddon(config: FontFamilyAddonConfig): AddonDefinition<FontFamilyAddonConfig>;
111
+ declare const FontFamilyAddonImpl: {
112
+ id: string;
113
+ initSchema(ctx: SchemaContext): void;
114
+ init(ctx: EditorContext): AddonInstance;
115
+ };
116
+ interface FontSizeAddonConfig {
117
+ sizes?: string[];
118
+ defaultSize?: string;
119
+ }
120
+ declare function FontSizeAddon(config?: FontSizeAddonConfig): AddonDefinition<FontSizeAddonConfig>;
121
+ declare const FontSizeAddonImpl: {
122
+ id: string;
123
+ initSchema(ctx: SchemaContext): void;
124
+ init(ctx: EditorContext): AddonInstance;
125
+ };
126
+ declare function ClearFormattingAddon(): AddonDefinition;
127
+ declare const ClearFormattingAddonImpl: {
128
+ id: string;
129
+ init(ctx: EditorContext): AddonInstance;
130
+ };
131
+
132
+ declare function AlignmentAddon(): AddonDefinition;
133
+ declare const AlignmentAddonImpl: {
134
+ id: string;
135
+ init(ctx: EditorContext): AddonInstance;
136
+ };
137
+ interface LineHeightAddonConfig {
138
+ options?: number[];
139
+ }
140
+ declare function LineHeightAddon(config?: LineHeightAddonConfig): AddonDefinition<LineHeightAddonConfig>;
141
+ declare const LineHeightAddonImpl: {
142
+ id: string;
143
+ init(ctx: EditorContext): AddonInstance;
144
+ };
145
+ declare function ParagraphSpacingAddon(): AddonDefinition;
146
+ declare const ParagraphSpacingAddonImpl: {
147
+ id: string;
148
+ init(ctx: EditorContext): AddonInstance;
149
+ };
150
+ declare function IndentAddon(): AddonDefinition;
151
+ declare const IndentAddonImpl: {
152
+ id: string;
153
+ init(ctx: EditorContext): AddonInstance;
154
+ };
155
+
156
+ declare function HeadingsAddon(): AddonDefinition;
157
+ declare const HeadingsAddonImpl: {
158
+ id: string;
159
+ initSchema(ctx: SchemaContext): void;
160
+ init(ctx: EditorContext): AddonInstance;
161
+ };
162
+ declare function BlockquoteAddon(): AddonDefinition;
163
+ declare const BlockquoteAddonImpl: {
164
+ id: string;
165
+ initSchema(ctx: SchemaContext): void;
166
+ init(ctx: EditorContext): AddonInstance;
167
+ };
168
+ declare function DividerAddon(): AddonDefinition;
169
+ declare const DividerAddonImpl: {
170
+ id: string;
171
+ initSchema(ctx: SchemaContext): void;
172
+ init(ctx: EditorContext): AddonInstance;
173
+ };
174
+ declare function PageBreakAddon(): AddonDefinition;
175
+ declare const PageBreakAddonImpl: {
176
+ id: string;
177
+ initSchema(ctx: SchemaContext): void;
178
+ init(ctx: EditorContext): AddonInstance;
179
+ };
180
+ type CalloutType = "info" | "success" | "warning" | "error" | "tip" | "note";
181
+ interface CalloutAddonConfig {
182
+ types?: CalloutType[];
183
+ }
184
+ declare function CalloutAddon(config?: CalloutAddonConfig): AddonDefinition<CalloutAddonConfig>;
185
+ declare const CalloutAddonImpl: {
186
+ id: string;
187
+ initSchema(ctx: SchemaContext): void;
188
+ init(ctx: EditorContext, config?: CalloutAddonConfig): AddonInstance;
189
+ };
190
+ declare function DetailsAddon(): AddonDefinition;
191
+ declare const DetailsAddonImpl: {
192
+ id: string;
193
+ initSchema(ctx: SchemaContext): void;
194
+ init(ctx: EditorContext): AddonInstance;
195
+ };
196
+ interface ColumnsAddonConfig {
197
+ maxColumns?: number;
198
+ ratios?: string[];
199
+ }
200
+ declare function ColumnsAddon(config?: ColumnsAddonConfig): AddonDefinition<ColumnsAddonConfig>;
201
+ declare const ColumnsAddonImpl: {
202
+ id: string;
203
+ initSchema(ctx: SchemaContext): void;
204
+ init(ctx: EditorContext, config?: ColumnsAddonConfig): AddonInstance;
205
+ };
206
+ interface CodeBlockAddonConfig {
207
+ languages?: string[];
208
+ defaultLanguage?: string;
209
+ lineNumbers?: boolean;
210
+ lineWrapping?: boolean;
211
+ }
212
+ declare function CodeBlockAddon(config?: CodeBlockAddonConfig): AddonDefinition<CodeBlockAddonConfig>;
213
+ declare const CodeBlockAddonImpl: {
214
+ id: string;
215
+ initSchema(ctx: SchemaContext): void;
216
+ init(ctx: EditorContext): AddonInstance;
217
+ };
218
+
219
+ declare function BulletListAddon(): AddonDefinition;
220
+ declare const BulletListAddonImpl: {
221
+ id: string;
222
+ initSchema(ctx: SchemaContext): void;
223
+ init(ctx: EditorContext): AddonInstance;
224
+ };
225
+ declare function OrderedListAddon(): AddonDefinition;
226
+ declare const OrderedListAddonImpl: {
227
+ id: string;
228
+ initSchema(ctx: SchemaContext): void;
229
+ init(ctx: EditorContext): AddonInstance;
230
+ };
231
+ declare function TaskListAddon(): AddonDefinition;
232
+ declare const TaskListAddonImpl: {
233
+ id: string;
234
+ initSchema(ctx: SchemaContext): void;
235
+ init(ctx: EditorContext): AddonInstance;
236
+ };
237
+ declare function ToggleListAddon(): AddonDefinition;
238
+ declare const ToggleListAddonImpl: {
239
+ id: string;
240
+ initSchema(ctx: SchemaContext): void;
241
+ init(ctx: EditorContext): AddonInstance;
242
+ };
243
+ declare function ListsAddon(): AddonDefinition[];
244
+
245
+ interface TableAddonConfig {
246
+ /**
247
+ * For full cell-selection, Tab navigation, and column resize handles you
248
+ * need prosemirror-tables' `tableEditing()` and (optionally)
249
+ * `columnResizing()` plugins. Inject them at editor construction via
250
+ * `EditorConfig.extraPlugins`:
251
+ *
252
+ * ```ts
253
+ * import { tableEditing, columnResizing } from 'prosemirror-tables';
254
+ *
255
+ * el.config = {
256
+ * addons: [TableAddon(), ...others],
257
+ * extraPlugins: [columnResizing({}), tableEditing()],
258
+ * };
259
+ * ```
260
+ *
261
+ * The flag is kept on the config for API symmetry with prior versions and
262
+ * for downstream tooling that wants to flip a single switch — at runtime
263
+ * the editor itself doesn't read it, the user owns the plugin list.
264
+ */
265
+ resizable?: boolean;
266
+ /** Soft cap on cols inserted via insertTable. Default 20. */
267
+ maxCols?: number;
268
+ /** Soft cap on rows inserted via insertTable. Default 100. */
269
+ maxRows?: number;
270
+ }
271
+ declare function TableAddon(config?: TableAddonConfig): AddonDefinition<TableAddonConfig>;
272
+ declare const TableAddonImpl: {
273
+ id: string;
274
+ initSchema(ctx: SchemaContext): void;
275
+ init(ctx: EditorContext, config?: TableAddonConfig): AddonInstance;
276
+ };
277
+
278
+ interface ImageAddonConfig {
279
+ upload: (file: File) => Promise<string>;
280
+ maxSizeMB?: number;
281
+ allowedTypes?: string[];
282
+ defaultAlign?: "left" | "center" | "right" | "full";
283
+ }
284
+ declare function ImageAddon(config: ImageAddonConfig): AddonDefinition<ImageAddonConfig>;
285
+ declare const ImageAddonImpl: {
286
+ id: string;
287
+ initSchema(ctx: SchemaContext): void;
288
+ init(ctx: EditorContext): AddonInstance;
289
+ };
290
+ interface VideoAddonConfig {
291
+ upload?: (file: File) => Promise<string>;
292
+ providers?: ("youtube" | "vimeo" | "loom")[];
293
+ }
294
+ declare function VideoAddon(config?: VideoAddonConfig): AddonDefinition<VideoAddonConfig>;
295
+ declare const VideoAddonImpl: {
296
+ id: string;
297
+ initSchema(ctx: SchemaContext): void;
298
+ init(ctx: EditorContext): AddonInstance;
299
+ };
300
+ interface AudioAddonConfig {
301
+ upload?: (file: File) => Promise<string>;
302
+ }
303
+ declare function AudioAddon(config?: AudioAddonConfig): AddonDefinition<AudioAddonConfig>;
304
+ declare const AudioAddonImpl: {
305
+ id: string;
306
+ initSchema(ctx: SchemaContext): void;
307
+ init(ctx: EditorContext): AddonInstance;
308
+ };
309
+ interface FileAddonConfig {
310
+ upload: (file: File) => Promise<{
311
+ url: string;
312
+ name: string;
313
+ size: number;
314
+ mimeType: string;
315
+ }>;
316
+ maxSizeMB?: number;
317
+ }
318
+ declare function FileAddon(config: FileAddonConfig): AddonDefinition<FileAddonConfig>;
319
+ declare const FileAddonImpl: {
320
+ id: string;
321
+ initSchema(ctx: SchemaContext): void;
322
+ init(ctx: EditorContext): AddonInstance;
323
+ };
324
+ interface EmbedProvider {
325
+ id: string;
326
+ name: string;
327
+ match: RegExp;
328
+ toEmbedUrl: (url: string) => string;
329
+ }
330
+ interface EmbedAddonConfig {
331
+ providers?: EmbedProvider[];
332
+ allowedDomains?: string[];
333
+ }
334
+ declare function EmbedAddon(config?: EmbedAddonConfig): AddonDefinition<EmbedAddonConfig>;
335
+ declare const EmbedAddonImpl: {
336
+ id: string;
337
+ initSchema(ctx: SchemaContext): void;
338
+ init(ctx: EditorContext): AddonInstance;
339
+ };
340
+ interface OGMetadata {
341
+ title?: string;
342
+ description?: string;
343
+ image?: string;
344
+ favicon?: string;
345
+ url: string;
346
+ }
347
+ interface BookmarkAddonConfig {
348
+ fetchMetadata: (url: string) => Promise<OGMetadata>;
349
+ }
350
+ declare function BookmarkAddon(config: BookmarkAddonConfig): AddonDefinition<BookmarkAddonConfig>;
351
+ declare const BookmarkAddonImpl: {
352
+ id: string;
353
+ initSchema(ctx: SchemaContext): void;
354
+ init(ctx: EditorContext): AddonInstance;
355
+ };
356
+
357
+ interface LinkAddonConfig {
358
+ autoLink?: boolean;
359
+ defaultTarget?: "_blank" | "_self";
360
+ validate?: (url: string) => boolean;
361
+ }
362
+ declare function LinkAddon(config?: LinkAddonConfig): AddonDefinition<LinkAddonConfig>;
363
+ declare const LinkAddonImpl: {
364
+ id: string;
365
+ initSchema(ctx: SchemaContext): void;
366
+ init(ctx: EditorContext, config?: LinkAddonConfig): AddonInstance;
367
+ };
368
+ interface MentionItem {
369
+ id: string;
370
+ label: string;
371
+ [key: string]: unknown;
372
+ }
373
+ interface MentionType {
374
+ id: string;
375
+ trigger?: string;
376
+ search(query: string): Promise<MentionItem[]>;
377
+ renderItem?: (item: MentionItem) => HTMLElement;
378
+ renderNode?: (item: MentionItem) => HTMLElement;
379
+ }
380
+ interface MentionAddonConfig {
381
+ trigger?: string;
382
+ types: MentionType[];
383
+ }
384
+ declare function MentionAddon(config: MentionAddonConfig): AddonDefinition<MentionAddonConfig>;
385
+ declare const MentionAddonImpl: {
386
+ id: string;
387
+ initSchema(ctx: SchemaContext): void;
388
+ init(ctx: EditorContext): AddonInstance;
389
+ };
390
+ interface EmojiAddonConfig {
391
+ trigger?: string;
392
+ skinTone?: number;
393
+ }
394
+ declare function EmojiAddon(config?: EmojiAddonConfig): AddonDefinition<EmojiAddonConfig>;
395
+ declare const EmojiAddonImpl: {
396
+ id: string;
397
+ initSchema(ctx: SchemaContext): void;
398
+ init(ctx: EditorContext): AddonInstance;
399
+ };
400
+ interface EquationAddonConfig {
401
+ katexOptions?: Record<string, unknown>;
402
+ macros?: Record<string, string>;
403
+ }
404
+ declare function EquationAddon(config?: EquationAddonConfig): AddonDefinition<EquationAddonConfig>;
405
+ declare const EquationAddonImpl: {
406
+ id: string;
407
+ initSchema(ctx: SchemaContext): void;
408
+ init(ctx: EditorContext): AddonInstance;
409
+ };
410
+ declare function FootnoteAddon(): AddonDefinition;
411
+ declare const FootnoteAddonImpl: {
412
+ id: string;
413
+ initSchema(ctx: SchemaContext): void;
414
+ init(ctx: EditorContext): AddonInstance;
415
+ };
416
+ interface PersonProvider {
417
+ search(query: string): Promise<{
418
+ id: string;
419
+ name: string;
420
+ avatar?: string;
421
+ }[]>;
422
+ }
423
+ interface FileChipProvider {
424
+ search(query: string): Promise<{
425
+ id: string;
426
+ name: string;
427
+ icon?: string;
428
+ }[]>;
429
+ }
430
+ interface SmartChipAddonConfig {
431
+ date?: {
432
+ formats?: string[];
433
+ relative?: boolean;
434
+ };
435
+ person?: {
436
+ provider: PersonProvider;
437
+ };
438
+ place?: {
439
+ mapProvider?: "google" | "osm";
440
+ };
441
+ file?: {
442
+ provider: FileChipProvider;
443
+ };
444
+ variables?: {
445
+ variables: Record<string, string>;
446
+ };
447
+ }
448
+ declare function SmartChipAddon(config?: SmartChipAddonConfig): AddonDefinition<SmartChipAddonConfig>;
449
+ declare const SmartChipAddonImpl: {
450
+ id: string;
451
+ initSchema(ctx: SchemaContext): void;
452
+ init(ctx: EditorContext): AddonInstance;
453
+ };
454
+
455
+ type CommandGroupMode = "inline" | "popover";
456
+ type CommandGroupDensity = "comfortable" | "compact";
457
+ type CommandGroupOrientation = "horizontal" | "vertical";
458
+ interface CommandGroupOptions {
459
+ /** Command IDs to render, in order. Unknown IDs are skipped. */
460
+ commands: string[];
461
+ /** Accessible label for the group (role="group" aria-label). */
462
+ label?: string;
463
+ /** Inline = toolbar style; popover = bubble/slash/link-editor style. */
464
+ mode?: CommandGroupMode;
465
+ /** Comfortable default; compact for popovers. */
466
+ density?: CommandGroupDensity;
467
+ /** Sets aria-orientation and flex direction. */
468
+ orientation?: CommandGroupOrientation;
469
+ /** Render the command label next to the icon. */
470
+ showLabels?: boolean;
471
+ /** Show the title (tooltip) attribute. */
472
+ showTooltips?: boolean;
473
+ /** Command IDs that are currently in a loading state. */
474
+ loading?: Set<string>;
475
+ /** Optional intercept; defaults to ctx.execCommand(cmd.id). */
476
+ onActivate?: (cmdId: string) => void;
477
+ }
478
+ interface CommandGroupHandle {
479
+ readonly el: HTMLElement;
480
+ /** Re-evaluate isEnabled/isActive/loading and update DOM state. Idempotent. */
481
+ update(): void;
482
+ /** Move focus to the first non-disabled button. No-op if all disabled. */
483
+ focusFirst(): void;
484
+ /** Move focus to the last non-disabled button. No-op if all disabled. */
485
+ focusLast(): void;
486
+ /** Update the loading set without recreating the group. */
487
+ setLoading(loading: Set<string>): void;
488
+ /** Remove the group and detach listeners. */
489
+ destroy(): void;
490
+ }
491
+ declare function createCommandGroup(ctx: EditorContext, opts: CommandGroupOptions): CommandGroupHandle;
492
+
493
+ interface ToolbarGroup {
494
+ label?: string;
495
+ commands: string[];
496
+ }
497
+ interface ToolbarAddonConfig {
498
+ position?: "top" | "bottom" | "sticky";
499
+ groups?: ToolbarGroup[];
500
+ overflow?: "scroll" | "dropdown";
501
+ showLabels?: boolean;
502
+ showTooltips?: boolean;
503
+ }
504
+ declare function ToolbarAddon(config?: ToolbarAddonConfig): AddonDefinition<ToolbarAddonConfig>;
505
+ declare const ToolbarAddonImpl: {
506
+ id: string;
507
+ init(ctx: EditorContext, config?: ToolbarAddonConfig): AddonInstance;
508
+ };
509
+ interface BubbleMenuAddonConfig {
510
+ commands?: string[];
511
+ showOnCode?: boolean;
512
+ delay?: number;
513
+ }
514
+ declare function BubbleMenuAddon(config?: BubbleMenuAddonConfig): AddonDefinition<BubbleMenuAddonConfig>;
515
+ declare const BubbleMenuAddonImpl: {
516
+ id: string;
517
+ init(ctx: EditorContext, config?: BubbleMenuAddonConfig): AddonInstance;
518
+ };
519
+ interface SlashGroup {
520
+ label: string;
521
+ commands: string[];
522
+ }
523
+ interface SlashMenuAddonConfig {
524
+ trigger?: string;
525
+ groups?: SlashGroup[];
526
+ maxVisible?: number;
527
+ }
528
+ declare function SlashMenuAddon(config?: SlashMenuAddonConfig): AddonDefinition<SlashMenuAddonConfig>;
529
+ declare const SlashMenuAddonImpl: {
530
+ id: string;
531
+ init(ctx: EditorContext, config?: SlashMenuAddonConfig): AddonInstance;
532
+ };
533
+ interface CommandPaletteAddonConfig {
534
+ shortcut?: string;
535
+ placeholder?: string;
536
+ maxRecent?: number;
537
+ }
538
+ declare function CommandPaletteAddon(config?: CommandPaletteAddonConfig): AddonDefinition<CommandPaletteAddonConfig>;
539
+ declare const CommandPaletteAddonImpl: {
540
+ id: string;
541
+ init(ctx: EditorContext, _config?: CommandPaletteAddonConfig): AddonInstance;
542
+ };
543
+ interface BlockHandlesAddonConfig {
544
+ showAddButton?: boolean;
545
+ addButtonCommand?: string;
546
+ }
547
+ declare function BlockHandlesAddon(config?: BlockHandlesAddonConfig): AddonDefinition<BlockHandlesAddonConfig>;
548
+ declare const BlockHandlesAddonImpl: {
549
+ id: string;
550
+ init(_ctx: EditorContext): AddonInstance;
551
+ };
552
+ declare function ContextMenuAddon(): AddonDefinition;
553
+ declare const ContextMenuAddonImpl: {
554
+ id: string;
555
+ init(ctx: EditorContext): AddonInstance;
556
+ };
557
+ type StatusBarSlot = "wordCount" | "charCount" | "readingTime" | "cursorPos" | "peers" | "saveStatus";
558
+ interface StatusBarAddonConfig {
559
+ slots?: StatusBarSlot[];
560
+ }
561
+ declare function StatusBarAddon(config?: StatusBarAddonConfig): AddonDefinition<StatusBarAddonConfig>;
562
+ declare const StatusBarAddonImpl: {
563
+ id: string;
564
+ init(ctx: EditorContext, config?: StatusBarAddonConfig): AddonInstance;
565
+ };
566
+
567
+ interface TableOfContentsAddonConfig {
568
+ headingLevels?: number[];
569
+ sidePanel?: boolean;
570
+ }
571
+ declare function TableOfContentsAddon(config?: TableOfContentsAddonConfig): AddonDefinition<TableOfContentsAddonConfig>;
572
+ declare const TableOfContentsAddonImpl: {
573
+ id: string;
574
+ initSchema(ctx: SchemaContext): void;
575
+ init(ctx: EditorContext): AddonInstance;
576
+ };
577
+ declare function OutlineAddon(): AddonDefinition;
578
+ declare const OutlineAddonImpl: {
579
+ id: string;
580
+ init(_ctx: EditorContext): AddonInstance;
581
+ };
582
+ interface CoverAddonConfig {
583
+ upload?: (file: File) => Promise<string>;
584
+ gradients?: string[];
585
+ }
586
+ declare function CoverAddon(config?: CoverAddonConfig): AddonDefinition<CoverAddonConfig>;
587
+ declare const CoverAddonImpl: {
588
+ id: string;
589
+ init(ctx: EditorContext): AddonInstance;
590
+ };
591
+ interface BreadcrumbItem {
592
+ id: string;
593
+ label: string;
594
+ href?: string;
595
+ }
596
+ interface BreadcrumbProvider {
597
+ getPath(docId: string): Promise<BreadcrumbItem[]>;
598
+ }
599
+ interface BreadcrumbAddonConfig {
600
+ provider: BreadcrumbProvider;
601
+ }
602
+ declare function BreadcrumbAddon(config: BreadcrumbAddonConfig): AddonDefinition<BreadcrumbAddonConfig>;
603
+ declare const BreadcrumbAddonImpl: {
604
+ id: string;
605
+ init(_ctx: EditorContext): AddonInstance;
606
+ };
607
+ declare function TemplatesAddon(): AddonDefinition;
608
+ declare const TemplatesAddonImpl: {
609
+ id: string;
610
+ init(ctx: EditorContext): AddonInstance;
611
+ };
612
+ interface PageSetupAddonConfig {
613
+ size?: "A4" | "Letter" | "Legal";
614
+ orientation?: "portrait" | "landscape";
615
+ margins?: {
616
+ top: string;
617
+ right: string;
618
+ bottom: string;
619
+ left: string;
620
+ };
621
+ }
622
+ declare function PageSetupAddon(config?: PageSetupAddonConfig): AddonDefinition<PageSetupAddonConfig>;
623
+ declare const PageSetupAddonImpl: {
624
+ id: string;
625
+ init(ctx: EditorContext): AddonInstance;
626
+ };
627
+
628
+ declare function ContentAddon(): AddonDefinition;
629
+ declare const ContentAddonImpl: {
630
+ id: string;
631
+ init(ctx: EditorContext): AddonInstance;
632
+ };
633
+ declare function DocxAddon(): AddonDefinition;
634
+ declare const DocxAddonImpl: {
635
+ id: string;
636
+ init(ctx: EditorContext): AddonInstance;
637
+ };
638
+ declare function PdfAddon(): AddonDefinition;
639
+ declare const PdfAddonImpl: {
640
+ id: string;
641
+ init(ctx: EditorContext): AddonInstance;
642
+ };
643
+ declare function PrintAddon(): AddonDefinition;
644
+ declare const PrintAddonImpl: {
645
+ id: string;
646
+ init(ctx: EditorContext): AddonInstance;
647
+ };
648
+
649
+ declare function SearchAddon(): AddonDefinition;
650
+ declare const SearchAddonImpl: {
651
+ id: string;
652
+ init(ctx: EditorContext): AddonInstance;
653
+ };
654
+ declare function SpellCheckAddon(): AddonDefinition;
655
+ declare const SpellCheckAddonImpl: {
656
+ id: string;
657
+ init(_ctx: EditorContext): AddonInstance;
658
+ };
659
+ declare function GrammarAddon(): AddonDefinition;
660
+ declare const GrammarAddonImpl: {
661
+ id: string;
662
+ init(_ctx: EditorContext): AddonInstance;
663
+ };
664
+ interface AutoSaveAddonConfig {
665
+ save: (content: string, format: string) => Promise<void>;
666
+ interval?: number;
667
+ format?: "json" | "html" | "markdown";
668
+ }
669
+ declare function AutoSaveAddon(config: AutoSaveAddonConfig): AddonDefinition<AutoSaveAddonConfig>;
670
+ declare const AutoSaveAddonImpl: {
671
+ id: string;
672
+ init(ctx: EditorContext, config: AutoSaveAddonConfig): AddonInstance;
673
+ };
674
+ interface ReadOnlyAddonConfig {
675
+ readOnly?: boolean;
676
+ }
677
+ declare function ReadOnlyAddon(config?: ReadOnlyAddonConfig): AddonDefinition<ReadOnlyAddonConfig>;
678
+ declare const ReadOnlyAddonImpl: {
679
+ id: string;
680
+ init(ctx: EditorContext, config?: ReadOnlyAddonConfig): AddonInstance;
681
+ };
682
+
683
+ declare function CollabAddon(config?: CollabConfig): AddonDefinition<CollabConfig>;
684
+ declare const CollabAddonImpl: {
685
+ id: string;
686
+ init(ctx: EditorContext, _config?: CollabConfig): AddonInstance;
687
+ };
688
+ interface AwarenessAddonConfig {
689
+ identity?: {
690
+ id: string;
691
+ name: string;
692
+ color: string;
693
+ };
694
+ /**
695
+ * Opaque schema version stamped into awareness state. The binder emits
696
+ * `collab:error { phase: 'schema-mismatch' }` if a peer's schemaVersion
697
+ * differs from this one. Pin per-release so a rolling deploy with an
698
+ * incompatible PM schema fails loudly instead of silently diverging.
699
+ */
700
+ schemaVersion?: string;
701
+ }
702
+ declare function AwarenessAddon(config?: AwarenessAddonConfig): AddonDefinition<AwarenessAddonConfig>;
703
+ declare const AwarenessAddonImpl: {
704
+ id: string;
705
+ init(ctx: EditorContext, config?: AwarenessAddonConfig): AddonInstance;
706
+ };
707
+ declare function PresenceAddon(): AddonDefinition;
708
+ declare const PresenceAddonImpl: {
709
+ id: string;
710
+ init(_ctx: EditorContext): AddonInstance;
711
+ };
712
+ interface CommentProvider {
713
+ getComments(docId: string): Promise<Comment[]>;
714
+ addComment(docId: string, range: {
715
+ from: number;
716
+ to: number;
717
+ }, text: string): Promise<Comment>;
718
+ resolveComment(id: string): Promise<void>;
719
+ deleteComment(id: string): Promise<void>;
720
+ }
721
+ interface Comment {
722
+ id: string;
723
+ from: number;
724
+ to: number;
725
+ text: string;
726
+ author: string;
727
+ createdAt: string;
728
+ resolved: boolean;
729
+ replies: Comment[];
730
+ }
731
+ interface CommentsAddonConfig {
732
+ provider: CommentProvider;
733
+ }
734
+ declare function CommentsAddon(config: CommentsAddonConfig): AddonDefinition<CommentsAddonConfig>;
735
+ declare const CommentsAddonImpl: {
736
+ id: string;
737
+ init(ctx: EditorContext): AddonInstance;
738
+ };
739
+ declare function SuggestionsAddon(): AddonDefinition;
740
+ declare const SuggestionsAddonImpl: {
741
+ id: string;
742
+ init(ctx: EditorContext): AddonInstance;
743
+ };
744
+ declare function VersionAddon(): AddonDefinition;
745
+ declare const VersionAddonImpl: {
746
+ id: string;
747
+ init(ctx: EditorContext): AddonInstance;
748
+ };
749
+
750
+ interface CodeAddonConfig {
751
+ language?: string;
752
+ theme?: string;
753
+ lineNumbers?: boolean;
754
+ }
755
+ declare function CodeAddon(config?: CodeAddonConfig): AddonDefinition<CodeAddonConfig>;
756
+ declare const CodeAddonImpl: {
757
+ id: string;
758
+ init(_ctx: EditorContext): AddonInstance;
759
+ };
760
+ declare function LineNumbersAddon(): AddonDefinition;
761
+ declare const LineNumbersAddonImpl: {
762
+ id: string;
763
+ init(_ctx: EditorContext): AddonInstance;
764
+ };
765
+ declare function CodeFoldingAddon(): AddonDefinition;
766
+ declare const CodeFoldingAddonImpl: {
767
+ id: string;
768
+ init(ctx: EditorContext): AddonInstance;
769
+ };
770
+ declare function BracketMatchingAddon(): AddonDefinition;
771
+ declare const BracketMatchingAddonImpl: {
772
+ id: string;
773
+ init(_ctx: EditorContext): AddonInstance;
774
+ };
775
+ interface CodeAutoCompleteAddonConfig {
776
+ completionSource?: unknown;
777
+ }
778
+ declare function CodeAutoCompleteAddon(config?: CodeAutoCompleteAddonConfig): AddonDefinition<CodeAutoCompleteAddonConfig>;
779
+ declare const CodeAutoCompleteAddonImpl: {
780
+ id: string;
781
+ init(_ctx: EditorContext): AddonInstance;
782
+ };
783
+ interface CodeLintAddonConfig {
784
+ linter: unknown;
785
+ delay?: number;
786
+ }
787
+ declare function CodeLintAddon(config: CodeLintAddonConfig): AddonDefinition<CodeLintAddonConfig>;
788
+ declare const CodeLintAddonImpl: {
789
+ id: string;
790
+ init(_ctx: EditorContext): AddonInstance;
791
+ };
792
+ interface DiffAddonConfig {
793
+ original: string;
794
+ mode?: "side-by-side" | "unified";
795
+ highlightChanges?: boolean;
796
+ gutter?: boolean;
797
+ }
798
+ declare function DiffAddon(config: DiffAddonConfig): AddonDefinition<DiffAddonConfig>;
799
+ declare const DiffAddonImpl: {
800
+ id: string;
801
+ init(ctx: EditorContext): AddonInstance;
802
+ };
803
+ declare function MiniMapAddon(): AddonDefinition;
804
+ declare const MiniMapAddonImpl: {
805
+ id: string;
806
+ init(_ctx: EditorContext): AddonInstance;
807
+ };
808
+
809
+ interface PlaceholderAddonConfig {
810
+ text: string;
811
+ showOnlyWhenFocused?: boolean;
812
+ }
813
+ declare function PlaceholderAddon(config: PlaceholderAddonConfig): AddonDefinition<PlaceholderAddonConfig>;
814
+ declare const PlaceholderAddonImpl: {
815
+ id: string;
816
+ init(ctx: EditorContext, config: PlaceholderAddonConfig): AddonInstance;
817
+ };
818
+ interface CountAddonConfig {
819
+ wordsPerMinute?: number;
820
+ showIn?: ("statusbar" | "tooltip")[];
821
+ }
822
+ declare function CountAddon(config?: CountAddonConfig): AddonDefinition<CountAddonConfig>;
823
+ declare const CountAddonImpl: {
824
+ id: string;
825
+ init(ctx: EditorContext, config?: CountAddonConfig): AddonInstance;
826
+ };
827
+ declare function ReadingTimeAddon(): AddonDefinition;
828
+ declare const ReadingTimeAddonImpl: {
829
+ id: string;
830
+ init(ctx: EditorContext): AddonInstance;
831
+ };
832
+ interface FocusModeAddonConfig {
833
+ dimInactive?: boolean;
834
+ typewriterScroll?: boolean;
835
+ }
836
+ declare function FocusModeAddon(config?: FocusModeAddonConfig): AddonDefinition<FocusModeAddonConfig>;
837
+ declare const FocusModeAddonImpl: {
838
+ id: string;
839
+ init(ctx: EditorContext): AddonInstance;
840
+ };
841
+ declare function FullScreenAddon(): AddonDefinition;
842
+ declare const FullScreenAddonImpl: {
843
+ id: string;
844
+ init(ctx: EditorContext): AddonInstance;
845
+ };
846
+ declare function AccessibilityAddon(): AddonDefinition;
847
+ declare const AccessibilityAddonImpl: {
848
+ id: string;
849
+ init(ctx: EditorContext): AddonInstance;
850
+ };
851
+ interface MarkdownAddonConfig {
852
+ defaultMode?: "wysiwyg" | "raw";
853
+ showPreview?: boolean;
854
+ sanitizeHtml?: (html: string) => string;
855
+ }
856
+ declare function MarkdownAddon(config?: MarkdownAddonConfig): AddonDefinition<MarkdownAddonConfig>;
857
+ declare const MarkdownAddonImpl: {
858
+ id: string;
859
+ init(ctx: EditorContext): AddonInstance;
860
+ };
861
+
862
+ declare const ADDON_IMPLEMENTATIONS: Map<string, Addon>;
863
+
864
+ export { ADDON_IMPLEMENTATIONS, AccessibilityAddon, AccessibilityAddonImpl, AlignmentAddon, AlignmentAddonImpl, AudioAddon, type AudioAddonConfig, AudioAddonImpl, AutoSaveAddon, type AutoSaveAddonConfig, AutoSaveAddonImpl, AwarenessAddon, type AwarenessAddonConfig, AwarenessAddonImpl, BlockHandlesAddon, type BlockHandlesAddonConfig, BlockHandlesAddonImpl, BlockquoteAddon, BlockquoteAddonImpl, BoldAddon, BoldAddonImpl, BookmarkAddon, type BookmarkAddonConfig, BookmarkAddonImpl, BracketMatchingAddon, BracketMatchingAddonImpl, BreadcrumbAddon, type BreadcrumbAddonConfig, BreadcrumbAddonImpl, type BreadcrumbItem, type BreadcrumbProvider, BubbleMenuAddon, type BubbleMenuAddonConfig, BubbleMenuAddonImpl, BulletListAddon, BulletListAddonImpl, CalloutAddon, type CalloutAddonConfig, CalloutAddonImpl, type CalloutType, ClearFormattingAddon, ClearFormattingAddonImpl, CodeAddon, type CodeAddonConfig, CodeAddonImpl, CodeAutoCompleteAddon, type CodeAutoCompleteAddonConfig, CodeAutoCompleteAddonImpl, CodeBlockAddon, type CodeBlockAddonConfig, CodeBlockAddonImpl, CodeFoldingAddon, CodeFoldingAddonImpl, CodeLintAddon, type CodeLintAddonConfig, CodeLintAddonImpl, CollabAddon, CollabAddonImpl, ColumnsAddon, type ColumnsAddonConfig, ColumnsAddonImpl, type CommandGroupDensity, type CommandGroupHandle, type CommandGroupMode, type CommandGroupOptions, type CommandGroupOrientation, CommandPaletteAddon, type CommandPaletteAddonConfig, CommandPaletteAddonImpl, CommandsAddon, CommandsAddonImpl, type Comment, type CommentProvider, CommentsAddon, type CommentsAddonConfig, CommentsAddonImpl, ContentAddon, ContentAddonImpl, ContextMenuAddon, ContextMenuAddonImpl, CountAddon, type CountAddonConfig, CountAddonImpl, CoverAddon, type CoverAddonConfig, CoverAddonImpl, DetailsAddon, DetailsAddonImpl, DiffAddon, type DiffAddonConfig, DiffAddonImpl, DividerAddon, DividerAddonImpl, DocxAddon, DocxAddonImpl, EmbedAddon, type EmbedAddonConfig, EmbedAddonImpl, type EmbedProvider, EmojiAddon, type EmojiAddonConfig, EmojiAddonImpl, EquationAddon, type EquationAddonConfig, EquationAddonImpl, FileAddon, type FileAddonConfig, FileAddonImpl, type FileChipProvider, FocusModeAddon, type FocusModeAddonConfig, FocusModeAddonImpl, FontFamilyAddon, type FontFamilyAddonConfig, FontFamilyAddonImpl, FontSizeAddon, type FontSizeAddonConfig, FontSizeAddonImpl, FootnoteAddon, FootnoteAddonImpl, FullScreenAddon, FullScreenAddonImpl, GrammarAddon, GrammarAddonImpl, HeadingsAddon, HeadingsAddonImpl, HighlightAddon, type HighlightAddonConfig, HighlightAddonImpl, HistoryAddon, HistoryAddonImpl, ImageAddon, type ImageAddonConfig, ImageAddonImpl, IndentAddon, IndentAddonImpl, InlineCodeAddon, InlineCodeAddonImpl, InputRulesAddon, InputRulesAddonImpl, ItalicAddon, ItalicAddonImpl, KeymapAddon, type KeymapAddonConfig, KeymapAddonImpl, LineHeightAddon, type LineHeightAddonConfig, LineHeightAddonImpl, LineNumbersAddon, LineNumbersAddonImpl, LinkAddon, type LinkAddonConfig, LinkAddonImpl, ListsAddon, MarkdownAddon, type MarkdownAddonConfig, MarkdownAddonImpl, MentionAddon, type MentionAddonConfig, MentionAddonImpl, type MentionItem, type MentionType, MiniMapAddon, MiniMapAddonImpl, type OGMetadata, OrderedListAddon, OrderedListAddonImpl, OutlineAddon, OutlineAddonImpl, PageBreakAddon, PageBreakAddonImpl, PageSetupAddon, type PageSetupAddonConfig, PageSetupAddonImpl, ParagraphSpacingAddon, ParagraphSpacingAddonImpl, PdfAddon, PdfAddonImpl, type PersonProvider, PlaceholderAddon, type PlaceholderAddonConfig, PlaceholderAddonImpl, PresenceAddon, PresenceAddonImpl, PrintAddon, PrintAddonImpl, ReadOnlyAddon, type ReadOnlyAddonConfig, ReadOnlyAddonImpl, ReadingTimeAddon, ReadingTimeAddonImpl, SchemaAddon, type SchemaAddonConfig, SchemaAddonImpl, SearchAddon, SearchAddonImpl, type SlashGroup, SlashMenuAddon, type SlashMenuAddonConfig, SlashMenuAddonImpl, SmartChipAddon, type SmartChipAddonConfig, SmartChipAddonImpl, SpellCheckAddon, SpellCheckAddonImpl, StatusBarAddon, type StatusBarAddonConfig, StatusBarAddonImpl, type StatusBarSlot, StrikethroughAddon, StrikethroughAddonImpl, SubscriptAddon, SubscriptAddonImpl, SuggestionsAddon, SuggestionsAddonImpl, SuperscriptAddon, SuperscriptAddonImpl, TableAddon, type TableAddonConfig, TableAddonImpl, TableOfContentsAddon, type TableOfContentsAddonConfig, TableOfContentsAddonImpl, TaskListAddon, TaskListAddonImpl, TemplatesAddon, TemplatesAddonImpl, TextColorAddon, type TextColorAddonConfig, TextColorAddonImpl, ToggleListAddon, ToggleListAddonImpl, ToolbarAddon, type ToolbarAddonConfig, ToolbarAddonImpl, type ToolbarGroup, UnderlineAddon, UnderlineAddonImpl, VersionAddon, VersionAddonImpl, VideoAddon, type VideoAddonConfig, VideoAddonImpl, createCommandGroup };