superdoc 1.0.0-beta.32 → 1.0.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/chunks/{PdfViewer-CTKbqDWv.cjs → PdfViewer-1hoKlV0M.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-edjIRb_p.es.js → PdfViewer-CVrn4X-3.es.js} +1 -1
  3. package/dist/chunks/{index-Pwv0a9G5.es.js → index-BTDOWM_2.es.js} +57 -32
  4. package/dist/chunks/{index-Cajp7-Xa.cjs → index-VKd9fPLu.cjs} +57 -32
  5. package/dist/chunks/{index-SGV4U12y-BPGxOtvI.es.js → index-hX4H5xPH-ChjioDix.es.js} +1 -1
  6. package/dist/chunks/{index-SGV4U12y-Dh5jaROA.cjs → index-hX4H5xPH-DfkQd7UH.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-CdGsYGU1.es.js → super-editor.es-CpmC4G9F.es.js} +158 -81
  8. package/dist/chunks/{super-editor.es-BbbbKgEs.cjs → super-editor.es-Dzrm58hW.cjs} +158 -81
  9. package/dist/style.css +33 -33
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-CpuOoAUa.js → converter-DZNL-ld-.js} +1 -1
  12. package/dist/super-editor/chunks/{docx-zipper-Dk99r397.js → docx-zipper-DukE72iM.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-CFv-RJI-.js → editor-CJCGDp-l.js} +159 -71
  14. package/dist/super-editor/chunks/{index-SGV4U12y.js → index-hX4H5xPH.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-CQr3Xnx9.js → toolbar-D6tqFv6-.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor.es.js +6 -6
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +2 -2
  25. package/dist/superdoc.es.js +2 -2
  26. package/dist/superdoc.umd.js +214 -112
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
@@ -18280,9 +18280,9 @@ const canMergeTextNodes = (nodeA, nodeB) => {
18280
18280
  const areAttrsEqual = (attrsA = {}, attrsB = {}) => {
18281
18281
  return objectIncludes(attrsA, attrsB);
18282
18282
  };
18283
- const TrackInsertMarkName = "trackInsert";
18284
- const TrackDeleteMarkName = "trackDelete";
18285
- const TrackFormatMarkName = "trackFormat";
18283
+ const TrackInsertMarkName$1 = "trackInsert";
18284
+ const TrackDeleteMarkName$1 = "trackDelete";
18285
+ const TrackFormatMarkName$1 = "trackFormat";
18286
18286
  const generateV2HandlerEntity = (handlerName, translator2) => ({
18287
18287
  handlerName,
18288
18288
  handler: (params2) => {
@@ -20048,7 +20048,7 @@ function handleStyleChangeMarksV2(rPrChange, currentMarks, params2) {
20048
20048
  const runProperties = translator$1N.encode({ ...params2, nodes: [rPr] });
20049
20049
  submarks = encodeMarksFromRPr(runProperties, params2?.docx);
20050
20050
  }
20051
- return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20051
+ return [{ type: TrackFormatMarkName$1, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20052
20052
  }
20053
20053
  function handleStyleChangeMarks(rPr, currentMarks) {
20054
20054
  const styleChangeMark = rPr.elements?.find((el) => el.name === "w:rPrChange");
@@ -20063,7 +20063,7 @@ function handleStyleChangeMarks(rPr, currentMarks) {
20063
20063
  authorEmail: attributes["w:authorEmail"]
20064
20064
  };
20065
20065
  const submarks = parseMarks(styleChangeMark);
20066
- return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20066
+ return [{ type: TrackFormatMarkName$1, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20067
20067
  }
20068
20068
  function createImportMarks(marks) {
20069
20069
  const textStyleMarksToCombine = marks.filter((mark) => mark.type === "textStyle");
@@ -20501,7 +20501,7 @@ const cloneRuns = (runs = []) => runs.map((run2) => cloneNode(run2));
20501
20501
  const prepareRunTrackingContext = (node = {}) => {
20502
20502
  const marks = Array.isArray(node.marks) ? node.marks : [];
20503
20503
  const trackingMarks = marks.filter(
20504
- (mark) => mark?.type === TrackInsertMarkName || mark?.type === TrackDeleteMarkName
20504
+ (mark) => mark?.type === TrackInsertMarkName$1 || mark?.type === TrackDeleteMarkName$1
20505
20505
  );
20506
20506
  if (!trackingMarks.length) {
20507
20507
  return { runNode: node, trackingMarksByType: /* @__PURE__ */ new Map() };
@@ -20510,7 +20510,7 @@ const prepareRunTrackingContext = (node = {}) => {
20510
20510
  trackingMarks.forEach((mark) => {
20511
20511
  if (mark?.type) trackingMarksByType.set(mark.type, cloneMark(mark));
20512
20512
  });
20513
- const preservedMarks = marks.filter((mark) => mark?.type !== TrackInsertMarkName && mark?.type !== TrackDeleteMarkName).map((mark) => cloneMark(mark));
20513
+ const preservedMarks = marks.filter((mark) => mark?.type !== TrackInsertMarkName$1 && mark?.type !== TrackDeleteMarkName$1).map((mark) => cloneMark(mark));
20514
20514
  const clonedContent = Array.isArray(node.content) ? node.content.map((child) => {
20515
20515
  const childClone = cloneNode(child);
20516
20516
  const childMarks = Array.isArray(childClone.marks) ? childClone.marks.slice() : [];
@@ -20549,8 +20549,8 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
20549
20549
  return runs;
20550
20550
  }
20551
20551
  if (!trackingMarksByType.size) return runs;
20552
- if (trackingMarksByType.has(TrackInsertMarkName)) {
20553
- const mark = trackingMarksByType.get(TrackInsertMarkName);
20552
+ if (trackingMarksByType.has(TrackInsertMarkName$1)) {
20553
+ const mark = trackingMarksByType.get(TrackInsertMarkName$1);
20554
20554
  const clonedRuns = cloneRuns(runs);
20555
20555
  const wrapper = {
20556
20556
  name: "w:ins",
@@ -20567,8 +20567,8 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
20567
20567
  };
20568
20568
  return [wrapper];
20569
20569
  }
20570
- if (trackingMarksByType.has(TrackDeleteMarkName)) {
20571
- const mark = trackingMarksByType.get(TrackDeleteMarkName);
20570
+ if (trackingMarksByType.has(TrackDeleteMarkName$1)) {
20571
+ const mark = trackingMarksByType.get(TrackDeleteMarkName$1);
20572
20572
  const clonedRuns = cloneRuns(runs);
20573
20573
  clonedRuns.forEach(renameTextElementsForDeletion);
20574
20574
  const wrapper = {
@@ -41858,7 +41858,7 @@ const _SuperConverter = class _SuperConverter2 {
41858
41858
  static getStoredSuperdocVersion(docx) {
41859
41859
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
41860
41860
  }
41861
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.32") {
41861
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.33") {
41862
41862
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
41863
41863
  }
41864
41864
  /**
@@ -45164,7 +45164,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
45164
45164
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
45165
45165
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
45166
45166
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
45167
- 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, 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, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
45167
+ 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, 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, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
45168
45168
  var GOOD_LEAF_SIZE = 200;
45169
45169
  var RopeSequence = function RopeSequence2() {
45170
45170
  };
@@ -56016,13 +56016,13 @@ const findTrackedMarkBetween = ({
56016
56016
  return markFound;
56017
56017
  };
56018
56018
  const markInsertion = ({ tr, from: from2, to, user, date }) => {
56019
- tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackDeleteMarkName]);
56020
- tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackInsertMarkName]);
56019
+ tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackDeleteMarkName$1]);
56020
+ tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackInsertMarkName$1]);
56021
56021
  let trackedMark = findTrackedMarkBetween({
56022
56022
  tr,
56023
56023
  from: from2,
56024
56024
  to,
56025
- markName: TrackInsertMarkName,
56025
+ markName: TrackInsertMarkName$1,
56026
56026
  attrs: { authorEmail: user.email }
56027
56027
  });
56028
56028
  let id;
@@ -56031,7 +56031,7 @@ const markInsertion = ({ tr, from: from2, to, user, date }) => {
56031
56031
  } else {
56032
56032
  id = v4();
56033
56033
  }
56034
- const insertionMark = tr.doc.type.schema.marks[TrackInsertMarkName].create({
56034
+ const insertionMark = tr.doc.type.schema.marks[TrackInsertMarkName$1].create({
56035
56035
  id,
56036
56036
  author: user.name,
56037
56037
  authorEmail: user.email,
@@ -56057,7 +56057,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56057
56057
  tr,
56058
56058
  from: from2,
56059
56059
  to,
56060
- markName: TrackDeleteMarkName,
56060
+ markName: TrackDeleteMarkName$1,
56061
56061
  attrs: { authorEmail: user.email }
56062
56062
  });
56063
56063
  let id;
@@ -56068,7 +56068,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56068
56068
  } else {
56069
56069
  id = v4();
56070
56070
  }
56071
- const deletionMark = tr.doc.type.schema.marks[TrackDeleteMarkName].create({
56071
+ const deletionMark = tr.doc.type.schema.marks[TrackDeleteMarkName$1].create({
56072
56072
  id,
56073
56073
  author: user.name,
56074
56074
  authorEmail: user.email,
@@ -56081,7 +56081,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56081
56081
  if (node.type.name.includes("table")) {
56082
56082
  return;
56083
56083
  }
56084
- if (node.isInline && node.marks.find((mark) => mark.type.name === TrackInsertMarkName && mark.attrs.authorEmail === user.email)) {
56084
+ if (node.isInline && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1 && mark.attrs.authorEmail === user.email)) {
56085
56085
  const removeStep = new ReplaceStep(
56086
56086
  deletionMap.map(Math.max(from2, pos)),
56087
56087
  deletionMap.map(Math.min(to, pos + node.nodeSize)),
@@ -56090,14 +56090,14 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56090
56090
  if (!tr.maybeStep(removeStep).failed) {
56091
56091
  deletionMap.appendMap(removeStep.getMap());
56092
56092
  }
56093
- } else if (node.isInline && !node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
56093
+ } else if (node.isInline && !node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
56094
56094
  nodes.push(node);
56095
56095
  tr.addMark(
56096
56096
  deletionMap.map(Math.max(from2, pos)),
56097
56097
  deletionMap.map(Math.min(to, pos + node.nodeSize)),
56098
56098
  deletionMark
56099
56099
  );
56100
- } else if (node.attrs.track && !node.attrs.track.find((trackAttr) => trackAttr.type === TrackDeleteMarkName) && !["bulletList", "orderedList"].includes(node.type.name)) ;
56100
+ } else if (node.attrs.track && !node.attrs.track.find((trackAttr) => trackAttr.type === TrackDeleteMarkName$1) && !["bulletList", "orderedList"].includes(node.type.name)) ;
56101
56101
  });
56102
56102
  return { deletionMark, deletionMap, nodes };
56103
56103
  };
@@ -56164,7 +56164,7 @@ const getTrackChanges = (state2, id = null) => {
56164
56164
  }
56165
56165
  allInlineNodes.forEach(({ node, pos }) => {
56166
56166
  const { marks } = node;
56167
- const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
56167
+ const trackedMarks = [TrackInsertMarkName$1, TrackDeleteMarkName$1, TrackFormatMarkName$1];
56168
56168
  if (marks.length > 0) {
56169
56169
  marks.forEach((mark) => {
56170
56170
  if (trackedMarks.includes(mark.type.name)) {
@@ -56277,7 +56277,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56277
56277
  return DecorationSet.empty;
56278
56278
  }
56279
56279
  trackedChanges.forEach(({ mark, from: from2, to }) => {
56280
- if (mark.type.name === TrackInsertMarkName) {
56280
+ if (mark.type.name === TrackInsertMarkName$1) {
56281
56281
  if (onlyOriginalShown) {
56282
56282
  const decoration = Decoration.inline(from2, to, {
56283
56283
  class: "track-insert-dec hidden"
@@ -56295,7 +56295,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56295
56295
  decorations.push(decoration);
56296
56296
  }
56297
56297
  }
56298
- if (mark.type.name === TrackDeleteMarkName) {
56298
+ if (mark.type.name === TrackDeleteMarkName$1) {
56299
56299
  if (onlyOriginalShown) {
56300
56300
  const decoration = Decoration.inline(from2, to, {
56301
56301
  class: "track-delete-dec normal"
@@ -56327,7 +56327,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56327
56327
  decorations.push(decorationWidget);
56328
56328
  }
56329
56329
  }
56330
- if (mark.type.name === TrackFormatMarkName) {
56330
+ if (mark.type.name === TrackFormatMarkName$1) {
56331
56331
  if (onlyOriginalShown) {
56332
56332
  const decoration = Decoration.inline(from2, to, {
56333
56333
  class: "track-format-dec before"
@@ -56348,7 +56348,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56348
56348
  });
56349
56349
  return DecorationSet.create(state2.doc, decorations);
56350
56350
  };
56351
- const CommentMarkName = "commentMark";
56351
+ const CommentMarkName$1 = "commentMark";
56352
56352
  const resolveCommentMeta = ({ converter, importedId }) => {
56353
56353
  const comments = converter?.comments || [];
56354
56354
  const matchingImportedComment = comments.find((c2) => c2.importedId == importedId);
@@ -56379,7 +56379,7 @@ const ensureFallbackComment = ({ converter, matchingImportedComment, commentId,
56379
56379
  const removeCommentsById = ({ commentId, state: state2, tr, dispatch }) => {
56380
56380
  const positions = getCommentPositionsById(commentId, state2.doc);
56381
56381
  positions.forEach(({ from: from2, to }) => {
56382
- tr.removeMark(from2, to, state2.schema.marks[CommentMarkName]);
56382
+ tr.removeMark(from2, to, state2.schema.marks[CommentMarkName$1]);
56383
56383
  });
56384
56384
  dispatch(tr);
56385
56385
  };
@@ -56387,7 +56387,7 @@ const getCommentPositionsById = (commentId, doc2) => {
56387
56387
  const positions = [];
56388
56388
  doc2.descendants((node, pos) => {
56389
56389
  const { marks } = node;
56390
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56390
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56391
56391
  if (commentMark) {
56392
56392
  const { attrs } = commentMark;
56393
56393
  const { commentId: currentCommentId } = attrs;
@@ -56407,7 +56407,7 @@ const prepareCommentsForExport = (doc2, tr, schema, comments = []) => {
56407
56407
  const endNodes = [];
56408
56408
  const seen = /* @__PURE__ */ new Set();
56409
56409
  doc2.descendants((node, pos) => {
56410
- const commentMarks = node.marks?.filter((mark) => mark.type.name === CommentMarkName) || [];
56410
+ const commentMarks = node.marks?.filter((mark) => mark.type.name === CommentMarkName$1) || [];
56411
56411
  commentMarks.forEach((commentMark) => {
56412
56412
  const { attrs = {} } = commentMark;
56413
56413
  const { commentId } = attrs;
@@ -56535,7 +56535,7 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
56535
56535
  importedId,
56536
56536
  internal: itemToMark.internal
56537
56537
  };
56538
- tr.addMark(start2, pos + 1, schema.marks[CommentMarkName].create(markAttrs));
56538
+ tr.addMark(start2, pos + 1, schema.marks[CommentMarkName$1].create(markAttrs));
56539
56539
  toDelete.push({ start: pos, end: pos + 1 });
56540
56540
  } else if (type2.name === "commentReference") {
56541
56541
  toDelete.push({ start: pos, end: pos + 1 });
@@ -56653,7 +56653,7 @@ const updatePosition = ({ allCommentPositions, threadId, pos, currentBounds, nod
56653
56653
  existing.bounds.bottom = Math.max(existing.bounds.bottom, currentBounds.bottom);
56654
56654
  }
56655
56655
  };
56656
- const TRACK_CHANGE_MARKS = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
56656
+ const TRACK_CHANGE_MARKS = [TrackInsertMarkName$1, TrackDeleteMarkName$1, TrackFormatMarkName$1];
56657
56657
  const CommentsPluginKey = new PluginKey("comments");
56658
56658
  const CommentsPlugin = Extension.create({
56659
56659
  name: "comments",
@@ -56669,7 +56669,7 @@ const CommentsPlugin = Extension.create({
56669
56669
  tr.addMark(
56670
56670
  $from.pos,
56671
56671
  $to.pos,
56672
- this.editor.schema.marks[CommentMarkName].create({
56672
+ this.editor.schema.marks[CommentMarkName$1].create({
56673
56673
  commentId: resolvedCommentId,
56674
56674
  internal: resolvedInternal
56675
56675
  })
@@ -56709,7 +56709,7 @@ const CommentsPlugin = Extension.create({
56709
56709
  doc2.descendants((node, pos) => {
56710
56710
  if (foundStartNode) return;
56711
56711
  const { marks = [] } = node;
56712
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56712
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56713
56713
  if (commentMark) {
56714
56714
  const { attrs } = commentMark;
56715
56715
  const wid = attrs.commentId;
@@ -56723,7 +56723,7 @@ const CommentsPlugin = Extension.create({
56723
56723
  tr.addMark(
56724
56724
  foundPos,
56725
56725
  foundPos + foundStartNode.nodeSize,
56726
- this.editor.schema.marks[CommentMarkName].create({
56726
+ this.editor.schema.marks[CommentMarkName$1].create({
56727
56727
  commentId,
56728
56728
  internal: isInternal
56729
56729
  })
@@ -56852,10 +56852,10 @@ const CommentsPlugin = Extension.create({
56852
56852
  prevDoc = doc2;
56853
56853
  shouldUpdate = false;
56854
56854
  const decorations = [];
56855
- const allCommentPositions = onlyActiveThreadChanged ? prevAllCommentPositions : {};
56855
+ const allCommentPositions = {};
56856
56856
  doc2.descendants((node, pos) => {
56857
56857
  const { marks = [] } = node;
56858
- const commentMarks = marks.filter((mark) => mark.type.name === CommentMarkName);
56858
+ const commentMarks = marks.filter((mark) => mark.type.name === CommentMarkName$1);
56859
56859
  let hasActive = false;
56860
56860
  commentMarks.forEach((commentMark) => {
56861
56861
  const { attrs } = commentMark;
@@ -56981,7 +56981,7 @@ const getActiveCommentId = (doc2, selection) => {
56981
56981
  return;
56982
56982
  }
56983
56983
  const { marks = [] } = node;
56984
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56984
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56985
56985
  if (commentMark) {
56986
56986
  overlaps.push({
56987
56987
  node,
@@ -57004,7 +57004,7 @@ const getActiveCommentId = (doc2, selection) => {
57004
57004
  }
57005
57005
  });
57006
57006
  const { marks: closestMarks = [] } = closestCommentRangeStart || {};
57007
- const closestCommentMark = closestMarks.find((mark) => mark.type.name === CommentMarkName);
57007
+ const closestCommentMark = closestMarks.find((mark) => mark.type.name === CommentMarkName$1);
57008
57008
  return closestCommentMark?.attrs?.commentId || closestCommentMark?.attrs?.importedId;
57009
57009
  };
57010
57010
  const findTrackedMark = ({
@@ -57054,7 +57054,7 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
57054
57054
  let nodes = step?.slice?.content?.content || [];
57055
57055
  if (!nodes.length) {
57056
57056
  newEditorState.doc.descendants((node) => {
57057
- const hasFormatMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57057
+ const hasFormatMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57058
57058
  if (hasFormatMark) {
57059
57059
  nodes = [node];
57060
57060
  return false;
@@ -57079,19 +57079,19 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
57079
57079
  const getTrackedChangeText = ({ nodes, mark, trackedChangeType, isDeletionInsertion }) => {
57080
57080
  let trackedChangeText = "";
57081
57081
  let deletionText = "";
57082
- if (trackedChangeType === TrackInsertMarkName) {
57082
+ if (trackedChangeType === TrackInsertMarkName$1) {
57083
57083
  trackedChangeText = nodes.reduce((acc, node) => {
57084
57084
  if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
57085
57085
  acc += node?.text || node?.textContent || "";
57086
57086
  return acc;
57087
57087
  }, "");
57088
57088
  }
57089
- if (trackedChangeType === TrackFormatMarkName) {
57089
+ if (trackedChangeType === TrackFormatMarkName$1) {
57090
57090
  trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
57091
57091
  }
57092
- if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
57092
+ if (trackedChangeType === TrackDeleteMarkName$1 || isDeletionInsertion) {
57093
57093
  deletionText = nodes.reduce((acc, node) => {
57094
- if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
57094
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName$1)) return acc;
57095
57095
  acc += node?.text || node?.textContent || "";
57096
57096
  return acc;
57097
57097
  }, "");
@@ -57157,7 +57157,7 @@ function findRangeById(doc2, id) {
57157
57157
  if (to === null || pos + node.nodeSize > to) to = pos + node.nodeSize;
57158
57158
  }
57159
57159
  const commentMark = node.marks.find(
57160
- (m2) => m2.type.name === CommentMarkName && (m2.attrs.commentId === id || m2.attrs.importedId === id)
57160
+ (m2) => m2.type.name === CommentMarkName$1 && (m2.attrs.commentId === id || m2.attrs.importedId === id)
57161
57161
  );
57162
57162
  if (commentMark) {
57163
57163
  if (from2 === null || pos < from2) from2 = pos;
@@ -57167,7 +57167,7 @@ function findRangeById(doc2, id) {
57167
57167
  return from2 !== null && to !== null ? { from: from2, to } : null;
57168
57168
  }
57169
57169
  const replaceStep = ({ state: state2, tr, step, newTr, map: map22, user, date, originalStep, originalStepIndex }) => {
57170
- const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName];
57170
+ const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName$1];
57171
57171
  const deletionMark = findMark(state2, deletionMarkSchema, false);
57172
57172
  const positionTo = deletionMark ? deletionMark.to : step.to;
57173
57173
  const newStep = new ReplaceStep(
@@ -57231,17 +57231,17 @@ const addMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) => {
57231
57231
  if (!node.isInline) {
57232
57232
  return;
57233
57233
  }
57234
- if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
57234
+ if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
57235
57235
  return false;
57236
57236
  }
57237
57237
  const existingChangeMark = node.marks.find(
57238
- (mark) => [TrackDeleteMarkName, TrackFormatMarkName].includes(mark.type.name)
57238
+ (mark) => [TrackDeleteMarkName$1, TrackFormatMarkName$1].includes(mark.type.name)
57239
57239
  );
57240
57240
  const wid = existingChangeMark ? existingChangeMark.attrs.id : v4();
57241
57241
  newTr.addMark(Math.max(step.from, pos), Math.min(step.to, pos + node.nodeSize), step.mark);
57242
57242
  const allowedMarks = ["bold", "italic", "strike", "underline", "textStyle"];
57243
57243
  if (allowedMarks.includes(step.mark.type.name) && !node.marks.find((mark) => mark.type === step.mark.type)) {
57244
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57244
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57245
57245
  let after = [];
57246
57246
  let before = [];
57247
57247
  if (formatChangeMark) {
@@ -57277,7 +57277,7 @@ const addMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) => {
57277
57277
  ];
57278
57278
  }
57279
57279
  if (after.length || before.length) {
57280
- const newFormatMark = state2.schema.marks[TrackFormatMarkName].create({
57280
+ const newFormatMark = state2.schema.marks[TrackFormatMarkName$1].create({
57281
57281
  id: wid,
57282
57282
  author: user.name,
57283
57283
  authorEmail: user.email,
@@ -57309,13 +57309,13 @@ const removeMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) =
57309
57309
  if (!node.isInline) {
57310
57310
  return true;
57311
57311
  }
57312
- if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
57312
+ if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
57313
57313
  return false;
57314
57314
  }
57315
57315
  newTr.removeMark(Math.max(step.from, pos), Math.min(step.to, pos + node.nodeSize), step.mark);
57316
57316
  const allowedMarks = ["bold", "italic", "strike", "underline", "textStyle"];
57317
57317
  if (allowedMarks.includes(step.mark.type.name) && node.marks.find((mark) => mark.type === step.mark.type)) {
57318
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57318
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57319
57319
  let after = [];
57320
57320
  let before = [];
57321
57321
  if (formatChangeMark) {
@@ -57343,7 +57343,7 @@ const removeMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) =
57343
57343
  ];
57344
57344
  }
57345
57345
  if (after.length || before.length) {
57346
- const newFormatMark = state2.schema.marks[TrackFormatMarkName].create({
57346
+ const newFormatMark = state2.schema.marks[TrackFormatMarkName$1].create({
57347
57347
  id: v4(),
57348
57348
  author: user.name,
57349
57349
  authorEmail: user.email,
@@ -57424,7 +57424,7 @@ const trackedTransaction = ({ tr, state: state2, user }) => {
57424
57424
  newTr.setMeta("addToHistory", tr.getMeta("addToHistory"));
57425
57425
  }
57426
57426
  if (tr.selectionSet) {
57427
- const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName];
57427
+ const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName$1];
57428
57428
  const deletionMark = findMark(state2, deletionMarkSchema, false);
57429
57429
  if (tr.selection instanceof TextSelection$1 && (tr.selection.from < state2.selection.from || tr.getMeta("inputType") === "deleteContentBackward")) {
57430
57430
  const caretPos = map22.map(tr.selection.from, -1);
@@ -59031,7 +59031,7 @@ const isHeadless = (editor) => {
59031
59031
  const shouldSkipNodeView = (editor) => {
59032
59032
  return isHeadless(editor);
59033
59033
  };
59034
- const summaryVersion = "1.0.0-beta.32";
59034
+ const summaryVersion = "1.0.0-beta.33";
59035
59035
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59036
59036
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59037
59037
  function mapAttributes(attrs) {
@@ -59820,7 +59820,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
59820
59820
  { default: remarkStringify },
59821
59821
  { default: remarkGfm }
59822
59822
  ] = await Promise.all([
59823
- Promise.resolve().then(() => require("./index-SGV4U12y-Dh5jaROA.cjs")),
59823
+ Promise.resolve().then(() => require("./index-hX4H5xPH-DfkQd7UH.cjs")),
59824
59824
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
59825
59825
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
59826
59826
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60025,7 +60025,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60025
60025
  * Process collaboration migrations
60026
60026
  */
60027
60027
  processCollaborationMigrations() {
60028
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.32");
60028
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.33");
60029
60029
  if (!this.options.ydoc) return;
60030
60030
  const metaMap = this.options.ydoc.getMap("meta");
60031
60031
  let docVersion = metaMap.get("version");
@@ -72822,7 +72822,7 @@ function hitTestFragment(layout, pageHit, blocks, measures, point) {
72822
72822
  });
72823
72823
  for (const fragment of fragments) {
72824
72824
  if (fragment.kind !== "para") continue;
72825
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
72825
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72826
72826
  if (blockIndex === -1) continue;
72827
72827
  const block = blocks[blockIndex];
72828
72828
  const measure = measures[blockIndex];
@@ -72849,7 +72849,7 @@ const hitTestAtomicFragment = (pageHit, blocks, measures, point) => {
72849
72849
  const withinX = point.x >= fragment.x && point.x <= fragment.x + fragment.width;
72850
72850
  const withinY = point.y >= fragment.y && point.y <= fragment.y + fragment.height;
72851
72851
  if (!withinX || !withinY) continue;
72852
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
72852
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72853
72853
  if (blockIndex === -1) continue;
72854
72854
  const block = blocks[blockIndex];
72855
72855
  const measure = measures[blockIndex];
@@ -72988,7 +72988,7 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
72988
72988
  blockId = fragment.blockId;
72989
72989
  pageIndex = pi;
72990
72990
  column = determineColumn(layout, fragment.x);
72991
- const blockIndex = blocks.findIndex((b2) => b2.id === fragment.blockId);
72991
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72992
72992
  if (blockIndex !== -1) {
72993
72993
  const measure = measures[blockIndex];
72994
72994
  if (measure && measure.kind === "paragraph") {
@@ -73138,6 +73138,44 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
73138
73138
  });
73139
73139
  return null;
73140
73140
  }
73141
+ function findBlockIndexByFragmentId(blocks, fragmentBlockId, targetPmRange) {
73142
+ const index2 = blocks.findIndex(
73143
+ (block) => block.id === fragmentBlockId && block.kind !== "pageBreak" && block.kind !== "sectionBreak"
73144
+ );
73145
+ if (index2 !== -1) {
73146
+ return index2;
73147
+ }
73148
+ const baseBlockId = fragmentBlockId.replace(/-\d+$/, "");
73149
+ if (baseBlockId === fragmentBlockId) {
73150
+ return -1;
73151
+ }
73152
+ const matchingIndices = [];
73153
+ blocks.forEach((block, idx) => {
73154
+ if (block.id === baseBlockId && block.kind === "paragraph") {
73155
+ matchingIndices.push(idx);
73156
+ }
73157
+ });
73158
+ if (matchingIndices.length === 0) {
73159
+ return -1;
73160
+ }
73161
+ if (matchingIndices.length === 1) {
73162
+ return matchingIndices[0];
73163
+ }
73164
+ if (targetPmRange) {
73165
+ for (const idx of matchingIndices) {
73166
+ const block = blocks[idx];
73167
+ if (block.kind !== "paragraph") continue;
73168
+ const hasOverlap = block.runs.some((run2) => {
73169
+ if (run2.pmStart == null || run2.pmEnd == null) return false;
73170
+ return run2.pmEnd > targetPmRange.from && run2.pmStart < targetPmRange.to;
73171
+ });
73172
+ if (hasOverlap) {
73173
+ return idx;
73174
+ }
73175
+ }
73176
+ }
73177
+ return matchingIndices[0];
73178
+ }
73141
73179
  function selectionToRects(layout, blocks, measures, from2, to) {
73142
73180
  if (from2 === to) {
73143
73181
  return [];
@@ -73146,8 +73184,10 @@ function selectionToRects(layout, blocks, measures, from2, to) {
73146
73184
  layout.pages.forEach((page, pageIndex) => {
73147
73185
  page.fragments.forEach((fragment) => {
73148
73186
  if (fragment.kind === "para") {
73149
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73150
- if (blockIndex === -1) return;
73187
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId, { from: from2, to });
73188
+ if (blockIndex === -1) {
73189
+ return;
73190
+ }
73151
73191
  const block = blocks[blockIndex];
73152
73192
  const measure = measures[blockIndex];
73153
73193
  if (!block || block.kind !== "paragraph" || measure?.kind !== "paragraph") {
@@ -73183,7 +73223,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
73183
73223
  return;
73184
73224
  }
73185
73225
  if (isAtomicFragment(fragment)) {
73186
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73226
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId, { from: from2, to });
73187
73227
  if (blockIndex === -1) return;
73188
73228
  const block = blocks[blockIndex];
73189
73229
  const pmRange = getAtomicPmRange(fragment, block);
@@ -73204,7 +73244,7 @@ function getFragmentAtPosition(layout, blocks, measures, pos) {
73204
73244
  for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
73205
73245
  const page = layout.pages[pageIndex];
73206
73246
  for (const fragment of page.fragments) {
73207
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73247
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
73208
73248
  if (blockIndex === -1) {
73209
73249
  continue;
73210
73250
  }
@@ -82682,6 +82722,10 @@ function isInRegisteredSurface(event) {
82682
82722
  }
82683
82723
  return false;
82684
82724
  }
82725
+ const CommentMarkName = "commentMark";
82726
+ const TrackInsertMarkName = "trackInsert";
82727
+ const TrackDeleteMarkName = "trackDelete";
82728
+ const TrackFormatMarkName = "trackFormat";
82685
82729
  function isValidFieldAnnotationAttributes(attrs) {
82686
82730
  if (!attrs || typeof attrs !== "object") return false;
82687
82731
  const a = attrs;
@@ -84171,6 +84215,33 @@ _scrollCleanup = /* @__PURE__ */ new WeakMap();
84171
84215
  _remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
84172
84216
  _scrollTimeout = /* @__PURE__ */ new WeakMap();
84173
84217
  _PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
84218
+ collectCommentPositions_fn = function() {
84219
+ const editorState = __privateGet$1(this, _editor3)?.state;
84220
+ if (!editorState) return {};
84221
+ const doc2 = editorState.doc;
84222
+ const trackChangeMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
84223
+ const pmPositions = {};
84224
+ doc2.descendants((node, pos) => {
84225
+ const marks = node.marks || [];
84226
+ for (const mark of marks) {
84227
+ let threadId;
84228
+ if (mark.type.name === CommentMarkName) {
84229
+ threadId = mark.attrs.commentId || mark.attrs.importedId;
84230
+ } else if (trackChangeMarks.includes(mark.type.name)) {
84231
+ threadId = mark.attrs.id;
84232
+ }
84233
+ if (!threadId) continue;
84234
+ const nodeEnd = pos + node.nodeSize;
84235
+ if (!pmPositions[threadId]) {
84236
+ pmPositions[threadId] = { threadId, start: pos, end: nodeEnd };
84237
+ } else {
84238
+ pmPositions[threadId].start = Math.min(pmPositions[threadId].start, pos);
84239
+ pmPositions[threadId].end = Math.max(pmPositions[threadId].end, nodeEnd);
84240
+ }
84241
+ }
84242
+ });
84243
+ return pmPositions;
84244
+ };
84174
84245
  aggregateLayoutBounds_fn = function(rects) {
84175
84246
  if (!rects.length) return null;
84176
84247
  const top2 = Math.min(...rects.map((rect) => rect.top));
@@ -84981,6 +85052,11 @@ rerender_fn = async function() {
84981
85052
  const payload = { layout, blocks, measures, metrics };
84982
85053
  this.emit("layoutUpdated", payload);
84983
85054
  this.emit("paginationUpdate", payload);
85055
+ const commentPositions = __privateMethod$1(this, _PresentationEditor_instances, collectCommentPositions_fn).call(this);
85056
+ const positionKeys = Object.keys(commentPositions);
85057
+ if (positionKeys.length > 0) {
85058
+ this.emit("commentPositions", { positions: commentPositions });
85059
+ }
84984
85060
  if (__privateGet$1(this, _telemetryEmitter) && metrics) {
84985
85061
  __privateGet$1(this, _telemetryEmitter).call(this, { type: "layout", data: { layout, blocks, measures, metrics } });
84986
85062
  }
@@ -90447,6 +90523,7 @@ const Paragraph = OxmlNode.create({
90447
90523
  return ["p", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
90448
90524
  },
90449
90525
  addNodeView() {
90526
+ if (this.editor.options?.mode !== "docx" || !this.editor.converter) return null;
90450
90527
  if (shouldSkipNodeView(this.editor)) return null;
90451
90528
  return ({ node, editor, getPos, decorations, extensionAttrs }) => {
90452
90529
  return new ParagraphNodeView(node, editor, getPos, decorations, extensionAttrs);
@@ -90689,7 +90766,7 @@ const CommentReference = Node$1.create({
90689
90766
  }
90690
90767
  });
90691
90768
  const CommentsMark = Mark2.create({
90692
- name: CommentMarkName,
90769
+ name: CommentMarkName$1,
90693
90770
  group: "comments",
90694
90771
  excludes: "",
90695
90772
  addOptions() {
@@ -90708,10 +90785,10 @@ const CommentsMark = Mark2.create({
90708
90785
  };
90709
90786
  },
90710
90787
  parseDOM() {
90711
- return [{ tag: CommentMarkName }];
90788
+ return [{ tag: CommentMarkName$1 }];
90712
90789
  },
90713
90790
  renderDOM({ htmlAttributes }) {
90714
- return [CommentMarkName, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
90791
+ return [CommentMarkName$1, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
90715
90792
  }
90716
90793
  });
90717
90794
  let cache$2 = /* @__PURE__ */ new WeakMap();
@@ -100895,7 +100972,7 @@ function addLinkRelationship({ editor, href }) {
100895
100972
  }
100896
100973
  const trackInsertClass = "track-insert";
100897
100974
  const TrackInsert = Mark2.create({
100898
- name: TrackInsertMarkName,
100975
+ name: TrackInsertMarkName$1,
100899
100976
  group: "track",
100900
100977
  inclusive: false,
100901
100978
  addOptions() {
@@ -100972,7 +101049,7 @@ const TrackInsert = Mark2.create({
100972
101049
  });
100973
101050
  const trackDeleteClass = "track-delete";
100974
101051
  const TrackDelete = Mark2.create({
100975
- name: TrackDeleteMarkName,
101052
+ name: TrackDeleteMarkName$1,
100976
101053
  group: "track",
100977
101054
  inclusive: false,
100978
101055
  addOptions() {
@@ -101081,7 +101158,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
101081
101158
  }, Symbol.toStringTag, { value: "Module" }));
101082
101159
  const trackFormatClass = "track-format";
101083
101160
  const TrackFormat = Mark2.create({
101084
- name: TrackFormatMarkName,
101161
+ name: TrackFormatMarkName$1,
101085
101162
  group: "track",
101086
101163
  inclusive: false,
101087
101164
  addOptions() {
@@ -101295,7 +101372,7 @@ const TrackChanges = Extension.create({
101295
101372
  tr.setMeta("inputType", "acceptReject");
101296
101373
  const map22 = new Mapping();
101297
101374
  doc2.nodesBetween(from2, to, (node, pos) => {
101298
- if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
101375
+ if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
101299
101376
  const deletionStep = new ReplaceStep(
101300
101377
  map22.map(Math.max(pos, from2)),
101301
101378
  map22.map(Math.min(pos + node.nodeSize, to)),
@@ -101303,8 +101380,8 @@ const TrackChanges = Extension.create({
101303
101380
  );
101304
101381
  tr.step(deletionStep);
101305
101382
  map22.appendMap(deletionStep.getMap());
101306
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName)) {
101307
- const insertionMark = node.marks.find((mark) => mark.type.name === TrackInsertMarkName);
101383
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
101384
+ const insertionMark = node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1);
101308
101385
  tr.step(
101309
101386
  new RemoveMarkStep(
101310
101387
  map22.map(Math.max(pos, from2)),
@@ -101312,8 +101389,8 @@ const TrackChanges = Extension.create({
101312
101389
  insertionMark
101313
101390
  )
101314
101391
  );
101315
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName)) {
101316
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
101392
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
101393
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
101317
101394
  tr.step(
101318
101395
  new RemoveMarkStep(
101319
101396
  map22.map(Math.max(pos, from2)),
@@ -101335,8 +101412,8 @@ const TrackChanges = Extension.create({
101335
101412
  tr.setMeta("inputType", "acceptReject");
101336
101413
  const map22 = new Mapping();
101337
101414
  doc2.nodesBetween(from2, to, (node, pos) => {
101338
- if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
101339
- const deletionMark = node.marks.find((mark) => mark.type.name === TrackDeleteMarkName);
101415
+ if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
101416
+ const deletionMark = node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1);
101340
101417
  tr.step(
101341
101418
  new RemoveMarkStep(
101342
101419
  map22.map(Math.max(pos, from2)),
@@ -101344,7 +101421,7 @@ const TrackChanges = Extension.create({
101344
101421
  deletionMark
101345
101422
  )
101346
101423
  );
101347
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName)) {
101424
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
101348
101425
  const deletionStep = new ReplaceStep(
101349
101426
  map22.map(Math.max(pos, from2)),
101350
101427
  map22.map(Math.min(pos + node.nodeSize, to)),
@@ -101352,8 +101429,8 @@ const TrackChanges = Extension.create({
101352
101429
  );
101353
101430
  tr.step(deletionStep);
101354
101431
  map22.appendMap(deletionStep.getMap());
101355
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName)) {
101356
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
101432
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
101433
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
101357
101434
  formatChangeMark.attrs.before.forEach((oldMark) => {
101358
101435
  tr.step(
101359
101436
  new AddMarkStep(
@@ -101529,7 +101606,7 @@ const getChangesByIdToResolve = (state2, id) => {
101529
101606
  const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
101530
101607
  return !hasContentBetween;
101531
101608
  };
101532
- const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
101609
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName$1 && secondType === TrackInsertMarkName$1 || firstType === TrackInsertMarkName$1 && secondType === TrackDeleteMarkName$1;
101533
101610
  const linkedBefore = [];
101534
101611
  const linkedAfter = [];
101535
101612
  const collectDirection = (direction, collection) => {