@harbour-enterprises/superdoc 1.0.0-beta.93 → 1.0.0-beta.94

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-DDlUqq8s.es.js → PdfViewer-BR7hR5hX.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DbMCgjlc.cjs → PdfViewer-CC_fv7lS.cjs} +1 -1
  3. package/dist/chunks/{index-Cyp2JwAE-BDSzsvVr.cjs → index-BstIHBcW-6lPNsqaA.cjs} +1 -1
  4. package/dist/chunks/{index-Cyp2JwAE-C4V2XscX.es.js → index-BstIHBcW-BxKvjs-R.es.js} +1 -1
  5. package/dist/chunks/{index-CIyFPdjr.cjs → index-DHRt1tCk.cjs} +3 -3
  6. package/dist/chunks/{index-D1G3HZnw.es.js → index-JAE9iqTX.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-BLW0IRfr.es.js → super-editor.es-C1RjP_IO.es.js} +163 -22
  8. package/dist/chunks/{super-editor.es-CZ_EMz2h.cjs → super-editor.es-DXKgM3JR.cjs} +163 -22
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-CvPb50HR.js → converter-CIgfC-et.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-BWUuyGDp.js → docx-zipper-AQa91HPZ.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-CsWOz21v.js → editor-6Tyu_6Nf.js} +164 -23
  13. package/dist/super-editor/chunks/{index-Cyp2JwAE.js → index-BstIHBcW.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-DjWypz4_.js → toolbar-yzD6N9Br.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 +165 -24
  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, _cellAnchor, _cellDragMode, _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, getCellPosFromTableHit_fn, getTablePosFromHit_fn, shouldUseCellSelection_fn, setCellAnchor_fn, clearCellAnchor_fn, hitTestTable_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, renderCellSelectionOverlay_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 SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-CvPb50HR.js";
16
- import { D as DocxZipper } from "./docx-zipper-BWUuyGDp.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 SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-CIgfC-et.js";
16
+ import { D as DocxZipper } from "./docx-zipper-AQa91HPZ.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() {
@@ -10861,12 +10861,12 @@ const findTrackedMarkBetween = ({
10861
10861
  const { doc: doc2 } = tr;
10862
10862
  const startPos = Math.max(from2 - offset2, 0);
10863
10863
  const endPos = Math.min(to + offset2, doc2.content.size);
10864
- let markFound;
10865
- doc2.nodesBetween(startPos, endPos, (node, pos) => {
10864
+ let markFound = null;
10865
+ const tryMatch = (node, pos) => {
10866
10866
  if (!node || node?.nodeSize === void 0) {
10867
10867
  return;
10868
10868
  }
10869
- const mark = node.marks.find(
10869
+ const mark = node.marks?.find(
10870
10870
  (mark2) => mark2.type.name === markName && Object.keys(attrs).every((attr) => mark2.attrs[attr] === attrs[attr])
10871
10871
  );
10872
10872
  if (mark && !markFound) {
@@ -10875,24 +10875,36 @@ const findTrackedMarkBetween = ({
10875
10875
  to: pos + node.nodeSize,
10876
10876
  mark
10877
10877
  };
10878
+ return false;
10878
10879
  }
10880
+ };
10881
+ doc2.nodesBetween(startPos, endPos, (node, pos) => {
10882
+ return tryMatch(node, pos);
10879
10883
  });
10880
- const nodeAtEndPosition = doc2.nodeAt(endPos);
10881
- if (nodeAtEndPosition?.type?.name === "run") {
10882
- const node = nodeAtEndPosition.content?.content?.[0];
10883
- const isTextNode = node?.type?.name === "text";
10884
- if (isTextNode) {
10885
- const mark = node.marks.find(
10886
- (mark2) => mark2.type.name === markName && Object.keys(attrs).every((attr) => mark2.attrs[attr] === attrs[attr])
10887
- );
10888
- if (mark && !markFound) {
10889
- markFound = {
10890
- from: endPos,
10891
- to: endPos + node.nodeSize,
10892
- mark
10893
- };
10884
+ const inspectAroundPosition = (pos) => {
10885
+ if (pos < 0 || pos > doc2.content.size) {
10886
+ return;
10887
+ }
10888
+ const resolved = doc2.resolve(pos);
10889
+ const before = resolved.nodeBefore;
10890
+ if (before?.type?.name === "run") {
10891
+ const beforeStart = Math.max(pos - before.nodeSize, 0);
10892
+ const node = before.content?.content?.[0];
10893
+ if (node?.type?.name === "text") {
10894
+ tryMatch(node, beforeStart);
10895
+ }
10896
+ }
10897
+ const after = resolved.nodeAfter;
10898
+ if (after?.type?.name === "run") {
10899
+ const node = after.content?.content?.[0];
10900
+ if (node?.type?.name === "text") {
10901
+ tryMatch(node, pos);
10894
10902
  }
10895
10903
  }
10904
+ };
10905
+ if (!markFound) {
10906
+ inspectAroundPosition(startPos);
10907
+ inspectAroundPosition(endPos);
10896
10908
  }
10897
10909
  return markFound;
10898
10910
  };
@@ -13940,7 +13952,7 @@ const isHeadless = (editor) => {
13940
13952
  const shouldSkipNodeView = (editor) => {
13941
13953
  return isHeadless(editor);
13942
13954
  };
13943
- const summaryVersion = "1.0.0-beta.93";
13955
+ const summaryVersion = "1.0.0-beta.94";
13944
13956
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
13945
13957
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
13946
13958
  function mapAttributes(attrs) {
@@ -14732,7 +14744,7 @@ const _Editor = class _Editor extends EventEmitter {
14732
14744
  { default: remarkStringify },
14733
14745
  { default: remarkGfm }
14734
14746
  ] = await Promise.all([
14735
- import("./index-Cyp2JwAE.js"),
14747
+ import("./index-BstIHBcW.js"),
14736
14748
  import("./index-DRCvimau.js"),
14737
14749
  import("./index-C_x_N6Uh.js"),
14738
14750
  import("./index-D_sWOSiG.js"),
@@ -14937,7 +14949,7 @@ const _Editor = class _Editor extends EventEmitter {
14937
14949
  * Process collaboration migrations
14938
14950
  */
14939
14951
  processCollaborationMigrations() {
14940
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.93");
14952
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.94");
14941
14953
  if (!this.options.ydoc) return;
14942
14954
  const metaMap = this.options.ydoc.getMap("meta");
14943
14955
  let docVersion = metaMap.get("version");
@@ -31902,7 +31914,9 @@ const deriveBlockVersion = (block) => {
31902
31914
  textRun.letterSpacing != null ? textRun.letterSpacing : "",
31903
31915
  textRun.pmStart ?? "",
31904
31916
  textRun.pmEnd ?? "",
31905
- textRun.token ?? ""
31917
+ textRun.token ?? "",
31918
+ // Tracked changes - force re-render when added or removed tracked change
31919
+ textRun.trackedChange ? 1 : 0
31906
31920
  ].join(",");
31907
31921
  }).join("|");
31908
31922
  const attrs = block.attrs;
@@ -39452,6 +39466,104 @@ async function measureParagraphBlock(block, maxWidth) {
39452
39466
  const wordStartChar = charPosInRun;
39453
39467
  const wordEndNoSpace = charPosInRun + word.length;
39454
39468
  const wordEndWithSpace = charPosInRun + (isLastWord ? word.length : word.length + 1);
39469
+ const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
39470
+ if (wordOnlyWidth > effectiveMaxWidth && word.length > 1) {
39471
+ if (currentLine && currentLine.width > 0 && currentLine.segments.length > 0) {
39472
+ const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
39473
+ const { spaceCount: _sc, ...lineBase } = currentLine;
39474
+ const completedLine = { ...lineBase, ...metrics };
39475
+ addBarTabsToLine(completedLine);
39476
+ lines.push(completedLine);
39477
+ tabStopCursor = 0;
39478
+ pendingTabAlignment = null;
39479
+ currentLine = null;
39480
+ }
39481
+ const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
39482
+ const hasTabOnlyLine = currentLine && currentLine.segments.length === 0 && currentLine.width > 0;
39483
+ const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
39484
+ const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
39485
+ const chunks = breakWordIntoChunks(word, chunkWidth - WIDTH_FUDGE_PX, font, ctx2, run);
39486
+ let chunkCharOffset = wordStartChar;
39487
+ for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
39488
+ const chunk = chunks[chunkIndex];
39489
+ const chunkStartChar = chunkCharOffset;
39490
+ const chunkEndChar = chunkCharOffset + chunk.text.length;
39491
+ const isLastChunk = chunkIndex === chunks.length - 1;
39492
+ const isFirstChunk = chunkIndex === 0;
39493
+ if (isFirstChunk && hasTabOnlyLine && currentLine) {
39494
+ currentLine.toRun = runIndex;
39495
+ currentLine.toChar = chunkEndChar;
39496
+ currentLine.width = roundValue(currentLine.width + chunk.width);
39497
+ currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run.fontSize);
39498
+ currentLine.maxFontInfo = getFontInfoFromRun(run);
39499
+ currentLine.segments.push({
39500
+ runIndex,
39501
+ fromChar: chunkStartChar,
39502
+ toChar: chunkEndChar,
39503
+ width: chunk.width
39504
+ });
39505
+ if (isLastChunk) {
39506
+ const ls = run.letterSpacing ?? 0;
39507
+ if (!isLastWord && currentLine.width + spaceWidth <= currentLine.maxWidth - WIDTH_FUDGE_PX) {
39508
+ currentLine.toChar = wordEndWithSpace;
39509
+ currentLine.width = roundValue(currentLine.width + spaceWidth + ls);
39510
+ charPosInRun = wordEndWithSpace;
39511
+ currentLine.spaceCount += 1;
39512
+ } else {
39513
+ charPosInRun = wordEndWithSpace;
39514
+ }
39515
+ } else {
39516
+ const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
39517
+ const { spaceCount: _sc, ...lineBase } = currentLine;
39518
+ const completedLine = { ...lineBase, ...metrics };
39519
+ addBarTabsToLine(completedLine);
39520
+ lines.push(completedLine);
39521
+ tabStopCursor = 0;
39522
+ pendingTabAlignment = null;
39523
+ currentLine = null;
39524
+ }
39525
+ } else if (isLastChunk) {
39526
+ currentLine = {
39527
+ fromRun: runIndex,
39528
+ fromChar: chunkStartChar,
39529
+ toRun: runIndex,
39530
+ toChar: chunkEndChar,
39531
+ width: chunk.width,
39532
+ maxFontSize: run.fontSize,
39533
+ maxFontInfo: getFontInfoFromRun(run),
39534
+ maxWidth: getEffectiveWidth(contentWidth),
39535
+ segments: [{ runIndex, fromChar: chunkStartChar, toChar: chunkEndChar, width: chunk.width }],
39536
+ spaceCount: 0
39537
+ };
39538
+ const ls = run.letterSpacing ?? 0;
39539
+ if (!isLastWord && currentLine.width + spaceWidth <= currentLine.maxWidth - WIDTH_FUDGE_PX) {
39540
+ currentLine.toChar = wordEndWithSpace;
39541
+ currentLine.width = roundValue(currentLine.width + spaceWidth + ls);
39542
+ charPosInRun = wordEndWithSpace;
39543
+ currentLine.spaceCount += 1;
39544
+ } else {
39545
+ charPosInRun = wordEndWithSpace;
39546
+ }
39547
+ } else {
39548
+ const chunkLineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
39549
+ const metrics = calculateTypographyMetrics(run.fontSize, spacing, getFontInfoFromRun(run));
39550
+ const chunkLine = {
39551
+ fromRun: runIndex,
39552
+ fromChar: chunkStartChar,
39553
+ toRun: runIndex,
39554
+ toChar: chunkEndChar,
39555
+ width: chunk.width,
39556
+ maxWidth: chunkLineMaxWidth,
39557
+ segments: [{ runIndex, fromChar: chunkStartChar, toChar: chunkEndChar, width: chunk.width }],
39558
+ ...metrics
39559
+ };
39560
+ addBarTabsToLine(chunkLine);
39561
+ lines.push(chunkLine);
39562
+ }
39563
+ chunkCharOffset = chunkEndChar;
39564
+ }
39565
+ continue;
39566
+ }
39455
39567
  if (!currentLine) {
39456
39568
  currentLine = {
39457
39569
  fromRun: runIndex,
@@ -40030,6 +40142,35 @@ const measureRunWidth = (text, font, ctx2, run) => {
40030
40142
  const width = getMeasuredTextWidth(text, font, letterSpacing, ctx2);
40031
40143
  return roundValue(width);
40032
40144
  };
40145
+ const breakWordIntoChunks = (word, maxWidth, font, ctx2, run) => {
40146
+ const chunks = [];
40147
+ if (maxWidth <= 0) {
40148
+ for (const char of word) {
40149
+ const charWidth = measureRunWidth(char, font, ctx2, run);
40150
+ chunks.push({ text: char, width: charWidth });
40151
+ }
40152
+ return chunks;
40153
+ }
40154
+ let currentChunk = "";
40155
+ let currentWidth = 0;
40156
+ for (let i = 0; i < word.length; i++) {
40157
+ const char = word[i];
40158
+ const testChunk = currentChunk + char;
40159
+ const testWidth = measureRunWidth(testChunk, font, ctx2, run);
40160
+ if (testWidth > maxWidth && currentChunk.length > 0) {
40161
+ chunks.push({ text: currentChunk, width: currentWidth });
40162
+ currentChunk = char;
40163
+ currentWidth = measureRunWidth(char, font, ctx2, run);
40164
+ } else {
40165
+ currentChunk = testChunk;
40166
+ currentWidth = testWidth;
40167
+ }
40168
+ }
40169
+ if (currentChunk.length > 0) {
40170
+ chunks.push({ text: currentChunk, width: currentWidth });
40171
+ }
40172
+ return chunks;
40173
+ };
40033
40174
  const appendSegment = (segments, runIndex, fromChar, toChar, width, x) => {
40034
40175
  if (!segments) return;
40035
40176
  const last = segments[segments.length - 1];
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-CvPb50HR.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-CIgfC-et.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-CvPb50HR.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CsWOz21v.js";
2
+ import { p as process$1 } from "./converter-CIgfC-et.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-6Tyu_6Nf.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-CvPb50HR.js";
1
+ import { ac } from "./chunks/converter-CIgfC-et.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CvPb50HR.js";
2
- import { D } from "./chunks/docx-zipper-BWUuyGDp.js";
1
+ import "./chunks/converter-CIgfC-et.js";
2
+ import { D } from "./chunks/docx-zipper-AQa91HPZ.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-CsWOz21v.js";
2
- import "./chunks/converter-CvPb50HR.js";
3
- import "./chunks/docx-zipper-BWUuyGDp.js";
1
+ import { E } from "./chunks/editor-6Tyu_6Nf.js";
2
+ import "./chunks/converter-CIgfC-et.js";
3
+ import "./chunks/docx-zipper-AQa91HPZ.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BWUuyGDp.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-AQa91HPZ.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, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-CvPb50HR.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-CvPb50HR.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-CsWOz21v.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-CsWOz21v.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, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-CIgfC-et.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-CIgfC-et.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-6Tyu_6Nf.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-6Tyu_6Nf.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-DjWypz4_.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-yzD6N9Br.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BWUuyGDp.js";
19
+ import { D } from "./chunks/docx-zipper-AQa91HPZ.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-DjWypz4_.js";
3
- import "./chunks/editor-CsWOz21v.js";
2
+ import { T } from "./chunks/toolbar-yzD6N9Br.js";
3
+ import "./chunks/editor-6Tyu_6Nf.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-CZ_EMz2h.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DXKgM3JR.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-BLW0IRfr.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-C1RjP_IO.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-CZ_EMz2h.cjs");
4
- const superdoc = require("./chunks/index-CIyFPdjr.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DXKgM3JR.cjs");
4
+ const superdoc = require("./chunks/index-DHRt1tCk.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-BLW0IRfr.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-D1G3HZnw.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C1RjP_IO.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-JAE9iqTX.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,