@vectojs/core 1.40.0 → 1.40.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/dist/index.js CHANGED
@@ -3819,6 +3819,8 @@ var SCENE_OPTION_KEYS = [
3819
3819
  "maxFPS",
3820
3820
  "particleBackend",
3821
3821
  "pointBackend",
3822
+ "projectionAutoDomBudget",
3823
+ "projectionHysteresisFrames",
3822
3824
  "readingDirection",
3823
3825
  "renderer",
3824
3826
  "renderMode",
@@ -5803,6 +5805,15 @@ var Scene = (_class15 = class _Scene {
5803
5805
  while (this.overlayRoot.children.length > 0) {
5804
5806
  this.destroyEntitySubtree(this.overlayRoot.children.at(-1));
5805
5807
  }
5808
+ for (const node of this.domSeenNodes.values()) {
5809
+ for (const backend of this.projectionBackends) backend.unmount(node);
5810
+ }
5811
+ this.domSeenNodes.clear();
5812
+ this.domSeenThisFrame.clear();
5813
+ this.domSeenPrevFrame.clear();
5814
+ this.projectionResolutions.clear();
5815
+ this.projectionHysteresis.clear();
5816
+ this.projectionGesturePins.clear();
5806
5817
  if (typeof window !== "undefined" && !this.disableWindowResize) {
5807
5818
  window.removeEventListener("resize", this.resizeHandler);
5808
5819
  }
@@ -6301,7 +6312,7 @@ var Scene = (_class15 = class _Scene {
6301
6312
  shouldProjectA11y(node) {
6302
6313
  if (!node.interactive) return false;
6303
6314
  if (!(node.width > 0 || node.a11yFullViewport)) return false;
6304
- if (node.domPolicy === "dom" || this.resolveProjectionFor(node) === "dom") return false;
6315
+ if (this.resolveProjectionFor(node) === "dom") return false;
6305
6316
  switch (node.a11yProjection) {
6306
6317
  case "never":
6307
6318
  return false;
@@ -7754,7 +7765,8 @@ var Scene = (_class15 = class _Scene {
7754
7765
  * the per-frame materialization of scene semantics into pixels through the
7755
7766
  * backend-agnostic `IRenderer` contract. (The `A11yProjection` /
7756
7767
  * `ContentProjection` rows run on the same cadence via {@link Scene.syncA11y}
7757
- * below; the `DOMProjection` row does not exist yet RFC2/CTX-0598.)
7768
+ * below; the `DOMProjection` row lives in `@vectojs/dom` and is driven from
7769
+ * the render walk further below.)
7758
7770
  *
7759
7771
  * Main-frame causal order is a correctness contract:
7760
7772
  *
package/dist/index.mjs CHANGED
@@ -3818,6 +3818,8 @@ var SCENE_OPTION_KEYS = [
3818
3818
  "maxFPS",
3819
3819
  "particleBackend",
3820
3820
  "pointBackend",
3821
+ "projectionAutoDomBudget",
3822
+ "projectionHysteresisFrames",
3821
3823
  "readingDirection",
3822
3824
  "renderer",
3823
3825
  "renderMode",
@@ -5802,6 +5804,15 @@ var Scene = class _Scene {
5802
5804
  while (this.overlayRoot.children.length > 0) {
5803
5805
  this.destroyEntitySubtree(this.overlayRoot.children.at(-1));
5804
5806
  }
5807
+ for (const node of this.domSeenNodes.values()) {
5808
+ for (const backend of this.projectionBackends) backend.unmount(node);
5809
+ }
5810
+ this.domSeenNodes.clear();
5811
+ this.domSeenThisFrame.clear();
5812
+ this.domSeenPrevFrame.clear();
5813
+ this.projectionResolutions.clear();
5814
+ this.projectionHysteresis.clear();
5815
+ this.projectionGesturePins.clear();
5805
5816
  if (typeof window !== "undefined" && !this.disableWindowResize) {
5806
5817
  window.removeEventListener("resize", this.resizeHandler);
5807
5818
  }
@@ -6300,7 +6311,7 @@ var Scene = class _Scene {
6300
6311
  shouldProjectA11y(node) {
6301
6312
  if (!node.interactive) return false;
6302
6313
  if (!(node.width > 0 || node.a11yFullViewport)) return false;
6303
- if (node.domPolicy === "dom" || this.resolveProjectionFor(node) === "dom") return false;
6314
+ if (this.resolveProjectionFor(node) === "dom") return false;
6304
6315
  switch (node.a11yProjection) {
6305
6316
  case "never":
6306
6317
  return false;
@@ -7753,7 +7764,8 @@ var Scene = class _Scene {
7753
7764
  * the per-frame materialization of scene semantics into pixels through the
7754
7765
  * backend-agnostic `IRenderer` contract. (The `A11yProjection` /
7755
7766
  * `ContentProjection` rows run on the same cadence via {@link Scene.syncA11y}
7756
- * below; the `DOMProjection` row does not exist yet RFC2/CTX-0598.)
7767
+ * below; the `DOMProjection` row lives in `@vectojs/dom` and is driven from
7768
+ * the render walk further below.)
7757
7769
  *
7758
7770
  * Main-frame causal order is a correctness contract:
7759
7771
  *
@@ -287,7 +287,7 @@ export interface SceneOptions {
287
287
  * against. A new option must be added here too — the test suite asserts the two
288
288
  * stay in sync.
289
289
  */
290
- export declare const SCENE_OPTION_KEYS: readonly ['a11ySyncInterval', 'autoThrottle', 'contentProjection', 'contentProjectionMargin', 'contentSemanticBudget', 'contentSemanticMargin', 'debugA11y', 'disableWindowResize', 'idleFPS', 'maxDPR', 'maxFPS', 'particleBackend', 'pointBackend', 'readingDirection', 'renderer', 'renderMode', 'respectReducedMotion', 'semanticProjectionPolicy', 'userTiming'];
290
+ export declare const SCENE_OPTION_KEYS: readonly ['a11ySyncInterval', 'autoThrottle', 'contentProjection', 'contentProjectionMargin', 'contentSemanticBudget', 'contentSemanticMargin', 'debugA11y', 'disableWindowResize', 'idleFPS', 'maxDPR', 'maxFPS', 'particleBackend', 'pointBackend', 'projectionAutoDomBudget', 'projectionHysteresisFrames', 'readingDirection', 'renderer', 'renderMode', 'respectReducedMotion', 'semanticProjectionPolicy', 'userTiming'];
291
291
  /** Frame-rate the loop is capped to when the OS requests reduced motion. */
292
292
  export declare const REDUCED_MOTION_FPS = 30;
293
293
  export type { AcceleratorReason, AcceleratorStatus, AcceleratorReport };
@@ -1812,7 +1812,8 @@ export declare class Scene {
1812
1812
  * the per-frame materialization of scene semantics into pixels through the
1813
1813
  * backend-agnostic `IRenderer` contract. (The `A11yProjection` /
1814
1814
  * `ContentProjection` rows run on the same cadence via {@link Scene.syncA11y}
1815
- * below; the `DOMProjection` row does not exist yet RFC2/CTX-0598.)
1815
+ * below; the `DOMProjection` row lives in `@vectojs/dom` and is driven from
1816
+ * the render walk further below.)
1816
1817
  *
1817
1818
  * Main-frame causal order is a correctness contract:
1818
1819
  *
@@ -18,8 +18,8 @@ export type ProjectionBackendKind = 'canvas' | 'dom' | 'a11y' | 'content' | (str
18
18
  * mount/update/unmount shape the existing projections already follow so
19
19
  * RFC2 (DOM projection), RFC3 (semantic/a11y projection), and RFC4
20
20
  * (projection policy) can each name which row they implement or consume.
21
- * Nothing implements this interface yet the rows below map each proposed
22
- * backend onto the code that performs its role today, with the invariant
21
+ * `@vectojs/dom` implements the `'dom'` row (`DOMProjection`); the rows below
22
+ * map each backend onto the code that performs its role, with the invariant
23
23
  * from RFC1 §2: two projections of the same node must agree on geometry
24
24
  * (world matrix), visibility, and lifecycle state, while each keeps its own
25
25
  * medium-specific representation.
@@ -29,7 +29,7 @@ export type ProjectionBackendKind = 'canvas' | 'dom' | 'a11y' | 'content' | (str
29
29
  * | `CanvasProjection` (`'canvas'`) | the main render pass via `IRenderer` | `Scene.render(renderer)` (`tree/Scene.ts`) → per-entity `Entity.render` (`tree/Entity.ts`) |
30
30
  * | `A11yProjection` (`'a11y'`) | `A11yProjectionManager` + `a11yRoot` mirrors | mirror creation in the `Scene.syncA11y` walk (`tree/Scene.ts`); ordering in `A11yProjectionManager` |
31
31
  * | `ContentProjection` (`'content'`) | `ContentProjectionManager` + `Entity.getContentProjection` | `Scene.syncContentProjection`, driven on the a11y sync cadence (`tree/Scene.ts`) |
32
- * | `DOMProjection` (`'dom'`) | **does not exist** RFC2's work item (CTX-0598) | — (`DOMPortalEntity` is the pilot consumer, not the backend) |
32
+ * | `DOMProjection` (`'dom'`) | `@vectojs/dom` (`DOMProjection`, driven from the render walk) | `Scene.addProjectionBackend` + walk hook (`tree/Scene.ts`) |
33
33
  *
34
34
  * Open points deliberately left to RFC2/RFC4 (RFC1 §5): whether `update`
35
35
  * receives the full matrix or a decomposed transform, how z-order/layering
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectojs/core",
3
- "version": "1.40.0",
3
+ "version": "1.40.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },