@harbour-enterprises/superdoc 1.0.0-beta.101 → 1.0.0-beta.103
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-Cd9VR_tI.es.js → PdfViewer-Dbqwkn0G.es.js} +1 -1
- package/dist/chunks/{PdfViewer-DZWkMtTG.cjs → PdfViewer-S_8SIFPi.cjs} +1 -1
- package/dist/chunks/{index-BzQ_CQ_p.es.js → index-C5Rf8gqE.es.js} +3 -3
- package/dist/chunks/{index-BavMv0sW.cjs → index-D4NTCKO5.cjs} +3 -3
- package/dist/chunks/{index-N8gZUeSO-BneVBXkH.cjs → index-DQVMKA35-DwhGWytr.cjs} +1 -1
- package/dist/chunks/{index-N8gZUeSO-Dxit0pPr.es.js → index-DQVMKA35-xsiaflRZ.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BGncr3MA.cjs → super-editor.es-CCmmUDjt.cjs} +264 -58
- package/dist/chunks/{super-editor.es-0IwuILla.es.js → super-editor.es-D6ttXPUE.es.js} +264 -58
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter---tUwTA4.js → converter-CE9B4HYb.js} +12 -6
- package/dist/super-editor/chunks/{docx-zipper-B8zS8jbu.js → docx-zipper-Bt1IoMBF.js} +1 -1
- package/dist/super-editor/chunks/{editor-3H6s48L7.js → editor-DLjQOZqB.js} +250 -50
- package/dist/super-editor/chunks/{index-N8gZUeSO.js → index-DQVMKA35.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-FxiK-_cI.js → toolbar-CqeJTLhO.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 -10
- 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 +266 -60
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -39781,7 +39781,7 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39781
39781
|
const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
|
|
39782
39782
|
const date = new Date(createdDate);
|
|
39783
39783
|
const unixTimestampMs = date.getTime();
|
|
39784
|
-
const
|
|
39784
|
+
const parsedElements = nodeListHandler.handler({
|
|
39785
39785
|
nodes: el.elements,
|
|
39786
39786
|
nodeListHandler,
|
|
39787
39787
|
docx,
|
|
@@ -39789,7 +39789,7 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39789
39789
|
converter,
|
|
39790
39790
|
path: [el]
|
|
39791
39791
|
});
|
|
39792
|
-
const { attrs } =
|
|
39792
|
+
const { attrs } = parsedElements[0];
|
|
39793
39793
|
const paraId = attrs["w14:paraId"];
|
|
39794
39794
|
return {
|
|
39795
39795
|
commentId: internalId || v4(),
|
|
@@ -39797,7 +39797,8 @@ function importCommentData({ docx, editor, converter }) {
|
|
|
39797
39797
|
creatorName: authorName,
|
|
39798
39798
|
creatorEmail: authorEmail,
|
|
39799
39799
|
createdTime: unixTimestampMs,
|
|
39800
|
-
textJson:
|
|
39800
|
+
textJson: parsedElements[0],
|
|
39801
|
+
elements: parsedElements,
|
|
39801
39802
|
initials,
|
|
39802
39803
|
paraId,
|
|
39803
39804
|
trackedChange,
|
|
@@ -39823,7 +39824,12 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
|
|
|
39823
39824
|
const { elements = [] } = initialElements[0] ?? {};
|
|
39824
39825
|
const commentEx = elements.filter((el) => el.name === "w15:commentEx");
|
|
39825
39826
|
return comments.map((comment) => {
|
|
39826
|
-
const extendedDef = commentEx.find((ce2) =>
|
|
39827
|
+
const extendedDef = commentEx.find((ce2) => {
|
|
39828
|
+
const isIncludedInCommentElements = comment.elements?.some(
|
|
39829
|
+
(el) => el.attrs?.["w14:paraId"] === ce2.attributes["w15:paraId"]
|
|
39830
|
+
);
|
|
39831
|
+
return isIncludedInCommentElements;
|
|
39832
|
+
});
|
|
39827
39833
|
if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
|
|
39828
39834
|
const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
|
|
39829
39835
|
let parentComment;
|
|
@@ -42255,7 +42261,7 @@ const updateCommentsIdsAndExtensible = (comments = [], commentsIds, extensible)
|
|
|
42255
42261
|
name: "w16cex:commentExtensible",
|
|
42256
42262
|
attributes: {
|
|
42257
42263
|
"w16cex:durableId": newDurableId,
|
|
42258
|
-
"w16cex:dateUtc": toIsoNoFractional()
|
|
42264
|
+
"w16cex:dateUtc": toIsoNoFractional(comment.createdTime)
|
|
42259
42265
|
}
|
|
42260
42266
|
};
|
|
42261
42267
|
extensibleUpdated.elements[0].elements.push(newExtensible);
|
|
@@ -42721,7 +42727,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42721
42727
|
static getStoredSuperdocVersion(docx) {
|
|
42722
42728
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42723
42729
|
}
|
|
42724
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
42730
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.103") {
|
|
42725
42731
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42726
42732
|
}
|
|
42727
42733
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-CE9B4HYb.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -12,8 +12,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _pageGeometryHelper, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _cellAnchor, _cellDragMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, getCellPosFromTableHit_fn, getTablePosFromHit_fn, shouldUseCellSelection_fn, setCellAnchor_fn, clearCellAnchor_fn, hitTestTable_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, computeExpectedSectionType_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, computeAnchorMap_fn, waitForPageMount_fn, getEffectivePageGap_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, applyDomCorrectionToRects_fn, renderCellSelectionOverlay_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter
|
|
16
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-CE9B4HYb.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-Bt1IoMBF.js";
|
|
17
17
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
@@ -9098,6 +9098,14 @@ const toggleNode = (typeOrName, toggleTypeOrName, attrs = {}) => ({ state, comma
|
|
|
9098
9098
|
const selectAll = () => ({ state, dispatch }) => selectAll$1(state, dispatch);
|
|
9099
9099
|
const deleteSelection = () => ({ state, tr, dispatch }) => {
|
|
9100
9100
|
const { from: from2, to, empty: empty2 } = state.selection;
|
|
9101
|
+
if (typeof document !== "undefined" && document.getSelection) {
|
|
9102
|
+
const currentDomSelection = document.getSelection();
|
|
9103
|
+
const selectedLength = currentDomSelection?.toString?.().length;
|
|
9104
|
+
const isCollapsed = currentDomSelection?.isCollapsed;
|
|
9105
|
+
if (!isCollapsed && selectedLength === 1) {
|
|
9106
|
+
return false;
|
|
9107
|
+
}
|
|
9108
|
+
}
|
|
9101
9109
|
if (empty2) {
|
|
9102
9110
|
return deleteSelection$1(state, dispatch);
|
|
9103
9111
|
}
|
|
@@ -11406,12 +11414,14 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
|
|
|
11406
11414
|
importedId: node.attrs["w:id"]
|
|
11407
11415
|
});
|
|
11408
11416
|
if (type.name === "commentRangeStart") {
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11417
|
+
if (!matchingImportedComment?.isDone) {
|
|
11418
|
+
toMark.push({
|
|
11419
|
+
commentId: resolvedCommentId,
|
|
11420
|
+
importedId,
|
|
11421
|
+
internal,
|
|
11422
|
+
start: pos
|
|
11423
|
+
});
|
|
11424
|
+
}
|
|
11415
11425
|
ensureFallbackComment({
|
|
11416
11426
|
converter,
|
|
11417
11427
|
matchingImportedComment,
|
|
@@ -13952,7 +13962,7 @@ const isHeadless = (editor) => {
|
|
|
13952
13962
|
const shouldSkipNodeView = (editor) => {
|
|
13953
13963
|
return isHeadless(editor);
|
|
13954
13964
|
};
|
|
13955
|
-
const summaryVersion = "1.0.0-beta.
|
|
13965
|
+
const summaryVersion = "1.0.0-beta.103";
|
|
13956
13966
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13957
13967
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13958
13968
|
function mapAttributes(attrs) {
|
|
@@ -14315,11 +14325,11 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14315
14325
|
if (!this.options.isNewFile || !this.options.collaborationProvider) return;
|
|
14316
14326
|
const provider = this.options.collaborationProvider;
|
|
14317
14327
|
const postSyncInit = () => {
|
|
14318
|
-
provider.off("synced", postSyncInit);
|
|
14328
|
+
provider.off?.("synced", postSyncInit);
|
|
14319
14329
|
__privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
14320
14330
|
};
|
|
14321
14331
|
if (provider.synced) __privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
14322
|
-
else provider.on("synced", postSyncInit);
|
|
14332
|
+
else provider.on?.("synced", postSyncInit);
|
|
14323
14333
|
}
|
|
14324
14334
|
/**
|
|
14325
14335
|
* Replace content of editor that was created with loadFromSchema option
|
|
@@ -14744,7 +14754,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14744
14754
|
{ default: remarkStringify },
|
|
14745
14755
|
{ default: remarkGfm }
|
|
14746
14756
|
] = await Promise.all([
|
|
14747
|
-
import("./index-
|
|
14757
|
+
import("./index-DQVMKA35.js"),
|
|
14748
14758
|
import("./index-DRCvimau.js"),
|
|
14749
14759
|
import("./index-C_x_N6Uh.js"),
|
|
14750
14760
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14949,7 +14959,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14949
14959
|
* Process collaboration migrations
|
|
14950
14960
|
*/
|
|
14951
14961
|
processCollaborationMigrations() {
|
|
14952
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14962
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.103");
|
|
14953
14963
|
if (!this.options.ydoc) return;
|
|
14954
14964
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14955
14965
|
let docVersion = metaMap.get("version");
|
|
@@ -18152,6 +18162,7 @@ function hydrateImageBlocks(blocks, mediaFiles) {
|
|
|
18152
18162
|
if (cellChanged) {
|
|
18153
18163
|
return {
|
|
18154
18164
|
...cell,
|
|
18165
|
+
// Cast to expected type - hydrateBlock preserves block kinds, just hydrates image sources
|
|
18155
18166
|
blocks: hydratedBlocks.length > 0 ? hydratedBlocks : cell.blocks,
|
|
18156
18167
|
paragraph: hydratedParagraph
|
|
18157
18168
|
};
|
|
@@ -21772,7 +21783,7 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
21772
21783
|
};
|
|
21773
21784
|
}
|
|
21774
21785
|
const hasValidNumbering = rawNumberingProps && isValidNumberingId(rawNumberingProps.numId);
|
|
21775
|
-
if (hasValidNumbering) {
|
|
21786
|
+
if (hasValidNumbering && rawNumberingProps) {
|
|
21776
21787
|
const numberingProps = rawNumberingProps;
|
|
21777
21788
|
const numId = numberingProps.numId;
|
|
21778
21789
|
const ilvl = Number.isFinite(numberingProps.ilvl) ? Math.max(0, Math.floor(Number(numberingProps.ilvl))) : 0;
|
|
@@ -21812,6 +21823,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
21812
21823
|
const resolvedCounterValue = path[path.length - 1] ?? counterValue;
|
|
21813
21824
|
const enrichedNumberingProps = {
|
|
21814
21825
|
...numberingProps,
|
|
21826
|
+
numId: numberingProps.numId,
|
|
21827
|
+
ilvl: numberingProps.ilvl,
|
|
21815
21828
|
path,
|
|
21816
21829
|
counterValue: resolvedCounterValue
|
|
21817
21830
|
};
|
|
@@ -23908,7 +23921,7 @@ const parseTableCell = (args) => {
|
|
|
23908
23921
|
context.nextBlockId,
|
|
23909
23922
|
context.positions
|
|
23910
23923
|
);
|
|
23911
|
-
if (drawingBlock) {
|
|
23924
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
23912
23925
|
blocks.push(drawingBlock);
|
|
23913
23926
|
}
|
|
23914
23927
|
continue;
|
|
@@ -23919,7 +23932,7 @@ const parseTableCell = (args) => {
|
|
|
23919
23932
|
context.nextBlockId,
|
|
23920
23933
|
context.positions
|
|
23921
23934
|
);
|
|
23922
|
-
if (drawingBlock) {
|
|
23935
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
23923
23936
|
blocks.push(drawingBlock);
|
|
23924
23937
|
}
|
|
23925
23938
|
continue;
|
|
@@ -23930,7 +23943,7 @@ const parseTableCell = (args) => {
|
|
|
23930
23943
|
context.nextBlockId,
|
|
23931
23944
|
context.positions
|
|
23932
23945
|
);
|
|
23933
|
-
if (drawingBlock) {
|
|
23946
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
23934
23947
|
blocks.push(drawingBlock);
|
|
23935
23948
|
}
|
|
23936
23949
|
continue;
|
|
@@ -23941,7 +23954,7 @@ const parseTableCell = (args) => {
|
|
|
23941
23954
|
context.nextBlockId,
|
|
23942
23955
|
context.positions
|
|
23943
23956
|
);
|
|
23944
|
-
if (drawingBlock) {
|
|
23957
|
+
if (drawingBlock && drawingBlock.kind === "drawing") {
|
|
23945
23958
|
blocks.push(drawingBlock);
|
|
23946
23959
|
}
|
|
23947
23960
|
}
|
|
@@ -24396,7 +24409,19 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
24396
24409
|
bookmarks2,
|
|
24397
24410
|
hyperlinkConfig2,
|
|
24398
24411
|
themeColorsParam ?? themeColors,
|
|
24399
|
-
paragraphConverter
|
|
24412
|
+
paragraphConverter,
|
|
24413
|
+
converterCtx ?? converterContext,
|
|
24414
|
+
{
|
|
24415
|
+
listCounterContext: { getListCounter, incrementListCounter, resetListCounter },
|
|
24416
|
+
converters: {
|
|
24417
|
+
paragraphToFlowBlocks: paragraphConverter,
|
|
24418
|
+
imageNodeToBlock,
|
|
24419
|
+
vectorShapeNodeToDrawingBlock,
|
|
24420
|
+
shapeGroupNodeToDrawingBlock,
|
|
24421
|
+
shapeContainerNodeToDrawingBlock,
|
|
24422
|
+
shapeTextboxNodeToDrawingBlock
|
|
24423
|
+
}
|
|
24424
|
+
}
|
|
24400
24425
|
);
|
|
24401
24426
|
const handlerContext = {
|
|
24402
24427
|
blocks,
|
|
@@ -24417,6 +24442,7 @@ function toFlowBlocks(pmDoc, options) {
|
|
|
24417
24442
|
currentParagraphIndex: 0
|
|
24418
24443
|
},
|
|
24419
24444
|
converters: {
|
|
24445
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
24420
24446
|
paragraphToFlowBlocks: paragraphConverter,
|
|
24421
24447
|
tableNodeToBlock: tableConverter,
|
|
24422
24448
|
imageNodeToBlock,
|
|
@@ -24512,6 +24538,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
24512
24538
|
{
|
|
24513
24539
|
listCounterContext,
|
|
24514
24540
|
converters: {
|
|
24541
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
24515
24542
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
24516
24543
|
imageNodeToBlock,
|
|
24517
24544
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -24525,7 +24552,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
|
|
|
24525
24552
|
converterContext
|
|
24526
24553
|
);
|
|
24527
24554
|
}
|
|
24528
|
-
function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, converterContext) {
|
|
24555
|
+
function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, _paragraphToFlowBlocksParam, converterContext, options) {
|
|
24529
24556
|
return tableNodeToBlock$1(
|
|
24530
24557
|
node,
|
|
24531
24558
|
nextBlockId,
|
|
@@ -24539,8 +24566,9 @@ function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize
|
|
|
24539
24566
|
themeColors,
|
|
24540
24567
|
paragraphToFlowBlocks,
|
|
24541
24568
|
converterContext,
|
|
24542
|
-
{
|
|
24569
|
+
options ?? {
|
|
24543
24570
|
converters: {
|
|
24571
|
+
// Type assertion needed due to signature mismatch between actual function and type definition
|
|
24544
24572
|
paragraphToFlowBlocks: paragraphToFlowBlocks$1,
|
|
24545
24573
|
imageNodeToBlock,
|
|
24546
24574
|
vectorShapeNodeToDrawingBlock,
|
|
@@ -28844,6 +28872,49 @@ const hashParagraphBorders$1 = (borders) => {
|
|
|
28844
28872
|
if (borders.left) parts.push(`l:[${hashParagraphBorder$1(borders.left)}]`);
|
|
28845
28873
|
return parts.join(";");
|
|
28846
28874
|
};
|
|
28875
|
+
const isNoneBorder$1 = (value) => {
|
|
28876
|
+
return typeof value === "object" && value !== null && "none" in value && value.none === true;
|
|
28877
|
+
};
|
|
28878
|
+
const isBorderSpec$1 = (value) => {
|
|
28879
|
+
return typeof value === "object" && value !== null && !("none" in value);
|
|
28880
|
+
};
|
|
28881
|
+
const hashBorderSpec$1 = (border) => {
|
|
28882
|
+
const parts = [];
|
|
28883
|
+
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
28884
|
+
if (border.width !== void 0) parts.push(`w:${border.width}`);
|
|
28885
|
+
if (border.color !== void 0) parts.push(`c:${border.color}`);
|
|
28886
|
+
if (border.space !== void 0) parts.push(`sp:${border.space}`);
|
|
28887
|
+
return parts.join(",");
|
|
28888
|
+
};
|
|
28889
|
+
const hashTableBorderValue$1 = (borderValue) => {
|
|
28890
|
+
if (borderValue === void 0) return "";
|
|
28891
|
+
if (borderValue === null) return "null";
|
|
28892
|
+
if (isNoneBorder$1(borderValue)) return "none";
|
|
28893
|
+
if (isBorderSpec$1(borderValue)) {
|
|
28894
|
+
return hashBorderSpec$1(borderValue);
|
|
28895
|
+
}
|
|
28896
|
+
return "";
|
|
28897
|
+
};
|
|
28898
|
+
const hashTableBorders$1 = (borders) => {
|
|
28899
|
+
if (!borders) return "";
|
|
28900
|
+
const parts = [];
|
|
28901
|
+
if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue$1(borders.top)}]`);
|
|
28902
|
+
if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue$1(borders.right)}]`);
|
|
28903
|
+
if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue$1(borders.bottom)}]`);
|
|
28904
|
+
if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue$1(borders.left)}]`);
|
|
28905
|
+
if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue$1(borders.insideH)}]`);
|
|
28906
|
+
if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue$1(borders.insideV)}]`);
|
|
28907
|
+
return parts.join(";");
|
|
28908
|
+
};
|
|
28909
|
+
const hashCellBorders$1 = (borders) => {
|
|
28910
|
+
if (!borders) return "";
|
|
28911
|
+
const parts = [];
|
|
28912
|
+
if (borders.top) parts.push(`t:[${hashBorderSpec$1(borders.top)}]`);
|
|
28913
|
+
if (borders.right) parts.push(`r:[${hashBorderSpec$1(borders.right)}]`);
|
|
28914
|
+
if (borders.bottom) parts.push(`b:[${hashBorderSpec$1(borders.bottom)}]`);
|
|
28915
|
+
if (borders.left) parts.push(`l:[${hashBorderSpec$1(borders.left)}]`);
|
|
28916
|
+
return parts.join(";");
|
|
28917
|
+
};
|
|
28847
28918
|
const hasStringProp = (run, prop) => {
|
|
28848
28919
|
return prop in run && typeof run[prop] === "string";
|
|
28849
28920
|
};
|
|
@@ -32059,6 +32130,25 @@ const deriveBlockVersion = (block) => {
|
|
|
32059
32130
|
hash2 = hashNumber(hash2, cellBlocks.length);
|
|
32060
32131
|
hash2 = hashNumber(hash2, cell.rowSpan ?? 1);
|
|
32061
32132
|
hash2 = hashNumber(hash2, cell.colSpan ?? 1);
|
|
32133
|
+
if (cell.attrs) {
|
|
32134
|
+
const cellAttrs = cell.attrs;
|
|
32135
|
+
if (cellAttrs.borders) {
|
|
32136
|
+
hash2 = hashString(hash2, hashCellBorders$1(cellAttrs.borders));
|
|
32137
|
+
}
|
|
32138
|
+
if (cellAttrs.padding) {
|
|
32139
|
+
const p = cellAttrs.padding;
|
|
32140
|
+
hash2 = hashNumber(hash2, p.top ?? 0);
|
|
32141
|
+
hash2 = hashNumber(hash2, p.right ?? 0);
|
|
32142
|
+
hash2 = hashNumber(hash2, p.bottom ?? 0);
|
|
32143
|
+
hash2 = hashNumber(hash2, p.left ?? 0);
|
|
32144
|
+
}
|
|
32145
|
+
if (cellAttrs.verticalAlign) {
|
|
32146
|
+
hash2 = hashString(hash2, cellAttrs.verticalAlign);
|
|
32147
|
+
}
|
|
32148
|
+
if (cellAttrs.background) {
|
|
32149
|
+
hash2 = hashString(hash2, cellAttrs.background);
|
|
32150
|
+
}
|
|
32151
|
+
}
|
|
32062
32152
|
for (const cellBlock of cellBlocks) {
|
|
32063
32153
|
hash2 = hashString(hash2, cellBlock?.kind ?? "unknown");
|
|
32064
32154
|
if (cellBlock?.kind === "paragraph") {
|
|
@@ -32104,6 +32194,18 @@ const deriveBlockVersion = (block) => {
|
|
|
32104
32194
|
}
|
|
32105
32195
|
}
|
|
32106
32196
|
}
|
|
32197
|
+
if (tableBlock.attrs) {
|
|
32198
|
+
const tblAttrs = tableBlock.attrs;
|
|
32199
|
+
if (tblAttrs.borders) {
|
|
32200
|
+
hash2 = hashString(hash2, hashTableBorders$1(tblAttrs.borders));
|
|
32201
|
+
}
|
|
32202
|
+
if (tblAttrs.borderCollapse) {
|
|
32203
|
+
hash2 = hashString(hash2, tblAttrs.borderCollapse);
|
|
32204
|
+
}
|
|
32205
|
+
if (tblAttrs.cellSpacing !== void 0) {
|
|
32206
|
+
hash2 = hashNumber(hash2, tblAttrs.cellSpacing);
|
|
32207
|
+
}
|
|
32208
|
+
}
|
|
32107
32209
|
return [block.id, tableBlock.rows.length, hash2.toString(16)].join("|");
|
|
32108
32210
|
}
|
|
32109
32211
|
return block.id;
|
|
@@ -32856,7 +32958,7 @@ function isListItem(markerWidth, block) {
|
|
|
32856
32958
|
return false;
|
|
32857
32959
|
}
|
|
32858
32960
|
const wordLayout = getWordLayoutConfig(block);
|
|
32859
|
-
const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
|
|
32961
|
+
const hasListAttrs = block.attrs?.listItem != null || block.attrs?.numberingProperties != null || wordLayout?.marker != null;
|
|
32860
32962
|
if (hasListAttrs) {
|
|
32861
32963
|
return true;
|
|
32862
32964
|
}
|
|
@@ -35842,6 +35944,49 @@ const hashParagraphBorders = (borders) => {
|
|
|
35842
35944
|
if (borders.left) parts.push(`l:[${hashParagraphBorder(borders.left)}]`);
|
|
35843
35945
|
return parts.join(";");
|
|
35844
35946
|
};
|
|
35947
|
+
function isNoneBorder(value) {
|
|
35948
|
+
return typeof value === "object" && value !== null && "none" in value && value.none === true;
|
|
35949
|
+
}
|
|
35950
|
+
function isBorderSpec(value) {
|
|
35951
|
+
return typeof value === "object" && value !== null && !("none" in value);
|
|
35952
|
+
}
|
|
35953
|
+
const hashBorderSpec = (border) => {
|
|
35954
|
+
const parts = [];
|
|
35955
|
+
if (border.style !== void 0) parts.push(`s:${border.style}`);
|
|
35956
|
+
if (border.width !== void 0) parts.push(`w:${border.width}`);
|
|
35957
|
+
if (border.color !== void 0) parts.push(`c:${border.color}`);
|
|
35958
|
+
if (border.space !== void 0) parts.push(`sp:${border.space}`);
|
|
35959
|
+
return parts.join(",");
|
|
35960
|
+
};
|
|
35961
|
+
const hashTableBorderValue = (borderValue) => {
|
|
35962
|
+
if (borderValue === void 0) return "";
|
|
35963
|
+
if (borderValue === null) return "null";
|
|
35964
|
+
if (isNoneBorder(borderValue)) return "none";
|
|
35965
|
+
if (isBorderSpec(borderValue)) {
|
|
35966
|
+
return hashBorderSpec(borderValue);
|
|
35967
|
+
}
|
|
35968
|
+
return "";
|
|
35969
|
+
};
|
|
35970
|
+
const hashTableBorders = (borders) => {
|
|
35971
|
+
if (!borders) return "";
|
|
35972
|
+
const parts = [];
|
|
35973
|
+
if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue(borders.top)}]`);
|
|
35974
|
+
if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue(borders.right)}]`);
|
|
35975
|
+
if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue(borders.bottom)}]`);
|
|
35976
|
+
if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue(borders.left)}]`);
|
|
35977
|
+
if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue(borders.insideH)}]`);
|
|
35978
|
+
if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue(borders.insideV)}]`);
|
|
35979
|
+
return parts.join(";");
|
|
35980
|
+
};
|
|
35981
|
+
const hashCellBorders = (borders) => {
|
|
35982
|
+
if (!borders) return "";
|
|
35983
|
+
const parts = [];
|
|
35984
|
+
if (borders.top) parts.push(`t:[${hashBorderSpec(borders.top)}]`);
|
|
35985
|
+
if (borders.right) parts.push(`r:[${hashBorderSpec(borders.right)}]`);
|
|
35986
|
+
if (borders.bottom) parts.push(`b:[${hashBorderSpec(borders.bottom)}]`);
|
|
35987
|
+
if (borders.left) parts.push(`l:[${hashBorderSpec(borders.left)}]`);
|
|
35988
|
+
return parts.join(";");
|
|
35989
|
+
};
|
|
35845
35990
|
const MAX_CACHE_SIZE$1 = 1e4;
|
|
35846
35991
|
const BYTES_PER_ENTRY_ESTIMATE = 5e3;
|
|
35847
35992
|
const NORMALIZED_WHITESPACE = /\s+/g;
|
|
@@ -35869,6 +36014,26 @@ const hashRuns = (block) => {
|
|
|
35869
36014
|
continue;
|
|
35870
36015
|
}
|
|
35871
36016
|
for (const cell of row.cells) {
|
|
36017
|
+
if (cell.attrs) {
|
|
36018
|
+
const cellAttrs = cell.attrs;
|
|
36019
|
+
const cellAttrParts = [];
|
|
36020
|
+
if (cellAttrs.borders) {
|
|
36021
|
+
cellAttrParts.push(`cb:${hashCellBorders(cellAttrs.borders)}`);
|
|
36022
|
+
}
|
|
36023
|
+
if (cellAttrs.padding) {
|
|
36024
|
+
const p = cellAttrs.padding;
|
|
36025
|
+
cellAttrParts.push(`cp:${p.top ?? 0}:${p.right ?? 0}:${p.bottom ?? 0}:${p.left ?? 0}`);
|
|
36026
|
+
}
|
|
36027
|
+
if (cellAttrs.verticalAlign) {
|
|
36028
|
+
cellAttrParts.push(`va:${cellAttrs.verticalAlign}`);
|
|
36029
|
+
}
|
|
36030
|
+
if (cellAttrs.background) {
|
|
36031
|
+
cellAttrParts.push(`bg:${cellAttrs.background}`);
|
|
36032
|
+
}
|
|
36033
|
+
if (cellAttrParts.length > 0) {
|
|
36034
|
+
cellHashes.push(`ca:${cellAttrParts.join(":")}`);
|
|
36035
|
+
}
|
|
36036
|
+
}
|
|
35872
36037
|
const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
|
|
35873
36038
|
for (const cellBlock of cellBlocks) {
|
|
35874
36039
|
const paragraphBlock = cellBlock;
|
|
@@ -35935,8 +36100,25 @@ const hashRuns = (block) => {
|
|
|
35935
36100
|
}
|
|
35936
36101
|
}
|
|
35937
36102
|
}
|
|
36103
|
+
let tableAttrsKey = "";
|
|
36104
|
+
if (tableBlock.attrs) {
|
|
36105
|
+
const tblAttrs = tableBlock.attrs;
|
|
36106
|
+
const tableAttrParts = [];
|
|
36107
|
+
if (tblAttrs.borders) {
|
|
36108
|
+
tableAttrParts.push(`tb:${hashTableBorders(tblAttrs.borders)}`);
|
|
36109
|
+
}
|
|
36110
|
+
if (tblAttrs.borderCollapse) {
|
|
36111
|
+
tableAttrParts.push(`bc:${tblAttrs.borderCollapse}`);
|
|
36112
|
+
}
|
|
36113
|
+
if (tblAttrs.cellSpacing !== void 0) {
|
|
36114
|
+
tableAttrParts.push(`cs:${tblAttrs.cellSpacing}`);
|
|
36115
|
+
}
|
|
36116
|
+
if (tableAttrParts.length > 0) {
|
|
36117
|
+
tableAttrsKey = `|ta:${tableAttrParts.join(":")}`;
|
|
36118
|
+
}
|
|
36119
|
+
}
|
|
35938
36120
|
const contentHash = cellHashes.join("|");
|
|
35939
|
-
return `${block.id}:table:${contentHash}`;
|
|
36121
|
+
return `${block.id}:table:${contentHash}${tableAttrsKey}`;
|
|
35940
36122
|
}
|
|
35941
36123
|
if (block.kind !== "paragraph") return block.id;
|
|
35942
36124
|
const trackedMode = block.attrs && "trackedChangesMode" in block.attrs && block.attrs.trackedChangesMode || "review";
|
|
@@ -40168,7 +40350,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
40168
40350
|
const wordEndWithSpace = charPosInRun + (isLastWord ? word.length : word.length + 1);
|
|
40169
40351
|
const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
40170
40352
|
if (wordOnlyWidth > effectiveMaxWidth && word.length > 1) {
|
|
40171
|
-
if (currentLine && currentLine.width > 0 && currentLine.segments.length > 0) {
|
|
40353
|
+
if (currentLine && currentLine.width > 0 && currentLine.segments && currentLine.segments.length > 0) {
|
|
40172
40354
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
40173
40355
|
const { spaceCount: _sc, ...lineBase } = currentLine;
|
|
40174
40356
|
const completedLine = { ...lineBase, ...metrics };
|
|
@@ -40179,7 +40361,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
40179
40361
|
currentLine = null;
|
|
40180
40362
|
}
|
|
40181
40363
|
const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
40182
|
-
const hasTabOnlyLine = currentLine && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
40364
|
+
const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
40183
40365
|
const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
|
|
40184
40366
|
const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
|
|
40185
40367
|
const chunks = breakWordIntoChunks(word, chunkWidth - WIDTH_FUDGE_PX2, font, ctx2, run);
|
|
@@ -40190,7 +40372,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
40190
40372
|
const chunkEndChar = chunkCharOffset + chunk.text.length;
|
|
40191
40373
|
const isLastChunk = chunkIndex === chunks.length - 1;
|
|
40192
40374
|
const isFirstChunk = chunkIndex === 0;
|
|
40193
|
-
if (isFirstChunk && hasTabOnlyLine && currentLine) {
|
|
40375
|
+
if (isFirstChunk && hasTabOnlyLine && currentLine && currentLine.segments) {
|
|
40194
40376
|
currentLine.toRun = runIndex;
|
|
40195
40377
|
currentLine.toChar = chunkEndChar;
|
|
40196
40378
|
currentLine.width = roundValue(currentLine.width + chunk.width);
|
|
@@ -44655,18 +44837,19 @@ normalizeAwarenessStates_fn = function() {
|
|
|
44655
44837
|
const normalized = /* @__PURE__ */ new Map();
|
|
44656
44838
|
states?.forEach((aw, clientId) => {
|
|
44657
44839
|
if (clientId === provider.awareness?.clientID) return;
|
|
44658
|
-
|
|
44840
|
+
const awState = aw;
|
|
44841
|
+
if (!awState.cursor) return;
|
|
44659
44842
|
try {
|
|
44660
44843
|
const anchor = relativePositionToAbsolutePosition(
|
|
44661
44844
|
ystate.doc,
|
|
44662
44845
|
ystate.type,
|
|
44663
|
-
Y.createRelativePositionFromJSON(
|
|
44846
|
+
Y.createRelativePositionFromJSON(awState.cursor.anchor),
|
|
44664
44847
|
ystate.binding.mapping
|
|
44665
44848
|
);
|
|
44666
44849
|
const head = relativePositionToAbsolutePosition(
|
|
44667
44850
|
ystate.doc,
|
|
44668
44851
|
ystate.type,
|
|
44669
|
-
Y.createRelativePositionFromJSON(
|
|
44852
|
+
Y.createRelativePositionFromJSON(awState.cursor.head),
|
|
44670
44853
|
ystate.binding.mapping
|
|
44671
44854
|
);
|
|
44672
44855
|
if (anchor === null || head === null) return;
|
|
@@ -44678,9 +44861,9 @@ normalizeAwarenessStates_fn = function() {
|
|
|
44678
44861
|
normalized.set(clientId, {
|
|
44679
44862
|
clientId,
|
|
44680
44863
|
user: {
|
|
44681
|
-
name:
|
|
44682
|
-
email:
|
|
44683
|
-
color:
|
|
44864
|
+
name: awState.user?.name,
|
|
44865
|
+
email: awState.user?.email,
|
|
44866
|
+
color: awState.user?.color || __privateMethod(this, _PresentationEditor_instances, getFallbackColor_fn).call(this, clientId)
|
|
44684
44867
|
},
|
|
44685
44868
|
anchor: clampedAnchor,
|
|
44686
44869
|
head: clampedHead,
|
|
@@ -47776,8 +47959,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
47776
47959
|
const zoom2 = __privateGet(this, _layoutOptions).zoom ?? 1;
|
|
47777
47960
|
let domCaretX2 = null;
|
|
47778
47961
|
let domCaretY2 = null;
|
|
47779
|
-
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
47780
|
-
for (const spanEl of spanEls2) {
|
|
47962
|
+
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
47963
|
+
for (const spanEl of Array.from(spanEls2 ?? [])) {
|
|
47781
47964
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
47782
47965
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
47783
47966
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
@@ -47829,8 +48012,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
47829
48012
|
const zoom = __privateGet(this, _layoutOptions).zoom ?? 1;
|
|
47830
48013
|
let domCaretX = null;
|
|
47831
48014
|
let domCaretY = null;
|
|
47832
|
-
const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]")
|
|
47833
|
-
for (const spanEl of spanEls) {
|
|
48015
|
+
const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
|
|
48016
|
+
for (const spanEl of Array.from(spanEls ?? [])) {
|
|
47834
48017
|
const pmStart = Number(spanEl.dataset.pmStart);
|
|
47835
48018
|
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
47836
48019
|
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
@@ -53643,14 +53826,19 @@ const createCell = (cellType, cellContent = null) => {
|
|
|
53643
53826
|
}
|
|
53644
53827
|
return cellType.createAndFill();
|
|
53645
53828
|
};
|
|
53646
|
-
const createTableBorders = (
|
|
53829
|
+
const createTableBorders = (borderSpec = {}) => {
|
|
53830
|
+
borderSpec = {
|
|
53831
|
+
size: 0.66665,
|
|
53832
|
+
color: "#000000",
|
|
53833
|
+
...borderSpec
|
|
53834
|
+
};
|
|
53647
53835
|
return {
|
|
53648
|
-
top:
|
|
53649
|
-
left:
|
|
53650
|
-
bottom:
|
|
53651
|
-
right:
|
|
53652
|
-
insideH:
|
|
53653
|
-
insideV:
|
|
53836
|
+
top: borderSpec,
|
|
53837
|
+
left: borderSpec,
|
|
53838
|
+
bottom: borderSpec,
|
|
53839
|
+
right: borderSpec,
|
|
53840
|
+
insideH: borderSpec,
|
|
53841
|
+
insideV: borderSpec
|
|
53654
53842
|
};
|
|
53655
53843
|
};
|
|
53656
53844
|
const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
|
|
@@ -53778,12 +53966,17 @@ const deleteTableWhenSelected = ({ editor }) => {
|
|
|
53778
53966
|
editor.commands.deleteTable();
|
|
53779
53967
|
return true;
|
|
53780
53968
|
};
|
|
53781
|
-
const createCellBorders = (
|
|
53969
|
+
const createCellBorders = (borderSpec = {}) => {
|
|
53970
|
+
borderSpec = {
|
|
53971
|
+
size: 0.66665,
|
|
53972
|
+
color: "#000000",
|
|
53973
|
+
...borderSpec
|
|
53974
|
+
};
|
|
53782
53975
|
return {
|
|
53783
|
-
top:
|
|
53784
|
-
left:
|
|
53785
|
-
bottom:
|
|
53786
|
-
right:
|
|
53976
|
+
top: borderSpec,
|
|
53977
|
+
left: borderSpec,
|
|
53978
|
+
bottom: borderSpec,
|
|
53979
|
+
right: borderSpec
|
|
53787
53980
|
};
|
|
53788
53981
|
};
|
|
53789
53982
|
function cellAround($pos) {
|
|
@@ -54550,13 +54743,20 @@ const Table = Node$1.create({
|
|
|
54550
54743
|
if (["tableCell", "tableHeader"].includes(node.type.name)) {
|
|
54551
54744
|
tr.setNodeMarkup(pos, void 0, {
|
|
54552
54745
|
...node.attrs,
|
|
54553
|
-
borders: createCellBorders({ size: 0 })
|
|
54746
|
+
borders: createCellBorders({ size: 0, space: 0, val: "none", color: "auto" })
|
|
54554
54747
|
});
|
|
54555
54748
|
}
|
|
54556
54749
|
});
|
|
54557
54750
|
tr.setNodeMarkup(table.pos, void 0, {
|
|
54558
54751
|
...table.node.attrs,
|
|
54559
|
-
borders: createTableBorders({ size: 0 })
|
|
54752
|
+
borders: createTableBorders({ size: 0 }),
|
|
54753
|
+
// TODO: This works around the issue that table borders are duplicated between
|
|
54754
|
+
// the attributes of the table and the tableProperties attribute.
|
|
54755
|
+
// This can be removed when the redundancy is eliminated.
|
|
54756
|
+
tableProperties: {
|
|
54757
|
+
...table.node.attrs.tableProperties,
|
|
54758
|
+
borders: createTableBorders({ size: 0, space: 0, val: "none", color: "auto" })
|
|
54759
|
+
}
|
|
54560
54760
|
});
|
|
54561
54761
|
return true;
|
|
54562
54762
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { p as process$1 } from "./converter
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-CE9B4HYb.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DLjQOZqB.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|