@pibbl/core 0.0.2 → 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/THIRD_PARTY_NOTICES.txt +81 -0
- 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/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/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/world/rapier.js +22 -26
- package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
- package/dist/features/sprites/loader.js +6 -3
- package/dist/features/sprites/loader.js.map +2 -2
- 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 +68 -6
- package/dist/features/viz/index.js +164 -2
- package/dist/features/viz/index.js.map +2 -2
- package/dist/features/viz/inspection/bar.d.ts +79 -0
- package/dist/features/viz/inspection/bar.js +49 -0
- package/dist/features/viz/inspection/bar.js.map +7 -0
- package/dist/features/viz/inspection/candle.d.ts +156 -0
- package/dist/features/viz/inspection/candle.js +120 -0
- package/dist/features/viz/inspection/candle.js.map +7 -0
- package/dist/features/viz/inspection/capture-types.d.ts +65 -0
- package/dist/features/viz/inspection/capture.d.ts +16 -0
- package/dist/features/viz/inspection/capture.js +49 -0
- package/dist/features/viz/inspection/capture.js.map +7 -0
- package/dist/features/viz/inspection/handler.d.ts +36 -0
- package/dist/features/viz/inspection/handler.js +91 -0
- package/dist/features/viz/inspection/handler.js.map +7 -0
- package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
- package/dist/features/viz/inspection/ohlc-bar.js +118 -0
- package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
- package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
- package/dist/features/viz/inspection/owned-ref.js +99 -0
- package/dist/features/viz/inspection/owned-ref.js.map +7 -0
- package/dist/features/viz/inspection/painted-point.d.ts +22 -0
- package/dist/features/viz/inspection/painted-point.js +29 -0
- package/dist/features/viz/inspection/painted-point.js.map +7 -0
- package/dist/features/viz/inspection/queries.d.ts +100 -0
- package/dist/features/viz/inspection/queries.js +192 -0
- package/dist/features/viz/inspection/queries.js.map +7 -0
- package/dist/features/viz/inspection/query-types.d.ts +177 -0
- package/dist/features/viz/inspection/volume.d.ts +104 -0
- package/dist/features/viz/inspection/volume.js +95 -0
- package/dist/features/viz/inspection/volume.js.map +7 -0
- package/dist/features/viz/inspection.d.ts +19 -0
- package/dist/features/viz/inspection.js +54 -0
- package/dist/features/viz/inspection.js.map +7 -0
- package/dist/features/viz/inspection.mjs +1 -0
- package/dist/features/viz/lib/area-series.d.ts +62 -0
- package/dist/features/viz/lib/area-series.js +120 -0
- package/dist/features/viz/lib/area-series.js.map +7 -0
- package/dist/features/viz/lib/axis-title.js +2 -1
- package/dist/features/viz/lib/axis-title.js.map +2 -2
- package/dist/features/viz/lib/axis.js +1 -1
- package/dist/features/viz/lib/axis.js.map +2 -2
- package/dist/features/viz/lib/bar-series.d.ts +3 -1
- package/dist/features/viz/lib/bar-series.js +16 -1
- package/dist/features/viz/lib/bar-series.js.map +2 -2
- package/dist/features/viz/lib/baseline-series.d.ts +55 -0
- package/dist/features/viz/lib/baseline-series.js +136 -0
- package/dist/features/viz/lib/baseline-series.js.map +7 -0
- package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
- package/dist/features/viz/lib/candlestick-series.js +150 -0
- package/dist/features/viz/lib/candlestick-series.js.map +7 -0
- package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
- package/dist/features/viz/lib/censored-point-series.js +129 -0
- package/dist/features/viz/lib/censored-point-series.js.map +7 -0
- package/dist/features/viz/lib/color-context.d.ts +4 -0
- package/dist/features/viz/lib/color-context.js +41 -0
- package/dist/features/viz/lib/color-context.js.map +7 -0
- package/dist/features/viz/lib/color-math.d.ts +4 -0
- package/dist/features/viz/lib/color-math.js +31 -0
- package/dist/features/viz/lib/color-math.js.map +7 -0
- package/dist/features/viz/lib/color-types.d.ts +53 -0
- package/dist/features/viz/lib/curve-definition.d.ts +49 -0
- package/dist/features/viz/lib/curve-definition.js +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 +5 -2
- package/dist/features/viz/lib/hover-data.js.map +2 -2
- package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
- package/dist/features/viz/lib/interval-band-series.js +136 -0
- package/dist/features/viz/lib/interval-band-series.js.map +7 -0
- package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
- package/dist/features/viz/lib/interval-diamond-series.js +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.js +1 -1
- package/dist/features/viz/lib/linear-scale.js.map +2 -2
- package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
- package/dist/features/viz/lib/monotone-curve.js +63 -0
- package/dist/features/viz/lib/monotone-curve.js.map +7 -0
- package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
- package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
- package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
- package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
- package/dist/features/viz/lib/paired-series.d.ts +44 -0
- package/dist/features/viz/lib/paired-series.js +93 -0
- package/dist/features/viz/lib/paired-series.js.map +7 -0
- package/dist/features/viz/lib/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-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.js +4 -1
- package/dist/features/viz/lib/reference-band.js.map +2 -2
- package/dist/features/viz/lib/scale-context.d.ts +1 -1
- package/dist/features/viz/lib/scale-ticks.js +21 -6
- package/dist/features/viz/lib/scale-ticks.js.map +2 -2
- package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
- package/dist/features/viz/lib/sequential-color-scale.js +49 -0
- package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
- package/dist/features/viz/lib/series-position.d.ts +12 -0
- package/dist/features/viz/lib/series-position.js +44 -0
- package/dist/features/viz/lib/series-position.js.map +7 -0
- package/dist/features/viz/lib/step-curves.d.ts +19 -0
- package/dist/features/viz/lib/step-curves.js +53 -0
- package/dist/features/viz/lib/step-curves.js.map +7 -0
- package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
- package/dist/features/viz/lib/threshold-color-scale.js +59 -0
- package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
- package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
- package/dist/features/viz/lib/trading-time-mapping.js +89 -0
- package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
- package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
- package/dist/features/viz/lib/trading-time-scale.js +96 -0
- package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
- package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
- package/dist/features/viz/lib/trajectory-series.js +111 -0
- package/dist/features/viz/lib/trajectory-series.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +20 -4
- package/dist/features/viz/lib/use-continuous-scale.js +6 -1
- package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
- package/dist/features/viz/lib/utc-scale.js +11 -10
- package/dist/features/viz/lib/utc-scale.js.map +2 -2
- package/dist/features/viz/lib/volume-series.d.ts +59 -0
- package/dist/features/viz/lib/volume-series.js +117 -0
- package/dist/features/viz/lib/volume-series.js.map +7 -0
- package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
- package/dist/features/viz/lib/weighted-point-series.js +169 -0
- package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
- package/dist/filters/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 +9 -5
- 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/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/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 +26 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/layout/participation.ts"],
|
|
4
|
+
"sourcesContent": ["import { peekPreNormalizedStyle, type PreparedStyleInput } from '../style/resolve-dispatch.js';\nimport { materializeContainerChildren } from '../element/children.js';\nimport { isKnownLayoutType } from './prepared-root.js';\nimport { getSpecifiedStyle } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport { isSignal, getSignalNode, withSignalDependencyRole } from '../signals/graph.js';\nimport type { PibblComponentRefs, PibblInstance } from '../types.js';\n\nconst contentsTransforms = new WeakSet<Function>();\nexport function registerContentsTransform(type: Function): void { contentsTransforms.add(type); }\nexport function isContentsTransform(type: Function): boolean { return contentsTransforms.has(type); }\n\nexport interface LayoutSuspensionResource { suspendLayout(): void; }\nconst suspensionResources = new WeakMap<PibblComponentRefs<any>, Set<LayoutSuspensionResource>>();\nexport function registerLayoutSuspensionResource(refs: PibblComponentRefs<any>, resource: LayoutSuspensionResource): void {\n let resources = suspensionResources.get(refs);\n if (!resources) { resources = new Set(); suspensionResources.set(refs, resources); }\n resources.add(resource);\n}\nexport function unregisterLayoutSuspensionResource(refs: PibblComponentRefs<any>, resource: LayoutSuspensionResource): void {\n const resources = suspensionResources.get(refs);\n resources?.delete(resource);\n if (resources?.size === 0) suspensionResources.delete(refs);\n}\n\nconst suspendedComponents = new WeakSet<PibblComponentRefs<any>>();\nexport function isLayoutComponentSuspended(refs: PibblComponentRefs<any>): boolean { return !refs.teardowns.closed && suspendedComponents.has(refs); }\nexport function isLayoutInstanceSuspended(owner: PibblInstance): boolean {\n let current: PibblInstance | undefined = owner;\n while (current) {\n if (current.eventParent && isLayoutComponentSuspended(current.eventParent)) return true;\n current = current.parent ? GLOBAL_STATE.pibblInstances.get(current.parent) : undefined;\n }\n return false;\n}\nexport function resumeLayoutComponent(refs: PibblComponentRefs<any>): void { suspendedComponents.delete(refs); }\nfunction participationStyle(element: PibblElement<any>, preparedStyle?: PreparedStyleInput | null): unknown {\n const prepared = preparedStyle === undefined ? peekPreNormalizedStyle(element) : preparedStyle;\n if (prepared) return prepared.style;\n const specified = getSpecifiedStyle(element);\n if (!isSignal(specified)) return specified;\n const node = getSignalNode(specified);\n node.validate?.();\n const current = node.value;\n // Ordinary whole-style inputs keep their existing single receiver read.\n // A participation input acquires its own layout dependency when present.\n return current && typeof current === 'object' && (current as Record<string, unknown>).layoutParticipation !== undefined\n ? specified.get() : current;\n}\n\nconst mountedChildren = new WeakMap<PibblComponentRefs<any>, Set<PibblComponentRefs<any>>>();\n\n/** Reads only the structural visibility input; hidden inputs never require measurement. */\nexport function layoutParticipation(element: PibblElement<any>, preparedStyle?: PreparedStyleInput | null): 'normal' | 'hidden' | 'contents' {\n const style = participationStyle(element, preparedStyle);\n const input = style && typeof style === 'object' ? (style as Record<string, unknown>).layoutParticipation : undefined;\n const value = isSignal(input) ? withSignalDependencyRole('layout', () => input.get()) : input;\n if (value === undefined || value === 'normal') return 'normal';\n if (value === 'hidden' || value === 'contents') return value;\n throw new TypeError(`${element.type.name || 'Component'} style.layoutParticipation must be normal, hidden, or contents.`);\n}\n\nexport interface LayoutParticipationSource {\n readonly element: PibblElement<any>;\n readonly hidden: boolean;\n readonly children?: readonly LayoutParticipationSource[];\n}\nconst participationPlans = new WeakMap<readonly PibblElement<any>[], readonly LayoutParticipationSource[]>();\n\n/** Contents may expose only declared structural children, never an opaque component program. */\nexport function contentsChildren(element: PibblElement<any>): readonly PibblElement<any>[] {\n if (!isContentsTransform(element.type) && !isKnownLayoutType(element.type)) {\n throw new TypeError(`${element.type.name || 'Component'} contents participation requires a built-in layout or Group with declared structural children.`);\n }\n const style = participationStyle(element);\n if (style && typeof style === 'object') {\n const values = style as Record<string, unknown>;\n rejectContentsBoxProperty(values, 'width', element);\n rejectContentsBoxProperty(values, 'height', element);\n rejectContentsBoxProperty(values, 'minWidth', element);\n rejectContentsBoxProperty(values, 'maxWidth', element);\n rejectContentsBoxProperty(values, 'minHeight', element);\n rejectContentsBoxProperty(values, 'maxHeight', element);\n rejectContentsBoxProperty(values, 'boxSizing', element);\n rejectContentsBoxProperty(values, 'padding', element);\n rejectContentsBoxProperty(values, 'paddingStart', element);\n rejectContentsBoxProperty(values, 'paddingEnd', element);\n rejectContentsBoxProperty(values, 'borderWidth', element);\n rejectContentsBoxProperty(values, 'borderStartWidth', element);\n rejectContentsBoxProperty(values, 'borderEndWidth', element);\n rejectContentsBoxProperty(values, 'overflow', element);\n rejectContentsBoxProperty(values, 'filter', element);\n rejectContentsBoxProperty(values, 'position', element);\n rejectContentsBoxProperty(values, 'left', element);\n rejectContentsBoxProperty(values, 'right', element);\n rejectContentsBoxProperty(values, 'top', element);\n rejectContentsBoxProperty(values, 'bottom', element);\n rejectContentsBoxProperty(values, 'insetStart', element);\n rejectContentsBoxProperty(values, 'insetEnd', element);\n rejectContentsBoxProperty(values, 'margin', element);\n rejectContentsBoxProperty(values, 'marginTop', element);\n rejectContentsBoxProperty(values, 'marginRight', element);\n rejectContentsBoxProperty(values, 'marginBottom', element);\n rejectContentsBoxProperty(values, 'marginLeft', element);\n rejectContentsBoxProperty(values, 'marginStart', element);\n rejectContentsBoxProperty(values, 'marginEnd', element);\n }\n const input = (element.props as { readonly children?: import('../element/types.js').PibblNodeInput }).children;\n return materializeContainerChildren(input, element);\n}\n\nexport function participatingLayoutChildren(source: readonly PibblElement<any>[]): readonly PibblElement<any>[] {\n let needsPlan = false;\n for (const element of source) if (layoutParticipation(element) !== 'normal') { needsPlan = true; break; }\n if (!needsPlan) return source;\n const leaves: PibblElement<any>[] = [];\n const visiting = new Set<PibblElement<any>>();\n const build = (sequence: readonly PibblElement<any>[]): LayoutParticipationSource[] => {\n const result: LayoutParticipationSource[] = [];\n for (const element of sequence) {\n const participation = layoutParticipation(element);\n if (participation === 'hidden') result.push({ element, hidden: true });\n else if (participation === 'contents') {\n if (visiting.has(element)) throw new TypeError('Contents layout descriptors form a cycle.');\n visiting.add(element);\n try { result.push({ element, hidden: false, children: build(contentsChildren(element)) }); }\n finally { visiting.delete(element); }\n } else { leaves.push(element); result.push({ element, hidden: false }); }\n }\n return result;\n };\n participationPlans.set(leaves, build(source));\n return leaves;\n}\n\nexport function layoutParticipationPlan(children: readonly PibblElement<any>[]): readonly LayoutParticipationSource[] | undefined {\n return participationPlans.get(children);\n}\n\n/** Records mount ownership once; retaining a hidden subtree never scans unrelated mounts. */\nexport function registerLayoutComponentMount(refs: PibblComponentRefs<any>): void {\n const parent = refs.parent;\n if (!parent) return;\n let children = mountedChildren.get(parent);\n if (!children) { children = new Set(); mountedChildren.set(parent, children); }\n children.add(refs);\n const owned = children;\n refs.teardowns.add(() => { owned.delete(refs); if (!owned.size && mountedChildren.get(parent) === owned) mountedChildren.delete(parent); mountedChildren.delete(refs); });\n}\n\nexport function retainHiddenLayoutDescendants(refs: PibblComponentRefs<any>): void {\n suspendedComponents.add(refs);\n refs.renderGeneration = GLOBAL_STATE.currentPibblInstance!.renderGeneration;\n const resources = suspensionResources.get(refs);\n if (resources) for (const resource of resources) resource.suspendLayout();\n const children = mountedChildren.get(refs);\n if (!children) return;\n for (const child of children) {\n if (child.teardowns.closed) continue;\n GLOBAL_STATE.seenIds!.add(child.id);\n retainHiddenLayoutDescendants(child);\n }\n}\n\nfunction rejectContentsBoxProperty(style: Readonly<Record<string, unknown>>, property: string, element: PibblElement<any>): void {\n const input = style[property];\n if ((isSignal(input) ? input.get() : input) !== undefined) {\n throw new TypeError(`${element.type.name} style.${property} requires a box and is incompatible with contents participation.`);\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -24,7 +24,7 @@ function PlacedChild(props, _style, ctx) {
|
|
|
24
24
|
refs.refs[0] = localBox;
|
|
25
25
|
}
|
|
26
26
|
ctx.translate(props.box.x, props.box.y);
|
|
27
|
-
const releaseLayout = pushLayoutBox(localBox);
|
|
27
|
+
const releaseLayout = pushLayoutBox(localBox, { logicalOffset: props.box });
|
|
28
28
|
let releaseClip;
|
|
29
29
|
try {
|
|
30
30
|
const clip = props.clipInChildSpace;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/layout/place-child.ts"],
|
|
4
|
-
"sourcesContent": ["import { rectangleSvg } from '../html/portable-clips.js';\nimport { definePrimitive } from '../define-primitive.js';\nimport { createElement } from '../element/create-element.js';\nimport { setPlacementIdentityHint } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport type { InternalIdentityHint, RenderingContext2D } from '../types.js';\nimport { pushClippingPath } from '../util/push-clipping-path.js';\nimport { pushLayoutBox } from './context.js';\nimport { recordLayoutPlacement } from './diagnostics.js';\nimport type { LayoutBox } from './types.js';\n\ninterface PlacedChildProps {\n element: PibblElement<any>;\n box: Readonly<LayoutBox>;\n clipInChildSpace?: Readonly<LayoutBox>;\n identityHint: InternalIdentityHint;\n}\n\nfunction PlacedChild(\n props: PlacedChildProps,\n _style: Readonly<{}>,\n ctx: RenderingContext2D,\n) {\n recordLayoutPlacement();\n assertFiniteBox(props.box, 'placement');\n if (props.clipInChildSpace) {\n assertFiniteBox(props.clipInChildSpace, 'placement clip');\n }\n\n const refs = GLOBAL_STATE.componentRefs!;\n let localBox = refs.refs[0] as Readonly<LayoutBox> | undefined;\n if (\n !localBox ||\n localBox.width !== props.box.width ||\n localBox.height !== props.box.height\n ) {\n localBox = Object.freeze({\n x: 0,\n y: 0,\n width: props.box.width,\n height: props.box.height,\n });\n refs.refs[0] = localBox;\n }\n\n ctx.translate(props.box.x, props.box.y);\n const releaseLayout = pushLayoutBox(localBox);\n let releaseClip: (() => void) | undefined;\n try {\n const clip = props.clipInChildSpace;\n if (clip) {\n const path = new Path2D();\n path.rect(clip.x, clip.y, clip.width, clip.height);\n releaseClip = pushClippingPath(ctx, path, 'nonzero', true, rectangleSvg(clip));\n }\n } catch (error) {\n releaseLayout();\n throw error;\n }\n\n refs.onAfterRender = () => {\n releaseClip?.();\n releaseLayout();\n };\n return props.element;\n}\n\nconst PlacedChildPrimitive = definePrimitive<PlacedChildProps>(PlacedChild);\n\nexport function placeChild(props: PlacedChildProps): PibblElement<any> {\n const element = createElement(PlacedChildPrimitive, props);\n setPlacementIdentityHint(element, props.identityHint);\n return element;\n}\n\nexport function createPlacementIdentityHint(\n element: PibblElement<any>,\n occurrence: number,\n): InternalIdentityHint {\n if (!Number.isInteger(occurrence) || occurrence < 0) {\n throw new Error('Placement identity occurrence must be a nonnegative integer');\n }\n return { type: element.type, key: element.key, occurrence };\n}\n\nfunction assertFiniteBox(box: Readonly<LayoutBox>, label: string): void {\n for (const [property, value] of Object.entries(box)) {\n if (!Number.isFinite(value)) {\n throw new Error(`${label} ${property} must be finite, received ${value}`);\n }\n }\n if (box.width < 0 || box.height < 0) {\n throw new Error(`${label} dimensions must be nonnegative`);\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;AAEzC,SAAS,oBAAoB;AAE7B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAUtC,SAAS,YACP,OACA,QACA,KACA;AACA,wBAAsB;AACtB,kBAAgB,MAAM,KAAK,WAAW;AACtC,MAAI,MAAM,kBAAkB;AAC1B,oBAAgB,MAAM,kBAAkB,gBAAgB;AAAA,EAC1D;AAEA,QAAM,OAAO,aAAa;AAC1B,MAAI,WAAW,KAAK,KAAK,CAAC;AAC1B,MACE,CAAC,YACD,SAAS,UAAU,MAAM,IAAI,SAC7B,SAAS,WAAW,MAAM,IAAI,QAC9B;AACA,eAAW,OAAO,OAAO;AAAA,MACvB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,OAAO,MAAM,IAAI;AAAA,MACjB,QAAQ,MAAM,IAAI;AAAA,IACpB,CAAC;AACD,SAAK,KAAK,CAAC,IAAI;AAAA,EACjB;AAEA,MAAI,UAAU,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;AACtC,QAAM,gBAAgB,cAAc,
|
|
4
|
+
"sourcesContent": ["import { rectangleSvg } from '../html/portable-clips.js';\nimport { definePrimitive } from '../define-primitive.js';\nimport { createElement } from '../element/create-element.js';\nimport { setPlacementIdentityHint } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport type { InternalIdentityHint, RenderingContext2D } from '../types.js';\nimport { pushClippingPath } from '../util/push-clipping-path.js';\nimport { pushLayoutBox } from './context.js';\nimport { recordLayoutPlacement } from './diagnostics.js';\nimport type { LayoutBox } from './types.js';\n\ninterface PlacedChildProps {\n element: PibblElement<any>;\n box: Readonly<LayoutBox>;\n clipInChildSpace?: Readonly<LayoutBox>;\n identityHint: InternalIdentityHint;\n}\n\nfunction PlacedChild(\n props: PlacedChildProps,\n _style: Readonly<{}>,\n ctx: RenderingContext2D,\n) {\n recordLayoutPlacement();\n assertFiniteBox(props.box, 'placement');\n if (props.clipInChildSpace) {\n assertFiniteBox(props.clipInChildSpace, 'placement clip');\n }\n\n const refs = GLOBAL_STATE.componentRefs!;\n let localBox = refs.refs[0] as Readonly<LayoutBox> | undefined;\n if (\n !localBox ||\n localBox.width !== props.box.width ||\n localBox.height !== props.box.height\n ) {\n localBox = Object.freeze({\n x: 0,\n y: 0,\n width: props.box.width,\n height: props.box.height,\n });\n refs.refs[0] = localBox;\n }\n\n ctx.translate(props.box.x, props.box.y);\n const releaseLayout = pushLayoutBox(localBox, { logicalOffset: props.box });\n let releaseClip: (() => void) | undefined;\n try {\n const clip = props.clipInChildSpace;\n if (clip) {\n const path = new Path2D();\n path.rect(clip.x, clip.y, clip.width, clip.height);\n releaseClip = pushClippingPath(ctx, path, 'nonzero', true, rectangleSvg(clip));\n }\n } catch (error) {\n releaseLayout();\n throw error;\n }\n\n refs.onAfterRender = () => {\n releaseClip?.();\n releaseLayout();\n };\n return props.element;\n}\n\nconst PlacedChildPrimitive = definePrimitive<PlacedChildProps>(PlacedChild);\n\nexport function placeChild(props: PlacedChildProps): PibblElement<any> {\n const element = createElement(PlacedChildPrimitive, props);\n setPlacementIdentityHint(element, props.identityHint);\n return element;\n}\n\nexport function createPlacementIdentityHint(\n element: PibblElement<any>,\n occurrence: number,\n): InternalIdentityHint {\n if (!Number.isInteger(occurrence) || occurrence < 0) {\n throw new Error('Placement identity occurrence must be a nonnegative integer');\n }\n return { type: element.type, key: element.key, occurrence };\n}\n\nfunction assertFiniteBox(box: Readonly<LayoutBox>, label: string): void {\n for (const [property, value] of Object.entries(box)) {\n if (!Number.isFinite(value)) {\n throw new Error(`${label} ${property} must be finite, received ${value}`);\n }\n }\n if (box.width < 0 || box.height < 0) {\n throw new Error(`${label} dimensions must be nonnegative`);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;AAEzC,SAAS,oBAAoB;AAE7B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAUtC,SAAS,YACP,OACA,QACA,KACA;AACA,wBAAsB;AACtB,kBAAgB,MAAM,KAAK,WAAW;AACtC,MAAI,MAAM,kBAAkB;AAC1B,oBAAgB,MAAM,kBAAkB,gBAAgB;AAAA,EAC1D;AAEA,QAAM,OAAO,aAAa;AAC1B,MAAI,WAAW,KAAK,KAAK,CAAC;AAC1B,MACE,CAAC,YACD,SAAS,UAAU,MAAM,IAAI,SAC7B,SAAS,WAAW,MAAM,IAAI,QAC9B;AACA,eAAW,OAAO,OAAO;AAAA,MACvB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,OAAO,MAAM,IAAI;AAAA,MACjB,QAAQ,MAAM,IAAI;AAAA,IACpB,CAAC;AACD,SAAK,KAAK,CAAC,IAAI;AAAA,EACjB;AAEA,MAAI,UAAU,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;AACtC,QAAM,gBAAgB,cAAc,UAAU,EAAE,eAAe,MAAM,IAAI,CAAC;AAC1E,MAAI;AACJ,MAAI;AACF,UAAM,OAAO,MAAM;AACnB,QAAI,MAAM;AACR,YAAM,OAAO,IAAI,OAAO;AACxB,WAAK,KAAK,KAAK,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,MAAM;AACjD,oBAAc,iBAAiB,KAAK,MAAM,WAAW,MAAM,aAAa,IAAI,CAAC;AAAA,IAC/E;AAAA,EACF,SAAS,OAAO;AACd,kBAAc;AACd,UAAM;AAAA,EACR;AAEA,OAAK,gBAAgB,MAAM;AACzB,kBAAc;AACd,kBAAc;AAAA,EAChB;AACA,SAAO,MAAM;AACf;AAEA,MAAM,uBAAuB,gBAAkC,WAAW;AAEnE,SAAS,WAAW,OAA4C;AACrE,QAAM,UAAU,cAAc,sBAAsB,KAAK;AACzD,2BAAyB,SAAS,MAAM,YAAY;AACpD,SAAO;AACT;AAEO,SAAS,4BACd,SACA,YACsB;AACtB,MAAI,CAAC,OAAO,UAAU,UAAU,KAAK,aAAa,GAAG;AACnD,UAAM,IAAI,MAAM,6DAA6D;AAAA,EAC/E;AACA,SAAO,EAAE,MAAM,QAAQ,MAAM,KAAK,QAAQ,KAAK,WAAW;AAC5D;AAEA,SAAS,gBAAgB,KAA0B,OAAqB;AACtE,aAAW,CAAC,UAAU,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AACnD,QAAI,CAAC,OAAO,SAAS,KAAK,GAAG;AAC3B,YAAM,IAAI,MAAM,GAAG,KAAK,IAAI,QAAQ,6BAA6B,KAAK,EAAE;AAAA,IAC1E;AAAA,EACF;AACA,MAAI,IAAI,QAAQ,KAAK,IAAI,SAAS,GAAG;AACnC,UAAM,IAAI,MAAM,GAAG,KAAK,iCAAiC;AAAA,EAC3D;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PibblElement } from '../element/types.js';
|
|
2
2
|
import type { SystemStyle } from '../types.js';
|
|
3
|
-
export declare function assertSupportedChildPosition(layout: string, child: PibblElement<any>, style: Readonly<SystemStyle
|
|
3
|
+
export declare function assertSupportedChildPosition(layout: string, child: PibblElement<any>, style: Readonly<SystemStyle>, supportsExplicitPosition?: boolean, rejectsLegacyOffsets?: boolean): void;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { isDevelopment } from "../development.js";
|
|
2
2
|
import { getElementSource } from "../element/metadata.js";
|
|
3
|
-
function assertSupportedChildPosition(layout, child, style) {
|
|
4
|
-
if (!isDevelopment) return;
|
|
3
|
+
function assertSupportedChildPosition(layout, child, style, supportsExplicitPosition = false, rejectsLegacyOffsets = true) {
|
|
5
4
|
const values = style;
|
|
5
|
+
const position = values.position;
|
|
6
|
+
if ((values.insetStart !== void 0 || values.insetEnd !== void 0) && (!supportsExplicitPosition || position !== "absolute")) {
|
|
7
|
+
throw new Error(`PIBBL_LAYOUT_UNSUPPORTED_POSITION: logical insets require a supported direct absolute Flex child; ${child.type.name || "Anonymous"} inside ${layout} cannot apply them.`);
|
|
8
|
+
}
|
|
9
|
+
if (position !== void 0 && (!supportsExplicitPosition || position !== "static" && position !== "relative" && position !== "absolute")) {
|
|
10
|
+
throw new Error(`PIBBL_LAYOUT_UNSUPPORTED_POSITION: ${child.type.name || "Anonymous"} inside ${layout} declares position: ${String(position)}. ${layout} does not support this placement mode.`);
|
|
11
|
+
}
|
|
12
|
+
const hasRightOrBottom = values.right !== void 0 || values.bottom !== void 0;
|
|
13
|
+
if (position === void 0 && hasRightOrBottom) {
|
|
14
|
+
throw new Error(`PIBBL_LAYOUT_IGNORED_POSITION: ${child.type.name || "Anonymous"} inside ${layout} declares right/bottom without an explicit position. ${layout} cannot apply these insets.`);
|
|
15
|
+
}
|
|
16
|
+
if (!isDevelopment || position !== void 0 || !rejectsLegacyOffsets) return;
|
|
6
17
|
const fields = ["left", "top"].filter((key) => Object.prototype.hasOwnProperty.call(values, key) && values[key] !== void 0);
|
|
7
18
|
if (fields.length === 0) return;
|
|
8
19
|
const source = getElementSource(child);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/layout/positioning-diagnostics.ts"],
|
|
4
|
-
"sourcesContent": ["import { isDevelopment } from '../development.js';\nimport { getElementSource } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport type { SystemStyle } from '../types.js';\n\nexport function assertSupportedChildPosition(layout: string, child: PibblElement<any>, style: Readonly<SystemStyle
|
|
5
|
-
"mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAI1B,SAAS,6BAA6B,QAAgB,OAA0B,
|
|
4
|
+
"sourcesContent": ["import { isDevelopment } from '../development.js';\nimport { getElementSource } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport type { SystemStyle } from '../types.js';\n\nexport function assertSupportedChildPosition(layout: string, child: PibblElement<any>, style: Readonly<SystemStyle>, supportsExplicitPosition = false, rejectsLegacyOffsets = true): void {\n const values = style as Readonly<Record<string, unknown>>;\n const position = values.position;\n if ((values.insetStart !== undefined || values.insetEnd !== undefined) &&\n (!supportsExplicitPosition || position !== 'absolute')) {\n throw new Error(`PIBBL_LAYOUT_UNSUPPORTED_POSITION: logical insets require a supported direct absolute Flex child; ${child.type.name || 'Anonymous'} inside ${layout} cannot apply them.`);\n }\n if (position !== undefined && (!supportsExplicitPosition || (position !== 'static' && position !== 'relative' && position !== 'absolute'))) {\n throw new Error(`PIBBL_LAYOUT_UNSUPPORTED_POSITION: ${child.type.name || 'Anonymous'} inside ${layout} declares position: ${String(position)}. ${layout} does not support this placement mode.`);\n }\n const hasRightOrBottom = values.right !== undefined || values.bottom !== undefined;\n if (position === undefined && hasRightOrBottom) {\n throw new Error(`PIBBL_LAYOUT_IGNORED_POSITION: ${child.type.name || 'Anonymous'} inside ${layout} declares right/bottom without an explicit position. ${layout} cannot apply these insets.`);\n }\n if (!isDevelopment || position !== undefined || !rejectsLegacyOffsets) return;\n const fields = (['left', 'top'] as const).filter(key => Object.prototype.hasOwnProperty.call(values, key) && values[key] !== undefined);\n if (fields.length === 0) return;\n const source = getElementSource(child);\n const location = source ? ` Source: ${source.fileName}:${source.lineNumber}` : '';\n throw new Error(`PIBBL_LAYOUT_IGNORED_POSITION: ${child.type.name || 'Anonymous'} inside ${layout} declares ${fields.map(key => `${key}: ${String(values[key])}`).join(', ')}. ${layout} controls this child's position; these fields have no effect. Use ${layout} alignment/gap or an Absolute region for positioned content.${location}`);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAI1B,SAAS,6BAA6B,QAAgB,OAA0B,OAA8B,2BAA2B,OAAO,uBAAuB,MAAY;AACxL,QAAM,SAAS;AACf,QAAM,WAAW,OAAO;AACxB,OAAK,OAAO,eAAe,UAAa,OAAO,aAAa,YACvD,CAAC,4BAA4B,aAAa,aAAa;AAC1D,UAAM,IAAI,MAAM,qGAAqG,MAAM,KAAK,QAAQ,WAAW,WAAW,MAAM,qBAAqB;AAAA,EAC3L;AACA,MAAI,aAAa,WAAc,CAAC,4BAA6B,aAAa,YAAY,aAAa,cAAc,aAAa,aAAc;AAC1I,UAAM,IAAI,MAAM,sCAAsC,MAAM,KAAK,QAAQ,WAAW,WAAW,MAAM,uBAAuB,OAAO,QAAQ,CAAC,KAAK,MAAM,wCAAwC;AAAA,EACjM;AACA,QAAM,mBAAmB,OAAO,UAAU,UAAa,OAAO,WAAW;AACzE,MAAI,aAAa,UAAa,kBAAkB;AAC9C,UAAM,IAAI,MAAM,kCAAkC,MAAM,KAAK,QAAQ,WAAW,WAAW,MAAM,wDAAwD,MAAM,6BAA6B;AAAA,EAC9L;AACA,MAAI,CAAC,iBAAiB,aAAa,UAAa,CAAC,qBAAsB;AACvE,QAAM,SAAU,CAAC,QAAQ,KAAK,EAAY,OAAO,SAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,GAAG,KAAK,OAAO,GAAG,MAAM,MAAS;AACtI,MAAI,OAAO,WAAW,EAAG;AACzB,QAAM,SAAS,iBAAiB,KAAK;AACrC,QAAM,WAAW,SAAS,YAAY,OAAO,QAAQ,IAAI,OAAO,UAAU,KAAK;AAC/E,QAAM,IAAI,MAAM,kCAAkC,MAAM,KAAK,QAAQ,WAAW,WAAW,MAAM,aAAa,OAAO,IAAI,SAAO,GAAG,GAAG,KAAK,OAAO,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,KAAK,MAAM,qEAAqE,MAAM,+DAA+D,QAAQ,EAAE;AAC7U;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { BoxStyle } from '../style/types.js';
|
|
2
|
+
import { LayoutRegion } from './wasm/region.js';
|
|
3
|
+
import type { PibblInstance } from '../types.js';
|
|
4
|
+
import type { PibblElement } from '../element/types.js';
|
|
5
|
+
import type { SystemStyle } from '../types.js';
|
|
6
|
+
import type { ResponsiveStylePreparation } from '../style/responsive.js';
|
|
7
|
+
import type { LayoutBox } from './types.js';
|
|
8
|
+
import { type LayoutTopologySlot } from './topology.js';
|
|
9
|
+
export { snapshotLayoutTopology } from './topology.js';
|
|
10
|
+
type PreparedStyle = Readonly<SystemStyle> | ResponsiveStylePreparation<Readonly<SystemStyle>>;
|
|
11
|
+
export interface KnownLayoutPreflightOptions {
|
|
12
|
+
readonly deferStaticContainingDescendants?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type Preflight = (element: PibblElement<any>, style: Readonly<SystemStyle>, content: Readonly<LayoutBox>, receiver: object, slot: PreparedLayoutSlot, parentMainAxis?: 'row' | 'column', options?: KnownLayoutPreflightOptions) => void;
|
|
15
|
+
export declare function isKnownLayoutType(type: Function): boolean;
|
|
16
|
+
/** Only the current transaction's settled preparation may be attached to a replay. */
|
|
17
|
+
export declare function currentPreparedReceiverSlot(receiver: object | undefined): PreparedLayoutSlot | undefined;
|
|
18
|
+
/** Registers only known declarative input preparation, never component evaluation. */
|
|
19
|
+
export declare function registerKnownLayoutPreflight(type: Function, preflight: Preflight): void;
|
|
20
|
+
export declare function preflightKnownLayout(element: PibblElement<any>, style: Readonly<SystemStyle>, content: Readonly<LayoutBox>, receiver?: object, occurrence?: number, parentSlot?: PreparedLayoutSlot, parentMainAxis?: 'row' | 'column', options?: KnownLayoutPreflightOptions): PreparedLayoutSlot | undefined;
|
|
21
|
+
export declare function attachPreparedLayoutSlot(element: PibblElement<any>, slot?: PreparedLayoutSlot): void;
|
|
22
|
+
export interface PreparedPlanPending {
|
|
23
|
+
readonly kind: 'static-flex-containing-origin';
|
|
24
|
+
count: number;
|
|
25
|
+
}
|
|
26
|
+
export interface PreparedLayoutPlan {
|
|
27
|
+
readonly region?: LayoutRegion;
|
|
28
|
+
readonly content: Readonly<LayoutBox>;
|
|
29
|
+
readonly children: readonly PibblElement<any>[];
|
|
30
|
+
readonly placements: {
|
|
31
|
+
box: LayoutBox;
|
|
32
|
+
element: PibblElement<any>;
|
|
33
|
+
}[];
|
|
34
|
+
/** A staged plan cannot transfer ownership while a late containing origin is unresolved. */
|
|
35
|
+
pending?: PreparedPlanPending;
|
|
36
|
+
}
|
|
37
|
+
export interface PreparedFlexLayoutPlan extends PreparedLayoutPlan {
|
|
38
|
+
readonly region: LayoutRegion;
|
|
39
|
+
readonly cached: boolean;
|
|
40
|
+
readonly revision: number;
|
|
41
|
+
readonly placements: {
|
|
42
|
+
box: LayoutBox;
|
|
43
|
+
layoutY: number;
|
|
44
|
+
usedWidth: number;
|
|
45
|
+
usedHeight: number;
|
|
46
|
+
element: PibblElement<any>;
|
|
47
|
+
}[];
|
|
48
|
+
}
|
|
49
|
+
export declare class PreparedLayoutSlot implements LayoutTopologySlot {
|
|
50
|
+
readonly topologyOwner: PibblInstance;
|
|
51
|
+
region: LayoutRegion | undefined;
|
|
52
|
+
private boundaryOwner;
|
|
53
|
+
claimBoundary(): void;
|
|
54
|
+
readonly children: Map<Function, Map<string, PreparedLayoutSlot>>;
|
|
55
|
+
private disposeChildren;
|
|
56
|
+
private readonly rootType;
|
|
57
|
+
private readonly rootKey;
|
|
58
|
+
private readonly release;
|
|
59
|
+
constructor(topologyOwner: PibblInstance, options: {
|
|
60
|
+
rootType: Function;
|
|
61
|
+
rootKey?: string;
|
|
62
|
+
release: () => void;
|
|
63
|
+
});
|
|
64
|
+
matchesRoot(root: PibblElement<any>): boolean;
|
|
65
|
+
acquire(): LayoutRegion;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
claim(region: LayoutRegion): void;
|
|
68
|
+
}
|
|
69
|
+
export declare function stagePreparedLayoutPlan(slot: PreparedLayoutSlot, plan: PreparedLayoutPlan): void;
|
|
70
|
+
export declare function claimPreparedLayoutPlan(element: PibblElement<any>, content: Readonly<LayoutBox>): PreparedLayoutPlan | undefined;
|
|
71
|
+
export declare function claimPreparedFlexPlan(element: PibblElement<any>, content: Readonly<LayoutBox>): PreparedFlexLayoutPlan | undefined;
|
|
72
|
+
/** @internal Reads a current staged plan without transferring its region. */
|
|
73
|
+
export declare function peekPreparedLayoutPlan(slot: PreparedLayoutSlot, content: Readonly<LayoutBox>, direction?: 'ltr' | 'rtl'): PreparedLayoutPlan | undefined;
|
|
74
|
+
/** @internal Reads a current staged Flex plan without transferring its region. */
|
|
75
|
+
export declare function peekPreparedFlexPlan(slot: PreparedLayoutSlot, content: Readonly<LayoutBox>, direction?: 'ltr' | 'rtl'): PreparedFlexLayoutPlan | undefined;
|
|
76
|
+
export declare function stagePreparedChildStyle(child: PibblElement<any>, receiver: object, content: Readonly<LayoutBox>, prepared: PreparedStyle): void;
|
|
77
|
+
export declare function takePreparedChildStyle(child: PibblElement<any>, receiver?: object, content?: Readonly<LayoutBox>): PreparedStyle | undefined;
|
|
78
|
+
export declare function hasPreparedChildStyles(): boolean;
|
|
79
|
+
export declare function stagePreparedBoundaryChildren(slot: PreparedLayoutSlot, children: readonly PibblElement<any>[]): void;
|
|
80
|
+
export declare function takePreparedBoundaryChildren(element: PibblElement<any>): readonly PibblElement<any>[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Whether a staged raster boundary contains a settled numeric layout plan.
|
|
83
|
+
* Opaque descendants deliberately do not count: they retain the scheduler's
|
|
84
|
+
* child-first ownership path until they are themselves prepared.
|
|
85
|
+
*/
|
|
86
|
+
export declare function preparedBoundaryNeedsAllocationParent(element: PibblElement<any>): boolean;
|
|
87
|
+
/** A clean Layer keeps the mounted descendants that already own these plans. */
|
|
88
|
+
export declare function retainPreparedBoundarySubtree(element: PibblElement<any>): void;
|
|
89
|
+
/** Carries a settled placement into known preparation without a second placement pass. */
|
|
90
|
+
export declare function preparePlacedKnownLayout(element: PibblElement<any>, occurrence: number, parentSlot?: PreparedLayoutSlot): void;
|
|
91
|
+
/** Recursively admits known placed roots without evaluating opaque components. */
|
|
92
|
+
export declare function prepareKnownLayoutDescendants(plan: Pick<PreparedLayoutPlan, 'children' | 'placements'>, parentSlot: PreparedLayoutSlot): void;
|
|
93
|
+
/**
|
|
94
|
+
* A native intrinsic-main query has already chosen final numeric child bounds.
|
|
95
|
+
* It is scoped to this render transaction and consumed once by the matching
|
|
96
|
+
* normal Flex root; no persistent layout graph or receiver receipt is retained.
|
|
97
|
+
*/
|
|
98
|
+
export interface PreparedIntrinsicMainStage {
|
|
99
|
+
/** The flattened source descriptors measured by this stage. */
|
|
100
|
+
readonly elements: readonly PibblElement<any>[];
|
|
101
|
+
readonly axis: 'row' | 'column';
|
|
102
|
+
readonly style: Readonly<BoxStyle>;
|
|
103
|
+
readonly rootMin?: number;
|
|
104
|
+
readonly rootMax?: number;
|
|
105
|
+
readonly contentMain: number;
|
|
106
|
+
/** Normal numeric-owner phases already include the final recursive bounds. */
|
|
107
|
+
readonly normalOwner?: boolean;
|
|
108
|
+
/** Native phase residual, distinct from final geometric remainder. */
|
|
109
|
+
readonly autoMarginFreeMain?: number;
|
|
110
|
+
readonly revision: number;
|
|
111
|
+
readonly items: readonly Readonly<{
|
|
112
|
+
sourceIndex: number;
|
|
113
|
+
target: number;
|
|
114
|
+
min: number;
|
|
115
|
+
max: number;
|
|
116
|
+
measured?: boolean;
|
|
117
|
+
}>[];
|
|
118
|
+
}
|
|
119
|
+
export declare function stagePreparedIntrinsicMain(receiver: object | undefined, stage: PreparedIntrinsicMainStage): void;
|
|
120
|
+
export declare function peekPreparedIntrinsicMain(receiver: object | undefined, elements: readonly PibblElement<any>[], axis: 'row' | 'column', contentMain: number, revision: number): PreparedIntrinsicMainStage | undefined;
|
|
121
|
+
export declare function takePreparedIntrinsicMain(receiver: object | undefined, elements: readonly PibblElement<any>[], axis: 'row' | 'column', contentMain: number, revision: number): PreparedIntrinsicMainStage | undefined;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { disposeAllocationCheckpoint, adoptAllocationCheckpointOwner } from "./allocation-checkpoint-owner.js";
|
|
2
|
+
import { getLayoutDirection } from "./context.js";
|
|
3
|
+
import { peekPreNormalizedStyle } from "../style/resolve-dispatch.js";
|
|
4
|
+
import { isLayoutComponent, prepareLayoutComponent } from "./define-layout-component.js";
|
|
5
|
+
import { getElementMetadata, setElementMetadata, getPrimitiveReceiverToken } from "../element/metadata.js";
|
|
6
|
+
import { LayoutRegion, adoptMountedLayoutRegion } from "./wasm/region.js";
|
|
7
|
+
import { GLOBAL_STATE } from "../global-state.js";
|
|
8
|
+
import { releaseLayoutTopology, stageLayoutTopology } from "./topology.js";
|
|
9
|
+
import { snapshotLayoutTopology } from "./topology.js";
|
|
10
|
+
const preflights = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
function isKnownLayoutType(type) {
|
|
12
|
+
return preflights.has(type);
|
|
13
|
+
}
|
|
14
|
+
const currentReceiverSlots = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
function currentPreparedReceiverSlot(receiver) {
|
|
16
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
17
|
+
return transaction && receiver ? currentReceiverSlots.get(transaction)?.get(receiver) : void 0;
|
|
18
|
+
}
|
|
19
|
+
const snapshots = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function registerKnownLayoutPreflight(type, preflight) {
|
|
21
|
+
preflights.set(type, preflight);
|
|
22
|
+
}
|
|
23
|
+
function preflightKnownLayout(element, style, content, receiver, occurrence = 0, parentSlot, parentMainAxis, options) {
|
|
24
|
+
const parent = GLOBAL_STATE.componentRefs, owner = GLOBAL_STATE.currentPibblInstance;
|
|
25
|
+
if (!receiver || !parent || !owner || !GLOBAL_STATE.renderTransaction) return;
|
|
26
|
+
const root = isLayoutComponent(element.type) ? prepareLayoutComponent(element, { receiverToken: receiver }) : element;
|
|
27
|
+
const preflight = preflights.get(root.type);
|
|
28
|
+
if (!preflight) return;
|
|
29
|
+
const rootReceiver = root === element ? receiver : getPrimitiveReceiverToken(root);
|
|
30
|
+
if (!rootReceiver) throw new Error("A prepared layout description requires its own root receiver.");
|
|
31
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
32
|
+
let visiting = activeDescriptions.get(transaction);
|
|
33
|
+
if (!visiting) {
|
|
34
|
+
visiting = /* @__PURE__ */ new Set();
|
|
35
|
+
activeDescriptions.set(transaction, visiting);
|
|
36
|
+
}
|
|
37
|
+
const source = getElementMetadata(element)?.layoutDescriptionSource ?? element;
|
|
38
|
+
if (visiting.has(source)) throw new Error("Known layout descriptions form a cycle.");
|
|
39
|
+
visiting.add(source);
|
|
40
|
+
try {
|
|
41
|
+
let types = parentSlot?.children ?? slots.get(parent);
|
|
42
|
+
if (!types) {
|
|
43
|
+
types = /* @__PURE__ */ new Map();
|
|
44
|
+
slots.set(parent, types);
|
|
45
|
+
const owned = types;
|
|
46
|
+
parent.teardowns.add(() => {
|
|
47
|
+
for (const entries2 of owned.values()) for (const slot2 of entries2.values()) slot2.dispose();
|
|
48
|
+
owned.clear();
|
|
49
|
+
slots.delete(parent);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
let entries = types.get(element.type);
|
|
53
|
+
if (!entries) {
|
|
54
|
+
entries = /* @__PURE__ */ new Map();
|
|
55
|
+
types.set(element.type, entries);
|
|
56
|
+
}
|
|
57
|
+
const key = element.key === void 0 ? `occurrence:${occurrence}` : `key:${element.key}`;
|
|
58
|
+
let slot = entries.get(key);
|
|
59
|
+
if (slot && !slot.matchesRoot(root)) {
|
|
60
|
+
slot.dispose();
|
|
61
|
+
slot = void 0;
|
|
62
|
+
types.set(element.type, entries);
|
|
63
|
+
}
|
|
64
|
+
if (!slot) {
|
|
65
|
+
const ownedEntries = entries, ownedTypes = types;
|
|
66
|
+
const created = new PreparedLayoutSlot(owner.interactionRoot ?? owner, {
|
|
67
|
+
rootType: root.type,
|
|
68
|
+
rootKey: root.key,
|
|
69
|
+
release: () => {
|
|
70
|
+
if (ownedEntries.get(key) !== created) return;
|
|
71
|
+
ownedEntries.delete(key);
|
|
72
|
+
if (!ownedEntries.size) ownedTypes.delete(element.type);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
slot = created;
|
|
76
|
+
entries.set(key, slot);
|
|
77
|
+
}
|
|
78
|
+
stageLayoutTopology(transaction, slot, parentSlot);
|
|
79
|
+
preflight(root, style, content, rootReceiver, slot, parentMainAxis, options);
|
|
80
|
+
let receivers = currentReceiverSlots.get(transaction);
|
|
81
|
+
if (!receivers) {
|
|
82
|
+
receivers = /* @__PURE__ */ new WeakMap();
|
|
83
|
+
currentReceiverSlots.set(transaction, receivers);
|
|
84
|
+
}
|
|
85
|
+
receivers.set(receiver, slot);
|
|
86
|
+
receivers.set(rootReceiver, slot);
|
|
87
|
+
return slot;
|
|
88
|
+
} finally {
|
|
89
|
+
visiting.delete(source);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function attachPreparedLayoutSlot(element, slot) {
|
|
93
|
+
if (slot) setElementMetadata(element, { ...getElementMetadata(element), preparedLayoutSlot: slot });
|
|
94
|
+
}
|
|
95
|
+
class PreparedLayoutSlot {
|
|
96
|
+
constructor(topologyOwner, options) {
|
|
97
|
+
this.topologyOwner = topologyOwner;
|
|
98
|
+
this.rootType = options.rootType;
|
|
99
|
+
this.rootKey = options.rootKey;
|
|
100
|
+
this.release = options.release;
|
|
101
|
+
}
|
|
102
|
+
topologyOwner;
|
|
103
|
+
region;
|
|
104
|
+
boundaryOwner;
|
|
105
|
+
claimBoundary() {
|
|
106
|
+
const refs = GLOBAL_STATE.componentRefs;
|
|
107
|
+
if (this.boundaryOwner === refs) return;
|
|
108
|
+
this.boundaryOwner = refs;
|
|
109
|
+
adoptAllocationCheckpointOwner(this);
|
|
110
|
+
refs.teardowns.add(() => {
|
|
111
|
+
if (this.boundaryOwner === refs) this.dispose();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
children = /* @__PURE__ */ new Map();
|
|
115
|
+
disposeChildren() {
|
|
116
|
+
for (const entries of this.children.values()) for (const child of entries.values()) child.dispose();
|
|
117
|
+
this.children.clear();
|
|
118
|
+
}
|
|
119
|
+
rootType;
|
|
120
|
+
rootKey;
|
|
121
|
+
release;
|
|
122
|
+
matchesRoot(root) {
|
|
123
|
+
return this.rootType === root.type && this.rootKey === root.key;
|
|
124
|
+
}
|
|
125
|
+
acquire() {
|
|
126
|
+
return this.region ??= new LayoutRegion(this.topologyOwner);
|
|
127
|
+
}
|
|
128
|
+
dispose() {
|
|
129
|
+
disposeAllocationCheckpoint(this);
|
|
130
|
+
const region = this.region;
|
|
131
|
+
this.region = void 0;
|
|
132
|
+
this.boundaryOwner = void 0;
|
|
133
|
+
try {
|
|
134
|
+
this.disposeChildren();
|
|
135
|
+
region?.dispose();
|
|
136
|
+
} finally {
|
|
137
|
+
releaseLayoutTopology(this);
|
|
138
|
+
this.release();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
claim(region) {
|
|
142
|
+
if (this.region !== region) throw new Error("Prepared layout region is stale.");
|
|
143
|
+
adoptMountedLayoutRegion(region, () => {
|
|
144
|
+
if (this.region === region) {
|
|
145
|
+
this.region = void 0;
|
|
146
|
+
this.disposeChildren();
|
|
147
|
+
releaseLayoutTopology(this);
|
|
148
|
+
this.release();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const activeDescriptions = /* @__PURE__ */ new WeakMap();
|
|
154
|
+
const slots = /* @__PURE__ */ new WeakMap();
|
|
155
|
+
const plans = /* @__PURE__ */ new WeakMap();
|
|
156
|
+
function stagePreparedLayoutPlan(slot, plan) {
|
|
157
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
158
|
+
let pending = plans.get(transaction);
|
|
159
|
+
if (!pending) {
|
|
160
|
+
pending = /* @__PURE__ */ new Map();
|
|
161
|
+
plans.set(transaction, pending);
|
|
162
|
+
const owned = pending;
|
|
163
|
+
transaction.onFinish(() => {
|
|
164
|
+
for (const [slot2, entry] of owned) if (!entry.claimed) slot2.dispose();
|
|
165
|
+
owned.clear();
|
|
166
|
+
plans.delete(transaction);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (pending.has(slot)) throw new Error("Duplicate known layout occurrence during preparation.");
|
|
170
|
+
pending.set(slot, { plan, direction: getLayoutDirection(), claimed: false });
|
|
171
|
+
}
|
|
172
|
+
function claimPreparedLayoutPlan(element, content) {
|
|
173
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
174
|
+
const slot = getElementMetadata(element)?.preparedLayoutSlot;
|
|
175
|
+
if (!transaction || !slot) return;
|
|
176
|
+
const entry = plans.get(transaction)?.get(slot);
|
|
177
|
+
if (!entry || entry.claimed || entry.direction !== getLayoutDirection() || entry.plan.content.width !== content.width || entry.plan.content.height !== content.height) throw new Error("Prepared layout plan does not match its allocation.");
|
|
178
|
+
if (entry.plan.pending?.count) throw new Error("Prepared static Flex descendants did not receive a settled containing origin.");
|
|
179
|
+
if (entry.plan.region) slot.claim(entry.plan.region);
|
|
180
|
+
else slot.claimBoundary();
|
|
181
|
+
entry.claimed = true;
|
|
182
|
+
return entry.plan;
|
|
183
|
+
}
|
|
184
|
+
function claimPreparedFlexPlan(element, content) {
|
|
185
|
+
const plan = claimPreparedLayoutPlan(element, content);
|
|
186
|
+
if (!plan) return;
|
|
187
|
+
if (!plan.region || !("cached" in plan) || typeof plan.cached !== "boolean" || !("revision" in plan) || typeof plan.revision !== "number") throw new Error("Prepared Flex plan is incompatible with this boundary.");
|
|
188
|
+
return plan;
|
|
189
|
+
}
|
|
190
|
+
function peekPreparedLayoutPlan(slot, content, direction = getLayoutDirection()) {
|
|
191
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
192
|
+
const entry = transaction ? plans.get(transaction)?.get(slot) : void 0;
|
|
193
|
+
if (!entry || entry.claimed || entry.direction !== direction || entry.plan.content.width !== content.width || entry.plan.content.height !== content.height) return;
|
|
194
|
+
return entry.plan;
|
|
195
|
+
}
|
|
196
|
+
function peekPreparedFlexPlan(slot, content, direction = getLayoutDirection()) {
|
|
197
|
+
const plan = peekPreparedLayoutPlan(slot, content, direction);
|
|
198
|
+
if (!plan) return;
|
|
199
|
+
if (!plan.region || !("cached" in plan) || typeof plan.cached !== "boolean" || !("revision" in plan) || typeof plan.revision !== "number") {
|
|
200
|
+
throw new Error("Prepared Flex plan is incompatible with this baseline allocation.");
|
|
201
|
+
}
|
|
202
|
+
return plan;
|
|
203
|
+
}
|
|
204
|
+
function stagePreparedChildStyle(child, receiver, content, prepared) {
|
|
205
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
206
|
+
if (!transaction) return;
|
|
207
|
+
let pending = snapshots.get(transaction);
|
|
208
|
+
if (!pending) {
|
|
209
|
+
pending = /* @__PURE__ */ new WeakMap();
|
|
210
|
+
snapshots.set(transaction, pending);
|
|
211
|
+
transaction.onFinish(() => snapshots.delete(transaction));
|
|
212
|
+
}
|
|
213
|
+
pending.set(receiver, { child, width: content.width, height: content.height, prepared });
|
|
214
|
+
}
|
|
215
|
+
function takePreparedChildStyle(child, receiver, content) {
|
|
216
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
217
|
+
if (!transaction || !receiver || !content) return;
|
|
218
|
+
const pending = snapshots.get(transaction), snapshot = pending?.get(receiver);
|
|
219
|
+
if (!snapshot || snapshot.child !== child || snapshot.width !== content.width || snapshot.height !== content.height) return;
|
|
220
|
+
pending.delete(receiver);
|
|
221
|
+
return snapshot.prepared;
|
|
222
|
+
}
|
|
223
|
+
function hasPreparedChildStyles() {
|
|
224
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
225
|
+
return !!transaction && snapshots.has(transaction);
|
|
226
|
+
}
|
|
227
|
+
const boundaryChildren = /* @__PURE__ */ new WeakMap();
|
|
228
|
+
function stagePreparedBoundaryChildren(slot, children) {
|
|
229
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
230
|
+
let pending = boundaryChildren.get(transaction);
|
|
231
|
+
if (!pending) {
|
|
232
|
+
pending = /* @__PURE__ */ new Map();
|
|
233
|
+
boundaryChildren.set(transaction, pending);
|
|
234
|
+
const owned = pending;
|
|
235
|
+
transaction.onFinish(() => {
|
|
236
|
+
for (const [slot2, entry] of owned) if (!entry.claimed) slot2.dispose();
|
|
237
|
+
owned.clear();
|
|
238
|
+
boundaryChildren.delete(transaction);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
if (pending.has(slot)) throw new Error("Duplicate known layout boundary during preparation.");
|
|
242
|
+
let needsAllocationParent = false;
|
|
243
|
+
const numericPlans = plans.get(transaction);
|
|
244
|
+
for (let index = 0; index < children.length; index++) {
|
|
245
|
+
const childSlot = getElementMetadata(children[index])?.preparedLayoutSlot;
|
|
246
|
+
if (childSlot && (numericPlans?.has(childSlot) || pending.get(childSlot)?.needsAllocationParent)) {
|
|
247
|
+
needsAllocationParent = true;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
pending.set(slot, { children, direction: getLayoutDirection(), claimed: false, needsAllocationParent });
|
|
252
|
+
}
|
|
253
|
+
function takePreparedBoundaryChildren(element) {
|
|
254
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
255
|
+
const slot = getElementMetadata(element)?.preparedLayoutSlot;
|
|
256
|
+
if (!transaction || !slot) return;
|
|
257
|
+
const entry = boundaryChildren.get(transaction)?.get(slot);
|
|
258
|
+
if (!entry) return;
|
|
259
|
+
if (entry.claimed || entry.direction !== getLayoutDirection()) throw new Error("Prepared boundary children are stale.");
|
|
260
|
+
entry.claimed = true;
|
|
261
|
+
slot.claimBoundary();
|
|
262
|
+
return entry.children;
|
|
263
|
+
}
|
|
264
|
+
function preparedBoundaryNeedsAllocationParent(element) {
|
|
265
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
266
|
+
const slot = getElementMetadata(element)?.preparedLayoutSlot;
|
|
267
|
+
if (!transaction || !slot) return false;
|
|
268
|
+
return plans.get(transaction)?.has(slot) === true || boundaryChildren.get(transaction)?.get(slot)?.needsAllocationParent === true;
|
|
269
|
+
}
|
|
270
|
+
function retainPreparedBoundarySubtree(element) {
|
|
271
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
272
|
+
const slot = getElementMetadata(element)?.preparedLayoutSlot;
|
|
273
|
+
if (!transaction || !slot) return;
|
|
274
|
+
retainPreparedSubtree(slot, plans.get(transaction), boundaryChildren.get(transaction));
|
|
275
|
+
}
|
|
276
|
+
function retainPreparedSubtree(parent, pending, boundaries) {
|
|
277
|
+
for (const entries of parent.children.values()) for (const child of entries.values()) {
|
|
278
|
+
const entry = pending?.get(child);
|
|
279
|
+
if (entry) entry.claimed = true;
|
|
280
|
+
const boundary = boundaries?.get(child);
|
|
281
|
+
if (boundary) boundary.claimed = true;
|
|
282
|
+
retainPreparedSubtree(child, pending, boundaries);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function preparePlacedKnownLayout(element, occurrence, parentSlot) {
|
|
286
|
+
const prepared = peekPreNormalizedStyle(element);
|
|
287
|
+
if (!prepared) throw new Error("Known layout preparation requires settled receiver inputs.");
|
|
288
|
+
const settled = prepared.style;
|
|
289
|
+
const width = settled.width, height = settled.height;
|
|
290
|
+
if (typeof width !== "number" || typeof height !== "number") throw new Error("Known layout preparation requires settled content geometry.");
|
|
291
|
+
const slot = preflightKnownLayout(prepared.source, prepared.style, { x: 0, y: 0, width, height }, getPrimitiveReceiverToken(element), occurrence, parentSlot);
|
|
292
|
+
attachPreparedLayoutSlot(element, slot);
|
|
293
|
+
}
|
|
294
|
+
function prepareKnownLayoutDescendants(plan, parentSlot) {
|
|
295
|
+
let occurrences;
|
|
296
|
+
for (let index = 0; index < plan.children.length; index++) {
|
|
297
|
+
const child = plan.children[index];
|
|
298
|
+
if (!isKnownLayoutType(child.type) && !isLayoutComponent(child.type)) continue;
|
|
299
|
+
let occurrence = 0;
|
|
300
|
+
if (child.key === void 0) {
|
|
301
|
+
occurrences ??= /* @__PURE__ */ new Map();
|
|
302
|
+
occurrence = occurrences.get(child.type) ?? 0;
|
|
303
|
+
occurrences.set(child.type, occurrence + 1);
|
|
304
|
+
}
|
|
305
|
+
preparePlacedKnownLayout(plan.placements[index].element, occurrence, parentSlot);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const intrinsicMainStages = /* @__PURE__ */ new WeakMap();
|
|
309
|
+
function stagePreparedIntrinsicMain(receiver, stage) {
|
|
310
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
311
|
+
if (!transaction || !receiver) return;
|
|
312
|
+
let pending = intrinsicMainStages.get(transaction);
|
|
313
|
+
if (!pending) {
|
|
314
|
+
pending = /* @__PURE__ */ new WeakMap();
|
|
315
|
+
intrinsicMainStages.set(transaction, pending);
|
|
316
|
+
transaction.onFinish(() => intrinsicMainStages.delete(transaction));
|
|
317
|
+
}
|
|
318
|
+
pending.set(receiver, stage);
|
|
319
|
+
}
|
|
320
|
+
function peekPreparedIntrinsicMain(receiver, elements, axis, contentMain, revision) {
|
|
321
|
+
const transaction = GLOBAL_STATE.renderTransaction;
|
|
322
|
+
const stage = transaction && receiver ? intrinsicMainStages.get(transaction)?.get(receiver) : void 0;
|
|
323
|
+
if (!stage || stage.axis !== axis || stage.contentMain !== contentMain || stage.revision !== revision || stage.elements.length !== elements.length) return;
|
|
324
|
+
for (let index = 0; index < elements.length; index++) {
|
|
325
|
+
if (stage.elements[index] !== elements[index]) return;
|
|
326
|
+
}
|
|
327
|
+
return stage;
|
|
328
|
+
}
|
|
329
|
+
function takePreparedIntrinsicMain(receiver, elements, axis, contentMain, revision) {
|
|
330
|
+
const stage = peekPreparedIntrinsicMain(receiver, elements, axis, contentMain, revision);
|
|
331
|
+
if (stage) intrinsicMainStages.get(GLOBAL_STATE.renderTransaction).delete(receiver);
|
|
332
|
+
return stage;
|
|
333
|
+
}
|
|
334
|
+
export {
|
|
335
|
+
PreparedLayoutSlot,
|
|
336
|
+
attachPreparedLayoutSlot,
|
|
337
|
+
claimPreparedFlexPlan,
|
|
338
|
+
claimPreparedLayoutPlan,
|
|
339
|
+
currentPreparedReceiverSlot,
|
|
340
|
+
hasPreparedChildStyles,
|
|
341
|
+
isKnownLayoutType,
|
|
342
|
+
peekPreparedFlexPlan,
|
|
343
|
+
peekPreparedIntrinsicMain,
|
|
344
|
+
peekPreparedLayoutPlan,
|
|
345
|
+
preflightKnownLayout,
|
|
346
|
+
prepareKnownLayoutDescendants,
|
|
347
|
+
preparePlacedKnownLayout,
|
|
348
|
+
preparedBoundaryNeedsAllocationParent,
|
|
349
|
+
registerKnownLayoutPreflight,
|
|
350
|
+
retainPreparedBoundarySubtree,
|
|
351
|
+
snapshotLayoutTopology,
|
|
352
|
+
stagePreparedBoundaryChildren,
|
|
353
|
+
stagePreparedChildStyle,
|
|
354
|
+
stagePreparedIntrinsicMain,
|
|
355
|
+
stagePreparedLayoutPlan,
|
|
356
|
+
takePreparedBoundaryChildren,
|
|
357
|
+
takePreparedChildStyle,
|
|
358
|
+
takePreparedIntrinsicMain
|
|
359
|
+
};
|
|
360
|
+
//# sourceMappingURL=prepared-root.js.map
|