@pibbl/core 0.0.1 → 0.0.3-alpha.109.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/README.md +1 -1
- package/THIRD_PARTY_NOTICES.txt +81 -0
- package/dist/features/machines/animation.d.ts +64 -0
- package/dist/features/machines/animation.js +55 -0
- package/dist/features/machines/animation.js.map +7 -0
- package/dist/features/machines/animation.mjs +1 -0
- package/dist/features/machines/assign.d.ts +16 -0
- package/dist/features/machines/assign.js +15 -0
- package/dist/features/machines/assign.js.map +7 -0
- package/dist/features/machines/callback.d.ts +9 -0
- package/dist/features/machines/callback.js +7 -0
- package/dist/features/machines/callback.js.map +7 -0
- package/dist/features/machines/hook.d.ts +30 -0
- package/dist/features/machines/hook.js +37 -0
- package/dist/features/machines/hook.js.map +7 -0
- package/dist/features/machines/index.d.ts +6 -0
- package/dist/features/machines/index.js +12 -0
- package/dist/features/machines/index.js.map +7 -0
- package/dist/features/machines/index.mjs +1 -0
- package/dist/features/machines/runtime.d.ts +18 -0
- package/dist/features/machines/runtime.js +363 -0
- package/dist/features/machines/runtime.js.map +7 -0
- package/dist/features/machines/types.d.ts +164 -0
- package/dist/features/physics/2d-geometry.d.ts +3 -3
- package/dist/features/physics/2d-geometry.js.map +1 -1
- package/dist/features/physics/2d-testing.d.ts +1 -1
- package/dist/features/physics/2d-testing.js +2 -2
- package/dist/features/physics/2d-testing.js.map +2 -2
- package/dist/features/physics/2d.d.ts +115 -62
- package/dist/features/physics/2d.js +59 -28
- package/dist/features/physics/2d.js.map +2 -2
- package/dist/features/physics/lib/2d/canvas/components.js +25 -21
- package/dist/features/physics/lib/2d/canvas/components.js.map +2 -2
- package/dist/features/physics/lib/2d/canvas/presentation.js +1 -2
- package/dist/features/physics/lib/2d/canvas/presentation.js.map +2 -2
- package/dist/features/physics/lib/2d/collision/casts.js +4 -2
- package/dist/features/physics/lib/2d/collision/casts.js.map +2 -2
- package/dist/features/physics/lib/2d/query-types.d.ts +6 -0
- package/dist/features/physics/lib/2d/runtime/controller.d.ts +7 -6
- package/dist/features/physics/lib/2d/runtime/controller.js +1 -1
- package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
- package/dist/features/physics/lib/2d/runtime/obstacles.js +9 -11
- package/dist/features/physics/lib/2d/runtime/obstacles.js.map +2 -2
- package/dist/features/physics/lib/2d/shapes.js +8 -9
- package/dist/features/physics/lib/2d/shapes.js.map +2 -2
- package/dist/features/physics/lib/2d/types.d.ts +8 -30
- package/dist/features/physics/lib/2d/world/queries.d.ts +7 -6
- package/dist/features/physics/lib/2d/world/queries.js.map +2 -2
- package/dist/features/physics/lib/2d/world/rapier.js +22 -26
- package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
- package/dist/features/sprites/formats/aseprite.d.ts +5 -0
- package/dist/features/sprites/formats/texture-packer.d.ts +5 -0
- package/dist/features/sprites/index.d.ts +6 -0
- package/dist/features/sprites/loader.d.ts +25 -0
- package/dist/features/sprites/loader.js +6 -3
- package/dist/features/sprites/loader.js.map +2 -2
- package/dist/features/sprites/model.d.ts +75 -0
- package/dist/features/sprites/sprite.d.ts +22 -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 +17 -24
- 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 +37 -0
- package/dist/features/textures/lib/gray-scott.js.map +7 -0
- package/dist/features/textures/lib/palette.js +1 -3
- package/dist/features/textures/lib/palette.js.map +2 -2
- 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/rain-drops.js +2 -1
- package/dist/features/textures/lib/rain-drops.js.map +2 -2
- 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/textures/lib/wasm/electric.js +8 -1
- package/dist/features/textures/lib/wasm/electric.js.map +2 -2
- package/dist/features/textures/lib/water-surface.js +1 -3
- package/dist/features/textures/lib/water-surface.js.map +2 -2
- package/dist/features/viz/index.d.ts +92 -5
- package/dist/features/viz/index.js +202 -4
- 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-labels.d.ts +2 -0
- package/dist/features/viz/lib/axis-labels.js +41 -0
- package/dist/features/viz/lib/axis-labels.js.map +7 -0
- package/dist/features/viz/lib/axis-title.d.ts +23 -0
- package/dist/features/viz/lib/axis-title.js +24 -0
- package/dist/features/viz/lib/axis-title.js.map +7 -0
- package/dist/features/viz/lib/axis.d.ts +1 -1
- package/dist/features/viz/lib/axis.js +50 -50
- package/dist/features/viz/lib/axis.js.map +2 -2
- package/dist/features/viz/lib/bar-scale.d.ts +7 -0
- package/dist/features/viz/lib/bar-scale.js +34 -0
- package/dist/features/viz/lib/bar-scale.js.map +7 -0
- package/dist/features/viz/lib/bar-series.d.ts +3 -1
- package/dist/features/viz/lib/bar-series.js +21 -5
- 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/chart-lines.d.ts +41 -0
- package/dist/features/viz/lib/chart-lines.js +32 -0
- package/dist/features/viz/lib/chart-lines.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 +142 -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/graph/bipartite.d.ts +14 -0
- package/dist/features/viz/lib/graph/bipartite.js +250 -0
- package/dist/features/viz/lib/graph/bipartite.js.map +7 -0
- package/dist/features/viz/lib/graph/chord.d.ts +44 -0
- package/dist/features/viz/lib/graph/chord.js +348 -0
- package/dist/features/viz/lib/graph/chord.js.map +7 -0
- package/dist/features/viz/lib/graph/dependency.d.ts +26 -0
- package/dist/features/viz/lib/graph/dependency.js +140 -0
- package/dist/features/viz/lib/graph/dependency.js.map +7 -0
- package/dist/features/viz/lib/graph/force.d.ts +28 -0
- package/dist/features/viz/lib/graph/force.js +580 -0
- package/dist/features/viz/lib/graph/force.js.map +7 -0
- package/dist/features/viz/lib/graph/hierarchy.d.ts +21 -0
- package/dist/features/viz/lib/graph/hierarchy.js +112 -0
- package/dist/features/viz/lib/graph/hierarchy.js.map +7 -0
- package/dist/features/viz/lib/graph/icicle.d.ts +16 -0
- package/dist/features/viz/lib/graph/icicle.js +153 -0
- package/dist/features/viz/lib/graph/icicle.js.map +7 -0
- package/dist/features/viz/lib/graph/matrix.d.ts +30 -0
- package/dist/features/viz/lib/graph/matrix.js +243 -0
- package/dist/features/viz/lib/graph/matrix.js.map +7 -0
- package/dist/features/viz/lib/graph/neighborhood.d.ts +11 -0
- package/dist/features/viz/lib/graph/neighborhood.js +281 -0
- package/dist/features/viz/lib/graph/neighborhood.js.map +7 -0
- package/dist/features/viz/lib/graph/routes.d.ts +35 -0
- package/dist/features/viz/lib/graph/routes.js +101 -0
- package/dist/features/viz/lib/graph/routes.js.map +7 -0
- package/dist/features/viz/lib/graph/sankey.d.ts +44 -0
- package/dist/features/viz/lib/graph/sankey.js +341 -0
- package/dist/features/viz/lib/graph/sankey.js.map +7 -0
- package/dist/features/viz/lib/graph/shared.d.ts +59 -0
- package/dist/features/viz/lib/graph/shared.js +301 -0
- package/dist/features/viz/lib/graph/shared.js.map +7 -0
- package/dist/features/viz/lib/graph/tree.d.ts +11 -0
- package/dist/features/viz/lib/graph/tree.js +232 -0
- package/dist/features/viz/lib/graph/tree.js.map +7 -0
- package/dist/features/viz/lib/graph/treemap.d.ts +20 -0
- package/dist/features/viz/lib/graph/treemap.js +227 -0
- package/dist/features/viz/lib/graph/treemap.js.map +7 -0
- package/dist/features/viz/lib/graph/types.d.ts +1097 -0
- package/dist/features/viz/lib/hover-card.js +8 -9
- package/dist/features/viz/lib/hover-card.js.map +2 -2
- package/dist/features/viz/lib/hover-data.d.ts +1 -1
- package/dist/features/viz/lib/hover-data.js +6 -3
- package/dist/features/viz/lib/hover-data.js.map +2 -2
- package/dist/features/viz/lib/hover-types.d.ts +5 -5
- 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 +122 -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/layout-pie.js +9 -13
- package/dist/features/viz/lib/layout-pie.js.map +2 -2
- 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-component.d.ts +7 -0
- package/dist/features/viz/lib/linear-scale-component.js +18 -0
- package/dist/features/viz/lib/linear-scale-component.js.map +7 -0
- 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/log-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/log-scale-component.js +19 -0
- package/dist/features/viz/lib/log-scale-component.js.map +7 -0
- package/dist/features/viz/lib/log-scale.d.ts +2 -0
- package/dist/features/viz/lib/log-scale.js +53 -0
- package/dist/features/viz/lib/log-scale.js.map +7 -0
- 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/nearest.d.ts +9 -9
- package/dist/features/viz/lib/nearest.js.map +1 -1
- 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/numeric-ticks.d.ts +38 -0
- package/dist/features/viz/lib/numeric-ticks.js +54 -0
- package/dist/features/viz/lib/numeric-ticks.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/pie-layout.js +2 -1
- package/dist/features/viz/lib/pie-layout.js.map +2 -2
- 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-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/point-scale-component.js +19 -0
- package/dist/features/viz/lib/point-scale-component.js.map +7 -0
- package/dist/features/viz/lib/point-scale.d.ts +2 -0
- package/dist/features/viz/lib/point-scale.js +45 -0
- package/dist/features/viz/lib/point-scale.js.map +7 -0
- 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/reference-band.d.ts +16 -0
- package/dist/features/viz/lib/reference-band.js +30 -0
- package/dist/features/viz/lib/reference-band.js.map +7 -0
- package/dist/features/viz/lib/scale-adjust.js +9 -4
- package/dist/features/viz/lib/scale-adjust.js.map +2 -2
- package/dist/features/viz/lib/scale-context.d.ts +5 -4
- package/dist/features/viz/lib/scale-context.js +15 -11
- package/dist/features/viz/lib/scale-context.js.map +2 -2
- package/dist/features/viz/lib/scale-provider.d.ts +2 -0
- package/dist/features/viz/lib/scale-provider.js +13 -0
- package/dist/features/viz/lib/scale-provider.js.map +7 -0
- package/dist/features/viz/lib/scale-ticks.d.ts +5 -0
- package/dist/features/viz/lib/scale-ticks.js +64 -0
- package/dist/features/viz/lib/scale-ticks.js.map +7 -0
- package/dist/features/viz/lib/scale-view.d.ts +4 -0
- package/dist/features/viz/lib/scale-view.js +21 -0
- package/dist/features/viz/lib/scale-view.js.map +7 -0
- 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/symlog-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/symlog-scale-component.js +19 -0
- package/dist/features/viz/lib/symlog-scale-component.js.map +7 -0
- package/dist/features/viz/lib/symlog-scale.d.ts +2 -0
- package/dist/features/viz/lib/symlog-scale.js +38 -0
- package/dist/features/viz/lib/symlog-scale.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 +114 -21
- package/dist/features/viz/lib/use-bar-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-bar-scale.js +9 -0
- package/dist/features/viz/lib/use-bar-scale.js.map +7 -0
- package/dist/features/viz/lib/use-continuous-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-continuous-scale.js +14 -0
- package/dist/features/viz/lib/use-continuous-scale.js.map +7 -0
- package/dist/features/viz/lib/use-linear-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-linear-scale.js +9 -0
- package/dist/features/viz/lib/use-linear-scale.js.map +7 -0
- package/dist/features/viz/lib/use-log-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-log-scale.js +9 -0
- package/dist/features/viz/lib/use-log-scale.js.map +7 -0
- package/dist/features/viz/lib/use-point-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-point-scale.js +9 -0
- package/dist/features/viz/lib/use-point-scale.js.map +7 -0
- package/dist/features/viz/lib/use-symlog-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-symlog-scale.js +9 -0
- package/dist/features/viz/lib/use-symlog-scale.js.map +7 -0
- package/dist/features/viz/lib/use-utc-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-utc-scale.js +9 -0
- package/dist/features/viz/lib/use-utc-scale.js.map +7 -0
- package/dist/features/viz/lib/utc-labels.d.ts +12 -0
- package/dist/features/viz/lib/utc-labels.js +27 -0
- package/dist/features/viz/lib/utc-labels.js.map +7 -0
- package/dist/features/viz/lib/utc-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/utc-scale-component.js +18 -0
- package/dist/features/viz/lib/utc-scale-component.js.map +7 -0
- package/dist/features/viz/lib/utc-scale.d.ts +21 -0
- package/dist/features/viz/lib/utc-scale.js +124 -0
- package/dist/features/viz/lib/utc-scale.js.map +7 -0
- 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/backdrop-contrast-gpu.d.ts +5 -0
- package/dist/filters/backdrop-contrast-gpu.js +33 -0
- package/dist/filters/backdrop-contrast-gpu.js.map +7 -0
- package/dist/filters/backdrop-contrast.d.ts +21 -0
- package/dist/filters/backdrop-contrast.js +61 -0
- package/dist/filters/backdrop-contrast.js.map +7 -0
- package/dist/filters/displacement.js +1 -1
- package/dist/filters/displacement.js.map +2 -2
- 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 +104 -0
- package/dist/filters/emboss.js.map +7 -0
- package/dist/filters/filter-executor.d.ts +11 -4
- package/dist/filters/filter-executor.js +104 -49
- package/dist/filters/filter-executor.js.map +2 -2
- package/dist/filters/reflected-light.js +1 -1
- package/dist/filters/reflected-light.js.map +2 -2
- 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-backdrop-contrast-boundary.d.ts +31 -0
- package/dist/filters/render-backdrop-contrast-boundary.js +116 -0
- package/dist/filters/render-backdrop-contrast-boundary.js.map +7 -0
- 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 +9 -5
- package/dist/filters.js +4 -0
- package/dist/filters.js.map +2 -2
- package/dist/index.d.ts +10 -6
- package/dist/index.js +18 -2
- package/dist/index.js.map +2 -2
- package/dist/internal.d.ts +4 -0
- package/dist/internal.js +6 -0
- package/dist/internal.js.map +2 -2
- package/dist/layout-kernel.d.ts +12 -0
- package/dist/layout-kernel.js +11 -0
- package/dist/layout-kernel.js.map +7 -0
- package/dist/layout-kernel.mjs +1 -0
- package/dist/lib/animation/definition.d.ts +5 -3
- package/dist/lib/animation/definition.js +29 -4
- package/dist/lib/animation/definition.js.map +2 -2
- package/dist/lib/animation/playback.d.ts +8 -0
- package/dist/lib/animation/playback.js +33 -11
- package/dist/lib/animation/playback.js.map +2 -2
- package/dist/lib/animation/spring.d.ts +3 -1
- package/dist/lib/animation/spring.js.map +2 -2
- package/dist/lib/animation/types.d.ts +29 -73
- package/dist/lib/backend/types.d.ts +13 -1
- package/dist/lib/backend/types.js.map +2 -2
- package/dist/lib/components/arc-geometry.js +2 -1
- package/dist/lib/components/arc-geometry.js.map +2 -2
- package/dist/lib/components/g.js +2 -0
- package/dist/lib/components/g.js.map +2 -2
- package/dist/lib/components/html-box.js +2 -1
- package/dist/lib/components/html-box.js.map +2 -2
- package/dist/lib/components/img.js +3 -3
- package/dist/lib/components/img.js.map +2 -2
- package/dist/lib/components/layer.js +98 -16
- package/dist/lib/components/layer.js.map +3 -3
- package/dist/lib/components/text.d.ts +16 -0
- package/dist/lib/components/text.js +131 -24
- package/dist/lib/components/text.js.map +2 -2
- package/dist/lib/define-primitive.d.ts +4 -2
- package/dist/lib/define-primitive.js +3 -1
- package/dist/lib/define-primitive.js.map +2 -2
- package/dist/lib/element/metadata.d.ts +9 -0
- package/dist/lib/element/metadata.js +19 -0
- package/dist/lib/element/metadata.js.map +2 -2
- package/dist/lib/element/resolve-primitive-inputs.d.ts +2 -0
- package/dist/lib/element/resolve-primitive-inputs.js +17 -4
- package/dist/lib/element/resolve-primitive-inputs.js.map +2 -2
- package/dist/lib/events/event-facade.d.ts +18 -0
- package/dist/lib/events/event-facade.js +28 -2
- package/dist/lib/events/event-facade.js.map +2 -2
- package/dist/lib/events/hit-test.js +2 -1
- package/dist/lib/events/hit-test.js.map +2 -2
- package/dist/lib/events/propagation.d.ts +2 -1
- package/dist/lib/events/propagation.js +22 -16
- package/dist/lib/events/propagation.js.map +2 -2
- package/dist/lib/events/registrations.d.ts +10 -0
- package/dist/lib/events/registrations.js +160 -5
- package/dist/lib/events/registrations.js.map +2 -2
- package/dist/lib/execute-render.js +25 -1
- package/dist/lib/execute-render.js.map +2 -2
- package/dist/lib/filter/filter-region.js +3 -10
- package/dist/lib/filter/filter-region.js.map +2 -2
- package/dist/lib/focus/focus-manager.d.ts +8 -1
- package/dist/lib/focus/focus-manager.js +87 -43
- package/dist/lib/focus/focus-manager.js.map +2 -2
- package/dist/lib/focus/geometry.d.ts +2 -0
- package/dist/lib/focus/geometry.js +6 -0
- package/dist/lib/focus/geometry.js.map +2 -2
- package/dist/lib/geometry/path-bend-guide.js +1 -1
- package/dist/lib/geometry/path-bend-guide.js.map +2 -2
- package/dist/lib/geometry/path-geometry.js +12 -11
- package/dist/lib/geometry/path-geometry.js.map +2 -2
- package/dist/lib/geometry/path-transforms.js +17 -21
- package/dist/lib/geometry/path-transforms.js.map +2 -2
- package/dist/lib/geometry/path-warp-bezier.js +3 -1
- package/dist/lib/geometry/path-warp-bezier.js.map +2 -2
- package/dist/lib/geometry/path-warp.js +1 -1
- package/dist/lib/geometry/path-warp.js.map +2 -2
- package/dist/lib/global-state.js +2 -0
- package/dist/lib/global-state.js.map +2 -2
- package/dist/lib/hooks/use-animated-value.d.ts +11 -21
- package/dist/lib/hooks/use-animated-value.js +23 -70
- package/dist/lib/hooks/use-animated-value.js.map +3 -3
- package/dist/lib/hooks/use-playback.js +1 -0
- package/dist/lib/hooks/use-playback.js.map +2 -2
- package/dist/lib/html/html-events.d.ts +32 -0
- package/dist/lib/html/html-events.js +179 -0
- package/dist/lib/html/html-events.js.map +7 -0
- package/dist/lib/html/html-service.d.ts +8 -2
- package/dist/lib/html/html-service.js +198 -65
- package/dist/lib/html/html-service.js.map +2 -2
- package/dist/lib/html/overlay-config.js +7 -6
- package/dist/lib/html/overlay-config.js.map +2 -2
- package/dist/lib/html/types.d.ts +29 -2
- package/dist/lib/layout/absolute.d.ts +11 -5
- package/dist/lib/layout/absolute.js +329 -55
- package/dist/lib/layout/absolute.js.map +3 -3
- package/dist/lib/layout/allocation-checkpoint-owner.d.ts +11 -0
- package/dist/lib/layout/allocation-checkpoint-owner.js +86 -0
- package/dist/lib/layout/allocation-checkpoint-owner.js.map +7 -0
- package/dist/lib/layout/allocation-checkpoint.d.ts +53 -0
- package/dist/lib/layout/allocation-checkpoint.js +463 -0
- package/dist/lib/layout/allocation-checkpoint.js.map +7 -0
- package/dist/lib/layout/allocation-dependencies.d.ts +30 -0
- package/dist/lib/layout/allocation-dependencies.js +90 -0
- package/dist/lib/layout/allocation-dependencies.js.map +7 -0
- package/dist/lib/layout/allocation-revision.d.ts +13 -0
- package/dist/lib/layout/allocation-revision.js +67 -0
- package/dist/lib/layout/allocation-revision.js.map +7 -0
- package/dist/lib/layout/box-insets.d.ts +17 -0
- package/dist/lib/layout/box-insets.js +138 -0
- package/dist/lib/layout/box-insets.js.map +7 -0
- package/dist/lib/layout/box-sizing.d.ts +16 -0
- package/dist/lib/layout/box-sizing.js +77 -0
- package/dist/lib/layout/box-sizing.js.map +7 -0
- package/dist/lib/layout/box.js +42 -12
- package/dist/lib/layout/box.js.map +2 -2
- package/dist/lib/layout/canvas-measurement.d.ts +13 -0
- package/dist/lib/layout/canvas-measurement.js +57 -0
- package/dist/lib/layout/canvas-measurement.js.map +7 -0
- package/dist/lib/layout/context.d.ts +35 -6
- package/dist/lib/layout/context.js +72 -3
- package/dist/lib/layout/context.js.map +2 -2
- package/dist/lib/layout/define-layout-component.d.ts +23 -0
- package/dist/lib/layout/define-layout-component.js +84 -0
- package/dist/lib/layout/define-layout-component.js.map +7 -0
- package/dist/lib/layout/flex-allocation-cache.d.ts +42 -0
- package/dist/lib/layout/flex-baseline-mode.d.ts +2 -0
- package/dist/lib/layout/flex-baseline-mode.js +7 -0
- package/dist/lib/layout/flex-baseline-mode.js.map +7 -0
- package/dist/lib/layout/flex.d.ts +50 -15
- package/dist/lib/layout/flex.js +2124 -195
- package/dist/lib/layout/flex.js.map +3 -3
- package/dist/lib/layout/flow.js +225 -49
- package/dist/lib/layout/flow.js.map +2 -2
- package/dist/lib/layout/geometry-publication.d.ts +53 -0
- package/dist/lib/layout/geometry-publication.js +244 -0
- package/dist/lib/layout/geometry-publication.js.map +7 -0
- package/dist/lib/layout/grid-kernel.d.ts +63 -0
- package/dist/lib/layout/grid-kernel.js +168 -0
- package/dist/lib/layout/grid-kernel.js.map +7 -0
- package/dist/lib/layout/grid.d.ts +63 -4
- package/dist/lib/layout/grid.js +767 -171
- package/dist/lib/layout/grid.js.map +3 -3
- package/dist/lib/layout/measure.d.ts +55 -3
- package/dist/lib/layout/measure.js +448 -15
- package/dist/lib/layout/measure.js.map +2 -2
- package/dist/lib/layout/overlay.js +81 -23
- package/dist/lib/layout/overlay.js.map +2 -2
- package/dist/lib/layout/participation.d.ts +27 -0
- package/dist/lib/layout/participation.js +188 -0
- package/dist/lib/layout/participation.js.map +7 -0
- package/dist/lib/layout/place-child.js +1 -1
- package/dist/lib/layout/place-child.js.map +2 -2
- package/dist/lib/layout/positioning-diagnostics.d.ts +1 -1
- package/dist/lib/layout/positioning-diagnostics.js +13 -2
- package/dist/lib/layout/positioning-diagnostics.js.map +2 -2
- package/dist/lib/layout/prepared-root.d.ts +121 -0
- package/dist/lib/layout/prepared-root.js +360 -0
- package/dist/lib/layout/prepared-root.js.map +7 -0
- package/dist/lib/layout/standalone-kernel.d.ts +60 -0
- package/dist/lib/layout/standalone-kernel.js +722 -0
- package/dist/lib/layout/standalone-kernel.js.map +7 -0
- package/dist/lib/layout/topology.d.ts +21 -0
- package/dist/lib/layout/topology.js +113 -0
- package/dist/lib/layout/topology.js.map +7 -0
- package/dist/lib/layout/types.d.ts +5 -0
- package/dist/lib/layout/wasm/artifact.d.ts +1 -0
- package/dist/lib/layout/wasm/artifact.js +5 -0
- package/dist/lib/layout/wasm/artifact.js.map +7 -0
- package/dist/lib/layout/wasm/bytes.d.ts +1 -0
- package/dist/lib/layout/wasm/bytes.js +5 -0
- package/dist/lib/layout/wasm/bytes.js.map +7 -0
- package/dist/lib/layout/wasm/embedded.d.ts +2 -0
- package/dist/lib/layout/wasm/embedded.js +12 -0
- package/dist/lib/layout/wasm/embedded.js.map +7 -0
- package/dist/lib/layout/wasm/layout.wasm +0 -0
- package/dist/lib/layout/wasm/module.d.ts +8 -0
- package/dist/lib/layout/wasm/module.js +70 -0
- package/dist/lib/layout/wasm/module.js.map +7 -0
- package/dist/lib/layout/wasm/region.d.ts +267 -0
- package/dist/lib/layout/wasm/region.js +1018 -0
- package/dist/lib/layout/wasm/region.js.map +7 -0
- package/dist/lib/manipulation/controller.js +4 -7
- package/dist/lib/manipulation/controller.js.map +2 -2
- package/dist/lib/manipulation/frame.js +1 -1
- package/dist/lib/manipulation/frame.js.map +2 -2
- package/dist/lib/manipulation/handles.js +32 -33
- package/dist/lib/manipulation/handles.js.map +2 -2
- package/dist/lib/manipulation/solve.js +12 -10
- package/dist/lib/manipulation/solve.js.map +2 -2
- package/dist/lib/mount-pibbl.js +1 -0
- package/dist/lib/mount-pibbl.js.map +2 -2
- package/dist/lib/mount-prepared-pibbl.d.ts +5 -0
- package/dist/lib/mount-prepared-pibbl.js +29 -0
- package/dist/lib/mount-prepared-pibbl.js.map +7 -0
- package/dist/lib/mount-request.d.ts +8 -0
- package/dist/lib/mount-request.js +41 -0
- package/dist/lib/mount-request.js.map +7 -0
- package/dist/lib/pibbl.d.ts +21 -13
- package/dist/lib/pibbl.js +18 -16
- package/dist/lib/pibbl.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-layer/controller.d.ts +9 -3
- package/dist/lib/render-layer/controller.js +259 -110
- package/dist/lib/render-layer/controller.js.map +2 -2
- package/dist/lib/render-transaction.d.ts +12 -2
- package/dist/lib/render-transaction.js +69 -1
- package/dist/lib/render-transaction.js.map +2 -2
- package/dist/lib/render.js +32 -8
- package/dist/lib/render.js.map +2 -2
- package/dist/lib/scheduler/realm-scheduler.d.ts +2 -0
- package/dist/lib/scheduler/realm-scheduler.js +55 -26
- package/dist/lib/scheduler/realm-scheduler.js.map +2 -2
- package/dist/lib/scheduler/renderer-participant.js +1 -0
- package/dist/lib/scheduler/renderer-participant.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/signals/edge.d.ts +7 -4
- package/dist/lib/signals/edge.js +25 -3
- package/dist/lib/signals/edge.js.map +2 -2
- package/dist/lib/signals/graph.d.ts +16 -2
- package/dist/lib/signals/graph.js +54 -12
- package/dist/lib/signals/graph.js.map +2 -2
- package/dist/lib/signals/input-provision.d.ts +15 -0
- package/dist/lib/signals/input-provision.js +53 -3
- package/dist/lib/signals/input-provision.js.map +2 -2
- package/dist/lib/signals/render-consumer.d.ts +3 -0
- package/dist/lib/signals/render-consumer.js +22 -14
- package/dist/lib/signals/render-consumer.js.map +2 -2
- package/dist/lib/style/positioning.d.ts +50 -2
- package/dist/lib/style/positioning.js +28 -4
- package/dist/lib/style/positioning.js.map +2 -2
- package/dist/lib/style/resolve-built-in.d.ts +4 -3
- package/dist/lib/style/resolve-built-in.js +17 -3
- package/dist/lib/style/resolve-built-in.js.map +2 -2
- package/dist/lib/style/resolve-dispatch.d.ts +3 -0
- package/dist/lib/style/resolve-dispatch.js +77 -4
- package/dist/lib/style/resolve-dispatch.js.map +2 -2
- package/dist/lib/style/resolve-length.d.ts +2 -0
- package/dist/lib/style/resolve-length.js +13 -9
- package/dist/lib/style/resolve-length.js.map +2 -2
- package/dist/lib/style/sizing-length.d.ts +51 -0
- package/dist/lib/style/sizing-length.js +77 -0
- package/dist/lib/style/sizing-length.js.map +7 -0
- package/dist/lib/style/types.d.ts +63 -25
- package/dist/lib/surface/root-surface.js +10 -6
- package/dist/lib/surface/root-surface.js.map +2 -2
- package/dist/lib/textures/texture.js +10 -8
- package/dist/lib/textures/texture.js.map +2 -2
- package/dist/lib/transitions/capture.js +4 -1
- package/dist/lib/transitions/capture.js.map +2 -2
- package/dist/lib/transitions/embers-physics.js +17 -10
- package/dist/lib/transitions/embers-physics.js.map +2 -2
- package/dist/lib/types.d.ts +110 -1
- package/dist/sync.d.ts +16 -0
- package/dist/sync.js +13 -0
- package/dist/sync.js.map +7 -0
- package/dist/sync.mjs +1 -0
- package/package.json +43 -6
- package/dist/features/viz/lib/scale.d.ts +0 -11
- package/dist/features/viz/lib/scale.js +0 -80
- package/dist/features/viz/lib/scale.js.map +0 -7
- package/dist/features/viz/lib/use-scale.d.ts +0 -20
- package/dist/features/viz/lib/use-scale.js +0 -10
- package/dist/features/viz/lib/use-scale.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/element/resolve-primitive-inputs.ts"],
|
|
4
|
-
"sourcesContent": ["import { resolveResponsiveStyle, preparedStyleValue, type ResponsiveStylePreparation, type QueryBasis } from '../style/responsive.js';\nimport {\n getPrimitiveProgramProps,\n getOpaquePrimitiveProps,\n getSpecifiedStyle,\n type PrimitiveDefinition,\n} from './metadata.js';\nimport type { PibblElement } from './types.js';\nimport {\n isSignal,\n recordPlainInputResolution,\n recordShallowInputCopy,\n recordSignalInputResolution,\n} from '../signals/graph.js';\n\nexport interface ResolvedPrimitiveInputs {\n readonly props: Readonly<Record<PropertyKey, unknown>>;\n readonly style: Readonly<Record<PropertyKey, unknown>> | undefined;\n}\n\nexport function resolvePrimitiveInputs(\n element: PibblElement<any>,\n definition: PrimitiveDefinition,\n prepared?: { style: Readonly<Record<PropertyKey, unknown>> },\n basis?: QueryBasis,\n): ResolvedPrimitiveInputs {\n const rawProps = getPrimitiveProgramProps(element) as Readonly<\n Record<PropertyKey, unknown>\n >;\n const preserve = definition.preserveSignalProps as\n readonly PropertyKey[] | undefined;\n let programProps: Record<PropertyKey, unknown> | undefined;\n\n for (const key in rawProps) {\n const value = rawProps[key];\n if (key === 'children' || preserve?.includes(key) || getOpaquePrimitiveProps(element.type)?.includes(key)) {\n if (programProps !== undefined) programProps[key] = value;\n continue;\n }\n if (isSignal(value)) {\n recordSignalInputResolution();\n if (programProps === undefined) {\n programProps = { ...rawProps };\n recordShallowInputCopy();\n }\n programProps[key] = value.get();\n } else {\n recordPlainInputResolution();\n if (programProps !== undefined) programProps[key] = value;\n }\n }\n\n return {\n props: programProps ?? rawProps,\n style: prepared ? prepared.style : resolvePrimitiveStyleInput(\n getSpecifiedStyle(element), element, basis, 'value',\n ),\n };\n}\n\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element: PibblElement<any> | undefined,\n basis: QueryBasis | undefined,\n mode: 'value',\n): Readonly<Record<PropertyKey, unknown>> | undefined;\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element?: PibblElement<any>,\n basis?: QueryBasis,\n): Readonly<Record<PropertyKey, unknown>> | ResponsiveStylePreparation | undefined;\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element?: PibblElement<any>,\n basis?: QueryBasis,\n mode: 'value' | 'preparation' = 'preparation',\n): Readonly<Record<PropertyKey, unknown>> | ResponsiveStylePreparation | undefined {\n let style = input;\n if (isSignal(style)) {\n recordSignalInputResolution();\n style = style.get();\n } else if (style !== undefined) {\n recordPlainInputResolution();\n }\n if (style === undefined) return undefined;\n if (style === null || typeof style !== 'object') {\n return style as Readonly<Record<PropertyKey, unknown>>;\n }\n\n const source = style as Readonly<Record<PropertyKey, unknown>>;\n if (source.when !== undefined) {\n const prepared = resolveResponsiveStyle(source, element, basis);\n return mode === 'value' ? preparedStyleValue(prepared) : prepared;\n }\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n if (key === 'custom') continue;\n const value = source[key];\n if (isSignal(value)) {\n recordSignalInputResolution();\n if (resolved === undefined) {\n resolved = { ...source };\n recordShallowInputCopy();\n }\n resolved[key] = value.get();\n } else {\n recordPlainInputResolution();\n }\n }\n return resolved ?? source;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,wBAAwB,0BAA4E;AAC7G;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOA,SAAS,uBACd,SACA,YACA,UACA,OACyB;AACzB,QAAM,WAAW,yBAAyB,OAAO;AAGjD,QAAM,WAAW,WAAW;AAE5B,MAAI;AAEJ,aAAW,OAAO,UAAU;AAC1B,UAAM,QAAQ,SAAS,GAAG;AAC1B,QAAI,QAAQ,cAAc,UAAU,SAAS,GAAG,KAAK,wBAAwB,QAAQ,IAAI,GAAG,SAAS,GAAG,GAAG;AACzG,UAAI,iBAAiB,OAAW,cAAa,GAAG,IAAI;AACpD;AAAA,IACF;AACA,QAAI,SAAS,KAAK,GAAG;AACnB,kCAA4B;AAC5B,UAAI,iBAAiB,QAAW;AAC9B,uBAAe,EAAE,GAAG,SAAS;AAC7B,+BAAuB;AAAA,MACzB;AACA,mBAAa,GAAG,IAAI,MAAM,IAAI;AAAA,
|
|
4
|
+
"sourcesContent": ["import { resolveResponsiveStyle, preparedStyleValue, type ResponsiveStylePreparation, type QueryBasis } from '../style/responsive.js';\nimport {\n getPrimitiveProgramProps,\n getOpaquePrimitiveProps,\n getSpecifiedStyle,\n type PrimitiveDefinition,\n} from './metadata.js';\nimport type { PibblElement } from './types.js';\nimport {\n isSignal,\n recordPlainInputResolution,\n recordShallowInputCopy,\n recordSignalInputResolution,\n withSignalDependencyRole,\n} from '../signals/graph.js';\n\nexport interface ResolvedPrimitiveInputs {\n readonly props: Readonly<Record<PropertyKey, unknown>>;\n readonly style: Readonly<Record<PropertyKey, unknown>> | undefined;\n}\n\nexport function resolvePrimitiveInputs(\n element: PibblElement<any>,\n definition: PrimitiveDefinition,\n prepared?: { style: Readonly<Record<PropertyKey, unknown>> },\n basis?: QueryBasis,\n): ResolvedPrimitiveInputs {\n const rawProps = getPrimitiveProgramProps(element) as Readonly<\n Record<PropertyKey, unknown>\n >;\n const preserve = definition.preserveSignalProps as\n readonly PropertyKey[] | undefined;\n let programProps: Record<PropertyKey, unknown> | undefined;\n\n for (const key in rawProps) {\n const value = rawProps[key];\n if (key === 'children' || preserve?.includes(key) || getOpaquePrimitiveProps(element.type)?.includes(key)) {\n if (programProps !== undefined) programProps[key] = value;\n continue;\n }\n if (isSignal(value)) {\n recordSignalInputResolution();\n if (programProps === undefined) {\n programProps = { ...rawProps };\n recordShallowInputCopy();\n }\n programProps[key] = key === 'pointerEvents' || key === 'keyboardFocusable' || key === 'keyboardNavigationBounds'\n ? withSignalDependencyRole('interaction', () => value.get()) : value.get();\n } else {\n recordPlainInputResolution();\n if (programProps !== undefined) programProps[key] = value;\n }\n }\n\n return {\n props: programProps ?? rawProps,\n style: prepared ? prepared.style : resolvePrimitiveStyleInput(\n getSpecifiedStyle(element), element, basis, 'value',\n ),\n };\n}\n\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element: PibblElement<any> | undefined,\n basis: QueryBasis | undefined,\n mode: 'value',\n): Readonly<Record<PropertyKey, unknown>> | undefined;\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element?: PibblElement<any>,\n basis?: QueryBasis,\n): Readonly<Record<PropertyKey, unknown>> | ResponsiveStylePreparation | undefined;\nexport function resolvePrimitiveStyleInput(\n input: unknown,\n element?: PibblElement<any>,\n basis?: QueryBasis,\n mode: 'value' | 'preparation' = 'preparation',\n): Readonly<Record<PropertyKey, unknown>> | ResponsiveStylePreparation | undefined {\n let style = input;\n if (isSignal(style)) {\n recordSignalInputResolution();\n style = style.get();\n } else if (style !== undefined) {\n recordPlainInputResolution();\n }\n if (style === undefined) return undefined;\n if (style === null || typeof style !== 'object') {\n return style as Readonly<Record<PropertyKey, unknown>>;\n }\n\n const source = style as Readonly<Record<PropertyKey, unknown>>;\n if (source.when !== undefined) {\n const prepared = resolveResponsiveStyle(source, element, basis);\n return mode === 'value' ? preparedStyleValue(prepared) : prepared;\n }\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n if (key === 'custom') continue;\n const value = source[key];\n if (isSignal(value)) {\n recordSignalInputResolution();\n if (resolved === undefined) {\n resolved = { ...source };\n recordShallowInputCopy();\n }\n resolved[key] = withSignalDependencyRole(\n styleInputRole(key),\n () => value.get(),\n );\n } else {\n recordPlainInputResolution();\n }\n }\n return resolved ?? source;\n}\n\n/** @internal Shared receiver input roles for numeric allocation comparisons. */\nexport function styleInputRole(\n key: string,\n): 'layout' | 'measurement' | 'paint' | 'interaction' | 'transform' | 'unknown' {\n if (key === 'fill' || key === 'stroke' || key === 'strokeWidth' || key === 'opacity' || key === 'filter') return 'paint';\n if (key === 'translateX' || key === 'translateY' || key === 'scaleX' || key === 'scaleY' || key === 'rotationDegrees' || key === 'rotationOrigin' || key === 'skewX' || key === 'skewY') return 'transform';\n if (key === 'cursor' || key === 'pointerEvents' || key === 'lineInteractionWidth') return 'interaction';\n if (key === 'font' || key === 'textBaseline' || key === 'textAlign' || key === 'lineHeight' || key === 'wrap' || key === 'fit') return 'measurement';\n if (key === 'layoutParticipation' || key === 'gridAutoFlow' || key === 'gridAutoColumns' || key === 'gridAutoRows' || key === 'gridTemplateColumns' || key === 'gridTemplateRows' || key === 'gridColumnStart' || key === 'gridColumnSpan' || key === 'gridRowStart' || key === 'gridRowSpan' || key === 'aspectRatio' || key === 'borderWidth' || key === 'borderStartWidth' || key === 'borderEndWidth' || key === 'boxSizing' || key === 'width' || key === 'height' || key === 'minWidth' || key === 'minHeight' || key === 'maxWidth' || key === 'maxHeight' || key === 'position' || key === 'left' || key === 'right' || key === 'top' || key === 'bottom' || key === 'insetStart' || key === 'insetEnd' || key === 'flexBasis' || key === 'flexGrow' || key === 'flexShrink' || key === 'layoutDirection' || key === 'flexDirection' || key === 'flexWrap' || key === 'justifyContent' || key === 'alignItems' || key === 'alignSelf' || key === 'alignContent' || key === 'gap' || key === 'rowGap' || key === 'columnGap' || key === 'padding' || key === 'paddingStart' || key === 'paddingEnd' || key === 'margin' || key === 'marginTop' || key === 'marginRight' || key === 'marginBottom' || key === 'marginLeft' || key === 'marginStart' || key === 'marginEnd') return 'layout';\n return 'unknown';\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,7 +12,25 @@ export interface CreatePibblEventInput<K extends PibblEventType> {
|
|
|
12
12
|
readonly x?: number;
|
|
13
13
|
/** Root-logical coordinate supplied by the family adapter. */
|
|
14
14
|
readonly y?: number;
|
|
15
|
+
/** HtmlBox border-local coordinates, fixed across the logical path. */
|
|
16
|
+
readonly localX?: number;
|
|
17
|
+
readonly localY?: number;
|
|
18
|
+
/** Native host paths preserve the original DOM bubbling flag. */
|
|
19
|
+
readonly nativeBubbles?: boolean;
|
|
15
20
|
}
|
|
21
|
+
/** Private opt-in dispatch ownership; ordinary events allocate no resource map.
|
|
22
|
+
* @param event - The currently dispatched logical event.
|
|
23
|
+
* @param key - Identity of this optional integration resource.
|
|
24
|
+
* @param create - Lazy initializer with an exact dispatch-end disposer.
|
|
25
|
+
* @returns Shared resource for this logical dispatch.
|
|
26
|
+
* @see {@link PibblEvent}
|
|
27
|
+
*/
|
|
28
|
+
export declare function borrowDispatchResource<T>(event: PibblEvent, key: object, create: () => {
|
|
29
|
+
value: T;
|
|
30
|
+
dispose: () => void;
|
|
31
|
+
}): T;
|
|
32
|
+
/** Releases optional synchronous resources even when a handler fails. */
|
|
33
|
+
export declare function finishEventDispatch(event: PibblEvent): void;
|
|
16
34
|
export declare function createPibblEvent<K extends PibblEventType>(input: CreatePibblEventInput<K>): PibblEventMap[K];
|
|
17
35
|
export declare function setPibblEventInvocation(event: PibblEvent, currentTarget: PibblEventTarget, eventPhase: PibblEventPhase): void;
|
|
18
36
|
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;
|
|
@@ -20,7 +41,7 @@ function createPibblEvent(input) {
|
|
|
20
41
|
type: input.type,
|
|
21
42
|
target: input.target.publicTarget,
|
|
22
43
|
relatedTarget: input.relatedTarget?.publicTarget ?? null,
|
|
23
|
-
bubbles: definition.bubbles,
|
|
44
|
+
bubbles: input.nativeBubbles ?? definition.bubbles,
|
|
24
45
|
cancelable,
|
|
25
46
|
timeStamp: originalEvent.timeStamp,
|
|
26
47
|
originalEvent,
|
|
@@ -32,7 +53,7 @@ function createPibblEvent(input) {
|
|
|
32
53
|
return state.eventPhase;
|
|
33
54
|
},
|
|
34
55
|
get defaultPrevented() {
|
|
35
|
-
return state.defaultPrevented;
|
|
56
|
+
return state.defaultPrevented || originalEvent.defaultPrevented;
|
|
36
57
|
},
|
|
37
58
|
composedPath() {
|
|
38
59
|
return publicPath;
|
|
@@ -81,6 +102,9 @@ function projectFamilyFields(facade, definition, input) {
|
|
|
81
102
|
const original = input.originalEvent;
|
|
82
103
|
if (definition.coordinate) {
|
|
83
104
|
Object.assign(facade, { x: input.x ?? 0, y: input.y ?? 0 });
|
|
105
|
+
if (input.localX !== void 0 && input.localY !== void 0) {
|
|
106
|
+
Object.assign(facade, { localX: input.localX, localY: input.localY });
|
|
107
|
+
}
|
|
84
108
|
}
|
|
85
109
|
switch (definition.family) {
|
|
86
110
|
case "pointer":
|
|
@@ -180,7 +204,9 @@ function pick(value, keys) {
|
|
|
180
204
|
return result;
|
|
181
205
|
}
|
|
182
206
|
export {
|
|
207
|
+
borrowDispatchResource,
|
|
183
208
|
createPibblEvent,
|
|
209
|
+
finishEventDispatch,
|
|
184
210
|
isPibblImmediatePropagationStopped,
|
|
185
211
|
isPibblPropagationStopped,
|
|
186
212
|
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 /** HtmlBox border-local coordinates, fixed across the logical path. */\n readonly localX?: number;\n readonly localY?: number;\n /** Native host paths preserve the original DOM bubbling flag. */\n readonly nativeBubbles?: boolean;\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: input.nativeBubbles ?? 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 || originalEvent.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 if (input.localX !== undefined && input.localY !== undefined) {\n Object.assign(facade, { localX: input.localX, localY: input.localY });\n }\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": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { committedLayoutPaintEntries } from "../layout/geometry-publication.js";
|
|
1
2
|
import { isHit } from "../util/is-hit.js";
|
|
2
3
|
import {
|
|
3
4
|
PibblHitDisposition,
|
|
@@ -37,7 +38,7 @@ function resolveCoordinateOutput(eventRoot, point) {
|
|
|
37
38
|
return output;
|
|
38
39
|
}
|
|
39
40
|
function resolveInstanceHit(eventRoot, instance, canvas, rootX, rootY, transform, output) {
|
|
40
|
-
const entries = Array.from(instance.paintEntries);
|
|
41
|
+
const entries = committedLayoutPaintEntries(instance) ?? Array.from(instance.paintEntries);
|
|
41
42
|
for (let index = entries.length - 1; index >= 0; index--) {
|
|
42
43
|
const entry = entries[index];
|
|
43
44
|
reset(output);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/events/hit-test.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PibblClippingStackEntry, PibblEventRoot, PibblInstance } from '../types.js';\nimport { isHit } from '../util/is-hit.js';\nimport {\n PibblHitDisposition,\n PibblPaintEntryKind,\n hitTestScratchFactory,\n type PibblHitTestInput,\n type PibblHitTestOutput,\n type PibblPathPaintEntry,\n} from './paint-entry.js';\nimport type { PibblEventTargetRegistration } from './registrations.js';\n\nexport interface PibblCoordinatePoint {\n readonly x: number;\n readonly y: number;\n}\n\n/** Resolves one paint entry in reverse global paint order without allocating. */\nexport function resolveCoordinateHit(\n eventRoot: PibblEventRoot,\n input: PibblHitTestInput,\n output: PibblHitTestOutput,\n): PibblHitTestOutput {\n const instance = eventRoot.rootInstance;\n const canvas = eventRoot.canvas;\n reset(output);\n if (!instance || !canvas || !instance.surface.snapshot) return output;\n return resolveInstanceHit(\n eventRoot,\n instance,\n canvas,\n input.rootX,\n input.rootY,\n new DOMMatrix(),\n output,\n );\n}\n\n/** Compatibility wrapper for coordinate event dispatch. */\nexport function resolveCoordinateTarget(\n eventRoot: PibblEventRoot,\n point: PibblCoordinatePoint,\n): PibblEventTargetRegistration | undefined {\n const output = resolveCoordinateOutput(eventRoot, point);\n return output.disposition === PibblHitDisposition.Target ?\n output.target ?? undefined :\n undefined;\n}\n\n/** Borrows the root scratch result for immediate coordinate dispatch. */\nexport function resolveCoordinateOutput(\n eventRoot: PibblEventRoot,\n point: PibblCoordinatePoint,\n): PibblHitTestOutput {\n let input = eventRoot.coordinateHitInput;\n let output = eventRoot.coordinateHitOutput;\n if (!input || !output) {\n const scratch = hitTestScratchFactory.create();\n input = eventRoot.coordinateHitInput = scratch.input;\n output = eventRoot.coordinateHitOutput = scratch.output;\n }\n input.rootX = point.x;\n input.rootY = point.y;\n resolveCoordinateHit(eventRoot, input, output);\n return output;\n}\n\nfunction resolveInstanceHit(\n eventRoot: PibblEventRoot,\n instance: PibblInstance,\n canvas: HTMLCanvasElement,\n rootX: number,\n rootY: number,\n transform: DOMMatrix,\n output: PibblHitTestOutput,\n): PibblHitTestOutput {\n const entries = Array.from(instance.paintEntries);\n for (let index = entries.length - 1; index >= 0; index--) {\n const entry = entries[index]!;\n reset(output);\n switch (entry.paintKind) {\n case PibblPaintEntryKind.Path:\n resolvePathHit(eventRoot, canvas, entry, rootX, rootY, transform, output);\n break;\n case PibblPaintEntryKind.NestedInstance:\n case PibblPaintEntryKind.Resolver: {\n if (entry.instance.mainTeardowns.closed) continue;\n const childTransform = multiplyTransforms(transform, entry.transform);\n const boundaryClippingStack = composeClippingStack(\n entry.clippingStack,\n transform,\n );\n if (!isHit({\n canvas,\n path: entry.bounds,\n transform: childTransform,\n x: rootX,\n y: rootY,\n fill: true,\n lineInteractionWidth: 0,\n currentClippingStack: boundaryClippingStack,\n })) break;\n try {\n if (entry.paintKind === PibblPaintEntryKind.NestedInstance) {\n resolveInstanceHit(\n eventRoot,\n entry.instance,\n canvas,\n rootX,\n rootY,\n childTransform,\n output,\n );\n } else if (entry.resolveLocal) {\n const local = childTransform.inverse().transformPoint(\n new DOMPoint(rootX, rootY),\n );\n entry.resolveLocal(local.x, local.y, output);\n }\n } finally {\n // Child clipping and local coordinates are stack-local to this call.\n }\n break;\n }\n }\n if (output.disposition !== PibblHitDisposition.Miss) return output;\n }\n return output;\n}\n\nfunction resolvePathHit(\n eventRoot: PibblEventRoot,\n canvas: HTMLCanvasElement,\n entry: PibblPathPaintEntry,\n rootX: number,\n rootY: number,\n transform: DOMMatrix,\n output: PibblHitTestOutput,\n): void {\n const target = entry.target;\n if (!isLiveTarget(eventRoot, target)) return;\n if (isHit({\n canvas,\n path: entry.path,\n transform: multiplyTransforms(transform, entry.transform),\n x: rootX,\n y: rootY,\n fill: entry.fill,\n lineInteractionWidth: entry.lineInteractionWidth,\n currentClippingStack: composeClippingStack(entry.clippingStack, transform),\n })) {\n output.disposition = PibblHitDisposition.Target;\n output.target = target;\n }\n}\n\nfunction reset(output: PibblHitTestOutput): void {\n output.disposition = PibblHitDisposition.Miss;\n output.target = null;\n delete output.winner;\n delete output.winnerState;\n}\n\nfunction isLiveTarget(\n eventRoot: PibblEventRoot,\n target: PibblEventTargetRegistration,\n): boolean {\n return target.live &&\n !target.owner.mainTeardowns.closed &&\n target.owner.eventRoot === eventRoot &&\n eventRoot.targets.has(target);\n}\n\nfunction composeClippingStack(\n clippingStack: readonly PibblClippingStackEntry[],\n transform: DOMMatrix,\n): readonly PibblClippingStackEntry[] {\n if (clippingStack.length === 0 || transform.isIdentity) return clippingStack;\n return clippingStack.map(entry => ({\n ...entry,\n transform: multiplyTransforms(transform, entry.transform),\n }));\n}\n\nfunction multiplyTransforms(parent: DOMMatrix, child: DOMMatrix): DOMMatrix {\n if (parent.isIdentity) return child;\n if (child.isIdentity) return parent;\n return parent.multiply(child);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { committedLayoutPaintEntries } from '../layout/geometry-publication.js';\nimport type { PibblClippingStackEntry, PibblEventRoot, PibblInstance } from '../types.js';\nimport { isHit } from '../util/is-hit.js';\nimport {\n PibblHitDisposition,\n PibblPaintEntryKind,\n hitTestScratchFactory,\n type PibblHitTestInput,\n type PibblHitTestOutput,\n type PibblPathPaintEntry,\n} from './paint-entry.js';\nimport type { PibblEventTargetRegistration } from './registrations.js';\n\nexport interface PibblCoordinatePoint {\n readonly x: number;\n readonly y: number;\n}\n\n/** Resolves one paint entry in reverse global paint order without allocating. */\nexport function resolveCoordinateHit(\n eventRoot: PibblEventRoot,\n input: PibblHitTestInput,\n output: PibblHitTestOutput,\n): PibblHitTestOutput {\n const instance = eventRoot.rootInstance;\n const canvas = eventRoot.canvas;\n reset(output);\n if (!instance || !canvas || !instance.surface.snapshot) return output;\n return resolveInstanceHit(\n eventRoot,\n instance,\n canvas,\n input.rootX,\n input.rootY,\n new DOMMatrix(),\n output,\n );\n}\n\n/** Compatibility wrapper for coordinate event dispatch. */\nexport function resolveCoordinateTarget(\n eventRoot: PibblEventRoot,\n point: PibblCoordinatePoint,\n): PibblEventTargetRegistration | undefined {\n const output = resolveCoordinateOutput(eventRoot, point);\n return output.disposition === PibblHitDisposition.Target ?\n output.target ?? undefined :\n undefined;\n}\n\n/** Borrows the root scratch result for immediate coordinate dispatch. */\nexport function resolveCoordinateOutput(\n eventRoot: PibblEventRoot,\n point: PibblCoordinatePoint,\n): PibblHitTestOutput {\n let input = eventRoot.coordinateHitInput;\n let output = eventRoot.coordinateHitOutput;\n if (!input || !output) {\n const scratch = hitTestScratchFactory.create();\n input = eventRoot.coordinateHitInput = scratch.input;\n output = eventRoot.coordinateHitOutput = scratch.output;\n }\n input.rootX = point.x;\n input.rootY = point.y;\n resolveCoordinateHit(eventRoot, input, output);\n return output;\n}\n\nfunction resolveInstanceHit(\n eventRoot: PibblEventRoot,\n instance: PibblInstance,\n canvas: HTMLCanvasElement,\n rootX: number,\n rootY: number,\n transform: DOMMatrix,\n output: PibblHitTestOutput,\n): PibblHitTestOutput {\n const entries = committedLayoutPaintEntries(instance) ?? Array.from(instance.paintEntries);\n for (let index = entries.length - 1; index >= 0; index--) {\n const entry = entries[index]!;\n reset(output);\n switch (entry.paintKind) {\n case PibblPaintEntryKind.Path:\n resolvePathHit(eventRoot, canvas, entry, rootX, rootY, transform, output);\n break;\n case PibblPaintEntryKind.NestedInstance:\n case PibblPaintEntryKind.Resolver: {\n if (entry.instance.mainTeardowns.closed) continue;\n const childTransform = multiplyTransforms(transform, entry.transform);\n const boundaryClippingStack = composeClippingStack(\n entry.clippingStack,\n transform,\n );\n if (!isHit({\n canvas,\n path: entry.bounds,\n transform: childTransform,\n x: rootX,\n y: rootY,\n fill: true,\n lineInteractionWidth: 0,\n currentClippingStack: boundaryClippingStack,\n })) break;\n try {\n if (entry.paintKind === PibblPaintEntryKind.NestedInstance) {\n resolveInstanceHit(\n eventRoot,\n entry.instance,\n canvas,\n rootX,\n rootY,\n childTransform,\n output,\n );\n } else if (entry.resolveLocal) {\n const local = childTransform.inverse().transformPoint(\n new DOMPoint(rootX, rootY),\n );\n entry.resolveLocal(local.x, local.y, output);\n }\n } finally {\n // Child clipping and local coordinates are stack-local to this call.\n }\n break;\n }\n }\n if (output.disposition !== PibblHitDisposition.Miss) return output;\n }\n return output;\n}\n\nfunction resolvePathHit(\n eventRoot: PibblEventRoot,\n canvas: HTMLCanvasElement,\n entry: PibblPathPaintEntry,\n rootX: number,\n rootY: number,\n transform: DOMMatrix,\n output: PibblHitTestOutput,\n): void {\n const target = entry.target;\n if (!isLiveTarget(eventRoot, target)) return;\n if (isHit({\n canvas,\n path: entry.path,\n transform: multiplyTransforms(transform, entry.transform),\n x: rootX,\n y: rootY,\n fill: entry.fill,\n lineInteractionWidth: entry.lineInteractionWidth,\n currentClippingStack: composeClippingStack(entry.clippingStack, transform),\n })) {\n output.disposition = PibblHitDisposition.Target;\n output.target = target;\n }\n}\n\nfunction reset(output: PibblHitTestOutput): void {\n output.disposition = PibblHitDisposition.Miss;\n output.target = null;\n delete output.winner;\n delete output.winnerState;\n}\n\nfunction isLiveTarget(\n eventRoot: PibblEventRoot,\n target: PibblEventTargetRegistration,\n): boolean {\n return target.live &&\n !target.owner.mainTeardowns.closed &&\n target.owner.eventRoot === eventRoot &&\n eventRoot.targets.has(target);\n}\n\nfunction composeClippingStack(\n clippingStack: readonly PibblClippingStackEntry[],\n transform: DOMMatrix,\n): readonly PibblClippingStackEntry[] {\n if (clippingStack.length === 0 || transform.isIdentity) return clippingStack;\n return clippingStack.map(entry => ({\n ...entry,\n transform: multiplyTransforms(transform, entry.transform),\n }));\n}\n\nfunction multiplyTransforms(parent: DOMMatrix, child: DOMMatrix): DOMMatrix {\n if (parent.isIdentity) return child;\n if (child.isIdentity) return parent;\n return parent.multiply(child);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type CreatePibblEventInput } from './event-facade.js';
|
|
2
2
|
import type { PibblEventNode } from './registrations.js';
|
|
3
|
-
import type { PibblEventMap, PibblEventType } from './types.js';
|
|
3
|
+
import type { PibblEvent, PibblEventMap, PibblEventPhase, PibblEventType } from './types.js';
|
|
4
4
|
export interface DispatchEventPathInput<K extends PibblEventType> extends Omit<CreatePibblEventInput<K>, 'path'> {
|
|
5
5
|
readonly target: PibblEventNode;
|
|
6
6
|
}
|
|
7
7
|
export declare function dispatchEventPath<K extends PibblEventType>(input: DispatchEventPathInput<K>): PibblEventMap[K];
|
|
8
|
+
export declare function invokePibblEventHandler(node: PibblEventNode, type: PibblEventType, capture: boolean, phase: PibblEventPhase, event: PibblEvent): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getPibblEventDefinition } from "./event-definitions.js";
|
|
2
2
|
import {
|
|
3
3
|
createPibblEvent,
|
|
4
|
+
finishEventDispatch,
|
|
4
5
|
isPibblImmediatePropagationStopped,
|
|
5
6
|
isPibblPropagationStopped,
|
|
6
7
|
setPibblEventInvocation
|
|
@@ -14,25 +15,29 @@ function dispatchEventPath(input) {
|
|
|
14
15
|
const path = buildEventPath(input.target);
|
|
15
16
|
const event = createPibblEvent({ ...input, path });
|
|
16
17
|
const targetIndex = path.length - 1;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
invoke(path[index], input.type, true, 1, event);
|
|
20
|
-
}
|
|
21
|
-
if (!isPibblPropagationStopped(event) && input.target.live) {
|
|
22
|
-
invoke(input.target, input.type, true, 2, event);
|
|
23
|
-
if (!isPibblImmediatePropagationStopped(event)) {
|
|
24
|
-
invoke(input.target, input.type, false, 2, event);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (definition.bubbles && !isPibblPropagationStopped(event)) {
|
|
28
|
-
for (let index = targetIndex - 1; index >= 0; index--) {
|
|
18
|
+
try {
|
|
19
|
+
for (let index = 0; index < targetIndex; index++) {
|
|
29
20
|
if (isPibblPropagationStopped(event)) break;
|
|
30
|
-
|
|
21
|
+
invokePibblEventHandler(path[index], input.type, true, 1, event);
|
|
22
|
+
}
|
|
23
|
+
if (!isPibblPropagationStopped(event) && input.target.live) {
|
|
24
|
+
invokePibblEventHandler(input.target, input.type, true, 2, event);
|
|
25
|
+
if (!isPibblImmediatePropagationStopped(event)) {
|
|
26
|
+
invokePibblEventHandler(input.target, input.type, false, 2, event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (definition.bubbles && !isPibblPropagationStopped(event)) {
|
|
30
|
+
for (let index = targetIndex - 1; index >= 0; index--) {
|
|
31
|
+
if (isPibblPropagationStopped(event)) break;
|
|
32
|
+
invokePibblEventHandler(path[index], input.type, false, 3, event);
|
|
33
|
+
}
|
|
31
34
|
}
|
|
35
|
+
return event;
|
|
36
|
+
} finally {
|
|
37
|
+
finishEventDispatch(event);
|
|
32
38
|
}
|
|
33
|
-
return event;
|
|
34
39
|
}
|
|
35
|
-
function
|
|
40
|
+
function invokePibblEventHandler(node, type, capture, phase, event) {
|
|
36
41
|
if (!node.live) return;
|
|
37
42
|
const key = capture ? `${type}Capture` : type;
|
|
38
43
|
const handler = node.handlers[key];
|
|
@@ -51,6 +56,7 @@ function reportDispatchError(error) {
|
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
export {
|
|
54
|
-
dispatchEventPath
|
|
59
|
+
dispatchEventPath,
|
|
60
|
+
invokePibblEventHandler
|
|
55
61
|
};
|
|
56
62
|
//# sourceMappingURL=propagation.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/events/propagation.ts"],
|
|
4
|
-
"sourcesContent": ["import { getPibblEventDefinition } from './event-definitions.js';\nimport {\n createPibblEvent,\n isPibblImmediatePropagationStopped,\n isPibblPropagationStopped,\n setPibblEventInvocation,\n type CreatePibblEventInput,\n} from './event-facade.js';\nimport { buildEventPath } from './event-path.js';\nimport type {\n PibblEventNode,\n PibblNormalizedHandlers,\n} from './registrations.js';\nimport type {\n PibblEvent,\n PibblEventMap,\n PibblEventPhase,\n PibblEventType,\n} from './types.js';\n\nexport interface DispatchEventPathInput<K extends PibblEventType>\n extends Omit<CreatePibblEventInput<K>, 'path'> {\n readonly target: PibblEventNode;\n}\n\ntype PibblNormalizedCaptureKey = `${PibblEventType}Capture`;\n\nexport function dispatchEventPath<K extends PibblEventType>(\n input: DispatchEventPathInput<K>,\n): PibblEventMap[K] {\n const definition = getPibblEventDefinition(input.type);\n if (!definition) {\n throw new Error(`Unsupported Pibbl event type: ${input.type}`);\n }\n const path = buildEventPath(input.target);\n const event = createPibblEvent({ ...input, path });\n const targetIndex = path.length - 1;\n\n for (let index = 0; index < targetIndex; index++) {\n if (isPibblPropagationStopped(event)) break;\n
|
|
5
|
-
"mappings": "AAAA,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,sBAAsB;AAmBxB,SAAS,kBACd,OACkB;AAClB,QAAM,aAAa,wBAAwB,MAAM,IAAI;AACrD,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,MAAM,iCAAiC,MAAM,IAAI,EAAE;AAAA,EAC/D;AACA,QAAM,OAAO,eAAe,MAAM,MAAM;AACxC,QAAM,QAAQ,iBAAiB,EAAE,GAAG,OAAO,KAAK,CAAC;AACjD,QAAM,cAAc,KAAK,SAAS;
|
|
4
|
+
"sourcesContent": ["import { getPibblEventDefinition } from './event-definitions.js';\nimport {\n createPibblEvent,\n finishEventDispatch,\n isPibblImmediatePropagationStopped,\n isPibblPropagationStopped,\n setPibblEventInvocation,\n type CreatePibblEventInput,\n} from './event-facade.js';\nimport { buildEventPath } from './event-path.js';\nimport type {\n PibblEventNode,\n PibblNormalizedHandlers,\n} from './registrations.js';\nimport type {\n PibblEvent,\n PibblEventMap,\n PibblEventPhase,\n PibblEventType,\n} from './types.js';\n\nexport interface DispatchEventPathInput<K extends PibblEventType>\n extends Omit<CreatePibblEventInput<K>, 'path'> {\n readonly target: PibblEventNode;\n}\n\ntype PibblNormalizedCaptureKey = `${PibblEventType}Capture`;\n\nexport function dispatchEventPath<K extends PibblEventType>(\n input: DispatchEventPathInput<K>,\n): PibblEventMap[K] {\n const definition = getPibblEventDefinition(input.type);\n if (!definition) {\n throw new Error(`Unsupported Pibbl event type: ${input.type}`);\n }\n const path = buildEventPath(input.target);\n const event = createPibblEvent({ ...input, path });\n const targetIndex = path.length - 1;\n try {\n for (let index = 0; index < targetIndex; index++) {\n if (isPibblPropagationStopped(event)) break;\n invokePibblEventHandler(path[index], input.type, true, 1, event);\n }\n\n if (!isPibblPropagationStopped(event) && input.target.live) {\n invokePibblEventHandler(input.target, input.type, true, 2, event);\n if (!isPibblImmediatePropagationStopped(event)) {\n invokePibblEventHandler(input.target, input.type, false, 2, event);\n }\n }\n\n if (definition.bubbles && !isPibblPropagationStopped(event)) {\n for (let index = targetIndex - 1; index >= 0; index--) {\n if (isPibblPropagationStopped(event)) break;\n invokePibblEventHandler(path[index], input.type, false, 3, event);\n }\n }\n\n return event;\n } finally { finishEventDispatch(event); }\n}\n\nexport function invokePibblEventHandler(\n node: PibblEventNode,\n type: PibblEventType,\n capture: boolean,\n phase: PibblEventPhase,\n event: PibblEvent,\n): void {\n if (!node.live) return;\n const key = capture ? `${type}Capture` as PibblNormalizedCaptureKey : type;\n const handler = node.handlers[key as keyof PibblNormalizedHandlers];\n if (!handler) return;\n setPibblEventInvocation(event, node.publicTarget, phase);\n try {\n (handler as (event: PibblEvent) => void)(event);\n } catch (error) {\n reportDispatchError(error);\n }\n}\n\nfunction reportDispatchError(error: unknown): void {\n try {\n globalThis.reportError(error);\n } catch {\n // Reporting cannot suppress unrelated handlers in this logical dispatch.\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,sBAAsB;AAmBxB,SAAS,kBACd,OACkB;AAClB,QAAM,aAAa,wBAAwB,MAAM,IAAI;AACrD,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,MAAM,iCAAiC,MAAM,IAAI,EAAE;AAAA,EAC/D;AACA,QAAM,OAAO,eAAe,MAAM,MAAM;AACxC,QAAM,QAAQ,iBAAiB,EAAE,GAAG,OAAO,KAAK,CAAC;AACjD,QAAM,cAAc,KAAK,SAAS;AAClC,MAAI;AACJ,aAAS,QAAQ,GAAG,QAAQ,aAAa,SAAS;AAChD,UAAI,0BAA0B,KAAK,EAAG;AACtC,8BAAwB,KAAK,KAAK,GAAG,MAAM,MAAM,MAAM,GAAG,KAAK;AAAA,IACjE;AAEA,QAAI,CAAC,0BAA0B,KAAK,KAAK,MAAM,OAAO,MAAM;AAC1D,8BAAwB,MAAM,QAAQ,MAAM,MAAM,MAAM,GAAG,KAAK;AAChE,UAAI,CAAC,mCAAmC,KAAK,GAAG;AAC9C,gCAAwB,MAAM,QAAQ,MAAM,MAAM,OAAO,GAAG,KAAK;AAAA,MACnE;AAAA,IACF;AAEA,QAAI,WAAW,WAAW,CAAC,0BAA0B,KAAK,GAAG;AAC3D,eAAS,QAAQ,cAAc,GAAG,SAAS,GAAG,SAAS;AACrD,YAAI,0BAA0B,KAAK,EAAG;AACtC,gCAAwB,KAAK,KAAK,GAAG,MAAM,MAAM,OAAO,GAAG,KAAK;AAAA,MAClE;AAAA,IACF;AAEA,WAAO;AAAA,EACP,UAAE;AAAU,wBAAoB,KAAK;AAAA,EAAG;AAC1C;AAEO,SAAS,wBACd,MACA,MACA,SACA,OACA,OACM;AACN,MAAI,CAAC,KAAK,KAAM;AAChB,QAAM,MAAM,UAAU,GAAG,IAAI,YAAyC;AACtE,QAAM,UAAU,KAAK,SAAS,GAAoC;AAClE,MAAI,CAAC,QAAS;AACd,0BAAwB,OAAO,KAAK,cAAc,KAAK;AACvD,MAAI;AACF,IAAC,QAAwC,KAAK;AAAA,EAChD,SAAS,OAAO;AACd,wBAAoB,KAAK;AAAA,EAC3B;AACF;AAEA,SAAS,oBAAoB,OAAsB;AACjD,MAAI;AACF,eAAW,YAAY,KAAK;AAAA,EAC9B,QAAQ;AAAA,EAER;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -20,6 +20,8 @@ export type PibblNormalizedHandlers = Partial<{
|
|
|
20
20
|
* @see {@link isBackendEventTargetLive}
|
|
21
21
|
*/
|
|
22
22
|
export interface PibblEventTargetRegistration {
|
|
23
|
+
/** @internal Withdraws published interaction while preserving mount-owned resources. */
|
|
24
|
+
suspendLayout(): void;
|
|
23
25
|
/** Selects the kind of geometry, material, or result. See {@link PibblEventTargetRegistration}. */
|
|
24
26
|
readonly kind: "target";
|
|
25
27
|
/** Mount or runtime resource owning this registration. See {@link PibblInstance}. */
|
|
@@ -87,6 +89,8 @@ export interface PibblEventTargetRegistration {
|
|
|
87
89
|
live: boolean;
|
|
88
90
|
}
|
|
89
91
|
export interface PibblEventListenerRegistration {
|
|
92
|
+
/** @internal Withdraws listeners while preserving mount-owned resources. */
|
|
93
|
+
suspendLayout(): void;
|
|
90
94
|
readonly kind: "listener";
|
|
91
95
|
readonly owner: PibblInstance;
|
|
92
96
|
readonly component: PibblComponentRefs<any>;
|
|
@@ -106,6 +110,12 @@ export interface PibblEventListenerRegistration {
|
|
|
106
110
|
}
|
|
107
111
|
export type PibblEventNode = PibblEventTargetRegistration | PibblEventListenerRegistration;
|
|
108
112
|
export declare function createTarget(owner: PibblInstance, component: PibblComponentRefs<any>, slot: number): PibblEventTargetRegistration;
|
|
113
|
+
/** Prepared external registrations acquire fallible native leases before adoption. */
|
|
114
|
+
export declare function prepareTargetUpdate(target: PibblEventTargetRegistration, handlers: PibblEventHandlers, options: PibblEventTargetOptions, transform: DOMMatrix, clippingStack: PibblPathPaintEntry['clippingStack']): {
|
|
115
|
+
adopt(): void;
|
|
116
|
+
finish(): void;
|
|
117
|
+
notify(): void;
|
|
118
|
+
};
|
|
109
119
|
export declare function updateTarget(target: PibblEventTargetRegistration, handlers: PibblEventHandlers, options: PibblEventTargetOptions, participatesInPaint?: boolean, preserveKeyboardNavigationGeometry?: boolean): void;
|
|
110
120
|
export declare function updateCursorTarget(target: PibblEventTargetRegistration, { path, fill, lineInteractionWidth, cursor, }: {
|
|
111
121
|
path: Path2D | PathGeometry;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { releaseLayoutTargetGeometry } from "../layout/geometry-publication.js";
|
|
2
|
+
import { registerLayoutSuspensionResource, unregisterLayoutSuspensionResource, isLayoutComponentSuspended, isLayoutInstanceSuspended } from "../layout/participation.js";
|
|
1
3
|
import { PIBBL_EVENT_DEFINITIONS } from "./event-definitions.js";
|
|
2
4
|
import { GLOBAL_STATE } from "../global-state.js";
|
|
3
5
|
import { resolvePath } from "../geometry/resolve-path.js";
|
|
@@ -15,6 +17,7 @@ function createTarget(owner, component, slot) {
|
|
|
15
17
|
const publicTarget = createPublicTarget(() => target);
|
|
16
18
|
Object.assign(target, {
|
|
17
19
|
kind: "target",
|
|
20
|
+
suspendLayout: suspendTargetLayout,
|
|
18
21
|
owner,
|
|
19
22
|
component,
|
|
20
23
|
slot,
|
|
@@ -33,8 +36,109 @@ function createTarget(owner, component, slot) {
|
|
|
33
36
|
keyboardNavigationPoints: void 0,
|
|
34
37
|
live: false
|
|
35
38
|
});
|
|
39
|
+
registerLayoutSuspensionResource(component, target);
|
|
36
40
|
return target;
|
|
37
41
|
}
|
|
42
|
+
function prepareTargetUpdate(target, handlers, options, transform, clippingStack) {
|
|
43
|
+
const state = { ...target };
|
|
44
|
+
refreshHandlers(state, handlers, Boolean(options.cursor));
|
|
45
|
+
const paintEntry = {
|
|
46
|
+
paintKind: PibblPaintEntryKind.Path,
|
|
47
|
+
target,
|
|
48
|
+
path: resolvePath(options.path),
|
|
49
|
+
fill: options.fill ?? false,
|
|
50
|
+
lineInteractionWidth: options.lineInteractionWidth ?? 0,
|
|
51
|
+
transform,
|
|
52
|
+
clippingStack
|
|
53
|
+
};
|
|
54
|
+
const leases = /* @__PURE__ */ new Map();
|
|
55
|
+
const existing = nativeReleases.get(target);
|
|
56
|
+
const additions = [];
|
|
57
|
+
const hub = target.owner.eventRoot.nativeListeners;
|
|
58
|
+
try {
|
|
59
|
+
if (hub) forEachChangedType(
|
|
60
|
+
state.requiredNativeTypesLow,
|
|
61
|
+
state.requiredNativeTypesHigh,
|
|
62
|
+
(type) => {
|
|
63
|
+
let lease = existing?.get(type);
|
|
64
|
+
if (!lease) {
|
|
65
|
+
lease = hub.acquire(type);
|
|
66
|
+
additions.push(lease);
|
|
67
|
+
}
|
|
68
|
+
leases.set(type, lease);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
const errors = [error];
|
|
73
|
+
for (const release of additions) {
|
|
74
|
+
try {
|
|
75
|
+
release();
|
|
76
|
+
} catch (releaseError) {
|
|
77
|
+
errors.push(releaseError);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (errors.length > 1) throw new AggregateError(errors, "Prepared target acquisition failed.", { cause: error });
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
let previous;
|
|
84
|
+
let adopted = false;
|
|
85
|
+
return {
|
|
86
|
+
adopt() {
|
|
87
|
+
previous = nativeReleases.get(target);
|
|
88
|
+
nativeReleases.set(target, leases);
|
|
89
|
+
if (target.paintEntry) target.owner.paintEntries.delete(target.paintEntry);
|
|
90
|
+
target.handlers = state.handlers;
|
|
91
|
+
target.handlerTypesLow = state.handlerTypesLow;
|
|
92
|
+
target.handlerTypesHigh = state.handlerTypesHigh;
|
|
93
|
+
target.requiredNativeTypesLow = target.ownedNativeTypesLow = state.requiredNativeTypesLow;
|
|
94
|
+
target.requiredNativeTypesHigh = target.ownedNativeTypesHigh = state.requiredNativeTypesHigh;
|
|
95
|
+
target.cursor = options.cursor;
|
|
96
|
+
target.keyboardFocusable = options.keyboardFocusable;
|
|
97
|
+
target.keyboardNavigationBounds = options.keyboardNavigationBounds;
|
|
98
|
+
target.keyboardNavigationPoints = void 0;
|
|
99
|
+
target.paintEntry = paintEntry;
|
|
100
|
+
target.live = true;
|
|
101
|
+
target.owner.regions.add(target);
|
|
102
|
+
target.owner.eventRoot.targets.add(target);
|
|
103
|
+
adopted = true;
|
|
104
|
+
},
|
|
105
|
+
finish() {
|
|
106
|
+
const errors = [];
|
|
107
|
+
const complete = (callback) => {
|
|
108
|
+
try {
|
|
109
|
+
callback();
|
|
110
|
+
} catch (error) {
|
|
111
|
+
errors.push(error);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
if (adopted) {
|
|
115
|
+
for (const [type, release] of previous ?? []) if (!leases.has(type)) complete(release);
|
|
116
|
+
previous = void 0;
|
|
117
|
+
} else {
|
|
118
|
+
for (const release of additions) complete(release);
|
|
119
|
+
additions.length = 0;
|
|
120
|
+
}
|
|
121
|
+
if (errors.length === 1) throw errors[0];
|
|
122
|
+
if (errors.length) throw new AggregateError(errors, "Prepared target completion failed.");
|
|
123
|
+
},
|
|
124
|
+
notify() {
|
|
125
|
+
if (!adopted || !target.live) return;
|
|
126
|
+
const errors = [];
|
|
127
|
+
try {
|
|
128
|
+
target.owner.eventRoot.focusPolicy?.observeTarget(target);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
errors.push(error);
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
target.owner.eventRoot.onTargetUpdate?.(target);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
errors.push(error);
|
|
136
|
+
}
|
|
137
|
+
if (errors.length === 1) throw errors[0];
|
|
138
|
+
if (errors.length) throw new AggregateError(errors, "Prepared target notification failed.");
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
38
142
|
function updateTarget(target, handlers, options, participatesInPaint = false, preserveKeyboardNavigationGeometry = false) {
|
|
39
143
|
updateTargetRegistration(
|
|
40
144
|
target,
|
|
@@ -106,27 +210,64 @@ function updateTargetRegistration(target, handlers, options, participatesInPaint
|
|
|
106
210
|
target.owner.paintEntries.add(paintEntry);
|
|
107
211
|
target.owner.eventRoot.targets.add(target);
|
|
108
212
|
updateNativeOwnership(target);
|
|
213
|
+
if (isLayoutComponentSuspended(target.component) || isLayoutInstanceSuspended(target.owner)) {
|
|
214
|
+
target.suspendLayout();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
109
217
|
target.owner.eventRoot.focusPolicy?.observeTarget(target);
|
|
110
218
|
target.owner.eventRoot.onTargetUpdate?.(target);
|
|
111
219
|
}
|
|
220
|
+
function suspendTargetLayout() {
|
|
221
|
+
if (!this.live) return;
|
|
222
|
+
if (this.paintEntry) this.owner.paintEntries.delete(this.paintEntry);
|
|
223
|
+
this.owner.regions.delete(this);
|
|
224
|
+
this.owner.eventRoot.targets.delete(this);
|
|
225
|
+
this.owner.eventRoot.focusPolicy?.removeTarget(this);
|
|
226
|
+
this.owner.eventRoot.onNodeRelease?.(this);
|
|
227
|
+
this.paintEntry = void 0;
|
|
228
|
+
this.live = false;
|
|
229
|
+
clearPointerCapturesForTarget(this);
|
|
230
|
+
}
|
|
231
|
+
function suspendListenerLayout() {
|
|
232
|
+
if (!this.live) return;
|
|
233
|
+
const entries = this.owner.eventRoot.listenersByComponent.get(this.component.id);
|
|
234
|
+
entries?.delete(this);
|
|
235
|
+
if (entries?.size === 0) this.owner.eventRoot.listenersByComponent.delete(this.component.id);
|
|
236
|
+
this.owner.eventRoot.onNodeRelease?.(this);
|
|
237
|
+
this.live = false;
|
|
238
|
+
clearPointerCapturesForTarget(this);
|
|
239
|
+
}
|
|
112
240
|
function releaseTarget(target) {
|
|
241
|
+
releaseLayoutTargetGeometry(target);
|
|
242
|
+
const errors = [];
|
|
243
|
+
const release = (callback) => {
|
|
244
|
+
try {
|
|
245
|
+
callback();
|
|
246
|
+
} catch (error) {
|
|
247
|
+
errors.push(error);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
release(() => unregisterLayoutSuspensionResource(target.component, target));
|
|
113
251
|
if (target.live) {
|
|
114
252
|
if (target.paintEntry) target.owner.paintEntries.delete(target.paintEntry);
|
|
115
253
|
target.owner.eventRoot.targets.delete(target);
|
|
116
|
-
target.owner.eventRoot.focusPolicy?.removeTarget(target);
|
|
117
|
-
target.owner.eventRoot.onNodeRelease?.(target);
|
|
254
|
+
release(() => target.owner.eventRoot.focusPolicy?.removeTarget(target));
|
|
255
|
+
release(() => target.owner.eventRoot.onNodeRelease?.(target));
|
|
118
256
|
}
|
|
119
257
|
target.owner.regions.delete(target);
|
|
120
258
|
target.paintEntry = void 0;
|
|
121
259
|
target.live = false;
|
|
122
|
-
clearPointerCapturesForTarget(target);
|
|
123
|
-
releaseNativeOwnership(target);
|
|
260
|
+
release(() => clearPointerCapturesForTarget(target));
|
|
261
|
+
release(() => releaseNativeOwnership(target));
|
|
262
|
+
if (errors.length === 1) throw errors[0];
|
|
263
|
+
if (errors.length) throw new AggregateError(errors, "Target release failed.");
|
|
124
264
|
}
|
|
125
265
|
function createListener(owner, component, slot) {
|
|
126
266
|
const listener = {};
|
|
127
267
|
const publicTarget = createPublicTarget(() => listener);
|
|
128
268
|
Object.assign(listener, {
|
|
129
269
|
kind: "listener",
|
|
270
|
+
suspendLayout: suspendListenerLayout,
|
|
130
271
|
owner,
|
|
131
272
|
component,
|
|
132
273
|
slot,
|
|
@@ -140,6 +281,7 @@ function createListener(owner, component, slot) {
|
|
|
140
281
|
ownedNativeTypesHigh: 0,
|
|
141
282
|
live: false
|
|
142
283
|
});
|
|
284
|
+
registerLayoutSuspensionResource(component, listener);
|
|
143
285
|
return listener;
|
|
144
286
|
}
|
|
145
287
|
function updateListener(listener, handlers) {
|
|
@@ -171,9 +313,14 @@ function updateListener(listener, handlers) {
|
|
|
171
313
|
}
|
|
172
314
|
registrations.add(listener);
|
|
173
315
|
listener.live = true;
|
|
316
|
+
if (isLayoutComponentSuspended(listener.component) || isLayoutInstanceSuspended(listener.owner)) {
|
|
317
|
+
listener.suspendLayout();
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
174
320
|
updateNativeOwnership(listener);
|
|
175
321
|
}
|
|
176
322
|
function releaseListener(listener) {
|
|
323
|
+
unregisterLayoutSuspensionResource(listener.component, listener);
|
|
177
324
|
if (listener.live) {
|
|
178
325
|
const registrations = listener.owner.eventRoot.listenersByComponent.get(
|
|
179
326
|
listener.component.id
|
|
@@ -354,10 +501,17 @@ function releaseNativeOwnership(registration) {
|
|
|
354
501
|
const releases = nativeReleases.get(registration);
|
|
355
502
|
if (!releases) return;
|
|
356
503
|
nativeReleases.delete(registration);
|
|
504
|
+
const errors = [];
|
|
357
505
|
for (const release of releases.values()) {
|
|
358
|
-
|
|
506
|
+
try {
|
|
507
|
+
release();
|
|
508
|
+
} catch (error) {
|
|
509
|
+
errors.push(error);
|
|
510
|
+
}
|
|
359
511
|
}
|
|
360
512
|
releases.clear();
|
|
513
|
+
if (errors.length === 1) throw errors[0];
|
|
514
|
+
if (errors.length) throw new AggregateError(errors, "Native listener release failed.");
|
|
361
515
|
}
|
|
362
516
|
function forEachChangedType(low, high, visit) {
|
|
363
517
|
while (low !== 0) {
|
|
@@ -388,6 +542,7 @@ export {
|
|
|
388
542
|
createListener,
|
|
389
543
|
createTarget,
|
|
390
544
|
normalizeHandlers,
|
|
545
|
+
prepareTargetUpdate,
|
|
391
546
|
releaseListener,
|
|
392
547
|
releaseTarget,
|
|
393
548
|
updateCursorTarget,
|