superdoc 1.0.0-beta.71 → 1.0.0-beta.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/chunks/{PdfViewer-ByYZWEAY.cjs → PdfViewer-BxCLl7Q6.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-fC8HER9x.es.js → PdfViewer-Dg-qiC1A.es.js} +1 -1
  3. package/dist/chunks/{index-dVVrZVr-.es.js → index-B1AqHbuy.es.js} +3 -3
  4. package/dist/chunks/{index-C5kk90i2.cjs → index-CAQDtLex.cjs} +3 -3
  5. package/dist/chunks/{index-DNdPLYmc-xVZ8rsAB.cjs → index-qXb-Hmel-BPsIpdLY.cjs} +1 -1
  6. package/dist/chunks/{index-DNdPLYmc-BiqKDIea.es.js → index-qXb-Hmel-DwJhkxdW.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-1WGVfjfp.es.js → super-editor.es-DPl3-zTR.es.js} +148 -13
  8. package/dist/chunks/{super-editor.es-DUGFHvw1.cjs → super-editor.es-DxG6ckVG.cjs} +148 -13
  9. package/dist/style.css +7 -8
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-Cd9FToOQ.js → converter-JlOFMM88.js} +1 -1
  12. package/dist/super-editor/chunks/{docx-zipper-Dy4WiCTL.js → docx-zipper-BVmpz1K_.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-DO6-AGUY.js → editor-CNzx36Ms.js} +92 -7
  14. package/dist/super-editor/chunks/{index-DNdPLYmc.js → index-qXb-Hmel.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-Dt8nFoPI.js → toolbar-DAhwzyFV.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/style.css +7 -8
  21. package/dist/super-editor/super-editor.es.js +63 -13
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +150 -15
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -12,8 +12,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, 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, applyDomCorrectionToRects_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, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_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-Cd9FToOQ.js";
16
- import { D as DocxZipper } from "./docx-zipper-Dy4WiCTL.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-JlOFMM88.js";
16
+ import { D as DocxZipper } from "./docx-zipper-BVmpz1K_.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() {
@@ -13923,7 +13923,7 @@ const isHeadless = (editor) => {
13923
13923
  const shouldSkipNodeView = (editor) => {
13924
13924
  return isHeadless(editor);
13925
13925
  };
13926
- const summaryVersion = "1.0.0-beta.71";
13926
+ const summaryVersion = "1.0.0-beta.72";
13927
13927
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
13928
13928
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
13929
13929
  function mapAttributes(attrs) {
@@ -14715,7 +14715,7 @@ const _Editor = class _Editor extends EventEmitter {
14715
14715
  { default: remarkStringify },
14716
14716
  { default: remarkGfm }
14717
14717
  ] = await Promise.all([
14718
- import("./index-DNdPLYmc.js"),
14718
+ import("./index-qXb-Hmel.js"),
14719
14719
  import("./index-DRCvimau.js"),
14720
14720
  import("./index-C_x_N6Uh.js"),
14721
14721
  import("./index-D_sWOSiG.js"),
@@ -14920,7 +14920,7 @@ const _Editor = class _Editor extends EventEmitter {
14920
14920
  * Process collaboration migrations
14921
14921
  */
14922
14922
  processCollaborationMigrations() {
14923
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.71");
14923
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.72");
14924
14924
  if (!this.options.ydoc) return;
14925
14925
  const metaMap = this.options.ydoc.getMap("meta");
14926
14926
  let docVersion = metaMap.get("version");
@@ -40326,6 +40326,74 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
40326
40326
  getLayoutOptions() {
40327
40327
  return { ...__privateGet(this, _layoutOptions) };
40328
40328
  }
40329
+ /**
40330
+ * Get the page styles for the section containing the current caret position.
40331
+ *
40332
+ * In multi-section documents, different sections can have different page sizes,
40333
+ * margins, and orientations. This method returns the styles for the section
40334
+ * where the caret is currently located, enabling section-aware UI components
40335
+ * like rulers to display accurate information.
40336
+ *
40337
+ * @returns Object containing:
40338
+ * - pageSize: { width, height } in inches
40339
+ * - pageMargins: { left, right, top, bottom } in inches
40340
+ * - sectionIndex: The current section index (0-based)
40341
+ * - orientation: 'portrait' or 'landscape'
40342
+ *
40343
+ * Falls back to document-level defaults if section info is unavailable.
40344
+ *
40345
+ * @example
40346
+ * ```typescript
40347
+ * const sectionStyles = presentation.getCurrentSectionPageStyles();
40348
+ * console.log(`Section ${sectionStyles.sectionIndex}: ${sectionStyles.pageSize.width}" x ${sectionStyles.pageSize.height}"`);
40349
+ * ```
40350
+ */
40351
+ getCurrentSectionPageStyles() {
40352
+ const PPI = 96;
40353
+ const layout = __privateGet(this, _layoutState).layout;
40354
+ const pageIndex = __privateMethod(this, _PresentationEditor_instances, getCurrentPageIndex_fn).call(this);
40355
+ const page = layout?.pages?.[pageIndex];
40356
+ const converterStyles = __privateGet(this, _editor3).converter?.pageStyles ?? {};
40357
+ const defaultMargins = converterStyles.pageMargins ?? { left: 1, right: 1, top: 1, bottom: 1 };
40358
+ const safeMargins = {
40359
+ left: typeof defaultMargins.left === "number" ? defaultMargins.left : 1,
40360
+ right: typeof defaultMargins.right === "number" ? defaultMargins.right : 1,
40361
+ top: typeof defaultMargins.top === "number" ? defaultMargins.top : 1,
40362
+ bottom: typeof defaultMargins.bottom === "number" ? defaultMargins.bottom : 1
40363
+ };
40364
+ if (!page) {
40365
+ return {
40366
+ pageSize: { width: 8.5, height: 11 },
40367
+ pageMargins: safeMargins,
40368
+ sectionIndex: 0,
40369
+ orientation: "portrait"
40370
+ };
40371
+ }
40372
+ const pageOrientation = page.orientation === "landscape" || page.orientation === "portrait" ? page.orientation : "portrait";
40373
+ const standardPortrait = { w: 8.5 * PPI, h: 11 * PPI };
40374
+ const standardLandscape = { w: 11 * PPI, h: 8.5 * PPI };
40375
+ const orientationDefault = pageOrientation === "landscape" ? standardLandscape : standardPortrait;
40376
+ const pageWidthPx = page.size?.w ?? orientationDefault.w;
40377
+ const pageHeightPx = page.size?.h ?? orientationDefault.h;
40378
+ const marginLeftPx = page.margins?.left ?? safeMargins.left * PPI;
40379
+ const marginRightPx = page.margins?.right ?? safeMargins.right * PPI;
40380
+ const marginTopPx = page.margins?.top ?? safeMargins.top * PPI;
40381
+ const marginBottomPx = page.margins?.bottom ?? safeMargins.bottom * PPI;
40382
+ return {
40383
+ pageSize: {
40384
+ width: pageWidthPx / PPI,
40385
+ height: pageHeightPx / PPI
40386
+ },
40387
+ pageMargins: {
40388
+ left: marginLeftPx / PPI,
40389
+ right: marginRightPx / PPI,
40390
+ top: marginTopPx / PPI,
40391
+ bottom: marginBottomPx / PPI
40392
+ },
40393
+ sectionIndex: page.sectionIndex ?? 0,
40394
+ orientation: pageOrientation
40395
+ };
40396
+ }
40329
40397
  /**
40330
40398
  * Get current remote cursor states (normalized to absolute PM positions).
40331
40399
  * Returns an array of cursor states for all remote collaborators, excluding the local user.
@@ -43867,9 +43935,26 @@ getCurrentPageIndex_fn = function() {
43867
43935
  }
43868
43936
  const layout = __privateGet(this, _layoutState).layout;
43869
43937
  const selection = __privateGet(this, _editor3).state?.selection;
43870
- if (!layout || !selection) return 0;
43938
+ if (!layout || !selection) {
43939
+ return 0;
43940
+ }
43871
43941
  const rects = selectionToRects(layout, __privateGet(this, _layoutState).blocks, __privateGet(this, _layoutState).measures, selection.from, selection.to) ?? [];
43872
- return rects[0]?.pageIndex ?? 0;
43942
+ if (rects.length > 0) {
43943
+ return rects[0]?.pageIndex ?? 0;
43944
+ }
43945
+ const pos = selection.from;
43946
+ for (let pageIdx = 0; pageIdx < layout.pages.length; pageIdx++) {
43947
+ const page = layout.pages[pageIdx];
43948
+ for (const fragment of page.fragments) {
43949
+ const frag = fragment;
43950
+ if (frag.pmStart != null && frag.pmEnd != null) {
43951
+ if (pos >= frag.pmStart && pos <= frag.pmEnd) {
43952
+ return pageIdx;
43953
+ }
43954
+ }
43955
+ }
43956
+ }
43957
+ return 0;
43873
43958
  };
43874
43959
  findRegionForPage_fn = function(kind, pageIndex) {
43875
43960
  const map2 = kind === "header" ? __privateGet(this, _headerRegions) : __privateGet(this, _footerRegions);
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-Cd9FToOQ.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-JlOFMM88.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-Cd9FToOQ.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DO6-AGUY.js";
2
+ import { p as process$1 } from "./converter-JlOFMM88.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CNzx36Ms.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-Cd9FToOQ.js";
1
+ import { ac } from "./chunks/converter-JlOFMM88.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-Cd9FToOQ.js";
2
- import { D } from "./chunks/docx-zipper-Dy4WiCTL.js";
1
+ import "./chunks/converter-JlOFMM88.js";
2
+ import { D } from "./chunks/docx-zipper-BVmpz1K_.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DO6-AGUY.js";
2
- import "./chunks/converter-Cd9FToOQ.js";
3
- import "./chunks/docx-zipper-Dy4WiCTL.js";
1
+ import { E } from "./chunks/editor-CNzx36Ms.js";
2
+ import "./chunks/converter-JlOFMM88.js";
3
+ import "./chunks/docx-zipper-BVmpz1K_.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-Dy4WiCTL.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BVmpz1K_.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1815,7 +1815,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1815
1815
  margin: 4px 0;
1816
1816
  }
1817
1817
  .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
1818
- .vertical-indicator[data-v-b9f4f30a] {
1818
+ .vertical-indicator[data-v-0d1b9cd1] {
1819
1819
  position: absolute;
1820
1820
  height: 0px;
1821
1821
  min-width: 1px;
@@ -1823,7 +1823,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1823
1823
  top: 20px;
1824
1824
  z-index: 100;
1825
1825
  }
1826
- .margin-handle[data-v-b9f4f30a] {
1826
+ .margin-handle[data-v-0d1b9cd1] {
1827
1827
  width: 56px;
1828
1828
  min-width: 5px;
1829
1829
  max-width: 5px;
@@ -1836,10 +1836,10 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1836
1836
  transition: background-color 250ms ease;
1837
1837
  z-index: 10;
1838
1838
  }
1839
- .margin-handle[data-v-b9f4f30a]:hover {
1839
+ .margin-handle[data-v-0d1b9cd1]:hover {
1840
1840
  background-color: var(--ruler-handle-active-color);
1841
1841
  }
1842
- .ruler[data-v-b9f4f30a] {
1842
+ .ruler[data-v-0d1b9cd1] {
1843
1843
  height: 25px;
1844
1844
  width: var(--ruler-width, 8.5in);
1845
1845
  margin: 0;
@@ -1847,14 +1847,13 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1847
1847
  box-sizing: border-box;
1848
1848
  position: relative;
1849
1849
  color: #666;
1850
+ transition: width 150ms ease-out;
1850
1851
  }
1851
-
1852
- /* Tick marks - using absolute positioning from ruler-core */
1853
- .ruler-tick[data-v-b9f4f30a] {
1852
+ .ruler-tick[data-v-0d1b9cd1] {
1854
1853
  pointer-events: none;
1855
1854
  user-select: none;
1856
1855
  }
1857
- .numbering[data-v-b9f4f30a] {
1856
+ .numbering[data-v-0d1b9cd1] {
1858
1857
  position: absolute;
1859
1858
  top: -16px;
1860
1859
  left: -2px;
@@ -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-Cd9FToOQ.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-Cd9FToOQ.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 generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-DO6-AGUY.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-DO6-AGUY.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-JlOFMM88.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-JlOFMM88.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 generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-CNzx36Ms.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-CNzx36Ms.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, Teleport, 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-Dt8nFoPI.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-DAhwzyFV.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-Dy4WiCTL.js";
19
+ import { D } from "./chunks/docx-zipper-BVmpz1K_.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -4640,6 +4640,7 @@ const _sfc_main$6 = {
4640
4640
  const rulerHandleActiveColor = ref("#2563EB66");
4641
4641
  const pageSize = ref(null);
4642
4642
  const pageMargins = ref(null);
4643
+ const currentSectionIndex = ref(0);
4643
4644
  const isDragging = ref(false);
4644
4645
  const currentHandle = ref(null);
4645
4646
  const leftHandle = reactive({ side: "left", x: 0 });
@@ -4647,9 +4648,29 @@ const _sfc_main$6 = {
4647
4648
  const showVerticalIndicator = ref(false);
4648
4649
  const initialX = ref(0);
4649
4650
  let offsetX = 0;
4650
- const initRuler = () => {
4651
- if (props.editor.options.mode !== "docx") return null;
4652
- const { pageMargins: docMargins, pageSize: docSize } = props.editor.getPageStyles();
4651
+ let selectionUpdateHandler = null;
4652
+ const getPresentationEditor = () => {
4653
+ return props.editor?.presentationEditor ?? null;
4654
+ };
4655
+ const updateRulerForCurrentSection = () => {
4656
+ if (!props.editor || props.editor.options?.mode !== "docx") return;
4657
+ const presentationEditor = getPresentationEditor();
4658
+ let docSize, docMargins, sectionIndex;
4659
+ if (presentationEditor && typeof presentationEditor.getCurrentSectionPageStyles === "function") {
4660
+ const sectionStyles = presentationEditor.getCurrentSectionPageStyles();
4661
+ docSize = sectionStyles.pageSize;
4662
+ docMargins = sectionStyles.pageMargins;
4663
+ sectionIndex = sectionStyles.sectionIndex;
4664
+ } else {
4665
+ const styles = props.editor.getPageStyles();
4666
+ docSize = styles.pageSize ?? { width: 8.5, height: 11 };
4667
+ docMargins = styles.pageMargins ?? { left: 1, right: 1, top: 1, bottom: 1 };
4668
+ sectionIndex = 0;
4669
+ }
4670
+ if (pageSize.value && currentSectionIndex.value === sectionIndex) {
4671
+ return;
4672
+ }
4673
+ currentSectionIndex.value = sectionIndex;
4653
4674
  pageSize.value = docSize;
4654
4675
  pageMargins.value = docMargins;
4655
4676
  const definition = generateRulerDefinition({
@@ -4663,7 +4684,7 @@ const _sfc_main$6 = {
4663
4684
  });
4664
4685
  leftHandle.x = definition.leftMarginPx;
4665
4686
  rightHandle.x = definition.rightMarginPx;
4666
- return definition;
4687
+ rulerDefinition.value = definition;
4667
4688
  };
4668
4689
  const getTickStyle = computed(() => (tick) => {
4669
4690
  return {
@@ -4717,7 +4738,8 @@ const _sfc_main$6 = {
4717
4738
  const marginValue = getNewMarginValue();
4718
4739
  emit("margin-change", {
4719
4740
  side: currentHandle.value.side,
4720
- value: marginValue
4741
+ value: marginValue,
4742
+ sectionIndex: currentSectionIndex.value
4721
4743
  });
4722
4744
  }
4723
4745
  };
@@ -4741,12 +4763,40 @@ const _sfc_main$6 = {
4741
4763
  "--ruler-width": `${width}px`
4742
4764
  };
4743
4765
  });
4766
+ const handleSelectionUpdate = () => {
4767
+ if (isDragging.value) return;
4768
+ updateRulerForCurrentSection();
4769
+ };
4770
+ const setupEditorListeners = () => {
4771
+ if (!props.editor) return;
4772
+ selectionUpdateHandler = handleSelectionUpdate;
4773
+ props.editor.on("selectionUpdate", selectionUpdateHandler);
4774
+ };
4775
+ const cleanupEditorListeners = () => {
4776
+ if (!props.editor || !selectionUpdateHandler) return;
4777
+ props.editor.off("selectionUpdate", selectionUpdateHandler);
4778
+ selectionUpdateHandler = null;
4779
+ };
4780
+ watch(
4781
+ () => props.editor,
4782
+ (newEditor, oldEditor) => {
4783
+ if (oldEditor && selectionUpdateHandler) {
4784
+ oldEditor.off("selectionUpdate", selectionUpdateHandler);
4785
+ }
4786
+ if (newEditor) {
4787
+ setupEditorListeners();
4788
+ updateRulerForCurrentSection();
4789
+ }
4790
+ }
4791
+ );
4744
4792
  onMounted(() => {
4745
- rulerDefinition.value = initRuler();
4793
+ updateRulerForCurrentSection();
4794
+ setupEditorListeners();
4746
4795
  window.addEventListener("mousemove", handleMouseMove);
4747
4796
  window.addEventListener("mouseup", handleMouseUp);
4748
4797
  });
4749
4798
  onUnmounted(() => {
4799
+ cleanupEditorListeners();
4750
4800
  window.removeEventListener("mousemove", handleMouseMove);
4751
4801
  window.removeEventListener("mouseup", handleMouseUp);
4752
4802
  });
@@ -4787,7 +4837,7 @@ const _sfc_main$6 = {
4787
4837
  };
4788
4838
  }
4789
4839
  };
4790
- const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b9f4f30a"]]);
4840
+ const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-0d1b9cd1"]]);
4791
4841
  const _sfc_main$5 = {
4792
4842
  __name: "GenericPopover",
4793
4843
  props: {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-Dt8nFoPI.js";
3
- import "./chunks/editor-DO6-AGUY.js";
2
+ import { T } from "./chunks/toolbar-DAhwzyFV.js";
3
+ import "./chunks/editor-CNzx36Ms.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-DUGFHvw1.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DxG6ckVG.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-1WGVfjfp.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-DPl3-zTR.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-DUGFHvw1.cjs");
4
- const superdoc = require("./chunks/index-C5kk90i2.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DxG6ckVG.cjs");
4
+ const superdoc = require("./chunks/index-CAQDtLex.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;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-1WGVfjfp.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-dVVrZVr-.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DPl3-zTR.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-B1AqHbuy.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,