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
package/dist/docx/load/index.mjs
CHANGED
|
@@ -3571,6 +3571,161 @@ var RELATIONSHIP_TYPES = {
|
|
|
3571
3571
|
diagramColors: `${BASE}/diagramColors`,
|
|
3572
3572
|
diagramDrawing: "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing"};
|
|
3573
3573
|
|
|
3574
|
+
// text/text-diff.ts
|
|
3575
|
+
var isLowSurrogate = (text, at) => {
|
|
3576
|
+
const code = text.charCodeAt(at);
|
|
3577
|
+
return code >= 56320 && code <= 57343;
|
|
3578
|
+
};
|
|
3579
|
+
function shortestEdit(n, m, same6, maxEdits) {
|
|
3580
|
+
const max = Math.min(n + m, maxEdits);
|
|
3581
|
+
const offset = max + 1;
|
|
3582
|
+
const v = new Int32Array(2 * max + 3);
|
|
3583
|
+
const trace = [];
|
|
3584
|
+
for (let d = 0; d <= max; d++) {
|
|
3585
|
+
for (let k = -d; k <= d; k += 2) {
|
|
3586
|
+
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
3587
|
+
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
3588
|
+
let y = x - k;
|
|
3589
|
+
while (x < n && y < m && same6(x, y)) {
|
|
3590
|
+
x++;
|
|
3591
|
+
y++;
|
|
3592
|
+
}
|
|
3593
|
+
v[offset + k] = x;
|
|
3594
|
+
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
3595
|
+
}
|
|
3596
|
+
trace.push(v.slice(offset - d, offset + d + 1));
|
|
3597
|
+
}
|
|
3598
|
+
return void 0;
|
|
3599
|
+
}
|
|
3600
|
+
function backtrack(trace, n, m, d) {
|
|
3601
|
+
const edits = [];
|
|
3602
|
+
let x = n;
|
|
3603
|
+
let y = m;
|
|
3604
|
+
for (let step = d; step > 0; step--) {
|
|
3605
|
+
const previous = trace[step - 1];
|
|
3606
|
+
const at = (k2) => previous[k2 + step - 1];
|
|
3607
|
+
const k = x - y;
|
|
3608
|
+
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
3609
|
+
const before = down ? k + 1 : k - 1;
|
|
3610
|
+
const startX = at(before);
|
|
3611
|
+
const startY = startX - before;
|
|
3612
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
3613
|
+
x = startX;
|
|
3614
|
+
y = startY;
|
|
3615
|
+
}
|
|
3616
|
+
return edits.reverse();
|
|
3617
|
+
}
|
|
3618
|
+
function changesOf(edits) {
|
|
3619
|
+
const changes = [];
|
|
3620
|
+
for (const [x, y, inserts] of edits) {
|
|
3621
|
+
const last = changes.at(-1);
|
|
3622
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
3623
|
+
if (inserts) last.toEnd++;
|
|
3624
|
+
else last.fromEnd++;
|
|
3625
|
+
} else
|
|
3626
|
+
changes.push({
|
|
3627
|
+
fromStart: x,
|
|
3628
|
+
fromEnd: inserts ? x : x + 1,
|
|
3629
|
+
toStart: y,
|
|
3630
|
+
toEnd: inserts ? y + 1 : y
|
|
3631
|
+
});
|
|
3632
|
+
}
|
|
3633
|
+
return changes;
|
|
3634
|
+
}
|
|
3635
|
+
function characterChanges(a2, b, maxEdits) {
|
|
3636
|
+
const edits = shortestEdit(
|
|
3637
|
+
a2.length,
|
|
3638
|
+
b.length,
|
|
3639
|
+
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
3640
|
+
maxEdits
|
|
3641
|
+
);
|
|
3642
|
+
return edits && changesOf(edits);
|
|
3643
|
+
}
|
|
3644
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
3645
|
+
function tokensOf(text, ids) {
|
|
3646
|
+
const tokens = [];
|
|
3647
|
+
const starts = [];
|
|
3648
|
+
for (const match of text.matchAll(TOKEN)) {
|
|
3649
|
+
let id = ids.get(match[0]);
|
|
3650
|
+
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
3651
|
+
tokens.push(id);
|
|
3652
|
+
starts.push(match.index);
|
|
3653
|
+
}
|
|
3654
|
+
starts.push(text.length);
|
|
3655
|
+
return { tokens, starts };
|
|
3656
|
+
}
|
|
3657
|
+
function tokenChanges(a2, b, maxEdits) {
|
|
3658
|
+
const ids = /* @__PURE__ */ new Map();
|
|
3659
|
+
const from = tokensOf(a2, ids);
|
|
3660
|
+
const to = tokensOf(b, ids);
|
|
3661
|
+
const edits = shortestEdit(
|
|
3662
|
+
from.tokens.length,
|
|
3663
|
+
to.tokens.length,
|
|
3664
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
3665
|
+
maxEdits
|
|
3666
|
+
);
|
|
3667
|
+
if (!edits) return void 0;
|
|
3668
|
+
let budget = maxEdits;
|
|
3669
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
3670
|
+
const change = {
|
|
3671
|
+
fromStart: from.starts[stretch.fromStart],
|
|
3672
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
3673
|
+
toStart: to.starts[stretch.toStart],
|
|
3674
|
+
toEnd: to.starts[stretch.toEnd]
|
|
3675
|
+
};
|
|
3676
|
+
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
3677
|
+
a2.slice(change.fromStart, change.fromEnd),
|
|
3678
|
+
b.slice(change.toStart, change.toEnd),
|
|
3679
|
+
budget
|
|
3680
|
+
) : void 0;
|
|
3681
|
+
if (!inner) return [change];
|
|
3682
|
+
for (const found of inner)
|
|
3683
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
3684
|
+
return inner.map((found) => ({
|
|
3685
|
+
fromStart: found.fromStart + change.fromStart,
|
|
3686
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
3687
|
+
toStart: found.toStart + change.toStart,
|
|
3688
|
+
toEnd: found.toEnd + change.toStart
|
|
3689
|
+
}));
|
|
3690
|
+
});
|
|
3691
|
+
}
|
|
3692
|
+
function diffText(from, to, maxEdits = 500) {
|
|
3693
|
+
let start = 0;
|
|
3694
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
3695
|
+
start++;
|
|
3696
|
+
let end = 0;
|
|
3697
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
3698
|
+
end++;
|
|
3699
|
+
const a2 = from.slice(start, from.length - end);
|
|
3700
|
+
const b = to.slice(start, to.length - end);
|
|
3701
|
+
if (!a2.length && !b.length) return [];
|
|
3702
|
+
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
3703
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
3704
|
+
const result = [];
|
|
3705
|
+
for (const change of changes) {
|
|
3706
|
+
const placed = {
|
|
3707
|
+
fromStart: change.fromStart + start,
|
|
3708
|
+
fromEnd: change.fromEnd + start,
|
|
3709
|
+
toStart: change.toStart + start,
|
|
3710
|
+
toEnd: change.toEnd + start
|
|
3711
|
+
};
|
|
3712
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
3713
|
+
placed.fromStart--;
|
|
3714
|
+
placed.toStart--;
|
|
3715
|
+
}
|
|
3716
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
3717
|
+
placed.fromEnd++;
|
|
3718
|
+
placed.toEnd++;
|
|
3719
|
+
}
|
|
3720
|
+
const last = result.at(-1);
|
|
3721
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
3722
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
3723
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
3724
|
+
} else result.push(placed);
|
|
3725
|
+
}
|
|
3726
|
+
return result;
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3574
3729
|
// opc/relationships.ts
|
|
3575
3730
|
function parseRelationships(xml) {
|
|
3576
3731
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -3707,15 +3862,6 @@ async function ensureRelationship(zip, relsPath, type, target) {
|
|
|
3707
3862
|
zip.file(relsPath, xml.replace("</Relationships>", `${insertion}</Relationships>`));
|
|
3708
3863
|
return id;
|
|
3709
3864
|
}
|
|
3710
|
-
|
|
3711
|
-
// opc/safe-href.ts
|
|
3712
|
-
var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
|
|
3713
|
-
function isSafeHyperlinkHref(href) {
|
|
3714
|
-
const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
|
|
3715
|
-
return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
|
|
3716
|
-
}
|
|
3717
|
-
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
3718
|
-
/* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
3719
3865
|
var DEFAULT_ZIP_LIMITS = {
|
|
3720
3866
|
maxInputBytes: 100 * 1024 * 1024,
|
|
3721
3867
|
maxEntries: 1e4,
|
|
@@ -3938,6 +4084,15 @@ async function openZip(input, limits = {}) {
|
|
|
3938
4084
|
return guardZip(await JSZip.loadAsync(bytes), limits);
|
|
3939
4085
|
}
|
|
3940
4086
|
|
|
4087
|
+
// opc/safe-href.ts
|
|
4088
|
+
var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
|
|
4089
|
+
function isSafeHyperlinkHref(href) {
|
|
4090
|
+
const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
|
|
4091
|
+
return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
|
|
4092
|
+
}
|
|
4093
|
+
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
4094
|
+
/* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
4095
|
+
|
|
3941
4096
|
// opc/properties/patch.ts
|
|
3942
4097
|
var XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
3943
4098
|
function tagEnd(xml, from) {
|
|
@@ -6340,161 +6495,6 @@ function patchCommentMetadata(parts, identities) {
|
|
|
6340
6495
|
return result;
|
|
6341
6496
|
}
|
|
6342
6497
|
|
|
6343
|
-
// text/text-diff.ts
|
|
6344
|
-
var isLowSurrogate = (text, at) => {
|
|
6345
|
-
const code = text.charCodeAt(at);
|
|
6346
|
-
return code >= 56320 && code <= 57343;
|
|
6347
|
-
};
|
|
6348
|
-
function shortestEdit(n, m, same6, maxEdits) {
|
|
6349
|
-
const max = Math.min(n + m, maxEdits);
|
|
6350
|
-
const offset = max + 1;
|
|
6351
|
-
const v = new Int32Array(2 * max + 3);
|
|
6352
|
-
const trace = [];
|
|
6353
|
-
for (let d = 0; d <= max; d++) {
|
|
6354
|
-
for (let k = -d; k <= d; k += 2) {
|
|
6355
|
-
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
6356
|
-
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
6357
|
-
let y = x - k;
|
|
6358
|
-
while (x < n && y < m && same6(x, y)) {
|
|
6359
|
-
x++;
|
|
6360
|
-
y++;
|
|
6361
|
-
}
|
|
6362
|
-
v[offset + k] = x;
|
|
6363
|
-
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
6364
|
-
}
|
|
6365
|
-
trace.push(v.slice(offset - d, offset + d + 1));
|
|
6366
|
-
}
|
|
6367
|
-
return void 0;
|
|
6368
|
-
}
|
|
6369
|
-
function backtrack(trace, n, m, d) {
|
|
6370
|
-
const edits = [];
|
|
6371
|
-
let x = n;
|
|
6372
|
-
let y = m;
|
|
6373
|
-
for (let step = d; step > 0; step--) {
|
|
6374
|
-
const previous = trace[step - 1];
|
|
6375
|
-
const at = (k2) => previous[k2 + step - 1];
|
|
6376
|
-
const k = x - y;
|
|
6377
|
-
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
6378
|
-
const before = down ? k + 1 : k - 1;
|
|
6379
|
-
const startX = at(before);
|
|
6380
|
-
const startY = startX - before;
|
|
6381
|
-
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
6382
|
-
x = startX;
|
|
6383
|
-
y = startY;
|
|
6384
|
-
}
|
|
6385
|
-
return edits.reverse();
|
|
6386
|
-
}
|
|
6387
|
-
function changesOf(edits) {
|
|
6388
|
-
const changes = [];
|
|
6389
|
-
for (const [x, y, inserts] of edits) {
|
|
6390
|
-
const last = changes.at(-1);
|
|
6391
|
-
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
6392
|
-
if (inserts) last.toEnd++;
|
|
6393
|
-
else last.fromEnd++;
|
|
6394
|
-
} else
|
|
6395
|
-
changes.push({
|
|
6396
|
-
fromStart: x,
|
|
6397
|
-
fromEnd: inserts ? x : x + 1,
|
|
6398
|
-
toStart: y,
|
|
6399
|
-
toEnd: inserts ? y + 1 : y
|
|
6400
|
-
});
|
|
6401
|
-
}
|
|
6402
|
-
return changes;
|
|
6403
|
-
}
|
|
6404
|
-
function characterChanges(a2, b, maxEdits) {
|
|
6405
|
-
const edits = shortestEdit(
|
|
6406
|
-
a2.length,
|
|
6407
|
-
b.length,
|
|
6408
|
-
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
6409
|
-
maxEdits
|
|
6410
|
-
);
|
|
6411
|
-
return edits && changesOf(edits);
|
|
6412
|
-
}
|
|
6413
|
-
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
6414
|
-
function tokensOf(text, ids) {
|
|
6415
|
-
const tokens = [];
|
|
6416
|
-
const starts = [];
|
|
6417
|
-
for (const match of text.matchAll(TOKEN)) {
|
|
6418
|
-
let id = ids.get(match[0]);
|
|
6419
|
-
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
6420
|
-
tokens.push(id);
|
|
6421
|
-
starts.push(match.index);
|
|
6422
|
-
}
|
|
6423
|
-
starts.push(text.length);
|
|
6424
|
-
return { tokens, starts };
|
|
6425
|
-
}
|
|
6426
|
-
function tokenChanges(a2, b, maxEdits) {
|
|
6427
|
-
const ids = /* @__PURE__ */ new Map();
|
|
6428
|
-
const from = tokensOf(a2, ids);
|
|
6429
|
-
const to = tokensOf(b, ids);
|
|
6430
|
-
const edits = shortestEdit(
|
|
6431
|
-
from.tokens.length,
|
|
6432
|
-
to.tokens.length,
|
|
6433
|
-
(x, y) => from.tokens[x] === to.tokens[y],
|
|
6434
|
-
maxEdits
|
|
6435
|
-
);
|
|
6436
|
-
if (!edits) return void 0;
|
|
6437
|
-
let budget = maxEdits;
|
|
6438
|
-
return changesOf(edits).flatMap((stretch) => {
|
|
6439
|
-
const change = {
|
|
6440
|
-
fromStart: from.starts[stretch.fromStart],
|
|
6441
|
-
fromEnd: from.starts[stretch.fromEnd],
|
|
6442
|
-
toStart: to.starts[stretch.toStart],
|
|
6443
|
-
toEnd: to.starts[stretch.toEnd]
|
|
6444
|
-
};
|
|
6445
|
-
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
6446
|
-
a2.slice(change.fromStart, change.fromEnd),
|
|
6447
|
-
b.slice(change.toStart, change.toEnd),
|
|
6448
|
-
budget
|
|
6449
|
-
) : void 0;
|
|
6450
|
-
if (!inner) return [change];
|
|
6451
|
-
for (const found of inner)
|
|
6452
|
-
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
6453
|
-
return inner.map((found) => ({
|
|
6454
|
-
fromStart: found.fromStart + change.fromStart,
|
|
6455
|
-
fromEnd: found.fromEnd + change.fromStart,
|
|
6456
|
-
toStart: found.toStart + change.toStart,
|
|
6457
|
-
toEnd: found.toEnd + change.toStart
|
|
6458
|
-
}));
|
|
6459
|
-
});
|
|
6460
|
-
}
|
|
6461
|
-
function diffText(from, to, maxEdits = 500) {
|
|
6462
|
-
let start = 0;
|
|
6463
|
-
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
6464
|
-
start++;
|
|
6465
|
-
let end = 0;
|
|
6466
|
-
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
6467
|
-
end++;
|
|
6468
|
-
const a2 = from.slice(start, from.length - end);
|
|
6469
|
-
const b = to.slice(start, to.length - end);
|
|
6470
|
-
if (!a2.length && !b.length) return [];
|
|
6471
|
-
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
6472
|
-
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
6473
|
-
const result = [];
|
|
6474
|
-
for (const change of changes) {
|
|
6475
|
-
const placed = {
|
|
6476
|
-
fromStart: change.fromStart + start,
|
|
6477
|
-
fromEnd: change.fromEnd + start,
|
|
6478
|
-
toStart: change.toStart + start,
|
|
6479
|
-
toEnd: change.toEnd + start
|
|
6480
|
-
};
|
|
6481
|
-
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
6482
|
-
placed.fromStart--;
|
|
6483
|
-
placed.toStart--;
|
|
6484
|
-
}
|
|
6485
|
-
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
6486
|
-
placed.fromEnd++;
|
|
6487
|
-
placed.toEnd++;
|
|
6488
|
-
}
|
|
6489
|
-
const last = result.at(-1);
|
|
6490
|
-
if (last && placed.fromStart <= last.fromEnd) {
|
|
6491
|
-
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
6492
|
-
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
6493
|
-
} else result.push(placed);
|
|
6494
|
-
}
|
|
6495
|
-
return result;
|
|
6496
|
-
}
|
|
6497
|
-
|
|
6498
6498
|
// color/color-primitives.ts
|
|
6499
6499
|
function clampUnitInterval(value) {
|
|
6500
6500
|
return Math.min(1, Math.max(0, value));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SnapshotMergeResult } from '../opc/merge-snapshots.js';
|
|
2
|
+
/**
|
|
3
|
+
* Three-way merge of independent edits to native DOCX snapshots with a common base. This reads
|
|
4
|
+
* source XML rather than reconstructing a document model, so unsupported one-sided parts survive.
|
|
5
|
+
* Ambiguous structure, overlapping text edits and opaque same-part conflicts remain unresolved.
|
|
6
|
+
* This does not synthesize the Yjs operation history absent from independently saved packages.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeDocxSnapshots(base: Uint8Array, local: Uint8Array, remote: Uint8Array): Promise<SnapshotMergeResult>;
|
|
9
|
+
//# sourceMappingURL=merge-snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-snapshots.d.ts","sourceRoot":"","sources":["../../docx/merge-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA2BrF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,GAChB,OAAO,CAAC,mBAAmB,CAAC,CA2B9B"}
|
package/dist/docx/ui/index.cjs
CHANGED
|
@@ -408,6 +408,161 @@ function attr(element3, local, ns, prefix) {
|
|
|
408
408
|
return element3?.getAttributeNS(ns, local) ?? element3?.getAttribute(`${prefix}:${local}`) ?? void 0;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
// text/text-diff.ts
|
|
412
|
+
var isLowSurrogate = (text2, at) => {
|
|
413
|
+
const code = text2.charCodeAt(at);
|
|
414
|
+
return code >= 56320 && code <= 57343;
|
|
415
|
+
};
|
|
416
|
+
function shortestEdit(n2, m, same3, maxEdits) {
|
|
417
|
+
const max = Math.min(n2 + m, maxEdits);
|
|
418
|
+
const offset = max + 1;
|
|
419
|
+
const v = new Int32Array(2 * max + 3);
|
|
420
|
+
const trace = [];
|
|
421
|
+
for (let d = 0; d <= max; d++) {
|
|
422
|
+
for (let k = -d; k <= d; k += 2) {
|
|
423
|
+
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
424
|
+
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
425
|
+
let y = x - k;
|
|
426
|
+
while (x < n2 && y < m && same3(x, y)) {
|
|
427
|
+
x++;
|
|
428
|
+
y++;
|
|
429
|
+
}
|
|
430
|
+
v[offset + k] = x;
|
|
431
|
+
if (x >= n2 && y >= m) return backtrack(trace, n2, m, d);
|
|
432
|
+
}
|
|
433
|
+
trace.push(v.slice(offset - d, offset + d + 1));
|
|
434
|
+
}
|
|
435
|
+
return void 0;
|
|
436
|
+
}
|
|
437
|
+
function backtrack(trace, n2, m, d) {
|
|
438
|
+
const edits = [];
|
|
439
|
+
let x = n2;
|
|
440
|
+
let y = m;
|
|
441
|
+
for (let step = d; step > 0; step--) {
|
|
442
|
+
const previous = trace[step - 1];
|
|
443
|
+
const at = (k2) => previous[k2 + step - 1];
|
|
444
|
+
const k = x - y;
|
|
445
|
+
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
446
|
+
const before = down ? k + 1 : k - 1;
|
|
447
|
+
const startX = at(before);
|
|
448
|
+
const startY = startX - before;
|
|
449
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
450
|
+
x = startX;
|
|
451
|
+
y = startY;
|
|
452
|
+
}
|
|
453
|
+
return edits.reverse();
|
|
454
|
+
}
|
|
455
|
+
function changesOf(edits) {
|
|
456
|
+
const changes = [];
|
|
457
|
+
for (const [x, y, inserts] of edits) {
|
|
458
|
+
const last = changes.at(-1);
|
|
459
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
460
|
+
if (inserts) last.toEnd++;
|
|
461
|
+
else last.fromEnd++;
|
|
462
|
+
} else
|
|
463
|
+
changes.push({
|
|
464
|
+
fromStart: x,
|
|
465
|
+
fromEnd: inserts ? x : x + 1,
|
|
466
|
+
toStart: y,
|
|
467
|
+
toEnd: inserts ? y + 1 : y
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
return changes;
|
|
471
|
+
}
|
|
472
|
+
function characterChanges(a, b, maxEdits) {
|
|
473
|
+
const edits = shortestEdit(
|
|
474
|
+
a.length,
|
|
475
|
+
b.length,
|
|
476
|
+
(x, y) => a.charCodeAt(x) === b.charCodeAt(y),
|
|
477
|
+
maxEdits
|
|
478
|
+
);
|
|
479
|
+
return edits && changesOf(edits);
|
|
480
|
+
}
|
|
481
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
482
|
+
function tokensOf(text2, ids) {
|
|
483
|
+
const tokens = [];
|
|
484
|
+
const starts = [];
|
|
485
|
+
for (const match of text2.matchAll(TOKEN)) {
|
|
486
|
+
let id = ids.get(match[0]);
|
|
487
|
+
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
488
|
+
tokens.push(id);
|
|
489
|
+
starts.push(match.index);
|
|
490
|
+
}
|
|
491
|
+
starts.push(text2.length);
|
|
492
|
+
return { tokens, starts };
|
|
493
|
+
}
|
|
494
|
+
function tokenChanges(a, b, maxEdits) {
|
|
495
|
+
const ids = /* @__PURE__ */ new Map();
|
|
496
|
+
const from = tokensOf(a, ids);
|
|
497
|
+
const to = tokensOf(b, ids);
|
|
498
|
+
const edits = shortestEdit(
|
|
499
|
+
from.tokens.length,
|
|
500
|
+
to.tokens.length,
|
|
501
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
502
|
+
maxEdits
|
|
503
|
+
);
|
|
504
|
+
if (!edits) return void 0;
|
|
505
|
+
let budget = maxEdits;
|
|
506
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
507
|
+
const change = {
|
|
508
|
+
fromStart: from.starts[stretch.fromStart],
|
|
509
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
510
|
+
toStart: to.starts[stretch.toStart],
|
|
511
|
+
toEnd: to.starts[stretch.toEnd]
|
|
512
|
+
};
|
|
513
|
+
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
514
|
+
a.slice(change.fromStart, change.fromEnd),
|
|
515
|
+
b.slice(change.toStart, change.toEnd),
|
|
516
|
+
budget
|
|
517
|
+
) : void 0;
|
|
518
|
+
if (!inner) return [change];
|
|
519
|
+
for (const found of inner)
|
|
520
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
521
|
+
return inner.map((found) => ({
|
|
522
|
+
fromStart: found.fromStart + change.fromStart,
|
|
523
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
524
|
+
toStart: found.toStart + change.toStart,
|
|
525
|
+
toEnd: found.toEnd + change.toStart
|
|
526
|
+
}));
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
function diffText(from, to, maxEdits = 500) {
|
|
530
|
+
let start = 0;
|
|
531
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
532
|
+
start++;
|
|
533
|
+
let end = 0;
|
|
534
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
535
|
+
end++;
|
|
536
|
+
const a = from.slice(start, from.length - end);
|
|
537
|
+
const b = to.slice(start, to.length - end);
|
|
538
|
+
if (!a.length && !b.length) return [];
|
|
539
|
+
const found = a.length && b.length ? characterChanges(a, b, maxEdits) ?? tokenChanges(a, b, maxEdits) : void 0;
|
|
540
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a.length, toStart: 0, toEnd: b.length }];
|
|
541
|
+
const result = [];
|
|
542
|
+
for (const change of changes) {
|
|
543
|
+
const placed = {
|
|
544
|
+
fromStart: change.fromStart + start,
|
|
545
|
+
fromEnd: change.fromEnd + start,
|
|
546
|
+
toStart: change.toStart + start,
|
|
547
|
+
toEnd: change.toEnd + start
|
|
548
|
+
};
|
|
549
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
550
|
+
placed.fromStart--;
|
|
551
|
+
placed.toStart--;
|
|
552
|
+
}
|
|
553
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
554
|
+
placed.fromEnd++;
|
|
555
|
+
placed.toEnd++;
|
|
556
|
+
}
|
|
557
|
+
const last = result.at(-1);
|
|
558
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
559
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
560
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
561
|
+
} else result.push(placed);
|
|
562
|
+
}
|
|
563
|
+
return result;
|
|
564
|
+
}
|
|
565
|
+
|
|
411
566
|
// docx/xml.ts
|
|
412
567
|
var WORD_NS = NS.w;
|
|
413
568
|
var WORD_DATE_UTC_NS = "http://schemas.microsoft.com/office/word/2023/wordml/word16du";
|
|
@@ -29485,161 +29640,6 @@ function rangeKeys(run) {
|
|
|
29485
29640
|
return keys;
|
|
29486
29641
|
}
|
|
29487
29642
|
|
|
29488
|
-
// text/text-diff.ts
|
|
29489
|
-
var isLowSurrogate = (text2, at) => {
|
|
29490
|
-
const code = text2.charCodeAt(at);
|
|
29491
|
-
return code >= 56320 && code <= 57343;
|
|
29492
|
-
};
|
|
29493
|
-
function shortestEdit(n2, m, same3, maxEdits) {
|
|
29494
|
-
const max = Math.min(n2 + m, maxEdits);
|
|
29495
|
-
const offset = max + 1;
|
|
29496
|
-
const v = new Int32Array(2 * max + 3);
|
|
29497
|
-
const trace = [];
|
|
29498
|
-
for (let d = 0; d <= max; d++) {
|
|
29499
|
-
for (let k = -d; k <= d; k += 2) {
|
|
29500
|
-
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
29501
|
-
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
29502
|
-
let y = x - k;
|
|
29503
|
-
while (x < n2 && y < m && same3(x, y)) {
|
|
29504
|
-
x++;
|
|
29505
|
-
y++;
|
|
29506
|
-
}
|
|
29507
|
-
v[offset + k] = x;
|
|
29508
|
-
if (x >= n2 && y >= m) return backtrack(trace, n2, m, d);
|
|
29509
|
-
}
|
|
29510
|
-
trace.push(v.slice(offset - d, offset + d + 1));
|
|
29511
|
-
}
|
|
29512
|
-
return void 0;
|
|
29513
|
-
}
|
|
29514
|
-
function backtrack(trace, n2, m, d) {
|
|
29515
|
-
const edits = [];
|
|
29516
|
-
let x = n2;
|
|
29517
|
-
let y = m;
|
|
29518
|
-
for (let step = d; step > 0; step--) {
|
|
29519
|
-
const previous = trace[step - 1];
|
|
29520
|
-
const at = (k2) => previous[k2 + step - 1];
|
|
29521
|
-
const k = x - y;
|
|
29522
|
-
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
29523
|
-
const before = down ? k + 1 : k - 1;
|
|
29524
|
-
const startX = at(before);
|
|
29525
|
-
const startY = startX - before;
|
|
29526
|
-
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
29527
|
-
x = startX;
|
|
29528
|
-
y = startY;
|
|
29529
|
-
}
|
|
29530
|
-
return edits.reverse();
|
|
29531
|
-
}
|
|
29532
|
-
function changesOf(edits) {
|
|
29533
|
-
const changes = [];
|
|
29534
|
-
for (const [x, y, inserts] of edits) {
|
|
29535
|
-
const last = changes.at(-1);
|
|
29536
|
-
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
29537
|
-
if (inserts) last.toEnd++;
|
|
29538
|
-
else last.fromEnd++;
|
|
29539
|
-
} else
|
|
29540
|
-
changes.push({
|
|
29541
|
-
fromStart: x,
|
|
29542
|
-
fromEnd: inserts ? x : x + 1,
|
|
29543
|
-
toStart: y,
|
|
29544
|
-
toEnd: inserts ? y + 1 : y
|
|
29545
|
-
});
|
|
29546
|
-
}
|
|
29547
|
-
return changes;
|
|
29548
|
-
}
|
|
29549
|
-
function characterChanges(a, b, maxEdits) {
|
|
29550
|
-
const edits = shortestEdit(
|
|
29551
|
-
a.length,
|
|
29552
|
-
b.length,
|
|
29553
|
-
(x, y) => a.charCodeAt(x) === b.charCodeAt(y),
|
|
29554
|
-
maxEdits
|
|
29555
|
-
);
|
|
29556
|
-
return edits && changesOf(edits);
|
|
29557
|
-
}
|
|
29558
|
-
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
29559
|
-
function tokensOf(text2, ids) {
|
|
29560
|
-
const tokens = [];
|
|
29561
|
-
const starts = [];
|
|
29562
|
-
for (const match of text2.matchAll(TOKEN)) {
|
|
29563
|
-
let id = ids.get(match[0]);
|
|
29564
|
-
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
29565
|
-
tokens.push(id);
|
|
29566
|
-
starts.push(match.index);
|
|
29567
|
-
}
|
|
29568
|
-
starts.push(text2.length);
|
|
29569
|
-
return { tokens, starts };
|
|
29570
|
-
}
|
|
29571
|
-
function tokenChanges(a, b, maxEdits) {
|
|
29572
|
-
const ids = /* @__PURE__ */ new Map();
|
|
29573
|
-
const from = tokensOf(a, ids);
|
|
29574
|
-
const to = tokensOf(b, ids);
|
|
29575
|
-
const edits = shortestEdit(
|
|
29576
|
-
from.tokens.length,
|
|
29577
|
-
to.tokens.length,
|
|
29578
|
-
(x, y) => from.tokens[x] === to.tokens[y],
|
|
29579
|
-
maxEdits
|
|
29580
|
-
);
|
|
29581
|
-
if (!edits) return void 0;
|
|
29582
|
-
let budget = maxEdits;
|
|
29583
|
-
return changesOf(edits).flatMap((stretch) => {
|
|
29584
|
-
const change = {
|
|
29585
|
-
fromStart: from.starts[stretch.fromStart],
|
|
29586
|
-
fromEnd: from.starts[stretch.fromEnd],
|
|
29587
|
-
toStart: to.starts[stretch.toStart],
|
|
29588
|
-
toEnd: to.starts[stretch.toEnd]
|
|
29589
|
-
};
|
|
29590
|
-
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
29591
|
-
a.slice(change.fromStart, change.fromEnd),
|
|
29592
|
-
b.slice(change.toStart, change.toEnd),
|
|
29593
|
-
budget
|
|
29594
|
-
) : void 0;
|
|
29595
|
-
if (!inner) return [change];
|
|
29596
|
-
for (const found of inner)
|
|
29597
|
-
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
29598
|
-
return inner.map((found) => ({
|
|
29599
|
-
fromStart: found.fromStart + change.fromStart,
|
|
29600
|
-
fromEnd: found.fromEnd + change.fromStart,
|
|
29601
|
-
toStart: found.toStart + change.toStart,
|
|
29602
|
-
toEnd: found.toEnd + change.toStart
|
|
29603
|
-
}));
|
|
29604
|
-
});
|
|
29605
|
-
}
|
|
29606
|
-
function diffText(from, to, maxEdits = 500) {
|
|
29607
|
-
let start = 0;
|
|
29608
|
-
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
29609
|
-
start++;
|
|
29610
|
-
let end = 0;
|
|
29611
|
-
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
29612
|
-
end++;
|
|
29613
|
-
const a = from.slice(start, from.length - end);
|
|
29614
|
-
const b = to.slice(start, to.length - end);
|
|
29615
|
-
if (!a.length && !b.length) return [];
|
|
29616
|
-
const found = a.length && b.length ? characterChanges(a, b, maxEdits) ?? tokenChanges(a, b, maxEdits) : void 0;
|
|
29617
|
-
const changes = found ?? [{ fromStart: 0, fromEnd: a.length, toStart: 0, toEnd: b.length }];
|
|
29618
|
-
const result = [];
|
|
29619
|
-
for (const change of changes) {
|
|
29620
|
-
const placed = {
|
|
29621
|
-
fromStart: change.fromStart + start,
|
|
29622
|
-
fromEnd: change.fromEnd + start,
|
|
29623
|
-
toStart: change.toStart + start,
|
|
29624
|
-
toEnd: change.toEnd + start
|
|
29625
|
-
};
|
|
29626
|
-
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
29627
|
-
placed.fromStart--;
|
|
29628
|
-
placed.toStart--;
|
|
29629
|
-
}
|
|
29630
|
-
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
29631
|
-
placed.fromEnd++;
|
|
29632
|
-
placed.toEnd++;
|
|
29633
|
-
}
|
|
29634
|
-
const last = result.at(-1);
|
|
29635
|
-
if (last && placed.fromStart <= last.fromEnd) {
|
|
29636
|
-
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
29637
|
-
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
29638
|
-
} else result.push(placed);
|
|
29639
|
-
}
|
|
29640
|
-
return result;
|
|
29641
|
-
}
|
|
29642
|
-
|
|
29643
29643
|
// docx/write-comments.ts
|
|
29644
29644
|
function setAttribute5(element3, local, value) {
|
|
29645
29645
|
element3.setAttributeNS(WORD_NS, `w:${local}`, value);
|