@superdoc-dev/mcp 0.6.0-next.17 → 0.6.0-next.19
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/index.js +222 -52
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -208781,7 +208781,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
208781
208781
|
init_remark_gfm_BhnWr3yf_es();
|
|
208782
208782
|
});
|
|
208783
208783
|
|
|
208784
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
208784
|
+
// ../../packages/superdoc/dist/chunks/src-IynDnUzG.es.js
|
|
208785
208785
|
function deleteProps(obj, propOrProps) {
|
|
208786
208786
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
208787
208787
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -240421,6 +240421,8 @@ function metadataGetWrapper(editor, input2) {
|
|
|
240421
240421
|
return findEntry(getConvertedXml2(editor), input2.id);
|
|
240422
240422
|
}
|
|
240423
240423
|
function metadataResolveWrapper(editor, input2) {
|
|
240424
|
+
if (!hasPayloadEntry(getConvertedXml2(editor), input2.id))
|
|
240425
|
+
return null;
|
|
240424
240426
|
const target = resolveAnchorTarget(editor, input2.id);
|
|
240425
240427
|
return target ? {
|
|
240426
240428
|
id: input2.id,
|
|
@@ -247245,6 +247247,17 @@ function compactSnapshotObject(input2) {
|
|
|
247245
247247
|
}
|
|
247246
247248
|
return out;
|
|
247247
247249
|
}
|
|
247250
|
+
function applyLayoutIdentityDataset(element3, identity) {
|
|
247251
|
+
if (!identity) {
|
|
247252
|
+
delete element3.dataset[DATASET_KEYS.LAYOUT_FRAGMENT_ID];
|
|
247253
|
+
delete element3.dataset[DATASET_KEYS.LAYOUT_BLOCK_REF];
|
|
247254
|
+
delete element3.dataset[DATASET_KEYS.LAYOUT_STORY];
|
|
247255
|
+
return;
|
|
247256
|
+
}
|
|
247257
|
+
element3.dataset[DATASET_KEYS.LAYOUT_FRAGMENT_ID] = identity.fragmentId;
|
|
247258
|
+
element3.dataset[DATASET_KEYS.LAYOUT_BLOCK_REF] = identity.blockRef;
|
|
247259
|
+
element3.dataset[DATASET_KEYS.LAYOUT_STORY] = encodeLayoutStoryDataset(identity.story);
|
|
247260
|
+
}
|
|
247248
247261
|
function applySourceAnchorDataset(element3, sourceAnchor) {
|
|
247249
247262
|
if (!sourceAnchor) {
|
|
247250
247263
|
delete element3.dataset.sourceAnchor;
|
|
@@ -247284,6 +247297,27 @@ function readNearestSourceAnchor(element3) {
|
|
|
247284
247297
|
return;
|
|
247285
247298
|
return readSourceAnchorDataset(element3) ?? readSourceAnchorDataset(element3.closest(`.${CLASS_NAMES$1.fragment}`));
|
|
247286
247299
|
}
|
|
247300
|
+
function readLayoutIdentityDataset(element3) {
|
|
247301
|
+
if (!element3)
|
|
247302
|
+
return;
|
|
247303
|
+
const fragmentId = element3.dataset?.[DATASET_KEYS.LAYOUT_FRAGMENT_ID];
|
|
247304
|
+
const blockRef = element3.dataset?.[DATASET_KEYS.LAYOUT_BLOCK_REF];
|
|
247305
|
+
const story = decodeLayoutStoryDataset(element3.dataset?.[DATASET_KEYS.LAYOUT_STORY]);
|
|
247306
|
+
if (!fragmentId || !blockRef || story.kind === "unknown")
|
|
247307
|
+
return;
|
|
247308
|
+
return compactSnapshotObject({
|
|
247309
|
+
schema: LAYOUT_BOUNDARY_SCHEMA,
|
|
247310
|
+
story,
|
|
247311
|
+
blockRef,
|
|
247312
|
+
fragmentId,
|
|
247313
|
+
sourceAnchor: readNearestSourceAnchor(element3)
|
|
247314
|
+
});
|
|
247315
|
+
}
|
|
247316
|
+
function readNearestLayoutSourceIdentity(element3) {
|
|
247317
|
+
if (!element3)
|
|
247318
|
+
return;
|
|
247319
|
+
return readLayoutIdentityDataset(element3) ?? readLayoutIdentityDataset(element3.closest(`.${CLASS_NAMES$1.fragment}`));
|
|
247320
|
+
}
|
|
247287
247321
|
function shouldIncludeInlineImageSnapshotElement(element3) {
|
|
247288
247322
|
if (element3.classList.contains(DOM_CLASS_NAMES.INLINE_IMAGE_CLIP_WRAPPER))
|
|
247289
247323
|
return true;
|
|
@@ -247310,7 +247344,8 @@ function collectPaintSnapshotEntitiesFromDomRoot(rootEl) {
|
|
|
247310
247344
|
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd),
|
|
247311
247345
|
fieldId: element3.dataset.fieldId || null,
|
|
247312
247346
|
fieldType: element3.dataset.fieldType || null,
|
|
247313
|
-
type: element3.dataset.type || null
|
|
247347
|
+
type: element3.dataset.type || null,
|
|
247348
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(element3)
|
|
247314
247349
|
}));
|
|
247315
247350
|
}
|
|
247316
247351
|
const blockSdtElements = Array.from(rootEl.querySelectorAll(`.${DOM_CLASS_NAMES.BLOCK_SDT}[data-sdt-id]`));
|
|
@@ -247324,7 +247359,8 @@ function collectPaintSnapshotEntitiesFromDomRoot(rootEl) {
|
|
|
247324
247359
|
pageIndex,
|
|
247325
247360
|
sdtId,
|
|
247326
247361
|
pmStart: readSnapshotDatasetNumber(element3.dataset.pmStart),
|
|
247327
|
-
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd)
|
|
247362
|
+
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd),
|
|
247363
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(element3)
|
|
247328
247364
|
}));
|
|
247329
247365
|
}
|
|
247330
247366
|
const inlineSdtElements = Array.from(rootEl.querySelectorAll(`.${DOM_CLASS_NAMES.INLINE_SDT_WRAPPER}[data-sdt-id]`));
|
|
@@ -247338,7 +247374,8 @@ function collectPaintSnapshotEntitiesFromDomRoot(rootEl) {
|
|
|
247338
247374
|
pageIndex,
|
|
247339
247375
|
sdtId,
|
|
247340
247376
|
pmStart: readSnapshotDatasetNumber(element3.dataset.pmStart),
|
|
247341
|
-
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd)
|
|
247377
|
+
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd),
|
|
247378
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(element3)
|
|
247342
247379
|
}));
|
|
247343
247380
|
}
|
|
247344
247381
|
const inlineImageElements = Array.from(rootEl.querySelectorAll(`.${DOM_CLASS_NAMES.INLINE_IMAGE_CLIP_WRAPPER}[data-pm-start], .${DOM_CLASS_NAMES.INLINE_IMAGE}[data-pm-start]`));
|
|
@@ -247354,7 +247391,8 @@ function collectPaintSnapshotEntitiesFromDomRoot(rootEl) {
|
|
|
247354
247391
|
kind: "inline",
|
|
247355
247392
|
pmStart: readSnapshotDatasetNumber(element3.dataset.pmStart),
|
|
247356
247393
|
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd),
|
|
247357
|
-
sourceAnchor: readNearestSourceAnchor(element3)
|
|
247394
|
+
sourceAnchor: readNearestSourceAnchor(element3),
|
|
247395
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(element3)
|
|
247358
247396
|
}));
|
|
247359
247397
|
}
|
|
247360
247398
|
const fragmentImageElements = Array.from(rootEl.querySelectorAll(`.${DOM_CLASS_NAMES.IMAGE_FRAGMENT}[data-pm-start]`));
|
|
@@ -247369,7 +247407,8 @@ function collectPaintSnapshotEntitiesFromDomRoot(rootEl) {
|
|
|
247369
247407
|
pmStart: readSnapshotDatasetNumber(element3.dataset.pmStart),
|
|
247370
247408
|
pmEnd: readSnapshotDatasetNumber(element3.dataset.pmEnd),
|
|
247371
247409
|
blockId: element3.getAttribute("data-sd-block-id"),
|
|
247372
|
-
sourceAnchor: readNearestSourceAnchor(element3)
|
|
247410
|
+
sourceAnchor: readNearestSourceAnchor(element3),
|
|
247411
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(element3)
|
|
247373
247412
|
}));
|
|
247374
247413
|
}
|
|
247375
247414
|
return entities;
|
|
@@ -247918,9 +247957,10 @@ function applyPaintVersions(item, visualVersion) {
|
|
|
247918
247957
|
} else
|
|
247919
247958
|
item.paintCacheVersion = visualVersion;
|
|
247920
247959
|
}
|
|
247921
|
-
function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, blockVersionCache) {
|
|
247960
|
+
function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, blockVersionCache, story) {
|
|
247922
247961
|
const sdtContainerKey = resolveFragmentSdtContainerKey(fragment, blockMap);
|
|
247923
247962
|
const version$1 = fragmentSignature(fragment, computeBlockVersion(fragment.blockId, blockMap, blockVersionCache));
|
|
247963
|
+
const layoutSourceIdentity = resolveFragmentLayoutIdentity(fragment, story);
|
|
247924
247964
|
switch (fragment.kind) {
|
|
247925
247965
|
case "table": {
|
|
247926
247966
|
const item = resolveTableItem(fragment, fragmentIndex, pageIndex, blockMap);
|
|
@@ -247928,6 +247968,7 @@ function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, block
|
|
|
247928
247968
|
item.sdtContainerKey = sdtContainerKey;
|
|
247929
247969
|
if (fragment.sourceAnchor != null)
|
|
247930
247970
|
item.sourceAnchor = fragment.sourceAnchor;
|
|
247971
|
+
item.layoutSourceIdentity = layoutSourceIdentity;
|
|
247931
247972
|
applyPaintVersions(item, version$1);
|
|
247932
247973
|
return item;
|
|
247933
247974
|
}
|
|
@@ -247937,6 +247978,7 @@ function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, block
|
|
|
247937
247978
|
item.sdtContainerKey = sdtContainerKey;
|
|
247938
247979
|
if (fragment.sourceAnchor != null)
|
|
247939
247980
|
item.sourceAnchor = fragment.sourceAnchor;
|
|
247981
|
+
item.layoutSourceIdentity = layoutSourceIdentity;
|
|
247940
247982
|
applyPaintVersions(item, version$1);
|
|
247941
247983
|
return item;
|
|
247942
247984
|
}
|
|
@@ -247946,6 +247988,7 @@ function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, block
|
|
|
247946
247988
|
item.sdtContainerKey = sdtContainerKey;
|
|
247947
247989
|
if (fragment.sourceAnchor != null)
|
|
247948
247990
|
item.sourceAnchor = fragment.sourceAnchor;
|
|
247991
|
+
item.layoutSourceIdentity = layoutSourceIdentity;
|
|
247949
247992
|
applyPaintVersions(item, version$1);
|
|
247950
247993
|
return item;
|
|
247951
247994
|
}
|
|
@@ -247963,7 +248006,8 @@ function resolveFragmentItem(fragment, fragmentIndex, pageIndex, blockMap, block
|
|
|
247963
248006
|
fragment,
|
|
247964
248007
|
blockId: fragment.blockId,
|
|
247965
248008
|
fragmentIndex,
|
|
247966
|
-
content: resolveParagraphContentIfApplicable(fragment, blockMap)
|
|
248009
|
+
content: resolveParagraphContentIfApplicable(fragment, blockMap),
|
|
248010
|
+
layoutSourceIdentity
|
|
247967
248011
|
};
|
|
247968
248012
|
if (sdtContainerKey != null)
|
|
247969
248013
|
item.sdtContainerKey = sdtContainerKey;
|
|
@@ -248050,14 +248094,14 @@ function resolveLayout(input2) {
|
|
|
248050
248094
|
resolved.layoutEpoch = layout.layoutEpoch;
|
|
248051
248095
|
return resolved;
|
|
248052
248096
|
}
|
|
248053
|
-
function resolveHeaderFooterLayout(layout, blocks2, measures) {
|
|
248097
|
+
function resolveHeaderFooterLayout(layout, blocks2, measures, story) {
|
|
248054
248098
|
const pages = layout.pages.map((page) => {
|
|
248055
248099
|
const blockMap = buildBlockMap(page.blocks ?? blocks2, page.measures ?? measures);
|
|
248056
248100
|
const blockVersionCache = /* @__PURE__ */ new Map;
|
|
248057
248101
|
return {
|
|
248058
248102
|
number: page.number,
|
|
248059
248103
|
numberText: page.numberText,
|
|
248060
|
-
items: page.fragments.map((fragment, fragmentIndex) => resolveFragmentItem(fragment, fragmentIndex, page.number - 1, blockMap, blockVersionCache))
|
|
248104
|
+
items: page.fragments.map((fragment, fragmentIndex) => resolveFragmentItem(fragment, fragmentIndex, page.number - 1, blockMap, blockVersionCache, story))
|
|
248061
248105
|
};
|
|
248062
248106
|
});
|
|
248063
248107
|
return {
|
|
@@ -252609,6 +252653,13 @@ function layoutHeaderFooter(blocks2, measures, constraints, kind) {
|
|
|
252609
252653
|
});
|
|
252610
252654
|
if (kind === "footer" && constraints.pageHeight != null)
|
|
252611
252655
|
normalizeFragmentsForRegion(layout.pages, blocks2, measures, kind, constraints);
|
|
252656
|
+
const story = kind ? { kind } : undefined;
|
|
252657
|
+
if (story)
|
|
252658
|
+
for (const page of layout.pages)
|
|
252659
|
+
page.fragments = page.fragments.map((fragment) => ({
|
|
252660
|
+
...fragment,
|
|
252661
|
+
layoutSourceIdentity: buildLayoutSourceIdentityForFragment(fragment, story)
|
|
252662
|
+
}));
|
|
252612
252663
|
const idToIndex = /* @__PURE__ */ new Map;
|
|
252613
252664
|
for (let i4 = 0;i4 < blocks2.length; i4 += 1)
|
|
252614
252665
|
idToIndex.set(blocks2[i4].id, i4);
|
|
@@ -266286,8 +266337,16 @@ function setSurfaceRangeEnd(range, entry, pos) {
|
|
|
266286
266337
|
range.setEndAfter(entry.el);
|
|
266287
266338
|
return true;
|
|
266288
266339
|
}
|
|
266289
|
-
function
|
|
266290
|
-
|
|
266340
|
+
function buildHeaderFooterStory(kind, id2) {
|
|
266341
|
+
const normalizedId = typeof id2 === "string" && id2.length > 0 ? id2 : undefined;
|
|
266342
|
+
return normalizedId ? namedStoryLocator(kind, normalizedId) : { kind };
|
|
266343
|
+
}
|
|
266344
|
+
function storyIdFromHeaderFooterLayoutKey(key2) {
|
|
266345
|
+
return key2.replace(/::s\d+$/, "");
|
|
266346
|
+
}
|
|
266347
|
+
function resolveResult(result, storyId) {
|
|
266348
|
+
const story = buildHeaderFooterStory(result.kind, storyId ?? String(result.type));
|
|
266349
|
+
return resolveHeaderFooterLayout(result.layout, result.blocks, result.measures, story);
|
|
266291
266350
|
}
|
|
266292
266351
|
function shiftResolvedPaintItemY(item, yOffset) {
|
|
266293
266352
|
if (item.kind === "group")
|
|
@@ -266800,6 +266859,55 @@ var Node$13 = class Node$14 {
|
|
|
266800
266859
|
return;
|
|
266801
266860
|
const candidate = run2.pmEnd;
|
|
266802
266861
|
return typeof candidate === "number" ? candidate : undefined;
|
|
266862
|
+
}, LAYOUT_BOUNDARY_SCHEMA = "layout-identity/1", bodyStoryLocator = () => ({ kind: "body" }), namedStoryLocator = (kind, id2) => id2 ? {
|
|
266863
|
+
kind,
|
|
266864
|
+
id: id2
|
|
266865
|
+
} : { kind: "unknown" }, computeLayoutFragmentId = (input2) => {
|
|
266866
|
+
const story = input2.story ?? bodyStoryLocator();
|
|
266867
|
+
const storySegment = story.kind === "body" ? "body" : `${story.kind}:${story.id ?? ""}`;
|
|
266868
|
+
let variant;
|
|
266869
|
+
if (input2.kind === "para")
|
|
266870
|
+
variant = `para:${input2.fromLine ?? 0}:${input2.toLine ?? ""}`;
|
|
266871
|
+
else if (input2.kind === "list-item")
|
|
266872
|
+
variant = `list-item:${input2.itemId ?? ""}:${input2.fromLine ?? 0}:${input2.toLine ?? ""}`;
|
|
266873
|
+
else if (input2.kind === "table") {
|
|
266874
|
+
const partialKey = input2.partialRow ? `:${input2.partialRow.rowIndex ?? ""}:${input2.partialRow.fromLineByCell?.join(",") ?? ""}-${input2.partialRow.toLineByCell?.join(",") ?? ""}` : "";
|
|
266875
|
+
variant = `table:${input2.fromRow ?? 0}:${input2.toRow ?? ""}${partialKey}`;
|
|
266876
|
+
} else if (input2.kind === "image" || input2.kind === "drawing")
|
|
266877
|
+
variant = `${input2.kind}:${input2.x ?? ""}:${input2.y ?? ""}`;
|
|
266878
|
+
else
|
|
266879
|
+
variant = input2.kind;
|
|
266880
|
+
return `${storySegment}|${input2.blockId}|${variant}`;
|
|
266881
|
+
}, buildLayoutSourceIdentity = (input2) => ({
|
|
266882
|
+
schema: LAYOUT_BOUNDARY_SCHEMA,
|
|
266883
|
+
story: input2.story ?? bodyStoryLocator(),
|
|
266884
|
+
blockRef: input2.blockId,
|
|
266885
|
+
fragmentId: computeLayoutFragmentId(input2),
|
|
266886
|
+
sourceAnchor: input2.sourceAnchor
|
|
266887
|
+
}), sameStoryLocator = (left$1, right$1) => left$1.kind === right$1.kind && (left$1.id ?? "") === (right$1.id ?? ""), shouldKeepExistingIdentity = (existing, story) => {
|
|
266888
|
+
if (!story)
|
|
266889
|
+
return true;
|
|
266890
|
+
if (sameStoryLocator(existing.story, story))
|
|
266891
|
+
return true;
|
|
266892
|
+
return story.kind === "body" && existing.story.kind !== "body";
|
|
266893
|
+
}, buildLayoutSourceIdentityForFragment = (fragment, story) => {
|
|
266894
|
+
const existing = fragment.layoutSourceIdentity;
|
|
266895
|
+
if (existing && shouldKeepExistingIdentity(existing, story))
|
|
266896
|
+
return existing;
|
|
266897
|
+
return buildLayoutSourceIdentity({
|
|
266898
|
+
blockId: fragment.blockId,
|
|
266899
|
+
story: story ?? existing?.story,
|
|
266900
|
+
kind: fragment.kind,
|
|
266901
|
+
fromLine: fragment.kind === "para" || fragment.kind === "list-item" ? fragment.fromLine : undefined,
|
|
266902
|
+
toLine: fragment.kind === "para" || fragment.kind === "list-item" ? fragment.toLine : undefined,
|
|
266903
|
+
fromRow: fragment.kind === "table" ? fragment.fromRow : undefined,
|
|
266904
|
+
toRow: fragment.kind === "table" ? fragment.toRow : undefined,
|
|
266905
|
+
itemId: fragment.kind === "list-item" ? fragment.itemId : undefined,
|
|
266906
|
+
x: fragment.kind === "image" || fragment.kind === "drawing" ? fragment.x : undefined,
|
|
266907
|
+
y: fragment.kind === "image" || fragment.kind === "drawing" ? fragment.y : undefined,
|
|
266908
|
+
partialRow: fragment.kind === "table" ? fragment.partialRow : undefined,
|
|
266909
|
+
sourceAnchor: fragment.sourceAnchor ?? existing?.sourceAnchor
|
|
266910
|
+
});
|
|
266803
266911
|
}, engines_exports, floor2, abs2, min$1 = (a2, b$1) => a2 < b$1 ? a2 : b$1, max$1 = (a2, b$1) => a2 > b$1 ? a2 : b$1, isNegativeZero2 = (n) => n !== 0 ? n < 0 : 1 / n < 0, BIT182, BIT192, BIT202, BIT212, BIT222, BIT232, BIT242, BIT252, BIT262, BIT272, BIT282, BIT292, BIT302, BIT312, MAX_SAFE_INTEGER2, MIN_SAFE_INTEGER2, isInteger3, create$22 = () => /* @__PURE__ */ new Set, every$1 = (arr, f2) => {
|
|
266804
266912
|
for (let i4 = 0;i4 < arr.length; i4++)
|
|
266805
266913
|
if (!f2(arr[i4], i4, arr))
|
|
@@ -277390,7 +277498,28 @@ var Node$13 = class Node$14 {
|
|
|
277390
277498
|
if (!allowedRanges?.length)
|
|
277391
277499
|
return false;
|
|
277392
277500
|
return allowedRanges.some((allowed) => range.from >= allowed.from && range.to <= allowed.to);
|
|
277393
|
-
}, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS,
|
|
277501
|
+
}, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS, encodeLayoutStoryDataset = (story) => story.kind === "body" ? "body" : story.id ? `${story.kind}:${story.id}` : story.kind, decodeLayoutStoryDataset = (raw) => {
|
|
277502
|
+
if (!raw)
|
|
277503
|
+
return { kind: "unknown" };
|
|
277504
|
+
if (raw === "body")
|
|
277505
|
+
return { kind: "body" };
|
|
277506
|
+
const idx = raw.indexOf(":");
|
|
277507
|
+
const kind = idx === -1 ? raw : raw.slice(0, idx);
|
|
277508
|
+
const id2 = idx === -1 ? undefined : raw.slice(idx + 1);
|
|
277509
|
+
switch (kind) {
|
|
277510
|
+
case "body":
|
|
277511
|
+
case "header":
|
|
277512
|
+
case "footer":
|
|
277513
|
+
case "footnote":
|
|
277514
|
+
case "endnote":
|
|
277515
|
+
return id2 ? {
|
|
277516
|
+
kind,
|
|
277517
|
+
id: id2
|
|
277518
|
+
} : { kind };
|
|
277519
|
+
default:
|
|
277520
|
+
return { kind: "unknown" };
|
|
277521
|
+
}
|
|
277522
|
+
}, DRAGGABLE_SELECTOR, VerticalNavigationPluginKey, createDefaultState = () => ({ goalX: null }), VerticalNavigation, STRONG_RTL_CHAR_RE$1, STRONG_LTR_CHAR_RE, isStrongRtl = (char) => STRONG_RTL_CHAR_RE$1.test(char), isStrongLtr = (char) => STRONG_LTR_CHAR_RE.test(char), hasMixedDirectionBoundary = (leftChar, rightChar) => isStrongRtl(leftChar) && isStrongLtr(rightChar) || isStrongLtr(leftChar) && isStrongRtl(rightChar), resolveCaretPoint = (doc$12, range) => {
|
|
277394
277523
|
const rect = range.getBoundingClientRect();
|
|
277395
277524
|
if (rect && Number.isFinite(rect.left) && Number.isFinite(rect.top)) {
|
|
277396
277525
|
if (rect.width === 0 && rect.height === 0)
|
|
@@ -285322,7 +285451,21 @@ menclose::after {
|
|
|
285322
285451
|
menclose.setAttribute("notation", notations.join(" "));
|
|
285323
285452
|
menclose.appendChild(innerMrow);
|
|
285324
285453
|
return menclose;
|
|
285325
|
-
}, MATHML_NS = "http://www.w3.org/1998/Math/MathML", MATH_OBJECT_REGISTRY, ARGUMENT_ELEMENTS,
|
|
285454
|
+
}, MATHML_NS = "http://www.w3.org/1998/Math/MathML", MATH_OBJECT_REGISTRY, ARGUMENT_ELEMENTS, resolveOrBuildFragmentIdentity = (fragment, story, existing) => buildLayoutSourceIdentityForFragment(existing ? {
|
|
285455
|
+
...fragment,
|
|
285456
|
+
layoutSourceIdentity: existing,
|
|
285457
|
+
sourceAnchor: fragment.sourceAnchor ?? existing.sourceAnchor
|
|
285458
|
+
} : fragment, story), resolveSectionStory = (section) => {
|
|
285459
|
+
if (!section || section === "body")
|
|
285460
|
+
return;
|
|
285461
|
+
return { kind: section };
|
|
285462
|
+
}, resolveDecorationStory = (kind, data) => {
|
|
285463
|
+
const id2 = data.headerFooterRefId ?? data.sectionType;
|
|
285464
|
+
return typeof id2 === "string" && id2.length > 0 ? {
|
|
285465
|
+
kind,
|
|
285466
|
+
id: id2
|
|
285467
|
+
} : { kind };
|
|
285468
|
+
}, LIST_MARKER_GAP$1 = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, SVG_NS = "http://www.w3.org/2000/svg", WORDART_LINE_FILL_RATIO = 0.9, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor$1 = (value) => {
|
|
285326
285469
|
if (typeof value !== "string")
|
|
285327
285470
|
return null;
|
|
285328
285471
|
const trimmed = value.trim();
|
|
@@ -286066,7 +286209,9 @@ menclose::after {
|
|
|
286066
286209
|
return `{${Object.keys(record3).sort().filter((key2) => record3[key2] !== undefined).map((key2) => `${JSON.stringify(key2)}:${stableSerializeEvidenceValue(record3[key2])}`).join(",")}}`;
|
|
286067
286210
|
}
|
|
286068
286211
|
return JSON.stringify(String(value));
|
|
286069
|
-
}, sourceAnchorSignature = (sourceAnchor) => sourceAnchor ? stableSerializeEvidenceValue(sourceAnchor) : "",
|
|
286212
|
+
}, sourceAnchorSignature = (sourceAnchor) => sourceAnchor ? stableSerializeEvidenceValue(sourceAnchor) : "", resolveFragmentLayoutIdentity = (fragment, story) => {
|
|
286213
|
+
return buildLayoutSourceIdentityForFragment(fragment, story);
|
|
286214
|
+
}, deriveBlockVersion = (block) => {
|
|
286070
286215
|
if (block.kind === "paragraph") {
|
|
286071
286216
|
const markerVersion = hasListMarkerProperties(block.attrs) ? `marker:${block.attrs.numberingProperties.numId ?? ""}:${block.attrs.numberingProperties.ilvl ?? 0}:${block.attrs.wordLayout?.marker?.markerText ?? ""}` : "";
|
|
286072
286217
|
const runsVersion = block.runs.map((run2) => {
|
|
@@ -295433,14 +295578,14 @@ menclose::after {
|
|
|
295433
295578
|
}
|
|
295434
295579
|
set headerLayoutResults(results) {
|
|
295435
295580
|
this.#headerLayoutResults = results;
|
|
295436
|
-
this.#resolvedHeaderLayouts = results ? results.map(resolveResult) : null;
|
|
295581
|
+
this.#resolvedHeaderLayouts = results ? results.map((result) => resolveResult(result)) : null;
|
|
295437
295582
|
}
|
|
295438
295583
|
get footerLayoutResults() {
|
|
295439
295584
|
return this.#footerLayoutResults;
|
|
295440
295585
|
}
|
|
295441
295586
|
set footerLayoutResults(results) {
|
|
295442
295587
|
this.#footerLayoutResults = results;
|
|
295443
|
-
this.#resolvedFooterLayouts = results ? results.map(resolveResult) : null;
|
|
295588
|
+
this.#resolvedFooterLayouts = results ? results.map((result) => resolveResult(result)) : null;
|
|
295444
295589
|
}
|
|
295445
295590
|
get headerLayoutsByRId() {
|
|
295446
295591
|
return this.#headerLayoutsByRId;
|
|
@@ -295495,8 +295640,8 @@ menclose::after {
|
|
|
295495
295640
|
setLayoutResults(headerResults, footerResults) {
|
|
295496
295641
|
this.#headerLayoutResults = headerResults;
|
|
295497
295642
|
this.#footerLayoutResults = footerResults;
|
|
295498
|
-
this.#resolvedHeaderLayouts = headerResults ? headerResults.map(resolveResult) : null;
|
|
295499
|
-
this.#resolvedFooterLayouts = footerResults ? footerResults.map(resolveResult) : null;
|
|
295643
|
+
this.#resolvedHeaderLayouts = headerResults ? headerResults.map((result) => resolveResult(result)) : null;
|
|
295644
|
+
this.#resolvedFooterLayouts = footerResults ? footerResults.map((result) => resolveResult(result)) : null;
|
|
295500
295645
|
}
|
|
295501
295646
|
initialize() {
|
|
295502
295647
|
if (!this.#options.editor)
|
|
@@ -296191,10 +296336,10 @@ menclose::after {
|
|
|
296191
296336
|
});
|
|
296192
296337
|
this.#resolvedHeaderByRId.clear();
|
|
296193
296338
|
for (const [key2, result] of this.#headerLayoutsByRId)
|
|
296194
|
-
this.#resolvedHeaderByRId.set(key2, resolveResult(result));
|
|
296339
|
+
this.#resolvedHeaderByRId.set(key2, resolveResult(result, storyIdFromHeaderFooterLayoutKey(key2)));
|
|
296195
296340
|
this.#resolvedFooterByRId.clear();
|
|
296196
296341
|
for (const [key2, result] of this.#footerLayoutsByRId)
|
|
296197
|
-
this.#resolvedFooterByRId.set(key2, resolveResult(result));
|
|
296342
|
+
this.#resolvedFooterByRId.set(key2, resolveResult(result, storyIdFromHeaderFooterLayoutKey(key2)));
|
|
296198
296343
|
}
|
|
296199
296344
|
#computeMetrics(kind, layoutHeight, box, pageHeight, footerMargin) {
|
|
296200
296345
|
const validatedLayoutHeight = Number.isFinite(layoutHeight) && layoutHeight >= 0 ? layoutHeight : 0;
|
|
@@ -296592,13 +296737,13 @@ menclose::after {
|
|
|
296592
296737
|
this.#footerDecorationProvider = this.createDecorationProvider("footer", resolvedLayout);
|
|
296593
296738
|
this.rebuildRegions(resolvedLayout);
|
|
296594
296739
|
}
|
|
296595
|
-
resolveAlignedDecorationItems(fragments, slotPageNumber, result, cachedResolvedLayout, contextLabel) {
|
|
296740
|
+
resolveAlignedDecorationItems(fragments, slotPageNumber, result, cachedResolvedLayout, contextLabel, storyId) {
|
|
296596
296741
|
const cachedItems = cachedResolvedLayout?.pages.find((page) => page.number === slotPageNumber)?.items;
|
|
296597
296742
|
if (cachedItems && cachedItems.length === fragments.length)
|
|
296598
296743
|
return cachedItems;
|
|
296599
296744
|
if (cachedItems)
|
|
296600
296745
|
console.warn(`[HeaderFooterSessionManager] Resolved items length (${cachedItems.length}) does not match fragments length (${fragments.length}) for ${contextLabel}. Recomputing items.`);
|
|
296601
|
-
const freshItems =
|
|
296746
|
+
const freshItems = resolveResult(result, storyId).pages.find((page) => page.number === slotPageNumber)?.items;
|
|
296602
296747
|
if (freshItems && freshItems.length === fragments.length)
|
|
296603
296748
|
return freshItems;
|
|
296604
296749
|
if (freshItems)
|
|
@@ -296659,7 +296804,7 @@ menclose::after {
|
|
|
296659
296804
|
if (slotPage$1) {
|
|
296660
296805
|
const fragments$1 = slotPage$1.fragments ?? [];
|
|
296661
296806
|
const rIdResolvedLayout = resolvedByRId.get(rIdLayoutKey);
|
|
296662
|
-
const alignedItems = this.resolveAlignedDecorationItems(fragments$1, slotPage$1.number, rIdLayout, rIdResolvedLayout, `rId '${rIdLayoutKey}' page ${pageNumber}
|
|
296807
|
+
const alignedItems = this.resolveAlignedDecorationItems(fragments$1, slotPage$1.number, rIdLayout, rIdResolvedLayout, `rId '${rIdLayoutKey}' page ${pageNumber}`, sectionRId);
|
|
296663
296808
|
if (!alignedItems)
|
|
296664
296809
|
return null;
|
|
296665
296810
|
const pageHeight$1 = page?.height ?? resolvedLayout.pages[0]?.height ?? layoutOptions.pageSize?.h ?? defaultPageSize.h;
|
|
@@ -296707,8 +296852,10 @@ menclose::after {
|
|
|
296707
296852
|
if (!slotPage)
|
|
296708
296853
|
return null;
|
|
296709
296854
|
const fragments = slotPage.fragments ?? [];
|
|
296855
|
+
const fallbackId = this.#headerFooterManager?.getVariantId(kind, headerFooterType);
|
|
296856
|
+
const finalHeaderId = sectionRId ?? fallbackId ?? undefined;
|
|
296710
296857
|
const resolvedVariant = resolvedResults?.[variantIndex];
|
|
296711
|
-
const alignedVariantItems = this.resolveAlignedDecorationItems(fragments, slotPage.number, variant, resolvedVariant, `variant '${headerFooterType}' page ${pageNumber}
|
|
296858
|
+
const alignedVariantItems = this.resolveAlignedDecorationItems(fragments, slotPage.number, variant, resolvedVariant, `variant '${headerFooterType}' page ${pageNumber}`, finalHeaderId ?? headerFooterType);
|
|
296712
296859
|
if (!alignedVariantItems)
|
|
296713
296860
|
return null;
|
|
296714
296861
|
const pageHeight = page?.height ?? resolvedLayout.pages[0]?.height ?? layoutOptions.pageSize?.h ?? defaultPageSize.h;
|
|
@@ -296717,8 +296864,6 @@ menclose::after {
|
|
|
296717
296864
|
const box = this.#computeDecorationBox(kind, decorationMargins, pageHeight);
|
|
296718
296865
|
const rawLayoutHeight = variant.layout.height ?? 0;
|
|
296719
296866
|
const metrics = this.#computeMetrics(kind, rawLayoutHeight, box, pageHeight, margins?.footer ?? 0);
|
|
296720
|
-
const fallbackId = this.#headerFooterManager?.getVariantId(kind, headerFooterType);
|
|
296721
|
-
const finalHeaderId = sectionRId ?? fallbackId ?? undefined;
|
|
296722
296867
|
const layoutMinY = variant.layout.minY ?? 0;
|
|
296723
296868
|
return {
|
|
296724
296869
|
fragments: normalizeDecorationFragments(fragments, layoutMinY),
|
|
@@ -297020,7 +297165,7 @@ menclose::after {
|
|
|
297020
297165
|
return;
|
|
297021
297166
|
console.log(...args$1);
|
|
297022
297167
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
|
|
297023
|
-
var
|
|
297168
|
+
var init_src_IynDnUzG_es = __esm(() => {
|
|
297024
297169
|
init_rolldown_runtime_Bg48TavK_es();
|
|
297025
297170
|
init_SuperConverter_CzwJ7ds9_es();
|
|
297026
297171
|
init_jszip_C49i9kUs_es();
|
|
@@ -315436,7 +315581,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
315436
315581
|
DRAGGABLE: "data-draggable",
|
|
315437
315582
|
DISPLAY_LABEL: "data-display-label",
|
|
315438
315583
|
VARIANT: "data-variant",
|
|
315439
|
-
TYPE: "data-type"
|
|
315584
|
+
TYPE: "data-type",
|
|
315585
|
+
LAYOUT_BOUNDARY_SCHEMA: "data-layout-boundary-schema",
|
|
315586
|
+
LAYOUT_FRAGMENT_ID: "data-layout-fragment-id",
|
|
315587
|
+
LAYOUT_STORY: "data-layout-story",
|
|
315588
|
+
LAYOUT_BLOCK_REF: "data-layout-block-ref"
|
|
315440
315589
|
};
|
|
315441
315590
|
DATASET_KEYS = {
|
|
315442
315591
|
PM_START: "pmStart",
|
|
@@ -315450,7 +315599,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
315450
315599
|
DRAGGABLE: "draggable",
|
|
315451
315600
|
DISPLAY_LABEL: "displayLabel",
|
|
315452
315601
|
VARIANT: "variant",
|
|
315453
|
-
TYPE: "type"
|
|
315602
|
+
TYPE: "type",
|
|
315603
|
+
LAYOUT_BOUNDARY_SCHEMA: "layoutBoundarySchema",
|
|
315604
|
+
LAYOUT_FRAGMENT_ID: "layoutFragmentId",
|
|
315605
|
+
LAYOUT_STORY: "layoutStory",
|
|
315606
|
+
LAYOUT_BLOCK_REF: "layoutBlockRef"
|
|
315454
315607
|
};
|
|
315455
315608
|
`${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
|
|
315456
315609
|
DRAGGABLE_SELECTOR = `[${DATA_ATTRS.DRAGGABLE}="true"]`;
|
|
@@ -323627,7 +323780,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
323627
323780
|
style: style2,
|
|
323628
323781
|
markers,
|
|
323629
323782
|
tabs,
|
|
323630
|
-
sourceAnchor: readNearestSourceAnchor(lineEl) ?? readNearestSourceAnchor(options.wrapperEl) ?? options.sourceAnchor
|
|
323783
|
+
sourceAnchor: readNearestSourceAnchor(lineEl) ?? readNearestSourceAnchor(options.wrapperEl) ?? options.sourceAnchor,
|
|
323784
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(lineEl) ?? readNearestLayoutSourceIdentity(options.wrapperEl)
|
|
323631
323785
|
}));
|
|
323632
323786
|
page.lineCount += 1;
|
|
323633
323787
|
builder.lineCount += 1;
|
|
@@ -323665,7 +323819,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
323665
323819
|
style: snapshotLineStyleFromElement(lineEl),
|
|
323666
323820
|
markers,
|
|
323667
323821
|
tabs,
|
|
323668
|
-
sourceAnchor: readNearestSourceAnchor(lineEl)
|
|
323822
|
+
sourceAnchor: readNearestSourceAnchor(lineEl),
|
|
323823
|
+
layoutSourceIdentity: readNearestLayoutSourceIdentity(lineEl)
|
|
323669
323824
|
}));
|
|
323670
323825
|
}
|
|
323671
323826
|
const pageNumberRaw = pageEl.dataset?.pageNumber;
|
|
@@ -324088,6 +324243,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324088
324243
|
el.dataset.layoutEpoch = String(this.layoutEpoch);
|
|
324089
324244
|
el.dataset.pageNumber = String(page.number);
|
|
324090
324245
|
el.dataset.pageIndex = String(pageIndex);
|
|
324246
|
+
el.dataset[DATASET_KEYS.LAYOUT_BOUNDARY_SCHEMA] = LAYOUT_BOUNDARY_SCHEMA;
|
|
324091
324247
|
if (!this.isSemanticFlow && this.options.ruler?.enabled) {
|
|
324092
324248
|
const rulerEl = this.renderPageRuler(width, page);
|
|
324093
324249
|
if (rulerEl)
|
|
@@ -324310,6 +324466,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324310
324466
|
pageNumber: page.number,
|
|
324311
324467
|
totalPages: this.totalPages,
|
|
324312
324468
|
section: kind,
|
|
324469
|
+
story: resolveDecorationStory(kind, data),
|
|
324313
324470
|
pageNumberText: page.numberText,
|
|
324314
324471
|
pageIndex
|
|
324315
324472
|
};
|
|
@@ -324548,6 +324705,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324548
324705
|
applyStyles(el, pageStyles(page.width, page.height, this.getEffectivePageStyles()));
|
|
324549
324706
|
this.applySemanticPageOverrides(el);
|
|
324550
324707
|
el.dataset.layoutEpoch = String(this.layoutEpoch);
|
|
324708
|
+
el.dataset[DATASET_KEYS.LAYOUT_BOUNDARY_SCHEMA] = LAYOUT_BOUNDARY_SCHEMA;
|
|
324551
324709
|
const contextBase = {
|
|
324552
324710
|
pageNumber: page.number,
|
|
324553
324711
|
totalPages: this.totalPages,
|
|
@@ -324647,9 +324805,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324647
324805
|
overflow: "visible"
|
|
324648
324806
|
} : fragmentStyles);
|
|
324649
324807
|
if (resolvedItem)
|
|
324650
|
-
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section);
|
|
324808
|
+
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section, context.story);
|
|
324651
324809
|
else
|
|
324652
|
-
this.applyFragmentFrame(fragmentEl, fragment, context.section);
|
|
324810
|
+
this.applyFragmentFrame(fragmentEl, fragment, context.section, context.story);
|
|
324653
324811
|
if (isTocEntry)
|
|
324654
324812
|
fragmentEl.classList.add("superdoc-toc-entry");
|
|
324655
324813
|
if (paraContinuesFromPrev)
|
|
@@ -324777,6 +324935,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324777
324935
|
this.capturePaintSnapshotLine(lineEl, context, {
|
|
324778
324936
|
inTableFragment: false,
|
|
324779
324937
|
inTableParagraph: false,
|
|
324938
|
+
wrapperEl: fragmentEl,
|
|
324780
324939
|
sourceAnchor: resolvedItem?.sourceAnchor
|
|
324781
324940
|
});
|
|
324782
324941
|
fragmentEl.appendChild(lineEl);
|
|
@@ -324916,6 +325075,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324916
325075
|
this.capturePaintSnapshotLine(lineEl, context, {
|
|
324917
325076
|
inTableFragment: false,
|
|
324918
325077
|
inTableParagraph: false,
|
|
325078
|
+
wrapperEl: fragmentEl,
|
|
324919
325079
|
sourceAnchor: resolvedItem?.sourceAnchor
|
|
324920
325080
|
});
|
|
324921
325081
|
fragmentEl.appendChild(lineEl);
|
|
@@ -324998,13 +325158,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324998
325158
|
fragmentEl.classList.add(CLASS_NAMES$1.fragment, `${CLASS_NAMES$1.fragment}-list-item`);
|
|
324999
325159
|
applyStyles(fragmentEl, fragmentStyles);
|
|
325000
325160
|
if (resolvedItem)
|
|
325001
|
-
this.applyResolvedListItemWrapperFrame(fragmentEl, fragment, resolvedItem, context.section);
|
|
325161
|
+
this.applyResolvedListItemWrapperFrame(fragmentEl, fragment, resolvedItem, context.section, context.story);
|
|
325002
325162
|
else {
|
|
325003
325163
|
fragmentEl.style.left = `${fragment.x - fragment.markerWidth}px`;
|
|
325004
325164
|
fragmentEl.style.top = `${fragment.y}px`;
|
|
325005
325165
|
fragmentEl.style.width = `${fragment.markerWidth + fragment.width}px`;
|
|
325006
325166
|
fragmentEl.dataset.blockId = fragment.blockId;
|
|
325007
325167
|
applySourceAnchorDataset(fragmentEl, fragment.sourceAnchor);
|
|
325168
|
+
applyLayoutIdentityDataset(fragmentEl, resolveOrBuildFragmentIdentity(fragment, context.story));
|
|
325008
325169
|
}
|
|
325009
325170
|
fragmentEl.dataset.itemId = fragment.itemId;
|
|
325010
325171
|
const paragraphMetadata = item.paragraph.attrs?.sdt;
|
|
@@ -325073,6 +325234,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325073
325234
|
this.capturePaintSnapshotLine(lineEl, context, {
|
|
325074
325235
|
inTableFragment: false,
|
|
325075
325236
|
inTableParagraph: false,
|
|
325237
|
+
wrapperEl: fragmentEl,
|
|
325076
325238
|
sourceAnchor: resolvedItem?.sourceAnchor
|
|
325077
325239
|
});
|
|
325078
325240
|
contentEl.appendChild(lineEl);
|
|
@@ -325098,9 +325260,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325098
325260
|
fragmentEl.classList.add(CLASS_NAMES$1.fragment, DOM_CLASS_NAMES.IMAGE_FRAGMENT);
|
|
325099
325261
|
applyStyles(fragmentEl, fragmentStyles);
|
|
325100
325262
|
if (resolvedItem)
|
|
325101
|
-
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section);
|
|
325263
|
+
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section, context.story);
|
|
325102
325264
|
else {
|
|
325103
|
-
this.applyFragmentFrame(fragmentEl, fragment, context.section);
|
|
325265
|
+
this.applyFragmentFrame(fragmentEl, fragment, context.section, context.story);
|
|
325104
325266
|
fragmentEl.style.height = `${fragment.height}px`;
|
|
325105
325267
|
this.applyFragmentWrapperZIndex(fragmentEl, fragment);
|
|
325106
325268
|
}
|
|
@@ -325215,9 +325377,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325215
325377
|
fragmentEl.classList.add(CLASS_NAMES$1.fragment, "superdoc-drawing-fragment");
|
|
325216
325378
|
applyStyles(fragmentEl, fragmentStyles);
|
|
325217
325379
|
if (resolvedItem)
|
|
325218
|
-
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section);
|
|
325380
|
+
this.applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment, context.section, context.story);
|
|
325219
325381
|
else {
|
|
325220
|
-
this.applyFragmentFrame(fragmentEl, fragment, context.section);
|
|
325382
|
+
this.applyFragmentFrame(fragmentEl, fragment, context.section, context.story);
|
|
325221
325383
|
fragmentEl.style.height = `${fragment.height}px`;
|
|
325222
325384
|
this.applyFragmentWrapperZIndex(fragmentEl, fragment);
|
|
325223
325385
|
}
|
|
@@ -325896,7 +326058,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325896
326058
|
if (!this.doc)
|
|
325897
326059
|
throw new Error("DomPainter: document is not available");
|
|
325898
326060
|
const applyFragmentFrameWithSection = (el$1, frag) => {
|
|
325899
|
-
this.applyFragmentFrame(el$1, frag, context.section);
|
|
326061
|
+
this.applyFragmentFrame(el$1, frag, context.section, context.story);
|
|
325900
326062
|
};
|
|
325901
326063
|
const tableCellExpandedRunsCache = /* @__PURE__ */ new WeakMap;
|
|
325902
326064
|
const renderLineForTableCell = (block, line, ctx$1, lineIndex, isLastLine, resolvedListTextStartPx) => {
|
|
@@ -325945,7 +326107,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
325945
326107
|
applyStyles
|
|
325946
326108
|
});
|
|
325947
326109
|
if (resolvedItem) {
|
|
325948
|
-
this.applyResolvedFragmentFrame(el, resolvedItem, fragment, context.section);
|
|
326110
|
+
this.applyResolvedFragmentFrame(el, resolvedItem, fragment, context.section, context.story);
|
|
325949
326111
|
if (sdtBoundary?.widthOverride != null)
|
|
325950
326112
|
el.style.width = `${sdtBoundary.widthOverride}px`;
|
|
325951
326113
|
}
|
|
@@ -327114,27 +327276,29 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
327114
327276
|
}
|
|
327115
327277
|
updateFragmentElement(el, fragment, section, resolvedItem) {
|
|
327116
327278
|
const fragmentItem = resolvedItem?.kind === "fragment" ? resolvedItem : undefined;
|
|
327279
|
+
const story = resolveSectionStory(section);
|
|
327117
327280
|
if (fragment.kind === "list-item" && fragmentItem) {
|
|
327118
|
-
this.applyResolvedListItemWrapperFrame(el, fragment, fragmentItem, section);
|
|
327281
|
+
this.applyResolvedListItemWrapperFrame(el, fragment, fragmentItem, section, story);
|
|
327119
327282
|
return;
|
|
327120
327283
|
}
|
|
327121
327284
|
if (fragmentItem)
|
|
327122
|
-
this.applyResolvedFragmentFrame(el, fragmentItem, fragment, section);
|
|
327285
|
+
this.applyResolvedFragmentFrame(el, fragmentItem, fragment, section, story);
|
|
327123
327286
|
else {
|
|
327124
|
-
this.applyFragmentFrame(el, fragment, section);
|
|
327287
|
+
this.applyFragmentFrame(el, fragment, section, story);
|
|
327125
327288
|
if (fragment.kind === "image" || fragment.kind === "drawing") {
|
|
327126
327289
|
el.style.height = `${fragment.height}px`;
|
|
327127
327290
|
this.applyFragmentWrapperZIndex(el, fragment);
|
|
327128
327291
|
}
|
|
327129
327292
|
}
|
|
327130
327293
|
}
|
|
327131
|
-
applyFragmentFrame(el, fragment, section) {
|
|
327294
|
+
applyFragmentFrame(el, fragment, section, story) {
|
|
327132
327295
|
el.style.left = `${fragment.x}px`;
|
|
327133
327296
|
el.style.top = `${fragment.y}px`;
|
|
327134
327297
|
el.style.width = `${fragment.width}px`;
|
|
327135
327298
|
el.dataset.blockId = fragment.blockId;
|
|
327136
327299
|
el.dataset.layoutEpoch = String(this.layoutEpoch);
|
|
327137
327300
|
applySourceAnchorDataset(el, fragment.sourceAnchor);
|
|
327301
|
+
applyLayoutIdentityDataset(el, resolveOrBuildFragmentIdentity(fragment, story ?? resolveSectionStory(section)));
|
|
327138
327302
|
if (typeof fragment.blockId === "string" && fragment.blockId.startsWith("footnote-"))
|
|
327139
327303
|
el.setAttribute("contenteditable", "false");
|
|
327140
327304
|
if (fragment.kind === "para") {
|
|
@@ -327209,20 +327373,24 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
327209
327373
|
applyFragmentWrapperZIndex(el, fragment, resolvedZIndex) {
|
|
327210
327374
|
el.style.zIndex = this.resolveFragmentWrapperZIndex(fragment, resolvedZIndex);
|
|
327211
327375
|
}
|
|
327212
|
-
applyResolvedFragmentFrame(el, item, fragment, section) {
|
|
327376
|
+
applyResolvedFragmentFrame(el, item, fragment, section, story) {
|
|
327213
327377
|
el.style.left = `${item.x}px`;
|
|
327214
327378
|
el.style.top = `${item.y}px`;
|
|
327215
327379
|
el.style.width = `${item.width}px`;
|
|
327216
327380
|
el.dataset.blockId = item.blockId;
|
|
327217
327381
|
el.dataset.layoutEpoch = String(this.layoutEpoch);
|
|
327218
327382
|
applySourceAnchorDataset(el, item.sourceAnchor);
|
|
327383
|
+
applyLayoutIdentityDataset(el, resolveOrBuildFragmentIdentity(fragment, story ?? resolveSectionStory(section), item.layoutSourceIdentity ? {
|
|
327384
|
+
...item.layoutSourceIdentity,
|
|
327385
|
+
sourceAnchor: item.sourceAnchor ?? item.layoutSourceIdentity.sourceAnchor
|
|
327386
|
+
} : undefined));
|
|
327219
327387
|
this.applyFragmentWrapperZIndex(el, fragment, item.zIndex);
|
|
327220
327388
|
if (item.fragmentKind === "image" || item.fragmentKind === "drawing" || item.fragmentKind === "table")
|
|
327221
327389
|
el.style.height = `${item.height}px`;
|
|
327222
327390
|
this.applyFragmentPmAttributes(el, fragment, section, item);
|
|
327223
327391
|
}
|
|
327224
|
-
applyResolvedListItemWrapperFrame(el, fragment, item, section) {
|
|
327225
|
-
this.applyResolvedFragmentFrame(el, item, fragment, section);
|
|
327392
|
+
applyResolvedListItemWrapperFrame(el, fragment, item, section, story) {
|
|
327393
|
+
this.applyResolvedFragmentFrame(el, item, fragment, section, story);
|
|
327226
327394
|
const mw = item.markerWidth ?? 0;
|
|
327227
327395
|
el.style.left = `${item.x - mw}px`;
|
|
327228
327396
|
el.style.width = `${item.width + mw}px`;
|
|
@@ -334719,9 +334887,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334719
334887
|
];
|
|
334720
334888
|
});
|
|
334721
334889
|
|
|
334722
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
334890
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-naojUqQe.es.js
|
|
334723
334891
|
var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
334724
|
-
var
|
|
334892
|
+
var init_create_super_doc_ui_naojUqQe_es = __esm(() => {
|
|
334725
334893
|
init_SuperConverter_CzwJ7ds9_es();
|
|
334726
334894
|
init_create_headless_toolbar_BQTnHkb4_es();
|
|
334727
334895
|
MOD_ALIASES = new Set([
|
|
@@ -334765,7 +334933,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
334765
334933
|
|
|
334766
334934
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
334767
334935
|
var init_super_editor_es = __esm(() => {
|
|
334768
|
-
|
|
334936
|
+
init_src_IynDnUzG_es();
|
|
334769
334937
|
init_SuperConverter_CzwJ7ds9_es();
|
|
334770
334938
|
init_jszip_C49i9kUs_es();
|
|
334771
334939
|
init_xml_js_CqGKpaft_es();
|
|
@@ -334774,7 +334942,7 @@ var init_super_editor_es = __esm(() => {
|
|
|
334774
334942
|
init_dist_B8HfvhaK_es();
|
|
334775
334943
|
init_unified_Dsuw2be5_es();
|
|
334776
334944
|
init_DocxZipper_CZMPWpOp_es();
|
|
334777
|
-
|
|
334945
|
+
init_create_super_doc_ui_naojUqQe_es();
|
|
334778
334946
|
init_ui_C5PAS9hY_es();
|
|
334779
334947
|
init_eventemitter3_BnGqBE_Q_es();
|
|
334780
334948
|
init_errors_CNaD6vcg_es();
|
|
@@ -464595,6 +464763,8 @@ function metadataGetWrapper2(editor, input2) {
|
|
|
464595
464763
|
return findEntry2(getConvertedXml5(editor), input2.id);
|
|
464596
464764
|
}
|
|
464597
464765
|
function metadataResolveWrapper2(editor, input2) {
|
|
464766
|
+
if (!hasPayloadEntry2(getConvertedXml5(editor), input2.id))
|
|
464767
|
+
return null;
|
|
464598
464768
|
const target = resolveAnchorTarget2(editor, input2.id);
|
|
464599
464769
|
return target ? { id: input2.id, target } : null;
|
|
464600
464770
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/mcp",
|
|
3
|
-
"version": "0.6.0-next.
|
|
3
|
+
"version": "0.6.0-next.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@types/node": "22.19.2",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
22
|
"@superdoc/document-api": "0.0.1",
|
|
23
|
-
"superdoc": "
|
|
24
|
-
"
|
|
23
|
+
"@superdoc/super-editor": "0.0.1",
|
|
24
|
+
"superdoc": "1.33.1"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|