@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LAYER_BRAND, type GraphicLayer, type LayerTiming, type TimeShape } from "@allyhub/piece";
|
|
2
|
+
/** A layer of a stack: a graphic layer, or a footage layer (the video's), of which the plan reads its file. */
|
|
3
|
+
export type StackLayer = GraphicLayer | (LayerTiming & {
|
|
4
|
+
readonly [LAYER_BRAND]: "footage";
|
|
5
|
+
readonly file?: unknown;
|
|
6
|
+
});
|
|
7
|
+
/** A graphics plane of a stack: its layers' windows, and whether they are behind the person or over the finished picture. */
|
|
8
|
+
export interface StackPlane {
|
|
9
|
+
layers: {
|
|
10
|
+
component: string;
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
}[];
|
|
14
|
+
behindPerson?: true;
|
|
15
|
+
overlay?: true;
|
|
16
|
+
}
|
|
17
|
+
export declare const isFootage: <L extends StackLayer>(l: L) => l is Exclude<L, GraphicLayer>;
|
|
18
|
+
/** A graphic layer's plane: behind the person, in front, or over the finished picture. */
|
|
19
|
+
export declare const zOf: (l: GraphicLayer) => "front" | "behind-person" | "overlay";
|
|
20
|
+
/** The layers' names, for the timeline: component names and "footage". */
|
|
21
|
+
export declare const layerNames: (layers: readonly StackLayer[]) => string[];
|
|
22
|
+
/** Replaces word references in props with seconds, where the shape says they are times. */
|
|
23
|
+
export declare function resolveTimes(v: unknown, shape: true | TimeShape, at: (ref: unknown) => number): unknown;
|
|
24
|
+
/** A layer's window in its part, seconds from the part's start. */
|
|
25
|
+
export declare function windowOf(l: LayerTiming, dur: number, at: (ref: unknown) => number): [number, number];
|
|
26
|
+
/** A part's stack, planned from its layers alone. */
|
|
27
|
+
export interface StackPlan {
|
|
28
|
+
/** The part's own footage (the first footage layer without a file) when layers are behind its person; else -1. */
|
|
29
|
+
takeAt: number;
|
|
30
|
+
/** Some graphic layer is behind the person. */
|
|
31
|
+
hasBehind: boolean;
|
|
32
|
+
/** The layers' indices in the order they are drawn, back to front. */
|
|
33
|
+
order: number[];
|
|
34
|
+
/** Its graphics planes, back to front (their layers filled in by compose). */
|
|
35
|
+
planes: StackPlane[];
|
|
36
|
+
/** Each graphic layer's plane. */
|
|
37
|
+
planeOf: Map<number, number>;
|
|
38
|
+
/** Each footage layer's count of planes under it. */
|
|
39
|
+
overOf: Map<number, number>;
|
|
40
|
+
/** Whether layer i is over the finished picture. */
|
|
41
|
+
overlaid(i: number): boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The stack: the layers in the order they are listed, back to front,
|
|
45
|
+
* footage and graphics alike. A layer behind the person belongs to the
|
|
46
|
+
* part's own footage (the first footage layer without a file): drawn
|
|
47
|
+
* right over it, under its speaker. Graphic layers with no footage
|
|
48
|
+
* between them are one plane; a footage layer is over the planes before
|
|
49
|
+
* it; layers over the finished picture come last.
|
|
50
|
+
*/
|
|
51
|
+
export declare function planStack(layers: readonly StackLayer[]): StackPlan;
|
|
52
|
+
//# sourceMappingURL=plan.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"@allyhub/piece";export const isFootage=n=>n.__allyhubLayer==="footage",zOf=n=>n.z==="behind-person"||n.z==="overlay"?n.z:"front",layerNames=n=>n.map(r=>isFootage(r)?"footage":r.component);export function resolveTimes(n,r,i){if(Array.isArray(n))return n.map(o=>resolveTimes(o,r,i));if(r===!0)return typeof n=="string"||typeof n=="number"?i(n):n;if(typeof n!="object"||n===null)return n;const t={...n};for(const[o,f]of Object.entries(r))o in t&&t[o]!==void 0&&(t[o]=resolveTimes(t[o],f,i));return t}export function windowOf(n,r,i){const t=u=>Math.min(Math.max(u,0),r),o=t(n.at===void 0?0:i(n.at)),f=n.until!==void 0?t(i(n.until)):n.dur!==void 0?t(o+n.dur):r;return[o,f]}export function planStack(n){const r=n.some(e=>!isFootage(e)&&zOf(e)==="behind-person"),i=r?n.findIndex(e=>isFootage(e)&&e.file===void 0):-1,t=e=>i>=0&&!isFootage(e)&&zOf(e)==="behind-person",o=e=>e!==void 0&&!isFootage(e)&&zOf(e)==="overlay",f=[];n.forEach((e,s)=>{isFootage(e)?(f.push(s),s===i&&n.forEach((c,h)=>{t(c)&&f.push(h)})):!t(e)&&!o(e)&&f.push(s)}),n.forEach((e,s)=>{o(e)&&f.push(s)});const u=[],a=new Map,p=new Map;let d;for(const e of f){const s=n[e];if(!s)continue;if(isFootage(s)){d=void 0,p.set(e,u.length);continue}const c=t(s)?"behind":o(s)?"overlay":"front";d!==c&&(u.push({layers:[],...c==="behind"?{behindPerson:!0}:{},...c==="overlay"?{overlay:!0}:{}}),d=c),a.set(e,u.length-1)}return{takeAt:i,hasBehind:r,order:f,planes:u,planeOf:a,overOf:p,overlaid:e=>o(n[e])}}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { type Problem } from "@allyhub/diagnostics";
|
|
2
|
+
import { type DataFile, type MediaInfo, type MessagesFile, type MessageTree, type MessageValue, type TextAnchor } from "@allyhub/piece";
|
|
3
|
+
import { type LineAnchor, type MessageHint, type Reads } from "@allyhub/piece";
|
|
4
|
+
export interface ReadLogOptions {
|
|
5
|
+
lang: string | undefined;
|
|
6
|
+
defaultLang: string | undefined;
|
|
7
|
+
own: MessagesFile;
|
|
8
|
+
fallback: MessagesFile;
|
|
9
|
+
/** Key → the anchors of a line a script wrote them in, for each of the two. */
|
|
10
|
+
anchors?: {
|
|
11
|
+
own?: Readonly<Record<string, readonly TextAnchor[]>>;
|
|
12
|
+
fallback?: Readonly<Record<string, readonly TextAnchor[]>>;
|
|
13
|
+
};
|
|
14
|
+
/** Repo path → media, with URLs valid in this page. */
|
|
15
|
+
media: Record<string, MediaInfo>;
|
|
16
|
+
/** The piece's file: ctx.asset and ctx.data paths are relative to it. */
|
|
17
|
+
file: string;
|
|
18
|
+
/** Repo path → data files ctx.data can read. */
|
|
19
|
+
data?: Record<string, DataFile>;
|
|
20
|
+
/** The folder of the shared words, where a missing key is to be added. */
|
|
21
|
+
text?: string;
|
|
22
|
+
/** The piece's script, with `{locale}` for each language: where the keys under its id are written. */
|
|
23
|
+
script?: string;
|
|
24
|
+
/** What its keys start with (`messagePrefix` of the piece's id). */
|
|
25
|
+
prefix?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class ReadLog {
|
|
28
|
+
private readonly messages;
|
|
29
|
+
private readonly media;
|
|
30
|
+
private readonly data;
|
|
31
|
+
/** Text that s() or s.with() returned → the key it came from (the latest). */
|
|
32
|
+
private readonly keyByText;
|
|
33
|
+
/** Media looked for that is not there yet (a say's stem): read as missing. */
|
|
34
|
+
private readonly missingReads;
|
|
35
|
+
private readonly missingMedia;
|
|
36
|
+
readonly problems: Problem[];
|
|
37
|
+
/** Every display text read, for matching against the screen. */
|
|
38
|
+
readonly texts: Set<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Hears every read as it happens (a message's value, a medium's or data
|
|
41
|
+
* file's sha256): the runtime records what each part reads while it
|
|
42
|
+
* mounts and draws, for the part's identity.
|
|
43
|
+
*/
|
|
44
|
+
tap: ((what: string, value: string) => void) | undefined;
|
|
45
|
+
private readonly opts;
|
|
46
|
+
private readonly fileOf;
|
|
47
|
+
constructor(opts: ReadLogOptions);
|
|
48
|
+
private value;
|
|
49
|
+
private record;
|
|
50
|
+
/** The locale a key's value comes from, for plural rules. */
|
|
51
|
+
private locale;
|
|
52
|
+
/** The text of a key for these inputs, recorded. */
|
|
53
|
+
private text;
|
|
54
|
+
/** s(key, hint): this language's text, else the default language's. */
|
|
55
|
+
s(key: string, hint?: MessageHint): string;
|
|
56
|
+
/**
|
|
57
|
+
* s.with(key, inputs, hint): the variant these inputs select (plurals,
|
|
58
|
+
* selectors), with its {name} variables filled.
|
|
59
|
+
*/
|
|
60
|
+
with(key: string, inputs: Readonly<Record<string, string | number>>, hint?: MessageHint): string;
|
|
61
|
+
/**
|
|
62
|
+
* The message a text came from (the latest s() or s.with() that returned
|
|
63
|
+
* it), and how it reads aloud: its `speak` when it has one.
|
|
64
|
+
*/
|
|
65
|
+
spokenOf(text: string): {
|
|
66
|
+
key: string;
|
|
67
|
+
speak: string;
|
|
68
|
+
anchors?: LineAnchor[];
|
|
69
|
+
} | undefined;
|
|
70
|
+
/** s.list(prefix): numbered keys under the prefix, in order. */
|
|
71
|
+
list(prefix: string, hint?: MessageHint): MessageTree[];
|
|
72
|
+
/** The keys under a prefix (`<prefix>.…`), in either language, without recording a read. */
|
|
73
|
+
keysUnder(prefix: string): string[];
|
|
74
|
+
/** The raw value of a key without recording a read. */
|
|
75
|
+
peek(key: string): MessageValue | undefined;
|
|
76
|
+
/** Marks a key as read (e.g. a page's "<prefix>.<page>.notes"). */
|
|
77
|
+
touch(key: string): MessageValue | undefined;
|
|
78
|
+
/** Media by repo path, recorded as read. undefined when it is not in the project. */
|
|
79
|
+
mediaAt(path: string): MediaInfo | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Media looked for by a path that is not there yet (a say's file, by its
|
|
82
|
+
* stem): recorded, so the digest changes once it is made.
|
|
83
|
+
*/
|
|
84
|
+
missing(path: string): void;
|
|
85
|
+
/** A problem found while reading (once per message). */
|
|
86
|
+
report(p: Problem): void;
|
|
87
|
+
/**
|
|
88
|
+
* Paths are relative to the file that wrote the output read (another
|
|
89
|
+
* piece's, for a piece that reuses its outputs), else the piece's.
|
|
90
|
+
*/
|
|
91
|
+
relativeTo(file: string): void;
|
|
92
|
+
private base;
|
|
93
|
+
/** The file paths are relative to. */
|
|
94
|
+
private get pathBase();
|
|
95
|
+
/** Where a path named in `base` (the folder of the module that wrote it; none: the piece's) is from, for a message. */
|
|
96
|
+
baseOf(base?: string): string;
|
|
97
|
+
/** A path named in `base` (a folder; none: the piece's file's), as a project path. */
|
|
98
|
+
private resolve;
|
|
99
|
+
/**
|
|
100
|
+
* ctx.asset(path): media relative to the piece's file, or to `base`, the
|
|
101
|
+
* file the code that named it was written in (pathBase).
|
|
102
|
+
*/
|
|
103
|
+
asset(path: string, base?: string): MediaInfo;
|
|
104
|
+
/** A media file that may not be there: found and recorded, or recorded as missing; never a problem. */
|
|
105
|
+
optionalAsset(path: string): MediaInfo | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* A data file the piece may not have yet (a take's edits file, which the
|
|
108
|
+
* preview's transcript editor creates): read and recorded when it is
|
|
109
|
+
* there; recorded as missing (so the digest changes once it is made)
|
|
110
|
+
* when not, without a problem.
|
|
111
|
+
*/
|
|
112
|
+
optionalData(path: string, base?: string): {
|
|
113
|
+
full?: string;
|
|
114
|
+
found: boolean;
|
|
115
|
+
value?: unknown;
|
|
116
|
+
error?: string;
|
|
117
|
+
};
|
|
118
|
+
/** ctx.data(path): a data file relative to the piece's file, parsed. */
|
|
119
|
+
readData(path: string): unknown;
|
|
120
|
+
/** reads(), with each message attributed to the part its key names. */
|
|
121
|
+
reads(prefix: string, partKeys: readonly string[]): Reads;
|
|
122
|
+
/** Translation problems: keys that fell back to the default language (S002). */
|
|
123
|
+
translationProblems(): Problem[];
|
|
124
|
+
/**
|
|
125
|
+
* The keys a text on screen came from: the keys whose display text is
|
|
126
|
+
* exactly `text` when there are any, else the keys whose display text
|
|
127
|
+
* contains it (a word of a split line, a line being typed), and then only
|
|
128
|
+
* for a text with at least `KEY_PART_MIN` letters or digits. A comma or a
|
|
129
|
+
* single digit is in many messages and came from none of them: naming a
|
|
130
|
+
* key for it would send its reader to the wrong line. Spaces do not
|
|
131
|
+
* count: a block's text is its text nodes joined with a space, which a
|
|
132
|
+
* line drawn as several spans did not have between them.
|
|
133
|
+
*/
|
|
134
|
+
keysShowing(text: string): string[];
|
|
135
|
+
/** The messages file of this language, for problem locations. */
|
|
136
|
+
get file(): string;
|
|
137
|
+
/**
|
|
138
|
+
* The file the keys a text shows are written in, for its problem's
|
|
139
|
+
* location: the piece's script where they are all its own (in this
|
|
140
|
+
* language where it has them, else the default's), else the shared
|
|
141
|
+
* words of this language.
|
|
142
|
+
*/
|
|
143
|
+
fileOfKeys(keys: readonly string[]): string;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=reads.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{problem as l}from"@allyhub/diagnostics";import{pathIn as m,asUrlString as d,displayOf as c,fillMessage as f,messageList as g,repoPath as u,speakOf as A,textsOf as p,hasMarks as w,withoutMarks as O}from"@allyhub/piece";import{lineAnchors as $}from"@allyhub/piece";import{TEXT_DIR as v}from"@allyhub/formats";const b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",k=3;export class ReadLog{messages=new Map;media=new Map;data=new Map;keyByText=new Map;missingReads=new Set;missingMedia=new Set;problems=[];texts=new Set;tap;opts;fileOf;constructor(e){this.opts=e,this.fileOf=t=>`${e.text??v}/${t??"en"}.json`}value(e){const{own:t,fallback:i,lang:s,defaultLang:n}=this.opts;return Object.hasOwn(t,e)?{value:t[e],fellBack:!1}:Object.hasOwn(i,e)?{value:i[e],fellBack:s!==n}:{value:void 0,fellBack:!1}}record(e,t,i){if(this.messages.has(e))return;const{value:s,fellBack:n}=this.value(e);if(this.messages.set(e,{key:e,kind:t,fallback:n,...i?{hint:i}:{}}),t!=="list"&&s===void 0){const a=e.slice(e.indexOf(".")+1),o=Object.keys(this.opts.fallback).find(h=>h.endsWith(`.${a}`));this.problems.push(l("AK-S001",`The code reads ${e}, but the default language ${this.opts.defaultLang??"(no messages)"} does not have it. ${o===void 0?`Add it to ${this.fileOfKeys([e])}.`:`It has ${o}: read that, or give the piece the id "${e.slice(0,e.indexOf("."))}".`}`,{where:{file:this.fileOfKeys([e])}}))}}locale(e){return Object.hasOwn(this.opts.own,e)?this.opts.lang:this.opts.defaultLang}text(e,t,i){this.record(e,"text",t);const{value:s}=this.value(e);this.tap?.(`m:${e}`,JSON.stringify(s??null));for(const n of p(s))this.texts.add(n);return c(s,i,this.locale(e))??""}s(e,t){const i=this.text(e,t,{});return i&&this.keyByText.set(i,{key:e,inputs:{}}),i}with(e,t,i){const s=f(this.text(e,i,t),t);return this.texts.add(s),s&&this.keyByText.set(s,{key:e,inputs:t}),s}spokenOf(e){const t=this.keyByText.get(e);if(!t)return;const i=A(this.value(t.key).value,t.inputs,this.locale(t.key)),s=(Object.hasOwn(this.opts.own,t.key)?this.opts.anchors?.own:this.opts.anchors?.fallback)?.[t.key];return{key:t.key,speak:i===void 0?e:f(i,t.inputs),...s&&i!==void 0?{anchors:$(i,s,n=>f(n,t.inputs))}:{}}}list(e,t){const i=[],s=new Set([...Object.keys(this.opts.own),...Object.keys(this.opts.fallback)]),n=g(a=>c(this.value(a).value,{},this.locale(a)),s,e,i);this.record(e,"list",t),i.length===0&&this.problems.push(l("AK-S001",`The code reads the list ${e}, but the default language has no keys like ${e}.0, ${e}.1. Add them to ${this.fileOfKeys([`${e}.0`])}.`,{where:{file:this.fileOfKeys([`${e}.0`])}}));for(const a of i)this.text(a,void 0,{});return n}keysUnder(e){const t=`${e}.`;return[...new Set([...Object.keys(this.opts.own),...Object.keys(this.opts.fallback)])].filter(i=>i.startsWith(t))}peek(e){return this.value(e).value}touch(e){const{value:t,fellBack:i}=this.value(e);return this.tap?.(`m:${e}`,JSON.stringify(t??null)),t!==void 0&&!this.messages.has(e)&&this.messages.set(e,{key:e,kind:"text",fallback:i}),t}mediaAt(e){const t=this.opts.media[e];return t&&this.media.set(e,d(t)),this.tap?.(`f:${e}`,t?.sha256??""),t}missing(e){this.missingReads.add(e)}report(e){this.problems.some(t=>t.code===e.code&&t.message===e.message)||this.problems.push(e)}relativeTo(e){this.base=e}base;get pathBase(){return this.base??this.opts.file}baseOf(e){return e===void 0?this.pathBase:e===""?"the project's root":e}resolve(e,t){return t===void 0?u(this.pathBase,e):m(t,e)}asset(e,t){const i=this.baseOf(t),s=this.resolve(e,t),n=s===void 0?void 0:this.mediaAt(s);if(n)return n;const a=s??e;return this.missingMedia.has(a)||(this.missingMedia.add(a),this.problems.push(l("AK-A001",s===void 0?`"${e}" points outside the project. Put media in the project, with a path relative to ${i}.`:`"${e}" (named in ${i}) cannot find ${s}: the path is wrong, or the file is not in the project yet.`,{where:{file:i}}))),d({path:s??e,sha256:"",kind:"image",url:b,width:1,height:1})}optionalAsset(e){const t=u(this.pathBase,e);if(t===void 0)return;const i=this.mediaAt(t);return i||this.missing(t),i?d(i):void 0}optionalData(e,t){const i=this.resolve(e,t);if(i===void 0)return{found:!1};const s=this.opts.data?.[i];return this.data.set(i,s?.sha256??""),s?s.error===void 0?{full:i,found:!0,value:s.value}:{full:i,found:!0,error:s.error}:{full:i,found:!1}}readData(e){const t=u(this.pathBase,e),i=t===void 0?void 0:this.opts.data?.[t];if(t!==void 0&&i){if(this.data.set(t,i.sha256),this.tap?.(`d:${t}`,i.sha256),i.error===void 0)return i.value;this.missingMedia.has(t)||(this.missingMedia.add(t),this.problems.push(l("AK-R001",`Cannot read the data file ${t}: ${i.error}`,{where:{file:t}})));return}this.missingMedia.has(e)||(this.missingMedia.add(e),this.problems.push(l("AK-A001",t===void 0?`ctx.data("${e}") points outside the project. Put data files in the project, with a path relative to ${this.pathBase}.`:`ctx.data("${e}") cannot find ${t}: the path is wrong, or the file is not CSV, YAML or JSON.`,{where:{file:this.pathBase}})))}reads(e,t){const i=s=>{if(!s.startsWith(`${e}.`))return;const n=s.slice(e.length+1).split(".")[0]??"";return t.includes(n)?n:void 0};return{messages:[...this.messages.values()].map(s=>{const n=i(s.key);return n===void 0?s:{...s,part:n}}).sort((s,n)=>s.key<n.key?-1:s.key>n.key?1:0),media:[...[...this.media.values()].map(s=>({path:s.path,sha256:s.sha256,kind:s.kind})),...[...this.missingReads].filter(s=>!this.media.has(s)).map(s=>({path:s,sha256:"",kind:"audio"}))].sort((s,n)=>s.path<n.path?-1:1),data:[...this.data.entries()].map(([s,n])=>({path:s,sha256:n})).sort((s,n)=>s.path<n.path?-1:1)}}translationProblems(){const e=[];for(const t of this.messages.values())t.fallback&&t.kind==="text"&&e.push(l("AK-S002",`${this.opts.lang??""} is missing a translation: ${t.key}. The ${this.opts.defaultLang??""} text was used.`,{where:{file:this.fileOf(this.opts.lang)}}));return e}keysShowing(e){const t=o=>o.replace(/[\s\p{Cf}]+/gu,""),i=t(e);if(i==="")return[];const s=[],n=[];for(const o of this.messages.values()){const h=p(this.peek(o.key)).flatMap(r=>w(r)?[r,O(r)]:[r]).map(t);h.includes(i)?s.push(o.key):h.some(r=>r.includes(i))&&n.push(o.key)}return s.length>0?s:(i.match(/[\p{L}\p{N}]/gu)?.length??0)>=k?n:[]}get file(){return this.fileOf(this.opts.lang)}fileOfKeys(e){const{script:t,prefix:i,own:s,lang:n,defaultLang:a}=this.opts;if(t===void 0||i===void 0||e.length===0||!e.every(h=>h.startsWith(i)))return this.file;const o=e.every(h=>Object.hasOwn(s,h));return t.replace("{locale}",(o?n:a)??"en")}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ShapeKind } from "@allyhub/piece";
|
|
2
|
+
/** What a shape's path is made from. */
|
|
3
|
+
export interface ShapeGeometry {
|
|
4
|
+
readonly shape: ShapeKind;
|
|
5
|
+
/** [x, y, w, h], shares of the frame; default all of it. */
|
|
6
|
+
readonly box?: readonly [number, number, number, number];
|
|
7
|
+
/** A path's data, the board's pixels (shape "path"). */
|
|
8
|
+
readonly path?: string;
|
|
9
|
+
/** A rectangle's corners, px. */
|
|
10
|
+
readonly radius?: number;
|
|
11
|
+
/** A polygon's sides (3 to 100). */
|
|
12
|
+
readonly sides?: number;
|
|
13
|
+
/** A polygon as a star: its inner points' distance, percent of its outer (100: a polygon). */
|
|
14
|
+
readonly starRatio?: number;
|
|
15
|
+
}
|
|
16
|
+
/** The shape's box in the frame's pixels. */
|
|
17
|
+
export declare function shapeBox(g: ShapeGeometry, frame: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}): [number, number, number, number];
|
|
21
|
+
/** The shape's path data, the frame's pixels. */
|
|
22
|
+
export declare function shapePath(g: ShapeGeometry, frame: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}): string;
|
|
26
|
+
//# sourceMappingURL=shape-path.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{SHAPE_DEFAULTS as x}from"@allyhub/piece";const t=c=>String(Math.round(c*1e3)/1e3);export function shapeBox(c,i){const[n,s,o,r]=c.box??[0,0,1,1];return[n*i.width,s*i.height,o*i.width,r*i.height]}export function shapePath(c,i){if(c.shape==="path")return c.path??"";const[n,s,o,r]=shapeBox(c,i);switch(c.shape){case"ellipse":{const $=o/2,e=r/2,h=n+$;return`M${t(h-$)} ${t(s+e)}A${t($)} ${t(e)} 0 1 0 ${t(h+$)} ${t(s+e)}A${t($)} ${t(e)} 0 1 0 ${t(h-$)} ${t(s+e)}Z`}case"triangle":return`M${t(n+o/2)} ${t(s)}L${t(n+o)} ${t(s+r)}L${t(n)} ${t(s+r)}Z`;case"line":{const $=s+r/2;return`M${t(n)} ${t($)}L${t(n+o)} ${t($)}`}case"polygon":{const $=Math.round(c.sides??x.sides),e=(c.starRatio??100)/100,h=n+o/2,A=s+r/2,u=[],p=e<1?$*2:$;for(let a=0;a<p;a++){const M=-Math.PI/2+a*2*Math.PI/p,d=e<1&&a%2===1?e:1;u.push(`${t(h+Math.cos(M)*o*d/2)} ${t(A+Math.sin(M)*r*d/2)}`)}return`M${u.join("L")}Z`}default:{const $=Math.min(c.radius??x.radius,o/2,r/2);return $<=0?`M${t(n)} ${t(s)}H${t(n+o)}V${t(s+r)}H${t(n)}Z`:`M${t(n+$)} ${t(s)}H${t(n+o-$)}A${t($)} ${t($)} 0 0 1 ${t(n+o)} ${t(s+$)}V${t(s+r-$)}A${t($)} ${t($)} 0 0 1 ${t(n+o-$)} ${t(s+r)}H${t(n+$)}A${t($)} ${t($)} 0 0 1 ${t(n)} ${t(s+r-$)}V${t(s+$)}A${t($)} ${t($)} 0 0 1 ${t(n+$)} ${t(s)}Z`}}}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Problem } from "@allyhub/diagnostics";
|
|
2
|
+
import { type Format, type Look, type SizeInfo } from "@allyhub/piece";
|
|
3
|
+
import type { Env } from "./env.js";
|
|
4
|
+
import { type StyleWatch } from "./styles.js";
|
|
5
|
+
/** What the stage is laid out for: a piece's frame, format, look and whether it is transparent. */
|
|
6
|
+
export interface DressedPiece {
|
|
7
|
+
readonly dims: SizeInfo;
|
|
8
|
+
readonly look: Look;
|
|
9
|
+
readonly format: Format;
|
|
10
|
+
readonly options: {
|
|
11
|
+
readonly transparent?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** What a stage's watchers say a problem was drawn by: a part (a board), its element and its layers'. */
|
|
15
|
+
export interface MountedOn {
|
|
16
|
+
readonly el: HTMLElement;
|
|
17
|
+
readonly part: {
|
|
18
|
+
readonly key: string;
|
|
19
|
+
};
|
|
20
|
+
readonly layers: readonly {
|
|
21
|
+
readonly el: HTMLElement;
|
|
22
|
+
readonly spec: {
|
|
23
|
+
readonly component: string;
|
|
24
|
+
};
|
|
25
|
+
readonly index: number;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export interface StageHost {
|
|
29
|
+
readonly el: HTMLElement;
|
|
30
|
+
/** Style values the browser drops, watched while checking (the outer output's, for an embedded one). */
|
|
31
|
+
readonly styles: StyleWatch | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Waits for the pictures a moment shows to decode, at most `limitMs`;
|
|
34
|
+
* the sources still not decoded then.
|
|
35
|
+
*/
|
|
36
|
+
readonly picturesDrawn: (limitMs: number) => Promise<string[]>;
|
|
37
|
+
/** Decodes every picture on the stage now (a check's watch). */
|
|
38
|
+
sweep(): Promise<void>;
|
|
39
|
+
/** Lays the stage out for the piece: size, look, background. Its background colour as the footage plane draws it. */
|
|
40
|
+
dress(piece: DressedPiece): string;
|
|
41
|
+
/** Whether the stage draws over nothing (a render's graphics, a transparent video). */
|
|
42
|
+
readonly clear: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A CSS colour as "#rrggbb" (or "#rrggbbaa"), for the host's footage
|
|
45
|
+
* plane: whatever colour the look or the piece gives, as the browser
|
|
46
|
+
* draws it in sRGB on this stage (its variables resolve here).
|
|
47
|
+
*/
|
|
48
|
+
readonly cssColor: (color: string) => string;
|
|
49
|
+
/** Takes the records of changes outside the stage while what changed is still there. */
|
|
50
|
+
takeOutside(): void;
|
|
51
|
+
/** What the watchers found, each with the part whose element holds it. */
|
|
52
|
+
problems(mounted: readonly MountedOn[]): Problem[];
|
|
53
|
+
dispose(): void;
|
|
54
|
+
}
|
|
55
|
+
export declare function createStage(env: Env, el: HTMLElement): StageHost;
|
|
56
|
+
//# sourceMappingURL=stage.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{problem as $}from"@allyhub/diagnostics";import{addLayerRule as L,lookCss as P}from"@allyhub/piece";import{selectorOf as E}from"./inspect.js";import{pictureHint as x,pictureWaiter as A,watchPictures as H}from"./pictures.js";import{rejectedMessage as K,watchStyles as M}from"./styles.js";const p=c=>c.toString(16).padStart(2,"0");export function createStage(c,n){const{options:m,embed:g}=c,f=m.purpose==="check"&&!g,b=f?M():void 0,v=f?H(n):void 0,h=[],R=A(n,t=>{h.some(o=>o.el===t.el&&o.src===t.src)||h.push(t)}),y=new Set,S=t=>!n.contains(t.target)&&!(t.target instanceof HTMLElement&&t.target.dataset.akHolder===""),w=f?new MutationObserver(t=>{for(const o of t)S(o)&&y.add(o.target.nodeName.toLowerCase())}):void 0;let u=!1;const C=t=>{const o=document.createElement("div");o.style.color=t,n.append(o);const i=getComputedStyle(o).color;o.remove();const s=document.createElement("canvas");s.width=1,s.height=1;const a=s.getContext("2d",{willReadFrequently:!0});if(!a)return"#000000";a.fillStyle=i,a.fillRect(0,0,1,1);const[e=0,r=0,d=0,l=255]=a.getImageData(0,0,1,1).data;return`#${p(e)}${p(r)}${p(d)}${l===255?"":p(l)}`},O=()=>{w?.takeRecords().forEach(t=>{S(t)&&y.add(t.target.nodeName.toLowerCase())})};return{el:n,styles:b,picturesDrawn:R,get clear(){return u},async sweep(){await v?.sweep()},cssColor:C,takeOutside:O,dress(t){const{dims:o,look:i}=t;u=m.purpose==="render"&&!g||t.options.transparent===!0,n.replaceChildren(),L(n.ownerDocument),n.dataset.format=t.format,c.lang!==void 0&&(n.lang=c.lang),Object.assign(n.style,{position:"relative",width:`${String(o.width)}px`,height:`${String(o.height)}px`,overflow:"hidden",background:u?"transparent":"var(--ak-color-bg)",color:"var(--ak-color-fg)",fontFamily:"var(--ak-font-body)"});for(const[e,r]of Object.entries(P(i)))n.style.setProperty(e,r);const a=t.options.transparent===!0?"transparent":C("var(--ak-color-bg)");return u&&m.purpose!=="play"&&!g&&(document.documentElement.style.background="transparent",document.body.style.background="transparent"),w?.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),a},problems(t){O();const o=[...y].map(e=>$("AK-R003",`Piece code changed <${e}> outside the stage. Draw only inside each layer's own element.`)),i=(b?.rejected()??[]).map(e=>{const r=e.el&&n.contains(e.el)?E(e.el,n):void 0;return $("AK-R004",K(e,r?` on ${r}`:""),{part:e.part,...r?{where:{selector:r}}:{}})}),s=v?.broken()??[],a=[...s,...h.filter(e=>!s.some(r=>r.el===e.el&&r.src===e.src))].map(e=>{const r=t.find(k=>k.el.contains(e.el)),d=r?.layers.find(k=>k.el.contains(e.el)),l=n.contains(e.el)?E(e.el,n):void 0,j=d?`${d.spec.component} (layer ${String(d.index+1)}) in part ${r?.part.key??""}`:r?`Part ${r.part.key}`:"The stage",D=e.via==="img"?`<img src="${e.src}">`:`a background image, url("${e.src}")`;return $("AK-A005",`${j} draws a picture that does not load: ${D}. ${x(e.src)}`,{...r?{part:r.part.key}:{},...l?{where:{selector:l}}:{}})});return[...o,...i,...a]},dispose(){w?.disconnect(),n.replaceChildren()}}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** A style value the browser did not take. */
|
|
2
|
+
export interface RejectedStyle {
|
|
3
|
+
/** The part being mounted or drawn when it was set. */
|
|
4
|
+
part: string;
|
|
5
|
+
/** The name as written: `fontWeight`, `font-weight`, or a setProperty name. */
|
|
6
|
+
prop: string;
|
|
7
|
+
value: string;
|
|
8
|
+
/** The value was a number, not a string. */
|
|
9
|
+
number?: true;
|
|
10
|
+
/** The element whose inline style it was, when it can be found. */
|
|
11
|
+
el?: Element;
|
|
12
|
+
via: "property" | "setProperty" | "cssText";
|
|
13
|
+
}
|
|
14
|
+
export interface StyleWatch {
|
|
15
|
+
/** The part whose code runs now (mount or render), or undefined. */
|
|
16
|
+
part: string | undefined;
|
|
17
|
+
/** What was rejected so far, at most `perPart` distinct values per part. */
|
|
18
|
+
rejected(): RejectedStyle[];
|
|
19
|
+
}
|
|
20
|
+
type Supports = (prop: string, value: string) => boolean;
|
|
21
|
+
/** `fontWeight` → `font-weight`, `webkitTransform` → `-webkit-transform`, `cssFloat` → `float`. */
|
|
22
|
+
export declare function cssName(prop: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* The declarations of a cssText, split at semicolons outside parentheses
|
|
25
|
+
* and quotes (url(data:…;…) and content: ";" stay whole).
|
|
26
|
+
*/
|
|
27
|
+
export declare function declarations(css: string): [prop: string, value: string][];
|
|
28
|
+
/** How to fix a rejected value, in one sentence. */
|
|
29
|
+
export declare function styleHint(r: Pick<RejectedStyle, "prop" | "value" | "via">, supports: Supports): string;
|
|
30
|
+
/** Wraps the inline style setters of this page (once per page). */
|
|
31
|
+
export declare function watchStyles(perPart?: number): StyleWatch;
|
|
32
|
+
/** The message of an AK-R004 problem. */
|
|
33
|
+
export declare function rejectedMessage(r: RejectedStyle, where: string): string;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=styles.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 cssName(e){if(e==="cssFloat")return"float";if(e.includes("-"))return e;const u=e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`);return/^(webkit|moz|ms|o)-/.test(u)?`-${u}`:u}export function declarations(e){const u=[];let r=0,c="",f=0;const d=l=>{const p=e.slice(f,l),y=p.indexOf(":");if(y>0){const h=p.slice(0,y).trim(),$=p.slice(y+1).replace(/!\s*important\s*$/i,"").trim();h&&$&&u.push([h,$])}f=l+1};for(let l=0;l<e.length;l++){const p=e[l];c?p==="\\"?l++:p===c&&(c=""):p==='"'||p==="'"?c=p:p==="("?r++:p===")"?r=Math.max(0,r-1):p===";"&&r===0&&d(l)}return d(e.length),u}const v=/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]+)$/i,C=/^-?(?:\d+\.?\d*|\.\d+)$/;export function styleHint(e,u){const r=cssName(e.prop),c=e.value.trim();if(e.via==="setProperty"&&r!==e.prop.toLowerCase())return`setProperty takes the CSS name "${r}", not "${e.prop}".`;if(!u(r,"initial"))return`Chrome has no style property "${e.prop}"; check its name.`;if(/!\s*important\s*$/i.test(c))return e.via==="cssText"?"Check the value's spelling and units.":`A style property does not take !important in its value: use style.setProperty("${r}", value, "important").`;const f=v.exec(c);return f?.[1]!==void 0&&u(r,f[1])?`${e.prop} takes a number such as ${f[1]}, not ${c}.`:C.test(c)&&u(r,`${c}px`)?`${e.prop} needs a unit: ${c}px, not ${c}.`:"Check the value's spelling and units: the browser drops a value it cannot read."}let w;export function watchStyles(e=3){if(w)return w;const u=[],r=new Set,c=new Map,f=new WeakMap,d=(t,n)=>CSS.supports(t,n),l={part:void 0,rejected:()=>u},p=(t,n,o,s,i=!1)=>{const a=l.part;if(a===void 0)return;const P=`${a}|${n}|${s}`;if(r.has(P))return;r.add(P);const m=c.get(a)??0;if(m>=e)return;c.set(a,m+1);const S=f.get(t);u.push({part:a,prop:n,value:o,via:s,...i?{number:!0}:{},...S?{el:S}:{}})},y=t=>{if(t==null||typeof t!="string"&&typeof t!="number")return;const n=String(t).trim();return n===""?void 0:n},h=CSSStyleDeclaration.prototype,$=Object.getOwnPropertyDescriptor(h,"cssText");if($?.set){const t=$;Object.defineProperty(h,"cssText",{...t,set(n){t.set?.call(this,n);const o=y(n);if(o!==void 0)for(const[s,i]of declarations(o))s.startsWith("--")||d(s,i)||p(this,s,i,"cssText")}})}const g=new WeakMap,x=new WeakMap,O={get(t,n){const o=Reflect.get(t,n,t);if(typeof o!="function")return o;let s=x.get(t);s||(s=new Map,x.set(t,s));let i=s.get(n);return i||(i=o.bind(t),s.set(n,i)),i},set(t,n,o){if(typeof n!="string"||n in h||/^\d+$/.test(n)||!(n in t))return Reflect.set(t,n,o,t);const s=y(o),i=s===void 0?"":t.getPropertyValue(cssName(n)),a=Reflect.set(t,n,o,t);if(s===void 0)return a;const P=cssName(n);return t.getPropertyValue(P)!==i||d(P,s)||p(t,n,s,"property",typeof o=="number"),a}};for(const t of[HTMLElement.prototype,SVGElement.prototype]){const n=Object.getOwnPropertyDescriptor(t,"style");if(!n?.get)continue;const o=n;Object.defineProperty(t,"style",{...o,get(){const s=o.get?.call(this);f.set(s,this);let i=g.get(s);return i||(i=new Proxy(s,O),g.set(s,i)),i}})}const b=h.setProperty;return h.setProperty=function(t,n,o){const s=y(n);if(s===void 0||t.startsWith("--")){b.call(this,t,n,o);return}const i=this.getPropertyValue(t),a=this.getPropertyPriority(t);b.call(this,t,n,o),!(this.getPropertyValue(t)!==i||this.getPropertyPriority(t)!==a)&&(d(t,s)||p(this,t,s,"setProperty"))},w=l,l}export function rejectedMessage(e,u){const r=(f,d)=>CSS.supports(f,d),c=e.via==="cssText"?`its cssText sets ${e.prop}: ${e.value}`:e.via==="setProperty"?`setProperty("${e.prop}", ${JSON.stringify(e.value)})`:`${/^[a-z]+$/i.test(e.prop)?e.prop:JSON.stringify(e.prop)} = ${e.number?e.value:JSON.stringify(e.value)}`;return`Part ${e.part} sets ${c}${u}, which the browser ignores: this style does not apply. ${styleHint(e,r)}`}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ColorStop, type Gradient, type LevelsChannel } from "@allyhub/piece";
|
|
2
|
+
/** A channel's function as 256 values, 0 to 1, for values 0/255 to 255/255. */
|
|
3
|
+
export type Table = number[];
|
|
4
|
+
/** The identity. */
|
|
5
|
+
export declare const identity: () => Table;
|
|
6
|
+
/** f after g, as tables. */
|
|
7
|
+
export declare function compose(f: Table, g: Table): Table;
|
|
8
|
+
/** Photoshop's Levels on one channel: inputs to [0, 1], the midtones' gamma, then the outputs' range. */
|
|
9
|
+
export declare function levelsTable(l: LevelsChannel | undefined): Table;
|
|
10
|
+
/**
|
|
11
|
+
* A curve through its points, as Photoshop draws one: a natural cubic
|
|
12
|
+
* spline through them, flat before the first and after the last, clamped
|
|
13
|
+
* to 0–255.
|
|
14
|
+
*/
|
|
15
|
+
export declare function curveTable(points: readonly (readonly [number, number])[] | undefined): Table;
|
|
16
|
+
/** Photoshop's Exposure in linear light: `(v · 2^exposure + offset)^(1/gamma)`, each value from sRGB and back. */
|
|
17
|
+
export declare function exposureTable(exposure: number, offset: number, gamma: number): Table;
|
|
18
|
+
/**
|
|
19
|
+
* Brightness/Contrast, the legacy one: the brightness added (of 255), then
|
|
20
|
+
* the values spread about the middle by tan((contrast / 100 + 1) · π/4).
|
|
21
|
+
*/
|
|
22
|
+
export declare function brightnessContrastTable(brightness: number, contrast: number): Table;
|
|
23
|
+
/**
|
|
24
|
+
* Color Balance on one channel: its amounts for the shadows, midtones and
|
|
25
|
+
* highlights (−100 to 100) added by how far the channel's value is in each
|
|
26
|
+
* range (GIMP's weights: a = 0.25, b = 0.333, scale 0.7).
|
|
27
|
+
*/
|
|
28
|
+
export declare function colorBalanceTable(shadows: number, midtones: number, highlights: number): Table;
|
|
29
|
+
/** Hue/Saturation's lightness: towards white by it when more than 0, towards black when less. */
|
|
30
|
+
export declare function lightnessTable(lightness: number): Table;
|
|
31
|
+
/** Threshold: 1 from `level` (of 255) up, else 0; a `discrete` table. */
|
|
32
|
+
export declare function thresholdTable(level: number): Table;
|
|
33
|
+
/** Invert. */
|
|
34
|
+
export declare const invertTable: () => Table;
|
|
35
|
+
/** A CSS colour's sRGB channels and alpha, 0 to 1, from hex or rgb(); undefined for any other notation. */
|
|
36
|
+
export declare function rgbOf(color: string): [number, number, number, number] | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* A gradient's stops in order, its locations shares, reversed when asked:
|
|
39
|
+
* what a table and an SVG gradient are drawn from.
|
|
40
|
+
*/
|
|
41
|
+
export declare function stopsOf(g: Gradient, reverse?: boolean): ColorStop[];
|
|
42
|
+
/**
|
|
43
|
+
* A gradient's colour at a share along it, each channel: CSS's
|
|
44
|
+
* interpolation with a colour hint (the midpoint, where the two colours are
|
|
45
|
+
* mixed half and half), in sRGB. Only hex and rgb() colours can be read
|
|
46
|
+
* here; another notation is undefined.
|
|
47
|
+
*/
|
|
48
|
+
export declare function gradientAt(stops: readonly ColorStop[], t: number): [number, number, number, number] | undefined;
|
|
49
|
+
/** A gradient as three tables (red, green, blue) along its length; undefined where a stop's colour is not hex or rgb(). */
|
|
50
|
+
export declare function gradientTables(g: Gradient, reverse?: boolean): [Table, Table, Table] | undefined;
|
|
51
|
+
/** A table as feComponentTransfer's `tableValues`. */
|
|
52
|
+
export declare const tableValues: (t: Table) => string;
|
|
53
|
+
//# sourceMappingURL=tone.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{ADJUSTMENT_DEFAULTS as b}from"@allyhub/piece";const h=t=>Math.min(Math.max(t,0),1),m=t=>Math.round(t*1e6)/1e6;export const identity=()=>Array.from({length:256},(t,o)=>o/255);export function compose(t,o){return o.map(e=>t[Math.round(h(e)*255)]??e)}export function levelsTable(t){const o=b.levels,e=(t?.inputBlack??o.inputBlack)/255,a=(t?.inputWhite??o.inputWhite)/255,s=t?.gamma??o.gamma,i=(t?.outputBlack??o.outputBlack)/255,r=(t?.outputWhite??o.outputWhite)/255;return identity().map(c=>{const l=h((c-e)/Math.max(a-e,1e-9));return m(h(i+Math.pow(l,1/s)*(r-i)))})}export function curveTable(t){if(!t||t.length<2)return identity();const o=t.map(r=>r[0]/255),e=t.map(r=>r[1]/255),a=o.length,s=new Array(a).fill(0);if(a>2){const r=new Array(a).fill(0),c=new Array(a).fill(0),l=new Array(a).fill(0),f=new Array(a).fill(0);for(let n=1;n<a-1;n++){const u=(o[n]??0)-(o[n-1]??0),p=(o[n+1]??0)-(o[n]??0);r[n]=u,c[n]=2*(u+p),l[n]=p,f[n]=6*(((e[n+1]??0)-(e[n]??0))/p-((e[n]??0)-(e[n-1]??0))/u)}for(let n=2;n<a-1;n++){const u=(r[n]??0)/(c[n-1]??1);c[n]=(c[n]??0)-u*(l[n-1]??0),f[n]=(f[n]??0)-u*(f[n-1]??0)}for(let n=a-2;n>=1;n--)s[n]=((f[n]??0)-(l[n]??0)*(s[n+1]??0))/(c[n]??1)}const i=r=>{if(r<=(o[0]??0))return e[0]??0;if(r>=(o[a-1]??1))return e[a-1]??1;let c=0;for(;c<a-2&&r>(o[c+1]??1);)c++;const l=o[c]??0,f=o[c+1]??1,n=f-l,u=(f-r)/n,p=(r-l)/n;return u*(e[c]??0)+p*(e[c+1]??0)+((u*u*u-u)*(s[c]??0)+(p*p*p-p)*(s[c+1]??0))*n*n/6};return identity().map(r=>m(h(i(r))))}const x=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),g=t=>t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055;export function exposureTable(t,o,e){return identity().map(a=>{const s=x(a)*Math.pow(2,t)+o;return m(h(g(Math.pow(Math.max(s,0),1/e))))})}export function brightnessContrastTable(t,o){const e=Math.min(Math.tan((o/100+1)*Math.PI/4),1e4);return identity().map(a=>m(h((a+t/255-.5)*e+.5)))}export function colorBalanceTable(t,o,e){return identity().map(r=>{const c=h((r-.333)/-.25+.5)*.7,l=h((r-.333)/.25+.5)*h((r+.333-1)/-.25+.5)*.7,f=h((r+.333-1)/.25+.5)*.7;return m(h(r+t/100*c+o/100*l+e/100*f))})}export function lightnessTable(t){const o=t/100;return identity().map(e=>m(o>=0?e+(1-e)*o:e*(1+o)))}export function thresholdTable(t){return identity().map((o,e)=>e>=t?1:0)}export const invertTable=()=>identity().map(t=>m(1-t));export function rgbOf(t){const o=t.trim().toLowerCase(),e=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/u.exec(o)?.[1];if(e!==void 0){const i=e.length<=4?e.split("").map(c=>c+c).join(""):e,r=c=>parseInt(i.slice(c,c+2),16)/255;return[r(0),r(2),r(4),i.length===8?r(6):1]}const a=/^rgba?\(([^)]*)\)$/u.exec(o)?.[1];if(a!==void 0){const i=a.split(/[\s,/]+/u).filter(u=>u!==""),r=(u,p)=>u===void 0?void 0:u.endsWith("%")?Number(u.slice(0,-1))/100:Number(u)/p,[c,l,f]=[r(i[0],255),r(i[1],255),r(i[2],255)],n=r(i[3],1)??1;return c===void 0||l===void 0||f===void 0||![c,l,f,n].every(Number.isFinite)?void 0:[h(c),h(l),h(f),h(n)]}return{black:[0,0,0,1],white:[1,1,1,1],transparent:[0,0,0,0]}[o]}export function stopsOf(t,o=!1){const e=[...t.stops].sort((s,i)=>s.location-i.location);return o!==(t.reverse??!1)?e.map((s,i)=>({color:s.color,location:100-s.location,midpoint:100-(e[i-1]?.midpoint??50)})).reverse():e}export function gradientAt(t,o){const e=o*100,a=t[0],s=t[t.length-1];if(!(!a||!s)){if(e<=a.location)return rgbOf(a.color);if(e>=s.location)return rgbOf(s.color);for(let i=0;i<t.length-1;i++){const r=t[i],c=t[i+1];if(!r||!c||e>c.location)continue;const l=rgbOf(r.color),f=rgbOf(c.color);if(!l||!f)return;const n=c.location-r.location;let u=n<=0?1:(e-r.location)/n;const p=(r.midpoint??50)/100;return p>0&&p<1&&p!==.5&&(u=Math.pow(u,Math.log(.5)/Math.log(p))),[0,1,2,3].map(d=>(l[d]??0)+((f[d]??0)-(l[d]??0))*u)}return rgbOf(s.color)}}export function gradientTables(t,o=!1){const e=stopsOf(t,o),a=[],s=[],i=[];for(let r=0;r<256;r++){const c=gradientAt(e,r/255);if(!c)return;a.push(m(c[0])),s.push(m(c[1])),i.push(m(c[2]))}return[a,s,i]}export const tableValues=t=>t.map(o=>String(m(o))).join(" ");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allyhub/image-draw",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./*": {
|
|
7
|
+
"types": "./dist/*.d.ts",
|
|
8
|
+
"default": "./dist/*.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"private": true,
|
|
13
|
+
"license": "SEE LICENSE IN LICENSE.md"
|
|
14
|
+
}
|