@harbour-enterprises/superdoc 1.12.0-next.13 → 1.12.0-next.14
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-BM8GbrHb.cjs → PdfViewer-CY2YJpu4.cjs} +2 -2
- package/dist/chunks/{PdfViewer-D9duMPBd.es.js → PdfViewer-CbstbhTN.es.js} +2 -2
- package/dist/chunks/{SuperConverter-Dx95dNlr.es.js → SuperConverter-CA4Y375g.es.js} +1 -1
- package/dist/chunks/{SuperConverter-BMjvGr5r.cjs → SuperConverter-OKWxKamo.cjs} +1 -1
- package/dist/chunks/{index-BTrpAvox.es.js → index-B6-qYQaj.es.js} +4 -4
- package/dist/chunks/{index-BF7DfWLs.cjs → index-CiZRgn7j.cjs} +119 -67
- package/dist/chunks/{index-DcUDN9u9.cjs → index-DQyH0Ms9.cjs} +4 -4
- package/dist/chunks/{index-C-t9SDCr.es.js → index-DwDTMIHF.es.js} +119 -67
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +120 -68
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-DQyH0Ms9.cjs");
|
|
5
|
+
const index = require("./index-CiZRgn7j.cjs");
|
|
6
6
|
function self(vars) {
|
|
7
7
|
const {
|
|
8
8
|
opacityDisabled,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, b as computed, r as ref, e as onMounted, f as onUnmounted, o as openBlock, c as createElementBlock, a as createBaseVNode, g as createVNode, u as unref, i as createCommentVNode } from "./vue-DiPLN5sT.es.js";
|
|
2
|
-
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-
|
|
3
|
-
import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-B6-qYQaj.es.js";
|
|
3
|
+
import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-DwDTMIHF.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -33817,7 +33817,7 @@ class SuperConverter {
|
|
|
33817
33817
|
static getStoredSuperdocVersion(docx) {
|
|
33818
33818
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33819
33819
|
}
|
|
33820
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.12.0-next.
|
|
33820
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.12.0-next.14") {
|
|
33821
33821
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33822
33822
|
}
|
|
33823
33823
|
/**
|
|
@@ -33818,7 +33818,7 @@ class SuperConverter {
|
|
|
33818
33818
|
static getStoredSuperdocVersion(docx) {
|
|
33819
33819
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33820
33820
|
}
|
|
33821
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.12.0-next.
|
|
33821
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.12.0-next.14") {
|
|
33822
33822
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33823
33823
|
}
|
|
33824
33824
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, aI as COMMUNITY_LICENSE_KEY, e as SuperToolbar } from "./index-
|
|
1
|
+
import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, aI as COMMUNITY_LICENSE_KEY, e as SuperToolbar } from "./index-DwDTMIHF.es.js";
|
|
2
2
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
3
3
|
import "./helpers-BqdwtJE0.es.js";
|
|
4
|
-
import "./SuperConverter-
|
|
4
|
+
import "./SuperConverter-CA4Y375g.es.js";
|
|
5
5
|
import { E as EventEmitter$1 } from "./eventemitter3-DdGu2UnW.es.js";
|
|
6
6
|
import { j as inject, k as provide, b as computed, l as onBeforeUnmount, p as process$1, m as onBeforeMount, d as defineComponent, h, t as toRef, T as Transition, n as TransitionGroup, w as watchEffect, r as ref, e as onMounted, q as Teleport, F as Fragment, s as reactive, v as effectScope, x as markRaw, y as toRaw, z as isRef, A as isReactive, B as watch, u as unref, C as hasInjectionContext, D as nextTick, E as getCurrentInstance, G as getCurrentScope, H as onScopeDispose, I as toRefs, J as global, K as shallowRef, o as openBlock, c as createElementBlock, g as createVNode, L as withCtx, a as createBaseVNode, M as toDisplayString, N as normalizeStyle, i as createCommentVNode, O as withModifiers, P as createBlock, Q as normalizeClass, R as resolveDirective, S as withDirectives, U as renderList, V as createApp, W as resolveDynamicComponent, X as defineAsyncComponent } from "./vue-DiPLN5sT.es.js";
|
|
7
7
|
import "./jszip.min-BCZQ7Wq2.es.js";
|
|
@@ -8152,7 +8152,7 @@ const _sfc_main = {
|
|
|
8152
8152
|
__name: "SuperDoc",
|
|
8153
8153
|
emits: ["selection-update"],
|
|
8154
8154
|
setup(__props, { emit: __emit }) {
|
|
8155
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
8155
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CbstbhTN.es.js"));
|
|
8156
8156
|
const superdocStore = useSuperdocStore();
|
|
8157
8157
|
const commentsStore = useCommentsStore();
|
|
8158
8158
|
const {
|
|
@@ -21626,7 +21626,7 @@ class SuperDoc extends EventEmitter$1 {
|
|
|
21626
21626
|
this.config.colors = shuffleArray(this.config.colors);
|
|
21627
21627
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
21628
21628
|
this.colorIndex = 0;
|
|
21629
|
-
this.version = "1.12.0-next.
|
|
21629
|
+
this.version = "1.12.0-next.14";
|
|
21630
21630
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
21631
21631
|
this.superdocId = config.superdocId || v4();
|
|
21632
21632
|
this.colors = this.config.colors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_converter = require("./SuperConverter-
|
|
2
|
+
const superEditor_converter = require("./SuperConverter-OKWxKamo.cjs");
|
|
3
3
|
const helpers$1 = require("./helpers-OFep8CYR.cjs");
|
|
4
4
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
5
5
|
require("./jszip.min-oAFpNMh5.cjs");
|
|
@@ -993,7 +993,7 @@ const DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
|
993
993
|
const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
|
|
994
994
|
function getSuperdocVersion() {
|
|
995
995
|
try {
|
|
996
|
-
return true ? "1.12.0-next.
|
|
996
|
+
return true ? "1.12.0-next.14" : "unknown";
|
|
997
997
|
} catch {
|
|
998
998
|
return "unknown";
|
|
999
999
|
}
|
|
@@ -17068,7 +17068,7 @@ const canUseDOM = () => {
|
|
|
17068
17068
|
return false;
|
|
17069
17069
|
}
|
|
17070
17070
|
};
|
|
17071
|
-
const summaryVersion = "1.12.0-next.
|
|
17071
|
+
const summaryVersion = "1.12.0-next.14";
|
|
17072
17072
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
17073
17073
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
17074
17074
|
function mapAttributes(attrs) {
|
|
@@ -19872,7 +19872,7 @@ class Editor extends EventEmitter {
|
|
|
19872
19872
|
* Process collaboration migrations
|
|
19873
19873
|
*/
|
|
19874
19874
|
processCollaborationMigrations() {
|
|
19875
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.12.0-next.
|
|
19875
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.12.0-next.14");
|
|
19876
19876
|
if (!this.options.ydoc) return;
|
|
19877
19877
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
19878
19878
|
let docVersion = metaMap.get("version");
|
|
@@ -25688,6 +25688,11 @@ const DOM_CLASS_NAMES = {
|
|
|
25688
25688
|
* Class name for block-level structured content containers.
|
|
25689
25689
|
*/
|
|
25690
25690
|
BLOCK_SDT: "superdoc-structured-content-block",
|
|
25691
|
+
/**
|
|
25692
|
+
* Class name for table fragment containers.
|
|
25693
|
+
* Applied to table fragments for resize overlay targeting and click mapping.
|
|
25694
|
+
*/
|
|
25695
|
+
TABLE_FRAGMENT: "superdoc-table-fragment",
|
|
25691
25696
|
/**
|
|
25692
25697
|
* Class name added to block SDT fragments on hover via event delegation.
|
|
25693
25698
|
* Applied/removed by SdtGroupedHover to highlight all fragments of the same SDT.
|
|
@@ -27383,16 +27388,31 @@ const renderTableFragment = (deps) => {
|
|
|
27383
27388
|
container.style.height = `${fragment.height}px`;
|
|
27384
27389
|
applySdtDataset(container, block.attrs?.sdt);
|
|
27385
27390
|
applySdtContainerStyling(doc2, container, block.attrs?.sdt, block.attrs?.containerSdt, sdtBoundary);
|
|
27386
|
-
container.classList.add(
|
|
27391
|
+
container.classList.add(DOM_CLASS_NAMES.TABLE_FRAGMENT);
|
|
27387
27392
|
if (fragment.metadata?.columnBoundaries) {
|
|
27388
27393
|
const columnCount = measure.columnWidths.length;
|
|
27389
|
-
const rowCount = block.rows.length;
|
|
27390
27394
|
const boundarySegments = [];
|
|
27391
27395
|
for (let i = 0; i < columnCount; i++) {
|
|
27392
27396
|
boundarySegments.push([]);
|
|
27393
27397
|
}
|
|
27398
|
+
const renderedRows = [];
|
|
27399
|
+
if (fragment.repeatHeaderCount && fragment.repeatHeaderCount > 0) {
|
|
27400
|
+
for (let r2 = 0; r2 < fragment.repeatHeaderCount; r2++) {
|
|
27401
|
+
const rowMeasure = measure.rows[r2];
|
|
27402
|
+
if (!rowMeasure) break;
|
|
27403
|
+
renderedRows.push({ rowIndex: r2, height: rowMeasure.height });
|
|
27404
|
+
}
|
|
27405
|
+
}
|
|
27406
|
+
for (let r2 = fragment.fromRow; r2 < fragment.toRow; r2++) {
|
|
27407
|
+
const rowMeasure = measure.rows[r2];
|
|
27408
|
+
if (!rowMeasure) break;
|
|
27409
|
+
const isPartialRow = fragment.partialRow && fragment.partialRow.rowIndex === r2;
|
|
27410
|
+
const actualHeight = isPartialRow ? fragment.partialRow.partialHeight : rowMeasure.height;
|
|
27411
|
+
renderedRows.push({ rowIndex: r2, height: actualHeight });
|
|
27412
|
+
}
|
|
27394
27413
|
let rowY = 0;
|
|
27395
|
-
for (let
|
|
27414
|
+
for (let i = 0; i < renderedRows.length; i++) {
|
|
27415
|
+
const { rowIndex, height } = renderedRows[i];
|
|
27396
27416
|
const rowMeasure = measure.rows[rowIndex];
|
|
27397
27417
|
if (!rowMeasure) continue;
|
|
27398
27418
|
const boundariesInRow = /* @__PURE__ */ new Set();
|
|
@@ -27410,19 +27430,19 @@ const renderTableFragment = (deps) => {
|
|
|
27410
27430
|
for (const boundaryCol of boundariesInRow) {
|
|
27411
27431
|
const segments = boundarySegments[boundaryCol];
|
|
27412
27432
|
const lastSegment = segments[segments.length - 1];
|
|
27413
|
-
if (lastSegment && lastSegment.toRow ===
|
|
27414
|
-
lastSegment.toRow =
|
|
27415
|
-
lastSegment.height +=
|
|
27433
|
+
if (lastSegment && i > 0 && lastSegment.toRow === i) {
|
|
27434
|
+
lastSegment.toRow = i + 1;
|
|
27435
|
+
lastSegment.height += height;
|
|
27416
27436
|
} else {
|
|
27417
27437
|
segments.push({
|
|
27418
|
-
fromRow:
|
|
27419
|
-
toRow:
|
|
27438
|
+
fromRow: i,
|
|
27439
|
+
toRow: i + 1,
|
|
27420
27440
|
y: rowY,
|
|
27421
|
-
height
|
|
27441
|
+
height
|
|
27422
27442
|
});
|
|
27423
27443
|
}
|
|
27424
27444
|
}
|
|
27425
|
-
rowY +=
|
|
27445
|
+
rowY += height;
|
|
27426
27446
|
}
|
|
27427
27447
|
const metadata = {
|
|
27428
27448
|
columns: fragment.metadata.columnBoundaries.map((boundary) => ({
|
|
@@ -44629,7 +44649,8 @@ const log = (...args) => {
|
|
|
44629
44649
|
const CLASS_NAMES = {
|
|
44630
44650
|
page: DOM_CLASS_NAMES.PAGE,
|
|
44631
44651
|
fragment: DOM_CLASS_NAMES.FRAGMENT,
|
|
44632
|
-
line: DOM_CLASS_NAMES.LINE
|
|
44652
|
+
line: DOM_CLASS_NAMES.LINE,
|
|
44653
|
+
tableFragment: DOM_CLASS_NAMES.TABLE_FRAGMENT
|
|
44633
44654
|
};
|
|
44634
44655
|
function clickToPositionDom(domContainer, clientX, clientY) {
|
|
44635
44656
|
const pageEl = findPageElement(domContainer, clientX, clientY);
|
|
@@ -44726,6 +44747,9 @@ function clickToPositionDom(domContainer, clientX, clientY) {
|
|
|
44726
44747
|
const result2 = processLineElement(hitChainLine, viewX);
|
|
44727
44748
|
return result2;
|
|
44728
44749
|
}
|
|
44750
|
+
if (fragmentEl.classList.contains(CLASS_NAMES.tableFragment)) {
|
|
44751
|
+
return null;
|
|
44752
|
+
}
|
|
44729
44753
|
const result = processFragment(fragmentEl, viewX, viewY);
|
|
44730
44754
|
return result;
|
|
44731
44755
|
}
|
|
@@ -52622,6 +52646,53 @@ var Priority = /* @__PURE__ */ ((Priority2) => {
|
|
|
52622
52646
|
const isAtomicFragment = (fragment) => {
|
|
52623
52647
|
return fragment.kind === "drawing" || fragment.kind === "image";
|
|
52624
52648
|
};
|
|
52649
|
+
function snapToNearestFragment(pageHit, blocks, measures, pageRelativePoint) {
|
|
52650
|
+
const fragments = pageHit.page.fragments.filter(
|
|
52651
|
+
(f) => f != null && typeof f === "object"
|
|
52652
|
+
);
|
|
52653
|
+
let nearestHit = null;
|
|
52654
|
+
let nearestDist = Infinity;
|
|
52655
|
+
for (const frag of fragments) {
|
|
52656
|
+
const isPara = frag.kind === "para";
|
|
52657
|
+
const isAtomic = isAtomicFragment(frag);
|
|
52658
|
+
if (!isPara && !isAtomic) continue;
|
|
52659
|
+
const blockIndex = findBlockIndexByFragmentId(blocks, frag.blockId);
|
|
52660
|
+
if (blockIndex === -1) continue;
|
|
52661
|
+
const block = blocks[blockIndex];
|
|
52662
|
+
const measure = measures[blockIndex];
|
|
52663
|
+
if (!block || !measure) continue;
|
|
52664
|
+
let fragHeight = 0;
|
|
52665
|
+
if (isAtomic) {
|
|
52666
|
+
fragHeight = frag.height;
|
|
52667
|
+
} else if (isPara && block.kind === "paragraph" && measure.kind === "paragraph") {
|
|
52668
|
+
fragHeight = measure.lines.slice(frag.fromLine, frag.toLine).reduce((sum, line) => sum + line.lineHeight, 0);
|
|
52669
|
+
} else {
|
|
52670
|
+
continue;
|
|
52671
|
+
}
|
|
52672
|
+
const top2 = frag.y;
|
|
52673
|
+
const bottom2 = frag.y + fragHeight;
|
|
52674
|
+
let dist;
|
|
52675
|
+
if (pageRelativePoint.y < top2) {
|
|
52676
|
+
dist = top2 - pageRelativePoint.y;
|
|
52677
|
+
} else if (pageRelativePoint.y > bottom2) {
|
|
52678
|
+
dist = pageRelativePoint.y - bottom2;
|
|
52679
|
+
} else {
|
|
52680
|
+
dist = 0;
|
|
52681
|
+
}
|
|
52682
|
+
if (dist < nearestDist) {
|
|
52683
|
+
nearestDist = dist;
|
|
52684
|
+
const pageY = Math.max(0, Math.min(pageRelativePoint.y - top2, fragHeight));
|
|
52685
|
+
nearestHit = {
|
|
52686
|
+
fragment: frag,
|
|
52687
|
+
block,
|
|
52688
|
+
measure,
|
|
52689
|
+
pageIndex: pageHit.pageIndex,
|
|
52690
|
+
pageY
|
|
52691
|
+
};
|
|
52692
|
+
}
|
|
52693
|
+
}
|
|
52694
|
+
return nearestHit;
|
|
52695
|
+
}
|
|
52625
52696
|
const logClickStage = (_level, _stage, _payload) => {
|
|
52626
52697
|
};
|
|
52627
52698
|
const logPositionDebug = (payload) => {
|
|
@@ -52926,66 +52997,46 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
52926
52997
|
return { pos: domPos, layoutEpoch: domLayoutEpoch, blockId: "", pageIndex: 0, column: 0, lineIndex: -1 };
|
|
52927
52998
|
}
|
|
52928
52999
|
}
|
|
52929
|
-
|
|
53000
|
+
let pageHit = null;
|
|
53001
|
+
let isContainerPointPageRelative = false;
|
|
53002
|
+
if (domContainer != null && clientX != null && clientY != null) {
|
|
53003
|
+
const pageEl = findPageElement(domContainer, clientX, clientY);
|
|
53004
|
+
if (pageEl) {
|
|
53005
|
+
const domPageIndex = Number(pageEl.dataset.pageIndex ?? "NaN");
|
|
53006
|
+
if (Number.isFinite(domPageIndex) && domPageIndex >= 0 && domPageIndex < layout.pages.length) {
|
|
53007
|
+
pageHit = { pageIndex: domPageIndex, page: layout.pages[domPageIndex] };
|
|
53008
|
+
isContainerPointPageRelative = true;
|
|
53009
|
+
}
|
|
53010
|
+
}
|
|
53011
|
+
}
|
|
53012
|
+
if (!pageHit) {
|
|
53013
|
+
pageHit = hitTestPage(layout, containerPoint, geometryHelper);
|
|
53014
|
+
}
|
|
52930
53015
|
if (!pageHit) {
|
|
52931
53016
|
return null;
|
|
52932
53017
|
}
|
|
52933
|
-
|
|
52934
|
-
|
|
52935
|
-
|
|
52936
|
-
|
|
52937
|
-
|
|
53018
|
+
let pageRelativePoint;
|
|
53019
|
+
if (isContainerPointPageRelative) {
|
|
53020
|
+
pageRelativePoint = containerPoint;
|
|
53021
|
+
} else {
|
|
53022
|
+
const pageTopY = geometryHelper ? geometryHelper.getPageTop(pageHit.pageIndex) : calculatePageTopFallback(layout, pageHit.pageIndex);
|
|
53023
|
+
pageRelativePoint = {
|
|
53024
|
+
x: containerPoint.x,
|
|
53025
|
+
y: containerPoint.y - pageTopY
|
|
53026
|
+
};
|
|
53027
|
+
}
|
|
52938
53028
|
logClickStage("log", "page-hit", {
|
|
52939
53029
|
pageIndex: pageHit.pageIndex
|
|
52940
53030
|
});
|
|
52941
53031
|
let fragmentHit = hitTestFragment(layout, pageHit, blocks, measures, pageRelativePoint);
|
|
52942
53032
|
if (!fragmentHit) {
|
|
52943
|
-
const
|
|
52944
|
-
|
|
52945
|
-
|
|
52946
|
-
);
|
|
52947
|
-
|
|
52948
|
-
|
|
52949
|
-
for (const frag of fragments) {
|
|
52950
|
-
const isPara = frag.kind === "para";
|
|
52951
|
-
const isAtomic = isAtomicFragment(frag);
|
|
52952
|
-
if (!isPara && !isAtomic) continue;
|
|
52953
|
-
const blockIndex = findBlockIndexByFragmentId(blocks, frag.blockId);
|
|
52954
|
-
if (blockIndex === -1) continue;
|
|
52955
|
-
const block = blocks[blockIndex];
|
|
52956
|
-
const measure = measures[blockIndex];
|
|
52957
|
-
if (!block || !measure) continue;
|
|
52958
|
-
let fragHeight = 0;
|
|
52959
|
-
if (isAtomic) {
|
|
52960
|
-
fragHeight = frag.height;
|
|
52961
|
-
} else if (isPara && block.kind === "paragraph" && measure.kind === "paragraph") {
|
|
52962
|
-
fragHeight = measure.lines.slice(frag.fromLine, frag.toLine).reduce((sum, line) => sum + line.lineHeight, 0);
|
|
52963
|
-
} else {
|
|
52964
|
-
continue;
|
|
52965
|
-
}
|
|
52966
|
-
const top2 = frag.y;
|
|
52967
|
-
const bottom2 = frag.y + fragHeight;
|
|
52968
|
-
let dist;
|
|
52969
|
-
if (pageRelativePoint.y < top2) {
|
|
52970
|
-
dist = top2 - pageRelativePoint.y;
|
|
52971
|
-
} else if (pageRelativePoint.y > bottom2) {
|
|
52972
|
-
dist = pageRelativePoint.y - bottom2;
|
|
52973
|
-
} else {
|
|
52974
|
-
dist = 0;
|
|
52975
|
-
}
|
|
52976
|
-
if (dist < nearestDist) {
|
|
52977
|
-
nearestDist = dist;
|
|
52978
|
-
const pageY = Math.max(0, Math.min(pageRelativePoint.y - top2, fragHeight));
|
|
52979
|
-
nearestHit = {
|
|
52980
|
-
fragment: frag,
|
|
52981
|
-
block,
|
|
52982
|
-
measure,
|
|
52983
|
-
pageIndex: pageHit.pageIndex,
|
|
52984
|
-
pageY
|
|
52985
|
-
};
|
|
52986
|
-
}
|
|
53033
|
+
const isWithinTableFragment = pageHit.page.fragments.filter((f) => f.kind === "table").some((f) => {
|
|
53034
|
+
const tf = f;
|
|
53035
|
+
return pageRelativePoint.x >= tf.x && pageRelativePoint.x <= tf.x + tf.width && pageRelativePoint.y >= tf.y && pageRelativePoint.y <= tf.y + tf.height;
|
|
53036
|
+
});
|
|
53037
|
+
if (!isWithinTableFragment) {
|
|
53038
|
+
fragmentHit = snapToNearestFragment(pageHit, blocks, measures, pageRelativePoint);
|
|
52987
53039
|
}
|
|
52988
|
-
fragmentHit = nearestHit;
|
|
52989
53040
|
}
|
|
52990
53041
|
if (fragmentHit) {
|
|
52991
53042
|
const { fragment, block, measure, pageIndex, pageY } = fragmentHit;
|
|
@@ -53025,7 +53076,8 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
53025
53076
|
const column = determineColumn(layout, fragment.x);
|
|
53026
53077
|
logPositionDebug({
|
|
53027
53078
|
blockId: fragment.blockId,
|
|
53028
|
-
x: pageRelativePoint.x - fragment.x
|
|
53079
|
+
x: pageRelativePoint.x - fragment.x,
|
|
53080
|
+
y: pageRelativePoint.y
|
|
53029
53081
|
});
|
|
53030
53082
|
logClickStage("log", "success", {
|
|
53031
53083
|
blockId: fragment.blockId
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
2
|
+
const index = require("./index-CiZRgn7j.cjs");
|
|
3
3
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
4
4
|
require("./helpers-OFep8CYR.cjs");
|
|
5
|
-
require("./SuperConverter-
|
|
5
|
+
require("./SuperConverter-OKWxKamo.cjs");
|
|
6
6
|
const eventemitter3 = require("./eventemitter3-D-UiF04J.cjs");
|
|
7
7
|
const vue = require("./vue-BkoOkkmT.cjs");
|
|
8
8
|
require("./jszip.min-oAFpNMh5.cjs");
|
|
@@ -8169,7 +8169,7 @@ const _sfc_main = {
|
|
|
8169
8169
|
__name: "SuperDoc",
|
|
8170
8170
|
emits: ["selection-update"],
|
|
8171
8171
|
setup(__props, { emit: __emit }) {
|
|
8172
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
8172
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CY2YJpu4.cjs")));
|
|
8173
8173
|
const superdocStore = useSuperdocStore();
|
|
8174
8174
|
const commentsStore = useCommentsStore();
|
|
8175
8175
|
const {
|
|
@@ -21643,7 +21643,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
21643
21643
|
this.config.colors = shuffleArray(this.config.colors);
|
|
21644
21644
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
21645
21645
|
this.colorIndex = 0;
|
|
21646
|
-
this.version = "1.12.0-next.
|
|
21646
|
+
this.version = "1.12.0-next.14";
|
|
21647
21647
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
21648
21648
|
this.superdocId = config.superdocId || uuid.v4();
|
|
21649
21649
|
this.colors = this.config.colors;
|