superdoc 1.0.0-beta.97 → 1.0.0-beta.98
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-BHcBfUWj.es.js → PdfViewer-1_KffD-j.es.js} +1 -1
- package/dist/chunks/{PdfViewer-YvkZg201.cjs → PdfViewer-D1Ot32kX.cjs} +1 -1
- package/dist/chunks/{index-DeQfFbTb.es.js → index-CP2_WwLA.es.js} +3 -3
- package/dist/chunks/{index-DZ_AI-HW.cjs → index-CUO7gEi8.cjs} +3 -3
- package/dist/chunks/{index-Pvlqsxge-vW641SZt.es.js → index-Dg_sTYZK-D20z8mus.es.js} +1 -1
- package/dist/chunks/{index-Pvlqsxge-IH3eauKE.cjs → index-Dg_sTYZK-DYDzxoXL.cjs} +1 -1
- package/dist/chunks/{super-editor.es-BinyZw4F.es.js → super-editor.es-3dJOUw65.es.js} +113 -151
- package/dist/chunks/{super-editor.es-BP3PKkwh.cjs → super-editor.es-DN_dgBH0.cjs} +113 -151
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BEVM5t3i.js → converter-Oj-eTB79.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-vETk3IMG.js → docx-zipper-Dl188zQ3.js} +1 -1
- package/dist/super-editor/chunks/{editor-B8k1bwD_.js → editor-DBXoaaWP.js} +114 -152
- package/dist/super-editor/chunks/{index-Pvlqsxge.js → index-Dg_sTYZK.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-j1GSUGWU.js → toolbar-PlGGj0Ew.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 +115 -153
- 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, _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, _cellAnchor, _cellDragMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, getCellPosFromTableHit_fn, getTablePosFromHit_fn, shouldUseCellSelection_fn, setCellAnchor_fn, clearCellAnchor_fn, hitTestTable_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, computeExpectedSectionType_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, computeAnchorMap_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, applyDomCorrectionToRects_fn, renderCellSelectionOverlay_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-
|
|
16
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as SelectionRange, ak as Transform, al as resolveParagraphProperties, am as _getReferencedTableStyles, an as parseSizeUnit, ao as minMax, ap as updateDOMAttributes, aq as findChildren$5, ar as generateRandomSigned32BitIntStrId, as as decodeRPrFromMarks, at as calculateResolvedParagraphProperties, au as resolveRunProperties, av as encodeCSSFromPPr, aw as twipsToPixels$2, ax as encodeCSSFromRPr, ay as generateOrderedListIndex, az as docxNumberingHelpers, aA as InputRule, aB as convertSizeToCSS, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-Oj-eTB79.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-Dl188zQ3.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() {
|
|
@@ -13952,7 +13952,7 @@ const isHeadless = (editor) => {
|
|
|
13952
13952
|
const shouldSkipNodeView = (editor) => {
|
|
13953
13953
|
return isHeadless(editor);
|
|
13954
13954
|
};
|
|
13955
|
-
const summaryVersion = "1.0.0-beta.
|
|
13955
|
+
const summaryVersion = "1.0.0-beta.98";
|
|
13956
13956
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13957
13957
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13958
13958
|
function mapAttributes(attrs) {
|
|
@@ -14744,7 +14744,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14744
14744
|
{ default: remarkStringify },
|
|
14745
14745
|
{ default: remarkGfm }
|
|
14746
14746
|
] = await Promise.all([
|
|
14747
|
-
import("./index-
|
|
14747
|
+
import("./index-Dg_sTYZK.js"),
|
|
14748
14748
|
import("./index-DRCvimau.js"),
|
|
14749
14749
|
import("./index-C_x_N6Uh.js"),
|
|
14750
14750
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14949,7 +14949,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14949
14949
|
* Process collaboration migrations
|
|
14950
14950
|
*/
|
|
14951
14951
|
processCollaborationMigrations() {
|
|
14952
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14952
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.98");
|
|
14953
14953
|
if (!this.options.ydoc) return;
|
|
14954
14954
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14955
14955
|
let docVersion = metaMap.get("version");
|
|
@@ -17415,14 +17415,15 @@ function extractPageSizeAndOrientation(elements) {
|
|
|
17415
17415
|
return { pageSizePx, orientation };
|
|
17416
17416
|
}
|
|
17417
17417
|
function extractFallbackMargins(elements, currentHeader, currentFooter) {
|
|
17418
|
-
if (currentHeader !== void 0 && currentFooter !== void 0) {
|
|
17419
|
-
return { headerPx: currentHeader, footerPx: currentFooter };
|
|
17420
|
-
}
|
|
17421
17418
|
const pgMar = elements.find((el) => el?.name === "w:pgMar");
|
|
17422
17419
|
const a = pgMar?.attributes || {};
|
|
17423
17420
|
return {
|
|
17424
17421
|
headerPx: currentHeader ?? (a["w:header"] != null ? twipsToPixels$1(a["w:header"]) : void 0),
|
|
17425
|
-
footerPx: currentFooter ?? (a["w:footer"] != null ? twipsToPixels$1(a["w:footer"]) : void 0)
|
|
17422
|
+
footerPx: currentFooter ?? (a["w:footer"] != null ? twipsToPixels$1(a["w:footer"]) : void 0),
|
|
17423
|
+
topPx: a["w:top"] != null ? twipsToPixels$1(a["w:top"]) : void 0,
|
|
17424
|
+
rightPx: a["w:right"] != null ? twipsToPixels$1(a["w:right"]) : void 0,
|
|
17425
|
+
bottomPx: a["w:bottom"] != null ? twipsToPixels$1(a["w:bottom"]) : void 0,
|
|
17426
|
+
leftPx: a["w:left"] != null ? twipsToPixels$1(a["w:left"]) : void 0
|
|
17426
17427
|
};
|
|
17427
17428
|
}
|
|
17428
17429
|
function extractHeaderFooterRefs(elements, refName) {
|
|
@@ -17483,7 +17484,10 @@ function extractSectionData(para) {
|
|
|
17483
17484
|
const type = extractSectionType(sectPrElements);
|
|
17484
17485
|
const { pageSizePx, orientation } = extractPageSizeAndOrientation(sectPrElements);
|
|
17485
17486
|
const titlePg = sectPrElements.some((el) => el?.name === "w:titlePg");
|
|
17486
|
-
|
|
17487
|
+
const fallbackMargins = extractFallbackMargins(sectPrElements, headerPx, footerPx);
|
|
17488
|
+
headerPx = fallbackMargins.headerPx;
|
|
17489
|
+
footerPx = fallbackMargins.footerPx;
|
|
17490
|
+
const { topPx, rightPx, bottomPx, leftPx } = fallbackMargins;
|
|
17487
17491
|
const headerRefs = extractHeaderFooterRefs(sectPrElements, "w:headerReference");
|
|
17488
17492
|
const footerRefs = extractHeaderFooterRefs(sectPrElements, "w:footerReference");
|
|
17489
17493
|
const numbering = extractPageNumbering(sectPrElements);
|
|
@@ -17492,6 +17496,10 @@ function extractSectionData(para) {
|
|
|
17492
17496
|
return {
|
|
17493
17497
|
headerPx,
|
|
17494
17498
|
footerPx,
|
|
17499
|
+
topPx,
|
|
17500
|
+
rightPx,
|
|
17501
|
+
bottomPx,
|
|
17502
|
+
leftPx,
|
|
17495
17503
|
type,
|
|
17496
17504
|
pageSizePx,
|
|
17497
17505
|
orientation,
|
|
@@ -17603,7 +17611,14 @@ function buildSectionRangesFromParagraphs(paragraphs, hasBodySectPr) {
|
|
|
17603
17611
|
startParagraphIndex: currentStart,
|
|
17604
17612
|
endParagraphIndex: item.index,
|
|
17605
17613
|
sectPr,
|
|
17606
|
-
margins: sectionData.headerPx != null || sectionData.footerPx != null ? {
|
|
17614
|
+
margins: sectionData.headerPx != null || sectionData.footerPx != null ? {
|
|
17615
|
+
header: sectionData.headerPx ?? 0,
|
|
17616
|
+
footer: sectionData.footerPx ?? 0,
|
|
17617
|
+
top: sectionData.topPx,
|
|
17618
|
+
right: sectionData.rightPx,
|
|
17619
|
+
bottom: sectionData.bottomPx,
|
|
17620
|
+
left: sectionData.leftPx
|
|
17621
|
+
} : null,
|
|
17607
17622
|
pageSize: sectionData.pageSizePx ?? null,
|
|
17608
17623
|
orientation: sectionData.orientation ?? null,
|
|
17609
17624
|
columns: sectionData.columnsPx ?? null,
|
|
@@ -17645,7 +17660,14 @@ function createFinalSectionFromBodySectPr(bodySectPr, currentStart, totalParagra
|
|
|
17645
17660
|
startParagraphIndex: currentStart,
|
|
17646
17661
|
endParagraphIndex: totalParagraphs - 1,
|
|
17647
17662
|
sectPr: bodySectPr,
|
|
17648
|
-
margins: bodySectionData.headerPx != null || bodySectionData.footerPx != null ? {
|
|
17663
|
+
margins: bodySectionData.headerPx != null || bodySectionData.footerPx != null ? {
|
|
17664
|
+
header: bodySectionData.headerPx ?? 0,
|
|
17665
|
+
footer: bodySectionData.footerPx ?? 0,
|
|
17666
|
+
top: bodySectionData.topPx,
|
|
17667
|
+
right: bodySectionData.rightPx,
|
|
17668
|
+
bottom: bodySectionData.bottomPx,
|
|
17669
|
+
left: bodySectionData.leftPx
|
|
17670
|
+
} : null,
|
|
17649
17671
|
pageSize: bodySectionData.pageSizePx ?? null,
|
|
17650
17672
|
orientation: bodySectionData.orientation ?? null,
|
|
17651
17673
|
columns: bodySectionData.columnsPx ?? null,
|
|
@@ -23924,41 +23946,6 @@ const parseTableCell = (args) => {
|
|
|
23924
23946
|
}
|
|
23925
23947
|
}
|
|
23926
23948
|
}
|
|
23927
|
-
try {
|
|
23928
|
-
const blockSummaries = blocks.map((b) => {
|
|
23929
|
-
if (b.kind === "paragraph") {
|
|
23930
|
-
const runs = b.runs ?? [];
|
|
23931
|
-
const attrs = b.attrs ?? {};
|
|
23932
|
-
return {
|
|
23933
|
-
kind: "paragraph",
|
|
23934
|
-
runKinds: runs.map((r2) => r2.kind ?? "text"),
|
|
23935
|
-
runCount: runs.length,
|
|
23936
|
-
runPreview: runs.map((r2) => {
|
|
23937
|
-
const kind = r2.kind ?? "text";
|
|
23938
|
-
if (kind === "image") {
|
|
23939
|
-
const img = r2;
|
|
23940
|
-
return { kind, src: img.src, width: img.width, height: img.height };
|
|
23941
|
-
}
|
|
23942
|
-
return { kind };
|
|
23943
|
-
}),
|
|
23944
|
-
hasNumbering: Boolean(attrs.numberingProperties),
|
|
23945
|
-
markerText: attrs.wordLayout?.marker?.markerText
|
|
23946
|
-
};
|
|
23947
|
-
}
|
|
23948
|
-
return { kind: b.kind };
|
|
23949
|
-
});
|
|
23950
|
-
console.log(
|
|
23951
|
-
"[tableNodeToBlock.parseTableCell] cell contents",
|
|
23952
|
-
JSON.stringify({
|
|
23953
|
-
cellIndex,
|
|
23954
|
-
rowIndex,
|
|
23955
|
-
cellIdPreview: `cell-${rowIndex}-${cellIndex}`,
|
|
23956
|
-
childTypes: cellNode.content.map((c) => c?.type),
|
|
23957
|
-
blocks: blockSummaries
|
|
23958
|
-
})
|
|
23959
|
-
);
|
|
23960
|
-
} catch {
|
|
23961
|
-
}
|
|
23962
23949
|
if (blocks.length === 0) {
|
|
23963
23950
|
return null;
|
|
23964
23951
|
}
|
|
@@ -27823,20 +27810,6 @@ const renderTableCell = (deps) => {
|
|
|
27823
27810
|
}
|
|
27824
27811
|
const cellBlocks = cell?.blocks ?? (cell?.paragraph ? [cell.paragraph] : []);
|
|
27825
27812
|
const blockMeasures = cellMeasure?.blocks ?? (cellMeasure?.paragraph ? [cellMeasure.paragraph] : []);
|
|
27826
|
-
try {
|
|
27827
|
-
console.log(
|
|
27828
|
-
"[DomPainter.renderTableCell] cell render input",
|
|
27829
|
-
JSON.stringify({
|
|
27830
|
-
cellId: cell?.id,
|
|
27831
|
-
blockKinds: cellBlocks.map((b) => b.kind),
|
|
27832
|
-
measureKinds: blockMeasures.map((m) => m.kind),
|
|
27833
|
-
width: cellMeasure?.width,
|
|
27834
|
-
height: cellMeasure?.height,
|
|
27835
|
-
rowHeight
|
|
27836
|
-
})
|
|
27837
|
-
);
|
|
27838
|
-
} catch {
|
|
27839
|
-
}
|
|
27840
27813
|
if (cellBlocks.length > 0 && blockMeasures.length > 0) {
|
|
27841
27814
|
const content = doc2.createElement("div");
|
|
27842
27815
|
content.style.position = "relative";
|
|
@@ -27869,15 +27842,6 @@ const renderTableCell = (deps) => {
|
|
|
27869
27842
|
const blockMeasure = blockMeasures[i];
|
|
27870
27843
|
const block = cellBlocks[i];
|
|
27871
27844
|
if (blockMeasure.kind === "image" && block?.kind === "image") {
|
|
27872
|
-
console.log(
|
|
27873
|
-
"[DomPainter.renderTableCell] rendering image block in cell",
|
|
27874
|
-
JSON.stringify({
|
|
27875
|
-
cellId: cell?.id,
|
|
27876
|
-
blockId: block.id,
|
|
27877
|
-
width: blockMeasure.width,
|
|
27878
|
-
height: blockMeasure.height
|
|
27879
|
-
})
|
|
27880
|
-
);
|
|
27881
27845
|
const imageWrapper = doc2.createElement("div");
|
|
27882
27846
|
imageWrapper.style.position = "relative";
|
|
27883
27847
|
imageWrapper.style.width = `${blockMeasure.width}px`;
|
|
@@ -27900,16 +27864,6 @@ const renderTableCell = (deps) => {
|
|
|
27900
27864
|
continue;
|
|
27901
27865
|
}
|
|
27902
27866
|
if (blockMeasure.kind === "drawing" && block?.kind === "drawing") {
|
|
27903
|
-
console.log(
|
|
27904
|
-
"[DomPainter.renderTableCell] rendering drawing block in cell",
|
|
27905
|
-
JSON.stringify({
|
|
27906
|
-
cellId: cell?.id,
|
|
27907
|
-
blockId: block.id,
|
|
27908
|
-
drawingKind: block.drawingKind,
|
|
27909
|
-
width: blockMeasure.width,
|
|
27910
|
-
height: blockMeasure.height
|
|
27911
|
-
})
|
|
27912
|
-
);
|
|
27913
27867
|
const drawingWrapper = doc2.createElement("div");
|
|
27914
27868
|
drawingWrapper.style.position = "relative";
|
|
27915
27869
|
drawingWrapper.style.width = `${blockMeasure.width}px`;
|
|
@@ -27952,20 +27906,6 @@ const renderTableCell = (deps) => {
|
|
|
27952
27906
|
continue;
|
|
27953
27907
|
}
|
|
27954
27908
|
if (blockMeasure.kind === "paragraph" && block?.kind === "paragraph") {
|
|
27955
|
-
try {
|
|
27956
|
-
const runKinds = (block.runs ?? []).map((r2) => r2.kind ?? "text");
|
|
27957
|
-
const imageRuns = (block.runs ?? []).filter((r2) => r2.kind === "image").map((r2) => ({ src: r2.src }));
|
|
27958
|
-
console.log(
|
|
27959
|
-
"[DomPainter.renderTableCell] rendering paragraph block in cell",
|
|
27960
|
-
JSON.stringify({
|
|
27961
|
-
cellId: cell?.id,
|
|
27962
|
-
blockId: block.id,
|
|
27963
|
-
runKinds,
|
|
27964
|
-
imageRuns
|
|
27965
|
-
})
|
|
27966
|
-
);
|
|
27967
|
-
} catch {
|
|
27968
|
-
}
|
|
27969
27909
|
const paragraphMeasure = blockMeasure;
|
|
27970
27910
|
const lines = paragraphMeasure.lines;
|
|
27971
27911
|
const blockLineCount = lines?.length || 0;
|
|
@@ -29780,7 +29720,9 @@ const _DomPainter = class _DomPainter {
|
|
|
29780
29720
|
const isTocEntry = block.attrs?.isTocEntry;
|
|
29781
29721
|
const hasMarker = !fragment.continuesFromPrev && fragment.markerWidth && wordLayout?.marker;
|
|
29782
29722
|
const hasSdtContainer = block.attrs?.sdt?.type === "documentSection" || block.attrs?.sdt?.type === "structuredContent" || block.attrs?.containerSdt?.type === "documentSection" || block.attrs?.containerSdt?.type === "structuredContent";
|
|
29783
|
-
const
|
|
29723
|
+
const paraIndentForOverflow = block.attrs?.indent;
|
|
29724
|
+
const hasNegativeIndent = (paraIndentForOverflow?.left ?? 0) < 0 || (paraIndentForOverflow?.right ?? 0) < 0;
|
|
29725
|
+
const styles = isTocEntry ? { ...fragmentStyles, whiteSpace: "nowrap" } : hasMarker || hasSdtContainer || hasNegativeIndent ? { ...fragmentStyles, overflow: "visible" } : fragmentStyles;
|
|
29784
29726
|
applyStyles$2(fragmentEl, styles);
|
|
29785
29727
|
this.applyFragmentFrame(fragmentEl, fragment, context.section);
|
|
29786
29728
|
if (isTocEntry) {
|
|
@@ -29809,6 +29751,8 @@ const _DomPainter = class _DomPainter {
|
|
|
29809
29751
|
}
|
|
29810
29752
|
if (fragmentEl.style.paddingLeft) fragmentEl.style.removeProperty("padding-left");
|
|
29811
29753
|
if (fragmentEl.style.paddingRight) fragmentEl.style.removeProperty("padding-right");
|
|
29754
|
+
if (fragmentEl.style.marginLeft) fragmentEl.style.removeProperty("margin-left");
|
|
29755
|
+
if (fragmentEl.style.marginRight) fragmentEl.style.removeProperty("margin-right");
|
|
29812
29756
|
if (fragmentEl.style.textIndent) fragmentEl.style.removeProperty("text-indent");
|
|
29813
29757
|
const paraIndent = block.attrs?.indent;
|
|
29814
29758
|
const paraIndentLeft = paraIndent?.left ?? 0;
|
|
@@ -29837,16 +29781,22 @@ const _DomPainter = class _DomPainter {
|
|
|
29837
29781
|
if (!isListFirstLine) {
|
|
29838
29782
|
if (hasExplicitSegmentPositioning) {
|
|
29839
29783
|
if (isFirstLine && firstLineOffset !== 0) {
|
|
29840
|
-
const
|
|
29841
|
-
|
|
29784
|
+
const effectiveLeftIndent = paraIndentLeft < 0 ? 0 : paraIndentLeft;
|
|
29785
|
+
const adjustedPadding = effectiveLeftIndent + firstLineOffset;
|
|
29786
|
+
if (adjustedPadding > 0) {
|
|
29787
|
+
lineEl.style.paddingLeft = `${adjustedPadding}px`;
|
|
29788
|
+
}
|
|
29842
29789
|
}
|
|
29843
|
-
} else if (paraIndentLeft) {
|
|
29790
|
+
} else if (paraIndentLeft && paraIndentLeft > 0) {
|
|
29844
29791
|
lineEl.style.paddingLeft = `${paraIndentLeft}px`;
|
|
29792
|
+
} else if (!isFirstLine && paraIndent?.hanging && paraIndent.hanging > 0) {
|
|
29793
|
+
lineEl.style.paddingLeft = `${paraIndent.hanging}px`;
|
|
29845
29794
|
}
|
|
29846
29795
|
}
|
|
29847
|
-
if (paraIndentRight) {
|
|
29796
|
+
if (paraIndentRight && paraIndentRight > 0) {
|
|
29848
29797
|
lineEl.style.paddingRight = `${paraIndentRight}px`;
|
|
29849
29798
|
}
|
|
29799
|
+
const hasNegativeLeftIndent = paraIndentLeft != null && paraIndentLeft < 0;
|
|
29850
29800
|
if (!fragment.continuesFromPrev && index2 === 0 && firstLineOffset && !isListFirstLine) {
|
|
29851
29801
|
if (!hasExplicitSegmentPositioning) {
|
|
29852
29802
|
lineEl.style.textIndent = `${firstLineOffset}px`;
|
|
@@ -32131,15 +32081,18 @@ const applyParagraphBlockStyles = (element, attrs) => {
|
|
|
32131
32081
|
}
|
|
32132
32082
|
const indent = attrs.indent;
|
|
32133
32083
|
if (indent) {
|
|
32134
|
-
if (indent.left) {
|
|
32084
|
+
if (indent.left && indent.left > 0) {
|
|
32135
32085
|
element.style.paddingLeft = `${indent.left}px`;
|
|
32136
32086
|
}
|
|
32137
|
-
if (indent.right) {
|
|
32087
|
+
if (indent.right && indent.right > 0) {
|
|
32138
32088
|
element.style.paddingRight = `${indent.right}px`;
|
|
32139
32089
|
}
|
|
32140
|
-
const
|
|
32141
|
-
if (
|
|
32142
|
-
|
|
32090
|
+
const hasNegativeLeftIndent = indent.left != null && indent.left < 0;
|
|
32091
|
+
if (!hasNegativeLeftIndent) {
|
|
32092
|
+
const textIndent = (indent.firstLine ?? 0) - (indent.hanging ?? 0);
|
|
32093
|
+
if (textIndent) {
|
|
32094
|
+
element.style.textIndent = `${textIndent}px`;
|
|
32095
|
+
}
|
|
32143
32096
|
}
|
|
32144
32097
|
}
|
|
32145
32098
|
applyParagraphBorderStyles(element, attrs.borders);
|
|
@@ -33501,20 +33454,6 @@ const asSafeNumber = (value) => {
|
|
|
33501
33454
|
}
|
|
33502
33455
|
return value;
|
|
33503
33456
|
};
|
|
33504
|
-
function calculateFirstLineIndent(block, measure) {
|
|
33505
|
-
const wordLayout = block.attrs?.wordLayout;
|
|
33506
|
-
if (!wordLayout?.firstLineIndentMode) {
|
|
33507
|
-
return 0;
|
|
33508
|
-
}
|
|
33509
|
-
if (!wordLayout.marker || !measure.marker) {
|
|
33510
|
-
return 0;
|
|
33511
|
-
}
|
|
33512
|
-
const markerWidthRaw = measure.marker.markerWidth ?? wordLayout.marker.markerBoxWidthPx ?? 0;
|
|
33513
|
-
const markerWidth = Number.isFinite(markerWidthRaw) && markerWidthRaw >= 0 ? markerWidthRaw : 0;
|
|
33514
|
-
const gutterWidthRaw = measure.marker.gutterWidth ?? 0;
|
|
33515
|
-
const gutterWidth = Number.isFinite(gutterWidthRaw) && gutterWidthRaw >= 0 ? gutterWidthRaw : 0;
|
|
33516
|
-
return markerWidth + gutterWidth;
|
|
33517
|
-
}
|
|
33518
33457
|
function layoutParagraphBlock(ctx2, anchors) {
|
|
33519
33458
|
const { block, measure, columnWidth, ensurePage, advanceColumn, columnX, floatManager } = ctx2;
|
|
33520
33459
|
const remeasureParagraph2 = ctx2.remeasureParagraph;
|
|
@@ -33636,10 +33575,25 @@ function layoutParagraphBlock(ctx2, anchors) {
|
|
|
33636
33575
|
}
|
|
33637
33576
|
let lines = normalizeLines(measure);
|
|
33638
33577
|
const measurementWidth = lines[0]?.maxWidth;
|
|
33578
|
+
const paraIndent = block.attrs?.indent;
|
|
33579
|
+
const indentLeft = typeof paraIndent?.left === "number" && Number.isFinite(paraIndent.left) ? paraIndent.left : 0;
|
|
33580
|
+
const indentRight = typeof paraIndent?.right === "number" && Number.isFinite(paraIndent.right) ? paraIndent.right : 0;
|
|
33581
|
+
const negativeLeftIndent = indentLeft < 0 ? indentLeft : 0;
|
|
33582
|
+
const negativeRightIndent = indentRight < 0 ? indentRight : 0;
|
|
33583
|
+
const remeasureWidth = Math.max(1, columnWidth - indentLeft - indentRight);
|
|
33639
33584
|
let didRemeasureForColumnWidth = false;
|
|
33640
|
-
if (typeof remeasureParagraph2 === "function" && typeof measurementWidth === "number" && measurementWidth >
|
|
33641
|
-
|
|
33642
|
-
const
|
|
33585
|
+
if (typeof remeasureParagraph2 === "function" && typeof measurementWidth === "number" && measurementWidth > remeasureWidth) {
|
|
33586
|
+
let firstLineIndent = 0;
|
|
33587
|
+
const wordLayout = block.attrs?.wordLayout;
|
|
33588
|
+
if (wordLayout?.marker && measure.marker) {
|
|
33589
|
+
const markerJustification = wordLayout.marker.justification ?? "left";
|
|
33590
|
+
if (markerJustification === "left") {
|
|
33591
|
+
const markerWidth = measure.marker.markerWidth ?? 0;
|
|
33592
|
+
const gutterWidth = measure.marker.gutterWidth ?? wordLayout.marker.gutterWidthPx ?? 0;
|
|
33593
|
+
firstLineIndent = markerWidth + gutterWidth;
|
|
33594
|
+
}
|
|
33595
|
+
}
|
|
33596
|
+
const newMeasure = remeasureParagraph2(block, remeasureWidth, firstLineIndent);
|
|
33643
33597
|
lines = normalizeLines(newMeasure);
|
|
33644
33598
|
didRemeasureForColumnWidth = true;
|
|
33645
33599
|
}
|
|
@@ -33718,9 +33672,19 @@ function layoutParagraphBlock(ctx2, anchors) {
|
|
|
33718
33672
|
}
|
|
33719
33673
|
tempY += lineHeight;
|
|
33720
33674
|
}
|
|
33721
|
-
|
|
33722
|
-
|
|
33723
|
-
|
|
33675
|
+
const narrowestRemeasureWidth = Math.max(1, narrowestWidth - indentLeft - indentRight);
|
|
33676
|
+
if (narrowestRemeasureWidth < remeasureWidth) {
|
|
33677
|
+
let firstLineIndent = 0;
|
|
33678
|
+
const wordLayout = block.attrs?.wordLayout;
|
|
33679
|
+
if (wordLayout?.marker && measure.marker) {
|
|
33680
|
+
const markerJustification = wordLayout.marker.justification ?? "left";
|
|
33681
|
+
if (markerJustification === "left") {
|
|
33682
|
+
const markerWidth = measure.marker.markerWidth ?? 0;
|
|
33683
|
+
const gutterWidth = measure.marker.gutterWidth ?? wordLayout.marker.gutterWidthPx ?? 0;
|
|
33684
|
+
firstLineIndent = markerWidth + gutterWidth;
|
|
33685
|
+
}
|
|
33686
|
+
}
|
|
33687
|
+
const newMeasure = remeasureParagraph2(block, narrowestRemeasureWidth, firstLineIndent);
|
|
33724
33688
|
lines = normalizeLines(newMeasure);
|
|
33725
33689
|
didRemeasureForFloats = true;
|
|
33726
33690
|
}
|
|
@@ -33774,14 +33738,16 @@ function layoutParagraphBlock(ctx2, anchors) {
|
|
|
33774
33738
|
}
|
|
33775
33739
|
const slice2 = sliceLines(lines, fromLine, state.contentBottom - state.cursorY);
|
|
33776
33740
|
const fragmentHeight = slice2.height;
|
|
33741
|
+
const adjustedX = columnX(state.columnIndex) + offsetX + negativeLeftIndent;
|
|
33742
|
+
const adjustedWidth = effectiveColumnWidth - negativeLeftIndent - negativeRightIndent;
|
|
33777
33743
|
const fragment = {
|
|
33778
33744
|
kind: "para",
|
|
33779
33745
|
blockId: block.id,
|
|
33780
33746
|
fromLine,
|
|
33781
33747
|
toLine: slice2.toLine,
|
|
33782
|
-
x:
|
|
33748
|
+
x: adjustedX,
|
|
33783
33749
|
y: state.cursorY,
|
|
33784
|
-
width:
|
|
33750
|
+
width: adjustedWidth,
|
|
33785
33751
|
...computeFragmentPmRange(block, lines, fromLine, slice2.toLine)
|
|
33786
33752
|
};
|
|
33787
33753
|
if (didRemeasureForColumnWidth) {
|
|
@@ -37489,9 +37455,15 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
37489
37455
|
}
|
|
37490
37456
|
const DEFAULT_PAGE_SIZE$1 = { w: 612, h: 792 };
|
|
37491
37457
|
const DEFAULT_MARGINS$1 = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
37458
|
+
const normalizeMargin = (value, fallback) => Number.isFinite(value) ? value : fallback;
|
|
37492
37459
|
function resolveMeasurementConstraints(options) {
|
|
37493
37460
|
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE$1;
|
|
37494
|
-
const margins =
|
|
37461
|
+
const margins = {
|
|
37462
|
+
top: normalizeMargin(options.margins?.top, DEFAULT_MARGINS$1.top),
|
|
37463
|
+
right: normalizeMargin(options.margins?.right, DEFAULT_MARGINS$1.right),
|
|
37464
|
+
bottom: normalizeMargin(options.margins?.bottom, DEFAULT_MARGINS$1.bottom),
|
|
37465
|
+
left: normalizeMargin(options.margins?.left, DEFAULT_MARGINS$1.left)
|
|
37466
|
+
};
|
|
37495
37467
|
const contentWidth = pageSize.w - (margins.left + margins.right);
|
|
37496
37468
|
const contentHeight = pageSize.h - (margins.top + margins.bottom);
|
|
37497
37469
|
const columns = options.columns;
|
|
@@ -39029,8 +39001,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39029
39001
|
const lines = [];
|
|
39030
39002
|
const indent = block.attrs?.indent;
|
|
39031
39003
|
const spacing = block.attrs?.spacing;
|
|
39032
|
-
const indentLeft =
|
|
39033
|
-
const indentRight =
|
|
39004
|
+
const indentLeft = sanitizeIndent(indent?.left);
|
|
39005
|
+
const indentRight = sanitizeIndent(indent?.right);
|
|
39034
39006
|
const firstLine = indent?.firstLine ?? 0;
|
|
39035
39007
|
const hanging = indent?.hanging ?? 0;
|
|
39036
39008
|
const isWordLayoutList = Boolean(wordLayout?.marker);
|
|
@@ -39039,10 +39011,10 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39039
39011
|
const clampedFirstLineOffset = Math.max(0, rawFirstLineOffset);
|
|
39040
39012
|
const firstLineOffset = isWordLayoutList ? 0 : clampedFirstLineOffset;
|
|
39041
39013
|
const contentWidth = Math.max(1, maxWidth - indentLeft - indentRight);
|
|
39014
|
+
const bodyContentWidth = contentWidth;
|
|
39042
39015
|
let initialAvailableWidth;
|
|
39043
39016
|
const textStartPx = wordLayout?.textStartPx;
|
|
39044
|
-
|
|
39045
|
-
if (typeof textStartPx === "number" && textStartPx > indentLeft && !treatAsHanging) {
|
|
39017
|
+
if (typeof textStartPx === "number" && textStartPx > indentLeft) {
|
|
39046
39018
|
initialAvailableWidth = Math.max(1, maxWidth - textStartPx - indentRight);
|
|
39047
39019
|
} else {
|
|
39048
39020
|
initialAvailableWidth = Math.max(1, contentWidth - firstLineOffset);
|
|
@@ -39089,21 +39061,6 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39089
39061
|
totalHeight: metrics.lineHeight
|
|
39090
39062
|
};
|
|
39091
39063
|
}
|
|
39092
|
-
const isListLike = Boolean(block.attrs?.numId || wordLayout?.marker);
|
|
39093
|
-
if (isListLike) {
|
|
39094
|
-
console.log(
|
|
39095
|
-
"[measureParagraph][list]",
|
|
39096
|
-
JSON.stringify({
|
|
39097
|
-
blockId: block.id,
|
|
39098
|
-
maxWidth,
|
|
39099
|
-
indentLeft,
|
|
39100
|
-
indentRight,
|
|
39101
|
-
textStartPx: textStartPx ?? null,
|
|
39102
|
-
firstLineOffset: firstLineOffset ?? null,
|
|
39103
|
-
initialAvailableWidth
|
|
39104
|
-
})
|
|
39105
|
-
);
|
|
39106
|
-
}
|
|
39107
39064
|
let currentLine = null;
|
|
39108
39065
|
const getEffectiveWidth = (baseWidth) => {
|
|
39109
39066
|
if (dropCapMeasure && lines.length < dropCapMeasure.lines && dropCapMeasure.mode === "drop") {
|
|
@@ -39249,7 +39206,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39249
39206
|
lines.push(emptyLine);
|
|
39250
39207
|
}
|
|
39251
39208
|
const hadPreviousLine = lines.length > 0;
|
|
39252
|
-
const nextLineMaxWidth = hadPreviousLine ? getEffectiveWidth(
|
|
39209
|
+
const nextLineMaxWidth = hadPreviousLine ? getEffectiveWidth(bodyContentWidth) : getEffectiveWidth(initialAvailableWidth);
|
|
39253
39210
|
currentLine = {
|
|
39254
39211
|
fromRun: runIndex,
|
|
39255
39212
|
fromChar: 0,
|
|
@@ -39360,7 +39317,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39360
39317
|
toChar: 1,
|
|
39361
39318
|
width: imageWidth,
|
|
39362
39319
|
maxFontSize: imageHeight,
|
|
39363
|
-
maxWidth: getEffectiveWidth(
|
|
39320
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
39364
39321
|
spaceCount: 0,
|
|
39365
39322
|
segments: [
|
|
39366
39323
|
{
|
|
@@ -39449,7 +39406,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39449
39406
|
toChar: 1,
|
|
39450
39407
|
width: annotationWidth,
|
|
39451
39408
|
maxFontSize: annotationHeight,
|
|
39452
|
-
maxWidth: getEffectiveWidth(
|
|
39409
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
39453
39410
|
spaceCount: 0,
|
|
39454
39411
|
segments: [
|
|
39455
39412
|
{
|
|
@@ -39531,7 +39488,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39531
39488
|
width: spacesWidth,
|
|
39532
39489
|
maxFontSize: run.fontSize,
|
|
39533
39490
|
maxFontInfo: getFontInfoFromRun(run),
|
|
39534
|
-
maxWidth: getEffectiveWidth(
|
|
39491
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
39535
39492
|
segments: [{ runIndex, fromChar: spacesStartChar, toChar: spacesEndChar, width: spacesWidth }],
|
|
39536
39493
|
spaceCount: spacesLength
|
|
39537
39494
|
};
|
|
@@ -39594,7 +39551,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39594
39551
|
width: singleSpaceWidth,
|
|
39595
39552
|
maxFontSize: run.fontSize,
|
|
39596
39553
|
maxFontInfo: getFontInfoFromRun(run),
|
|
39597
|
-
maxWidth: getEffectiveWidth(
|
|
39554
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
39598
39555
|
segments: [{ runIndex, fromChar: spaceStartChar, toChar: spaceEndChar, width: singleSpaceWidth }],
|
|
39599
39556
|
spaceCount: 1
|
|
39600
39557
|
};
|
|
@@ -39787,7 +39744,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
39787
39744
|
width: wordOnlyWidth,
|
|
39788
39745
|
maxFontSize: run.fontSize,
|
|
39789
39746
|
maxFontInfo: getFontInfoFromRun(run),
|
|
39790
|
-
maxWidth: getEffectiveWidth(
|
|
39747
|
+
maxWidth: getEffectiveWidth(bodyContentWidth),
|
|
39791
39748
|
segments: [{ runIndex, fromChar: wordStartChar, toChar: wordEndNoSpace, width: wordOnlyWidth }],
|
|
39792
39749
|
spaceCount: 0
|
|
39793
39750
|
};
|
|
@@ -40352,6 +40309,7 @@ const resolveLineHeight = (spacing, baseLineHeight) => {
|
|
|
40352
40309
|
return Math.max(baseLineHeight, raw);
|
|
40353
40310
|
};
|
|
40354
40311
|
const sanitizePositive = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
40312
|
+
const sanitizeIndent = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
40355
40313
|
const sanitizeDecimalSeparator = (value) => {
|
|
40356
40314
|
if (value === ",") return ",";
|
|
40357
40315
|
return DEFAULT_DECIMAL_SEPARATOR;
|
|
@@ -45509,6 +45467,10 @@ resolveLayoutOptions_fn = function(blocks, sectionMetadata) {
|
|
|
45509
45467
|
const pageSize = firstSection?.pageSize ?? defaults.pageSize;
|
|
45510
45468
|
const margins = {
|
|
45511
45469
|
...defaults.margins,
|
|
45470
|
+
...firstSection?.margins?.top != null ? { top: firstSection.margins.top } : {},
|
|
45471
|
+
...firstSection?.margins?.right != null ? { right: firstSection.margins.right } : {},
|
|
45472
|
+
...firstSection?.margins?.bottom != null ? { bottom: firstSection.margins.bottom } : {},
|
|
45473
|
+
...firstSection?.margins?.left != null ? { left: firstSection.margins.left } : {},
|
|
45512
45474
|
...firstSection?.margins?.header != null ? { header: firstSection.margins.header } : {},
|
|
45513
45475
|
...firstSection?.margins?.footer != null ? { footer: firstSection.margins.footer } : {}
|
|
45514
45476
|
};
|
|
@@ -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-Oj-eTB79.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DBXoaaWP.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-DBXoaaWP.js";
|
|
2
|
+
import "./chunks/converter-Oj-eTB79.js";
|
|
3
|
+
import "./chunks/docx-zipper-Dl188zQ3.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, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an 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 generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { F, I, G, T, B, H, C } 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, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-Oj-eTB79.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-Oj-eTB79.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 generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-DBXoaaWP.js";
|
|
15
|
+
import { F, I, G, T, B, H, C } from "./chunks/editor-DBXoaaWP.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, Teleport, 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-PlGGj0Ew.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-Dl188zQ3.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-DN_dgBH0.cjs");
|
|
4
4
|
require("./chunks/vue-jWLMl8Ts.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-3dJOUw65.es.js";
|
|
2
2
|
import "./chunks/vue-Dysv_7z5.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|