@harbour-enterprises/superdoc 0.23.0-next.14 → 0.23.0-next.15

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 (36) hide show
  1. package/dist/chunks/{PdfViewer-D3cgkd9j.cjs → PdfViewer-1MZFKzXW.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BaaVD5bX.es.js → PdfViewer-NEyAcxt7.es.js} +1 -1
  3. package/dist/chunks/{eventemitter3-CR2eBWft.es.js → eventemitter3-BWEnUdTY.es.js} +1 -1
  4. package/dist/chunks/{eventemitter3-DSRogsNq.cjs → eventemitter3-DkXkH2rT.cjs} +1 -1
  5. package/dist/chunks/{index-CAHkANZY.cjs → index-CGtSnLpQ.cjs} +160 -465
  6. package/dist/chunks/{index-CESuSQe2.es.js → index-DAT3_wPu.es.js} +27 -332
  7. package/dist/chunks/{super-editor.es-BYutUrPg.cjs → super-editor.es-C7TgrpFl.cjs} +616 -116
  8. package/dist/chunks/{super-editor.es-BKb7p4fi.es.js → super-editor.es-Ctq_imo8.es.js} +616 -116
  9. package/dist/chunks/{xml-js-CWV8R-ek.cjs → xml-js-D_ZIzxu0.cjs} +1 -1
  10. package/dist/chunks/xml-js-Dx4FIjnp.es.js +2 -0
  11. package/dist/core/types/index.d.ts +19 -1
  12. package/dist/core/types/index.d.ts.map +1 -1
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-DD7uNz2k.js → converter-vEmAnrOg.js} +665 -249
  15. package/dist/super-editor/chunks/{docx-zipper-DraPR30Z.js → docx-zipper-DA00N7eN.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-xzhKWRFZ.js → editor-Das_uwlq.js} +94 -10
  17. package/dist/super-editor/chunks/{toolbar-D6SJTVWT.js → toolbar-CKugkxNQ.js} +2 -2
  18. package/dist/super-editor/converter.es.js +1 -1
  19. package/dist/super-editor/docx-zipper.es.js +2 -2
  20. package/dist/super-editor/editor.es.js +3 -3
  21. package/dist/super-editor/file-zipper.es.js +1 -1
  22. package/dist/super-editor/src/core/Editor.d.ts +57 -3
  23. package/dist/super-editor/src/core/super-converter/SuperConverter.d.ts +58 -2
  24. package/dist/super-editor/src/core/super-converter/exporter-docx-defs.d.ts +28 -39
  25. package/dist/super-editor/super-editor.es.js +6 -6
  26. package/dist/super-editor/toolbar.es.js +2 -2
  27. package/dist/super-editor.cjs +1 -1
  28. package/dist/super-editor.es.js +1 -1
  29. package/dist/superdoc.cjs +2 -3
  30. package/dist/superdoc.es.js +2 -3
  31. package/dist/superdoc.umd.js +641 -446
  32. package/dist/superdoc.umd.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/chunks/xml-js-Bbc0NeKa.es.js +0 -2
  35. package/dist/chunks/{jszip-DAXEPCUv.es.js → jszip-BDk3JBqp.es.js} +3 -3
  36. package/dist/chunks/{jszip-B4LDL19y.cjs → jszip-u4dvXAKa.cjs} +3 -3
@@ -1,4 +1,4 @@
1
- import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-DD7uNz2k.js";
1
+ import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-vEmAnrOg.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberigHelpers, ap as parseIndentElement, aq as combineIndents, ar as SelectionRange, as as Transform, at as isInTable$1, au as generateDocxRandomId, av as insertNewRelationship } from "./converter-DD7uNz2k.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberigHelpers, ap as parseIndentElement, aq as combineIndents, ar as SelectionRange, as as Transform, at as isInTable$1, au as generateDocxRandomId, av as insertNewRelationship } from "./converter-vEmAnrOg.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-DraPR30Z.js";
17
+ import { D as DocxZipper } from "./docx-zipper-DA00N7eN.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -14531,19 +14531,34 @@ const _Editor = class _Editor extends EventEmitter {
14531
14531
  * @returns {string} Document version
14532
14532
  */
14533
14533
  static getDocumentVersion(doc2) {
14534
- const version2 = SuperConverter.getStoredSuperdocVersion(doc2);
14535
- return version2;
14534
+ return SuperConverter.getStoredSuperdocVersion(doc2);
14536
14535
  }
14537
14536
  /**
14538
- * Update the document version
14537
+ * Set the document version
14539
14538
  * @static
14540
14539
  * @param {Object} doc - Document object
14541
14540
  * @param {string} version - New version
14542
- * @returns {Object}
14541
+ * @returns {string} The set version
14542
+ */
14543
+ static setDocumentVersion(doc2, version2) {
14544
+ return SuperConverter.setStoredSuperdocVersion(doc2, version2);
14545
+ }
14546
+ /**
14547
+ * Get the document GUID
14548
+ * @static
14549
+ * @param {Object} doc - Document object
14550
+ * @returns {string|null} Document GUID
14551
+ */
14552
+ static getDocumentGuid(doc2) {
14553
+ return SuperConverter.extractDocumentGuid(doc2);
14554
+ }
14555
+ // Deprecated
14556
+ /**
14557
+ * @deprecated use setDocumentVersion instead
14543
14558
  */
14544
14559
  static updateDocumentVersion(doc2, version2) {
14545
- const updatedContent = SuperConverter.updateDocumentVersion(doc2, version2);
14546
- return updatedContent;
14560
+ console.warn("updateDocumentVersion is deprecated, use setDocumentVersion instead");
14561
+ return _Editor.setDocumentVersion(doc2, version2);
14547
14562
  }
14548
14563
  /**
14549
14564
  * Creates all node views.
@@ -14679,6 +14694,43 @@ const _Editor = class _Editor extends EventEmitter {
14679
14694
  }
14680
14695
  window.addEventListener("resize", () => handleResize);
14681
14696
  }
14697
+ /**
14698
+ * Get document identifier for telemetry (async - may generate hash)
14699
+ * @returns {Promise<string>} GUID for modified docs, hash for unmodified
14700
+ */
14701
+ async getDocumentIdentifier() {
14702
+ return await this.converter?.getDocumentIdentifier() || null;
14703
+ }
14704
+ /**
14705
+ * Get permanent document GUID (sync - only for modified documents)
14706
+ * @returns {string|null} GUID or null if document hasn't been modified
14707
+ */
14708
+ getDocumentGuid() {
14709
+ return this.converter?.documentGuid || null;
14710
+ }
14711
+ /**
14712
+ * Check if document has been modified
14713
+ * @returns {boolean}
14714
+ */
14715
+ isDocumentModified() {
14716
+ return this.converter?.documentModified || false;
14717
+ }
14718
+ /**
14719
+ * Get telemetry data (async because of lazy hash generation)
14720
+ */
14721
+ async getTelemetryData() {
14722
+ return {
14723
+ documentId: await this.getDocumentIdentifier(),
14724
+ isModified: this.isDocumentModified(),
14725
+ isPermanentId: !!this.converter?.documentGuid,
14726
+ version: this.converter?.getSuperdocVersion()
14727
+ };
14728
+ }
14729
+ // Deprecated for backward compatibility
14730
+ getDocumentId() {
14731
+ console.warn("getDocumentId is deprecated, use getDocumentGuid instead");
14732
+ return this.getDocumentGuid();
14733
+ }
14682
14734
  /**
14683
14735
  * Get attrs of the currently selected node or mark.
14684
14736
  * @param {String} nameOrType
@@ -14710,6 +14762,21 @@ const _Editor = class _Editor extends EventEmitter {
14710
14762
  getJSON() {
14711
14763
  return this.state.doc.toJSON();
14712
14764
  }
14765
+ /**
14766
+ * Get document metadata including GUID, modification status, and version
14767
+ * @returns {{
14768
+ * documentGuid: string | null,
14769
+ * isModified: boolean,
14770
+ * version: string | null
14771
+ * }} Document metadata
14772
+ */
14773
+ getMetadata() {
14774
+ return {
14775
+ documentGuid: this.converter?.documentGuid || null,
14776
+ isModified: this.isDocumentModified(),
14777
+ version: this.converter?.getSuperdocVersion() || null
14778
+ };
14779
+ }
14713
14780
  /**
14714
14781
  * Get the editor content as HTML
14715
14782
  * @param {Object} options - Options for the HTML serializer
@@ -14727,6 +14794,13 @@ const _Editor = class _Editor extends EventEmitter {
14727
14794
  }
14728
14795
  return html;
14729
14796
  }
14797
+ /**
14798
+ * Get the document version from the converter
14799
+ * @returns {string|null} The SuperDoc version stored in the document
14800
+ */
14801
+ getDocumentVersion() {
14802
+ return this.converter?.getSuperdocVersion() || null;
14803
+ }
14730
14804
  /**
14731
14805
  * Create a child editor linked to this editor.
14732
14806
  * This is useful for creating header/footer editors that are linked to the main editor.
@@ -14809,7 +14883,8 @@ const _Editor = class _Editor extends EventEmitter {
14809
14883
  if (exportXmlOnly || exportJsonOnly) return documentXml;
14810
14884
  const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
14811
14885
  const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
14812
- const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
14886
+ const hasCustomSettings = !!this.converter.convertedXml["word/settings.xml"]?.elements?.length;
14887
+ const customSettings = hasCustomSettings ? this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"]?.elements?.[0]) : null;
14813
14888
  const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
14814
14889
  const media = this.converter.addedMedia;
14815
14890
  const updatedHeadersFooters = {};
@@ -14825,13 +14900,15 @@ const _Editor = class _Editor extends EventEmitter {
14825
14900
  ...this.options.customUpdatedFiles,
14826
14901
  "word/document.xml": String(documentXml),
14827
14902
  "docProps/custom.xml": String(customXml),
14828
- "word/settings.xml": String(customSettings),
14829
14903
  "word/_rels/document.xml.rels": String(rels),
14830
14904
  "word/numbering.xml": String(numbering),
14831
14905
  // Replace & with &amp; in styles.xml as DOCX viewers can't handle it
14832
14906
  "word/styles.xml": String(styles).replace(/&/gi, "&amp;"),
14833
14907
  ...updatedHeadersFooters
14834
14908
  };
14909
+ if (hasCustomSettings) {
14910
+ updatedDocs["word/settings.xml"] = String(customSettings);
14911
+ }
14835
14912
  if (comments.length) {
14836
14913
  const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
14837
14914
  const commentsExtendedXml = this.converter.schemaToXml(
@@ -15542,6 +15619,13 @@ dispatchTransaction_fn = function(transaction) {
15542
15619
  if (!transaction.docChanged) {
15543
15620
  return;
15544
15621
  }
15622
+ if (transaction.docChanged && this.converter) {
15623
+ if (!this.converter.documentGuid) {
15624
+ this.converter.promoteToGuid();
15625
+ console.debug("Document modified - assigned GUID:", this.converter.documentGuid);
15626
+ }
15627
+ this.converter.documentModified = true;
15628
+ }
15545
15629
  this.emit("update", {
15546
15630
  editor: this,
15547
15631
  transaction
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { p as process$1 } from "./converter-DD7uNz2k.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-xzhKWRFZ.js";
2
+ import { p as process$1 } from "./converter-vEmAnrOg.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-Das_uwlq.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { a5 } from "./chunks/converter-DD7uNz2k.js";
1
+ import { a5 } from "./chunks/converter-vEmAnrOg.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-DD7uNz2k.js";
2
- import { D } from "./chunks/docx-zipper-DraPR30Z.js";
1
+ import "./chunks/converter-vEmAnrOg.js";
2
+ import { D } from "./chunks/docx-zipper-DA00N7eN.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-xzhKWRFZ.js";
2
- import "./chunks/converter-DD7uNz2k.js";
3
- import "./chunks/docx-zipper-DraPR30Z.js";
1
+ import { E } from "./chunks/editor-Das_uwlq.js";
2
+ import "./chunks/converter-vEmAnrOg.js";
3
+ import "./chunks/docx-zipper-DA00N7eN.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DraPR30Z.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-DA00N7eN.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -118,13 +118,24 @@ export class Editor extends EventEmitter {
118
118
  */
119
119
  static getDocumentVersion(doc: any): string;
120
120
  /**
121
- * Update the document version
121
+ * Set the document version
122
122
  * @static
123
123
  * @param {Object} doc - Document object
124
124
  * @param {string} version - New version
125
- * @returns {Object}
125
+ * @returns {string} The set version
126
126
  */
127
- static updateDocumentVersion(doc: any, version: string): any;
127
+ static setDocumentVersion(doc: any, version: string): string;
128
+ /**
129
+ * Get the document GUID
130
+ * @static
131
+ * @param {Object} doc - Document object
132
+ * @returns {string|null} Document GUID
133
+ */
134
+ static getDocumentGuid(doc: any): string | null;
135
+ /**
136
+ * @deprecated use setDocumentVersion instead
137
+ */
138
+ static updateDocumentVersion(doc: any, version: any): string;
128
139
  /**
129
140
  * Check if migrations are needed for the data
130
141
  * @static
@@ -381,6 +392,31 @@ export class Editor extends EventEmitter {
381
392
  * @returns {void}
382
393
  */
383
394
  initMobileStyles(element: HTMLElement | void): void;
395
+ /**
396
+ * Get document identifier for telemetry (async - may generate hash)
397
+ * @returns {Promise<string>} GUID for modified docs, hash for unmodified
398
+ */
399
+ getDocumentIdentifier(): Promise<string>;
400
+ /**
401
+ * Get permanent document GUID (sync - only for modified documents)
402
+ * @returns {string|null} GUID or null if document hasn't been modified
403
+ */
404
+ getDocumentGuid(): string | null;
405
+ /**
406
+ * Check if document has been modified
407
+ * @returns {boolean}
408
+ */
409
+ isDocumentModified(): boolean;
410
+ /**
411
+ * Get telemetry data (async because of lazy hash generation)
412
+ */
413
+ getTelemetryData(): Promise<{
414
+ documentId: string;
415
+ isModified: boolean;
416
+ isPermanentId: boolean;
417
+ version: any;
418
+ }>;
419
+ getDocumentId(): string;
384
420
  /**
385
421
  * Get attrs of the currently selected node or mark.
386
422
  * @param {String} nameOrType
@@ -404,6 +440,19 @@ export class Editor extends EventEmitter {
404
440
  * @returns {Object} Editor content as JSON
405
441
  */
406
442
  getJSON(): any;
443
+ /**
444
+ * Get document metadata including GUID, modification status, and version
445
+ * @returns {{
446
+ * documentGuid: string | null,
447
+ * isModified: boolean,
448
+ * version: string | null
449
+ * }} Document metadata
450
+ */
451
+ getMetadata(): {
452
+ documentGuid: string | null;
453
+ isModified: boolean;
454
+ version: string | null;
455
+ };
407
456
  /**
408
457
  * Get the editor content as HTML
409
458
  * @param {Object} options - Options for the HTML serializer
@@ -413,6 +462,11 @@ export class Editor extends EventEmitter {
413
462
  getHTML({ unflattenLists }?: {
414
463
  unflattenLists?: boolean;
415
464
  }): string;
465
+ /**
466
+ * Get the document version from the converter
467
+ * @returns {string|null} The SuperDoc version stored in the document
468
+ */
469
+ getDocumentVersion(): string | null;
416
470
  /**
417
471
  * Create a child editor linked to this editor.
418
472
  * This is useful for creating header/footer editors that are linked to the main editor.
@@ -50,8 +50,35 @@ export class SuperConverter {
50
50
  static getFontTableEntry(docx: any, fontName: any): any;
51
51
  static getFallbackFromFontTable(docx: any, fontName: any): any;
52
52
  static toCssFontFamily(fontName: any, docx: any): any;
53
- static getStoredSuperdocVersion(docx: any): any;
54
- static updateDocumentVersion(docx?: any, version?: any): any;
53
+ /**
54
+ * Generic method to get a stored custom property from docx
55
+ * @static
56
+ * @param {Array} docx - Array of docx file objects
57
+ * @param {string} propertyName - Name of the property to retrieve
58
+ * @returns {string|null} The property value or null if not found
59
+ */
60
+ static getStoredCustomProperty(docx: any[], propertyName: string): string | null;
61
+ /**
62
+ * Generic method to set a stored custom property in docx
63
+ * @static
64
+ * @param {Object} docx - The docx object to store the property in
65
+ * @param {string} propertyName - Name of the property
66
+ * @param {string|Function} value - Value or function that returns the value
67
+ * @param {boolean} preserveExisting - If true, won't overwrite existing values
68
+ * @returns {string} The stored value
69
+ */
70
+ static setStoredCustomProperty(docx: any, propertyName: string, value: string | Function, preserveExisting?: boolean): string;
71
+ static getStoredSuperdocVersion(docx: any): string;
72
+ static setStoredSuperdocVersion(docx?: any, version?: any): string;
73
+ /**
74
+ * Get document GUID from docx files (static method)
75
+ * @static
76
+ * @param {Array} docx - Array of docx file objects
77
+ * @returns {string|null} The document GUID
78
+ */
79
+ static extractDocumentGuid(docx: any[]): string | null;
80
+ static getStoredSuperdocId(docx: any): string;
81
+ static updateDocumentVersion(docx: any, version: any): string;
55
82
  constructor(params?: any);
56
83
  debug: any;
57
84
  declaration: any;
@@ -91,6 +118,9 @@ export class SuperConverter {
91
118
  documentInternalId: any;
92
119
  fileSource: any;
93
120
  documentId: any;
121
+ documentGuid: any;
122
+ documentHash: string;
123
+ documentModified: boolean;
94
124
  /**
95
125
  * Get the DocxHelpers object that contains utility functions for working with docx files.
96
126
  * @returns {import('./docx-helpers/docx-helpers.js').DocxHelpers} The DocxHelpers object.
@@ -98,6 +128,32 @@ export class SuperConverter {
98
128
  get docxHelpers(): any;
99
129
  parseFromXml(): void;
100
130
  parseXmlToJson(xml: any): any;
131
+ /**
132
+ * Get the permanent document GUID
133
+ * @returns {string|null} The document GUID (only for modified documents)
134
+ */
135
+ getDocumentGuid(): string | null;
136
+ /**
137
+ * Get the SuperDoc version for this converter instance
138
+ * @returns {string|null} The SuperDoc version or null if not available
139
+ */
140
+ getSuperdocVersion(): string | null;
141
+ /**
142
+ * Resolve existing document GUID (synchronous)
143
+ */
144
+ resolveDocumentGuid(): void;
145
+ /**
146
+ * Get Microsoft's docId from settings.xml (READ ONLY)
147
+ */
148
+ getMicrosoftDocId(): any;
149
+ /**
150
+ * Get document identifier (GUID or hash) - async for lazy hash generation
151
+ */
152
+ getDocumentIdentifier(): Promise<any>;
153
+ /**
154
+ * Promote from hash to GUID on first edit
155
+ */
156
+ promoteToGuid(): any;
101
157
  getDocumentDefaultStyles(): {};
102
158
  getDocumentFonts(): string;
103
159
  getDocumentInternalId(): void;
@@ -57,21 +57,10 @@ export namespace DEFAULT_CUSTOM_XML {
57
57
  elements: any[];
58
58
  }[];
59
59
  }
60
- export namespace SETTINGS_CUSTOM_XML {
61
- let elements_1: {
62
- type: string;
63
- name: string;
64
- attributes: {
65
- 'xmlns:w': string;
66
- };
67
- elements: any[];
68
- }[];
69
- export { elements_1 as elements };
70
- }
71
60
  export namespace COMMENT_REF {
72
61
  export let type: string;
73
62
  export let name: string;
74
- let elements_2: ({
63
+ let elements_1: ({
75
64
  type: string;
76
65
  name: string;
77
66
  elements: {
@@ -86,7 +75,7 @@ export namespace COMMENT_REF {
86
75
  name: string;
87
76
  elements?: undefined;
88
77
  })[];
89
- export { elements_2 as elements };
78
+ export { elements_1 as elements };
90
79
  }
91
80
  export namespace DEFAULT_LINKED_STYLES {
92
81
  namespace Normal {
@@ -99,7 +88,7 @@ export namespace DEFAULT_LINKED_STYLES {
99
88
  'w:default': string;
100
89
  'w:styleId': string;
101
90
  };
102
- let elements_3: ({
91
+ let elements_2: ({
103
92
  type: string;
104
93
  name: string;
105
94
  attributes: {
@@ -110,7 +99,7 @@ export namespace DEFAULT_LINKED_STYLES {
110
99
  name: string;
111
100
  attributes?: undefined;
112
101
  })[];
113
- export { elements_3 as elements };
102
+ export { elements_2 as elements };
114
103
  }
115
104
  namespace Title {
116
105
  let type_2: string;
@@ -122,7 +111,7 @@ export namespace DEFAULT_LINKED_STYLES {
122
111
  'w:styleId': string;
123
112
  };
124
113
  export { attributes_1 as attributes };
125
- let elements_4: ({
114
+ let elements_3: ({
126
115
  type: string;
127
116
  name: string;
128
117
  attributes: {
@@ -175,7 +164,7 @@ export namespace DEFAULT_LINKED_STYLES {
175
164
  })[];
176
165
  attributes?: undefined;
177
166
  })[];
178
- export { elements_4 as elements };
167
+ export { elements_3 as elements };
179
168
  }
180
169
  namespace Subtitle {
181
170
  let type_3: string;
@@ -187,7 +176,7 @@ export namespace DEFAULT_LINKED_STYLES {
187
176
  'w:styleId': string;
188
177
  };
189
178
  export { attributes_2 as attributes };
190
- let elements_5: ({
179
+ let elements_4: ({
191
180
  type: string;
192
181
  name: string;
193
182
  attributes: {
@@ -264,7 +253,7 @@ export namespace DEFAULT_LINKED_STYLES {
264
253
  })[];
265
254
  attributes?: undefined;
266
255
  })[];
267
- export { elements_5 as elements };
256
+ export { elements_4 as elements };
268
257
  }
269
258
  namespace Heading1 {
270
259
  let type_4: string;
@@ -276,7 +265,7 @@ export namespace DEFAULT_LINKED_STYLES {
276
265
  'w:styleId': string;
277
266
  };
278
267
  export { attributes_3 as attributes };
279
- let elements_6: ({
268
+ let elements_5: ({
280
269
  type: string;
281
270
  name: string;
282
271
  attributes: {
@@ -355,7 +344,7 @@ export namespace DEFAULT_LINKED_STYLES {
355
344
  })[];
356
345
  attributes?: undefined;
357
346
  })[];
358
- export { elements_6 as elements };
347
+ export { elements_5 as elements };
359
348
  }
360
349
  namespace Heading2 {
361
350
  let type_5: string;
@@ -367,7 +356,7 @@ export namespace DEFAULT_LINKED_STYLES {
367
356
  'w:styleId': string;
368
357
  };
369
358
  export { attributes_4 as attributes };
370
- let elements_7: ({
359
+ let elements_6: ({
371
360
  type: string;
372
361
  name: string;
373
362
  attributes: {
@@ -446,7 +435,7 @@ export namespace DEFAULT_LINKED_STYLES {
446
435
  })[];
447
436
  attributes?: undefined;
448
437
  })[];
449
- export { elements_7 as elements };
438
+ export { elements_6 as elements };
450
439
  }
451
440
  namespace Heading3 {
452
441
  let type_6: string;
@@ -458,7 +447,7 @@ export namespace DEFAULT_LINKED_STYLES {
458
447
  'w:styleId': string;
459
448
  };
460
449
  export { attributes_5 as attributes };
461
- let elements_8: ({
450
+ let elements_7: ({
462
451
  type: string;
463
452
  name: string;
464
453
  attributes: {
@@ -531,7 +520,7 @@ export namespace DEFAULT_LINKED_STYLES {
531
520
  })[];
532
521
  attributes?: undefined;
533
522
  })[];
534
- export { elements_8 as elements };
523
+ export { elements_7 as elements };
535
524
  }
536
525
  }
537
526
  export namespace COMMENTS_XML_DEF {
@@ -543,7 +532,7 @@ export namespace COMMENTS_XML_DEF {
543
532
  }
544
533
  export { attributes_6 as attributes };
545
534
  }
546
- let elements_9: {
535
+ let elements_8: {
547
536
  type: string;
548
537
  name: string;
549
538
  attributes: {
@@ -586,7 +575,7 @@ export namespace COMMENTS_XML_DEF {
586
575
  };
587
576
  elements: any[];
588
577
  }[];
589
- export { elements_9 as elements };
578
+ export { elements_8 as elements };
590
579
  }
591
580
  export namespace COMMENTS_EXTENDED_XML_DEF {
592
581
  export namespace declaration_1 {
@@ -601,7 +590,7 @@ export namespace COMMENTS_EXTENDED_XML_DEF {
601
590
  export { attributes_7 as attributes };
602
591
  }
603
592
  export { declaration_1 as declaration };
604
- let elements_10: {
593
+ let elements_9: {
605
594
  type: string;
606
595
  name: string;
607
596
  attributes: {
@@ -644,7 +633,7 @@ export namespace COMMENTS_EXTENDED_XML_DEF {
644
633
  };
645
634
  elements: any[];
646
635
  }[];
647
- export { elements_10 as elements };
636
+ export { elements_9 as elements };
648
637
  }
649
638
  export namespace COMMENTS_EXTENSIBLE_XML_DEF {
650
639
  export namespace declaration_2 {
@@ -659,7 +648,7 @@ export namespace COMMENTS_EXTENSIBLE_XML_DEF {
659
648
  export { attributes_8 as attributes };
660
649
  }
661
650
  export { declaration_2 as declaration };
662
- let elements_11: {
651
+ let elements_10: {
663
652
  type: string;
664
653
  name: string;
665
654
  attributes: {
@@ -703,7 +692,7 @@ export namespace COMMENTS_EXTENSIBLE_XML_DEF {
703
692
  };
704
693
  elements: any[];
705
694
  }[];
706
- export { elements_11 as elements };
695
+ export { elements_10 as elements };
707
696
  }
708
697
  export namespace COMMENTS_IDS_XML_DEF {
709
698
  export namespace declaration_3 {
@@ -718,7 +707,7 @@ export namespace COMMENTS_IDS_XML_DEF {
718
707
  export { attributes_9 as attributes };
719
708
  }
720
709
  export { declaration_3 as declaration };
721
- let elements_12: {
710
+ let elements_11: {
722
711
  type: string;
723
712
  name: string;
724
713
  attributes: {
@@ -761,7 +750,7 @@ export namespace COMMENTS_IDS_XML_DEF {
761
750
  };
762
751
  elements: any[];
763
752
  }[];
764
- export { elements_12 as elements };
753
+ export { elements_11 as elements };
765
754
  }
766
755
  export namespace DOCUMENT_RELS_XML_DEF {
767
756
  export namespace declaration_4 {
@@ -776,7 +765,7 @@ export namespace DOCUMENT_RELS_XML_DEF {
776
765
  export { attributes_10 as attributes };
777
766
  }
778
767
  export { declaration_4 as declaration };
779
- let elements_13: {
768
+ let elements_12: {
780
769
  type: string;
781
770
  name: string;
782
771
  attributes: {
@@ -792,7 +781,7 @@ export namespace DOCUMENT_RELS_XML_DEF {
792
781
  };
793
782
  }[];
794
783
  }[];
795
- export { elements_13 as elements };
784
+ export { elements_12 as elements };
796
785
  }
797
786
  export namespace PEOPLE_XML_DEF {
798
787
  export namespace declaration_5 {
@@ -807,7 +796,7 @@ export namespace PEOPLE_XML_DEF {
807
796
  export { attributes_11 as attributes };
808
797
  }
809
798
  export { declaration_5 as declaration };
810
- let elements_14: {
799
+ let elements_13: {
811
800
  type: string;
812
801
  name: string;
813
802
  attributes: {
@@ -857,7 +846,7 @@ export namespace PEOPLE_XML_DEF {
857
846
  elements: any[];
858
847
  }[];
859
848
  }[];
860
- export { elements_14 as elements };
849
+ export { elements_13 as elements };
861
850
  }
862
851
  export namespace CONTENT_TYPES {
863
852
  export namespace declaration_6 {
@@ -872,7 +861,7 @@ export namespace CONTENT_TYPES {
872
861
  export { attributes_12 as attributes };
873
862
  }
874
863
  export { declaration_6 as declaration };
875
- let elements_15: {
864
+ let elements_14: {
876
865
  type: string;
877
866
  name: string;
878
867
  attributes: {
@@ -896,7 +885,7 @@ export namespace CONTENT_TYPES {
896
885
  };
897
886
  })[];
898
887
  }[];
899
- export { elements_15 as elements };
888
+ export { elements_14 as elements };
900
889
  }
901
890
  /**
902
891
  * @type {CommentsXmlDefinitions}