@superdoc-dev/cli 0.17.0-next.7 → 0.17.0-next.8
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 +212 -100
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -68327,7 +68327,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
68327
68327
|
emptyOptions2 = {};
|
|
68328
68328
|
});
|
|
68329
68329
|
|
|
68330
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
68330
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-e4tY-2EB.es.js
|
|
68331
68331
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
68332
68332
|
const fieldValue = extension$1.config[field];
|
|
68333
68333
|
if (typeof fieldValue === "function")
|
|
@@ -104893,12 +104893,14 @@ function applyTocMetadata(blocks, metadata) {
|
|
|
104893
104893
|
};
|
|
104894
104894
|
if (metadata.instruction)
|
|
104895
104895
|
block.attrs.tocInstruction = metadata.instruction;
|
|
104896
|
+
if (metadata.tocId)
|
|
104897
|
+
block.attrs.tocId = metadata.tocId;
|
|
104896
104898
|
}
|
|
104897
104899
|
});
|
|
104898
104900
|
}
|
|
104899
104901
|
function processTocChildren(children, metadata, context, outputArrays) {
|
|
104900
104902
|
const paragraphConverter = context.converters.paragraphToFlowBlocks;
|
|
104901
|
-
const { docPartGallery, docPartObjectId, tocInstruction } = metadata;
|
|
104903
|
+
const { docPartGallery, docPartObjectId, tocInstruction, tocId } = metadata;
|
|
104902
104904
|
const { blocks, recordBlockKind } = outputArrays;
|
|
104903
104905
|
children.forEach((child) => {
|
|
104904
104906
|
if (child.type === "paragraph") {
|
|
@@ -104923,7 +104925,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
|
|
|
104923
104925
|
applyTocMetadata(paragraphBlocks, {
|
|
104924
104926
|
gallery: docPartGallery,
|
|
104925
104927
|
uniqueId: docPartObjectId,
|
|
104926
|
-
instruction: tocInstruction
|
|
104928
|
+
instruction: tocInstruction,
|
|
104929
|
+
tocId
|
|
104927
104930
|
});
|
|
104928
104931
|
applySdtMetadataToParagraphBlocks(paragraphBlocks.filter((b) => b.kind === "paragraph"), metadata.sdtMetadata);
|
|
104929
104932
|
paragraphBlocks.forEach((block) => {
|
|
@@ -104938,7 +104941,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
|
|
|
104938
104941
|
docPartGallery,
|
|
104939
104942
|
docPartObjectId,
|
|
104940
104943
|
tocInstruction: finalInstruction,
|
|
104941
|
-
sdtMetadata: metadata.sdtMetadata
|
|
104944
|
+
sdtMetadata: metadata.sdtMetadata,
|
|
104945
|
+
tocId
|
|
104942
104946
|
}, context, outputArrays);
|
|
104943
104947
|
}
|
|
104944
104948
|
});
|
|
@@ -104946,7 +104950,11 @@ function processTocChildren(children, metadata, context, outputArrays) {
|
|
|
104946
104950
|
function handleTableOfContentsNode(node3, context) {
|
|
104947
104951
|
if (!Array.isArray(node3.content))
|
|
104948
104952
|
return;
|
|
104949
|
-
|
|
104953
|
+
const sdBlockId = node3.attrs?.sdBlockId;
|
|
104954
|
+
processTocChildren(node3.content, {
|
|
104955
|
+
tocInstruction: getNodeInstruction(node3),
|
|
104956
|
+
tocId: typeof sdBlockId === "string" ? sdBlockId : undefined
|
|
104957
|
+
}, {
|
|
104950
104958
|
nextBlockId: context.nextBlockId,
|
|
104951
104959
|
positions: context.positions,
|
|
104952
104960
|
bookmarks: context.bookmarks,
|
|
@@ -105275,7 +105283,8 @@ function processDocumentPartObject(child, sectionMetadata, context, output, conv
|
|
|
105275
105283
|
docPartGallery,
|
|
105276
105284
|
docPartObjectId,
|
|
105277
105285
|
tocInstruction,
|
|
105278
|
-
sdtMetadata: docPartSdtMetadata
|
|
105286
|
+
sdtMetadata: docPartSdtMetadata,
|
|
105287
|
+
tocId: docPartObjectId ?? undefined
|
|
105279
105288
|
}, {
|
|
105280
105289
|
nextBlockId: context.nextBlockId,
|
|
105281
105290
|
positions: context.positions,
|
|
@@ -105346,12 +105355,15 @@ function handleDocumentPartObjectNode(node3, context) {
|
|
|
105346
105355
|
const tocInstruction = getNodeInstruction(node3);
|
|
105347
105356
|
const docPartSdtMetadata = resolveNodeSdtMetadata(node3, "docPartObject");
|
|
105348
105357
|
const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
|
|
105358
|
+
const sdBlockId = node3.attrs?.sdBlockId;
|
|
105359
|
+
const tocId = docPartObjectId && docPartObjectId.length > 0 ? docPartObjectId : typeof sdBlockId === "string" && sdBlockId.length > 0 ? sdBlockId : undefined;
|
|
105349
105360
|
if (docPartGallery === "Table of Contents")
|
|
105350
105361
|
processTocChildren(Array.from(node3.content), {
|
|
105351
105362
|
docPartGallery,
|
|
105352
105363
|
docPartObjectId,
|
|
105353
105364
|
tocInstruction,
|
|
105354
|
-
sdtMetadata: docPartSdtMetadata
|
|
105365
|
+
sdtMetadata: docPartSdtMetadata,
|
|
105366
|
+
tocId
|
|
105355
105367
|
}, {
|
|
105356
105368
|
nextBlockId,
|
|
105357
105369
|
positions,
|
|
@@ -105399,7 +105411,8 @@ function handleDocumentPartObjectNode(node3, context) {
|
|
|
105399
105411
|
docPartGallery: docPartGallery ?? "",
|
|
105400
105412
|
docPartObjectId,
|
|
105401
105413
|
tocInstruction: getNodeInstruction(child) ?? tocInstruction,
|
|
105402
|
-
sdtMetadata: docPartSdtMetadata
|
|
105414
|
+
sdtMetadata: docPartSdtMetadata,
|
|
105415
|
+
tocId
|
|
105403
105416
|
};
|
|
105404
105417
|
const tocContext = {
|
|
105405
105418
|
nextBlockId,
|
|
@@ -134192,7 +134205,7 @@ var isRegExp = (value) => {
|
|
|
134192
134205
|
state.kern = kernNode.attributes["w:val"];
|
|
134193
134206
|
}
|
|
134194
134207
|
}, SuperConverter;
|
|
134195
|
-
var
|
|
134208
|
+
var init_SuperConverter_e4tY_2EB_es = __esm(() => {
|
|
134196
134209
|
init_rolldown_runtime_Bg48TavK_es();
|
|
134197
134210
|
init_jszip_C49i9kUs_es();
|
|
134198
134211
|
init_xml_js_CqGKpaft_es();
|
|
@@ -173976,7 +173989,7 @@ var init_SuperConverter_BaKhr4cp_es = __esm(() => {
|
|
|
173976
173989
|
};
|
|
173977
173990
|
});
|
|
173978
173991
|
|
|
173979
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
173992
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-3iIgFoKe.es.js
|
|
173980
173993
|
function parseSizeUnit(val = "0") {
|
|
173981
173994
|
const length3 = val.toString() || "0";
|
|
173982
173995
|
const value = Number.parseFloat(length3);
|
|
@@ -184334,8 +184347,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
184334
184347
|
}
|
|
184335
184348
|
};
|
|
184336
184349
|
};
|
|
184337
|
-
var
|
|
184338
|
-
|
|
184350
|
+
var init_create_headless_toolbar_3iIgFoKe_es = __esm(() => {
|
|
184351
|
+
init_SuperConverter_e4tY_2EB_es();
|
|
184339
184352
|
init_uuid_B2wVPhPi_es();
|
|
184340
184353
|
init_constants_D9qj59G2_es();
|
|
184341
184354
|
init_dist_B8HfvhaK_es();
|
|
@@ -233498,7 +233511,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
233498
233511
|
init_remark_gfm_BhnWr3yf_es();
|
|
233499
233512
|
});
|
|
233500
233513
|
|
|
233501
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
233514
|
+
// ../../packages/superdoc/dist/chunks/src-M0JgzZDj.es.js
|
|
233502
233515
|
function deleteProps(obj, propOrProps) {
|
|
233503
233516
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
233504
233517
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -242592,9 +242605,6 @@ function replaceCommand(wrap5, moveForward) {
|
|
|
242592
242605
|
return true;
|
|
242593
242606
|
};
|
|
242594
242607
|
}
|
|
242595
|
-
function buildSdtBlockSelector(escapedSdtId) {
|
|
242596
|
-
return `.${DOM_CLASS_NAMES.BLOCK_SDT}[${DATA_ATTRS.SDT_ID}="${escapedSdtId}"]`;
|
|
242597
|
-
}
|
|
242598
242608
|
function buildAnnotationSelector() {
|
|
242599
242609
|
return `.${DOM_CLASS_NAMES.ANNOTATION}[${DATA_ATTRS.PM_START}]`;
|
|
242600
242610
|
}
|
|
@@ -312799,6 +312809,7 @@ var Node$13 = class Node$14 {
|
|
|
312799
312809
|
this.syncInlineStyleLayers(options.editorState, options.domPositionIndex);
|
|
312800
312810
|
this.applyProofingAnnotations(options.proofingAnnotations, options.rebuildDomPositionIndex);
|
|
312801
312811
|
options.reapplyStructuredContentHover?.();
|
|
312812
|
+
options.reapplyTocGroupHover?.();
|
|
312802
312813
|
}
|
|
312803
312814
|
destroy() {
|
|
312804
312815
|
this.#proofingDecorator.clear();
|
|
@@ -312808,6 +312819,83 @@ var Node$13 = class Node$14 {
|
|
|
312808
312819
|
this.#commentHighlightDecorator.destroy();
|
|
312809
312820
|
this.#decorationBridge.destroy();
|
|
312810
312821
|
}
|
|
312822
|
+
}, HoverGroupCoordinator = class {
|
|
312823
|
+
#spec;
|
|
312824
|
+
#current = null;
|
|
312825
|
+
constructor(spec) {
|
|
312826
|
+
this.handleMouseEnter = (event) => {
|
|
312827
|
+
const entry = event.target?.closest?.(this.#spec.entrySelector);
|
|
312828
|
+
if (!entry)
|
|
312829
|
+
return;
|
|
312830
|
+
const id2 = this.#spec.getId(entry);
|
|
312831
|
+
if (!id2)
|
|
312832
|
+
return;
|
|
312833
|
+
this.#set(id2);
|
|
312834
|
+
};
|
|
312835
|
+
this.handleMouseLeave = (event) => {
|
|
312836
|
+
const entry = event.target?.closest?.(this.#spec.entrySelector);
|
|
312837
|
+
if (!entry)
|
|
312838
|
+
return;
|
|
312839
|
+
const id2 = this.#spec.getId(entry);
|
|
312840
|
+
if (!id2)
|
|
312841
|
+
return;
|
|
312842
|
+
const relatedTarget = event.relatedTarget;
|
|
312843
|
+
if (relatedTarget) {
|
|
312844
|
+
const nextEntry = relatedTarget.closest?.(this.#spec.entrySelector);
|
|
312845
|
+
if (nextEntry && this.#spec.getId(nextEntry) === id2)
|
|
312846
|
+
return;
|
|
312847
|
+
}
|
|
312848
|
+
this.clear();
|
|
312849
|
+
};
|
|
312850
|
+
this.#spec = spec;
|
|
312851
|
+
}
|
|
312852
|
+
reapply() {
|
|
312853
|
+
if (!this.#current)
|
|
312854
|
+
return;
|
|
312855
|
+
const { id: id2 } = this.#current;
|
|
312856
|
+
const elements = this.#spec.queryGroup(id2);
|
|
312857
|
+
if (elements.length === 0) {
|
|
312858
|
+
this.#current = null;
|
|
312859
|
+
return;
|
|
312860
|
+
}
|
|
312861
|
+
this.#applyClass(elements);
|
|
312862
|
+
this.#spec.onApply?.(elements);
|
|
312863
|
+
this.#current = {
|
|
312864
|
+
id: id2,
|
|
312865
|
+
elements
|
|
312866
|
+
};
|
|
312867
|
+
}
|
|
312868
|
+
clear() {
|
|
312869
|
+
if (!this.#current)
|
|
312870
|
+
return;
|
|
312871
|
+
for (const element3 of this.#current.elements) {
|
|
312872
|
+
element3.classList.remove(this.#spec.hoverClass);
|
|
312873
|
+
this.#spec.onClear?.(element3);
|
|
312874
|
+
}
|
|
312875
|
+
this.#current = null;
|
|
312876
|
+
}
|
|
312877
|
+
#set(id2) {
|
|
312878
|
+
if (this.#current?.id === id2)
|
|
312879
|
+
return;
|
|
312880
|
+
this.clear();
|
|
312881
|
+
const elements = this.#spec.queryGroup(id2);
|
|
312882
|
+
if (elements.length === 0)
|
|
312883
|
+
return;
|
|
312884
|
+
this.#applyClass(elements);
|
|
312885
|
+
this.#spec.onApply?.(elements);
|
|
312886
|
+
this.#current = {
|
|
312887
|
+
id: id2,
|
|
312888
|
+
elements
|
|
312889
|
+
};
|
|
312890
|
+
}
|
|
312891
|
+
#applyClass(elements) {
|
|
312892
|
+
const filter = this.#spec.shouldApplyTo;
|
|
312893
|
+
for (const element3 of elements) {
|
|
312894
|
+
if (filter && !filter(element3))
|
|
312895
|
+
continue;
|
|
312896
|
+
element3.classList.add(this.#spec.hoverClass);
|
|
312897
|
+
}
|
|
312898
|
+
}
|
|
312811
312899
|
}, ProofingStore = class {
|
|
312812
312900
|
#issuesBySegment = /* @__PURE__ */ new Map;
|
|
312813
312901
|
addIssue(issue) {
|
|
@@ -313418,6 +313506,9 @@ var Node$13 = class Node$14 {
|
|
|
313418
313506
|
color: inherit !important;
|
|
313419
313507
|
text-decoration: none !important;
|
|
313420
313508
|
cursor: default;
|
|
313509
|
+
/* Disable native link drag so our pointer loop can run text-selection. */
|
|
313510
|
+
-webkit-user-drag: none;
|
|
313511
|
+
user-drag: none;
|
|
313421
313512
|
}
|
|
313422
313513
|
|
|
313423
313514
|
.superdoc-toc-entry .superdoc-link:hover {
|
|
@@ -313429,6 +313520,31 @@ var Node$13 = class Node$14 {
|
|
|
313429
313520
|
outline: none;
|
|
313430
313521
|
}
|
|
313431
313522
|
|
|
313523
|
+
/* TOC hover. .toc-group-hover is set by PresentationEditor on every entry
|
|
313524
|
+
sharing a data-toc-id so the whole TOC greys out together. The ::after
|
|
313525
|
+
stripe (height set via --toc-gap-below) fills the paragraph-spacing gap
|
|
313526
|
+
between adjacent entries so the hover reads as one continuous block. */
|
|
313527
|
+
.superdoc-toc-entry:hover,
|
|
313528
|
+
.superdoc-toc-entry.toc-group-hover {
|
|
313529
|
+
background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
|
|
313530
|
+
}
|
|
313531
|
+
|
|
313532
|
+
/* Pointer-events stay on (default) so the stripe extends the parent entry's
|
|
313533
|
+
hit-test area through the paragraph-spacing gap. Without this, moving the
|
|
313534
|
+
cursor between two adjacent entries fires mouseout on the upper entry with
|
|
313535
|
+
relatedTarget = the page (not a TOC entry), the coordinator drops the
|
|
313536
|
+
group-hover class, and the grey disappears for a frame before the next
|
|
313537
|
+
entry's mouseover restores it — visible as a flicker. */
|
|
313538
|
+
.superdoc-toc-entry.toc-group-hover::after {
|
|
313539
|
+
content: '';
|
|
313540
|
+
position: absolute;
|
|
313541
|
+
left: 0;
|
|
313542
|
+
right: 0;
|
|
313543
|
+
top: 100%;
|
|
313544
|
+
height: var(--toc-gap-below, 0px);
|
|
313545
|
+
background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
|
|
313546
|
+
}
|
|
313547
|
+
|
|
313432
313548
|
/* Remove focus outlines from layout engine elements */
|
|
313433
313549
|
.superdoc-layout,
|
|
313434
313550
|
.superdoc-page,
|
|
@@ -317406,8 +317522,12 @@ menclose::after {
|
|
|
317406
317522
|
applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment2);
|
|
317407
317523
|
else
|
|
317408
317524
|
applyFragmentFrame(fragmentEl, fragment2);
|
|
317409
|
-
if (isTocEntry)
|
|
317410
|
-
fragmentEl.classList.add(
|
|
317525
|
+
if (isTocEntry) {
|
|
317526
|
+
fragmentEl.classList.add(DOM_CLASS_NAMES.TOC_ENTRY);
|
|
317527
|
+
const tocId = block.attrs?.tocId;
|
|
317528
|
+
if (typeof tocId === "string" && tocId.length > 0)
|
|
317529
|
+
fragmentEl.dataset.tocId = tocId;
|
|
317530
|
+
}
|
|
317411
317531
|
if (paraContinuesFromPrev)
|
|
317412
317532
|
fragmentEl.dataset.continuesFromPrev = "true";
|
|
317413
317533
|
if (paraContinuesOnNext)
|
|
@@ -325602,6 +325722,7 @@ menclose::after {
|
|
|
325602
325722
|
#cellAnchor = null;
|
|
325603
325723
|
#cellDragMode = "none";
|
|
325604
325724
|
#pendingMarginClick = null;
|
|
325725
|
+
#pendingTocLinkNav = null;
|
|
325605
325726
|
#lastSelectedImageBlockId = null;
|
|
325606
325727
|
#suppressFocusInFromDraggable = false;
|
|
325607
325728
|
#pendingStructuredContentLabelGesture = null;
|
|
@@ -326143,10 +326264,14 @@ menclose::after {
|
|
|
326143
326264
|
return;
|
|
326144
326265
|
}
|
|
326145
326266
|
const linkEl = target?.closest?.("a.superdoc-link");
|
|
326146
|
-
|
|
326147
|
-
|
|
326148
|
-
|
|
326149
|
-
|
|
326267
|
+
this.#pendingTocLinkNav = null;
|
|
326268
|
+
if (linkEl)
|
|
326269
|
+
if (linkEl.closest(`.${DOM_CLASS_NAMES.TOC_ENTRY}`))
|
|
326270
|
+
this.#pendingTocLinkNav = linkEl;
|
|
326271
|
+
else {
|
|
326272
|
+
this.#handleLinkClick(event, linkEl);
|
|
326273
|
+
return;
|
|
326274
|
+
}
|
|
326150
326275
|
const annotationEl = target?.closest?.(buildAnnotationSelector());
|
|
326151
326276
|
const isDraggableAnnotation = target?.closest?.(DRAGGABLE_SELECTOR) != null;
|
|
326152
326277
|
const isNativeDragSource = target?.closest?.(DRAG_SOURCE_SELECTOR) != null;
|
|
@@ -326485,6 +326610,10 @@ menclose::after {
|
|
|
326485
326610
|
event
|
|
326486
326611
|
});
|
|
326487
326612
|
this.#suppressFocusInFromDraggable = false;
|
|
326613
|
+
const pendingTocLink = this.#pendingTocLinkNav;
|
|
326614
|
+
this.#pendingTocLinkNav = null;
|
|
326615
|
+
if (pendingTocLink && !this.#dragThresholdExceeded)
|
|
326616
|
+
this.#handleLinkClick(event, pendingTocLink);
|
|
326488
326617
|
if (!this.#isDragging) {
|
|
326489
326618
|
this.#stopAutoScroll();
|
|
326490
326619
|
return;
|
|
@@ -330959,13 +331088,13 @@ menclose::after {
|
|
|
330959
331088
|
return;
|
|
330960
331089
|
console.log(...args$1);
|
|
330961
331090
|
}, 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, TRACKED_MARK_NAMES;
|
|
330962
|
-
var
|
|
331091
|
+
var init_src_M0JgzZDj_es = __esm(() => {
|
|
330963
331092
|
init_rolldown_runtime_Bg48TavK_es();
|
|
330964
|
-
|
|
331093
|
+
init_SuperConverter_e4tY_2EB_es();
|
|
330965
331094
|
init_jszip_C49i9kUs_es();
|
|
330966
331095
|
init_xml_js_CqGKpaft_es();
|
|
330967
331096
|
init_uuid_B2wVPhPi_es();
|
|
330968
|
-
|
|
331097
|
+
init_create_headless_toolbar_3iIgFoKe_es();
|
|
330969
331098
|
init_constants_D9qj59G2_es();
|
|
330970
331099
|
init_dist_B8HfvhaK_es();
|
|
330971
331100
|
init_unified_Dsuw2be5_es();
|
|
@@ -349895,6 +350024,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
349895
350024
|
TABLE_FRAGMENT: "superdoc-table-fragment",
|
|
349896
350025
|
DOCUMENT_SECTION: "superdoc-document-section",
|
|
349897
350026
|
SDT_GROUP_HOVER: "sdt-group-hover",
|
|
350027
|
+
TOC_ENTRY: "superdoc-toc-entry",
|
|
350028
|
+
TOC_GROUP_HOVER: "toc-group-hover",
|
|
349898
350029
|
IMAGE_FRAGMENT: "superdoc-image-fragment",
|
|
349899
350030
|
INLINE_IMAGE: "superdoc-inline-image",
|
|
349900
350031
|
LIST_MARKER: "superdoc-list-marker",
|
|
@@ -359420,7 +359551,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
359420
359551
|
#lastSelectedFieldAnnotation = null;
|
|
359421
359552
|
#lastSelectedStructuredContentBlock = null;
|
|
359422
359553
|
#lastSelectedStructuredContentInline = null;
|
|
359423
|
-
#
|
|
359554
|
+
#sdtHoverCoordinator = null;
|
|
359555
|
+
#tocHoverCoordinator = null;
|
|
359424
359556
|
#remoteCursorManager = null;
|
|
359425
359557
|
#cursorUpdateTimer = null;
|
|
359426
359558
|
#remoteCursorOverlay = null;
|
|
@@ -359491,8 +359623,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
359491
359623
|
ensureEditorNativeSelectionStyles(doc$12);
|
|
359492
359624
|
ensureEditorFieldAnnotationInteractionStyles(doc$12);
|
|
359493
359625
|
ensureEditorMovableObjectInteractionStyles(doc$12);
|
|
359494
|
-
this.#
|
|
359495
|
-
this.#painterHost.addEventListener("
|
|
359626
|
+
this.#initializeHoverCoordinators();
|
|
359627
|
+
this.#painterHost.addEventListener("mouseover", this.#sdtHoverCoordinator.handleMouseEnter);
|
|
359628
|
+
this.#painterHost.addEventListener("mouseout", this.#sdtHoverCoordinator.handleMouseLeave);
|
|
359629
|
+
this.#painterHost.addEventListener("mouseover", this.#tocHoverCoordinator.handleMouseEnter);
|
|
359630
|
+
this.#painterHost.addEventListener("mouseout", this.#tocHoverCoordinator.handleMouseLeave);
|
|
359496
359631
|
this.#domIndexObserverManager = new DomPositionIndexObserverManager({
|
|
359497
359632
|
windowRoot: this.#visibleHost?.ownerDocument?.defaultView ?? window,
|
|
359498
359633
|
getPainterHost: () => this.#painterHost,
|
|
@@ -363483,74 +363618,50 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
363483
363618
|
}
|
|
363484
363619
|
this.#setSelectedStructuredContentBlockClass(elements, id2);
|
|
363485
363620
|
}
|
|
363486
|
-
#
|
|
363487
|
-
|
|
363488
|
-
if (!block || !(block instanceof HTMLElement))
|
|
363621
|
+
#initializeHoverCoordinators() {
|
|
363622
|
+
if (this.#sdtHoverCoordinator || this.#tocHoverCoordinator)
|
|
363489
363623
|
return;
|
|
363490
|
-
|
|
363624
|
+
this.#sdtHoverCoordinator = new HoverGroupCoordinator({
|
|
363625
|
+
entrySelector: `.${DOM_CLASS_NAMES.BLOCK_SDT}`,
|
|
363626
|
+
getId: (entry) => entry.dataset.sdtId,
|
|
363627
|
+
queryGroup: (id2) => this.#painterAdapter.getStructuredContentBlockElementsById(id2),
|
|
363628
|
+
hoverClass: DOM_CLASS_NAMES.SDT_GROUP_HOVER,
|
|
363629
|
+
shouldApplyTo: (element3) => !element3.classList.contains("ProseMirror-selectednode")
|
|
363630
|
+
});
|
|
363631
|
+
this.#tocHoverCoordinator = new HoverGroupCoordinator({
|
|
363632
|
+
entrySelector: `.${DOM_CLASS_NAMES.TOC_ENTRY}`,
|
|
363633
|
+
getId: (entry) => entry.dataset.tocId,
|
|
363634
|
+
queryGroup: (id2) => this.#queryTocEntryElementsById(id2),
|
|
363635
|
+
hoverClass: DOM_CLASS_NAMES.TOC_GROUP_HOVER,
|
|
363636
|
+
onApply: (elements) => this.#applyTocGapFill(elements),
|
|
363637
|
+
onClear: (element3) => element3.style.removeProperty("--toc-gap-below")
|
|
363638
|
+
});
|
|
363639
|
+
}
|
|
363640
|
+
#applyTocGapFill(elements) {
|
|
363641
|
+
if (elements.length < 2)
|
|
363491
363642
|
return;
|
|
363492
|
-
const
|
|
363493
|
-
|
|
363494
|
-
|
|
363495
|
-
|
|
363496
|
-
|
|
363497
|
-
|
|
363498
|
-
|
|
363499
|
-
|
|
363500
|
-
|
|
363501
|
-
|
|
363502
|
-
|
|
363503
|
-
const
|
|
363504
|
-
|
|
363505
|
-
|
|
363643
|
+
const measured = elements.map((element3) => ({
|
|
363644
|
+
element: element3,
|
|
363645
|
+
rect: element3.getBoundingClientRect()
|
|
363646
|
+
})).sort((a2, b$1) => a2.rect.top - b$1.rect.top);
|
|
363647
|
+
for (let i4 = 0;i4 < measured.length - 1; i4++) {
|
|
363648
|
+
const current = measured[i4];
|
|
363649
|
+
const next2 = measured[i4 + 1];
|
|
363650
|
+
const currentPage = current.element.closest("[data-page-index]");
|
|
363651
|
+
if (!currentPage || currentPage !== next2.element.closest("[data-page-index]"))
|
|
363652
|
+
continue;
|
|
363653
|
+
const rawGap = next2.rect.top - current.rect.bottom;
|
|
363654
|
+
const scaleY = current.rect.height && current.element.offsetHeight ? current.rect.height / current.element.offsetHeight : 1;
|
|
363655
|
+
const gap = scaleY > 0 ? rawGap / scaleY : rawGap;
|
|
363656
|
+
if (gap > 0)
|
|
363657
|
+
current.element.style.setProperty("--toc-gap-below", `${gap + 1}px`);
|
|
363506
363658
|
}
|
|
363507
|
-
this.#clearHoveredStructuredContentBlockClass();
|
|
363508
|
-
};
|
|
363509
|
-
#clearHoveredStructuredContentBlockClass() {
|
|
363510
|
-
if (!this.#lastHoveredStructuredContentBlock)
|
|
363511
|
-
return;
|
|
363512
|
-
this.#lastHoveredStructuredContentBlock.elements.forEach((element3) => {
|
|
363513
|
-
element3.classList.remove(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
|
|
363514
|
-
});
|
|
363515
|
-
this.#lastHoveredStructuredContentBlock = null;
|
|
363516
363659
|
}
|
|
363517
|
-
#
|
|
363518
|
-
if (this.#lastHoveredStructuredContentBlock?.id === id2)
|
|
363519
|
-
return;
|
|
363520
|
-
this.#clearHoveredStructuredContentBlockClass();
|
|
363660
|
+
#queryTocEntryElementsById(id2) {
|
|
363521
363661
|
if (!this.#painterHost)
|
|
363522
|
-
return;
|
|
363523
|
-
const
|
|
363524
|
-
|
|
363525
|
-
return;
|
|
363526
|
-
elements.forEach((element3) => {
|
|
363527
|
-
if (!element3.classList.contains("ProseMirror-selectednode"))
|
|
363528
|
-
element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
|
|
363529
|
-
});
|
|
363530
|
-
this.#lastHoveredStructuredContentBlock = {
|
|
363531
|
-
id: id2,
|
|
363532
|
-
elements
|
|
363533
|
-
};
|
|
363534
|
-
}
|
|
363535
|
-
#reapplySdtGroupHover() {
|
|
363536
|
-
if (!this.#lastHoveredStructuredContentBlock || !this.#painterHost)
|
|
363537
|
-
return;
|
|
363538
|
-
const { id: id2 } = this.#lastHoveredStructuredContentBlock;
|
|
363539
|
-
if (!id2)
|
|
363540
|
-
return;
|
|
363541
|
-
const elements = this.#painterAdapter.getStructuredContentBlockElementsById(id2);
|
|
363542
|
-
if (elements.length === 0) {
|
|
363543
|
-
this.#lastHoveredStructuredContentBlock = null;
|
|
363544
|
-
return;
|
|
363545
|
-
}
|
|
363546
|
-
elements.forEach((element3) => {
|
|
363547
|
-
if (!element3.classList.contains("ProseMirror-selectednode"))
|
|
363548
|
-
element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
|
|
363549
|
-
});
|
|
363550
|
-
this.#lastHoveredStructuredContentBlock = {
|
|
363551
|
-
id: id2,
|
|
363552
|
-
elements
|
|
363553
|
-
};
|
|
363662
|
+
return [];
|
|
363663
|
+
const escapedId = escapeAttrValue(id2);
|
|
363664
|
+
return Array.from(this.#painterHost.querySelectorAll(`.${DOM_CLASS_NAMES.TOC_ENTRY}[data-toc-id="${escapedId}"]`));
|
|
363554
363665
|
}
|
|
363555
363666
|
#refreshEditorDomAugmentations() {
|
|
363556
363667
|
this.#postPaintPipeline.refreshAfterPaint({
|
|
@@ -363559,7 +363670,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
363559
363670
|
domPositionIndex: this.#domPositionIndex,
|
|
363560
363671
|
proofingAnnotations: this.#buildProofingAnnotations(),
|
|
363561
363672
|
rebuildDomPositionIndex: () => this.#rebuildDomPositionIndex(),
|
|
363562
|
-
reapplyStructuredContentHover: () => this.#
|
|
363673
|
+
reapplyStructuredContentHover: () => this.#sdtHoverCoordinator?.reapply(),
|
|
363674
|
+
reapplyTocGroupHover: () => this.#tocHoverCoordinator?.reapply()
|
|
363563
363675
|
});
|
|
363564
363676
|
}
|
|
363565
363677
|
#clearSelectedStructuredContentInlineClass() {
|
|
@@ -365947,11 +366059,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
365947
366059
|
]);
|
|
365948
366060
|
});
|
|
365949
366061
|
|
|
365950
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
366062
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-BbHhTe5g.es.js
|
|
365951
366063
|
var headlessToolbarConstants, 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;
|
|
365952
|
-
var
|
|
365953
|
-
|
|
365954
|
-
|
|
366064
|
+
var init_create_super_doc_ui_BbHhTe5g_es = __esm(() => {
|
|
366065
|
+
init_SuperConverter_e4tY_2EB_es();
|
|
366066
|
+
init_create_headless_toolbar_3iIgFoKe_es();
|
|
365955
366067
|
headlessToolbarConstants = {
|
|
365956
366068
|
DEFAULT_TEXT_ALIGN_OPTIONS: [
|
|
365957
366069
|
{
|
|
@@ -366233,16 +366345,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
366233
366345
|
|
|
366234
366346
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
366235
366347
|
var init_super_editor_es = __esm(() => {
|
|
366236
|
-
|
|
366237
|
-
|
|
366348
|
+
init_src_M0JgzZDj_es();
|
|
366349
|
+
init_SuperConverter_e4tY_2EB_es();
|
|
366238
366350
|
init_jszip_C49i9kUs_es();
|
|
366239
366351
|
init_xml_js_CqGKpaft_es();
|
|
366240
|
-
|
|
366352
|
+
init_create_headless_toolbar_3iIgFoKe_es();
|
|
366241
366353
|
init_constants_D9qj59G2_es();
|
|
366242
366354
|
init_dist_B8HfvhaK_es();
|
|
366243
366355
|
init_unified_Dsuw2be5_es();
|
|
366244
366356
|
init_DocxZipper_FUsfThjV_es();
|
|
366245
|
-
|
|
366357
|
+
init_create_super_doc_ui_BbHhTe5g_es();
|
|
366246
366358
|
init_ui_C5PAS9hY_es();
|
|
366247
366359
|
init_eventemitter3_BnGqBE_Q_es();
|
|
366248
366360
|
init_errors_CNaD6vcg_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.17.0-next.
|
|
3
|
+
"version": "0.17.0-next.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"@types/ws": "^8.5.13",
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"@superdoc/document-api": "0.0.1",
|
|
28
|
-
"
|
|
29
|
-
"superdoc": "
|
|
28
|
+
"superdoc": "1.39.0",
|
|
29
|
+
"@superdoc/super-editor": "0.0.1"
|
|
30
30
|
},
|
|
31
31
|
"module": "src/index.ts",
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@superdoc-dev/cli-darwin-arm64": "0.17.0-next.
|
|
37
|
-
"@superdoc-dev/cli-darwin-x64": "0.17.0-next.
|
|
38
|
-
"@superdoc-dev/cli-
|
|
39
|
-
"@superdoc-dev/cli-linux-
|
|
40
|
-
"@superdoc-dev/cli-
|
|
36
|
+
"@superdoc-dev/cli-darwin-arm64": "0.17.0-next.8",
|
|
37
|
+
"@superdoc-dev/cli-darwin-x64": "0.17.0-next.8",
|
|
38
|
+
"@superdoc-dev/cli-windows-x64": "0.17.0-next.8",
|
|
39
|
+
"@superdoc-dev/cli-linux-arm64": "0.17.0-next.8",
|
|
40
|
+
"@superdoc-dev/cli-linux-x64": "0.17.0-next.8"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"predev": "node scripts/ensure-superdoc-build.js",
|