@hypit/hypit 0.0.1 → 0.1.1
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/LICENSE +26 -0
- package/README.md +142 -0
- package/bin/hypit.mjs +46 -0
- package/dist/public/artifact.d.ts +75 -0
- package/dist/public/author-kit.d.ts +559 -0
- package/dist/public/browser-capture.d.ts +56 -0
- package/dist/public/caption.d.ts +751 -0
- package/dist/public/composition.d.ts +672 -0
- package/dist/public/endpoint-kit.d.ts +366 -0
- package/dist/public/generation.d.ts +591 -0
- package/dist/public/hyperframes.d.ts +774 -0
- package/dist/public/media.d.ts +708 -0
- package/dist/public/model-kit.d.ts +523 -0
- package/dist/public/narrative.d.ts +315 -0
- package/dist/public/program-space.d.ts +193 -0
- package/dist/public/runtime-kit.d.ts +427 -0
- package/dist/public/semantic-track.d.ts +418 -0
- package/dist/public/spatial.d.ts +1193 -0
- package/dist/public/speech.d.ts +391 -0
- package/dist/public/studio-adapter.d.ts +686 -0
- package/dist/public/svs.d.ts +311 -0
- package/dist/public/temporal-markup.d.ts +343 -0
- package/dist/public/temporal.d.ts +497 -0
- package/dist/public/text.d.ts +817 -0
- package/dist/public/visual-ir.d.ts +98 -0
- package/docs/public/hypit-logo-dark.svg +36 -0
- package/docs/public/hypit-logo-light.svg +38 -0
- package/examples/README.md +24 -0
- package/examples/minimal-author-package/README.md +18 -0
- package/examples/minimal-author-package/packages/example-component/README.md +44 -0
- package/examples/minimal-author-package/packages/example-component/package.json +27 -0
- package/examples/minimal-author-package/packages/example-component/preview/Box.png +0 -0
- package/examples/minimal-author-package/packages/example-component/preview/build.svrun +6 -0
- package/examples/minimal-author-package/packages/example-component/preview/preview.svml +47 -0
- package/examples/minimal-author-package/packages/example-component/preview/recipes.svs +8 -0
- package/examples/minimal-author-package/packages/example-component/src/activation.ts +10 -0
- package/examples/minimal-author-package/packages/example-component/src/component.ts +44 -0
- package/examples/minimal-author-package/packages/example-component/src/fragment.ts +32 -0
- package/examples/minimal-author-package/packages/example-component/src/index.ts +6 -0
- package/examples/minimal-author-package/packages/example-component/src/manifest.ts +82 -0
- package/examples/minimal-author-package/packages/example-component/src/style.ts +13 -0
- package/examples/minimal-author-package/packages/example-component/src/surface.ts +41 -0
- package/examples/minimal-author-package/packages/example-component/src/temporal.ts +6 -0
- package/examples/minimal-author-package/packages/example-component/tsconfig.json +18 -0
- package/examples/semantic-composition/README.md +35 -0
- package/examples/semantic-composition/chat.svml +25 -0
- package/examples/semantic-composition/chat.svrun +6 -0
- package/examples/semantic-composition/chat.svs +4 -0
- package/examples/semantic-composition/hypit.runtime.json +8 -0
- package/examples/semantic-composition/packages/chat-scene/README.md +29 -0
- package/examples/semantic-composition/packages/chat-scene/package.json +11 -0
- package/examples/semantic-composition/packages/chat-scene/src/activation.ts +112 -0
- package/examples/semantic-composition/packages/chat-scene/src/render.ts +64 -0
- package/examples/semantic-composition/packages/chat-scene/tsconfig.json +18 -0
- package/examples/semantic-composition/packages/responsive-explainer/README.md +45 -0
- package/examples/semantic-composition/packages/responsive-explainer/package.json +11 -0
- package/examples/semantic-composition/packages/responsive-explainer/src/activation.ts +90 -0
- package/examples/semantic-composition/packages/responsive-explainer/src/render.ts +68 -0
- package/examples/semantic-composition/packages/responsive-explainer/tsconfig.json +18 -0
- package/package.json +263 -5
- package/packages/artifact/README.md +10 -0
- package/packages/artifact/package.json +16 -0
- package/packages/artifact/src/activation.ts +8 -0
- package/packages/artifact/src/index.ts +24 -0
- package/packages/audio-track/README.md +43 -0
- package/packages/audio-track/package.json +36 -0
- package/packages/audio-track/src/activation.ts +20 -0
- package/packages/audio-track/src/component.ts +40 -0
- package/packages/audio-track/src/fragment.ts +63 -0
- package/packages/audio-track/src/index.ts +7 -0
- package/packages/audio-track/src/manifest.ts +151 -0
- package/packages/audio-track/src/program.ts +254 -0
- package/packages/audio-track/src/surface.ts +187 -0
- package/packages/audio-track/src/types.ts +62 -0
- package/packages/audio-track-studio/README.md +3 -0
- package/packages/audio-track-studio/package.json +14 -0
- package/packages/audio-track-studio/src/activation.ts +7 -0
- package/packages/audio-track-studio/src/index.ts +72 -0
- package/packages/author-kit/README.md +31 -0
- package/packages/author-kit/package.json +16 -0
- package/packages/author-kit/src/index.ts +59 -0
- package/packages/background-removal/README.md +29 -0
- package/packages/background-removal/package.json +16 -0
- package/packages/background-removal/src/activation.ts +18 -0
- package/packages/background-removal/src/component.ts +32 -0
- package/packages/background-removal/src/fragment.ts +18 -0
- package/packages/background-removal/src/index.ts +6 -0
- package/packages/background-removal/src/manifest.ts +45 -0
- package/packages/background-removal/src/program.ts +19 -0
- package/packages/background-removal/src/surface.ts +27 -0
- package/packages/background-removal/src/types.ts +5 -0
- package/packages/browser-capture/README.md +82 -0
- package/packages/browser-capture/package.json +15 -0
- package/packages/browser-capture/src/browser.ts +19 -0
- package/packages/browser-capture/src/index.ts +198 -0
- package/packages/build-result/package.json +13 -0
- package/packages/build-result/src/decode.ts +286 -0
- package/packages/build-result/src/index.ts +25 -0
- package/packages/build-result/src/store.ts +505 -0
- package/packages/build-result/src/types.ts +354 -0
- package/packages/build-result/src/writer.ts +184 -0
- package/packages/build-result-fs/README.md +29 -0
- package/packages/build-result-fs/package.json +17 -0
- package/packages/build-result-fs/src/activation.ts +62 -0
- package/packages/build-result-fs/src/index.ts +1 -0
- package/packages/build-result-kit/README.md +10 -0
- package/packages/build-result-kit/package.json +15 -0
- package/packages/build-result-kit/src/index.ts +144 -0
- package/packages/build-result-s3/README.md +49 -0
- package/packages/build-result-s3/package.json +19 -0
- package/packages/build-result-s3/src/activation.ts +71 -0
- package/packages/build-result-s3/src/client.ts +254 -0
- package/packages/build-result-s3/src/index.ts +4 -0
- package/packages/build-result-s3/src/repository.ts +361 -0
- package/packages/caption/README.md +77 -0
- package/packages/caption/package.json +28 -0
- package/packages/caption/src/activation.ts +17 -0
- package/packages/caption/src/component.ts +38 -0
- package/packages/caption/src/display.ts +111 -0
- package/packages/caption/src/error.ts +9 -0
- package/packages/caption/src/fragment.ts +26 -0
- package/packages/caption/src/index.ts +33 -0
- package/packages/caption/src/manifest.ts +97 -0
- package/packages/caption/src/style.ts +170 -0
- package/packages/caption/src/surface.ts +96 -0
- package/packages/caption/src/temporalize.ts +124 -0
- package/packages/caption/src/types.ts +71 -0
- package/packages/caption-fine/README.md +108 -0
- package/packages/caption-fine/package.json +30 -0
- package/packages/caption-fine/preview/Track.png +0 -0
- package/packages/caption-fine/src/activation.ts +32 -0
- package/packages/caption-fine/src/component.ts +58 -0
- package/packages/caption-fine/src/fragment.ts +112 -0
- package/packages/caption-fine/src/index.ts +19 -0
- package/packages/caption-fine/src/manifest.ts +383 -0
- package/packages/caption-fine/src/recipe.ts +120 -0
- package/packages/caption-fine/src/render.ts +1133 -0
- package/packages/caption-fine/src/schedule.ts +126 -0
- package/packages/caption-fine/src/spacing.ts +69 -0
- package/packages/caption-fine/src/style.ts +370 -0
- package/packages/caption-fine/src/surface.ts +152 -0
- package/packages/caption-fine/src/types.ts +191 -0
- package/packages/caption-fine-studio/README.md +3 -0
- package/packages/caption-fine-studio/package.json +15 -0
- package/packages/caption-fine-studio/src/activation.ts +7 -0
- package/packages/caption-fine-studio/src/index.ts +163 -0
- package/packages/cli/README.md +51 -0
- package/packages/cli/package.json +33 -0
- package/packages/cli/src/arguments.ts +605 -0
- package/packages/cli/src/build-planning.ts +460 -0
- package/packages/cli/src/command.ts +202 -0
- package/packages/cli/src/commands/environment.ts +391 -0
- package/packages/cli/src/commands/execution.ts +321 -0
- package/packages/cli/src/commands/results.ts +187 -0
- package/packages/cli/src/commands/types.ts +9 -0
- package/packages/cli/src/distribution.ts +74 -0
- package/packages/cli/src/index.ts +30 -0
- package/packages/cli/src/machine-view.ts +28 -0
- package/packages/cli/src/main.ts +654 -0
- package/packages/cli/src/oauth.ts +228 -0
- package/packages/cli/src/observation.ts +203 -0
- package/packages/cli/src/output.ts +1007 -0
- package/packages/cli/src/paths.ts +7 -0
- package/packages/cli/src/project-context.ts +38 -0
- package/packages/cli/src/reachability.ts +91 -0
- package/packages/cli/src/result-export.ts +148 -0
- package/packages/cli/src/result-query.ts +46 -0
- package/packages/cli/src/run-file.ts +186 -0
- package/packages/cli/src/runtime-port.ts +13 -0
- package/packages/cli/src/runtime-selection.ts +94 -0
- package/packages/cli/src/runtime-view.ts +15 -0
- package/packages/cli/src/source-discovery.ts +150 -0
- package/packages/cli/src/source-packages.ts +91 -0
- package/packages/cli/src/view.ts +228 -0
- package/packages/comment-sticker/README.md +41 -0
- package/packages/comment-sticker/package.json +29 -0
- package/packages/comment-sticker/preview/Track.png +0 -0
- package/packages/comment-sticker/src/activation.ts +32 -0
- package/packages/comment-sticker/src/author.ts +148 -0
- package/packages/comment-sticker/src/component.ts +97 -0
- package/packages/comment-sticker/src/fragment.ts +124 -0
- package/packages/comment-sticker/src/index.ts +8 -0
- package/packages/comment-sticker/src/manifest.ts +373 -0
- package/packages/comment-sticker/src/program.ts +610 -0
- package/packages/comment-sticker/src/surface.ts +172 -0
- package/packages/comment-sticker/src/types.ts +109 -0
- package/packages/comment-sticker-studio/README.md +3 -0
- package/packages/comment-sticker-studio/package.json +14 -0
- package/packages/comment-sticker-studio/src/activation.ts +7 -0
- package/packages/comment-sticker-studio/src/index.ts +132 -0
- package/packages/compiler-markup-node/README.md +12 -0
- package/packages/compiler-markup-node/package.json +22 -0
- package/packages/compiler-markup-node/src/index.ts +59 -0
- package/packages/compiler-node/README.md +60 -0
- package/packages/compiler-node/package.json +25 -0
- package/packages/compiler-node/src/compiler.ts +207 -0
- package/packages/compiler-node/src/error.ts +11 -0
- package/packages/compiler-node/src/graph-query.ts +51 -0
- package/packages/compiler-node/src/index.ts +27 -0
- package/packages/compiler-node/src/modules.ts +107 -0
- package/packages/compiler-node/src/run.ts +355 -0
- package/packages/component-kit/README.md +97 -0
- package/packages/component-kit/package.json +13 -0
- package/packages/component-kit/src/index.ts +155 -0
- package/packages/composition/README.md +53 -0
- package/packages/composition/package.json +29 -0
- package/packages/composition/src/activation.ts +3 -0
- package/packages/composition/src/component.ts +10 -0
- package/packages/composition/src/index.ts +18 -0
- package/packages/composition/src/manifest.ts +13 -0
- package/packages/composition/src/schema.ts +194 -0
- package/packages/composition/src/track.ts +1403 -0
- package/packages/core/README.md +22 -0
- package/packages/core/package.json +13 -0
- package/packages/core/src/error.ts +12 -0
- package/packages/core/src/graph.ts +341 -0
- package/packages/core/src/index.ts +32 -0
- package/packages/core/src/link.ts +240 -0
- package/packages/core/src/machine.ts +60 -0
- package/packages/core/src/plan.ts +504 -0
- package/packages/core/src/reducer.ts +428 -0
- package/packages/core/src/reference.ts +25 -0
- package/packages/core/src/slice.ts +108 -0
- package/packages/credential-store-env/README.md +11 -0
- package/packages/credential-store-env/package.json +17 -0
- package/packages/credential-store-env/src/activation.ts +25 -0
- package/packages/credential-store-env/src/index.ts +23 -0
- package/packages/credential-store-os/README.md +13 -0
- package/packages/credential-store-os/package.json +22 -0
- package/packages/credential-store-os/runtime/windows-credential.ps1 +59 -0
- package/packages/credential-store-os/src/activation.ts +32 -0
- package/packages/credential-store-os/src/index.ts +2 -0
- package/packages/credential-store-os/src/store.ts +196 -0
- package/packages/deck-track/README.md +52 -0
- package/packages/deck-track/package.json +35 -0
- package/packages/deck-track/preview/DepthStack.png +0 -0
- package/packages/deck-track/src/activation.ts +32 -0
- package/packages/deck-track/src/author.ts +217 -0
- package/packages/deck-track/src/component.ts +86 -0
- package/packages/deck-track/src/fragment.ts +148 -0
- package/packages/deck-track/src/index.ts +16 -0
- package/packages/deck-track/src/lower.ts +370 -0
- package/packages/deck-track/src/manifest.ts +438 -0
- package/packages/deck-track/src/program.ts +367 -0
- package/packages/deck-track/src/surface.ts +286 -0
- package/packages/deck-track/src/types.ts +119 -0
- package/packages/deck-track-studio/README.md +3 -0
- package/packages/deck-track-studio/package.json +14 -0
- package/packages/deck-track-studio/src/activation.ts +7 -0
- package/packages/deck-track-studio/src/index.ts +134 -0
- package/packages/driver-node/README.md +23 -0
- package/packages/driver-node/package.json +18 -0
- package/packages/driver-node/src/driver.ts +616 -0
- package/packages/driver-node/src/index.ts +10 -0
- package/packages/driver-node/src/planning.ts +67 -0
- package/packages/driver-node/src/registry.ts +234 -0
- package/packages/driver-node/src/resources.ts +36 -0
- package/packages/driver-node/src/types.ts +69 -0
- package/packages/elaborator/README.md +74 -0
- package/packages/elaborator/package.json +16 -0
- package/packages/elaborator/src/author.ts +308 -0
- package/packages/elaborator/src/fragment.ts +505 -0
- package/packages/elaborator/src/frontend-facet.ts +30 -0
- package/packages/elaborator/src/index.ts +78 -0
- package/packages/elaborator/src/source.ts +608 -0
- package/packages/endpoint-kit/README.md +111 -0
- package/packages/endpoint-kit/package.json +14 -0
- package/packages/endpoint-kit/src/index.ts +488 -0
- package/packages/estimate/README.md +32 -0
- package/packages/estimate/package.json +20 -0
- package/packages/estimate/src/activation.ts +11 -0
- package/packages/estimate/src/index.ts +16 -0
- package/packages/estimate/src/manifest.ts +34 -0
- package/packages/estimate/src/policy.ts +70 -0
- package/packages/estimate/src/program.ts +196 -0
- package/packages/estimate/src/types.ts +15 -0
- package/packages/film/README.md +49 -0
- package/packages/film/package.json +34 -0
- package/packages/film/src/activation.ts +16 -0
- package/packages/film/src/component.ts +61 -0
- package/packages/film/src/fragment.ts +83 -0
- package/packages/film/src/index.ts +11 -0
- package/packages/film/src/manifest.ts +152 -0
- package/packages/film/src/program.ts +110 -0
- package/packages/film/src/recipe.ts +24 -0
- package/packages/film/src/surface.ts +146 -0
- package/packages/film/src/types.ts +26 -0
- package/packages/film-studio/package.json +16 -0
- package/packages/film-studio/src/activation.ts +8 -0
- package/packages/film-studio/src/index.ts +17 -0
- package/packages/fonts-open/README.md +77 -0
- package/packages/fonts-open/package.json +130 -0
- package/packages/fonts-open/src/activation.ts +30 -0
- package/packages/fonts-open/src/catalog.ts +317 -0
- package/packages/fonts-open/src/index.ts +13 -0
- package/packages/fonts-open/src/manifest.ts +83 -0
- package/packages/fonts-open/src/surface.ts +239 -0
- package/packages/generation/README.md +19 -0
- package/packages/generation/package.json +23 -0
- package/packages/generation/src/activation.ts +9 -0
- package/packages/generation/src/component.ts +77 -0
- package/packages/generation/src/identity.ts +80 -0
- package/packages/generation/src/index.ts +79 -0
- package/packages/generation/src/manifest.ts +65 -0
- package/packages/generation/src/mapping.ts +231 -0
- package/packages/generation/src/ports.ts +222 -0
- package/packages/generation/src/request.ts +427 -0
- package/packages/generation/src/schema.ts +62 -0
- package/packages/generation/src/types.ts +17 -0
- package/packages/gpt-image/README.md +54 -0
- package/packages/gpt-image/package.json +34 -0
- package/packages/gpt-image/src/activation.ts +39 -0
- package/packages/gpt-image/src/fragment.ts +101 -0
- package/packages/gpt-image/src/index.ts +203 -0
- package/packages/gpt-image/src/surface.ts +194 -0
- package/packages/gpt-image-kits/README.md +44 -0
- package/packages/gpt-image-kits/kits/phone-ugc-v1.svs +34 -0
- package/packages/gpt-image-kits/package.json +15 -0
- package/packages/grok-imagine/README.md +21 -0
- package/packages/grok-imagine/package.json +21 -0
- package/packages/grok-imagine/src/activation.ts +29 -0
- package/packages/grok-imagine/src/index.ts +174 -0
- package/packages/grok-imagine/src/surface.ts +149 -0
- package/packages/host/README.md +5 -0
- package/packages/host/package.json +10 -0
- package/packages/host/src/facet.ts +6 -0
- package/packages/host/src/frontend.ts +56 -0
- package/packages/host/src/index.ts +9 -0
- package/packages/hyperframes/README.md +69 -0
- package/packages/hyperframes/package.json +36 -0
- package/packages/hyperframes/src/activation.ts +8 -0
- package/packages/hyperframes/src/browser-program.ts +79 -0
- package/packages/hyperframes/src/component.ts +32 -0
- package/packages/hyperframes/src/document.ts +827 -0
- package/packages/hyperframes/src/fragment.ts +32 -0
- package/packages/hyperframes/src/index.ts +13 -0
- package/packages/hyperframes/src/manifest.ts +67 -0
- package/packages/hyperframes/src/project.ts +118 -0
- package/packages/hyperframes/src/text.ts +1179 -0
- package/packages/hyperframes/src/types.ts +38 -0
- package/packages/image-compose/README.md +25 -0
- package/packages/image-compose/package.json +18 -0
- package/packages/image-compose/src/activation.ts +21 -0
- package/packages/image-compose/src/component.ts +100 -0
- package/packages/image-compose/src/fragment.ts +54 -0
- package/packages/image-compose/src/index.ts +10 -0
- package/packages/image-compose/src/manifest.ts +119 -0
- package/packages/image-compose/src/program.ts +75 -0
- package/packages/image-compose/src/surface.ts +83 -0
- package/packages/image-compose/src/types.ts +22 -0
- package/packages/image-transform/README.md +29 -0
- package/packages/image-transform/package.json +21 -0
- package/packages/image-transform/src/activation.ts +33 -0
- package/packages/image-transform/src/component.ts +67 -0
- package/packages/image-transform/src/fragment.ts +25 -0
- package/packages/image-transform/src/index.ts +13 -0
- package/packages/image-transform/src/manifest.ts +209 -0
- package/packages/image-transform/src/program.ts +23 -0
- package/packages/image-transform/src/surface.ts +216 -0
- package/packages/image-transform/src/types.ts +20 -0
- package/packages/interview-emoji-reveal/README.md +39 -0
- package/packages/interview-emoji-reveal/package.json +23 -0
- package/packages/interview-emoji-reveal/preview/Track.png +0 -0
- package/packages/interview-emoji-reveal/src/activation.ts +14 -0
- package/packages/interview-emoji-reveal/src/component.ts +45 -0
- package/packages/interview-emoji-reveal/src/fragment.ts +62 -0
- package/packages/interview-emoji-reveal/src/index.ts +16 -0
- package/packages/interview-emoji-reveal/src/manifest.ts +174 -0
- package/packages/interview-emoji-reveal/src/program.ts +242 -0
- package/packages/interview-emoji-reveal/src/style.ts +47 -0
- package/packages/interview-emoji-reveal/src/surface.ts +110 -0
- package/packages/interview-emoji-reveal/src/types.ts +52 -0
- package/packages/markup/README.md +81 -0
- package/packages/markup/package.json +16 -0
- package/packages/markup/src/element.ts +39 -0
- package/packages/markup/src/error.ts +20 -0
- package/packages/markup/src/frontend.ts +518 -0
- package/packages/markup/src/host-facet.ts +115 -0
- package/packages/markup/src/index.ts +25 -0
- package/packages/markup/src/registry.ts +83 -0
- package/packages/markup/src/syntax.ts +271 -0
- package/packages/markup/src/types.ts +246 -0
- package/packages/media/README.md +37 -0
- package/packages/media/package.json +19 -0
- package/packages/media/src/activation.ts +38 -0
- package/packages/media/src/component.ts +16 -0
- package/packages/media/src/frame-range.ts +33 -0
- package/packages/media/src/identity.ts +227 -0
- package/packages/media/src/index.ts +15 -0
- package/packages/media/src/manifest.ts +122 -0
- package/packages/media/src/render.ts +140 -0
- package/packages/media/src/schema.ts +69 -0
- package/packages/media/src/surface.ts +150 -0
- package/packages/media/src/types.ts +121 -0
- package/packages/media-execution/README.md +28 -0
- package/packages/media-execution/package.json +17 -0
- package/packages/media-execution/src/execute.ts +1322 -0
- package/packages/media-execution/src/index.ts +16 -0
- package/packages/media-execution/src/probe.ts +315 -0
- package/packages/media-execution/src/surface.ts +286 -0
- package/packages/media-execution/src/toolchain.ts +81 -0
- package/packages/media-execution/src/webp.ts +200 -0
- package/packages/media-pipeline/README.md +113 -0
- package/packages/media-pipeline/package.json +27 -0
- package/packages/media-pipeline/src/activation.ts +47 -0
- package/packages/media-pipeline/src/audio-plan.ts +113 -0
- package/packages/media-pipeline/src/component.ts +373 -0
- package/packages/media-pipeline/src/fragment.ts +167 -0
- package/packages/media-pipeline/src/index.ts +46 -0
- package/packages/media-pipeline/src/manifest.ts +653 -0
- package/packages/media-pipeline/src/operations.ts +248 -0
- package/packages/media-pipeline/src/selection.ts +110 -0
- package/packages/media-pipeline/src/surface.ts +389 -0
- package/packages/media-pipeline/src/types.ts +175 -0
- package/packages/media-track/README.md +197 -0
- package/packages/media-track/package.json +29 -0
- package/packages/media-track/preview/Track.png +0 -0
- package/packages/media-track/preview/build.svrun +5 -0
- package/packages/media-track/preview/flush.png +0 -0
- package/packages/media-track/preview/preview.svml +47 -0
- package/packages/media-track/preview/recipes.svs +23 -0
- package/packages/media-track/preview/rounded.png +0 -0
- package/packages/media-track/src/activation.ts +20 -0
- package/packages/media-track/src/author.ts +317 -0
- package/packages/media-track/src/component.ts +162 -0
- package/packages/media-track/src/fragment.ts +57 -0
- package/packages/media-track/src/index.ts +65 -0
- package/packages/media-track/src/layers.ts +308 -0
- package/packages/media-track/src/lower.ts +335 -0
- package/packages/media-track/src/manifest.ts +624 -0
- package/packages/media-track/src/motion.ts +387 -0
- package/packages/media-track/src/performance.ts +37 -0
- package/packages/media-track/src/presentation.ts +35 -0
- package/packages/media-track/src/program.ts +565 -0
- package/packages/media-track/src/sampling.ts +118 -0
- package/packages/media-track/src/sequence.ts +403 -0
- package/packages/media-track/src/sounds.ts +71 -0
- package/packages/media-track/src/surface.ts +668 -0
- package/packages/media-track/src/types.ts +311 -0
- package/packages/media-track-studio/README.md +3 -0
- package/packages/media-track-studio/package.json +15 -0
- package/packages/media-track-studio/src/activation.ts +7 -0
- package/packages/media-track-studio/src/index.ts +235 -0
- package/packages/mimo-speech/README.md +33 -0
- package/packages/mimo-speech/package.json +21 -0
- package/packages/mimo-speech/src/activation.ts +32 -0
- package/packages/mimo-speech/src/fragment.ts +11 -0
- package/packages/mimo-speech/src/index.ts +160 -0
- package/packages/mimo-speech/src/surface.ts +193 -0
- package/packages/minimax-h3/README.md +21 -0
- package/packages/minimax-h3/package.json +21 -0
- package/packages/minimax-h3/src/activation.ts +14 -0
- package/packages/minimax-h3/src/index.ts +188 -0
- package/packages/minimax-h3/src/surface.ts +87 -0
- package/packages/model-kit/README.md +52 -0
- package/packages/model-kit/package.json +19 -0
- package/packages/model-kit/src/index.ts +728 -0
- package/packages/nano-banana/README.md +23 -0
- package/packages/nano-banana/package.json +21 -0
- package/packages/nano-banana/src/activation.ts +14 -0
- package/packages/nano-banana/src/index.ts +172 -0
- package/packages/nano-banana/src/surface.ts +120 -0
- package/packages/narrative/README.md +7 -0
- package/packages/narrative/package.json +17 -0
- package/packages/narrative/src/activation.ts +7 -0
- package/packages/narrative/src/component.ts +33 -0
- package/packages/narrative/src/identity.ts +131 -0
- package/packages/narrative/src/index.ts +11 -0
- package/packages/narrative/src/manifest.ts +30 -0
- package/packages/narrative/src/schema.ts +89 -0
- package/packages/narrative/src/types.ts +141 -0
- package/packages/package-loader-node/README.md +23 -0
- package/packages/package-loader-node/package.json +15 -0
- package/packages/package-loader-node/src/contribution.ts +97 -0
- package/packages/package-loader-node/src/distribution-resolution.ts +146 -0
- package/packages/package-loader-node/src/index.ts +27 -0
- package/packages/package-loader-node/src/loader.ts +301 -0
- package/packages/package-loader-node/src/location.ts +279 -0
- package/packages/package-loader-node/src/types.ts +60 -0
- package/packages/program-space/README.md +20 -0
- package/packages/program-space/package.json +17 -0
- package/packages/program-space/src/activation.ts +19 -0
- package/packages/program-space/src/index.ts +107 -0
- package/packages/program-space/src/surface.ts +55 -0
- package/packages/protocol/README.md +11 -0
- package/packages/protocol/package.json +10 -0
- package/packages/protocol/src/build-id.ts +52 -0
- package/packages/protocol/src/build.ts +265 -0
- package/packages/protocol/src/canonical.ts +37 -0
- package/packages/protocol/src/error.ts +11 -0
- package/packages/protocol/src/identity.ts +59 -0
- package/packages/protocol/src/index.ts +9 -0
- package/packages/protocol/src/module.ts +67 -0
- package/packages/protocol/src/value.ts +88 -0
- package/packages/provider-hyperframes-aws-lambda/README.md +30 -0
- package/packages/provider-hyperframes-aws-lambda/package.json +30 -0
- package/packages/provider-hyperframes-aws-lambda/src/activation.ts +97 -0
- package/packages/provider-hyperframes-aws-lambda/src/client.ts +114 -0
- package/packages/provider-hyperframes-aws-lambda/src/index.ts +21 -0
- package/packages/provider-hyperframes-aws-lambda/src/provider.ts +522 -0
- package/packages/provider-hyperframes-local/README.md +129 -0
- package/packages/provider-hyperframes-local/package.json +34 -0
- package/packages/provider-hyperframes-local/src/activation.ts +107 -0
- package/packages/provider-hyperframes-local/src/capture-process.ts +110 -0
- package/packages/provider-hyperframes-local/src/capture-worker.ts +17 -0
- package/packages/provider-hyperframes-local/src/capture.ts +184 -0
- package/packages/provider-hyperframes-local/src/index.ts +10 -0
- package/packages/provider-hyperframes-local/src/options.ts +19 -0
- package/packages/provider-hyperframes-local/src/output.ts +73 -0
- package/packages/provider-hyperframes-local/src/process.ts +83 -0
- package/packages/provider-hyperframes-local/src/program.ts +58 -0
- package/packages/provider-hyperframes-local/src/provider.ts +62 -0
- package/packages/provider-hyperframes-local/src/render.ts +114 -0
- package/packages/provider-hyperframes-local/src/sampling.ts +89 -0
- package/packages/provider-hypihub/README.md +143 -0
- package/packages/provider-hypihub/package.json +26 -0
- package/packages/provider-hypihub/src/activation.ts +91 -0
- package/packages/provider-hypihub/src/index.ts +2 -0
- package/packages/provider-hypihub/src/mapping.ts +145 -0
- package/packages/provider-hypihub/src/oauth.ts +113 -0
- package/packages/provider-hypihub/src/provider.ts +566 -0
- package/packages/provider-hypihub/src/routes.ts +134 -0
- package/packages/provider-hypihub/src/upload.ts +402 -0
- package/packages/provider-image-opencv-local/README.md +16 -0
- package/packages/provider-image-opencv-local/package.json +27 -0
- package/packages/provider-image-opencv-local/runtime/raster_execute.py +299 -0
- package/packages/provider-image-opencv-local/src/activation.ts +61 -0
- package/packages/provider-image-opencv-local/src/deployment.ts +68 -0
- package/packages/provider-image-opencv-local/src/index.ts +2 -0
- package/packages/provider-image-opencv-local/src/program.ts +60 -0
- package/packages/provider-image-opencv-local/src/provider.ts +155 -0
- package/packages/provider-kie/README.md +134 -0
- package/packages/provider-kie/package.json +43 -0
- package/packages/provider-kie/src/activation.ts +71 -0
- package/packages/provider-kie/src/index.ts +10 -0
- package/packages/provider-kie/src/mapping.ts +182 -0
- package/packages/provider-kie/src/provider.ts +657 -0
- package/packages/provider-kie/src/routes.ts +150 -0
- package/packages/provider-media-local/README.md +58 -0
- package/packages/provider-media-local/package.json +28 -0
- package/packages/provider-media-local/src/activation.ts +65 -0
- package/packages/provider-media-local/src/index.ts +2 -0
- package/packages/provider-media-local/src/program.ts +19 -0
- package/packages/provider-media-local/src/provider.ts +150 -0
- package/packages/provider-whisperx-local/README.md +44 -0
- package/packages/provider-whisperx-local/package.json +27 -0
- package/packages/provider-whisperx-local/src/activation.ts +93 -0
- package/packages/provider-whisperx-local/src/index.ts +5 -0
- package/packages/provider-whisperx-local/src/program.ts +157 -0
- package/packages/provider-whisperx-local/src/provider.ts +191 -0
- package/packages/provider-xiaomi-mimo/README.md +32 -0
- package/packages/provider-xiaomi-mimo/package.json +24 -0
- package/packages/provider-xiaomi-mimo/src/activation.ts +57 -0
- package/packages/provider-xiaomi-mimo/src/index.ts +5 -0
- package/packages/provider-xiaomi-mimo/src/provider.ts +214 -0
- package/packages/ranking/README.md +67 -0
- package/packages/ranking/package.json +33 -0
- package/packages/ranking/preview/Column.svg +29 -0
- package/packages/ranking/preview/TierBoard.png +0 -0
- package/packages/ranking/preview/TierBoard.svg +36 -0
- package/packages/ranking/preview/TopThree.png +0 -0
- package/packages/ranking/src/activation.ts +38 -0
- package/packages/ranking/src/component.ts +271 -0
- package/packages/ranking/src/fragment.ts +206 -0
- package/packages/ranking/src/index.ts +26 -0
- package/packages/ranking/src/manifest.ts +807 -0
- package/packages/ranking/src/render.ts +698 -0
- package/packages/ranking/src/schedule.ts +895 -0
- package/packages/ranking/src/style.ts +272 -0
- package/packages/ranking/src/surface.ts +322 -0
- package/packages/ranking/src/tier.ts +176 -0
- package/packages/ranking/src/types.ts +277 -0
- package/packages/ranking-studio/README.md +3 -0
- package/packages/ranking-studio/package.json +14 -0
- package/packages/ranking-studio/src/activation.ts +7 -0
- package/packages/ranking-studio/src/index.ts +255 -0
- package/packages/raster/README.md +7 -0
- package/packages/raster/package.json +14 -0
- package/packages/raster/src/activation.ts +7 -0
- package/packages/raster/src/index.ts +7 -0
- package/packages/raster/src/manifest.ts +14 -0
- package/packages/raster/src/program.ts +128 -0
- package/packages/raster/src/schema.ts +53 -0
- package/packages/raster/src/types.ts +61 -0
- package/packages/render-hyperframes/README.md +58 -0
- package/packages/render-hyperframes/package.json +33 -0
- package/packages/render-hyperframes/src/activation.ts +18 -0
- package/packages/render-hyperframes/src/component.ts +37 -0
- package/packages/render-hyperframes/src/fragment.ts +73 -0
- package/packages/render-hyperframes/src/index.ts +6 -0
- package/packages/render-hyperframes/src/manifest.ts +100 -0
- package/packages/render-hyperframes/src/product.ts +29 -0
- package/packages/render-hyperframes/src/surface.ts +65 -0
- package/packages/resource-store-fs/README.md +13 -0
- package/packages/resource-store-fs/package.json +14 -0
- package/packages/resource-store-fs/src/index.ts +2 -0
- package/packages/resource-store-fs/src/store.ts +154 -0
- package/packages/resource-store-s3/README.md +15 -0
- package/packages/resource-store-s3/package.json +15 -0
- package/packages/resource-store-s3/src/client.ts +138 -0
- package/packages/resource-store-s3/src/index.ts +10 -0
- package/packages/resource-store-s3/src/store.ts +258 -0
- package/packages/run/README.md +23 -0
- package/packages/run/package.json +16 -0
- package/packages/run/src/candidate.ts +33 -0
- package/packages/run/src/facet.ts +59 -0
- package/packages/run/src/frontend-facet.ts +23 -0
- package/packages/run/src/frontend.ts +62 -0
- package/packages/run/src/graph.ts +65 -0
- package/packages/run/src/index.ts +33 -0
- package/packages/run/src/registry.ts +24 -0
- package/packages/run/src/resolve.ts +213 -0
- package/packages/run/src/types.ts +147 -0
- package/packages/run-markup/README.md +60 -0
- package/packages/run-markup/package.json +22 -0
- package/packages/run-markup/src/activation.ts +10 -0
- package/packages/run-markup/src/frontend.ts +16 -0
- package/packages/run-markup/src/index.ts +5 -0
- package/packages/run-markup/src/syntax.ts +304 -0
- package/packages/runtime/README.md +39 -0
- package/packages/runtime/package.json +15 -0
- package/packages/runtime/src/capacity.ts +51 -0
- package/packages/runtime/src/catalog.ts +30 -0
- package/packages/runtime/src/credentials.ts +124 -0
- package/packages/runtime/src/environment.ts +6 -0
- package/packages/runtime/src/execution.ts +125 -0
- package/packages/runtime/src/index.ts +24 -0
- package/packages/runtime/src/operations.ts +99 -0
- package/packages/runtime/src/scheduler.ts +281 -0
- package/packages/runtime/src/submission.ts +24 -0
- package/packages/runtime/src/types.ts +157 -0
- package/packages/runtime-host-node/README.md +25 -0
- package/packages/runtime-host-node/package.json +19 -0
- package/packages/runtime-host-node/src/index.ts +421 -0
- package/packages/runtime-host-node/src/packages.ts +158 -0
- package/packages/runtime-kit/README.md +42 -0
- package/packages/runtime-kit/package.json +16 -0
- package/packages/runtime-kit/src/index.ts +307 -0
- package/packages/runtime-kit/src/request-deadline.ts +17 -0
- package/packages/runtime-local/README.md +119 -0
- package/packages/runtime-local/package.json +33 -0
- package/packages/runtime-local/src/actions.ts +20 -0
- package/packages/runtime-local/src/config.ts +1229 -0
- package/packages/runtime-local/src/control.ts +120 -0
- package/packages/runtime-local/src/credentials.ts +61 -0
- package/packages/runtime-local/src/host.ts +174 -0
- package/packages/runtime-local/src/index.ts +36 -0
- package/packages/runtime-local/src/process-control.ts +59 -0
- package/packages/runtime-local/src/process-logs.ts +33 -0
- package/packages/runtime-local/src/programs.ts +441 -0
- package/packages/runtime-local/src/result-writer.ts +246 -0
- package/packages/runtime-local/src/runtime.ts +342 -0
- package/packages/runtime-local/src/types.ts +100 -0
- package/packages/runtime-local/src/worker-process.ts +343 -0
- package/packages/runtime-local/src/worker.ts +449 -0
- package/packages/screen-overlay/README.md +17 -0
- package/packages/screen-overlay/package.json +31 -0
- package/packages/screen-overlay/preview/Track.png +0 -0
- package/packages/screen-overlay/src/activation.ts +15 -0
- package/packages/screen-overlay/src/component.ts +20 -0
- package/packages/screen-overlay/src/fragment.ts +40 -0
- package/packages/screen-overlay/src/index.ts +7 -0
- package/packages/screen-overlay/src/manifest.ts +305 -0
- package/packages/screen-overlay/src/program.ts +321 -0
- package/packages/screen-overlay/src/surface.ts +90 -0
- package/packages/screen-overlay/src/types.ts +69 -0
- package/packages/screen-overlay-studio/README.md +3 -0
- package/packages/screen-overlay-studio/package.json +14 -0
- package/packages/screen-overlay-studio/src/activation.ts +7 -0
- package/packages/screen-overlay-studio/src/index.ts +80 -0
- package/packages/script/README.md +137 -0
- package/packages/script/package.json +22 -0
- package/packages/script/src/activation.ts +20 -0
- package/packages/script/src/edit.ts +174 -0
- package/packages/script/src/error.ts +13 -0
- package/packages/script/src/format.ts +83 -0
- package/packages/script/src/index.ts +20 -0
- package/packages/script/src/lexical.ts +133 -0
- package/packages/script/src/manifest.ts +95 -0
- package/packages/script/src/narrative.ts +232 -0
- package/packages/script/src/parser.ts +850 -0
- package/packages/script/src/surface.ts +132 -0
- package/packages/script/src/types.ts +125 -0
- package/packages/script-studio/package.json +13 -0
- package/packages/script-studio/src/activation.ts +8 -0
- package/packages/script-studio/src/index.ts +61 -0
- package/packages/seedance/README.md +19 -0
- package/packages/seedance/package.json +22 -0
- package/packages/seedance/src/activation.ts +38 -0
- package/packages/seedance/src/fragment.ts +46 -0
- package/packages/seedance/src/index.ts +329 -0
- package/packages/seedance/src/surface.ts +355 -0
- package/packages/seedance-kits/README.md +153 -0
- package/packages/seedance-kits/kits/broll-v1.svs +52 -0
- package/packages/seedance-kits/kits/call-v1.svs +55 -0
- package/packages/seedance-kits/kits/camera-reference-v1.svs +9 -0
- package/packages/seedance-kits/kits/motion-reference-v1.svs +9 -0
- package/packages/seedance-kits/kits/podcast-v1.svs +55 -0
- package/packages/seedance-kits/kits/speaker-v1.svs +136 -0
- package/packages/seedance-kits/kits/street-interview-v1.svs +49 -0
- package/packages/seedance-kits/package.json +24 -0
- package/packages/seedream/README.md +21 -0
- package/packages/seedream/package.json +21 -0
- package/packages/seedream/src/activation.ts +12 -0
- package/packages/seedream/src/index.ts +162 -0
- package/packages/seedream/src/surface.ts +84 -0
- package/packages/semantic-take-adjust/package.json +21 -0
- package/packages/semantic-take-adjust/src/activation.ts +22 -0
- package/packages/semantic-take-adjust/src/component.ts +31 -0
- package/packages/semantic-take-adjust/src/fragment.ts +24 -0
- package/packages/semantic-take-adjust/src/index.ts +12 -0
- package/packages/semantic-take-adjust/src/manifest.ts +57 -0
- package/packages/semantic-take-adjust/src/program.ts +49 -0
- package/packages/semantic-take-adjust/src/surface.ts +96 -0
- package/packages/semantic-take-adjust/src/types.ts +9 -0
- package/packages/semantic-track/README.md +21 -0
- package/packages/semantic-track/package.json +22 -0
- package/packages/semantic-track/src/activation.ts +8 -0
- package/packages/semantic-track/src/component.ts +24 -0
- package/packages/semantic-track/src/identity.ts +58 -0
- package/packages/semantic-track/src/index.ts +6 -0
- package/packages/semantic-track/src/location.ts +81 -0
- package/packages/semantic-track/src/manifest.ts +38 -0
- package/packages/semantic-track/src/projection.ts +71 -0
- package/packages/semantic-track/src/types.ts +26 -0
- package/packages/source/README.md +13 -0
- package/packages/source/package.json +13 -0
- package/packages/source/src/header.ts +80 -0
- package/packages/source/src/index.ts +17 -0
- package/packages/source/src/unit.ts +38 -0
- package/packages/spatial/README.md +77 -0
- package/packages/spatial/package.json +24 -0
- package/packages/spatial/src/activation.ts +43 -0
- package/packages/spatial/src/author.ts +59 -0
- package/packages/spatial/src/component.ts +45 -0
- package/packages/spatial/src/fragment.ts +36 -0
- package/packages/spatial/src/geometry.ts +238 -0
- package/packages/spatial/src/index.ts +37 -0
- package/packages/spatial/src/manifest.ts +341 -0
- package/packages/spatial/src/region-timeline.ts +69 -0
- package/packages/spatial/src/schema.ts +47 -0
- package/packages/spatial/src/surface.ts +319 -0
- package/packages/spatial/src/types.ts +101 -0
- package/packages/speech/README.md +16 -0
- package/packages/speech/package.json +19 -0
- package/packages/speech/src/activation.ts +7 -0
- package/packages/speech/src/component.ts +43 -0
- package/packages/speech/src/identity.ts +73 -0
- package/packages/speech/src/index.ts +6 -0
- package/packages/speech/src/manifest.ts +30 -0
- package/packages/speech/src/materialize.ts +103 -0
- package/packages/speech/src/schema.ts +42 -0
- package/packages/speech/src/types.ts +54 -0
- package/packages/speech-alignment/README.md +29 -0
- package/packages/speech-alignment/package.json +25 -0
- package/packages/speech-alignment/src/activation.ts +8 -0
- package/packages/speech-alignment/src/align.ts +235 -0
- package/packages/speech-alignment/src/component.ts +37 -0
- package/packages/speech-alignment/src/error.ts +9 -0
- package/packages/speech-alignment/src/index.ts +7 -0
- package/packages/speech-alignment/src/local.ts +64 -0
- package/packages/speech-alignment/src/locate.ts +473 -0
- package/packages/speech-alignment/src/manifest.ts +37 -0
- package/packages/speech-alignment/src/normalize.ts +79 -0
- package/packages/speech-alignment/src/types.ts +30 -0
- package/packages/speech-evidence/README.md +3 -0
- package/packages/speech-evidence/package.json +16 -0
- package/packages/speech-evidence/src/activation.ts +3 -0
- package/packages/speech-evidence/src/index.ts +102 -0
- package/packages/speech-track/README.md +51 -0
- package/packages/speech-track/package.json +28 -0
- package/packages/speech-track/preview/Track.png +0 -0
- package/packages/speech-track/src/activation.ts +19 -0
- package/packages/speech-track/src/component.ts +45 -0
- package/packages/speech-track/src/fragment.ts +74 -0
- package/packages/speech-track/src/index.ts +7 -0
- package/packages/speech-track/src/manifest.ts +73 -0
- package/packages/speech-track/src/program.ts +64 -0
- package/packages/speech-track/src/surface.ts +35 -0
- package/packages/speech-track/src/types.ts +6 -0
- package/packages/speech-track-studio/README.md +3 -0
- package/packages/speech-track-studio/package.json +14 -0
- package/packages/speech-track-studio/src/activation.ts +7 -0
- package/packages/speech-track-studio/src/index.ts +40 -0
- package/packages/store-sqlite/README.md +14 -0
- package/packages/store-sqlite/package.json +18 -0
- package/packages/store-sqlite/src/index.ts +2 -0
- package/packages/store-sqlite/src/store.ts +1101 -0
- package/packages/studio/README.md +125 -0
- package/packages/studio/index.html +10 -0
- package/packages/studio/package.json +50 -0
- package/packages/studio/src/build-library.ts +281 -0
- package/packages/studio/src/companion-assembly.ts +39 -0
- package/packages/studio/src/compile.ts +166 -0
- package/packages/studio/src/domain.ts +139 -0
- package/packages/studio/src/execute.ts +57 -0
- package/packages/studio/src/fallback-companions.ts +98 -0
- package/packages/studio/src/observe.ts +202 -0
- package/packages/studio/src/parameter-values.ts +81 -0
- package/packages/studio/src/parameters.ts +550 -0
- package/packages/studio/src/preview/render.ts +51 -0
- package/packages/studio/src/preview/runtime-shim.ts +184 -0
- package/packages/studio/src/programme.ts +276 -0
- package/packages/studio/src/run.ts +85 -0
- package/packages/studio/src/server.ts +725 -0
- package/packages/studio/src/session.ts +111 -0
- package/packages/studio/src/shared.ts +315 -0
- package/packages/studio/src/snapshot.ts +454 -0
- package/packages/studio/src/source-transaction.ts +57 -0
- package/packages/studio/src/storyboard.ts +133 -0
- package/packages/studio/src/studio-preflight.ts +198 -0
- package/packages/studio/src/studio-registry.ts +406 -0
- package/packages/studio/src/studio-trace.ts +136 -0
- package/packages/studio/src/style.css +1525 -0
- package/packages/studio/src/surface-preview.ts +35 -0
- package/packages/studio/src/temporal-graph.ts +227 -0
- package/packages/studio/src/ui/code.ts +450 -0
- package/packages/studio/src/ui/icons.ts +51 -0
- package/packages/studio/src/ui/library.ts +378 -0
- package/packages/studio/src/ui/main.ts +1001 -0
- package/packages/studio/src/ui/markers.ts +152 -0
- package/packages/studio/src/ui/material-preview.ts +176 -0
- package/packages/studio/src/ui/overlay.ts +144 -0
- package/packages/studio/src/ui/resize.ts +74 -0
- package/packages/studio/src/ui/selection.ts +178 -0
- package/packages/studio/src/ui/stage.ts +231 -0
- package/packages/studio/src/ui/syntax.ts +195 -0
- package/packages/studio/src/ui/timeline.ts +1041 -0
- package/packages/studio/src/ui/writeback.ts +10 -0
- package/packages/studio/src/ui/zoom.ts +129 -0
- package/packages/studio/start.ts +143 -0
- package/packages/studio-adapter/README.md +186 -0
- package/packages/studio-adapter/package.json +14 -0
- package/packages/studio-adapter/src/index.ts +850 -0
- package/packages/svs/README.md +37 -0
- package/packages/svs/package.json +21 -0
- package/packages/svs/src/activation.ts +11 -0
- package/packages/svs/src/format.ts +16 -0
- package/packages/svs/src/frontend.ts +33 -0
- package/packages/svs/src/index.ts +5 -0
- package/packages/svs/src/manifest.ts +17 -0
- package/packages/svs/src/parser.ts +279 -0
- package/packages/svs/src/types.ts +26 -0
- package/packages/temporal/README.md +31 -0
- package/packages/temporal/package.json +20 -0
- package/packages/temporal/src/activation.ts +9 -0
- package/packages/temporal/src/component.ts +68 -0
- package/packages/temporal/src/index.ts +110 -0
- package/packages/temporal/src/location.ts +67 -0
- package/packages/temporal/src/projection.ts +280 -0
- package/packages/temporal/src/rational.ts +80 -0
- package/packages/temporal/src/sample.ts +43 -0
- package/packages/temporal/src/schedule.ts +52 -0
- package/packages/temporal/src/types.ts +124 -0
- package/packages/temporal-markup/README.md +75 -0
- package/packages/temporal-markup/package.json +18 -0
- package/packages/temporal-markup/src/index.ts +537 -0
- package/packages/temporal-markup/src/space.ts +59 -0
- package/packages/text/README.md +59 -0
- package/packages/text/package.json +21 -0
- package/packages/text/src/activation.ts +33 -0
- package/packages/text/src/component.ts +72 -0
- package/packages/text/src/fragment.ts +57 -0
- package/packages/text/src/frontend.ts +39 -0
- package/packages/text/src/index.ts +27 -0
- package/packages/text/src/manifest.ts +170 -0
- package/packages/text/src/program.ts +418 -0
- package/packages/text/src/surface.ts +212 -0
- package/packages/text/src/svs.ts +189 -0
- package/packages/text/src/types.ts +82 -0
- package/packages/transport-aws-lambda/README.md +20 -0
- package/packages/transport-aws-lambda/package.json +14 -0
- package/packages/transport-aws-lambda/src/index.ts +131 -0
- package/packages/typography-track/README.md +50 -0
- package/packages/typography-track/package.json +34 -0
- package/packages/typography-track/preview/Mask.png +0 -0
- package/packages/typography-track/preview/Track.png +0 -0
- package/packages/typography-track/src/activation.ts +36 -0
- package/packages/typography-track/src/component.ts +93 -0
- package/packages/typography-track/src/fragment.ts +30 -0
- package/packages/typography-track/src/index.ts +11 -0
- package/packages/typography-track/src/manifest.ts +556 -0
- package/packages/typography-track/src/program.ts +622 -0
- package/packages/typography-track/src/surface.ts +842 -0
- package/packages/typography-track/src/types.ts +109 -0
- package/packages/typography-track-studio/README.md +3 -0
- package/packages/typography-track-studio/package.json +14 -0
- package/packages/typography-track-studio/src/activation.ts +7 -0
- package/packages/typography-track-studio/src/index.ts +116 -0
- package/packages/validation/README.md +11 -0
- package/packages/validation/package.json +15 -0
- package/packages/validation/src/index.ts +100 -0
- package/packages/video-cli/README.md +181 -0
- package/packages/video-cli/package.json +37 -0
- package/packages/video-cli/src/capture.ts +174 -0
- package/packages/video-cli/src/cli.ts +109 -0
- package/packages/video-cli/src/compiler.ts +32 -0
- package/packages/video-cli/src/creation.ts +449 -0
- package/packages/video-cli/src/distribution.ts +88 -0
- package/packages/video-cli/src/index.ts +50 -0
- package/packages/video-cli/src/media.ts +701 -0
- package/packages/video-cli/src/package-selection.ts +34 -0
- package/packages/video-cli/src/process.ts +71 -0
- package/packages/video-cli/src/studio-distribution.ts +19 -0
- package/packages/video-cli/src/transcript.ts +71 -0
- package/packages/video-cli/src/vocabulary.ts +386 -0
- package/packages/visual-ir/README.md +36 -0
- package/packages/visual-ir/package.json +16 -0
- package/packages/visual-ir/src/activation.ts +3 -0
- package/packages/visual-ir/src/index.ts +7 -0
- package/packages/visual-ir/src/style.ts +222 -0
- package/packages/volcengine-matting/README.md +89 -0
- package/packages/volcengine-matting/package.json +16 -0
- package/packages/volcengine-matting/src/activation.ts +13 -0
- package/packages/volcengine-matting/src/index.ts +45 -0
- package/packages/volcengine-matting/src/surface.ts +48 -0
- package/packages/whisperx/README.md +34 -0
- package/packages/whisperx/package.json +28 -0
- package/packages/whisperx/src/activation.ts +18 -0
- package/packages/whisperx/src/component.ts +64 -0
- package/packages/whisperx/src/evidence.ts +69 -0
- package/packages/whisperx/src/fragment.ts +76 -0
- package/packages/whisperx/src/index.ts +14 -0
- package/packages/whisperx/src/manifest.ts +92 -0
- package/packages/whisperx/src/surface.ts +90 -0
- package/packages/whisperx/src/transcript.ts +97 -0
- package/packages/whisperx/src/types.ts +9 -0
- package/packages/workspace/README.md +4 -0
- package/packages/workspace/package.json +14 -0
- package/packages/workspace/src/index.ts +38 -0
- package/packages/workspace-fs-node/README.md +13 -0
- package/packages/workspace-fs-node/package.json +15 -0
- package/packages/workspace-fs-node/src/index.ts +6 -0
- package/packages/workspace-fs-node/src/workspace.ts +226 -0
- package/packages/yt-dlp/README.md +31 -0
- package/packages/yt-dlp/package.json +10 -0
- package/packages/yt-dlp/src/download.ts +104 -0
- package/packages/yt-dlp/src/index.ts +1 -0
- package/services/image-opencv/README.md +33 -0
- package/services/image-opencv/package.json +14 -0
- package/services/image-opencv/pyproject.toml +13 -0
- package/services/image-opencv/uv.lock +56 -0
- package/services/whisperx/README.md +82 -0
- package/services/whisperx/package.json +15 -0
- package/services/whisperx/pyproject.toml +26 -0
- package/services/whisperx/src/hypit_whisperx_service/__init__.py +6 -0
- package/services/whisperx/src/hypit_whisperx_service/__main__.py +29 -0
- package/services/whisperx/src/hypit_whisperx_service/application.py +88 -0
- package/services/whisperx/src/hypit_whisperx_service/audio.py +66 -0
- package/services/whisperx/src/hypit_whisperx_service/check.py +35 -0
- package/services/whisperx/src/hypit_whisperx_service/config.py +81 -0
- package/services/whisperx/src/hypit_whisperx_service/engine.py +173 -0
- package/services/whisperx/src/hypit_whisperx_service/prepare.py +19 -0
- package/services/whisperx/src/hypit_whisperx_service/resources.py +41 -0
- package/services/whisperx/src/hypit_whisperx_service/server.py +101 -0
- package/services/whisperx/uv.lock +3381 -0
- package/services/yt-dlp/README.md +19 -0
- package/services/yt-dlp/package.json +14 -0
- package/services/yt-dlp/pyproject.toml +13 -0
- package/services/yt-dlp/uv.lock +23 -0
- package/index.js +0 -1
|
@@ -0,0 +1,1001 @@
|
|
|
1
|
+
import type { Clip, StudioFailure, StudioInspectorDomain, StudioSnapshot } from "../shared.js";
|
|
2
|
+
import type { CanonicalValue, ValueSchema } from "@hypit/protocol";
|
|
3
|
+
import { validateParameterValue } from "../parameter-values.js";
|
|
4
|
+
import { createCodePane } from "./code.js";
|
|
5
|
+
import { icon } from "./icons.js";
|
|
6
|
+
import { createLibraryPane } from "./library.js";
|
|
7
|
+
import { createHandle } from "./resize.js";
|
|
8
|
+
import type { Highlight } from "./code.js";
|
|
9
|
+
import { intentAtOffset, spanAtOffset } from "./markers.js";
|
|
10
|
+
import { clipAtOffset, createStore } from "./selection.js";
|
|
11
|
+
import { createStage } from "./stage.js";
|
|
12
|
+
import { applyStudioMutation } from "./writeback.js";
|
|
13
|
+
import { createTimeline } from "./timeline.js";
|
|
14
|
+
import "../style.css";
|
|
15
|
+
|
|
16
|
+
const app = document.querySelector<HTMLElement>("#app")!;
|
|
17
|
+
app.innerHTML = `
|
|
18
|
+
<header class="topbar">
|
|
19
|
+
<div class="brand" aria-label="Hypit">
|
|
20
|
+
<span class="brand-mark" aria-hidden="true">
|
|
21
|
+
<svg class="brand-symbol" viewBox="50 180 262 234" preserveAspectRatio="xMidYMid meet">
|
|
22
|
+
<path fill="currentColor" d="M303.78,277.82c-5.98-8.63-15.83-13.77-26.32-13.77h-93.41c-12.28,0-24.92,7.44-29.6,18.8l-28.26,75.82c-4.6,11.25-4.54,24.05,2.22,34.16,6.79,10.15,19.36,16.15,31.57,16.15h85.98c14.12,0,26.9-8.88,31.84-22.1l29.69-79.57c3.67-9.84,2.29-20.86-3.69-29.48v-.02h-.02ZM252.02,377.25c-.94,2.52-3.39,4.22-6.08,4.22h-83.45c-4.34,0-6.68-2.8-7.49-3.99s-2.5-4.43-.84-8.44l23.85-66.24c2.29-6.35,8.08-10.87,14.82-11.22.33-.02.67-.02,1.02-.02h75.41s12.51,1.42,9.29,14.61l-26.53,71.09h0ZM106.85,361.73s-22.36-11.59-17.66-32.66l29.67-82.23c4.78-13.25,17.36-22.09,31.45-22.09h95.02c6.25,0,12.1,3.03,15.71,8.14l13.89,19.68h-112.97c-8.7,0-16.49,5.41-19.52,13.57l-35.59,95.6h0ZM73.3,323.27s-22.37-11.59-17.66-32.66l29.67-82.23c4.79-13.25,17.37-22.09,31.45-22.09h89.91c6.25,0,12.1,3.03,15.71,8.14l13.89,19.68h-107.84c-8.7,0-16.49,5.41-19.52,13.57l-35.59,95.6h-.02Z"/>
|
|
23
|
+
</svg>
|
|
24
|
+
<svg class="brand-wordmark" viewBox="370 228 422 180" preserveAspectRatio="xMinYMid meet">
|
|
25
|
+
<g fill="currentColor">
|
|
26
|
+
<rect x="692.47" y="276.19" width="19.22" height="90.09" rx="4.12" ry="4.12"/>
|
|
27
|
+
<path d="M462.31,293.32c-4.51-11.11-12.93-15.68-28.26-17.66-15.52-2-31.17,1.58-36.41,2.96v-38.42c0-2.22-1.8-4.02-4.02-4.02h-11.19c-2.22,0-4.02,1.8-4.02,4.02v123.26c0,2.22,1.8,4.02,4.02,4.02h11.19c2.22,0,4.02-1.8,4.02-4.02v-66.25c3.68-1.46,16.84-6.13,30.89-4.57,12.12,1.35,15.81,10.13,16.92,14.75.32,1.33.47,2.68.47,4.03v53.36c0,1.49,1.2,2.68,2.68,2.68h13.65c1.49,0,2.68-1.2,2.68-2.68v-57.38c0-4.82-.82-9.63-2.63-14.09h.01Z"/>
|
|
28
|
+
<path d="M568.55,346.34v-67.42c0-1.57-1.27-2.85-2.85-2.85h-14.66c-1.57,0-2.85,1.27-2.85,2.85v64.51c0,.58-.19,1.16-.58,1.6-1.62,1.88-7.33,6.23-25.19,5.92-2.22.05-6.37-.58-8.51-1.13-14.03-3.61-12.62-17.41-12.62-33.16v-37.73c0-1.57-1.27-2.85-2.85-2.85h-13.68c-1.57,0-2.85,1.27-2.85,2.85v57.63s-2.72,24.49,25.91,30.92c0,0,3.11.67,7.45,1.01h-.02s.13,0,.38.03c.07,0,.15,0,.23.02.19.02.42.02.69.04.25.02.51.02.77.04,2.94.14,8.59.25,14.08-.44h-.05c6.97-.77,13.42-2.51,17.37-5.02,0,0-1.77,20.45-18.82,23.73-9.86,1.13-24.24-.46-31.62-1.65-2.22-.36-4.33,1.06-4.84,3.24l-2.55,10.92c-.49,2.08.99,4.09,3.1,4.28,7.44.63,23.6,1.84,34.54,1.37,14.62-.61,26.8-6.24,34.06-21.17,7.26-14.93,5.93-37.54,5.93-37.54h.03Z"/>
|
|
29
|
+
<path d="M674.19,297.63c-8.46-21.2-28.09-21.76-37.64-22.58-7.78-.66-37.08.93-47.69,1.54-2.17.13-3.86,1.92-3.86,4.1v119.88c0,1.74,1.41,3.14,3.14,3.14h14.17c1.74,0,3.14-1.41,3.14-3.14v-34.16c45.01,4.23,52.91-1.5,60.82-8.86,8.8-8.2,15.13-37.91,7.91-59.92h.01ZM656.46,330.82c-.27,4.64-1.91,18-19.5,19.22-17.59,1.23-31.5-2.32-31.5-2.32v-54.21c4.62-.18,16.65-.61,25.09-.61,10.64,0,15.27,1.5,21.82,8.32s4.37,24.96,4.09,29.59h0Z"/>
|
|
30
|
+
<path d="M784.34,292.92c1.41,0,2.56-1.15,2.56-2.56v-11.6c0-1.41-1.15-2.56-2.56-2.56h-27.3v-19.11c0-1.32-1.07-2.38-2.38-2.38h-14.87c-1.32,0-2.38,1.07-2.38,2.38v19.11h-10.74c-1.41,0-2.56,1.15-2.56,2.56v11.6c0,1.41,1.15,2.56,2.56,2.56h10.74v48.61c0,14.46,11.72,26.19,26.19,26.19h19.46c2.13,0,3.86-1.73,3.86-3.86v-9.69c0-2.13-1.73-3.86-3.86-3.86h-13.53c-6.9,0-12.48-5.59-12.48-12.48v-44.92h27.3-.01Z"/>
|
|
31
|
+
</g>
|
|
32
|
+
<circle fill="#e83f5f" cx="703.1" cy="250.37" r="14.18"/>
|
|
33
|
+
</svg>
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="project-title" data-project></div>
|
|
37
|
+
<div class="topbar-right">
|
|
38
|
+
<div class="meta" data-meta></div>
|
|
39
|
+
<div class="status" data-status></div>
|
|
40
|
+
</div>
|
|
41
|
+
</header>
|
|
42
|
+
<main class="studio-shell">
|
|
43
|
+
<section class="upper-shell">
|
|
44
|
+
<aside class="source-panel" data-library></aside>
|
|
45
|
+
<div class="preview-panel" data-stage></div>
|
|
46
|
+
<aside class="workspace-panel">
|
|
47
|
+
<div class="pane-heading workspace-heading" data-workspace-heading>
|
|
48
|
+
<div class="pane-title">${icon("tune")}<h2>Properties</h2></div>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="workspace-scroll">
|
|
51
|
+
<section class="workspace-section">
|
|
52
|
+
<div class="inspector" data-inspector></div>
|
|
53
|
+
</section>
|
|
54
|
+
</div>
|
|
55
|
+
</aside>
|
|
56
|
+
</section>
|
|
57
|
+
<div class="timeline-panel" data-timeline></div>
|
|
58
|
+
</main>
|
|
59
|
+
<pre class="failure" data-failure></pre>`;
|
|
60
|
+
|
|
61
|
+
const store = createStore();
|
|
62
|
+
const code = createCodePane();
|
|
63
|
+
const library = createLibraryPane(code);
|
|
64
|
+
const timeline = createTimeline(store);
|
|
65
|
+
const stage = createStage(store);
|
|
66
|
+
app.querySelector<HTMLElement>("[data-library]")!.append(library.element);
|
|
67
|
+
app.querySelector<HTMLElement>("[data-timeline]")!.append(timeline.element);
|
|
68
|
+
app.querySelector<HTMLElement>("[data-stage]")!.append(stage.element);
|
|
69
|
+
|
|
70
|
+
// The source, picture, workspace and timeline all need different amounts of
|
|
71
|
+
// room for different jobs, so each boundary is draggable and remembered.
|
|
72
|
+
const shell = app.querySelector<HTMLElement>(".studio-shell")!;
|
|
73
|
+
const upperShell = app.querySelector<HTMLElement>(".upper-shell")!;
|
|
74
|
+
const workspacePanel = app.querySelector<HTMLElement>(".workspace-panel")!;
|
|
75
|
+
const sourceHandle = createHandle({
|
|
76
|
+
axis: "column", initial: Math.round(window.innerWidth * 0.34), minimum: 280,
|
|
77
|
+
maximum: () => Math.max(360, upperShell.clientWidth - 720),
|
|
78
|
+
apply: (size) => { upperShell.style.setProperty("--source-width", `${size}px`); },
|
|
79
|
+
remember: "hypit-studio.v3.source-width",
|
|
80
|
+
});
|
|
81
|
+
sourceHandle.classList.add("source-handle");
|
|
82
|
+
upperShell.insertBefore(sourceHandle, app.querySelector<HTMLElement>("[data-stage]")!);
|
|
83
|
+
const workspaceHandle = createHandle({
|
|
84
|
+
axis: "column", initial: Math.round(window.innerWidth * 0.22), minimum: 270, invert: true,
|
|
85
|
+
maximum: () => Math.max(320, upperShell.clientWidth - 680),
|
|
86
|
+
apply: (size) => { upperShell.style.setProperty("--workspace-width", `${size}px`); },
|
|
87
|
+
remember: "hypit-studio.v3.workspace-width",
|
|
88
|
+
});
|
|
89
|
+
workspaceHandle.classList.add("workspace-handle");
|
|
90
|
+
upperShell.insertBefore(workspaceHandle, workspacePanel);
|
|
91
|
+
shell.insertBefore(createHandle({
|
|
92
|
+
axis: "row", initial: Math.round(window.innerHeight * 0.45), minimum: 220, invert: true,
|
|
93
|
+
maximum: () => Math.max(260, shell.clientHeight - 260),
|
|
94
|
+
apply: (size) => { shell.style.setProperty("--timeline-height", `${size}px`); },
|
|
95
|
+
remember: "hypit-studio.v3.timeline-height",
|
|
96
|
+
}), app.querySelector<HTMLElement>("[data-timeline]")!);
|
|
97
|
+
const inspector = app.querySelector<HTMLElement>("[data-inspector]")!;
|
|
98
|
+
const workspaceHeading = app.querySelector<HTMLElement>("[data-workspace-heading]")!;
|
|
99
|
+
const meta = app.querySelector<HTMLElement>("[data-meta]")!;
|
|
100
|
+
const project = app.querySelector<HTMLElement>("[data-project]")!;
|
|
101
|
+
const status = app.querySelector<HTMLElement>("[data-status]")!;
|
|
102
|
+
const failureView = app.querySelector<HTMLElement>("[data-failure]")!;
|
|
103
|
+
|
|
104
|
+
timeline.element.addEventListener("studio:write", (event) => {
|
|
105
|
+
const state = (event as CustomEvent<{ readonly state?: string }>).detail.state;
|
|
106
|
+
status.className = state === "error" ? "status error" : state === "saved" ? "status saved" : "status saving";
|
|
107
|
+
status.textContent = state === "error" ? "Save failed" : state === "saved" ? "Saved" : "Saving";
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Program-level facts never change while a Source is being read, so they live in
|
|
111
|
+
// the header rather than taking a panel that would have to sit over something.
|
|
112
|
+
function renderMeta(snapshot: StudioSnapshot): void {
|
|
113
|
+
project.textContent = snapshot.source.path.split(/[\\/]/u).at(-1) ?? snapshot.source.path;
|
|
114
|
+
project.title = snapshot.source.path;
|
|
115
|
+
// Sequence facts belong to the project/inspector, not the application chrome.
|
|
116
|
+
// The timeline transport is the single persistent time readout.
|
|
117
|
+
meta.textContent = "";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function property(label: string, value: string, tone?: string): HTMLElement {
|
|
121
|
+
const node = document.createElement("div");
|
|
122
|
+
node.className = `property${tone === undefined ? "" : ` ${tone}`}`;
|
|
123
|
+
node.innerHTML = "<span></span><strong></strong>";
|
|
124
|
+
node.querySelector("span")!.textContent = label;
|
|
125
|
+
node.querySelector("strong")!.textContent = value;
|
|
126
|
+
node.querySelector("strong")!.title = value;
|
|
127
|
+
return node;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function group(label: string, items: readonly HTMLElement[], className = ""): HTMLElement {
|
|
131
|
+
const node = document.createElement("section");
|
|
132
|
+
node.className = `property-group${className.length === 0 ? "" : ` ${className}`}`;
|
|
133
|
+
const heading = document.createElement("h3");
|
|
134
|
+
heading.textContent = label;
|
|
135
|
+
const content = document.createElement("div");
|
|
136
|
+
content.className = "property-grid";
|
|
137
|
+
content.append(...items);
|
|
138
|
+
node.append(heading, content);
|
|
139
|
+
return node;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function aspectRatio(width: number, height: number): string {
|
|
143
|
+
let a = width;
|
|
144
|
+
let b = height;
|
|
145
|
+
while (b !== 0) [a, b] = [b, a % b];
|
|
146
|
+
return `${width / a}:${height / a}`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const domainPresentation: Readonly<Record<StudioInspectorDomain, { readonly label: string; readonly icon: string }>> = {
|
|
150
|
+
where: { label: "Where", icon: "where" },
|
|
151
|
+
how: { label: "How", icon: "how" },
|
|
152
|
+
when: { label: "When", icon: "when" },
|
|
153
|
+
};
|
|
154
|
+
const domainOrder: readonly StudioInspectorDomain[] = ["where", "how", "when"];
|
|
155
|
+
const inspectorDomainByEntity = new Map<string, StudioInspectorDomain>();
|
|
156
|
+
const inspectorPageByEntity = new Map<string, string>();
|
|
157
|
+
|
|
158
|
+
function defaultWorkspaceHeading(): void {
|
|
159
|
+
workspaceHeading.className = "pane-heading workspace-heading";
|
|
160
|
+
workspaceHeading.innerHTML = `<div class="pane-title">${icon("tune")}<h2>Properties</h2></div>`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function inspectorHeading(
|
|
164
|
+
entityId: string,
|
|
165
|
+
domains: readonly StudioInspectorDomain[],
|
|
166
|
+
active: StudioInspectorDomain,
|
|
167
|
+
select: (domain: StudioInspectorDomain) => void,
|
|
168
|
+
): void {
|
|
169
|
+
workspaceHeading.className = "pane-heading workspace-heading inspector-domain-tabs";
|
|
170
|
+
workspaceHeading.replaceChildren(...domains.map((domain) => {
|
|
171
|
+
const presentation = domainPresentation[domain];
|
|
172
|
+
const button = document.createElement("button");
|
|
173
|
+
button.type = "button";
|
|
174
|
+
button.className = `inspector-domain-tab${domain === active ? " active" : ""}`;
|
|
175
|
+
button.dataset.domain = domain;
|
|
176
|
+
button.innerHTML = `${icon(presentation.icon)}<strong>${presentation.label}</strong>`;
|
|
177
|
+
button.setAttribute("aria-pressed", String(domain === active));
|
|
178
|
+
button.addEventListener("click", () => {
|
|
179
|
+
inspectorDomainByEntity.set(entityId, domain);
|
|
180
|
+
select(domain);
|
|
181
|
+
});
|
|
182
|
+
return button;
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function sameValue(left: CanonicalValue, right: CanonicalValue): boolean {
|
|
187
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function textValue(value: CanonicalValue): string {
|
|
191
|
+
return typeof value === "string" ? value : value === null ? "" : String(value);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function commitControl(entityId: string, parameter: Clip["inspector"][number], replacement: CanonicalValue): void {
|
|
195
|
+
if (sameValue(replacement, parameter.value)) return;
|
|
196
|
+
void writeParameter(entityId, parameter, replacement);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let openColorPicker: {
|
|
200
|
+
readonly root: HTMLElement;
|
|
201
|
+
readonly close: () => void;
|
|
202
|
+
} | undefined;
|
|
203
|
+
|
|
204
|
+
document.addEventListener("click", (event) => {
|
|
205
|
+
if (openColorPicker === undefined || !(event.target instanceof Node)) return;
|
|
206
|
+
if (!openColorPicker.root.contains(event.target)) openColorPicker.close();
|
|
207
|
+
}, true);
|
|
208
|
+
|
|
209
|
+
document.addEventListener("keydown", (event) => {
|
|
210
|
+
if (event.key !== "Escape" || openColorPicker === undefined) return;
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
event.stopPropagation();
|
|
213
|
+
openColorPicker.close();
|
|
214
|
+
}, true);
|
|
215
|
+
|
|
216
|
+
function selectControl(
|
|
217
|
+
entityId: string,
|
|
218
|
+
parameter: Clip["inspector"][number],
|
|
219
|
+
): HTMLElement {
|
|
220
|
+
const control = document.createElement("div");
|
|
221
|
+
control.className = "parameter-select parameter-control";
|
|
222
|
+
const trigger = document.createElement("button");
|
|
223
|
+
trigger.type = "button";
|
|
224
|
+
trigger.className = "parameter-select-trigger";
|
|
225
|
+
trigger.setAttribute("aria-label", parameter.label);
|
|
226
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
227
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
228
|
+
const selected = document.createElement("span");
|
|
229
|
+
selected.className = "parameter-select-value";
|
|
230
|
+
const current = textValue(parameter.value);
|
|
231
|
+
selected.textContent = current;
|
|
232
|
+
const chevron = document.createElement("span");
|
|
233
|
+
chevron.className = "parameter-select-chevron";
|
|
234
|
+
chevron.innerHTML = icon("chevron");
|
|
235
|
+
trigger.append(selected, chevron);
|
|
236
|
+
|
|
237
|
+
const menu = document.createElement("div");
|
|
238
|
+
menu.className = "parameter-select-menu";
|
|
239
|
+
menu.id = `${parameter.id}:options`;
|
|
240
|
+
menu.setAttribute("role", "listbox");
|
|
241
|
+
menu.setAttribute("aria-label", parameter.label);
|
|
242
|
+
menu.hidden = true;
|
|
243
|
+
trigger.setAttribute("aria-controls", menu.id);
|
|
244
|
+
|
|
245
|
+
const options = (parameter.options ?? []).map((option) => {
|
|
246
|
+
const item = document.createElement("button");
|
|
247
|
+
item.type = "button";
|
|
248
|
+
item.className = `parameter-select-option${option === current ? " active" : ""}`;
|
|
249
|
+
item.textContent = option;
|
|
250
|
+
item.setAttribute("role", "option");
|
|
251
|
+
item.setAttribute("aria-selected", String(option === current));
|
|
252
|
+
item.addEventListener("click", () => {
|
|
253
|
+
selected.textContent = option;
|
|
254
|
+
for (const sibling of options) {
|
|
255
|
+
sibling.classList.toggle("active", sibling === item);
|
|
256
|
+
sibling.setAttribute("aria-selected", String(sibling === item));
|
|
257
|
+
}
|
|
258
|
+
close(false);
|
|
259
|
+
trigger.focus();
|
|
260
|
+
commitControl(entityId, parameter, option);
|
|
261
|
+
});
|
|
262
|
+
return item;
|
|
263
|
+
});
|
|
264
|
+
menu.append(...options);
|
|
265
|
+
|
|
266
|
+
const close = (restoreFocus: boolean): void => {
|
|
267
|
+
control.classList.remove("open", "open-up");
|
|
268
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
269
|
+
menu.hidden = true;
|
|
270
|
+
if (restoreFocus) trigger.focus();
|
|
271
|
+
};
|
|
272
|
+
const open = (focus: "selected" | "first" | "last" = "selected"): void => {
|
|
273
|
+
control.classList.add("open");
|
|
274
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
275
|
+
menu.hidden = false;
|
|
276
|
+
control.classList.remove("open-up");
|
|
277
|
+
const scroll = control.closest<HTMLElement>(".workspace-scroll");
|
|
278
|
+
if (scroll !== null) {
|
|
279
|
+
const menuBox = menu.getBoundingClientRect();
|
|
280
|
+
const scrollBox = scroll.getBoundingClientRect();
|
|
281
|
+
if (menuBox.bottom > scrollBox.bottom && trigger.getBoundingClientRect().top - menuBox.height >= scrollBox.top) {
|
|
282
|
+
control.classList.add("open-up");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const target = focus === "first" ? options[0]
|
|
286
|
+
: focus === "last" ? options.at(-1)
|
|
287
|
+
: options.find((option) => option.classList.contains("active")) ?? options[0];
|
|
288
|
+
target?.focus();
|
|
289
|
+
};
|
|
290
|
+
const moveOptionFocus = (offset: number): void => {
|
|
291
|
+
const current = options.indexOf(document.activeElement as HTMLButtonElement);
|
|
292
|
+
const next = current < 0 ? 0 : (current + offset + options.length) % options.length;
|
|
293
|
+
options[next]?.focus();
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
trigger.addEventListener("click", () => {
|
|
297
|
+
if (control.classList.contains("open")) close(false);
|
|
298
|
+
else open();
|
|
299
|
+
});
|
|
300
|
+
trigger.addEventListener("keydown", (event) => {
|
|
301
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
302
|
+
event.preventDefault();
|
|
303
|
+
event.stopPropagation();
|
|
304
|
+
open(event.key === "ArrowDown" ? "first" : "last");
|
|
305
|
+
} else if (event.key === "Escape" && control.classList.contains("open")) {
|
|
306
|
+
event.preventDefault();
|
|
307
|
+
event.stopPropagation();
|
|
308
|
+
close(false);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
menu.addEventListener("keydown", (event) => {
|
|
312
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
313
|
+
event.preventDefault();
|
|
314
|
+
event.stopPropagation();
|
|
315
|
+
moveOptionFocus(event.key === "ArrowDown" ? 1 : -1);
|
|
316
|
+
} else if (event.key === "Home" || event.key === "End") {
|
|
317
|
+
event.preventDefault();
|
|
318
|
+
event.stopPropagation();
|
|
319
|
+
options[event.key === "Home" ? 0 : options.length - 1]?.focus();
|
|
320
|
+
} else if (event.key === "Escape") {
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
event.stopPropagation();
|
|
323
|
+
close(true);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
control.addEventListener("focusout", (event) => {
|
|
327
|
+
if (event.relatedTarget instanceof Node && control.contains(event.relatedTarget)) return;
|
|
328
|
+
close(false);
|
|
329
|
+
});
|
|
330
|
+
control.append(trigger, menu);
|
|
331
|
+
return control;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function colorValueControl(
|
|
335
|
+
label: string,
|
|
336
|
+
initial: string,
|
|
337
|
+
change: (value: string) => void,
|
|
338
|
+
draft = false,
|
|
339
|
+
): HTMLElement {
|
|
340
|
+
const field = document.createElement("span");
|
|
341
|
+
field.className = "parameter-color-field";
|
|
342
|
+
const colorControl = document.createElement("span");
|
|
343
|
+
colorControl.className = "parameter-color";
|
|
344
|
+
colorControl.dataset.open = "false";
|
|
345
|
+
const swatch = document.createElement("span");
|
|
346
|
+
swatch.className = "parameter-color-swatch";
|
|
347
|
+
const picker = document.createElement("input");
|
|
348
|
+
picker.type = "color";
|
|
349
|
+
picker.className = "parameter-color-native";
|
|
350
|
+
picker.setAttribute("aria-label", `${label} picker`);
|
|
351
|
+
picker.title = label;
|
|
352
|
+
const exact = /^#[0-9a-f]{6}(?:[0-9a-f]{2})?$/iu.test(initial);
|
|
353
|
+
picker.value = exact ? initial.slice(0, 7) : "#000000";
|
|
354
|
+
swatch.style.background = exact ? initial : "transparent";
|
|
355
|
+
const value = document.createElement("input");
|
|
356
|
+
value.type = "text";
|
|
357
|
+
value.className = "parameter-value parameter-color-value";
|
|
358
|
+
value.value = initial;
|
|
359
|
+
value.setAttribute("aria-label", label);
|
|
360
|
+
value.spellcheck = false;
|
|
361
|
+
const alpha = exact && initial.length === 9 ? initial.slice(7) : "";
|
|
362
|
+
const replacement = (): string => `${picker.value.toUpperCase()}${alpha}`;
|
|
363
|
+
const close = (): void => {
|
|
364
|
+
if (openColorPicker?.root === colorControl) openColorPicker = undefined;
|
|
365
|
+
colorControl.dataset.open = "false";
|
|
366
|
+
picker.blur();
|
|
367
|
+
};
|
|
368
|
+
picker.addEventListener("click", (event) => {
|
|
369
|
+
if (openColorPicker?.root === colorControl) {
|
|
370
|
+
event.preventDefault();
|
|
371
|
+
close();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
openColorPicker?.close();
|
|
375
|
+
openColorPicker = { root: colorControl, close };
|
|
376
|
+
colorControl.dataset.open = "true";
|
|
377
|
+
});
|
|
378
|
+
picker.addEventListener("input", () => {
|
|
379
|
+
swatch.style.background = picker.value;
|
|
380
|
+
value.value = replacement();
|
|
381
|
+
if (draft) change(replacement());
|
|
382
|
+
});
|
|
383
|
+
picker.addEventListener("change", () => {
|
|
384
|
+
const next = replacement();
|
|
385
|
+
swatch.style.background = picker.value;
|
|
386
|
+
value.value = next;
|
|
387
|
+
close();
|
|
388
|
+
change(next);
|
|
389
|
+
});
|
|
390
|
+
value.addEventListener(draft ? "input" : "change", () => {
|
|
391
|
+
const next = value.value.trim();
|
|
392
|
+
swatch.style.background = /^#[0-9a-f]{6}(?:[0-9a-f]{2})?$/iu.test(next) ? next : "transparent";
|
|
393
|
+
change(next);
|
|
394
|
+
});
|
|
395
|
+
colorControl.append(swatch, picker);
|
|
396
|
+
field.append(colorControl, value);
|
|
397
|
+
return field;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function fieldLabel(name: string): string {
|
|
401
|
+
return name.split("-").map((part) => `${part.slice(0, 1).toUpperCase()}${part.slice(1)}`).join(" ");
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function blankValue(schema: ValueSchema): CanonicalValue {
|
|
405
|
+
if (schema.kind === "string") return "";
|
|
406
|
+
if (schema.kind === "number" || schema.kind === "null" || schema.kind === "literal" || schema.kind === "oneOf") return null;
|
|
407
|
+
if (schema.kind === "boolean") return false;
|
|
408
|
+
if (schema.kind === "array") return [];
|
|
409
|
+
if (schema.kind === "object") return Object.fromEntries(Object.entries(schema.fields)
|
|
410
|
+
.filter(([, field]) => field.optional !== true)
|
|
411
|
+
.map(([name, field]) => [name, blankValue(field.schema)]));
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function scalarDraftControl(
|
|
416
|
+
label: string,
|
|
417
|
+
schema: ValueSchema,
|
|
418
|
+
held: CanonicalValue | undefined,
|
|
419
|
+
change: (value: CanonicalValue) => void,
|
|
420
|
+
): HTMLElement {
|
|
421
|
+
if (schema.kind === "string" && schema.format === "color") {
|
|
422
|
+
return colorValueControl(label, typeof held === "string" ? held : "", change, true);
|
|
423
|
+
}
|
|
424
|
+
const input = document.createElement("input");
|
|
425
|
+
input.className = "parameter-value parameter-structured-value";
|
|
426
|
+
input.setAttribute("aria-label", label);
|
|
427
|
+
input.spellcheck = false;
|
|
428
|
+
if (schema.kind === "boolean") {
|
|
429
|
+
input.type = "checkbox";
|
|
430
|
+
input.checked = held === true;
|
|
431
|
+
input.addEventListener("change", () => change(input.checked));
|
|
432
|
+
return input;
|
|
433
|
+
}
|
|
434
|
+
input.type = "text";
|
|
435
|
+
if (schema.kind === "number") input.inputMode = "decimal";
|
|
436
|
+
input.value = held === undefined || held === null ? "" : textValue(held);
|
|
437
|
+
input.addEventListener("input", () => {
|
|
438
|
+
if (schema.kind === "number") {
|
|
439
|
+
const number = Number(input.value);
|
|
440
|
+
change(input.value.trim().length === 0 || !Number.isFinite(number) ? null : number);
|
|
441
|
+
} else {
|
|
442
|
+
change(input.value);
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
return input;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function recordDraftControl(
|
|
449
|
+
schema: Extract<ValueSchema, { readonly kind: "object" }>,
|
|
450
|
+
held: CanonicalValue,
|
|
451
|
+
change: (value: CanonicalValue) => void,
|
|
452
|
+
): HTMLElement {
|
|
453
|
+
let record = (held !== null && !Array.isArray(held) && typeof held === "object"
|
|
454
|
+
? held
|
|
455
|
+
: {}) as Readonly<Record<string, CanonicalValue>>;
|
|
456
|
+
const fields = document.createElement("div");
|
|
457
|
+
fields.className = "parameter-record-fields";
|
|
458
|
+
for (const [name, field] of Object.entries(schema.fields)) {
|
|
459
|
+
const row = document.createElement("label");
|
|
460
|
+
row.className = "parameter-record-field";
|
|
461
|
+
const copy = document.createElement("span");
|
|
462
|
+
copy.textContent = fieldLabel(name);
|
|
463
|
+
row.append(copy, scalarDraftControl(fieldLabel(name), field.schema, record[name], (next) => {
|
|
464
|
+
record = { ...record, [name]: next };
|
|
465
|
+
change(record);
|
|
466
|
+
}));
|
|
467
|
+
fields.append(row);
|
|
468
|
+
}
|
|
469
|
+
return fields;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function structuredControl(entityId: string, parameter: Clip["inspector"][number]): HTMLElement {
|
|
473
|
+
const schema = parameter.schema;
|
|
474
|
+
const shell = document.createElement("div");
|
|
475
|
+
shell.className = "parameter-structured";
|
|
476
|
+
if (schema === undefined || (schema.kind !== "array" && schema.kind !== "object")) return shell;
|
|
477
|
+
let draft = structuredClone(parameter.value);
|
|
478
|
+
let refreshDecisions = (): void => {};
|
|
479
|
+
|
|
480
|
+
const valid = (): boolean => {
|
|
481
|
+
try {
|
|
482
|
+
validateParameterValue(draft, schema, parameter.label);
|
|
483
|
+
return true;
|
|
484
|
+
} catch {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
const render = (): void => {
|
|
490
|
+
shell.replaceChildren();
|
|
491
|
+
const summary = document.createElement("div");
|
|
492
|
+
summary.className = "parameter-structured-summary";
|
|
493
|
+
const count = document.createElement("span");
|
|
494
|
+
count.textContent = schema.kind === "array" && Array.isArray(draft)
|
|
495
|
+
? `${draft.length} ${draft.length === 1 ? "item" : "items"}`
|
|
496
|
+
: "Structured value";
|
|
497
|
+
summary.append(count);
|
|
498
|
+
shell.append(summary);
|
|
499
|
+
|
|
500
|
+
if (schema.kind === "array") {
|
|
501
|
+
const list = Array.isArray(draft) ? draft : [];
|
|
502
|
+
const items = document.createElement("div");
|
|
503
|
+
items.className = "parameter-list-items";
|
|
504
|
+
list.forEach((item, index) => {
|
|
505
|
+
const row = document.createElement("div");
|
|
506
|
+
row.className = `parameter-list-item${schema.items.kind === "object" ? " record" : ""}`;
|
|
507
|
+
const editor = schema.items.kind === "object"
|
|
508
|
+
? recordDraftControl(schema.items, item, (next) => {
|
|
509
|
+
const current = Array.isArray(draft) ? draft : [];
|
|
510
|
+
draft = current.map((candidate, heldIndex) => heldIndex === index ? next : candidate);
|
|
511
|
+
refreshDecisions();
|
|
512
|
+
})
|
|
513
|
+
: scalarDraftControl(`${parameter.label} ${index + 1}`, schema.items, item, (next) => {
|
|
514
|
+
const current = Array.isArray(draft) ? draft : [];
|
|
515
|
+
draft = current.map((candidate, heldIndex) => heldIndex === index ? next : candidate);
|
|
516
|
+
refreshDecisions();
|
|
517
|
+
});
|
|
518
|
+
const actions = document.createElement("span");
|
|
519
|
+
actions.className = "parameter-list-actions";
|
|
520
|
+
const move = (offset: number): void => {
|
|
521
|
+
const reordered = [...(Array.isArray(draft) ? draft : [])];
|
|
522
|
+
const [moving] = reordered.splice(index, 1);
|
|
523
|
+
reordered.splice(index + offset, 0, moving!);
|
|
524
|
+
draft = reordered;
|
|
525
|
+
render();
|
|
526
|
+
};
|
|
527
|
+
const up = document.createElement("button");
|
|
528
|
+
up.type = "button";
|
|
529
|
+
up.textContent = "↑";
|
|
530
|
+
up.title = "Move up";
|
|
531
|
+
up.disabled = index === 0;
|
|
532
|
+
up.addEventListener("click", () => move(-1));
|
|
533
|
+
const down = document.createElement("button");
|
|
534
|
+
down.type = "button";
|
|
535
|
+
down.textContent = "↓";
|
|
536
|
+
down.title = "Move down";
|
|
537
|
+
down.disabled = index === list.length - 1;
|
|
538
|
+
down.addEventListener("click", () => move(1));
|
|
539
|
+
const remove = document.createElement("button");
|
|
540
|
+
remove.type = "button";
|
|
541
|
+
remove.innerHTML = icon("minus");
|
|
542
|
+
remove.title = "Remove item";
|
|
543
|
+
remove.disabled = schema.minItems !== undefined && list.length <= schema.minItems;
|
|
544
|
+
remove.addEventListener("click", () => {
|
|
545
|
+
const current = Array.isArray(draft) ? draft : [];
|
|
546
|
+
draft = current.filter((_, heldIndex) => heldIndex !== index);
|
|
547
|
+
render();
|
|
548
|
+
});
|
|
549
|
+
actions.append(up, down, remove);
|
|
550
|
+
row.append(editor, actions);
|
|
551
|
+
items.append(row);
|
|
552
|
+
});
|
|
553
|
+
shell.append(items);
|
|
554
|
+
} else {
|
|
555
|
+
shell.append(recordDraftControl(schema, draft, (next) => {
|
|
556
|
+
draft = next;
|
|
557
|
+
refreshDecisions();
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const footer = document.createElement("div");
|
|
562
|
+
footer.className = "parameter-structured-footer";
|
|
563
|
+
if (schema.kind === "array") {
|
|
564
|
+
const list = Array.isArray(draft) ? draft : [];
|
|
565
|
+
const add = document.createElement("button");
|
|
566
|
+
add.type = "button";
|
|
567
|
+
add.className = "parameter-structured-add";
|
|
568
|
+
add.innerHTML = `${icon("plus")}<span>Add ${schema.items.kind === "string" && schema.items.format === "color" ? "color" : "item"}</span>`;
|
|
569
|
+
add.disabled = schema.maxItems !== undefined && list.length >= schema.maxItems;
|
|
570
|
+
add.addEventListener("click", () => {
|
|
571
|
+
const current = Array.isArray(draft) ? draft : [];
|
|
572
|
+
draft = [...current, blankValue(schema.items)];
|
|
573
|
+
render();
|
|
574
|
+
});
|
|
575
|
+
footer.append(add);
|
|
576
|
+
}
|
|
577
|
+
const decisions = document.createElement("span");
|
|
578
|
+
decisions.className = "parameter-structured-decisions";
|
|
579
|
+
const reset = document.createElement("button");
|
|
580
|
+
reset.type = "button";
|
|
581
|
+
reset.textContent = "Reset";
|
|
582
|
+
reset.disabled = sameValue(draft, parameter.value);
|
|
583
|
+
reset.addEventListener("click", () => {
|
|
584
|
+
draft = structuredClone(parameter.value);
|
|
585
|
+
render();
|
|
586
|
+
});
|
|
587
|
+
const apply = document.createElement("button");
|
|
588
|
+
apply.type = "button";
|
|
589
|
+
apply.className = "primary";
|
|
590
|
+
apply.textContent = "Apply";
|
|
591
|
+
apply.addEventListener("click", () => commitControl(entityId, parameter, draft));
|
|
592
|
+
refreshDecisions = () => {
|
|
593
|
+
reset.disabled = sameValue(draft, parameter.value);
|
|
594
|
+
apply.disabled = reset.disabled || !valid();
|
|
595
|
+
};
|
|
596
|
+
refreshDecisions();
|
|
597
|
+
decisions.append(reset, apply);
|
|
598
|
+
footer.append(decisions);
|
|
599
|
+
shell.append(footer);
|
|
600
|
+
};
|
|
601
|
+
render();
|
|
602
|
+
return shell;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function parameterControl(entityId: string, parameter: Clip["inspector"][number]): HTMLElement {
|
|
606
|
+
const row = document.createElement("div");
|
|
607
|
+
row.className = `parameter-row parameter-editable control-${parameter.control}`;
|
|
608
|
+
const name = document.createElement("span");
|
|
609
|
+
name.className = "parameter-label";
|
|
610
|
+
name.textContent = parameter.label;
|
|
611
|
+
name.title = parameter.summary ?? parameter.label;
|
|
612
|
+
const right = document.createElement("span");
|
|
613
|
+
right.className = "parameter-right parameter-control";
|
|
614
|
+
if (parameter.control === "select") {
|
|
615
|
+
right.append(selectControl(entityId, parameter));
|
|
616
|
+
} else if (parameter.control === "color") {
|
|
617
|
+
right.append(colorValueControl(parameter.label, textValue(parameter.value), (next) => {
|
|
618
|
+
commitControl(entityId, parameter, next);
|
|
619
|
+
}));
|
|
620
|
+
} else if (parameter.control === "list" || parameter.control === "record") {
|
|
621
|
+
right.append(structuredControl(entityId, parameter));
|
|
622
|
+
} else {
|
|
623
|
+
const value = document.createElement("input");
|
|
624
|
+
value.type = parameter.control === "boolean" ? "checkbox" : "text";
|
|
625
|
+
if (parameter.control === "number") value.inputMode = "decimal";
|
|
626
|
+
value.className = "parameter-value";
|
|
627
|
+
value.setAttribute("aria-label", parameter.label);
|
|
628
|
+
value.spellcheck = false;
|
|
629
|
+
if (value.type === "checkbox") value.checked = parameter.value === true || parameter.value === "true";
|
|
630
|
+
else value.value = textValue(parameter.value);
|
|
631
|
+
value.dataset.parameterId = parameter.id;
|
|
632
|
+
value.title = parameter.summary ?? parameter.label;
|
|
633
|
+
value.addEventListener("change", () => {
|
|
634
|
+
if (value.type === "checkbox") {
|
|
635
|
+
commitControl(entityId, parameter, value.checked);
|
|
636
|
+
} else if (parameter.control === "number") {
|
|
637
|
+
const number = Number(value.value);
|
|
638
|
+
if (Number.isFinite(number)) commitControl(entityId, parameter, number);
|
|
639
|
+
} else {
|
|
640
|
+
commitControl(entityId, parameter, value.value);
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
right.append(value);
|
|
644
|
+
}
|
|
645
|
+
if (parameter.unit !== undefined) {
|
|
646
|
+
const unit = document.createElement("small");
|
|
647
|
+
unit.textContent = parameter.unit;
|
|
648
|
+
right.append(unit);
|
|
649
|
+
}
|
|
650
|
+
row.append(name, right);
|
|
651
|
+
row.title = parameter.summary ?? parameter.label;
|
|
652
|
+
return row;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
function parameterGroups(entityId: string, fields: readonly Clip["inspector"][number][]): readonly HTMLElement[] {
|
|
656
|
+
const groups = new Map<string, Clip["inspector"][number][]>();
|
|
657
|
+
for (const field of fields) {
|
|
658
|
+
const key = `${field.section.id}\u0000${field.section.label}`;
|
|
659
|
+
const held = groups.get(key) ?? [];
|
|
660
|
+
held.push(field);
|
|
661
|
+
groups.set(key, held);
|
|
662
|
+
}
|
|
663
|
+
return [...groups].map(([key, values]) => {
|
|
664
|
+
const [, label = ""] = key.split("\u0000");
|
|
665
|
+
return group(label, values.map((parameter) => parameterControl(entityId, parameter)), "parameter-group inspector-field-group");
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
let parameterWriteState: "" | "Saving" | "Saved" | "Failed" = "";
|
|
670
|
+
async function writeParameter(entityId: string, parameter: Clip["inspector"][number], replacement: CanonicalValue): Promise<void> {
|
|
671
|
+
const state = store.current();
|
|
672
|
+
if (state === undefined) return;
|
|
673
|
+
parameterWriteState = "Saving";
|
|
674
|
+
status.textContent = parameterWriteState;
|
|
675
|
+
status.className = "status saving";
|
|
676
|
+
try {
|
|
677
|
+
await applyStudioMutation({
|
|
678
|
+
type: "parameter.adjust",
|
|
679
|
+
revision: state.snapshot.revision,
|
|
680
|
+
entityId,
|
|
681
|
+
parameterId: parameter.id,
|
|
682
|
+
value: replacement,
|
|
683
|
+
});
|
|
684
|
+
parameterWriteState = "Saved";
|
|
685
|
+
status.textContent = parameterWriteState;
|
|
686
|
+
status.className = "status saved";
|
|
687
|
+
} catch (error) {
|
|
688
|
+
parameterWriteState = "Failed";
|
|
689
|
+
status.textContent = error instanceof Error ? "Save failed" : parameterWriteState;
|
|
690
|
+
status.className = "status error";
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* A single strip between the picture and the timeline. It is a row of the
|
|
696
|
+
* layout rather than a floating card, so it can never cover the frame being
|
|
697
|
+
* inspected or the transport used to reach it.
|
|
698
|
+
*/
|
|
699
|
+
function renderInspector(snapshot: StudioSnapshot, clipId: string | undefined): void {
|
|
700
|
+
const clip = clipId === undefined ? undefined : store.clip(clipId);
|
|
701
|
+
|
|
702
|
+
if (clip === undefined) {
|
|
703
|
+
defaultWorkspaceHeading();
|
|
704
|
+
const fps = snapshot.space.frameRate.numerator / snapshot.space.frameRate.denominator;
|
|
705
|
+
inspector.replaceChildren(
|
|
706
|
+
group("Project", [
|
|
707
|
+
property("Author", snapshot.source.path, "property-code"),
|
|
708
|
+
property("Run", snapshot.run.path, "property-code"),
|
|
709
|
+
property("Sources", `${snapshot.source.files.length} referenced files`),
|
|
710
|
+
property("Tracks", String(snapshot.tracks.length), "property-number"),
|
|
711
|
+
]),
|
|
712
|
+
group("Canvas", [
|
|
713
|
+
property("Resolution", `${snapshot.space.canvasWidth} × ${snapshot.space.canvasHeight}`, "property-number"),
|
|
714
|
+
property("Aspect ratio", aspectRatio(snapshot.space.canvasWidth, snapshot.space.canvasHeight), "property-number"),
|
|
715
|
+
]),
|
|
716
|
+
group("Timeline", [
|
|
717
|
+
property("Duration", `${snapshot.space.durationSec.toFixed(2)} s`, "property-number"),
|
|
718
|
+
property("Frame rate", `${fps.toFixed(Number.isInteger(fps) ? 0 : 2)} fps`, "property-number"),
|
|
719
|
+
property("Frames", String(snapshot.space.frameCount), "property-number"),
|
|
720
|
+
]),
|
|
721
|
+
group("Build", [
|
|
722
|
+
property("Targets", snapshot.run.targets
|
|
723
|
+
.map((target) => target.split("::output::").at(-1) ?? target)
|
|
724
|
+
.join(", ") || "—", "property-code"),
|
|
725
|
+
property("Candidates", String(snapshot.run.satisfactions.length), "property-number"),
|
|
726
|
+
]),
|
|
727
|
+
);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
const domains = domainOrder.filter((domain) => clip.inspector.some((field) => field.domain === domain));
|
|
731
|
+
if (domains.length === 0) {
|
|
732
|
+
defaultWorkspaceHeading();
|
|
733
|
+
const empty = document.createElement("div");
|
|
734
|
+
empty.className = "inspector-empty";
|
|
735
|
+
empty.textContent = "No adjustable parameters";
|
|
736
|
+
inspector.replaceChildren(empty);
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
const remembered = inspectorDomainByEntity.get(clip.id);
|
|
740
|
+
const activeDomain = remembered !== undefined && domains.includes(remembered) ? remembered : domains[0]!;
|
|
741
|
+
inspectorDomainByEntity.set(clip.id, activeDomain);
|
|
742
|
+
inspectorHeading(clip.id, domains, activeDomain, () => renderInspector(snapshot, clip.id));
|
|
743
|
+
|
|
744
|
+
const domainFields = clip.inspector.filter((field) => field.domain === activeDomain);
|
|
745
|
+
const pages = new Map<string, { readonly label: string; readonly fields: typeof domainFields }>();
|
|
746
|
+
for (const field of domainFields) {
|
|
747
|
+
const id = field.page?.id ?? "default";
|
|
748
|
+
const page = pages.get(id) ?? { label: field.page?.label ?? "", fields: [] };
|
|
749
|
+
pages.set(id, { ...page, fields: [...page.fields, field] });
|
|
750
|
+
}
|
|
751
|
+
const pageIds = [...pages.keys()];
|
|
752
|
+
const memoryKey = `${clip.id}:${activeDomain}`;
|
|
753
|
+
const rememberedPage = inspectorPageByEntity.get(memoryKey);
|
|
754
|
+
const activePage = rememberedPage !== undefined && pages.has(rememberedPage) ? rememberedPage : pageIds[0]!;
|
|
755
|
+
inspectorPageByEntity.set(memoryKey, activePage);
|
|
756
|
+
const page = pages.get(activePage)!;
|
|
757
|
+
const subtabs = document.createElement("div");
|
|
758
|
+
subtabs.className = "inspector-subtabs";
|
|
759
|
+
if (pageIds.length > 1) {
|
|
760
|
+
subtabs.append(...pageIds.map((id) => {
|
|
761
|
+
const button = document.createElement("button");
|
|
762
|
+
button.type = "button";
|
|
763
|
+
button.className = `inspector-subtab${id === activePage ? " active" : ""}`;
|
|
764
|
+
const label = document.createElement("span");
|
|
765
|
+
label.textContent = pages.get(id)?.label ?? id;
|
|
766
|
+
button.append(label);
|
|
767
|
+
button.addEventListener("click", () => {
|
|
768
|
+
inspectorPageByEntity.set(memoryKey, id);
|
|
769
|
+
renderInspector(snapshot, clip.id);
|
|
770
|
+
});
|
|
771
|
+
return button;
|
|
772
|
+
}));
|
|
773
|
+
}
|
|
774
|
+
inspector.replaceChildren(...(pageIds.length > 1 ? [subtabs] : []), ...parameterGroups(clip.id, page.fields));
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
function renderSemanticInspector(snapshot: StudioSnapshot, segmentId: string): void {
|
|
778
|
+
const segment = snapshot.semantic?.segments.find((item) => item.id === segmentId);
|
|
779
|
+
if (segment === undefined) { inspector.replaceChildren(); return; }
|
|
780
|
+
defaultWorkspaceHeading();
|
|
781
|
+
const empty = document.createElement("div");
|
|
782
|
+
empty.className = "inspector-empty";
|
|
783
|
+
empty.textContent = "No adjustable parameters";
|
|
784
|
+
inspector.replaceChildren(empty);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function renderSemanticSelectionInspector(snapshot: StudioSnapshot, selectionId: string): void {
|
|
788
|
+
const selection = snapshot.semantic?.selections.find((item) => item.id === selectionId);
|
|
789
|
+
if (selection === undefined) { inspector.replaceChildren(); return; }
|
|
790
|
+
defaultWorkspaceHeading();
|
|
791
|
+
const empty = document.createElement("div");
|
|
792
|
+
empty.className = "inspector-empty";
|
|
793
|
+
empty.textContent = "Adjust on the timeline";
|
|
794
|
+
inspector.replaceChildren(empty);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
function renderSemanticMomentInspector(snapshot: StudioSnapshot, momentId: string): void {
|
|
798
|
+
const moment = snapshot.semantic?.moments.find((item) => item.id === momentId);
|
|
799
|
+
if (moment === undefined) { inspector.replaceChildren(); return; }
|
|
800
|
+
defaultWorkspaceHeading();
|
|
801
|
+
const empty = document.createElement("div");
|
|
802
|
+
empty.className = "inspector-empty";
|
|
803
|
+
empty.textContent = "Adjust on the timeline";
|
|
804
|
+
inspector.replaceChildren(empty);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// The word being spoken at the playhead, which is the point of carrying token
|
|
808
|
+
// timings at all: it ties the Script text to the frame on screen.
|
|
809
|
+
store.subscribe(({ snapshot, playhead }) => {
|
|
810
|
+
const token = snapshot.script?.tokens.find((item) =>
|
|
811
|
+
playhead.frame >= item.startFrame && playhead.frame < item.endFrame);
|
|
812
|
+
code.speak(token?.range);
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
let described = "";
|
|
816
|
+
let scrolledTo = "";
|
|
817
|
+
|
|
818
|
+
store.subscribe(({ snapshot, selection, playhead }) => {
|
|
819
|
+
const origin = selection.kind === "none" ? undefined : selection.origin;
|
|
820
|
+
const chosen = selection.kind === "clip" ? store.clip(selection.clipId) : undefined;
|
|
821
|
+
const chosenSegment = selection.kind === "semantic-segment"
|
|
822
|
+
? snapshot.semantic?.segments.find((item) => item.id === selection.segmentId)
|
|
823
|
+
: undefined;
|
|
824
|
+
const chosenSelection = selection.kind === "semantic-selection"
|
|
825
|
+
? snapshot.semantic?.selections.find((item) => item.id === selection.selectionId)
|
|
826
|
+
: undefined;
|
|
827
|
+
const chosenMoment = selection.kind === "semantic-moment"
|
|
828
|
+
? snapshot.semantic?.moments.find((item) => item.id === selection.momentId)
|
|
829
|
+
: undefined;
|
|
830
|
+
// Rebuilding this every frame of playback would be DOM churn for no change.
|
|
831
|
+
const describes = `${snapshot.revision}:${selection.kind}:${chosen?.id ?? chosenSegment?.id ?? chosenSelection?.id ?? chosenMoment?.id ?? ""}`;
|
|
832
|
+
if (describes !== described) {
|
|
833
|
+
described = describes;
|
|
834
|
+
if (chosenSegment !== undefined) renderSemanticInspector(snapshot, chosenSegment.id);
|
|
835
|
+
else if (chosenSelection !== undefined) renderSemanticSelectionInspector(snapshot, chosenSelection.id);
|
|
836
|
+
else if (chosenMoment !== undefined) renderSemanticMomentInspector(snapshot, chosenMoment.id);
|
|
837
|
+
else renderInspector(snapshot, chosen?.id);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Source outlines are selection affordances, not a second always-on syntax
|
|
841
|
+
// layer. Keeping every live Selection outlined made the code pane fill with
|
|
842
|
+
// yellow polygons while the author was merely playing the film.
|
|
843
|
+
const highlights: Highlight[] = [];
|
|
844
|
+
// The element that placed what is on screen is outlined too. Knowing a cutaway
|
|
845
|
+
// is running is half the answer; the other half is which line put it there.
|
|
846
|
+
// Only what was chosen is outlined. What is merely drawn at this frame is
|
|
847
|
+
// already said by the gutter bars, and a second outline for it made a board
|
|
848
|
+
// look picked when one of its rows was.
|
|
849
|
+
if (chosen?.elementRange !== undefined) {
|
|
850
|
+
highlights.push({ range: chosen.elementRange, tone: "element" });
|
|
851
|
+
}
|
|
852
|
+
if (chosenSegment?.range !== undefined) {
|
|
853
|
+
highlights.push({ range: chosenSegment.range, tone: "element" });
|
|
854
|
+
}
|
|
855
|
+
const sourceSelection = chosenSelection === undefined
|
|
856
|
+
? undefined
|
|
857
|
+
: snapshot.script?.selections.find((item) => item.id === chosenSelection.id);
|
|
858
|
+
const sourceMoment = chosenMoment === undefined
|
|
859
|
+
? undefined
|
|
860
|
+
: snapshot.script?.moments.find((item) => item.id === chosenMoment.id);
|
|
861
|
+
const chosenIntentRange = sourceSelection === undefined
|
|
862
|
+
? sourceMoment?.range
|
|
863
|
+
: { start: sourceSelection.open.start, end: sourceSelection.close.end };
|
|
864
|
+
if (chosenIntentRange !== undefined) highlights.push({ range: chosenIntentRange, tone: "binding" });
|
|
865
|
+
|
|
866
|
+
// Scroll only when the selection actually moved, and never toward the pane
|
|
867
|
+
// the author is pointing at: following the playhead every frame would drag
|
|
868
|
+
// the source out from under whoever is reading it.
|
|
869
|
+
const focused = chosen === undefined && chosenSegment === undefined
|
|
870
|
+
&& chosenSelection === undefined && chosenMoment === undefined
|
|
871
|
+
? ""
|
|
872
|
+
: `${snapshot.revision}:${selection.kind}:${chosen?.id ?? chosenSegment?.id ?? chosenSelection?.id ?? chosenMoment?.id}`;
|
|
873
|
+
const moved = focused.length > 0 && focused !== scrolledTo;
|
|
874
|
+
scrolledTo = focused;
|
|
875
|
+
code.highlight(highlights, moved && origin !== "code");
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
// Clicking a marked region in the source selects what it binds and looks at the
|
|
879
|
+
// instant it covers. The source token and range overlay carry that relationship;
|
|
880
|
+
// the line-number gutter stays quiet.
|
|
881
|
+
code.element.addEventListener("click", (event) => {
|
|
882
|
+
if ((event.target as HTMLElement | null)?.closest("button, textarea") !== null) return;
|
|
883
|
+
const state = store.current();
|
|
884
|
+
if (state === undefined) return;
|
|
885
|
+
if (code.activePath() !== state.snapshot.source.path) return;
|
|
886
|
+
const offset = code.offsetAt(event);
|
|
887
|
+
// Below the last line, or in the heading: nothing is being pointed at.
|
|
888
|
+
if (offset === undefined) {
|
|
889
|
+
store.clearSelection();
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
const intent = intentAtOffset(state.snapshot, offset);
|
|
893
|
+
if (intent?.kind === "selection") {
|
|
894
|
+
store.selectSemanticSelection(intent.id, "code");
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (intent?.kind === "moment") {
|
|
898
|
+
store.selectSemanticMoment(intent.id, "code");
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
const clip = clipAtOffset(state.snapshot, offset);
|
|
902
|
+
|
|
903
|
+
// A click inside marked prose lands inside the innermost marker written there,
|
|
904
|
+
// not at the start of whatever encloses it. `@amount` places nothing, so
|
|
905
|
+
// resolving through clips alone would throw the playhead out to `@fee`.
|
|
906
|
+
const span = spanAtOffset(state.snapshot, offset);
|
|
907
|
+
// Prose is anywhere a marker was written; whether a clip also covers that
|
|
908
|
+
// offset only decides which clip to select, not whether the click counts.
|
|
909
|
+
const inProse = span !== undefined
|
|
910
|
+
&& (clip?.elementRange === undefined
|
|
911
|
+
|| !(offset >= clip.elementRange.start && offset <= clip.elementRange.end));
|
|
912
|
+
if (inProse) {
|
|
913
|
+
// A clip is named after itself and remembers what placed it, so a marker
|
|
914
|
+
// finds the clips it put there through the second, not the first.
|
|
915
|
+
const bound = state.snapshot.tracks
|
|
916
|
+
.flatMap((track) => track.clips)
|
|
917
|
+
.find((item) => item.markerId === span.id || item.authoredId === span.id);
|
|
918
|
+
// A marker that places nothing still sits inside one that does, so the
|
|
919
|
+
// enclosing clip stays selected rather than leaving the inspector blank.
|
|
920
|
+
const target = bound?.id ?? clip?.id;
|
|
921
|
+
if (target === undefined) store.seek(span.startFrame, "code");
|
|
922
|
+
else store.focus(span.startFrame, target, "code");
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (clip === undefined) store.clearSelection();
|
|
926
|
+
else store.selectClip(clip.id, "code");
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
window.addEventListener("keydown", (event) => {
|
|
930
|
+
const state = store.current();
|
|
931
|
+
if (state === undefined || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
932
|
+
// Space is the transport everywhere else; typing in a field is not transport.
|
|
933
|
+
const target = event.target instanceof Element ? event.target : undefined;
|
|
934
|
+
const editing = target?.closest("input, textarea, select, [contenteditable=true], .parameter-control") !== null && target !== undefined;
|
|
935
|
+
if (editing) return;
|
|
936
|
+
if (event.key === " ") {
|
|
937
|
+
stage.toggle();
|
|
938
|
+
event.preventDefault();
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
if (event.key === "-" || event.key === "_") {
|
|
942
|
+
timeline.zoomOut();
|
|
943
|
+
event.preventDefault();
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
if (event.key === "=" || event.key === "+") {
|
|
947
|
+
timeline.zoomIn();
|
|
948
|
+
event.preventDefault();
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
if (event.key === "\\" || event.key.toLowerCase() === "f") {
|
|
952
|
+
timeline.fit();
|
|
953
|
+
event.preventDefault();
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
const step = event.shiftKey ? 10 : 1;
|
|
957
|
+
if (event.key === "ArrowLeft" || event.key === ",") store.seek(state.playhead.frame - step, "timeline");
|
|
958
|
+
else if (event.key === "ArrowRight" || event.key === ".") store.seek(state.playhead.frame + step, "timeline");
|
|
959
|
+
else if (event.key === "Home") store.seek(0, "timeline");
|
|
960
|
+
else if (event.key === "End") store.seek(state.snapshot.space.frameCount - 1, "timeline");
|
|
961
|
+
else if (event.key === "Escape") store.clearSelection();
|
|
962
|
+
else return;
|
|
963
|
+
event.preventDefault();
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
function applySnapshot(snapshot: StudioSnapshot): void {
|
|
967
|
+
failureView.textContent = "";
|
|
968
|
+
status.className = "status";
|
|
969
|
+
status.textContent = "";
|
|
970
|
+
renderMeta(snapshot);
|
|
971
|
+
library.show(snapshot);
|
|
972
|
+
store.load(snapshot);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
function applyFailure(failure: StudioFailure): void {
|
|
976
|
+
status.className = "status error";
|
|
977
|
+
status.textContent = "Compile failed";
|
|
978
|
+
failureView.textContent = failure.error;
|
|
979
|
+
if (failure.range !== undefined) code.highlight([{ range: failure.range, tone: "element" }], true);
|
|
980
|
+
// A parameter control changes immediately in the browser, but the source
|
|
981
|
+
// remains the only truth. If recompilation rejects the transaction, rebuild
|
|
982
|
+
// the Inspector from the last accepted snapshot instead of leaving a false
|
|
983
|
+
// value visible in the field.
|
|
984
|
+
const current = store.current();
|
|
985
|
+
if (current === undefined) return;
|
|
986
|
+
if (current.selection.kind === "clip") renderInspector(current.snapshot, current.selection.clipId);
|
|
987
|
+
else if (current.selection.kind === "semantic-segment") renderSemanticInspector(current.snapshot, current.selection.segmentId);
|
|
988
|
+
else if (current.selection.kind === "semantic-selection") renderSemanticSelectionInspector(current.snapshot, current.selection.selectionId);
|
|
989
|
+
else if (current.selection.kind === "semantic-moment") renderSemanticMomentInspector(current.snapshot, current.selection.momentId);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const response = await fetch("/__studio/session");
|
|
993
|
+
const initial = await response.json() as StudioSnapshot | StudioFailure;
|
|
994
|
+
if (response.ok && "tracks" in initial) applySnapshot(initial);
|
|
995
|
+
else applyFailure(initial as StudioFailure);
|
|
996
|
+
void library.refresh();
|
|
997
|
+
|
|
998
|
+
type Hot = { on(event: string, listener: (value: unknown) => void): void };
|
|
999
|
+
const hot = (import.meta as ImportMeta & { hot?: Hot }).hot;
|
|
1000
|
+
hot?.on("studio:snapshot", (value) => applySnapshot(value as StudioSnapshot));
|
|
1001
|
+
hot?.on("studio:error", (value) => applyFailure(value as StudioFailure));
|