fundus 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -26
- package/build/client/_app/immutable/chunks/{DWHqxOBm.js → C4w39LtR.js} +1 -1
- package/build/client/_app/immutable/chunks/C4w39LtR.js.br +1 -0
- package/build/client/_app/immutable/chunks/C4w39LtR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Co7xGpqv.js → DGy-bMvO.js} +1 -1
- package/build/client/_app/immutable/chunks/DGy-bMvO.js.br +0 -0
- package/build/client/_app/immutable/chunks/DGy-bMvO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CVeOwywf.js → WV4B0d_0.js} +2 -2
- package/build/client/_app/immutable/chunks/WV4B0d_0.js.br +0 -0
- package/build/client/_app/immutable/chunks/WV4B0d_0.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.BvNykvNA.js → app.GgnXYpzJ.js} +2 -2
- package/build/client/_app/immutable/entry/app.GgnXYpzJ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.GgnXYpzJ.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.O9RwuDjf.js +1 -0
- package/build/client/_app/immutable/entry/start.O9RwuDjf.js.br +0 -0
- package/build/client/_app/immutable/entry/start.O9RwuDjf.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.C-TKgrGP.js → 0.D1g1plhI.js} +1 -1
- package/build/client/_app/immutable/nodes/0.D1g1plhI.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.D1g1plhI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.q-uG--Ye.js → 1.DzAnL2O6.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DzAnL2O6.js.br +2 -0
- package/build/client/_app/immutable/nodes/1.DzAnL2O6.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.EtCNRoA2.js → 2.BMN1YTJ4.js} +1 -1
- package/build/client/_app/immutable/nodes/2.BMN1YTJ4.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BMN1YTJ4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.D7nMxWez.js → 3.DL_TiE5x.js} +1 -1
- package/build/client/_app/immutable/nodes/3.DL_TiE5x.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.DL_TiE5x.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.B3M1zSBU.js → 4.D7FHmbgq.js} +1 -1
- package/build/client/_app/immutable/nodes/4.D7FHmbgq.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.D7FHmbgq.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/handler.js +7 -7
- package/build/index.js +7 -7
- package/build/server/chunks/chunks/{exports.js-BmD4UbfP.js → exports.js-BAfR8rsb.js} +2 -2
- package/build/server/chunks/chunks/{exports.js-BmD4UbfP.js.map → exports.js-BAfR8rsb.js.map} +1 -1
- package/build/server/chunks/chunks/{internal.js-CamOhpYX.js → internal.js-B3hOADoz.js} +2 -2
- package/build/server/chunks/chunks/{internal.js-CamOhpYX.js.map → internal.js-B3hOADoz.js.map} +1 -1
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -1
- package/build/server/chunks/chunks/{shared.js-z20dV9L6.js → shared.js-DN477dAr.js} +2 -2
- package/build/server/chunks/chunks/{shared.js-z20dV9L6.js.map → shared.js-DN477dAr.js.map} +1 -1
- package/build/server/chunks/chunks/{utils.js-CCdpL1Io.js → utils.js-zf3Q16Eh.js} +3 -3
- package/build/server/chunks/chunks/{utils.js-CCdpL1Io.js.map → utils.js-zf3Q16Eh.js.map} +1 -1
- package/build/server/chunks/{handler-B2BaQ6Ml.js → handler-BN27c-Da.js} +5 -5
- package/build/server/chunks/{handler-B2BaQ6Ml.js.map → handler-BN27c-Da.js.map} +1 -1
- package/build/server/chunks/{index.js-B77LinCI.js → index.js-C1f-Qrf0.js} +5 -5
- package/build/server/chunks/{index.js-B77LinCI.js.map → index.js-C1f-Qrf0.js.map} +1 -1
- package/build/server/chunks/{manifest.js-DBhPPiGl.js → manifest.js-CFkuYTzu.js} +7 -7
- package/build/server/chunks/{manifest.js-DBhPPiGl.js.map → manifest.js-CFkuYTzu.js.map} +1 -1
- package/build/server/chunks/nodes/{0.js-bzZzX1Nn.js → 0.js-B1i6yC_e.js} +2 -2
- package/build/server/chunks/nodes/{0.js-bzZzX1Nn.js.map → 0.js-B1i6yC_e.js.map} +1 -1
- package/build/server/chunks/nodes/1.js-Bv64OO0t.js +7 -0
- package/build/server/chunks/nodes/{1.js-CQ-mFntC.js.map → 1.js-Bv64OO0t.js.map} +1 -1
- package/build/server/chunks/nodes/{2.js-BSGPEoRK.js → 2.js-DivaYfS1.js} +2 -2
- package/build/server/chunks/nodes/{2.js-BSGPEoRK.js.map → 2.js-DivaYfS1.js.map} +1 -1
- package/build/server/chunks/nodes/3.js-CUAbHOxb.js +7 -0
- package/build/server/chunks/nodes/{3.js-BzUyw6Q9.js.map → 3.js-CUAbHOxb.js.map} +1 -1
- package/build/server/chunks/nodes/{4.js-vMj7JX0_.js → 4.js-Ceg0ylPI.js} +2 -2
- package/build/server/chunks/nodes/{4.js-vMj7JX0_.js.map → 4.js-Ceg0ylPI.js.map} +1 -1
- package/dist/core/manifest-entry.d.ts +6 -7
- package/dist/runtime/canvas.d.ts +23 -17
- package/dist/runtime/canvas.js +44 -33
- package/dist/runtime/components/Slice.svelte +4 -4
- package/dist/runtime/geometry.d.ts +61 -33
- package/dist/runtime/geometry.js +54 -38
- package/dist/runtime/index.d.ts +6 -4
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/kind-handlers.d.ts +1 -26
- package/dist/runtime/kind-handlers.js +13 -29
- package/dist/runtime/manifest.d.ts +13 -15
- package/dist/runtime/manifest.js +23 -23
- package/dist/runtime/preload-registry.d.ts +4 -23
- package/dist/runtime/preload-registry.js +24 -5
- package/dist/runtime/retained-entry.d.ts +48 -0
- package/dist/runtime/retained-entry.js +61 -0
- package/dist/runtime/retained-entry.svelte.d.ts +26 -0
- package/dist/runtime/retained-entry.svelte.js +62 -0
- package/package.json +1 -1
- package/build/client/_app/immutable/chunks/CVeOwywf.js.br +0 -0
- package/build/client/_app/immutable/chunks/CVeOwywf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Co7xGpqv.js.br +0 -0
- package/build/client/_app/immutable/chunks/Co7xGpqv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DWHqxOBm.js.br +0 -0
- package/build/client/_app/immutable/chunks/DWHqxOBm.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BvNykvNA.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BvNykvNA.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DfWWrqAi.js +0 -1
- package/build/client/_app/immutable/entry/start.DfWWrqAi.js.br +0 -0
- package/build/client/_app/immutable/entry/start.DfWWrqAi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.C-TKgrGP.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.C-TKgrGP.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.q-uG--Ye.js.br +0 -2
- package/build/client/_app/immutable/nodes/1.q-uG--Ye.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.EtCNRoA2.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.EtCNRoA2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.D7nMxWez.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.D7nMxWez.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.B3M1zSBU.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.B3M1zSBU.js.gz +0 -0
- package/build/server/chunks/nodes/1.js-CQ-mFntC.js +0 -7
- package/build/server/chunks/nodes/3.js-BzUyw6Q9.js +0 -7
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { assertEntryByteSize } from './manifest.js';
|
|
2
|
+
import { acquireSource, releaseSource, resolveRetainedImageSource, resolveRetainedSource } from './preload-registry.js';
|
|
3
|
+
class Handle {
|
|
4
|
+
entry;
|
|
5
|
+
/** `null` once released. */
|
|
6
|
+
#source;
|
|
7
|
+
constructor(entry, source) {
|
|
8
|
+
this.entry = entry;
|
|
9
|
+
this.#source = source;
|
|
10
|
+
}
|
|
11
|
+
// A prototype getter, so spreading, proxying or serializing a handle never
|
|
12
|
+
// reads it — only an explicit access after release throws.
|
|
13
|
+
get source() {
|
|
14
|
+
if (this.#source === null) {
|
|
15
|
+
throw new Error(`EntryHandle "${this.entry.id}" was released.`);
|
|
16
|
+
}
|
|
17
|
+
return this.#source;
|
|
18
|
+
}
|
|
19
|
+
release = () => {
|
|
20
|
+
if (this.#source === null)
|
|
21
|
+
return;
|
|
22
|
+
this.#source = null;
|
|
23
|
+
releaseSource(this.entry.src);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Take one hold on `entry`'s own source and resolve with a handle to it once
|
|
28
|
+
* loaded. An already loaded source (e.g. after `manifest.preload()`) resolves
|
|
29
|
+
* without loading, a source in flight is joined, and an absent one loads via
|
|
30
|
+
* its kind — deduplicated and cached exactly like `preload()`. Only the
|
|
31
|
+
* entry's own `src` is retained: a chroma-key-video's `mask` and `fallback`
|
|
32
|
+
* are separate entries to retain on their own.
|
|
33
|
+
*
|
|
34
|
+
* The hold lasts until `release()`, even when the source was already
|
|
35
|
+
* preloaded; while any holder keeps it, the source object stays the same.
|
|
36
|
+
* Always release, including when a caller stops waiting for the promise.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} (rejects) When the entry's `byteSize` is invalid, the load
|
|
39
|
+
* fails, or an image-backed source cannot be decoded in this environment.
|
|
40
|
+
* A rejection leaves no hold behind.
|
|
41
|
+
*/
|
|
42
|
+
export async function retainEntry(entry) {
|
|
43
|
+
const { id, kind, src, byteSize } = entry;
|
|
44
|
+
assertEntryByteSize(src, byteSize);
|
|
45
|
+
try {
|
|
46
|
+
await acquireSource(src, kind, byteSize, entry);
|
|
47
|
+
}
|
|
48
|
+
catch (cause) {
|
|
49
|
+
releaseSource(src);
|
|
50
|
+
throw cause;
|
|
51
|
+
}
|
|
52
|
+
if (kind === 'image' || kind === 'slice') {
|
|
53
|
+
const source = resolveRetainedImageSource(src);
|
|
54
|
+
if (source === null) {
|
|
55
|
+
releaseSource(src);
|
|
56
|
+
throw new Error(`Cannot retain "${id}": this environment cannot decode ${kind} sources.`);
|
|
57
|
+
}
|
|
58
|
+
return new Handle(entry, source);
|
|
59
|
+
}
|
|
60
|
+
return new Handle(entry, resolveRetainedSource(src));
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ManifestEntry } from '../core/index.js';
|
|
2
|
+
import { type RetainedSourceOf } from './retained-entry.js';
|
|
3
|
+
export type RetainedEntryStatus = 'loading' | 'ready' | 'error' | 'released';
|
|
4
|
+
/**
|
|
5
|
+
* One hold on `entry`'s own source for the lifetime of the constructing
|
|
6
|
+
* component, shared with manifests and handles exactly like `retainEntry`.
|
|
7
|
+
* Construct it during component initialisation; the hold is dropped on
|
|
8
|
+
* destroy, including when the load is still in flight.
|
|
9
|
+
*
|
|
10
|
+
* Loading starts on mount, so server rendering never loads and reports
|
|
11
|
+
* `loading`.
|
|
12
|
+
*
|
|
13
|
+
* @throws {Error} When constructed outside component initialisation.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RetainedEntry<E extends ManifestEntry> {
|
|
16
|
+
#private;
|
|
17
|
+
readonly entry: E;
|
|
18
|
+
constructor(entry: E);
|
|
19
|
+
/** The loaded source; `undefined` while loading, after an error, and after release. */
|
|
20
|
+
get source(): RetainedSourceOf<E> | undefined;
|
|
21
|
+
get status(): RetainedEntryStatus;
|
|
22
|
+
/** The rejection reason while `status` is `error`. */
|
|
23
|
+
get error(): unknown;
|
|
24
|
+
/** Drop the hold before destroy. Idempotent; safe to call unbound. */
|
|
25
|
+
readonly release: () => void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component-scoped retention: an `EntryHandle` whose lifetime follows the
|
|
3
|
+
* component that creates it, with the source exposed as reactive state.
|
|
4
|
+
*/
|
|
5
|
+
import { onDestroy, onMount } from 'svelte';
|
|
6
|
+
import { retainEntry } from './retained-entry.js';
|
|
7
|
+
/**
|
|
8
|
+
* One hold on `entry`'s own source for the lifetime of the constructing
|
|
9
|
+
* component, shared with manifests and handles exactly like `retainEntry`.
|
|
10
|
+
* Construct it during component initialisation; the hold is dropped on
|
|
11
|
+
* destroy, including when the load is still in flight.
|
|
12
|
+
*
|
|
13
|
+
* Loading starts on mount, so server rendering never loads and reports
|
|
14
|
+
* `loading`.
|
|
15
|
+
*
|
|
16
|
+
* @throws {Error} When constructed outside component initialisation.
|
|
17
|
+
*/
|
|
18
|
+
export class RetainedEntry {
|
|
19
|
+
entry;
|
|
20
|
+
#handle = $state.raw();
|
|
21
|
+
#status = $state('loading');
|
|
22
|
+
#error = $state.raw();
|
|
23
|
+
constructor(entry) {
|
|
24
|
+
this.entry = entry;
|
|
25
|
+
onMount(() => {
|
|
26
|
+
if (this.#status === 'released')
|
|
27
|
+
return;
|
|
28
|
+
retainEntry(entry).then((handle) => {
|
|
29
|
+
if (this.#status === 'released') {
|
|
30
|
+
handle.release();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.#handle = handle;
|
|
34
|
+
this.#status = 'ready';
|
|
35
|
+
}, (error) => {
|
|
36
|
+
// A rejected retain leaves no hold behind.
|
|
37
|
+
if (this.#status === 'released')
|
|
38
|
+
return;
|
|
39
|
+
this.#error = error;
|
|
40
|
+
this.#status = 'error';
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
onDestroy(this.release);
|
|
44
|
+
}
|
|
45
|
+
/** The loaded source; `undefined` while loading, after an error, and after release. */
|
|
46
|
+
get source() {
|
|
47
|
+
return this.#handle?.source;
|
|
48
|
+
}
|
|
49
|
+
get status() {
|
|
50
|
+
return this.#status;
|
|
51
|
+
}
|
|
52
|
+
/** The rejection reason while `status` is `error`. */
|
|
53
|
+
get error() {
|
|
54
|
+
return this.#error;
|
|
55
|
+
}
|
|
56
|
+
/** Drop the hold before destroy. Idempotent; safe to call unbound. */
|
|
57
|
+
release = () => {
|
|
58
|
+
this.#status = 'released';
|
|
59
|
+
this.#handle?.release();
|
|
60
|
+
this.#handle = undefined;
|
|
61
|
+
};
|
|
62
|
+
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,r as t}from"../chunks/Co7xGpqv.js";export{e as load_css,t as start};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const index = 1;
|
|
2
|
-
const imports = ["_app/immutable/nodes/1.q-uG--Ye.js","_app/immutable/chunks/DLEDBLL1.js","_app/immutable/chunks/xihTtKlq.js","_app/immutable/chunks/DWHqxOBm.js","_app/immutable/chunks/Co7xGpqv.js"];
|
|
3
|
-
const stylesheets = [];
|
|
4
|
-
const fonts = [];
|
|
5
|
-
|
|
6
|
-
export { fonts, imports, index, stylesheets };
|
|
7
|
-
//# sourceMappingURL=1.js-CQ-mFntC.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const index = 3;
|
|
2
|
-
const imports = ["_app/immutable/nodes/3.D7nMxWez.js","_app/immutable/chunks/DLEDBLL1.js","_app/immutable/chunks/Co7xGpqv.js","_app/immutable/chunks/xihTtKlq.js","_app/immutable/chunks/DWHqxOBm.js","_app/immutable/chunks/Cml0-AYv.js","_app/immutable/chunks/CVeOwywf.js","_app/immutable/chunks/DGYcFVZ3.js","_app/immutable/chunks/CzxolZCO.js"];
|
|
3
|
-
const stylesheets = ["_app/immutable/assets/ManifestSelector.Cue3sCA1.css","_app/immutable/assets/Popover.CCTioPJZ.css","_app/immutable/assets/AssetSourceMenu.DWPxyX6L.css","_app/immutable/assets/3.OulZ54CG.css"];
|
|
4
|
-
const fonts = [];
|
|
5
|
-
|
|
6
|
-
export { fonts, imports, index, stylesheets };
|
|
7
|
-
//# sourceMappingURL=3.js-BzUyw6Q9.js.map
|