ooxml-core 1.32.0 → 1.33.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/dist/{PptxHandler-TESZUH66.cjs → PptxHandler-MGKMIK22.cjs} +3 -3
- package/dist/PptxHandler-Q7CFNKOU.mjs +7 -0
- package/dist/PptxHandler-TEC7SWBU.mjs +4 -0
- package/dist/{PresentationBuilder-3CH5TR4W.mjs → PresentationBuilder-PJMQRZI6.mjs} +2 -2
- package/dist/{PresentationBuilder-S6HXHKEJ.mjs → PresentationBuilder-SADKXDWC.mjs} +4 -4
- package/dist/{PresentationBuilder-5NFBUP7Y.cjs → PresentationBuilder-VP2637RH.cjs} +5 -5
- package/dist/automation/index.cjs +4398 -2262
- package/dist/automation/index.mjs +4398 -2262
- package/dist/chart/funnel-geometry.d.ts +1 -1
- package/dist/chart/funnel-geometry.d.ts.map +1 -1
- package/dist/chart/index.cjs +5743 -3820
- package/dist/chart/index.mjs +5736 -3821
- package/dist/chart/region-map/alias.d.ts +12 -0
- package/dist/chart/region-map/alias.d.ts.map +1 -0
- package/dist/chart/region-map/cache.d.ts +20 -0
- package/dist/chart/region-map/cache.d.ts.map +1 -0
- package/dist/chart/region-map/colors.d.ts +4 -0
- package/dist/chart/region-map/colors.d.ts.map +1 -0
- package/dist/chart/region-map/data.d.ts +45 -0
- package/dist/chart/region-map/data.d.ts.map +1 -0
- package/dist/chart/region-map/geographic-projection.d.ts +4 -0
- package/dist/chart/region-map/geographic-projection.d.ts.map +1 -0
- package/dist/chart/region-map/geometry.d.ts +10 -0
- package/dist/chart/region-map/geometry.d.ts.map +1 -0
- package/dist/chart/region-map/index.cjs +892 -0
- package/dist/chart/region-map/index.d.ts +12 -0
- package/dist/chart/region-map/index.d.ts.map +1 -0
- package/dist/chart/region-map/index.mjs +870 -0
- package/dist/chart/region-map/projection.d.ts +19 -0
- package/dist/chart/region-map/projection.d.ts.map +1 -0
- package/dist/chart/region-map/types.d.ts +39 -0
- package/dist/chart/region-map/types.d.ts.map +1 -0
- package/dist/chart/region-map/value-color-positions.d.ts +4 -0
- package/dist/chart/region-map/value-color-positions.d.ts.map +1 -0
- package/dist/chart/region-map/value-colors.d.ts +4 -0
- package/dist/chart/region-map/value-colors.d.ts.map +1 -0
- package/dist/chart/region-map/world-regions.d.ts +22 -0
- package/dist/chart/region-map/world-regions.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-camera.d.ts +26 -0
- package/dist/chart/render/chart-3d-camera.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-layout.d.ts +27 -0
- package/dist/chart/render/chart-3d-layout.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-marks.d.ts +10 -0
- package/dist/chart/render/chart-3d-marks.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-mesh.d.ts +32 -0
- package/dist/chart/render/chart-3d-mesh.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-pie.d.ts +16 -0
- package/dist/chart/render/chart-3d-pie.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-projection.d.ts +37 -0
- package/dist/chart/render/chart-3d-projection.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-scene.d.ts +9 -0
- package/dist/chart/render/chart-3d-scene.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-shading.d.ts +10 -0
- package/dist/chart/render/chart-3d-shading.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-surface.d.ts +5 -0
- package/dist/chart/render/chart-3d-surface.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-svg.d.ts +7 -0
- package/dist/chart/render/chart-3d-svg.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-walls.d.ts +13 -0
- package/dist/chart/render/chart-3d-walls.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-funnel.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-region-map.d.ts +4 -0
- package/dist/chart/render/chart-svg-region-map.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-text-metrics.d.ts +2 -0
- package/dist/chart/render/chart-svg-text-metrics.d.ts.map +1 -1
- package/dist/chart/render/chart-svg.d.ts.map +1 -1
- package/dist/chart/render/chart-view.d.ts +5 -1
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/render/index.d.ts +5 -0
- package/dist/chart/render/index.d.ts.map +1 -1
- package/dist/chart/render/render-space.d.ts.map +1 -1
- package/dist/chart/render/summary-ex-formatting.d.ts +5 -0
- package/dist/chart/render/summary-ex-formatting.d.ts.map +1 -0
- package/dist/chart/render/summary-ex-series.d.ts.map +1 -1
- package/dist/chart/render/summary-from-chartex.d.ts.map +1 -1
- package/dist/chart/render/summary-from-space.d.ts.map +1 -1
- package/dist/chart/render/summary.d.ts +5 -1
- package/dist/chart/render/summary.d.ts.map +1 -1
- package/dist/{chunk-Q6NM64J2.cjs → chunk-2LTIDUXH.cjs} +4791 -950
- package/dist/chunk-2N7RZQLC.mjs +8 -0
- package/dist/{chunk-NAWLWKOJ.mjs → chunk-3LMHYL4W.mjs} +2 -2
- package/dist/{chunk-O7SVHLD7.mjs → chunk-6LJW76BZ.mjs} +4756 -951
- package/dist/{chunk-X6VNUBES.cjs → chunk-BDZR4DZ6.cjs} +2058 -1748
- package/dist/{chunk-IOTGRLJH.mjs → chunk-BQGLWC6N.mjs} +867 -557
- package/dist/{chunk-N6424WKA.mjs → chunk-EBBWRRSB.mjs} +1 -1
- package/dist/{chunk-UYMSFJQZ.mjs → chunk-JQVOUS6B.mjs} +5 -5
- package/dist/{chunk-3H5UAJB3.mjs → chunk-QRXMYOVN.mjs} +870 -525
- package/dist/{chunk-54S5A5PZ.mjs → chunk-VDUNZTJC.mjs} +36 -1
- package/dist/{chunk-4R65YYAD.mjs → chunk-Y2RH4QWG.mjs} +4228 -1070
- package/dist/diagram/drawing-resolve.d.ts.map +1 -1
- package/dist/diagram/drawing-view.d.ts +6 -0
- package/dist/diagram/drawing-view.d.ts.map +1 -1
- package/dist/diagram/engine/engine-to-result.d.ts.map +1 -1
- package/dist/diagram/index.cjs +786 -145
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +783 -147
- package/dist/diagram/layout/smartart-layout-types.d.ts +7 -0
- package/dist/diagram/layout/smartart-layout-types.d.ts.map +1 -1
- package/dist/diagram/layout-preview.d.ts +4 -0
- package/dist/diagram/layout-preview.d.ts.map +1 -1
- package/dist/diagram/layout-role-style.d.ts +4 -0
- package/dist/diagram/layout-role-style.d.ts.map +1 -0
- package/dist/diagram/load.d.ts.map +1 -1
- package/dist/diagram/picture-layout.d.ts +23 -0
- package/dist/diagram/picture-layout.d.ts.map +1 -0
- package/dist/diagram/types.d.ts +6 -0
- package/dist/diagram/types.d.ts.map +1 -1
- package/dist/diagram/write/cache.d.ts +1 -0
- package/dist/diagram/write/cache.d.ts.map +1 -1
- package/dist/digest/crc32.d.ts +2 -0
- package/dist/digest/crc32.d.ts.map +1 -0
- package/dist/digest/index.cjs +11 -0
- package/dist/digest/index.d.ts +1 -0
- package/dist/digest/index.d.ts.map +1 -1
- package/dist/digest/index.mjs +11 -1
- package/dist/docx/diagram-cache.d.ts.map +1 -1
- package/dist/docx/diagram-save.d.ts.map +1 -1
- package/dist/docx/drawing.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +882 -212
- package/dist/docx/embedded.mjs +882 -212
- package/dist/docx/index.cjs +3082 -866
- package/dist/docx/index.mjs +3082 -866
- package/dist/docx/inline-model.d.ts +4 -0
- package/dist/docx/inline-model.d.ts.map +1 -1
- package/dist/docx/layout/adapt-floats.d.ts.map +1 -1
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/floats.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +2200 -438
- package/dist/docx/layout/index.mjs +2200 -438
- package/dist/docx/layout/input.d.ts +3 -0
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +3 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +1311 -641
- package/dist/docx/load/index.mjs +1311 -641
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +2832 -842
- package/dist/docx/ui/index.mjs +2832 -842
- package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
- package/dist/docx/ui/run-adapter.d.ts.map +1 -1
- package/dist/docx/write-drawing.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +707 -111
- package/dist/drawingml/index.d.ts +7 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +697 -113
- package/dist/drawingml/picture-artistic.d.ts +14 -0
- package/dist/drawingml/picture-artistic.d.ts.map +1 -0
- package/dist/drawingml/picture-effects.d.ts +4 -1
- package/dist/drawingml/picture-effects.d.ts.map +1 -1
- package/dist/drawingml/picture-fill.d.ts.map +1 -1
- package/dist/drawingml/picture-hsl-pixels.d.ts +4 -0
- package/dist/drawingml/picture-hsl-pixels.d.ts.map +1 -0
- package/dist/drawingml/picture-layout.d.ts +25 -0
- package/dist/drawingml/picture-layout.d.ts.map +1 -0
- package/dist/drawingml/picture-standard-effects.d.ts +15 -0
- package/dist/drawingml/picture-standard-effects.d.ts.map +1 -0
- package/dist/drawingml/picture-transfer.d.ts +11 -0
- package/dist/drawingml/picture-transfer.d.ts.map +1 -0
- package/dist/drawingml/raster-image.d.ts +29 -0
- package/dist/drawingml/raster-image.d.ts.map +1 -0
- package/dist/drawingml/types.d.ts +1 -0
- package/dist/drawingml/types.d.ts.map +1 -1
- package/dist/drawingml/write-pattern-picture.d.ts.map +1 -1
- package/dist/geometry/index.cjs +38 -0
- package/dist/geometry/index.d.ts +1 -0
- package/dist/geometry/index.d.ts.map +1 -1
- package/dist/geometry/index.mjs +36 -1
- package/dist/geometry/picture-tile.d.ts +29 -0
- package/dist/geometry/picture-tile.d.ts.map +1 -0
- package/dist/index.cjs +15164 -12669
- package/dist/index.mjs +15164 -12669
- package/dist/pptx/automation/index.cjs +7431 -2967
- package/dist/pptx/automation/index.d.ts +5 -5
- package/dist/pptx/automation/index.mjs +7 -7
- package/dist/pptx/chunks/{elements-mSCZ84Tc.d.ts → elements-f3UbFph-.d.ts} +7 -2
- package/dist/pptx/chunks/elements-f3UbFph-.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-DnWlmYCy.d.ts → index-BnH2QjYm.d.ts} +4 -4
- package/dist/pptx/chunks/{index-DnWlmYCy.d.ts.map → index-BnH2QjYm.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-D-FdgqrP.d.ts → index-Bp-1pGo1.d.ts} +4 -4
- package/dist/pptx/chunks/{index-D-FdgqrP.d.ts.map → index-Bp-1pGo1.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DKybuHPT.d.ts → index-BuMPQDQb.d.ts} +27 -16
- package/dist/pptx/chunks/index-BuMPQDQb.d.ts.map +1 -0
- package/dist/pptx/chunks/{smart-art-DLumQo90.d.ts → smart-art-CmOrPLLQ.d.ts} +86 -2
- package/dist/pptx/chunks/smart-art-CmOrPLLQ.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-hyPODwIQ.d.ts → text-operations-D5sgspO6.d.ts} +2 -2
- package/dist/pptx/chunks/{text-operations-hyPODwIQ.d.ts.map → text-operations-D5sgspO6.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +7196 -2732
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +6 -6
- package/dist/pptx/converter/index.cjs +3895 -503
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +3 -3
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +6828 -2969
- package/dist/pptx/index.d.ts +7 -7
- package/dist/pptx/index.mjs +7 -7
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/pptx/smartart-layouts/index.d.ts +1 -1
- package/dist/pptx/smartart-layouts/index.mjs +2 -2
- package/dist/teams/index.cjs +1964 -726
- package/dist/teams/index.mjs +1964 -726
- package/dist/visio/cell-formula.d.ts +5 -1
- package/dist/visio/cell-formula.d.ts.map +1 -1
- package/dist/visio/collab/index.cjs +3 -1
- package/dist/visio/collab/index.mjs +3 -1
- package/dist/visio/container-relationships.d.ts +19 -0
- package/dist/visio/container-relationships.d.ts.map +1 -0
- package/dist/visio/edit-container-fit.d.ts +19 -0
- package/dist/visio/edit-container-fit.d.ts.map +1 -0
- package/dist/visio/edit-container-members.d.ts +21 -0
- package/dist/visio/edit-container-members.d.ts.map +1 -0
- package/dist/visio/edit-delete.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts +23 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts.d.ts +3 -2
- package/dist/visio/edit-diagram-parts.d.ts.map +1 -1
- package/dist/visio/edit-geometry.d.ts +4 -1
- package/dist/visio/edit-geometry.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts +13 -0
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-values.d.ts.map +1 -1
- package/dist/visio/edit-recalculate.d.ts.map +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/formula-analyze.d.ts +2 -0
- package/dist/visio/formula-analyze.d.ts.map +1 -1
- package/dist/visio/formula-evaluate.d.ts.map +1 -1
- package/dist/visio/formula-master.d.ts +1 -0
- package/dist/visio/formula-master.d.ts.map +1 -1
- package/dist/visio/index.cjs +2771 -1312
- package/dist/visio/index.d.ts +1 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +2771 -1312
- package/dist/visio/media.d.ts +4 -23
- package/dist/visio/media.d.ts.map +1 -1
- package/dist/visio/package-common.d.ts +1 -1
- package/dist/visio/package-common.d.ts.map +1 -1
- package/dist/visio/shape-structure.d.ts +6 -3
- package/dist/visio/shape-structure.d.ts.map +1 -1
- package/dist/visio/ui/diagram-parts.d.ts +12 -1
- package/dist/visio/ui/diagram-parts.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +2679 -1201
- package/dist/visio/ui/index.mjs +2679 -1202
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
- package/dist/xlsx/edit/chart-ex.d.ts +1 -0
- package/dist/xlsx/edit/chart-ex.d.ts.map +1 -1
- package/dist/xlsx/edit/filter.d.ts +5 -1
- package/dist/xlsx/edit/filter.d.ts.map +1 -1
- package/dist/xlsx/edit/index.d.ts +1 -0
- package/dist/xlsx/edit/index.d.ts.map +1 -1
- package/dist/xlsx/edit/session-calc.d.ts +5 -0
- package/dist/xlsx/edit/session-calc.d.ts.map +1 -1
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/text-columns.d.ts +21 -0
- package/dist/xlsx/edit/text-columns.d.ts.map +1 -0
- package/dist/xlsx/edit/types.d.ts +5 -1
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/embedded-chart-ex-space.d.ts +18 -0
- package/dist/xlsx/embedded-chart-ex-space.d.ts.map +1 -0
- package/dist/xlsx/filter-criteria.d.ts +22 -0
- package/dist/xlsx/filter-criteria.d.ts.map +1 -0
- package/dist/xlsx/filter-dynamic.d.ts +8 -0
- package/dist/xlsx/filter-dynamic.d.ts.map +1 -0
- package/dist/xlsx/filter-menu.d.ts +49 -0
- package/dist/xlsx/filter-menu.d.ts.map +1 -0
- package/dist/xlsx/filter-rows.d.ts +4 -4
- package/dist/xlsx/filter-rows.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +5861 -2939
- package/dist/xlsx/index.d.ts +4 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +5844 -2939
- package/dist/xlsx/load/index.cjs +1871 -585
- package/dist/xlsx/load/index.mjs +1871 -585
- package/dist/xlsx/model-filter.d.ts +54 -0
- package/dist/xlsx/model-filter.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +42 -3
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/read/chart.d.ts.map +1 -1
- package/dist/xlsx/read/drawing.d.ts.map +1 -1
- package/dist/xlsx/read/filter-columns.d.ts +5 -0
- package/dist/xlsx/read/filter-columns.d.ts.map +1 -0
- package/dist/xlsx/read/shared-strings.d.ts +5 -3
- package/dist/xlsx/read/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-data.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-props.d.ts +2 -2
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/filters.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/filters.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -1
- package/dist/xlsx/ui/dialogs/grid-chart.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +7177 -4234
- package/dist/xlsx/ui/index.mjs +7177 -4234
- package/dist/xlsx/write/drawing.d.ts.map +1 -1
- package/dist/xlsx/write/filter-columns.d.ts +39 -0
- package/dist/xlsx/write/filter-columns.d.ts.map +1 -0
- package/dist/xlsx/write/shared-strings.d.ts +4 -4
- package/dist/xlsx/write/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts +2 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/smart-art-cache.d.ts.map +1 -1
- package/dist/xlsx/write/smart-art.d.ts.map +1 -1
- package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
- package/package.json +6 -1
- package/dist/PptxHandler-QY5VL3CY.mjs +0 -7
- package/dist/PptxHandler-SJ5ZUIUX.mjs +0 -4
- package/dist/chunk-3GXV5MPC.mjs +0 -41
- package/dist/pptx/chunks/elements-mSCZ84Tc.d.ts.map +0 -1
- package/dist/pptx/chunks/index-DKybuHPT.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-DLumQo90.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker,
|
|
1
|
+
import { NS, RELATIONSHIP_TYPES, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker, readText3DValues, readScene3DValues, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, LN_CHILD_ORDER, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, readCommentMentions, rebaseCommentMentions, applyCommentMentions, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, drawingLineXml, parseDrawingTextBody, parseXml, parseDrawingFill, parseDrawingLine, first, buildXml, setDrawingFillXml, fillElementOf, patchDrawingLine, elements, drawingFillXml, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseDiagramDataModel, DEFAULT_GENERATED_DIAGRAM_SCHEME, previewDiagramLayout, parseDiagramColors, resolveDrawingColor, children, parseDrawingRichTextBody, writeGeneratedDiagramDrawing, descendants, GENERATED_DIAGRAM_CACHE_NS, generatedDrawingDigest, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, resolveThemeFillStyle, resolveThemeLineStyle, resolveThemeEffectStyle, relAttr, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, relationshipsPartFor, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, formatCellAddress, childrenNamed, childNamed, parseCellAddress, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, worksheetData, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, readPictureEffect, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, normalizeStShapeType, applyCustomShows, applySections, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, patchDrawingColorIn, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, parsePptxJson, pptxDataFromJsonDocument, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, buildRelationshipsXml, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, escText, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, OOXML_PERCENT_UNITS, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, emu, formatSchemeKey, gradFill, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, parseKinsoku, deobfuscateFont, detectFontFormat, parseDataTable, parseChartAxes, parseBubbleChartOptions, extractGuidFromPartName, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, extractCxSeriesColor, parseCxDataLabels, parseCxRegionMapOptions, parseCxAxes, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, decodeBase64, parseSmartArtPresLayoutVars, parseDrawingColorIn, parseSmartArtConnection, connectionLabel, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, captureDiagramPictures, parseDiagramDrawing, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, collectTransitionText, parseSmartArtQuickStyleLabels, parseDiagramQuickStyle, parseDiagramLayoutSummary, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-Y2RH4QWG.mjs';
|
|
2
2
|
import { openPptxZip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, openZip, MAX_ZIP_ENTRY_COUNT, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError } from './chunk-EYCM7RVL.mjs';
|
|
3
|
-
import { resolveSmartArtLayoutCategory } from './chunk-
|
|
4
|
-
import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-
|
|
3
|
+
import { resolveSmartArtLayoutCategory } from './chunk-2N7RZQLC.mjs';
|
|
4
|
+
import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-VDUNZTJC.mjs';
|
|
5
5
|
import { themeColorRefFromColorChoice, parseOoxmlPercent, themeColorRefToSolidFillWithOpacity, applyDrawingColorTransforms, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, themeColorRefFromSchemeClr, blendColorOntoWhite } from './chunk-7DJEJTN7.mjs';
|
|
6
6
|
import JSZip2 from 'jszip';
|
|
7
7
|
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
@@ -199,196 +199,49 @@ function countAuthoredElements(elements2) {
|
|
|
199
199
|
return total;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
//
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
"legacyObliqueBottom",
|
|
212
|
-
"legacyObliqueBottomRight",
|
|
213
|
-
"legacyPerspectiveTopLeft",
|
|
214
|
-
"legacyPerspectiveTop",
|
|
215
|
-
"legacyPerspectiveTopRight",
|
|
216
|
-
"legacyPerspectiveLeft",
|
|
217
|
-
"legacyPerspectiveFront",
|
|
218
|
-
"legacyPerspectiveRight",
|
|
219
|
-
"legacyPerspectiveBottomLeft",
|
|
220
|
-
"legacyPerspectiveBottom",
|
|
221
|
-
"legacyPerspectiveBottomRight",
|
|
222
|
-
"orthographicFront",
|
|
223
|
-
"isometricTopUp",
|
|
224
|
-
"isometricTopDown",
|
|
225
|
-
"isometricBottomUp",
|
|
226
|
-
"isometricBottomDown",
|
|
227
|
-
"isometricLeftUp",
|
|
228
|
-
"isometricLeftDown",
|
|
229
|
-
"isometricRightUp",
|
|
230
|
-
"isometricRightDown",
|
|
231
|
-
"isometricOffAxis1Left",
|
|
232
|
-
"isometricOffAxis1Right",
|
|
233
|
-
"isometricOffAxis1Top",
|
|
234
|
-
"isometricOffAxis2Left",
|
|
235
|
-
"isometricOffAxis2Right",
|
|
236
|
-
"isometricOffAxis2Top",
|
|
237
|
-
"isometricOffAxis3Left",
|
|
238
|
-
"isometricOffAxis3Right",
|
|
239
|
-
"isometricOffAxis3Bottom",
|
|
240
|
-
"isometricOffAxis4Left",
|
|
241
|
-
"isometricOffAxis4Right",
|
|
242
|
-
"isometricOffAxis4Bottom",
|
|
243
|
-
"obliqueTopLeft",
|
|
244
|
-
"obliqueTop",
|
|
245
|
-
"obliqueTopRight",
|
|
246
|
-
"obliqueLeft",
|
|
247
|
-
"obliqueRight",
|
|
248
|
-
"obliqueBottomLeft",
|
|
249
|
-
"obliqueBottom",
|
|
250
|
-
"obliqueBottomRight",
|
|
251
|
-
"perspectiveFront",
|
|
252
|
-
"perspectiveLeft",
|
|
253
|
-
"perspectiveRight",
|
|
254
|
-
"perspectiveAbove",
|
|
255
|
-
"perspectiveBelow",
|
|
256
|
-
"perspectiveAboveLeftFacing",
|
|
257
|
-
"perspectiveAboveRightFacing",
|
|
258
|
-
"perspectiveContrastingLeftFacing",
|
|
259
|
-
"perspectiveContrastingRightFacing",
|
|
260
|
-
"perspectiveHeroicLeftFacing",
|
|
261
|
-
"perspectiveHeroicRightFacing",
|
|
262
|
-
"perspectiveHeroicExtremeLeftFacing",
|
|
263
|
-
"perspectiveHeroicExtremeRightFacing",
|
|
264
|
-
"perspectiveRelaxed",
|
|
265
|
-
"perspectiveRelaxedModerately"
|
|
266
|
-
]);
|
|
267
|
-
var LIGHT_RIGS = /* @__PURE__ */ new Set([
|
|
268
|
-
"legacyFlat1",
|
|
269
|
-
"legacyFlat2",
|
|
270
|
-
"legacyFlat3",
|
|
271
|
-
"legacyFlat4",
|
|
272
|
-
"legacyNormal1",
|
|
273
|
-
"legacyNormal2",
|
|
274
|
-
"legacyNormal3",
|
|
275
|
-
"legacyNormal4",
|
|
276
|
-
"legacyHarsh1",
|
|
277
|
-
"legacyHarsh2",
|
|
278
|
-
"legacyHarsh3",
|
|
279
|
-
"legacyHarsh4",
|
|
280
|
-
"threePt",
|
|
281
|
-
"balanced",
|
|
282
|
-
"soft",
|
|
283
|
-
"harsh",
|
|
284
|
-
"flood",
|
|
285
|
-
"contrasting",
|
|
286
|
-
"morning",
|
|
287
|
-
"sunrise",
|
|
288
|
-
"sunset",
|
|
289
|
-
"chilly",
|
|
290
|
-
"freezing",
|
|
291
|
-
"flat",
|
|
292
|
-
"twoPt",
|
|
293
|
-
"glow",
|
|
294
|
-
"brightRoom"
|
|
295
|
-
]);
|
|
296
|
-
var LIGHT_DIRECTIONS = /* @__PURE__ */ new Set(["tl", "t", "tr", "l", "r", "bl", "b", "br"]);
|
|
297
|
-
|
|
298
|
-
// drawingml/read-3d-values.ts
|
|
299
|
-
var integer = (value) => {
|
|
300
|
-
if (value === void 0 || value === null || String(value).trim() === "") return void 0;
|
|
301
|
-
const n = Number(value);
|
|
302
|
-
return Number.isSafeInteger(n) ? n : void 0;
|
|
303
|
-
};
|
|
304
|
-
function readScene3DValues(node, read) {
|
|
305
|
-
const out = {};
|
|
306
|
-
const camera = read.child(node, "camera");
|
|
307
|
-
const light = read.child(node, "lightRig");
|
|
308
|
-
for (const [key2, source, attribute2, choices] of [
|
|
309
|
-
["cameraPreset", camera, "prst", CAMERA_PRESETS],
|
|
310
|
-
["lightRigType", light, "rig", LIGHT_RIGS],
|
|
311
|
-
["lightRigDirection", light, "dir", LIGHT_DIRECTIONS]
|
|
312
|
-
]) {
|
|
313
|
-
const token2 = String(read.attribute(source, attribute2) ?? "").trim();
|
|
314
|
-
if (choices.has(token2)) out[key2] = token2;
|
|
315
|
-
}
|
|
316
|
-
const fov = integer(read.attribute(camera, "fov"));
|
|
317
|
-
if (fov !== void 0 && fov >= 0 && fov <= 108e5) out.cameraFieldOfView = fov;
|
|
318
|
-
const zoom = picturePercentage(read.attribute(camera, "zoom"));
|
|
319
|
-
if (zoom !== void 0 && zoom > 0) out.cameraZoom = zoom;
|
|
320
|
-
for (const [prefix, source] of [
|
|
321
|
-
["camera", camera],
|
|
322
|
-
["lightRig", light]
|
|
323
|
-
]) {
|
|
324
|
-
const rot = read.child(source, "rot");
|
|
325
|
-
for (const [axis, key2] of [
|
|
326
|
-
["lat", "RotX"],
|
|
327
|
-
["lon", "RotY"],
|
|
328
|
-
["rev", "RotZ"]
|
|
329
|
-
]) {
|
|
330
|
-
const value = integer(read.attribute(rot, axis));
|
|
331
|
-
if (value !== void 0 && value >= 0 && value < 216e5) out[`${prefix}${key2}`] = value;
|
|
332
|
-
}
|
|
202
|
+
// diagram/edit/node-tree.ts
|
|
203
|
+
function treeOrderDiagramNodes(nodes) {
|
|
204
|
+
const ids = new Set(nodes.map((node) => node.id));
|
|
205
|
+
const childrenOf = /* @__PURE__ */ new Map();
|
|
206
|
+
for (const node of nodes) {
|
|
207
|
+
const parent = node.parentId && ids.has(node.parentId) ? node.parentId : void 0;
|
|
208
|
+
const list2 = childrenOf.get(parent) ?? [];
|
|
209
|
+
list2.push(node);
|
|
210
|
+
childrenOf.set(parent, list2);
|
|
333
211
|
}
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
for (const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const point = read.child(backdrop, name);
|
|
343
|
-
for (const [axis, suffix] of [
|
|
344
|
-
["x", "X"],
|
|
345
|
-
["y", "Y"],
|
|
346
|
-
["z", "Z"]
|
|
347
|
-
]) {
|
|
348
|
-
const value = integer(read.attribute(point, `${attr5}${axis}`));
|
|
349
|
-
if (value !== void 0) out[`${prefix}${suffix}`] = value;
|
|
350
|
-
}
|
|
212
|
+
const ordered3 = [];
|
|
213
|
+
const seen = /* @__PURE__ */ new Set();
|
|
214
|
+
const visit = (parent) => {
|
|
215
|
+
for (const node of childrenOf.get(parent) ?? []) {
|
|
216
|
+
if (seen.has(node.id)) continue;
|
|
217
|
+
seen.add(node.id);
|
|
218
|
+
ordered3.push(node);
|
|
219
|
+
visit(node.id);
|
|
351
220
|
}
|
|
352
|
-
}
|
|
353
|
-
|
|
221
|
+
};
|
|
222
|
+
visit(void 0);
|
|
223
|
+
for (const node of nodes) if (!seen.has(node.id)) ordered3.push(node);
|
|
224
|
+
return ordered3;
|
|
354
225
|
}
|
|
355
|
-
function
|
|
356
|
-
const
|
|
357
|
-
for (const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
["bevelT", "bevelTop"],
|
|
369
|
-
["bevelB", "bevelBottom"]
|
|
370
|
-
]) {
|
|
371
|
-
const bevel = read.child(node, name);
|
|
372
|
-
if (!bevel) continue;
|
|
373
|
-
out[`${prefix}Type`] = String(read.attribute(bevel, "prst") || "circle").trim();
|
|
374
|
-
for (const [attribute2, suffix] of [
|
|
375
|
-
["w", "Width"],
|
|
376
|
-
["h", "Height"]
|
|
377
|
-
]) {
|
|
378
|
-
const value = integer(read.attribute(bevel, attribute2));
|
|
379
|
-
if (value !== void 0) out[`${prefix}${suffix}`] = value;
|
|
226
|
+
function diagramNodesInTreeOrder(data) {
|
|
227
|
+
const order = /* @__PURE__ */ new Map();
|
|
228
|
+
for (const connection of data.connections)
|
|
229
|
+
if ((connection.type ?? "parOf") === "parOf" && !order.has(connection.destId))
|
|
230
|
+
order.set(connection.destId, connection.srcOrd ?? 0);
|
|
231
|
+
const nodes = data.nodes.map((node, index) => ({
|
|
232
|
+
index,
|
|
233
|
+
node: {
|
|
234
|
+
id: node.modelId,
|
|
235
|
+
text: node.text,
|
|
236
|
+
...node.textParagraphs ? { paragraphs: node.textParagraphs } : {},
|
|
237
|
+
...data.parentById.get(node.modelId) ? { parentId: data.parentById.get(node.modelId) } : {},
|
|
238
|
+
...node.type === "asst" ? { nodeType: "asst" } : {}
|
|
380
239
|
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
function appendInSchemaOrder(parent, order, entries) {
|
|
387
|
-
const rank = (name) => {
|
|
388
|
-
const index = order.indexOf(name);
|
|
389
|
-
return index < 0 ? order.length : index;
|
|
390
|
-
};
|
|
391
|
-
entries.map((entry2, index) => ({ entry: entry2, index })).sort((a, b) => rank(a.entry.name) - rank(b.entry.name) || a.index - b.index).forEach(({ entry: entry2 }) => parent.appendChild(entry2.node));
|
|
240
|
+
}));
|
|
241
|
+
nodes.sort(
|
|
242
|
+
(a, b) => (order.get(a.node.id) ?? Number.MAX_SAFE_INTEGER) - (order.get(b.node.id) ?? Number.MAX_SAFE_INTEGER) || a.index - b.index
|
|
243
|
+
);
|
|
244
|
+
return treeOrderDiagramNodes(nodes.map((entry2) => entry2.node));
|
|
392
245
|
}
|
|
393
246
|
|
|
394
247
|
// diagram/write/fabricated-styles.ts
|
|
@@ -435,150 +288,31 @@ function buildFabricatedColorsXml(scheme) {
|
|
|
435
288
|
).join("")}</dgm:colorsDef>`;
|
|
436
289
|
}
|
|
437
290
|
|
|
438
|
-
// drawingml/
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
"grpFill",
|
|
447
|
-
"effectLst",
|
|
448
|
-
"effectDag",
|
|
449
|
-
"highlight",
|
|
450
|
-
"uLnTx",
|
|
451
|
-
"uLn",
|
|
452
|
-
"uFillTx",
|
|
453
|
-
"uFill",
|
|
454
|
-
"latin",
|
|
455
|
-
"ea",
|
|
456
|
-
"cs",
|
|
457
|
-
"sym",
|
|
458
|
-
"hlinkClick",
|
|
459
|
-
"hlinkMouseOver",
|
|
460
|
-
"rtl",
|
|
461
|
-
"extLst"
|
|
462
|
-
];
|
|
463
|
-
|
|
464
|
-
// diagram/data-model.ts
|
|
465
|
-
var TRANSITION_TYPES = /* @__PURE__ */ new Set(["parTrans", "sibTrans"]);
|
|
466
|
-
function collectTransitionText(points7, describe, text) {
|
|
467
|
-
const byId = /* @__PURE__ */ new Map();
|
|
468
|
-
for (const point of points7) {
|
|
469
|
-
const { type, modelId } = describe(point);
|
|
470
|
-
if (!TRANSITION_TYPES.has((type ?? "").trim())) continue;
|
|
471
|
-
const id = (modelId ?? "").trim();
|
|
472
|
-
if (!id) continue;
|
|
473
|
-
const value = text(point).trim();
|
|
474
|
-
if (value.length > 0) byId.set(id, value);
|
|
475
|
-
}
|
|
476
|
-
return byId;
|
|
477
|
-
}
|
|
478
|
-
function connectionLabel(connection, transitionText) {
|
|
479
|
-
const parent = connection.parentTransitionId ? transitionText.get(connection.parentTransitionId) : void 0;
|
|
480
|
-
const sibling = connection.siblingTransitionId ? transitionText.get(connection.siblingTransitionId) : void 0;
|
|
481
|
-
return parent ?? sibling;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// opc/relationship-types.ts
|
|
485
|
-
var BASE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
486
|
-
var RELATIONSHIP_TYPES = {
|
|
487
|
-
officeDocument: `${BASE}/officeDocument`,
|
|
488
|
-
styles: `${BASE}/styles`,
|
|
489
|
-
numbering: `${BASE}/numbering`,
|
|
490
|
-
settings: `${BASE}/settings`,
|
|
491
|
-
theme: `${BASE}/theme`,
|
|
492
|
-
fontTable: `${BASE}/fontTable`,
|
|
493
|
-
webSettings: `${BASE}/webSettings`,
|
|
494
|
-
header: `${BASE}/header`,
|
|
495
|
-
footer: `${BASE}/footer`,
|
|
496
|
-
footnotes: `${BASE}/footnotes`,
|
|
497
|
-
endnotes: `${BASE}/endnotes`,
|
|
498
|
-
comments: `${BASE}/comments`,
|
|
499
|
-
image: `${BASE}/image`,
|
|
500
|
-
hyperlink: `${BASE}/hyperlink`,
|
|
501
|
-
oleObject: `${BASE}/oleObject`,
|
|
502
|
-
chart: `${BASE}/chart`,
|
|
503
|
-
package: `${BASE}/package`,
|
|
504
|
-
slide: `${BASE}/slide`,
|
|
505
|
-
slideLayout: `${BASE}/slideLayout`,
|
|
506
|
-
slideMaster: `${BASE}/slideMaster`,
|
|
507
|
-
notesSlide: `${BASE}/notesSlide`,
|
|
508
|
-
diagramData: `${BASE}/diagramData`,
|
|
509
|
-
diagramLayout: `${BASE}/diagramLayout`,
|
|
510
|
-
diagramQuickStyle: `${BASE}/diagramQuickStyle`,
|
|
511
|
-
diagramColors: `${BASE}/diagramColors`,
|
|
512
|
-
diagramDrawing: "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing",
|
|
513
|
-
coreProperties: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
|
|
514
|
-
extendedProperties: `${BASE}/extended-properties`,
|
|
515
|
-
customProperties: `${BASE}/custom-properties`,
|
|
516
|
-
customXml: `${BASE}/customXml`,
|
|
517
|
-
worksheet: `${BASE}/worksheet`,
|
|
518
|
-
chartsheet: `${BASE}/chartsheet`,
|
|
519
|
-
dialogsheet: `${BASE}/dialogsheet`,
|
|
520
|
-
xlMacrosheet: "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",
|
|
521
|
-
sharedStrings: `${BASE}/sharedStrings`,
|
|
522
|
-
drawing: `${BASE}/drawing`,
|
|
523
|
-
table: `${BASE}/table`,
|
|
524
|
-
threadedComment: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
|
|
525
|
-
person: "http://schemas.microsoft.com/office/2017/10/relationships/person",
|
|
526
|
-
vmlDrawing: `${BASE}/vmlDrawing`,
|
|
527
|
-
calcChain: `${BASE}/calcChain`,
|
|
528
|
-
vbaProject: "http://schemas.microsoft.com/office/2006/relationships/vbaProject",
|
|
529
|
-
pivotTable: `${BASE}/pivotTable`,
|
|
530
|
-
pivotCacheDefinition: `${BASE}/pivotCacheDefinition`,
|
|
531
|
-
externalLink: `${BASE}/externalLink`,
|
|
532
|
-
printerSettings: `${BASE}/printerSettings`,
|
|
533
|
-
sheetMetadata: `${BASE}/sheetMetadata`
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
// opc/relationships.ts
|
|
537
|
-
function parseRelationships(xml) {
|
|
538
|
-
const map = /* @__PURE__ */ new Map();
|
|
539
|
-
if (!xml) return map;
|
|
540
|
-
const root = parseXml(xml).documentElement;
|
|
541
|
-
for (const node of elements(root)) {
|
|
542
|
-
if (node.localName !== "Relationship") continue;
|
|
543
|
-
const id = node.getAttribute("Id");
|
|
544
|
-
const target = node.getAttribute("Target");
|
|
545
|
-
if (!id || target == null) continue;
|
|
546
|
-
map.set(id, {
|
|
547
|
-
id,
|
|
548
|
-
type: node.getAttribute("Type") ?? "",
|
|
549
|
-
target,
|
|
550
|
-
mode: node.getAttribute("TargetMode") === "External" ? "External" : "Internal"
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
return map;
|
|
554
|
-
}
|
|
555
|
-
var escapeAttr = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
556
|
-
function buildRelationshipsXml(relationships2) {
|
|
557
|
-
const items = Array.from(relationships2).map(([id, rel]) => {
|
|
558
|
-
const mode = rel.mode === "External" ? ' TargetMode="External"' : "";
|
|
559
|
-
return `<Relationship Id="${escapeAttr(id)}" Type="${escapeAttr(rel.type)}" Target="${escapeAttr(rel.target)}"${mode}/>`;
|
|
560
|
-
}).join("");
|
|
561
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${NS.rels}">${items}</Relationships>`;
|
|
562
|
-
}
|
|
563
|
-
function resolvePartPath(basePart, target) {
|
|
564
|
-
if (target.startsWith("/")) return target.slice(1);
|
|
565
|
-
const baseDir = basePart.slice(0, basePart.lastIndexOf("/") + 1);
|
|
566
|
-
const resolved = [];
|
|
567
|
-
for (const segment of `${baseDir}${target}`.split("/")) {
|
|
568
|
-
if (segment === "." || segment === "") continue;
|
|
569
|
-
if (segment === "..") resolved.pop();
|
|
570
|
-
else resolved.push(segment);
|
|
291
|
+
// drawingml/drawing-shadow.ts
|
|
292
|
+
function resolveDrawingOuterShadow(effect, theme) {
|
|
293
|
+
if (effect.sourceXml) {
|
|
294
|
+
const source = parseXml(effect.sourceXml).documentElement;
|
|
295
|
+
for (const attribute2 of ["blurRad", "dist", "dir", "sx", "sy", "kx", "ky"]) {
|
|
296
|
+
const value = source.getAttribute(attribute2);
|
|
297
|
+
if (value !== null && !Number.isFinite(Number(value))) return void 0;
|
|
298
|
+
}
|
|
571
299
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return
|
|
300
|
+
if ((effect.scaleX ?? 1e5) !== 1e5 || (effect.scaleY ?? 1e5) !== 1e5 || (effect.skewXAngle ?? 0) !== 0 || (effect.skewYAngle ?? 0) !== 0)
|
|
301
|
+
return void 0;
|
|
302
|
+
const color2 = effect.color;
|
|
303
|
+
const resolved = color2 && resolveDrawingColor(color2, theme, { transformOrder: "document" });
|
|
304
|
+
const blur = (effect.blurRadiusEmu ?? 0) / EMU_PER_PIXEL;
|
|
305
|
+
const distance = (effect.distanceEmu ?? 0) / EMU_PER_PIXEL;
|
|
306
|
+
const angle = (effect.directionAngle ?? 0) / 6e4 * Math.PI / 180;
|
|
307
|
+
if (!resolved || ![blur, distance, angle].every(Number.isFinite) || blur < 0 || distance < 0)
|
|
308
|
+
return void 0;
|
|
309
|
+
return {
|
|
310
|
+
color: resolved.hex,
|
|
311
|
+
opacity: resolved.alpha,
|
|
312
|
+
blur,
|
|
313
|
+
dx: Math.cos(angle) * distance,
|
|
314
|
+
dy: Math.sin(angle) * distance
|
|
315
|
+
};
|
|
582
316
|
}
|
|
583
317
|
|
|
584
318
|
// opc/content-types.ts
|
|
@@ -1157,6 +891,215 @@ function replaceTitleGroup(headingPairs, titlesOfParts, group) {
|
|
|
1157
891
|
return fromTitleGroups(groups);
|
|
1158
892
|
}
|
|
1159
893
|
|
|
894
|
+
// diagram/drawing-theme.ts
|
|
895
|
+
function resolveDiagramDrawingStyles(drawing, scheme) {
|
|
896
|
+
if (!scheme) return drawing;
|
|
897
|
+
return {
|
|
898
|
+
...drawing,
|
|
899
|
+
shapes: drawing.shapes.map((shape2) => {
|
|
900
|
+
const refs = shape2.style;
|
|
901
|
+
if (!refs) return shape2;
|
|
902
|
+
const fill3 = !shape2.fill && refs.fill?.index !== void 0 ? refs.fill.index === 0 ? { kind: "none" } : resolveThemeFillStyle(scheme, refs.fill.index, refs.fill.color) : void 0;
|
|
903
|
+
const inheritedLine = refs.line?.index !== void 0 ? refs.line.index === 0 ? { fill: { kind: "none" } } : resolveThemeLineStyle(scheme, refs.line.index, refs.line.color) : void 0;
|
|
904
|
+
const line = inheritedLine ? { ...inheritedLine, ...shape2.line } : void 0;
|
|
905
|
+
const effects2 = !shape2.effects && refs.effect?.index !== void 0 ? resolveThemeEffectStyle(scheme, refs.effect.index, refs.effect.color) : void 0;
|
|
906
|
+
return {
|
|
907
|
+
...shape2,
|
|
908
|
+
...fill3 ? { fill: fill3 } : {},
|
|
909
|
+
...line ? { line } : {},
|
|
910
|
+
...effects2 ? { effects: effects2 } : {}
|
|
911
|
+
};
|
|
912
|
+
})
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// diagram/write/cache.ts
|
|
917
|
+
var DSP = "http://schemas.microsoft.com/office/drawing/2008/diagram";
|
|
918
|
+
function add(parent, namespace, name, attrs2 = {}) {
|
|
919
|
+
const child17 = parent.ownerDocument.createElementNS(namespace, name);
|
|
920
|
+
for (const [key2, value] of Object.entries(attrs2)) child17.setAttribute(key2, value);
|
|
921
|
+
parent.appendChild(child17);
|
|
922
|
+
return child17;
|
|
923
|
+
}
|
|
924
|
+
function withDiagramDrawingRelationship(xml, relationshipId) {
|
|
925
|
+
const doc = parseXml(xml);
|
|
926
|
+
const model = doc.documentElement;
|
|
927
|
+
let extension = descendants(model, "dataModelExt").find((node) => node.namespaceURI === DSP);
|
|
928
|
+
if (!extension) {
|
|
929
|
+
const extLst = first(model, "extLst", NS.dgm) ?? add(model, NS.dgm, "dgm:extLst");
|
|
930
|
+
extension = add(add(extLst, NS.a, "a:ext", { uri: DSP }), DSP, "dsp:dataModelExt", {
|
|
931
|
+
minVer: NS.dgm
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
extension.setAttribute("relId", relationshipId);
|
|
935
|
+
return buildXml(doc);
|
|
936
|
+
}
|
|
937
|
+
function buildGeneratedDiagramCache(dataXml2, input) {
|
|
938
|
+
dataXml2 = withDiagramPictureSources(dataXml2, input.source);
|
|
939
|
+
const source = { ...input.source, dataXml: dataXml2 };
|
|
940
|
+
const model = parseDiagramDataModel(dataXml2);
|
|
941
|
+
const scheme = { ...DEFAULT_GENERATED_DIAGRAM_SCHEME, ...input.scheme };
|
|
942
|
+
const preview = previewDiagramLayout({
|
|
943
|
+
...input,
|
|
944
|
+
source,
|
|
945
|
+
scheme,
|
|
946
|
+
nodes: diagramNodesInTreeOrder(model)
|
|
947
|
+
});
|
|
948
|
+
if (preview.mode !== "interpreted" || preview.issues.length || !preview.drawing?.shapes.length)
|
|
949
|
+
return void 0;
|
|
950
|
+
const drawing = resolveDiagramDrawingStyles(preview.drawing, input.formatScheme);
|
|
951
|
+
const doc = parseXml(dataXml2);
|
|
952
|
+
const root = doc.documentElement;
|
|
953
|
+
const points7 = first(root, "ptLst", NS.dgm);
|
|
954
|
+
const connections = first(root, "cxnLst", NS.dgm);
|
|
955
|
+
if (!points7 || !connections) return void 0;
|
|
956
|
+
const colors = source.colorsXml ? parseDiagramColors(source.colorsXml).labels : [];
|
|
957
|
+
const authoredColors = colors.flatMap((label2) => [...label2.fill.colors, ...label2.line.colors]);
|
|
958
|
+
const themed = /* @__PURE__ */ new Map();
|
|
959
|
+
for (const color2 of authoredColors) {
|
|
960
|
+
const resolved = resolveDrawingColor(color2, { scheme: (name) => scheme[name] });
|
|
961
|
+
if (resolved && !resolved.unapplied.length) themed.set(resolved.hex.toUpperCase(), color2);
|
|
962
|
+
}
|
|
963
|
+
for (const shape2 of drawing.shapes) {
|
|
964
|
+
if (shape2.has3d || shape2.foldedNodeIds?.length) return void 0;
|
|
965
|
+
if (shape2.fill && !["none", "solid", "gradient", "picture"].includes(shape2.fill.kind))
|
|
966
|
+
return void 0;
|
|
967
|
+
if (shape2.fill?.kind === "picture" && (!shape2.fill.relId || !drawing.pictureParts?.[shape2.fill.relId]))
|
|
968
|
+
return void 0;
|
|
969
|
+
if (shape2.fill?.kind === "gradient" && shape2.fill.path && !["circle", "rect"].includes(shape2.fill.path))
|
|
970
|
+
return void 0;
|
|
971
|
+
if (shape2.effects?.effects.some(
|
|
972
|
+
(effect) => effect.kind !== "outerShadow" || !resolveDrawingOuterShadow(effect, { scheme: (name) => scheme[name] })
|
|
973
|
+
))
|
|
974
|
+
return void 0;
|
|
975
|
+
const point = children(points7, "pt", NS.dgm).find(
|
|
976
|
+
(point2) => point2.getAttribute("modelId") === shape2.sourceNodeId
|
|
977
|
+
);
|
|
978
|
+
const direct = model.nodes.find((node) => node.modelId === shape2.sourceNodeId);
|
|
979
|
+
const fillIndex = shape2.style?.fill?.index;
|
|
980
|
+
const template = fillIndex ? input.formatScheme?.fillStyles[fillIndex - 1]?.fill : void 0;
|
|
981
|
+
if (!direct?.fill && shape2.fill?.kind === "solid" && shape2.fill.color.kind === "srgb" && (!template || template.kind === "solid" && template.color.kind === "scheme" && template.color.value === "phClr")) {
|
|
982
|
+
const original = themed.get(`#${shape2.fill.color.value}`.toUpperCase());
|
|
983
|
+
if (original)
|
|
984
|
+
shape2.fill.color = {
|
|
985
|
+
...original,
|
|
986
|
+
transforms: [...original.transforms, ...shape2.fill.color.transforms]
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
if (!direct?.fill && shape2.fill?.kind === "gradient" && template?.kind === "gradient") {
|
|
990
|
+
shape2.fill.stops.forEach((stop, index) => {
|
|
991
|
+
const authored = template.stops[index]?.color;
|
|
992
|
+
if (authored?.kind === "scheme" && authored.value === "phClr" && stop.color.kind === "srgb") {
|
|
993
|
+
const original = themed.get(`#${stop.color.value}`.toUpperCase());
|
|
994
|
+
if (original)
|
|
995
|
+
stop.color = {
|
|
996
|
+
...original,
|
|
997
|
+
transforms: [...original.transforms, ...stop.color.transforms]
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
const role = colors.find((label2) => label2.name === shape2.sourceStyleLabel) ?? colors.find((label2) => label2.name === "node0");
|
|
1003
|
+
const fallbackColor = role?.textFill.colors[0] ?? {
|
|
1004
|
+
kind: "scheme",
|
|
1005
|
+
value: "tx1",
|
|
1006
|
+
transforms: []
|
|
1007
|
+
};
|
|
1008
|
+
const body = parseDrawingRichTextBody(first(point, "t", NS.dgm));
|
|
1009
|
+
if (body) {
|
|
1010
|
+
const props = body.bodyProperties;
|
|
1011
|
+
if (props && (props.vertical && props.vertical !== "horz" || (props.columnCount ?? 1) > 1 || props.rotation || props.extraXml?.length || props.autofit?.kind === "shape"))
|
|
1012
|
+
return void 0;
|
|
1013
|
+
for (const paragraph2 of body.paragraphs) {
|
|
1014
|
+
if (paragraph2.properties?.bullet && paragraph2.properties.bullet.kind !== "none" || paragraph2.properties?.tabStops?.length || paragraph2.items.some((item) => item.kind === "unknown"))
|
|
1015
|
+
return void 0;
|
|
1016
|
+
if (paragraph2.properties?.extraXml?.length || paragraph2.items.some((item) => {
|
|
1017
|
+
const properties = "properties" in item ? item.properties : void 0;
|
|
1018
|
+
return properties && (properties.baseline || properties.spacingPt || properties.rightToLeft || properties.highlight || properties.line || properties.caps && properties.caps !== "none" || properties.strike && properties.strike !== "noStrike" || properties.extraXml?.length);
|
|
1019
|
+
}))
|
|
1020
|
+
return void 0;
|
|
1021
|
+
paragraph2.properties = {
|
|
1022
|
+
...paragraph2.properties,
|
|
1023
|
+
defaultRunProperties: {
|
|
1024
|
+
sizePt: shape2.text?.paragraphs[0]?.runs[0]?.sizePt ?? 12,
|
|
1025
|
+
fill: { kind: "solid", color: fallbackColor },
|
|
1026
|
+
latin: { typeface: "+mn-lt" },
|
|
1027
|
+
...paragraph2.properties?.defaultRunProperties
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
body.bodyProperties = { anchor: "ctr", ...body.bodyProperties };
|
|
1032
|
+
shape2.body = body;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
let serialized;
|
|
1036
|
+
try {
|
|
1037
|
+
serialized = writeGeneratedDiagramDrawing(drawing);
|
|
1038
|
+
} catch {
|
|
1039
|
+
return void 0;
|
|
1040
|
+
}
|
|
1041
|
+
const oldMarkers = descendants(root, "generatedCache").filter(
|
|
1042
|
+
(node) => node.namespaceURI === GENERATED_DIAGRAM_CACHE_NS
|
|
1043
|
+
);
|
|
1044
|
+
const oldIds = new Set(
|
|
1045
|
+
oldMarkers.flatMap(
|
|
1046
|
+
(marker3) => descendants(marker3, "shape").map((node) => node.getAttribute("id"))
|
|
1047
|
+
)
|
|
1048
|
+
);
|
|
1049
|
+
for (const point of children(points7, "pt", NS.dgm))
|
|
1050
|
+
if (oldIds.has(point.getAttribute("modelId"))) points7.removeChild(point);
|
|
1051
|
+
for (const edge of children(connections, "cxn", NS.dgm))
|
|
1052
|
+
if (oldIds.has(edge.getAttribute("destId"))) connections.removeChild(edge);
|
|
1053
|
+
for (const marker3 of oldMarkers) {
|
|
1054
|
+
const parent = marker3.parentNode;
|
|
1055
|
+
if (parent && children(parent, "generatedCache", GENERATED_DIAGRAM_CACHE_NS).length === 1 && parent.childNodes.length === 1)
|
|
1056
|
+
parent.parentNode?.removeChild(parent);
|
|
1057
|
+
else parent?.removeChild(marker3);
|
|
1058
|
+
}
|
|
1059
|
+
const extLst = first(root, "extLst", NS.dgm) ?? add(root, NS.dgm, "dgm:extLst");
|
|
1060
|
+
const marker2 = add(
|
|
1061
|
+
add(extLst, NS.a, "a:ext", { uri: GENERATED_DIAGRAM_CACHE_NS }),
|
|
1062
|
+
GENERATED_DIAGRAM_CACHE_NS,
|
|
1063
|
+
"oc:generatedCache",
|
|
1064
|
+
{
|
|
1065
|
+
engine: "ordered-2d",
|
|
1066
|
+
approximate: "1",
|
|
1067
|
+
drawingSha256: generatedDrawingDigest(serialized.xml)
|
|
1068
|
+
}
|
|
1069
|
+
);
|
|
1070
|
+
drawing.shapes.forEach((shape2, index) => {
|
|
1071
|
+
const id = serialized.modelIds.get(shape2.modelId);
|
|
1072
|
+
const point = add(points7, NS.dgm, "dgm:pt", { modelId: id, type: "pres" });
|
|
1073
|
+
add(point, NS.dgm, "dgm:prSet", {
|
|
1074
|
+
...shape2.sourceNodeId ? { presAssocID: shape2.sourceNodeId } : {},
|
|
1075
|
+
presName: shape2.sourceLayoutRole ?? "node",
|
|
1076
|
+
presStyleLbl: shape2.sourceStyleLabel ?? "node1",
|
|
1077
|
+
presStyleIdx: String(index),
|
|
1078
|
+
presStyleCnt: String(drawing.shapes.length)
|
|
1079
|
+
});
|
|
1080
|
+
const properties = add(point, NS.dgm, "dgm:spPr");
|
|
1081
|
+
if (shape2.fill?.kind === "picture" && shape2.fill.sourceXml) {
|
|
1082
|
+
properties.appendChild(doc.importNode(parseXml(shape2.fill.sourceXml).documentElement, true));
|
|
1083
|
+
}
|
|
1084
|
+
if (shape2.sourceNodeId)
|
|
1085
|
+
add(connections, NS.dgm, "dgm:cxn", {
|
|
1086
|
+
modelId: createOfficeGuid(),
|
|
1087
|
+
type: "presOf",
|
|
1088
|
+
srcId: shape2.sourceNodeId,
|
|
1089
|
+
destId: id,
|
|
1090
|
+
srcOrd: "0",
|
|
1091
|
+
destOrd: "0",
|
|
1092
|
+
presId: input.layoutId ?? ""
|
|
1093
|
+
});
|
|
1094
|
+
add(marker2, GENERATED_DIAGRAM_CACHE_NS, "oc:shape", { id });
|
|
1095
|
+
});
|
|
1096
|
+
return {
|
|
1097
|
+
dataXml: buildXml(doc),
|
|
1098
|
+
drawingXml: serialized.xml,
|
|
1099
|
+
...drawing.pictureParts ? { pictureParts: drawing.pictureParts } : {}
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1160
1103
|
// diagram/relationships.ts
|
|
1161
1104
|
function diagramRelationshipsPart(partPath) {
|
|
1162
1105
|
const dir = partPath.replace(/\/[^/]+$/u, "");
|
|
@@ -1185,84 +1128,164 @@ async function resolveDiagramDrawingPart(hostPart, dataRelId, drawingExtensionRe
|
|
|
1185
1128
|
if (id.length === 0 || target.length === 0) return void 0;
|
|
1186
1129
|
return { relId: id, path: host.resolvePath(dataPath, target), ownerPart: dataPath };
|
|
1187
1130
|
}
|
|
1131
|
+
({
|
|
1132
|
+
data: RELATIONSHIP_TYPES.diagramData,
|
|
1133
|
+
layout: RELATIONSHIP_TYPES.diagramLayout,
|
|
1134
|
+
quickStyle: RELATIONSHIP_TYPES.diagramQuickStyle,
|
|
1135
|
+
colors: RELATIONSHIP_TYPES.diagramColors,
|
|
1136
|
+
drawing: RELATIONSHIP_TYPES.diagramDrawing
|
|
1137
|
+
});
|
|
1188
1138
|
|
|
1189
|
-
//
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
]
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1139
|
+
// diagram/load.ts
|
|
1140
|
+
var slot = [
|
|
1141
|
+
["data", "dataRelId"],
|
|
1142
|
+
["layout", "layoutRelId"],
|
|
1143
|
+
["quickStyle", "styleRelId"],
|
|
1144
|
+
["colors", "colorsRelId"]
|
|
1145
|
+
];
|
|
1146
|
+
async function loadDiagram(hostPart, relationshipIds, host) {
|
|
1147
|
+
const issues = [];
|
|
1148
|
+
const paths = {};
|
|
1149
|
+
const hostRels = host.hostRelationships(hostPart);
|
|
1150
|
+
for (const [name, key2] of slot) {
|
|
1151
|
+
const relId = relationshipIds[key2];
|
|
1152
|
+
if (!relId) {
|
|
1153
|
+
issues.push({
|
|
1154
|
+
code: "DIAGRAM_RELATIONSHIP_MISSING",
|
|
1155
|
+
message: `The diagram has no ${name} relationship id.`
|
|
1156
|
+
});
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
const target = hostRels?.get(relId);
|
|
1160
|
+
if (target === void 0)
|
|
1161
|
+
issues.push({
|
|
1162
|
+
code: "DIAGRAM_RELATIONSHIP_UNRESOLVED",
|
|
1163
|
+
message: `Relationship ${relId} (${name}) is not in ${hostPart}.`
|
|
1164
|
+
});
|
|
1165
|
+
else paths[name] = host.resolvePath(hostPart, target);
|
|
1199
1166
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1167
|
+
const layoutSource = {};
|
|
1168
|
+
const read = async (name, parse) => {
|
|
1169
|
+
const part = paths[name];
|
|
1170
|
+
if (!part) return void 0;
|
|
1171
|
+
try {
|
|
1172
|
+
const xml = await host.readText(part);
|
|
1173
|
+
if (xml === void 0) {
|
|
1174
|
+
issues.push({
|
|
1175
|
+
code: "DIAGRAM_PART_MISSING",
|
|
1176
|
+
message: `Part ${part} is not in the package.`,
|
|
1177
|
+
part
|
|
1178
|
+
});
|
|
1179
|
+
return void 0;
|
|
1180
|
+
}
|
|
1181
|
+
if (name === "layout") layoutSource.layoutXml = xml;
|
|
1182
|
+
if (name === "data") layoutSource.dataXml = xml;
|
|
1183
|
+
if (name === "colors") layoutSource.colorsXml = xml;
|
|
1184
|
+
if (name === "quickStyle") layoutSource.quickStyleXml = xml;
|
|
1185
|
+
return parse(xml, part);
|
|
1186
|
+
} catch (error) {
|
|
1187
|
+
issues.push({
|
|
1188
|
+
code: "DIAGRAM_PART_UNREADABLE",
|
|
1189
|
+
message: `Part ${part} could not be parsed: ${error instanceof Error ? error.message : String(error)}`,
|
|
1190
|
+
part
|
|
1191
|
+
});
|
|
1192
|
+
return void 0;
|
|
1193
|
+
}
|
|
1222
1194
|
};
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1195
|
+
const data = await read("data", (xml, part) => parseDiagramDataModel(xml, part));
|
|
1196
|
+
if (data) issues.push(...data.issues);
|
|
1197
|
+
const layout = await read("layout", (xml) => parseDiagramLayoutSummary(xml));
|
|
1198
|
+
const colors = await read("colors", (xml) => parseDiagramColors(xml));
|
|
1199
|
+
const quickStyle = await read("quickStyle", (xml) => parseDiagramQuickStyle(xml));
|
|
1200
|
+
let drawingResolution;
|
|
1201
|
+
try {
|
|
1202
|
+
drawingResolution = await resolveDiagramDrawingPart(
|
|
1203
|
+
hostPart,
|
|
1204
|
+
relationshipIds.dataRelId ?? "",
|
|
1205
|
+
data?.drawingRelId ?? "",
|
|
1206
|
+
host
|
|
1207
|
+
);
|
|
1208
|
+
} catch (error) {
|
|
1209
|
+
issues.push({
|
|
1210
|
+
code: "DIAGRAM_DRAWING_UNRESOLVED",
|
|
1211
|
+
message: `The cached drawing could not be located: ${error instanceof Error ? error.message : String(error)}`
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
let drawing;
|
|
1215
|
+
let generatedCache = false;
|
|
1216
|
+
if (drawingResolution) {
|
|
1217
|
+
paths.drawing = drawingResolution.path;
|
|
1218
|
+
drawing = await read("drawing", (xml, part) => {
|
|
1219
|
+
generatedCache = Boolean(
|
|
1220
|
+
data?.generatedCacheDigest && data.generatedCacheDigest === generatedDrawingDigest(xml)
|
|
1221
|
+
);
|
|
1222
|
+
return parseDiagramDrawing(xml, part);
|
|
1223
|
+
});
|
|
1224
|
+
if (drawing) {
|
|
1225
|
+
try {
|
|
1226
|
+
const entries = await host.readRelationshipEntries(
|
|
1227
|
+
diagramRelationshipsPart(drawingResolution.path)
|
|
1228
|
+
);
|
|
1229
|
+
const pictures = (entries ?? []).filter(
|
|
1230
|
+
(entry2) => entry2.type.endsWith("/image") && entry2.mode !== "External" && !/^[a-z][a-z0-9+.-]*:/i.test(entry2.target)
|
|
1231
|
+
);
|
|
1232
|
+
if (pictures.length)
|
|
1233
|
+
drawing.pictureParts = Object.fromEntries(
|
|
1234
|
+
pictures.map((entry2) => [
|
|
1235
|
+
entry2.id,
|
|
1236
|
+
host.resolvePath(drawingResolution.path, entry2.target)
|
|
1237
|
+
])
|
|
1238
|
+
);
|
|
1239
|
+
} catch {
|
|
1240
|
+
issues.push({
|
|
1241
|
+
code: "DIAGRAM_PICTURE_RELATIONSHIPS_UNREADABLE",
|
|
1242
|
+
message: "Picture relationships in the cached drawing could not be read."
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
issues.push(...drawing.issues);
|
|
1246
|
+
}
|
|
1247
|
+
} else if (data)
|
|
1248
|
+
issues.push({
|
|
1249
|
+
code: "DIAGRAM_DRAWING_ABSENT",
|
|
1250
|
+
message: "The package has no cached drawing for this diagram; its layout can only be recomputed from the layout definition."
|
|
1251
|
+
});
|
|
1252
|
+
if (data && layoutSource.dataXml) {
|
|
1253
|
+
let pictureParts = {};
|
|
1254
|
+
if (paths.data) {
|
|
1255
|
+
const owner = paths.data;
|
|
1256
|
+
try {
|
|
1257
|
+
const entries = await host.readRelationshipEntries(diagramRelationshipsPart(owner));
|
|
1258
|
+
pictureParts = Object.fromEntries(
|
|
1259
|
+
(entries ?? []).filter(
|
|
1260
|
+
(entry2) => entry2.type.endsWith("/image") && entry2.mode !== "External" && !/^[a-z][a-z0-9+.-]*:/i.test(entry2.target)
|
|
1261
|
+
).map((entry2) => [entry2.id, host.resolvePath(owner, entry2.target)])
|
|
1262
|
+
);
|
|
1263
|
+
} catch {
|
|
1264
|
+
issues.push({
|
|
1265
|
+
code: "DIAGRAM_PICTURE_RELATIONSHIPS_UNREADABLE",
|
|
1266
|
+
message: "Picture relationships in the diagram data could not be read."
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
Object.assign(
|
|
1271
|
+
layoutSource,
|
|
1272
|
+
captureDiagramPictures(data, layoutSource.dataXml, pictureParts, drawing)
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1235
1275
|
return {
|
|
1236
|
-
|
|
1237
|
-
...
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
...
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
const result = {
|
|
1249
|
-
paragraphs,
|
|
1250
|
-
text: paragraphs.map((paragraph2) => paragraph2.runs.map((run2) => run2.text).join("")).join("\n")
|
|
1276
|
+
layoutSource,
|
|
1277
|
+
...generatedCache ? { generatedCache: true } : {},
|
|
1278
|
+
relationshipIds,
|
|
1279
|
+
paths,
|
|
1280
|
+
...drawingResolution ? { drawingRelId: drawingResolution.relId } : {},
|
|
1281
|
+
...drawingResolution?.ownerPart ? { drawingOwnerPart: drawingResolution.ownerPart } : {},
|
|
1282
|
+
...data ? { data } : {},
|
|
1283
|
+
...layout ? { layout } : {},
|
|
1284
|
+
...colors ? { colors } : {},
|
|
1285
|
+
...quickStyle ? { quickStyle } : {},
|
|
1286
|
+
...drawing ? { drawing } : {},
|
|
1287
|
+
issues
|
|
1251
1288
|
};
|
|
1252
|
-
const anchor = properties?.getAttribute("anchor");
|
|
1253
|
-
if (anchor) result.anchor = anchor;
|
|
1254
|
-
const insets = {};
|
|
1255
|
-
for (const [key2, attribute2] of [
|
|
1256
|
-
["left", "lIns"],
|
|
1257
|
-
["top", "tIns"],
|
|
1258
|
-
["right", "rIns"],
|
|
1259
|
-
["bottom", "bIns"]
|
|
1260
|
-
]) {
|
|
1261
|
-
const value = Number.parseInt(properties?.getAttribute(attribute2) ?? "", 10);
|
|
1262
|
-
if (Number.isFinite(value)) insets[key2] = value;
|
|
1263
|
-
}
|
|
1264
|
-
if (Object.keys(insets).length > 0) result.insetsEmu = insets;
|
|
1265
|
-
return result;
|
|
1266
1289
|
}
|
|
1267
1290
|
|
|
1268
1291
|
// pptx/core/builders/factories/ConnectorXmlFactory.ts
|
|
@@ -2369,7 +2392,7 @@ function findSectionList(presentation, lookup) {
|
|
|
2369
2392
|
}
|
|
2370
2393
|
return void 0;
|
|
2371
2394
|
}
|
|
2372
|
-
function
|
|
2395
|
+
function booleanAttribute(value) {
|
|
2373
2396
|
const normalized = String(value ?? "").trim().toLowerCase();
|
|
2374
2397
|
if (normalized === "1" || normalized === "true") {
|
|
2375
2398
|
return true;
|
|
@@ -2405,7 +2428,7 @@ function extractSectionMap(presentationData, lookup) {
|
|
|
2405
2428
|
id: sectionId,
|
|
2406
2429
|
name: sectionName,
|
|
2407
2430
|
slideIds,
|
|
2408
|
-
collapsed:
|
|
2431
|
+
collapsed: booleanAttribute(sectionPr?.["@_collapsed"]),
|
|
2409
2432
|
color: colorRaw ? colorRaw.startsWith("#") ? colorRaw : `#${colorRaw}` : void 0,
|
|
2410
2433
|
rawXml: cloneXmlObject(section)
|
|
2411
2434
|
});
|
|
@@ -5114,7 +5137,7 @@ function extractFillOverlayAttributes(shapeProps, context) {
|
|
|
5114
5137
|
|
|
5115
5138
|
// pptx/core/core/builders/effect-style-extractor-reflection.ts
|
|
5116
5139
|
var VALID_ALIGNMENTS = /* @__PURE__ */ new Set(["tl", "t", "tr", "l", "ctr", "r", "bl", "b", "br"]);
|
|
5117
|
-
function
|
|
5140
|
+
function integer(value) {
|
|
5118
5141
|
if (value === void 0 || value === null || value === "") {
|
|
5119
5142
|
return void 0;
|
|
5120
5143
|
}
|
|
@@ -5131,19 +5154,19 @@ function boolean(value) {
|
|
|
5131
5154
|
return void 0;
|
|
5132
5155
|
}
|
|
5133
5156
|
function fixedFraction(value) {
|
|
5134
|
-
const parsed =
|
|
5157
|
+
const parsed = integer(value);
|
|
5135
5158
|
return parsed !== void 0 && parsed >= 0 && parsed <= 1e5 ? parsed / 1e5 : void 0;
|
|
5136
5159
|
}
|
|
5137
5160
|
function extractReflectionAttributes(node, emuPerPx) {
|
|
5138
|
-
const blur =
|
|
5139
|
-
const distance =
|
|
5140
|
-
const startOpacity =
|
|
5141
|
-
const endOpacity =
|
|
5142
|
-
const startPosition =
|
|
5143
|
-
const endPosition =
|
|
5144
|
-
const direction =
|
|
5145
|
-
const rotation =
|
|
5146
|
-
const fadeDirection =
|
|
5161
|
+
const blur = integer(node["@_blurRad"]);
|
|
5162
|
+
const distance = integer(node["@_dist"]);
|
|
5163
|
+
const startOpacity = integer(node["@_stA"]);
|
|
5164
|
+
const endOpacity = integer(node["@_endA"]);
|
|
5165
|
+
const startPosition = integer(node["@_stPos"]);
|
|
5166
|
+
const endPosition = integer(node["@_endPos"]);
|
|
5167
|
+
const direction = integer(node["@_dir"]);
|
|
5168
|
+
const rotation = integer(node["@_rot"]);
|
|
5169
|
+
const fadeDirection = integer(node["@_fadeDir"]);
|
|
5147
5170
|
const alignment = String(node["@_algn"] ?? "").trim();
|
|
5148
5171
|
return {
|
|
5149
5172
|
reflectionBlurRadius: blur !== void 0 && blur >= 0 ? blur / emuPerPx : void 0,
|
|
@@ -5155,10 +5178,10 @@ function extractReflectionAttributes(node, emuPerPx) {
|
|
|
5155
5178
|
reflectionRotation: rotation !== void 0 ? rotation / 6e4 : void 0,
|
|
5156
5179
|
reflectionDistance: distance !== void 0 && distance >= 0 ? distance / emuPerPx : void 0,
|
|
5157
5180
|
reflectionFadeDirection: fadeDirection !== void 0 ? fadeDirection / 6e4 : void 0,
|
|
5158
|
-
reflectionScaleX:
|
|
5159
|
-
reflectionScaleY:
|
|
5160
|
-
reflectionSkewX:
|
|
5161
|
-
reflectionSkewY:
|
|
5181
|
+
reflectionScaleX: integer(node["@_sx"]),
|
|
5182
|
+
reflectionScaleY: integer(node["@_sy"]),
|
|
5183
|
+
reflectionSkewX: integer(node["@_kx"]),
|
|
5184
|
+
reflectionSkewY: integer(node["@_ky"]),
|
|
5162
5185
|
reflectionAlignment: VALID_ALIGNMENTS.has(alignment) ? alignment : void 0,
|
|
5163
5186
|
reflectionRotateWithShape: boolean(node["@_rotWithShape"])
|
|
5164
5187
|
};
|
|
@@ -9717,12 +9740,12 @@ var PptxShapeIdValidator = class {
|
|
|
9717
9740
|
return { reassigned: 0, ids };
|
|
9718
9741
|
}
|
|
9719
9742
|
const usedIds = /* @__PURE__ */ new Set();
|
|
9720
|
-
const
|
|
9743
|
+
const invalid2 = [];
|
|
9721
9744
|
let maxId = 0;
|
|
9722
9745
|
for (const cNvPr of cNvPrNodes) {
|
|
9723
9746
|
const id = parseShapeId(cNvPr["@_id"], true);
|
|
9724
9747
|
if (id === void 0 || id === 0 || usedIds.has(id)) {
|
|
9725
|
-
|
|
9748
|
+
invalid2.push(cNvPr);
|
|
9726
9749
|
continue;
|
|
9727
9750
|
}
|
|
9728
9751
|
usedIds.add(id);
|
|
@@ -9731,7 +9754,7 @@ var PptxShapeIdValidator = class {
|
|
|
9731
9754
|
}
|
|
9732
9755
|
}
|
|
9733
9756
|
const allocator = new ShapeIdAllocator(usedIds, maxId);
|
|
9734
|
-
for (const cNvPr of
|
|
9757
|
+
for (const cNvPr of invalid2) {
|
|
9735
9758
|
const oldId = String(cNvPr["@_id"] ?? "").trim();
|
|
9736
9759
|
const fresh = String(allocator.next());
|
|
9737
9760
|
cNvPr["@_id"] = fresh;
|
|
@@ -9740,7 +9763,7 @@ var PptxShapeIdValidator = class {
|
|
|
9740
9763
|
}
|
|
9741
9764
|
}
|
|
9742
9765
|
remapShapeIdReferences(referenceRoot, ids);
|
|
9743
|
-
return { reassigned:
|
|
9766
|
+
return { reassigned: invalid2.length, ids };
|
|
9744
9767
|
}
|
|
9745
9768
|
};
|
|
9746
9769
|
|
|
@@ -34399,7 +34422,7 @@ function collectDesiredEffects(animations) {
|
|
|
34399
34422
|
const desired = [];
|
|
34400
34423
|
animations.forEach((anim, index) => {
|
|
34401
34424
|
const order = anim.order ?? index;
|
|
34402
|
-
const
|
|
34425
|
+
const add2 = (presetClass) => {
|
|
34403
34426
|
desired.push({
|
|
34404
34427
|
anim,
|
|
34405
34428
|
key: effectOwnershipKey(anim.elementId, presetClass),
|
|
@@ -34408,16 +34431,16 @@ function collectDesiredEffects(animations) {
|
|
|
34408
34431
|
});
|
|
34409
34432
|
};
|
|
34410
34433
|
if (anim.entrance && anim.entrance !== "none") {
|
|
34411
|
-
|
|
34434
|
+
add2("entr");
|
|
34412
34435
|
}
|
|
34413
34436
|
if (anim.emphasis && anim.emphasis !== "none") {
|
|
34414
|
-
|
|
34437
|
+
add2("emph");
|
|
34415
34438
|
}
|
|
34416
34439
|
if (anim.exit && anim.exit !== "none") {
|
|
34417
|
-
|
|
34440
|
+
add2("exit");
|
|
34418
34441
|
}
|
|
34419
34442
|
if (anim.motionPath) {
|
|
34420
|
-
|
|
34443
|
+
add2("path");
|
|
34421
34444
|
}
|
|
34422
34445
|
});
|
|
34423
34446
|
return desired;
|
|
@@ -38271,9 +38294,9 @@ function parseDimension(context, element2) {
|
|
|
38271
38294
|
var DATA = /* @__PURE__ */ new Set(["numDim", "strDim", "extLst"]);
|
|
38272
38295
|
function parseData(context, element2) {
|
|
38273
38296
|
reportUnmodelled2(context, element2, DATA);
|
|
38274
|
-
const
|
|
38297
|
+
const dimensions2 = elements(element2).filter((child17) => child17.localName === "numDim" || child17.localName === "strDim").map((child17) => parseDimension(context, child17));
|
|
38275
38298
|
return assignDefined(
|
|
38276
|
-
{ dimensions },
|
|
38299
|
+
{ dimensions: dimensions2 },
|
|
38277
38300
|
{ id: indexAttribute(context, element2, "id"), extLst: extensionList2(element2) }
|
|
38278
38301
|
);
|
|
38279
38302
|
}
|
|
@@ -38697,7 +38720,7 @@ function numberFormatXml2(format) {
|
|
|
38697
38720
|
|
|
38698
38721
|
// chart/ex/write-series.ts
|
|
38699
38722
|
function dataXml(context, data) {
|
|
38700
|
-
const
|
|
38723
|
+
const dimensions2 = data.dimensions.map((dimension2) => {
|
|
38701
38724
|
const levels = dimension2.levels.map(
|
|
38702
38725
|
(level) => cxElement(
|
|
38703
38726
|
"lvl",
|
|
@@ -38715,7 +38738,7 @@ function dataXml(context, data) {
|
|
|
38715
38738
|
attributes([["type", dimension2.type]])
|
|
38716
38739
|
);
|
|
38717
38740
|
}).join("");
|
|
38718
|
-
return cxElement("data",
|
|
38741
|
+
return cxElement("data", dimensions2 + raw(context, data.extLst), attributes([["id", data.id]]));
|
|
38719
38742
|
}
|
|
38720
38743
|
function chartDataXml(context, chartData) {
|
|
38721
38744
|
const external = chartData.externalData;
|
|
@@ -40022,6 +40045,236 @@ function createChartExSpace(data, layout, options2 = {}) {
|
|
|
40022
40045
|
return space;
|
|
40023
40046
|
}
|
|
40024
40047
|
|
|
40048
|
+
// digest/crc32.ts
|
|
40049
|
+
var crcTable = Uint32Array.from({ length: 256 }, (_, value) => {
|
|
40050
|
+
for (let i = 0; i < 8; i++) value = value & 1 ? 3988292384 ^ value >>> 1 : value >>> 1;
|
|
40051
|
+
return value >>> 0;
|
|
40052
|
+
});
|
|
40053
|
+
function crc32(bytes, crc = 4294967295) {
|
|
40054
|
+
for (const byte of bytes) crc = (crcTable[(crc ^ byte) & 255] ?? 0) ^ crc >>> 8;
|
|
40055
|
+
return crc >>> 0;
|
|
40056
|
+
}
|
|
40057
|
+
|
|
40058
|
+
// drawingml/raster-image.ts
|
|
40059
|
+
var RASTER_IMAGE_LIMITS = Object.freeze({
|
|
40060
|
+
maxImageBytes: 8 * 1024 * 1024,
|
|
40061
|
+
maxPixels: 16e6,
|
|
40062
|
+
maxDimension: 16384
|
|
40063
|
+
});
|
|
40064
|
+
var RasterImageError = class extends Error {
|
|
40065
|
+
constructor(code, message) {
|
|
40066
|
+
super(message);
|
|
40067
|
+
this.code = code;
|
|
40068
|
+
this.name = "RasterImageError";
|
|
40069
|
+
}
|
|
40070
|
+
code;
|
|
40071
|
+
};
|
|
40072
|
+
var invalid = (message) => {
|
|
40073
|
+
throw new RasterImageError("invalid-image", message);
|
|
40074
|
+
};
|
|
40075
|
+
var unsupported2 = (message) => {
|
|
40076
|
+
throw new RasterImageError("unsupported-image", message);
|
|
40077
|
+
};
|
|
40078
|
+
function dimensions(width, height, limits) {
|
|
40079
|
+
if (!width || !height) invalid("Raster image has zero dimensions.");
|
|
40080
|
+
if (width > limits.maxDimension || height > limits.maxDimension || width * height > limits.maxPixels)
|
|
40081
|
+
throw new RasterImageError(
|
|
40082
|
+
"image-limit",
|
|
40083
|
+
"Raster image dimensions exceed the configured limit."
|
|
40084
|
+
);
|
|
40085
|
+
}
|
|
40086
|
+
var ascii = (bytes, start, length) => String.fromCharCode(...bytes.subarray(start, start + length));
|
|
40087
|
+
function png(bytes, limits) {
|
|
40088
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40089
|
+
if (bytes.length < 33 || view.getUint32(8) !== 13 || ascii(bytes, 12, 4) !== "IHDR")
|
|
40090
|
+
return invalid("PNG is missing a complete IHDR header.");
|
|
40091
|
+
const width = view.getUint32(16), height = view.getUint32(20);
|
|
40092
|
+
dimensions(width, height, limits);
|
|
40093
|
+
const depth = bytes[24], color2 = bytes[25];
|
|
40094
|
+
const depths = {
|
|
40095
|
+
0: [1, 2, 4, 8, 16],
|
|
40096
|
+
2: [8, 16],
|
|
40097
|
+
3: [1, 2, 4, 8],
|
|
40098
|
+
4: [8, 16],
|
|
40099
|
+
6: [8, 16]
|
|
40100
|
+
};
|
|
40101
|
+
if (!depths[color2]?.includes(depth) || bytes[26] !== 0 || bytes[27] !== 0 || bytes[28] > 1)
|
|
40102
|
+
invalid("PNG header uses invalid color, compression, filter, or interlace values.");
|
|
40103
|
+
let data = false;
|
|
40104
|
+
for (let at = 8; at < bytes.length; ) {
|
|
40105
|
+
if (at + 12 > bytes.length) invalid("Truncated PNG chunk.");
|
|
40106
|
+
const length = view.getUint32(at), type = ascii(bytes, at + 4, 4), end = at + length + 12;
|
|
40107
|
+
if (end > bytes.length) invalid("Truncated PNG chunk payload.");
|
|
40108
|
+
if ((crc32(bytes.subarray(at + 4, end - 4)) ^ 4294967295) >>> 0 !== view.getUint32(end - 4))
|
|
40109
|
+
invalid("PNG chunk checksum mismatch.");
|
|
40110
|
+
if (type === "acTL") unsupported2("Animated PNG is not supported.");
|
|
40111
|
+
if (type === "IHDR" && at !== 8) invalid("PNG contains multiple image headers.");
|
|
40112
|
+
if (type === "IDAT" && length) data = true;
|
|
40113
|
+
if (type === "IEND") {
|
|
40114
|
+
if (length || end !== bytes.length || !data) invalid("PNG has an invalid image terminator.");
|
|
40115
|
+
return [width, height];
|
|
40116
|
+
}
|
|
40117
|
+
at = end;
|
|
40118
|
+
}
|
|
40119
|
+
return invalid("PNG has no image terminator.");
|
|
40120
|
+
}
|
|
40121
|
+
function gif(bytes, limits) {
|
|
40122
|
+
if (bytes.length < 13) return invalid("GIF is missing a complete screen descriptor.");
|
|
40123
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40124
|
+
const width = view.getUint16(6, true), height = view.getUint16(8, true);
|
|
40125
|
+
dimensions(width, height, limits);
|
|
40126
|
+
let at = 13 + (bytes[10] & 128 ? 3 * 2 ** ((bytes[10] & 7) + 1) : 0);
|
|
40127
|
+
let frames = 0, pixels = 0;
|
|
40128
|
+
const blocks = () => {
|
|
40129
|
+
for (; ; ) {
|
|
40130
|
+
if (at >= bytes.length) invalid("GIF has truncated data blocks.");
|
|
40131
|
+
const size = bytes[at++];
|
|
40132
|
+
if (!size) return;
|
|
40133
|
+
at += size;
|
|
40134
|
+
if (at > bytes.length) invalid("GIF has a truncated data block.");
|
|
40135
|
+
}
|
|
40136
|
+
};
|
|
40137
|
+
while (at < bytes.length) {
|
|
40138
|
+
const marker2 = bytes[at++];
|
|
40139
|
+
if (marker2 === 59) {
|
|
40140
|
+
if (!frames || at !== bytes.length) invalid("GIF has an invalid image terminator.");
|
|
40141
|
+
return [width, height];
|
|
40142
|
+
}
|
|
40143
|
+
if (marker2 === 33) {
|
|
40144
|
+
if (at >= bytes.length) invalid("GIF has a truncated extension.");
|
|
40145
|
+
at++;
|
|
40146
|
+
blocks();
|
|
40147
|
+
continue;
|
|
40148
|
+
}
|
|
40149
|
+
if (marker2 !== 44 || at + 9 > bytes.length) invalid("GIF has an invalid image descriptor.");
|
|
40150
|
+
const left = view.getUint16(at, true), top = view.getUint16(at + 2, true);
|
|
40151
|
+
const frameWidth = view.getUint16(at + 4, true), frameHeight = view.getUint16(at + 6, true);
|
|
40152
|
+
dimensions(frameWidth, frameHeight, limits);
|
|
40153
|
+
if (left + frameWidth > width || top + frameHeight > height)
|
|
40154
|
+
invalid("GIF frame exceeds its screen.");
|
|
40155
|
+
pixels += width * height;
|
|
40156
|
+
if (pixels > limits.maxPixels)
|
|
40157
|
+
throw new RasterImageError("image-limit", "GIF animation exceeds the pixel limit.");
|
|
40158
|
+
const packed = bytes[at + 8];
|
|
40159
|
+
at += 9 + (packed & 128 ? 3 * 2 ** ((packed & 7) + 1) : 0);
|
|
40160
|
+
if (at >= bytes.length || bytes[at] < 2 || bytes[at] > 8)
|
|
40161
|
+
invalid("GIF has an invalid LZW header.");
|
|
40162
|
+
at++;
|
|
40163
|
+
blocks();
|
|
40164
|
+
frames++;
|
|
40165
|
+
}
|
|
40166
|
+
return invalid("GIF has no image terminator.");
|
|
40167
|
+
}
|
|
40168
|
+
function jpeg(bytes, limits) {
|
|
40169
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40170
|
+
let at = 2, width = 0, height = 0, scan2 = false;
|
|
40171
|
+
while (at < bytes.length) {
|
|
40172
|
+
if (bytes[at++] !== 255) invalid("JPEG has an invalid segment marker.");
|
|
40173
|
+
while (bytes[at] === 255) at++;
|
|
40174
|
+
const marker2 = bytes[at++];
|
|
40175
|
+
if (marker2 === 217) {
|
|
40176
|
+
if (!width || !scan2 || at !== bytes.length) invalid("JPEG has an invalid image terminator.");
|
|
40177
|
+
return [width, height];
|
|
40178
|
+
}
|
|
40179
|
+
if (marker2 === void 0 || marker2 === 0 || marker2 === 216 || marker2 === 1 || marker2 >= 208 && marker2 <= 215)
|
|
40180
|
+
invalid("JPEG has an unexpected standalone marker.");
|
|
40181
|
+
if (at + 2 > bytes.length) invalid("JPEG has a truncated segment header.");
|
|
40182
|
+
const length = view.getUint16(at), end = at + length;
|
|
40183
|
+
if (length < 2 || end > bytes.length) invalid("JPEG has a truncated segment.");
|
|
40184
|
+
if (marker2 >= 192 && marker2 <= 207 && ![196, 200, 204].includes(marker2)) {
|
|
40185
|
+
if (![192, 193, 194].includes(marker2))
|
|
40186
|
+
unsupported2("This JPEG frame coding is unsupported.");
|
|
40187
|
+
if (width || length < 11 || bytes[at + 2] !== 8 || length !== 8 + 3 * bytes[at + 7])
|
|
40188
|
+
invalid("JPEG has an invalid frame header.");
|
|
40189
|
+
height = view.getUint16(at + 3);
|
|
40190
|
+
width = view.getUint16(at + 5);
|
|
40191
|
+
dimensions(width, height, limits);
|
|
40192
|
+
}
|
|
40193
|
+
if (marker2 === 220) unsupported2("JPEG deferred dimensions are unsupported.");
|
|
40194
|
+
at = end;
|
|
40195
|
+
if (marker2 === 218) {
|
|
40196
|
+
if (!width || length < 8 || length !== 6 + 2 * bytes[end - length + 2])
|
|
40197
|
+
invalid("JPEG has an invalid scan header.");
|
|
40198
|
+
scan2 = true;
|
|
40199
|
+
while (at < bytes.length) {
|
|
40200
|
+
if (bytes[at] !== 255) {
|
|
40201
|
+
at++;
|
|
40202
|
+
continue;
|
|
40203
|
+
}
|
|
40204
|
+
const next = bytes[at + 1];
|
|
40205
|
+
if (next === 0 || next !== void 0 && next >= 208 && next <= 215) {
|
|
40206
|
+
at += 2;
|
|
40207
|
+
continue;
|
|
40208
|
+
}
|
|
40209
|
+
break;
|
|
40210
|
+
}
|
|
40211
|
+
}
|
|
40212
|
+
}
|
|
40213
|
+
return invalid("JPEG has no image terminator.");
|
|
40214
|
+
}
|
|
40215
|
+
function inspectRasterImage(bytes, options2 = {}) {
|
|
40216
|
+
if (!options2 || typeof options2 !== "object" || Array.isArray(options2))
|
|
40217
|
+
throw new RasterImageError("invalid-limit", "Image limits must be an options object.");
|
|
40218
|
+
const limits = { ...RASTER_IMAGE_LIMITS, ...options2 };
|
|
40219
|
+
for (const key2 of Object.keys(RASTER_IMAGE_LIMITS)) {
|
|
40220
|
+
const value = limits[key2];
|
|
40221
|
+
if (!Number.isSafeInteger(value) || value <= 0 || value > RASTER_IMAGE_LIMITS[key2])
|
|
40222
|
+
throw new RasterImageError("invalid-limit", `Invalid raster image limit: ${key2}.`);
|
|
40223
|
+
}
|
|
40224
|
+
if (!(bytes instanceof Uint8Array)) invalid("Raster image bytes must be a Uint8Array.");
|
|
40225
|
+
if (bytes.byteLength > limits.maxImageBytes)
|
|
40226
|
+
throw new RasterImageError("image-limit", "Raster image bytes exceed the configured limit.");
|
|
40227
|
+
return inspectRasterImageStructure(bytes, limits);
|
|
40228
|
+
}
|
|
40229
|
+
function inspectRasterImageStructure(bytes, limits) {
|
|
40230
|
+
let mimeType, size;
|
|
40231
|
+
if ([137, 80, 78, 71, 13, 10, 26, 10].every((value, index) => bytes[index] === value)) {
|
|
40232
|
+
mimeType = "image/png";
|
|
40233
|
+
size = png(bytes, limits);
|
|
40234
|
+
} else if (["GIF87a", "GIF89a"].includes(ascii(bytes, 0, 6))) {
|
|
40235
|
+
mimeType = "image/gif";
|
|
40236
|
+
size = gif(bytes, limits);
|
|
40237
|
+
} else if (bytes[0] === 255 && bytes[1] === 216) {
|
|
40238
|
+
mimeType = "image/jpeg";
|
|
40239
|
+
size = jpeg(bytes, limits);
|
|
40240
|
+
} else return unsupported2("Foreign data is not a supported PNG, JPEG, or GIF raster image.");
|
|
40241
|
+
return { mimeType, pixelWidth: size[0], pixelHeight: size[1] };
|
|
40242
|
+
}
|
|
40243
|
+
|
|
40244
|
+
// chart/region-map/value-color-positions.ts
|
|
40245
|
+
function schemaPosition(node, end) {
|
|
40246
|
+
for (const kind of ["number", "percent"]) {
|
|
40247
|
+
const element2 = first(node, kind, NS.cx), raw2 = element2?.getAttribute("val");
|
|
40248
|
+
const value = raw2 === null || raw2 === void 0 || raw2 === "" ? NaN : Number(raw2);
|
|
40249
|
+
if (Number.isFinite(value)) return { kind, value };
|
|
40250
|
+
}
|
|
40251
|
+
return end === "mid" ? { kind: "percent", value: 50 } : { kind: end };
|
|
40252
|
+
}
|
|
40253
|
+
function parseRegionValueColorPositions(xml) {
|
|
40254
|
+
if (!xml) return void 0;
|
|
40255
|
+
const root = parseXml(`<cx:root xmlns:cx="${NS.cx}">${xml}</cx:root>`).documentElement;
|
|
40256
|
+
const positions2 = first(root, "valueColorPositions", NS.cx);
|
|
40257
|
+
if (!positions2) return void 0;
|
|
40258
|
+
const count2 = positions2.getAttribute("count");
|
|
40259
|
+
const native = ["min", "mid", "max"].some((key2) => first(positions2, key2, NS.cx));
|
|
40260
|
+
if (native || count2 !== null && children(positions2, "pos", NS.cx).length === 0) {
|
|
40261
|
+
const keys = count2 === "3" || first(positions2, "mid", NS.cx) ? ["min", "mid", "max"] : ["min", "max"];
|
|
40262
|
+
return keys.map((key2) => schemaPosition(first(positions2, key2, NS.cx), key2));
|
|
40263
|
+
}
|
|
40264
|
+
const legacy = children(positions2, "pos", NS.cx).flatMap(
|
|
40265
|
+
(element2) => {
|
|
40266
|
+
const type = element2.getAttribute("type");
|
|
40267
|
+
if (type === "min" || type === "max") return [{ kind: type }];
|
|
40268
|
+
if (type !== "num" && type !== "percent") return [];
|
|
40269
|
+
const raw2 = element2.getAttribute("val"), value = raw2 === null || raw2 === "" ? NaN : Number(raw2);
|
|
40270
|
+
return [
|
|
40271
|
+
{ kind: type === "num" ? "number" : type, ...Number.isFinite(value) ? { value } : {} }
|
|
40272
|
+
];
|
|
40273
|
+
}
|
|
40274
|
+
);
|
|
40275
|
+
return legacy.length ? legacy : void 0;
|
|
40276
|
+
}
|
|
40277
|
+
|
|
40025
40278
|
// chart/edit/paint.ts
|
|
40026
40279
|
var ALPHA = /* @__PURE__ */ new Set(["alpha", "alphaMod", "alphaOff"]);
|
|
40027
40280
|
var drawingColorAlphaTransforms = (color2) => structuredClone(color2?.transforms.filter((item) => ALPHA.has(item.name)) ?? []);
|
|
@@ -40763,10 +41016,10 @@ function holders(draft, target, create = false) {
|
|
|
40763
41016
|
throw new RangeError("This chart target has no text");
|
|
40764
41017
|
}
|
|
40765
41018
|
}
|
|
40766
|
-
function
|
|
41019
|
+
function descendants2(root, names) {
|
|
40767
41020
|
return elements(root).flatMap((node) => [
|
|
40768
41021
|
...node.namespaceURI === NS.a && names.includes(node.localName) ? [node] : [],
|
|
40769
|
-
...
|
|
41022
|
+
...descendants2(node, names)
|
|
40770
41023
|
]);
|
|
40771
41024
|
}
|
|
40772
41025
|
function chartTextBodyElement(body) {
|
|
@@ -40898,7 +41151,7 @@ function editChartTextBody(body, edit) {
|
|
|
40898
41151
|
String(typeof value === "number" ? Math.round(value * 6e4) : value)
|
|
40899
41152
|
);
|
|
40900
41153
|
}
|
|
40901
|
-
const runs =
|
|
41154
|
+
const runs = descendants2(root, ["defRPr", "rPr", "endParaRPr"]);
|
|
40902
41155
|
if (!runs.length) {
|
|
40903
41156
|
let paragraph2 = first(root, "p", NS.a);
|
|
40904
41157
|
if (!paragraph2) {
|
|
@@ -41108,22 +41361,22 @@ function patchRange(labels2, range, show) {
|
|
|
41108
41361
|
for (const child17 of elements(ext))
|
|
41109
41362
|
if (child17.namespaceURI === C15 && ["datalabelsRange", "showDataLabelsRange"].includes(child17.localName))
|
|
41110
41363
|
ext.removeChild(child17);
|
|
41111
|
-
const
|
|
41364
|
+
const add2 = (parent, ns, name, text) => {
|
|
41112
41365
|
const node = root.ownerDocument.createElementNS(ns, name);
|
|
41113
41366
|
if (text !== void 0) node.textContent = text;
|
|
41114
41367
|
parent.appendChild(node);
|
|
41115
41368
|
return node;
|
|
41116
41369
|
};
|
|
41117
41370
|
if (range) {
|
|
41118
|
-
|
|
41119
|
-
const node =
|
|
41120
|
-
|
|
41121
|
-
const cache2 =
|
|
41122
|
-
|
|
41371
|
+
add2(ext, C15, "c15:showDataLabelsRange").setAttribute("val", show ? "1" : "0");
|
|
41372
|
+
const node = add2(ext, C15, "c15:datalabelsRange");
|
|
41373
|
+
add2(node, C15, "c15:f", range.formula);
|
|
41374
|
+
const cache2 = add2(node, C15, "c15:dlblRangeCache");
|
|
41375
|
+
add2(cache2, NS.c, "c:ptCount").setAttribute("val", String(range.cache.length));
|
|
41123
41376
|
range.cache.forEach((text, index) => {
|
|
41124
|
-
const pt2 =
|
|
41377
|
+
const pt2 = add2(cache2, NS.c, "c:pt");
|
|
41125
41378
|
pt2.setAttribute("idx", String(index));
|
|
41126
|
-
|
|
41379
|
+
add2(pt2, NS.c, "c:v", text);
|
|
41127
41380
|
});
|
|
41128
41381
|
}
|
|
41129
41382
|
if (!elements(ext).length) root.removeChild(ext);
|
|
@@ -45784,6 +46037,7 @@ function dimension(data, kind, type) {
|
|
|
45784
46037
|
if (d.kind === kind) map.set(d.type?.trim() || (kind === "numDim" ? "val" : "cat"), d);
|
|
45785
46038
|
return map.get(type) ?? map.values().next().value;
|
|
45786
46039
|
}
|
|
46040
|
+
var exactDimension = (data, kind, type) => data?.dimensions.find((d) => d.kind === kind && d.type?.trim() === type);
|
|
45787
46041
|
var levelText = (dimension2) => dimension2?.levels.map((level) => level.points.map((point) => point.value.trim()));
|
|
45788
46042
|
function flags(visibility) {
|
|
45789
46043
|
return {
|
|
@@ -45805,6 +46059,32 @@ function chartExFromNeutral(space, styled) {
|
|
|
45805
46059
|
const values = levelText(dimension(dataOf2(index), "numDim", "val"))?.[0]?.map((value) => Number.parseFloat(value)).filter(Number.isFinite);
|
|
45806
46060
|
result.name = source.tx?.value?.trim() || `Series ${index + 1}`;
|
|
45807
46061
|
result.values = values?.length ? values : [0];
|
|
46062
|
+
if (source.layoutId === "regionMap") {
|
|
46063
|
+
const dim = exactDimension(dataOf2(index), "numDim", "colorVal")?.levels[0];
|
|
46064
|
+
if (dim) {
|
|
46065
|
+
result.values = dim.points.map((p) => Number.parseFloat(p.value));
|
|
46066
|
+
result.regionMapOptions = {
|
|
46067
|
+
...result.regionMapOptions,
|
|
46068
|
+
valueSourceIndices: dim.points.map((p, i) => p.index ?? i)
|
|
46069
|
+
};
|
|
46070
|
+
}
|
|
46071
|
+
for (const [type, key2] of [
|
|
46072
|
+
["cat", "categorySourceIndices"],
|
|
46073
|
+
["entityId", "entityIdSourceIndices"]
|
|
46074
|
+
]) {
|
|
46075
|
+
const points7 = exactDimension(dataOf2(index), "strDim", type)?.levels[0]?.points;
|
|
46076
|
+
if (points7)
|
|
46077
|
+
result.regionMapOptions = {
|
|
46078
|
+
...result.regionMapOptions,
|
|
46079
|
+
[key2]: points7.map((p, i) => p.index ?? i)
|
|
46080
|
+
};
|
|
46081
|
+
}
|
|
46082
|
+
const positions2 = parseRegionValueColorPositions(source.valueColorPositionsXml);
|
|
46083
|
+
if (positions2)
|
|
46084
|
+
result.regionMapOptions = { ...result.regionMapOptions, valueColorPositions: positions2 };
|
|
46085
|
+
if (source.spPr?.fill?.kind === "solid" && result.color)
|
|
46086
|
+
result.regionMapOptions = { ...result.regionMapOptions, fixedColor: result.color };
|
|
46087
|
+
}
|
|
45808
46088
|
for (const key2 of [
|
|
45809
46089
|
"histogramOptions",
|
|
45810
46090
|
"waterfallOptions",
|
|
@@ -45813,6 +46093,11 @@ function chartExFromNeutral(space, styled) {
|
|
|
45813
46093
|
])
|
|
45814
46094
|
delete result[key2];
|
|
45815
46095
|
Object.assign(result, chartExFamilyFields(source));
|
|
46096
|
+
if (source.layoutId === "regionMap" && source.layoutProperties?.geography?.geoCacheXml)
|
|
46097
|
+
result.regionMapOptions = {
|
|
46098
|
+
...result.regionMapOptions,
|
|
46099
|
+
geographyCacheXml: source.layoutProperties.geography.geoCacheXml
|
|
46100
|
+
};
|
|
45816
46101
|
const group = source.dataLabels;
|
|
45817
46102
|
if (!group) {
|
|
45818
46103
|
delete result.dataLabels;
|
|
@@ -45903,12 +46188,18 @@ function chartExFromNeutral(space, styled) {
|
|
|
45903
46188
|
});
|
|
45904
46189
|
const title = chartExText(space.title?.tx);
|
|
45905
46190
|
const chartData = { ...styled.chartData };
|
|
46191
|
+
if (space.plotArea.series[0]?.layoutId === "funnel") {
|
|
46192
|
+
const category = space.plotArea.axes.find((axis) => axis.scaling?.kind === "cat")?.scaling;
|
|
46193
|
+
if (category?.kind === "cat" && typeof category.gapWidth === "number")
|
|
46194
|
+
chartData.funnelGapWidth = category.gapWidth;
|
|
46195
|
+
else delete chartData.funnelGapWidth;
|
|
46196
|
+
}
|
|
45906
46197
|
if (axes.length) chartData.axes = axes;
|
|
45907
46198
|
else delete chartData.axes;
|
|
45908
46199
|
if (title) chartData.title = title;
|
|
45909
46200
|
else delete chartData.title;
|
|
45910
46201
|
return {
|
|
45911
|
-
categories: (levels?.[0] ?? []).filter(Boolean),
|
|
46202
|
+
categories: space.plotArea.series[0]?.layoutId === "regionMap" ? levels?.[0] ?? [] : (levels?.[0] ?? []).filter(Boolean),
|
|
45912
46203
|
categoryLevels: levels,
|
|
45913
46204
|
series,
|
|
45914
46205
|
hasDataLabels: space.plotArea.series.some((series2) => {
|
|
@@ -50150,7 +50441,7 @@ var NS2 = 'xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"
|
|
|
50150
50441
|
var MODEL3D_URI = "http://schemas.microsoft.com/office/drawing/2017/model3d";
|
|
50151
50442
|
var MODEL3D_REL = "http://schemas.microsoft.com/office/2017/06/relationships/model3d";
|
|
50152
50443
|
var IMAGE_REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
50153
|
-
function
|
|
50444
|
+
function escapeAttr(value) {
|
|
50154
50445
|
return value.replace(/&/gu, "&").replace(/"/gu, """).replace(/</gu, "<");
|
|
50155
50446
|
}
|
|
50156
50447
|
function modelBody(cx, cy, hasPoster) {
|
|
@@ -50181,7 +50472,7 @@ function buildModel3dMetroInput(element2, glbBytes) {
|
|
|
50181
50472
|
const cx = Math.max(1, Math.round(rect.w));
|
|
50182
50473
|
const cy = Math.max(1, Math.round(rect.h));
|
|
50183
50474
|
const id = element2.shapeId && /^\d+$/u.test(element2.shapeId) ? element2.shapeId : "2";
|
|
50184
|
-
const name =
|
|
50475
|
+
const name = escapeAttr(element2.name ?? "3D Model");
|
|
50185
50476
|
const rootXml = `<p:E2oFrame ${NS2}><p:nvGraphicFramePr><p:cNvPr id="${id}" name="${name}"/><p:cNvGraphicFramePr/><p:nvPr/></p:nvGraphicFramePr><p:xfrm><a:off x="${Math.round(rect.x)}" y="${Math.round(rect.y)}"/><a:ext cx="${cx}" cy="${cy}"/></p:xfrm><a:graphic><a:graphicData uri="${MODEL3D_URI}"><am3d:model3d r:embed="rId1">${modelBody(cx, cy, Boolean(posterExt))}</am3d:model3d></a:graphicData></a:graphic></p:E2oFrame>`;
|
|
50186
50477
|
const parts = /* @__PURE__ */ new Map([["drs/media/model3d1.glb", glb]]);
|
|
50187
50478
|
const contentTypes2 = /* @__PURE__ */ new Map([["drs/media/model3d1.glb", "model/gltf-binary"]]);
|
|
@@ -50218,12 +50509,12 @@ var DOWNREV = {
|
|
|
50218
50509
|
contentType: "application/vnd.ms-office.DrsDownRev+xml",
|
|
50219
50510
|
relType: "http://schemas.microsoft.com/office/2006/relationships/downRev"
|
|
50220
50511
|
};
|
|
50221
|
-
function
|
|
50512
|
+
function escapeAttr2(value) {
|
|
50222
50513
|
return value.replace(/&/gu, "&").replace(/"/gu, """).replace(/</gu, "<").replace(/>/gu, ">");
|
|
50223
50514
|
}
|
|
50224
50515
|
function buildRelsXml(rels) {
|
|
50225
50516
|
const body = rels.map(
|
|
50226
|
-
(r) => `<Relationship Id="${
|
|
50517
|
+
(r) => `<Relationship Id="${escapeAttr2(r.id)}" Type="${escapeAttr2(r.type)}" Target="${escapeAttr2(
|
|
50227
50518
|
r.target
|
|
50228
50519
|
)}"${r.external ? ' TargetMode="External"' : ""}/>`
|
|
50229
50520
|
).join("");
|
|
@@ -50235,7 +50526,7 @@ function buildDownRevXml(shapeId) {
|
|
|
50235
50526
|
}
|
|
50236
50527
|
function buildContentTypesXml(overrides) {
|
|
50237
50528
|
const body = [...overrides].map(
|
|
50238
|
-
([path3, type]) => `<Override PartName="/${
|
|
50529
|
+
([path3, type]) => `<Override PartName="/${escapeAttr2(path3)}" ContentType="${escapeAttr2(type)}"/>`
|
|
50239
50530
|
).join("");
|
|
50240
50531
|
return `${XML_DECL}<Types xmlns="${CT_NS}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/>${body}</Types>`;
|
|
50241
50532
|
}
|
|
@@ -53075,8 +53366,8 @@ function readTxStyles(masterXml) {
|
|
|
53075
53366
|
const declarations = [...root.matchAll(/\s(xmlns(?::\w+)?)="[^"]*"/gu)].filter((m) => !startTag.includes(` ${m[1]}=`)).map((m) => m[0]);
|
|
53076
53367
|
return txStyles.replace(/^<p:txStyles\b/u, `<p:txStyles${declarations.join("")}`);
|
|
53077
53368
|
}
|
|
53078
|
-
function themeColor(themeXml3,
|
|
53079
|
-
const body = new RegExp(`<a:${
|
|
53369
|
+
function themeColor(themeXml3, slot2) {
|
|
53370
|
+
const body = new RegExp(`<a:${slot2}>([\\s\\S]*?)</a:${slot2}>`, "u").exec(themeXml3)?.[1];
|
|
53080
53371
|
if (!body) {
|
|
53081
53372
|
return void 0;
|
|
53082
53373
|
}
|
|
@@ -53094,7 +53385,7 @@ function schemeColorsFor(themeXml3, clrMapAttributes) {
|
|
|
53094
53385
|
"hlink",
|
|
53095
53386
|
"folHlink"
|
|
53096
53387
|
];
|
|
53097
|
-
const colors = slots.map((
|
|
53388
|
+
const colors = slots.map((slot2) => themeColor(themeXml3, slot2)?.toUpperCase());
|
|
53098
53389
|
return colors.every((c) => c !== void 0) ? colors : void 0;
|
|
53099
53390
|
}
|
|
53100
53391
|
function latinFace(themeXml3, scheme) {
|
|
@@ -53265,18 +53556,18 @@ async function rasterizeSvgInDom(svg, fallbackW, fallbackH) {
|
|
|
53265
53556
|
}
|
|
53266
53557
|
}
|
|
53267
53558
|
async function rasterizeSvg(svg, fallbackWidthPx, fallbackHeightPx, rasterize) {
|
|
53268
|
-
let
|
|
53559
|
+
let png2;
|
|
53269
53560
|
if (rasterize) {
|
|
53270
53561
|
const sizeFor = (w, h) => svgRasterSize(w, h, fallbackWidthPx, fallbackHeightPx);
|
|
53271
53562
|
try {
|
|
53272
|
-
|
|
53563
|
+
png2 = await rasterize(svg, sizeFor);
|
|
53273
53564
|
} catch {
|
|
53274
|
-
|
|
53565
|
+
png2 = void 0;
|
|
53275
53566
|
}
|
|
53276
53567
|
} else if (hasDomRasteriser()) {
|
|
53277
|
-
|
|
53568
|
+
png2 = await rasterizeSvgInDom(svg, fallbackWidthPx, fallbackHeightPx);
|
|
53278
53569
|
}
|
|
53279
|
-
return
|
|
53570
|
+
return png2 ? { extension: "png", bytes: png2 } : void 0;
|
|
53280
53571
|
}
|
|
53281
53572
|
|
|
53282
53573
|
// pptx/core/ppt/writer/picture-resolve.ts
|
|
@@ -60944,31 +61235,6 @@ function blipExtensionEntries(blip) {
|
|
|
60944
61235
|
}
|
|
60945
61236
|
|
|
60946
61237
|
// pptx/core/core/runtime/image-a14-effects.ts
|
|
60947
|
-
var ARTISTIC_PRIMARY_ATTRIBUTE = {
|
|
60948
|
-
artisticBlur: "radius",
|
|
60949
|
-
artisticCement: "crackSpacing",
|
|
60950
|
-
artisticChalkSketch: "pressure",
|
|
60951
|
-
artisticCrisscrossEtching: "pressure",
|
|
60952
|
-
artisticCutout: "numberOfShades",
|
|
60953
|
-
artisticFilmGrain: "grainSize",
|
|
60954
|
-
artisticGlass: "scaling",
|
|
60955
|
-
artisticGlowDiffused: "intensity",
|
|
60956
|
-
artisticGlowEdges: "smoothness",
|
|
60957
|
-
artisticLightScreen: "gridSize",
|
|
60958
|
-
artisticLineDrawing: "pencilSize",
|
|
60959
|
-
artisticMarker: "size",
|
|
60960
|
-
// Spelled "Mosiaic" in the schema; Microsoft's typo is part of the format.
|
|
60961
|
-
artisticMosiaicBubbles: "pressure",
|
|
60962
|
-
artisticPaintBrush: "brushSize",
|
|
60963
|
-
artisticPaintStrokes: "intensity",
|
|
60964
|
-
artisticPastelsSmooth: "scaling",
|
|
60965
|
-
artisticPencilGrayscale: "pencilSize",
|
|
60966
|
-
artisticPencilSketch: "pressure",
|
|
60967
|
-
artisticPhotocopy: "detail",
|
|
60968
|
-
artisticPlasticWrap: "smoothness",
|
|
60969
|
-
artisticTexturizer: "scaling",
|
|
60970
|
-
artisticWatercolorSponge: "brushSize"
|
|
60971
|
-
};
|
|
60972
61238
|
var NON_SIZE_ATTRIBUTES = /* @__PURE__ */ new Set(["trans", "visible"]);
|
|
60973
61239
|
function parseMarks(parent, name) {
|
|
60974
61240
|
const marks = [];
|
|
@@ -68602,7 +68868,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
68602
68868
|
*/
|
|
68603
68869
|
findMasterSlotForLayoutSlot(masterSlots, layoutPhInfo) {
|
|
68604
68870
|
if (layoutPhInfo.idx !== void 0) {
|
|
68605
|
-
const byIdx = masterSlots.find((
|
|
68871
|
+
const byIdx = masterSlots.find((slot2) => slot2.phInfo.idx === layoutPhInfo.idx);
|
|
68606
68872
|
if (byIdx) {
|
|
68607
68873
|
return byIdx;
|
|
68608
68874
|
}
|
|
@@ -68612,7 +68878,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
68612
68878
|
}
|
|
68613
68879
|
const aliasedType = layoutPhInfo.type === "ctrtitle" ? "title" : layoutPhInfo.type === "subtitle" ? "body" : layoutPhInfo.type;
|
|
68614
68880
|
return masterSlots.find(
|
|
68615
|
-
(
|
|
68881
|
+
(slot2) => slot2.phInfo.type === layoutPhInfo.type || slot2.phInfo.type === aliasedType
|
|
68616
68882
|
);
|
|
68617
68883
|
}
|
|
68618
68884
|
/**
|
|
@@ -68628,7 +68894,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
68628
68894
|
if (slots.length === 0 || !layoutPath) {
|
|
68629
68895
|
return slots;
|
|
68630
68896
|
}
|
|
68631
|
-
const needsMasterGeometry = slots.some((
|
|
68897
|
+
const needsMasterGeometry = slots.some((slot2) => slot2.cxEmu <= 0 || slot2.cyEmu <= 0);
|
|
68632
68898
|
if (!needsMasterGeometry) {
|
|
68633
68899
|
return slots;
|
|
68634
68900
|
}
|
|
@@ -68639,16 +68905,16 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
68639
68905
|
if (masterSlots.length === 0) {
|
|
68640
68906
|
return slots;
|
|
68641
68907
|
}
|
|
68642
|
-
return slots.map((
|
|
68643
|
-
if (
|
|
68644
|
-
return
|
|
68908
|
+
return slots.map((slot2) => {
|
|
68909
|
+
if (slot2.cxEmu > 0 && slot2.cyEmu > 0) {
|
|
68910
|
+
return slot2;
|
|
68645
68911
|
}
|
|
68646
|
-
const masterSlot = this.findMasterSlotForLayoutSlot(masterSlots,
|
|
68912
|
+
const masterSlot = this.findMasterSlotForLayoutSlot(masterSlots, slot2.phInfo);
|
|
68647
68913
|
if (!masterSlot || masterSlot.cxEmu <= 0 || masterSlot.cyEmu <= 0) {
|
|
68648
|
-
return
|
|
68914
|
+
return slot2;
|
|
68649
68915
|
}
|
|
68650
68916
|
return {
|
|
68651
|
-
...
|
|
68917
|
+
...slot2,
|
|
68652
68918
|
xEmu: masterSlot.xEmu,
|
|
68653
68919
|
yEmu: masterSlot.yEmu,
|
|
68654
68920
|
cxEmu: masterSlot.cxEmu,
|
|
@@ -68672,8 +68938,8 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
68672
68938
|
* @returns The updated elements array.
|
|
68673
68939
|
*/
|
|
68674
68940
|
remapElementsToNewLayout(elements2, newLayoutXml, newLayoutPath) {
|
|
68675
|
-
const targets = this.extractLayoutPlaceholders(newLayoutXml, newLayoutPath).map((
|
|
68676
|
-
...
|
|
68941
|
+
const targets = this.extractLayoutPlaceholders(newLayoutXml, newLayoutPath).map((slot2) => ({
|
|
68942
|
+
...slot2,
|
|
68677
68943
|
matched: false
|
|
68678
68944
|
}));
|
|
68679
68945
|
const claimOrder = [
|
|
@@ -72724,7 +72990,17 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
72724
72990
|
smartArtData.chrome,
|
|
72725
72991
|
(k) => this.compatibilityService.getXmlLocalName(k)
|
|
72726
72992
|
);
|
|
72727
|
-
this.zip.file(
|
|
72993
|
+
this.zip.file(
|
|
72994
|
+
dataPartPath,
|
|
72995
|
+
withDiagramPictureSources(this.builder.build(parsed), smartArtData.pictureLayoutSource)
|
|
72996
|
+
);
|
|
72997
|
+
const pictureDataRelsPath = dataPartPath.replace(/([^/]+)$/, "_rels/$1.rels");
|
|
72998
|
+
const pictureDataRels = diagramPictureRelationships(
|
|
72999
|
+
dataPartPath,
|
|
73000
|
+
smartArtData.pictureLayoutSource,
|
|
73001
|
+
await this.zip.file(pictureDataRelsPath)?.async("string")
|
|
73002
|
+
);
|
|
73003
|
+
if (pictureDataRels) this.zip.file(pictureDataRelsPath, pictureDataRels);
|
|
72728
73004
|
if (saveLayout && smartArtData.layoutRelId) {
|
|
72729
73005
|
const layoutTarget = relationships2?.get(smartArtData.layoutRelId);
|
|
72730
73006
|
if (layoutTarget) {
|
|
@@ -72745,7 +73021,31 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
72745
73021
|
presentationIds
|
|
72746
73022
|
);
|
|
72747
73023
|
if (drawingTarget && drawingXml) {
|
|
72748
|
-
this.
|
|
73024
|
+
const drawingPath = this.resolveImagePath(slidePath, drawingTarget);
|
|
73025
|
+
const pictureSource = smartArtData.pictureLayoutSource;
|
|
73026
|
+
const savedData = await this.zip.file(dataPartPath)?.async("string");
|
|
73027
|
+
const pictureCache = pictureSource && savedData ? buildGeneratedDiagramCache(savedData, {
|
|
73028
|
+
extentEmu: { width: element2.width * 9525, height: element2.height * 9525 },
|
|
73029
|
+
source: {
|
|
73030
|
+
...pictureSource,
|
|
73031
|
+
...saveLayout ? { layoutXml: saveLayout.xml } : {}
|
|
73032
|
+
},
|
|
73033
|
+
minorFont: smartArtData.themeMinorFont,
|
|
73034
|
+
scheme: smartArtData.pictureScheme
|
|
73035
|
+
}) : void 0;
|
|
73036
|
+
if (pictureCache)
|
|
73037
|
+
this.zip.file(
|
|
73038
|
+
dataPartPath,
|
|
73039
|
+
withDiagramDrawingRelationship(pictureCache.dataXml, smartArtData.drawingRelId)
|
|
73040
|
+
);
|
|
73041
|
+
this.zip.file(drawingPath, pictureCache?.drawingXml ?? drawingXml);
|
|
73042
|
+
const relsPath2 = drawingPath.replace(/([^/]+)$/, "_rels/$1.rels");
|
|
73043
|
+
const rels = diagramPictureRelationships(
|
|
73044
|
+
drawingPath,
|
|
73045
|
+
pictureSource,
|
|
73046
|
+
await this.zip.file(relsPath2)?.async("string")
|
|
73047
|
+
);
|
|
73048
|
+
if (rels) this.zip.file(relsPath2, rels);
|
|
72749
73049
|
}
|
|
72750
73050
|
}
|
|
72751
73051
|
} catch (e) {
|
|
@@ -77271,7 +77571,7 @@ function pruneEmptyEnvelopes(slideNode, getLocalName2) {
|
|
|
77271
77571
|
function reconcileSlideTransition(options2) {
|
|
77272
77572
|
const { slideNode, transitionNode, sourceNode, getLocalName: getLocalName2 } = options2;
|
|
77273
77573
|
const slots = collectEnvelopeSlots(slideNode, getLocalName2);
|
|
77274
|
-
const target = sourceNode ? slots.find((
|
|
77574
|
+
const target = sourceNode ? slots.find((slot2) => slot2.node === sourceNode) : void 0;
|
|
77275
77575
|
const usage = transitionNode ? extensionUsageOf(transitionNode) : void 0;
|
|
77276
77576
|
const requiresPrefix = usage ? requiresPrefixFor(usage) : void 0;
|
|
77277
77577
|
const reuseTarget = target && (requiresPrefix === void 0 || target.branchLocalName === "Choice") ? target : void 0;
|
|
@@ -77279,9 +77579,9 @@ function reconcileSlideTransition(options2) {
|
|
|
77279
77579
|
delete slideNode[key2];
|
|
77280
77580
|
}
|
|
77281
77581
|
const keptEnvelope = transitionNode ? reuseTarget?.envelope : void 0;
|
|
77282
|
-
for (const
|
|
77283
|
-
if (
|
|
77284
|
-
delete
|
|
77582
|
+
for (const slot2 of slots) {
|
|
77583
|
+
if (slot2.envelope !== keptEnvelope) {
|
|
77584
|
+
delete slot2.branch[slot2.key];
|
|
77285
77585
|
}
|
|
77286
77586
|
}
|
|
77287
77587
|
if (reuseTarget && transitionNode) {
|
|
@@ -78067,25 +78367,25 @@ var PptxHandlerRuntime43 = class extends PptxHandlerRuntime42 {
|
|
|
78067
78367
|
* fix to preserve original color XML and is out of scope here).
|
|
78068
78368
|
*/
|
|
78069
78369
|
buildClrSchemeObject(schemeName, colorMap) {
|
|
78070
|
-
const
|
|
78370
|
+
const slot2 = (key2) => {
|
|
78071
78371
|
const hex3 = String(colorMap[key2] || "").replace(/^#/, "");
|
|
78072
78372
|
const srgb = hex3.length === 6 ? hex3.toUpperCase() : "000000";
|
|
78073
78373
|
return { "a:srgbClr": { "@_val": srgb } };
|
|
78074
78374
|
};
|
|
78075
78375
|
return {
|
|
78076
78376
|
"@_name": schemeName,
|
|
78077
|
-
"a:dk1":
|
|
78078
|
-
"a:lt1":
|
|
78079
|
-
"a:dk2":
|
|
78080
|
-
"a:lt2":
|
|
78081
|
-
"a:accent1":
|
|
78082
|
-
"a:accent2":
|
|
78083
|
-
"a:accent3":
|
|
78084
|
-
"a:accent4":
|
|
78085
|
-
"a:accent5":
|
|
78086
|
-
"a:accent6":
|
|
78087
|
-
"a:hlink":
|
|
78088
|
-
"a:folHlink":
|
|
78377
|
+
"a:dk1": slot2("dk1"),
|
|
78378
|
+
"a:lt1": slot2("lt1"),
|
|
78379
|
+
"a:dk2": slot2("dk2"),
|
|
78380
|
+
"a:lt2": slot2("lt2"),
|
|
78381
|
+
"a:accent1": slot2("accent1"),
|
|
78382
|
+
"a:accent2": slot2("accent2"),
|
|
78383
|
+
"a:accent3": slot2("accent3"),
|
|
78384
|
+
"a:accent4": slot2("accent4"),
|
|
78385
|
+
"a:accent5": slot2("accent5"),
|
|
78386
|
+
"a:accent6": slot2("accent6"),
|
|
78387
|
+
"a:hlink": slot2("hlink"),
|
|
78388
|
+
"a:folHlink": slot2("folHlink")
|
|
78089
78389
|
};
|
|
78090
78390
|
}
|
|
78091
78391
|
/**
|
|
@@ -89133,6 +89433,14 @@ async function parseDrawingShapesFromPart(drawingPath, deps) {
|
|
|
89133
89433
|
shapes.push(shape2);
|
|
89134
89434
|
});
|
|
89135
89435
|
await resolveDrawingBlipFills(shapes, drawingPath, deps);
|
|
89436
|
+
try {
|
|
89437
|
+
const source = parseDiagramDrawing(xmlString);
|
|
89438
|
+
for (const shape2 of shapes) {
|
|
89439
|
+
const fill3 = source.shapes.find((entry2) => entry2.modelId === shape2.id)?.fill;
|
|
89440
|
+
if (fill3?.kind === "picture") shape2.pictureFill = fill3;
|
|
89441
|
+
}
|
|
89442
|
+
} catch {
|
|
89443
|
+
}
|
|
89136
89444
|
return shapes;
|
|
89137
89445
|
} catch {
|
|
89138
89446
|
return [];
|
|
@@ -89270,7 +89578,44 @@ var PptxHandlerRuntime91 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
|
|
|
89270
89578
|
const drawingRelationshipId = drawingResolution?.relId;
|
|
89271
89579
|
const styleRelationshipId = parsedRelationshipIds?.styleRelId ?? "";
|
|
89272
89580
|
const quickStyle = await this.parseSmartArtQuickStyle(slidePath, styleRelationshipId);
|
|
89581
|
+
const neutral = await loadDiagram(slidePath, parsedRelationshipIds ?? {}, {
|
|
89582
|
+
hostRelationships: (path3) => this.slideRelsMap.get(path3),
|
|
89583
|
+
resolvePath: (base, target) => this.resolveImagePath(base, target),
|
|
89584
|
+
readText: (path3) => this.zip.file(path3)?.async("string") ?? Promise.resolve(void 0),
|
|
89585
|
+
readRelationshipEntries: async (path3) => {
|
|
89586
|
+
const xml = await this.zip.file(path3)?.async("string");
|
|
89587
|
+
return xml ? [...parseRelationships(xml).values()] : void 0;
|
|
89588
|
+
}
|
|
89589
|
+
});
|
|
89590
|
+
const pictureLayoutSource = neutral.layoutSource?.pictures?.length ? neutral.layoutSource : void 0;
|
|
89591
|
+
const pictureUrls = {};
|
|
89592
|
+
const pictureSizes = {};
|
|
89593
|
+
for (const part of Object.values(pictureLayoutSource?.pictureParts ?? {})) {
|
|
89594
|
+
const url = await this.getImageDataAsDataUrl(part);
|
|
89595
|
+
if (url) pictureUrls[part] = url;
|
|
89596
|
+
const payload = url ? /^data:[^,]*;base64,(.*)$/s.exec(url)?.[1] : void 0;
|
|
89597
|
+
const bytes = payload ? decodeBase64(payload) : void 0;
|
|
89598
|
+
if (bytes) {
|
|
89599
|
+
try {
|
|
89600
|
+
const info = inspectRasterImage(bytes);
|
|
89601
|
+
pictureSizes[part] = { width: info.pixelWidth, height: info.pixelHeight };
|
|
89602
|
+
} catch {
|
|
89603
|
+
}
|
|
89604
|
+
}
|
|
89605
|
+
}
|
|
89606
|
+
for (const shape2 of drawingShapes) {
|
|
89607
|
+
const part = shape2.fillBlipEmbedId ? neutral.drawing?.pictureParts?.[shape2.fillBlipEmbedId] : void 0;
|
|
89608
|
+
if (part && pictureUrls[part]) shape2.fillImageUrl = pictureUrls[part];
|
|
89609
|
+
if (part && pictureSizes[part]) {
|
|
89610
|
+
shape2.fillImageWidth = pictureSizes[part].width;
|
|
89611
|
+
shape2.fillImageHeight = pictureSizes[part].height;
|
|
89612
|
+
}
|
|
89613
|
+
}
|
|
89273
89614
|
return {
|
|
89615
|
+
pictureLayoutSource,
|
|
89616
|
+
pictureUrls: pictureLayoutSource ? pictureUrls : void 0,
|
|
89617
|
+
pictureScheme: pictureLayoutSource ? { ...this.themeColorMap } : void 0,
|
|
89618
|
+
pictureSizes: pictureLayoutSource ? pictureSizes : void 0,
|
|
89274
89619
|
layoutType,
|
|
89275
89620
|
resolvedLayoutType,
|
|
89276
89621
|
layoutDefinition,
|
|
@@ -92305,7 +92650,7 @@ var PptxHandlerRuntime104 = class extends PptxHandlerRuntime103 {
|
|
|
92305
92650
|
}
|
|
92306
92651
|
root["p:cSld"] = withLeadingBackground(root["p:cSld"] ?? {}, bg);
|
|
92307
92652
|
root["p:clrMap"] = Object.fromEntries(
|
|
92308
|
-
Object.entries(clrMap).map(([alias,
|
|
92653
|
+
Object.entries(clrMap).map(([alias, slot2]) => [`@_${alias}`, slot2])
|
|
92309
92654
|
);
|
|
92310
92655
|
this.masterClrMaps.set(masterPath, { ...clrMap });
|
|
92311
92656
|
this.masterStyleOverrides.set(masterPath, { bg, clrMap: { ...clrMap } });
|
|
@@ -92339,12 +92684,12 @@ function selectTextPlaceholder(input, type, options2, slots) {
|
|
|
92339
92684
|
};
|
|
92340
92685
|
let best;
|
|
92341
92686
|
let bestScore = 0;
|
|
92342
|
-
for (const
|
|
92343
|
-
if (!TEXT_PLACEHOLDER_TYPES.has(
|
|
92344
|
-
if (source.idx !== void 0 && source.idx !== (
|
|
92345
|
-
const score = scorePlaceholderMatch(input, source,
|
|
92687
|
+
for (const slot2 of slots) {
|
|
92688
|
+
if (!TEXT_PLACEHOLDER_TYPES.has(slot2.phInfo.type ?? "obj")) continue;
|
|
92689
|
+
if (source.idx !== void 0 && source.idx !== (slot2.phInfo.idx ?? "0")) continue;
|
|
92690
|
+
const score = scorePlaceholderMatch(input, source, slot2.phInfo);
|
|
92346
92691
|
if (score > bestScore) {
|
|
92347
|
-
best =
|
|
92692
|
+
best = slot2;
|
|
92348
92693
|
bestScore = score;
|
|
92349
92694
|
}
|
|
92350
92695
|
}
|
|
@@ -94016,7 +94361,7 @@ var OPT2 = {
|
|
|
94016
94361
|
fNoLineDrawDash: 511,
|
|
94017
94362
|
wzName: 896
|
|
94018
94363
|
};
|
|
94019
|
-
function
|
|
94364
|
+
function parseProperties(view, data, rec) {
|
|
94020
94365
|
const values = /* @__PURE__ */ new Map();
|
|
94021
94366
|
const complex = /* @__PURE__ */ new Map();
|
|
94022
94367
|
const count2 = rec.recInstance;
|
|
@@ -94223,7 +94568,7 @@ function parseShape(ctx, container) {
|
|
|
94223
94568
|
return void 0;
|
|
94224
94569
|
}
|
|
94225
94570
|
const optRec = findChild2(ctx.view, container, OA.FOPT);
|
|
94226
|
-
const props = optRec ?
|
|
94571
|
+
const props = optRec ? parseProperties(ctx.view, ctx.data, optRec) : { values: /* @__PURE__ */ new Map(), complex: /* @__PURE__ */ new Map() };
|
|
94227
94572
|
const anchorRec = findChild2(ctx.view, container, OA.ClientAnchor);
|
|
94228
94573
|
const childAnchorRec = findChild2(ctx.view, container, OA.ChildAnchor);
|
|
94229
94574
|
const anchor = anchorRec ? readClientAnchor(ctx.view, anchorRec) : childAnchorRec ? readChildAnchor(ctx.view, childAnchorRec) : void 0;
|
|
@@ -94386,7 +94731,7 @@ function extractBackground(ctx, container) {
|
|
|
94386
94731
|
if (!optRec) {
|
|
94387
94732
|
return ctx.scheme[0];
|
|
94388
94733
|
}
|
|
94389
|
-
const props =
|
|
94734
|
+
const props = parseProperties(ctx.view, ctx.data, optRec);
|
|
94390
94735
|
const fillColor = props.values.get(OPT2.fillColor);
|
|
94391
94736
|
return fillColor !== void 0 ? resolveEscherColor(fillColor, ctx.scheme) : ctx.scheme[0];
|
|
94392
94737
|
}
|
|
@@ -98403,4 +98748,4 @@ var PresentationBuilder = class {
|
|
|
98403
98748
|
* `<p:extLst>` (optional)
|
|
98404
98749
|
*/
|
|
98405
98750
|
|
|
98406
|
-
export { AFTER_ANIMATION_VALUES, ConnectorXmlFactory, DEFAULT_AFTER_ANIMATION_DIM_COLOR, DEFAULT_ANIMATION_DURATION_MS, DEFAULT_ANIMATION_TRIGGER, DEFAULT_POWERPOINT_TABLE_STYLE_ID, DEFAULT_PPTX_LOAD_LIMITS, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime107 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxLoadLimitError, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, PresentationBuilder, STANDARD_LAYOUTS, SlideBuilder, TABLE_STYLE_PART_SEQUENCE, TextShapeXmlFactory, addChartCategory, addChartSeries2 as addChartSeries, addLayoutContentType, addLayoutToSlideMaster, addTableStyleToMap, animationFor, applyAfterAnimationBehavior, applyAfterAnimationFromEditorList, applyChartGroupOptionsInput, applyConnectorShapeIds, applyGradient, applySoundToEffectCTn, applySpeedToDuration, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive,
|
|
98751
|
+
export { AFTER_ANIMATION_VALUES, ConnectorXmlFactory, DEFAULT_AFTER_ANIMATION_DIM_COLOR, DEFAULT_ANIMATION_DURATION_MS, DEFAULT_ANIMATION_TRIGGER, DEFAULT_POWERPOINT_TABLE_STYLE_ID, DEFAULT_PPTX_LOAD_LIMITS, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime107 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxLoadLimitError, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, PresentationBuilder, STANDARD_LAYOUTS, SlideBuilder, TABLE_STYLE_PART_SEQUENCE, TextShapeXmlFactory, addChartCategory, addChartSeries2 as addChartSeries, addLayoutContentType, addLayoutToSlideMaster, addTableStyleToMap, animationFor, applyAfterAnimationBehavior, applyAfterAnimationFromEditorList, applyChartGroupOptionsInput, applyConnectorShapeIds, applyGradient, applySoundToEffectCTn, applySpeedToDuration, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive, buildSingleEffectNode, buildSlideReferenceRemap, capturedPresetIds, capturedPresetNativeAnimation, capturedSubtypes, chartFormatTargetKey, chartFormatTargetSupports, clonePartGraph, convertPptToPptx, countExistingLayouts, createAutoNumberSequence, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createFreeformElement, createGroupElement, createImageElement, createLayout, createLayouts, createMediaElement, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTableStyleEntry, createTextElement, deleteTableStyleFromMap, ensureChartData, ensureDataPoint, extractAfterAnimationFromSubTnLst, extractGraphicBuilds, extractTableCellTextRuns, findLayoutByName, findLayoutByType, generateLayoutXml, generateTableStyleGuid, getAfterAnimation, getAfterAnimationState, getCapturedPreset, getCapturedTree, getPptxLoadLimitViolation, hasAnimation, hasGradientField, isEncryptedLegacyPpt, isLegacyPpt, isNativeAfterAnimationOnly, layoutRelsXml, mergeNativeAfterAnimationIntoEditorAnimations, mergeNativeSoundIntoEditorAnimations, mirrorFlatFields, mirrorTextColor, nextAutoNumber, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseChartFormatTargetKey, parseCondition, parseConditionList, parseFilterToken, parseTimeTargetElement, readChartElementFormat, rebuildTableStructureInRawXml, reconcileAnimationTargets, relativePartTarget, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries2 as removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveEffectTiming, resolveIterationCount, resolveOoxmlPresetMapping, resolveOpacitySet, resolveTableBackgroundFillRef, resolveTableStyleLineRef, resolveTableStyleLineRefColor, resolveVisibilitySetTiming, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setAfterAnimation, setAfterAnimationColor, setChartAreaFormat, setChartAxis2 as setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories2 as setChartCategories, setChartDataLabels2 as setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions2 as setChartGroupOptions, setChartGrouping2 as setChartGrouping, setChartLegend2 as setChartLegend, setChartSeriesChartType, setChartSeriesColor2 as setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle2 as setChartTitle, setChartType2 as setChartType, shouldHoldEndState, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, upsert, validateSeriesIndex, withSeries };
|