allyhub 0.5.0 → 0.7.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/dist/audio-text.js +1 -1
- package/dist/commands/add.js +2 -2
- package/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/dev.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/render.js +1 -1
- package/dist/commands/sheet.js +7 -7
- package/dist/commands/site.js +3 -2
- package/dist/commands/skills.js +3 -3
- package/dist/commands/slides.js +2 -2
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
- package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
- package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
- package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
- package/dist/node_modules/@allyhub-next/build/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
- package/dist/node_modules/@allyhub-next/check/package.json +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
- package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
- package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
- package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/export/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +248 -18
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1114 -91
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +625 -30
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
- package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
- package/dist/node_modules/@allyhub-next/media/package.json +1 -1
- package/dist/node_modules/@allyhub-next/model/package.json +1 -1
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
- package/dist/node_modules/@allyhub-next/project/package.json +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +89 -5
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
- package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
- package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
- package/dist/node_modules/@allyhub-next/render/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
- package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
- package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +12 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +44 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +121 -44
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +50 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +188 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +38 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +26 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
- package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
- package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
- package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
- package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
- package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
- package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
- package/dist/node_modules/@allyhub-next/website/package.json +13 -0
- package/dist/text/facts-text.js +4 -4
- package/dist/works.js +1 -1
- package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
- package/editor-web/assets/dist-0emakyZE.js +36 -0
- package/editor-web/assets/dist-B3UoDUa5.js +37 -0
- package/editor-web/assets/dist-B6KzR3pN.js +10 -0
- package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
- package/editor-web/assets/dist-CTQIm8Im.js +10 -0
- package/editor-web/assets/dist-CiHNHwyq.js +2 -0
- package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
- package/editor-web/assets/index-CFt3ovRY.js +69 -0
- package/editor-web/assets/index-ujKjdu_s.css +2 -0
- package/editor-web/assets/minus-BhoPZC5P.js +1 -0
- package/editor-web/assets/react-C_-rEEBU.js +101 -0
- package/editor-web/assets/tabs-Den4gHrU.js +105 -0
- package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
- package/editor-web/index.html +5 -5
- package/package.json +8 -14
- package/dist/astro.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
- package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
- package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
- package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
- package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
- package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
- package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
- package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
- package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
- package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
- package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
- package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
- package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
- package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
- package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
- package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
- package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
- package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
- package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
- package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
- package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
- package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -76
- package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
- package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
- package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -186
- package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
- package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
- package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
- package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
- package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
- package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
- package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
- package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
- package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
- package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
- package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
- package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
- package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
- package/dist/node_modules/@allyhub-next/site/package.json +0 -25
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
- package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
- package/dist/site.d.ts +0 -2
- package/editor-web/assets/dist-Cg2PdedY.js +0 -6
- package/editor-web/assets/dist-CuW84oPe.js +0 -233
- package/editor-web/assets/dist-CxAS_vp7.js +0 -2
- package/editor-web/assets/dist-DCVaj9i1.js +0 -4
- package/editor-web/assets/dist-DGVUuVPB.js +0 -33
- package/editor-web/assets/dist-Yi3sy7Ea.js +0 -1
- package/editor-web/assets/index-B7S9RZhL.css +0 -2
- package/editor-web/assets/index-pwRfZ2Jv.js +0 -69
- package/editor-web/assets/minus-BizJdinJ.js +0 -1
- package/editor-web/assets/react-D54s6gwK.js +0 -101
- package/editor-web/assets/textarea-CvxipnGW.js +0 -105
- package/editor-web/assets/trash-2-Bq1Dt8XG.js +0 -1
- package/editor-web/assets/undo-2-Djhvu4xt.js +0 -1
- /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
|
@@ -76,7 +76,12 @@
|
|
|
76
76
|
"unpack": {
|
|
77
77
|
"default": "none",
|
|
78
78
|
"type": "string",
|
|
79
|
-
"enum": [
|
|
79
|
+
"enum": [
|
|
80
|
+
"none",
|
|
81
|
+
"zip",
|
|
82
|
+
"tgz",
|
|
83
|
+
"dmg"
|
|
84
|
+
]
|
|
80
85
|
},
|
|
81
86
|
"name": {
|
|
82
87
|
"type": "string",
|
|
@@ -97,7 +102,10 @@
|
|
|
97
102
|
"pattern": "^[0-9a-f]{64}$"
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
|
-
"required": [
|
|
105
|
+
"required": [
|
|
106
|
+
"path",
|
|
107
|
+
"sha256"
|
|
108
|
+
],
|
|
101
109
|
"additionalProperties": false
|
|
102
110
|
}
|
|
103
111
|
},
|
|
@@ -118,17 +126,29 @@
|
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
},
|
|
121
|
-
"required": [
|
|
129
|
+
"required": [
|
|
130
|
+
"url",
|
|
131
|
+
"sha256",
|
|
132
|
+
"size"
|
|
133
|
+
],
|
|
122
134
|
"additionalProperties": false
|
|
123
135
|
}
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
138
|
},
|
|
127
|
-
"required": [
|
|
139
|
+
"required": [
|
|
140
|
+
"about",
|
|
141
|
+
"version",
|
|
142
|
+
"license",
|
|
143
|
+
"platforms"
|
|
144
|
+
],
|
|
128
145
|
"additionalProperties": false
|
|
129
146
|
}
|
|
130
147
|
}
|
|
131
148
|
},
|
|
132
|
-
"required": [
|
|
149
|
+
"required": [
|
|
150
|
+
"version",
|
|
151
|
+
"runtimes"
|
|
152
|
+
],
|
|
133
153
|
"additionalProperties": false
|
|
134
154
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import{mkdir as c,readFile as y,writeFile as d}from"node:fs/promises";import{basename as f,join as a,resolve as h}from"node:path";export const PROJECT_PACKAGES={cli:"allyhub",sdk:"@allyhub/sdk"},PROJECT_TYPESCRIPT="~5.9.3",PROJECT_GITIGNORE=`node_modules/
|
|
3
3
|
.allyhub/
|
|
4
4
|
.playwright-cli/
|
|
5
|
-
`,SDK_DOCS=[["project.md","folders, items and entry files, imports, scripts and shared text, allyhub.config.ts, fonts"],["contract.md","a frame drawn from its time alone, drawn offline, problems and their rules"],["video.md","video(), formats, part(), layers and stacking, transitions, the look, capture, post"],["layers.md","defineComponent(), custom(), the layer's ctx, DOM, animation, path, noise and input helpers, starter components"],["speech.md","take(), say(), word references, anchors, shown and said, captions, edits files"],["sound.md","music, sound effects, the mix, the master, mic"],["footage.md","footage(): placing, cropping, reframing, faces and mattes, a video item inside another"],["slides.md","slides(), layouts, slides.yaml's pages and what is placed on them, steps, speaker notes"],["batches.md","the matrix: dimensions, slots, pools, rules, combos"],["scenery.md","3D sceneries: defineScenery(), cameras and moves, the scenery() layer, screens"],["modeling.md","props modelled in code with @allyhub-next/model"],["docs.md","a doc (doc.mdx): its title, the Markdown and tags it reads, pictures and links, comments"],["sheets.md","a sheet (sheet.yaml and CSV): Excel's model as text, the openpyxl API, formulas, tables, names, checks, sheet.ts, scenarios, calc, trace, render"],["defaults.md","every default of the piece API and the option that changes it"]],REGISTRY="https://allyhub.com/r",MASTER_SKILL="allyhub";export function workSkills(t){return t.filter(e=>e.type==="allyhub:skill"&&e.name!==MASTER_SKILL).map(e=>({name:e.name,description:e.description.replaceAll(/\s+/gu," ").trim()}))}export const AGENT_RULES_BEGIN="<!-- BEGIN:allyhub-agent-rules -->",AGENT_RULES_END="<!-- END:allyhub-agent-rules -->";export function agentRules(){return[AGENT_RULES_BEGIN,"",`Before writing or changing a video, a deck, a doc, a sheet, a 3D scenery or a 3D model, read the files it needs in the SDK's docs, for the version this project builds with: \`node_modules/${PROJECT_PACKAGES.sdk}/docs/\` once the project has installed it; without it, \`allyhub help\` says where they are (the SDK the CLI lends). The API has changed from what you may know; the docs and the SDK's types are right.`,"",...SDK_DOCS.map(([t,e])=>`- ${t}: ${e}`),"","`allyhub help` lists AllyHub's commands (`npx allyhub help` once the project has installed it); `allyhub help <command>` says what one does.","","`allyhub skills` lists AllyHub's work skills, each how to make one kind of work; `allyhub skills show <name>` prints one, `allyhub add skill/<name>` adds it to this project.","",AGENT_RULES_END].join(`
|
|
5
|
+
`,SDK_DOCS=[["project.md","folders, items and entry files, imports, scripts and shared text, allyhub.config.ts, fonts"],["contract.md","a frame drawn from its time alone, drawn offline, problems and their rules"],["video.md","video(), formats, part(), layers and stacking, transitions, the look, capture, post"],["layers.md","defineComponent(), custom(), the layer's ctx, DOM, animation, path, noise and input helpers, starter components"],["speech.md","take(), say(), word references, anchors, shown and said, captions, edits files"],["sound.md","music, sound effects, the mix, the master, mic"],["footage.md","footage(): placing, cropping, reframing, faces and mattes, a video item inside another"],["slides.md","slides(), layouts, slides.yaml's pages and what is placed on them, steps, speaker notes"],["batches.md","the matrix: dimensions, slots, pools, rules, combos"],["scenery.md","3D sceneries: defineScenery(), cameras and moves, the scenery() layer, screens"],["modeling.md","props modelled in code with @allyhub-next/model"],["docs.md","a doc (doc.mdx): its title, the Markdown and tags it reads, pictures and links, comments"],["sheets.md","a sheet (sheet.yaml and CSV): Excel's model as text, the openpyxl API, formulas, tables, names, checks, sheet.ts, scenarios, calc, trace, render"],["websites.md","a website, any web project with website.json: how Studio serves it ($PORT, $HOST, the preview hosts), videos in its pages, its build"],["defaults.md","every default of the piece API and the option that changes it"]],REGISTRY="https://allyhub.com/r",MASTER_SKILL="allyhub";export function workSkills(t){return t.filter(e=>e.type==="allyhub:skill"&&e.name!==MASTER_SKILL).map(e=>({name:e.name,description:e.description.replaceAll(/\s+/gu," ").trim()}))}export const AGENT_RULES_BEGIN="<!-- BEGIN:allyhub-agent-rules -->",AGENT_RULES_END="<!-- END:allyhub-agent-rules -->";export function agentRules(){return[AGENT_RULES_BEGIN,"",`Before writing or changing a video, a deck, a doc, a sheet, a 3D scenery or a 3D model, read the files it needs in the SDK's docs, for the version this project builds with: \`node_modules/${PROJECT_PACKAGES.sdk}/docs/\` once the project has installed it; without it, \`allyhub help\` says where they are (the SDK the CLI lends). The API has changed from what you may know; the docs and the SDK's types are right.`,"",...SDK_DOCS.map(([t,e])=>`- ${t}: ${e}`),"","`allyhub help` lists AllyHub's commands (`npx allyhub help` once the project has installed it); `allyhub help <command>` says what one does.","","`allyhub skills` lists AllyHub's work skills, each how to make one kind of work; `allyhub skills show <name>` prints one, `allyhub add skill/<name>` adds it to this project.","",AGENT_RULES_END].join(`
|
|
6
6
|
`)}export function projectAgents(){return`# AllyHub project
|
|
7
7
|
|
|
8
|
-
This folder is an AllyHub project. Videos, 3D sceneries and 3D models are TypeScript, docs MDX, sheets YAML and CSV: each is a folder with its entry file (\`video.ts\`, \`scenery.ts\`, \`model.ts\`, \`doc.mdx\`, \`sheet.yaml\`), wherever it suits the project; a model is made once and put in any scenery that imports it.
|
|
8
|
+
This folder is an AllyHub project. Videos, 3D sceneries and 3D models are TypeScript, docs MDX, sheets YAML and CSV, and a website any web project: each is a folder with its entry file (\`video.ts\`, \`scenery.ts\`, \`model.ts\`, \`doc.mdx\`, \`sheet.yaml\`, a website's \`website.json\`), wherever it suits the project; a model is made once and put in any scenery that imports it.
|
|
9
9
|
|
|
10
10
|
- A video or a scenery is code: where the project has no package.json yet, \`npm create allyhub@latest .\` then \`npm install\`.
|
|
11
11
|
|
|
12
12
|
${agentRules()}
|
|
13
13
|
`}export const PROJECT_CLAUDE=`@AGENTS.md
|
|
14
14
|
`,PROJECT_TSCONFIG=`${JSON.stringify({compilerOptions:{target:"ES2022",module:"ESNext",moduleResolution:"Bundler",lib:["ES2022","DOM","DOM.Iterable"],types:[`${PROJECT_PACKAGES.sdk}/client`,`${PROJECT_PACKAGES.cli}/client`],strict:!0,noEmit:!0,skipLibCheck:!0,verbatimModuleSyntax:!0,allowImportingTsExtensions:!0},include:["**/*.ts",".allyhub/cache/types"],exclude:["node_modules"]},null,2)}
|
|
15
|
-
`;export function packageName(t){const e=t.toLowerCase().normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^\w.-]+/gu,"-").replace(/^[-._]+|[-._]+$/gu,"").slice(0,214);return e===""?"allyhub-project":e}const l=t=>y(t).then(()=>!0,()=>!1);export async function writeAgentFiles(t){const e=h(t);await c(e,{recursive:!0});const s=[];for(const[n,
|
|
16
|
-
`],["tsconfig.json",PROJECT_TSCONFIG],[".gitignore",PROJECT_GITIGNORE]];await c(s,{recursive:!0});const
|
|
15
|
+
`;export function packageName(t){const e=t.toLowerCase().normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^\w.-]+/gu,"-").replace(/^[-._]+|[-._]+$/gu,"").slice(0,214);return e===""?"allyhub-project":e}const l=t=>y(t).then(()=>!0,()=>!1);export async function writeAgentFiles(t){const e=h(t);await c(e,{recursive:!0});const s=[];for(const[n,i]of[["AGENTS.md",projectAgents()],["CLAUDE.md",PROJECT_CLAUDE]])await l(a(e,n))||(await d(a(e,n),i,{flag:"wx"}),s.push(n));return s}export async function startProject(t,e){const s=h(t);if(await l(a(s,"package.json")))throw new Error(`${s} already has a package.json: add AllyHub to it with npm install ${PROJECT_PACKAGES.cli} ${PROJECT_PACKAGES.sdk}.`);const n=packageName(f(s)),i=o=>e.packages?.[o]??e.version,p={name:n,version:"0.0.0",private:!0,type:"module",scripts:{dev:"allyhub dev",check:"allyhub check",render:"allyhub render",typecheck:"tsc --noEmit"},dependencies:{[PROJECT_PACKAGES.cli]:i(PROJECT_PACKAGES.cli),[PROJECT_PACKAGES.sdk]:i(PROJECT_PACKAGES.sdk)},devDependencies:{typescript:PROJECT_TYPESCRIPT}},m=[["package.json",`${JSON.stringify(p,null,2)}
|
|
16
|
+
`],["tsconfig.json",PROJECT_TSCONFIG],[".gitignore",PROJECT_GITIGNORE]];await c(s,{recursive:!0});const r=[];for(const[o,u]of m)await l(a(s,o))||(await d(a(s,o),u,{flag:"wx"}),r.push(o));return r.push(...await writeAgentFiles(s)),{folder:s,name:n,files:r}}
|
|
@@ -40,6 +40,14 @@ export declare function hostResolve(): Plugin;
|
|
|
40
40
|
export declare function sceneryModules(opts: {
|
|
41
41
|
root: string;
|
|
42
42
|
}): Plugin;
|
|
43
|
+
/** The folder of a scenery build that a stage serves as the tree's `scenery/`. */
|
|
44
|
+
export declare const SCENERY_STAGE = "stage";
|
|
45
|
+
/**
|
|
46
|
+
* A path of a scenery bundle (as SceneryBundle names it) from the tree's
|
|
47
|
+
* `scenery/` folder: its modules are one folder below it, as a piece's
|
|
48
|
+
* are below `build/`, so they reach the tree's `media/` the same way.
|
|
49
|
+
*/
|
|
50
|
+
export declare const sceneryHref: (path: string) => string;
|
|
43
51
|
export interface SceneryBundle {
|
|
44
52
|
/** The bundle's file, relative to the build folder. */
|
|
45
53
|
module: string;
|
|
@@ -51,6 +59,8 @@ export interface SceneryBundle {
|
|
|
51
59
|
xatlasWasm: string;
|
|
52
60
|
/** The project's files bundled into it (project paths). */
|
|
53
61
|
files: string[];
|
|
62
|
+
/** What this bundle wrote that a page loads (its chunks, stylesheets and assets), named as `module` is. */
|
|
63
|
+
output: string[];
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Bundles a scenery module (a project path) with this package's page half
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{realpathSync as
|
|
2
|
+
import{realpathSync as g}from"node:fs";import{cp as S,copyFile as p,mkdir as y,writeFile as v}from"node:fs/promises";import{createRequire as W}from"node:module";import{dirname as u,join as o,relative as E,sep as h}from"node:path";import{fileURLToPath as f}from"node:url";import{bundleForStage as j}from"@allyhub-next/build";import{entryKind as D}from"@allyhub-next/formats";import{manifoldFiles as w}from"@allyhub-next/model/build";export{stageCameras,writeModelStage}from"./model-stage.js";export const THREE_LIBS="three-libs",WASM_DIR="wasm";const i="@allyhub-next/scenery-host",F="manifold-3d/manifold",N=new Set(["three"]),O=W(import.meta.url);export function threeLibsDir(){return u(u(f(import.meta.resolve("three/addons/libs/draco/draco_decoder.wasm"))))}export async function manifoldWasmFile(){return(await w()).wasm}export function xatlasWasmFile(){return O.resolve("xatlas-web/dist/xatlas-web.wasm")}export async function copyDecoders(e){const r=threeLibsDir();for(const t of["draco","basis"])await S(o(r,t),o(e,THREE_LIBS,t),{recursive:!0})}function T(e){const r=e.split("/");return e.startsWith("@")?r.slice(0,2).join("/"):r[0]??e}export function lendThree(e){return{name:"allyhub-scenery-three",enforce:"pre",resolveId(r){const t=T(r);if(!N.has(t)||e.dependencies.has(t))return null;try{return f(import.meta.resolve(r))}catch{return null}}}}export function lendManifold(){return{name:"allyhub-scenery-manifold",enforce:"pre",async resolveId(e){return e===F?(await w()).js:null}}}export function hostResolve(){return{name:"allyhub-scenery-host",enforce:"pre",resolveId(e){return e!==i&&!e.startsWith(`${i}/`)?null:f(import.meta.resolve(e))}}}const $=/(^|\n)export default\s+/;function b(e){let r=e;try{r=g(e)}catch{}return t=>{for(const a of[r,e]){const n=E(a,t).split(h).join("/");if(!n.startsWith("..")&&!n.startsWith("/"))return n}}}export function sceneryModules(e){const r=b(e.root);return{name:"allyhub-scenery-modules",enforce:"post",transform(t,a){const n=r(a.replace(/[?#].*$/,""));return n===void 0||D(n)!=="scenery"||!$.test(t)?null:{code:`${t.replace($,"$1const __allyhubScenery = ")}
|
|
3
3
|
import { markScenery as __allyhubMark } from ${JSON.stringify(`${i}/module`)};
|
|
4
4
|
export default __allyhubMark(__allyhubScenery, ${JSON.stringify(n)});
|
|
5
|
-
`,map:null}}}}const
|
|
6
|
-
`));const n=o(e.outDir,
|
|
5
|
+
`,map:null}}}}export const SCENERY_STAGE="stage",sceneryHref=e=>e.startsWith(`${SCENERY_STAGE}/`)?e.slice(SCENERY_STAGE.length+1):e;const k=e=>e.replace(/\.[^.]+$/,"").replace(/[^A-Za-z0-9]+/g,"_").replace(/^_+|_+$/g,"");export async function bundleScenery(e){const r=`scenery__${k(e.file)}`,t=o(e.outDir,"sceneries",`${r}.entry.js`);await y(u(t),{recursive:!0});const a=o(e.root,e.file).split(h).join("/");await v(t,["// Written by allyhub for a scenery page: the scenery and its host, one bundle.",`export { default as scenery } from ${JSON.stringify(a)};`,`export * from ${JSON.stringify(i)};`,""].join(`
|
|
6
|
+
`));const n=o(e.outDir,SCENERY_STAGE),l=await j({root:e.root,entries:{[r]:t},outDir:n,plugins:[hostResolve(),lendManifold(),lendThree({dependencies:e.dependencies}),sceneryModules({root:e.root}),...e.plugins],...e.user?{user:e.user}:{}}),m=l.entries[r];if(!m)throw new Error(`The scenery ${e.file} did not bundle.`);const x=b(e.root),d=new Set;for(const c of Object.values(l.chunks))for(const _ of c.modules){const s=x(_.replace(/[?#].*$/,""));s!==void 0&&!s.includes("node_modules")&&!s.startsWith(".allyhub/")&&d.add(s)}return await y(o(n,WASM_DIR),{recursive:!0}),await p(await manifoldWasmFile(),o(n,WASM_DIR,"manifold.wasm")),await p(xatlasWasmFile(),o(n,WASM_DIR,"xatlas.wasm")),await copyDecoders(n),{module:`${SCENERY_STAGE}/${m.file}`,decoders:`${SCENERY_STAGE}/${THREE_LIBS}/`,manifoldWasm:`${SCENERY_STAGE}/${WASM_DIR}/manifold.wasm`,xatlasWasm:`${SCENERY_STAGE}/${WASM_DIR}/xatlas.wasm`,files:[...d].sort(),output:l.files.map(c=>`${SCENERY_STAGE}/${c}`)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{publicNames as n}from"@allyhub-next/formats";import{FUNCTIONS as h}from"../calc/functions/index.js";import{AreaChart as d,BarChart as p,DataLabelList as m,DoughnutChart as c,GraphicalProperties as w,Legend as f,LineChart as u,LineProperties as y,Marker as
|
|
2
|
+
import{publicNames as n}from"@allyhub-next/formats";import{FUNCTIONS as h}from"../calc/functions/index.js";import{AreaChart as d,BarChart as p,DataLabelList as m,DoughnutChart as c,GraphicalProperties as w,Legend as f,LineChart as u,LineProperties as y,Marker as g,NumericAxis as b,PieChart as k,Reference as _,ScatterChart as x,Scaling as C,Series as A,TextAxis as S}from"./charts.js";import{AutoFilter as v,ConditionalFormattingList as D,DataValidation as P,DataValidationList as F,DifferentialStyle as L,Rule as T}from"./rules.js";import{Alignment as R,Border as I,Color as N,Font as E,PatternFill as V,Side as B}from"./styles.js";import{Cell as W,ColumnDimension as j,DefinedName as G,DefinedNameDict as H,RowDimension as M,Table as O,TableList as U,Workbook as z,Worksheet as q}from"./workbook.js";import{Comment as X,HeaderFooter as J,HeaderFooterPart as K,Image as Q,PageMargins as Y,PageSetup as Z,SheetProtection as $}from"./page.js";const a={Series:{title:"A series' name in words, openpyxl's SeriesFactory argument, kept here as a field."},Workbook:{open:"Workbook.open(dir): a workbook's folder read (load_workbook(dir) is the same).",block_cells:"How many typed cells together go in a CSV file of their own: 100 unless set.",title:"The workbook's title, sheet.yaml's.",check:"wb.check(): what allyhub check would say of the workbook as it stands: a list of { file, line, message }."},Cell:{computed:"What the cell computes to, the workbook as it stands, saved or not."},Table:{key:"The column that lines rows up when two hands' changes merge."},DataValidation:{multiple:"A list's cell may hold several of its values, joined by separator: an .xlsx keeps them as text.",separator:"What joins a cell's choices: a comma and a space unless set."},PageSetup:{fitToWidth:"Pages wide; setting it or fitToHeight fits the sheet, with no pageSetUpPr to set."},ColumnDimension:{files:"Its cells name files, from the sheet's folder: true, or { separator, height }."}},ee=["add_data","set_categories","append","title","legend","width","height","style","anchor","series","dataLabels","x_axis","y_axis"],te={BarChart:["type","grouping","overlap","gapWidth","varyColors"],LineChart:["grouping"],AreaChart:["grouping"],PieChart:["varyColors"],DoughnutChart:["holeSize"],ScatterChart:[]},oe={Workbook:z.prototype,Worksheet:q.prototype,Cell:W.prototype,Font:E.prototype,PatternFill:V.prototype,Border:I.prototype,Side:B.prototype,Alignment:R.prototype,Color:N.prototype,Table:O.prototype,TableList:U.prototype,DefinedName:G.prototype,DefinedNameDict:H.prototype,ColumnDimension:j.prototype,RowDimension:M.prototype,ConditionalFormattingList:D.prototype,Rule:T.prototype,DifferentialStyle:L.prototype,DataValidation:P.prototype,DataValidationList:F.prototype,AutoFilter:v.prototype,BarChart:p.prototype,LineChart:u.prototype,AreaChart:d.prototype,PieChart:k.prototype,DoughnutChart:c.prototype,ScatterChart:x.prototype,Reference:_.prototype,Series:A.prototype,Legend:f.prototype,Scaling:C.prototype,TextAxis:S.prototype,NumericAxis:b.prototype,DataLabelList:m.prototype,Marker:g.prototype,GraphicalProperties:w.prototype,LineProperties:y.prototype,PageSetup:Z.prototype,PageMargins:Y.prototype,_HeaderFooterItem:J.prototype,_HeaderFooterPart:K.prototype,SheetProtection:$.prototype,Comment:X.prototype,Image:Q.prototype},r=["title","scaling","majorUnit","number_format","delete","majorGridlines"],ae={_HeaderFooterItem:["left","center","right"],Comment:["text","author"],Image:["path","width","height","anchor"],Workbook:["worksheets","defined_names","data_only","path","title","block_cells"],Cell:["row","column"],Worksheet:["min_row","min_column"],Font:["name","size","bold","italic","underline","strike","color"],PatternFill:["fill_type","fgColor","bgColor"],Border:["left","right","top","bottom"],Side:["style","color"],Alignment:["horizontal","vertical","wrap_text","shrink_to_fit","indent","text_rotation"],Color:["rgb"],Table:["displayName","ref","key","autoFilter"],DefinedName:["name","attr_text"],ColumnDimension:["index"],RowDimension:["index"],Rule:["type","operator","formula","stopIfTrue","rank","percent","bottom","aboveAverage","equalAverage","text","dxf"],DifferentialStyle:["font","fill","border"],DataValidation:["type","formula1","formula2","operator","allow_blank","showDropDown","showErrorMessage","showInputMessage","errorStyle","errorTitle","error","promptTitle","prompt","sqref"],DataValidationList:["dataValidation"],AutoFilter:["ref"],...Object.fromEntries(Object.entries(te).map(([e,t])=>[e,[...ee.filter(o=>!(/^(?:Pie|Doughnut)/u.test(e)&&o.endsWith("_axis"))),...t]])),Reference:["worksheet","min_col","min_row","max_col","max_row"],Series:["val","xVal","title","smooth","marker","graphicalProperties"],Legend:["position"],Scaling:["min","max","orientation"],TextAxis:r.filter(e=>e!=="majorUnit"),NumericAxis:r,DataLabelList:["showVal","showPercent","showCatName","showSerName","dLblPos"],Marker:["symbol","size"],GraphicalProperties:["solidFill","noFill","line"],LineProperties:["width","solidFill","noFill"]};export const HELPERS=["CellIsRule","ColorScaleRule","DataBarRule","FormulaRule","IconSetRule","column_index_from_string","coordinate_to_tuple","get_column_letter","range_boundaries"];const re=()=>{const e={};for(const[t,o]of Object.entries(oe)){const i=a[t]??{};e[t]=[...n(o),...ae[t]??[]].filter(l=>!Object.hasOwn(i,l)).sort()}return e},s=e=>[...h.values()].filter(t=>t.from===e).map(t=>t.name).sort();export const CAPABILITIES={reference:{library:"openpyxl",version:"3.1.5",docs:"https://openpyxl.readthedocs.io/"},holds:re(),functions:HELPERS,differs:["A workbook is a folder, not a file: load_workbook(dir) reads sheet.yaml and its CSV files, wb.save(dir) writes them, and only what changed is written. This API does not read or write .xlsx: allyhub sheet import and allyhub render --type xlsx do.","A keyword argument of openpyxl's is a field of an object: new Font({ bold: true }), new Table({ displayName, ref }), new DefinedName(name, { attr_text }). Classes are made with new.","A name openpyxl has that is not held throws where it is used, naming what the class holds. ws['A1'], ws['A1:B2'], ws['A'], ws[1], wb['Sheet'], ws.tables['t'], wb.defined_names['n'], ws.column_dimensions['A'] and ws.row_dimensions[1] are held; in TypeScript ws['A1'] is typed as a Cell, so write ws['A1'].value = v (ws['A1'] = v works at run time), and wb.get_sheet_by_name(name) is typed where wb[name] is not.","Rows and columns count from 1, as openpyxl's. iter_rows, rows, columns and values give arrays, not generators.","A colour is #RRGGBB; RRGGBB and AARRGGBB are taken, the alpha left out. Theme colours are not held.","cell.value of a date is a Date (read in UTC), a formula's its text, and with load_workbook(dir, { data_only: true }) what it computes to, which openpyxl reads from a file's cache and this computes.","column_dimensions' width is Excel's unit and row_dimensions' height points, as openpyxl's; the file holds pixels.","ws.merged_cells is an array of each merged range's text.","A table's rows are its CSV file, so ws.add_table(new Table({ displayName, ref })) moves the cells of ref there; its header row names its columns. A column whose every row has one formula, moved, is written as a calculated column.","A run of cells with one formula, moved, is written as one range key, and at least wb.block_cells typed cells together in a CSV file of their own (a block).","ws.title = 'New' renames the sheet in every formula, which openpyxl leaves to you.","ws.insert_rows, delete_rows, insert_cols and delete_cols rewrite every formula of the workbook as Excel does (a reference moves, a range grows or shrinks, one to what went is #REF!), move tables, blocks, merges and looks, and take rows and columns in or out of a table's CSV file. openpyxl moves cells and leaves formulas as they were. A table's header row is not deleted unless all of the table is.","A string that reads as another value (=, 12%, 2026-01-01) stays text, as openpyxl's does: its cell is written with a leading ' unless it starts with =, which makes it a formula.","A DataValidation refuses what breaks it and shows its prompt unless showErrorMessage or showInputMessage is false, as Excel's dialog starts: openpyxl's leave both off. A list's cell keeps its blank unless allow_blank is false.","ws.auto_filter.ref and add_filter_column say what a filter keeps, and the rows it leaves out are worked out from that, never written: a file made by openpyxl hides nothing until Excel reapplies it. A table has its own, table.autoFilter. add_sort_condition is not held: sorting is the rows of the files in order.","A chart reads its cells live, whatever else is in the file: there is no cache to refresh. chart.add_data and set_categories, and Series, take a Reference or a formula's text for a table's column or a spill, as add_data('orders[total]', { title: 'Total' }) or set_categories('orders[month]'), since a Reference cannot name one.","Series is made with new Series(values, { xvalues, title, title_from_data }); openpyxl's is the SeriesFactory function.","A chart's width and height are centimetres, as openpyxl's; the file holds pixels, and anchor a cell: ws.add_chart(chart, 'E2').","A LineChart's grouping is standard; a stacked area is an AreaChart. Chart styles are kept but draw nothing, as sheet.yaml has no place for them: chart.style is only read.","ws._charts lists a sheet's charts, those read from sheet.yaml among them, as the classes above.","In a rule, a fill's bgColor paints, or its fgColor where it has none. A rule's font holds bold, italic, underline, strike and a colour; alignment and number formats in a rule are not held.","workbook((wb, { data }) => { … }), the default export of an item's sheet.ts, makes sheets with these classes, on a workbook of its own that starts with none. They are made again from the code wherever the workbook is read, never saved: wb.save throws there."],adds:a,formulas:{own:s("allyhub"),formulajs:s("formulajs")}};
|
|
@@ -4,4 +4,5 @@ export { AutoFilter, CellIsRule, ColorScaleRule, ConditionalFormattingList, Data
|
|
|
4
4
|
export { AreaChart, BarChart, ChartBase, DataLabelList, DoughnutChart, GraphicalProperties, Legend, LineChart, LineProperties, Marker, NumericAxis, PieChart, Reference, ScatterChart, Scaling, Series, TextAxis, type BarChartOptions, type ChartData, type ReferenceOptions, type SeriesOptions, } from "./charts.js";
|
|
5
5
|
export { CAPABILITIES, HELPERS, type Capabilities } from "./capabilities.js";
|
|
6
6
|
export { WORKBOOK_BRAND, isSheetCode, workbook, type SheetCode, type SheetCodeBuild, type SheetCodeContext, } from "./code.js";
|
|
7
|
+
export { Comment, HeaderFooter, Image, PageMargins, PageSetup, SheetProtection, } from "./page.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{Alignment,Border,Color,Font,PatternFill,Side}from"./styles.js";export{BLOCK_CELLS,Cell,ColumnDimension,DefinedName,DefinedNameDict,RowDimension,Table,TableList,Workbook,Worksheet,column_index_from_string,coordinate_to_tuple,get_column_letter,load_workbook,range_boundaries}from"./workbook.js";export{AutoFilter,CellIsRule,ColorScaleRule,ConditionalFormattingList,DataBarRule,DataValidation,DataValidationList,DifferentialStyle,FormulaRule,IconSetRule,Rule}from"./rules.js";export{AreaChart,BarChart,ChartBase,DataLabelList,DoughnutChart,GraphicalProperties,Legend,LineChart,LineProperties,Marker,NumericAxis,PieChart,Reference,ScatterChart,Scaling,Series,TextAxis}from"./charts.js";export{CAPABILITIES,HELPERS}from"./capabilities.js";export{WORKBOOK_BRAND,isSheetCode,workbook}from"./code.js";
|
|
2
|
+
export{Alignment,Border,Color,Font,PatternFill,Side}from"./styles.js";export{BLOCK_CELLS,Cell,ColumnDimension,DefinedName,DefinedNameDict,RowDimension,Table,TableList,Workbook,Worksheet,column_index_from_string,coordinate_to_tuple,get_column_letter,load_workbook,range_boundaries}from"./workbook.js";export{AutoFilter,CellIsRule,ColorScaleRule,ConditionalFormattingList,DataBarRule,DataValidation,DataValidationList,DifferentialStyle,FormulaRule,IconSetRule,Rule}from"./rules.js";export{AreaChart,BarChart,ChartBase,DataLabelList,DoughnutChart,GraphicalProperties,Legend,LineChart,LineProperties,Marker,NumericAxis,PieChart,Reference,ScatterChart,Scaling,Series,TextAxis}from"./charts.js";export{CAPABILITIES,HELPERS}from"./capabilities.js";export{WORKBOOK_BRAND,isSheetCode,workbook}from"./code.js";export{Comment,HeaderFooter,Image,PageMargins,PageSetup,SheetProtection}from"./page.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type SheetHeaderFooter, type SheetNote, type SheetPrint } from "@allyhub-next/formats";
|
|
2
|
+
/** What a page object changes: the sheet's `print`, and that it changed. */
|
|
3
|
+
export interface PageHost {
|
|
4
|
+
_print: SheetPrint;
|
|
5
|
+
_changed(): void;
|
|
6
|
+
}
|
|
7
|
+
/** openpyxl's `PrintPageSetup`. */
|
|
8
|
+
export declare class PageSetup {
|
|
9
|
+
private readonly ws;
|
|
10
|
+
constructor(ws: PageHost);
|
|
11
|
+
get orientation(): SheetPrint["orientation"];
|
|
12
|
+
set orientation(v: SheetPrint["orientation"]);
|
|
13
|
+
/** Excel's number (9 is A4), or a name: letter, legal, a3, a4, a5. */
|
|
14
|
+
get paperSize(): number | undefined;
|
|
15
|
+
set paperSize(v: number | string | undefined);
|
|
16
|
+
get fitToWidth(): number | undefined;
|
|
17
|
+
/** Pages wide. Setting it fits the sheet: openpyxl's pageSetUpPr.fitToPage is not asked for. */
|
|
18
|
+
set fitToWidth(v: number | undefined);
|
|
19
|
+
get fitToHeight(): number | undefined;
|
|
20
|
+
/** Pages tall; 0 as many as it takes. */
|
|
21
|
+
set fitToHeight(v: number | undefined);
|
|
22
|
+
private _fit;
|
|
23
|
+
}
|
|
24
|
+
/** openpyxl's `PageMargins`, in inches. */
|
|
25
|
+
export declare class PageMargins {
|
|
26
|
+
private readonly ws;
|
|
27
|
+
constructor(ws: PageHost);
|
|
28
|
+
private _set;
|
|
29
|
+
get left(): number | undefined;
|
|
30
|
+
set left(v: number | undefined);
|
|
31
|
+
get right(): number | undefined;
|
|
32
|
+
set right(v: number | undefined);
|
|
33
|
+
get top(): number | undefined;
|
|
34
|
+
set top(v: number | undefined);
|
|
35
|
+
get bottom(): number | undefined;
|
|
36
|
+
set bottom(v: number | undefined);
|
|
37
|
+
get header(): number | undefined;
|
|
38
|
+
set header(v: number | undefined);
|
|
39
|
+
get footer(): number | undefined;
|
|
40
|
+
set footer(v: number | undefined);
|
|
41
|
+
}
|
|
42
|
+
/** openpyxl's `_HeaderFooterPart`: its `text`, Excel's codes holding. */
|
|
43
|
+
export declare class HeaderFooterPart {
|
|
44
|
+
private readonly ws;
|
|
45
|
+
private readonly kind;
|
|
46
|
+
private readonly side;
|
|
47
|
+
constructor(ws: PageHost, kind: "header" | "footer", side: keyof SheetHeaderFooter);
|
|
48
|
+
get text(): string | undefined;
|
|
49
|
+
set text(v: string | undefined);
|
|
50
|
+
}
|
|
51
|
+
/** openpyxl's `_HeaderFooterItem`: a header's or a footer's three parts. */
|
|
52
|
+
export declare class HeaderFooter {
|
|
53
|
+
readonly left: HeaderFooterPart;
|
|
54
|
+
readonly center: HeaderFooterPart;
|
|
55
|
+
readonly right: HeaderFooterPart;
|
|
56
|
+
constructor(ws: PageHost, kind: "header" | "footer");
|
|
57
|
+
}
|
|
58
|
+
/** openpyxl's `SheetProtection`, with no password. */
|
|
59
|
+
export declare class SheetProtection {
|
|
60
|
+
private readonly read;
|
|
61
|
+
private readonly write;
|
|
62
|
+
constructor(read: () => boolean, write: (on: boolean) => void);
|
|
63
|
+
get sheet(): boolean;
|
|
64
|
+
set sheet(on: boolean);
|
|
65
|
+
enable(): void;
|
|
66
|
+
disable(): void;
|
|
67
|
+
}
|
|
68
|
+
/** openpyxl's `Comment`: Excel's Note. */
|
|
69
|
+
export declare class Comment {
|
|
70
|
+
readonly text: string;
|
|
71
|
+
readonly author: string | undefined;
|
|
72
|
+
constructor(text: string, author?: string);
|
|
73
|
+
_file(): SheetNote;
|
|
74
|
+
}
|
|
75
|
+
/** openpyxl's `Image`: a picture over the cells, a path from the sheet's folder. */
|
|
76
|
+
export declare class Image {
|
|
77
|
+
readonly path: string;
|
|
78
|
+
width: number | undefined;
|
|
79
|
+
height: number | undefined;
|
|
80
|
+
anchor: string | undefined;
|
|
81
|
+
constructor(path: string);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=page.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_PAPERS as h,strict as s}from"@allyhub-next/formats";import{HINT as r}from"./hint.js";export class PageSetup{ws;constructor(t){return this.ws=t,s(this,"PageSetup",r)}get orientation(){return this.ws._print.orientation}set orientation(t){t===void 0?delete this.ws._print.orientation:this.ws._print.orientation=t,this.ws._changed()}get paperSize(){const{paper:t}=this.ws._print;return t===void 0?void 0:h[t]}set paperSize(t){const e=Object.keys(h).find(i=>i===t||String(h[i])===String(t));if(t===void 0)delete this.ws._print.paper;else if(e)this.ws._print.paper=e;else throw new RangeError(`Paper is one of ${Object.keys(h).join(", ")}, not ${String(t)}.`);this.ws._changed()}get fitToWidth(){return this.ws._print.fit?.width}set fitToWidth(t){this._fit("width",t)}get fitToHeight(){return this.ws._print.fit?.height}set fitToHeight(t){this._fit("height",t)}_fit(t,e){const i={...this.ws._print.fit};e===void 0?Reflect.deleteProperty(i,t):i[t]=e,Object.keys(i).length===0?delete this.ws._print.fit:this.ws._print.fit=i,this.ws._changed()}}export class PageMargins{ws;constructor(t){return this.ws=t,s(this,"PageMargins",r)}_set(t,e){const i={...this.ws._print.margins};e===void 0?Reflect.deleteProperty(i,t):i[t]=e,this.ws._print.margins=i,this.ws._changed()}get left(){return this.ws._print.margins?.left}set left(t){this._set("left",t)}get right(){return this.ws._print.margins?.right}set right(t){this._set("right",t)}get top(){return this.ws._print.margins?.top}set top(t){this._set("top",t)}get bottom(){return this.ws._print.margins?.bottom}set bottom(t){this._set("bottom",t)}get header(){return this.ws._print.margins?.header}set header(t){this._set("header",t)}get footer(){return this.ws._print.margins?.footer}set footer(t){this._set("footer",t)}}export class HeaderFooterPart{ws;kind;side;constructor(t,e,i){return this.ws=t,this.kind=e,this.side=i,s(this,"_HeaderFooterPart",r)}get text(){return this.ws._print[this.kind]?.[this.side]}set text(t){const e={...this.ws._print[this.kind]};t===void 0?Reflect.deleteProperty(e,this.side):e[this.side]=t,this.ws._print[this.kind]=e,this.ws._changed()}}export class HeaderFooter{left;center;right;constructor(t,e){return this.left=new HeaderFooterPart(t,e,"left"),this.center=new HeaderFooterPart(t,e,"center"),this.right=new HeaderFooterPart(t,e,"right"),s(this,"_HeaderFooterItem",r)}}export class SheetProtection{read;write;constructor(t,e){return this.read=t,this.write=e,s(this,"SheetProtection",r)}get sheet(){return this.read()}set sheet(t){this.write(t)}enable(){this.write(!0)}disable(){this.write(!1)}}export class Comment{text;author;constructor(t,e){return this.text=t,this.author=e,s(this,"Comment",r)}_file(){return this.author===void 0?this.text:{text:this.text,author:this.author}}}export class Image{path;width;height;anchor;constructor(t){return this.path=t,this.width=void 0,this.height=void 0,this.anchor=void 0,s(this,"Image",r)}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type SheetConditional, type SheetFile, type SheetFilesColumn, type SheetTable, type SheetWorksheet } from "@allyhub-next/formats";
|
|
1
|
+
import { type SheetNote, type SheetPicture, type SheetPrint, type SheetConditional, type SheetFile, type SheetFilesColumn, type SheetTable, type SheetWorksheet } from "@allyhub-next/formats";
|
|
2
|
+
import { Comment, HeaderFooter, PageMargins, PageSetup, SheetProtection, type Image } from "./page.js";
|
|
2
3
|
import { Calc } from "../calc/engine.js";
|
|
3
4
|
import { type ParsedCsv } from "../csv.js";
|
|
4
5
|
import type { SheetProblem } from "../file.js";
|
|
@@ -36,6 +37,12 @@ export declare class Cell {
|
|
|
36
37
|
get computed(): CellValue;
|
|
37
38
|
get data_type(): string;
|
|
38
39
|
get is_date(): boolean;
|
|
40
|
+
/** What it opens: an address on the web, or `#Sheet!A1`. */
|
|
41
|
+
get hyperlink(): string | undefined;
|
|
42
|
+
set hyperlink(to: string | undefined);
|
|
43
|
+
/** Its note: Excel's Note, openpyxl's Comment. */
|
|
44
|
+
get comment(): Comment | undefined;
|
|
45
|
+
set comment(note: Comment | undefined);
|
|
39
46
|
get number_format(): string;
|
|
40
47
|
set number_format(code: string);
|
|
41
48
|
private _setLook;
|
|
@@ -55,8 +62,12 @@ export declare class ColumnDimension {
|
|
|
55
62
|
_width: number | undefined;
|
|
56
63
|
_hidden: boolean | undefined;
|
|
57
64
|
_files: SheetFilesColumn | undefined;
|
|
65
|
+
_level: number | undefined;
|
|
58
66
|
_ws: Worksheet;
|
|
59
67
|
constructor(ws: Worksheet, letter: string);
|
|
68
|
+
/** How deep it is grouped, Excel's outline, 1 to 7. */
|
|
69
|
+
get outlineLevel(): number | undefined;
|
|
70
|
+
set outlineLevel(level: number | undefined);
|
|
60
71
|
/** Its cells name files, not an openpyxl field: true, or how they join and how tall a picture is. */
|
|
61
72
|
get files(): SheetFilesColumn | undefined;
|
|
62
73
|
set files(files: SheetFilesColumn | undefined);
|
|
@@ -70,8 +81,12 @@ export declare class RowDimension {
|
|
|
70
81
|
readonly index: number;
|
|
71
82
|
_height: number | undefined;
|
|
72
83
|
_hidden: boolean | undefined;
|
|
84
|
+
_level: number | undefined;
|
|
73
85
|
_ws: Worksheet;
|
|
74
86
|
constructor(ws: Worksheet, row: number);
|
|
87
|
+
/** How deep it is grouped, Excel's outline, 1 to 7. */
|
|
88
|
+
get outlineLevel(): number | undefined;
|
|
89
|
+
set outlineLevel(level: number | undefined);
|
|
75
90
|
/** In points, as openpyxl's; the file holds pixels. */
|
|
76
91
|
get height(): number | undefined;
|
|
77
92
|
set height(points: number | undefined);
|
|
@@ -149,6 +164,11 @@ export declare class Worksheet {
|
|
|
149
164
|
_filter: AutoFilter;
|
|
150
165
|
/** Its charts, openpyxl's private list. */
|
|
151
166
|
_charts: ChartBase[];
|
|
167
|
+
_print: SheetPrint;
|
|
168
|
+
_links: Record<string, string>;
|
|
169
|
+
_notes: Record<string, SheetNote>;
|
|
170
|
+
_pictures: SheetPicture[];
|
|
171
|
+
_protect: boolean;
|
|
152
172
|
constructor(parent: Workbook, title: string, model?: ModelSheet);
|
|
153
173
|
_spec(): SheetWorksheet | undefined;
|
|
154
174
|
/** What sheet.yaml says of its rules and filter. */
|
|
@@ -210,6 +230,25 @@ export declare class Worksheet {
|
|
|
210
230
|
add_data_validation(data_validation: DataValidation): void;
|
|
211
231
|
/** The sheet's AutoFilter: set its ref to have one. A table has its own. */
|
|
212
232
|
get auto_filter(): AutoFilter;
|
|
233
|
+
_changed(): void;
|
|
234
|
+
/** `print`, `links`, `notes`, `pictures` and `protect` as sheet.yaml holds them. */
|
|
235
|
+
_heldPage(spec: SheetWorksheet | undefined): void;
|
|
236
|
+
get page_setup(): PageSetup;
|
|
237
|
+
get page_margins(): PageMargins;
|
|
238
|
+
get oddHeader(): HeaderFooter;
|
|
239
|
+
get oddFooter(): HeaderFooter;
|
|
240
|
+
get protection(): SheetProtection;
|
|
241
|
+
/** The range that prints. */
|
|
242
|
+
get print_area(): string | undefined;
|
|
243
|
+
set print_area(area: string | undefined);
|
|
244
|
+
/** Rows repeated on every page, as `1:2`. */
|
|
245
|
+
get print_title_rows(): string | undefined;
|
|
246
|
+
set print_title_rows(rows: string | undefined);
|
|
247
|
+
/** Columns repeated on every page, as `A:B`. */
|
|
248
|
+
get print_title_cols(): string | undefined;
|
|
249
|
+
set print_title_cols(columns: string | undefined);
|
|
250
|
+
/** A picture over the cells, at a cell: its anchor unless it says. */
|
|
251
|
+
add_image(image: Image, anchor?: string): void;
|
|
213
252
|
/** A chart at a cell: its anchor unless it says. */
|
|
214
253
|
add_chart(chart: ChartBase, anchor?: string): void;
|
|
215
254
|
add_table(table: Table): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{SHEET_DATA as H,SHEET_FILE as z,strict as g}from"@allyhub-next/formats";import{columnIndex as E,columnLetter as N,cellName as C,contains as L,rangeName as x,readAddress as b,readArea as k}from"../address.js";import{Calc as U}from"../calc/engine.js";import{checkWorkbook as G}from"../check.js";import{readCsv as V,writeCsv as Y}from"../csv.js";import{GENERATED as q}from"../generated.js";import{moveFormula as Q,relativeKey as X}from"../formula/move.js";import{parseFormula as F}from"../formula/parse.js";import{printFormula as A}from"../formula/print.js";import{rewriteFormula as Z}from"../formula/rewrite.js";import{isDateCode as S}from"../format.js";import{patchCsv as ee}from"../patch.js";import{CellError as P,dateOfSerial as te,isoOfSerial as se,readTyped as M,serialOfDate as oe,writeTyped as ne}from"../values.js";import{FormulaCell as re,readWorkbook as B,validName as W}from"../workbook.js";import{restructure as ie,tableShape as le}from"../structure.js";import{patchYaml as ae}from"../write.js";import{anchorOf as he,chartOfSpec as fe}from"./charts.js";import{HINT as w}from"./hint.js";import{rectangles as T}from"./rectangles.js";import{AutoFilter as I,ConditionalFormattingList as ce,DataValidationList as ue,validationOf as _e,validationSpec as de}from"./rules.js";import{alignmentLook as me,alignmentOf as pe,borderLook as we,borderOf as ge,fillLook as ke,fillOf as ye,fontLook as be,fontOf as ve}from"./styles.js";const K=()=>process.getBuiltinModule("node:fs"),$=(...l)=>process.getBuiltinModule("node:path").join(...l);export const BLOCK_CELLS=100;const xe=l=>Math.round(l*7+5),Ee=l=>(l-5)/7,Se=l=>l*4/3,$e=l=>l*3/4;function Ce(l,e){const t={},s=l,o=e;for(const n of new Set([...Object.keys(s),...Object.keys(o)])){const r=o[n];JSON.stringify(r??!1)!==JSON.stringify(s[n]??!1)&&(t[n]=r??!1)}return t}const p=l=>Object.keys(l).length===0,y=(l,e)=>{if(!Number.isInteger(l)||l<1)throw new RangeError(`A ${e} is a whole number from 1: ${String(l)}.`);return l},j=(l,e)=>Object.fromEntries(Object.entries(l).filter(([t])=>t!==e));export class Cell{row;column;_ws;_value;_formula=void 0;_look;_changed=!1;_styled=!1;_fresh=!1;constructor(e,t,s){this._ws=e,this.row=t,this.column=s;const o=t-1,n=s-1,r=e._model?.at(o,n);return this._value=null,r instanceof re?this._formula=r.text:r!==void 0&&(this._value=r),this._look=e._model?.lookAt(o,n)??{},this._fresh=r===void 0,g(this,"Cell",w)}get parent(){return this._ws}get coordinate(){return C({row:this.row-1,col:this.column-1})}get column_letter(){return N(this.column-1)}get col_idx(){return this.column}get value(){return this._ws.parent.data_only?this.computed:this._formula!==void 0?this._formula:this._shown(this._value)}set value(e){if(e===void 0)throw new TypeError(`${this.coordinate}: a value is not undefined.`);if(this._formula=void 0,this._changed=!0,this._ws.parent._pending=!0,e instanceof Date){if(Number.isNaN(e.getTime()))throw new TypeError(`${this.coordinate}: the date is not valid.`);this._value=oe(e),S(this._look.format)||(this._look={...this._look,format:Number.isInteger(this._value)?"yyyy-mm-dd":"yyyy-mm-dd hh:mm"});return}if(typeof e=="string"&&e.length>1&&e.startsWith("=")){this._formula=e,this._value=null;return}this._value=e}_shown(e){return typeof e=="number"&&S(this._look.format)?te(e)??e:e instanceof P?e.code:e}get computed(){const{calc:e,model:t}=this._ws.parent._computed(),s=t.sheet(this._ws.title);return s?this._shown(e.value(s,this.row-1,this.column-1)):null}get data_type(){if(this._formula!==void 0)return"f";const e=this._value;return e===null?"n":typeof e=="number"?S(this._look.format)?"d":"n":typeof e=="boolean"?"b":e instanceof P?"e":"s"}get is_date(){return this.data_type==="d"}get number_format(){return this._look.format??"General"}set number_format(e){this._setLook({format:e})}_setLook(e){this._look={...this._look,...e},this._styled=!0,this._ws.parent._pending=!0}get font(){return ve(this._look)}set font(e){this._setLook(be(e))}get fill(){return ye(this._look)}set fill(e){this._setLook(ke(e))}get border(){return ge(this._look)}set border(e){this._setLook(we(e))}get alignment(){return pe(this._look)}set alignment(e){this._setLook(me(e))}get has_style(){return!p(this._look)}offset(e=0,t=0){return this._ws.cell(this.row+e,this.column+t)}}export class ColumnDimension{index;_width;_hidden;_files;_ws;constructor(e,t){this._ws=e,this.index=t;const s=e._spec()?.columns?.[t];return this._width=s?.width,this._hidden=s?.hidden,this._files=s?.files,g(this,"ColumnDimension",w)}get files(){return this._files}set files(e){this._files=e,this._ws._dimensions=!0}get width(){return this._width===void 0?void 0:Ee(this._width)}set width(e){this._width=e===void 0?void 0:xe(e),this._ws._dimensions=!0}get hidden(){return this._hidden??!1}set hidden(e){this._hidden=e,this._ws._dimensions=!0}}export class RowDimension{index;_height;_hidden;_ws;constructor(e,t){this._ws=e,this.index=t;const s=e._spec()?.rows?.[String(t)];return this._height=s?.height,this._hidden=s?.hidden,g(this,"RowDimension",w)}get height(){return this._height===void 0?void 0:$e(this._height)}set height(e){this._height=e===void 0?void 0:Se(e),this._ws._dimensions=!0}get hidden(){return this._hidden??!1}set hidden(e){this._hidden=e,this._ws._dimensions=!0}}export class Table{displayName;ref;key;_spec;autoFilter;constructor(e){for(const t of Object.keys(e))if(!["displayName","ref","key"].includes(t))throw new TypeError(`Table takes displayName, ref and key; it has no ${t}. ${w}`);if(!W(e.displayName))throw new TypeError(`${e.displayName} cannot be a table's name.`);if(!k(e.ref))throw new TypeError(`${e.ref} is not a range.`);return this.displayName=e.displayName,this.ref=e.ref,this.key=e.key,this.autoFilter=new I(e.ref,()=>{}),g(this,"Table",w)}get name(){return this.displayName}}export class TableList{_items=new Map;constructor(){return g(this,"TableList",w,{key:e=>this._items.get(e)})}add(e){this._items.set(e.name,e)}get(e){return this._items.get(e)}keys(){return[...this._items.keys()]}values(){return[...this._items.values()]}items(){return[...this._items.entries()]}pop(e){const t=this._items.get(e);return this._items.delete(e),t}}export class DefinedName{name;attr_text;constructor(e,t){if(!W(e))throw new TypeError(`${e} cannot be a name.`);return this.name=e,this.attr_text=t.attr_text.replace(/^=/u,""),g(this,"DefinedName",w)}get value(){return this.attr_text}set value(e){this.attr_text=e.replace(/^=/u,"")}}export class DefinedNameDict{_items=new Map;constructor(){return g(this,"DefinedNameDict",w,{key:e=>this._items.get(e),setKey:(e,t)=>t instanceof DefinedName?(this._items.set(e,t),!0):!1})}add(e){this._items.set(e.name,e)}get(e){return this._items.get(e)}keys(){return[...this._items.keys()]}values(){return[...this._items.values()]}items(){return[...this._items.entries()]}pop(e){const t=this._items.get(e);return this._items.delete(e),t}}const v=l=>{if(l._formula!==void 0)return l._formula;const e=l._value;return typeof e=="number"&&S(l._look.format)?se(e):ne(e)};function J(l){if(l._formula!==void 0)return l._formula;const e=l._value;return e===null?null:typeof e=="number"&&!S(l._look.format)||typeof e=="boolean"?e:v(l)}const Te=l=>l.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/gu,"")||"rows";export class Worksheet{_parent;_title;_was;_model;_cells=new Map;_columns=new Map;_rows=new Map;_tables=new TableList;_freeze;_merges=[];_state="visible";_dimensions=!1;_lastRow=0;_rules=[];_validations=[];_filter;_charts=[];constructor(e,t,s){if(this._parent=e,this._title=t,this._filter=new I(void 0,()=>{this._parent._pending=!0}),s){this._model=s,this._was=t,this._freeze=s.spec.freeze,this._merges=[...s.spec.merges??[]],this._state=s.spec.hidden===!0?"hidden":"visible",this._lastRow=(s.used?.bottom??-1)+1,this._heldRules(s.spec);for(const o of s.tables){const n=new Table({displayName:o.name,ref:x(o.area),...o.spec.key===void 0?{}:{key:o.spec.key}});n._spec=o.spec;const{filter:r}=o.spec;if(r)for(const[a,f]of Object.entries(r.columns)){const u=o.column(a);u&&n.autoFilter._columns.set(u.index,f)}this._tables.add(n)}}return g(this,"Worksheet",w,{index:o=>this._rowCells(o),key:o=>this._at(o),setKey:(o,n)=>{const r=b(o);return r?(this.cell(r.row+1,r.col+1).value=n,!0):!1}})}_spec(){return this._parent._file.sheets.find(e=>e.name===(this._was??this._title))}_heldRules(e){this._rules=[...e?.conditional??[]],this._validations=(e?.validations??[]).map(_e),this._charts=(e?.charts??[]).map(fe),this._filter.ref=e?.filter?.range,this._filter._columns.clear();const t=e?.filter?k(e.filter.range):void 0;for(const[s,o]of Object.entries(e?.filter?.columns??{})){const n=E(s);t&&n!==void 0&&this._filter._columns.set(n-t.left,o)}}_at(e){const t=b(e);if(t)return this.cell(t.row+1,t.col+1);const s=k(e);if(s)return this._area(s);const o=E(e);if(o!==void 0){const n=[];for(let r=1;r<=this.max_row;r++)n.push(this.cell(r,o+1));return n}}_rowCells(e){const t=[];for(let s=1;s<=this.max_column;s++)t.push(this.cell(e,s));return t}_area(e){const t=[];for(let s=e.top;s<=e.bottom;s++){const o=[];for(let n=e.left;n<=e.right;n++)o.push(this.cell(s+1,n+1));t.push(o)}return t}get parent(){return this._parent}get title(){return this._title}set title(e){const t=this._title;e!==t&&this._parent._renameSheet(this,t,e)}get sheet_state(){return this._state}set sheet_state(e){this._state=e}cell(e,t,s){if(e<1||t<1)throw new RangeError(`Row and column values must be at least 1: ${String(e)}, ${String(t)}.`);const o=(e-1)*16384+t-1;let n=this._cells.get(o);return n||(n=new Cell(this,e,t),this._cells.set(o,n)),s!==void 0&&(n.value=s),e>this._lastRow&&(this._lastRow=e),n}append(e){const t=this._lastRow+1,s=(o,n)=>{n!=null&&this.cell(t,o,n)};if(Array.isArray(e))e.forEach((o,n)=>{s(n+1,o)});else for(const[o,n]of Object.entries(e)){const r=/^\d+$/u.test(o)?Number(o)-1:E(o);if(r===void 0)throw new TypeError(`${o} is not a column.`);s(r+1,n)}this._lastRow=t}get max_row(){return Math.max(1,this._lastRow)}get max_column(){let e=this._model?.columnsUsed??0;for(const t of this._cells.values())(t._value!==null||t._formula!==void 0)&&t.column>e&&(e=t.column);return Math.max(1,e)}min_row=1;min_column=1;get dimensions(){return x({top:0,left:0,bottom:this.max_row-1,right:this.max_column-1})}iter_rows(e={}){const t=this._area({top:(e.min_row??1)-1,left:(e.min_col??1)-1,bottom:(e.max_row??this.max_row)-1,right:(e.max_col??this.max_column)-1});return e.values_only===!0?t.map(s=>s.map(o=>o.value)):t}iter_cols(e={}){const t=this.iter_rows(e);return(t[0]??[]).map((o,n)=>t.map(r=>r[n]))}get rows(){return this.iter_rows()}get columns(){return this.iter_cols()}get values(){return this.iter_rows({values_only:!0})}insert_rows(e,t=1){this._parent._restructure({op:"insert-rows",sheet:this._title,at:y(e,"row")-1,count:y(t,"amount")})}delete_rows(e,t=1){this._parent._restructure({op:"delete-rows",sheet:this._title,at:y(e,"row")-1,count:y(t,"amount")})}insert_cols(e,t=1){this._parent._restructure({op:"insert-columns",sheet:this._title,at:y(e,"column")-1,count:y(t,"amount")})}delete_cols(e,t=1){this._parent._restructure({op:"delete-columns",sheet:this._title,at:y(e,"column")-1,count:y(t,"amount")})}merge_cells(e){if(!k(e))throw new TypeError(`${e} is not a range.`);this._merges.includes(e)||this._merges.push(e),this._parent._pending=!0}unmerge_cells(e){this._merges=this._merges.filter(t=>t!==e),this._parent._pending=!0}get merged_cells(){return[...this._merges]}get freeze_panes(){return this._freeze}set freeze_panes(e){const t=e instanceof Cell?e.coordinate:e;if(t!==void 0&&!b(t))throw new TypeError(`${t} is not a cell.`);this._freeze=t,this._parent._pending=!0}get column_dimensions(){return new Proxy({},{get:(e,t)=>{if(typeof t!="string")return;const s=t.toUpperCase();if(E(s)===void 0)throw new TypeError(`${t} is not a column.`);let o=this._columns.get(s);return o||(o=new ColumnDimension(this,s),this._columns.set(s,o)),o}})}get row_dimensions(){return new Proxy({},{get:(e,t)=>{if(typeof t!="string"||!/^[1-9]\d*$/u.test(t))throw new TypeError(`${String(t)} is not a row.`);const s=Number(t);let o=this._rows.get(s);return o||(o=new RowDimension(this,s),this._rows.set(s,o)),o}})}get tables(){return this._tables}get conditional_formatting(){return new ce(this._rules,()=>{this._parent._pending=!0})}get data_validations(){return new ue(this._validations,()=>{this._parent._pending=!0})}add_data_validation(e){this._validations.push(e),this._parent._pending=!0}get auto_filter(){return this._filter}add_chart(e,t){e.anchor=he(t)??e.anchor,this._charts.push(e),this._parent._pending=!0}add_table(e){if(this._parent._tableNamed(e.name))throw new Error(`There is already a table named ${e.name}.`);this._tables.add(e),this._parent._pending=!0}}export class Workbook{worksheets=[];defined_names=new DefinedNameDict;data_only;title;path;block_cells=BLOCK_CELLS;_file={sheets:[]};_text="";_disk={text:"",csv:new Map};_csv=new Map;_model;_names=new Map;_active=0;_pending=!1;_making=!1;_calc=void 0;constructor(e={}){this.data_only=e.data_only??!1;const t=g(this,"Workbook",w,{key:s=>this.worksheets.find(o=>o.title===s),index:s=>this.worksheets[s]});return t.worksheets=[new Worksheet(t,"Sheet")],t}static open(e,t={}){const s=new Workbook(t);return s.path=e,s._read(e),s}_read(e){const{readFileSync:t}=K(),s=t($(e,z),"utf8"),o=new Map,n=r=>{try{const a=t($(e,r),"utf8");return o.set(r,a),a}catch{return}};this._load(s,n);for(const[r,a]of o)this._keepCsv(r,a);this._disk={text:s,csv:o}}_keepCsv(e,t){const s=V(t);this._csv.set(e,{parsed:s,rows:s.records.map(o=>o.end===o.start?[]:[...o.fields])})}_load(e,t){const{workbook:s,problems:o}=B({text:e,read:t});if(!s)throw new Error(`sheet.yaml cannot be opened: ${o.map(n=>n.message).join("; ")}`);this._text=e,this._file=structuredClone(s.file),this._model=s,this.title=s.title,this.worksheets=s.sheets.map(n=>new Worksheet(this,n.name,n));for(const n of s.names.values()){if(n.source.path?.[0]!=="names")continue;const r=n.formula?n.formula.text:n.value??null;this._names.set(n.name,r),this.defined_names.add(new DefinedName(n.name,{attr_text:String(r)}))}}get active(){const e=this.worksheets[this._active]??this.worksheets[0];if(!e)throw new Error("The workbook has no sheets.");return e}set active(e){this._active=this.worksheets.indexOf(e)}get sheetnames(){return this.worksheets.map(e=>e.title)}get_sheet_by_name(e){return this.worksheets.find(t=>t.title===e)}index(e){return this.worksheets.indexOf(e)}create_sheet(e,t){let s=e??"Sheet";for(let n=1;this.worksheets.some(r=>r.title===s);n++)s=`${e??"Sheet"}${String(n)}`;const o=new Worksheet(this,s);return this.worksheets.splice(t??this.worksheets.length,0,o),this._pending=!0,o}remove(e){this.worksheets=this.worksheets.filter(t=>t!==e),this._pending=!0}move_sheet(e,t=0){const s=this.worksheets.indexOf(e);this.worksheets.splice(s,1),this.worksheets.splice(s+t,0,e),this._pending=!0}_tableNamed(e){for(const t of this.worksheets){const s=t._tables.get(e);if(s)return s}}_renameSheet(e,t,s){if(this.worksheets.some(n=>n!==e&&n.title===s))throw new Error(`There is already a sheet named ${s}.`);this._apply(),this._rewrite({op:"rename-sheet",from:t,to:s}),e._title=s,e._was=s;const o=this._file.sheets.find(n=>n.name===t);o&&(o.name=s),this._apply()}_restructure(e){this._apply();const t=ie({file:this._file,rows:new Map([...this._csv].map(([o,n])=>[o,n.rows]))},e);if(t.refused!==void 0)throw new Error(t.refused==="table-header"?"A table's header row is not deleted: delete the table's rows, or all of it.":"That sheet is not there.");this._file=t.file;for(const[o,n]of t.rows){const r=this._csv.get(o);r&&(r.rows=n.map(a=>[...a]))}for(const o of this.worksheets){const n=this._file.sheets.find(r=>r.name===o._title);o._cells.clear(),o._columns.clear(),o._rows.clear(),o._merges=[...n?.merges??[]],o._freeze=n?.freeze,o._heldRules(n)}const s=this._build();this._rebase(s.text,s.files);for(const o of this.worksheets){const n=this._model?.sheet(o._title);if(n){o._lastRow=(n.used?.bottom??-1)+1;for(const r of n.tables){const a=o._tables.get(r.name);a&&(a.ref=x(r.area))}}}}_rewrite(e){const t=(o,n)=>{const r=F(o);if(!r.ok)return o;const a=Z(r.node,e,n);return a===r.node?o:A(a)},{_file:s}=this;if(s.names){for(const[o,n]of Object.entries(s.names))if(typeof n=="string"&&n.startsWith("=")){const r=t(n,s.sheets[0]?.name??"");s.names[o]=r,this._names.set(o,r);const a=this.defined_names.get(o);a&&(a.attr_text=r.slice(1))}}for(const o of s.checks??[])o.formula=t(o.formula,s.sheets[0]?.name??"");for(const o of s.sheets){for(const[n,r]of Object.entries(o.cells??{}))typeof r=="string"&&r.startsWith("=")?o.cells[n]=t(r,o.name):r!==null&&typeof r=="object"&&r.formula!==void 0&&(r.formula=t(r.formula,o.name));for(const n of o.tables??[]){for(const r of Object.values(n.columns??{}))r.formula!==void 0&&(r.formula=t(r.formula,o.name));this._rewriteCsv(n.rows,o.name,t)}for(const n of o.blocks??[])this._rewriteCsv(n.rows,o.name,t)}}_rewriteCsv(e,t,s){const o=this._csv.get(e);o&&(o.rows=o.rows.map(n=>n.map(r=>M(r).formula!==void 0?s(r,t):r)))}_sheetEntry(e){const t=e._was??e._title;let s=this._file.sheets.find(o=>o.name===t);return s||(s={name:e._title},this._file.sheets.push(s)),s.name=e._title,s}_dataPath(e){const t=`${H}/${Te(e)}`;let s=`${t}.csv`;const o=n=>this._csv.has(n)||this._file.sheets.some(r=>r.tables?.some(a=>a.rows===n)??r.blocks?.some(a=>a.rows===n));for(let n=2;o(s);n++)s=`${t}-${String(n)}.csv`;return s}_writeNewTable(e,t,s){const o=k(s.ref);if(!o)throw new Error(`${s.ref} is not a range.`);const n=[];for(let i=o.left;i<=o.right;i++){const h=e.cell(o.top+1,i+1).value;if(h===null||h==="")throw new Error(`Table ${s.name}'s header has no name at ${C({row:o.top,col:i})}.`);n.push(String(h))}const r={},a=[];n.forEach((i,h)=>{const c=o.left+h,d=this._columnFormula(e,o,c);d===void 0?a.push(h):r[i]={formula:d};const m=this._columnFormat(e,o,c);m!==void 0&&(r[i]={...r[i],format:m})}),this._columnsStyled(e,o);const f=[a.map(i=>n[i]??"")];for(let i=o.top+1;i<=o.bottom;i++)f.push(a.map(h=>v(e.cell(i+1,o.left+h+1))));t.cells&&(t.cells=Object.fromEntries(Object.entries(t.cells).filter(([i])=>{const h=b(i);return!h||!L(o,h.row,h.col)})));const u=this._dataPath(s.name);this._csv.set(u,{parsed:void 0,rows:f});const _={name:s.name,at:C({row:o.top,col:o.left}),rows:u,...s.key===void 0?{}:{key:s.key},...p(r)?{}:{columns:r}};(t.tables??=[]).push(_),s._spec=_}_columnsStyled(e,t){for(let s=t.left;s<=t.right;s++)for(let o=t.top+1;o<=t.bottom;o++){const n=e.cell(o+1,s+1),{format:r,...a}=this._ownLook(n);r!==void 0&&p(a)&&(n._styled=!1)}}_columnFormula(e,t,s){if(t.bottom<=t.top)return;const o=e.cell(t.top+2,s+1),n=D(o);if(n!==void 0){for(let r=t.top+2;r<=t.bottom;r++)if(D(e.cell(r+1,s+1))!==n)return;return o._formula}}_columnFormat(e,t,s){if(t.bottom<=t.top)return;const o=r=>this._ownLook(e.cell(r+1,s+1)).format,n=o(t.top+1);for(let r=t.top+2;r<=t.bottom;r++)if(o(r)!==n)return;return n}_held(e){const t=this._csv.get(e);if(!t)throw new Error(`${e} was not read.`);return t}_setCsvCell(e,t,s,o){const{rows:n}=this._held(e);for(;n.length<=t;)n.push([]);const r=n[t];if(r){for(;r.length<=s;)r.push("");r[s]=o}}_recordOf(e,t){let s=0;for(let o=0;o<t;){if(s+=1,s>=e.length)return s+t-o-1;e[s]?.length!==0&&(o+=1)}return s}_writeTableCell(e,t,s){const o=this._held(e.rows),n=o.rows[0]??[],r=s.column-1-t.left,a=this._recordOf(o.rows,s.row-1-t.top),f=Object.keys(e.columns??{}).filter(c=>!n.some(d=>d.trim().toLowerCase()===c.toLowerCase())),_=[...n.map(c=>c.trim()),...f][r];if(_===void 0)return;if(a===0){r<n.length&&(n[r]=v(s));return}const i=e.columns?.[_]?.formula;if(i!==void 0){const c=this._movedColumn(i,t,s);if(s._formula===c){const d=n.findIndex(m=>m.trim()===_);d>=0&&this._setCsvCell(e.rows,a,d,"");return}}let h=n.findIndex(c=>c.trim()===_);h<0&&(h=n.length,this._setCsvCell(e.rows,0,h,_)),this._setCsvCell(e.rows,a,h,v(s))}_movedColumn(e,t,s){const o=F(e);if(!o.ok)return e;const n=s.row-1-(t.top+1);return n===0?e:A(Q(o.node,n,0))}_apply(){this.title===void 0?delete this._file.title:this._file.title=this.title;const e=new Set(this.worksheets.map(s=>s._was??s._title));this._file.sheets=this._file.sheets.filter(s=>e.has(s.name));for(const s of this.worksheets)this._applySheet(s);this._file.sheets=this.worksheets.map(s=>this._sheetEntry(s)),this._applyNames();const t=this._build();this._rebase(t.text,t.files)}_applyNames(){const e={};for(const t of this.defined_names.values()){const s=M(t.attr_text),o=this._names.get(t.name);e[t.name]=o!==void 0&&String(o).replace(/^=/u,"")===t.attr_text?o:typeof s.value=="number"||typeof s.value=="boolean"?s.value:/^"[^"]*"$/u.test(t.attr_text)?t.attr_text.slice(1,-1):`=${t.attr_text}`}p(e)?delete this._file.names:this._file.names=e}_applySheet(e){const t=this._sheetEntry(e);e._freeze===void 0?delete t.freeze:t.freeze=e._freeze,e._merges.length===0?delete t.merges:t.merges=[...e._merges],e._state==="hidden"?t.hidden=!0:delete t.hidden,e._rules.length===0?delete t.conditional:t.conditional=[...e._rules],e._validations.length===0?delete t.validations:t.validations=e._validations.map(de),e._charts.length===0?delete t.charts:t.charts=e._charts.map(o=>o._spec(e._title)),this._applyFilter(e,t);const s=new Set(t.tables?.map(o=>o.name.toLowerCase()));for(const o of e._tables.values())s.has(o.name.toLowerCase())||this._writeNewTable(e,t,o);this._applyTableFilters(e,t),this._applyCells(e,t),this._applyDimensions(e,t),t.cells&&p(t.cells)&&delete t.cells,t.columns&&p(t.columns)&&delete t.columns,t.rows&&p(t.rows)&&delete t.rows,t.format?.length===0&&delete t.format,t.tables?.length===0&&delete t.tables,t.blocks?.length===0&&delete t.blocks}_applyFilter(e,t){const{ref:s,_columns:o}=e._filter;if(s===void 0){delete t.filter;return}const n=k(s);if(!n)throw new TypeError(`${s} is not a range.`);const r={};for(const[a,f]of o)r[N(n.left+a)]=f;t.filter={range:s,...p(r)?{}:{columns:r}}}_applyTableFilters(e,t){for(const s of t.tables??[]){const o=e._tables.get(s.name);if(!o||o.autoFilter._columns.size===0)continue;const n=this._csv.get(s.rows)?.rows??[],r=le(s,n)?.names??[],a={};for(const[f,u]of o.autoFilter._columns){const _=r[f];if(_===void 0)throw new RangeError(`Table ${s.name} has no column at ${String(f)}.`);a[_]=u}s.filter={columns:a}}}_applyDimensions(e,t){if(e._dimensions){for(const[s,o]of e._columns){const n={...t.columns?.[s]};o._width===void 0?delete n.width:n.width=o._width,o._hidden===void 0?delete n.hidden:n.hidden=o._hidden,o._files===void 0?delete n.files:n.files=o._files;const r=j(t.columns??{},s);t.columns=p(n)?r:{...r,[s]:n}}for(const[s,o]of e._rows){const n={...t.rows?.[String(s)]};o._height===void 0?delete n.height:n.height=o._height,o._hidden===void 0?delete n.hidden:n.hidden=o._hidden;const r=j(t.rows??{},String(s));t.rows=p(n)?r:{...r,[String(s)]:n}}e._dimensions=!1}}_applyCells(e,t){const s=(t.tables??[]).flatMap(r=>{const a=b(r.at),f=e._tables.get(r.name),u=f?k(f.ref):void 0;return a&&u?[{entry:r,area:u}]:[]}),o=(t.blocks??[]).flatMap(r=>{const a=e._model?.blocks.find(f=>f.file===r.rows);return a?[{entry:r,area:a.area}]:[]}),n=[];for(const r of e._cells.values()){if(!r._changed&&!r._styled)continue;const a=r.row-1,f=r.column-1,u=s.find(i=>L(i.area,a,f)),_=o.find(i=>L(i.area,a,f));u?(r._changed&&this._writeTableCell(u.entry,u.area,r),r._styled&&this._styleByFormat(t,r)):_?(r._changed&&this._setCsvCell(_.entry.rows,a-_.area.top,f-_.area.left,v(r)),r._styled&&this._styleByFormat(t,r)):r._fresh&&!e._model?.keys.has(a*16384+f)?n.push(r):this._writeLoose(e,t,r),r._changed=!1,r._styled=!1}this._consolidate(e,t,n),Oe(t)}_styleByFormat(e,t){(e.format??=[]).push({range:t.coordinate,...this._ownLook(t)})}_ownLook(e){const t=e._ws._model?.lookAt(e.row-1,e.column-1)??{},s=Ce(t,e._look);return s.format!==void 0&&e._formula===void 0&&M(v(e)).format===s.format&&delete s.format,s}_writeLoose(e,t,s){const o=s.coordinate,n=t.cells??={},r=J(s),a=this._ownLook(s),f=n[o],_={...f!==null&&typeof f=="object"?Object.fromEntries(Object.entries(f).filter(([c])=>c!=="value"&&c!=="formula"&&c!=="name")):{},...a},i=f!==null&&typeof f=="object"&&f.name!==void 0?{name:f.name}:{},h=e._model?.at(s.row-1,s.column-1)!==void 0;if(r===null&&p(_)&&!h){t.cells=j(n,o);return}n[o]=p(_)&&p(i)?r:{...typeof r=="string"&&r.startsWith("=")?{formula:r}:r===null?{}:{value:r},...i,..._}}_consolidate(e,t,s){const o=s.filter(i=>i._value!==null||i._formula!==void 0),n=new Map;for(const i of s){const h=this._ownLook(i);if(p(h))continue;const c=JSON.stringify(h),d=n.get(c);d?d.push(i):n.set(c,[i])}const r=new Map(o.map(i=>[`${String(i.row)}:${String(i.column)}`,i])),a=i=>r.get(`${String(i.row+1)}:${String(i.col+1)}`)??e.cell(i.row+1,i.col+1),f=new Map,u=[];for(const i of o){const h={row:i.row-1,col:i.column-1},c=i._formula===void 0?void 0:D(i);if(c===void 0){u.push(h);continue}const d=f.get(c);d?d.push(h):f.set(c,[h])}const _=t.cells??={};for(const i of f.values())for(const h of T(i))_[x(h)]=a({row:h.top,col:h.left})._formula??null;for(const i of T(u))if((i.bottom-i.top+1)*(i.right-i.left+1)>=this.block_cells){const c=[];for(let m=i.top;m<=i.bottom;m++){const R=[];for(let O=i.left;O<=i.right;O++)R.push(v(a({row:m,col:O})));c.push(R)}const d=this._dataPath(e._title);this._csv.set(d,{parsed:void 0,rows:c}),(t.blocks??=[]).push({at:C({row:i.top,col:i.left}),rows:d})}else for(let c=i.top;c<=i.bottom;c++)for(let d=i.left;d<=i.right;d++){const m=a({row:c,col:d});_[m.coordinate]=J(m)}for(const i of n.values()){const[h]=i;if(!h)continue;const c=this._ownLook(h),d=i.map(m=>({row:m.row-1,col:m.column-1}));for(const m of T(d))(t.format??=[]).push({range:x(m),...c})}}_build(){const e=new Map;for(const[t,s]of this._csv)e.set(t,s.parsed?ee(s.parsed,s.rows):Y(s.rows));return{text:ae(this._text,this._file),files:e}}_rebase(e,t){const{workbook:s,problems:o}=B({text:e,read:n=>t.get(n)});if(!s)throw new Error(`The workbook is not one: ${o.map(n=>n.message).join("; ")}`);this._text=e,this._file=structuredClone(s.file),this._model=s;for(const[n,r]of t)this._keepCsv(n,r);this._calc=void 0,this._pending=!1;for(const n of this.worksheets){n._was=n._title;const r=s.sheet(n._title);r&&(n._model=r);for(const a of n._cells.values())a._fresh=r?.at(a.row-1,a.column-1)===void 0}this._names=new Map;for(const n of s.names.values())n.source.path?.[0]==="names"&&this._names.set(n.name,n.formula?n.formula.text:n.value??null)}_computed(){const e=[...this.defined_names.values()];if((this._pending||e.length!==this._names.size||e.some(t=>String(this._names.get(t.name)).replace(/^=/u,"")!==t.attr_text))&&this._apply(),!this._calc){const t=this._model;if(!t)throw new Error("The workbook has no sheets.");this._calc={calc:new U(t).calculate(),model:t}}return this._calc}check(){this._apply();const{text:e,files:t}=this._build();return G({text:e,read:s=>t.get(s)}).problems}_generated(){if(this.worksheets.length===0)return this._applyNames(),{sheets:[],csv:{},...this._file.names?{names:this._file.names}:{}};this._apply();const e=structuredClone(this._file.sheets),t=o=>`${q}${o}`;for(const o of e){for(const n of o.tables??[])n.rows=t(n.rows);for(const n of o.blocks??[])n.rows=t(n.rows)}const s={};for(const[o,n]of this._build().files)s[t(o)]=n;return{sheets:e,csv:s,...this._file.names?{names:this._file.names}:{}}}save(e){if(this._making)throw new Error("sheet.ts makes sheets and saves nothing: what it adds to wb is what it makes.");const t=e??this.path;if(t===void 0)throw new TypeError("A new workbook is saved to a folder: wb.save('content/budget').");if(this.worksheets.length===0)throw new Error("A workbook has at least one sheet.");const{text:s,csv:o}=this._disk;this._apply();const n=new Set(this._file.sheets.flatMap(i=>[...(i.tables??[]).map(h=>h.rows),...(i.blocks??[]).map(h=>h.rows)])),r=[...this._csv.keys()].filter(i=>!n.has(i));for(const i of r)this._csv.delete(i);const{mkdirSync:a,rmSync:f,writeFileSync:u}=K(),_=process.getBuiltinModule("node:path");a(t,{recursive:!0}),(this._text!==s||e!==void 0)&&u($(t,z),this._text);for(const[i,h]of this._csv){const c=h.parsed?.source??"";if(e===void 0&&o.get(i)===c)continue;const d=$(t,i);a(_.dirname(d),{recursive:!0}),u(d,c)}if(e===void 0||t===this.path)for(const i of r)f($(t,i),{force:!0});this._disk={text:this._text,csv:new Map([...this._csv].map(([i,h])=>[i,h.parsed?.source??""]))},this.path=t}}function D(l){if(l._formula===void 0)return;const e=F(l._formula);if(e.ok)return X(e.node,l.row-1,l.column-1)}function Oe(l){const e=l.format;if(!e||e.length<2)return;const t=[],s=new Map;for(const o of e){const{range:n,...r}=o,a=b(n);if(!a){t.push(o);continue}const f=JSON.stringify(r),u=s.get(f);u?u.places.push(a):s.set(f,{look:r,places:[a]})}for(const{look:o,places:n}of s.values())for(const r of T(n))t.push({range:x(r),...o});l.format=t}export function load_workbook(l,e={}){return Workbook.open(l,e)}export const get_column_letter=l=>N(l-1);export function column_index_from_string(l){const e=E(l);if(e===void 0)throw new TypeError(`${l} is not a column.`);return e+1}export function coordinate_to_tuple(l){const e=b(l);if(!e)throw new TypeError(`${l} is not a cell.`);return[e.row+1,e.col+1]}export function range_boundaries(l){const e=k(l);if(!e)throw new TypeError(`${l} is not a range.`);return[e.left+1,e.top+1,e.right+1,e.bottom+1]}
|
|
2
|
+
import{SHEET_DATA as G,SHEET_FILE as P,strict as g}from"@allyhub-next/formats";import{Comment as z,HeaderFooter as A,PageMargins as V,PageSetup as Y,SheetProtection as q}from"./page.js";import{columnIndex as E,columnLetter as L,cellName as C,contains as N,rangeName as x,readAddress as y,readArea as k}from"../address.js";import{Calc as Q}from"../calc/engine.js";import{checkWorkbook as X}from"../check.js";import{readCsv as Z,writeCsv as ee}from"../csv.js";import{GENERATED as te}from"../generated.js";import{moveFormula as se,relativeKey as ne}from"../formula/move.js";import{parseFormula as F}from"../formula/parse.js";import{printFormula as B}from"../formula/print.js";import{rewriteFormula as oe}from"../formula/rewrite.js";import{isDateCode as S}from"../format.js";import{patchCsv as re}from"../patch.js";import{CellError as W,dateOfSerial as ie,isoOfSerial as le,readTyped as M,serialOfDate as ae,writeTyped as he}from"../values.js";import{FormulaCell as fe,readWorkbook as I,validName as H}from"../workbook.js";import{restructure as _e,tableShape as ce}from"../structure.js";import{patchYaml as ue}from"../write.js";import{anchorOf as de,chartOfSpec as me}from"./charts.js";import{HINT as w}from"./hint.js";import{rectangles as T}from"./rectangles.js";import{AutoFilter as K,ConditionalFormattingList as pe,DataValidationList as we,validationOf as ge,validationSpec as ke}from"./rules.js";import{alignmentLook as ye,alignmentOf as be,borderLook as ve,borderOf as xe,fillLook as Ee,fillOf as Se,fontLook as $e,fontOf as Ce}from"./styles.js";const J=()=>process.getBuiltinModule("node:fs"),$=(...l)=>process.getBuiltinModule("node:path").join(...l);export const BLOCK_CELLS=100;const Te=l=>Math.round(l*7+5),Oe=l=>(l-5)/7,Le=l=>l*4/3,Ne=l=>l*3/4;function Fe(l,e){const t={},s=l,n=e;for(const o of new Set([...Object.keys(s),...Object.keys(n)])){const r=n[o];JSON.stringify(r??!1)!==JSON.stringify(s[o]??!1)&&(t[o]=r??!1)}return t}const m=l=>Object.keys(l).length===0,b=(l,e)=>{if(!Number.isInteger(l)||l<1)throw new RangeError(`A ${e} is a whole number from 1: ${String(l)}.`);return l},j=(l,e)=>Object.fromEntries(Object.entries(l).filter(([t])=>t!==e));export class Cell{row;column;_ws;_value;_formula=void 0;_look;_changed=!1;_styled=!1;_fresh=!1;constructor(e,t,s){this._ws=e,this.row=t,this.column=s;const n=t-1,o=s-1,r=e._model?.at(n,o);return this._value=null,r instanceof fe?this._formula=r.text:r!==void 0&&(this._value=r),this._look=e._model?.lookAt(n,o)??{},this._fresh=r===void 0,g(this,"Cell",w)}get parent(){return this._ws}get coordinate(){return C({row:this.row-1,col:this.column-1})}get column_letter(){return L(this.column-1)}get col_idx(){return this.column}get value(){return this._ws.parent.data_only?this.computed:this._formula!==void 0?this._formula:this._shown(this._value)}set value(e){if(e===void 0)throw new TypeError(`${this.coordinate}: a value is not undefined.`);if(this._formula=void 0,this._changed=!0,this._ws.parent._pending=!0,e instanceof Date){if(Number.isNaN(e.getTime()))throw new TypeError(`${this.coordinate}: the date is not valid.`);this._value=ae(e),S(this._look.format)||(this._look={...this._look,format:Number.isInteger(this._value)?"yyyy-mm-dd":"yyyy-mm-dd hh:mm"});return}if(typeof e=="string"&&e.length>1&&e.startsWith("=")){this._formula=e,this._value=null;return}this._value=e}_shown(e){return typeof e=="number"&&S(this._look.format)?ie(e)??e:e instanceof W?e.code:e}get computed(){const{calc:e,model:t}=this._ws.parent._computed(),s=t.sheet(this._ws.title);return s?this._shown(e.value(s,this.row-1,this.column-1)):null}get data_type(){if(this._formula!==void 0)return"f";const e=this._value;return e===null?"n":typeof e=="number"?S(this._look.format)?"d":"n":typeof e=="boolean"?"b":e instanceof W?"e":"s"}get is_date(){return this.data_type==="d"}get hyperlink(){return this._ws._links[this.coordinate]}set hyperlink(e){e===void 0?Reflect.deleteProperty(this._ws._links,this.coordinate):this._ws._links[this.coordinate]=e,this._ws._changed()}get comment(){const e=this._ws._notes[this.coordinate];if(e!==void 0)return typeof e=="string"?new z(e):new z(e.text,e.author)}set comment(e){e===void 0?Reflect.deleteProperty(this._ws._notes,this.coordinate):this._ws._notes[this.coordinate]=e._file(),this._ws._changed()}get number_format(){return this._look.format??"General"}set number_format(e){this._setLook({format:e})}_setLook(e){this._look={...this._look,...e},this._styled=!0,this._ws.parent._pending=!0}get font(){return Ce(this._look)}set font(e){this._setLook($e(e))}get fill(){return Se(this._look)}set fill(e){this._setLook(Ee(e))}get border(){return xe(this._look)}set border(e){this._setLook(ve(e))}get alignment(){return be(this._look)}set alignment(e){this._setLook(ye(e))}get has_style(){return!m(this._look)}offset(e=0,t=0){return this._ws.cell(this.row+e,this.column+t)}}export class ColumnDimension{index;_width;_hidden;_files;_level;_ws;constructor(e,t){this._ws=e,this.index=t;const s=e._spec()?.columns?.[t];return this._level=s?.level,this._width=s?.width,this._hidden=s?.hidden,this._files=s?.files,g(this,"ColumnDimension",w)}get outlineLevel(){return this._level}set outlineLevel(e){this._level=e,this._ws._dimensions=!0}get files(){return this._files}set files(e){this._files=e,this._ws._dimensions=!0}get width(){return this._width===void 0?void 0:Oe(this._width)}set width(e){this._width=e===void 0?void 0:Te(e),this._ws._dimensions=!0}get hidden(){return this._hidden??!1}set hidden(e){this._hidden=e,this._ws._dimensions=!0}}export class RowDimension{index;_height;_hidden;_level;_ws;constructor(e,t){this._ws=e,this.index=t;const s=e._spec()?.rows?.[String(t)];return this._level=s?.level,this._height=s?.height,this._hidden=s?.hidden,g(this,"RowDimension",w)}get outlineLevel(){return this._level}set outlineLevel(e){this._level=e,this._ws._dimensions=!0}get height(){return this._height===void 0?void 0:Ne(this._height)}set height(e){this._height=e===void 0?void 0:Le(e),this._ws._dimensions=!0}get hidden(){return this._hidden??!1}set hidden(e){this._hidden=e,this._ws._dimensions=!0}}export class Table{displayName;ref;key;_spec;autoFilter;constructor(e){for(const t of Object.keys(e))if(!["displayName","ref","key"].includes(t))throw new TypeError(`Table takes displayName, ref and key; it has no ${t}. ${w}`);if(!H(e.displayName))throw new TypeError(`${e.displayName} cannot be a table's name.`);if(!k(e.ref))throw new TypeError(`${e.ref} is not a range.`);return this.displayName=e.displayName,this.ref=e.ref,this.key=e.key,this.autoFilter=new K(e.ref,()=>{}),g(this,"Table",w)}get name(){return this.displayName}}export class TableList{_items=new Map;constructor(){return g(this,"TableList",w,{key:e=>this._items.get(e)})}add(e){this._items.set(e.name,e)}get(e){return this._items.get(e)}keys(){return[...this._items.keys()]}values(){return[...this._items.values()]}items(){return[...this._items.entries()]}pop(e){const t=this._items.get(e);return this._items.delete(e),t}}export class DefinedName{name;attr_text;constructor(e,t){if(!H(e))throw new TypeError(`${e} cannot be a name.`);return this.name=e,this.attr_text=t.attr_text.replace(/^=/u,""),g(this,"DefinedName",w)}get value(){return this.attr_text}set value(e){this.attr_text=e.replace(/^=/u,"")}}export class DefinedNameDict{_items=new Map;constructor(){return g(this,"DefinedNameDict",w,{key:e=>this._items.get(e),setKey:(e,t)=>t instanceof DefinedName?(this._items.set(e,t),!0):!1})}add(e){this._items.set(e.name,e)}get(e){return this._items.get(e)}keys(){return[...this._items.keys()]}values(){return[...this._items.values()]}items(){return[...this._items.entries()]}pop(e){const t=this._items.get(e);return this._items.delete(e),t}}const v=l=>{if(l._formula!==void 0)return l._formula;const e=l._value;return typeof e=="number"&&S(l._look.format)?le(e):he(e)};function U(l){if(l._formula!==void 0)return l._formula;const e=l._value;return e===null?null:typeof e=="number"&&!S(l._look.format)||typeof e=="boolean"?e:v(l)}const Me=l=>l.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/gu,"")||"rows";export class Worksheet{_parent;_title;_was;_model;_cells=new Map;_columns=new Map;_rows=new Map;_tables=new TableList;_freeze;_merges=[];_state="visible";_dimensions=!1;_lastRow=0;_rules=[];_validations=[];_filter;_charts=[];_print={};_links={};_notes={};_pictures=[];_protect=!1;constructor(e,t,s){if(this._parent=e,this._title=t,this._filter=new K(void 0,()=>{this._parent._pending=!0}),s){this._model=s,this._was=t,this._freeze=s.spec.freeze,this._heldPage(s.spec),this._merges=[...s.spec.merges??[]],this._state=s.spec.hidden===!0?"hidden":"visible",this._lastRow=(s.used?.bottom??-1)+1,this._heldRules(s.spec);for(const n of s.tables){const o=new Table({displayName:n.name,ref:x(n.area),...n.spec.key===void 0?{}:{key:n.spec.key}});o._spec=n.spec;const{filter:r}=n.spec;if(r)for(const[a,f]of Object.entries(r.columns)){const c=n.column(a);c&&o.autoFilter._columns.set(c.index,f)}this._tables.add(o)}}return g(this,"Worksheet",w,{index:n=>this._rowCells(n),key:n=>this._at(n),setKey:(n,o)=>{const r=y(n);return r?(this.cell(r.row+1,r.col+1).value=o,!0):!1}})}_spec(){return this._parent._file.sheets.find(e=>e.name===(this._was??this._title))}_heldRules(e){this._rules=[...e?.conditional??[]],this._validations=(e?.validations??[]).map(ge),this._charts=(e?.charts??[]).map(me),this._filter.ref=e?.filter?.range,this._filter._columns.clear();const t=e?.filter?k(e.filter.range):void 0;for(const[s,n]of Object.entries(e?.filter?.columns??{})){const o=E(s);t&&o!==void 0&&this._filter._columns.set(o-t.left,n)}}_at(e){const t=y(e);if(t)return this.cell(t.row+1,t.col+1);const s=k(e);if(s)return this._area(s);const n=E(e);if(n!==void 0){const o=[];for(let r=1;r<=this.max_row;r++)o.push(this.cell(r,n+1));return o}}_rowCells(e){const t=[];for(let s=1;s<=this.max_column;s++)t.push(this.cell(e,s));return t}_area(e){const t=[];for(let s=e.top;s<=e.bottom;s++){const n=[];for(let o=e.left;o<=e.right;o++)n.push(this.cell(s+1,o+1));t.push(n)}return t}get parent(){return this._parent}get title(){return this._title}set title(e){const t=this._title;e!==t&&this._parent._renameSheet(this,t,e)}get sheet_state(){return this._state}set sheet_state(e){this._state=e}cell(e,t,s){if(e<1||t<1)throw new RangeError(`Row and column values must be at least 1: ${String(e)}, ${String(t)}.`);const n=(e-1)*16384+t-1;let o=this._cells.get(n);return o||(o=new Cell(this,e,t),this._cells.set(n,o)),s!==void 0&&(o.value=s),e>this._lastRow&&(this._lastRow=e),o}append(e){const t=this._lastRow+1,s=(n,o)=>{o!=null&&this.cell(t,n,o)};if(Array.isArray(e))e.forEach((n,o)=>{s(o+1,n)});else for(const[n,o]of Object.entries(e)){const r=/^\d+$/u.test(n)?Number(n)-1:E(n);if(r===void 0)throw new TypeError(`${n} is not a column.`);s(r+1,o)}this._lastRow=t}get max_row(){return Math.max(1,this._lastRow)}get max_column(){let e=this._model?.columnsUsed??0;for(const t of this._cells.values())(t._value!==null||t._formula!==void 0)&&t.column>e&&(e=t.column);return Math.max(1,e)}min_row=1;min_column=1;get dimensions(){return x({top:0,left:0,bottom:this.max_row-1,right:this.max_column-1})}iter_rows(e={}){const t=this._area({top:(e.min_row??1)-1,left:(e.min_col??1)-1,bottom:(e.max_row??this.max_row)-1,right:(e.max_col??this.max_column)-1});return e.values_only===!0?t.map(s=>s.map(n=>n.value)):t}iter_cols(e={}){const t=this.iter_rows(e);return(t[0]??[]).map((n,o)=>t.map(r=>r[o]))}get rows(){return this.iter_rows()}get columns(){return this.iter_cols()}get values(){return this.iter_rows({values_only:!0})}insert_rows(e,t=1){this._parent._restructure({op:"insert-rows",sheet:this._title,at:b(e,"row")-1,count:b(t,"amount")})}delete_rows(e,t=1){this._parent._restructure({op:"delete-rows",sheet:this._title,at:b(e,"row")-1,count:b(t,"amount")})}insert_cols(e,t=1){this._parent._restructure({op:"insert-columns",sheet:this._title,at:b(e,"column")-1,count:b(t,"amount")})}delete_cols(e,t=1){this._parent._restructure({op:"delete-columns",sheet:this._title,at:b(e,"column")-1,count:b(t,"amount")})}merge_cells(e){if(!k(e))throw new TypeError(`${e} is not a range.`);this._merges.includes(e)||this._merges.push(e),this._parent._pending=!0}unmerge_cells(e){this._merges=this._merges.filter(t=>t!==e),this._parent._pending=!0}get merged_cells(){return[...this._merges]}get freeze_panes(){return this._freeze}set freeze_panes(e){const t=e instanceof Cell?e.coordinate:e;if(t!==void 0&&!y(t))throw new TypeError(`${t} is not a cell.`);this._freeze=t,this._parent._pending=!0}get column_dimensions(){return new Proxy({},{get:(e,t)=>{if(typeof t!="string")return;const s=t.toUpperCase();if(E(s)===void 0)throw new TypeError(`${t} is not a column.`);let n=this._columns.get(s);return n||(n=new ColumnDimension(this,s),this._columns.set(s,n)),n}})}get row_dimensions(){return new Proxy({},{get:(e,t)=>{if(typeof t!="string"||!/^[1-9]\d*$/u.test(t))throw new TypeError(`${String(t)} is not a row.`);const s=Number(t);let n=this._rows.get(s);return n||(n=new RowDimension(this,s),this._rows.set(s,n)),n}})}get tables(){return this._tables}get conditional_formatting(){return new pe(this._rules,()=>{this._parent._pending=!0})}get data_validations(){return new we(this._validations,()=>{this._parent._pending=!0})}add_data_validation(e){this._validations.push(e),this._parent._pending=!0}get auto_filter(){return this._filter}_changed(){this._parent._pending=!0}_heldPage(e){this._print=structuredClone(e?.print??{}),this._links={...e?.links},this._notes={...e?.notes},this._pictures=[...e?.pictures??[]],this._protect=e?.protect===!0}get page_setup(){return new Y(this)}get page_margins(){return new V(this)}get oddHeader(){return new A(this,"header")}get oddFooter(){return new A(this,"footer")}get protection(){return new q(()=>this._protect,e=>{this._protect=e,this._changed()})}get print_area(){return this._print.area}set print_area(e){if(e===void 0)delete this._print.area;else if(k(e))this._print.area=e;else throw new TypeError(`${e} is not a range.`);this._changed()}get print_title_rows(){return this._print.title_rows}set print_title_rows(e){e===void 0?delete this._print.title_rows:this._print.title_rows=e,this._changed()}get print_title_cols(){return this._print.title_cols}set print_title_cols(e){e===void 0?delete this._print.title_cols:this._print.title_cols=e,this._changed()}add_image(e,t){const s=t??e.anchor??"A1";if(!y(s))throw new TypeError(`${s} is not a cell.`);this._pictures.push({file:e.path,at:s,...e.width===void 0?{}:{width:e.width},...e.height===void 0?{}:{height:e.height}}),this._changed()}add_chart(e,t){e.anchor=de(t)??e.anchor,this._charts.push(e),this._parent._pending=!0}add_table(e){if(this._parent._tableNamed(e.name))throw new Error(`There is already a table named ${e.name}.`);this._tables.add(e),this._parent._pending=!0}}export class Workbook{worksheets=[];defined_names=new DefinedNameDict;data_only;title;path;block_cells=BLOCK_CELLS;_file={sheets:[]};_text="";_disk={text:"",csv:new Map};_csv=new Map;_model;_names=new Map;_active=0;_pending=!1;_making=!1;_calc=void 0;constructor(e={}){this.data_only=e.data_only??!1;const t=g(this,"Workbook",w,{key:s=>this.worksheets.find(n=>n.title===s),index:s=>this.worksheets[s]});return t.worksheets=[new Worksheet(t,"Sheet")],t}static open(e,t={}){const s=new Workbook(t);return s.path=e,s._read(e),s}_read(e){const{readFileSync:t}=J(),s=t($(e,P),"utf8"),n=new Map,o=r=>{try{const a=t($(e,r),"utf8");return n.set(r,a),a}catch{return}};this._load(s,o);for(const[r,a]of n)this._keepCsv(r,a);this._disk={text:s,csv:n}}_keepCsv(e,t){const s=Z(t);this._csv.set(e,{parsed:s,rows:s.records.map(n=>n.end===n.start?[]:[...n.fields])})}_load(e,t){const{workbook:s,problems:n}=I({text:e,read:t});if(!s)throw new Error(`sheet.yaml cannot be opened: ${n.map(o=>o.message).join("; ")}`);this._text=e,this._file=structuredClone(s.file),this._model=s,this.title=s.title,this.worksheets=s.sheets.map(o=>new Worksheet(this,o.name,o));for(const o of s.names.values()){if(o.source.path?.[0]!=="names")continue;const r=o.formula?o.formula.text:o.value??null;this._names.set(o.name,r),this.defined_names.add(new DefinedName(o.name,{attr_text:String(r)}))}}get active(){const e=this.worksheets[this._active]??this.worksheets[0];if(!e)throw new Error("The workbook has no sheets.");return e}set active(e){this._active=this.worksheets.indexOf(e)}get sheetnames(){return this.worksheets.map(e=>e.title)}get_sheet_by_name(e){return this.worksheets.find(t=>t.title===e)}index(e){return this.worksheets.indexOf(e)}create_sheet(e,t){let s=e??"Sheet";for(let o=1;this.worksheets.some(r=>r.title===s);o++)s=`${e??"Sheet"}${String(o)}`;const n=new Worksheet(this,s);return this.worksheets.splice(t??this.worksheets.length,0,n),this._pending=!0,n}remove(e){this.worksheets=this.worksheets.filter(t=>t!==e),this._pending=!0}move_sheet(e,t=0){const s=this.worksheets.indexOf(e);this.worksheets.splice(s,1),this.worksheets.splice(s+t,0,e),this._pending=!0}_tableNamed(e){for(const t of this.worksheets){const s=t._tables.get(e);if(s)return s}}_renameSheet(e,t,s){if(this.worksheets.some(o=>o!==e&&o.title===s))throw new Error(`There is already a sheet named ${s}.`);this._apply(),this._rewrite({op:"rename-sheet",from:t,to:s}),e._title=s,e._was=s;const n=this._file.sheets.find(o=>o.name===t);n&&(n.name=s),this._apply()}_restructure(e){this._apply();const t=_e({file:this._file,rows:new Map([...this._csv].map(([n,o])=>[n,o.rows]))},e);if(t.refused!==void 0)throw new Error(t.refused==="table-header"?"A table's header row is not deleted: delete the table's rows, or all of it.":"That sheet is not there.");this._file=t.file;for(const[n,o]of t.rows){const r=this._csv.get(n);r&&(r.rows=o.map(a=>[...a]))}for(const n of this.worksheets){const o=this._file.sheets.find(r=>r.name===n._title);n._cells.clear(),n._columns.clear(),n._rows.clear(),n._merges=[...o?.merges??[]],n._freeze=o?.freeze,n._heldPage(o),n._heldRules(o)}const s=this._build();this._rebase(s.text,s.files);for(const n of this.worksheets){const o=this._model?.sheet(n._title);if(o){n._lastRow=(o.used?.bottom??-1)+1;for(const r of o.tables){const a=n._tables.get(r.name);a&&(a.ref=x(r.area))}}}}_rewrite(e){const t=(n,o)=>{const r=F(n);if(!r.ok)return n;const a=oe(r.node,e,o);return a===r.node?n:B(a)},{_file:s}=this;if(s.names){for(const[n,o]of Object.entries(s.names))if(typeof o=="string"&&o.startsWith("=")){const r=t(o,s.sheets[0]?.name??"");s.names[n]=r,this._names.set(n,r);const a=this.defined_names.get(n);a&&(a.attr_text=r.slice(1))}}for(const n of s.checks??[])n.formula=t(n.formula,s.sheets[0]?.name??"");for(const n of s.sheets){for(const[o,r]of Object.entries(n.cells??{}))typeof r=="string"&&r.startsWith("=")?n.cells[o]=t(r,n.name):r!==null&&typeof r=="object"&&r.formula!==void 0&&(r.formula=t(r.formula,n.name));for(const o of n.tables??[]){for(const r of Object.values(o.columns??{}))r.formula!==void 0&&(r.formula=t(r.formula,n.name));this._rewriteCsv(o.rows,n.name,t)}for(const o of n.blocks??[])this._rewriteCsv(o.rows,n.name,t)}}_rewriteCsv(e,t,s){const n=this._csv.get(e);n&&(n.rows=n.rows.map(o=>o.map(r=>M(r).formula!==void 0?s(r,t):r)))}_sheetEntry(e){const t=e._was??e._title;let s=this._file.sheets.find(n=>n.name===t);return s||(s={name:e._title},this._file.sheets.push(s)),s.name=e._title,s}_dataPath(e){const t=`${G}/${Me(e)}`;let s=`${t}.csv`;const n=o=>this._csv.has(o)||this._file.sheets.some(r=>r.tables?.some(a=>a.rows===o)??r.blocks?.some(a=>a.rows===o));for(let o=2;n(s);o++)s=`${t}-${String(o)}.csv`;return s}_writeNewTable(e,t,s){const n=k(s.ref);if(!n)throw new Error(`${s.ref} is not a range.`);const o=[];for(let i=n.left;i<=n.right;i++){const h=e.cell(n.top+1,i+1).value;if(h===null||h==="")throw new Error(`Table ${s.name}'s header has no name at ${C({row:n.top,col:i})}.`);o.push(String(h))}const r={},a=[];o.forEach((i,h)=>{const _=n.left+h,d=this._columnFormula(e,n,_);d===void 0?a.push(h):r[i]={formula:d};const p=this._columnFormat(e,n,_);p!==void 0&&(r[i]={...r[i],format:p})}),this._columnsStyled(e,n);const f=[a.map(i=>o[i]??"")];for(let i=n.top+1;i<=n.bottom;i++)f.push(a.map(h=>v(e.cell(i+1,n.left+h+1))));t.cells&&(t.cells=Object.fromEntries(Object.entries(t.cells).filter(([i])=>{const h=y(i);return!h||!N(n,h.row,h.col)})));const c=this._dataPath(s.name);this._csv.set(c,{parsed:void 0,rows:f});const u={name:s.name,at:C({row:n.top,col:n.left}),rows:c,...s.key===void 0?{}:{key:s.key},...m(r)?{}:{columns:r}};(t.tables??=[]).push(u),s._spec=u}_columnsStyled(e,t){for(let s=t.left;s<=t.right;s++)for(let n=t.top+1;n<=t.bottom;n++){const o=e.cell(n+1,s+1),{format:r,...a}=this._ownLook(o);r!==void 0&&m(a)&&(o._styled=!1)}}_columnFormula(e,t,s){if(t.bottom<=t.top)return;const n=e.cell(t.top+2,s+1),o=R(n);if(o!==void 0){for(let r=t.top+2;r<=t.bottom;r++)if(R(e.cell(r+1,s+1))!==o)return;return n._formula}}_columnFormat(e,t,s){if(t.bottom<=t.top)return;const n=r=>this._ownLook(e.cell(r+1,s+1)).format,o=n(t.top+1);for(let r=t.top+2;r<=t.bottom;r++)if(n(r)!==o)return;return o}_held(e){const t=this._csv.get(e);if(!t)throw new Error(`${e} was not read.`);return t}_setCsvCell(e,t,s,n){const{rows:o}=this._held(e);for(;o.length<=t;)o.push([]);const r=o[t];if(r){for(;r.length<=s;)r.push("");r[s]=n}}_recordOf(e,t){let s=0;for(let n=0;n<t;){if(s+=1,s>=e.length)return s+t-n-1;e[s]?.length!==0&&(n+=1)}return s}_writeTableCell(e,t,s){const n=this._held(e.rows),o=n.rows[0]??[],r=s.column-1-t.left,a=this._recordOf(n.rows,s.row-1-t.top),f=Object.keys(e.columns??{}).filter(_=>!o.some(d=>d.trim().toLowerCase()===_.toLowerCase())),u=[...o.map(_=>_.trim()),...f][r];if(u===void 0)return;if(a===0){r<o.length&&(o[r]=v(s));return}const i=e.columns?.[u]?.formula;if(i!==void 0){const _=this._movedColumn(i,t,s);if(s._formula===_){const d=o.findIndex(p=>p.trim()===u);d>=0&&this._setCsvCell(e.rows,a,d,"");return}}let h=o.findIndex(_=>_.trim()===u);h<0&&(h=o.length,this._setCsvCell(e.rows,0,h,u)),this._setCsvCell(e.rows,a,h,v(s))}_movedColumn(e,t,s){const n=F(e);if(!n.ok)return e;const o=s.row-1-(t.top+1);return o===0?e:B(se(n.node,o,0))}_apply(){this.title===void 0?delete this._file.title:this._file.title=this.title;const e=new Set(this.worksheets.map(s=>s._was??s._title));this._file.sheets=this._file.sheets.filter(s=>e.has(s.name));for(const s of this.worksheets)this._applySheet(s);this._file.sheets=this.worksheets.map(s=>this._sheetEntry(s)),this._applyNames();const t=this._build();this._rebase(t.text,t.files)}_applyNames(){const e={};for(const t of this.defined_names.values()){const s=M(t.attr_text),n=this._names.get(t.name);e[t.name]=n!==void 0&&String(n).replace(/^=/u,"")===t.attr_text?n:typeof s.value=="number"||typeof s.value=="boolean"?s.value:/^"[^"]*"$/u.test(t.attr_text)?t.attr_text.slice(1,-1):`=${t.attr_text}`}m(e)?delete this._file.names:this._file.names=e}_applySheet(e){const t=this._sheetEntry(e);e._freeze===void 0?delete t.freeze:t.freeze=e._freeze,m(e._print)?delete t.print:t.print=e._print,m(e._links)?delete t.links:t.links=e._links,m(e._notes)?delete t.notes:t.notes=e._notes,e._pictures.length===0?delete t.pictures:t.pictures=e._pictures,e._protect?t.protect=!0:delete t.protect,e._merges.length===0?delete t.merges:t.merges=[...e._merges],e._state==="hidden"?t.hidden=!0:delete t.hidden,e._rules.length===0?delete t.conditional:t.conditional=[...e._rules],e._validations.length===0?delete t.validations:t.validations=e._validations.map(ke),e._charts.length===0?delete t.charts:t.charts=e._charts.map(n=>n._spec(e._title)),this._applyFilter(e,t);const s=new Set(t.tables?.map(n=>n.name.toLowerCase()));for(const n of e._tables.values())s.has(n.name.toLowerCase())||this._writeNewTable(e,t,n);this._applyTableFilters(e,t),this._applyCells(e,t),this._applyDimensions(e,t),t.cells&&m(t.cells)&&delete t.cells,t.columns&&m(t.columns)&&delete t.columns,t.rows&&m(t.rows)&&delete t.rows,t.format?.length===0&&delete t.format,t.tables?.length===0&&delete t.tables,t.blocks?.length===0&&delete t.blocks}_applyFilter(e,t){const{ref:s,_columns:n}=e._filter;if(s===void 0){delete t.filter;return}const o=k(s);if(!o)throw new TypeError(`${s} is not a range.`);const r={};for(const[a,f]of n)r[L(o.left+a)]=f;t.filter={range:s,...m(r)?{}:{columns:r}}}_applyTableFilters(e,t){for(const s of t.tables??[]){const n=e._tables.get(s.name);if(!n||n.autoFilter._columns.size===0)continue;const o=this._csv.get(s.rows)?.rows??[],r=ce(s,o)?.names??[],a={};for(const[f,c]of n.autoFilter._columns){const u=r[f];if(u===void 0)throw new RangeError(`Table ${s.name} has no column at ${String(f)}.`);a[u]=c}s.filter={columns:a}}}_applyDimensions(e,t){if(e._dimensions){for(const[s,n]of e._columns){const o={...t.columns?.[s]};n._width===void 0?delete o.width:o.width=n._width,n._hidden===void 0?delete o.hidden:o.hidden=n._hidden,n._files===void 0?delete o.files:o.files=n._files,n._level===void 0?delete o.level:o.level=n._level;const r=j(t.columns??{},s);t.columns=m(o)?r:{...r,[s]:o}}for(const[s,n]of e._rows){const o={...t.rows?.[String(s)]};n._height===void 0?delete o.height:o.height=n._height,n._hidden===void 0?delete o.hidden:o.hidden=n._hidden,n._level===void 0?delete o.level:o.level=n._level;const r=j(t.rows??{},String(s));t.rows=m(o)?r:{...r,[String(s)]:o}}e._dimensions=!1}}_applyCells(e,t){const s=(t.tables??[]).flatMap(r=>{const a=y(r.at),f=e._tables.get(r.name),c=f?k(f.ref):void 0;return a&&c?[{entry:r,area:c}]:[]}),n=(t.blocks??[]).flatMap(r=>{const a=e._model?.blocks.find(f=>f.file===r.rows);return a?[{entry:r,area:a.area}]:[]}),o=[];for(const r of e._cells.values()){if(!r._changed&&!r._styled)continue;const a=r.row-1,f=r.column-1,c=s.find(i=>N(i.area,a,f)),u=n.find(i=>N(i.area,a,f));c?(r._changed&&this._writeTableCell(c.entry,c.area,r),r._styled&&this._styleByFormat(t,r)):u?(r._changed&&this._setCsvCell(u.entry.rows,a-u.area.top,f-u.area.left,v(r)),r._styled&&this._styleByFormat(t,r)):r._fresh&&!e._model?.keys.has(a*16384+f)?o.push(r):this._writeLoose(e,t,r),r._changed=!1,r._styled=!1}this._consolidate(e,t,o),je(t)}_styleByFormat(e,t){(e.format??=[]).push({range:t.coordinate,...this._ownLook(t)})}_ownLook(e){const t=e._ws._model?.lookAt(e.row-1,e.column-1)??{},s=Fe(t,e._look);return s.format!==void 0&&e._formula===void 0&&M(v(e)).format===s.format&&delete s.format,s}_writeLoose(e,t,s){const n=s.coordinate,o=t.cells??={},r=U(s),a=this._ownLook(s),f=o[n],u={...f!==null&&typeof f=="object"?Object.fromEntries(Object.entries(f).filter(([_])=>_!=="value"&&_!=="formula"&&_!=="name")):{},...a},i=f!==null&&typeof f=="object"&&f.name!==void 0?{name:f.name}:{},h=e._model?.at(s.row-1,s.column-1)!==void 0;if(r===null&&m(u)&&!h){t.cells=j(o,n);return}o[n]=m(u)&&m(i)?r:{...typeof r=="string"&&r.startsWith("=")?{formula:r}:r===null?{}:{value:r},...i,...u}}_consolidate(e,t,s){const n=s.filter(i=>i._value!==null||i._formula!==void 0),o=new Map;for(const i of s){const h=this._ownLook(i);if(m(h))continue;const _=JSON.stringify(h),d=o.get(_);d?d.push(i):o.set(_,[i])}const r=new Map(n.map(i=>[`${String(i.row)}:${String(i.column)}`,i])),a=i=>r.get(`${String(i.row+1)}:${String(i.col+1)}`)??e.cell(i.row+1,i.col+1),f=new Map,c=[];for(const i of n){const h={row:i.row-1,col:i.column-1},_=i._formula===void 0?void 0:R(i);if(_===void 0){c.push(h);continue}const d=f.get(_);d?d.push(h):f.set(_,[h])}const u=t.cells??={};for(const i of f.values())for(const h of T(i))u[x(h)]=a({row:h.top,col:h.left})._formula??null;for(const i of T(c))if((i.bottom-i.top+1)*(i.right-i.left+1)>=this.block_cells){const _=[];for(let p=i.top;p<=i.bottom;p++){const D=[];for(let O=i.left;O<=i.right;O++)D.push(v(a({row:p,col:O})));_.push(D)}const d=this._dataPath(e._title);this._csv.set(d,{parsed:void 0,rows:_}),(t.blocks??=[]).push({at:C({row:i.top,col:i.left}),rows:d})}else for(let _=i.top;_<=i.bottom;_++)for(let d=i.left;d<=i.right;d++){const p=a({row:_,col:d});u[p.coordinate]=U(p)}for(const i of o.values()){const[h]=i;if(!h)continue;const _=this._ownLook(h),d=i.map(p=>({row:p.row-1,col:p.column-1}));for(const p of T(d))(t.format??=[]).push({range:x(p),..._})}}_build(){const e=new Map;for(const[t,s]of this._csv)e.set(t,s.parsed?re(s.parsed,s.rows):ee(s.rows));return{text:ue(this._text,this._file),files:e}}_rebase(e,t){const{workbook:s,problems:n}=I({text:e,read:o=>t.get(o)});if(!s)throw new Error(`The workbook is not one: ${n.map(o=>o.message).join("; ")}`);this._text=e,this._file=structuredClone(s.file),this._model=s;for(const[o,r]of t)this._keepCsv(o,r);this._calc=void 0,this._pending=!1;for(const o of this.worksheets){o._was=o._title;const r=s.sheet(o._title);r&&(o._model=r);for(const a of o._cells.values())a._fresh=r?.at(a.row-1,a.column-1)===void 0}this._names=new Map;for(const o of s.names.values())o.source.path?.[0]==="names"&&this._names.set(o.name,o.formula?o.formula.text:o.value??null)}_computed(){const e=[...this.defined_names.values()];if((this._pending||e.length!==this._names.size||e.some(t=>String(this._names.get(t.name)).replace(/^=/u,"")!==t.attr_text))&&this._apply(),!this._calc){const t=this._model;if(!t)throw new Error("The workbook has no sheets.");this._calc={calc:new Q(t).calculate(),model:t}}return this._calc}check(){this._apply();const{text:e,files:t}=this._build();return X({text:e,read:s=>t.get(s)}).problems}_generated(){if(this.worksheets.length===0)return this._applyNames(),{sheets:[],csv:{},...this._file.names?{names:this._file.names}:{}};this._apply();const e=structuredClone(this._file.sheets),t=n=>`${te}${n}`;for(const n of e){for(const o of n.tables??[])o.rows=t(o.rows);for(const o of n.blocks??[])o.rows=t(o.rows)}const s={};for(const[n,o]of this._build().files)s[t(n)]=o;return{sheets:e,csv:s,...this._file.names?{names:this._file.names}:{}}}save(e){if(this._making)throw new Error("sheet.ts makes sheets and saves nothing: what it adds to wb is what it makes.");const t=e??this.path;if(t===void 0)throw new TypeError("A new workbook is saved to a folder: wb.save('content/budget').");if(this.worksheets.length===0)throw new Error("A workbook has at least one sheet.");const{text:s,csv:n}=this._disk;this._apply();const o=new Set(this._file.sheets.flatMap(i=>[...(i.tables??[]).map(h=>h.rows),...(i.blocks??[]).map(h=>h.rows)])),r=[...this._csv.keys()].filter(i=>!o.has(i));for(const i of r)this._csv.delete(i);const{mkdirSync:a,rmSync:f,writeFileSync:c}=J(),u=process.getBuiltinModule("node:path");a(t,{recursive:!0}),(this._text!==s||e!==void 0)&&c($(t,P),this._text);for(const[i,h]of this._csv){const _=h.parsed?.source??"";if(e===void 0&&n.get(i)===_)continue;const d=$(t,i);a(u.dirname(d),{recursive:!0}),c(d,_)}if(e===void 0||t===this.path)for(const i of r)f($(t,i),{force:!0});this._disk={text:this._text,csv:new Map([...this._csv].map(([i,h])=>[i,h.parsed?.source??""]))},this.path=t}}function R(l){if(l._formula===void 0)return;const e=F(l._formula);if(e.ok)return ne(e.node,l.row-1,l.column-1)}function je(l){const e=l.format;if(!e||e.length<2)return;const t=[],s=new Map;for(const n of e){const{range:o,...r}=n,a=y(o);if(!a){t.push(n);continue}const f=JSON.stringify(r),c=s.get(f);c?c.places.push(a):s.set(f,{look:r,places:[a]})}for(const{look:n,places:o}of s.values())for(const r of T(o))t.push({range:x(r),...n});l.format=t}export function load_workbook(l,e={}){return Workbook.open(l,e)}export const get_column_letter=l=>L(l-1);export function column_index_from_string(l){const e=E(l);if(e===void 0)throw new TypeError(`${l} is not a column.`);return e+1}export function coordinate_to_tuple(l){const e=y(l);if(!e)throw new TypeError(`${l} is not a cell.`);return[e.row+1,e.col+1]}export function range_boundaries(l){const e=k(l);if(!e)throw new TypeError(`${l} is not a range.`);return[e.left+1,e.top+1,e.right+1,e.bottom+1]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RefNode, StructuredNode } from "../formula/ast.js";
|
|
2
|
-
import type { SharedFormula, Workbook } from "../workbook.js";
|
|
2
|
+
import type { SharedFormula, Workbook, Worksheet } from "../workbook.js";
|
|
3
3
|
export interface Analysis {
|
|
4
4
|
reads: (RefNode | StructuredNode)[];
|
|
5
5
|
/** Defined names, in lower case. */
|
|
@@ -9,13 +9,19 @@ export interface Analysis {
|
|
|
9
9
|
unknownNames: string[];
|
|
10
10
|
/** Functions that are nothing here. */
|
|
11
11
|
unknownFunctions: string[];
|
|
12
|
-
/** Functions given too few or too many arguments. */
|
|
12
|
+
/** Functions given too few or too many arguments, or a repeating group of them left short (`group`, its size). */
|
|
13
13
|
arguments: {
|
|
14
14
|
name: string;
|
|
15
15
|
given: number;
|
|
16
16
|
min: number;
|
|
17
17
|
max: number;
|
|
18
|
+
group?: number;
|
|
18
19
|
}[];
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* A formula's analysis. `sheet`: the sheet it is on, whose own names come
|
|
23
|
+
* before the workbook's; without it every sheet's name of a spelling counts,
|
|
24
|
+
* so what a formula can read is never less than it reads.
|
|
25
|
+
*/
|
|
26
|
+
export declare function analyse(wb: Workbook, shared: SharedFormula, sheet?: Worksheet): Analysis;
|
|
21
27
|
//# sourceMappingURL=analyse.d.ts.map
|