@a3s-lab/office 0.25.0 → 0.27.0
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/README.md +76 -2
- package/dist/0~4595.js +16 -2
- package/dist/0~5093.js +463 -201
- package/dist/0~6090.js +77 -77
- package/dist/{0~2805.js → 0~7043.js} +305 -2
- package/dist/0~document-editor.js +2451 -985
- package/dist/0~spreadsheet-editor.js +22113 -20117
- package/dist/0~work-docx-export.js +492 -10
- package/dist/0~work-docx-import.js +171 -98
- package/dist/0~work-office-diagnostics.js +198 -4
- package/dist/{164.js → 1544.js} +1412 -1055
- package/dist/4104.js +145 -29
- package/dist/6282.js +1920 -544
- package/dist/9424.js +16 -0
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +102 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +83 -0
- package/dist/internal/features/work/editors/document-font-dialog-script-font-model.d.ts +18 -0
- package/dist/internal/features/work/editors/document-font-dialog.d.ts +9 -0
- package/dist/internal/features/work/editors/document-home-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-page-chrome-editor.d.ts +6 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-strike-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/document-text-case-ribbon.d.ts +4 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
- package/dist/internal/features/work/editors/document-underline-ribbon.d.ts +9 -0
- package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +1 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill-format.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +18 -9
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +13 -2
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-panel.d.ts +13 -0
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-preview.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-operation-projection.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-dom-selection.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-paste.d.ts +22 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-controller.d.ts +38 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-format.d.ts +26 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +9 -1
- package/dist/internal/features/work/work-css-color.d.ts +1 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +16 -1
- package/dist/internal/features/work/work-document-character-position.d.ts +9 -0
- package/dist/internal/features/work/work-document-character-scale.d.ts +8 -0
- package/dist/internal/features/work/work-document-character-spacing.d.ts +8 -0
- package/dist/internal/features/work/work-document-emphasis.d.ts +7 -0
- package/dist/internal/features/work/work-document-equations.d.ts +2 -1
- package/dist/internal/features/work/work-document-format-changes.d.ts +16 -2
- package/dist/internal/features/work/work-document-hidden-text.d.ts +5 -0
- package/dist/internal/features/work/work-document-kerning.d.ts +10 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +1 -1
- package/dist/internal/features/work/work-document-script-font-extension.d.ts +2 -0
- package/dist/internal/features/work/work-document-script-fonts.d.ts +51 -0
- package/dist/internal/features/work/work-document-strike.d.ts +21 -0
- package/dist/internal/features/work/work-document-text-case.d.ts +10 -0
- package/dist/internal/features/work/work-document-underline.d.ts +37 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +12 -0
- package/dist/internal/features/work/work-docx-character-position.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-scale.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-spacing.d.ts +4 -0
- package/dist/internal/features/work/work-docx-emphasis-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-emphasis.d.ts +14 -0
- package/dist/internal/features/work/work-docx-hidden-text-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-hidden-text-export.d.ts +16 -0
- package/dist/internal/features/work/work-docx-hidden-text.d.ts +11 -0
- package/dist/internal/features/work/work-docx-kerning-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-kerning.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-fonts-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts.d.ts +13 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +23 -2
- package/dist/internal/features/work/work-docx-run-script-font-import.d.ts +9 -0
- package/dist/internal/features/work/work-docx-strike.d.ts +8 -0
- package/dist/internal/features/work/work-docx-theme-reference.d.ts +1 -1
- package/dist/internal/features/work/work-docx-twips.d.ts +6 -0
- package/dist/internal/features/work/work-docx-underline.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-gradient-fill-canvas.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-native-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-spreadsheet-pattern-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-xlsx-cell-style-origin.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-cell-style-writer.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-cell-styles.d.ts +4 -0
- package/dist/internal/features/work/work-xlsx-gradient-fill.d.ts +31 -0
- package/dist/internal/features/work/work-xlsx-native-fill.d.ts +17 -0
- package/dist/internal/features/work/work-xlsx-pattern-fill.d.ts +21 -0
- package/dist/internal/features/work/work-xlsx-rich-text-edit.d.ts +28 -0
- package/dist/internal/features/work/work-xlsx-rich-text-model.d.ts +40 -0
- package/dist/internal/features/work/work-xlsx-rich-text.d.ts +4 -18
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +770 -80
- package/docs/latest/en/browser-editor-architecture.md +37 -0
- package/package.json +32 -1
package/dist/0~5093.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { descendants, directChildren as work_ooxml_package_directChildren, xmlNamespacePrefix, directChild, attribute as work_ooxml_package_attribute, childPath } from "./5184.js";
|
|
2
|
-
import {
|
|
3
|
-
import { DOCUMENT_PARAGRAPH_BORDER_STYLES, normalizeDocumentParagraphBorders as work_document_paragraph_borders_normalizeDocumentParagraphBorders, DOCUMENT_PARAGRAPH_BORDER_EDGES,
|
|
2
|
+
import { docxThemeFont, XML_NAMESPACE as work_docx_settings_xml_XML_NAMESPACE, XMLNS_NAMESPACE as work_docx_settings_xml_XMLNS_NAMESPACE, STRICT_WORDPROCESSING_NAMESPACE, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, docxCharacterScalePercentFromProperties, resolveDocxEmphasisMark, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver as work_docx_theme_resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, parseDocxTwipsMeasure } from "./0~7043.js";
|
|
3
|
+
import { normalizeDocumentEmphasisMark, normalizeDocumentPageBorders, normalizeDocumentParagraphBorder, documentCharacterPositionDomAttributes, DOCUMENT_PAGE_BORDER_EDGES, normalizeDocumentTabStops, documentTextCaseFromWordFlags, DOCUMENT_PARAGRAPH_SHADING_PATTERNS, documentStrikeDomAttributes, documentAutoLineHeight, documentScriptFontFallbackSlots, normalizeDocumentUnderlineColor, documentScriptFontsDomAttributes, documentKerningDomAttributes, documentCharacterScaleDomAttributes, documentParagraphShadingDomAttributes, serializeDocxThemeReference, documentParagraphBordersDomAttributes, normalizeDocumentScriptFontHint, serializeDocumentParagraphFormatting, normalizeDocumentPaperSource, documentEquationText, normalizeDocumentScriptFonts, DOCUMENT_PARAGRAPH_BORDER_STYLES, normalizeDocumentParagraphBorders as work_document_paragraph_borders_normalizeDocumentParagraphBorders, DOCUMENT_PARAGRAPH_BORDER_EDGES, normalizeDocumentParagraphIndent, documentScriptFontFamily, normalizeDocumentThemeFont, documentCharacterSpacingDomAttributes, normalizeDocumentEquation, renderDocumentAutoLineHeight, documentUnderlineDomAttributes, normalizeDocumentUnderlineStyle, normalizeDocumentFontName, applyDocumentTextCaseStyle, documentHiddenTextDomAttributes, importedDocumentCharacterFormatting, documentScriptFontSegments, createDocumentEquationElement, normalizeDocumentPageGeometry, serializeDocumentTabStops, documentEmphasisMarkDomAttributes, normalizeDocumentPageMargins, documentWordLineHeightFactor } from "./6282.js";
|
|
4
4
|
function docxCaptionSequenceKind(instruction) {
|
|
5
5
|
const identifier = /^\s*SEQ\s+([^\s\\]+)/i.exec(instruction)?.[1]?.toLowerCase();
|
|
6
6
|
if (!identifier) return null;
|
|
@@ -1066,13 +1066,6 @@ const WORD_VERTICAL_ALIGNMENTS = new Set([
|
|
|
1066
1066
|
"superscript",
|
|
1067
1067
|
"subscript"
|
|
1068
1068
|
]);
|
|
1069
|
-
const WORD_EMPHASIS_MARKS = new Set([
|
|
1070
|
-
'none',
|
|
1071
|
-
'dot',
|
|
1072
|
-
'comma',
|
|
1073
|
-
'circle',
|
|
1074
|
-
'underDot'
|
|
1075
|
-
]);
|
|
1076
1069
|
const WORD_COMBINE_BRACKETS = new Set([
|
|
1077
1070
|
'none',
|
|
1078
1071
|
'round',
|
|
@@ -1096,8 +1089,6 @@ const MAX_WORD_FONT_NAME_LENGTH = 127;
|
|
|
1096
1089
|
const MAX_WORD_LANGUAGE_LENGTH = 85;
|
|
1097
1090
|
const MAX_WORD_HALF_POINT_SIZE = 1024;
|
|
1098
1091
|
const MAX_WORD_CHARACTER_SPACING_TWIPS = 31680;
|
|
1099
|
-
const MAX_WORD_CHARACTER_SCALE_PERCENT = 600;
|
|
1100
|
-
const MAX_WORD_KERNING_THRESHOLD_HALF_POINTS = 3277;
|
|
1101
1092
|
const MIN_WORD_LINE_BORDER_EIGHTH_POINTS = 2;
|
|
1102
1093
|
const MAX_WORD_LINE_BORDER_EIGHTH_POINTS = 96;
|
|
1103
1094
|
const MAX_WORD_BORDER_SPACING_POINTS = 31;
|
|
@@ -1561,7 +1552,7 @@ function parseWordRunProperties(properties) {
|
|
|
1561
1552
|
const color = parseWordRunColor(children.get('color'));
|
|
1562
1553
|
const characterSpacingTwips = parseWordRequiredInteger(children.get('spacing'), -MAX_WORD_CHARACTER_SPACING_TWIPS, MAX_WORD_CHARACTER_SPACING_TWIPS);
|
|
1563
1554
|
const characterScalePercent = parseWordCharacterScale(children.get('w'));
|
|
1564
|
-
const kerningThresholdHalfPoints = parseWordRequiredInteger(children.get('kern'), 0,
|
|
1555
|
+
const kerningThresholdHalfPoints = parseWordRequiredInteger(children.get('kern'), 0, 3277);
|
|
1565
1556
|
const positionHalfPoints = parseWordPosition(children.get('position'));
|
|
1566
1557
|
const fontSize = parseWordHalfPointSize(children.get('sz'));
|
|
1567
1558
|
const fontSizeComplexScript = parseWordHalfPointSize(children.get('szCs'));
|
|
@@ -1980,7 +1971,7 @@ function parseWordCharacterScale(element) {
|
|
|
1980
1971
|
]));
|
|
1981
1972
|
if (!attributes) return null;
|
|
1982
1973
|
if (!attributes.size) return 100;
|
|
1983
|
-
return wordIntegerValue(attributes.get('val')?.trim() ?? '', 1,
|
|
1974
|
+
return wordIntegerValue(attributes.get('val')?.trim() ?? '', 1, 600);
|
|
1984
1975
|
}
|
|
1985
1976
|
function parseWordPosition(element) {
|
|
1986
1977
|
if (!element) return;
|
|
@@ -2170,7 +2161,7 @@ function parseWordEmphasisMark(element) {
|
|
|
2170
2161
|
'val'
|
|
2171
2162
|
]));
|
|
2172
2163
|
const value = attributes?.get('val')?.trim();
|
|
2173
|
-
return attributes?.size === 1
|
|
2164
|
+
return attributes?.size === 1 ? normalizeDocumentEmphasisMark(value) : null;
|
|
2174
2165
|
}
|
|
2175
2166
|
function parseWordLanguages(element) {
|
|
2176
2167
|
if (!element) return;
|
|
@@ -4082,6 +4073,65 @@ function nextEquationMarker(state) {
|
|
|
4082
4073
|
state.occupiedText += marker;
|
|
4083
4074
|
return marker;
|
|
4084
4075
|
}
|
|
4076
|
+
const ON_VALUES = new Set([
|
|
4077
|
+
'1',
|
|
4078
|
+
'on',
|
|
4079
|
+
'true'
|
|
4080
|
+
]);
|
|
4081
|
+
const OFF_VALUES = new Set([
|
|
4082
|
+
'0',
|
|
4083
|
+
'off',
|
|
4084
|
+
'false'
|
|
4085
|
+
]);
|
|
4086
|
+
function inspectDocxHiddenText(properties) {
|
|
4087
|
+
if (!properties) return {
|
|
4088
|
+
status: 'absent'
|
|
4089
|
+
};
|
|
4090
|
+
const localMatches = work_ooxml_package_directChildren(properties, 'vanish');
|
|
4091
|
+
if (!localMatches.length) return {
|
|
4092
|
+
status: 'absent'
|
|
4093
|
+
};
|
|
4094
|
+
const nativeMatches = localMatches.filter((element)=>DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? ''));
|
|
4095
|
+
if (1 !== localMatches.length || 1 !== nativeMatches.length) return {
|
|
4096
|
+
status: 'invalid'
|
|
4097
|
+
};
|
|
4098
|
+
const vanish = nativeMatches[0];
|
|
4099
|
+
if (work_ooxml_package_directChildren(vanish).length || Array.from(vanish.childNodes).some((node)=>(node.nodeType === Node.TEXT_NODE || node.nodeType === Node.CDATA_SECTION_NODE) && Boolean(node.textContent?.trim()))) return {
|
|
4100
|
+
status: 'invalid'
|
|
4101
|
+
};
|
|
4102
|
+
const attributes = Array.from(vanish.attributes).filter((attribute)=>xmlAttributeNamespace(vanish, attribute) !== work_docx_settings_xml_XMLNS_NAMESPACE && 'xmlns' !== attribute.name && !attribute.name.startsWith('xmlns:'));
|
|
4103
|
+
if (!attributes.length) return {
|
|
4104
|
+
status: 'valid',
|
|
4105
|
+
value: true
|
|
4106
|
+
};
|
|
4107
|
+
if (1 !== attributes.length || 'val' !== xmlAttributeLocalName(attributes[0]) || !DOCX_WORDPROCESSING_NAMESPACES.has(xmlAttributeNamespace(vanish, attributes[0]) ?? '')) return {
|
|
4108
|
+
status: 'invalid'
|
|
4109
|
+
};
|
|
4110
|
+
const value = attributes[0].value;
|
|
4111
|
+
if (ON_VALUES.has(value)) return {
|
|
4112
|
+
status: 'valid',
|
|
4113
|
+
value: true
|
|
4114
|
+
};
|
|
4115
|
+
if (OFF_VALUES.has(value)) return {
|
|
4116
|
+
status: 'valid',
|
|
4117
|
+
value: false
|
|
4118
|
+
};
|
|
4119
|
+
return {
|
|
4120
|
+
status: 'invalid'
|
|
4121
|
+
};
|
|
4122
|
+
}
|
|
4123
|
+
function docxHiddenTextFromProperties(properties) {
|
|
4124
|
+
const inspection = inspectDocxHiddenText(properties);
|
|
4125
|
+
return 'valid' === inspection.status ? inspection.value : void 0;
|
|
4126
|
+
}
|
|
4127
|
+
function resolveDocxHiddenText(propertySources) {
|
|
4128
|
+
let hiddenText;
|
|
4129
|
+
for (const properties of propertySources){
|
|
4130
|
+
const candidate = docxHiddenTextFromProperties(properties);
|
|
4131
|
+
if (void 0 !== candidate) hiddenText = candidate;
|
|
4132
|
+
}
|
|
4133
|
+
return hiddenText;
|
|
4134
|
+
}
|
|
4085
4135
|
const MAX_STYLE_INHERITANCE_DEPTH = 64;
|
|
4086
4136
|
function createDocxParagraphStyleResolver(stylesDocument) {
|
|
4087
4137
|
if (!stylesDocument) return {
|
|
@@ -4640,14 +4690,14 @@ function parseBorderColor(attributes, theme) {
|
|
|
4640
4690
|
if (!semanticValue) return null;
|
|
4641
4691
|
return {
|
|
4642
4692
|
value: semanticValue,
|
|
4643
|
-
theme:
|
|
4693
|
+
theme: work_docx_paragraph_borders_import_themeReference(themeName, semanticValue, tint, shade)
|
|
4644
4694
|
};
|
|
4645
4695
|
}
|
|
4646
4696
|
if ('none' === themeName) {
|
|
4647
4697
|
const value = color ?? 'auto';
|
|
4648
4698
|
return {
|
|
4649
4699
|
value,
|
|
4650
|
-
theme:
|
|
4700
|
+
theme: work_docx_paragraph_borders_import_themeReference(themeName, 'auto' === value ? '#000000' : value, tint, shade)
|
|
4651
4701
|
};
|
|
4652
4702
|
}
|
|
4653
4703
|
if (!color) return null;
|
|
@@ -4655,7 +4705,7 @@ function parseBorderColor(attributes, theme) {
|
|
|
4655
4705
|
value: color
|
|
4656
4706
|
};
|
|
4657
4707
|
}
|
|
4658
|
-
function
|
|
4708
|
+
function work_docx_paragraph_borders_import_themeReference(theme, resolved, tint, shade) {
|
|
4659
4709
|
return {
|
|
4660
4710
|
theme,
|
|
4661
4711
|
resolved,
|
|
@@ -5084,6 +5134,66 @@ function work_docx_paragraph_shading_import_textNodes(root) {
|
|
|
5084
5134
|
while(walker.nextNode())nodes.push(walker.currentNode);
|
|
5085
5135
|
return nodes;
|
|
5086
5136
|
}
|
|
5137
|
+
function importedDocxUnderline(element, theme) {
|
|
5138
|
+
const rawStyle = work_ooxml_package_attribute(element, 'val');
|
|
5139
|
+
const style = null === rawStyle ? 'single' : normalizeDocumentUnderlineStyle(rawStyle) ?? 'single';
|
|
5140
|
+
const themeName = work_ooxml_package_attribute(element, 'themeColor')?.trim();
|
|
5141
|
+
const tint = normalizedByteHex(work_ooxml_package_attribute(element, 'themeTint'));
|
|
5142
|
+
const shade = normalizedByteHex(work_ooxml_package_attribute(element, 'themeShade'));
|
|
5143
|
+
const themed = theme && themeName ? docxThemeColor(theme, themeName, tint, shade) : void 0;
|
|
5144
|
+
const direct = normalizeDocumentUnderlineColor(work_ooxml_package_attribute(element, 'color'));
|
|
5145
|
+
const color = themed ? `#${themed}` : direct;
|
|
5146
|
+
const themeColor = themeName && color ? underlineThemeReference(themeName, color, tint, shade) : void 0;
|
|
5147
|
+
return {
|
|
5148
|
+
style,
|
|
5149
|
+
...color ? {
|
|
5150
|
+
color
|
|
5151
|
+
} : {},
|
|
5152
|
+
...themeColor ? {
|
|
5153
|
+
themeColor
|
|
5154
|
+
} : {}
|
|
5155
|
+
};
|
|
5156
|
+
}
|
|
5157
|
+
function underlineThemeReference(theme, resolved, tint, shade) {
|
|
5158
|
+
return {
|
|
5159
|
+
theme,
|
|
5160
|
+
resolved,
|
|
5161
|
+
...tint ? {
|
|
5162
|
+
tint
|
|
5163
|
+
} : {},
|
|
5164
|
+
...shade ? {
|
|
5165
|
+
shade
|
|
5166
|
+
} : {}
|
|
5167
|
+
};
|
|
5168
|
+
}
|
|
5169
|
+
function normalizedByteHex(value) {
|
|
5170
|
+
const normalized = value?.trim().toUpperCase();
|
|
5171
|
+
return normalized && /^[0-9A-F]{2}$/.test(normalized) ? normalized : void 0;
|
|
5172
|
+
}
|
|
5173
|
+
function importedDocxStrikeFlags(properties) {
|
|
5174
|
+
return {
|
|
5175
|
+
...importedFlag(directChild(properties, 'strike'), 'single'),
|
|
5176
|
+
...importedFlag(directChild(properties, 'dstrike'), 'double')
|
|
5177
|
+
};
|
|
5178
|
+
}
|
|
5179
|
+
function importedDocxStrike(properties) {
|
|
5180
|
+
const flags = importedDocxStrikeFlags(properties);
|
|
5181
|
+
return resolvedDocxStrikeFormatting(flags.single, flags.double);
|
|
5182
|
+
}
|
|
5183
|
+
function resolvedDocxStrikeFormatting(single, double, materializeNone = false) {
|
|
5184
|
+
if (void 0 === single && void 0 === double && !materializeNone) return;
|
|
5185
|
+
const style = double ? 'double' : single ? 'single' : 'none';
|
|
5186
|
+
return {
|
|
5187
|
+
style
|
|
5188
|
+
};
|
|
5189
|
+
}
|
|
5190
|
+
function importedFlag(element, name) {
|
|
5191
|
+
if (!element) return {};
|
|
5192
|
+
const value = work_ooxml_package_attribute(element, 'val')?.trim().toLowerCase();
|
|
5193
|
+
return {
|
|
5194
|
+
[name]: '0' !== value && 'false' !== value && 'off' !== value
|
|
5195
|
+
};
|
|
5196
|
+
}
|
|
5087
5197
|
const PAGE_BORDER_EDGE_SET = new Set(DOCUMENT_PAGE_BORDER_EDGES);
|
|
5088
5198
|
const PAGE_BORDER_ATTRIBUTES = new Set([
|
|
5089
5199
|
'zOrder',
|
|
@@ -5231,64 +5341,6 @@ function hasNonWhitespaceText(element) {
|
|
|
5231
5341
|
function work_docx_page_borders_import_isNamespaceDeclaration(attribute) {
|
|
5232
5342
|
return attribute.namespaceURI === work_docx_settings_xml_XMLNS_NAMESPACE || 'xmlns' === attribute.name || attribute.name.startsWith('xmlns:');
|
|
5233
5343
|
}
|
|
5234
|
-
const STRICT_WORDPROCESSING_NAMESPACE = 'http://purl.oclc.org/ooxml/wordprocessingml/main';
|
|
5235
|
-
const UNIVERSAL_TWIP_RATIOS = {
|
|
5236
|
-
mm: [
|
|
5237
|
-
7200n,
|
|
5238
|
-
127n
|
|
5239
|
-
],
|
|
5240
|
-
cm: [
|
|
5241
|
-
72000n,
|
|
5242
|
-
127n
|
|
5243
|
-
],
|
|
5244
|
-
in: [
|
|
5245
|
-
1440n,
|
|
5246
|
-
1n
|
|
5247
|
-
],
|
|
5248
|
-
pt: [
|
|
5249
|
-
20n,
|
|
5250
|
-
1n
|
|
5251
|
-
],
|
|
5252
|
-
pc: [
|
|
5253
|
-
240n,
|
|
5254
|
-
1n
|
|
5255
|
-
],
|
|
5256
|
-
pi: [
|
|
5257
|
-
240n,
|
|
5258
|
-
1n
|
|
5259
|
-
]
|
|
5260
|
-
};
|
|
5261
|
-
function parseDocxTwipsMeasure(source, options) {
|
|
5262
|
-
const integer = parseBoundedDocxInteger(source, {
|
|
5263
|
-
minimum: options.minimum,
|
|
5264
|
-
maximum: options.maximum,
|
|
5265
|
-
signed: options.signed
|
|
5266
|
-
});
|
|
5267
|
-
if (null !== integer) return integer;
|
|
5268
|
-
return options.strict ? parseStrictUniversalTwips(source, options) : null;
|
|
5269
|
-
}
|
|
5270
|
-
function parseBoundedDocxInteger(source, options) {
|
|
5271
|
-
if (source.length > 32) return null;
|
|
5272
|
-
const pattern = options.signed ? /^[+-]?\d+$/u : /^\+?\d+$/u;
|
|
5273
|
-
if (!pattern.test(source)) return null;
|
|
5274
|
-
const value = Number(source);
|
|
5275
|
-
return Number.isSafeInteger(value) && value >= options.minimum && value <= options.maximum ? Object.is(value, -0) ? 0 : value : null;
|
|
5276
|
-
}
|
|
5277
|
-
function parseStrictUniversalTwips(source, options) {
|
|
5278
|
-
if (source.length > 64) return null;
|
|
5279
|
-
const match = /^(-?)(\d+)(?:\.(\d+))?(mm|cm|in|pt|pc|pi)$/u.exec(source);
|
|
5280
|
-
if (!match) return null;
|
|
5281
|
-
const [, sign, whole = '', fraction = '', unit = ''] = match;
|
|
5282
|
-
if (!options.signed && sign) return null;
|
|
5283
|
-
const conversion = UNIVERSAL_TWIP_RATIOS[unit];
|
|
5284
|
-
if (!conversion) return null;
|
|
5285
|
-
const denominator = 10n ** BigInt(fraction.length) * conversion[1];
|
|
5286
|
-
const numerator = BigInt(`${whole}${fraction}`) * conversion[0] * (sign ? -1n : 1n);
|
|
5287
|
-
if (numerator % denominator !== 0n) return null;
|
|
5288
|
-
const twips = numerator / denominator;
|
|
5289
|
-
if (twips < BigInt(options.minimum) || twips > BigInt(options.maximum)) return null;
|
|
5290
|
-
return Number(twips);
|
|
5291
|
-
}
|
|
5292
5344
|
const PAGE_MARGIN_ATTRIBUTE_SET = new Set([
|
|
5293
5345
|
'top',
|
|
5294
5346
|
'right',
|
|
@@ -6599,6 +6651,151 @@ function work_docx_paragraph_format_change_import_textNodes(root) {
|
|
|
6599
6651
|
while(walker.nextNode())nodes.push(walker.currentNode);
|
|
6600
6652
|
return nodes;
|
|
6601
6653
|
}
|
|
6654
|
+
const FONT_ATTRIBUTES = new Set([
|
|
6655
|
+
'ascii',
|
|
6656
|
+
'hAnsi',
|
|
6657
|
+
'eastAsia',
|
|
6658
|
+
'cs',
|
|
6659
|
+
'asciiTheme',
|
|
6660
|
+
'hAnsiTheme',
|
|
6661
|
+
'eastAsiaTheme',
|
|
6662
|
+
'cstheme',
|
|
6663
|
+
'hint'
|
|
6664
|
+
]);
|
|
6665
|
+
const EMPTY_THEME = {
|
|
6666
|
+
colors: new Map(),
|
|
6667
|
+
fonts: new Map()
|
|
6668
|
+
};
|
|
6669
|
+
function inspectDocxRunFonts(properties, theme = EMPTY_THEME) {
|
|
6670
|
+
if (!properties) return {
|
|
6671
|
+
status: 'absent'
|
|
6672
|
+
};
|
|
6673
|
+
const candidates = work_ooxml_package_directChildren(properties, 'rFonts');
|
|
6674
|
+
if (!candidates.length) return {
|
|
6675
|
+
status: 'absent'
|
|
6676
|
+
};
|
|
6677
|
+
if (1 !== candidates.length) return {
|
|
6678
|
+
status: 'invalid'
|
|
6679
|
+
};
|
|
6680
|
+
const value = parseDocxRunFontsElement(candidates[0], theme);
|
|
6681
|
+
return void 0 === value ? {
|
|
6682
|
+
status: 'invalid'
|
|
6683
|
+
} : {
|
|
6684
|
+
status: 'valid',
|
|
6685
|
+
value
|
|
6686
|
+
};
|
|
6687
|
+
}
|
|
6688
|
+
function resolveDocxRunFonts(propertySources, theme) {
|
|
6689
|
+
const resolved = {};
|
|
6690
|
+
let found = false;
|
|
6691
|
+
for (const properties of propertySources){
|
|
6692
|
+
const inspection = inspectDocxRunFonts(properties, theme);
|
|
6693
|
+
if ('valid' !== inspection.status || !inspection.value) continue;
|
|
6694
|
+
found = true;
|
|
6695
|
+
const next = inspection.value;
|
|
6696
|
+
for (const slot of [
|
|
6697
|
+
'ascii',
|
|
6698
|
+
'highAnsi',
|
|
6699
|
+
'eastAsia',
|
|
6700
|
+
'complexScript'
|
|
6701
|
+
])if (next[slot]) resolved[slot] = next[slot];
|
|
6702
|
+
if (next.hint) resolved.hint = next.hint;
|
|
6703
|
+
}
|
|
6704
|
+
return found ? normalizeDocumentScriptFonts(resolved) : null;
|
|
6705
|
+
}
|
|
6706
|
+
function parseDocxRunFontsElement(element, theme = EMPTY_THEME) {
|
|
6707
|
+
if (!element || 'rFonts' !== element.localName || !DOCX_WORDPROCESSING_NAMESPACES.has(element.namespaceURI ?? '') || work_ooxml_package_directChildren(element).length || Array.from(element.childNodes).some((node)=>node.nodeType === Node.TEXT_NODE && node.textContent?.trim())) return;
|
|
6708
|
+
const attributes = new Map();
|
|
6709
|
+
for (const item of Array.from(element.attributes)){
|
|
6710
|
+
if (item.namespaceURI === work_docx_settings_xml_XMLNS_NAMESPACE || 'xmlns' === item.name || item.name.startsWith('xmlns:')) continue;
|
|
6711
|
+
const name = xmlAttributeLocalName(item);
|
|
6712
|
+
if (!FONT_ATTRIBUTES.has(name) || !DOCX_WORDPROCESSING_NAMESPACES.has(xmlAttributeNamespace(element, item) ?? '') || attributes.has(name)) return;
|
|
6713
|
+
attributes.set(name, item.value);
|
|
6714
|
+
}
|
|
6715
|
+
const ascii = fontFace(attributes.get('ascii'), attributes.get('asciiTheme'), theme);
|
|
6716
|
+
const highAnsi = fontFace(attributes.get('hAnsi'), attributes.get('hAnsiTheme'), theme);
|
|
6717
|
+
const eastAsia = fontFace(attributes.get('eastAsia'), attributes.get('eastAsiaTheme'), theme);
|
|
6718
|
+
const complexScript = fontFace(attributes.get('cs'), attributes.get('cstheme'), theme);
|
|
6719
|
+
const hintValue = attributes.get('hint');
|
|
6720
|
+
const hint = void 0 === hintValue ? void 0 : normalizeDocumentScriptFontHint(hintValue);
|
|
6721
|
+
if (void 0 === ascii || void 0 === highAnsi || void 0 === eastAsia || void 0 === complexScript || null === hint) return;
|
|
6722
|
+
return normalizeDocumentScriptFonts({
|
|
6723
|
+
...ascii ? {
|
|
6724
|
+
ascii
|
|
6725
|
+
} : {},
|
|
6726
|
+
...highAnsi ? {
|
|
6727
|
+
highAnsi
|
|
6728
|
+
} : {},
|
|
6729
|
+
...eastAsia ? {
|
|
6730
|
+
eastAsia
|
|
6731
|
+
} : {},
|
|
6732
|
+
...complexScript ? {
|
|
6733
|
+
complexScript
|
|
6734
|
+
} : {},
|
|
6735
|
+
...hint ? {
|
|
6736
|
+
hint
|
|
6737
|
+
} : {}
|
|
6738
|
+
});
|
|
6739
|
+
}
|
|
6740
|
+
function fontFace(directSource, themeSource, theme) {
|
|
6741
|
+
const name = void 0 === directSource ? void 0 : normalizeDocumentFontName(directSource);
|
|
6742
|
+
const themeReference = void 0 === themeSource ? void 0 : normalizeDocumentThemeFont(themeSource);
|
|
6743
|
+
if (void 0 !== directSource && !name || null === themeReference) return;
|
|
6744
|
+
if (!name && !themeReference) return null;
|
|
6745
|
+
const themedFamily = themeReference ? docxThemeFont(theme, themeReference) : void 0;
|
|
6746
|
+
const resolved = themedFamily ?? name;
|
|
6747
|
+
return {
|
|
6748
|
+
...name ? {
|
|
6749
|
+
name
|
|
6750
|
+
} : {},
|
|
6751
|
+
...themeReference ? {
|
|
6752
|
+
theme: themeReference
|
|
6753
|
+
} : {},
|
|
6754
|
+
...resolved ? {
|
|
6755
|
+
resolved
|
|
6756
|
+
} : {}
|
|
6757
|
+
};
|
|
6758
|
+
}
|
|
6759
|
+
function directDocxRunText(run) {
|
|
6760
|
+
return directDocxRunTextElements(run).map((child)=>child.textContent ?? '').join('');
|
|
6761
|
+
}
|
|
6762
|
+
function markSegmentedDocxRunFormatting(run, state, segments, formattingFor, changeFor, createMarkers) {
|
|
6763
|
+
let runOffset = 0;
|
|
6764
|
+
for (const textElement of directDocxRunTextElements(run)){
|
|
6765
|
+
const source = textElement.textContent ?? '';
|
|
6766
|
+
const elementFrom = runOffset;
|
|
6767
|
+
const elementTo = elementFrom + source.length;
|
|
6768
|
+
runOffset = elementTo;
|
|
6769
|
+
if (!source) continue;
|
|
6770
|
+
const replacement = [];
|
|
6771
|
+
for (const segment of segments){
|
|
6772
|
+
const from = Math.max(elementFrom, segment.from);
|
|
6773
|
+
const to = Math.min(elementTo, segment.to);
|
|
6774
|
+
if (to <= from) continue;
|
|
6775
|
+
const text = source.slice(from - elementFrom, to - elementFrom);
|
|
6776
|
+
const formatting = formattingFor(text, segment.slot);
|
|
6777
|
+
const change = changeFor(text, segment.slot);
|
|
6778
|
+
if (!Object.keys(formatting).length && !change) {
|
|
6779
|
+
replacement.push(text);
|
|
6780
|
+
continue;
|
|
6781
|
+
}
|
|
6782
|
+
const { startMarker, endMarker } = createMarkers();
|
|
6783
|
+
replacement.push(startMarker, text, endMarker);
|
|
6784
|
+
state.markers.runs.push({
|
|
6785
|
+
startMarker,
|
|
6786
|
+
endMarker,
|
|
6787
|
+
formatting,
|
|
6788
|
+
...change ? {
|
|
6789
|
+
change
|
|
6790
|
+
} : {}
|
|
6791
|
+
});
|
|
6792
|
+
}
|
|
6793
|
+
textElement.textContent = replacement.join('');
|
|
6794
|
+
}
|
|
6795
|
+
}
|
|
6796
|
+
function directDocxRunTextElements(run) {
|
|
6797
|
+
return Array.from(run.children).filter((child)=>'t' === child.localName || 'delText' === child.localName);
|
|
6798
|
+
}
|
|
6602
6799
|
const work_docx_run_formatting_import_WORD_NAMESPACE = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
|
|
6603
6800
|
const work_docx_run_formatting_import_XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
6604
6801
|
const RUN_FORMATTING_MARKER_PATTERN = /__A3S_WORK_RUN_(?:START|END)_\d+__/g;
|
|
@@ -6610,6 +6807,13 @@ const SUPPORTED_RUN_PROPERTY_CHANGE_CHILDREN = new Set([
|
|
|
6610
6807
|
'u',
|
|
6611
6808
|
'strike',
|
|
6612
6809
|
'dstrike',
|
|
6810
|
+
'caps',
|
|
6811
|
+
'smallCaps',
|
|
6812
|
+
'vanish',
|
|
6813
|
+
'spacing',
|
|
6814
|
+
'w',
|
|
6815
|
+
'kern',
|
|
6816
|
+
'position',
|
|
6613
6817
|
'rFonts',
|
|
6614
6818
|
'sz',
|
|
6615
6819
|
'szCs',
|
|
@@ -6619,28 +6823,47 @@ const SUPPORTED_RUN_PROPERTY_CHANGE_CHILDREN = new Set([
|
|
|
6619
6823
|
'snapToGrid',
|
|
6620
6824
|
'cs',
|
|
6621
6825
|
'rtl',
|
|
6826
|
+
'em',
|
|
6622
6827
|
'vertAlign'
|
|
6623
6828
|
]);
|
|
6624
|
-
function
|
|
6625
|
-
|
|
6829
|
+
function createImportedDocxRunFormattingMarkerState(documents) {
|
|
6830
|
+
return {
|
|
6831
|
+
markers: {
|
|
6832
|
+
runs: []
|
|
6833
|
+
},
|
|
6834
|
+
nextMarker: 1,
|
|
6835
|
+
occupiedText: documents.map((document)=>document.documentElement.textContent ?? '').join('')
|
|
6836
|
+
};
|
|
6837
|
+
}
|
|
6838
|
+
function markDocxRunFormattingIntoState(document, state, styleSource, themeSource, tableStyleSource) {
|
|
6626
6839
|
const styles = resolveDocxParagraphStyleResolver(styleSource);
|
|
6627
6840
|
const theme = work_docx_theme_resolveDocxThemeResolver(themeSource);
|
|
6628
6841
|
const tableStyles = resolveDocxTableStyleResolver(tableStyleSource);
|
|
6629
6842
|
for (const run of descendants(document, 'r')){
|
|
6630
|
-
const runText =
|
|
6631
|
-
if (!runText
|
|
6843
|
+
const runText = directDocxRunText(run);
|
|
6844
|
+
if (!runText) continue;
|
|
6632
6845
|
const paragraph = work_docx_run_formatting_import_closestAncestor(run, 'p');
|
|
6633
6846
|
if (!paragraph) continue;
|
|
6634
6847
|
const paragraphProperties = directChild(paragraph, 'pPr');
|
|
6635
6848
|
const runProperties = directChild(run, 'rPr');
|
|
6636
|
-
const
|
|
6637
|
-
const
|
|
6849
|
+
const contextualProperties = docxTableRunPropertySources(run, tableStyles);
|
|
6850
|
+
const propertySources = docxRunPropertySources(paragraphProperties, runProperties, styles, contextualProperties);
|
|
6851
|
+
const scriptFonts = resolveDocxRunFonts(propertySources, theme);
|
|
6852
|
+
const forceComplexScript = propertySourcesUseComplexScript(propertySources);
|
|
6853
|
+
const scriptSegments = documentScriptFontSegments(runText, scriptFonts?.hint, forceComplexScript);
|
|
6854
|
+
const formattingFor = (text, scriptFontSlot)=>resolvedRunFormatting(propertySources, theme, text, scriptFontSlot, scriptFonts);
|
|
6855
|
+
const changeFor = (text, scriptFontSlot)=>importedRunFormattingChange(runProperties, paragraphProperties, styles, contextualProperties, theme, text, scriptFontSlot);
|
|
6856
|
+
if (scriptSegments.length > 1) {
|
|
6857
|
+
markSegmentedDocxRunFormatting(run, state, scriptSegments, formattingFor, changeFor, ()=>nextRunFormattingMarkers(state));
|
|
6858
|
+
continue;
|
|
6859
|
+
}
|
|
6860
|
+
const scriptFontSlot = scriptSegments[0]?.slot;
|
|
6861
|
+
const formatting = formattingFor(runText, scriptFontSlot);
|
|
6862
|
+
const change = changeFor(runText, scriptFontSlot);
|
|
6638
6863
|
if (!Object.keys(formatting).length && !change) continue;
|
|
6639
|
-
const
|
|
6640
|
-
const startMarker = `__A3S_WORK_RUN_START_${index}__`;
|
|
6641
|
-
const endMarker = `__A3S_WORK_RUN_END_${index}__`;
|
|
6864
|
+
const { startMarker, endMarker } = nextRunFormattingMarkers(state);
|
|
6642
6865
|
insertRunMarkers(document, run, runProperties, startMarker, endMarker);
|
|
6643
|
-
runs.push({
|
|
6866
|
+
state.markers.runs.push({
|
|
6644
6867
|
startMarker,
|
|
6645
6868
|
endMarker,
|
|
6646
6869
|
formatting,
|
|
@@ -6649,9 +6872,6 @@ function markDocxRunFormatting(document, styleSource, themeSource, tableStyleSou
|
|
|
6649
6872
|
} : {}
|
|
6650
6873
|
});
|
|
6651
6874
|
}
|
|
6652
|
-
return {
|
|
6653
|
-
runs
|
|
6654
|
-
};
|
|
6655
6875
|
}
|
|
6656
6876
|
function applyImportedDocxRunFormattingMarkers(document, markers) {
|
|
6657
6877
|
const replacements = new Map();
|
|
@@ -6664,13 +6884,24 @@ function applyImportedDocxRunFormattingMarkers(document, markers) {
|
|
|
6664
6884
|
replacements.set(marker.startMarker, `${change.start}${markup.start}`);
|
|
6665
6885
|
replacements.set(marker.endMarker, `${markup.end}${change.end}`);
|
|
6666
6886
|
}
|
|
6667
|
-
document.body.innerHTML = document.body.innerHTML.replace(RUN_FORMATTING_MARKER_PATTERN, (marker)=>replacements.get(marker) ??
|
|
6887
|
+
document.body.innerHTML = document.body.innerHTML.replace(RUN_FORMATTING_MARKER_PATTERN, (marker)=>replacements.get(marker) ?? marker);
|
|
6888
|
+
}
|
|
6889
|
+
function nextRunFormattingMarkers(state) {
|
|
6890
|
+
while(true){
|
|
6891
|
+
const index = state.nextMarker;
|
|
6892
|
+
state.nextMarker += 1;
|
|
6893
|
+
const startMarker = `__A3S_WORK_RUN_START_${index}__`;
|
|
6894
|
+
const endMarker = `__A3S_WORK_RUN_END_${index}__`;
|
|
6895
|
+
if (!state.occupiedText.includes(startMarker) && !state.occupiedText.includes(endMarker)) return {
|
|
6896
|
+
startMarker,
|
|
6897
|
+
endMarker
|
|
6898
|
+
};
|
|
6899
|
+
}
|
|
6668
6900
|
}
|
|
6669
6901
|
function hasImportedDocxRunFormattingMarkers(markers) {
|
|
6670
6902
|
return markers.runs.length > 0;
|
|
6671
6903
|
}
|
|
6672
|
-
function resolvedRunFormatting(propertySources, theme, runText) {
|
|
6673
|
-
const fonts = {};
|
|
6904
|
+
function resolvedRunFormatting(propertySources, theme, runText, requestedFontSlot, resolvedScriptFonts = resolveDocxRunFonts(propertySources, theme)) {
|
|
6674
6905
|
let fontSize;
|
|
6675
6906
|
let complexFontSize;
|
|
6676
6907
|
let color;
|
|
@@ -6683,20 +6914,34 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6683
6914
|
let complexItalic;
|
|
6684
6915
|
let underline;
|
|
6685
6916
|
let strike;
|
|
6917
|
+
let doubleStrike;
|
|
6686
6918
|
let subscript;
|
|
6687
6919
|
let superscript;
|
|
6688
6920
|
let snapToGrid;
|
|
6689
6921
|
let complexScriptFormatting;
|
|
6690
6922
|
let rightToLeft;
|
|
6691
|
-
let
|
|
6923
|
+
let allCaps;
|
|
6924
|
+
let smallCaps;
|
|
6925
|
+
let characterScalePercent;
|
|
6926
|
+
let characterPositionHalfPoints;
|
|
6927
|
+
let characterSpacingTwips;
|
|
6928
|
+
const kerningThresholdHalfPoints = resolveDocxKerningThresholdHalfPoints(propertySources);
|
|
6929
|
+
const emphasisMark = resolveDocxEmphasisMark(propertySources);
|
|
6930
|
+
const hiddenText = resolveDocxHiddenText(propertySources);
|
|
6692
6931
|
for (const properties of propertySources){
|
|
6693
6932
|
bold = overriddenBoolean(bold, onOffProperty(properties, 'b'));
|
|
6694
6933
|
complexBold = overriddenBoolean(complexBold, onOffProperty(properties, 'bCs'));
|
|
6695
6934
|
italic = overriddenBoolean(italic, onOffProperty(properties, 'i'));
|
|
6696
6935
|
complexItalic = overriddenBoolean(complexItalic, onOffProperty(properties, 'iCs'));
|
|
6697
|
-
underline =
|
|
6698
|
-
|
|
6699
|
-
strike = overriddenBoolean(strike,
|
|
6936
|
+
underline = overriddenValue(underline, underlineProperty(properties, theme));
|
|
6937
|
+
const importedStrike = importedDocxStrikeFlags(properties);
|
|
6938
|
+
strike = overriddenBoolean(strike, importedStrike.single);
|
|
6939
|
+
doubleStrike = overriddenBoolean(doubleStrike, importedStrike.double);
|
|
6940
|
+
allCaps = overriddenBoolean(allCaps, onOffProperty(properties, 'caps'));
|
|
6941
|
+
smallCaps = overriddenBoolean(smallCaps, onOffProperty(properties, 'smallCaps'));
|
|
6942
|
+
characterSpacingTwips = overriddenValue(characterSpacingTwips, docxCharacterSpacingTwipsFromProperties(properties));
|
|
6943
|
+
characterScalePercent = overriddenValue(characterScalePercent, docxCharacterScalePercentFromProperties(properties));
|
|
6944
|
+
characterPositionHalfPoints = overriddenValue(characterPositionHalfPoints, docxCharacterPositionHalfPointsFromProperties(properties));
|
|
6700
6945
|
const verticalAlign = directChild(properties, 'vertAlign');
|
|
6701
6946
|
if (verticalAlign) {
|
|
6702
6947
|
const value = work_docx_run_formatting_import_wordAttribute(verticalAlign, 'val')?.trim().toLowerCase();
|
|
@@ -6710,14 +6955,6 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6710
6955
|
snapToGrid = overriddenBoolean(snapToGrid, onOffProperty(properties, 'snapToGrid'));
|
|
6711
6956
|
complexScriptFormatting = overriddenBoolean(complexScriptFormatting, onOffProperty(properties, 'cs'));
|
|
6712
6957
|
rightToLeft = overriddenBoolean(rightToLeft, onOffProperty(properties, 'rtl'));
|
|
6713
|
-
const runFonts = directChild(properties, 'rFonts');
|
|
6714
|
-
if (runFonts) {
|
|
6715
|
-
fontHint = resolvedFontHint(runFonts) ?? fontHint;
|
|
6716
|
-
assignFont(fonts, 'ascii', resolvedFont(runFonts, 'ascii', 'asciiTheme', theme));
|
|
6717
|
-
assignFont(fonts, 'hAnsi', resolvedFont(runFonts, 'hAnsi', 'hAnsiTheme', theme));
|
|
6718
|
-
assignFont(fonts, 'eastAsia', resolvedFont(runFonts, 'eastAsia', 'eastAsiaTheme', theme));
|
|
6719
|
-
assignFont(fonts, 'complex', resolvedFont(runFonts, 'cs', 'cstheme', theme));
|
|
6720
|
-
}
|
|
6721
6958
|
const size = work_docx_run_formatting_import_numericAttribute(directChild(properties, 'sz'), 'val');
|
|
6722
6959
|
if (void 0 !== size && size > 0) fontSize = Math.min(512, size / 2);
|
|
6723
6960
|
const complexSize = work_docx_run_formatting_import_numericAttribute(directChild(properties, 'szCs'), 'val');
|
|
@@ -6760,19 +6997,15 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6760
6997
|
}
|
|
6761
6998
|
}
|
|
6762
6999
|
}
|
|
6763
|
-
const fontSlot = true === complexScriptFormatting || true === rightToLeft ? '
|
|
6764
|
-
const usesComplexFormatting = '
|
|
7000
|
+
const fontSlot = true === complexScriptFormatting || true === rightToLeft ? 'complexScript' : requestedFontSlot ?? documentScriptFontSegments(runText, resolvedScriptFonts?.hint)[0]?.slot ?? 'ascii';
|
|
7001
|
+
const usesComplexFormatting = 'complexScript' === fontSlot;
|
|
6765
7002
|
const resolvedBold = usesComplexFormatting ? complexBold ?? bold : bold;
|
|
6766
7003
|
const resolvedItalic = usesComplexFormatting ? complexItalic ?? italic : italic;
|
|
6767
7004
|
const resolvedFontSize = usesComplexFormatting ? complexFontSize ?? fontSize : fontSize;
|
|
6768
|
-
|
|
6769
|
-
if (!fontFamily) fontFamily = uniqueFonts(orderedFonts({
|
|
6770
|
-
ascii: docxThemeFont(theme, 'minorAscii'),
|
|
6771
|
-
hAnsi: docxThemeFont(theme, 'minorHAnsi'),
|
|
6772
|
-
eastAsia: docxThemeFont(theme, 'minorEastAsia'),
|
|
6773
|
-
complex: docxThemeFont(theme, 'minorBidi')
|
|
6774
|
-
}, fontSlot));
|
|
7005
|
+
const fontFamily = documentScriptFontFamily(resolvedScriptFonts, fontSlot) ?? defaultThemeFontFamily(theme, fontSlot);
|
|
6775
7006
|
const hasRunPropertySource = propertySources.length > 0;
|
|
7007
|
+
const resolvedStrike = resolvedDocxStrikeFormatting(strike, doubleStrike, hasRunPropertySource);
|
|
7008
|
+
const textCase = documentTextCaseFromWordFlags(allCaps, smallCaps);
|
|
6776
7009
|
return {
|
|
6777
7010
|
...void 0 !== resolvedBold || hasRunPropertySource ? {
|
|
6778
7011
|
bold: resolvedBold ?? false
|
|
@@ -6781,10 +7014,12 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6781
7014
|
italic: resolvedItalic ?? false
|
|
6782
7015
|
} : {},
|
|
6783
7016
|
...void 0 !== underline || hasRunPropertySource ? {
|
|
6784
|
-
underline: underline ??
|
|
7017
|
+
underline: underline ?? {
|
|
7018
|
+
style: 'none'
|
|
7019
|
+
}
|
|
6785
7020
|
} : {},
|
|
6786
|
-
...
|
|
6787
|
-
strike:
|
|
7021
|
+
...resolvedStrike ? {
|
|
7022
|
+
strike: resolvedStrike
|
|
6788
7023
|
} : {},
|
|
6789
7024
|
...void 0 !== subscript ? {
|
|
6790
7025
|
subscript
|
|
@@ -6792,10 +7027,32 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6792
7027
|
...void 0 !== superscript ? {
|
|
6793
7028
|
superscript
|
|
6794
7029
|
} : {},
|
|
7030
|
+
...void 0 !== characterScalePercent ? {
|
|
7031
|
+
characterScalePercent
|
|
7032
|
+
} : {},
|
|
7033
|
+
...void 0 !== characterPositionHalfPoints ? {
|
|
7034
|
+
characterPositionHalfPoints
|
|
7035
|
+
} : {},
|
|
7036
|
+
...void 0 !== characterSpacingTwips ? {
|
|
7037
|
+
characterSpacingTwips
|
|
7038
|
+
} : {},
|
|
7039
|
+
...void 0 !== kerningThresholdHalfPoints ? {
|
|
7040
|
+
kerningThresholdHalfPoints
|
|
7041
|
+
} : {},
|
|
7042
|
+
...void 0 !== emphasisMark ? {
|
|
7043
|
+
emphasisMark
|
|
7044
|
+
} : {},
|
|
7045
|
+
...void 0 !== hiddenText ? {
|
|
7046
|
+
hiddenText
|
|
7047
|
+
} : {},
|
|
6795
7048
|
...fontFamily ? {
|
|
6796
7049
|
fontFamily,
|
|
6797
7050
|
wordLineHeightFactor: documentWordLineHeightFactor(fontFamily)
|
|
6798
7051
|
} : {},
|
|
7052
|
+
...resolvedScriptFonts ? {
|
|
7053
|
+
scriptFonts: resolvedScriptFonts,
|
|
7054
|
+
scriptFontSlot: fontSlot
|
|
7055
|
+
} : {},
|
|
6799
7056
|
...void 0 !== resolvedFontSize ? {
|
|
6800
7057
|
fontSize: resolvedFontSize
|
|
6801
7058
|
} : {},
|
|
@@ -6813,6 +7070,9 @@ function resolvedRunFormatting(propertySources, theme, runText) {
|
|
|
6813
7070
|
} : {},
|
|
6814
7071
|
...themeFill ? {
|
|
6815
7072
|
themeFill
|
|
7073
|
+
} : {},
|
|
7074
|
+
...textCase ? {
|
|
7075
|
+
textCase
|
|
6816
7076
|
} : {}
|
|
6817
7077
|
};
|
|
6818
7078
|
}
|
|
@@ -6832,8 +7092,23 @@ function formattingMarkup(document, formatting) {
|
|
|
6832
7092
|
const span = document.createElement('span');
|
|
6833
7093
|
if (false === formatting.bold) span.style.fontWeight = 'normal';
|
|
6834
7094
|
if (false === formatting.italic) span.style.fontStyle = 'normal';
|
|
6835
|
-
|
|
7095
|
+
const underlineEnabled = void 0 !== formatting.underline && 'none' !== formatting.underline.style;
|
|
7096
|
+
const strikeEnabled = void 0 !== formatting.strike && 'none' !== formatting.strike.style;
|
|
7097
|
+
if ((formatting.underline?.style === 'none' || formatting.strike?.style === 'none') && !underlineEnabled && !strikeEnabled) span.style.textDecorationLine = 'none';
|
|
6836
7098
|
if (formatting.fontFamily) span.style.fontFamily = formatting.fontFamily;
|
|
7099
|
+
if (formatting.scriptFonts) for (const [name, value] of Object.entries(documentScriptFontsDomAttributes(formatting.scriptFonts, formatting.scriptFontSlot)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7100
|
+
else span.setAttribute(name, value);
|
|
7101
|
+
if (void 0 !== formatting.characterSpacingTwips) for (const [name, value] of Object.entries(documentCharacterSpacingDomAttributes(formatting.characterSpacingTwips)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7102
|
+
else span.setAttribute(name, value);
|
|
7103
|
+
if (void 0 !== formatting.characterScalePercent) for (const [name, value] of Object.entries(documentCharacterScaleDomAttributes(formatting.characterScalePercent)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7104
|
+
else span.setAttribute(name, value);
|
|
7105
|
+
if (void 0 !== formatting.kerningThresholdHalfPoints) for (const [name, value] of Object.entries(documentKerningDomAttributes(formatting.kerningThresholdHalfPoints, formatting.fontSize)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7106
|
+
else span.setAttribute(name, value);
|
|
7107
|
+
if (void 0 !== formatting.characterPositionHalfPoints) for (const [name, value] of Object.entries(documentCharacterPositionDomAttributes(formatting.characterPositionHalfPoints)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7108
|
+
else span.setAttribute(name, value);
|
|
7109
|
+
if (void 0 !== formatting.emphasisMark) for (const [name, value] of Object.entries(documentEmphasisMarkDomAttributes(formatting.emphasisMark)))if ('style' === name) span.style.cssText += `; ${value}`;
|
|
7110
|
+
else span.setAttribute(name, value);
|
|
7111
|
+
if (void 0 !== formatting.hiddenText) for (const [name, value] of Object.entries(documentHiddenTextDomAttributes(formatting.hiddenText)))span.setAttribute(name, value);
|
|
6837
7112
|
if (void 0 !== formatting.wordLineHeightFactor) {
|
|
6838
7113
|
const factor = formatLineHeightFactor(formatting.wordLineHeightFactor);
|
|
6839
7114
|
span.dataset.officeWordLineHeightFactor = factor;
|
|
@@ -6847,38 +7122,69 @@ function formattingMarkup(document, formatting) {
|
|
|
6847
7122
|
if (formatting.backgroundColor) span.style.backgroundColor = formatting.backgroundColor;
|
|
6848
7123
|
const themeFill = serializeDocxThemeReference(formatting.themeFill ?? null);
|
|
6849
7124
|
if (themeFill) span.dataset.officeThemeFill = themeFill;
|
|
7125
|
+
if (formatting.textCase) applyDocumentTextCaseStyle(span, formatting.textCase);
|
|
6850
7126
|
const html = span.outerHTML;
|
|
6851
|
-
const
|
|
7127
|
+
const wrappers = [
|
|
6852
7128
|
...formatting.bold ? [
|
|
6853
|
-
|
|
7129
|
+
{
|
|
7130
|
+
start: '<strong>',
|
|
7131
|
+
end: '</strong>'
|
|
7132
|
+
}
|
|
6854
7133
|
] : [],
|
|
6855
7134
|
...formatting.italic ? [
|
|
6856
|
-
|
|
7135
|
+
{
|
|
7136
|
+
start: '<em>',
|
|
7137
|
+
end: '</em>'
|
|
7138
|
+
}
|
|
6857
7139
|
] : [],
|
|
6858
7140
|
...formatting.underline ? [
|
|
6859
|
-
|
|
7141
|
+
underlineFormattingWrapper(document, formatting.underline)
|
|
6860
7142
|
] : [],
|
|
6861
7143
|
...formatting.strike ? [
|
|
6862
|
-
|
|
7144
|
+
strikeFormattingWrapper(document, formatting.strike)
|
|
6863
7145
|
] : [],
|
|
6864
7146
|
...formatting.subscript ? [
|
|
6865
|
-
|
|
7147
|
+
{
|
|
7148
|
+
start: '<sub>',
|
|
7149
|
+
end: '</sub>'
|
|
7150
|
+
}
|
|
6866
7151
|
] : [],
|
|
6867
7152
|
...formatting.superscript ? [
|
|
6868
|
-
|
|
7153
|
+
{
|
|
7154
|
+
start: '<sup>',
|
|
7155
|
+
end: '</sup>'
|
|
7156
|
+
}
|
|
6869
7157
|
] : []
|
|
6870
7158
|
];
|
|
6871
7159
|
return {
|
|
6872
|
-
start: `${html.slice(0, html.indexOf('>') + 1)}${
|
|
7160
|
+
start: `${html.slice(0, html.indexOf('>') + 1)}${wrappers.map((wrapper)=>wrapper.start).join('')}`,
|
|
6873
7161
|
end: `${[
|
|
6874
|
-
...
|
|
6875
|
-
].reverse().map((
|
|
7162
|
+
...wrappers
|
|
7163
|
+
].reverse().map((wrapper)=>wrapper.end).join('')}</span>`
|
|
7164
|
+
};
|
|
7165
|
+
}
|
|
7166
|
+
function underlineFormattingWrapper(document, formatting) {
|
|
7167
|
+
const underline = document.createElement('u');
|
|
7168
|
+
for (const [name, value] of Object.entries(documentUnderlineDomAttributes(formatting)))underline.setAttribute(name, value);
|
|
7169
|
+
const html = underline.outerHTML;
|
|
7170
|
+
return {
|
|
7171
|
+
start: html.slice(0, html.indexOf('>') + 1),
|
|
7172
|
+
end: '</u>'
|
|
6876
7173
|
};
|
|
6877
7174
|
}
|
|
6878
|
-
function
|
|
7175
|
+
function strikeFormattingWrapper(document, formatting) {
|
|
7176
|
+
const strike = document.createElement('s');
|
|
7177
|
+
for (const [name, value] of Object.entries(documentStrikeDomAttributes(formatting)))strike.setAttribute(name, value);
|
|
7178
|
+
const html = strike.outerHTML;
|
|
7179
|
+
return {
|
|
7180
|
+
start: html.slice(0, html.indexOf('>') + 1),
|
|
7181
|
+
end: '</s>'
|
|
7182
|
+
};
|
|
7183
|
+
}
|
|
7184
|
+
function importedRunFormattingChange(runProperties, paragraphProperties, styles, contextualProperties, theme, runText, requestedFontSlot) {
|
|
6879
7185
|
const parsed = supportedRunFormattingChange(runProperties);
|
|
6880
7186
|
if (!parsed) return;
|
|
6881
|
-
const beforeFormatting = resolvedRunFormatting(docxRunPropertySources(paragraphProperties, parsed.properties, styles, contextualProperties), theme, runText);
|
|
7187
|
+
const beforeFormatting = resolvedRunFormatting(docxRunPropertySources(paragraphProperties, parsed.properties, styles, contextualProperties), theme, runText, requestedFontSlot);
|
|
6882
7188
|
return {
|
|
6883
7189
|
id: `docx-format-change-${parsed.id}`,
|
|
6884
7190
|
author: parsed.author,
|
|
@@ -6886,7 +7192,10 @@ function importedRunFormattingChange(runProperties, paragraphProperties, styles,
|
|
|
6886
7192
|
before: importedDocumentCharacterFormatting({
|
|
6887
7193
|
...beforeFormatting,
|
|
6888
7194
|
themeColor: serializeDocxThemeReference(beforeFormatting.themeColor ?? null),
|
|
6889
|
-
themeFill: serializeDocxThemeReference(beforeFormatting.themeFill ?? null)
|
|
7195
|
+
themeFill: serializeDocxThemeReference(beforeFormatting.themeFill ?? null),
|
|
7196
|
+
scriptFonts: beforeFormatting.scriptFonts,
|
|
7197
|
+
scriptFontSlot: beforeFormatting.scriptFontSlot,
|
|
7198
|
+
textCase: beforeFormatting.textCase
|
|
6890
7199
|
})
|
|
6891
7200
|
};
|
|
6892
7201
|
}
|
|
@@ -6942,8 +7251,8 @@ function work_docx_run_formatting_import_normalizeRevisionDate(value) {
|
|
|
6942
7251
|
function work_docx_run_formatting_import_themeReference(element, themeName, tintName, shadeName, resolved) {
|
|
6943
7252
|
const theme = work_docx_run_formatting_import_wordAttribute(element, themeName)?.trim();
|
|
6944
7253
|
if (!theme) return;
|
|
6945
|
-
const tint =
|
|
6946
|
-
const shade =
|
|
7254
|
+
const tint = work_docx_run_formatting_import_normalizedByteHex(work_docx_run_formatting_import_wordAttribute(element, tintName));
|
|
7255
|
+
const shade = work_docx_run_formatting_import_normalizedByteHex(work_docx_run_formatting_import_wordAttribute(element, shadeName));
|
|
6947
7256
|
return {
|
|
6948
7257
|
theme,
|
|
6949
7258
|
resolved,
|
|
@@ -6955,27 +7264,35 @@ function work_docx_run_formatting_import_themeReference(element, themeName, tint
|
|
|
6955
7264
|
} : {}
|
|
6956
7265
|
};
|
|
6957
7266
|
}
|
|
6958
|
-
function
|
|
7267
|
+
function work_docx_run_formatting_import_normalizedByteHex(value) {
|
|
6959
7268
|
const normalized = value?.trim().toUpperCase();
|
|
6960
7269
|
return normalized && /^[0-9A-F]{2}$/.test(normalized) ? normalized : void 0;
|
|
6961
7270
|
}
|
|
6962
7271
|
function overriddenBoolean(current, next) {
|
|
6963
7272
|
return void 0 === next ? current : next;
|
|
6964
7273
|
}
|
|
7274
|
+
function overriddenValue(current, next) {
|
|
7275
|
+
return void 0 === next ? current : next;
|
|
7276
|
+
}
|
|
7277
|
+
function propertySourcesUseComplexScript(propertySources) {
|
|
7278
|
+
let complexScript;
|
|
7279
|
+
let rightToLeft;
|
|
7280
|
+
for (const properties of propertySources){
|
|
7281
|
+
complexScript = overriddenBoolean(complexScript, onOffProperty(properties, 'cs'));
|
|
7282
|
+
rightToLeft = overriddenBoolean(rightToLeft, onOffProperty(properties, 'rtl'));
|
|
7283
|
+
}
|
|
7284
|
+
return true === complexScript || true === rightToLeft;
|
|
7285
|
+
}
|
|
6965
7286
|
function onOffProperty(properties, propertyName) {
|
|
6966
7287
|
const element = directChild(properties, propertyName);
|
|
6967
7288
|
if (!element) return;
|
|
6968
7289
|
const value = work_docx_run_formatting_import_wordAttribute(element, 'val')?.trim().toLowerCase();
|
|
6969
7290
|
return '0' !== value && 'false' !== value && 'off' !== value;
|
|
6970
7291
|
}
|
|
6971
|
-
function underlineProperty(properties) {
|
|
7292
|
+
function underlineProperty(properties, theme) {
|
|
6972
7293
|
const element = directChild(properties, 'u');
|
|
6973
7294
|
if (!element) return;
|
|
6974
|
-
|
|
6975
|
-
return '0' !== value && 'false' !== value && 'off' !== value && 'none' !== value;
|
|
6976
|
-
}
|
|
6977
|
-
function directRunText(run) {
|
|
6978
|
-
return Array.from(run.children).filter((child)=>'t' === child.localName || 'delText' === child.localName).map((child)=>child.textContent ?? '').join('');
|
|
7295
|
+
return importedDocxUnderline(element, theme);
|
|
6979
7296
|
}
|
|
6980
7297
|
function work_docx_run_formatting_import_closestAncestor(element, localName) {
|
|
6981
7298
|
let current = element.parentElement;
|
|
@@ -6985,69 +7302,14 @@ function work_docx_run_formatting_import_closestAncestor(element, localName) {
|
|
|
6985
7302
|
}
|
|
6986
7303
|
return null;
|
|
6987
7304
|
}
|
|
6988
|
-
function
|
|
6989
|
-
const
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
if ('eastasia' === hint) return 'eastAsia';
|
|
6995
|
-
if ('cs' === hint) return 'complex';
|
|
6996
|
-
if ('default' === hint) return 'ascii';
|
|
6997
|
-
}
|
|
6998
|
-
function orderedFonts(fonts, preferred) {
|
|
6999
|
-
const order = {
|
|
7000
|
-
ascii: [
|
|
7001
|
-
'ascii',
|
|
7002
|
-
'hAnsi',
|
|
7003
|
-
'eastAsia',
|
|
7004
|
-
'complex'
|
|
7005
|
-
],
|
|
7006
|
-
hAnsi: [
|
|
7007
|
-
'hAnsi',
|
|
7008
|
-
'ascii',
|
|
7009
|
-
'eastAsia',
|
|
7010
|
-
'complex'
|
|
7011
|
-
],
|
|
7012
|
-
eastAsia: [
|
|
7013
|
-
'eastAsia',
|
|
7014
|
-
'hAnsi',
|
|
7015
|
-
'ascii',
|
|
7016
|
-
'complex'
|
|
7017
|
-
],
|
|
7018
|
-
complex: [
|
|
7019
|
-
'complex',
|
|
7020
|
-
'hAnsi',
|
|
7021
|
-
'ascii',
|
|
7022
|
-
'eastAsia'
|
|
7023
|
-
]
|
|
7305
|
+
function defaultThemeFontFamily(theme, preferred) {
|
|
7306
|
+
const fonts = {
|
|
7307
|
+
ascii: docxThemeFont(theme, 'minorAscii'),
|
|
7308
|
+
highAnsi: docxThemeFont(theme, 'minorHAnsi'),
|
|
7309
|
+
eastAsia: docxThemeFont(theme, 'minorEastAsia'),
|
|
7310
|
+
complexScript: docxThemeFont(theme, 'minorBidi')
|
|
7024
7311
|
};
|
|
7025
|
-
return
|
|
7026
|
-
}
|
|
7027
|
-
function docxFontSlotForText(text, hint) {
|
|
7028
|
-
for (const character of text){
|
|
7029
|
-
const codePoint = character.codePointAt(0);
|
|
7030
|
-
if (!(void 0 === codePoint || isNeutralCodePoint(codePoint))) {
|
|
7031
|
-
if (isComplexScriptCodePoint(codePoint)) return 'complex';
|
|
7032
|
-
if (isEastAsianCodePoint(codePoint)) return 'eastAsia';
|
|
7033
|
-
return codePoint <= 0x7f ? 'ascii' : 'hAnsi';
|
|
7034
|
-
}
|
|
7035
|
-
}
|
|
7036
|
-
return hint ?? 'ascii';
|
|
7037
|
-
}
|
|
7038
|
-
function isNeutralCodePoint(codePoint) {
|
|
7039
|
-
return codePoint <= 0x20 || codePoint <= 0x7f && !(codePoint >= 0x41 && codePoint <= 0x5a || codePoint >= 0x61 && codePoint <= 0x7a) || codePoint >= 0x300 && codePoint <= 0x36f || codePoint >= 0x2000 && codePoint <= 0x206f;
|
|
7040
|
-
}
|
|
7041
|
-
function isComplexScriptCodePoint(codePoint) {
|
|
7042
|
-
return codePoint >= 0x0590 && codePoint <= 0x08ff || codePoint >= 0xfb1d && codePoint <= 0xfdff || codePoint >= 0xfe70 && codePoint <= 0xfeff || codePoint >= 0x1ee00 && codePoint <= 0x1eeff;
|
|
7043
|
-
}
|
|
7044
|
-
function isEastAsianCodePoint(codePoint) {
|
|
7045
|
-
return codePoint >= 0x1100 && codePoint <= 0x11ff || codePoint >= 0x2e80 && codePoint <= 0xa4cf || codePoint >= 0xac00 && codePoint <= 0xd7af || codePoint >= 0xf900 && codePoint <= 0xfaff || codePoint >= 0xfe10 && codePoint <= 0xfe6f || codePoint >= 0xff00 && codePoint <= 0xffef || codePoint >= 0x20000 && codePoint <= 0x323af;
|
|
7046
|
-
}
|
|
7047
|
-
function resolvedFont(element, explicitName, themeName, theme) {
|
|
7048
|
-
const explicit = work_docx_run_formatting_import_wordAttribute(element, explicitName);
|
|
7049
|
-
if (explicit?.trim()) return explicit;
|
|
7050
|
-
return docxThemeFont(theme, work_docx_run_formatting_import_wordAttribute(element, themeName)) ?? null;
|
|
7312
|
+
return uniqueFonts(documentScriptFontFallbackSlots(preferred).map((slot)=>fonts[slot]));
|
|
7051
7313
|
}
|
|
7052
7314
|
function uniqueFonts(values) {
|
|
7053
7315
|
const fonts = [
|
|
@@ -7096,4 +7358,4 @@ function work_docx_run_formatting_import_formatNumber(value) {
|
|
|
7096
7358
|
function formatLineHeightFactor(value) {
|
|
7097
7359
|
return Number(value.toFixed(4)).toString();
|
|
7098
7360
|
}
|
|
7099
|
-
export { applyImportedDocxEquationMarkers, applyImportedDocxParagraphAlignmentMarkers, applyImportedDocxParagraphBorderMarkers, applyImportedDocxParagraphDirectionMarkers, applyImportedDocxParagraphFormattingChangeMarkers, applyImportedDocxParagraphIndentMarkers, applyImportedDocxParagraphPaginationMarkers, applyImportedDocxParagraphShadingMarkers, applyImportedDocxParagraphSpacingMarkers, applyImportedDocxParagraphTabStopMarkers, applyImportedDocxRunFormattingMarkers, createDocxParagraphStyleResolver, createDocxTableStyleResolver, docxCaptionBookmark, docxCaptionReferenceTarget, docxCaptionSequenceKind, docxEquationHtml, docxFieldInstructions, docxFieldOccurrenceIsInlineEditable, docxFieldOccurrences, docxFieldResultText, docxTableCellStyleLayers, docxTablePropertySources, hasImportedDocxParagraphAlignmentMarkers, hasImportedDocxParagraphBorderMarkers, hasImportedDocxParagraphDirectionMarkers, hasImportedDocxParagraphFormattingChangeMarkers, hasImportedDocxParagraphIndentMarkers, hasImportedDocxParagraphPaginationMarkers, hasImportedDocxParagraphShadingMarkers, hasImportedDocxParagraphSpacingMarkers, hasImportedDocxParagraphTabStopMarkers, hasImportedDocxRunFormattingMarkers, hasInvalidDocxFieldStructure, inspectDocxEquation, inspectDocxPageBorders, inspectDocxPageMarginSettings, inspectDocxPageMargins, inspectDocxPageSize, inspectDocxPaperSource, isDocxEquationLikeRoot, isSupportedDocxEquationPlacement, isSupportedDocxParagraphFormattingChange, isSupportedDocxRunFormattingChange, markDocxPackageEquations, markDocxParagraphAlignments, markDocxParagraphBorders, markDocxParagraphDirections, markDocxParagraphFormattingChanges, markDocxParagraphIndents, markDocxParagraphPagination, markDocxParagraphShading, markDocxParagraphSpacing, markDocxParagraphTabStops,
|
|
7361
|
+
export { applyImportedDocxEquationMarkers, applyImportedDocxParagraphAlignmentMarkers, applyImportedDocxParagraphBorderMarkers, applyImportedDocxParagraphDirectionMarkers, applyImportedDocxParagraphFormattingChangeMarkers, applyImportedDocxParagraphIndentMarkers, applyImportedDocxParagraphPaginationMarkers, applyImportedDocxParagraphShadingMarkers, applyImportedDocxParagraphSpacingMarkers, applyImportedDocxParagraphTabStopMarkers, applyImportedDocxRunFormattingMarkers, createDocxParagraphStyleResolver, createDocxTableStyleResolver, createImportedDocxRunFormattingMarkerState, docxCaptionBookmark, docxCaptionReferenceTarget, docxCaptionSequenceKind, docxEquationHtml, docxFieldInstructions, docxFieldOccurrenceIsInlineEditable, docxFieldOccurrences, docxFieldResultText, docxRunPropertySources, docxTableCellStyleLayers, docxTablePropertySources, docxTableRunPropertySources, hasImportedDocxParagraphAlignmentMarkers, hasImportedDocxParagraphBorderMarkers, hasImportedDocxParagraphDirectionMarkers, hasImportedDocxParagraphFormattingChangeMarkers, hasImportedDocxParagraphIndentMarkers, hasImportedDocxParagraphPaginationMarkers, hasImportedDocxParagraphShadingMarkers, hasImportedDocxParagraphSpacingMarkers, hasImportedDocxParagraphTabStopMarkers, hasImportedDocxRunFormattingMarkers, hasInvalidDocxFieldStructure, importedDocxStrike, importedDocxUnderline, inspectDocxEquation, inspectDocxHiddenText, inspectDocxPageBorders, inspectDocxPageMarginSettings, inspectDocxPageMargins, inspectDocxPageSize, inspectDocxPaperSource, inspectDocxRunFonts, isDocxEquationLikeRoot, isSupportedDocxEquationPlacement, isSupportedDocxParagraphFormattingChange, isSupportedDocxRunFormattingChange, markDocxPackageEquations, markDocxParagraphAlignments, markDocxParagraphBorders, markDocxParagraphDirections, markDocxParagraphFormattingChanges, markDocxParagraphIndents, markDocxParagraphPagination, markDocxParagraphShading, markDocxParagraphSpacing, markDocxParagraphTabStops, markDocxRunFormattingIntoState, parseDirectDocxParagraphShading, parseDocxPageBorders, parseDocxPageGeometry, parseDocxPageMargins, parseDocxPaperSource, resolveDocxHiddenText, resolveDocxParagraphBordersForParagraph, resolveDocxTableStyleResolver };
|