@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.
Files changed (27) hide show
  1. package/dist/chunks/{PdfViewer-DAayAt76.es.js → PdfViewer-2DqlQMKM.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-Cwmc4rak.cjs → PdfViewer-DBW8dNGO.cjs} +1 -1
  3. package/dist/chunks/{index-rv7o9043-DVlRSGhv.es.js → index-BLlh97IN-75N3psN2.es.js} +1 -1
  4. package/dist/chunks/{index-rv7o9043-DD5SvBoC.cjs → index-BLlh97IN-BF_Nyujm.cjs} +1 -1
  5. package/dist/chunks/{index-huIbWXSg.cjs → index-i17b8wYa.cjs} +3 -3
  6. package/dist/chunks/{index-BV2SxVfK.es.js → index-nvs_L5an.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-C43B4f8Z.cjs → super-editor.es-DB49uQPF.cjs} +156 -34
  8. package/dist/chunks/{super-editor.es-BuujpqOr.es.js → super-editor.es-DpbjE-x_.es.js} +156 -34
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-G519mwN2.js → converter-CjKHGzQU.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-CHfjJ_h-.js → docx-zipper-BDVppBrA.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-BQsR9BR1.js → editor-CgbApADp.js} +152 -30
  13. package/dist/super-editor/chunks/{index-rv7o9043.js → index-BLlh97IN.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-DNfQq2Cl.js → toolbar-BEQMP5-e.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +158 -36
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, z as h, O as Transition, a0 as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-Dysv_7z5.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-BV2SxVfK.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-nvs_L5an.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-huIbWXSg.cjs");
4
+ const superdoc = require("./index-i17b8wYa.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BuujpqOr.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-DpbjE-x_.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-C43B4f8Z.cjs");
3
+ const superEditor_es = require("./super-editor.es-DB49uQPF.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C43B4f8Z.cjs");
2
+ const superEditor_es = require("./super-editor.es-DB49uQPF.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17268,7 +17268,7 @@ const _sfc_main = {
17268
17268
  __name: "SuperDoc",
17269
17269
  emits: ["selection-update"],
17270
17270
  setup(__props, { emit: __emit }) {
17271
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Cwmc4rak.cjs")));
17271
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DBW8dNGO.cjs")));
17272
17272
  const superdocStore = useSuperdocStore();
17273
17273
  const commentsStore = useCommentsStore();
17274
17274
  const {
@@ -18157,7 +18157,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18157
18157
  this.config.colors = shuffleArray(this.config.colors);
18158
18158
  this.userColorMap = /* @__PURE__ */ new Map();
18159
18159
  this.colorIndex = 0;
18160
- this.version = "1.0.0-beta.87";
18160
+ this.version = "1.0.0-beta.88";
18161
18161
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18162
18162
  this.superdocId = config.superdocId || uuid.v4();
18163
18163
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BuujpqOr.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DpbjE-x_.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17251,7 +17251,7 @@ const _sfc_main = {
17251
17251
  __name: "SuperDoc",
17252
17252
  emits: ["selection-update"],
17253
17253
  setup(__props, { emit: __emit }) {
17254
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DAayAt76.es.js"));
17254
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-2DqlQMKM.es.js"));
17255
17255
  const superdocStore = useSuperdocStore();
17256
17256
  const commentsStore = useCommentsStore();
17257
17257
  const {
@@ -18140,7 +18140,7 @@ class SuperDoc extends EventEmitter {
18140
18140
  this.config.colors = shuffleArray(this.config.colors);
18141
18141
  this.userColorMap = /* @__PURE__ */ new Map();
18142
18142
  this.colorIndex = 0;
18143
- this.version = "1.0.0-beta.87";
18143
+ this.version = "1.0.0-beta.88";
18144
18144
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18145
18145
  this.superdocId = config.superdocId || v4();
18146
18146
  this.colors = this.config.colors;
@@ -19631,9 +19631,9 @@ function encodeCSSFromPPr(paragraphProperties, hasPreviousParagraph, nextParagra
19631
19631
  const { spacing, indent, borders, justification } = paragraphProperties;
19632
19632
  const nextStyleId = nextParagraphProps?.styleId;
19633
19633
  if (spacing) {
19634
- const getEffectiveBefore = (nextSpacing, isListItem) => {
19634
+ const getEffectiveBefore = (nextSpacing, isListItem2) => {
19635
19635
  if (!nextSpacing) return 0;
19636
- if (nextSpacing.beforeAutospacing && isListItem) {
19636
+ if (nextSpacing.beforeAutospacing && isListItem2) {
19637
19637
  return 0;
19638
19638
  }
19639
19639
  return nextSpacing.before || 0;
@@ -20014,7 +20014,7 @@ function addTextDecorationEntries(targetSet, value) {
20014
20014
  }
20015
20015
  String(value).split(/\s+/).map((entry) => entry.trim()).filter(Boolean).forEach((entry) => targetSet.add(entry));
20016
20016
  }
20017
- const getSpacingStyle = (spacing, isListItem) => {
20017
+ const getSpacingStyle = (spacing, isListItem2) => {
20018
20018
  let { before, after, line, lineRule, beforeAutospacing, afterAutospacing } = spacing;
20019
20019
  line = twipsToLines(line);
20020
20020
  if (line != null && line < 1) {
@@ -20025,13 +20025,13 @@ const getSpacingStyle = (spacing, isListItem) => {
20025
20025
  }
20026
20026
  before = twipsToPixels$2(before);
20027
20027
  if (beforeAutospacing) {
20028
- if (isListItem) {
20028
+ if (isListItem2) {
20029
20029
  before = 0;
20030
20030
  }
20031
20031
  }
20032
20032
  after = twipsToPixels$2(after);
20033
20033
  if (afterAutospacing) {
20034
- if (isListItem) {
20034
+ if (isListItem2) {
20035
20035
  after = 0;
20036
20036
  }
20037
20037
  }
@@ -42397,7 +42397,7 @@ const _SuperConverter = class _SuperConverter2 {
42397
42397
  static getStoredSuperdocVersion(docx) {
42398
42398
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42399
42399
  }
42400
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.87") {
42400
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.88") {
42401
42401
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42402
42402
  }
42403
42403
  /**
@@ -59603,7 +59603,7 @@ const isHeadless = (editor) => {
59603
59603
  const shouldSkipNodeView = (editor) => {
59604
59604
  return isHeadless(editor);
59605
59605
  };
59606
- const summaryVersion = "1.0.0-beta.87";
59606
+ const summaryVersion = "1.0.0-beta.88";
59607
59607
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59608
59608
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59609
59609
  function mapAttributes(attrs) {
@@ -60392,7 +60392,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60392
60392
  { default: remarkStringify },
60393
60393
  { default: remarkGfm }
60394
60394
  ] = await Promise.all([
60395
- Promise.resolve().then(() => require("./index-rv7o9043-DD5SvBoC.cjs")),
60395
+ Promise.resolve().then(() => require("./index-BLlh97IN-BF_Nyujm.cjs")),
60396
60396
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
60397
60397
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
60398
60398
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60597,7 +60597,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60597
60597
  * Process collaboration migrations
60598
60598
  */
60599
60599
  processCollaborationMigrations() {
60600
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.87");
60600
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.88");
60601
60601
  if (!this.options.ydoc) return;
60602
60602
  const metaMap = this.options.ydoc.getMap("meta");
60603
60603
  let docVersion = metaMap.get("version");
@@ -78285,6 +78285,50 @@ function findCharIndexAtX(textNode, container, targetX) {
78285
78285
  }
78286
78286
  return index2;
78287
78287
  }
78288
+ function getWordLayoutConfig(block) {
78289
+ if (!block || block.kind !== "paragraph") {
78290
+ return void 0;
78291
+ }
78292
+ return block.attrs?.wordLayout;
78293
+ }
78294
+ function isListItem(markerWidth, block) {
78295
+ const hasMarkerWidth = markerWidth > 0;
78296
+ if (hasMarkerWidth) {
78297
+ return true;
78298
+ }
78299
+ if (!block || block.kind !== "paragraph") {
78300
+ return false;
78301
+ }
78302
+ const wordLayout = getWordLayoutConfig(block);
78303
+ const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
78304
+ if (hasListAttrs) {
78305
+ return true;
78306
+ }
78307
+ const hangingIndent = block.attrs?.indent?.hanging ?? 0;
78308
+ const paraIndentLeft = block.attrs?.indent?.left ?? 0;
78309
+ const hasHangingIndentPattern = hangingIndent > 0 && paraIndentLeft > 0;
78310
+ return hasHangingIndentPattern;
78311
+ }
78312
+ function calculateTextStartIndent(params2) {
78313
+ const { isFirstLine, isListItem: isListItem2, markerWidth, paraIndentLeft, firstLineIndent, hangingIndent, wordLayout } = params2;
78314
+ const firstLineOffset = firstLineIndent - hangingIndent;
78315
+ const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
78316
+ let indentAdjust = paraIndentLeft;
78317
+ if (isListItem2 && isFirstLine && isFirstLineIndentMode) {
78318
+ const textStartFallback = paraIndentLeft + Math.max(firstLineIndent, 0) + markerWidth;
78319
+ indentAdjust = typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : textStartFallback;
78320
+ } else if (isFirstLine && !isListItem2) {
78321
+ indentAdjust += firstLineOffset;
78322
+ }
78323
+ return indentAdjust;
78324
+ }
78325
+ function extractParagraphIndent(indent) {
78326
+ const left2 = typeof indent?.left === "number" && Number.isFinite(indent.left) ? indent.left : 0;
78327
+ const right2 = typeof indent?.right === "number" && Number.isFinite(indent.right) ? indent.right : 0;
78328
+ const firstLine = typeof indent?.firstLine === "number" && Number.isFinite(indent.firstLine) ? indent.firstLine : 0;
78329
+ const hanging = typeof indent?.hanging === "number" && Number.isFinite(indent.hanging) ? indent.hanging : 0;
78330
+ return { left: left2, right: right2, firstLine, hanging };
78331
+ }
78288
78332
  const defaultHeaderFooterIdentifier = () => ({
78289
78333
  headerIds: { default: null, first: null, even: null, odd: null },
78290
78334
  footerIds: { default: null, first: null, even: null, odd: null },
@@ -83296,8 +83340,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
83296
83340
  );
83297
83341
  }
83298
83342
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
83299
- const isListItem = markerWidth > 0;
83300
- const alignmentOverride = isListItem ? "left" : void 0;
83343
+ const isListItem3 = markerWidth > 0;
83344
+ const alignmentOverride = isListItem3 ? "left" : void 0;
83301
83345
  const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
83302
83346
  if (pos == null) {
83303
83347
  logClickStage("warn", "no-position", {
@@ -83341,8 +83385,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
83341
83385
  );
83342
83386
  }
83343
83387
  const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
83344
- const isListItem = cellMarkerWidth > 0;
83345
- const alignmentOverride = isListItem ? "left" : void 0;
83388
+ const isListItem3 = cellMarkerWidth > 0;
83389
+ const alignmentOverride = isListItem3 ? "left" : void 0;
83346
83390
  const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
83347
83391
  if (pos != null) {
83348
83392
  logClickStage("log", "success", {
@@ -83500,17 +83544,22 @@ function selectionToRects(layout, blocks, measures, from2, to) {
83500
83544
  const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
83501
83545
  const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
83502
83546
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
83503
- const isListItem = markerWidth > 0;
83504
- const alignmentOverride = isListItem ? "left" : void 0;
83547
+ const isListItemFlag = isListItem(markerWidth, block);
83548
+ const alignmentOverride = isListItemFlag ? "left" : void 0;
83505
83549
  const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
83506
83550
  const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
83507
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
83508
- const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
83551
+ const indent = extractParagraphIndent(block.attrs?.indent);
83552
+ const wordLayout = getWordLayoutConfig(block);
83509
83553
  const isFirstLine = index2 === fragment.fromLine;
83510
- let indentAdjust = paraIndentLeft;
83511
- if (isFirstLine && !isListItem) {
83512
- indentAdjust += firstLineOffset;
83513
- }
83554
+ const indentAdjust = calculateTextStartIndent({
83555
+ isFirstLine,
83556
+ isListItem: isListItemFlag,
83557
+ markerWidth,
83558
+ paraIndentLeft: indent.left,
83559
+ firstLineIndent: indent.firstLine,
83560
+ hangingIndent: indent.hanging,
83561
+ wordLayout
83562
+ });
83514
83563
  const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
83515
83564
  const rectWidth = Math.max(1, Math.abs(endX - startX));
83516
83565
  const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
@@ -83613,9 +83662,12 @@ function selectionToRects(layout, blocks, measures, from2, to) {
83613
83662
  let blockTopCursor = padding.top + verticalOffset;
83614
83663
  renderedBlocks.forEach((info) => {
83615
83664
  const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
83616
- const isListItem = paragraphMarkerWidth > 0;
83617
- const alignmentOverride = isListItem ? "left" : void 0;
83618
- const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
83665
+ const cellIsListItem = isListItem(paragraphMarkerWidth, info.block);
83666
+ const alignmentOverride = cellIsListItem ? "left" : void 0;
83667
+ const cellIndent = extractParagraphIndent(
83668
+ info.block.kind === "paragraph" ? info.block.attrs?.indent : void 0
83669
+ );
83670
+ const cellWordLayout = getWordLayoutConfig(info.block);
83619
83671
  const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
83620
83672
  intersectingLines.forEach(({ line, index: index2 }) => {
83621
83673
  if (index2 < info.startLine || index2 >= info.endLine) {
@@ -83631,7 +83683,17 @@ function selectionToRects(layout, blocks, measures, from2, to) {
83631
83683
  const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
83632
83684
  const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
83633
83685
  const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
83634
- const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
83686
+ const isFirstLine = index2 === info.startLine;
83687
+ const textIndentAdjust = calculateTextStartIndent({
83688
+ isFirstLine,
83689
+ isListItem: cellIsListItem,
83690
+ markerWidth: paragraphMarkerWidth,
83691
+ paraIndentLeft: cellIndent.left,
83692
+ firstLineIndent: cellIndent.firstLine,
83693
+ hangingIndent: cellIndent.hanging,
83694
+ wordLayout: cellWordLayout
83695
+ });
83696
+ const rectX = fragment.x + cellX + padding.left + textIndentAdjust + Math.min(startX, endX);
83635
83697
  const rectWidth = Math.max(1, Math.abs(endX - startX));
83636
83698
  const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
83637
83699
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
@@ -91175,18 +91237,78 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
91175
91237
  if (range2.pmStart == null || range2.pmEnd == null) return null;
91176
91238
  const pmOffset = pmPosToCharOffset(block, line, pos);
91177
91239
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
91178
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
91179
- const paraIndentRight = block.attrs?.indent?.right ?? 0;
91180
- const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
91240
+ const indent = extractParagraphIndent(block.attrs?.indent);
91241
+ const availableWidth = Math.max(0, fragment.width - (indent.left + indent.right));
91181
91242
  const charX = measureCharacterX(block, line, pmOffset, availableWidth);
91182
- const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
91183
91243
  const isFirstLine = index2 === fragment.fromLine;
91184
- const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && (fragment.markerWidth ?? 0) > 0;
91185
- let indentAdjust = 0;
91186
- if (!isListFirstLine) {
91187
- indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
91244
+ const isListItemFlag = isListItem(markerWidth, block);
91245
+ const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && isListItemFlag;
91246
+ const wordLayout = getWordLayoutConfig(block);
91247
+ const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
91248
+ if (isListFirstLine && isFirstLineIndentMode) {
91249
+ const textStartPx = calculateTextStartIndent({
91250
+ isFirstLine,
91251
+ isListItem: isListItemFlag,
91252
+ markerWidth,
91253
+ paraIndentLeft: indent.left,
91254
+ firstLineIndent: indent.firstLine,
91255
+ hangingIndent: indent.hanging,
91256
+ wordLayout
91257
+ });
91258
+ const localX2 = fragment.x + textStartPx + charX;
91259
+ const lineOffset2 = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
91260
+ const localY2 = fragment.y + lineOffset2;
91261
+ const result2 = {
91262
+ pageIndex: hit.pageIndex,
91263
+ x: localX2,
91264
+ y: localY2,
91265
+ height: line.lineHeight
91266
+ };
91267
+ const pageEl2 = __privateGet$1(this, _painterHost)?.querySelector(
91268
+ `.superdoc-page[data-page-index="${hit.pageIndex}"]`
91269
+ );
91270
+ const pageRect2 = pageEl2?.getBoundingClientRect();
91271
+ const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
91272
+ let domCaretX2 = null;
91273
+ let domCaretY2 = null;
91274
+ const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
91275
+ for (const spanEl of spanEls2) {
91276
+ const pmStart = Number(spanEl.dataset.pmStart);
91277
+ const pmEnd = Number(spanEl.dataset.pmEnd);
91278
+ if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
91279
+ const textNode = spanEl.firstChild;
91280
+ const charIndex = Math.min(pos - pmStart, textNode.length);
91281
+ const rangeObj = document.createRange();
91282
+ rangeObj.setStart(textNode, charIndex);
91283
+ rangeObj.setEnd(textNode, charIndex);
91284
+ const rangeRect = rangeObj.getBoundingClientRect();
91285
+ if (pageRect2) {
91286
+ domCaretX2 = (rangeRect.left - pageRect2.left) / zoom2;
91287
+ domCaretY2 = (rangeRect.top - pageRect2.top) / zoom2;
91288
+ }
91289
+ break;
91290
+ }
91291
+ }
91292
+ if (includeDomFallback && domCaretX2 != null && domCaretY2 != null) {
91293
+ return {
91294
+ pageIndex: hit.pageIndex,
91295
+ x: domCaretX2,
91296
+ y: domCaretY2,
91297
+ height: line.lineHeight
91298
+ };
91299
+ }
91300
+ return result2;
91188
91301
  }
91189
- const localX = fragment.x + markerWidth + indentAdjust + charX;
91302
+ const indentAdjust = calculateTextStartIndent({
91303
+ isFirstLine,
91304
+ isListItem: isListItemFlag,
91305
+ markerWidth,
91306
+ paraIndentLeft: indent.left,
91307
+ firstLineIndent: indent.firstLine,
91308
+ hangingIndent: indent.hanging,
91309
+ wordLayout
91310
+ });
91311
+ const localX = fragment.x + indentAdjust + charX;
91190
91312
  const lineOffset = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
91191
91313
  const localY = fragment.y + lineOffset;
91192
91314
  const result = {