superdoc 1.0.0-beta.57 → 1.0.0-beta.58

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 (27) hide show
  1. package/dist/chunks/{PdfViewer-BpJ5YJmq.es.js → PdfViewer-BOtq_Mxx.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DvAhx37Y.cjs → PdfViewer-CPNlFudP.cjs} +1 -1
  3. package/dist/chunks/{index-D5IkZjf9-CPmfOXHq.es.js → index-BWMksCRw-BE_kaq_r.es.js} +1 -1
  4. package/dist/chunks/{index-D5IkZjf9-XnnWMFi7.cjs → index-BWMksCRw-BtY5hIaC.cjs} +1 -1
  5. package/dist/chunks/{index-BE9w4viZ.es.js → index-Wqm4Y9w9.es.js} +3 -3
  6. package/dist/chunks/{index-BbXDEDIW.cjs → index-yDP_DAl6.cjs} +3 -3
  7. package/dist/chunks/{super-editor.es-BY9i51n2.es.js → super-editor.es-BtTJyHJj.es.js} +182 -97
  8. package/dist/chunks/{super-editor.es-BjELk3Xl.cjs → super-editor.es-DsUuY-Pt.cjs} +182 -97
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-Aoe_RSZD.js → converter-w1IY5-V-.js} +70 -11
  11. package/dist/super-editor/chunks/{docx-zipper-Ct68kitw.js → docx-zipper-B7-XHg8m.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-Dfqm3VkC.js → editor-CiTfe7Wr.js} +183 -96
  13. package/dist/super-editor/chunks/{index-D5IkZjf9.js → index-BWMksCRw.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-Dj_HCM6i.js → toolbar-yy1NR024.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +184 -99
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -9,11 +9,11 @@ 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, 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, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _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, _dragAnchor, _isDragging, _dragExtensionMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _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, computeAnchorMap_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;
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, 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, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _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, _dragAnchor, _isDragging, _dragExtensionMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _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, computeExpectedSectionType_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, computeAnchorMap_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;
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 htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-Aoe_RSZD.js";
16
- import { D as DocxZipper } from "./docx-zipper-Ct68kitw.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 htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-w1IY5-V-.js";
16
+ import { D as DocxZipper } from "./docx-zipper-B7-XHg8m.js";
17
17
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
@@ -13504,7 +13504,12 @@ function processRelationships(root, convertedXml, results) {
13504
13504
  }
13505
13505
  }
13506
13506
  if (targetMode.toLowerCase() !== "external" && !looksExternal(target)) {
13507
- const likelyPath = `word/${target.replace(/^\.?\//, "")}`;
13507
+ let likelyPath;
13508
+ if (target.startsWith("../")) {
13509
+ likelyPath = target.replace(/^\.\.\//, "");
13510
+ } else {
13511
+ likelyPath = `word/${target.replace(/^\.?\//, "")}`;
13512
+ }
13508
13513
  if (!(likelyPath in convertedXml)) {
13509
13514
  if (!isImageType(type)) {
13510
13515
  results.push(`Removed relationship ${id} with missing target: ${target}`);
@@ -13918,7 +13923,7 @@ const isHeadless = (editor) => {
13918
13923
  const shouldSkipNodeView = (editor) => {
13919
13924
  return isHeadless(editor);
13920
13925
  };
13921
- const summaryVersion = "1.0.0-beta.57";
13926
+ const summaryVersion = "1.0.0-beta.58";
13922
13927
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
13923
13928
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
13924
13929
  function mapAttributes(attrs) {
@@ -14710,7 +14715,7 @@ const _Editor = class _Editor extends EventEmitter {
14710
14715
  { default: remarkStringify },
14711
14716
  { default: remarkGfm }
14712
14717
  ] = await Promise.all([
14713
- import("./index-D5IkZjf9.js"),
14718
+ import("./index-BWMksCRw.js"),
14714
14719
  import("./index-DRCvimau.js"),
14715
14720
  import("./index-C_x_N6Uh.js"),
14716
14721
  import("./index-D_sWOSiG.js"),
@@ -14915,7 +14920,7 @@ const _Editor = class _Editor extends EventEmitter {
14915
14920
  * Process collaboration migrations
14916
14921
  */
14917
14922
  processCollaborationMigrations() {
14918
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.57");
14923
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.58");
14919
14924
  if (!this.options.ydoc) return;
14920
14925
  const metaMap = this.options.ydoc.getMap("meta");
14921
14926
  let docVersion = metaMap.get("version");
@@ -29989,7 +29994,7 @@ const defaultMultiSectionIdentifier = () => ({
29989
29994
  sectionFooterIds: /* @__PURE__ */ new Map(),
29990
29995
  sectionTitlePg: /* @__PURE__ */ new Map()
29991
29996
  });
29992
- function buildMultiSectionIdentifier(sectionMetadata, pageStyles2) {
29997
+ function buildMultiSectionIdentifier(sectionMetadata, pageStyles2, converterIds) {
29993
29998
  const identifier = defaultMultiSectionIdentifier();
29994
29999
  identifier.alternateHeaders = Boolean(pageStyles2?.alternateHeaders ?? false);
29995
30000
  identifier.sectionCount = sectionMetadata.length;
@@ -30024,6 +30029,18 @@ function buildMultiSectionIdentifier(sectionMetadata, pageStyles2) {
30024
30029
  identifier.footerIds = { ...section0Footers };
30025
30030
  }
30026
30031
  identifier.titlePg = identifier.sectionTitlePg.get(0) ?? false;
30032
+ if (converterIds?.headerIds) {
30033
+ identifier.headerIds.default = identifier.headerIds.default ?? converterIds.headerIds.default ?? null;
30034
+ identifier.headerIds.first = identifier.headerIds.first ?? converterIds.headerIds.first ?? null;
30035
+ identifier.headerIds.even = identifier.headerIds.even ?? converterIds.headerIds.even ?? null;
30036
+ identifier.headerIds.odd = identifier.headerIds.odd ?? converterIds.headerIds.odd ?? null;
30037
+ }
30038
+ if (converterIds?.footerIds) {
30039
+ identifier.footerIds.default = identifier.footerIds.default ?? converterIds.footerIds.default ?? null;
30040
+ identifier.footerIds.first = identifier.footerIds.first ?? converterIds.footerIds.first ?? null;
30041
+ identifier.footerIds.even = identifier.footerIds.even ?? converterIds.footerIds.even ?? null;
30042
+ identifier.footerIds.odd = identifier.footerIds.odd ?? converterIds.footerIds.odd ?? null;
30043
+ }
30027
30044
  return identifier;
30028
30045
  }
30029
30046
  function getHeaderFooterTypeForSection(pageNumber, sectionIndex, identifier, options) {
@@ -36990,6 +37007,9 @@ const onHeaderFooterDataUpdate = async ({ editor, transaction }, mainEditor, sec
36990
37007
  }
36991
37008
  mainEditor.converter[`${type}s`][sectionId] = updatedData;
36992
37009
  mainEditor.setOptions({ isHeaderFooterChanged: editor.docChanged });
37010
+ if (editor.docChanged && mainEditor.converter) {
37011
+ mainEditor.converter.headerFooterModified = true;
37012
+ }
36993
37013
  await updateYdocDocxData(mainEditor);
36994
37014
  };
36995
37015
  const setEditorToolbar = ({ editor }, mainEditor) => {
@@ -37271,17 +37291,20 @@ class HeaderFooterEditorManager extends EventEmitter {
37271
37291
  * ```
37272
37292
  */
37273
37293
  getDocumentJson(descriptor) {
37274
- if (!descriptor?.id) return null;
37294
+ if (!descriptor?.id) {
37295
+ return null;
37296
+ }
37275
37297
  const liveEntry = __privateGet(this, _editorEntries).get(descriptor.id);
37276
37298
  if (liveEntry) {
37277
37299
  try {
37278
- const json = liveEntry.editor.getJSON?.();
37279
- return json;
37300
+ return liveEntry.editor.getJSON?.();
37280
37301
  } catch {
37281
37302
  }
37282
37303
  }
37283
37304
  const collections = __privateGet(this, _collections);
37284
- if (!collections) return null;
37305
+ if (!collections) {
37306
+ return null;
37307
+ }
37285
37308
  if (descriptor.kind === "header") {
37286
37309
  return collections.headers?.[descriptor.id] ?? null;
37287
37310
  }
@@ -37714,7 +37737,9 @@ class HeaderFooterLayoutAdapter {
37714
37737
  */
37715
37738
  getBatch(kind) {
37716
37739
  const descriptors = __privateGet(this, _manager).getDescriptors(kind);
37717
- if (!descriptors.length) return void 0;
37740
+ if (!descriptors.length) {
37741
+ return void 0;
37742
+ }
37718
37743
  const batch = {};
37719
37744
  let hasBlocks = false;
37720
37745
  descriptors.forEach((descriptor) => {
@@ -37959,13 +37984,7 @@ class EditorOverlayManager {
37959
37984
  showEditingOverlay(pageElement, region, zoom) {
37960
37985
  try {
37961
37986
  const decorationContainer = __privateMethod(this, _EditorOverlayManager_instances, findDecorationContainer_fn).call(this, pageElement, region.kind);
37962
- if (!decorationContainer) {
37963
- return {
37964
- success: false,
37965
- reason: `Decoration container not found for ${region.kind} on page ${region.pageIndex}`
37966
- };
37967
- }
37968
- const editorHost = __privateMethod(this, _EditorOverlayManager_instances, ensureEditorHost_fn).call(this, pageElement, region.kind);
37987
+ const editorHost = __privateMethod(this, _EditorOverlayManager_instances, ensureEditorHost_fn).call(this, pageElement, region.kind, decorationContainer);
37969
37988
  if (!editorHost) {
37970
37989
  return {
37971
37990
  success: false,
@@ -37973,7 +37992,9 @@ class EditorOverlayManager {
37973
37992
  };
37974
37993
  }
37975
37994
  __privateMethod(this, _EditorOverlayManager_instances, positionEditorHost_fn).call(this, editorHost, region, decorationContainer, zoom);
37976
- decorationContainer.style.visibility = "hidden";
37995
+ if (decorationContainer) {
37996
+ decorationContainer.style.visibility = "hidden";
37997
+ }
37977
37998
  editorHost.style.visibility = "visible";
37978
37999
  editorHost.style.zIndex = EDITOR_HOST_Z_INDEX;
37979
38000
  if (region.kind === "footer") {
@@ -37985,7 +38006,7 @@ class EditorOverlayManager {
37985
38006
  }
37986
38007
  }
37987
38008
  }
37988
- __privateMethod(this, _EditorOverlayManager_instances, showHeaderFooterBorder_fn).call(this, pageElement, region, decorationContainer);
38009
+ __privateMethod(this, _EditorOverlayManager_instances, showHeaderFooterBorder_fn).call(this, pageElement, region, decorationContainer, zoom);
37989
38010
  __privateSet(this, _activeEditorHost, editorHost);
37990
38011
  __privateSet(this, _activeDecorationContainer, decorationContainer);
37991
38012
  __privateSet(this, _activeRegion, region);
@@ -38114,17 +38135,18 @@ findDecorationContainer_fn = function(pageElement, kind) {
38114
38135
  return pageElement.querySelector(`.${className}`);
38115
38136
  };
38116
38137
  /**
38117
- * Ensures an editor host element exists as a sibling to the decoration container.
38138
+ * Ensures an editor host element exists for editing.
38118
38139
  *
38119
38140
  * If the editor host doesn't exist, creates it. Otherwise, returns the existing one.
38120
- * The editor host is positioned as a sibling (not child) of the decoration container
38121
- * to avoid the pointer-events: none constraint.
38141
+ * When a decoration container exists, the editor host is positioned as a sibling.
38142
+ * When no decoration container exists (empty header/footer), it's appended to the page.
38122
38143
  *
38123
38144
  * @param pageElement - The page element to create the host within
38124
38145
  * @param kind - The region kind (header or footer)
38146
+ * @param decorationContainer - The decoration container (optional, may not exist for empty regions)
38125
38147
  * @returns The editor host element
38126
38148
  */
38127
- ensureEditorHost_fn = function(pageElement, kind) {
38149
+ ensureEditorHost_fn = function(pageElement, kind, decorationContainer) {
38128
38150
  const className = kind === "header" ? "superdoc-header-editor-host" : "superdoc-footer-editor-host";
38129
38151
  let editorHost = pageElement.querySelector(`.${className}`);
38130
38152
  if (!editorHost) {
@@ -38139,45 +38161,56 @@ ensureEditorHost_fn = function(pageElement, kind) {
38139
38161
  overflow: "hidden",
38140
38162
  boxSizing: "border-box"
38141
38163
  });
38142
- const decorationContainer = __privateMethod(this, _EditorOverlayManager_instances, findDecorationContainer_fn).call(this, pageElement, kind);
38143
- if (!decorationContainer) {
38144
- console.error(`[EditorOverlayManager] Decoration container not found for ${kind}`);
38145
- return null;
38164
+ if (decorationContainer) {
38165
+ decorationContainer.parentNode?.insertBefore(editorHost, decorationContainer.nextSibling);
38166
+ } else {
38167
+ pageElement.appendChild(editorHost);
38146
38168
  }
38147
- decorationContainer.parentNode?.insertBefore(editorHost, decorationContainer.nextSibling);
38148
38169
  }
38149
38170
  return editorHost;
38150
38171
  };
38151
38172
  /**
38152
- * Positions the editor host to match the decoration container bounds.
38173
+ * Positions the editor host for header/footer editing.
38153
38174
  *
38154
- * The editor host is positioned absolutely within the page element to exactly
38155
- * overlap the decoration container's visual space.
38175
+ * When a decoration container exists, positions are derived from its bounds.
38176
+ * When no decoration container exists (empty header/footer), positions are
38177
+ * derived directly from the region data.
38156
38178
  *
38157
38179
  * @param editorHost - The editor host element to position
38158
38180
  * @param region - The header/footer region with dimension data
38159
- * @param decorationContainer - The decoration container to match
38181
+ * @param decorationContainer - The decoration container (optional, may not exist for empty regions)
38160
38182
  * @param zoom - Current zoom level
38161
38183
  */
38162
- positionEditorHost_fn = function(editorHost, region, decorationContainer, _zoom) {
38163
- const decorationRect = decorationContainer.getBoundingClientRect();
38184
+ positionEditorHost_fn = function(editorHost, region, decorationContainer, zoom) {
38164
38185
  const pageElement = editorHost.parentElement;
38165
38186
  if (!pageElement) {
38166
38187
  console.error("[EditorOverlayManager] Editor host has no parent element");
38167
38188
  return;
38168
38189
  }
38169
- const pageRect = pageElement.getBoundingClientRect();
38170
- const top2 = decorationRect.top - pageRect.top;
38171
- const left2 = decorationRect.left - pageRect.left;
38172
- const width = decorationRect.width;
38173
- const height = decorationRect.height;
38190
+ let top2;
38191
+ let left2;
38192
+ let width;
38193
+ let height;
38194
+ if (decorationContainer) {
38195
+ const decorationRect = decorationContainer.getBoundingClientRect();
38196
+ const pageRect = pageElement.getBoundingClientRect();
38197
+ top2 = decorationRect.top - pageRect.top;
38198
+ left2 = decorationRect.left - pageRect.left;
38199
+ width = decorationRect.width;
38200
+ height = decorationRect.height;
38201
+ } else {
38202
+ top2 = region.localY * zoom;
38203
+ left2 = region.localX * zoom;
38204
+ width = region.width * zoom;
38205
+ height = region.height * zoom;
38206
+ }
38174
38207
  Object.assign(editorHost.style, {
38175
38208
  top: `${top2}px`,
38176
38209
  left: `${left2}px`,
38177
38210
  width: `${width}px`,
38178
38211
  height: `${height}px`
38179
38212
  });
38180
- if (region.kind === "footer") {
38213
+ if (region.kind === "footer" && decorationContainer) {
38181
38214
  const fragment = decorationContainer.querySelector(".superdoc-fragment");
38182
38215
  if (fragment instanceof HTMLElement) {
38183
38216
  const fragmentTop = parseFloat(fragment.style.top) || 0;
@@ -38200,14 +38233,19 @@ hideDimmingOverlay_fn = function() {
38200
38233
  * Shows a full-width border line at the bottom of the header or top of the footer.
38201
38234
  * This creates the MS Word style visual indicator spanning edge-to-edge of the page.
38202
38235
  */
38203
- showHeaderFooterBorder_fn = function(pageElement, region, decorationContainer) {
38236
+ showHeaderFooterBorder_fn = function(pageElement, region, decorationContainer, zoom) {
38204
38237
  __privateMethod(this, _EditorOverlayManager_instances, hideHeaderFooterBorder_fn).call(this);
38205
38238
  __privateSet(this, _borderLine, document.createElement("div"));
38206
38239
  __privateGet(this, _borderLine).className = "superdoc-header-footer-border";
38207
- const decorationRect = decorationContainer.getBoundingClientRect();
38208
- const pageRect = pageElement.getBoundingClientRect();
38240
+ let topPosition;
38209
38241
  const isHeader = region.kind === "header";
38210
- const topPosition = isHeader ? decorationRect.bottom - pageRect.top : decorationRect.top - pageRect.top;
38242
+ if (decorationContainer) {
38243
+ const decorationRect = decorationContainer.getBoundingClientRect();
38244
+ const pageRect = pageElement.getBoundingClientRect();
38245
+ topPosition = isHeader ? decorationRect.bottom - pageRect.top : decorationRect.top - pageRect.top;
38246
+ } else {
38247
+ topPosition = isHeader ? (region.localY + region.height) * zoom : region.localY * zoom;
38248
+ }
38211
38249
  Object.assign(__privateGet(this, _borderLine).style, {
38212
38250
  position: "absolute",
38213
38251
  left: "0",
@@ -41138,7 +41176,10 @@ rerender_fn = async function() {
41138
41176
  }
41139
41177
  __privateSet(this, _sectionMetadata, sectionMetadata);
41140
41178
  const converter = __privateGet(this, _editor3).converter;
41141
- __privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
41179
+ __privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles, {
41180
+ headerIds: converter?.headerIds,
41181
+ footerIds: converter?.footerIds
41182
+ }));
41142
41183
  const anchorMap = __privateMethod(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
41143
41184
  __privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
41144
41185
  __privateSet(this, _headerLayoutResults, headerLayouts ?? null);
@@ -41661,41 +41702,83 @@ computeDecorationBox_fn = function(kind, pageMargins, pageHeight) {
41661
41702
  return { x: left2, width, height, offset: offset2 };
41662
41703
  }
41663
41704
  };
41705
+ /**
41706
+ * Computes the expected header/footer section type for a page based on document configuration.
41707
+ *
41708
+ * Unlike getHeaderFooterType/getHeaderFooterTypeForSection, this returns the appropriate
41709
+ * variant even when no header/footer IDs are configured. This is needed to determine
41710
+ * what variant to create when the user double-clicks an empty header/footer region.
41711
+ *
41712
+ * @param kind - Whether this is for a header or footer
41713
+ * @param page - The page to compute the section type for
41714
+ * @param sectionFirstPageNumbers - Map of section index to first page number in that section
41715
+ * @returns The expected section type ('default', 'first', 'even', or 'odd')
41716
+ */
41717
+ computeExpectedSectionType_fn = function(kind, page, sectionFirstPageNumbers) {
41718
+ const sectionIndex = page.sectionIndex ?? 0;
41719
+ const firstPageInSection = sectionFirstPageNumbers.get(sectionIndex);
41720
+ const sectionPageNumber = typeof firstPageInSection === "number" ? page.number - firstPageInSection + 1 : page.number;
41721
+ const multiSectionId = __privateGet(this, _multiSectionIdentifier);
41722
+ const legacyIdentifier = __privateGet(this, _headerFooterIdentifier);
41723
+ let titlePgEnabled = false;
41724
+ let alternateHeaders = false;
41725
+ if (multiSectionId) {
41726
+ titlePgEnabled = multiSectionId.sectionTitlePg?.get(sectionIndex) ?? multiSectionId.titlePg;
41727
+ alternateHeaders = multiSectionId.alternateHeaders;
41728
+ } else if (legacyIdentifier) {
41729
+ titlePgEnabled = legacyIdentifier.titlePg;
41730
+ alternateHeaders = legacyIdentifier.alternateHeaders;
41731
+ }
41732
+ if (sectionPageNumber === 1 && titlePgEnabled) {
41733
+ return "first";
41734
+ }
41735
+ if (alternateHeaders) {
41736
+ return page.number % 2 === 0 ? "even" : "odd";
41737
+ }
41738
+ return "default";
41739
+ };
41664
41740
  rebuildHeaderFooterRegions_fn = function(layout) {
41665
41741
  __privateGet(this, _headerRegions).clear();
41666
41742
  __privateGet(this, _footerRegions).clear();
41667
41743
  const pageHeight = layout.pageSize?.h ?? __privateGet(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
41668
41744
  if (pageHeight <= 0) return;
41745
+ const sectionFirstPageNumbers = /* @__PURE__ */ new Map();
41746
+ for (const p of layout.pages) {
41747
+ const idx = p.sectionIndex ?? 0;
41748
+ if (!sectionFirstPageNumbers.has(idx)) {
41749
+ sectionFirstPageNumbers.set(idx, p.number);
41750
+ }
41751
+ }
41669
41752
  layout.pages.forEach((page, pageIndex) => {
41670
41753
  var _a, _b;
41671
- const headerPayload = (_a = __privateGet(this, _headerDecorationProvider)) == null ? void 0 : _a.call(this, page.number, page.margins, page);
41672
- if (headerPayload?.hitRegion) {
41673
- __privateGet(this, _headerRegions).set(pageIndex, {
41674
- kind: "header",
41675
- headerId: headerPayload.headerId,
41676
- sectionType: headerPayload.sectionType,
41677
- pageIndex,
41678
- pageNumber: page.number,
41679
- localX: headerPayload.hitRegion.x ?? 0,
41680
- localY: headerPayload.hitRegion.y ?? 0,
41681
- width: headerPayload.hitRegion.width ?? headerPayload.box?.width ?? 0,
41682
- height: headerPayload.hitRegion.height ?? headerPayload.box?.height ?? 0
41683
- });
41684
- }
41685
- const footerPayload = (_b = __privateGet(this, _footerDecorationProvider)) == null ? void 0 : _b.call(this, page.number, page.margins, page);
41686
- if (footerPayload?.hitRegion) {
41687
- __privateGet(this, _footerRegions).set(pageIndex, {
41688
- kind: "footer",
41689
- headerId: footerPayload.headerId,
41690
- sectionType: footerPayload.sectionType,
41691
- pageIndex,
41692
- pageNumber: page.number,
41693
- localX: footerPayload.hitRegion.x ?? 0,
41694
- localY: footerPayload.hitRegion.y ?? 0,
41695
- width: footerPayload.hitRegion.width ?? footerPayload.box?.width ?? 0,
41696
- height: footerPayload.hitRegion.height ?? footerPayload.box?.height ?? 0
41697
- });
41698
- }
41754
+ const margins = page.margins ?? __privateGet(this, _layoutOptions).margins ?? DEFAULT_MARGINS;
41755
+ const actualPageHeight = page.size?.h ?? pageHeight;
41756
+ const headerPayload = (_a = __privateGet(this, _headerDecorationProvider)) == null ? void 0 : _a.call(this, page.number, margins, page);
41757
+ const headerBox = __privateMethod(this, _PresentationEditor_instances, computeDecorationBox_fn).call(this, "header", margins, actualPageHeight);
41758
+ __privateGet(this, _headerRegions).set(pageIndex, {
41759
+ kind: "header",
41760
+ headerId: headerPayload?.headerId,
41761
+ sectionType: headerPayload?.sectionType ?? __privateMethod(this, _PresentationEditor_instances, computeExpectedSectionType_fn).call(this, "header", page, sectionFirstPageNumbers),
41762
+ pageIndex,
41763
+ pageNumber: page.number,
41764
+ localX: headerPayload?.hitRegion?.x ?? headerBox.x,
41765
+ localY: headerPayload?.hitRegion?.y ?? headerBox.offset,
41766
+ width: headerPayload?.hitRegion?.width ?? headerBox.width,
41767
+ height: headerPayload?.hitRegion?.height ?? headerBox.height
41768
+ });
41769
+ const footerPayload = (_b = __privateGet(this, _footerDecorationProvider)) == null ? void 0 : _b.call(this, page.number, margins, page);
41770
+ const footerBox = __privateMethod(this, _PresentationEditor_instances, computeDecorationBox_fn).call(this, "footer", margins, actualPageHeight);
41771
+ __privateGet(this, _footerRegions).set(pageIndex, {
41772
+ kind: "footer",
41773
+ headerId: footerPayload?.headerId,
41774
+ sectionType: footerPayload?.sectionType ?? __privateMethod(this, _PresentationEditor_instances, computeExpectedSectionType_fn).call(this, "footer", page, sectionFirstPageNumbers),
41775
+ pageIndex,
41776
+ pageNumber: page.number,
41777
+ localX: footerPayload?.hitRegion?.x ?? footerBox.x,
41778
+ localY: footerPayload?.hitRegion?.y ?? footerBox.offset,
41779
+ width: footerPayload?.hitRegion?.width ?? footerBox.width,
41780
+ height: footerPayload?.hitRegion?.height ?? footerBox.height
41781
+ });
41699
41782
  });
41700
41783
  };
41701
41784
  hitTestHeaderFooterRegion_fn = function(x, y) {
@@ -41885,6 +41968,7 @@ enterHeaderFooterMode_fn = async function(region) {
41885
41968
  };
41886
41969
  exitHeaderFooterMode_fn = function() {
41887
41970
  if (__privateGet(this, _session).mode === "body") return;
41971
+ const editedHeaderId = __privateGet(this, _session).headerId;
41888
41972
  if (__privateGet(this, _activeHeaderFooterEditor)) {
41889
41973
  __privateGet(this, _activeHeaderFooterEditor).setEditable(false);
41890
41974
  __privateGet(this, _activeHeaderFooterEditor).setOptions({ documentMode: "viewing" });
@@ -41896,6 +41980,12 @@ exitHeaderFooterMode_fn = function() {
41896
41980
  __privateMethod(this, _PresentationEditor_instances, emitHeaderFooterModeChanged_fn).call(this);
41897
41981
  __privateMethod(this, _PresentationEditor_instances, emitHeaderFooterEditingContext_fn).call(this, __privateGet(this, _editor3));
41898
41982
  __privateGet(this, _inputBridge)?.notifyTargetChanged();
41983
+ if (editedHeaderId) {
41984
+ __privateGet(this, _headerFooterAdapter)?.invalidate(editedHeaderId);
41985
+ }
41986
+ __privateGet(this, _headerFooterManager)?.refresh();
41987
+ __privateSet(this, _pendingDocChange, true);
41988
+ __privateMethod(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
41899
41989
  __privateGet(this, _editor3).view?.focus();
41900
41990
  };
41901
41991
  getActiveDomTarget_fn = function() {
@@ -41995,34 +42085,31 @@ resolveDescriptorForRegion_fn = function(region) {
41995
42085
  * but no content exists yet. It uses the converter API to create an empty
41996
42086
  * header/footer document.
41997
42087
  *
41998
- * @param region - The header/footer region to create content for
42088
+ * @param region - The header/footer region containing kind ('header' | 'footer')
42089
+ * and sectionType ('default' | 'first' | 'even' | 'odd') information
42090
+ *
42091
+ * Side effects:
42092
+ * - Calls converter.createDefaultHeader() or converter.createDefaultFooter() to
42093
+ * create a new header/footer document in the underlying document model
42094
+ * - Updates this.#headerFooterIdentifier with the new header/footer IDs from
42095
+ * the converter after creation
42096
+ *
42097
+ * Behavior when converter is unavailable:
42098
+ * - Returns early without creating any header/footer if converter is not attached
42099
+ * - Returns early if the appropriate create method is not available on the converter
41999
42100
  */
42000
42101
  createDefaultHeaderFooter_fn = function(region) {
42001
42102
  const converter = __privateGet(this, _editor3).converter;
42002
42103
  if (!converter) {
42003
- console.error("[PresentationEditor] Converter not available for creating header/footer");
42004
42104
  return;
42005
42105
  }
42006
42106
  const variant = region.sectionType ?? "default";
42007
- try {
42008
- if (region.kind === "header") {
42009
- if (typeof converter.createDefaultHeader === "function") {
42010
- const headerId = converter.createDefaultHeader(variant);
42011
- console.log(`[PresentationEditor] Created default header: ${headerId}`);
42012
- } else {
42013
- console.error("[PresentationEditor] converter.createDefaultHeader is not a function");
42014
- }
42015
- } else if (region.kind === "footer") {
42016
- if (typeof converter.createDefaultFooter === "function") {
42017
- const footerId = converter.createDefaultFooter(variant);
42018
- console.log(`[PresentationEditor] Created default footer: ${footerId}`);
42019
- } else {
42020
- console.error("[PresentationEditor] converter.createDefaultFooter is not a function");
42021
- }
42022
- }
42023
- } catch (error) {
42024
- console.error("[PresentationEditor] Failed to create default header/footer:", error);
42107
+ if (region.kind === "header" && typeof converter.createDefaultHeader === "function") {
42108
+ converter.createDefaultHeader(variant);
42109
+ } else if (region.kind === "footer" && typeof converter.createDefaultFooter === "function") {
42110
+ converter.createDefaultFooter(variant);
42025
42111
  }
42112
+ __privateSet(this, _headerFooterIdentifier, extractIdentifierFromConverter(converter));
42026
42113
  };
42027
42114
  /**
42028
42115
  * Gets the DOM element for a specific page index.
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-Aoe_RSZD.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-w1IY5-V-.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, 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-Aoe_RSZD.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-Dfqm3VkC.js";
2
+ import { p as process$1 } from "./converter-w1IY5-V-.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CiTfe7Wr.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 { ac } from "./chunks/converter-Aoe_RSZD.js";
1
+ import { ac } from "./chunks/converter-w1IY5-V-.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-Aoe_RSZD.js";
2
- import { D } from "./chunks/docx-zipper-Ct68kitw.js";
1
+ import "./chunks/converter-w1IY5-V-.js";
2
+ import { D } from "./chunks/docx-zipper-B7-XHg8m.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-Dfqm3VkC.js";
2
- import "./chunks/converter-Aoe_RSZD.js";
3
- import "./chunks/docx-zipper-Ct68kitw.js";
1
+ import { E } from "./chunks/editor-CiTfe7Wr.js";
2
+ import "./chunks/converter-w1IY5-V-.js";
3
+ import "./chunks/docx-zipper-B7-XHg8m.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-Ct68kitw.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-B7-XHg8m.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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 _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
12
- import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-Aoe_RSZD.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-Aoe_RSZD.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 getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-Dfqm3VkC.js";
15
- import { z, F, B, T, w, C, x } from "./chunks/editor-Dfqm3VkC.js";
12
+ import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-w1IY5-V-.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-w1IY5-V-.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 getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-CiTfe7Wr.js";
15
+ import { z, F, B, T, w, C, x } from "./chunks/editor-CiTfe7Wr.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, defineComponent, reactive, onUnmounted, renderSlot, useCssVars, 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-Dj_HCM6i.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-yy1NR024.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-Ct68kitw.js";
19
+ import { D } from "./chunks/docx-zipper-B7-XHg8m.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-Dj_HCM6i.js";
3
- import "./chunks/editor-Dfqm3VkC.js";
2
+ import { T } from "./chunks/toolbar-yy1NR024.js";
3
+ import "./chunks/editor-CiTfe7Wr.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-BjELk3Xl.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DsUuY-Pt.cjs");
4
4
  require("./chunks/vue-jWLMl8Ts.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, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BY9i51n2.es.js";
1
+ import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BtTJyHJj.es.js";
2
2
  import "./chunks/vue-Dysv_7z5.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-BjELk3Xl.cjs");
4
- const superdoc = require("./chunks/index-BbXDEDIW.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DsUuY-Pt.cjs");
4
+ const superdoc = require("./chunks/index-yDP_DAl6.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
7
7
  exports.Editor = superEditor_es.Editor;