ooxml-core 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/automation/index.cjs +207 -207
- package/dist/automation/index.mjs +207 -207
- package/dist/{chunk-M2DFN3SP.mjs → chunk-XBIZIBTJ.mjs} +507 -10
- package/dist/collab/merge-values.d.ts +14 -0
- package/dist/collab/merge-values.d.ts.map +1 -0
- package/dist/docx/embedded.cjs +476 -474
- package/dist/docx/embedded.mjs +476 -474
- package/dist/docx/index.cjs +1075 -719
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +1075 -720
- package/dist/docx/layout/index.cjs +4 -0
- package/dist/docx/layout/index.mjs +4 -0
- package/dist/docx/load/index.cjs +164 -164
- package/dist/docx/load/index.mjs +164 -164
- package/dist/docx/merge-snapshots.d.ts +9 -0
- package/dist/docx/merge-snapshots.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +155 -155
- package/dist/docx/ui/index.mjs +155 -155
- package/dist/embedding/index.cjs +207 -0
- package/dist/embedding/index.d.ts +3 -0
- package/dist/embedding/index.d.ts.map +1 -1
- package/dist/embedding/index.mjs +205 -1
- package/dist/embedding/onedrive/client.d.ts +4 -0
- package/dist/embedding/onedrive/client.d.ts.map +1 -0
- package/dist/embedding/onedrive/index.cjs +617 -0
- package/dist/embedding/onedrive/index.d.ts +6 -0
- package/dist/embedding/onedrive/index.d.ts.map +1 -0
- package/dist/embedding/onedrive/index.mjs +611 -0
- package/dist/embedding/onedrive/metadata.d.ts +6 -0
- package/dist/embedding/onedrive/metadata.d.ts.map +1 -0
- package/dist/embedding/onedrive/requests.d.ts +8 -0
- package/dist/embedding/onedrive/requests.d.ts.map +1 -0
- package/dist/embedding/onedrive/session.d.ts +4 -0
- package/dist/embedding/onedrive/session.d.ts.map +1 -0
- package/dist/embedding/onedrive/transport.d.ts +9 -0
- package/dist/embedding/onedrive/transport.d.ts.map +1 -0
- package/dist/embedding/onedrive/types.d.ts +86 -0
- package/dist/embedding/onedrive/types.d.ts.map +1 -0
- package/dist/embedding/onedrive/upload.d.ts +3 -0
- package/dist/embedding/onedrive/upload.d.ts.map +1 -0
- package/dist/embedding/storage-merge.d.ts +8 -0
- package/dist/embedding/storage-merge.d.ts.map +1 -0
- package/dist/embedding/storage-session.d.ts +7 -0
- package/dist/embedding/storage-session.d.ts.map +1 -0
- package/dist/embedding/versioned-storage.d.ts +67 -0
- package/dist/embedding/versioned-storage.d.ts.map +1 -0
- package/dist/index.cjs +1013 -340
- package/dist/index.mjs +1013 -340
- package/dist/opc/index.cjs +680 -216
- package/dist/opc/index.d.ts +1 -0
- package/dist/opc/index.d.ts.map +1 -1
- package/dist/opc/index.mjs +680 -217
- package/dist/opc/merge-snapshots.d.ts +26 -0
- package/dist/opc/merge-snapshots.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +20 -6
- package/dist/pptx/automation/index.d.ts +8 -17
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/index.d.ts +1 -3
- package/dist/pptx/automation/schemas/index.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -3
- package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
- package/dist/pptx/chunks/{collaboration-text-codec-Du_XeE_i.d.ts → collaboration-text-codec-1VmwD3yq.d.ts} +1 -3
- package/dist/pptx/chunks/collaboration-text-codec-1VmwD3yq.d.ts.map +1 -0
- package/dist/pptx/chunks/{collaboration-text-merge-DWWWdT_t.d.ts → collaboration-text-merge-B-tth-0W.d.ts} +2 -4
- package/dist/pptx/chunks/collaboration-text-merge-B-tth-0W.d.ts.map +1 -0
- package/dist/pptx/chunks/{collaboration-text-positions-MMT3GkZi.d.ts → collaboration-text-positions-D-1Jo1Fz.d.ts} +1 -3
- package/dist/pptx/chunks/collaboration-text-positions-D-1Jo1Fz.d.ts.map +1 -0
- package/dist/pptx/chunks/{collaboration-text-session-D0NOLQk7.d.ts → collaboration-text-session-CWHTaWF4.d.ts} +4 -6
- package/dist/pptx/chunks/collaboration-text-session-CWHTaWF4.d.ts.map +1 -0
- package/dist/pptx/chunks/{collaboration-text-session-delta-CzJGrTKJ.d.ts → collaboration-text-session-delta-Dxzybssp.d.ts} +2 -4
- package/dist/pptx/chunks/collaboration-text-session-delta-Dxzybssp.d.ts.map +1 -0
- package/dist/pptx/chunks/{color-ref-DT599vEx.d.ts → color-ref-CwUQoKPJ.d.ts} +1 -3
- package/dist/pptx/chunks/color-ref-CwUQoKPJ.d.ts.map +1 -0
- package/dist/pptx/chunks/{elements-f3UbFph-.d.ts → elements-DheCTwi0.d.ts} +4 -54
- package/dist/pptx/chunks/elements-DheCTwi0.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Bp-1pGo1.d.ts → index-B4ofjG6_.d.ts} +6 -384
- package/dist/pptx/chunks/index-B4ofjG6_.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BnH2QjYm.d.ts → index-Jcce8TlI.d.ts} +5 -37
- package/dist/pptx/chunks/index-Jcce8TlI.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-pLLN4OTz.d.ts → index-bgj0Ztnq.d.ts} +23 -543
- package/dist/pptx/chunks/index-bgj0Ztnq.d.ts.map +1 -0
- package/dist/pptx/chunks/{inspection-status-DjiWd_Aa.d.ts → inspection-status-TKac7eqb.d.ts} +1 -13
- package/dist/pptx/chunks/inspection-status-TKac7eqb.d.ts.map +1 -0
- package/dist/pptx/chunks/{schemas-fuDGetRe.d.ts → schemas-LHsDbVOw.d.ts} +1 -29
- package/dist/pptx/chunks/schemas-LHsDbVOw.d.ts.map +1 -0
- package/dist/pptx/chunks/{smart-art-CmOrPLLQ.d.ts → smart-art-DB37AsFP.d.ts} +2 -46
- package/dist/pptx/chunks/smart-art-DB37AsFP.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-D5sgspO6.d.ts → text-operations-CdgEnFuK.d.ts} +4 -32
- package/dist/pptx/chunks/text-operations-CdgEnFuK.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-P9xVnXXf.d.ts → text-t_wJ2OwM.d.ts} +2 -12
- package/dist/pptx/chunks/text-t_wJ2OwM.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +20 -6
- package/dist/pptx/cli/index.d.ts +1 -3
- package/dist/pptx/cli/index.d.ts.map +1 -1
- package/dist/pptx/converter/index.cjs +7 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/editor/ai/table-merge.d.ts +0 -2
- package/dist/pptx/editor/ai/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/loader/element-patch-walker.d.ts +0 -2
- package/dist/pptx/editor/loader/element-patch-walker.d.ts.map +1 -1
- package/dist/pptx/editor/loader/is-external-url.d.ts +0 -2
- package/dist/pptx/editor/loader/is-external-url.d.ts.map +1 -1
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts +0 -2
- package/dist/pptx/editor/loader/lazy-image-resolution.d.ts.map +1 -1
- package/dist/pptx/editor/loader/load-content-helpers.d.ts +0 -2
- package/dist/pptx/editor/loader/load-content-helpers.d.ts.map +1 -1
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts +0 -2
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts +0 -2
- package/dist/pptx/editor/loader/text-fill-image-paths.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-list.d.ts +0 -2
- package/dist/pptx/editor/render/bullet-list.d.ts.map +1 -1
- package/dist/pptx/editor/render/bullet-toggle.d.ts +0 -2
- package/dist/pptx/editor/render/bullet-toggle.d.ts.map +1 -1
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts +0 -2
- package/dist/pptx/editor/render/chart-user-shape-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/clone.d.ts +0 -2
- package/dist/pptx/editor/render/clone.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-active-session.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-active-session.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-departure.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-departure.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-load-origin.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-load-origin.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.d.ts +4 -8
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-codec.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-lease.d.ts +0 -2
- package/dist/pptx/editor/render/collaboration-text-lease.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-merge.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +2 -4
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-positions.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-projection.d.ts +1 -3
- package/dist/pptx/editor/render/collaboration-text-projection.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-session-apply.d.ts +3 -5
- package/dist/pptx/editor/render/collaboration-text-session-apply.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-session-delta.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -3
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-text-session.d.ts +1 -1
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts +2 -4
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts.map +1 -1
- package/dist/pptx/editor/render/custom-show-operations.d.ts +0 -2
- package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/deck-save-encryption.d.ts +0 -2
- package/dist/pptx/editor/render/deck-save-encryption.d.ts.map +1 -1
- package/dist/pptx/editor/render/editor-history.d.ts +0 -2
- package/dist/pptx/editor/render/editor-history.d.ts.map +1 -1
- package/dist/pptx/editor/render/editor-mutations.d.ts +0 -2
- package/dist/pptx/editor/render/editor-mutations.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-locks.d.ts +0 -2
- package/dist/pptx/editor/render/element-locks.d.ts.map +1 -1
- package/dist/pptx/editor/render/element-operations.d.ts +0 -2
- package/dist/pptx/editor/render/element-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/element.d.ts +0 -2
- package/dist/pptx/editor/render/element.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.d.ts +2 -4
- package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
- package/dist/pptx/editor/render/font-family-update.d.ts +1 -3
- package/dist/pptx/editor/render/font-family-update.d.ts.map +1 -1
- package/dist/pptx/editor/render/group-drill.d.ts +0 -2
- package/dist/pptx/editor/render/group-drill.d.ts.map +1 -1
- package/dist/pptx/editor/render/inline-list-body.d.ts +0 -2
- package/dist/pptx/editor/render/inline-list-body.d.ts.map +1 -1
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +1 -3
- package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-empty-paragraph.d.ts +0 -2
- package/dist/pptx/editor/render/remap-empty-paragraph.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-paragraph-sources.d.ts +0 -2
- package/dist/pptx/editor/render/remap-paragraph-sources.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text-bullets.d.ts +0 -2
- package/dist/pptx/editor/render/remap-text-bullets.d.ts.map +1 -1
- package/dist/pptx/editor/render/remap-text.d.ts +0 -2
- package/dist/pptx/editor/render/remap-text.d.ts.map +1 -1
- package/dist/pptx/editor/render/schema-label-keys.d.ts +0 -2
- package/dist/pptx/editor/render/schema-label-keys.d.ts.map +1 -1
- package/dist/pptx/editor/render/section-operations.d.ts +0 -2
- package/dist/pptx/editor/render/section-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-background-patch.d.ts +0 -2
- package/dist/pptx/editor/render/slide-background-patch.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-operations.d.ts +0 -2
- package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-search.d.ts +0 -2
- package/dist/pptx/editor/render/slide-search.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-size-rescale.d.ts +0 -2
- package/dist/pptx/editor/render/slide-size-rescale.d.ts.map +1 -1
- package/dist/pptx/editor/render/slide-transition-edits.d.ts +0 -2
- package/dist/pptx/editor/render/slide-transition-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-edit.d.ts +0 -2
- package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-cell-merge.d.ts +0 -2
- package/dist/pptx/editor/render/table-cell-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts +0 -2
- package/dist/pptx/editor/render/table-data-grid-ops.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.d.ts +0 -2
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-merge.d.ts +0 -2
- package/dist/pptx/editor/render/table-merge.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts +0 -2
- package/dist/pptx/editor/render/table-style-editor-descriptor.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts +0 -2
- package/dist/pptx/editor/render/table-style-editor-edit.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts +0 -2
- package/dist/pptx/editor/render/table-style-editor-parts.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-style-map-edits.d.ts +0 -2
- package/dist/pptx/editor/render/table-style-map-edits.d.ts.map +1 -1
- package/dist/pptx/editor/render/template-editing.d.ts +0 -2
- package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-content-style.d.ts +1 -3
- package/dist/pptx/editor/render/text-content-style.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -4
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts +0 -2
- package/dist/pptx/editor/render/text-segment-paragraph-break.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +2 -4
- package/dist/pptx/editor/render/text-style-scope.d.ts.map +1 -1
- package/dist/pptx/editor/render/text-theme.d.ts +0 -2
- package/dist/pptx/editor/render/text-theme.d.ts.map +1 -1
- package/dist/pptx/editor/render/theme-editor-model.d.ts +0 -2
- package/dist/pptx/editor/render/theme-editor-model.d.ts.map +1 -1
- package/dist/pptx/editor/render/theme-editor-presets.d.ts +0 -2
- package/dist/pptx/editor/render/theme-editor-presets.d.ts.map +1 -1
- package/dist/pptx/editor/render/update-text-segment-style.d.ts +1 -3
- package/dist/pptx/editor/render/update-text-segment-style.d.ts.map +1 -1
- package/dist/pptx/index.cjs +1687 -1159
- package/dist/pptx/index.d.ts +10 -10
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/node/index.d.ts +1 -3
- package/dist/pptx/node/index.d.ts.map +1 -1
- package/dist/pptx/signature-node/index.d.ts +1 -21
- package/dist/pptx/signature-node/index.d.ts.map +1 -1
- package/dist/pptx/smartart-layouts/index.d.ts +1 -7
- package/dist/pptx/smartart-layouts/index.d.ts.map +1 -1
- package/dist/pptx/ui/index.d.ts +1 -9
- package/dist/pptx/ui/index.d.ts.map +1 -1
- package/dist/teams/index.cjs +215 -201
- package/dist/teams/index.mjs +215 -201
- package/dist/text/index.cjs +193 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.mjs +193 -1
- package/dist/text/merge-three-way.d.ts +9 -0
- package/dist/text/merge-three-way.d.ts.map +1 -0
- package/dist/visio/collab/index.cjs +226 -7
- package/dist/visio/collab/index.d.ts +1 -0
- package/dist/visio/collab/index.d.ts.map +1 -1
- package/dist/visio/collab/index.mjs +225 -7
- package/dist/visio/collab/merge-snapshots.d.ts +14 -0
- package/dist/visio/collab/merge-snapshots.d.ts.map +1 -0
- package/dist/visio/index.cjs +9 -9
- package/dist/visio/index.mjs +9 -9
- package/dist/visio/ui/index.cjs +9 -9
- package/dist/visio/ui/index.mjs +9 -9
- package/dist/xlsx/collab/index.cjs +49966 -507
- package/dist/xlsx/collab/index.d.ts +1 -0
- package/dist/xlsx/collab/index.d.ts.map +1 -1
- package/dist/xlsx/collab/index.mjs +49961 -507
- package/dist/xlsx/collab/merge-residual.d.ts +16 -0
- package/dist/xlsx/collab/merge-residual.d.ts.map +1 -0
- package/dist/xlsx/collab/merge-snapshots.d.ts +8 -0
- package/dist/xlsx/collab/merge-snapshots.d.ts.map +1 -0
- package/dist/xlsx/index.cjs +202 -202
- package/dist/xlsx/index.mjs +202 -202
- package/dist/xlsx/load/index.cjs +155 -155
- package/dist/xlsx/load/index.mjs +155 -155
- package/dist/xlsx/ui/index.cjs +202 -202
- package/dist/xlsx/ui/index.mjs +202 -202
- package/dist/xml/index.cjs +390 -22
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/index.mjs +390 -23
- package/dist/xml/merge-three-way.d.ts +16 -0
- package/dist/xml/merge-three-way.d.ts.map +1 -0
- package/package.json +13 -8
- package/dist/pptx/chunks/collaboration-text-codec-Du_XeE_i.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-merge-DWWWdT_t.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-positions-MMT3GkZi.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-D0NOLQk7.d.ts.map +0 -1
- package/dist/pptx/chunks/collaboration-text-session-delta-CzJGrTKJ.d.ts.map +0 -1
- package/dist/pptx/chunks/color-ref-DT599vEx.d.ts.map +0 -1
- package/dist/pptx/chunks/elements-f3UbFph-.d.ts.map +0 -1
- package/dist/pptx/chunks/index-BnH2QjYm.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Bp-1pGo1.d.ts.map +0 -1
- package/dist/pptx/chunks/index-pLLN4OTz.d.ts.map +0 -1
- package/dist/pptx/chunks/inspection-status-DjiWd_Aa.d.ts.map +0 -1
- package/dist/pptx/chunks/schemas-fuDGetRe.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-CmOrPLLQ.d.ts.map +0 -1
- package/dist/pptx/chunks/text-P9xVnXXf.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-D5sgspO6.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-OEM2ECAJ.mjs';
|
|
2
2
|
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, chartFormatTargetKey, readChartElementFormat, hasGradientField, applyGradient, mirrorFlatFields, mirrorTextColor, withSeries, applyChartGroupOptionsInput, countExistingLayouts, addLayoutToSlideMaster, addLayoutContentType, createLayout, STANDARD_LAYOUTS, generateLayoutXml, layoutRelsXml, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, clonePartGraph, buildBlankPresentationArchive, relativePartTarget, PptxXmlBuilder } from './chunk-RHQQS6LJ.mjs';
|
|
3
|
-
import { EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, hasTextProperties, nextRelationshipId, escAttr } from './chunk-J43V3QOA.mjs';
|
|
4
|
-
import { openPptxZip } from './chunk-EYCM7RVL.mjs';
|
|
3
|
+
import { EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, hasTextProperties, nextRelationshipId, escAttr, NS } from './chunk-J43V3QOA.mjs';
|
|
4
|
+
import { openPptxZip, openZip } from './chunk-EYCM7RVL.mjs';
|
|
5
5
|
import { cloneSlide, cloneElement } from './chunk-VDUNZTJC.mjs';
|
|
6
6
|
|
|
7
7
|
// pptx/core/types/transition.ts
|
|
@@ -242,6 +242,469 @@ var THEME_PRESETS = [
|
|
|
242
242
|
METROPOLITAN_PRESET
|
|
243
243
|
];
|
|
244
244
|
|
|
245
|
+
// text/text-diff.ts
|
|
246
|
+
var isLowSurrogate = (text, at) => {
|
|
247
|
+
const code = text.charCodeAt(at);
|
|
248
|
+
return code >= 56320 && code <= 57343;
|
|
249
|
+
};
|
|
250
|
+
function shortestEdit(n, m, same, maxEdits) {
|
|
251
|
+
const max = Math.min(n + m, maxEdits);
|
|
252
|
+
const offset = max + 1;
|
|
253
|
+
const v = new Int32Array(2 * max + 3);
|
|
254
|
+
const trace = [];
|
|
255
|
+
for (let d = 0; d <= max; d++) {
|
|
256
|
+
for (let k = -d; k <= d; k += 2) {
|
|
257
|
+
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
258
|
+
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
259
|
+
let y = x - k;
|
|
260
|
+
while (x < n && y < m && same(x, y)) {
|
|
261
|
+
x++;
|
|
262
|
+
y++;
|
|
263
|
+
}
|
|
264
|
+
v[offset + k] = x;
|
|
265
|
+
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
266
|
+
}
|
|
267
|
+
trace.push(v.slice(offset - d, offset + d + 1));
|
|
268
|
+
}
|
|
269
|
+
return void 0;
|
|
270
|
+
}
|
|
271
|
+
function backtrack(trace, n, m, d) {
|
|
272
|
+
const edits = [];
|
|
273
|
+
let x = n;
|
|
274
|
+
let y = m;
|
|
275
|
+
for (let step = d; step > 0; step--) {
|
|
276
|
+
const previous = trace[step - 1];
|
|
277
|
+
const at = (k2) => previous[k2 + step - 1];
|
|
278
|
+
const k = x - y;
|
|
279
|
+
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
280
|
+
const before = down ? k + 1 : k - 1;
|
|
281
|
+
const startX = at(before);
|
|
282
|
+
const startY = startX - before;
|
|
283
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
284
|
+
x = startX;
|
|
285
|
+
y = startY;
|
|
286
|
+
}
|
|
287
|
+
return edits.reverse();
|
|
288
|
+
}
|
|
289
|
+
function changesOf(edits) {
|
|
290
|
+
const changes = [];
|
|
291
|
+
for (const [x, y, inserts] of edits) {
|
|
292
|
+
const last = changes.at(-1);
|
|
293
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
294
|
+
if (inserts) last.toEnd++;
|
|
295
|
+
else last.fromEnd++;
|
|
296
|
+
} else
|
|
297
|
+
changes.push({
|
|
298
|
+
fromStart: x,
|
|
299
|
+
fromEnd: inserts ? x : x + 1,
|
|
300
|
+
toStart: y,
|
|
301
|
+
toEnd: inserts ? y + 1 : y
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
return changes;
|
|
305
|
+
}
|
|
306
|
+
function characterChanges(a, b, maxEdits) {
|
|
307
|
+
const edits = shortestEdit(
|
|
308
|
+
a.length,
|
|
309
|
+
b.length,
|
|
310
|
+
(x, y) => a.charCodeAt(x) === b.charCodeAt(y),
|
|
311
|
+
maxEdits
|
|
312
|
+
);
|
|
313
|
+
return edits && changesOf(edits);
|
|
314
|
+
}
|
|
315
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
316
|
+
function tokensOf(text, ids) {
|
|
317
|
+
const tokens = [];
|
|
318
|
+
const starts = [];
|
|
319
|
+
for (const match of text.matchAll(TOKEN)) {
|
|
320
|
+
let id = ids.get(match[0]);
|
|
321
|
+
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
322
|
+
tokens.push(id);
|
|
323
|
+
starts.push(match.index);
|
|
324
|
+
}
|
|
325
|
+
starts.push(text.length);
|
|
326
|
+
return { tokens, starts };
|
|
327
|
+
}
|
|
328
|
+
function tokenChanges(a, b, maxEdits) {
|
|
329
|
+
const ids = /* @__PURE__ */ new Map();
|
|
330
|
+
const from = tokensOf(a, ids);
|
|
331
|
+
const to = tokensOf(b, ids);
|
|
332
|
+
const edits = shortestEdit(
|
|
333
|
+
from.tokens.length,
|
|
334
|
+
to.tokens.length,
|
|
335
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
336
|
+
maxEdits
|
|
337
|
+
);
|
|
338
|
+
if (!edits) return void 0;
|
|
339
|
+
let budget = maxEdits;
|
|
340
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
341
|
+
const change = {
|
|
342
|
+
fromStart: from.starts[stretch.fromStart],
|
|
343
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
344
|
+
toStart: to.starts[stretch.toStart],
|
|
345
|
+
toEnd: to.starts[stretch.toEnd]
|
|
346
|
+
};
|
|
347
|
+
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
348
|
+
a.slice(change.fromStart, change.fromEnd),
|
|
349
|
+
b.slice(change.toStart, change.toEnd),
|
|
350
|
+
budget
|
|
351
|
+
) : void 0;
|
|
352
|
+
if (!inner) return [change];
|
|
353
|
+
for (const found of inner)
|
|
354
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
355
|
+
return inner.map((found) => ({
|
|
356
|
+
fromStart: found.fromStart + change.fromStart,
|
|
357
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
358
|
+
toStart: found.toStart + change.toStart,
|
|
359
|
+
toEnd: found.toEnd + change.toStart
|
|
360
|
+
}));
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function diffText(from, to, maxEdits = 500) {
|
|
364
|
+
let start = 0;
|
|
365
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
366
|
+
start++;
|
|
367
|
+
let end = 0;
|
|
368
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
369
|
+
end++;
|
|
370
|
+
const a = from.slice(start, from.length - end);
|
|
371
|
+
const b = to.slice(start, to.length - end);
|
|
372
|
+
if (!a.length && !b.length) return [];
|
|
373
|
+
const found = a.length && b.length ? characterChanges(a, b, maxEdits) ?? tokenChanges(a, b, maxEdits) : void 0;
|
|
374
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a.length, toStart: 0, toEnd: b.length }];
|
|
375
|
+
const result = [];
|
|
376
|
+
for (const change of changes) {
|
|
377
|
+
const placed = {
|
|
378
|
+
fromStart: change.fromStart + start,
|
|
379
|
+
fromEnd: change.fromEnd + start,
|
|
380
|
+
toStart: change.toStart + start,
|
|
381
|
+
toEnd: change.toEnd + start
|
|
382
|
+
};
|
|
383
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
384
|
+
placed.fromStart--;
|
|
385
|
+
placed.toStart--;
|
|
386
|
+
}
|
|
387
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
388
|
+
placed.fromEnd++;
|
|
389
|
+
placed.toEnd++;
|
|
390
|
+
}
|
|
391
|
+
const last = result.at(-1);
|
|
392
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
393
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
394
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
395
|
+
} else result.push(placed);
|
|
396
|
+
}
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// text/merge-three-way.ts
|
|
401
|
+
function mergeTextThreeWay(base, local, remote) {
|
|
402
|
+
if (local === remote || base === remote) return { status: "merged", text: local };
|
|
403
|
+
if (base === local) return { status: "merged", text: remote };
|
|
404
|
+
if (Math.max(base.length, local.length, remote.length) > 1e6)
|
|
405
|
+
return { status: "unresolved" };
|
|
406
|
+
const changes = (value) => diffText(base, value).map((change) => ({
|
|
407
|
+
start: change.fromStart,
|
|
408
|
+
end: change.fromEnd,
|
|
409
|
+
text: value.slice(change.toStart, change.toEnd)
|
|
410
|
+
}));
|
|
411
|
+
const edits = changes(local);
|
|
412
|
+
for (const next of changes(remote)) {
|
|
413
|
+
if (edits.some(
|
|
414
|
+
(edit) => edit.start === next.start && edit.end === next.end && edit.text === next.text
|
|
415
|
+
))
|
|
416
|
+
continue;
|
|
417
|
+
if (edits.some((edit) => {
|
|
418
|
+
if (edit.start === edit.end && next.start === next.end) return false;
|
|
419
|
+
if (edit.start === edit.end) return edit.start > next.start && edit.start < next.end;
|
|
420
|
+
if (next.start === next.end) return next.start > edit.start && next.start < edit.end;
|
|
421
|
+
return edit.start < next.end && next.start < edit.end;
|
|
422
|
+
}))
|
|
423
|
+
return { status: "unresolved" };
|
|
424
|
+
edits.push(next);
|
|
425
|
+
}
|
|
426
|
+
edits.sort(
|
|
427
|
+
(a, b) => a.start - b.start || a.end - b.end || (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)
|
|
428
|
+
);
|
|
429
|
+
let text = "", cursor = 0;
|
|
430
|
+
for (const edit of edits) {
|
|
431
|
+
text += base.slice(cursor, edit.start) + edit.text;
|
|
432
|
+
cursor = edit.end;
|
|
433
|
+
}
|
|
434
|
+
return { status: "merged", text: text + base.slice(cursor) };
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// xml/merge-three-way.ts
|
|
438
|
+
var tag = (node) => `${node.namespaceURI ?? ""}|${node.localName ?? node.tagName}`;
|
|
439
|
+
var xml = (node) => node ? buildXml(node) : void 0;
|
|
440
|
+
function childrenByKey(parent, options, repeated) {
|
|
441
|
+
const result = /* @__PURE__ */ new Map();
|
|
442
|
+
const counts = /* @__PURE__ */ new Map();
|
|
443
|
+
for (const child of elements(parent)) {
|
|
444
|
+
const name = tag(child), explicit = options.keyElement?.(child, parent);
|
|
445
|
+
const index = counts.get(name) ?? 0;
|
|
446
|
+
counts.set(name, index + 1);
|
|
447
|
+
if (!explicit && repeated.has(name) && !options.allowPositional?.(parent))
|
|
448
|
+
throw new Error("Ambiguous repeated elements");
|
|
449
|
+
const key = explicit ? `${name}@${explicit}` : `${name}#${index}`;
|
|
450
|
+
if (result.has(key)) throw new Error("Duplicate element identity");
|
|
451
|
+
result.set(key, child);
|
|
452
|
+
}
|
|
453
|
+
return result;
|
|
454
|
+
}
|
|
455
|
+
function orderKeys(base, local, remote) {
|
|
456
|
+
const same = (a, b) => a.length === b.length && a.every((key, index) => key === b[index]);
|
|
457
|
+
if (same(base, local)) return [...remote];
|
|
458
|
+
if (same(base, remote) || same(local, remote)) return [...local];
|
|
459
|
+
const keys = [.../* @__PURE__ */ new Set([...remote, ...local])].sort();
|
|
460
|
+
const edges = new Map(keys.map((key) => [key, /* @__PURE__ */ new Set()]));
|
|
461
|
+
const degree = new Map(keys.map((key) => [key, 0]));
|
|
462
|
+
for (const sequence of [local, remote])
|
|
463
|
+
for (let i = 1; i < sequence.length; i++) {
|
|
464
|
+
const previous = sequence[i - 1], next = sequence[i];
|
|
465
|
+
if (!edges.get(previous).has(next)) {
|
|
466
|
+
edges.get(previous).add(next);
|
|
467
|
+
degree.set(next, degree.get(next) + 1);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
const out = [];
|
|
471
|
+
const ready = keys.filter((key) => degree.get(key) === 0);
|
|
472
|
+
while (ready.length) {
|
|
473
|
+
const next = ready.sort().shift();
|
|
474
|
+
out.push(next);
|
|
475
|
+
for (const key of edges.get(next)) {
|
|
476
|
+
degree.set(key, degree.get(key) - 1);
|
|
477
|
+
if (degree.get(key) === 0) ready.push(key);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return out.length === keys.length ? out : void 0;
|
|
481
|
+
}
|
|
482
|
+
function mergeXmlThreeWay(baseXml, localXml, remoteXml, options = {}) {
|
|
483
|
+
if (localXml === remoteXml || baseXml === remoteXml) return { status: "merged", xml: localXml };
|
|
484
|
+
if (baseXml === localXml) return { status: "merged", xml: remoteXml };
|
|
485
|
+
const issues = [];
|
|
486
|
+
try {
|
|
487
|
+
let merge2 = function(b, l, r, path) {
|
|
488
|
+
const bx = xml(b), lx = xml(l), rx = xml(r);
|
|
489
|
+
if (lx === rx || bx === rx) return l ? copy(l) : void 0;
|
|
490
|
+
if (bx === lx) return r ? copy(r) : void 0;
|
|
491
|
+
if (!b && l && r && tag(l) === tag(r) && !elements(l).length && !elements(r).length) {
|
|
492
|
+
const resolved = options.resolveText?.(r, l, r);
|
|
493
|
+
if (resolved !== void 0) {
|
|
494
|
+
const node = copy(r);
|
|
495
|
+
node.textContent = resolved;
|
|
496
|
+
return node;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (!b || !l || !r || tag(b) !== tag(l) || tag(b) !== tag(r)) {
|
|
500
|
+
issues.push(`${path}: overlapping structural changes`);
|
|
501
|
+
return void 0;
|
|
502
|
+
}
|
|
503
|
+
const out = remote.createElementNS(r.namespaceURI, r.tagName);
|
|
504
|
+
const attrs = (node) => new Map(
|
|
505
|
+
Array.from(node.attributes).map((a) => [
|
|
506
|
+
`${a.namespaceURI ?? ""}|${a.localName ?? a.name}`,
|
|
507
|
+
a
|
|
508
|
+
])
|
|
509
|
+
);
|
|
510
|
+
const ba = attrs(b), la = attrs(l), ra = attrs(r);
|
|
511
|
+
for (const key of /* @__PURE__ */ new Set([...ba.keys(), ...la.keys(), ...ra.keys()])) {
|
|
512
|
+
const old = ba.get(key)?.value, left = la.get(key)?.value, right = ra.get(key)?.value;
|
|
513
|
+
const value = left === right || right === old ? left : left === old ? right : void 0;
|
|
514
|
+
if (left !== right && left !== old && right !== old) {
|
|
515
|
+
issues.push(`${path}: overlapping attribute ${key}`);
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
const source = ra.get(key) ?? la.get(key) ?? ba.get(key);
|
|
519
|
+
if (value !== void 0) out.setAttributeNS(source.namespaceURI, source.name, value);
|
|
520
|
+
}
|
|
521
|
+
const lists = [b, l, r].map(elements);
|
|
522
|
+
if (lists.every((list) => list.length === 0)) {
|
|
523
|
+
if ([b, l, r].some(
|
|
524
|
+
(node) => Array.from(node.childNodes).some(
|
|
525
|
+
(child) => child.nodeType !== 3 && child.nodeType !== 4
|
|
526
|
+
)
|
|
527
|
+
)) {
|
|
528
|
+
issues.push(`${path}: non-text leaf content requires explicit preservation`);
|
|
529
|
+
return void 0;
|
|
530
|
+
}
|
|
531
|
+
const texts = [b, l, r].map((node) => node.textContent ?? "");
|
|
532
|
+
const override = options.resolveText?.(b, l, r);
|
|
533
|
+
const value = override !== void 0 ? { status: "merged", text: override } : texts[1] === texts[2] || texts[0] === texts[2] ? { status: "merged", text: texts[1] } : texts[0] === texts[1] ? { status: "merged", text: texts[2] } : options.allowText?.(b) ? mergeTextThreeWay(texts[0], texts[1], texts[2]) : { status: "unresolved" };
|
|
534
|
+
if (value.status !== "merged") issues.push(`${path}: overlapping text changes`);
|
|
535
|
+
else if (value.text) out.appendChild(remote.createTextNode(value.text));
|
|
536
|
+
return out;
|
|
537
|
+
}
|
|
538
|
+
if ([b, l, r].some(
|
|
539
|
+
(node) => Array.from(node.childNodes).some(
|
|
540
|
+
(child) => child.nodeType !== 1 && (child.nodeType !== 3 || Boolean(child.textContent?.trim()))
|
|
541
|
+
)
|
|
542
|
+
)) {
|
|
543
|
+
issues.push(`${path}: mixed content cannot be matched safely`);
|
|
544
|
+
return void 0;
|
|
545
|
+
}
|
|
546
|
+
const repeated = /* @__PURE__ */ new Set();
|
|
547
|
+
const groups = lists.map((list) => {
|
|
548
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
549
|
+
for (const child of list) {
|
|
550
|
+
const name = tag(child), group = grouped.get(name) ?? [];
|
|
551
|
+
group.push(child);
|
|
552
|
+
grouped.set(name, group);
|
|
553
|
+
if (group.length > 1) repeated.add(name);
|
|
554
|
+
}
|
|
555
|
+
return grouped;
|
|
556
|
+
});
|
|
557
|
+
for (const name of repeated) {
|
|
558
|
+
const rows = groups.map((group) => group.get(name) ?? []);
|
|
559
|
+
if (rows.some((row) => row.some((child) => options.keyElement?.(child, b) !== void 0)))
|
|
560
|
+
continue;
|
|
561
|
+
if (rows.some((row) => row.length !== rows[0].length)) {
|
|
562
|
+
issues.push(`${path}: unkeyed structural changes`);
|
|
563
|
+
return void 0;
|
|
564
|
+
}
|
|
565
|
+
const before = rows[0].map((child) => buildXml(child));
|
|
566
|
+
const known = new Set(before);
|
|
567
|
+
for (const row of rows.slice(1))
|
|
568
|
+
if (row.some((child, i) => {
|
|
569
|
+
const value = buildXml(child);
|
|
570
|
+
return before[i] !== value && known.has(value);
|
|
571
|
+
})) {
|
|
572
|
+
issues.push(`${path}: reordered unkeyed elements`);
|
|
573
|
+
return void 0;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
let maps;
|
|
577
|
+
try {
|
|
578
|
+
maps = [b, l, r].map((parent) => childrenByKey(parent, options, repeated));
|
|
579
|
+
} catch {
|
|
580
|
+
issues.push(`${path}: ambiguous element identities`);
|
|
581
|
+
return void 0;
|
|
582
|
+
}
|
|
583
|
+
const [bm, lm, rm] = maps;
|
|
584
|
+
const merged = /* @__PURE__ */ new Map();
|
|
585
|
+
for (const key of /* @__PURE__ */ new Set([...bm.keys(), ...lm.keys(), ...rm.keys()])) {
|
|
586
|
+
const node = merge2(bm.get(key), lm.get(key), rm.get(key), `${path}/${key}`);
|
|
587
|
+
if (node) merged.set(key, node);
|
|
588
|
+
}
|
|
589
|
+
const surviving = (map) => [...map.keys()].filter((key) => merged.has(key));
|
|
590
|
+
const order = orderKeys(surviving(bm), surviving(lm), surviving(rm));
|
|
591
|
+
if (!order) {
|
|
592
|
+
issues.push(`${path}: incompatible element order`);
|
|
593
|
+
return void 0;
|
|
594
|
+
}
|
|
595
|
+
for (const key of order) out.appendChild(merged.get(key));
|
|
596
|
+
return out;
|
|
597
|
+
};
|
|
598
|
+
var merge = merge2;
|
|
599
|
+
const base = parseXml(baseXml, { warningsAsErrors: true });
|
|
600
|
+
const local = parseXml(localXml, { warningsAsErrors: true });
|
|
601
|
+
const remote = parseXml(remoteXml, { warningsAsErrors: true });
|
|
602
|
+
const copy = (node) => remote.importNode(node, true);
|
|
603
|
+
const root = merge2(base.documentElement, local.documentElement, remote.documentElement, "root");
|
|
604
|
+
if (!root || issues.length) return { status: "unresolved", issues };
|
|
605
|
+
remote.replaceChild(root, remote.documentElement);
|
|
606
|
+
return { status: "merged", xml: buildXml(remote) };
|
|
607
|
+
} catch {
|
|
608
|
+
return { status: "unresolved", issues: ["Invalid or unsupported XML input"] };
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// opc/merge-snapshots.ts
|
|
613
|
+
var equal = (a, b) => a === b || Boolean(a && b && a.length === b.length && a.every((value, index) => value === b[index]));
|
|
614
|
+
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
615
|
+
var encoder = new TextEncoder();
|
|
616
|
+
function mergeManifest(input) {
|
|
617
|
+
const { path, base, local, remote } = input;
|
|
618
|
+
if (!base || !local || !remote) return void 0;
|
|
619
|
+
if (!path.endsWith(".rels") && path !== "[Content_Types].xml" && path !== "docProps/core.xml")
|
|
620
|
+
return void 0;
|
|
621
|
+
try {
|
|
622
|
+
const result = mergeXmlThreeWay(
|
|
623
|
+
decoder.decode(base),
|
|
624
|
+
decoder.decode(local),
|
|
625
|
+
decoder.decode(remote),
|
|
626
|
+
{
|
|
627
|
+
keyElement: (element) => {
|
|
628
|
+
const attribute = element.localName === "Relationship" ? "Id" : element.localName === "Override" ? "PartName" : element.localName === "Default" ? "Extension" : void 0;
|
|
629
|
+
return attribute ? element.getAttribute(attribute) ?? void 0 : void 0;
|
|
630
|
+
},
|
|
631
|
+
resolveText: (_b, _l, r) => path === "docProps/core.xml" && (r.namespaceURI === "http://purl.org/dc/terms/" && r.localName === "modified" || r.namespaceURI === "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" && r.localName === "lastModifiedBy") ? r.textContent ?? "" : void 0
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
return result.status === "merged" ? { status: "merged", bytes: encoder.encode(result.xml) } : result;
|
|
635
|
+
} catch {
|
|
636
|
+
return { status: "unresolved", issues: [`${path}: invalid metadata XML`] };
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
async function mergeOpcSnapshots(baseBytes, localBytes, remoteBytes, options = {}) {
|
|
640
|
+
if (equal(localBytes, remoteBytes) || equal(baseBytes, remoteBytes))
|
|
641
|
+
return { status: "merged", bytes: localBytes.slice() };
|
|
642
|
+
if (equal(baseBytes, localBytes)) return { status: "merged", bytes: remoteBytes.slice() };
|
|
643
|
+
try {
|
|
644
|
+
const [base, local, remote] = await Promise.all([
|
|
645
|
+
openZip(baseBytes, { label: "Merge" }),
|
|
646
|
+
openZip(localBytes, { label: "Merge" }),
|
|
647
|
+
openZip(remoteBytes, { label: "Merge" })
|
|
648
|
+
]);
|
|
649
|
+
const paths = [
|
|
650
|
+
...new Set(
|
|
651
|
+
[base, local, remote].flatMap(
|
|
652
|
+
(zip) => Object.keys(zip.files).filter((path) => !zip.files[path].dir)
|
|
653
|
+
)
|
|
654
|
+
)
|
|
655
|
+
].sort();
|
|
656
|
+
if (paths.some((path) => path.startsWith("_xmlsignatures/")))
|
|
657
|
+
return {
|
|
658
|
+
status: "unresolved",
|
|
659
|
+
issues: ["Signed packages require explicit signature handling before merging"]
|
|
660
|
+
};
|
|
661
|
+
const issues = [];
|
|
662
|
+
for (const path of paths) {
|
|
663
|
+
const [b, l, r] = await Promise.all(
|
|
664
|
+
[base, local, remote].map((zip) => zip.file(path)?.async("uint8array"))
|
|
665
|
+
);
|
|
666
|
+
let chosen;
|
|
667
|
+
if (equal(l, r) || equal(b, r)) chosen = l;
|
|
668
|
+
else if (equal(b, l)) chosen = r;
|
|
669
|
+
else {
|
|
670
|
+
const input = {
|
|
671
|
+
path,
|
|
672
|
+
...b ? { base: b } : {},
|
|
673
|
+
...l ? { local: l } : {},
|
|
674
|
+
...r ? { remote: r } : {}
|
|
675
|
+
};
|
|
676
|
+
const result = mergeManifest(input) ?? await options.mergePart?.(input);
|
|
677
|
+
if (!result || result.status === "unresolved") {
|
|
678
|
+
issues.push(...result?.issues ?? [`${path}: both versions changed the same part`]);
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
chosen = result.bytes;
|
|
682
|
+
}
|
|
683
|
+
if (chosen) remote.file(path, chosen);
|
|
684
|
+
else remote.remove(path);
|
|
685
|
+
}
|
|
686
|
+
if (issues.length) return { status: "unresolved", issues };
|
|
687
|
+
for (const path of Object.keys(remote.files).filter((name) => name.endsWith(".rels"))) {
|
|
688
|
+
const source = path === "_rels/.rels" ? "" : path.replace(/(^|\/)_rels\/([^/]+)\.rels$/u, "$1$2");
|
|
689
|
+
for (const relation of parseRelationships(
|
|
690
|
+
await remote.file(path).async("string")
|
|
691
|
+
).values()) {
|
|
692
|
+
if (relation.mode === "External") continue;
|
|
693
|
+
const target = resolvePartPath(source, relation.target.split("#")[0] ?? "");
|
|
694
|
+
if (!remote.file(target) && !remote.file(decodeURIComponent(target)))
|
|
695
|
+
issues.push(`${path}: merged relationship target is missing`);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
if (issues.length) return { status: "unresolved", issues };
|
|
699
|
+
return {
|
|
700
|
+
status: "merged",
|
|
701
|
+
bytes: await remote.generateAsync({ type: "uint8array", compression: "DEFLATE" })
|
|
702
|
+
};
|
|
703
|
+
} catch {
|
|
704
|
+
return { status: "unresolved", issues: ["Invalid or oversized Office package"] };
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
245
708
|
// pptx/core/builders/sdk/diff-operations.ts
|
|
246
709
|
var ELEMENT_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
247
710
|
"rawXml",
|
|
@@ -2245,22 +2708,22 @@ async function removeMasterFromPresentation(zip, masterPath) {
|
|
|
2245
2708
|
const idRe = new RegExp(`\\s*<p:sldMasterId[^>]*r:id="${match[1]}"[^>]*/>`);
|
|
2246
2709
|
zip.file(presPath, presContent.replace(idRe, ""));
|
|
2247
2710
|
}
|
|
2248
|
-
function withCSldName(
|
|
2711
|
+
function withCSldName(xml2, name) {
|
|
2249
2712
|
const escaped = escAttr(name);
|
|
2250
|
-
if (/<p:cSld[^>]*\sname="/.test(
|
|
2251
|
-
return
|
|
2713
|
+
if (/<p:cSld[^>]*\sname="/.test(xml2)) {
|
|
2714
|
+
return xml2.replace(/(<p:cSld[^>]*\sname=")[^"]*(")/, `$1${escaped}$2`);
|
|
2252
2715
|
}
|
|
2253
|
-
return
|
|
2716
|
+
return xml2.replace(/<p:cSld(?=[\s>])/, `<p:cSld name="${escaped}"`);
|
|
2254
2717
|
}
|
|
2255
2718
|
var MASTER_XMLNS = 'xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"';
|
|
2256
2719
|
var FALLBACK_CLR_MAP = '<p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>';
|
|
2257
2720
|
var FALLBACK_TX_STYLES = '<p:txStyles><p:titleStyle><a:lvl1pPr algn="l"><a:defRPr sz="4400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mj-lt"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr algn="l"><a:defRPr sz="3200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/></a:defRPr></a:lvl1pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang="en-US"/></a:defPPr></p:otherStyle></p:txStyles>';
|
|
2258
|
-
function extractTag(
|
|
2259
|
-
const container =
|
|
2721
|
+
function extractTag(xml2, tag2) {
|
|
2722
|
+
const container = xml2.match(new RegExp(`<${tag2}(?:\\s[^>]*)?>[^]*?</${tag2}>`));
|
|
2260
2723
|
if (container) {
|
|
2261
2724
|
return container[0];
|
|
2262
2725
|
}
|
|
2263
|
-
const selfClosed =
|
|
2726
|
+
const selfClosed = xml2.match(new RegExp(`<${tag2}(?:\\s[^>]*)?/>`));
|
|
2264
2727
|
return selfClosed ? selfClosed[0] : "";
|
|
2265
2728
|
}
|
|
2266
2729
|
function newMasterXmlFromSource(sourceMasterXml, sldLayoutIdLst) {
|
|
@@ -14472,6 +14935,40 @@ function listUnassessedOpenXmlCoverage(vocabulary) {
|
|
|
14472
14935
|
);
|
|
14473
14936
|
}
|
|
14474
14937
|
|
|
14938
|
+
// pptx/merge-snapshots.ts
|
|
14939
|
+
var SLIDE_PART = /^ppt\/(?:slides\/slide\d+|notesSlides\/notesSlide\d+)\.xml$/u;
|
|
14940
|
+
var SHAPES = /* @__PURE__ */ new Set(["sp", "pic", "cxnSp", "graphicFrame", "grpSp"]);
|
|
14941
|
+
var POSITIONAL = /* @__PURE__ */ new Set(["txBody", "p", "r", "fld"]);
|
|
14942
|
+
function keyElement(element, parent) {
|
|
14943
|
+
if (element.namespaceURI !== NS.p || !SHAPES.has(element.localName) || parent.namespaceURI !== NS.p || parent.localName !== "spTree" && parent.localName !== "grpSp")
|
|
14944
|
+
return void 0;
|
|
14945
|
+
const id = element.getElementsByTagNameNS(NS.p, "cNvPr")[0]?.getAttribute("id");
|
|
14946
|
+
return id ? `shape:${id}` : void 0;
|
|
14947
|
+
}
|
|
14948
|
+
function mergePptxSnapshots(base, local, remote) {
|
|
14949
|
+
return mergeOpcSnapshots(base, local, remote, {
|
|
14950
|
+
async mergePart(input) {
|
|
14951
|
+
if (!SLIDE_PART.test(input.path) || !input.base || !input.local || !input.remote)
|
|
14952
|
+
return {
|
|
14953
|
+
status: "unresolved",
|
|
14954
|
+
issues: [`Concurrent unsupported PPTX part: ${input.path}`]
|
|
14955
|
+
};
|
|
14956
|
+
const decoder2 = new TextDecoder();
|
|
14957
|
+
const result = mergeXmlThreeWay(
|
|
14958
|
+
decoder2.decode(input.base),
|
|
14959
|
+
decoder2.decode(input.local),
|
|
14960
|
+
decoder2.decode(input.remote),
|
|
14961
|
+
{
|
|
14962
|
+
keyElement,
|
|
14963
|
+
allowPositional: (parent) => (parent.namespaceURI === NS.a || parent.namespaceURI === NS.p) && POSITIONAL.has(parent.localName),
|
|
14964
|
+
allowText: (element) => element.namespaceURI === NS.a && element.localName === "t"
|
|
14965
|
+
}
|
|
14966
|
+
);
|
|
14967
|
+
return result.status === "merged" ? { status: "merged", bytes: new TextEncoder().encode(result.xml) } : { status: "unresolved", issues: result.issues.map((issue) => `${input.path}: ${issue}`) };
|
|
14968
|
+
}
|
|
14969
|
+
});
|
|
14970
|
+
}
|
|
14971
|
+
|
|
14475
14972
|
// pptx/core/utils/suite-text.ts
|
|
14476
14973
|
async function inspectPresentationText(bytes) {
|
|
14477
14974
|
const data = await new PptxHandler().load(new Uint8Array(bytes).buffer);
|
|
@@ -14547,4 +15044,4 @@ async function createPresentationFromOutline(slides, options = {}) {
|
|
|
14547
15044
|
return handler.save(data.slides);
|
|
14548
15045
|
}
|
|
14549
15046
|
|
|
14550
|
-
export { ChartBuilder, ConnectorBuilder, GroupBuilder, ImageBuilder, MediaBuilder, OPENXML_COVERAGE, OPENXML_SCHEMA_CONSTRUCT_IDS, OPENXML_STRICT_SCHEMA_CONSTRUCT_IDS, OPENXML_TRANSITIONAL_SCHEMA_CONSTRUCT_IDS, Presentation, SLIDE_PACKAGE_CLIPBOARD_MIME, ShapeBuilder, SlideSizes, THEME_PRESETS, TRANSITION_PATTERN_OPTIONS, TRANSITION_THRUBLK_TYPES, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, ThemePresets, addChartUserShape, addChartUserShapeGroupChild, addSection, applyTemplate, chartSupportsSecondaryAxis, cm, cmToEmu, collectLayoutNames, collectMasterNames, createPresentationFromOutline, createSlideClipboardPackage, deleteLayout, deleteSlideMaster, deserializeSlidePackageClipboard, diffPresentations, diffSlides, duplicateElement, duplicateLayout, duplicateSlide, duplicateSlideMaster, emuToPixels, findOpenXmlCoverage, findPlaceholders, getChartUserShapeAtPath, getSectionForSlide, getThemePreset, importSlidePackage, inches, inchesToEmu, insertLayout, insertSlideMaster, inspectPresentationText, interpolateShapeGeometry, isChartSeriesOnSecondaryAxis, listChartUserShapes, listUnassessedOpenXmlCoverage, mailMerge, mm, moveSlidesToSection, parseSvgPath, pixelsToEmu, pt, removeChartUserShape, removeChartUserShapeAtPath, removeSection, renameLayout, renameSlideMaster, reorderSections, replaceShapeGeometry, replaceWithCustomGeometry, resetChartElementFormat, resetCloneIdCounter, resetSectionIdCounter, serializeSlidePackageClipboard, serializeSvgPath, setChartColorMapOverride, setChartDataPointGradient, setChartDataPointStyle, setChartHelperLine, setChartSeriesGradient, setElementLocked, setPresentationRunText, summarizeOpenXmlCoverage, summarizeOpenXmlCoverageByVocabulary, uniqueDisplayName, uniquePrefixedName, updateChartUserShape, updateChartUserShapeAtPath, withChartAxisOptions, withChartDataLabelOptions, withChartElementFormat, withChartLegendOptions, withChartSeriesOnSecondaryAxis, withChartSeriesOptions };
|
|
15047
|
+
export { ChartBuilder, ConnectorBuilder, GroupBuilder, ImageBuilder, MediaBuilder, OPENXML_COVERAGE, OPENXML_SCHEMA_CONSTRUCT_IDS, OPENXML_STRICT_SCHEMA_CONSTRUCT_IDS, OPENXML_TRANSITIONAL_SCHEMA_CONSTRUCT_IDS, Presentation, SLIDE_PACKAGE_CLIPBOARD_MIME, ShapeBuilder, SlideSizes, THEME_PRESETS, TRANSITION_PATTERN_OPTIONS, TRANSITION_THRUBLK_TYPES, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, ThemePresets, addChartUserShape, addChartUserShapeGroupChild, addSection, applyTemplate, chartSupportsSecondaryAxis, cm, cmToEmu, collectLayoutNames, collectMasterNames, createPresentationFromOutline, createSlideClipboardPackage, deleteLayout, deleteSlideMaster, deserializeSlidePackageClipboard, diffPresentations, diffSlides, duplicateElement, duplicateLayout, duplicateSlide, duplicateSlideMaster, emuToPixels, findOpenXmlCoverage, findPlaceholders, getChartUserShapeAtPath, getSectionForSlide, getThemePreset, importSlidePackage, inches, inchesToEmu, insertLayout, insertSlideMaster, inspectPresentationText, interpolateShapeGeometry, isChartSeriesOnSecondaryAxis, listChartUserShapes, listUnassessedOpenXmlCoverage, mailMerge, mergePptxSnapshots, mm, moveSlidesToSection, parseSvgPath, pixelsToEmu, pt, removeChartUserShape, removeChartUserShapeAtPath, removeSection, renameLayout, renameSlideMaster, reorderSections, replaceShapeGeometry, replaceWithCustomGeometry, resetChartElementFormat, resetCloneIdCounter, resetSectionIdCounter, serializeSlidePackageClipboard, serializeSvgPath, setChartColorMapOverride, setChartDataPointGradient, setChartDataPointStyle, setChartHelperLine, setChartSeriesGradient, setElementLocked, setPresentationRunText, summarizeOpenXmlCoverage, summarizeOpenXmlCoverageByVocabulary, uniqueDisplayName, uniquePrefixedName, updateChartUserShape, updateChartUserShapeAtPath, withChartAxisOptions, withChartDataLabelOptions, withChartElementFormat, withChartLegendOptions, withChartSeriesOnSecondaryAxis, withChartSeriesOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Y from 'yjs';
|
|
2
|
+
/** Snapshot equality, independent of plain-object key insertion order. Arrays remain ordered. */
|
|
3
|
+
export declare function snapshotEqual(a: unknown, b: unknown): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Reconciles saved snapshots, not invented CRDT history. Independent object fields combine;
|
|
6
|
+
* conflicting values, ordered arrays and delete-versus-edit remain explicitly unresolved.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeSnapshotValue(base: unknown, local: unknown, remote: unknown, path: string, issues: string[]): unknown;
|
|
9
|
+
/** Uses real common-base Yjs updates, then reconciles overlapping atomic JSON values explicitly. */
|
|
10
|
+
export declare function mergeSnapshotMaps(base: Y.Doc, local: Y.Doc, remote: Y.Doc, names: readonly string[]): {
|
|
11
|
+
doc: Y.Doc;
|
|
12
|
+
issues: string[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=merge-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-values.d.ts","sourceRoot":"","sources":["../../collab/merge-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAOzB,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAgB7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,GACd,OAAO,CA0CT;AAuBD,oGAAoG;AACpG,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,CAAC,CAAC,GAAG,EACX,KAAK,EAAE,CAAC,CAAC,GAAG,EACZ,MAAM,EAAE,CAAC,CAAC,GAAG,EACb,KAAK,EAAE,SAAS,MAAM,EAAE,GACtB;IAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CA4BlC"}
|