@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
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
import { readyLayoutModule } from "./wasm/module.js";
|
|
2
|
+
const NODE_STRIDE = 70;
|
|
3
|
+
const MEASUREMENT_STRIDE = 7;
|
|
4
|
+
const LENGTH_NONE = 0;
|
|
5
|
+
const LENGTH_POINT = 1;
|
|
6
|
+
const LENGTH_PERCENT = 2;
|
|
7
|
+
const LENGTH_AUTO = 3;
|
|
8
|
+
const FLEX_DIRECTIONS = [
|
|
9
|
+
"row",
|
|
10
|
+
"row-reverse",
|
|
11
|
+
"column",
|
|
12
|
+
"column-reverse"
|
|
13
|
+
];
|
|
14
|
+
const FLEX_WRAPS = ["nowrap", "wrap", "wrap-reverse"];
|
|
15
|
+
const JUSTIFY_CONTENT = [
|
|
16
|
+
"flex-start",
|
|
17
|
+
"flex-end",
|
|
18
|
+
"center",
|
|
19
|
+
"space-between",
|
|
20
|
+
"space-around",
|
|
21
|
+
"space-evenly"
|
|
22
|
+
];
|
|
23
|
+
const ALIGNMENTS = [
|
|
24
|
+
"stretch",
|
|
25
|
+
"flex-start",
|
|
26
|
+
"flex-end",
|
|
27
|
+
"center",
|
|
28
|
+
"baseline",
|
|
29
|
+
"first-baseline",
|
|
30
|
+
"last-baseline"
|
|
31
|
+
];
|
|
32
|
+
const ALIGN_SELF = [
|
|
33
|
+
"auto",
|
|
34
|
+
"stretch",
|
|
35
|
+
"flex-start",
|
|
36
|
+
"flex-end",
|
|
37
|
+
"center",
|
|
38
|
+
"baseline",
|
|
39
|
+
"first-baseline",
|
|
40
|
+
"last-baseline"
|
|
41
|
+
];
|
|
42
|
+
const ALIGN_CONTENT = [
|
|
43
|
+
"flex-start",
|
|
44
|
+
"flex-end",
|
|
45
|
+
"center",
|
|
46
|
+
"stretch",
|
|
47
|
+
"space-between",
|
|
48
|
+
"space-around",
|
|
49
|
+
"space-evenly"
|
|
50
|
+
];
|
|
51
|
+
const POSITIONS = ["relative", "static", "absolute"];
|
|
52
|
+
const BOX_SIZINGS = ["border-box", "content-box"];
|
|
53
|
+
const GRID_FLOWS = ["row", "column", "row dense", "column dense"];
|
|
54
|
+
function status(value, action) {
|
|
55
|
+
if (value !== 0)
|
|
56
|
+
throw new Error(`Standalone native layout ${action} failed (${value}).`);
|
|
57
|
+
}
|
|
58
|
+
function finite(value, property) {
|
|
59
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
`Standalone layout ${property} must be a finite number.`
|
|
62
|
+
);
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function length(records, offset, value, property) {
|
|
66
|
+
if (value === void 0) {
|
|
67
|
+
records[offset] = 0;
|
|
68
|
+
records[offset + 1] = LENGTH_NONE;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (value === "auto") {
|
|
72
|
+
records[offset] = 0;
|
|
73
|
+
records[offset + 1] = LENGTH_AUTO;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (typeof value === "number") {
|
|
77
|
+
records[offset] = finite(value, property);
|
|
78
|
+
records[offset + 1] = LENGTH_POINT;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value === "string" && /^-?(?:\d+|\d*\.\d+)%$/.test(value)) {
|
|
82
|
+
records[offset] = Number.parseFloat(value);
|
|
83
|
+
records[offset + 1] = LENGTH_PERCENT;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
throw new TypeError(
|
|
87
|
+
`Standalone layout ${property} must be numeric, percentage, auto, or omitted.`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function numeric(records, offset, value, fallback, property) {
|
|
91
|
+
records[offset] = value === void 0 ? fallback : finite(value, property);
|
|
92
|
+
}
|
|
93
|
+
function numericValue(value, fallback, property) {
|
|
94
|
+
return value === void 0 ? fallback : finite(value, property);
|
|
95
|
+
}
|
|
96
|
+
function enumCode(value, values, fallback, property) {
|
|
97
|
+
if (value === void 0) return fallback;
|
|
98
|
+
const index = values.indexOf(value);
|
|
99
|
+
if (index < 0)
|
|
100
|
+
throw new TypeError(
|
|
101
|
+
`Standalone layout ${property} is unsupported by the native tree boundary.`
|
|
102
|
+
);
|
|
103
|
+
return index;
|
|
104
|
+
}
|
|
105
|
+
function edge(style, side, property) {
|
|
106
|
+
const value = style[property];
|
|
107
|
+
if (value === void 0 || typeof value === "number" || typeof value === "string")
|
|
108
|
+
return value;
|
|
109
|
+
if (value !== null && typeof value === "object")
|
|
110
|
+
return value[side];
|
|
111
|
+
throw new TypeError(
|
|
112
|
+
`Standalone layout ${property} must be a scalar or physical-edge record.`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
class NativeStandaloneLayoutKernel {
|
|
116
|
+
#kernel;
|
|
117
|
+
#handle = 0;
|
|
118
|
+
#generation = 0;
|
|
119
|
+
constructor() {
|
|
120
|
+
this.#kernel = new WebAssembly.Instance(readyLayoutModule()).exports;
|
|
121
|
+
this.#handle = this.kernel.standalone_tree_create();
|
|
122
|
+
this.#generation = this.#handle ? this.kernel.standalone_tree_generation(this.#handle) : 0;
|
|
123
|
+
if (!this.#handle || !this.#generation)
|
|
124
|
+
throw new Error("Standalone native tree allocation failed.");
|
|
125
|
+
}
|
|
126
|
+
get kernel() {
|
|
127
|
+
if (!this.#kernel)
|
|
128
|
+
throw new Error("The standalone layout kernel has been disposed.");
|
|
129
|
+
return this.#kernel;
|
|
130
|
+
}
|
|
131
|
+
calculate(input) {
|
|
132
|
+
if (!Number.isFinite(input.width) || input.width < 0 || !Number.isFinite(input.height) || input.height < 0)
|
|
133
|
+
throw new RangeError(
|
|
134
|
+
"Standalone layout constraints must be finite and nonnegative."
|
|
135
|
+
);
|
|
136
|
+
const nodes = input.nodes;
|
|
137
|
+
const sourceIndex = /* @__PURE__ */ new Map();
|
|
138
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
139
|
+
const id = nodes[index].id;
|
|
140
|
+
if (!Number.isInteger(id) || id < 0 || sourceIndex.has(id))
|
|
141
|
+
throw new Error(
|
|
142
|
+
"Standalone layout node ids must be unique nonnegative integers."
|
|
143
|
+
);
|
|
144
|
+
sourceIndex.set(id, index);
|
|
145
|
+
}
|
|
146
|
+
const rootIndex = sourceIndex.get(input.root);
|
|
147
|
+
if (rootIndex === void 0)
|
|
148
|
+
throw new Error(
|
|
149
|
+
"Standalone layout root is not present in the owned node set."
|
|
150
|
+
);
|
|
151
|
+
const children = [];
|
|
152
|
+
const pointer = this.kernel.standalone_tree_resize_nodes(
|
|
153
|
+
this.#handle,
|
|
154
|
+
this.#generation,
|
|
155
|
+
nodes.length
|
|
156
|
+
);
|
|
157
|
+
if (!pointer && nodes.length)
|
|
158
|
+
throw new Error("Standalone native node storage allocation failed.");
|
|
159
|
+
const records = new Float64Array(
|
|
160
|
+
this.kernel.memory.buffer,
|
|
161
|
+
pointer,
|
|
162
|
+
nodes.length * NODE_STRIDE
|
|
163
|
+
);
|
|
164
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
165
|
+
const node = nodes[index];
|
|
166
|
+
const offset = index * NODE_STRIDE;
|
|
167
|
+
const style = node.style;
|
|
168
|
+
const parentIndex = node.parent === void 0 ? -1 : sourceIndex.get(node.parent);
|
|
169
|
+
if (parentIndex === void 0)
|
|
170
|
+
throw new Error(
|
|
171
|
+
"Standalone layout node parent is not present in the owned node set."
|
|
172
|
+
);
|
|
173
|
+
const parent = parentIndex < 0 ? void 0 : nodes[parentIndex];
|
|
174
|
+
const gridContainerDeclaration = style.gridTemplateColumns !== void 0 || style.gridTemplateRows !== void 0 || style.gridAutoColumns !== void 0 || style.gridAutoRows !== void 0 || style.gridAutoFlow !== void 0;
|
|
175
|
+
const gridItemDeclaration = style.gridColumnStart !== void 0 || style.gridColumnSpan !== void 0 || style.gridRowStart !== void 0 || style.gridRowSpan !== void 0;
|
|
176
|
+
const flexContainerDeclaration = style.flexDirection !== void 0 || style.flexWrap !== void 0 || style.justifyContent !== void 0 || style.alignContent !== void 0;
|
|
177
|
+
const flexItemDeclaration = style.flexBasis !== void 0 || style.flexGrow !== void 0 || style.flexShrink !== void 0;
|
|
178
|
+
if (style.layout !== "grid" && gridContainerDeclaration)
|
|
179
|
+
throw new TypeError(
|
|
180
|
+
"Standalone Grid declarations require layout: 'grid'."
|
|
181
|
+
);
|
|
182
|
+
if (style.layout === "grid" && flexContainerDeclaration)
|
|
183
|
+
throw new TypeError(
|
|
184
|
+
"Standalone Flex-container declarations cannot be applied to a Grid owner."
|
|
185
|
+
);
|
|
186
|
+
if (parent === void 0 && style.layout === "grid" && flexItemDeclaration)
|
|
187
|
+
throw new TypeError(
|
|
188
|
+
"Standalone Flex item declarations require a Flex parent."
|
|
189
|
+
);
|
|
190
|
+
if (parent?.style.layout === "grid" && flexItemDeclaration)
|
|
191
|
+
throw new TypeError(
|
|
192
|
+
"Standalone Flex item declarations require a Flex parent."
|
|
193
|
+
);
|
|
194
|
+
if (parent?.style.layout !== "grid" && gridItemDeclaration)
|
|
195
|
+
throw new TypeError(
|
|
196
|
+
"Standalone Grid item placement requires a Grid parent."
|
|
197
|
+
);
|
|
198
|
+
if (style.overflow !== void 0 && style.overflow !== "visible")
|
|
199
|
+
throw new TypeError(
|
|
200
|
+
"The standalone native tree does not yet admit clipped overflow."
|
|
201
|
+
);
|
|
202
|
+
if (style.alignItems === "baseline" || style.alignItems === "first-baseline" || style.alignItems === "last-baseline" || style.alignSelf === "baseline" || style.alignSelf === "first-baseline" || style.alignSelf === "last-baseline")
|
|
203
|
+
throw new TypeError("Standalone baseline alignment requires a baseline provider and is not supported.");
|
|
204
|
+
records[offset] = index;
|
|
205
|
+
records[offset + 1] = parentIndex;
|
|
206
|
+
records[offset + 2] = children.length;
|
|
207
|
+
records[offset + 3] = node.children.length;
|
|
208
|
+
for (const child of node.children) {
|
|
209
|
+
const childIndex = sourceIndex.get(child);
|
|
210
|
+
if (childIndex === void 0)
|
|
211
|
+
throw new Error(
|
|
212
|
+
"Standalone layout child is not present in the owned node set."
|
|
213
|
+
);
|
|
214
|
+
children.push(childIndex);
|
|
215
|
+
}
|
|
216
|
+
length(records, offset + 4, style.width, "width");
|
|
217
|
+
length(records, offset + 6, style.height, "height");
|
|
218
|
+
length(records, offset + 8, style.minWidth, "minWidth");
|
|
219
|
+
length(records, offset + 10, style.minHeight, "minHeight");
|
|
220
|
+
length(records, offset + 12, style.maxWidth, "maxWidth");
|
|
221
|
+
length(records, offset + 14, style.maxHeight, "maxHeight");
|
|
222
|
+
length(records, offset + 16, style.flexBasis, "flexBasis");
|
|
223
|
+
numeric(records, offset + 18, style.flexGrow, 0, "flexGrow");
|
|
224
|
+
numeric(records, offset + 19, style.flexShrink, 0, "flexShrink");
|
|
225
|
+
numeric(records, offset + 20, style.gap, 0, "gap");
|
|
226
|
+
numeric(records, offset + 21, style.rowGap, -1, "rowGap");
|
|
227
|
+
numeric(records, offset + 22, style.columnGap, -1, "columnGap");
|
|
228
|
+
records[offset + 23] = enumCode(
|
|
229
|
+
style.flexDirection,
|
|
230
|
+
FLEX_DIRECTIONS,
|
|
231
|
+
0,
|
|
232
|
+
"flexDirection"
|
|
233
|
+
);
|
|
234
|
+
records[offset + 24] = enumCode(
|
|
235
|
+
style.flexWrap,
|
|
236
|
+
FLEX_WRAPS,
|
|
237
|
+
0,
|
|
238
|
+
"flexWrap"
|
|
239
|
+
);
|
|
240
|
+
records[offset + 25] = enumCode(
|
|
241
|
+
style.justifyContent,
|
|
242
|
+
JUSTIFY_CONTENT,
|
|
243
|
+
0,
|
|
244
|
+
"justifyContent"
|
|
245
|
+
);
|
|
246
|
+
records[offset + 26] = enumCode(
|
|
247
|
+
style.alignItems,
|
|
248
|
+
ALIGNMENTS,
|
|
249
|
+
0,
|
|
250
|
+
"alignItems"
|
|
251
|
+
);
|
|
252
|
+
records[offset + 27] = enumCode(
|
|
253
|
+
style.alignSelf,
|
|
254
|
+
ALIGN_SELF,
|
|
255
|
+
0,
|
|
256
|
+
"alignSelf"
|
|
257
|
+
);
|
|
258
|
+
records[offset + 50] = enumCode(style.alignContent, ALIGN_CONTENT, 0, "alignContent");
|
|
259
|
+
records[offset + 51] = enumCode(style.position, POSITIONS, 0, "position");
|
|
260
|
+
records[offset + 52] = enumCode(style.boxSizing, BOX_SIZINGS, 0, "boxSizing");
|
|
261
|
+
numeric(records, offset + 53, style.aspectRatio, 0, "aspectRatio");
|
|
262
|
+
if (records[offset + 53] < 0 || records[offset + 53] !== 0 && records[offset + 53] <= 0)
|
|
263
|
+
throw new TypeError("Standalone layout aspectRatio must be positive.");
|
|
264
|
+
length(records, offset + 54, style.left, "left");
|
|
265
|
+
length(records, offset + 56, style.right, "right");
|
|
266
|
+
length(records, offset + 58, style.top, "top");
|
|
267
|
+
length(records, offset + 60, style.bottom, "bottom");
|
|
268
|
+
const borderLeft = edge(style, "left", "borderWidth") ?? 0;
|
|
269
|
+
const borderRight = edge(style, "right", "borderWidth") ?? 0;
|
|
270
|
+
const borderTop = edge(style, "top", "borderWidth") ?? 0;
|
|
271
|
+
const borderBottom = edge(style, "bottom", "borderWidth") ?? 0;
|
|
272
|
+
records[offset + 62] = finite(borderLeft, "borderWidth.left");
|
|
273
|
+
records[offset + 63] = finite(borderRight, "borderWidth.right");
|
|
274
|
+
records[offset + 64] = finite(borderTop, "borderWidth.top");
|
|
275
|
+
records[offset + 65] = finite(borderBottom, "borderWidth.bottom");
|
|
276
|
+
if (records[offset + 62] < 0 || records[offset + 63] < 0 || records[offset + 64] < 0 || records[offset + 65] < 0)
|
|
277
|
+
throw new TypeError("Standalone layout borderWidth must be nonnegative.");
|
|
278
|
+
length(
|
|
279
|
+
records,
|
|
280
|
+
offset + 28,
|
|
281
|
+
style.marginLeft ?? style.margin,
|
|
282
|
+
"marginLeft"
|
|
283
|
+
);
|
|
284
|
+
length(
|
|
285
|
+
records,
|
|
286
|
+
offset + 30,
|
|
287
|
+
style.marginRight ?? style.margin,
|
|
288
|
+
"marginRight"
|
|
289
|
+
);
|
|
290
|
+
length(
|
|
291
|
+
records,
|
|
292
|
+
offset + 32,
|
|
293
|
+
style.marginTop ?? style.margin,
|
|
294
|
+
"marginTop"
|
|
295
|
+
);
|
|
296
|
+
length(
|
|
297
|
+
records,
|
|
298
|
+
offset + 34,
|
|
299
|
+
style.marginBottom ?? style.margin,
|
|
300
|
+
"marginBottom"
|
|
301
|
+
);
|
|
302
|
+
length(
|
|
303
|
+
records,
|
|
304
|
+
offset + 36,
|
|
305
|
+
edge(style, "left", "padding") ?? 0,
|
|
306
|
+
"padding.left"
|
|
307
|
+
);
|
|
308
|
+
length(
|
|
309
|
+
records,
|
|
310
|
+
offset + 38,
|
|
311
|
+
edge(style, "right", "padding") ?? 0,
|
|
312
|
+
"padding.right"
|
|
313
|
+
);
|
|
314
|
+
length(
|
|
315
|
+
records,
|
|
316
|
+
offset + 40,
|
|
317
|
+
edge(style, "top", "padding") ?? 0,
|
|
318
|
+
"padding.top"
|
|
319
|
+
);
|
|
320
|
+
length(
|
|
321
|
+
records,
|
|
322
|
+
offset + 42,
|
|
323
|
+
edge(style, "bottom", "padding") ?? 0,
|
|
324
|
+
"padding.bottom"
|
|
325
|
+
);
|
|
326
|
+
if (records[offset + 37] !== LENGTH_POINT && records[offset + 37] !== LENGTH_PERCENT || records[offset + 39] !== LENGTH_POINT && records[offset + 39] !== LENGTH_PERCENT || records[offset + 41] !== LENGTH_POINT && records[offset + 41] !== LENGTH_PERCENT || records[offset + 43] !== LENGTH_POINT && records[offset + 43] !== LENGTH_PERCENT)
|
|
327
|
+
throw new TypeError(
|
|
328
|
+
"Standalone layout padding must be numeric or percentage."
|
|
329
|
+
);
|
|
330
|
+
records[offset + 44] = node.measure ? 1 : 0;
|
|
331
|
+
records[offset + 49] = node.measureIntrinsic ? 1 : 0;
|
|
332
|
+
records[offset + 45] = numericValue(
|
|
333
|
+
style.gridColumnStart,
|
|
334
|
+
0,
|
|
335
|
+
"gridColumnStart"
|
|
336
|
+
);
|
|
337
|
+
records[offset + 46] = numericValue(
|
|
338
|
+
style.gridColumnSpan,
|
|
339
|
+
1,
|
|
340
|
+
"gridColumnSpan"
|
|
341
|
+
);
|
|
342
|
+
records[offset + 47] = numericValue(
|
|
343
|
+
style.gridRowStart,
|
|
344
|
+
0,
|
|
345
|
+
"gridRowStart"
|
|
346
|
+
);
|
|
347
|
+
records[offset + 48] = numericValue(style.gridRowSpan, 1, "gridRowSpan");
|
|
348
|
+
}
|
|
349
|
+
const grid = [];
|
|
350
|
+
const breadth = (value, property) => {
|
|
351
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0)
|
|
352
|
+
return [0, value];
|
|
353
|
+
if (typeof value === "string" && /^(?:\d+|\d*\.\d+)%$/.test(value))
|
|
354
|
+
return [1, Number.parseFloat(value)];
|
|
355
|
+
if (typeof value === "string" && /^(?:\d+|\d*\.\d+)fr$/.test(value) && Number.parseFloat(value) >= 0)
|
|
356
|
+
return [2, Number.parseFloat(value)];
|
|
357
|
+
if (value === "min-content") return [3, 0];
|
|
358
|
+
if (value === "max-content") return [4, 0];
|
|
359
|
+
if (value === "auto") return [5, 0];
|
|
360
|
+
throw new TypeError(
|
|
361
|
+
`Standalone Grid ${property} must be a finite, percentage, fractional, or intrinsic track.`
|
|
362
|
+
);
|
|
363
|
+
};
|
|
364
|
+
const track = (value, property) => {
|
|
365
|
+
if (value !== null && typeof value === "object" && value.kind === "minmax") {
|
|
366
|
+
const min = breadth(
|
|
367
|
+
value.min,
|
|
368
|
+
`${property}.min`
|
|
369
|
+
);
|
|
370
|
+
const max = breadth(
|
|
371
|
+
value.max,
|
|
372
|
+
`${property}.max`
|
|
373
|
+
);
|
|
374
|
+
return [6, 0, min[0], min[1], max[0], max[1], 0];
|
|
375
|
+
}
|
|
376
|
+
if (value !== null && typeof value === "object" && value.kind === "fit-content") {
|
|
377
|
+
const limit = breadth(
|
|
378
|
+
value.limit,
|
|
379
|
+
`${property}.limit`
|
|
380
|
+
);
|
|
381
|
+
if (limit[0] > 1)
|
|
382
|
+
throw new TypeError(
|
|
383
|
+
`Standalone Grid ${property} fit-content limit must be numeric or percentage.`
|
|
384
|
+
);
|
|
385
|
+
return [limit[0] === 1 ? 9 : 7, limit[1], 0, 0, 4, 0, 0];
|
|
386
|
+
}
|
|
387
|
+
const fixed = breadth(value, property);
|
|
388
|
+
return [fixed[0], fixed[1], 0, 0, 4, fixed[1], 0];
|
|
389
|
+
};
|
|
390
|
+
const expand = (value, property, target, nestedAuto = false) => {
|
|
391
|
+
if (value !== null && typeof value === "object" && value.kind === "repeat") {
|
|
392
|
+
const repeat = value;
|
|
393
|
+
if (!Array.isArray(repeat.tracks) || !repeat.tracks.length)
|
|
394
|
+
throw new TypeError(
|
|
395
|
+
`Standalone Grid ${property} repeat requires tracks.`
|
|
396
|
+
);
|
|
397
|
+
if (repeat.count === "auto-fill" || repeat.count === "auto-fit") {
|
|
398
|
+
if (nestedAuto)
|
|
399
|
+
throw new TypeError(
|
|
400
|
+
`Standalone Grid ${property} does not permit nested automatic repeats.`
|
|
401
|
+
);
|
|
402
|
+
const pattern = [];
|
|
403
|
+
for (const nested of repeat.tracks)
|
|
404
|
+
expand(nested, `${property}.tracks`, pattern, true);
|
|
405
|
+
target.push([
|
|
406
|
+
8,
|
|
407
|
+
repeat.count === "auto-fill" ? 1 : 2,
|
|
408
|
+
pattern.length,
|
|
409
|
+
0,
|
|
410
|
+
0,
|
|
411
|
+
0,
|
|
412
|
+
0
|
|
413
|
+
]);
|
|
414
|
+
for (const record of pattern) target.push(record);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
if (!Number.isInteger(repeat.count) || repeat.count < 1)
|
|
418
|
+
throw new TypeError(
|
|
419
|
+
`Standalone Grid ${property} repeat count must be positive or automatic.`
|
|
420
|
+
);
|
|
421
|
+
for (let count2 = 0; count2 < repeat.count; count2++)
|
|
422
|
+
for (const nested of repeat.tracks)
|
|
423
|
+
expand(nested, `${property}.tracks`, target, nestedAuto);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
target.push(track(value, property));
|
|
427
|
+
};
|
|
428
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
429
|
+
const style = nodes[index].style;
|
|
430
|
+
if (style.layout !== "grid") continue;
|
|
431
|
+
const columns = style.gridTemplateColumns;
|
|
432
|
+
const rows = style.gridTemplateRows;
|
|
433
|
+
if (!Array.isArray(columns) || !Array.isArray(rows) || !columns.length || !rows.length)
|
|
434
|
+
throw new TypeError(
|
|
435
|
+
"Standalone Grid requires nonempty explicit column and row tracks."
|
|
436
|
+
);
|
|
437
|
+
const packedColumns = [];
|
|
438
|
+
const packedRows = [];
|
|
439
|
+
for (const value of columns)
|
|
440
|
+
expand(value, "gridTemplateColumns", packedColumns);
|
|
441
|
+
for (const value of rows) expand(value, "gridTemplateRows", packedRows);
|
|
442
|
+
const flow = enumCode(style.gridAutoFlow, GRID_FLOWS, 0, "gridAutoFlow");
|
|
443
|
+
const autoColumn = style.gridAutoColumns === void 0 ? void 0 : track(style.gridAutoColumns, "gridAutoColumns");
|
|
444
|
+
const autoRow = style.gridAutoRows === void 0 ? void 0 : track(style.gridAutoRows, "gridAutoRows");
|
|
445
|
+
grid.push(
|
|
446
|
+
index,
|
|
447
|
+
packedColumns.length,
|
|
448
|
+
packedRows.length,
|
|
449
|
+
numericValue(style.columnGap ?? style.gap, 0, "columnGap"),
|
|
450
|
+
numericValue(style.rowGap ?? style.gap, 0, "rowGap"),
|
|
451
|
+
flow,
|
|
452
|
+
autoColumn ? 1 : 0,
|
|
453
|
+
autoRow ? 1 : 0,
|
|
454
|
+
...autoColumn ?? [0, 0, 0, 0, 4, 0, 0],
|
|
455
|
+
...autoRow ?? [0, 0, 0, 0, 4, 0, 0]
|
|
456
|
+
);
|
|
457
|
+
for (const value of packedColumns) grid.push(...value);
|
|
458
|
+
for (const value of packedRows) grid.push(...value);
|
|
459
|
+
}
|
|
460
|
+
const gridPointer = this.kernel.standalone_tree_resize_grid(
|
|
461
|
+
this.#handle,
|
|
462
|
+
this.#generation,
|
|
463
|
+
grid.length
|
|
464
|
+
);
|
|
465
|
+
if (!gridPointer && grid.length)
|
|
466
|
+
throw new Error("Standalone native Grid storage allocation failed.");
|
|
467
|
+
new Float64Array(this.kernel.memory.buffer, gridPointer, grid.length).set(
|
|
468
|
+
grid
|
|
469
|
+
);
|
|
470
|
+
const childPointer = this.kernel.standalone_tree_resize_children(
|
|
471
|
+
this.#handle,
|
|
472
|
+
this.#generation,
|
|
473
|
+
children.length
|
|
474
|
+
);
|
|
475
|
+
if (!childPointer && children.length)
|
|
476
|
+
throw new Error("Standalone native child storage allocation failed.");
|
|
477
|
+
new Uint32Array(
|
|
478
|
+
this.kernel.memory.buffer,
|
|
479
|
+
childPointer,
|
|
480
|
+
children.length
|
|
481
|
+
).set(children);
|
|
482
|
+
status(
|
|
483
|
+
this.kernel.standalone_tree_replace(
|
|
484
|
+
this.#handle,
|
|
485
|
+
this.#generation,
|
|
486
|
+
rootIndex,
|
|
487
|
+
input.direction === "rtl" ? 1 : 0
|
|
488
|
+
),
|
|
489
|
+
"tree replacement"
|
|
490
|
+
);
|
|
491
|
+
status(
|
|
492
|
+
this.kernel.standalone_tree_prepare(
|
|
493
|
+
this.#handle,
|
|
494
|
+
this.#generation,
|
|
495
|
+
input.width,
|
|
496
|
+
input.height
|
|
497
|
+
),
|
|
498
|
+
"measurement preparation"
|
|
499
|
+
);
|
|
500
|
+
const count = this.kernel.standalone_tree_measure_count(
|
|
501
|
+
this.#handle,
|
|
502
|
+
this.#generation
|
|
503
|
+
);
|
|
504
|
+
const measurementPointer = this.kernel.standalone_tree_resize_measurements(
|
|
505
|
+
this.#handle,
|
|
506
|
+
this.#generation,
|
|
507
|
+
count
|
|
508
|
+
);
|
|
509
|
+
if (!measurementPointer && count)
|
|
510
|
+
throw new Error(
|
|
511
|
+
"Standalone native measurement storage allocation failed."
|
|
512
|
+
);
|
|
513
|
+
const measurements = new Float64Array(
|
|
514
|
+
this.kernel.memory.buffer,
|
|
515
|
+
measurementPointer,
|
|
516
|
+
count * MEASUREMENT_STRIDE
|
|
517
|
+
);
|
|
518
|
+
for (let index = 0; index < count; index++) {
|
|
519
|
+
const nativeId = this.kernel.standalone_tree_measure_node(
|
|
520
|
+
this.#handle,
|
|
521
|
+
this.#generation,
|
|
522
|
+
index
|
|
523
|
+
);
|
|
524
|
+
const node = nodes[nativeId];
|
|
525
|
+
const kind = this.kernel.standalone_tree_measure_kind(
|
|
526
|
+
this.#handle,
|
|
527
|
+
this.#generation,
|
|
528
|
+
index
|
|
529
|
+
);
|
|
530
|
+
if (!node)
|
|
531
|
+
throw new Error(
|
|
532
|
+
"Standalone native tree requested an unknown measurement node."
|
|
533
|
+
);
|
|
534
|
+
const offset = index * MEASUREMENT_STRIDE;
|
|
535
|
+
measurements[offset] = nativeId;
|
|
536
|
+
if (kind === 0) {
|
|
537
|
+
if (!node.measure)
|
|
538
|
+
throw new Error(
|
|
539
|
+
"Standalone native tree requested a node without an owned measurement callback."
|
|
540
|
+
);
|
|
541
|
+
const result = node.measure({
|
|
542
|
+
width: {
|
|
543
|
+
minimum: this.kernel.standalone_tree_measure_width_min(
|
|
544
|
+
this.#handle,
|
|
545
|
+
this.#generation,
|
|
546
|
+
index
|
|
547
|
+
),
|
|
548
|
+
maximum: this.kernel.standalone_tree_measure_width_max(
|
|
549
|
+
this.#handle,
|
|
550
|
+
this.#generation,
|
|
551
|
+
index
|
|
552
|
+
)
|
|
553
|
+
},
|
|
554
|
+
height: {
|
|
555
|
+
minimum: this.kernel.standalone_tree_measure_height_min(
|
|
556
|
+
this.#handle,
|
|
557
|
+
this.#generation,
|
|
558
|
+
index
|
|
559
|
+
),
|
|
560
|
+
maximum: this.kernel.standalone_tree_measure_height_max(
|
|
561
|
+
this.#handle,
|
|
562
|
+
this.#generation,
|
|
563
|
+
index
|
|
564
|
+
)
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
measurements[offset + 1] = finite(result.width, "measurement width");
|
|
568
|
+
measurements[offset + 2] = finite(result.height, "measurement height");
|
|
569
|
+
} else if (kind === 1) {
|
|
570
|
+
if (!node.measureIntrinsic)
|
|
571
|
+
throw new Error(
|
|
572
|
+
"Standalone native tree requested a node without an owned intrinsic measurement callback."
|
|
573
|
+
);
|
|
574
|
+
const result = node.measureIntrinsic();
|
|
575
|
+
measurements[offset + 3] = finite(
|
|
576
|
+
result.minWidth,
|
|
577
|
+
"intrinsic minimum width"
|
|
578
|
+
);
|
|
579
|
+
measurements[offset + 4] = finite(
|
|
580
|
+
result.maxWidth,
|
|
581
|
+
"intrinsic maximum width"
|
|
582
|
+
);
|
|
583
|
+
measurements[offset + 5] = finite(
|
|
584
|
+
result.minHeight,
|
|
585
|
+
"intrinsic minimum height"
|
|
586
|
+
);
|
|
587
|
+
measurements[offset + 6] = finite(
|
|
588
|
+
result.maxHeight,
|
|
589
|
+
"intrinsic maximum height"
|
|
590
|
+
);
|
|
591
|
+
if (measurements[offset + 3] > measurements[offset + 4] || measurements[offset + 5] > measurements[offset + 6])
|
|
592
|
+
throw new RangeError(
|
|
593
|
+
"Standalone intrinsic measurement minimums must not exceed maximums."
|
|
594
|
+
);
|
|
595
|
+
} else
|
|
596
|
+
throw new Error(
|
|
597
|
+
"Standalone native tree requested an unknown measurement kind."
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
status(
|
|
601
|
+
this.kernel.standalone_tree_solve(
|
|
602
|
+
this.#handle,
|
|
603
|
+
this.#generation,
|
|
604
|
+
input.width,
|
|
605
|
+
input.height
|
|
606
|
+
),
|
|
607
|
+
"solve"
|
|
608
|
+
);
|
|
609
|
+
let settled = false;
|
|
610
|
+
for (let phase = 0; phase <= nodes.length; phase++) {
|
|
611
|
+
status(
|
|
612
|
+
this.kernel.standalone_tree_prepare_settled_measurements(
|
|
613
|
+
this.#handle,
|
|
614
|
+
this.#generation
|
|
615
|
+
),
|
|
616
|
+
"settled measurement preparation"
|
|
617
|
+
);
|
|
618
|
+
const settledCount = this.kernel.standalone_tree_measure_count(
|
|
619
|
+
this.#handle,
|
|
620
|
+
this.#generation
|
|
621
|
+
);
|
|
622
|
+
if (!settledCount) {
|
|
623
|
+
settled = true;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
{
|
|
627
|
+
const settledPointer = this.kernel.standalone_tree_resize_measurements(this.#handle, this.#generation, settledCount);
|
|
628
|
+
if (!settledPointer) throw new Error("Standalone native settled measurement storage allocation failed.");
|
|
629
|
+
const settled2 = new Float64Array(this.kernel.memory.buffer, settledPointer, settledCount * MEASUREMENT_STRIDE);
|
|
630
|
+
for (let index = 0; index < settledCount; index++) {
|
|
631
|
+
const nativeId = this.kernel.standalone_tree_measure_node(this.#handle, this.#generation, index);
|
|
632
|
+
const node = nodes[nativeId];
|
|
633
|
+
const kind = this.kernel.standalone_tree_measure_kind(this.#handle, this.#generation, index);
|
|
634
|
+
if (!node) throw new Error("Standalone native tree requested an unknown settled measurement node.");
|
|
635
|
+
const offset = index * MEASUREMENT_STRIDE;
|
|
636
|
+
settled2[offset] = nativeId;
|
|
637
|
+
if (kind === 0) {
|
|
638
|
+
if (!node.measure) throw new Error("Standalone native tree requested a node without an owned measurement callback.");
|
|
639
|
+
const result = node.measure({ width: { minimum: this.kernel.standalone_tree_measure_width_min(this.#handle, this.#generation, index), maximum: this.kernel.standalone_tree_measure_width_max(this.#handle, this.#generation, index) }, height: { minimum: this.kernel.standalone_tree_measure_height_min(this.#handle, this.#generation, index), maximum: this.kernel.standalone_tree_measure_height_max(this.#handle, this.#generation, index) } });
|
|
640
|
+
settled2[offset + 1] = finite(result.width, "settled measurement width");
|
|
641
|
+
settled2[offset + 2] = finite(result.height, "settled measurement height");
|
|
642
|
+
} else if (kind === 1) {
|
|
643
|
+
if (!node.measureIntrinsic) throw new Error("Standalone native tree requested a node without an owned intrinsic measurement callback.");
|
|
644
|
+
const result = node.measureIntrinsic();
|
|
645
|
+
settled2[offset + 3] = finite(result.minWidth, "settled intrinsic minimum width");
|
|
646
|
+
settled2[offset + 4] = finite(result.maxWidth, "settled intrinsic maximum width");
|
|
647
|
+
settled2[offset + 5] = finite(result.minHeight, "settled intrinsic minimum height");
|
|
648
|
+
settled2[offset + 6] = finite(result.maxHeight, "settled intrinsic maximum height");
|
|
649
|
+
if (settled2[offset + 3] > settled2[offset + 4] || settled2[offset + 5] > settled2[offset + 6]) throw new RangeError("Standalone settled intrinsic measurement minimums must not exceed maximums.");
|
|
650
|
+
} else throw new Error("Standalone native tree requested an unknown settled measurement kind.");
|
|
651
|
+
}
|
|
652
|
+
status(this.kernel.standalone_tree_solve(this.#handle, this.#generation, input.width, input.height), "settled solve");
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
if (!settled)
|
|
656
|
+
throw new Error(`Standalone native layout measurement continuation did not converge within ${nodes.length + 1} native dependency phases.`);
|
|
657
|
+
const boxCount = this.kernel.standalone_tree_box_count(
|
|
658
|
+
this.#handle,
|
|
659
|
+
this.#generation
|
|
660
|
+
);
|
|
661
|
+
if (boxCount !== nodes.length)
|
|
662
|
+
throw new Error("Standalone native tree returned an incomplete box set.");
|
|
663
|
+
const boxes = [];
|
|
664
|
+
for (let index = 0; index < boxCount; index++) {
|
|
665
|
+
const nativeId = this.kernel.standalone_tree_box_id(
|
|
666
|
+
this.#handle,
|
|
667
|
+
this.#generation,
|
|
668
|
+
index
|
|
669
|
+
);
|
|
670
|
+
const source = nodes[nativeId];
|
|
671
|
+
if (!source)
|
|
672
|
+
throw new Error("Standalone native tree returned an unknown node id.");
|
|
673
|
+
const box = {
|
|
674
|
+
id: source.id,
|
|
675
|
+
x: this.kernel.standalone_tree_box_x(
|
|
676
|
+
this.#handle,
|
|
677
|
+
this.#generation,
|
|
678
|
+
index
|
|
679
|
+
),
|
|
680
|
+
y: this.kernel.standalone_tree_box_y(
|
|
681
|
+
this.#handle,
|
|
682
|
+
this.#generation,
|
|
683
|
+
index
|
|
684
|
+
),
|
|
685
|
+
width: this.kernel.standalone_tree_box_width(
|
|
686
|
+
this.#handle,
|
|
687
|
+
this.#generation,
|
|
688
|
+
index
|
|
689
|
+
),
|
|
690
|
+
height: this.kernel.standalone_tree_box_height(
|
|
691
|
+
this.#handle,
|
|
692
|
+
this.#generation,
|
|
693
|
+
index
|
|
694
|
+
)
|
|
695
|
+
};
|
|
696
|
+
boxes.push(box);
|
|
697
|
+
}
|
|
698
|
+
return Object.freeze(
|
|
699
|
+
boxes.map((box) => Object.freeze(box))
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
dispose() {
|
|
703
|
+
const kernel = this.#kernel;
|
|
704
|
+
if (!kernel) return;
|
|
705
|
+
this.#kernel = void 0;
|
|
706
|
+
try {
|
|
707
|
+
if (this.#handle && kernel.standalone_tree_dispose(this.#handle, this.#generation) !== 0)
|
|
708
|
+
throw new Error("Standalone native tree disposal failed.");
|
|
709
|
+
} finally {
|
|
710
|
+
this.#handle = 0;
|
|
711
|
+
this.#generation = 0;
|
|
712
|
+
kernel.dispose();
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
function createStandaloneLayoutKernel() {
|
|
717
|
+
return new NativeStandaloneLayoutKernel();
|
|
718
|
+
}
|
|
719
|
+
export {
|
|
720
|
+
createStandaloneLayoutKernel
|
|
721
|
+
};
|
|
722
|
+
//# sourceMappingURL=standalone-kernel.js.map
|