@allyhub/sdk 0.4.0 → 0.5.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/{node_modules → dist/node_modules}/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +3 -0
- package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/chart}/dist/chart.d.ts +26 -15
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/chart/dist/index.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/chart/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/chart/package.json +14 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/reference.d.ts +0 -86
- package/dist/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +4908 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/slides.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +2146 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/editor.d.ts +10 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/editor.js +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/notes.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/tools.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/lock.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/runtimes.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +4 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.d.ts +7 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/phone.d.ts +3 -1
- package/dist/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/address.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/address.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.d.ts +204 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/code.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/code.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.d.ts +170 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.d.ts +117 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +323 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/arrange.d.ts +68 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/arrange.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +152 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +69 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.d.ts +29 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +50 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/check.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/csv.d.ts +62 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/csv.js +12 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +64 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/edit.d.ts +154 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/edit.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +11 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/file.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/files.d.ts +24 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/files.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/fill.d.ts +30 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/fill.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/filter.d.ts +29 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/filter.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +9 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.d.ts +113 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.d.ts +65 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/generated.d.ts +46 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/generated.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +34 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +20 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/import.d.ts +11 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/import.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.d.ts +25 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/patch.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/patch.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/profile.d.ts +30 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/profile.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/rules.d.ts +56 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/scenario.d.ts +42 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/scenario.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/series.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/series.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/sort.d.ts +24 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/sort.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/validate.d.ts +26 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/validate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.d.ts +67 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +315 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/write.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/write.js +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +42 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +17 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +44 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.d.ts +8 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +117 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.js +3 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +21 -0
- package/dist/node_modules/@allyhub-next/slides-core/LICENSE +241 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-api.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-file.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.d.ts +2 -5
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/resolve.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/video-core/LICENSE +241 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/fact.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/formats.d.ts +0 -28
- package/dist/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/measure.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/problem.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/package.json +1 -1
- package/dist/phone.js +1 -1
- package/dist/sheets.d.ts +2 -0
- package/dist/sheets.js +2 -0
- package/docs/README.md +2 -2
- package/docs/defaults.md +1 -0
- package/docs/project.md +1 -1
- package/docs/scenery.md +1 -1
- package/docs/sheets.md +377 -84
- package/docs/slides.md +1 -1
- package/docs/speech.md +1 -1
- package/package.json +11 -19
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +0 -214
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/data/slides.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/index.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/items.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +0 -719
- package/node_modules/@allyhub-next/formats/dist/schemas.js +0 -2
- package/node_modules/@allyhub-next/protocol/dist/notes.js +0 -2
- package/node_modules/@allyhub-next/protocol/dist/tools.js +0 -2
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +0 -2
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +0 -3
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package-lock.json +0 -2533
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package.json +0 -8
- package/node_modules/@allyhub-next/scenery/dist/phone.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart-api.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart-file.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/index.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +0 -23
- package/node_modules/@allyhub-next/slides-core/dist/strict.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/fact.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/formats.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/measure.js +0 -5
- package/node_modules/@allyhub-next/video-core/dist/problem.js +0 -2
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.js +0 -0
- /package/{node_modules/@allyhub-next/formats → dist/node_modules/@allyhub-next/chart}/LICENSE +0 -0
- /package/{node_modules/@allyhub-next/protocol → dist/node_modules/@allyhub-next/formats}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.js +0 -0
- /package/{node_modules/@allyhub-next/runtimes → dist/node_modules/@allyhub-next/protocol}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.js +0 -0
- /package/{node_modules/@allyhub-next/scenery → dist/node_modules/@allyhub-next/runtimes}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/manifest.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/schemas/runtimes.schema.json +0 -0
- /package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/scenery}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/NOTICE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.js +0 -0
- /package/{node_modules/@allyhub-next/video-core → dist/node_modules/@allyhub-next/sheet}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/api.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/api.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/capabilities.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/capabilities.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/enums.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/enums.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/office.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/office.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/resolve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{MAX_COLUMNS as q,MAX_ROWS as D,cellName as S,columnIndex as R,columnLetter as _,rangeName as x,readAddress as y,readArea as A,readAreas as G}from"./address.js";import{chartAfter as H}from"./chart.js";import{moveFormula as J,relativeKey as Q}from"./formula/move.js";import{parseFormula as z}from"./formula/parse.js";import{printFormula as N}from"./formula/print.js";import{rewriteFormula as B}from"./formula/rewrite.js";import{walk as V}from"./formula/walk.js";import{readTyped as Y}from"./values.js";import{chartFormula as Z}from"./workbook.js";const E=r=>r.op==="insert-rows"||r.op==="delete-rows"||r.op==="insert-columns"||r.op==="delete-columns",k=r=>r.op==="insert-rows"||r.op==="insert-columns",b=r=>r.op==="insert-rows"||r.op==="delete-rows";function v(r,t){return k(t)?r>=t.at?r+t.count:r:r<t.at?r:r>=t.at+t.count?r-t.count:void 0}const tt=r=>b(r)?D:q;function $(r,t,n){const s=tt(n);if(k(n)){const e=r>=n.at?r+n.count:r,c=t>=n.at?t+n.count:t;return e>=s?void 0:[e,Math.min(c,s-1)]}const i=n.at+n.count-1;if(r>=n.at&&t<=i)return;const a=r<n.at?r:r>i?r-n.count:n.at,o=t<n.at?t:t>i?t-n.count:n.at-1;return[a,o]}function L(r,t){const n=b(t)?$(r.top,r.bottom,t):$(r.left,r.right,t);if(n)return b(t)?{...r,top:n[0],bottom:n[1]}:{...r,left:n[0],right:n[1]}}function nt(r,t,n,s){let i=0;const a=(o,e)=>{o&&!o.abs&&(i=Math.max(i,Math.abs(o.index-e)))};return V(r,o=>{o.kind==="ref"&&(t?(a(o.row,n),a(o.row2,n)):(a(o.col,s),a(o.col2,s)))}),i}function et(r,t,n,s){const i=new Set,a=l=>{for(let f=l-s-1;f<=l+s+1;f++)f>=r&&f<=t&&i.add(f)};a(n.at),a(n.at+n.count);const o=[...i].sort((l,f)=>l-f),e=[];let c=r;for(const l of o)l>c&&e.push([c,l-1]),e.push([l,l]),c=l+1;return c<=t&&e.push([c,t]),e}function ot(r,t,n,s,i){const a=z(t);if(!a.ok){const m=i?L(r,s):r;return m?[{area:m,text:t}]:[]}const o=b(s),[e,c]=o?[r.top,r.bottom]:[r.left,r.right],l=nt(a.node,o,r.top,r.left),f=[];let u=!0;for(const[m,d]of et(e,c,s,l)){const w=o?m:r.top,p=o?r.left:m,h=i?v(m,s):m;if(h===void 0)continue;const g=i?v(d,s):d;if(g===void 0)continue;const C=J(a.node,w-r.top,p-r.left),j=B(C,s,n);j!==C&&(u=!1);const U=o?h:r.top,X=o?r.left:h,F=Q(j,U,X),I=f[f.length-1];I?.key===F&&I.to+1===h?I.to=g:f.push({from:h,to:g,key:F,text:N(j)})}return f.map(m=>({area:o?{...r,top:m.from,bottom:m.to}:{...r,left:m.from,right:m.to},text:u&&f.length===1?t:m.text}))}function W(r,t){return r!==null&&typeof r=="object"?{...r,formula:t}:t}const st=r=>{if(typeof r=="string")return r.startsWith("=")?r:void 0;if(!(r===null||typeof r!="object"))return r.formula!==void 0?r.formula.startsWith("=")?r.formula:`=${r.formula}`:typeof r.value=="string"&&r.value.startsWith("=")?r.value:void 0};function O(r,t,n,s){const i=z(r);if(!i.ok)return r;const a=B(i.node,t,n,s);return a===i.node?r:N(a)}function rt(r,t,n,s){const i={},a=E(n)?n:void 0;for(const[o,e]of Object.entries(r)){const c=st(e),l=A(o);if(!l){i[o]=e;continue}const f=s&&a!==void 0;if(o.includes(":")){if(!a){i[o]=c===void 0?e:W(e,O(c,n,t));continue}if(c!==void 0){for(const h of ot(l,c,t,a,f))i[x(h.area)]=W(e,h.text);continue}if(!f){i[o]=e;continue}if(!k(a)){const h=L(l,a);h&&(i[x(h)]=e);continue}const d=b(a),[w,p]=d?[l.top,l.bottom]:[l.left,l.right];for(const[h,g]of[[w,Math.min(p,a.at-1)],[Math.max(w,a.at),p]]){if(h>g)continue;const C=h>=a.at?a.count:0,j=d?{...l,top:h+C,bottom:g+C}:{...l,left:h+C,right:g+C};i[x(j)]=e}continue}const u={row:l.top,col:l.left};let m=u;if(f){const d=v(b(a)?u.row:u.col,a);m=d===void 0?void 0:b(a)?{...u,row:d}:{...u,col:d}}m&&(i[S(m)]=c===void 0?e:W(e,O(c,n,t)))}return i}export function tableShape(r,t){const n=y(r.at);if(!n)return;const s=t[0]??[],i=s.map(e=>e.trim()),a=new Set(i.map(e=>e.toLowerCase()));for(const e of Object.keys(r.columns??{}))a.has(e.toLowerCase())||i.push(e);const o=[];return t.forEach((e,c)=>{c>0&&e.length>0&&o.push(c)}),{at:n,header:s,names:i,places:o}}const P=r=>r.reduce((t,n)=>Math.max(t,n.length),0);function K(r,t,n){const s=Math.max(P(r),1),i=Array.from({length:n},()=>new Array(s).fill(""));return[...r.slice(0,t),...i,...r.slice(t)]}export function freeColumn(r,t="Column"){const n=new Set(r.map(s=>s.toLowerCase()));for(let s=1;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function uniqueColumn(r,t){const n=new Set(r.map(s=>s.toLowerCase()));if(!n.has(t.toLowerCase()))return t;for(let s=2;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function withColumnsUpTo(r,t,n){const s=r.map(o=>[...o]),i=s[0]??[];for(s.length===0&&s.push(i);i.length<=n;)i.push(t[i.length]??"");const a=i.length;for(let o=1;o<s.length;o++){const e=s[o];if(e&&e.length>0)for(;e.length<a;)e.push("")}return s}class T{file;rows;edit;after=[];refused;constructor(t,n){this.file=structuredClone(t.file),this.rows=new Map(t.rows),this.edit=n}sheets(){return this.file.sheets}rewrite(t){const n=this.file.sheets[0]?.name??"";if(this.file.names)for(const[s,i]of Object.entries(this.file.names))typeof i=="string"&&i.startsWith("=")&&(this.file.names[s]=O(i,t,n));for(const s of this.file.checks??[])s.formula=O(s.formula,t,n);for(const s of this.sheets())this.rewriteSheet(s,t)}rewriteSheet(t,n){const s=E(n)&&M(t.name,n.sheet);t.cells&&(t.cells=rt(t.cells,t.name,n,s));for(const i of t.tables??[]){for(const a of Object.values(i.columns??{}))a.formula!==void 0&&(a.formula=O(a.formula,n,t.name,i.name));this.rewriteCsv(i.rows,n,t.name,i.name)}for(const i of t.blocks??[])this.rewriteCsv(i.rows,n,t.name);this.rewriteRules(t,n)}freePath(t,n){const s=t.slice(0,t.lastIndexOf("/")+1),i=o=>[...this.rows.keys()].some(e=>M(e,o));let a=`${s}${n}.csv`;for(let o=2;i(a);o++)a=`${s}${n}-${String(o)}.csv`;return a}duplicate(t,n){const s=this.sheets(),i=s.findIndex(f=>M(f.name,t)),a=s[i];if(!a){this.refused="no-sheet";return}const o=structuredClone(a);o.name=n,delete o.hidden;for(const f of Object.values(o.cells??{}))f!==null&&typeof f=="object"&&delete f.name;const e=new Set(s.flatMap(f=>f.tables??[]).map(f=>f.name.toLowerCase())),c=new Set(Object.keys(this.file.names??{}).map(f=>f.toLowerCase())),l=[];for(const f of o.tables??[]){let u=f.name;for(let d=2;;d++){u=`${f.name}${String(d)}`;const w=u.toLowerCase();if(!e.has(w)&&!c.has(w))break}e.add(u.toLowerCase());const m=this.freePath(f.rows,u);this.rows.set(m,this.rows.get(f.rows)??[]),l.push({op:"rename-table",from:f.name,to:u}),f.rows=m,f.name=u}for(const f of o.blocks??[]){const u=f.rows.slice(f.rows.lastIndexOf("/")+1,-4),m=this.freePath(f.rows,u);this.rows.set(m,this.rows.get(f.rows)??[]),f.rows=m}this.file.sheets=[...s.slice(0,i+1),o,...s.slice(i+1)],this.rewriteSheet(o,{op:"rename-sheet",from:t,to:n});for(const f of l)this.rewriteSheet(o,f)}rewriteRules(t,n){const s=e=>typeof e=="string"&&e.startsWith("=")?O(e,n,t.name):e,i=e=>e.value===void 0?e:{...e,value:s(e.value)},a=t.conditional?.map(e=>{switch(e.type){case"cellIs":return{...e,formula:e.formula.map(s)};case"expression":return{...e,formula:O(e.formula.startsWith("=")?e.formula:`=${e.formula}`,n,t.name)};case"dataBar":return{...e,...e.min?{min:i(e.min)}:{},...e.max?{max:i(e.max)}:{}};case"colorScale":return{...e,stops:e.stops.map(i)};case"iconSet":return e.stops?{...e,stops:e.stops.map(i)}:e;default:return e}});a&&(t.conditional=a);const o=t.validations?.map(e=>e.formula?{...e,formula:e.formula.map(s)}:e);o&&(t.validations=o),t.charts&&(t.charts=t.charts.map(e=>H(e,c=>{const l=c.startsWith("="),f=O(Z(c),n,t.name);return l?f:f.slice(1)})))}rewriteCsv(t,n,s,i){const a=this.rows.get(t);if(!a)return;let o;a.forEach((e,c)=>{if(!e.some(f=>f.charCodeAt(0)===61))return;const l=e.map(f=>Y(f).formula===void 0?f:O(f,n,s,i));l.every((f,u)=>f===e[u])||(o??=[...a],o[c]=l)}),o&&this.rows.set(t,o)}tableOn(t,n){const s=b(n),i=[];for(const a of t.tables??[]){const o=this.rows.get(a.rows),e=o&&tableShape(a,o);if(!o||!e){i.push(a);continue}const c=e.at.row,l=e.at.col,f=c+e.places.length,u=l+Math.max(e.names.length,1)-1,[m,d]=s?[c,f]:[l,u];if(!k(n)&&n.at<=m&&n.at+n.count-1>=d){this.after.push({op:"delete-table",name:a.name});continue}const w={...e.at};if(s)if(k(n)){if(n.at<=c)w.row+=n.count;else if(n.at<=f){const p=e.places[n.at-c-1]??o.length;this.rows.set(a.rows,K(o,p,n.count))}}else{const p=n.at+n.count-1;if(p<c)w.row-=n.count;else if(n.at<=c){this.refused="table-header";return}else if(n.at<=f){const h=new Set(e.places.slice(n.at-c-1,p-c));this.rows.set(a.rows,o.filter((g,C)=>!h.has(C)))}}else if(k(n))n.at<=l?w.col+=n.count:n.at<=u&&this.columnsIn(a,e,n.at-l,n.count);else{const p=n.at+n.count-1;if(p<l)w.col-=n.count;else if(n.at<=u){w.col=Math.min(l,n.at);const h=Math.max(0,n.at-l),g=Math.min(e.names.length-1,p-l);this.columnsOut(a,e,h,g)}}a.at=S(w),i.push(a)}t.tables=i,i.length===0&&delete t.tables}columnsIn(t,n,s,i){const a=this.rows.get(t.rows)??[],o=s>0?withColumnsUpTo(a,n.names,s-1):a.map(c=>[...c]),e=[...n.names];o.forEach((c,l)=>{if(l>0&&c.length===0)return;const f=[];for(let u=0;u<i;u++)if(l===0){const m=freeColumn(e);e.push(m),f.push(m)}else f.push("");for(;c.length<s;)c.push("");c.splice(s,0,...f)}),this.rows.set(t.rows,o)}columnsOut(t,n,s,i){const a=n.names.slice(s,i+1),o=this.rows.get(t.rows)??[],e=n.header.length,c=new Set;for(let l=s;l<=i&&l<e;l++)c.add(l);if(c.size>0&&this.rows.set(t.rows,o.map(l=>l.length===0?l:l.filter((f,u)=>!c.has(u)))),t.columns){const l=new Set(a.map(f=>f.toLowerCase()));t.columns=Object.fromEntries(Object.entries(t.columns).filter(([f])=>!l.has(f.toLowerCase()))),Object.keys(t.columns).length===0&&delete t.columns}if(t.key!==void 0&&a.some(l=>l.toLowerCase()===t.key?.toLowerCase())&&delete t.key,t.filter){const l=new Set(a.map(u=>u.toLowerCase())),f=Object.fromEntries(Object.entries(t.filter.columns).filter(([u])=>!l.has(u.toLowerCase())));Object.keys(f).length>0?t.filter={columns:f}:delete t.filter}for(const l of a)this.after.push({op:"delete-column",table:t.name,name:l})}blocksOn(t,n){const s=b(n),i=(t.blocks??[]).flatMap(a=>{const o=y(a.at),e=this.rows.get(a.rows);if(!o||!e)return[a];const c=s?o.row:o.col,l=s?e.length:Math.max(P(e),1),f=c+l-1,u=$(c,f,n);if(!u)return[];const m=s?{...o,row:u[0]}:{...o,col:u[0]};if(k(n)&&n.at>c&&n.at<=f){const d=n.at-c;this.rows.set(a.rows,s?K(e,d,n.count):e.map(w=>{if(w.length===0)return w;const p=[...w];for(;p.length<d;)p.push("");return p.splice(d,0,...new Array(n.count).fill("")),p}))}else if(!k(n)&&n.at<=f){const d=Math.max(n.at,c)-c,w=Math.min(n.at+n.count-1,f)-c;this.rows.set(a.rows,s?e.filter((p,h)=>h<d||h>w):e.map(p=>p.filter((h,g)=>g<d||g>w)))}return[{...a,at:S(m)}]});t.blocks=i,i.length===0&&delete t.blocks}looksOn(t,n){const s=b(n);t.format&&(t.format=t.format.flatMap(o=>{const e=A(o.range);if(!e)return[o];const c=L(e,n);return c?[{...o,range:x(c)}]:[]})),t.format?.length===0&&delete t.format,t.merges&&(t.merges=t.merges.flatMap(o=>{const e=A(o);if(!e)return[o];const c=L(e,n);return c?[x(c)]:[]})),t.merges?.length===0&&delete t.merges;const i=o=>{const e=G(o);if(!e)return o;const c=e.flatMap(l=>{const f=L(l,n);return f?[x(f)]:[]});return c.length===0?void 0:c.join(" ")};if(t.conditional&&(t.conditional=t.conditional.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.conditional?.length===0&&delete t.conditional,t.validations&&(t.validations=t.validations.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.validations?.length===0&&delete t.validations,t.charts&&(t.charts=t.charts.map(o=>{const e=y(o.at);if(!e)return o;const c=s?e.row:e.col,l=v(c,n)??n.at;return{...o,at:S(s?{...e,row:l}:{...e,col:l})}})),t.filter){const o=A(t.filter.range),e=o&&L(o,n);if(o&&!e)delete t.filter;else if(e){const c=s?t.filter.columns:Object.fromEntries(Object.entries(t.filter.columns??{}).flatMap(([l,f])=>{const u=R(l),m=u===void 0?void 0:v(u,n);return m===void 0?[]:[[_(m),f]]}));t.filter={range:x(e),...c&&Object.keys(c).length>0?{columns:c}:{}}}}if(t.freeze!==void 0){const o=y(t.freeze);if(o){const e=s?o.row:o.col,c=$(0,e-1,n),l=e===0?0:c?c[1]+1:0;t.freeze=S(s?{...o,row:l}:{...o,col:l})}}const a=(o,e,c)=>{if(!o)return;const l={};for(const[f,u]of Object.entries(o)){const m=e(f),d=m===void 0?void 0:v(m,n);m===void 0?l[f]=u:d!==void 0&&(l[c(d)]=u)}return l};if(s){const o=a(t.rows,e=>/^[1-9]\d*$/u.test(e)?Number(e)-1:void 0,e=>String(e+1));o&&(t.rows=o)}else{const o=a(t.columns,R,_);o&&(t.columns=o)}}run(){const t=this.edit;if(E(t)){const n=this.sheets().find(s=>M(s.name,t.sheet));if(!n){this.refused="no-sheet";return}if(this.rewrite(t),this.tableOn(n,t),this.refused)return;this.blocksOn(n,t),this.looksOn(n,t);for(const s of this.after)this.rewrite(s);return}switch(t.op){case"rename-sheet":{this.rewrite(t);const n=this.sheets().find(s=>M(s.name,t.from));n&&(n.name=t.to);return}case"rename-column":{this.renameColumn(t.table,t.from,t.to),this.rewrite(t);return}case"delete-sheet":{const n=this.sheets(),s=n.find(i=>M(i.name,t.name));if(!s){this.refused="no-sheet";return}if(n.filter(i=>i.hidden!==!0).length<=1){this.refused="last-sheet";return}this.rewrite(t);for(const i of s.tables??[])this.rewrite({op:"delete-table",name:i.name});this.file.sheets=n.filter(i=>i!==s);return}default:this.rewrite(t)}}renameColumn(t,n,s){const i=this.sheets().flatMap(c=>c.tables??[]).find(c=>M(c.name,t));if(!i)return;const a=n.toLowerCase(),o=this.rows.get(i.rows),e=o?.[0]?.findIndex(c=>c.trim().toLowerCase()===a)??-1;if(o&&e>=0){const c=[...o[0]??[]];c[e]=s,this.rows.set(i.rows,[c,...o.slice(1)])}if(i.columns){const c=Object.keys(i.columns).find(l=>l.toLowerCase()===a);c!==void 0&&(i.columns=Object.fromEntries(Object.entries(i.columns).map(([l,f])=>[l===c?s:l,f])))}i.key?.toLowerCase()===a&&(i.key=s),i.filter&&(i.filter={columns:Object.fromEntries(Object.entries(i.filter.columns).map(([c,l])=>[c.toLowerCase()===a?s:c,l]))})}}const M=(r,t)=>r.toLowerCase()===t.toLowerCase();export function restructure(r,t){const n=new T(r,t);return n.run(),n.refused?{file:r.file,rows:new Map(r.rows),refused:n.refused}:{file:n.file,rows:n.rows}}export function duplicated(r,t,n){const s=new T(r,{op:"rename-sheet",from:t,to:n});return s.duplicate(t,n),s.refused?{file:r.file,rows:new Map(r.rows),refused:s.refused}:{file:s.file,rows:s.rows}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SheetValidation } from "@allyhub-next/formats";
|
|
2
|
+
import type { Calc } from "./calc/engine.js";
|
|
3
|
+
import { type Scalar } from "./values.js";
|
|
4
|
+
import { type Validation, type Workbook, type Worksheet } from "./workbook.js";
|
|
5
|
+
/** What joins the choices of a cell under a rule. */
|
|
6
|
+
export declare const separatorOf: (spec: SheetValidation) => string;
|
|
7
|
+
/** The choices a cell's text holds, under a list that allows several. */
|
|
8
|
+
export declare function choicesIn(text: string, spec: SheetValidation): string[];
|
|
9
|
+
/** A cell's text for its choices. */
|
|
10
|
+
export declare const joinChoices: (choices: readonly string[], spec: SheetValidation) => string;
|
|
11
|
+
/** A rule's list: what it spells out, or what its range holds. */
|
|
12
|
+
export declare function listValues(calc: Calc, sheet: Worksheet, rule: Validation, row: number, col: number): string[];
|
|
13
|
+
/** Whether a value passes a rule, at the place it would stand. */
|
|
14
|
+
export declare function valid(calc: Calc, sheet: Worksheet, rule: Validation, row: number, col: number, value: Scalar): boolean;
|
|
15
|
+
export interface InvalidCell {
|
|
16
|
+
sheet: string;
|
|
17
|
+
row: number;
|
|
18
|
+
col: number;
|
|
19
|
+
value: Scalar;
|
|
20
|
+
/** The range of the rule it breaks. */
|
|
21
|
+
range: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}
|
|
24
|
+
/** Every cell that breaks its sheet's data validation: facts, never problems. */
|
|
25
|
+
export declare function invalidCells(wb: Workbook, calc: Calc): InvalidCell[];
|
|
26
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{SHEET_SEPARATOR as y}from"@allyhub-next/formats";import{toBool as g}from"./calc/coerce.js";import{holds as l}from"./rules.js";import{shownValue as d}from"./format.js";import{CellError as x,Matrix as b,readTyped as C}from"./values.js";import{FormulaCell as A}from"./workbook.js";export const separatorOf=e=>e.separator??y;export function choicesIn(e,o){const i=separatorOf(o);return e.split(i.trim()===""?i:i.trim()).map(n=>n.trim()).filter(n=>n!=="")}export const joinChoices=(e,o)=>e.join(separatorOf(o));export function listValues(e,o,i,n,r){const{spec:t}=i;if(t.values)return t.values;const[s]=t.formula??[],[f]=i.formulas;if(!f)return typeof s=="string"?s.split(","):[];const u=e.evaluateAt(f,o,n,r),a=m=>d(m,void 0);return u instanceof b?u.data.map(a).filter(m=>m!==""):u===null?[]:[a(u)]}function E(e,o,i,n,r,t){const s=i.spec.formula?.[n];if(s===void 0)return null;const f=i.formulas[n];if(f){const a=e.evaluateAt(f,o,r,t);return a instanceof b?a.at(0,0):a}if(typeof s=="number")return s;const u=C(s);return u.formula===void 0?u.value:null}function H(e,o,i,n,r,t){const[s]=i.formulas;if(!s)return!0;const f=o.at(n,r),a=e.value(o,n,r)!==t&&!(f instanceof A);a&&e.change([{sheet:o,row:n,col:r,slot:t??void 0}]);const m=e.evaluateAt(s,o,n,r);a&&e.change([{sheet:o,row:n,col:r,slot:f}]);const c=m instanceof b?m.at(0,0):m;return g(c)===!0}export function valid(e,o,i,n,r,t){const{spec:s}=i;if(t===null||t==="")return s.blank!==!1;if(t instanceof x)return!1;const f=s.operator??"between",u=a=>E(e,o,i,a,n,r);switch(s.type){case"list":{const a=d(t,void 0),m=listValues(e,o,i,n,r).map(p=>p.trim()),c=p=>s.values?m.includes(p.trim()):m.some(h=>h.toLowerCase()===p.trim().toLowerCase());return s.multiple===!0?choicesIn(a,s).every(c):c(a)}case"custom":return H(e,o,i,n,r,t);case"textLength":return l(f,(typeof t=="string"?t:d(t)).length,u(0),u(1));case"whole":return typeof t=="number"&&Number.isInteger(t)&&l(f,t,u(0),u(1));case"time":return typeof t=="number"&&t>=0&&t<1&&l(f,t,u(0),u(1));default:return typeof t=="number"&&l(f,t,u(0),u(1))}}function L(e,o,i){const n=Math.min(o.right,e.columnsUsed-1);for(let r=o.left;r<=n;r++){const[t,s]=e.span(r,o.top,o.bottom);for(let f=t;f<=s;f++)e.at(f,r)!==void 0&&i(f,r)}}export function invalidCells(e,o){const i=[];for(const n of e.sheets)for(const r of n.validations)for(const t of r.areas)L(n,t,(s,f)=>{const u=o.value(n,s,f);valid(o,n,r,s,f,u)||i.push({sheet:n.name,row:s,col:f,value:u,range:r.spec.range,type:r.spec.type})});return i}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type ErrorCode = "#NULL!" | "#DIV/0!" | "#VALUE!" | "#REF!" | "#NAME?" | "#NUM!" | "#N/A" | "#GETTING_DATA" | "#SPILL!" | "#CALC!" | "#CYCLE!";
|
|
2
|
+
/** An error value; one object per code, so two are the same with ===. */
|
|
3
|
+
export declare class CellError {
|
|
4
|
+
private static readonly all;
|
|
5
|
+
readonly code: ErrorCode;
|
|
6
|
+
private constructor();
|
|
7
|
+
static of(code: ErrorCode): CellError;
|
|
8
|
+
toString(): string;
|
|
9
|
+
toJSON(): string;
|
|
10
|
+
}
|
|
11
|
+
export declare const ERR: {
|
|
12
|
+
readonly NULL: CellError;
|
|
13
|
+
readonly DIV0: CellError;
|
|
14
|
+
readonly VALUE: CellError;
|
|
15
|
+
readonly REF: CellError;
|
|
16
|
+
readonly NAME: CellError;
|
|
17
|
+
readonly NUM: CellError;
|
|
18
|
+
readonly NA: CellError;
|
|
19
|
+
readonly SPILL: CellError;
|
|
20
|
+
readonly CALC: CellError;
|
|
21
|
+
/** A formula that reads itself: Excel says so in a dialog, a sheet in its value. */
|
|
22
|
+
readonly CYCLE: CellError;
|
|
23
|
+
};
|
|
24
|
+
/** The error text names, whatever its case; undefined when it names none. */
|
|
25
|
+
export declare function errorOf(text: string): CellError | undefined;
|
|
26
|
+
/** What a cell holds; null is an empty cell. */
|
|
27
|
+
export type Scalar = number | string | boolean | null | CellError;
|
|
28
|
+
/** Values in rows, as an array formula gives them. */
|
|
29
|
+
export declare class Matrix {
|
|
30
|
+
readonly rows: number;
|
|
31
|
+
readonly cols: number;
|
|
32
|
+
readonly data: readonly Scalar[];
|
|
33
|
+
constructor(rows: number, cols: number, data: readonly Scalar[]);
|
|
34
|
+
at(row: number, col: number): Scalar;
|
|
35
|
+
}
|
|
36
|
+
/** The serial of a year, month and day; months and days past their end carry over, as DATE's do. */
|
|
37
|
+
export declare function serialOf(year: number, month: number, day: number): number;
|
|
38
|
+
/** A serial's year, month (from 1) and day; serial 60 is the 29 February 1900 Excel has. */
|
|
39
|
+
export declare function dateOf(serial: number): {
|
|
40
|
+
year: number;
|
|
41
|
+
month: number;
|
|
42
|
+
day: number;
|
|
43
|
+
};
|
|
44
|
+
/** A moment as a serial. */
|
|
45
|
+
export declare function serialOfDate(at: Date): number;
|
|
46
|
+
/** A serial as a moment; undefined for the day that never was. */
|
|
47
|
+
export declare function dateOfSerial(serial: number): Date | undefined;
|
|
48
|
+
/** A serial as ISO 8601: its time only when it has one. */
|
|
49
|
+
export declare function isoOfSerial(serial: number): string;
|
|
50
|
+
/** A value as text reads it: at most 15 significant digits, as Excel's are. */
|
|
51
|
+
export declare function numberText(n: number): string;
|
|
52
|
+
/** How a value typed reads: the value, and the format Excel gives it when it has none. */
|
|
53
|
+
export interface Typed {
|
|
54
|
+
value: Scalar;
|
|
55
|
+
/** The formula's text, the = included, when it is one. */
|
|
56
|
+
formula?: string;
|
|
57
|
+
format?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Text as Excel reads what is typed: a number (a percent, grouped thousands
|
|
61
|
+
* and a dollar sign included), TRUE or FALSE, an ISO date, an error, text.
|
|
62
|
+
* `=` starts a formula, and `'` keeps what follows as text.
|
|
63
|
+
*/
|
|
64
|
+
export declare function readTyped(text: string): Typed;
|
|
65
|
+
/** A value as a CSV cell or a YAML cell writes it: it reads back as itself. */
|
|
66
|
+
export declare function writeTyped(value: Scalar): string;
|
|
67
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export class CellError{static all=new Map;code;constructor(t){this.code=t}static of(t){let n=CellError.all.get(t);return n||(n=new CellError(t),CellError.all.set(t,n)),n}toString(){return this.code}toJSON(){return this.code}}export const ERR={NULL:CellError.of("#NULL!"),DIV0:CellError.of("#DIV/0!"),VALUE:CellError.of("#VALUE!"),REF:CellError.of("#REF!"),NAME:CellError.of("#NAME?"),NUM:CellError.of("#NUM!"),NA:CellError.of("#N/A"),SPILL:CellError.of("#SPILL!"),CALC:CellError.of("#CALC!"),CYCLE:CellError.of("#CYCLE!")};const L=["#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A","#GETTING_DATA","#SPILL!","#CALC!","#CYCLE!"];export function errorOf(e){const t=e.toUpperCase(),n=L.find(r=>r===t);return n===void 0?void 0:CellError.of(n)}export class Matrix{rows;cols;data;constructor(t,n,r){this.rows=t,this.cols=n,this.data=r}at(t,n){return this.data[t*this.cols+n]??null}}const i=864e5,p=25569;function y(e){const t=e+p;return t<61?t-1:t}function N(e){const t=Math.floor(e);if(t!==60)return(t<60?t+1:t)-p}export function serialOf(e,t,n){const r=new Date(Date.UTC(2e3,t-1,1));return r.setUTCFullYear(r.getUTCFullYear()-2e3+e),y(Math.floor(r.getTime()/i))+n-1}export function dateOf(e){const t=N(e);if(t===void 0)return{year:1900,month:2,day:29};if(Math.floor(e)===0)return{year:1900,month:1,day:0};const n=new Date(t*i);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()}}export function serialOfDate(e){const t=e.getTime(),n=Math.floor(t/i);return y(n)+(t-n*i)/i}export function dateOfSerial(e){const t=N(e);if(t===void 0)return;const n=e-Math.floor(e);return new Date(t*i+Math.round(n*i))}const a=(e,t=2)=>String(e).padStart(t,"0");export function isoOfSerial(e){const{year:t,month:n,day:r}=dateOf(e),s=`${a(t,4)}-${a(n)}-${a(r)}`,o=Math.round((e-Math.floor(e))*86400);if(o===0)return s;const u=o%60;return`${s}T${a(Math.floor(o/3600))}:${a(Math.floor(o/60)%60)}${u===0?"":`:${a(u)}`}`}export function numberText(e){if(e===0)return"0";const t=Number(e.toPrecision(15)),n=Math.floor(Math.log10(Math.abs(t)));if(n>=15||n<-10){const[s="",o="0"]=t.toExponential().split("e"),u=Number(o);return`${s}E${u<0?"-":"+"}${a(Math.abs(u))}`}const r=String(t);return r.includes("e")?t.toFixed(Math.min(20,Math.abs(n)+15)).replace(/0+$/u,""):r}const M=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u,$=/^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d+)?$/u,b=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,E=e=>/^[+-]?\d+$/u.test(e)&&e.replace(/^[+-]?0*/u,"").length>15;function U(e){const t=b.exec(e);if(!t)return;const[n,r,s]=[Number(t[1]),Number(t[2]),Number(t[3])],o=serialOf(n,r,s),u=dateOf(o);if(u.month!==r||u.day!==s)return;if(t[4]===void 0)return{value:o,format:"yyyy-mm-dd"};const[f,l,m]=[Number(t[4]),Number(t[5]),Number(t[6]??0)];if(f>23||l>59||m>59)return;const d=t[7];let h=0;if(d!==void 0&&d!=="Z"){const c=d.replace(":","");h=(c.startsWith("-")?1:-1)*(Number(c.slice(1,3))*60+Number(c.slice(3,5)))/1440}return{value:o+(f*3600+l*60+m)/86400+h,format:t[6]===void 0?"yyyy-mm-dd hh:mm":"yyyy-mm-dd hh:mm:ss"}}export function readTyped(e){if(e==="")return{value:null};if(e.startsWith("'"))return{value:e.slice(1)};if(e.length>1&&e.startsWith("="))return{value:null,formula:e};const t=e.trim();if(t==="")return{value:e};const n=t.toUpperCase();if(n==="TRUE")return{value:!0};if(n==="FALSE")return{value:!1};if(M.test(t))return E(t)?{value:e}:{value:Number(t)};if(t.endsWith("%")){const f=t.slice(0,-1).trim();if(M.test(f))return{value:Number(f)/100,format:f.includes(".")?"0.00%":"0%"}}if($.test(t))return{value:Number(t.replaceAll(",","")),format:t.includes(".")?"#,##0.00":"#,##0"};const r=/^([+-]?)\$(\d[\d,]*(?:\.\d+)?)$/u.exec(t),s=r?.[2]?.replaceAll(",","");if(r&&s!==void 0)return{value:+`${r[1]??""}${s}`,format:t.includes(".")?"$#,##0.00":"$#,##0"};const o=U(t);if(o)return o;const u=errorOf(t);return u?{value:u}:{value:e}}export function writeTyped(e){if(e===null)return"";if(typeof e=="number"){const n=String(e);return E(n)?e.toExponential():n}if(typeof e=="boolean")return e?"TRUE":"FALSE";if(e instanceof CellError)return e.code;const t=readTyped(e);return t.value===e&&t.formula===void 0?e:`'${e}`}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import type { SheetChart, SheetConditional, SheetFile, SheetFilesColumn, SheetFilterColumn, SheetFormatEntry, SheetTable, SheetTableColumn, SheetValidation, SheetWorksheet } from "@allyhub-next/formats";
|
|
2
|
+
import { rangeName, type Area, type Place } from "./address.js";
|
|
3
|
+
import { type SheetProblem, type YamlPath } from "./file.js";
|
|
4
|
+
import { type GeneratedSheets } from "./generated.js";
|
|
5
|
+
import type { Node, ParseError } from "./formula/ast.js";
|
|
6
|
+
import { CellError, type Matrix, type Scalar } from "./values.js";
|
|
7
|
+
/** Where a value is written. */
|
|
8
|
+
export interface Source {
|
|
9
|
+
/** sheet.yaml or a CSV file, from the sheet's folder. */
|
|
10
|
+
file: string;
|
|
11
|
+
/** In a CSV file. */
|
|
12
|
+
line?: number;
|
|
13
|
+
/** In sheet.yaml. */
|
|
14
|
+
path?: YamlPath;
|
|
15
|
+
}
|
|
16
|
+
/** One formula's text and tree, for every cell that holds it. */
|
|
17
|
+
export declare class SharedFormula {
|
|
18
|
+
readonly node: Node | undefined;
|
|
19
|
+
readonly error: ParseError | undefined;
|
|
20
|
+
/** What the engine learned of it: filled in once. */
|
|
21
|
+
analysis: unknown;
|
|
22
|
+
readonly text: string;
|
|
23
|
+
/** The cell it is written for. */
|
|
24
|
+
readonly row: number;
|
|
25
|
+
readonly col: number;
|
|
26
|
+
readonly source: Source;
|
|
27
|
+
constructor(text: string, row: number, col: number, source: Source);
|
|
28
|
+
}
|
|
29
|
+
/** The state of a formula cell's value: 0 fresh, 1 to compute, 2 being computed. */
|
|
30
|
+
export type CellState = 0 | 1 | 2;
|
|
31
|
+
export declare class FormulaCell {
|
|
32
|
+
value: Scalar;
|
|
33
|
+
/** Every value of an array result, the first of which is `value`. */
|
|
34
|
+
array: Matrix | undefined;
|
|
35
|
+
/** The cells its array result covers, itself first, when that is more than one. */
|
|
36
|
+
spill: Area | undefined;
|
|
37
|
+
/** The cells its array result would cover, when something stands in them: its value is #SPILL!. */
|
|
38
|
+
blocked: Area | undefined;
|
|
39
|
+
state: CellState;
|
|
40
|
+
/** The last pass that ordered it. */
|
|
41
|
+
mark: number;
|
|
42
|
+
readonly shared: SharedFormula;
|
|
43
|
+
readonly sheet: Worksheet;
|
|
44
|
+
readonly row: number;
|
|
45
|
+
readonly col: number;
|
|
46
|
+
constructor(shared: SharedFormula, sheet: Worksheet, row: number, col: number);
|
|
47
|
+
/** Its formula's tree as this cell reads it, moved from where it was written. */
|
|
48
|
+
get moved(): Node;
|
|
49
|
+
/** Its formula as this cell reads it, moved from where it was written. */
|
|
50
|
+
get text(): string;
|
|
51
|
+
}
|
|
52
|
+
export type Slot = number | string | boolean | CellError | FormulaCell;
|
|
53
|
+
export interface TableColumn {
|
|
54
|
+
name: string;
|
|
55
|
+
/** Its place in the table, from 0. */
|
|
56
|
+
index: number;
|
|
57
|
+
/** Its place in the CSV file; absent when the file has no such column. */
|
|
58
|
+
csv?: number;
|
|
59
|
+
/** A calculated column's formula. */
|
|
60
|
+
formula?: SharedFormula;
|
|
61
|
+
spec?: SheetTableColumn;
|
|
62
|
+
}
|
|
63
|
+
export declare class Table {
|
|
64
|
+
columns: TableColumn[];
|
|
65
|
+
/** The rows under its header. */
|
|
66
|
+
rows: number;
|
|
67
|
+
/** Each row's line in its CSV file. */
|
|
68
|
+
lines: number[];
|
|
69
|
+
/** Each row's record in its CSV file, the header being 0: blank lines are no rows. */
|
|
70
|
+
places: number[];
|
|
71
|
+
/** Each column's values as the CSV file writes them, by row. */
|
|
72
|
+
records: string[][];
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly sheet: Worksheet;
|
|
75
|
+
readonly at: Place;
|
|
76
|
+
readonly file: string;
|
|
77
|
+
readonly spec: SheetTable;
|
|
78
|
+
constructor(name: string, sheet: Worksheet, at: Place, file: string, spec: SheetTable);
|
|
79
|
+
/** Its header and rows. */
|
|
80
|
+
get area(): Area;
|
|
81
|
+
/** Its rows, without its header; bottom is above top when it has none. */
|
|
82
|
+
get data(): Area;
|
|
83
|
+
column(name: string): TableColumn | undefined;
|
|
84
|
+
}
|
|
85
|
+
export interface Block {
|
|
86
|
+
area: Area;
|
|
87
|
+
file: string;
|
|
88
|
+
lines: number[];
|
|
89
|
+
}
|
|
90
|
+
/** A conditional format as the sheet holds it: its cells, and its formulas parsed. */
|
|
91
|
+
export interface Condition {
|
|
92
|
+
spec: SheetConditional;
|
|
93
|
+
areas: Area[];
|
|
94
|
+
/** Its bounds or its rule, each written for the first cell. */
|
|
95
|
+
formulas: SharedFormula[];
|
|
96
|
+
}
|
|
97
|
+
/** A data validation as the sheet holds it. */
|
|
98
|
+
export interface Validation {
|
|
99
|
+
spec: SheetValidation;
|
|
100
|
+
areas: Area[];
|
|
101
|
+
/** Its bounds that are formulas, by their place in `spec.formula`. */
|
|
102
|
+
formulas: (SharedFormula | undefined)[];
|
|
103
|
+
}
|
|
104
|
+
/** A chart's series, with where it reads from parsed. */
|
|
105
|
+
export interface ChartSeriesRefs {
|
|
106
|
+
values: SharedFormula;
|
|
107
|
+
x?: SharedFormula;
|
|
108
|
+
/** When it is named by a cell. */
|
|
109
|
+
name?: SharedFormula;
|
|
110
|
+
}
|
|
111
|
+
/** A chart as the sheet holds it: its place, and each reference parsed. */
|
|
112
|
+
export interface Chart {
|
|
113
|
+
spec: SheetChart;
|
|
114
|
+
at: Place;
|
|
115
|
+
/** Its place in `charts`. */
|
|
116
|
+
index: number;
|
|
117
|
+
categories?: SharedFormula;
|
|
118
|
+
/** When its title is a cell's. */
|
|
119
|
+
title?: SharedFormula;
|
|
120
|
+
series: ChartSeriesRefs[];
|
|
121
|
+
}
|
|
122
|
+
/** A filter of a sheet, whichever holds it. */
|
|
123
|
+
export interface Filter {
|
|
124
|
+
/** Its header row and its rows. */
|
|
125
|
+
area: Area;
|
|
126
|
+
table?: Table;
|
|
127
|
+
/** What each column keeps, by its place on the sheet. */
|
|
128
|
+
columns: Map<number, SheetFilterColumn>;
|
|
129
|
+
}
|
|
130
|
+
/** A CSV file as rows, each its fields; a line with nothing on it is a row of none. */
|
|
131
|
+
export type CsvRows = readonly (readonly string[])[];
|
|
132
|
+
interface Fill {
|
|
133
|
+
area: Area;
|
|
134
|
+
/** Its formula, or its value. */
|
|
135
|
+
shared?: SharedFormula;
|
|
136
|
+
value?: Scalar;
|
|
137
|
+
format?: string;
|
|
138
|
+
}
|
|
139
|
+
export declare const placeKey: (row: number, col: number) => number;
|
|
140
|
+
export declare class Worksheet {
|
|
141
|
+
readonly tables: Table[];
|
|
142
|
+
readonly blocks: Block[];
|
|
143
|
+
readonly merges: Area[];
|
|
144
|
+
/** The formula cells of the sheet, once its cells are made. */
|
|
145
|
+
readonly formulas: Set<FormulaCell>;
|
|
146
|
+
/** The format a typed value implies, by place: a date, a percent. */
|
|
147
|
+
readonly implied: Map<number, string>;
|
|
148
|
+
/** Single cells written in sheet.yaml, by place, with their keys. */
|
|
149
|
+
readonly keys: Map<number, string>;
|
|
150
|
+
readonly fills: Fill[];
|
|
151
|
+
/** Cells a key keeps empty inside a fill. */
|
|
152
|
+
readonly blanks: Set<number>;
|
|
153
|
+
/** Its conditional formats, the first the strongest. */
|
|
154
|
+
readonly conditions: Condition[];
|
|
155
|
+
readonly validations: Validation[];
|
|
156
|
+
/** Its AutoFilter and its tables', those with their buttons. */
|
|
157
|
+
readonly filters: Filter[];
|
|
158
|
+
/** Its charts, the last on top. */
|
|
159
|
+
readonly charts: Chart[];
|
|
160
|
+
freeze: Place | undefined;
|
|
161
|
+
/** sheet.ts makes it: what is on it is not changed by hand. */
|
|
162
|
+
generated: boolean;
|
|
163
|
+
private readonly grid;
|
|
164
|
+
private expanded;
|
|
165
|
+
private lowest;
|
|
166
|
+
/** Cells an array result spills into, by place: the formula cell each is of. */
|
|
167
|
+
private readonly ghosts;
|
|
168
|
+
/** Formula cells that spill. */
|
|
169
|
+
private readonly spills;
|
|
170
|
+
/** Formula cells that would spill, and something stands in the way. */
|
|
171
|
+
private readonly stopped;
|
|
172
|
+
private reach;
|
|
173
|
+
private lookAreas;
|
|
174
|
+
readonly name: string;
|
|
175
|
+
readonly index: number;
|
|
176
|
+
spec: SheetWorksheet;
|
|
177
|
+
constructor(name: string, index: number, spec: SheetWorksheet);
|
|
178
|
+
/** What sheet.yaml says of it after an edit that moved nothing: a look, a cell's key. */
|
|
179
|
+
respec(spec: SheetWorksheet): void;
|
|
180
|
+
/** Sets a cell, as reading the files does. */
|
|
181
|
+
put(row: number, col: number, slot: Slot): void;
|
|
182
|
+
/** Changes a cell after the sheet is read. */
|
|
183
|
+
replace(row: number, col: number, slot: Slot | undefined): void;
|
|
184
|
+
/** Makes the cells its fills cover: an earlier fill never takes a cell a later one has. */
|
|
185
|
+
expand(): void;
|
|
186
|
+
at(row: number, col: number): Slot | undefined;
|
|
187
|
+
/** The formula cell a place's value spilled from; undefined at the formula cell itself. */
|
|
188
|
+
spillAt(row: number, col: number): FormulaCell | undefined;
|
|
189
|
+
/** Whether anything in an area stops a spill from `cell`: a cell of the file, another's spill aside. */
|
|
190
|
+
holds(area: Area, cell: FormulaCell): boolean;
|
|
191
|
+
/** The spills in an area. */
|
|
192
|
+
spillsIn(area: Area): FormulaCell[];
|
|
193
|
+
/** The formula cells whose spill something stands in, and that wanted cells of an area. */
|
|
194
|
+
blockedBy(area: Area): FormulaCell[];
|
|
195
|
+
/** Puts an array result on the sheet. */
|
|
196
|
+
placeSpill(cell: FormulaCell, area: Area): void;
|
|
197
|
+
/** Says a result could not be put on the sheet. */
|
|
198
|
+
blockSpill(cell: FormulaCell, area: Area): void;
|
|
199
|
+
/** Takes an array result off the sheet. How far spills reach is worked out again by `tighten`. */
|
|
200
|
+
clearSpill(cell: FormulaCell): void;
|
|
201
|
+
/** Forgets every spill, for a pass over the whole workbook. */
|
|
202
|
+
clearSpills(): void;
|
|
203
|
+
/** After a pass: how far spills reach is what they cover now. */
|
|
204
|
+
tighten(): void;
|
|
205
|
+
private spillReach;
|
|
206
|
+
/** Whether a column holds a formula. */
|
|
207
|
+
hasFormulas(col: number): boolean;
|
|
208
|
+
/** The rows of a column to read in an area: nothing below or above what it holds, or a spill reaches, is read. */
|
|
209
|
+
span(col: number, top: number, bottom: number): [number, number];
|
|
210
|
+
get columnsUsed(): number;
|
|
211
|
+
/** The last row anything is on. */
|
|
212
|
+
get lastRow(): number;
|
|
213
|
+
/** What holds anything, from A1; undefined when it holds nothing. */
|
|
214
|
+
get used(): Area | undefined;
|
|
215
|
+
tableAt(row: number, col: number): Table | undefined;
|
|
216
|
+
blockAt(row: number, col: number): Block | undefined;
|
|
217
|
+
/** What applies to areas: `format`'s entries and range keys with a look, read once. */
|
|
218
|
+
private looks;
|
|
219
|
+
/** The areas `format` and range keys give a look: cells of them have it, whatever they hold. */
|
|
220
|
+
styledAreas(): readonly {
|
|
221
|
+
area: Area;
|
|
222
|
+
entry: object;
|
|
223
|
+
}[];
|
|
224
|
+
/** The format and look that hold for a cell, from the file's less specific places to its own. */
|
|
225
|
+
lookAt(row: number, col: number): CellLook;
|
|
226
|
+
/** The merge a place is in. */
|
|
227
|
+
mergeAt(row: number, col: number): Area | undefined;
|
|
228
|
+
/** The data validation that holds for a place. */
|
|
229
|
+
validationAt(row: number, col: number): Validation | undefined;
|
|
230
|
+
/** The filter whose header a place is in. */
|
|
231
|
+
filterHeadAt(row: number, col: number): Filter | undefined;
|
|
232
|
+
/** The filter a place is in. */
|
|
233
|
+
filterAt(row: number, col: number): Filter | undefined;
|
|
234
|
+
/** A `files` column a place is in, under a table's header or a sheet's column: how it joins and draws them. */
|
|
235
|
+
filesAt(row: number, col: number): SheetFilesColumn | undefined;
|
|
236
|
+
}
|
|
237
|
+
/** What joins a `files` column's files in a cell. */
|
|
238
|
+
export declare const filesSeparator: (column: SheetFilesColumn) => string;
|
|
239
|
+
/** What a cell of a `files` column names: its text apart at the column's separator. */
|
|
240
|
+
export declare function filesIn(text: string, column: SheetFilesColumn): string[];
|
|
241
|
+
/** Every field of a cell's look, and its number format. */
|
|
242
|
+
export type CellLook = Omit<SheetFormatEntry, "range">;
|
|
243
|
+
/** A defined name: a constant, or a formula that may be a place. */
|
|
244
|
+
export interface DefinedName {
|
|
245
|
+
name: string;
|
|
246
|
+
value?: Scalar;
|
|
247
|
+
formula?: SharedFormula;
|
|
248
|
+
source: Source;
|
|
249
|
+
}
|
|
250
|
+
export interface Check {
|
|
251
|
+
name: string;
|
|
252
|
+
formula: SharedFormula;
|
|
253
|
+
source: Source;
|
|
254
|
+
}
|
|
255
|
+
export declare class Workbook {
|
|
256
|
+
title: string | undefined;
|
|
257
|
+
readonly sheets: Worksheet[];
|
|
258
|
+
readonly names: Map<string, DefinedName>;
|
|
259
|
+
readonly checks: Check[];
|
|
260
|
+
private readonly bySheet;
|
|
261
|
+
private readonly byTable;
|
|
262
|
+
file: SheetFile;
|
|
263
|
+
/** What sheet.ts makes: `file` holds it too. */
|
|
264
|
+
readonly generated: GeneratedSheets | undefined;
|
|
265
|
+
/** Sheets sheet.ts makes that sheet.yaml holds: sheet.yaml's stand. */
|
|
266
|
+
ordinary: readonly string[];
|
|
267
|
+
constructor(file: SheetFile, generated?: GeneratedSheets);
|
|
268
|
+
/** sheet.yaml after an edit that changed no sheet, table or fill: the looks and the keys. */
|
|
269
|
+
respec(file: SheetFile): void;
|
|
270
|
+
sheet(name: string): Worksheet | undefined;
|
|
271
|
+
table(name: string): Table | undefined;
|
|
272
|
+
name(name: string): DefinedName | undefined;
|
|
273
|
+
get tables(): Table[];
|
|
274
|
+
addSheet(sheet: Worksheet): void;
|
|
275
|
+
addTable(table: Table): void;
|
|
276
|
+
/** Where a cell's value is written. */
|
|
277
|
+
sourceOf(sheet: Worksheet, row: number, col: number): Source | undefined;
|
|
278
|
+
}
|
|
279
|
+
/** What a workbook's files are, as a reader of them needs them. */
|
|
280
|
+
export interface WorkbookFiles {
|
|
281
|
+
/** sheet.yaml's text. */
|
|
282
|
+
text: string;
|
|
283
|
+
/** A file's text, from the sheet's folder; undefined when it is not there. */
|
|
284
|
+
read: (path: string) => string | undefined;
|
|
285
|
+
/** What its sheet.ts makes. */
|
|
286
|
+
generated?: GeneratedSheets | undefined;
|
|
287
|
+
/** Whether a file is there, from the sheet's folder: what a `files` column names is looked for. */
|
|
288
|
+
exists?: ((path: string) => boolean) | undefined;
|
|
289
|
+
}
|
|
290
|
+
/** A workbook's files as values: what an editor holds, with nothing to read again. */
|
|
291
|
+
export interface WorkbookValues {
|
|
292
|
+
file: SheetFile;
|
|
293
|
+
/** A CSV file's rows, from the sheet's folder; undefined when it is not there. */
|
|
294
|
+
rows: (path: string) => CsvRows | undefined;
|
|
295
|
+
/** What its sheet.ts makes. */
|
|
296
|
+
generated?: GeneratedSheets | undefined;
|
|
297
|
+
}
|
|
298
|
+
export interface ReadWorkbook {
|
|
299
|
+
/** Undefined when sheet.yaml cannot be read as the format. */
|
|
300
|
+
workbook?: Workbook;
|
|
301
|
+
problems: SheetProblem[];
|
|
302
|
+
lineOf: (path: YamlPath) => number | undefined;
|
|
303
|
+
}
|
|
304
|
+
/** A fill's cells at most: more is a mistake, not a sheet. */
|
|
305
|
+
export declare const MAX_FILL_CELLS = 5000000;
|
|
306
|
+
/** Whether a text can be a defined name or a table's: not an address, nor TRUE. */
|
|
307
|
+
export declare function validName(name: string): boolean;
|
|
308
|
+
/** A chart's reference as a formula. */
|
|
309
|
+
export declare const chartFormula: (text: string) => string;
|
|
310
|
+
/** A workbook from its files, and what is wrong with them that reading can tell. */
|
|
311
|
+
export declare function readWorkbook(files: WorkbookFiles): ReadWorkbook;
|
|
312
|
+
/** A workbook from what an editor holds, with no file to read: its CSV rows as they stand. */
|
|
313
|
+
export declare function workbookOf(values: WorkbookValues): Workbook;
|
|
314
|
+
export { rangeName };
|
|
315
|
+
//# sourceMappingURL=workbook.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{SHEET_CODE as C,SHEET_SEPARATOR as P}from"@allyhub-next/formats";import{MAX_ROWS as B,cellName as H,columnIndex as j,columnLetter as z,contains as y,overlaps as v,rangeName as U,readAddress as x,readArea as $,readAreas as _}from"./address.js";import{readCsv as R}from"./csv.js";import{ENTRY as E,readSheetFile as D}from"./file.js";import{withGenerated as O}from"./generated.js";import{moveFormula as G}from"./formula/move.js";import{parseFormula as X}from"./formula/parse.js";import{printFormula as Y}from"./formula/print.js";import{readTyped as A}from"./values.js";export class SharedFormula{node;error;analysis;text;row;col;source;constructor(e,t,s,n){this.text=e,this.row=t,this.col=s,this.source=n;const i=X(e);i.ok?this.node=i.node:this.error=i.error}}export class FormulaCell{value=null;array;spill;blocked;state=1;mark=0;shared;sheet;row;col;constructor(e,t,s,n){this.shared=e,this.sheet=t,this.row=s,this.col=n}get moved(){const{node:e,row:t,col:s}=this.shared;if(!e)throw new Error(`${this.shared.text} does not parse.`);return G(e,this.row-t,this.col-s)}get text(){const{node:e,text:t,row:s,col:n}=this.shared;return!e||s===this.row&&n===this.col?t:Y(this.moved)}}class Z{columns=[];firsts=[];lasts=[];formulas=[];get(e,t){return this.columns[t]?.[e]}set(e,t,s){let n=this.columns[t];n||(n=[],this.columns[t]=n,this.firsts[t]=e,this.lasts[t]=e),n[e]instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??1)-1),s instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??0)+1),n[e]=s,e<(this.firsts[t]??e)&&(this.firsts[t]=e),e>(this.lasts[t]??e)&&(this.lasts[t]=e)}get width(){return this.columns.length}holds(e,t,s){const n=Math.min(e.right,this.columns.length-1);for(let i=e.left;i<=n;i++){const r=this.columns[i];if(!r)continue;const l=Math.min(e.bottom,this.last(i));for(let o=Math.max(e.top,this.first(i));o<=l;o++)if(r[o]!==void 0&&!(o===t&&i===s))return!0}return!1}first(e){return this.firsts[e]??1/0}last(e){return this.lasts[e]??-1}hasFormulas(e){return(this.formulas[e]??0)>0}}export class Table{columns=[];rows=0;lines=[];places=[];records=[];name;sheet;at;file;spec;constructor(e,t,s,n,i){this.name=e,this.sheet=t,this.at=s,this.file=n,this.spec=i}get area(){return{top:this.at.row,left:this.at.col,bottom:this.at.row+this.rows,right:this.at.col+Math.max(this.columns.length,1)-1}}get data(){const e=this.area;return{...e,top:e.top+1}}column(e){const t=e.toLowerCase();return this.columns.find(s=>s.name.toLowerCase()===t)}}export const placeKey=(a,e)=>a*16384+e;function T(a,e){a.bottom=Math.max(a.bottom,e.bottom),a.right=Math.max(a.right,e.right);for(let t=e.left;t<=e.right;t++){const s=a.columns.get(t);a.columns.set(t,[Math.min(s?.[0]??e.top,e.top),Math.max(s?.[1]??e.bottom,e.bottom)])}}export class Worksheet{tables=[];blocks=[];merges=[];formulas=new Set;implied=new Map;keys=new Map;fills=[];blanks=new Set;conditions=[];validations=[];filters=[];charts=[];freeze;generated=!1;grid=new Z;expanded=!1;lowest=-1;ghosts=new Map;spills=new Set;stopped=new Set;reach;lookAreas;name;index;spec;constructor(e,t,s){this.name=e,this.index=t,this.spec=s}respec(e){const t=e.charts!==this.spec.charts;this.spec=e,this.lookAreas=void 0,t&&(this.charts.length=0,e.charts?.forEach((s,n)=>{const i=W(s,n,[],()=>{});i&&this.charts.push(i)}))}put(e,t,s){s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}replace(e,t,s){this.expand();const n=this.grid.get(e,t);n instanceof FormulaCell&&this.formulas.delete(n),s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}expand(){if(!this.expanded){this.expanded=!0;for(let e=this.fills.length-1;e>=0;e--){const t=this.fills[e];if(!t)continue;const{area:s,shared:n,value:i,format:r}=t;for(let l=s.top;l<=s.bottom;l++)for(let o=s.left;o<=s.right;o++)this.grid.get(l,o)===void 0&&(this.blanks.has(placeKey(l,o))||(n?this.put(l,o,new FormulaCell(n,this,l,o)):i!=null&&(this.put(l,o,i),r!==void 0&&this.implied.set(placeKey(l,o),r))))}}}at(e,t){return this.expand(),this.grid.get(e,t)}spillAt(e,t){return this.ghosts.size===0?void 0:this.ghosts.get(placeKey(e,t))}holds(e,t){return this.expand(),this.grid.holds(e,t.row,t.col)}spillsIn(e){if(this.spills.size===0)return[];if((e.bottom-e.top+1)*(e.right-e.left+1)>=this.spills.size)return[...this.spills].filter(n=>n.spill!==void 0&&v(n.spill,e));const s=new Set;for(let n=e.top;n<=e.bottom;n++)for(let i=e.left;i<=e.right;i++){const r=this.ghosts.get(placeKey(n,i));r&&s.add(r)}return[...s]}blockedBy(e){if(this.stopped.size===0)return[];const t=[];for(const s of this.stopped)s.blocked&&v(s.blocked,e)&&t.push(s);return t}placeSpill(e,t){e.spill=t,this.spills.add(e);for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)(s!==e.row||n!==e.col)&&this.ghosts.set(placeKey(s,n),e);this.reach&&T(this.reach,t)}blockSpill(e,t){e.blocked=t,this.stopped.add(e)}clearSpill(e){const t=e.spill;if(t)for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)this.ghosts.get(placeKey(s,n))===e&&this.ghosts.delete(placeKey(s,n));e.spill=void 0,e.blocked=void 0,this.spills.delete(e),this.stopped.delete(e)}clearSpills(){for(const e of[...this.spills,...this.stopped])e.spill=void 0,e.blocked=void 0;this.spills.clear(),this.stopped.clear(),this.ghosts.clear(),this.reach=void 0}tighten(){this.reach=void 0}spillReach(){if(this.reach)return this.reach;const e={columns:new Map,bottom:-1,right:-1};for(const{spill:t}of this.spills)t&&T(e,t);return this.reach=e,e}hasFormulas(e){return this.expand(),this.grid.hasFormulas(e)}span(e,t,s){this.expand();const n=this.grid.first(e),i=this.grid.last(e);if(this.spills.size===0)return[Math.max(t,n),Math.min(s,i)];const[r,l]=this.spillReach().columns.get(e)??[1/0,-1];return[Math.max(t,Math.min(n,r)),Math.min(s,Math.max(i,l))]}get columnsUsed(){return this.expand(),this.spills.size===0?this.grid.width:Math.max(this.grid.width,this.spillReach().right+1)}get lastRow(){return this.expand(),this.spills.size===0?this.lowest:Math.max(this.lowest,this.spillReach().bottom)}get used(){const e=this.lastRow,t=this.columnsUsed-1;return e<0||t<0?void 0:{top:0,left:0,bottom:e,right:t}}tableAt(e,t){return this.tables.find(s=>y(s.area,e,t))}blockAt(e,t){return this.blocks.find(s=>y(s.area,e,t))}looks(){if(this.lookAreas)return this.lookAreas;const e=[];for(const s of this.spec.format??[]){const n=$(s.range);n&&e.push({area:n,entry:s})}const t=[];for(const[s,n]of Object.entries(this.spec.cells??{})){if(!s.includes(":")||n===null||typeof n!="object")continue;const i=$(s);i&&t.push({area:i,entry:n})}return this.lookAreas={formats:e,ranges:t},this.lookAreas}styledAreas(){const{formats:e,ranges:t}=this.looks();return[...e,...t.filter(s=>Object.keys(s.entry).some(n=>F.has(n)))]}lookAt(e,t){const s={},n=c=>{if(c)for(const[b,w]of Object.entries(c))F.has(b)&&w!==void 0&&(s[b]=b==="border"?{...s.border,...w}:w)},i=this.implied.get(placeKey(e,t));i!==void 0&&(s.format=i);const r=this.ghosts.size===0?void 0:this.spillAt(e,t),l=r&&this.lookAt(r.row,r.col).format;l!==void 0&&(s.format=l),this.spec.columns&&n(this.spec.columns[z(t)]),this.spec.rows&&n(this.spec.rows[String(e+1)]);const o=this.tableAt(e,t);o&&e>o.at.row&&n(o.columns[t-o.at.col]?.spec);const{formats:f,ranges:h}=this.looks();for(const c of f)y(c.area,e,t)&&n(c.entry);for(const c of h)y(c.area,e,t)&&n(c.entry);const m=this.keys.get(placeKey(e,t)),g=m===void 0?void 0:this.spec.cells?.[m];if(g!==null&&typeof g=="object"&&n(g),s.border){const c=Object.entries(s.border).filter(([,b])=>b?.style!=="none");c.length===0?delete s.border:s.border=Object.fromEntries(c)}return s}mergeAt(e,t){return this.merges.find(s=>y(s,e,t))}validationAt(e,t){return this.validations.find(s=>s.areas.some(n=>y(n,e,t)))}filterHeadAt(e,t){return this.filters.find(s=>e===s.area.top&&t>=s.area.left&&t<=s.area.right)}filterAt(e,t){return this.filters.find(s=>y(s.area,e,t))}filesAt(e,t){const s=this.tableAt(e,t);if(s&&e>s.at.row){const n=s.columns[t-s.at.col]?.spec?.files;if(n!==void 0)return n}return s?.at.row===e?void 0:this.spec.columns?.[z(t)]?.files}}export const filesSeparator=a=>(typeof a=="object"?a.separator:void 0)??P;export function filesIn(a,e){const t=filesSeparator(e);return a.split(t.trim()===""?t:t.trim()).map(s=>s.trim()).filter(s=>s!=="")}const F=new Set(["bold","italic","underline","strike","font","size","color","fill","align","valign","wrap","shrink","indent","rotation","border","format"]);export class Workbook{title;sheets=[];names=new Map;checks=[];bySheet=new Map;byTable=new Map;file;generated;ordinary=[];constructor(e,t){this.file=e,this.title=e.title,this.generated=t}respec(e){this.file=O(e,this.generated).file,this.title=e.title,this.sheets.forEach(t=>{const s=e.sheets.find(n=>n.name===t.name);s&&t.respec(s)})}sheet(e){return this.bySheet.get(e.toLowerCase())}table(e){return this.byTable.get(e.toLowerCase())}name(e){return this.names.get(e.toLowerCase())}get tables(){return[...this.byTable.values()]}addSheet(e){this.sheets.push(e),this.bySheet.set(e.name.toLowerCase(),e)}addTable(e){e.sheet.tables.push(e),this.byTable.set(e.name.toLowerCase(),e)}sourceOf(e,t,s){if(e.generated)return{file:C};const n=this.sheets.indexOf(e),i=e.tableAt(t,s);if(i){const o=i.columns[s-i.at.col],f=t-i.at.row-1,h=o?.csv!==void 0&&(i.records[f]?.[o.csv]??"")!=="";return f>=0&&o?.formula&&!h?o.formula.source:{file:i.file,line:f<0?1:i.lines[f]??1}}const r=e.blockAt(t,s);if(r)return{file:r.file,line:r.lines[t-r.area.top]??1};const l=e.keys.get(placeKey(t,s));if(l!==void 0)return{file:E,path:["sheets",n,"cells",l]};for(const o of Object.keys(e.spec.cells??{})){if(!o.includes(":"))continue;const f=$(o);if(f&&y(f,t,s))return{file:E,path:["sheets",n,"cells",o]}}}}export const MAX_FILL_CELLS=5e6;const q=/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u;export function validName(a){return q.test(a)&&x(a)===void 0&&!/^(?:TRUE|FALSE)$/iu.test(a)&&!/^[Rr](?:\d+)?(?:[Cc]\d*)?$/u.test(a)&&!/^[Cc]\d*$/u.test(a)}const M="made",k=a=>a[0]===M?C:E;class N{problems=[];wb;read_;lineOf;own;madeNames;constructor(e,t,s,n,i){this.wb=e,this.read_=t,this.lineOf=s,this.own=n,this.madeNames=i}yaml(e,t){const s=this.lineOf(e);this.problems.push({file:k(e),...s===void 0?{}:{line:s},message:t})}sheetPath(e){return e<this.own?["sheets",e]:[M,"sheets",e-this.own]}read(){const{file:e}=this.wb;e.sheets.forEach((t,s)=>{const n=this.sheetPath(s);if(this.wb.sheet(t.name)){this.yaml([...n,"name"],`two sheets are named ${t.name}`);return}(/[\\/?*[\]:]/u.test(t.name)||t.name.length>31)&&this.yaml([...n,"name"],`${t.name} cannot be a sheet's name: at most 31 characters, none of \\ / ? * [ ] :`);const i=new Worksheet(t.name,this.wb.sheets.length,t);i.generated=s>=this.own,this.wb.addSheet(i)}),this.names();for(const[t,s]of e.sheets.entries()){const n=this.wb.sheets[t];n?.spec===s&&this.sheet(n,this.sheetPath(t))}e.checks?.forEach((t,s)=>{const n={file:E,path:["checks",s,"formula"]};this.wb.checks.push({name:t.name,formula:new SharedFormula(t.formula,0,0,n),source:n})})}names(){for(const[e,t]of Object.entries(this.wb.file.names??{})){const s=this.madeNames.has(e)?[M,"names",e]:["names",e];if(!validName(e)){this.yaml(s,`${e} cannot be a name`);continue}const n={file:k(s),path:s},i=typeof t=="string"&&t.startsWith("=")?{name:e,formula:new SharedFormula(t,0,0,n),source:n}:{name:e,value:typeof t=="string"?A(t).value:t,source:n};this.wb.names.set(e.toLowerCase(),i)}}sheet(e,t){const{spec:s}=e;if(s.freeze!==void 0){const n=x(s.freeze);n?e.freeze=n:this.yaml([...t,"freeze"],`${s.freeze} is not a cell`)}s.tables?.forEach((n,i)=>{this.table(e,n,[...t,"tables",i])});for(const[n,i]of e.tables.entries())for(const r of e.tables.slice(n+1))v(i.area,r.area)&&this.problems.push({file:E,message:`tables ${i.name} and ${r.name} overlap on ${e.name}`});s.blocks?.forEach((n,i)=>{this.block(e,n.at,n.rows,[...t,"blocks",i])}),this.cells(e,s.cells??{},[...t,"cells"]),s.merges?.forEach((n,i)=>{const r=$(n);r?e.merges.push(r):this.yaml([...t,"merges",i],`${n} is not a range`)}),s.format?.forEach((n,i)=>{$(n.range)||this.yaml([...t,"format",i,"range"],`${n.range} is not a range`)}),s.conditional?.forEach((n,i)=>{this.condition(e,n,[...t,"conditional",i])}),s.validations?.forEach((n,i)=>{this.validation(e,n,[...t,"validations",i])}),this.filters(e,t),s.charts?.forEach((n,i)=>{this.chart(e,n,i,[...t,"charts",i])});for(const n of Object.keys(s.columns??{}))j(n)===void 0&&this.yaml([...t,"columns",n],`${n} is not a column`);for(const n of Object.keys(s.rows??{}))(!/^[1-9]\d*$/u.test(n)||Number(n)>B)&&this.yaml([...t,"rows",n],`${n} is not a row`)}chart(e,t,s,n){const i=W(t,s,n,(r,l)=>{this.yaml(r,l)});i&&e.charts.push(i)}bound(e,t,s){if(!(typeof e!="string"||!e.startsWith("=")||e.length<2))return new SharedFormula(e,t?.top??0,t?.left??0,{file:k(s),path:s})}condition(e,t,s){const n=_(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const[i]=n,r=[],l=(o,f)=>{const h=this.bound(o,i,f);h&&r.push(h)};if(t.type==="expression"){const o=t.formula.startsWith("=")?t.formula:`=${t.formula}`;l(o,[...s,"formula"])}if(t.type==="cellIs"&&t.formula.forEach((o,f)=>{l(o,[...s,"formula",f])}),t.type==="dataBar")for(const o of["min","max"])l(t[o]?.value,[...s,o,"value"]);(t.type==="colorScale"||t.type==="iconSet")&&t.stops?.forEach((o,f)=>{l(o.value,[...s,"stops",f,"value"])}),e.conditions.push({spec:t,areas:n,formulas:r})}validation(e,t,s){const n=_(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const i=(t.formula??[]).map((o,f)=>this.bound(o,n[0],[...s,"formula",f])),r=t.formula?.length??0,l=t.type!=="list"&&t.type!=="custom"&&(t.operator===void 0||t.operator==="between"||t.operator==="notBetween");!(t.type==="list"&&t.values!==void 0)&&r<(l?2:1)&&this.yaml(s,`a ${t.type} validation needs its bounds`),e.validations.push({spec:t,areas:n,formulas:i})}filters(e,t){const{spec:s}=e;if(s.filter){const n=[...t,"filter"],i=$(s.filter.range);if(!i)this.yaml([...n,"range"],`${s.filter.range} is not a range`);else{const r=new Map;for(const[o,f]of Object.entries(s.filter.columns??{})){const h=j(o);h===void 0||h<i.left||h>i.right?this.yaml([...n,"columns",o],`${o} is not a column of ${s.filter.range}`):r.set(h,f)}const l=e.tables.find(o=>v(o.area,i));l&&this.yaml(n,`a filter over table ${l.name}: a table has its own`),e.filters.push({area:i,columns:r})}}e.tables.forEach((n,i)=>{const{filter:r}=n.spec;if(r===!1)return;const l=new Map;for(const[o,f]of Object.entries(r?.columns??{})){const h=n.column(o);h?l.set(n.at.col+h.index,f):this.yaml([...t,"tables",i,"filter","columns",o],`table ${n.name} has no column ${o}`)}e.filters.push({area:n.area,table:n,columns:l})})}csv(e,t,s){const n=this.read_(e);return n||this.yaml(t,`${s}: ${e} is not there`),n}overlapping(e,t){const s=e.tables.find(i=>v(i.area,t));if(s)return`table ${s.name}`;const n=e.blocks.find(i=>v(i.area,t));return n?`the block of ${n.file}`:void 0}typed(e,t,s,n,i){if(n.formula!==void 0){const r=new SharedFormula(n.formula,t,s,i);e.put(t,s,new FormulaCell(r,e,t,s));return}n.value!==null&&(e.put(t,s,n.value),n.format!==void 0&&e.implied.set(placeKey(t,s),n.format))}table(e,t,s){const n=x(t.at);if(!n){this.yaml([...s,"at"],`${t.at} is not a cell`);return}if(!validName(t.name)){this.yaml([...s,"name"],`${t.name} cannot be a table's name`);return}if(this.wb.table(t.name)){this.yaml([...s,"name"],`two tables are named ${t.name}`);return}this.wb.name(t.name)&&this.yaml([...s,"name"],`${t.name} is a defined name and a table's`);const i=new Table(t.name,e,n,t.rows,t),r=this.csv(t.rows,[...s,"rows"],`table ${t.name}`),l=r?.rows??[],o=r?.lines??[],f=l[0],h=o[0]??1,m=new Set,g=f?.length===0?[""]:f??[];g.forEach((u,d)=>{const p=u.trim();p===""&&this.problems.push({file:t.rows,line:h,message:`column ${String(d+1)} has no name`}),m.has(p.toLowerCase())&&this.problems.push({file:t.rows,line:h,message:`two columns are named ${p}`}),m.add(p.toLowerCase()),i.columns.push({name:p,index:i.columns.length,csv:d})});for(const[u,d]of Object.entries(t.columns??{})){const p=i.column(u),S=p??{name:u,index:i.columns.length};p||(d.formula===void 0&&this.yaml([...s,"columns",u],`table ${t.name} has no column ${u}`),i.columns.push(S)),S.spec=d}const c=g.length;for(let u=1;u<l.length;u++){const d=l[u];if(!d||d.length===0)continue;const p=o[u]??u+1;i.places.push(u),i.records.push(d),i.lines.push(p),d.length>c&&this.problems.push({file:t.rows,line:p,message:`this row has ${String(d.length)} fields and the header ${String(c)}`})}i.rows=i.records.length;const b=this.overlapping(e,i.area);b&&this.yaml(s,`table ${t.name} overlaps ${b} on ${e.name}`),this.wb.addTable(i),this.tableKey(i,s);const w=n.row+1;i.columns.forEach(u=>{const d=n.col+u.index;e.put(n.row,d,u.name);const p=u.spec?.formula;p!==void 0&&(u.formula=new SharedFormula(p,w,d,{file:k(s),path:[...s,"columns",u.name,"formula"]}),i.rows>0&&e.fills.push({area:{top:w,left:d,bottom:w+i.rows-1,right:d},shared:u.formula})),u.csv!==void 0&&i.records.forEach((S,L)=>{this.typed(e,w+L,d,A(S[u.csv??0]??""),{file:t.rows,line:i.lines[L]??1})})})}tableKey(e,t){const{key:s}=e.spec;if(s===void 0)return;const n=e.column(s);if(n?.csv===void 0){this.yaml([...t,"key"],`table ${e.name} has no column ${s} in ${e.file}`);return}const i=new Set;e.records.forEach((r,l)=>{const o=r[n.csv??0]??"",f=e.lines[l]??1;o===""?this.problems.push({file:e.file,line:f,message:`this row has no ${s}, table ${e.name}'s key`}):i.has(o)&&this.problems.push({file:e.file,line:f,message:`two rows have the key ${o}`}),i.add(o)})}block(e,t,s,n){const i=x(t);if(!i){this.yaml([...n,"at"],`${t} is not a cell`);return}const r=this.csv(s,[...n,"rows"],"a block");if(!r)return;const l=r.rows,o=l.map((g,c)=>r.lines[c]??c+1),f=l.reduce((g,c)=>Math.max(g,c.length),1),h={top:i.row,left:i.col,bottom:i.row+Math.max(l.length,1)-1,right:i.col+f-1},m=this.overlapping(e,h);m&&this.yaml(n,`the block of ${s} overlaps ${m} on ${e.name}`),e.blocks.push({area:h,file:s,lines:o}),l.forEach((g,c)=>{g.forEach((b,w)=>{this.typed(e,i.row+c,i.col+w,A(b),{file:s,line:o[c]??c+1})})})}cells(e,t,s){const n=[];for(const[i,r]of Object.entries(t)){const l=[...s,i],o=$(i);if(!o){this.yaml(l,`${i} is not a cell or a range`);continue}const f=this.overlapping(e,o);if(f&&this.yaml(l,`${i} overlaps ${f}`),i.includes(":")){const h=(o.bottom-o.top+1)*(o.right-o.left+1);h>MAX_FILL_CELLS?this.yaml(l,`${i} is ${String(h)} cells`):this.fill(e,o,r,l)}else n.push([i,r,{row:o.top,col:o.left}])}for(const[i,r,l]of n){const o=[...s,i],f=K(r),h=placeKey(l.row,l.col);e.keys.set(h,i),f.value===null&&f.formula===void 0&&e.blanks.add(h),this.typed(e,l.row,l.col,f,{file:k(o),path:o});const m=r!==null&&typeof r=="object"?r.name:void 0;m!==void 0&&this.cellName(e,l,m,o)}}cellName(e,t,s,n){if(!validName(s)){this.yaml(n,`${s} cannot be a name`);return}if(this.wb.name(s)){this.yaml(n,`two places are named ${s}`);return}const i={file:k(n),path:n},r=H(t).replace(/^([A-Z]+)(\d+)$/u,"$$$1$$$2"),l=`='${e.name.replaceAll("'","''")}'!${r}`;this.wb.names.set(s.toLowerCase(),{name:s,formula:new SharedFormula(l,0,0,i),source:i})}fill(e,t,s,n){const i=K(s),r={file:k(n),path:n};e.fills.push(i.formula===void 0?{area:t,value:i.value,...i.format===void 0?{}:{format:i.format}}:{area:t,shared:new SharedFormula(i.formula,t.top,t.left,r)})}}function W(a,e,t,s){const n=x(a.at);if(!n){s([...t,"at"],`${a.at} is not a cell`);return}const i=(o,f)=>{const h=new SharedFormula(chartFormula(o),0,0,{file:k(f),path:f});return h.node&&!I(h.node)&&s(f,`${o} is not a range or a table's column`),h},r=(o,f)=>o?.startsWith("=")===!0?i(o,f):void 0,l=r(a.title,[...t,"title"]);return{spec:a,at:n,index:e,...a.categories===void 0?{}:{categories:i(a.categories,[...t,"categories"])},...l?{title:l}:{},series:a.series.map((o,f)=>{const h=[...t,"series",f],m=r(o.name,[...h,"name"]);return{values:i(o.values,[...h,"values"]),...o.x===void 0?{}:{x:i(o.x,[...h,"x"])},...m?{name:m}:{}}})}}export const chartFormula=a=>a.startsWith("=")?a:`=${a}`;function I(a){switch(a.kind){case"error":case"ref":case"structured":case"name":return!0;case"paren":case"postfix":return I(a.arg);case"binary":return a.op===":"||a.op===",";default:return!1}}function K(a){if(a===null)return{value:null};if(typeof a=="string")return A(a);if(typeof a!="object")return{value:a};if(a.formula!==void 0)return{value:null,formula:a.formula.startsWith("=")?a.formula:`=${a.formula}`};const{value:e}=a;return typeof e=="string"?A(e):{value:e??null}}export function readWorkbook(a){const e=D(a.text),t=l=>l[0]===M?void 0:e.lineOf(l);if(!e.file)return{problems:e.problems,lineOf:t};const s=O(e.file,a.generated),n=new Workbook(s.file,a.generated);n.ordinary=s.ordinary;const i=[],r=new N(n,l=>{const o=a.generated?.csv[l]??a.read(l);if(o===void 0)return;const f=R(o);for(const h of f.problems)i.push({file:l,line:h.line,message:h.message});return{rows:f.records.map(h=>h.end===h.start?[]:h.fields),lines:f.records.map(h=>h.line)}},t,s.own,s.names);return r.read(),{workbook:n,problems:[...i,...r.problems],lineOf:t}}export function workbookOf(a){const e=O(a.file,a.generated),t=new Workbook(e.file,a.generated);return t.ordinary=e.ordinary,new N(t,s=>{const n=a.generated?.csv[s];if(n!==void 0)return{rows:R(n).records.map(r=>r.end===r.start?[]:r.fields),lines:[]};const i=a.rows(s);return i&&{rows:i,lines:[]}},()=>{},e.own,e.names).read(),t}export{U as rangeName};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A value as a whole file. */
|
|
2
|
+
export declare function writeYaml(value: unknown): string;
|
|
3
|
+
/** `text` saying `next`, with what did not change kept as it was written. */
|
|
4
|
+
export declare function patchYaml(text: string, next: unknown): string;
|
|
5
|
+
//# sourceMappingURL=write.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{Document as D,isMap as a,isScalar as I,isSeq as d,parseDocument as L}from"yaml";const M=n=>I(n.key)?String(n.key.value):void 0,B=96,F=n=>I(n)||d(n)&&n.items.every(I),G=new Set(["","sheets[]","tables[]","cells","columns","rows","names","scenarios"]);function v(n,r){if(d(n)){for(const e of n.items)v(e,`${r}[]`);n.flow=n.items.every(I)}else if(a(n)){for(const e of n.items)v(e.value,M(e)??"");n.flow=!G.has(r)&&n.items.length>0&&n.items.every(e=>F(e.value)||a(e.value)&&e.value.flow===!0),n.flow&&new D(n).toString({lineWidth:0,flowCollectionPadding:!0}).length>B&&(n.flow=!1)}}const P={lineWidth:0,flowCollectionPadding:!0};export function writeYaml(n){const r=new D(n,{aliasDuplicateObjects:!1});v(r.contents,"");const e=r.toString(P);return e===`{}
|
|
3
|
+
`?"":b(e)}const b=n=>n.replace(/\[ ([^[\]{}"'\n]*) \]/g,"[$1]").replace(/\[ \{/g,"[{").replace(/\} \]/g,"}]"),T=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function h(n,r){if(n===r)return!0;if(Array.isArray(n)&&Array.isArray(r))return n.length===r.length&&n.every((t,c)=>h(t,r[c]));if(!T(n)||!T(r))return!1;const e=t=>Object.keys(t).filter(c=>t[c]!==void 0),i=e(n);return i.length===e(r).length&&i.every(t=>t in r&&h(n[t],r[t]))}function R(n,r,e,i,t){if(!h(r,e)){if(a(n)&&!n.flow&&T(r)&&T(e)){for(const c of new Set([...Object.keys(r),...Object.keys(e)])){const s=n.items.find(o=>M(o)===c)?.value;h(r[c],e[c])||R(s,r[c],e[c],[...i,c],t)}return}if(d(n)&&!n.flow&&Array.isArray(r)&&Array.isArray(e)&&e.length>0){const c=Math.min(r.length,e.length);let s=0;for(;s<c&&h(r[s],e[s]);)s++;let o=0;for(;o<c-s&&h(r[r.length-1-o],e[e.length-1-o]);)o++;const m=r.length-s-o,y=e.length-s-o,g=Math.min(m,y);for(let l=s;l<s+g;l++)R(n.items[l],r[l],e[l],[...i,l],t);for(let l=s+m-1;l>=s+g;l--)t.push({path:[...i,l],value:void 0});for(let l=s+g;l<s+y;l++)t.push({path:[...i,l],value:e[l],...o>0?{insert:!0}:{}});return}t.push({path:i,value:e})}}const A=(n,r)=>n.lastIndexOf(`
|
|
4
|
+
`,r-1)+1,C=(n,r)=>{const e=n.indexOf(`
|
|
5
|
+
`,r);return e<0?n.length:e+1},U=(n,r)=>n.split(`
|
|
6
|
+
`).map((e,i)=>i===0||e===""?e:" ".repeat(r)+e).join(`
|
|
7
|
+
`);function Y(n,r,e,i){const t=new D({[n]:r},{aliasDuplicateObjects:!1}),c=t.contents;v(c,"");const s=c.items[0];return(a(i)||d(i))&&(a(s?.value)||d(s?.value))&&(s.value.flow=i.flow??!1),U(b(t.toString(P).replace(/\n$/,"")),e)}function E(n,r,e){const i=new D([n],{aliasDuplicateObjects:!1}),t=i.contents;return v(t,e),t.flow=!1,U(b(i.toString(P).replace(/\n$/,"")),r)}function H(n,r){let e=n.contents;for(const i of r.slice(0,-1))if(a(e)){if(e.flow)return;e=e.items.find(t=>M(t)===String(i))?.value}else if(d(e)){if(e.flow)return;e=e.items[Number(i)]}else return;return a(e)||d(e)?e:void 0}function K(n,r){const e=r.items[0]?.range?.[0];if(e===void 0)return;const i=A(n,e),t=n.indexOf("-",i);return t>=0&&t<e?t-i:void 0}function Q(n,r){const e=L(n);if(e.errors.length>0)return;const{path:i,value:t}=r,c=i[i.length-1],s=H(e,i);if(c===void 0||!s||s.flow)return;if(d(s)){const u=Number(c),f=K(n,s);if(f===void 0)return;const p=s.items[u];if(t===void 0){const S=p?.range?.[0],$=p?.range?.[1];return S===void 0||$===void 0?void 0:n.slice(0,A(n,S))+n.slice(C(n,$-1))}if(r.insert===!0){const S=p?.range?.[0];if(S===void 0)return;const $=A(n,S);return`${n.slice(0,$)}${" ".repeat(f)}${E(t,f,String(i[i.length-2]))}
|
|
8
|
+
${n.slice($)}`}if(p)return;const N=s.items[s.items.length-1]?.range?.[1];if(N===void 0)return;const j=n.charAt(N-1)===`
|
|
9
|
+
`?N:C(n,N),z=j>0&&n.charAt(j-1)!==`
|
|
10
|
+
`?`
|
|
11
|
+
`:"";return`${n.slice(0,j)}${z}${" ".repeat(f)}${E(t,f,String(i[i.length-2]??""))}
|
|
12
|
+
${n.slice(j)}`}const o=String(c),m=s.items.find(u=>M(u)===o),y=m?.key,g=m?.value??void 0,J=s.items[0]?.key?.range?.[0],O=J===void 0?2*(i.length-1):J-A(n,J);if(m&&y?.range){const u=y.range[0],f=g?.range?g.range[1]:y.range[1];if(t===void 0)return n.slice(0,A(n,u))+n.slice(C(n,f-1));const p=n.charAt(f-1)===`
|
|
13
|
+
`?`
|
|
14
|
+
`:"";return n.slice(0,u)+Y(o,t,O,g)+p+n.slice(f)}if(t===void 0)return n;const W=Y(o,t,O,void 0),q=s.items[s.items.length-1],w=(q?.value??q?.key)?.range?.[1];if(w===void 0){const u=n===""||n.endsWith(`
|
|
15
|
+
`)?"":`
|
|
16
|
+
`;return`${n}${u}${" ".repeat(O)}${W}
|
|
17
|
+
`}const k=n.charAt(w-1)===`
|
|
18
|
+
`?w:C(n,w),_=k>0&&n.charAt(k-1)!==`
|
|
19
|
+
`?`
|
|
20
|
+
`:"";return`${n.slice(0,k)}${_}${" ".repeat(O)}${W}
|
|
21
|
+
${n.slice(k)}`}const V=400;export function patchYaml(n,r){const e=L(n);if(e.errors.length>0||n.trim()!==""&&!a(e.contents)||n.trim()==="")return writeYaml(r);const i=[];if(R(e.contents,e.toJS(),r,[],i),i.length===0)return n;if(i.length>V)return writeYaml(r);let t=n;for(const s of i){const o=Q(t,s);if(o===void 0)return writeYaml(r);t=o}const c=L(t);return c.errors.length===0&&h(c.toJS(),X(r))?t:writeYaml(r)}const X=n=>JSON.parse(JSON.stringify(n));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SheetChart } from "@allyhub-next/formats";
|
|
2
|
+
import type { Calc } from "../calc/engine.js";
|
|
3
|
+
import type { Chart, Worksheet } from "../workbook.js";
|
|
4
|
+
import { type Tag } from "./xml.js";
|
|
5
|
+
/** A chart's part. */
|
|
6
|
+
export declare function chartPart(calc: Calc, sheet: Worksheet, chart: Chart): string;
|
|
7
|
+
/** A picture of a `files` cell in a sheet's drawing: `file` is its media part. */
|
|
8
|
+
export interface DrawnPicture {
|
|
9
|
+
row: number;
|
|
10
|
+
col: number;
|
|
11
|
+
/** How far into its cell, px. */
|
|
12
|
+
x: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
name: string;
|
|
16
|
+
file: string;
|
|
17
|
+
bytes: Uint8Array;
|
|
18
|
+
}
|
|
19
|
+
/** A sheet's drawing: each chart at its anchor, then each picture, by their relationships' numbers. */
|
|
20
|
+
export declare function drawingPart(charts: readonly Chart[], pictures?: readonly DrawnPicture[]): string;
|
|
21
|
+
/** What a chart reads as, before its references are named as the sheet names them. */
|
|
22
|
+
export type ReadChart = SheetChart;
|
|
23
|
+
/** A chart part as sheet.yaml writes one, or why it cannot be. */
|
|
24
|
+
export declare function readChart(root: Tag | undefined): ReadChart | string;
|
|
25
|
+
export interface Anchored {
|
|
26
|
+
/** Its relationship in the drawing's part. */
|
|
27
|
+
id: string;
|
|
28
|
+
at: {
|
|
29
|
+
row: number;
|
|
30
|
+
col: number;
|
|
31
|
+
};
|
|
32
|
+
x?: number;
|
|
33
|
+
y?: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
}
|
|
37
|
+
/** Each chart of a drawing where it sits, sizes in pixels. */
|
|
38
|
+
export declare function chartAnchors(root: Tag | undefined, columnWidth: (col: number) => number, rowHeight: (row: number) => number): {
|
|
39
|
+
anchors: Anchored[];
|
|
40
|
+
others: number;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=charts.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CHART_DEFAULTS as Q,chartSpaceXml as ce}from"@allyhub-next/chart";import{columnLetter as Y}from"../address.js";import{Reference as Z,Union as ae}from"../calc/types.js";import{chartDef as fe,chartSize as de}from"../chart.js";import{sheetPrefix as le}from"../formula/print.js";import{HEAD as ue,attr as $,el as s,flag as ee,numberAttr as P,tag as o,tags as k,textOf as y}from"./xml.js";const he="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",me="http://schemas.openxmlformats.org/drawingml/2006/main",te="http://schemas.openxmlformats.org/drawingml/2006/chart",re="http://schemas.openxmlformats.org/officeDocument/2006/relationships",b=9525,xe=(e,t)=>`${le(e.sheet.name)}$${Y(e.left)}$${String(e.top+1)}${e.single?"":`:$${Y(e.right)}$${String(t+1)}`}`;function S(e,t,r){if(!r?.node)return;const n=e.eval(r.node,{sheet:t,row:0,col:0,dr:0,dc:0}),i=a=>xe(a,Math.min(a.bottom,Math.max(a.top,a.sheet.lastRow)));if(n instanceof Z)return i(n);if(n instanceof ae)return`(${n.parts.map(i).join(",")})`}function pe(e,t,r){if(!r?.node)return!1;const n=e.eval(r.node,{sheet:t,row:0,col:0,dr:0,dc:0});return n instanceof Z&&typeof e.value(n.sheet,n.top,n.left)=="number"}export function chartPart(e,t,r){const n=fe(e,t,r),i={name:f=>S(e,t,r.series[f]?.name),categories:S(e,t,r.categories),numeric:pe(e,t,r.categories),values:f=>S(e,t,r.series[f]?.values)??"",x:f=>S(e,t,r.series[f]?.x??r.categories)},a=S(e,t,r.title);return ce(n,{refs:i,...a===void 0?{}:{titleRef:a}})}const ge=(e,t,r)=>s("xdr:oneCellAnchor",{},s("xdr:from",{},`<xdr:col>${String(e.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round(e.x*b))}</xdr:colOff>`,`<xdr:row>${String(e.row)}</xdr:row>`,"<xdr:rowOff>0</xdr:rowOff>"),s("xdr:ext",{cx:Math.round(e.width*b),cy:Math.round(e.height*b)}),s("xdr:pic",{},s("xdr:nvPicPr",{},s("xdr:cNvPr",{id:t,name:e.name}),s("xdr:cNvPicPr",{},s("a:picLocks",{noChangeAspect:!0}))),s("xdr:blipFill",{},s("a:blip",{"xmlns:r":re,"r:embed":`rId${String(r)}`}),s("a:stretch",{},s("a:fillRect"))),s("xdr:spPr",{},s("a:xfrm",{},s("a:off",{x:0,y:0}),s("a:ext",{cx:Math.round(e.width*b),cy:Math.round(e.height*b)})),s("a:prstGeom",{prst:"rect"},s("a:avLst")))),s("xdr:clientData"));export function drawingPart(e,t=[]){const r=(n,i)=>{const{width:a,height:f}=de(n.spec);return s("xdr:oneCellAnchor",{},s("xdr:from",{},`<xdr:col>${String(n.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((n.spec.x??0)*b))}</xdr:colOff>`,`<xdr:row>${String(n.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((n.spec.y??0)*b))}</xdr:rowOff>`),s("xdr:ext",{cx:Math.round(a*b),cy:Math.round(f*b)}),s("xdr:graphicFrame",{macro:""},s("xdr:nvGraphicFramePr",{},s("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),s("xdr:cNvGraphicFramePr")),s("xdr:xfrm",{},s("a:off",{x:0,y:0}),s("a:ext",{cx:0,cy:0})),s("a:graphic",{},s("a:graphicData",{uri:te},s("c:chart",{"xmlns:c":te,"xmlns:r":re,"r:id":`rId${String(i+1)}`})))),s("xdr:clientData"))};return ue+s("xdr:wsDr",{"xmlns:xdr":he,"xmlns:a":me},...e.map(r),...t.map((n,i)=>ge(n,e.length+i+2,e.length+i+1)))}function G(e){if(Array.isArray(e))return e.map(G).join("");if(typeof e!="object"||e===null)return"";const t=e,r=[];for(const[n,i]of Object.entries(t))n==="t"?r.push(y(i)):typeof i=="object"&&r.push(G(i));return r.join("")}const T=e=>{const t=o(e?.solidFill),r=$(o(t?.srgbClr),"val");return r!==void 0?`#${r.toUpperCase()}`:we[$(o(t?.schemeClr),"val")??""]},we={accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"},O=(e,t)=>$(o(e?.[t]),"val"),A=(e,t)=>P(o(e?.[t]),"val"),D=(e,t)=>ee(o(e?.[t]),"val");function ne(e){if(!e)return;const t=o(e.tx),r=o(t?.strRef);if(r)return`=${y(r.f)}`;const n=G(t?.rich);return n===""?void 0:n}function oe(e){if(!e)return;const t=o(e.scaling),r=o(e.numFmt),n=$(r,"formatCode"),i={},a=ne(o(e.title));a!==void 0&&(i.title=a);const f=A(t,"min"),g=A(t,"max"),l=A(e,"majorUnit");return f!==void 0&&(i.min=f),g!==void 0&&(i.max=g),l!==void 0&&l>0&&(i.major=l),D(e,"delete")===!0&&(i.visible=!1),O(t,"orientation")==="maxMin"&&(i.reverse=!0),n!==void 0&&n!=="General"&&ee(r,"sourceLinked")!==!0&&(i.format=n),i}const R=e=>{const t=o(e?.numRef)??o(e?.strRef),r=t?y(t.f):"";return r===""?void 0:r};function be(e,t){const r=R(o(e[t?"yVal":"val"]));if(r===void 0)return"its numbers are written in the chart";const n={values:r},i=o(e.tx),a=R(i);if(a!==void 0)n.name=`=${a}`;else{const p=y(i?.v);p!==""&&(n.name=p)}const f=o(e.spPr),g=o(f?.ln),l=o(e.marker),c=t||l!==void 0,d=T(f)??(c?T(g)??T(o(l?.spPr)):void 0);d!==void 0&&(n.color=d);const h=P(g,"w");if(c&&h!==void 0&&g?.noFill===void 0){const p=Number((h/12700).toFixed(2));p!==Q.lineWidth&&(n.line_width=p)}D(e,"smooth")===!0&&(n.smooth=!0);const m=A(l,"size");m!==void 0&&m!==Q.marker&&(n.marker_size=m);const w=t?R(o(e.xVal)):void 0;w!==void 0&&(n.x=w);const x=t?void 0:R(o(e.cat));return{series:n,...x===void 0?{}:{categories:x}}}function ve(e){const t=O(e,"barDir")==="bar"?"bar":"column",r=O(e,"grouping");return r==="stacked"?`${t}-stacked`:r==="percentStacked"?`${t}-stacked-100`:`${t}-clustered`}function ye(e){const t=O(e,"grouping");return t==="stacked"?"area-stacked":t==="percentStacked"?"area-stacked-100":"area"}export function readChart(e){const t=o(e?.chartSpace),r=o(t?.chart),n=o(r?.plotArea);if(!r||!n)return"it has no plot";const i=Object.entries(n).filter(([u])=>u.endsWith("Chart")),[a]=i;if(!a)return"it has no plot";if(i.length>1||Array.isArray(a[1])&&a[1].length>1)return"it combines several kinds of chart";const[f,g]=a,l=o(g);if(!l)return"it has no plot";const c=k(l.ser),d=f==="scatterChart",h=[];let m;for(const u of c){const C=be(u,d);if(typeof C=="string")return C;h.push(C.series),m??=C.categories}if(h.length===0)return"it has no series";const w=u=>o(o(u.spPr)?.ln)?.noFill!==void 0,x=u=>O(o(u.marker),"symbol")==="none",p=(()=>{switch(f){case"barChart":return ve(l);case"lineChart":return c.every(x)?"line":"line-markers";case"areaChart":return ye(l);case"pieChart":return"pie";case"doughnutChart":return"doughnut";case"scatterChart":return c.every(w)?"scatter":c.some(u=>D(u,"smooth")===!0)?"scatter-smooth":"scatter-lines";default:return}})();if(!p)return`a sheet has no ${f.replace(/Chart$/u,"")} chart`;const U=ne(o(r.title)),I=o(r.legend),j=O(I,"legendPos"),V=o(l.dLbls),v=u=>D(V,u)===!0,se=v("showVal")||v("showPercent")||v("showCatName")||v("showSerName"),H=O(V,"dLblPos"),F=A(l,"gapWidth"),W=A(l,"overlap"),N=A(l,"holeSize"),X=D(l,"varyColors"),B=p==="pie"||p==="doughnut",M={value:k(n.valAx).find((u,C,ie)=>d?C===ie.length-1:!0),category:d?k(n.valAx)[0]:o(n.catAx)??o(n.dateAx)},L=oe(M.value),z=oe(M.category);L&&M.value?.majorGridlines===void 0&&(L.gridlines=!1),z&&M.category?.majorGridlines!==void 0&&(z.gridlines=!0);const E=P(o(o(o(o(t?.txPr)?.p)?.pPr)?.defRPr),"sz"),q=u=>u&&Object.keys(u).length>0?u:void 0,J=q(L),K=q(z);return{type:p,at:"A1",...U===void 0?{}:{title:U},...m===void 0?{}:{categories:m},series:B?h.slice(0,1):h,...I?{legend:j==="b"?"bottom":j==="t"?"top":j==="l"?"left":"right"}:{},...se?{labels:{...v("showVal")?{value:!0}:{},...v("showPercent")?{percentage:!0}:{},...v("showCatName")?{category:!0}:{},...v("showSerName")?{series:!0}:{},...H===void 0?{}:{position:H}}}:{},...F===void 0||F===150?{}:{gap_width:F},...W===void 0||p.includes("stacked")?{}:{overlap:W},...N===void 0||N===50?{}:{hole_size:N},...X===!0&&f==="barChart"?{vary_by_categories:!0}:{},...X===!1&&B?{vary_by_categories:!1}:{},...J?{value_axis:J}:{},...K?{category_axis:K}:{},...E===void 0||E===900?{}:{size:E/100}}}const _=e=>Math.round(e/b);export function chartAnchors(e,t,r){const n=o(e?.wsDr),i=[];let a=0;const f=c=>({col:Number(y(c?.col)),row:Number(y(c?.row)),colOff:_(Number(y(c?.colOff))),rowOff:_(Number(y(c?.rowOff)))}),g=c=>$(o(o(o(o(c.graphicFrame)?.graphic)?.graphicData)?.chart),"id"),l=(c,d,h,m)=>{const w=g(c);if(w===void 0){a+=1;return}i.push({id:w,at:{row:d.row,col:d.col},...d.colOff>0?{x:d.colOff}:{},...d.rowOff>0?{y:d.rowOff}:{},width:h,height:m})};for(const c of k(n?.oneCellAnchor)){const d=o(c.ext);l(c,f(o(c.from)),_(P(d,"cx")??0),_(P(d,"cy")??0))}for(const c of k(n?.twoCellAnchor)){const d=f(o(c.from)),h=f(o(c.to));let m=h.colOff-d.colOff;for(let x=d.col;x<h.col;x++)m+=t(x);let w=h.rowOff-d.rowOff;for(let x=d.row;x<h.row;x++)w+=r(x);l(c,d,m,w)}return{anchors:i,others:a}}
|