@superdoc-dev/cli 0.7.0-next.26 → 0.7.0-next.28
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 +266 -104
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -205572,7 +205572,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
205572
205572
|
init_remark_gfm_BhnWr3yf_es();
|
|
205573
205573
|
});
|
|
205574
205574
|
|
|
205575
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
205575
|
+
// ../../packages/superdoc/dist/chunks/src-BSdWFICK.es.js
|
|
205576
205576
|
function deleteProps(obj, propOrProps) {
|
|
205577
205577
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
205578
205578
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -248666,8 +248666,10 @@ function layoutParagraphBlock(ctx$1, anchors) {
|
|
|
248666
248666
|
state.trailingSpacing = 0;
|
|
248667
248667
|
continue;
|
|
248668
248668
|
}
|
|
248669
|
-
if (neededSpacingBefore > 0)
|
|
248669
|
+
if (neededSpacingBefore > 0) {
|
|
248670
248670
|
state.cursorY += neededSpacingBefore;
|
|
248671
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
248672
|
+
}
|
|
248671
248673
|
state.trailingSpacing = 0;
|
|
248672
248674
|
appliedSpacingBefore = true;
|
|
248673
248675
|
}
|
|
@@ -248731,6 +248733,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
|
|
|
248731
248733
|
}
|
|
248732
248734
|
state.page.fragments.push(fragment2);
|
|
248733
248735
|
state.cursorY += borderExpansion.top + fragmentHeight + borderExpansion.bottom;
|
|
248736
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
248734
248737
|
lastState = state;
|
|
248735
248738
|
fromLine = slice2.toLine;
|
|
248736
248739
|
}
|
|
@@ -248741,8 +248744,10 @@ function layoutParagraphBlock(ctx$1, anchors) {
|
|
|
248741
248744
|
if (targetState.cursorY + spacingAfter > targetState.contentBottom) {
|
|
248742
248745
|
targetState = advanceColumn(targetState);
|
|
248743
248746
|
appliedSpacingAfter = 0;
|
|
248744
|
-
} else
|
|
248747
|
+
} else {
|
|
248745
248748
|
targetState.cursorY += spacingAfter;
|
|
248749
|
+
targetState.maxCursorY = Math.max(targetState.maxCursorY, targetState.cursorY);
|
|
248750
|
+
}
|
|
248746
248751
|
targetState.trailingSpacing = appliedSpacingAfter;
|
|
248747
248752
|
} else
|
|
248748
248753
|
lastState.trailingSpacing = 0;
|
|
@@ -248802,6 +248807,7 @@ function layoutImageBlock({ block, measure, columns, ensurePage, advanceColumn,
|
|
|
248802
248807
|
};
|
|
248803
248808
|
state.page.fragments.push(fragment2);
|
|
248804
248809
|
state.cursorY += requiredHeight;
|
|
248810
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
248805
248811
|
}
|
|
248806
248812
|
function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn, columnX }) {
|
|
248807
248813
|
if (block.anchor?.isAnchored)
|
|
@@ -248861,6 +248867,7 @@ function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn
|
|
|
248861
248867
|
};
|
|
248862
248868
|
state.page.fragments.push(fragment2);
|
|
248863
248869
|
state.cursorY += requiredHeight;
|
|
248870
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
248864
248871
|
}
|
|
248865
248872
|
function describeCellRenderBlocks(cellMeasure, cellBlock, cellPadding) {
|
|
248866
248873
|
const measuredBlocks = cellMeasure.blocks;
|
|
@@ -249609,6 +249616,7 @@ function layoutMonolithicTable(context) {
|
|
|
249609
249616
|
applyTableFragmentPmRange(fragment2, context.block, context.measure);
|
|
249610
249617
|
state.page.fragments.push(fragment2);
|
|
249611
249618
|
state.cursorY += height;
|
|
249619
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
249612
249620
|
}
|
|
249613
249621
|
function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColumn, columnX }) {
|
|
249614
249622
|
let treatAsInline = false;
|
|
@@ -249684,6 +249692,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
|
|
|
249684
249692
|
applyTableFragmentPmRange(fragment2, block, measure);
|
|
249685
249693
|
state.page.fragments.push(fragment2);
|
|
249686
249694
|
state.cursorY += height;
|
|
249695
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
249687
249696
|
return;
|
|
249688
249697
|
}
|
|
249689
249698
|
const borderCollapse = block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse");
|
|
@@ -249755,6 +249764,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
|
|
|
249755
249764
|
applyTableFragmentPmRange(fragment$1, block, measure);
|
|
249756
249765
|
state.page.fragments.push(fragment$1);
|
|
249757
249766
|
state.cursorY += fragmentHeight$1;
|
|
249767
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
249758
249768
|
}
|
|
249759
249769
|
if (!hasRemainingLinesAfterContinuation) {
|
|
249760
249770
|
currentRow = rowIndex + 1;
|
|
@@ -249809,6 +249819,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
|
|
|
249809
249819
|
applyTableFragmentPmRange(fragment$1, block, measure);
|
|
249810
249820
|
state.page.fragments.push(fragment$1);
|
|
249811
249821
|
state.cursorY += fragmentHeight$1;
|
|
249822
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
249812
249823
|
pendingPartialRow = forcedPartialRow;
|
|
249813
249824
|
samePagePartialContinuation = true;
|
|
249814
249825
|
isTableContinuation = true;
|
|
@@ -249836,6 +249847,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
|
|
|
249836
249847
|
applyTableFragmentPmRange(fragment2, block, measure);
|
|
249837
249848
|
state.page.fragments.push(fragment2);
|
|
249838
249849
|
state.cursorY += fragmentHeight;
|
|
249850
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
249839
249851
|
if (partialRow && !partialRow.isLastPart) {
|
|
249840
249852
|
pendingPartialRow = partialRow;
|
|
249841
249853
|
currentRow = partialRow.rowIndex;
|
|
@@ -250075,7 +250087,8 @@ function createPaginator(opts) {
|
|
|
250075
250087
|
activeConstraintIndex: -1,
|
|
250076
250088
|
trailingSpacing: 0,
|
|
250077
250089
|
lastParagraphStyleId: undefined,
|
|
250078
|
-
lastParagraphContextualSpacing: false
|
|
250090
|
+
lastParagraphContextualSpacing: false,
|
|
250091
|
+
maxCursorY: topMargin
|
|
250079
250092
|
};
|
|
250080
250093
|
states.push(state);
|
|
250081
250094
|
pages.push(state.page);
|
|
@@ -250092,6 +250105,7 @@ function createPaginator(opts) {
|
|
|
250092
250105
|
const advanceColumn = (state) => {
|
|
250093
250106
|
const activeCols = getActiveColumnsForState(state);
|
|
250094
250107
|
if (state.columnIndex < activeCols.count - 1) {
|
|
250108
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
250095
250109
|
state.columnIndex += 1;
|
|
250096
250110
|
if (state.activeConstraintIndex >= 0 && state.constraintBoundaries[state.activeConstraintIndex])
|
|
250097
250111
|
state.cursorY = state.constraintBoundaries[state.activeConstraintIndex].y;
|
|
@@ -251116,8 +251130,11 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
251116
251130
|
const columnX = paginator.columnX;
|
|
251117
251131
|
const advanceColumn = paginator.advanceColumn;
|
|
251118
251132
|
const startMidPageRegion = (state, newColumns) => {
|
|
251133
|
+
const regionStartY = Math.max(state.cursorY, state.maxCursorY);
|
|
251134
|
+
state.cursorY = regionStartY;
|
|
251135
|
+
state.maxCursorY = regionStartY;
|
|
251119
251136
|
const boundary = {
|
|
251120
|
-
y:
|
|
251137
|
+
y: regionStartY,
|
|
251121
251138
|
columns: newColumns
|
|
251122
251139
|
};
|
|
251123
251140
|
state.constraintBoundaries.push(boundary);
|
|
@@ -251126,7 +251143,7 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
251126
251143
|
layoutLog(`[Layout] *** COLUMNS CHANGED MID-PAGE ***`);
|
|
251127
251144
|
layoutLog(` OLD activeColumns: ${JSON.stringify(activeColumns)}`);
|
|
251128
251145
|
layoutLog(` NEW activeColumns: ${JSON.stringify(newColumns)}`);
|
|
251129
|
-
layoutLog(` Current page: ${state.page.number}, cursorY: ${state.cursorY}`);
|
|
251146
|
+
layoutLog(` Current page: ${state.page.number}, cursorY: ${state.cursorY}, maxCursorY: ${state.maxCursorY}`);
|
|
251130
251147
|
activeColumns = cloneColumnLayout(newColumns);
|
|
251131
251148
|
cachedColumnsState.state = null;
|
|
251132
251149
|
const contentWidth = activePageSize.w - (activeLeftMargin + activeRightMargin);
|
|
@@ -251514,6 +251531,7 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
251514
251531
|
}
|
|
251515
251532
|
}
|
|
251516
251533
|
state.cursorY = tableBottomY;
|
|
251534
|
+
state.maxCursorY = Math.max(state.maxCursorY, state.cursorY);
|
|
251517
251535
|
}
|
|
251518
251536
|
continue;
|
|
251519
251537
|
}
|
|
@@ -260962,7 +260980,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
260962
260980
|
toRun: runIndex,
|
|
260963
260981
|
toChar: 1,
|
|
260964
260982
|
width: 0,
|
|
260965
|
-
maxFontSize:
|
|
260983
|
+
maxFontSize: lastFontSize,
|
|
260984
|
+
maxFontInfo: hasSeenTextRun ? undefined : fallbackFontInfo,
|
|
260966
260985
|
maxWidth: getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : bodyContentWidth),
|
|
260967
260986
|
segments: [],
|
|
260968
260987
|
spaceCount: 0
|
|
@@ -260977,7 +260996,7 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
260977
260996
|
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
|
|
260978
260997
|
currentLine.width = roundValue(currentLine.width + tabAdvance);
|
|
260979
260998
|
run2.width = tabAdvance;
|
|
260980
|
-
currentLine.maxFontSize = Math.max(currentLine.maxFontSize,
|
|
260999
|
+
currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lastFontSize);
|
|
260981
261000
|
currentLine.toRun = runIndex;
|
|
260982
261001
|
currentLine.toChar = 1;
|
|
260983
261002
|
let currentLeader = null;
|
|
@@ -276999,7 +277018,7 @@ var Node$13 = class Node$14 {
|
|
|
276999
277018
|
missingBoth: s2.missingBoth
|
|
277000
277019
|
});
|
|
277001
277020
|
}
|
|
277002
|
-
}, globalValidationStats, DEFAULT_PPI = 96, DEFAULT_RULER_HEIGHT = 25, TICK_SPACING_PX, RULER_CLASS_NAMES, RULER_STYLES, rulerStylesInjected = false, CLASS_NAMES$1, DEFAULT_PAGE_STYLES, containerStyles, containerStylesHorizontal, spreadStyles, pageStyles = (width, height, overrides) => {
|
|
277021
|
+
}, globalValidationStats, DEFAULT_PPI = 96, DEFAULT_RULER_HEIGHT = 25, TICK_SPACING_PX, RULER_CLASS_NAMES, RULER_STYLES, rulerStylesInjected = false, BROWSER_DEFAULT_FONT_SIZE = "16px", CLASS_NAMES$1, DEFAULT_PAGE_STYLES, containerStyles, containerStylesHorizontal, spreadStyles, pageStyles = (width, height, overrides) => {
|
|
277003
277022
|
const merged = {
|
|
277004
277023
|
...DEFAULT_PAGE_STYLES,
|
|
277005
277024
|
...overrides || {}
|
|
@@ -277020,6 +277039,7 @@ var Node$13 = class Node$14 {
|
|
|
277020
277039
|
}, fragmentStyles, lineStyles = (lineHeight) => ({
|
|
277021
277040
|
lineHeight: `${lineHeight}px`,
|
|
277022
277041
|
height: `${lineHeight}px`,
|
|
277042
|
+
fontSize: "0",
|
|
277023
277043
|
position: "relative",
|
|
277024
277044
|
display: "block",
|
|
277025
277045
|
whiteSpace: "pre",
|
|
@@ -277484,7 +277504,77 @@ var Node$13 = class Node$14 {
|
|
|
277484
277504
|
.superdoc-layout .annotation * {
|
|
277485
277505
|
caret-color: transparent;
|
|
277486
277506
|
}
|
|
277487
|
-
`, IMAGE_SELECTION_STYLES,
|
|
277507
|
+
`, IMAGE_SELECTION_STYLES, MATH_MENCLOSE_STYLES = `
|
|
277508
|
+
/* MathML <menclose> polyfill.
|
|
277509
|
+
*
|
|
277510
|
+
* MathML 3 defined <menclose notation="..."> with borders, strikes, and other
|
|
277511
|
+
* enclosure notations. MathML Core (the subset shipped in Chrome 109+, 2023)
|
|
277512
|
+
* dropped <menclose> — the WG moved its rendering to CSS/SVG. Firefox and
|
|
277513
|
+
* WebKit also do not paint it. Without this polyfill, m:borderBox content
|
|
277514
|
+
* imports correctly (the notation attribute is right) but renders invisibly.
|
|
277515
|
+
*
|
|
277516
|
+
* Each notation token is composable: "box horizontalstrike" draws the box
|
|
277517
|
+
* border and a horizontal strike together. Diagonal strikes layer through
|
|
277518
|
+
* CSS custom properties so X patterns (both diagonals) stack correctly.
|
|
277519
|
+
*
|
|
277520
|
+
* @spec MathML 3 §3.3.8 menclose
|
|
277521
|
+
*/
|
|
277522
|
+
menclose {
|
|
277523
|
+
display: inline-block;
|
|
277524
|
+
position: relative;
|
|
277525
|
+
padding: 0.15em 0.25em;
|
|
277526
|
+
|
|
277527
|
+
--sd-menclose-stroke: currentColor;
|
|
277528
|
+
--sd-menclose-h: none;
|
|
277529
|
+
--sd-menclose-v: none;
|
|
277530
|
+
--sd-menclose-up: none;
|
|
277531
|
+
--sd-menclose-down: none;
|
|
277532
|
+
}
|
|
277533
|
+
|
|
277534
|
+
menclose[notation~="box"] { border: 1px solid var(--sd-menclose-stroke); }
|
|
277535
|
+
menclose[notation~="roundedbox"] { border: 1px solid var(--sd-menclose-stroke); border-radius: 0.3em; }
|
|
277536
|
+
menclose[notation~="top"] { border-top: 1px solid var(--sd-menclose-stroke); }
|
|
277537
|
+
menclose[notation~="bottom"] { border-bottom: 1px solid var(--sd-menclose-stroke); }
|
|
277538
|
+
menclose[notation~="left"] { border-left: 1px solid var(--sd-menclose-stroke); }
|
|
277539
|
+
menclose[notation~="right"] { border-right: 1px solid var(--sd-menclose-stroke); }
|
|
277540
|
+
|
|
277541
|
+
menclose[notation~="horizontalstrike"] {
|
|
277542
|
+
--sd-menclose-h: linear-gradient(var(--sd-menclose-stroke), var(--sd-menclose-stroke)) no-repeat center / 100% 1px;
|
|
277543
|
+
}
|
|
277544
|
+
menclose[notation~="verticalstrike"] {
|
|
277545
|
+
--sd-menclose-v: linear-gradient(var(--sd-menclose-stroke), var(--sd-menclose-stroke)) no-repeat center / 1px 100%;
|
|
277546
|
+
}
|
|
277547
|
+
/* Gradient direction is perpendicular to the stripe it produces.
|
|
277548
|
+
* "to bottom right" → stripe runs bottom-left → top-right (visually "/") = updiagonalstrike.
|
|
277549
|
+
* "to top right" → stripe runs top-left → bottom-right (visually "") = downdiagonalstrike.
|
|
277550
|
+
*/
|
|
277551
|
+
menclose[notation~="updiagonalstrike"] {
|
|
277552
|
+
--sd-menclose-up: linear-gradient(
|
|
277553
|
+
to bottom right,
|
|
277554
|
+
transparent calc(50% - 0.5px),
|
|
277555
|
+
var(--sd-menclose-stroke) calc(50% - 0.5px),
|
|
277556
|
+
var(--sd-menclose-stroke) calc(50% + 0.5px),
|
|
277557
|
+
transparent calc(50% + 0.5px)
|
|
277558
|
+
);
|
|
277559
|
+
}
|
|
277560
|
+
menclose[notation~="downdiagonalstrike"] {
|
|
277561
|
+
--sd-menclose-down: linear-gradient(
|
|
277562
|
+
to top right,
|
|
277563
|
+
transparent calc(50% - 0.5px),
|
|
277564
|
+
var(--sd-menclose-stroke) calc(50% - 0.5px),
|
|
277565
|
+
var(--sd-menclose-stroke) calc(50% + 0.5px),
|
|
277566
|
+
transparent calc(50% + 0.5px)
|
|
277567
|
+
);
|
|
277568
|
+
}
|
|
277569
|
+
|
|
277570
|
+
menclose::after {
|
|
277571
|
+
content: "";
|
|
277572
|
+
position: absolute;
|
|
277573
|
+
inset: 0;
|
|
277574
|
+
pointer-events: none;
|
|
277575
|
+
background: var(--sd-menclose-h), var(--sd-menclose-v), var(--sd-menclose-up), var(--sd-menclose-down);
|
|
277576
|
+
}
|
|
277577
|
+
`, printStylesInjected = false, linkStylesInjected = false, trackChangeStylesInjected = false, sdtContainerStylesInjected = false, fieldAnnotationStylesInjected = false, imageSelectionStylesInjected = false, mathMencloseStylesInjected = false, ensurePrintStyles = (doc$12) => {
|
|
277488
277578
|
if (printStylesInjected || !doc$12)
|
|
277489
277579
|
return;
|
|
277490
277580
|
const styleEl = doc$12.createElement("style");
|
|
@@ -277532,6 +277622,14 @@ var Node$13 = class Node$14 {
|
|
|
277532
277622
|
styleEl.textContent = IMAGE_SELECTION_STYLES;
|
|
277533
277623
|
doc$12.head?.appendChild(styleEl);
|
|
277534
277624
|
imageSelectionStylesInjected = true;
|
|
277625
|
+
}, ensureMathMencloseStyles = (doc$12) => {
|
|
277626
|
+
if (mathMencloseStylesInjected || !doc$12)
|
|
277627
|
+
return;
|
|
277628
|
+
const styleEl = doc$12.createElement("style");
|
|
277629
|
+
styleEl.setAttribute("data-superdoc-math-menclose-styles", "true");
|
|
277630
|
+
styleEl.textContent = MATH_MENCLOSE_STYLES;
|
|
277631
|
+
doc$12.head?.appendChild(styleEl);
|
|
277632
|
+
mathMencloseStylesInjected = true;
|
|
277535
277633
|
}, gradientIdCounter = 0, getFragmentParagraphBorders = (fragment2, blockLookup) => {
|
|
277536
277634
|
const lookup3 = blockLookup.get(fragment2.blockId);
|
|
277537
277635
|
if (!lookup3)
|
|
@@ -278944,7 +279042,7 @@ var Node$13 = class Node$14 {
|
|
|
278944
279042
|
}
|
|
278945
279043
|
element3.style.textAlign = resolveTextAlign(attrs?.alignment, rtl);
|
|
278946
279044
|
return rtl;
|
|
278947
|
-
}, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$
|
|
279045
|
+
}, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$19 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, STY_TO_VARIANT, SCR_TO_VARIANT, convertMathRun = (node3, doc$12) => {
|
|
278948
279046
|
const elements = node3.elements ?? [];
|
|
278949
279047
|
let text5 = "";
|
|
278950
279048
|
for (const child of elements)
|
|
@@ -278958,66 +279056,66 @@ var Node$13 = class Node$14 {
|
|
|
278958
279056
|
return null;
|
|
278959
279057
|
const variant = resolveMathVariant(elements.find((el$1) => el$1.name === "m:rPr"));
|
|
278960
279058
|
const tag = classifyMathText(text5);
|
|
278961
|
-
const el = doc$12.createElementNS(MATHML_NS$
|
|
279059
|
+
const el = doc$12.createElementNS(MATHML_NS$19, tag);
|
|
278962
279060
|
el.textContent = text5;
|
|
278963
279061
|
if (variant)
|
|
278964
279062
|
el.setAttribute("mathvariant", variant);
|
|
278965
279063
|
return el;
|
|
278966
|
-
}, MATHML_NS$
|
|
279064
|
+
}, MATHML_NS$18 = "http://www.w3.org/1998/Math/MathML", convertFraction = (node3, doc$12, convertChildren) => {
|
|
278967
279065
|
const elements = node3.elements ?? [];
|
|
278968
279066
|
const num = elements.find((e) => e.name === "m:num");
|
|
278969
279067
|
const den = elements.find((e) => e.name === "m:den");
|
|
278970
|
-
const frac = doc$12.createElementNS(MATHML_NS$
|
|
278971
|
-
const numRow = doc$12.createElementNS(MATHML_NS$
|
|
279068
|
+
const frac = doc$12.createElementNS(MATHML_NS$18, "mfrac");
|
|
279069
|
+
const numRow = doc$12.createElementNS(MATHML_NS$18, "mrow");
|
|
278972
279070
|
numRow.appendChild(convertChildren(num?.elements ?? []));
|
|
278973
279071
|
frac.appendChild(numRow);
|
|
278974
|
-
const denRow = doc$12.createElementNS(MATHML_NS$
|
|
279072
|
+
const denRow = doc$12.createElementNS(MATHML_NS$18, "mrow");
|
|
278975
279073
|
denRow.appendChild(convertChildren(den?.elements ?? []));
|
|
278976
279074
|
frac.appendChild(denRow);
|
|
278977
279075
|
return frac;
|
|
278978
|
-
}, MATHML_NS$
|
|
279076
|
+
}, MATHML_NS$17 = "http://www.w3.org/1998/Math/MathML", convertBar = (node3, doc$12, convertChildren) => {
|
|
278979
279077
|
const elements = node3.elements ?? [];
|
|
278980
279078
|
const isUnder = elements.find((e) => e.name === "m:barPr")?.elements?.find((e) => e.name === "m:pos")?.attributes?.["m:val"] !== "top";
|
|
278981
279079
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
278982
|
-
const wrapper = doc$12.createElementNS(MATHML_NS$
|
|
279080
|
+
const wrapper = doc$12.createElementNS(MATHML_NS$17, isUnder ? "munder" : "mover");
|
|
278983
279081
|
const baseContent = convertChildren(base5?.elements ?? []);
|
|
278984
|
-
const mrow = doc$12.createElementNS(MATHML_NS$
|
|
279082
|
+
const mrow = doc$12.createElementNS(MATHML_NS$17, "mrow");
|
|
278985
279083
|
mrow.appendChild(baseContent);
|
|
278986
279084
|
wrapper.appendChild(mrow);
|
|
278987
|
-
const accent = doc$12.createElementNS(MATHML_NS$
|
|
279085
|
+
const accent = doc$12.createElementNS(MATHML_NS$17, "mo");
|
|
278988
279086
|
accent.setAttribute("stretchy", "true");
|
|
278989
279087
|
accent.textContent = "‾";
|
|
278990
279088
|
wrapper.appendChild(accent);
|
|
278991
279089
|
return wrapper;
|
|
278992
|
-
}, MATHML_NS$
|
|
279090
|
+
}, MATHML_NS$16 = "http://www.w3.org/1998/Math/MathML", FUNCTION_APPLY_OPERATOR = "", convertFunction = (node3, doc$12, convertChildren) => {
|
|
278993
279091
|
const elements = node3.elements ?? [];
|
|
278994
279092
|
const functionName = elements.find((element3) => element3.name === "m:fName");
|
|
278995
279093
|
const argument = elements.find((element3) => element3.name === "m:e");
|
|
278996
|
-
const wrapper = doc$12.createElementNS(MATHML_NS$
|
|
278997
|
-
const functionNameRow = doc$12.createElementNS(MATHML_NS$
|
|
279094
|
+
const wrapper = doc$12.createElementNS(MATHML_NS$16, "mrow");
|
|
279095
|
+
const functionNameRow = doc$12.createElementNS(MATHML_NS$16, "mrow");
|
|
278998
279096
|
functionNameRow.appendChild(convertChildren(functionName?.elements ?? []));
|
|
278999
279097
|
forceNormalMathVariant(functionNameRow);
|
|
279000
279098
|
if (functionNameRow.childNodes.length > 0)
|
|
279001
279099
|
wrapper.appendChild(functionNameRow);
|
|
279002
|
-
const argumentRow = doc$12.createElementNS(MATHML_NS$
|
|
279100
|
+
const argumentRow = doc$12.createElementNS(MATHML_NS$16, "mrow");
|
|
279003
279101
|
argumentRow.appendChild(convertChildren(argument?.elements ?? []));
|
|
279004
279102
|
if (functionNameRow.childNodes.length > 0 && argumentRow.childNodes.length > 0) {
|
|
279005
|
-
const applyOperator = doc$12.createElementNS(MATHML_NS$
|
|
279103
|
+
const applyOperator = doc$12.createElementNS(MATHML_NS$16, "mo");
|
|
279006
279104
|
applyOperator.textContent = FUNCTION_APPLY_OPERATOR;
|
|
279007
279105
|
wrapper.appendChild(applyOperator);
|
|
279008
279106
|
}
|
|
279009
279107
|
if (argumentRow.childNodes.length > 0)
|
|
279010
279108
|
wrapper.appendChild(argumentRow);
|
|
279011
279109
|
return wrapper.childNodes.length > 0 ? wrapper : null;
|
|
279012
|
-
}, MATHML_NS$
|
|
279110
|
+
}, MATHML_NS$15 = "http://www.w3.org/1998/Math/MathML", DEFAULT_BEGIN_DELIMITER = "(", DEFAULT_END_DELIMITER = ")", DEFAULT_SEPARATOR_DELIMITER = "│", convertDelimiter = (node3, doc$12, convertChildren) => {
|
|
279013
279111
|
const elements = node3.elements ?? [];
|
|
279014
279112
|
const delimiterProps = elements.find((element3) => element3.name === "m:dPr");
|
|
279015
279113
|
const expressions = elements.filter((element3) => element3.name === "m:e");
|
|
279016
279114
|
const beginDelimiter = getDelimiterValue(delimiterProps, "m:begChr", DEFAULT_BEGIN_DELIMITER);
|
|
279017
279115
|
const endDelimiter = getDelimiterValue(delimiterProps, "m:endChr", DEFAULT_END_DELIMITER);
|
|
279018
279116
|
const separatorDelimiter = getDelimiterValue(delimiterProps, "m:sepChr", DEFAULT_SEPARATOR_DELIMITER);
|
|
279019
|
-
const wrapper = doc$12.createElementNS(MATHML_NS$
|
|
279020
|
-
const begin = doc$12.createElementNS(MATHML_NS$
|
|
279117
|
+
const wrapper = doc$12.createElementNS(MATHML_NS$15, "mrow");
|
|
279118
|
+
const begin = doc$12.createElementNS(MATHML_NS$15, "mo");
|
|
279021
279119
|
begin.textContent = beginDelimiter;
|
|
279022
279120
|
wrapper.appendChild(begin);
|
|
279023
279121
|
let renderedCount = 0;
|
|
@@ -279026,60 +279124,60 @@ var Node$13 = class Node$14 {
|
|
|
279026
279124
|
if (fragment2.childNodes.length === 0)
|
|
279027
279125
|
continue;
|
|
279028
279126
|
if (renderedCount > 0) {
|
|
279029
|
-
const separator = doc$12.createElementNS(MATHML_NS$
|
|
279127
|
+
const separator = doc$12.createElementNS(MATHML_NS$15, "mo");
|
|
279030
279128
|
separator.textContent = separatorDelimiter;
|
|
279031
279129
|
wrapper.appendChild(separator);
|
|
279032
279130
|
}
|
|
279033
|
-
const group = doc$12.createElementNS(MATHML_NS$
|
|
279131
|
+
const group = doc$12.createElementNS(MATHML_NS$15, "mrow");
|
|
279034
279132
|
group.appendChild(fragment2);
|
|
279035
279133
|
wrapper.appendChild(group);
|
|
279036
279134
|
renderedCount++;
|
|
279037
279135
|
}
|
|
279038
|
-
const end$1 = doc$12.createElementNS(MATHML_NS$
|
|
279136
|
+
const end$1 = doc$12.createElementNS(MATHML_NS$15, "mo");
|
|
279039
279137
|
end$1.textContent = endDelimiter;
|
|
279040
279138
|
wrapper.appendChild(end$1);
|
|
279041
279139
|
return wrapper;
|
|
279042
|
-
}, MATHML_NS$
|
|
279140
|
+
}, MATHML_NS$14 = "http://www.w3.org/1998/Math/MathML", convertSubscript = (node3, doc$12, convertChildren) => {
|
|
279043
279141
|
const elements = node3.elements ?? [];
|
|
279044
279142
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279045
279143
|
const sub = elements.find((e) => e.name === "m:sub");
|
|
279046
|
-
const msub = doc$12.createElementNS(MATHML_NS$
|
|
279047
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279144
|
+
const msub = doc$12.createElementNS(MATHML_NS$14, "msub");
|
|
279145
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$14, "mrow");
|
|
279048
279146
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279049
279147
|
msub.appendChild(baseRow);
|
|
279050
|
-
const subRow = doc$12.createElementNS(MATHML_NS$
|
|
279148
|
+
const subRow = doc$12.createElementNS(MATHML_NS$14, "mrow");
|
|
279051
279149
|
subRow.appendChild(convertChildren(sub?.elements ?? []));
|
|
279052
279150
|
msub.appendChild(subRow);
|
|
279053
279151
|
return msub;
|
|
279054
|
-
}, MATHML_NS$
|
|
279152
|
+
}, MATHML_NS$13 = "http://www.w3.org/1998/Math/MathML", convertSuperscript = (node3, doc$12, convertChildren) => {
|
|
279055
279153
|
const elements = node3.elements ?? [];
|
|
279056
279154
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279057
279155
|
const sup = elements.find((e) => e.name === "m:sup");
|
|
279058
|
-
const msup = doc$12.createElementNS(MATHML_NS$
|
|
279059
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279156
|
+
const msup = doc$12.createElementNS(MATHML_NS$13, "msup");
|
|
279157
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$13, "mrow");
|
|
279060
279158
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279061
279159
|
msup.appendChild(baseRow);
|
|
279062
|
-
const supRow = doc$12.createElementNS(MATHML_NS$
|
|
279160
|
+
const supRow = doc$12.createElementNS(MATHML_NS$13, "mrow");
|
|
279063
279161
|
supRow.appendChild(convertChildren(sup?.elements ?? []));
|
|
279064
279162
|
msup.appendChild(supRow);
|
|
279065
279163
|
return msup;
|
|
279066
|
-
}, MATHML_NS$
|
|
279164
|
+
}, MATHML_NS$12 = "http://www.w3.org/1998/Math/MathML", convertSubSuperscript = (node3, doc$12, convertChildren) => {
|
|
279067
279165
|
const elements = node3.elements ?? [];
|
|
279068
279166
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279069
279167
|
const sub = elements.find((e) => e.name === "m:sub");
|
|
279070
279168
|
const sup = elements.find((e) => e.name === "m:sup");
|
|
279071
|
-
const msubsup = doc$12.createElementNS(MATHML_NS$
|
|
279072
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279169
|
+
const msubsup = doc$12.createElementNS(MATHML_NS$12, "msubsup");
|
|
279170
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$12, "mrow");
|
|
279073
279171
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279074
279172
|
msubsup.appendChild(baseRow);
|
|
279075
|
-
const subRow = doc$12.createElementNS(MATHML_NS$
|
|
279173
|
+
const subRow = doc$12.createElementNS(MATHML_NS$12, "mrow");
|
|
279076
279174
|
subRow.appendChild(convertChildren(sub?.elements ?? []));
|
|
279077
279175
|
msubsup.appendChild(subRow);
|
|
279078
|
-
const supRow = doc$12.createElementNS(MATHML_NS$
|
|
279176
|
+
const supRow = doc$12.createElementNS(MATHML_NS$12, "mrow");
|
|
279079
279177
|
supRow.appendChild(convertChildren(sup?.elements ?? []));
|
|
279080
279178
|
msubsup.appendChild(supRow);
|
|
279081
279179
|
return msubsup;
|
|
279082
|
-
}, MATHML_NS$
|
|
279180
|
+
}, MATHML_NS$11 = "http://www.w3.org/1998/Math/MathML", DEFAULT_ACCENT_CHAR = "̂", COMBINING_TO_SPACING, convertAccent = (node3, doc$12, convertChildren) => {
|
|
279083
279181
|
const elements = node3.elements ?? [];
|
|
279084
279182
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279085
279183
|
if (!base5)
|
|
@@ -279087,37 +279185,37 @@ var Node$13 = class Node$14 {
|
|
|
279087
279185
|
const chr = elements.find((e) => e.name === "m:accPr")?.elements?.find((e) => e.name === "m:chr");
|
|
279088
279186
|
const rawVal = chr?.attributes?.["m:val"];
|
|
279089
279187
|
const accentChar = chr === undefined ? DEFAULT_ACCENT_CHAR : rawVal && rawVal.length > 0 ? rawVal : "";
|
|
279090
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279188
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$11, "mrow");
|
|
279091
279189
|
baseRow.appendChild(convertChildren(base5.elements ?? []));
|
|
279092
279190
|
if (!accentChar)
|
|
279093
279191
|
return baseRow;
|
|
279094
279192
|
const renderChar = COMBINING_TO_SPACING[accentChar] ?? accentChar;
|
|
279095
|
-
const mover = doc$12.createElementNS(MATHML_NS$
|
|
279193
|
+
const mover = doc$12.createElementNS(MATHML_NS$11, "mover");
|
|
279096
279194
|
mover.setAttribute("accent", "true");
|
|
279097
279195
|
mover.appendChild(baseRow);
|
|
279098
|
-
const mo = doc$12.createElementNS(MATHML_NS$
|
|
279196
|
+
const mo = doc$12.createElementNS(MATHML_NS$11, "mo");
|
|
279099
279197
|
mo.setAttribute("stretchy", "true");
|
|
279100
279198
|
mo.textContent = renderChar;
|
|
279101
279199
|
mover.appendChild(mo);
|
|
279102
279200
|
return mover;
|
|
279103
|
-
}, MATHML_NS$
|
|
279201
|
+
}, MATHML_NS$10 = "http://www.w3.org/1998/Math/MathML", convertPreSubSuperscript = (node3, doc$12, convertChildren) => {
|
|
279104
279202
|
const elements = node3.elements ?? [];
|
|
279105
279203
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279106
279204
|
const sub = elements.find((e) => e.name === "m:sub");
|
|
279107
279205
|
const sup = elements.find((e) => e.name === "m:sup");
|
|
279108
|
-
const mmultiscripts = doc$12.createElementNS(MATHML_NS$
|
|
279109
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279206
|
+
const mmultiscripts = doc$12.createElementNS(MATHML_NS$10, "mmultiscripts");
|
|
279207
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$10, "mrow");
|
|
279110
279208
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279111
279209
|
mmultiscripts.appendChild(baseRow);
|
|
279112
|
-
mmultiscripts.appendChild(doc$12.createElementNS(MATHML_NS$
|
|
279113
|
-
const subRow = doc$12.createElementNS(MATHML_NS$
|
|
279210
|
+
mmultiscripts.appendChild(doc$12.createElementNS(MATHML_NS$10, "mprescripts"));
|
|
279211
|
+
const subRow = doc$12.createElementNS(MATHML_NS$10, "mrow");
|
|
279114
279212
|
subRow.appendChild(convertChildren(sub?.elements ?? []));
|
|
279115
279213
|
mmultiscripts.appendChild(subRow);
|
|
279116
|
-
const supRow = doc$12.createElementNS(MATHML_NS$
|
|
279214
|
+
const supRow = doc$12.createElementNS(MATHML_NS$10, "mrow");
|
|
279117
279215
|
supRow.appendChild(convertChildren(sup?.elements ?? []));
|
|
279118
279216
|
mmultiscripts.appendChild(supRow);
|
|
279119
279217
|
return mmultiscripts;
|
|
279120
|
-
}, MATHML_NS$
|
|
279218
|
+
}, MATHML_NS$9 = "http://www.w3.org/1998/Math/MathML", stripAlignmentMarkers = (nodes) => nodes.map((node3) => {
|
|
279121
279219
|
if (node3?.type === "text" && typeof node3.text === "string" && node3.text.includes("&"))
|
|
279122
279220
|
return {
|
|
279123
279221
|
...node3,
|
|
@@ -279131,12 +279229,12 @@ var Node$13 = class Node$14 {
|
|
|
279131
279229
|
return node3;
|
|
279132
279230
|
}), convertEquationArray = (node3, doc$12, convertChildren) => {
|
|
279133
279231
|
const rows = (node3.elements ?? []).filter((e) => e.name === "m:e");
|
|
279134
|
-
const mtable = doc$12.createElementNS(MATHML_NS$
|
|
279232
|
+
const mtable = doc$12.createElementNS(MATHML_NS$9, "mtable");
|
|
279135
279233
|
mtable.setAttribute("columnalign", "left");
|
|
279136
279234
|
for (const row2 of rows) {
|
|
279137
|
-
const mtr = doc$12.createElementNS(MATHML_NS$
|
|
279138
|
-
const mtd = doc$12.createElementNS(MATHML_NS$
|
|
279139
|
-
const mrow = doc$12.createElementNS(MATHML_NS$
|
|
279235
|
+
const mtr = doc$12.createElementNS(MATHML_NS$9, "mtr");
|
|
279236
|
+
const mtd = doc$12.createElementNS(MATHML_NS$9, "mtd");
|
|
279237
|
+
const mrow = doc$12.createElementNS(MATHML_NS$9, "mrow");
|
|
279140
279238
|
const cleanedChildren = stripAlignmentMarkers(row2.elements ?? []);
|
|
279141
279239
|
mrow.appendChild(convertChildren(cleanedChildren));
|
|
279142
279240
|
mtd.appendChild(mrow);
|
|
@@ -279144,7 +279242,7 @@ var Node$13 = class Node$14 {
|
|
|
279144
279242
|
mtable.appendChild(mtr);
|
|
279145
279243
|
}
|
|
279146
279244
|
return mtable.childNodes.length > 0 ? mtable : null;
|
|
279147
|
-
}, MATHML_NS$
|
|
279245
|
+
}, MATHML_NS$8 = "http://www.w3.org/1998/Math/MathML", convertRadical = (node3, doc$12, convertChildren) => {
|
|
279148
279246
|
const elements = node3.elements ?? [];
|
|
279149
279247
|
const radPr = elements.find((e) => e.name === "m:radPr");
|
|
279150
279248
|
const deg = elements.find((e) => e.name === "m:deg");
|
|
@@ -279152,45 +279250,45 @@ var Node$13 = class Node$14 {
|
|
|
279152
279250
|
const degHideEl = radPr?.elements?.find((e) => e.name === "m:degHide");
|
|
279153
279251
|
const degHideVal = degHideEl?.attributes?.["m:val"];
|
|
279154
279252
|
if (degHideEl !== undefined && degHideVal !== "0" && degHideVal !== "false" && degHideVal !== "off" || !deg || (deg.elements ?? []).length === 0) {
|
|
279155
|
-
const msqrt = doc$12.createElementNS(MATHML_NS$
|
|
279156
|
-
const radicandRow$1 = doc$12.createElementNS(MATHML_NS$
|
|
279253
|
+
const msqrt = doc$12.createElementNS(MATHML_NS$8, "msqrt");
|
|
279254
|
+
const radicandRow$1 = doc$12.createElementNS(MATHML_NS$8, "mrow");
|
|
279157
279255
|
radicandRow$1.appendChild(convertChildren(radicand?.elements ?? []));
|
|
279158
279256
|
msqrt.appendChild(radicandRow$1);
|
|
279159
279257
|
return msqrt;
|
|
279160
279258
|
}
|
|
279161
|
-
const mroot = doc$12.createElementNS(MATHML_NS$
|
|
279162
|
-
const radicandRow = doc$12.createElementNS(MATHML_NS$
|
|
279259
|
+
const mroot = doc$12.createElementNS(MATHML_NS$8, "mroot");
|
|
279260
|
+
const radicandRow = doc$12.createElementNS(MATHML_NS$8, "mrow");
|
|
279163
279261
|
radicandRow.appendChild(convertChildren(radicand?.elements ?? []));
|
|
279164
279262
|
mroot.appendChild(radicandRow);
|
|
279165
|
-
const degRow = doc$12.createElementNS(MATHML_NS$
|
|
279263
|
+
const degRow = doc$12.createElementNS(MATHML_NS$8, "mrow");
|
|
279166
279264
|
degRow.appendChild(convertChildren(deg?.elements ?? []));
|
|
279167
279265
|
mroot.appendChild(degRow);
|
|
279168
279266
|
return mroot;
|
|
279169
|
-
}, MATHML_NS$
|
|
279267
|
+
}, MATHML_NS$7 = "http://www.w3.org/1998/Math/MathML", convertLowerLimit = (node3, doc$12, convertChildren) => {
|
|
279170
279268
|
const elements = node3.elements ?? [];
|
|
279171
279269
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279172
279270
|
const lim = elements.find((e) => e.name === "m:lim");
|
|
279173
|
-
const munder = doc$12.createElementNS(MATHML_NS$
|
|
279174
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279271
|
+
const munder = doc$12.createElementNS(MATHML_NS$7, "munder");
|
|
279272
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$7, "mrow");
|
|
279175
279273
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279176
279274
|
munder.appendChild(baseRow);
|
|
279177
|
-
const limRow = doc$12.createElementNS(MATHML_NS$
|
|
279275
|
+
const limRow = doc$12.createElementNS(MATHML_NS$7, "mrow");
|
|
279178
279276
|
limRow.appendChild(convertChildren(lim?.elements ?? []));
|
|
279179
279277
|
munder.appendChild(limRow);
|
|
279180
279278
|
return munder;
|
|
279181
|
-
}, MATHML_NS$
|
|
279279
|
+
}, MATHML_NS$6 = "http://www.w3.org/1998/Math/MathML", convertUpperLimit = (node3, doc$12, convertChildren) => {
|
|
279182
279280
|
const elements = node3.elements ?? [];
|
|
279183
279281
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
279184
279282
|
const lim = elements.find((e) => e.name === "m:lim");
|
|
279185
|
-
const mover = doc$12.createElementNS(MATHML_NS$
|
|
279186
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279283
|
+
const mover = doc$12.createElementNS(MATHML_NS$6, "mover");
|
|
279284
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$6, "mrow");
|
|
279187
279285
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279188
279286
|
mover.appendChild(baseRow);
|
|
279189
|
-
const limRow = doc$12.createElementNS(MATHML_NS$
|
|
279287
|
+
const limRow = doc$12.createElementNS(MATHML_NS$6, "mrow");
|
|
279190
279288
|
limRow.appendChild(convertChildren(lim?.elements ?? []));
|
|
279191
279289
|
mover.appendChild(limRow);
|
|
279192
279290
|
return mover;
|
|
279193
|
-
}, MATHML_NS$
|
|
279291
|
+
}, MATHML_NS$5 = "http://www.w3.org/1998/Math/MathML", DEFAULT_NARY_CHAR = "∫", INTEGRAL_CHARS, convertNary = (node3, doc$12, convertChildren) => {
|
|
279194
279292
|
const elements = node3.elements ?? [];
|
|
279195
279293
|
const naryPr = elements.find((e) => e.name === "m:naryPr");
|
|
279196
279294
|
const sub = elements.find((e) => e.name === "m:sub");
|
|
@@ -279217,7 +279315,7 @@ var Node$13 = class Node$14 {
|
|
|
279217
279315
|
const hasSub = renderSubChildren.length > 0 || sub !== undefined && !subHidden;
|
|
279218
279316
|
const hasSup = renderSupChildren.length > 0 || sup !== undefined && !supHidden;
|
|
279219
279317
|
const growOff = grow !== undefined && !isStOnOffTrue(grow);
|
|
279220
|
-
const mo = doc$12.createElementNS(MATHML_NS$
|
|
279318
|
+
const mo = doc$12.createElementNS(MATHML_NS$5, "mo");
|
|
279221
279319
|
mo.textContent = opChar;
|
|
279222
279320
|
if (growOff) {
|
|
279223
279321
|
mo.setAttribute("largeop", "false");
|
|
@@ -279226,38 +279324,38 @@ var Node$13 = class Node$14 {
|
|
|
279226
279324
|
let operatorEl;
|
|
279227
279325
|
if (hasSub && hasSup) {
|
|
279228
279326
|
const tag = isUndOvr ? "munderover" : "msubsup";
|
|
279229
|
-
operatorEl = doc$12.createElementNS(MATHML_NS$
|
|
279327
|
+
operatorEl = doc$12.createElementNS(MATHML_NS$5, tag);
|
|
279230
279328
|
operatorEl.appendChild(mo);
|
|
279231
|
-
const subRow = doc$12.createElementNS(MATHML_NS$
|
|
279329
|
+
const subRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279232
279330
|
subRow.appendChild(convertChildren(renderSubChildren));
|
|
279233
279331
|
operatorEl.appendChild(subRow);
|
|
279234
|
-
const supRow = doc$12.createElementNS(MATHML_NS$
|
|
279332
|
+
const supRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279235
279333
|
supRow.appendChild(convertChildren(renderSupChildren));
|
|
279236
279334
|
operatorEl.appendChild(supRow);
|
|
279237
279335
|
} else if (hasSub) {
|
|
279238
279336
|
const tag = isUndOvr ? "munder" : "msub";
|
|
279239
|
-
operatorEl = doc$12.createElementNS(MATHML_NS$
|
|
279337
|
+
operatorEl = doc$12.createElementNS(MATHML_NS$5, tag);
|
|
279240
279338
|
operatorEl.appendChild(mo);
|
|
279241
|
-
const subRow = doc$12.createElementNS(MATHML_NS$
|
|
279339
|
+
const subRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279242
279340
|
subRow.appendChild(convertChildren(renderSubChildren));
|
|
279243
279341
|
operatorEl.appendChild(subRow);
|
|
279244
279342
|
} else if (hasSup) {
|
|
279245
279343
|
const tag = isUndOvr ? "mover" : "msup";
|
|
279246
|
-
operatorEl = doc$12.createElementNS(MATHML_NS$
|
|
279344
|
+
operatorEl = doc$12.createElementNS(MATHML_NS$5, tag);
|
|
279247
279345
|
operatorEl.appendChild(mo);
|
|
279248
|
-
const supRow = doc$12.createElementNS(MATHML_NS$
|
|
279346
|
+
const supRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279249
279347
|
supRow.appendChild(convertChildren(renderSupChildren));
|
|
279250
279348
|
operatorEl.appendChild(supRow);
|
|
279251
279349
|
} else
|
|
279252
279350
|
operatorEl = mo;
|
|
279253
|
-
const wrapper = doc$12.createElementNS(MATHML_NS$
|
|
279351
|
+
const wrapper = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279254
279352
|
wrapper.appendChild(operatorEl);
|
|
279255
|
-
const bodyRow = doc$12.createElementNS(MATHML_NS$
|
|
279353
|
+
const bodyRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
|
|
279256
279354
|
bodyRow.appendChild(convertChildren(body?.elements ?? []));
|
|
279257
279355
|
if (bodyRow.childNodes.length > 0)
|
|
279258
279356
|
wrapper.appendChild(bodyRow);
|
|
279259
279357
|
return wrapper;
|
|
279260
|
-
}, MATHML_NS$
|
|
279358
|
+
}, MATHML_NS$4 = "http://www.w3.org/1998/Math/MathML", convertPhantom = (node3, doc$12, convertChildren) => {
|
|
279261
279359
|
const elements = node3.elements ?? [];
|
|
279262
279360
|
const phantPr = elements.find((e) => e.name === "m:phantPr");
|
|
279263
279361
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
@@ -279270,11 +279368,11 @@ var Node$13 = class Node$14 {
|
|
|
279270
279368
|
const hasZeroDimension = zeroWid || zeroAsc || zeroDesc;
|
|
279271
279369
|
const content3 = convertChildren(base5?.elements ?? []);
|
|
279272
279370
|
if (!isVisible$1 && !hasZeroDimension) {
|
|
279273
|
-
const mphantom = doc$12.createElementNS(MATHML_NS$
|
|
279371
|
+
const mphantom = doc$12.createElementNS(MATHML_NS$4, "mphantom");
|
|
279274
279372
|
mphantom.appendChild(content3);
|
|
279275
279373
|
return mphantom;
|
|
279276
279374
|
}
|
|
279277
|
-
const mpadded = doc$12.createElementNS(MATHML_NS$
|
|
279375
|
+
const mpadded = doc$12.createElementNS(MATHML_NS$4, "mpadded");
|
|
279278
279376
|
const isZeroVal = (el) => el && (isOnOffTrue(el.attributes?.["m:val"]) || !el.attributes);
|
|
279279
279377
|
if (isZeroVal(zeroWid))
|
|
279280
279378
|
mpadded.setAttribute("width", "0");
|
|
@@ -279283,13 +279381,13 @@ var Node$13 = class Node$14 {
|
|
|
279283
279381
|
if (isZeroVal(zeroDesc))
|
|
279284
279382
|
mpadded.setAttribute("depth", "0");
|
|
279285
279383
|
if (!isVisible$1) {
|
|
279286
|
-
const mphantom = doc$12.createElementNS(MATHML_NS$
|
|
279384
|
+
const mphantom = doc$12.createElementNS(MATHML_NS$4, "mphantom");
|
|
279287
279385
|
mphantom.appendChild(content3);
|
|
279288
279386
|
mpadded.appendChild(mphantom);
|
|
279289
279387
|
} else
|
|
279290
279388
|
mpadded.appendChild(content3);
|
|
279291
279389
|
return mpadded;
|
|
279292
|
-
}, MATHML_NS$
|
|
279390
|
+
}, MATHML_NS$3 = "http://www.w3.org/1998/Math/MathML", DEFAULT_GROUP_CHAR = "⏟", VERT_JC_SHIFT_EM = 1, convertGroupCharacter = (node3, doc$12, convertChildren) => {
|
|
279293
279391
|
const elements = node3.elements ?? [];
|
|
279294
279392
|
const groupChrPr = elements.find((e) => e.name === "m:groupChrPr");
|
|
279295
279393
|
const base5 = elements.find((e) => e.name === "m:e");
|
|
@@ -279299,11 +279397,11 @@ var Node$13 = class Node$14 {
|
|
|
279299
279397
|
const groupChar = chr ? chr.attributes?.["m:val"] ?? "" : DEFAULT_GROUP_CHAR;
|
|
279300
279398
|
const position4 = pos?.attributes?.["m:val"] ?? "bot";
|
|
279301
279399
|
const vertJustify = vertJc ? vertJc.attributes?.["m:val"] ?? "bot" : null;
|
|
279302
|
-
const wrapper = doc$12.createElementNS(MATHML_NS$
|
|
279303
|
-
const baseRow = doc$12.createElementNS(MATHML_NS$
|
|
279400
|
+
const wrapper = doc$12.createElementNS(MATHML_NS$3, position4 === "top" ? "mover" : "munder");
|
|
279401
|
+
const baseRow = doc$12.createElementNS(MATHML_NS$3, "mrow");
|
|
279304
279402
|
baseRow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279305
279403
|
wrapper.appendChild(baseRow);
|
|
279306
|
-
const mo = doc$12.createElementNS(MATHML_NS$
|
|
279404
|
+
const mo = doc$12.createElementNS(MATHML_NS$3, "mo");
|
|
279307
279405
|
mo.setAttribute("stretchy", "true");
|
|
279308
279406
|
mo.textContent = groupChar;
|
|
279309
279407
|
wrapper.appendChild(mo);
|
|
@@ -279315,21 +279413,21 @@ var Node$13 = class Node$14 {
|
|
|
279315
279413
|
}
|
|
279316
279414
|
}
|
|
279317
279415
|
return wrapper;
|
|
279318
|
-
}, MATHML_NS$
|
|
279416
|
+
}, MATHML_NS$2 = "http://www.w3.org/1998/Math/MathML", EMPTY_CELL_PLACEHOLDER = "□", convertMatrix = (node3, doc$12, convertChildren) => {
|
|
279319
279417
|
const elements = node3.elements ?? [];
|
|
279320
279418
|
const rows = elements.filter((e) => e.name === "m:mr");
|
|
279321
279419
|
const plcHide = elements.find((e) => e.name === "m:mPr")?.elements?.find((e) => e.name === "m:plcHide");
|
|
279322
279420
|
const hidePlaceholders = isPlaceholderHidden(plcHide);
|
|
279323
|
-
const mtable = doc$12.createElementNS(MATHML_NS$
|
|
279421
|
+
const mtable = doc$12.createElementNS(MATHML_NS$2, "mtable");
|
|
279324
279422
|
for (const row2 of rows) {
|
|
279325
|
-
const mtr = doc$12.createElementNS(MATHML_NS$
|
|
279423
|
+
const mtr = doc$12.createElementNS(MATHML_NS$2, "mtr");
|
|
279326
279424
|
const cells = row2.elements?.filter((e) => e.name === "m:e") ?? [];
|
|
279327
279425
|
for (const cell2 of cells) {
|
|
279328
|
-
const mtd = doc$12.createElementNS(MATHML_NS$
|
|
279329
|
-
const mrow = doc$12.createElementNS(MATHML_NS$
|
|
279426
|
+
const mtd = doc$12.createElementNS(MATHML_NS$2, "mtd");
|
|
279427
|
+
const mrow = doc$12.createElementNS(MATHML_NS$2, "mrow");
|
|
279330
279428
|
const fragment2 = convertChildren(cell2.elements ?? []);
|
|
279331
279429
|
if (fragment2.childNodes.length === 0 && !hidePlaceholders) {
|
|
279332
|
-
const placeholder = doc$12.createElementNS(MATHML_NS$
|
|
279430
|
+
const placeholder = doc$12.createElementNS(MATHML_NS$2, "mi");
|
|
279333
279431
|
placeholder.textContent = EMPTY_CELL_PLACEHOLDER;
|
|
279334
279432
|
mrow.appendChild(placeholder);
|
|
279335
279433
|
} else
|
|
@@ -279340,6 +279438,67 @@ var Node$13 = class Node$14 {
|
|
|
279340
279438
|
mtable.appendChild(mtr);
|
|
279341
279439
|
}
|
|
279342
279440
|
return mtable.childNodes.length > 0 ? mtable : null;
|
|
279441
|
+
}, MATHML_NS$1 = "http://www.w3.org/1998/Math/MathML", convertBox = (node3, doc$12, convertChildren) => {
|
|
279442
|
+
const base5 = (node3.elements ?? []).find((e) => e.name === "m:e");
|
|
279443
|
+
const mrow = doc$12.createElementNS(MATHML_NS$1, "mrow");
|
|
279444
|
+
mrow.appendChild(convertChildren(base5?.elements ?? []));
|
|
279445
|
+
return mrow.childNodes.length > 0 ? mrow : null;
|
|
279446
|
+
}, convertBorderBox = (node3, doc$12, convertChildren) => {
|
|
279447
|
+
const elements = node3.elements ?? [];
|
|
279448
|
+
const props = elements.find((e) => e.name === "m:borderBoxPr");
|
|
279449
|
+
const base5 = elements.find((e) => e.name === "m:e");
|
|
279450
|
+
const isOn = (el) => {
|
|
279451
|
+
if (!el)
|
|
279452
|
+
return false;
|
|
279453
|
+
const val = el.attributes?.["m:val"];
|
|
279454
|
+
if (val === undefined)
|
|
279455
|
+
return true;
|
|
279456
|
+
return val === "1" || val === "true" || val === "on";
|
|
279457
|
+
};
|
|
279458
|
+
const hideTop = props?.elements?.find((e) => e.name === "m:hideTop");
|
|
279459
|
+
const hideBot = props?.elements?.find((e) => e.name === "m:hideBot");
|
|
279460
|
+
const hideLeft = props?.elements?.find((e) => e.name === "m:hideLeft");
|
|
279461
|
+
const hideRight = props?.elements?.find((e) => e.name === "m:hideRight");
|
|
279462
|
+
const strikeBLTR = props?.elements?.find((e) => e.name === "m:strikeBLTR");
|
|
279463
|
+
const strikeH = props?.elements?.find((e) => e.name === "m:strikeH");
|
|
279464
|
+
const strikeTLBR = props?.elements?.find((e) => e.name === "m:strikeTLBR");
|
|
279465
|
+
const strikeV = props?.elements?.find((e) => e.name === "m:strikeV");
|
|
279466
|
+
const notations = [];
|
|
279467
|
+
if (!(isOn(hideTop) && isOn(hideBot) && isOn(hideLeft) && isOn(hideRight)))
|
|
279468
|
+
if (!isOn(hideTop) && !isOn(hideBot) && !isOn(hideLeft) && !isOn(hideRight))
|
|
279469
|
+
notations.push("box");
|
|
279470
|
+
else {
|
|
279471
|
+
if (!isOn(hideTop))
|
|
279472
|
+
notations.push("top");
|
|
279473
|
+
if (!isOn(hideBot))
|
|
279474
|
+
notations.push("bottom");
|
|
279475
|
+
if (!isOn(hideLeft))
|
|
279476
|
+
notations.push("left");
|
|
279477
|
+
if (!isOn(hideRight))
|
|
279478
|
+
notations.push("right");
|
|
279479
|
+
}
|
|
279480
|
+
if (isOn(strikeBLTR))
|
|
279481
|
+
notations.push("updiagonalstrike");
|
|
279482
|
+
if (isOn(strikeH))
|
|
279483
|
+
notations.push("horizontalstrike");
|
|
279484
|
+
if (isOn(strikeTLBR))
|
|
279485
|
+
notations.push("downdiagonalstrike");
|
|
279486
|
+
if (isOn(strikeV))
|
|
279487
|
+
notations.push("verticalstrike");
|
|
279488
|
+
const content3 = convertChildren(base5?.elements ?? []);
|
|
279489
|
+
if (content3.childNodes.length === 0)
|
|
279490
|
+
return null;
|
|
279491
|
+
if (notations.length === 0) {
|
|
279492
|
+
const mrow = doc$12.createElementNS(MATHML_NS$1, "mrow");
|
|
279493
|
+
mrow.appendChild(content3);
|
|
279494
|
+
return mrow;
|
|
279495
|
+
}
|
|
279496
|
+
const innerMrow = doc$12.createElementNS(MATHML_NS$1, "mrow");
|
|
279497
|
+
innerMrow.appendChild(content3);
|
|
279498
|
+
const menclose = doc$12.createElementNS(MATHML_NS$1, "menclose");
|
|
279499
|
+
menclose.setAttribute("notation", notations.join(" "));
|
|
279500
|
+
menclose.appendChild(innerMrow);
|
|
279501
|
+
return menclose;
|
|
279343
279502
|
}, MATHML_NS = "http://www.w3.org/1998/Math/MathML", MATH_OBJECT_REGISTRY, ARGUMENT_ELEMENTS, LIST_MARKER_GAP$1 = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, SVG_NS = "http://www.w3.org/2000/svg", WORDART_LINE_FILL_RATIO = 0.9, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor$1 = (value) => {
|
|
279344
279503
|
if (typeof value !== "string")
|
|
279345
279504
|
return null;
|
|
@@ -289575,7 +289734,7 @@ var Node$13 = class Node$14 {
|
|
|
289575
289734
|
return;
|
|
289576
289735
|
console.log(...args$1);
|
|
289577
289736
|
}, 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;
|
|
289578
|
-
var
|
|
289737
|
+
var init_src_BSdWFICK_es = __esm(() => {
|
|
289579
289738
|
init_rolldown_runtime_Bg48TavK_es();
|
|
289580
289739
|
init_SuperConverter_CpoUNyba_es();
|
|
289581
289740
|
init_jszip_C49i9kUs_es();
|
|
@@ -315246,8 +315405,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
315246
315405
|
"m:sSup": convertSuperscript,
|
|
315247
315406
|
"m:sSubSup": convertSubSuperscript,
|
|
315248
315407
|
"m:sPre": convertPreSubSuperscript,
|
|
315249
|
-
"m:borderBox":
|
|
315250
|
-
"m:box":
|
|
315408
|
+
"m:borderBox": convertBorderBox,
|
|
315409
|
+
"m:box": convertBox,
|
|
315251
315410
|
"m:groupChr": convertGroupCharacter
|
|
315252
315411
|
};
|
|
315253
315412
|
ARGUMENT_ELEMENTS = new Set([
|
|
@@ -315614,6 +315773,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
315614
315773
|
ensureFieldAnnotationStyles(doc$12);
|
|
315615
315774
|
ensureSdtContainerStyles(doc$12);
|
|
315616
315775
|
ensureImageSelectionStyles(doc$12);
|
|
315776
|
+
ensureMathMencloseStyles(doc$12);
|
|
315617
315777
|
if (!this.isSemanticFlow && this.options.ruler?.enabled)
|
|
315618
315778
|
ensureRulerStyles(doc$12);
|
|
315619
315779
|
mount.classList.add(CLASS_NAMES$1.container);
|
|
@@ -317973,6 +318133,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
317973
318133
|
wrapper.style.verticalAlign = "middle";
|
|
317974
318134
|
wrapper.style.minWidth = `${run2.width}px`;
|
|
317975
318135
|
wrapper.style.minHeight = `${run2.height}px`;
|
|
318136
|
+
wrapper.style.fontSize = BROWSER_DEFAULT_FONT_SIZE;
|
|
317976
318137
|
wrapper.dataset.layoutEpoch = String(this.layoutEpoch ?? 0);
|
|
317977
318138
|
const mathEl = convertOmmlToMathml(run2.ommlJson, this.doc);
|
|
317978
318139
|
if (mathEl)
|
|
@@ -318255,8 +318416,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
318255
318416
|
}
|
|
318256
318417
|
if (run2.fontFamily)
|
|
318257
318418
|
annotation.style.fontFamily = run2.fontFamily;
|
|
318258
|
-
|
|
318259
|
-
const fontSize = typeof run2.fontSize === "number" ? `${run2.fontSize}pt` : run2.fontSize;
|
|
318419
|
+
{
|
|
318420
|
+
const fontSize = run2.fontSize ? typeof run2.fontSize === "number" ? `${run2.fontSize}pt` : run2.fontSize : BROWSER_DEFAULT_FONT_SIZE;
|
|
318260
318421
|
annotation.style.fontSize = fontSize;
|
|
318261
318422
|
}
|
|
318262
318423
|
if (run2.textColor)
|
|
@@ -318383,6 +318544,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
318383
318544
|
span.dataset.pmStart = String(lineRange.pmStart);
|
|
318384
318545
|
if (lineRange.pmEnd != null)
|
|
318385
318546
|
span.dataset.pmEnd = String(lineRange.pmEnd);
|
|
318547
|
+
span.style.fontSize = `${line.lineHeight}px`;
|
|
318386
318548
|
span.innerHTML = " ";
|
|
318387
318549
|
el.appendChild(span);
|
|
318388
318550
|
}
|
|
@@ -324395,7 +324557,7 @@ var init_zipper_DbkgrypV_es = __esm(() => {
|
|
|
324395
324557
|
|
|
324396
324558
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
324397
324559
|
var init_super_editor_es = __esm(() => {
|
|
324398
|
-
|
|
324560
|
+
init_src_BSdWFICK_es();
|
|
324399
324561
|
init_SuperConverter_CpoUNyba_es();
|
|
324400
324562
|
init_jszip_C49i9kUs_es();
|
|
324401
324563
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.7.0-next.
|
|
3
|
+
"version": "0.7.0-next.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"@superdoc/document-api": "0.0.1",
|
|
28
28
|
"@superdoc/super-editor": "0.0.1",
|
|
29
|
-
"superdoc": "
|
|
30
|
-
"
|
|
29
|
+
"@superdoc/pm-adapter": "0.0.0",
|
|
30
|
+
"superdoc": "1.26.0"
|
|
31
31
|
},
|
|
32
32
|
"module": "src/index.ts",
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.
|
|
38
|
-
"@superdoc-dev/cli-
|
|
39
|
-
"@superdoc-dev/cli-
|
|
40
|
-
"@superdoc-dev/cli-windows-x64": "0.7.0-next.
|
|
41
|
-
"@superdoc-dev/cli-linux-arm64": "0.7.0-next.
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.28",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.7.0-next.28",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.7.0-next.28",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.7.0-next.28",
|
|
41
|
+
"@superdoc-dev/cli-linux-arm64": "0.7.0-next.28"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|