@harbour-enterprises/superdoc 1.0.0-beta.21 → 1.0.0-beta.22

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 (28) hide show
  1. package/dist/chunks/{PdfViewer-CEwbF85g.es.js → PdfViewer-B42JCeYb.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-CqAQvFv3.cjs → PdfViewer-CswYWp1h.cjs} +1 -1
  3. package/dist/chunks/{index-DSuc12CK-DH_DeF0B.es.js → index-895wSAjT-C4ksiI6n.es.js} +1 -1
  4. package/dist/chunks/{index-DSuc12CK-Dpg5Hd9W.cjs → index-895wSAjT-CWlZl8zz.cjs} +1 -1
  5. package/dist/chunks/{index-Dy-eAVHL.cjs → index-CK4eX_iu.cjs} +7 -5
  6. package/dist/chunks/{index-BFobqgP4.es.js → index-DBmh710D.es.js} +7 -5
  7. package/dist/chunks/{super-editor.es-C2UuUFg3.cjs → super-editor.es-BkRizaIE.cjs} +206 -77
  8. package/dist/chunks/{super-editor.es-B5YJmpPg.es.js → super-editor.es-V792hb-6.es.js} +206 -77
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-Cw0V00On.js → converter-DhkZt4Pv.js} +6 -6
  12. package/dist/super-editor/chunks/{docx-zipper-D7k6lS5l.js → docx-zipper-Bajmc-RM.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-CDWzRc4H.js → editor-oZjoYNA0.js} +208 -78
  14. package/dist/super-editor/chunks/{index-DSuc12CK.js → index-895wSAjT.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-CHJspeuY.js → toolbar-Bn5LTbq9.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor.es.js +6 -6
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +2 -2
  25. package/dist/superdoc.es.js +2 -2
  26. package/dist/superdoc.umd.js +212 -81
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
@@ -36371,7 +36371,7 @@ const _SuperConverter = class _SuperConverter2 {
36371
36371
  static getStoredSuperdocVersion(docx) {
36372
36372
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
36373
36373
  }
36374
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.21") {
36374
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.22") {
36375
36375
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
36376
36376
  }
36377
36377
  /**
@@ -39677,7 +39677,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
39677
39677
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
39678
39678
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
39679
39679
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
39680
- 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
39680
+ 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
39681
39681
  var GOOD_LEAF_SIZE = 200;
39682
39682
  var RopeSequence = function RopeSequence2() {
39683
39683
  };
@@ -49579,6 +49579,59 @@ function skipTab(dir) {
49579
49579
  return true;
49580
49580
  };
49581
49581
  }
49582
+ const decreaseListIndent = () => ({ editor, tr, dispatch }) => {
49583
+ const handled = changeListLevel(-1, editor, tr);
49584
+ if (handled && dispatch) {
49585
+ dispatch(tr);
49586
+ }
49587
+ return handled;
49588
+ };
49589
+ const removeNumberingProperties = ({ checkType = "startParagraph" } = {}) => (props) => {
49590
+ const { tr, state: state2, editor, dispatch } = props;
49591
+ const { node: paragraph, pos } = findParentNode(isList)(state2.selection) || {};
49592
+ if (!paragraph) return false;
49593
+ if (checkType === "empty" && !isVisuallyEmptyParagraph(paragraph)) return false;
49594
+ if (checkType === "startParagraph") {
49595
+ const { $from, empty: empty2 } = state2.selection;
49596
+ if ((!empty2 || $from.parentOffset !== 0) && !isVisuallyEmptyParagraph(paragraph)) return false;
49597
+ }
49598
+ const ilvl = getResolvedParagraphProperties(paragraph).numberingProperties.ilvl;
49599
+ if (ilvl > 0) {
49600
+ const outdented = decreaseListIndent()(props);
49601
+ if (outdented) {
49602
+ tr.scrollIntoView();
49603
+ }
49604
+ return outdented;
49605
+ } else {
49606
+ updateNumberingProperties(null, paragraph, pos, editor, tr);
49607
+ }
49608
+ if (dispatch) dispatch(tr);
49609
+ return true;
49610
+ };
49611
+ function isVisuallyEmptyParagraph(node) {
49612
+ if (!node || node.type.name !== "paragraph") return false;
49613
+ let hasHardBreak = false;
49614
+ node.descendants((n) => {
49615
+ if (n.type && n.type.name === "hardBreak") {
49616
+ hasHardBreak = true;
49617
+ return false;
49618
+ }
49619
+ return true;
49620
+ });
49621
+ if (hasHardBreak) return false;
49622
+ const text = (node.textContent || "").replace(/\u200b/g, "").trim();
49623
+ if (text.length > 0) return false;
49624
+ let hasInlineLeaf = false;
49625
+ node.descendants((n) => {
49626
+ if (n.isInline && n.isLeaf && n.type?.name !== "hardBreak" && n.type?.name !== "run") {
49627
+ hasInlineLeaf = true;
49628
+ return false;
49629
+ }
49630
+ return true;
49631
+ });
49632
+ if (hasInlineLeaf) return false;
49633
+ return true;
49634
+ }
49582
49635
  const toggleList = (listType) => ({ editor, state: state2, tr, dispatch }) => {
49583
49636
  let predicate;
49584
49637
  if (listType === "orderedList") {
@@ -49598,19 +49651,22 @@ const toggleList = (listType) => ({ editor, state: state2, tr, dispatch }) => {
49598
49651
  const { from: from2, to } = selection;
49599
49652
  let firstListNode = null;
49600
49653
  let hasNonListParagraphs = false;
49601
- let paragraphsInSelection = [];
49654
+ let allParagraphsInSelection = [];
49602
49655
  state2.doc.nodesBetween(from2, to, (node, pos) => {
49603
49656
  if (node.type.name === "paragraph") {
49604
- paragraphsInSelection.push({ node, pos });
49605
- if (!firstListNode && predicate(node)) {
49606
- firstListNode = node;
49607
- } else if (!predicate(node)) {
49608
- hasNonListParagraphs = true;
49609
- }
49657
+ allParagraphsInSelection.push({ node, pos });
49610
49658
  return false;
49611
49659
  }
49612
49660
  return true;
49613
49661
  });
49662
+ let paragraphsInSelection = allParagraphsInSelection.length === 1 ? allParagraphsInSelection : allParagraphsInSelection.filter(({ node }) => !isVisuallyEmptyParagraph(node));
49663
+ for (const { node } of paragraphsInSelection) {
49664
+ if (!firstListNode && predicate(node)) {
49665
+ firstListNode = node;
49666
+ } else if (!predicate(node)) {
49667
+ hasNonListParagraphs = true;
49668
+ }
49669
+ }
49614
49670
  if (!firstListNode && from2 > 0) {
49615
49671
  const $from = state2.doc.resolve(from2);
49616
49672
  const parentIndex = $from.index(-1);
@@ -49654,11 +49710,30 @@ const toggleList = (listType) => ({ editor, state: state2, tr, dispatch }) => {
49654
49710
  }
49655
49711
  updateNumberingProperties(sharedNumberingProperties, node, pos, editor, tr);
49656
49712
  }
49657
- const newTo = tr.mapping.map(to);
49658
- if (newTo >= 0 && newTo <= tr.doc.content.size) {
49659
- try {
49660
- tr.setSelection(state2.selection.constructor.near(tr.doc.resolve(newTo)));
49661
- } catch {
49713
+ if (paragraphsInSelection.length > 0) {
49714
+ const firstPara = paragraphsInSelection[0];
49715
+ const lastPara = paragraphsInSelection[paragraphsInSelection.length - 1];
49716
+ const mappedFirstPos = tr.mapping.map(firstPara.pos);
49717
+ const mappedLastPos = tr.mapping.map(lastPara.pos);
49718
+ const $firstPos = tr.doc.resolve(mappedFirstPos);
49719
+ const $lastPos = tr.doc.resolve(mappedLastPos);
49720
+ const firstNode = $firstPos.nodeAfter;
49721
+ const lastNode = $lastPos.nodeAfter;
49722
+ if (firstNode && lastNode) {
49723
+ let selFrom = mappedFirstPos + 1;
49724
+ let selTo = mappedLastPos + lastNode.nodeSize - 1;
49725
+ if (firstNode.firstChild && firstNode.firstChild.type.name === "run") {
49726
+ selFrom = mappedFirstPos + 2;
49727
+ }
49728
+ if (lastNode.lastChild && lastNode.lastChild.type.name === "run") {
49729
+ selTo = mappedLastPos + lastNode.nodeSize - 2;
49730
+ }
49731
+ if (selFrom >= 0 && selTo <= tr.doc.content.size && selFrom <= selTo) {
49732
+ try {
49733
+ tr.setSelection(TextSelection$1.create(tr.doc, selFrom, selTo));
49734
+ } catch {
49735
+ }
49736
+ }
49662
49737
  }
49663
49738
  }
49664
49739
  if (dispatch) dispatch(tr);
@@ -49671,59 +49746,6 @@ const increaseListIndent = () => ({ editor, tr, dispatch }) => {
49671
49746
  }
49672
49747
  return handled;
49673
49748
  };
49674
- const decreaseListIndent = () => ({ editor, tr, dispatch }) => {
49675
- const handled = changeListLevel(-1, editor, tr);
49676
- if (handled && dispatch) {
49677
- dispatch(tr);
49678
- }
49679
- return handled;
49680
- };
49681
- const removeNumberingProperties = ({ checkType = "startParagraph" } = {}) => (props) => {
49682
- const { tr, state: state2, editor, dispatch } = props;
49683
- const { node: paragraph, pos } = findParentNode(isList)(state2.selection) || {};
49684
- if (!paragraph) return false;
49685
- if (checkType === "empty" && !isVisuallyEmptyParagraph(paragraph)) return false;
49686
- if (checkType === "startParagraph") {
49687
- const { $from, empty: empty2 } = state2.selection;
49688
- if ((!empty2 || $from.parentOffset !== 0) && !isVisuallyEmptyParagraph(paragraph)) return false;
49689
- }
49690
- const ilvl = getResolvedParagraphProperties(paragraph).numberingProperties.ilvl;
49691
- if (ilvl > 0) {
49692
- const outdented = decreaseListIndent()(props);
49693
- if (outdented) {
49694
- tr.scrollIntoView();
49695
- }
49696
- return outdented;
49697
- } else {
49698
- updateNumberingProperties(null, paragraph, pos, editor, tr);
49699
- }
49700
- if (dispatch) dispatch(tr);
49701
- return true;
49702
- };
49703
- function isVisuallyEmptyParagraph(node) {
49704
- if (!node || node.type.name !== "paragraph") return false;
49705
- let hasHardBreak = false;
49706
- node.descendants((n) => {
49707
- if (n.type && n.type.name === "hardBreak") {
49708
- hasHardBreak = true;
49709
- return false;
49710
- }
49711
- return true;
49712
- });
49713
- if (hasHardBreak) return false;
49714
- const text = (node.textContent || "").replace(/\u200b/g, "").trim();
49715
- if (text.length > 0) return false;
49716
- let hasInlineLeaf = false;
49717
- node.descendants((n) => {
49718
- if (n.isInline && n.isLeaf && n.type?.name !== "hardBreak" && n.type?.name !== "run") {
49719
- hasInlineLeaf = true;
49720
- return false;
49721
- }
49722
- return true;
49723
- });
49724
- if (hasInlineLeaf) return false;
49725
- return true;
49726
- }
49727
49749
  const restoreSelection = () => ({ editor, state: state2, tr }) => {
49728
49750
  if (editor.options.lastSelection) {
49729
49751
  const selectionTr = tr.setSelection(
@@ -49806,6 +49828,7 @@ const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
49806
49828
  insertTabCharacter,
49807
49829
  insertTabNode,
49808
49830
  isStyleTokenEnabled,
49831
+ isVisuallyEmptyParagraph,
49809
49832
  joinBackward,
49810
49833
  joinDown,
49811
49834
  joinForward,
@@ -49924,12 +49947,38 @@ const Keymap = Extension.create({
49924
49947
  const Editable = Extension.create({
49925
49948
  name: "editable",
49926
49949
  addPmPlugins() {
49950
+ const editor = this.editor;
49927
49951
  const editablePlugin = new Plugin({
49928
49952
  key: new PluginKey("editable"),
49929
49953
  props: {
49930
- editable: () => {
49931
- return this.editor.options.editable;
49932
- }
49954
+ editable: () => editor.options.editable,
49955
+ handleDOMEvents: {
49956
+ beforeinput: (_view, event) => {
49957
+ if (!editor.options.editable) {
49958
+ event.preventDefault();
49959
+ return true;
49960
+ }
49961
+ return false;
49962
+ },
49963
+ mousedown: (_view, event) => {
49964
+ if (!editor.options.editable) {
49965
+ event.preventDefault();
49966
+ return true;
49967
+ }
49968
+ return false;
49969
+ },
49970
+ focus: (view, event) => {
49971
+ if (!editor.options.editable) {
49972
+ event.preventDefault();
49973
+ view.dom.blur();
49974
+ return true;
49975
+ }
49976
+ return false;
49977
+ }
49978
+ },
49979
+ handleClick: () => !editor.options.editable,
49980
+ handleDoubleClick: () => !editor.options.editable,
49981
+ handleTripleClick: () => !editor.options.editable
49933
49982
  }
49934
49983
  });
49935
49984
  return [editablePlugin];
@@ -53487,7 +53536,7 @@ const isHeadless = (editor) => {
53487
53536
  const shouldSkipNodeView = (editor) => {
53488
53537
  return isHeadless(editor);
53489
53538
  };
53490
- const summaryVersion = "1.0.0-beta.21";
53539
+ const summaryVersion = "1.0.0-beta.22";
53491
53540
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
53492
53541
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
53493
53542
  function mapAttributes(attrs) {
@@ -53892,10 +53941,23 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53892
53941
  this.view.updateState(this.state);
53893
53942
  }
53894
53943
  /**
53895
- * Set whether the editor is editable
53944
+ * Set whether the editor is editable.
53945
+ *
53946
+ * When setting to non-editable, this method:
53947
+ * - Forces ProseMirror to re-evaluate the editable prop from the Editable plugin
53948
+ * - Blurs the editor to remove the cursor
53949
+ *
53950
+ * @param editable - Whether the editor should accept user input (default: true)
53951
+ * @param emitUpdate - Whether to emit an update event after changing editability (default: true)
53896
53952
  */
53897
53953
  setEditable(editable = true, emitUpdate = true) {
53898
53954
  this.setOptions({ editable });
53955
+ if (this.view) {
53956
+ this.view.setProps({});
53957
+ if (!editable && this.view.dom) {
53958
+ this.view.dom.blur();
53959
+ }
53960
+ }
53899
53961
  if (emitUpdate) {
53900
53962
  this.emit("update", { editor: this, transaction: this.state.tr });
53901
53963
  }
@@ -54263,7 +54325,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54263
54325
  { default: remarkStringify },
54264
54326
  { default: remarkGfm }
54265
54327
  ] = await Promise.all([
54266
- import("./index-DSuc12CK-DH_DeF0B.es.js"),
54328
+ import("./index-895wSAjT-C4ksiI6n.es.js"),
54267
54329
  import("./index-DRCvimau-Cw339678.es.js"),
54268
54330
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
54269
54331
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -54468,7 +54530,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54468
54530
  * Process collaboration migrations
54469
54531
  */
54470
54532
  processCollaborationMigrations() {
54471
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.21");
54533
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.22");
54472
54534
  if (!this.options.ydoc) return;
54473
54535
  const metaMap = this.options.ydoc.getMap("meta");
54474
54536
  let docVersion = metaMap.get("version");
@@ -72539,9 +72601,36 @@ const fragmentSignature = (fragment, lookup2) => {
72539
72601
  }
72540
72602
  return base2;
72541
72603
  };
72604
+ const hasListMarkerProperties = (attrs) => {
72605
+ if (!attrs || typeof attrs !== "object") return false;
72606
+ const obj = attrs;
72607
+ if (!obj.numberingProperties || typeof obj.numberingProperties !== "object") return false;
72608
+ const numProps = obj.numberingProperties;
72609
+ if ("numId" in numProps) {
72610
+ const numId = numProps.numId;
72611
+ if (typeof numId !== "number" && typeof numId !== "string") return false;
72612
+ }
72613
+ if ("ilvl" in numProps) {
72614
+ const ilvl = numProps.ilvl;
72615
+ if (typeof ilvl !== "number") return false;
72616
+ }
72617
+ if ("wordLayout" in obj && obj.wordLayout !== void 0) {
72618
+ if (typeof obj.wordLayout !== "object" || obj.wordLayout === null) return false;
72619
+ const wordLayout = obj.wordLayout;
72620
+ if ("marker" in wordLayout && wordLayout.marker !== void 0) {
72621
+ if (typeof wordLayout.marker !== "object" || wordLayout.marker === null) return false;
72622
+ const marker = wordLayout.marker;
72623
+ if ("markerText" in marker && marker.markerText !== void 0) {
72624
+ if (typeof marker.markerText !== "string") return false;
72625
+ }
72626
+ }
72627
+ }
72628
+ return true;
72629
+ };
72542
72630
  const deriveBlockVersion = (block) => {
72543
72631
  if (block.kind === "paragraph") {
72544
- return block.runs.map((run2) => {
72632
+ const markerVersion = hasListMarkerProperties(block.attrs) ? `marker:${block.attrs.numberingProperties.numId ?? ""}:${block.attrs.numberingProperties.ilvl ?? 0}:${block.attrs.wordLayout?.marker?.markerText ?? ""}` : "";
72633
+ const runsVersion = block.runs.map((run2) => {
72545
72634
  if (run2.kind === "image") {
72546
72635
  const imgRun = run2;
72547
72636
  return [
@@ -72584,6 +72673,7 @@ const deriveBlockVersion = (block) => {
72584
72673
  textRun.token ?? ""
72585
72674
  ].join(",");
72586
72675
  }).join("|");
72676
+ return markerVersion ? `${markerVersion}|${runsVersion}` : runsVersion;
72587
72677
  }
72588
72678
  if (block.kind === "list") {
72589
72679
  return block.items.map((item) => `${item.id}:${item.marker.text}:${deriveBlockVersion(item.paragraph)}`).join("|");
@@ -77087,7 +77177,12 @@ setupPointerHandlers_fn = function() {
77087
77177
  setupInputBridge_fn = function() {
77088
77178
  __privateGet$1(this, _inputBridge)?.destroy();
77089
77179
  const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
77090
- __privateSet(this, _inputBridge, new PresentationInputBridge(win, __privateGet$1(this, _visibleHost), () => __privateMethod$1(this, _PresentationEditor_instances, getActiveDomTarget_fn).call(this)));
77180
+ __privateSet(this, _inputBridge, new PresentationInputBridge(
77181
+ win,
77182
+ __privateGet$1(this, _visibleHost),
77183
+ () => __privateMethod$1(this, _PresentationEditor_instances, getActiveDomTarget_fn).call(this),
77184
+ () => __privateGet$1(this, _documentMode) !== "viewing"
77185
+ ));
77091
77186
  __privateGet$1(this, _inputBridge).bind();
77092
77187
  };
77093
77188
  initHeaderFooterRegistry_fn = function() {
@@ -77475,6 +77570,10 @@ updateSelection_fn = function() {
77475
77570
  if (!__privateGet$1(this, _localSelectionLayer)) {
77476
77571
  return;
77477
77572
  }
77573
+ if (__privateGet$1(this, _documentMode) === "viewing") {
77574
+ __privateGet$1(this, _localSelectionLayer).innerHTML = "";
77575
+ return;
77576
+ }
77478
77577
  const layout = __privateGet$1(this, _layoutState).layout;
77479
77578
  const selection = this.getActiveEditor().state?.selection;
77480
77579
  __privateGet$1(this, _localSelectionLayer).innerHTML = "";
@@ -78780,11 +78879,27 @@ _PresentationEditor.CURSOR_STYLES = {
78780
78879
  };
78781
78880
  let PresentationEditor = _PresentationEditor;
78782
78881
  class PresentationInputBridge {
78783
- constructor(windowRoot, layoutSurface, getTargetDom, onTargetChanged, options) {
78882
+ /**
78883
+ * Creates a new PresentationInputBridge that forwards user input events from the visible layout
78884
+ * surface to the hidden editor DOM. This enables input handling when the actual editor is not
78885
+ * directly visible to the user.
78886
+ *
78887
+ * @param windowRoot - The window object containing the layout surface and editor target
78888
+ * @param layoutSurface - The visible HTML element that receives user input events (e.g., keyboard, mouse)
78889
+ * @param getTargetDom - Callback that returns the hidden editor's DOM element where events should be forwarded
78890
+ * @param isEditable - Callback that returns whether the editor is in an editable mode (editing/suggesting).
78891
+ * When this returns false (e.g., in viewing mode), keyboard, text, and composition
78892
+ * events will not be forwarded to prevent document modification.
78893
+ * @param onTargetChanged - Optional callback invoked when the target editor DOM element changes
78894
+ * @param options - Optional configuration including:
78895
+ * - useWindowFallback: Whether to attach window-level event listeners as fallback
78896
+ */
78897
+ constructor(windowRoot, layoutSurface, getTargetDom, isEditable, onTargetChanged, options) {
78784
78898
  __privateAdd$1(this, _PresentationInputBridge_instances);
78785
78899
  __privateAdd$1(this, _windowRoot);
78786
78900
  __privateAdd$1(this, _layoutSurfaces);
78787
78901
  __privateAdd$1(this, _getTargetDom);
78902
+ __privateAdd$1(this, _isEditable);
78788
78903
  __privateAdd$1(this, _onTargetChanged);
78789
78904
  __privateAdd$1(this, _listeners);
78790
78905
  __privateAdd$1(this, _currentTarget, null);
@@ -78793,6 +78908,7 @@ class PresentationInputBridge {
78793
78908
  __privateSet(this, _windowRoot, windowRoot);
78794
78909
  __privateSet(this, _layoutSurfaces, /* @__PURE__ */ new Set([layoutSurface]));
78795
78910
  __privateSet(this, _getTargetDom, getTargetDom);
78911
+ __privateSet(this, _isEditable, isEditable);
78796
78912
  __privateSet(this, _onTargetChanged, onTargetChanged);
78797
78913
  __privateSet(this, _listeners, []);
78798
78914
  __privateSet(this, _useWindowFallback, options?.useWindowFallback ?? false);
@@ -78859,6 +78975,7 @@ class PresentationInputBridge {
78859
78975
  _windowRoot = /* @__PURE__ */ new WeakMap();
78860
78976
  _layoutSurfaces = /* @__PURE__ */ new WeakMap();
78861
78977
  _getTargetDom = /* @__PURE__ */ new WeakMap();
78978
+ _isEditable = /* @__PURE__ */ new WeakMap();
78862
78979
  _onTargetChanged = /* @__PURE__ */ new WeakMap();
78863
78980
  _listeners = /* @__PURE__ */ new WeakMap();
78864
78981
  _currentTarget = /* @__PURE__ */ new WeakMap();
@@ -78889,6 +79006,9 @@ dispatchToTarget_fn = function(originalEvent, synthetic) {
78889
79006
  }
78890
79007
  };
78891
79008
  forwardKeyboardEvent_fn = function(event) {
79009
+ if (!__privateGet$1(this, _isEditable).call(this)) {
79010
+ return;
79011
+ }
78892
79012
  if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
78893
79013
  return;
78894
79014
  }
@@ -78916,6 +79036,9 @@ forwardKeyboardEvent_fn = function(event) {
78916
79036
  __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
78917
79037
  };
78918
79038
  forwardTextEvent_fn = function(event) {
79039
+ if (!__privateGet$1(this, _isEditable).call(this)) {
79040
+ return;
79041
+ }
78919
79042
  if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
78920
79043
  return;
78921
79044
  }
@@ -78946,6 +79069,9 @@ forwardTextEvent_fn = function(event) {
78946
79069
  });
78947
79070
  };
78948
79071
  forwardCompositionEvent_fn = function(event) {
79072
+ if (!__privateGet$1(this, _isEditable).call(this)) {
79073
+ return;
79074
+ }
78949
79075
  if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
78950
79076
  return;
78951
79077
  }
@@ -78965,6 +79091,9 @@ forwardCompositionEvent_fn = function(event) {
78965
79091
  __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
78966
79092
  };
78967
79093
  forwardContextMenu_fn = function(event) {
79094
+ if (!__privateGet$1(this, _isEditable).call(this)) {
79095
+ return;
79096
+ }
78968
79097
  if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
78969
79098
  return;
78970
79099
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAqBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA4ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAhFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAA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AE,GAC7C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAkChC;IAWK,8CAAkC;IAsBxC;;;OAGG;IACH,QAFa,OAAO,CAAC,IAAI,EAAE,CAAC,CAY3B;IAED;;;OAGG;IACH,WAFa,IAAI,CAiChB;IAED;;;OAGG;IACH,SAFa,IAAI,CAahB;IAED;;;;OAIG;IACH,oCAHW,OAAO,GACL,IAAI,CAMhB;IAED;;;;;;;OAOG;IACH,oCAJG;QAAwB,IAAI,EAApB,MAAM;QACU,IAAI,EAApB,MAAM;KACd,GAAU,IAAI,CAUhB;;CACF;mBAl/Ba,OAAO,SAAS,EAAE,IAAI;8BACtB,OAAO,SAAS,EAAE,eAAe;uBACjC,OAAO,SAAS,EAAE,QAAQ;sBAC1B,OAAO,SAAS,EAAE,OAAO;qBACzB,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;qBAC9B,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;6BA1Bf,eAAe;8BAMd,iEAAiE"}
1
+ {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAqBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA4ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAhFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,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IAED;;;OAGG;IACH,SAFa,IAAI,CAahB;IAED;;;;OAIG;IACH,oCAHW,OAAO,GACL,IAAI,CAMhB;IAED;;;;;;;OAOG;IACH,oCAJG;QAAwB,IAAI,EAApB,MAAM;QACU,IAAI,EAApB,MAAM;KACd,GAAU,IAAI,CAUhB;;CACF;mBAp/Ba,OAAO,SAAS,EAAE,IAAI;8BACtB,OAAO,SAAS,EAAE,eAAe;uBACjC,OAAO,SAAS,EAAE,QAAQ;sBAC1B,OAAO,SAAS,EAAE,OAAO;qBACzB,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;qBAC9B,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;6BA1Bf,eAAe;8BAMd,iEAAiE"}
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-Cw0V00On.js";
3
- import { _ as _export_sfc } from "./chunks/editor-CDWzRc4H.js";
2
+ import { T as TextSelection } from "./chunks/converter-DhkZt4Pv.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-oZjoYNA0.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -36652,7 +36652,7 @@ const _SuperConverter = class _SuperConverter {
36652
36652
  static getStoredSuperdocVersion(docx) {
36653
36653
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
36654
36654
  }
36655
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.21") {
36655
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.22") {
36656
36656
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
36657
36657
  }
36658
36658
  /**
@@ -37355,17 +37355,17 @@ export {
37355
37355
  ptToTwips as I,
37356
37356
  getResolvedParagraphProperties as J,
37357
37357
  linesToTwips as K,
37358
- ListHelpers as L,
37358
+ changeListLevel as L,
37359
37359
  Mapping as M,
37360
37360
  NodeSelection as N,
37361
- updateNumberingProperties as O,
37361
+ findParentNode as O,
37362
37362
  PluginKey as P,
37363
- changeListLevel as Q,
37363
+ isList as Q,
37364
37364
  ReplaceAroundStep as R,
37365
37365
  Selection as S,
37366
37366
  TextSelection as T,
37367
- findParentNode as U,
37368
- isList as V,
37367
+ updateNumberingProperties as U,
37368
+ ListHelpers as V,
37369
37369
  isMacOS as W,
37370
37370
  isIOS as X,
37371
37371
  getSchemaTypeByName as Y,
@@ -1,4 +1,4 @@
1
- import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-Cw0V00On.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-DhkZt4Pv.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
  }