@a3s-lab/office 0.43.0 → 0.45.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 +30 -1
- package/dist/0~1403.js +1 -1
- package/dist/0~2330.js +2 -2
- package/dist/0~3539.js +2 -2
- package/dist/0~3557.js +1 -1
- package/dist/{0~5024.js → 0~4042.js} +111 -3
- package/dist/0~4980.js +1 -1
- package/dist/0~7828.js +1 -1
- package/dist/{0~7048.js → 0~7831.js} +2 -547
- package/dist/0~document-editor.js +154 -5
- package/dist/{0~3635.js → 0~office-color-picker.js} +1 -12
- package/dist/0~pdf-viewer.js +22 -8
- package/dist/0~presentation-editor.js +4 -3
- package/dist/0~spreadsheet-editor.js +200 -3669
- package/dist/0~work-docx-export.js +11 -8
- package/dist/0~work-docx-import.js +11 -5
- package/dist/0~work-office-diagnostics.js +14 -3
- package/dist/0~work-pptx-export.js +1 -1
- package/dist/0~work-pptx-import.js +1 -1
- package/dist/0~work-presentation-charts.js +1 -1
- package/dist/3818.js +1 -1
- package/dist/4166.js +1 -1
- package/dist/4174.js +112 -4
- package/dist/4560.js +2 -2
- package/dist/{5416.js → 610.js} +4335 -410
- package/dist/{4121.js → 6968.js} +622 -13
- package/dist/7060.js +1 -1
- package/dist/{4650.js → 816.js} +12 -1
- package/dist/8715.js +1 -1
- package/dist/9333.js +17 -17
- package/dist/core.js +7 -5
- package/dist/index.js +2 -2
- package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +4 -1
- package/dist/internal/features/work/editors/spreadsheet-data-validation-list.d.ts +44 -0
- package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +1 -1
- package/dist/internal/features/work/work-document-image-layout.d.ts +14 -0
- package/dist/internal/features/work/work-docx-export-image.d.ts +2 -1
- package/dist/internal/features/work/work-docx-image-layout-import.d.ts +2 -1
- package/dist/internal/features/work/work-docx-image-transform.d.ts +17 -0
- package/dist/internal/features/work/work-types.d.ts +4 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +51 -3
- package/docs/latest/en/browser-editor-architecture.md +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -309,6 +309,35 @@ and [CLI reference](./docs/latest/en/cli-reference.md).
|
|
|
309
309
|
|
|
310
310
|
## Current release
|
|
311
311
|
|
|
312
|
+
Version `0.45.0` adds bounded Writer picture transforms without introducing a
|
|
313
|
+
second document model or a remote service:
|
|
314
|
+
|
|
315
|
+
- The contextual **Picture** ribbon now exposes quarter-turn rotation plus
|
|
316
|
+
horizontal and vertical reflection with accessible Lucide icons. **Picture
|
|
317
|
+
Properties** keeps the same controls in a responsive dialog, and each
|
|
318
|
+
confirmed change is one undoable, controlled update.
|
|
319
|
+
- The transform is projected consistently into editing, preview, PDF capture,
|
|
320
|
+
and the native DOCX `a:xfrm` fields (`rot`, `flipH`, and `flipV`). Imported
|
|
321
|
+
90-degree/reflection values reopen as editable state, while arbitrary-angle
|
|
322
|
+
or malformed values produce a compatibility diagnostic and normalize safely.
|
|
323
|
+
|
|
324
|
+
Version `0.44.0` adds dependent local dropdowns to Spreadsheet Data Validation
|
|
325
|
+
without introducing a remote service:
|
|
326
|
+
|
|
327
|
+
- **Data → Data Tools → Data Validation** accepts a bounded
|
|
328
|
+
`=INDIRECT(...)` source composed of quoted text and single-cell references.
|
|
329
|
+
Relative drivers are re-evaluated for every target cell, so a Region column
|
|
330
|
+
can drive a Regional owner list through workbook-local named ranges or
|
|
331
|
+
one-row/one-column areas.
|
|
332
|
+
- Empty drivers show an empty list. External books, whole-row/column ranges,
|
|
333
|
+
missing sheets, uncached formulas, and malformed expressions fail closed;
|
|
334
|
+
formulas stay within 255 Unicode characters and local range reads stay
|
|
335
|
+
bounded.
|
|
336
|
+
- The controlled model keeps the authored formula compact while the grid gets
|
|
337
|
+
a bounded runtime projection. Native XLSX import/export/reopen preserves the
|
|
338
|
+
list formula and names, and the public **新建 → 数据验证** template includes
|
|
339
|
+
the Region → Regional owner example.
|
|
340
|
+
|
|
312
341
|
Version `0.43.0` makes Spreadsheet formula conditional formatting a local,
|
|
313
342
|
editable workflow instead of a file-only preservation path:
|
|
314
343
|
|
|
@@ -402,7 +431,7 @@ ordered-list numbering revisions:
|
|
|
402
431
|
|
|
403
432
|
Browse the product-focused [What's new](https://a3s-lab.github.io/Office/docs/changelog.html)
|
|
404
433
|
page or the exhaustive engineering [changelog](./CHANGELOG.md). The Playground
|
|
405
|
-
exposes
|
|
434
|
+
exposes these workflows from the release-labelled template grid.
|
|
406
435
|
|
|
407
436
|
## Capabilities and boundaries
|
|
408
437
|
|
package/dist/0~1403.js
CHANGED
package/dist/0~2330.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { documentRunBorderDomAttributes, normalizeDocumentRunBorder, normalizeDocumentParagraphBorder, serializeDocumentRunBorder, serializeDocumentRunShading, documentIndexEntryHtml, attribute as work_ooxml_package_attribute, documentScriptFontFallbackSlots, documentScriptFontsDomAttributes, documentHighlightFromDocxValue, serializeDocxThemeReference, directChildren as work_ooxml_package_directChildren, documentParagraphShadingDomAttributes, documentTableOfContentsHtml, documentParagraphBordersDomAttributes, normalizeDocumentScriptFontHint, normalizeDocumentScriptFonts, DOCUMENT_PARAGRAPH_BORDER_STYLES, normalizeDocumentParagraphBorders as work_document_paragraph_borders_normalizeDocumentParagraphBorders, DOCUMENT_PARAGRAPH_BORDER_EDGES, documentScriptFontFamily, normalizeDocumentThemeFont, normalizeDocumentParagraphId, documentHighlightDomAttributes, descendants, documentIndexHtml, documentHighlightCssColor, xmlNamespacePrefix, normalizeDocumentFontName, documentProofingDomAttributes, work_document_paragraph_shading_DOCUMENT_PARAGRAPH_SHADING_PATTERNS, directChild, documentScriptFontSegments, childPath, parseDocumentTableOfContentsInstruction, documentRunShadingDomAttributes } from "./
|
|
2
|
-
import { docxThemeFont, XML_NAMESPACE as work_docx_settings_xml_XML_NAMESPACE, parseDocumentIndexEntryInstruction, resolveDocxProofing, parseDocumentIndexInstruction, DOCX_WORD_2010_NAMESPACE, XMLNS_NAMESPACE as work_docx_settings_xml_XMLNS_NAMESPACE, STRICT_WORDPROCESSING_NAMESPACE, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxOpenTypeFeatures, docxCharacterScalePercentFromProperties, resolveDocxEmphasisMark, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver as work_docx_theme_resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, parseDocxTwipsMeasure } from "./0~
|
|
1
|
+
import { documentRunBorderDomAttributes, normalizeDocumentRunBorder, normalizeDocumentParagraphBorder, serializeDocumentRunBorder, serializeDocumentRunShading, documentIndexEntryHtml, attribute as work_ooxml_package_attribute, documentScriptFontFallbackSlots, documentScriptFontsDomAttributes, documentHighlightFromDocxValue, serializeDocxThemeReference, directChildren as work_ooxml_package_directChildren, documentParagraphShadingDomAttributes, documentTableOfContentsHtml, documentParagraphBordersDomAttributes, normalizeDocumentScriptFontHint, normalizeDocumentScriptFonts, DOCUMENT_PARAGRAPH_BORDER_STYLES, normalizeDocumentParagraphBorders as work_document_paragraph_borders_normalizeDocumentParagraphBorders, DOCUMENT_PARAGRAPH_BORDER_EDGES, documentScriptFontFamily, normalizeDocumentThemeFont, normalizeDocumentParagraphId, documentHighlightDomAttributes, descendants, documentIndexHtml, documentHighlightCssColor, xmlNamespacePrefix, normalizeDocumentFontName, documentProofingDomAttributes, work_document_paragraph_shading_DOCUMENT_PARAGRAPH_SHADING_PATTERNS, directChild, documentScriptFontSegments, childPath, parseDocumentTableOfContentsInstruction, documentRunShadingDomAttributes } from "./6968.js";
|
|
2
|
+
import { docxThemeFont, XML_NAMESPACE as work_docx_settings_xml_XML_NAMESPACE, parseDocumentIndexEntryInstruction, resolveDocxProofing, parseDocumentIndexInstruction, DOCX_WORD_2010_NAMESPACE, XMLNS_NAMESPACE as work_docx_settings_xml_XMLNS_NAMESPACE, STRICT_WORDPROCESSING_NAMESPACE, docxCharacterSpacingTwipsFromProperties, parseBoundedDocxInteger, xmlAttributeLocalName, resolveDocxOpenTypeFeatures, docxCharacterScalePercentFromProperties, resolveDocxEmphasisMark, docxCharacterPositionHalfPointsFromProperties, docxThemeColor, parseDocxParagraphDefaultCollapsed, resolveDocxKerningThresholdHalfPoints, resolveDocxThemeResolver as work_docx_theme_resolveDocxThemeResolver, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, parseDocxTwipsMeasure } from "./0~4042.js";
|
|
3
3
|
import { normalizeDocumentEmphasisMark, normalizeDocumentPageBorders, documentCharacterPositionDomAttributes, DOCUMENT_PAGE_BORDER_EDGES, normalizeDocumentTabStops, documentTextCaseFromWordFlags, documentStrikeDomAttributes, serializeDocumentNumberingChange, numberingTypeFromFormat, normalizeDocumentUnderlineColor, documentAutoLineHeight, documentKerningDomAttributes, documentCharacterScaleDomAttributes, serializeDocumentParagraphFormatting, normalizeDocumentPaperSource, documentEquationText, documentLegacyTextEffectsDomAttributes, documentLegacyTextEffectsConflict, documentCharacterSpacingDomAttributes, normalizeDocumentParagraphIndent, normalizeDocumentEquation, documentOpenTypeDomAttributes, renderDocumentAutoLineHeight, documentUnderlineDomAttributes, MAX_DOCUMENT_NUMBERING_START, normalizeDocumentUnderlineStyle, applyDocumentTextCaseStyle, documentHiddenTextDomAttributes, importedDocumentCharacterFormatting, DOCUMENT_LEGACY_TEXT_EFFECT_NAMES, createDocumentEquationElement, normalizeDocumentPageGeometry, serializeDocumentTabStops, documentWordLineHeightFactor, documentEmphasisMarkDomAttributes, normalizeDocumentPageMargins } from "./4174.js";
|
|
4
4
|
function docxCaptionSequenceKind(instruction) {
|
|
5
5
|
const identifier = /^\s*SEQ\s+([^\s\\]+)/i.exec(instruction)?.[1]?.toLowerCase();
|
package/dist/0~3539.js
CHANGED
|
@@ -4,8 +4,8 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { showToast, createAgentProposalRequest as createWorkAgentProposalRequest } from "./6489.js";
|
|
5
5
|
import { effectiveSpreadsheetCalculationSettings, workSpreadsheetCombinationSeriesTypeLabel, workSpreadsheetChartSupportsGrouping, spreadsheetPivotIntersects, workSpreadsheetErrorBarValueTypeLabel, workSpreadsheetChartAxisTickMarkLabel, normalizeWorkSpreadsheetChartSmoothLines, spreadsheetFormulaRangesForSelection, normalizeWorkSpreadsheetChartSeriesStyle, workSpreadsheetErrorBarTypeLabel, workSpreadsheetChartAxisPositionLabel, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartLegendOverlay, workSpreadsheetChartSupportsTrendlines, normalizeWorkSpreadsheetChartGapWidth, workSpreadsheetChartSupportsBarSpacing, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsSmoothLines, parseSpreadsheetChartReference, workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartLegendPositionLabel, workSpreadsheetChartAxisLabelPositionLabel, normalizeWorkSpreadsheetChartAxisGroup, workSpreadsheetChartAxisDefaultLabelPosition, workSpreadsheetChartGroupingLabel, workSpreadsheetDataLabelPositionLabel, workSpreadsheetChartSupportsSeriesAnalysis, defaultWorkSpreadsheetChartSeriesStyle, spreadsheetPivotAggregationLabel, resolveSpreadsheetChart, spreadsheetPivotFields, parseSpreadsheetCellRanges, normalizeWorkSpreadsheetChartAxes, normalizeWorkSpreadsheetChartOverlap, workSpreadsheetChartUsesNumericXAxis, normalizeWorkSpreadsheetChartLegendPosition, workSpreadsheetChartTypeLabel, workSpreadsheetTrendlineTypeLabel, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetCombinationSeriesType, spreadsheetChartSeriesStyleContext, normalizeWorkSpreadsheetDataLabels } from "./8715.js";
|
|
6
6
|
import { presentationChartLegendPositionLabel, presentationChartShowsLegend, normalizePresentationChartLegendPosition, presentationChartUsesNumericXAxis, normalizePresentationBubbleSizeRepresents, normalizePresentationBubbleScale, presentationChartAxes, normalizePresentationChartDataLabels, presentationChartTypeLabel, presentationChartDataLabelPositionLabel, normalizePresentationScatterStyle } from "./0~work-presentation-charts.js";
|
|
7
|
-
import { OfficeCheckbox, CommittedOfficeNumberField, CollectionState } from "./0~
|
|
8
|
-
import { OfficeColorPicker } from "./0~
|
|
7
|
+
import { OfficeCheckbox, CommittedOfficeNumberField, CollectionState } from "./0~7831.js";
|
|
8
|
+
import { OfficeColorPicker } from "./0~office-color-picker.js";
|
|
9
9
|
import { OfficeSelect } from "./0~9073.js";
|
|
10
10
|
import { office_text_field_OfficeTextField, CommittedOfficeTextField } from "./0~8136.js";
|
|
11
11
|
function spreadsheetAgentMenuItems(selection, onAgentRequest, applyProposal) {
|
package/dist/0~3557.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
2
|
-
import { isOfficeCompositionKeyboardEvent } from "./
|
|
2
|
+
import { isOfficeCompositionKeyboardEvent } from "./816.js";
|
|
3
3
|
import { matchesOfficeEditorKeyboardShortcut } from "./0~8136.js";
|
|
4
4
|
const DEFAULT_EXTENSION_PRIORITY = 100;
|
|
5
5
|
function createOfficeEditorExtension(config) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
|
-
import { normalizeDocumentIndexEntryDraft, serializeUtf8Xml, directChildren, xmlNamespacePrefix, normalizeDocumentLanguageTag, parseXml, firstDescendant, decodeXmlBytes, directChild, descendants, normalizeDocumentProofingLanguages, attribute as work_ooxml_package_attribute, normalizeDocumentIndexOptions } from "./
|
|
3
|
-
import { normalizeDocumentEmphasisMark, normalizeDocumentCharacterScalePercent, documentCitationStyle,
|
|
2
|
+
import { normalizeDocumentIndexEntryDraft, serializeUtf8Xml, directChildren, xmlNamespacePrefix, normalizeDocumentLanguageTag, parseXml, firstDescendant, decodeXmlBytes, directChild, descendants, normalizeDocumentProofingLanguages, attribute as work_ooxml_package_attribute, normalizeDocumentIndexOptions } from "./6968.js";
|
|
3
|
+
import { normalizeDocumentEmphasisMark, normalizeDocumentCharacterScalePercent, documentCitationStyle, normalizeDocumentCharacterPositionHalfPoints, normalizeDocumentCharacterSpacingTwips, normalizeDocumentKerningThresholdHalfPoints, normalizeDocumentOpenTypeNumberSpacing, createDocumentBibliography, normalizeDocumentImageTransform, normalizeDocumentOpenTypeLigatures, normalizeDocumentOpenTypeNumberForm, normalizeDocumentTabStops, documentCitationStyleDetails, normalizeDocumentOpenTypeStylisticSets } from "./4174.js";
|
|
4
4
|
const BIBLIOGRAPHY_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/bibliography';
|
|
5
5
|
const CUSTOM_XML_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/customXml';
|
|
6
6
|
const OFFICE_RELATIONSHIPS_NAMESPACE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
|
|
@@ -708,6 +708,114 @@ function isAllowedExtensionNamespace(namespace, context) {
|
|
|
708
708
|
function isNamespacePrefix(value) {
|
|
709
709
|
return /^[A-Za-z_][A-Za-z0-9_.-]*$/.test(value) && 'xml' !== value;
|
|
710
710
|
}
|
|
711
|
+
const DOCX_ROTATION_UNITS_PER_DEGREE = 60000;
|
|
712
|
+
const DOCX_QUADRANT_ROTATION_UNITS = 5400000;
|
|
713
|
+
function readDocxImageTransform(drawing) {
|
|
714
|
+
const target = pictureTransform(drawing);
|
|
715
|
+
if (!target) return {
|
|
716
|
+
transform: null,
|
|
717
|
+
supported: true
|
|
718
|
+
};
|
|
719
|
+
const rawRotation = work_ooxml_package_attribute(target, 'rot');
|
|
720
|
+
const rawFlipHorizontal = work_ooxml_package_attribute(target, 'flipH');
|
|
721
|
+
const rawFlipVertical = work_ooxml_package_attribute(target, 'flipV');
|
|
722
|
+
const rotation = parseRotation(rawRotation);
|
|
723
|
+
const flipHorizontal = parseFlip(rawFlipHorizontal);
|
|
724
|
+
const flipVertical = parseFlip(rawFlipVertical);
|
|
725
|
+
const supported = null !== rotation && null !== flipHorizontal && null !== flipVertical && (0 === rotation || rotation % DOCX_QUADRANT_ROTATION_UNITS === 0);
|
|
726
|
+
const normalized = normalizeDocumentImageTransform({
|
|
727
|
+
rotation: null === rotation ? 0 : rotation / DOCX_ROTATION_UNITS_PER_DEGREE,
|
|
728
|
+
flipHorizontal: flipHorizontal ?? false,
|
|
729
|
+
flipVertical: flipVertical ?? false
|
|
730
|
+
});
|
|
731
|
+
return {
|
|
732
|
+
transform: 0 !== normalized.rotation || normalized.flipHorizontal || normalized.flipVertical ? normalized : null,
|
|
733
|
+
supported
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
class DocxImageTransformPatchCollector {
|
|
737
|
+
patches = [];
|
|
738
|
+
nextMarker = 1;
|
|
739
|
+
marker(transform) {
|
|
740
|
+
if (!transform) return '';
|
|
741
|
+
const normalized = normalizeDocumentImageTransform(transform);
|
|
742
|
+
if (0 === normalized.rotation && !normalized.flipHorizontal && !normalized.flipVertical) return '';
|
|
743
|
+
const marker = `__A3S_IMAGE_TRANSFORM_${this.nextMarker}__`;
|
|
744
|
+
this.nextMarker += 1;
|
|
745
|
+
this.patches.push({
|
|
746
|
+
marker,
|
|
747
|
+
transform: normalized
|
|
748
|
+
});
|
|
749
|
+
return marker;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
async function patchDocxImageTransforms(buffer, patches) {
|
|
753
|
+
if (!patches.length) return buffer;
|
|
754
|
+
const archive = await jszip.loadAsync(buffer);
|
|
755
|
+
const entries = Object.values(archive.files).filter((entry)=>!entry.dir && /^word\/(?:document|header\d+|footer\d+|footnotes|endnotes|comments)\.xml$/.test(entry.name));
|
|
756
|
+
const byMarker = new Map(patches.map((patch)=>[
|
|
757
|
+
patch.marker,
|
|
758
|
+
patch
|
|
759
|
+
]));
|
|
760
|
+
for (const entry of entries){
|
|
761
|
+
const document = parseXml(await entry.async('text'), entry.name);
|
|
762
|
+
let changed = false;
|
|
763
|
+
for (const properties of descendants(document, 'docPr')){
|
|
764
|
+
const patch = imageTransformPatch(properties, byMarker);
|
|
765
|
+
if (!patch) continue;
|
|
766
|
+
removeTransformMarker(properties, patch.marker);
|
|
767
|
+
changed = true;
|
|
768
|
+
const drawing = closestDrawing(properties);
|
|
769
|
+
const transform = drawing ? pictureTransform(drawing) : void 0;
|
|
770
|
+
if (transform) applyImageTransform(transform, patch.transform);
|
|
771
|
+
}
|
|
772
|
+
if (changed) archive.file(entry.name, new XMLSerializer().serializeToString(document));
|
|
773
|
+
}
|
|
774
|
+
return archive.generateAsync({
|
|
775
|
+
type: 'arraybuffer'
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
function imageTransformPatch(properties, patches) {
|
|
779
|
+
for (const attribute of Array.from(properties.attributes))for (const [marker, patch] of patches)if (attribute.value.includes(marker)) return patch;
|
|
780
|
+
return null;
|
|
781
|
+
}
|
|
782
|
+
function removeTransformMarker(properties, marker) {
|
|
783
|
+
for (const attribute of Array.from(properties.attributes))if (attribute.value.includes(marker)) attribute.value = attribute.value.replace(marker, '');
|
|
784
|
+
}
|
|
785
|
+
function closestDrawing(element) {
|
|
786
|
+
let current = element;
|
|
787
|
+
while(current){
|
|
788
|
+
if ('anchor' === current.localName || 'inline' === current.localName) return current;
|
|
789
|
+
current = current.parentElement;
|
|
790
|
+
}
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
function pictureTransform(drawing) {
|
|
794
|
+
const picture = descendants(drawing, 'pic')[0];
|
|
795
|
+
const properties = picture ? directChild(picture, 'spPr') : void 0;
|
|
796
|
+
return properties ? directChild(properties, 'xfrm') : descendants(drawing, 'xfrm')[0];
|
|
797
|
+
}
|
|
798
|
+
function parseRotation(value) {
|
|
799
|
+
if (null === value || !value.trim()) return 0;
|
|
800
|
+
const number = Number(value);
|
|
801
|
+
return Number.isInteger(number) && number >= 0 ? number : null;
|
|
802
|
+
}
|
|
803
|
+
function parseFlip(value) {
|
|
804
|
+
if (null === value || !value.trim()) return false;
|
|
805
|
+
const normalized = value.trim().toLowerCase();
|
|
806
|
+
if ('1' === normalized || 'true' === normalized) return true;
|
|
807
|
+
if ('0' === normalized || 'false' === normalized) return false;
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
function applyImageTransform(target, transform) {
|
|
811
|
+
const normalized = normalizeDocumentImageTransform(transform);
|
|
812
|
+
if (0 === normalized.rotation) target.removeAttribute('rot');
|
|
813
|
+
else target.setAttribute('rot', String(normalized.rotation * DOCX_ROTATION_UNITS_PER_DEGREE));
|
|
814
|
+
if (normalized.flipHorizontal) target.setAttribute('flipH', '1');
|
|
815
|
+
else target.removeAttribute('flipH');
|
|
816
|
+
if (normalized.flipVertical) target.setAttribute('flipV', '1');
|
|
817
|
+
else target.removeAttribute('flipV');
|
|
818
|
+
}
|
|
711
819
|
function parseDocumentIndexEntryInstruction(instruction) {
|
|
712
820
|
const command = /^\s*XE\b/i.exec(instruction);
|
|
713
821
|
if (!command) return {
|
|
@@ -2072,4 +2180,4 @@ function isParagraphPartRoot(root, path) {
|
|
|
2072
2180
|
const expected = /^word\/header\d*\.xml$/i.test(path) ? 'hdr' : /^word\/footer\d*\.xml$/i.test(path) ? 'ftr' : /^word\/footnotes\.xml$/i.test(path) ? 'footnotes' : /^word\/endnotes\.xml$/i.test(path) ? 'endnotes' : 'document';
|
|
2073
2181
|
return root.localName === expected && DOCX_WORDPROCESSING_NAMESPACES.has(root.namespaceURI ?? '');
|
|
2074
2182
|
}
|
|
2075
|
-
export { DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES, DOCX_WORDPROCESSING_NAMESPACES, DOCX_WORD_2010_NAMESPACE, DocxParagraphDefaultCollapsedPatchCollector, STRICT_WORDPROCESSING_NAMESPACE, XMLNS_NAMESPACE, XML_NAMESPACE, assertXmlRoot, cloneXmlElement, createDocxThemeResolver, cssColorToHex, cssFontFamily, cssFontSize, dataBoolean, documentIndexEntryInstruction, documentIndexInstruction, documentProofingLanguageDocxOptions, docxCharacterPositionHalfPointsFromProperties, docxCharacterPositionValue, docxCharacterScalePercentFromProperties, docxCharacterScaleValue, docxCharacterSpacingTwipsFromProperties, docxCharacterSpacingValue, docxEmphasisMarkRunOptions, docxKerningThresholdValue, docxThemeColor, docxThemeFont, domDirection, hasNonWhitespaceXmlText, inspectDocxEmphasisMark, inspectDocxKerningThresholdHalfPoints, inspectDocxNoProof, inspectDocxProofingLanguages, mergeDocxIgnorableExtensions, mergeDocxIgnorableExtensionsAtPairs, paragraphAlignment, paragraphBidirectional, paragraphDirectionOptions, paragraphIndent, paragraphPaginationOptions, paragraphSpacingOptions, paragraphTabStops, parseBoundedDocxInteger, parseDocumentIndexEntryInstruction, parseDocumentIndexInstruction, parseDocxColorSchemeMappingElement, parseDocxParagraphDefaultCollapsed, parseDocxTwipsMeasure, patchDocxBibliography, patchDocxExplicitZeroCharacterSpacing, patchDocxExplicitZeroKerningThresholds, patchDocxParagraphDefaultCollapsed, readDocxBibliography, resolveDocxEmphasisMark, resolveDocxKerningThresholdHalfPoints, resolveDocxOpenTypeFeatures, resolveDocxProofing, resolveDocxThemeResolver, xmlAttributeLocalName, xmlAttributeNamespace, xmlDeclaredPrefix, xmlNamespaceUri };
|
|
2183
|
+
export { DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES, DOCX_WORDPROCESSING_NAMESPACES, DOCX_WORD_2010_NAMESPACE, DocxImageTransformPatchCollector, DocxParagraphDefaultCollapsedPatchCollector, STRICT_WORDPROCESSING_NAMESPACE, XMLNS_NAMESPACE, XML_NAMESPACE, assertXmlRoot, cloneXmlElement, createDocxThemeResolver, cssColorToHex, cssFontFamily, cssFontSize, dataBoolean, documentIndexEntryInstruction, documentIndexInstruction, documentProofingLanguageDocxOptions, docxCharacterPositionHalfPointsFromProperties, docxCharacterPositionValue, docxCharacterScalePercentFromProperties, docxCharacterScaleValue, docxCharacterSpacingTwipsFromProperties, docxCharacterSpacingValue, docxEmphasisMarkRunOptions, docxKerningThresholdValue, docxThemeColor, docxThemeFont, domDirection, hasNonWhitespaceXmlText, inspectDocxEmphasisMark, inspectDocxKerningThresholdHalfPoints, inspectDocxNoProof, inspectDocxProofingLanguages, mergeDocxIgnorableExtensions, mergeDocxIgnorableExtensionsAtPairs, paragraphAlignment, paragraphBidirectional, paragraphDirectionOptions, paragraphIndent, paragraphPaginationOptions, paragraphSpacingOptions, paragraphTabStops, parseBoundedDocxInteger, parseDocumentIndexEntryInstruction, parseDocumentIndexInstruction, parseDocxColorSchemeMappingElement, parseDocxParagraphDefaultCollapsed, parseDocxTwipsMeasure, patchDocxBibliography, patchDocxExplicitZeroCharacterSpacing, patchDocxExplicitZeroKerningThresholds, patchDocxImageTransforms, patchDocxParagraphDefaultCollapsed, readDocxBibliography, readDocxImageTransform, resolveDocxEmphasisMark, resolveDocxKerningThresholdHalfPoints, resolveDocxOpenTypeFeatures, resolveDocxProofing, resolveDocxThemeResolver, xmlAttributeLocalName, xmlAttributeNamespace, xmlDeclaredPrefix, xmlNamespaceUri };
|
package/dist/0~4980.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
2
|
import { documentNoteKey } from "./4174.js";
|
|
3
|
-
import { directChild, xmlNamespacePrefix, attribute, parseXml } from "./
|
|
3
|
+
import { directChild, xmlNamespacePrefix, attribute, parseXml } from "./6968.js";
|
|
4
4
|
import { DEFAULT_DOCUMENT_PAGE_COLOR, normalizeDocumentPageColor } from "./0~work-document-page-color.js";
|
|
5
5
|
const MAX_NATIVE_ID = 2147483647;
|
|
6
6
|
const MIN_NATIVE_COMMENT_ID = -2147483648;
|
package/dist/0~7828.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import jszip from "jszip";
|
|
2
|
-
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant, descendants, directChild, attribute, createOfficeId as createWorkId } from "./
|
|
2
|
+
import { directChildren, xmlNamespacePrefix, parseXml, firstDescendant, descendants, directChild, attribute, createOfficeId as createWorkId } from "./6968.js";
|
|
3
3
|
import { normalizePresentationChartDataLabelPosition, normalizePresentationChartDataLabels, normalizePresentationChartSeriesStyle } from "./0~work-presentation-charts.js";
|
|
4
4
|
import { parseXlsxChartSeriesStyle, xlsxChartSeriesMarkerXml, parseXlsxTrendline, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, isSupportedXlsxChartSeriesFormatting, parseXlsxChartPlotLayout, parseXlsxChartLegend, xlsxChartSeriesShapePropertiesXml, parseXlsxErrorBars } from "./4166.js";
|
|
5
5
|
import { workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsGrouping, normalizeWorkSpreadsheetChartSmoothLines, workSpreadsheetChartSupportsSeriesAnalysis, normalizeWorkSpreadsheetChartSeriesStyle, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetChartOverlap, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetChartSupportsBarSpacing, normalizeWorkSpreadsheetChartLegendOverlay, normalizeWorkSpreadsheetChartGapWidth, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartSupportsSmoothLines, normalizeWorkSpreadsheetTrendline } from "./8715.js";
|