@superdoc-dev/cli 0.2.0-next.121 → 0.2.0-next.122
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 +193 -91
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -134644,7 +134644,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
134644
134644
|
init_remark_gfm_z_sDF4ss_es();
|
|
134645
134645
|
});
|
|
134646
134646
|
|
|
134647
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
134647
|
+
// ../../packages/superdoc/dist/chunks/src-BDv_tIia.es.js
|
|
134648
134648
|
function deleteProps(obj, propOrProps) {
|
|
134649
134649
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
134650
134650
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -169616,76 +169616,86 @@ function applyAlphaToSVG$1(svg2, alphaData) {
|
|
|
169616
169616
|
function generateGradientId(prefix2 = "gradient") {
|
|
169617
169617
|
return `${prefix2}-${Date.now()}-${gradientIdCounter++}-${Math.random().toString(36).substring(2, 11)}`;
|
|
169618
169618
|
}
|
|
169619
|
-
function
|
|
169619
|
+
function resolveListMarkerGeometry(wordLayout, indentLeft, firstLine, hanging, measureMarkerText) {
|
|
169620
169620
|
const marker = wordLayout?.marker;
|
|
169621
169621
|
if (!marker)
|
|
169622
|
-
return
|
|
169623
|
-
const
|
|
169624
|
-
|
|
169625
|
-
|
|
169626
|
-
|
|
169627
|
-
|
|
169628
|
-
|
|
169629
|
-
const
|
|
169630
|
-
let markerStartPos;
|
|
169631
|
-
if (wordLayout?.firstLineIndentMode === true && typeof marker.markerX === "number" && Number.isFinite(marker.markerX))
|
|
169632
|
-
markerStartPos = marker.markerX;
|
|
169633
|
-
else
|
|
169634
|
-
markerStartPos = indentLeft - hanging + firstLine;
|
|
169635
|
-
if (!Number.isFinite(markerStartPos))
|
|
169636
|
-
markerStartPos = 0;
|
|
169637
|
-
const currentPos = markerStartPos + finalMarkerTextWidth;
|
|
169622
|
+
return;
|
|
169623
|
+
const markerTextWidthPx = getMarkerTextWidthPx(marker, measureMarkerText);
|
|
169624
|
+
const markerBoxWidthPx = getMarkerBoxWidthPx(marker, markerTextWidthPx);
|
|
169625
|
+
const justification = marker.justification ?? "left";
|
|
169626
|
+
const explicitFirstLineMarkerStartPx = getExplicitFirstLineMarkerStartPx(wordLayout, marker);
|
|
169627
|
+
const anchorPx = getMarkerAnchorPx(indentLeft, firstLine, hanging);
|
|
169628
|
+
const markerStartPx = explicitFirstLineMarkerStartPx ?? getMarkerStartPx(anchorPx, justification, markerTextWidthPx);
|
|
169629
|
+
const markerContentEndPx = markerStartPx + markerTextWidthPx;
|
|
169638
169630
|
const suffix = marker.suffix ?? "tab";
|
|
169639
|
-
if (suffix === "space")
|
|
169640
|
-
return markerStartPos + finalMarkerTextWidth + 4;
|
|
169641
169631
|
if (suffix === "nothing")
|
|
169642
|
-
return
|
|
169643
|
-
|
|
169644
|
-
|
|
169645
|
-
|
|
169646
|
-
|
|
169647
|
-
|
|
169632
|
+
return {
|
|
169633
|
+
markerStartPx,
|
|
169634
|
+
markerTextWidthPx,
|
|
169635
|
+
textStartPx: markerContentEndPx,
|
|
169636
|
+
suffixWidthPx: 0
|
|
169637
|
+
};
|
|
169638
|
+
if (suffix === "space")
|
|
169639
|
+
return {
|
|
169640
|
+
markerStartPx,
|
|
169641
|
+
markerTextWidthPx,
|
|
169642
|
+
textStartPx: markerContentEndPx + 4,
|
|
169643
|
+
suffixWidthPx: 4
|
|
169644
|
+
};
|
|
169645
|
+
if (justification !== "left") {
|
|
169646
|
+
const gutterWidthPx$1 = Math.max(getNonNegativeFiniteNumber(marker.gutterWidthPx) ?? 0, 8);
|
|
169647
|
+
return {
|
|
169648
|
+
markerStartPx,
|
|
169649
|
+
markerTextWidthPx,
|
|
169650
|
+
textStartPx: markerContentEndPx + gutterWidthPx$1,
|
|
169651
|
+
suffixWidthPx: gutterWidthPx$1
|
|
169652
|
+
};
|
|
169648
169653
|
}
|
|
169649
169654
|
if (wordLayout?.firstLineIndentMode === true) {
|
|
169650
|
-
|
|
169651
|
-
|
|
169652
|
-
|
|
169653
|
-
|
|
169654
|
-
|
|
169655
|
-
|
|
169656
|
-
|
|
169657
|
-
}
|
|
169658
|
-
const textStartTarget$1 = typeof marker.textStartX === "number" && Number.isFinite(marker.textStartX) ? marker.textStartX : wordLayout.textStartPx;
|
|
169659
|
-
let tabWidth$1;
|
|
169660
|
-
if (targetTabStop !== undefined)
|
|
169661
|
-
tabWidth$1 = targetTabStop - currentPos;
|
|
169662
|
-
else if (textStartTarget$1 !== undefined && Number.isFinite(textStartTarget$1) && textStartTarget$1 > currentPos)
|
|
169663
|
-
tabWidth$1 = textStartTarget$1 - currentPos;
|
|
169655
|
+
const explicitTabStopPx = getNextExplicitTabStopPx(wordLayout.tabsPx, markerContentEndPx);
|
|
169656
|
+
const textStartTargetPx = getFirstLineTextStartTargetPx(wordLayout, marker);
|
|
169657
|
+
let textStartPx$1;
|
|
169658
|
+
if (explicitTabStopPx != null)
|
|
169659
|
+
textStartPx$1 = explicitTabStopPx;
|
|
169660
|
+
else if (textStartTargetPx != null && textStartTargetPx > markerContentEndPx)
|
|
169661
|
+
textStartPx$1 = textStartTargetPx;
|
|
169664
169662
|
else
|
|
169665
|
-
|
|
169666
|
-
if (
|
|
169667
|
-
|
|
169668
|
-
return
|
|
169669
|
-
|
|
169670
|
-
|
|
169671
|
-
|
|
169672
|
-
|
|
169673
|
-
|
|
169674
|
-
if (Array.isArray(wordLayout?.tabsPx)) {
|
|
169675
|
-
for (const tab of wordLayout.tabsPx)
|
|
169676
|
-
if (typeof tab === "number" && tab > currentPosStandard) {
|
|
169677
|
-
explicitTabStop = tab;
|
|
169678
|
-
break;
|
|
169679
|
-
}
|
|
169663
|
+
textStartPx$1 = markerContentEndPx + 8;
|
|
169664
|
+
if (textStartPx$1 - markerContentEndPx < 8)
|
|
169665
|
+
textStartPx$1 = markerContentEndPx + 8;
|
|
169666
|
+
return {
|
|
169667
|
+
markerStartPx,
|
|
169668
|
+
markerTextWidthPx,
|
|
169669
|
+
textStartPx: textStartPx$1,
|
|
169670
|
+
suffixWidthPx: textStartPx$1 - markerContentEndPx
|
|
169671
|
+
};
|
|
169680
169672
|
}
|
|
169681
|
-
|
|
169682
|
-
|
|
169683
|
-
if (
|
|
169684
|
-
return
|
|
169685
|
-
|
|
169686
|
-
|
|
169687
|
-
|
|
169688
|
-
|
|
169673
|
+
const gutterWidthPx = Math.max(getNonNegativeFiniteNumber(marker.gutterWidthPx) ?? 0, 8);
|
|
169674
|
+
const explicitTextStartPx = resolveExplicitStandardTextStartPx(getFiniteNumber(wordLayout?.textStartPx), markerContentEndPx, gutterWidthPx);
|
|
169675
|
+
if (explicitTextStartPx != null)
|
|
169676
|
+
return {
|
|
169677
|
+
markerStartPx,
|
|
169678
|
+
markerTextWidthPx,
|
|
169679
|
+
textStartPx: explicitTextStartPx,
|
|
169680
|
+
suffixWidthPx: explicitTextStartPx - markerContentEndPx
|
|
169681
|
+
};
|
|
169682
|
+
const markerBoxEndPx = markerStartPx + markerBoxWidthPx;
|
|
169683
|
+
let textStartPx = indentLeft + firstLine;
|
|
169684
|
+
if (textStartPx <= markerBoxEndPx)
|
|
169685
|
+
textStartPx = getNextDefaultTabStopPx(markerBoxEndPx);
|
|
169686
|
+
return {
|
|
169687
|
+
markerStartPx,
|
|
169688
|
+
markerTextWidthPx,
|
|
169689
|
+
textStartPx,
|
|
169690
|
+
suffixWidthPx: textStartPx - markerContentEndPx
|
|
169691
|
+
};
|
|
169692
|
+
}
|
|
169693
|
+
function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, measureMarkerText) {
|
|
169694
|
+
const geometry = resolveListMarkerGeometry(wordLayout, indentLeft, firstLine, hanging, measureMarkerText);
|
|
169695
|
+
if (geometry)
|
|
169696
|
+
return geometry.textStartPx;
|
|
169697
|
+
if (wordLayout?.firstLineIndentMode === true)
|
|
169698
|
+
return getFiniteNumber(wordLayout.textStartPx);
|
|
169689
169699
|
}
|
|
169690
169700
|
function calculateRotatedBounds(input2) {
|
|
169691
169701
|
const width = Math.max(0, input2.width);
|
|
@@ -175760,7 +175770,14 @@ function computeCellVisibleHeight(cell2, cellFrom, cellTo) {
|
|
|
175760
175770
|
return cellVisHeight;
|
|
175761
175771
|
}
|
|
175762
175772
|
function renderListMarker(params$1) {
|
|
175763
|
-
const { doc: doc$2, lineEl, markerLayout, markerMeasure, indentLeftPx, hangingIndentPx, firstLineIndentPx, tabsPx } = params$1;
|
|
175773
|
+
const { doc: doc$2, lineEl, wordLayout, markerLayout, markerMeasure, indentLeftPx, hangingIndentPx, firstLineIndentPx, tabsPx } = params$1;
|
|
175774
|
+
const markerGeometry = markerLayout?.justification === "left" && wordLayout?.firstLineIndentMode !== true && typeof markerMeasure?.markerTextWidth === "number" && Number.isFinite(markerMeasure.markerTextWidth) && markerMeasure.markerTextWidth >= 0 ? resolvePainterListMarkerGeometry({
|
|
175775
|
+
wordLayout,
|
|
175776
|
+
indentLeftPx,
|
|
175777
|
+
hangingIndentPx,
|
|
175778
|
+
firstLineIndentPx,
|
|
175779
|
+
markerTextWidthPx: markerMeasure?.markerTextWidth
|
|
175780
|
+
}) : undefined;
|
|
175764
175781
|
const anchorPoint = indentLeftPx - hangingIndentPx + firstLineIndentPx;
|
|
175765
175782
|
const markerJustification = markerLayout?.justification ?? "left";
|
|
175766
175783
|
const markerTextWidth = markerMeasure?.markerTextWidth ?? 0;
|
|
@@ -175777,7 +175794,9 @@ function renderListMarker(params$1) {
|
|
|
175777
175794
|
}
|
|
175778
175795
|
const suffix = markerLayout?.suffix ?? "tab";
|
|
175779
175796
|
let listTabWidth = 0;
|
|
175780
|
-
if (suffix === "tab")
|
|
175797
|
+
if (markerGeometry && (suffix === "tab" || suffix === "space"))
|
|
175798
|
+
listTabWidth = markerGeometry.suffixWidthPx;
|
|
175799
|
+
else if (suffix === "tab")
|
|
175781
175800
|
listTabWidth = computeTabWidth(currentPos, markerJustification, tabsPx, hangingIndentPx, firstLineIndentPx, indentLeftPx);
|
|
175782
175801
|
else if (suffix === "space")
|
|
175783
175802
|
listTabWidth = 4;
|
|
@@ -176985,6 +177004,10 @@ function computeWordParagraphLayout(input2) {
|
|
|
176985
177004
|
}
|
|
176986
177005
|
layout.marker = {
|
|
176987
177006
|
markerText: listRenderingAttrs.markerText,
|
|
177007
|
+
markerBoxWidthPx,
|
|
177008
|
+
markerX,
|
|
177009
|
+
textStartX: layout.textStartPx,
|
|
177010
|
+
gutterWidthPx: 8,
|
|
176988
177011
|
justification: listRenderingAttrs.justification ?? "left",
|
|
176989
177012
|
suffix: normalizeSuffix(listRenderingAttrs.suffix),
|
|
176990
177013
|
run: markerRun
|
|
@@ -178776,7 +178799,7 @@ function paragraphToFlowBlocks({ para, nextBlockId, positions, trackedChangesCon
|
|
|
178776
178799
|
kind: "paragraph",
|
|
178777
178800
|
id: baseBlockId,
|
|
178778
178801
|
runs: [emptyRun],
|
|
178779
|
-
attrs:
|
|
178802
|
+
attrs: emptyParagraphAttrs
|
|
178780
178803
|
});
|
|
178781
178804
|
return blocks2;
|
|
178782
178805
|
}
|
|
@@ -201014,7 +201037,56 @@ var Node$13 = class Node$14 {
|
|
|
201014
201037
|
styleEl.textContent = NATIVE_SELECTION_STYLES;
|
|
201015
201038
|
doc$2.head?.appendChild(styleEl);
|
|
201016
201039
|
nativeSelectionStylesInjected = true;
|
|
201017
|
-
}, gradientIdCounter = 0,
|
|
201040
|
+
}, gradientIdCounter = 0, getFiniteNumber = (value) => {
|
|
201041
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
201042
|
+
return;
|
|
201043
|
+
return value;
|
|
201044
|
+
}, getNonNegativeFiniteNumber = (value) => {
|
|
201045
|
+
const numericValue = getFiniteNumber(value);
|
|
201046
|
+
if (numericValue == null || numericValue < 0)
|
|
201047
|
+
return;
|
|
201048
|
+
return numericValue;
|
|
201049
|
+
}, getMarkerTextWidthPx = (marker, measureMarkerText) => {
|
|
201050
|
+
const glyphWidthPx = getNonNegativeFiniteNumber(marker.glyphWidthPx);
|
|
201051
|
+
if (glyphWidthPx != null)
|
|
201052
|
+
return glyphWidthPx;
|
|
201053
|
+
if (marker.markerText) {
|
|
201054
|
+
const safeMeasuredWidthPx = getNonNegativeFiniteNumber(measureMarkerText(marker.markerText, marker));
|
|
201055
|
+
if (safeMeasuredWidthPx != null)
|
|
201056
|
+
return safeMeasuredWidthPx;
|
|
201057
|
+
}
|
|
201058
|
+
return getNonNegativeFiniteNumber(marker.markerBoxWidthPx) ?? 0;
|
|
201059
|
+
}, getMarkerBoxWidthPx = (marker, markerTextWidthPx) => Math.max(getNonNegativeFiniteNumber(marker.markerBoxWidthPx) ?? 0, markerTextWidthPx), getExplicitFirstLineMarkerStartPx = (wordLayout, marker) => {
|
|
201060
|
+
if (wordLayout?.firstLineIndentMode !== true)
|
|
201061
|
+
return;
|
|
201062
|
+
return getFiniteNumber(marker.markerX);
|
|
201063
|
+
}, getMarkerAnchorPx = (indentLeft, firstLine, hanging) => indentLeft - hanging + firstLine, getMarkerStartPx = (anchorPx, justification, markerTextWidthPx) => {
|
|
201064
|
+
if (justification === "right")
|
|
201065
|
+
return anchorPx - markerTextWidthPx;
|
|
201066
|
+
if (justification === "center")
|
|
201067
|
+
return anchorPx - markerTextWidthPx / 2;
|
|
201068
|
+
return anchorPx;
|
|
201069
|
+
}, getNextExplicitTabStopPx = (tabsPx, currentPosPx) => {
|
|
201070
|
+
if (!Array.isArray(tabsPx))
|
|
201071
|
+
return;
|
|
201072
|
+
for (const tabPx of tabsPx)
|
|
201073
|
+
if (typeof tabPx === "number" && Number.isFinite(tabPx) && tabPx > currentPosPx)
|
|
201074
|
+
return tabPx;
|
|
201075
|
+
}, getFirstLineTextStartTargetPx = (wordLayout, marker) => {
|
|
201076
|
+
return getFiniteNumber(marker.textStartX) ?? getFiniteNumber(wordLayout?.textStartPx);
|
|
201077
|
+
}, getNextDefaultTabStopPx = (currentPosPx) => {
|
|
201078
|
+
const remainderPx = currentPosPx % 48;
|
|
201079
|
+
if (remainderPx === 0)
|
|
201080
|
+
return currentPosPx + 48;
|
|
201081
|
+
return currentPosPx + 48 - remainderPx;
|
|
201082
|
+
}, getMinimumReadableTextStartPx = (markerContentEndPx, gutterWidthPx) => markerContentEndPx + gutterWidthPx, resolveExplicitStandardTextStartPx = (explicitTextStartPx, markerContentEndPx, gutterWidthPx) => {
|
|
201083
|
+
if (explicitTextStartPx == null)
|
|
201084
|
+
return;
|
|
201085
|
+
if (explicitTextStartPx > markerContentEndPx)
|
|
201086
|
+
return explicitTextStartPx;
|
|
201087
|
+
if (explicitTextStartPx > 0)
|
|
201088
|
+
return getMinimumReadableTextStartPx(markerContentEndPx, gutterWidthPx);
|
|
201089
|
+
}, EMUS_PER_INCH = 914400, maxSize = 5000, cache$1, makeKey = (text5, font, letterSpacing) => {
|
|
201018
201090
|
return `${text5}|${font}|${letterSpacing || 0}`;
|
|
201019
201091
|
}, fontMetricsCache, MAX_CACHE_SIZE$1 = 1000, METRICS_TEST_STRING = "MHgypbdlÁÉÍ", computeTabStops, measurementConfig, canvasContext = null, DEFAULT_TAB_INTERVAL_TWIPS$2 = 720, TWIPS_PER_PX$1, twipsToPx$2 = (twips) => twips / TWIPS_PER_PX$1, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$1), DEFAULT_TAB_INTERVAL_PX$1, TAB_EPSILON$1 = 0.1, DEFAULT_CELL_PADDING$1, DEFAULT_DECIMAL_SEPARATOR$1 = ".", ALLOWED_TAB_VALS, FIELD_ANNOTATION_PILL_PADDING = 8, FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2, FIELD_ANNOTATION_VERTICAL_PADDING = 6, DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16, DEFAULT_PARAGRAPH_FONT_SIZE = 12, DEFAULT_PARAGRAPH_FONT_FAMILY = "Arial", isValidFontSize = (value) => typeof value === "number" && Number.isFinite(value) && value > 0, normalizeFontSize$1 = (value, fallback = DEFAULT_PARAGRAPH_FONT_SIZE) => {
|
|
201020
201092
|
if (isValidFontSize(value))
|
|
@@ -201678,7 +201750,11 @@ var Node$13 = class Node$14 {
|
|
|
201678
201750
|
line.el.style.marginLeft = `${marginLeft}px`;
|
|
201679
201751
|
line.el.style.marginRight = `${marginRight}px`;
|
|
201680
201752
|
});
|
|
201681
|
-
}, DEFAULT_TAB_INTERVAL_PX = 48,
|
|
201753
|
+
}, DEFAULT_TAB_INTERVAL_PX = 48, getFiniteNonNegativeNumber = (value) => {
|
|
201754
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0)
|
|
201755
|
+
return;
|
|
201756
|
+
return value;
|
|
201757
|
+
}, resolvePainterMarkerTextWidth = (markerTextWidthPx, marker) => getFiniteNonNegativeNumber(markerTextWidthPx) ?? getFiniteNonNegativeNumber(marker.glyphWidthPx) ?? getFiniteNonNegativeNumber(marker.markerBoxWidthPx) ?? 0, resolvePainterListMarkerGeometry = ({ wordLayout, indentLeftPx, hangingIndentPx, firstLineIndentPx, markerTextWidthPx }) => resolveListMarkerGeometry(wordLayout, indentLeftPx, firstLineIndentPx, hangingIndentPx, (_markerText, marker) => resolvePainterMarkerTextWidth(markerTextWidthPx, marker)), resolvePainterListTextStartPx = ({ wordLayout, indentLeftPx, hangingIndentPx, firstLineIndentPx, markerTextWidthPx }) => resolveListTextStartPx(wordLayout, indentLeftPx, firstLineIndentPx, hangingIndentPx, (_markerText, marker) => resolvePainterMarkerTextWidth(markerTextWidthPx, marker)), computeTabWidth = (currentPos, justification, tabs, hangingIndent, firstLineIndent, leftIndent) => {
|
|
201682
201758
|
const nextDefaultTabStop = currentPos + DEFAULT_TAB_INTERVAL_PX - currentPos % DEFAULT_TAB_INTERVAL_PX;
|
|
201683
201759
|
let tabWidth;
|
|
201684
201760
|
if (justification === "left") {
|
|
@@ -202096,6 +202172,13 @@ var Node$13 = class Node$14 {
|
|
|
202096
202172
|
const hangingIndentPx = block.attrs?.indent && typeof block.attrs.indent.hanging === "number" ? block.attrs.indent.hanging : 0;
|
|
202097
202173
|
const firstLineIndentPx = block.attrs?.indent && typeof block.attrs.indent.firstLine === "number" ? block.attrs.indent.firstLine : 0;
|
|
202098
202174
|
const suppressFirstLineIndent = block.attrs?.suppressFirstLineIndent === true;
|
|
202175
|
+
const listFirstLineTextStartPx = markerLayout && markerMeasure ? resolvePainterListTextStartPx({
|
|
202176
|
+
wordLayout: wordLayout ?? undefined,
|
|
202177
|
+
indentLeftPx,
|
|
202178
|
+
hangingIndentPx,
|
|
202179
|
+
firstLineIndentPx,
|
|
202180
|
+
markerTextWidthPx: markerMeasure.markerTextWidth
|
|
202181
|
+
}) : undefined;
|
|
202099
202182
|
const blockStartGlobal = cumulativeLineCount;
|
|
202100
202183
|
if (cumulativeLineCount + blockLineCount <= globalFromLine) {
|
|
202101
202184
|
cumulativeLineCount += blockLineCount;
|
|
@@ -202135,7 +202218,7 @@ var Node$13 = class Node$14 {
|
|
|
202135
202218
|
const lineEl = renderLine(block, line, {
|
|
202136
202219
|
...context,
|
|
202137
202220
|
section: "body"
|
|
202138
|
-
}, lineIdx, isLastLine);
|
|
202221
|
+
}, lineIdx, isLastLine, lineIdx === 0 && localStartLine === 0 ? listFirstLineTextStartPx : undefined);
|
|
202139
202222
|
lineEl.style.paddingLeft = "";
|
|
202140
202223
|
lineEl.style.paddingRight = "";
|
|
202141
202224
|
lineEl.style.textIndent = "";
|
|
@@ -202143,6 +202226,7 @@ var Node$13 = class Node$14 {
|
|
|
202143
202226
|
renderListMarker({
|
|
202144
202227
|
doc: doc$2,
|
|
202145
202228
|
lineEl,
|
|
202229
|
+
wordLayout: wordLayout ?? undefined,
|
|
202146
202230
|
markerLayout,
|
|
202147
202231
|
markerMeasure,
|
|
202148
202232
|
indentLeftPx,
|
|
@@ -202752,7 +202836,7 @@ var Node$13 = class Node$14 {
|
|
|
202752
202836
|
this.onMouseLeave = null;
|
|
202753
202837
|
this.hoveredSdtId = null;
|
|
202754
202838
|
}
|
|
202755
|
-
}, LIST_MARKER_GAP = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, COMMENT_EXTERNAL_COLOR = "#B1124B", COMMENT_INTERNAL_COLOR = "#078383", COMMENT_INACTIVE_ALPHA = "40", COMMENT_ACTIVE_ALPHA = "66", COMMENT_FADED_ALPHA = "20", LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_FOCUSED_CLASS = "track-change-focused", TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor$1 = (value) => {
|
|
202839
|
+
}, LIST_MARKER_GAP$1 = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, COMMENT_EXTERNAL_COLOR = "#B1124B", COMMENT_INTERNAL_COLOR = "#078383", COMMENT_INACTIVE_ALPHA = "40", COMMENT_ACTIVE_ALPHA = "66", COMMENT_FADED_ALPHA = "20", LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_FOCUSED_CLASS = "track-change-focused", TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor$1 = (value) => {
|
|
202756
202840
|
if (typeof value !== "string")
|
|
202757
202841
|
return null;
|
|
202758
202842
|
const trimmed = value.trim();
|
|
@@ -216742,7 +216826,7 @@ var Node$13 = class Node$14 {
|
|
|
216742
216826
|
return false;
|
|
216743
216827
|
return Boolean(checker(attrs));
|
|
216744
216828
|
}, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
|
|
216745
|
-
var
|
|
216829
|
+
var init_src_BDv_tIia_es = __esm(() => {
|
|
216746
216830
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
216747
216831
|
init_SuperConverter_BBGfKYpx_es();
|
|
216748
216832
|
init_jszip_ChlR43oI_es();
|
|
@@ -232314,9 +232398,22 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
232314
232398
|
const paraIndentRight = paraIndent?.right ?? 0;
|
|
232315
232399
|
const firstLineOffset = block.attrs?.suppressFirstLineIndent === true ? 0 : (paraIndent?.firstLine ?? 0) - (paraIndent?.hanging ?? 0);
|
|
232316
232400
|
const paragraphEndsWithLineBreak = (block.runs.length > 0 ? block.runs[block.runs.length - 1] : null)?.kind === "lineBreak";
|
|
232317
|
-
|
|
232401
|
+
const listFirstLineTextStartPx = !fragment2.continuesFromPrev && fragment2.markerWidth && wordLayout?.marker ? resolvePainterListTextStartPx({
|
|
232402
|
+
wordLayout,
|
|
232403
|
+
indentLeftPx: paraIndentLeft,
|
|
232404
|
+
hangingIndentPx: paraIndent?.hanging ?? 0,
|
|
232405
|
+
firstLineIndentPx: paraIndent?.firstLine ?? 0,
|
|
232406
|
+
markerTextWidthPx: fragment2.markerTextWidth
|
|
232407
|
+
}) : undefined;
|
|
232408
|
+
const listFirstLineMarkerGeometry = !fragment2.continuesFromPrev && fragment2.markerWidth && wordLayout?.marker?.justification === "left" && wordLayout.firstLineIndentMode !== true && typeof fragment2.markerTextWidth === "number" && Number.isFinite(fragment2.markerTextWidth) && fragment2.markerTextWidth >= 0 ? resolvePainterListMarkerGeometry({
|
|
232409
|
+
wordLayout,
|
|
232410
|
+
indentLeftPx: paraIndentLeft,
|
|
232411
|
+
hangingIndentPx: paraIndent?.hanging ?? 0,
|
|
232412
|
+
firstLineIndentPx: paraIndent?.firstLine ?? 0,
|
|
232413
|
+
markerTextWidthPx: fragment2.markerTextWidth
|
|
232414
|
+
}) : undefined;
|
|
232318
232415
|
let listTabWidth = 0;
|
|
232319
|
-
let markerStartPos;
|
|
232416
|
+
let markerStartPos = 0;
|
|
232320
232417
|
if (!fragment2.continuesFromPrev && fragment2.markerWidth && wordLayout?.marker) {
|
|
232321
232418
|
const markerTextWidth = fragment2.markerTextWidth;
|
|
232322
232419
|
const anchorPoint = paraIndentLeft - (paraIndent?.hanging ?? 0) + (paraIndent?.firstLine ?? 0);
|
|
@@ -232333,22 +232430,25 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
232333
232430
|
currentPos = markerStartPos + markerTextWidth;
|
|
232334
232431
|
}
|
|
232335
232432
|
const suffix = wordLayout.marker.suffix ?? "tab";
|
|
232336
|
-
if (suffix === "tab")
|
|
232433
|
+
if (listFirstLineMarkerGeometry && (suffix === "tab" || suffix === "space"))
|
|
232434
|
+
listTabWidth = listFirstLineMarkerGeometry.suffixWidthPx;
|
|
232435
|
+
else if (suffix === "tab")
|
|
232337
232436
|
listTabWidth = computeTabWidth(currentPos, markerJustification, wordLayout.tabsPx, paraIndent?.hanging, paraIndent?.firstLine, paraIndentLeft);
|
|
232338
232437
|
else if (suffix === "space")
|
|
232339
232438
|
listTabWidth = 4;
|
|
232340
|
-
listFirstLineMarkerTabEndPx = currentPos + listTabWidth;
|
|
232341
232439
|
}
|
|
232342
232440
|
lines.forEach((line, index2) => {
|
|
232441
|
+
const hasExplicitSegmentPositioning = line.segments?.some((segment) => segment.x !== undefined) === true;
|
|
232442
|
+
const hasListFirstLineMarker = index2 === 0 && !fragment2.continuesFromPrev && fragment2.markerWidth && wordLayout?.marker;
|
|
232443
|
+
const shouldUseResolvedListTextStart = hasListFirstLineMarker && hasExplicitSegmentPositioning && listFirstLineTextStartPx != null;
|
|
232343
232444
|
const positiveIndentReduction = Math.max(0, paraIndentLeft) + Math.max(0, paraIndentRight);
|
|
232344
232445
|
const fallbackAvailableWidth = Math.max(0, fragment2.width - positiveIndentReduction);
|
|
232345
232446
|
let availableWidthOverride = line.maxWidth != null ? Math.min(line.maxWidth, fallbackAvailableWidth) : fallbackAvailableWidth;
|
|
232346
|
-
if (
|
|
232347
|
-
availableWidthOverride = fragment2.width -
|
|
232447
|
+
if (shouldUseResolvedListTextStart)
|
|
232448
|
+
availableWidthOverride = fragment2.width - listFirstLineTextStartPx - Math.max(0, paraIndentRight);
|
|
232348
232449
|
const shouldSkipJustifyForLastLine = index2 === lines.length - 1 && !fragment2.continuesOnNext && !paragraphEndsWithLineBreak;
|
|
232349
|
-
const lineEl = this.renderLine(block, line, context, availableWidthOverride, fragment2.fromLine + index2, shouldSkipJustifyForLastLine);
|
|
232350
|
-
const isListFirstLine =
|
|
232351
|
-
const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
232450
|
+
const lineEl = this.renderLine(block, line, context, availableWidthOverride, fragment2.fromLine + index2, shouldSkipJustifyForLastLine, shouldUseResolvedListTextStart ? listFirstLineTextStartPx : undefined);
|
|
232451
|
+
const isListFirstLine = Boolean(hasListFirstLineMarker && fragment2.markerTextWidth);
|
|
232352
232452
|
const isFirstLine = index2 === 0 && !fragment2.continuesFromPrev;
|
|
232353
232453
|
if (!isListFirstLine) {
|
|
232354
232454
|
if (hasExplicitSegmentPositioning) {
|
|
@@ -232370,7 +232470,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
232370
232470
|
} else if (firstLineOffset && !isListFirstLine)
|
|
232371
232471
|
lineEl.style.textIndent = "0px";
|
|
232372
232472
|
if (isListFirstLine) {
|
|
232373
|
-
const marker = wordLayout
|
|
232473
|
+
const marker = wordLayout?.marker;
|
|
232474
|
+
if (!marker)
|
|
232475
|
+
return;
|
|
232374
232476
|
lineEl.style.paddingLeft = `${paraIndentLeft + (paraIndent?.firstLine ?? 0) - (paraIndent?.hanging ?? 0)}px`;
|
|
232375
232477
|
if (!marker.run.vanish) {
|
|
232376
232478
|
const markerContainer = this.doc.createElement("span");
|
|
@@ -232517,8 +232619,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
232517
232619
|
if (marker) {
|
|
232518
232620
|
markerEl.textContent = marker.markerText ?? null;
|
|
232519
232621
|
markerEl.style.display = "inline-block";
|
|
232520
|
-
markerEl.style.width = `${Math.max(0, fragment2.markerWidth - LIST_MARKER_GAP)}px`;
|
|
232521
|
-
markerEl.style.paddingRight = `${LIST_MARKER_GAP}px`;
|
|
232622
|
+
markerEl.style.width = `${Math.max(0, fragment2.markerWidth - LIST_MARKER_GAP$1)}px`;
|
|
232623
|
+
markerEl.style.paddingRight = `${LIST_MARKER_GAP$1}px`;
|
|
232522
232624
|
markerEl.style.textAlign = marker.justification ?? "left";
|
|
232523
232625
|
markerEl.style.fontFamily = toCssFontFamily(marker.run.fontFamily) ?? marker.run.fontFamily;
|
|
232524
232626
|
markerEl.style.fontSize = `${marker.run.fontSize}px`;
|
|
@@ -232533,8 +232635,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
232533
232635
|
} else {
|
|
232534
232636
|
markerEl.textContent = item.marker.text;
|
|
232535
232637
|
markerEl.style.display = "inline-block";
|
|
232536
|
-
markerEl.style.width = `${Math.max(0, fragment2.markerWidth - LIST_MARKER_GAP)}px`;
|
|
232537
|
-
markerEl.style.paddingRight = `${LIST_MARKER_GAP}px`;
|
|
232638
|
+
markerEl.style.width = `${Math.max(0, fragment2.markerWidth - LIST_MARKER_GAP$1)}px`;
|
|
232639
|
+
markerEl.style.paddingRight = `${LIST_MARKER_GAP$1}px`;
|
|
232538
232640
|
if (item.marker.align)
|
|
232539
232641
|
markerEl.style.textAlign = item.marker.align;
|
|
232540
232642
|
}
|
|
@@ -233212,10 +233314,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
233212
233314
|
const applyFragmentFrameWithSection = (el, frag) => {
|
|
233213
233315
|
this.applyFragmentFrame(el, frag, context.section);
|
|
233214
233316
|
};
|
|
233215
|
-
const renderLineForTableCell = (block, line, ctx$1, lineIndex, isLastLine) => {
|
|
233317
|
+
const renderLineForTableCell = (block, line, ctx$1, lineIndex, isLastLine, resolvedListTextStartPx) => {
|
|
233216
233318
|
const paragraphEndsWithLineBreak = (block.runs.length > 0 ? block.runs[block.runs.length - 1] : null)?.kind === "lineBreak";
|
|
233217
233319
|
const shouldSkipJustify = isLastLine && !paragraphEndsWithLineBreak;
|
|
233218
|
-
return this.renderLine(block, line, ctx$1, undefined, lineIndex, shouldSkipJustify);
|
|
233320
|
+
return this.renderLine(block, line, ctx$1, undefined, lineIndex, shouldSkipJustify, resolvedListTextStartPx);
|
|
233219
233321
|
};
|
|
233220
233322
|
const renderDrawingContentForTableCell = (block) => {
|
|
233221
233323
|
if (block.drawingKind === "image")
|
|
@@ -233797,7 +233899,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
233797
233899
|
annotation.style.position = "relative";
|
|
233798
233900
|
annotation.appendChild(caretAnchor);
|
|
233799
233901
|
}
|
|
233800
|
-
renderLine(block, line, context, availableWidthOverride, lineIndex, skipJustify) {
|
|
233902
|
+
renderLine(block, line, context, availableWidthOverride, lineIndex, skipJustify, resolvedListTextStartPx) {
|
|
233801
233903
|
if (!this.doc)
|
|
233802
233904
|
throw new Error("DomPainter: document is not available");
|
|
233803
233905
|
const lineRange = computeLinePmRange$1(block, line);
|
|
@@ -234021,8 +234123,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
234021
234123
|
const wordLayoutValue = block.attrs?.wordLayout;
|
|
234022
234124
|
const wordLayout = isMinimalWordLayout(wordLayoutValue) ? wordLayoutValue : undefined;
|
|
234023
234125
|
const isListParagraph = Boolean(wordLayout?.marker);
|
|
234024
|
-
const
|
|
234025
|
-
const indentOffset = isListParagraph ? isFirstLineOfPara ?
|
|
234126
|
+
const fallbackListTextStartPx = typeof wordLayout?.marker?.textStartX === "number" && Number.isFinite(wordLayout.marker.textStartX) ? wordLayout.marker.textStartX : typeof wordLayout?.textStartPx === "number" && Number.isFinite(wordLayout.textStartPx) ? wordLayout.textStartPx : undefined;
|
|
234127
|
+
const indentOffset = isListParagraph ? isFirstLineOfPara ? resolvedListTextStartPx ?? fallbackListTextStartPx ?? indentLeft : indentLeft : indentLeft + firstLineOffsetForCumX;
|
|
234026
234128
|
let cumulativeX = 0;
|
|
234027
234129
|
const segmentsByRun = /* @__PURE__ */ new Map;
|
|
234028
234130
|
line.segments.forEach((segment) => {
|
|
@@ -250352,7 +250454,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
250352
250454
|
|
|
250353
250455
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
250354
250456
|
var init_super_editor_es = __esm(() => {
|
|
250355
|
-
|
|
250457
|
+
init_src_BDv_tIia_es();
|
|
250356
250458
|
init_SuperConverter_BBGfKYpx_es();
|
|
250357
250459
|
init_jszip_ChlR43oI_es();
|
|
250358
250460
|
init_xml_js_DLE8mr0n_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.122",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.
|
|
34
|
-
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.
|
|
35
|
-
"@superdoc-dev/cli-linux-
|
|
36
|
-
"@superdoc-dev/cli-linux-
|
|
37
|
-
"@superdoc-dev/cli-windows-x64": "0.2.0-next.
|
|
33
|
+
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.122",
|
|
34
|
+
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.122",
|
|
35
|
+
"@superdoc-dev/cli-linux-arm64": "0.2.0-next.122",
|
|
36
|
+
"@superdoc-dev/cli-linux-x64": "0.2.0-next.122",
|
|
37
|
+
"@superdoc-dev/cli-windows-x64": "0.2.0-next.122"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "bun run src/index.ts",
|