@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,6 +1,6 @@
1
- import { E } from "./chunks/editor-BQsR9BR1.js";
2
- import "./chunks/converter-G519mwN2.js";
3
- import "./chunks/docx-zipper-CHfjJ_h-.js";
1
+ import { E } from "./chunks/editor-CgbApADp.js";
2
+ import "./chunks/converter-CjKHGzQU.js";
3
+ import "./chunks/docx-zipper-BDVppBrA.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CHfjJ_h-.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BDVppBrA.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
12
- import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-G519mwN2.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-G519mwN2.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-BQsR9BR1.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-BQsR9BR1.js";
12
+ import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-CjKHGzQU.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-CjKHGzQU.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-CgbApADp.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-CgbApADp.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-DNfQq2Cl.js";
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-BEQMP5-e.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-CHfjJ_h-.js";
19
+ import { D } from "./chunks/docx-zipper-BDVppBrA.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DNfQq2Cl.js";
3
- import "./chunks/editor-BQsR9BR1.js";
2
+ import { T } from "./chunks/toolbar-BEQMP5-e.js";
3
+ import "./chunks/editor-CgbApADp.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -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-C43B4f8Z.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DB49uQPF.cjs");
4
4
  require("./chunks/vue-jWLMl8Ts.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -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-BuujpqOr.es.js";
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-DpbjE-x_.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-C43B4f8Z.cjs");
4
- const superdoc = require("./chunks/index-huIbWXSg.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DB49uQPF.cjs");
4
+ const superdoc = require("./chunks/index-i17b8wYa.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;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BuujpqOr.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-BV2SxVfK.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DpbjE-x_.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-nvs_L5an.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -19632,9 +19632,9 @@
19632
19632
  const { spacing, indent: indent2, borders, justification } = paragraphProperties;
19633
19633
  const nextStyleId = nextParagraphProps?.styleId;
19634
19634
  if (spacing) {
19635
- const getEffectiveBefore = (nextSpacing, isListItem) => {
19635
+ const getEffectiveBefore = (nextSpacing, isListItem2) => {
19636
19636
  if (!nextSpacing) return 0;
19637
- if (nextSpacing.beforeAutospacing && isListItem) {
19637
+ if (nextSpacing.beforeAutospacing && isListItem2) {
19638
19638
  return 0;
19639
19639
  }
19640
19640
  return nextSpacing.before || 0;
@@ -20015,7 +20015,7 @@
20015
20015
  }
20016
20016
  String(value).split(/\s+/).map((entry) => entry.trim()).filter(Boolean).forEach((entry) => targetSet.add(entry));
20017
20017
  }
20018
- const getSpacingStyle = (spacing, isListItem) => {
20018
+ const getSpacingStyle = (spacing, isListItem2) => {
20019
20019
  let { before, after, line, lineRule, beforeAutospacing, afterAutospacing } = spacing;
20020
20020
  line = twipsToLines(line);
20021
20021
  if (line != null && line < 1) {
@@ -20026,13 +20026,13 @@
20026
20026
  }
20027
20027
  before = twipsToPixels$2(before);
20028
20028
  if (beforeAutospacing) {
20029
- if (isListItem) {
20029
+ if (isListItem2) {
20030
20030
  before = 0;
20031
20031
  }
20032
20032
  }
20033
20033
  after = twipsToPixels$2(after);
20034
20034
  if (afterAutospacing) {
20035
- if (isListItem) {
20035
+ if (isListItem2) {
20036
20036
  after = 0;
20037
20037
  }
20038
20038
  }
@@ -42398,7 +42398,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42398
42398
  static getStoredSuperdocVersion(docx) {
42399
42399
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42400
42400
  }
42401
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.87") {
42401
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.88") {
42402
42402
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42403
42403
  }
42404
42404
  /**
@@ -67461,7 +67461,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
67461
67461
  const shouldSkipNodeView = (editor) => {
67462
67462
  return isHeadless(editor);
67463
67463
  };
67464
- const summaryVersion = "1.0.0-beta.87";
67464
+ const summaryVersion = "1.0.0-beta.88";
67465
67465
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
67466
67466
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
67467
67467
  function mapAttributes(attrs) {
@@ -68250,7 +68250,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68250
68250
  { default: remarkStringify2 },
68251
68251
  { default: remarkGfm2 }
68252
68252
  ] = await Promise.all([
68253
- Promise.resolve().then(() => indexRv7o9043),
68253
+ Promise.resolve().then(() => indexBLlh97IN),
68254
68254
  Promise.resolve().then(() => indexDRCvimau),
68255
68255
  Promise.resolve().then(() => indexC_x_N6Uh),
68256
68256
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -68455,7 +68455,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68455
68455
  * Process collaboration migrations
68456
68456
  */
68457
68457
  processCollaborationMigrations() {
68458
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.87");
68458
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.88");
68459
68459
  if (!this.options.ydoc) return;
68460
68460
  const metaMap = this.options.ydoc.getMap("meta");
68461
68461
  let docVersion = metaMap.get("version");
@@ -86143,6 +86143,50 @@ ${l}
86143
86143
  }
86144
86144
  return index2;
86145
86145
  }
86146
+ function getWordLayoutConfig(block) {
86147
+ if (!block || block.kind !== "paragraph") {
86148
+ return void 0;
86149
+ }
86150
+ return block.attrs?.wordLayout;
86151
+ }
86152
+ function isListItem(markerWidth, block) {
86153
+ const hasMarkerWidth = markerWidth > 0;
86154
+ if (hasMarkerWidth) {
86155
+ return true;
86156
+ }
86157
+ if (!block || block.kind !== "paragraph") {
86158
+ return false;
86159
+ }
86160
+ const wordLayout = getWordLayoutConfig(block);
86161
+ const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
86162
+ if (hasListAttrs) {
86163
+ return true;
86164
+ }
86165
+ const hangingIndent = block.attrs?.indent?.hanging ?? 0;
86166
+ const paraIndentLeft = block.attrs?.indent?.left ?? 0;
86167
+ const hasHangingIndentPattern = hangingIndent > 0 && paraIndentLeft > 0;
86168
+ return hasHangingIndentPattern;
86169
+ }
86170
+ function calculateTextStartIndent(params2) {
86171
+ const { isFirstLine, isListItem: isListItem2, markerWidth, paraIndentLeft, firstLineIndent, hangingIndent, wordLayout } = params2;
86172
+ const firstLineOffset = firstLineIndent - hangingIndent;
86173
+ const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
86174
+ let indentAdjust = paraIndentLeft;
86175
+ if (isListItem2 && isFirstLine && isFirstLineIndentMode) {
86176
+ const textStartFallback = paraIndentLeft + Math.max(firstLineIndent, 0) + markerWidth;
86177
+ indentAdjust = typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : textStartFallback;
86178
+ } else if (isFirstLine && !isListItem2) {
86179
+ indentAdjust += firstLineOffset;
86180
+ }
86181
+ return indentAdjust;
86182
+ }
86183
+ function extractParagraphIndent(indent2) {
86184
+ const left2 = typeof indent2?.left === "number" && Number.isFinite(indent2.left) ? indent2.left : 0;
86185
+ const right2 = typeof indent2?.right === "number" && Number.isFinite(indent2.right) ? indent2.right : 0;
86186
+ const firstLine = typeof indent2?.firstLine === "number" && Number.isFinite(indent2.firstLine) ? indent2.firstLine : 0;
86187
+ const hanging = typeof indent2?.hanging === "number" && Number.isFinite(indent2.hanging) ? indent2.hanging : 0;
86188
+ return { left: left2, right: right2, firstLine, hanging };
86189
+ }
86146
86190
  const defaultHeaderFooterIdentifier = () => ({
86147
86191
  headerIds: { default: null, first: null, even: null, odd: null },
86148
86192
  footerIds: { default: null, first: null, even: null, odd: null },
@@ -91154,8 +91198,8 @@ ${l}
91154
91198
  );
91155
91199
  }
91156
91200
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
91157
- const isListItem = markerWidth > 0;
91158
- const alignmentOverride = isListItem ? "left" : void 0;
91201
+ const isListItem3 = markerWidth > 0;
91202
+ const alignmentOverride = isListItem3 ? "left" : void 0;
91159
91203
  const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
91160
91204
  if (pos == null) {
91161
91205
  logClickStage("warn", "no-position", {
@@ -91199,8 +91243,8 @@ ${l}
91199
91243
  );
91200
91244
  }
91201
91245
  const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
91202
- const isListItem = cellMarkerWidth > 0;
91203
- const alignmentOverride = isListItem ? "left" : void 0;
91246
+ const isListItem3 = cellMarkerWidth > 0;
91247
+ const alignmentOverride = isListItem3 ? "left" : void 0;
91204
91248
  const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
91205
91249
  if (pos != null) {
91206
91250
  logClickStage("log", "success", {
@@ -91358,17 +91402,22 @@ ${l}
91358
91402
  const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
91359
91403
  const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
91360
91404
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
91361
- const isListItem = markerWidth > 0;
91362
- const alignmentOverride = isListItem ? "left" : void 0;
91405
+ const isListItemFlag = isListItem(markerWidth, block);
91406
+ const alignmentOverride = isListItemFlag ? "left" : void 0;
91363
91407
  const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
91364
91408
  const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
91365
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
91366
- const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
91409
+ const indent2 = extractParagraphIndent(block.attrs?.indent);
91410
+ const wordLayout = getWordLayoutConfig(block);
91367
91411
  const isFirstLine = index2 === fragment.fromLine;
91368
- let indentAdjust = paraIndentLeft;
91369
- if (isFirstLine && !isListItem) {
91370
- indentAdjust += firstLineOffset;
91371
- }
91412
+ const indentAdjust = calculateTextStartIndent({
91413
+ isFirstLine,
91414
+ isListItem: isListItemFlag,
91415
+ markerWidth,
91416
+ paraIndentLeft: indent2.left,
91417
+ firstLineIndent: indent2.firstLine,
91418
+ hangingIndent: indent2.hanging,
91419
+ wordLayout
91420
+ });
91372
91421
  const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
91373
91422
  const rectWidth = Math.max(1, Math.abs(endX - startX));
91374
91423
  const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
@@ -91471,9 +91520,12 @@ ${l}
91471
91520
  let blockTopCursor = padding.top + verticalOffset;
91472
91521
  renderedBlocks.forEach((info) => {
91473
91522
  const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
91474
- const isListItem = paragraphMarkerWidth > 0;
91475
- const alignmentOverride = isListItem ? "left" : void 0;
91476
- const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
91523
+ const cellIsListItem = isListItem(paragraphMarkerWidth, info.block);
91524
+ const alignmentOverride = cellIsListItem ? "left" : void 0;
91525
+ const cellIndent = extractParagraphIndent(
91526
+ info.block.kind === "paragraph" ? info.block.attrs?.indent : void 0
91527
+ );
91528
+ const cellWordLayout = getWordLayoutConfig(info.block);
91477
91529
  const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
91478
91530
  intersectingLines.forEach(({ line, index: index2 }) => {
91479
91531
  if (index2 < info.startLine || index2 >= info.endLine) {
@@ -91489,7 +91541,17 @@ ${l}
91489
91541
  const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
91490
91542
  const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
91491
91543
  const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
91492
- const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
91544
+ const isFirstLine = index2 === info.startLine;
91545
+ const textIndentAdjust = calculateTextStartIndent({
91546
+ isFirstLine,
91547
+ isListItem: cellIsListItem,
91548
+ markerWidth: paragraphMarkerWidth,
91549
+ paraIndentLeft: cellIndent.left,
91550
+ firstLineIndent: cellIndent.firstLine,
91551
+ hangingIndent: cellIndent.hanging,
91552
+ wordLayout: cellWordLayout
91553
+ });
91554
+ const rectX = fragment.x + cellX + padding.left + textIndentAdjust + Math.min(startX, endX);
91493
91555
  const rectWidth = Math.max(1, Math.abs(endX - startX));
91494
91556
  const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
91495
91557
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
@@ -99033,18 +99095,78 @@ ${l}
99033
99095
  if (range2.pmStart == null || range2.pmEnd == null) return null;
99034
99096
  const pmOffset = pmPosToCharOffset(block, line, pos);
99035
99097
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
99036
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
99037
- const paraIndentRight = block.attrs?.indent?.right ?? 0;
99038
- const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
99098
+ const indent2 = extractParagraphIndent(block.attrs?.indent);
99099
+ const availableWidth = Math.max(0, fragment.width - (indent2.left + indent2.right));
99039
99100
  const charX = measureCharacterX(block, line, pmOffset, availableWidth);
99040
- const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
99041
99101
  const isFirstLine = index2 === fragment.fromLine;
99042
- const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && (fragment.markerWidth ?? 0) > 0;
99043
- let indentAdjust = 0;
99044
- if (!isListFirstLine) {
99045
- indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
99102
+ const isListItemFlag = isListItem(markerWidth, block);
99103
+ const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && isListItemFlag;
99104
+ const wordLayout = getWordLayoutConfig(block);
99105
+ const isFirstLineIndentMode = wordLayout?.firstLineIndentMode === true;
99106
+ if (isListFirstLine && isFirstLineIndentMode) {
99107
+ const textStartPx = calculateTextStartIndent({
99108
+ isFirstLine,
99109
+ isListItem: isListItemFlag,
99110
+ markerWidth,
99111
+ paraIndentLeft: indent2.left,
99112
+ firstLineIndent: indent2.firstLine,
99113
+ hangingIndent: indent2.hanging,
99114
+ wordLayout
99115
+ });
99116
+ const localX2 = fragment.x + textStartPx + charX;
99117
+ const lineOffset2 = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
99118
+ const localY2 = fragment.y + lineOffset2;
99119
+ const result2 = {
99120
+ pageIndex: hit.pageIndex,
99121
+ x: localX2,
99122
+ y: localY2,
99123
+ height: line.lineHeight
99124
+ };
99125
+ const pageEl2 = __privateGet$1(this, _painterHost)?.querySelector(
99126
+ `.superdoc-page[data-page-index="${hit.pageIndex}"]`
99127
+ );
99128
+ const pageRect2 = pageEl2?.getBoundingClientRect();
99129
+ const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
99130
+ let domCaretX2 = null;
99131
+ let domCaretY2 = null;
99132
+ const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
99133
+ for (const spanEl of spanEls2) {
99134
+ const pmStart = Number(spanEl.dataset.pmStart);
99135
+ const pmEnd = Number(spanEl.dataset.pmEnd);
99136
+ if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
99137
+ const textNode = spanEl.firstChild;
99138
+ const charIndex = Math.min(pos - pmStart, textNode.length);
99139
+ const rangeObj = document.createRange();
99140
+ rangeObj.setStart(textNode, charIndex);
99141
+ rangeObj.setEnd(textNode, charIndex);
99142
+ const rangeRect = rangeObj.getBoundingClientRect();
99143
+ if (pageRect2) {
99144
+ domCaretX2 = (rangeRect.left - pageRect2.left) / zoom2;
99145
+ domCaretY2 = (rangeRect.top - pageRect2.top) / zoom2;
99146
+ }
99147
+ break;
99148
+ }
99149
+ }
99150
+ if (includeDomFallback && domCaretX2 != null && domCaretY2 != null) {
99151
+ return {
99152
+ pageIndex: hit.pageIndex,
99153
+ x: domCaretX2,
99154
+ y: domCaretY2,
99155
+ height: line.lineHeight
99156
+ };
99157
+ }
99158
+ return result2;
99046
99159
  }
99047
- const localX = fragment.x + markerWidth + indentAdjust + charX;
99160
+ const indentAdjust = calculateTextStartIndent({
99161
+ isFirstLine,
99162
+ isListItem: isListItemFlag,
99163
+ markerWidth,
99164
+ paraIndentLeft: indent2.left,
99165
+ firstLineIndent: indent2.firstLine,
99166
+ hangingIndent: indent2.hanging,
99167
+ wordLayout
99168
+ });
99169
+ const localX = fragment.x + indentAdjust + charX;
99048
99170
  const lineOffset = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
99049
99171
  const localY = fragment.y + lineOffset;
99050
99172
  const result = {
@@ -151393,7 +151515,7 @@ ${style2}
151393
151515
  this.config.colors = shuffleArray(this.config.colors);
151394
151516
  this.userColorMap = /* @__PURE__ */ new Map();
151395
151517
  this.colorIndex = 0;
151396
- this.version = "1.0.0-beta.87";
151518
+ this.version = "1.0.0-beta.88";
151397
151519
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
151398
151520
  this.superdocId = config2.superdocId || v4();
151399
151521
  this.colors = this.config.colors;
@@ -153865,7 +153987,7 @@ ${style2}
153865
153987
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
153866
153988
  );
153867
153989
  }
153868
- const indexRv7o9043 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153990
+ const indexBLlh97IN = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153869
153991
  __proto__: null,
153870
153992
  unified
153871
153993
  }, Symbol.toStringTag, { value: "Module" }));