@pibbl/core 0.0.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/LICENSE.txt +19 -0
- package/README.md +76 -0
- package/THIRD_PARTY_NOTICES.txt +205 -0
- package/dist/features/particles/index.d.ts +7 -0
- package/dist/features/particles/index.js +26 -0
- package/dist/features/particles/index.js.map +7 -0
- package/dist/features/particles/index.mjs +1 -0
- package/dist/features/particles/lib/canvas/birth-ledger.d.ts +69 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js +752 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js.map +7 -0
- package/dist/features/particles/lib/canvas/component.d.ts +14 -0
- package/dist/features/particles/lib/canvas/component.js +249 -0
- package/dist/features/particles/lib/canvas/component.js.map +7 -0
- package/dist/features/particles/lib/canvas/executor.d.ts +31 -0
- package/dist/features/particles/lib/canvas/executor.js +537 -0
- package/dist/features/particles/lib/canvas/executor.js.map +7 -0
- package/dist/features/particles/lib/canvas/primitive.d.ts +14 -0
- package/dist/features/particles/lib/canvas/primitive.js +50 -0
- package/dist/features/particles/lib/canvas/primitive.js.map +7 -0
- package/dist/features/particles/lib/canvas/raster-cache.d.ts +13 -0
- package/dist/features/particles/lib/canvas/raster-cache.js +106 -0
- package/dist/features/particles/lib/canvas/raster-cache.js.map +7 -0
- package/dist/features/particles/lib/color.d.ts +7 -0
- package/dist/features/particles/lib/color.js +159 -0
- package/dist/features/particles/lib/color.js.map +7 -0
- package/dist/features/particles/lib/compiler.d.ts +134 -0
- package/dist/features/particles/lib/compiler.js +443 -0
- package/dist/features/particles/lib/compiler.js.map +7 -0
- package/dist/features/particles/lib/curve.d.ts +19 -0
- package/dist/features/particles/lib/curve.js +129 -0
- package/dist/features/particles/lib/curve.js.map +7 -0
- package/dist/features/particles/lib/definition-records.d.ts +58 -0
- package/dist/features/particles/lib/definition-records.js +500 -0
- package/dist/features/particles/lib/definition-records.js.map +7 -0
- package/dist/features/particles/lib/definition.d.ts +18 -0
- package/dist/features/particles/lib/definition.js +602 -0
- package/dist/features/particles/lib/definition.js.map +7 -0
- package/dist/features/particles/lib/emission.d.ts +54 -0
- package/dist/features/particles/lib/emission.js +184 -0
- package/dist/features/particles/lib/emission.js.map +7 -0
- package/dist/features/particles/lib/flow/field.d.ts +81 -0
- package/dist/features/particles/lib/flow/field.js +585 -0
- package/dist/features/particles/lib/flow/field.js.map +7 -0
- package/dist/features/particles/lib/flow/hook.d.ts +158 -0
- package/dist/features/particles/lib/flow/hook.js +215 -0
- package/dist/features/particles/lib/flow/hook.js.map +7 -0
- package/dist/features/particles/lib/flow/population.d.ts +25 -0
- package/dist/features/particles/lib/flow/population.js +104 -0
- package/dist/features/particles/lib/flow/population.js.map +7 -0
- package/dist/features/particles/lib/particle.d.ts +113 -0
- package/dist/features/particles/lib/particle.js +192 -0
- package/dist/features/particles/lib/particle.js.map +7 -0
- package/dist/features/particles/lib/random.d.ts +16 -0
- package/dist/features/particles/lib/random.js +61 -0
- package/dist/features/particles/lib/random.js.map +7 -0
- package/dist/features/particles/lib/sample.d.ts +32 -0
- package/dist/features/particles/lib/sample.js +397 -0
- package/dist/features/particles/lib/sample.js.map +7 -0
- package/dist/features/particles/lib/signal-inputs.d.ts +6 -0
- package/dist/features/particles/lib/signal-inputs.js +41 -0
- package/dist/features/particles/lib/signal-inputs.js.map +7 -0
- package/dist/features/particles/lib/system/binding.d.ts +59 -0
- package/dist/features/particles/lib/system/binding.js +122 -0
- package/dist/features/particles/lib/system/binding.js.map +7 -0
- package/dist/features/particles/lib/system/controller.d.ts +58 -0
- package/dist/features/particles/lib/system/controller.js +1446 -0
- package/dist/features/particles/lib/system/controller.js.map +7 -0
- package/dist/features/particles/lib/system/hook.d.ts +13 -0
- package/dist/features/particles/lib/system/hook.js +52 -0
- package/dist/features/particles/lib/system/hook.js.map +7 -0
- package/dist/features/particles/lib/system/ownership.d.ts +26 -0
- package/dist/features/particles/lib/system/ownership.js +128 -0
- package/dist/features/particles/lib/system/ownership.js.map +7 -0
- package/dist/features/particles/lib/types.d.ts +983 -0
- package/dist/features/physics/2d-geometry.d.ts +216 -0
- package/dist/features/physics/2d-geometry.js +59 -0
- package/dist/features/physics/2d-geometry.js.map +7 -0
- package/dist/features/physics/2d-geometry.mjs +1 -0
- package/dist/features/physics/2d-testing.d.ts +80 -0
- package/dist/features/physics/2d-testing.js +141 -0
- package/dist/features/physics/2d-testing.js.map +7 -0
- package/dist/features/physics/2d-testing.mjs +1 -0
- package/dist/features/physics/2d.d.ts +165 -0
- package/dist/features/physics/2d.js +119 -0
- package/dist/features/physics/2d.js.map +7 -0
- package/dist/features/physics/2d.mjs +1 -0
- package/dist/features/physics/lib/2d/canvas/components.d.ts +46 -0
- package/dist/features/physics/lib/2d/canvas/components.js +212 -0
- package/dist/features/physics/lib/2d/canvas/components.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/custom.d.ts +24 -0
- package/dist/features/physics/lib/2d/canvas/custom.js +45 -0
- package/dist/features/physics/lib/2d/canvas/custom.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/debug.d.ts +23 -0
- package/dist/features/physics/lib/2d/canvas/debug.js +53 -0
- package/dist/features/physics/lib/2d/canvas/debug.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/inference.d.ts +9 -0
- package/dist/features/physics/lib/2d/canvas/inference.js +704 -0
- package/dist/features/physics/lib/2d/canvas/inference.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/presentation.d.ts +11 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js +169 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/analytic.d.ts +15 -0
- package/dist/features/physics/lib/2d/collision/analytic.js +151 -0
- package/dist/features/physics/lib/2d/collision/analytic.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/casts.d.ts +37 -0
- package/dist/features/physics/lib/2d/collision/casts.js +631 -0
- package/dist/features/physics/lib/2d/collision/casts.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/epa.d.ts +21 -0
- package/dist/features/physics/lib/2d/collision/epa.js +102 -0
- package/dist/features/physics/lib/2d/collision/epa.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/gjk.d.ts +28 -0
- package/dist/features/physics/lib/2d/collision/gjk.js +233 -0
- package/dist/features/physics/lib/2d/collision/gjk.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/manifold.d.ts +35 -0
- package/dist/features/physics/lib/2d/collision/manifold.js +238 -0
- package/dist/features/physics/lib/2d/collision/manifold.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/pairs.d.ts +10 -0
- package/dist/features/physics/lib/2d/collision/pairs.js +285 -0
- package/dist/features/physics/lib/2d/collision/pairs.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/support.d.ts +20 -0
- package/dist/features/physics/lib/2d/collision/support.js +155 -0
- package/dist/features/physics/lib/2d/collision/support.js.map +7 -0
- package/dist/features/physics/lib/2d/inspection-types.d.ts +159 -0
- package/dist/features/physics/lib/2d/math.d.ts +27 -0
- package/dist/features/physics/lib/2d/math.js +314 -0
- package/dist/features/physics/lib/2d/math.js.map +7 -0
- package/dist/features/physics/lib/2d/numeric-policy.d.ts +24 -0
- package/dist/features/physics/lib/2d/numeric-policy.js +51 -0
- package/dist/features/physics/lib/2d/numeric-policy.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.d.ts +148 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js +305 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/context.d.ts +9 -0
- package/dist/features/physics/lib/2d/runtime/context.js +57 -0
- package/dist/features/physics/lib/2d/runtime/context.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/controller.d.ts +106 -0
- package/dist/features/physics/lib/2d/runtime/controller.js +1317 -0
- package/dist/features/physics/lib/2d/runtime/controller.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.d.ts +153 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js +526 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/events.d.ts +56 -0
- package/dist/features/physics/lib/2d/runtime/events.js +153 -0
- package/dist/features/physics/lib/2d/runtime/events.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.d.ts +22 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js +192 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/ownership.d.ts +41 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js +46 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/trace.d.ts +32 -0
- package/dist/features/physics/lib/2d/runtime/trace.js +22 -0
- package/dist/features/physics/lib/2d/runtime/trace.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-component.d.ts +18 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js +41 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-props.d.ts +16 -0
- package/dist/features/physics/lib/2d/shape-records.d.ts +60 -0
- package/dist/features/physics/lib/2d/shape-records.js +26 -0
- package/dist/features/physics/lib/2d/shape-records.js.map +7 -0
- package/dist/features/physics/lib/2d/shapes.d.ts +191 -0
- package/dist/features/physics/lib/2d/shapes.js +543 -0
- package/dist/features/physics/lib/2d/shapes.js.map +7 -0
- package/dist/features/physics/lib/2d/types.d.ts +713 -0
- package/dist/features/physics/lib/2d/types.js +1 -0
- package/dist/features/physics/lib/2d/types.js.map +7 -0
- package/dist/features/physics/lib/2d/world/broad-phase.d.ts +77 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js +762 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js.map +7 -0
- package/dist/features/physics/lib/2d/world/ccd.d.ts +19 -0
- package/dist/features/physics/lib/2d/world/ccd.js +265 -0
- package/dist/features/physics/lib/2d/world/ccd.js.map +7 -0
- package/dist/features/physics/lib/2d/world/contact-cache.d.ts +81 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js +497 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js.map +7 -0
- package/dist/features/physics/lib/2d/world/integrator.d.ts +11 -0
- package/dist/features/physics/lib/2d/world/integrator.js +99 -0
- package/dist/features/physics/lib/2d/world/integrator.js.map +7 -0
- package/dist/features/physics/lib/2d/world/queries.d.ts +62 -0
- package/dist/features/physics/lib/2d/world/queries.js +424 -0
- package/dist/features/physics/lib/2d/world/queries.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js +7054 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier.d.ts +50 -0
- package/dist/features/physics/lib/2d/world/rapier.js +655 -0
- package/dist/features/physics/lib/2d/world/rapier.js.map +7 -0
- package/dist/features/physics/lib/2d/world/solver.d.ts +58 -0
- package/dist/features/physics/lib/2d/world/solver.js +660 -0
- package/dist/features/physics/lib/2d/world/solver.js.map +7 -0
- package/dist/features/physics/lib/2d/world/storage.d.ts +96 -0
- package/dist/features/physics/lib/2d/world/storage.js +371 -0
- package/dist/features/physics/lib/2d/world/storage.js.map +7 -0
- package/dist/features/physics/lib/2d/world/world.d.ts +265 -0
- package/dist/features/physics/lib/2d/world/world.js +1713 -0
- package/dist/features/physics/lib/2d/world/world.js.map +7 -0
- package/dist/features/physics/lib/shared/signal-inputs.d.ts +5 -0
- package/dist/features/physics/lib/shared/signal-inputs.js +20 -0
- package/dist/features/physics/lib/shared/signal-inputs.js.map +7 -0
- package/dist/features/physics/lib/shared/validation.d.ts +5 -0
- package/dist/features/physics/lib/shared/validation.js +48 -0
- package/dist/features/physics/lib/shared/validation.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.js +23 -0
- package/dist/features/sprites/formats/aseprite.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.mjs +1 -0
- package/dist/features/sprites/formats/texture-packer.js +14 -0
- package/dist/features/sprites/formats/texture-packer.js.map +7 -0
- package/dist/features/sprites/formats/texture-packer.mjs +1 -0
- package/dist/features/sprites/index.js +9 -0
- package/dist/features/sprites/index.js.map +7 -0
- package/dist/features/sprites/index.mjs +1 -0
- package/dist/features/sprites/loader.js +63 -0
- package/dist/features/sprites/loader.js.map +7 -0
- package/dist/features/sprites/model.js +64 -0
- package/dist/features/sprites/model.js.map +7 -0
- package/dist/features/sprites/sprite.js +31 -0
- package/dist/features/sprites/sprite.js.map +7 -0
- package/dist/features/textures/index.d.ts +22 -0
- package/dist/features/textures/index.js +31 -0
- package/dist/features/textures/index.js.map +7 -0
- package/dist/features/textures/index.mjs +1 -0
- package/dist/features/textures/lib/definitions.d.ts +117 -0
- package/dist/features/textures/lib/definitions.js +179 -0
- package/dist/features/textures/lib/definitions.js.map +7 -0
- package/dist/features/textures/lib/electric-boundary.d.ts +3 -0
- package/dist/features/textures/lib/electric-boundary.js +11 -0
- package/dist/features/textures/lib/electric-boundary.js.map +7 -0
- package/dist/features/textures/lib/electric-shared.d.ts +69 -0
- package/dist/features/textures/lib/electric-shared.js +43 -0
- package/dist/features/textures/lib/electric-shared.js.map +7 -0
- package/dist/features/textures/lib/electric-sources.d.ts +50 -0
- package/dist/features/textures/lib/electric-sources.js +43 -0
- package/dist/features/textures/lib/electric-sources.js.map +7 -0
- package/dist/features/textures/lib/lightning.d.ts +72 -0
- package/dist/features/textures/lib/lightning.js +139 -0
- package/dist/features/textures/lib/lightning.js.map +7 -0
- package/dist/features/textures/lib/material-field.d.ts +12 -0
- package/dist/features/textures/lib/material-field.js +31 -0
- package/dist/features/textures/lib/material-field.js.map +7 -0
- package/dist/features/textures/lib/palette.d.ts +45 -0
- package/dist/features/textures/lib/palette.js +52 -0
- package/dist/features/textures/lib/palette.js.map +7 -0
- package/dist/features/textures/lib/presentation.d.ts +54 -0
- package/dist/features/textures/lib/presentation.js +83 -0
- package/dist/features/textures/lib/presentation.js.map +7 -0
- package/dist/features/textures/lib/procedural-texture.d.ts +44 -0
- package/dist/features/textures/lib/procedural-texture.js +110 -0
- package/dist/features/textures/lib/procedural-texture.js.map +7 -0
- package/dist/features/textures/lib/rain-drops.d.ts +96 -0
- package/dist/features/textures/lib/rain-drops.js +322 -0
- package/dist/features/textures/lib/rain-drops.js.map +7 -0
- package/dist/features/textures/lib/reaction-diffusion.d.ts +67 -0
- package/dist/features/textures/lib/reaction-diffusion.js +210 -0
- package/dist/features/textures/lib/reaction-diffusion.js.map +7 -0
- package/dist/features/textures/lib/simulation.d.ts +16 -0
- package/dist/features/textures/lib/simulation.js +85 -0
- package/dist/features/textures/lib/simulation.js.map +7 -0
- package/dist/features/textures/lib/tendrils.d.ts +57 -0
- package/dist/features/textures/lib/tendrils.js +216 -0
- package/dist/features/textures/lib/tendrils.js.map +7 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/electric.d.ts +88 -0
- package/dist/features/textures/lib/wasm/electric.js +299 -0
- package/dist/features/textures/lib/wasm/electric.js.map +7 -0
- package/dist/features/textures/lib/wasm/ink-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/marble-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/memory.d.ts +31 -0
- package/dist/features/textures/lib/wasm/memory.js +103 -0
- package/dist/features/textures/lib/wasm/memory.js.map +7 -0
- package/dist/features/textures/lib/wasm/paper-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js.map +7 -0
- package/dist/features/textures/lib/water-surface.d.ts +92 -0
- package/dist/features/textures/lib/water-surface.js +378 -0
- package/dist/features/textures/lib/water-surface.js.map +7 -0
- package/dist/features/textures/lib/water-waves.d.ts +60 -0
- package/dist/features/textures/lib/water-waves.js +154 -0
- package/dist/features/textures/lib/water-waves.js.map +7 -0
- package/dist/features/viz/index.d.ts +28 -0
- package/dist/features/viz/index.js +45 -0
- package/dist/features/viz/index.js.map +7 -0
- package/dist/features/viz/index.mjs +1 -0
- package/dist/features/viz/lib/anchored-layout.d.ts +104 -0
- package/dist/features/viz/lib/anchored-layout.js +166 -0
- package/dist/features/viz/lib/anchored-layout.js.map +7 -0
- package/dist/features/viz/lib/axis.d.ts +10 -0
- package/dist/features/viz/lib/axis.js +116 -0
- package/dist/features/viz/lib/axis.js.map +7 -0
- package/dist/features/viz/lib/band-scale.d.ts +3 -0
- package/dist/features/viz/lib/band-scale.js +57 -0
- package/dist/features/viz/lib/band-scale.js.map +7 -0
- package/dist/features/viz/lib/bar-fill.d.ts +16 -0
- package/dist/features/viz/lib/bar-fill.js +53 -0
- package/dist/features/viz/lib/bar-fill.js.map +7 -0
- package/dist/features/viz/lib/bar-series.d.ts +150 -0
- package/dist/features/viz/lib/bar-series.js +152 -0
- package/dist/features/viz/lib/bar-series.js.map +7 -0
- package/dist/features/viz/lib/hover-card.d.ts +92 -0
- package/dist/features/viz/lib/hover-card.js +146 -0
- package/dist/features/viz/lib/hover-card.js.map +7 -0
- package/dist/features/viz/lib/hover-data.d.ts +12 -0
- package/dist/features/viz/lib/hover-data.js +50 -0
- package/dist/features/viz/lib/hover-data.js.map +7 -0
- package/dist/features/viz/lib/hover-placement.d.ts +46 -0
- package/dist/features/viz/lib/hover-placement.js +51 -0
- package/dist/features/viz/lib/hover-placement.js.map +7 -0
- package/dist/features/viz/lib/hover-queries.d.ts +60 -0
- package/dist/features/viz/lib/hover-queries.js +185 -0
- package/dist/features/viz/lib/hover-queries.js.map +7 -0
- package/dist/features/viz/lib/hover-types.d.ts +277 -0
- package/dist/features/viz/lib/layout-pie.d.ts +13 -0
- package/dist/features/viz/lib/layout-pie.js +159 -0
- package/dist/features/viz/lib/layout-pie.js.map +7 -0
- package/dist/features/viz/lib/line-series.d.ts +11 -0
- package/dist/features/viz/lib/line-series.js +89 -0
- package/dist/features/viz/lib/line-series.js.map +7 -0
- package/dist/features/viz/lib/linear-scale.d.ts +3 -0
- package/dist/features/viz/lib/linear-scale.js +70 -0
- package/dist/features/viz/lib/linear-scale.js.map +7 -0
- package/dist/features/viz/lib/nearest.d.ts +82 -0
- package/dist/features/viz/lib/nearest.js +51 -0
- package/dist/features/viz/lib/nearest.js.map +7 -0
- package/dist/features/viz/lib/paint.d.ts +2 -0
- package/dist/features/viz/lib/paint.js +17 -0
- package/dist/features/viz/lib/paint.js.map +7 -0
- package/dist/features/viz/lib/pie-layout.d.ts +31 -0
- package/dist/features/viz/lib/pie-layout.js +324 -0
- package/dist/features/viz/lib/pie-layout.js.map +7 -0
- package/dist/features/viz/lib/pie-slices.d.ts +51 -0
- package/dist/features/viz/lib/pie-slices.js +50 -0
- package/dist/features/viz/lib/pie-slices.js.map +7 -0
- package/dist/features/viz/lib/pie-types.d.ts +215 -0
- package/dist/features/viz/lib/plot-series.d.ts +13 -0
- package/dist/features/viz/lib/plot-series.js +53 -0
- package/dist/features/viz/lib/plot-series.js.map +7 -0
- package/dist/features/viz/lib/plot-types.d.ts +63 -0
- package/dist/features/viz/lib/point-data.d.ts +5 -0
- package/dist/features/viz/lib/point-data.js +17 -0
- package/dist/features/viz/lib/point-data.js.map +7 -0
- package/dist/features/viz/lib/point-geometry.d.ts +2 -0
- package/dist/features/viz/lib/point-geometry.js +24 -0
- package/dist/features/viz/lib/point-geometry.js.map +7 -0
- package/dist/features/viz/lib/point-series.d.ts +11 -0
- package/dist/features/viz/lib/point-series.js +118 -0
- package/dist/features/viz/lib/point-series.js.map +7 -0
- package/dist/features/viz/lib/point-types.d.ts +94 -0
- package/dist/features/viz/lib/scale-adjust.d.ts +11 -0
- package/dist/features/viz/lib/scale-adjust.js +25 -0
- package/dist/features/viz/lib/scale-adjust.js.map +7 -0
- package/dist/features/viz/lib/scale-context.d.ts +8 -0
- package/dist/features/viz/lib/scale-context.js +61 -0
- package/dist/features/viz/lib/scale-context.js.map +7 -0
- package/dist/features/viz/lib/scale.d.ts +11 -0
- package/dist/features/viz/lib/scale.js +80 -0
- package/dist/features/viz/lib/scale.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +414 -0
- package/dist/features/viz/lib/use-scale.d.ts +20 -0
- package/dist/features/viz/lib/use-scale.js +10 -0
- package/dist/features/viz/lib/use-scale.js.map +7 -0
- package/dist/filters/displacement-gpu.d.ts +38 -0
- package/dist/filters/displacement-gpu.js +243 -0
- package/dist/filters/displacement-gpu.js.map +7 -0
- package/dist/filters/displacement-math.d.ts +5 -0
- package/dist/filters/displacement-math.js +22 -0
- package/dist/filters/displacement-math.js.map +7 -0
- package/dist/filters/displacement.d.ts +13 -0
- package/dist/filters/displacement.js +65 -0
- package/dist/filters/displacement.js.map +7 -0
- package/dist/filters/filter-executor.d.ts +21 -0
- package/dist/filters/filter-executor.js +120 -0
- package/dist/filters/filter-executor.js.map +7 -0
- package/dist/filters/native-canvas-filter.d.ts +4 -0
- package/dist/filters/native-canvas-filter.js +105 -0
- package/dist/filters/native-canvas-filter.js.map +7 -0
- package/dist/filters/native-color.d.ts +2 -0
- package/dist/filters/native-color.js +200 -0
- package/dist/filters/native-color.js.map +7 -0
- package/dist/filters/native-operations.d.ts +8 -0
- package/dist/filters/native-operations.js +7 -0
- package/dist/filters/native-operations.js.map +7 -0
- package/dist/filters/native.d.ts +113 -0
- package/dist/filters/native.js +115 -0
- package/dist/filters/native.js.map +7 -0
- package/dist/filters/reflected-light.d.ts +12 -0
- package/dist/filters/reflected-light.js +93 -0
- package/dist/filters/reflected-light.js.map +7 -0
- package/dist/filters/reflection-gpu.d.ts +58 -0
- package/dist/filters/reflection-gpu.js +266 -0
- package/dist/filters/reflection-gpu.js.map +7 -0
- package/dist/filters/render-displacement-boundary.d.ts +12 -0
- package/dist/filters/render-displacement-boundary.js +116 -0
- package/dist/filters/render-displacement-boundary.js.map +7 -0
- package/dist/filters/render-reflection-boundary.d.ts +15 -0
- package/dist/filters/render-reflection-boundary.js +127 -0
- package/dist/filters/render-reflection-boundary.js.map +7 -0
- package/dist/filters.d.ts +5 -0
- package/dist/filters.js +29 -0
- package/dist/filters.js.map +7 -0
- package/dist/filters.mjs +1 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +300 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +1 -0
- package/dist/internal.d.ts +160 -0
- package/dist/internal.js +320 -0
- package/dist/internal.js.map +7 -0
- package/dist/internal.mjs +1 -0
- package/dist/jsx-dev-runtime.d.ts +35 -0
- package/dist/jsx-dev-runtime.js +6 -0
- package/dist/jsx-dev-runtime.js.map +7 -0
- package/dist/jsx-dev-runtime.mjs +1 -0
- package/dist/jsx-runtime.d.ts +35 -0
- package/dist/jsx-runtime.js +7 -0
- package/dist/jsx-runtime.js.map +7 -0
- package/dist/jsx-runtime.mjs +1 -0
- package/dist/lib/animation/definition.d.ts +140 -0
- package/dist/lib/animation/definition.js +605 -0
- package/dist/lib/animation/definition.js.map +7 -0
- package/dist/lib/animation/easing.d.ts +55 -0
- package/dist/lib/animation/easing.js +112 -0
- package/dist/lib/animation/easing.js.map +7 -0
- package/dist/lib/animation/evaluate.d.ts +118 -0
- package/dist/lib/animation/evaluate.js +2398 -0
- package/dist/lib/animation/evaluate.js.map +7 -0
- package/dist/lib/animation/playback.d.ts +30 -0
- package/dist/lib/animation/playback.js +932 -0
- package/dist/lib/animation/playback.js.map +7 -0
- package/dist/lib/animation/program.d.ts +145 -0
- package/dist/lib/animation/program.js +741 -0
- package/dist/lib/animation/program.js.map +7 -0
- package/dist/lib/animation/spring.d.ts +30 -0
- package/dist/lib/animation/spring.js +324 -0
- package/dist/lib/animation/spring.js.map +7 -0
- package/dist/lib/animation/types.d.ts +418 -0
- package/dist/lib/animation/writer-leases.d.ts +47 -0
- package/dist/lib/animation/writer-leases.js +314 -0
- package/dist/lib/animation/writer-leases.js.map +7 -0
- package/dist/lib/backend/canvas-2d-backend.d.ts +4 -0
- package/dist/lib/backend/canvas-2d-backend.js +97 -0
- package/dist/lib/backend/canvas-2d-backend.js.map +7 -0
- package/dist/lib/backend/types.d.ts +309 -0
- package/dist/lib/backend/types.js +26 -0
- package/dist/lib/backend/types.js.map +7 -0
- package/dist/lib/components/arc-geometry.d.ts +4 -0
- package/dist/lib/components/arc-geometry.js +46 -0
- package/dist/lib/components/arc-geometry.js.map +7 -0
- package/dist/lib/components/arc.d.ts +55 -0
- package/dist/lib/components/arc.js +91 -0
- package/dist/lib/components/arc.js.map +7 -0
- package/dist/lib/components/circle.d.ts +49 -0
- package/dist/lib/components/circle.js +46 -0
- package/dist/lib/components/circle.js.map +7 -0
- package/dist/lib/components/clip.d.ts +43 -0
- package/dist/lib/components/clip.js +24 -0
- package/dist/lib/components/clip.js.map +7 -0
- package/dist/lib/components/ellipse.d.ts +53 -0
- package/dist/lib/components/ellipse.js +59 -0
- package/dist/lib/components/ellipse.js.map +7 -0
- package/dist/lib/components/g.d.ts +56 -0
- package/dist/lib/components/g.js +24 -0
- package/dist/lib/components/g.js.map +7 -0
- package/dist/lib/components/horizontal-line.d.ts +56 -0
- package/dist/lib/components/horizontal-line.js +71 -0
- package/dist/lib/components/horizontal-line.js.map +7 -0
- package/dist/lib/components/html-box.d.ts +16 -0
- package/dist/lib/components/html-box.js +57 -0
- package/dist/lib/components/html-box.js.map +7 -0
- package/dist/lib/components/img.d.ts +24 -0
- package/dist/lib/components/img.js +150 -0
- package/dist/lib/components/img.js.map +7 -0
- package/dist/lib/components/layer-node-equality.d.ts +65 -0
- package/dist/lib/components/layer-node-equality.js +91 -0
- package/dist/lib/components/layer-node-equality.js.map +7 -0
- package/dist/lib/components/layer.d.ts +34 -0
- package/dist/lib/components/layer.js +172 -0
- package/dist/lib/components/layer.js.map +7 -0
- package/dist/lib/components/line.d.ts +51 -0
- package/dist/lib/components/line.js +76 -0
- package/dist/lib/components/line.js.map +7 -0
- package/dist/lib/components/path.d.ts +28 -0
- package/dist/lib/components/path.js +47 -0
- package/dist/lib/components/path.js.map +7 -0
- package/dist/lib/components/polygon.d.ts +45 -0
- package/dist/lib/components/polygon.js +93 -0
- package/dist/lib/components/polygon.js.map +7 -0
- package/dist/lib/components/rect.d.ts +24 -0
- package/dist/lib/components/rect.js +83 -0
- package/dist/lib/components/rect.js.map +7 -0
- package/dist/lib/components/regular-polygon.d.ts +102 -0
- package/dist/lib/components/regular-polygon.js +112 -0
- package/dist/lib/components/regular-polygon.js.map +7 -0
- package/dist/lib/components/rounded-corner-style.d.ts +7 -0
- package/dist/lib/components/rounded-corner-style.js +40 -0
- package/dist/lib/components/rounded-corner-style.js.map +7 -0
- package/dist/lib/components/shape-style.d.ts +7 -0
- package/dist/lib/components/shape-style.js +52 -0
- package/dist/lib/components/shape-style.js.map +7 -0
- package/dist/lib/components/star.d.ts +56 -0
- package/dist/lib/components/star.js +98 -0
- package/dist/lib/components/star.js.map +7 -0
- package/dist/lib/components/structural-events.d.ts +10 -0
- package/dist/lib/components/structural-events.js +8 -0
- package/dist/lib/components/structural-events.js.map +7 -0
- package/dist/lib/components/svg-path.d.ts +23 -0
- package/dist/lib/components/svg-path.js +25 -0
- package/dist/lib/components/svg-path.js.map +7 -0
- package/dist/lib/components/text-layout.d.ts +31 -0
- package/dist/lib/components/text-layout.js +139 -0
- package/dist/lib/components/text-layout.js.map +7 -0
- package/dist/lib/components/text.d.ts +29 -0
- package/dist/lib/components/text.js +174 -0
- package/dist/lib/components/text.js.map +7 -0
- package/dist/lib/components/vertical-line.d.ts +57 -0
- package/dist/lib/components/vertical-line.js +71 -0
- package/dist/lib/components/vertical-line.js.map +7 -0
- package/dist/lib/components/wedge.d.ts +55 -0
- package/dist/lib/components/wedge.js +93 -0
- package/dist/lib/components/wedge.js.map +7 -0
- package/dist/lib/define-primitive.d.ts +82 -0
- package/dist/lib/define-primitive.js +85 -0
- package/dist/lib/define-primitive.js.map +7 -0
- package/dist/lib/development.d.ts +2 -0
- package/dist/lib/development.js +5 -0
- package/dist/lib/development.js.map +7 -0
- package/dist/lib/element/children.d.ts +16 -0
- package/dist/lib/element/children.js +333 -0
- package/dist/lib/element/children.js.map +7 -0
- package/dist/lib/element/create-element.d.ts +34 -0
- package/dist/lib/element/create-element.js +75 -0
- package/dist/lib/element/create-element.js.map +7 -0
- package/dist/lib/element/fragment.d.ts +15 -0
- package/dist/lib/element/fragment.js +11 -0
- package/dist/lib/element/fragment.js.map +7 -0
- package/dist/lib/element/jsx-runtime.d.ts +48 -0
- package/dist/lib/element/jsx-runtime.js +16 -0
- package/dist/lib/element/jsx-runtime.js.map +7 -0
- package/dist/lib/element/metadata.d.ts +96 -0
- package/dist/lib/element/metadata.js +160 -0
- package/dist/lib/element/metadata.js.map +7 -0
- package/dist/lib/element/resolve-primitive-inputs.d.ts +12 -0
- package/dist/lib/element/resolve-primitive-inputs.js +83 -0
- package/dist/lib/element/resolve-primitive-inputs.js.map +7 -0
- package/dist/lib/element/types.d.ts +123 -0
- package/dist/lib/element-enhancers.d.ts +134 -0
- package/dist/lib/element-enhancers.js +193 -0
- package/dist/lib/element-enhancers.js.map +7 -0
- package/dist/lib/events/adapters/clipboard.d.ts +9 -0
- package/dist/lib/events/adapters/clipboard.js +23 -0
- package/dist/lib/events/adapters/clipboard.js.map +7 -0
- package/dist/lib/events/adapters/drag.d.ts +12 -0
- package/dist/lib/events/adapters/drag.js +29 -0
- package/dist/lib/events/adapters/drag.js.map +7 -0
- package/dist/lib/events/adapters/editing.d.ts +15 -0
- package/dist/lib/events/adapters/editing.js +41 -0
- package/dist/lib/events/adapters/editing.js.map +7 -0
- package/dist/lib/events/adapters/keyboard-focus.d.ts +12 -0
- package/dist/lib/events/adapters/keyboard-focus.js +36 -0
- package/dist/lib/events/adapters/keyboard-focus.js.map +7 -0
- package/dist/lib/events/adapters/mouse.d.ts +17 -0
- package/dist/lib/events/adapters/mouse.js +32 -0
- package/dist/lib/events/adapters/mouse.js.map +7 -0
- package/dist/lib/events/adapters/pointer.d.ts +19 -0
- package/dist/lib/events/adapters/pointer.js +40 -0
- package/dist/lib/events/adapters/pointer.js.map +7 -0
- package/dist/lib/events/adapters/touch.d.ts +16 -0
- package/dist/lib/events/adapters/touch.js +36 -0
- package/dist/lib/events/adapters/touch.js.map +7 -0
- package/dist/lib/events/adapters/wheel.d.ts +10 -0
- package/dist/lib/events/adapters/wheel.js +16 -0
- package/dist/lib/events/adapters/wheel.js.map +7 -0
- package/dist/lib/events/boundary-transitions.d.ts +9 -0
- package/dist/lib/events/boundary-transitions.js +16 -0
- package/dist/lib/events/boundary-transitions.js.map +7 -0
- package/dist/lib/events/dispatch.d.ts +21 -0
- package/dist/lib/events/dispatch.js +1078 -0
- package/dist/lib/events/dispatch.js.map +7 -0
- package/dist/lib/events/event-definitions.d.ts +23 -0
- package/dist/lib/events/event-definitions.js +74 -0
- package/dist/lib/events/event-definitions.js.map +7 -0
- package/dist/lib/events/event-facade.d.ts +19 -0
- package/dist/lib/events/event-facade.js +188 -0
- package/dist/lib/events/event-facade.js.map +7 -0
- package/dist/lib/events/event-path.d.ts +3 -0
- package/dist/lib/events/event-path.js +43 -0
- package/dist/lib/events/event-path.js.map +7 -0
- package/dist/lib/events/hit-test.d.ts +13 -0
- package/dist/lib/events/hit-test.js +135 -0
- package/dist/lib/events/hit-test.js.map +7 -0
- package/dist/lib/events/native-listener-hub.d.ts +10 -0
- package/dist/lib/events/native-listener-hub.js +72 -0
- package/dist/lib/events/native-listener-hub.js.map +7 -0
- package/dist/lib/events/paint-entry.d.ts +66 -0
- package/dist/lib/events/paint-entry.js +30 -0
- package/dist/lib/events/paint-entry.js.map +7 -0
- package/dist/lib/events/pointer-capture.d.ts +23 -0
- package/dist/lib/events/pointer-capture.js +339 -0
- package/dist/lib/events/pointer-capture.js.map +7 -0
- package/dist/lib/events/propagation.d.ts +7 -0
- package/dist/lib/events/propagation.js +56 -0
- package/dist/lib/events/propagation.js.map +7 -0
- package/dist/lib/events/registrations.d.ts +120 -0
- package/dist/lib/events/registrations.js +397 -0
- package/dist/lib/events/registrations.js.map +7 -0
- package/dist/lib/events/resolver-input.d.ts +25 -0
- package/dist/lib/events/resolver-input.js +62 -0
- package/dist/lib/events/resolver-input.js.map +7 -0
- package/dist/lib/events/types.d.ts +596 -0
- package/dist/lib/execute-render.d.ts +9 -0
- package/dist/lib/execute-render.js +195 -0
- package/dist/lib/execute-render.js.map +7 -0
- package/dist/lib/filter/canvas-state.d.ts +2 -0
- package/dist/lib/filter/canvas-state.js +31 -0
- package/dist/lib/filter/canvas-state.js.map +7 -0
- package/dist/lib/filter/filter-region.d.ts +33 -0
- package/dist/lib/filter/filter-region.js +291 -0
- package/dist/lib/filter/filter-region.js.map +7 -0
- package/dist/lib/filter/filter-surface-pool.d.ts +38 -0
- package/dist/lib/filter/filter-surface-pool.js +252 -0
- package/dist/lib/filter/filter-surface-pool.js.map +7 -0
- package/dist/lib/filter/render-filter-boundary.d.ts +14 -0
- package/dist/lib/filter/render-filter-boundary.js +211 -0
- package/dist/lib/filter/render-filter-boundary.js.map +7 -0
- package/dist/lib/focus/directional-navigation.d.ts +12 -0
- package/dist/lib/focus/directional-navigation.js +86 -0
- package/dist/lib/focus/directional-navigation.js.map +7 -0
- package/dist/lib/focus/dom-focus-host.d.ts +13 -0
- package/dist/lib/focus/dom-focus-host.js +352 -0
- package/dist/lib/focus/dom-focus-host.js.map +7 -0
- package/dist/lib/focus/dom-tab-stops.d.ts +3 -0
- package/dist/lib/focus/dom-tab-stops.js +71 -0
- package/dist/lib/focus/dom-tab-stops.js.map +7 -0
- package/dist/lib/focus/focus-events.d.ts +4 -0
- package/dist/lib/focus/focus-events.js +78 -0
- package/dist/lib/focus/focus-events.js.map +7 -0
- package/dist/lib/focus/focus-manager.d.ts +121 -0
- package/dist/lib/focus/focus-manager.js +1131 -0
- package/dist/lib/focus/focus-manager.js.map +7 -0
- package/dist/lib/focus/geometry.d.ts +4 -0
- package/dist/lib/focus/geometry.js +64 -0
- package/dist/lib/focus/geometry.js.map +7 -0
- package/dist/lib/focus/html-focus-region.d.ts +27 -0
- package/dist/lib/focus/keyboard-defaults.d.ts +7 -0
- package/dist/lib/focus/keyboard-defaults.js +110 -0
- package/dist/lib/focus/keyboard-defaults.js.map +7 -0
- package/dist/lib/focus/policy-components.d.ts +45 -0
- package/dist/lib/focus/policy-components.js +94 -0
- package/dist/lib/focus/policy-components.js.map +7 -0
- package/dist/lib/focus/types.d.ts +37 -0
- package/dist/lib/focus/types.js +7 -0
- package/dist/lib/focus/types.js.map +7 -0
- package/dist/lib/geometry/circle.d.ts +22 -0
- package/dist/lib/geometry/circle.js +13 -0
- package/dist/lib/geometry/circle.js.map +7 -0
- package/dist/lib/geometry/circular-sweep.d.ts +54 -0
- package/dist/lib/geometry/circular-sweep.js +95 -0
- package/dist/lib/geometry/circular-sweep.js.map +7 -0
- package/dist/lib/geometry/ellipse.d.ts +26 -0
- package/dist/lib/geometry/ellipse.js +17 -0
- package/dist/lib/geometry/ellipse.js.map +7 -0
- package/dist/lib/geometry/line.d.ts +20 -0
- package/dist/lib/geometry/line.js +15 -0
- package/dist/lib/geometry/line.js.map +7 -0
- package/dist/lib/geometry/path-arc.d.ts +25 -0
- package/dist/lib/geometry/path-arc.js +57 -0
- package/dist/lib/geometry/path-arc.js.map +7 -0
- package/dist/lib/geometry/path-bend-guide.d.ts +31 -0
- package/dist/lib/geometry/path-bend-guide.js +282 -0
- package/dist/lib/geometry/path-bend-guide.js.map +7 -0
- package/dist/lib/geometry/path-bend-spans.d.ts +31 -0
- package/dist/lib/geometry/path-bend-spans.js +109 -0
- package/dist/lib/geometry/path-bend-spans.js.map +7 -0
- package/dist/lib/geometry/path-bending.d.ts +90 -0
- package/dist/lib/geometry/path-bending.js +202 -0
- package/dist/lib/geometry/path-bending.js.map +7 -0
- package/dist/lib/geometry/path-conversion.d.ts +19 -0
- package/dist/lib/geometry/path-conversion.js +114 -0
- package/dist/lib/geometry/path-conversion.js.map +7 -0
- package/dist/lib/geometry/path-geometry.d.ts +218 -0
- package/dist/lib/geometry/path-geometry.js +557 -0
- package/dist/lib/geometry/path-geometry.js.map +7 -0
- package/dist/lib/geometry/path-radial.d.ts +15 -0
- package/dist/lib/geometry/path-radial.js +107 -0
- package/dist/lib/geometry/path-radial.js.map +7 -0
- package/dist/lib/geometry/path-transforms.d.ts +233 -0
- package/dist/lib/geometry/path-transforms.js +478 -0
- package/dist/lib/geometry/path-transforms.js.map +7 -0
- package/dist/lib/geometry/path-utilities.d.ts +78 -0
- package/dist/lib/geometry/path-utilities.js +341 -0
- package/dist/lib/geometry/path-utilities.js.map +7 -0
- package/dist/lib/geometry/path-wang.d.ts +18 -0
- package/dist/lib/geometry/path-wang.js +136 -0
- package/dist/lib/geometry/path-wang.js.map +7 -0
- package/dist/lib/geometry/path-warp-bezier.d.ts +17 -0
- package/dist/lib/geometry/path-warp-bezier.js +109 -0
- package/dist/lib/geometry/path-warp-bezier.js.map +7 -0
- package/dist/lib/geometry/path-warp.d.ts +27 -0
- package/dist/lib/geometry/path-warp.js +165 -0
- package/dist/lib/geometry/path-warp.js.map +7 -0
- package/dist/lib/geometry/polygon.d.ts +21 -0
- package/dist/lib/geometry/polygon.js +12 -0
- package/dist/lib/geometry/polygon.js.map +7 -0
- package/dist/lib/geometry/rectangle.d.ts +38 -0
- package/dist/lib/geometry/rectangle.js +22 -0
- package/dist/lib/geometry/rectangle.js.map +7 -0
- package/dist/lib/geometry/regular-polygon.d.ts +88 -0
- package/dist/lib/geometry/regular-polygon.js +67 -0
- package/dist/lib/geometry/regular-polygon.js.map +7 -0
- package/dist/lib/geometry/resolve-path.d.ts +4 -0
- package/dist/lib/geometry/resolve-path.js +16 -0
- package/dist/lib/geometry/resolve-path.js.map +7 -0
- package/dist/lib/geometry/rounded-corners.d.ts +28 -0
- package/dist/lib/geometry/rounded-corners.js +118 -0
- package/dist/lib/geometry/rounded-corners.js.map +7 -0
- package/dist/lib/geometry/star.d.ts +39 -0
- package/dist/lib/geometry/star.js +90 -0
- package/dist/lib/geometry/star.js.map +7 -0
- package/dist/lib/geometry/svg-path.d.ts +21 -0
- package/dist/lib/geometry/svg-path.js +7 -0
- package/dist/lib/geometry/svg-path.js.map +7 -0
- package/dist/lib/geometry/transform-bend.d.ts +46 -0
- package/dist/lib/geometry/transform-bend.js +219 -0
- package/dist/lib/geometry/transform-bend.js.map +7 -0
- package/dist/lib/geometry/transform-guide.d.ts +57 -0
- package/dist/lib/geometry/transform-guide.js +157 -0
- package/dist/lib/geometry/transform-guide.js.map +7 -0
- package/dist/lib/geometry/transform-math.d.ts +21 -0
- package/dist/lib/geometry/transform-math.js +91 -0
- package/dist/lib/geometry/transform-math.js.map +7 -0
- package/dist/lib/geometry/transform-mesh.d.ts +39 -0
- package/dist/lib/geometry/transform-mesh.js +129 -0
- package/dist/lib/geometry/transform-mesh.js.map +7 -0
- package/dist/lib/geometry/validation.d.ts +6 -0
- package/dist/lib/geometry/validation.js +42 -0
- package/dist/lib/geometry/validation.js.map +7 -0
- package/dist/lib/global-state.d.ts +63 -0
- package/dist/lib/global-state.js +176 -0
- package/dist/lib/global-state.js.map +7 -0
- package/dist/lib/hooks/hook-slot.d.ts +30 -0
- package/dist/lib/hooks/hook-slot.js +66 -0
- package/dist/lib/hooks/hook-slot.js.map +7 -0
- package/dist/lib/hooks/use-animated-value.d.ts +24 -0
- package/dist/lib/hooks/use-animated-value.js +169 -0
- package/dist/lib/hooks/use-animated-value.js.map +7 -0
- package/dist/lib/hooks/use-canvas-context.d.ts +10 -0
- package/dist/lib/hooks/use-canvas-context.js +13 -0
- package/dist/lib/hooks/use-canvas-context.js.map +7 -0
- package/dist/lib/hooks/use-computed.d.ts +13 -0
- package/dist/lib/hooks/use-computed.js +91 -0
- package/dist/lib/hooks/use-computed.js.map +7 -0
- package/dist/lib/hooks/use-const.d.ts +10 -0
- package/dist/lib/hooks/use-const.js +15 -0
- package/dist/lib/hooks/use-const.js.map +7 -0
- package/dist/lib/hooks/use-cursor.d.ts +16 -0
- package/dist/lib/hooks/use-cursor.js +51 -0
- package/dist/lib/hooks/use-cursor.js.map +7 -0
- package/dist/lib/hooks/use-event-listener.d.ts +10 -0
- package/dist/lib/hooks/use-event-listener.js +24 -0
- package/dist/lib/hooks/use-event-listener.js.map +7 -0
- package/dist/lib/hooks/use-event-target.d.ts +14 -0
- package/dist/lib/hooks/use-event-target.js +30 -0
- package/dist/lib/hooks/use-event-target.js.map +7 -0
- package/dist/lib/hooks/use-layout-box.d.ts +9 -0
- package/dist/lib/hooks/use-layout-box.js +8 -0
- package/dist/lib/hooks/use-layout-box.js.map +7 -0
- package/dist/lib/hooks/use-line-path.d.ts +14 -0
- package/dist/lib/hooks/use-line-path.js +13 -0
- package/dist/lib/hooks/use-line-path.js.map +7 -0
- package/dist/lib/hooks/use-paint-target.d.ts +3 -0
- package/dist/lib/hooks/use-paint-target.js +34 -0
- package/dist/lib/hooks/use-paint-target.js.map +7 -0
- package/dist/lib/hooks/use-playback.d.ts +21 -0
- package/dist/lib/hooks/use-playback.js +87 -0
- package/dist/lib/hooks/use-playback.js.map +7 -0
- package/dist/lib/hooks/use-reaction.d.ts +19 -0
- package/dist/lib/hooks/use-reaction.js +245 -0
- package/dist/lib/hooks/use-reaction.js.map +7 -0
- package/dist/lib/hooks/use-rect-path.d.ts +20 -0
- package/dist/lib/hooks/use-rect-path.js +25 -0
- package/dist/lib/hooks/use-rect-path.js.map +7 -0
- package/dist/lib/hooks/use-ref.d.ts +17 -0
- package/dist/lib/hooks/use-ref.js +8 -0
- package/dist/lib/hooks/use-ref.js.map +7 -0
- package/dist/lib/hooks/use-region.d.ts +11 -0
- package/dist/lib/hooks/use-region.js +34 -0
- package/dist/lib/hooks/use-region.js.map +7 -0
- package/dist/lib/hooks/use-signal.d.ts +12 -0
- package/dist/lib/hooks/use-signal.js +12 -0
- package/dist/lib/hooks/use-signal.js.map +7 -0
- package/dist/lib/hooks/use-svg-path.d.ts +11 -0
- package/dist/lib/hooks/use-svg-path.js +13 -0
- package/dist/lib/hooks/use-svg-path.js.map +7 -0
- package/dist/lib/hooks/use-value-memo-slot.d.ts +12 -0
- package/dist/lib/hooks/use-value-memo-slot.js +45 -0
- package/dist/lib/hooks/use-value-memo-slot.js.map +7 -0
- package/dist/lib/hooks/use-visibility-transition.d.ts +103 -0
- package/dist/lib/hooks/use-visibility-transition.js +195 -0
- package/dist/lib/hooks/use-visibility-transition.js.map +7 -0
- package/dist/lib/html/html-service.d.ts +30 -0
- package/dist/lib/html/html-service.js +281 -0
- package/dist/lib/html/html-service.js.map +7 -0
- package/dist/lib/html/overlay-config.d.ts +3 -0
- package/dist/lib/html/overlay-config.js +37 -0
- package/dist/lib/html/overlay-config.js.map +7 -0
- package/dist/lib/html/portable-clips.d.ts +4 -0
- package/dist/lib/html/portable-clips.js +20 -0
- package/dist/lib/html/portable-clips.js.map +7 -0
- package/dist/lib/html/types.d.ts +110 -0
- package/dist/lib/layout/absolute.d.ts +57 -0
- package/dist/lib/layout/absolute.js +348 -0
- package/dist/lib/layout/absolute.js.map +7 -0
- package/dist/lib/layout/box.d.ts +19 -0
- package/dist/lib/layout/box.js +209 -0
- package/dist/lib/layout/box.js.map +7 -0
- package/dist/lib/layout/context.d.ts +13 -0
- package/dist/lib/layout/context.js +42 -0
- package/dist/lib/layout/context.js.map +7 -0
- package/dist/lib/layout/diagnostics.d.ts +15 -0
- package/dist/lib/layout/diagnostics.js +30 -0
- package/dist/lib/layout/diagnostics.js.map +7 -0
- package/dist/lib/layout/flex.d.ts +64 -0
- package/dist/lib/layout/flex.js +803 -0
- package/dist/lib/layout/flex.js.map +7 -0
- package/dist/lib/layout/flow.d.ts +53 -0
- package/dist/lib/layout/flow.js +400 -0
- package/dist/lib/layout/flow.js.map +7 -0
- package/dist/lib/layout/grid.d.ts +64 -0
- package/dist/lib/layout/grid.js +597 -0
- package/dist/lib/layout/grid.js.map +7 -0
- package/dist/lib/layout/measure.d.ts +19 -0
- package/dist/lib/layout/measure.js +144 -0
- package/dist/lib/layout/measure.js.map +7 -0
- package/dist/lib/layout/overlay.d.ts +42 -0
- package/dist/lib/layout/overlay.js +151 -0
- package/dist/lib/layout/overlay.js.map +7 -0
- package/dist/lib/layout/place-child.d.ts +12 -0
- package/dist/lib/layout/place-child.js +72 -0
- package/dist/lib/layout/place-child.js.map +7 -0
- package/dist/lib/layout/positioning-diagnostics.d.ts +3 -0
- package/dist/lib/layout/positioning-diagnostics.js +15 -0
- package/dist/lib/layout/positioning-diagnostics.js.map +7 -0
- package/dist/lib/layout/types.d.ts +78 -0
- package/dist/lib/manipulation/controller-types.d.ts +299 -0
- package/dist/lib/manipulation/controller.d.ts +57 -0
- package/dist/lib/manipulation/controller.js +464 -0
- package/dist/lib/manipulation/controller.js.map +7 -0
- package/dist/lib/manipulation/coordinates.d.ts +9 -0
- package/dist/lib/manipulation/coordinates.js +55 -0
- package/dist/lib/manipulation/coordinates.js.map +7 -0
- package/dist/lib/manipulation/degrees.d.ts +10 -0
- package/dist/lib/manipulation/degrees.js +9 -0
- package/dist/lib/manipulation/degrees.js.map +7 -0
- package/dist/lib/manipulation/frame.d.ts +24 -0
- package/dist/lib/manipulation/frame.js +101 -0
- package/dist/lib/manipulation/frame.js.map +7 -0
- package/dist/lib/manipulation/geometry.d.ts +4 -0
- package/dist/lib/manipulation/geometry.js +26 -0
- package/dist/lib/manipulation/geometry.js.map +7 -0
- package/dist/lib/manipulation/handles.d.ts +298 -0
- package/dist/lib/manipulation/handles.js +598 -0
- package/dist/lib/manipulation/handles.js.map +7 -0
- package/dist/lib/manipulation/manipulable.d.ts +65 -0
- package/dist/lib/manipulation/manipulable.js +47 -0
- package/dist/lib/manipulation/manipulable.js.map +7 -0
- package/dist/lib/manipulation/ownership.d.ts +15 -0
- package/dist/lib/manipulation/ownership.js +80 -0
- package/dist/lib/manipulation/ownership.js.map +7 -0
- package/dist/lib/manipulation/snap.d.ts +6 -0
- package/dist/lib/manipulation/snap.js +40 -0
- package/dist/lib/manipulation/snap.js.map +7 -0
- package/dist/lib/manipulation/solve.d.ts +2 -0
- package/dist/lib/manipulation/solve.js +563 -0
- package/dist/lib/manipulation/solve.js.map +7 -0
- package/dist/lib/manipulation/types.d.ts +178 -0
- package/dist/lib/mount-pibbl.d.ts +25 -0
- package/dist/lib/mount-pibbl.js +278 -0
- package/dist/lib/mount-pibbl.js.map +7 -0
- package/dist/lib/optional-services.d.ts +8 -0
- package/dist/lib/optional-services.js +11 -0
- package/dist/lib/optional-services.js.map +7 -0
- package/dist/lib/pibbl.d.ts +17 -0
- package/dist/lib/pibbl.js +21 -0
- package/dist/lib/pibbl.js.map +7 -0
- package/dist/lib/primitive-presentation.d.ts +24 -0
- package/dist/lib/primitive-presentation.js +102 -0
- package/dist/lib/primitive-presentation.js.map +7 -0
- package/dist/lib/render-layer/controller.d.ts +67 -0
- package/dist/lib/render-layer/controller.js +603 -0
- package/dist/lib/render-layer/controller.js.map +7 -0
- package/dist/lib/render-layer/define-render-layer.d.ts +17 -0
- package/dist/lib/render-layer/define-render-layer.js +90 -0
- package/dist/lib/render-layer/define-render-layer.js.map +7 -0
- package/dist/lib/render-layer/types.d.ts +315 -0
- package/dist/lib/render-target.d.ts +27 -0
- package/dist/lib/render-target.js +118 -0
- package/dist/lib/render-target.js.map +7 -0
- package/dist/lib/render-transaction.d.ts +10 -0
- package/dist/lib/render-transaction.js +46 -0
- package/dist/lib/render-transaction.js.map +7 -0
- package/dist/lib/render.d.ts +3 -0
- package/dist/lib/render.js +385 -0
- package/dist/lib/render.js.map +7 -0
- package/dist/lib/scheduler/realm-scheduler.d.ts +52 -0
- package/dist/lib/scheduler/realm-scheduler.js +964 -0
- package/dist/lib/scheduler/realm-scheduler.js.map +7 -0
- package/dist/lib/scheduler/renderer-participant.d.ts +257 -0
- package/dist/lib/scheduler/renderer-participant.js +216 -0
- package/dist/lib/scheduler/renderer-participant.js.map +7 -0
- package/dist/lib/scheduler/simulation-participant.d.ts +103 -0
- package/dist/lib/scheduler/simulation-participant.js +229 -0
- package/dist/lib/scheduler/simulation-participant.js.map +7 -0
- package/dist/lib/scheduler/testing.d.ts +56 -0
- package/dist/lib/scheduler/testing.js +71 -0
- package/dist/lib/scheduler/testing.js.map +7 -0
- package/dist/lib/scheduler/types.d.ts +103 -0
- package/dist/lib/signals/edge.d.ts +44 -0
- package/dist/lib/signals/edge.js +245 -0
- package/dist/lib/signals/edge.js.map +7 -0
- package/dist/lib/signals/graph.d.ts +220 -0
- package/dist/lib/signals/graph.js +1035 -0
- package/dist/lib/signals/graph.js.map +7 -0
- package/dist/lib/signals/input-provision.d.ts +3 -0
- package/dist/lib/signals/input-provision.js +67 -0
- package/dist/lib/signals/input-provision.js.map +7 -0
- package/dist/lib/signals/render-consumer.d.ts +21 -0
- package/dist/lib/signals/render-consumer.js +218 -0
- package/dist/lib/signals/render-consumer.js.map +7 -0
- package/dist/lib/signals/resolve-signal-value.d.ts +10 -0
- package/dist/lib/signals/resolve-signal-value.js +17 -0
- package/dist/lib/signals/resolve-signal-value.js.map +7 -0
- package/dist/lib/signals/types.d.ts +80 -0
- package/dist/lib/style/diagnostics.d.ts +83 -0
- package/dist/lib/style/diagnostics.js +63 -0
- package/dist/lib/style/diagnostics.js.map +7 -0
- package/dist/lib/style/empty-style.d.ts +3 -0
- package/dist/lib/style/empty-style.js +5 -0
- package/dist/lib/style/empty-style.js.map +7 -0
- package/dist/lib/style/filter-types.d.ts +243 -0
- package/dist/lib/style/filter-types.js +5 -0
- package/dist/lib/style/filter-types.js.map +7 -0
- package/dist/lib/style/filter.d.ts +7 -0
- package/dist/lib/style/filter.js +50 -0
- package/dist/lib/style/filter.js.map +7 -0
- package/dist/lib/style/normalize.d.ts +18 -0
- package/dist/lib/style/normalize.js +50 -0
- package/dist/lib/style/normalize.js.map +7 -0
- package/dist/lib/style/positioning.d.ts +32 -0
- package/dist/lib/style/positioning.js +81 -0
- package/dist/lib/style/positioning.js.map +7 -0
- package/dist/lib/style/resolve-built-in.d.ts +6 -0
- package/dist/lib/style/resolve-built-in.js +58 -0
- package/dist/lib/style/resolve-built-in.js.map +7 -0
- package/dist/lib/style/resolve-dispatch.d.ts +20 -0
- package/dist/lib/style/resolve-dispatch.js +167 -0
- package/dist/lib/style/resolve-dispatch.js.map +7 -0
- package/dist/lib/style/resolve-length.d.ts +16 -0
- package/dist/lib/style/resolve-length.js +54 -0
- package/dist/lib/style/resolve-length.js.map +7 -0
- package/dist/lib/style/responsive.d.ts +31 -0
- package/dist/lib/style/responsive.js +172 -0
- package/dist/lib/style/responsive.js.map +7 -0
- package/dist/lib/style/types.d.ts +338 -0
- package/dist/lib/surface/resolve-surface.d.ts +4 -0
- package/dist/lib/surface/resolve-surface.js +184 -0
- package/dist/lib/surface/resolve-surface.js.map +7 -0
- package/dist/lib/surface/root-surface.d.ts +7 -0
- package/dist/lib/surface/root-surface.js +171 -0
- package/dist/lib/surface/root-surface.js.map +7 -0
- package/dist/lib/surface/transform.d.ts +4 -0
- package/dist/lib/surface/transform.js +16 -0
- package/dist/lib/surface/transform.js.map +7 -0
- package/dist/lib/surface/types.d.ts +132 -0
- package/dist/lib/teardowns.d.ts +14 -0
- package/dist/lib/teardowns.js +50 -0
- package/dist/lib/teardowns.js.map +7 -0
- package/dist/lib/textures/texture-protocol.d.ts +124 -0
- package/dist/lib/textures/texture-protocol.js +40 -0
- package/dist/lib/textures/texture-protocol.js.map +7 -0
- package/dist/lib/textures/texture.d.ts +170 -0
- package/dist/lib/textures/texture.js +385 -0
- package/dist/lib/textures/texture.js.map +7 -0
- package/dist/lib/transitions/bifrost.d.ts +47 -0
- package/dist/lib/transitions/bifrost.js +91 -0
- package/dist/lib/transitions/bifrost.js.map +7 -0
- package/dist/lib/transitions/binding.d.ts +14 -0
- package/dist/lib/transitions/binding.js +35 -0
- package/dist/lib/transitions/binding.js.map +7 -0
- package/dist/lib/transitions/capture.d.ts +21 -0
- package/dist/lib/transitions/capture.js +91 -0
- package/dist/lib/transitions/capture.js.map +7 -0
- package/dist/lib/transitions/common.d.ts +130 -0
- package/dist/lib/transitions/common.js +57 -0
- package/dist/lib/transitions/common.js.map +7 -0
- package/dist/lib/transitions/define-transition.d.ts +64 -0
- package/dist/lib/transitions/define-transition.js +31 -0
- package/dist/lib/transitions/define-transition.js.map +7 -0
- package/dist/lib/transitions/embers-physics.d.ts +114 -0
- package/dist/lib/transitions/embers-physics.js +161 -0
- package/dist/lib/transitions/embers-physics.js.map +7 -0
- package/dist/lib/transitions/embers.d.ts +67 -0
- package/dist/lib/transitions/embers.js +196 -0
- package/dist/lib/transitions/embers.js.map +7 -0
- package/dist/lib/transitions/fade.d.ts +41 -0
- package/dist/lib/transitions/fade.js +31 -0
- package/dist/lib/transitions/fade.js.map +7 -0
- package/dist/lib/transitions/hologram.d.ts +47 -0
- package/dist/lib/transitions/hologram.js +94 -0
- package/dist/lib/transitions/hologram.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js +5 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js +27 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js.map +7 -0
- package/dist/lib/transitions/wasm/embers-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/embers-bytes.js +5 -0
- package/dist/lib/transitions/wasm/embers-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/hologram-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js +5 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/kernel.d.ts +7 -0
- package/dist/lib/transitions/wasm/kernel.js +26 -0
- package/dist/lib/transitions/wasm/kernel.js.map +7 -0
- package/dist/lib/types.d.ts +570 -0
- package/dist/lib/update.d.ts +8 -0
- package/dist/lib/update.js +20 -0
- package/dist/lib/update.js.map +7 -0
- package/dist/lib/util/get-2d-context.d.ts +2 -0
- package/dist/lib/util/get-2d-context.js +11 -0
- package/dist/lib/util/get-2d-context.js.map +7 -0
- package/dist/lib/util/get-mouse-coordinates.d.ts +2 -0
- package/dist/lib/util/get-mouse-coordinates.js +32 -0
- package/dist/lib/util/get-mouse-coordinates.js.map +7 -0
- package/dist/lib/util/is-hit.d.ts +11 -0
- package/dist/lib/util/is-hit.js +52 -0
- package/dist/lib/util/is-hit.js.map +7 -0
- package/dist/lib/util/is-transparent.d.ts +1 -0
- package/dist/lib/util/is-transparent.js +8 -0
- package/dist/lib/util/is-transparent.js.map +7 -0
- package/dist/lib/util/pixel-grid-adjustments.d.ts +8 -0
- package/dist/lib/util/pixel-grid-adjustments.js +28 -0
- package/dist/lib/util/pixel-grid-adjustments.js.map +7 -0
- package/dist/lib/util/push-clipping-path.d.ts +6 -0
- package/dist/lib/util/push-clipping-path.js +28 -0
- package/dist/lib/util/push-clipping-path.js.map +7 -0
- package/dist/lib/util/wire-common-events.d.ts +2 -0
- package/dist/lib/util/wire-common-events.js +15 -0
- package/dist/lib/util/wire-common-events.js.map +7 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +7 -0
- package/dist/types.mjs +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { resolveTexturePaint } from "../textures/texture-protocol.js";
|
|
2
|
+
import { definePrimitive } from "../define-primitive.js";
|
|
3
|
+
import { useRectPath } from "../hooks/use-rect-path.js";
|
|
4
|
+
import { useReaction } from "../hooks/use-reaction.js";
|
|
5
|
+
import { useSignal } from "../hooks/use-signal.js";
|
|
6
|
+
import { resolveLength } from "../style/resolve-length.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveOptionalLength,
|
|
9
|
+
stripLayoutParticipation
|
|
10
|
+
} from "../style/resolve-built-in.js";
|
|
11
|
+
import { registerOpaqueStyleProperties } from "../style/resolve-dispatch.js";
|
|
12
|
+
import { adjustRectangleToPixelGrid } from "../util/pixel-grid-adjustments.js";
|
|
13
|
+
import { wireCommonEvents } from "../util/wire-common-events.js";
|
|
14
|
+
function renderImage(props, style, ctx) {
|
|
15
|
+
let {
|
|
16
|
+
src,
|
|
17
|
+
x = 0,
|
|
18
|
+
y = 0,
|
|
19
|
+
width,
|
|
20
|
+
height,
|
|
21
|
+
stroke,
|
|
22
|
+
strokeWidth,
|
|
23
|
+
opacity,
|
|
24
|
+
cursor,
|
|
25
|
+
alignToPixelGrid
|
|
26
|
+
} = style;
|
|
27
|
+
if (opacity !== void 0) {
|
|
28
|
+
ctx.globalAlpha = ctx.globalAlpha * opacity;
|
|
29
|
+
}
|
|
30
|
+
const loadedImage = useSignal(null);
|
|
31
|
+
const loadedImageValue = loadedImage.get();
|
|
32
|
+
const image = loadedImageValue && loadedImageValue.src === src ? loadedImageValue.element : null;
|
|
33
|
+
useReaction(() => {
|
|
34
|
+
let active = true;
|
|
35
|
+
const BrowserImage = globalThis.Image;
|
|
36
|
+
const element = new BrowserImage();
|
|
37
|
+
const settle = () => {
|
|
38
|
+
active = false;
|
|
39
|
+
element.onload = null;
|
|
40
|
+
element.onerror = null;
|
|
41
|
+
};
|
|
42
|
+
element.onload = () => {
|
|
43
|
+
if (!active) return;
|
|
44
|
+
settle();
|
|
45
|
+
loadedImage.set({ src, element });
|
|
46
|
+
};
|
|
47
|
+
element.onerror = () => {
|
|
48
|
+
if (!active) return;
|
|
49
|
+
settle();
|
|
50
|
+
loadedImage.set(null);
|
|
51
|
+
};
|
|
52
|
+
element.src = src;
|
|
53
|
+
return () => {
|
|
54
|
+
active = false;
|
|
55
|
+
element.onload = null;
|
|
56
|
+
element.onerror = null;
|
|
57
|
+
element.removeAttribute("src");
|
|
58
|
+
};
|
|
59
|
+
}, [src]);
|
|
60
|
+
width = width ?? image?.naturalWidth ?? image?.width ?? 0;
|
|
61
|
+
height = height ?? image?.naturalHeight ?? image?.height ?? 0;
|
|
62
|
+
if (alignToPixelGrid) {
|
|
63
|
+
({ x, y, width, height } = adjustRectangleToPixelGrid(
|
|
64
|
+
strokeWidth ?? 0,
|
|
65
|
+
x,
|
|
66
|
+
y,
|
|
67
|
+
width,
|
|
68
|
+
height,
|
|
69
|
+
alignToPixelGrid
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
const imagePath = useRectPath(x, y, width, height);
|
|
73
|
+
if (image) {
|
|
74
|
+
ctx.drawImage(image, x, y, width, height);
|
|
75
|
+
}
|
|
76
|
+
if (stroke && strokeWidth) {
|
|
77
|
+
ctx.strokeStyle = resolveTexturePaint(stroke, ctx, { x, y, width, height });
|
|
78
|
+
ctx.lineWidth = strokeWidth;
|
|
79
|
+
ctx.stroke(imagePath);
|
|
80
|
+
}
|
|
81
|
+
wireCommonEvents(
|
|
82
|
+
props,
|
|
83
|
+
imagePath,
|
|
84
|
+
true,
|
|
85
|
+
strokeWidth ?? 0,
|
|
86
|
+
cursor,
|
|
87
|
+
{ x, y, width, height }
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
const Image = definePrimitive(renderImage, {
|
|
91
|
+
resolveStyle: resolveImageStyle,
|
|
92
|
+
measure: measureImage
|
|
93
|
+
});
|
|
94
|
+
registerOpaqueStyleProperties(Image, ["src", "stroke", "cursor"]);
|
|
95
|
+
function resolveImageStyle(style, context) {
|
|
96
|
+
return {
|
|
97
|
+
...stripLayoutParticipation(style),
|
|
98
|
+
x: 0,
|
|
99
|
+
y: 0,
|
|
100
|
+
width: resolveOptionalLength(
|
|
101
|
+
style.width,
|
|
102
|
+
context.percentageBasis.width,
|
|
103
|
+
"width",
|
|
104
|
+
context
|
|
105
|
+
),
|
|
106
|
+
height: resolveOptionalLength(
|
|
107
|
+
style.height,
|
|
108
|
+
context.percentageBasis.height,
|
|
109
|
+
"height",
|
|
110
|
+
context
|
|
111
|
+
)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function measureImage({
|
|
115
|
+
style,
|
|
116
|
+
constraints
|
|
117
|
+
}) {
|
|
118
|
+
if (style.width === void 0 || style.width === "auto" || style.height === void 0 || style.height === "auto") {
|
|
119
|
+
return {
|
|
120
|
+
status: "unsupported",
|
|
121
|
+
reason: "Image natural dimensions are unavailable during pure measurement"
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const context = {
|
|
125
|
+
component: "Image",
|
|
126
|
+
algorithm: "measurement",
|
|
127
|
+
constraints
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
status: "measured",
|
|
131
|
+
size: {
|
|
132
|
+
width: resolveLength(
|
|
133
|
+
style.width,
|
|
134
|
+
constraints.maxWidth,
|
|
135
|
+
"width",
|
|
136
|
+
context
|
|
137
|
+
),
|
|
138
|
+
height: resolveLength(
|
|
139
|
+
style.height,
|
|
140
|
+
constraints.maxHeight,
|
|
141
|
+
"height",
|
|
142
|
+
context
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
Image
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=img.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/components/img.ts"],
|
|
4
|
+
"sourcesContent": ["import { resolveTexturePaint } from '../textures/texture-protocol.js';\nimport { definePrimitive } from '../define-primitive.js';\nimport type {\n PibblEventFocusOptions,\n PibblEventHandlers,\n PibblEventParticipationOptions,\n} from '../events/types.js';\nimport { useRectPath } from '../hooks/use-rect-path.js';\nimport { useReaction } from '../hooks/use-reaction.js';\nimport { useSignal } from '../hooks/use-signal.js';\nimport type {\n PibblPhysics2DPropExtension,\n MeasureInput,\n MeasureResult,\n RenderingContext2D,\n StyleResolutionContext,\n} from '../types.js';\nimport { resolveLength } from '../style/resolve-length.js';\nimport {\n resolveOptionalLength,\n stripLayoutParticipation,\n} from '../style/resolve-built-in.js';\nimport { registerOpaqueStyleProperties } from '../style/resolve-dispatch.js';\nimport type { ImgStyle, ResolvedImgStyle } from '../style/types.js';\nimport { adjustRectangleToPixelGrid } from '../util/pixel-grid-adjustments.js';\nimport { wireCommonEvents } from '../util/wire-common-events.js';\n\n/**\n * Authored inputs for Image, including the declared data and presentation options.\n *\n * @see {@link PibblEventHandlers}\n * @see {@link PibblEventParticipationOptions}\n * @see {@link PibblPhysics2DPropExtension}\n * @see {@link Image}\n */\nexport interface ImageProps extends PibblEventHandlers, PibblEventFocusOptions, PibblEventParticipationOptions, PibblPhysics2DPropExtension {}\n\ninterface LoadedImage {\n src: string;\n element: HTMLImageElement;\n}\n\nfunction renderImage(\n props: ImageProps,\n style: Readonly<ResolvedImgStyle>,\n ctx: RenderingContext2D,\n) {\n let {\n src,\n x = 0,\n y = 0,\n width,\n height,\n stroke,\n strokeWidth,\n opacity,\n cursor,\n alignToPixelGrid,\n } = style;\n\n if (opacity !== undefined) {\n ctx.globalAlpha = ctx.globalAlpha * opacity;\n }\n\n const loadedImage = useSignal<LoadedImage | null>(null);\n const loadedImageValue = loadedImage.get();\n const image =\n loadedImageValue && loadedImageValue.src === src ?\n loadedImageValue.element : null;\n\n useReaction(() => {\n let active = true;\n const BrowserImage = globalThis.Image;\n const element = new BrowserImage();\n const settle = () => {\n active = false;\n element.onload = null;\n element.onerror = null;\n };\n\n element.onload = () => {\n if (!active) return;\n settle();\n loadedImage.set({ src, element });\n };\n element.onerror = () => {\n if (!active) return;\n settle();\n loadedImage.set(null);\n };\n element.src = src;\n\n return () => {\n active = false;\n element.onload = null;\n element.onerror = null;\n element.removeAttribute('src');\n };\n }, [src]);\n\n width = width ?? image?.naturalWidth ?? image?.width ?? 0;\n height = height ?? image?.naturalHeight ?? image?.height ?? 0;\n\n if (alignToPixelGrid) {\n ({ x, y, width, height } = adjustRectangleToPixelGrid(\n strokeWidth ?? 0,\n x,\n y,\n width,\n height,\n alignToPixelGrid,\n ));\n }\n\n const imagePath = useRectPath(x, y, width, height);\n\n if (image) {\n ctx.drawImage(image, x, y, width, height);\n }\n\n if (stroke && strokeWidth) {\n ctx.strokeStyle = resolveTexturePaint(stroke, ctx, { x, y, width, height });\n ctx.lineWidth = strokeWidth;\n ctx.stroke(imagePath);\n }\n\n wireCommonEvents(\n props,\n imagePath,\n true,\n strokeWidth ?? 0,\n cursor,\n { x, y, width, height },\n );\n}\n\n/**\n * Describes a Canvas image primitive for JSX or createElement authoring.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link ImageProps}\n * @see {@link ImgStyle}\n */\nexport const Image = definePrimitive<\n ImageProps,\n ImgStyle,\n ImgStyle,\n ResolvedImgStyle\n>(renderImage, {\n resolveStyle: resolveImageStyle,\n measure: measureImage,\n});\nregisterOpaqueStyleProperties(Image, ['src', 'stroke', 'cursor']);\n\nfunction resolveImageStyle(\n style: Readonly<ImgStyle>,\n context: Readonly<StyleResolutionContext>,\n): ResolvedImgStyle {\n return {\n ...stripLayoutParticipation(style),\n x: 0,\n y: 0,\n width: resolveOptionalLength(\n style.width,\n context.percentageBasis.width,\n 'width',\n context,\n ),\n height: resolveOptionalLength(\n style.height,\n context.percentageBasis.height,\n 'height',\n context,\n ),\n } as ResolvedImgStyle;\n}\n\nfunction measureImage({\n style,\n constraints,\n}: MeasureInput<ImageProps, ImgStyle>): MeasureResult {\n if (\n style.width === undefined || style.width === 'auto' ||\n style.height === undefined || style.height === 'auto'\n ) {\n return {\n status: 'unsupported',\n reason: 'Image natural dimensions are unavailable during pure measurement',\n };\n }\n const context = {\n component: 'Image',\n algorithm: 'measurement' as const,\n constraints,\n };\n return {\n status: 'measured',\n size: {\n width: resolveLength(\n style.width,\n constraints.maxWidth,\n 'width',\n context,\n )!,\n height: resolveLength(\n style.height,\n constraints.maxHeight,\n 'height',\n context,\n )!,\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type PibblElementEnhancerDescriptor } from '../element-enhancers.js';
|
|
2
|
+
import type { PibblElement, PibblNodeInput } from '../element/types.js';
|
|
3
|
+
interface LayerElementSnapshot {
|
|
4
|
+
readonly kind: 'element';
|
|
5
|
+
readonly type: PibblElement<any>['type'];
|
|
6
|
+
readonly key: string | undefined;
|
|
7
|
+
readonly enhancers: readonly PibblElementEnhancerDescriptor[];
|
|
8
|
+
readonly nonChildProps: readonly LayerPropertySnapshot[];
|
|
9
|
+
readonly style: readonly LayerPropertySnapshot[];
|
|
10
|
+
readonly children: LayerNodeSnapshot;
|
|
11
|
+
}
|
|
12
|
+
interface LayerArraySnapshot {
|
|
13
|
+
readonly kind: 'array';
|
|
14
|
+
readonly children: readonly LayerNodeSnapshot[];
|
|
15
|
+
}
|
|
16
|
+
interface LayerOpaqueSnapshot {
|
|
17
|
+
readonly kind: 'opaque';
|
|
18
|
+
readonly value: unknown;
|
|
19
|
+
}
|
|
20
|
+
interface LayerPropertySnapshot {
|
|
21
|
+
readonly key: PropertyKey;
|
|
22
|
+
readonly value: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Captured element structure used to compare managed-layer inputs.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link haveSameLayerNodeTree}
|
|
28
|
+
* @see {@link snapshotLayerNodeTree}
|
|
29
|
+
*/
|
|
30
|
+
export type LayerNodeSnapshot = LayerElementSnapshot | LayerArraySnapshot | LayerOpaqueSnapshot;
|
|
31
|
+
/**
|
|
32
|
+
* Materializes retained Layer children once before a private renderer owns them.
|
|
33
|
+
*
|
|
34
|
+
* @param node - Recursive child structure to materialize. See {@link PibblNodeInput}.
|
|
35
|
+
* @param receiver - Receiver name used in invalid-child diagnostics.
|
|
36
|
+
* @returns The ordered element descriptors retained by the layer. See {@link PibblElement}.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link PibblNodeInput}
|
|
39
|
+
* @see {@link PibblElement}
|
|
40
|
+
*/
|
|
41
|
+
export declare function materializeRetainedLayerChildren(node: PibblNodeInput, receiver: string): readonly PibblElement<any>[];
|
|
42
|
+
/**
|
|
43
|
+
* Captures Layer's successfully rendered tree without retaining mutable
|
|
44
|
+
* author-owned containers. Direct Layer children are already materialized;
|
|
45
|
+
* nested opaque iterables remain identity values and are never evaluated.
|
|
46
|
+
*
|
|
47
|
+
* @param node - Node tree to record.
|
|
48
|
+
* @returns A snapshot used for subsequent structural equality checks. See
|
|
49
|
+
* {@link LayerNodeSnapshot} .
|
|
50
|
+
*
|
|
51
|
+
* @see {@link LayerNodeSnapshot}
|
|
52
|
+
*/
|
|
53
|
+
export declare function snapshotLayerNodeTree(node: unknown): LayerNodeSnapshot;
|
|
54
|
+
/**
|
|
55
|
+
* Compares an immutable successful-render snapshot with an already-materialized
|
|
56
|
+
* candidate tree. Opaque nested iterables compare only by identity.
|
|
57
|
+
*
|
|
58
|
+
* @param snapshot - Previously recorded node-tree snapshot, if any. See {@link LayerNodeSnapshot}.
|
|
59
|
+
* @param node - Current node tree to compare.
|
|
60
|
+
* @returns Whether the current tree matches the retained snapshot.
|
|
61
|
+
*
|
|
62
|
+
* @see {@link LayerNodeSnapshot}
|
|
63
|
+
*/
|
|
64
|
+
export declare function haveSameLayerNodeTree(snapshot: LayerNodeSnapshot | undefined, node: unknown): boolean;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getElementEnhancerDescriptors
|
|
3
|
+
} from "../element-enhancers.js";
|
|
4
|
+
import { materializeContainerChildren } from "../element/children.js";
|
|
5
|
+
import { isPibblElement } from "../element/create-element.js";
|
|
6
|
+
function materializeRetainedLayerChildren(node, receiver) {
|
|
7
|
+
return materializeContainerChildren(node, receiver);
|
|
8
|
+
}
|
|
9
|
+
function snapshotLayerNodeTree(node) {
|
|
10
|
+
if (isPibblElement(node)) {
|
|
11
|
+
const props = splitProps(node.props);
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
kind: "element",
|
|
14
|
+
type: node.type,
|
|
15
|
+
key: node.key,
|
|
16
|
+
enhancers: Object.freeze([...getElementEnhancerDescriptors(node)]),
|
|
17
|
+
nonChildProps: snapshotProperties(props.nonChild),
|
|
18
|
+
style: snapshotProperties(props.style),
|
|
19
|
+
children: snapshotLayerNodeTree(props.children)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (Array.isArray(node)) {
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
kind: "array",
|
|
25
|
+
children: Object.freeze(node.map(snapshotLayerNodeTree))
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return Object.freeze({ kind: "opaque", value: node });
|
|
29
|
+
}
|
|
30
|
+
function haveSameLayerNodeTree(snapshot, node) {
|
|
31
|
+
if (!snapshot) return false;
|
|
32
|
+
switch (snapshot.kind) {
|
|
33
|
+
case "element":
|
|
34
|
+
return isPibblElement(node) && haveSameLayerElement(snapshot, node);
|
|
35
|
+
case "array":
|
|
36
|
+
return Array.isArray(node) && snapshot.children.length === node.length && snapshot.children.every(
|
|
37
|
+
(child, index) => haveSameLayerNodeTree(child, node[index])
|
|
38
|
+
);
|
|
39
|
+
case "opaque":
|
|
40
|
+
return snapshot.value === node;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function haveSameLayerElement(snapshot, element) {
|
|
44
|
+
if (snapshot.type !== element.type || snapshot.key !== element.key) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const enhancers = getElementEnhancerDescriptors(element);
|
|
48
|
+
if (snapshot.enhancers.length !== enhancers.length || !snapshot.enhancers.every(
|
|
49
|
+
(descriptor, index) => descriptor === enhancers[index]
|
|
50
|
+
)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const props = splitProps(element.props);
|
|
54
|
+
return haveSameProperties(snapshot.nonChildProps, props.nonChild) && haveSameProperties(snapshot.style, props.style) && haveSameLayerNodeTree(snapshot.children, props.children);
|
|
55
|
+
}
|
|
56
|
+
function snapshotProperties(value) {
|
|
57
|
+
return Object.freeze(enumerableOwnKeys(value).map((key) => Object.freeze({
|
|
58
|
+
key,
|
|
59
|
+
value: value[key]
|
|
60
|
+
})));
|
|
61
|
+
}
|
|
62
|
+
function haveSameProperties(snapshot, value) {
|
|
63
|
+
const keys = enumerableOwnKeys(value);
|
|
64
|
+
return snapshot.length === keys.length && snapshot.every(
|
|
65
|
+
(property) => Object.prototype.propertyIsEnumerable.call(value, property.key) && value[property.key] === property.value
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function enumerableOwnKeys(value) {
|
|
69
|
+
return Reflect.ownKeys(value).filter(
|
|
70
|
+
(key) => Object.prototype.propertyIsEnumerable.call(value, key)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function splitProps(props) {
|
|
74
|
+
const {
|
|
75
|
+
children,
|
|
76
|
+
style,
|
|
77
|
+
...nonChild
|
|
78
|
+
} = props;
|
|
79
|
+
return {
|
|
80
|
+
children,
|
|
81
|
+
nonChild,
|
|
82
|
+
style: style ?? EMPTY_PROPS
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const EMPTY_PROPS = Object.freeze({});
|
|
86
|
+
export {
|
|
87
|
+
haveSameLayerNodeTree,
|
|
88
|
+
materializeRetainedLayerChildren,
|
|
89
|
+
snapshotLayerNodeTree
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=layer-node-equality.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/components/layer-node-equality.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n getElementEnhancerDescriptors,\n type PibblElementEnhancerDescriptor,\n} from '../element-enhancers.js';\nimport { materializeContainerChildren } from '../element/children.js';\nimport { isPibblElement } from '../element/create-element.js';\nimport type { PibblElement, PibblNodeInput } from '../element/types.js';\n\ninterface LayerElementSnapshot {\n readonly kind: 'element';\n readonly type: PibblElement<any>['type'];\n readonly key: string | undefined;\n readonly enhancers: readonly PibblElementEnhancerDescriptor[];\n readonly nonChildProps: readonly LayerPropertySnapshot[];\n readonly style: readonly LayerPropertySnapshot[];\n readonly children: LayerNodeSnapshot;\n}\n\ninterface LayerArraySnapshot {\n readonly kind: 'array';\n readonly children: readonly LayerNodeSnapshot[];\n}\n\ninterface LayerOpaqueSnapshot {\n readonly kind: 'opaque';\n readonly value: unknown;\n}\n\ninterface LayerPropertySnapshot {\n readonly key: PropertyKey;\n readonly value: unknown;\n}\n\n/**\n * Captured element structure used to compare managed-layer inputs.\n *\n * @see {@link haveSameLayerNodeTree}\n * @see {@link snapshotLayerNodeTree}\n */\nexport type LayerNodeSnapshot =\n | LayerElementSnapshot\n | LayerArraySnapshot\n | LayerOpaqueSnapshot;\n\n/**\n * Materializes retained Layer children once before a private renderer owns them.\n *\n * @param node - Recursive child structure to materialize. See {@link PibblNodeInput}.\n * @param receiver - Receiver name used in invalid-child diagnostics.\n * @returns The ordered element descriptors retained by the layer. See {@link PibblElement}.\n *\n * @see {@link PibblNodeInput}\n * @see {@link PibblElement}\n */\nexport function materializeRetainedLayerChildren(\n node: PibblNodeInput,\n receiver: string,\n): readonly PibblElement<any>[] {\n return materializeContainerChildren(node, receiver);\n}\n\n/**\n * Captures Layer's successfully rendered tree without retaining mutable\n * author-owned containers. Direct Layer children are already materialized;\n * nested opaque iterables remain identity values and are never evaluated.\n *\n * @param node - Node tree to record.\n * @returns A snapshot used for subsequent structural equality checks. See\n * {@link LayerNodeSnapshot} .\n *\n * @see {@link LayerNodeSnapshot}\n */\nexport function snapshotLayerNodeTree(node: unknown): LayerNodeSnapshot {\n if (isPibblElement(node)) {\n const props = splitProps(node.props);\n return Object.freeze({\n kind: 'element',\n type: node.type,\n key: node.key,\n enhancers: Object.freeze([...getElementEnhancerDescriptors(node)]),\n nonChildProps: snapshotProperties(props.nonChild),\n style: snapshotProperties(props.style),\n children: snapshotLayerNodeTree(props.children),\n });\n }\n\n if (Array.isArray(node)) {\n return Object.freeze({\n kind: 'array',\n children: Object.freeze(node.map(snapshotLayerNodeTree)),\n });\n }\n\n return Object.freeze({ kind: 'opaque', value: node });\n}\n\n/**\n * Compares an immutable successful-render snapshot with an already-materialized\n * candidate tree. Opaque nested iterables compare only by identity.\n *\n * @param snapshot - Previously recorded node-tree snapshot, if any. See {@link LayerNodeSnapshot}.\n * @param node - Current node tree to compare.\n * @returns Whether the current tree matches the retained snapshot.\n *\n * @see {@link LayerNodeSnapshot}\n */\nexport function haveSameLayerNodeTree(\n snapshot: LayerNodeSnapshot | undefined,\n node: unknown,\n): boolean {\n if (!snapshot) return false;\n\n switch (snapshot.kind) {\n case 'element':\n return isPibblElement(node) && haveSameLayerElement(snapshot, node);\n case 'array':\n return Array.isArray(node) &&\n snapshot.children.length === node.length &&\n snapshot.children.every((child, index) =>\n haveSameLayerNodeTree(child, node[index])\n );\n case 'opaque':\n return snapshot.value === node;\n }\n}\n\nfunction haveSameLayerElement(\n snapshot: LayerElementSnapshot,\n element: PibblElement<any>,\n): boolean {\n if (snapshot.type !== element.type || snapshot.key !== element.key) {\n return false;\n }\n\n const enhancers = getElementEnhancerDescriptors(element);\n if (\n snapshot.enhancers.length !== enhancers.length ||\n !snapshot.enhancers.every((descriptor, index) =>\n descriptor === enhancers[index]\n )\n ) {\n return false;\n }\n\n const props = splitProps(element.props);\n return haveSameProperties(snapshot.nonChildProps, props.nonChild) &&\n haveSameProperties(snapshot.style, props.style) &&\n haveSameLayerNodeTree(snapshot.children, props.children);\n}\n\nfunction snapshotProperties(\n value: Readonly<Record<PropertyKey, unknown>>,\n): readonly LayerPropertySnapshot[] {\n return Object.freeze(enumerableOwnKeys(value).map(key => Object.freeze({\n key,\n value: value[key],\n })));\n}\n\nfunction haveSameProperties(\n snapshot: readonly LayerPropertySnapshot[],\n value: Readonly<Record<PropertyKey, unknown>>,\n): boolean {\n const keys = enumerableOwnKeys(value);\n return snapshot.length === keys.length && snapshot.every(property =>\n Object.prototype.propertyIsEnumerable.call(value, property.key) &&\n value[property.key] === property.value\n );\n}\n\nfunction enumerableOwnKeys(\n value: Readonly<Record<PropertyKey, unknown>>,\n): readonly PropertyKey[] {\n return Reflect.ownKeys(value).filter(key =>\n Object.prototype.propertyIsEnumerable.call(value, key)\n );\n}\n\nfunction splitProps(props: Readonly<Record<PropertyKey, unknown>>): {\n children: unknown;\n nonChild: Readonly<Record<PropertyKey, unknown>>;\n style: Readonly<Record<PropertyKey, unknown>>;\n} {\n const {\n children,\n style,\n ...nonChild\n } = props as Readonly<{\n children?: unknown;\n style?: Readonly<Record<PropertyKey, unknown>>;\n [key: PropertyKey]: unknown;\n }>;\n return {\n children,\n nonChild,\n style: style ?? EMPTY_PROPS,\n };\n}\n\nconst EMPTY_PROPS: Readonly<Record<PropertyKey, unknown>> = Object.freeze({});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PibblNodeInput, SystemStyle } from '../types.js';
|
|
2
|
+
import type { BoxStyle, LayoutItemStyle } from '../style/types.js';
|
|
3
|
+
import { type PibblStructuralEventProps } from './structural-events.js';
|
|
4
|
+
/**
|
|
5
|
+
* Authored inputs for Layer, including the declared data and presentation options.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link PibblNodeInput}
|
|
8
|
+
* @see {@link Layer}
|
|
9
|
+
*/
|
|
10
|
+
export interface LayerProps extends PibblStructuralEventProps {
|
|
11
|
+
/** Descendant content or the callback that supplies it. See {@link PibblNodeInput}. */
|
|
12
|
+
children: PibblNodeInput;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Supported geometry and presentation properties for Layer.
|
|
16
|
+
*
|
|
17
|
+
* @see {@link SystemStyle}
|
|
18
|
+
* @see {@link BoxStyle}
|
|
19
|
+
* @see {@link LayoutItemStyle}
|
|
20
|
+
* @see {@link Layer}
|
|
21
|
+
*/
|
|
22
|
+
export interface LayerStyle extends SystemStyle, BoxStyle, LayoutItemStyle {
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Describes a retained offscreen composition layer.
|
|
26
|
+
*
|
|
27
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
28
|
+
* props and style types.
|
|
29
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link LayerProps}
|
|
32
|
+
* @see {@link LayerStyle}
|
|
33
|
+
*/
|
|
34
|
+
export declare const Layer: import("@pibbl/core").PibblPrimitiveComponent<LayerProps, import("@pibbl/core").PrimitiveInput<LayerProps, LayerStyle>>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { definePrimitive } from "../define-primitive.js";
|
|
2
|
+
import { materializeContainerChildren } from "../element/children.js";
|
|
3
|
+
import { createElement } from "../element/create-element.js";
|
|
4
|
+
import { Fragment } from "../element/fragment.js";
|
|
5
|
+
import { executeRender } from "../execute-render.js";
|
|
6
|
+
import {
|
|
7
|
+
getPibblInstance,
|
|
8
|
+
getCurrentPibblInstance,
|
|
9
|
+
GLOBAL_STATE
|
|
10
|
+
} from "../global-state.js";
|
|
11
|
+
import { mountPibbl } from "../mount-pibbl.js";
|
|
12
|
+
import { PibblPaintEntryKind } from "../events/paint-entry.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveRequiredLength,
|
|
15
|
+
stripLayoutParticipation
|
|
16
|
+
} from "../style/resolve-built-in.js";
|
|
17
|
+
import {
|
|
18
|
+
getSurfaceSnapshot
|
|
19
|
+
} from "../surface/transform.js";
|
|
20
|
+
import { getCurrentWorldTransform } from "../render-target.js";
|
|
21
|
+
import { createLayerSurface } from "../surface/resolve-surface.js";
|
|
22
|
+
import {
|
|
23
|
+
completeInstanceRenderRevision,
|
|
24
|
+
hasPendingInstanceRender
|
|
25
|
+
} from "../scheduler/realm-scheduler.js";
|
|
26
|
+
import {
|
|
27
|
+
haveSameLayerNodeTree,
|
|
28
|
+
snapshotLayerNodeTree
|
|
29
|
+
} from "./layer-node-equality.js";
|
|
30
|
+
import {
|
|
31
|
+
wireStructuralEvents
|
|
32
|
+
} from "./structural-events.js";
|
|
33
|
+
function renderLayer(props, style, ctx) {
|
|
34
|
+
wireStructuralEvents(props);
|
|
35
|
+
const materializedChildren = materializeContainerChildren(
|
|
36
|
+
props.children,
|
|
37
|
+
"Layer"
|
|
38
|
+
);
|
|
39
|
+
const nextRoot = createPrivateLayerRoot(materializedChildren);
|
|
40
|
+
const canvas = GLOBAL_STATE.canvas;
|
|
41
|
+
const { width = canvas.width, height = canvas.height } = style;
|
|
42
|
+
const componentRefs = GLOBAL_STATE.componentRefs;
|
|
43
|
+
const parentInstance = getCurrentPibblInstance();
|
|
44
|
+
const parentSurface = getSurfaceSnapshot(parentInstance);
|
|
45
|
+
const layerSurface = createLayerSurface(
|
|
46
|
+
width,
|
|
47
|
+
height,
|
|
48
|
+
parentSurface.backingPixelsPerLogicalUnitX,
|
|
49
|
+
parentSurface.backingPixelsPerLogicalUnitY
|
|
50
|
+
);
|
|
51
|
+
if (GLOBAL_STATE.componentIsMounting) {
|
|
52
|
+
const offscreenCanvas2 = new OffscreenCanvas(
|
|
53
|
+
layerSurface.backingWidth,
|
|
54
|
+
layerSurface.backingHeight
|
|
55
|
+
);
|
|
56
|
+
const controller = mountPibbl(offscreenCanvas2, nextRoot, {
|
|
57
|
+
parent: canvas,
|
|
58
|
+
surface: layerSurface
|
|
59
|
+
});
|
|
60
|
+
const childInstance = getPibblInstance(offscreenCanvas2);
|
|
61
|
+
childInstance.eventParent = componentRefs;
|
|
62
|
+
const interactionLayer2 = {
|
|
63
|
+
paintKind: PibblPaintEntryKind.NestedInstance,
|
|
64
|
+
instance: childInstance,
|
|
65
|
+
transform: new DOMMatrix(),
|
|
66
|
+
clippingStack: [],
|
|
67
|
+
bounds: createBounds(width, height),
|
|
68
|
+
resolveLocal: void 0
|
|
69
|
+
};
|
|
70
|
+
componentRefs.refs[0] = {
|
|
71
|
+
canvas: offscreenCanvas2,
|
|
72
|
+
interactionLayer: interactionLayer2,
|
|
73
|
+
logicalWidth: width,
|
|
74
|
+
logicalHeight: height,
|
|
75
|
+
focusRenderRevision: void 0,
|
|
76
|
+
retainedTree: void 0
|
|
77
|
+
};
|
|
78
|
+
componentRefs.teardowns.add(() => {
|
|
79
|
+
childInstance.eventParent = void 0;
|
|
80
|
+
parentInstance.paintEntries.delete(interactionLayer2);
|
|
81
|
+
controller.dispose();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const slot = componentRefs.refs[0];
|
|
85
|
+
const offscreenCanvas = slot.canvas;
|
|
86
|
+
const layerPibbl = getPibblInstance(offscreenCanvas);
|
|
87
|
+
const dimensionsChanged = slot.logicalWidth !== width || slot.logicalHeight !== height;
|
|
88
|
+
const surfaceChanged = offscreenCanvas.width !== layerSurface.backingWidth || offscreenCanvas.height !== layerSurface.backingHeight;
|
|
89
|
+
const { interactionLayer } = slot;
|
|
90
|
+
parentInstance.paintEntries.delete(interactionLayer);
|
|
91
|
+
interactionLayer.transform = getCurrentWorldTransform();
|
|
92
|
+
interactionLayer.clippingStack = Array.from(GLOBAL_STATE.clippingStack);
|
|
93
|
+
if (dimensionsChanged) {
|
|
94
|
+
interactionLayer.bounds = createBounds(width, height);
|
|
95
|
+
}
|
|
96
|
+
parentInstance.paintEntries.add(interactionLayer);
|
|
97
|
+
const focusPolicy = parentInstance.eventRoot.focusPolicy;
|
|
98
|
+
const focusRenderRevision = focusPolicy?.layerFocusRenderRevision?.(layerPibbl);
|
|
99
|
+
const shouldRender = GLOBAL_STATE.componentIsMounting || dimensionsChanged || surfaceChanged || !haveSameLayerNodeTree(slot.retainedTree, nextRoot) || slot.focusRenderRevision !== focusRenderRevision || hasPendingInstanceRender(layerPibbl);
|
|
100
|
+
if (shouldRender) {
|
|
101
|
+
if (layerPibbl.surface.kind !== "layer") {
|
|
102
|
+
throw new Error("Pibbl layer mounted without a derived surface.");
|
|
103
|
+
}
|
|
104
|
+
layerPibbl.surface.snapshot = layerSurface;
|
|
105
|
+
layerPibbl.surface.managed = true;
|
|
106
|
+
offscreenCanvas.width = layerSurface.backingWidth;
|
|
107
|
+
offscreenCanvas.height = layerSurface.backingHeight;
|
|
108
|
+
slot.logicalWidth = width;
|
|
109
|
+
slot.logicalHeight = height;
|
|
110
|
+
const renderedRevision = layerPibbl.requestedRenderRevision;
|
|
111
|
+
executeRender(
|
|
112
|
+
offscreenCanvas,
|
|
113
|
+
getCurrentPibblInstance().renderTimestamp,
|
|
114
|
+
nextRoot,
|
|
115
|
+
false
|
|
116
|
+
);
|
|
117
|
+
completeInstanceRenderRevision(layerPibbl, renderedRevision);
|
|
118
|
+
slot.retainedTree = snapshotLayerNodeTree(nextRoot);
|
|
119
|
+
} else {
|
|
120
|
+
parentInstance.eventRoot.focusPolicy?.replayRetainedSubtree(layerPibbl);
|
|
121
|
+
}
|
|
122
|
+
const renderedFocusPolicy = parentInstance.eventRoot.focusPolicy;
|
|
123
|
+
slot.focusRenderRevision = renderedFocusPolicy?.layerFocusRenderRevision?.(layerPibbl);
|
|
124
|
+
parentInstance.eventRoot.html?.recordLayer(parentInstance, layerPibbl, interactionLayer, ctx.globalAlpha, ctx.globalCompositeOperation);
|
|
125
|
+
ctx.drawImage(
|
|
126
|
+
offscreenCanvas,
|
|
127
|
+
0,
|
|
128
|
+
0,
|
|
129
|
+
offscreenCanvas.width,
|
|
130
|
+
offscreenCanvas.height,
|
|
131
|
+
0,
|
|
132
|
+
0,
|
|
133
|
+
width,
|
|
134
|
+
height
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
const Layer = definePrimitive(renderLayer, {
|
|
138
|
+
childInput: "structural",
|
|
139
|
+
resolveStyle: resolveLayerStyle
|
|
140
|
+
});
|
|
141
|
+
function resolveLayerStyle(style, context) {
|
|
142
|
+
return {
|
|
143
|
+
...stripLayoutParticipation(style),
|
|
144
|
+
width: resolveRequiredLength(
|
|
145
|
+
style.width ?? context.allocation.width,
|
|
146
|
+
context.percentageBasis.width,
|
|
147
|
+
"width",
|
|
148
|
+
context
|
|
149
|
+
),
|
|
150
|
+
height: resolveRequiredLength(
|
|
151
|
+
style.height ?? context.allocation.height,
|
|
152
|
+
context.percentageBasis.height,
|
|
153
|
+
"height",
|
|
154
|
+
context
|
|
155
|
+
)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function createPrivateLayerRoot(children) {
|
|
159
|
+
return createElement(Fragment, {
|
|
160
|
+
key: "pibbl-layer-root",
|
|
161
|
+
children
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function createBounds(width, height) {
|
|
165
|
+
const bounds = new Path2D();
|
|
166
|
+
bounds.rect(0, 0, width, height);
|
|
167
|
+
return bounds;
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
Layer
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=layer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/components/layer.ts"],
|
|
4
|
+
"sourcesContent": ["import { definePrimitive } from '../define-primitive.js';\nimport { materializeContainerChildren } from '../element/children.js';\nimport { createElement } from '../element/create-element.js';\nimport { Fragment, type FragmentProps } from '../element/fragment.js';\nimport { executeRender } from '../execute-render.js';\nimport {\n getPibblInstance,\n getCurrentPibblInstance,\n GLOBAL_STATE,\n} from '../global-state.js';\nimport { mountPibbl } from '../mount-pibbl.js';\nimport {\n PibblNodeInput,\n PibblInteractionLayer,\n RenderingContext2D,\n SystemStyle,\n} from '../types.js';\nimport { PibblPaintEntryKind } from '../events/paint-entry.js';\nimport {\n resolveRequiredLength,\n stripLayoutParticipation,\n} from '../style/resolve-built-in.js';\nimport type {\n BoxStyle,\n LayoutItemStyle,\n ResolvedDrawingStyle,\n} from '../style/types.js';\nimport {\n getSurfaceSnapshot,\n} from '../surface/transform.js';\nimport { getCurrentWorldTransform } from '../render-target.js';\nimport { createLayerSurface } from '../surface/resolve-surface.js';\nimport {\n completeInstanceRenderRevision,\n hasPendingInstanceRender,\n} from '../scheduler/realm-scheduler.js';\nimport type { PibblElement } from '../element/types.js';\nimport {\n haveSameLayerNodeTree,\n snapshotLayerNodeTree,\n type LayerNodeSnapshot,\n} from './layer-node-equality.js';\nimport {\n type PibblStructuralEventProps,\n wireStructuralEvents,\n} from './structural-events.js';\n\n/**\n * Authored inputs for Layer, including the declared data and presentation options.\n *\n * @see {@link PibblNodeInput}\n * @see {@link Layer}\n */\nexport interface LayerProps extends PibblStructuralEventProps {\n /** Descendant content or the callback that supplies it. See {@link PibblNodeInput}. */\n children: PibblNodeInput;\n}\n\n/**\n * Supported geometry and presentation properties for Layer.\n *\n * @see {@link SystemStyle}\n * @see {@link BoxStyle}\n * @see {@link LayoutItemStyle}\n * @see {@link Layer}\n */\nexport interface LayerStyle extends SystemStyle, BoxStyle, LayoutItemStyle {}\n\ntype ResolvedLayerStyle = ResolvedDrawingStyle<LayerStyle> & {\n width: number;\n height: number;\n};\n\ninterface LayerSlot {\n canvas: OffscreenCanvas;\n interactionLayer: PibblInteractionLayer;\n logicalWidth: number;\n logicalHeight: number;\n focusRenderRevision: number | undefined;\n retainedTree: LayerNodeSnapshot | undefined;\n}\n\nfunction renderLayer(\n props: LayerProps,\n style: Readonly<ResolvedLayerStyle>,\n ctx: RenderingContext2D,\n) {\n wireStructuralEvents(props);\n const materializedChildren = materializeContainerChildren(\n props.children,\n 'Layer',\n );\n const nextRoot = createPrivateLayerRoot(materializedChildren);\n const canvas = GLOBAL_STATE.canvas!;\n const { width = canvas.width, height = canvas.height } = style;\n const componentRefs = GLOBAL_STATE.componentRefs!;\n const parentInstance = getCurrentPibblInstance();\n const parentSurface = getSurfaceSnapshot(parentInstance);\n const layerSurface = createLayerSurface(\n width,\n height,\n parentSurface.backingPixelsPerLogicalUnitX,\n parentSurface.backingPixelsPerLogicalUnitY,\n );\n if (GLOBAL_STATE.componentIsMounting) {\n const offscreenCanvas = new OffscreenCanvas(\n layerSurface.backingWidth,\n layerSurface.backingHeight,\n );\n const controller = mountPibbl(offscreenCanvas, nextRoot, {\n parent: canvas,\n surface: layerSurface,\n });\n const childInstance = getPibblInstance(offscreenCanvas);\n childInstance.eventParent = componentRefs;\n const interactionLayer: PibblInteractionLayer = {\n paintKind: PibblPaintEntryKind.NestedInstance,\n instance: childInstance,\n transform: new DOMMatrix(),\n clippingStack: [],\n bounds: createBounds(width, height),\n resolveLocal: undefined,\n };\n componentRefs.refs[0] = {\n canvas: offscreenCanvas,\n interactionLayer,\n logicalWidth: width,\n logicalHeight: height,\n focusRenderRevision: undefined,\n retainedTree: undefined,\n } satisfies LayerSlot;\n componentRefs.teardowns.add(() => {\n childInstance.eventParent = undefined;\n parentInstance.paintEntries.delete(interactionLayer);\n controller.dispose();\n });\n }\n\n const slot = componentRefs.refs[0] as LayerSlot;\n const offscreenCanvas = slot.canvas;\n const layerPibbl = getPibblInstance(offscreenCanvas);\n const dimensionsChanged = slot.logicalWidth !== width ||\n slot.logicalHeight !== height;\n const surfaceChanged =\n offscreenCanvas.width !== layerSurface.backingWidth ||\n offscreenCanvas.height !== layerSurface.backingHeight;\n\n const { interactionLayer } = slot;\n parentInstance.paintEntries.delete(interactionLayer);\n interactionLayer.transform = getCurrentWorldTransform();\n interactionLayer.clippingStack = Array.from(GLOBAL_STATE.clippingStack);\n if (dimensionsChanged) {\n interactionLayer.bounds = createBounds(width, height);\n }\n // Install the current bridge before entering the child render. Focus bounds\n // collected by the child must never see the previous frame's transform.\n parentInstance.paintEntries.add(interactionLayer);\n\n const focusPolicy = parentInstance.eventRoot.focusPolicy;\n const focusRenderRevision = focusPolicy?.layerFocusRenderRevision?.(layerPibbl);\n\n const shouldRender =\n GLOBAL_STATE.componentIsMounting ||\n dimensionsChanged ||\n surfaceChanged ||\n !haveSameLayerNodeTree(slot.retainedTree, nextRoot) ||\n slot.focusRenderRevision !== focusRenderRevision ||\n hasPendingInstanceRender(layerPibbl);\n if (shouldRender) {\n if (layerPibbl.surface.kind !== 'layer') {\n throw new Error('Pibbl layer mounted without a derived surface.');\n }\n layerPibbl.surface.snapshot = layerSurface;\n layerPibbl.surface.managed = true;\n offscreenCanvas.width = layerSurface.backingWidth;\n offscreenCanvas.height = layerSurface.backingHeight;\n slot.logicalWidth = width;\n slot.logicalHeight = height;\n\n const renderedRevision = layerPibbl.requestedRenderRevision;\n executeRender(\n offscreenCanvas,\n getCurrentPibblInstance().renderTimestamp,\n nextRoot,\n false,\n );\n completeInstanceRenderRevision(layerPibbl, renderedRevision);\n slot.retainedTree = snapshotLayerNodeTree(nextRoot);\n } else {\n parentInstance.eventRoot.focusPolicy?.replayRetainedSubtree(layerPibbl);\n }\n const renderedFocusPolicy = parentInstance.eventRoot.focusPolicy;\n slot.focusRenderRevision =\n renderedFocusPolicy?.layerFocusRenderRevision?.(layerPibbl);\n\n parentInstance.eventRoot.html?.recordLayer(parentInstance, layerPibbl, interactionLayer, ctx.globalAlpha, ctx.globalCompositeOperation);\n\n ctx.drawImage(\n offscreenCanvas,\n 0,\n 0,\n offscreenCanvas.width,\n offscreenCanvas.height,\n 0,\n 0,\n width,\n height,\n );\n\n}\n\n/**\n * Describes a retained offscreen composition layer.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link LayerProps}\n * @see {@link LayerStyle}\n */\nexport const Layer = definePrimitive<\n LayerProps,\n LayerStyle,\n LayerStyle,\n ResolvedLayerStyle\n>(renderLayer, {\n childInput: 'structural',\n resolveStyle: resolveLayerStyle,\n});\n\nfunction resolveLayerStyle(\n style: Readonly<LayerStyle>,\n context: Parameters<NonNullable<\n import('../types.js').PrimitiveCapabilities<\n LayerProps,\n LayerStyle,\n LayerStyle,\n ResolvedLayerStyle\n >['resolveStyle']\n >>[1],\n): ResolvedLayerStyle {\n return {\n ...stripLayoutParticipation(style),\n width: resolveRequiredLength(\n style.width ?? context.allocation.width,\n context.percentageBasis.width,\n 'width',\n context,\n ),\n height: resolveRequiredLength(\n style.height ?? context.allocation.height,\n context.percentageBasis.height,\n 'height',\n context,\n ),\n } as ResolvedLayerStyle;\n}\n\nfunction createPrivateLayerRoot(\n children: readonly PibblElement<any>[],\n): PibblElement<FragmentProps> {\n return createElement(Fragment, {\n key: 'pibbl-layer-root',\n children,\n });\n}\n\nfunction createBounds(width: number, height: number): Path2D {\n const bounds = new Path2D();\n bounds.rect(0, 0, width, height);\n return bounds;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["offscreenCanvas", "interactionLayer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { HorizontalLineStyle } from "./horizontal-line.js";
|
|
2
|
+
import type { VerticalLineStyle } from "./vertical-line.js";
|
|
3
|
+
import type { PibblEventFocusOptions, PibblEventHandlers, PibblEventParticipationOptions } from '../events/types.js';
|
|
4
|
+
import { RenderingContext2D, SystemStyle } from '../types.js';
|
|
5
|
+
import type { PibblPhysics2DPropExtension } from '../types.js';
|
|
6
|
+
import type { BoxStyle, CursorStyle, LayoutItemStyle, PaintStyle, ResolvedDrawingStyle } from '../style/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Authored inputs for Line, including the declared data and presentation options.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link PibblEventHandlers}
|
|
11
|
+
* @see {@link PibblEventParticipationOptions}
|
|
12
|
+
* @see {@link PibblPhysics2DPropExtension}
|
|
13
|
+
* @see {@link Line}
|
|
14
|
+
*/
|
|
15
|
+
export interface LineProps extends PibblEventHandlers, PibblEventFocusOptions, PibblEventParticipationOptions, PibblPhysics2DPropExtension {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Supported geometry and presentation properties for Line.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link SystemStyle}
|
|
21
|
+
* @see {@link BoxStyle}
|
|
22
|
+
* @see {@link LayoutItemStyle}
|
|
23
|
+
* @see {@link PaintStyle}
|
|
24
|
+
* @see {@link CursorStyle}
|
|
25
|
+
* @see {@link Line}
|
|
26
|
+
* @see {@link HorizontalLineStyle}
|
|
27
|
+
* @see {@link VerticalLineStyle}
|
|
28
|
+
*/
|
|
29
|
+
export interface LineStyle extends SystemStyle, BoxStyle, LayoutItemStyle, Omit<PaintStyle, 'fill'>, CursorStyle {
|
|
30
|
+
/** Ordered coordinate pairs describing the path vertices. See {@link LineStyle}. */
|
|
31
|
+
coords: [number, number][];
|
|
32
|
+
/**
|
|
33
|
+
* Width used for line hit testing independently of the visible stroke width. See
|
|
34
|
+
* {@link LineStyle}.
|
|
35
|
+
*/
|
|
36
|
+
lineInteractionWidth?: number;
|
|
37
|
+
}
|
|
38
|
+
type ResolvedLineStyle = ResolvedDrawingStyle<LineStyle>;
|
|
39
|
+
export declare function renderLine(props: LineProps, style: Readonly<ResolvedLineStyle>, ctx: RenderingContext2D): void;
|
|
40
|
+
/**
|
|
41
|
+
* Describes a polyline primitive for JSX or createElement authoring.
|
|
42
|
+
*
|
|
43
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
44
|
+
* props and style types.
|
|
45
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link LineProps}
|
|
48
|
+
* @see {@link LineStyle}
|
|
49
|
+
*/
|
|
50
|
+
export declare const Line: import("@pibbl/core").PibblPrimitiveComponent<LineProps, import("@pibbl/core").PrimitiveInput<LineProps, LineStyle>>;
|
|
51
|
+
export {};
|