@pibbl/core 0.0.2 → 0.0.3-alpha.85.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/THIRD_PARTY_NOTICES.txt +81 -0
- package/dist/features/textures/index.d.ts +12 -2
- package/dist/features/textures/index.js +33 -1
- package/dist/features/textures/index.js.map +2 -2
- package/dist/features/textures/lib/chemical-field.d.ts +56 -0
- package/dist/features/textures/lib/chemical-field.js +154 -0
- package/dist/features/textures/lib/chemical-field.js.map +7 -0
- package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
- package/dist/features/textures/lib/chemical-recipes.js +275 -0
- package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
- package/dist/features/textures/lib/definitions.d.ts +3 -18
- package/dist/features/textures/lib/definitions.js +15 -20
- package/dist/features/textures/lib/definitions.js.map +2 -2
- package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
- package/dist/features/textures/lib/geometric-patterns.js +305 -0
- package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
- package/dist/features/textures/lib/gray-scott.d.ts +55 -0
- package/dist/features/textures/lib/gray-scott.js +39 -0
- package/dist/features/textures/lib/gray-scott.js.map +7 -0
- package/dist/features/textures/lib/patterns.d.ts +123 -0
- package/dist/features/textures/lib/patterns.js +344 -0
- package/dist/features/textures/lib/patterns.js.map +7 -0
- package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
- package/dist/features/textures/lib/reaction-diffusion.js +9 -20
- package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
- package/dist/features/textures/lib/simulation.d.ts +10 -4
- package/dist/features/textures/lib/simulation.js +23 -13
- package/dist/features/textures/lib/simulation.js.map +2 -2
- package/dist/features/viz/index.d.ts +55 -6
- package/dist/features/viz/index.js +107 -2
- package/dist/features/viz/index.js.map +2 -2
- package/dist/features/viz/inspection/bar.d.ts +79 -0
- package/dist/features/viz/inspection/bar.js +49 -0
- package/dist/features/viz/inspection/bar.js.map +7 -0
- package/dist/features/viz/inspection/candle.d.ts +156 -0
- package/dist/features/viz/inspection/candle.js +120 -0
- package/dist/features/viz/inspection/candle.js.map +7 -0
- package/dist/features/viz/inspection/capture-types.d.ts +65 -0
- package/dist/features/viz/inspection/capture.d.ts +16 -0
- package/dist/features/viz/inspection/capture.js +49 -0
- package/dist/features/viz/inspection/capture.js.map +7 -0
- package/dist/features/viz/inspection/handler.d.ts +36 -0
- package/dist/features/viz/inspection/handler.js +91 -0
- package/dist/features/viz/inspection/handler.js.map +7 -0
- package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
- package/dist/features/viz/inspection/ohlc-bar.js +118 -0
- package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
- package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
- package/dist/features/viz/inspection/owned-ref.js +99 -0
- package/dist/features/viz/inspection/owned-ref.js.map +7 -0
- package/dist/features/viz/inspection/painted-point.d.ts +22 -0
- package/dist/features/viz/inspection/painted-point.js +29 -0
- package/dist/features/viz/inspection/painted-point.js.map +7 -0
- package/dist/features/viz/inspection/queries.d.ts +100 -0
- package/dist/features/viz/inspection/queries.js +192 -0
- package/dist/features/viz/inspection/queries.js.map +7 -0
- package/dist/features/viz/inspection/query-types.d.ts +177 -0
- package/dist/features/viz/inspection/volume.d.ts +104 -0
- package/dist/features/viz/inspection/volume.js +95 -0
- package/dist/features/viz/inspection/volume.js.map +7 -0
- package/dist/features/viz/inspection.d.ts +19 -0
- package/dist/features/viz/inspection.js +54 -0
- package/dist/features/viz/inspection.js.map +7 -0
- package/dist/features/viz/inspection.mjs +1 -0
- package/dist/features/viz/lib/area-series.d.ts +62 -0
- package/dist/features/viz/lib/area-series.js +120 -0
- package/dist/features/viz/lib/area-series.js.map +7 -0
- package/dist/features/viz/lib/axis.js +1 -1
- package/dist/features/viz/lib/axis.js.map +2 -2
- package/dist/features/viz/lib/bar-series.d.ts +3 -1
- package/dist/features/viz/lib/bar-series.js +16 -1
- package/dist/features/viz/lib/bar-series.js.map +2 -2
- package/dist/features/viz/lib/baseline-series.d.ts +55 -0
- package/dist/features/viz/lib/baseline-series.js +136 -0
- package/dist/features/viz/lib/baseline-series.js.map +7 -0
- package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
- package/dist/features/viz/lib/candlestick-series.js +150 -0
- package/dist/features/viz/lib/candlestick-series.js.map +7 -0
- package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
- package/dist/features/viz/lib/censored-point-series.js +129 -0
- package/dist/features/viz/lib/censored-point-series.js.map +7 -0
- package/dist/features/viz/lib/color-context.d.ts +4 -0
- package/dist/features/viz/lib/color-context.js +41 -0
- package/dist/features/viz/lib/color-context.js.map +7 -0
- package/dist/features/viz/lib/color-math.d.ts +4 -0
- package/dist/features/viz/lib/color-math.js +31 -0
- package/dist/features/viz/lib/color-math.js.map +7 -0
- package/dist/features/viz/lib/color-types.d.ts +53 -0
- package/dist/features/viz/lib/curve-definition.d.ts +49 -0
- package/dist/features/viz/lib/curve-definition.js +148 -0
- package/dist/features/viz/lib/curve-definition.js.map +7 -0
- package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
- package/dist/features/viz/lib/diverging-color-scale.js +51 -0
- package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
- package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
- package/dist/features/viz/lib/domain-navigation.js +77 -0
- package/dist/features/viz/lib/domain-navigation.js.map +7 -0
- package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
- package/dist/features/viz/lib/editable-chart-elements.js +733 -0
- package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
- package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
- package/dist/features/viz/lib/financial-aggregation.js +116 -0
- package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
- package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
- package/dist/features/viz/lib/financial-autoscale.js +61 -0
- package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
- package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
- package/dist/features/viz/lib/financial-comparison.js +98 -0
- package/dist/features/viz/lib/financial-comparison.js.map +7 -0
- package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
- package/dist/features/viz/lib/financial-geometry.js +67 -0
- package/dist/features/viz/lib/financial-geometry.js.map +7 -0
- package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
- package/dist/features/viz/lib/financial-indicators.js +135 -0
- package/dist/features/viz/lib/financial-indicators.js.map +7 -0
- package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
- package/dist/features/viz/lib/financial-oscillators.js +265 -0
- package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
- package/dist/features/viz/lib/hover-data.d.ts +1 -1
- package/dist/features/viz/lib/hover-data.js +5 -2
- package/dist/features/viz/lib/hover-data.js.map +2 -2
- package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
- package/dist/features/viz/lib/interval-band-series.js +136 -0
- package/dist/features/viz/lib/interval-band-series.js.map +7 -0
- package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
- package/dist/features/viz/lib/interval-diamond-series.js +124 -0
- package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
- package/dist/features/viz/lib/interval-series.d.ts +79 -0
- package/dist/features/viz/lib/interval-series.js +158 -0
- package/dist/features/viz/lib/interval-series.js.map +7 -0
- package/dist/features/viz/lib/line-series.d.ts +1 -1
- package/dist/features/viz/lib/line-series.js +47 -28
- package/dist/features/viz/lib/line-series.js.map +2 -2
- package/dist/features/viz/lib/linear-scale.js +1 -1
- package/dist/features/viz/lib/linear-scale.js.map +2 -2
- package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
- package/dist/features/viz/lib/monotone-curve.js +63 -0
- package/dist/features/viz/lib/monotone-curve.js.map +7 -0
- package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
- package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
- package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
- package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
- package/dist/features/viz/lib/paired-series.d.ts +44 -0
- package/dist/features/viz/lib/paired-series.js +93 -0
- package/dist/features/viz/lib/paired-series.js.map +7 -0
- package/dist/features/viz/lib/plot-series.js +11 -6
- package/dist/features/viz/lib/plot-series.js.map +2 -2
- package/dist/features/viz/lib/plot-types.d.ts +4 -3
- package/dist/features/viz/lib/point-series.d.ts +1 -1
- package/dist/features/viz/lib/point-series.js +36 -9
- package/dist/features/viz/lib/point-series.js.map +2 -2
- package/dist/features/viz/lib/point-types.d.ts +5 -2
- package/dist/features/viz/lib/scale-context.d.ts +1 -1
- package/dist/features/viz/lib/scale-ticks.js +21 -6
- package/dist/features/viz/lib/scale-ticks.js.map +2 -2
- package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
- package/dist/features/viz/lib/sequential-color-scale.js +49 -0
- package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
- package/dist/features/viz/lib/series-position.d.ts +12 -0
- package/dist/features/viz/lib/series-position.js +44 -0
- package/dist/features/viz/lib/series-position.js.map +7 -0
- package/dist/features/viz/lib/step-curves.d.ts +19 -0
- package/dist/features/viz/lib/step-curves.js +53 -0
- package/dist/features/viz/lib/step-curves.js.map +7 -0
- package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
- package/dist/features/viz/lib/threshold-color-scale.js +59 -0
- package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
- package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
- package/dist/features/viz/lib/trading-time-mapping.js +89 -0
- package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
- package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
- package/dist/features/viz/lib/trading-time-scale.js +96 -0
- package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
- package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
- package/dist/features/viz/lib/trajectory-series.js +111 -0
- package/dist/features/viz/lib/trajectory-series.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +20 -4
- package/dist/features/viz/lib/use-continuous-scale.js +6 -1
- package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
- package/dist/features/viz/lib/volume-series.d.ts +59 -0
- package/dist/features/viz/lib/volume-series.js +117 -0
- package/dist/features/viz/lib/volume-series.js.map +7 -0
- package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
- package/dist/features/viz/lib/weighted-point-series.js +169 -0
- package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
- package/dist/filters/emboss-gpu.d.ts +4 -0
- package/dist/filters/emboss-gpu.js +39 -0
- package/dist/filters/emboss-gpu.js.map +7 -0
- package/dist/filters/emboss.d.ts +32 -0
- package/dist/filters/emboss.js +106 -0
- package/dist/filters/emboss.js.map +7 -0
- package/dist/filters/reflection-gpu.d.ts +3 -1
- package/dist/filters/reflection-gpu.js +5 -2
- package/dist/filters/reflection-gpu.js.map +2 -2
- package/dist/filters/render-emboss-boundary.d.ts +13 -0
- package/dist/filters/render-emboss-boundary.js +131 -0
- package/dist/filters/render-emboss-boundary.js.map +7 -0
- package/dist/filters.d.ts +2 -0
- package/dist/filters.js +2 -0
- package/dist/filters.js.map +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +4 -0
- package/dist/internal.js.map +2 -2
- package/dist/lib/events/event-facade.d.ts +13 -0
- package/dist/lib/events/event-facade.js +23 -0
- package/dist/lib/events/event-facade.js.map +2 -2
- package/dist/lib/events/propagation.js +19 -14
- package/dist/lib/events/propagation.js.map +2 -2
- package/dist/lib/execute-render.js +13 -0
- package/dist/lib/execute-render.js.map +2 -2
- package/dist/lib/recording/recording.d.ts +43 -0
- package/dist/lib/recording/recording.js +555 -0
- package/dist/lib/recording/recording.js.map +7 -0
- package/dist/lib/recording/types.d.ts +118 -0
- package/dist/lib/recording/wasm-bytes.d.ts +1 -0
- package/dist/lib/recording/wasm-bytes.js +5 -0
- package/dist/lib/recording/wasm-bytes.js.map +7 -0
- package/dist/lib/recording/worker-source.d.ts +1 -0
- package/dist/lib/recording/worker-source.js +5 -0
- package/dist/lib/recording/worker-source.js.map +7 -0
- package/dist/lib/render-transaction.d.ts +5 -2
- package/dist/lib/render-transaction.js +23 -1
- package/dist/lib/render-transaction.js.map +2 -2
- package/dist/lib/series-inspection-frame.d.ts +18 -0
- package/dist/lib/series-inspection-frame.js +70 -0
- package/dist/lib/series-inspection-frame.js.map +7 -0
- package/dist/lib/types.d.ts +6 -0
- package/package.json +10 -2
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
borrowTextureRaster
|
|
3
|
+
} from "../lib/textures/texture-protocol.js";
|
|
4
|
+
import { GLOBAL_STATE, getPibblInstance } from "../lib/global-state.js";
|
|
5
|
+
import { getOptionalService } from "../lib/optional-services.js";
|
|
6
|
+
import { update } from "../lib/update.js";
|
|
7
|
+
import { EmbossGpu } from "./emboss-gpu.js";
|
|
8
|
+
const GPU_BORROWER = /* @__PURE__ */ Symbol("pibbl.emboss-borrower");
|
|
9
|
+
const rootServices = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
class RootGpuService {
|
|
11
|
+
constructor(root) {
|
|
12
|
+
this.root = root;
|
|
13
|
+
this.gpu = new EmbossGpu({
|
|
14
|
+
onContextRestored: () => {
|
|
15
|
+
if (this.disposed || this.recoveryRequested || this.root.mainTeardowns.closed)
|
|
16
|
+
return;
|
|
17
|
+
this.recoveryRequested = true;
|
|
18
|
+
for (const borrower of this.borrowers)
|
|
19
|
+
update(borrower.instance.canvas, void 0, true);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
root;
|
|
24
|
+
gpu;
|
|
25
|
+
borrowers = /* @__PURE__ */ new Set();
|
|
26
|
+
disposed = false;
|
|
27
|
+
recoveryRequested = false;
|
|
28
|
+
beginRender() {
|
|
29
|
+
this.recoveryRequested = false;
|
|
30
|
+
}
|
|
31
|
+
pruneMaps() {
|
|
32
|
+
const resources = /* @__PURE__ */ new Set();
|
|
33
|
+
for (const borrower of this.borrowers)
|
|
34
|
+
for (const resource of borrower.resources) resources.add(resource);
|
|
35
|
+
this.gpu.retainMaps(resources);
|
|
36
|
+
}
|
|
37
|
+
dispose() {
|
|
38
|
+
this.disposed = true;
|
|
39
|
+
this.gpu.dispose();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
class GpuBorrower {
|
|
43
|
+
constructor(instance) {
|
|
44
|
+
this.instance = instance;
|
|
45
|
+
let root = instance;
|
|
46
|
+
while (root.parent) root = getPibblInstance(root.parent);
|
|
47
|
+
this.root = root;
|
|
48
|
+
let shared = rootServices.get(root);
|
|
49
|
+
if (!shared) {
|
|
50
|
+
shared = new RootGpuService(root);
|
|
51
|
+
rootServices.set(root, shared);
|
|
52
|
+
}
|
|
53
|
+
this.shared = shared;
|
|
54
|
+
shared.borrowers.add(this);
|
|
55
|
+
}
|
|
56
|
+
instance;
|
|
57
|
+
used = false;
|
|
58
|
+
resources = /* @__PURE__ */ new Set();
|
|
59
|
+
candidates = /* @__PURE__ */ new Set();
|
|
60
|
+
committed = false;
|
|
61
|
+
disposed = false;
|
|
62
|
+
shared;
|
|
63
|
+
root;
|
|
64
|
+
beginRender() {
|
|
65
|
+
this.shared.beginRender();
|
|
66
|
+
this.used = false;
|
|
67
|
+
this.candidates.clear();
|
|
68
|
+
}
|
|
69
|
+
useMap(resource) {
|
|
70
|
+
this.candidates.add(resource);
|
|
71
|
+
}
|
|
72
|
+
endRender(success) {
|
|
73
|
+
if (success && this.used) {
|
|
74
|
+
this.committed = true;
|
|
75
|
+
this.resources = new Set(this.candidates);
|
|
76
|
+
this.shared.pruneMaps();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (success || !this.committed) {
|
|
80
|
+
this.dispose();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!this.shared.gpu.isContextLost) this.shared.pruneMaps();
|
|
84
|
+
}
|
|
85
|
+
dispose() {
|
|
86
|
+
if (this.disposed) return;
|
|
87
|
+
this.disposed = true;
|
|
88
|
+
this.instance.optionalServices.delete(GPU_BORROWER);
|
|
89
|
+
this.shared.borrowers.delete(this);
|
|
90
|
+
if (this.shared.borrowers.size === 0) {
|
|
91
|
+
rootServices.delete(this.root);
|
|
92
|
+
this.shared.dispose();
|
|
93
|
+
} else this.shared.pruneMaps();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function peekEmbossGpu(instance) {
|
|
97
|
+
let root = instance;
|
|
98
|
+
while (root.parent) root = getPibblInstance(root.parent);
|
|
99
|
+
return rootServices.get(root)?.gpu;
|
|
100
|
+
}
|
|
101
|
+
function processEmboss(source, windows, paint, settings, region) {
|
|
102
|
+
const instance = GLOBAL_STATE.currentPibblInstance;
|
|
103
|
+
if (!instance) throw new Error("Emboss requires an active Pibbl instance.");
|
|
104
|
+
const borrower = getOptionalService(
|
|
105
|
+
instance,
|
|
106
|
+
GPU_BORROWER,
|
|
107
|
+
() => new GpuBorrower(instance)
|
|
108
|
+
);
|
|
109
|
+
borrower.used = true;
|
|
110
|
+
return borrowTextureRaster(paint, (map) => {
|
|
111
|
+
borrower.useMap(map.resource);
|
|
112
|
+
const coordinates = {
|
|
113
|
+
originX: windows.source.backingX / windows.density,
|
|
114
|
+
originY: windows.source.backingY / windows.density,
|
|
115
|
+
density: windows.density,
|
|
116
|
+
region
|
|
117
|
+
};
|
|
118
|
+
return borrower.shared.gpu.apply(
|
|
119
|
+
source,
|
|
120
|
+
map,
|
|
121
|
+
{ color: "#ffffff" },
|
|
122
|
+
settings,
|
|
123
|
+
coordinates
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
peekEmbossGpu,
|
|
129
|
+
processEmboss
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=render-emboss-boundary.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/filters/render-emboss-boundary.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n borrowTextureRaster,\n type TexturePaint,\n} from \"../lib/textures/texture-protocol.js\";\nimport { GLOBAL_STATE, getPibblInstance } from \"../lib/global-state.js\";\nimport { getOptionalService } from \"../lib/optional-services.js\";\nimport { update } from \"../lib/update.js\";\nimport type { PibblInstance } from \"../lib/types.js\";\nimport type { FilterWindows } from \"../lib/filter/filter-region.js\";\nimport { EmbossGpu } from \"./emboss-gpu.js\";\nimport type { ReflectionSettings } from \"./reflection-gpu.js\";\n\nconst GPU_BORROWER = Symbol(\"pibbl.emboss-borrower\");\nconst rootServices = new WeakMap<PibblInstance, RootGpuService>();\n\nclass RootGpuService {\n readonly gpu: EmbossGpu;\n readonly borrowers = new Set<GpuBorrower>();\n private disposed = false;\n private recoveryRequested = false;\n constructor(private readonly root: PibblInstance) {\n this.gpu = new EmbossGpu({\n onContextRestored: () => {\n if (\n this.disposed ||\n this.recoveryRequested ||\n this.root.mainTeardowns.closed\n )\n return;\n this.recoveryRequested = true;\n for (const borrower of this.borrowers)\n update(borrower.instance.canvas, undefined, true);\n },\n });\n }\n beginRender(): void {\n this.recoveryRequested = false;\n }\n pruneMaps(): void {\n const resources = new Set<object>();\n for (const borrower of this.borrowers)\n for (const resource of borrower.resources) resources.add(resource);\n this.gpu.retainMaps(resources);\n }\n dispose(): void {\n this.disposed = true;\n this.gpu.dispose();\n }\n}\n\nclass GpuBorrower {\n used = false;\n resources = new Set<object>();\n private candidates = new Set<object>();\n private committed = false;\n private disposed = false;\n readonly shared: RootGpuService;\n private readonly root: PibblInstance;\n constructor(readonly instance: PibblInstance) {\n let root = instance;\n while (root.parent) root = getPibblInstance(root.parent);\n this.root = root;\n let shared = rootServices.get(root);\n if (!shared) {\n shared = new RootGpuService(root);\n rootServices.set(root, shared);\n }\n this.shared = shared;\n shared.borrowers.add(this);\n }\n beginRender(): void {\n this.shared.beginRender();\n this.used = false;\n this.candidates.clear();\n }\n useMap(resource: object): void {\n this.candidates.add(resource);\n }\n endRender(success: boolean): void {\n if (success && this.used) {\n this.committed = true;\n this.resources = new Set(this.candidates);\n this.shared.pruneMaps();\n return;\n }\n if (success || !this.committed) {\n this.dispose();\n return;\n }\n if (!this.shared.gpu.isContextLost) this.shared.pruneMaps();\n }\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n this.instance.optionalServices.delete(GPU_BORROWER);\n this.shared.borrowers.delete(this);\n if (this.shared.borrowers.size === 0) {\n rootServices.delete(this.root);\n this.shared.dispose();\n } else this.shared.pruneMaps();\n }\n}\n\n/** @internal Test-only read-only access; it never creates a GPU service. */\nexport function peekEmbossGpu(instance: PibblInstance): EmbossGpu | undefined {\n let root = instance;\n while (root.parent) root = getPibblInstance(root.parent);\n return rootServices.get(root)?.gpu;\n}\n\nexport function processEmboss(\n source: OffscreenCanvas,\n windows: FilterWindows,\n paint: TexturePaint,\n settings: ReflectionSettings,\n region: Readonly<{ x: number; y: number; width: number; height: number }>,\n): ImageBitmap {\n const instance = GLOBAL_STATE.currentPibblInstance;\n if (!instance) throw new Error(\"Emboss requires an active Pibbl instance.\");\n const borrower = getOptionalService(\n instance,\n GPU_BORROWER,\n () => new GpuBorrower(instance),\n );\n borrower.used = true;\n return borrowTextureRaster(paint, (map) => {\n borrower.useMap(map.resource);\n const coordinates = {\n originX: windows.source.backingX / windows.density,\n originY: windows.source.backingY / windows.density,\n density: windows.density,\n region,\n };\n return borrower.shared.gpu.apply(\n source,\n map,\n { color: \"#ffffff\" },\n settings,\n coordinates,\n );\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,cAAc,wBAAwB;AAC/C,SAAS,0BAA0B;AACnC,SAAS,cAAc;AAGvB,SAAS,i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MAClB,SAAS,QAAQ,OAAO,WAAW,QAAQ;AAAA,MAC3C,SAAS,QAAQ,OAAO,WAAW,QAAQ;AAAA,MAC3C,SAAS,QAAQ;AAAA,MACjB;AAAA,IACF;AACA,WAAO,SAAS,OAAO,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA,EAAE,OAAO,UAAU;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/filters.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ export { displacement } from './filters/displacement.js';
|
|
|
3
3
|
export type { PibblFilter, PibblBlurFilterOptions, PibblBrightnessFilterOptions, PibblContrastFilterOptions, PibblDropShadowFilterOptions, PibblGrayscaleFilterOptions, PibblHueRotateFilterOptions, PibblInvertFilterOptions, PibblOpacityFilterOptions, PibblSaturateFilterOptions, PibblSepiaFilterOptions, PibblDisplacementFilterOptions, } from './lib/style/filter-types.js';
|
|
4
4
|
export { reflectedLight } from './filters/reflected-light.js';
|
|
5
5
|
export type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';
|
|
6
|
+
export { emboss } from './filters/emboss.js';
|
|
7
|
+
export type { PibblEmbossFilterOptions } from './filters/emboss.js';
|
package/dist/filters.js
CHANGED
|
@@ -12,12 +12,14 @@ import {
|
|
|
12
12
|
} from "./filters/native.js";
|
|
13
13
|
import { displacement } from "./filters/displacement.js";
|
|
14
14
|
import { reflectedLight } from "./filters/reflected-light.js";
|
|
15
|
+
import { emboss } from "./filters/emboss.js";
|
|
15
16
|
export {
|
|
16
17
|
blur,
|
|
17
18
|
brightness,
|
|
18
19
|
contrast,
|
|
19
20
|
displacement,
|
|
20
21
|
dropShadow,
|
|
22
|
+
emboss,
|
|
21
23
|
grayscale,
|
|
22
24
|
hueRotate,
|
|
23
25
|
invert,
|
package/dist/filters.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/filters.ts"],
|
|
4
|
-
"sourcesContent": ["export {\n blur,\n brightness,\n contrast,\n dropShadow,\n grayscale,\n hueRotate,\n invert,\n opacity,\n saturate,\n sepia,\n} from './filters/native.js';\nexport { displacement } from './filters/displacement.js';\nexport type {\n PibblFilter,\n PibblBlurFilterOptions,\n PibblBrightnessFilterOptions,\n PibblContrastFilterOptions,\n PibblDropShadowFilterOptions,\n PibblGrayscaleFilterOptions,\n PibblHueRotateFilterOptions,\n PibblInvertFilterOptions,\n PibblOpacityFilterOptions,\n PibblSaturateFilterOptions,\n PibblSepiaFilterOptions,\n PibblDisplacementFilterOptions,\n} from './lib/style/filter-types.js';\n\nexport { reflectedLight } from './filters/reflected-light.js';\nexport type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAgB7B,SAAS,sBAAsB;",
|
|
4
|
+
"sourcesContent": ["export {\n blur,\n brightness,\n contrast,\n dropShadow,\n grayscale,\n hueRotate,\n invert,\n opacity,\n saturate,\n sepia,\n} from './filters/native.js';\nexport { displacement } from './filters/displacement.js';\nexport type {\n PibblFilter,\n PibblBlurFilterOptions,\n PibblBrightnessFilterOptions,\n PibblContrastFilterOptions,\n PibblDropShadowFilterOptions,\n PibblGrayscaleFilterOptions,\n PibblHueRotateFilterOptions,\n PibblInvertFilterOptions,\n PibblOpacityFilterOptions,\n PibblSaturateFilterOptions,\n PibblSepiaFilterOptions,\n PibblDisplacementFilterOptions,\n} from './lib/style/filter-types.js';\n\nexport { reflectedLight } from './filters/reflected-light.js';\nexport type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';\n\nexport { emboss } from './filters/emboss.js';\nexport type { PibblEmbossFilterOptions } from './filters/emboss.js';\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAgB7B,SAAS,sBAAsB;AAG/B,SAAS,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -109,3 +109,5 @@ export type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRe
|
|
|
109
109
|
export { defineTransition } from './lib/transitions/define-transition.js';
|
|
110
110
|
export type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';
|
|
111
111
|
export type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';
|
|
112
|
+
export { recordFrames, exportGif } from './lib/recording/recording.js';
|
|
113
|
+
export type { PibblFrameRecordingOptions, PibblFrameRecordingSession, PibblRecordedFrameInfo, PibblRecordedFrame, PibblFrameRecording, PibblGifExportOptions, PibblRenderCompletion, } from './lib/recording/types.js';
|
package/dist/index.js
CHANGED
|
@@ -178,6 +178,7 @@ import { hologram } from "./lib/transitions/hologram.js";
|
|
|
178
178
|
import { bifrost } from "./lib/transitions/bifrost.js";
|
|
179
179
|
import { slide, zoom, wipe, blurReveal, dissolve } from "./lib/transitions/common.js";
|
|
180
180
|
import { defineTransition } from "./lib/transitions/define-transition.js";
|
|
181
|
+
import { recordFrames, exportGif } from "./lib/recording/recording.js";
|
|
181
182
|
export {
|
|
182
183
|
Absolute,
|
|
183
184
|
Arc,
|
|
@@ -243,6 +244,7 @@ export {
|
|
|
243
244
|
easing,
|
|
244
245
|
embers,
|
|
245
246
|
envelopeTransform,
|
|
247
|
+
exportGif,
|
|
246
248
|
fade,
|
|
247
249
|
flattenPath,
|
|
248
250
|
flattenPathWang,
|
|
@@ -258,6 +260,7 @@ export {
|
|
|
258
260
|
pathBendTransform,
|
|
259
261
|
pibbl,
|
|
260
262
|
quadTransform,
|
|
263
|
+
recordFrames,
|
|
261
264
|
repeat,
|
|
262
265
|
resolveBox,
|
|
263
266
|
resolveLength,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblAnimatedValueOptions,\n PibblAnimationTarget,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAsC;AAC/C,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAyC;AAClD;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4C;AACrD;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK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AACxB,SAAS,mBAAmB;AAG5B,SAAS,eAAe,kBAAkB;AAG1C,SAAS,eAAe;AAGxB,SAAS,YAAY;AAGrB,SAAS,+BAA+B;AAGxC,SAAS,cAAc;AAGvB,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAGxB,SAAS,OAAO,MAAM,MAAM,YAAY,gBAAgB;AAGxD,SAAS,wBAAwB;",
|
|
4
|
+
"sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblAnimatedValueOptions,\n PibblAnimationTarget,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n\nexport { recordFrames, exportGif } from './lib/recording/recording.js';\nexport type {\n PibblFrameRecordingOptions,\n PibblFrameRecordingSession,\n PibblRecordedFrameInfo,\n PibblRecordedFrame,\n PibblFrameRecording,\n PibblGifExportOptions,\n PibblRenderCompletion,\n} from './lib/recording/types.js';\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAsC;AAC/C,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAyC;AAClD;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4C;AACrD;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,YAA4B;AACrC;AAAA,EACE;AAAA,OAGK;AACP;AAA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C,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAgE3B,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,YAAY,cAAc,eAAe,sBAAsB;AAOxE,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAG5B,SAAS,eAAe,kBAAkB;AAG1C,SAAS,eAAe;AAGxB,SAAS,YAAY;AAGrB,SAAS,+BAA+B;AAGxC,SAAS,cAAc;AAGvB,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAGxB,SAAS,OAAO,MAAM,MAAM,YAAY,gBAAgB;AAGxD,SAAS,wBAAwB;AAKjC,SAAS,cAAc,iBAAiB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/internal.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type { PibblInternalAdvanceLane, PibblInternalSimulationOwner, } from "./
|
|
|
26
26
|
import type { PibblBackendEventTargetOptions, PibblBackendToken, PibblNestedResolverInput } from "./lib/backend/types.js";
|
|
27
27
|
import { type PibblEventTargetRegistration } from "./lib/events/registrations.js";
|
|
28
28
|
import type { PibblEventHandlers, PibblPointerEvents } from "./lib/events/types.js";
|
|
29
|
+
export { captureSeriesInspectionFrame } from "./lib/series-inspection-frame.js";
|
|
30
|
+
export { borrowDispatchResource } from "./lib/events/event-facade.js";
|
|
29
31
|
import { type PibblElementSource } from "./lib/element/metadata.js";
|
|
30
32
|
import type { Canvas } from "./lib/types.js";
|
|
31
33
|
/**
|
package/dist/internal.js
CHANGED
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
} from "./lib/events/registrations.js";
|
|
34
34
|
import { PibblPaintEntryKind } from "./lib/events/paint-entry.js";
|
|
35
35
|
import { getCurrentPibblInstance, GLOBAL_STATE } from "./lib/global-state.js";
|
|
36
|
+
import { captureSeriesInspectionFrame } from "./lib/series-inspection-frame.js";
|
|
37
|
+
import { borrowDispatchResource } from "./lib/events/event-facade.js";
|
|
36
38
|
import {
|
|
37
39
|
requireHookContext,
|
|
38
40
|
useInternalHookSlot as useInternalHookSlot2
|
|
@@ -263,7 +265,9 @@ import { getCurrentWorldTransform as getCurrentWorldTransform2 } from "./lib/ren
|
|
|
263
265
|
import { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from "./lib/textures/texture-protocol.js";
|
|
264
266
|
export {
|
|
265
267
|
ManualSchedulerDriver as PibblInternalManualSchedulerDriver,
|
|
268
|
+
borrowDispatchResource,
|
|
266
269
|
borrowTextureRaster,
|
|
270
|
+
captureSeriesInspectionFrame,
|
|
267
271
|
createBackendToken,
|
|
268
272
|
defineBackendPrimitive,
|
|
269
273
|
derivePrimitive,
|
package/dist/internal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/internal.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PibblInternalFrame, pibblInternalOnRenderFinish, pibblInternalRequestRender } from './lib/scheduler/renderer-participant.js';\nimport type { PibblConfig, PibblPixelRatio } from './lib/surface/types.js';\n/**\n * @packageDocumentation\n * Reserved for official Pibbl packages that are released in lockstep with\n * `@pibbl/core`. This version-coupled module is not a stable third-party plugin\n * API and intentionally does not re-export the public root module.\n */\n\nexport { createBackendToken } from \"./lib/backend/types.js\";\nexport type {\n PibblBackendDriver,\n PibblBackendEventTargetOptions,\n PibblBackendFrame,\n PibblBackendFrameInput,\n PibblBackendMount,\n PibblBackendMountOptions,\n PibblBackendPrimitiveDefinition,\n PibblBackendPrimitiveInput,\n PibblBackendPrimitiveProgram,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nexport type { SignalProgramProps, SignalStyle } from \"./lib/types.js\";\nexport {\n pibblInternalRunPurePrimitiveResolver,\n defineBackendPrimitive,\n derivePrimitive,\n} from \"./lib/define-primitive.js\";\nexport { mountBackendPibbl } from \"./lib/mount-pibbl.js\";\nexport {\n useInternalHookSlot,\n withHooksForbidden,\n} from \"./lib/hooks/hook-slot.js\";\nexport { useValueMemoSlot as useInternalValueMemoSlot } from \"./lib/hooks/use-value-memo-slot.js\";\nexport {\n haveSameLayerNodeTree,\n materializeRetainedLayerChildren,\n snapshotLayerNodeTree,\n} from \"./lib/components/layer-node-equality.js\";\nexport type { LayerNodeSnapshot } from \"./lib/components/layer-node-equality.js\";\nexport type { PibblEventTargetRegistration } from \"./lib/events/registrations.js\";\nexport type { PibblElementSource } from \"./lib/element/metadata.js\";\nexport { pibblInternalCreatePropAttachment } from \"./lib/element-enhancers.js\";\nexport type {\n PibblInternalMountedPropAttachment,\n PibblInternalPrimitiveAttachmentInput,\n} from \"./lib/element-enhancers.js\";\nexport type { PibblHitTestOutput } from \"./lib/events/paint-entry.js\";\nexport { hasPibblEventHandler } from \"./lib/events/event-definitions.js\";\nexport {\n pibblInternalCurrentSimulationOwner,\n pibblInternalOnSimulationRenderTransactionFinish,\n pibblInternalQueueSimulationBegin,\n pibblInternalQueueSimulationCommitAcknowledgement,\n pibblInternalQueueSimulationComplete,\n pibblInternalRegisterSimulationAdvance,\n pibblInternalRequestSimulationRender,\n} from \"./lib/scheduler/simulation-participant.js\";\nexport type {\n PibblInternalAdvanceLane,\n PibblInternalSimulationOwner,\n} from \"./lib/scheduler/simulation-participant.js\";\n\nimport type {\n PibblBackendEventTargetOptions,\n PibblBackendMount,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nimport {\n createTarget,\n releaseTarget,\n updateTarget,\n type PibblEventTargetRegistration,\n} from \"./lib/events/registrations.js\";\nimport { PibblPaintEntryKind } from \"./lib/events/paint-entry.js\";\nimport type { PibblEventHandlers, PibblPointerEvents } from \"./lib/events/types.js\";\nimport { getCurrentPibblInstance, GLOBAL_STATE } from \"./lib/global-state.js\";\nimport {\n requireHookContext,\n useInternalHookSlot,\n} from \"./lib/hooks/hook-slot.js\";\nimport { getCurrentWorldTransform } from \"./lib/render-target.js\";\nimport {\n getElementSource,\n type PibblElementSource,\n} from \"./lib/element/metadata.js\";\nimport { getSurfaceSnapshot } from \"./lib/surface/transform.js\";\nimport type {\n Canvas,\n PibblComponentRefs,\n PibblInstance,\n} from \"./lib/types.js\";\nimport type { PibblInteractionLayer } from \"./lib/types.js\";\nimport { update } from \"./lib/update.js\";\nimport { queueBeginCommand } from \"./lib/scheduler/realm-scheduler.js\";\nimport type { PibblBeginCommandHandle } from \"./lib/scheduler/types.js\";\n\ninterface CurrentInstanceFrameRequestState {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly instance: PibblInstance;\n active: boolean;\n handle: PibblBeginCommandHandle | undefined;\n updateParents: boolean;\n}\n\nconst frameRequestsByComponent = new WeakMap<\n PibblComponentRefs<any>,\n CurrentInstanceFrameRequestState\n>();\n/**\n * Reads the selected official backend's current frame environment.\n *\n * @param token - Backend identity required by the caller. See {@link PibblBackendToken}.\n * @returns The active environment for that backend.\n *\n * @see {@link PibblBackendToken}\n */\nexport function getBackendEnvironment<E>(token: PibblBackendToken): E {\n const driver = GLOBAL_STATE.backendDriver;\n const frame = GLOBAL_STATE.backendFrame;\n if (!driver || !frame || driver.token !== token) {\n throw new Error(\"The requested Pibbl backend environment is not active.\");\n }\n return frame.environment as E;\n}\n\n/**\n * Returns the timestamp shared by the current Pibbl render transaction.\n *\n * @returns The active frame timestamp in milliseconds.\n *\n * @see {@link PibblInternalFrame}\n */\nexport function getCurrentFrameTimestamp(): number {\n return getCurrentPibblInstance().renderTimestamp;\n}\n\n/**\n * Returns the active instance's owning Canvas, never a transient filter target.\n *\n * @returns The host canvas of the active backend mount. See {@link Canvas}.\n *\n * @see {@link Canvas}\n */\nexport function getCurrentBackendHostCanvas(): Canvas {\n return getCurrentPibblInstance().canvas;\n}\n\n/**\n * Returns development JSX source metadata for the current component.\n *\n * @returns Source metadata for the current element, or undefined when unavailable. See\n * {@link PibblElementSource} .\n *\n * @see {@link PibblElementSource}\n */\nexport function getCurrentElementSource(): PibblElementSource | undefined {\n const { componentRefs } = requireHookContext();\n return getElementSource(componentRefs.element);\n}\n\n/**\n * Returns the active surface's independent effective backing densities.\n *\n * @returns Backing pixels per logical unit on each axis.\n *\n * @see {@link PibblPixelRatio}\n */\nexport function getCurrentSurfaceDensity(): Readonly<{ x: number; y: number }> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n x: surface.backingPixelsPerLogicalUnitX,\n y: surface.backingPixelsPerLogicalUnitY,\n });\n}\n\n/**\n * Returns the active root-logical viewport for an official renderer hook.\n *\n * @returns The current logical viewport width and height.\n *\n * @see {@link PibblConfig}\n */\nexport function getCurrentLogicalViewport(): Readonly<{\n width: number;\n height: number;\n}> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n width: surface.logicalWidth,\n height: surface.logicalHeight,\n });\n}\n\n/**\n * Registers a callback on the root-wide transaction containing this render.\n *\n * @param callback - Callback receiving whether the current render transaction succeeded.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function onCurrentRenderFinish(\n callback: (success: boolean) => void,\n): void {\n requireHookContext();\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error(\"No Pibbl render transaction is active.\");\n }\n transaction.onFinish(callback);\n}\n\n/**\n * Requests a coalesced frame for the current private backend instance.\n *\n * @param updateParents - Whether ancestor compositions should also receive a frame request.\n *\n * @see {@link pibblInternalRequestRender}\n */\nexport function requestCurrentInstanceFrame(updateParents: boolean): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n let state = frameRequestsByComponent.get(componentRefs);\n if (!state) {\n state = {\n componentRefs,\n instance: pibblInstance,\n active: true,\n handle: undefined,\n updateParents: false,\n };\n frameRequestsByComponent.set(componentRefs, state);\n componentRefs.teardowns.add(() =>\n releaseCurrentInstanceFrameRequest(state!),\n );\n }\n state.updateParents ||= updateParents;\n if (state.handle) return;\n state.handle = queueBeginCommand(() => {\n state!.handle = undefined;\n const updateParentsForFrame = state!.updateParents;\n state!.updateParents = false;\n if (!isCurrentInstanceFrameRequestActive(state!)) return;\n if (updateParentsForFrame) {\n update(state!.instance.canvas, undefined, true);\n } else {\n update(state!.instance.canvas);\n }\n });\n}\n\n/**\n * Retains one geometry-independent target for an official backend picker.\n *\n * @param handlers - Handlers for the backend target. See {@link PibblEventHandlers}.\n * @param options - Backend geometry and focus metadata. See {@link PibblBackendEventTargetOptions}.\n * @param pointerEvents - Pointer participation policy; defaults to auto. See\n * {@link PibblPointerEvents} .\n * @returns The live registration, or undefined when registration is unnecessary. See\n * {@link PibblEventTargetRegistration} .\n *\n * @see {@link PibblEventHandlers}\n * @see {@link PibblBackendEventTargetOptions}\n * @see {@link PibblPointerEvents}\n * @see {@link PibblEventTargetRegistration}\n */\nexport function useBackendEventTarget(\n handlers: PibblEventHandlers,\n options: PibblBackendEventTargetOptions = {},\n pointerEvents: PibblPointerEvents = \"auto\",\n): PibblEventTargetRegistration | undefined {\n const { componentRefs, pibblInstance } = requireHookContext();\n const hookIndex = GLOBAL_STATE.componentHookIndex;\n const slot = useInternalHookSlot(\"backendEventTarget\", (teardowns) => {\n const target = createTarget(pibblInstance, componentRefs, hookIndex);\n teardowns.add(() => releaseTarget(target));\n return { target, emptyPath: new Path2D() };\n });\n const { target, emptyPath } = slot.value;\n if (pointerEvents === \"none\") {\n releaseTarget(target);\n return undefined;\n }\n updateTarget(\n target,\n handlers,\n { ...options, path: emptyPath },\n true,\n options.deferKeyboardNavigationGeometry ?? false,\n );\n if (target.paintEntry) {\n target.owner.paintEntries.delete(target.paintEntry);\n target.paintEntry = undefined;\n }\n return target;\n}\n\n/**\n * Tests whether an official backend target can still win coordinate picking.\n *\n * @param target - Registration whose ownership is being checked. See\n * {@link PibblEventTargetRegistration} .\n * @returns Whether the target registration is still live.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function isBackendEventTargetLive(\n target: PibblEventTargetRegistration,\n): boolean {\n const { owner } = target;\n return (\n target.live &&\n !owner.mainTeardowns.closed &&\n owner.eventRoot.targets.has(target)\n );\n}\n\n/**\n * Temporarily releases one backend target; its retained hook may enroll it again.\n *\n * @param target - Target registration to release. See {@link PibblEventTargetRegistration}.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function releaseBackendEventTarget(\n target: PibblEventTargetRegistration,\n): void {\n releaseTarget(target);\n target.keyboardNavigationBounds = undefined;\n target.keyboardNavigationPoints = undefined;\n}\n\n/**\n * Registers work that runs after this component's rendered descendants.\n *\n * @param callback - Callback to execute after the current component renders.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function setCurrentComponentAfterRender(callback: () => void): void {\n const { componentRefs } = requireHookContext();\n const previous = componentRefs.onAfterRender;\n componentRefs.onAfterRender = previous\n ? () => {\n try {\n previous();\n } finally {\n callback();\n }\n }\n : callback;\n}\n\n/**\n * Installs one stable nested backend resolver in the current Canvas paint order.\n *\n * @param input - Nested coordinate resolver and its target metadata. See\n * {@link PibblNestedResolverInput} .\n *\n * @see {@link PibblNestedResolverInput}\n */\nexport function registerNestedInteractionResolver(\n input: PibblNestedResolverInput,\n): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n const childInstance = backendMountInstance(input.child);\n if (\n childInstance.parent !== pibblInstance.canvas ||\n childInstance.eventRoot !== pibblInstance.eventRoot\n ) {\n throw new Error(\n \"A nested Pibbl backend mount must belong to the current instance and same event root.\",\n );\n }\n const slot = useInternalHookSlot<{\n entry: PibblInteractionLayer;\n child: PibblBackendMount;\n }>(\"nestedInteractionResolver\", (teardowns) => {\n const entry: PibblInteractionLayer = {\n paintKind: PibblPaintEntryKind.Resolver,\n instance: childInstance,\n bounds: input.bounds,\n transform: new DOMMatrix(),\n clippingStack: [],\n resolveLocal: input.resolveLocal,\n };\n const value = { entry, child: input.child };\n teardowns.add(() => {\n pibblInstance.paintEntries.delete(entry);\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n });\n return value;\n });\n const { entry } = slot.value;\n if (\n (childInstance.eventParent !== undefined &&\n childInstance.eventParent !== componentRefs) ||\n (childInstance.focusParentBridge !== undefined &&\n childInstance.focusParentBridge !== entry)\n ) {\n throw new Error(\n \"A nested Pibbl backend mount already belongs to another nested resolver.\",\n );\n }\n pibblInstance.paintEntries.delete(entry);\n if (slot.value.child !== input.child) {\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n slot.value.child = input.child;\n }\n entry.instance = childInstance;\n entry.instance.eventParent = componentRefs;\n entry.bounds = input.bounds;\n entry.transform = getCurrentWorldTransform();\n entry.clippingStack = Array.from(GLOBAL_STATE.clippingStack);\n entry.resolveLocal = input.resolveLocal;\n entry.instance.focusParentBridge = entry;\n if (input.pointerEvents === \"auto\") {\n pibblInstance.paintEntries.add(entry);\n }\n}\n\nfunction backendMountInstance(mount: PibblBackendMount) {\n const instance = GLOBAL_STATE.pibblInstances.get(mount.canvas);\n if (!instance) {\n throw new Error(\"Nested Pibbl backend mount is not active.\");\n }\n return instance;\n}\n\nfunction cancelCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n state.handle?.cancel();\n state.handle = undefined;\n state.updateParents = false;\n}\n\nfunction releaseCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n if (!state.active) return;\n state.active = false;\n cancelCurrentInstanceFrameRequest(state);\n frameRequestsByComponent.delete(state.componentRefs);\n\n}\n\nfunction isCurrentInstanceFrameRequestActive(\n state: CurrentInstanceFrameRequestState,\n): boolean {\n return (\n state.active &&\n !state.componentRefs.teardowns.closed &&\n !state.instance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(state.instance.canvas) === state.instance &&\n state.instance.refs.get(state.componentRefs.id) === state.componentRefs\n );\n}\nexport {\n pibblInternalAssertCommandAllowed,\n pibblInternalCreateSignalConsumer,\n pibblInternalCurrentFrame,\n pibblInternalCurrentRenderOwner,\n pibblInternalOnRenderFinish,\n pibblInternalPaintTarget,\n pibblInternalQueueBegin,\n pibblInternalQueueComplete,\n pibblInternalQueueCurrentCommit,\n pibblInternalQueueCurrentComplete,\n pibblInternalRegisterAdvance,\n pibblInternalRequestRender,\n pibblInternalRequestRendererWork,\n} from \"./lib/scheduler/renderer-participant.js\";\nexport type {\n PibblInternalCommandHandle,\n PibblInternalFrame,\n PibblInternalRendererWorkKind,\n PibblInternalRenderOwner,\n PibblInternalSignalBatch,\n PibblInternalSignalConsumer,\n} from \"./lib/scheduler/renderer-participant.js\";\n\nexport { pushLayoutBox } from \"./lib/layout/context.js\";\n\nexport {\n ManualSchedulerDriver as PibblInternalManualSchedulerDriver,\n installSchedulerDriverForTest as pibblInternalInstallTestSchedulerDriver,\n snapshotRealmScheduler as pibblInternalSnapshotRealmScheduler,\n} from \"./lib/scheduler/testing.js\";\n\nexport { getCurrentWorldTransform as pibblInternalCurrentWorldTransform } from \"./lib/render-target.js\";\n\nexport { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from './lib/textures/texture-protocol.js';\nexport type { BorrowedTextureRaster } from './lib/textures/texture-protocol.js';\n"],
|
|
5
|
-
"mappings": "AASA,SAAS,0BAA0B;AAenC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAA6B,wBAAgC;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,yCAAyC;AAMlD,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;AAEpC,SAAS,yBAAyB,oBAAoB;AACtD;AAAA,EACE;AAAA,EACA,uBAAAA;AAAA,OACK;AACP,SAAS,gCAAgC;AAC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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,SAAS,qBAAqB;AAE9B;AAAA,EAC2B;AAAA,EACQ;AAAA,EACP;AAAA,OACrB;AAEP,SAAqC,4BAA5BC,iCAAsE;AAE/E,SAAS,qBAAqB,qBAAqB,4BAA4B;",
|
|
4
|
+
"sourcesContent": ["import type { PibblInternalFrame, pibblInternalOnRenderFinish, pibblInternalRequestRender } from './lib/scheduler/renderer-participant.js';\nimport type { PibblConfig, PibblPixelRatio } from './lib/surface/types.js';\n/**\n * @packageDocumentation\n * Reserved for official Pibbl packages that are released in lockstep with\n * `@pibbl/core`. This version-coupled module is not a stable third-party plugin\n * API and intentionally does not re-export the public root module.\n */\n\nexport { createBackendToken } from \"./lib/backend/types.js\";\nexport type {\n PibblBackendDriver,\n PibblBackendEventTargetOptions,\n PibblBackendFrame,\n PibblBackendFrameInput,\n PibblBackendMount,\n PibblBackendMountOptions,\n PibblBackendPrimitiveDefinition,\n PibblBackendPrimitiveInput,\n PibblBackendPrimitiveProgram,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nexport type { SignalProgramProps, SignalStyle } from \"./lib/types.js\";\nexport {\n pibblInternalRunPurePrimitiveResolver,\n defineBackendPrimitive,\n derivePrimitive,\n} from \"./lib/define-primitive.js\";\nexport { mountBackendPibbl } from \"./lib/mount-pibbl.js\";\nexport {\n useInternalHookSlot,\n withHooksForbidden,\n} from \"./lib/hooks/hook-slot.js\";\nexport { useValueMemoSlot as useInternalValueMemoSlot } from \"./lib/hooks/use-value-memo-slot.js\";\nexport {\n haveSameLayerNodeTree,\n materializeRetainedLayerChildren,\n snapshotLayerNodeTree,\n} from \"./lib/components/layer-node-equality.js\";\nexport type { LayerNodeSnapshot } from \"./lib/components/layer-node-equality.js\";\nexport type { PibblEventTargetRegistration } from \"./lib/events/registrations.js\";\nexport type { PibblElementSource } from \"./lib/element/metadata.js\";\nexport { pibblInternalCreatePropAttachment } from \"./lib/element-enhancers.js\";\nexport type {\n PibblInternalMountedPropAttachment,\n PibblInternalPrimitiveAttachmentInput,\n} from \"./lib/element-enhancers.js\";\nexport type { PibblHitTestOutput } from \"./lib/events/paint-entry.js\";\nexport { hasPibblEventHandler } from \"./lib/events/event-definitions.js\";\nexport {\n pibblInternalCurrentSimulationOwner,\n pibblInternalOnSimulationRenderTransactionFinish,\n pibblInternalQueueSimulationBegin,\n pibblInternalQueueSimulationCommitAcknowledgement,\n pibblInternalQueueSimulationComplete,\n pibblInternalRegisterSimulationAdvance,\n pibblInternalRequestSimulationRender,\n} from \"./lib/scheduler/simulation-participant.js\";\nexport type {\n PibblInternalAdvanceLane,\n PibblInternalSimulationOwner,\n} from \"./lib/scheduler/simulation-participant.js\";\n\nimport type {\n PibblBackendEventTargetOptions,\n PibblBackendMount,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nimport {\n createTarget,\n releaseTarget,\n updateTarget,\n type PibblEventTargetRegistration,\n} from \"./lib/events/registrations.js\";\nimport { PibblPaintEntryKind } from \"./lib/events/paint-entry.js\";\nimport type { PibblEventHandlers, PibblPointerEvents } from \"./lib/events/types.js\";\nimport { getCurrentPibblInstance, GLOBAL_STATE } from \"./lib/global-state.js\";\nexport { captureSeriesInspectionFrame } from \"./lib/series-inspection-frame.js\";\nexport { borrowDispatchResource } from \"./lib/events/event-facade.js\";\nimport {\n requireHookContext,\n useInternalHookSlot,\n} from \"./lib/hooks/hook-slot.js\";\nimport { getCurrentWorldTransform } from \"./lib/render-target.js\";\nimport {\n getElementSource,\n type PibblElementSource,\n} from \"./lib/element/metadata.js\";\nimport { getSurfaceSnapshot } from \"./lib/surface/transform.js\";\nimport type {\n Canvas,\n PibblComponentRefs,\n PibblInstance,\n} from \"./lib/types.js\";\nimport type { PibblInteractionLayer } from \"./lib/types.js\";\nimport { update } from \"./lib/update.js\";\nimport { queueBeginCommand } from \"./lib/scheduler/realm-scheduler.js\";\nimport type { PibblBeginCommandHandle } from \"./lib/scheduler/types.js\";\n\ninterface CurrentInstanceFrameRequestState {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly instance: PibblInstance;\n active: boolean;\n handle: PibblBeginCommandHandle | undefined;\n updateParents: boolean;\n}\n\nconst frameRequestsByComponent = new WeakMap<\n PibblComponentRefs<any>,\n CurrentInstanceFrameRequestState\n>();\n/**\n * Reads the selected official backend's current frame environment.\n *\n * @param token - Backend identity required by the caller. See {@link PibblBackendToken}.\n * @returns The active environment for that backend.\n *\n * @see {@link PibblBackendToken}\n */\nexport function getBackendEnvironment<E>(token: PibblBackendToken): E {\n const driver = GLOBAL_STATE.backendDriver;\n const frame = GLOBAL_STATE.backendFrame;\n if (!driver || !frame || driver.token !== token) {\n throw new Error(\"The requested Pibbl backend environment is not active.\");\n }\n return frame.environment as E;\n}\n\n/**\n * Returns the timestamp shared by the current Pibbl render transaction.\n *\n * @returns The active frame timestamp in milliseconds.\n *\n * @see {@link PibblInternalFrame}\n */\nexport function getCurrentFrameTimestamp(): number {\n return getCurrentPibblInstance().renderTimestamp;\n}\n\n/**\n * Returns the active instance's owning Canvas, never a transient filter target.\n *\n * @returns The host canvas of the active backend mount. See {@link Canvas}.\n *\n * @see {@link Canvas}\n */\nexport function getCurrentBackendHostCanvas(): Canvas {\n return getCurrentPibblInstance().canvas;\n}\n\n/**\n * Returns development JSX source metadata for the current component.\n *\n * @returns Source metadata for the current element, or undefined when unavailable. See\n * {@link PibblElementSource} .\n *\n * @see {@link PibblElementSource}\n */\nexport function getCurrentElementSource(): PibblElementSource | undefined {\n const { componentRefs } = requireHookContext();\n return getElementSource(componentRefs.element);\n}\n\n/**\n * Returns the active surface's independent effective backing densities.\n *\n * @returns Backing pixels per logical unit on each axis.\n *\n * @see {@link PibblPixelRatio}\n */\nexport function getCurrentSurfaceDensity(): Readonly<{ x: number; y: number }> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n x: surface.backingPixelsPerLogicalUnitX,\n y: surface.backingPixelsPerLogicalUnitY,\n });\n}\n\n/**\n * Returns the active root-logical viewport for an official renderer hook.\n *\n * @returns The current logical viewport width and height.\n *\n * @see {@link PibblConfig}\n */\nexport function getCurrentLogicalViewport(): Readonly<{\n width: number;\n height: number;\n}> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n width: surface.logicalWidth,\n height: surface.logicalHeight,\n });\n}\n\n/**\n * Registers a callback on the root-wide transaction containing this render.\n *\n * @param callback - Callback receiving whether the current render transaction succeeded.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function onCurrentRenderFinish(\n callback: (success: boolean) => void,\n): void {\n requireHookContext();\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error(\"No Pibbl render transaction is active.\");\n }\n transaction.onFinish(callback);\n}\n\n/**\n * Requests a coalesced frame for the current private backend instance.\n *\n * @param updateParents - Whether ancestor compositions should also receive a frame request.\n *\n * @see {@link pibblInternalRequestRender}\n */\nexport function requestCurrentInstanceFrame(updateParents: boolean): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n let state = frameRequestsByComponent.get(componentRefs);\n if (!state) {\n state = {\n componentRefs,\n instance: pibblInstance,\n active: true,\n handle: undefined,\n updateParents: false,\n };\n frameRequestsByComponent.set(componentRefs, state);\n componentRefs.teardowns.add(() =>\n releaseCurrentInstanceFrameRequest(state!),\n );\n }\n state.updateParents ||= updateParents;\n if (state.handle) return;\n state.handle = queueBeginCommand(() => {\n state!.handle = undefined;\n const updateParentsForFrame = state!.updateParents;\n state!.updateParents = false;\n if (!isCurrentInstanceFrameRequestActive(state!)) return;\n if (updateParentsForFrame) {\n update(state!.instance.canvas, undefined, true);\n } else {\n update(state!.instance.canvas);\n }\n });\n}\n\n/**\n * Retains one geometry-independent target for an official backend picker.\n *\n * @param handlers - Handlers for the backend target. See {@link PibblEventHandlers}.\n * @param options - Backend geometry and focus metadata. See {@link PibblBackendEventTargetOptions}.\n * @param pointerEvents - Pointer participation policy; defaults to auto. See\n * {@link PibblPointerEvents} .\n * @returns The live registration, or undefined when registration is unnecessary. See\n * {@link PibblEventTargetRegistration} .\n *\n * @see {@link PibblEventHandlers}\n * @see {@link PibblBackendEventTargetOptions}\n * @see {@link PibblPointerEvents}\n * @see {@link PibblEventTargetRegistration}\n */\nexport function useBackendEventTarget(\n handlers: PibblEventHandlers,\n options: PibblBackendEventTargetOptions = {},\n pointerEvents: PibblPointerEvents = \"auto\",\n): PibblEventTargetRegistration | undefined {\n const { componentRefs, pibblInstance } = requireHookContext();\n const hookIndex = GLOBAL_STATE.componentHookIndex;\n const slot = useInternalHookSlot(\"backendEventTarget\", (teardowns) => {\n const target = createTarget(pibblInstance, componentRefs, hookIndex);\n teardowns.add(() => releaseTarget(target));\n return { target, emptyPath: new Path2D() };\n });\n const { target, emptyPath } = slot.value;\n if (pointerEvents === \"none\") {\n releaseTarget(target);\n return undefined;\n }\n updateTarget(\n target,\n handlers,\n { ...options, path: emptyPath },\n true,\n options.deferKeyboardNavigationGeometry ?? false,\n );\n if (target.paintEntry) {\n target.owner.paintEntries.delete(target.paintEntry);\n target.paintEntry = undefined;\n }\n return target;\n}\n\n/**\n * Tests whether an official backend target can still win coordinate picking.\n *\n * @param target - Registration whose ownership is being checked. See\n * {@link PibblEventTargetRegistration} .\n * @returns Whether the target registration is still live.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function isBackendEventTargetLive(\n target: PibblEventTargetRegistration,\n): boolean {\n const { owner } = target;\n return (\n target.live &&\n !owner.mainTeardowns.closed &&\n owner.eventRoot.targets.has(target)\n );\n}\n\n/**\n * Temporarily releases one backend target; its retained hook may enroll it again.\n *\n * @param target - Target registration to release. See {@link PibblEventTargetRegistration}.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function releaseBackendEventTarget(\n target: PibblEventTargetRegistration,\n): void {\n releaseTarget(target);\n target.keyboardNavigationBounds = undefined;\n target.keyboardNavigationPoints = undefined;\n}\n\n/**\n * Registers work that runs after this component's rendered descendants.\n *\n * @param callback - Callback to execute after the current component renders.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function setCurrentComponentAfterRender(callback: () => void): void {\n const { componentRefs } = requireHookContext();\n const previous = componentRefs.onAfterRender;\n componentRefs.onAfterRender = previous\n ? () => {\n try {\n previous();\n } finally {\n callback();\n }\n }\n : callback;\n}\n\n/**\n * Installs one stable nested backend resolver in the current Canvas paint order.\n *\n * @param input - Nested coordinate resolver and its target metadata. See\n * {@link PibblNestedResolverInput} .\n *\n * @see {@link PibblNestedResolverInput}\n */\nexport function registerNestedInteractionResolver(\n input: PibblNestedResolverInput,\n): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n const childInstance = backendMountInstance(input.child);\n if (\n childInstance.parent !== pibblInstance.canvas ||\n childInstance.eventRoot !== pibblInstance.eventRoot\n ) {\n throw new Error(\n \"A nested Pibbl backend mount must belong to the current instance and same event root.\",\n );\n }\n const slot = useInternalHookSlot<{\n entry: PibblInteractionLayer;\n child: PibblBackendMount;\n }>(\"nestedInteractionResolver\", (teardowns) => {\n const entry: PibblInteractionLayer = {\n paintKind: PibblPaintEntryKind.Resolver,\n instance: childInstance,\n bounds: input.bounds,\n transform: new DOMMatrix(),\n clippingStack: [],\n resolveLocal: input.resolveLocal,\n };\n const value = { entry, child: input.child };\n teardowns.add(() => {\n pibblInstance.paintEntries.delete(entry);\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n });\n return value;\n });\n const { entry } = slot.value;\n if (\n (childInstance.eventParent !== undefined &&\n childInstance.eventParent !== componentRefs) ||\n (childInstance.focusParentBridge !== undefined &&\n childInstance.focusParentBridge !== entry)\n ) {\n throw new Error(\n \"A nested Pibbl backend mount already belongs to another nested resolver.\",\n );\n }\n pibblInstance.paintEntries.delete(entry);\n if (slot.value.child !== input.child) {\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n slot.value.child = input.child;\n }\n entry.instance = childInstance;\n entry.instance.eventParent = componentRefs;\n entry.bounds = input.bounds;\n entry.transform = getCurrentWorldTransform();\n entry.clippingStack = Array.from(GLOBAL_STATE.clippingStack);\n entry.resolveLocal = input.resolveLocal;\n entry.instance.focusParentBridge = entry;\n if (input.pointerEvents === \"auto\") {\n pibblInstance.paintEntries.add(entry);\n }\n}\n\nfunction backendMountInstance(mount: PibblBackendMount) {\n const instance = GLOBAL_STATE.pibblInstances.get(mount.canvas);\n if (!instance) {\n throw new Error(\"Nested Pibbl backend mount is not active.\");\n }\n return instance;\n}\n\nfunction cancelCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n state.handle?.cancel();\n state.handle = undefined;\n state.updateParents = false;\n}\n\nfunction releaseCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n if (!state.active) return;\n state.active = false;\n cancelCurrentInstanceFrameRequest(state);\n frameRequestsByComponent.delete(state.componentRefs);\n\n}\n\nfunction isCurrentInstanceFrameRequestActive(\n state: CurrentInstanceFrameRequestState,\n): boolean {\n return (\n state.active &&\n !state.componentRefs.teardowns.closed &&\n !state.instance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(state.instance.canvas) === state.instance &&\n state.instance.refs.get(state.componentRefs.id) === state.componentRefs\n );\n}\nexport {\n pibblInternalAssertCommandAllowed,\n pibblInternalCreateSignalConsumer,\n pibblInternalCurrentFrame,\n pibblInternalCurrentRenderOwner,\n pibblInternalOnRenderFinish,\n pibblInternalPaintTarget,\n pibblInternalQueueBegin,\n pibblInternalQueueComplete,\n pibblInternalQueueCurrentCommit,\n pibblInternalQueueCurrentComplete,\n pibblInternalRegisterAdvance,\n pibblInternalRequestRender,\n pibblInternalRequestRendererWork,\n} from \"./lib/scheduler/renderer-participant.js\";\nexport type {\n PibblInternalCommandHandle,\n PibblInternalFrame,\n PibblInternalRendererWorkKind,\n PibblInternalRenderOwner,\n PibblInternalSignalBatch,\n PibblInternalSignalConsumer,\n} from \"./lib/scheduler/renderer-participant.js\";\n\nexport { pushLayoutBox } from \"./lib/layout/context.js\";\n\nexport {\n ManualSchedulerDriver as PibblInternalManualSchedulerDriver,\n installSchedulerDriverForTest as pibblInternalInstallTestSchedulerDriver,\n snapshotRealmScheduler as pibblInternalSnapshotRealmScheduler,\n} from \"./lib/scheduler/testing.js\";\n\nexport { getCurrentWorldTransform as pibblInternalCurrentWorldTransform } from \"./lib/render-target.js\";\n\nexport { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from './lib/textures/texture-protocol.js';\nexport type { BorrowedTextureRaster } from './lib/textures/texture-protocol.js';\n"],
|
|
5
|
+
"mappings": "AASA,SAAS,0BAA0B;AAenC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAA6B,wBAAgC;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,yCAAyC;AAMlD,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;AAEpC,SAAS,yBAAyB,oBAAoB;AACtD,SAAS,oCAAoC;AAC7C,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA,uBAAAA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,0BAA0B;AAOnC,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAWlC,MAAM,2BAA2B,oBAAI,QAGn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SAAS,qBAAqB;AAE9B;AAAA,EAC2B;AAAA,EACQ;AAAA,EACP;AAAA,OACrB;AAEP,SAAqC,4BAA5BC,iCAAsE;AAE/E,SAAS,qBAAqB,qBAAqB,4BAA4B;",
|
|
6
6
|
"names": ["useInternalHookSlot", "target", "entry", "getCurrentWorldTransform"]
|
|
7
7
|
}
|
|
@@ -13,6 +13,19 @@ export interface CreatePibblEventInput<K extends PibblEventType> {
|
|
|
13
13
|
/** Root-logical coordinate supplied by the family adapter. */
|
|
14
14
|
readonly y?: number;
|
|
15
15
|
}
|
|
16
|
+
/** Private opt-in dispatch ownership; ordinary events allocate no resource map.
|
|
17
|
+
* @param event - The currently dispatched logical event.
|
|
18
|
+
* @param key - Identity of this optional integration resource.
|
|
19
|
+
* @param create - Lazy initializer with an exact dispatch-end disposer.
|
|
20
|
+
* @returns Shared resource for this logical dispatch.
|
|
21
|
+
* @see {@link PibblEvent}
|
|
22
|
+
*/
|
|
23
|
+
export declare function borrowDispatchResource<T>(event: PibblEvent, key: object, create: () => {
|
|
24
|
+
value: T;
|
|
25
|
+
dispose: () => void;
|
|
26
|
+
}): T;
|
|
27
|
+
/** Releases optional synchronous resources even when a handler fails. */
|
|
28
|
+
export declare function finishEventDispatch(event: PibblEvent): void;
|
|
16
29
|
export declare function createPibblEvent<K extends PibblEventType>(input: CreatePibblEventInput<K>): PibblEventMap[K];
|
|
17
30
|
export declare function setPibblEventInvocation(event: PibblEvent, currentTarget: PibblEventTarget, eventPhase: PibblEventPhase): void;
|
|
18
31
|
export declare function isPibblPropagationStopped(event: PibblEvent): boolean;
|
|
@@ -2,6 +2,27 @@ import {
|
|
|
2
2
|
getPibblEventDefinition
|
|
3
3
|
} from "./event-definitions.js";
|
|
4
4
|
const states = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
function borrowDispatchResource(event, key, create) {
|
|
6
|
+
const state = requiredState(event);
|
|
7
|
+
if (state.dispatchFinished) throw new Error("Inspection dispatch has expired.");
|
|
8
|
+
const resources = state.resources ??= /* @__PURE__ */ new Map();
|
|
9
|
+
let resource = resources.get(key);
|
|
10
|
+
if (!resource) {
|
|
11
|
+
resource = create();
|
|
12
|
+
resources.set(key, resource);
|
|
13
|
+
}
|
|
14
|
+
return resource.value;
|
|
15
|
+
}
|
|
16
|
+
function finishEventDispatch(event) {
|
|
17
|
+
const state = requiredState(event);
|
|
18
|
+
state.dispatchFinished = true;
|
|
19
|
+
const resources = state.resources;
|
|
20
|
+
if (resources) {
|
|
21
|
+
for (const resource of resources.values()) resource.dispose();
|
|
22
|
+
resources.clear();
|
|
23
|
+
state.resources = void 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
5
26
|
function createPibblEvent(input) {
|
|
6
27
|
const definition = requiredDefinition(input.type);
|
|
7
28
|
const originalEvent = input.originalEvent;
|
|
@@ -180,7 +201,9 @@ function pick(value, keys) {
|
|
|
180
201
|
return result;
|
|
181
202
|
}
|
|
182
203
|
export {
|
|
204
|
+
borrowDispatchResource,
|
|
183
205
|
createPibblEvent,
|
|
206
|
+
finishEventDispatch,
|
|
184
207
|
isPibblImmediatePropagationStopped,
|
|
185
208
|
isPibblPropagationStopped,
|
|
186
209
|
setPibblEventInvocation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/events/event-facade.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n getPibblEventDefinition,\n type PibblEventDefinition,\n} from './event-definitions.js';\nimport type { PibblEventNode } from './registrations.js';\nimport type {\n PibblEvent,\n PibblEventMap,\n PibblEventPhase,\n PibblEventTarget,\n PibblEventType,\n} from './types.js';\n\nexport type PibblOriginalEvent<K extends PibblEventType> =\n PibblEventMap[K] extends PibblEvent<infer TOriginal> ? TOriginal : Event;\n\nexport interface CreatePibblEventInput<K extends PibblEventType> {\n readonly type: K;\n readonly target: PibblEventNode;\n readonly path: readonly PibblEventNode[];\n readonly relatedTarget?: PibblEventNode | null;\n readonly originalEvent: PibblOriginalEvent<K>;\n readonly sourceEvent?: Event;\n /** Root-logical coordinate supplied by the family adapter. */\n readonly x?: number;\n /** Root-logical coordinate supplied by the family adapter. */\n readonly y?: number;\n}\n\ninterface PibblEventFacadeState {\n currentTarget: PibblEventTarget;\n eventPhase: PibblEventPhase;\n defaultPrevented: boolean;\n propagationStopped: boolean;\n immediatePropagationStopped: boolean;\n}\n\nconst states = new WeakMap<object, PibblEventFacadeState>();\n\nexport function createPibblEvent<K extends PibblEventType>(\n input: CreatePibblEventInput<K>,\n): PibblEventMap[K] {\n const definition = requiredDefinition(input.type);\n const originalEvent = input.originalEvent;\n const cancelable = definition.cancelable && originalEvent.cancelable;\n const publicPath = Object.freeze(\n input.path.map(node => node.publicTarget),\n );\n const state: PibblEventFacadeState = {\n currentTarget: input.target.publicTarget,\n eventPhase: 2,\n defaultPrevented: cancelable && originalEvent.defaultPrevented,\n propagationStopped: false,\n immediatePropagationStopped: false,\n };\n const facade = {\n type: input.type,\n target: input.target.publicTarget,\n relatedTarget: input.relatedTarget?.publicTarget ?? null,\n bubbles: definition.bubbles,\n cancelable,\n timeStamp: originalEvent.timeStamp,\n originalEvent,\n sourceEvent: input.sourceEvent,\n get currentTarget() {\n return state.currentTarget;\n },\n get eventPhase() {\n return state.eventPhase;\n },\n get defaultPrevented() {\n return state.defaultPrevented;\n },\n composedPath() {\n return publicPath;\n },\n preventDefault() {\n if (!cancelable) return;\n state.defaultPrevented = true;\n originalEvent.preventDefault();\n },\n stopPropagation() {\n state.propagationStopped = true;\n originalEvent.stopPropagation();\n },\n stopImmediatePropagation() {\n state.propagationStopped = true;\n state.immediatePropagationStopped = true;\n originalEvent.stopImmediatePropagation();\n },\n } as PibblEvent & Record<string, unknown>;\n states.set(facade, state);\n projectFamilyFields(facade, definition, input);\n return facade as unknown as PibblEventMap[K];\n}\n\nexport function setPibblEventInvocation(\n event: PibblEvent,\n currentTarget: PibblEventTarget,\n eventPhase: PibblEventPhase,\n): void {\n const state = requiredState(event);\n state.currentTarget = currentTarget;\n state.eventPhase = eventPhase;\n}\n\nexport function isPibblPropagationStopped(event: PibblEvent): boolean {\n return requiredState(event).propagationStopped;\n}\n\nexport function isPibblImmediatePropagationStopped(event: PibblEvent): boolean {\n return requiredState(event).immediatePropagationStopped;\n}\n\nfunction requiredState(event: PibblEvent): PibblEventFacadeState {\n const state = states.get(event);\n if (!state) throw new Error('Pibbl event facade state is unavailable.');\n return state;\n}\n\nfunction requiredDefinition(type: PibblEventType): PibblEventDefinition {\n const definition = getPibblEventDefinition(type);\n if (!definition) throw new Error(`Unsupported Pibbl event type: ${type}`);\n return definition;\n}\n\nfunction projectFamilyFields<K extends PibblEventType>(\n facade: PibblEvent & Record<string, unknown>,\n definition: PibblEventDefinition,\n input: CreatePibblEventInput<K>,\n): void {\n const original: unknown = input.originalEvent;\n if (definition.coordinate) {\n Object.assign(facade, { x: input.x ?? 0, y: input.y ?? 0 });\n }\n\n switch (definition.family) {\n case 'pointer':\n projectMouseFields(facade, original as PointerEvent);\n Object.assign(facade, pick(original as PointerEvent, [\n 'pointerId',\n 'width',\n 'height',\n 'pressure',\n 'tangentialPressure',\n 'tiltX',\n 'tiltY',\n 'twist',\n 'pointerType',\n 'isPrimary',\n ]));\n break;\n case 'mouse':\n projectMouseFields(facade, original as MouseEvent);\n break;\n case 'touch':\n projectModifierFields(facade, original as TouchEvent);\n Object.assign(facade, pick(original as TouchEvent, [\n 'touches',\n 'targetTouches',\n 'changedTouches',\n ]));\n break;\n case 'wheel':\n projectMouseFields(facade, original as WheelEvent);\n Object.assign(facade, pick(original as WheelEvent, [\n 'deltaX',\n 'deltaY',\n 'deltaZ',\n 'deltaMode',\n ]));\n break;\n case 'keyboard':\n projectModifierFields(facade, original as KeyboardEvent);\n Object.assign(facade, pick(original as KeyboardEvent, [\n 'key',\n 'code',\n 'location',\n 'repeat',\n 'isComposing',\n ]));\n break;\n case 'input':\n if (definition.type === 'beforeinput' || definition.type === 'input') {\n Object.assign(facade, pick(original as InputEvent, [\n 'data',\n 'dataTransfer',\n 'inputType',\n 'isComposing',\n ]));\n }\n break;\n case 'composition':\n Object.assign(facade, pick(original as CompositionEvent, ['data']));\n break;\n case 'clipboard':\n Object.assign(facade, pick(original as ClipboardEvent, ['clipboardData']));\n break;\n case 'drag':\n projectMouseFields(facade, original as DragEvent);\n Object.assign(facade, pick(original as DragEvent, ['dataTransfer']));\n break;\n case 'focus':\n break;\n }\n}\n\nfunction projectMouseFields(\n facade: PibblEvent & Record<string, unknown>,\n original: MouseEvent,\n): void {\n projectModifierFields(facade, original);\n Object.assign(facade, pick(original, [\n 'clientX',\n 'clientY',\n 'screenX',\n 'screenY',\n 'movementX',\n 'movementY',\n 'button',\n 'buttons',\n 'detail',\n ]));\n}\n\nfunction projectModifierFields(\n facade: PibblEvent & Record<string, unknown>,\n original: MouseEvent | TouchEvent | KeyboardEvent,\n): void {\n Object.assign(facade, pick(original, [\n 'altKey',\n 'ctrlKey',\n 'metaKey',\n 'shiftKey',\n ]));\n}\n\nfunction pick<T extends object, K extends keyof T>(\n value: T,\n keys: readonly K[],\n): Pick<T, K> {\n const result = {} as Pick<T, K>;\n for (const key of keys) result[key] = value[key];\n return result;\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,OAEK;
|
|
4
|
+
"sourcesContent": ["import {\n getPibblEventDefinition,\n type PibblEventDefinition,\n} from './event-definitions.js';\nimport type { PibblEventNode } from './registrations.js';\nimport type {\n PibblEvent,\n PibblEventMap,\n PibblEventPhase,\n PibblEventTarget,\n PibblEventType,\n} from './types.js';\n\nexport type PibblOriginalEvent<K extends PibblEventType> =\n PibblEventMap[K] extends PibblEvent<infer TOriginal> ? TOriginal : Event;\n\nexport interface CreatePibblEventInput<K extends PibblEventType> {\n readonly type: K;\n readonly target: PibblEventNode;\n readonly path: readonly PibblEventNode[];\n readonly relatedTarget?: PibblEventNode | null;\n readonly originalEvent: PibblOriginalEvent<K>;\n readonly sourceEvent?: Event;\n /** Root-logical coordinate supplied by the family adapter. */\n readonly x?: number;\n /** Root-logical coordinate supplied by the family adapter. */\n readonly y?: number;\n}\n\ninterface PibblEventFacadeState {\n dispatchFinished?: boolean;\n resources?: Map<object, { value: unknown; dispose: () => void }>;\n currentTarget: PibblEventTarget;\n eventPhase: PibblEventPhase;\n defaultPrevented: boolean;\n propagationStopped: boolean;\n immediatePropagationStopped: boolean;\n}\n\nconst states = new WeakMap<object, PibblEventFacadeState>();\n\n/** Private opt-in dispatch ownership; ordinary events allocate no resource map.\n * @param event - The currently dispatched logical event.\n * @param key - Identity of this optional integration resource.\n * @param create - Lazy initializer with an exact dispatch-end disposer.\n * @returns Shared resource for this logical dispatch.\n * @see {@link PibblEvent}\n */\nexport function borrowDispatchResource<T>(event: PibblEvent, key: object, create: () => {value:T;dispose:()=>void}): T {\n const state = requiredState(event);\n if (state.dispatchFinished) throw new Error('Inspection dispatch has expired.');\n const resources = state.resources ??= new Map();\n let resource = resources.get(key);\n if (!resource) { resource = create(); resources.set(key,resource); }\n return resource.value as T;\n}\n\n/** Releases optional synchronous resources even when a handler fails. */\nexport function finishEventDispatch(event: PibblEvent): void {\n const state = requiredState(event);\n state.dispatchFinished = true;\n const resources = state.resources;\n if (resources) {\n for (const resource of resources.values()) resource.dispose();\n resources.clear();\n state.resources = undefined;\n }\n}\n\nexport function createPibblEvent<K extends PibblEventType>(\n input: CreatePibblEventInput<K>,\n): PibblEventMap[K] {\n const definition = requiredDefinition(input.type);\n const originalEvent = input.originalEvent;\n const cancelable = definition.cancelable && originalEvent.cancelable;\n const publicPath = Object.freeze(\n input.path.map(node => node.publicTarget),\n );\n const state: PibblEventFacadeState = {\n currentTarget: input.target.publicTarget,\n eventPhase: 2,\n defaultPrevented: cancelable && originalEvent.defaultPrevented,\n propagationStopped: false,\n immediatePropagationStopped: false,\n };\n const facade = {\n type: input.type,\n target: input.target.publicTarget,\n relatedTarget: input.relatedTarget?.publicTarget ?? null,\n bubbles: definition.bubbles,\n cancelable,\n timeStamp: originalEvent.timeStamp,\n originalEvent,\n sourceEvent: input.sourceEvent,\n get currentTarget() {\n return state.currentTarget;\n },\n get eventPhase() {\n return state.eventPhase;\n },\n get defaultPrevented() {\n return state.defaultPrevented;\n },\n composedPath() {\n return publicPath;\n },\n preventDefault() {\n if (!cancelable) return;\n state.defaultPrevented = true;\n originalEvent.preventDefault();\n },\n stopPropagation() {\n state.propagationStopped = true;\n originalEvent.stopPropagation();\n },\n stopImmediatePropagation() {\n state.propagationStopped = true;\n state.immediatePropagationStopped = true;\n originalEvent.stopImmediatePropagation();\n },\n } as PibblEvent & Record<string, unknown>;\n states.set(facade, state);\n projectFamilyFields(facade, definition, input);\n return facade as unknown as PibblEventMap[K];\n}\n\nexport function setPibblEventInvocation(\n event: PibblEvent,\n currentTarget: PibblEventTarget,\n eventPhase: PibblEventPhase,\n): void {\n const state = requiredState(event);\n state.currentTarget = currentTarget;\n state.eventPhase = eventPhase;\n}\n\nexport function isPibblPropagationStopped(event: PibblEvent): boolean {\n return requiredState(event).propagationStopped;\n}\n\nexport function isPibblImmediatePropagationStopped(event: PibblEvent): boolean {\n return requiredState(event).immediatePropagationStopped;\n}\n\nfunction requiredState(event: PibblEvent): PibblEventFacadeState {\n const state = states.get(event);\n if (!state) throw new Error('Pibbl event facade state is unavailable.');\n return state;\n}\n\nfunction requiredDefinition(type: PibblEventType): PibblEventDefinition {\n const definition = getPibblEventDefinition(type);\n if (!definition) throw new Error(`Unsupported Pibbl event type: ${type}`);\n return definition;\n}\n\nfunction projectFamilyFields<K extends PibblEventType>(\n facade: PibblEvent & Record<string, unknown>,\n definition: PibblEventDefinition,\n input: CreatePibblEventInput<K>,\n): void {\n const original: unknown = input.originalEvent;\n if (definition.coordinate) {\n Object.assign(facade, { x: input.x ?? 0, y: input.y ?? 0 });\n }\n\n switch (definition.family) {\n case 'pointer':\n projectMouseFields(facade, original as PointerEvent);\n Object.assign(facade, pick(original as PointerEvent, [\n 'pointerId',\n 'width',\n 'height',\n 'pressure',\n 'tangentialPressure',\n 'tiltX',\n 'tiltY',\n 'twist',\n 'pointerType',\n 'isPrimary',\n ]));\n break;\n case 'mouse':\n projectMouseFields(facade, original as MouseEvent);\n break;\n case 'touch':\n projectModifierFields(facade, original as TouchEvent);\n Object.assign(facade, pick(original as TouchEvent, [\n 'touches',\n 'targetTouches',\n 'changedTouches',\n ]));\n break;\n case 'wheel':\n projectMouseFields(facade, original as WheelEvent);\n Object.assign(facade, pick(original as WheelEvent, [\n 'deltaX',\n 'deltaY',\n 'deltaZ',\n 'deltaMode',\n ]));\n break;\n case 'keyboard':\n projectModifierFields(facade, original as KeyboardEvent);\n Object.assign(facade, pick(original as KeyboardEvent, [\n 'key',\n 'code',\n 'location',\n 'repeat',\n 'isComposing',\n ]));\n break;\n case 'input':\n if (definition.type === 'beforeinput' || definition.type === 'input') {\n Object.assign(facade, pick(original as InputEvent, [\n 'data',\n 'dataTransfer',\n 'inputType',\n 'isComposing',\n ]));\n }\n break;\n case 'composition':\n Object.assign(facade, pick(original as CompositionEvent, ['data']));\n break;\n case 'clipboard':\n Object.assign(facade, pick(original as ClipboardEvent, ['clipboardData']));\n break;\n case 'drag':\n projectMouseFields(facade, original as DragEvent);\n Object.assign(facade, pick(original as DragEvent, ['dataTransfer']));\n break;\n case 'focus':\n break;\n }\n}\n\nfunction projectMouseFields(\n facade: PibblEvent & Record<string, unknown>,\n original: MouseEvent,\n): void {\n projectModifierFields(facade, original);\n Object.assign(facade, pick(original, [\n 'clientX',\n 'clientY',\n 'screenX',\n 'screenY',\n 'movementX',\n 'movementY',\n 'button',\n 'buttons',\n 'detail',\n ]));\n}\n\nfunction projectModifierFields(\n facade: PibblEvent & Record<string, unknown>,\n original: MouseEvent | TouchEvent | KeyboardEvent,\n): void {\n Object.assign(facade, pick(original, [\n 'altKey',\n 'ctrlKey',\n 'metaKey',\n 'shiftKey',\n ]));\n}\n\nfunction pick<T extends object, K extends keyof T>(\n value: T,\n keys: readonly K[],\n): Pick<T, K> {\n const result = {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