@harbour-enterprises/superdoc 1.0.0-beta.86 → 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-CykepcoV.es.js → PdfViewer-2DqlQMKM.es.js} +1 -1
- package/dist/chunks/{PdfViewer-SI3BgkBA.cjs → PdfViewer-DBW8dNGO.cjs} +1 -1
- package/dist/chunks/{index-DeSyD44U-BKmM9Hn7.es.js → index-BLlh97IN-75N3psN2.es.js} +1 -1
- package/dist/chunks/{index-DeSyD44U-Dxv0c3H-.cjs → index-BLlh97IN-BF_Nyujm.cjs} +1 -1
- package/dist/chunks/{index-xfoqV3U-.cjs → index-i17b8wYa.cjs} +3 -3
- package/dist/chunks/{index-BpJVC0Wc.es.js → index-nvs_L5an.es.js} +3 -3
- package/dist/chunks/{super-editor.es-DLa6Nlsi.cjs → super-editor.es-DB49uQPF.cjs} +244 -36
- package/dist/chunks/{super-editor.es-CEmkebDF.es.js → super-editor.es-DpbjE-x_.es.js} +244 -36
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-B25GbVbB.js → converter-CjKHGzQU.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-ROb6hWD8.js → docx-zipper-BDVppBrA.js} +1 -1
- package/dist/super-editor/chunks/{editor-C2fZMnwi.js → editor-CgbApADp.js} +240 -32
- package/dist/super-editor/chunks/{index-DeSyD44U.js → index-BLlh97IN.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CzcKT6WT.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 +246 -38
- package/dist/superdoc.umd.js.map +1 -1
- 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-
|
|
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-
|
|
4
|
+
const superdoc = require("./index-i17b8wYa.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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.
|
|
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-
|
|
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-
|
|
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.
|
|
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,
|
|
19634
|
+
const getEffectiveBefore = (nextSpacing, isListItem2) => {
|
|
19635
19635
|
if (!nextSpacing) return 0;
|
|
19636
|
-
if (nextSpacing.beforeAutospacing &&
|
|
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,
|
|
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 (
|
|
20028
|
+
if (isListItem2) {
|
|
20029
20029
|
before = 0;
|
|
20030
20030
|
}
|
|
20031
20031
|
}
|
|
20032
20032
|
after = twipsToPixels$2(after);
|
|
20033
20033
|
if (afterAutospacing) {
|
|
20034
|
-
if (
|
|
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.
|
|
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
|
/**
|
|
@@ -56563,6 +56563,23 @@ const findTrackedMarkBetween = ({
|
|
|
56563
56563
|
};
|
|
56564
56564
|
}
|
|
56565
56565
|
});
|
|
56566
|
+
const nodeAtEndPosition = doc2.nodeAt(endPos);
|
|
56567
|
+
if (nodeAtEndPosition?.type?.name === "run") {
|
|
56568
|
+
const node = nodeAtEndPosition.content?.content?.[0];
|
|
56569
|
+
const isTextNode = node?.type?.name === "text";
|
|
56570
|
+
if (isTextNode) {
|
|
56571
|
+
const mark = node.marks.find(
|
|
56572
|
+
(mark2) => mark2.type.name === markName && Object.keys(attrs).every((attr) => mark2.attrs[attr] === attrs[attr])
|
|
56573
|
+
);
|
|
56574
|
+
if (mark && !markFound) {
|
|
56575
|
+
markFound = {
|
|
56576
|
+
from: endPos,
|
|
56577
|
+
to: endPos + node.nodeSize,
|
|
56578
|
+
mark
|
|
56579
|
+
};
|
|
56580
|
+
}
|
|
56581
|
+
}
|
|
56582
|
+
}
|
|
56566
56583
|
return markFound;
|
|
56567
56584
|
};
|
|
56568
56585
|
const markInsertion = ({ tr, from: from2, to, user, date }) => {
|
|
@@ -59586,7 +59603,7 @@ const isHeadless = (editor) => {
|
|
|
59586
59603
|
const shouldSkipNodeView = (editor) => {
|
|
59587
59604
|
return isHeadless(editor);
|
|
59588
59605
|
};
|
|
59589
|
-
const summaryVersion = "1.0.0-beta.
|
|
59606
|
+
const summaryVersion = "1.0.0-beta.88";
|
|
59590
59607
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
59591
59608
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
59592
59609
|
function mapAttributes(attrs) {
|
|
@@ -60375,7 +60392,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60375
60392
|
{ default: remarkStringify },
|
|
60376
60393
|
{ default: remarkGfm }
|
|
60377
60394
|
] = await Promise.all([
|
|
60378
|
-
Promise.resolve().then(() => require("./index-
|
|
60395
|
+
Promise.resolve().then(() => require("./index-BLlh97IN-BF_Nyujm.cjs")),
|
|
60379
60396
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
60380
60397
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
60381
60398
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -60580,7 +60597,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
60580
60597
|
* Process collaboration migrations
|
|
60581
60598
|
*/
|
|
60582
60599
|
processCollaborationMigrations() {
|
|
60583
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
60600
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.88");
|
|
60584
60601
|
if (!this.options.ydoc) return;
|
|
60585
60602
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
60586
60603
|
let docVersion = metaMap.get("version");
|
|
@@ -63656,7 +63673,9 @@ function hydrateImageBlocks(blocks, mediaFiles) {
|
|
|
63656
63673
|
let cellsChanged = false;
|
|
63657
63674
|
const newCells = row.cells.map((cell) => {
|
|
63658
63675
|
let cellChanged = false;
|
|
63659
|
-
const hydratedBlocks = (cell.blocks ?? (cell.paragraph ? [cell.paragraph] : [])).map(
|
|
63676
|
+
const hydratedBlocks = (cell.blocks ?? (cell.paragraph ? [cell.paragraph] : [])).map(
|
|
63677
|
+
(cb) => hydrateBlock(cb)
|
|
63678
|
+
);
|
|
63660
63679
|
if (cell.blocks && hydratedBlocks !== cell.blocks) {
|
|
63661
63680
|
cellChanged = true;
|
|
63662
63681
|
}
|
|
@@ -63691,6 +63710,40 @@ function hydrateImageBlocks(blocks, mediaFiles) {
|
|
|
63691
63710
|
}
|
|
63692
63711
|
return blk;
|
|
63693
63712
|
}
|
|
63713
|
+
if (blk.kind === "drawing") {
|
|
63714
|
+
const drawingBlock = blk;
|
|
63715
|
+
if (drawingBlock.drawingKind !== "shapeGroup") {
|
|
63716
|
+
return blk;
|
|
63717
|
+
}
|
|
63718
|
+
const shapeGroupBlock = drawingBlock;
|
|
63719
|
+
if (!shapeGroupBlock.shapes || shapeGroupBlock.shapes.length === 0) {
|
|
63720
|
+
return blk;
|
|
63721
|
+
}
|
|
63722
|
+
let shapesChanged = false;
|
|
63723
|
+
const hydratedShapes = shapeGroupBlock.shapes.map((shape) => {
|
|
63724
|
+
if (shape.shapeType !== "image") {
|
|
63725
|
+
return shape;
|
|
63726
|
+
}
|
|
63727
|
+
const imageChild = shape;
|
|
63728
|
+
const src = imageChild.attrs?.src;
|
|
63729
|
+
if (!src || src.startsWith("data:")) {
|
|
63730
|
+
return shape;
|
|
63731
|
+
}
|
|
63732
|
+
const resolvedSrc = resolveImageSrc(src);
|
|
63733
|
+
if (resolvedSrc) {
|
|
63734
|
+
shapesChanged = true;
|
|
63735
|
+
return {
|
|
63736
|
+
...imageChild,
|
|
63737
|
+
attrs: { ...imageChild.attrs, src: resolvedSrc }
|
|
63738
|
+
};
|
|
63739
|
+
}
|
|
63740
|
+
return shape;
|
|
63741
|
+
});
|
|
63742
|
+
if (shapesChanged) {
|
|
63743
|
+
return { ...shapeGroupBlock, shapes: hydratedShapes };
|
|
63744
|
+
}
|
|
63745
|
+
return blk;
|
|
63746
|
+
}
|
|
63694
63747
|
return blk;
|
|
63695
63748
|
};
|
|
63696
63749
|
return hydrateBlock(block);
|
|
@@ -73254,6 +73307,7 @@ const renderTableCell = (deps) => {
|
|
|
73254
73307
|
cell,
|
|
73255
73308
|
borders,
|
|
73256
73309
|
renderLine,
|
|
73310
|
+
renderDrawingContent,
|
|
73257
73311
|
context,
|
|
73258
73312
|
applySdtDataset,
|
|
73259
73313
|
fromLine,
|
|
@@ -73396,6 +73450,11 @@ const renderTableCell = (deps) => {
|
|
|
73396
73450
|
img.style.height = "100%";
|
|
73397
73451
|
img.style.objectFit = block.objectFit ?? "contain";
|
|
73398
73452
|
drawingInner.appendChild(img);
|
|
73453
|
+
} else if (renderDrawingContent) {
|
|
73454
|
+
const drawingContent = renderDrawingContent(block);
|
|
73455
|
+
drawingContent.style.width = "100%";
|
|
73456
|
+
drawingContent.style.height = "100%";
|
|
73457
|
+
drawingInner.appendChild(drawingContent);
|
|
73399
73458
|
} else {
|
|
73400
73459
|
const placeholder = doc2.createElement("div");
|
|
73401
73460
|
placeholder.style.width = "100%";
|
|
@@ -73521,6 +73580,7 @@ const renderTableRow = (deps) => {
|
|
|
73521
73580
|
allRowHeights,
|
|
73522
73581
|
context,
|
|
73523
73582
|
renderLine,
|
|
73583
|
+
renderDrawingContent,
|
|
73524
73584
|
applySdtDataset,
|
|
73525
73585
|
continuesFromPrev,
|
|
73526
73586
|
continuesOnNext,
|
|
@@ -73617,6 +73677,7 @@ const renderTableRow = (deps) => {
|
|
|
73617
73677
|
cell,
|
|
73618
73678
|
borders: resolvedBorders,
|
|
73619
73679
|
renderLine,
|
|
73680
|
+
renderDrawingContent,
|
|
73620
73681
|
context,
|
|
73621
73682
|
applySdtDataset,
|
|
73622
73683
|
fromLine,
|
|
@@ -73670,7 +73731,17 @@ function applySdtContainerStyling(doc2, container, sdt, containerSdt) {
|
|
|
73670
73731
|
container.appendChild(labelEl);
|
|
73671
73732
|
}
|
|
73672
73733
|
const renderTableFragment = (deps) => {
|
|
73673
|
-
const {
|
|
73734
|
+
const {
|
|
73735
|
+
doc: doc2,
|
|
73736
|
+
fragment,
|
|
73737
|
+
blockLookup,
|
|
73738
|
+
context,
|
|
73739
|
+
renderLine,
|
|
73740
|
+
renderDrawingContent,
|
|
73741
|
+
applyFragmentFrame,
|
|
73742
|
+
applySdtDataset,
|
|
73743
|
+
applyStyles: applyStyles2
|
|
73744
|
+
} = deps;
|
|
73674
73745
|
if (!doc2) {
|
|
73675
73746
|
console.error("DomPainter: document is not available");
|
|
73676
73747
|
if (typeof document !== "undefined") {
|
|
@@ -73800,6 +73871,7 @@ const renderTableFragment = (deps) => {
|
|
|
73800
73871
|
allRowHeights,
|
|
73801
73872
|
context,
|
|
73802
73873
|
renderLine,
|
|
73874
|
+
renderDrawingContent,
|
|
73803
73875
|
applySdtDataset,
|
|
73804
73876
|
// Headers are always rendered as-is (no border suppression)
|
|
73805
73877
|
continuesFromPrev: false,
|
|
@@ -73829,6 +73901,7 @@ const renderTableFragment = (deps) => {
|
|
|
73829
73901
|
allRowHeights,
|
|
73830
73902
|
context,
|
|
73831
73903
|
renderLine,
|
|
73904
|
+
renderDrawingContent,
|
|
73832
73905
|
applySdtDataset,
|
|
73833
73906
|
// Draw top border if table continues from previous fragment (MS Word behavior)
|
|
73834
73907
|
continuesFromPrev: isFirstRenderedBodyRow && fragment.continuesFromPrev === true,
|
|
@@ -76071,12 +76144,25 @@ const _DomPainter = class _DomPainter2 {
|
|
|
76071
76144
|
const renderLineForTableCell = (block, line, ctx2) => {
|
|
76072
76145
|
return this.renderLine(block, line, ctx2, void 0, void 0, true);
|
|
76073
76146
|
};
|
|
76147
|
+
const renderDrawingContentForTableCell = (block) => {
|
|
76148
|
+
if (block.drawingKind === "image") {
|
|
76149
|
+
return this.createDrawingImageElement(block);
|
|
76150
|
+
}
|
|
76151
|
+
if (block.drawingKind === "shapeGroup") {
|
|
76152
|
+
return this.createShapeGroupElement(block);
|
|
76153
|
+
}
|
|
76154
|
+
if (block.drawingKind === "vectorShape") {
|
|
76155
|
+
return this.createVectorShapeElement(block, block.geometry, false);
|
|
76156
|
+
}
|
|
76157
|
+
return this.createDrawingPlaceholder();
|
|
76158
|
+
};
|
|
76074
76159
|
return renderTableFragment({
|
|
76075
76160
|
doc: this.doc,
|
|
76076
76161
|
fragment,
|
|
76077
76162
|
context,
|
|
76078
76163
|
blockLookup: this.blockLookup,
|
|
76079
76164
|
renderLine: renderLineForTableCell,
|
|
76165
|
+
renderDrawingContent: renderDrawingContentForTableCell,
|
|
76080
76166
|
applyFragmentFrame: applyFragmentFrameWithSection,
|
|
76081
76167
|
applySdtDataset: this.applySdtDataset.bind(this),
|
|
76082
76168
|
applyStyles: applyStyles$2
|
|
@@ -78199,6 +78285,50 @@ function findCharIndexAtX(textNode, container, targetX) {
|
|
|
78199
78285
|
}
|
|
78200
78286
|
return index2;
|
|
78201
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
|
+
}
|
|
78202
78332
|
const defaultHeaderFooterIdentifier = () => ({
|
|
78203
78333
|
headerIds: { default: null, first: null, even: null, odd: null },
|
|
78204
78334
|
footerIds: { default: null, first: null, even: null, odd: null },
|
|
@@ -83210,8 +83340,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
83210
83340
|
);
|
|
83211
83341
|
}
|
|
83212
83342
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
83213
|
-
const
|
|
83214
|
-
const alignmentOverride =
|
|
83343
|
+
const isListItem3 = markerWidth > 0;
|
|
83344
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
83215
83345
|
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
|
|
83216
83346
|
if (pos == null) {
|
|
83217
83347
|
logClickStage("warn", "no-position", {
|
|
@@ -83255,8 +83385,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
83255
83385
|
);
|
|
83256
83386
|
}
|
|
83257
83387
|
const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
|
|
83258
|
-
const
|
|
83259
|
-
const alignmentOverride =
|
|
83388
|
+
const isListItem3 = cellMarkerWidth > 0;
|
|
83389
|
+
const alignmentOverride = isListItem3 ? "left" : void 0;
|
|
83260
83390
|
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
|
|
83261
83391
|
if (pos != null) {
|
|
83262
83392
|
logClickStage("log", "success", {
|
|
@@ -83414,17 +83544,22 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83414
83544
|
const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
|
|
83415
83545
|
const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
|
|
83416
83546
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
83417
|
-
const
|
|
83418
|
-
const alignmentOverride =
|
|
83547
|
+
const isListItemFlag = isListItem(markerWidth, block);
|
|
83548
|
+
const alignmentOverride = isListItemFlag ? "left" : void 0;
|
|
83419
83549
|
const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
|
|
83420
83550
|
const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
|
|
83421
|
-
const
|
|
83422
|
-
const
|
|
83551
|
+
const indent = extractParagraphIndent(block.attrs?.indent);
|
|
83552
|
+
const wordLayout = getWordLayoutConfig(block);
|
|
83423
83553
|
const isFirstLine = index2 === fragment.fromLine;
|
|
83424
|
-
|
|
83425
|
-
|
|
83426
|
-
|
|
83427
|
-
|
|
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
|
+
});
|
|
83428
83563
|
const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
|
|
83429
83564
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
83430
83565
|
const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
|
|
@@ -83527,9 +83662,12 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83527
83662
|
let blockTopCursor = padding.top + verticalOffset;
|
|
83528
83663
|
renderedBlocks.forEach((info) => {
|
|
83529
83664
|
const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
|
|
83530
|
-
const
|
|
83531
|
-
const alignmentOverride =
|
|
83532
|
-
const
|
|
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);
|
|
83533
83671
|
const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
|
|
83534
83672
|
intersectingLines.forEach(({ line, index: index2 }) => {
|
|
83535
83673
|
if (index2 < info.startLine || index2 >= info.endLine) {
|
|
@@ -83545,7 +83683,17 @@ function selectionToRects(layout, blocks, measures, from2, to) {
|
|
|
83545
83683
|
const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
|
|
83546
83684
|
const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
|
|
83547
83685
|
const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
|
|
83548
|
-
const
|
|
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);
|
|
83549
83697
|
const rectWidth = Math.max(1, Math.abs(endX - startX));
|
|
83550
83698
|
const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
|
|
83551
83699
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
@@ -91089,18 +91237,78 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
91089
91237
|
if (range2.pmStart == null || range2.pmEnd == null) return null;
|
|
91090
91238
|
const pmOffset = pmPosToCharOffset(block, line, pos);
|
|
91091
91239
|
const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
|
|
91092
|
-
const
|
|
91093
|
-
const
|
|
91094
|
-
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));
|
|
91095
91242
|
const charX = measureCharacterX(block, line, pmOffset, availableWidth);
|
|
91096
|
-
const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
|
|
91097
91243
|
const isFirstLine = index2 === fragment.fromLine;
|
|
91098
|
-
const
|
|
91099
|
-
|
|
91100
|
-
|
|
91101
|
-
|
|
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;
|
|
91102
91301
|
}
|
|
91103
|
-
const
|
|
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;
|
|
91104
91312
|
const lineOffset = __privateMethod$1(this, _PresentationEditor_instances, lineHeightBeforeIndex_fn).call(this, measure.lines, fragment.fromLine, index2);
|
|
91105
91313
|
const localY = fragment.y + lineOffset;
|
|
91106
91314
|
const result = {
|