oasis-editor 0.0.124 → 0.0.126
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/{OasisEditorApp-gxYuoU70.js → OasisEditorApp-DFgUxV_0.js} +142 -6
- package/dist/assets/{importDocxWorker-A73eR_fM.js → importDocxWorker-ayg-B322.js} +1 -1
- package/dist/core/layoutConstants.d.ts +13 -0
- package/dist/core/model/types/styles.d.ts +46 -0
- package/dist/export/docx/borders.d.ts +2 -0
- package/dist/import/docx/borders.d.ts +4 -0
- package/dist/{index-zlwh4WsF.js → index-BGUkA0aZ.js} +585 -363
- package/dist/layoutProjection/index.d.ts +1 -1
- package/dist/layoutProjection/paragraphBorders.d.ts +8 -0
- package/dist/oasis-editor.js +49 -49
- package/dist/oasis-editor.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -2623,7 +2623,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2623
2623
|
onCleanup(() => {
|
|
2624
2624
|
cancelled = true;
|
|
2625
2625
|
});
|
|
2626
|
-
import("./OasisEditorApp-
|
|
2626
|
+
import("./OasisEditorApp-DFgUxV_0.js").then((m) => {
|
|
2627
2627
|
cancelled = true;
|
|
2628
2628
|
setProgress(1);
|
|
2629
2629
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -3365,7 +3365,24 @@ const DEFAULT_PARAGRAPH_STYLE = asRequired({
|
|
|
3365
3365
|
keepLinesTogether: false,
|
|
3366
3366
|
widowControl: true,
|
|
3367
3367
|
textDirection: null,
|
|
3368
|
-
outlineLevel: null
|
|
3368
|
+
outlineLevel: null,
|
|
3369
|
+
suppressLineNumbers: false,
|
|
3370
|
+
suppressAutoHyphens: false,
|
|
3371
|
+
bidi: false,
|
|
3372
|
+
kinsoku: true,
|
|
3373
|
+
wordWrap: true,
|
|
3374
|
+
overflowPunct: true,
|
|
3375
|
+
topLinePunct: false,
|
|
3376
|
+
autoSpaceDE: true,
|
|
3377
|
+
autoSpaceDN: true,
|
|
3378
|
+
adjustRightInd: true,
|
|
3379
|
+
textAlignment: null,
|
|
3380
|
+
textboxTightWrap: null,
|
|
3381
|
+
divId: null,
|
|
3382
|
+
conditionalStyle: null,
|
|
3383
|
+
borderBetween: null,
|
|
3384
|
+
borderBar: null,
|
|
3385
|
+
framePrXml: null
|
|
3369
3386
|
});
|
|
3370
3387
|
const DEFAULT_EDITOR_PAGE_SETTINGS = {
|
|
3371
3388
|
width: 816,
|
|
@@ -14482,7 +14499,11 @@ function composeMeasuredParagraphLines(options) {
|
|
|
14482
14499
|
var _a;
|
|
14483
14500
|
const { paragraph, fragments, styles, contentWidth, defaultTabStop } = options;
|
|
14484
14501
|
const exclusions = options.exclusions ?? [];
|
|
14485
|
-
const
|
|
14502
|
+
const effectiveParagraphStyle = resolveEffectiveParagraphStyle(
|
|
14503
|
+
paragraph.style,
|
|
14504
|
+
styles
|
|
14505
|
+
);
|
|
14506
|
+
const hyphenation = effectiveParagraphStyle.suppressAutoHyphens ? void 0 : options.hyphenation;
|
|
14486
14507
|
const measuredChars = buildMeasuredChars(paragraph, fragments, styles);
|
|
14487
14508
|
const tokens = tokenizeMeasuredChars(measuredChars);
|
|
14488
14509
|
const charByOffset = new Map(
|
|
@@ -15031,9 +15052,36 @@ function getParagraphBorderInsets(style2) {
|
|
|
15031
15052
|
bottom: edgeInset(style2.borderBottom)
|
|
15032
15053
|
};
|
|
15033
15054
|
}
|
|
15055
|
+
function paragraphBetweenBorderMatches(a, b) {
|
|
15056
|
+
const ba = a.borderBetween;
|
|
15057
|
+
const bb = b.borderBetween;
|
|
15058
|
+
if (!isVisibleBorder$1(ba) || !isVisibleBorder$1(bb)) {
|
|
15059
|
+
return false;
|
|
15060
|
+
}
|
|
15061
|
+
return ba.type === bb.type && ba.width === bb.width && ba.color === bb.color;
|
|
15062
|
+
}
|
|
15034
15063
|
const VERTICAL_HIT_WEIGHT = 1e3;
|
|
15035
15064
|
const TEXT_BASELINE_RATIO = 0.8;
|
|
15036
15065
|
const NO_WRAP_MEASURE_WIDTH_PX = 1e5;
|
|
15066
|
+
function resolveTextAlignmentBaselineOffset(textAlignment, fontSizePx, lineHeightPx) {
|
|
15067
|
+
if (!textAlignment || textAlignment === "auto" || textAlignment === "baseline") {
|
|
15068
|
+
return 0;
|
|
15069
|
+
}
|
|
15070
|
+
if (fontSizePx >= lineHeightPx) {
|
|
15071
|
+
return 0;
|
|
15072
|
+
}
|
|
15073
|
+
const delta = fontSizePx - lineHeightPx;
|
|
15074
|
+
switch (textAlignment) {
|
|
15075
|
+
case "top":
|
|
15076
|
+
return TEXT_BASELINE_RATIO * delta;
|
|
15077
|
+
case "center":
|
|
15078
|
+
return (TEXT_BASELINE_RATIO - 0.5) * delta;
|
|
15079
|
+
case "bottom":
|
|
15080
|
+
return (1 - TEXT_BASELINE_RATIO) * -delta;
|
|
15081
|
+
default:
|
|
15082
|
+
return 0;
|
|
15083
|
+
}
|
|
15084
|
+
}
|
|
15037
15085
|
function formatTimestamp() {
|
|
15038
15086
|
const now = /* @__PURE__ */ new Date();
|
|
15039
15087
|
const h = String(now.getHours()).padStart(2, "0");
|
|
@@ -21244,6 +21292,11 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21244
21292
|
slotByOffset.set(slot.offset, slot);
|
|
21245
21293
|
}
|
|
21246
21294
|
const baselineY = originY + line.top + line.height * TEXT_BASELINE_RATIO;
|
|
21295
|
+
const paragraphStyle = resolveEffectiveParagraphStyle(
|
|
21296
|
+
paragraph.style,
|
|
21297
|
+
state.document.styles
|
|
21298
|
+
);
|
|
21299
|
+
const textAlignment = paragraphStyle.textAlignment;
|
|
21247
21300
|
const listPrefix = line.index === 0 ? resolveListPrefix(paragraph, state.document) : "";
|
|
21248
21301
|
if (listPrefix) {
|
|
21249
21302
|
const prefixStyles = resolveEffectiveTextStyleForParagraph(
|
|
@@ -21386,7 +21439,11 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21386
21439
|
state,
|
|
21387
21440
|
styles,
|
|
21388
21441
|
originX,
|
|
21389
|
-
baselineY + renderMetrics.baselineOffset
|
|
21442
|
+
baselineY + renderMetrics.baselineOffset + resolveTextAlignmentBaselineOffset(
|
|
21443
|
+
textAlignment,
|
|
21444
|
+
fontSize,
|
|
21445
|
+
line.height
|
|
21446
|
+
)
|
|
21390
21447
|
);
|
|
21391
21448
|
if (styles.reflection) {
|
|
21392
21449
|
drawFragmentReflection(
|
|
@@ -21395,7 +21452,11 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21395
21452
|
slotByOffset,
|
|
21396
21453
|
styles,
|
|
21397
21454
|
originX,
|
|
21398
|
-
baselineY + renderMetrics.baselineOffset
|
|
21455
|
+
baselineY + renderMetrics.baselineOffset + resolveTextAlignmentBaselineOffset(
|
|
21456
|
+
textAlignment,
|
|
21457
|
+
fontSize,
|
|
21458
|
+
line.height
|
|
21459
|
+
),
|
|
21399
21460
|
styles.reflection
|
|
21400
21461
|
);
|
|
21401
21462
|
}
|
|
@@ -21625,7 +21686,7 @@ function toCanvasEdge(border) {
|
|
|
21625
21686
|
};
|
|
21626
21687
|
}
|
|
21627
21688
|
function drawParagraphDecorations(ctx, paragraphStyle, lines, originX, contentTop, contentWidth) {
|
|
21628
|
-
const hasBorder = !!paragraphStyle.borderTop || !!paragraphStyle.borderRight || !!paragraphStyle.borderBottom || !!paragraphStyle.borderLeft;
|
|
21689
|
+
const hasBorder = !!paragraphStyle.borderTop || !!paragraphStyle.borderRight || !!paragraphStyle.borderBottom || !!paragraphStyle.borderLeft || !!paragraphStyle.borderBar;
|
|
21629
21690
|
if (!paragraphStyle.shading && !hasBorder) {
|
|
21630
21691
|
return;
|
|
21631
21692
|
}
|
|
@@ -21655,11 +21716,17 @@ function drawParagraphDecorations(ctx, paragraphStyle, lines, originX, contentTo
|
|
|
21655
21716
|
left: toCanvasEdge(paragraphStyle.borderLeft)
|
|
21656
21717
|
});
|
|
21657
21718
|
}
|
|
21719
|
+
if (paragraphStyle.borderBar) {
|
|
21720
|
+
drawBorderBox(ctx, left, contentTop, 0, boxHeight, {
|
|
21721
|
+
left: toCanvasEdge(paragraphStyle.borderBar)
|
|
21722
|
+
});
|
|
21723
|
+
}
|
|
21658
21724
|
}
|
|
21659
21725
|
function renderBlockList(ctx, state, blocks, originX, originY, contentWidth, pageIndex, onUpdate, pageSettings) {
|
|
21660
21726
|
var _a;
|
|
21661
21727
|
let cursorY = originY;
|
|
21662
|
-
for (
|
|
21728
|
+
for (let blockIndex = 0; blockIndex < blocks.length; blockIndex += 1) {
|
|
21729
|
+
const block = blocks[blockIndex];
|
|
21663
21730
|
if (block.sourceBlock.type === "paragraph" && block.layout) {
|
|
21664
21731
|
const paragraphStyle = resolveEffectiveParagraphStyle(
|
|
21665
21732
|
block.sourceBlock.style,
|
|
@@ -21752,6 +21819,30 @@ function renderBlockList(ctx, state, blocks, originX, originY, contentWidth, pag
|
|
|
21752
21819
|
layer: "front"
|
|
21753
21820
|
});
|
|
21754
21821
|
}
|
|
21822
|
+
const nextBlock = blocks[blockIndex + 1];
|
|
21823
|
+
if ((nextBlock == null ? void 0 : nextBlock.sourceBlock.type) === "paragraph" && nextBlock.layout && nextBlock.sourceBlock.id !== block.sourceBlock.id) {
|
|
21824
|
+
const nextStyle = resolveEffectiveParagraphStyle(
|
|
21825
|
+
nextBlock.sourceBlock.style,
|
|
21826
|
+
state.document.styles
|
|
21827
|
+
);
|
|
21828
|
+
if (paragraphBetweenBorderMatches(paragraphStyle, nextStyle)) {
|
|
21829
|
+
let linesHeight = 0;
|
|
21830
|
+
for (const line of block.layout.lines) {
|
|
21831
|
+
linesHeight = Math.max(linesHeight, line.top + line.height);
|
|
21832
|
+
}
|
|
21833
|
+
const betweenY = textTop + linesHeight;
|
|
21834
|
+
const barLeft = originX + (paragraphStyle.indentLeft ?? 0);
|
|
21835
|
+
const barRight = originX + contentWidth - (paragraphStyle.indentRight ?? 0);
|
|
21836
|
+
drawBorderBox(
|
|
21837
|
+
ctx,
|
|
21838
|
+
barLeft,
|
|
21839
|
+
betweenY,
|
|
21840
|
+
Math.max(0, barRight - barLeft),
|
|
21841
|
+
0,
|
|
21842
|
+
{ top: toCanvasEdge(paragraphStyle.borderBetween) }
|
|
21843
|
+
);
|
|
21844
|
+
}
|
|
21845
|
+
}
|
|
21755
21846
|
} else if (block.sourceBlock.type === "table") {
|
|
21756
21847
|
const floating = (_a = block.sourceBlock.style) == null ? void 0 : _a.floating;
|
|
21757
21848
|
if (floating && pageSettings) {
|
|
@@ -33030,6 +33121,12 @@ function parseDocxBoxBorders(container) {
|
|
|
33030
33121
|
),
|
|
33031
33122
|
borderTopRightToBottomLeft: parseDocxBorder(
|
|
33032
33123
|
getFirstChildByTagNameNS(container, WORD_NS, "tr2bl")
|
|
33124
|
+
),
|
|
33125
|
+
borderBetween: parseDocxBorder(
|
|
33126
|
+
getFirstChildByTagNameNS(container, WORD_NS, "between")
|
|
33127
|
+
),
|
|
33128
|
+
borderBar: parseDocxBorder(
|
|
33129
|
+
getFirstChildByTagNameNS(container, WORD_NS, "bar")
|
|
33033
33130
|
)
|
|
33034
33131
|
};
|
|
33035
33132
|
}
|
|
@@ -33601,240 +33698,6 @@ function parseRunStyle(runProperties, theme) {
|
|
|
33601
33698
|
}
|
|
33602
33699
|
return emptyOrUndefined(styles);
|
|
33603
33700
|
}
|
|
33604
|
-
function normalizeImportedParagraphStyle(style2) {
|
|
33605
|
-
if (!style2) {
|
|
33606
|
-
return void 0;
|
|
33607
|
-
}
|
|
33608
|
-
const effective = resolveEffectiveParagraphStyle(
|
|
33609
|
-
style2,
|
|
33610
|
-
DEFAULT_EDITOR_STYLES
|
|
33611
|
-
);
|
|
33612
|
-
const defaultEffective = resolveEffectiveParagraphStyle(
|
|
33613
|
-
void 0,
|
|
33614
|
-
DEFAULT_EDITOR_STYLES
|
|
33615
|
-
);
|
|
33616
|
-
const normalized = stripUndefined({
|
|
33617
|
-
styleId: style2.styleId,
|
|
33618
|
-
align: effective.align !== defaultEffective.align ? effective.align : void 0,
|
|
33619
|
-
spacingBefore: effective.spacingBefore !== defaultEffective.spacingBefore ? effective.spacingBefore : void 0,
|
|
33620
|
-
spacingAfter: effective.spacingAfter !== defaultEffective.spacingAfter ? effective.spacingAfter : void 0,
|
|
33621
|
-
contextualSpacing: style2.contextualSpacing !== void 0 || effective.contextualSpacing !== defaultEffective.contextualSpacing ? effective.contextualSpacing : void 0,
|
|
33622
|
-
lineHeight: effective.lineHeight !== defaultEffective.lineHeight ? effective.lineHeight : void 0,
|
|
33623
|
-
lineRule: effective.lineRule ?? void 0,
|
|
33624
|
-
lineGridPitch: style2.lineGridPitch ?? void 0,
|
|
33625
|
-
snapToGrid: style2.snapToGrid !== void 0 || effective.snapToGrid !== defaultEffective.snapToGrid ? effective.snapToGrid : void 0,
|
|
33626
|
-
indentLeft: style2.indentLeft !== void 0 || effective.indentLeft !== defaultEffective.indentLeft ? effective.indentLeft : void 0,
|
|
33627
|
-
indentRight: style2.indentRight !== void 0 || effective.indentRight !== defaultEffective.indentRight ? effective.indentRight : void 0,
|
|
33628
|
-
indentFirstLine: style2.indentFirstLine !== void 0 || effective.indentFirstLine !== defaultEffective.indentFirstLine ? effective.indentFirstLine : void 0,
|
|
33629
|
-
indentHanging: style2.indentHanging !== void 0 || effective.indentHanging !== defaultEffective.indentHanging ? effective.indentHanging : void 0,
|
|
33630
|
-
mirrorIndents: style2.mirrorIndents !== void 0 || effective.mirrorIndents !== defaultEffective.mirrorIndents ? effective.mirrorIndents : void 0,
|
|
33631
|
-
pageBreakBefore: style2.pageBreakBefore !== void 0 || effective.pageBreakBefore !== defaultEffective.pageBreakBefore ? effective.pageBreakBefore : void 0,
|
|
33632
|
-
keepWithNext: style2.keepWithNext !== void 0 || effective.keepWithNext !== defaultEffective.keepWithNext ? effective.keepWithNext : void 0,
|
|
33633
|
-
keepLinesTogether: style2.keepLinesTogether !== void 0 || effective.keepLinesTogether !== defaultEffective.keepLinesTogether ? effective.keepLinesTogether : void 0,
|
|
33634
|
-
widowControl: style2.widowControl !== void 0 || effective.widowControl !== defaultEffective.widowControl ? effective.widowControl : void 0,
|
|
33635
|
-
shading: style2.shading ?? void 0,
|
|
33636
|
-
borderTop: style2.borderTop ?? void 0,
|
|
33637
|
-
borderRight: style2.borderRight ?? void 0,
|
|
33638
|
-
borderBottom: style2.borderBottom ?? void 0,
|
|
33639
|
-
borderLeft: style2.borderLeft ?? void 0,
|
|
33640
|
-
tabs: style2.tabs ?? void 0,
|
|
33641
|
-
textDirection: style2.textDirection ?? void 0,
|
|
33642
|
-
outlineLevel: style2.outlineLevel ?? void 0
|
|
33643
|
-
});
|
|
33644
|
-
return normalized;
|
|
33645
|
-
}
|
|
33646
|
-
function withDocxImplicitSingleLineHeight(style2) {
|
|
33647
|
-
if ((style2 == null ? void 0 : style2.lineHeight) !== void 0) {
|
|
33648
|
-
return style2;
|
|
33649
|
-
}
|
|
33650
|
-
return {
|
|
33651
|
-
...style2 ?? {},
|
|
33652
|
-
lineHeight: DOCX_IMPLICIT_SINGLE_LINE_HEIGHT
|
|
33653
|
-
};
|
|
33654
|
-
}
|
|
33655
|
-
function parseAutospacingFlags(paragraphProperties) {
|
|
33656
|
-
const spacing = getFirstChildByTagNameNS(
|
|
33657
|
-
paragraphProperties,
|
|
33658
|
-
WORD_NS,
|
|
33659
|
-
"spacing"
|
|
33660
|
-
);
|
|
33661
|
-
return {
|
|
33662
|
-
before: isWordTrue(getAttributeValue(spacing, "beforeAutospacing")),
|
|
33663
|
-
after: isWordTrue(getAttributeValue(spacing, "afterAutospacing"))
|
|
33664
|
-
};
|
|
33665
|
-
}
|
|
33666
|
-
function parseParagraphTabs(paragraphProperties) {
|
|
33667
|
-
const tabsElement = getFirstChildByTagNameNS(
|
|
33668
|
-
paragraphProperties,
|
|
33669
|
-
WORD_NS,
|
|
33670
|
-
"tabs"
|
|
33671
|
-
);
|
|
33672
|
-
if (!tabsElement) {
|
|
33673
|
-
return [];
|
|
33674
|
-
}
|
|
33675
|
-
const tabs = [];
|
|
33676
|
-
for (const tabElement of getChildrenByTagNameNS(
|
|
33677
|
-
tabsElement,
|
|
33678
|
-
WORD_NS,
|
|
33679
|
-
"tab"
|
|
33680
|
-
)) {
|
|
33681
|
-
const position2 = twipsToPoints(getAttributeValue(tabElement, "pos"));
|
|
33682
|
-
if (position2 === void 0) {
|
|
33683
|
-
continue;
|
|
33684
|
-
}
|
|
33685
|
-
const typeValue = getAttributeValue(tabElement, "val");
|
|
33686
|
-
const type = typeValue === "center" || typeValue === "right" || typeValue === "decimal" || typeValue === "bar" || typeValue === "clear" ? typeValue : "left";
|
|
33687
|
-
const leaderValue = getAttributeValue(tabElement, "leader");
|
|
33688
|
-
const leader = leaderValue === "dot" || leaderValue === "hyphen" || leaderValue === "underscore" || leaderValue === "heavy" || leaderValue === "middleDot" ? leaderValue : leaderValue === "none" ? "none" : void 0;
|
|
33689
|
-
tabs.push({
|
|
33690
|
-
position: position2,
|
|
33691
|
-
type,
|
|
33692
|
-
...leader !== void 0 ? { leader } : {}
|
|
33693
|
-
});
|
|
33694
|
-
}
|
|
33695
|
-
return tabs;
|
|
33696
|
-
}
|
|
33697
|
-
function parseParagraphStyle$1(paragraphProperties, colors) {
|
|
33698
|
-
if (!paragraphProperties) {
|
|
33699
|
-
return void 0;
|
|
33700
|
-
}
|
|
33701
|
-
const style2 = {};
|
|
33702
|
-
const styleId = parseStyleIdProperty(paragraphProperties, "pStyle");
|
|
33703
|
-
if (styleId) {
|
|
33704
|
-
style2.styleId = styleId;
|
|
33705
|
-
}
|
|
33706
|
-
const justification = getFirstChildByTagNameNS(
|
|
33707
|
-
paragraphProperties,
|
|
33708
|
-
WORD_NS,
|
|
33709
|
-
"jc"
|
|
33710
|
-
);
|
|
33711
|
-
const justificationValue = getAttributeValue(justification, "val");
|
|
33712
|
-
if (justificationValue === "left" || justificationValue === "start" || justificationValue === "center" || justificationValue === "right" || justificationValue === "end" || justificationValue === "justify") {
|
|
33713
|
-
style2.align = justificationValue === "start" ? "left" : justificationValue === "end" ? "right" : justificationValue;
|
|
33714
|
-
} else if (justificationValue === "both" || justificationValue === "distribute") {
|
|
33715
|
-
style2.align = "justify";
|
|
33716
|
-
}
|
|
33717
|
-
const spacing = getFirstChildByTagNameNS(
|
|
33718
|
-
paragraphProperties,
|
|
33719
|
-
WORD_NS,
|
|
33720
|
-
"spacing"
|
|
33721
|
-
);
|
|
33722
|
-
const before = getAttributeValue(spacing, "before");
|
|
33723
|
-
const after = getAttributeValue(spacing, "after");
|
|
33724
|
-
const line = getAttributeValue(spacing, "line");
|
|
33725
|
-
const lineRule = getAttributeValue(spacing, "lineRule");
|
|
33726
|
-
if (before) {
|
|
33727
|
-
style2.spacingBefore = twipsToPx(before, 0);
|
|
33728
|
-
}
|
|
33729
|
-
if (after) {
|
|
33730
|
-
style2.spacingAfter = twipsToPx(after, 0);
|
|
33731
|
-
}
|
|
33732
|
-
if (line) {
|
|
33733
|
-
if (lineRule === "exact" || lineRule === "atLeast") {
|
|
33734
|
-
style2.lineHeight = roundTo(Number(line) / 1440 * 96, 4);
|
|
33735
|
-
style2.lineRule = lineRule;
|
|
33736
|
-
} else {
|
|
33737
|
-
style2.lineHeight = Number(line) / 240;
|
|
33738
|
-
}
|
|
33739
|
-
}
|
|
33740
|
-
const contextualSpacing = parseOnOffProperty(
|
|
33741
|
-
paragraphProperties,
|
|
33742
|
-
"contextualSpacing"
|
|
33743
|
-
);
|
|
33744
|
-
if (contextualSpacing !== void 0) {
|
|
33745
|
-
style2.contextualSpacing = contextualSpacing;
|
|
33746
|
-
}
|
|
33747
|
-
const snapToGrid = parseOnOffProperty(paragraphProperties, "snapToGrid");
|
|
33748
|
-
if (snapToGrid !== void 0) {
|
|
33749
|
-
style2.snapToGrid = snapToGrid;
|
|
33750
|
-
}
|
|
33751
|
-
const indent = getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "ind");
|
|
33752
|
-
const left = getAttributeValue(indent, "start") ?? getAttributeValue(indent, "left");
|
|
33753
|
-
const right = getAttributeValue(indent, "end") ?? getAttributeValue(indent, "right");
|
|
33754
|
-
const firstLine = getAttributeValue(indent, "firstLine");
|
|
33755
|
-
const hanging = getAttributeValue(indent, "hanging");
|
|
33756
|
-
if (left) {
|
|
33757
|
-
style2.indentLeft = twipsToPx(left, 0);
|
|
33758
|
-
}
|
|
33759
|
-
if (right) {
|
|
33760
|
-
style2.indentRight = twipsToPx(right, 0);
|
|
33761
|
-
}
|
|
33762
|
-
if (hanging) {
|
|
33763
|
-
style2.indentHanging = twipsToPx(hanging, 0);
|
|
33764
|
-
style2.indentFirstLine = void 0;
|
|
33765
|
-
} else if (firstLine) {
|
|
33766
|
-
style2.indentFirstLine = twipsToPx(firstLine, 0);
|
|
33767
|
-
}
|
|
33768
|
-
const tabs = parseParagraphTabs(paragraphProperties);
|
|
33769
|
-
if (tabs.length > 0) {
|
|
33770
|
-
style2.tabs = tabs;
|
|
33771
|
-
}
|
|
33772
|
-
const pageBreakBefore = parseOnOffProperty(
|
|
33773
|
-
paragraphProperties,
|
|
33774
|
-
"pageBreakBefore"
|
|
33775
|
-
);
|
|
33776
|
-
if (pageBreakBefore !== void 0) {
|
|
33777
|
-
style2.pageBreakBefore = pageBreakBefore;
|
|
33778
|
-
}
|
|
33779
|
-
const keepNext = parseOnOffProperty(paragraphProperties, "keepNext");
|
|
33780
|
-
if (keepNext !== void 0) {
|
|
33781
|
-
style2.keepWithNext = keepNext;
|
|
33782
|
-
}
|
|
33783
|
-
const keepLines = parseOnOffProperty(paragraphProperties, "keepLines");
|
|
33784
|
-
if (keepLines !== void 0) {
|
|
33785
|
-
style2.keepLinesTogether = keepLines;
|
|
33786
|
-
}
|
|
33787
|
-
const widowControl = parseOnOffProperty(paragraphProperties, "widowControl");
|
|
33788
|
-
if (widowControl !== void 0) {
|
|
33789
|
-
style2.widowControl = widowControl;
|
|
33790
|
-
}
|
|
33791
|
-
const mirrorIndents = parseOnOffProperty(
|
|
33792
|
-
paragraphProperties,
|
|
33793
|
-
"mirrorIndents"
|
|
33794
|
-
);
|
|
33795
|
-
if (mirrorIndents !== void 0) {
|
|
33796
|
-
style2.mirrorIndents = mirrorIndents;
|
|
33797
|
-
}
|
|
33798
|
-
const paragraphBorders = getFirstChildByTagNameNS(
|
|
33799
|
-
paragraphProperties,
|
|
33800
|
-
WORD_NS,
|
|
33801
|
-
"pBdr"
|
|
33802
|
-
);
|
|
33803
|
-
if (paragraphBorders) {
|
|
33804
|
-
const { borderTop, borderRight, borderBottom, borderLeft } = parseDocxBoxBorders(paragraphBorders);
|
|
33805
|
-
if (borderTop) style2.borderTop = borderTop;
|
|
33806
|
-
if (borderRight) style2.borderRight = borderRight;
|
|
33807
|
-
if (borderBottom) style2.borderBottom = borderBottom;
|
|
33808
|
-
if (borderLeft) style2.borderLeft = borderLeft;
|
|
33809
|
-
}
|
|
33810
|
-
const shading = getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "shd");
|
|
33811
|
-
const shadingFill = parseShdFill(shading, colors);
|
|
33812
|
-
if (shadingFill) {
|
|
33813
|
-
style2.shading = shadingFill;
|
|
33814
|
-
}
|
|
33815
|
-
const textDirection = parseTextDirection(
|
|
33816
|
-
getAttributeValue(
|
|
33817
|
-
getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "textDirection"),
|
|
33818
|
-
"val"
|
|
33819
|
-
)
|
|
33820
|
-
);
|
|
33821
|
-
if (textDirection) {
|
|
33822
|
-
style2.textDirection = textDirection;
|
|
33823
|
-
}
|
|
33824
|
-
const outlineLvlEl = getFirstChildByTagNameNS(
|
|
33825
|
-
paragraphProperties,
|
|
33826
|
-
WORD_NS,
|
|
33827
|
-
"outlineLvl"
|
|
33828
|
-
);
|
|
33829
|
-
const outlineLvlVal = getAttributeValue(outlineLvlEl, "val");
|
|
33830
|
-
if (outlineLvlVal !== void 0) {
|
|
33831
|
-
const level = Number(outlineLvlVal);
|
|
33832
|
-
if (Number.isFinite(level) && level >= 0 && level <= 8) {
|
|
33833
|
-
style2.outlineLevel = level;
|
|
33834
|
-
}
|
|
33835
|
-
}
|
|
33836
|
-
return emptyOrUndefined(style2);
|
|
33837
|
-
}
|
|
33838
33701
|
const TABLE_CONDITIONAL_FLAG_ATTRIBUTES = [
|
|
33839
33702
|
["firstRow", "firstRow"],
|
|
33840
33703
|
["lastRow", "lastRow"],
|
|
@@ -34372,6 +34235,363 @@ function collapseCellAutospacing(paragraphs, flags) {
|
|
|
34372
34235
|
}
|
|
34373
34236
|
}
|
|
34374
34237
|
}
|
|
34238
|
+
function normalizeImportedParagraphStyle(style2) {
|
|
34239
|
+
if (!style2) {
|
|
34240
|
+
return void 0;
|
|
34241
|
+
}
|
|
34242
|
+
const effective = resolveEffectiveParagraphStyle(
|
|
34243
|
+
style2,
|
|
34244
|
+
DEFAULT_EDITOR_STYLES
|
|
34245
|
+
);
|
|
34246
|
+
const defaultEffective = resolveEffectiveParagraphStyle(
|
|
34247
|
+
void 0,
|
|
34248
|
+
DEFAULT_EDITOR_STYLES
|
|
34249
|
+
);
|
|
34250
|
+
const normalized = stripUndefined({
|
|
34251
|
+
styleId: style2.styleId,
|
|
34252
|
+
align: effective.align !== defaultEffective.align ? effective.align : void 0,
|
|
34253
|
+
spacingBefore: effective.spacingBefore !== defaultEffective.spacingBefore ? effective.spacingBefore : void 0,
|
|
34254
|
+
spacingAfter: effective.spacingAfter !== defaultEffective.spacingAfter ? effective.spacingAfter : void 0,
|
|
34255
|
+
contextualSpacing: style2.contextualSpacing !== void 0 || effective.contextualSpacing !== defaultEffective.contextualSpacing ? effective.contextualSpacing : void 0,
|
|
34256
|
+
lineHeight: effective.lineHeight !== defaultEffective.lineHeight ? effective.lineHeight : void 0,
|
|
34257
|
+
lineRule: effective.lineRule ?? void 0,
|
|
34258
|
+
lineGridPitch: style2.lineGridPitch ?? void 0,
|
|
34259
|
+
snapToGrid: style2.snapToGrid !== void 0 || effective.snapToGrid !== defaultEffective.snapToGrid ? effective.snapToGrid : void 0,
|
|
34260
|
+
indentLeft: style2.indentLeft !== void 0 || effective.indentLeft !== defaultEffective.indentLeft ? effective.indentLeft : void 0,
|
|
34261
|
+
indentRight: style2.indentRight !== void 0 || effective.indentRight !== defaultEffective.indentRight ? effective.indentRight : void 0,
|
|
34262
|
+
indentFirstLine: style2.indentFirstLine !== void 0 || effective.indentFirstLine !== defaultEffective.indentFirstLine ? effective.indentFirstLine : void 0,
|
|
34263
|
+
indentHanging: style2.indentHanging !== void 0 || effective.indentHanging !== defaultEffective.indentHanging ? effective.indentHanging : void 0,
|
|
34264
|
+
mirrorIndents: style2.mirrorIndents !== void 0 || effective.mirrorIndents !== defaultEffective.mirrorIndents ? effective.mirrorIndents : void 0,
|
|
34265
|
+
pageBreakBefore: style2.pageBreakBefore !== void 0 || effective.pageBreakBefore !== defaultEffective.pageBreakBefore ? effective.pageBreakBefore : void 0,
|
|
34266
|
+
keepWithNext: style2.keepWithNext !== void 0 || effective.keepWithNext !== defaultEffective.keepWithNext ? effective.keepWithNext : void 0,
|
|
34267
|
+
keepLinesTogether: style2.keepLinesTogether !== void 0 || effective.keepLinesTogether !== defaultEffective.keepLinesTogether ? effective.keepLinesTogether : void 0,
|
|
34268
|
+
widowControl: style2.widowControl !== void 0 || effective.widowControl !== defaultEffective.widowControl ? effective.widowControl : void 0,
|
|
34269
|
+
shading: style2.shading ?? void 0,
|
|
34270
|
+
borderTop: style2.borderTop ?? void 0,
|
|
34271
|
+
borderRight: style2.borderRight ?? void 0,
|
|
34272
|
+
borderBottom: style2.borderBottom ?? void 0,
|
|
34273
|
+
borderLeft: style2.borderLeft ?? void 0,
|
|
34274
|
+
tabs: style2.tabs ?? void 0,
|
|
34275
|
+
textDirection: style2.textDirection ?? void 0,
|
|
34276
|
+
outlineLevel: style2.outlineLevel ?? void 0,
|
|
34277
|
+
suppressLineNumbers: style2.suppressLineNumbers !== void 0 || effective.suppressLineNumbers !== defaultEffective.suppressLineNumbers ? effective.suppressLineNumbers : void 0,
|
|
34278
|
+
suppressAutoHyphens: style2.suppressAutoHyphens !== void 0 || effective.suppressAutoHyphens !== defaultEffective.suppressAutoHyphens ? effective.suppressAutoHyphens : void 0,
|
|
34279
|
+
bidi: style2.bidi !== void 0 || effective.bidi !== defaultEffective.bidi ? effective.bidi : void 0,
|
|
34280
|
+
kinsoku: style2.kinsoku !== void 0 || effective.kinsoku !== defaultEffective.kinsoku ? effective.kinsoku : void 0,
|
|
34281
|
+
wordWrap: style2.wordWrap !== void 0 || effective.wordWrap !== defaultEffective.wordWrap ? effective.wordWrap : void 0,
|
|
34282
|
+
overflowPunct: style2.overflowPunct !== void 0 || effective.overflowPunct !== defaultEffective.overflowPunct ? effective.overflowPunct : void 0,
|
|
34283
|
+
topLinePunct: style2.topLinePunct !== void 0 || effective.topLinePunct !== defaultEffective.topLinePunct ? effective.topLinePunct : void 0,
|
|
34284
|
+
autoSpaceDE: style2.autoSpaceDE !== void 0 || effective.autoSpaceDE !== defaultEffective.autoSpaceDE ? effective.autoSpaceDE : void 0,
|
|
34285
|
+
autoSpaceDN: style2.autoSpaceDN !== void 0 || effective.autoSpaceDN !== defaultEffective.autoSpaceDN ? effective.autoSpaceDN : void 0,
|
|
34286
|
+
adjustRightInd: style2.adjustRightInd !== void 0 || effective.adjustRightInd !== defaultEffective.adjustRightInd ? effective.adjustRightInd : void 0,
|
|
34287
|
+
textAlignment: style2.textAlignment ?? void 0,
|
|
34288
|
+
textboxTightWrap: style2.textboxTightWrap ?? void 0,
|
|
34289
|
+
divId: style2.divId ?? void 0,
|
|
34290
|
+
conditionalStyle: style2.conditionalStyle ?? void 0,
|
|
34291
|
+
borderBetween: style2.borderBetween ?? void 0,
|
|
34292
|
+
borderBar: style2.borderBar ?? void 0,
|
|
34293
|
+
framePrXml: style2.framePrXml ?? void 0
|
|
34294
|
+
});
|
|
34295
|
+
return normalized;
|
|
34296
|
+
}
|
|
34297
|
+
function withDocxImplicitSingleLineHeight(style2) {
|
|
34298
|
+
if ((style2 == null ? void 0 : style2.lineHeight) !== void 0) {
|
|
34299
|
+
return style2;
|
|
34300
|
+
}
|
|
34301
|
+
return {
|
|
34302
|
+
...style2 ?? {},
|
|
34303
|
+
lineHeight: DOCX_IMPLICIT_SINGLE_LINE_HEIGHT
|
|
34304
|
+
};
|
|
34305
|
+
}
|
|
34306
|
+
function parseAutospacingFlags(paragraphProperties) {
|
|
34307
|
+
const spacing = getFirstChildByTagNameNS(
|
|
34308
|
+
paragraphProperties,
|
|
34309
|
+
WORD_NS,
|
|
34310
|
+
"spacing"
|
|
34311
|
+
);
|
|
34312
|
+
return {
|
|
34313
|
+
before: isWordTrue(getAttributeValue(spacing, "beforeAutospacing")),
|
|
34314
|
+
after: isWordTrue(getAttributeValue(spacing, "afterAutospacing"))
|
|
34315
|
+
};
|
|
34316
|
+
}
|
|
34317
|
+
function parseParagraphTabs(paragraphProperties) {
|
|
34318
|
+
const tabsElement = getFirstChildByTagNameNS(
|
|
34319
|
+
paragraphProperties,
|
|
34320
|
+
WORD_NS,
|
|
34321
|
+
"tabs"
|
|
34322
|
+
);
|
|
34323
|
+
if (!tabsElement) {
|
|
34324
|
+
return [];
|
|
34325
|
+
}
|
|
34326
|
+
const tabs = [];
|
|
34327
|
+
for (const tabElement of getChildrenByTagNameNS(
|
|
34328
|
+
tabsElement,
|
|
34329
|
+
WORD_NS,
|
|
34330
|
+
"tab"
|
|
34331
|
+
)) {
|
|
34332
|
+
const position2 = twipsToPoints(getAttributeValue(tabElement, "pos"));
|
|
34333
|
+
if (position2 === void 0) {
|
|
34334
|
+
continue;
|
|
34335
|
+
}
|
|
34336
|
+
const typeValue = getAttributeValue(tabElement, "val");
|
|
34337
|
+
const type = typeValue === "center" || typeValue === "right" || typeValue === "decimal" || typeValue === "bar" || typeValue === "clear" ? typeValue : "left";
|
|
34338
|
+
const leaderValue = getAttributeValue(tabElement, "leader");
|
|
34339
|
+
const leader = leaderValue === "dot" || leaderValue === "hyphen" || leaderValue === "underscore" || leaderValue === "heavy" || leaderValue === "middleDot" ? leaderValue : leaderValue === "none" ? "none" : void 0;
|
|
34340
|
+
tabs.push({
|
|
34341
|
+
position: position2,
|
|
34342
|
+
type,
|
|
34343
|
+
...leader !== void 0 ? { leader } : {}
|
|
34344
|
+
});
|
|
34345
|
+
}
|
|
34346
|
+
return tabs;
|
|
34347
|
+
}
|
|
34348
|
+
function parseParagraphStyle$1(paragraphProperties, colors) {
|
|
34349
|
+
if (!paragraphProperties) {
|
|
34350
|
+
return void 0;
|
|
34351
|
+
}
|
|
34352
|
+
const style2 = {};
|
|
34353
|
+
const styleId = parseStyleIdProperty(paragraphProperties, "pStyle");
|
|
34354
|
+
if (styleId) {
|
|
34355
|
+
style2.styleId = styleId;
|
|
34356
|
+
}
|
|
34357
|
+
const justification = getFirstChildByTagNameNS(
|
|
34358
|
+
paragraphProperties,
|
|
34359
|
+
WORD_NS,
|
|
34360
|
+
"jc"
|
|
34361
|
+
);
|
|
34362
|
+
const justificationValue = getAttributeValue(justification, "val");
|
|
34363
|
+
if (justificationValue === "left" || justificationValue === "start" || justificationValue === "center" || justificationValue === "right" || justificationValue === "end" || justificationValue === "justify") {
|
|
34364
|
+
style2.align = justificationValue === "start" ? "left" : justificationValue === "end" ? "right" : justificationValue;
|
|
34365
|
+
} else if (justificationValue === "both" || justificationValue === "distribute") {
|
|
34366
|
+
style2.align = "justify";
|
|
34367
|
+
}
|
|
34368
|
+
const spacing = getFirstChildByTagNameNS(
|
|
34369
|
+
paragraphProperties,
|
|
34370
|
+
WORD_NS,
|
|
34371
|
+
"spacing"
|
|
34372
|
+
);
|
|
34373
|
+
const before = getAttributeValue(spacing, "before");
|
|
34374
|
+
const after = getAttributeValue(spacing, "after");
|
|
34375
|
+
const line = getAttributeValue(spacing, "line");
|
|
34376
|
+
const lineRule = getAttributeValue(spacing, "lineRule");
|
|
34377
|
+
if (before) {
|
|
34378
|
+
style2.spacingBefore = twipsToPx(before, 0);
|
|
34379
|
+
}
|
|
34380
|
+
if (after) {
|
|
34381
|
+
style2.spacingAfter = twipsToPx(after, 0);
|
|
34382
|
+
}
|
|
34383
|
+
if (line) {
|
|
34384
|
+
if (lineRule === "exact" || lineRule === "atLeast") {
|
|
34385
|
+
style2.lineHeight = roundTo(Number(line) / 1440 * 96, 4);
|
|
34386
|
+
style2.lineRule = lineRule;
|
|
34387
|
+
} else {
|
|
34388
|
+
style2.lineHeight = Number(line) / 240;
|
|
34389
|
+
}
|
|
34390
|
+
}
|
|
34391
|
+
const contextualSpacing = parseOnOffProperty(
|
|
34392
|
+
paragraphProperties,
|
|
34393
|
+
"contextualSpacing"
|
|
34394
|
+
);
|
|
34395
|
+
if (contextualSpacing !== void 0) {
|
|
34396
|
+
style2.contextualSpacing = contextualSpacing;
|
|
34397
|
+
}
|
|
34398
|
+
const snapToGrid = parseOnOffProperty(paragraphProperties, "snapToGrid");
|
|
34399
|
+
if (snapToGrid !== void 0) {
|
|
34400
|
+
style2.snapToGrid = snapToGrid;
|
|
34401
|
+
}
|
|
34402
|
+
const indent = getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "ind");
|
|
34403
|
+
const left = getAttributeValue(indent, "start") ?? getAttributeValue(indent, "left");
|
|
34404
|
+
const right = getAttributeValue(indent, "end") ?? getAttributeValue(indent, "right");
|
|
34405
|
+
const firstLine = getAttributeValue(indent, "firstLine");
|
|
34406
|
+
const hanging = getAttributeValue(indent, "hanging");
|
|
34407
|
+
if (left) {
|
|
34408
|
+
style2.indentLeft = twipsToPx(left, 0);
|
|
34409
|
+
}
|
|
34410
|
+
if (right) {
|
|
34411
|
+
style2.indentRight = twipsToPx(right, 0);
|
|
34412
|
+
}
|
|
34413
|
+
if (hanging) {
|
|
34414
|
+
style2.indentHanging = twipsToPx(hanging, 0);
|
|
34415
|
+
style2.indentFirstLine = void 0;
|
|
34416
|
+
} else if (firstLine) {
|
|
34417
|
+
style2.indentFirstLine = twipsToPx(firstLine, 0);
|
|
34418
|
+
}
|
|
34419
|
+
const tabs = parseParagraphTabs(paragraphProperties);
|
|
34420
|
+
if (tabs.length > 0) {
|
|
34421
|
+
style2.tabs = tabs;
|
|
34422
|
+
}
|
|
34423
|
+
const pageBreakBefore = parseOnOffProperty(
|
|
34424
|
+
paragraphProperties,
|
|
34425
|
+
"pageBreakBefore"
|
|
34426
|
+
);
|
|
34427
|
+
if (pageBreakBefore !== void 0) {
|
|
34428
|
+
style2.pageBreakBefore = pageBreakBefore;
|
|
34429
|
+
}
|
|
34430
|
+
const keepNext = parseOnOffProperty(paragraphProperties, "keepNext");
|
|
34431
|
+
if (keepNext !== void 0) {
|
|
34432
|
+
style2.keepWithNext = keepNext;
|
|
34433
|
+
}
|
|
34434
|
+
const keepLines = parseOnOffProperty(paragraphProperties, "keepLines");
|
|
34435
|
+
if (keepLines !== void 0) {
|
|
34436
|
+
style2.keepLinesTogether = keepLines;
|
|
34437
|
+
}
|
|
34438
|
+
const widowControl = parseOnOffProperty(paragraphProperties, "widowControl");
|
|
34439
|
+
if (widowControl !== void 0) {
|
|
34440
|
+
style2.widowControl = widowControl;
|
|
34441
|
+
}
|
|
34442
|
+
const mirrorIndents = parseOnOffProperty(
|
|
34443
|
+
paragraphProperties,
|
|
34444
|
+
"mirrorIndents"
|
|
34445
|
+
);
|
|
34446
|
+
if (mirrorIndents !== void 0) {
|
|
34447
|
+
style2.mirrorIndents = mirrorIndents;
|
|
34448
|
+
}
|
|
34449
|
+
const paragraphBorders = getFirstChildByTagNameNS(
|
|
34450
|
+
paragraphProperties,
|
|
34451
|
+
WORD_NS,
|
|
34452
|
+
"pBdr"
|
|
34453
|
+
);
|
|
34454
|
+
if (paragraphBorders) {
|
|
34455
|
+
const {
|
|
34456
|
+
borderTop,
|
|
34457
|
+
borderRight,
|
|
34458
|
+
borderBottom,
|
|
34459
|
+
borderLeft,
|
|
34460
|
+
borderBetween,
|
|
34461
|
+
borderBar
|
|
34462
|
+
} = parseDocxBoxBorders(paragraphBorders);
|
|
34463
|
+
if (borderTop) style2.borderTop = borderTop;
|
|
34464
|
+
if (borderRight) style2.borderRight = borderRight;
|
|
34465
|
+
if (borderBottom) style2.borderBottom = borderBottom;
|
|
34466
|
+
if (borderLeft) style2.borderLeft = borderLeft;
|
|
34467
|
+
if (borderBetween) style2.borderBetween = borderBetween;
|
|
34468
|
+
if (borderBar) style2.borderBar = borderBar;
|
|
34469
|
+
}
|
|
34470
|
+
const shading = getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "shd");
|
|
34471
|
+
const shadingFill = parseShdFill(shading, colors);
|
|
34472
|
+
if (shadingFill) {
|
|
34473
|
+
style2.shading = shadingFill;
|
|
34474
|
+
}
|
|
34475
|
+
const textDirection = parseTextDirection(
|
|
34476
|
+
getAttributeValue(
|
|
34477
|
+
getFirstChildByTagNameNS(paragraphProperties, WORD_NS, "textDirection"),
|
|
34478
|
+
"val"
|
|
34479
|
+
)
|
|
34480
|
+
);
|
|
34481
|
+
if (textDirection) {
|
|
34482
|
+
style2.textDirection = textDirection;
|
|
34483
|
+
}
|
|
34484
|
+
const outlineLvlEl = getFirstChildByTagNameNS(
|
|
34485
|
+
paragraphProperties,
|
|
34486
|
+
WORD_NS,
|
|
34487
|
+
"outlineLvl"
|
|
34488
|
+
);
|
|
34489
|
+
const outlineLvlVal = getAttributeValue(outlineLvlEl, "val");
|
|
34490
|
+
if (outlineLvlVal !== void 0) {
|
|
34491
|
+
const level = Number(outlineLvlVal);
|
|
34492
|
+
if (Number.isFinite(level) && level >= 0 && level <= 8) {
|
|
34493
|
+
style2.outlineLevel = level;
|
|
34494
|
+
}
|
|
34495
|
+
}
|
|
34496
|
+
const suppressLineNumbers = parseOnOffProperty(
|
|
34497
|
+
paragraphProperties,
|
|
34498
|
+
"suppressLineNumbers"
|
|
34499
|
+
);
|
|
34500
|
+
if (suppressLineNumbers !== void 0) {
|
|
34501
|
+
style2.suppressLineNumbers = suppressLineNumbers;
|
|
34502
|
+
}
|
|
34503
|
+
const suppressAutoHyphens = parseOnOffProperty(
|
|
34504
|
+
paragraphProperties,
|
|
34505
|
+
"suppressAutoHyphens"
|
|
34506
|
+
);
|
|
34507
|
+
if (suppressAutoHyphens !== void 0) {
|
|
34508
|
+
style2.suppressAutoHyphens = suppressAutoHyphens;
|
|
34509
|
+
}
|
|
34510
|
+
const bidi = parseOnOffProperty(paragraphProperties, "bidi");
|
|
34511
|
+
if (bidi !== void 0) {
|
|
34512
|
+
style2.bidi = bidi;
|
|
34513
|
+
}
|
|
34514
|
+
const kinsoku = parseOnOffProperty(paragraphProperties, "kinsoku");
|
|
34515
|
+
if (kinsoku !== void 0) {
|
|
34516
|
+
style2.kinsoku = kinsoku;
|
|
34517
|
+
}
|
|
34518
|
+
const wordWrap = parseOnOffProperty(paragraphProperties, "wordWrap");
|
|
34519
|
+
if (wordWrap !== void 0) {
|
|
34520
|
+
style2.wordWrap = wordWrap;
|
|
34521
|
+
}
|
|
34522
|
+
const overflowPunct = parseOnOffProperty(
|
|
34523
|
+
paragraphProperties,
|
|
34524
|
+
"overflowPunct"
|
|
34525
|
+
);
|
|
34526
|
+
if (overflowPunct !== void 0) {
|
|
34527
|
+
style2.overflowPunct = overflowPunct;
|
|
34528
|
+
}
|
|
34529
|
+
const topLinePunct = parseOnOffProperty(paragraphProperties, "topLinePunct");
|
|
34530
|
+
if (topLinePunct !== void 0) {
|
|
34531
|
+
style2.topLinePunct = topLinePunct;
|
|
34532
|
+
}
|
|
34533
|
+
const autoSpaceDE = parseOnOffProperty(paragraphProperties, "autoSpaceDE");
|
|
34534
|
+
if (autoSpaceDE !== void 0) {
|
|
34535
|
+
style2.autoSpaceDE = autoSpaceDE;
|
|
34536
|
+
}
|
|
34537
|
+
const autoSpaceDN = parseOnOffProperty(paragraphProperties, "autoSpaceDN");
|
|
34538
|
+
if (autoSpaceDN !== void 0) {
|
|
34539
|
+
style2.autoSpaceDN = autoSpaceDN;
|
|
34540
|
+
}
|
|
34541
|
+
const adjustRightInd = parseOnOffProperty(
|
|
34542
|
+
paragraphProperties,
|
|
34543
|
+
"adjustRightInd"
|
|
34544
|
+
);
|
|
34545
|
+
if (adjustRightInd !== void 0) {
|
|
34546
|
+
style2.adjustRightInd = adjustRightInd;
|
|
34547
|
+
}
|
|
34548
|
+
const textAlignmentEl = getFirstChildByTagNameNS(
|
|
34549
|
+
paragraphProperties,
|
|
34550
|
+
WORD_NS,
|
|
34551
|
+
"textAlignment"
|
|
34552
|
+
);
|
|
34553
|
+
const textAlignmentVal = getAttributeValue(textAlignmentEl, "val");
|
|
34554
|
+
if (textAlignmentVal === "auto" || textAlignmentVal === "top" || textAlignmentVal === "center" || textAlignmentVal === "baseline" || textAlignmentVal === "bottom") {
|
|
34555
|
+
style2.textAlignment = textAlignmentVal;
|
|
34556
|
+
}
|
|
34557
|
+
const textboxTightWrapEl = getFirstChildByTagNameNS(
|
|
34558
|
+
paragraphProperties,
|
|
34559
|
+
WORD_NS,
|
|
34560
|
+
"textboxTightWrap"
|
|
34561
|
+
);
|
|
34562
|
+
const textboxTightWrapVal = getAttributeValue(textboxTightWrapEl, "val");
|
|
34563
|
+
if (textboxTightWrapVal === "none" || textboxTightWrapVal === "allLines" || textboxTightWrapVal === "firstLineOnly" || textboxTightWrapVal === "firstLastLine") {
|
|
34564
|
+
style2.textboxTightWrap = textboxTightWrapVal;
|
|
34565
|
+
}
|
|
34566
|
+
const divIdEl = getFirstChildByTagNameNS(
|
|
34567
|
+
paragraphProperties,
|
|
34568
|
+
WORD_NS,
|
|
34569
|
+
"divId"
|
|
34570
|
+
);
|
|
34571
|
+
const divIdVal = getAttributeValue(divIdEl, "val");
|
|
34572
|
+
if (divIdVal !== null) {
|
|
34573
|
+
const divId = Number(divIdVal);
|
|
34574
|
+
if (Number.isFinite(divId) && divId >= 0) {
|
|
34575
|
+
style2.divId = Math.floor(divId);
|
|
34576
|
+
}
|
|
34577
|
+
}
|
|
34578
|
+
const conditionalStyle = parseTableConditionalFlags(paragraphProperties);
|
|
34579
|
+
if (conditionalStyle) {
|
|
34580
|
+
style2.conditionalStyle = conditionalStyle;
|
|
34581
|
+
}
|
|
34582
|
+
const framePrEl = getFirstChildByTagNameNS(
|
|
34583
|
+
paragraphProperties,
|
|
34584
|
+
WORD_NS,
|
|
34585
|
+
"framePr"
|
|
34586
|
+
);
|
|
34587
|
+
if (framePrEl) {
|
|
34588
|
+
const frameDropCap = getAttributeValue(framePrEl, "dropCap");
|
|
34589
|
+
if (!frameDropCap || frameDropCap === "none") {
|
|
34590
|
+
style2.framePrXml = new XMLSerializer().serializeToString(framePrEl);
|
|
34591
|
+
}
|
|
34592
|
+
}
|
|
34593
|
+
return emptyOrUndefined(style2);
|
|
34594
|
+
}
|
|
34375
34595
|
function parseImportedStyles(stylesXml, theme) {
|
|
34376
34596
|
if (!stylesXml) {
|
|
34377
34597
|
return void 0;
|
|
@@ -37294,7 +37514,7 @@ function importDocxInWorker(buffer, options = {}) {
|
|
|
37294
37514
|
const worker = new Worker(
|
|
37295
37515
|
new URL(
|
|
37296
37516
|
/* @vite-ignore */
|
|
37297
|
-
"" + new URL("assets/importDocxWorker-
|
|
37517
|
+
"" + new URL("assets/importDocxWorker-ayg-B322.js", import.meta.url).href,
|
|
37298
37518
|
import.meta.url
|
|
37299
37519
|
),
|
|
37300
37520
|
{
|
|
@@ -43763,7 +43983,7 @@ export {
|
|
|
43763
43983
|
FormField as ay,
|
|
43764
43984
|
Checkbox as az,
|
|
43765
43985
|
getPageBodyTop as b,
|
|
43766
|
-
|
|
43986
|
+
getDocumentParagraphs as b$,
|
|
43767
43987
|
EMU_PER_PT as b0,
|
|
43768
43988
|
OOXML_ROTATION_UNITS as b1,
|
|
43769
43989
|
OOXML_PERCENT_DENOMINATOR as b2,
|
|
@@ -43774,33 +43994,33 @@ export {
|
|
|
43774
43994
|
iterateEndnoteReferenceRuns as b7,
|
|
43775
43995
|
imageContentTypeDefaults as b8,
|
|
43776
43996
|
getRunFieldChar as b9,
|
|
43777
|
-
|
|
43778
|
-
|
|
43779
|
-
|
|
43780
|
-
|
|
43781
|
-
|
|
43782
|
-
|
|
43783
|
-
|
|
43784
|
-
|
|
43785
|
-
|
|
43786
|
-
|
|
43787
|
-
|
|
43788
|
-
|
|
43789
|
-
|
|
43790
|
-
|
|
43791
|
-
|
|
43792
|
-
|
|
43793
|
-
|
|
43794
|
-
|
|
43795
|
-
|
|
43796
|
-
|
|
43797
|
-
|
|
43798
|
-
|
|
43799
|
-
|
|
43800
|
-
|
|
43801
|
-
|
|
43802
|
-
|
|
43803
|
-
|
|
43997
|
+
DOUBLE_STRIKE_OFFSET_PX as bA,
|
|
43998
|
+
resolveListLabel as bB,
|
|
43999
|
+
getListLabelInset as bC,
|
|
44000
|
+
getAlignedListLabelInset as bD,
|
|
44001
|
+
getParagraphBorderInsets as bE,
|
|
44002
|
+
buildSegmentTable as bF,
|
|
44003
|
+
buildCanvasTableLayout as bG,
|
|
44004
|
+
resolveCanvasTableWidth as bH,
|
|
44005
|
+
resolveFloatingTableRect as bI,
|
|
44006
|
+
paragraphBetweenBorderMatches as bJ,
|
|
44007
|
+
normalizeFamily as bK,
|
|
44008
|
+
ROBOTO_FONT_FILES as bL,
|
|
44009
|
+
loadFontAsset as bM,
|
|
44010
|
+
OFFICE_COMPAT_FONT_FAMILIES as bN,
|
|
44011
|
+
BinaryReader as bO,
|
|
44012
|
+
buildSfnt as bP,
|
|
44013
|
+
defaultFontDecoderRegistry as bQ,
|
|
44014
|
+
SfntFontProgram as bR,
|
|
44015
|
+
collectPdfFontFamilies as bS,
|
|
44016
|
+
outlineFrom as bT,
|
|
44017
|
+
getPageHeaderZoneTop as bU,
|
|
44018
|
+
getPageColumnRects as bV,
|
|
44019
|
+
findFootnoteReference as bW,
|
|
44020
|
+
resolveImporterForFile as bX,
|
|
44021
|
+
roundTo as bY,
|
|
44022
|
+
getDocumentSectionsCanonical as bZ,
|
|
44023
|
+
getDocumentParagraphsCanonical as b_,
|
|
43804
44024
|
getRunFieldInstruction as ba,
|
|
43805
44025
|
createEditorRun as bb,
|
|
43806
44026
|
JSZip as bc,
|
|
@@ -43823,101 +44043,103 @@ export {
|
|
|
43823
44043
|
rgb255ToHex as bt,
|
|
43824
44044
|
getImageFloatingGeometry as bu,
|
|
43825
44045
|
textStyleToFontSizePt as bv,
|
|
43826
|
-
|
|
43827
|
-
|
|
43828
|
-
|
|
43829
|
-
|
|
44046
|
+
resolveTextAlignmentBaselineOffset as bw,
|
|
44047
|
+
TEXT_BASELINE_RATIO as bx,
|
|
44048
|
+
resolveOpenTypeFeatureTags as by,
|
|
44049
|
+
resolveDecorationLineY as bz,
|
|
43830
44050
|
getPageContentWidth as c,
|
|
43831
|
-
|
|
43832
|
-
|
|
43833
|
-
|
|
43834
|
-
|
|
43835
|
-
|
|
43836
|
-
|
|
43837
|
-
|
|
43838
|
-
|
|
43839
|
-
|
|
43840
|
-
|
|
43841
|
-
|
|
43842
|
-
|
|
43843
|
-
|
|
43844
|
-
|
|
43845
|
-
|
|
43846
|
-
|
|
43847
|
-
|
|
43848
|
-
|
|
43849
|
-
|
|
43850
|
-
|
|
43851
|
-
|
|
43852
|
-
|
|
43853
|
-
|
|
43854
|
-
|
|
43855
|
-
|
|
43856
|
-
|
|
43857
|
-
|
|
43858
|
-
|
|
43859
|
-
|
|
43860
|
-
|
|
43861
|
-
|
|
43862
|
-
|
|
43863
|
-
|
|
43864
|
-
|
|
43865
|
-
|
|
43866
|
-
|
|
43867
|
-
|
|
43868
|
-
|
|
43869
|
-
|
|
43870
|
-
|
|
43871
|
-
|
|
43872
|
-
|
|
43873
|
-
|
|
43874
|
-
|
|
43875
|
-
|
|
43876
|
-
|
|
43877
|
-
|
|
43878
|
-
|
|
43879
|
-
|
|
43880
|
-
|
|
43881
|
-
|
|
43882
|
-
|
|
43883
|
-
|
|
43884
|
-
|
|
43885
|
-
|
|
43886
|
-
|
|
43887
|
-
|
|
43888
|
-
|
|
43889
|
-
|
|
43890
|
-
|
|
43891
|
-
|
|
43892
|
-
|
|
43893
|
-
|
|
43894
|
-
|
|
44051
|
+
FloatingActionButton as c$,
|
|
44052
|
+
getDocumentPageSettings as c0,
|
|
44053
|
+
getTableCellContentWidthForParagraph as c1,
|
|
44054
|
+
layoutMetricsEpoch as c2,
|
|
44055
|
+
bumpLayoutMetricsEpoch as c3,
|
|
44056
|
+
createCanvasLayoutSnapshotProvider as c4,
|
|
44057
|
+
on as c5,
|
|
44058
|
+
debounce as c6,
|
|
44059
|
+
unwrap as c7,
|
|
44060
|
+
perfTimer as c8,
|
|
44061
|
+
getRunTextBox as c9,
|
|
44062
|
+
fontSizePtToPx as cA,
|
|
44063
|
+
createDefaultToolbarPreset as cB,
|
|
44064
|
+
MenuRegistry as cC,
|
|
44065
|
+
createToolbarRegistry as cD,
|
|
44066
|
+
Editor as cE,
|
|
44067
|
+
resolveCommandRef as cF,
|
|
44068
|
+
commandRefName as cG,
|
|
44069
|
+
createOasisEditorClient as cH,
|
|
44070
|
+
createEditorZoom as cI,
|
|
44071
|
+
startLongTaskObserver as cJ,
|
|
44072
|
+
installGlobalReport as cK,
|
|
44073
|
+
applyStoredPreciseFontPreference as cL,
|
|
44074
|
+
getWelcomeSeen as cM,
|
|
44075
|
+
isLocalFontAccessSupported as cN,
|
|
44076
|
+
EDITOR_SCROLL_PADDING_PX as cO,
|
|
44077
|
+
Toolbar as cP,
|
|
44078
|
+
OasisEditorLoading as cQ,
|
|
44079
|
+
I18nProvider as cR,
|
|
44080
|
+
createTranslator as cS,
|
|
44081
|
+
registerDomStatsSurface as cT,
|
|
44082
|
+
createEditorLogger as cU,
|
|
44083
|
+
ActionRow as cV,
|
|
44084
|
+
ColorPicker as cW,
|
|
44085
|
+
CommandRegistry as cX,
|
|
44086
|
+
DEFAULT_PALETTE as cY,
|
|
44087
|
+
DialogFooter as cZ,
|
|
44088
|
+
FieldRow as c_,
|
|
44089
|
+
createEditorDocument as ca,
|
|
44090
|
+
resolveResizedDimensions as cb,
|
|
44091
|
+
resolveTextBoxRenderHeight as cc,
|
|
44092
|
+
getToolbarStyleState as cd,
|
|
44093
|
+
VERTICAL_HIT_WEIGHT as ce,
|
|
44094
|
+
getCachedCanvasImage as cf,
|
|
44095
|
+
measureParagraphMinContentWidthPx as cg,
|
|
44096
|
+
getEditableBlocksForZone as ch,
|
|
44097
|
+
findParagraphLocation as ci,
|
|
44098
|
+
createSectionBoundaryParagraph as cj,
|
|
44099
|
+
normalizePageSettings as ck,
|
|
44100
|
+
DEFAULT_EDITOR_PAGE_SETTINGS as cl,
|
|
44101
|
+
markStart as cm,
|
|
44102
|
+
markEnd as cn,
|
|
44103
|
+
getParagraphEntries as co,
|
|
44104
|
+
getParagraphById as cp,
|
|
44105
|
+
createEditorFootnote as cq,
|
|
44106
|
+
createFootnoteReferenceRun as cr,
|
|
44107
|
+
renumberFootnotes as cs,
|
|
44108
|
+
getHeadingLevel as ct,
|
|
44109
|
+
preciseFontModeVersion as cu,
|
|
44110
|
+
isPreciseFontModeEnabled as cv,
|
|
44111
|
+
resolveNamedTextStyle as cw,
|
|
44112
|
+
togglePreciseFontMode as cx,
|
|
44113
|
+
nextFontSizePt as cy,
|
|
44114
|
+
previousFontSizePt as cz,
|
|
43895
44115
|
domTextMeasurer as d,
|
|
43896
|
-
|
|
43897
|
-
|
|
43898
|
-
|
|
43899
|
-
|
|
43900
|
-
|
|
43901
|
-
|
|
43902
|
-
|
|
43903
|
-
|
|
43904
|
-
|
|
43905
|
-
|
|
43906
|
-
|
|
43907
|
-
|
|
43908
|
-
|
|
43909
|
-
|
|
43910
|
-
|
|
43911
|
-
|
|
43912
|
-
|
|
43913
|
-
|
|
43914
|
-
|
|
43915
|
-
|
|
43916
|
-
|
|
43917
|
-
|
|
43918
|
-
|
|
43919
|
-
|
|
43920
|
-
|
|
44116
|
+
GridPicker as d0,
|
|
44117
|
+
Heading as d1,
|
|
44118
|
+
IconButton as d2,
|
|
44119
|
+
Menu as d3,
|
|
44120
|
+
OASIS_BUILTIN_COMMANDS as d4,
|
|
44121
|
+
OASIS_MENU_ITEMS as d5,
|
|
44122
|
+
OASIS_TOOLBAR_ITEMS as d6,
|
|
44123
|
+
OasisEditorAppLazy as d7,
|
|
44124
|
+
OasisEditorContainer as d8,
|
|
44125
|
+
PluginCollection as d9,
|
|
44126
|
+
Popover as da,
|
|
44127
|
+
RIBBON_TABS as db,
|
|
44128
|
+
Select as dc,
|
|
44129
|
+
Separator as dd,
|
|
44130
|
+
SidePanel as de,
|
|
44131
|
+
SidePanelBody as df,
|
|
44132
|
+
SidePanelFooter as dg,
|
|
44133
|
+
SidePanelHeader as dh,
|
|
44134
|
+
SplitButton as di,
|
|
44135
|
+
StyleGallery as dj,
|
|
44136
|
+
Button$1 as dk,
|
|
44137
|
+
buildRibbonTabDefinitions as dl,
|
|
44138
|
+
createEditorCommandBus as dm,
|
|
44139
|
+
createOasisEditor as dn,
|
|
44140
|
+
createOasisEditorContainer as dp,
|
|
44141
|
+
mount as dq,
|
|
44142
|
+
registerToolbarRenderer as dr,
|
|
43921
44143
|
estimateTableBlockHeight as e,
|
|
43922
44144
|
getParagraphText as f,
|
|
43923
44145
|
getProjectedParagraphBlockHeight as g,
|