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
|
@@ -186,6 +186,161 @@ function attr(element5, local, ns, prefix3) {
|
|
|
186
186
|
}
|
|
187
187
|
var relAttr = (element5, local) => attr(element5, local, NS.r, "r");
|
|
188
188
|
|
|
189
|
+
// text/text-diff.ts
|
|
190
|
+
var isLowSurrogate = (text9, at3) => {
|
|
191
|
+
const code = text9.charCodeAt(at3);
|
|
192
|
+
return code >= 56320 && code <= 57343;
|
|
193
|
+
};
|
|
194
|
+
function shortestEdit(n, m, same17, maxEdits) {
|
|
195
|
+
const max = Math.min(n + m, maxEdits);
|
|
196
|
+
const offset2 = max + 1;
|
|
197
|
+
const v = new Int32Array(2 * max + 3);
|
|
198
|
+
const trace = [];
|
|
199
|
+
for (let d = 0; d <= max; d++) {
|
|
200
|
+
for (let k = -d; k <= d; k += 2) {
|
|
201
|
+
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
202
|
+
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
203
|
+
let y = x - k;
|
|
204
|
+
while (x < n && y < m && same17(x, y)) {
|
|
205
|
+
x++;
|
|
206
|
+
y++;
|
|
207
|
+
}
|
|
208
|
+
v[offset2 + k] = x;
|
|
209
|
+
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
210
|
+
}
|
|
211
|
+
trace.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
212
|
+
}
|
|
213
|
+
return void 0;
|
|
214
|
+
}
|
|
215
|
+
function backtrack(trace, n, m, d) {
|
|
216
|
+
const edits2 = [];
|
|
217
|
+
let x = n;
|
|
218
|
+
let y = m;
|
|
219
|
+
for (let step2 = d; step2 > 0; step2--) {
|
|
220
|
+
const previous = trace[step2 - 1];
|
|
221
|
+
const at3 = (k2) => previous[k2 + step2 - 1];
|
|
222
|
+
const k = x - y;
|
|
223
|
+
const down = k === -step2 || k !== step2 && at3(k - 1) < at3(k + 1);
|
|
224
|
+
const before = down ? k + 1 : k - 1;
|
|
225
|
+
const startX = at3(before);
|
|
226
|
+
const startY = startX - before;
|
|
227
|
+
edits2.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
228
|
+
x = startX;
|
|
229
|
+
y = startY;
|
|
230
|
+
}
|
|
231
|
+
return edits2.reverse();
|
|
232
|
+
}
|
|
233
|
+
function changesOf(edits2) {
|
|
234
|
+
const changes = [];
|
|
235
|
+
for (const [x, y, inserts] of edits2) {
|
|
236
|
+
const last = changes.at(-1);
|
|
237
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
238
|
+
if (inserts) last.toEnd++;
|
|
239
|
+
else last.fromEnd++;
|
|
240
|
+
} else
|
|
241
|
+
changes.push({
|
|
242
|
+
fromStart: x,
|
|
243
|
+
fromEnd: inserts ? x : x + 1,
|
|
244
|
+
toStart: y,
|
|
245
|
+
toEnd: inserts ? y + 1 : y
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return changes;
|
|
249
|
+
}
|
|
250
|
+
function characterChanges(a2, b, maxEdits) {
|
|
251
|
+
const edits2 = shortestEdit(
|
|
252
|
+
a2.length,
|
|
253
|
+
b.length,
|
|
254
|
+
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
255
|
+
maxEdits
|
|
256
|
+
);
|
|
257
|
+
return edits2 && changesOf(edits2);
|
|
258
|
+
}
|
|
259
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
260
|
+
function tokensOf(text9, ids) {
|
|
261
|
+
const tokens3 = [];
|
|
262
|
+
const starts = [];
|
|
263
|
+
for (const match2 of text9.matchAll(TOKEN)) {
|
|
264
|
+
let id5 = ids.get(match2[0]);
|
|
265
|
+
if (id5 === void 0) ids.set(match2[0], id5 = ids.size);
|
|
266
|
+
tokens3.push(id5);
|
|
267
|
+
starts.push(match2.index);
|
|
268
|
+
}
|
|
269
|
+
starts.push(text9.length);
|
|
270
|
+
return { tokens: tokens3, starts };
|
|
271
|
+
}
|
|
272
|
+
function tokenChanges(a2, b, maxEdits) {
|
|
273
|
+
const ids = /* @__PURE__ */ new Map();
|
|
274
|
+
const from = tokensOf(a2, ids);
|
|
275
|
+
const to = tokensOf(b, ids);
|
|
276
|
+
const edits2 = shortestEdit(
|
|
277
|
+
from.tokens.length,
|
|
278
|
+
to.tokens.length,
|
|
279
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
280
|
+
maxEdits
|
|
281
|
+
);
|
|
282
|
+
if (!edits2) return void 0;
|
|
283
|
+
let budget = maxEdits;
|
|
284
|
+
return changesOf(edits2).flatMap((stretch) => {
|
|
285
|
+
const change = {
|
|
286
|
+
fromStart: from.starts[stretch.fromStart],
|
|
287
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
288
|
+
toStart: to.starts[stretch.toStart],
|
|
289
|
+
toEnd: to.starts[stretch.toEnd]
|
|
290
|
+
};
|
|
291
|
+
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
292
|
+
a2.slice(change.fromStart, change.fromEnd),
|
|
293
|
+
b.slice(change.toStart, change.toEnd),
|
|
294
|
+
budget
|
|
295
|
+
) : void 0;
|
|
296
|
+
if (!inner2) return [change];
|
|
297
|
+
for (const found of inner2)
|
|
298
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
299
|
+
return inner2.map((found) => ({
|
|
300
|
+
fromStart: found.fromStart + change.fromStart,
|
|
301
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
302
|
+
toStart: found.toStart + change.toStart,
|
|
303
|
+
toEnd: found.toEnd + change.toStart
|
|
304
|
+
}));
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function diffText(from, to, maxEdits = 500) {
|
|
308
|
+
let start = 0;
|
|
309
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
310
|
+
start++;
|
|
311
|
+
let end = 0;
|
|
312
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
313
|
+
end++;
|
|
314
|
+
const a2 = from.slice(start, from.length - end);
|
|
315
|
+
const b = to.slice(start, to.length - end);
|
|
316
|
+
if (!a2.length && !b.length) return [];
|
|
317
|
+
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
318
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
319
|
+
const result2 = [];
|
|
320
|
+
for (const change of changes) {
|
|
321
|
+
const placed = {
|
|
322
|
+
fromStart: change.fromStart + start,
|
|
323
|
+
fromEnd: change.fromEnd + start,
|
|
324
|
+
toStart: change.toStart + start,
|
|
325
|
+
toEnd: change.toEnd + start
|
|
326
|
+
};
|
|
327
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
328
|
+
placed.fromStart--;
|
|
329
|
+
placed.toStart--;
|
|
330
|
+
}
|
|
331
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
332
|
+
placed.fromEnd++;
|
|
333
|
+
placed.toEnd++;
|
|
334
|
+
}
|
|
335
|
+
const last = result2.at(-1);
|
|
336
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
337
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
338
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
339
|
+
} else result2.push(placed);
|
|
340
|
+
}
|
|
341
|
+
return result2;
|
|
342
|
+
}
|
|
343
|
+
|
|
189
344
|
// xml/lite.ts
|
|
190
345
|
var LiteElement = class {
|
|
191
346
|
constructor(tagName2, localName3, namespaceURI) {
|
|
@@ -1447,58 +1602,6 @@ async function ensureRelationship(zip, relsPath, type, target3) {
|
|
|
1447
1602
|
zip.file(relsPath, xml.replace("</Relationships>", `${insertion}</Relationships>`));
|
|
1448
1603
|
return id5;
|
|
1449
1604
|
}
|
|
1450
|
-
|
|
1451
|
-
// opc/safe-href.ts
|
|
1452
|
-
var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
|
|
1453
|
-
function isSafeHyperlinkHref(href) {
|
|
1454
|
-
const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
|
|
1455
|
-
return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
|
|
1456
|
-
}
|
|
1457
|
-
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
1458
|
-
var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
1459
|
-
var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
|
|
1460
|
-
"javascript",
|
|
1461
|
-
"vbscript",
|
|
1462
|
-
"livescript",
|
|
1463
|
-
"jscript",
|
|
1464
|
-
"mocha",
|
|
1465
|
-
"data",
|
|
1466
|
-
"mhtml",
|
|
1467
|
-
"ms-its",
|
|
1468
|
-
"mk",
|
|
1469
|
-
"x-javascript",
|
|
1470
|
-
"blob"
|
|
1471
|
-
]);
|
|
1472
|
-
var IGNORABLE = new RegExp(
|
|
1473
|
-
"[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
|
|
1474
|
-
"gu"
|
|
1475
|
-
);
|
|
1476
|
-
var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
|
|
1477
|
-
var SCHEME = /^([a-z][a-z0-9+.-]*):/;
|
|
1478
|
-
var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
|
|
1479
|
-
var reject = (reason) => ({
|
|
1480
|
-
store: false,
|
|
1481
|
-
open: false,
|
|
1482
|
-
reason
|
|
1483
|
-
});
|
|
1484
|
-
function hyperlinkPolicy(href, options2 = {}) {
|
|
1485
|
-
if (typeof href !== "string") return reject("empty");
|
|
1486
|
-
const trimmed2 = href.trim();
|
|
1487
|
-
const normalized = trimmed2.replace(IGNORABLE, "").toLowerCase();
|
|
1488
|
-
if (normalized.length === 0) return reject("empty");
|
|
1489
|
-
const scheme2 = SCHEME.exec(normalized)?.[1];
|
|
1490
|
-
if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
|
|
1491
|
-
if (scheme2 !== void 0 && !trimmed2.toLowerCase().startsWith(`${scheme2}:`))
|
|
1492
|
-
return reject("obfuscated-scheme");
|
|
1493
|
-
if (CONTROL.test(trimmed2)) return reject("control-characters");
|
|
1494
|
-
if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
|
|
1495
|
-
if (scheme2.length === 1) return STORE_ONLY;
|
|
1496
|
-
if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
|
|
1497
|
-
if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
|
|
1498
|
-
return { store: true, open: true };
|
|
1499
|
-
if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
|
|
1500
|
-
return reject("unsupported-scheme");
|
|
1501
|
-
}
|
|
1502
1605
|
var DEFAULT_ZIP_LIMITS = {
|
|
1503
1606
|
maxInputBytes: 100 * 1024 * 1024,
|
|
1504
1607
|
maxEntries: 1e4,
|
|
@@ -1721,6 +1824,58 @@ async function openZip(input2, limits = {}) {
|
|
|
1721
1824
|
return guardZip(await JSZip.loadAsync(bytes), limits);
|
|
1722
1825
|
}
|
|
1723
1826
|
|
|
1827
|
+
// opc/safe-href.ts
|
|
1828
|
+
var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
|
|
1829
|
+
function isSafeHyperlinkHref(href) {
|
|
1830
|
+
const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
|
|
1831
|
+
return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
|
|
1832
|
+
}
|
|
1833
|
+
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
1834
|
+
var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
1835
|
+
var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
|
|
1836
|
+
"javascript",
|
|
1837
|
+
"vbscript",
|
|
1838
|
+
"livescript",
|
|
1839
|
+
"jscript",
|
|
1840
|
+
"mocha",
|
|
1841
|
+
"data",
|
|
1842
|
+
"mhtml",
|
|
1843
|
+
"ms-its",
|
|
1844
|
+
"mk",
|
|
1845
|
+
"x-javascript",
|
|
1846
|
+
"blob"
|
|
1847
|
+
]);
|
|
1848
|
+
var IGNORABLE = new RegExp(
|
|
1849
|
+
"[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
|
|
1850
|
+
"gu"
|
|
1851
|
+
);
|
|
1852
|
+
var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
|
|
1853
|
+
var SCHEME = /^([a-z][a-z0-9+.-]*):/;
|
|
1854
|
+
var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
|
|
1855
|
+
var reject = (reason) => ({
|
|
1856
|
+
store: false,
|
|
1857
|
+
open: false,
|
|
1858
|
+
reason
|
|
1859
|
+
});
|
|
1860
|
+
function hyperlinkPolicy(href, options2 = {}) {
|
|
1861
|
+
if (typeof href !== "string") return reject("empty");
|
|
1862
|
+
const trimmed2 = href.trim();
|
|
1863
|
+
const normalized = trimmed2.replace(IGNORABLE, "").toLowerCase();
|
|
1864
|
+
if (normalized.length === 0) return reject("empty");
|
|
1865
|
+
const scheme2 = SCHEME.exec(normalized)?.[1];
|
|
1866
|
+
if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
|
|
1867
|
+
if (scheme2 !== void 0 && !trimmed2.toLowerCase().startsWith(`${scheme2}:`))
|
|
1868
|
+
return reject("obfuscated-scheme");
|
|
1869
|
+
if (CONTROL.test(trimmed2)) return reject("control-characters");
|
|
1870
|
+
if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
|
|
1871
|
+
if (scheme2.length === 1) return STORE_ONLY;
|
|
1872
|
+
if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
|
|
1873
|
+
if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
|
|
1874
|
+
return { store: true, open: true };
|
|
1875
|
+
if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
|
|
1876
|
+
return reject("unsupported-scheme");
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1724
1879
|
// opc/properties/types.ts
|
|
1725
1880
|
var CUSTOM_PROPERTIES_FMTID = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
|
|
1726
1881
|
var PROPERTY_PART_NAMES = {
|
|
@@ -4016,161 +4171,6 @@ function patchCommentMetadata(parts, identities) {
|
|
|
4016
4171
|
return result2;
|
|
4017
4172
|
}
|
|
4018
4173
|
|
|
4019
|
-
// text/text-diff.ts
|
|
4020
|
-
var isLowSurrogate = (text9, at3) => {
|
|
4021
|
-
const code = text9.charCodeAt(at3);
|
|
4022
|
-
return code >= 56320 && code <= 57343;
|
|
4023
|
-
};
|
|
4024
|
-
function shortestEdit(n, m, same17, maxEdits) {
|
|
4025
|
-
const max = Math.min(n + m, maxEdits);
|
|
4026
|
-
const offset2 = max + 1;
|
|
4027
|
-
const v = new Int32Array(2 * max + 3);
|
|
4028
|
-
const trace = [];
|
|
4029
|
-
for (let d = 0; d <= max; d++) {
|
|
4030
|
-
for (let k = -d; k <= d; k += 2) {
|
|
4031
|
-
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
4032
|
-
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
4033
|
-
let y = x - k;
|
|
4034
|
-
while (x < n && y < m && same17(x, y)) {
|
|
4035
|
-
x++;
|
|
4036
|
-
y++;
|
|
4037
|
-
}
|
|
4038
|
-
v[offset2 + k] = x;
|
|
4039
|
-
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
4040
|
-
}
|
|
4041
|
-
trace.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
4042
|
-
}
|
|
4043
|
-
return void 0;
|
|
4044
|
-
}
|
|
4045
|
-
function backtrack(trace, n, m, d) {
|
|
4046
|
-
const edits2 = [];
|
|
4047
|
-
let x = n;
|
|
4048
|
-
let y = m;
|
|
4049
|
-
for (let step2 = d; step2 > 0; step2--) {
|
|
4050
|
-
const previous = trace[step2 - 1];
|
|
4051
|
-
const at3 = (k2) => previous[k2 + step2 - 1];
|
|
4052
|
-
const k = x - y;
|
|
4053
|
-
const down = k === -step2 || k !== step2 && at3(k - 1) < at3(k + 1);
|
|
4054
|
-
const before = down ? k + 1 : k - 1;
|
|
4055
|
-
const startX = at3(before);
|
|
4056
|
-
const startY = startX - before;
|
|
4057
|
-
edits2.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
4058
|
-
x = startX;
|
|
4059
|
-
y = startY;
|
|
4060
|
-
}
|
|
4061
|
-
return edits2.reverse();
|
|
4062
|
-
}
|
|
4063
|
-
function changesOf(edits2) {
|
|
4064
|
-
const changes = [];
|
|
4065
|
-
for (const [x, y, inserts] of edits2) {
|
|
4066
|
-
const last = changes.at(-1);
|
|
4067
|
-
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
4068
|
-
if (inserts) last.toEnd++;
|
|
4069
|
-
else last.fromEnd++;
|
|
4070
|
-
} else
|
|
4071
|
-
changes.push({
|
|
4072
|
-
fromStart: x,
|
|
4073
|
-
fromEnd: inserts ? x : x + 1,
|
|
4074
|
-
toStart: y,
|
|
4075
|
-
toEnd: inserts ? y + 1 : y
|
|
4076
|
-
});
|
|
4077
|
-
}
|
|
4078
|
-
return changes;
|
|
4079
|
-
}
|
|
4080
|
-
function characterChanges(a2, b, maxEdits) {
|
|
4081
|
-
const edits2 = shortestEdit(
|
|
4082
|
-
a2.length,
|
|
4083
|
-
b.length,
|
|
4084
|
-
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
4085
|
-
maxEdits
|
|
4086
|
-
);
|
|
4087
|
-
return edits2 && changesOf(edits2);
|
|
4088
|
-
}
|
|
4089
|
-
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
4090
|
-
function tokensOf(text9, ids) {
|
|
4091
|
-
const tokens3 = [];
|
|
4092
|
-
const starts = [];
|
|
4093
|
-
for (const match2 of text9.matchAll(TOKEN)) {
|
|
4094
|
-
let id5 = ids.get(match2[0]);
|
|
4095
|
-
if (id5 === void 0) ids.set(match2[0], id5 = ids.size);
|
|
4096
|
-
tokens3.push(id5);
|
|
4097
|
-
starts.push(match2.index);
|
|
4098
|
-
}
|
|
4099
|
-
starts.push(text9.length);
|
|
4100
|
-
return { tokens: tokens3, starts };
|
|
4101
|
-
}
|
|
4102
|
-
function tokenChanges(a2, b, maxEdits) {
|
|
4103
|
-
const ids = /* @__PURE__ */ new Map();
|
|
4104
|
-
const from = tokensOf(a2, ids);
|
|
4105
|
-
const to = tokensOf(b, ids);
|
|
4106
|
-
const edits2 = shortestEdit(
|
|
4107
|
-
from.tokens.length,
|
|
4108
|
-
to.tokens.length,
|
|
4109
|
-
(x, y) => from.tokens[x] === to.tokens[y],
|
|
4110
|
-
maxEdits
|
|
4111
|
-
);
|
|
4112
|
-
if (!edits2) return void 0;
|
|
4113
|
-
let budget = maxEdits;
|
|
4114
|
-
return changesOf(edits2).flatMap((stretch) => {
|
|
4115
|
-
const change = {
|
|
4116
|
-
fromStart: from.starts[stretch.fromStart],
|
|
4117
|
-
fromEnd: from.starts[stretch.fromEnd],
|
|
4118
|
-
toStart: to.starts[stretch.toStart],
|
|
4119
|
-
toEnd: to.starts[stretch.toEnd]
|
|
4120
|
-
};
|
|
4121
|
-
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
4122
|
-
a2.slice(change.fromStart, change.fromEnd),
|
|
4123
|
-
b.slice(change.toStart, change.toEnd),
|
|
4124
|
-
budget
|
|
4125
|
-
) : void 0;
|
|
4126
|
-
if (!inner2) return [change];
|
|
4127
|
-
for (const found of inner2)
|
|
4128
|
-
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
4129
|
-
return inner2.map((found) => ({
|
|
4130
|
-
fromStart: found.fromStart + change.fromStart,
|
|
4131
|
-
fromEnd: found.fromEnd + change.fromStart,
|
|
4132
|
-
toStart: found.toStart + change.toStart,
|
|
4133
|
-
toEnd: found.toEnd + change.toStart
|
|
4134
|
-
}));
|
|
4135
|
-
});
|
|
4136
|
-
}
|
|
4137
|
-
function diffText(from, to, maxEdits = 500) {
|
|
4138
|
-
let start = 0;
|
|
4139
|
-
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
4140
|
-
start++;
|
|
4141
|
-
let end = 0;
|
|
4142
|
-
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
4143
|
-
end++;
|
|
4144
|
-
const a2 = from.slice(start, from.length - end);
|
|
4145
|
-
const b = to.slice(start, to.length - end);
|
|
4146
|
-
if (!a2.length && !b.length) return [];
|
|
4147
|
-
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
4148
|
-
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
4149
|
-
const result2 = [];
|
|
4150
|
-
for (const change of changes) {
|
|
4151
|
-
const placed = {
|
|
4152
|
-
fromStart: change.fromStart + start,
|
|
4153
|
-
fromEnd: change.fromEnd + start,
|
|
4154
|
-
toStart: change.toStart + start,
|
|
4155
|
-
toEnd: change.toEnd + start
|
|
4156
|
-
};
|
|
4157
|
-
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
4158
|
-
placed.fromStart--;
|
|
4159
|
-
placed.toStart--;
|
|
4160
|
-
}
|
|
4161
|
-
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
4162
|
-
placed.fromEnd++;
|
|
4163
|
-
placed.toEnd++;
|
|
4164
|
-
}
|
|
4165
|
-
const last = result2.at(-1);
|
|
4166
|
-
if (last && placed.fromStart <= last.fromEnd) {
|
|
4167
|
-
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
4168
|
-
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
4169
|
-
} else result2.push(placed);
|
|
4170
|
-
}
|
|
4171
|
-
return result2;
|
|
4172
|
-
}
|
|
4173
|
-
|
|
4174
4174
|
// color/color-primitives.ts
|
|
4175
4175
|
function clampUnitInterval(value3) {
|
|
4176
4176
|
return Math.min(1, Math.max(0, value3));
|