ooxml-core 1.8.4 → 1.10.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-5UURGJEV.mjs +2 -0
- package/dist/{PptxHandler-BL4B7CZO.mjs → PptxHandler-ADEFY476.mjs} +2 -2
- package/dist/PptxHandler-U5XB2HUE.cjs +11 -0
- package/dist/automation/index.cjs +7239 -4037
- package/dist/automation/index.mjs +7239 -4037
- package/dist/chunk-3N6XMMTT.cjs +87913 -0
- package/dist/{chunk-TTPZITQN.mjs → chunk-5NVJN4E6.mjs} +30 -2
- package/dist/{chunk-ZAP5WLEN.mjs → chunk-A6P7G3UK.mjs} +1 -1
- package/dist/{chunk-CPKNMQLX.cjs → chunk-AWIDASUW.cjs} +25 -2
- package/dist/{chunk-SVQZXP3F.mjs → chunk-CBNKBVX5.mjs} +25 -2
- package/dist/{chunk-GAGSCAR3.mjs → chunk-CCHYFCPD.mjs} +1199 -348
- package/dist/chunk-R6KSBNKX.mjs +44133 -0
- package/dist/chunk-S6DOCMQC.cjs +44451 -0
- package/dist/{chunk-Z7IQR4S4.mjs → chunk-WUE5ZHU3.mjs} +269 -21
- package/dist/chunk-ZE53K7DH.mjs +87907 -0
- package/dist/{chunk-NIHPA63A.mjs → chunk-ZOUGMAZG.mjs} +54 -37
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/cell-blocks.d.ts +4 -0
- package/dist/docx/cell-blocks.d.ts.map +1 -0
- package/dist/docx/document-paragraphs.d.ts.map +1 -1
- package/dist/docx/document-parts.d.ts +2 -0
- package/dist/docx/document-parts.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +189 -20
- package/dist/docx/embedded.mjs +189 -20
- package/dist/docx/index.cjs +219 -24
- package/dist/docx/index.mjs +219 -24
- package/dist/docx/layout/adapt-table.d.ts +2 -2
- package/dist/docx/layout/adapt-table.d.ts.map +1 -1
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/flow-paragraph.d.ts +5 -0
- package/dist/docx/layout/flow-paragraph.d.ts.map +1 -1
- package/dist/docx/layout/flow-table.d.ts +2 -1
- package/dist/docx/layout/flow-table.d.ts.map +1 -1
- package/dist/docx/layout/footnote-columns.d.ts +22 -0
- package/dist/docx/layout/footnote-columns.d.ts.map +1 -0
- package/dist/docx/layout/footnote-flow.d.ts +27 -0
- package/dist/docx/layout/footnote-flow.d.ts.map +1 -0
- package/dist/docx/layout/footnote-split.d.ts +7 -0
- package/dist/docx/layout/footnote-split.d.ts.map +1 -0
- package/dist/docx/layout/index.cjs +1528 -119
- package/dist/docx/layout/index.mjs +1528 -120
- package/dist/docx/layout/input.d.ts +17 -1
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/legacy-footnote-flow.d.ts +18 -0
- package/dist/docx/layout/legacy-footnote-flow.d.ts.map +1 -0
- package/dist/docx/layout/line-metrics.d.ts.map +1 -1
- package/dist/docx/layout/nested-frame-profile.d.ts +9 -0
- package/dist/docx/layout/nested-frame-profile.d.ts.map +1 -0
- package/dist/docx/layout/page-cursor.d.ts +15 -8
- package/dist/docx/layout/page-cursor.d.ts.map +1 -1
- package/dist/docx/layout/page-flow.d.ts.map +1 -1
- package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
- package/dist/docx/layout/paragraph-tokens.d.ts +2 -0
- package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
- package/dist/docx/layout/reference-footnotes.d.ts +7 -0
- package/dist/docx/layout/reference-footnotes.d.ts.map +1 -0
- package/dist/docx/layout/result.d.ts +44 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/layout/section-flow.d.ts +2 -0
- package/dist/docx/layout/section-flow.d.ts.map +1 -1
- package/dist/docx/layout/table-border-layout.d.ts +16 -0
- package/dist/docx/layout/table-border-layout.d.ts.map +1 -0
- package/dist/docx/layout/table-cell-layout.d.ts +12 -0
- package/dist/docx/layout/table-cell-layout.d.ts.map +1 -0
- package/dist/docx/layout/table-content.d.ts +4 -0
- package/dist/docx/layout/table-content.d.ts.map +1 -0
- package/dist/docx/layout/table-footnotes.d.ts +32 -0
- package/dist/docx/layout/table-footnotes.d.ts.map +1 -0
- package/dist/docx/layout/table-frames.d.ts +4 -0
- package/dist/docx/layout/table-frames.d.ts.map +1 -0
- package/dist/docx/layout/table-layout.d.ts +16 -5
- package/dist/docx/layout/table-layout.d.ts.map +1 -1
- package/dist/docx/layout/table-note-completion.d.ts +5 -0
- package/dist/docx/layout/table-note-completion.d.ts.map +1 -0
- package/dist/docx/layout/table-note-stories.d.ts +6 -0
- package/dist/docx/layout/table-note-stories.d.ts.map +1 -0
- package/dist/docx/load/index.cjs +194 -25
- package/dist/docx/load/index.mjs +194 -25
- package/dist/docx/model-run.d.ts +2 -0
- package/dist/docx/model-run.d.ts.map +1 -1
- package/dist/docx/model.d.ts +7 -0
- package/dist/docx/model.d.ts.map +1 -1
- package/dist/docx/notes.d.ts +5 -0
- package/dist/docx/notes.d.ts.map +1 -1
- package/dist/docx/parse-table.d.ts.map +1 -1
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/section-model.d.ts +2 -0
- package/dist/docx/section-model.d.ts.map +1 -1
- package/dist/docx/sections.d.ts.map +1 -1
- package/dist/docx/settings.d.ts +2 -0
- package/dist/docx/settings.d.ts.map +1 -1
- package/dist/docx/table-model.d.ts +3 -1
- package/dist/docx/table-model.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +55 -0
- package/dist/docx/ui/index.d.ts +1 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +55 -1
- package/dist/docx/ui/table-structure-guard.d.ts +4 -0
- package/dist/docx/ui/table-structure-guard.d.ts.map +1 -0
- package/dist/docx/write-footnote-columns.d.ts +3 -0
- package/dist/docx/write-footnote-columns.d.ts.map +1 -0
- package/dist/docx/write-notes.d.ts.map +1 -1
- package/dist/docx/write-run.d.ts.map +1 -1
- package/dist/docx/write-sections.d.ts.map +1 -1
- package/dist/index.cjs +8 -5
- package/dist/index.mjs +8 -5
- package/dist/opc/clone-part-graph.d.ts +4 -0
- package/dist/opc/clone-part-graph.d.ts.map +1 -1
- package/dist/opc/index.cjs +8 -5
- package/dist/opc/index.mjs +8 -5
- package/dist/pptx/automation/index.cjs +1156 -389
- package/dist/pptx/automation/index.d.ts +4 -4
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-CKIUurnd.d.ts → index-Cuxtr76Y.d.ts} +29 -10
- package/dist/pptx/chunks/index-Cuxtr76Y.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Cn-GzYGp.d.ts → index-DUCGeZh7.d.ts} +94 -5
- package/dist/pptx/chunks/index-DUCGeZh7.d.ts.map +1 -0
- package/dist/pptx/chunks/{smart-art-Q2kZQtHh.d.ts → smart-art-D-sXa_Nb.d.ts} +11 -1
- package/dist/pptx/chunks/smart-art-D-sXa_Nb.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-BHfAm5K9.d.ts → text-operations-BqHmLaLA.d.ts} +54 -13
- package/dist/pptx/chunks/text-operations-BqHmLaLA.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +1157 -395
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +54 -36
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +416 -45
- package/dist/pptx/editor/render/find-replace.d.ts +35 -4
- package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +416 -46
- package/dist/pptx/editor/render/remap-text.cjs +2 -2
- package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +87 -0
- package/dist/pptx/editor/render/slide-operations.d.ts +17 -1
- package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +83 -1
- package/dist/pptx/editor/render/slide-search.cjs +6 -10
- package/dist/pptx/editor/render/slide-search.d.ts +1 -1
- package/dist/pptx/editor/render/slide-search.mjs +6 -10
- package/dist/pptx/editor/render/template-editing.d.ts +1 -1
- package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
- package/dist/pptx/index.cjs +1651 -419
- package/dist/pptx/index.d.ts +5 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/smartart-layouts/index.d.ts +1 -1
- package/dist/teams/index.cjs +965 -34
- package/dist/teams/index.mjs +965 -34
- package/dist/visio/accessibility.d.ts +10 -0
- package/dist/visio/accessibility.d.ts.map +1 -0
- package/dist/visio/cell-formula.d.ts +2 -0
- package/dist/visio/cell-formula.d.ts.map +1 -1
- package/dist/visio/connector-curve-aligned.d.ts +5 -0
- package/dist/visio/connector-curve-aligned.d.ts.map +1 -0
- package/dist/visio/connector-curve-spans.d.ts +14 -0
- package/dist/visio/connector-curve-spans.d.ts.map +1 -0
- package/dist/visio/connector-jumps.d.ts +5 -0
- package/dist/visio/connector-jumps.d.ts.map +1 -0
- package/dist/visio/connector-route-walk.d.ts +2 -1
- package/dist/visio/connector-route-walk.d.ts.map +1 -1
- package/dist/visio/date-cache.d.ts +3 -0
- package/dist/visio/date-cache.d.ts.map +1 -0
- package/dist/visio/edit-alt-text-scope.d.ts +5 -0
- package/dist/visio/edit-alt-text-scope.d.ts.map +1 -0
- package/dist/visio/edit-alt-text.d.ts +3 -0
- package/dist/visio/edit-alt-text.d.ts.map +1 -0
- package/dist/visio/edit-commands.d.ts +7 -2
- package/dist/visio/edit-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-commands.d.ts +5 -0
- package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
- package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
- package/dist/visio/edit-line-jump-cache.d.ts +4 -0
- package/dist/visio/edit-line-jump-cache.d.ts.map +1 -0
- package/dist/visio/edit-master-index.d.ts.map +1 -1
- package/dist/visio/edit-metadata-commands.d.ts +10 -2
- package/dist/visio/edit-metadata-commands.d.ts.map +1 -1
- package/dist/visio/edit-metadata.d.ts +3 -1
- package/dist/visio/edit-metadata.d.ts.map +1 -1
- package/dist/visio/edit-page-alt-text.d.ts +4 -0
- package/dist/visio/edit-page-alt-text.d.ts.map +1 -0
- package/dist/visio/edit-page-layout.d.ts.map +1 -1
- package/dist/visio/edit-page-rename.d.ts.map +1 -1
- package/dist/visio/edit-page-setup-commands.d.ts +7 -1
- package/dist/visio/edit-page-setup-commands.d.ts.map +1 -1
- package/dist/visio/edit-page-size.d.ts.map +1 -1
- package/dist/visio/edit-pages.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-scope.d.ts.map +1 -1
- package/dist/visio/edit-shape-create.d.ts.map +1 -1
- package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
- package/dist/visio/edit-style-admission.d.ts.map +1 -1
- package/dist/visio/edit-text-field.d.ts.map +1 -1
- package/dist/visio/edit-text.d.ts.map +1 -1
- package/dist/visio/edit.d.ts +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/index.cjs +1215 -248
- package/dist/visio/index.d.ts +2 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +1215 -249
- package/dist/visio/line-jumps.d.ts +1 -5
- package/dist/visio/line-jumps.d.ts.map +1 -1
- package/dist/visio/model.d.ts +13 -0
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/page-layout.d.ts +11 -2
- package/dist/visio/page-layout.d.ts.map +1 -1
- package/dist/visio/parser.d.ts.map +1 -1
- package/dist/visio/shape-metadata.d.ts +6 -0
- package/dist/visio/shape-metadata.d.ts.map +1 -1
- package/dist/visio/shapes.d.ts.map +1 -1
- package/dist/visio/text-field-case.d.ts +2 -0
- package/dist/visio/text-field-case.d.ts.map +1 -0
- package/dist/visio/text-field-display.d.ts.map +1 -1
- package/dist/visio/text-field-fraction.d.ts +3 -0
- package/dist/visio/text-field-fraction.d.ts.map +1 -0
- package/dist/visio/text-field-numeric.d.ts +4 -0
- package/dist/visio/text-field-numeric.d.ts.map +1 -0
- package/dist/visio/text-field-system-date.d.ts +4 -0
- package/dist/visio/text-field-system-date.d.ts.map +1 -0
- package/dist/visio/text-fields.d.ts +1 -0
- package/dist/visio/text-fields.d.ts.map +1 -1
- package/dist/visio/ui/connector-preview.d.ts +1 -1
- package/dist/visio/ui/connector-preview.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-rules.d.ts +2 -0
- package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
- package/dist/visio/ui/data-graphics.d.ts +3 -2
- package/dist/visio/ui/data-graphics.d.ts.map +1 -1
- package/dist/visio/ui/edit-commands.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +19310 -18157
- package/dist/visio/ui/index.mjs +19310 -18158
- package/dist/visio/ui/scene-details.d.ts.map +1 -1
- package/dist/visio/ui/scene-validation.d.ts.map +1 -1
- package/dist/visio/ui/snapshot-scene.d.ts +2 -1
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
- package/dist/visio/ui/text-field-catalog.d.ts.map +1 -1
- package/dist/visio/xml-attribute-whitespace.d.ts +5 -0
- package/dist/visio/xml-attribute-whitespace.d.ts.map +1 -0
- package/dist/xlsx/edit/index.d.ts +1 -0
- package/dist/xlsx/edit/index.d.ts.map +1 -1
- package/dist/xlsx/edit/insert-guard.d.ts.map +1 -1
- package/dist/xlsx/edit/merge.d.ts.map +1 -1
- package/dist/xlsx/edit/page-breaks.d.ts +5 -0
- package/dist/xlsx/edit/page-breaks.d.ts.map +1 -0
- package/dist/xlsx/edit/pivots.d.ts +8 -0
- package/dist/xlsx/edit/pivots.d.ts.map +1 -0
- package/dist/xlsx/edit/print-titles.d.ts +7 -0
- package/dist/xlsx/edit/print-titles.d.ts.map +1 -0
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/sheets.d.ts.map +1 -1
- package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
- package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
- package/dist/xlsx/edit/sparkline-ranges.d.ts +11 -0
- package/dist/xlsx/edit/sparkline-ranges.d.ts.map +1 -0
- package/dist/xlsx/edit/sparkline-xml.d.ts +13 -0
- package/dist/xlsx/edit/sparkline-xml.d.ts.map +1 -0
- package/dist/xlsx/edit/sparklines.d.ts +16 -0
- package/dist/xlsx/edit/sparklines.d.ts.map +1 -0
- package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
- package/dist/xlsx/edit/tables.d.ts.map +1 -1
- package/dist/xlsx/edit/types.d.ts +22 -1
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +3638 -1199
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +3619 -1200
- package/dist/xlsx/layout/cell-view.d.ts +2 -0
- package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
- package/dist/xlsx/layout/header-footer.d.ts +58 -0
- package/dist/xlsx/layout/header-footer.d.ts.map +1 -0
- package/dist/xlsx/layout/index.d.ts +5 -0
- package/dist/xlsx/layout/index.d.ts.map +1 -1
- package/dist/xlsx/layout/print-breaks.d.ts +11 -0
- package/dist/xlsx/layout/print-breaks.d.ts.map +1 -0
- package/dist/xlsx/layout/print-layout.d.ts +34 -0
- package/dist/xlsx/layout/print-layout.d.ts.map +1 -0
- package/dist/xlsx/layout/print-merges.d.ts +18 -0
- package/dist/xlsx/layout/print-merges.d.ts.map +1 -0
- package/dist/xlsx/layout/print-repeat.d.ts +12 -0
- package/dist/xlsx/layout/print-repeat.d.ts.map +1 -0
- package/dist/xlsx/layout/print-titles.d.ts +20 -0
- package/dist/xlsx/layout/print-titles.d.ts.map +1 -0
- package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -1
- package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +8165 -6945
- package/dist/xlsx/load/index.mjs +8165 -6945
- package/dist/xlsx/model-pivots.d.ts +67 -0
- package/dist/xlsx/model-pivots.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +5 -0
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/pivot/admission.d.ts +5 -0
- package/dist/xlsx/pivot/admission.d.ts.map +1 -0
- package/dist/xlsx/pivot/aggregate.d.ts +21 -0
- package/dist/xlsx/pivot/aggregate.d.ts.map +1 -0
- package/dist/xlsx/pivot/cache-xml.d.ts +9 -0
- package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -0
- package/dist/xlsx/pivot/data.d.ts +12 -0
- package/dist/xlsx/pivot/data.d.ts.map +1 -0
- package/dist/xlsx/pivot/hierarchy-first.d.ts +21 -0
- package/dist/xlsx/pivot/hierarchy-first.d.ts.map +1 -0
- package/dist/xlsx/pivot/hierarchy.d.ts +5 -0
- package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -0
- package/dist/xlsx/pivot/index.d.ts +3 -0
- package/dist/xlsx/pivot/index.d.ts.map +1 -0
- package/dist/xlsx/pivot/measures.d.ts +13 -0
- package/dist/xlsx/pivot/measures.d.ts.map +1 -0
- package/dist/xlsx/pivot/read.d.ts +5 -0
- package/dist/xlsx/pivot/read.d.ts.map +1 -0
- package/dist/xlsx/pivot/table-xml.d.ts +5 -0
- package/dist/xlsx/pivot/table-xml.d.ts.map +1 -0
- package/dist/xlsx/pivot/values-axis.d.ts +9 -0
- package/dist/xlsx/pivot/values-axis.d.ts.map +1 -0
- package/dist/xlsx/pivot/write.d.ts +11 -0
- package/dist/xlsx/pivot/write.d.ts.map +1 -0
- package/dist/xlsx/read/load.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- 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/pivots.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/print-layout.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/sparklines.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/sparklines.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/page-breaks.d.ts +3 -0
- package/dist/xlsx/ui/commands/page-breaks.d.ts.map +1 -0
- package/dist/xlsx/ui/index.cjs +2421 -288
- package/dist/xlsx/ui/index.d.ts +1 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +2421 -289
- package/dist/xlsx/write/page-setup.d.ts.map +1 -1
- package/dist/xlsx/write/save.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-parts.d.ts +1 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
- package/dist/xlsx/write/workbook-part.d.ts +1 -1
- package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
- package/dist/xlsx/write/worksheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/pptx/chunks/index-CKIUurnd.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { 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, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, XML_PROLOG, DGM_XMLNS, xmlEscape, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, preservesSpreadsheetXmlWhitespace, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, escAttr, escText, 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, OOXML_PERCENT_UNITS, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, emu, extractGuidFromPartName, deobfuscateFont, detectFontFormat, gradFill, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesTrendlines, parseSeriesErrBars, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, readChartManualLayoutValues, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-
|
|
1
|
+
import { 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, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, XML_PROLOG, DGM_XMLNS, xmlEscape, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, preservesSpreadsheetXmlWhitespace, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, escAttr, escText, 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, OOXML_PERCENT_UNITS, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, emu, extractGuidFromPartName, deobfuscateFont, detectFontFormat, gradFill, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesTrendlines, parseSeriesErrBars, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, readChartManualLayoutValues, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-5NVJN4E6.mjs';
|
|
2
2
|
import { DIGITAL_SIGNATURE_ORIGIN_REL_TYPE } from './chunk-KBIJI6P5.mjs';
|
|
3
3
|
import { resolveSmartArtLayoutCategory } from './chunk-3GXV5MPC.mjs';
|
|
4
4
|
import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-54S5A5PZ.mjs';
|
|
5
5
|
import { themeColorRefFromColorChoice, parseOoxmlPercent, themeColorRefToSolidFillWithOpacity, applyDrawingColorTransforms, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, themeColorRefFromSchemeClr, blendColorOntoWhite } from './chunk-KII4AAYH.mjs';
|
|
6
|
-
import
|
|
6
|
+
import JSZip5 from 'jszip';
|
|
7
7
|
import { DOMParser, XMLSerializer } from '@xmldom/xmldom';
|
|
8
8
|
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
9
9
|
import { decompressEotFont } from 'mtx-decompressor';
|
|
@@ -1761,7 +1761,7 @@ function rootRelsXml() {
|
|
|
1761
1761
|
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
1762
1762
|
</Relationships>`;
|
|
1763
1763
|
}
|
|
1764
|
-
function presentationXml(width, height, slideCount) {
|
|
1764
|
+
function presentationXml(width, height, slideCount, firstSlideNumber) {
|
|
1765
1765
|
const slideIdBase = 256;
|
|
1766
1766
|
const slideRIdBase = 6;
|
|
1767
1767
|
const sldIdLst = slideCount > 0 ? ` <p:sldIdLst>
|
|
@@ -1770,6 +1770,7 @@ ${Array.from(
|
|
|
1770
1770
|
(_, i) => ` <p:sldId id="${slideIdBase + i}" r:id="rId${slideRIdBase + i}"/>`
|
|
1771
1771
|
).join("\n")}
|
|
1772
1772
|
</p:sldIdLst>` : "";
|
|
1773
|
+
const firstSlideNum = firstSlideNumber === void 0 ? "" : ` firstSlideNum="${Math.trunc(firstSlideNumber)}"`;
|
|
1773
1774
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
1774
1775
|
<p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
1775
1776
|
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
|
|
@@ -1777,7 +1778,7 @@ ${Array.from(
|
|
|
1777
1778
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
1778
1779
|
xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
|
|
1779
1780
|
xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"
|
|
1780
|
-
saveSubsetFonts="1">
|
|
1781
|
+
saveSubsetFonts="1"${firstSlideNum}>
|
|
1781
1782
|
<p:sldMasterIdLst>
|
|
1782
1783
|
<p:sldMasterId id="2147483648" r:id="rId1"/>
|
|
1783
1784
|
</p:sldMasterIdLst>
|
|
@@ -2011,10 +2012,13 @@ async function buildBlankPresentationArchive(options) {
|
|
|
2011
2012
|
const layoutCount = STANDARD_LAYOUTS.length;
|
|
2012
2013
|
const initialSlideCount = Math.max(0, options?.initialSlideCount ?? 0);
|
|
2013
2014
|
const blankLayoutIdx = STANDARD_LAYOUTS.findIndex((l) => l.type === "blank") + 1 || 7;
|
|
2014
|
-
const zip = new
|
|
2015
|
+
const zip = new JSZip5();
|
|
2015
2016
|
zip.file("[Content_Types].xml", contentTypesXml(layoutCount, initialSlideCount));
|
|
2016
2017
|
zip.file("_rels/.rels", rootRelsXml());
|
|
2017
|
-
zip.file(
|
|
2018
|
+
zip.file(
|
|
2019
|
+
"ppt/presentation.xml",
|
|
2020
|
+
presentationXml(width, height, initialSlideCount, options?.firstSlideNumber)
|
|
2021
|
+
);
|
|
2018
2022
|
zip.file("ppt/_rels/presentation.xml.rels", presentationRelsXml(layoutCount, initialSlideCount));
|
|
2019
2023
|
zip.file("ppt/slideMasters/slideMaster1.xml", slideMasterXml(layoutCount));
|
|
2020
2024
|
zip.file("ppt/slideMasters/_rels/slideMaster1.xml.rels", slideMasterRelsXml(layoutCount));
|
|
@@ -2260,6 +2264,11 @@ function relationshipsPartFor(partName) {
|
|
|
2260
2264
|
const slash = partName.lastIndexOf("/");
|
|
2261
2265
|
return `${partName.slice(0, slash + 1)}_rels/${partName.slice(slash + 1)}.rels`;
|
|
2262
2266
|
}
|
|
2267
|
+
function nextRelationshipId(used) {
|
|
2268
|
+
let index = 1;
|
|
2269
|
+
while (used.has(`rId${index}`)) index++;
|
|
2270
|
+
return `rId${index}`;
|
|
2271
|
+
}
|
|
2263
2272
|
|
|
2264
2273
|
// opc/content-types.ts
|
|
2265
2274
|
function parseContentTypes(xml) {
|
|
@@ -2279,6 +2288,13 @@ function parseContentTypes(xml) {
|
|
|
2279
2288
|
}
|
|
2280
2289
|
return { defaults, overrides };
|
|
2281
2290
|
}
|
|
2291
|
+
function contentTypeForPart(types, partName) {
|
|
2292
|
+
const overridePath = partName.startsWith("/") ? partName : `/${partName}`;
|
|
2293
|
+
const override = types.overrides.get(overridePath);
|
|
2294
|
+
if (override) return override;
|
|
2295
|
+
const extension = partName.split(".").pop()?.toLowerCase();
|
|
2296
|
+
return extension ? types.defaults.get(extension) : void 0;
|
|
2297
|
+
}
|
|
2282
2298
|
|
|
2283
2299
|
// opc/package.ts
|
|
2284
2300
|
var CONTENT_TYPES_PATH = "[Content_Types].xml";
|
|
@@ -2308,10 +2324,13 @@ function relativePartTarget(basePart, targetPart) {
|
|
|
2308
2324
|
}
|
|
2309
2325
|
async function clonePartGraph(options) {
|
|
2310
2326
|
const { zip, sourcePart, targetPart, shouldClone } = options;
|
|
2311
|
-
const
|
|
2312
|
-
const
|
|
2327
|
+
const sourceZip = options.sourceZip ?? zip;
|
|
2328
|
+
const copies = options.copies ?? /* @__PURE__ */ new Map();
|
|
2329
|
+
copies.set(sourcePart, targetPart);
|
|
2330
|
+
const types = parseContentTypes(await sourceZip.file("[Content_Types].xml")?.async("string"));
|
|
2313
2331
|
const reserved = new Set(Object.keys(zip.files));
|
|
2314
2332
|
reserved.add(targetPart);
|
|
2333
|
+
for (const target of copies.values()) reserved.add(target);
|
|
2315
2334
|
const allocate = (source) => {
|
|
2316
2335
|
const match = /^(?<stem>.*?)(?:\d+)?(?<extension>\.[^/.]+)$/u.exec(source);
|
|
2317
2336
|
const stem = match?.groups?.stem ?? source;
|
|
@@ -2323,9 +2342,9 @@ async function clonePartGraph(options) {
|
|
|
2323
2342
|
return path2;
|
|
2324
2343
|
};
|
|
2325
2344
|
const copyRelationships = async (source, destination) => {
|
|
2326
|
-
const contentType = types
|
|
2345
|
+
const contentType = contentTypeForPart(types, source);
|
|
2327
2346
|
if (contentType) await ensureContentTypeOverride(zip, destination, contentType);
|
|
2328
|
-
const xml = await
|
|
2347
|
+
const xml = await sourceZip.file(relationshipsPartFor(source))?.async("string");
|
|
2329
2348
|
if (!xml) return;
|
|
2330
2349
|
const relationships2 = parseRelationships(xml);
|
|
2331
2350
|
for (const relationship of relationships2.values()) {
|
|
@@ -2333,7 +2352,7 @@ async function clonePartGraph(options) {
|
|
|
2333
2352
|
const originalTarget = resolvePartPath(source, relationship.target);
|
|
2334
2353
|
let newTarget = copies.get(originalTarget);
|
|
2335
2354
|
if (!newTarget && shouldClone(relationship, originalTarget)) {
|
|
2336
|
-
const file =
|
|
2355
|
+
const file = sourceZip.file(originalTarget);
|
|
2337
2356
|
if (!file) throw new Error(`Cannot clone missing package part: ${originalTarget}`);
|
|
2338
2357
|
newTarget = allocate(originalTarget);
|
|
2339
2358
|
copies.set(originalTarget, newTarget);
|
|
@@ -4541,7 +4560,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
4541
4560
|
}
|
|
4542
4561
|
staticRelationships.push(relationship);
|
|
4543
4562
|
}
|
|
4544
|
-
const
|
|
4563
|
+
const nextRelationshipId5 = () => {
|
|
4545
4564
|
let index = 1;
|
|
4546
4565
|
while (usedRIds.has(`rId${index}`)) {
|
|
4547
4566
|
index += 1;
|
|
@@ -4585,7 +4604,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
4585
4604
|
const existingSlideXml = input.slideMap.get(slide.id);
|
|
4586
4605
|
if (existingSlideXml) {
|
|
4587
4606
|
if (!slide.rId || slide.rId.length === 0 || !slideTargetByRid.has(slide.rId)) {
|
|
4588
|
-
slide.rId =
|
|
4607
|
+
slide.rId = nextRelationshipId5();
|
|
4589
4608
|
} else {
|
|
4590
4609
|
usedRIds.add(slide.rId);
|
|
4591
4610
|
}
|
|
@@ -4604,7 +4623,7 @@ var PptxPresentationSlidesReconciler = class {
|
|
|
4604
4623
|
sourceSlidePath,
|
|
4605
4624
|
usedRIds,
|
|
4606
4625
|
slideTargetByRid,
|
|
4607
|
-
nextRelationshipId:
|
|
4626
|
+
nextRelationshipId: nextRelationshipId5
|
|
4608
4627
|
});
|
|
4609
4628
|
attachedPaths.set(originalId, slide.id);
|
|
4610
4629
|
}
|
|
@@ -5554,7 +5573,13 @@ var PptxSlideNotesPartUpdater = class {
|
|
|
5554
5573
|
init.slideNotesRelationshipType,
|
|
5555
5574
|
`../notesSlides/${fileName}`
|
|
5556
5575
|
);
|
|
5557
|
-
|
|
5576
|
+
const notesXmlObject = this.buildNotesSlide(init.slide, strict);
|
|
5577
|
+
init.updateNotesXmlText(
|
|
5578
|
+
notesXmlObject,
|
|
5579
|
+
init.slide.notes ?? init.slide.notesSegments?.map((segment) => segment.text).join("") ?? "",
|
|
5580
|
+
init.slide.notesSegments
|
|
5581
|
+
);
|
|
5582
|
+
init.zip.file(notesPath, init.xmlBuilder.build(notesXmlObject));
|
|
5558
5583
|
init.zip.file(
|
|
5559
5584
|
`ppt/notesSlides/_rels/${fileName}.rels`,
|
|
5560
5585
|
init.xmlBuilder.build({
|
|
@@ -10036,7 +10061,7 @@ function parseShapeLockNode(node, spec) {
|
|
|
10036
10061
|
return void 0;
|
|
10037
10062
|
}
|
|
10038
10063
|
const locks = {};
|
|
10039
|
-
let
|
|
10064
|
+
let hasAny2 = false;
|
|
10040
10065
|
for (const prop of spec.permitted) {
|
|
10041
10066
|
const raw = node[LOCK_ATTRIBUTE[prop]];
|
|
10042
10067
|
if (raw === void 0) {
|
|
@@ -10044,9 +10069,9 @@ function parseShapeLockNode(node, spec) {
|
|
|
10044
10069
|
}
|
|
10045
10070
|
const value = String(raw).trim().toLowerCase();
|
|
10046
10071
|
locks[prop] = value === "1" || value === "true";
|
|
10047
|
-
|
|
10072
|
+
hasAny2 = true;
|
|
10048
10073
|
}
|
|
10049
|
-
return
|
|
10074
|
+
return hasAny2 ? locks : void 0;
|
|
10050
10075
|
}
|
|
10051
10076
|
|
|
10052
10077
|
// pptx/core/core/runtime/shape-lock-containers.ts
|
|
@@ -10850,6 +10875,7 @@ var PptxLoadDataBuilder = class {
|
|
|
10850
10875
|
modernCommentAuthors;
|
|
10851
10876
|
conformance;
|
|
10852
10877
|
embedTrueTypeFonts;
|
|
10878
|
+
firstSlideNumber;
|
|
10853
10879
|
defaultTextStyle;
|
|
10854
10880
|
withDimensions(width, height, widthEmu, heightEmu) {
|
|
10855
10881
|
this.width = width;
|
|
@@ -11019,6 +11045,10 @@ var PptxLoadDataBuilder = class {
|
|
|
11019
11045
|
this.embedTrueTypeFonts = embedTrueTypeFonts;
|
|
11020
11046
|
return this;
|
|
11021
11047
|
}
|
|
11048
|
+
withFirstSlideNumber(firstSlideNumber) {
|
|
11049
|
+
this.firstSlideNumber = firstSlideNumber;
|
|
11050
|
+
return this;
|
|
11051
|
+
}
|
|
11022
11052
|
withDefaultTextStyle(defaultTextStyle) {
|
|
11023
11053
|
this.defaultTextStyle = defaultTextStyle;
|
|
11024
11054
|
return this;
|
|
@@ -11070,6 +11100,7 @@ var PptxLoadDataBuilder = class {
|
|
|
11070
11100
|
modernCommentAuthors: this.modernCommentAuthors,
|
|
11071
11101
|
conformance: this.conformance,
|
|
11072
11102
|
embedTrueTypeFonts: this.embedTrueTypeFonts,
|
|
11103
|
+
firstSlideNumber: this.firstSlideNumber,
|
|
11073
11104
|
defaultTextStyle: this.defaultTextStyle
|
|
11074
11105
|
};
|
|
11075
11106
|
}
|
|
@@ -14868,6 +14899,345 @@ async function attachRealMediaDurations(elements2, nativeAnimations, readBytes)
|
|
|
14868
14899
|
applyPlainDelayRemap(nativeAnimations, plainDelayRemap);
|
|
14869
14900
|
}
|
|
14870
14901
|
|
|
14902
|
+
// pptx/core/services/editor-animation-entry.ts
|
|
14903
|
+
var DEFAULT_ANIMATION_DURATION_MS = 500;
|
|
14904
|
+
var DEFAULT_ANIMATION_TRIGGER = "onClick";
|
|
14905
|
+
function hasAuthoredAnimationEffect(entry2) {
|
|
14906
|
+
return Boolean(
|
|
14907
|
+
[entry2.entrance, entry2.exit, entry2.emphasis].some((preset) => preset && preset !== "none") || entry2.motionPath
|
|
14908
|
+
);
|
|
14909
|
+
}
|
|
14910
|
+
function hasAnimation(animations, elementId) {
|
|
14911
|
+
const entry2 = animationFor(animations, elementId);
|
|
14912
|
+
return Boolean(entry2 && (entry2.entrance || entry2.exit || entry2.emphasis || entry2.motionPath));
|
|
14913
|
+
}
|
|
14914
|
+
function animationFor(slideAnimations, elementId) {
|
|
14915
|
+
return slideAnimations.find((a) => a.elementId === elementId);
|
|
14916
|
+
}
|
|
14917
|
+
function upsert(anims, elementId, updater) {
|
|
14918
|
+
const idx = anims.findIndex((a) => a.elementId === elementId);
|
|
14919
|
+
if (idx >= 0) {
|
|
14920
|
+
const updated2 = updater({ ...anims[idx] });
|
|
14921
|
+
if (updated2 === null) {
|
|
14922
|
+
return anims.filter((a) => a.elementId !== elementId);
|
|
14923
|
+
}
|
|
14924
|
+
return anims.map((a, i) => i === idx ? updated2 : a);
|
|
14925
|
+
}
|
|
14926
|
+
const created = {
|
|
14927
|
+
elementId,
|
|
14928
|
+
durationMs: DEFAULT_ANIMATION_DURATION_MS,
|
|
14929
|
+
order: anims.length,
|
|
14930
|
+
trigger: DEFAULT_ANIMATION_TRIGGER
|
|
14931
|
+
};
|
|
14932
|
+
const updated = updater(created);
|
|
14933
|
+
if (updated === null) {
|
|
14934
|
+
return [...anims];
|
|
14935
|
+
}
|
|
14936
|
+
return [...anims, updated];
|
|
14937
|
+
}
|
|
14938
|
+
|
|
14939
|
+
// pptx/core/services/native-animation-after-effect.ts
|
|
14940
|
+
function hasAfterEffectFlag(cTn) {
|
|
14941
|
+
const raw = cTn?.["@_afterEffect"];
|
|
14942
|
+
return raw === "1" || raw === "true";
|
|
14943
|
+
}
|
|
14944
|
+
function extractSrgbHex(colorContainer) {
|
|
14945
|
+
const srgb = colorContainer?.["a:srgbClr"];
|
|
14946
|
+
const val = srgb?.["@_val"];
|
|
14947
|
+
return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
|
|
14948
|
+
}
|
|
14949
|
+
function findDimBehaviour(subTnLst) {
|
|
14950
|
+
for (const node of ensureArray3(subTnLst["p:animClr"])) {
|
|
14951
|
+
const cBhvr = node["p:cBhvr"];
|
|
14952
|
+
if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
|
|
14953
|
+
continue;
|
|
14954
|
+
}
|
|
14955
|
+
if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
|
|
14956
|
+
continue;
|
|
14957
|
+
}
|
|
14958
|
+
const toNode = node["p:to"];
|
|
14959
|
+
const color = extractSrgbHex(toNode);
|
|
14960
|
+
if (color) {
|
|
14961
|
+
return { action: "dimToColor", color };
|
|
14962
|
+
}
|
|
14963
|
+
const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
|
|
14964
|
+
return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
|
|
14965
|
+
}
|
|
14966
|
+
return void 0;
|
|
14967
|
+
}
|
|
14968
|
+
function findHideBehaviour(subTnLst) {
|
|
14969
|
+
for (const node of ensureArray3(subTnLst["p:set"])) {
|
|
14970
|
+
const cBhvr = node["p:cBhvr"];
|
|
14971
|
+
if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
|
|
14972
|
+
continue;
|
|
14973
|
+
}
|
|
14974
|
+
const innerCTn = cBhvr?.["p:cTn"];
|
|
14975
|
+
if (!hasAfterEffectFlag(innerCTn)) {
|
|
14976
|
+
continue;
|
|
14977
|
+
}
|
|
14978
|
+
const toNode = node["p:to"];
|
|
14979
|
+
const strVal = toNode?.["p:strVal"]?.["@_val"];
|
|
14980
|
+
if (String(strVal ?? "").toLowerCase() !== "hidden") {
|
|
14981
|
+
continue;
|
|
14982
|
+
}
|
|
14983
|
+
const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
|
|
14984
|
+
return { action };
|
|
14985
|
+
}
|
|
14986
|
+
return void 0;
|
|
14987
|
+
}
|
|
14988
|
+
function extractAfterAnimationFromSubTnLst(cTn) {
|
|
14989
|
+
const subTnLst = cTn["p:subTnLst"];
|
|
14990
|
+
if (!subTnLst) {
|
|
14991
|
+
return void 0;
|
|
14992
|
+
}
|
|
14993
|
+
return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
|
|
14994
|
+
}
|
|
14995
|
+
|
|
14996
|
+
// pptx/core/services/animation-after-effect-write.ts
|
|
14997
|
+
function assertAfterAnimationClearSupported(effectCTn) {
|
|
14998
|
+
const shapeIds = /* @__PURE__ */ new Set();
|
|
14999
|
+
const checkTarget = (value) => {
|
|
15000
|
+
if (Array.isArray(value)) {
|
|
15001
|
+
value.forEach(checkTarget);
|
|
15002
|
+
return;
|
|
15003
|
+
}
|
|
15004
|
+
if (!isXmlObject3(value)) return;
|
|
15005
|
+
const shapeTarget = value["p:spTgt"];
|
|
15006
|
+
if (isXmlObject3(shapeTarget) && shapeTarget["@_spid"] !== void 0)
|
|
15007
|
+
shapeIds.add(String(shapeTarget["@_spid"]));
|
|
15008
|
+
if ([
|
|
15009
|
+
"p:bg",
|
|
15010
|
+
"p:txEl",
|
|
15011
|
+
"p:subSp",
|
|
15012
|
+
"p:graphicEl",
|
|
15013
|
+
"p:oleChartEl",
|
|
15014
|
+
"p:sndTgt",
|
|
15015
|
+
"p:inkTgt",
|
|
15016
|
+
"p:sldTgt"
|
|
15017
|
+
].some((key2) => value[key2] !== void 0))
|
|
15018
|
+
throw new Error("Clearing after-animation supports whole-shape targets only");
|
|
15019
|
+
Object.values(value).forEach(checkTarget);
|
|
15020
|
+
};
|
|
15021
|
+
checkTarget(effectCTn["p:childTnLst"]);
|
|
15022
|
+
if (shapeIds.size > 1)
|
|
15023
|
+
throw new Error("Editing after-animation supports a single whole-shape target only");
|
|
15024
|
+
const sub = effectCTn["p:subTnLst"];
|
|
15025
|
+
if (!isXmlObject3(sub)) return;
|
|
15026
|
+
const countAfterFlags = (value) => {
|
|
15027
|
+
if (Array.isArray(value))
|
|
15028
|
+
return value.reduce((count, child14) => count + countAfterFlags(child14), 0);
|
|
15029
|
+
if (!isXmlObject3(value)) return 0;
|
|
15030
|
+
return Object.entries(value).reduce(
|
|
15031
|
+
(count, [key2, child14]) => count + (key2 === "@_afterEffect" && ["1", "true"].includes(String(child14)) ? 1 : countAfterFlags(child14)),
|
|
15032
|
+
0
|
|
15033
|
+
);
|
|
15034
|
+
};
|
|
15035
|
+
for (const [key2, value] of Object.entries(sub)) {
|
|
15036
|
+
for (const node of ensureArray3(value)) {
|
|
15037
|
+
const flags = countAfterFlags(node);
|
|
15038
|
+
if (!flags) continue;
|
|
15039
|
+
if (flags !== 1 || !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } }))
|
|
15040
|
+
throw new Error("Cannot clear an unsupported native after-animation behavior");
|
|
15041
|
+
checkTarget(node);
|
|
15042
|
+
}
|
|
15043
|
+
}
|
|
15044
|
+
if (shapeIds.size > 1)
|
|
15045
|
+
throw new Error("Editing after-animation supports a single whole-shape target only");
|
|
15046
|
+
}
|
|
15047
|
+
function clearAfterAnimationBehavior(effectCTn) {
|
|
15048
|
+
const sub = effectCTn["p:subTnLst"];
|
|
15049
|
+
if (!isXmlObject3(sub)) return;
|
|
15050
|
+
for (const key2 of Object.keys(sub)) {
|
|
15051
|
+
const nodes = ensureArray3(sub[key2]);
|
|
15052
|
+
const remaining = nodes.filter(
|
|
15053
|
+
(node) => !extractAfterAnimationFromSubTnLst({ "p:subTnLst": { [key2]: node } })
|
|
15054
|
+
);
|
|
15055
|
+
if (remaining.length === nodes.length) continue;
|
|
15056
|
+
if (remaining.length === 0) delete sub[key2];
|
|
15057
|
+
else sub[key2] = remaining.length === 1 ? remaining[0] : remaining;
|
|
15058
|
+
}
|
|
15059
|
+
if (Object.keys(sub).length === 0) delete effectCTn["p:subTnLst"];
|
|
15060
|
+
}
|
|
15061
|
+
function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
|
|
15062
|
+
if (anim.afterAnimation === void 0) return;
|
|
15063
|
+
if (anim.afterAnimation === "none") {
|
|
15064
|
+
assertAfterAnimationClearSupported(effectCTn);
|
|
15065
|
+
clearAfterAnimationBehavior(effectCTn);
|
|
15066
|
+
return;
|
|
15067
|
+
}
|
|
15068
|
+
assertAfterAnimationClearSupported(effectCTn);
|
|
15069
|
+
clearAfterAnimationBehavior(effectCTn);
|
|
15070
|
+
delete effectCTn["@_afterEffect"];
|
|
15071
|
+
if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
|
|
15072
|
+
appendAfterAnimationBehavior(effectCTn, buildDimSubTnLst(shapeId, anim.afterAnimationColor));
|
|
15073
|
+
return;
|
|
15074
|
+
}
|
|
15075
|
+
if (anim.afterAnimation === "hideAfterAnimation") {
|
|
15076
|
+
const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
|
|
15077
|
+
appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "sameClick", entranceId));
|
|
15078
|
+
return;
|
|
15079
|
+
}
|
|
15080
|
+
if (anim.afterAnimation === "hideOnNextClick") {
|
|
15081
|
+
appendAfterAnimationBehavior(effectCTn, buildHideSubTnLst(shapeId, "nextClick"));
|
|
15082
|
+
}
|
|
15083
|
+
}
|
|
15084
|
+
function appendAfterAnimationBehavior(effect, addition) {
|
|
15085
|
+
const sub = isXmlObject3(effect["p:subTnLst"]) ? effect["p:subTnLst"] : {};
|
|
15086
|
+
for (const [key2, value] of Object.entries(addition)) {
|
|
15087
|
+
const nodes = [...ensureArray3(sub[key2]), ...ensureArray3(value)];
|
|
15088
|
+
sub[key2] = nodes.length === 1 ? nodes[0] : nodes;
|
|
15089
|
+
}
|
|
15090
|
+
effect["p:subTnLst"] = sub;
|
|
15091
|
+
}
|
|
15092
|
+
function buildDimSubTnLst(shapeId, colorHex) {
|
|
15093
|
+
const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
|
|
15094
|
+
return {
|
|
15095
|
+
"p:animClr": {
|
|
15096
|
+
"@_clrSpc": "rgb",
|
|
15097
|
+
"@_dir": "cw",
|
|
15098
|
+
"p:cBhvr": {
|
|
15099
|
+
"@_override": "childStyle",
|
|
15100
|
+
"p:cTn": {
|
|
15101
|
+
"@_dur": "1",
|
|
15102
|
+
"@_fill": "hold",
|
|
15103
|
+
"@_display": "0",
|
|
15104
|
+
"@_masterRel": "nextClick",
|
|
15105
|
+
"@_afterEffect": "1"
|
|
15106
|
+
},
|
|
15107
|
+
"p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
|
|
15108
|
+
"p:attrNameLst": { "p:attrName": "ppt_c" }
|
|
15109
|
+
},
|
|
15110
|
+
"p:to": { "a:srgbClr": { "@_val": hex3 } }
|
|
15111
|
+
}
|
|
15112
|
+
};
|
|
15113
|
+
}
|
|
15114
|
+
function buildHideSubTnLst(shapeId, masterRel, entranceId) {
|
|
15115
|
+
const cTn = {
|
|
15116
|
+
"@_dur": "1",
|
|
15117
|
+
"@_fill": "hold",
|
|
15118
|
+
"@_display": "0",
|
|
15119
|
+
"@_masterRel": masterRel,
|
|
15120
|
+
"@_afterEffect": "1"
|
|
15121
|
+
};
|
|
15122
|
+
if (masterRel === "sameClick") {
|
|
15123
|
+
cTn["p:stCondLst"] = {
|
|
15124
|
+
"p:cond": {
|
|
15125
|
+
"@_evt": "end",
|
|
15126
|
+
"@_delay": "0",
|
|
15127
|
+
"p:tn": { "@_val": entranceId ?? "0" }
|
|
15128
|
+
}
|
|
15129
|
+
};
|
|
15130
|
+
}
|
|
15131
|
+
return {
|
|
15132
|
+
"p:set": {
|
|
15133
|
+
"p:cBhvr": {
|
|
15134
|
+
"@_override": "childStyle",
|
|
15135
|
+
"p:cTn": cTn,
|
|
15136
|
+
"p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
|
|
15137
|
+
"p:attrNameLst": { "p:attrName": "style.visibility" }
|
|
15138
|
+
},
|
|
15139
|
+
"p:to": { "p:strVal": { "@_val": "hidden" } }
|
|
15140
|
+
}
|
|
15141
|
+
};
|
|
15142
|
+
}
|
|
15143
|
+
|
|
15144
|
+
// pptx/core/services/editor-animation-after-effect.ts
|
|
15145
|
+
var AFTER_ANIMATION_VALUES = [
|
|
15146
|
+
"none",
|
|
15147
|
+
"dimToColor",
|
|
15148
|
+
"hideAfterAnimation",
|
|
15149
|
+
"hideOnNextClick"
|
|
15150
|
+
];
|
|
15151
|
+
var DEFAULT_AFTER_ANIMATION_DIM_COLOR = "#808080";
|
|
15152
|
+
function setAfterAnimation(anims, elementId, action) {
|
|
15153
|
+
return upsert(anims, elementId, (cur) => {
|
|
15154
|
+
const value = action;
|
|
15155
|
+
return {
|
|
15156
|
+
...cur,
|
|
15157
|
+
afterAnimation: value,
|
|
15158
|
+
afterAnimationColor: value === "dimToColor" ? cur.afterAnimationColor ?? DEFAULT_AFTER_ANIMATION_DIM_COLOR : void 0
|
|
15159
|
+
};
|
|
15160
|
+
});
|
|
15161
|
+
}
|
|
15162
|
+
function setAfterAnimationColor(anims, elementId, color) {
|
|
15163
|
+
const entry2 = animationFor(anims, elementId);
|
|
15164
|
+
if (!entry2 || (entry2.afterAnimation ?? entry2.nativeAfterAnimation) !== "dimToColor") {
|
|
15165
|
+
return [...anims];
|
|
15166
|
+
}
|
|
15167
|
+
return upsert(anims, elementId, (cur) => ({
|
|
15168
|
+
...cur,
|
|
15169
|
+
afterAnimation: "dimToColor",
|
|
15170
|
+
afterAnimationColor: color
|
|
15171
|
+
}));
|
|
15172
|
+
}
|
|
15173
|
+
function getAfterAnimation(slideAnimations, elementId) {
|
|
15174
|
+
const entry2 = animationFor(slideAnimations, elementId);
|
|
15175
|
+
return entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
|
|
15176
|
+
}
|
|
15177
|
+
function getAfterAnimationState(entry2) {
|
|
15178
|
+
const action = entry2?.afterAnimation ?? entry2?.nativeAfterAnimation ?? "none";
|
|
15179
|
+
return {
|
|
15180
|
+
action,
|
|
15181
|
+
color: action === "dimToColor" ? entry2?.afterAnimationColor ?? entry2?.nativeAfterAnimationColor : void 0,
|
|
15182
|
+
showColor: entry2?.afterAnimation !== void 0 || /^#[0-9a-f]{6}$/iu.test(entry2?.nativeAfterAnimationColor ?? "")
|
|
15183
|
+
};
|
|
15184
|
+
}
|
|
15185
|
+
function isNativeAfterAnimationOnly(entry2) {
|
|
15186
|
+
return Boolean(
|
|
15187
|
+
entry2?.nativeAfterAnimation && !entry2.entrance && !entry2.exit && !entry2.emphasis && !entry2.motionPath
|
|
15188
|
+
);
|
|
15189
|
+
}
|
|
15190
|
+
function mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming) {
|
|
15191
|
+
for (const native of nativeAnimations ?? []) {
|
|
15192
|
+
const existing = native.targetId ? animationFor(animations, native.targetId) : void 0;
|
|
15193
|
+
const action = native.afterAnimationAction ?? (existing?.afterAnimation !== void 0 ? "none" : void 0);
|
|
15194
|
+
if ((nativeAnimations ?? []).filter(
|
|
15195
|
+
(other) => other.targetId === native.targetId && ["entr", "emph"].includes(other.presetClass ?? "")
|
|
15196
|
+
).length !== 1)
|
|
15197
|
+
continue;
|
|
15198
|
+
if (!native.targetId || !action || !["entr", "emph"].includes(native.presetClass ?? "") || native.textTarget)
|
|
15199
|
+
continue;
|
|
15200
|
+
if (native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
|
|
15201
|
+
continue;
|
|
15202
|
+
try {
|
|
15203
|
+
if (rawTiming && native.target?.type === "shape" && indexEffectNodes(rawTiming).filter(
|
|
15204
|
+
(ref) => ref.spid === (native.target?.type === "shape" ? native.target.shapeId : void 0) && ["entr", "emph"].includes(ref.presetClass)
|
|
15205
|
+
).length !== 1)
|
|
15206
|
+
continue;
|
|
15207
|
+
const effect = rawTiming ? indexEffectNodes(rawTiming).find(
|
|
15208
|
+
(ref) => String(ref.cTn["@_id"]) === String(native.nodeId) && native.target?.type === "shape" && ref.spid === native.target.shapeId
|
|
15209
|
+
) : void 0;
|
|
15210
|
+
if (rawTiming && !effect) continue;
|
|
15211
|
+
assertAfterAnimationClearSupported(
|
|
15212
|
+
effect?.cTn ?? { "p:subTnLst": native.cTnAttributes?.["p:subTnLst"] }
|
|
15213
|
+
);
|
|
15214
|
+
} catch {
|
|
15215
|
+
continue;
|
|
15216
|
+
}
|
|
15217
|
+
let entry2 = animationFor(animations, native.targetId);
|
|
15218
|
+
if (!entry2) {
|
|
15219
|
+
entry2 = { elementId: native.targetId };
|
|
15220
|
+
animations.push(entry2);
|
|
15221
|
+
}
|
|
15222
|
+
if (entry2.nativeAfterAnimation !== void 0) continue;
|
|
15223
|
+
entry2.nativeAfterAnimation = action;
|
|
15224
|
+
entry2.nativeAfterAnimationColor = native.afterAnimationColor;
|
|
15225
|
+
}
|
|
15226
|
+
}
|
|
15227
|
+
function isNativeAfterAnimationFallback(entry2) {
|
|
15228
|
+
return entry2.nativeAfterAnimation !== void 0 && Object.entries(entry2).every(
|
|
15229
|
+
([key2, value]) => value === void 0 || [
|
|
15230
|
+
"elementId",
|
|
15231
|
+
"nativeAfterAnimation",
|
|
15232
|
+
"nativeAfterAnimationColor",
|
|
15233
|
+
"soundRId",
|
|
15234
|
+
"soundPath",
|
|
15235
|
+
"soundName",
|
|
15236
|
+
"stopSound"
|
|
15237
|
+
].includes(key2)
|
|
15238
|
+
);
|
|
15239
|
+
}
|
|
15240
|
+
|
|
14871
15241
|
// pptx/core/services/slide-name.ts
|
|
14872
15242
|
function asNode3(value) {
|
|
14873
15243
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -15369,6 +15739,8 @@ var PptxSlideLoaderService = class {
|
|
|
15369
15739
|
}
|
|
15370
15740
|
});
|
|
15371
15741
|
reconcileAnimationTargets(elements2, nativeAnimations, animations, animationTimelineAnchors);
|
|
15742
|
+
animations ??= [];
|
|
15743
|
+
mergeNativeAfterAnimationIntoEditorAnimations(nativeAnimations, animations, rawTiming);
|
|
15372
15744
|
mergeNativeSoundIntoEditorAnimations(nativeAnimations, animations);
|
|
15373
15745
|
mergeNativeBuildTemplatesIntoEditorAnimations(nativeAnimations, animations);
|
|
15374
15746
|
applyHiddenFlagFromRawXml(elements2);
|
|
@@ -15794,7 +16166,7 @@ var PptxEditorAnimationService = class {
|
|
|
15794
16166
|
* @param animations - Editor animations to serialize.
|
|
15795
16167
|
*/
|
|
15796
16168
|
applyEditorAnimations(slideNode, animations) {
|
|
15797
|
-
const sequenced =
|
|
16169
|
+
const sequenced = animations.filter((entry2) => !isNativeAfterAnimationFallback(entry2)).sort((left, right) => sortOrder(left) - sortOrder(right));
|
|
15798
16170
|
const sanitizedAnimations = sequenced.map((animation) => {
|
|
15799
16171
|
const elementId = String(animation.elementId || "").trim();
|
|
15800
16172
|
if (elementId.length === 0) {
|
|
@@ -15808,7 +16180,7 @@ var PptxEditorAnimationService = class {
|
|
|
15808
16180
|
const orderIsTreeDerived = animation.orderFromTimeline !== void 0 && animation.order === animation.orderFromTimeline;
|
|
15809
16181
|
const order = typeof animation.order === "number" && Number.isFinite(animation.order) && !orderIsTreeDerived ? Math.round(animation.order) : void 0;
|
|
15810
16182
|
const repeatCount = typeof animation.repeatCount === "number" && Number.isFinite(animation.repeatCount) && animation.repeatCount > 0 ? animation.repeatCount : void 0;
|
|
15811
|
-
if (!entrance && !exit2 && !emphasis && !animation.motionPath) {
|
|
16183
|
+
if (!entrance && !exit2 && !emphasis && !animation.motionPath && animation.afterAnimation === void 0) {
|
|
15812
16184
|
return null;
|
|
15813
16185
|
}
|
|
15814
16186
|
return {
|
|
@@ -16245,63 +16617,6 @@ function parseAnimEffectFilter(childTnList) {
|
|
|
16245
16617
|
};
|
|
16246
16618
|
}
|
|
16247
16619
|
|
|
16248
|
-
// pptx/core/services/native-animation-after-effect.ts
|
|
16249
|
-
function hasAfterEffectFlag(cTn) {
|
|
16250
|
-
const raw = cTn?.["@_afterEffect"];
|
|
16251
|
-
return raw === "1" || raw === "true";
|
|
16252
|
-
}
|
|
16253
|
-
function extractSrgbHex(colorContainer) {
|
|
16254
|
-
const srgb = colorContainer?.["a:srgbClr"];
|
|
16255
|
-
const val = srgb?.["@_val"];
|
|
16256
|
-
return val !== void 0 ? `#${String(val).toUpperCase()}` : void 0;
|
|
16257
|
-
}
|
|
16258
|
-
function findDimBehaviour(subTnLst) {
|
|
16259
|
-
for (const node of ensureArray3(subTnLst["p:animClr"])) {
|
|
16260
|
-
const cBhvr = node["p:cBhvr"];
|
|
16261
|
-
if (extractAttrNameFromCBhvr(cBhvr) !== "ppt_c") {
|
|
16262
|
-
continue;
|
|
16263
|
-
}
|
|
16264
|
-
if (!hasAfterEffectFlag(cBhvr?.["p:cTn"])) {
|
|
16265
|
-
continue;
|
|
16266
|
-
}
|
|
16267
|
-
const toNode = node["p:to"];
|
|
16268
|
-
const color = extractSrgbHex(toNode);
|
|
16269
|
-
if (color) {
|
|
16270
|
-
return { action: "dimToColor", color };
|
|
16271
|
-
}
|
|
16272
|
-
const colorRef = themeColorRefFromSchemeClr(toNode?.["a:schemeClr"]);
|
|
16273
|
-
return colorRef ? { action: "dimToColor", colorRef } : { action: "dimToColor" };
|
|
16274
|
-
}
|
|
16275
|
-
return void 0;
|
|
16276
|
-
}
|
|
16277
|
-
function findHideBehaviour(subTnLst) {
|
|
16278
|
-
for (const node of ensureArray3(subTnLst["p:set"])) {
|
|
16279
|
-
const cBhvr = node["p:cBhvr"];
|
|
16280
|
-
if (extractAttrNameFromCBhvr(cBhvr) !== "style.visibility") {
|
|
16281
|
-
continue;
|
|
16282
|
-
}
|
|
16283
|
-
const innerCTn = cBhvr?.["p:cTn"];
|
|
16284
|
-
if (!hasAfterEffectFlag(innerCTn)) {
|
|
16285
|
-
continue;
|
|
16286
|
-
}
|
|
16287
|
-
const toNode = node["p:to"];
|
|
16288
|
-
const strVal = toNode?.["p:strVal"]?.["@_val"];
|
|
16289
|
-
if (String(strVal ?? "").toLowerCase() !== "hidden") {
|
|
16290
|
-
continue;
|
|
16291
|
-
}
|
|
16292
|
-
const action = innerCTn?.["@_masterRel"] === "sameClick" ? "hideAfterAnimation" : "hideOnNextClick";
|
|
16293
|
-
return { action };
|
|
16294
|
-
}
|
|
16295
|
-
return void 0;
|
|
16296
|
-
}
|
|
16297
|
-
function extractAfterAnimationFromSubTnLst(cTn) {
|
|
16298
|
-
const subTnLst = cTn["p:subTnLst"];
|
|
16299
|
-
if (!subTnLst) {
|
|
16300
|
-
return void 0;
|
|
16301
|
-
}
|
|
16302
|
-
return findDimBehaviour(subTnLst) ?? findHideBehaviour(subTnLst);
|
|
16303
|
-
}
|
|
16304
|
-
|
|
16305
16620
|
// pptx/core/services/native-animation-cbhvr-attrs.ts
|
|
16306
16621
|
var ADDITIVE_VALUES = /* @__PURE__ */ new Set(["base", "sum", "repl", "mult", "none"]);
|
|
16307
16622
|
var ACCUMULATE_VALUES = /* @__PURE__ */ new Set(["none", "always"]);
|
|
@@ -16444,6 +16759,16 @@ function readTiming(cTn) {
|
|
|
16444
16759
|
return {};
|
|
16445
16760
|
}
|
|
16446
16761
|
const timing = {};
|
|
16762
|
+
const starts = ensureArray3(cTn["p:stCondLst"]?.["p:cond"]);
|
|
16763
|
+
if (starts.length > 1 || cTn["@_dur"] === "indefinite" || cTn["@_repeatCount"] === "indefinite" || cTn["@_repeatDur"] !== void 0 || cTn["p:endCondLst"] !== void 0 || cTn["p:endSync"] !== void 0 || starts.some(
|
|
16764
|
+
(condition) => condition === null || typeof condition !== "object" || condition["@_evt"] !== void 0 || condition["@_tn"] !== void 0 || condition["@_rtn"] !== void 0 || condition["p:tn"] !== void 0 || condition["p:rtn"] !== void 0 || condition["p:tgtEl"] !== void 0 || condition["@_delay"] !== void 0 && !/^\d+$/u.test(String(condition["@_delay"])) || condition["@_delay"] === "indefinite"
|
|
16765
|
+
)) {
|
|
16766
|
+
timing.unsupportedSetTiming = true;
|
|
16767
|
+
}
|
|
16768
|
+
const fill = cTn["@_fill"];
|
|
16769
|
+
if (fill === "remove" || fill === "freeze" || fill === "hold" || fill === "transition") {
|
|
16770
|
+
timing.fill = fill;
|
|
16771
|
+
}
|
|
16447
16772
|
const durationMs = readTimingAttr(cTn["@_dur"]);
|
|
16448
16773
|
if (durationMs !== void 0) {
|
|
16449
16774
|
timing.durationMs = durationMs;
|
|
@@ -16820,6 +17145,7 @@ function buildTimingNodeAnimation(cTn, trigger, group) {
|
|
|
16820
17145
|
commandString: cmdInfo.commandString,
|
|
16821
17146
|
textTarget: textTarget ?? void 0,
|
|
16822
17147
|
cTnAttributes: roundTripAttrs,
|
|
17148
|
+
unsupportedOpacitySetTiming: cTn["@_dur"] === "indefinite" || cTn["p:endSync"] !== void 0 || void 0,
|
|
16823
17149
|
afterEffect: afterEffectFlag,
|
|
16824
17150
|
afterAnimationAction: parsedAfterAnimation?.action,
|
|
16825
17151
|
afterAnimationColor: parsedAfterAnimation?.color,
|
|
@@ -17557,75 +17883,6 @@ function isTransitionElementName(localName15) {
|
|
|
17557
17883
|
return P14_TRANSITION_TYPES.has(localName15) || localName15 === "prstTrans" || localName15 === "morph";
|
|
17558
17884
|
}
|
|
17559
17885
|
|
|
17560
|
-
// pptx/core/services/animation-after-effect-write.ts
|
|
17561
|
-
function applyAfterAnimationBehavior(effectCTn, anim, shapeId) {
|
|
17562
|
-
delete effectCTn["p:subTnLst"];
|
|
17563
|
-
delete effectCTn["@_afterEffect"];
|
|
17564
|
-
if (anim.afterAnimation === "dimToColor" && anim.afterAnimationColor) {
|
|
17565
|
-
effectCTn["p:subTnLst"] = buildDimSubTnLst(shapeId, anim.afterAnimationColor);
|
|
17566
|
-
return;
|
|
17567
|
-
}
|
|
17568
|
-
if (anim.afterAnimation === "hideAfterAnimation") {
|
|
17569
|
-
const entranceId = effectCTn["@_id"] !== void 0 ? String(effectCTn["@_id"]) : "0";
|
|
17570
|
-
effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "sameClick", entranceId);
|
|
17571
|
-
return;
|
|
17572
|
-
}
|
|
17573
|
-
if (anim.afterAnimation === "hideOnNextClick") {
|
|
17574
|
-
effectCTn["p:subTnLst"] = buildHideSubTnLst(shapeId, "nextClick");
|
|
17575
|
-
}
|
|
17576
|
-
}
|
|
17577
|
-
function buildDimSubTnLst(shapeId, colorHex) {
|
|
17578
|
-
const hex3 = colorHex.replace(/^#/u, "").toUpperCase();
|
|
17579
|
-
return {
|
|
17580
|
-
"p:animClr": {
|
|
17581
|
-
"@_clrSpc": "rgb",
|
|
17582
|
-
"@_dir": "cw",
|
|
17583
|
-
"p:cBhvr": {
|
|
17584
|
-
"@_override": "childStyle",
|
|
17585
|
-
"p:cTn": {
|
|
17586
|
-
"@_dur": "1",
|
|
17587
|
-
"@_fill": "hold",
|
|
17588
|
-
"@_display": "0",
|
|
17589
|
-
"@_masterRel": "nextClick",
|
|
17590
|
-
"@_afterEffect": "1"
|
|
17591
|
-
},
|
|
17592
|
-
"p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
|
|
17593
|
-
"p:attrNameLst": { "p:attrName": "ppt_c" }
|
|
17594
|
-
},
|
|
17595
|
-
"p:to": { "a:srgbClr": { "@_val": hex3 } }
|
|
17596
|
-
}
|
|
17597
|
-
};
|
|
17598
|
-
}
|
|
17599
|
-
function buildHideSubTnLst(shapeId, masterRel, entranceId) {
|
|
17600
|
-
const cTn = {
|
|
17601
|
-
"@_dur": "1",
|
|
17602
|
-
"@_fill": "hold",
|
|
17603
|
-
"@_display": "0",
|
|
17604
|
-
"@_masterRel": masterRel,
|
|
17605
|
-
"@_afterEffect": "1"
|
|
17606
|
-
};
|
|
17607
|
-
if (masterRel === "sameClick") {
|
|
17608
|
-
cTn["p:stCondLst"] = {
|
|
17609
|
-
"p:cond": {
|
|
17610
|
-
"@_evt": "end",
|
|
17611
|
-
"@_delay": "0",
|
|
17612
|
-
"p:tn": { "@_val": entranceId ?? "0" }
|
|
17613
|
-
}
|
|
17614
|
-
};
|
|
17615
|
-
}
|
|
17616
|
-
return {
|
|
17617
|
-
"p:set": {
|
|
17618
|
-
"p:cBhvr": {
|
|
17619
|
-
"@_override": "childStyle",
|
|
17620
|
-
"p:cTn": cTn,
|
|
17621
|
-
"p:tgtEl": { "p:spTgt": { "@_spid": shapeId } },
|
|
17622
|
-
"p:attrNameLst": { "p:attrName": "style.visibility" }
|
|
17623
|
-
},
|
|
17624
|
-
"p:to": { "p:strVal": { "@_val": "hidden" } }
|
|
17625
|
-
}
|
|
17626
|
-
};
|
|
17627
|
-
}
|
|
17628
|
-
|
|
17629
17886
|
// pptx/core/services/animation-behavior-captures.json
|
|
17630
17887
|
var animation_behavior_captures_default = {
|
|
17631
17888
|
entr: {
|
|
@@ -35685,6 +35942,33 @@ function updateEffectNodeAttributes(cTn, anim, presetClass, shapeId, allocateId)
|
|
|
35685
35942
|
applySoundToEffectCTn(cTn, anim);
|
|
35686
35943
|
}
|
|
35687
35944
|
function surgicallyUpdateTimingTree(rawTiming, animations) {
|
|
35945
|
+
const sourceRefs = indexEffectNodes(rawTiming);
|
|
35946
|
+
for (const entry2 of animations.filter((animation) => animation.afterAnimation !== void 0)) {
|
|
35947
|
+
if (sourceRefs.filter(
|
|
35948
|
+
(ref) => ref.spid === entry2.elementId && ["entr", "emph"].includes(ref.presetClass)
|
|
35949
|
+
).length > 1)
|
|
35950
|
+
throw new Error(
|
|
35951
|
+
"Cannot edit an ambiguous native after-animation target with multiple effects"
|
|
35952
|
+
);
|
|
35953
|
+
}
|
|
35954
|
+
const explicitClears = new Map(
|
|
35955
|
+
animations.filter((a) => a.afterAnimation !== void 0 && !hasAuthoredAnimationEffect(a)).map((a) => [a.elementId, a])
|
|
35956
|
+
);
|
|
35957
|
+
const clearRefs = sourceRefs.filter(
|
|
35958
|
+
(ref) => ref.spid && explicitClears.has(ref.spid) && (ref.presetClass === "entr" || ref.presetClass === "emph")
|
|
35959
|
+
);
|
|
35960
|
+
for (const target of explicitClears.keys()) {
|
|
35961
|
+
if (!clearRefs.some((ref) => ref.spid === target))
|
|
35962
|
+
throw new Error("Cannot edit after-animation without a supported native effect");
|
|
35963
|
+
if (clearRefs.filter((ref) => ref.spid === target).length > 1)
|
|
35964
|
+
throw new Error(
|
|
35965
|
+
"Cannot clear an ambiguous native after-animation target with multiple effects"
|
|
35966
|
+
);
|
|
35967
|
+
}
|
|
35968
|
+
clearRefs.forEach((ref) => assertAfterAnimationClearSupported(ref.cTn));
|
|
35969
|
+
clearRefs.forEach(
|
|
35970
|
+
(ref) => applyAfterAnimationBehavior(ref.cTn, explicitClears.get(ref.spid), ref.spid)
|
|
35971
|
+
);
|
|
35688
35972
|
const desired = collectDesiredEffects(animations);
|
|
35689
35973
|
const previouslyOwned = readOwnedEffectKeys(rawTiming);
|
|
35690
35974
|
if (desired.length === 0 && previouslyOwned.size === 0) {
|
|
@@ -35779,9 +36063,11 @@ var PptxAnimationWriteService = class {
|
|
|
35779
36063
|
const validAnimations = animations.filter((a) => a.entrance || a.exit || a.emphasis || a.motionPath).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
35780
36064
|
if (existingRawTiming) {
|
|
35781
36065
|
const cloned = typeof structuredClone === "function" ? structuredClone(existingRawTiming) : JSON.parse(JSON.stringify(existingRawTiming));
|
|
35782
|
-
return surgicallyUpdateTimingTree(cloned,
|
|
36066
|
+
return surgicallyUpdateTimingTree(cloned, animations);
|
|
35783
36067
|
}
|
|
35784
36068
|
if (validAnimations.length === 0) {
|
|
36069
|
+
if (animations.some((entry2) => entry2.afterAnimation !== void 0))
|
|
36070
|
+
throw new Error("Cannot edit after-animation without a supported native effect");
|
|
35785
36071
|
return void 0;
|
|
35786
36072
|
}
|
|
35787
36073
|
this.nextId = 1;
|
|
@@ -35956,6 +36242,110 @@ function capturedPresetNativeAnimation(presetClass, presetId, presetSubtype, dur
|
|
|
35956
36242
|
return parsed ? { ...parsed } : void 0;
|
|
35957
36243
|
}
|
|
35958
36244
|
|
|
36245
|
+
// pptx/core/services/editor-animation-after-effect-precedence.ts
|
|
36246
|
+
function applyAfterAnimationFromEditorList(nativeAnimations, editorAnimations) {
|
|
36247
|
+
if (!editorAnimations || editorAnimations.length === 0) {
|
|
36248
|
+
return [...nativeAnimations];
|
|
36249
|
+
}
|
|
36250
|
+
const byElement = /* @__PURE__ */ new Map();
|
|
36251
|
+
for (const ea of editorAnimations) {
|
|
36252
|
+
if (ea.afterAnimation !== void 0) {
|
|
36253
|
+
byElement.set(ea.elementId, ea);
|
|
36254
|
+
}
|
|
36255
|
+
}
|
|
36256
|
+
if (byElement.size === 0) {
|
|
36257
|
+
return [...nativeAnimations];
|
|
36258
|
+
}
|
|
36259
|
+
for (const [id, editor] of byElement) {
|
|
36260
|
+
const matches = nativeAnimations.filter(
|
|
36261
|
+
(native) => native.targetId === id && ["entr", "emph"].includes(native.presetClass ?? "")
|
|
36262
|
+
);
|
|
36263
|
+
if (matches.length > 1)
|
|
36264
|
+
throw new Error(
|
|
36265
|
+
"Cannot edit an ambiguous native after-animation target with multiple effects"
|
|
36266
|
+
);
|
|
36267
|
+
if (matches.length === 0 && !hasAuthoredAnimationEffect(editor))
|
|
36268
|
+
throw new Error("Cannot edit after-animation without a supported native effect");
|
|
36269
|
+
for (const native of matches) {
|
|
36270
|
+
if (native.textTarget || native.target && (native.target.type !== "shape" || native.target.backgroundOnly || native.target.subShapeId || native.target.graphicElement || native.target.oleChartElement))
|
|
36271
|
+
throw new Error("Editing after-animation supports whole-shape targets only");
|
|
36272
|
+
assertAfterAnimationClearSupported({
|
|
36273
|
+
"p:subTnLst": native.cTnAttributes?.["p:subTnLst"]
|
|
36274
|
+
});
|
|
36275
|
+
}
|
|
36276
|
+
}
|
|
36277
|
+
return nativeAnimations.map((anim) => {
|
|
36278
|
+
if (!anim.targetId || !["entr", "emph"].includes(anim.presetClass ?? "")) {
|
|
36279
|
+
return anim;
|
|
36280
|
+
}
|
|
36281
|
+
const ea = byElement.get(anim.targetId);
|
|
36282
|
+
if (!ea) {
|
|
36283
|
+
return anim;
|
|
36284
|
+
}
|
|
36285
|
+
return {
|
|
36286
|
+
...anim,
|
|
36287
|
+
afterAnimationAction: ea.afterAnimation === "none" ? void 0 : ea.afterAnimation,
|
|
36288
|
+
afterAnimationColor: ea.afterAnimationColor,
|
|
36289
|
+
// The editor's own model has no theme-colour-ref concept (it always
|
|
36290
|
+
// writes a concrete hex); clear a native scheme ref so a stale one
|
|
36291
|
+
// never survives an edit that overrides the colour.
|
|
36292
|
+
afterAnimationColorRef: void 0
|
|
36293
|
+
};
|
|
36294
|
+
});
|
|
36295
|
+
}
|
|
36296
|
+
|
|
36297
|
+
// pptx/core/services/animation-opacity-set.ts
|
|
36298
|
+
var holds = (fill) => fill === "hold" || fill === "freeze";
|
|
36299
|
+
function resolveOpacitySet(anim) {
|
|
36300
|
+
if (anim.unsupportedOpacitySetTiming || anim.endConditions?.length || anim.rawEndCondLst !== void 0 || anim.cTnAttributes?.["@_tmFilter"] !== void 0 || anim.cTnAttributes?.["@_endSync"] !== void 0)
|
|
36301
|
+
return void 0;
|
|
36302
|
+
if (anim.afterAnimationAction !== void 0) return void 0;
|
|
36303
|
+
if (anim.target?.type === "shape" && (anim.target.backgroundOnly || anim.target.subShapeId || anim.target.graphicElement || anim.target.oleChartElement))
|
|
36304
|
+
return void 0;
|
|
36305
|
+
if (anim.textTarget || anim.target && anim.target.type !== "shape" || anim.trigger === "onHover")
|
|
36306
|
+
return void 0;
|
|
36307
|
+
if (anim.presetClass !== "emph" || anim.autoReverse || (anim.repeatCount ?? 1) !== 1 || anim.repeatDurMs !== void 0)
|
|
36308
|
+
return void 0;
|
|
36309
|
+
const behaviors = anim.behaviors;
|
|
36310
|
+
if (!behaviors?.length || behaviors.some(
|
|
36311
|
+
(b) => b.kind !== "set" && !(b.kind === "animEffect" && b.filter === "image" && (b.transition === void 0 || b.transition === "none"))
|
|
36312
|
+
))
|
|
36313
|
+
return void 0;
|
|
36314
|
+
const sets = behaviors.filter((b) => b.kind === "set");
|
|
36315
|
+
if (sets.length !== 1) return void 0;
|
|
36316
|
+
const hints = behaviors.filter((b) => b.kind === "animEffect");
|
|
36317
|
+
if (hints.length > 1) return void 0;
|
|
36318
|
+
const hint = hints[0];
|
|
36319
|
+
if (hint && (hint.timing.unsupportedSetTiming || hint.timing.autoReverse || (hint.timing.repeatCount ?? 1) !== 1 || hint.timing.tmFilter !== void 0))
|
|
36320
|
+
return void 0;
|
|
36321
|
+
const set = sets[0];
|
|
36322
|
+
if (set.attrNames.length !== 1 || set.attrNames[0] !== "style.opacity" || set.additive !== void 0 && !["base", "repl", "none"].includes(set.additive))
|
|
36323
|
+
return void 0;
|
|
36324
|
+
const raw = set.value;
|
|
36325
|
+
if (typeof raw !== "number" && (typeof raw !== "string" || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/u.test(raw.trim())))
|
|
36326
|
+
return void 0;
|
|
36327
|
+
const value = Number(raw);
|
|
36328
|
+
const { timing } = set;
|
|
36329
|
+
if (timing.unsupportedSetTiming) return void 0;
|
|
36330
|
+
if (anim.fill === "transition" || timing.fill === "transition") return void 0;
|
|
36331
|
+
if (!Number.isFinite(value) || value < 0 || value > 1 || timing.autoReverse || (timing.repeatCount ?? 1) !== 1 || timing.tmFilter !== void 0)
|
|
36332
|
+
return void 0;
|
|
36333
|
+
const delayMs = timing.delayMs ?? 0;
|
|
36334
|
+
const durationMs = timing.durationMs;
|
|
36335
|
+
if (!Number.isFinite(delayMs) || delayMs < 0 || durationMs === void 0 || !Number.isFinite(durationMs) || durationMs < 0)
|
|
36336
|
+
return void 0;
|
|
36337
|
+
const effectDuration = anim.durationMs ?? delayMs + durationMs;
|
|
36338
|
+
if (!Number.isFinite(effectDuration) || effectDuration < delayMs || (anim.speedPct ?? 100) !== 100)
|
|
36339
|
+
return void 0;
|
|
36340
|
+
const holdEndState = holds(anim.fill) && holds(timing.fill);
|
|
36341
|
+
return {
|
|
36342
|
+
value,
|
|
36343
|
+
delayMs,
|
|
36344
|
+
durationMs: holds(timing.fill) ? effectDuration - delayMs : Math.min(durationMs, effectDuration - delayMs),
|
|
36345
|
+
holdEndState
|
|
36346
|
+
};
|
|
36347
|
+
}
|
|
36348
|
+
|
|
35959
36349
|
// pptx/core/utils/xml-namespace-declarations.ts
|
|
35960
36350
|
var WELL_KNOWN_NAMESPACES = {
|
|
35961
36351
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
@@ -37295,6 +37685,323 @@ function applyHeaderFooterToMaster(masterRoot, headerFooter) {
|
|
|
37295
37685
|
}
|
|
37296
37686
|
}
|
|
37297
37687
|
|
|
37688
|
+
// pptx/core/utils/chart-xlsx-write-validation.ts
|
|
37689
|
+
function unsupported(reason) {
|
|
37690
|
+
throw new Error(`Chart label replacement requires direct literal workbook cells: ${reason}.`);
|
|
37691
|
+
}
|
|
37692
|
+
async function validateAtomicChartWorkbookWrites(zip, parser, paths, writes, requireCurrentValues = false) {
|
|
37693
|
+
const relationships2 = xmlChild(
|
|
37694
|
+
parser.parse(
|
|
37695
|
+
await zip.file("xl/_rels/workbook.xml.rels")?.async("string") ?? ""
|
|
37696
|
+
),
|
|
37697
|
+
"Relationships"
|
|
37698
|
+
);
|
|
37699
|
+
for (const rel of xmlChildren(relationships2, "Relationship")) {
|
|
37700
|
+
if (xmlAttr(rel, "TargetMode") === "External") {
|
|
37701
|
+
unsupported("external worksheet relationships are not supported");
|
|
37702
|
+
}
|
|
37703
|
+
}
|
|
37704
|
+
const sheets = /* @__PURE__ */ new Map();
|
|
37705
|
+
const cellsByPath = /* @__PURE__ */ new Map();
|
|
37706
|
+
for (const path2 of new Set(paths.values())) {
|
|
37707
|
+
const file = zip.file(path2);
|
|
37708
|
+
if (!file) {
|
|
37709
|
+
unsupported("a referenced worksheet is missing");
|
|
37710
|
+
}
|
|
37711
|
+
let tree;
|
|
37712
|
+
try {
|
|
37713
|
+
tree = parser.parse(await file.async("string"));
|
|
37714
|
+
} catch {
|
|
37715
|
+
unsupported("a worksheet cannot be parsed");
|
|
37716
|
+
}
|
|
37717
|
+
const data = xmlChild(xmlChild(tree, "worksheet"), "sheetData");
|
|
37718
|
+
if (!data) {
|
|
37719
|
+
unsupported("a worksheet has no cell data");
|
|
37720
|
+
}
|
|
37721
|
+
if (Object.keys(data).some((key2) => key2.includes(":"))) {
|
|
37722
|
+
unsupported("prefixed worksheet cell nodes are not supported");
|
|
37723
|
+
}
|
|
37724
|
+
const cells2 = /* @__PURE__ */ new Map();
|
|
37725
|
+
for (const row of xmlChildren(data, "row")) {
|
|
37726
|
+
if (Object.keys(row).some((key2) => key2.includes(":"))) {
|
|
37727
|
+
unsupported("prefixed worksheet cell nodes are not supported");
|
|
37728
|
+
}
|
|
37729
|
+
for (const cell of xmlChildren(row, "c")) {
|
|
37730
|
+
const ref = xmlAttr(cell, "r");
|
|
37731
|
+
if (!ref || cells2.has(ref)) {
|
|
37732
|
+
unsupported("duplicate or unidentified worksheet cells are not supported");
|
|
37733
|
+
}
|
|
37734
|
+
cells2.set(ref, cell);
|
|
37735
|
+
if (Object.keys(cell).some((key2) => key2 === "f" || key2.endsWith(":f"))) {
|
|
37736
|
+
unsupported("formula-dependent workbooks are not supported");
|
|
37737
|
+
}
|
|
37738
|
+
}
|
|
37739
|
+
}
|
|
37740
|
+
sheets.set(path2, data);
|
|
37741
|
+
cellsByPath.set(path2, cells2);
|
|
37742
|
+
}
|
|
37743
|
+
const sharedFile = zip.file("xl/sharedStrings.xml");
|
|
37744
|
+
const shared = sharedFile ? xmlChildren(
|
|
37745
|
+
xmlChild(parser.parse(await sharedFile.async("string")), "sst"),
|
|
37746
|
+
"si"
|
|
37747
|
+
) : [];
|
|
37748
|
+
const destinations = /* @__PURE__ */ new Map();
|
|
37749
|
+
for (const write of writes) {
|
|
37750
|
+
const range = parseChartFormulaRange(write.formula);
|
|
37751
|
+
if (!range || /[\[\]:!]/u.test(range.sheetName)) {
|
|
37752
|
+
unsupported("a range is not a direct local reference");
|
|
37753
|
+
}
|
|
37754
|
+
if ([range.start, range.end].some(
|
|
37755
|
+
(cell) => cell.row < 0 || cell.row >= 1048576 || cell.col < 0 || cell.col >= 16384
|
|
37756
|
+
)) {
|
|
37757
|
+
unsupported("a source cell lies outside the worksheet limits");
|
|
37758
|
+
}
|
|
37759
|
+
const addresses = expandRangeAddresses(range, write.values.length);
|
|
37760
|
+
const path2 = paths.get(range.sheetName.toLowerCase());
|
|
37761
|
+
const data = path2 ? sheets.get(path2) : void 0;
|
|
37762
|
+
if (!addresses || !path2 || !data) {
|
|
37763
|
+
unsupported("a source range cannot be resolved");
|
|
37764
|
+
}
|
|
37765
|
+
for (const [index, address] of addresses.entries()) {
|
|
37766
|
+
const value = write.values[index];
|
|
37767
|
+
const key2 = `${path2}!${address}`;
|
|
37768
|
+
const prior = destinations.get(key2);
|
|
37769
|
+
if (prior && (prior.value !== value || prior.numeric !== write.isNumeric)) {
|
|
37770
|
+
unsupported("overlapping source ranges request conflicting values");
|
|
37771
|
+
}
|
|
37772
|
+
destinations.set(key2, { value, numeric: write.isNumeric });
|
|
37773
|
+
const cell = cellsByPath.get(path2)?.get(address);
|
|
37774
|
+
if (!cell) {
|
|
37775
|
+
unsupported("a source cell is missing");
|
|
37776
|
+
}
|
|
37777
|
+
const type = xmlAttr(cell, "t") ?? "n";
|
|
37778
|
+
const text = type === "s" ? shared[Number(xmlText(cell.v))] : xmlChild(cell, "is");
|
|
37779
|
+
if (text && Object.keys(text).some((node) => !node.startsWith("@_") && node !== "t" && node !== "#text")) {
|
|
37780
|
+
unsupported("rich worksheet strings require source-workbook editing");
|
|
37781
|
+
}
|
|
37782
|
+
if (requireCurrentValues) {
|
|
37783
|
+
const current = text ? xmlText(text.t) : xmlText(cell.v);
|
|
37784
|
+
const equal = write.isNumeric ? current !== void 0 && Number(current) === Number(value) : current === value;
|
|
37785
|
+
if (!equal) {
|
|
37786
|
+
unsupported("the workbook and chart caches disagree");
|
|
37787
|
+
}
|
|
37788
|
+
}
|
|
37789
|
+
if (write.isNumeric && !Number.isFinite(Number(value))) {
|
|
37790
|
+
unsupported("a numeric cache value is not finite");
|
|
37791
|
+
}
|
|
37792
|
+
if (!["n", "s", "inlineStr", "str"].includes(type)) {
|
|
37793
|
+
unsupported("a source cell has an unsupported value type");
|
|
37794
|
+
}
|
|
37795
|
+
}
|
|
37796
|
+
}
|
|
37797
|
+
}
|
|
37798
|
+
|
|
37799
|
+
// pptx/core/utils/chart-xlsx-writer.ts
|
|
37800
|
+
function collectChartWorkbookWrite(xmlLookupService, container, isNumeric2, values) {
|
|
37801
|
+
if (!container) {
|
|
37802
|
+
return void 0;
|
|
37803
|
+
}
|
|
37804
|
+
const refNode = xmlLookupService.getChildByLocalName(container, isNumeric2 ? "numRef" : "strRef");
|
|
37805
|
+
const formula = refNode ? xmlLookupService.getScalarChildByLocalName(refNode, "f") : void 0;
|
|
37806
|
+
return formula ? { formula, isNumeric: isNumeric2, values } : void 0;
|
|
37807
|
+
}
|
|
37808
|
+
function createSpreadsheetXmlParser() {
|
|
37809
|
+
return new XMLParser({
|
|
37810
|
+
ignoreAttributes: false,
|
|
37811
|
+
attributeNamePrefix: "@_",
|
|
37812
|
+
trimValues: false,
|
|
37813
|
+
parseTagValue: false,
|
|
37814
|
+
tagValueProcessor: (tagName, tagValue) => preservesSpreadsheetXmlWhitespace(tagName) ? tagValue : tagValue.trim()
|
|
37815
|
+
});
|
|
37816
|
+
}
|
|
37817
|
+
function createSpreadsheetXmlBuilder() {
|
|
37818
|
+
return new XMLBuilder({
|
|
37819
|
+
ignoreAttributes: false,
|
|
37820
|
+
attributeNamePrefix: "@_",
|
|
37821
|
+
suppressBooleanAttributes: false,
|
|
37822
|
+
format: false
|
|
37823
|
+
});
|
|
37824
|
+
}
|
|
37825
|
+
async function resolveWorksheetPathsByName(xlsxZip, parser) {
|
|
37826
|
+
const result = /* @__PURE__ */ new Map();
|
|
37827
|
+
const workbookFile = xlsxZip.file("xl/workbook.xml");
|
|
37828
|
+
const relsFile = xlsxZip.file("xl/_rels/workbook.xml.rels");
|
|
37829
|
+
if (!workbookFile || !relsFile) {
|
|
37830
|
+
return result;
|
|
37831
|
+
}
|
|
37832
|
+
try {
|
|
37833
|
+
const workbookTree = parser.parse(await workbookFile.async("string"));
|
|
37834
|
+
const relsTree = parser.parse(await relsFile.async("string"));
|
|
37835
|
+
const targetByRelId = /* @__PURE__ */ new Map();
|
|
37836
|
+
const relationships2 = xmlChild(relsTree, "Relationships");
|
|
37837
|
+
for (const rel of xmlChildren(relationships2, "Relationship")) {
|
|
37838
|
+
const id = xmlAttr(rel, "Id");
|
|
37839
|
+
const target = xmlAttr(rel, "Target");
|
|
37840
|
+
if (id && target) {
|
|
37841
|
+
targetByRelId.set(id, target);
|
|
37842
|
+
}
|
|
37843
|
+
}
|
|
37844
|
+
const workbookRoot = xmlChild(workbookTree, "workbook");
|
|
37845
|
+
const sheets = xmlChild(workbookRoot, "sheets");
|
|
37846
|
+
for (const sheet of xmlChildren(sheets, "sheet")) {
|
|
37847
|
+
const name = xmlAttr(sheet, "name");
|
|
37848
|
+
const relId = xmlAttr(sheet, "r:id") ?? xmlAttr(sheet, "id");
|
|
37849
|
+
const target = relId ? targetByRelId.get(relId) : void 0;
|
|
37850
|
+
if (name && target) {
|
|
37851
|
+
result.set(name.toLowerCase(), resolveWorkbookPartPath(target));
|
|
37852
|
+
}
|
|
37853
|
+
}
|
|
37854
|
+
} catch {
|
|
37855
|
+
}
|
|
37856
|
+
return result;
|
|
37857
|
+
}
|
|
37858
|
+
function resolveWorkbookPartPath(target) {
|
|
37859
|
+
return target.startsWith("/") ? target.slice(1) : `xl/${target}`;
|
|
37860
|
+
}
|
|
37861
|
+
async function writeChartWorkbookUpdates(xlsxBytes, writes, options = {}) {
|
|
37862
|
+
if (writes.length === 0) {
|
|
37863
|
+
return { unresolved: 0 };
|
|
37864
|
+
}
|
|
37865
|
+
let xlsxZip;
|
|
37866
|
+
try {
|
|
37867
|
+
xlsxZip = await JSZip5.loadAsync(xlsxBytes);
|
|
37868
|
+
} catch {
|
|
37869
|
+
if (options.atomic) {
|
|
37870
|
+
throw new Error("Chart label replacement requires a readable embedded workbook.");
|
|
37871
|
+
}
|
|
37872
|
+
return { unresolved: writes.length };
|
|
37873
|
+
}
|
|
37874
|
+
const parser = createSpreadsheetXmlParser();
|
|
37875
|
+
const sheetPathByName = await resolveWorksheetPathsByName(xlsxZip, parser);
|
|
37876
|
+
if (options.atomic) {
|
|
37877
|
+
await validateAtomicChartWorkbookWrites(
|
|
37878
|
+
xlsxZip,
|
|
37879
|
+
parser,
|
|
37880
|
+
sheetPathByName,
|
|
37881
|
+
writes,
|
|
37882
|
+
options.requireCurrentValues ?? false
|
|
37883
|
+
);
|
|
37884
|
+
}
|
|
37885
|
+
const writesBySheetPath = /* @__PURE__ */ new Map();
|
|
37886
|
+
let unresolved = 0;
|
|
37887
|
+
for (const write of writes) {
|
|
37888
|
+
const range = parseChartFormulaRange(write.formula);
|
|
37889
|
+
const sheetPath = range ? sheetPathByName.get(range.sheetName.toLowerCase()) : void 0;
|
|
37890
|
+
const refs = range ? expandRangeAddresses(range, write.values.length) : void 0;
|
|
37891
|
+
if (!range || !sheetPath || !refs) {
|
|
37892
|
+
unresolved += 1;
|
|
37893
|
+
continue;
|
|
37894
|
+
}
|
|
37895
|
+
const bucket = writesBySheetPath.get(sheetPath) ?? [];
|
|
37896
|
+
bucket.push({ refs, values: write.values, isNumeric: write.isNumeric });
|
|
37897
|
+
writesBySheetPath.set(sheetPath, bucket);
|
|
37898
|
+
}
|
|
37899
|
+
const builder = createSpreadsheetXmlBuilder();
|
|
37900
|
+
let changedAny = false;
|
|
37901
|
+
for (const [sheetPath, resolvedWrites] of writesBySheetPath) {
|
|
37902
|
+
const sheetFile = xlsxZip.file(sheetPath);
|
|
37903
|
+
if (!sheetFile) {
|
|
37904
|
+
unresolved += resolvedWrites.length;
|
|
37905
|
+
continue;
|
|
37906
|
+
}
|
|
37907
|
+
try {
|
|
37908
|
+
const sheetTree = parser.parse(await sheetFile.async("string"));
|
|
37909
|
+
const cellWrites = resolvedWrites.flatMap(
|
|
37910
|
+
({ refs, values, isNumeric: isNumeric2 }) => refs.map((ref, i) => ({ ref, isNumeric: isNumeric2, value: values[i] }))
|
|
37911
|
+
);
|
|
37912
|
+
if (applyCellWritesToWorksheet(sheetTree, cellWrites)) {
|
|
37913
|
+
xlsxZip.file(sheetPath, builder.build(sheetTree));
|
|
37914
|
+
changedAny = true;
|
|
37915
|
+
}
|
|
37916
|
+
} catch {
|
|
37917
|
+
unresolved += resolvedWrites.length;
|
|
37918
|
+
}
|
|
37919
|
+
}
|
|
37920
|
+
if (options.atomic && unresolved > 0) {
|
|
37921
|
+
throw new Error("Chart label replacement could not update every source range.");
|
|
37922
|
+
}
|
|
37923
|
+
if (!changedAny) {
|
|
37924
|
+
return { unresolved };
|
|
37925
|
+
}
|
|
37926
|
+
const bytes = await xlsxZip.generateAsync({
|
|
37927
|
+
type: "uint8array",
|
|
37928
|
+
compression: "DEFLATE",
|
|
37929
|
+
compressionOptions: { level: 6 }
|
|
37930
|
+
});
|
|
37931
|
+
return { bytes, unresolved };
|
|
37932
|
+
}
|
|
37933
|
+
|
|
37934
|
+
// pptx/core/utils/chart-label-source.ts
|
|
37935
|
+
function formulaCount(value) {
|
|
37936
|
+
if (!value || typeof value !== "object") return 0;
|
|
37937
|
+
if (Array.isArray(value)) return value.reduce((total, item) => total + formulaCount(item), 0);
|
|
37938
|
+
return Object.entries(value).reduce(
|
|
37939
|
+
(total, [key2, child14]) => total + (key2 === "f" || key2.endsWith(":f") ? 1 : formulaCount(child14)),
|
|
37940
|
+
0
|
|
37941
|
+
);
|
|
37942
|
+
}
|
|
37943
|
+
async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes, series, categories, external, chartPartPath, resolve) {
|
|
37944
|
+
if (!chartSpace || seriesNodes.length !== series.length || !categories.length || external?.isExternal)
|
|
37945
|
+
return false;
|
|
37946
|
+
if (formulaCount(chartSpace) !== seriesNodes.reduce((sum, node) => sum + formulaCount(node), 0))
|
|
37947
|
+
return false;
|
|
37948
|
+
const writes = [];
|
|
37949
|
+
const labelOwners = /* @__PURE__ */ new Map();
|
|
37950
|
+
for (const [index, node] of seriesNodes.entries()) {
|
|
37951
|
+
const entry2 = series[index];
|
|
37952
|
+
for (const [name, numeric, values] of [
|
|
37953
|
+
["tx", false, [entry2.name]],
|
|
37954
|
+
["cat", false, [...categories]],
|
|
37955
|
+
["val", true, entry2.values.map(String)]
|
|
37956
|
+
]) {
|
|
37957
|
+
const container = xml.getChildByLocalName(node, name);
|
|
37958
|
+
if (!container) return false;
|
|
37959
|
+
const write = collectChartWorkbookWrite(xml, container, numeric, [...values]);
|
|
37960
|
+
if (write) {
|
|
37961
|
+
writes.push(write);
|
|
37962
|
+
if (!numeric) {
|
|
37963
|
+
const range = parseChartFormulaRange(write.formula);
|
|
37964
|
+
const addresses = range ? expandRangeAddresses(range, values.length) : void 0;
|
|
37965
|
+
if (!range || !addresses) return false;
|
|
37966
|
+
for (const [point, address] of addresses.entries()) {
|
|
37967
|
+
const key2 = `${range.sheetName.toLowerCase()}!${address}`;
|
|
37968
|
+
const owner = name === "tx" ? `series:${index}` : `category:${point}`;
|
|
37969
|
+
if (labelOwners.has(key2) && labelOwners.get(key2) !== owner) return false;
|
|
37970
|
+
labelOwners.set(key2, owner);
|
|
37971
|
+
}
|
|
37972
|
+
}
|
|
37973
|
+
} else if (external || !xml.getChildByLocalName(container, numeric ? "numLit" : "strLit") && !(name === "tx" && xml.getScalarChildByLocalName(container, "v") !== void 0))
|
|
37974
|
+
return false;
|
|
37975
|
+
}
|
|
37976
|
+
}
|
|
37977
|
+
if (formulaCount(chartSpace) !== writes.length) return false;
|
|
37978
|
+
if (!external) return writes.length === 0;
|
|
37979
|
+
if (!external.targetPath || !external.embeddedWorkbookData) return false;
|
|
37980
|
+
const target = resolve(chartPartPath, external.targetPath);
|
|
37981
|
+
let references = 0;
|
|
37982
|
+
const parser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
37983
|
+
try {
|
|
37984
|
+
for (const path2 of Object.keys(zip.files)) {
|
|
37985
|
+
if (!path2.endsWith(".rels") || !path2.includes("/_rels/")) continue;
|
|
37986
|
+
const source = path2.replace("/_rels/", "/").slice(0, -5);
|
|
37987
|
+
const tree = parser.parse(await zip.file(path2).async("string"));
|
|
37988
|
+
for (const rel of xmlChildren(xmlChild(tree, "Relationships"), "Relationship")) {
|
|
37989
|
+
const relationshipTarget2 = xmlAttr(rel, "Target");
|
|
37990
|
+
if (relationshipTarget2 && xmlAttr(rel, "TargetMode") !== "External" && resolve(source, relationshipTarget2) === target)
|
|
37991
|
+
references++;
|
|
37992
|
+
}
|
|
37993
|
+
}
|
|
37994
|
+
if (references !== 1) return false;
|
|
37995
|
+
await writeChartWorkbookUpdates(external.embeddedWorkbookData, writes, {
|
|
37996
|
+
atomic: true,
|
|
37997
|
+
requireCurrentValues: true
|
|
37998
|
+
});
|
|
37999
|
+
return true;
|
|
38000
|
+
} catch {
|
|
38001
|
+
return false;
|
|
38002
|
+
}
|
|
38003
|
+
}
|
|
38004
|
+
|
|
37298
38005
|
// pptx/core/utils/chart-band-fmts.ts
|
|
37299
38006
|
function safeUnsignedInt(val) {
|
|
37300
38007
|
const n = Number(val);
|
|
@@ -42485,7 +43192,7 @@ function saveModernSlideComments(init) {
|
|
|
42485
43192
|
rawXml: init.slide.modernCommentPart?.rawXml
|
|
42486
43193
|
};
|
|
42487
43194
|
}
|
|
42488
|
-
var
|
|
43195
|
+
var nextRelationshipId2 = (relationships2) => {
|
|
42489
43196
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] || "")));
|
|
42490
43197
|
let index = 1;
|
|
42491
43198
|
while (used.has(`rId${index}`)) {
|
|
@@ -42528,7 +43235,7 @@ async function persistModernCommentPackage(init) {
|
|
|
42528
43235
|
authorPath,
|
|
42529
43236
|
init.xmlBuilder.build(buildModernAuthorPart(init.authors, init.authorRoot))
|
|
42530
43237
|
);
|
|
42531
|
-
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") ||
|
|
43238
|
+
relationshipId = init.authorRelationshipId || String(existing?.["@_Id"] || "") || nextRelationshipId2(retained);
|
|
42532
43239
|
retained.push({
|
|
42533
43240
|
...existing || {},
|
|
42534
43241
|
"@_Id": relationshipId,
|
|
@@ -43950,7 +44657,7 @@ function buildContentTypesXml(overrides) {
|
|
|
43950
44657
|
}
|
|
43951
44658
|
async function buildMetroBlobPackage(input) {
|
|
43952
44659
|
const root = ROOT[input.kind];
|
|
43953
|
-
const zip = new
|
|
44660
|
+
const zip = new JSZip5();
|
|
43954
44661
|
const overrides = new Map([
|
|
43955
44662
|
[root.path, root.contentType],
|
|
43956
44663
|
...input.parts.contentTypes,
|
|
@@ -44239,7 +44946,7 @@ async function buildOne(zip, slidePath, slideXml3, element) {
|
|
|
44239
44946
|
});
|
|
44240
44947
|
}
|
|
44241
44948
|
async function buildMetroBlobs(pptxBytes, slides) {
|
|
44242
|
-
const zip = await
|
|
44949
|
+
const zip = await JSZip5.loadAsync(pptxBytes);
|
|
44243
44950
|
const slidePaths = await orderedSlidePaths(zip);
|
|
44244
44951
|
const out = /* @__PURE__ */ new Map();
|
|
44245
44952
|
for (let i = 0; i < slides.length; i++) {
|
|
@@ -46856,7 +47563,7 @@ function withDeclaration(xml) {
|
|
|
46856
47563
|
${body}`;
|
|
46857
47564
|
}
|
|
46858
47565
|
async function zipParts(parts) {
|
|
46859
|
-
const zip = new
|
|
47566
|
+
const zip = new JSZip5();
|
|
46860
47567
|
for (const [name, text] of parts) {
|
|
46861
47568
|
zip.file(name, text);
|
|
46862
47569
|
}
|
|
@@ -46903,7 +47610,7 @@ async function buildMasterRoundTrip(source) {
|
|
|
46903
47610
|
};
|
|
46904
47611
|
}
|
|
46905
47612
|
async function buildDeckMasterRoundTripsFromPptx(pptxBytes) {
|
|
46906
|
-
const zip = await
|
|
47613
|
+
const zip = await JSZip5.loadAsync(pptxBytes);
|
|
46907
47614
|
const slidePaths = await readSlideMasterPaths(zip);
|
|
46908
47615
|
const masterPaths = [...new Set(slidePaths)];
|
|
46909
47616
|
if (masterPaths.length === 0) {
|
|
@@ -49541,7 +50248,7 @@ function upsertRelationship(relationships2, entry2, target) {
|
|
|
49541
50248
|
(item) => String(item["@_Id"] ?? "") === entry2.relId && isCustomXmlRelationship(item["@_Type"])
|
|
49542
50249
|
);
|
|
49543
50250
|
if (!relationship) {
|
|
49544
|
-
entry2.relId =
|
|
50251
|
+
entry2.relId = nextRelationshipId3(relationships2);
|
|
49545
50252
|
relationship = {};
|
|
49546
50253
|
relationships2.push(relationship);
|
|
49547
50254
|
}
|
|
@@ -49609,7 +50316,7 @@ function relativeTarget2(source, target) {
|
|
|
49609
50316
|
}
|
|
49610
50317
|
return [...from.map(() => ".."), ...to].join("/");
|
|
49611
50318
|
}
|
|
49612
|
-
function
|
|
50319
|
+
function nextRelationshipId3(relationships2) {
|
|
49613
50320
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
49614
50321
|
let index = 1;
|
|
49615
50322
|
while (used.has(`rId${index}`)) {
|
|
@@ -49855,7 +50562,7 @@ async function upsertTagRelationship(zip, codec, collection) {
|
|
|
49855
50562
|
(entry2) => String(entry2["@_Id"] ?? "") === collection.relationshipId && String(entry2["@_Type"] ?? "") === TAG_RELATIONSHIP_TYPE
|
|
49856
50563
|
);
|
|
49857
50564
|
if (!relationship) {
|
|
49858
|
-
collection.relationshipId =
|
|
50565
|
+
collection.relationshipId = nextRelationshipId4(relationships2);
|
|
49859
50566
|
relationship = {};
|
|
49860
50567
|
relationships2.push(relationship);
|
|
49861
50568
|
}
|
|
@@ -49914,7 +50621,7 @@ function relativeTarget3(source, target) {
|
|
|
49914
50621
|
}
|
|
49915
50622
|
return [...from.map(() => ".."), ...to].join("/");
|
|
49916
50623
|
}
|
|
49917
|
-
function
|
|
50624
|
+
function nextRelationshipId4(relationships2) {
|
|
49918
50625
|
const used = new Set(relationships2.map((entry2) => String(entry2["@_Id"] ?? "")));
|
|
49919
50626
|
let index = 1;
|
|
49920
50627
|
while (used.has(`rId${index}`)) {
|
|
@@ -49932,6 +50639,14 @@ function ensureArray9(value) {
|
|
|
49932
50639
|
return Array.isArray(value) ? value : [value];
|
|
49933
50640
|
}
|
|
49934
50641
|
|
|
50642
|
+
// pptx/core/utils/chart-workbook-data-signature.ts
|
|
50643
|
+
function chartWorkbookDataSignature(data) {
|
|
50644
|
+
return JSON.stringify({
|
|
50645
|
+
categories: data.dateCategories?.values ?? data.categories,
|
|
50646
|
+
series: data.series.map((series) => ({ name: series.name, values: series.values }))
|
|
50647
|
+
});
|
|
50648
|
+
}
|
|
50649
|
+
|
|
49935
50650
|
// pptx/core/utils/chart-axis-deleted.ts
|
|
49936
50651
|
function authoredDeleted(node) {
|
|
49937
50652
|
if (node === void 0) {
|
|
@@ -50119,8 +50834,8 @@ function buildDefRPr(style, existing, resolveColor2) {
|
|
|
50119
50834
|
return rPr;
|
|
50120
50835
|
}
|
|
50121
50836
|
function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveColor2) {
|
|
50122
|
-
const
|
|
50123
|
-
if (!
|
|
50837
|
+
const hasAny2 = style.fontFamily !== void 0 || style.fontSize !== void 0 || style.fontBold !== void 0 || style.fontColor !== void 0;
|
|
50838
|
+
if (!hasAny2) {
|
|
50124
50839
|
return;
|
|
50125
50840
|
}
|
|
50126
50841
|
const titleKey = findKey(axisNode, "title", getLocalName2);
|
|
@@ -50961,6 +51676,28 @@ function realignOrCollapseTitleRuns(staleRuns, newTitle) {
|
|
|
50961
51676
|
return [{ ...staleRuns[0], text: newTitle }];
|
|
50962
51677
|
}
|
|
50963
51678
|
|
|
51679
|
+
// pptx/core/utils/chart-title-text-edit.ts
|
|
51680
|
+
function patchChartTitleRunText(title, runs, local) {
|
|
51681
|
+
const tx = title[findKey(title, "tx", local) ?? ""];
|
|
51682
|
+
const rich = tx?.[findKey(tx, "rich", local) ?? ""];
|
|
51683
|
+
const raw = rich?.[findKey(rich, "p", local) ?? ""];
|
|
51684
|
+
const paragraphs = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
51685
|
+
if (paragraphs.length !== 1) return false;
|
|
51686
|
+
const paragraph = paragraphs[0];
|
|
51687
|
+
if (findKey(paragraph, "br", local) || findKey(paragraph, "fld", local)) return false;
|
|
51688
|
+
const rawRuns = paragraph[findKey(paragraph, "r", local) ?? ""];
|
|
51689
|
+
const original = Array.isArray(rawRuns) ? rawRuns : rawRuns ? [rawRuns] : [];
|
|
51690
|
+
if (original.length !== runs.length) return false;
|
|
51691
|
+
const keys = original.map((run) => findKey(run, "t", local));
|
|
51692
|
+
if (keys.some((key2) => !key2)) return false;
|
|
51693
|
+
for (const [index, value] of original.entries()) {
|
|
51694
|
+
const run = value, key2 = keys[index];
|
|
51695
|
+
const text = run[key2];
|
|
51696
|
+
run[key2] = text && typeof text === "object" && !Array.isArray(text) ? { ...text, "#text": runs[index].text } : runs[index].text;
|
|
51697
|
+
}
|
|
51698
|
+
return true;
|
|
51699
|
+
}
|
|
51700
|
+
|
|
50964
51701
|
// pptx/core/utils/chart-title-serializer.ts
|
|
50965
51702
|
function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefix: "c" }) {
|
|
50966
51703
|
const { prefix } = options;
|
|
@@ -50986,11 +51723,18 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
|
|
|
50986
51723
|
runs = realignOrCollapseTitleRuns(staleRuns, model.title);
|
|
50987
51724
|
}
|
|
50988
51725
|
let titleNode = existingKey ? chartRoot[existingKey] : void 0;
|
|
51726
|
+
const textOnlyStylesMatch = Boolean(
|
|
51727
|
+
runs && model.titleTextOnlyStyles?.length === runs.length && runs.every(
|
|
51728
|
+
(run, index) => ["bold", "italic", "fontSize", "color"].every(
|
|
51729
|
+
(key2) => run[key2] === model.titleTextOnlyStyles[index][key2]
|
|
51730
|
+
)
|
|
51731
|
+
)
|
|
51732
|
+
);
|
|
50989
51733
|
if (runs && titleNode && typeof titleNode === "object") {
|
|
50990
51734
|
const existingTexts = [];
|
|
50991
51735
|
collectAllText(titleNode, getLocalName2, existingTexts);
|
|
50992
51736
|
const newTexts = runs.map((run) => run.text);
|
|
50993
|
-
if (existingTexts.length === newTexts.length && existingTexts.every((text, index) => text === newTexts[index])) {
|
|
51737
|
+
if ((!model.titleTextOnly || textOnlyStylesMatch) && existingTexts.length === newTexts.length && existingTexts.every((text, index) => text === newTexts[index])) {
|
|
50994
51738
|
runs = void 0;
|
|
50995
51739
|
}
|
|
50996
51740
|
}
|
|
@@ -51002,6 +51746,12 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
|
|
|
51002
51746
|
insertAt(chartRoot, 0, `${prefix}:title`, titleNode);
|
|
51003
51747
|
}
|
|
51004
51748
|
} else if (runs) {
|
|
51749
|
+
if (model.titleTextOnly && textOnlyStylesMatch) {
|
|
51750
|
+
if (!patchChartTitleRunText(titleNode, runs, getLocalName2))
|
|
51751
|
+
throw new Error("This chart title cannot be replaced without changing its text source");
|
|
51752
|
+
if (prefix === "c") setAutoTitleDeleted(chartRoot, false, getLocalName2);
|
|
51753
|
+
return true;
|
|
51754
|
+
}
|
|
51005
51755
|
const txKey = findKey(titleNode, "tx", getLocalName2);
|
|
51006
51756
|
if (txKey) {
|
|
51007
51757
|
titleNode[txKey] = buildTitleTextFromRuns(prefix, runs);
|
|
@@ -51171,123 +51921,6 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
|
|
|
51171
51921
|
}
|
|
51172
51922
|
chartRoot[titleKey] = title;
|
|
51173
51923
|
}
|
|
51174
|
-
function collectChartWorkbookWrite(xmlLookupService, container, isNumeric2, values) {
|
|
51175
|
-
if (!container) {
|
|
51176
|
-
return void 0;
|
|
51177
|
-
}
|
|
51178
|
-
const refNode = xmlLookupService.getChildByLocalName(container, isNumeric2 ? "numRef" : "strRef");
|
|
51179
|
-
const formula = refNode ? xmlLookupService.getScalarChildByLocalName(refNode, "f") : void 0;
|
|
51180
|
-
return formula ? { formula, isNumeric: isNumeric2, values } : void 0;
|
|
51181
|
-
}
|
|
51182
|
-
function createSpreadsheetXmlParser() {
|
|
51183
|
-
return new XMLParser({
|
|
51184
|
-
ignoreAttributes: false,
|
|
51185
|
-
attributeNamePrefix: "@_",
|
|
51186
|
-
trimValues: false,
|
|
51187
|
-
tagValueProcessor: (tagName, tagValue) => preservesSpreadsheetXmlWhitespace(tagName) ? tagValue : tagValue.trim()
|
|
51188
|
-
});
|
|
51189
|
-
}
|
|
51190
|
-
function createSpreadsheetXmlBuilder() {
|
|
51191
|
-
return new XMLBuilder({
|
|
51192
|
-
ignoreAttributes: false,
|
|
51193
|
-
attributeNamePrefix: "@_",
|
|
51194
|
-
suppressBooleanAttributes: false,
|
|
51195
|
-
format: false
|
|
51196
|
-
});
|
|
51197
|
-
}
|
|
51198
|
-
async function resolveWorksheetPathsByName(xlsxZip, parser) {
|
|
51199
|
-
const result = /* @__PURE__ */ new Map();
|
|
51200
|
-
const workbookFile = xlsxZip.file("xl/workbook.xml");
|
|
51201
|
-
const relsFile = xlsxZip.file("xl/_rels/workbook.xml.rels");
|
|
51202
|
-
if (!workbookFile || !relsFile) {
|
|
51203
|
-
return result;
|
|
51204
|
-
}
|
|
51205
|
-
try {
|
|
51206
|
-
const workbookTree = parser.parse(await workbookFile.async("string"));
|
|
51207
|
-
const relsTree = parser.parse(await relsFile.async("string"));
|
|
51208
|
-
const targetByRelId = /* @__PURE__ */ new Map();
|
|
51209
|
-
const relationships2 = xmlChild(relsTree, "Relationships");
|
|
51210
|
-
for (const rel of xmlChildren(relationships2, "Relationship")) {
|
|
51211
|
-
const id = xmlAttr(rel, "Id");
|
|
51212
|
-
const target = xmlAttr(rel, "Target");
|
|
51213
|
-
if (id && target) {
|
|
51214
|
-
targetByRelId.set(id, target);
|
|
51215
|
-
}
|
|
51216
|
-
}
|
|
51217
|
-
const workbookRoot = xmlChild(workbookTree, "workbook");
|
|
51218
|
-
const sheets = xmlChild(workbookRoot, "sheets");
|
|
51219
|
-
for (const sheet of xmlChildren(sheets, "sheet")) {
|
|
51220
|
-
const name = xmlAttr(sheet, "name");
|
|
51221
|
-
const relId = xmlAttr(sheet, "r:id") ?? xmlAttr(sheet, "id");
|
|
51222
|
-
const target = relId ? targetByRelId.get(relId) : void 0;
|
|
51223
|
-
if (name && target) {
|
|
51224
|
-
result.set(name.toLowerCase(), resolveWorkbookPartPath(target));
|
|
51225
|
-
}
|
|
51226
|
-
}
|
|
51227
|
-
} catch {
|
|
51228
|
-
}
|
|
51229
|
-
return result;
|
|
51230
|
-
}
|
|
51231
|
-
function resolveWorkbookPartPath(target) {
|
|
51232
|
-
return target.startsWith("/") ? target.slice(1) : `xl/${target}`;
|
|
51233
|
-
}
|
|
51234
|
-
async function writeChartWorkbookUpdates(xlsxBytes, writes) {
|
|
51235
|
-
if (writes.length === 0) {
|
|
51236
|
-
return { unresolved: 0 };
|
|
51237
|
-
}
|
|
51238
|
-
let xlsxZip;
|
|
51239
|
-
try {
|
|
51240
|
-
xlsxZip = await JSZip4.loadAsync(xlsxBytes);
|
|
51241
|
-
} catch {
|
|
51242
|
-
return { unresolved: writes.length };
|
|
51243
|
-
}
|
|
51244
|
-
const parser = createSpreadsheetXmlParser();
|
|
51245
|
-
const sheetPathByName = await resolveWorksheetPathsByName(xlsxZip, parser);
|
|
51246
|
-
const writesBySheetPath = /* @__PURE__ */ new Map();
|
|
51247
|
-
let unresolved = 0;
|
|
51248
|
-
for (const write of writes) {
|
|
51249
|
-
const range = parseChartFormulaRange(write.formula);
|
|
51250
|
-
const sheetPath = range ? sheetPathByName.get(range.sheetName.toLowerCase()) : void 0;
|
|
51251
|
-
const refs = range ? expandRangeAddresses(range, write.values.length) : void 0;
|
|
51252
|
-
if (!range || !sheetPath || !refs) {
|
|
51253
|
-
unresolved += 1;
|
|
51254
|
-
continue;
|
|
51255
|
-
}
|
|
51256
|
-
const bucket = writesBySheetPath.get(sheetPath) ?? [];
|
|
51257
|
-
bucket.push({ refs, values: write.values, isNumeric: write.isNumeric });
|
|
51258
|
-
writesBySheetPath.set(sheetPath, bucket);
|
|
51259
|
-
}
|
|
51260
|
-
const builder = createSpreadsheetXmlBuilder();
|
|
51261
|
-
let changedAny = false;
|
|
51262
|
-
for (const [sheetPath, resolvedWrites] of writesBySheetPath) {
|
|
51263
|
-
const sheetFile = xlsxZip.file(sheetPath);
|
|
51264
|
-
if (!sheetFile) {
|
|
51265
|
-
unresolved += resolvedWrites.length;
|
|
51266
|
-
continue;
|
|
51267
|
-
}
|
|
51268
|
-
try {
|
|
51269
|
-
const sheetTree = parser.parse(await sheetFile.async("string"));
|
|
51270
|
-
const cellWrites = resolvedWrites.flatMap(
|
|
51271
|
-
({ refs, values, isNumeric: isNumeric2 }) => refs.map((ref, i) => ({ ref, isNumeric: isNumeric2, value: values[i] }))
|
|
51272
|
-
);
|
|
51273
|
-
if (applyCellWritesToWorksheet(sheetTree, cellWrites)) {
|
|
51274
|
-
xlsxZip.file(sheetPath, builder.build(sheetTree));
|
|
51275
|
-
changedAny = true;
|
|
51276
|
-
}
|
|
51277
|
-
} catch {
|
|
51278
|
-
unresolved += resolvedWrites.length;
|
|
51279
|
-
}
|
|
51280
|
-
}
|
|
51281
|
-
if (!changedAny) {
|
|
51282
|
-
return { unresolved };
|
|
51283
|
-
}
|
|
51284
|
-
const bytes = await xlsxZip.generateAsync({
|
|
51285
|
-
type: "uint8array",
|
|
51286
|
-
compression: "DEFLATE",
|
|
51287
|
-
compressionOptions: { level: 6 }
|
|
51288
|
-
});
|
|
51289
|
-
return { bytes, unresolved };
|
|
51290
|
-
}
|
|
51291
51924
|
|
|
51292
51925
|
// pptx/core/core/runtime/chart-cx-update-data.ts
|
|
51293
51926
|
function findKey20(node, localName15, getLocalName2) {
|
|
@@ -51605,13 +52238,19 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
51605
52238
|
}
|
|
51606
52239
|
|
|
51607
52240
|
// pptx/core/core/runtime/chart-external-workbook-save.ts
|
|
51608
|
-
async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath, externalData, writes) {
|
|
52241
|
+
async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath, externalData, writes, atomic = false) {
|
|
52242
|
+
if (atomic && externalData && (!externalData.targetPath || externalData.isExternal)) {
|
|
52243
|
+
throw new Error("Chart label replacement cannot update an external or missing workbook.");
|
|
52244
|
+
}
|
|
51609
52245
|
if (writes.length === 0 || !externalData?.targetPath) {
|
|
51610
|
-
return;
|
|
52246
|
+
return writes.length === 0;
|
|
51611
52247
|
}
|
|
51612
52248
|
const embeddingPath = deps.resolveImagePath(chartPartPath, externalData.targetPath);
|
|
51613
52249
|
const looksEmbedded = embeddingPath.includes("embeddings/") && /\.xlsx$/iu.test(embeddingPath);
|
|
51614
|
-
if (!looksEmbedded) {
|
|
52250
|
+
if (!looksEmbedded || externalData.isExternal) {
|
|
52251
|
+
if (atomic) {
|
|
52252
|
+
throw new Error("Chart label replacement requires an embedded .xlsx workbook.");
|
|
52253
|
+
}
|
|
51615
52254
|
deps.reportWarning({
|
|
51616
52255
|
code: "CHART_EXTERNAL_DATA_WRITEBACK_UNSUPPORTED",
|
|
51617
52256
|
message: "Chart data changes were saved to the cached values only: the linked data source is external or not an embedded .xlsx workbook, so it was not updated.",
|
|
@@ -51620,10 +52259,13 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
|
|
|
51620
52259
|
slideId: slidePath,
|
|
51621
52260
|
xmlPath: chartPartPath
|
|
51622
52261
|
});
|
|
51623
|
-
return;
|
|
52262
|
+
return false;
|
|
51624
52263
|
}
|
|
51625
52264
|
const xlsxFile = deps.zip.file(embeddingPath);
|
|
51626
52265
|
if (!xlsxFile) {
|
|
52266
|
+
if (atomic) {
|
|
52267
|
+
throw new Error("Chart label replacement workbook is missing.");
|
|
52268
|
+
}
|
|
51627
52269
|
deps.reportWarning({
|
|
51628
52270
|
code: "CHART_EMBEDDED_WORKBOOK_MISSING",
|
|
51629
52271
|
message: "Chart data changes were saved to the cached values only: the referenced embedded workbook was not found in the package.",
|
|
@@ -51632,12 +52274,15 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
|
|
|
51632
52274
|
slideId: slidePath,
|
|
51633
52275
|
xmlPath: embeddingPath
|
|
51634
52276
|
});
|
|
51635
|
-
return;
|
|
52277
|
+
return false;
|
|
51636
52278
|
}
|
|
51637
52279
|
let xlsxBytes;
|
|
51638
52280
|
try {
|
|
51639
52281
|
xlsxBytes = await xlsxFile.async("uint8array");
|
|
51640
52282
|
} catch {
|
|
52283
|
+
if (atomic) {
|
|
52284
|
+
throw new Error("Chart label replacement workbook cannot be read.");
|
|
52285
|
+
}
|
|
51641
52286
|
deps.reportWarning({
|
|
51642
52287
|
code: "CHART_EMBEDDED_WORKBOOK_UNREADABLE",
|
|
51643
52288
|
message: "Chart data changes were saved to the cached values only: the referenced embedded workbook could not be read.",
|
|
@@ -51646,9 +52291,9 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
|
|
|
51646
52291
|
slideId: slidePath,
|
|
51647
52292
|
xmlPath: embeddingPath
|
|
51648
52293
|
});
|
|
51649
|
-
return;
|
|
52294
|
+
return false;
|
|
51650
52295
|
}
|
|
51651
|
-
const result = await writeChartWorkbookUpdates(xlsxBytes, writes);
|
|
52296
|
+
const result = await writeChartWorkbookUpdates(xlsxBytes, writes, { atomic });
|
|
51652
52297
|
if (result.bytes) {
|
|
51653
52298
|
deps.zip.file(embeddingPath, result.bytes);
|
|
51654
52299
|
}
|
|
@@ -51662,6 +52307,7 @@ async function saveChartExternalWorkbookUpdates(deps, chartPartPath, slidePath,
|
|
|
51662
52307
|
xmlPath: embeddingPath
|
|
51663
52308
|
});
|
|
51664
52309
|
}
|
|
52310
|
+
return result.unresolved === 0;
|
|
51665
52311
|
}
|
|
51666
52312
|
|
|
51667
52313
|
// pptx/core/core/runtime/chart-part-registration.ts
|
|
@@ -51908,8 +52554,8 @@ function applyRotationFlipToRawNode(node, rotation, flipH, flipV) {
|
|
|
51908
52554
|
const spPrKey = findChildKey(node, "spPr");
|
|
51909
52555
|
const container = spPrKey ? node[spPrKey] ?? node : node;
|
|
51910
52556
|
const xfrmKey = findChildKey(container, "xfrm");
|
|
51911
|
-
const
|
|
51912
|
-
if (!xfrmKey && !
|
|
52557
|
+
const hasAny2 = Boolean(rotation) || Boolean(flipH) || Boolean(flipV);
|
|
52558
|
+
if (!xfrmKey && !hasAny2) {
|
|
51913
52559
|
return;
|
|
51914
52560
|
}
|
|
51915
52561
|
const xfrm = xfrmKey ? container[xfrmKey] : {};
|
|
@@ -51946,24 +52592,24 @@ function hexVal(hex3) {
|
|
|
51946
52592
|
}
|
|
51947
52593
|
function buildRunProps(para) {
|
|
51948
52594
|
const rPr = {};
|
|
51949
|
-
let
|
|
52595
|
+
let hasAny2 = false;
|
|
51950
52596
|
if (para.fontSize !== void 0) {
|
|
51951
52597
|
rPr["@_sz"] = String(Math.round(para.fontSize * 100));
|
|
51952
|
-
|
|
52598
|
+
hasAny2 = true;
|
|
51953
52599
|
}
|
|
51954
52600
|
if (para.bold) {
|
|
51955
52601
|
rPr["@_b"] = "1";
|
|
51956
|
-
|
|
52602
|
+
hasAny2 = true;
|
|
51957
52603
|
}
|
|
51958
52604
|
if (para.italic) {
|
|
51959
52605
|
rPr["@_i"] = "1";
|
|
51960
|
-
|
|
52606
|
+
hasAny2 = true;
|
|
51961
52607
|
}
|
|
51962
52608
|
if (para.color) {
|
|
51963
52609
|
rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hexVal(para.color) } };
|
|
51964
|
-
|
|
52610
|
+
hasAny2 = true;
|
|
51965
52611
|
}
|
|
51966
|
-
return
|
|
52612
|
+
return hasAny2 ? rPr : void 0;
|
|
51967
52613
|
}
|
|
51968
52614
|
function buildParagraphNode(para) {
|
|
51969
52615
|
const node = {};
|
|
@@ -53855,7 +54501,7 @@ function forceSvgStretchFill(svgText) {
|
|
|
53855
54501
|
|
|
53856
54502
|
// pptx/core/core/runtime/image-a14-effects-model.ts
|
|
53857
54503
|
function applyA14ExtensionToEffects(effects, a14) {
|
|
53858
|
-
let
|
|
54504
|
+
let hasAny2 = false;
|
|
53859
54505
|
if (a14.artisticEffect !== void 0) {
|
|
53860
54506
|
effects.artisticEffect = a14.artisticEffect;
|
|
53861
54507
|
if (a14.originalImageRelId !== void 0) {
|
|
@@ -53867,15 +54513,15 @@ function applyA14ExtensionToEffects(effects, a14) {
|
|
|
53867
54513
|
if (a14.artisticParams) {
|
|
53868
54514
|
effects.artisticParams = a14.artisticParams;
|
|
53869
54515
|
}
|
|
53870
|
-
|
|
54516
|
+
hasAny2 = true;
|
|
53871
54517
|
}
|
|
53872
54518
|
if (a14.backgroundRemoval) {
|
|
53873
54519
|
effects.backgroundRemoval = a14.backgroundRemoval;
|
|
53874
|
-
|
|
54520
|
+
hasAny2 = true;
|
|
53875
54521
|
}
|
|
53876
54522
|
if (a14.originalImageRelId !== void 0) {
|
|
53877
54523
|
effects.originalImageRelId = a14.originalImageRelId;
|
|
53878
|
-
|
|
54524
|
+
hasAny2 = true;
|
|
53879
54525
|
}
|
|
53880
54526
|
const corrections = {};
|
|
53881
54527
|
if (a14.sharpenSoften) {
|
|
@@ -53898,9 +54544,9 @@ function applyA14ExtensionToEffects(effects, a14) {
|
|
|
53898
54544
|
if (a14.originalImageRelId !== void 0) {
|
|
53899
54545
|
effects.prerenderedCorrections = corrections;
|
|
53900
54546
|
}
|
|
53901
|
-
|
|
54547
|
+
hasAny2 = true;
|
|
53902
54548
|
}
|
|
53903
|
-
return
|
|
54549
|
+
return hasAny2;
|
|
53904
54550
|
}
|
|
53905
54551
|
|
|
53906
54552
|
// pptx/core/core/runtime/template-element-baselines.ts
|
|
@@ -54007,7 +54653,7 @@ var PptxHandlerRuntime = class {
|
|
|
54007
54653
|
*/
|
|
54008
54654
|
savedSlideFingerprints = /* @__PURE__ */ new Map();
|
|
54009
54655
|
/**
|
|
54010
|
-
* `chartData`
|
|
54656
|
+
* `chartData` as parsed or last serialized into the current ZIP,
|
|
54011
54657
|
* serialized to JSON and keyed by `chartPartPath`. The save pipeline used
|
|
54012
54658
|
* to re-serialize EVERY chart part on any slide rewrite regardless of
|
|
54013
54659
|
* whether the chart itself was touched, which materializes the load-time
|
|
@@ -54020,6 +54666,10 @@ var PptxHandlerRuntime = class {
|
|
|
54020
54666
|
* untouched chart part pass through byte-for-byte instead.
|
|
54021
54667
|
*/
|
|
54022
54668
|
chartDataBaselines = /* @__PURE__ */ new Map();
|
|
54669
|
+
/** Pending chart requests also retain warned workbook writes for later retry. */
|
|
54670
|
+
pendingChartUpdates;
|
|
54671
|
+
/** Last fully reconciled workbook data plus whether a write-back needs retry. */
|
|
54672
|
+
chartWorkbookDataBaselines = /* @__PURE__ */ new Map();
|
|
54023
54673
|
/** Per-slide relationship maps: slide path -> (rId -> target path). */
|
|
54024
54674
|
slideRelsMap = /* @__PURE__ */ new Map();
|
|
54025
54675
|
/** Tracks relationship IDs with TargetMode="External" per slide/part path. */
|
|
@@ -55180,13 +55830,13 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55180
55830
|
return null;
|
|
55181
55831
|
}
|
|
55182
55832
|
const effects = {};
|
|
55183
|
-
let
|
|
55833
|
+
let hasAny2 = false;
|
|
55184
55834
|
const brightRaw = blip["@_bright"] ?? blip["@_brt"];
|
|
55185
55835
|
if (brightRaw !== null) {
|
|
55186
55836
|
const val = parseInt(String(brightRaw));
|
|
55187
55837
|
if (Number.isFinite(val)) {
|
|
55188
55838
|
effects.brightness = val / 1e3;
|
|
55189
|
-
|
|
55839
|
+
hasAny2 = true;
|
|
55190
55840
|
}
|
|
55191
55841
|
}
|
|
55192
55842
|
const contrastRaw = blip["@_contrast"] ?? blip["@_cont"];
|
|
@@ -55194,7 +55844,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55194
55844
|
const val = parseInt(String(contrastRaw));
|
|
55195
55845
|
if (Number.isFinite(val)) {
|
|
55196
55846
|
effects.contrast = val / 1e3;
|
|
55197
|
-
|
|
55847
|
+
hasAny2 = true;
|
|
55198
55848
|
}
|
|
55199
55849
|
}
|
|
55200
55850
|
const colorEffects = parseImageColorEffects(
|
|
@@ -55204,12 +55854,12 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55204
55854
|
);
|
|
55205
55855
|
Object.assign(effects, colorEffects);
|
|
55206
55856
|
if (Object.keys(colorEffects).length > 0) {
|
|
55207
|
-
|
|
55857
|
+
hasAny2 = true;
|
|
55208
55858
|
}
|
|
55209
55859
|
const alphaEffects = parseImageAlphaEffects(blip, (node) => this.parseColor(node));
|
|
55210
55860
|
Object.assign(effects, alphaEffects);
|
|
55211
55861
|
if (Object.keys(alphaEffects).length > 0) {
|
|
55212
|
-
|
|
55862
|
+
hasAny2 = true;
|
|
55213
55863
|
}
|
|
55214
55864
|
const lumNode = blip["a:lum"];
|
|
55215
55865
|
if (lumNode) {
|
|
@@ -55229,7 +55879,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55229
55879
|
}
|
|
55230
55880
|
}
|
|
55231
55881
|
effects.lum = lumEffect;
|
|
55232
|
-
|
|
55882
|
+
hasAny2 = true;
|
|
55233
55883
|
}
|
|
55234
55884
|
const hslNode = blip["a:hsl"];
|
|
55235
55885
|
if (hslNode) {
|
|
@@ -55256,7 +55906,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55256
55906
|
}
|
|
55257
55907
|
}
|
|
55258
55908
|
effects.hsl = hslEffect;
|
|
55259
|
-
|
|
55909
|
+
hasAny2 = true;
|
|
55260
55910
|
}
|
|
55261
55911
|
const tintNode = blip["a:tint"];
|
|
55262
55912
|
if (tintNode) {
|
|
@@ -55276,7 +55926,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55276
55926
|
}
|
|
55277
55927
|
}
|
|
55278
55928
|
effects.tint = tintEffect;
|
|
55279
|
-
|
|
55929
|
+
hasAny2 = true;
|
|
55280
55930
|
}
|
|
55281
55931
|
const fillOverlay = blip["a:fillOverlay"];
|
|
55282
55932
|
if (fillOverlay) {
|
|
@@ -55303,7 +55953,7 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55303
55953
|
...resolvedGradient ? { resolvedGradient } : {},
|
|
55304
55954
|
...resolvedPattern ? { resolvedPattern } : {}
|
|
55305
55955
|
};
|
|
55306
|
-
|
|
55956
|
+
hasAny2 = true;
|
|
55307
55957
|
}
|
|
55308
55958
|
const blurNode = blip["a:blur"];
|
|
55309
55959
|
if (blurNode) {
|
|
@@ -55321,16 +55971,16 @@ var PptxHandlerRuntime5 = class extends PptxHandlerRuntime4 {
|
|
|
55321
55971
|
blurEffect.grow = s === "1" || s === "true";
|
|
55322
55972
|
}
|
|
55323
55973
|
effects.blur = blurEffect;
|
|
55324
|
-
|
|
55974
|
+
hasAny2 = true;
|
|
55325
55975
|
}
|
|
55326
55976
|
const extLst = xmlChild(blip, "a:extLst");
|
|
55327
55977
|
if (extLst) {
|
|
55328
55978
|
const a14 = parseA14ImageExtension(this.ensureArray(extLst["a:ext"]));
|
|
55329
55979
|
if (a14 && applyA14ExtensionToEffects(effects, a14)) {
|
|
55330
|
-
|
|
55980
|
+
hasAny2 = true;
|
|
55331
55981
|
}
|
|
55332
55982
|
}
|
|
55333
|
-
return
|
|
55983
|
+
return hasAny2 ? effects : null;
|
|
55334
55984
|
}
|
|
55335
55985
|
/**
|
|
55336
55986
|
* Resolve a blip `a:fillOverlay/a:gradFill` to the structured gradient a
|
|
@@ -56908,8 +57558,8 @@ function buildTextRunEffectListXml(style, parseColor) {
|
|
|
56908
57558
|
const hasTextHsl = typeof style.textHslHue === "number" || typeof style.textHslSaturation === "number" || typeof style.textHslLuminance === "number";
|
|
56909
57559
|
const hasTextClrChange = Boolean(style.textClrChangeFrom) && Boolean(style.textClrChangeTo);
|
|
56910
57560
|
const hasTextDuotone = Boolean(style.textDuotone);
|
|
56911
|
-
const
|
|
56912
|
-
if (!
|
|
57561
|
+
const hasAny2 = hasTextShadow || hasTextInnerShadow || hasTextPresetShadow || hasTextGlow || hasTextReflection || hasTextBlur || hasTextSoftEdge || hasTextAlphaModFix || hasTextAlphaMod || hasTextHsl || hasTextClrChange || hasTextDuotone;
|
|
57562
|
+
if (!hasAny2) {
|
|
56913
57563
|
return void 0;
|
|
56914
57564
|
}
|
|
56915
57565
|
const effectLst = {};
|
|
@@ -61054,6 +61704,82 @@ function writeTableColumnWidths(tbl, columnWidths) {
|
|
|
61054
61704
|
}
|
|
61055
61705
|
}
|
|
61056
61706
|
|
|
61707
|
+
// pptx/core/core/runtime/table-style-change-cell-clear.ts
|
|
61708
|
+
var FILL_KEYS = [
|
|
61709
|
+
"a:noFill",
|
|
61710
|
+
"a:solidFill",
|
|
61711
|
+
"a:gradFill",
|
|
61712
|
+
"a:blipFill",
|
|
61713
|
+
"a:pattFill",
|
|
61714
|
+
"a:grpFill"
|
|
61715
|
+
];
|
|
61716
|
+
var LINE_KEYS = [
|
|
61717
|
+
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
|
|
61718
|
+
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
|
|
61719
|
+
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
|
|
61720
|
+
["a:lnB", ["borderBottomWidth", "borderBottomColor", "borderBottomDash"]],
|
|
61721
|
+
["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
|
|
61722
|
+
["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
|
|
61723
|
+
];
|
|
61724
|
+
var FILL_FIELDS = [
|
|
61725
|
+
"fillMode",
|
|
61726
|
+
"backgroundColor",
|
|
61727
|
+
"gradientFillStops",
|
|
61728
|
+
"patternFillPreset",
|
|
61729
|
+
"backgroundImageFillPath",
|
|
61730
|
+
"backgroundImageFillData"
|
|
61731
|
+
];
|
|
61732
|
+
function normaliseStyleId(id) {
|
|
61733
|
+
const text = typeof id === "string" || typeof id === "number" ? String(id) : "";
|
|
61734
|
+
const trimmed2 = text.trim().toUpperCase();
|
|
61735
|
+
if (!trimmed2) {
|
|
61736
|
+
return "";
|
|
61737
|
+
}
|
|
61738
|
+
return trimmed2.startsWith("{") ? trimmed2 : `{${trimmed2}}`;
|
|
61739
|
+
}
|
|
61740
|
+
function xmlTableStyleId(tblPr) {
|
|
61741
|
+
if (!tblPr || typeof tblPr !== "object") {
|
|
61742
|
+
return "";
|
|
61743
|
+
}
|
|
61744
|
+
const props = tblPr;
|
|
61745
|
+
const node = props["a:tableStyleId"];
|
|
61746
|
+
const spec = normaliseStyleId(
|
|
61747
|
+
node && typeof node === "object" ? node["#text"] : node
|
|
61748
|
+
);
|
|
61749
|
+
if (spec) {
|
|
61750
|
+
return spec;
|
|
61751
|
+
}
|
|
61752
|
+
const legacy = props["a:tblStyle"];
|
|
61753
|
+
return normaliseStyleId(legacy?.["@_val"] || props["@_tblStyle"]);
|
|
61754
|
+
}
|
|
61755
|
+
function tableStyleIdChanged(tblPr, nextStyleId) {
|
|
61756
|
+
if (nextStyleId === void 0) {
|
|
61757
|
+
return false;
|
|
61758
|
+
}
|
|
61759
|
+
return normaliseStyleId(nextStyleId) !== xmlTableStyleId(tblPr);
|
|
61760
|
+
}
|
|
61761
|
+
var hasAny = (style, keys) => keys.some((key2) => style?.[key2] !== void 0);
|
|
61762
|
+
function clearCellFormattingForStyleChange(xmlCell, style) {
|
|
61763
|
+
const tcPr = xmlCell["a:tcPr"];
|
|
61764
|
+
if (!tcPr || typeof tcPr !== "object") {
|
|
61765
|
+
return;
|
|
61766
|
+
}
|
|
61767
|
+
const props = tcPr;
|
|
61768
|
+
if (!hasAny(style, FILL_FIELDS)) {
|
|
61769
|
+
for (const key2 of FILL_KEYS) {
|
|
61770
|
+
delete props[key2];
|
|
61771
|
+
}
|
|
61772
|
+
}
|
|
61773
|
+
for (const [key2, fields] of LINE_KEYS) {
|
|
61774
|
+
if (!hasAny(style, fields)) {
|
|
61775
|
+
delete props[key2];
|
|
61776
|
+
}
|
|
61777
|
+
}
|
|
61778
|
+
if (!style?.cell3D) {
|
|
61779
|
+
delete props["a:cell3D"];
|
|
61780
|
+
}
|
|
61781
|
+
}
|
|
61782
|
+
|
|
61057
61783
|
// pptx/core/core/runtime/table-paragraph-save-order.ts
|
|
61058
61784
|
var CONTENT_TAGS = /* @__PURE__ */ new Set(["a:r", "a:br", "a:fld"]);
|
|
61059
61785
|
var paragraphOrders = /* @__PURE__ */ new WeakMap();
|
|
@@ -61986,6 +62712,7 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
61986
62712
|
if (!tbl) {
|
|
61987
62713
|
return;
|
|
61988
62714
|
}
|
|
62715
|
+
const styleChanged = tableData.clearDirectCellFormatting === true || tableStyleIdChanged(tbl["a:tblPr"], tableData.tableStyleId);
|
|
61989
62716
|
serializeTablePropertyFlags(tbl, tableData);
|
|
61990
62717
|
writeTablePropertiesOwnFillAndEffects(tbl["a:tblPr"], tableData);
|
|
61991
62718
|
const xmlRows = this.ensureArray(tbl["a:tr"]);
|
|
@@ -62017,6 +62744,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62017
62744
|
if (cell.text !== void 0) {
|
|
62018
62745
|
this.writeTableCellText(xmlCell, cell.text);
|
|
62019
62746
|
}
|
|
62747
|
+
if (styleChanged) {
|
|
62748
|
+
clearCellFormattingForStyleChange(xmlCell, cell.style);
|
|
62749
|
+
}
|
|
62020
62750
|
if (cell.style) {
|
|
62021
62751
|
this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
|
|
62022
62752
|
}
|
|
@@ -62040,6 +62770,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62040
62770
|
if (cell.text !== void 0) {
|
|
62041
62771
|
this.writeTableCellText(xmlCell, cell.text);
|
|
62042
62772
|
}
|
|
62773
|
+
if (styleChanged) {
|
|
62774
|
+
clearCellFormattingForStyleChange(xmlCell, cell.style);
|
|
62775
|
+
}
|
|
62043
62776
|
if (cell.style) {
|
|
62044
62777
|
this.writeTableCellStyle(xmlCell, cell.style, cell.paragraphs);
|
|
62045
62778
|
}
|
|
@@ -62051,8 +62784,6 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62051
62784
|
console.warn("Failed to serialize table data:", e);
|
|
62052
62785
|
}
|
|
62053
62786
|
}
|
|
62054
|
-
/** Pending chart data updates to process in the async save method. */
|
|
62055
|
-
pendingChartUpdates;
|
|
62056
62787
|
/**
|
|
62057
62788
|
* Record `chartData` as parsed, straight off `enrichChartData`, as this
|
|
62058
62789
|
* chart's load-time baseline. See {@link chartDataBaselines}.
|
|
@@ -62062,6 +62793,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62062
62793
|
return;
|
|
62063
62794
|
}
|
|
62064
62795
|
this.chartDataBaselines.set(chartData.chartPartPath, JSON.stringify(chartData));
|
|
62796
|
+
this.chartWorkbookDataBaselines.set(chartData.chartPartPath, {
|
|
62797
|
+
signature: chartWorkbookDataSignature(chartData),
|
|
62798
|
+
pending: false
|
|
62799
|
+
});
|
|
62065
62800
|
}
|
|
62066
62801
|
/**
|
|
62067
62802
|
* Collect chart data for deferred async processing during save.
|
|
@@ -62078,12 +62813,28 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62078
62813
|
/**
|
|
62079
62814
|
* Process all pending chart data updates (called from the async save method).
|
|
62080
62815
|
*/
|
|
62081
|
-
async processPendingChartUpdates() {
|
|
62816
|
+
async processPendingChartUpdates(slides) {
|
|
62082
62817
|
if (!this.pendingChartUpdates || this.pendingChartUpdates.length === 0) {
|
|
62083
62818
|
return;
|
|
62084
62819
|
}
|
|
62820
|
+
if (slides) {
|
|
62821
|
+
const current = /* @__PURE__ */ new Map();
|
|
62822
|
+
const visit = (elements2, slidePath) => {
|
|
62823
|
+
for (const element of elements2) {
|
|
62824
|
+
if (element.type === "group") visit(element.children, slidePath);
|
|
62825
|
+
else if (element.type === "chart" && element.chartData?.chartPartPath) {
|
|
62826
|
+
current.set(element.chartData.chartPartPath, {
|
|
62827
|
+
chartData: element.chartData,
|
|
62828
|
+
slidePath
|
|
62829
|
+
});
|
|
62830
|
+
}
|
|
62831
|
+
}
|
|
62832
|
+
};
|
|
62833
|
+
for (const slide of slides) visit(slide.elements, slide.id);
|
|
62834
|
+
this.pendingChartUpdates = [...current.values()];
|
|
62835
|
+
}
|
|
62085
62836
|
for (const { chartData, slidePath } of this.pendingChartUpdates) {
|
|
62086
|
-
if (chartData.chartPartPath && this.chartDataBaselines.get(chartData.chartPartPath) === JSON.stringify(chartData)) {
|
|
62837
|
+
if (chartData.chartPartPath && !this.chartWorkbookDataBaselines.get(chartData.chartPartPath)?.pending && this.chartDataBaselines.get(chartData.chartPartPath) === JSON.stringify(chartData)) {
|
|
62087
62838
|
continue;
|
|
62088
62839
|
}
|
|
62089
62840
|
if (chartData.colorPalette && chartData.colorStylePartPath) {
|
|
@@ -62502,7 +63253,9 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62502
63253
|
{
|
|
62503
63254
|
title: chartData.title,
|
|
62504
63255
|
hasTitle: chartData.style?.hasTitle,
|
|
62505
|
-
titleRuns: chartData.titleRuns
|
|
63256
|
+
titleRuns: chartData.titleRuns,
|
|
63257
|
+
titleTextOnly: chartData.titleTextOnly,
|
|
63258
|
+
titleTextOnlyStyles: chartData.titleTextOnlyStyles
|
|
62506
63259
|
},
|
|
62507
63260
|
(key2) => this.compatibilityService.getXmlLocalName(key2)
|
|
62508
63261
|
);
|
|
@@ -62694,23 +63447,41 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
62694
63447
|
}
|
|
62695
63448
|
}
|
|
62696
63449
|
await this.syncChartUserShapesToXml(chartSpace, chartData, chartPartPath);
|
|
63450
|
+
const serializedBaseline = this.chartDataBaselines.get(chartPartPath);
|
|
63451
|
+
const signature = chartWorkbookDataSignature(chartData);
|
|
63452
|
+
const workbookBaseline = this.chartWorkbookDataBaselines.get(chartPartPath);
|
|
63453
|
+
const previousSignature = workbookBaseline?.signature ?? (serializedBaseline ? chartWorkbookDataSignature(JSON.parse(serializedBaseline)) : void 0);
|
|
63454
|
+
const workbookDataChanged = workbookBaseline?.pending || signature !== previousSignature;
|
|
63455
|
+
if (workbookDataChanged) {
|
|
63456
|
+
const complete = await saveChartExternalWorkbookUpdates(
|
|
63457
|
+
{
|
|
63458
|
+
zip: this.zip,
|
|
63459
|
+
resolveImagePath: (basePath, target) => this.resolveImagePath(basePath, target),
|
|
63460
|
+
reportWarning: (warning) => this.compatibilityService.reportWarning(warning)
|
|
63461
|
+
},
|
|
63462
|
+
chartPartPath,
|
|
63463
|
+
slidePath,
|
|
63464
|
+
chartData.externalData,
|
|
63465
|
+
workbookWrites,
|
|
63466
|
+
chartData.dataLabelTextOnly ?? false
|
|
63467
|
+
);
|
|
63468
|
+
this.chartWorkbookDataBaselines.set(chartPartPath, {
|
|
63469
|
+
signature: complete ? signature : previousSignature ?? signature,
|
|
63470
|
+
pending: !complete
|
|
63471
|
+
});
|
|
63472
|
+
}
|
|
62697
63473
|
this.zip.file(chartPartPath, this.builder.build(chartXmlData));
|
|
62698
|
-
|
|
62699
|
-
{
|
|
62700
|
-
zip: this.zip,
|
|
62701
|
-
resolveImagePath: (basePath, target) => this.resolveImagePath(basePath, target),
|
|
62702
|
-
reportWarning: (warning) => this.compatibilityService.reportWarning(warning)
|
|
62703
|
-
},
|
|
62704
|
-
chartPartPath,
|
|
62705
|
-
slidePath,
|
|
62706
|
-
chartData.externalData,
|
|
62707
|
-
workbookWrites
|
|
62708
|
-
);
|
|
63474
|
+
this.chartDataBaselines.set(chartPartPath, JSON.stringify(chartData));
|
|
62709
63475
|
} catch (e) {
|
|
63476
|
+
if (chartData.dataLabelTextOnly) {
|
|
63477
|
+
throw e;
|
|
63478
|
+
}
|
|
62710
63479
|
console.warn(`[pptx-save] Failed to serialize chart data for ${chartPartPath}:`, e);
|
|
62711
63480
|
}
|
|
62712
63481
|
}
|
|
62713
|
-
this.pendingChartUpdates =
|
|
63482
|
+
this.pendingChartUpdates = this.pendingChartUpdates.filter(
|
|
63483
|
+
({ chartData }) => chartData.chartPartPath && this.chartWorkbookDataBaselines.get(chartData.chartPartPath)?.pending
|
|
63484
|
+
);
|
|
62714
63485
|
}
|
|
62715
63486
|
/**
|
|
62716
63487
|
* Route a chart save that the 2006 `c:*Chart` update loop cannot handle:
|
|
@@ -70474,16 +71245,37 @@ var PptxHandlerRuntime50 = class extends PptxHandlerRuntime49 {
|
|
|
70474
71245
|
/** Ensure authored notes have the global notes-master OPC infrastructure. */
|
|
70475
71246
|
async ensureNotesMasterForAuthoredNotes(slides, constants) {
|
|
70476
71247
|
const needsNotes = slides.some(
|
|
70477
|
-
(slide) => slide.notes
|
|
71248
|
+
(slide) => Boolean(slide.notes) || Boolean(slide.notesSegments?.some((segment) => segment.text))
|
|
70478
71249
|
);
|
|
70479
71250
|
if (!needsNotes || Object.keys(this.zip.files).some(
|
|
70480
71251
|
(path2) => /^ppt\/notesMasters\/notesMaster\d+\.xml$/u.test(path2)
|
|
70481
71252
|
)) {
|
|
70482
71253
|
return;
|
|
70483
71254
|
}
|
|
71255
|
+
const relsPath2 = "ppt/_rels/presentation.xml.rels";
|
|
71256
|
+
const relsXml = await this.zip.file(relsPath2)?.async("string");
|
|
71257
|
+
if (!relsXml || !this.presentationData) return;
|
|
71258
|
+
if (Array.from(parseRelationships(relsXml).values()).some(
|
|
71259
|
+
(relationship) => relationship.type.endsWith("/notesMaster") && relationship.mode !== "External" && this.zip.file(resolvePartPath("ppt/presentation.xml", relationship.target))
|
|
71260
|
+
))
|
|
71261
|
+
return;
|
|
70484
71262
|
const strict = constants.conformance === "strict";
|
|
70485
71263
|
const masterPath = "ppt/notesMasters/notesMaster1.xml";
|
|
70486
|
-
const
|
|
71264
|
+
const sourceThemePath = Object.keys(this.zip.files).find((path2) => /^ppt\/theme\/theme\d+\.xml$/u.test(path2)) ?? "ppt/theme/theme1.xml";
|
|
71265
|
+
let themeIndex = 1;
|
|
71266
|
+
while (this.zip.file(`ppt/theme/theme${themeIndex}.xml`)) themeIndex += 1;
|
|
71267
|
+
const themePath = `ppt/theme/theme${themeIndex}.xml`;
|
|
71268
|
+
const themeBytes = await this.zip.file(sourceThemePath)?.async("uint8array");
|
|
71269
|
+
const theme = themeBytes ?? this.buildThemeXml(themePath, void 0);
|
|
71270
|
+
if (!theme) throw new Error("Cannot create a notes theme from the presentation state");
|
|
71271
|
+
this.zip.file(themePath, theme);
|
|
71272
|
+
const themeRelationships = await this.zip.file(`ppt/theme/_rels/${sourceThemePath.slice(sourceThemePath.lastIndexOf("/") + 1)}.rels`)?.async("uint8array");
|
|
71273
|
+
if (themeRelationships)
|
|
71274
|
+
this.zip.file(`ppt/theme/_rels/theme${themeIndex}.xml.rels`, themeRelationships);
|
|
71275
|
+
await this.addContentTypeOverride(
|
|
71276
|
+
`/${themePath}`,
|
|
71277
|
+
"application/vnd.openxmlformats-officedocument.theme+xml"
|
|
71278
|
+
);
|
|
70487
71279
|
this.zip.file(masterPath, this.builder.build(this.buildDefaultNotesMaster(strict)));
|
|
70488
71280
|
this.zip.file(
|
|
70489
71281
|
"ppt/notesMasters/_rels/notesMaster1.xml.rels",
|
|
@@ -70498,11 +71290,6 @@ var PptxHandlerRuntime50 = class extends PptxHandlerRuntime49 {
|
|
|
70498
71290
|
}
|
|
70499
71291
|
})
|
|
70500
71292
|
);
|
|
70501
|
-
const relsPath2 = "ppt/_rels/presentation.xml.rels";
|
|
70502
|
-
const relsXml = await this.zip.file(relsPath2)?.async("string");
|
|
70503
|
-
if (!relsXml || !this.presentationData) {
|
|
70504
|
-
return;
|
|
70505
|
-
}
|
|
70506
71293
|
const relsData = this.parser.parse(relsXml);
|
|
70507
71294
|
const relsRoot = relsData["Relationships"] ?? {};
|
|
70508
71295
|
const relationships2 = asArray7(relsRoot["Relationship"]);
|
|
@@ -71200,7 +71987,7 @@ var PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
71200
71987
|
saveSession,
|
|
71201
71988
|
saveConstants
|
|
71202
71989
|
);
|
|
71203
|
-
await this.processPendingChartUpdates();
|
|
71990
|
+
await this.processPendingChartUpdates(slides);
|
|
71204
71991
|
await this.ensureChartPartContentTypes();
|
|
71205
71992
|
await this.ensureOleEmbeddingContentTypes();
|
|
71206
71993
|
await this.processPendingOleContentUpdates();
|
|
@@ -72283,6 +73070,10 @@ var PptxHandlerRuntime60 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
|
|
|
72283
73070
|
const pathLst = custGeom["a:pathLst"];
|
|
72284
73071
|
if (isNonEmpty(pathLst)) {
|
|
72285
73072
|
result.pathLstXml = pathLst;
|
|
73073
|
+
const pathCommandOrder = readPathListCommandOrder(pathLst);
|
|
73074
|
+
if (pathCommandOrder) {
|
|
73075
|
+
result.pathCommandOrder = pathCommandOrder;
|
|
73076
|
+
}
|
|
72286
73077
|
}
|
|
72287
73078
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
72288
73079
|
}
|
|
@@ -73156,7 +73947,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
73156
73947
|
return void 0;
|
|
73157
73948
|
}
|
|
73158
73949
|
const locks = {};
|
|
73159
|
-
let
|
|
73950
|
+
let hasAny2 = false;
|
|
73160
73951
|
const boolAttr2 = (attr5) => {
|
|
73161
73952
|
const raw = spLocks[attr5];
|
|
73162
73953
|
if (raw === void 0) {
|
|
@@ -73169,7 +73960,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
73169
73960
|
const val = boolAttr2(attr5);
|
|
73170
73961
|
if (val !== void 0) {
|
|
73171
73962
|
fn(val);
|
|
73172
|
-
|
|
73963
|
+
hasAny2 = true;
|
|
73173
73964
|
}
|
|
73174
73965
|
};
|
|
73175
73966
|
set("@_noGrp", (v) => {
|
|
@@ -73208,7 +73999,7 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
73208
73999
|
set("@_noCrop", (v) => {
|
|
73209
74000
|
locks.noCrop = v;
|
|
73210
74001
|
});
|
|
73211
|
-
return
|
|
74002
|
+
return hasAny2 ? locks : void 0;
|
|
73212
74003
|
}
|
|
73213
74004
|
/**
|
|
73214
74005
|
* Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
|
|
@@ -80800,6 +81591,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
|
|
|
80800
81591
|
);
|
|
80801
81592
|
const autoUpdateAttr = externalDataNode["@_autoUpdate"];
|
|
80802
81593
|
const autoUpdate = autoUpdateNode?.["@_val"] === "1" || autoUpdateNode?.["@_val"] === "true" || autoUpdateAttr === "1" || autoUpdateAttr === "true" || false;
|
|
81594
|
+
let isExternal = false;
|
|
80803
81595
|
let targetPath;
|
|
80804
81596
|
try {
|
|
80805
81597
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
@@ -80814,6 +81606,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
|
|
|
80814
81606
|
for (const rel of rels) {
|
|
80815
81607
|
if (String(rel?.["@_Id"] || "") === relId) {
|
|
80816
81608
|
targetPath = String(rel?.["@_Target"] || "").trim() || void 0;
|
|
81609
|
+
isExternal = String(rel?.["@_TargetMode"] || "") === "External";
|
|
80817
81610
|
break;
|
|
80818
81611
|
}
|
|
80819
81612
|
}
|
|
@@ -80822,7 +81615,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
|
|
|
80822
81615
|
} catch {
|
|
80823
81616
|
}
|
|
80824
81617
|
let embeddedWorkbookData;
|
|
80825
|
-
if (targetPath) {
|
|
81618
|
+
if (targetPath && !isExternal) {
|
|
80826
81619
|
try {
|
|
80827
81620
|
const embeddingPath = this.resolveImagePath(chartPartPath, targetPath);
|
|
80828
81621
|
if (embeddingPath.includes("embeddings/") && embeddingPath.endsWith(".xlsx")) {
|
|
@@ -80836,6 +81629,7 @@ var PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
|
|
|
80836
81629
|
}
|
|
80837
81630
|
return {
|
|
80838
81631
|
relId,
|
|
81632
|
+
...isExternal ? { isExternal: true } : {},
|
|
80839
81633
|
targetPath,
|
|
80840
81634
|
autoUpdate,
|
|
80841
81635
|
...embeddedWorkbookData ? { embeddedWorkbookData } : {}
|
|
@@ -81187,6 +81981,8 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
|
|
|
81187
81981
|
...result.categoryLevels ? { categoryLevels: result.categoryLevels } : {},
|
|
81188
81982
|
series: result.series,
|
|
81189
81983
|
title: cxTitleText,
|
|
81984
|
+
titleTextEditable: false,
|
|
81985
|
+
dataLabelTextEditable: false,
|
|
81190
81986
|
style: chartStyle2,
|
|
81191
81987
|
chartPartPath,
|
|
81192
81988
|
chartRelationshipId,
|
|
@@ -81380,12 +82176,34 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
|
|
|
81380
82176
|
colorAdapter
|
|
81381
82177
|
);
|
|
81382
82178
|
const style = chartStyleFromNeutral(neutral, this.extractChartStyle(chartSpace, chartRoot));
|
|
82179
|
+
const titleTx = reader.xml.getChildByLocalName(
|
|
82180
|
+
reader.xml.getChildByLocalName(chartRoot, "title"),
|
|
82181
|
+
"tx"
|
|
82182
|
+
);
|
|
82183
|
+
const titleRich = reader.xml.getChildByLocalName(titleTx, "rich");
|
|
82184
|
+
const titleParagraphs = reader.xml.getChildrenArrayByLocalName(titleRich, "p");
|
|
82185
|
+
const titleTextEditable = Boolean(
|
|
82186
|
+
titleRuns?.length && titleParagraphs.length === 1 && !Object.keys(titleParagraphs[0] ?? {}).some(
|
|
82187
|
+
(key2) => ["br", "fld"].includes(reader.localName(key2))
|
|
82188
|
+
)
|
|
82189
|
+
);
|
|
81383
82190
|
const groupOptions = groupOptionsFromNeutral(groups[0]?.group, chartType);
|
|
81384
82191
|
const linesAndChrome = this.readChartLinesAndChrome(neutral, tree, groups, reader);
|
|
81385
82192
|
const facts = await this.readChartPartFacts(chartSpace, chartRoot, chartPartPath);
|
|
81386
82193
|
const workbook = facts.embeddedWorkbookData;
|
|
81387
82194
|
const dateCategories = rawDateCategories ? { ...rawDateCategories, date1904: neutral.date1904 ?? workbook?.date1904 ?? false } : void 0;
|
|
81388
82195
|
const filled = applyEmbeddedWorkbookFallback(chartType, categories, built.series, workbook);
|
|
82196
|
+
const dataLabelTextEditable = !categoryLevels && !dateCategories && await chartLabelsHaveEditableSources(
|
|
82197
|
+
reader.xml,
|
|
82198
|
+
this.zip,
|
|
82199
|
+
chartSpace,
|
|
82200
|
+
built.seriesNodes,
|
|
82201
|
+
filled.series,
|
|
82202
|
+
filled.categories,
|
|
82203
|
+
facts.externalData,
|
|
82204
|
+
chartPartPath,
|
|
82205
|
+
this.resolveImagePath.bind(this)
|
|
82206
|
+
);
|
|
81389
82207
|
const hasPicture = filled.series.some(
|
|
81390
82208
|
(entry2) => entry2.picture || entry2.impliedPicture || entry2.dataPoints?.some((point) => point.picture || point.impliedPicture)
|
|
81391
82209
|
);
|
|
@@ -81418,6 +82236,14 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
|
|
|
81418
82236
|
...built.filtered,
|
|
81419
82237
|
title: neutralTitleText(neutral.title),
|
|
81420
82238
|
...titleRuns ? { titleRuns } : {},
|
|
82239
|
+
titleTextEditable,
|
|
82240
|
+
dataLabelTextEditable,
|
|
82241
|
+
...dataLabelTextEditable ? {
|
|
82242
|
+
dataLabelSourceShape: {
|
|
82243
|
+
categoryCount: filled.categories.length,
|
|
82244
|
+
seriesValueCounts: filled.series.map((series) => series.values.length)
|
|
82245
|
+
}
|
|
82246
|
+
} : {},
|
|
81421
82247
|
style,
|
|
81422
82248
|
grouping: groupOptions.grouping,
|
|
81423
82249
|
...groupOptions,
|
|
@@ -81439,6 +82265,8 @@ var PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
|
|
|
81439
82265
|
};
|
|
81440
82266
|
|
|
81441
82267
|
// pptx/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts
|
|
82268
|
+
var XSD_INT_MIN = -2147483648;
|
|
82269
|
+
var XSD_INT_MAX = 2147483647;
|
|
81442
82270
|
var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
|
|
81443
82271
|
parseEditorAnimations(slideXml3) {
|
|
81444
82272
|
return this.editorAnimationService.parseEditorAnimations(slideXml3);
|
|
@@ -81621,6 +82449,22 @@ var PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
|
|
|
81621
82449
|
const lexical = String(raw).trim().toLowerCase();
|
|
81622
82450
|
return lexical !== "0" && lexical !== "false";
|
|
81623
82451
|
}
|
|
82452
|
+
/**
|
|
82453
|
+
* Extract `p:presentation/@firstSlideNum` (ECMA-376 §19.2.1.26, an
|
|
82454
|
+
* `xsd:int`). `undefined` when absent, not an integer, or outside the
|
|
82455
|
+
* `xsd:int` range (-2147483648 to 2147483647, which also rejects digit
|
|
82456
|
+
* strings too long to parse), so the spec default (`1`) is never forced
|
|
82457
|
+
* onto the typed model.
|
|
82458
|
+
*/
|
|
82459
|
+
extractFirstSlideNumber() {
|
|
82460
|
+
const pres = this.presentationData?.["p:presentation"];
|
|
82461
|
+
const lexical = String(pres?.["@_firstSlideNum"] ?? "").trim();
|
|
82462
|
+
if (!/^[+-]?\d+$/.test(lexical)) {
|
|
82463
|
+
return void 0;
|
|
82464
|
+
}
|
|
82465
|
+
const value = Number(lexical);
|
|
82466
|
+
return value >= XSD_INT_MIN && value <= XSD_INT_MAX ? value : void 0;
|
|
82467
|
+
}
|
|
81624
82468
|
};
|
|
81625
82469
|
|
|
81626
82470
|
// pptx/core/core/runtime/PptxHandlerRuntimeEmbeddedFonts.ts
|
|
@@ -81847,7 +82691,7 @@ var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
|
|
|
81847
82691
|
);
|
|
81848
82692
|
}
|
|
81849
82693
|
try {
|
|
81850
|
-
this.zip = await
|
|
82694
|
+
this.zip = await JSZip5.loadAsync(data);
|
|
81851
82695
|
this.documentPropertiesUpdater = this.dependencyFactory.createDocumentPropertiesUpdater(
|
|
81852
82696
|
this.zip,
|
|
81853
82697
|
this.parser,
|
|
@@ -81885,6 +82729,8 @@ var PptxHandlerRuntime98 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
|
|
|
81885
82729
|
this.slideMap.clear();
|
|
81886
82730
|
this.savedSlideFingerprints.clear();
|
|
81887
82731
|
this.chartDataBaselines.clear();
|
|
82732
|
+
this.chartWorkbookDataBaselines.clear();
|
|
82733
|
+
this.pendingChartUpdates = void 0;
|
|
81888
82734
|
this.layoutCache.clear();
|
|
81889
82735
|
this.masterCache.clear();
|
|
81890
82736
|
this.templateElementBaselines.reset();
|
|
@@ -82251,7 +83097,7 @@ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
|
|
|
82251
83097
|
this.commentAuthorDetails.size > 0 ? Array.from(this.commentAuthorDetails.values()) : void 0
|
|
82252
83098
|
).withModernCommentAuthors(
|
|
82253
83099
|
this.modernCommentAuthors.size > 0 ? Array.from(this.modernCommentAuthors.values()) : void 0
|
|
82254
|
-
).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withDefaultTextStyle(defaultTextStyle).build();
|
|
83100
|
+
).withConformance(this.isStrictOoxml ? "strict" : "transitional").withEmbedTrueTypeFonts(embedTrueTypeFonts).withFirstSlideNumber(this.extractFirstSlideNumber()).withDefaultTextStyle(defaultTextStyle).build();
|
|
82255
83101
|
}
|
|
82256
83102
|
/**
|
|
82257
83103
|
* Walk the raw XML of every slide to find the highest numeric `@_id`
|
|
@@ -82357,6 +83203,8 @@ var PptxHandlerRuntime99 = class extends PptxHandlerRuntime98 {
|
|
|
82357
83203
|
this.slideMap.clear();
|
|
82358
83204
|
this.savedSlideFingerprints.clear();
|
|
82359
83205
|
this.chartDataBaselines.clear();
|
|
83206
|
+
this.chartWorkbookDataBaselines.clear();
|
|
83207
|
+
this.pendingChartUpdates = void 0;
|
|
82360
83208
|
this.slideRelsMap.clear();
|
|
82361
83209
|
this.externalRelsMap.clear();
|
|
82362
83210
|
this.layoutCache.clear();
|
|
@@ -82741,7 +83589,7 @@ var PptxHandlerRuntime101 = class _PptxHandlerRuntime extends PptxHandlerRuntime
|
|
|
82741
83589
|
constructor(dependencyFactory = new PptxRuntimeDependencyFactory()) {
|
|
82742
83590
|
super();
|
|
82743
83591
|
this.dependencyFactory = dependencyFactory;
|
|
82744
|
-
this.zip = new
|
|
83592
|
+
this.zip = new JSZip5();
|
|
82745
83593
|
this.parser = this.dependencyFactory.createParser();
|
|
82746
83594
|
this.builder = this.dependencyFactory.createBuilder();
|
|
82747
83595
|
this.elementXmlBuilder = new PptxElementXmlBuilder({
|
|
@@ -85513,7 +86361,7 @@ function collectPictureIndexes(slide) {
|
|
|
85513
86361
|
return indexes;
|
|
85514
86362
|
}
|
|
85515
86363
|
async function buildPptxPackage(deck) {
|
|
85516
|
-
const zip = new
|
|
86364
|
+
const zip = new JSZip5();
|
|
85517
86365
|
const usage = { fileNumbers: /* @__PURE__ */ new Map() };
|
|
85518
86366
|
let mediaCounter = 0;
|
|
85519
86367
|
for (const slide of deck.slides) {
|
|
@@ -86305,7 +87153,10 @@ var PptxHandler = class extends PptxHandlerCore {
|
|
|
86305
87153
|
const imported = deserializePptxFromJson(text);
|
|
86306
87154
|
const blankBytes = await buildBlankPresentationArchive({
|
|
86307
87155
|
width: imported.widthEmu,
|
|
86308
|
-
height: imported.heightEmu
|
|
87156
|
+
height: imported.heightEmu,
|
|
87157
|
+
// Saving writes presentation.xml from the loaded archive, not from
|
|
87158
|
+
// the overlaid model, so the archive must carry the value itself.
|
|
87159
|
+
firstSlideNumber: imported.firstSlideNumber
|
|
86309
87160
|
});
|
|
86310
87161
|
const base = await super.load(blankBytes, options);
|
|
86311
87162
|
return applyImportedPptxData(base, imported);
|
|
@@ -86363,4 +87214,4 @@ var PptxHandler = class extends PptxHandlerCore {
|
|
|
86363
87214
|
* `<p:extLst>` (optional)
|
|
86364
87215
|
*/
|
|
86365
87216
|
|
|
86366
|
-
export { ConnectorXmlFactory, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_POWERPOINT_TABLE_STYLE_ID, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MAX_ZIP_ENTRY_COUNT, 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, PptxHandlerRuntime102 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, 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, ZipBombError, addChartCategory, addChartSeries, addTableStyleToMap, applyAfterAnimationBehavior, applyConnectorShapeIds, applySoundToEffectCTn, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive, buildSingleEffectNode, buildSlideReferenceRemap, capturedPresetIds, capturedPresetNativeAnimation, capturedSubtypes, convertPptToPptx, createAutoNumberSequence, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createFreeformElement, createGroupElement, createImageElement, createMediaElement, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTableStyleEntry, createTextElement, deleteTableStyleFromMap, ensureChartData, ensureDataPoint, extractAfterAnimationFromSubTnLst, extractGraphicBuilds, extractTableCellTextRuns, generateTableStyleGuid, getCapturedPreset, getCapturedTree, isEncryptedLegacyPpt, isLegacyPpt, mergeNativeSoundIntoEditorAnimations, nextAutoNumber, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseCondition, parseConditionList, parseFilterToken, parseTimeTargetElement, rebuildTableStructureInRawXml, reconcileAnimationTargets, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveOoxmlPresetMapping, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setChartAreaFormat, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, validateSeriesIndex };
|
|
87217
|
+
export { AFTER_ANIMATION_VALUES, ConnectorXmlFactory, DEFAULT_AFTER_ANIMATION_DIM_COLOR, DEFAULT_ANIMATION_DURATION_MS, DEFAULT_ANIMATION_TRIGGER, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_POWERPOINT_TABLE_STYLE_ID, ELEMENT_PARAGRAPH_GEOMETRY_KEYS, EncryptedPptError, MAX_ZIP_ENTRY_COUNT, 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, PptxHandlerRuntime102 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, 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, ZipBombError, addChartCategory, addChartSeries, addTableStyleToMap, animationFor, applyAfterAnimationBehavior, applyAfterAnimationFromEditorList, applyConnectorShapeIds, applySoundToEffectCTn, applyTableCellTextAndStyle, assertChartGradientSupported, breakAutoNumberRun, buildBlankPresentationArchive, buildRelationshipsXml, buildSingleEffectNode, buildSlideReferenceRemap, buildXml, capturedPresetIds, capturedPresetNativeAnimation, capturedSubtypes, clonePartGraph, convertPptToPptx, createAutoNumberSequence, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createFreeformElement, createGroupElement, createImageElement, createMediaElement, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTableStyleEntry, createTextElement, deleteTableStyleFromMap, elements, ensureChartData, ensureDataPoint, extractAfterAnimationFromSubTnLst, extractGraphicBuilds, extractTableCellTextRuns, first, generateTableStyleGuid, getAfterAnimation, getAfterAnimationState, getCapturedPreset, getCapturedTree, hasAnimation, isEncryptedLegacyPpt, isLegacyPpt, isNativeAfterAnimationOnly, mergeNativeAfterAnimationIntoEditorAnimations, mergeNativeSoundIntoEditorAnimations, nextAutoNumber, nextRelationshipId, normalizeTableStyleGuid, ooxmlToPresetName, parseAnimEffectFilter, parseCondition, parseConditionList, parseFilterToken, parseRelationships, parseTimeTargetElement, parseXml, rebuildTableStructureInRawXml, reconcileAnimationTargets, relationshipsPartFor, relativePartTarget, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeEmptyDataPoint, resetIdCounter, resolveConnectorShapeIds, resolveDirectionSubtype, resolveOoxmlPresetMapping, resolveOpacitySet, resolvePartPath, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeTimeTargetElement, setAfterAnimation, setAfterAnimationColor, setChartAreaFormat, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGroupOptions, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, timingCurveToAccelDecel, toChartGradientFill, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, upsert, validateSeriesIndex };
|