@superdoc-dev/cli 0.8.0-next.38 → 0.8.0-next.39
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 +71 -49
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -207213,7 +207213,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
207213
207213
|
init_remark_gfm_BhnWr3yf_es();
|
|
207214
207214
|
});
|
|
207215
207215
|
|
|
207216
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
207216
|
+
// ../../packages/superdoc/dist/chunks/src-BA9o3DfT.es.js
|
|
207217
207217
|
function deleteProps(obj, propOrProps) {
|
|
207218
207218
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
207219
207219
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -207275,21 +207275,35 @@ function computeTabStops$1(context) {
|
|
|
207275
207275
|
const hanging = paragraphIndent.hanging ?? 0;
|
|
207276
207276
|
const effectiveMinIndent = Math.max(0, leftIndent - hanging);
|
|
207277
207277
|
const clearPositions = explicitStops.filter((stop) => stop.val === "clear").map((stop) => stop.pos);
|
|
207278
|
-
const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent)
|
|
207278
|
+
const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent).map((stop) => ({
|
|
207279
|
+
...stop,
|
|
207280
|
+
source: "explicit"
|
|
207281
|
+
}));
|
|
207279
207282
|
const maxExplicit = filteredExplicitStops.reduce((max$2, stop) => Math.max(max$2, stop.pos), 0);
|
|
207280
207283
|
const stops = [...filteredExplicitStops];
|
|
207281
|
-
const
|
|
207284
|
+
const hasStartAlignedExplicit = filteredExplicitStops.some((stop) => stop.val === "start");
|
|
207285
|
+
const hasExplicitStops = filteredExplicitStops.length > 0;
|
|
207286
|
+
const hasClearAtLeftIndent = clearPositions.some((clearPos) => Math.abs(clearPos - leftIndent) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207287
|
+
if (!hasExplicitStops && !hasClearAtLeftIndent && hanging > 0 && leftIndent > effectiveMinIndent)
|
|
207288
|
+
stops.push({
|
|
207289
|
+
val: "start",
|
|
207290
|
+
pos: leftIndent,
|
|
207291
|
+
leader: "none",
|
|
207292
|
+
source: "default"
|
|
207293
|
+
});
|
|
207294
|
+
const defaultStart = !hasStartAlignedExplicit ? 0 : Math.max(maxExplicit, leftIndent);
|
|
207282
207295
|
let pos = defaultStart;
|
|
207283
207296
|
const targetLimit = Math.max(defaultStart, leftIndent, maxExplicit) + 14400;
|
|
207284
207297
|
while (pos < targetLimit) {
|
|
207285
207298
|
pos += defaultTabInterval;
|
|
207286
|
-
const
|
|
207287
|
-
const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) <
|
|
207288
|
-
if (!
|
|
207299
|
+
const hasExistingStop = stops.some((s2) => Math.abs(s2.pos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207300
|
+
const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207301
|
+
if (!hasExistingStop && !hasClearStop && pos >= leftIndent)
|
|
207289
207302
|
stops.push({
|
|
207290
207303
|
val: "start",
|
|
207291
207304
|
pos,
|
|
207292
|
-
leader: "none"
|
|
207305
|
+
leader: "none",
|
|
207306
|
+
source: "default"
|
|
207293
207307
|
});
|
|
207294
207308
|
}
|
|
207295
207309
|
return stops.sort((a2, b$1) => a2.pos - b$1.pos);
|
|
@@ -207501,12 +207515,13 @@ function getFragmentZIndex(block) {
|
|
|
207501
207515
|
return resolveFloatingZIndex(block.anchor?.behindDoc === true, raw);
|
|
207502
207516
|
}
|
|
207503
207517
|
function shouldApplyJustify(params$1) {
|
|
207504
|
-
const { alignment: alignment$1, hasExplicitPositioning, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
|
|
207518
|
+
const { alignment: alignment$1, hasExplicitPositioning, hasExplicitTabStops, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
|
|
207519
|
+
const lineHasExplicitTabStops = hasExplicitTabStops ?? hasExplicitPositioning ?? false;
|
|
207505
207520
|
if (alignment$1 !== "justify" && alignment$1 !== "both")
|
|
207506
207521
|
return false;
|
|
207507
207522
|
if (skipJustifyOverride === true)
|
|
207508
207523
|
return false;
|
|
207509
|
-
if (
|
|
207524
|
+
if (lineHasExplicitTabStops)
|
|
207510
207525
|
return false;
|
|
207511
207526
|
if (isLastLineOfParagraph && !paragraphEndsWithLineBreak)
|
|
207512
207527
|
return false;
|
|
@@ -257932,7 +257947,12 @@ function sliceRunsForLine(block, line) {
|
|
|
257932
257947
|
function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
|
|
257933
257948
|
const ctx$1 = getMeasurementContext();
|
|
257934
257949
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
257935
|
-
const justify = getJustifyAdjustment(
|
|
257950
|
+
const justify = getJustifyAdjustment({
|
|
257951
|
+
block,
|
|
257952
|
+
line,
|
|
257953
|
+
availableWidthOverride: availableWidth,
|
|
257954
|
+
alignmentOverride
|
|
257955
|
+
});
|
|
257936
257956
|
const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
|
|
257937
257957
|
const renderedLineWidth = alignment$1 === "justify" && justify.extraPerSpace !== 0 ? availableWidth : line.width;
|
|
257938
257958
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
@@ -258064,7 +258084,12 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
|
|
|
258064
258084
|
function findCharacterAtX(block, line, x, pmStart, availableWidthOverride, alignmentOverride) {
|
|
258065
258085
|
const ctx$1 = getMeasurementContext();
|
|
258066
258086
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
258067
|
-
const justify = getJustifyAdjustment(
|
|
258087
|
+
const justify = getJustifyAdjustment({
|
|
258088
|
+
block,
|
|
258089
|
+
line,
|
|
258090
|
+
availableWidthOverride: availableWidth,
|
|
258091
|
+
alignmentOverride
|
|
258092
|
+
});
|
|
258068
258093
|
const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
|
|
258069
258094
|
const renderedLineWidth = alignment$1 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
258070
258095
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
@@ -267415,6 +267440,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
267415
267440
|
const clampedTarget = Math.min(target, maxAbsWidth);
|
|
267416
267441
|
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
|
|
267417
267442
|
currentLine.width = roundValue(currentLine.width + tabAdvance);
|
|
267443
|
+
if (stop?.source === "explicit")
|
|
267444
|
+
currentLine.hasExplicitTabStops = true;
|
|
267418
267445
|
run2.width = tabAdvance;
|
|
267419
267446
|
currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lastFontSize);
|
|
267420
267447
|
currentLine.toRun = runIndex;
|
|
@@ -268173,6 +268200,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
268173
268200
|
const clampedTarget = Math.min(target, maxAbsWidth);
|
|
268174
268201
|
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
|
|
268175
268202
|
currentLine.width = roundValue(currentLine.width + tabAdvance);
|
|
268203
|
+
if (stop?.source === "explicit")
|
|
268204
|
+
currentLine.hasExplicitTabStops = true;
|
|
268176
268205
|
currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
|
|
268177
268206
|
currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lineHeightFontSize(run2));
|
|
268178
268207
|
currentLine.toRun = runIndex;
|
|
@@ -269261,7 +269290,7 @@ var Node$13 = class Node$14 {
|
|
|
269261
269290
|
"iPhone",
|
|
269262
269291
|
"iPod"
|
|
269263
269292
|
].includes(navigator.platform);
|
|
269264
|
-
}, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
|
|
269293
|
+
}, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
|
|
269265
269294
|
if (!run2 || typeof run2 !== "object")
|
|
269266
269295
|
return false;
|
|
269267
269296
|
return typeof run2.src === "string";
|
|
@@ -273876,20 +273905,23 @@ var Node$13 = class Node$14 {
|
|
|
273876
273905
|
segments,
|
|
273877
273906
|
ranges: []
|
|
273878
273907
|
};
|
|
273908
|
+
const sorted = [...segments].sort((a2, b$1) => a2.from - b$1.from);
|
|
273879
273909
|
const ranges = [];
|
|
273880
|
-
let active =
|
|
273881
|
-
|
|
273882
|
-
|
|
273883
|
-
|
|
273884
|
-
|
|
273885
|
-
|
|
273886
|
-
|
|
273887
|
-
};
|
|
273888
|
-
return;
|
|
273889
|
-
}
|
|
273910
|
+
let active = {
|
|
273911
|
+
from: sorted[0].from,
|
|
273912
|
+
to: sorted[0].to,
|
|
273913
|
+
internal: !!sorted[0].attrs?.internal
|
|
273914
|
+
};
|
|
273915
|
+
for (let i4 = 1;i4 < sorted.length; i4 += 1) {
|
|
273916
|
+
const seg = sorted[i4];
|
|
273890
273917
|
if (seg.from <= active.to) {
|
|
273891
|
-
|
|
273892
|
-
|
|
273918
|
+
if (seg.to > active.to)
|
|
273919
|
+
active.to = seg.to;
|
|
273920
|
+
continue;
|
|
273921
|
+
}
|
|
273922
|
+
if (!(doc$12.textBetween(active.to, seg.from, "", "").length > 0)) {
|
|
273923
|
+
active.to = seg.to;
|
|
273924
|
+
continue;
|
|
273893
273925
|
}
|
|
273894
273926
|
ranges.push(active);
|
|
273895
273927
|
active = {
|
|
@@ -273897,9 +273929,8 @@ var Node$13 = class Node$14 {
|
|
|
273897
273929
|
to: seg.to,
|
|
273898
273930
|
internal: !!seg.attrs?.internal
|
|
273899
273931
|
};
|
|
273900
|
-
}
|
|
273901
|
-
|
|
273902
|
-
ranges.push(active);
|
|
273932
|
+
}
|
|
273933
|
+
ranges.push(active);
|
|
273903
273934
|
return {
|
|
273904
273935
|
segments,
|
|
273905
273936
|
ranges
|
|
@@ -289621,19 +289652,6 @@ menclose::after {
|
|
|
289621
289652
|
return false;
|
|
289622
289653
|
const code7 = char.charCodeAt(0);
|
|
289623
289654
|
return code7 >= 48 && code7 <= 57 || code7 >= 65 && code7 <= 90 || code7 >= 97 && code7 <= 122 || char === "'";
|
|
289624
|
-
}, lineContainsManualTabWithoutSegments = (block, line) => {
|
|
289625
|
-
if (block.kind !== "paragraph")
|
|
289626
|
-
return false;
|
|
289627
|
-
if (line.segments?.some((seg) => seg.x !== undefined))
|
|
289628
|
-
return false;
|
|
289629
|
-
const fromRun = line.fromRun ?? 0;
|
|
289630
|
-
const toRun = line.toRun ?? fromRun;
|
|
289631
|
-
for (let runIndex = fromRun;runIndex <= toRun; runIndex += 1) {
|
|
289632
|
-
const run2 = block.runs[runIndex];
|
|
289633
|
-
if (run2 && isTabRun$1(run2))
|
|
289634
|
-
return true;
|
|
289635
|
-
}
|
|
289636
|
-
return false;
|
|
289637
289655
|
}, capitalizeText$3 = (text5) => {
|
|
289638
289656
|
if (!text5)
|
|
289639
289657
|
return text5;
|
|
@@ -289660,7 +289678,7 @@ menclose::after {
|
|
|
289660
289678
|
if (SPACE_CHARS$1.has(text5[i4]))
|
|
289661
289679
|
spaces += 1;
|
|
289662
289680
|
return spaces;
|
|
289663
|
-
}, getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride) => {
|
|
289681
|
+
}, getJustifyAdjustment = ({ block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride }) => {
|
|
289664
289682
|
if (block.kind !== "paragraph")
|
|
289665
289683
|
return {
|
|
289666
289684
|
extraPerSpace: 0,
|
|
@@ -289672,7 +289690,6 @@ menclose::after {
|
|
|
289672
289690
|
totalSpaces: 0
|
|
289673
289691
|
};
|
|
289674
289692
|
const alignment$1 = alignmentOverride ?? block.attrs?.alignment;
|
|
289675
|
-
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined) ?? false;
|
|
289676
289693
|
const lastRunIndex = block.runs.length - 1;
|
|
289677
289694
|
const lastRun = block.runs[lastRunIndex];
|
|
289678
289695
|
const lastRunLength = getRunCharacterLength(lastRun);
|
|
@@ -289680,7 +289697,8 @@ menclose::after {
|
|
|
289680
289697
|
const derivedEndsWithLineBreak = lastRun ? lastRun.kind === "lineBreak" : false;
|
|
289681
289698
|
if (!shouldApplyJustify({
|
|
289682
289699
|
alignment: alignment$1,
|
|
289683
|
-
hasExplicitPositioning,
|
|
289700
|
+
hasExplicitPositioning: line.segments?.some((seg) => seg.x !== undefined) ?? false,
|
|
289701
|
+
hasExplicitTabStops: line.hasExplicitTabStops === true,
|
|
289684
289702
|
isLastLineOfParagraph: isLastLineOfParagraph ?? derivedIsLastLine,
|
|
289685
289703
|
paragraphEndsWithLineBreak: paragraphEndsWithLineBreak ?? derivedEndsWithLineBreak,
|
|
289686
289704
|
skipJustifyOverride
|
|
@@ -290482,7 +290500,8 @@ menclose::after {
|
|
|
290482
290500
|
}).map((stop) => ({
|
|
290483
290501
|
pos: twipsToPx$1(stop.pos),
|
|
290484
290502
|
val: stop.val,
|
|
290485
|
-
leader: stop.leader
|
|
290503
|
+
leader: stop.leader,
|
|
290504
|
+
source: stop.source
|
|
290486
290505
|
}));
|
|
290487
290506
|
}, getNextTabStopPx$1 = (currentX, tabStops, startIndex) => {
|
|
290488
290507
|
let index2 = startIndex;
|
|
@@ -290672,6 +290691,8 @@ menclose::after {
|
|
|
290672
290691
|
const clampedTarget = Number.isFinite(maxAbsWidth) ? Math.min(target, maxAbsWidth) : target;
|
|
290673
290692
|
const relativeTarget = clampedTarget - effectiveIndent;
|
|
290674
290693
|
lineWidth = Math.max(lineWidth, relativeTarget);
|
|
290694
|
+
if (stop?.source === "explicit")
|
|
290695
|
+
line.hasExplicitTabStops = true;
|
|
290675
290696
|
let currentLeader = null;
|
|
290676
290697
|
if (stop?.leader && stop.leader !== "none") {
|
|
290677
290698
|
currentLeader = {
|
|
@@ -296762,7 +296783,8 @@ menclose::after {
|
|
|
296762
296783
|
}).map((stop) => ({
|
|
296763
296784
|
pos: twipsToPx(stop.pos),
|
|
296764
296785
|
val: stop.val,
|
|
296765
|
-
leader: stop.leader
|
|
296786
|
+
leader: stop.leader,
|
|
296787
|
+
source: stop.source
|
|
296766
296788
|
}));
|
|
296767
296789
|
}, getNextTabStopPx = (currentX, tabStops, startIndex) => {
|
|
296768
296790
|
let index2 = startIndex;
|
|
@@ -298420,7 +298442,7 @@ menclose::after {
|
|
|
298420
298442
|
return;
|
|
298421
298443
|
console.log(...args$1);
|
|
298422
298444
|
}, 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;
|
|
298423
|
-
var
|
|
298445
|
+
var init_src_BA9o3DfT_es = __esm(() => {
|
|
298424
298446
|
init_rolldown_runtime_Bg48TavK_es();
|
|
298425
298447
|
init_SuperConverter_DklB_kc9_es();
|
|
298426
298448
|
init_jszip_C49i9kUs_es();
|
|
@@ -328364,14 +328386,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
328364
328386
|
el.appendChild(barEl);
|
|
328365
328387
|
});
|
|
328366
328388
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
328367
|
-
const manualTabWithoutSegments = runsForLine.some((run2) => run2.kind === "tab") && !hasExplicitPositioning;
|
|
328368
328389
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
328369
328390
|
const justifyShouldApply = shouldApplyJustify({
|
|
328370
328391
|
alignment: block.attrs?.alignment,
|
|
328371
328392
|
hasExplicitPositioning: hasExplicitPositioning ?? false,
|
|
328393
|
+
hasExplicitTabStops: line.hasExplicitTabStops === true,
|
|
328372
328394
|
isLastLineOfParagraph: false,
|
|
328373
328395
|
paragraphEndsWithLineBreak: false,
|
|
328374
|
-
skipJustifyOverride: skipJustify
|
|
328396
|
+
skipJustifyOverride: skipJustify
|
|
328375
328397
|
});
|
|
328376
328398
|
const countSpaces$1 = (text5) => {
|
|
328377
328399
|
let count2 = 0;
|
|
@@ -335832,7 +335854,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
335832
335854
|
|
|
335833
335855
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
335834
335856
|
var init_super_editor_es = __esm(() => {
|
|
335835
|
-
|
|
335857
|
+
init_src_BA9o3DfT_es();
|
|
335836
335858
|
init_SuperConverter_DklB_kc9_es();
|
|
335837
335859
|
init_jszip_C49i9kUs_es();
|
|
335838
335860
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-x64": "0.8.0-next.
|
|
40
|
-
"@superdoc-dev/cli-
|
|
41
|
-
"@superdoc-dev/cli-
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.39",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.39",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.8.0-next.39",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.8.0-next.39",
|
|
41
|
+
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.39"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|