@harbour-enterprises/superdoc 0.21.0-next.2 → 0.21.0-next.3

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 (29) hide show
  1. package/dist/chunks/{PdfViewer-BkXBRXPs.es.js → PdfViewer-D3zo7tPo.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-1mNuyy3m.cjs → PdfViewer-OZDJ7gwT.cjs} +1 -1
  3. package/dist/chunks/{index-BB3Qn69u.cjs → index-CfYf4T_z.cjs} +2 -2
  4. package/dist/chunks/{index-C-44kxYe.es.js → index-MzW5BVNd.es.js} +2 -2
  5. package/dist/core/SuperDoc.d.ts +21 -569
  6. package/dist/core/SuperDoc.d.ts.map +1 -1
  7. package/dist/core/types/index.d.ts +396 -0
  8. package/dist/core/types/index.d.ts.map +1 -0
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{docx-zipper-BWZ2o1H5.js → docx-zipper-CZdELYi-.js} +1 -1
  11. package/dist/super-editor/chunks/{editor-XsrBXzy-.js → editor-BqYH4kDD.js} +2 -2
  12. package/dist/super-editor/chunks/{toolbar-tBWlOBPh.js → toolbar-TkaE2kKM.js} +2 -2
  13. package/dist/super-editor/converter.es.js +1 -1
  14. package/dist/super-editor/docx-zipper.es.js +2 -2
  15. package/dist/super-editor/editor.es.js +3 -3
  16. package/dist/super-editor/file-zipper.es.js +1 -1
  17. package/dist/super-editor/super-editor.es.js +6 -6
  18. package/dist/super-editor/toolbar.es.js +2 -2
  19. package/dist/super-editor.cjs +1 -1
  20. package/dist/super-editor.es.js +1 -1
  21. package/dist/superdoc.cjs +2 -2
  22. package/dist/superdoc.es.js +2 -2
  23. package/dist/superdoc.umd.js +12 -12
  24. package/dist/superdoc.umd.js.map +1 -1
  25. package/npm-deprecation-notice.cjs +1 -9
  26. package/package.json +1 -1
  27. package/dist/chunks/{super-editor.es-CKw7iZcz.es.js → super-editor.es-Bntob7Wd.es.js} +12 -12
  28. package/dist/chunks/{super-editor.es-Dd0joLAR.cjs → super-editor.es-U-GVCd_F.cjs} +12 -12
  29. package/dist/super-editor/chunks/{converter-FESR2WO7.js → converter-3xnF_NHq.js} +12 -12
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-C-44kxYe.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-MzW5BVNd.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-BB3Qn69u.cjs");
4
+ const superdoc = require("./index-CfYf4T_z.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-Dd0joLAR.cjs");
2
+ const superEditor_es = require("./super-editor.es-U-GVCd_F.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -17409,7 +17409,7 @@ const _sfc_main = {
17409
17409
  __name: "SuperDoc",
17410
17410
  emits: ["selection-update"],
17411
17411
  setup(__props, { emit: __emit }) {
17412
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-1mNuyy3m.cjs")));
17412
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-OZDJ7gwT.cjs")));
17413
17413
  const superdocStore = useSuperdocStore();
17414
17414
  const commentsStore = useCommentsStore();
17415
17415
  const {
@@ -1,4 +1,4 @@
1
- import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-CKw7iZcz.es.js";
1
+ import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-Bntob7Wd.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -17392,7 +17392,7 @@ const _sfc_main = {
17392
17392
  __name: "SuperDoc",
17393
17393
  emits: ["selection-update"],
17394
17394
  setup(__props, { emit: __emit }) {
17395
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BkXBRXPs.es.js"));
17395
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-D3zo7tPo.es.js"));
17396
17396
  const superdocStore = useSuperdocStore();
17397
17397
  const commentsStore = useCommentsStore();
17398
17398
  const {
@@ -1,94 +1,10 @@
1
- /**
2
- * @typedef {Object} User The current user of this superdoc
3
- * @property {string} name The user's name
4
- * @property {string} email The user's email
5
- * @property {string | null} [image] The user's photo
6
- */
7
- /**
8
- * @typedef {Object} TelemetryConfig Telemetry configuration
9
- * @property {boolean} [enabled=true] Whether telemetry is enabled
10
- * @property {string} [licenseKey] The licence key for telemetry
11
- * @property {string} [endpoint] The endpoint for telemetry
12
- * @property {string} [superdocVersion] The version of the superdoc
13
- */
14
- /**
15
- * @typedef {Object} Document
16
- * @property {string} [id] The ID of the document
17
- * @property {string} type The type of the document
18
- * @property {File | Blob | null} [data] The initial data of the document (File, Blob, or null)
19
- * @property {string} [name] The name of the document
20
- * @property {string} [url] The URL of the document
21
- * @property {boolean} [isNewFile] Whether the document is a new file
22
- * @property {import('yjs').Doc} [ydoc] The Yjs document for collaboration
23
- * @property {import('@hocuspocus/provider').HocuspocusProvider} [provider] The provider for collaboration
24
- */
25
- /**
26
- * @typedef {Object} Modules
27
- * @property {Object} [comments] Comments module configuration
28
- * @property {Object} [ai] AI module configuration
29
- * @property {string} [ai.apiKey] Harbour API key for AI features
30
- * @property {string} [ai.endpoint] Custom endpoint URL for AI services
31
- * @property {Object} [collaboration] Collaboration module configuration
32
- * @property {Object} [toolbar] Toolbar module configuration
33
- */
34
- /** @typedef {import('@harbour-enterprises/super-editor').Editor} Editor */
35
- /**
36
- * @typedef {string} DocumentMode
37
- * @property {'editing'} editing The document is in editing mode
38
- * @property {'viewing'} viewing The document is in viewing mode
39
- * @property {'suggesting'} suggesting The document is in suggesting mode
40
- */
41
- /**
42
- * @typedef {Object} Config
43
- * @property {string} [superdocId] The ID of the SuperDoc
44
- * @property {string} selector The selector to mount the SuperDoc into
45
- * @property {DocumentMode} documentMode The mode of the document
46
- * @property {'editor' | 'viewer' | 'suggester'} [role] The role of the user in this SuperDoc
47
- * @property {Object | string | File | Blob} [document] The document to load. If a string, it will be treated as a URL. If a File or Blob, it will be used directly.
48
- * @property {Array<Document>} documents The documents to load
49
- * @property {User} [user] The current user of this SuperDoc
50
- * @property {Array<User>} [users] All users of this SuperDoc (can be used for "@"-mentions)
51
- * @property {Array<string>} [colors] Colors to use for user awareness
52
- * @property {Modules} [modules] Modules to load
53
- * @property {boolean} [pagination] Whether to show pagination in SuperEditors
54
- * @property {string} [toolbar] Optional DOM element to render the toolbar in
55
- * @property {Array<string>} [toolbarGroups] Toolbar groups to show
56
- * @property {Object} [toolbarIcons] Icons to show in the toolbar
57
- * @property {Object} [toolbarTexts] Texts to override in the toolbar
58
- * @property {boolean} [isDev] Whether the SuperDoc is in development mode
59
- * @property {TelemetryConfig} [telemetry] Telemetry configuration
60
- * @property {(editor: Editor) => void} [onEditorBeforeCreate] Callback before an editor is created
61
- * @property {(editor: Editor) => void} [onEditorCreate] Callback after an editor is created
62
- * @property {(params: { editor: Editor, transaction: any, duration: number }) => void} [onTransaction] Callback when a transaction is made
63
- * @property {() => void} [onEditorDestroy] Callback after an editor is destroyed
64
- * @property {(params: { error: object, editor: Editor, documentId: string, file: File }) => void} [onContentError] Callback when there is an error in the content
65
- * @property {(editor: { superdoc: SuperDoc }) => void} [onReady] Callback when the SuperDoc is ready
66
- * @property {(params: { type: string, data: object}) => void} [onCommentsUpdate] Callback when comments are updated
67
- * @property {(params: { context: SuperDoc, states: Array }) => void} [onAwarenessUpdate] Callback when awareness is updated
68
- * @property {(params: { isLocked: boolean, lockedBy: User }) => void} [onLocked] Callback when the SuperDoc is locked
69
- * @property {() => void} [onPdfDocumentReady] Callback when the PDF document is ready
70
- * @property {(isOpened: boolean) => void} [onSidebarToggle] Callback when the sidebar is toggled
71
- * @property {(params: { editor: Editor }) => void} [onCollaborationReady] Callback when collaboration is ready
72
- * @property {(params: { editor: Editor }) => void} [onEditorUpdate] Callback when document is updated
73
- * @property {(params: { error: Error }) => void} [onException] Callback when an exception is thrown
74
- * @property {(params: { isRendered: boolean }) => void} [onCommentsListChange] Callback when the comments list is rendered
75
- * @property {(params: {})} [onListDefinitionsChange] Callback when the list definitions change
76
- * @property {string} [format] The format of the document (docx, pdf, html)
77
- * @property {Object[]} [editorExtensions] The extensions to load for the editor
78
- * @property {boolean} [isInternal] Whether the SuperDoc is internal
79
- * @property {string} [title] The title of the SuperDoc
80
- * @property {Object[]} [conversations] The conversations to load
81
- * @property {boolean} [isLocked] Whether the SuperDoc is locked
82
- * @property {function(File): Promise<string>} [handleImageUpload] The function to handle image uploads
83
- * @property {User} [lockedBy] The user who locked the SuperDoc
84
- * @property {boolean} [rulers] Whether to show the ruler in the editor
85
- * @property {boolean} [suppressDefaultDocxStyles] Whether to suppress default styles in docx mode
86
- * @property {Object} [jsonOverride] Provided JSON to override content with
87
- * @property {boolean} [disableContextMenu] Whether to disable slash / right-click custom context menu
88
- * @property {string} [html] HTML content to initialize the editor with
89
- * @property {string} [markdown] Markdown content to initialize the editor with
90
- * @property {boolean} [isDebug=false] Whether to enable debug mode
91
- */
1
+ /** @typedef {import('./types').User} User */
2
+ /** @typedef {import('./types').TelemetryConfig} TelemetryConfig */
3
+ /** @typedef {import('./types').Document} Document */
4
+ /** @typedef {import('./types').Modules} Modules */
5
+ /** @typedef {import('./types').Editor} Editor */
6
+ /** @typedef {import('./types').DocumentMode} DocumentMode */
7
+ /** @typedef {import('./types').Config} Config */
92
8
  /**
93
9
  * SuperDoc class
94
10
  * Expects a config object
@@ -116,92 +32,15 @@ export class SuperDoc extends EventEmitter<string | symbol, any> {
116
32
  userColorMap: Map<any, any>;
117
33
  colorIndex: number;
118
34
  superdocId: any;
119
- colors: string[];
120
- user: User;
35
+ colors: any;
36
+ user: any;
121
37
  socket: any;
122
- isDev: boolean;
123
- activeEditor: {
124
- setHighContrastMode: (value: any) => void;
125
- get docChanged(): boolean;
126
- mount(el: any): void;
127
- unmount(): void;
128
- view: any;
129
- setToolbar(toolbar: any): void;
130
- toolbar: any;
131
- focus(): void;
132
- get state(): any;
133
- get storage(): any;
134
- readonly commands: any;
135
- readonly helpers: EditorHelpers;
136
- get isEditable(): boolean;
137
- get isDestroyed(): boolean;
138
- get element(): HTMLElement;
139
- get users(): Array<User>;
140
- chain(): any;
141
- can(): any;
142
- setDocumentMode(documentMode: string): void;
143
- generateCollaborationUpdate(): Promise<Uint8Array>;
144
- initializeCollaborationData(): void;
145
- replaceContent(content: object): void;
146
- setOptions(options?: EditorOptions): void;
147
- options: any;
148
- setEditable(editable?: boolean, emitUpdate?: boolean): void;
149
- registerPlugin(plugin: any, handlePlugins: any): void;
150
- unregisterPlugin(nameOrPluginKey: string | any): void;
151
- createNodeViews(): void;
152
- getMaxContentSize(): any;
153
- updateEditorStyles(element: any, proseMirror: any, hasPaginationEnabled?: boolean): void;
154
- initDefaultStyles(element?: HTMLElement, isPaginationEnabled?: boolean): void;
155
- initMobileStyles(element: HTMLElement | void): void;
156
- getAttributes(nameOrType: string): any;
157
- isActive(nameOrAttributes: string | any, attributesOrUndefined?: any): boolean;
158
- getJSON(): any;
159
- getHTML({ unflattenLists }?: {
160
- unflattenLists?: boolean;
161
- }): string;
162
- createChildEditor(options: EditorOptions): {
163
- new (options: EditorOptions): /*elided*/ any;
164
- loadXmlData(fileSource: File | Blob | Buffer, isNode2?: boolean): Promise<any[]>;
165
- getDocumentVersion(doc2: any): string;
166
- updateDocumentVersion(doc2: any, version2: any): any;
167
- checkIfMigrationsNeeded(): boolean;
168
- };
169
- getPageStyles(): any;
170
- updatePageStyle({ pageMargins }: {
171
- pageMargins: any;
172
- }): void;
173
- migrateListsToV2(): any[];
174
- getUpdatedJson(): any;
175
- exportDocx({ isFinalDoc, commentsType, exportJsonOnly, exportXmlOnly, comments, getUpdatedDocs, fieldsHighlightColor }?: {
176
- isFinalDoc?: boolean;
177
- commentsType?: string;
178
- comments?: any[];
179
- getUpdatedDocs?: boolean;
180
- }): Promise<Blob | ArrayBuffer | any>;
181
- destroy(): void;
182
- destroyHeaderFooterEditors(): void;
183
- processCollaborationMigrations(): any | void;
184
- replaceFile(newFile: any): Promise<void>;
185
- getInternalXmlFile(name: string, type?: string): any | string;
186
- updateInternalXmlFile(name: string, updatedContent: string): void;
187
- getNodesOfType(type: string): any[];
188
- replaceNodeWithHTML(targetNode: any, html: string): void;
189
- prepareForAnnotations(annotationValues?: FieldValue[]): void;
190
- migrateParagraphFields(annotationValues?: FieldValue[]): Promise<FieldValue[]>;
191
- annotate(annotationValues?: FieldValue[], hiddenIds?: string[], removeEmptyFields?: boolean): void;
192
- previewAnnotations(annotationValues?: any[], hiddenIds?: string[]): void;
193
- originalState: any;
194
- closePreview(): void;
195
- on(name: string, fn2: any): void;
196
- emit(name: string, ...args: any[]): void;
197
- off(name: string, fn2: any): void;
198
- once(name: string, fn2: any): void;
199
- removeAllListeners(): void;
200
- };
38
+ isDev: any;
39
+ activeEditor: any;
201
40
  comments: any[];
202
41
  readyEditors: number;
203
- isLocked: boolean;
204
- lockedBy: User;
42
+ isLocked: any;
43
+ lockedBy: any;
205
44
  /**
206
45
  * Get the number of editors that are required for this superdoc
207
46
  * @returns {number} The number of required editors
@@ -209,7 +48,7 @@ export class SuperDoc extends EventEmitter<string | symbol, any> {
209
48
  get requiredNumberOfEditors(): number;
210
49
  get state(): {
211
50
  documents: any;
212
- users: User[];
51
+ users: any[];
213
52
  };
214
53
  app: any;
215
54
  pinia: any;
@@ -402,400 +241,13 @@ export class SuperDoc extends EventEmitter<string | symbol, any> {
402
241
  setHighContrastMode(isHighContrast: boolean): void;
403
242
  #private;
404
243
  }
405
- /**
406
- * The current user of this superdoc
407
- */
408
- export type User = {
409
- /**
410
- * The user's name
411
- */
412
- name: string;
413
- /**
414
- * The user's email
415
- */
416
- email: string;
417
- /**
418
- * The user's photo
419
- */
420
- image?: string | null;
421
- };
422
- /**
423
- * Telemetry configuration
424
- */
425
- export type TelemetryConfig = {
426
- /**
427
- * Whether telemetry is enabled
428
- */
429
- enabled?: boolean;
430
- /**
431
- * The licence key for telemetry
432
- */
433
- licenseKey?: string;
434
- /**
435
- * The endpoint for telemetry
436
- */
437
- endpoint?: string;
438
- /**
439
- * The version of the superdoc
440
- */
441
- superdocVersion?: string;
442
- };
443
- export type Document = {
444
- /**
445
- * The ID of the document
446
- */
447
- id?: string;
448
- /**
449
- * The type of the document
450
- */
451
- type: string;
452
- /**
453
- * The initial data of the document (File, Blob, or null)
454
- */
455
- data?: File | Blob | null;
456
- /**
457
- * The name of the document
458
- */
459
- name?: string;
460
- /**
461
- * The URL of the document
462
- */
463
- url?: string;
464
- /**
465
- * Whether the document is a new file
466
- */
467
- isNewFile?: boolean;
468
- /**
469
- * The Yjs document for collaboration
470
- */
471
- ydoc?: import("yjs").Doc;
472
- /**
473
- * The provider for collaboration
474
- */
475
- provider?: import("@hocuspocus/provider").HocuspocusProvider;
476
- };
477
- export type Modules = {
478
- /**
479
- * Comments module configuration
480
- */
481
- comments?: any;
482
- /**
483
- * AI module configuration
484
- */
485
- ai?: {
486
- apiKey?: string;
487
- endpoint?: string;
488
- };
489
- /**
490
- * Collaboration module configuration
491
- */
492
- collaboration?: any;
493
- /**
494
- * Toolbar module configuration
495
- */
496
- toolbar?: any;
497
- };
498
- export type Editor = {
499
- setHighContrastMode: (value: any) => void;
500
- get docChanged(): boolean;
501
- mount(el: any): void;
502
- unmount(): void;
503
- view: any;
504
- setToolbar(toolbar: any): void;
505
- toolbar: any;
506
- focus(): void;
507
- get state(): any;
508
- get storage(): any;
509
- readonly commands: any;
510
- readonly helpers: EditorHelpers;
511
- get isEditable(): boolean;
512
- get isDestroyed(): boolean;
513
- get element(): HTMLElement;
514
- get users(): Array<User>;
515
- chain(): any;
516
- can(): any;
517
- setDocumentMode(documentMode: string): void;
518
- generateCollaborationUpdate(): Promise<Uint8Array>;
519
- initializeCollaborationData(): void;
520
- replaceContent(content: object): void;
521
- setOptions(options?: EditorOptions): void;
522
- options: any;
523
- setEditable(editable?: boolean, emitUpdate?: boolean): void;
524
- registerPlugin(plugin: any, handlePlugins: any): void;
525
- unregisterPlugin(nameOrPluginKey: string | any): void;
526
- createNodeViews(): void;
527
- getMaxContentSize(): any;
528
- updateEditorStyles(element: any, proseMirror: any, hasPaginationEnabled?: boolean): void;
529
- initDefaultStyles(element?: HTMLElement, isPaginationEnabled?: boolean): void;
530
- initMobileStyles(element: HTMLElement | void): void;
531
- getAttributes(nameOrType: string): any;
532
- isActive(nameOrAttributes: string | any, attributesOrUndefined?: any): boolean;
533
- getJSON(): any;
534
- getHTML({ unflattenLists }?: {
535
- unflattenLists?: boolean;
536
- }): string;
537
- createChildEditor(options: EditorOptions): {
538
- new (options: EditorOptions): /*elided*/ any;
539
- loadXmlData(fileSource: File | Blob | Buffer, isNode2?: boolean): Promise<any[]>;
540
- getDocumentVersion(doc2: any): string;
541
- updateDocumentVersion(doc2: any, version2: any): any;
542
- checkIfMigrationsNeeded(): boolean;
543
- };
544
- getPageStyles(): any;
545
- updatePageStyle({ pageMargins }: {
546
- pageMargins: any;
547
- }): void;
548
- migrateListsToV2(): any[];
549
- getUpdatedJson(): any;
550
- exportDocx({ isFinalDoc, commentsType, exportJsonOnly, exportXmlOnly, comments, getUpdatedDocs, fieldsHighlightColor }?: {
551
- isFinalDoc?: boolean;
552
- commentsType?: string;
553
- comments?: any[];
554
- getUpdatedDocs?: boolean;
555
- }): Promise<Blob | ArrayBuffer | any>;
556
- destroy(): void;
557
- destroyHeaderFooterEditors(): void;
558
- processCollaborationMigrations(): any | void;
559
- replaceFile(newFile: any): Promise<void>;
560
- getInternalXmlFile(name: string, type?: string): any | string;
561
- updateInternalXmlFile(name: string, updatedContent: string): void;
562
- getNodesOfType(type: string): any[];
563
- replaceNodeWithHTML(targetNode: any, html: string): void;
564
- prepareForAnnotations(annotationValues?: FieldValue[]): void;
565
- migrateParagraphFields(annotationValues?: FieldValue[]): Promise<FieldValue[]>;
566
- annotate(annotationValues?: FieldValue[], hiddenIds?: string[], removeEmptyFields?: boolean): void;
567
- previewAnnotations(annotationValues?: any[], hiddenIds?: string[]): void;
568
- originalState: any;
569
- closePreview(): void;
570
- on(name: string, fn2: any): void;
571
- emit(name: string, ...args: any[]): void;
572
- off(name: string, fn2: any): void;
573
- once(name: string, fn2: any): void;
574
- removeAllListeners(): void;
575
- };
576
- export type DocumentMode = string;
577
- export type Config = {
578
- /**
579
- * The ID of the SuperDoc
580
- */
581
- superdocId?: string;
582
- /**
583
- * The selector to mount the SuperDoc into
584
- */
585
- selector: string;
586
- /**
587
- * The mode of the document
588
- */
589
- documentMode: DocumentMode;
590
- /**
591
- * The role of the user in this SuperDoc
592
- */
593
- role?: "editor" | "viewer" | "suggester";
594
- /**
595
- * The document to load. If a string, it will be treated as a URL. If a File or Blob, it will be used directly.
596
- */
597
- document?: any | string | File | Blob;
598
- /**
599
- * The documents to load
600
- */
601
- documents: Array<Document>;
602
- /**
603
- * The current user of this SuperDoc
604
- */
605
- user?: User;
606
- /**
607
- * All users of this SuperDoc (can be used for "@"-mentions)
608
- */
609
- users?: Array<User>;
610
- /**
611
- * Colors to use for user awareness
612
- */
613
- colors?: Array<string>;
614
- /**
615
- * Modules to load
616
- */
617
- modules?: Modules;
618
- /**
619
- * Whether to show pagination in SuperEditors
620
- */
621
- pagination?: boolean;
622
- /**
623
- * Optional DOM element to render the toolbar in
624
- */
625
- toolbar?: string;
626
- /**
627
- * Toolbar groups to show
628
- */
629
- toolbarGroups?: Array<string>;
630
- /**
631
- * Icons to show in the toolbar
632
- */
633
- toolbarIcons?: any;
634
- /**
635
- * Texts to override in the toolbar
636
- */
637
- toolbarTexts?: any;
638
- /**
639
- * Whether the SuperDoc is in development mode
640
- */
641
- isDev?: boolean;
642
- /**
643
- * Telemetry configuration
644
- */
645
- telemetry?: TelemetryConfig;
646
- /**
647
- * Callback before an editor is created
648
- */
649
- onEditorBeforeCreate?: (editor: Editor) => void;
650
- /**
651
- * Callback after an editor is created
652
- */
653
- onEditorCreate?: (editor: Editor) => void;
654
- /**
655
- * Callback when a transaction is made
656
- */
657
- onTransaction?: (params: {
658
- editor: Editor;
659
- transaction: any;
660
- duration: number;
661
- }) => void;
662
- /**
663
- * Callback after an editor is destroyed
664
- */
665
- onEditorDestroy?: () => void;
666
- /**
667
- * Callback when there is an error in the content
668
- */
669
- onContentError?: (params: {
670
- error: object;
671
- editor: Editor;
672
- documentId: string;
673
- file: File;
674
- }) => void;
675
- /**
676
- * Callback when the SuperDoc is ready
677
- */
678
- onReady?: (editor: {
679
- superdoc: SuperDoc;
680
- }) => void;
681
- /**
682
- * Callback when comments are updated
683
- */
684
- onCommentsUpdate?: (params: {
685
- type: string;
686
- data: object;
687
- }) => void;
688
- /**
689
- * Callback when awareness is updated
690
- */
691
- onAwarenessUpdate?: (params: {
692
- context: SuperDoc;
693
- states: any[];
694
- }) => void;
695
- /**
696
- * Callback when the SuperDoc is locked
697
- */
698
- onLocked?: (params: {
699
- isLocked: boolean;
700
- lockedBy: User;
701
- }) => void;
702
- /**
703
- * Callback when the PDF document is ready
704
- */
705
- onPdfDocumentReady?: () => void;
706
- /**
707
- * Callback when the sidebar is toggled
708
- */
709
- onSidebarToggle?: (isOpened: boolean) => void;
710
- /**
711
- * Callback when collaboration is ready
712
- */
713
- onCollaborationReady?: (params: {
714
- editor: Editor;
715
- }) => void;
716
- /**
717
- * Callback when document is updated
718
- */
719
- onEditorUpdate?: (params: {
720
- editor: Editor;
721
- }) => void;
722
- /**
723
- * Callback when an exception is thrown
724
- */
725
- onException?: (params: {
726
- error: Error;
727
- }) => void;
728
- /**
729
- * Callback when the comments list is rendered
730
- */
731
- onCommentsListChange?: (params: {
732
- isRendered: boolean;
733
- }) => void;
734
- /**
735
- * Callback when the list definitions change
736
- */
737
- onListDefinitionsChange?: (params: {}) => any;
738
- /**
739
- * The format of the document (docx, pdf, html)
740
- */
741
- format?: string;
742
- /**
743
- * The extensions to load for the editor
744
- */
745
- editorExtensions?: any[];
746
- /**
747
- * Whether the SuperDoc is internal
748
- */
749
- isInternal?: boolean;
750
- /**
751
- * The title of the SuperDoc
752
- */
753
- title?: string;
754
- /**
755
- * The conversations to load
756
- */
757
- conversations?: any[];
758
- /**
759
- * Whether the SuperDoc is locked
760
- */
761
- isLocked?: boolean;
762
- /**
763
- * The function to handle image uploads
764
- */
765
- handleImageUpload?: (arg0: File) => Promise<string>;
766
- /**
767
- * The user who locked the SuperDoc
768
- */
769
- lockedBy?: User;
770
- /**
771
- * Whether to show the ruler in the editor
772
- */
773
- rulers?: boolean;
774
- /**
775
- * Whether to suppress default styles in docx mode
776
- */
777
- suppressDefaultDocxStyles?: boolean;
778
- /**
779
- * Provided JSON to override content with
780
- */
781
- jsonOverride?: any;
782
- /**
783
- * Whether to disable slash / right-click custom context menu
784
- */
785
- disableContextMenu?: boolean;
786
- /**
787
- * HTML content to initialize the editor with
788
- */
789
- html?: string;
790
- /**
791
- * Markdown content to initialize the editor with
792
- */
793
- markdown?: string;
794
- /**
795
- * Whether to enable debug mode
796
- */
797
- isDebug?: boolean;
798
- };
244
+ export type User = any;
245
+ export type TelemetryConfig = any;
246
+ export type Document = any;
247
+ export type Modules = any;
248
+ export type Editor = any;
249
+ export type DocumentMode = any;
250
+ export type Config = any;
799
251
  import { EventEmitter } from 'eventemitter3';
800
252
  import { Telemetry } from '@harbour-enterprises/common/Telemetry.js';
801
253
  import { SuperToolbar } from '@harbour-enterprises/super-editor';
@@ -1 +1 @@
1
- {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AAEH;;;;;;GAMG;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