@fundamental-engine/elements 0.9.1 → 0.9.3
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 +12 -3
- package/custom-elements.json +587 -11
- package/dist/field-cell.d.ts +34 -2
- package/dist/field-cell.d.ts.map +1 -1
- package/dist/field-cell.js +75 -7
- package/dist/field-cell.js.map +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -21
- package/dist/index.js.map +1 -1
- package/dist/platform-runtime.d.ts.map +1 -1
- package/dist/platform-runtime.js +20 -9
- package/dist/platform-runtime.js.map +1 -1
- package/dist/preregistration-queue.d.ts +31 -0
- package/dist/preregistration-queue.d.ts.map +1 -0
- package/dist/preregistration-queue.js +136 -0
- package/dist/preregistration-queue.js.map +1 -0
- package/package.json +4 -4
package/dist/field-cell.d.ts
CHANGED
|
@@ -11,11 +11,20 @@ import { HTMLElementBase } from './base.ts';
|
|
|
11
11
|
* - `IntersectionObserver` gates the rAF loop — paused when off-screen.
|
|
12
12
|
* - Honours `prefers-reduced-motion`: renders one static frame, no animation.
|
|
13
13
|
*
|
|
14
|
+
* **Budgets & isolation (shadow-dom.md §31.19).** Each cell owns its *own* pool, so
|
|
15
|
+
* many cells on a docs page never share or starve one budget. Hard caps keep that
|
|
16
|
+
* budget cheap: `max-particles` clamps the pool ceiling (over both the auto-size and an
|
|
17
|
+
* explicit `count`), and `fps` throttles the animation loop to a target framerate. Both
|
|
18
|
+
* caps are enforced per instance — a saturating cell cannot spill particles or frame
|
|
19
|
+
* cost into a neighbour.
|
|
20
|
+
*
|
|
14
21
|
* @summary A standalone, in-frame demo field that renders one force with its own
|
|
15
22
|
* particle pool, in-view-gated. Registered as `<field-cell>`.
|
|
16
23
|
* @attr {string} force - The single force token rendered: `attract` | `repel` | `swirl` | `gravity` | `stream` | `buoyancy` | `tether`.
|
|
17
24
|
* @attr {string} color - Accent color (hex) for the cell's particles.
|
|
18
25
|
* @attr {number} count - Number of particles in the cell's pool.
|
|
26
|
+
* @attr {number} max-particles - Hard ceiling on the pool size (§31.19); caps both the auto-size and an explicit `count`.
|
|
27
|
+
* @attr {number} fps - Target frames per second for the animation loop (§31.19); throttles rAF so many cells stay cheap.
|
|
19
28
|
*/
|
|
20
29
|
export declare class FieldCell extends HTMLElementBase {
|
|
21
30
|
static readonly observedAttributes: string[];
|
|
@@ -31,6 +40,8 @@ export declare class FieldCell extends HTMLElementBase {
|
|
|
31
40
|
/** cursor in frame-local CSS px, or null when absent. */
|
|
32
41
|
private cursorX;
|
|
33
42
|
private cursorY;
|
|
43
|
+
/** rAF timestamp of the last rendered frame — drives the `fps` throttle (§31.19). */
|
|
44
|
+
private lastStepTs;
|
|
34
45
|
private readonly onPointerMove;
|
|
35
46
|
private readonly onPointerLeave;
|
|
36
47
|
private readonly tick;
|
|
@@ -41,13 +52,34 @@ export declare class FieldCell extends HTMLElementBase {
|
|
|
41
52
|
get color(): string;
|
|
42
53
|
/** particle count; `0` (default) means auto-size to the frame area. */
|
|
43
54
|
get count(): number;
|
|
44
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Hard ceiling on the pool size (§31.19 scoped local-cell budget); `0` (default) means
|
|
57
|
+
* no cap. Clamps *both* the auto-size and an explicit `count`, so a cell can never
|
|
58
|
+
* exceed its declared budget no matter how large its frame grows.
|
|
59
|
+
*/
|
|
60
|
+
get maxParticles(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Target frames per second for the animation loop (§31.19); `0` (default) means run at
|
|
63
|
+
* the display's native rAF cadence. A positive value throttles the loop so a page full
|
|
64
|
+
* of demo cells stays cheap — each cell keeps its own frame budget.
|
|
65
|
+
*/
|
|
66
|
+
get fps(): number;
|
|
67
|
+
attributeChangedCallback(name: string): void;
|
|
45
68
|
connectedCallback(): void;
|
|
46
69
|
disconnectedCallback(): void;
|
|
47
70
|
private isPrefersReducedMotion;
|
|
71
|
+
/** A monotonic timestamp for the fps throttle, in ms (rAF-timestamp compatible). */
|
|
72
|
+
private rafNow;
|
|
73
|
+
/**
|
|
74
|
+
* The per-cell frame-budget gate (§31.19). With no `fps` (0), every frame renders. With a
|
|
75
|
+
* positive `fps`, a frame renders only once its `1000/fps` ms interval has elapsed since the
|
|
76
|
+
* last render; renders advance `lastStepTs`. Each cell keeps its own budget — one cell's rate
|
|
77
|
+
* never affects another's.
|
|
78
|
+
*/
|
|
79
|
+
private shouldRenderFrame;
|
|
48
80
|
/** Fit the canvas to the element box (DPR-aware) and rebuild the pool. */
|
|
49
81
|
private fit;
|
|
50
|
-
/** Build the particle pool sized to the frame area. */
|
|
82
|
+
/** Build the particle pool sized to the frame area, capped by the cell's budget (§31.19). */
|
|
51
83
|
private buildPool;
|
|
52
84
|
private start;
|
|
53
85
|
private stop;
|
package/dist/field-cell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-cell.d.ts","sourceRoot":"","sources":["../src/field-cell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAa5C
|
|
1
|
+
{"version":3,"file":"field-cell.d.ts","sourceRoot":"","sources":["../src/field-cell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAa5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,SAAU,SAAQ,eAAe;IAC5C,MAAM,CAAC,QAAQ,CAAC,kBAAkB,WAAuD;IAEzF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,GAAG,CAAyC;IAEpD,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,oBAAoB,CAAC,CAAuB;IAEpD,0DAA0D;IAC1D,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,IAAI,CAAK;IAEjB,yDAAyD;IACzD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,OAAO,CAAuB;IAEtC,qFAAqF;IACrF,OAAO,CAAC,UAAU,CAAK;IAEvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4B;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAa;IAC5C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;;IA8B7C,gDAAgD;IAChD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,iBAAiB;IACjB,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,uEAAuE;IACvE,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,MAAM,CAGzB;IAED;;;;OAIG;IACH,IAAI,GAAG,IAAI,MAAM,CAGhB;IAED,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAU5C,iBAAiB,IAAI,IAAI;IAqBzB,oBAAoB,IAAI,IAAI;IAU5B,OAAO,CAAC,sBAAsB;IAO9B,oFAAoF;IACpF,OAAO,CAAC,MAAM;IAMd;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAYzB,0EAA0E;IAC1E,OAAO,CAAC,GAAG;IAmBX,6FAA6F;IAC7F,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,IAAI;IAKZ,kCAAkC;IAClC,OAAO,CAAC,IAAI;CAwDb;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
package/dist/field-cell.js
CHANGED
|
@@ -13,14 +13,23 @@ const clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
|
13
13
|
* - `IntersectionObserver` gates the rAF loop — paused when off-screen.
|
|
14
14
|
* - Honours `prefers-reduced-motion`: renders one static frame, no animation.
|
|
15
15
|
*
|
|
16
|
+
* **Budgets & isolation (shadow-dom.md §31.19).** Each cell owns its *own* pool, so
|
|
17
|
+
* many cells on a docs page never share or starve one budget. Hard caps keep that
|
|
18
|
+
* budget cheap: `max-particles` clamps the pool ceiling (over both the auto-size and an
|
|
19
|
+
* explicit `count`), and `fps` throttles the animation loop to a target framerate. Both
|
|
20
|
+
* caps are enforced per instance — a saturating cell cannot spill particles or frame
|
|
21
|
+
* cost into a neighbour.
|
|
22
|
+
*
|
|
16
23
|
* @summary A standalone, in-frame demo field that renders one force with its own
|
|
17
24
|
* particle pool, in-view-gated. Registered as `<field-cell>`.
|
|
18
25
|
* @attr {string} force - The single force token rendered: `attract` | `repel` | `swirl` | `gravity` | `stream` | `buoyancy` | `tether`.
|
|
19
26
|
* @attr {string} color - Accent color (hex) for the cell's particles.
|
|
20
27
|
* @attr {number} count - Number of particles in the cell's pool.
|
|
28
|
+
* @attr {number} max-particles - Hard ceiling on the pool size (§31.19); caps both the auto-size and an explicit `count`.
|
|
29
|
+
* @attr {number} fps - Target frames per second for the animation loop (§31.19); throttles rAF so many cells stay cheap.
|
|
21
30
|
*/
|
|
22
31
|
export class FieldCell extends HTMLElementBase {
|
|
23
|
-
static observedAttributes = ['force', 'color', 'count'];
|
|
32
|
+
static observedAttributes = ['force', 'color', 'count', 'max-particles', 'fps'];
|
|
24
33
|
canvas;
|
|
25
34
|
ctx = null;
|
|
26
35
|
particles = [];
|
|
@@ -33,6 +42,8 @@ export class FieldCell extends HTMLElementBase {
|
|
|
33
42
|
/** cursor in frame-local CSS px, or null when absent. */
|
|
34
43
|
cursorX = null;
|
|
35
44
|
cursorY = null;
|
|
45
|
+
/** rAF timestamp of the last rendered frame — drives the `fps` throttle (§31.19). */
|
|
46
|
+
lastStepTs = 0;
|
|
36
47
|
onPointerMove;
|
|
37
48
|
onPointerLeave;
|
|
38
49
|
tick;
|
|
@@ -54,8 +65,12 @@ export class FieldCell extends HTMLElementBase {
|
|
|
54
65
|
this.cursorX = null;
|
|
55
66
|
this.cursorY = null;
|
|
56
67
|
};
|
|
57
|
-
this.tick = () => {
|
|
58
|
-
this.
|
|
68
|
+
this.tick = (ts) => {
|
|
69
|
+
const now = typeof ts === 'number' ? ts : this.rafNow();
|
|
70
|
+
// fps budget (§31.19): render only when this frame is within budget; 0 (default)
|
|
71
|
+
// renders every frame at the display's native rAF cadence.
|
|
72
|
+
if (this.shouldRenderFrame(now))
|
|
73
|
+
this.step();
|
|
59
74
|
this.raf = requestAnimationFrame(this.tick);
|
|
60
75
|
};
|
|
61
76
|
}
|
|
@@ -72,8 +87,32 @@ export class FieldCell extends HTMLElementBase {
|
|
|
72
87
|
const v = Number(this.getAttribute('count'));
|
|
73
88
|
return Number.isFinite(v) && v > 0 ? Math.round(v) : 0;
|
|
74
89
|
}
|
|
75
|
-
|
|
76
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Hard ceiling on the pool size (§31.19 scoped local-cell budget); `0` (default) means
|
|
92
|
+
* no cap. Clamps *both* the auto-size and an explicit `count`, so a cell can never
|
|
93
|
+
* exceed its declared budget no matter how large its frame grows.
|
|
94
|
+
*/
|
|
95
|
+
get maxParticles() {
|
|
96
|
+
const v = Number(this.getAttribute('max-particles'));
|
|
97
|
+
return Number.isFinite(v) && v > 0 ? Math.round(v) : 0;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Target frames per second for the animation loop (§31.19); `0` (default) means run at
|
|
101
|
+
* the display's native rAF cadence. A positive value throttles the loop so a page full
|
|
102
|
+
* of demo cells stays cheap — each cell keeps its own frame budget.
|
|
103
|
+
*/
|
|
104
|
+
get fps() {
|
|
105
|
+
const v = Number(this.getAttribute('fps'));
|
|
106
|
+
return Number.isFinite(v) && v > 0 ? v : 0;
|
|
107
|
+
}
|
|
108
|
+
attributeChangedCallback(name) {
|
|
109
|
+
// force/color are read live each frame; count / max-particles change the pool size, so
|
|
110
|
+
// rebuild it now (not just on the next resize) — the declared budget takes effect at once.
|
|
111
|
+
if (this.ctx && (name === 'count' || name === 'max-particles')) {
|
|
112
|
+
this.buildPool();
|
|
113
|
+
if (!this.raf)
|
|
114
|
+
this.step();
|
|
115
|
+
}
|
|
77
116
|
if (this.isPrefersReducedMotion() && this.ctx)
|
|
78
117
|
this.step();
|
|
79
118
|
}
|
|
@@ -111,6 +150,30 @@ export class FieldCell extends HTMLElementBase {
|
|
|
111
150
|
return (typeof matchMedia !== 'undefined' &&
|
|
112
151
|
matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
113
152
|
}
|
|
153
|
+
/** A monotonic timestamp for the fps throttle, in ms (rAF-timestamp compatible). */
|
|
154
|
+
rafNow() {
|
|
155
|
+
return typeof performance !== 'undefined' && typeof performance.now === 'function'
|
|
156
|
+
? performance.now()
|
|
157
|
+
: Date.now();
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The per-cell frame-budget gate (§31.19). With no `fps` (0), every frame renders. With a
|
|
161
|
+
* positive `fps`, a frame renders only once its `1000/fps` ms interval has elapsed since the
|
|
162
|
+
* last render; renders advance `lastStepTs`. Each cell keeps its own budget — one cell's rate
|
|
163
|
+
* never affects another's.
|
|
164
|
+
*/
|
|
165
|
+
shouldRenderFrame(now) {
|
|
166
|
+
const fps = this.fps;
|
|
167
|
+
if (fps <= 0)
|
|
168
|
+
return true;
|
|
169
|
+
// First frame of a run (lastStepTs === 0) always renders and starts the clock, so a
|
|
170
|
+
// resumed cell isn't stalled up to one interval; thereafter, throttle to 1000/fps ms.
|
|
171
|
+
if (this.lastStepTs === 0 || now - this.lastStepTs >= 1000 / fps) {
|
|
172
|
+
this.lastStepTs = now;
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
114
177
|
/** Fit the canvas to the element box (DPR-aware) and rebuild the pool. */
|
|
115
178
|
fit() {
|
|
116
179
|
if (!this.ctx)
|
|
@@ -129,10 +192,13 @@ export class FieldCell extends HTMLElementBase {
|
|
|
129
192
|
if (!this.raf)
|
|
130
193
|
this.step();
|
|
131
194
|
}
|
|
132
|
-
/** Build the particle pool sized to the frame area. */
|
|
195
|
+
/** Build the particle pool sized to the frame area, capped by the cell's budget (§31.19). */
|
|
133
196
|
buildPool() {
|
|
134
197
|
const area = this.boxW * this.boxH;
|
|
135
|
-
const
|
|
198
|
+
const requested = this.count > 0 ? this.count : clamp(Math.round(area / 9000), 16, 90);
|
|
199
|
+
// Hard cap: max-particles clamps both the auto-size and an explicit count (per-cell budget).
|
|
200
|
+
const cap = this.maxParticles;
|
|
201
|
+
const n = cap > 0 ? Math.min(requested, cap) : requested;
|
|
136
202
|
const pool = [];
|
|
137
203
|
for (let i = 0; i < n; i++) {
|
|
138
204
|
pool.push({
|
|
@@ -151,6 +217,8 @@ export class FieldCell extends HTMLElementBase {
|
|
|
151
217
|
this.step(); // one static frame, no loop
|
|
152
218
|
return;
|
|
153
219
|
}
|
|
220
|
+
// Fresh frame budget on resume, so re-entering view isn't stalled by the fps throttle.
|
|
221
|
+
this.lastStepTs = 0;
|
|
154
222
|
this.raf = requestAnimationFrame(this.tick);
|
|
155
223
|
}
|
|
156
224
|
stop() {
|
package/dist/field-cell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-cell.js","sourceRoot":"","sources":["../src/field-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAU5C,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,EAAU,EAAE,CAC1D,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhC
|
|
1
|
+
{"version":3,"file":"field-cell.js","sourceRoot":"","sources":["../src/field-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,C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
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentHandle, type AgentSpec, type AtomPayload, type FieldHandle, type ThreadLink, type FlowOptions, type OverlayInput, type ScalarGrid, type FieldEventType, type FieldEventMap, type BodySpec, type BodyHandle, type FieldChannelHandle } from '@fundamental-engine/core';
|
|
1
|
+
import { type AgentHandle, type AgentSpec, type AtomPayload, type FieldHandle, type ThreadLink, type FlowOptions, type OverlayInput, type IntegratorMode, type ScalarGrid, type FieldEventType, type FieldEventMap, type BodySpec, type BodyHandle, type FieldChannelHandle, type FieldQuery, type FieldQueryResult, type FieldSnapshot, type FieldSnapshotOptions, type FieldDiff, type CausalReplay, type ReplayOptions, type ProjectionRegistry } from '@fundamental-engine/core';
|
|
2
2
|
import { type FieldPlatform } from '@fundamental-engine/dom';
|
|
3
3
|
import { HTMLElementBase } from './base.ts';
|
|
4
4
|
import { type PlatformRuntime } from './platform-runtime.ts';
|
|
@@ -28,6 +28,9 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
28
28
|
/** element-level visibility: pages can hide the field (display:none) — skip draw work then. */
|
|
29
29
|
private visibilityObserver?;
|
|
30
30
|
private fieldVisible;
|
|
31
|
+
/** SSR pre-registration queue bookkeeping: true while this element counts as a live field, so a
|
|
32
|
+
* rebuild (start() after a destroy) does not double-count the active-field tally (#683). */
|
|
33
|
+
private fieldActiveMarked;
|
|
31
34
|
/** experimental platform runtime (Phase D); present only when the flag is on. */
|
|
32
35
|
platformRuntime?: PlatformRuntime;
|
|
33
36
|
/**
|
|
@@ -42,11 +45,13 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
42
45
|
get accent(): string;
|
|
43
46
|
/** particle-count multiplier (§2.5). */
|
|
44
47
|
get density(): number;
|
|
45
|
-
/** draw the background Currents (§24).
|
|
48
|
+
/** draw the background Currents (§24). OPT-IN (#979, mirrors the core default): the attribute
|
|
49
|
+
* must be PRESENT (and not `"false"`) to build the waves — same semantics as `attention` /
|
|
50
|
+
* `causality` / `mass`. Absent = the bare field, no carrier waves. */
|
|
46
51
|
get waves(): boolean;
|
|
47
52
|
/** render mode (§20.6); the DEFAULT is `none` (#538) — the signals-only engine: simulate + feed back,
|
|
48
53
|
* never draw (#297). Set `render="dots"` (or another drawing mode) to get a visible surface. */
|
|
49
|
-
get renderMode(): 'dots' | 'trails' | 'links' | 'metaballs' | 'voronoi' | 'streamlines' | 'flow' | 'none';
|
|
54
|
+
get renderMode(): 'dots' | 'trails' | 'links' | 'metaballs' | 'voronoi' | 'streamlines' | 'flow' | 'knockout' | 'redshift' | 'blackbody' | 'depth' | 'none';
|
|
50
55
|
/** substrate background: `transparent` (present and not `"false"`) clears to transparent so the
|
|
51
56
|
* underlay composites over light content; default `opaque` paints the near-black substrate. */
|
|
52
57
|
get background(): 'opaque' | 'transparent';
|
|
@@ -74,6 +79,16 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
74
79
|
get gridIntensity(): number | undefined;
|
|
75
80
|
/** `separation` — particle-to-particle separation force strength ∈ [0,1]; undefined if absent/invalid. */
|
|
76
81
|
get separation(): number | undefined;
|
|
82
|
+
/** `ambient-orbit` — DECLARED resting-formation swirl on attract (#978); undefined (engine default
|
|
83
|
+
* 0.1, the historical hardcoded value) if absent/invalid. `0` is valid (a purely radial attract). */
|
|
84
|
+
get ambientOrbit(): number | undefined;
|
|
85
|
+
/** `ambient-wander` — DECLARED resting-formation drift (#978); undefined (engine default 1.0, the
|
|
86
|
+
* historical hardcoded value) if absent/invalid. `0` is valid (a still resting field). */
|
|
87
|
+
get ambientWander(): number | undefined;
|
|
88
|
+
/** `integrator` — the integration scheme (substrate doc 04 §Step 3); `'fixed'` opts into the
|
|
89
|
+
* frame-rate-independent integrator, `'velocity-verlet'` into the second-order Verlet scheme
|
|
90
|
+
* (#659); anything else (incl. absent) is the default `'legacy'`. */
|
|
91
|
+
get integrator(): IntegratorMode | undefined;
|
|
77
92
|
/** `theme` — ambient palette preset (`warm` (default) | `cool` | `mono`); undefined if absent (#529). */
|
|
78
93
|
get theme(): string | undefined;
|
|
79
94
|
/** `gradient-cool` — hex for the cool end of the heat ramp; overrides the theme (#529). */
|
|
@@ -137,7 +152,7 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
137
152
|
/** apply an adaptive quality tier 0–3 (#413) — the platform runtime forwards the governor's tier. */
|
|
138
153
|
setQualityTier(tier: number): void;
|
|
139
154
|
/** switch the underlay render mode (§20.6) live; `none` = signals-only — stop drawing, keep the signals (#297). */
|
|
140
|
-
setRender(mode: 'dots' | 'trails' | 'links' | 'metaballs' | 'voronoi' | 'streamlines' | 'flow' | 'none'): void;
|
|
155
|
+
setRender(mode: 'dots' | 'trails' | 'links' | 'metaballs' | 'voronoi' | 'streamlines' | 'flow' | 'knockout' | 'redshift' | 'blackbody' | 'depth' | 'none'): void;
|
|
141
156
|
/** render field readings on the overlay surface (Field Surfaces — in front of content); one mode or an additive stack. */
|
|
142
157
|
setOverlay(mode: OverlayInput): void;
|
|
143
158
|
/** wire glowing connector lines between a set, or clear with null (§10). */
|
|
@@ -178,6 +193,17 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
178
193
|
total: number;
|
|
179
194
|
count: number;
|
|
180
195
|
};
|
|
196
|
+
/** Ask the live field a structured question (bodies/metrics/relationships/influences) — read-only.
|
|
197
|
+
* Returns an empty reading before the field starts. See {@link FieldHandle.query}. EXPERIMENTAL. */
|
|
198
|
+
query(q?: FieldQuery): FieldQueryResult;
|
|
199
|
+
/** Capture field state — a portable, versioned {@link FieldSnapshot}. Empty before start. EXPERIMENTAL. */
|
|
200
|
+
snapshot(opts?: FieldSnapshotOptions): FieldSnapshot;
|
|
201
|
+
/** Compare two snapshots — pure (works before the field starts). See {@link FieldHandle.diff}. EXPERIMENTAL. */
|
|
202
|
+
diff(a: FieldSnapshot, b: FieldSnapshot): FieldDiff;
|
|
203
|
+
/** Explain how the field changed between two snapshots — pure (works before start). See {@link FieldHandle.replay}. EXPERIMENTAL. */
|
|
204
|
+
replay(a: FieldSnapshot, b: FieldSnapshot, opts?: ReplayOptions): CausalReplay;
|
|
205
|
+
/** The field's projection registry — a no-op registry before the field starts. See {@link FieldHandle.projections}. EXPERIMENTAL. */
|
|
206
|
+
get projections(): ProjectionRegistry;
|
|
181
207
|
/** sample the live field at `(x, y)` — the net force vector a still test particle would feel
|
|
182
208
|
* (zero before the field starts). The seam external visualizers consume to build field geometry. */
|
|
183
209
|
sample(x: number, y: number): {
|
|
@@ -211,6 +237,14 @@ export declare class FieldField extends HTMLElementBase {
|
|
|
211
237
|
* `this.field` guard skips — the first mount reads every attribute itself.
|
|
212
238
|
*/
|
|
213
239
|
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
240
|
+
/**
|
|
241
|
+
* Field Surfaces: lazily create + attach the front overlay surface (light DOM — the shadow host is
|
|
242
|
+
* z-index:0, behind content). A fixed, full-viewport, click-through, mix-blend canvas above content;
|
|
243
|
+
* core sizes its backing store and draws the overlay mode onto it. Created ONCE, on the first overlay
|
|
244
|
+
* that actually goes active (#676) — core invokes this as `overlayCanvasProvider` — and reused across
|
|
245
|
+
* rebuilds. Idempotent: returns the existing canvas on every later call, never a second element.
|
|
246
|
+
*/
|
|
247
|
+
private ensureOverlayCanvas;
|
|
214
248
|
/** (re)create the engine on the canvas, reading the current attributes. */
|
|
215
249
|
private start;
|
|
216
250
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAqB,KAAK,UAAU,EAAqB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAoB,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE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