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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Y from 'yjs';
|
|
2
|
+
import type { Workbook } from '../model.js';
|
|
3
|
+
export declare function workbookResidual(workbook: Workbook, doc: Y.Doc): {
|
|
4
|
+
book: {
|
|
5
|
+
properties: {
|
|
6
|
+
[k: string]: any;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
sheets: any;
|
|
10
|
+
};
|
|
11
|
+
export declare function applyWorkbookResidual(workbook: Workbook, doc: Y.Doc, value: ReturnType<typeof workbookResidual>): void;
|
|
12
|
+
/** Formula result caches are derived, not user edits. The combined workbook asks Excel to recalc. */
|
|
13
|
+
export declare function stripFormulaCaches(doc: Y.Doc): boolean;
|
|
14
|
+
/** Unknown source fragments of regenerated parts must not silently take the remote branch. */
|
|
15
|
+
export declare function unsupportedSourceChanges(workbooks: Workbook[]): string[];
|
|
16
|
+
//# sourceMappingURL=merge-residual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-residual.d.ts","sourceRoot":"","sources":["../../../xlsx/collab/merge-residual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAG9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AA2CzC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG;;;;;;;EAqB9D;AAED,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,CAAC,CAAC,GAAG,EACV,KAAK,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,QAgB1C;AAED,qGAAqG;AACrG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,OAAO,CActD;AAED,8FAA8F;AAC9F,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CA+DxE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SnapshotMergeResult } from '../../opc/merge-snapshots.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reconciles saved XLSX files by logical sheet/cell/style identity using a common Yjs baseline.
|
|
4
|
+
* This is a three-way merge of snapshots, not recovery of missing collaboration operations.
|
|
5
|
+
* Arrays outside the stable mapping and changes to the same field remain unresolved.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeWorkbookSnapshots(base: Uint8Array, local: Uint8Array, remote: Uint8Array): Promise<SnapshotMergeResult>;
|
|
8
|
+
//# sourceMappingURL=merge-snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-snapshots.d.ts","sourceRoot":"","sources":["../../../xlsx/collab/merge-snapshots.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAYxF;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,GAChB,OAAO,CAAC,mBAAmB,CAAC,CA4E9B"}
|
package/dist/xlsx/index.cjs
CHANGED
|
@@ -244,6 +244,161 @@ function attr(element3, local, ns, prefix) {
|
|
|
244
244
|
}
|
|
245
245
|
var relAttr = (element3, local) => attr(element3, local, NS.r, "r");
|
|
246
246
|
|
|
247
|
+
// text/text-diff.ts
|
|
248
|
+
var isLowSurrogate = (text3, at2) => {
|
|
249
|
+
const code = text3.charCodeAt(at2);
|
|
250
|
+
return code >= 56320 && code <= 57343;
|
|
251
|
+
};
|
|
252
|
+
function shortestEdit(n2, m, same11, maxEdits) {
|
|
253
|
+
const max = Math.min(n2 + m, maxEdits);
|
|
254
|
+
const offset2 = max + 1;
|
|
255
|
+
const v = new Int32Array(2 * max + 3);
|
|
256
|
+
const trace = [];
|
|
257
|
+
for (let d = 0; d <= max; d++) {
|
|
258
|
+
for (let k = -d; k <= d; k += 2) {
|
|
259
|
+
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
260
|
+
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
261
|
+
let y = x - k;
|
|
262
|
+
while (x < n2 && y < m && same11(x, y)) {
|
|
263
|
+
x++;
|
|
264
|
+
y++;
|
|
265
|
+
}
|
|
266
|
+
v[offset2 + k] = x;
|
|
267
|
+
if (x >= n2 && y >= m) return backtrack(trace, n2, m, d);
|
|
268
|
+
}
|
|
269
|
+
trace.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
270
|
+
}
|
|
271
|
+
return void 0;
|
|
272
|
+
}
|
|
273
|
+
function backtrack(trace, n2, m, d) {
|
|
274
|
+
const edits = [];
|
|
275
|
+
let x = n2;
|
|
276
|
+
let y = m;
|
|
277
|
+
for (let step2 = d; step2 > 0; step2--) {
|
|
278
|
+
const previous = trace[step2 - 1];
|
|
279
|
+
const at2 = (k2) => previous[k2 + step2 - 1];
|
|
280
|
+
const k = x - y;
|
|
281
|
+
const down = k === -step2 || k !== step2 && at2(k - 1) < at2(k + 1);
|
|
282
|
+
const before = down ? k + 1 : k - 1;
|
|
283
|
+
const startX = at2(before);
|
|
284
|
+
const startY = startX - before;
|
|
285
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
286
|
+
x = startX;
|
|
287
|
+
y = startY;
|
|
288
|
+
}
|
|
289
|
+
return edits.reverse();
|
|
290
|
+
}
|
|
291
|
+
function changesOf(edits) {
|
|
292
|
+
const changes = [];
|
|
293
|
+
for (const [x, y, inserts] of edits) {
|
|
294
|
+
const last = changes.at(-1);
|
|
295
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
296
|
+
if (inserts) last.toEnd++;
|
|
297
|
+
else last.fromEnd++;
|
|
298
|
+
} else
|
|
299
|
+
changes.push({
|
|
300
|
+
fromStart: x,
|
|
301
|
+
fromEnd: inserts ? x : x + 1,
|
|
302
|
+
toStart: y,
|
|
303
|
+
toEnd: inserts ? y + 1 : y
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
return changes;
|
|
307
|
+
}
|
|
308
|
+
function characterChanges(a2, b, maxEdits) {
|
|
309
|
+
const edits = shortestEdit(
|
|
310
|
+
a2.length,
|
|
311
|
+
b.length,
|
|
312
|
+
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
313
|
+
maxEdits
|
|
314
|
+
);
|
|
315
|
+
return edits && changesOf(edits);
|
|
316
|
+
}
|
|
317
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
318
|
+
function tokensOf(text3, ids) {
|
|
319
|
+
const tokens2 = [];
|
|
320
|
+
const starts = [];
|
|
321
|
+
for (const match2 of text3.matchAll(TOKEN)) {
|
|
322
|
+
let id = ids.get(match2[0]);
|
|
323
|
+
if (id === void 0) ids.set(match2[0], id = ids.size);
|
|
324
|
+
tokens2.push(id);
|
|
325
|
+
starts.push(match2.index);
|
|
326
|
+
}
|
|
327
|
+
starts.push(text3.length);
|
|
328
|
+
return { tokens: tokens2, starts };
|
|
329
|
+
}
|
|
330
|
+
function tokenChanges(a2, b, maxEdits) {
|
|
331
|
+
const ids = /* @__PURE__ */ new Map();
|
|
332
|
+
const from = tokensOf(a2, ids);
|
|
333
|
+
const to = tokensOf(b, ids);
|
|
334
|
+
const edits = shortestEdit(
|
|
335
|
+
from.tokens.length,
|
|
336
|
+
to.tokens.length,
|
|
337
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
338
|
+
maxEdits
|
|
339
|
+
);
|
|
340
|
+
if (!edits) return void 0;
|
|
341
|
+
let budget = maxEdits;
|
|
342
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
343
|
+
const change = {
|
|
344
|
+
fromStart: from.starts[stretch.fromStart],
|
|
345
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
346
|
+
toStart: to.starts[stretch.toStart],
|
|
347
|
+
toEnd: to.starts[stretch.toEnd]
|
|
348
|
+
};
|
|
349
|
+
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
350
|
+
a2.slice(change.fromStart, change.fromEnd),
|
|
351
|
+
b.slice(change.toStart, change.toEnd),
|
|
352
|
+
budget
|
|
353
|
+
) : void 0;
|
|
354
|
+
if (!inner2) return [change];
|
|
355
|
+
for (const found of inner2)
|
|
356
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
357
|
+
return inner2.map((found) => ({
|
|
358
|
+
fromStart: found.fromStart + change.fromStart,
|
|
359
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
360
|
+
toStart: found.toStart + change.toStart,
|
|
361
|
+
toEnd: found.toEnd + change.toStart
|
|
362
|
+
}));
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function diffText(from, to, maxEdits = 500) {
|
|
366
|
+
let start = 0;
|
|
367
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
368
|
+
start++;
|
|
369
|
+
let end = 0;
|
|
370
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
371
|
+
end++;
|
|
372
|
+
const a2 = from.slice(start, from.length - end);
|
|
373
|
+
const b = to.slice(start, to.length - end);
|
|
374
|
+
if (!a2.length && !b.length) return [];
|
|
375
|
+
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
376
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
377
|
+
const result2 = [];
|
|
378
|
+
for (const change of changes) {
|
|
379
|
+
const placed = {
|
|
380
|
+
fromStart: change.fromStart + start,
|
|
381
|
+
fromEnd: change.fromEnd + start,
|
|
382
|
+
toStart: change.toStart + start,
|
|
383
|
+
toEnd: change.toEnd + start
|
|
384
|
+
};
|
|
385
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
386
|
+
placed.fromStart--;
|
|
387
|
+
placed.toStart--;
|
|
388
|
+
}
|
|
389
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
390
|
+
placed.fromEnd++;
|
|
391
|
+
placed.toEnd++;
|
|
392
|
+
}
|
|
393
|
+
const last = result2.at(-1);
|
|
394
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
395
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
396
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
397
|
+
} else result2.push(placed);
|
|
398
|
+
}
|
|
399
|
+
return result2;
|
|
400
|
+
}
|
|
401
|
+
|
|
247
402
|
// xml/lite.ts
|
|
248
403
|
var LiteElement = class {
|
|
249
404
|
constructor(tagName, localName3, namespaceURI) {
|
|
@@ -20505,53 +20660,6 @@ function buildContentTypesXml(types) {
|
|
|
20505
20660
|
).join("");
|
|
20506
20661
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${NS.contentTypes}">${defaults}${overrides}</Types>`;
|
|
20507
20662
|
}
|
|
20508
|
-
|
|
20509
|
-
// opc/safe-href.ts
|
|
20510
|
-
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
20511
|
-
var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
20512
|
-
var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
|
|
20513
|
-
"javascript",
|
|
20514
|
-
"vbscript",
|
|
20515
|
-
"livescript",
|
|
20516
|
-
"jscript",
|
|
20517
|
-
"mocha",
|
|
20518
|
-
"data",
|
|
20519
|
-
"mhtml",
|
|
20520
|
-
"ms-its",
|
|
20521
|
-
"mk",
|
|
20522
|
-
"x-javascript",
|
|
20523
|
-
"blob"
|
|
20524
|
-
]);
|
|
20525
|
-
var IGNORABLE = new RegExp(
|
|
20526
|
-
"[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
|
|
20527
|
-
"gu"
|
|
20528
|
-
);
|
|
20529
|
-
var CONTROL2 = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
|
|
20530
|
-
var SCHEME = /^([a-z][a-z0-9+.-]*):/;
|
|
20531
|
-
var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
|
|
20532
|
-
var reject = (reason) => ({
|
|
20533
|
-
store: false,
|
|
20534
|
-
open: false,
|
|
20535
|
-
reason
|
|
20536
|
-
});
|
|
20537
|
-
function hyperlinkPolicy(href, options2 = {}) {
|
|
20538
|
-
if (typeof href !== "string") return reject("empty");
|
|
20539
|
-
const trimmed2 = href.trim();
|
|
20540
|
-
const normalized = trimmed2.replace(IGNORABLE, "").toLowerCase();
|
|
20541
|
-
if (normalized.length === 0) return reject("empty");
|
|
20542
|
-
const scheme2 = SCHEME.exec(normalized)?.[1];
|
|
20543
|
-
if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
|
|
20544
|
-
if (scheme2 !== void 0 && !trimmed2.toLowerCase().startsWith(`${scheme2}:`))
|
|
20545
|
-
return reject("obfuscated-scheme");
|
|
20546
|
-
if (CONTROL2.test(trimmed2)) return reject("control-characters");
|
|
20547
|
-
if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
|
|
20548
|
-
if (scheme2.length === 1) return STORE_ONLY;
|
|
20549
|
-
if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
|
|
20550
|
-
if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
|
|
20551
|
-
return { store: true, open: true };
|
|
20552
|
-
if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
|
|
20553
|
-
return reject("unsupported-scheme");
|
|
20554
|
-
}
|
|
20555
20663
|
var DEFAULT_ZIP_LIMITS = {
|
|
20556
20664
|
maxEntries: 1e4,
|
|
20557
20665
|
maxEntryBytes: 100 * 1024 * 1024,
|
|
@@ -20760,6 +20868,53 @@ function guardZip(zip, limits = {}) {
|
|
|
20760
20868
|
return zip;
|
|
20761
20869
|
}
|
|
20762
20870
|
|
|
20871
|
+
// opc/safe-href.ts
|
|
20872
|
+
var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
|
|
20873
|
+
var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
|
|
20874
|
+
var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
|
|
20875
|
+
"javascript",
|
|
20876
|
+
"vbscript",
|
|
20877
|
+
"livescript",
|
|
20878
|
+
"jscript",
|
|
20879
|
+
"mocha",
|
|
20880
|
+
"data",
|
|
20881
|
+
"mhtml",
|
|
20882
|
+
"ms-its",
|
|
20883
|
+
"mk",
|
|
20884
|
+
"x-javascript",
|
|
20885
|
+
"blob"
|
|
20886
|
+
]);
|
|
20887
|
+
var IGNORABLE = new RegExp(
|
|
20888
|
+
"[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
|
|
20889
|
+
"gu"
|
|
20890
|
+
);
|
|
20891
|
+
var CONTROL2 = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
|
|
20892
|
+
var SCHEME = /^([a-z][a-z0-9+.-]*):/;
|
|
20893
|
+
var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
|
|
20894
|
+
var reject = (reason) => ({
|
|
20895
|
+
store: false,
|
|
20896
|
+
open: false,
|
|
20897
|
+
reason
|
|
20898
|
+
});
|
|
20899
|
+
function hyperlinkPolicy(href, options2 = {}) {
|
|
20900
|
+
if (typeof href !== "string") return reject("empty");
|
|
20901
|
+
const trimmed2 = href.trim();
|
|
20902
|
+
const normalized = trimmed2.replace(IGNORABLE, "").toLowerCase();
|
|
20903
|
+
if (normalized.length === 0) return reject("empty");
|
|
20904
|
+
const scheme2 = SCHEME.exec(normalized)?.[1];
|
|
20905
|
+
if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
|
|
20906
|
+
if (scheme2 !== void 0 && !trimmed2.toLowerCase().startsWith(`${scheme2}:`))
|
|
20907
|
+
return reject("obfuscated-scheme");
|
|
20908
|
+
if (CONTROL2.test(trimmed2)) return reject("control-characters");
|
|
20909
|
+
if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
|
|
20910
|
+
if (scheme2.length === 1) return STORE_ONLY;
|
|
20911
|
+
if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
|
|
20912
|
+
if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
|
|
20913
|
+
return { store: true, open: true };
|
|
20914
|
+
if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
|
|
20915
|
+
return reject("unsupported-scheme");
|
|
20916
|
+
}
|
|
20917
|
+
|
|
20763
20918
|
// opc/properties/types.ts
|
|
20764
20919
|
var CUSTOM_PROPERTIES_FMTID = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
|
|
20765
20920
|
var PROPERTY_PART_NAMES = {
|
|
@@ -49633,161 +49788,6 @@ var CommentIds = class {
|
|
|
49633
49788
|
}
|
|
49634
49789
|
};
|
|
49635
49790
|
|
|
49636
|
-
// text/text-diff.ts
|
|
49637
|
-
var isLowSurrogate = (text3, at2) => {
|
|
49638
|
-
const code = text3.charCodeAt(at2);
|
|
49639
|
-
return code >= 56320 && code <= 57343;
|
|
49640
|
-
};
|
|
49641
|
-
function shortestEdit(n2, m, same11, maxEdits) {
|
|
49642
|
-
const max = Math.min(n2 + m, maxEdits);
|
|
49643
|
-
const offset2 = max + 1;
|
|
49644
|
-
const v = new Int32Array(2 * max + 3);
|
|
49645
|
-
const trace = [];
|
|
49646
|
-
for (let d = 0; d <= max; d++) {
|
|
49647
|
-
for (let k = -d; k <= d; k += 2) {
|
|
49648
|
-
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
49649
|
-
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
49650
|
-
let y = x - k;
|
|
49651
|
-
while (x < n2 && y < m && same11(x, y)) {
|
|
49652
|
-
x++;
|
|
49653
|
-
y++;
|
|
49654
|
-
}
|
|
49655
|
-
v[offset2 + k] = x;
|
|
49656
|
-
if (x >= n2 && y >= m) return backtrack(trace, n2, m, d);
|
|
49657
|
-
}
|
|
49658
|
-
trace.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
49659
|
-
}
|
|
49660
|
-
return void 0;
|
|
49661
|
-
}
|
|
49662
|
-
function backtrack(trace, n2, m, d) {
|
|
49663
|
-
const edits = [];
|
|
49664
|
-
let x = n2;
|
|
49665
|
-
let y = m;
|
|
49666
|
-
for (let step2 = d; step2 > 0; step2--) {
|
|
49667
|
-
const previous = trace[step2 - 1];
|
|
49668
|
-
const at2 = (k2) => previous[k2 + step2 - 1];
|
|
49669
|
-
const k = x - y;
|
|
49670
|
-
const down = k === -step2 || k !== step2 && at2(k - 1) < at2(k + 1);
|
|
49671
|
-
const before = down ? k + 1 : k - 1;
|
|
49672
|
-
const startX = at2(before);
|
|
49673
|
-
const startY = startX - before;
|
|
49674
|
-
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
49675
|
-
x = startX;
|
|
49676
|
-
y = startY;
|
|
49677
|
-
}
|
|
49678
|
-
return edits.reverse();
|
|
49679
|
-
}
|
|
49680
|
-
function changesOf(edits) {
|
|
49681
|
-
const changes = [];
|
|
49682
|
-
for (const [x, y, inserts] of edits) {
|
|
49683
|
-
const last = changes.at(-1);
|
|
49684
|
-
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
49685
|
-
if (inserts) last.toEnd++;
|
|
49686
|
-
else last.fromEnd++;
|
|
49687
|
-
} else
|
|
49688
|
-
changes.push({
|
|
49689
|
-
fromStart: x,
|
|
49690
|
-
fromEnd: inserts ? x : x + 1,
|
|
49691
|
-
toStart: y,
|
|
49692
|
-
toEnd: inserts ? y + 1 : y
|
|
49693
|
-
});
|
|
49694
|
-
}
|
|
49695
|
-
return changes;
|
|
49696
|
-
}
|
|
49697
|
-
function characterChanges(a2, b, maxEdits) {
|
|
49698
|
-
const edits = shortestEdit(
|
|
49699
|
-
a2.length,
|
|
49700
|
-
b.length,
|
|
49701
|
-
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
49702
|
-
maxEdits
|
|
49703
|
-
);
|
|
49704
|
-
return edits && changesOf(edits);
|
|
49705
|
-
}
|
|
49706
|
-
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
49707
|
-
function tokensOf(text3, ids) {
|
|
49708
|
-
const tokens2 = [];
|
|
49709
|
-
const starts = [];
|
|
49710
|
-
for (const match2 of text3.matchAll(TOKEN)) {
|
|
49711
|
-
let id = ids.get(match2[0]);
|
|
49712
|
-
if (id === void 0) ids.set(match2[0], id = ids.size);
|
|
49713
|
-
tokens2.push(id);
|
|
49714
|
-
starts.push(match2.index);
|
|
49715
|
-
}
|
|
49716
|
-
starts.push(text3.length);
|
|
49717
|
-
return { tokens: tokens2, starts };
|
|
49718
|
-
}
|
|
49719
|
-
function tokenChanges(a2, b, maxEdits) {
|
|
49720
|
-
const ids = /* @__PURE__ */ new Map();
|
|
49721
|
-
const from = tokensOf(a2, ids);
|
|
49722
|
-
const to = tokensOf(b, ids);
|
|
49723
|
-
const edits = shortestEdit(
|
|
49724
|
-
from.tokens.length,
|
|
49725
|
-
to.tokens.length,
|
|
49726
|
-
(x, y) => from.tokens[x] === to.tokens[y],
|
|
49727
|
-
maxEdits
|
|
49728
|
-
);
|
|
49729
|
-
if (!edits) return void 0;
|
|
49730
|
-
let budget = maxEdits;
|
|
49731
|
-
return changesOf(edits).flatMap((stretch) => {
|
|
49732
|
-
const change = {
|
|
49733
|
-
fromStart: from.starts[stretch.fromStart],
|
|
49734
|
-
fromEnd: from.starts[stretch.fromEnd],
|
|
49735
|
-
toStart: to.starts[stretch.toStart],
|
|
49736
|
-
toEnd: to.starts[stretch.toEnd]
|
|
49737
|
-
};
|
|
49738
|
-
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
49739
|
-
a2.slice(change.fromStart, change.fromEnd),
|
|
49740
|
-
b.slice(change.toStart, change.toEnd),
|
|
49741
|
-
budget
|
|
49742
|
-
) : void 0;
|
|
49743
|
-
if (!inner2) return [change];
|
|
49744
|
-
for (const found of inner2)
|
|
49745
|
-
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
49746
|
-
return inner2.map((found) => ({
|
|
49747
|
-
fromStart: found.fromStart + change.fromStart,
|
|
49748
|
-
fromEnd: found.fromEnd + change.fromStart,
|
|
49749
|
-
toStart: found.toStart + change.toStart,
|
|
49750
|
-
toEnd: found.toEnd + change.toStart
|
|
49751
|
-
}));
|
|
49752
|
-
});
|
|
49753
|
-
}
|
|
49754
|
-
function diffText(from, to, maxEdits = 500) {
|
|
49755
|
-
let start = 0;
|
|
49756
|
-
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
49757
|
-
start++;
|
|
49758
|
-
let end = 0;
|
|
49759
|
-
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
49760
|
-
end++;
|
|
49761
|
-
const a2 = from.slice(start, from.length - end);
|
|
49762
|
-
const b = to.slice(start, to.length - end);
|
|
49763
|
-
if (!a2.length && !b.length) return [];
|
|
49764
|
-
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
49765
|
-
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
49766
|
-
const result2 = [];
|
|
49767
|
-
for (const change of changes) {
|
|
49768
|
-
const placed = {
|
|
49769
|
-
fromStart: change.fromStart + start,
|
|
49770
|
-
fromEnd: change.fromEnd + start,
|
|
49771
|
-
toStart: change.toStart + start,
|
|
49772
|
-
toEnd: change.toEnd + start
|
|
49773
|
-
};
|
|
49774
|
-
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
49775
|
-
placed.fromStart--;
|
|
49776
|
-
placed.toStart--;
|
|
49777
|
-
}
|
|
49778
|
-
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
49779
|
-
placed.fromEnd++;
|
|
49780
|
-
placed.toEnd++;
|
|
49781
|
-
}
|
|
49782
|
-
const last = result2.at(-1);
|
|
49783
|
-
if (last && placed.fromStart <= last.fromEnd) {
|
|
49784
|
-
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
49785
|
-
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
49786
|
-
} else result2.push(placed);
|
|
49787
|
-
}
|
|
49788
|
-
return result2;
|
|
49789
|
-
}
|
|
49790
|
-
|
|
49791
49791
|
// xlsx/write/comment-mentions.ts
|
|
49792
49792
|
function patchCommentMentions(node2, before, message, ids, commentId, preserveIds) {
|
|
49793
49793
|
const container = first(node2, "mentions", NS.tc);
|