fundus 0.0.2 → 0.0.4
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/README.md +73 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css +1 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.br +0 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css +1 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css.br +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css +1 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.br +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.gz +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js +108 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DVEQFclp.js} +1 -1
- package/build/client/_app/immutable/chunks/DVEQFclp.js.br +1 -0
- package/build/client/_app/immutable/chunks/DVEQFclp.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/DiFoWL2c.js} +1 -1
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.br +0 -0
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js +1 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
- package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.CKgtYXQb.js} +2 -2
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js +1 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.br +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.I_1SApYQ.js} +1 -1
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.v6eUTnWq.js} +1 -1
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.br +2 -0
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js +3 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js +1 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js +2 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/env.js +100 -0
- package/build/env.js.map +1 -0
- package/build/handler.js +22 -0
- package/build/handler.js.map +1 -0
- package/build/index.js +145 -0
- package/build/index.js.map +1 -0
- package/build/server/chunks/chunks/context.js-BUZqFfWG.js +429 -0
- package/build/server/chunks/chunks/context.js-BUZqFfWG.js.map +1 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.js +458 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.js.map +1 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
- package/build/server/chunks/chunks/exports.js-C0rwMMtk.js +152 -0
- package/build/server/chunks/chunks/exports.js-C0rwMMtk.js.map +1 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
- package/build/server/chunks/chunks/http.js-DvopzwKh.js +100 -0
- package/build/server/chunks/chunks/http.js-DvopzwKh.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.js +5753 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.js.map +1 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
- package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-ZLudCJlT.js} +463 -492
- package/build/server/chunks/chunks/library-store.js-ZLudCJlT.js.map +1 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
- package/build/server/chunks/chunks/shared.js-B1gC9MiJ.js +255 -0
- package/build/server/chunks/chunks/shared.js-B1gC9MiJ.js.map +1 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js +1048 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js +27 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js +24 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js +45 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js +38 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js +31 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js +24 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js +31 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js +24 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js +27 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js +24 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js +24 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js.map +1 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js +23 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js.map +1 -0
- package/build/server/chunks/handler-DnbS2t1B.js +1475 -0
- package/build/server/chunks/handler-DnbS2t1B.js.map +1 -0
- package/build/server/chunks/index.js-g77q3Boj.js +3789 -0
- package/build/server/chunks/index.js-g77q3Boj.js.map +1 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js +149 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js.map +1 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js +11 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js.map +1 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js +7 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js.map +1 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js +7 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js.map +1 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js +7 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js.map +1 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.js +7 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.js.map +1 -0
- package/build/shims.js +33 -0
- package/build/shims.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +116 -1336
- package/dist/config.d.ts +3 -2
- package/dist/config.js +2 -2
- package/dist/core/api-types.d.ts +141 -0
- package/dist/core/api-types.js +1 -0
- package/dist/core/asset-id.d.ts +28 -0
- package/dist/core/asset-id.js +59 -0
- package/dist/core/asset-reference.d.ts +23 -0
- package/dist/core/asset-reference.js +15 -0
- package/dist/core/canonicalize.d.ts +9 -0
- package/dist/core/canonicalize.js +36 -0
- package/dist/core/chroma-key.d.ts +30 -0
- package/dist/core/chroma-key.js +55 -0
- package/dist/core/config.d.ts +35 -0
- package/dist/core/config.js +4 -0
- package/dist/core/folder-path.d.ts +19 -0
- package/dist/core/folder-path.js +86 -0
- package/dist/core/index.d.ts +33 -499
- package/dist/core/index.js +17 -962
- package/dist/core/ingest.d.ts +24 -0
- package/dist/core/ingest.js +42 -0
- package/dist/core/library.d.ts +54 -0
- package/dist/core/library.js +138 -0
- package/dist/core/manifest-appearance.d.ts +35 -0
- package/dist/core/manifest-appearance.js +123 -0
- package/dist/core/manifest-entry.d.ts +104 -0
- package/dist/core/manifest-entry.js +1 -0
- package/dist/core/manifest-membership.d.ts +56 -0
- package/dist/core/manifest-membership.js +54 -0
- package/dist/core/plugins/audio.d.ts +26 -0
- package/dist/core/plugins/audio.js +44 -0
- package/dist/core/plugins/chroma-key-video.d.ts +29 -0
- package/dist/core/plugins/chroma-key-video.js +69 -0
- package/dist/core/plugins/contract.d.ts +35 -0
- package/dist/core/plugins/contract.js +1 -0
- package/dist/core/plugins/image.d.ts +30 -0
- package/dist/core/plugins/image.js +45 -0
- package/dist/core/plugins/registry.d.ts +16 -0
- package/dist/core/plugins/registry.js +52 -0
- package/dist/core/plugins/slice.d.ts +22 -0
- package/dist/core/plugins/slice.js +60 -0
- package/dist/core/plugins/video.d.ts +45 -0
- package/dist/core/plugins/video.js +77 -0
- package/dist/core/reference-graph.d.ts +41 -0
- package/dist/core/reference-graph.js +138 -0
- package/dist/core/slice-data.d.ts +61 -0
- package/dist/core/slice-data.js +49 -0
- package/dist/runtime/chroma-key-gl.d.ts +40 -22
- package/dist/runtime/chroma-key-gl.js +189 -183
- package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
- package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
- package/dist/runtime/components/Image.svelte +1 -1
- package/dist/runtime/components/Image.svelte.d.ts +9 -0
- package/dist/runtime/components/Slice.svelte +1 -1
- package/dist/runtime/components/Slice.svelte.d.ts +19 -0
- package/dist/runtime/components/SliceCanvas.svelte +3 -3
- package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
- package/dist/runtime/components/SliceDom.svelte +3 -3
- package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
- package/dist/runtime/components/Video.svelte +2 -2
- package/dist/runtime/components/Video.svelte.d.ts +18 -0
- package/dist/runtime/geometry.d.ts +55 -35
- package/dist/runtime/geometry.js +186 -191
- package/dist/runtime/index.d.ts +9 -9
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/kind-handlers.d.ts +33 -30
- package/dist/runtime/kind-handlers.js +85 -67
- package/dist/runtime/manifest.d.ts +53 -47
- package/dist/runtime/manifest.js +133 -113
- package/dist/runtime/observe-border-box-size.d.ts +1 -4
- package/dist/runtime/observe-border-box-size.js +9 -10
- package/dist/runtime/preload-registry.d.ts +22 -8
- package/dist/runtime/preload-registry.js +65 -62
- package/dist/server/build.d.ts +8 -0
- package/dist/server/build.js +25 -0
- package/dist/server/check.d.ts +24 -0
- package/dist/server/check.js +199 -0
- package/dist/server/cli-commands.d.ts +25 -0
- package/dist/server/cli-commands.js +1178 -0
- package/dist/server/cli-init.d.ts +3 -0
- package/dist/server/cli-init.js +53 -0
- package/dist/server/cli-io.d.ts +46 -0
- package/dist/server/cli-io.js +105 -0
- package/dist/server/codegen.d.ts +58 -0
- package/dist/server/codegen.js +185 -0
- package/dist/server/config-loader.d.ts +35 -0
- package/dist/server/config-loader.js +79 -0
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.js +19 -0
- package/dist/server/folder-filesystem.d.ts +7 -0
- package/dist/server/folder-filesystem.js +39 -0
- package/dist/server/http.d.ts +12 -0
- package/dist/server/http.js +100 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +9 -0
- package/dist/server/job-hash.d.ts +10 -0
- package/dist/server/job-hash.js +23 -0
- package/dist/server/library-store.d.ts +82 -0
- package/dist/server/library-store.js +763 -0
- package/dist/server/operations.d.ts +87 -0
- package/dist/server/operations.js +427 -0
- package/dist/server/plugins/audio.d.ts +8 -0
- package/dist/server/plugins/audio.js +41 -0
- package/dist/server/plugins/chroma-key-video.d.ts +9 -0
- package/dist/server/plugins/chroma-key-video.js +40 -0
- package/dist/server/plugins/config.d.ts +13 -0
- package/dist/server/plugins/config.js +32 -0
- package/dist/server/plugins/contract.d.ts +114 -0
- package/dist/server/plugins/contract.js +16 -0
- package/dist/server/plugins/image.d.ts +9 -0
- package/dist/server/plugins/image.js +43 -0
- package/dist/server/plugins/slice.d.ts +15 -0
- package/dist/server/plugins/slice.js +76 -0
- package/dist/server/plugins/video.d.ts +7 -0
- package/dist/server/plugins/video.js +54 -0
- package/dist/server/plugins.d.ts +23 -0
- package/dist/server/plugins.js +35 -0
- package/dist/server/processing/audio-processing.d.ts +17 -0
- package/dist/server/processing/audio-processing.js +46 -0
- package/dist/server/processing/ffmpeg.d.ts +9 -0
- package/dist/server/processing/ffmpeg.js +50 -0
- package/dist/server/processing/image-processing.d.ts +16 -0
- package/dist/server/processing/image-processing.js +26 -0
- package/dist/server/processing/media-probe.d.ts +15 -0
- package/dist/server/processing/media-probe.js +27 -0
- package/dist/server/processing/processor.d.ts +50 -0
- package/dist/server/processing/processor.js +158 -0
- package/dist/server/processing/video-processing.d.ts +35 -0
- package/dist/server/processing/video-processing.js +87 -0
- package/dist/server/server.d.ts +13 -0
- package/dist/server/server.js +57 -0
- package/dist/server/start.d.ts +13 -0
- package/dist/server/start.js +80 -0
- package/package.json +31 -16
- package/dist/build-CZYFLLvl.js +0 -191
- package/dist/core/image-Dqmz8FXS.js +0 -54
- package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
- package/dist/core/testing.d.ts +0 -27
- package/dist/core/testing.js +0 -80
- package/dist/editor/200.html +0 -37
- package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
- package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
- package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
- package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
- package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
- package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
- package/dist/editor/_app/immutable/chunks/DjdrdRzT.js +0 -1
- package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
- package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
- package/dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js +0 -3
- package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
- package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
- package/dist/editor/_app/version.json +0 -1
- package/dist/index.d.ts +0 -370
- package/dist/index.js +0 -4
- package/dist/start-Bhnqt9Dc.js +0 -279
- package/dist/start-D2IXOrni.js +0 -2
- /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ask each asset's owning plugin for the references in its parameters. Assets
|
|
3
|
+
* whose type is unknown or whose parameters do not validate contribute no
|
|
4
|
+
* references — those problems are reported by the regular validation pass.
|
|
5
|
+
*/
|
|
6
|
+
export function collectAllReferences(library, plugins) {
|
|
7
|
+
const referencesByAsset = {};
|
|
8
|
+
for (const [assetId, record] of Object.entries(library.assets)) {
|
|
9
|
+
referencesByAsset[assetId] = [];
|
|
10
|
+
const plugin = plugins[record.type];
|
|
11
|
+
if (!plugin?.collectReferences)
|
|
12
|
+
continue;
|
|
13
|
+
try {
|
|
14
|
+
referencesByAsset[assetId] = plugin.collectReferences(plugin.validateParameters(record.parameters));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Invalid parameters — reported as a validation issue elsewhere.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return referencesByAsset;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Reference *errors* (they block build/codegen): a reference to an unknown
|
|
24
|
+
* asset, a target whose type is not among the field's expected types, and
|
|
25
|
+
* cycles (composition is acyclic by nature).
|
|
26
|
+
*/
|
|
27
|
+
export function referenceErrors(library, referencesByAsset) {
|
|
28
|
+
const issues = [];
|
|
29
|
+
for (const [assetId, references] of Object.entries(referencesByAsset)) {
|
|
30
|
+
for (const reference of references) {
|
|
31
|
+
if (!Object.hasOwn(library.assets, reference.assetId)) {
|
|
32
|
+
issues.push({
|
|
33
|
+
assetId,
|
|
34
|
+
message: `Reference "${reference.field}" points at unknown asset "${reference.assetId}".`
|
|
35
|
+
});
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const targetType = library.assets[reference.assetId].type;
|
|
39
|
+
if (reference.expectedTypes.length > 0 && !reference.expectedTypes.includes(targetType)) {
|
|
40
|
+
issues.push({
|
|
41
|
+
assetId,
|
|
42
|
+
message: `Reference "${reference.field}" points at "${reference.assetId}" of type ` +
|
|
43
|
+
`"${targetType}" — expected ${reference.expectedTypes.map((type) => `"${type}"`).join(' or ')}.`
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
issues.push(...cycleErrors(referencesByAsset));
|
|
49
|
+
return issues;
|
|
50
|
+
}
|
|
51
|
+
/** DFS cycle detection with an explicit stack path; each cycle reported once. */
|
|
52
|
+
function cycleErrors(referencesByAsset) {
|
|
53
|
+
const issues = [];
|
|
54
|
+
const finished = new Set();
|
|
55
|
+
const reportedCycles = new Set();
|
|
56
|
+
const stack = [];
|
|
57
|
+
const onStack = new Set();
|
|
58
|
+
function visit(assetId) {
|
|
59
|
+
if (finished.has(assetId))
|
|
60
|
+
return;
|
|
61
|
+
if (onStack.has(assetId)) {
|
|
62
|
+
const cyclePath = [...stack.slice(stack.indexOf(assetId)), assetId];
|
|
63
|
+
// Canonical key so `a → b → a` and `b → a → b` report once.
|
|
64
|
+
const cycleKey = [...new Set(cyclePath)].sort().join('\u0000');
|
|
65
|
+
if (!reportedCycles.has(cycleKey)) {
|
|
66
|
+
reportedCycles.add(cycleKey);
|
|
67
|
+
issues.push({
|
|
68
|
+
assetId: cyclePath[0],
|
|
69
|
+
message: `Reference cycle: ${cyclePath.map((id) => `"${id}"`).join(' → ')} — references express composition and must stay acyclic.`
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
stack.push(assetId);
|
|
75
|
+
onStack.add(assetId);
|
|
76
|
+
for (const reference of referencesByAsset[assetId] ?? []) {
|
|
77
|
+
if (Object.hasOwn(referencesByAsset, reference.assetId))
|
|
78
|
+
visit(reference.assetId);
|
|
79
|
+
}
|
|
80
|
+
stack.pop();
|
|
81
|
+
onStack.delete(assetId);
|
|
82
|
+
finished.add(assetId);
|
|
83
|
+
}
|
|
84
|
+
for (const assetId of Object.keys(referencesByAsset))
|
|
85
|
+
visit(assetId);
|
|
86
|
+
return issues;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The transitive reference closure of a set of assets, including the starting
|
|
90
|
+
* set — the assets that must be delivered so the starting set renders as
|
|
91
|
+
* authored. Tolerates cycles and ignores dangling targets (both are reported
|
|
92
|
+
* as errors by `referenceErrors`).
|
|
93
|
+
*/
|
|
94
|
+
export function referenceClosure(assetIds, referencesByAsset) {
|
|
95
|
+
const closure = new Set();
|
|
96
|
+
const pending = [...assetIds];
|
|
97
|
+
while (pending.length > 0) {
|
|
98
|
+
const assetId = pending.pop();
|
|
99
|
+
if (closure.has(assetId) || !Object.hasOwn(referencesByAsset, assetId))
|
|
100
|
+
continue;
|
|
101
|
+
closure.add(assetId);
|
|
102
|
+
for (const reference of referencesByAsset[assetId]) {
|
|
103
|
+
pending.push(reference.assetId);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return closure;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A dependencies-first order over `assetIds` and everything they transitively
|
|
110
|
+
* reference — the build order that lets each entry inline its references from
|
|
111
|
+
* already-built entries. Throws on a cycle (with the cycle path).
|
|
112
|
+
*/
|
|
113
|
+
export function topologicalReferenceOrder(assetIds, referencesByAsset) {
|
|
114
|
+
const order = [];
|
|
115
|
+
const finished = new Set();
|
|
116
|
+
const stack = [];
|
|
117
|
+
const onStack = new Set();
|
|
118
|
+
function visit(assetId) {
|
|
119
|
+
if (finished.has(assetId) || !Object.hasOwn(referencesByAsset, assetId))
|
|
120
|
+
return;
|
|
121
|
+
if (onStack.has(assetId)) {
|
|
122
|
+
const cyclePath = [...stack.slice(stack.indexOf(assetId)), assetId];
|
|
123
|
+
throw new Error(`Reference cycle: ${cyclePath.map((id) => `"${id}"`).join(' → ')} — cannot order entries.`);
|
|
124
|
+
}
|
|
125
|
+
stack.push(assetId);
|
|
126
|
+
onStack.add(assetId);
|
|
127
|
+
for (const reference of referencesByAsset[assetId]) {
|
|
128
|
+
visit(reference.assetId);
|
|
129
|
+
}
|
|
130
|
+
stack.pop();
|
|
131
|
+
onStack.delete(assetId);
|
|
132
|
+
finished.add(assetId);
|
|
133
|
+
order.push(assetId);
|
|
134
|
+
}
|
|
135
|
+
for (const assetId of assetIds)
|
|
136
|
+
visit(assetId);
|
|
137
|
+
return order;
|
|
138
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slice data model keeps the source image separate from slicing metadata
|
|
3
|
+
* (Fundus tracks raw files and
|
|
4
|
+
* proxy dimensions separately), so there is no `SliceSource` here.
|
|
5
|
+
*
|
|
6
|
+
* The geometry is stored as **insets** (border thickness in source pixels), the
|
|
7
|
+
* canonical, render-ready form — equivalent to CSS `border-image-slice`.
|
|
8
|
+
* `slicedAxesFor` is the single source of truth for which axes each mode uses.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SLICE_MODES: readonly ["nine", "three-horizontal", "three-vertical", "one"];
|
|
11
|
+
export type SliceMode = (typeof SLICE_MODES)[number];
|
|
12
|
+
/** Border thickness in source pixels. Always integers (pixel-precise). */
|
|
13
|
+
export interface SliceInsets {
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Full slicing description for an image, independent of which image it applies
|
|
21
|
+
* to. Stored in the library as (part of) the slice plugin's parameters and
|
|
22
|
+
* emitted into generated manifest entries.
|
|
23
|
+
*/
|
|
24
|
+
export interface Slicing {
|
|
25
|
+
mode: SliceMode;
|
|
26
|
+
insets: SliceInsets;
|
|
27
|
+
/**
|
|
28
|
+
* Source pixels per CSS pixel — the scale the asset was exported at
|
|
29
|
+
* (`1` = @1x, `2` = @2x, `3` = @3x). All fixed slice dimensions (9-slice
|
|
30
|
+
* corners) are divided by this when rendering, so a high-resolution asset
|
|
31
|
+
* displays at its intended logical size.
|
|
32
|
+
*/
|
|
33
|
+
pixelRatio: number;
|
|
34
|
+
/**
|
|
35
|
+
* Per-side thickness (in source pixels) of the image's baked-in overdraw — a
|
|
36
|
+
* drop shadow / glow painted around the actual element. The renderers treat
|
|
37
|
+
* the image **minus** the overdraw as the element: that core fills the layout
|
|
38
|
+
* box, and the overdraw band is painted outside it (like a CSS `box-shadow`).
|
|
39
|
+
* Optional: absent means no overdraw.
|
|
40
|
+
*/
|
|
41
|
+
overdraw?: SliceInsets;
|
|
42
|
+
}
|
|
43
|
+
/** All-zero insets — the "no overdraw" value. */
|
|
44
|
+
export declare function createZeroInsets(): SliceInsets;
|
|
45
|
+
/**
|
|
46
|
+
* Default insets for a freshly ingested image: each border a quarter of the
|
|
47
|
+
* corresponding dimension (at least 1px where the image is large enough),
|
|
48
|
+
* always clamped so a center of at least one source pixel remains on each
|
|
49
|
+
* axis. For an axis too small for insets + a 1px center (width/height ≤ 2)
|
|
50
|
+
* the insets on that axis are 0 — structurally valid slicing for any size ≥ 1.
|
|
51
|
+
*/
|
|
52
|
+
export declare function defaultInsetsForSize(width: number, height: number): SliceInsets;
|
|
53
|
+
/** Which source-image axes are sliced for a mode. */
|
|
54
|
+
export declare function slicedAxesFor(mode: SliceMode): {
|
|
55
|
+
horizontal: boolean;
|
|
56
|
+
vertical: boolean;
|
|
57
|
+
};
|
|
58
|
+
/** Maximum inset on one side while preserving the opposite inset. */
|
|
59
|
+
export declare function maxInset(insets: SliceInsets, side: keyof SliceInsets, width: number, height: number): number;
|
|
60
|
+
/** Maximum overdraw on one side while preserving at least one core source pixel. */
|
|
61
|
+
export declare function maxOverdraw(overdraw: SliceInsets, side: keyof SliceInsets, width: number, height: number): number;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slice data model keeps the source image separate from slicing metadata
|
|
3
|
+
* (Fundus tracks raw files and
|
|
4
|
+
* proxy dimensions separately), so there is no `SliceSource` here.
|
|
5
|
+
*
|
|
6
|
+
* The geometry is stored as **insets** (border thickness in source pixels), the
|
|
7
|
+
* canonical, render-ready form — equivalent to CSS `border-image-slice`.
|
|
8
|
+
* `slicedAxesFor` is the single source of truth for which axes each mode uses.
|
|
9
|
+
*/
|
|
10
|
+
export const SLICE_MODES = ['nine', 'three-horizontal', 'three-vertical', 'one'];
|
|
11
|
+
/** All-zero insets — the "no overdraw" value. */
|
|
12
|
+
export function createZeroInsets() {
|
|
13
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Default insets for a freshly ingested image: each border a quarter of the
|
|
17
|
+
* corresponding dimension (at least 1px where the image is large enough),
|
|
18
|
+
* always clamped so a center of at least one source pixel remains on each
|
|
19
|
+
* axis. For an axis too small for insets + a 1px center (width/height ≤ 2)
|
|
20
|
+
* the insets on that axis are 0 — structurally valid slicing for any size ≥ 1.
|
|
21
|
+
*/
|
|
22
|
+
export function defaultInsetsForSize(width, height) {
|
|
23
|
+
// max(1, quarter) is the desired border; min(…, floor((size − 1) / 2)) caps
|
|
24
|
+
// it so `2 × inset ≤ size − 1`, i.e. the center keeps ≥ 1 source pixel.
|
|
25
|
+
const horizontal = Math.min(Math.max(1, Math.floor(width / 4)), Math.floor((width - 1) / 2));
|
|
26
|
+
const vertical = Math.min(Math.max(1, Math.floor(height / 4)), Math.floor((height - 1) / 2));
|
|
27
|
+
return { top: vertical, right: horizontal, bottom: vertical, left: horizontal };
|
|
28
|
+
}
|
|
29
|
+
/** Which source-image axes are sliced for a mode. */
|
|
30
|
+
export function slicedAxesFor(mode) {
|
|
31
|
+
return {
|
|
32
|
+
horizontal: mode === 'nine' || mode === 'three-horizontal',
|
|
33
|
+
vertical: mode === 'nine' || mode === 'three-vertical'
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Maximum inset on one side while preserving the opposite inset. */
|
|
37
|
+
export function maxInset(insets, side, width, height) {
|
|
38
|
+
if (side === 'left')
|
|
39
|
+
return width - insets.right;
|
|
40
|
+
if (side === 'right')
|
|
41
|
+
return width - insets.left;
|
|
42
|
+
if (side === 'top')
|
|
43
|
+
return height - insets.bottom;
|
|
44
|
+
return height - insets.top;
|
|
45
|
+
}
|
|
46
|
+
/** Maximum overdraw on one side while preserving at least one core source pixel. */
|
|
47
|
+
export function maxOverdraw(overdraw, side, width, height) {
|
|
48
|
+
return maxInset(overdraw, side, width, height) - 1;
|
|
49
|
+
}
|
|
@@ -1,23 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
/**
|
|
2
|
+
* WebGL2 chroma-key video renderer based on the public UnityChromakey shader
|
|
3
|
+
* (https://github.com/otdavies/UnityChromakey, `Shaders/ChromaKey.shader`) so a
|
|
4
|
+
* greenscreen video plays with a transparent background.
|
|
5
|
+
*
|
|
6
|
+
* The keying algorithm follows the upstream shader: the key color and each
|
|
7
|
+
* pixel are converted to YCbCr chroma (Cb/Cr), the squared chroma distance is mapped
|
|
8
|
+
* through a cutoff/feather window (`colorclose`), the resulting mask is blurred with a
|
|
9
|
+
* 3×3 neighbourhood + smoothstep-sharpened, the keyed color is despilled (green pulled
|
|
10
|
+
* toward the red/blue average, lost luminance re-added), and the output is
|
|
11
|
+
* `vec4(color * mask, mask)` — the upstream output formula (tint fixed at white; tinting
|
|
12
|
+
* is host styling, not asset data) — emitted premultiplied (rgb × alpha) for the canvas
|
|
13
|
+
* compositor (see the fragColor note).
|
|
14
|
+
*
|
|
15
|
+
* Fundus adds an optional mask pass (`setMask`): a grayscale image
|
|
16
|
+
* sampled at the same UVs whose luminance multiplies the final alpha — white keeps a
|
|
17
|
+
* pixel, black drops it, gray fades it (no alpha clip). Absent a mask, a 1×1 white
|
|
18
|
+
* fallback texture makes the pass a no-op.
|
|
19
|
+
*
|
|
20
|
+
* Owns its own GL context on the given canvas. `create` returns null when WebGL2 is
|
|
21
|
+
* unavailable. Browser-only; the caller drives it per frame with the playing <video>.
|
|
22
|
+
*/
|
|
23
|
+
import type { ChromaKeyParameters } from '../core/index.js';
|
|
24
|
+
export declare class ChromaKeyGl {
|
|
25
|
+
#private;
|
|
26
|
+
/** Returns null when WebGL2 is unavailable or the shader fails to compile. */
|
|
27
|
+
static create(canvas: HTMLCanvasElement): ChromaKeyGl | null;
|
|
28
|
+
private constructor();
|
|
29
|
+
/**
|
|
30
|
+
* Set (or clear) the grayscale shape mask multiplied onto the output alpha. The
|
|
31
|
+
* mask is stretched over the full video frame, so author it at the video's aspect
|
|
32
|
+
* ratio. Pass null to remove the mask.
|
|
33
|
+
*/
|
|
34
|
+
setMask(image: TexImageSource | null): void;
|
|
35
|
+
/**
|
|
36
|
+
* Upload the video's current frame and render it keyed. Sizes the drawing buffer to
|
|
37
|
+
* the video's intrinsic size on first draw (and after a size change).
|
|
38
|
+
*/
|
|
39
|
+
draw(video: HTMLVideoElement, parameters: ChromaKeyParameters): void;
|
|
40
|
+
dispose(): void;
|
|
21
41
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ChromaKeyGl };
|