@harbour-enterprises/superdoc 1.0.0-beta.32 → 1.0.0-beta.34
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.
- package/dist/chunks/{PdfViewer-CTKbqDWv.cjs → PdfViewer-CMVOK_jD.cjs} +1 -1
- package/dist/chunks/{PdfViewer-edjIRb_p.es.js → PdfViewer-DSx1zQC5.es.js} +1 -1
- package/dist/chunks/{index-Pwv0a9G5.es.js → index-8_ijaxSz.es.js} +57 -32
- package/dist/chunks/{index-Cajp7-Xa.cjs → index-BqXrnRP8.cjs} +57 -32
- package/dist/chunks/{index-SGV4U12y-Dh5jaROA.cjs → index-CQeXM6oB-BAx-uLYb.cjs} +1 -1
- package/dist/chunks/{index-SGV4U12y-BPGxOtvI.es.js → index-CQeXM6oB-DjCz53Th.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BbbbKgEs.cjs → super-editor.es-CgTVSX1p.cjs} +433 -124
- package/dist/chunks/{super-editor.es-CdGsYGU1.es.js → super-editor.es-TkKngzld.es.js} +433 -124
- package/dist/style.css +33 -33
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CpuOoAUa.js → converter-Hv-kNdxI.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-Dk99r397.js → docx-zipper-C6nUdlsw.js} +1 -1
- package/dist/super-editor/chunks/{editor-CFv-RJI-.js → editor-uvvccWc5.js} +487 -117
- package/dist/super-editor/chunks/{index-SGV4U12y.js → index-CQeXM6oB.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CQr3Xnx9.js → toolbar-BCWRHtW5.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +10 -9
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +489 -155
- package/dist/superdoc.umd.js.map +1 -1
- 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.
|
|
41861
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.34") {
|
|
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,
|
|
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, _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, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, computeAnchorMap_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
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 =
|
|
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.
|
|
59034
|
+
const summaryVersion = "1.0.0-beta.34";
|
|
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-
|
|
59823
|
+
Promise.resolve().then(() => require("./index-CQeXM6oB-BAx-uLYb.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.
|
|
60028
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.34");
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
73150
|
-
if (blockIndex === -1)
|
|
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.
|
|
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
|
|
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;
|
|
@@ -82694,7 +82738,7 @@ const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
|
|
|
82694
82738
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
82695
82739
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
82696
82740
|
const HEADER_FOOTER_INIT_BUDGET_MS = 200;
|
|
82697
|
-
const SCROLL_DEBOUNCE_MS =
|
|
82741
|
+
const SCROLL_DEBOUNCE_MS = 32;
|
|
82698
82742
|
const MAX_ZOOM_WARNING_THRESHOLD = 10;
|
|
82699
82743
|
const MAX_SELECTION_RECTS_PER_USER = 100;
|
|
82700
82744
|
const DEFAULT_STALE_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
@@ -82711,7 +82755,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
82711
82755
|
__privateAdd$1(this, _selectionOverlay2);
|
|
82712
82756
|
__privateAdd$1(this, _hiddenHost);
|
|
82713
82757
|
__privateAdd$1(this, _layoutOptions);
|
|
82714
|
-
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null });
|
|
82758
|
+
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null, bookmarks: /* @__PURE__ */ new Map() });
|
|
82715
82759
|
__privateAdd$1(this, _domPainter, null);
|
|
82716
82760
|
__privateAdd$1(this, _dragHandlerCleanup, null);
|
|
82717
82761
|
__privateAdd$1(this, _layoutError, null);
|
|
@@ -82761,18 +82805,31 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
82761
82805
|
__privateAdd$1(this, _isDragging, false);
|
|
82762
82806
|
__privateAdd$1(this, _dragExtensionMode, "char");
|
|
82763
82807
|
__privateAdd$1(this, _remoteCursorState, /* @__PURE__ */ new Map());
|
|
82808
|
+
__privateAdd$1(this, _remoteCursorElements, /* @__PURE__ */ new Map());
|
|
82764
82809
|
__privateAdd$1(this, _remoteCursorDirty, false);
|
|
82765
82810
|
__privateAdd$1(this, _remoteCursorOverlay, null);
|
|
82766
82811
|
__privateAdd$1(this, _localSelectionLayer, null);
|
|
82767
82812
|
__privateAdd$1(this, _awarenessCleanup, null);
|
|
82768
82813
|
__privateAdd$1(this, _scrollCleanup, null);
|
|
82769
|
-
__privateAdd$1(this, _remoteCursorRafHandle, null);
|
|
82770
82814
|
__privateAdd$1(this, _scrollTimeout);
|
|
82815
|
+
__privateAdd$1(this, _lastRemoteCursorRenderTime, 0);
|
|
82816
|
+
__privateAdd$1(this, _remoteCursorThrottleTimeout, null);
|
|
82771
82817
|
__privateAdd$1(this, _handlePointerDown, (event) => {
|
|
82772
82818
|
if (event.button !== 0) {
|
|
82773
82819
|
return;
|
|
82774
82820
|
}
|
|
82775
82821
|
const target = event.target;
|
|
82822
|
+
const linkEl = target?.closest?.("a.superdoc-link");
|
|
82823
|
+
if (linkEl) {
|
|
82824
|
+
const href = linkEl.getAttribute("href") ?? "";
|
|
82825
|
+
const isAnchorLink = href.startsWith("#") && href.length > 1;
|
|
82826
|
+
if (isAnchorLink) {
|
|
82827
|
+
event.preventDefault();
|
|
82828
|
+
event.stopPropagation();
|
|
82829
|
+
this.goToAnchor(href);
|
|
82830
|
+
return;
|
|
82831
|
+
}
|
|
82832
|
+
}
|
|
82776
82833
|
const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
|
|
82777
82834
|
if (!__privateGet$1(this, _layoutState).layout) {
|
|
82778
82835
|
if (!isDraggableAnnotation) {
|
|
@@ -84032,12 +84089,11 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84032
84089
|
__privateSet(this, _rafHandle, null);
|
|
84033
84090
|
}, "Layout RAF");
|
|
84034
84091
|
}
|
|
84035
|
-
if (__privateGet$1(this,
|
|
84092
|
+
if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
|
|
84036
84093
|
__privateMethod$1(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
|
|
84037
|
-
|
|
84038
|
-
|
|
84039
|
-
|
|
84040
|
-
}, "Remote cursor RAF");
|
|
84094
|
+
clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
|
|
84095
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
84096
|
+
}, "Remote cursor throttle");
|
|
84041
84097
|
}
|
|
84042
84098
|
__privateGet$1(this, _editorListeners).forEach(({ event, handler: handler2 }) => __privateGet$1(this, _editor3)?.off(event, handler2));
|
|
84043
84099
|
__privateSet(this, _editorListeners, []);
|
|
@@ -84061,6 +84117,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84061
84117
|
__privateSet(this, _scrollCleanup, null);
|
|
84062
84118
|
}
|
|
84063
84119
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
84120
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
84064
84121
|
__privateSet(this, _remoteCursorOverlay, null);
|
|
84065
84122
|
if (__privateGet$1(this, _options)?.documentId) {
|
|
84066
84123
|
__privateGet$1(_PresentationEditor2, _instances).delete(__privateGet$1(this, _options).documentId);
|
|
@@ -84103,6 +84160,94 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84103
84160
|
__privateGet$1(this, _editor3).destroy();
|
|
84104
84161
|
}
|
|
84105
84162
|
}
|
|
84163
|
+
/**
|
|
84164
|
+
* Navigate to a bookmark/anchor in the current document (e.g., TOC links).
|
|
84165
|
+
*
|
|
84166
|
+
* This method performs asynchronous navigation to support virtualized page rendering:
|
|
84167
|
+
* 1. Normalizes the anchor by removing leading '#' if present
|
|
84168
|
+
* 2. Looks up the bookmark in the document's bookmark registry
|
|
84169
|
+
* 3. Determines which page contains the target position
|
|
84170
|
+
* 4. Scrolls the page into view (may be virtualized)
|
|
84171
|
+
* 5. Waits up to 2000ms for the page to mount in the DOM
|
|
84172
|
+
* 6. Moves the editor caret to the bookmark position
|
|
84173
|
+
*
|
|
84174
|
+
* @param anchor - Bookmark name or fragment identifier (with or without leading '#')
|
|
84175
|
+
* @returns Promise resolving to true if navigation succeeded, false otherwise
|
|
84176
|
+
*
|
|
84177
|
+
* @remarks
|
|
84178
|
+
* Navigation fails and returns false if:
|
|
84179
|
+
* - The anchor parameter is empty or becomes empty after normalization
|
|
84180
|
+
* - No layout has been computed yet
|
|
84181
|
+
* - The bookmark does not exist in the document
|
|
84182
|
+
* - The bookmark's page cannot be determined
|
|
84183
|
+
* - The page fails to mount within the timeout period (2000ms)
|
|
84184
|
+
*
|
|
84185
|
+
* Note: This method does not throw errors. All failures are logged and result in
|
|
84186
|
+
* a false return value. An 'error' event is emitted for unhandled exceptions.
|
|
84187
|
+
*
|
|
84188
|
+
* @throws Never throws directly - errors are caught, logged, and emitted as events
|
|
84189
|
+
*/
|
|
84190
|
+
async goToAnchor(anchor) {
|
|
84191
|
+
try {
|
|
84192
|
+
if (!anchor) return false;
|
|
84193
|
+
const layout = __privateGet$1(this, _layoutState).layout;
|
|
84194
|
+
if (!layout) return false;
|
|
84195
|
+
const normalized = anchor.startsWith("#") ? anchor.slice(1) : anchor;
|
|
84196
|
+
if (!normalized) return false;
|
|
84197
|
+
const pmPos = __privateGet$1(this, _layoutState).bookmarks.get(normalized);
|
|
84198
|
+
if (pmPos == null) return false;
|
|
84199
|
+
const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, pmPos, pmPos + 1) ?? [];
|
|
84200
|
+
const rect = rects[0];
|
|
84201
|
+
let pageIndex = rect?.pageIndex ?? null;
|
|
84202
|
+
if (pageIndex == null) {
|
|
84203
|
+
let nextFragmentPage = null;
|
|
84204
|
+
let nextFragmentStart = null;
|
|
84205
|
+
for (const page of layout.pages) {
|
|
84206
|
+
for (const fragment of page.fragments) {
|
|
84207
|
+
if (fragment.kind !== "para") continue;
|
|
84208
|
+
const fragStart = fragment.pmStart;
|
|
84209
|
+
const fragEnd = fragment.pmEnd;
|
|
84210
|
+
if (fragStart == null || fragEnd == null) continue;
|
|
84211
|
+
if (pmPos >= fragStart && pmPos < fragEnd) {
|
|
84212
|
+
pageIndex = page.number - 1;
|
|
84213
|
+
break;
|
|
84214
|
+
}
|
|
84215
|
+
if (fragStart > pmPos && (nextFragmentStart === null || fragStart < nextFragmentStart)) {
|
|
84216
|
+
nextFragmentPage = page.number - 1;
|
|
84217
|
+
nextFragmentStart = fragStart;
|
|
84218
|
+
}
|
|
84219
|
+
}
|
|
84220
|
+
if (pageIndex != null) break;
|
|
84221
|
+
}
|
|
84222
|
+
if (pageIndex == null && nextFragmentPage != null) {
|
|
84223
|
+
pageIndex = nextFragmentPage;
|
|
84224
|
+
}
|
|
84225
|
+
}
|
|
84226
|
+
if (pageIndex == null) return false;
|
|
84227
|
+
__privateMethod$1(this, _PresentationEditor_instances, scrollPageIntoView_fn).call(this, pageIndex);
|
|
84228
|
+
await __privateMethod$1(this, _PresentationEditor_instances, waitForPageMount_fn).call(this, pageIndex, { timeout: _PresentationEditor2.ANCHOR_NAV_TIMEOUT_MS });
|
|
84229
|
+
const pageEl = __privateGet$1(this, _painterHost)?.querySelector(`[data-page-index="${pageIndex}"]`);
|
|
84230
|
+
if (pageEl) {
|
|
84231
|
+
pageEl.scrollIntoView({ behavior: "instant", block: "start" });
|
|
84232
|
+
}
|
|
84233
|
+
const activeEditor = this.getActiveEditor();
|
|
84234
|
+
if (activeEditor?.commands?.setTextSelection) {
|
|
84235
|
+
activeEditor.commands.setTextSelection({ from: pmPos, to: pmPos });
|
|
84236
|
+
} else {
|
|
84237
|
+
console.warn(
|
|
84238
|
+
"[PresentationEditor] goToAnchor: Navigation succeeded but could not move caret (editor commands unavailable)"
|
|
84239
|
+
);
|
|
84240
|
+
}
|
|
84241
|
+
return true;
|
|
84242
|
+
} catch (error) {
|
|
84243
|
+
console.error("[PresentationEditor] goToAnchor failed:", error);
|
|
84244
|
+
this.emit("error", {
|
|
84245
|
+
error,
|
|
84246
|
+
context: "goToAnchor"
|
|
84247
|
+
});
|
|
84248
|
+
return false;
|
|
84249
|
+
}
|
|
84250
|
+
}
|
|
84106
84251
|
};
|
|
84107
84252
|
_instances = /* @__PURE__ */ new WeakMap();
|
|
84108
84253
|
_options = /* @__PURE__ */ new WeakMap();
|
|
@@ -84163,14 +84308,43 @@ _dragAnchor = /* @__PURE__ */ new WeakMap();
|
|
|
84163
84308
|
_isDragging = /* @__PURE__ */ new WeakMap();
|
|
84164
84309
|
_dragExtensionMode = /* @__PURE__ */ new WeakMap();
|
|
84165
84310
|
_remoteCursorState = /* @__PURE__ */ new WeakMap();
|
|
84311
|
+
_remoteCursorElements = /* @__PURE__ */ new WeakMap();
|
|
84166
84312
|
_remoteCursorDirty = /* @__PURE__ */ new WeakMap();
|
|
84167
84313
|
_remoteCursorOverlay = /* @__PURE__ */ new WeakMap();
|
|
84168
84314
|
_localSelectionLayer = /* @__PURE__ */ new WeakMap();
|
|
84169
84315
|
_awarenessCleanup = /* @__PURE__ */ new WeakMap();
|
|
84170
84316
|
_scrollCleanup = /* @__PURE__ */ new WeakMap();
|
|
84171
|
-
_remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
|
|
84172
84317
|
_scrollTimeout = /* @__PURE__ */ new WeakMap();
|
|
84318
|
+
_lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
|
|
84319
|
+
_remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
|
|
84173
84320
|
_PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
|
|
84321
|
+
collectCommentPositions_fn = function() {
|
|
84322
|
+
const editorState = __privateGet$1(this, _editor3)?.state;
|
|
84323
|
+
if (!editorState) return {};
|
|
84324
|
+
const doc2 = editorState.doc;
|
|
84325
|
+
const trackChangeMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
|
|
84326
|
+
const pmPositions = {};
|
|
84327
|
+
doc2.descendants((node, pos) => {
|
|
84328
|
+
const marks = node.marks || [];
|
|
84329
|
+
for (const mark of marks) {
|
|
84330
|
+
let threadId;
|
|
84331
|
+
if (mark.type.name === CommentMarkName) {
|
|
84332
|
+
threadId = mark.attrs.commentId || mark.attrs.importedId;
|
|
84333
|
+
} else if (trackChangeMarks.includes(mark.type.name)) {
|
|
84334
|
+
threadId = mark.attrs.id;
|
|
84335
|
+
}
|
|
84336
|
+
if (!threadId) continue;
|
|
84337
|
+
const nodeEnd = pos + node.nodeSize;
|
|
84338
|
+
if (!pmPositions[threadId]) {
|
|
84339
|
+
pmPositions[threadId] = { threadId, start: pos, end: nodeEnd };
|
|
84340
|
+
} else {
|
|
84341
|
+
pmPositions[threadId].start = Math.min(pmPositions[threadId].start, pos);
|
|
84342
|
+
pmPositions[threadId].end = Math.max(pmPositions[threadId].end, nodeEnd);
|
|
84343
|
+
}
|
|
84344
|
+
}
|
|
84345
|
+
});
|
|
84346
|
+
return pmPositions;
|
|
84347
|
+
};
|
|
84174
84348
|
aggregateLayoutBounds_fn = function(rects) {
|
|
84175
84349
|
if (!rects.length) return null;
|
|
84176
84350
|
const top2 = Math.min(...rects.map((rect) => rect.top));
|
|
@@ -84203,9 +84377,13 @@ setupEditorListeners_fn = function() {
|
|
|
84203
84377
|
__privateSet(this, _pendingDocChange, true);
|
|
84204
84378
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
|
|
84205
84379
|
}
|
|
84380
|
+
if (transaction?.docChanged) {
|
|
84381
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
84382
|
+
}
|
|
84206
84383
|
};
|
|
84207
84384
|
const handleSelection = () => {
|
|
84208
84385
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
|
|
84386
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
84209
84387
|
};
|
|
84210
84388
|
__privateGet$1(this, _editor3).on("update", handleUpdate);
|
|
84211
84389
|
__privateGet$1(this, _editor3).on("selectionUpdate", handleSelection);
|
|
@@ -84275,6 +84453,29 @@ setupCollaborationCursors_fn = function() {
|
|
|
84275
84453
|
});
|
|
84276
84454
|
handleAwarenessChange();
|
|
84277
84455
|
};
|
|
84456
|
+
updateLocalAwarenessCursor_fn = function() {
|
|
84457
|
+
const provider = __privateGet$1(this, _options).collaborationProvider;
|
|
84458
|
+
if (!provider?.awareness) return;
|
|
84459
|
+
if (typeof provider.awareness.setLocalStateField !== "function") {
|
|
84460
|
+
return;
|
|
84461
|
+
}
|
|
84462
|
+
const ystate = ySyncPluginKey.getState(__privateGet$1(this, _editor3).state);
|
|
84463
|
+
if (!ystate?.binding?.mapping) return;
|
|
84464
|
+
const { selection } = __privateGet$1(this, _editor3).state;
|
|
84465
|
+
const { anchor, head } = selection;
|
|
84466
|
+
try {
|
|
84467
|
+
const relAnchor = absolutePositionToRelativePosition(anchor, ystate.type, ystate.binding.mapping);
|
|
84468
|
+
const relHead = absolutePositionToRelativePosition(head, ystate.type, ystate.binding.mapping);
|
|
84469
|
+
if (relAnchor && relHead) {
|
|
84470
|
+
const cursorData = {
|
|
84471
|
+
anchor: relAnchor,
|
|
84472
|
+
head: relHead
|
|
84473
|
+
};
|
|
84474
|
+
provider.awareness.setLocalStateField("cursor", cursorData);
|
|
84475
|
+
}
|
|
84476
|
+
} catch {
|
|
84477
|
+
}
|
|
84478
|
+
};
|
|
84278
84479
|
normalizeAwarenessStates_fn = function() {
|
|
84279
84480
|
const provider = __privateGet$1(this, _options).collaborationProvider;
|
|
84280
84481
|
if (!provider?.awareness) return /* @__PURE__ */ new Map();
|
|
@@ -84342,27 +84543,45 @@ scheduleRemoteCursorUpdate_fn = function() {
|
|
|
84342
84543
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
84343
84544
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
84344
84545
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
84345
|
-
|
|
84346
|
-
|
|
84347
|
-
|
|
84348
|
-
|
|
84349
|
-
|
|
84350
|
-
|
|
84546
|
+
queueMicrotask(() => {
|
|
84547
|
+
if (!__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
84548
|
+
const now = performance.now();
|
|
84549
|
+
const elapsed = now - __privateGet$1(this, _lastRemoteCursorRenderTime);
|
|
84550
|
+
const THROTTLE_MS = 16;
|
|
84551
|
+
if (elapsed >= THROTTLE_MS) {
|
|
84552
|
+
if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
|
|
84553
|
+
clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
|
|
84554
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
84555
|
+
}
|
|
84556
|
+
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
84557
|
+
__privateSet(this, _lastRemoteCursorRenderTime, now);
|
|
84558
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
|
|
84559
|
+
return;
|
|
84560
|
+
}
|
|
84561
|
+
const remaining = THROTTLE_MS - elapsed;
|
|
84562
|
+
__privateSet(this, _remoteCursorThrottleTimeout, window.setTimeout(() => {
|
|
84563
|
+
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
84564
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
84565
|
+
__privateSet(this, _lastRemoteCursorRenderTime, performance.now());
|
|
84566
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
|
|
84567
|
+
}, remaining));
|
|
84568
|
+
});
|
|
84351
84569
|
};
|
|
84352
84570
|
scheduleRemoteCursorReRender_fn = function() {
|
|
84353
84571
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
84354
84572
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
84355
84573
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
84356
84574
|
const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
|
|
84357
|
-
|
|
84575
|
+
win.requestAnimationFrame(() => {
|
|
84358
84576
|
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
84359
|
-
__privateSet(this,
|
|
84577
|
+
__privateSet(this, _lastRemoteCursorRenderTime, performance.now());
|
|
84360
84578
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursors_fn).call(this);
|
|
84361
|
-
})
|
|
84579
|
+
});
|
|
84362
84580
|
};
|
|
84363
84581
|
updateRemoteCursors_fn = function() {
|
|
84364
84582
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) {
|
|
84365
84583
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
84584
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
84366
84585
|
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
84367
84586
|
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
84368
84587
|
}
|
|
@@ -84391,9 +84610,6 @@ updateRemoteCursors_fn = function() {
|
|
|
84391
84610
|
}
|
|
84392
84611
|
};
|
|
84393
84612
|
renderRemoteCursors_fn = function() {
|
|
84394
|
-
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
84395
|
-
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
84396
|
-
}
|
|
84397
84613
|
const layout = __privateGet$1(this, _layoutState)?.layout;
|
|
84398
84614
|
const blocks = __privateGet$1(this, _layoutState)?.blocks;
|
|
84399
84615
|
const measures = __privateGet$1(this, _layoutState)?.measures;
|
|
@@ -84402,37 +84618,63 @@ renderRemoteCursors_fn = function() {
|
|
|
84402
84618
|
}
|
|
84403
84619
|
const maxVisible = __privateGet$1(this, _layoutOptions).presence?.maxVisible ?? 20;
|
|
84404
84620
|
const sortedCursors = Array.from(__privateGet$1(this, _remoteCursorState).values()).sort((a, b2) => b2.updatedAt - a.updatedAt).slice(0, maxVisible);
|
|
84621
|
+
const visibleClientIds = /* @__PURE__ */ new Set();
|
|
84405
84622
|
sortedCursors.forEach((cursor) => {
|
|
84623
|
+
visibleClientIds.add(cursor.clientId);
|
|
84406
84624
|
if (cursor.anchor === cursor.head) {
|
|
84407
84625
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCaret_fn).call(this, cursor);
|
|
84408
84626
|
} else {
|
|
84409
84627
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteSelection_fn).call(this, cursor);
|
|
84410
84628
|
}
|
|
84411
84629
|
});
|
|
84630
|
+
__privateGet$1(this, _remoteCursorElements).forEach((element, clientId) => {
|
|
84631
|
+
if (!visibleClientIds.has(clientId)) {
|
|
84632
|
+
element.remove();
|
|
84633
|
+
__privateGet$1(this, _remoteCursorElements).delete(clientId);
|
|
84634
|
+
}
|
|
84635
|
+
});
|
|
84412
84636
|
};
|
|
84413
84637
|
renderRemoteCaret_fn = function(cursor) {
|
|
84414
84638
|
const caretLayout = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRect_fn).call(this, cursor.head);
|
|
84415
|
-
if (!caretLayout) return;
|
|
84416
|
-
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
|
|
84417
|
-
if (!coords) return;
|
|
84418
84639
|
const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
84419
84640
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
84420
84641
|
const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
84421
|
-
|
|
84422
|
-
|
|
84423
|
-
|
|
84424
|
-
|
|
84425
|
-
|
|
84426
|
-
|
|
84642
|
+
let caretEl = __privateGet$1(this, _remoteCursorElements).get(cursor.clientId);
|
|
84643
|
+
const isNewElement = !caretEl;
|
|
84644
|
+
if (isNewElement) {
|
|
84645
|
+
caretEl = doc2.createElement("div");
|
|
84646
|
+
caretEl.className = "presentation-editor__remote-caret";
|
|
84647
|
+
caretEl.style.position = "absolute";
|
|
84648
|
+
caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
|
|
84649
|
+
caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color}`;
|
|
84650
|
+
caretEl.style.pointerEvents = "none";
|
|
84651
|
+
caretEl.style.transition = "transform 50ms ease-out, height 50ms ease-out, opacity 100ms ease-out";
|
|
84652
|
+
caretEl.style.willChange = "transform";
|
|
84653
|
+
caretEl.setAttribute("data-client-id", cursor.clientId.toString());
|
|
84654
|
+
caretEl.setAttribute("aria-hidden", "true");
|
|
84655
|
+
if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
|
|
84656
|
+
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
|
|
84657
|
+
}
|
|
84658
|
+
__privateGet$1(this, _remoteCursorElements).set(cursor.clientId, caretEl);
|
|
84659
|
+
__privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
|
|
84660
|
+
}
|
|
84661
|
+
if (!caretLayout) {
|
|
84662
|
+
caretEl.style.opacity = "0";
|
|
84663
|
+
return;
|
|
84664
|
+
}
|
|
84665
|
+
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
|
|
84666
|
+
if (!coords) {
|
|
84667
|
+
caretEl.style.opacity = "0";
|
|
84668
|
+
return;
|
|
84669
|
+
}
|
|
84670
|
+
caretEl.style.opacity = "1";
|
|
84671
|
+
caretEl.style.transform = `translate(${coords.x}px, ${coords.y}px)`;
|
|
84427
84672
|
caretEl.style.height = `${Math.max(1, caretLayout.height * zoom)}px`;
|
|
84428
|
-
caretEl.style.
|
|
84429
|
-
|
|
84430
|
-
|
|
84431
|
-
|
|
84432
|
-
if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
|
|
84433
|
-
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
|
|
84673
|
+
caretEl.style.borderLeftColor = color;
|
|
84674
|
+
const labelEl = caretEl.querySelector(".presentation-editor__remote-label");
|
|
84675
|
+
if (labelEl) {
|
|
84676
|
+
labelEl.style.backgroundColor = color;
|
|
84434
84677
|
}
|
|
84435
|
-
__privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
|
|
84436
84678
|
};
|
|
84437
84679
|
renderRemoteCursorLabel_fn = function(caretEl, cursor) {
|
|
84438
84680
|
const labelFormatter = __privateGet$1(this, _layoutOptions).presence?.labelFormatter;
|
|
@@ -84867,6 +85109,7 @@ rerender_fn = async function() {
|
|
|
84867
85109
|
}
|
|
84868
85110
|
const sectionMetadata = [];
|
|
84869
85111
|
let blocks;
|
|
85112
|
+
let bookmarks = /* @__PURE__ */ new Map();
|
|
84870
85113
|
try {
|
|
84871
85114
|
const converter2 = __privateGet$1(this, _editor3).converter;
|
|
84872
85115
|
const converterContext = converter2 ? {
|
|
@@ -84885,6 +85128,7 @@ rerender_fn = async function() {
|
|
|
84885
85128
|
converterContext
|
|
84886
85129
|
});
|
|
84887
85130
|
blocks = result.blocks;
|
|
85131
|
+
bookmarks = result.bookmarks ?? /* @__PURE__ */ new Map();
|
|
84888
85132
|
} catch (error) {
|
|
84889
85133
|
__privateMethod$1(this, _PresentationEditor_instances, handleLayoutError_fn).call(this, "render", __privateMethod$1(this, _PresentationEditor_instances, decorateError_fn).call(this, error, "toFlowBlocks"));
|
|
84890
85134
|
return;
|
|
@@ -84932,7 +85176,8 @@ rerender_fn = async function() {
|
|
|
84932
85176
|
__privateSet(this, _sectionMetadata, sectionMetadata);
|
|
84933
85177
|
const converter = __privateGet$1(this, _editor3).converter;
|
|
84934
85178
|
__privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
|
|
84935
|
-
|
|
85179
|
+
const anchorMap = __privateMethod$1(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
|
|
85180
|
+
__privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
|
|
84936
85181
|
__privateSet(this, _headerLayoutResults, headerLayouts ?? null);
|
|
84937
85182
|
__privateSet(this, _footerLayoutResults, footerLayouts ?? null);
|
|
84938
85183
|
await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
|
|
@@ -84981,6 +85226,11 @@ rerender_fn = async function() {
|
|
|
84981
85226
|
const payload = { layout, blocks, measures, metrics };
|
|
84982
85227
|
this.emit("layoutUpdated", payload);
|
|
84983
85228
|
this.emit("paginationUpdate", payload);
|
|
85229
|
+
const commentPositions = __privateMethod$1(this, _PresentationEditor_instances, collectCommentPositions_fn).call(this);
|
|
85230
|
+
const positionKeys = Object.keys(commentPositions);
|
|
85231
|
+
if (positionKeys.length > 0) {
|
|
85232
|
+
this.emit("commentPositions", { positions: commentPositions });
|
|
85233
|
+
}
|
|
84984
85234
|
if (__privateGet$1(this, _telemetryEmitter) && metrics) {
|
|
84985
85235
|
__privateGet$1(this, _telemetryEmitter).call(this, { type: "layout", data: { layout, blocks, measures, metrics } });
|
|
84986
85236
|
}
|
|
@@ -85586,9 +85836,9 @@ emitHeaderFooterEditingContext_fn = function(editor) {
|
|
|
85586
85836
|
__privateMethod$1(this, _PresentationEditor_instances, announce_fn).call(this, __privateGet$1(this, _session).mode === "body" ? "Exited header/footer edit mode." : `Editing ${__privateGet$1(this, _session).kind === "header" ? "Header" : "Footer"} (${__privateGet$1(this, _session).sectionType ?? "default"})`);
|
|
85587
85837
|
};
|
|
85588
85838
|
updateAwarenessSession_fn = function() {
|
|
85589
|
-
const provider = __privateGet$1(this,
|
|
85839
|
+
const provider = __privateGet$1(this, _options).collaborationProvider;
|
|
85590
85840
|
const awareness = provider?.awareness;
|
|
85591
|
-
if (!awareness
|
|
85841
|
+
if (!awareness || typeof awareness.setLocalStateField !== "function") {
|
|
85592
85842
|
return;
|
|
85593
85843
|
}
|
|
85594
85844
|
if (__privateGet$1(this, _session).mode === "body") {
|
|
@@ -85697,6 +85947,62 @@ scrollPageIntoView_fn = function(pageIndex) {
|
|
|
85697
85947
|
__privateGet$1(this, _visibleHost).scrollTop = yPosition;
|
|
85698
85948
|
}
|
|
85699
85949
|
};
|
|
85950
|
+
computeAnchorMap_fn = function(bookmarks, layout) {
|
|
85951
|
+
const anchorMap = /* @__PURE__ */ new Map();
|
|
85952
|
+
const blockPmRanges = /* @__PURE__ */ new Map();
|
|
85953
|
+
const computeBlockRange = (blockId) => {
|
|
85954
|
+
if (blockPmRanges.has(blockId)) {
|
|
85955
|
+
const cached = blockPmRanges.get(blockId);
|
|
85956
|
+
return { pmStart: cached.pmStart, pmEnd: cached.pmEnd };
|
|
85957
|
+
}
|
|
85958
|
+
const block = __privateGet$1(this, _layoutState).blocks.find((b2) => b2.id === blockId);
|
|
85959
|
+
if (!block || block.kind !== "paragraph") {
|
|
85960
|
+
blockPmRanges.set(blockId, { pmStart: null, pmEnd: null, hasFragmentPositions: false });
|
|
85961
|
+
return { pmStart: null, pmEnd: null };
|
|
85962
|
+
}
|
|
85963
|
+
let pmStart = null;
|
|
85964
|
+
let pmEnd = null;
|
|
85965
|
+
for (const run2 of block.runs) {
|
|
85966
|
+
if (run2.pmStart != null) {
|
|
85967
|
+
pmStart = pmStart == null ? run2.pmStart : Math.min(pmStart, run2.pmStart);
|
|
85968
|
+
}
|
|
85969
|
+
if (run2.pmEnd != null) {
|
|
85970
|
+
pmEnd = pmEnd == null ? run2.pmEnd : Math.max(pmEnd, run2.pmEnd);
|
|
85971
|
+
}
|
|
85972
|
+
}
|
|
85973
|
+
blockPmRanges.set(blockId, { pmStart, pmEnd, hasFragmentPositions: false });
|
|
85974
|
+
return { pmStart, pmEnd };
|
|
85975
|
+
};
|
|
85976
|
+
bookmarks.forEach((pmPosition, bookmarkName) => {
|
|
85977
|
+
for (const page of layout.pages) {
|
|
85978
|
+
for (const fragment of page.fragments) {
|
|
85979
|
+
if (fragment.kind !== "para") continue;
|
|
85980
|
+
let fragStart = fragment.pmStart;
|
|
85981
|
+
let fragEnd = fragment.pmEnd;
|
|
85982
|
+
if (fragStart == null || fragEnd == null) {
|
|
85983
|
+
const range2 = computeBlockRange(fragment.blockId);
|
|
85984
|
+
if (range2.pmStart != null && range2.pmEnd != null) {
|
|
85985
|
+
fragStart = range2.pmStart;
|
|
85986
|
+
fragEnd = range2.pmEnd;
|
|
85987
|
+
}
|
|
85988
|
+
} else {
|
|
85989
|
+
const cached = blockPmRanges.get(fragment.blockId);
|
|
85990
|
+
blockPmRanges.set(fragment.blockId, {
|
|
85991
|
+
pmStart: cached?.pmStart ?? fragStart,
|
|
85992
|
+
pmEnd: cached?.pmEnd ?? fragEnd,
|
|
85993
|
+
hasFragmentPositions: true
|
|
85994
|
+
});
|
|
85995
|
+
}
|
|
85996
|
+
if (fragStart == null || fragEnd == null) continue;
|
|
85997
|
+
if (pmPosition >= fragStart && pmPosition < fragEnd) {
|
|
85998
|
+
anchorMap.set(bookmarkName, page.number);
|
|
85999
|
+
return;
|
|
86000
|
+
}
|
|
86001
|
+
}
|
|
86002
|
+
}
|
|
86003
|
+
});
|
|
86004
|
+
return anchorMap;
|
|
86005
|
+
};
|
|
85700
86006
|
waitForPageMount_fn = async function(pageIndex, options = {}) {
|
|
85701
86007
|
const timeout2 = options.timeout ?? 2e3;
|
|
85702
86008
|
const startTime = performance.now();
|
|
@@ -86316,6 +86622,7 @@ _PresentationEditor.CURSOR_STYLES = {
|
|
|
86316
86622
|
SELECTION_BORDER_RADIUS: "2px",
|
|
86317
86623
|
MAX_LABEL_LENGTH: 30
|
|
86318
86624
|
};
|
|
86625
|
+
_PresentationEditor.ANCHOR_NAV_TIMEOUT_MS = 2e3;
|
|
86319
86626
|
let PresentationEditor = _PresentationEditor;
|
|
86320
86627
|
class PresentationInputBridge {
|
|
86321
86628
|
/**
|
|
@@ -90447,6 +90754,7 @@ const Paragraph = OxmlNode.create({
|
|
|
90447
90754
|
return ["p", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
|
|
90448
90755
|
},
|
|
90449
90756
|
addNodeView() {
|
|
90757
|
+
if (this.editor.options?.mode !== "docx" || !this.editor.converter) return null;
|
|
90450
90758
|
if (shouldSkipNodeView(this.editor)) return null;
|
|
90451
90759
|
return ({ node, editor, getPos, decorations, extensionAttrs }) => {
|
|
90452
90760
|
return new ParagraphNodeView(node, editor, getPos, decorations, extensionAttrs);
|
|
@@ -90689,7 +90997,7 @@ const CommentReference = Node$1.create({
|
|
|
90689
90997
|
}
|
|
90690
90998
|
});
|
|
90691
90999
|
const CommentsMark = Mark2.create({
|
|
90692
|
-
name: CommentMarkName,
|
|
91000
|
+
name: CommentMarkName$1,
|
|
90693
91001
|
group: "comments",
|
|
90694
91002
|
excludes: "",
|
|
90695
91003
|
addOptions() {
|
|
@@ -90708,10 +91016,10 @@ const CommentsMark = Mark2.create({
|
|
|
90708
91016
|
};
|
|
90709
91017
|
},
|
|
90710
91018
|
parseDOM() {
|
|
90711
|
-
return [{ tag: CommentMarkName }];
|
|
91019
|
+
return [{ tag: CommentMarkName$1 }];
|
|
90712
91020
|
},
|
|
90713
91021
|
renderDOM({ htmlAttributes }) {
|
|
90714
|
-
return [CommentMarkName, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
|
|
91022
|
+
return [CommentMarkName$1, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
|
|
90715
91023
|
}
|
|
90716
91024
|
});
|
|
90717
91025
|
let cache$2 = /* @__PURE__ */ new WeakMap();
|
|
@@ -100895,7 +101203,7 @@ function addLinkRelationship({ editor, href }) {
|
|
|
100895
101203
|
}
|
|
100896
101204
|
const trackInsertClass = "track-insert";
|
|
100897
101205
|
const TrackInsert = Mark2.create({
|
|
100898
|
-
name: TrackInsertMarkName,
|
|
101206
|
+
name: TrackInsertMarkName$1,
|
|
100899
101207
|
group: "track",
|
|
100900
101208
|
inclusive: false,
|
|
100901
101209
|
addOptions() {
|
|
@@ -100972,7 +101280,7 @@ const TrackInsert = Mark2.create({
|
|
|
100972
101280
|
});
|
|
100973
101281
|
const trackDeleteClass = "track-delete";
|
|
100974
101282
|
const TrackDelete = Mark2.create({
|
|
100975
|
-
name: TrackDeleteMarkName,
|
|
101283
|
+
name: TrackDeleteMarkName$1,
|
|
100976
101284
|
group: "track",
|
|
100977
101285
|
inclusive: false,
|
|
100978
101286
|
addOptions() {
|
|
@@ -101081,7 +101389,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
101081
101389
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
101082
101390
|
const trackFormatClass = "track-format";
|
|
101083
101391
|
const TrackFormat = Mark2.create({
|
|
101084
|
-
name: TrackFormatMarkName,
|
|
101392
|
+
name: TrackFormatMarkName$1,
|
|
101085
101393
|
group: "track",
|
|
101086
101394
|
inclusive: false,
|
|
101087
101395
|
addOptions() {
|
|
@@ -101295,7 +101603,7 @@ const TrackChanges = Extension.create({
|
|
|
101295
101603
|
tr.setMeta("inputType", "acceptReject");
|
|
101296
101604
|
const map22 = new Mapping();
|
|
101297
101605
|
doc2.nodesBetween(from2, to, (node, pos) => {
|
|
101298
|
-
if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
|
|
101606
|
+
if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
|
|
101299
101607
|
const deletionStep = new ReplaceStep(
|
|
101300
101608
|
map22.map(Math.max(pos, from2)),
|
|
101301
101609
|
map22.map(Math.min(pos + node.nodeSize, to)),
|
|
@@ -101303,8 +101611,8 @@ const TrackChanges = Extension.create({
|
|
|
101303
101611
|
);
|
|
101304
101612
|
tr.step(deletionStep);
|
|
101305
101613
|
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);
|
|
101614
|
+
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
|
|
101615
|
+
const insertionMark = node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1);
|
|
101308
101616
|
tr.step(
|
|
101309
101617
|
new RemoveMarkStep(
|
|
101310
101618
|
map22.map(Math.max(pos, from2)),
|
|
@@ -101312,8 +101620,8 @@ const TrackChanges = Extension.create({
|
|
|
101312
101620
|
insertionMark
|
|
101313
101621
|
)
|
|
101314
101622
|
);
|
|
101315
|
-
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName)) {
|
|
101316
|
-
const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
|
|
101623
|
+
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
|
|
101624
|
+
const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
|
|
101317
101625
|
tr.step(
|
|
101318
101626
|
new RemoveMarkStep(
|
|
101319
101627
|
map22.map(Math.max(pos, from2)),
|
|
@@ -101335,8 +101643,8 @@ const TrackChanges = Extension.create({
|
|
|
101335
101643
|
tr.setMeta("inputType", "acceptReject");
|
|
101336
101644
|
const map22 = new Mapping();
|
|
101337
101645
|
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);
|
|
101646
|
+
if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
|
|
101647
|
+
const deletionMark = node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1);
|
|
101340
101648
|
tr.step(
|
|
101341
101649
|
new RemoveMarkStep(
|
|
101342
101650
|
map22.map(Math.max(pos, from2)),
|
|
@@ -101344,7 +101652,7 @@ const TrackChanges = Extension.create({
|
|
|
101344
101652
|
deletionMark
|
|
101345
101653
|
)
|
|
101346
101654
|
);
|
|
101347
|
-
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName)) {
|
|
101655
|
+
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
|
|
101348
101656
|
const deletionStep = new ReplaceStep(
|
|
101349
101657
|
map22.map(Math.max(pos, from2)),
|
|
101350
101658
|
map22.map(Math.min(pos + node.nodeSize, to)),
|
|
@@ -101352,8 +101660,8 @@ const TrackChanges = Extension.create({
|
|
|
101352
101660
|
);
|
|
101353
101661
|
tr.step(deletionStep);
|
|
101354
101662
|
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);
|
|
101663
|
+
} else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
|
|
101664
|
+
const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
|
|
101357
101665
|
formatChangeMark.attrs.before.forEach((oldMark) => {
|
|
101358
101666
|
tr.step(
|
|
101359
101667
|
new AddMarkStep(
|
|
@@ -101529,7 +101837,7 @@ const getChangesByIdToResolve = (state2, id) => {
|
|
|
101529
101837
|
const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
|
|
101530
101838
|
return !hasContentBetween;
|
|
101531
101839
|
};
|
|
101532
|
-
const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
|
|
101840
|
+
const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName$1 && secondType === TrackInsertMarkName$1 || firstType === TrackInsertMarkName$1 && secondType === TrackDeleteMarkName$1;
|
|
101533
101841
|
const linkedBefore = [];
|
|
101534
101842
|
const linkedAfter = [];
|
|
101535
101843
|
const collectDirection = (direction, collection) => {
|
|
@@ -121895,7 +122203,8 @@ const _sfc_main$2 = {
|
|
|
121895
122203
|
if (!surface) {
|
|
121896
122204
|
return;
|
|
121897
122205
|
}
|
|
121898
|
-
|
|
122206
|
+
const detail = event?.detail ?? {};
|
|
122207
|
+
moveCursorToMouseEvent(detail, props.editor);
|
|
121899
122208
|
setTimeout(() => {
|
|
121900
122209
|
const currentState = props.editor.state;
|
|
121901
122210
|
const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
|
|
@@ -121910,8 +122219,8 @@ const _sfc_main$2 = {
|
|
|
121910
122219
|
closePopover: props.closePopover
|
|
121911
122220
|
},
|
|
121912
122221
|
{
|
|
121913
|
-
left: `${
|
|
121914
|
-
top: `${
|
|
122222
|
+
left: `${detail.clientX - surfaceRect.left}px`,
|
|
122223
|
+
top: `${detail.clientY - surfaceRect.top + 15}px`
|
|
121915
122224
|
}
|
|
121916
122225
|
);
|
|
121917
122226
|
}
|