@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,8 +1,9 @@
|
|
|
1
|
+
import { bindAnimationTarget } from "../animation/definition.js";
|
|
2
|
+
import { drive } from "../animation/program.js";
|
|
3
|
+
import { withSignalWriteForbidden } from "../signals/graph.js";
|
|
1
4
|
import {
|
|
2
5
|
createAnimationPlaybackController
|
|
3
6
|
} from "../animation/playback.js";
|
|
4
|
-
import { spring, tween } from "../animation/definition.js";
|
|
5
|
-
import { drive } from "../animation/program.js";
|
|
6
7
|
import { GLOBAL_STATE } from "../global-state.js";
|
|
7
8
|
import {
|
|
8
9
|
isSignal,
|
|
@@ -11,45 +12,16 @@ import {
|
|
|
11
12
|
untracked
|
|
12
13
|
} from "../signals/graph.js";
|
|
13
14
|
import { resolveSignalValue } from "../signals/resolve-signal-value.js";
|
|
14
|
-
import { requireHookContext, useHookSlot } from "./hook-slot.js";
|
|
15
|
-
function hasOwn(value, key) {
|
|
16
|
-
return Object.prototype.hasOwnProperty.call(value, key);
|
|
17
|
-
}
|
|
15
|
+
import { requireHookContext, useHookSlot, withHooksForbidden } from "./hook-slot.js";
|
|
18
16
|
function normalizeCandidate(target, options) {
|
|
19
17
|
if (typeof options !== "object" || options === null) {
|
|
20
|
-
throw new TypeError("
|
|
21
|
-
}
|
|
22
|
-
if (options.type !== "tween" && options.type !== "spring") {
|
|
23
|
-
throw new TypeError('Pibbl transition type must be "tween" or "spring".');
|
|
18
|
+
throw new TypeError("useAnimatedValue options must be an object.");
|
|
24
19
|
}
|
|
25
20
|
if (options.equals !== void 0 && typeof options.equals !== "function") {
|
|
26
21
|
throw new TypeError("Pibbl transition equals must be a function.");
|
|
27
22
|
}
|
|
28
23
|
const snapshot = Object.freeze({ ...options });
|
|
29
|
-
|
|
30
|
-
spring({
|
|
31
|
-
from: target,
|
|
32
|
-
to: target,
|
|
33
|
-
mass: snapshot.mass,
|
|
34
|
-
stiffness: snapshot.stiffness,
|
|
35
|
-
damping: snapshot.damping,
|
|
36
|
-
initialVelocity: snapshot.initialVelocity,
|
|
37
|
-
restSpeed: snapshot.restSpeed,
|
|
38
|
-
restDelta: snapshot.restDelta,
|
|
39
|
-
maxDuration: snapshot.maxDuration,
|
|
40
|
-
debugName: snapshot.debugName
|
|
41
|
-
});
|
|
42
|
-
} else {
|
|
43
|
-
tween({
|
|
44
|
-
from: target,
|
|
45
|
-
to: target,
|
|
46
|
-
duration: snapshot.duration,
|
|
47
|
-
easing: snapshot.easing,
|
|
48
|
-
interpolate: snapshot.interpolate,
|
|
49
|
-
debugName: snapshot.debugName
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const hasInitial = hasOwn(options, "initial");
|
|
24
|
+
const hasInitial = Object.prototype.hasOwnProperty.call(options, "initial");
|
|
53
25
|
return Object.freeze({
|
|
54
26
|
options: snapshot,
|
|
55
27
|
equals: snapshot.equals ?? Object.is,
|
|
@@ -58,31 +30,6 @@ function normalizeCandidate(target, options) {
|
|
|
58
30
|
target
|
|
59
31
|
});
|
|
60
32
|
}
|
|
61
|
-
function programFor(output, from, candidate, springVelocity) {
|
|
62
|
-
const options = candidate.options;
|
|
63
|
-
if (options.type === "spring") {
|
|
64
|
-
return drive(output, spring({
|
|
65
|
-
from,
|
|
66
|
-
to: candidate.target,
|
|
67
|
-
mass: options.mass,
|
|
68
|
-
stiffness: options.stiffness,
|
|
69
|
-
damping: options.damping,
|
|
70
|
-
initialVelocity: springVelocity ?? options.initialVelocity,
|
|
71
|
-
restSpeed: options.restSpeed,
|
|
72
|
-
restDelta: options.restDelta,
|
|
73
|
-
maxDuration: options.maxDuration,
|
|
74
|
-
debugName: options.debugName
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
return drive(output, tween({
|
|
78
|
-
from,
|
|
79
|
-
to: candidate.target,
|
|
80
|
-
duration: options.duration,
|
|
81
|
-
easing: options.easing,
|
|
82
|
-
interpolate: options.interpolate,
|
|
83
|
-
debugName: options.debugName
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
33
|
function isCurrentSlot(slot) {
|
|
87
34
|
return !slot.componentRefs.teardowns.closed && !slot.pibblInstance.mainTeardowns.closed && GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance && slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;
|
|
88
35
|
}
|
|
@@ -91,13 +38,14 @@ function useAnimatedValue(targetInput, optionsInput) {
|
|
|
91
38
|
const target = resolveSignalValue(targetInput);
|
|
92
39
|
const options = resolveTransitionOptions(optionsInput);
|
|
93
40
|
const candidate = normalizeCandidate(target, options);
|
|
94
|
-
const slot = useHookSlot("
|
|
41
|
+
const slot = useHookSlot("animatedValue", (teardowns) => {
|
|
95
42
|
const output = signal(candidate.initial);
|
|
96
|
-
const
|
|
97
|
-
const controller = createAnimationPlaybackController(
|
|
43
|
+
const program2 = programFor(output, candidate.initial, candidate);
|
|
44
|
+
const controller = createAnimationPlaybackController(program2, {
|
|
98
45
|
conflict: "replace",
|
|
99
46
|
debugName: candidate.options.debugName
|
|
100
47
|
});
|
|
48
|
+
controller.setDeferredStatusCommandOwner(pibblInstance.mainTeardowns);
|
|
101
49
|
const value = {
|
|
102
50
|
componentRefs,
|
|
103
51
|
controller,
|
|
@@ -111,6 +59,12 @@ function useAnimatedValue(targetInput, optionsInput) {
|
|
|
111
59
|
teardowns.add(() => controller.dispose());
|
|
112
60
|
return value;
|
|
113
61
|
}).value;
|
|
62
|
+
const program = programFor(
|
|
63
|
+
slot.output,
|
|
64
|
+
slot.settled ? untracked(() => slot.output.get()) : candidate.initial,
|
|
65
|
+
candidate,
|
|
66
|
+
slot.settled ? slot.controller.committedSpringSnapshot()?.velocity : void 0
|
|
67
|
+
);
|
|
114
68
|
const shouldEnter = !slot.settled && candidate.hasInitial && !candidate.equals(candidate.initial, candidate.target);
|
|
115
69
|
const shouldRetarget = slot.settled && !candidate.equals(slot.target, candidate.target);
|
|
116
70
|
const previousProvisionalValue = untracked(() => slot.output.get());
|
|
@@ -130,7 +84,7 @@ function useAnimatedValue(targetInput, optionsInput) {
|
|
|
130
84
|
slot.target = candidate.target;
|
|
131
85
|
if (!shouldEnter && !shouldRetarget) {
|
|
132
86
|
slot.controller.adopt(
|
|
133
|
-
|
|
87
|
+
program,
|
|
134
88
|
{
|
|
135
89
|
conflict: "replace",
|
|
136
90
|
debugName: candidate.options.debugName
|
|
@@ -138,13 +92,6 @@ function useAnimatedValue(targetInput, optionsInput) {
|
|
|
138
92
|
);
|
|
139
93
|
return;
|
|
140
94
|
}
|
|
141
|
-
const springVelocity = candidate.options.type === "spring" ? slot.controller.committedSpringSnapshot()?.velocity : void 0;
|
|
142
|
-
const program = programFor(
|
|
143
|
-
slot.output,
|
|
144
|
-
slot.output.get(),
|
|
145
|
-
candidate,
|
|
146
|
-
springVelocity
|
|
147
|
-
);
|
|
148
95
|
slot.controller.retarget(program, {
|
|
149
96
|
conflict: "replace",
|
|
150
97
|
debugName: candidate.options.debugName
|
|
@@ -163,6 +110,12 @@ function resolveTransitionOptions(input) {
|
|
|
163
110
|
}
|
|
164
111
|
return resolved ?? source;
|
|
165
112
|
}
|
|
113
|
+
function programFor(output, from, candidate, velocity) {
|
|
114
|
+
const context = Object.freeze({ from, to: candidate.target, velocity });
|
|
115
|
+
const animation = candidate.options.animation;
|
|
116
|
+
const definition = typeof animation === "function" ? withHooksForbidden("Animation factories cannot call hooks.", () => withSignalWriteForbidden("Animation factories cannot write to signals.", () => animation(context))) : animation;
|
|
117
|
+
return drive(output, bindAnimationTarget(definition, context));
|
|
118
|
+
}
|
|
166
119
|
export {
|
|
167
120
|
useAnimatedValue
|
|
168
121
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/hooks/use-animated-value.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n createAnimationPlaybackController,\n type AnimationPlaybackController,\n} from '../animation/playback.js';\nimport { spring, tween } from '../animation/definition.js';\nimport { drive } from '../animation/program.js';\nimport type {\n PibblAnimationProgram,\n PibblSpringAnimatedValueOptions,\n PibblTweenAnimatedValueOptions,\n} from '../animation/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport {\n isSignal,\n provisionSignalValueForRender,\n signal,\n untracked,\n} from '../signals/graph.js';\nimport { resolveSignalValue } from '../signals/resolve-signal-value.js';\nimport type {\n Signal,\n SignalEquals,\n SignalValue,\n WritableSignal,\n} from '../signals/types.js';\nimport type { PibblComponentRefs, PibblInstance } from '../types.js';\nimport { requireHookContext, useHookSlot } from './hook-slot.js';\n\ntype PibblTransitionOptions<T> =\n | PibblTweenAnimatedValueOptions<T>\n | PibblSpringAnimatedValueOptions;\n\ntype PibblTransitionOptionsInput<T> =\n | {\n readonly [K in keyof PibblTweenAnimatedValueOptions<T>]:\n SignalValue<PibblTweenAnimatedValueOptions<T>[K]>;\n }\n | {\n readonly [K in keyof PibblSpringAnimatedValueOptions]:\n SignalValue<PibblSpringAnimatedValueOptions[K]>;\n };\n\ninterface PibblTransitionCandidate<T> {\n readonly options: PibblTransitionOptions<T>;\n readonly equals: SignalEquals<T>;\n readonly hasInitial: boolean;\n readonly initial: T;\n readonly target: T;\n}\n\ninterface PibblTransitionHookSlot<T> {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly controller: AnimationPlaybackController;\n readonly pibblInstance: PibblInstance;\n readonly output: WritableSignal<T>;\n readonly readonlyOutput: Signal<T>;\n renderRevision: number;\n settled: boolean;\n target: T;\n}\n\nfunction hasOwn(value: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nfunction normalizeCandidate<T>(\n target: T,\n options: PibblTransitionOptions<T>,\n): PibblTransitionCandidate<T> {\n if (typeof options !== 'object' || options === null) {\n throw new TypeError('Pibbl transition options must be an object.');\n }\n if (options.type !== 'tween' && options.type !== 'spring') {\n throw new TypeError('Pibbl transition type must be \"tween\" or \"spring\".');\n }\n if (options.equals !== undefined && typeof options.equals !== 'function') {\n throw new TypeError('Pibbl transition equals must be a function.');\n }\n const snapshot = Object.freeze({ ...options }) as PibblTransitionOptions<T>;\n if (snapshot.type === 'spring') {\n spring({\n from: target as number,\n to: target as number,\n mass: snapshot.mass,\n stiffness: snapshot.stiffness,\n damping: snapshot.damping,\n initialVelocity: snapshot.initialVelocity,\n restSpeed: snapshot.restSpeed,\n restDelta: snapshot.restDelta,\n maxDuration: snapshot.maxDuration,\n debugName: snapshot.debugName,\n });\n } else {\n tween({\n from: target,\n to: target,\n duration: snapshot.duration,\n easing: snapshot.easing,\n interpolate: snapshot.interpolate,\n debugName: snapshot.debugName,\n });\n }\n const hasInitial = hasOwn(options, 'initial');\n return Object.freeze({\n options: snapshot,\n equals: (snapshot.equals ?? Object.is) as SignalEquals<T>,\n hasInitial,\n initial: (hasInitial ? snapshot.initial : target) as T,\n target,\n });\n}\n\nfunction programFor<T>(\n output: WritableSignal<T>,\n from: T,\n candidate: PibblTransitionCandidate<T>,\n springVelocity?: number,\n): PibblAnimationProgram {\n const options = candidate.options;\n if (options.type === 'spring') {\n return drive(output as unknown as WritableSignal<number>, spring({\n from: from as number,\n to: candidate.target as number,\n mass: options.mass,\n stiffness: options.stiffness,\n damping: options.damping,\n initialVelocity: springVelocity ?? options.initialVelocity,\n restSpeed: options.restSpeed,\n restDelta: options.restDelta,\n maxDuration: options.maxDuration,\n debugName: options.debugName,\n }));\n }\n return drive(output, tween({\n from,\n to: candidate.target,\n duration: options.duration,\n easing: options.easing,\n interpolate: options.interpolate,\n debugName: options.debugName,\n }));\n}\n\nfunction isCurrentSlot<T>(slot: PibblTransitionHookSlot<T>): boolean {\n return !slot.componentRefs.teardowns.closed &&\n !slot.pibblInstance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance &&\n slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;\n}\n\n/**\n * Animates a numeric target using an analytic spring. See {@link PibblSpringAnimatedValueOptions}\n * and {@link Signal}.\n * @param target - Target value or signal whose changes start transitions. See {@link SignalValue}.\n * @param options - Spring or tween configuration, including signal-backed fields. See\n * {@link SignalValue} , {@link PibblSpringAnimatedValueOptions} .\n * @returns A readonly signal containing the animated value. See {@link Signal}.\n */\nexport function useAnimatedValue(\n target: SignalValue<number>,\n options: SignalValue<{\n readonly [K in keyof PibblSpringAnimatedValueOptions]:\n SignalValue<PibblSpringAnimatedValueOptions[K]>;\n }>,\n): Signal<number>;\n/**\n * Animates a target using a tween and optional custom interpolation. See\n * {@link PibblTweenAnimatedValueOptions} and {@link Signal}.\n * @param target - Target value or signal whose changes start transitions. See {@link SignalValue}.\n * @param options - Spring or tween configuration, including signal-backed fields. See\n * {@link SignalValue} , {@link PibblTweenAnimatedValueOptions} .\n * @returns A readonly signal containing the animated value. See {@link Signal}.\n */\nexport function useAnimatedValue<T>(\n target: SignalValue<T>,\n options: SignalValue<{\n readonly [K in keyof PibblTweenAnimatedValueOptions<T>]:\n SignalValue<PibblTweenAnimatedValueOptions<T>[K]>;\n }>,\n): Signal<T>;\n/**\n * Returns a mount-owned signal that animates toward the current target using the supplied\n * transition options.\n *\n * @param targetInput - Target value or signal whose changes start transitions. See\n * {@link SignalValue} .\n * @param optionsInput - Spring or tween configuration, including signal-backed fields. See\n * {@link SignalValue} , {@link PibblTransitionOptionsInput} .\n * @returns A readonly signal containing the animated value. See {@link Signal}.\n *\n * @see {@link SignalValue}\n * @see {@link Signal}\n */\nexport function useAnimatedValue<T>(\n targetInput: SignalValue<T>,\n optionsInput: SignalValue<PibblTransitionOptionsInput<T>>,\n): Signal<T> {\n const { componentRefs, pibblInstance } = requireHookContext();\n const target = resolveSignalValue(targetInput);\n const options = resolveTransitionOptions(optionsInput);\n const candidate = normalizeCandidate(target, options);\n const slot = useHookSlot<PibblTransitionHookSlot<T>>('transition', teardowns => {\n const output = signal(candidate.initial);\n const program = programFor(output, candidate.initial, candidate);\n const controller = createAnimationPlaybackController(program, {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n });\n const value: PibblTransitionHookSlot<T> = {\n componentRefs,\n controller,\n pibblInstance,\n output,\n readonlyOutput: output.asReadonly(),\n renderRevision: 0,\n settled: false,\n target: candidate.target,\n };\n teardowns.add(() => controller.dispose());\n return value;\n }).value;\n\n const shouldEnter = !slot.settled && candidate.hasInitial &&\n !candidate.equals(candidate.initial, candidate.target);\n const shouldRetarget = slot.settled &&\n !candidate.equals(slot.target, candidate.target);\n const previousProvisionalValue = untracked(() => slot.output.get());\n const hasProvisionalValue = !slot.settled &&\n !Object.is(previousProvisionalValue, candidate.initial);\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error('useAnimatedValue requires an active Pibbl render transaction.');\n }\n if (hasProvisionalValue) {\n provisionSignalValueForRender(slot.output, candidate.initial, transaction);\n }\n const revision = ++slot.renderRevision;\n transaction.onFinish(success => {\n if (!success) return;\n if (revision !== slot.renderRevision || !isCurrentSlot(slot)) return;\n slot.settled = true;\n slot.target = candidate.target;\n if (!shouldEnter && !shouldRetarget) {\n slot.controller.adopt(\n programFor(slot.output, slot.output.get(), candidate),\n {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n },\n );\n return;\n }\n const springVelocity = candidate.options.type === 'spring' ?\n slot.controller.committedSpringSnapshot()?.velocity : undefined;\n const program = programFor(\n slot.output,\n slot.output.get(),\n candidate,\n springVelocity,\n );\n slot.controller.retarget(program, {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n });\n });\n return slot.readonlyOutput;\n}\n\nfunction resolveTransitionOptions<T>(\n input: SignalValue<PibblTransitionOptionsInput<T>>,\n): PibblTransitionOptions<T> {\n const source = resolveSignalValue(input);\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n const value = source[key as keyof typeof source];\n if (!isSignal(value)) continue;\n resolved ??= { ...source };\n resolved[key] = resolveSignalValue(value as SignalValue<unknown>);\n }\n return (resolved ?? source) as PibblTransitionOptions<T>;\n}\n"],
|
|
5
|
-
"mappings": "AAAA
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { bindAnimationTarget } from '../animation/definition.js';\nimport { drive } from '../animation/program.js';\nimport { withSignalWriteForbidden } from '../signals/graph.js';\nimport {\n createAnimationPlaybackController,\n type AnimationPlaybackController,\n} from '../animation/playback.js';\nimport type {\n PibblAnimatedValueOptions,\n} from '../animation/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport {\n isSignal,\n provisionSignalValueForRender,\n signal,\n untracked,\n} from '../signals/graph.js';\nimport { resolveSignalValue } from '../signals/resolve-signal-value.js';\nimport type {\n Signal,\n SignalEquals,\n SignalValue,\n WritableSignal,\n} from '../signals/types.js';\nimport type { PibblComponentRefs, PibblInstance } from '../types.js';\nimport { requireHookContext, useHookSlot, withHooksForbidden } from './hook-slot.js';\n\ntype AnimatedValueInputs<T> = {\n readonly [K in keyof PibblAnimatedValueOptions<T>]: SignalValue<PibblAnimatedValueOptions<T>[K]>;\n};\n\ninterface PibblTransitionCandidate<T> {\n readonly options: PibblAnimatedValueOptions<T>;\n readonly equals: SignalEquals<T>;\n readonly hasInitial: boolean;\n readonly initial: T;\n readonly target: T;\n}\n\ninterface PibblTransitionHookSlot<T> {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly controller: AnimationPlaybackController;\n readonly pibblInstance: PibblInstance;\n readonly output: WritableSignal<T>;\n readonly readonlyOutput: Signal<T>;\n renderRevision: number;\n settled: boolean;\n target: T;\n}\n\nfunction normalizeCandidate<T>(\n target: T,\n options: PibblAnimatedValueOptions<T>,\n): PibblTransitionCandidate<T> {\n if (typeof options !== 'object' || options === null) {\n throw new TypeError('useAnimatedValue options must be an object.');\n }\n if (options.equals !== undefined && typeof options.equals !== 'function') {\n throw new TypeError('Pibbl transition equals must be a function.');\n }\n const snapshot = Object.freeze({ ...options });\n const hasInitial = Object.prototype.hasOwnProperty.call(options, 'initial');\n return Object.freeze({\n options: snapshot,\n equals: snapshot.equals ?? Object.is,\n hasInitial,\n initial: (hasInitial ? snapshot.initial : target) as T,\n target,\n });\n}\n\nfunction isCurrentSlot<T>(slot: PibblTransitionHookSlot<T>): boolean {\n return !slot.componentRefs.teardowns.closed &&\n !slot.pibblInstance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance &&\n slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;\n}\n\n/**\n * Presents a target through an immutable animation definition or a pure animation factory.\n * @param targetInput - Target value or signal. See {@link SignalValue}.\n * @param optionsInput - Animation definition, initial value, equality, and diagnostic settings;\n * fields and the options object may be signals. See {@link PibblAnimatedValueOptions}.\n * @returns One stable readonly animated signal. See {@link Signal}.\n */\nexport function useAnimatedValue<T>(\n targetInput: SignalValue<T>,\n optionsInput: SignalValue<AnimatedValueInputs<NoInfer<T>>>,\n): Signal<T> {\n const { componentRefs, pibblInstance } = requireHookContext();\n const target = resolveSignalValue(targetInput);\n const options = resolveTransitionOptions<T>(optionsInput);\n const candidate = normalizeCandidate(target, options);\n const slot = useHookSlot<PibblTransitionHookSlot<T>>('animatedValue', teardowns => {\n const output = signal(candidate.initial);\n const program = programFor(output, candidate.initial, candidate);\n const controller = createAnimationPlaybackController(program, {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n });\n controller.setDeferredStatusCommandOwner(pibblInstance.mainTeardowns);\n const value: PibblTransitionHookSlot<T> = {\n componentRefs,\n controller,\n pibblInstance,\n output,\n readonlyOutput: output.asReadonly(),\n renderRevision: 0,\n settled: false,\n target: candidate.target,\n };\n teardowns.add(() => controller.dispose());\n return value;\n }).value;\n\n // Prepare user-defined work while Render can still fail transactionally. No factory runs\n // in onFinish, where a late exception could otherwise adopt only part of the update.\n const program = programFor(slot.output,\n slot.settled ? untracked(() => slot.output.get()) : candidate.initial,\n candidate, slot.settled ? slot.controller.committedSpringSnapshot()?.velocity : undefined);\n\n const shouldEnter = !slot.settled && candidate.hasInitial &&\n !candidate.equals(candidate.initial, candidate.target);\n const shouldRetarget = slot.settled &&\n !candidate.equals(slot.target, candidate.target);\n const previousProvisionalValue = untracked(() => slot.output.get());\n const hasProvisionalValue = !slot.settled &&\n !Object.is(previousProvisionalValue, candidate.initial);\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error('useAnimatedValue requires an active Pibbl render transaction.');\n }\n if (hasProvisionalValue) {\n provisionSignalValueForRender(slot.output, candidate.initial, transaction);\n }\n const revision = ++slot.renderRevision;\n transaction.onFinish(success => {\n if (!success) return;\n if (revision !== slot.renderRevision || !isCurrentSlot(slot)) return;\n slot.settled = true;\n slot.target = candidate.target;\n if (!shouldEnter && !shouldRetarget) {\n slot.controller.adopt(\n program,\n {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n },\n );\n return;\n }\n slot.controller.retarget(program, {\n conflict: 'replace',\n debugName: candidate.options.debugName,\n });\n });\n return slot.readonlyOutput;\n}\n\nfunction resolveTransitionOptions<T>(\n input: SignalValue<AnimatedValueInputs<T>>,\n): PibblAnimatedValueOptions<T> {\n const source = resolveSignalValue(input);\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n const value = source[key as keyof typeof source];\n if (!isSignal(value)) continue;\n resolved ??= { ...source };\n resolved[key] = resolveSignalValue(value as SignalValue<unknown>);\n }\n return (resolved ?? source) as PibblAnimatedValueOptions<T>;\n}\n\nfunction programFor<T>(\n output: WritableSignal<T>, from: T, candidate: PibblTransitionCandidate<T>, velocity?: number,\n) {\n const context = Object.freeze({ from, to: candidate.target, velocity });\n const animation = candidate.options.animation;\n const definition = typeof animation === 'function'\n ? withHooksForbidden('Animation factories cannot call hooks.', () =>\n withSignalWriteForbidden('Animation factories cannot write to signals.', () => animation(context)))\n : animation;\n return drive(output,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9D,SAAK,UAAU;AACf,SAAK,SAAS,UAAU;AACxB,QAAI,CAAC,eAAe,CAAC,gBAAgB;AACnC,WAAK,WAAW;AAAA,QACd;AAAA,QACA;AAAA,UACE,UAAU;AAAA,UACV,WAAW,UAAU,QAAQ;AAAA,QAC/B;AAAA,MACF;AACA;AAAA,IACF;AACA,SAAK,WAAW,SAAS,SAAS;AAAA,MAChC,UAAU;AAAA,MACV,WAAW,UAAU,QAAQ;AAAA,IAC/B,CAAC;AAAA,EACH,CAAC;AACD,SAAO,KAAK;AACd;AAEA,SAAS,yBACP,OAC8B;AAC9B,QAAM,SAAS,mBAAmB,KAAK;AACvC,MAAI;AACJ,aAAW,OAAO,QAAQ;AACxB,UAAM,QAAQ,OAAO,GAA0B;AAC/C,QAAI,CAAC,SAAS,KAAK,EAAG;AACtB,iBAAa,EAAE,GAAG,OAAO;AACzB,aAAS,GAAG,IAAI,mBAAmB,KAA6B;AAAA,EAClE;AACA,SAAQ,YAAY;AACtB;AAEA,SAAS,WACP,QAA2B,MAAS,WAAwC,UAC5E;AACA,QAAM,UAAU,OAAO,OAAO,EAAE,MAAM,IAAI,UAAU,QAAQ,SAAS,CAAC;AACtE,QAAM,YAAY,UAAU,QAAQ;AACpC,QAAM,aAAa,OAAO,cAAc,aACpC,mBAAmB,0CAA0C,MAC7D,yBAAyB,gDAAgD,MAAM,UAAU,OAAO,CAAC,CAAC,IAClG;AACJ,SAAO,MAAM,QAAQ,oBAAoB,YAAY,OAAO,CAAC;AAC/D;",
|
|
6
|
+
"names": ["program"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,7 @@ function usePlayback(programInput, optionsInput = {}) {
|
|
|
28
28
|
candidate.program,
|
|
29
29
|
candidateOptions
|
|
30
30
|
);
|
|
31
|
+
controller.setDeferredStatusCommandOwner(pibblInstance.mainTeardowns);
|
|
31
32
|
const onEvent = (event) => {
|
|
32
33
|
if (isCurrentSlot(value)) value.latestOptions.onEvent?.(event);
|
|
33
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/hooks/use-playback.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n createAnimationPlaybackController,\n normalizeAnimationPlaybackCandidate,\n type AnimationPlaybackController,\n} from '../animation/playback.js';\nimport type {\n PibblAnimationProgram,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n} from '../animation/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport { isSignal } from '../signals/graph.js';\nimport { resolveSignalValue } from '../signals/resolve-signal-value.js';\nimport type { SignalValue } from '../signals/types.js';\nimport type { PibblComponentRefs, PibblInstance } from '../types.js';\nimport { requireHookContext, useHookSlot } from './hook-slot.js';\n\ntype PibblPlaybackOptionsInput = {\n readonly [K in keyof PibblPlaybackOptions]: SignalValue<PibblPlaybackOptions[K]>;\n};\n\ninterface PibblPlaybackHookSlot {\n readonly controller: AnimationPlaybackController;\n readonly componentRefs: PibblComponentRefs<any>;\n readonly pibblInstance: PibblInstance;\n latestOptions: PibblPlaybackOptions;\n mountSettled: boolean;\n readonly onError: (error: unknown) => void;\n readonly onEvent: (event: PibblPlaybackEvent) => void;\n renderRevision: number;\n}\n\nfunction isCurrentSlot(slot: PibblPlaybackHookSlot): boolean {\n return !slot.componentRefs.teardowns.closed &&\n !slot.pibblInstance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance &&\n slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;\n}\n\nfunction controllerOptions(\n candidate: PibblPlaybackOptions,\n onEvent: (event: PibblPlaybackEvent) => void,\n onError: (error: unknown) => void,\n): PibblPlaybackOptions {\n return {\n ...candidate,\n onEvent: typeof candidate.onEvent === 'function' ?\n onEvent : candidate.onEvent,\n onError: typeof candidate.onError === 'function' ?\n onError : candidate.onError,\n };\n}\n\n/**\n * Creates one component-owned animation playback handle for a hook slot.\n *\n * @param programInput - Animation program, optionally supplied by a signal. See\n * {@link SignalValue} , {@link PibblAnimationProgram} .\n * @param optionsInput - Playback configuration, optionally supplied by a signal. See\n * {@link SignalValue} , {@link PibblPlaybackOptionsInput} .\n * @returns Stable mount-owned playback controls and reactive status/time values. See\n * {@link PibblPlayback} .\n *\n * @see {@link SignalValue}\n * @see {@link PibblAnimationProgram}\n * @see {@link PibblPlayback}\n */\nexport function usePlayback(\n programInput: SignalValue<PibblAnimationProgram>,\n optionsInput: SignalValue<PibblPlaybackOptionsInput> = {},\n): PibblPlayback {\n const { componentRefs, pibblInstance } = requireHookContext();\n const program = resolveSignalValue(programInput);\n const options = resolvePlaybackOptions(optionsInput);\n const candidate = normalizeAnimationPlaybackCandidate(program, options);\n const candidateOptions = candidate.options;\n const slot = useHookSlot<PibblPlaybackHookSlot>('playback', teardowns => {\n let value!: PibblPlaybackHookSlot;\n const controller = createAnimationPlaybackController(\n candidate.program,\n candidateOptions,\n );\n const onEvent = (event: PibblPlaybackEvent): void => {\n if (isCurrentSlot(value)) value.latestOptions.onEvent?.(event);\n };\n const onError = (error: unknown): void => {\n if (isCurrentSlot(value)) value.latestOptions.onError?.(error);\n };\n value = {\n controller,\n componentRefs,\n pibblInstance,\n latestOptions: {},\n mountSettled: false,\n onError,\n onEvent,\n renderRevision: 0,\n };\n controller.adopt(\n candidate.program,\n controllerOptions(candidateOptions, onEvent, onError),\n );\n teardowns.add(() => controller.dispose());\n return value;\n }).value;\n const revision = ++slot.renderRevision;\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error('usePlayback requires an active Pibbl render transaction.');\n }\n transaction.onFinish(success => {\n if (!success || revision !== slot.renderRevision || !isCurrentSlot(slot)) return;\n slot.controller.adopt(\n candidate.program,\n controllerOptions(candidateOptions, slot.onEvent, slot.onError),\n );\n slot.latestOptions = candidateOptions;\n if (!slot.mountSettled) {\n slot.mountSettled = true;\n if (candidateOptions.autoplay === true) slot.controller.handle.play();\n }\n });\n return slot.controller.handle;\n}\n\nfunction resolvePlaybackOptions(\n input: SignalValue<PibblPlaybackOptionsInput>,\n): PibblPlaybackOptions {\n const source = resolveSignalValue(input);\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n const value = source[key as keyof PibblPlaybackOptionsInput];\n if (!isSignal(value)) continue;\n resolved ??= { ...source };\n resolved[key] = resolveSignalValue(value as SignalValue<unknown>);\n }\n return (resolved ?? source) as PibblPlaybackOptions;\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAOP,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AAGnC,SAAS,oBAAoB,mBAAmB;AAiBhD,SAAS,cAAc,MAAsC;AAC3D,SAAO,CAAC,KAAK,cAAc,UAAU,UACnC,CAAC,KAAK,cAAc,cAAc,UAClC,aAAa,eAAe,IAAI,KAAK,cAAc,MAAM,MAAM,KAAK,iBACpE,KAAK,cAAc,KAAK,IAAI,KAAK,cAAc,EAAE,MAAM,KAAK;AAChE;AAEA,SAAS,kBACP,WACA,SACA,SACsB;AACtB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,OAAO,UAAU,YAAY,aACpC,UAAU,UAAU;AAAA,IACtB,SAAS,OAAO,UAAU,YAAY,aACpC,UAAU,UAAU;AAAA,EACxB;AACF;AAgBO,SAAS,YACd,cACA,eAAuD,CAAC,GACzC;AACf,QAAM,EAAE,eAAe,cAAc,IAAI,mBAAmB;AAC5D,QAAM,UAAU,mBAAmB,YAAY;AAC/C,QAAM,UAAU,uBAAuB,YAAY;AACnD,QAAM,YAAY,oCAAoC,SAAS,OAAO;AACtE,QAAM,mBAAmB,UAAU;AACnC,QAAM,OAAO,YAAmC,YAAY,eAAa;AACvE,QAAI;AACJ,UAAM,aAAa;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,IACF;AACA,UAAM,UAAU,CAAC,UAAoC;AACnD,UAAI,cAAc,KAAK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{\n createAnimationPlaybackController,\n normalizeAnimationPlaybackCandidate,\n type AnimationPlaybackController,\n} from '../animation/playback.js';\nimport type {\n PibblAnimationProgram,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n} from '../animation/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport { isSignal } from '../signals/graph.js';\nimport { resolveSignalValue } from '../signals/resolve-signal-value.js';\nimport type { SignalValue } from '../signals/types.js';\nimport type { PibblComponentRefs, PibblInstance } from '../types.js';\nimport { requireHookContext, useHookSlot } from './hook-slot.js';\n\ntype PibblPlaybackOptionsInput = {\n readonly [K in keyof PibblPlaybackOptions]: SignalValue<PibblPlaybackOptions[K]>;\n};\n\ninterface PibblPlaybackHookSlot {\n readonly controller: AnimationPlaybackController;\n readonly componentRefs: PibblComponentRefs<any>;\n readonly pibblInstance: PibblInstance;\n latestOptions: PibblPlaybackOptions;\n mountSettled: boolean;\n readonly onError: (error: unknown) => void;\n readonly onEvent: (event: PibblPlaybackEvent) => void;\n renderRevision: number;\n}\n\nfunction isCurrentSlot(slot: PibblPlaybackHookSlot): boolean {\n return !slot.componentRefs.teardowns.closed &&\n !slot.pibblInstance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance &&\n slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;\n}\n\nfunction controllerOptions(\n candidate: PibblPlaybackOptions,\n onEvent: (event: PibblPlaybackEvent) => void,\n onError: (error: unknown) => void,\n): PibblPlaybackOptions {\n return {\n ...candidate,\n onEvent: typeof candidate.onEvent === 'function' ?\n onEvent : candidate.onEvent,\n onError: typeof candidate.onError === 'function' ?\n onError : candidate.onError,\n };\n}\n\n/**\n * Creates one component-owned animation playback handle for a hook slot.\n *\n * @param programInput - Animation program, optionally supplied by a signal. See\n * {@link SignalValue} , {@link PibblAnimationProgram} .\n * @param optionsInput - Playback configuration, optionally supplied by a signal. See\n * {@link SignalValue} , {@link PibblPlaybackOptionsInput} .\n * @returns Stable mount-owned playback controls and reactive status/time values. See\n * {@link PibblPlayback} .\n *\n * @see {@link SignalValue}\n * @see {@link PibblAnimationProgram}\n * @see {@link PibblPlayback}\n */\nexport function usePlayback(\n programInput: SignalValue<PibblAnimationProgram>,\n optionsInput: SignalValue<PibblPlaybackOptionsInput> = {},\n): PibblPlayback {\n const { componentRefs, pibblInstance } = requireHookContext();\n const program = resolveSignalValue(programInput);\n const options = resolvePlaybackOptions(optionsInput);\n const candidate = normalizeAnimationPlaybackCandidate(program, options);\n const candidateOptions = candidate.options;\n const slot = useHookSlot<PibblPlaybackHookSlot>('playback', teardowns => {\n let value!: PibblPlaybackHookSlot;\n const controller = createAnimationPlaybackController(\n candidate.program,\n candidateOptions,\n );\n controller.setDeferredStatusCommandOwner(pibblInstance.mainTeardowns);\n const onEvent = (event: PibblPlaybackEvent): void => {\n if (isCurrentSlot(value)) value.latestOptions.onEvent?.(event);\n };\n const onError = (error: unknown): void => {\n if (isCurrentSlot(value)) value.latestOptions.onError?.(error);\n };\n value = {\n controller,\n componentRefs,\n pibblInstance,\n latestOptions: {},\n mountSettled: false,\n onError,\n onEvent,\n renderRevision: 0,\n };\n controller.adopt(\n candidate.program,\n controllerOptions(candidateOptions, onEvent, onError),\n );\n teardowns.add(() => controller.dispose());\n return value;\n }).value;\n const revision = ++slot.renderRevision;\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error('usePlayback requires an active Pibbl render transaction.');\n }\n transaction.onFinish(success => {\n if (!success || revision !== slot.renderRevision || !isCurrentSlot(slot)) return;\n slot.controller.adopt(\n candidate.program,\n controllerOptions(candidateOptions, slot.onEvent, slot.onError),\n );\n slot.latestOptions = candidateOptions;\n if (!slot.mountSettled) {\n slot.mountSettled = true;\n if (candidateOptions.autoplay === true) slot.controller.handle.play();\n }\n });\n return slot.controller.handle;\n}\n\nfunction resolvePlaybackOptions(\n input: SignalValue<PibblPlaybackOptionsInput>,\n): PibblPlaybackOptions {\n const source = resolveSignalValue(input);\n let resolved: Record<PropertyKey, unknown> | undefined;\n for (const key in source) {\n const value = source[key as keyof PibblPlaybackOptionsInput];\n if (!isSignal(value)) continue;\n resolved ??= { ...source };\n resolved[key] = resolveSignalValue(value as SignalValue<unknown>);\n }\n return (resolved ?? source) as PibblPlaybackOptions;\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAOP,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AAGnC,SAAS,oBAAoB,mBAAmB;AAiBhD,SAAS,cAAc,MAAsC;AAC3D,SAAO,CAAC,KAAK,cAAc,UAAU,UACnC,CAAC,KAAK,cAAc,cAAc,UAClC,aAAa,eAAe,IAAI,KAAK,cAAc,MAAM,MAAM,KAAK,iBACpE,KAAK,cAAc,KAAK,IAAI,KAAK,cAAc,EAAE,MAAM,KAAK;AAChE;AAEA,SAAS,kBACP,WACA,SACA,SACsB;AACtB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,OAAO,UAAU,YAAY,aACpC,UAAU,UAAU;AAAA,IACtB,SAAS,OAAO,UAAU,YAAY,aACpC,UAAU,UAAU;AAAA,EACxB;AACF;AAgBO,SAAS,YACd,cACA,eAAuD,CAAC,GACzC;AACf,QAAM,EAAE,eAAe,cAAc,IAAI,mBAAmB;AAC5D,QAAM,UAAU,mBAAmB,YAAY;AAC/C,QAAM,UAAU,uBAAuB,YAAY;AACnD,QAAM,YAAY,oCAAoC,SAAS,OAAO;AACtE,QAAM,mBAAmB,UAAU;AACnC,QAAM,OAAO,YAAmC,YAAY,eAAa;AACvE,QAAI;AACJ,UAAM,aAAa;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,IACF;AACA,eAAW,8BAA8B,cAAc,aAAa;AACpE,UAAM,UAAU,CAAC,UAAoC;AACnD,UAAI,cAAc,KAAK,EAAG,OAAM,cAAc,UAAU,KAAK;AAAA,IAC/D;AACA,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PibblEventListenerRegistration, type PibblEventNode, type PibblNormalizedHandlers } from '../events/registrations.js';
|
|
2
|
+
import type { HtmlBoxEventHandlers, HtmlBoxSlot } from './types.js';
|
|
3
|
+
/** Candidate event state remains invisible until the shared geometry adoption. */
|
|
4
|
+
export interface HtmlNativeEventSnapshot {
|
|
5
|
+
readonly handlers: PibblNormalizedHandlers;
|
|
6
|
+
readonly path: readonly PibblEventNode[];
|
|
7
|
+
readonly inverseWorld: DOMMatrix;
|
|
8
|
+
readonly inverseProjection: DOMMatrix;
|
|
9
|
+
readonly active: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Observes the real DOM path; never enters Canvas targeting/default actions. */
|
|
12
|
+
export declare class HtmlNativeEvents {
|
|
13
|
+
private readonly slot;
|
|
14
|
+
private readonly coordinateRoot;
|
|
15
|
+
private readonly relatedNode;
|
|
16
|
+
readonly node: PibblEventListenerRegistration;
|
|
17
|
+
private readonly listeners;
|
|
18
|
+
private readonly dispatches;
|
|
19
|
+
private readonly pendingDispatches;
|
|
20
|
+
private current;
|
|
21
|
+
constructor(slot: HtmlBoxSlot, coordinateRoot: () => SVGSVGElement, relatedNode: (target: EventTarget | null) => PibblEventNode | null);
|
|
22
|
+
prepare(handlers: HtmlBoxEventHandlers, world: DOMMatrix, projection: DOMMatrix, active: boolean): HtmlNativeEventSnapshot;
|
|
23
|
+
/** Add candidates without withdrawing any listeners needed by the old snapshot. */
|
|
24
|
+
prepareListeners(snapshot: HtmlNativeEventSnapshot): void;
|
|
25
|
+
adopt(snapshot: HtmlNativeEventSnapshot): void;
|
|
26
|
+
suspend(): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
private listen;
|
|
29
|
+
private releaseDispatch;
|
|
30
|
+
private finish;
|
|
31
|
+
private coordinates;
|
|
32
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { batch } from "../signals/graph.js";
|
|
2
|
+
import { PIBBL_EVENT_DEFINITIONS } from "../events/event-definitions.js";
|
|
3
|
+
import { buildEventPath } from "../events/event-path.js";
|
|
4
|
+
import { createPibblEvent, finishEventDispatch, isPibblImmediatePropagationStopped, isPibblPropagationStopped } from "../events/event-facade.js";
|
|
5
|
+
import { invokePibblEventHandler } from "../events/propagation.js";
|
|
6
|
+
import { normalizeHandlers } from "../events/registrations.js";
|
|
7
|
+
class HtmlNativeEvents {
|
|
8
|
+
constructor(slot, coordinateRoot, relatedNode) {
|
|
9
|
+
this.slot = slot;
|
|
10
|
+
this.coordinateRoot = coordinateRoot;
|
|
11
|
+
this.relatedNode = relatedNode;
|
|
12
|
+
this.node = {
|
|
13
|
+
kind: "listener",
|
|
14
|
+
owner: slot.owner,
|
|
15
|
+
component: slot.component,
|
|
16
|
+
slot: -1,
|
|
17
|
+
suspendLayout: () => this.suspend(),
|
|
18
|
+
publicTarget: {
|
|
19
|
+
setPointerCapture: (id) => {
|
|
20
|
+
if (!slot.disposed) slot.content?.setPointerCapture(id);
|
|
21
|
+
},
|
|
22
|
+
hasPointerCapture: (id) => !slot.disposed && Boolean(slot.content?.hasPointerCapture(id)),
|
|
23
|
+
releasePointerCapture: (id) => {
|
|
24
|
+
if (!slot.disposed) slot.content?.releasePointerCapture(id);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
handlers: {},
|
|
28
|
+
live: false,
|
|
29
|
+
handlerTypesLow: 0,
|
|
30
|
+
handlerTypesHigh: 0,
|
|
31
|
+
requiredNativeTypesLow: 0,
|
|
32
|
+
requiredNativeTypesHigh: 0,
|
|
33
|
+
ownedNativeTypesLow: 0,
|
|
34
|
+
ownedNativeTypesHigh: 0
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
slot;
|
|
38
|
+
coordinateRoot;
|
|
39
|
+
relatedNode;
|
|
40
|
+
node;
|
|
41
|
+
listeners = /* @__PURE__ */ new Map();
|
|
42
|
+
dispatches = /* @__PURE__ */ new WeakMap();
|
|
43
|
+
pendingDispatches = /* @__PURE__ */ new Set();
|
|
44
|
+
current;
|
|
45
|
+
prepare(handlers, world, projection, active) {
|
|
46
|
+
const normalized = normalizeHandlers(handlers);
|
|
47
|
+
const inverseWorld = world.inverse();
|
|
48
|
+
const inverseProjection = projection.inverse();
|
|
49
|
+
const path = buildEventPath(this.node).map((node) => ({
|
|
50
|
+
...node,
|
|
51
|
+
handlers: node === this.node ? normalized : node.handlers,
|
|
52
|
+
live: node === this.node ? active : node.live
|
|
53
|
+
}));
|
|
54
|
+
return {
|
|
55
|
+
handlers: normalized,
|
|
56
|
+
path,
|
|
57
|
+
inverseWorld,
|
|
58
|
+
inverseProjection,
|
|
59
|
+
active: active && finite(inverseWorld) && finite(inverseProjection)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Add candidates without withdrawing any listeners needed by the old snapshot. */
|
|
63
|
+
prepareListeners(snapshot) {
|
|
64
|
+
if (!snapshot.active) return;
|
|
65
|
+
for (const definition of PIBBL_EVENT_DEFINITIONS) {
|
|
66
|
+
if (!this.listeners.has(definition.type) && needsEvent(snapshot, definition.type)) this.listen(definition);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
adopt(snapshot) {
|
|
70
|
+
this.current = snapshot;
|
|
71
|
+
this.node.handlers = snapshot.handlers;
|
|
72
|
+
this.node.live = snapshot.active;
|
|
73
|
+
}
|
|
74
|
+
suspend() {
|
|
75
|
+
this.node.live = false;
|
|
76
|
+
}
|
|
77
|
+
dispose() {
|
|
78
|
+
this.node.live = false;
|
|
79
|
+
for (const release of this.listeners.values()) release();
|
|
80
|
+
this.listeners.clear();
|
|
81
|
+
for (const dispatch of this.pendingDispatches) this.releaseDispatch(dispatch);
|
|
82
|
+
this.node.handlers = {};
|
|
83
|
+
this.current = void 0;
|
|
84
|
+
}
|
|
85
|
+
listen(definition) {
|
|
86
|
+
const host = this.slot.shell;
|
|
87
|
+
const capture = (original) => batch(() => {
|
|
88
|
+
const snapshot = this.current;
|
|
89
|
+
if (!snapshot || !this.node.live || !this.slot.region.active || this.slot.disposed || !needsEvent(snapshot, definition.type)) return;
|
|
90
|
+
if ((definition.type === "mouseenter" || definition.type === "mouseleave" || definition.type === "pointerenter" || definition.type === "pointerleave") && original.target !== host) return;
|
|
91
|
+
const coordinates = definition.coordinate ? this.coordinates(original, snapshot) : void 0;
|
|
92
|
+
if (definition.coordinate && !coordinates) return;
|
|
93
|
+
const path = snapshot.path;
|
|
94
|
+
const event = createPibblEvent({
|
|
95
|
+
type: definition.type,
|
|
96
|
+
target: this.node,
|
|
97
|
+
path,
|
|
98
|
+
originalEvent: original,
|
|
99
|
+
relatedTarget: this.relatedNode(original.relatedTarget ?? null),
|
|
100
|
+
nativeBubbles: original.bubbles,
|
|
101
|
+
...coordinates
|
|
102
|
+
});
|
|
103
|
+
const dispatch = { event, path, original };
|
|
104
|
+
const previous = this.dispatches.get(original);
|
|
105
|
+
if (previous) this.releaseDispatch(previous);
|
|
106
|
+
this.dispatches.set(original, dispatch);
|
|
107
|
+
this.pendingDispatches.add(dispatch);
|
|
108
|
+
if (original.bubbles) dispatch.cleanup = setTimeout(() => this.releaseDispatch(dispatch), 0);
|
|
109
|
+
for (let index = 0; index < path.length - 1; index++) {
|
|
110
|
+
if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) break;
|
|
111
|
+
invokePibblEventHandler(path[index], definition.type, true, 1, event);
|
|
112
|
+
}
|
|
113
|
+
if (this.node.live && !this.slot.disposed && !isPibblPropagationStopped(event)) invokePibblEventHandler(path[path.length - 1], definition.type, true, 2, event);
|
|
114
|
+
if (!original.bubbles) {
|
|
115
|
+
this.finish(definition.type, dispatch, false);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const bubble = (original) => batch(() => {
|
|
119
|
+
const dispatch = this.dispatches.get(original);
|
|
120
|
+
if (dispatch) this.finish(definition.type, dispatch, true);
|
|
121
|
+
});
|
|
122
|
+
host.addEventListener(definition.type, capture, { capture: true, passive: false });
|
|
123
|
+
try {
|
|
124
|
+
host.addEventListener(definition.type, bubble, { passive: false });
|
|
125
|
+
} catch (error) {
|
|
126
|
+
host.removeEventListener(definition.type, capture, true);
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
this.listeners.set(definition.type, () => {
|
|
130
|
+
host.removeEventListener(definition.type, capture, true);
|
|
131
|
+
host.removeEventListener(definition.type, bubble);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
releaseDispatch(dispatch) {
|
|
135
|
+
if (!this.pendingDispatches.delete(dispatch)) return;
|
|
136
|
+
if (dispatch.cleanup !== void 0) clearTimeout(dispatch.cleanup);
|
|
137
|
+
if (this.dispatches.get(dispatch.original) === dispatch) this.dispatches.delete(dispatch.original);
|
|
138
|
+
finishEventDispatch(dispatch.event);
|
|
139
|
+
}
|
|
140
|
+
finish(type, dispatch, bubbles) {
|
|
141
|
+
const { event, path } = dispatch;
|
|
142
|
+
try {
|
|
143
|
+
if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) return;
|
|
144
|
+
if (!isPibblImmediatePropagationStopped(event)) invokePibblEventHandler(path[path.length - 1], type, false, 2, event);
|
|
145
|
+
if (!bubbles) return;
|
|
146
|
+
for (let index = path.length - 2; index >= 0; index--) {
|
|
147
|
+
if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) break;
|
|
148
|
+
invokePibblEventHandler(path[index], type, false, 3, event);
|
|
149
|
+
}
|
|
150
|
+
} finally {
|
|
151
|
+
this.releaseDispatch(dispatch);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
coordinates(event, snapshot) {
|
|
155
|
+
const source = "changedTouches" in event ? event.changedTouches[0] : event;
|
|
156
|
+
if (!source || !Number.isFinite(source.clientX) || !Number.isFinite(source.clientY)) return;
|
|
157
|
+
const screen = this.coordinateRoot().getScreenCTM();
|
|
158
|
+
if (!screen) return;
|
|
159
|
+
const clientToOverlay = new DOMMatrix([screen.a, screen.b, screen.c, screen.d, screen.e, screen.f]).inverse();
|
|
160
|
+
const overlay = clientToOverlay.transformPoint({ x: source.clientX, y: source.clientY });
|
|
161
|
+
const root = snapshot.inverseProjection.transformPoint(overlay);
|
|
162
|
+
const local = snapshot.inverseWorld.transformPoint(root);
|
|
163
|
+
if (!Number.isFinite(root.x) || !Number.isFinite(root.y) || !Number.isFinite(local.x) || !Number.isFinite(local.y)) return;
|
|
164
|
+
return { x: root.x, y: root.y, localX: local.x, localY: local.y };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function finite(matrix) {
|
|
168
|
+
return Number.isFinite(matrix.a) && Number.isFinite(matrix.b) && Number.isFinite(matrix.c) && Number.isFinite(matrix.d) && Number.isFinite(matrix.e) && Number.isFinite(matrix.f);
|
|
169
|
+
}
|
|
170
|
+
function needsEvent(snapshot, type) {
|
|
171
|
+
for (const node of snapshot.path) {
|
|
172
|
+
if (node.live && (node.handlers[type] || node.handlers[`${type}Capture`])) return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
HtmlNativeEvents
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=html-events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/html/html-events.ts"],
|
|
4
|
+
"sourcesContent": ["import { batch } from '../signals/graph.js';\nimport { PIBBL_EVENT_DEFINITIONS, type PibblEventDefinition } from '../events/event-definitions.js';\nimport { buildEventPath } from '../events/event-path.js';\nimport { createPibblEvent, finishEventDispatch, isPibblImmediatePropagationStopped, isPibblPropagationStopped } from '../events/event-facade.js';\nimport { invokePibblEventHandler } from '../events/propagation.js';\nimport { normalizeHandlers, type PibblEventListenerRegistration, type PibblEventNode, type PibblNormalizedHandlers } from '../events/registrations.js';\nimport type { PibblEvent, PibblEventHandlers, PibblEventType } from '../events/types.js';\nimport type { HtmlBoxEventHandlers, HtmlBoxSlot } from './types.js';\n\ninterface NativeDispatch {\n readonly original: Event;\n cleanup?: ReturnType<typeof setTimeout>;\n readonly event: PibblEvent;\n readonly path: readonly PibblEventNode[];\n}\n\n/** Candidate event state remains invisible until the shared geometry adoption. */\nexport interface HtmlNativeEventSnapshot {\n readonly handlers: PibblNormalizedHandlers;\n readonly path: readonly PibblEventNode[];\n readonly inverseWorld: DOMMatrix;\n readonly inverseProjection: DOMMatrix;\n readonly active: boolean;\n}\n\n/** Observes the real DOM path; never enters Canvas targeting/default actions. */\nexport class HtmlNativeEvents {\n readonly node: PibblEventListenerRegistration;\n private readonly listeners = new Map<PibblEventType, () => void>();\n private readonly dispatches = new WeakMap<Event, NativeDispatch>();\n private readonly pendingDispatches = new Set<NativeDispatch>();\n private current: HtmlNativeEventSnapshot | undefined;\n\n constructor(\n private readonly slot: HtmlBoxSlot,\n private readonly coordinateRoot: () => SVGSVGElement,\n private readonly relatedNode: (target: EventTarget | null) => PibblEventNode | null,\n ) {\n // Dedicated virtual listener: no Canvas hit geometry, subscriptions or capture.\n this.node = {\n kind: 'listener', owner: slot.owner, component: slot.component, slot: -1,\n suspendLayout: () => this.suspend(),\n publicTarget: {\n setPointerCapture: id => { if (!slot.disposed) slot.content?.setPointerCapture(id); },\n hasPointerCapture: id => !slot.disposed && Boolean(slot.content?.hasPointerCapture(id)),\n releasePointerCapture: id => { if (!slot.disposed) slot.content?.releasePointerCapture(id); },\n },\n handlers: {}, live: false,\n handlerTypesLow: 0, handlerTypesHigh: 0,\n requiredNativeTypesLow: 0, requiredNativeTypesHigh: 0,\n ownedNativeTypesLow: 0, ownedNativeTypesHigh: 0,\n };\n }\n\n prepare(handlers: HtmlBoxEventHandlers, world: DOMMatrix, projection: DOMMatrix, active: boolean): HtmlNativeEventSnapshot {\n const normalized = normalizeHandlers(handlers as PibblEventHandlers);\n const inverseWorld = world.inverse();\n const inverseProjection = projection.inverse();\n // Preserve ancestor handlers as well as geometry during fallible HTML callbacks.\n const path = buildEventPath(this.node).map(node => ({\n ...node,\n handlers: node === this.node ? normalized : node.handlers,\n live: node === this.node ? active : node.live,\n }));\n return {\n handlers: normalized, path, inverseWorld, inverseProjection,\n active: active && finite(inverseWorld) && finite(inverseProjection),\n };\n }\n\n /** Add candidates without withdrawing any listeners needed by the old snapshot. */\n prepareListeners(snapshot: HtmlNativeEventSnapshot): void {\n if (!snapshot.active) return;\n for (const definition of PIBBL_EVENT_DEFINITIONS) {\n if (!this.listeners.has(definition.type) && needsEvent(snapshot, definition.type)) this.listen(definition);\n }\n }\n\n adopt(snapshot: HtmlNativeEventSnapshot): void {\n this.current = snapshot;\n this.node.handlers = snapshot.handlers;\n this.node.live = snapshot.active;\n }\n\n suspend(): void { this.node.live = false; }\n\n dispose(): void {\n this.node.live = false;\n for (const release of this.listeners.values()) release();\n this.listeners.clear();\n for (const dispatch of this.pendingDispatches) this.releaseDispatch(dispatch);\n this.node.handlers = {};\n this.current = undefined;\n }\n\n private listen(definition: PibblEventDefinition): void {\n const host = this.slot.shell!;\n const capture = (original: Event) => batch(() => {\n const snapshot = this.current;\n if (!snapshot || !this.node.live || !this.slot.region.active || this.slot.disposed || !needsEvent(snapshot, definition.type)) return;\n // Native enter/leave traverse ancestors for each nested DOM target.\n if ((definition.type === 'mouseenter' || definition.type === 'mouseleave' ||\n definition.type === 'pointerenter' || definition.type === 'pointerleave') && original.target !== host) return;\n const coordinates = definition.coordinate ? this.coordinates(original, snapshot) : undefined;\n if (definition.coordinate && !coordinates) return;\n const path = snapshot.path;\n const event = createPibblEvent({\n type: definition.type, target: this.node, path, originalEvent: original,\n relatedTarget: this.relatedNode((original as FocusEvent).relatedTarget ?? null),\n nativeBubbles: original.bubbles,\n ...coordinates,\n });\n const dispatch: NativeDispatch = { event, path, original };\n const previous = this.dispatches.get(original);\n if (previous) this.releaseDispatch(previous);\n this.dispatches.set(original, dispatch);\n this.pendingDispatches.add(dispatch);\n // Native descendants may stop propagation before our bubble listener runs.\n // A microtask can run BETWEEN native listeners, so only a later task may\n // expire an abandoned dispatch. Normal bubbling releases synchronously.\n if (original.bubbles) dispatch.cleanup = setTimeout(() => this.releaseDispatch(dispatch), 0);\n for (let index = 0; index < path.length - 1; index++) {\n if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) break;\n invokePibblEventHandler(path[index], definition.type, true, 1, event);\n }\n if (this.node.live && !this.slot.disposed && !isPibblPropagationStopped(event)) invokePibblEventHandler(path[path.length - 1], definition.type, true, 2, event);\n // Focus/blur/enter/leave have no native bubble callback.\n if (!original.bubbles) {\n this.finish(definition.type, dispatch, false);\n }\n });\n const bubble = (original: Event) => batch(() => {\n const dispatch = this.dispatches.get(original);\n if (dispatch) this.finish(definition.type, dispatch, true);\n });\n host.addEventListener(definition.type, capture, { capture: true, passive: false });\n try {\n host.addEventListener(definition.type, bubble, { passive: false });\n } catch (error) {\n host.removeEventListener(definition.type, capture, true);\n throw error;\n }\n this.listeners.set(definition.type, () => {\n host.removeEventListener(definition.type, capture, true);\n host.removeEventListener(definition.type, bubble);\n });\n }\n\n private releaseDispatch(dispatch: NativeDispatch): void {\n if (!this.pendingDispatches.delete(dispatch)) return;\n if (dispatch.cleanup !== undefined) clearTimeout(dispatch.cleanup);\n if (this.dispatches.get(dispatch.original) === dispatch) this.dispatches.delete(dispatch.original);\n finishEventDispatch(dispatch.event);\n }\n\n private finish(type: PibblEventType, dispatch: NativeDispatch, bubbles: boolean): void {\n const { event, path } = dispatch;\n try {\n if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) return;\n if (!isPibblImmediatePropagationStopped(event)) invokePibblEventHandler(path[path.length - 1], type, false, 2, event);\n if (!bubbles) return;\n for (let index = path.length - 2; index >= 0; index--) {\n if (!this.node.live || this.slot.disposed || isPibblPropagationStopped(event)) break;\n invokePibblEventHandler(path[index], type, false, 3, event);\n }\n } finally { this.releaseDispatch(dispatch); }\n }\n\n private coordinates(event: Event, snapshot: HtmlNativeEventSnapshot): { x: number; y: number; localX: number; localY: number } | undefined {\n const source = 'changedTouches' in event ? (event as TouchEvent).changedTouches[0] : event as MouseEvent;\n if (!source || !Number.isFinite(source.clientX) || !Number.isFinite(source.clientY)) return;\n // This unpainted SVG at overlay (0,0) includes shared CSS affine transforms.\n const screen = this.coordinateRoot().getScreenCTM();\n if (!screen) return;\n const clientToOverlay = new DOMMatrix([screen.a, screen.b, screen.c, screen.d, screen.e, screen.f]).inverse();\n const overlay = clientToOverlay.transformPoint({ x: source.clientX, y: source.clientY });\n const root = snapshot.inverseProjection.transformPoint(overlay);\n const local = snapshot.inverseWorld.transformPoint(root);\n if (!Number.isFinite(root.x) || !Number.isFinite(root.y) || !Number.isFinite(local.x) || !Number.isFinite(local.y)) return;\n return { x: root.x, y: root.y, localX: local.x, localY: local.y };\n }\n}\n\nfunction finite(matrix: DOMMatrixReadOnly): boolean {\n return Number.isFinite(matrix.a) && Number.isFinite(matrix.b) && Number.isFinite(matrix.c) &&\n Number.isFinite(matrix.d) && Number.isFinite(matrix.e) && Number.isFinite(matrix.f);\n}\n\nfunction needsEvent(snapshot: HtmlNativeEventSnapshot, type: PibblEventType): boolean {\n for (const node of snapshot.path) {\n if (node.live && (node.handlers[type] || node.handlers[`${type}Capture`])) return true;\n }\n return false;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB,SAAS,+BAA0D;AACnE,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB,qBAAqB,oCAAoC,iCAAiC;AACrH,SAAS,+BAA+B;AACxC,SAAS,yBAAiH;AAqBnH,MAAM,iBAAiB;AAAA,EAO5B,YACmB,MACA,gBACA,aACjB;AAHiB;AACA;AACA;AAGjB,SAAK,OAAO;AAAA,MACV,MAAM;AAAA,MAAY,OAAO,KAAK;AAAA,MAAO,WAAW,KAAK;AAAA,MAAW,MAAM;AAAA,MACtE,eAAe,MAAM,KAAK,QAAQ;AAAA,MAClC,cAAc;AAAA,QACZ,mBAAmB,QAAM;AAAE,cAAI,CAAC,KAAK,SAAU,MAAK,SAAS,kBAAkB,EAAE;AAAA,QAAG;AAAA,QACpF,mBAAmB,QAAM,CAAC,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AAkB,eAAe,OAAO;AAC9D,UAAM,QAAQ,SAAS,aAAa,eAAe,IAAI;AACvD,QAAI,CAAC,OAAO,SAAS,KAAK,CAAC,KAAK,CAAC,OAAO,SAAS,KAAK,CAAC,KAAK,CAAC,OAAO,SAAS,MAAM,CAAC,KAAK,CAAC,OAAO,SAAS,MAAM,CAAC,EAAG;AACpH,WAAO,EAAE,GAAG,KAAK,GAAG,GAAG,KAAK,GAAG,QAAQ,MAAM,GAAG,QAAQ,MAAM,EAAE;AAAA,EAClE;AACF;AAEA,SAAS,OAAO,QAAoC;AAClD,SAAO,OAAO,SAAS,OAAO,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC,KACvF,OAAO,SAAS,OAAO,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC;AACtF;AAEA,SAAS,WAAW,UAAmC,MAA+B;AACpF,aAAW,QAAQ,SAAS,MAAM;AAChC,QAAI,KAAK,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,GAAG,IAAI,SAAS,GAAI,QAAO;AAAA,EACpF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -10,6 +10,9 @@ export declare class HtmlService implements HtmlBridge {
|
|
|
10
10
|
private svg;
|
|
11
11
|
private viewport;
|
|
12
12
|
private disposed;
|
|
13
|
+
private suspended;
|
|
14
|
+
private projections;
|
|
15
|
+
private nextSnapshots;
|
|
13
16
|
private rendered;
|
|
14
17
|
constructor(root: PibblEventRoot);
|
|
15
18
|
private enterTransaction;
|
|
@@ -20,10 +23,13 @@ export declare class HtmlService implements HtmlBridge {
|
|
|
20
23
|
private hasHosts;
|
|
21
24
|
release(slot: HtmlBoxSlot): void;
|
|
22
25
|
private retire;
|
|
26
|
+
private prepare;
|
|
23
27
|
private publish;
|
|
28
|
+
private adopt;
|
|
24
29
|
private ensureDOM;
|
|
25
|
-
private
|
|
26
|
-
private
|
|
30
|
+
private publishContent;
|
|
31
|
+
private applyGeometry;
|
|
32
|
+
private prepareClips;
|
|
27
33
|
private reset;
|
|
28
34
|
dispose(): void;
|
|
29
35
|
}
|