@harbour-enterprises/superdoc 1.0.0-beta.80 → 1.0.0-beta.81

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-otVXTOCF.cjs → PdfViewer-BQvWj9WT.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-Cl8-bF2d.es.js → PdfViewer-Ctnh2N_O.es.js} +1 -1
  3. package/dist/chunks/{index-DvRDR0Q1.cjs → index-BbmC10xF.cjs} +3 -3
  4. package/dist/chunks/{index-Da8gsiup.es.js → index-C-Pdo0ND.es.js} +3 -3
  5. package/dist/chunks/{index-dhmURjT9-eBXRY_y8.cjs → index-IjeMBukf-BVs_Hga_.cjs} +1 -1
  6. package/dist/chunks/{index-dhmURjT9-C4FbtHG8.es.js → index-IjeMBukf-dEWPAX8f.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-Bo6Jt_tq.es.js → super-editor.es-CO8LXugA.es.js} +85 -12
  8. package/dist/chunks/{super-editor.es-BPfJzTNn.cjs → super-editor.es-D3uoIURW.cjs} +85 -12
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-Cww1mCyd.js → converter-CbcgpI3f.js} +72 -7
  11. package/dist/super-editor/chunks/{docx-zipper-BlOp_CYx.js → docx-zipper-2XxpGSAi.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-D3MjMYeX.js → editor-y07m2wx4.js} +15 -7
  13. package/dist/super-editor/chunks/{index-dhmURjT9.js → index-IjeMBukf.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-CuJJlHlv.js → toolbar-ClrfxKAI.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 +87 -14
  26. package/dist/superdoc.umd.js.map +1 -1
  27. 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-Cww1mCyd.js";
16
- import { D as DocxZipper } from "./docx-zipper-BlOp_CYx.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-CbcgpI3f.js";
16
+ import { D as DocxZipper } from "./docx-zipper-2XxpGSAi.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.80";
13926
+ const summaryVersion = "1.0.0-beta.81";
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-dhmURjT9.js"),
14718
+ import("./index-IjeMBukf.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.80");
14923
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.81");
14924
14924
  if (!this.options.ydoc) return;
14925
14925
  const metaMap = this.options.ydoc.getMap("meta");
14926
14926
  let docVersion = metaMap.get("version");
@@ -17215,7 +17215,10 @@ function tokenNodeToRun(node, positions, defaultFont, defaultSize, inheritedMark
17215
17215
  run.pmStart = pos.start;
17216
17216
  run.pmEnd = pos.end;
17217
17217
  }
17218
- const marks = [...node.marks ?? [], ...inheritedMarks ?? []];
17218
+ const nodeMarks = node.marks ?? [];
17219
+ const marksAsAttrs = Array.isArray(node.attrs?.marksAsAttrs) ? node.attrs.marksAsAttrs : [];
17220
+ const effectiveMarks = nodeMarks.length > 0 ? nodeMarks : marksAsAttrs;
17221
+ const marks = [...effectiveMarks, ...inheritedMarks ?? []];
17219
17222
  applyMarksToRun(run, marks, hyperlinkConfig, themeColors);
17220
17223
  return run;
17221
17224
  }
@@ -38594,10 +38597,15 @@ getBlocks_fn = function(descriptor) {
38594
38597
  const providedMedia = __privateGet(this, _mediaFiles);
38595
38598
  const fallbackMedia = rootConverter?.media;
38596
38599
  const mediaFiles = providedMedia && Object.keys(providedMedia).length > 0 ? providedMedia : fallbackMedia;
38600
+ const docDefaults = rootConverter?.getDocumentDefaultStyles?.();
38601
+ const defaultFont = docDefaults?.typeface;
38602
+ const defaultSize = docDefaults?.fontSizePt != null ? docDefaults.fontSizePt * (96 / 72) : void 0;
38597
38603
  const result = toFlowBlocks(doc2, {
38598
38604
  mediaFiles,
38599
38605
  blockIdPrefix,
38600
- converterContext
38606
+ converterContext,
38607
+ defaultFont,
38608
+ defaultSize
38601
38609
  });
38602
38610
  const blocks = result.blocks;
38603
38611
  __privateGet(this, _blockCache).set(descriptor.id, { docRef: doc2, blocks });
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-Cww1mCyd.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-CbcgpI3f.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-Cww1mCyd.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D3MjMYeX.js";
2
+ import { p as process$1 } from "./converter-CbcgpI3f.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-y07m2wx4.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-Cww1mCyd.js";
1
+ import { ac } from "./chunks/converter-CbcgpI3f.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-Cww1mCyd.js";
2
- import { D } from "./chunks/docx-zipper-BlOp_CYx.js";
1
+ import "./chunks/converter-CbcgpI3f.js";
2
+ import { D } from "./chunks/docx-zipper-2XxpGSAi.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-D3MjMYeX.js";
2
- import "./chunks/converter-Cww1mCyd.js";
3
- import "./chunks/docx-zipper-BlOp_CYx.js";
1
+ import { E } from "./chunks/editor-y07m2wx4.js";
2
+ import "./chunks/converter-CbcgpI3f.js";
3
+ import "./chunks/docx-zipper-2XxpGSAi.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BlOp_CYx.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-2XxpGSAi.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-Cww1mCyd.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-Cww1mCyd.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-D3MjMYeX.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-D3MjMYeX.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-CbcgpI3f.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-CbcgpI3f.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-y07m2wx4.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-y07m2wx4.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-CuJJlHlv.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-ClrfxKAI.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BlOp_CYx.js";
19
+ import { D } from "./chunks/docx-zipper-2XxpGSAi.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-CuJJlHlv.js";
3
- import "./chunks/editor-D3MjMYeX.js";
2
+ import { T } from "./chunks/toolbar-ClrfxKAI.js";
3
+ import "./chunks/editor-y07m2wx4.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-BPfJzTNn.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-D3uoIURW.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-Bo6Jt_tq.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-CO8LXugA.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-BPfJzTNn.cjs");
4
- const superdoc = require("./chunks/index-DvRDR0Q1.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-D3uoIURW.cjs");
4
+ const superdoc = require("./chunks/index-BbmC10xF.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-Bo6Jt_tq.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-Da8gsiup.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CO8LXugA.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-C-Pdo0ND.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -40220,26 +40220,40 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40220
40220
  };
40221
40221
  const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
40222
40222
  const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$5);
40223
- function preProcessPageInstruction(nodesToCombine) {
40223
+ function preProcessPageInstruction(nodesToCombine, _instrText, fieldRunRPr = null) {
40224
40224
  const pageNumNode = {
40225
40225
  name: "sd:autoPageNumber",
40226
40226
  type: "element"
40227
40227
  };
40228
+ let foundContentRPr = false;
40228
40229
  nodesToCombine.forEach((n) => {
40229
- const rPrNode = n.elements.find((el) => el.name === "w:rPr");
40230
- if (rPrNode) pageNumNode.elements = [rPrNode];
40230
+ const rPrNode = n.elements?.find((el) => el.name === "w:rPr");
40231
+ if (rPrNode) {
40232
+ pageNumNode.elements = [rPrNode];
40233
+ foundContentRPr = true;
40234
+ }
40231
40235
  });
40236
+ if (!foundContentRPr && fieldRunRPr && fieldRunRPr.name === "w:rPr") {
40237
+ pageNumNode.elements = [fieldRunRPr];
40238
+ }
40232
40239
  return [pageNumNode];
40233
40240
  }
40234
- function preProcessNumPagesInstruction(nodesToCombine) {
40241
+ function preProcessNumPagesInstruction(nodesToCombine, _instrText, fieldRunRPr = null) {
40235
40242
  const totalPageNumNode = {
40236
40243
  name: "sd:totalPageNumber",
40237
40244
  type: "element"
40238
40245
  };
40246
+ let foundContentRPr = false;
40239
40247
  nodesToCombine.forEach((n) => {
40240
40248
  const rPrNode = n.elements?.find((el) => el.name === "w:rPr");
40241
- if (rPrNode) totalPageNumNode.elements = [rPrNode];
40249
+ if (rPrNode) {
40250
+ totalPageNumNode.elements = [rPrNode];
40251
+ foundContentRPr = true;
40252
+ }
40242
40253
  });
40254
+ if (!foundContentRPr && fieldRunRPr && fieldRunRPr.name === "w:rPr") {
40255
+ totalPageNumNode.elements = [fieldRunRPr];
40256
+ }
40243
40257
  return [totalPageNumNode];
40244
40258
  }
40245
40259
  function preProcessPageRefInstruction(nodesToCombine, instrText) {
@@ -40446,7 +40460,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40446
40460
  if (fieldInfo && (fieldInfo.fieldType === "PAGE" || fieldInfo.fieldType === "NUMPAGES")) {
40447
40461
  const preprocessor = fieldInfo.fieldType === "PAGE" ? preProcessPageInstruction : preProcessNumPagesInstruction;
40448
40462
  const contentNodes = fieldInfo.contentNodes;
40449
- const processedField = preprocessor(contentNodes, fieldInfo.instrText);
40463
+ const processedField = preprocessor(contentNodes, fieldInfo.instrText, fieldInfo.fieldRunRPr);
40450
40464
  processedNodes.push(...processedField);
40451
40465
  i2 = fieldInfo.endIndex + 1;
40452
40466
  continue;
@@ -40479,6 +40493,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40479
40493
  let separateIndex = -1;
40480
40494
  let endIndex = -1;
40481
40495
  const contentNodes = [];
40496
+ let fieldRunRPr = null;
40497
+ const beginNode = nodes[beginIndex];
40498
+ const beginRPr = beginNode.elements?.find((el) => el.name === "w:rPr");
40499
+ if (beginRPr && hasSignificantStyling(beginRPr)) {
40500
+ fieldRunRPr = beginRPr;
40501
+ }
40482
40502
  for (let i2 = beginIndex + 1; i2 < nodes.length; i2++) {
40483
40503
  const node2 = nodes[i2];
40484
40504
  const fldCharEl = node2.elements?.find((el) => el.name === "w:fldChar");
@@ -40487,6 +40507,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40487
40507
  if (instrTextEl) {
40488
40508
  instrText += (instrTextEl.elements?.[0]?.text || "") + " ";
40489
40509
  }
40510
+ if (!fieldRunRPr || separateIndex === -1 && fldType !== "end") {
40511
+ const rPrNode = node2.elements?.find((el) => el.name === "w:rPr");
40512
+ if (rPrNode && hasSignificantStyling(rPrNode)) {
40513
+ fieldRunRPr = rPrNode;
40514
+ }
40515
+ }
40490
40516
  if (fldType === "separate") {
40491
40517
  separateIndex = i2;
40492
40518
  } else if (fldType === "end") {
@@ -40504,9 +40530,48 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40504
40530
  fieldType,
40505
40531
  instrText: instrText.trim(),
40506
40532
  contentNodes,
40533
+ fieldRunRPr,
40507
40534
  endIndex
40508
40535
  };
40509
40536
  }
40537
+ function hasSignificantStyling(rPrNode) {
40538
+ if (!rPrNode?.elements?.length) {
40539
+ return false;
40540
+ }
40541
+ const significantElements = [
40542
+ "w:rStyle",
40543
+ // Run style reference (Word commonly uses this for page number formatting)
40544
+ "w:rFonts",
40545
+ // Font family
40546
+ "w:sz",
40547
+ // Font size
40548
+ "w:szCs",
40549
+ // Complex script font size
40550
+ "w:b",
40551
+ // Bold
40552
+ "w:bCs",
40553
+ // Complex script bold
40554
+ "w:i",
40555
+ // Italic
40556
+ "w:iCs",
40557
+ // Complex script italic
40558
+ "w:u",
40559
+ // Underline
40560
+ "w:color",
40561
+ // Font color
40562
+ "w:highlight",
40563
+ // Highlight color
40564
+ "w:strike",
40565
+ // Strikethrough
40566
+ "w:dstrike",
40567
+ // Double strikethrough
40568
+ "w:caps",
40569
+ // All caps
40570
+ "w:smallCaps"
40571
+ // Small caps
40572
+ ];
40573
+ return rPrNode.elements.some((el) => significantElements.includes(el.name));
40574
+ }
40510
40575
  const commentRangeStartHandlerEntity = generateV2HandlerEntity(
40511
40576
  "commentRangeStartHandler",
40512
40577
  commentRangeStartTranslator
@@ -42327,7 +42392,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42327
42392
  static getStoredSuperdocVersion(docx) {
42328
42393
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42329
42394
  }
42330
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.80") {
42395
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.81") {
42331
42396
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42332
42397
  }
42333
42398
  /**
@@ -67373,7 +67438,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
67373
67438
  const shouldSkipNodeView = (editor) => {
67374
67439
  return isHeadless(editor);
67375
67440
  };
67376
- const summaryVersion = "1.0.0-beta.80";
67441
+ const summaryVersion = "1.0.0-beta.81";
67377
67442
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
67378
67443
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
67379
67444
  function mapAttributes(attrs) {
@@ -68162,7 +68227,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68162
68227
  { default: remarkStringify2 },
68163
68228
  { default: remarkGfm2 }
68164
68229
  ] = await Promise.all([
68165
- Promise.resolve().then(() => indexDhmURjT9),
68230
+ Promise.resolve().then(() => indexIjeMBukf),
68166
68231
  Promise.resolve().then(() => indexDRCvimau),
68167
68232
  Promise.resolve().then(() => indexC_x_N6Uh),
68168
68233
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -68367,7 +68432,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68367
68432
  * Process collaboration migrations
68368
68433
  */
68369
68434
  processCollaborationMigrations() {
68370
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.80");
68435
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.81");
68371
68436
  if (!this.options.ydoc) return;
68372
68437
  const metaMap = this.options.ydoc.getMap("meta");
68373
68438
  let docVersion = metaMap.get("version");
@@ -70574,7 +70639,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
70574
70639
  run2.pmStart = pos.start;
70575
70640
  run2.pmEnd = pos.end;
70576
70641
  }
70577
- const marks = [...node2.marks ?? [], ...inheritedMarks ?? []];
70642
+ const nodeMarks = node2.marks ?? [];
70643
+ const marksAsAttrs = Array.isArray(node2.attrs?.marksAsAttrs) ? node2.attrs.marksAsAttrs : [];
70644
+ const effectiveMarks = nodeMarks.length > 0 ? nodeMarks : marksAsAttrs;
70645
+ const marks = [...effectiveMarks, ...inheritedMarks ?? []];
70578
70646
  applyMarksToRun(run2, marks, hyperlinkConfig, themeColors);
70579
70647
  return run2;
70580
70648
  }
@@ -91906,10 +91974,15 @@ ${l}
91906
91974
  const providedMedia = __privateGet$1(this, _mediaFiles);
91907
91975
  const fallbackMedia = rootConverter?.media;
91908
91976
  const mediaFiles = providedMedia && Object.keys(providedMedia).length > 0 ? providedMedia : fallbackMedia;
91977
+ const docDefaults = rootConverter?.getDocumentDefaultStyles?.();
91978
+ const defaultFont = docDefaults?.typeface;
91979
+ const defaultSize = docDefaults?.fontSizePt != null ? docDefaults.fontSizePt * (96 / 72) : void 0;
91909
91980
  const result = toFlowBlocks(doc2, {
91910
91981
  mediaFiles,
91911
91982
  blockIdPrefix,
91912
- converterContext
91983
+ converterContext,
91984
+ defaultFont,
91985
+ defaultSize
91913
91986
  });
91914
91987
  const blocks2 = result.blocks;
91915
91988
  __privateGet$1(this, _blockCache).set(descriptor.id, { docRef: doc2, blocks: blocks2 });
@@ -150474,7 +150547,7 @@ ${style2}
150474
150547
  this.config.colors = shuffleArray(this.config.colors);
150475
150548
  this.userColorMap = /* @__PURE__ */ new Map();
150476
150549
  this.colorIndex = 0;
150477
- this.version = "1.0.0-beta.80";
150550
+ this.version = "1.0.0-beta.81";
150478
150551
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
150479
150552
  this.superdocId = config2.superdocId || v4();
150480
150553
  this.colors = this.config.colors;
@@ -152946,7 +153019,7 @@ ${style2}
152946
153019
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
152947
153020
  );
152948
153021
  }
152949
- const indexDhmURjT9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153022
+ const indexIjeMBukf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152950
153023
  __proto__: null,
152951
153024
  unified
152952
153025
  }, Symbol.toStringTag, { value: "Module" }));