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,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as N,isArea as R,isBar as
|
|
3
|
-
`,
|
|
2
|
+
import{lumOf as X}from"@allyhub-next/ooxml/brightness";import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as N,isArea as R,isBar as C,isHorizontal as T,isLine as k,isRound as h,isScatter as P,labelPositionOf as U,variesOf as w}from"./chart.js";const V="http://schemas.openxmlformats.org/drawingml/2006/chart",B="http://schemas.openxmlformats.org/drawingml/2006/main",W="http://schemas.openxmlformats.org/officeDocument/2006/relationships",H=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,y="2118791784",x="2140495176",Z={"&":"&","<":"<",">":">",'"':"""},q=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},l=e=>Array.from(e,n=>q(n)?"":Z[n]??n).join("");function r(e,n={},...c){const o=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${l(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),a=c.join("");return a===""?`<${e}${o}/>`:`<${e}${o}>${a}</${e}>`}const K=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=X(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},f=e=>e===null?r("a:noFill"):r("a:solidFill",{},K(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),m=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},f(e)),O=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":f(n))),r("a:endParaRPr",{lang:"en-US"}))),S=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${l(n)}</c:v>`))),A=(e,n)=>r("c:numCache",{},`<c:formatCode>${l(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,o)=>c===null?[]:[r("c:pt",{idx:o},`<c:v>${String(c)}</c:v>`)])),Y=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${l(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${l(n)}</c:f>`,S([e.name]))),J=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${l(n)}</c:f>`,A("General",e.x??[])));function Q(e,n,c,o){const a=n.color??j(c),s=h(e.type),i=P(e.type),u=k(e.type)||i,g=N(e.type),I=u?r("c:spPr",{},E(e.type)?m(a,n.line_width??d.lineWidth):r("a:ln",{w:19050},f(null))):r("c:spPr",{},f(a),s?m("lt1",1):""),_=o.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),Y(n,o.name(c)),I,C(e.type)?t("c:invertIfNegative",!1):"",u?r("c:marker",{},t("c:symbol",g?"circle":"none"),g?t("c:size",n.marker_size??d.marker):"",g?r("c:spPr",{},f(a),m(a)):""):"",...w(e)&&!u&&!R(e.type)?e.categories.map((v,p)=>r("c:dPt",{},t("c:idx",p),C(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},f(j(p)),s?m("lt1",1):""))):[],i?J(n,o.x?.(c)):_===void 0?"":r("c:cat",{},o.numeric===!0?r("c:numRef",{},`<c:f>${l(_)}</c:f>`,A("General",e.categories.map(v=>{const p=Number(v);return v===""||!Number.isFinite(p)?null:p}))):r("c:strRef",{},`<c:f>${l(_)}</c:f>`,S(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${l(o.values(c))}</c:f>`,A(n.number_format,n.values))),u?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function b(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,o=U(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!h(e.type)?"":O(n.size,n.color??(h(e.type)?"lt1":void 0)),o===void 0?"":t("c:dLblPos",o),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function ee(e,n){const c=e.series.map((s,i)=>Q(e,s,i,n)).join(""),o=z(e.type),a=t("c:axId",y)+t("c:axId",x);if(h(e.type)){const s=e.type==="pie";return r(s?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",w(e)),c,b(e),t("c:firstSliceAng",0),s?"":t("c:holeSize",e.hole_size??50))}if(P(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),c,b(e),a);if(C(e.type)){const s=o!=="clustered";return r("c:barChart",{},t("c:barDir",T(e.type)?"bar":"col"),t("c:grouping",o),t("c:varyColors",w(e)),c,b(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||s?t("c:overlap",e.overlap??100):"",a)}return r(k(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",o),t("c:varyColors",!1),c,b(e),k(e.type)?t("c:marker",!0):"",a)}const L=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),F=e=>r("c:spPr",{},m(e.line_color??{rgb:d.axisLine},d.gridWidth)),M=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},m(e.gridline_color??{rgb:d.gridline},d.gridWidth))):"",G=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${l(e)}</a:t>`))),$=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},G(e,n)),t("c:overlay",!1));function te(e){if(h(e.type))return"";const n=P(e.type),c=T(e.type),o=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},s=z(e.type)==="percentStacked",i=a.number_format??(s?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??d.fontSize)*100);return(n?r("c:valAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos","b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),F(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos",c?"l":"b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),F(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",x),L(a),t("c:delete",a.visible===!1),t("c:axPos",c?"b":"l"),M(a),$(a.title,u),r("c:numFmt",{formatCode:i,sourceLinked:a.number_format===void 0&&!s?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},m(null)),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween",R(e.type)||n?"midCat":"between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const ne={bottom:"b",top:"t",left:"l",right:"r"};function re(e,n){const c=n.width,o=n.height,{plot:a}=D(e,c,o),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(a.x/c)),t("c:y",s(a.y/o)),t("c:w",s(a.width/c)),t("c:h",s(a.height/o))))}export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,o=e.font_size??d.fontSize,a=Math.round((e.title_size??o*d.titleScale)*100);return H+r("c:chartSpace",{"xmlns:c":V,"xmlns:a":B,"xmlns:r":W},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?G(c,a):r("c:strRef",{},`<c:f>${l(n.titleRef)}</c:f>`,S([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?re(e,n.frame):r("c:layout"),ee(e,n.refs),te(e)),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",ne[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),O(o,e.font_color??"dk1"),n.tail??"")}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import type { ChartLegendPosition, SheetChartType, ThemeColor } from "@allyhub-next/formats";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { ChartLegendPosition, Color, SheetChartType, ThemeColor } from "@allyhub-next/formats";
|
|
2
|
+
export type { Color };
|
|
3
|
+
/** A theme colour at a brightness: its name alone at 0. */
|
|
4
|
+
export declare const themeColor: (theme_color: ThemeColor, brightness?: number) => Color;
|
|
5
|
+
/** The theme colour a colour is, at any brightness. */
|
|
6
|
+
export declare const themeColorOf: (c: Color) => ThemeColor | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* A colour as it is drawn, against the theme in force: a theme colour's
|
|
9
|
+
* value, lighter or darker by its brightness as PowerPoint makes it, or its
|
|
10
|
+
* own. Every colour drawn or measured comes through here.
|
|
11
|
+
*/
|
|
12
|
+
export declare function colorRgb(c: Color, colors: Readonly<Record<ThemeColor, string>>): string;
|
|
6
13
|
/** The kinds a chart is drawn as: a slide's and a sheet's (which adds scatter). */
|
|
7
14
|
export type ChartKind = SheetChartType;
|
|
8
15
|
/** Where a data label sits (`c:dLblPos`). */
|
|
@@ -60,6 +67,8 @@ export interface ChartDef {
|
|
|
60
67
|
title?: string;
|
|
61
68
|
/** Where its legend is; absent: it has none. */
|
|
62
69
|
legend?: ChartLegendPosition;
|
|
70
|
+
/** Its legend drawn over the plot, the plot not made smaller for it (python-pptx's include_in_layout false, `c:overlay`). */
|
|
71
|
+
legend_overlay?: boolean;
|
|
63
72
|
/** Its data labels; absent: it has none. */
|
|
64
73
|
labels?: ChartLabelsDef;
|
|
65
74
|
/** Between bars' groups, as a share of a bar's width, in %. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{format as Lt,isValidFormat as jt}from"numfmt";export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const bt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>bt[t%bt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const a=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&a.includes(l))return l;if(a.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,a="General"){return a==="General"||!jt(a)?String(Number(t.toPrecision(10))):Lt(a,t)}const Ct=[1,2,5,10];export function chartScale(t,a,l,s,e={}){const h=t>0&&(a-t)/a<.16666666666666666?t:Math.min(t,0),i=a<=0&&t<0?0:a,o=e.minimum_scale??h,C=e.maximum_scale??i,_=C>o?C-o:1,F=Math.max(1,Math.floor(l/s)),b=_/F,P=10**Math.floor(Math.log10(b)),B=e.major_unit??(Ct.find(E=>E*P>=b)??10)*P,N=(E,L)=>Number((L(Number((E/B).toFixed(9)))*B).toPrecision(12)),Z=i>0?i+_*.05:i===h?_:i,g=e.maximum_scale??N(Z,Math.ceil),R=h<0?h-_*.05:h,W=e.minimum_scale??N(R,Math.floor),O=[],x=Math.round((g-W)/B);for(let E=0;E<=x;E++)O.push(Number((W+E*B).toPrecision(12)));return{min:W,max:g,major:B,ticks:O}}const it=(t,a)=>{let l=0;for(const s of t)l+=(s.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*a},d=t=>String(Number(t.toFixed(3)));function $t(t){const a=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,s],e)=>{if(e===0)return`M${d(l)} ${d(s)}`;const[h,i]=a(e-2),[o,C]=a(e-1),[_,F]=a(e+1),b=`${d(o+(l-h)/6)} ${d(C+(s-i)/6)}`,P=`${d(l-(_-o)/6)} ${d(s-(F-C)/6)}`;return`C${b} ${P} ${d(l)} ${d(s)}`}).join(" ")}const lt=t=>t.map(([a,l],s)=>`${s===0?"M":"L"}${d(a)} ${d(l)}`).join(" ");function Ft(t,a,l,s,e,h){const i=(F,b)=>`${d(t+F*Math.sin(b))} ${d(a-F*Math.cos(b))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,C=o-e>Math.PI?1:0,_=`M${i(l,e)} A${d(l)} ${d(l)} 0 ${String(C)} 1 ${i(l,o)}`;return s<=0?`${_} L${d(t)} ${d(a)} Z`:`${_} L${i(s,o)} A${d(s)} ${d(s)} 0 ${String(C)} 0 ${i(s,e)} Z`}function vt(t,a,l,s){const e=s*1.5;return a!==void 0&&a!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function kt(t,a,l,s,e,h,i){s!==void 0&&s!==""&&t.words.push({x:a.x+a.width/2,y:l.y,text:s,size:h,anchor:"middle",color:i}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:a.y+a.height/2,text:e,size:h,anchor:"middle",color:i,rotate:-90})}const ht=(t,a,l,s,e)=>{const h=t.labels;if(!h)return"";const i=isRound(t.type),o=[];return h.show_series_name&&o.push(s.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(a,h.number_format??s.number_format)),h.show_percentage&&i&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,a,l,s,e){const h=CHART_DEFAULTS,i=t.category_axis??{},o=t.value_axis??{},C=vt(l,i.title,o.title,s),_=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=_.flat().map(c=>c[0]),b=_.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,B=c=>c.length>0?Math.max(...c):1,N=o.number_format??t.series[0]?.number_format??"General",Z=i.number_format??"General",g=s*.5,R=chartScale(P(b),B(b),l.bottom-l.top,s*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,N),s)))+g,O=i.visible===!1?0:s*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-O};a.plot=x,kt(a,x,C,i.title,o.title,s,e);const E=chartScale(P(F),B(F),x.width,s*5,i),L=chartScale(P(b),B(b),x.height,s*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(L.max,Math.max(L.min,c))-L.min)/(L.max-L.min)*x.height;for(const c of L.ticks){const $=D(c);(o.has_major_gridlines??!0)&&a.grid.push({d:`M${d(x.x)} ${d($)} H${d(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&a.words.push({x:x.x-g,y:$,text:formatValue(c,N),size:s,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);i.has_major_gridlines===!0&&a.grid.push({d:`M${d($)} ${d(x.y)} V${d(x.y+x.height)}`,color:i.gridline_color??{rgb:h.gridline},width:h.gridWidth}),i.visible!==!1&&a.words.push({x:$,y:x.y+x.height+g+s*.6,text:formatValue(c,Z),size:s,anchor:"middle",color:e})}a.axes.push({d:`M${d(x.x)} ${d(D(Math.max(L.min,Math.min(L.max,0))))} H${d(x.x+x.width)}`,color:i.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(_[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&a.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?$t(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)a.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,a,l){const s=CHART_DEFAULTS,e=t.font_size??s.fontSize,h=t.font_color??"dk1",i={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:s.margin,top:s.margin,right:a-s.margin,bottom:l-s.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*s.titleScale;i.words.push({x:a/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const C=isRound(t.type),_=variesOf(t),F=(n,m)=>_?accentOf(m):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=_?t.categories:t.series.map(p=>p.name),m=e*.6,f=e*.4,r=e*1.5,y=n.map(p=>m+f+it(p,e)),S=(p,M,w)=>{i.keys.push({x:M,y:w-m/2,width:m,height:m,color:_?accentOf(p):t.series[p]?.color??accentOf(p),series:_?0:p,category:_?p:0}),i.words.push({x:M+m+f,y:w,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+r/2:o.bottom-r/2;let w=(a-p)/2;n.forEach((A,v)=>{S(v,w,M),w+=(y[v]??0)+e}),t.legend==="top"?o.top+=r:o.bottom-=r}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,w=(o.top+o.bottom-r*n.length)/2+r/2;n.forEach((A,v)=>{S(v,M,w+v*r)}),t.legend==="left"?o.left+=p+e:o.right-=p+e}}const b=t.labels,P=b?.size??e,B=b?.color??h,N=(n,m,f,r,y=B)=>{f!==""&&i.words.push({x:n,y:m,text:f,size:P,anchor:r,color:y})};if(C){const n=t.series[0],m=(n?.values??[]).map(w=>Math.max(0,w??0)),f=m.reduce((w,A)=>w+A,0),r=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?r*((t.hole_size??s.holeSize)/100):0;i.plot={x:y-r,y:S-r,width:r*2,height:r*2};let M=0;return m.forEach((w,A)=>{const v=f>0?w/f:0,V=M+v*Math.PI*2;if(v>0){i.shapes.push({d:Ft(y,S,r,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const j=(M+V)/2,k=p>0?(r+p)/2:labelPositionOf(t)==="inEnd"?r*.85:r*.6;n&&N(y+k*Math.sin(j),S-k*Math.cos(j),ht(t,w,v,n,t.categories[A]??""),"middle",b?.color??"lt1")}M=V}),i}if(isScatter(t.type))return Bt(t,i,o,e,h),i;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",O=R==="percentStacked",x=t.series.map(n=>t.categories.map((m,f)=>n.values[f]??null)),E=t.categories.map((n,m)=>x.reduce((f,r)=>f+Math.abs(r[m]??0),0)),L=(n,m)=>{const f=x[n]?.[m];if(f==null)return null;const r=E[m]??0;return O?r>0?f/r:0:f};let z=0,D=0;if(t.categories.forEach((n,m)=>{let f=0,r=0;t.series.forEach((y,S)=>{const p=L(S,m)??0;W?p>=0?f+=p:r+=p:(f=Math.max(f,p),r=Math.min(r,p))}),D=Math.max(D,f),z=Math.min(z,r)}),!W){const n=x.flat().filter(m=>m!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}O&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(O?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...O?{maximum_scale:c.maximum_scale??1}:{}}),Wt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),Et=Math.max(0,...Wt.map(n=>it(n,e))),ot=$.visible!==!1,dt=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,mt=g?c.title:$.title,ft=g?$.title:c.title,St=vt(o,mt,ft,e),u=g?{x:o.left+(ot?dt+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:Et+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x,i.plot=u,kt(i,u,St,mt,ft,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...O?{maximum_scale:c.maximum_scale??1}:{}}),ut=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+ut(n):u.y+u.height-ut(n),pt=isArea(t.type),gt=$.reverse_order===!0,xt=g?!gt:gt,at=(g?u.height:u.width)/Z,yt=pt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const m=pt?n*yt:(n+.5)*at,f=g?u.height:u.width,r=xt?f-m:m;return(g?u.y:u.x)+r},Mt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const m=q(n);(c.has_major_gridlines??!0)&&i.grid.push({d:g?`M${d(m)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(m)} H${d(u.x+u.width)}`,color:c.gridline_color??{rgb:s.gridline},width:s.gridWidth}),c.visible!==!1&&i.words.push(g?{x:m,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:m,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(i.axes.push({d:g?`M${d(Mt)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(Mt)} H${d(u.x+u.width)}`,color:$.line_color??{rgb:s.axisLine},width:s.gridWidth}),ot){const n=g?e*1.3:dt+e,m=Math.max(1,Math.ceil(n/Math.max(1,yt)));t.categories.forEach((f,r)=>{if(r%m!==0)return;const y=ct(r);i.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??s.gapWidth)/100,m=W?1:t.series.length,f=W?1:(t.overlap??0)/100,r=at/(Math.max(1,m-(m-1)*f)+n),y=r*(1-f),S=r+y*(m-1);t.categories.forEach((p,M)=>{const w=ct(M);let A=0,v=0;t.series.forEach((V,j)=>{const k=L(j,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?w-r/2:w-S/2+j*y)+(g&&xt&&!W?S-r-2*j*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:r}:{x:st,y:Math.min(J,K),width:r,height:Math.abs(K-J)};if(i.boxes.push({...Pt,color:F(j,M),series:j,category:M}),!b)return;const wt=ht(t,x[j]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,_t=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?N(_t(J,K),st+r/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):N(st+r/2,_t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),m=t.series.map((f,r)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const w=L(r,M);if(w===null)return;const A=W?n[M]??0:0,v=A+w;W&&(n[M]=v);const V=ct(M),j=k=>g?[q(k),V]:[V,q(k)];if(y.push(j(v)),S.push(j(A)),isLine(t.type)&&b){const k=labelPositionOf(t),[nt,tt]=j(v);N(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[r]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:r,points:y,base:S}});for(const{series:f,s:r,points:y,base:S}of m){const p=f.color??accentOf(r);if(isArea(t.type)&&y.length>0)i.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:r});else if(y.length>0&&(i.lines.push({d:f.smooth===!0?$t(y):lt(y),color:p,width:f.line_width??s.lineWidth,series:r}),hasMarkers(t.type)))for(const[M,w]of y)i.dots.push({x:M,y:w,r:(f.marker_size??s.marker)/2,color:p})}i.shapes.reverse()}return i}
|
|
2
|
+
import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub-next/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:jt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const wt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>wt[t%wt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&s.includes(l))return l;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Lt(s)?String(Number(t.toPrecision(10))):Ct(s,t)}const Ft=[1,2,5,10];export function chartScale(t,s,l,r,e={}){const h=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,o=e.minimum_scale??h,j=e.maximum_scale??a,b=j>o?j-o:1,F=Math.max(1,Math.floor(l/r)),w=b/F,P=10**Math.floor(Math.log10(w)),O=e.major_unit??(Ft.find(E=>E*P>=w)??10)*P,B=(E,C)=>Number((C(Number((E/O).toFixed(9)))*O).toPrecision(12)),Z=a>0?a+b*.05:a===h?b:a,g=e.maximum_scale??B(Z,Math.ceil),R=h<0?h-b*.05:h,W=e.minimum_scale??B(R,Math.floor),N=[],x=Math.round((g-W)/O);for(let E=0;E<=x;E++)N.push(Number((W+E*O).toPrecision(12)));return{min:W,max:g,major:O,ticks:N}}const it=(t,s)=>{let l=0;for(const r of t)l+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*s},d=t=>String(Number(t.toFixed(3)));function $t(t){const s=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,r],e)=>{if(e===0)return`M${d(l)} ${d(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${d(o+(l-h)/6)} ${d(j+(r-a)/6)}`,P=`${d(l-(b-o)/6)} ${d(r-(F-j)/6)}`;return`C${w} ${P} ${d(l)} ${d(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${d(s)} ${d(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${d(t+F*Math.sin(w))} ${d(s-F*Math.cos(w))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,j=o-e>Math.PI?1:0,b=`M${a(l,e)} A${d(l)} ${d(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${d(t)} ${d(s)} Z`:`${b} L${a(r,o)} A${d(r)} ${d(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function vt(t,s,l,r){const e=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function kt(t,s,l,r,e,h,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:l.y,text:r,size:h,anchor:"middle",color:a}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:s.y+s.height/2,text:e,size:h,anchor:"middle",color:a,rotate:-90})}const ht=(t,s,l,r,e)=>{const h=t.labels;if(!h)return"";const a=isRound(t.type),o=[];return h.show_series_name&&o.push(r.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(s,h.number_format??r.number_format)),h.show_percentage&&a&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,s,l,r,e){const h=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},j=vt(l,a.title,o.title,r),b=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=b.flat().map(c=>c[0]),w=b.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,O=c=>c.length>0?Math.max(...c):1,B=o.number_format??t.series[0]?.number_format??"General",Z=a.number_format??"General",g=r*.5,R=chartScale(P(w),O(w),l.bottom-l.top,r*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,B),r)))+g,N=a.visible===!1?0:r*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-N};s.plot=x,kt(s,x,j,a.title,o.title,r,e);const E=chartScale(P(F),O(F),x.width,r*5,a),C=chartScale(P(w),O(w),x.height,r*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(C.max,Math.max(C.min,c))-C.min)/(C.max-C.min)*x.height;for(const c of C.ticks){const $=D(c);(o.has_major_gridlines??!0)&&s.grid.push({d:`M${d(x.x)} ${d($)} H${d(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&s.words.push({x:x.x-g,y:$,text:formatValue(c,B),size:r,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);a.has_major_gridlines===!0&&s.grid.push({d:`M${d($)} ${d(x.y)} V${d(x.y+x.height)}`,color:a.gridline_color??{rgb:h.gridline},width:h.gridWidth}),a.visible!==!1&&s.words.push({x:$,y:x.y+x.height+g+r*.6,text:formatValue(c,Z),size:r,anchor:"middle",color:e})}s.axes.push({d:`M${d(x.x)} ${d(D(Math.max(C.min,Math.min(C.max,0))))} H${d(x.x+x.width)}`,color:a.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(b[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?$t(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)s.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,s,l){const r=CHART_DEFAULTS,e=t.font_size??r.fontSize,h=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:s-r.margin,bottom:l-r.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*r.titleScale;a.words.push({x:s/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const j=isRound(t.type),b=variesOf(t),F=(n,m)=>b?accentOf(m):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),m=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>m+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-m/2,width:m,height:m,color:b?accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+m+f,y:_,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+i/2:o.bottom-i/2;let _=(s-p)/2;n.forEach((A,v)=>{S(v,_,M),_+=(y[v]??0)+e}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=i:o.bottom-=i)}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,_=(o.top+o.bottom-i*n.length)/2+i/2;n.forEach((A,v)=>{S(v,M,_+v*i)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=p+e:o.right-=p+e)}}const w=t.labels,P=w?.size??e,O=w?.color??h,B=(n,m,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:m,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],m=(n?.values??[]).map(_=>Math.max(0,_??0)),f=m.reduce((_,A)=>_+A,0),i=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?i*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-i,y:S-i,width:i*2,height:i*2};let M=0;return m.forEach((_,A)=>{const v=f>0?_/f:0,V=M+v*Math.PI*2;if(v>0){a.shapes.push({d:Ot(y,S,i,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const L=(M+V)/2,k=p>0?(i+p)/2:labelPositionOf(t)==="inEnd"?i*.85:i*.6;n&&B(y+k*Math.sin(L),S-k*Math.cos(L),ht(t,_,v,n,t.categories[A]??""),"middle",w?.color??"lt1")}M=V}),a}if(isScatter(t.type))return Bt(t,a,o,e,h),a;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",N=R==="percentStacked",x=t.series.map(n=>t.categories.map((m,f)=>n.values[f]??null)),E=t.categories.map((n,m)=>x.reduce((f,i)=>f+Math.abs(i[m]??0),0)),C=(n,m)=>{const f=x[n]?.[m];if(f==null)return null;const i=E[m]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,m)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,m)??0;W?p>=0?f+=p:i+=p:(f=Math.max(f,p),i=Math.min(i,p))}),D=Math.max(D,f),z=Math.min(z,i)}),!W){const n=x.flat().filter(m=>m!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}N&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(N?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),Wt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),Et=Math.max(0,...Wt.map(n=>it(n,e))),ot=$.visible!==!1,dt=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,mt=g?c.title:$.title,ft=g?$.title:c.title,St=vt(o,mt,ft,e),u=g?{x:o.left+(ot?dt+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:Et+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x,a.plot=u,kt(a,u,St,mt,ft,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),ut=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+ut(n):u.y+u.height-ut(n),pt=isArea(t.type),gt=$.reverse_order===!0,xt=g?!gt:gt,at=(g?u.height:u.width)/Z,yt=pt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const m=pt?n*yt:(n+.5)*at,f=g?u.height:u.width,i=xt?f-m:m;return(g?u.y:u.x)+i},Mt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const m=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${d(m)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(m)} H${d(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:m,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:m,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${d(Mt)} ${d(u.y)} V${d(u.y+u.height)}`:`M${d(u.x)} ${d(Mt)} H${d(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:dt+e,m=Math.max(1,Math.ceil(n/Math.max(1,yt)));t.categories.forEach((f,i)=>{if(i%m!==0)return;const y=ct(i);a.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??r.gapWidth)/100,m=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,m-(m-1)*f)+n),y=i*(1-f),S=i+y*(m-1);t.categories.forEach((p,M)=>{const _=ct(M);let A=0,v=0;t.series.forEach((V,L)=>{const k=C(L,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?_-i/2:_-S/2+L*y)+(g&&xt&&!W?S-i-2*L*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:i}:{x:st,y:Math.min(J,K),width:i,height:Math.abs(K-J)};if(a.boxes.push({...Pt,color:F(L,M),series:L,category:M}),!w)return;const _t=ht(t,x[L]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,bt=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?B(bt(J,K),st+i/2,_t,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,bt(J,K),_t,"middle")})})}else{const n=t.categories.map(()=>0),m=t.series.map((f,i)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const _=C(i,M);if(_===null)return;const A=W?n[M]??0:0,v=A+_;W&&(n[M]=v);const V=ct(M),L=k=>g?[q(k),V]:[V,q(k)];if(y.push(L(v)),S.push(L(A)),isLine(t.type)&&w){const k=labelPositionOf(t),[nt,tt]=L(v);B(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[i]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:i,points:y,base:S}});for(const{series:f,s:i,points:y,base:S}of m){const p=f.color??accentOf(i);if(isArea(t.type)&&y.length>0)a.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:i});else if(y.length>0&&(a.lines.push({d:f.smooth===!0?$t(y):lt(y),color:p,width:f.line_width??r.lineWidth,series:i}),hasMarkers(t.type)))for(const[M,_]of y)a.dots.push({x:M,y:_,r:(f.marker_size??r.marker)/2,color:p})}a.shapes.reverse()}return a}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{deckFacts as ge}from"@allyhub-next/slides-core";import{createHash as te}from"node:crypto";import{join as se}from"node:path";import{uniformInt as oe}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as we}from"pure-rand/generator/xoroshiro128plus";import{CACHE_DIR as xe}from"@allyhub-next/formats";import{buildModule as be}from"@allyhub-next/model/build";import{ffmpegOf as ye,ffmpegRuns as $e,postPlaces as ke,postProblems as Se,readPng as ne}from"@allyhub-next/render";import{comboIdOf as U,comboKey as
|
|
3
|
-
`)}}function
|
|
4
|
-
`)[0]??""}`}}return await $e(
|
|
2
|
+
import{deckFacts as ge}from"@allyhub-next/slides-core";import{createHash as te}from"node:crypto";import{join as se}from"node:path";import{uniformInt as oe}from"pure-rand/distribution/uniformInt";import{xoroshiro128plus as we}from"pure-rand/generator/xoroshiro128plus";import{CACHE_DIR as xe}from"@allyhub-next/formats";import{buildModule as be}from"@allyhub-next/model/build";import{ffmpegOf as ye,ffmpegRuns as $e,postPlaces as ke,postProblems as Se,readPng as ne}from"@allyhub-next/render";import{comboIdOf as U,comboKey as z,comboMatches as Me,countLevels as ve,coverCombos as Fe,cutThroughout as ie,pieceNamed as re,problem as j,CONSOLE_LIMIT as Le}from"@allyhub-next/video-core";import{OutputCache as Ce,cacheKey as De,checkerId as Pe}from"./cache.js";import{consoleOf as Ae,baseDigest as Ee,outputDigest as ae,dedupe as ce,StuckError as me,CheckSession as _e,runtimeDigest as Ie,extraCombos as Ke,measureDeck as Te}from"@allyhub-next/project";import{matrixFacts as Oe,measuredFacts as je,screenFidelity as Re,flatFrames as He,cutSeams as Be,flashFrames as ze,stillPicture as Ne}from"@allyhub-next/measure";import{generatedFact as Ue,generatedPagedFact as Ge,mismatchFacts as Ye}from"./generated.js";import{StretchLoudness as fe,estimatePlan as qe,loadedPlan as Je,planProblems as Qe}from"./plans.js";import{sceneryLayerFacts as Ve,withBakes as We}from"./scenery.js";export function checkStats(t,s,o,e=0){const i=s.length;return{loaded:s,reused:o,outputs:{total:t,checked:i,reused:Math.max(0,t-i-e),covered:e}}}const Xe=new Set(["text-time","words-on-screen","speech-on-screen","text-covered","flat-frames","still-picture"]);export const plural=(t,s)=>`${String(t)} ${s}${t===1?"":"s"}`;const de=t=>we(te("sha256").update(t).digest().readInt32BE(0));export function samplesFor(t,s,o,e){const i=new Set(t.slice(0,e)),a=de(o),c=Math.floor(s*30);for(let f=0;i.size<Math.min(e,c)&&f<e*20;f++)i.add(oe(a,0,c-1)/30);return[...i]}export function shuffled(t,s){const o=[...t],e=de(s);for(let i=o.length-1;i>0;i--){const a=oe(e,0,i),c=o[i],f=o[a];c===void 0||f===void 0||(o[i]=f,o[a]=c)}return o}export const RASTER_NOISE=3,RASTER_SPECKS=8;export function frameDifference(t,s){const o=ne(t),e=ne(s);if(o.width!==e.width||o.height!==e.height)return{max:255,pixels:Math.max(o.width*o.height,1)};let i=0,a=0;for(let c=0;c<o.data.length;c+=4){let f=0;for(let d=0;d<4;d++)f=Math.max(f,Math.abs((o.data[c+d]??0)-(e.data[c+d]??0)));f>RASTER_NOISE&&a++,f>i&&(i=f)}return{max:i,pixels:a}}export const CUT_RECHECK={most:48,every:2};export async function recheckCuts(t,s,o,e){const i=ie(s);if(i.length===0)return s;const a=CUT_RECHECK.every/o,c=new Set;for(const d of i){const r=e.find(w=>w.key===d.part);if(!r)continue;const l=s.moments.filter(w=>w.part===d.part).map(w=>w.t).sort((w,L)=>w-L),h=d.moments[0]??d.t,g=d.moments.at(-1)??d.t,F=Math.max(r.start,l.filter(w=>w<h).at(-1)??r.start),K=Math.min(r.end-1/o,l.find(w=>w>g)??r.end),A=Math.min(CUT_RECHECK.most,Math.floor((K-F)/a)+1),R=A>1?(K-F)/(A-1):0;for(let w=0;w<A;w++){const L=Math.round((F+R*w)*o)/o;l.includes(L)||c.add(L)}}if(c.size===0)return s;const f=await t.measure([...c].sort((d,r)=>d-r));return{...s,moments:[...s.moments,...f.moments].sort((d,r)=>d.t-r.t)}}export function offFrameProblems(t,s){const o=e=>`${e.toFixed(2)} s`;return ie(t).map(e=>{const i=e.moments[0]??0,a=e.moments.at(-1)??i,c=e.moments.length===1?`at ${o(i)}, the one moment measured that shows it`:`at all ${String(e.moments.length)} moments measured that show it (${i.toFixed(2)}–${o(a)})`,f=e.worst.edges.map(h=>`${String(h.px)} pixels past the ${h.side} edge`).join(" and "),d=`"${e.text.text.length>40?`${e.text.text.slice(0,40)}…`:e.text.text}"`,r={piece:s.piece,output:s.output,combo:s.combo,format:s.format,part:e.part},l=t.deck;if(l){const h=g=>Math.round(g/l.pxPerPt*10)/10;return j("AK-L002",`Text goes off the slide: the slide's edge cuts ${d} of ${e.text.layer} on slide ${e.part} at every build that shows it; its letters reach ${e.worst.edges.map(g=>`${String(h(g.px))} pt past the ${g.side} edge`).join(" and ")} (${String(Math.round(e.worst.share*100))}% of them outside). Move or size its shape inside the slide, or give it less text. allyhub inspect --kind text-off-slide has it.`,{...r,level:"error"})}return j("AK-L002",`Text goes off the frame: the frame cuts ${d} ${c}; its letters reach ${f} at ${s.format} (${String(Math.round(e.worst.share*100))}% of them outside). Move it inside the frame or make it smaller (fitText in a component); text that is part of a picture the frame crops on purpose (a mocked interface) goes inside an element with data-ak-picture. allyhub inspect --kind text-off-frame has each moment.`,{...r,t:e.t,where:{bbox:e.worst.glyphs}})})}const le=t=>te("sha256").update(t).digest("hex");export async function determinism(t,s,o){const e=t.timeline,i=samplesFor(e.parts.map(r=>r.still),e.duration,s,o),a=new Map;for(const r of[...i].sort((l,h)=>l-h))a.set(r,await t.shot(r));const c=[];let f=0;for(const r of shuffled(i,`${s}:shuffle`)){const l=a.get(r),h=await t.shot(r);if(!l||le(h)===le(l))continue;const g=frameDifference(l,h);g.pixels>RASTER_SPECKS&&(c.push(r),f=Math.max(f,g.max))}if(c.length===0)return[];c.sort((r,l)=>r-l);const d=[...new Set(c.flatMap(r=>e.parts.filter(l=>r>=l.start&&r<l.end).map(l=>l.key)))];return[j("AK-D002",`${plural(c.length,"moment")} drew differently in order and out of order (${c.map(r=>`${r.toFixed(2)}s`).join(", ")}; pixels differ by up to ${String(f)} levels). render must depend only on t, not on state left by an earlier frame.`,{piece:t.target.piece,output:t.target.output,combo:t.target.combo,format:t.target.format,t:c[0]??0,...d.length===1&&d[0]?{part:d[0]}:{}})]}export function summarize(t){const s=ve(t);return{status:s.errors>0?"failed":s.warnings>0?"warnings":"passed",...s}}function Ze(t,s){const o=a=>[a.piece??"",a.output??"",a.combo?z(a.combo):"",a.format??"",a.part??"",a.where?.file??"",String(a.where?.line??0).padStart(6,"0"),a.code].join("\0"),e=o(t),i=o(s);return e<i?-1:e>i?1:0}class et{spent=new Map;on=process.env.ALLYHUB_CHECK_TIMINGS==="1";async time(s,o){if(!this.on)return o();const e=performance.now();try{return await o()}finally{this.spent.set(s,(this.spent.get(s)??0)+(performance.now()-e)/1e3)}}report(){if(!this.on)return;const s=[...this.spent].sort((o,e)=>e[1]-o[1]);process.stderr.write(`Check timings (s): ${s.map(([o,e])=>`${o} ${e.toFixed(2)}`).join(", ")}
|
|
3
|
+
`)}}function tt(t){const s=t.options,o=s.post,e=typeof o=="object"&&o!==null?o.filter:void 0;return{transparent:s.transparent===!0,deliverable:s.deliverable!==!1,...typeof s.maxDuration=="number"?{maxDuration:s.maxDuration}:{},...typeof e=="string"?{post:e}:{}}}async function st(t){let s;try{s=await ye(t===void 0?{}:{ffmpeg:t})}catch(o){return{missing:`the pinned ffmpeg could not be had: ${(o instanceof Error?o.message:String(o)).split(`
|
|
4
|
+
`)[0]??""}`}}return await $e(s)?{ffmpeg:s}:{missing:`${s} does not run`}}export async function runCheck(t){const s=new et,o=t.session??await s.time("prepare (discover, metadata, bundle)",()=>_e.open({root:t.dir,...t.buildDir===void 0?{}:{buildDir:t.buildDir},...t.gpu===void 0?{}:{gpu:t.gpu},...t.consoleLimit===void 0?{}:{consoleLimit:t.consoleLimit}}));try{const e=o.prepared,i=t.samples??12,a=o.consoleLimit,c=await Ie(),f=await Ce.open(e.root,await Pe({runtimeSha:c,samples:i,gpu:o.gpu,...a===Le?{}:{consoleLimit:a}}));let d;const r=()=>d??=st(t.ffmpeg),l=[],h=[...e.problems],g=[],F=[],K=[],A=[];let R=0,w=0;const L=[];let C;const ue=e.pieces.filter(n=>t.piece===void 0||re({id:n.id,path:n.place},t.piece));for(const n of ue){if(!e.bundle?.chunks.entries[n.id.replaceAll("/","__")])continue;const M=tt(n),E=n.kind,T=n.format,Y=await Ee(e,n,c);g.push(...Oe(n));const q=new Set,H=[...n.combos.filter(p=>!t.combos?.length||t.combos.some(u=>Me(p,u,U(n.matrix,p)))),...Ke(n,t.combos)],pe=new Set(n.matrix?Fe(n.matrix.space,n.dims,H):H.keys()),_=[],J=p=>{K.push(p);for(const u of p.reads?.media??[])q.add(u.path);p.timeline&&_.push({...p,timeline:p.timeline})};let N=!1;const he=(p,u,I)=>{if(t.fresh===!0)return;const m=f.get(p),y=m?.result.reads,D=m?.result.timeline;return!m||!y||!D||I&&!m.sampled||m.factless===!0&&t.facts!==!1?void 0:ae(e,Y,n,u,y)===m.digest?m:void 0};for(const[p,u]of H.entries()){const I=U(n.matrix,u),m={piece:n.id,output:E,combo:u,format:T},y=z(u);if(F.push({...m,...I?{id:I}:{},key:y}),!pe.has(p)){w++;continue}const D=n.kind==="video"&&!N,P=De(n.id,E,y,T),b=he(P,u,D);if(b){R++,b.sampled&&(N=!0),h.push(...b.problems),g.push(...b.facts),l.push({version:m,log:b.console}),J({...b.result,digest:b.digest}),f.set(P,b);continue}A.push(`${n.id}/${E}/${y}/${T}`);const x=await s.time("load (mount, stills)",()=>o.open(n,m));try{const $=x.summary,O=[],v=[...$?.facts??[]];let Q=!1;try{if($){const k=$.timeline;try{const S=await s.time("layout measure",()=>n.kind==="slides"?Te(o,n,x,{fresh:t.fresh===!0}):x.measure());if(O.push(...offFrameProblems(S.deck?S:await s.time("recheck cut text",()=>recheckCuts(x,S,k.fps,k.parts)),m)),S.deck)v.push(...ge(S.deck,{width:S.width,height:S.height},{piece:m.piece,output:m.output,combo:m.combo,format:m.format}));else{const ee=await r();v.push(...await s.time("layout facts",()=>je(S,k,m,{root:e.root,media:e.media,ffmpeg:"ffmpeg"in ee?ee.ffmpeg:"ffmpeg"},k.profile?.label)))}}catch(S){if(S instanceof me)throw S}t.facts!==!1&&v.push(...await s.time("scenery facts",()=>Ve(x)))}$&&D&&(N=!0,Q=!0,O.push(...await s.time("determinism",()=>determinism(x,`${n.id}:${E}:${T}`,i))),t.facts!==!1&&!M.transparent&&v.push(...await s.time("flat frames",()=>He(x))),t.facts!==!1&&v.push(...await s.time("still picture",()=>Ne(x))),t.facts!==!1&&(v.push(...await s.time("cut seams",()=>Be(x))),M.transparent||v.push(...await s.time("flash",()=>ze(x))))),$&&t.facts!==!1&&v.push(...(await s.time("scenery screen fidelity",()=>Re(x))).facts)}catch(k){if(!(k instanceof me))throw k;k.kept||O.push(j("AK-P003",k.message,{piece:m.piece,output:m.output,combo:m.combo,format:m.format}))}O.push(...await x.problems());const V=ce(O);h.push(...V);const W=M.deliverable?v:v.filter(k=>!Xe.has(k.kind));g.push(...W);const X=await x.console();l.push({version:m,log:X});const B=$?ae(e,Y,n,u,$.reads):void 0,Z={...m,...$?{timeline:$.timeline,reads:$.reads,text:$.text}:{}};J({...Z,...B?{digest:B}:{}}),B&&f.set(P,{digest:B,result:Z,problems:V,facts:W,sampled:Q,...t.facts===!1?{factless:!0}:{},console:X})}finally{await x.close()}}if(n.kind==="video"){const p=ke(M.post,_.map(u=>u.timeline));if(p.length>0){const u=await r();"ffmpeg"in u&&h.push(...await s.time("post chains",()=>Se(p,{piece:n.id,output:E},u.ffmpeg)))}}if(n.kind!=="video")for(const p of _){const u=Ge(p,e.media);u&&g.push(u)}else for(const p of H){const u=U(n.matrix,p),I=z(p),m=_.find(b=>z(b.combo)===I),y=m?Je(m,u):qe(n,p,u,E,T,_);if(!y)continue;if(L.push(y),n.matrix&&C===void 0){const b=await r();if("ffmpeg"in b){const x=new fe(e.root,b.ffmpeg);await x.open(),C=x}else C={missing:"ffmpeg",why:`${b.missing} (set ALLYHUB_FFMPEG to an ffmpeg, or let the runtime manager fetch its pinned one)`}}const D=await s.time("plans (loudness, music)",()=>Qe(y,{...M.maxDuration===void 0?{}:{maxDuration:M.maxDuration},fps:m?.timeline.fps??_[0]?.timeline.fps??30,media:e.media,local:b=>o.mediaPath(b),...n.matrix&&C?{loudness:C}:{}}));h.push(...D.problems),g.push(...D.facts);const P=Ue(y,e.media);P&&g.push(P)}g.push(...Ye({piece:n.id},q,e.media))}for(const n of e.items)if(n.kind==="model"&&!(t.piece!==void 0&&!re({id:n.dir,path:n.dir},t.piece)))try{await s.time("models",()=>be(se(e.root,n.entry),{root:e.root,cache:se(e.root,xe,"model"),log:()=>{}}))}catch(M){h.push(j("AK-B010",`${n.entry} does not build: ${M instanceof Error?M.message:String(M)}`,{piece:n.dir,where:{file:n.entry}}))}C instanceof fe&&await C.save(),await f.save(new Set(e.pieces.map(n=>n.id)));const G=ce(h).sort(Ze);return s.report(),{targets:F,check:summarize(G),problems:G,facts:await We(g,e.root),results:K,plans:L,stats:checkStats(F.length,A,R,w),console:Ae(a,l)}}finally{t.session||await o.close()}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{mkdir as p,readFile as w,writeFile as b}from"node:fs/promises";import{dirname as y}from"node:path";import{BLOBS_MAX as d,BlobsResponseSchema as S}from"@allyhub-next/protocol";import{CloudError as k}from"./errors.js";const g=4,v=30*6e4;export class BlobStore{cloud;path;file;known;constructor(i,s){this.cloud=i,this.path=s.path,this.file=s.file}async load(){if(this.known)return this.known;if(this.file===void 0)return this.known=new Set;try{this.known=new Set(JSON.parse(await w(this.file,"utf8")))}catch{this.known=new Set}return this.known}async save(){this.file!==void 0&&(await p(y(this.file),{recursive:!0}),await b(this.file,JSON.stringify([...this.known??[]])))}async forget(i){const s=await this.load();for(const n of i)s.delete(n);await this.save()}async put(i){let s=0;const n=await this.load(),o=new Map;for(const e of i)n.has(e.sha256)||o.set(e.sha256,e);const l=[...o.values()];for(let e=0;e<l.length;e+=d){const c=l.slice(e,e+d),{uploads:a}=S.parse(await this.cloud.json(this.path,{method:"POST",body:{blobs:c.map(t=>({sha256:t.sha256,size:t.size,contentType:t.type}))}}));let f=0;const u=async()=>{for(;f<a.length;){const t=a[f++],r=t&&o.get(t.sha256);if(!t||!r)continue;const m=r.bytes??await w(r.file??""),h=await this.cloud.config.fetch(t.url,{method:"PUT",headers:t.headers,body:new Uint8Array(m),signal:AbortSignal.timeout(v)});if(!h.ok)throw new k("blob-refused",`Storage refused a blob: ${String(h.status)} ${(await h.text()).slice(0,200)}`);s+=1}};await Promise.all(Array.from({length:Math.min(g,a.length)},u));for(const t of c)n.add(t.sha256);await this.save()}return s}}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{mkdir as
|
|
3
|
-
`)
|
|
2
|
+
import{mkdir as $,readdir as W,readFile as A,rm as B,writeFile as j}from"node:fs/promises";import{basename as T,dirname as k,extname as C,join as m}from"node:path";import{EXIT as w,FileContentResponseSchema as z,ToolCallSchema as J,callPath as G,fileContentPath as U,parseAllyFilePath as Z,toolCallsPath as K}from"@allyhub-next/protocol";import{genFileFor as _}from"@allyhub-next/formats";import{CloudError as d}from"./errors.js";import{genRecord as P,inputHash as X,namedFile as Y,readGen as q,toolWords as Q,writeGen as R,writeWords as V}from"./records.js";import{withKnownUploads as tt}from"./uploads.js";export const WAIT_SECONDS=900,POLL_SECONDS={least:1,most:60},RETRY_SECONDS={least:1,most:30},READ_SECONDS=120;const et=new Set([408,429,500,502,503,504]),at=t=>t instanceof d&&(t.code==="network"||t.status!==void 0&&et.has(t.status));function nt(t){return Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).filter(e=>typeof e=="string").join("-").replace(/^https?:\/\//u,"").replace(/[^\p{L}\p{N}._]+/gu,"-").replace(/^-+|-+$/gu,"").slice(0,40).replace(/-+$/u,"")}async function it(t,e,i,a,o){await $(t,{recursive:!0});const r=a.replace(/[^A-Za-z0-9_-]/gu,"_").slice(0,8),s=[e,nt(i),r].filter(Boolean).join("-"),c=m(t,`${s}.output.json`);return await j(c,`${JSON.stringify(o,null,2)}
|
|
3
|
+
`),c}async function ot(t,e){const i=C(t)===""?`${t}.json`:t;return await $(k(i),{recursive:!0}),await j(i,`${JSON.stringify(e,null,2)}
|
|
4
|
+
`),i}const N=t=>m(t.config.cacheDir,"jobs"),D=(t,e)=>m(N(t),`${e.replace(/[^A-Za-z0-9_-]/gu,"_")}.json`);async function rt(t,e,i){await $(k(D(t,e)),{recursive:!0}),await j(D(t,e),`${JSON.stringify(i,null,2)}
|
|
5
|
+
`)}const O=(t,e)=>B(D(t,e),{force:!0});async function st(t,e,i){const a=await W(N(t)).catch(()=>[]);for(const o of a.filter(r=>r.endsWith(".json")).sort()){const r=await A(m(N(t),o),"utf8").then(s=>JSON.parse(s)).catch(()=>{});if(r?.jobId!==void 0&&r.file===e&&r.inputHash===i)return r.jobId}}async function lt(t,e){try{return JSON.parse(await A(D(t,e),"utf8"))}catch{throw new d("unknown-job",`No job ${e} was started on this computer.`,{exit:w.notFound,hint:"Call the tool again: that is a new call."})}}async function ut(t,e,i,a,o){const{url:r}=z.parse(await t.json(U(e,"attachment"),{signal:v(o)}));let s;try{const l=await t.config.fetch(r,o?{signal:o}:{});if(!l.ok)throw new d("download-failed",`Downloading ${i} answered ${String(l.status)}.`,{exit:w.platform,status:l.status});s=Buffer.from(await l.arrayBuffer())}catch(l){throw l instanceof d||o?.aborted===!0?l:new d("network",`Downloading ${i} failed: ${l instanceof Error?l.message:String(l)}`,{exit:w.platform,cause:l})}const c="dir"in a?m(a.dir,T(i)):C(a.file)?a.file:`${a.file}${C(i)}`;return await $(k(c),{recursive:!0}),await j(c,s),c}const v=t=>t?AbortSignal.any([t,AbortSignal.timeout(READ_SECONDS*1e3)]):AbortSignal.timeout(READ_SECONDS*1e3),H=(t,e)=>new Promise((i,a)=>{const o=setTimeout(i,t*1e3);e?.addEventListener("abort",()=>{clearTimeout(o),a(e.reason instanceof Error?e.reason:new Error("Stopped."))},{once:!0})});export async function callTool(t,e,i,a){const o=a.file,r=await tt(t,i,a.base),s=X(e,r);let c=a.jobId,l=!1;if(o!==void 0&&c===void 0){c=await st(t,o,s);const f=c===void 0?await Y(o):void 0,u=f?await q(f):void 0;if(a.force===!0)l=u!==void 0;else{if(f&&!u)throw new d("file-exists",`${f} is there, without a record (${T(_(f))}) saying a tool call made it.`,{exit:w.conflict,hint:"Choose another --file, or pass --force to replace it."});if(f&&u){if(u.tool===e&&u.inputHash===s)return{tool:e,output:typeof u.output?.allyFilePath=="string"?u.output:JSON.parse(await A(f,"utf8")),file:f,gen:_(f),kept:{at:u.at}};throw new d("file-exists",`${f} was made by ${u.tool??"another tool"} from another input on ${u.at}.`,{exit:w.conflict,hint:"Choose another --file to keep it, or pass --force to make it again over it (charged again)."})}}}const y=Date.now()+(a.timeoutSeconds??WAIT_SECONDS)*1e3,b=a.signal;let n=c===void 0?J.parse(await t.json(K(e),{method:"POST",body:{input:i},...b?{signal:b}:{}})):await I(t,c,y,a);n.status==="working"&&c===void 0&&await rt(t,n.id,{jobId:n.id,tool:e,input:{...i},inputHash:s,outDir:a.outDir,...o===void 0?{}:{file:o}});const L=()=>({tool:e,jobId:n.id,status:"running",elapsedSeconds:(Date.now()-Date.parse(n.createdAt))/1e3,...o===void 0?{}:{file:o}});for(;n.status==="working";){if(a.wait===!1||Date.now()>y)return L();a.onRunning?.(n),await H(Math.min(Math.max((n.pollAfterMs??0)/1e3,POLL_SECONDS.least),POLL_SECONDS.most),b),n=await I(t,n.id,y,a)}if(n.status==="failed")throw await O(t,n.id),new d(`tool-${(n.error?.kind??"failed").replaceAll("_","-")}`,n.error?.message??"The tool failed.",{exit:n.error?.kind==="input"?w.usage:w.platform,hint:n.error?.kind==="input"||n.error?.kind==="not_found"?"A failed call is not charged. Change the input and call again.":"A failed call is not charged. Call it again; a supplier's failure often passes."});if(n.status!=="completed")throw new d("tool-state",`The call ${n.id} is ${n.status}, a state this version of allyhub does not know.`,{exit:w.platform,hint:"Update allyhub in the project (npm install allyhub@latest) and call it again."});const h=typeof n.output=="object"&&n.output!==null?n.output:{value:n.output},E=h.allyFilePath,S=typeof E=="string"?Z(E):void 0,g=!S&&o!==void 0?await ot(o,h):void 0,p={tool:e,output:h,outputFile:g??await it(a.outputDir??a.outDir,e,i,n.id,h),...n.credits===void 0?{}:{credits:n.credits}};if(S){const f=n.id,u=await M(f,()=>ut(t,S.id,S.name,o!==void 0?{file:o}:{dir:a.outDir},b),y,a);p.file=u,p.gen=await R(u,await P(u,{tool:e,input:r,output:h,credits:n.credits}));const F=Q(h),x=h.durationSeconds;F&&(p.words=await V(u,F,typeof x=="number"&&x>=0?x:void 0)),l&&(p.replaced=!0)}else g!==void 0&&(p.file=g,p.gen=await R(g,await P(g,{tool:e,input:r,output:h,credits:n.credits})),l&&(p.replaced=!0));return await O(t,n.id),p}async function I(t,e,i,a){try{return await M(e,async()=>J.parse(await t.json(G(e),{signal:v(a.signal)})),i,a)}catch(o){throw o instanceof d&&o.status===404&&await O(t,e),o}}async function M(t,e,i,a){const o=a.retrySeconds??RETRY_SECONDS;for(let r=o.least;;)try{return await e()}catch(s){if(!at(s)||a.signal?.aborted===!0)throw s;if(Date.now()+r*1e3>i)throw new d(s.code,s.message,{exit:s.exit,...s.status===void 0?{}:{status:s.status},hint:`Call ${t} goes on at AllyHub, charged once when it works: --resume ${t} waits for it again (so does the same call to the same --file).`,cause:s});a.onRetry?.(t,s,r),await H(r,a.signal),r=Math.min(r*2,o.most)}}export async function resumeJob(t,e,i){const a=await lt(t,e);if(i.tool!==void 0&&i.tool!==a.tool)throw new d("wrong-job",`Job ${e} is ${a.tool}'s, not ${i.tool}'s.`,{exit:w.usage,hint:`Resume it with ${a.tool}.`});return await callTool(t,a.tool,a.input,{...i,outDir:a.outDir,...a.file===void 0?{}:{file:a.file},jobId:e})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as l}from"node:crypto";import{EXIT as
|
|
2
|
+
import{createHash as l}from"node:crypto";import{EXIT as r,ORGANIZATION_HEADER as y}from"@allyhub-next/protocol";import{accessOf as g,SignedOut as p}from"./credentials.js";import{CloudError as s,notSignedIn as f,unreachable as h}from"./errors.js";export function scrub(c,e){let t=c.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),e&&(t=t.split(e).join("<key>")),t}export class Cloud{config;constructor(e){this.config=e}get url(){return this.config.url}async key(){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:l("sha256").update(e).digest("hex")};try{const t=await g(this.config);if(!t)return;const o=t.credentials.account.organization?.id;return{key:t.token,source:"oauth",account:t.credentials.account.id,expiresAt:t.expiresAt,...o===void 0?{}:{organization:o}}}catch(t){if(t instanceof p)return;throw h(this.url,t)}}async requireKey(){const e=await this.key();if(!e)throw f();return e}keyedFetch=async(e,t)=>{const o=n=>{const a=new Headers(t?.headers);return a.set("authorization",`Bearer ${n.key}`),n.organization!==void 0&&a.set(y,n.organization),this.config.fetch(e,{...t,headers:a})},i=await this.requireKey();return o(i)};async json(e,t={}){const o=t.auth!==!1,i=o?(await this.requireKey()).key:void 0;let n;try{n=await(o?this.keyedFetch:this.config.fetch)(`${this.url}${e}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(u){throw u instanceof s?u:h(this.url,u)}const a=await n.text(),d=n.ok?void 0:m(a,n.status,i);if(d&&n.status!==401)throw d;if(n.status===403)throw new s("forbidden","This AllyHub account does not have access to this operation.",{exit:r.auth,status:403});if(n.status===401)throw f(o?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!n.ok)throw new s("api-error",`${this.url}${e} answered ${String(n.status)}: ${scrub(a.slice(0,300),i)}`,{exit:n.status>=500?r.platform:r.usage,status:n.status});try{return JSON.parse(a)}catch{throw new s("api-error",`${this.url}${e} did not answer JSON.`,{exit:r.platform,status:n.status})}}}const w={bad_input:r.usage,insufficient_credits:r.auth,limit_reached:r.auth,forbidden:r.auth,not_found:r.notFound,conflict:r.conflict,worked_elsewhere:r.conflict};function m(c,e,t){let o;try{o=JSON.parse(c)}catch{return}const i=o?.error;if(typeof i?.code!="string"||typeof i.message!="string")return;const n=typeof i.hint=="string"?i.hint:i.code==="insufficient_credits"?"Add credits to the AllyHub account.":void 0;return new s(i.code.replaceAll("_","-"),scrub(i.message,t),{exit:w[i.code]??r.platform,status:e,...n===void 0?{}:{hint:n},...typeof i.data=="object"&&i.data!==null?{data:i.data}:{}})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{EXIT as r}from"@allyhub-next/protocol";export class CloudError extends Error{code;hint;exit;status;constructor(t,s,e={}){super(s,e.cause===void 0?void 0:{cause:e.cause}),this.name="CloudError",this.code=t,this.hint=e.hint,this.exit=e.exit??r.failed,this.status=e.status}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(n,t)=>new CloudError("not-signed-in",n??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(n,t)=>new CloudError("network",`Cannot reach ${n}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
|
|
2
|
+
import{EXIT as r}from"@allyhub-next/protocol";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,s,e={}){super(s,e.cause===void 0?void 0:{cause:e.cause}),this.name="CloudError",this.code=t,this.hint=e.hint,this.exit=e.exit??r.failed,this.status=e.status,this.data=e.data}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(n,t)=>new CloudError("not-signed-in",n??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(n,t)=>new CloudError("network",`Cannot reach ${n}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{createHash as l}from"node:crypto";import{createReadStream as u}from"node:fs";import{mkdir as y,readdir as w,readFile as k,stat as z,writeFile as O}from"node:fs/promises";import{dirname as F,join as x,relative as M,sep as p}from"node:path";const v=n=>new Promise((s,t)=>{const e=l("sha256");u(n).on("data",i=>e.update(i)).on("error",t).on("end",()=>{s(e.digest("hex"))})});export const sha256Of=n=>l("sha256").update(n).digest("hex");export class Hashes{file;stamps;dirty=!1;constructor(s){this.file=s}async load(){if(this.stamps)return this.stamps;try{const s=JSON.parse(await k(this.file,"utf8"));this.stamps=new Map(Object.entries(s))}catch{this.stamps=new Map}return this.stamps}async of(s){const t=await z(s).catch(()=>{});if(!t?.isFile())return;const e=await this.load(),i=e.get(s);if(i?.size===t.size&&i.mtimeMs===t.mtimeMs)return{sha256:i.sha256,size:t.size};const a=await v(s);return e.set(s,{size:t.size,mtimeMs:t.mtimeMs,sha256:a}),this.dirty=!0,{sha256:a,size:t.size}}async keepOnly(s,t){const e=await this.load(),i=s.endsWith(p)?s:s+p;for(const a of e.keys())a.startsWith(i)&&!t.has(a)&&(e.delete(a),this.dirty=!0)}async save(){!this.dirty||!this.stamps||(this.dirty=!1,await y(F(this.file),{recursive:!0}),await O(this.file,JSON.stringify(Object.fromEntries(this.stamps))))}}export async function hashFolder(n,s,t){const e=r=>t.skip.some(o=>r===o||r.endsWith(`/${o}`)),i=[],a=new Set,m=async r=>{const o=await w(r,{withFileTypes:!0}).catch(()=>[]);for(const f of o){const c=x(r,f.name),h=M(n,c).split(p).join("/");if(f.isSymbolicLink())t.onLink?.(h);else if(f.isDirectory())!e(h)&&t.enter?.(h)!==!1&&await m(c);else if(f.isFile()){if(t.only&&!t.only(h))continue;const d=await s.of(c);if(!d)continue;a.add(c),i.push({path:h,file:c,...d})}}};return await m(n),t.prune!==!1&&await s.keepOnly(n,a),i.sort((r,o)=>r.path<o.path?-1:r.path>o.path?1:0)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations}from"./token.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
|
|
2
|
+
export{cloudConfig,hostsText}from"./config.js";export{CloudError,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,scrub}from"./client.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations}from"./token.js";export{BlobStore}from"./blobs.js";export{Hashes,hashFolder,sha256Of}from"./hashes.js";export{addDeployment,changeSite,createSite,goLive,listSites,removeSite,siteDetail,unpublishSite}from"./sites.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub-next/protocol";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as
|
|
2
|
+
import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g,genFileFor as k}from"@allyhub-next/formats";import{EXIT as F}from"@allyhub-next/protocol";import{callTool as b}from"./call.js";import{CloudError as h}from"./errors.js";import{toolWords as D,writeWords as W}from"./records.js";export function sayInput(o){return{...o.params??{},text:o.text,...o.voice===void 0?{}:{voiceId:o.voice}}}export async function makeSay(o,e,n,f){const u=await s(r(v(),"allyhub-voice-"));try{const t=await b(o,n.tool,sayInput(n),{...f,outDir:u,outputDir:r(e,g,"voice"),wait:!0});if("jobId"in t||t.file===void 0)throw new h("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const d=D(t.output)??[],a=t.output.durationSeconds,m=typeof a=="number"?a:d.at(-1)?.end??0,i=`${n.stem}${I(t.file).toLowerCase()||".mp3"}`;await p(x(r(e,i)),{recursive:!0}),await c(t.file,r(e,i)),t.gen&&await c(t.gen,r(e,k(i)));const l=await W(r(e,i),d,m>=0?m:void 0);return{file:i,words:l.slice(e.length+1),seconds:m,credits:t.credits??0}}finally{await w(u,{recursive:!0,force:!0})}}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"path": "src/caption-subtitle.ts",
|
|
16
16
|
"target": "{dir}/caption-subtitle.ts",
|
|
17
|
-
"sha256": "
|
|
17
|
+
"sha256": "307620d5b2fc6751dd109ef1c64d650981c7cfce9af7682d7cf2d8ce18a382a0"
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"categories": []
|
|
@@ -8,14 +8,33 @@ export interface CaptionSubtitleProps {
|
|
|
8
8
|
* freeAreas (@allyhub/sdk/dom) to keep it clear of a face or text.
|
|
9
9
|
*/
|
|
10
10
|
y?: number;
|
|
11
|
+
/** Most characters in a cue; default 40 in portrait, 60 otherwise. */
|
|
12
|
+
maxChars?: number;
|
|
13
|
+
/** Most words in a cue; default no limit. */
|
|
14
|
+
maxWords?: number;
|
|
15
|
+
/** Phrases a cue never breaks inside (["work harder"]), as said. */
|
|
16
|
+
keep?: readonly string[];
|
|
17
|
+
/** Seconds: a gap between two cues under this closes; default 0.4. */
|
|
18
|
+
close?: number;
|
|
19
|
+
/** The font size at 1080p, px; default 50 in portrait, 46 square, 42 wide. */
|
|
20
|
+
size?: number;
|
|
21
|
+
/** The smallest font size fitting may reach at 1080p, px; default 28. */
|
|
22
|
+
minSize?: number;
|
|
23
|
+
/** The line's width at 1080p, px; default 860 in portrait, 1320 otherwise. */
|
|
24
|
+
width?: number;
|
|
25
|
+
/** Seconds a cue fades in after a pause; default 0.18. */
|
|
26
|
+
fadeIn?: number;
|
|
27
|
+
/** Seconds a cue fades out before a pause; default 0.12. */
|
|
28
|
+
fadeOut?: number;
|
|
11
29
|
}
|
|
12
30
|
|
|
13
31
|
/** Sentences cut into readable lines. */
|
|
14
|
-
const optsFor = (portrait: boolean) => ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
const optsFor = (p: CaptionSubtitleProps, portrait: boolean) => ({
|
|
33
|
+
maxChars: p.maxChars ?? (portrait ? 40 : 60),
|
|
34
|
+
...(p.maxWords === undefined ? {} : { maxWords: p.maxWords }),
|
|
35
|
+
...(p.keep === undefined ? {} : { keep: p.keep }),
|
|
36
|
+
...(p.close === undefined ? {} : { close: p.close }),
|
|
37
|
+
});
|
|
19
38
|
|
|
20
39
|
export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
|
|
21
40
|
name: "captionSubtitle",
|
|
@@ -29,10 +48,14 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
|
|
|
29
48
|
const L = layout(ctx);
|
|
30
49
|
const { light, dark } = lightDark(el);
|
|
31
50
|
const portrait = L.orient === "portrait";
|
|
32
|
-
const size =
|
|
51
|
+
const size =
|
|
52
|
+
(p.size ?? (portrait ? 50 : L.orient === "square" ? 46 : 42)) * L.k;
|
|
33
53
|
// A comfortable measure, not the full width.
|
|
34
|
-
const width = Math.min(
|
|
35
|
-
|
|
54
|
+
const width = Math.min(
|
|
55
|
+
L.right - L.left,
|
|
56
|
+
(p.width ?? (portrait ? 860 : 1320)) * L.k,
|
|
57
|
+
);
|
|
58
|
+
for (const cue of ctx.captions(optsFor(p, portrait))) {
|
|
36
59
|
const line = tag(
|
|
37
60
|
h(
|
|
38
61
|
"div",
|
|
@@ -54,7 +77,7 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
|
|
|
54
77
|
);
|
|
55
78
|
el.append(line);
|
|
56
79
|
const fs = fitTo(line, {
|
|
57
|
-
min: 28 * L.k,
|
|
80
|
+
min: (p.minSize ?? 28) * L.k,
|
|
58
81
|
max: size,
|
|
59
82
|
maxHeight: size * 1.3 * 2 + 1,
|
|
60
83
|
});
|
|
@@ -64,15 +87,30 @@ export const captionSubtitle = defineComponent<CaptionSubtitleProps>({
|
|
|
64
87
|
line.style.display = "none";
|
|
65
88
|
}
|
|
66
89
|
},
|
|
67
|
-
render(el, t,
|
|
68
|
-
const cues = ctx.captions(optsFor(ctx.dims.orient === "portrait"));
|
|
90
|
+
render(el, t, p, ctx) {
|
|
91
|
+
const cues = ctx.captions(optsFor(p, ctx.dims.orient === "portrait"));
|
|
69
92
|
all(el, "cue").forEach((line, i) => {
|
|
70
93
|
const cue = cues[i];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
line
|
|
94
|
+
if (!cue || t < cue.start || t >= cue.end) {
|
|
95
|
+
line.style.display = "none";
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// One line replaces the next at once: two never show over each other.
|
|
99
|
+
// Only a pause has a fade.
|
|
100
|
+
const before = cues[i - 1];
|
|
101
|
+
const after = cues[i + 1];
|
|
102
|
+
const fadeIn =
|
|
103
|
+
before && before.end >= cue.start
|
|
104
|
+
? 1
|
|
105
|
+
: ease.out(progress(t, cue.start, p.fadeIn ?? 0.18));
|
|
106
|
+
const fadeOut =
|
|
107
|
+
after && after.start <= cue.end
|
|
108
|
+
? 0
|
|
109
|
+
: ease.inOut(
|
|
110
|
+
progress(t, cue.end - (p.fadeOut ?? 0.12), p.fadeOut ?? 0.12),
|
|
111
|
+
);
|
|
112
|
+
line.style.display = "block";
|
|
113
|
+
line.style.opacity = (fadeIn * (1 - fadeOut)).toFixed(4);
|
|
76
114
|
});
|
|
77
115
|
},
|
|
78
116
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{runCheck as
|
|
2
|
+
import{runCheck as l}from"@allyhub-next/check";import{indexNeeds as d,makeIndex as c}from"@allyhub-next/project";import{loose as o}from"./paths.js";export const SETTLE_MS=1500;export class Checker{state;reads=new Map;timer;active;again=!1;closed=!1;live;emit;needs;settle;constructor(e){this.live=e.live,this.emit=e.emit,this.needs=e.needs,this.settle=e.settle??SETTLE_MS,this.state={status:"waiting",revision:0,problems:[],facts:[]}}schedule(e=!1){this.closed||(clearTimeout(this.timer),this.state.status!=="running"&&this.publish({...this.state,status:"waiting"}),this.timer=setTimeout(()=>{if(!this.closed){if(this.active){this.again=!0;return}this.active=this.run().finally(()=>{this.active=void 0})}},e?0:this.settle))}async run(){const e=this.live.revision;this.publish({...this.state,status:"running",revision:e});let s;try{const t=await this.live.withSession(i=>l({dir:this.live.root,session:i}));s={status:"done",revision:e,problems:t.problems.map(o),facts:t.facts.map(o),versions:{total:t.targets.length,loaded:t.stats.loaded.length,reused:t.stats.reused}},this.needs?.(d(t.results));const a=new Map;for(const i of t.results){const r=a.get(i.piece)??{media:new Set,data:new Set};a.set(i.piece,r);for(const n of i.reads?.media??[])r.media.add(n.path);for(const n of i.reads?.data??[])r.data.add(n.path)}this.reads=new Map([...a].map(([i,{media:r,data:n}])=>[i,{media:[...r],data:[...n]}]))}catch(t){s={status:"failed",revision:e,problems:[],facts:[],error:t instanceof Error?t.message:String(t)}}this.closed||(e===this.live.revision&&!this.again?this.publish(s):(this.again=!1,this.schedule(!0)))}publish(e){this.state=e,this.emit(e)}async close(){this.closed=!0,clearTimeout(this.timer),await this.active}}export class Indexer{jobs=[];root;emit;made;wanted=[];tried=new Set;running;abort=new AbortController;constructor(e){this.root=e.root,this.emit=e.emit,this.made=e.made}want(e){const s=e.filter(t=>!this.tried.has(`${t.file}:${String(t.faces)}:${String(t.matte)}`));if(s.length!==0){for(const t of s)this.tried.add(`${t.file}:${String(t.faces)}:${String(t.matte)}`);this.wanted.push(...s),this.running??=this.loop().finally(()=>{this.running=void 0})}}async loop(){for(;this.wanted.length>0&&!this.abort.signal.aborted;){const e=this.wanted.splice(0),{done:s}=await c(this.root,e,t=>{this.jobs=[...this.jobs.filter(a=>a.file!==t.file),{file:t.file,status:t.status,message:t.message,...t.share===void 0?{}:{share:t.share}}],this.emit(this.jobs)},this.abort.signal);s.length>0&&this.made()}}async close(){this.abort.abort(),await this.running}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{readFile as m}from"node:fs/promises";import w from"postcss";const p=t=>t.trim().replace(/^(['"])(.*)\1$/su,"$2");export async function fontFaces(t){const n=await m(t.file,"utf8").catch(()=>{});if(n===void 0)return[];let r;try{r=w.parse(n)}catch{return[]}const o=[];return r.walkAtRules(/^font-face$/iu,h=>{const e=new Map;h.walkDecls(g=>{e.set(g.prop.toLowerCase(),g.value)});const s=e.get("font-family"),c=e.get("src"),u=c===void 0?void 0:/url\(\s*([^)]*?)\s*\)/u.exec(c);if(s===void 0||u?.[1]===void 0)return;let f;try{f=new URL(p(u[1]),t.url).href}catch{return}const i=e.get("font-weight"),d=e.get("font-style"),a=e.get("font-stretch"),l=e.get("unicode-range");o.push({family:p(s),url:f,...i===void 0?{}:{weight:i},...d===void 0?{}:{style:d},...a===void 0?{}:{stretch:a},...l===void 0?{}:{unicodeRange:l}})}),o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{
|
|
2
|
+
export{RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{CARD_DEFAULTS,itemPreview,projectName}from"./card.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readFile as
|
|
2
|
+
import{readFile as v,rm as w}from"node:fs/promises";import{join as c}from"node:path";import{fileLoudness as y}from"@allyhub-next/audio/node";import{startBrowser as g}from"@allyhub-next/browser";import{allyhubPlugin as S,hasSheetCode as D,listFiles as k,loadUserVite as O,mediaHref as C,prepare as E,readMedia as R,readSheetSource as $,sourceOf as j}from"@allyhub-next/build";import{CACHE_DIR as P,entryKind as F}from"@allyhub-next/formats";import{CheckSession as H,ProjectError as N,pickTarget as _,parseCombo as M}from"@allyhub-next/project";import{RPC_ERROR as u,RpcError as f,SNAPSHOT_TREE as m,SOUND_FOLDER as T}from"@allyhub-next/protocol";import{SCENERY_STAGE as U,bundleScenery as W,sceneryHref as l,writeModelStage as A}from"@allyhub-next/scenery-host/bundle";import{bakesOnDisk as L,sceneryHost as b,serveDecoders as x}from"@allyhub-next/stage";export function rpcErrorOf(d){return d instanceof N?new f(d.kind==="not-found"?u.notFound:u.invalid,d.hint?`${d.message} ${d.hint}`:d.message):d}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;sceneries=new Map;building=Promise.resolve();closed=!1;sheetCodes=new Map;constructor(e,i={}){this.root=e,this.buildDir=c(e,P,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await E(this.root,{buildDir:this.pieceDir,host:b(this.root)});return e.bundle&&await x(e.bundle.dir),this.last=e,e}async sheetCode(e){if(!D(this.root,e))return{failed:!1};const i=this.sheetCodes.get(e),t=i?.revision===this.revision?i.promise:$(this.root,e).catch(()=>{});this.sheetCodes.set(e,{revision:this.revision,promise:t});const s=await t;return{failed:s?.failed??!0,...s?.generated?{generated:s.generated}:{}}}get pieceDir(){return c(this.buildDir,"stage")}get sceneryDir(){return c(this.buildDir,"scenery",U)}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:r}=_(t,e,i===void 0?void 0:[M(i)]);return{prepared:t,piece:s,combo:r.combo}}catch(s){throw rpcErrorOf(s)}}async source(e){const i=await this.prepared(),t=i.pieces.find(n=>n.id===e);if(!t)throw new f(u.notFound,`No piece ${e}.`);const s=j(i,t),r={...s.media},h=(n,a)=>`${n}${C(a).slice(m.media.length)}`;return await Promise.all(Object.entries(r).map(async([n,a])=>{let o=a;if(a.kind==="video"&&a.matte===!0&&(o={...o,matteUrl:h(m.matte,n)}),a.kind==="audio"||a.kind==="video"&&a.audio===!0){o={...o,denoisedUrl:h(T,n)};const p=await y(c(this.root,n)).catch(()=>{});p!==void 0&&(o={...o,loudness:p.lufs,...p.by==="level"?{loudnessBy:"level"}:{}})}r[n]=o})),{...s,media:r}}browser(){return this.browserStarted??=g(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s=c(this.buildDir,`session-${String(this.revision)}`),r={revision:this.revision,session:H.open({root:this.root,browser:t,buildDir:s}),users:0,retired:!1,dir:s};i=r,this.lease=r,r.session.catch(()=>{this.lease===r&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new f(u.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{}),await w(e.dir,{recursive:!0,force:!0})})(),e.ended}scenery(e){const i=this.sceneries.get(e);if(i?.revision===this.revision)return i.promise;const t=this.bundleScenery(e);return this.sceneries.set(e,{revision:this.revision,promise:t}),t.catch(()=>{this.sceneries.get(e)?.promise===t&&this.sceneries.delete(e)}),t}async scenerySource(e){const i=await this.scenery(e),t=s=>`${m.scenery}${s}`;return{module:t(i.module),decoders:t(i.decoders),manifoldWasm:t(i.manifoldWasm),bakes:[...await L(this.root)]}}async bundleScenery(e){const i=await k(this.root),t=await R(this.root,i),s=await B(this.root),r=b(this.root),h=await O(this.root),n=c(this.buildDir,"scenery"),a=F(e)==="model"?await A({root:this.root,model:e,outDir:n}):e,o=await W({root:this.root,file:a,outDir:n,dependencies:s,plugins:[S({root:this.root,media:t,dependencies:s,lent:r.lent})],...h?{user:h}:{}});return{module:l(o.module),decoders:l(o.decoders),manifoldWasm:l(o.manifoldWasm),output:o.output.map(l),media:Object.keys(t)}}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await w(this.buildDir,{recursive:!0,force:!0})}}async function B(d){try{const e=JSON.parse(await v(c(d,"package.json"),"utf8")),i=new Set;for(const t of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const s=e[t];if(s&&typeof s=="object")for(const r of Object.keys(s))i.add(r)}return i}catch{return new Set}}
|