superdoc 1.0.0-beta.40 → 1.0.0-beta.54
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-B5MRM8r_.es.js → PdfViewer-D_U-y4Wi.es.js} +1 -1
- package/dist/chunks/{PdfViewer-IpSRU3o0.cjs → PdfViewer-qBKjClah.cjs} +1 -1
- package/dist/chunks/{index-B9PZ8RCF.cjs → index-BKvAeQdF.cjs} +3 -3
- package/dist/chunks/{index-Dx9W6Dsv-D4FIlgW4.cjs → index-t8thQIOL-CV8VTGI4.cjs} +1 -1
- package/dist/chunks/{index-Dx9W6Dsv-DbYj9Ur7.es.js → index-t8thQIOL-vW80ABaR.es.js} +1 -1
- package/dist/chunks/{index-CJeY9b_E.es.js → index-to6_YLa7.es.js} +3 -3
- package/dist/chunks/{super-editor.es-C7wUYMFI.cjs → super-editor.es-BMiadG4G.cjs} +510 -180
- package/dist/chunks/{super-editor.es-CGmPt3mY.es.js → super-editor.es-xpC1DWhM.es.js} +510 -180
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-D6IUdu7s.js → converter-OoT4LYwQ.js} +294 -79
- package/dist/super-editor/chunks/{docx-zipper-C1WNNxUr.js → docx-zipper-Cf_hIcjC.js} +15 -11
- package/dist/super-editor/chunks/{editor-DNmem5Gg.js → editor-CqbtudGQ.js} +204 -93
- package/dist/super-editor/chunks/{index-Dx9W6Dsv.js → index-t8thQIOL.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CHc2RUXU.js → toolbar-BsfRAJ0o.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 +512 -182
- 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-OoT4LYwQ.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
|
}
|
|
@@ -2385,19 +2385,24 @@ class DocxZipper {
|
|
|
2385
2385
|
const u8 = await zipEntry.async("uint8array");
|
|
2386
2386
|
const content = ensureXmlString(u8);
|
|
2387
2387
|
this.files.push({ name, content });
|
|
2388
|
-
} else if (name.startsWith("word/media") && name !== "word/media/" || zipEntry.name.startsWith("media") && zipEntry.name !== "media/" || name.startsWith("media") && name !== "media/") {
|
|
2388
|
+
} else if (name.startsWith("word/media") && name !== "word/media/" || zipEntry.name.startsWith("media") && zipEntry.name !== "media/" || name.startsWith("media") && name !== "media/" || name.startsWith("word/embeddings") && name !== "word/embeddings/") {
|
|
2389
2389
|
if (isNode) {
|
|
2390
2390
|
const buffer = await zipEntry.async("nodebuffer");
|
|
2391
2391
|
const fileBase64 = buffer.toString("base64");
|
|
2392
2392
|
this.mediaFiles[name] = fileBase64;
|
|
2393
2393
|
} else {
|
|
2394
|
-
const blob = await zipEntry.async("blob");
|
|
2395
|
-
const extension = this.getFileExtension(name);
|
|
2396
2394
|
const fileBase64 = await zipEntry.async("base64");
|
|
2397
|
-
this.
|
|
2398
|
-
const
|
|
2399
|
-
|
|
2400
|
-
|
|
2395
|
+
const extension = this.getFileExtension(name)?.toLowerCase();
|
|
2396
|
+
const imageTypes = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "tiff", "emf", "wmf", "svg", "webp"]);
|
|
2397
|
+
if (imageTypes.has(extension)) {
|
|
2398
|
+
this.mediaFiles[name] = `data:image/${extension};base64,${fileBase64}`;
|
|
2399
|
+
const blob = await zipEntry.async("blob");
|
|
2400
|
+
const fileObj = new File([blob], name, { type: blob.type });
|
|
2401
|
+
const imageUrl = URL.createObjectURL(fileObj);
|
|
2402
|
+
this.media[name] = imageUrl;
|
|
2403
|
+
} else {
|
|
2404
|
+
this.mediaFiles[name] = fileBase64;
|
|
2405
|
+
}
|
|
2401
2406
|
}
|
|
2402
2407
|
} else if (name.startsWith("word/fonts") && name !== "word/fonts/") {
|
|
2403
2408
|
const uint8array = await zipEntry.async("uint8array");
|
|
@@ -2416,9 +2421,8 @@ class DocxZipper {
|
|
|
2416
2421
|
*/
|
|
2417
2422
|
async updateContentTypes(docx, media, fromJson, updatedDocs = {}) {
|
|
2418
2423
|
const additionalPartNames = Object.keys(updatedDocs || {});
|
|
2419
|
-
const
|
|
2420
|
-
|
|
2421
|
-
}).filter(Boolean);
|
|
2424
|
+
const imageExts = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "tiff", "emf", "wmf", "svg", "webp"]);
|
|
2425
|
+
const newMediaTypes = Object.keys(media).map((name) => this.getFileExtension(name)).filter((ext) => ext && imageExts.has(ext));
|
|
2422
2426
|
const contentTypesPath = "[Content_Types].xml";
|
|
2423
2427
|
let contentTypesXml;
|
|
2424
2428
|
if (fromJson) {
|
|
@@ -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 encodeCSSFromPPr, at as twipsToPixels$2, au as resolveRunProperties, 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-
|
|
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 encodeCSSFromPPr, at as twipsToPixels$2, au as resolveRunProperties, 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-OoT4LYwQ.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-Cf_hIcjC.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.54";
|
|
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-t8thQIOL.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.54");
|
|
14919
14919
|
if (!this.options.ydoc) return;
|
|
14920
14920
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14921
14921
|
let docVersion = metaMap.get("version");
|
|
@@ -17462,8 +17462,8 @@ const indentPtToPx = (indent) => {
|
|
|
17462
17462
|
const hanging = ptToPx(indent.hanging);
|
|
17463
17463
|
if (left2 != null && left2 !== 0) result.left = left2;
|
|
17464
17464
|
if (right2 != null && right2 !== 0) result.right = right2;
|
|
17465
|
-
if (firstLine != null
|
|
17466
|
-
if (hanging != null
|
|
17465
|
+
if (firstLine != null) result.firstLine = firstLine;
|
|
17466
|
+
if (hanging != null) result.hanging = hanging;
|
|
17467
17467
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
17468
17468
|
};
|
|
17469
17469
|
const normalizeAlignment = (value) => {
|
|
@@ -17550,7 +17550,7 @@ const normalizePxIndent = (value) => {
|
|
|
17550
17550
|
}
|
|
17551
17551
|
});
|
|
17552
17552
|
if (!values.length) return void 0;
|
|
17553
|
-
const looksLikeTwips = values.some((val) => val >= 50 || Math.abs(val % 15) < 1e-6);
|
|
17553
|
+
const looksLikeTwips = values.some((val) => val >= 50 || val !== 0 && Math.abs(val % 15) < 1e-6);
|
|
17554
17554
|
if (looksLikeTwips) {
|
|
17555
17555
|
return void 0;
|
|
17556
17556
|
}
|
|
@@ -18435,6 +18435,7 @@ function computeWordParagraphLayout(input) {
|
|
|
18435
18435
|
const firstLinePx = indent.firstLine;
|
|
18436
18436
|
const defaultTabIntervalPx = resolveDefaultTabIntervalPx(paragraph.tabIntervalTwips, docDefaults);
|
|
18437
18437
|
const tabsPx = tabs.map((tab) => tab.position);
|
|
18438
|
+
const hasFirstLineIndent = indent.firstLine != null && Number.isFinite(indent.firstLine) && indent.firstLine > 0 && !indent.hanging;
|
|
18438
18439
|
const layout = {
|
|
18439
18440
|
indentLeftPx,
|
|
18440
18441
|
hangingPx: Math.max(hangingPxRaw, 0),
|
|
@@ -18458,9 +18459,19 @@ function computeWordParagraphLayout(input) {
|
|
|
18458
18459
|
});
|
|
18459
18460
|
const markerText = numbering.markerText ?? formatMarkerText(numbering);
|
|
18460
18461
|
const glyphWidthPx = measurement?.measureText && markerText ? measurement.measureText(markerText, buildFontCss(markerRun), { letterSpacing: markerRun.letterSpacing }) : void 0;
|
|
18461
|
-
|
|
18462
|
-
|
|
18463
|
-
|
|
18462
|
+
let markerBoxWidthPx;
|
|
18463
|
+
let markerX;
|
|
18464
|
+
if (hasFirstLineIndent) {
|
|
18465
|
+
markerBoxWidthPx = glyphWidthPx != null && glyphWidthPx > 0 ? glyphWidthPx + LIST_MARKER_GAP$2 : DEFAULT_LIST_HANGING_PX$1;
|
|
18466
|
+
markerX = indentLeftPx + (firstLinePx ?? 0);
|
|
18467
|
+
layout.textStartPx = markerX + markerBoxWidthPx;
|
|
18468
|
+
layout.hangingPx = 0;
|
|
18469
|
+
layout.firstLineIndentMode = true;
|
|
18470
|
+
} else {
|
|
18471
|
+
markerBoxWidthPx = resolveMarkerBoxWidth(hangingPxRaw, glyphWidthPx);
|
|
18472
|
+
markerX = indentLeftPx - markerBoxWidthPx;
|
|
18473
|
+
layout.hangingPx = markerBoxWidthPx;
|
|
18474
|
+
}
|
|
18464
18475
|
layout.marker = buildMarkerLayout({
|
|
18465
18476
|
numbering,
|
|
18466
18477
|
markerText,
|
|
@@ -19052,6 +19063,9 @@ const cloneIfObject = (value) => {
|
|
|
19052
19063
|
};
|
|
19053
19064
|
const { resolveSpacingIndent } = Engines;
|
|
19054
19065
|
const DEFAULT_DECIMAL_SEPARATOR$2 = ".";
|
|
19066
|
+
const isValidNumberingId = (numId) => {
|
|
19067
|
+
return numId != null && numId !== 0 && numId !== "0";
|
|
19068
|
+
};
|
|
19055
19069
|
const asOoxmlElement = (value) => {
|
|
19056
19070
|
if (!value || typeof value !== "object") return void 0;
|
|
19057
19071
|
const element = value;
|
|
@@ -19544,9 +19558,10 @@ const computeWordLayoutForParagraph = (paragraphAttrs, numberingProps, styleCont
|
|
|
19544
19558
|
let effectiveIndent = paragraphAttrs.indent;
|
|
19545
19559
|
if (numberingProps?.resolvedLevelIndent) {
|
|
19546
19560
|
const resolvedIndentPx = convertIndentTwipsToPx(numberingProps.resolvedLevelIndent);
|
|
19561
|
+
const numberingIndent = resolvedIndentPx ?? numberingProps.resolvedLevelIndent;
|
|
19547
19562
|
effectiveIndent = {
|
|
19548
|
-
...
|
|
19549
|
-
...
|
|
19563
|
+
...numberingIndent,
|
|
19564
|
+
...paragraphAttrs.indent
|
|
19550
19565
|
};
|
|
19551
19566
|
}
|
|
19552
19567
|
const resolvedTabs = toResolvedTabStops(paragraphAttrs.tabs);
|
|
@@ -19708,11 +19723,6 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
19708
19723
|
} else if (computed2.paragraph.alignment) {
|
|
19709
19724
|
paragraphAttrs.alignment = computed2.paragraph.alignment;
|
|
19710
19725
|
}
|
|
19711
|
-
const isJustified = paragraphAttrs.alignment === "justify";
|
|
19712
|
-
const hasFirstLineIndent = normalizedIndent?.firstLine && normalizedIndent.firstLine > 0;
|
|
19713
|
-
if (isJustified && hasFirstLineIndent) {
|
|
19714
|
-
paragraphAttrs.suppressFirstLineIndent = true;
|
|
19715
|
-
}
|
|
19716
19726
|
const spacingPx = spacingPtToPx(spacing, normalizedSpacing);
|
|
19717
19727
|
if (spacingPx) paragraphAttrs.spacing = spacingPx;
|
|
19718
19728
|
if (normalizedSpacing?.beforeAutospacing != null || normalizedSpacing?.afterAutospacing != null) {
|
|
@@ -19851,7 +19861,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
|
|
|
19851
19861
|
}
|
|
19852
19862
|
const numberingSource = attrs.numberingProperties ?? paragraphProps.numberingProperties ?? hydrated?.numberingProperties;
|
|
19853
19863
|
const rawNumberingProps = toAdapterNumberingProps(numberingSource);
|
|
19854
|
-
|
|
19864
|
+
const hasValidNumbering = rawNumberingProps && isValidNumberingId(rawNumberingProps.numId);
|
|
19865
|
+
if (hasValidNumbering) {
|
|
19855
19866
|
const numberingProps = rawNumberingProps;
|
|
19856
19867
|
const numId = numberingProps.numId;
|
|
19857
19868
|
const ilvl = Number.isFinite(numberingProps.ilvl) ? Math.max(0, Math.floor(Number(numberingProps.ilvl))) : 0;
|
|
@@ -26149,6 +26160,50 @@ function assertFragmentPmPositions(fragment, _context) {
|
|
|
26149
26160
|
const hasPmEnd = fragment.pmEnd != null;
|
|
26150
26161
|
globalValidationStats.record(hasPmStart, hasPmEnd);
|
|
26151
26162
|
}
|
|
26163
|
+
function isMinimalWordLayout(value) {
|
|
26164
|
+
if (typeof value !== "object" || value === null) {
|
|
26165
|
+
return false;
|
|
26166
|
+
}
|
|
26167
|
+
const obj = value;
|
|
26168
|
+
if (obj.marker !== void 0) {
|
|
26169
|
+
if (typeof obj.marker !== "object" || obj.marker === null) {
|
|
26170
|
+
return false;
|
|
26171
|
+
}
|
|
26172
|
+
const marker = obj.marker;
|
|
26173
|
+
if (marker.markerX !== void 0 && typeof marker.markerX !== "number") {
|
|
26174
|
+
return false;
|
|
26175
|
+
}
|
|
26176
|
+
if (marker.textStartX !== void 0 && typeof marker.textStartX !== "number") {
|
|
26177
|
+
return false;
|
|
26178
|
+
}
|
|
26179
|
+
}
|
|
26180
|
+
if (obj.indentLeftPx !== void 0) {
|
|
26181
|
+
if (typeof obj.indentLeftPx !== "number") {
|
|
26182
|
+
return false;
|
|
26183
|
+
}
|
|
26184
|
+
}
|
|
26185
|
+
if (obj.firstLineIndentMode !== void 0) {
|
|
26186
|
+
if (typeof obj.firstLineIndentMode !== "boolean") {
|
|
26187
|
+
return false;
|
|
26188
|
+
}
|
|
26189
|
+
}
|
|
26190
|
+
if (obj.textStartPx !== void 0) {
|
|
26191
|
+
if (typeof obj.textStartPx !== "number") {
|
|
26192
|
+
return false;
|
|
26193
|
+
}
|
|
26194
|
+
}
|
|
26195
|
+
if (obj.tabsPx !== void 0) {
|
|
26196
|
+
if (!Array.isArray(obj.tabsPx)) {
|
|
26197
|
+
return false;
|
|
26198
|
+
}
|
|
26199
|
+
for (const tab of obj.tabsPx) {
|
|
26200
|
+
if (typeof tab !== "number") {
|
|
26201
|
+
return false;
|
|
26202
|
+
}
|
|
26203
|
+
}
|
|
26204
|
+
}
|
|
26205
|
+
return true;
|
|
26206
|
+
}
|
|
26152
26207
|
const LIST_MARKER_GAP$1 = 8;
|
|
26153
26208
|
const DEFAULT_TAB_INTERVAL_PX$1 = 48;
|
|
26154
26209
|
const COMMENT_EXTERNAL_COLOR = "#B1124B";
|
|
@@ -26910,7 +26965,7 @@ const _DomPainter = class _DomPainter {
|
|
|
26910
26965
|
}
|
|
26911
26966
|
const block = lookup.block;
|
|
26912
26967
|
const measure = lookup.measure;
|
|
26913
|
-
const wordLayout = block.attrs?.wordLayout;
|
|
26968
|
+
const wordLayout = isMinimalWordLayout(block.attrs?.wordLayout) ? block.attrs.wordLayout : void 0;
|
|
26914
26969
|
const fragmentEl = this.doc.createElement("div");
|
|
26915
26970
|
fragmentEl.classList.add(CLASS_NAMES$1.fragment);
|
|
26916
26971
|
const isTocEntry = block.attrs?.isTocEntry;
|
|
@@ -26951,11 +27006,11 @@ const _DomPainter = class _DomPainter {
|
|
|
26951
27006
|
const paraIndentRight = paraIndent?.right ?? 0;
|
|
26952
27007
|
const suppressFirstLineIndent = block.attrs?.suppressFirstLineIndent === true;
|
|
26953
27008
|
const firstLineOffset = suppressFirstLineIndent ? 0 : (paraIndent?.firstLine ?? 0) - (paraIndent?.hanging ?? 0);
|
|
26954
|
-
const isListParagraph = !!(fragment.markerWidth && wordLayout?.marker);
|
|
26955
27009
|
const lastRun = block.runs.length > 0 ? block.runs[block.runs.length - 1] : null;
|
|
26956
27010
|
const paragraphEndsWithLineBreak = lastRun?.kind === "lineBreak";
|
|
26957
27011
|
lines.forEach((line, index2) => {
|
|
26958
|
-
const
|
|
27012
|
+
const fallbackAvailableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
|
|
27013
|
+
const availableWidthOverride = line.maxWidth ?? fallbackAvailableWidth;
|
|
26959
27014
|
const isLastLineOfFragment = index2 === lines.length - 1;
|
|
26960
27015
|
const isLastLineOfParagraph = isLastLineOfFragment && !fragment.continuesOnNext;
|
|
26961
27016
|
const shouldSkipJustifyForLastLine = isLastLineOfParagraph && !paragraphEndsWithLineBreak;
|
|
@@ -26965,7 +27020,7 @@ const _DomPainter = class _DomPainter {
|
|
|
26965
27020
|
context,
|
|
26966
27021
|
availableWidthOverride,
|
|
26967
27022
|
fragment.fromLine + index2,
|
|
26968
|
-
|
|
27023
|
+
shouldSkipJustifyForLastLine
|
|
26969
27024
|
);
|
|
26970
27025
|
const isListFirstLine = index2 === 0 && !fragment.continuesFromPrev && fragment.markerWidth && wordLayout?.marker;
|
|
26971
27026
|
const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
@@ -26989,8 +27044,17 @@ const _DomPainter = class _DomPainter {
|
|
|
26989
27044
|
lineEl.style.textIndent = "0px";
|
|
26990
27045
|
}
|
|
26991
27046
|
if (isListFirstLine && wordLayout?.marker && fragment.markerWidth) {
|
|
26992
|
-
const
|
|
26993
|
-
|
|
27047
|
+
const isFirstLineIndentMode = wordLayout.firstLineIndentMode === true;
|
|
27048
|
+
let markerStartPos;
|
|
27049
|
+
if (isFirstLineIndentMode && wordLayout.marker.markerX !== void 0 && Number.isFinite(wordLayout.marker.markerX)) {
|
|
27050
|
+
markerStartPos = wordLayout.marker.markerX;
|
|
27051
|
+
} else if (isFirstLineIndentMode) {
|
|
27052
|
+
markerStartPos = paraIndentLeft + (paraIndent?.firstLine ?? 0);
|
|
27053
|
+
} else {
|
|
27054
|
+
markerStartPos = paraIndentLeft - (paraIndent?.hanging ?? 0);
|
|
27055
|
+
}
|
|
27056
|
+
const validMarkerStartPos = Number.isFinite(markerStartPos) ? markerStartPos : 0;
|
|
27057
|
+
lineEl.style.paddingLeft = `${validMarkerStartPos}px`;
|
|
26994
27058
|
const markerContainer = this.doc.createElement("span");
|
|
26995
27059
|
markerContainer.style.display = "inline-block";
|
|
26996
27060
|
const markerEl = this.doc.createElement("span");
|
|
@@ -27006,7 +27070,7 @@ const _DomPainter = class _DomPainter {
|
|
|
27006
27070
|
if (markerJustification === "left") {
|
|
27007
27071
|
markerContainer.style.position = "relative";
|
|
27008
27072
|
} else {
|
|
27009
|
-
const markerLeftX =
|
|
27073
|
+
const markerLeftX = validMarkerStartPos - fragment.markerWidth;
|
|
27010
27074
|
markerContainer.style.position = "absolute";
|
|
27011
27075
|
markerContainer.style.left = `${markerLeftX}px`;
|
|
27012
27076
|
markerContainer.style.top = "0";
|
|
@@ -27031,12 +27095,36 @@ const _DomPainter = class _DomPainter {
|
|
|
27031
27095
|
const markerBoxWidth = fragment.markerWidth;
|
|
27032
27096
|
const markerTextWidth = fragment.markerTextWidth != null && isFinite(fragment.markerTextWidth) && fragment.markerTextWidth >= 0 ? fragment.markerTextWidth : markerBoxWidth;
|
|
27033
27097
|
if ((wordLayout.marker.justification ?? "left") === "left") {
|
|
27034
|
-
const currentPos =
|
|
27035
|
-
|
|
27036
|
-
|
|
27037
|
-
|
|
27038
|
-
|
|
27039
|
-
|
|
27098
|
+
const currentPos = validMarkerStartPos + markerTextWidth;
|
|
27099
|
+
if (isFirstLineIndentMode) {
|
|
27100
|
+
const explicitTabs = wordLayout.tabsPx;
|
|
27101
|
+
let targetTabStop;
|
|
27102
|
+
if (Array.isArray(explicitTabs) && explicitTabs.length > 0) {
|
|
27103
|
+
for (const tab of explicitTabs) {
|
|
27104
|
+
if (typeof tab === "number" && tab > currentPos) {
|
|
27105
|
+
targetTabStop = tab;
|
|
27106
|
+
break;
|
|
27107
|
+
}
|
|
27108
|
+
}
|
|
27109
|
+
}
|
|
27110
|
+
const textStartTarget = wordLayout.marker.textStartX !== void 0 && Number.isFinite(wordLayout.marker.textStartX) ? wordLayout.marker.textStartX : wordLayout.textStartPx;
|
|
27111
|
+
if (targetTabStop !== void 0) {
|
|
27112
|
+
tabWidth = targetTabStop - currentPos;
|
|
27113
|
+
} else if (textStartTarget !== void 0 && Number.isFinite(textStartTarget) && textStartTarget > currentPos) {
|
|
27114
|
+
tabWidth = textStartTarget - currentPos;
|
|
27115
|
+
} else {
|
|
27116
|
+
tabWidth = LIST_MARKER_GAP$1;
|
|
27117
|
+
}
|
|
27118
|
+
if (tabWidth < LIST_MARKER_GAP$1) {
|
|
27119
|
+
tabWidth = LIST_MARKER_GAP$1;
|
|
27120
|
+
}
|
|
27121
|
+
} else {
|
|
27122
|
+
const implicitTabStop = paraIndentLeft;
|
|
27123
|
+
tabWidth = implicitTabStop - currentPos;
|
|
27124
|
+
if (tabWidth < 1) {
|
|
27125
|
+
tabWidth = DEFAULT_TAB_INTERVAL_PX$1 - currentPos % DEFAULT_TAB_INTERVAL_PX$1;
|
|
27126
|
+
if (tabWidth === 0) tabWidth = DEFAULT_TAB_INTERVAL_PX$1;
|
|
27127
|
+
}
|
|
27040
27128
|
}
|
|
27041
27129
|
} else {
|
|
27042
27130
|
tabWidth = fragment.markerGutter != null && isFinite(fragment.markerGutter) ? fragment.markerGutter : typeof wordLayout.marker.gutterWidthPx === "number" && isFinite(wordLayout.marker.gutterWidthPx) && wordLayout.marker.gutterWidthPx > 0 ? wordLayout.marker.gutterWidthPx : LIST_MARKER_GAP$1;
|
|
@@ -31008,8 +31096,13 @@ function computePartialRow(rowIndex, blockRow, measure, availableHeight, fromLin
|
|
|
31008
31096
|
toLineByCell.push(cutLine);
|
|
31009
31097
|
heightByCell.push(cumulativeHeight);
|
|
31010
31098
|
}
|
|
31011
|
-
const
|
|
31012
|
-
|
|
31099
|
+
const allCellsCompleteInFirstPass = toLineByCell.every((cutLine, idx) => {
|
|
31100
|
+
const totalLines = getCellTotalLines(row.cells[idx]);
|
|
31101
|
+
return cutLine >= totalLines;
|
|
31102
|
+
});
|
|
31103
|
+
const lineAdvancements = toLineByCell.map((cutLine, idx) => cutLine - (startLines[idx] || 0));
|
|
31104
|
+
const positiveAdvancements = lineAdvancements.filter((adv) => adv > 0);
|
|
31105
|
+
const minLineAdvancement = positiveAdvancements.length > 0 ? Math.min(...positiveAdvancements) : 0;
|
|
31013
31106
|
let actualPartialHeight = 0;
|
|
31014
31107
|
let maxPaddingTotal = 0;
|
|
31015
31108
|
for (let cellIdx = 0; cellIdx < cellCount; cellIdx++) {
|
|
@@ -31019,18 +31112,17 @@ function computePartialRow(rowIndex, blockRow, measure, availableHeight, fromLin
|
|
|
31019
31112
|
const cellPadding = cellPaddings[cellIdx];
|
|
31020
31113
|
const paddingTotal = cellPadding.top + cellPadding.bottom;
|
|
31021
31114
|
maxPaddingTotal = Math.max(maxPaddingTotal, paddingTotal);
|
|
31022
|
-
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
const
|
|
31026
|
-
|
|
31027
|
-
|
|
31115
|
+
if (allCellsCompleteInFirstPass) {
|
|
31116
|
+
actualPartialHeight = Math.max(actualPartialHeight, heightByCell[cellIdx] + paddingTotal);
|
|
31117
|
+
} else {
|
|
31118
|
+
const targetLine = Math.min(startLine + minLineAdvancement, lines.length);
|
|
31119
|
+
let cumulativeHeight = 0;
|
|
31120
|
+
for (let i = startLine; i < targetLine; i++) {
|
|
31121
|
+
cumulativeHeight += lines[i].lineHeight || 0;
|
|
31028
31122
|
}
|
|
31029
|
-
|
|
31030
|
-
|
|
31123
|
+
toLineByCell[cellIdx] = targetLine;
|
|
31124
|
+
actualPartialHeight = Math.max(actualPartialHeight, cumulativeHeight + paddingTotal);
|
|
31031
31125
|
}
|
|
31032
|
-
toLineByCell[cellIdx] = cutLine;
|
|
31033
|
-
actualPartialHeight = Math.max(actualPartialHeight, cumulativeHeight + paddingTotal);
|
|
31034
31126
|
}
|
|
31035
31127
|
const madeProgress = toLineByCell.some((cutLine, idx) => cutLine > (startLines[idx] || 0));
|
|
31036
31128
|
const isFirstPart = startLines.every((l) => l === 0);
|
|
@@ -31258,7 +31350,6 @@ function layoutTableBlock({
|
|
|
31258
31350
|
} else if (!madeProgress && hadRemainingLinesBefore) {
|
|
31259
31351
|
state = advanceColumn(state);
|
|
31260
31352
|
} else {
|
|
31261
|
-
state = advanceColumn(state);
|
|
31262
31353
|
pendingPartialRow = continuationPartialRow;
|
|
31263
31354
|
}
|
|
31264
31355
|
isTableContinuation = true;
|
|
@@ -46735,6 +46826,52 @@ function createDropcapPlugin(editor) {
|
|
|
46735
46826
|
}
|
|
46736
46827
|
});
|
|
46737
46828
|
}
|
|
46829
|
+
function parseAttrs(node) {
|
|
46830
|
+
const numberingProperties = {};
|
|
46831
|
+
let indent, spacing;
|
|
46832
|
+
const { styleid: styleId, ...extraAttrs } = Array.from(node.attributes).reduce((acc, attr) => {
|
|
46833
|
+
if (attr.name === "data-num-id") {
|
|
46834
|
+
numberingProperties.numId = parseInt(attr.value);
|
|
46835
|
+
} else if (attr.name === "data-level") {
|
|
46836
|
+
numberingProperties.ilvl = parseInt(attr.value);
|
|
46837
|
+
} else if (attr.name === "data-indent") {
|
|
46838
|
+
try {
|
|
46839
|
+
indent = JSON.parse(attr.value);
|
|
46840
|
+
Object.keys(indent).forEach((key2) => {
|
|
46841
|
+
indent[key2] = Number(indent[key2]);
|
|
46842
|
+
});
|
|
46843
|
+
} catch {
|
|
46844
|
+
}
|
|
46845
|
+
} else if (attr.name === "data-spacing") {
|
|
46846
|
+
try {
|
|
46847
|
+
spacing = JSON.parse(attr.value);
|
|
46848
|
+
Object.keys(spacing).forEach((key2) => {
|
|
46849
|
+
spacing[key2] = Number(spacing[key2]);
|
|
46850
|
+
});
|
|
46851
|
+
} catch {
|
|
46852
|
+
}
|
|
46853
|
+
} else {
|
|
46854
|
+
acc[attr.name] = attr.value;
|
|
46855
|
+
}
|
|
46856
|
+
return acc;
|
|
46857
|
+
}, {});
|
|
46858
|
+
let attrs = {
|
|
46859
|
+
paragraphProperties: {
|
|
46860
|
+
styleId: styleId || null
|
|
46861
|
+
},
|
|
46862
|
+
extraAttrs
|
|
46863
|
+
};
|
|
46864
|
+
if (indent && Object.keys(indent).length > 0) {
|
|
46865
|
+
attrs.paragraphProperties.indent = indent;
|
|
46866
|
+
}
|
|
46867
|
+
if (spacing && Object.keys(spacing).length > 0) {
|
|
46868
|
+
attrs.paragraphProperties.spacing = spacing;
|
|
46869
|
+
}
|
|
46870
|
+
if (Object.keys(numberingProperties).length > 0) {
|
|
46871
|
+
attrs.paragraphProperties.numberingProperties = numberingProperties;
|
|
46872
|
+
}
|
|
46873
|
+
return attrs;
|
|
46874
|
+
}
|
|
46738
46875
|
const bulletInputRegex = /^\s*([-+*])\s$/;
|
|
46739
46876
|
const orderedInputRegex = /^(\d+)\.\s$/;
|
|
46740
46877
|
const Paragraph = OxmlNode.create({
|
|
@@ -46804,50 +46941,7 @@ const Paragraph = OxmlNode.create({
|
|
|
46804
46941
|
return [
|
|
46805
46942
|
{
|
|
46806
46943
|
tag: "p",
|
|
46807
|
-
getAttrs:
|
|
46808
|
-
const numberingProperties = {};
|
|
46809
|
-
let indent, spacing;
|
|
46810
|
-
const { styleid: styleId, ...extraAttrs } = Array.from(node.attributes).reduce((acc, attr) => {
|
|
46811
|
-
if (attr.name === "data-num-id") {
|
|
46812
|
-
numberingProperties.numId = parseInt(attr.value);
|
|
46813
|
-
} else if (attr.name === "data-level") {
|
|
46814
|
-
numberingProperties.ilvl = parseInt(attr.value);
|
|
46815
|
-
} else if (attr.name === "data-indent") {
|
|
46816
|
-
try {
|
|
46817
|
-
indent = JSON.parse(attr.value);
|
|
46818
|
-
Object.keys(indent).forEach((key2) => {
|
|
46819
|
-
indent[key2] = Number(indent[key2]);
|
|
46820
|
-
});
|
|
46821
|
-
} catch {
|
|
46822
|
-
}
|
|
46823
|
-
} else if (attr.name === "data-spacing") {
|
|
46824
|
-
try {
|
|
46825
|
-
spacing = JSON.parse(attr.value);
|
|
46826
|
-
Object.keys(spacing).forEach((key2) => {
|
|
46827
|
-
spacing[key2] = Number(spacing[key2]);
|
|
46828
|
-
});
|
|
46829
|
-
} catch {
|
|
46830
|
-
}
|
|
46831
|
-
} else {
|
|
46832
|
-
acc[attr.name] = attr.value;
|
|
46833
|
-
}
|
|
46834
|
-
return acc;
|
|
46835
|
-
}, {});
|
|
46836
|
-
if (Object.keys(numberingProperties).length > 0) {
|
|
46837
|
-
return {
|
|
46838
|
-
paragraphProperties: {
|
|
46839
|
-
numberingProperties,
|
|
46840
|
-
indent,
|
|
46841
|
-
spacing,
|
|
46842
|
-
styleId: styleId || null
|
|
46843
|
-
},
|
|
46844
|
-
extraAttrs
|
|
46845
|
-
};
|
|
46846
|
-
}
|
|
46847
|
-
return {
|
|
46848
|
-
extraAttrs
|
|
46849
|
-
};
|
|
46850
|
-
}
|
|
46944
|
+
getAttrs: parseAttrs
|
|
46851
46945
|
},
|
|
46852
46946
|
{
|
|
46853
46947
|
tag: "div",
|
|
@@ -46865,7 +46959,16 @@ const Paragraph = OxmlNode.create({
|
|
|
46865
46959
|
},
|
|
46866
46960
|
...this.options.headingLevels.map((level) => ({
|
|
46867
46961
|
tag: `h${level}`,
|
|
46868
|
-
|
|
46962
|
+
getAttrs: (node) => {
|
|
46963
|
+
let attrs = parseAttrs(node);
|
|
46964
|
+
return {
|
|
46965
|
+
...attrs,
|
|
46966
|
+
paragraphProperties: {
|
|
46967
|
+
...attrs.paragraphProperties,
|
|
46968
|
+
styleId: `Heading${level}`
|
|
46969
|
+
}
|
|
46970
|
+
};
|
|
46971
|
+
}
|
|
46869
46972
|
}))
|
|
46870
46973
|
];
|
|
46871
46974
|
},
|
|
@@ -53356,6 +53459,14 @@ const Image = Node$1.create({
|
|
|
53356
53459
|
if (!style) return {};
|
|
53357
53460
|
return { style };
|
|
53358
53461
|
}
|
|
53462
|
+
},
|
|
53463
|
+
drawingChildOrder: {
|
|
53464
|
+
default: null,
|
|
53465
|
+
rendered: false
|
|
53466
|
+
},
|
|
53467
|
+
originalDrawingChildren: {
|
|
53468
|
+
default: null,
|
|
53469
|
+
rendered: false
|
|
53359
53470
|
}
|
|
53360
53471
|
};
|
|
53361
53472
|
},
|
|
@@ -57998,11 +58109,11 @@ const getChangesByIdToResolve = (state, id) => {
|
|
|
57998
58109
|
break;
|
|
57999
58110
|
}
|
|
58000
58111
|
const [left2, right2] = direction < 0 ? [neighbor, currentChange] : [currentChange, neighbor];
|
|
58001
|
-
if (!areDirectlyConnected(left2, right2)) {
|
|
58002
|
-
break;
|
|
58003
|
-
}
|
|
58004
58112
|
const sharesId = neighbor.mark.attrs.id === matchingId;
|
|
58005
58113
|
const complementary = isComplementaryPair(currentChange.mark.type.name, neighbor.mark.type.name);
|
|
58114
|
+
if (!sharesId && !areDirectlyConnected(left2, right2)) {
|
|
58115
|
+
break;
|
|
58116
|
+
}
|
|
58006
58117
|
if (!sharesId && !complementary) {
|
|
58007
58118
|
break;
|
|
58008
58119
|
}
|
|
@@ -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-OoT4LYwQ.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CqbtudGQ.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-CqbtudGQ.js";
|
|
2
|
+
import "./chunks/converter-OoT4LYwQ.js";
|
|
3
|
+
import "./chunks/docx-zipper-Cf_hIcjC.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-OoT4LYwQ.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-OoT4LYwQ.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-CqbtudGQ.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-CqbtudGQ.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-BsfRAJ0o.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-Cf_hIcjC.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|