@harbour-enterprises/superdoc 1.0.0-beta.87 → 1.0.0-beta.88
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-DAayAt76.es.js → PdfViewer-2DqlQMKM.es.js} +1 -1
- package/dist/chunks/{PdfViewer-Cwmc4rak.cjs → PdfViewer-DBW8dNGO.cjs} +1 -1
- package/dist/chunks/{index-rv7o9043-DVlRSGhv.es.js → index-BLlh97IN-75N3psN2.es.js} +1 -1
- package/dist/chunks/{index-rv7o9043-DD5SvBoC.cjs → index-BLlh97IN-BF_Nyujm.cjs} +1 -1
- package/dist/chunks/{index-huIbWXSg.cjs → index-i17b8wYa.cjs} +3 -3
- package/dist/chunks/{index-BV2SxVfK.es.js → index-nvs_L5an.es.js} +3 -3
- package/dist/chunks/{super-editor.es-C43B4f8Z.cjs → super-editor.es-DB49uQPF.cjs} +156 -34
- package/dist/chunks/{super-editor.es-BuujpqOr.es.js → super-editor.es-DpbjE-x_.es.js} +156 -34
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-G519mwN2.js → converter-CjKHGzQU.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-CHfjJ_h-.js → docx-zipper-BDVppBrA.js} +1 -1
- package/dist/super-editor/chunks/{editor-BQsR9BR1.js → editor-CgbApADp.js} +152 -30
- package/dist/super-editor/chunks/{index-rv7o9043.js → index-BLlh97IN.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DNfQq2Cl.js → toolbar-BEQMP5-e.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 +158 -36
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -19614,9 +19614,9 @@ function encodeCSSFromPPr(paragraphProperties, hasPreviousParagraph, nextParagra
|
|
|
19614
19614
|
const { spacing, indent, borders, justification } = paragraphProperties;
|
|
19615
19615
|
const nextStyleId = nextParagraphProps?.styleId;
|
|
19616
19616
|
if (spacing) {
|
|
19617
|
-
const getEffectiveBefore = (nextSpacing,
|
|
19617
|
+
const getEffectiveBefore = (nextSpacing, isListItem2) => {
|
|
19618
19618
|
if (!nextSpacing) return 0;
|
|
19619
|
-
if (nextSpacing.beforeAutospacing &&
|
|
19619
|
+
if (nextSpacing.beforeAutospacing && isListItem2) {
|
|
19620
19620
|
return 0;
|
|
19621
19621
|
}
|
|
19622
19622
|
return nextSpacing.before || 0;
|
|
@@ -19997,7 +19997,7 @@ function addTextDecorationEntries(targetSet, value) {
|
|
|
19997
19997
|
}
|
|
19998
19998
|
String(value).split(/\s+/).map((entry) => entry.trim()).filter(Boolean).forEach((entry) => targetSet.add(entry));
|
|
19999
19999
|
}
|
|
20000
|
-
const getSpacingStyle = (spacing,
|
|
20000
|
+
const getSpacingStyle = (spacing, isListItem2) => {
|
|
20001
20001
|
let { before, after, line, lineRule, beforeAutospacing, afterAutospacing } = spacing;
|
|
20002
20002
|
line = twipsToLines(line);
|
|
20003
20003
|
if (line != null && line < 1) {
|
|
@@ -20008,13 +20008,13 @@ const getSpacingStyle = (spacing, isListItem) => {
|
|
|
20008
20008
|
}
|
|
20009
20009
|
before = twipsToPixels$2(before);
|
|
20010
20010
|
if (beforeAutospacing) {
|
|
20011
|
-
if (
|
|
20011
|
+
if (isListItem2) {
|
|
20012
20012
|
before = 0;
|
|
20013
20013
|
}
|
|
20014
20014
|
}
|
|
20015
20015
|
after = twipsToPixels$2(after);
|
|
20016
20016
|
if (afterAutospacing) {
|
|
20017
|
-
if (
|
|
20017
|
+
if (isListItem2) {
|
|
20018
20018
|
after = 0;
|
|
20019
20019
|
}
|
|
20020
20020
|
}
|
|
@@ -42380,7 +42380,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
42380
42380
|
static getStoredSuperdocVersion(docx) {
|
|
42381
42381
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42382
42382
|
}
|
|
42383
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42383
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.88") {
|
|
42384
42384
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42385
42385
|
}
|
|
42386
42386
|
/**
|
|
@@ -59586,7 +59586,7 @@ const isHeadless = (editor) => {
|
|
|
59586
59586
|
const shouldSkipNodeView = (editor) => {
|
|
59587
59587
|
return isHeadless(editor);
|
|
59588
59588
|
};
|
|
59589
|
-
const summaryVersion = "1.0.0-beta.
|
|
59589
|
+
const summaryVersion = "1.0.0-beta.88";
|
|
59590
59590
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59591
59591
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59592
59592
|
function mapAttributes(attrs) {
|
|
@@ -60375,7 +60375,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60375
60375
|
{ default: remarkStringify },
|
|
60376
60376
|
{ default: remarkGfm }
|
|
60377
60377
|
] = await Promise.all([
|
|
60378
|
-
import("./index-
|
|
60378
|
+
import("./index-BLlh97IN-75N3psN2.es.js"),
|
|
60379
60379
|
import("./index-DRCvimau-Cw339678.es.js"),
|
|
60380
60380
|
import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
|
|
60381
60381
|
import("./index-D_sWOSiG-DE96TaT5.es.js"),
|
|
@@ -60580,7 +60580,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60580
60580
|
* Process collaboration migrations
|
|
60581
60581
|
*/
|
|
60582
60582
|
processCollaborationMigrations() {
|
|
60583
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60583
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.88");
|
|
60584
60584
|
if (!this.options.ydoc) return;
|
|
60585
60585
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60586
60586
|
let docVersion = metaMap.get("version");
|
|
@@ -78268,6 +78268,50 @@ function findCharIndexAtX(textNode, container, targetX) {
|
|
|
78268
78268
|
}
|
|
78269
78269
|
return index2;
|
|
78270
78270
|
}
|
|
78271
|
+
function getWordLayoutConfig(block) {
|
|
78272
|
+
if (!block || block.kind !== "paragraph") {
|
|
78273
|
+
return void 0;
|
|
78274
|
+
}
|
|
78275
|
+
return block.attrs?.wordLayout;
|
|
78276
|
+
}
|
|
78277
|
+
function isListItem(markerWidth, block) {
|
|
78278
|
+
const hasMarkerWidth = markerWidth > 0;
|
|
78279
|
+
if (hasMarkerWidth) {
|
|
78280
|
+
return true;
|
|
78281
|
+
}
|
|
78282
|
+
if (!block || block.kind !== "paragraph") {
|
|
78283
|
+
return false;
|
|
78284
|
+
}
|
|
78285
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
78286
|
+
const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
|
|
78287
|
+
if (hasListAttrs) {
|
|
78288
|
+
return true;
|
|
78289
|
+
}
|
|
78290
|
+
const hangingIndent = block.attrs?.indent?.hanging ?? 0;
|
|
78291
|
+
const paraIndentLeft = block.attrs?.indent?.left ?? 0;
|
|
78292
|
+
const hasHangingIndentPattern = hangingIndent > 0 && paraIndentLeft > 0;
|
|
78293
|
+
return hasHangingIndentPattern;
|
|
78294
|
+
}
|
|
78295
|
+
function calculateTextStartIndent(params2) {
|
|
78296
|
+
const { isFirstLine, isListItem: isListItem2, markerWidth, paraIndentLeft, firstLineIndent, hangingIndent, wordLayout } = params2;
|
|
78297
|
+
const firstLineOffset = firstLineIndent - hangingIndent;
|
|
78298
|
+
const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
|
|
78299
|
+
let indentAdjust = paraIndentLeft;
|
|
78300
|
+
if (isListItem2 && isFirstLine && isFirstLineIndentMode) {
|
|
78301
|
+
const textStartFallback = paraIndentLeft + Math.max(firstLineIndent, 0) + markerWidth;
|
|
78302
|
+
indentAdjust = typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : textStartFallback;
|
|
78303
|
+
} else if (isFirstLine && !isListItem2) {
|
|
78304
|
+
indentAdjust += firstLineOffset;
|
|
78305
|
+
}
|
|
78306
|
+
return indentAdjust;
|
|
78307
|
+
}
|
|
78308
|
+
function extractParagraphIndent(indent) {
|
|
78309
|
+
const left2 = typeof indent?.left === "number" && Number.isFinite(indent.left) ? indent.left : 0;
|
|
78310
|
+
const right2 = typeof indent?.right === "number" && Number.isFinite(indent.right) ? indent.right : 0;
|
|
78311
|
+
const firstLine = typeof indent?.firstLine === "number" && Number.isFinite(indent.firstLine) ? indent.firstLine : 0;
|
|
78312
|
+
const hanging = typeof indent?.hanging === "number" && Number.isFinite(indent.hanging) ? indent.hanging : 0;
|
|
78313
|
+
return { left: left2, right: right2, firstLine, hanging };
|
|
78314
|
+
}
|
|
78271
78315
|
const defaultHeaderFooterIdentifier = () => ({
|
|
78272
78316
|
headerIds: { default: null, first: null, even: null, odd: null },
|
|
78273
78317
|
footerIds: { default: null, first: null, even: null, odd: null },
|
|
@@ -83279,8 +83323,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
83279
83323
|
);
|
|
83280
83324
|
}
|
|
83281
83325
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
83282
|
-
const
|
|
83283
|
-
const alignmentOverride =
|
|
83326
|
+
const isListItem3 = markerWidth > 0;
|
|
83327
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
83284
83328
|
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
83285
83329
|
if (pos == null) {
|
|
83286
83330
|
logClickStage("warn", "no-position", {
|
|
@@ -83324,8 +83368,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
83324
83368
|
);
|
|
83325
83369
|
}
|
|
83326
83370
|
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
83327
|
-
const
|
|
83328
|
-
const alignmentOverride =
|
|
83371
|
+
const isListItem3 = cellMarkerWidth > 0;
|
|
83372
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
83329
83373
|
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
83330
83374
|
if (pos != null) {
|
|
83331
83375
|
logClickStage("log", "success", {
|
|
@@ -83483,17 +83527,22 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83483
83527
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
83484
83528
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
83485
83529
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
83486
|
-
const
|
|
83487
|
-
const alignmentOverride =
|
|
83530
|
+
const isListItemFlag = isListItem(markerWidth, block);
|
|
83531
|
+
const alignmentOverride = isListItemFlag ? "left" : void 0;
|
|
83488
83532
|
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
83489
83533
|
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
83490
|
-
const
|
|
83491
|
-
const
|
|
83534
|
+
const indent = extractParagraphIndent(block.attrs?.indent);
|
|
83535
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
83492
83536
|
const isFirstLine = index2 === fragment.fromLine;
|
|
83493
|
-
|
|
83494
|
-
|
|
83495
|
-
|
|
83496
|
-
|
|
83537
|
+
const indentAdjust = calculateTextStartIndent({
|
|
83538
|
+
isFirstLine,
|
|
83539
|
+
isListItem: isListItemFlag,
|
|
83540
|
+
markerWidth,
|
|
83541
|
+
paraIndentLeft: indent.left,
|
|
83542
|
+
firstLineIndent: indent.firstLine,
|
|
83543
|
+
hangingIndent: indent.hanging,
|
|
83544
|
+
wordLayout
|
|
83545
|
+
});
|
|
83497
83546
|
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
83498
83547
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
83499
83548
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
@@ -83596,9 +83645,12 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83596
83645
|
let blockTopCursor = padding.top + verticalOffset;
|
|
83597
83646
|
renderedBlocks.forEach((info) => {
|
|
83598
83647
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
83599
|
-
const
|
|
83600
|
-
const alignmentOverride =
|
|
83601
|
-
const
|
|
83648
|
+
const cellIsListItem = isListItem(paragraphMarkerWidth, info.block);
|
|
83649
|
+
const alignmentOverride = cellIsListItem ? "left" : void 0;
|
|
83650
|
+
const cellIndent = extractParagraphIndent(
|
|
83651
|
+
info.block.kind === "paragraph" ? info.block.attrs?.indent : void 0
|
|
83652
|
+
);
|
|
83653
|
+
const cellWordLayout = getWordLayoutConfig(info.block);
|
|
83602
83654
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
83603
83655
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
83604
83656
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -83614,7 +83666,17 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83614
83666
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
83615
83667
|
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
83616
83668
|
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
83617
|
-
const
|
|
83669
|
+
const isFirstLine = index2 === info.startLine;
|
|
83670
|
+
const textIndentAdjust = calculateTextStartIndent({
|
|
83671
|
+
isFirstLine,
|
|
83672
|
+
isListItem: cellIsListItem,
|
|
83673
|
+
markerWidth: paragraphMarkerWidth,
|
|
83674
|
+
paraIndentLeft: cellIndent.left,
|
|
83675
|
+
firstLineIndent: cellIndent.firstLine,
|
|
83676
|
+
hangingIndent: cellIndent.hanging,
|
|
83677
|
+
wordLayout: cellWordLayout
|
|
83678
|
+
});
|
|
83679
|
+
const rectX = fragment.x + cellX + padding.left + textIndentAdjust + Math.min(startX, endX);
|
|
83618
83680
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
83619
83681
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
83620
83682
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -91158,18 +91220,78 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
91158
91220
|
if (range2.pmStart == null || range2.pmEnd == null) return null;
|
|
91159
91221
|
const pmOffset = pmPosToCharOffset(block, line, pos);
|
|
91160
91222
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
91161
|
-
const
|
|
91162
|
-
const
|
|
91163
|
-
const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
|
|
91223
|
+
const indent = extractParagraphIndent(block.attrs?.indent);
|
|
91224
|
+
const availableWidth = Math.max(0, fragment.width - (indent.left + indent.right));
|
|
91164
91225
|
const charX = measureCharacterX(block, line, pmOffset, availableWidth);
|
|
91165
|
-
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
91166
91226
|
const isFirstLine = index2 === fragment.fromLine;
|
|
91167
|
-
const
|
|
91168
|
-
|
|
91169
|
-
|
|
91170
|
-
|
|
91227
|
+
const isListItemFlag = isListItem(markerWidth, block);
|
|
91228
|
+
const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && isListItemFlag;
|
|
91229
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
91230
|
+
const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
|
|
91231
|
+
if (isListFirstLine && isFirstLineIndentMode) {
|
|
91232
|
+
const textStartPx = calculateTextStartIndent({
|
|
91233
|
+
isFirstLine,
|
|
91234
|
+
isListItem: isListItemFlag,
|
|
91235
|
+
markerWidth,
|
|
91236
|
+
paraIndentLeft: indent.left,
|
|
91237
|
+
firstLineIndent: indent.firstLine,
|
|
91238
|
+
hangingIndent: indent.hanging,
|
|
91239
|
+
wordLayout
|
|
91240
|
+
});
|
|
91241
|
+
const localX2 = fragment.x + textStartPx + charX;
|
|
91242
|
+
const lineOffset2 = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
|
|
91243
|
+
const localY2 = fragment.y + lineOffset2;
|
|
91244
|
+
const result2 = {
|
|
91245
|
+
pageIndex: hit.pageIndex,
|
|
91246
|
+
x: localX2,
|
|
91247
|
+
y: localY2,
|
|
91248
|
+
height: line.lineHeight
|
|
91249
|
+
};
|
|
91250
|
+
const pageEl2 = __privateGet$1(this, _painterHost)?.querySelector(
|
|
91251
|
+
`.superdoc-page[data-page-index="${hit.pageIndex}"]`
|
|
91252
|
+
);
|
|
91253
|
+
const pageRect2 = pageEl2?.getBoundingClientRect();
|
|
91254
|
+
const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
91255
|
+
let domCaretX2 = null;
|
|
91256
|
+
let domCaretY2 = null;
|
|
91257
|
+
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
|
|
91258
|
+
for (const spanEl of spanEls2) {
|
|
91259
|
+
const pmStart = Number(spanEl.dataset.pmStart);
|
|
91260
|
+
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
91261
|
+
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
91262
|
+
const textNode = spanEl.firstChild;
|
|
91263
|
+
const charIndex = Math.min(pos - pmStart, textNode.length);
|
|
91264
|
+
const rangeObj = document.createRange();
|
|
91265
|
+
rangeObj.setStart(textNode, charIndex);
|
|
91266
|
+
rangeObj.setEnd(textNode, charIndex);
|
|
91267
|
+
const rangeRect = rangeObj.getBoundingClientRect();
|
|
91268
|
+
if (pageRect2) {
|
|
91269
|
+
domCaretX2 = (rangeRect.left - pageRect2.left) / zoom2;
|
|
91270
|
+
domCaretY2 = (rangeRect.top - pageRect2.top) / zoom2;
|
|
91271
|
+
}
|
|
91272
|
+
break;
|
|
91273
|
+
}
|
|
91274
|
+
}
|
|
91275
|
+
if (includeDomFallback && domCaretX2 != null && domCaretY2 != null) {
|
|
91276
|
+
return {
|
|
91277
|
+
pageIndex: hit.pageIndex,
|
|
91278
|
+
x: domCaretX2,
|
|
91279
|
+
y: domCaretY2,
|
|
91280
|
+
height: line.lineHeight
|
|
91281
|
+
};
|
|
91282
|
+
}
|
|
91283
|
+
return result2;
|
|
91171
91284
|
}
|
|
91172
|
-
const
|
|
91285
|
+
const indentAdjust = calculateTextStartIndent({
|
|
91286
|
+
isFirstLine,
|
|
91287
|
+
isListItem: isListItemFlag,
|
|
91288
|
+
markerWidth,
|
|
91289
|
+
paraIndentLeft: indent.left,
|
|
91290
|
+
firstLineIndent: indent.firstLine,
|
|
91291
|
+
hangingIndent: indent.hanging,
|
|
91292
|
+
wordLayout
|
|
91293
|
+
});
|
|
91294
|
+
const localX = fragment.x + indentAdjust + charX;
|
|
91173
91295
|
const lineOffset = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
|
|
91174
91296
|
const localY = fragment.y + lineOffset;
|
|
91175
91297
|
const result = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-CjKHGzQU.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-CgbApADp.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -42697,7 +42697,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42697
42697
|
static getStoredSuperdocVersion(docx) {
|
|
42698
42698
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42699
42699
|
}
|
|
42700
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
42700
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.88") {
|
|
42701
42701
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42702
42702
|
}
|
|
42703
42703
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-CjKHGzQU.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -12,8 +12,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _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-CjKHGzQU.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-BDVppBrA.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() {
|
|
@@ -13940,7 +13940,7 @@ const isHeadless = (editor) => {
|
|
|
13940
13940
|
const shouldSkipNodeView = (editor) => {
|
|
13941
13941
|
return isHeadless(editor);
|
|
13942
13942
|
};
|
|
13943
|
-
const summaryVersion = "1.0.0-beta.
|
|
13943
|
+
const summaryVersion = "1.0.0-beta.88";
|
|
13944
13944
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13945
13945
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13946
13946
|
function mapAttributes(attrs) {
|
|
@@ -14732,7 +14732,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14732
14732
|
{ default: remarkStringify },
|
|
14733
14733
|
{ default: remarkGfm }
|
|
14734
14734
|
] = await Promise.all([
|
|
14735
|
-
import("./index-
|
|
14735
|
+
import("./index-BLlh97IN.js"),
|
|
14736
14736
|
import("./index-DRCvimau.js"),
|
|
14737
14737
|
import("./index-C_x_N6Uh.js"),
|
|
14738
14738
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14937,7 +14937,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14937
14937
|
* Process collaboration migrations
|
|
14938
14938
|
*/
|
|
14939
14939
|
processCollaborationMigrations() {
|
|
14940
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14940
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.88");
|
|
14941
14941
|
if (!this.options.ydoc) return;
|
|
14942
14942
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14943
14943
|
let docVersion = metaMap.get("version");
|
|
@@ -32713,6 +32713,50 @@ function findCharIndexAtX(textNode, container, targetX) {
|
|
|
32713
32713
|
}
|
|
32714
32714
|
return index2;
|
|
32715
32715
|
}
|
|
32716
|
+
function getWordLayoutConfig(block) {
|
|
32717
|
+
if (!block || block.kind !== "paragraph") {
|
|
32718
|
+
return void 0;
|
|
32719
|
+
}
|
|
32720
|
+
return block.attrs?.wordLayout;
|
|
32721
|
+
}
|
|
32722
|
+
function isListItem(markerWidth, block) {
|
|
32723
|
+
const hasMarkerWidth = markerWidth > 0;
|
|
32724
|
+
if (hasMarkerWidth) {
|
|
32725
|
+
return true;
|
|
32726
|
+
}
|
|
32727
|
+
if (!block || block.kind !== "paragraph") {
|
|
32728
|
+
return false;
|
|
32729
|
+
}
|
|
32730
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
32731
|
+
const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
|
|
32732
|
+
if (hasListAttrs) {
|
|
32733
|
+
return true;
|
|
32734
|
+
}
|
|
32735
|
+
const hangingIndent = block.attrs?.indent?.hanging ?? 0;
|
|
32736
|
+
const paraIndentLeft = block.attrs?.indent?.left ?? 0;
|
|
32737
|
+
const hasHangingIndentPattern = hangingIndent > 0 && paraIndentLeft > 0;
|
|
32738
|
+
return hasHangingIndentPattern;
|
|
32739
|
+
}
|
|
32740
|
+
function calculateTextStartIndent(params2) {
|
|
32741
|
+
const { isFirstLine, isListItem: isListItem2, markerWidth, paraIndentLeft, firstLineIndent, hangingIndent, wordLayout } = params2;
|
|
32742
|
+
const firstLineOffset = firstLineIndent - hangingIndent;
|
|
32743
|
+
const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
|
|
32744
|
+
let indentAdjust = paraIndentLeft;
|
|
32745
|
+
if (isListItem2 && isFirstLine && isFirstLineIndentMode) {
|
|
32746
|
+
const textStartFallback = paraIndentLeft + Math.max(firstLineIndent, 0) + markerWidth;
|
|
32747
|
+
indentAdjust = typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : textStartFallback;
|
|
32748
|
+
} else if (isFirstLine && !isListItem2) {
|
|
32749
|
+
indentAdjust += firstLineOffset;
|
|
32750
|
+
}
|
|
32751
|
+
return indentAdjust;
|
|
32752
|
+
}
|
|
32753
|
+
function extractParagraphIndent(indent) {
|
|
32754
|
+
const left2 = typeof indent?.left === "number" && Number.isFinite(indent.left) ? indent.left : 0;
|
|
32755
|
+
const right2 = typeof indent?.right === "number" && Number.isFinite(indent.right) ? indent.right : 0;
|
|
32756
|
+
const firstLine = typeof indent?.firstLine === "number" && Number.isFinite(indent.firstLine) ? indent.firstLine : 0;
|
|
32757
|
+
const hanging = typeof indent?.hanging === "number" && Number.isFinite(indent.hanging) ? indent.hanging : 0;
|
|
32758
|
+
return { left: left2, right: right2, firstLine, hanging };
|
|
32759
|
+
}
|
|
32716
32760
|
const defaultHeaderFooterIdentifier = () => ({
|
|
32717
32761
|
headerIds: { default: null, first: null, even: null, odd: null },
|
|
32718
32762
|
footerIds: { default: null, first: null, even: null, odd: null },
|
|
@@ -37724,8 +37768,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
37724
37768
|
);
|
|
37725
37769
|
}
|
|
37726
37770
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
37727
|
-
const
|
|
37728
|
-
const alignmentOverride =
|
|
37771
|
+
const isListItem3 = markerWidth > 0;
|
|
37772
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
37729
37773
|
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
37730
37774
|
if (pos == null) {
|
|
37731
37775
|
logClickStage("warn", "no-position", {
|
|
@@ -37769,8 +37813,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
37769
37813
|
);
|
|
37770
37814
|
}
|
|
37771
37815
|
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
37772
|
-
const
|
|
37773
|
-
const alignmentOverride =
|
|
37816
|
+
const isListItem3 = cellMarkerWidth > 0;
|
|
37817
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
37774
37818
|
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
37775
37819
|
if (pos != null) {
|
|
37776
37820
|
logClickStage("log", "success", {
|
|
@@ -37928,17 +37972,22 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
37928
37972
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
37929
37973
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
37930
37974
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
37931
|
-
const
|
|
37932
|
-
const alignmentOverride =
|
|
37975
|
+
const isListItemFlag = isListItem(markerWidth, block);
|
|
37976
|
+
const alignmentOverride = isListItemFlag ? "left" : void 0;
|
|
37933
37977
|
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
37934
37978
|
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
37935
|
-
const
|
|
37936
|
-
const
|
|
37979
|
+
const indent = extractParagraphIndent(block.attrs?.indent);
|
|
37980
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
37937
37981
|
const isFirstLine = index2 === fragment.fromLine;
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37982
|
+
const indentAdjust = calculateTextStartIndent({
|
|
37983
|
+
isFirstLine,
|
|
37984
|
+
isListItem: isListItemFlag,
|
|
37985
|
+
markerWidth,
|
|
37986
|
+
paraIndentLeft: indent.left,
|
|
37987
|
+
firstLineIndent: indent.firstLine,
|
|
37988
|
+
hangingIndent: indent.hanging,
|
|
37989
|
+
wordLayout
|
|
37990
|
+
});
|
|
37942
37991
|
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
37943
37992
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
37944
37993
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
@@ -38041,9 +38090,12 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
38041
38090
|
let blockTopCursor = padding.top + verticalOffset;
|
|
38042
38091
|
renderedBlocks.forEach((info) => {
|
|
38043
38092
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
38044
|
-
const
|
|
38045
|
-
const alignmentOverride =
|
|
38046
|
-
const
|
|
38093
|
+
const cellIsListItem = isListItem(paragraphMarkerWidth, info.block);
|
|
38094
|
+
const alignmentOverride = cellIsListItem ? "left" : void 0;
|
|
38095
|
+
const cellIndent = extractParagraphIndent(
|
|
38096
|
+
info.block.kind === "paragraph" ? info.block.attrs?.indent : void 0
|
|
38097
|
+
);
|
|
38098
|
+
const cellWordLayout = getWordLayoutConfig(info.block);
|
|
38047
38099
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
38048
38100
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
38049
38101
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -38059,7 +38111,17 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
38059
38111
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
38060
38112
|
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
38061
38113
|
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
38062
|
-
const
|
|
38114
|
+
const isFirstLine = index2 === info.startLine;
|
|
38115
|
+
const textIndentAdjust = calculateTextStartIndent({
|
|
38116
|
+
isFirstLine,
|
|
38117
|
+
isListItem: cellIsListItem,
|
|
38118
|
+
markerWidth: paragraphMarkerWidth,
|
|
38119
|
+
paraIndentLeft: cellIndent.left,
|
|
38120
|
+
firstLineIndent: cellIndent.firstLine,
|
|
38121
|
+
hangingIndent: cellIndent.hanging,
|
|
38122
|
+
wordLayout: cellWordLayout
|
|
38123
|
+
});
|
|
38124
|
+
const rectX = fragment.x + cellX + padding.left + textIndentAdjust + Math.min(startX, endX);
|
|
38063
38125
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
38064
38126
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
38065
38127
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -46449,18 +46511,78 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
46449
46511
|
if (range.pmStart == null || range.pmEnd == null) return null;
|
|
46450
46512
|
const pmOffset = pmPosToCharOffset(block, line, pos);
|
|
46451
46513
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
46452
|
-
const
|
|
46453
|
-
const
|
|
46454
|
-
const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
|
|
46514
|
+
const indent = extractParagraphIndent(block.attrs?.indent);
|
|
46515
|
+
const availableWidth = Math.max(0, fragment.width - (indent.left + indent.right));
|
|
46455
46516
|
const charX = measureCharacterX(block, line, pmOffset, availableWidth);
|
|
46456
|
-
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
46457
46517
|
const isFirstLine = index2 === fragment.fromLine;
|
|
46458
|
-
const
|
|
46459
|
-
|
|
46460
|
-
|
|
46461
|
-
|
|
46518
|
+
const isListItemFlag = isListItem(markerWidth, block);
|
|
46519
|
+
const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && isListItemFlag;
|
|
46520
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
46521
|
+
const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
|
|
46522
|
+
if (isListFirstLine && isFirstLineIndentMode) {
|
|
46523
|
+
const textStartPx = calculateTextStartIndent({
|
|
46524
|
+
isFirstLine,
|
|
46525
|
+
isListItem: isListItemFlag,
|
|
46526
|
+
markerWidth,
|
|
46527
|
+
paraIndentLeft: indent.left,
|
|
46528
|
+
firstLineIndent: indent.firstLine,
|
|
46529
|
+
hangingIndent: indent.hanging,
|
|
46530
|
+
wordLayout
|
|
46531
|
+
});
|
|
46532
|
+
const localX2 = fragment.x + textStartPx + charX;
|
|
46533
|
+
const lineOffset2 = __privateMethod(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
|
|
46534
|
+
const localY2 = fragment.y + lineOffset2;
|
|
46535
|
+
const result2 = {
|
|
46536
|
+
pageIndex: hit.pageIndex,
|
|
46537
|
+
x: localX2,
|
|
46538
|
+
y: localY2,
|
|
46539
|
+
height: line.lineHeight
|
|
46540
|
+
};
|
|
46541
|
+
const pageEl2 = __privateGet(this, _painterHost)?.querySelector(
|
|
46542
|
+
`.superdoc-page[data-page-index="${hit.pageIndex}"]`
|
|
46543
|
+
);
|
|
46544
|
+
const pageRect2 = pageEl2?.getBoundingClientRect();
|
|
46545
|
+
const zoom2 = __privateGet(this, _layoutOptions).zoom ?? 1;
|
|
46546
|
+
let domCaretX2 = null;
|
|
46547
|
+
let domCaretY2 = null;
|
|
46548
|
+
const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
|
|
46549
|
+
for (const spanEl of spanEls2) {
|
|
46550
|
+
const pmStart = Number(spanEl.dataset.pmStart);
|
|
46551
|
+
const pmEnd = Number(spanEl.dataset.pmEnd);
|
|
46552
|
+
if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
|
|
46553
|
+
const textNode = spanEl.firstChild;
|
|
46554
|
+
const charIndex = Math.min(pos - pmStart, textNode.length);
|
|
46555
|
+
const rangeObj = document.createRange();
|
|
46556
|
+
rangeObj.setStart(textNode, charIndex);
|
|
46557
|
+
rangeObj.setEnd(textNode, charIndex);
|
|
46558
|
+
const rangeRect = rangeObj.getBoundingClientRect();
|
|
46559
|
+
if (pageRect2) {
|
|
46560
|
+
domCaretX2 = (rangeRect.left - pageRect2.left) / zoom2;
|
|
46561
|
+
domCaretY2 = (rangeRect.top - pageRect2.top) / zoom2;
|
|
46562
|
+
}
|
|
46563
|
+
break;
|
|
46564
|
+
}
|
|
46565
|
+
}
|
|
46566
|
+
if (includeDomFallback && domCaretX2 != null && domCaretY2 != null) {
|
|
46567
|
+
return {
|
|
46568
|
+
pageIndex: hit.pageIndex,
|
|
46569
|
+
x: domCaretX2,
|
|
46570
|
+
y: domCaretY2,
|
|
46571
|
+
height: line.lineHeight
|
|
46572
|
+
};
|
|
46573
|
+
}
|
|
46574
|
+
return result2;
|
|
46462
46575
|
}
|
|
46463
|
-
const
|
|
46576
|
+
const indentAdjust = calculateTextStartIndent({
|
|
46577
|
+
isFirstLine,
|
|
46578
|
+
isListItem: isListItemFlag,
|
|
46579
|
+
markerWidth,
|
|
46580
|
+
paraIndentLeft: indent.left,
|
|
46581
|
+
firstLineIndent: indent.firstLine,
|
|
46582
|
+
hangingIndent: indent.hanging,
|
|
46583
|
+
wordLayout
|
|
46584
|
+
});
|
|
46585
|
+
const localX = fragment.x + indentAdjust + charX;
|
|
46464
46586
|
const lineOffset = __privateMethod(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
|
|
46465
46587
|
const localY = fragment.y + lineOffset;
|
|
46466
46588
|
const result = {
|
|
@@ -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-CjKHGzQU.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CgbApADp.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|