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/text/index.cjs
CHANGED
|
@@ -314,6 +314,198 @@ function changeTextCaseRanges(text, mode, boundaries = []) {
|
|
|
314
314
|
return ranges;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
// text/text-diff.ts
|
|
318
|
+
var isLowSurrogate = (text, at) => {
|
|
319
|
+
const code = text.charCodeAt(at);
|
|
320
|
+
return code >= 56320 && code <= 57343;
|
|
321
|
+
};
|
|
322
|
+
function shortestEdit(n, m, same, maxEdits) {
|
|
323
|
+
const max = Math.min(n + m, maxEdits);
|
|
324
|
+
const offset = max + 1;
|
|
325
|
+
const v = new Int32Array(2 * max + 3);
|
|
326
|
+
const trace = [];
|
|
327
|
+
for (let d = 0; d <= max; d++) {
|
|
328
|
+
for (let k = -d; k <= d; k += 2) {
|
|
329
|
+
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
330
|
+
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
331
|
+
let y = x - k;
|
|
332
|
+
while (x < n && y < m && same(x, y)) {
|
|
333
|
+
x++;
|
|
334
|
+
y++;
|
|
335
|
+
}
|
|
336
|
+
v[offset + k] = x;
|
|
337
|
+
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
338
|
+
}
|
|
339
|
+
trace.push(v.slice(offset - d, offset + d + 1));
|
|
340
|
+
}
|
|
341
|
+
return void 0;
|
|
342
|
+
}
|
|
343
|
+
function backtrack(trace, n, m, d) {
|
|
344
|
+
const edits = [];
|
|
345
|
+
let x = n;
|
|
346
|
+
let y = m;
|
|
347
|
+
for (let step = d; step > 0; step--) {
|
|
348
|
+
const previous = trace[step - 1];
|
|
349
|
+
const at = (k2) => previous[k2 + step - 1];
|
|
350
|
+
const k = x - y;
|
|
351
|
+
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
352
|
+
const before = down ? k + 1 : k - 1;
|
|
353
|
+
const startX = at(before);
|
|
354
|
+
const startY = startX - before;
|
|
355
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
356
|
+
x = startX;
|
|
357
|
+
y = startY;
|
|
358
|
+
}
|
|
359
|
+
return edits.reverse();
|
|
360
|
+
}
|
|
361
|
+
function changesOf(edits) {
|
|
362
|
+
const changes = [];
|
|
363
|
+
for (const [x, y, inserts] of edits) {
|
|
364
|
+
const last = changes.at(-1);
|
|
365
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
366
|
+
if (inserts) last.toEnd++;
|
|
367
|
+
else last.fromEnd++;
|
|
368
|
+
} else
|
|
369
|
+
changes.push({
|
|
370
|
+
fromStart: x,
|
|
371
|
+
fromEnd: inserts ? x : x + 1,
|
|
372
|
+
toStart: y,
|
|
373
|
+
toEnd: inserts ? y + 1 : y
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return changes;
|
|
377
|
+
}
|
|
378
|
+
function characterChanges(a, b, maxEdits) {
|
|
379
|
+
const edits = shortestEdit(
|
|
380
|
+
a.length,
|
|
381
|
+
b.length,
|
|
382
|
+
(x, y) => a.charCodeAt(x) === b.charCodeAt(y),
|
|
383
|
+
maxEdits
|
|
384
|
+
);
|
|
385
|
+
return edits && changesOf(edits);
|
|
386
|
+
}
|
|
387
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
388
|
+
function tokensOf(text, ids) {
|
|
389
|
+
const tokens = [];
|
|
390
|
+
const starts = [];
|
|
391
|
+
for (const match of text.matchAll(TOKEN)) {
|
|
392
|
+
let id = ids.get(match[0]);
|
|
393
|
+
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
394
|
+
tokens.push(id);
|
|
395
|
+
starts.push(match.index);
|
|
396
|
+
}
|
|
397
|
+
starts.push(text.length);
|
|
398
|
+
return { tokens, starts };
|
|
399
|
+
}
|
|
400
|
+
function tokenChanges(a, b, maxEdits) {
|
|
401
|
+
const ids = /* @__PURE__ */ new Map();
|
|
402
|
+
const from = tokensOf(a, ids);
|
|
403
|
+
const to = tokensOf(b, ids);
|
|
404
|
+
const edits = shortestEdit(
|
|
405
|
+
from.tokens.length,
|
|
406
|
+
to.tokens.length,
|
|
407
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
408
|
+
maxEdits
|
|
409
|
+
);
|
|
410
|
+
if (!edits) return void 0;
|
|
411
|
+
let budget = maxEdits;
|
|
412
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
413
|
+
const change = {
|
|
414
|
+
fromStart: from.starts[stretch.fromStart],
|
|
415
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
416
|
+
toStart: to.starts[stretch.toStart],
|
|
417
|
+
toEnd: to.starts[stretch.toEnd]
|
|
418
|
+
};
|
|
419
|
+
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
420
|
+
a.slice(change.fromStart, change.fromEnd),
|
|
421
|
+
b.slice(change.toStart, change.toEnd),
|
|
422
|
+
budget
|
|
423
|
+
) : void 0;
|
|
424
|
+
if (!inner) return [change];
|
|
425
|
+
for (const found of inner)
|
|
426
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
427
|
+
return inner.map((found) => ({
|
|
428
|
+
fromStart: found.fromStart + change.fromStart,
|
|
429
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
430
|
+
toStart: found.toStart + change.toStart,
|
|
431
|
+
toEnd: found.toEnd + change.toStart
|
|
432
|
+
}));
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function diffText(from, to, maxEdits = 500) {
|
|
436
|
+
let start = 0;
|
|
437
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
438
|
+
start++;
|
|
439
|
+
let end = 0;
|
|
440
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
441
|
+
end++;
|
|
442
|
+
const a = from.slice(start, from.length - end);
|
|
443
|
+
const b = to.slice(start, to.length - end);
|
|
444
|
+
if (!a.length && !b.length) return [];
|
|
445
|
+
const found = a.length && b.length ? characterChanges(a, b, maxEdits) ?? tokenChanges(a, b, maxEdits) : void 0;
|
|
446
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a.length, toStart: 0, toEnd: b.length }];
|
|
447
|
+
const result = [];
|
|
448
|
+
for (const change of changes) {
|
|
449
|
+
const placed = {
|
|
450
|
+
fromStart: change.fromStart + start,
|
|
451
|
+
fromEnd: change.fromEnd + start,
|
|
452
|
+
toStart: change.toStart + start,
|
|
453
|
+
toEnd: change.toEnd + start
|
|
454
|
+
};
|
|
455
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
456
|
+
placed.fromStart--;
|
|
457
|
+
placed.toStart--;
|
|
458
|
+
}
|
|
459
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
460
|
+
placed.fromEnd++;
|
|
461
|
+
placed.toEnd++;
|
|
462
|
+
}
|
|
463
|
+
const last = result.at(-1);
|
|
464
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
465
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
466
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
467
|
+
} else result.push(placed);
|
|
468
|
+
}
|
|
469
|
+
return result;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// text/merge-three-way.ts
|
|
473
|
+
function mergeTextThreeWay(base, local, remote) {
|
|
474
|
+
if (local === remote || base === remote) return { status: "merged", text: local };
|
|
475
|
+
if (base === local) return { status: "merged", text: remote };
|
|
476
|
+
if (Math.max(base.length, local.length, remote.length) > 1e6)
|
|
477
|
+
return { status: "unresolved" };
|
|
478
|
+
const changes = (value) => diffText(base, value).map((change) => ({
|
|
479
|
+
start: change.fromStart,
|
|
480
|
+
end: change.fromEnd,
|
|
481
|
+
text: value.slice(change.toStart, change.toEnd)
|
|
482
|
+
}));
|
|
483
|
+
const edits = changes(local);
|
|
484
|
+
for (const next of changes(remote)) {
|
|
485
|
+
if (edits.some(
|
|
486
|
+
(edit) => edit.start === next.start && edit.end === next.end && edit.text === next.text
|
|
487
|
+
))
|
|
488
|
+
continue;
|
|
489
|
+
if (edits.some((edit) => {
|
|
490
|
+
if (edit.start === edit.end && next.start === next.end) return false;
|
|
491
|
+
if (edit.start === edit.end) return edit.start > next.start && edit.start < next.end;
|
|
492
|
+
if (next.start === next.end) return next.start > edit.start && next.start < edit.end;
|
|
493
|
+
return edit.start < next.end && next.start < edit.end;
|
|
494
|
+
}))
|
|
495
|
+
return { status: "unresolved" };
|
|
496
|
+
edits.push(next);
|
|
497
|
+
}
|
|
498
|
+
edits.sort(
|
|
499
|
+
(a, b) => a.start - b.start || a.end - b.end || (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)
|
|
500
|
+
);
|
|
501
|
+
let text = "", cursor = 0;
|
|
502
|
+
for (const edit of edits) {
|
|
503
|
+
text += base.slice(cursor, edit.start) + edit.text;
|
|
504
|
+
cursor = edit.end;
|
|
505
|
+
}
|
|
506
|
+
return { status: "merged", text: text + base.slice(cursor) };
|
|
507
|
+
}
|
|
508
|
+
|
|
317
509
|
// text/font-metrics/design-advances.generated.ts
|
|
318
510
|
var DESIGN_ADVANCES = {
|
|
319
511
|
arial: {
|
|
@@ -1218,6 +1410,7 @@ exports.getSubstituteFonts = getSubstituteFonts;
|
|
|
1218
1410
|
exports.hasDesignAdvances = hasDesignAdvances;
|
|
1219
1411
|
exports.hasDirectSubstitution = hasDirectSubstitution;
|
|
1220
1412
|
exports.hasDistinctScriptFonts = hasDistinctScriptFonts;
|
|
1413
|
+
exports.mergeTextThreeWay = mergeTextThreeWay;
|
|
1221
1414
|
exports.metricFontFamily = metricFontFamily;
|
|
1222
1415
|
exports.parseLocaleNumber = parseLocaleNumber;
|
|
1223
1416
|
exports.parsePanoseBytes = parsePanoseBytes;
|
package/dist/text/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './tab-leader.js';
|
|
|
4
4
|
export * from './decimal-tab.js';
|
|
5
5
|
export * from './wrap-styled-runs.js';
|
|
6
6
|
export * from './change-case.js';
|
|
7
|
+
export * from './merge-three-way.js';
|
|
7
8
|
export * from './font-metrics/advance-width.js';
|
|
8
9
|
export { parseTsv, toTsv } from './tsv.js';
|
|
9
10
|
export * from './locale-number.js';
|
package/dist/text/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../text/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,SAAS,GACd,MAAM,4BAA4B,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../text/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,SAAS,GACd,MAAM,4BAA4B,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/text/index.mjs
CHANGED
|
@@ -312,6 +312,198 @@ function changeTextCaseRanges(text, mode, boundaries = []) {
|
|
|
312
312
|
return ranges;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
// text/text-diff.ts
|
|
316
|
+
var isLowSurrogate = (text, at) => {
|
|
317
|
+
const code = text.charCodeAt(at);
|
|
318
|
+
return code >= 56320 && code <= 57343;
|
|
319
|
+
};
|
|
320
|
+
function shortestEdit(n, m, same, maxEdits) {
|
|
321
|
+
const max = Math.min(n + m, maxEdits);
|
|
322
|
+
const offset = max + 1;
|
|
323
|
+
const v = new Int32Array(2 * max + 3);
|
|
324
|
+
const trace = [];
|
|
325
|
+
for (let d = 0; d <= max; d++) {
|
|
326
|
+
for (let k = -d; k <= d; k += 2) {
|
|
327
|
+
const down = k === -d || k !== d && v[offset + k - 1] < v[offset + k + 1];
|
|
328
|
+
let x = down ? v[offset + k + 1] : v[offset + k - 1] + 1;
|
|
329
|
+
let y = x - k;
|
|
330
|
+
while (x < n && y < m && same(x, y)) {
|
|
331
|
+
x++;
|
|
332
|
+
y++;
|
|
333
|
+
}
|
|
334
|
+
v[offset + k] = x;
|
|
335
|
+
if (x >= n && y >= m) return backtrack(trace, n, m, d);
|
|
336
|
+
}
|
|
337
|
+
trace.push(v.slice(offset - d, offset + d + 1));
|
|
338
|
+
}
|
|
339
|
+
return void 0;
|
|
340
|
+
}
|
|
341
|
+
function backtrack(trace, n, m, d) {
|
|
342
|
+
const edits = [];
|
|
343
|
+
let x = n;
|
|
344
|
+
let y = m;
|
|
345
|
+
for (let step = d; step > 0; step--) {
|
|
346
|
+
const previous = trace[step - 1];
|
|
347
|
+
const at = (k2) => previous[k2 + step - 1];
|
|
348
|
+
const k = x - y;
|
|
349
|
+
const down = k === -step || k !== step && at(k - 1) < at(k + 1);
|
|
350
|
+
const before = down ? k + 1 : k - 1;
|
|
351
|
+
const startX = at(before);
|
|
352
|
+
const startY = startX - before;
|
|
353
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
354
|
+
x = startX;
|
|
355
|
+
y = startY;
|
|
356
|
+
}
|
|
357
|
+
return edits.reverse();
|
|
358
|
+
}
|
|
359
|
+
function changesOf(edits) {
|
|
360
|
+
const changes = [];
|
|
361
|
+
for (const [x, y, inserts] of edits) {
|
|
362
|
+
const last = changes.at(-1);
|
|
363
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
364
|
+
if (inserts) last.toEnd++;
|
|
365
|
+
else last.fromEnd++;
|
|
366
|
+
} else
|
|
367
|
+
changes.push({
|
|
368
|
+
fromStart: x,
|
|
369
|
+
fromEnd: inserts ? x : x + 1,
|
|
370
|
+
toStart: y,
|
|
371
|
+
toEnd: inserts ? y + 1 : y
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return changes;
|
|
375
|
+
}
|
|
376
|
+
function characterChanges(a, b, maxEdits) {
|
|
377
|
+
const edits = shortestEdit(
|
|
378
|
+
a.length,
|
|
379
|
+
b.length,
|
|
380
|
+
(x, y) => a.charCodeAt(x) === b.charCodeAt(y),
|
|
381
|
+
maxEdits
|
|
382
|
+
);
|
|
383
|
+
return edits && changesOf(edits);
|
|
384
|
+
}
|
|
385
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
386
|
+
function tokensOf(text, ids) {
|
|
387
|
+
const tokens = [];
|
|
388
|
+
const starts = [];
|
|
389
|
+
for (const match of text.matchAll(TOKEN)) {
|
|
390
|
+
let id = ids.get(match[0]);
|
|
391
|
+
if (id === void 0) ids.set(match[0], id = ids.size);
|
|
392
|
+
tokens.push(id);
|
|
393
|
+
starts.push(match.index);
|
|
394
|
+
}
|
|
395
|
+
starts.push(text.length);
|
|
396
|
+
return { tokens, starts };
|
|
397
|
+
}
|
|
398
|
+
function tokenChanges(a, b, maxEdits) {
|
|
399
|
+
const ids = /* @__PURE__ */ new Map();
|
|
400
|
+
const from = tokensOf(a, ids);
|
|
401
|
+
const to = tokensOf(b, ids);
|
|
402
|
+
const edits = shortestEdit(
|
|
403
|
+
from.tokens.length,
|
|
404
|
+
to.tokens.length,
|
|
405
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
406
|
+
maxEdits
|
|
407
|
+
);
|
|
408
|
+
if (!edits) return void 0;
|
|
409
|
+
let budget = maxEdits;
|
|
410
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
411
|
+
const change = {
|
|
412
|
+
fromStart: from.starts[stretch.fromStart],
|
|
413
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
414
|
+
toStart: to.starts[stretch.toStart],
|
|
415
|
+
toEnd: to.starts[stretch.toEnd]
|
|
416
|
+
};
|
|
417
|
+
const inner = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
418
|
+
a.slice(change.fromStart, change.fromEnd),
|
|
419
|
+
b.slice(change.toStart, change.toEnd),
|
|
420
|
+
budget
|
|
421
|
+
) : void 0;
|
|
422
|
+
if (!inner) return [change];
|
|
423
|
+
for (const found of inner)
|
|
424
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
425
|
+
return inner.map((found) => ({
|
|
426
|
+
fromStart: found.fromStart + change.fromStart,
|
|
427
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
428
|
+
toStart: found.toStart + change.toStart,
|
|
429
|
+
toEnd: found.toEnd + change.toStart
|
|
430
|
+
}));
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
function diffText(from, to, maxEdits = 500) {
|
|
434
|
+
let start = 0;
|
|
435
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
436
|
+
start++;
|
|
437
|
+
let end = 0;
|
|
438
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
439
|
+
end++;
|
|
440
|
+
const a = from.slice(start, from.length - end);
|
|
441
|
+
const b = to.slice(start, to.length - end);
|
|
442
|
+
if (!a.length && !b.length) return [];
|
|
443
|
+
const found = a.length && b.length ? characterChanges(a, b, maxEdits) ?? tokenChanges(a, b, maxEdits) : void 0;
|
|
444
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a.length, toStart: 0, toEnd: b.length }];
|
|
445
|
+
const result = [];
|
|
446
|
+
for (const change of changes) {
|
|
447
|
+
const placed = {
|
|
448
|
+
fromStart: change.fromStart + start,
|
|
449
|
+
fromEnd: change.fromEnd + start,
|
|
450
|
+
toStart: change.toStart + start,
|
|
451
|
+
toEnd: change.toEnd + start
|
|
452
|
+
};
|
|
453
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
454
|
+
placed.fromStart--;
|
|
455
|
+
placed.toStart--;
|
|
456
|
+
}
|
|
457
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
458
|
+
placed.fromEnd++;
|
|
459
|
+
placed.toEnd++;
|
|
460
|
+
}
|
|
461
|
+
const last = result.at(-1);
|
|
462
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
463
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
464
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
465
|
+
} else result.push(placed);
|
|
466
|
+
}
|
|
467
|
+
return result;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// text/merge-three-way.ts
|
|
471
|
+
function mergeTextThreeWay(base, local, remote) {
|
|
472
|
+
if (local === remote || base === remote) return { status: "merged", text: local };
|
|
473
|
+
if (base === local) return { status: "merged", text: remote };
|
|
474
|
+
if (Math.max(base.length, local.length, remote.length) > 1e6)
|
|
475
|
+
return { status: "unresolved" };
|
|
476
|
+
const changes = (value) => diffText(base, value).map((change) => ({
|
|
477
|
+
start: change.fromStart,
|
|
478
|
+
end: change.fromEnd,
|
|
479
|
+
text: value.slice(change.toStart, change.toEnd)
|
|
480
|
+
}));
|
|
481
|
+
const edits = changes(local);
|
|
482
|
+
for (const next of changes(remote)) {
|
|
483
|
+
if (edits.some(
|
|
484
|
+
(edit) => edit.start === next.start && edit.end === next.end && edit.text === next.text
|
|
485
|
+
))
|
|
486
|
+
continue;
|
|
487
|
+
if (edits.some((edit) => {
|
|
488
|
+
if (edit.start === edit.end && next.start === next.end) return false;
|
|
489
|
+
if (edit.start === edit.end) return edit.start > next.start && edit.start < next.end;
|
|
490
|
+
if (next.start === next.end) return next.start > edit.start && next.start < edit.end;
|
|
491
|
+
return edit.start < next.end && next.start < edit.end;
|
|
492
|
+
}))
|
|
493
|
+
return { status: "unresolved" };
|
|
494
|
+
edits.push(next);
|
|
495
|
+
}
|
|
496
|
+
edits.sort(
|
|
497
|
+
(a, b) => a.start - b.start || a.end - b.end || (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)
|
|
498
|
+
);
|
|
499
|
+
let text = "", cursor = 0;
|
|
500
|
+
for (const edit of edits) {
|
|
501
|
+
text += base.slice(cursor, edit.start) + edit.text;
|
|
502
|
+
cursor = edit.end;
|
|
503
|
+
}
|
|
504
|
+
return { status: "merged", text: text + base.slice(cursor) };
|
|
505
|
+
}
|
|
506
|
+
|
|
315
507
|
// text/font-metrics/design-advances.generated.ts
|
|
316
508
|
var DESIGN_ADVANCES = {
|
|
317
509
|
arial: {
|
|
@@ -1190,4 +1382,4 @@ function subsetTrueType(font, used) {
|
|
|
1190
1382
|
return { data: out, glyphs };
|
|
1191
1383
|
}
|
|
1192
1384
|
|
|
1193
|
-
export { FONT_SUBSTITUTION_MAP, METRIC_FONT_SUBSTITUTES, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, TEXT_CASE_MODES, buildFontFamilyString, buildLeaderString, changeTextCase, changeTextCaseRanges, classifyPanose, decimalAnchorIndex, decimalSeparatorForLanguage, designTextWidthEm, detectFontScript, distributeRunsText, formatLocaleNumber, getLeaderCharacter, getLeaderStyles, getPanoseWeight, getSubstituteFontFamily, getSubstituteFonts, hasDesignAdvances, hasDirectSubstitution, hasDistinctScriptFonts, metricFontFamily, parseLocaleNumber, parsePanoseBytes, parsePanoseString, parseTrueType, parseTsv, realignOrCollapseRuns, resolveFontForScript, resolveScriptFontSet, segmentByFont, segmentByScript, stripFontStyleSuffix, subsetTrueType, toTsv, wrapStyledRuns };
|
|
1385
|
+
export { FONT_SUBSTITUTION_MAP, METRIC_FONT_SUBSTITUTES, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, TEXT_CASE_MODES, buildFontFamilyString, buildLeaderString, changeTextCase, changeTextCaseRanges, classifyPanose, decimalAnchorIndex, decimalSeparatorForLanguage, designTextWidthEm, detectFontScript, distributeRunsText, formatLocaleNumber, getLeaderCharacter, getLeaderStyles, getPanoseWeight, getSubstituteFontFamily, getSubstituteFonts, hasDesignAdvances, hasDirectSubstitution, hasDistinctScriptFonts, mergeTextThreeWay, metricFontFamily, parseLocaleNumber, parsePanoseBytes, parsePanoseString, parseTrueType, parseTsv, realignOrCollapseRuns, resolveFontForScript, resolveScriptFontSet, segmentByFont, segmentByScript, stripFontStyleSuffix, subsetTrueType, toTsv, wrapStyledRuns };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type TextMergeResult = {
|
|
2
|
+
status: 'merged';
|
|
3
|
+
text: string;
|
|
4
|
+
} | {
|
|
5
|
+
status: 'unresolved';
|
|
6
|
+
};
|
|
7
|
+
/** Combine non-overlapping changes against one shared ancestor, without inventing edit history. */
|
|
8
|
+
export declare function mergeTextThreeWay(base: string, local: string, remote: string): TextMergeResult;
|
|
9
|
+
//# sourceMappingURL=merge-three-way.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-three-way.d.ts","sourceRoot":"","sources":["../../text/merge-three-way.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AAO5F,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CA0C9F"}
|