@superdoc-dev/cli 0.17.0-next.3 → 0.17.0-next.5
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 +311 -76
- 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-BaKhr4cp.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")
|
|
@@ -102479,32 +102479,37 @@ function buildFallback(row, physicalFamily, verdict, faceSlot) {
|
|
|
102479
102479
|
lineBreakSafe: LINE_BREAK_SAFE_VERDICTS.has(verdict),
|
|
102480
102480
|
faces: row.faces,
|
|
102481
102481
|
evidenceId: row.evidenceId,
|
|
102482
|
+
generic: row.generic,
|
|
102482
102483
|
...glyphExceptions && glyphExceptions.length > 0 ? { glyphExceptions } : {}
|
|
102483
102484
|
};
|
|
102484
102485
|
}
|
|
102485
102486
|
function decideRow(row, canRenderFamily$1) {
|
|
102486
|
-
const { policyAction, physicalFamily, verdict, evidenceId } = row;
|
|
102487
|
+
const { policyAction, physicalFamily, verdict, evidenceId, generic } = row;
|
|
102487
102488
|
if (policyAction === "preserve_only")
|
|
102488
102489
|
return {
|
|
102489
102490
|
kind: "preserve_only",
|
|
102490
|
-
evidenceId
|
|
102491
|
+
evidenceId,
|
|
102492
|
+
generic
|
|
102491
102493
|
};
|
|
102492
102494
|
if (policyAction === "customer_supplied")
|
|
102493
102495
|
return {
|
|
102494
102496
|
kind: "customer_supplied",
|
|
102495
|
-
evidenceId
|
|
102497
|
+
evidenceId,
|
|
102498
|
+
generic
|
|
102496
102499
|
};
|
|
102497
102500
|
if (physicalFamily === null)
|
|
102498
102501
|
return {
|
|
102499
102502
|
kind: "no_recommended_fallback",
|
|
102500
|
-
evidenceId
|
|
102503
|
+
evidenceId,
|
|
102504
|
+
generic
|
|
102501
102505
|
};
|
|
102502
102506
|
if (canRenderFamily$1 && !canRenderFamily$1(physicalFamily))
|
|
102503
102507
|
return {
|
|
102504
102508
|
kind: "asset_missing",
|
|
102505
102509
|
substituteFamily: physicalFamily,
|
|
102506
102510
|
verdict,
|
|
102507
|
-
evidenceId
|
|
102511
|
+
evidenceId,
|
|
102512
|
+
generic
|
|
102508
102513
|
};
|
|
102509
102514
|
return {
|
|
102510
102515
|
kind: "fallback",
|
|
@@ -102523,7 +102528,8 @@ function decideRowForFace(row, face, canRenderFamily$1) {
|
|
|
102523
102528
|
return {
|
|
102524
102529
|
kind: "face_missing",
|
|
102525
102530
|
substituteFamily: base$1.fallback.substituteFamily,
|
|
102526
|
-
evidenceId: row.evidenceId
|
|
102531
|
+
evidenceId: row.evidenceId,
|
|
102532
|
+
generic: row.generic
|
|
102527
102533
|
};
|
|
102528
102534
|
const faceVerdict = row.faceVerdicts?.[face] ?? row.verdict;
|
|
102529
102535
|
return {
|
|
@@ -102844,7 +102850,7 @@ function deriveOfferings() {
|
|
|
102844
102850
|
return {
|
|
102845
102851
|
logicalFamily: row.logicalFamily,
|
|
102846
102852
|
physicalFamily: row.physicalFamily,
|
|
102847
|
-
generic: row.
|
|
102853
|
+
generic: row.generic,
|
|
102848
102854
|
offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
|
|
102849
102855
|
bundled,
|
|
102850
102856
|
verdict: row.verdict,
|
|
@@ -102853,12 +102859,11 @@ function deriveOfferings() {
|
|
|
102853
102859
|
});
|
|
102854
102860
|
return Object.freeze(offerings);
|
|
102855
102861
|
}
|
|
102862
|
+
function compareLogicalFamily(a, b) {
|
|
102863
|
+
return a.logicalFamily.localeCompare(b.logicalFamily, "en", { sensitivity: "base" });
|
|
102864
|
+
}
|
|
102856
102865
|
function getDefaultFontOfferings() {
|
|
102857
|
-
|
|
102858
|
-
const i$1 = DEFAULT_FONT_ORDER.indexOf(name);
|
|
102859
|
-
return i$1 === -1 ? DEFAULT_FONT_ORDER.length : i$1;
|
|
102860
|
-
};
|
|
102861
|
-
return FONT_OFFERINGS.filter((o) => o.offering === "default").sort((a, b) => rank$1(a.logicalFamily) - rank$1(b.logicalFamily));
|
|
102866
|
+
return FONT_OFFERINGS.filter((o) => o.offering === "default").sort(compareLogicalFamily);
|
|
102862
102867
|
}
|
|
102863
102868
|
function fontOfferingStack(offering) {
|
|
102864
102869
|
return `${offering.logicalFamily}, ${offering.generic}`;
|
|
@@ -102872,6 +102877,33 @@ function getDefaultFontFamilyOptions() {
|
|
|
102872
102877
|
value: fontOfferingStack(offering)
|
|
102873
102878
|
}));
|
|
102874
102879
|
}
|
|
102880
|
+
function normalizeKey(family$1) {
|
|
102881
|
+
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
102882
|
+
}
|
|
102883
|
+
function isRegularFace(rec) {
|
|
102884
|
+
return rec.face?.weight === "400" && rec.face?.style === "normal";
|
|
102885
|
+
}
|
|
102886
|
+
function buildDocumentFontOptions(usedFaces, registry, resolver$1) {
|
|
102887
|
+
const faceRecords = buildFaceReport(usedFaces, registry, resolver$1);
|
|
102888
|
+
const agg = /* @__PURE__ */ new Map;
|
|
102889
|
+
for (const rec of faceRecords) {
|
|
102890
|
+
const key = normalizeKey(rec.logicalFamily);
|
|
102891
|
+
const existing = agg.get(key);
|
|
102892
|
+
if (!existing) {
|
|
102893
|
+
agg.set(key, rec);
|
|
102894
|
+
continue;
|
|
102895
|
+
}
|
|
102896
|
+
if (isRegularFace(rec) && !isRegularFace(existing))
|
|
102897
|
+
agg.set(key, rec);
|
|
102898
|
+
}
|
|
102899
|
+
const options = [];
|
|
102900
|
+
for (const rep of agg.values())
|
|
102901
|
+
options.push({
|
|
102902
|
+
logicalFamily: rep.logicalFamily,
|
|
102903
|
+
previewFamily: rep.physicalFamily
|
|
102904
|
+
});
|
|
102905
|
+
return options;
|
|
102906
|
+
}
|
|
102875
102907
|
function writeAppStatistics(convertedXml, stats) {
|
|
102876
102908
|
const elements = ensureElements$1(ensureAppPropertiesRoot(convertedXml));
|
|
102877
102909
|
upsertSimpleElement(elements, "Words", String(stats.words));
|
|
@@ -130184,7 +130216,7 @@ var isRegExp = (value) => {
|
|
|
130184
130216
|
const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
|
|
130185
130217
|
console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
130186
130218
|
}
|
|
130187
|
-
}, registriesByFontSet, domlessRegistry = null,
|
|
130219
|
+
}, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
|
|
130188
130220
|
return {
|
|
130189
130221
|
...comment,
|
|
130190
130222
|
commentParaId: generateDocxRandomId()
|
|
@@ -134160,7 +134192,7 @@ var isRegExp = (value) => {
|
|
|
134160
134192
|
state.kern = kernNode.attributes["w:val"];
|
|
134161
134193
|
}
|
|
134162
134194
|
}, SuperConverter;
|
|
134163
|
-
var
|
|
134195
|
+
var init_SuperConverter_BaKhr4cp_es = __esm(() => {
|
|
134164
134196
|
init_rolldown_runtime_Bg48TavK_es();
|
|
134165
134197
|
init_jszip_C49i9kUs_es();
|
|
134166
134198
|
init_xml_js_CqGKpaft_es();
|
|
@@ -171480,6 +171512,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171480
171512
|
SUBSTITUTION_EVIDENCE$1 = [
|
|
171481
171513
|
{
|
|
171482
171514
|
evidenceId: "calibri",
|
|
171515
|
+
generic: "sans-serif",
|
|
171483
171516
|
logicalFamily: "Calibri",
|
|
171484
171517
|
physicalFamily: "Carlito",
|
|
171485
171518
|
verdict: "metric_safe",
|
|
@@ -171506,6 +171539,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171506
171539
|
},
|
|
171507
171540
|
{
|
|
171508
171541
|
evidenceId: "cambria",
|
|
171542
|
+
generic: "serif",
|
|
171509
171543
|
logicalFamily: "Cambria",
|
|
171510
171544
|
physicalFamily: "Caladea",
|
|
171511
171545
|
verdict: "visual_only",
|
|
@@ -171549,6 +171583,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171549
171583
|
},
|
|
171550
171584
|
{
|
|
171551
171585
|
evidenceId: "arial",
|
|
171586
|
+
generic: "sans-serif",
|
|
171552
171587
|
logicalFamily: "Arial",
|
|
171553
171588
|
physicalFamily: "Liberation Sans",
|
|
171554
171589
|
verdict: "metric_safe",
|
|
@@ -171575,6 +171610,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171575
171610
|
},
|
|
171576
171611
|
{
|
|
171577
171612
|
evidenceId: "times-new-roman",
|
|
171613
|
+
generic: "serif",
|
|
171578
171614
|
logicalFamily: "Times New Roman",
|
|
171579
171615
|
physicalFamily: "Liberation Serif",
|
|
171580
171616
|
verdict: "metric_safe",
|
|
@@ -171601,6 +171637,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171601
171637
|
},
|
|
171602
171638
|
{
|
|
171603
171639
|
evidenceId: "courier-new",
|
|
171640
|
+
generic: "monospace",
|
|
171604
171641
|
logicalFamily: "Courier New",
|
|
171605
171642
|
physicalFamily: "Liberation Mono",
|
|
171606
171643
|
verdict: "metric_safe",
|
|
@@ -171627,6 +171664,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171627
171664
|
},
|
|
171628
171665
|
{
|
|
171629
171666
|
evidenceId: "georgia",
|
|
171667
|
+
generic: "serif",
|
|
171630
171668
|
logicalFamily: "Georgia",
|
|
171631
171669
|
physicalFamily: "Gelasio",
|
|
171632
171670
|
verdict: "near_metric",
|
|
@@ -171679,6 +171717,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171679
171717
|
},
|
|
171680
171718
|
{
|
|
171681
171719
|
evidenceId: "arial-narrow",
|
|
171720
|
+
generic: "sans-serif",
|
|
171682
171721
|
logicalFamily: "Arial Narrow",
|
|
171683
171722
|
physicalFamily: "Liberation Sans Narrow",
|
|
171684
171723
|
verdict: "visual_only",
|
|
@@ -171722,6 +171761,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171722
171761
|
},
|
|
171723
171762
|
{
|
|
171724
171763
|
evidenceId: "aptos",
|
|
171764
|
+
generic: "sans-serif",
|
|
171725
171765
|
logicalFamily: "Aptos",
|
|
171726
171766
|
physicalFamily: null,
|
|
171727
171767
|
verdict: "no_substitute",
|
|
@@ -171744,6 +171784,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171744
171784
|
},
|
|
171745
171785
|
{
|
|
171746
171786
|
evidenceId: "consolas",
|
|
171787
|
+
generic: "monospace",
|
|
171747
171788
|
logicalFamily: "Consolas",
|
|
171748
171789
|
physicalFamily: "Inconsolata SemiExpanded",
|
|
171749
171790
|
verdict: "cell_width_only",
|
|
@@ -171770,6 +171811,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171770
171811
|
},
|
|
171771
171812
|
{
|
|
171772
171813
|
evidenceId: "verdana",
|
|
171814
|
+
generic: "sans-serif",
|
|
171773
171815
|
logicalFamily: "Verdana",
|
|
171774
171816
|
physicalFamily: null,
|
|
171775
171817
|
verdict: "visual_only",
|
|
@@ -171792,6 +171834,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171792
171834
|
},
|
|
171793
171835
|
{
|
|
171794
171836
|
evidenceId: "tahoma",
|
|
171837
|
+
generic: "sans-serif",
|
|
171795
171838
|
logicalFamily: "Tahoma",
|
|
171796
171839
|
physicalFamily: null,
|
|
171797
171840
|
verdict: "visual_only",
|
|
@@ -171814,6 +171857,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171814
171857
|
},
|
|
171815
171858
|
{
|
|
171816
171859
|
evidenceId: "trebuchet-ms",
|
|
171860
|
+
generic: "sans-serif",
|
|
171817
171861
|
logicalFamily: "Trebuchet MS",
|
|
171818
171862
|
physicalFamily: null,
|
|
171819
171863
|
verdict: "visual_only",
|
|
@@ -171836,6 +171880,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171836
171880
|
},
|
|
171837
171881
|
{
|
|
171838
171882
|
evidenceId: "comic-sans-ms",
|
|
171883
|
+
generic: "sans-serif",
|
|
171839
171884
|
logicalFamily: "Comic Sans MS",
|
|
171840
171885
|
physicalFamily: "Comic Neue",
|
|
171841
171886
|
verdict: "visual_only",
|
|
@@ -171862,6 +171907,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171862
171907
|
},
|
|
171863
171908
|
{
|
|
171864
171909
|
evidenceId: "candara",
|
|
171910
|
+
generic: "sans-serif",
|
|
171865
171911
|
logicalFamily: "Candara",
|
|
171866
171912
|
physicalFamily: null,
|
|
171867
171913
|
verdict: "visual_only",
|
|
@@ -171884,6 +171930,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171884
171930
|
},
|
|
171885
171931
|
{
|
|
171886
171932
|
evidenceId: "constantia",
|
|
171933
|
+
generic: "serif",
|
|
171887
171934
|
logicalFamily: "Constantia",
|
|
171888
171935
|
physicalFamily: null,
|
|
171889
171936
|
verdict: "visual_only",
|
|
@@ -171906,6 +171953,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171906
171953
|
},
|
|
171907
171954
|
{
|
|
171908
171955
|
evidenceId: "corbel",
|
|
171956
|
+
generic: "sans-serif",
|
|
171909
171957
|
logicalFamily: "Corbel",
|
|
171910
171958
|
physicalFamily: null,
|
|
171911
171959
|
verdict: "visual_only",
|
|
@@ -171928,6 +171976,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171928
171976
|
},
|
|
171929
171977
|
{
|
|
171930
171978
|
evidenceId: "lucida-console",
|
|
171979
|
+
generic: "monospace",
|
|
171931
171980
|
logicalFamily: "Lucida Console",
|
|
171932
171981
|
physicalFamily: "Cousine",
|
|
171933
171982
|
verdict: "cell_width_only",
|
|
@@ -171954,6 +172003,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171954
172003
|
},
|
|
171955
172004
|
{
|
|
171956
172005
|
evidenceId: "aptos-display",
|
|
172006
|
+
generic: "sans-serif",
|
|
171957
172007
|
logicalFamily: "Aptos Display",
|
|
171958
172008
|
physicalFamily: null,
|
|
171959
172009
|
verdict: "customer_supplied",
|
|
@@ -171975,6 +172025,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171975
172025
|
},
|
|
171976
172026
|
{
|
|
171977
172027
|
evidenceId: "cambria-math",
|
|
172028
|
+
generic: "serif",
|
|
171978
172029
|
logicalFamily: "Cambria Math",
|
|
171979
172030
|
physicalFamily: null,
|
|
171980
172031
|
verdict: "preserve_only",
|
|
@@ -171996,6 +172047,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
171996
172047
|
},
|
|
171997
172048
|
{
|
|
171998
172049
|
evidenceId: "helvetica",
|
|
172050
|
+
generic: "sans-serif",
|
|
171999
172051
|
logicalFamily: "Helvetica",
|
|
172000
172052
|
physicalFamily: "Liberation Sans",
|
|
172001
172053
|
verdict: "metric_safe",
|
|
@@ -172022,6 +172074,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
172022
172074
|
},
|
|
172023
172075
|
{
|
|
172024
172076
|
evidenceId: "calibri-light",
|
|
172077
|
+
generic: "sans-serif",
|
|
172025
172078
|
logicalFamily: "Calibri Light",
|
|
172026
172079
|
physicalFamily: "Carlito",
|
|
172027
172080
|
verdict: "visual_only",
|
|
@@ -172048,6 +172101,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
172048
172101
|
},
|
|
172049
172102
|
{
|
|
172050
172103
|
evidenceId: "baskerville-old-face",
|
|
172104
|
+
generic: "serif",
|
|
172051
172105
|
logicalFamily: "Baskerville Old Face",
|
|
172052
172106
|
physicalFamily: "Bacasime Antique",
|
|
172053
172107
|
verdict: "visual_only",
|
|
@@ -172078,6 +172132,34 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
172078
172132
|
advanceDelta: 0.4916,
|
|
172079
172133
|
note: "Bacasime Antique Regular's no-break space (U+00A0) advance diverges ~49% from Baskerville Old Face; lines containing NBSP reflow. Every other Latin-core glyph is advance-identical, which is why this is visual_only with a single named exception, not near_metric."
|
|
172080
172134
|
}]
|
|
172135
|
+
},
|
|
172136
|
+
{
|
|
172137
|
+
evidenceId: "cooper-black",
|
|
172138
|
+
generic: "serif",
|
|
172139
|
+
logicalFamily: "Cooper Black",
|
|
172140
|
+
physicalFamily: "Caprasimo",
|
|
172141
|
+
verdict: "metric_safe",
|
|
172142
|
+
faces: {
|
|
172143
|
+
regular: true,
|
|
172144
|
+
bold: false,
|
|
172145
|
+
italic: false,
|
|
172146
|
+
boldItalic: false
|
|
172147
|
+
},
|
|
172148
|
+
gates: {
|
|
172149
|
+
static: "pass",
|
|
172150
|
+
metric: "pass",
|
|
172151
|
+
layout: "not_run",
|
|
172152
|
+
ship: "not_run"
|
|
172153
|
+
},
|
|
172154
|
+
policyAction: "substitute",
|
|
172155
|
+
measurementRefs: ["cooper-black_regular__caprasimo#regular#w400#786ab84e#analytic_advance#2026-06-05"],
|
|
172156
|
+
exportRule: "preserve_original_name",
|
|
172157
|
+
advance: {
|
|
172158
|
+
meanDelta: 0,
|
|
172159
|
+
maxDelta: 0
|
|
172160
|
+
},
|
|
172161
|
+
candidateLicense: "OFL-1.1",
|
|
172162
|
+
faceVerdicts: { regular: "metric_safe" }
|
|
172081
172163
|
}
|
|
172082
172164
|
];
|
|
172083
172165
|
LINE_BREAK_SAFE_VERDICTS = new Set([
|
|
@@ -172106,22 +172188,8 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
172106
172188
|
RENDER_ALL = { canRenderFamily: () => true };
|
|
172107
172189
|
OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
|
|
172108
172190
|
registriesByFontSet = /* @__PURE__ */ new WeakMap;
|
|
172109
|
-
PHYSICAL_GENERIC = Object.freeze({
|
|
172110
|
-
Carlito: "sans-serif",
|
|
172111
|
-
Caladea: "serif",
|
|
172112
|
-
"Liberation Sans": "sans-serif",
|
|
172113
|
-
"Liberation Serif": "serif",
|
|
172114
|
-
"Liberation Mono": "monospace"
|
|
172115
|
-
});
|
|
172116
172191
|
BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
172117
172192
|
FONT_OFFERINGS = deriveOfferings();
|
|
172118
|
-
DEFAULT_FONT_ORDER = [
|
|
172119
|
-
"Calibri",
|
|
172120
|
-
"Arial",
|
|
172121
|
-
"Courier New",
|
|
172122
|
-
"Times New Roman",
|
|
172123
|
-
"Helvetica"
|
|
172124
|
-
];
|
|
172125
172193
|
ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
|
|
172126
172194
|
REL_ID_NUMERIC_PATTERN = /rId|mi/g;
|
|
172127
172195
|
FOOTNOTES_CONFIG$1 = {
|
|
@@ -173908,7 +173976,7 @@ var init_SuperConverter_CfRQprW6_es = __esm(() => {
|
|
|
173908
173976
|
};
|
|
173909
173977
|
});
|
|
173910
173978
|
|
|
173911
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
173979
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-B3wNa0zb.es.js
|
|
173912
173980
|
function parseSizeUnit(val = "0") {
|
|
173913
173981
|
const length3 = val.toString() || "0";
|
|
173914
173982
|
const value = Number.parseFloat(length3);
|
|
@@ -184266,8 +184334,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
184266
184334
|
}
|
|
184267
184335
|
};
|
|
184268
184336
|
};
|
|
184269
|
-
var
|
|
184270
|
-
|
|
184337
|
+
var init_create_headless_toolbar_B3wNa0zb_es = __esm(() => {
|
|
184338
|
+
init_SuperConverter_BaKhr4cp_es();
|
|
184271
184339
|
init_uuid_B2wVPhPi_es();
|
|
184272
184340
|
init_constants_D9qj59G2_es();
|
|
184273
184341
|
init_dist_B8HfvhaK_es();
|
|
@@ -219787,7 +219855,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
219787
219855
|
var createVNodeWithArgsTransform = (...args2) => {
|
|
219788
219856
|
return _createVNode(...vnodeArgsTransformer ? vnodeArgsTransformer(args2, currentRenderingInstance) : args2);
|
|
219789
219857
|
};
|
|
219790
|
-
var
|
|
219858
|
+
var normalizeKey2 = ({ key: key2 }) => key2 != null ? key2 : null;
|
|
219791
219859
|
var normalizeRef = ({
|
|
219792
219860
|
ref: ref3,
|
|
219793
219861
|
ref_key,
|
|
@@ -219804,7 +219872,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
219804
219872
|
__v_skip: true,
|
|
219805
219873
|
type,
|
|
219806
219874
|
props,
|
|
219807
|
-
key: props &&
|
|
219875
|
+
key: props && normalizeKey2(props),
|
|
219808
219876
|
ref: props && normalizeRef(props),
|
|
219809
219877
|
scopeId: currentScopeId,
|
|
219810
219878
|
slotScopeIds: null,
|
|
@@ -219904,7 +219972,7 @@ Component that was made reactive: `, type);
|
|
|
219904
219972
|
__v_skip: true,
|
|
219905
219973
|
type: vnode.type,
|
|
219906
219974
|
props: mergedProps,
|
|
219907
|
-
key: mergedProps &&
|
|
219975
|
+
key: mergedProps && normalizeKey2(mergedProps),
|
|
219908
219976
|
ref: extraProps && extraProps.ref ? mergeRef && ref3 ? shared.isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref3,
|
|
219909
219977
|
scopeId: vnode.scopeId,
|
|
219910
219978
|
slotScopeIds: vnode.slotScopeIds,
|
|
@@ -233430,7 +233498,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
233430
233498
|
init_remark_gfm_BhnWr3yf_es();
|
|
233431
233499
|
});
|
|
233432
233500
|
|
|
233433
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
233501
|
+
// ../../packages/superdoc/dist/chunks/src-Btvk6jT1.es.js
|
|
233434
233502
|
function deleteProps(obj, propOrProps) {
|
|
233435
233503
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
233436
233504
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -245788,6 +245856,36 @@ function scrollToElement(targetElement, options = {
|
|
|
245788
245856
|
behavior: options.behavior
|
|
245789
245857
|
});
|
|
245790
245858
|
}
|
|
245859
|
+
function normalizeToolbarFamily(value) {
|
|
245860
|
+
return String(value ?? "").trim().toLowerCase();
|
|
245861
|
+
}
|
|
245862
|
+
function compareToolbarFontOptions(a2, b$1) {
|
|
245863
|
+
return String(a2.label ?? "").trim().localeCompare(String(b$1.label ?? "").trim(), "en", { sensitivity: "base" });
|
|
245864
|
+
}
|
|
245865
|
+
function composeToolbarFontOptions(documentOptions, configFonts) {
|
|
245866
|
+
if (configFonts)
|
|
245867
|
+
return configFonts;
|
|
245868
|
+
if (!documentOptions?.length)
|
|
245869
|
+
return;
|
|
245870
|
+
const seen = new Set(TOOLBAR_FONTS.map((option) => normalizeToolbarFamily(option.label)));
|
|
245871
|
+
const merged = [...TOOLBAR_FONTS];
|
|
245872
|
+
for (const option of documentOptions) {
|
|
245873
|
+
const dedupeKey = normalizeToolbarFamily(option.logicalFamily);
|
|
245874
|
+
if (seen.has(dedupeKey))
|
|
245875
|
+
continue;
|
|
245876
|
+
seen.add(dedupeKey);
|
|
245877
|
+
merged.push({
|
|
245878
|
+
label: option.logicalFamily,
|
|
245879
|
+
key: option.logicalFamily,
|
|
245880
|
+
fontWeight: 400,
|
|
245881
|
+
props: {
|
|
245882
|
+
style: { fontFamily: option.previewFamily || option.logicalFamily },
|
|
245883
|
+
"data-item": "btn-fontFamily-option"
|
|
245884
|
+
}
|
|
245885
|
+
});
|
|
245886
|
+
}
|
|
245887
|
+
return merged.length > TOOLBAR_FONTS.length ? merged.sort(compareToolbarFontOptions) : undefined;
|
|
245888
|
+
}
|
|
245791
245889
|
function isExtensionRulesEnabled(extension3, enabled) {
|
|
245792
245890
|
if (Array.isArray(enabled))
|
|
245793
245891
|
return enabled.some((enabledExtension) => {
|
|
@@ -278547,7 +278645,10 @@ function calculateBalancedColumnHeight(ctx$1, config2 = DEFAULT_BALANCING_CONFIG
|
|
|
278547
278645
|
iterations: 0
|
|
278548
278646
|
};
|
|
278549
278647
|
const totalHeight = ctx$1.contentBlocks.reduce((sum, b$1) => sum + b$1.measuredHeight, 0);
|
|
278550
|
-
const maxBlockHeight = ctx$1.contentBlocks.reduce((m$1, b$1) =>
|
|
278648
|
+
const maxBlockHeight = ctx$1.contentBlocks.reduce((m$1, b$1) => {
|
|
278649
|
+
const indivisible = b$1.canBreak && b$1.lineHeights && b$1.lineHeights.length > 1 ? Math.max(...b$1.lineHeights) : b$1.measuredHeight;
|
|
278650
|
+
return Math.max(m$1, indivisible);
|
|
278651
|
+
}, 0);
|
|
278551
278652
|
if (totalHeight < config2.minColumnHeight * ctx$1.columnCount)
|
|
278552
278653
|
return createSingleColumnResult(ctx$1);
|
|
278553
278654
|
let lo = Math.max(maxBlockHeight, config2.minColumnHeight);
|
|
@@ -278717,6 +278818,8 @@ function shouldSkipBalancing(ctx$1, config2 = DEFAULT_BALANCING_CONFIG) {
|
|
|
278717
278818
|
}
|
|
278718
278819
|
function getFragmentHeight(fragment2, measureMap) {
|
|
278719
278820
|
if (fragment2.kind === "para") {
|
|
278821
|
+
if (fragment2.lines && fragment2.lines.length > 0)
|
|
278822
|
+
return fragment2.lines.reduce((sum$1, l) => sum$1 + (l.lineHeight ?? 0), 0);
|
|
278720
278823
|
const measure = measureMap.get(fragment2.blockId);
|
|
278721
278824
|
if (!measure || measure.kind !== "paragraph" || !measure.lines)
|
|
278722
278825
|
return 0;
|
|
@@ -278797,13 +278900,38 @@ function balanceSectionOnPage(args$1) {
|
|
|
278797
278900
|
return a2.x - b$1.x;
|
|
278798
278901
|
return a2.y - b$1.y;
|
|
278799
278902
|
});
|
|
278800
|
-
const
|
|
278801
|
-
|
|
278802
|
-
|
|
278803
|
-
|
|
278804
|
-
|
|
278805
|
-
|
|
278806
|
-
|
|
278903
|
+
const lineHeightsFor = (f2) => {
|
|
278904
|
+
if (f2.kind !== "para")
|
|
278905
|
+
return;
|
|
278906
|
+
if (args$1.sectPrMarkerBlockIds?.has(f2.blockId))
|
|
278907
|
+
return;
|
|
278908
|
+
if (args$1.keepLinesBlockIds?.has(f2.blockId))
|
|
278909
|
+
return;
|
|
278910
|
+
if (f2.lines && f2.lines.length > 0) {
|
|
278911
|
+
if (f2.lines.length <= 1)
|
|
278912
|
+
return;
|
|
278913
|
+
return f2.lines.map((l) => l.lineHeight);
|
|
278914
|
+
}
|
|
278915
|
+
const measure = args$1.measureMap.get(f2.blockId);
|
|
278916
|
+
if (!measure || measure.kind !== "paragraph" || !Array.isArray(measure.lines))
|
|
278917
|
+
return;
|
|
278918
|
+
const fromLine = f2.fromLine ?? 0;
|
|
278919
|
+
const toLine = f2.toLine ?? measure.lines.length;
|
|
278920
|
+
if (toLine - fromLine <= 1)
|
|
278921
|
+
return;
|
|
278922
|
+
return measure.lines.slice(fromLine, toLine).map((l) => l.lineHeight);
|
|
278923
|
+
};
|
|
278924
|
+
const contentBlocks = ordered.map((f2, i4) => {
|
|
278925
|
+
const lineHeights = lineHeightsFor(f2);
|
|
278926
|
+
return {
|
|
278927
|
+
blockId: `${f2.blockId}#${i4}`,
|
|
278928
|
+
measuredHeight: getBalancingHeight(f2, args$1.measureMap, args$1.sectPrMarkerBlockIds),
|
|
278929
|
+
canBreak: lineHeights !== undefined,
|
|
278930
|
+
keepWithNext: false,
|
|
278931
|
+
keepTogether: lineHeights === undefined,
|
|
278932
|
+
lineHeights
|
|
278933
|
+
};
|
|
278934
|
+
});
|
|
278807
278935
|
if (shouldSkipBalancing({
|
|
278808
278936
|
columnCount,
|
|
278809
278937
|
columnWidth,
|
|
@@ -278838,6 +278966,39 @@ function balanceSectionOnPage(args$1) {
|
|
|
278838
278966
|
f2.x = columnX(col);
|
|
278839
278967
|
f2.y = colCursors[col];
|
|
278840
278968
|
f2.width = columnWidth;
|
|
278969
|
+
const bp = result.blockBreakPoints?.get(block.blockId);
|
|
278970
|
+
if (bp && bp.heightAfterBreak > 0 && col < columnCount - 1) {
|
|
278971
|
+
const splitLine = (f2.fromLine ?? 0) + bp.breakAfterLine + 1;
|
|
278972
|
+
const measureLineCount = args$1.measureMap.get(f2.blockId)?.lines?.length ?? splitLine;
|
|
278973
|
+
const originalToLine = f2.toLine ?? measureLineCount;
|
|
278974
|
+
const originalContinuesOnNext = f2.continuesOnNext ?? false;
|
|
278975
|
+
const secondHalf = {
|
|
278976
|
+
...f2,
|
|
278977
|
+
fromLine: splitLine,
|
|
278978
|
+
toLine: originalToLine,
|
|
278979
|
+
x: columnX(col + 1),
|
|
278980
|
+
y: colCursors[col + 1],
|
|
278981
|
+
width: columnWidth,
|
|
278982
|
+
continuesFromPrev: true,
|
|
278983
|
+
continuesOnNext: originalContinuesOnNext
|
|
278984
|
+
};
|
|
278985
|
+
if (f2.lines && f2.lines.length > 0) {
|
|
278986
|
+
secondHalf.lines = f2.lines.slice(bp.breakAfterLine + 1);
|
|
278987
|
+
f2.lines = f2.lines.slice(0, bp.breakAfterLine + 1);
|
|
278988
|
+
}
|
|
278989
|
+
f2.toLine = splitLine;
|
|
278990
|
+
f2.continuesOnNext = true;
|
|
278991
|
+
colCursors[col] += bp.heightBeforeBreak;
|
|
278992
|
+
colCursors[col + 1] += bp.heightAfterBreak;
|
|
278993
|
+
const fragIdx = fragments.indexOf(f2);
|
|
278994
|
+
if (fragIdx >= 0)
|
|
278995
|
+
fragments.splice(fragIdx + 1, 0, secondHalf);
|
|
278996
|
+
if (colCursors[col] > maxY)
|
|
278997
|
+
maxY = colCursors[col];
|
|
278998
|
+
if (colCursors[col + 1] > maxY)
|
|
278999
|
+
maxY = colCursors[col + 1];
|
|
279000
|
+
continue;
|
|
279001
|
+
}
|
|
278841
279002
|
colCursors[col] += block.measuredHeight;
|
|
278842
279003
|
if (colCursors[col] > maxY)
|
|
278843
279004
|
maxY = colCursors[col];
|
|
@@ -279989,6 +280150,7 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
279989
280150
|
const sectionTypeIsExplicit = /* @__PURE__ */ new Map;
|
|
279990
280151
|
let lastSectionIdx = null;
|
|
279991
280152
|
const sectPrMarkerBlockIds = /* @__PURE__ */ new Set;
|
|
280153
|
+
const keepLinesBlockIds = /* @__PURE__ */ new Set;
|
|
279992
280154
|
let documentHasExplicitColumnBreak = false;
|
|
279993
280155
|
let documentHasAnySectionBreak = false;
|
|
279994
280156
|
const alreadyBalancedSections = /* @__PURE__ */ new Set;
|
|
@@ -280022,6 +280184,8 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
280022
280184
|
documentHasExplicitColumnBreak = true;
|
|
280023
280185
|
if (block.kind === "paragraph" && blockWithAttrs.attrs?.sectPrMarker === true)
|
|
280024
280186
|
sectPrMarkerBlockIds.add(block.id);
|
|
280187
|
+
if (block.kind === "paragraph" && blockWithAttrs.attrs?.keepLines === true)
|
|
280188
|
+
keepLinesBlockIds.add(block.id);
|
|
280025
280189
|
});
|
|
280026
280190
|
const anchoredByParagraph = collectAnchoredDrawings(blocks2, measures);
|
|
280027
280191
|
const anchoredTables = collectAnchoredTables(blocks2, measures);
|
|
@@ -280240,7 +280404,8 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
280240
280404
|
columnWidth: normalized.width,
|
|
280241
280405
|
availableHeight,
|
|
280242
280406
|
measureMap: balancingMeasureMap,
|
|
280243
|
-
sectPrMarkerBlockIds
|
|
280407
|
+
sectPrMarkerBlockIds,
|
|
280408
|
+
keepLinesBlockIds
|
|
280244
280409
|
});
|
|
280245
280410
|
if (balanceResult) {
|
|
280246
280411
|
state.cursorY = balanceResult.maxY;
|
|
@@ -280639,7 +280804,9 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
280639
280804
|
const isMultiPage = sectionPagesCount > 1;
|
|
280640
280805
|
if (isMultiPage && !isLast)
|
|
280641
280806
|
continue;
|
|
280642
|
-
const
|
|
280807
|
+
const nextSectionBeginType = sectionEndBreakType.get(sectionIdx + 1);
|
|
280808
|
+
const nextIsBody = lastSectionIdx !== null && sectionIdx + 1 === lastSectionIdx;
|
|
280809
|
+
const allowedByMidDocContinuous = !isLast && !nextIsBody && nextSectionBeginType === "continuous";
|
|
280643
280810
|
const allowedByBodyExplicitContinuous = bodyExplicitContinuousIdx !== null && sectionIdx === bodyExplicitContinuousIdx - 1 && !isExplicitNonContinuous;
|
|
280644
280811
|
if (!allowedByMidDocContinuous && !allowedByBodyExplicitContinuous && !isMultiPage)
|
|
280645
280812
|
continue;
|
|
@@ -280670,7 +280837,8 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
280670
280837
|
columnWidth: normalized.width,
|
|
280671
280838
|
availableHeight: sectionAvailableHeight,
|
|
280672
280839
|
measureMap: balancingMeasureMap,
|
|
280673
|
-
sectPrMarkerBlockIds
|
|
280840
|
+
sectPrMarkerBlockIds,
|
|
280841
|
+
keepLinesBlockIds
|
|
280674
280842
|
});
|
|
280675
280843
|
}
|
|
280676
280844
|
for (const state of states) {
|
|
@@ -330322,6 +330490,17 @@ menclose::after {
|
|
|
330322
330490
|
const declaredRows = buildFontReport(declared.filter((family2) => family2 && !usedFamilies.has(family2.toLowerCase())), registry2, resolver2);
|
|
330323
330491
|
return [...faceRows, ...declaredRows];
|
|
330324
330492
|
}
|
|
330493
|
+
getDocumentFontOptions() {
|
|
330494
|
+
try {
|
|
330495
|
+
const usedFaces = this.#getUsedFaces?.() ?? [];
|
|
330496
|
+
if (!usedFaces.length)
|
|
330497
|
+
return [];
|
|
330498
|
+
const { registry: registry2 } = this.#resolveContext();
|
|
330499
|
+
return buildDocumentFontOptions(usedFaces, registry2, this.#fontResolver ?? undefined);
|
|
330500
|
+
} catch {
|
|
330501
|
+
return [];
|
|
330502
|
+
}
|
|
330503
|
+
}
|
|
330325
330504
|
async ensureReadyForMeasure() {
|
|
330326
330505
|
if (this.#getRequiredFaces)
|
|
330327
330506
|
return this.#ensureFacesReady(this.#getRequiredFaces);
|
|
@@ -330761,13 +330940,13 @@ menclose::after {
|
|
|
330761
330940
|
return;
|
|
330762
330941
|
console.log(...args$1);
|
|
330763
330942
|
}, 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;
|
|
330764
|
-
var
|
|
330943
|
+
var init_src_Btvk6jT1_es = __esm(() => {
|
|
330765
330944
|
init_rolldown_runtime_Bg48TavK_es();
|
|
330766
|
-
|
|
330945
|
+
init_SuperConverter_BaKhr4cp_es();
|
|
330767
330946
|
init_jszip_C49i9kUs_es();
|
|
330768
330947
|
init_xml_js_CqGKpaft_es();
|
|
330769
330948
|
init_uuid_B2wVPhPi_es();
|
|
330770
|
-
|
|
330949
|
+
init_create_headless_toolbar_B3wNa0zb_es();
|
|
330771
330950
|
init_constants_D9qj59G2_es();
|
|
330772
330951
|
init_dist_B8HfvhaK_es();
|
|
330773
330952
|
init_unified_Dsuw2be5_es();
|
|
@@ -352987,16 +353166,21 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
352987
353166
|
toolbarKey.value += 1;
|
|
352988
353167
|
};
|
|
352989
353168
|
const onResizeThrottled = throttle(onWindowResized, 300);
|
|
352990
|
-
|
|
353169
|
+
const onToolbarItemsChanged = () => {
|
|
353170
|
+
toolbarKey.value += 1;
|
|
353171
|
+
};
|
|
353172
|
+
function teardownListeners() {
|
|
352991
353173
|
window.removeEventListener("resize", onResizeThrottled);
|
|
352992
353174
|
window.removeEventListener("keydown", onKeyDown);
|
|
353175
|
+
proxy.$toolbar.off?.("toolbar-items-changed", onToolbarItemsChanged);
|
|
352993
353176
|
containerResizeObserver?.disconnect();
|
|
352994
353177
|
containerResizeObserver = null;
|
|
352995
353178
|
}
|
|
352996
|
-
function
|
|
352997
|
-
|
|
353179
|
+
function setupListeners() {
|
|
353180
|
+
teardownListeners();
|
|
352998
353181
|
window.addEventListener("resize", onResizeThrottled);
|
|
352999
353182
|
window.addEventListener("keydown", onKeyDown);
|
|
353183
|
+
proxy.$toolbar.on?.("toolbar-items-changed", onToolbarItemsChanged);
|
|
353000
353184
|
if (typeof ResizeObserver !== "undefined" && proxy.$toolbar.config?.responsiveToContainer && proxy.$toolbar.toolbarContainer) {
|
|
353001
353185
|
containerResizeObserver = new ResizeObserver(() => {
|
|
353002
353186
|
onResizeThrottled();
|
|
@@ -353005,10 +353189,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353005
353189
|
}
|
|
353006
353190
|
updateCompactSideGroups();
|
|
353007
353191
|
}
|
|
353008
|
-
exports_vue.onMounted(
|
|
353009
|
-
exports_vue.onActivated(
|
|
353010
|
-
exports_vue.onDeactivated(
|
|
353011
|
-
exports_vue.onBeforeUnmount(
|
|
353192
|
+
exports_vue.onMounted(setupListeners);
|
|
353193
|
+
exports_vue.onActivated(setupListeners);
|
|
353194
|
+
exports_vue.onDeactivated(teardownListeners);
|
|
353195
|
+
exports_vue.onBeforeUnmount(teardownListeners);
|
|
353012
353196
|
const handleCommand = ({ item, argument, option }) => {
|
|
353013
353197
|
proxy.$toolbar.emitCommand({
|
|
353014
353198
|
item,
|
|
@@ -353087,7 +353271,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353087
353271
|
], 32);
|
|
353088
353272
|
};
|
|
353089
353273
|
}
|
|
353090
|
-
}, [["__scopeId", "data-v-
|
|
353274
|
+
}, [["__scopeId", "data-v-938eaa1b"]]);
|
|
353091
353275
|
toolbarTexts = {
|
|
353092
353276
|
bold: "Bold",
|
|
353093
353277
|
fontFamily: "Font",
|
|
@@ -353218,8 +353402,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353218
353402
|
this._boundEditorHandlers = {
|
|
353219
353403
|
transaction: null,
|
|
353220
353404
|
selectionUpdate: null,
|
|
353221
|
-
focus: null
|
|
353405
|
+
focus: null,
|
|
353406
|
+
fontsChanged: null
|
|
353222
353407
|
};
|
|
353408
|
+
this._lastFontOptionsSignature = "";
|
|
353223
353409
|
this._restoreFocusTimeoutId = null;
|
|
353224
353410
|
if (!this.config.selector && this.config.element)
|
|
353225
353411
|
this.config.selector = this.config.element;
|
|
@@ -353278,24 +353464,40 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353278
353464
|
if (this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length)
|
|
353279
353465
|
this.config.toolbarGroups = Object.keys(this.config.groups);
|
|
353280
353466
|
}
|
|
353467
|
+
#detachActiveEditorListeners() {
|
|
353468
|
+
if (!this.activeEditor || !this._boundEditorHandlers.transaction)
|
|
353469
|
+
return;
|
|
353470
|
+
this.activeEditor.off("transaction", this._boundEditorHandlers.transaction);
|
|
353471
|
+
this.activeEditor.off("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
|
|
353472
|
+
this.activeEditor.off("focus", this._boundEditorHandlers.focus);
|
|
353473
|
+
this.activeEditor.off("fonts-changed", this._boundEditorHandlers.fontsChanged);
|
|
353474
|
+
this._boundEditorHandlers.transaction = null;
|
|
353475
|
+
this._boundEditorHandlers.selectionUpdate = null;
|
|
353476
|
+
this._boundEditorHandlers.focus = null;
|
|
353477
|
+
this._boundEditorHandlers.fontsChanged = null;
|
|
353478
|
+
}
|
|
353281
353479
|
setActiveEditor(editor) {
|
|
353282
|
-
|
|
353283
|
-
|
|
353284
|
-
|
|
353285
|
-
this.
|
|
353286
|
-
|
|
353287
|
-
this._boundEditorHandlers.selectionUpdate = null;
|
|
353288
|
-
this._boundEditorHandlers.focus = null;
|
|
353480
|
+
const sameEditor = editor === this.activeEditor;
|
|
353481
|
+
const alreadyListening = Boolean(this._boundEditorHandlers.transaction);
|
|
353482
|
+
if (sameEditor && (!editor || alreadyListening)) {
|
|
353483
|
+
this.updateToolbarState();
|
|
353484
|
+
return;
|
|
353289
353485
|
}
|
|
353486
|
+
this.#detachActiveEditorListeners();
|
|
353290
353487
|
this.activeEditor = editor;
|
|
353291
353488
|
if (editor) {
|
|
353292
353489
|
this._boundEditorHandlers.transaction = this.onEditorTransaction.bind(this);
|
|
353293
353490
|
this._boundEditorHandlers.selectionUpdate = this.onEditorSelectionUpdate.bind(this);
|
|
353294
353491
|
this._boundEditorHandlers.focus = this.onEditorFocus.bind(this);
|
|
353492
|
+
this._boundEditorHandlers.fontsChanged = this.onEditorFontsChanged.bind(this);
|
|
353295
353493
|
this.activeEditor.on("transaction", this._boundEditorHandlers.transaction);
|
|
353296
353494
|
this.activeEditor.on("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
|
|
353297
353495
|
this.activeEditor.on("focus", this._boundEditorHandlers.focus);
|
|
353496
|
+
this.activeEditor.on("fonts-changed", this._boundEditorHandlers.fontsChanged);
|
|
353298
353497
|
}
|
|
353498
|
+
this.#rebuildToolbarItems();
|
|
353499
|
+
this._lastFontOptionsSignature = this.#fontOptionsSignature();
|
|
353500
|
+
this.updateToolbarState();
|
|
353299
353501
|
}
|
|
353300
353502
|
getToolbarItemByGroup(groupName) {
|
|
353301
353503
|
return this.toolbarItems.filter((item) => (item.group?.value || "center") === groupName);
|
|
@@ -353312,13 +353514,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353312
353514
|
return this.config.responsiveToContainer ? containerWidth : documentWidth;
|
|
353313
353515
|
}
|
|
353314
353516
|
#makeToolbarItems({ superToolbar, icons: icons$1, texts, fonts, hideButtons, isDev = false } = {}) {
|
|
353517
|
+
const availableWidth = this.getAvailableWidth();
|
|
353315
353518
|
const { defaultItems, overflowItems } = makeDefaultItems({
|
|
353316
353519
|
superToolbar,
|
|
353317
353520
|
toolbarIcons: icons$1,
|
|
353318
353521
|
toolbarTexts: texts,
|
|
353319
|
-
toolbarFonts: fonts,
|
|
353522
|
+
toolbarFonts: this.#resolveToolbarFonts(fonts),
|
|
353320
353523
|
hideButtons,
|
|
353321
|
-
availableWidth
|
|
353524
|
+
availableWidth,
|
|
353322
353525
|
role: this.role,
|
|
353323
353526
|
isDev
|
|
353324
353527
|
});
|
|
@@ -353331,6 +353534,26 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353331
353534
|
this.toolbarItems = defaultItems.filter((item) => allConfigItems.includes(item.name.value)).filter((item) => !this.config.excludeItems.includes(item.name.value));
|
|
353332
353535
|
this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
|
|
353333
353536
|
}
|
|
353537
|
+
#resolveToolbarFonts(configFonts) {
|
|
353538
|
+
return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts);
|
|
353539
|
+
}
|
|
353540
|
+
#rebuildToolbarItems() {
|
|
353541
|
+
this.#makeToolbarItems({
|
|
353542
|
+
superToolbar: this,
|
|
353543
|
+
icons: this.config.icons,
|
|
353544
|
+
texts: this.config.texts,
|
|
353545
|
+
fonts: this.config.fonts,
|
|
353546
|
+
hideButtons: this.config.hideButtons,
|
|
353547
|
+
isDev: this.isDev
|
|
353548
|
+
});
|
|
353549
|
+
this.emit("toolbar-items-changed");
|
|
353550
|
+
}
|
|
353551
|
+
#fontOptionsSignature() {
|
|
353552
|
+
if (this.config.fonts)
|
|
353553
|
+
return "custom-fonts";
|
|
353554
|
+
const options = this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [];
|
|
353555
|
+
return JSON.stringify(options.map((option) => [option.logicalFamily, option.previewFamily]));
|
|
353556
|
+
}
|
|
353334
353557
|
#initDefaultFonts() {
|
|
353335
353558
|
if (!this.activeEditor || !this.activeEditor.converter)
|
|
353336
353559
|
return;
|
|
@@ -353702,6 +353925,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353702
353925
|
if (this.#restoreStickyMarksIfNeeded())
|
|
353703
353926
|
this.updateToolbarState();
|
|
353704
353927
|
}
|
|
353928
|
+
onEditorFontsChanged() {
|
|
353929
|
+
const signature = this.#fontOptionsSignature();
|
|
353930
|
+
if (signature !== this._lastFontOptionsSignature) {
|
|
353931
|
+
this._lastFontOptionsSignature = signature;
|
|
353932
|
+
this.#rebuildToolbarItems();
|
|
353933
|
+
}
|
|
353934
|
+
this.updateToolbarState();
|
|
353935
|
+
}
|
|
353705
353936
|
onEditorFocus() {
|
|
353706
353937
|
if (this.pendingMarkCommands.length) {
|
|
353707
353938
|
this.onEditorSelectionUpdate();
|
|
@@ -353768,6 +353999,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353768
353999
|
clearTimeout(this._restoreFocusTimeoutId);
|
|
353769
354000
|
this._restoreFocusTimeoutId = null;
|
|
353770
354001
|
}
|
|
354002
|
+
this.#detachActiveEditorListeners();
|
|
353771
354003
|
this.destroyHeadlessToolbar();
|
|
353772
354004
|
this.app?.unmount();
|
|
353773
354005
|
}
|
|
@@ -360388,6 +360620,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
360388
360620
|
getFontReport() {
|
|
360389
360621
|
return this.#fontGate?.getReport() ?? [];
|
|
360390
360622
|
}
|
|
360623
|
+
getDocumentFontOptions() {
|
|
360624
|
+
return this.#fontGate?.getDocumentFontOptions() ?? [];
|
|
360625
|
+
}
|
|
360391
360626
|
getMissingFonts() {
|
|
360392
360627
|
return [...new Set(this.getFontReport().filter((record) => record.missing).map((record) => record.logicalFamily))];
|
|
360393
360628
|
}
|
|
@@ -365672,11 +365907,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
365672
365907
|
]);
|
|
365673
365908
|
});
|
|
365674
365909
|
|
|
365675
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
365910
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-ClaBD_rO.es.js
|
|
365676
365911
|
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;
|
|
365677
|
-
var
|
|
365678
|
-
|
|
365679
|
-
|
|
365912
|
+
var init_create_super_doc_ui_ClaBD_rO_es = __esm(() => {
|
|
365913
|
+
init_SuperConverter_BaKhr4cp_es();
|
|
365914
|
+
init_create_headless_toolbar_B3wNa0zb_es();
|
|
365680
365915
|
headlessToolbarConstants = {
|
|
365681
365916
|
DEFAULT_TEXT_ALIGN_OPTIONS: [
|
|
365682
365917
|
{
|
|
@@ -365958,16 +366193,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
365958
366193
|
|
|
365959
366194
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
365960
366195
|
var init_super_editor_es = __esm(() => {
|
|
365961
|
-
|
|
365962
|
-
|
|
366196
|
+
init_src_Btvk6jT1_es();
|
|
366197
|
+
init_SuperConverter_BaKhr4cp_es();
|
|
365963
366198
|
init_jszip_C49i9kUs_es();
|
|
365964
366199
|
init_xml_js_CqGKpaft_es();
|
|
365965
|
-
|
|
366200
|
+
init_create_headless_toolbar_B3wNa0zb_es();
|
|
365966
366201
|
init_constants_D9qj59G2_es();
|
|
365967
366202
|
init_dist_B8HfvhaK_es();
|
|
365968
366203
|
init_unified_Dsuw2be5_es();
|
|
365969
366204
|
init_DocxZipper_FUsfThjV_es();
|
|
365970
|
-
|
|
366205
|
+
init_create_super_doc_ui_ClaBD_rO_es();
|
|
365971
366206
|
init_ui_C5PAS9hY_es();
|
|
365972
366207
|
init_eventemitter3_BnGqBE_Q_es();
|
|
365973
366208
|
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.5",
|
|
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
|
-
"superdoc": "
|
|
29
|
-
"
|
|
28
|
+
"@superdoc/super-editor": "0.0.1",
|
|
29
|
+
"superdoc": "1.39.0"
|
|
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-
|
|
37
|
-
"@superdoc-dev/cli-darwin-
|
|
38
|
-
"@superdoc-dev/cli-linux-x64": "0.17.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-arm64": "0.17.0-next.
|
|
40
|
-
"@superdoc-dev/cli-windows-x64": "0.17.0-next.
|
|
36
|
+
"@superdoc-dev/cli-darwin-arm64": "0.17.0-next.5",
|
|
37
|
+
"@superdoc-dev/cli-darwin-x64": "0.17.0-next.5",
|
|
38
|
+
"@superdoc-dev/cli-linux-x64": "0.17.0-next.5",
|
|
39
|
+
"@superdoc-dev/cli-linux-arm64": "0.17.0-next.5",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.17.0-next.5"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"predev": "node scripts/ensure-superdoc-build.js",
|