allyhub 0.6.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 +5 -5
- 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/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 +69 -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 +847 -116
- 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 +3 -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 +501 -38
- 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/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 +79 -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 +21 -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/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 +10 -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 +3 -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 +42 -1
- 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 +59 -39
- 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 +27 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.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 +179 -16
- 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 -1
- 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 +2 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -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 +21 -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/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/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 -67
- 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 -178
- 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-core/dist/preset.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
- 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 -56
- 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 -72
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
- 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 -32
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
- 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-BW2s9FMO.js +0 -4
- package/editor-web/assets/dist-C-6JmebI.js +0 -233
- package/editor-web/assets/dist-CCYMLMKN.js +0 -6
- package/editor-web/assets/dist-CHzurjMx.js +0 -33
- package/editor-web/assets/dist-DF7H1dxw.js +0 -1
- package/editor-web/assets/dist-Da5AUSKX.js +0 -2
- package/editor-web/assets/index-B7S9RZhL.css +0 -2
- package/editor-web/assets/index-CovQYWvD.js +0 -69
- package/editor-web/assets/minus-BrvjaJyO.js +0 -1
- package/editor-web/assets/react-DV5fPdiH.js +0 -101
- package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
- package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
- package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
- /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type Area } from "./address.js";
|
|
2
2
|
import type { Calc } from "./calc/engine.js";
|
|
3
|
+
import { DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT, type PrintJob } from "./paginate.js";
|
|
3
4
|
import { type Worksheet } from "./workbook.js";
|
|
4
|
-
|
|
5
|
-
export declare const DEFAULT_COLUMN_WIDTH = 64;
|
|
6
|
-
export declare const DEFAULT_ROW_HEIGHT = 20;
|
|
5
|
+
export { DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT };
|
|
7
6
|
export interface SheetHtmlOptions {
|
|
8
7
|
/** The sheets drawn; default every one that is not hidden. */
|
|
9
8
|
sheets?: readonly Worksheet[];
|
|
@@ -29,6 +28,55 @@ export interface SheetHtml {
|
|
|
29
28
|
/** What `rows` and `columns` left out, a line per sheet. */
|
|
30
29
|
cut: string[];
|
|
31
30
|
}
|
|
32
|
-
/** A workbook's sheets as one page of HTML. */
|
|
31
|
+
/** A workbook's sheets as one page of HTML, as a person sees them: for a picture, and frames. */
|
|
33
32
|
export declare function sheetHtml(calc: Calc, o?: SheetHtmlOptions): SheetHtml;
|
|
33
|
+
/** What a header's or footer's codes name, for one page. */
|
|
34
|
+
export interface PageFields {
|
|
35
|
+
page: number;
|
|
36
|
+
pages: number;
|
|
37
|
+
sheet: string;
|
|
38
|
+
/** The workbook's file name, &F. */
|
|
39
|
+
file: string;
|
|
40
|
+
/** When it is printed, for &D and &T. */
|
|
41
|
+
date: Date;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A header's or footer's section as HTML: Excel's codes, &P and &N (with
|
|
45
|
+
* +n or -n), &D, &T, &F, &A, &Z, &&, &B, &I, &U, &E, &S, &X, &Y, a font
|
|
46
|
+
* (&"name,style"), a size (&14) and a colour (&KFF0000). A picture (&G)
|
|
47
|
+
* draws nothing.
|
|
48
|
+
*/
|
|
49
|
+
export declare function headerFooterHtml(text: string, f: PageFields): string;
|
|
50
|
+
export interface PrintHtmlOptions {
|
|
51
|
+
css?: string;
|
|
52
|
+
font?: string;
|
|
53
|
+
/** The workbook's file name, a header's &F. */
|
|
54
|
+
name: string;
|
|
55
|
+
/** When it is printed, a header's &D and &T. */
|
|
56
|
+
date: Date;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A workbook on paper: its pages, laid out once, and any stretch of them
|
|
60
|
+
* as one HTML page that prints them. What drawing a sheet needs (its
|
|
61
|
+
* pictures, its tables' stripes, its charts) is read once for every
|
|
62
|
+
* stretch.
|
|
63
|
+
*/
|
|
64
|
+
export declare class SheetPrint {
|
|
65
|
+
readonly job: PrintJob;
|
|
66
|
+
private readonly calc;
|
|
67
|
+
private readonly drawers;
|
|
68
|
+
private readonly file;
|
|
69
|
+
constructor(calc: Calc, o?: {
|
|
70
|
+
sheets?: readonly Worksheet[];
|
|
71
|
+
file?: SheetHtmlOptions["file"];
|
|
72
|
+
});
|
|
73
|
+
private drawer;
|
|
74
|
+
/**
|
|
75
|
+
* Pages `from` to before `to` as one HTML page that prints them: each
|
|
76
|
+
* the paper's size, its header and footer in its margins, its title rows
|
|
77
|
+
* and columns, then its own, scaled, and the charts that fall in them.
|
|
78
|
+
*/
|
|
79
|
+
html(from: number, to: number, o: PrintHtmlOptions): string;
|
|
80
|
+
private page;
|
|
81
|
+
}
|
|
34
82
|
//# sourceMappingURL=html.d.ts.map
|
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{formatColor as
|
|
3
|
-
${t.
|
|
4
|
-
|
|
2
|
+
import{formatColor as O,isValidFormat as P}from"numfmt";import{cellName as T,columnLetter as _}from"./address.js";import{chartDef as U,chartPlace as k,chartSize as q,chartSvg as V}from"./chart.js";import{fileCells as K,isPicture as Y,pictureHeight as X,pictureSize as Z}from"./files.js";import{generalForms as J,shownValue as Q}from"./format.js";import{DEFAULT_COLUMN_WIDTH as tt,DEFAULT_ROW_HEIGHT as D,columnHidden as N,columnWidth as M,pageTitleCols as et,pageTitleRows as nt,rowHeight as st,rowHidden as H,paginate as it,usedWithCharts as ot}from"./paginate.js";import{Rules as rt,iconShape as lt}from"./rules.js";import{tableStyleLook as at,tableStyleOf as dt}from"./table-style.js";import{CellError as ct}from"./values.js";import{placeKey as I}from"./workbook.js";export{tt as DEFAULT_COLUMN_WIDTH,D as DEFAULT_ROW_HEIGHT};const ht={"&":"&","<":"<",">":">",'"':"""},ft=o=>{let t="";for(let e=0;e<o.length;e+=32768)t+=String.fromCharCode(...o.subarray(e,e+32768));return btoa(t)},v=o=>o.replace(/[&<>"]/gu,t=>ht[t]??t),gt={thin:"1px solid",medium:"2px solid",thick:"3px solid",double:"3px double",hair:"1px dotted",dotted:"1px dotted",dashed:"1px dashed",dashDot:"1px dashed",dashDotDot:"1px dashed",mediumDashed:"2px dashed",mediumDashDot:"2px dashed",mediumDashDotDot:"2px dashed",slantDashDot:"2px dashed"},pt={left:"left",center:"center",right:"right",justify:"justify",distributed:"justify",centerContinuous:"center",fill:"left"},ut={top:"top",center:"middle",justify:"middle",distributed:"middle"};function mt(o){if(typeof o=="number")return"right";if(typeof o=="boolean"||o instanceof ct)return"center"}const $t={up:"▲","up-right":"◥",right:"▶","down-right":"◢",down:"▼",circle:"●",flag:"⚑",check:"✔",bang:"!",cross:"✖",triangle:"▲",diamond:"◆",bars:"▮",quarter:"◔"};function wt(o){const{shape:t,color:e,level:i}=lt(o.set,o.index),l=($t[t]??"●").repeat(t==="bars"?i??1:1);return`<span style="float:left;color:${e}">${l}</span>`}function bt(o,t,e){const i=[];o.bold===!0&&i.push("font-weight:bold"),o.italic===!0&&i.push("font-style:italic");const l=[o.underline?"underline":"",o.strike===!0?"line-through":""].filter(Boolean);l.length>0&&i.push(`text-decoration:${l.join(" ")}`),o.font!==void 0&&i.push(`font-family:"${o.font.replace(/["\\]/gu,"")}",var(--font)`),o.size!==void 0&&i.push(`font-size:${String(o.size)}pt`);const r=(typeof t=="number"&&e!==void 0&&P(e)?O(e,t)??void 0:void 0)??o.color;typeof r=="string"&&i.push(`color:${r}`);const{fill:d}=o;if(typeof d=="string")i.push(`background:${d}`);else if(d){const s=d.color??d.background;s!==void 0&&i.push(`background:${s}`)}const f=(o.align===void 0||o.align==="general"?void 0:pt[o.align])??mt(t);f!==void 0&&i.push(`text-align:${f}`);const c=o.valign===void 0?void 0:ut[o.valign];c!==void 0&&i.push(`vertical-align:${c}`),o.wrap===!0&&i.push("white-space:pre-wrap","overflow-wrap:anywhere"),o.indent!==void 0&&i.push(`padding-left:${String(3+o.indent*9)}px`);for(const s of["left","right","top","bottom"]){const n=o.border?.[s];n&&n.style!=="none"&&i.push(`border-${s}:${gt[n.style]??"1px solid"} ${n.color??"#000"}`)}return i.join(";")}class L{names=new Map;of(t){if(t==="")return"";let e=this.names.get(t);return e||(e=`s${String(this.names.size)}`,this.names.set(t,e)),e}css(){return[...this.names].map(([t,e])=>`.${e}{${t}}`).join(`
|
|
3
|
+
`)}}class W{calc;sheet;rules;read;drawnFiles;bands=new Map;svgs=new Map;constructor(t,e,i){this.calc=t,this.sheet=e,this.read=i,this.rules=e.conditions.length>0?new rt(e,t):void 0}files(){if(this.drawnFiles)return this.drawnFiles;const t=new Map,e=new Map,i=this.read;for(const{row:l,col:r,paths:d,column:f}of i?K(this.sheet,this.calc):[]){const c=X(f),s=d.map(n=>{const a=Y(n)?i?.(n):void 0,h=a&&Z(a);return!a||!h?v(n):(e.set(l,Math.max(e.get(l)??0,c)),`<img src="data:image/${h.type};base64,${ft(a)}" alt="${v(n)}" style="height:${String(c)}px">`)});t.set(I(l,r),s.join(" "))}return this.drawnFiles={cells:t,rows:e},this.drawnFiles}height(t){return this.sheet.spec.rows?.[String(t+1)]?.height??this.files().rows.get(t)??D}band(t,e){if(e===t.at.row)return;let i=this.bands.get(t);if(!i){i=new Map;let l=0;for(let r=t.at.row+1;r<=t.area.bottom;r++)H(this.calc,this.sheet,r)||i.set(r,l++);this.bands.set(t,i)}return i.get(e)??0}cell(t,e,i,l,r){const{sheet:d}=this,f=this.calc.value(d,t,e),c=this.rules?.at(t,e),s=d.lookAt(t,e),n=d.tableAt(t,e),a=n&&dt(n),h=n&&a?at(a,n,t,e,this.band(n,t)):void 0,g={...h,...s,...c?.look,...c?.scale===void 0?{}:{fill:c.scale}};(h?.border||s.border)&&(g.border={...h?.border,...s.border,...c?.look?.border});const w=g.format;let m=bt(g,f,w);if(c?.bar){const C=`${String(Math.round(c.bar.share*100))}%`;m=[m,`background:linear-gradient(90deg,${c.bar.color} ${C},transparent ${C})`].filter(Boolean).join(";")}const p=this.files().cells.get(I(t,e)),y=c?.icon?wt(c.icon):"",x=p??(c?.bare===!0?"":v(Q(f,w))),b=typeof f=="string"&&g.wrap!==!0&&l&&!i,S=typeof f=="number"&&!p&&y===""&&x!=="",F=S&&(w===void 0||w==="General"),j=[r.of(m),b?"over":"",S?"n":""].filter(Boolean).join(" ");return`<td${[j===""?"":` class="${j}"`,F?` data-g="${v(J(f).slice(1).join(" "))}"`:"",i&&i.rows>1?` rowspan="${String(i.rows)}"`:"",i&&i.cols>1?` colspan="${String(i.cols)}"`:""].join("")}>${y}${x}</td>`}spans(t,e){const i=new Map,l=new Set;for(const r of this.sheet.merges){const d=t.filter(n=>n>=r.top&&n<=r.bottom),f=e.filter(n=>n>=r.left&&n<=r.right),[c]=d,[s]=f;if(!(c===void 0||s===void 0)){for(const n of d)for(const a of f)l.add(`${String(n)}:${String(a)}`);l.delete(`${String(c)}:${String(s)}`),i.set(`${String(c)}:${String(s)}`,{rows:d.length,cols:f.length})}}return{spans:i,covered:l}}table(t,e,i,l){const{sheet:r}=this,{spans:d,covered:f}=this.spans(t,e),c=e.map(h=>M(r,h)),s=l.headings?B:0,n=c.reduce((h,g)=>h+g,0)+s,a=[`<table class="${l.className??""}" style="width:${String(n)}px"><colgroup>`,l.headings?`<col style="width:${String(s)}px">`:"",...c.map(h=>`<col style="width:${String(h)}px">`),"</colgroup>"];l.headings&&a.push(`<thead><tr><th></th>${e.map(h=>`<th>${_(h)}</th>`).join("")}</tr></thead>`),a.push("<tbody>");for(const h of t)a.push(`<tr style="height:${String(this.height(h))}px">`),l.headings&&a.push(`<th>${String(h+1)}</th>`),e.forEach((g,w)=>{const m=`${String(h)}:${String(g)}`;if(f.has(m))return;const p=e[w+1],y=p!==void 0&&r.at(h,p)===void 0&&!f.has(`${String(h)}:${String(p)}`);a.push(this.cell(h,g,d.get(m),y,i))}),a.push("</tr>");return a.push("</tbody></table>"),{html:a.join(""),width:n}}svg(t){let e=this.svgs.get(t);if(e===void 0){const{width:i,height:l}=q(t.spec);e=V(U(this.calc,this.sheet,t),i,l,{font:"var(--font)"}),this.svgs.set(t,e)}return e}charts(t,e,i){const{sheet:l}=this;if(l.charts.length===0||t.length===0||e.length===0)return"";const r=(s,n)=>{const a=new Map;let h=0;for(const g of s)a.set(g,h),h+=n(g);return{at:a,sum:h}},d=r(t,s=>this.height(s)),f=r(e,s=>M(l,s)),c=(s,n,a,h)=>{const g=s[0]??0;if(a<g){let m=0;for(let p=a;p<g;p++)m-=h(p);return m}const w=s.find(m=>m>=a);return w===void 0?1/0:n.get(w)??0};return l.charts.map(s=>{const n=k(s.spec,h=>c(t,d.at,h,g=>H(this.calc,l,g)?0:st(l,g)),h=>c(e,f.at,h,g=>N(l,g)?0:M(l,g)));return n.left<f.sum&&n.left+n.width>0&&n.top<d.sum&&n.top+n.height>0?`<div class="chart" style="left:${String(i.left+n.left)}px;top:${String(i.top+n.top)}px">${this.svg(s)}</div>`:""}).join("")}}const B=44,yt=`
|
|
4
|
+
(() => {
|
|
5
|
+
const fit = () => {
|
|
6
|
+
const cells = Array.from(document.querySelectorAll("td.n"));
|
|
7
|
+
const over = cells.filter((td) => td.scrollWidth > td.clientWidth);
|
|
8
|
+
for (const td of over) {
|
|
9
|
+
const room = td.clientWidth;
|
|
10
|
+
const fits = (t) => { td.textContent = t; return td.scrollWidth <= room; };
|
|
11
|
+
const g = td.dataset.g;
|
|
12
|
+
// General's shorter forms, from the engine (generalForms), widest first.
|
|
13
|
+
if (g !== undefined && g !== "" && g.split(" ").some(fits)) continue;
|
|
14
|
+
td.textContent = "#";
|
|
15
|
+
const style = getComputedStyle(td);
|
|
16
|
+
const inner = room - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
|
|
17
|
+
const range = document.createRange();
|
|
18
|
+
range.selectNodeContents(td);
|
|
19
|
+
const one = range.getBoundingClientRect().width || 1;
|
|
20
|
+
td.textContent = "#".repeat(Math.max(1, Math.floor(inner / one)));
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
window.allyhubReady = new Promise((r) => addEventListener("load", r, { once: true })).then(() => document.fonts.ready).then(fit);
|
|
25
|
+
})();
|
|
26
|
+
`;function G(o,t,e){return`<!doctype html><html><head><meta charset="utf-8"><style>
|
|
27
|
+
${o.css??""}
|
|
28
|
+
:root{--font:${o.font===void 0?"":`"${o.font}",`}Carlito,Calibri,"Noto Sans SC",Arial,sans-serif}
|
|
5
29
|
*{box-sizing:border-box}
|
|
6
30
|
html,body{margin:0;background:#fff;color:#000}
|
|
7
31
|
body{font:11pt/1.2 var(--font)}
|
|
8
|
-
.sheet{break-after:page}
|
|
9
|
-
.sheet:last-child{break-after:auto}
|
|
10
|
-
h2{font:bold 12pt var(--font);margin:0 0 8px;${e?"":"display:none"}}
|
|
11
32
|
table{table-layout:fixed;border-collapse:collapse}
|
|
12
|
-
td,th{height:${String(
|
|
33
|
+
td,th{height:${String(D)}px;padding:0 3px;overflow:hidden;white-space:pre;vertical-align:bottom}
|
|
13
34
|
td.over{overflow:visible}
|
|
14
|
-
.book{position:relative;width:max-content;overflow:hidden}
|
|
15
35
|
.chart{position:absolute;line-height:0}
|
|
16
36
|
.grid td{border:1px solid #e3e3e3}
|
|
17
37
|
.edged th{border:1px solid #e3e3e3;background:#f5f5f5;color:#555;font-weight:normal;text-align:center;vertical-align:middle;font-size:9pt}
|
|
18
|
-
${
|
|
19
|
-
`)}
|
|
20
|
-
|
|
38
|
+
${t}
|
|
39
|
+
</style><script>${yt}<\/script></head><body>${e}</body></html>`}export function sheetHtml(o,t={}){const e=t.sheets??o.wb.sheets.filter(s=>s.spec.hidden!==!0),i=new L,l=[];let r=0;const d=e.length>1&&t.area===void 0,f=e.map(s=>{const n=new W(o,s,t.file),a=t.area??ot(s)??{top:0,left:0,bottom:0,right:0},h=[];for(let b=a.top;b<=a.bottom;b++)H(o,s,b)||h.push(b);const g=[];for(let b=a.left;b<=a.right;b++)N(s,b)||g.push(b);const w=h.slice(0,t.rows??h.length),m=g.slice(0,t.columns??g.length);if(w.length<h.length||m.length<g.length){const b=w[w.length-1]??a.top,S=m[m.length-1]??a.left;l.push(`${s.name}: drew ${T({row:a.top,col:a.left})}:${T({row:b,col:S})} of ${String(h.length)} rows and ${String(g.length)} columns`)}const p=t.headings===!0,y=n.table(w,m,i,{headings:p,className:p?s.spec.gridlines===!1?"edged":"edged grid":""});r=Math.max(r,y.width);const x=n.charts(w,m,{left:p?B:0,top:p?D:0});return`<section class="sheet">${d?`<h2>${v(s.name)}</h2>`:""}<div class="book">${y.html}${x}</div></section>`});return{html:G(t,`h2{font:bold 12pt var(--font);margin:0 0 8px}
|
|
40
|
+
.sheet+.sheet{margin-top:24px}
|
|
41
|
+
.book{position:relative;width:max-content;overflow:hidden}
|
|
42
|
+
${i.css()}`,f.join("")),width:r,cut:l}}const z=o=>String(o).padStart(2,"0");export function headerFooterHtml(o,t){let e="",i=0;const l=d=>{e+=`<span style="${d}">`,i++},r={B:"font-weight:bold",I:"font-style:italic",U:"text-decoration:underline",E:"text-decoration:underline double",S:"text-decoration:line-through",X:"vertical-align:super;font-size:smaller",Y:"vertical-align:sub;font-size:smaller"};for(let d=0;d<o.length;d++){const f=o[d]??"";if(f!=="&"){e+=v(f);continue}const c=o[d+1]??"",s=c.toUpperCase();if(d++,c==="&")e+="&";else if(s==="P"||s==="N"){const n=/^[+-]\d+/u.exec(o.slice(d+1)),a=s==="P"?t.page:t.pages;e+=String(a+(n?Number(n[0]):0)),n&&(d+=n[0].length)}else if(s==="D")e+=`${String(t.date.getFullYear())}-${z(t.date.getMonth()+1)}-${z(t.date.getDate())}`;else if(s==="T")e+=`${z(t.date.getHours())}:${z(t.date.getMinutes())}`;else if(s==="F"||s==="Z")e+=v(t.file);else if(s==="A")e+=v(t.sheet);else{if(s==="G")continue;if(r[s]!==void 0)l(r[s]);else if(c==='"'){const n=o.indexOf('"',d+1),[a="",h=""]=o.slice(d+1,n<0?o.length:n).split(",");d=n<0?o.length:n;const g=[a==="-"||a===""?"":`font-family:"${a.replace(/["\\]/gu,"")}",var(--font)`,/bold/iu.test(h)?"font-weight:bold":"",/italic/iu.test(h)?"font-style:italic":""].filter(Boolean).join(";");g!==""&&l(g)}else if(/\d/u.test(c)){const n=/^\d+/u.exec(o.slice(d))?.[0]??c;d+=n.length-1,l(`font-size:${n}pt`)}else if(s==="K"){const n=o.slice(d+1,d+7);d+=6,/^[0-9A-Fa-f]{6}$/u.test(n)&&l(`color:#${n}`)}}}return e+"</span>".repeat(i)}const u=o=>`${String(Math.round(o*1e3)/1e3)}px`;export class SheetPrint{job;calc;drawers=new Map;file;constructor(t,e={}){this.calc=t,this.file=e.file,this.job=it(t,{...e.sheets?{sheets:e.sheets}:{},height:(i,l)=>this.drawer(i).height(l)})}drawer(t){let e=this.drawers.get(t);return e||(e=new W(this.calc,t,this.file),this.drawers.set(t,e)),e}html(t,e,i){const l=new L,r=new Map,d=[];for(const c of this.job.pages.slice(t,e)){const{of:s}=c,n=`${u(s.paper.width)} ${u(s.paper.height)}`;let a=r.get(n);a===void 0&&(a=`paper${String(r.size)}`,r.set(n,a)),d.push(this.page(c,l,a,i))}const f=[...r].map(([c,s])=>`@page ${s}{size:${c};margin:0}`).join(`
|
|
43
|
+
`);return G(i,`${f}
|
|
44
|
+
.page{position:relative;overflow:hidden;break-after:page}
|
|
45
|
+
.page:last-child{break-after:auto}
|
|
46
|
+
.body,.charts{position:absolute;overflow:hidden}
|
|
47
|
+
.scaled{position:absolute;left:0;top:0;transform-origin:0 0}
|
|
48
|
+
.hf{position:absolute;display:flex;white-space:pre;font-size:11pt;line-height:1.2}
|
|
49
|
+
.hf>div{flex:1 1 0;overflow:visible}
|
|
50
|
+
.hf>.c{text-align:center}
|
|
51
|
+
.hf>.r{text-align:right}
|
|
52
|
+
${l.css()}`,d.join(""))}page(t,e,i,l){const{of:r}=t,d=this.drawer(r.sheet),{margins:f,scale:c}=r,s=nt(t),n=et(t),a=r.rows.slice(t.down.from,t.down.to),h=r.cols.slice(t.across.from,t.across.to),g=d.table([...s,...a],[...n,...h],e,{headings:!1}),w=s.reduce(($,A)=>$+d.height(A),0),m=n.reduce(($,A)=>$+M(r.sheet,A),0),p=r.rowAt[t.down.from]??0,y=r.colAt[t.across.from]??0,x=(r.rowAt[t.down.to]??0)-p,b=(r.colAt[t.across.to]??0)-y,S=r.charts.filter($=>$.left<y+b&&$.left+$.width>y&&$.top<p+x&&$.top+$.height>p).map($=>`<div class="chart" style="left:${u($.left-y)};top:${u($.top-p)}">${d.svg($.chart)}</div>`).join(""),F=S===""?"":`<div class="charts" style="left:${u(m)};top:${u(w)};width:${u(b)};height:${u(x)}">${S}</div>`,j=r.paper.width-f.left-f.right,R=r.paper.height-f.top-f.bottom,C={page:t.number,pages:this.job.pages.length,sheet:r.sheet.name,file:l.name,date:l.date},E=($,A)=>$?`<div class="hf" style="left:${u(f.left)};right:${u(f.right)};${A}"><div>${headerFooterHtml($.left??"",C)}</div><div class="c">${headerFooterHtml($.center??"",C)}</div><div class="r">${headerFooterHtml($.right??"",C)}</div></div>`:"";return`<section class="page" style="page:${i};width:${u(r.paper.width)};height:${u(r.paper.height)}">`+E(r.header,`top:${u(f.header)}`)+`<div class="body" style="left:${u(f.left)};top:${u(f.top)};width:${u(j)};height:${u(R)}"><div class="scaled" style="width:${u(j/c)};height:${u(R/c)}${c===1?"":`;transform:scale(${String(c)})`}">`+g.html+F+"</div></div>"+E(r.footer,`bottom:${u(f.footer)}`)+"</section>"}}
|
|
@@ -3,6 +3,8 @@ export { DEFAULT_DIALECT, csvField, csvRecord, csvRows, fromTsv, readCsv, toTsv,
|
|
|
3
3
|
export { patchCsv } from "./patch.js";
|
|
4
4
|
export * from "./values.js";
|
|
5
5
|
export * from "./workbook.js";
|
|
6
|
+
export * from "./calc/remote.js";
|
|
7
|
+
export * from "./calc/server.js";
|
|
6
8
|
export { dataFilesOf, readSheetFile, type SheetProblem } from "./file.js";
|
|
7
9
|
export { GENERATED, ordinarySheet, typedNumbers, withGenerated, type GeneratedSheets, type MergedFile, } from "./generated.js";
|
|
8
10
|
export { applyScenario, cellOfName, scenarioNames, scenariosByCell, type ScenarioCell, type SheetScenarios, } from "./scenario.js";
|
|
@@ -17,9 +19,11 @@ export { analyse, type Analysis } from "./calc/analyse.js";
|
|
|
17
19
|
export { FUNCTIONS } from "./calc/functions/index.js";
|
|
18
20
|
export { Reference } from "./calc/types.js";
|
|
19
21
|
export { checkWorkbook, placeName, type CheckedWorkbook } from "./check.js";
|
|
20
|
-
export { csvOf, jsonOf, markdownOf, tableRows } from "./export.js";
|
|
21
|
-
export {
|
|
22
|
-
export { DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT, sheetHtml, type SheetHtml, type SheetHtmlOptions, } from "./html.js";
|
|
22
|
+
export { csvOf, csvText, dataValue, excelNumber, jsonOf, markdownOf, tableRows, type CsvOptions, type ValueMode, type ValueOptions, } from "./export.js";
|
|
23
|
+
export { generalForms, generalText, isDateCode, shownColor, shownValue, } from "./format.js";
|
|
24
|
+
export { DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT, headerFooterHtml, sheetHtml, SheetPrint, type PageFields, type PrintHtmlOptions, type SheetHtml, type SheetHtmlOptions, } from "./html.js";
|
|
25
|
+
export { PAPERS, PRINT_DEFAULTS, paginate, type PaginateOptions, type PrintJob, type PrintedPage, type SheetPages, } from "./paginate.js";
|
|
26
|
+
export { DEFAULT_TABLE_STYLE, tableStyleLook, tableStyleOf, type TablePart, type TableStyle, } from "./table-style.js";
|
|
23
27
|
export { PROFILE_TOP, profileTable, type ColumnProfile } from "./profile.js";
|
|
24
28
|
export { importRows, type ImportedSheet } from "./import.js";
|
|
25
29
|
export { patchYaml, writeYaml } from "./write.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export*from"./address.js";export{DEFAULT_DIALECT,csvField,csvRecord,csvRows,fromTsv,readCsv,toTsv,writeCsv}from"./csv.js";export{patchCsv}from"./patch.js";export*from"./values.js";export*from"./workbook.js";export{dataFilesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,jsonOf,markdownOf,tableRows}from"./export.js";export{
|
|
2
|
+
export*from"./address.js";export{DEFAULT_DIALECT,csvField,csvRecord,csvRows,fromTsv,readCsv,toTsv,writeCsv}from"./csv.js";export{patchCsv}from"./patch.js";export*from"./values.js";export*from"./workbook.js";export*from"./calc/remote.js";export*from"./calc/server.js";export{dataFilesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,csvText,dataValue,excelNumber,jsonOf,markdownOf,tableRows}from"./export.js";export{generalForms,generalText,isDateCode,shownColor,shownValue}from"./format.js";export{DEFAULT_COLUMN_WIDTH,DEFAULT_ROW_HEIGHT,headerFooterHtml,sheetHtml,SheetPrint}from"./html.js";export{PAPERS,PRINT_DEFAULTS,paginate}from"./paginate.js";export{DEFAULT_TABLE_STYLE,tableStyleLook,tableStyleOf}from"./table-style.js";export{PROFILE_TOP,profileTable}from"./profile.js";export{importRows}from"./import.js";export{patchYaml,writeYaml}from"./write.js";export*from"./edit.js";export*from"./arrange.js";export{NO_LOOK,autoFill,copyLooks,fillDownTo,moveCells,pasteLooks}from"./fill.js";export{seriesAfter}from"./series.js";export{compareForSort,hasHeader,sortCells,sortedOrder,sortedRows}from"./sort.js";export{filterChoices,filteredRows,regionAround}from"./filter.js";export{Rules,colorBetween,compareValues,holds,iconShape}from"./rules.js";export{choicesIn,invalidCells,joinChoices,listValues,separatorOf,valid}from"./validate.js";export{freeColumn,restructure,tableShape,uniqueColumn,withColumnsUpTo}from"./structure.js";export{SHEET_CHART_DEFAULTS,chartAfter,chartDataRange,chartDef,chartOfRange,chartPlace,chartSize,chartSvg,readDataRange}from"./chart.js";export{INSPECT_DEFAULTS,SHEET_FACT_KINDS,inspectWorkbook}from"./inspect.js";export{DIFF_DEFAULTS,diffWorkbooks}from"./diff.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{cellName as g}from"./address.js";import"./calc/types.js";import{analyse as y}from"./calc/analyse.js";import{dataValue as S
|
|
2
|
+
import{cellName as g}from"./address.js";import"./calc/types.js";import{analyse as y}from"./calc/analyse.js";import{dataValue as S}from"./export.js";import{shownValue as x}from"./format.js";import{relativeKey as _}from"./formula/move.js";import{exceptionsOf as C}from"./edit.js";import{invalidCells as F}from"./validate.js";import{CellError as E}from"./values.js";import{FormulaCell as v}from"./workbook.js";export const SHEET_FACT_KINDS=["sheet-error","sheet-number","sheet-unlike","sheet-exception","sheet-unused","sheet-invalid","sheet-typed","sheet-ordinary"],INSPECT_DEFAULTS={plain:[0,1,-1],around:1};function w(o){const s=new Map;for(const t of o.formulas){const n=s.get(t.shared);n?(n.count+=1,(t.row<n.first.row||t.row===n.first.row&&t.col<n.first.col)&&(n.first=t)):s.set(t.shared,{shared:t.shared,first:t,count:1})}return[...s.values()].sort((t,n)=>t.first.row-n.first.row||t.first.col-n.first.col)}function k(o,s,t){switch(o.kind){case"number":t.push({value:o.value,in:s});return;case"unary":o.op==="-"&&o.arg.kind==="number"?t.push({value:-o.arg.value,in:s}):k(o.arg,o.op,t);return;case"postfix":k(o.arg,o.op,t);return;case"paren":k(o.arg,s,t);return;case"binary":k(o.left,o.op,t),k(o.right,o.op,t);return;case"array":for(const n of o.rows)for(const l of n)k(l,"{}",t);return;case"call":for(const n of o.args)k(n,o.name,t);return;case"invoke":k(o.callee,s,t);for(const n of o.args)k(n,"LAMBDA",t);return;default:return}}function N(o,s){const t={error:!1};for(const n of o.precedents(s))if(o.each(n,l=>{l instanceof E&&(t.error=!0)}),t.error)return!1;return!0}const b=new WeakMap;function A(o){const s=b.get(o);if(s!==void 0)return s;const t=o.node?_(o.node,o.row,o.col):o.text;return b.set(o,t),t}const I=(o,s)=>o instanceof v?o.text:x(o,s);function M(o,s,t){const n=[],l=(r,e)=>{if(r<0||e<0)return;const u=o.at(r,e);return u instanceof v?A(u.shared):void 0},c=(r,e,u,i)=>{const f=u==="column"?1:0,a=u==="row"?1:0,h=o.at(r,e);if(h===void 0||h instanceof v&&A(h.shared)===i)return;for(let d=1;d<=s;d++)if(l(r-f*d,e-a*d)!==i||l(r+f*d,e+a*d)!==i)return;if(t.has(r*16384+e))return;let m=s*2;for(let d=s+1;l(r-f*d,e-a*d)===i;d++)m+=1;for(let d=s+1;l(r+f*d,e+a*d)===i;d++)m+=1;const p=o.at(r-f,e-a);n.push({sheet:o.name,cell:g({row:r,col:e}),holds:I(h,o.lookAt(r,e).format),neighbour:p instanceof v?p.text:"",along:u,run:m})};for(const r of o.formulas){const e=A(r.shared);c(r.row+1,r.col,"column",e),c(r.row,r.col+1,"row",e)}return n.sort((r,e)=>T(r.cell,e.cell))}const T=(o,s)=>o.length-s.length||o.localeCompare(s,"en",{numeric:!0});function R(o,s){const t=[],n=(c,r)=>{c&&t.push(...o.readsOfFormula(c,r))};for(const c of s.sheets){for(const r of c.conditions)for(const e of r.formulas)n(e,c);for(const r of c.validations)for(const e of r.formulas)n(e,c);for(const r of c.charts){n(r.title,c),n(r.categories,c);for(const e of r.series)n(e.values,c),n(e.x,c),n(e.name,c)}}const l=s.sheets[0];if(l){for(const c of s.checks)n(c.formula,l);for(const c of s.names.values())n(c.formula,l)}return t}function D(o){const s=new Set,t=n=>{if(n)for(const l of y(o,n).names)s.add(l)};for(const n of o.sheets){for(const{shared:l}of w(n))t(l);for(const l of n.conditions)l.formulas.forEach(t);for(const l of n.validations)l.formulas.forEach(t);for(const l of n.charts){t(l.title),t(l.categories);for(const c of l.series)t(c.values),t(c.x),t(c.name)}}for(const n of o.checks)t(n.formula);return s}function K(o,s,t){const n=[],l=D(s);for(const e of s.names.values())l.has(e.name.toLowerCase())||n.push({what:"name",name:e.name,value:e.formula?.text??x(e.value??null)});const c=R(o,s),r=(e,u,i)=>c.some(f=>f.sheet===e&&u>=f.top&&u<=f.bottom&&i>=f.left&&i<=f.right)||o.readers(e,u,i).length>0;for(const e of s.sheets){for(let u=0;u<e.columnsUsed;u++){const[i,f]=e.span(u,0,Number.MAX_SAFE_INTEGER);for(let a=i;a<=f;a++){const h=e.at(a,u);typeof h=="number"&&(e.tableAt(a,u)||e.blockAt(a,u)||r(e,a,u)||n.push({what:"cell",sheet:e.name,name:g({row:a,col:u}),value:x(h,e.lookAt(a,u).format)}))}}if(t)for(const u of e.tables)for(const i of u.columns){const f=u.at.col+i.index,{top:a,bottom:h}=u.data;let m=!1;for(let p=a;p<=h&&!m;p++)m=r(e,p,f);m||n.push({what:"column",sheet:e.name,name:`${u.name}[${i.name}]`})}}return n}export function inspectWorkbook(o,s={}){const{wb:t}=o,n=new Set(s.plain??INSPECT_DEFAULTS.plain),l=Math.max(1,s.around??INSPECT_DEFAULTS.around),c=s.all===!0,r=[];for(const e of t.sheets){const u=[...e.formulas].sort((f,a)=>f.row-a.row||f.col-a.col);for(const f of u){const{value:a}=f;a instanceof E&&r.push({kind:"sheet-error",data:{sheet:e.name,cell:g(f),code:a.code,formula:f.text,origin:N(o,f)}})}for(let f=0;f<e.columnsUsed;f++){const[a,h]=e.span(f,0,Number.MAX_SAFE_INTEGER);for(let m=a;m<=h;m++){const p=e.at(m,f);p instanceof E&&r.push({kind:"sheet-error",data:{sheet:e.name,cell:g({row:m,col:f}),code:p.code,origin:!0}})}}for(const{shared:f,first:a,count:h}of w(e)){if(!f.node)continue;const m=[];k(f.node,"=",m);const p=c?m:m.filter(d=>!n.has(d.value));p.length>0&&r.push({kind:"sheet-number",data:{sheet:e.name,cell:g(a),cells:h,formula:a.text,numbers:p}})}const i=new Set;for(const f of e.tables)for(const a of C(f))i.add(a.row*16384+a.col),r.push({kind:"sheet-exception",data:{sheet:e.name,table:f.name,column:a.column,cell:g(a),text:a.text}});for(const f of M(e,l,i))r.push({kind:"sheet-unlike",data:f})}for(const e of K(o,t,c))r.push({kind:"sheet-unused",data:e});for(const e of F(t,o))r.push({kind:"sheet-invalid",data:{sheet:e.sheet,cell:g(e),value:S(e.value,void 0),rule:e.type,range:e.range}});for(const e of t.generated?.typed??[])t.sheet(e.sheet)?.generated===!0&&r.push({kind:"sheet-typed",data:e});for(const e of t.ordinary)r.push({kind:"sheet-ordinary",data:{sheet:e}});return r}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { SheetHeaderFooter, SheetPrint } from "@allyhub-next/formats";
|
|
2
|
+
import { type Area } from "./address.js";
|
|
3
|
+
import type { Calc } from "./calc/engine.js";
|
|
4
|
+
import type { Chart, Worksheet } from "./workbook.js";
|
|
5
|
+
/** A column and a row nothing sizes, px: Excel's 8.43 characters and 15 points. */
|
|
6
|
+
export declare const DEFAULT_COLUMN_WIDTH = 64;
|
|
7
|
+
export declare const DEFAULT_ROW_HEIGHT = 20;
|
|
8
|
+
/** Paper, portrait, px. */
|
|
9
|
+
export declare const PAPERS: Readonly<Record<NonNullable<SheetPrint["paper"]>, {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}>>;
|
|
13
|
+
/** How a sheet prints when `print` does not say: A4, Excel's Normal margins (inches), 100%. */
|
|
14
|
+
export declare const PRINT_DEFAULTS: {
|
|
15
|
+
readonly paper: "a4";
|
|
16
|
+
readonly orientation: "portrait";
|
|
17
|
+
readonly margins: {
|
|
18
|
+
readonly left: 0.7;
|
|
19
|
+
readonly right: 0.7;
|
|
20
|
+
readonly top: 0.75;
|
|
21
|
+
readonly bottom: 0.75;
|
|
22
|
+
readonly header: 0.3;
|
|
23
|
+
readonly footer: 0.3;
|
|
24
|
+
};
|
|
25
|
+
readonly scale: 100;
|
|
26
|
+
};
|
|
27
|
+
/** A stretch of a sheet's rows or columns that show, by index: from, and to before. */
|
|
28
|
+
export interface Span {
|
|
29
|
+
from: number;
|
|
30
|
+
to: number;
|
|
31
|
+
}
|
|
32
|
+
/** One sheet as it prints. */
|
|
33
|
+
export interface SheetPages {
|
|
34
|
+
sheet: Worksheet;
|
|
35
|
+
/** The rows and columns that show in its print area, in order, and their sizes, px. */
|
|
36
|
+
rows: readonly number[];
|
|
37
|
+
heights: readonly number[];
|
|
38
|
+
cols: readonly number[];
|
|
39
|
+
widths: readonly number[];
|
|
40
|
+
/** Where each of them starts, px from the area's first; one more for where the last ends. */
|
|
41
|
+
rowAt: readonly number[];
|
|
42
|
+
colAt: readonly number[];
|
|
43
|
+
/** Its charts, px from the area's first row and column that show. */
|
|
44
|
+
charts: readonly PlacedChart[];
|
|
45
|
+
/** Rows and columns repeated on each page that comes after them. */
|
|
46
|
+
titleRows: readonly number[];
|
|
47
|
+
titleCols: readonly number[];
|
|
48
|
+
/** Pages down and across. */
|
|
49
|
+
down: readonly Span[];
|
|
50
|
+
across: readonly Span[];
|
|
51
|
+
/** Paper, oriented, and its margins, px. */
|
|
52
|
+
paper: {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
margins: Readonly<Record<keyof typeof PRINT_DEFAULTS.margins, number>>;
|
|
57
|
+
/** 1 is 100%. */
|
|
58
|
+
scale: number;
|
|
59
|
+
header?: SheetHeaderFooter;
|
|
60
|
+
footer?: SheetHeaderFooter;
|
|
61
|
+
}
|
|
62
|
+
/** A chart where it lies, px from a print area's first row and column that show. */
|
|
63
|
+
export interface PlacedChart {
|
|
64
|
+
chart: Chart;
|
|
65
|
+
left: number;
|
|
66
|
+
top: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
}
|
|
70
|
+
/** A page: which sheet, which of its rows and columns, its number from 1. */
|
|
71
|
+
export interface PrintedPage {
|
|
72
|
+
of: SheetPages;
|
|
73
|
+
down: Span;
|
|
74
|
+
across: Span;
|
|
75
|
+
number: number;
|
|
76
|
+
}
|
|
77
|
+
export interface PrintJob {
|
|
78
|
+
sheets: SheetPages[];
|
|
79
|
+
pages: PrintedPage[];
|
|
80
|
+
}
|
|
81
|
+
export interface PaginateOptions {
|
|
82
|
+
/** The sheets printed; default every one that is not hidden. */
|
|
83
|
+
sheets?: readonly Worksheet[];
|
|
84
|
+
/** A row's height as drawn, px; default its own (pictures in a cell make a row taller). */
|
|
85
|
+
height?: (sheet: Worksheet, row: number) => number;
|
|
86
|
+
}
|
|
87
|
+
export declare function columnWidth(sheet: Worksheet, col: number): number;
|
|
88
|
+
export declare const rowHeight: (sheet: Worksheet, row: number) => number;
|
|
89
|
+
export declare const rowHidden: (calc: Calc, sheet: Worksheet, row: number) => boolean;
|
|
90
|
+
export declare const columnHidden: (sheet: Worksheet, col: number) => boolean;
|
|
91
|
+
/** What a sheet uses, with the cells its charts reach. */
|
|
92
|
+
export declare function usedWithCharts(sheet: Worksheet): Area | undefined;
|
|
93
|
+
/** A workbook's sheets on paper: every page, numbered through the workbook. */
|
|
94
|
+
export declare function paginate(calc: Calc, o?: PaginateOptions): PrintJob;
|
|
95
|
+
/** The rows a page repeats over its own: the title rows before its first. */
|
|
96
|
+
export declare const pageTitleRows: (page: PrintedPage) => number[];
|
|
97
|
+
export declare const pageTitleCols: (page: PrintedPage) => number[];
|
|
98
|
+
//# sourceMappingURL=paginate.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{columnIndex as L,columnLetter as k,readArea as D}from"./address.js";import{chartSize as y}from"./chart.js";export const DEFAULT_COLUMN_WIDTH=64,DEFAULT_ROW_HEIGHT=20;const u=96;export const PAPERS={letter:{width:8.5*u,height:11*u},tabloid:{width:11*u,height:17*u},ledger:{width:17*u,height:11*u},legal:{width:8.5*u,height:14*u},executive:{width:7.25*u,height:10.5*u},a3:{width:297/25.4*u,height:420/25.4*u},a4:{width:210/25.4*u,height:297/25.4*u},a5:{width:148/25.4*u,height:210/25.4*u},b4:{width:257/25.4*u,height:364/25.4*u},b5:{width:182/25.4*u,height:257/25.4*u}},PRINT_DEFAULTS={paper:"a4",orientation:"portrait",margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},scale:100};const N=10;export function columnWidth(o,t){const n=o.spec.columns?.[k(t)]?.width;if(n!==void 0)return n;for(const r of o.tables){const l=r.columns[t-r.at.col]?.spec?.width;if(l!==void 0)return l}return DEFAULT_COLUMN_WIDTH}export const rowHeight=(o,t)=>o.spec.rows?.[String(t+1)]?.height??DEFAULT_ROW_HEIGHT,rowHidden=(o,t,n)=>o.filtered(t).has(n)||t.spec.rows?.[String(n+1)]?.hidden===!0,columnHidden=(o,t)=>o.spec.columns?.[k(t)]?.hidden===!0;export function usedWithCharts(o){let t=o.used;for(const{spec:n,at:r}of o.charts){const{width:l,height:h}=y(n);let f=r.col;for(let c=(n.x??0)+l;c>0;f++)c-=columnWidth(o,f);let s=r.row;for(let c=(n.y??0)+h;c>0;s++)c-=rowHeight(o,s);t={top:0,left:0,bottom:Math.max(t?.bottom??0,s-1),right:Math.max(t?.right??0,f-1)}}return t}function U(o){const t=o.spec.print?.area;if(t!==void 0){const r=t.split(",").map(l=>D(l.slice(l.lastIndexOf("!")+1).replaceAll("$","")));if(r.every(l=>l!==void 0))return r}const n=usedWithCharts(o);return n?[n]:[]}function O(o,t){if(o===void 0)return;const[n,r]=o.split(":").map(t);return n===void 0||r===void 0?void 0:{from:Math.min(n,r),to:Math.max(n,r)}}function E(o){const t=[0];for(const n of o)t.push((t[t.length-1]??0)+n);return t}function v(o,t,n,r,l){const h=E(o),f=[];let s=0;for(;s<o.length;){const c=t-n(s);let i=s+1;for(;i<o.length&&!r.has(i)&&(h[i+1]??0)-(h[s]??0)<=c;)i++;if(i<o.length&&!r.has(i))for(let w=!0;w;){w=!1;const x=h[i]??0;for(const m of l){if(!(m.from<x&&x<m.to)||m.to-m.from>c)continue;let d=i;for(;d>s&&(h[d]??0)>m.from;)d--;d>s&&d<i&&(i=d,w=!0)}}f.push({from:s,to:i}),s=i}return f}function _(o,t,n,r){const l=(s,c,i)=>i===void 0?0:s.filter(w=>w<i).reduce((w,x)=>w+c(x),0),h=o.height,f=s=>columnWidth(o.sheet,s);return{down:v(o.heights,t.height/n,s=>l(o.titleRows,h,o.rows[s]),r?o.rowBreaks:new Set,o.rowReaches),across:v(o.widths,t.width/n,s=>l(o.titleCols,f,o.cols[s]),r?o.colBreaks:new Set,o.colReaches)}}function W(o,t,n,r){const l=t.spec.print,h=[];for(let e=n.top;e<=n.bottom;e++)rowHidden(o,t,e)||h.push(e);const f=[];for(let e=n.left;e<=n.right;e++)columnHidden(t,e)||f.push(e);const s=h.map(r),c=f.map(e=>columnWidth(t,e)),i=(e,a)=>{const p=[];if(e)for(let A=e.from;A<=e.to;A++)a(A)||p.push(A);return p},w=i(O(l?.title_rows,e=>/^\d+$/u.test(e)?Number(e)-1:void 0),e=>rowHidden(o,t,e)),x=i(O(l?.title_cols,L),e=>columnHidden(t,e)),m=(e,a)=>new Set(a.map(p=>e.findIndex(A=>A>=p)).filter(p=>p>0)),d=m(h,(l?.breaks?.rows??[]).map(e=>e-1)),M=m(f,(l?.breaks?.cols??[]).flatMap(e=>{const a=L(e);return a===void 0?[]:[a]})),C=E(s),R=E(c),S=(e,a,p,A,I)=>{let T=e.findIndex(B=>B>=p);T<0&&(T=e.length);const H=(a[T]??0)+A;return{from:H,to:H+I}},g=[],b=[];for(const{spec:e,at:a}of t.charts){const p=y(e);g.push(S(h,C,a.row,e.y??0,p.height)),b.push(S(f,R,a.col,e.x??0,p.width))}return{sheet:t,height:r,rows:h,heights:s,cols:f,widths:c,titleRows:w,titleCols:x,rowBreaks:d,colBreaks:M,rowReaches:g,colReaches:b,rowAt:C,colAt:R}}function F(o,t,n,r){const l=t.rowAt[n.from]??0,h=t.rowAt[n.to]??0,f=t.colAt[r.from]??0,s=t.colAt[r.to]??0;if(t.charts.some(c=>c.left<s&&c.left+c.width>f&&c.top<h&&c.top+c.height>l))return!0;for(let c=n.from;c<n.to;c++)for(let i=r.from;i<r.to;i++)if(o.value(t.sheet,t.rows[c]??0,t.cols[i]??0)!==null)return!0;return!1}export function paginate(o,t={}){const n=t.sheets??o.wb.sheets.filter(h=>h.spec.hidden!==!0),r=[],l=[];for(const h of n){const f=h.spec.print,s=PAPERS[f?.paper??PRINT_DEFAULTS.paper],c=(f?.orientation??PRINT_DEFAULTS.orientation)==="landscape"?{width:s.height,height:s.width}:s,i=m=>(f?.margins?.[m]??PRINT_DEFAULTS.margins[m])*u,w={left:i("left"),right:i("right"),top:i("top"),bottom:i("bottom"),header:i("header"),footer:i("footer")},x={width:Math.max(1,c.width-w.left-w.right),height:Math.max(1,c.height-w.top-w.bottom)};for(const m of U(h)){const d=W(o,h,m,g=>t.height?t.height(h,g):rowHeight(h,g));if(d.rows.length===0||d.cols.length===0)continue;const M=f?.fit;let C=f?.scale??PRINT_DEFAULTS.scale,R=_(d,x,C/100,M===void 0);if(M!==void 0){const g=M.width??1,b=M.height??1,e=a=>(g===0||a.across.length<=g)&&(b===0||a.down.length<=b);if(C=100,R=_(d,x,1,!1),!e(R)){let a=N,p=99,A=_(d,x,a/100,!1);for(;a<p;){const I=Math.ceil((a+p)/2),T=_(d,x,I/100,!1);e(T)?(a=I,A=T):p=I-1}C=a,R=A}}const S={sheet:h,rows:d.rows,heights:d.heights,cols:d.cols,widths:d.widths,titleRows:d.titleRows,titleCols:d.titleCols,rowAt:d.rowAt,colAt:d.colAt,charts:h.charts.map((g,b)=>{const e=d.colReaches[b]??{from:0,to:0},a=d.rowReaches[b]??{from:0,to:0};return{chart:g,left:e.from,top:a.from,width:e.to-e.from,height:a.to-a.from}}),down:R.down,across:R.across,paper:c,margins:w,scale:C/100,...f?.header?{header:f.header}:{},...f?.footer?{footer:f.footer}:{}};r.push(S);for(const g of S.across)for(const b of S.down)F(o,S,b,g)&&l.push({of:S,down:b,across:g,number:l.length+1})}}return{sheets:r,pages:l}}export const pageTitleRows=o=>{const t=o.of.rows[o.down.from];return t===void 0?[]:o.of.titleRows.filter(n=>n<t)},pageTitleCols=o=>{const t=o.of.cols[o.across.from];return t===void 0?[]:o.of.titleCols.filter(n=>n<t)};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{MAX_COLUMNS as G,MAX_ROWS as H,cellName as v,columnIndex as R,columnLetter as _,rangeName as M,readAddress as y,readArea as A,readAreas as J}from"./address.js";import{chartAfter as Q}from"./chart.js";import{moveFormula as V,relativeKey as Y}from"./formula/move.js";import{parseFormula as z}from"./formula/parse.js";import{printFormula as N}from"./formula/print.js";import{rewriteFormula as B}from"./formula/rewrite.js";import{walk as Z}from"./formula/walk.js";import{readTyped as tt}from"./values.js";import{chartFormula as nt}from"./workbook.js";const $=r=>r.op==="insert-rows"||r.op==="delete-rows"||r.op==="insert-columns"||r.op==="delete-columns",k=r=>r.op==="insert-rows"||r.op==="insert-columns",b=r=>r.op==="insert-rows"||r.op==="delete-rows";function x(r,t){return k(t)?r>=t.at?r+t.count:r:r<t.at?r:r>=t.at+t.count?r-t.count:void 0}function P(r,t){const n=y(r);if(!n)return r;const s=x(b(t)?n.row:n.col,t);if(s!==void 0)return v(b(t)?{...n,row:s}:{...n,col:s})}function K(r,t){return Object.fromEntries(Object.entries(r).flatMap(([n,s])=>{const i=P(n,t);return i===void 0?[]:[[i,s]]}))}const et=r=>b(r)?H:G;function E(r,t,n){const s=et(n);if(k(n)){const e=r>=n.at?r+n.count:r,c=t>=n.at?t+n.count:t;return e>=s?void 0:[e,Math.min(c,s-1)]}const i=n.at+n.count-1;if(r>=n.at&&t<=i)return;const a=r<n.at?r:r>i?r-n.count:n.at,o=t<n.at?t:t>i?t-n.count:n.at-1;return[a,o]}function L(r,t){const n=b(t)?E(r.top,r.bottom,t):E(r.left,r.right,t);if(n)return b(t)?{...r,top:n[0],bottom:n[1]}:{...r,left:n[0],right:n[1]}}function ot(r,t,n,s){let i=0;const a=(o,e)=>{o&&!o.abs&&(i=Math.max(i,Math.abs(o.index-e)))};return Z(r,o=>{o.kind==="ref"&&(t?(a(o.row,n),a(o.row2,n)):(a(o.col,s),a(o.col2,s)))}),i}function st(r,t,n,s){const i=new Set,a=l=>{for(let f=l-s-1;f<=l+s+1;f++)f>=r&&f<=t&&i.add(f)};a(n.at),a(n.at+n.count);const o=[...i].sort((l,f)=>l-f),e=[];let c=r;for(const l of o)l>c&&e.push([c,l-1]),e.push([l,l]),c=l+1;return c<=t&&e.push([c,t]),e}function rt(r,t,n,s,i){const a=z(t);if(!a.ok){const m=i?L(r,s):r;return m?[{area:m,text:t}]:[]}const o=b(s),[e,c]=o?[r.top,r.bottom]:[r.left,r.right],l=ot(a.node,o,r.top,r.left),f=[];let u=!0;for(const[m,d]of st(e,c,s,l)){const w=o?m:r.top,p=o?r.left:m,h=i?x(m,s):m;if(h===void 0)continue;const g=i?x(d,s):d;if(g===void 0)continue;const C=V(a.node,w-r.top,p-r.left),S=B(C,s,n);S!==C&&(u=!1);const q=o?h:r.top,D=o?r.left:h,F=Y(S,q,D),I=f[f.length-1];I?.key===F&&I.to+1===h?I.to=g:f.push({from:h,to:g,key:F,text:N(S)})}return f.map(m=>({area:o?{...r,top:m.from,bottom:m.to}:{...r,left:m.from,right:m.to},text:u&&f.length===1?t:m.text}))}function W(r,t){return r!==null&&typeof r=="object"?{...r,formula:t}:t}const it=r=>{if(typeof r=="string")return r.startsWith("=")?r:void 0;if(!(r===null||typeof r!="object"))return r.formula!==void 0?r.formula.startsWith("=")?r.formula:`=${r.formula}`:typeof r.value=="string"&&r.value.startsWith("=")?r.value:void 0};function O(r,t,n,s){const i=z(r);if(!i.ok)return r;const a=B(i.node,t,n,s);return a===i.node?r:N(a)}function ct(r,t,n,s){const i={},a=$(n)?n:void 0;for(const[o,e]of Object.entries(r)){const c=it(e),l=A(o);if(!l){i[o]=e;continue}const f=s&&a!==void 0;if(o.includes(":")){if(!a){i[o]=c===void 0?e:W(e,O(c,n,t));continue}if(c!==void 0){for(const h of rt(l,c,t,a,f))i[M(h.area)]=W(e,h.text);continue}if(!f){i[o]=e;continue}if(!k(a)){const h=L(l,a);h&&(i[M(h)]=e);continue}const d=b(a),[w,p]=d?[l.top,l.bottom]:[l.left,l.right];for(const[h,g]of[[w,Math.min(p,a.at-1)],[Math.max(w,a.at),p]]){if(h>g)continue;const C=h>=a.at?a.count:0,S=d?{...l,top:h+C,bottom:g+C}:{...l,left:h+C,right:g+C};i[M(S)]=e}continue}const u={row:l.top,col:l.left};let m=u;if(f){const d=x(b(a)?u.row:u.col,a);m=d===void 0?void 0:b(a)?{...u,row:d}:{...u,col:d}}m&&(i[v(m)]=c===void 0?e:W(e,O(c,n,t)))}return i}export function tableShape(r,t){const n=y(r.at);if(!n)return;const s=t[0]??[],i=s.map(e=>e.trim()),a=new Set(i.map(e=>e.toLowerCase()));for(const e of Object.keys(r.columns??{}))a.has(e.toLowerCase())||i.push(e);const o=[];return t.forEach((e,c)=>{c>0&&e.length>0&&o.push(c)}),{at:n,header:s,names:i,places:o}}const T=r=>r.reduce((t,n)=>Math.max(t,n.length),0);function U(r,t,n){const s=Math.max(T(r),1),i=Array.from({length:n},()=>new Array(s).fill(""));return[...r.slice(0,t),...i,...r.slice(t)]}export function freeColumn(r,t="Column"){const n=new Set(r.map(s=>s.toLowerCase()));for(let s=1;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function uniqueColumn(r,t){const n=new Set(r.map(s=>s.toLowerCase()));if(!n.has(t.toLowerCase()))return t;for(let s=2;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function withColumnsUpTo(r,t,n){const s=r.map(o=>[...o]),i=s[0]??[];for(s.length===0&&s.push(i);i.length<=n;)i.push(t[i.length]??"");const a=i.length;for(let o=1;o<s.length;o++){const e=s[o];if(e&&e.length>0)for(;e.length<a;)e.push("")}return s}class X{file;rows;edit;after=[];refused;constructor(t,n){this.file=structuredClone(t.file),this.rows=new Map(t.rows),this.edit=n}sheets(){return this.file.sheets}rewrite(t){const n=this.file.sheets[0]?.name??"";if(this.file.names)for(const[s,i]of Object.entries(this.file.names))typeof i=="string"&&i.startsWith("=")&&(this.file.names[s]=O(i,t,n));for(const s of this.file.checks??[])s.formula=O(s.formula,t,n);for(const s of this.sheets())this.rewriteSheet(s,t)}rewriteSheet(t,n){const s=$(n)&&j(t.name,n.sheet);t.cells&&(t.cells=ct(t.cells,t.name,n,s));for(const i of t.tables??[]){for(const a of Object.values(i.columns??{}))a.formula!==void 0&&(a.formula=O(a.formula,n,t.name,i.name));this.rewriteCsv(i.rows,n,t.name,i.name)}for(const i of t.blocks??[])this.rewriteCsv(i.rows,n,t.name);this.rewriteRules(t,n)}freePath(t,n){const s=t.slice(0,t.lastIndexOf("/")+1),i=o=>[...this.rows.keys()].some(e=>j(e,o));let a=`${s}${n}.csv`;for(let o=2;i(a);o++)a=`${s}${n}-${String(o)}.csv`;return a}duplicate(t,n){const s=this.sheets(),i=s.findIndex(f=>j(f.name,t)),a=s[i];if(!a){this.refused="no-sheet";return}const o=structuredClone(a);o.name=n,delete o.hidden;for(const f of Object.values(o.cells??{}))f!==null&&typeof f=="object"&&delete f.name;const e=new Set(s.flatMap(f=>f.tables??[]).map(f=>f.name.toLowerCase())),c=new Set(Object.keys(this.file.names??{}).map(f=>f.toLowerCase())),l=[];for(const f of o.tables??[]){let u=f.name;for(let d=2;;d++){u=`${f.name}${String(d)}`;const w=u.toLowerCase();if(!e.has(w)&&!c.has(w))break}e.add(u.toLowerCase());const m=this.freePath(f.rows,u);this.rows.set(m,this.rows.get(f.rows)??[]),l.push({op:"rename-table",from:f.name,to:u}),f.rows=m,f.name=u}for(const f of o.blocks??[]){const u=f.rows.slice(f.rows.lastIndexOf("/")+1,-4),m=this.freePath(f.rows,u);this.rows.set(m,this.rows.get(f.rows)??[]),f.rows=m}this.file.sheets=[...s.slice(0,i+1),o,...s.slice(i+1)],this.rewriteSheet(o,{op:"rename-sheet",from:t,to:n});for(const f of l)this.rewriteSheet(o,f)}rewriteRules(t,n){const s=e=>typeof e=="string"&&e.startsWith("=")?O(e,n,t.name):e,i=e=>e.value===void 0?e:{...e,value:s(e.value)},a=t.conditional?.map(e=>{switch(e.type){case"cellIs":return{...e,formula:e.formula.map(s)};case"expression":return{...e,formula:O(e.formula.startsWith("=")?e.formula:`=${e.formula}`,n,t.name)};case"dataBar":return{...e,...e.min?{min:i(e.min)}:{},...e.max?{max:i(e.max)}:{}};case"colorScale":return{...e,stops:e.stops.map(i)};case"iconSet":return e.stops?{...e,stops:e.stops.map(i)}:e;default:return e}});a&&(t.conditional=a);const o=t.validations?.map(e=>e.formula?{...e,formula:e.formula.map(s)}:e);o&&(t.validations=o),$(n)&&n.sheet===t.name&&(t.links&&(t.links=K(t.links,n)),t.notes&&(t.notes=K(t.notes,n)),t.pictures&&(t.pictures=t.pictures.flatMap(e=>{const c=P(e.at,n);return c===void 0?[]:[{...e,at:c}]}))),t.charts&&(t.charts=t.charts.map(e=>Q(e,c=>{const l=c.startsWith("="),f=O(nt(c),n,t.name);return l?f:f.slice(1)})))}rewriteCsv(t,n,s,i){const a=this.rows.get(t);if(!a)return;let o;a.forEach((e,c)=>{if(!e.some(f=>f.charCodeAt(0)===61))return;const l=e.map(f=>tt(f).formula===void 0?f:O(f,n,s,i));l.every((f,u)=>f===e[u])||(o??=[...a],o[c]=l)}),o&&this.rows.set(t,o)}tableOn(t,n){const s=b(n),i=[];for(const a of t.tables??[]){const o=this.rows.get(a.rows),e=o&&tableShape(a,o);if(!o||!e){i.push(a);continue}const c=e.at.row,l=e.at.col,f=c+e.places.length,u=l+Math.max(e.names.length,1)-1,[m,d]=s?[c,f]:[l,u];if(!k(n)&&n.at<=m&&n.at+n.count-1>=d){this.after.push({op:"delete-table",name:a.name});continue}const w={...e.at};if(s)if(k(n)){if(n.at<=c)w.row+=n.count;else if(n.at<=f){const p=e.places[n.at-c-1]??o.length;this.rows.set(a.rows,U(o,p,n.count))}}else{const p=n.at+n.count-1;if(p<c)w.row-=n.count;else if(n.at<=c){this.refused="table-header";return}else if(n.at<=f){const h=new Set(e.places.slice(n.at-c-1,p-c));this.rows.set(a.rows,o.filter((g,C)=>!h.has(C)))}}else if(k(n))n.at<=l?w.col+=n.count:n.at<=u&&this.columnsIn(a,e,n.at-l,n.count);else{const p=n.at+n.count-1;if(p<l)w.col-=n.count;else if(n.at<=u){w.col=Math.min(l,n.at);const h=Math.max(0,n.at-l),g=Math.min(e.names.length-1,p-l);this.columnsOut(a,e,h,g)}}a.at=v(w),i.push(a)}t.tables=i,i.length===0&&delete t.tables}columnsIn(t,n,s,i){const a=this.rows.get(t.rows)??[],o=s>0?withColumnsUpTo(a,n.names,s-1):a.map(c=>[...c]),e=[...n.names];o.forEach((c,l)=>{if(l>0&&c.length===0)return;const f=[];for(let u=0;u<i;u++)if(l===0){const m=freeColumn(e);e.push(m),f.push(m)}else f.push("");for(;c.length<s;)c.push("");c.splice(s,0,...f)}),this.rows.set(t.rows,o)}columnsOut(t,n,s,i){const a=n.names.slice(s,i+1),o=this.rows.get(t.rows)??[],e=n.header.length,c=new Set;for(let l=s;l<=i&&l<e;l++)c.add(l);if(c.size>0&&this.rows.set(t.rows,o.map(l=>l.length===0?l:l.filter((f,u)=>!c.has(u)))),t.columns){const l=new Set(a.map(f=>f.toLowerCase()));t.columns=Object.fromEntries(Object.entries(t.columns).filter(([f])=>!l.has(f.toLowerCase()))),Object.keys(t.columns).length===0&&delete t.columns}if(t.key!==void 0&&a.some(l=>l.toLowerCase()===t.key?.toLowerCase())&&delete t.key,t.filter){const l=new Set(a.map(u=>u.toLowerCase())),f=Object.fromEntries(Object.entries(t.filter.columns).filter(([u])=>!l.has(u.toLowerCase())));Object.keys(f).length>0?t.filter={columns:f}:delete t.filter}for(const l of a)this.after.push({op:"delete-column",table:t.name,name:l})}blocksOn(t,n){const s=b(n),i=(t.blocks??[]).flatMap(a=>{const o=y(a.at),e=this.rows.get(a.rows);if(!o||!e)return[a];const c=s?o.row:o.col,l=s?e.length:Math.max(T(e),1),f=c+l-1,u=E(c,f,n);if(!u)return[];const m=s?{...o,row:u[0]}:{...o,col:u[0]};if(k(n)&&n.at>c&&n.at<=f){const d=n.at-c;this.rows.set(a.rows,s?U(e,d,n.count):e.map(w=>{if(w.length===0)return w;const p=[...w];for(;p.length<d;)p.push("");return p.splice(d,0,...new Array(n.count).fill("")),p}))}else if(!k(n)&&n.at<=f){const d=Math.max(n.at,c)-c,w=Math.min(n.at+n.count-1,f)-c;this.rows.set(a.rows,s?e.filter((p,h)=>h<d||h>w):e.map(p=>p.filter((h,g)=>g<d||g>w)))}return[{...a,at:v(m)}]});t.blocks=i,i.length===0&&delete t.blocks}looksOn(t,n){const s=b(n);t.format&&(t.format=t.format.flatMap(o=>{const e=A(o.range);if(!e)return[o];const c=L(e,n);return c?[{...o,range:M(c)}]:[]})),t.format?.length===0&&delete t.format,t.merges&&(t.merges=t.merges.flatMap(o=>{const e=A(o);if(!e)return[o];const c=L(e,n);return c?[M(c)]:[]})),t.merges?.length===0&&delete t.merges;const i=o=>{const e=J(o);if(!e)return o;const c=e.flatMap(l=>{const f=L(l,n);return f?[M(f)]:[]});return c.length===0?void 0:c.join(" ")};if(t.conditional&&(t.conditional=t.conditional.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.conditional?.length===0&&delete t.conditional,t.validations&&(t.validations=t.validations.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.validations?.length===0&&delete t.validations,t.charts&&(t.charts=t.charts.map(o=>{const e=y(o.at);if(!e)return o;const c=s?e.row:e.col,l=x(c,n)??n.at;return{...o,at:v(s?{...e,row:l}:{...e,col:l})}})),t.filter){const o=A(t.filter.range),e=o&&L(o,n);if(o&&!e)delete t.filter;else if(e){const c=s?t.filter.columns:Object.fromEntries(Object.entries(t.filter.columns??{}).flatMap(([l,f])=>{const u=R(l),m=u===void 0?void 0:x(u,n);return m===void 0?[]:[[_(m),f]]}));t.filter={range:M(e),...c&&Object.keys(c).length>0?{columns:c}:{}}}}if(t.freeze!==void 0){const o=y(t.freeze);if(o){const e=s?o.row:o.col,c=E(0,e-1,n),l=e===0?0:c?c[1]+1:0;t.freeze=v(s?{...o,row:l}:{...o,col:l})}}const a=(o,e,c)=>{if(!o)return;const l={};for(const[f,u]of Object.entries(o)){const m=e(f),d=m===void 0?void 0:x(m,n);m===void 0?l[f]=u:d!==void 0&&(l[c(d)]=u)}return l};if(s){const o=a(t.rows,e=>/^[1-9]\d*$/u.test(e)?Number(e)-1:void 0,e=>String(e+1));o&&(t.rows=o)}else{const o=a(t.columns,R,_);o&&(t.columns=o)}}run(){const t=this.edit;if($(t)){const n=this.sheets().find(s=>j(s.name,t.sheet));if(!n){this.refused="no-sheet";return}if(this.rewrite(t),this.tableOn(n,t),this.refused)return;this.blocksOn(n,t),this.looksOn(n,t);for(const s of this.after)this.rewrite(s);return}switch(t.op){case"rename-sheet":{this.rewrite(t);const n=this.sheets().find(s=>j(s.name,t.from));n&&(n.name=t.to);return}case"rename-column":{this.renameColumn(t.table,t.from,t.to),this.rewrite(t);return}case"delete-sheet":{const n=this.sheets(),s=n.find(i=>j(i.name,t.name));if(!s){this.refused="no-sheet";return}if(n.filter(i=>i.hidden!==!0).length<=1){this.refused="last-sheet";return}this.rewrite(t);for(const i of s.tables??[])this.rewrite({op:"delete-table",name:i.name});this.file.sheets=n.filter(i=>i!==s);return}default:this.rewrite(t)}}renameColumn(t,n,s){const i=this.sheets().flatMap(c=>c.tables??[]).find(c=>j(c.name,t));if(!i)return;const a=n.toLowerCase(),o=this.rows.get(i.rows),e=o?.[0]?.findIndex(c=>c.trim().toLowerCase()===a)??-1;if(o&&e>=0){const c=[...o[0]??[]];c[e]=s,this.rows.set(i.rows,[c,...o.slice(1)])}if(i.columns){const c=Object.keys(i.columns).find(l=>l.toLowerCase()===a);c!==void 0&&(i.columns=Object.fromEntries(Object.entries(i.columns).map(([l,f])=>[l===c?s:l,f])))}i.key?.toLowerCase()===a&&(i.key=s),i.filter&&(i.filter={columns:Object.fromEntries(Object.entries(i.filter.columns).map(([c,l])=>[c.toLowerCase()===a?s:c,l]))})}}const j=(r,t)=>r.toLowerCase()===t.toLowerCase();export function restructure(r,t){const n=new X(r,t);return n.run(),n.refused?{file:r.file,rows:new Map(r.rows),refused:n.refused}:{file:n.file,rows:n.rows}}export function duplicated(r,t,n){const s=new X(r,{op:"rename-sheet",from:t,to:n});return s.duplicate(t,n),s.refused?{file:r.file,rows:new Map(r.rows),refused:s.refused}:{file:s.file,rows:s.rows}}
|
|
2
|
+
import{MAX_COLUMNS as G,MAX_ROWS as H,cellName as v,columnIndex as R,columnLetter as _,rangeName as M,readAddress as y,readArea as A,readAreas as J}from"./address.js";import{chartAfter as Q}from"./chart.js";import{moveFormula as V,relativeKey as Y}from"./formula/move.js";import{parseFormula as z}from"./formula/parse.js";import{printFormula as N}from"./formula/print.js";import{rewriteFormula as B}from"./formula/rewrite.js";import{walk as Z}from"./formula/walk.js";import{readTyped as tt}from"./values.js";import{chartFormula as nt}from"./workbook.js";const $=r=>r.op==="insert-rows"||r.op==="delete-rows"||r.op==="insert-columns"||r.op==="delete-columns",k=r=>r.op==="insert-rows"||r.op==="insert-columns",b=r=>r.op==="insert-rows"||r.op==="delete-rows";function x(r,t){return k(t)?r>=t.at?r+t.count:r:r<t.at?r:r>=t.at+t.count?r-t.count:void 0}function P(r,t){const n=y(r);if(!n)return r;const s=x(b(t)?n.row:n.col,t);if(s!==void 0)return v(b(t)?{...n,row:s}:{...n,col:s})}function K(r,t){return Object.fromEntries(Object.entries(r).flatMap(([n,s])=>{const i=P(n,t);return i===void 0?[]:[[i,s]]}))}const et=r=>b(r)?H:G;function E(r,t,n){const s=et(n);if(k(n)){const e=r>=n.at?r+n.count:r,c=t>=n.at?t+n.count:t;return e>=s?void 0:[e,Math.min(c,s-1)]}const i=n.at+n.count-1;if(r>=n.at&&t<=i)return;const f=r<n.at?r:r>i?r-n.count:n.at,o=t<n.at?t:t>i?t-n.count:n.at-1;return[f,o]}function L(r,t){const n=b(t)?E(r.top,r.bottom,t):E(r.left,r.right,t);if(n)return b(t)?{...r,top:n[0],bottom:n[1]}:{...r,left:n[0],right:n[1]}}function ot(r,t,n,s){let i=0;const f=(o,e)=>{o&&!o.abs&&(i=Math.max(i,Math.abs(o.index-e)))};return Z(r,o=>{o.kind==="ref"&&(t?(f(o.row,n),f(o.row2,n)):(f(o.col,s),f(o.col2,s)))}),i}function st(r,t,n,s){const i=new Set,f=l=>{for(let a=l-s-1;a<=l+s+1;a++)a>=r&&a<=t&&i.add(a)};f(n.at),f(n.at+n.count);const o=[...i].sort((l,a)=>l-a),e=[];let c=r;for(const l of o)l>c&&e.push([c,l-1]),e.push([l,l]),c=l+1;return c<=t&&e.push([c,t]),e}function rt(r,t,n,s,i){const f=z(t);if(!f.ok){const m=i?L(r,s):r;return m?[{area:m,text:t}]:[]}const o=b(s),[e,c]=o?[r.top,r.bottom]:[r.left,r.right],l=ot(f.node,o,r.top,r.left),a=[];let u=!0;for(const[m,d]of st(e,c,s,l)){const w=o?m:r.top,p=o?r.left:m,h=i?x(m,s):m;if(h===void 0)continue;const g=i?x(d,s):d;if(g===void 0)continue;const C=V(f.node,w-r.top,p-r.left),S=B(C,s,n);S!==C&&(u=!1);const q=o?h:r.top,D=o?r.left:h,F=Y(S,q,D),I=a[a.length-1];I?.key===F&&I.to+1===h?I.to=g:a.push({from:h,to:g,key:F,text:N(S)})}return a.map(m=>({area:o?{...r,top:m.from,bottom:m.to}:{...r,left:m.from,right:m.to},text:u&&a.length===1?t:m.text}))}function W(r,t){return r!==null&&typeof r=="object"?{...r,formula:t}:t}const it=r=>{if(typeof r=="string")return r.startsWith("=")?r:void 0;if(!(r===null||typeof r!="object"))return r.formula!==void 0?r.formula.startsWith("=")?r.formula:`=${r.formula}`:typeof r.value=="string"&&r.value.startsWith("=")?r.value:void 0};function O(r,t,n,s){const i=z(r);if(!i.ok)return r;const f=B(i.node,t,n,s);return f===i.node?r:N(f)}function ct(r,t,n,s){const i={},f=$(n)?n:void 0;for(const[o,e]of Object.entries(r)){const c=it(e),l=A(o);if(!l){i[o]=e;continue}const a=s&&f!==void 0;if(o.includes(":")){if(!f){i[o]=c===void 0?e:W(e,O(c,n,t));continue}if(c!==void 0){for(const h of rt(l,c,t,f,a))i[M(h.area)]=W(e,h.text);continue}if(!a){i[o]=e;continue}if(!k(f)){const h=L(l,f);h&&(i[M(h)]=e);continue}const d=b(f),[w,p]=d?[l.top,l.bottom]:[l.left,l.right];for(const[h,g]of[[w,Math.min(p,f.at-1)],[Math.max(w,f.at),p]]){if(h>g)continue;const C=h>=f.at?f.count:0,S=d?{...l,top:h+C,bottom:g+C}:{...l,left:h+C,right:g+C};i[M(S)]=e}continue}const u={row:l.top,col:l.left};let m=u;if(a){const d=x(b(f)?u.row:u.col,f);m=d===void 0?void 0:b(f)?{...u,row:d}:{...u,col:d}}m&&(i[v(m)]=c===void 0?e:W(e,O(c,n,t)))}return i}export function tableShape(r,t){const n=y(r.at);if(!n)return;const s=t[0]??[],i=s.map(e=>e.trim()),f=new Set(i.map(e=>e.toLowerCase()));for(const e of Object.keys(r.columns??{}))f.has(e.toLowerCase())||i.push(e);const o=[];return t.forEach((e,c)=>{c>0&&e.length>0&&o.push(c)}),{at:n,header:s,names:i,places:o}}const T=r=>r.reduce((t,n)=>Math.max(t,n.length),0);function U(r,t,n){const s=Math.max(T(r),1),i=Array.from({length:n},()=>new Array(s).fill(""));return[...r.slice(0,t),...i,...r.slice(t)]}export function freeColumn(r,t="Column"){const n=new Set(r.map(s=>s.toLowerCase()));for(let s=1;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function uniqueColumn(r,t){const n=new Set(r.map(s=>s.toLowerCase()));if(!n.has(t.toLowerCase()))return t;for(let s=2;;s++){const i=`${t}${String(s)}`;if(!n.has(i.toLowerCase()))return i}}export function withColumnsUpTo(r,t,n){const s=r.map(o=>[...o]),i=s[0]??[];for(s.length===0&&s.push(i);i.length<=n;)i.push(t[i.length]??"");const f=i.length;for(let o=1;o<s.length;o++){const e=s[o];if(e&&e.length>0)for(;e.length<f;)e.push("")}return s}class X{file;rows;edit;after=[];refused;constructor(t,n){this.file=structuredClone(t.file),this.rows=new Map(t.rows),this.edit=n}sheets(){return this.file.sheets}rewrite(t){const n=this.file.sheets[0]?.name??"";if(this.file.names)for(const[s,i]of Object.entries(this.file.names))typeof i=="string"&&i.startsWith("=")&&(this.file.names[s]=O(i,t,n));for(const s of this.file.checks??[])s.formula=O(s.formula,t,n);for(const s of this.sheets())this.rewriteSheet(s,t)}rewriteSheet(t,n){const s=$(n)&&j(t.name,n.sheet);if(t.names)for(const[i,f]of Object.entries(t.names))typeof f=="string"&&f.startsWith("=")&&(t.names[i]=O(f,n,t.name));t.cells&&(t.cells=ct(t.cells,t.name,n,s));for(const i of t.tables??[]){for(const f of Object.values(i.columns??{}))f.formula!==void 0&&(f.formula=O(f.formula,n,t.name,i.name));this.rewriteCsv(i.rows,n,t.name,i.name)}for(const i of t.blocks??[])this.rewriteCsv(i.rows,n,t.name);this.rewriteRules(t,n)}freePath(t,n){const s=t.slice(0,t.lastIndexOf("/")+1),i=o=>[...this.rows.keys()].some(e=>j(e,o));let f=`${s}${n}.csv`;for(let o=2;i(f);o++)f=`${s}${n}-${String(o)}.csv`;return f}duplicate(t,n){const s=this.sheets(),i=s.findIndex(a=>j(a.name,t)),f=s[i];if(!f){this.refused="no-sheet";return}const o=structuredClone(f);o.name=n,delete o.hidden;for(const a of Object.values(o.cells??{}))a!==null&&typeof a=="object"&&delete a.name;const e=new Set(s.flatMap(a=>a.tables??[]).map(a=>a.name.toLowerCase())),c=new Set(Object.keys(this.file.names??{}).map(a=>a.toLowerCase())),l=[];for(const a of o.tables??[]){let u=a.name;for(let d=2;;d++){u=`${a.name}${String(d)}`;const w=u.toLowerCase();if(!e.has(w)&&!c.has(w))break}e.add(u.toLowerCase());const m=this.freePath(a.rows,u);this.rows.set(m,this.rows.get(a.rows)??[]),l.push({op:"rename-table",from:a.name,to:u}),a.rows=m,a.name=u}for(const a of o.blocks??[]){const u=a.rows.slice(a.rows.lastIndexOf("/")+1,-4),m=this.freePath(a.rows,u);this.rows.set(m,this.rows.get(a.rows)??[]),a.rows=m}this.file.sheets=[...s.slice(0,i+1),o,...s.slice(i+1)],this.rewriteSheet(o,{op:"rename-sheet",from:t,to:n});for(const a of l)this.rewriteSheet(o,a)}rewriteRules(t,n){const s=e=>typeof e=="string"&&e.startsWith("=")?O(e,n,t.name):e,i=e=>e.value===void 0?e:{...e,value:s(e.value)},f=t.conditional?.map(e=>{switch(e.type){case"cellIs":return{...e,formula:e.formula.map(s)};case"expression":return{...e,formula:O(e.formula.startsWith("=")?e.formula:`=${e.formula}`,n,t.name)};case"dataBar":return{...e,...e.min?{min:i(e.min)}:{},...e.max?{max:i(e.max)}:{}};case"colorScale":return{...e,stops:e.stops.map(i)};case"iconSet":return e.stops?{...e,stops:e.stops.map(i)}:e;default:return e}});f&&(t.conditional=f);const o=t.validations?.map(e=>e.formula?{...e,formula:e.formula.map(s)}:e);o&&(t.validations=o),$(n)&&n.sheet===t.name&&(t.links&&(t.links=K(t.links,n)),t.notes&&(t.notes=K(t.notes,n)),t.pictures&&(t.pictures=t.pictures.flatMap(e=>{const c=P(e.at,n);return c===void 0?[]:[{...e,at:c}]}))),t.charts&&(t.charts=t.charts.map(e=>Q(e,c=>{const l=c.startsWith("="),a=O(nt(c),n,t.name);return l?a:a.slice(1)})))}rewriteCsv(t,n,s,i){const f=this.rows.get(t);if(!f)return;let o;f.forEach((e,c)=>{if(!e.some(a=>a.charCodeAt(0)===61))return;const l=e.map(a=>tt(a).formula===void 0?a:O(a,n,s,i));l.every((a,u)=>a===e[u])||(o??=[...f],o[c]=l)}),o&&this.rows.set(t,o)}tableOn(t,n){const s=b(n),i=[];for(const f of t.tables??[]){const o=this.rows.get(f.rows),e=o&&tableShape(f,o);if(!o||!e){i.push(f);continue}const c=e.at.row,l=e.at.col,a=c+e.places.length,u=l+Math.max(e.names.length,1)-1,[m,d]=s?[c,a]:[l,u];if(!k(n)&&n.at<=m&&n.at+n.count-1>=d){this.after.push({op:"delete-table",name:f.name});continue}const w={...e.at};if(s)if(k(n)){if(n.at<=c)w.row+=n.count;else if(n.at<=a){const p=e.places[n.at-c-1]??o.length;this.rows.set(f.rows,U(o,p,n.count))}}else{const p=n.at+n.count-1;if(p<c)w.row-=n.count;else if(n.at<=c){this.refused="table-header";return}else if(n.at<=a){const h=new Set(e.places.slice(n.at-c-1,p-c));this.rows.set(f.rows,o.filter((g,C)=>!h.has(C)))}}else if(k(n))n.at<=l?w.col+=n.count:n.at<=u&&this.columnsIn(f,e,n.at-l,n.count);else{const p=n.at+n.count-1;if(p<l)w.col-=n.count;else if(n.at<=u){w.col=Math.min(l,n.at);const h=Math.max(0,n.at-l),g=Math.min(e.names.length-1,p-l);this.columnsOut(f,e,h,g)}}f.at=v(w),i.push(f)}t.tables=i,i.length===0&&delete t.tables}columnsIn(t,n,s,i){const f=this.rows.get(t.rows)??[],o=s>0?withColumnsUpTo(f,n.names,s-1):f.map(c=>[...c]),e=[...n.names];o.forEach((c,l)=>{if(l>0&&c.length===0)return;const a=[];for(let u=0;u<i;u++)if(l===0){const m=freeColumn(e);e.push(m),a.push(m)}else a.push("");for(;c.length<s;)c.push("");c.splice(s,0,...a)}),this.rows.set(t.rows,o)}columnsOut(t,n,s,i){const f=n.names.slice(s,i+1),o=this.rows.get(t.rows)??[],e=n.header.length,c=new Set;for(let l=s;l<=i&&l<e;l++)c.add(l);if(c.size>0&&this.rows.set(t.rows,o.map(l=>l.length===0?l:l.filter((a,u)=>!c.has(u)))),t.columns){const l=new Set(f.map(a=>a.toLowerCase()));t.columns=Object.fromEntries(Object.entries(t.columns).filter(([a])=>!l.has(a.toLowerCase()))),Object.keys(t.columns).length===0&&delete t.columns}if(t.key!==void 0&&f.some(l=>l.toLowerCase()===t.key?.toLowerCase())&&delete t.key,t.filter){const l=new Set(f.map(u=>u.toLowerCase())),a=Object.fromEntries(Object.entries(t.filter.columns).filter(([u])=>!l.has(u.toLowerCase())));Object.keys(a).length>0?t.filter={columns:a}:delete t.filter}for(const l of f)this.after.push({op:"delete-column",table:t.name,name:l})}blocksOn(t,n){const s=b(n),i=(t.blocks??[]).flatMap(f=>{const o=y(f.at),e=this.rows.get(f.rows);if(!o||!e)return[f];const c=s?o.row:o.col,l=s?e.length:Math.max(T(e),1),a=c+l-1,u=E(c,a,n);if(!u)return[];const m=s?{...o,row:u[0]}:{...o,col:u[0]};if(k(n)&&n.at>c&&n.at<=a){const d=n.at-c;this.rows.set(f.rows,s?U(e,d,n.count):e.map(w=>{if(w.length===0)return w;const p=[...w];for(;p.length<d;)p.push("");return p.splice(d,0,...new Array(n.count).fill("")),p}))}else if(!k(n)&&n.at<=a){const d=Math.max(n.at,c)-c,w=Math.min(n.at+n.count-1,a)-c;this.rows.set(f.rows,s?e.filter((p,h)=>h<d||h>w):e.map(p=>p.filter((h,g)=>g<d||g>w)))}return[{...f,at:v(m)}]});t.blocks=i,i.length===0&&delete t.blocks}looksOn(t,n){const s=b(n);t.format&&(t.format=t.format.flatMap(o=>{const e=A(o.range);if(!e)return[o];const c=L(e,n);return c?[{...o,range:M(c)}]:[]})),t.format?.length===0&&delete t.format,t.merges&&(t.merges=t.merges.flatMap(o=>{const e=A(o);if(!e)return[o];const c=L(e,n);return c?[M(c)]:[]})),t.merges?.length===0&&delete t.merges;const i=o=>{const e=J(o);if(!e)return o;const c=e.flatMap(l=>{const a=L(l,n);return a?[M(a)]:[]});return c.length===0?void 0:c.join(" ")};if(t.conditional&&(t.conditional=t.conditional.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.conditional?.length===0&&delete t.conditional,t.validations&&(t.validations=t.validations.flatMap(o=>{const e=i(o.range);return e===void 0?[]:[{...o,range:e}]})),t.validations?.length===0&&delete t.validations,t.charts&&(t.charts=t.charts.map(o=>{const e=y(o.at);if(!e)return o;const c=s?e.row:e.col,l=x(c,n)??n.at;return{...o,at:v(s?{...e,row:l}:{...e,col:l})}})),t.filter){const o=A(t.filter.range),e=o&&L(o,n);if(o&&!e)delete t.filter;else if(e){const c=s?t.filter.columns:Object.fromEntries(Object.entries(t.filter.columns??{}).flatMap(([l,a])=>{const u=R(l),m=u===void 0?void 0:x(u,n);return m===void 0?[]:[[_(m),a]]}));t.filter={range:M(e),...c&&Object.keys(c).length>0?{columns:c}:{}}}}if(t.freeze!==void 0){const o=y(t.freeze);if(o){const e=s?o.row:o.col,c=E(0,e-1,n),l=e===0?0:c?c[1]+1:0;t.freeze=v(s?{...o,row:l}:{...o,col:l})}}const f=(o,e,c)=>{if(!o)return;const l={};for(const[a,u]of Object.entries(o)){const m=e(a),d=m===void 0?void 0:x(m,n);m===void 0?l[a]=u:d!==void 0&&(l[c(d)]=u)}return l};if(s){const o=f(t.rows,e=>/^[1-9]\d*$/u.test(e)?Number(e)-1:void 0,e=>String(e+1));o&&(t.rows=o)}else{const o=f(t.columns,R,_);o&&(t.columns=o)}}run(){const t=this.edit;if($(t)){const n=this.sheets().find(s=>j(s.name,t.sheet));if(!n){this.refused="no-sheet";return}if(this.rewrite(t),this.tableOn(n,t),this.refused)return;this.blocksOn(n,t),this.looksOn(n,t);for(const s of this.after)this.rewrite(s);return}switch(t.op){case"rename-sheet":{this.rewrite(t);const n=this.sheets().find(s=>j(s.name,t.from));n&&(n.name=t.to);return}case"rename-column":{this.renameColumn(t.table,t.from,t.to),this.rewrite(t);return}case"delete-sheet":{const n=this.sheets(),s=n.find(i=>j(i.name,t.name));if(!s){this.refused="no-sheet";return}if(n.filter(i=>i.hidden!==!0).length<=1){this.refused="last-sheet";return}this.rewrite(t);for(const i of s.tables??[])this.rewrite({op:"delete-table",name:i.name});this.file.sheets=n.filter(i=>i!==s);return}default:this.rewrite(t)}}renameColumn(t,n,s){const i=this.sheets().flatMap(c=>c.tables??[]).find(c=>j(c.name,t));if(!i)return;const f=n.toLowerCase(),o=this.rows.get(i.rows),e=o?.[0]?.findIndex(c=>c.trim().toLowerCase()===f)??-1;if(o&&e>=0){const c=[...o[0]??[]];c[e]=s,this.rows.set(i.rows,[c,...o.slice(1)])}if(i.columns){const c=Object.keys(i.columns).find(l=>l.toLowerCase()===f);c!==void 0&&(i.columns=Object.fromEntries(Object.entries(i.columns).map(([l,a])=>[l===c?s:l,a])))}i.key?.toLowerCase()===f&&(i.key=s),i.filter&&(i.filter={columns:Object.fromEntries(Object.entries(i.filter.columns).map(([c,l])=>[c.toLowerCase()===f?s:c,l]))})}}const j=(r,t)=>r.toLowerCase()===t.toLowerCase();export function restructure(r,t){const n=new X(r,t);return n.run(),n.refused?{file:r.file,rows:new Map(r.rows),refused:n.refused}:{file:n.file,rows:n.rows}}export function duplicated(r,t,n){const s=new X(r,{op:"rename-sheet",from:t,to:n});return s.duplicate(t,n),s.refused?{file:r.file,rows:new Map(r.rows),refused:s.refused}:{file:s.file,rows:s.rows}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SheetSide } from "@allyhub-next/formats";
|
|
2
|
+
import type { CellLook, Table } from "./workbook.js";
|
|
3
|
+
/** A line of a part: Excel's border style and colour. */
|
|
4
|
+
export interface TableLine {
|
|
5
|
+
style: SheetSide["style"];
|
|
6
|
+
color: string;
|
|
7
|
+
}
|
|
8
|
+
/** One part of a table style: a fill, a font's weight and colour, its lines. */
|
|
9
|
+
export interface TablePart {
|
|
10
|
+
bold?: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
fill?: string;
|
|
13
|
+
/** Its outer sides, and `horizontal` and `vertical`, the lines inside it. */
|
|
14
|
+
border?: Partial<Record<"left" | "right" | "top" | "bottom" | "horizontal" | "vertical", TableLine>>;
|
|
15
|
+
}
|
|
16
|
+
export interface TableStyle {
|
|
17
|
+
whole?: TablePart;
|
|
18
|
+
header?: TablePart;
|
|
19
|
+
stripe?: TablePart;
|
|
20
|
+
stripe2?: TablePart;
|
|
21
|
+
}
|
|
22
|
+
/** A table's style unless it names one, as Excel's new table. */
|
|
23
|
+
export declare const DEFAULT_TABLE_STYLE = "TableStyleMedium2";
|
|
24
|
+
/** The style a table is drawn in; undefined for `none` or a name Excel has not. */
|
|
25
|
+
export declare const tableStyleOf: (table: Table) => TableStyle | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The look a table's style gives a cell of it, under the cell's own.
|
|
28
|
+
* `band` is which stripe the row is, counted over the rows that show
|
|
29
|
+
* (0 the first); undefined for the header.
|
|
30
|
+
*/
|
|
31
|
+
export declare function tableStyleLook(style: TableStyle, table: Table, row: number, col: number, band: number | undefined): CellLook;
|
|
32
|
+
//# sourceMappingURL=table-style.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{TABLE_STYLES as S}from"./table-styles.js";export const DEFAULT_TABLE_STYLE="TableStyleMedium2",tableStyleOf=e=>e.spec.style==="none"?void 0:S[e.spec.style??DEFAULT_TABLE_STYLE];export function tableStyleLook(e,m,d,u,b){const{area:n}=m,t={},i={},r=(o,p)=>{if(!o)return;o.bold!==void 0&&(t.bold=o.bold),o.color!==void 0&&(t.color=o.color),o.fill!==void 0&&(t.fill=o.fill);const c=o.border;if(!c)return;const l=(s,L)=>{const h=p[s]?c[s]:c[L];h&&(i[s]=h)};l("left","vertical"),l("right","vertical"),l("top","horizontal"),l("bottom","horizontal")},f={left:u===n.left,right:u===n.right};return r(e.whole,{...f,top:d===n.top,bottom:d===n.bottom}),b===void 0?r(e.header,{...f,top:!0,bottom:!0}):r(b%2===0?e.stripe:e.stripe2,{...f,top:!0,bottom:!0}),Object.keys(i).length>0&&(t.border=i),t}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const TABLE_STYLES={TableStyleDark1:{whole:{color:"#FFFFFF",fill:"#737373"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#404040"}},TableStyleDark2:{whole:{color:"#FFFFFF",fill:"#4472C4"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#2F5597"}},TableStyleDark3:{whole:{color:"#FFFFFF",fill:"#ED7D31"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#C55A11"}},TableStyleDark4:{whole:{color:"#FFFFFF",fill:"#A5A5A5"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#7C7C7C"}},TableStyleDark5:{whole:{color:"#FFFFFF",fill:"#FFC000"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#BF9000"}},TableStyleDark6:{whole:{color:"#FFFFFF",fill:"#5B9BD5"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#2E75B6"}},TableStyleDark7:{whole:{color:"#FFFFFF",fill:"#70AD47"},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#FFFFFF"}}},stripe:{fill:"#548235"}},TableStyleDark8:{whole:{fill:"#D9D9D9"},header:{color:"#FFFFFF",fill:"#000000"},stripe:{fill:"#A6A6A6"}},TableStyleDark9:{whole:{fill:"#DAE3F3"},header:{color:"#FFFFFF",fill:"#ED7D31"},stripe:{fill:"#B4C7E7"}},TableStyleDark10:{whole:{fill:"#EDEDED"},header:{color:"#FFFFFF",fill:"#FFC000"},stripe:{fill:"#DBDBDB"}},TableStyleDark11:{whole:{fill:"#DEEBF7"},header:{color:"#FFFFFF",fill:"#70AD47"},stripe:{fill:"#BDD7EE"}},TableStyleLight1:{whole:{color:"#000000",border:{top:{style:"thin",color:"#000000"},bottom:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"thin",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleLight2:{whole:{color:"#2F5597",border:{top:{style:"thin",color:"#4472C4"},bottom:{style:"thin",color:"#4472C4"}}},header:{bold:!0,color:"#2F5597",border:{bottom:{style:"thin",color:"#4472C4"}}},stripe:{fill:"#DAE3F3"}},TableStyleLight3:{whole:{color:"#C55A11",border:{top:{style:"thin",color:"#ED7D31"},bottom:{style:"thin",color:"#ED7D31"}}},header:{bold:!0,color:"#C55A11",border:{bottom:{style:"thin",color:"#ED7D31"}}},stripe:{fill:"#FBE5D6"}},TableStyleLight4:{whole:{color:"#7C7C7C",border:{top:{style:"thin",color:"#A5A5A5"},bottom:{style:"thin",color:"#A5A5A5"}}},header:{bold:!0,color:"#7C7C7C",border:{bottom:{style:"thin",color:"#A5A5A5"}}},stripe:{fill:"#EDEDED"}},TableStyleLight5:{whole:{color:"#BF9000",border:{top:{style:"thin",color:"#FFC000"},bottom:{style:"thin",color:"#FFC000"}}},header:{bold:!0,color:"#BF9000",border:{bottom:{style:"thin",color:"#FFC000"}}},stripe:{fill:"#FFF2CC"}},TableStyleLight6:{whole:{color:"#2E75B6",border:{top:{style:"thin",color:"#5B9BD5"},bottom:{style:"thin",color:"#5B9BD5"}}},header:{bold:!0,color:"#2E75B6",border:{bottom:{style:"thin",color:"#5B9BD5"}}},stripe:{fill:"#DEEBF7"}},TableStyleLight7:{whole:{color:"#548235",border:{top:{style:"thin",color:"#70AD47"},bottom:{style:"thin",color:"#70AD47"}}},header:{bold:!0,color:"#548235",border:{bottom:{style:"thin",color:"#70AD47"}}},stripe:{fill:"#E2F0D9"}},TableStyleLight8:{whole:{color:"#000000",border:{left:{style:"thin",color:"#000000"},right:{style:"thin",color:"#000000"},top:{style:"thin",color:"#000000"},bottom:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#000000"},stripe:{border:{top:{style:"thin",color:"#000000"}}},stripe2:{border:{top:{style:"thin",color:"#000000"}}}},TableStyleLight9:{whole:{color:"#000000",border:{left:{style:"thin",color:"#4472C4"},right:{style:"thin",color:"#4472C4"},top:{style:"thin",color:"#4472C4"},bottom:{style:"thin",color:"#4472C4"}}},header:{bold:!0,color:"#FFFFFF",fill:"#4472C4"},stripe:{border:{top:{style:"thin",color:"#4472C4"}}},stripe2:{border:{top:{style:"thin",color:"#4472C4"}}}},TableStyleLight10:{whole:{color:"#000000",border:{left:{style:"thin",color:"#ED7D31"},right:{style:"thin",color:"#ED7D31"},top:{style:"thin",color:"#ED7D31"},bottom:{style:"thin",color:"#ED7D31"}}},header:{bold:!0,color:"#FFFFFF",fill:"#ED7D31"},stripe:{border:{top:{style:"thin",color:"#ED7D31"}}},stripe2:{border:{top:{style:"thin",color:"#ED7D31"}}}},TableStyleLight11:{whole:{color:"#000000",border:{left:{style:"thin",color:"#A5A5A5"},right:{style:"thin",color:"#A5A5A5"},top:{style:"thin",color:"#A5A5A5"},bottom:{style:"thin",color:"#A5A5A5"}}},header:{bold:!0,color:"#FFFFFF",fill:"#A5A5A5"},stripe:{border:{top:{style:"thin",color:"#A5A5A5"}}},stripe2:{border:{top:{style:"thin",color:"#A5A5A5"}}}},TableStyleLight12:{whole:{color:"#000000",border:{left:{style:"thin",color:"#FFC000"},right:{style:"thin",color:"#FFC000"},top:{style:"thin",color:"#FFC000"},bottom:{style:"thin",color:"#FFC000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#FFC000"},stripe:{border:{top:{style:"thin",color:"#FFC000"}}},stripe2:{border:{top:{style:"thin",color:"#FFC000"}}}},TableStyleLight13:{whole:{color:"#000000",border:{left:{style:"thin",color:"#5B9BD5"},right:{style:"thin",color:"#5B9BD5"},top:{style:"thin",color:"#5B9BD5"},bottom:{style:"thin",color:"#5B9BD5"}}},header:{bold:!0,color:"#FFFFFF",fill:"#5B9BD5"},stripe:{border:{top:{style:"thin",color:"#5B9BD5"}}},stripe2:{border:{top:{style:"thin",color:"#5B9BD5"}}}},TableStyleLight14:{whole:{color:"#000000",border:{left:{style:"thin",color:"#70AD47"},right:{style:"thin",color:"#70AD47"},top:{style:"thin",color:"#70AD47"},bottom:{style:"thin",color:"#70AD47"}}},header:{bold:!0,color:"#FFFFFF",fill:"#70AD47"},stripe:{border:{top:{style:"thin",color:"#70AD47"}}},stripe2:{border:{top:{style:"thin",color:"#70AD47"}}}},TableStyleLight15:{whole:{color:"#000000",border:{left:{style:"thin",color:"#000000"},right:{style:"thin",color:"#000000"},top:{style:"thin",color:"#000000"},bottom:{style:"thin",color:"#000000"},horizontal:{style:"thin",color:"#000000"},vertical:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleLight16:{whole:{color:"#000000",border:{left:{style:"thin",color:"#4472C4"},right:{style:"thin",color:"#4472C4"},top:{style:"thin",color:"#4472C4"},bottom:{style:"thin",color:"#4472C4"},horizontal:{style:"thin",color:"#4472C4"},vertical:{style:"thin",color:"#4472C4"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#4472C4"}}},stripe:{fill:"#DAE3F3"}},TableStyleLight17:{whole:{color:"#000000",border:{left:{style:"thin",color:"#ED7D31"},right:{style:"thin",color:"#ED7D31"},top:{style:"thin",color:"#ED7D31"},bottom:{style:"thin",color:"#ED7D31"},horizontal:{style:"thin",color:"#ED7D31"},vertical:{style:"thin",color:"#ED7D31"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#ED7D31"}}},stripe:{fill:"#FBE5D6"}},TableStyleLight18:{whole:{color:"#000000",border:{left:{style:"thin",color:"#A5A5A5"},right:{style:"thin",color:"#A5A5A5"},top:{style:"thin",color:"#A5A5A5"},bottom:{style:"thin",color:"#A5A5A5"},horizontal:{style:"thin",color:"#A5A5A5"},vertical:{style:"thin",color:"#A5A5A5"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#A5A5A5"}}},stripe:{fill:"#EDEDED"}},TableStyleLight19:{whole:{color:"#000000",border:{left:{style:"thin",color:"#FFC000"},right:{style:"thin",color:"#FFC000"},top:{style:"thin",color:"#FFC000"},bottom:{style:"thin",color:"#FFC000"},horizontal:{style:"thin",color:"#FFC000"},vertical:{style:"thin",color:"#FFC000"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#FFC000"}}},stripe:{fill:"#FFF2CC"}},TableStyleLight20:{whole:{color:"#000000",border:{left:{style:"thin",color:"#5B9BD5"},right:{style:"thin",color:"#5B9BD5"},top:{style:"thin",color:"#5B9BD5"},bottom:{style:"thin",color:"#5B9BD5"},horizontal:{style:"thin",color:"#5B9BD5"},vertical:{style:"thin",color:"#5B9BD5"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#5B9BD5"}}},stripe:{fill:"#DEEBF7"}},TableStyleLight21:{whole:{color:"#000000",border:{left:{style:"thin",color:"#70AD47"},right:{style:"thin",color:"#70AD47"},top:{style:"thin",color:"#70AD47"},bottom:{style:"thin",color:"#70AD47"},horizontal:{style:"thin",color:"#70AD47"},vertical:{style:"thin",color:"#70AD47"}}},header:{bold:!0,color:"#000000",border:{bottom:{style:"medium",color:"#70AD47"}}},stripe:{fill:"#E2F0D9"}},TableStyleMedium1:{whole:{color:"#000000",border:{left:{style:"thin",color:"#000000"},right:{style:"thin",color:"#000000"},top:{style:"thin",color:"#000000"},bottom:{style:"thin",color:"#000000"},horizontal:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#000000"},stripe:{fill:"#D9D9D9"}},TableStyleMedium2:{whole:{color:"#000000",border:{left:{style:"thin",color:"#8FAADC"},right:{style:"thin",color:"#8FAADC"},top:{style:"thin",color:"#8FAADC"},bottom:{style:"thin",color:"#8FAADC"},horizontal:{style:"thin",color:"#8FAADC"}}},header:{bold:!0,color:"#FFFFFF",fill:"#4472C4"},stripe:{fill:"#DAE3F3"}},TableStyleMedium3:{whole:{color:"#000000",border:{left:{style:"thin",color:"#F4B183"},right:{style:"thin",color:"#F4B183"},top:{style:"thin",color:"#F4B183"},bottom:{style:"thin",color:"#F4B183"},horizontal:{style:"thin",color:"#F4B183"}}},header:{bold:!0,color:"#FFFFFF",fill:"#ED7D31"},stripe:{fill:"#FBE5D6"}},TableStyleMedium4:{whole:{color:"#000000",border:{left:{style:"thin",color:"#C9C9C9"},right:{style:"thin",color:"#C9C9C9"},top:{style:"thin",color:"#C9C9C9"},bottom:{style:"thin",color:"#C9C9C9"},horizontal:{style:"thin",color:"#C9C9C9"}}},header:{bold:!0,color:"#FFFFFF",fill:"#A5A5A5"},stripe:{fill:"#EDEDED"}},TableStyleMedium5:{whole:{color:"#000000",border:{left:{style:"thin",color:"#FFD966"},right:{style:"thin",color:"#FFD966"},top:{style:"thin",color:"#FFD966"},bottom:{style:"thin",color:"#FFD966"},horizontal:{style:"thin",color:"#FFD966"}}},header:{bold:!0,color:"#FFFFFF",fill:"#FFC000"},stripe:{fill:"#FFF2CC"}},TableStyleMedium6:{whole:{color:"#000000",border:{left:{style:"thin",color:"#9DC3E6"},right:{style:"thin",color:"#9DC3E6"},top:{style:"thin",color:"#9DC3E6"},bottom:{style:"thin",color:"#9DC3E6"},horizontal:{style:"thin",color:"#9DC3E6"}}},header:{bold:!0,color:"#FFFFFF",fill:"#5B9BD5"},stripe:{fill:"#DEEBF7"}},TableStyleMedium7:{whole:{color:"#000000",border:{left:{style:"thin",color:"#A9D18E"},right:{style:"thin",color:"#A9D18E"},top:{style:"thin",color:"#A9D18E"},bottom:{style:"thin",color:"#A9D18E"},horizontal:{style:"thin",color:"#A9D18E"}}},header:{bold:!0,color:"#FFFFFF",fill:"#70AD47"},stripe:{fill:"#E2F0D9"}},TableStyleMedium8:{whole:{color:"#000000",fill:"#D9D9D9",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#A6A6A6"}},TableStyleMedium9:{whole:{color:"#000000",fill:"#DAE3F3",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#4472C4",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#B4C7E7"}},TableStyleMedium10:{whole:{color:"#000000",fill:"#FBE5D6",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#ED7D31",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#F8CBAD"}},TableStyleMedium11:{whole:{color:"#000000",fill:"#EDEDED",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#A5A5A5",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#DBDBDB"}},TableStyleMedium12:{whole:{color:"#000000",fill:"#FFF2CC",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#FFC000",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#FFE699"}},TableStyleMedium13:{whole:{color:"#000000",fill:"#DEEBF7",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#5B9BD5",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#BDD7EE"}},TableStyleMedium14:{whole:{color:"#000000",fill:"#E2F0D9",border:{horizontal:{style:"thin",color:"#FFFFFF"},vertical:{style:"thin",color:"#FFFFFF"}}},header:{bold:!0,color:"#FFFFFF",fill:"#70AD47",border:{bottom:{style:"thick",color:"#FFFFFF"}}},stripe:{fill:"#C5E0B4"}},TableStyleMedium15:{whole:{color:"#000000",border:{left:{style:"thin",color:"#000000"},right:{style:"thin",color:"#000000"},top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"},horizontal:{style:"thin",color:"#000000"},vertical:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#000000",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium16:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#4472C4",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium17:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#ED7D31",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium18:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#A5A5A5",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium19:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#FFC000",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium20:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#5B9BD5",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium21:{whole:{color:"#000000",border:{top:{style:"medium",color:"#000000"},bottom:{style:"medium",color:"#000000"}}},header:{bold:!0,color:"#FFFFFF",fill:"#70AD47",border:{bottom:{style:"medium",color:"#000000"}}},stripe:{fill:"#D9D9D9"}},TableStyleMedium22:{whole:{color:"#000000",fill:"#D9D9D9",border:{left:{style:"thin",color:"#000000"},right:{style:"thin",color:"#000000"},top:{style:"thin",color:"#000000"},bottom:{style:"thin",color:"#000000"},horizontal:{style:"thin",color:"#000000"},vertical:{style:"thin",color:"#000000"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#A6A6A6"}},TableStyleMedium23:{whole:{color:"#000000",fill:"#DAE3F3",border:{left:{style:"thin",color:"#8FAADC"},right:{style:"thin",color:"#8FAADC"},top:{style:"thin",color:"#8FAADC"},bottom:{style:"thin",color:"#8FAADC"},horizontal:{style:"thin",color:"#8FAADC"},vertical:{style:"thin",color:"#8FAADC"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#B4C7E7"}},TableStyleMedium24:{whole:{color:"#000000",fill:"#FBE5D6",border:{left:{style:"thin",color:"#F4B183"},right:{style:"thin",color:"#F4B183"},top:{style:"thin",color:"#F4B183"},bottom:{style:"thin",color:"#F4B183"},horizontal:{style:"thin",color:"#F4B183"},vertical:{style:"thin",color:"#F4B183"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#F8CBAD"}},TableStyleMedium25:{whole:{color:"#000000",fill:"#EDEDED",border:{left:{style:"thin",color:"#C9C9C9"},right:{style:"thin",color:"#C9C9C9"},top:{style:"thin",color:"#C9C9C9"},bottom:{style:"thin",color:"#C9C9C9"},horizontal:{style:"thin",color:"#C9C9C9"},vertical:{style:"thin",color:"#C9C9C9"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#DBDBDB"}},TableStyleMedium26:{whole:{color:"#000000",fill:"#FFF2CC",border:{left:{style:"thin",color:"#FFD966"},right:{style:"thin",color:"#FFD966"},top:{style:"thin",color:"#FFD966"},bottom:{style:"thin",color:"#FFD966"},horizontal:{style:"thin",color:"#FFD966"},vertical:{style:"thin",color:"#FFD966"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#FFE699"}},TableStyleMedium27:{whole:{color:"#000000",fill:"#DEEBF7",border:{left:{style:"thin",color:"#9DC3E6"},right:{style:"thin",color:"#9DC3E6"},top:{style:"thin",color:"#9DC3E6"},bottom:{style:"thin",color:"#9DC3E6"},horizontal:{style:"thin",color:"#9DC3E6"},vertical:{style:"thin",color:"#9DC3E6"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#BDD7EE"}},TableStyleMedium28:{whole:{color:"#000000",fill:"#E2F0D9",border:{left:{style:"thin",color:"#A9D18E"},right:{style:"thin",color:"#A9D18E"},top:{style:"thin",color:"#A9D18E"},bottom:{style:"thin",color:"#A9D18E"},horizontal:{style:"thin",color:"#A9D18E"},vertical:{style:"thin",color:"#A9D18E"}}},header:{bold:!0,color:"#000000"},stripe:{fill:"#C5E0B4"}}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export class CellError{static all=new Map;code;constructor(t){this.code=t}static of(t){let n=CellError.all.get(t);return n||(n=new CellError(t),CellError.all.set(t,n)),n}toString(){return this.code}toJSON(){return this.code}}export const ERR={NULL:CellError.of("#NULL!"),DIV0:CellError.of("#DIV/0!"),VALUE:CellError.of("#VALUE!"),REF:CellError.of("#REF!"),NAME:CellError.of("#NAME?"),NUM:CellError.of("#NUM!"),NA:CellError.of("#N/A"),SPILL:CellError.of("#SPILL!"),CALC:CellError.of("#CALC!"),CYCLE:CellError.of("#CYCLE!")};const
|
|
2
|
+
export class CellError{static all=new Map;code;constructor(t){this.code=t}static of(t){let n=CellError.all.get(t);return n||(n=new CellError(t),CellError.all.set(t,n)),n}toString(){return this.code}toJSON(){return this.code}}export const ERR={NULL:CellError.of("#NULL!"),DIV0:CellError.of("#DIV/0!"),VALUE:CellError.of("#VALUE!"),REF:CellError.of("#REF!"),NAME:CellError.of("#NAME?"),NUM:CellError.of("#NUM!"),NA:CellError.of("#N/A"),SPILL:CellError.of("#SPILL!"),CALC:CellError.of("#CALC!"),CYCLE:CellError.of("#CYCLE!")};const $=["#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A","#GETTING_DATA","#SPILL!","#CALC!","#CYCLE!"];export function errorOf(e){const t=e.toUpperCase(),n=$.find(r=>r===t);return n===void 0?void 0:CellError.of(n)}export class Matrix{rows;cols;data;constructor(t,n,r){this.rows=t,this.cols=n,this.data=r}at(t,n){return this.data[t*this.cols+n]??null}}const i=864e5,p=25569;function y(e){const t=e+p;return t<61?t-1:t}function M(e){const t=Math.floor(e);if(t!==60)return(t<60?t+1:t)-p}export function serialOf(e,t,n){const r=new Date(Date.UTC(2e3,t-1,1));return r.setUTCFullYear(r.getUTCFullYear()-2e3+e),y(Math.floor(r.getTime()/i))+n-1}export function dateOf(e){const t=M(e);if(t===void 0)return{year:1900,month:2,day:29};if(Math.floor(e)===0)return{year:1900,month:1,day:0};const n=new Date(t*i);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()}}export function serialOfDate(e){const t=e.getTime(),n=Math.floor(t/i);return y(n)+(t-n*i)/i}export function dateOfSerial(e){const t=M(e);if(t===void 0)return;const n=e-Math.floor(e);return new Date(t*i+Math.round(n*i))}const a=(e,t=2)=>String(e).padStart(t,"0");export function isoOfSerial(e){const{year:t,month:n,day:r}=dateOf(e),s=`${a(t,4)}-${a(n)}-${a(r)}`,o=Math.round((e-Math.floor(e))*86400);if(o===0)return s;const u=o%60;return`${s}T${a(Math.floor(o/3600))}:${a(Math.floor(o/60)%60)}${u===0?"":`:${a(u)}`}`}export function numberText(e){if(e===0)return"0";const t=Number(e.toPrecision(15)),n=Math.floor(Math.log10(Math.abs(t)));if(n>=15||n<-10){const[s="",o="0"]=t.toExponential().split("e"),u=Number(o);return`${s}E${u<0?"-":"+"}${a(Math.abs(u))}`}const r=String(t);return r.includes("e")?t.toFixed(Math.min(20,Math.abs(n)+15)).replace(/0+$/u,""):r}const N=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u,E=/^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d+)?$/u,L=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,b=e=>/^[+-]?\d+$/u.test(e)&&e.replace(/^[+-]?0*/u,"").length>15;function A(e){const t=L.exec(e);if(!t)return;const[n,r,s]=[Number(t[1]),Number(t[2]),Number(t[3])],o=serialOf(n,r,s),u=dateOf(o);if(u.month!==r||u.day!==s)return;if(t[4]===void 0)return{value:o,format:"yyyy-mm-dd"};const[f,d,m]=[Number(t[4]),Number(t[5]),Number(t[6]??0)];if(f>23||d>59||m>59)return;const c=t[7];let h=0;if(c!==void 0&&c!=="Z"){const l=c.replace(":","");h=(l.startsWith("-")?1:-1)*(Number(l.slice(1,3))*60+Number(l.slice(3,5)))/1440}return{value:o+(f*3600+d*60+m)/86400+h,format:t[6]===void 0?"yyyy-mm-dd hh:mm":"yyyy-mm-dd hh:mm:ss"}}function U(e){const t=/^(\d{1,4}):([0-5]?\d)(?::([0-5]?\d))?(?:\s*([AaPp])[Mm]?)?$/u.exec(e)??/^(\d{1,2})()()\s*([AaPp])[Mm]?$/u.exec(e);if(!t)return;const n=Number(t[1]),r=t[2]===void 0||t[2]===""?0:Number(t[2]),s=t[3]===void 0||t[3]===""?0:Number(t[3]),o=t[4]?.toUpperCase();if(o!==void 0)return n<1||n>12?void 0:{value:((n%12+(o==="P"?12:0))*3600+r*60+s)/86400,format:t[3]?"h:mm:ss AM/PM":"h:mm AM/PM"};const u=(n*3600+r*60+s)/86400;return n>=24?{value:u,format:"[h]:mm:ss"}:{value:u,format:t[3]?"h:mm:ss":"h:mm"}}export function readTyped(e){if(e==="")return{value:null};if(e.startsWith("'"))return{value:e.slice(1)};if(e.length>1&&e.startsWith("="))return{value:null,formula:e};const t=e.trim();if(t==="")return{value:e};const n=t.toUpperCase();if(n==="TRUE")return{value:!0};if(n==="FALSE")return{value:!1};if(N.test(t))return b(t)?{value:e}:{value:Number(t)};if(t.endsWith("%")){const d=t.slice(0,-1).trim();if(N.test(d))return{value:Number(d)/100,format:d.includes(".")?"0.00%":"0%"}}if(E.test(t))return{value:Number(t.replaceAll(",","")),format:t.includes(".")?"#,##0.00":"#,##0"};const r=/^([+-]?)\$(\d[\d,]*(?:\.\d+)?)$/u.exec(t),s=r?.[2]?.replaceAll(",","");if(r&&s!==void 0)return{value:+`${r[1]??""}${s}`,format:t.includes(".")?"$#,##0.00":"$#,##0"};const o=A(t);if(o)return o;const u=U(t);if(u)return u;const f=errorOf(t);return f?{value:f}:{value:e}}export function writeTyped(e){if(e===null)return"";if(typeof e=="number"){const n=String(e);return b(n)?e.toExponential():n}if(typeof e=="boolean")return e?"TRUE":"FALSE";if(e instanceof CellError)return e.code;const t=readTyped(e);return t.value===e&&t.formula===void 0?e:`'${e}`}
|