@vectojs/core 1.11.0 → 1.11.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/dist/index.js +77 -58
- package/dist/index.mjs +22 -3
- package/dist/tree/Scene.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -701,40 +701,47 @@ var Scene = (_class2 = class _Scene {
|
|
|
701
701
|
__init39() {this.activePortalsPrevFrame = /* @__PURE__ */ new Set()}
|
|
702
702
|
__init40() {this.portalEntities = /* @__PURE__ */ new Map()}
|
|
703
703
|
__init41() {this.renderOrderCounter = 0}
|
|
704
|
+
/**
|
|
705
|
+
* Authoritative paint order for semantic nodes discovered during the main
|
|
706
|
+
* render. A node may not have a DOM projection until the following a11y
|
|
707
|
+
* sync, so retaining the order prevents a newly opened overlay from spending
|
|
708
|
+
* its first frame below previously projected controls.
|
|
709
|
+
*/
|
|
710
|
+
__init42() {this.a11yRenderOrders = /* @__PURE__ */ new Map()}
|
|
704
711
|
// Optional WebGL point-cloud layer (see SceneOptions.pointBackend).
|
|
705
|
-
|
|
706
|
-
|
|
712
|
+
__init43() {this.pointRenderer = null}
|
|
713
|
+
__init44() {this.glCanvas = null}
|
|
707
714
|
|
|
708
715
|
|
|
709
716
|
|
|
710
|
-
|
|
717
|
+
__init45() {this.disableWindowResize = false}
|
|
711
718
|
/** See {@link SceneOptions.maxDPR}. `undefined` = uncapped (real DPR). */
|
|
712
719
|
|
|
713
720
|
// WebGPU properties
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
721
|
+
__init46() {this.destroyed = false}
|
|
722
|
+
__init47() {this.device = null}
|
|
723
|
+
__init48() {this.deviceLost = false}
|
|
724
|
+
__init49() {this.particleBackend = "auto"}
|
|
725
|
+
__init50() {this._webgpuDisabled = false}
|
|
719
726
|
get webgpuDisabled() {
|
|
720
727
|
return this._webgpuDisabled || this.particleBackend === "cpu";
|
|
721
728
|
}
|
|
722
729
|
set webgpuDisabled(value) {
|
|
723
730
|
this._webgpuDisabled = value;
|
|
724
731
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
732
|
+
__init51() {this.recoveryTimerId = null}
|
|
733
|
+
__init52() {this.manager = null}
|
|
734
|
+
__init53() {this.initializingWebGPU = false}
|
|
735
|
+
__init54() {this.gpuCanvas = null}
|
|
736
|
+
__init55() {this.gpuContext = null}
|
|
730
737
|
/** True while the GPU canvas holds a presented particle frame (needs clearing when they leave). */
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
+
__init56() {this.gpuHasContent = false}
|
|
739
|
+
__init57() {this.mouseX = -9999}
|
|
740
|
+
__init58() {this.mouseY = -9999}
|
|
741
|
+
__init59() {this.pointerMoveListener = null}
|
|
742
|
+
__init60() {this.pointerLeaveListener = null}
|
|
743
|
+
__init61() {this.hasWarnedZeroSize = false}
|
|
744
|
+
__init62() {this.fontLoadHandler = null}
|
|
738
745
|
// ── Dev-mode warning infrastructure ──────────────────────────────
|
|
739
746
|
//
|
|
740
747
|
// Enable with `Scene.devMode = true` or by setting `globalThis.__DEV__`.
|
|
@@ -752,7 +759,7 @@ var Scene = (_class2 = class _Scene {
|
|
|
752
759
|
return false;
|
|
753
760
|
}
|
|
754
761
|
|
|
755
|
-
|
|
762
|
+
__init63() {this._devFrameCount = 0}
|
|
756
763
|
_devWarn(message) {
|
|
757
764
|
if (!this._devActive) return;
|
|
758
765
|
console.warn(`[vectojs/dev] ${message}`);
|
|
@@ -796,7 +803,7 @@ var Scene = (_class2 = class _Scene {
|
|
|
796
803
|
};
|
|
797
804
|
walkProjections(this.root);
|
|
798
805
|
}
|
|
799
|
-
constructor(canvas, options = {}) {;_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this);_class2.prototype.__init27.call(this);_class2.prototype.__init28.call(this);_class2.prototype.__init29.call(this);_class2.prototype.__init30.call(this);_class2.prototype.__init31.call(this);_class2.prototype.__init32.call(this);_class2.prototype.__init33.call(this);_class2.prototype.__init34.call(this);_class2.prototype.__init35.call(this);_class2.prototype.__init36.call(this);_class2.prototype.__init37.call(this);_class2.prototype.__init38.call(this);_class2.prototype.__init39.call(this);_class2.prototype.__init40.call(this);_class2.prototype.__init41.call(this);_class2.prototype.__init42.call(this);_class2.prototype.__init43.call(this);_class2.prototype.__init44.call(this);_class2.prototype.__init45.call(this);_class2.prototype.__init46.call(this);_class2.prototype.__init47.call(this);_class2.prototype.__init48.call(this);_class2.prototype.__init49.call(this);_class2.prototype.__init50.call(this);_class2.prototype.__init51.call(this);_class2.prototype.__init52.call(this);_class2.prototype.__init53.call(this);_class2.prototype.__init54.call(this);_class2.prototype.__init55.call(this);_class2.prototype.__init56.call(this);_class2.prototype.__init57.call(this);_class2.prototype.__init58.call(this);_class2.prototype.__init59.call(this);_class2.prototype.__init60.call(this);_class2.prototype.__init61.call(this);_class2.prototype.__init62.call(this);
|
|
806
|
+
constructor(canvas, options = {}) {;_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this);_class2.prototype.__init27.call(this);_class2.prototype.__init28.call(this);_class2.prototype.__init29.call(this);_class2.prototype.__init30.call(this);_class2.prototype.__init31.call(this);_class2.prototype.__init32.call(this);_class2.prototype.__init33.call(this);_class2.prototype.__init34.call(this);_class2.prototype.__init35.call(this);_class2.prototype.__init36.call(this);_class2.prototype.__init37.call(this);_class2.prototype.__init38.call(this);_class2.prototype.__init39.call(this);_class2.prototype.__init40.call(this);_class2.prototype.__init41.call(this);_class2.prototype.__init42.call(this);_class2.prototype.__init43.call(this);_class2.prototype.__init44.call(this);_class2.prototype.__init45.call(this);_class2.prototype.__init46.call(this);_class2.prototype.__init47.call(this);_class2.prototype.__init48.call(this);_class2.prototype.__init49.call(this);_class2.prototype.__init50.call(this);_class2.prototype.__init51.call(this);_class2.prototype.__init52.call(this);_class2.prototype.__init53.call(this);_class2.prototype.__init54.call(this);_class2.prototype.__init55.call(this);_class2.prototype.__init56.call(this);_class2.prototype.__init57.call(this);_class2.prototype.__init58.call(this);_class2.prototype.__init59.call(this);_class2.prototype.__init60.call(this);_class2.prototype.__init61.call(this);_class2.prototype.__init62.call(this);_class2.prototype.__init63.call(this);
|
|
800
807
|
this.canvas = canvas;
|
|
801
808
|
this.debugA11y = _nullishCoalesce(options.debugA11y, () => ( false));
|
|
802
809
|
this.disableWindowResize = _nullishCoalesce(options.disableWindowResize, () => ( false));
|
|
@@ -1463,6 +1470,10 @@ var Scene = (_class2 = class _Scene {
|
|
|
1463
1470
|
if (el.style.pointerEvents !== semanticPointerEvents) {
|
|
1464
1471
|
el.style.pointerEvents = semanticPointerEvents;
|
|
1465
1472
|
}
|
|
1473
|
+
const renderOrder = this.a11yRenderOrders.get(node.id);
|
|
1474
|
+
if (renderOrder !== void 0 && el.style.zIndex !== String(renderOrder)) {
|
|
1475
|
+
el.style.zIndex = String(renderOrder);
|
|
1476
|
+
}
|
|
1466
1477
|
const implicitTabIndex = !isNativelyFocusable(el) && attrs.role && INTERACTIVE_A11Y_ROLES.has(attrs.role) ? 0 : null;
|
|
1467
1478
|
const desiredTabIndex = _nullishCoalesce(attrs.tabIndex, () => ( implicitTabIndex));
|
|
1468
1479
|
if (desiredTabIndex === null) {
|
|
@@ -2181,7 +2192,11 @@ var Scene = (_class2 = class _Scene {
|
|
|
2181
2192
|
this.scheduleFrame();
|
|
2182
2193
|
return;
|
|
2183
2194
|
}
|
|
2184
|
-
|
|
2195
|
+
let dt = time - this.lastTime;
|
|
2196
|
+
if (cap > 0) {
|
|
2197
|
+
const nominal = 1e3 / cap;
|
|
2198
|
+
if (Math.abs(dt - nominal) < nominal * 0.3) dt = nominal;
|
|
2199
|
+
}
|
|
2185
2200
|
this.lastTime = time;
|
|
2186
2201
|
if (this.renderMode === "onDemand" && isIdle) {
|
|
2187
2202
|
this.scheduleFrame();
|
|
@@ -2223,6 +2238,7 @@ var Scene = (_class2 = class _Scene {
|
|
|
2223
2238
|
}
|
|
2224
2239
|
if (isMainRenderer) {
|
|
2225
2240
|
this.renderOrderCounter = 0;
|
|
2241
|
+
this.a11yRenderOrders.clear();
|
|
2226
2242
|
this.activePortalsThisFrame.clear();
|
|
2227
2243
|
}
|
|
2228
2244
|
const computeEntities = [];
|
|
@@ -2381,8 +2397,11 @@ var Scene = (_class2 = class _Scene {
|
|
|
2381
2397
|
const orthogonalTolerance = Math.max(1, worldScaleX * worldScaleY) * 1e-6;
|
|
2382
2398
|
const isSimilarityTransform = Number.isFinite(worldScaleX) && Number.isFinite(worldScaleY) && Math.abs(worldScaleX - worldScaleY) <= scaleTolerance && Math.abs(a * c + b * d) <= orthogonalTolerance;
|
|
2383
2399
|
const a11yEl = isMainRenderer ? this.a11yElements.get(node.id) : void 0;
|
|
2384
|
-
|
|
2385
|
-
|
|
2400
|
+
const willProjectA11y = isMainRenderer && node.interactive && (node.width > 0 || node.a11yFullViewport);
|
|
2401
|
+
if (a11yEl || willProjectA11y) {
|
|
2402
|
+
const renderOrder = this.renderOrderCounter++;
|
|
2403
|
+
if (willProjectA11y) this.a11yRenderOrders.set(node.id, renderOrder);
|
|
2404
|
+
if (a11yEl) a11yEl.style.zIndex = String(renderOrder);
|
|
2386
2405
|
}
|
|
2387
2406
|
if (node.isDOMPortal) {
|
|
2388
2407
|
if (isMainRenderer) {
|
|
@@ -2711,15 +2730,15 @@ var TextEntity = (_class3 = class extends _chunk2Z23LTH3js.Entity {
|
|
|
2711
2730
|
|
|
2712
2731
|
|
|
2713
2732
|
|
|
2714
|
-
|
|
2733
|
+
__init64() {this.nodes = []}
|
|
2715
2734
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2735
|
+
__init65() {this.fillStyle = "#94a3b8"}
|
|
2736
|
+
__init66() {this.strokeStyle = null}
|
|
2737
|
+
__init67() {this.hoveredFillStyle = "#ffffff"}
|
|
2738
|
+
__init68() {this.lineWidth = 1}
|
|
2739
|
+
__init69() {this.isHovered = false}
|
|
2721
2740
|
constructor(text, atlas, maxWidth, fontSize = 24) {
|
|
2722
|
-
super();_class3.prototype.
|
|
2741
|
+
super();_class3.prototype.__init64.call(this);_class3.prototype.__init65.call(this);_class3.prototype.__init66.call(this);_class3.prototype.__init67.call(this);_class3.prototype.__init68.call(this);_class3.prototype.__init69.call(this);;
|
|
2723
2742
|
this.text = text;
|
|
2724
2743
|
this.atlas = atlas;
|
|
2725
2744
|
this.fontSize = fontSize;
|
|
@@ -2834,15 +2853,15 @@ var TextEntity = (_class3 = class extends _chunk2Z23LTH3js.Entity {
|
|
|
2834
2853
|
// src/components/GridTextEntity.ts
|
|
2835
2854
|
var GridTextEntity = (_class4 = class extends _chunk2Z23LTH3js.Entity {
|
|
2836
2855
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2856
|
+
__init70() {this.fillStyle = "#ffffff"}
|
|
2857
|
+
__init71() {this.grid = []}
|
|
2839
2858
|
// Array of rows
|
|
2840
|
-
|
|
2841
|
-
|
|
2859
|
+
__init72() {this.cols = 0}
|
|
2860
|
+
__init73() {this.rows = 0}
|
|
2842
2861
|
|
|
2843
2862
|
|
|
2844
2863
|
constructor(_atlas, fontSize = 10) {
|
|
2845
|
-
super();_class4.prototype.
|
|
2864
|
+
super();_class4.prototype.__init70.call(this);_class4.prototype.__init71.call(this);_class4.prototype.__init72.call(this);_class4.prototype.__init73.call(this);;
|
|
2846
2865
|
this.fontSize = fontSize;
|
|
2847
2866
|
this.charWidth = fontSize * 1;
|
|
2848
2867
|
this.charHeight = fontSize * 1.1;
|
|
@@ -2934,23 +2953,23 @@ var SplineEntity = (_class5 = class extends _chunk2Z23LTH3js.Entity {
|
|
|
2934
2953
|
|
|
2935
2954
|
|
|
2936
2955
|
|
|
2937
|
-
|
|
2938
|
-
|
|
2956
|
+
__init74() {this.offscreen = null}
|
|
2957
|
+
__init75() {this.baked = false}
|
|
2939
2958
|
/** Logical (CSS-pixel) size of the baked bitmap — the blit destination size. */
|
|
2940
|
-
|
|
2941
|
-
|
|
2959
|
+
__init76() {this.bakedWidth = 0}
|
|
2960
|
+
__init77() {this.bakedHeight = 0}
|
|
2942
2961
|
/** Gradient strokes can't be baked to a solid-color bitmap; they render per-frame. */
|
|
2943
2962
|
|
|
2944
2963
|
/** Lazily-flattened polylines (one Float32Array of [x,y,...] per segment) for hit-testing. */
|
|
2945
|
-
|
|
2964
|
+
__init78() {this.polylines = null}
|
|
2946
2965
|
/**
|
|
2947
2966
|
* When `true`, the renderer draws a rounded-rect outline of the entity's
|
|
2948
2967
|
* local bounds after painting the curves. Useful for drag feedback and
|
|
2949
2968
|
* debugging hit areas. Defaults to `false`.
|
|
2950
2969
|
*/
|
|
2951
|
-
|
|
2970
|
+
__init79() {this.showBounds = false}
|
|
2952
2971
|
constructor(doc, opts = {}) {
|
|
2953
|
-
super();_class5.prototype.
|
|
2972
|
+
super();_class5.prototype.__init74.call(this);_class5.prototype.__init75.call(this);_class5.prototype.__init76.call(this);_class5.prototype.__init77.call(this);_class5.prototype.__init78.call(this);_class5.prototype.__init79.call(this);;
|
|
2954
2973
|
this.doc = doc;
|
|
2955
2974
|
this.lineWidth = _nullishCoalesce(opts.lineWidth, () => ( 2));
|
|
2956
2975
|
this.cache = _nullishCoalesce(opts.cache, () => ( true));
|
|
@@ -3325,9 +3344,9 @@ var Group = class extends _chunk2Z23LTH3js.Entity {
|
|
|
3325
3344
|
// src/math/SpatialHashGrid.ts
|
|
3326
3345
|
var SpatialHashGrid = (_class6 = class {
|
|
3327
3346
|
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
constructor(cellSize = 64) {;_class6.prototype.
|
|
3347
|
+
__init80() {this.grid = /* @__PURE__ */ new Map()}
|
|
3348
|
+
__init81() {this.entityCells = /* @__PURE__ */ new Map()}
|
|
3349
|
+
constructor(cellSize = 64) {;_class6.prototype.__init80.call(this);_class6.prototype.__init81.call(this);
|
|
3331
3350
|
this.cellSize = cellSize;
|
|
3332
3351
|
}
|
|
3333
3352
|
hash(cx, cy) {
|
|
@@ -3419,18 +3438,18 @@ var SpatialHashGrid = (_class6 = class {
|
|
|
3419
3438
|
// src/tree/DOMPortalEntity.ts
|
|
3420
3439
|
var DOMPortalEntity = (_class7 = class extends _chunk2Z23LTH3js.Entity {
|
|
3421
3440
|
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3441
|
+
__init82() {this.isDOMPortal = true}
|
|
3442
|
+
__init83() {this.domListeners = []}
|
|
3443
|
+
__init84() {this.resizeObserver = null}
|
|
3444
|
+
__init85() {this.cachedWidth = 100}
|
|
3445
|
+
__init86() {this.cachedHeight = 100}
|
|
3446
|
+
__init87() {this.lastWidth = ""}
|
|
3447
|
+
__init88() {this.lastHeight = ""}
|
|
3448
|
+
__init89() {this.lastTransform = ""}
|
|
3449
|
+
__init90() {this.lastZIndex = ""}
|
|
3450
|
+
__init91() {this.lastOpacity = ""}
|
|
3432
3451
|
constructor(domElement, width, height, id) {
|
|
3433
|
-
super(id);_class7.prototype.
|
|
3452
|
+
super(id);_class7.prototype.__init82.call(this);_class7.prototype.__init83.call(this);_class7.prototype.__init84.call(this);_class7.prototype.__init85.call(this);_class7.prototype.__init86.call(this);_class7.prototype.__init87.call(this);_class7.prototype.__init88.call(this);_class7.prototype.__init89.call(this);_class7.prototype.__init90.call(this);_class7.prototype.__init91.call(this);;
|
|
3434
3453
|
this.domElement = domElement;
|
|
3435
3454
|
this.width = _nullishCoalesce(width, () => ( 0));
|
|
3436
3455
|
this.height = _nullishCoalesce(height, () => ( 0));
|
package/dist/index.mjs
CHANGED
|
@@ -701,6 +701,13 @@ var Scene = class _Scene {
|
|
|
701
701
|
activePortalsPrevFrame = /* @__PURE__ */ new Set();
|
|
702
702
|
portalEntities = /* @__PURE__ */ new Map();
|
|
703
703
|
renderOrderCounter = 0;
|
|
704
|
+
/**
|
|
705
|
+
* Authoritative paint order for semantic nodes discovered during the main
|
|
706
|
+
* render. A node may not have a DOM projection until the following a11y
|
|
707
|
+
* sync, so retaining the order prevents a newly opened overlay from spending
|
|
708
|
+
* its first frame below previously projected controls.
|
|
709
|
+
*/
|
|
710
|
+
a11yRenderOrders = /* @__PURE__ */ new Map();
|
|
704
711
|
// Optional WebGL point-cloud layer (see SceneOptions.pointBackend).
|
|
705
712
|
pointRenderer = null;
|
|
706
713
|
glCanvas = null;
|
|
@@ -1463,6 +1470,10 @@ var Scene = class _Scene {
|
|
|
1463
1470
|
if (el.style.pointerEvents !== semanticPointerEvents) {
|
|
1464
1471
|
el.style.pointerEvents = semanticPointerEvents;
|
|
1465
1472
|
}
|
|
1473
|
+
const renderOrder = this.a11yRenderOrders.get(node.id);
|
|
1474
|
+
if (renderOrder !== void 0 && el.style.zIndex !== String(renderOrder)) {
|
|
1475
|
+
el.style.zIndex = String(renderOrder);
|
|
1476
|
+
}
|
|
1466
1477
|
const implicitTabIndex = !isNativelyFocusable(el) && attrs.role && INTERACTIVE_A11Y_ROLES.has(attrs.role) ? 0 : null;
|
|
1467
1478
|
const desiredTabIndex = attrs.tabIndex ?? implicitTabIndex;
|
|
1468
1479
|
if (desiredTabIndex === null) {
|
|
@@ -2181,7 +2192,11 @@ var Scene = class _Scene {
|
|
|
2181
2192
|
this.scheduleFrame();
|
|
2182
2193
|
return;
|
|
2183
2194
|
}
|
|
2184
|
-
|
|
2195
|
+
let dt = time - this.lastTime;
|
|
2196
|
+
if (cap > 0) {
|
|
2197
|
+
const nominal = 1e3 / cap;
|
|
2198
|
+
if (Math.abs(dt - nominal) < nominal * 0.3) dt = nominal;
|
|
2199
|
+
}
|
|
2185
2200
|
this.lastTime = time;
|
|
2186
2201
|
if (this.renderMode === "onDemand" && isIdle) {
|
|
2187
2202
|
this.scheduleFrame();
|
|
@@ -2223,6 +2238,7 @@ var Scene = class _Scene {
|
|
|
2223
2238
|
}
|
|
2224
2239
|
if (isMainRenderer) {
|
|
2225
2240
|
this.renderOrderCounter = 0;
|
|
2241
|
+
this.a11yRenderOrders.clear();
|
|
2226
2242
|
this.activePortalsThisFrame.clear();
|
|
2227
2243
|
}
|
|
2228
2244
|
const computeEntities = [];
|
|
@@ -2381,8 +2397,11 @@ var Scene = class _Scene {
|
|
|
2381
2397
|
const orthogonalTolerance = Math.max(1, worldScaleX * worldScaleY) * 1e-6;
|
|
2382
2398
|
const isSimilarityTransform = Number.isFinite(worldScaleX) && Number.isFinite(worldScaleY) && Math.abs(worldScaleX - worldScaleY) <= scaleTolerance && Math.abs(a * c + b * d) <= orthogonalTolerance;
|
|
2383
2399
|
const a11yEl = isMainRenderer ? this.a11yElements.get(node.id) : void 0;
|
|
2384
|
-
|
|
2385
|
-
|
|
2400
|
+
const willProjectA11y = isMainRenderer && node.interactive && (node.width > 0 || node.a11yFullViewport);
|
|
2401
|
+
if (a11yEl || willProjectA11y) {
|
|
2402
|
+
const renderOrder = this.renderOrderCounter++;
|
|
2403
|
+
if (willProjectA11y) this.a11yRenderOrders.set(node.id, renderOrder);
|
|
2404
|
+
if (a11yEl) a11yEl.style.zIndex = String(renderOrder);
|
|
2386
2405
|
}
|
|
2387
2406
|
if (node.isDOMPortal) {
|
|
2388
2407
|
if (isMainRenderer) {
|
package/dist/tree/Scene.d.ts
CHANGED
|
@@ -205,6 +205,13 @@ export declare class Scene {
|
|
|
205
205
|
private activePortalsPrevFrame;
|
|
206
206
|
private portalEntities;
|
|
207
207
|
private renderOrderCounter;
|
|
208
|
+
/**
|
|
209
|
+
* Authoritative paint order for semantic nodes discovered during the main
|
|
210
|
+
* render. A node may not have a DOM projection until the following a11y
|
|
211
|
+
* sync, so retaining the order prevents a newly opened overlay from spending
|
|
212
|
+
* its first frame below previously projected controls.
|
|
213
|
+
*/
|
|
214
|
+
private a11yRenderOrders;
|
|
208
215
|
private pointRenderer;
|
|
209
216
|
private glCanvas;
|
|
210
217
|
private debugA11y;
|