@allyhub/sdk 0.8.0 → 0.9.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/CHANGELOG.md +11 -0
- package/NOTICE +46 -49
- package/dist/dom.d.ts +1 -209
- package/dist/dom.js +1 -1
- package/dist/image.d.ts +2 -0
- package/dist/image.js +2 -0
- package/dist/index.d.ts +1 -21
- package/dist/index.js +1 -1
- package/dist/media.d.ts +1 -5
- package/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
- package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
- package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +20 -82
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +96 -8
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
- package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +46 -42
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
- package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
- package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
- package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
- package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
- package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
- package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
- package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
- package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
- package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/measure/package.json +13 -0
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
- package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
- package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
- package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
- package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +421 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
- package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +285 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
- package/dist/node_modules/@allyhub/piece/package.json +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +139 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
- package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +232 -132
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +22 -9
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +5 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +273 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +26 -0
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
- package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
- package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
- package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
- package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
- package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
- package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
- package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -4
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +76 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +6 -6
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +44 -4
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
- package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +208 -0
- package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
- package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +19 -2
- package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +17 -10
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
- package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
- package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
- package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
- package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
- package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
- package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
- package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
- package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
- package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +22 -430
- package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +6 -12
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
- package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
- package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
- package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
- package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
- package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
- package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
- package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
- package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
- package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
- package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
- package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
- package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
- package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
- package/dist/scenery.d.ts +1 -1
- package/dist/scenery.js +1 -1
- package/dist/sheets.d.ts +1 -1
- package/dist/sheets.js +1 -1
- package/dist/slides.d.ts +1 -9
- package/dist/slides.js +1 -1
- package/docs/README.md +8 -6
- package/docs/batches.md +5 -5
- package/docs/contract.md +2 -2
- package/docs/defaults.md +278 -20
- package/docs/docs.md +77 -63
- package/docs/footage.md +7 -7
- package/docs/image.md +165 -0
- package/docs/layers.md +22 -13
- package/docs/modeling.md +4 -4
- package/docs/pictures.md +65 -0
- package/docs/project.md +51 -31
- package/docs/scenery.md +11 -11
- package/docs/sheets.md +26 -25
- package/docs/slides.md +73 -65
- package/docs/sound.md +3 -3
- package/docs/speech.md +8 -8
- package/docs/video.md +16 -13
- package/docs/websites.md +4 -4
- package/package.json +7 -2
- package/dist/define.js +0 -2
- package/dist/free.js +0 -2
- package/dist/input.js +0 -2
- package/dist/module.js +0 -2
- package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
- package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
- package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
- package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
- package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
- package/dist/parts.js +0 -2
- package/dist/piece.js +0 -2
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
- /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
- /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
- /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
- /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
- /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
- /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
- /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
- /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
- /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
- /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
- /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
- /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
- /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
- /package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +0 -0
- /package/dist/{phone.js → node_modules/@allyhub/video-sdk/dist/phone.js} +0 -0
|
@@ -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 Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub/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},m=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${m(l)} ${m(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${m(o+(l-h)/6)} ${m(j+(r-a)/6)}`,P=`${m(l-(b-o)/6)} ${m(r-(F-j)/6)}`;return`C${w} ${P} ${m(l)} ${m(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${m(s)} ${m(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${m(t+F*Math.sin(w))} ${m(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${m(l)} ${m(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${m(t)} ${m(s)} Z`:`${b} L${a(r,o)} A${m(r)} ${m(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${m(x.x)} ${m($)} H${m(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${m($)} ${m(x.y)} V${m(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${m(x.x)} ${m(D(Math.max(C.min,Math.min(C.max,0))))} H${m(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,d)=>b?t.category_colors?.[d]??accentOf(d):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),d=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>d+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-d/2,width:d,height:d,color:b?t.category_colors?.[p]??accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+d+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,d,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:d,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],d=(n?.values??[]).map(_=>Math.max(0,_??0)),f=d.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 d.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((d,f)=>n.values[f]??null)),E=t.categories.map((n,d)=>x.reduce((f,i)=>f+Math.abs(i[d]??0),0)),C=(n,d)=>{const f=x[n]?.[d];if(f==null)return null;const i=E[d]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,d)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,d)??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(d=>d!==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 d=pt?n*yt:(n+.5)*at,f=g?u.height:u.width,i=xt?f-d:d;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 d=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${m(d)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(d)} H${m(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:d,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:d,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${m(Mt)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(Mt)} H${m(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:dt+e,d=Math.max(1,Math.ceil(n/Math.max(1,yt)));t.categories.forEach((f,i)=>{if(i%d!==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,d=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,d-(d-1)*f)+n),y=i*(1-f),S=i+y*(d-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),d=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 d){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}
|
|
2
|
+
import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub/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 vt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>vt[t%vt.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},m=t=>String(Number(t.toFixed(3)));function kt(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${m(l)} ${m(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${m(o+(l-h)/6)} ${m(j+(r-a)/6)}`,P=`${m(l-(b-o)/6)} ${m(r-(F-j)/6)}`;return`C${w} ${P} ${m(l)} ${m(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${m(s)} ${m(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${m(t+F*Math.sin(w))} ${m(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${m(l)} ${m(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${m(t)} ${m(s)} Z`:`${b} L${a(r,o)} A${m(r)} ${m(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function Wt(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 Et(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=Wt(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,Et(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${m(x.x)} ${m($)} H${m(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${m($)} ${m(x.y)} V${m(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${m(x.x)} ${m(D(Math.max(C.min,Math.min(C.max,0))))} H${m(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?kt(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,d)=>b?t.category_colors?.[d]??accentOf(d):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),d=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>d+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-d/2,width:d,height:d,color:b?t.category_colors?.[p]??accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+d+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,d,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:d,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],d=(n?.values??[]).map(_=>Math.max(0,_??0)),f=d.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 d.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((d,f)=>n.values[f]??null)),E=t.categories.map((n,d)=>x.reduce((f,i)=>f+Math.abs(i[d]??0),0)),C=(n,d)=>{const f=x[n]?.[d];if(f==null)return null;const i=E[d]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,d)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,d)??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(d=>d!==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}:{}}),dt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),mt=Math.max(0,...dt.map(n=>it(n,e))),ot=$.visible!==!1,ft=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,ut=g?c.title:$.title,pt=g?$.title:c.title,St=Wt(o,ut,pt,e),u=g?{x:o.left+(ot?ft+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:mt+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x-(g&&dt.length>0?mt/2:0),a.plot=u,Et(a,u,St,ut,pt,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),gt=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+gt(n):u.y+u.height-gt(n),xt=isArea(t.type),yt=$.reverse_order===!0,Mt=g?!yt:yt,at=(g?u.height:u.width)/Z,_t=xt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const d=xt?n*_t:(n+.5)*at,f=g?u.height:u.width,i=Mt?f-d:d;return(g?u.y:u.x)+i},bt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const d=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${m(d)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(d)} H${m(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:d,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:d,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${m(bt)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(bt)} H${m(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:ft+e,d=Math.max(1,Math.ceil(n/Math.max(1,_t)));t.categories.forEach((f,i)=>{if(i%d!==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,d=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,d-(d-1)*f)+n),y=i*(1-f),S=i+y*(d-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&&Mt&&!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 wt=ht(t,x[L]?.[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?B($t(J,K),st+i/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,$t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),d=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 d){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?kt(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}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
AllyHub Software License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AllyHub, Inc. ("AllyHub"). All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software (the AllyHub command-line tool, its SDK, runtime and the
|
|
6
|
+
packages they depend on) is proprietary. It is not open source.
|
|
7
|
+
|
|
8
|
+
1. Permitted use. You may install and run the software, unmodified, to make,
|
|
9
|
+
check, preview and render videos and decks, including for commercial
|
|
10
|
+
purposes. What you make with it is yours.
|
|
11
|
+
|
|
12
|
+
2. Restrictions. Except as this license permits or applicable law requires,
|
|
13
|
+
you may not copy, modify, adapt, translate, sublicense, sell, rent, lease,
|
|
14
|
+
publish or otherwise distribute the software, create derivative works of
|
|
15
|
+
it, or reverse engineer, decompile or disassemble it.
|
|
16
|
+
|
|
17
|
+
3. Cloud services. AllyHub's cloud tools (sign-in, research, images, voice,
|
|
18
|
+
video) are separate services governed by AllyHub's terms of service.
|
|
19
|
+
|
|
20
|
+
4. Trademarks. This license grants no right to use the name "AllyHub" or its
|
|
21
|
+
logos.
|
|
22
|
+
|
|
23
|
+
5. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
24
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
|
26
|
+
ALLYHUB BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
|
|
28
|
+
|
|
29
|
+
6. Third-party code. Parts of the software are adapted from HyperFrames,
|
|
30
|
+
licensed under the Apache License, Version 2.0 (see NOTICE). Those parts
|
|
31
|
+
remain under that license, reproduced below, and nothing in this license
|
|
32
|
+
limits your rights under it.
|
|
33
|
+
|
|
34
|
+
7. Starter components. The starter components in the "components" folder,
|
|
35
|
+
which "allyhub add" copies into your workspace, are licensed under the MIT
|
|
36
|
+
License (see components/LICENSE): once copied, you may change, use and
|
|
37
|
+
share them freely.
|
|
38
|
+
|
|
39
|
+
--------------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
Apache License
|
|
42
|
+
Version 2.0, January 2004
|
|
43
|
+
http://www.apache.org/licenses/
|
|
44
|
+
|
|
45
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
46
|
+
|
|
47
|
+
1. Definitions.
|
|
48
|
+
|
|
49
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
50
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
51
|
+
|
|
52
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
53
|
+
the copyright owner that is granting the License.
|
|
54
|
+
|
|
55
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
56
|
+
other entities that control, are controlled by, or are under common
|
|
57
|
+
control with that entity. For the purposes of this definition,
|
|
58
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
59
|
+
direction or management of such entity, whether by contract or
|
|
60
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
61
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
62
|
+
|
|
63
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
64
|
+
exercising permissions granted by this License.
|
|
65
|
+
|
|
66
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
67
|
+
including but not limited to software source code, documentation
|
|
68
|
+
source, and configuration files.
|
|
69
|
+
|
|
70
|
+
"Object" form shall mean any form resulting from mechanical
|
|
71
|
+
transformation or translation of a Source form, including but
|
|
72
|
+
not limited to compiled object code, generated documentation,
|
|
73
|
+
and conversions to other media types.
|
|
74
|
+
|
|
75
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
76
|
+
Object form, made available under the License, as indicated by a
|
|
77
|
+
copyright notice that is included in or attached to the work
|
|
78
|
+
(an example is provided in the Appendix below).
|
|
79
|
+
|
|
80
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
81
|
+
form, that is based on (or derived from) the Work and for which the
|
|
82
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
83
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
84
|
+
of this License, Derivative Works shall not include works that remain
|
|
85
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
86
|
+
the Work and Derivative Works thereof.
|
|
87
|
+
|
|
88
|
+
"Contribution" shall mean any work of authorship, including
|
|
89
|
+
the original version of the Work and any modifications or additions
|
|
90
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
91
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
92
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
93
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
94
|
+
means any form of electronic, verbal, or written communication sent
|
|
95
|
+
to the Licensor or its representatives, including but not limited to
|
|
96
|
+
communication on electronic mailing lists, source code control systems,
|
|
97
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
98
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
99
|
+
excluding communication that is conspicuously marked or otherwise
|
|
100
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
101
|
+
|
|
102
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
103
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
104
|
+
subsequently incorporated within the Work.
|
|
105
|
+
|
|
106
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
107
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
108
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
109
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
110
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
111
|
+
Work and such Derivative Works in Source or Object form.
|
|
112
|
+
|
|
113
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
114
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
115
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
116
|
+
(except as stated in this section) patent license to make, have made,
|
|
117
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
118
|
+
where such license applies only to those patent claims licensable
|
|
119
|
+
by such Contributor that are necessarily infringed by their
|
|
120
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
121
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
122
|
+
institute patent litigation against any entity (including a
|
|
123
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
124
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
125
|
+
or contributory patent infringement, then any patent licenses
|
|
126
|
+
granted to You under this License for that Work shall terminate
|
|
127
|
+
as of the date such litigation is filed.
|
|
128
|
+
|
|
129
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
130
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
131
|
+
modifications, and in Source or Object form, provided that You
|
|
132
|
+
meet the following conditions:
|
|
133
|
+
|
|
134
|
+
(a) You must give any other recipients of the Work or
|
|
135
|
+
Derivative Works a copy of this License; and
|
|
136
|
+
|
|
137
|
+
(b) You must cause any modified files to carry prominent notices
|
|
138
|
+
stating that You changed the files; and
|
|
139
|
+
|
|
140
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
141
|
+
that You distribute, all copyright, patent, trademark, and
|
|
142
|
+
attribution notices from the Source form of the Work,
|
|
143
|
+
excluding those notices that do not pertain to any part of
|
|
144
|
+
the Derivative Works; and
|
|
145
|
+
|
|
146
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
147
|
+
distribution, then any Derivative Works that You distribute must
|
|
148
|
+
include a readable copy of the attribution notices contained
|
|
149
|
+
within such NOTICE file, excluding those notices that do not
|
|
150
|
+
pertain to any part of the Derivative Works, in at least one
|
|
151
|
+
of the following places: within a NOTICE text file distributed
|
|
152
|
+
as part of the Derivative Works; within the Source form or
|
|
153
|
+
documentation, if provided along with the Derivative Works; or,
|
|
154
|
+
within a display generated by the Derivative Works, if and
|
|
155
|
+
wherever such third-party notices normally appear. The contents
|
|
156
|
+
of the NOTICE file are for informational purposes only and
|
|
157
|
+
do not modify the License. You may add Your own attribution
|
|
158
|
+
notices within Derivative Works that You distribute, alongside
|
|
159
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
160
|
+
that such additional attribution notices cannot be construed
|
|
161
|
+
as modifying the License.
|
|
162
|
+
|
|
163
|
+
You may add Your own copyright statement to Your modifications and
|
|
164
|
+
may provide additional or different license terms and conditions
|
|
165
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
166
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
167
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
168
|
+
the conditions stated in this License.
|
|
169
|
+
|
|
170
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
171
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
172
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
173
|
+
this License, without any additional terms or conditions.
|
|
174
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
175
|
+
the terms of any separate license agreement you may have executed
|
|
176
|
+
with Licensor regarding such Contributions.
|
|
177
|
+
|
|
178
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
179
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
180
|
+
except as required for reasonable and customary use in describing the
|
|
181
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
182
|
+
|
|
183
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
184
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
185
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
186
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
187
|
+
implied, including, without limitation, any warranties or conditions
|
|
188
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
189
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
190
|
+
appropriateness of using or redistributing the Work and assume any
|
|
191
|
+
risks associated with Your exercise of permissions under this License.
|
|
192
|
+
|
|
193
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
194
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
195
|
+
unless required by applicable law (such as deliberate and grossly
|
|
196
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
197
|
+
liable to You for damages, including any direct, indirect, special,
|
|
198
|
+
incidental, or consequential damages of any character arising as a
|
|
199
|
+
result of this License or out of the use or inability to use the
|
|
200
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
201
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
202
|
+
other commercial damages or losses), even if such Contributor
|
|
203
|
+
has been advised of the possibility of such damages.
|
|
204
|
+
|
|
205
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
206
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
207
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
208
|
+
or other liability obligations and/or rights consistent with this
|
|
209
|
+
License. However, in accepting such obligations, You may act only
|
|
210
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
211
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
212
|
+
defend, and hold each Contributor harmless for any liability
|
|
213
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
214
|
+
of your accepting any such warranty or additional liability.
|
|
215
|
+
|
|
216
|
+
END OF TERMS AND CONDITIONS
|
|
217
|
+
|
|
218
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
219
|
+
|
|
220
|
+
To apply the Apache License to your work, attach the following
|
|
221
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
222
|
+
replaced with your own identifying information. (Don't include
|
|
223
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
224
|
+
comment syntax for the file format. We also recommend that a
|
|
225
|
+
file or class name and description of purpose be included on the
|
|
226
|
+
same "printed page" as the copyright notice for easier
|
|
227
|
+
identification within third-party archives.
|
|
228
|
+
|
|
229
|
+
Copyright [yyyy] [name of copyright owner]
|
|
230
|
+
|
|
231
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
232
|
+
you may not use this file except in compliance with the License.
|
|
233
|
+
You may obtain a copy of the License at
|
|
234
|
+
|
|
235
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
236
|
+
|
|
237
|
+
Unless required by applicable law or agreed to in writing, software
|
|
238
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
239
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
240
|
+
See the License for the specific language governing permissions and
|
|
241
|
+
limitations under the License.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Where a fact was measured. Piece-level facts (the matrix) have no output, combo or format. */
|
|
2
|
+
export interface FactPlace {
|
|
3
|
+
piece: string;
|
|
4
|
+
output?: string;
|
|
5
|
+
combo?: Record<string, string>;
|
|
6
|
+
format?: string;
|
|
7
|
+
part?: string;
|
|
8
|
+
/** Film seconds. */
|
|
9
|
+
t?: number;
|
|
10
|
+
}
|
|
11
|
+
/** A fact, of a map of kinds to their data (an extension's); of any kind when none is given. */
|
|
12
|
+
export type Fact<M extends object = Record<string, unknown>> = {
|
|
13
|
+
[K in keyof M & string]: FactPlace & {
|
|
14
|
+
kind: K;
|
|
15
|
+
data: M[K];
|
|
16
|
+
};
|
|
17
|
+
}[keyof M & string];
|
|
18
|
+
/** A fact of one map's: made with what it measured, typed by its kind. */
|
|
19
|
+
export declare function factOf<M extends object, K extends keyof M & string>(kind: K, place: FactPlace, data: M[K]): Fact<M>;
|
|
20
|
+
/** The facts of one kind, typed as the list is (`Fact<DeckFactData>[]`). */
|
|
21
|
+
export declare function factsOf<F extends {
|
|
22
|
+
kind: string;
|
|
23
|
+
}, K extends F["kind"]>(facts: readonly F[], kind: K): Extract<F, {
|
|
24
|
+
kind: K;
|
|
25
|
+
}>[];
|
|
26
|
+
/** How many facts of each kind, in the order the kinds first come. */
|
|
27
|
+
export declare function countFacts(facts: readonly Fact[]): Record<string, number>;
|
|
28
|
+
/** Which facts to keep: of these kinds, of this part, between these seconds. */
|
|
29
|
+
export interface FactFilter {
|
|
30
|
+
kinds?: readonly string[] | undefined;
|
|
31
|
+
part?: string | undefined;
|
|
32
|
+
from?: number | undefined;
|
|
33
|
+
to?: number | undefined;
|
|
34
|
+
}
|
|
35
|
+
/** The facts a filter keeps; a fact without a time goes when a time is asked. */
|
|
36
|
+
export declare function filterFacts<F extends Fact>(facts: readonly F[], o: FactFilter): F[];
|
|
37
|
+
//# sourceMappingURL=fact.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export function factOf(e,n,t){return{kind:e,...n,data:t}}export function factsOf(e,n){return e.filter(t=>t.kind===n)}export function countFacts(e){const n={};for(const t of e)n[t.kind]=(n[t.kind]??0)+1;return n}export function filterFacts(e,n){return e.filter(t=>!(n.kinds?.length&&!n.kinds.includes(t.kind)||n.part!==void 0&&t.part!==n.part||(n.from!==void 0||n.to!==void 0)&&(t.t===void 0||n.from!==void 0&&t.t<n.from-1e-6||n.to!==void 0&&t.t>n.to+1e-6)))}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "error": must fix — the render breaks or a safety rule is broken;
|
|
3
|
+
* nothing is rendered until it is fixed. "warn": a suggestion — never
|
|
4
|
+
* blocks.
|
|
5
|
+
*/
|
|
6
|
+
export type ProblemLevel = "error" | "warn";
|
|
7
|
+
export type Box = [x: number, y: number, w: number, h: number];
|
|
8
|
+
export interface Problem {
|
|
9
|
+
/** Its rule's code, e.g. "AK-L002". */
|
|
10
|
+
code: string;
|
|
11
|
+
level: ProblemLevel;
|
|
12
|
+
/** What is wrong and how to fix it. */
|
|
13
|
+
message: string;
|
|
14
|
+
/** Where it was found: absent for project-level problems. */
|
|
15
|
+
piece?: string;
|
|
16
|
+
output?: string;
|
|
17
|
+
combo?: Record<string, string>;
|
|
18
|
+
format?: string;
|
|
19
|
+
/** Where inside the output. */
|
|
20
|
+
part?: string;
|
|
21
|
+
t?: number;
|
|
22
|
+
page?: number;
|
|
23
|
+
where?: {
|
|
24
|
+
file?: string;
|
|
25
|
+
line?: number;
|
|
26
|
+
selector?: string;
|
|
27
|
+
bbox?: Box;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** A code no rule this process knows has: a mistake in the code that reports it, or in its extension's manifest. */
|
|
31
|
+
export declare class UnknownRuleError extends Error {
|
|
32
|
+
readonly code: string;
|
|
33
|
+
constructor(code: string);
|
|
34
|
+
}
|
|
35
|
+
/** A problem under a rule this process knows, at the rule's own level unless one is given. */
|
|
36
|
+
export declare function problem(code: string, message: string, extra?: Omit<Problem, "code" | "level" | "message"> & {
|
|
37
|
+
level?: ProblemLevel;
|
|
38
|
+
}): Problem;
|
|
39
|
+
export declare function countLevels(problems: readonly Problem[]): {
|
|
40
|
+
errors: number;
|
|
41
|
+
warnings: number;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=problem.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{ruleOf as l}from"./rules.js";export class UnknownRuleError extends Error{code;constructor(e){super(`${e} is not a rule's code: no rule the core or a loaded extension declares has it (an extension declares its own in contributes.rules).`),this.name="UnknownRuleError",this.code=e}}export function problem(r,e,n={}){const o=l(r);if(o===void 0)throw new UnknownRuleError(r);const{level:t,...s}=n;return{code:r,level:t??o.level,message:e,...s}}export function countLevels(r){let e=0,n=0;for(const o of r)o.level==="error"?e++:n++;return{errors:e,warnings:n}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ProblemLevel } from "./problem.js";
|
|
2
|
+
/** A rule: its code, the level its problems take unless one is given, and what it says, for help. */
|
|
3
|
+
export interface Rule {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly level: ProblemLevel;
|
|
6
|
+
readonly rule: string;
|
|
7
|
+
}
|
|
8
|
+
/** A rule as this process knows it, with what declares it: an extension's id, or CORE. */
|
|
9
|
+
export interface DeclaredRule extends Rule {
|
|
10
|
+
readonly extension: string;
|
|
11
|
+
}
|
|
12
|
+
/** What declares the core's own rules. */
|
|
13
|
+
export declare const CORE = "allyhub";
|
|
14
|
+
/** The rules the core reports under. */
|
|
15
|
+
export declare const CORE_RULES: readonly Rule[];
|
|
16
|
+
/**
|
|
17
|
+
* Declares an extension's rules in this process. A code another extension
|
|
18
|
+
* (or the core) declares already is refused, each said in what this
|
|
19
|
+
* returns; the same extension declaring its code again replaces it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function declareRules(extension: string, rules: readonly Rule[]): string[];
|
|
22
|
+
/** Declares rules another process knew (`declaredRules`), each by its extension. */
|
|
23
|
+
export declare function declareAll(rules: readonly DeclaredRule[]): string[];
|
|
24
|
+
/** The rule a code is, when this process knows it. */
|
|
25
|
+
export declare const ruleOf: (code: string) => DeclaredRule | undefined;
|
|
26
|
+
/** Whether a code is a rule's this process knows. */
|
|
27
|
+
export declare const isRule: (code: string) => boolean;
|
|
28
|
+
/** Every rule this process knows: the core's, then the extensions' as they were declared. */
|
|
29
|
+
export declare const declaredRules: () => DeclaredRule[];
|
|
30
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const CORE="allyhub",CORE_RULES=[{code:"AK-M001",level:"error",rule:"The fields of video(), presentation() or defineComponent do not match the format"},{code:"AK-M002",level:"error",rule:"The project's list (allyhub.yaml) cannot be read, or names a kind not loaded or a file not there"},{code:"AK-M003",level:"error",rule:"The project's list names two pieces by one id"},{code:"AK-M004",level:"error",rule:"The project has no pieces"},{code:"AK-M006",level:"error",rule:"A messages file does not match the format"},{code:"AK-M007",level:"error",rule:"A script file does not match the format"},{code:"AK-M011",level:"error",rule:"A deck names no slides file or script, or its slides file is not there, does not match the format, or names a layout, a prop, a file or a video item the deck does not have"},{code:"AK-M012",level:"error",rule:"A sheet's code reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},{code:"AK-M016",level:"error",rule:"An item uses another item's made file that is not there: no such item in the work list, no type both kinds take, or an item using itself"},{code:"AK-B001",level:"error",rule:"Two pieces have the same id"},{code:"AK-B003",level:"error",rule:"The build made a network request"},{code:"AK-B004",level:"error",rule:"The build timed out, or its result is over the size limit"},{code:"AK-B005",level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},{code:"AK-B006",level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},{code:"AK-B008",level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},{code:"AK-B009",level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},{code:"AK-D002",level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},{code:"AK-N003",level:"error",rule:"The sandbox blocked a request at run time"},{code:"AK-A001",level:"error",rule:"A referenced media or data file does not exist"},{code:"AK-P003",level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},{code:"AK-R001",level:"error",rule:"An unhandled exception was thrown at run time"},{code:"AK-X001",level:"error",rule:"The matrix's slots, structures, rules or combos name something that does not exist, or a combo lacks a slot of its structure"},{code:"AK-X002",level:"error",rule:"The matrix's rules leave no combination to make, or rule out a combo matrix.combos names"},{code:"AK-X004",level:"error",rule:"Two chosen combos are the same, or more alike than the matrix's differ allows"},{code:"AK-X006",level:"error",rule:"A combo is longer than its output's maxDuration"},{code:"AK-L002",level:"warn",rule:"Text overflows the frame or is clipped"},{code:"AK-L006",level:"warn",rule:"Text is drawn in a fallback font, or in a bold or italic the font does not have"}];const r=new Map(CORE_RULES.map(e=>[e.code,{extension:CORE,...e}]));export function declareRules(e,t){const s=[];for(const o of t){const l=r.get(o.code);if(l&&l.extension!==e){s.push(`${o.code} is ${l.extension===CORE?"the core's":`${l.extension}'s`} rule already.`);continue}r.set(o.code,{extension:e,code:o.code,level:o.level,rule:o.rule})}return s}export function declareAll(e){return e.flatMap(t=>declareRules(t.extension,[t]))}export const ruleOf=e=>r.get(e),isRule=e=>r.has(e),declaredRules=()=>[...r.values()];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allyhub/diagnostics",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"private": true,
|
|
13
|
+
"license": "SEE LICENSE IN LICENSE.md"
|
|
14
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** A step after an export, as its extension contributes it (`exportProcessors`). */
|
|
2
|
+
export interface ExportProcessorSpec {
|
|
3
|
+
/** Its id: its extension's id and a name, `acme.sums.sha256`. */
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** The file types it applies to: every file of one of them an export makes. */
|
|
6
|
+
readonly types: readonly string[];
|
|
7
|
+
/** Its module, where the export imports it from: its default export is `@allyhub/export`'s ExportProcessor. */
|
|
8
|
+
readonly module: string;
|
|
9
|
+
/** The extension that contributes it. */
|
|
10
|
+
readonly extension: string;
|
|
11
|
+
}
|
|
12
|
+
/** The export processors the extensions loaded contribute, in their order. */
|
|
13
|
+
export type ProcessorTable = readonly ExportProcessorSpec[];
|
|
14
|
+
/** An analysis of media, as its extension contributes it (`mediaAnalyses`). */
|
|
15
|
+
export interface MediaAnalysisSpec {
|
|
16
|
+
/** Its id, as a version's needs name it in the media index (`faces`). */
|
|
17
|
+
readonly id: string;
|
|
18
|
+
/** What it measures, for a person and an agent. */
|
|
19
|
+
readonly about: string;
|
|
20
|
+
/** What it makes, as a line of progress names it: `the face track`. */
|
|
21
|
+
readonly what: string;
|
|
22
|
+
/** The kinds of media file it takes (`video`). */
|
|
23
|
+
readonly media: readonly string[];
|
|
24
|
+
/** The runtimes it downloads when first run (`yt-dlp`), by their names in the runtime manager. */
|
|
25
|
+
readonly runtimes: readonly string[];
|
|
26
|
+
/** Its module, where the index imports it from: its default export is `@allyhub/media`'s MediaAnalysis. */
|
|
27
|
+
readonly module: string;
|
|
28
|
+
/** The extension that contributes it. */
|
|
29
|
+
readonly extension: string;
|
|
30
|
+
}
|
|
31
|
+
/** The media analyses the extensions loaded contribute, in their order: the order the index runs them in. */
|
|
32
|
+
export type AnalysisTable = readonly MediaAnalysisSpec[];
|
|
33
|
+
/** A command of the CLI, as its extension contributes it (`cliCommands`). */
|
|
34
|
+
export interface CliCommandSpec {
|
|
35
|
+
/** Its words: `allyhub <name>`. */
|
|
36
|
+
readonly name: string;
|
|
37
|
+
/** Its one line in `allyhub help`. */
|
|
38
|
+
readonly summary: string;
|
|
39
|
+
/** The work `allyhub help <work>` lists it in. */
|
|
40
|
+
readonly work?: string;
|
|
41
|
+
/** Its module, where the CLI imports it from: its default export is `@allyhub/build`'s CliCommands, which has this command by name. */
|
|
42
|
+
readonly module: string;
|
|
43
|
+
/** The extension that contributes it. */
|
|
44
|
+
readonly extension: string;
|
|
45
|
+
}
|
|
46
|
+
/** A view of `allyhub inspect`, as its extension contributes it (`inspectViews`). */
|
|
47
|
+
export interface InspectViewSpec {
|
|
48
|
+
/** Its word: `allyhub inspect <name>`. */
|
|
49
|
+
readonly name: string;
|
|
50
|
+
/** Its one line in `allyhub help`. */
|
|
51
|
+
readonly summary: string;
|
|
52
|
+
/** Its module, where the CLI imports it from: its default export is `@allyhub/build`'s InspectViews, which has this view by name. */
|
|
53
|
+
readonly module: string;
|
|
54
|
+
/** The extension that contributes it. */
|
|
55
|
+
readonly extension: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What does for the agent what a project tool does for an editor: a CLI
|
|
59
|
+
* command, or the files it reads or writes instead; or, for what only a
|
|
60
|
+
* person decides (taking a website offline), why the agent has none.
|
|
61
|
+
*/
|
|
62
|
+
export type ToolCounterpart = {
|
|
63
|
+
readonly command: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly files: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly person: string;
|
|
68
|
+
};
|
|
69
|
+
/** What a stage page loads from a folder of the tree: the CSP fetch directive it needs (`script-src` for "script"). */
|
|
70
|
+
export declare const STAGE_LOADS: readonly ["script", "style", "font", "img", "media", "connect"];
|
|
71
|
+
export type StageLoad = (typeof STAGE_LOADS)[number];
|
|
72
|
+
/** A folder of the stage's tree an extension serves, as it contributes it (`stageRoutes`). */
|
|
73
|
+
export interface StageRouteSpec {
|
|
74
|
+
/** Its folder at the tree's root, ending in "/" (`sound/`). */
|
|
75
|
+
readonly folder: string;
|
|
76
|
+
/** What the stage's pages load from it, which their CSP allows there. */
|
|
77
|
+
readonly loads: readonly StageLoad[];
|
|
78
|
+
/** Its module, where the dev server imports it from: its default export is `@allyhub/build`'s StageRoutes, which has this folder. */
|
|
79
|
+
readonly module: string;
|
|
80
|
+
/** The extension that contributes it. */
|
|
81
|
+
readonly extension: string;
|
|
82
|
+
}
|
|
83
|
+
/** A tool of the project's server, as its extension contributes it (`projectTools`). */
|
|
84
|
+
export interface ProjectToolSpec {
|
|
85
|
+
/** Its method: `video/timeline`, namespaced by its kind or its extension. */
|
|
86
|
+
readonly name: string;
|
|
87
|
+
/** Where a read view answers it with no machine (@allyhub/protocol's MethodSource): from the snapshot, as nothing, or by the machine. */
|
|
88
|
+
readonly source: "project" | "asleep" | "machine";
|
|
89
|
+
/** What does the same for the agent. */
|
|
90
|
+
readonly does: ToolCounterpart;
|
|
91
|
+
/** Its module, where the dev server imports it from: its default export is `@allyhub/build`'s ProjectTools, which has this tool by name. */
|
|
92
|
+
readonly module: string;
|
|
93
|
+
/** The extension that contributes it. */
|
|
94
|
+
readonly extension: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A part of a skill (`skills`): a folder laid out as an Agent Skill's
|
|
98
|
+
* (its SKILL.md, references/, scripts/, assets/), named as the skill is.
|
|
99
|
+
* A skill is assembled from every part of its name: the one that holds
|
|
100
|
+
* its SKILL.md, and those that add files to it.
|
|
101
|
+
*/
|
|
102
|
+
export interface SkillSpec {
|
|
103
|
+
/** The skill's name: its folder's (`allyhub`). */
|
|
104
|
+
readonly name: string;
|
|
105
|
+
/** Where the folder is. */
|
|
106
|
+
readonly folder: string;
|
|
107
|
+
/** What gives it: the extension that contributes it, or the app whose own part it is. */
|
|
108
|
+
readonly extension: string;
|
|
109
|
+
}
|
|
110
|
+
/** An MCP server, as its extension contributes it (`mcpServers`): a local program or an address, as `.mcp.json` names one. */
|
|
111
|
+
export type McpServerSpec = {
|
|
112
|
+
/** Its name, as an agent names its tools (`mcp__<name>__<tool>`). */
|
|
113
|
+
readonly name: string;
|
|
114
|
+
/** The extension that contributes it. */
|
|
115
|
+
readonly extension: string;
|
|
116
|
+
} & ({
|
|
117
|
+
readonly command: string;
|
|
118
|
+
readonly args: readonly string[];
|
|
119
|
+
readonly env: Readonly<Record<string, string>>;
|
|
120
|
+
/** Where it runs: its extension's folder unless it says. */
|
|
121
|
+
readonly cwd: string;
|
|
122
|
+
} | {
|
|
123
|
+
readonly url: string;
|
|
124
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=contributed.d.ts.map
|
|
@@ -18,7 +18,7 @@ export interface TrackedFace {
|
|
|
18
18
|
*/
|
|
19
19
|
export interface FaceTrack {
|
|
20
20
|
version: 2;
|
|
21
|
-
/**
|
|
21
|
+
/** What found the faces: the cloud tool ("find-faces"), never the model behind it. */
|
|
22
22
|
model: string;
|
|
23
23
|
/** The displayed picture's pixels the boxes are in. */
|
|
24
24
|
width: number;
|