superdoc 1.0.0-beta.71 → 1.0.0-beta.73
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-fC8HER9x.es.js → PdfViewer-A6N1Ilp8.es.js} +1 -1
- package/dist/chunks/{PdfViewer-ByYZWEAY.cjs → PdfViewer-DBqcgXRQ.cjs} +1 -1
- package/dist/chunks/{index-DNdPLYmc-xVZ8rsAB.cjs → index-DZuRXtuO-BP5GzZkJ.cjs} +1 -1
- package/dist/chunks/{index-DNdPLYmc-BiqKDIea.es.js → index-DZuRXtuO-BpEV348M.es.js} +1 -1
- package/dist/chunks/{index-C5kk90i2.cjs → index-Dc6FhKsA.cjs} +3 -3
- package/dist/chunks/{index-dVVrZVr-.es.js → index-YCkhH3qs.es.js} +3 -3
- package/dist/chunks/{super-editor.es-DUGFHvw1.cjs → super-editor.es-CrRRbz3_.cjs} +184 -39
- package/dist/chunks/{super-editor.es-1WGVfjfp.es.js → super-editor.es-rYLAMF97.es.js} +184 -39
- package/dist/style.css +7 -8
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Cd9FToOQ.js → converter-Czwp6T-t.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-Dy4WiCTL.js → docx-zipper-BT3IILnA.js} +1 -1
- package/dist/super-editor/chunks/{editor-DO6-AGUY.js → editor-DaiVtTXo.js} +128 -33
- package/dist/super-editor/chunks/{index-DNdPLYmc.js → index-DZuRXtuO.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Dt8nFoPI.js → toolbar-DuPPWgDF.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +7 -8
- package/dist/super-editor/super-editor.es.js +63 -13
- 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 +186 -41
- 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, _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, 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, 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 resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-
|
|
16
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-Czwp6T-t.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-BT3IILnA.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() {
|
|
@@ -13923,7 +13923,7 @@ const isHeadless = (editor) => {
|
|
|
13923
13923
|
const shouldSkipNodeView = (editor) => {
|
|
13924
13924
|
return isHeadless(editor);
|
|
13925
13925
|
};
|
|
13926
|
-
const summaryVersion = "1.0.0-beta.
|
|
13926
|
+
const summaryVersion = "1.0.0-beta.73";
|
|
13927
13927
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13928
13928
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13929
13929
|
function mapAttributes(attrs) {
|
|
@@ -14715,7 +14715,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14715
14715
|
{ default: remarkStringify },
|
|
14716
14716
|
{ default: remarkGfm }
|
|
14717
14717
|
] = await Promise.all([
|
|
14718
|
-
import("./index-
|
|
14718
|
+
import("./index-DZuRXtuO.js"),
|
|
14719
14719
|
import("./index-DRCvimau.js"),
|
|
14720
14720
|
import("./index-C_x_N6Uh.js"),
|
|
14721
14721
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14920,7 +14920,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14920
14920
|
* Process collaboration migrations
|
|
14921
14921
|
*/
|
|
14922
14922
|
processCollaborationMigrations() {
|
|
14923
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14923
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.73");
|
|
14924
14924
|
if (!this.options.ydoc) return;
|
|
14925
14925
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14926
14926
|
let docVersion = metaMap.get("version");
|
|
@@ -22539,11 +22539,11 @@ const countSpaces = (text) => {
|
|
|
22539
22539
|
}
|
|
22540
22540
|
return spaces;
|
|
22541
22541
|
};
|
|
22542
|
-
const getJustifyAdjustment = (block, line, availableWidthOverride) => {
|
|
22542
|
+
const getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride) => {
|
|
22543
22543
|
if (block.kind !== "paragraph") {
|
|
22544
22544
|
return { extraPerSpace: 0, totalSpaces: 0 };
|
|
22545
22545
|
}
|
|
22546
|
-
const alignment = block.attrs?.alignment;
|
|
22546
|
+
const alignment = alignmentOverride ?? block.attrs?.alignment;
|
|
22547
22547
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
22548
22548
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
22549
22549
|
const slack = Math.max(0, availableWidth - line.width);
|
|
@@ -22622,13 +22622,13 @@ function sliceRunsForLine$1(block, line) {
|
|
|
22622
22622
|
}
|
|
22623
22623
|
return result;
|
|
22624
22624
|
}
|
|
22625
|
-
function measureCharacterX(block, line, charOffset, availableWidthOverride) {
|
|
22625
|
+
function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
|
|
22626
22626
|
const ctx2 = getMeasurementContext();
|
|
22627
22627
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: if no maxWidth, approximate available width as line width (no slack)
|
|
22628
22628
|
line.width;
|
|
22629
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
22630
|
-
const
|
|
22631
|
-
const
|
|
22629
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
22630
|
+
const alignment = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
22631
|
+
const renderedLineWidth = alignment === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
22632
22632
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
22633
22633
|
const alignmentOffset = !hasExplicitPositioning && alignment === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
22634
22634
|
if (hasExplicitPositioning && line.segments && ctx2) {
|
|
@@ -22757,13 +22757,13 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
|
|
|
22757
22757
|
}
|
|
22758
22758
|
return lastPm;
|
|
22759
22759
|
}
|
|
22760
|
-
function findCharacterAtX(block, line, x, pmStart, availableWidthOverride) {
|
|
22760
|
+
function findCharacterAtX(block, line, x, pmStart, availableWidthOverride, alignmentOverride) {
|
|
22761
22761
|
const ctx2 = getMeasurementContext();
|
|
22762
22762
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: approximate with line width when no maxWidth is present
|
|
22763
22763
|
line.width;
|
|
22764
|
-
const justify = getJustifyAdjustment(block, line, availableWidth);
|
|
22765
|
-
const
|
|
22766
|
-
const
|
|
22764
|
+
const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
|
|
22765
|
+
const alignment = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
|
|
22766
|
+
const renderedLineWidth = alignment === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
22767
22767
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
|
|
22768
22768
|
const alignmentOffset = !hasExplicitPositioning && alignment === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
|
|
22769
22769
|
if (!ctx2) {
|
|
@@ -35471,7 +35471,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
35471
35471
|
`[clickToPosition] Paragraph indents (${totalIndent}px) exceed fragment width (${fragment.width}px) for block ${fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
35472
35472
|
);
|
|
35473
35473
|
}
|
|
35474
|
-
const
|
|
35474
|
+
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
35475
|
+
const isListItem = markerWidth > 0;
|
|
35476
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
35477
|
+
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
35475
35478
|
if (pos == null) {
|
|
35476
35479
|
logClickStage("warn", "no-position", {
|
|
35477
35480
|
blockId: fragment.blockId
|
|
@@ -35513,7 +35516,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
35513
35516
|
`[clickToPosition:table] Paragraph indents (${totalIndent}px) exceed fragment width (${tableHit.fragment.width}px) for block ${tableHit.fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
35514
35517
|
);
|
|
35515
35518
|
}
|
|
35516
|
-
const
|
|
35519
|
+
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
35520
|
+
const isListItem = cellMarkerWidth > 0;
|
|
35521
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
35522
|
+
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
35517
35523
|
if (pos != null) {
|
|
35518
35524
|
logClickStage("log", "success", {
|
|
35519
35525
|
blockId: tableHit.fragment.blockId,
|
|
@@ -35669,18 +35675,19 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
35669
35675
|
if (sliceFrom >= sliceTo) return;
|
|
35670
35676
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
35671
35677
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
35672
|
-
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width);
|
|
35673
|
-
const endX = mapPmToX(block, line, charOffsetTo, fragment.width);
|
|
35674
35678
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
35679
|
+
const isListItem = markerWidth > 0;
|
|
35680
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
35681
|
+
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
35682
|
+
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
35675
35683
|
const paraIndentLeft = block.attrs?.indent?.left ?? 0;
|
|
35676
35684
|
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
35677
35685
|
const isFirstLine = index2 === fragment.fromLine;
|
|
35678
|
-
|
|
35679
|
-
|
|
35680
|
-
|
|
35681
|
-
indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
|
|
35686
|
+
let indentAdjust = paraIndentLeft;
|
|
35687
|
+
if (isFirstLine && !isListItem) {
|
|
35688
|
+
indentAdjust += firstLineOffset;
|
|
35682
35689
|
}
|
|
35683
|
-
const rectX = fragment.x +
|
|
35690
|
+
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
35684
35691
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
35685
35692
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
35686
35693
|
const rectY = fragment.y + lineOffset;
|
|
@@ -35782,6 +35789,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
35782
35789
|
let blockTopCursor = padding.top + verticalOffset;
|
|
35783
35790
|
renderedBlocks.forEach((info) => {
|
|
35784
35791
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
35792
|
+
const isListItem = paragraphMarkerWidth > 0;
|
|
35793
|
+
const alignmentOverride = isListItem ? "left" : void 0;
|
|
35794
|
+
const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
|
|
35785
35795
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
35786
35796
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
35787
35797
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -35795,9 +35805,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
35795
35805
|
const charOffsetFrom = pmPosToCharOffset(info.block, line, sliceFrom);
|
|
35796
35806
|
const charOffsetTo = pmPosToCharOffset(info.block, line, sliceTo);
|
|
35797
35807
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
35798
|
-
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth);
|
|
35799
|
-
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth);
|
|
35800
|
-
const rectX = fragment.x + cellX + padding.left +
|
|
35808
|
+
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
35809
|
+
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
35810
|
+
const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
|
|
35801
35811
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
35802
35812
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
35803
35813
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -36056,11 +36066,11 @@ const lineHeightBeforeIndex = (measure, absoluteLineIndex) => {
|
|
|
36056
36066
|
}
|
|
36057
36067
|
return height;
|
|
36058
36068
|
};
|
|
36059
|
-
const mapPointToPm = (block, line, x, isRTL, availableWidthOverride) => {
|
|
36069
|
+
const mapPointToPm = (block, line, x, isRTL, availableWidthOverride, alignmentOverride) => {
|
|
36060
36070
|
if (block.kind !== "paragraph") return null;
|
|
36061
36071
|
const range = computeLinePmRange(block, line);
|
|
36062
36072
|
if (range.pmStart == null || range.pmEnd == null) return null;
|
|
36063
|
-
const result = findCharacterAtX(block, line, x, range.pmStart, availableWidthOverride);
|
|
36073
|
+
const result = findCharacterAtX(block, line, x, range.pmStart, availableWidthOverride, alignmentOverride);
|
|
36064
36074
|
if (isRTL) {
|
|
36065
36075
|
const charOffset = result.charOffset;
|
|
36066
36076
|
const charsInLine = Math.max(1, line.toChar - line.fromChar);
|
|
@@ -36069,7 +36079,7 @@ const mapPointToPm = (block, line, x, isRTL, availableWidthOverride) => {
|
|
|
36069
36079
|
}
|
|
36070
36080
|
return result.pmPosition;
|
|
36071
36081
|
};
|
|
36072
|
-
const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
36082
|
+
const mapPmToX = (block, line, offset2, fragmentWidth, alignmentOverride) => {
|
|
36073
36083
|
if (fragmentWidth <= 0 || line.width <= 0) return 0;
|
|
36074
36084
|
let paraIndentLeft = 0;
|
|
36075
36085
|
let paraIndentRight = 0;
|
|
@@ -36086,7 +36096,7 @@ const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
|
36086
36096
|
`[mapPmToX] Paragraph indents (${totalIndent}px) exceed fragment width (${fragmentWidth}px) for block ${block.id}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
36087
36097
|
);
|
|
36088
36098
|
}
|
|
36089
|
-
return measureCharacterX(block, line, offset2, availableWidth);
|
|
36099
|
+
return measureCharacterX(block, line, offset2, availableWidth, alignmentOverride);
|
|
36090
36100
|
};
|
|
36091
36101
|
const isRtlBlock = (block) => {
|
|
36092
36102
|
if (block.kind !== "paragraph") return false;
|
|
@@ -40326,6 +40336,74 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
|
|
|
40326
40336
|
getLayoutOptions() {
|
|
40327
40337
|
return { ...__privateGet(this, _layoutOptions) };
|
|
40328
40338
|
}
|
|
40339
|
+
/**
|
|
40340
|
+
* Get the page styles for the section containing the current caret position.
|
|
40341
|
+
*
|
|
40342
|
+
* In multi-section documents, different sections can have different page sizes,
|
|
40343
|
+
* margins, and orientations. This method returns the styles for the section
|
|
40344
|
+
* where the caret is currently located, enabling section-aware UI components
|
|
40345
|
+
* like rulers to display accurate information.
|
|
40346
|
+
*
|
|
40347
|
+
* @returns Object containing:
|
|
40348
|
+
* - pageSize: { width, height } in inches
|
|
40349
|
+
* - pageMargins: { left, right, top, bottom } in inches
|
|
40350
|
+
* - sectionIndex: The current section index (0-based)
|
|
40351
|
+
* - orientation: 'portrait' or 'landscape'
|
|
40352
|
+
*
|
|
40353
|
+
* Falls back to document-level defaults if section info is unavailable.
|
|
40354
|
+
*
|
|
40355
|
+
* @example
|
|
40356
|
+
* ```typescript
|
|
40357
|
+
* const sectionStyles = presentation.getCurrentSectionPageStyles();
|
|
40358
|
+
* console.log(`Section ${sectionStyles.sectionIndex}: ${sectionStyles.pageSize.width}" x ${sectionStyles.pageSize.height}"`);
|
|
40359
|
+
* ```
|
|
40360
|
+
*/
|
|
40361
|
+
getCurrentSectionPageStyles() {
|
|
40362
|
+
const PPI = 96;
|
|
40363
|
+
const layout = __privateGet(this, _layoutState).layout;
|
|
40364
|
+
const pageIndex = __privateMethod(this, _PresentationEditor_instances, getCurrentPageIndex_fn).call(this);
|
|
40365
|
+
const page = layout?.pages?.[pageIndex];
|
|
40366
|
+
const converterStyles = __privateGet(this, _editor3).converter?.pageStyles ?? {};
|
|
40367
|
+
const defaultMargins = converterStyles.pageMargins ?? { left: 1, right: 1, top: 1, bottom: 1 };
|
|
40368
|
+
const safeMargins = {
|
|
40369
|
+
left: typeof defaultMargins.left === "number" ? defaultMargins.left : 1,
|
|
40370
|
+
right: typeof defaultMargins.right === "number" ? defaultMargins.right : 1,
|
|
40371
|
+
top: typeof defaultMargins.top === "number" ? defaultMargins.top : 1,
|
|
40372
|
+
bottom: typeof defaultMargins.bottom === "number" ? defaultMargins.bottom : 1
|
|
40373
|
+
};
|
|
40374
|
+
if (!page) {
|
|
40375
|
+
return {
|
|
40376
|
+
pageSize: { width: 8.5, height: 11 },
|
|
40377
|
+
pageMargins: safeMargins,
|
|
40378
|
+
sectionIndex: 0,
|
|
40379
|
+
orientation: "portrait"
|
|
40380
|
+
};
|
|
40381
|
+
}
|
|
40382
|
+
const pageOrientation = page.orientation === "landscape" || page.orientation === "portrait" ? page.orientation : "portrait";
|
|
40383
|
+
const standardPortrait = { w: 8.5 * PPI, h: 11 * PPI };
|
|
40384
|
+
const standardLandscape = { w: 11 * PPI, h: 8.5 * PPI };
|
|
40385
|
+
const orientationDefault = pageOrientation === "landscape" ? standardLandscape : standardPortrait;
|
|
40386
|
+
const pageWidthPx = page.size?.w ?? orientationDefault.w;
|
|
40387
|
+
const pageHeightPx = page.size?.h ?? orientationDefault.h;
|
|
40388
|
+
const marginLeftPx = page.margins?.left ?? safeMargins.left * PPI;
|
|
40389
|
+
const marginRightPx = page.margins?.right ?? safeMargins.right * PPI;
|
|
40390
|
+
const marginTopPx = page.margins?.top ?? safeMargins.top * PPI;
|
|
40391
|
+
const marginBottomPx = page.margins?.bottom ?? safeMargins.bottom * PPI;
|
|
40392
|
+
return {
|
|
40393
|
+
pageSize: {
|
|
40394
|
+
width: pageWidthPx / PPI,
|
|
40395
|
+
height: pageHeightPx / PPI
|
|
40396
|
+
},
|
|
40397
|
+
pageMargins: {
|
|
40398
|
+
left: marginLeftPx / PPI,
|
|
40399
|
+
right: marginRightPx / PPI,
|
|
40400
|
+
top: marginTopPx / PPI,
|
|
40401
|
+
bottom: marginBottomPx / PPI
|
|
40402
|
+
},
|
|
40403
|
+
sectionIndex: page.sectionIndex ?? 0,
|
|
40404
|
+
orientation: pageOrientation
|
|
40405
|
+
};
|
|
40406
|
+
}
|
|
40329
40407
|
/**
|
|
40330
40408
|
* Get current remote cursor states (normalized to absolute PM positions).
|
|
40331
40409
|
* Returns an array of cursor states for all remote collaborators, excluding the local user.
|
|
@@ -43867,9 +43945,26 @@ getCurrentPageIndex_fn = function() {
|
|
|
43867
43945
|
}
|
|
43868
43946
|
const layout = __privateGet(this, _layoutState).layout;
|
|
43869
43947
|
const selection = __privateGet(this, _editor3).state?.selection;
|
|
43870
|
-
if (!layout || !selection)
|
|
43948
|
+
if (!layout || !selection) {
|
|
43949
|
+
return 0;
|
|
43950
|
+
}
|
|
43871
43951
|
const rects = selectionToRects(layout, __privateGet(this, _layoutState).blocks, __privateGet(this, _layoutState).measures, selection.from, selection.to) ?? [];
|
|
43872
|
-
|
|
43952
|
+
if (rects.length > 0) {
|
|
43953
|
+
return rects[0]?.pageIndex ?? 0;
|
|
43954
|
+
}
|
|
43955
|
+
const pos = selection.from;
|
|
43956
|
+
for (let pageIdx = 0; pageIdx < layout.pages.length; pageIdx++) {
|
|
43957
|
+
const page = layout.pages[pageIdx];
|
|
43958
|
+
for (const fragment of page.fragments) {
|
|
43959
|
+
const frag = fragment;
|
|
43960
|
+
if (frag.pmStart != null && frag.pmEnd != null) {
|
|
43961
|
+
if (pos >= frag.pmStart && pos <= frag.pmEnd) {
|
|
43962
|
+
return pageIdx;
|
|
43963
|
+
}
|
|
43964
|
+
}
|
|
43965
|
+
}
|
|
43966
|
+
}
|
|
43967
|
+
return 0;
|
|
43873
43968
|
};
|
|
43874
43969
|
findRegionForPage_fn = function(kind, pageIndex) {
|
|
43875
43970
|
const map2 = kind === "header" ? __privateGet(this, _headerRegions) : __privateGet(this, _footerRegions);
|
|
@@ -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-Czwp6T-t.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DaiVtTXo.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-DaiVtTXo.js";
|
|
2
|
+
import "./chunks/converter-Czwp6T-t.js";
|
|
3
|
+
import "./chunks/docx-zipper-BT3IILnA.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1815,7 +1815,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1815
1815
|
margin: 4px 0;
|
|
1816
1816
|
}
|
|
1817
1817
|
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
|
|
1818
|
-
.vertical-indicator[data-v-
|
|
1818
|
+
.vertical-indicator[data-v-0d1b9cd1] {
|
|
1819
1819
|
position: absolute;
|
|
1820
1820
|
height: 0px;
|
|
1821
1821
|
min-width: 1px;
|
|
@@ -1823,7 +1823,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1823
1823
|
top: 20px;
|
|
1824
1824
|
z-index: 100;
|
|
1825
1825
|
}
|
|
1826
|
-
.margin-handle[data-v-
|
|
1826
|
+
.margin-handle[data-v-0d1b9cd1] {
|
|
1827
1827
|
width: 56px;
|
|
1828
1828
|
min-width: 5px;
|
|
1829
1829
|
max-width: 5px;
|
|
@@ -1836,10 +1836,10 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1836
1836
|
transition: background-color 250ms ease;
|
|
1837
1837
|
z-index: 10;
|
|
1838
1838
|
}
|
|
1839
|
-
.margin-handle[data-v-
|
|
1839
|
+
.margin-handle[data-v-0d1b9cd1]:hover {
|
|
1840
1840
|
background-color: var(--ruler-handle-active-color);
|
|
1841
1841
|
}
|
|
1842
|
-
.ruler[data-v-
|
|
1842
|
+
.ruler[data-v-0d1b9cd1] {
|
|
1843
1843
|
height: 25px;
|
|
1844
1844
|
width: var(--ruler-width, 8.5in);
|
|
1845
1845
|
margin: 0;
|
|
@@ -1847,14 +1847,13 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1847
1847
|
box-sizing: border-box;
|
|
1848
1848
|
position: relative;
|
|
1849
1849
|
color: #666;
|
|
1850
|
+
transition: width 150ms ease-out;
|
|
1850
1851
|
}
|
|
1851
|
-
|
|
1852
|
-
/* Tick marks - using absolute positioning from ruler-core */
|
|
1853
|
-
.ruler-tick[data-v-b9f4f30a] {
|
|
1852
|
+
.ruler-tick[data-v-0d1b9cd1] {
|
|
1854
1853
|
pointer-events: none;
|
|
1855
1854
|
user-select: none;
|
|
1856
1855
|
}
|
|
1857
|
-
.numbering[data-v-
|
|
1856
|
+
.numbering[data-v-0d1b9cd1] {
|
|
1858
1857
|
position: absolute;
|
|
1859
1858
|
top: -16px;
|
|
1860
1859
|
left: -2px;
|
|
@@ -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 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, 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-Czwp6T-t.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-Czwp6T-t.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-DaiVtTXo.js";
|
|
15
|
+
import { F, I, G, T, B, H, C } from "./chunks/editor-DaiVtTXo.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-DuPPWgDF.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-BT3IILnA.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -4640,6 +4640,7 @@ const _sfc_main$6 = {
|
|
|
4640
4640
|
const rulerHandleActiveColor = ref("#2563EB66");
|
|
4641
4641
|
const pageSize = ref(null);
|
|
4642
4642
|
const pageMargins = ref(null);
|
|
4643
|
+
const currentSectionIndex = ref(0);
|
|
4643
4644
|
const isDragging = ref(false);
|
|
4644
4645
|
const currentHandle = ref(null);
|
|
4645
4646
|
const leftHandle = reactive({ side: "left", x: 0 });
|
|
@@ -4647,9 +4648,29 @@ const _sfc_main$6 = {
|
|
|
4647
4648
|
const showVerticalIndicator = ref(false);
|
|
4648
4649
|
const initialX = ref(0);
|
|
4649
4650
|
let offsetX = 0;
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4651
|
+
let selectionUpdateHandler = null;
|
|
4652
|
+
const getPresentationEditor = () => {
|
|
4653
|
+
return props.editor?.presentationEditor ?? null;
|
|
4654
|
+
};
|
|
4655
|
+
const updateRulerForCurrentSection = () => {
|
|
4656
|
+
if (!props.editor || props.editor.options?.mode !== "docx") return;
|
|
4657
|
+
const presentationEditor = getPresentationEditor();
|
|
4658
|
+
let docSize, docMargins, sectionIndex;
|
|
4659
|
+
if (presentationEditor && typeof presentationEditor.getCurrentSectionPageStyles === "function") {
|
|
4660
|
+
const sectionStyles = presentationEditor.getCurrentSectionPageStyles();
|
|
4661
|
+
docSize = sectionStyles.pageSize;
|
|
4662
|
+
docMargins = sectionStyles.pageMargins;
|
|
4663
|
+
sectionIndex = sectionStyles.sectionIndex;
|
|
4664
|
+
} else {
|
|
4665
|
+
const styles = props.editor.getPageStyles();
|
|
4666
|
+
docSize = styles.pageSize ?? { width: 8.5, height: 11 };
|
|
4667
|
+
docMargins = styles.pageMargins ?? { left: 1, right: 1, top: 1, bottom: 1 };
|
|
4668
|
+
sectionIndex = 0;
|
|
4669
|
+
}
|
|
4670
|
+
if (pageSize.value && currentSectionIndex.value === sectionIndex) {
|
|
4671
|
+
return;
|
|
4672
|
+
}
|
|
4673
|
+
currentSectionIndex.value = sectionIndex;
|
|
4653
4674
|
pageSize.value = docSize;
|
|
4654
4675
|
pageMargins.value = docMargins;
|
|
4655
4676
|
const definition = generateRulerDefinition({
|
|
@@ -4663,7 +4684,7 @@ const _sfc_main$6 = {
|
|
|
4663
4684
|
});
|
|
4664
4685
|
leftHandle.x = definition.leftMarginPx;
|
|
4665
4686
|
rightHandle.x = definition.rightMarginPx;
|
|
4666
|
-
|
|
4687
|
+
rulerDefinition.value = definition;
|
|
4667
4688
|
};
|
|
4668
4689
|
const getTickStyle = computed(() => (tick) => {
|
|
4669
4690
|
return {
|
|
@@ -4717,7 +4738,8 @@ const _sfc_main$6 = {
|
|
|
4717
4738
|
const marginValue = getNewMarginValue();
|
|
4718
4739
|
emit("margin-change", {
|
|
4719
4740
|
side: currentHandle.value.side,
|
|
4720
|
-
value: marginValue
|
|
4741
|
+
value: marginValue,
|
|
4742
|
+
sectionIndex: currentSectionIndex.value
|
|
4721
4743
|
});
|
|
4722
4744
|
}
|
|
4723
4745
|
};
|
|
@@ -4741,12 +4763,40 @@ const _sfc_main$6 = {
|
|
|
4741
4763
|
"--ruler-width": `${width}px`
|
|
4742
4764
|
};
|
|
4743
4765
|
});
|
|
4766
|
+
const handleSelectionUpdate = () => {
|
|
4767
|
+
if (isDragging.value) return;
|
|
4768
|
+
updateRulerForCurrentSection();
|
|
4769
|
+
};
|
|
4770
|
+
const setupEditorListeners = () => {
|
|
4771
|
+
if (!props.editor) return;
|
|
4772
|
+
selectionUpdateHandler = handleSelectionUpdate;
|
|
4773
|
+
props.editor.on("selectionUpdate", selectionUpdateHandler);
|
|
4774
|
+
};
|
|
4775
|
+
const cleanupEditorListeners = () => {
|
|
4776
|
+
if (!props.editor || !selectionUpdateHandler) return;
|
|
4777
|
+
props.editor.off("selectionUpdate", selectionUpdateHandler);
|
|
4778
|
+
selectionUpdateHandler = null;
|
|
4779
|
+
};
|
|
4780
|
+
watch(
|
|
4781
|
+
() => props.editor,
|
|
4782
|
+
(newEditor, oldEditor) => {
|
|
4783
|
+
if (oldEditor && selectionUpdateHandler) {
|
|
4784
|
+
oldEditor.off("selectionUpdate", selectionUpdateHandler);
|
|
4785
|
+
}
|
|
4786
|
+
if (newEditor) {
|
|
4787
|
+
setupEditorListeners();
|
|
4788
|
+
updateRulerForCurrentSection();
|
|
4789
|
+
}
|
|
4790
|
+
}
|
|
4791
|
+
);
|
|
4744
4792
|
onMounted(() => {
|
|
4745
|
-
|
|
4793
|
+
updateRulerForCurrentSection();
|
|
4794
|
+
setupEditorListeners();
|
|
4746
4795
|
window.addEventListener("mousemove", handleMouseMove);
|
|
4747
4796
|
window.addEventListener("mouseup", handleMouseUp);
|
|
4748
4797
|
});
|
|
4749
4798
|
onUnmounted(() => {
|
|
4799
|
+
cleanupEditorListeners();
|
|
4750
4800
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
4751
4801
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
4752
4802
|
});
|
|
@@ -4787,7 +4837,7 @@ const _sfc_main$6 = {
|
|
|
4787
4837
|
};
|
|
4788
4838
|
}
|
|
4789
4839
|
};
|
|
4790
|
-
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
4840
|
+
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-0d1b9cd1"]]);
|
|
4791
4841
|
const _sfc_main$5 = {
|
|
4792
4842
|
__name: "GenericPopover",
|
|
4793
4843
|
props: {
|
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-CrRRbz3_.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-rYLAMF97.es.js";
|
|
2
2
|
import "./chunks/vue-Dysv_7z5.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CrRRbz3_.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-Dc6FhKsA.cjs");
|
|
5
5
|
const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
|
7
7
|
exports.Editor = superEditor_es.Editor;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-rYLAMF97.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-YCkhH3qs.es.js";
|
|
3
3
|
import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
export {
|
|
5
5
|
a as AnnotatorHelpers,
|