@harbour-enterprises/superdoc 1.0.0-beta.54 → 1.0.0-beta.55
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-D_U-y4Wi.es.js → PdfViewer-ARRkZgYS.es.js} +1 -1
- package/dist/chunks/{PdfViewer-qBKjClah.cjs → PdfViewer-ObG30G-u.cjs} +1 -1
- package/dist/chunks/{index-to6_YLa7.es.js → index-Bwqb03qi.es.js} +3 -3
- package/dist/chunks/{index-BKvAeQdF.cjs → index-DFHwDXHd.cjs} +3 -3
- package/dist/chunks/{index-t8thQIOL-CV8VTGI4.cjs → index-bqjMjne1-CJi4d9NS.cjs} +1 -1
- package/dist/chunks/{index-t8thQIOL-vW80ABaR.es.js → index-bqjMjne1-DBB94Dlj.es.js} +1 -1
- package/dist/chunks/{super-editor.es-xpC1DWhM.es.js → super-editor.es-7Twgz-8H.es.js} +485 -177
- package/dist/chunks/{super-editor.es-BMiadG4G.cjs → super-editor.es-C2Ob7BbN.cjs} +485 -177
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-OoT4LYwQ.js → converter-D33MGATy.js} +274 -171
- package/dist/super-editor/chunks/{docx-zipper-Cf_hIcjC.js → docx-zipper-C7Fp89_I.js} +1 -1
- package/dist/super-editor/chunks/{editor-CqbtudGQ.js → editor-BiFHsy25.js} +216 -11
- package/dist/super-editor/chunks/{index-t8thQIOL.js → index-bqjMjne1.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BsfRAJ0o.js → toolbar-BNta2qOv.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 +487 -179
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -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-D33MGATy.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, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, computeAnchorMap_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
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 resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as
|
|
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 resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-D33MGATy.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-C7Fp89_I.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() {
|
|
@@ -13918,7 +13918,7 @@ const isHeadless = (editor) => {
|
|
|
13918
13918
|
const shouldSkipNodeView = (editor) => {
|
|
13919
13919
|
return isHeadless(editor);
|
|
13920
13920
|
};
|
|
13921
|
-
const summaryVersion = "1.0.0-beta.
|
|
13921
|
+
const summaryVersion = "1.0.0-beta.55";
|
|
13922
13922
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13923
13923
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13924
13924
|
function mapAttributes(attrs) {
|
|
@@ -14710,7 +14710,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14710
14710
|
{ default: remarkStringify },
|
|
14711
14711
|
{ default: remarkGfm }
|
|
14712
14712
|
] = await Promise.all([
|
|
14713
|
-
import("./index-
|
|
14713
|
+
import("./index-bqjMjne1.js"),
|
|
14714
14714
|
import("./index-DRCvimau.js"),
|
|
14715
14715
|
import("./index-C_x_N6Uh.js"),
|
|
14716
14716
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14915,7 +14915,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14915
14915
|
* Process collaboration migrations
|
|
14916
14916
|
*/
|
|
14917
14917
|
processCollaborationMigrations() {
|
|
14918
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14918
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.55");
|
|
14919
14919
|
if (!this.options.ydoc) return;
|
|
14920
14920
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14921
14921
|
let docVersion = metaMap.get("version");
|
|
@@ -45729,7 +45729,7 @@ const cleanupEmptyRunsPlugin = new Plugin({
|
|
|
45729
45729
|
return tr.docChanged ? tr : null;
|
|
45730
45730
|
}
|
|
45731
45731
|
});
|
|
45732
|
-
const mergeRanges$
|
|
45732
|
+
const mergeRanges$2 = (ranges, docSize) => {
|
|
45733
45733
|
if (!ranges.length) return [];
|
|
45734
45734
|
const sorted = ranges.map(({ from: from2, to }) => ({
|
|
45735
45735
|
from: Math.max(0, from2),
|
|
@@ -45758,7 +45758,7 @@ const collectChangedRanges = (trs, docSize) => {
|
|
|
45758
45758
|
});
|
|
45759
45759
|
});
|
|
45760
45760
|
});
|
|
45761
|
-
return mergeRanges$
|
|
45761
|
+
return mergeRanges$2(ranges, docSize);
|
|
45762
45762
|
};
|
|
45763
45763
|
const mapRangesThroughTransactions = (ranges, transactions, docSize) => {
|
|
45764
45764
|
let mapped = ranges;
|
|
@@ -45770,7 +45770,7 @@ const mapRangesThroughTransactions = (ranges, transactions, docSize) => {
|
|
|
45770
45770
|
return { from: mappedFrom, to: mappedTo };
|
|
45771
45771
|
}).filter(Boolean);
|
|
45772
45772
|
});
|
|
45773
|
-
return mergeRanges$
|
|
45773
|
+
return mergeRanges$2(mapped, docSize);
|
|
45774
45774
|
};
|
|
45775
45775
|
const buildWrapTransaction = (state, ranges, runType) => {
|
|
45776
45776
|
if (!ranges.length) return null;
|
|
@@ -45829,7 +45829,7 @@ const wrapTextInRunsPlugin = () => {
|
|
|
45829
45829
|
if (!runType) return null;
|
|
45830
45830
|
pendingRanges = mapRangesThroughTransactions(pendingRanges, transactions, docSize);
|
|
45831
45831
|
const changedRanges = collectChangedRanges(transactions, docSize);
|
|
45832
|
-
pendingRanges = mergeRanges$
|
|
45832
|
+
pendingRanges = mergeRanges$2([...pendingRanges, ...changedRanges], docSize);
|
|
45833
45833
|
if (view?.composing) {
|
|
45834
45834
|
return null;
|
|
45835
45835
|
}
|
|
@@ -45839,6 +45839,204 @@ const wrapTextInRunsPlugin = () => {
|
|
|
45839
45839
|
}
|
|
45840
45840
|
});
|
|
45841
45841
|
};
|
|
45842
|
+
const splitRunsAfterMarkPlugin = new Plugin({
|
|
45843
|
+
appendTransaction(transactions, _old, newState) {
|
|
45844
|
+
const markRanges = [];
|
|
45845
|
+
let mappingToFinal = new Mapping();
|
|
45846
|
+
for (let ti = transactions.length - 1; ti >= 0; ti--) {
|
|
45847
|
+
const tr2 = transactions[ti];
|
|
45848
|
+
tr2.steps.forEach((step) => {
|
|
45849
|
+
if (!(step instanceof AddMarkStep || step instanceof RemoveMarkStep)) return;
|
|
45850
|
+
const fromAfterTr = tr2.mapping.map(step.from, 1);
|
|
45851
|
+
const toAfterTr = tr2.mapping.map(step.to, -1);
|
|
45852
|
+
markRanges.push({
|
|
45853
|
+
from: mappingToFinal.map(fromAfterTr, 1),
|
|
45854
|
+
to: mappingToFinal.map(toAfterTr, -1)
|
|
45855
|
+
});
|
|
45856
|
+
});
|
|
45857
|
+
const composed = new Mapping();
|
|
45858
|
+
composed.appendMapping(tr2.mapping);
|
|
45859
|
+
composed.appendMapping(mappingToFinal);
|
|
45860
|
+
mappingToFinal = composed;
|
|
45861
|
+
}
|
|
45862
|
+
if (!markRanges.length) return null;
|
|
45863
|
+
const runType = newState.schema.nodes["run"];
|
|
45864
|
+
if (!runType) return null;
|
|
45865
|
+
const runPositions = /* @__PURE__ */ new Set();
|
|
45866
|
+
markRanges.forEach(({ from: from2, to }) => {
|
|
45867
|
+
newState.doc.nodesBetween(from2, to, (node, pos) => {
|
|
45868
|
+
if (node.type === runType) runPositions.add(pos);
|
|
45869
|
+
});
|
|
45870
|
+
});
|
|
45871
|
+
if (!runPositions.size) return null;
|
|
45872
|
+
const tr = newState.tr;
|
|
45873
|
+
const originalSelection = newState.selection;
|
|
45874
|
+
const isTextSelection2 = originalSelection instanceof TextSelection;
|
|
45875
|
+
let preservedAnchor = isTextSelection2 ? originalSelection.anchor : null;
|
|
45876
|
+
let preservedHead = isTextSelection2 ? originalSelection.head : null;
|
|
45877
|
+
const anchorAssoc = preservedAnchor != null && preservedHead != null && preservedAnchor <= preservedHead ? -1 : 1;
|
|
45878
|
+
const headAssoc = preservedAnchor != null && preservedHead != null && preservedHead >= preservedAnchor ? 1 : -1;
|
|
45879
|
+
const mapOffsetThroughReplacement = (startPos, replacement, offset2) => {
|
|
45880
|
+
let currentPos = startPos;
|
|
45881
|
+
let remaining = offset2;
|
|
45882
|
+
let mapped = null;
|
|
45883
|
+
replacement.forEach((node) => {
|
|
45884
|
+
if (mapped != null) return;
|
|
45885
|
+
const contentSize = node.content.size;
|
|
45886
|
+
if (remaining <= contentSize) {
|
|
45887
|
+
mapped = currentPos + 1 + remaining;
|
|
45888
|
+
return;
|
|
45889
|
+
}
|
|
45890
|
+
remaining -= contentSize;
|
|
45891
|
+
currentPos += node.nodeSize;
|
|
45892
|
+
});
|
|
45893
|
+
return mapped ?? currentPos;
|
|
45894
|
+
};
|
|
45895
|
+
Array.from(runPositions).sort((a, b) => b - a).forEach((pos) => {
|
|
45896
|
+
const mappedPos = tr.mapping.map(pos);
|
|
45897
|
+
const runNode = tr.doc.nodeAt(mappedPos);
|
|
45898
|
+
if (!runNode) return;
|
|
45899
|
+
const groups = [];
|
|
45900
|
+
let current = [];
|
|
45901
|
+
let currentMarks = null;
|
|
45902
|
+
runNode.forEach((child) => {
|
|
45903
|
+
if (child.isText) {
|
|
45904
|
+
if (currentMarks && Mark$1.sameSet(currentMarks, child.marks)) {
|
|
45905
|
+
current.push(child);
|
|
45906
|
+
} else {
|
|
45907
|
+
if (current.length) groups.push(Fragment.from(current));
|
|
45908
|
+
current = [child];
|
|
45909
|
+
currentMarks = child.marks;
|
|
45910
|
+
}
|
|
45911
|
+
} else {
|
|
45912
|
+
if (current.length) groups.push(Fragment.from(current));
|
|
45913
|
+
groups.push(Fragment.from(child));
|
|
45914
|
+
current = [];
|
|
45915
|
+
currentMarks = null;
|
|
45916
|
+
}
|
|
45917
|
+
});
|
|
45918
|
+
if (current.length) groups.push(Fragment.from(current));
|
|
45919
|
+
if (groups.length <= 1) return;
|
|
45920
|
+
const replacement = Fragment.from(
|
|
45921
|
+
groups.map((content) => runType.create(runNode.attrs, content, runNode.marks))
|
|
45922
|
+
);
|
|
45923
|
+
tr.replaceWith(mappedPos, mappedPos + runNode.nodeSize, replacement);
|
|
45924
|
+
const stepMap = tr.mapping.maps[tr.mapping.maps.length - 1];
|
|
45925
|
+
const mapSelectionPos = (pos2, assoc) => {
|
|
45926
|
+
if (pos2 == null) return null;
|
|
45927
|
+
if (pos2 < mappedPos || pos2 > mappedPos + runNode.nodeSize) {
|
|
45928
|
+
return stepMap.map(pos2, assoc);
|
|
45929
|
+
}
|
|
45930
|
+
const offsetInRun = pos2 - (mappedPos + 1);
|
|
45931
|
+
return mapOffsetThroughReplacement(mappedPos, replacement, offsetInRun);
|
|
45932
|
+
};
|
|
45933
|
+
preservedAnchor = mapSelectionPos(preservedAnchor, anchorAssoc);
|
|
45934
|
+
preservedHead = mapSelectionPos(preservedHead, headAssoc);
|
|
45935
|
+
});
|
|
45936
|
+
if (tr.docChanged && originalSelection) {
|
|
45937
|
+
if (originalSelection instanceof TextSelection && preservedAnchor != null && preservedHead != null) {
|
|
45938
|
+
tr.setSelection(TextSelection.create(tr.doc, preservedAnchor, preservedHead));
|
|
45939
|
+
} else {
|
|
45940
|
+
tr.setSelection(originalSelection.map(tr.doc, tr.mapping));
|
|
45941
|
+
}
|
|
45942
|
+
}
|
|
45943
|
+
return tr.docChanged ? tr : null;
|
|
45944
|
+
}
|
|
45945
|
+
});
|
|
45946
|
+
const calculateInlineRunPropertiesPlugin = (editor) => new Plugin({
|
|
45947
|
+
appendTransaction(transactions, _oldState, newState) {
|
|
45948
|
+
const tr = newState.tr;
|
|
45949
|
+
if (!transactions.some((t) => t.docChanged)) return null;
|
|
45950
|
+
if (!transactions.some(
|
|
45951
|
+
(tr2) => tr2.steps.some((step) => step instanceof AddMarkStep || step instanceof RemoveMarkStep)
|
|
45952
|
+
)) {
|
|
45953
|
+
return null;
|
|
45954
|
+
}
|
|
45955
|
+
const runType = newState.schema.nodes.run;
|
|
45956
|
+
if (!runType) return null;
|
|
45957
|
+
const changedRanges = [];
|
|
45958
|
+
transactions.forEach((tr2) => {
|
|
45959
|
+
tr2.steps.forEach((step) => {
|
|
45960
|
+
const from2 = tr2.mapping.map(step.from, 1);
|
|
45961
|
+
const to = tr2.mapping.map(step.to, -1);
|
|
45962
|
+
changedRanges.push({ from: from2, to });
|
|
45963
|
+
});
|
|
45964
|
+
});
|
|
45965
|
+
const runPositions = /* @__PURE__ */ new Set();
|
|
45966
|
+
mergeRanges$1(changedRanges, newState.doc.content.size).forEach(({ from: from2, to }) => {
|
|
45967
|
+
newState.doc.nodesBetween(from2, to, (node, pos) => {
|
|
45968
|
+
if (node.type === runType) runPositions.add(pos);
|
|
45969
|
+
});
|
|
45970
|
+
});
|
|
45971
|
+
if (!runPositions.size) return null;
|
|
45972
|
+
runPositions.forEach((pos) => {
|
|
45973
|
+
const runNode = tr.doc.nodeAt(pos);
|
|
45974
|
+
if (!runNode) return;
|
|
45975
|
+
const $pos = tr.doc.resolve(pos);
|
|
45976
|
+
let paragraphNode = null;
|
|
45977
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
45978
|
+
const node = $pos.node(depth);
|
|
45979
|
+
if (node.type.name === "paragraph") {
|
|
45980
|
+
paragraphNode = node;
|
|
45981
|
+
break;
|
|
45982
|
+
}
|
|
45983
|
+
}
|
|
45984
|
+
if (!paragraphNode) return;
|
|
45985
|
+
const marks = getMarksFromRun(runNode);
|
|
45986
|
+
const runPropertiesFromMarks = decodeRPrFromMarks(marks);
|
|
45987
|
+
const paragraphProperties = getResolvedParagraphProperties(paragraphNode) || calculateResolvedParagraphProperties(editor, paragraphNode, $pos);
|
|
45988
|
+
const runPropertiesFromStyles = resolveRunProperties(
|
|
45989
|
+
{ docx: editor.converter?.convertedXml ?? {}, numbering: editor.converter?.numbering ?? {} },
|
|
45990
|
+
{},
|
|
45991
|
+
paragraphProperties,
|
|
45992
|
+
false,
|
|
45993
|
+
Boolean(paragraphNode.attrs.paragraphProperties?.numberingProperties)
|
|
45994
|
+
);
|
|
45995
|
+
const inlineRunProperties = getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles);
|
|
45996
|
+
const runProperties = Object.keys(inlineRunProperties).length ? inlineRunProperties : null;
|
|
45997
|
+
if (JSON.stringify(runProperties) === JSON.stringify(runNode.attrs.runProperties)) return;
|
|
45998
|
+
tr.setNodeMarkup(pos, runNode.type, { ...runNode.attrs, runProperties }, runNode.marks);
|
|
45999
|
+
});
|
|
46000
|
+
return tr.docChanged ? tr : null;
|
|
46001
|
+
}
|
|
46002
|
+
});
|
|
46003
|
+
function getMarksFromRun(runNode) {
|
|
46004
|
+
let marks = [];
|
|
46005
|
+
runNode.forEach((child) => {
|
|
46006
|
+
if (!marks.length && child.isText) {
|
|
46007
|
+
marks = child.marks;
|
|
46008
|
+
}
|
|
46009
|
+
});
|
|
46010
|
+
return marks;
|
|
46011
|
+
}
|
|
46012
|
+
function getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles) {
|
|
46013
|
+
const inlineRunProperties = {};
|
|
46014
|
+
for (const key2 in runPropertiesFromMarks) {
|
|
46015
|
+
const valueFromMarks = runPropertiesFromMarks[key2];
|
|
46016
|
+
const valueFromStyles = runPropertiesFromStyles[key2];
|
|
46017
|
+
if (JSON.stringify(valueFromMarks) !== JSON.stringify(valueFromStyles)) {
|
|
46018
|
+
inlineRunProperties[key2] = valueFromMarks;
|
|
46019
|
+
}
|
|
46020
|
+
}
|
|
46021
|
+
return inlineRunProperties;
|
|
46022
|
+
}
|
|
46023
|
+
function mergeRanges$1(ranges, docSize) {
|
|
46024
|
+
if (!ranges.length) return [];
|
|
46025
|
+
const sorted = ranges.map(({ from: from2, to }) => ({
|
|
46026
|
+
from: Math.max(0, from2),
|
|
46027
|
+
to: Math.min(docSize, to)
|
|
46028
|
+
})).filter(({ from: from2, to }) => from2 < to).sort((a, b) => a.from - b.from);
|
|
46029
|
+
const merged = [];
|
|
46030
|
+
for (const range of sorted) {
|
|
46031
|
+
const last = merged[merged.length - 1];
|
|
46032
|
+
if (last && range.from <= last.to) {
|
|
46033
|
+
last.to = Math.max(last.to, range.to);
|
|
46034
|
+
} else {
|
|
46035
|
+
merged.push({ ...range });
|
|
46036
|
+
}
|
|
46037
|
+
}
|
|
46038
|
+
return merged;
|
|
46039
|
+
}
|
|
45842
46040
|
const Run = OxmlNode.create({
|
|
45843
46041
|
name: "run",
|
|
45844
46042
|
oXmlName: "w:r",
|
|
@@ -45893,7 +46091,12 @@ const Run = OxmlNode.create({
|
|
|
45893
46091
|
return ["span", base2, 0];
|
|
45894
46092
|
},
|
|
45895
46093
|
addPmPlugins() {
|
|
45896
|
-
return [
|
|
46094
|
+
return [
|
|
46095
|
+
wrapTextInRunsPlugin(),
|
|
46096
|
+
splitRunsAfterMarkPlugin,
|
|
46097
|
+
calculateInlineRunPropertiesPlugin(this.editor),
|
|
46098
|
+
cleanupEmptyRunsPlugin
|
|
46099
|
+
];
|
|
45897
46100
|
}
|
|
45898
46101
|
});
|
|
45899
46102
|
const restartNumbering = ({ editor, tr, state, dispatch }) => {
|
|
@@ -50789,7 +50992,9 @@ const TableCell = Node$1.create({
|
|
|
50789
50992
|
const style = sides.map((side) => {
|
|
50790
50993
|
const border = borders?.[side];
|
|
50791
50994
|
if (border && border.val === "none") return `border-${side}: ${border.val};`;
|
|
50792
|
-
|
|
50995
|
+
let color = border?.color || "black";
|
|
50996
|
+
if (color === "auto") color = "black";
|
|
50997
|
+
if (border) return `border-${side}: ${Math.ceil(border.size)}px solid ${color};`;
|
|
50793
50998
|
return "";
|
|
50794
50999
|
}).join(" ");
|
|
50795
51000
|
return { style };
|
|
@@ -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-D33MGATy.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BiFHsy25.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-BiFHsy25.js";
|
|
2
|
+
import "./chunks/converter-D33MGATy.js";
|
|
3
|
+
import "./chunks/docx-zipper-C7Fp89_I.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 { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { ac, i, a9, aQ } 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 { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-D33MGATy.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-D33MGATy.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-BiFHsy25.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-BiFHsy25.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, useCssVars, shallowRef, createBlock, 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-BNta2qOv.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-C7Fp89_I.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-C2Ob7BbN.cjs");
|
|
4
4
|
require("./chunks/vue-jWLMl8Ts.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-7Twgz-8H.es.js";
|
|
2
2
|
import "./chunks/vue-Dysv_7z5.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-C2Ob7BbN.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-DFHwDXHd.cjs");
|
|
5
5
|
const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
|
7
7
|
exports.Editor = superEditor_es.Editor;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-7Twgz-8H.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-Bwqb03qi.es.js";
|
|
3
3
|
import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
export {
|
|
5
5
|
a as AnnotatorHelpers,
|