@harbour-enterprises/superdoc 0.26.0-next.2 → 0.26.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-Bk6eeTRu.cjs → PdfViewer-Ddo_DM5d.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BUDqeNx7.es.js → PdfViewer-juhTQvgB.es.js} +1 -1
  3. package/dist/chunks/{index-kTEBpqiG.es.js → index-CV1DF2JY.es.js} +2 -4
  4. package/dist/chunks/{index-W-nB4woH.cjs → index-CgZ_A5Ca.cjs} +2 -4
  5. package/dist/chunks/{super-editor.es-C74O3hXJ.cjs → super-editor.es-CGKyR4l8.cjs} +5048 -4926
  6. package/dist/chunks/{super-editor.es-DznCuGcp.es.js → super-editor.es-zFJj_1tC.es.js} +5048 -4926
  7. package/dist/core/collaboration/helpers.d.ts.map +1 -1
  8. package/dist/core/types/index.d.ts.map +1 -1
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-khE-H7hH.js → converter-CTSH6ApH.js} +5056 -4972
  11. package/dist/super-editor/chunks/{docx-zipper-KoUEtzIj.js → docx-zipper-B9s4CP-_.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-wd9pvfTV.js → editor-CwtMgXx9.js} +86 -48
  13. package/dist/super-editor/chunks/{toolbar-CWJmT_bY.js → toolbar-C66Pu-nq.js} +2 -2
  14. package/dist/super-editor/converter.es.js +1 -1
  15. package/dist/super-editor/docx-zipper.es.js +2 -2
  16. package/dist/super-editor/editor.es.js +3 -3
  17. package/dist/super-editor/file-zipper.es.js +1 -1
  18. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/listImporter.d.ts +2 -2
  19. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/numberingCache.d.ts +37 -0
  20. package/dist/super-editor/super-editor/src/extensions/list-item/ListItemNodeView.d.ts +8 -2
  21. package/dist/super-editor/super-editor.es.js +6 -6
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +5048 -4928
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-khE-H7hH.js";
1
+ import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-CTSH6ApH.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
  }
@@ -9,12 +9,12 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
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, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initTrackChanges_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;
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, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initTrackChanges_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, applyIndentStyling_fn, _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 twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-khE-H7hH.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 docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-CTSH6ApH.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-KoUEtzIj.js";
17
+ import { D as DocxZipper } from "./docx-zipper-B9s4CP-_.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -19737,7 +19737,11 @@ function getAdjacentListItemNodeView({ nodeView, pos, direction, activeNodeViews
19737
19737
  if (view === nodeView) return;
19738
19738
  let viewPos;
19739
19739
  try {
19740
- viewPos = view.getPos();
19740
+ if (typeof view.getResolvedPos === "function") {
19741
+ viewPos = view.getResolvedPos();
19742
+ } else if (typeof view.getPos === "function") {
19743
+ viewPos = view.getPos();
19744
+ }
19741
19745
  } catch {
19742
19746
  return;
19743
19747
  }
@@ -19903,54 +19907,44 @@ class ListItemNodeView {
19903
19907
  this.editor = editor;
19904
19908
  this.decorations = decorations;
19905
19909
  this.view = editor.view;
19906
- this.getPos = getPos;
19910
+ this._rawGetPos = getPos;
19911
+ this._pendingIndentRefresh = null;
19912
+ this.getPos = () => this.getResolvedPos();
19907
19913
  __privateMethod(this, _ListItemNodeView_instances, init_fn3).call(this);
19908
19914
  activeListItemNodeViews.add(this);
19909
19915
  }
19910
- refreshIndentStyling() {
19911
- const { attrs } = this.node;
19912
- const { styleId, numId, level, indent: inlineIndent } = attrs;
19913
- const defs = getListItemStyleDefinitions({ styleId, node: this.node, numId, level, editor: this.editor });
19914
- const visibleIndent = getVisibleIndent(defs.stylePpr, defs.numDefPpr, inlineIndent);
19915
- const lvlJc = defs.numLvlJs?.attributes?.["w:val"] || "left";
19916
- const contentLeft = visibleIndent.left || 0;
19917
- const hanging = visibleIndent.hanging || 0;
19918
- const handlers2 = {
19919
- right: () => {
19920
- const calculatedWidth = calculateMarkerWidth(this.dom, this.numberingDOM, this.editor);
19921
- const minMarkerWidth = Math.max(calculatedWidth, MIN_MARKER_WIDTH);
19922
- const effectiveHanging = Math.max(hanging, minMarkerWidth);
19923
- const markerLeft = contentLeft - effectiveHanging - MARKER_OFFSET_RIGHT;
19924
- this.contentDOM.style.marginLeft = `${contentLeft}px`;
19925
- this.numberingDOM.style.left = `${markerLeft}px`;
19926
- this.numberingDOM.style.width = `${effectiveHanging}px`;
19927
- this.numberingDOM.style.textAlign = "right";
19928
- },
19929
- left: () => {
19930
- const calculatedWidth = calculateMarkerWidth(this.dom, this.numberingDOM, this.editor);
19931
- const minMarkerWidth = Math.max(calculatedWidth, MIN_MARKER_WIDTH);
19932
- let markerLeft = contentLeft - hanging;
19933
- if (markerLeft === contentLeft) {
19934
- markerLeft -= minMarkerWidth;
19935
- } else if (minMarkerWidth > hanging) {
19936
- const diff = minMarkerWidth - hanging;
19937
- markerLeft -= diff;
19938
- }
19939
- this.contentDOM.style.marginLeft = `${contentLeft}px`;
19940
- this.numberingDOM.style.left = `${markerLeft}px`;
19941
- this.numberingDOM.style.width = "";
19942
- this.numberingDOM.style.textAlign = "";
19943
- }
19944
- };
19945
- const handleStyles = handlers2[lvlJc] ?? handlers2.left;
19946
- handleStyles();
19916
+ getResolvedPos() {
19917
+ if (typeof this._rawGetPos !== "function") return null;
19918
+ try {
19919
+ const resolved = this._rawGetPos();
19920
+ return typeof resolved === "number" ? resolved : null;
19921
+ } catch {
19922
+ return null;
19923
+ }
19924
+ }
19925
+ invalidateResolvedPos() {
19926
+ }
19927
+ refreshIndentStyling({ immediate = false } = {}) {
19928
+ const raf = typeof globalThis !== "undefined" ? globalThis.requestAnimationFrame : void 0;
19929
+ const shouldSchedule = !immediate && typeof raf === "function";
19930
+ if (!shouldSchedule) {
19931
+ this._pendingIndentRefresh = null;
19932
+ __privateMethod(this, _ListItemNodeView_instances, applyIndentStyling_fn).call(this);
19933
+ return;
19934
+ }
19935
+ if (this._pendingIndentRefresh != null) return;
19936
+ this._pendingIndentRefresh = raf(() => {
19937
+ this._pendingIndentRefresh = null;
19938
+ __privateMethod(this, _ListItemNodeView_instances, applyIndentStyling_fn).call(this);
19939
+ });
19947
19940
  }
19948
19941
  update(node, decorations) {
19949
19942
  this.node = node;
19950
19943
  this.decorations = decorations;
19944
+ this.invalidateResolvedPos();
19951
19945
  const { fontSize, fontFamily, lineHeight } = resolveListItemTypography({
19952
19946
  node,
19953
- pos: this.getPos(),
19947
+ pos: this.getResolvedPos(),
19954
19948
  editor: this.editor,
19955
19949
  nodeView: this,
19956
19950
  activeNodeViews: activeListItemNodeViews
@@ -19958,10 +19952,16 @@ class ListItemNodeView {
19958
19952
  this.dom.style.fontSize = fontSize;
19959
19953
  this.dom.style.fontFamily = fontFamily || "inherit";
19960
19954
  this.dom.style.lineHeight = lineHeight || "";
19955
+ this.refreshIndentStyling();
19961
19956
  }
19962
19957
  destroy() {
19963
19958
  activeListItemNodeViews.delete(this);
19964
19959
  this.numberingDOM.removeEventListener("click", this.handleNumberingClick);
19960
+ const caf = typeof globalThis !== "undefined" ? globalThis.cancelAnimationFrame : void 0;
19961
+ if (this._pendingIndentRefresh != null && typeof caf === "function") {
19962
+ caf(this._pendingIndentRefresh);
19963
+ }
19964
+ this._pendingIndentRefresh = null;
19965
19965
  }
19966
19966
  }
19967
19967
  _ListItemNodeView_instances = new WeakSet();
@@ -19978,10 +19978,10 @@ init_fn3 = function() {
19978
19978
  customFormat
19979
19979
  });
19980
19980
  } else {
19981
- orderMarker = docxNumberigHelpers.normalizeLvlTextChar(lvlText);
19981
+ orderMarker = docxNumberingHelpers.normalizeLvlTextChar(lvlText);
19982
19982
  }
19983
19983
  }
19984
- const pos = this.getPos();
19984
+ const pos = this.getResolvedPos();
19985
19985
  const { fontSize, fontFamily, lineHeight } = resolveListItemTypography({
19986
19986
  node: this.node,
19987
19987
  pos,
@@ -20010,10 +20010,48 @@ init_fn3 = function() {
20010
20010
  this.dom.appendChild(this.contentDOM);
20011
20011
  this.refreshIndentStyling();
20012
20012
  };
20013
+ applyIndentStyling_fn = function() {
20014
+ const { attrs } = this.node;
20015
+ const { styleId, numId, level, indent: inlineIndent } = attrs;
20016
+ const defs = getListItemStyleDefinitions({ styleId, node: this.node, numId, level, editor: this.editor });
20017
+ const visibleIndent = getVisibleIndent(defs.stylePpr, defs.numDefPpr, inlineIndent);
20018
+ const lvlJc = defs.numLvlJs?.attributes?.["w:val"] || "left";
20019
+ const contentLeft = visibleIndent.left || 0;
20020
+ const hanging = visibleIndent.hanging || 0;
20021
+ const handlers2 = {
20022
+ right: () => {
20023
+ const calculatedWidth = calculateMarkerWidth(this.dom, this.numberingDOM, this.editor);
20024
+ const minMarkerWidth = Math.max(calculatedWidth, MIN_MARKER_WIDTH);
20025
+ const effectiveHanging = Math.max(hanging, minMarkerWidth);
20026
+ const markerLeft = contentLeft - effectiveHanging - MARKER_OFFSET_RIGHT;
20027
+ this.contentDOM.style.marginLeft = `${contentLeft}px`;
20028
+ this.numberingDOM.style.left = `${markerLeft}px`;
20029
+ this.numberingDOM.style.width = `${effectiveHanging}px`;
20030
+ this.numberingDOM.style.textAlign = "right";
20031
+ },
20032
+ left: () => {
20033
+ const calculatedWidth = calculateMarkerWidth(this.dom, this.numberingDOM, this.editor);
20034
+ const minMarkerWidth = Math.max(calculatedWidth, MIN_MARKER_WIDTH);
20035
+ let markerLeft = contentLeft - hanging;
20036
+ if (markerLeft === contentLeft) {
20037
+ markerLeft -= minMarkerWidth;
20038
+ } else if (minMarkerWidth > hanging) {
20039
+ const diff = minMarkerWidth - hanging;
20040
+ markerLeft -= diff;
20041
+ }
20042
+ this.contentDOM.style.marginLeft = `${contentLeft}px`;
20043
+ this.numberingDOM.style.left = `${markerLeft}px`;
20044
+ this.numberingDOM.style.width = "";
20045
+ this.numberingDOM.style.textAlign = "";
20046
+ }
20047
+ };
20048
+ const handleStyles = handlers2[lvlJc] ?? handlers2.left;
20049
+ handleStyles();
20050
+ };
20013
20051
  function refreshAllListItemNodeViews() {
20014
20052
  activeListItemNodeViews.forEach((nodeView) => {
20015
20053
  try {
20016
- nodeView.refreshIndentStyling();
20054
+ nodeView.refreshIndentStyling({ immediate: true });
20017
20055
  } catch (error) {
20018
20056
  console.error("Error refreshing list item node view:", error);
20019
20057
  activeListItemNodeViews.delete(nodeView);
@@ -20089,7 +20127,7 @@ function orderedListSync(editor) {
20089
20127
  const start2 = parseInt(numberingDefStart) || 1;
20090
20128
  if (!listMap.has(numId)) {
20091
20129
  const generatedLevels = {};
20092
- const initialPath = docxNumberigHelpers.generateListPath(level, numId, styleId, generatedLevels, docx);
20130
+ const initialPath = docxNumberingHelpers.generateListPath(level, numId, styleId, generatedLevels, docx);
20093
20131
  listMap.set(numId, initialPath || []);
20094
20132
  listInitialized.set(numId, false);
20095
20133
  }
@@ -27028,7 +27066,7 @@ const Image = Node$1.create({
27028
27066
  return {
27029
27067
  allowBase64: true,
27030
27068
  htmlAttributes: {
27031
- style: "display: inline-block;",
27069
+ style: "display: inline-block; content-visibility: auto; contain-intrinsic-size: auto 600px;",
27032
27070
  "aria-label": "Image node"
27033
27071
  }
27034
27072
  };
@@ -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-khE-H7hH.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-wd9pvfTV.js";
2
+ import { p as process$1 } from "./converter-CTSH6ApH.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CwtMgXx9.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-khE-H7hH.js";
1
+ import { a5 } from "./chunks/converter-CTSH6ApH.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-khE-H7hH.js";
2
- import { D } from "./chunks/docx-zipper-KoUEtzIj.js";
1
+ import "./chunks/converter-CTSH6ApH.js";
2
+ import { D } from "./chunks/docx-zipper-B9s4CP-_.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-wd9pvfTV.js";
2
- import "./chunks/converter-khE-H7hH.js";
3
- import "./chunks/docx-zipper-KoUEtzIj.js";
1
+ import { E } from "./chunks/editor-CwtMgXx9.js";
2
+ import "./chunks/converter-CTSH6ApH.js";
3
+ import "./chunks/docx-zipper-B9s4CP-_.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-KoUEtzIj.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-B9s4CP-_.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -107,10 +107,10 @@ export const handleListNode: any;
107
107
  * @type {import("docxImporter").NodeHandlerEntry}
108
108
  */
109
109
  export const listHandlerEntity: any;
110
- export function getAbstractDefinition(numId: any, docx: any): any;
110
+ export function getAbstractDefinition(numId: any, docx: any): import("./numberingCache.js").DocxXmlElement;
111
111
  export function generateListPath(level: any, numId: any, styleId: any, levels: any, docx: any): any[];
112
112
  export function getListLevelDefinitionTag(numId: string, level: string, pStyleId: any, docx: any): any;
113
- export namespace docxNumberigHelpers {
113
+ export namespace docxNumberingHelpers {
114
114
  export { getListLevelDefinitionTag };
115
115
  export { combineIndents };
116
116
  export { parseIndentElement };
@@ -0,0 +1,37 @@
1
+ /** Key used to store the numbering cache on the docx container. */
2
+ export const NUMBERING_CACHE_KEY: "numbering-cache";
3
+ /** Symbol used to memoize level lookups on abstract numbering elements. */
4
+ export const LEVELS_MAP_KEY: unique symbol;
5
+ export function buildNumberingCache(docx: DocxPackage | null | undefined): NumberingCache;
6
+ export function ensureNumberingCache(docx: DocxPackage | null | undefined): NumberingCache;
7
+ export function getNumberingCache(docx: DocxPackage | null | undefined): NumberingCache;
8
+ export type DocxXmlElement = {
9
+ name?: string;
10
+ attributes?: Record<string, unknown>;
11
+ elements?: DocxXmlElement[];
12
+ };
13
+ export type DocxPackage = Record<string, {
14
+ elements?: DocxXmlElement[];
15
+ }>;
16
+ export type NumberingCache = {
17
+ /**
18
+ * Maps w:numId values to their abstract numbering ids.
19
+ */
20
+ numToAbstractId: Map<string, string>;
21
+ /**
22
+ * Stores abstract numbering definitions by id.
23
+ */
24
+ abstractById: Map<string, DocxXmlElement>;
25
+ /**
26
+ * Stores abstract numbering definitions keyed by the template value.
27
+ */
28
+ templateById: Map<string, DocxXmlElement>;
29
+ /**
30
+ * Maps w:numId to their resolved abstract numbering element.
31
+ */
32
+ numToDefinition: Map<string, DocxXmlElement>;
33
+ /**
34
+ * Stores the raw w:num nodes by id for quick lookup.
35
+ */
36
+ numNodesById: Map<string, DocxXmlElement>;
37
+ };
@@ -5,11 +5,17 @@ export class ListItemNodeView {
5
5
  editor: any;
6
6
  decorations: any;
7
7
  view: any;
8
- getPos: any;
8
+ _rawGetPos: any;
9
+ _pendingIndentRefresh: any;
10
+ getPos: () => number;
9
11
  dom: HTMLLIElement;
10
12
  numberingDOM: HTMLSpanElement;
11
13
  contentDOM: HTMLDivElement;
12
- refreshIndentStyling(): void;
14
+ getResolvedPos(): number;
15
+ invalidateResolvedPos(): void;
16
+ refreshIndentStyling({ immediate }?: {
17
+ immediate?: boolean;
18
+ }): void;
13
19
  handleNumberingClick: () => void;
14
20
  update(node: any, decorations: any): void;
15
21
  destroy(): void;
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn;
12
- import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-khE-H7hH.js";
13
- import { c1, a5, i, a2 } from "./chunks/converter-khE-H7hH.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-wd9pvfTV.js";
15
- import { t, C, v, T, p, w, q } from "./chunks/editor-wd9pvfTV.js";
12
+ import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-CTSH6ApH.js";
13
+ import { c1, a5, i, a2 } from "./chunks/converter-CTSH6ApH.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-CwtMgXx9.js";
15
+ import { t, C, v, T, p, w, q } from "./chunks/editor-CwtMgXx9.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-CWJmT_bY.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-C66Pu-nq.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-KoUEtzIj.js";
19
+ import { D } from "./chunks/docx-zipper-B9s4CP-_.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-CWJmT_bY.js";
3
- import "./chunks/editor-wd9pvfTV.js";
2
+ import { T } from "./chunks/toolbar-C66Pu-nq.js";
3
+ import "./chunks/editor-CwtMgXx9.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C74O3hXJ.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CGKyR4l8.cjs");
4
4
  require("./chunks/vue-DKMj1I9B.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-DznCuGcp.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-zFJj_1tC.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C74O3hXJ.cjs");
4
- const superdoc = require("./chunks/index-W-nB4woH.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CGKyR4l8.cjs");
4
+ const superdoc = require("./chunks/index-CgZ_A5Ca.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DznCuGcp.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-kTEBpqiG.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-zFJj_1tC.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-CV1DF2JY.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  export {