@liquid-glass-forge/dom 0.1.0-rc.1 → 0.1.0-rc.2
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 +21 -3
- package/dist/cpu.d.ts +7 -2
- package/dist/cpu.js +7 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <img src="https://raw.githubusercontent.com/namipsg/liquid-glass-forge/main/showcase/public/frameworks/vanilla.svg" width="20" height="20" alt=""> @liquid-glass-forge/dom
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Render glass on native HTML controls with explicit media sources and shared scenes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[Live showcase](https://namipsg.github.io/liquid-glass-forge/#playground) · [Examples](https://namipsg.github.io/liquid-glass-forge/examples.html) · [Documentation](https://github.com/namipsg/liquid-glass-forge/blob/main/docs/HOSTS.md) · [Support](https://namipsg.github.io/liquid-glass-forge/support.html)
|
|
6
|
+
|
|
7
|
+
## Install in Vanilla JS
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @liquid-glass-forge/dom@next
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The starter uses CSS glass. Keep the Forge packages at matching versions.
|
|
14
|
+
The [live installer](https://namipsg.github.io/liquid-glass-forge/?framework=vanilla#developers)
|
|
15
|
+
shows verified exact versions and has a copy button.
|
|
16
|
+
|
|
17
|
+
[Open the Vanilla JS starter](https://github.com/namipsg/liquid-glass-forge/blob/main/docs/QUICKSTART.md#vanilla) · [Add WebGL refraction](https://github.com/namipsg/liquid-glass-forge/blob/main/docs/QUICKSTART.md#add-webgl-refraction)
|
|
18
|
+
|
|
19
|
+
[](https://namipsg.github.io/liquid-glass-forge/#playground)
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Experimental preview `0.1.0-rc.2` sources, coordinate mapping and vanilla host/lifecycle.
|
|
6
24
|
Requires exact matching core/CPU package versions. ESM and TypeScript
|
|
7
25
|
declarations are included; imports are SSR-safe and start no timers or network.
|
|
8
26
|
|
package/dist/cpu.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface CpuRendererOptions {
|
|
|
19
19
|
readonly maxHeight?: number;
|
|
20
20
|
readonly maxUpdatesPerSecond?: number;
|
|
21
21
|
readonly maxSourcePixels?: number;
|
|
22
|
+
/** Explicit active-interaction policy; balanced/default retains its 30 Hz limit. */
|
|
23
|
+
readonly cadence?: 'balanced' | 'interactive';
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
/** One scene owns this adapter. Initialization owns resources; construction only snapshots data. */
|
|
@@ -45,13 +47,16 @@ export declare class CpuRenderer implements GlassRenderer {
|
|
|
45
47
|
effectiveHeight: number | undefined;
|
|
46
48
|
qualityReduced: boolean;
|
|
47
49
|
reasons: readonly string[];
|
|
48
|
-
quality: Required<{
|
|
50
|
+
quality: Required<Omit<{
|
|
49
51
|
readonly maxPixels?: number;
|
|
50
52
|
readonly maxWidth?: number;
|
|
51
53
|
readonly maxHeight?: number;
|
|
52
54
|
readonly maxUpdatesPerSecond?: number;
|
|
53
55
|
readonly maxSourcePixels?: number;
|
|
54
|
-
|
|
56
|
+
/** Explicit active-interaction policy; balanced/default retains its 30 Hz limit. */
|
|
57
|
+
readonly cadence?: 'balanced' | 'interactive';
|
|
58
|
+
}, "cadence">>;
|
|
59
|
+
cadencePolicy?: "interactive";
|
|
55
60
|
timings: (CpuTimings & {
|
|
56
61
|
readonly captureMs: number;
|
|
57
62
|
readonly rateWaitMs: number;
|
package/dist/cpu.js
CHANGED
|
@@ -49,6 +49,7 @@ export class CpuRenderer {
|
|
|
49
49
|
#effects;
|
|
50
50
|
#sourceRect;
|
|
51
51
|
#quality;
|
|
52
|
+
#cadence;
|
|
52
53
|
#executor;
|
|
53
54
|
#pacer;
|
|
54
55
|
#cleanup;
|
|
@@ -75,7 +76,10 @@ export class CpuRenderer {
|
|
|
75
76
|
this.#effects = snapshotCpuEffects(options.effects);
|
|
76
77
|
this.#sourceRect = typeof options.sourceRect === 'function' || options.sourceRect === undefined ? options.sourceRect : sourceRect(options.sourceRect);
|
|
77
78
|
const quality = options.quality === undefined ? {} : options.quality;
|
|
78
|
-
object(quality, ['maxPixels', 'maxWidth', 'maxHeight', 'maxUpdatesPerSecond', 'maxSourcePixels'], 'quality');
|
|
79
|
+
object(quality, ['maxPixels', 'maxWidth', 'maxHeight', 'maxUpdatesPerSecond', 'maxSourcePixels', 'cadence'], 'quality');
|
|
80
|
+
if (quality.cadence !== undefined && !['balanced', 'interactive'].includes(quality.cadence))
|
|
81
|
+
throw new CpuError('INVALID_OPTIONS', 'Invalid CPU cadence policy');
|
|
82
|
+
this.#cadence = quality.cadence ?? 'balanced';
|
|
79
83
|
const q = { maxPixels: quality.maxPixels === undefined ? 57600 : quality.maxPixels,
|
|
80
84
|
maxWidth: quality.maxWidth === undefined ? 320 : quality.maxWidth, maxHeight: quality.maxHeight === undefined ? 180 : quality.maxHeight,
|
|
81
85
|
maxUpdatesPerSecond: quality.maxUpdatesPerSecond === undefined ? 30 : quality.maxUpdatesPerSecond,
|
|
@@ -85,7 +89,7 @@ export class CpuRenderer {
|
|
|
85
89
|
if (!Number.isSafeInteger(q[key]))
|
|
86
90
|
throw new CpuError('INVALID_OPTIONS', `${key} must be an integer`);
|
|
87
91
|
}
|
|
88
|
-
finite(q.maxUpdatesPerSecond, 1, 30, 'maxUpdatesPerSecond');
|
|
92
|
+
finite(q.maxUpdatesPerSecond, 1, this.#cadence === 'interactive' ? 60 : 30, 'maxUpdatesPerSecond');
|
|
89
93
|
this.#quality = Object.freeze(q);
|
|
90
94
|
}
|
|
91
95
|
executorDiagnostics() { return this.#executor.diagnostics; }
|
|
@@ -96,7 +100,7 @@ export class CpuRenderer {
|
|
|
96
100
|
requestedWidth: this.#requested?.width, requestedHeight: this.#requested?.height,
|
|
97
101
|
effectiveWidth: this.#effective?.width, effectiveHeight: this.#effective?.height,
|
|
98
102
|
qualityReduced: this.#reasons.length > 0, reasons: this.#reasons, quality: this.#quality,
|
|
99
|
-
timings: this.#timings, surface: this.#lastSurface, executor });
|
|
103
|
+
...(this.#cadence === 'interactive' ? { cadencePolicy: this.#cadence } : {}), timings: this.#timings, surface: this.#lastSurface, executor });
|
|
100
104
|
}
|
|
101
105
|
initialize(signal) {
|
|
102
106
|
if (this.#disposed)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liquid-glass-forge/dom",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.2",
|
|
4
4
|
"description": "Experimental explicit sources, coordinates and vanilla host lifecycle for Liquid Glass Forge",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"README.md"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@liquid-glass-forge/core": "0.1.0-rc.
|
|
30
|
-
"@liquid-glass-forge/cpu": "0.1.0-rc.
|
|
29
|
+
"@liquid-glass-forge/core": "0.1.0-rc.2",
|
|
30
|
+
"@liquid-glass-forge/cpu": "0.1.0-rc.2"
|
|
31
31
|
},
|
|
32
|
+
"homepage": "https://namipsg.github.io/liquid-glass-forge/#playground",
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|
|
34
35
|
"url": "git+https://github.com/namipsg/liquid-glass-forge.git",
|