@vectojs/core 1.36.0 → 1.37.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/dist/{chunk-QJC4VZ2E.mjs → chunk-3MTVDXZQ.mjs} +14 -3
- package/dist/{chunk-XE6K7T5S.js → chunk-DSYYQ6BQ.js} +14 -3
- package/dist/{chunk-25PS5K7R.mjs → chunk-LWEMD34D.mjs} +18 -4
- package/dist/{chunk-MO24PVGT.js → chunk-ZYYP2M5D.js} +18 -4
- package/dist/index.js +39 -39
- package/dist/index.mjs +2 -2
- package/dist/renderer/CanvasRenderer.d.ts +1 -1
- package/dist/renderer/IRenderer.d.ts +8 -1
- package/dist/renderer/SVGRenderer.d.ts +1 -1
- package/dist/renderer.js +2 -2
- package/dist/renderer.mjs +1 -1
- package/dist/text.js +2 -2
- package/dist/text.mjs +1 -1
- package/dist/tree/Entity.d.ts +14 -3
- package/package.json +1 -1
|
@@ -283,9 +283,20 @@ var Entity = class {
|
|
|
283
283
|
* and promotes it.
|
|
284
284
|
*
|
|
285
285
|
* `'never'` suppresses the node entirely. Prefer `interactive = false` unless
|
|
286
|
-
* the entity genuinely needs
|
|
287
|
-
* this exists so a purely decorative interactive surface can opt
|
|
288
|
-
*
|
|
286
|
+
* the entity genuinely needs to stay hit-testable without any semantic
|
|
287
|
+
* presence — this exists so a purely decorative interactive surface can opt
|
|
288
|
+
* out of the a11y tree.
|
|
289
|
+
*
|
|
290
|
+
* **Pointer input is routed through the projected mirror.** The engine binds
|
|
291
|
+
* `pointerdown`/`pointermove`/`pointerup`/`click`/`dblclick` to each shadow
|
|
292
|
+
* element (the canvas itself only tracks `mouseX`/`mouseY`), so an entity
|
|
293
|
+
* with no materialized node receives **no pointer events at all** — neither
|
|
294
|
+
* in `'never'` mode nor in `'onDemand'` before it is engaged (focused,
|
|
295
|
+
* pointer target, or `requestA11yProjection`). Canvas hit-testing exists
|
|
296
|
+
* (`Scene.findEntityAt`) but is a query API, not a dispatch path. For a
|
|
297
|
+
* pointer-reactive region with no role (e.g. a desktop click-catcher), use
|
|
298
|
+
* `'eager'` + `a11yFullViewport` + `tabIndex: -1` with a role-less
|
|
299
|
+
* `getA11yAttributes()`: the mirror is AT-invisible but pointer-visible.
|
|
289
300
|
*
|
|
290
301
|
* **This does not replace an aggregate description.** A thousand `'onDemand'`
|
|
291
302
|
* danmaku are individually reachable but say nothing collectively. The proven
|
|
@@ -285,9 +285,20 @@ var Entity = (_class2 = class {
|
|
|
285
285
|
* and promotes it.
|
|
286
286
|
*
|
|
287
287
|
* `'never'` suppresses the node entirely. Prefer `interactive = false` unless
|
|
288
|
-
* the entity genuinely needs
|
|
289
|
-
* this exists so a purely decorative interactive surface can opt
|
|
290
|
-
*
|
|
288
|
+
* the entity genuinely needs to stay hit-testable without any semantic
|
|
289
|
+
* presence — this exists so a purely decorative interactive surface can opt
|
|
290
|
+
* out of the a11y tree.
|
|
291
|
+
*
|
|
292
|
+
* **Pointer input is routed through the projected mirror.** The engine binds
|
|
293
|
+
* `pointerdown`/`pointermove`/`pointerup`/`click`/`dblclick` to each shadow
|
|
294
|
+
* element (the canvas itself only tracks `mouseX`/`mouseY`), so an entity
|
|
295
|
+
* with no materialized node receives **no pointer events at all** — neither
|
|
296
|
+
* in `'never'` mode nor in `'onDemand'` before it is engaged (focused,
|
|
297
|
+
* pointer target, or `requestA11yProjection`). Canvas hit-testing exists
|
|
298
|
+
* (`Scene.findEntityAt`) but is a query API, not a dispatch path. For a
|
|
299
|
+
* pointer-reactive region with no role (e.g. a desktop click-catcher), use
|
|
300
|
+
* `'eager'` + `a11yFullViewport` + `tabIndex: -1` with a role-less
|
|
301
|
+
* `getA11yAttributes()`: the mirror is AT-invisible but pointer-visible.
|
|
291
302
|
*
|
|
292
303
|
* **This does not replace an aggregate description.** A thousand `'onDemand'`
|
|
293
304
|
* danmaku are individually reachable but say nothing collectively. The proven
|
|
@@ -304,11 +304,15 @@ var CanvasRenderer = class _CanvasRenderer {
|
|
|
304
304
|
this.ctx.globalAlpha = alpha;
|
|
305
305
|
}
|
|
306
306
|
/** @inheritdoc */
|
|
307
|
-
clip(x, y, width, height) {
|
|
307
|
+
clip(x, y, width, height, radii) {
|
|
308
308
|
this.flush();
|
|
309
309
|
if (this.counters) this.counters.clips++;
|
|
310
310
|
this.ctx.beginPath();
|
|
311
|
-
|
|
311
|
+
if (radii !== void 0) {
|
|
312
|
+
this.ctx.roundRect(x, y, width, height, radii);
|
|
313
|
+
} else {
|
|
314
|
+
this.ctx.rect(x, y, width, height);
|
|
315
|
+
}
|
|
312
316
|
this.ctx.clip();
|
|
313
317
|
}
|
|
314
318
|
/** @inheritdoc */
|
|
@@ -854,11 +858,21 @@ var SVGRenderer = class {
|
|
|
854
858
|
createMatrix: [this.ma, this.mb, this.mc, this.md, this.me, this.mf]
|
|
855
859
|
};
|
|
856
860
|
}
|
|
857
|
-
clip(x, y, width, height) {
|
|
861
|
+
clip(x, y, width, height, radii) {
|
|
858
862
|
this.flush();
|
|
859
863
|
const id = `clip-${this.clipCounter++}`;
|
|
860
864
|
const transformStr = `matrix(${this.ma},${this.mb},${this.mc},${this.md},${this.me},${this.mf})`;
|
|
861
|
-
|
|
865
|
+
let clipShape;
|
|
866
|
+
if (radii !== void 0) {
|
|
867
|
+
const savedPath = this.currentPath;
|
|
868
|
+
this.currentPath = [];
|
|
869
|
+
this.roundRect(x, y, width, height, radii);
|
|
870
|
+
clipShape = `<path d="${this.currentPath.join(" ")}" transform="${transformStr}" />`;
|
|
871
|
+
this.currentPath = savedPath;
|
|
872
|
+
} else {
|
|
873
|
+
clipShape = `<rect x="${x}" y="${y}" width="${width}" height="${height}" transform="${transformStr}" />`;
|
|
874
|
+
}
|
|
875
|
+
const clipXML = `<clipPath id="${id}">${clipShape}</clipPath>`;
|
|
862
876
|
this.defsBuffer.push(clipXML);
|
|
863
877
|
this.buffer.push(`<g clip-path="url(#${id})">`);
|
|
864
878
|
this.clipDepth++;
|
|
@@ -306,11 +306,15 @@ var CanvasRenderer = (_class = class _CanvasRenderer {
|
|
|
306
306
|
this.ctx.globalAlpha = alpha;
|
|
307
307
|
}
|
|
308
308
|
/** @inheritdoc */
|
|
309
|
-
clip(x, y, width, height) {
|
|
309
|
+
clip(x, y, width, height, radii) {
|
|
310
310
|
this.flush();
|
|
311
311
|
if (this.counters) this.counters.clips++;
|
|
312
312
|
this.ctx.beginPath();
|
|
313
|
-
|
|
313
|
+
if (radii !== void 0) {
|
|
314
|
+
this.ctx.roundRect(x, y, width, height, radii);
|
|
315
|
+
} else {
|
|
316
|
+
this.ctx.rect(x, y, width, height);
|
|
317
|
+
}
|
|
314
318
|
this.ctx.clip();
|
|
315
319
|
}
|
|
316
320
|
/** @inheritdoc */
|
|
@@ -856,11 +860,21 @@ var SVGRenderer = (_class2 = class {
|
|
|
856
860
|
createMatrix: [this.ma, this.mb, this.mc, this.md, this.me, this.mf]
|
|
857
861
|
};
|
|
858
862
|
}
|
|
859
|
-
clip(x, y, width, height) {
|
|
863
|
+
clip(x, y, width, height, radii) {
|
|
860
864
|
this.flush();
|
|
861
865
|
const id = `clip-${this.clipCounter++}`;
|
|
862
866
|
const transformStr = `matrix(${this.ma},${this.mb},${this.mc},${this.md},${this.me},${this.mf})`;
|
|
863
|
-
|
|
867
|
+
let clipShape;
|
|
868
|
+
if (radii !== void 0) {
|
|
869
|
+
const savedPath = this.currentPath;
|
|
870
|
+
this.currentPath = [];
|
|
871
|
+
this.roundRect(x, y, width, height, radii);
|
|
872
|
+
clipShape = `<path d="${this.currentPath.join(" ")}" transform="${transformStr}" />`;
|
|
873
|
+
this.currentPath = savedPath;
|
|
874
|
+
} else {
|
|
875
|
+
clipShape = `<rect x="${x}" y="${y}" width="${width}" height="${height}" transform="${transformStr}" />`;
|
|
876
|
+
}
|
|
877
|
+
const clipXML = `<clipPath id="${id}">${clipShape}</clipPath>`;
|
|
864
878
|
this.defsBuffer.push(clipXML);
|
|
865
879
|
this.buffer.push(`<g clip-path="url(#${id})">`);
|
|
866
880
|
this.clipDepth++;
|
package/dist/index.js
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkZYYP2M5Djs = require('./chunk-ZYYP2M5D.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkDSYYQ6BQjs = require('./chunk-DSYYQ6BQ.js');
|
|
23
23
|
|
|
24
24
|
// src/tree/ComputeParticleEntity.ts
|
|
25
25
|
var PARTICLE_STRIDE_FLOATS = 8;
|
|
@@ -31,7 +31,7 @@ var PARTICLE_OFFSET_ORIGIN_X = 4;
|
|
|
31
31
|
var PARTICLE_OFFSET_ORIGIN_Y = 5;
|
|
32
32
|
var PARTICLE_OFFSET_SIZE = 6;
|
|
33
33
|
var PARTICLE_OFFSET_LIFE = 7;
|
|
34
|
-
var ComputeParticleEntity = (_class = class extends
|
|
34
|
+
var ComputeParticleEntity = (_class = class extends _chunkDSYYQ6BQjs.Entity {
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -4698,7 +4698,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
4698
4698
|
}
|
|
4699
4699
|
static set devMode(active) {
|
|
4700
4700
|
_Scene._devMode = active;
|
|
4701
|
-
|
|
4701
|
+
_chunkZYYP2M5Djs.setRendererDevMode.call(void 0, active);
|
|
4702
4702
|
}
|
|
4703
4703
|
static _devModeDetected() {
|
|
4704
4704
|
if (_Scene._devMode) return true;
|
|
@@ -4816,7 +4816,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
4816
4816
|
this.readingDirection = _nullishCoalesce(options.readingDirection, () => ( "ltr"));
|
|
4817
4817
|
this.renderMode = _nullishCoalesce(options.renderMode, () => ( "always"));
|
|
4818
4818
|
this._devActive = _Scene._devModeDetected();
|
|
4819
|
-
|
|
4819
|
+
_chunkZYYP2M5Djs.setRendererDevMode.call(void 0, this._devActive);
|
|
4820
4820
|
this._warnUnknownOptions(options);
|
|
4821
4821
|
this.reducedMotionQuery = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
|
|
4822
4822
|
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
@@ -4824,7 +4824,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
4824
4824
|
this.forcedColorsChangeHandler = () => this.markDirty();
|
|
4825
4825
|
_optionalChain([this, 'access', _118 => _118.forcedColorsQuery, 'access', _119 => _119.addEventListener, 'optionalCall', _120 => _120("change", this.forcedColorsChangeHandler)]);
|
|
4826
4826
|
}
|
|
4827
|
-
this.root = new class RootEntity extends
|
|
4827
|
+
this.root = new class RootEntity extends _chunkDSYYQ6BQjs.Entity {
|
|
4828
4828
|
isPointInside() {
|
|
4829
4829
|
return false;
|
|
4830
4830
|
}
|
|
@@ -4834,7 +4834,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
4834
4834
|
}("root");
|
|
4835
4835
|
this.root._scene = this;
|
|
4836
4836
|
this._wasmBackend = new WasmBackendFacade(this.root);
|
|
4837
|
-
this.overlayRoot = new class OverlayRoot extends
|
|
4837
|
+
this.overlayRoot = new class OverlayRoot extends _chunkDSYYQ6BQjs.Entity {
|
|
4838
4838
|
isPointInside() {
|
|
4839
4839
|
return false;
|
|
4840
4840
|
}
|
|
@@ -4847,7 +4847,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
4847
4847
|
if (options.renderer) {
|
|
4848
4848
|
this.renderer = options.renderer;
|
|
4849
4849
|
} else {
|
|
4850
|
-
this.renderer = new (0,
|
|
4850
|
+
this.renderer = new (0, _chunkZYYP2M5Djs.CanvasRenderer)(
|
|
4851
4851
|
canvas,
|
|
4852
4852
|
this.disableWindowResize ? { width: this.width, height: this.height } : void 0,
|
|
4853
4853
|
this.maxDPR
|
|
@@ -5154,7 +5154,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
5154
5154
|
}
|
|
5155
5155
|
if (this.hoveredA11yElements.has(el)) {
|
|
5156
5156
|
this.hoveredA11yElements.delete(el);
|
|
5157
|
-
node.dispatchEvent(new (0,
|
|
5157
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointerleave", node, void 0, false));
|
|
5158
5158
|
}
|
|
5159
5159
|
this.preserveFocusOnRemoval(el);
|
|
5160
5160
|
el.remove();
|
|
@@ -5745,20 +5745,20 @@ var Scene = (_class15 = class _Scene {
|
|
|
5745
5745
|
el.style.background = "transparent";
|
|
5746
5746
|
}
|
|
5747
5747
|
el.addEventListener("click", (e) => {
|
|
5748
|
-
node.dispatchEvent(new (0,
|
|
5748
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("click", node, e));
|
|
5749
5749
|
});
|
|
5750
5750
|
el.addEventListener("dblclick", (e) => {
|
|
5751
|
-
node.dispatchEvent(new (0,
|
|
5751
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("dblclick", node, e));
|
|
5752
5752
|
});
|
|
5753
5753
|
el.addEventListener("mouseenter", (e) => {
|
|
5754
5754
|
if (this.debugA11y) el.style.backgroundColor = "rgba(56, 189, 248, 0.2)";
|
|
5755
5755
|
this.hoveredA11yElements.add(el);
|
|
5756
|
-
node.dispatchEvent(new (0,
|
|
5756
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("hover", node, e, false));
|
|
5757
5757
|
});
|
|
5758
5758
|
el.addEventListener("mouseleave", (e) => {
|
|
5759
5759
|
if (this.debugA11y) el.style.backgroundColor = "rgba(56, 189, 248, 0.05)";
|
|
5760
5760
|
this.hoveredA11yElements.delete(el);
|
|
5761
|
-
node.dispatchEvent(new (0,
|
|
5761
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointerleave", node, e, false));
|
|
5762
5762
|
});
|
|
5763
5763
|
const capEl = el;
|
|
5764
5764
|
const releasePointer = (event) => {
|
|
@@ -5774,24 +5774,24 @@ var Scene = (_class15 = class _Scene {
|
|
|
5774
5774
|
};
|
|
5775
5775
|
el.addEventListener("pointerdown", (e) => {
|
|
5776
5776
|
if (typeof capEl.setPointerCapture === "function") capEl.setPointerCapture(e.pointerId);
|
|
5777
|
-
node.dispatchEvent(new (0,
|
|
5777
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointerdown", node, e));
|
|
5778
5778
|
});
|
|
5779
5779
|
el.addEventListener("pointerup", (e) => {
|
|
5780
5780
|
releasePointer(e);
|
|
5781
|
-
node.dispatchEvent(new (0,
|
|
5781
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointerup", node, e));
|
|
5782
5782
|
});
|
|
5783
5783
|
el.addEventListener("pointercancel", (e) => {
|
|
5784
5784
|
releasePointer(e);
|
|
5785
|
-
node.dispatchEvent(new (0,
|
|
5785
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointercancel", node, e));
|
|
5786
5786
|
});
|
|
5787
5787
|
el.addEventListener(
|
|
5788
5788
|
"pointermove",
|
|
5789
|
-
(e) => node.dispatchEvent(new (0,
|
|
5789
|
+
(e) => node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("pointermove", node, e))
|
|
5790
5790
|
);
|
|
5791
5791
|
el.addEventListener(
|
|
5792
5792
|
"wheel",
|
|
5793
5793
|
(e) => {
|
|
5794
|
-
node.dispatchEvent(new (0,
|
|
5794
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("wheel", node, e));
|
|
5795
5795
|
},
|
|
5796
5796
|
{ passive: false }
|
|
5797
5797
|
);
|
|
@@ -5816,10 +5816,10 @@ var Scene = (_class15 = class _Scene {
|
|
|
5816
5816
|
);
|
|
5817
5817
|
emitInitialScroll = emitScroll;
|
|
5818
5818
|
el.addEventListener("keydown", (e) => {
|
|
5819
|
-
node.dispatchEvent(new (0,
|
|
5819
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("keydown", node, e));
|
|
5820
5820
|
});
|
|
5821
5821
|
el.addEventListener("keyup", (e) => {
|
|
5822
|
-
node.dispatchEvent(new (0,
|
|
5822
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("keyup", node, e));
|
|
5823
5823
|
});
|
|
5824
5824
|
if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
|
|
5825
5825
|
const input = el;
|
|
@@ -5885,7 +5885,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
5885
5885
|
el.addEventListener("keydown", (e) => {
|
|
5886
5886
|
if (e.key === "Enter" || e.key === " ") {
|
|
5887
5887
|
e.preventDefault();
|
|
5888
|
-
node.dispatchEvent(new (0,
|
|
5888
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("click", node, e));
|
|
5889
5889
|
}
|
|
5890
5890
|
});
|
|
5891
5891
|
}
|
|
@@ -5923,7 +5923,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
5923
5923
|
this.syncOptionalAttribute(
|
|
5924
5924
|
el,
|
|
5925
5925
|
"href",
|
|
5926
|
-
attrs.href === void 0 ? void 0 :
|
|
5926
|
+
attrs.href === void 0 ? void 0 : _chunkZYYP2M5Djs.sanitizeUrl.call(void 0, attrs.href)
|
|
5927
5927
|
);
|
|
5928
5928
|
this.syncOptionalAttribute(el, "target", attrs.target);
|
|
5929
5929
|
}
|
|
@@ -6322,7 +6322,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
6322
6322
|
el.addEventListener(
|
|
6323
6323
|
"wheel",
|
|
6324
6324
|
(e2) => {
|
|
6325
|
-
node.dispatchEvent(new (0,
|
|
6325
|
+
node.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)("wheel", node, e2));
|
|
6326
6326
|
},
|
|
6327
6327
|
{ passive: false }
|
|
6328
6328
|
);
|
|
@@ -6991,7 +6991,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
6991
6991
|
let walkHadAnimation = false;
|
|
6992
6992
|
let walkHadInteractive = false;
|
|
6993
6993
|
const runUpdate = (node) => {
|
|
6994
|
-
const overridesUpdate = node.update !==
|
|
6994
|
+
const overridesUpdate = node.update !== _chunkDSYYQ6BQjs.Entity.prototype.update;
|
|
6995
6995
|
let pending = node.hasPendingAnimations();
|
|
6996
6996
|
if (pending || overridesUpdate) {
|
|
6997
6997
|
node.update(dt, time);
|
|
@@ -7000,7 +7000,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
7000
7000
|
if (pending) walkHadAnimation = true;
|
|
7001
7001
|
if (!walkHadInteractive && node.interactive) walkHadInteractive = true;
|
|
7002
7002
|
if (this._devActive && this._devFrameCount % 120 === 0) {
|
|
7003
|
-
if (overridesUpdate && node.hasPendingAnimations ===
|
|
7003
|
+
if (overridesUpdate && node.hasPendingAnimations === _chunkDSYYQ6BQjs.Entity.prototype.hasPendingAnimations) {
|
|
7004
7004
|
this._devWarn(
|
|
7005
7005
|
`Entity "${node.id}" overrides update() but not hasPendingAnimations(). Custom motion in update() without overriding hasPendingAnimations() causes the idle throttle to slow the animation. Override hasPendingAnimations() to return true while motion is in flight.`
|
|
7006
7006
|
);
|
|
@@ -7213,7 +7213,7 @@ var Scene = (_class15 = class _Scene {
|
|
|
7213
7213
|
* Export the current scene state to a lightweight, flat SVG XML string.
|
|
7214
7214
|
*/
|
|
7215
7215
|
toSVG() {
|
|
7216
|
-
const renderer = new (0,
|
|
7216
|
+
const renderer = new (0, _chunkZYYP2M5Djs.SVGRenderer)(this.width, this.height);
|
|
7217
7217
|
this.render(renderer, 0, 0);
|
|
7218
7218
|
return renderer.toXMLString();
|
|
7219
7219
|
}
|
|
@@ -7426,7 +7426,7 @@ function defaultMeasurer() {
|
|
|
7426
7426
|
sharedMeasurer ??= _layout.resolveGlyphMeasurer.call(void 0, "sans-serif");
|
|
7427
7427
|
return sharedMeasurer;
|
|
7428
7428
|
}
|
|
7429
|
-
var TextEntity = (_class16 = class extends
|
|
7429
|
+
var TextEntity = (_class16 = class extends _chunkDSYYQ6BQjs.Entity {
|
|
7430
7430
|
|
|
7431
7431
|
|
|
7432
7432
|
|
|
@@ -7630,7 +7630,7 @@ var TextEntity = (_class16 = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
7630
7630
|
}, _class16);
|
|
7631
7631
|
|
|
7632
7632
|
// src/components/GridTextEntity.ts
|
|
7633
|
-
var GridTextEntity = (_class17 = class extends
|
|
7633
|
+
var GridTextEntity = (_class17 = class extends _chunkDSYYQ6BQjs.Entity {
|
|
7634
7634
|
|
|
7635
7635
|
__init185() {this.fillStyle = "#ffffff"}
|
|
7636
7636
|
__init186() {this.grid = []}
|
|
@@ -7724,7 +7724,7 @@ function distSqToSegment(px, py, x1, y1, x2, y2) {
|
|
|
7724
7724
|
const ey = py - cy;
|
|
7725
7725
|
return ex * ex + ey * ey;
|
|
7726
7726
|
}
|
|
7727
|
-
var SplineEntity = (_class18 = class extends
|
|
7727
|
+
var SplineEntity = (_class18 = class extends _chunkDSYYQ6BQjs.Entity {
|
|
7728
7728
|
|
|
7729
7729
|
|
|
7730
7730
|
|
|
@@ -8052,7 +8052,7 @@ async function loadSpline(url) {
|
|
|
8052
8052
|
}
|
|
8053
8053
|
|
|
8054
8054
|
// src/components/Rect.ts
|
|
8055
|
-
var Rect = class extends
|
|
8055
|
+
var Rect = class extends _chunkDSYYQ6BQjs.Entity {
|
|
8056
8056
|
|
|
8057
8057
|
|
|
8058
8058
|
|
|
@@ -8108,7 +8108,7 @@ var Rect = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8108
8108
|
};
|
|
8109
8109
|
|
|
8110
8110
|
// src/components/Circle.ts
|
|
8111
|
-
var Circle = class extends
|
|
8111
|
+
var Circle = class extends _chunkDSYYQ6BQjs.Entity {
|
|
8112
8112
|
|
|
8113
8113
|
|
|
8114
8114
|
|
|
@@ -8172,7 +8172,7 @@ var Circle = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8172
8172
|
};
|
|
8173
8173
|
|
|
8174
8174
|
// src/components/Group.ts
|
|
8175
|
-
var Group = class extends
|
|
8175
|
+
var Group = class extends _chunkDSYYQ6BQjs.Entity {
|
|
8176
8176
|
constructor(...children) {
|
|
8177
8177
|
super();
|
|
8178
8178
|
if (children.length > 0) this.add(...children);
|
|
@@ -8191,7 +8191,7 @@ var _math = require('@vectojs/math'); _createStarExport(_math);
|
|
|
8191
8191
|
|
|
8192
8192
|
|
|
8193
8193
|
// src/tree/DOMPortalEntity.ts
|
|
8194
|
-
var DOMPortalEntity = (_class19 = class extends
|
|
8194
|
+
var DOMPortalEntity = (_class19 = class extends _chunkDSYYQ6BQjs.Entity {
|
|
8195
8195
|
|
|
8196
8196
|
__init196() {this.isDOMPortal = true}
|
|
8197
8197
|
__init197() {this.domListeners = []}
|
|
@@ -8247,7 +8247,7 @@ var DOMPortalEntity = (_class19 = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8247
8247
|
];
|
|
8248
8248
|
for (const type of events) {
|
|
8249
8249
|
const handler = (e) => {
|
|
8250
|
-
this.dispatchEvent(new (0,
|
|
8250
|
+
this.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)(type, this, e));
|
|
8251
8251
|
};
|
|
8252
8252
|
this.domElement.addEventListener(type, handler);
|
|
8253
8253
|
this.domListeners.push({ type, handler, capture: false });
|
|
@@ -8258,7 +8258,7 @@ var DOMPortalEntity = (_class19 = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8258
8258
|
];
|
|
8259
8259
|
for (const { native, vecto } of hoverEvents) {
|
|
8260
8260
|
const handler = (e) => {
|
|
8261
|
-
this.dispatchEvent(new (0,
|
|
8261
|
+
this.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)(vecto, this, e, false));
|
|
8262
8262
|
};
|
|
8263
8263
|
this.domElement.addEventListener(native, handler);
|
|
8264
8264
|
this.domListeners.push({ type: native, handler, capture: false });
|
|
@@ -8266,7 +8266,7 @@ var DOMPortalEntity = (_class19 = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8266
8266
|
const focusEvents = ["focus", "blur"];
|
|
8267
8267
|
for (const type of focusEvents) {
|
|
8268
8268
|
const handler = (e) => {
|
|
8269
|
-
this.dispatchEvent(new (0,
|
|
8269
|
+
this.dispatchEvent(new (0, _chunkDSYYQ6BQjs.VectoJSEvent)(type, this, e, true));
|
|
8270
8270
|
};
|
|
8271
8271
|
this.domElement.addEventListener(type, handler, true);
|
|
8272
8272
|
this.domListeners.push({ type, handler, capture: true });
|
|
@@ -8317,8 +8317,8 @@ var DOMPortalEntity = (_class19 = class extends _chunkXE6K7T5Sjs.Entity {
|
|
|
8317
8317
|
}, _class19);
|
|
8318
8318
|
|
|
8319
8319
|
// src/index.ts
|
|
8320
|
-
Scene.registerWebGLPointRendererCreator(
|
|
8321
|
-
Scene.registerWebGPUParticleSystemManager(
|
|
8320
|
+
Scene.registerWebGLPointRendererCreator(_chunkZYYP2M5Djs.createWebGLPointRenderer);
|
|
8321
|
+
Scene.registerWebGPUParticleSystemManager(_chunkZYYP2M5Djs.WebGPUParticleSystemManager);
|
|
8322
8322
|
|
|
8323
8323
|
|
|
8324
8324
|
|
|
@@ -8364,4 +8364,4 @@ Scene.registerWebGPUParticleSystemManager(_chunkMO24PVGTjs.WebGPUParticleSystemM
|
|
|
8364
8364
|
|
|
8365
8365
|
|
|
8366
8366
|
|
|
8367
|
-
exports.CanvasRenderer =
|
|
8367
|
+
exports.CanvasRenderer = _chunkZYYP2M5Djs.CanvasRenderer; exports.Circle = Circle; exports.ComputeParticleEntity = ComputeParticleEntity; exports.DEFAULT_CONTENT_SEMANTIC_BUDGET = DEFAULT_CONTENT_SEMANTIC_BUDGET; exports.DOMPortalEntity = DOMPortalEntity; exports.Entity = _chunkDSYYQ6BQjs.Entity; exports.GlyphRasterAtlas = _chunkZYYP2M5Djs.GlyphRasterAtlas; exports.GridTextEntity = GridTextEntity; exports.Group = Group; exports.MSDFTextEntity = _chunkDSYYQ6BQjs.MSDFTextEntity; exports.PARTICLE_OFFSET_LIFE = PARTICLE_OFFSET_LIFE; exports.PARTICLE_OFFSET_ORIGIN_X = PARTICLE_OFFSET_ORIGIN_X; exports.PARTICLE_OFFSET_ORIGIN_Y = PARTICLE_OFFSET_ORIGIN_Y; exports.PARTICLE_OFFSET_POSITION_X = PARTICLE_OFFSET_POSITION_X; exports.PARTICLE_OFFSET_POSITION_Y = PARTICLE_OFFSET_POSITION_Y; exports.PARTICLE_OFFSET_SIZE = PARTICLE_OFFSET_SIZE; exports.PARTICLE_OFFSET_VELOCITY_X = PARTICLE_OFFSET_VELOCITY_X; exports.PARTICLE_OFFSET_VELOCITY_Y = PARTICLE_OFFSET_VELOCITY_Y; exports.PARTICLE_STRIDE_FLOATS = PARTICLE_STRIDE_FLOATS; exports.REDUCED_MOTION_FPS = REDUCED_MOTION_FPS; exports.Rect = Rect; exports.SCENE_OPTION_KEYS = SCENE_OPTION_KEYS; exports.SVGEntity = _chunkDSYYQ6BQjs.SVGEntity; exports.SVGRenderer = _chunkZYYP2M5Djs.SVGRenderer; exports.Scene = Scene; exports.SplineEntity = SplineEntity; exports.TextEntity = TextEntity; exports.TextRasterCache = _chunkZYYP2M5Djs.TextRasterCache; exports.VECTO_USER_TIMING = VECTO_USER_TIMING; exports.VectoJSEvent = _chunkDSYYQ6BQjs.VectoJSEvent; exports.WebGPUParticleSystemManager = _chunkZYYP2M5Djs.WebGPUParticleSystemManager; exports.beginVectoUserTiming = beginVectoUserTiming; exports.contentLineInHint = _chunkDSYYQ6BQjs.contentLineInHint; exports.createWebGLPointRenderer = _chunkZYYP2M5Djs.createWebGLPointRenderer; exports.endVectoUserTiming = endVectoUserTiming; exports.installRendererDevTraps = _chunkZYYP2M5Djs.installRendererDevTraps; exports.isRendererDevMode = _chunkZYYP2M5Djs.isRendererDevMode; exports.isSafeUrl = _chunkZYYP2M5Djs.isSafeUrl; exports.loadSpline = loadSpline; exports.measureVectoUserTiming = measureVectoUserTiming; exports.parseColorToRGBA = _chunkZYYP2M5Djs.parseColorToRGBA; exports.polySegmentToBezier = polySegmentToBezier; exports.sanitizeUrl = _chunkZYYP2M5Djs.sanitizeUrl; exports.setRendererDevMode = _chunkZYYP2M5Djs.setRendererDevMode;
|
package/dist/index.mjs
CHANGED
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
parseColorToRGBA,
|
|
12
12
|
sanitizeUrl,
|
|
13
13
|
setRendererDevMode
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LWEMD34D.mjs";
|
|
15
15
|
import {
|
|
16
16
|
Entity,
|
|
17
17
|
MSDFTextEntity,
|
|
18
18
|
SVGEntity,
|
|
19
19
|
VectoJSEvent,
|
|
20
20
|
contentLineInHint
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3MTVDXZQ.mjs";
|
|
22
22
|
|
|
23
23
|
// src/tree/ComputeParticleEntity.ts
|
|
24
24
|
var PARTICLE_STRIDE_FLOATS = 8;
|
|
@@ -133,7 +133,7 @@ export declare class CanvasRenderer implements IRenderer {
|
|
|
133
133
|
/** @inheritdoc */
|
|
134
134
|
setGlobalAlpha(alpha: number): void;
|
|
135
135
|
/** @inheritdoc */
|
|
136
|
-
clip(x: number, y: number, width: number, height: number): void;
|
|
136
|
+
clip(x: number, y: number, width: number, height: number, radii?: number | number[]): void;
|
|
137
137
|
/** @inheritdoc */
|
|
138
138
|
beginPath(): void;
|
|
139
139
|
/** @inheritdoc */
|
|
@@ -129,12 +129,19 @@ export interface IRenderer {
|
|
|
129
129
|
* Intersect the current clip region with a rectangle. Affects all subsequent
|
|
130
130
|
* draws until the next {@link restore}; wrap in {@link save}/{@link restore}.
|
|
131
131
|
*
|
|
132
|
+
* When `radii` is provided the clip is a rounded rectangle instead of a sharp
|
|
133
|
+
* one. Backends that can only express a rectangular clip (e.g. a scissor-test
|
|
134
|
+
* GPU path) may ignore `radii`, so it must be treated as a progressive
|
|
135
|
+
* enhancement rather than a guarantee.
|
|
136
|
+
*
|
|
132
137
|
* @param x - Left edge.
|
|
133
138
|
* @param y - Top edge.
|
|
134
139
|
* @param width - Rectangle width.
|
|
135
140
|
* @param height - Rectangle height.
|
|
141
|
+
* @param radii - Optional corner radius (uniform) or per-corner array, matching
|
|
142
|
+
* {@link roundRect}. Omit for a sharp rectangle.
|
|
136
143
|
*/
|
|
137
|
-
clip(x: number, y: number, width: number, height: number): void;
|
|
144
|
+
clip(x: number, y: number, width: number, height: number, radii?: number | number[]): void;
|
|
138
145
|
/** Begin a new sub-path, discarding the current path. */
|
|
139
146
|
beginPath(): void;
|
|
140
147
|
/**
|
|
@@ -72,7 +72,7 @@ export declare class SVGRenderer implements IRenderer {
|
|
|
72
72
|
stop: number;
|
|
73
73
|
color: string;
|
|
74
74
|
}[]): SVGLinearGradient;
|
|
75
|
-
clip(x: number, y: number, width: number, height: number): void;
|
|
75
|
+
clip(x: number, y: number, width: number, height: number, radii?: number | number[]): void;
|
|
76
76
|
toXMLString(): string;
|
|
77
77
|
private resolveGradient;
|
|
78
78
|
private escapeXML;
|
package/dist/renderer.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkZYYP2M5Djs = require('./chunk-ZYYP2M5D.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -22,4 +22,4 @@ var _chunkMO24PVGTjs = require('./chunk-MO24PVGT.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.CanvasRenderer =
|
|
25
|
+
exports.CanvasRenderer = _chunkZYYP2M5Djs.CanvasRenderer; exports.GlyphRasterAtlas = _chunkZYYP2M5Djs.GlyphRasterAtlas; exports.SVGRenderer = _chunkZYYP2M5Djs.SVGRenderer; exports.TextRasterCache = _chunkZYYP2M5Djs.TextRasterCache; exports.WebGPUParticleSystemManager = _chunkZYYP2M5Djs.WebGPUParticleSystemManager; exports.createWebGLPointRenderer = _chunkZYYP2M5Djs.createWebGLPointRenderer; exports.installRendererDevTraps = _chunkZYYP2M5Djs.installRendererDevTraps; exports.isRendererDevMode = _chunkZYYP2M5Djs.isRendererDevMode; exports.parseColorToRGBA = _chunkZYYP2M5Djs.parseColorToRGBA; exports.setRendererDevMode = _chunkZYYP2M5Djs.setRendererDevMode;
|
package/dist/renderer.mjs
CHANGED
package/dist/text.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkDSYYQ6BQjs = require('./chunk-DSYYQ6BQ.js');
|
|
6
6
|
|
|
7
7
|
// src/text/index.ts
|
|
8
8
|
var _text = require('@vectojs/text'); _createStarExport(_text);
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.MSDFTextEntity =
|
|
12
|
+
exports.MSDFTextEntity = _chunkDSYYQ6BQjs.MSDFTextEntity; exports.SVGEntity = _chunkDSYYQ6BQjs.SVGEntity;
|
package/dist/text.mjs
CHANGED
package/dist/tree/Entity.d.ts
CHANGED
|
@@ -658,9 +658,20 @@ export declare abstract class Entity {
|
|
|
658
658
|
* and promotes it.
|
|
659
659
|
*
|
|
660
660
|
* `'never'` suppresses the node entirely. Prefer `interactive = false` unless
|
|
661
|
-
* the entity genuinely needs
|
|
662
|
-
* this exists so a purely decorative interactive surface can opt
|
|
663
|
-
*
|
|
661
|
+
* the entity genuinely needs to stay hit-testable without any semantic
|
|
662
|
+
* presence — this exists so a purely decorative interactive surface can opt
|
|
663
|
+
* out of the a11y tree.
|
|
664
|
+
*
|
|
665
|
+
* **Pointer input is routed through the projected mirror.** The engine binds
|
|
666
|
+
* `pointerdown`/`pointermove`/`pointerup`/`click`/`dblclick` to each shadow
|
|
667
|
+
* element (the canvas itself only tracks `mouseX`/`mouseY`), so an entity
|
|
668
|
+
* with no materialized node receives **no pointer events at all** — neither
|
|
669
|
+
* in `'never'` mode nor in `'onDemand'` before it is engaged (focused,
|
|
670
|
+
* pointer target, or `requestA11yProjection`). Canvas hit-testing exists
|
|
671
|
+
* (`Scene.findEntityAt`) but is a query API, not a dispatch path. For a
|
|
672
|
+
* pointer-reactive region with no role (e.g. a desktop click-catcher), use
|
|
673
|
+
* `'eager'` + `a11yFullViewport` + `tabIndex: -1` with a role-less
|
|
674
|
+
* `getA11yAttributes()`: the mirror is AT-invisible but pointer-visible.
|
|
664
675
|
*
|
|
665
676
|
* **This does not replace an aggregate description.** A thousand `'onDemand'`
|
|
666
677
|
* danmaku are individually reachable but say nothing collectively. The proven
|