@harbour-enterprises/superdoc 1.0.0-beta.7 → 1.0.0-beta.9
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-hAYAlKzI.es.js → PdfViewer-CuFLNmIu.es.js} +1 -1
- package/dist/chunks/{PdfViewer-T4fTm1XF.cjs → PdfViewer-IfeBMKsU.cjs} +1 -1
- package/dist/chunks/{index-DV613LhK-BY095UD2.es.js → index-BVhSHfFK-4HejWjUD.es.js} +1 -1
- package/dist/chunks/{index-DV613LhK-CqFLIBmd.cjs → index-BVhSHfFK-CTmHktSn.cjs} +1 -1
- package/dist/chunks/{index-CYQjWGo5.cjs → index-CICIPNZT.cjs} +3 -3
- package/dist/chunks/{index-DGYP5Xod.es.js → index-WwpxSzB1.es.js} +3 -3
- package/dist/chunks/{super-editor.es-CcaD69pQ.es.js → super-editor.es-BJP3oxNX.es.js} +250 -47
- package/dist/chunks/{super-editor.es-DmhQckCV.cjs → super-editor.es-CCq8j_qB.cjs} +250 -47
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BM6gXTRC.js → converter-VnZK3P1W.js} +27 -2
- package/dist/super-editor/chunks/{docx-zipper-fwXPJGKu.js → docx-zipper-Bw5zXmBh.js} +1 -1
- package/dist/super-editor/chunks/{editor-RPTrfArg.js → editor-CKkHVssy.js} +259 -60
- package/dist/super-editor/chunks/{index-DV613LhK.js → index-BVhSHfFK.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DacKXz_n.js → toolbar-DPzMju-T.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 +6 -6
- 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 +252 -49
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,11 +9,11 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
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, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_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, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_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, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _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, updateHTMLAttributes_fn, updateDOMStyles_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;
|
|
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, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_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, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_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, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _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;
|
|
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 ListHelpers, O as updateNumberingProperties, Q as changeListLevel, U as findParentNode, V as isList, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName, $ as TrackInsertMarkName, a0 as v4, a1 as TrackFormatMarkName, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as calculateResolvedParagraphProperties, ar as encodeCSSFromPPr, as as twipsToPixels$2, at as resolveRunProperties, au as encodeCSSFromRPr, av as generateOrderedListIndex, aw as docxNumberingHelpers, ax as InputRule, ay as convertSizeToCSS, az as SelectionRange, aA as Transform, aB as findParentNodeClosestToPos, aC as isInTable$1, aD as generateDocxRandomId, aE as insertNewRelationship, aF as inchesToPixels, aG as kebabCase, aH 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 ListHelpers, O as updateNumberingProperties, Q as changeListLevel, U as findParentNode, V as isList, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName, $ as TrackInsertMarkName, a0 as v4, a1 as TrackFormatMarkName, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as calculateResolvedParagraphProperties, ar as encodeCSSFromPPr, as as twipsToPixels$2, at as resolveRunProperties, au as encodeCSSFromRPr, av as generateOrderedListIndex, aw as docxNumberingHelpers, ax as InputRule, ay as convertSizeToCSS, az as SelectionRange, aA as Transform, aB as findParentNodeClosestToPos, aC as isInTable$1, aD as generateDocxRandomId, aE as insertNewRelationship, aF as inchesToPixels, aG as kebabCase, aH as getUnderlineCssString } from "./converter-VnZK3P1W.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-Bw5zXmBh.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() {
|
|
@@ -13553,7 +13553,7 @@ const isHeadless = (editor) => {
|
|
|
13553
13553
|
const shouldSkipNodeView = (editor) => {
|
|
13554
13554
|
return isHeadless(editor);
|
|
13555
13555
|
};
|
|
13556
|
-
const summaryVersion = "1.0.0-beta.
|
|
13556
|
+
const summaryVersion = "1.0.0-beta.9";
|
|
13557
13557
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13558
13558
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13559
13559
|
function mapAttributes(attrs) {
|
|
@@ -14335,7 +14335,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14335
14335
|
{ default: remarkStringify },
|
|
14336
14336
|
{ default: remarkGfm }
|
|
14337
14337
|
] = await Promise.all([
|
|
14338
|
-
import("./index-
|
|
14338
|
+
import("./index-BVhSHfFK.js"),
|
|
14339
14339
|
import("./index-DRCvimau.js"),
|
|
14340
14340
|
import("./index-C_x_N6Uh.js"),
|
|
14341
14341
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14540,7 +14540,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14540
14540
|
* Process collaboration migrations
|
|
14541
14541
|
*/
|
|
14542
14542
|
processCollaborationMigrations() {
|
|
14543
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14543
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.9");
|
|
14544
14544
|
if (!this.options.ydoc) return;
|
|
14545
14545
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14546
14546
|
let docVersion = metaMap.get("version");
|
|
@@ -18180,8 +18180,6 @@ function calculateTabWidth(params2) {
|
|
|
18180
18180
|
const beforeWidth = measureText2 ? measureText2(before) : 0;
|
|
18181
18181
|
width -= beforeWidth;
|
|
18182
18182
|
}
|
|
18183
|
-
} else if (alignment === "bar") {
|
|
18184
|
-
width = 0;
|
|
18185
18183
|
}
|
|
18186
18184
|
if (width < 1) {
|
|
18187
18185
|
return fallbackWidth();
|
|
@@ -23178,11 +23176,11 @@ class HeaderFooterLayoutCache {
|
|
|
23178
23176
|
}
|
|
23179
23177
|
}
|
|
23180
23178
|
const sharedHeaderFooterCache = new HeaderFooterLayoutCache();
|
|
23181
|
-
async function layoutHeaderFooterWithCache(sections, constraints, measureBlock2,
|
|
23179
|
+
async function layoutHeaderFooterWithCache(sections, constraints, measureBlock2, cache2 = sharedHeaderFooterCache) {
|
|
23182
23180
|
const result = {};
|
|
23183
23181
|
for (const [type, blocks] of Object.entries(sections)) {
|
|
23184
23182
|
if (!blocks || blocks.length === 0) continue;
|
|
23185
|
-
const measures = await
|
|
23183
|
+
const measures = await cache2.measureBlocks(blocks, constraints, measureBlock2);
|
|
23186
23184
|
const layout = layoutHeaderFooter(blocks, measures, constraints);
|
|
23187
23185
|
result[type] = { blocks, measures, layout };
|
|
23188
23186
|
}
|
|
@@ -23224,14 +23222,14 @@ function measureRunSliceWidth(run, fromChar, toChar) {
|
|
|
23224
23222
|
return metrics.width;
|
|
23225
23223
|
}
|
|
23226
23224
|
function lineHeightForRuns(runs, fromRun, toRun) {
|
|
23227
|
-
let
|
|
23225
|
+
let maxSize2 = 0;
|
|
23228
23226
|
for (let i = fromRun; i <= toRun; i += 1) {
|
|
23229
23227
|
const run = runs[i];
|
|
23230
23228
|
const textRun = run && isTextRun(run) ? run : null;
|
|
23231
23229
|
const size = textRun?.fontSize ?? 16;
|
|
23232
|
-
if (size >
|
|
23230
|
+
if (size > maxSize2) maxSize2 = size;
|
|
23233
23231
|
}
|
|
23234
|
-
return
|
|
23232
|
+
return maxSize2 * 1.2;
|
|
23235
23233
|
}
|
|
23236
23234
|
function remeasureParagraph(block, maxWidth) {
|
|
23237
23235
|
const runs = block.runs ?? [];
|
|
@@ -28834,6 +28832,45 @@ function normalizeRotation(rotation) {
|
|
|
28834
28832
|
function degToRad(degrees) {
|
|
28835
28833
|
return degrees * Math.PI / 180;
|
|
28836
28834
|
}
|
|
28835
|
+
const defaultMaxSize = 5e3;
|
|
28836
|
+
let maxSize = defaultMaxSize;
|
|
28837
|
+
const cache$1 = /* @__PURE__ */ new Map();
|
|
28838
|
+
const makeKey = (text, font, letterSpacing) => {
|
|
28839
|
+
return `${text}|${font}|${letterSpacing || 0}`;
|
|
28840
|
+
};
|
|
28841
|
+
function getMeasuredTextWidth(text, font, letterSpacing, ctx2) {
|
|
28842
|
+
if (text.length > 32e3) {
|
|
28843
|
+
text = text.substring(0, 32e3);
|
|
28844
|
+
}
|
|
28845
|
+
const key2 = makeKey(text, font, letterSpacing);
|
|
28846
|
+
const hit = cache$1.get(key2);
|
|
28847
|
+
if (hit !== void 0) {
|
|
28848
|
+
cache$1.delete(key2);
|
|
28849
|
+
cache$1.set(key2, hit);
|
|
28850
|
+
return hit.width;
|
|
28851
|
+
}
|
|
28852
|
+
try {
|
|
28853
|
+
ctx2.font = font;
|
|
28854
|
+
const metrics = ctx2.measureText(text);
|
|
28855
|
+
const advanceWidth = metrics.width;
|
|
28856
|
+
const paintedWidth = (metrics.actualBoundingBoxLeft || 0) + (metrics.actualBoundingBoxRight || 0);
|
|
28857
|
+
const baseWidth = Math.max(advanceWidth, paintedWidth);
|
|
28858
|
+
const extra = letterSpacing ? Math.max(0, text.length - 1) * letterSpacing : 0;
|
|
28859
|
+
const width = baseWidth + extra;
|
|
28860
|
+
cache$1.set(key2, { width });
|
|
28861
|
+
evictIfNeeded();
|
|
28862
|
+
return width;
|
|
28863
|
+
} catch {
|
|
28864
|
+
return 0;
|
|
28865
|
+
}
|
|
28866
|
+
}
|
|
28867
|
+
function evictIfNeeded() {
|
|
28868
|
+
while (cache$1.size > maxSize) {
|
|
28869
|
+
const oldestKey = cache$1.keys().next().value;
|
|
28870
|
+
if (oldestKey === void 0) break;
|
|
28871
|
+
cache$1.delete(oldestKey);
|
|
28872
|
+
}
|
|
28873
|
+
}
|
|
28837
28874
|
const { computeTabStops } = Engines;
|
|
28838
28875
|
let canvasContext = null;
|
|
28839
28876
|
const DEFAULT_TAB_INTERVAL_TWIPS = 720;
|
|
@@ -28878,8 +28915,7 @@ function measureText(text, font, ctx2, _fontFamily, _letterSpacing) {
|
|
|
28878
28915
|
const metrics = ctx2.measureText(text);
|
|
28879
28916
|
const advanceWidth = metrics.width;
|
|
28880
28917
|
const paintedWidth = (metrics.actualBoundingBoxLeft || 0) + (metrics.actualBoundingBoxRight || 0);
|
|
28881
|
-
|
|
28882
|
-
return baseWidth;
|
|
28918
|
+
return Math.max(advanceWidth, paintedWidth);
|
|
28883
28919
|
}
|
|
28884
28920
|
const MIN_SINGLE_LINE_PX = 12 * 96 / 72;
|
|
28885
28921
|
function calculateTypographyMetrics(fontSize, spacing) {
|
|
@@ -29460,13 +29496,9 @@ const getPrimaryRun = (paragraph) => {
|
|
|
29460
29496
|
};
|
|
29461
29497
|
};
|
|
29462
29498
|
const measureRunWidth = (text, font, ctx2, run) => {
|
|
29463
|
-
const
|
|
29464
|
-
const
|
|
29465
|
-
|
|
29466
|
-
return baseWidth;
|
|
29467
|
-
}
|
|
29468
|
-
const extra = Math.max(0, text.length - 1) * letterSpacing;
|
|
29469
|
-
return roundValue(baseWidth + extra);
|
|
29499
|
+
const letterSpacing = run.kind !== "tab" ? run.letterSpacing || 0 : 0;
|
|
29500
|
+
const width = getMeasuredTextWidth(text, font, letterSpacing, ctx2);
|
|
29501
|
+
return roundValue(width);
|
|
29470
29502
|
};
|
|
29471
29503
|
const appendSegment = (segments, runIndex, fromChar, toChar, width, x) => {
|
|
29472
29504
|
if (!segments) return;
|
|
@@ -36530,20 +36562,20 @@ function calculateTabStyle(nodeSize2, view, pos, blockParent2, paragraphContext,
|
|
|
36530
36562
|
const tabHeight = paragraphContext.tabHeight;
|
|
36531
36563
|
paragraphContext.accumulatedTabWidth = accumulatedTabWidth + tabWidth;
|
|
36532
36564
|
return `width: ${tabWidth}px; height: ${tabHeight}; ${extraStyles}`;
|
|
36533
|
-
} catch
|
|
36565
|
+
} catch {
|
|
36534
36566
|
return null;
|
|
36535
36567
|
}
|
|
36536
36568
|
}
|
|
36537
|
-
function findParagraphContext($pos,
|
|
36569
|
+
function findParagraphContext($pos, cache2, helpers2) {
|
|
36538
36570
|
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
36539
36571
|
const node = $pos.node(depth);
|
|
36540
36572
|
if (node?.type?.name === "paragraph") {
|
|
36541
36573
|
const startPos = $pos.start(depth);
|
|
36542
|
-
if (!
|
|
36574
|
+
if (!cache2.has(startPos)) {
|
|
36543
36575
|
const paragraphContext = extractParagraphContext(node, startPos, helpers2, depth);
|
|
36544
|
-
|
|
36576
|
+
cache2.set(startPos, paragraphContext);
|
|
36545
36577
|
}
|
|
36546
|
-
return
|
|
36578
|
+
return cache2.get(startPos);
|
|
36547
36579
|
}
|
|
36548
36580
|
}
|
|
36549
36581
|
return null;
|
|
@@ -36722,6 +36754,7 @@ function calcTabHeight(blockParent2) {
|
|
|
36722
36754
|
const fontSize = parseInt(parentTextStyleMark?.attrs.fontSize) * ptToPxRatio || defaultFontSize;
|
|
36723
36755
|
return `${fontSize * defaultLineHeight}px`;
|
|
36724
36756
|
}
|
|
36757
|
+
const nodeViewMap = /* @__PURE__ */ new WeakMap();
|
|
36725
36758
|
class ParagraphNodeView {
|
|
36726
36759
|
/**
|
|
36727
36760
|
* @param {import('prosemirror-model').Node} node Current paragraph node.
|
|
@@ -36738,6 +36771,8 @@ class ParagraphNodeView {
|
|
|
36738
36771
|
this.decorations = decorations;
|
|
36739
36772
|
this.extensionAttrs = extensionAttrs;
|
|
36740
36773
|
this._animationFrameRequest = null;
|
|
36774
|
+
this.surroundingContext = {};
|
|
36775
|
+
nodeViewMap.set(this.node, this);
|
|
36741
36776
|
calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
|
|
36742
36777
|
this.dom = document.createElement("p");
|
|
36743
36778
|
this.contentDOM = document.createElement("span");
|
|
@@ -36757,18 +36792,26 @@ class ParagraphNodeView {
|
|
|
36757
36792
|
/**
|
|
36758
36793
|
* @param {import('prosemirror-model').Node} node
|
|
36759
36794
|
* @param {import('prosemirror-view').Decoration[]} decorations
|
|
36795
|
+
* @param {import('prosemirror-view').Decoration[]} innerDecorations
|
|
36796
|
+
* @param {boolean} [forceUpdate=false]
|
|
36797
|
+
* @returns {boolean}
|
|
36760
36798
|
*/
|
|
36761
|
-
update(node, decorations) {
|
|
36799
|
+
update(node, decorations, innerDecorations, forceUpdate = false) {
|
|
36800
|
+
if (nodeViewMap.get(this.node) === this) {
|
|
36801
|
+
nodeViewMap.delete(this.node);
|
|
36802
|
+
}
|
|
36803
|
+
const oldProps = getResolvedParagraphProperties(this.node);
|
|
36762
36804
|
const oldAttrs = this.node.attrs;
|
|
36763
|
-
const newAttrs = node.attrs;
|
|
36764
36805
|
this.node = node;
|
|
36765
36806
|
this.decorations = decorations;
|
|
36766
|
-
|
|
36807
|
+
this.innerDecorations = innerDecorations;
|
|
36808
|
+
nodeViewMap.set(this.node, this);
|
|
36809
|
+
if (!forceUpdate && !__privateMethod(this, _ParagraphNodeView_instances, checkShouldUpdate_fn).call(this, oldProps, oldAttrs, this.surroundingContext)) {
|
|
36767
36810
|
return true;
|
|
36768
36811
|
}
|
|
36769
36812
|
calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
|
|
36770
36813
|
__privateMethod(this, _ParagraphNodeView_instances, updateHTMLAttributes_fn).call(this);
|
|
36771
|
-
__privateMethod(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this);
|
|
36814
|
+
__privateMethod(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this, oldProps);
|
|
36772
36815
|
if (!__privateMethod(this, _ParagraphNodeView_instances, checkIsList_fn).call(this)) {
|
|
36773
36816
|
__privateMethod(this, _ParagraphNodeView_instances, removeList_fn).call(this);
|
|
36774
36817
|
return true;
|
|
@@ -36811,9 +36854,26 @@ class ParagraphNodeView {
|
|
|
36811
36854
|
}
|
|
36812
36855
|
destroy() {
|
|
36813
36856
|
__privateMethod(this, _ParagraphNodeView_instances, cancelScheduledAnimation_fn).call(this);
|
|
36857
|
+
if (nodeViewMap.get(this.node) === this) {
|
|
36858
|
+
nodeViewMap.delete(this.node);
|
|
36859
|
+
}
|
|
36814
36860
|
}
|
|
36815
36861
|
}
|
|
36816
36862
|
_ParagraphNodeView_instances = new WeakSet();
|
|
36863
|
+
/**
|
|
36864
|
+
* Checks whether the node view should update based on changes to props, attrs, or surrounding context.
|
|
36865
|
+
* @param {Record<string, unknown>} oldProps
|
|
36866
|
+
* @param {Record<string, unknown>} oldAttrs
|
|
36867
|
+
* @param {Record<string, unknown>} oldSurroundingContext
|
|
36868
|
+
* @returns {boolean}
|
|
36869
|
+
*/
|
|
36870
|
+
checkShouldUpdate_fn = function(oldProps, oldAttrs, oldSurroundingContext) {
|
|
36871
|
+
__privateMethod(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
|
|
36872
|
+
return JSON.stringify(oldAttrs) !== JSON.stringify(this.node.attrs) || JSON.stringify(oldProps) !== JSON.stringify(getResolvedParagraphProperties(this.node)) || JSON.stringify(oldSurroundingContext) !== JSON.stringify(this.surroundingContext);
|
|
36873
|
+
};
|
|
36874
|
+
/**
|
|
36875
|
+
* Updates the HTML attributes of the paragraph DOM element based on node attributes and properties.
|
|
36876
|
+
*/
|
|
36817
36877
|
updateHTMLAttributes_fn = function() {
|
|
36818
36878
|
const htmlAttributes = Attribute.getAttributesToRender(this.node, this.extensionAttrs);
|
|
36819
36879
|
htmlAttributes.style = htmlAttributes.style || "";
|
|
@@ -36841,14 +36901,74 @@ updateHTMLAttributes_fn = function() {
|
|
|
36841
36901
|
this.dom.setAttribute("styleid", paragraphProperties.styleId);
|
|
36842
36902
|
}
|
|
36843
36903
|
};
|
|
36844
|
-
|
|
36904
|
+
/**
|
|
36905
|
+
* Updates the CSS styles of the paragraph DOM element based on resolved paragraph properties.
|
|
36906
|
+
* @param {Record<string, unknown> | null} oldParagraphProperties
|
|
36907
|
+
*/
|
|
36908
|
+
updateDOMStyles_fn = function(oldParagraphProperties = null) {
|
|
36845
36909
|
this.dom.style.cssText = "";
|
|
36846
36910
|
const paragraphProperties = getResolvedParagraphProperties(this.node);
|
|
36847
|
-
|
|
36911
|
+
__privateMethod(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
|
|
36912
|
+
const style = encodeCSSFromPPr(
|
|
36913
|
+
paragraphProperties,
|
|
36914
|
+
this.surroundingContext.hasPreviousParagraph,
|
|
36915
|
+
this.surroundingContext.nextParagraphProps
|
|
36916
|
+
);
|
|
36848
36917
|
Object.entries(style).forEach(([k2, v]) => {
|
|
36849
36918
|
this.dom.style[k2] = v;
|
|
36850
36919
|
});
|
|
36920
|
+
if (JSON.stringify(paragraphProperties.spacing) !== JSON.stringify(oldParagraphProperties?.spacing) || paragraphProperties.styleId !== oldParagraphProperties?.styleId || paragraphProperties.contextualSpacing !== oldParagraphProperties?.contextualSpacing) {
|
|
36921
|
+
const previousNodeView = this.surroundingContext.previousParagraph ? nodeViewMap.get(this.surroundingContext.previousParagraph) : null;
|
|
36922
|
+
if (previousNodeView) {
|
|
36923
|
+
try {
|
|
36924
|
+
previousNodeView.getPos();
|
|
36925
|
+
} catch {
|
|
36926
|
+
return;
|
|
36927
|
+
}
|
|
36928
|
+
previousNodeView.update(
|
|
36929
|
+
previousNodeView.node,
|
|
36930
|
+
previousNodeView.decorations,
|
|
36931
|
+
previousNodeView.innerDecorations,
|
|
36932
|
+
true
|
|
36933
|
+
);
|
|
36934
|
+
}
|
|
36935
|
+
}
|
|
36936
|
+
};
|
|
36937
|
+
/**
|
|
36938
|
+
* Resolves properties of neighboring paragraphs to determine surrounding context.
|
|
36939
|
+
*/
|
|
36940
|
+
resolveNeighborParagraphProperties_fn = function() {
|
|
36941
|
+
const $pos = this.editor.state.doc.resolve(this.getPos());
|
|
36942
|
+
const parent = $pos.parent;
|
|
36943
|
+
const index2 = $pos.index();
|
|
36944
|
+
let hasPreviousParagraph = false;
|
|
36945
|
+
let previousParagraph = null;
|
|
36946
|
+
let nextParagraphProps = null;
|
|
36947
|
+
if (index2 > 0) {
|
|
36948
|
+
const previousNode = parent.child(index2 - 1);
|
|
36949
|
+
hasPreviousParagraph = previousNode.type.name === "paragraph" && !getResolvedParagraphProperties(previousNode)?.framePr?.dropCap;
|
|
36950
|
+
if (hasPreviousParagraph) {
|
|
36951
|
+
previousParagraph = previousNode;
|
|
36952
|
+
}
|
|
36953
|
+
}
|
|
36954
|
+
if (parent) {
|
|
36955
|
+
if (index2 < parent.childCount - 1) {
|
|
36956
|
+
const nextNode = parent.child(index2 + 1);
|
|
36957
|
+
if (nextNode.type.name === "paragraph") {
|
|
36958
|
+
nextParagraphProps = getResolvedParagraphProperties(nextNode);
|
|
36959
|
+
}
|
|
36960
|
+
}
|
|
36961
|
+
}
|
|
36962
|
+
this.surroundingContext = {
|
|
36963
|
+
hasPreviousParagraph,
|
|
36964
|
+
previousParagraph,
|
|
36965
|
+
nextParagraphProps
|
|
36966
|
+
};
|
|
36851
36967
|
};
|
|
36968
|
+
/**
|
|
36969
|
+
* Updates the styles of the list marker and separator based on current node attributes.
|
|
36970
|
+
* @returns {boolean}
|
|
36971
|
+
*/
|
|
36852
36972
|
updateListStyles_fn = function() {
|
|
36853
36973
|
let { suffix, justification } = this.node.attrs.listRendering;
|
|
36854
36974
|
suffix = suffix ?? "tab";
|
|
@@ -37672,6 +37792,19 @@ const CommentsMark = Mark.create({
|
|
|
37672
37792
|
return [CommentMarkName, Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
|
|
37673
37793
|
}
|
|
37674
37794
|
});
|
|
37795
|
+
let cache = /* @__PURE__ */ new WeakMap();
|
|
37796
|
+
function getParagraphContext(paragraph, startPos, helpers2, revision, compute) {
|
|
37797
|
+
const cached = cache.get(paragraph);
|
|
37798
|
+
if (cached && cached.revision === revision) {
|
|
37799
|
+
return cached.context;
|
|
37800
|
+
}
|
|
37801
|
+
const context = compute(paragraph, startPos, helpers2);
|
|
37802
|
+
cache.set(paragraph, { revision, context });
|
|
37803
|
+
return context;
|
|
37804
|
+
}
|
|
37805
|
+
function clearAllParagraphContexts() {
|
|
37806
|
+
cache = /* @__PURE__ */ new WeakMap();
|
|
37807
|
+
}
|
|
37675
37808
|
const leaderStyles = {
|
|
37676
37809
|
dot: "border-bottom: 1px dotted black;",
|
|
37677
37810
|
heavy: "border-bottom: 2px solid black;",
|
|
@@ -37688,6 +37821,14 @@ function createLayoutRequest(doc2, paragraphPos, view, helpers2, revision, parag
|
|
|
37688
37821
|
if (!paragraphContext) return null;
|
|
37689
37822
|
const paragraphId = paragraphIdFromPos(paragraphContext.startPos);
|
|
37690
37823
|
const paragraphNode = paragraphContext.paragraph;
|
|
37824
|
+
const cachedContext = getParagraphContext(
|
|
37825
|
+
paragraphNode,
|
|
37826
|
+
paragraphContext.startPos,
|
|
37827
|
+
helpers2,
|
|
37828
|
+
revision,
|
|
37829
|
+
() => extractParagraphContext(paragraphNode, paragraphContext.startPos, helpers2, paragraphContext.paragraphDepth)
|
|
37830
|
+
);
|
|
37831
|
+
const effectiveContext = cachedContext || paragraphContext;
|
|
37691
37832
|
const { entries } = flattenParagraph(paragraphNode, paragraphContext.startPos);
|
|
37692
37833
|
const spans = [];
|
|
37693
37834
|
let tabIndex = 0;
|
|
@@ -37715,13 +37856,13 @@ function createLayoutRequest(doc2, paragraphPos, view, helpers2, revision, parag
|
|
|
37715
37856
|
});
|
|
37716
37857
|
}
|
|
37717
37858
|
});
|
|
37718
|
-
const tabStops = Array.isArray(
|
|
37719
|
-
const hangingPx = twipsToPixels(Number(
|
|
37720
|
-
if (hangingPx > 0 &&
|
|
37721
|
-
tabStops.unshift({ val: "start", pos:
|
|
37859
|
+
const tabStops = Array.isArray(effectiveContext.tabStops) ? [...effectiveContext.tabStops] : [];
|
|
37860
|
+
const hangingPx = twipsToPixels(Number(effectiveContext.indent?.hanging) || 0);
|
|
37861
|
+
if (hangingPx > 0 && effectiveContext.indentWidth != null) {
|
|
37862
|
+
tabStops.unshift({ val: "start", pos: effectiveContext.indentWidth + hangingPx, leader: "none" });
|
|
37722
37863
|
}
|
|
37723
|
-
const paragraphWidth = getBlockNodeWidth(view,
|
|
37724
|
-
const indentWidth =
|
|
37864
|
+
const paragraphWidth = getBlockNodeWidth(view, effectiveContext.startPos) ?? defaultLineLength;
|
|
37865
|
+
const indentWidth = effectiveContext.indentWidth ?? getIndentWidth(view, effectiveContext.startPos, effectiveContext.indent);
|
|
37725
37866
|
return {
|
|
37726
37867
|
paragraphId,
|
|
37727
37868
|
revision,
|
|
@@ -37729,9 +37870,9 @@ function createLayoutRequest(doc2, paragraphPos, view, helpers2, revision, parag
|
|
|
37729
37870
|
defaultTabDistance,
|
|
37730
37871
|
defaultLineLength,
|
|
37731
37872
|
indents: {
|
|
37732
|
-
left: twipsToPixels(Number(
|
|
37733
|
-
right: twipsToPixels(Number(
|
|
37734
|
-
firstLine: twipsToPixels(Number(
|
|
37873
|
+
left: twipsToPixels(Number(effectiveContext.indent?.left) || 0),
|
|
37874
|
+
right: twipsToPixels(Number(effectiveContext.indent?.right) || 0),
|
|
37875
|
+
firstLine: twipsToPixels(Number(effectiveContext.indent?.firstLine) || 0),
|
|
37735
37876
|
hanging: hangingPx
|
|
37736
37877
|
},
|
|
37737
37878
|
tabStops,
|
|
@@ -37896,31 +38037,58 @@ const TabNode = Node$1.create({
|
|
|
37896
38037
|
key: new PluginKey("tabPlugin"),
|
|
37897
38038
|
state: {
|
|
37898
38039
|
init() {
|
|
37899
|
-
|
|
38040
|
+
const initialDecorations = buildInitialDecorations(view.state.doc, view, helpers2, 0);
|
|
38041
|
+
return { decorations: initialDecorations, revision: 0 };
|
|
37900
38042
|
},
|
|
37901
38043
|
apply(tr, { decorations, revision }, _oldState, newState) {
|
|
37902
|
-
|
|
37903
|
-
const newDecorations2 = buildDecorations(newState.doc, view, helpers2, 0);
|
|
37904
|
-
return { decorations: newDecorations2, revision: 0 };
|
|
37905
|
-
}
|
|
38044
|
+
const currentDecorations = decorations && decorations.map ? decorations.map(tr.mapping, tr.doc) : DecorationSet.empty;
|
|
37906
38045
|
if (!tr.docChanged || tr.getMeta("blockNodeInitialUpdate")) {
|
|
37907
|
-
return { decorations, revision };
|
|
38046
|
+
return { decorations: currentDecorations, revision };
|
|
37908
38047
|
}
|
|
37909
|
-
const
|
|
37910
|
-
|
|
37911
|
-
|
|
38048
|
+
const affectedParagraphs = getAffectedParagraphStarts(tr, newState);
|
|
38049
|
+
if (affectedParagraphs.size === 0) {
|
|
38050
|
+
return { decorations: currentDecorations, revision };
|
|
38051
|
+
}
|
|
38052
|
+
let nextDecorations = currentDecorations;
|
|
38053
|
+
affectedParagraphs.forEach((pos) => {
|
|
38054
|
+
const paragraph = newState.doc.nodeAt(pos);
|
|
38055
|
+
if (!paragraph || paragraph.type.name !== "paragraph") return;
|
|
38056
|
+
const from2 = pos;
|
|
38057
|
+
const to = pos + paragraph.nodeSize;
|
|
38058
|
+
const existing = nextDecorations.find(from2, to);
|
|
38059
|
+
if (existing?.length) {
|
|
38060
|
+
nextDecorations = nextDecorations.remove(existing);
|
|
38061
|
+
}
|
|
38062
|
+
const paragraphDecorations = buildParagraphDecorations(
|
|
38063
|
+
newState.doc,
|
|
38064
|
+
pos + 1,
|
|
38065
|
+
paragraph,
|
|
38066
|
+
view,
|
|
38067
|
+
helpers2,
|
|
38068
|
+
revision + 1
|
|
38069
|
+
);
|
|
38070
|
+
nextDecorations = nextDecorations.add(newState.doc, paragraphDecorations);
|
|
38071
|
+
});
|
|
38072
|
+
return { decorations: nextDecorations, revision: revision + 1 };
|
|
37912
38073
|
}
|
|
37913
38074
|
},
|
|
37914
38075
|
props: {
|
|
37915
38076
|
decorations(state) {
|
|
37916
38077
|
return this.getState(state).decorations;
|
|
37917
38078
|
}
|
|
38079
|
+
},
|
|
38080
|
+
view() {
|
|
38081
|
+
return {
|
|
38082
|
+
destroy() {
|
|
38083
|
+
clearAllParagraphContexts();
|
|
38084
|
+
}
|
|
38085
|
+
};
|
|
37918
38086
|
}
|
|
37919
38087
|
});
|
|
37920
38088
|
return [tabPlugin];
|
|
37921
38089
|
}
|
|
37922
38090
|
});
|
|
37923
|
-
function
|
|
38091
|
+
function buildInitialDecorations(doc2, view, helpers2, revision) {
|
|
37924
38092
|
const decorations = [];
|
|
37925
38093
|
doc2.descendants((node, pos) => {
|
|
37926
38094
|
if (node.type.name !== "paragraph") return;
|
|
@@ -37941,6 +38109,37 @@ function buildDecorations(doc2, view, helpers2, revision) {
|
|
|
37941
38109
|
});
|
|
37942
38110
|
return DecorationSet.create(doc2, decorations);
|
|
37943
38111
|
}
|
|
38112
|
+
function buildParagraphDecorations(doc2, paragraphContentPos, paragraphNode, view, helpers2, revision) {
|
|
38113
|
+
const request = createLayoutRequest(doc2, paragraphContentPos, view, helpers2, revision);
|
|
38114
|
+
if (!request) return [];
|
|
38115
|
+
const result = calculateTabLayout(request, void 0, view);
|
|
38116
|
+
return applyLayoutResult(result, paragraphNode, paragraphContentPos - 1);
|
|
38117
|
+
}
|
|
38118
|
+
function getAffectedParagraphStarts(tr, newState) {
|
|
38119
|
+
const affected = /* @__PURE__ */ new Set();
|
|
38120
|
+
tr.steps.forEach((step, index2) => {
|
|
38121
|
+
if (step.from == null && step.to == null) return;
|
|
38122
|
+
let fromPos = step.from;
|
|
38123
|
+
let toPos = step.to;
|
|
38124
|
+
if (typeof fromPos !== "number" || typeof toPos !== "number") return;
|
|
38125
|
+
for (let i = index2; i < tr.steps.length; i++) {
|
|
38126
|
+
const stepMap = tr.steps[i].getMap();
|
|
38127
|
+
fromPos = stepMap.map(fromPos, -1);
|
|
38128
|
+
toPos = stepMap.map(toPos, 1);
|
|
38129
|
+
}
|
|
38130
|
+
if (fromPos < 0 || toPos < 0 || fromPos > newState.doc.content.size || toPos > newState.doc.content.size) {
|
|
38131
|
+
return;
|
|
38132
|
+
}
|
|
38133
|
+
newState.doc.nodesBetween(fromPos, toPos, (node, pos) => {
|
|
38134
|
+
if (node.type.name === "paragraph") {
|
|
38135
|
+
affected.add(pos);
|
|
38136
|
+
return false;
|
|
38137
|
+
}
|
|
38138
|
+
return true;
|
|
38139
|
+
});
|
|
38140
|
+
});
|
|
38141
|
+
return affected;
|
|
38142
|
+
}
|
|
37944
38143
|
const LineBreak = Node$1.create({
|
|
37945
38144
|
name: "lineBreak",
|
|
37946
38145
|
group: "inline",
|
|
@@ -38315,24 +38514,24 @@ const createColGroup = (node, cellMinWidth, overrideCol, overrideValue) => {
|
|
|
38315
38514
|
var readFromCache;
|
|
38316
38515
|
var addToCache;
|
|
38317
38516
|
if (typeof WeakMap != "undefined") {
|
|
38318
|
-
let
|
|
38319
|
-
readFromCache = (key2) =>
|
|
38517
|
+
let cache2 = /* @__PURE__ */ new WeakMap();
|
|
38518
|
+
readFromCache = (key2) => cache2.get(key2);
|
|
38320
38519
|
addToCache = (key2, value) => {
|
|
38321
|
-
|
|
38520
|
+
cache2.set(key2, value);
|
|
38322
38521
|
return value;
|
|
38323
38522
|
};
|
|
38324
38523
|
} else {
|
|
38325
|
-
const
|
|
38524
|
+
const cache2 = [];
|
|
38326
38525
|
const cacheSize = 10;
|
|
38327
38526
|
let cachePos = 0;
|
|
38328
38527
|
readFromCache = (key2) => {
|
|
38329
|
-
for (let i = 0; i <
|
|
38330
|
-
if (
|
|
38528
|
+
for (let i = 0; i < cache2.length; i += 2)
|
|
38529
|
+
if (cache2[i] == key2) return cache2[i + 1];
|
|
38331
38530
|
};
|
|
38332
38531
|
addToCache = (key2, value) => {
|
|
38333
38532
|
if (cachePos == cacheSize) cachePos = 0;
|
|
38334
|
-
|
|
38335
|
-
return
|
|
38533
|
+
cache2[cachePos++] = key2;
|
|
38534
|
+
return cache2[cachePos++] = value;
|
|
38336
38535
|
};
|
|
38337
38536
|
}
|
|
38338
38537
|
var TableMap = class {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, 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-VnZK3P1W.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CKkHVssy.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-CKkHVssy.js";
|
|
2
|
+
import "./chunks/converter-VnZK3P1W.js";
|
|
3
|
+
import "./chunks/docx-zipper-Bw5zXmBh.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
|
|
12
|
-
import { aJ as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aM as vClickOutside, aN as getActiveFormatting, aC as isInTable, U as findParentNode, aq as calculateResolvedParagraphProperties, a7 as twipsToLines, V as isList, al as parseSizeUnit, a8 as pixelsToTwips, aO as getFileObject, aP as translator, aQ as translator$1, aR as translator$2, aS as translator$3, aT as translator$4, aU as translator$5, aV as translator$6, aW as translator$7, aX as translator$8, aY as translator$9, aZ as translator$a, a_ as translator$b, a$ as translator$c, b0 as translator$d, b1 as translator$e, b2 as commentRangeEndTranslator, b3 as commentRangeStartTranslator, b4 as translator$f, b5 as translator$g, b6 as translator$h, b7 as translator$i, b8 as translator$j, b9 as translator$k, ba as translator$l, bb as translator$m, bc as translator$n, bd as translator$o, be as translator$p, bf as translator$q, bg as translator$r, bh as translator$s, bi as translator$t, bj as translator$u, bk as translator$v, bl as translator$w, bm as translator$x, bn as translator$y, bo as translator$z, bp as translator$A, bq as translator$B, br as translator$C, bs as translator$D, bt as translator$E, bu as translator$F, bv as translator$G, bw as translator$H, bx as translator$I, by as translator$J, bz as translator$K, bA as translator$L, bB as translator$M, bC as translator$N, bD as translator$O, bE as translator$P, bF as translator$Q, bG as translator$R, bH as translator$S, bI as translator$T, bJ as translator$U, bK as translator$V, bL as translator$W, bM as translator$X, bN as translator$Y, bO as translator$Z, bP as translator$_, bQ as translator$$, bR as translator$10, bS as translator$11, bT as translator$12, bU as translator$13, bV as translator$14, bW as translator$15, bX as translator$16, bY as translator$17, bZ as translator$18, b_ as translator$19, b$ as translator$1a, c0 as translator$1b, c1 as translator$1c, c2 as translator$1d, c3 as translator$1e, c4 as translator$1f, c5 as translator$1g, c6 as translator$1h, c7 as translator$1i, c8 as translator$1j, P as PluginKey, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { ac, i, a9 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { z, F, B, T, w, C, x } from "./chunks/editor-
|
|
12
|
+
import { aJ as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aM as vClickOutside, aN as getActiveFormatting, aC as isInTable, U as findParentNode, aq as calculateResolvedParagraphProperties, a7 as twipsToLines, V as isList, al as parseSizeUnit, a8 as pixelsToTwips, aO as getFileObject, aP as translator, aQ as translator$1, aR as translator$2, aS as translator$3, aT as translator$4, aU as translator$5, aV as translator$6, aW as translator$7, aX as translator$8, aY as translator$9, aZ as translator$a, a_ as translator$b, a$ as translator$c, b0 as translator$d, b1 as translator$e, b2 as commentRangeEndTranslator, b3 as commentRangeStartTranslator, b4 as translator$f, b5 as translator$g, b6 as translator$h, b7 as translator$i, b8 as translator$j, b9 as translator$k, ba as translator$l, bb as translator$m, bc as translator$n, bd as translator$o, be as translator$p, bf as translator$q, bg as translator$r, bh as translator$s, bi as translator$t, bj as translator$u, bk as translator$v, bl as translator$w, bm as translator$x, bn as translator$y, bo as translator$z, bp as translator$A, bq as translator$B, br as translator$C, bs as translator$D, bt as translator$E, bu as translator$F, bv as translator$G, bw as translator$H, bx as translator$I, by as translator$J, bz as translator$K, bA as translator$L, bB as translator$M, bC as translator$N, bD as translator$O, bE as translator$P, bF as translator$Q, bG as translator$R, bH as translator$S, bI as translator$T, bJ as translator$U, bK as translator$V, bL as translator$W, bM as translator$X, bN as translator$Y, bO as translator$Z, bP as translator$_, bQ as translator$$, bR as translator$10, bS as translator$11, bT as translator$12, bU as translator$13, bV as translator$14, bW as translator$15, bX as translator$16, bY as translator$17, bZ as translator$18, b_ as translator$19, b$ as translator$1a, c0 as translator$1b, c1 as translator$1c, c2 as translator$1d, c3 as translator$1e, c4 as translator$1f, c5 as translator$1g, c6 as translator$1h, c7 as translator$1i, c8 as translator$1j, P as PluginKey, a as Plugin } from "./chunks/converter-VnZK3P1W.js";
|
|
13
|
+
import { ac, i, a9 } from "./chunks/converter-VnZK3P1W.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-CKkHVssy.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-CKkHVssy.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DPzMju-T.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-Bw5zXmBh.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|