superdoc 1.0.0-beta.10 → 1.0.0-beta.11
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-H8A08hnq.cjs → PdfViewer-B89Kdpki.cjs} +1 -1
- package/dist/chunks/{PdfViewer--YMlVUNN.es.js → PdfViewer-BEUDb1IK.es.js} +1 -1
- package/dist/chunks/{index-CC6Vsniy-D24AMjnI.cjs → index-COtSUOub-BMr5e7ql.cjs} +1 -1
- package/dist/chunks/{index-CC6Vsniy-En79I7vb.es.js → index-COtSUOub-BN5H-8s7.es.js} +1 -1
- package/dist/chunks/{index-BrS4iO03.es.js → index-DojaiJhC.es.js} +3 -3
- package/dist/chunks/{index-B7kE5mis.cjs → index-DtZQUqqh.cjs} +3 -3
- package/dist/chunks/{super-editor.es-C3Mtq3FL.es.js → super-editor.es-CvgUsCEN.es.js} +213 -72
- package/dist/chunks/{super-editor.es-Bf7zv4k5.cjs → super-editor.es-DQQOSn_9.cjs} +213 -72
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-xQmDrmCk.js → converter-Y0EypB0y.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-BKkVPA0E.js → docx-zipper-BwRRySEU.js} +1 -1
- package/dist/super-editor/chunks/{editor-C0RiU_sq.js → editor-D15SNlq2.js} +171 -55
- package/dist/super-editor/chunks/{index-CC6Vsniy.js → index-COtSUOub.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BznN8wrp.js → toolbar-DFaZbHng.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/style.css +6 -6
- package/dist/super-editor/super-editor.es.js +49 -24
- 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 +215 -74
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -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, _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-Y0EypB0y.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-BwRRySEU.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.11";
|
|
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-COtSUOub.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.11");
|
|
14544
14544
|
if (!this.options.ydoc) return;
|
|
14545
14545
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14546
14546
|
let docVersion = metaMap.get("version");
|
|
@@ -18729,28 +18729,42 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
18729
18729
|
const indentSource = attrs.indent ?? paragraphProps.indent ?? hydrated?.indent;
|
|
18730
18730
|
const normalizedIndent = normalizePxIndent(indentSource) ?? normalizeParagraphIndent(indentSource ?? attrs.textIndent);
|
|
18731
18731
|
const unwrapTabStops = (tabStops) => {
|
|
18732
|
-
if (!Array.isArray(tabStops))
|
|
18732
|
+
if (!Array.isArray(tabStops)) {
|
|
18733
|
+
return void 0;
|
|
18734
|
+
}
|
|
18733
18735
|
const unwrapped = [];
|
|
18734
18736
|
for (const entry of tabStops) {
|
|
18735
|
-
if (entry
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18737
|
+
if (!entry || typeof entry !== "object") {
|
|
18738
|
+
continue;
|
|
18739
|
+
}
|
|
18740
|
+
if ("tab" in entry) {
|
|
18741
|
+
const entryRecord2 = entry;
|
|
18742
|
+
const tab = entryRecord2.tab;
|
|
18743
|
+
if (!tab || typeof tab !== "object") {
|
|
18744
|
+
continue;
|
|
18745
|
+
}
|
|
18746
|
+
const tabObj = tab;
|
|
18747
|
+
const val = typeof tabObj.tabType === "string" ? tabObj.tabType : typeof tabObj.val === "string" ? tabObj.val : void 0;
|
|
18748
|
+
const pos = pickNumber(tabObj.originalPos ?? tabObj.pos);
|
|
18749
|
+
if (!val || pos == null) {
|
|
18750
|
+
continue;
|
|
18751
|
+
}
|
|
18752
|
+
const normalized = { val, pos };
|
|
18753
|
+
const leader = tabObj.leader;
|
|
18754
|
+
if (typeof leader === "string" && leader.length > 0) {
|
|
18755
|
+
normalized.leader = leader;
|
|
18750
18756
|
}
|
|
18757
|
+
const originalPos = pickNumber(tabObj.originalPos);
|
|
18758
|
+
if (originalPos != null && Number.isFinite(originalPos)) {
|
|
18759
|
+
normalized.originalPos = originalPos;
|
|
18760
|
+
}
|
|
18761
|
+
unwrapped.push(normalized);
|
|
18762
|
+
continue;
|
|
18751
18763
|
}
|
|
18752
|
-
|
|
18753
|
-
|
|
18764
|
+
const entryRecord = entry;
|
|
18765
|
+
const hasValidStructure = ("val" in entryRecord || "tabType" in entryRecord) && ("pos" in entryRecord || "originalPos" in entryRecord);
|
|
18766
|
+
if (hasValidStructure) {
|
|
18767
|
+
unwrapped.push(entryRecord);
|
|
18754
18768
|
}
|
|
18755
18769
|
}
|
|
18756
18770
|
return unwrapped.length > 0 ? unwrapped : void 0;
|
|
@@ -26585,7 +26599,7 @@ const resolveTableCellBorders = (tableBorders, rowIndex, colIndex, totalRows, to
|
|
|
26585
26599
|
};
|
|
26586
26600
|
};
|
|
26587
26601
|
const renderTableCell = (deps) => {
|
|
26588
|
-
const { doc: doc2, x, y, rowHeight, cellMeasure, cell, borders,
|
|
26602
|
+
const { doc: doc2, x, y, rowHeight, cellMeasure, cell, borders, renderLine, context, applySdtDataset } = deps;
|
|
26589
26603
|
const cellEl = doc2.createElement("div");
|
|
26590
26604
|
cellEl.style.position = "absolute";
|
|
26591
26605
|
cellEl.style.left = `${x}px`;
|
|
@@ -26595,8 +26609,6 @@ const renderTableCell = (deps) => {
|
|
|
26595
26609
|
cellEl.style.boxSizing = "border-box";
|
|
26596
26610
|
if (borders) {
|
|
26597
26611
|
applyCellBorders(cellEl, borders);
|
|
26598
|
-
} else if (useDefaultBorder) {
|
|
26599
|
-
cellEl.style.border = "1px solid rgba(0,0,0,0.6)";
|
|
26600
26612
|
}
|
|
26601
26613
|
if (cell?.attrs?.background) {
|
|
26602
26614
|
cellEl.style.backgroundColor = cell.attrs.background;
|
|
@@ -26638,25 +26650,55 @@ const renderTableRow = (deps) => {
|
|
|
26638
26650
|
row,
|
|
26639
26651
|
totalRows,
|
|
26640
26652
|
tableBorders,
|
|
26653
|
+
columnWidths,
|
|
26654
|
+
allRowHeights,
|
|
26641
26655
|
context,
|
|
26642
26656
|
renderLine,
|
|
26643
26657
|
applySdtDataset
|
|
26644
26658
|
} = deps;
|
|
26645
|
-
|
|
26659
|
+
const calculateXPosition = (gridColumnStart) => {
|
|
26660
|
+
let x = 0;
|
|
26661
|
+
for (let i = 0; i < gridColumnStart && i < columnWidths.length; i++) {
|
|
26662
|
+
x += columnWidths[i];
|
|
26663
|
+
}
|
|
26664
|
+
return x;
|
|
26665
|
+
};
|
|
26666
|
+
const calculateRowspanHeight = (startRowIndex, rowSpan) => {
|
|
26667
|
+
let totalHeight = 0;
|
|
26668
|
+
for (let i = 0; i < rowSpan && startRowIndex + i < allRowHeights.length; i++) {
|
|
26669
|
+
totalHeight += allRowHeights[startRowIndex + i];
|
|
26670
|
+
}
|
|
26671
|
+
return totalHeight;
|
|
26672
|
+
};
|
|
26646
26673
|
for (let cellIndex = 0; cellIndex < rowMeasure.cells.length; cellIndex += 1) {
|
|
26647
26674
|
const cellMeasure = rowMeasure.cells[cellIndex];
|
|
26648
26675
|
const cell = row?.cells?.[cellIndex];
|
|
26649
|
-
const
|
|
26650
|
-
const
|
|
26676
|
+
const x = cellMeasure.gridColumnStart != null ? calculateXPosition(cellMeasure.gridColumnStart) : cellIndex === 0 ? 0 : calculateXPosition(cellIndex);
|
|
26677
|
+
const cellBordersAttr = cell?.attrs?.borders;
|
|
26678
|
+
const hasBordersAttribute = cellBordersAttr !== void 0;
|
|
26679
|
+
const hasExplicitBorders = hasBordersAttribute && cellBordersAttr && (cellBordersAttr.top !== void 0 || cellBordersAttr.right !== void 0 || cellBordersAttr.bottom !== void 0 || cellBordersAttr.left !== void 0);
|
|
26680
|
+
const gridColIndex = cellMeasure.gridColumnStart ?? cellIndex;
|
|
26681
|
+
const totalCols = columnWidths.length;
|
|
26682
|
+
let resolvedBorders;
|
|
26683
|
+
if (hasExplicitBorders) {
|
|
26684
|
+
resolvedBorders = cellBordersAttr;
|
|
26685
|
+
} else if (hasBordersAttribute) {
|
|
26686
|
+
resolvedBorders = void 0;
|
|
26687
|
+
} else if (tableBorders) {
|
|
26688
|
+
resolvedBorders = resolveTableCellBorders(tableBorders, rowIndex, gridColIndex, totalRows, totalCols);
|
|
26689
|
+
} else {
|
|
26690
|
+
resolvedBorders = void 0;
|
|
26691
|
+
}
|
|
26692
|
+
const rowSpan = cellMeasure.rowSpan ?? 1;
|
|
26693
|
+
const cellHeight = rowSpan > 1 ? calculateRowspanHeight(rowIndex, rowSpan) : rowMeasure.height;
|
|
26651
26694
|
const { cellElement, contentElement } = renderTableCell({
|
|
26652
26695
|
doc: doc2,
|
|
26653
26696
|
x,
|
|
26654
26697
|
y,
|
|
26655
|
-
rowHeight:
|
|
26698
|
+
rowHeight: cellHeight,
|
|
26656
26699
|
cellMeasure,
|
|
26657
26700
|
cell,
|
|
26658
26701
|
borders: resolvedBorders,
|
|
26659
|
-
useDefaultBorder: !hasExplicitBorders && !tableBorders,
|
|
26660
26702
|
renderLine,
|
|
26661
26703
|
context,
|
|
26662
26704
|
applySdtDataset
|
|
@@ -26665,7 +26707,6 @@ const renderTableRow = (deps) => {
|
|
|
26665
26707
|
if (contentElement) {
|
|
26666
26708
|
container.appendChild(contentElement);
|
|
26667
26709
|
}
|
|
26668
|
-
x += cellMeasure.width;
|
|
26669
26710
|
}
|
|
26670
26711
|
};
|
|
26671
26712
|
const renderTableFragment = (deps) => {
|
|
@@ -26707,6 +26748,45 @@ const renderTableFragment = (deps) => {
|
|
|
26707
26748
|
applySdtDataset(container, block.attrs?.sdt);
|
|
26708
26749
|
container.classList.add("superdoc-table-fragment");
|
|
26709
26750
|
if (fragment.metadata?.columnBoundaries) {
|
|
26751
|
+
const columnCount = measure.columnWidths.length;
|
|
26752
|
+
const rowCount = block.rows.length;
|
|
26753
|
+
const boundarySegments = [];
|
|
26754
|
+
for (let i = 0; i < columnCount; i++) {
|
|
26755
|
+
boundarySegments.push([]);
|
|
26756
|
+
}
|
|
26757
|
+
let rowY = 0;
|
|
26758
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
26759
|
+
const rowMeasure = measure.rows[rowIndex];
|
|
26760
|
+
if (!rowMeasure) continue;
|
|
26761
|
+
const boundariesInRow = /* @__PURE__ */ new Set();
|
|
26762
|
+
for (const cellMeasure of rowMeasure.cells) {
|
|
26763
|
+
const startCol = cellMeasure.gridColumnStart ?? 0;
|
|
26764
|
+
const colSpan = cellMeasure.colSpan ?? 1;
|
|
26765
|
+
const endCol = startCol + colSpan;
|
|
26766
|
+
if (startCol > 0) {
|
|
26767
|
+
boundariesInRow.add(startCol);
|
|
26768
|
+
}
|
|
26769
|
+
if (endCol < columnCount) {
|
|
26770
|
+
boundariesInRow.add(endCol);
|
|
26771
|
+
}
|
|
26772
|
+
}
|
|
26773
|
+
for (const boundaryCol of boundariesInRow) {
|
|
26774
|
+
const segments = boundarySegments[boundaryCol];
|
|
26775
|
+
const lastSegment = segments[segments.length - 1];
|
|
26776
|
+
if (lastSegment && lastSegment.toRow === rowIndex) {
|
|
26777
|
+
lastSegment.toRow = rowIndex + 1;
|
|
26778
|
+
lastSegment.height += rowMeasure.height;
|
|
26779
|
+
} else {
|
|
26780
|
+
segments.push({
|
|
26781
|
+
fromRow: rowIndex,
|
|
26782
|
+
toRow: rowIndex + 1,
|
|
26783
|
+
y: rowY,
|
|
26784
|
+
height: rowMeasure.height
|
|
26785
|
+
});
|
|
26786
|
+
}
|
|
26787
|
+
}
|
|
26788
|
+
rowY += rowMeasure.height;
|
|
26789
|
+
}
|
|
26710
26790
|
const metadata = {
|
|
26711
26791
|
columns: fragment.metadata.columnBoundaries.map((boundary) => ({
|
|
26712
26792
|
i: boundary.index,
|
|
@@ -26714,7 +26794,18 @@ const renderTableFragment = (deps) => {
|
|
|
26714
26794
|
w: boundary.width,
|
|
26715
26795
|
min: boundary.minWidth,
|
|
26716
26796
|
r: boundary.resizable ? 1 : 0
|
|
26717
|
-
}))
|
|
26797
|
+
})),
|
|
26798
|
+
// Add segments for each column boundary (segments where resize handle should appear)
|
|
26799
|
+
segments: boundarySegments.map(
|
|
26800
|
+
(segs, colIndex) => segs.map((seg) => ({
|
|
26801
|
+
c: colIndex,
|
|
26802
|
+
// column index
|
|
26803
|
+
y: seg.y,
|
|
26804
|
+
// y position
|
|
26805
|
+
h: seg.height
|
|
26806
|
+
// height of segment
|
|
26807
|
+
}))
|
|
26808
|
+
)
|
|
26718
26809
|
};
|
|
26719
26810
|
container.setAttribute("data-table-boundaries", JSON.stringify(metadata));
|
|
26720
26811
|
}
|
|
@@ -26725,6 +26816,7 @@ const renderTableFragment = (deps) => {
|
|
|
26725
26816
|
if (borderCollapse === "separate" && block.attrs?.cellSpacing) {
|
|
26726
26817
|
container.style.borderSpacing = `${block.attrs.cellSpacing}px`;
|
|
26727
26818
|
}
|
|
26819
|
+
const allRowHeights = measure.rows.map((r2) => r2.height);
|
|
26728
26820
|
let y = 0;
|
|
26729
26821
|
for (let r2 = fragment.fromRow; r2 < fragment.toRow; r2 += 1) {
|
|
26730
26822
|
const rowMeasure = measure.rows[r2];
|
|
@@ -26738,6 +26830,8 @@ const renderTableFragment = (deps) => {
|
|
|
26738
26830
|
row: block.rows[r2],
|
|
26739
26831
|
totalRows: block.rows.length,
|
|
26740
26832
|
tableBorders,
|
|
26833
|
+
columnWidths: measure.columnWidths,
|
|
26834
|
+
allRowHeights,
|
|
26741
26835
|
context,
|
|
26742
26836
|
renderLine,
|
|
26743
26837
|
applySdtDataset
|
|
@@ -29379,21 +29473,9 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
29379
29473
|
}
|
|
29380
29474
|
async function measureTableBlock(block, constraints) {
|
|
29381
29475
|
const maxWidth = typeof constraints === "number" ? constraints : constraints.maxWidth;
|
|
29382
|
-
const columnCount = Math.max(1, Math.max(...block.rows.map((r2) => r2.cells.length)));
|
|
29383
29476
|
let columnWidths;
|
|
29384
29477
|
if (block.columnWidths && block.columnWidths.length > 0) {
|
|
29385
29478
|
columnWidths = [...block.columnWidths];
|
|
29386
|
-
if (columnWidths.length < columnCount) {
|
|
29387
|
-
const usedWidth = columnWidths.reduce((a, b) => a + b, 0);
|
|
29388
|
-
const remainingWidth = Math.max(0, maxWidth - usedWidth);
|
|
29389
|
-
const missingCount = columnCount - columnWidths.length;
|
|
29390
|
-
const defaultWidth = missingCount > 0 ? Math.max(1, Math.floor(remainingWidth / missingCount)) : 0;
|
|
29391
|
-
for (let i = columnWidths.length; i < columnCount; i++) {
|
|
29392
|
-
columnWidths.push(defaultWidth);
|
|
29393
|
-
}
|
|
29394
|
-
} else if (columnWidths.length > columnCount) {
|
|
29395
|
-
columnWidths = columnWidths.slice(0, columnCount);
|
|
29396
|
-
}
|
|
29397
29479
|
const totalWidth2 = columnWidths.reduce((a, b) => a + b, 0);
|
|
29398
29480
|
const hasExplicitWidth = block.attrs?.tableWidth != null;
|
|
29399
29481
|
if (!hasExplicitWidth && totalWidth2 > maxWidth) {
|
|
@@ -29401,22 +29483,56 @@ async function measureTableBlock(block, constraints) {
|
|
|
29401
29483
|
columnWidths = columnWidths.map((w) => Math.max(1, Math.floor(w * scale)));
|
|
29402
29484
|
}
|
|
29403
29485
|
} else {
|
|
29404
|
-
const
|
|
29405
|
-
|
|
29486
|
+
const maxCellCount = Math.max(1, Math.max(...block.rows.map((r2) => r2.cells.length)));
|
|
29487
|
+
const columnWidth = Math.max(1, Math.floor(maxWidth / maxCellCount));
|
|
29488
|
+
columnWidths = Array.from({ length: maxCellCount }, () => columnWidth);
|
|
29406
29489
|
}
|
|
29490
|
+
const gridColumnCount = columnWidths.length;
|
|
29491
|
+
const calculateCellWidth = (startCol, colspan) => {
|
|
29492
|
+
let width = 0;
|
|
29493
|
+
for (let i = 0; i < colspan && startCol + i < columnWidths.length; i++) {
|
|
29494
|
+
width += columnWidths[startCol + i];
|
|
29495
|
+
}
|
|
29496
|
+
return Math.max(1, width);
|
|
29497
|
+
};
|
|
29498
|
+
const rowspanTracker = new Array(gridColumnCount).fill(0);
|
|
29407
29499
|
const rows = [];
|
|
29408
|
-
for (
|
|
29500
|
+
for (let rowIndex = 0; rowIndex < block.rows.length; rowIndex++) {
|
|
29501
|
+
const row = block.rows[rowIndex];
|
|
29409
29502
|
const cellMeasures = [];
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
const
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29503
|
+
let gridColIndex = 0;
|
|
29504
|
+
for (const cell of row.cells) {
|
|
29505
|
+
const colspan = cell.colSpan ?? 1;
|
|
29506
|
+
const rowspan = cell.rowSpan ?? 1;
|
|
29507
|
+
while (gridColIndex < gridColumnCount && rowspanTracker[gridColIndex] > 0) {
|
|
29508
|
+
rowspanTracker[gridColIndex]--;
|
|
29509
|
+
gridColIndex++;
|
|
29510
|
+
}
|
|
29511
|
+
if (gridColIndex >= gridColumnCount) {
|
|
29512
|
+
break;
|
|
29513
|
+
}
|
|
29514
|
+
const cellWidth = calculateCellWidth(gridColIndex, colspan);
|
|
29515
|
+
if (rowspan > 1) {
|
|
29516
|
+
for (let c = 0; c < colspan && gridColIndex + c < gridColumnCount; c++) {
|
|
29517
|
+
rowspanTracker[gridColIndex + c] = rowspan - 1;
|
|
29518
|
+
}
|
|
29416
29519
|
}
|
|
29417
29520
|
const paraMeasure = await measureParagraphBlock(cell.paragraph, cellWidth);
|
|
29418
29521
|
const height = paraMeasure.totalHeight;
|
|
29419
|
-
cellMeasures.push({
|
|
29522
|
+
cellMeasures.push({
|
|
29523
|
+
paragraph: paraMeasure,
|
|
29524
|
+
width: cellWidth,
|
|
29525
|
+
height,
|
|
29526
|
+
gridColumnStart: gridColIndex,
|
|
29527
|
+
colSpan: colspan,
|
|
29528
|
+
rowSpan: rowspan
|
|
29529
|
+
});
|
|
29530
|
+
gridColIndex += colspan;
|
|
29531
|
+
}
|
|
29532
|
+
for (let col = gridColIndex; col < gridColumnCount; col++) {
|
|
29533
|
+
if (rowspanTracker[col] > 0) {
|
|
29534
|
+
rowspanTracker[col]--;
|
|
29535
|
+
}
|
|
29420
29536
|
}
|
|
29421
29537
|
const rowHeight = Math.max(0, ...cellMeasures.map((c) => c.height));
|
|
29422
29538
|
rows.push({ cells: cellMeasures, height: rowHeight });
|
|
@@ -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-Y0EypB0y.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D15SNlq2.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-D15SNlq2.js";
|
|
2
|
+
import "./chunks/converter-Y0EypB0y.js";
|
|
3
|
+
import "./chunks/docx-zipper-BwRRySEU.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1889,18 +1889,18 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1889
1889
|
min-height: 40px;
|
|
1890
1890
|
}
|
|
1891
1891
|
|
|
1892
|
-
.superdoc-table-resize-overlay[data-v-
|
|
1892
|
+
.superdoc-table-resize-overlay[data-v-d4258885] {
|
|
1893
1893
|
position: absolute;
|
|
1894
1894
|
pointer-events: none;
|
|
1895
1895
|
user-select: none;
|
|
1896
1896
|
}
|
|
1897
|
-
.resize-handle[data-v-
|
|
1897
|
+
.resize-handle[data-v-d4258885] {
|
|
1898
1898
|
position: absolute;
|
|
1899
1899
|
cursor: col-resize;
|
|
1900
1900
|
user-select: none;
|
|
1901
1901
|
z-index: 15;
|
|
1902
1902
|
}
|
|
1903
|
-
.resize-handle[data-v-
|
|
1903
|
+
.resize-handle[data-v-d4258885]::before {
|
|
1904
1904
|
content: '';
|
|
1905
1905
|
position: absolute;
|
|
1906
1906
|
left: 50%;
|
|
@@ -1913,17 +1913,17 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1913
1913
|
background-color 0.2s ease,
|
|
1914
1914
|
width 0.2s ease;
|
|
1915
1915
|
}
|
|
1916
|
-
.resize-handle[data-v-
|
|
1916
|
+
.resize-handle[data-v-d4258885]:hover::before {
|
|
1917
1917
|
background-color: #4a90e2;
|
|
1918
1918
|
width: 3px;
|
|
1919
1919
|
transform: translateX(-1.5px);
|
|
1920
1920
|
}
|
|
1921
|
-
.resize-handle--active[data-v-
|
|
1921
|
+
.resize-handle--active[data-v-d4258885]::before {
|
|
1922
1922
|
background-color: #4a90e2;
|
|
1923
1923
|
width: 2px;
|
|
1924
1924
|
transform: translateX(-1px);
|
|
1925
1925
|
}
|
|
1926
|
-
.resize-guideline[data-v-
|
|
1926
|
+
.resize-guideline[data-v-d4258885] {
|
|
1927
1927
|
position: absolute;
|
|
1928
1928
|
background-color: #4a90e2;
|
|
1929
1929
|
pointer-events: none;
|
|
@@ -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-Y0EypB0y.js";
|
|
13
|
+
import { ac, i, a9 } from "./chunks/converter-Y0EypB0y.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-D15SNlq2.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-D15SNlq2.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-DFaZbHng.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-BwRRySEU.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -4945,13 +4945,31 @@ const _sfc_main$2 = {
|
|
|
4945
4945
|
});
|
|
4946
4946
|
return boundaries;
|
|
4947
4947
|
});
|
|
4948
|
-
function
|
|
4948
|
+
function getBoundarySegments(boundary) {
|
|
4949
|
+
if (boundary.type === "right-edge") {
|
|
4950
|
+
return [{ y: 0, h: null }];
|
|
4951
|
+
}
|
|
4952
|
+
const segmentsData = tableMetadata.value?.segments;
|
|
4953
|
+
if (!segmentsData || !Array.isArray(segmentsData)) {
|
|
4954
|
+
return [{ y: 0, h: null }];
|
|
4955
|
+
}
|
|
4956
|
+
const boundaryColIndex = boundary.index + 1;
|
|
4957
|
+
const colSegments = segmentsData[boundaryColIndex];
|
|
4958
|
+
if (!colSegments || colSegments.length === 0) {
|
|
4959
|
+
return [];
|
|
4960
|
+
}
|
|
4961
|
+
return colSegments.map((seg) => ({
|
|
4962
|
+
y: seg.y,
|
|
4963
|
+
h: seg.h
|
|
4964
|
+
}));
|
|
4965
|
+
}
|
|
4966
|
+
function getSegmentHandleStyle(boundary, segment) {
|
|
4949
4967
|
return {
|
|
4950
4968
|
position: "absolute",
|
|
4951
4969
|
left: `${boundary.x}px`,
|
|
4952
|
-
top: "0",
|
|
4970
|
+
top: segment.y != null ? `${segment.y}px` : "0",
|
|
4953
4971
|
width: "9px",
|
|
4954
|
-
height: "100%",
|
|
4972
|
+
height: segment.h != null ? `${segment.h}px` : "100%",
|
|
4955
4973
|
transform: "translateX(-4px)",
|
|
4956
4974
|
cursor: "col-resize",
|
|
4957
4975
|
pointerEvents: "auto"
|
|
@@ -5006,7 +5024,8 @@ const _sfc_main$2 = {
|
|
|
5006
5024
|
});
|
|
5007
5025
|
return;
|
|
5008
5026
|
}
|
|
5009
|
-
|
|
5027
|
+
const segments = Array.isArray(parsed.segments) ? parsed.segments : void 0;
|
|
5028
|
+
tableMetadata.value = { columns: validatedColumns, segments };
|
|
5010
5029
|
} catch (error) {
|
|
5011
5030
|
tableMetadata.value = null;
|
|
5012
5031
|
emit("resize-error", {
|
|
@@ -5168,7 +5187,7 @@ const _sfc_main$2 = {
|
|
|
5168
5187
|
updateCellColwidths(tr, tableNode, tablePos, affectedColumns, newWidths);
|
|
5169
5188
|
dispatch(tr);
|
|
5170
5189
|
const blockId = props.tableElement?.getAttribute("data-sd-block-id");
|
|
5171
|
-
if (blockId) {
|
|
5190
|
+
if (blockId && blockId.trim()) {
|
|
5172
5191
|
measureCache.invalidate([blockId]);
|
|
5173
5192
|
}
|
|
5174
5193
|
emit("resize-success", { columnIndex, newWidths });
|
|
@@ -5271,18 +5290,24 @@ const _sfc_main$2 = {
|
|
|
5271
5290
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5272
5291
|
}, ["stop"]))
|
|
5273
5292
|
}, [
|
|
5274
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary,
|
|
5275
|
-
return openBlock(), createElementBlock(
|
|
5276
|
-
key: `
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5293
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary, boundaryIndex) => {
|
|
5294
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
5295
|
+
key: `boundary-${boundaryIndex}`
|
|
5296
|
+
}, [
|
|
5297
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getBoundarySegments(boundary), (segment, segmentIndex) => {
|
|
5298
|
+
return openBlock(), createElementBlock("div", {
|
|
5299
|
+
key: `handle-${boundary.type}-${boundary.index}-${segmentIndex}`,
|
|
5300
|
+
class: normalizeClass(["resize-handle", {
|
|
5301
|
+
"resize-handle--active": dragState.value && dragState.value.boundaryIndex === boundaryIndex,
|
|
5302
|
+
"resize-handle--edge": boundary.type === "right-edge"
|
|
5303
|
+
}]),
|
|
5304
|
+
"data-boundary-index": boundaryIndex,
|
|
5305
|
+
"data-boundary-type": boundary.type,
|
|
5306
|
+
style: normalizeStyle(getSegmentHandleStyle(boundary, segment)),
|
|
5307
|
+
onMousedown: ($event) => onHandleMouseDown($event, boundaryIndex)
|
|
5308
|
+
}, null, 46, _hoisted_1$2);
|
|
5309
|
+
}), 128))
|
|
5310
|
+
], 64);
|
|
5286
5311
|
}), 128)),
|
|
5287
5312
|
dragState.value ? (openBlock(), createElementBlock("div", {
|
|
5288
5313
|
key: 0,
|
|
@@ -5293,7 +5318,7 @@ const _sfc_main$2 = {
|
|
|
5293
5318
|
};
|
|
5294
5319
|
}
|
|
5295
5320
|
};
|
|
5296
|
-
const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
5321
|
+
const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d4258885"]]);
|
|
5297
5322
|
function adjustPaginationBreaks(editorElem, editor) {
|
|
5298
5323
|
if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
|
|
5299
5324
|
const zoom = editor.value.options.scale;
|
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-DQQOSn_9.cjs");
|
|
4
4
|
require("./chunks/vue-ARQSyfaw.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-CvgUsCEN.es.js";
|
|
2
2
|
import "./chunks/vue-CztqUvm1.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-DQQOSn_9.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-DtZQUqqh.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;
|