@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/particles/lib/curve.ts"],
|
|
4
|
+
"sourcesContent": ["import type { PibblEasing } from \"@pibbl/core\";\nimport { parseParticleColor } from \"./color.js\";\nimport { getParticleDescriptorRecord } from \"./particle.js\";\nimport type {\n PibblParticleCurve,\n PibblParticleCurveValue,\n PibblParticleGradient,\n} from \"./types.js\";\n\nexport const PARTICLE_CURVE_POINT_COUNT = 257;\nconst PARTICLE_CURVE_SEGMENTS = PARTICLE_CURVE_POINT_COUNT - 1;\n\nexport interface CompiledParticleCurve {\n readonly dimension: 1 | 2;\n readonly pointCount: 257;\n readonly samples: readonly number[];\n}\n\nexport interface CompiledParticleGradient {\n readonly pointCount: 257;\n readonly samples: readonly number[];\n readonly cssSamples: readonly string[];\n}\n\nfunction clampProgress(progress: number): number {\n return Math.min(1, Math.max(0, progress));\n}\n\nexport function compileEasingTable(easing?: PibblEasing): readonly number[] {\n const samples: number[] = [];\n for (let index = 0; index < PARTICLE_CURVE_POINT_COUNT; index += 1) {\n const progress = index / PARTICLE_CURVE_SEGMENTS;\n const value = easing === undefined ? progress : easing(progress);\n if (!Number.isFinite(value)) {\n throw new RangeError(\n `Particle curve easing must return finite samples; received ${String(value)} at ${progress}.`,\n );\n }\n samples.push(value);\n }\n return Object.freeze(samples);\n}\n\nexport function sampleEasingTable(\n samples: readonly number[],\n progress: number,\n): number {\n const scaled = clampProgress(progress) * PARTICLE_CURVE_SEGMENTS;\n const lower = Math.floor(scaled);\n if (lower >= PARTICLE_CURVE_SEGMENTS)\n return samples[PARTICLE_CURVE_SEGMENTS]!;\n const fraction = scaled - lower;\n const from = samples[lower]!;\n return from + (samples[lower + 1]! - from) * fraction;\n}\n\nfunction findSegment(\n keys: readonly (readonly [time: number, value: unknown])[],\n time: number,\n): number {\n let index = 0;\n while (index + 1 < keys.length - 1 && time > keys[index + 1]![0]) index += 1;\n return index;\n}\n\nfunction segmentProgress(\n keys: readonly (readonly [time: number, value: unknown])[],\n segment: number,\n time: number,\n): number {\n const from = keys[segment]![0];\n const to = keys[segment + 1]![0];\n return to === from ? 1 : (time - from) / (to - from);\n}\n\nfunction curveComponent(\n value: PibblParticleCurveValue,\n component: number,\n): number {\n return typeof value === \"number\" ? value : value[component]!;\n}\n\nexport function compileParticleCurve(\n descriptor: PibblParticleCurve<PibblParticleCurveValue>,\n): CompiledParticleCurve {\n const record = getParticleDescriptorRecord(descriptor);\n if (record?.type !== \"curve\") {\n throw new TypeError(\"Expected a curve created by particleCurve().\");\n }\n const dimension: 1 | 2 = typeof record.keys[0]![1] === \"number\" ? 1 : 2;\n const easing = compileEasingTable(record.options?.easing);\n const samples: number[] = [];\n for (let index = 0; index < PARTICLE_CURVE_POINT_COUNT; index += 1) {\n const time = index / PARTICLE_CURVE_SEGMENTS;\n const segment = findSegment(record.keys, time);\n const from = record.keys[segment]![1];\n const to = record.keys[segment + 1]![1];\n const progress = sampleEasingTable(\n easing,\n segmentProgress(record.keys, segment, time),\n );\n for (let component = 0; component < dimension; component += 1) {\n const start = curveComponent(from, component);\n samples.push(start + (curveComponent(to, component) - start) * progress);\n }\n }\n return Object.freeze({\n dimension,\n pointCount: PARTICLE_CURVE_POINT_COUNT,\n samples: Object.freeze(samples),\n });\n}\n\nexport function sampleParticleCurve(\n curve: CompiledParticleCurve,\n normalizedAge: number,\n component: number,\n): number {\n const scaled = clampProgress(normalizedAge) * PARTICLE_CURVE_SEGMENTS;\n const lower = Math.floor(scaled);\n const lowerValue = curve.samples[lower * curve.dimension + component]!;\n if (lower >= PARTICLE_CURVE_SEGMENTS) return lowerValue;\n const fraction = scaled - lower;\n const upperValue = curve.samples[(lower + 1) * curve.dimension + component]!;\n return lowerValue + (upperValue - lowerValue) * fraction;\n}\n\nexport function compileParticleGradient(\n descriptor: PibblParticleGradient,\n): CompiledParticleGradient {\n const record = getParticleDescriptorRecord(descriptor);\n if (record?.type !== \"gradient\") {\n throw new TypeError(\"Expected a gradient created by particleGradient().\");\n }\n const easing = compileEasingTable(record.options?.easing);\n const samples: number[] = [];\n const cssSamples: string[] = [];\n for (let index = 0; index < PARTICLE_CURVE_POINT_COUNT; index += 1) {\n const time = index / PARTICLE_CURVE_SEGMENTS;\n const segment = findSegment(record.keys, time);\n const from = parseParticleColor(record.keys[segment]![1]);\n const to = parseParticleColor(record.keys[segment + 1]![1]);\n const progress = sampleEasingTable(\n easing,\n segmentProgress(record.keys, segment, time),\n );\n const red = clampProgress(from[0] + (to[0] - from[0]) * progress);\n const green = clampProgress(from[1] + (to[1] - from[1]) * progress);\n const blue = clampProgress(from[2] + (to[2] - from[2]) * progress);\n const alpha = clampProgress(from[3] + (to[3] - from[3]) * progress);\n samples.push(red, green, blue, alpha);\n cssSamples.push(\n `rgba(${red * 255} ${green * 255} ${blue * 255} / ${alpha})`,\n );\n }\n return Object.freeze({\n pointCount: PARTICLE_CURVE_POINT_COUNT,\n samples: Object.freeze(samples),\n cssSamples: Object.freeze(cssSamples),\n });\n}\n\nexport function sampleParticleGradient(\n gradient: CompiledParticleGradient,\n normalizedAge: number,\n output: Float64Array,\n offset: number,\n): void {\n const index =\n Math.round(clampProgress(normalizedAge) * PARTICLE_CURVE_SEGMENTS) * 4;\n output[offset] = gradient.samples[index]!;\n output[offset + 1] = gradient.samples[index + 1]!;\n output[offset + 2] = gradient.samples[index + 2]!;\n output[offset + 3] = gradient.samples[index + 3]!;\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAOrC,MAAM,6BAA6B;AAC1C,MAAM,0BAA0B,6BAA6B;AAc7D,S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,QAAQ,KAAK;AACvC,SAAO,SAAS,CAAC,IAAI,SAAS,QAAQ,QAAQ,CAAC;AAC/C,SAAO,SAAS,CAAC,IAAI,SAAS,QAAQ,QAAQ,CAAC;AAC/C,SAAO,SAAS,CAAC,IAAI,SAAS,QAAQ,QAAQ,CAAC;AACjD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PibblParticleAppearance, PibblParticleBounds2D, PibblParticleEffect2D, PibblParticleEmission, PibblParticleEmitter2D, PibblParticleParameterDefinitions, PibblParticleRenderer2D, PibblParticleScalar } from './types.js';
|
|
2
|
+
export interface ParticleDefinitionCapabilities {
|
|
3
|
+
readonly statelessCanvas: boolean;
|
|
4
|
+
readonly requiresStateful: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
type NativeParticleRenderer2D = Exclude<PibblParticleRenderer2D, {
|
|
7
|
+
type: 'path';
|
|
8
|
+
}> | Readonly<{
|
|
9
|
+
type: 'path';
|
|
10
|
+
path: Path2D;
|
|
11
|
+
blend?: 'source-over' | 'additive';
|
|
12
|
+
}>;
|
|
13
|
+
export interface ParticleEmitter2DRecord extends Omit<PibblParticleEmitter2D, 'bounds' | 'renderer'> {
|
|
14
|
+
readonly renderer: NativeParticleRenderer2D;
|
|
15
|
+
readonly nameHash: number;
|
|
16
|
+
readonly bounds: PibblParticleBounds2D;
|
|
17
|
+
readonly boundsSource: 'explicit' | 'derived';
|
|
18
|
+
}
|
|
19
|
+
interface BaseParticleEffectRecord {
|
|
20
|
+
readonly debugName: string | undefined;
|
|
21
|
+
readonly parameters: PibblParticleParameterDefinitions;
|
|
22
|
+
readonly emitterNames: readonly string[];
|
|
23
|
+
readonly capabilities: ParticleDefinitionCapabilities;
|
|
24
|
+
}
|
|
25
|
+
export interface ParticleEffect2DRecord extends BaseParticleEffectRecord {
|
|
26
|
+
readonly dimension: 2;
|
|
27
|
+
readonly emitters: readonly ParticleEmitter2DRecord[];
|
|
28
|
+
}
|
|
29
|
+
export interface ParticleValidationContext {
|
|
30
|
+
readonly debugName?: string;
|
|
31
|
+
readonly emitter?: string;
|
|
32
|
+
readonly module?: string;
|
|
33
|
+
readonly property?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ParticleScalarRange {
|
|
36
|
+
readonly min: number;
|
|
37
|
+
readonly max: number;
|
|
38
|
+
readonly dynamic: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare function particleDefinitionError(context: ParticleValidationContext, message: string, value?: unknown, ErrorConstructor?: typeof TypeError | typeof RangeError): never;
|
|
41
|
+
export declare function assertFiniteNumber(value: unknown, context: ParticleValidationContext): asserts value is number;
|
|
42
|
+
export declare function assertNonnegativeNumber(value: unknown, context: ParticleValidationContext): asserts value is number;
|
|
43
|
+
export declare function assertPositiveNumber(value: unknown, context: ParticleValidationContext): asserts value is number;
|
|
44
|
+
export declare function assertFiniteVector(value: unknown, dimension: 2, context: ParticleValidationContext): asserts value is readonly number[];
|
|
45
|
+
export declare function freezeParticleRecord<T>(value: T, seen?: WeakSet<object>): T;
|
|
46
|
+
export declare function cloneParticleRecord<T>(value: T, seen?: WeakMap<object, unknown>): T;
|
|
47
|
+
export declare function hashParticleEmitterName(name: string): number;
|
|
48
|
+
export declare function normalizeParameters(parameters: PibblParticleParameterDefinitions | undefined, debugName: string | undefined): PibblParticleParameterDefinitions;
|
|
49
|
+
export declare function particleScalarRange(value: PibblParticleScalar, parameters: PibblParticleParameterDefinitions, context: ParticleValidationContext): ParticleScalarRange;
|
|
50
|
+
export declare function validateScalarVector(value: unknown, dimension: 2, parameters: PibblParticleParameterDefinitions, context: ParticleValidationContext): readonly ParticleScalarRange[];
|
|
51
|
+
export declare function normalizeEmission(emission: readonly PibblParticleEmission[], context: ParticleValidationContext): readonly PibblParticleEmission[];
|
|
52
|
+
export declare function validateAppearance(appearance: PibblParticleAppearance | undefined, context: ParticleValidationContext): PibblParticleAppearance | undefined;
|
|
53
|
+
export declare function normalizeBounds2D(bounds: PibblParticleBounds2D, context: ParticleValidationContext): PibblParticleBounds2D;
|
|
54
|
+
export declare function normalizeRenderer2D(renderer: PibblParticleRenderer2D, context: ParticleValidationContext): NativeParticleRenderer2D;
|
|
55
|
+
export declare function createParticleEffect2D(record: ParticleEffect2DRecord): PibblParticleEffect2D;
|
|
56
|
+
/** @internal Returns the immutable normalized record for a package-created 2D effect. */
|
|
57
|
+
export declare function getParticleEffect2DRecord(effect: PibblParticleEffect2D): ParticleEffect2DRecord;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import { PathGeometry, toPath2D } from "@pibbl/core";
|
|
2
|
+
import { getParticleDescriptorRecord } from "./particle.js";
|
|
3
|
+
const effect2DRecords = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function effectLabel(debugName) {
|
|
5
|
+
return debugName === void 0 ? "Pibbl particle effect" : `Pibbl particle effect "${debugName}"`;
|
|
6
|
+
}
|
|
7
|
+
function valueLabel(value) {
|
|
8
|
+
if (typeof value === "string") return `"${value}"`;
|
|
9
|
+
if (typeof value === "number" || typeof value === "boolean" || value == null) {
|
|
10
|
+
return String(value);
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
return JSON.stringify(value);
|
|
14
|
+
} catch {
|
|
15
|
+
return Object.prototype.toString.call(value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function particleDefinitionError(context, message, value, ErrorConstructor = TypeError) {
|
|
19
|
+
const path = [
|
|
20
|
+
effectLabel(context.debugName),
|
|
21
|
+
context.emitter === void 0 ? void 0 : `emitter "${context.emitter}"`,
|
|
22
|
+
context.module,
|
|
23
|
+
context.property
|
|
24
|
+
].filter((part) => part !== void 0).join(" ");
|
|
25
|
+
const received = arguments.length >= 3 ? `; received ${valueLabel(value)}` : "";
|
|
26
|
+
throw new ErrorConstructor(`${path} ${message}${received}.`);
|
|
27
|
+
}
|
|
28
|
+
function assertFiniteNumber(value, context) {
|
|
29
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
30
|
+
particleDefinitionError(context, "must be finite", value, RangeError);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function assertNonnegativeNumber(value, context) {
|
|
34
|
+
assertFiniteNumber(value, context);
|
|
35
|
+
if (value < 0) particleDefinitionError(context, "must be nonnegative", value, RangeError);
|
|
36
|
+
}
|
|
37
|
+
function assertPositiveNumber(value, context) {
|
|
38
|
+
assertFiniteNumber(value, context);
|
|
39
|
+
if (value <= 0) particleDefinitionError(context, "must be positive", value, RangeError);
|
|
40
|
+
}
|
|
41
|
+
function assertFiniteVector(value, dimension, context) {
|
|
42
|
+
if (!Array.isArray(value) || value.length !== dimension) {
|
|
43
|
+
particleDefinitionError(context, `must be a ${dimension}-dimensional vector`, value);
|
|
44
|
+
}
|
|
45
|
+
for (let index = 0; index < dimension; index += 1) {
|
|
46
|
+
assertFiniteNumber(value[index], {
|
|
47
|
+
...context,
|
|
48
|
+
property: `${context.property ?? "value"}[${index}]`
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function freezeParticleRecord(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
53
|
+
if (value === null || typeof value !== "object" || seen.has(value)) return value;
|
|
54
|
+
if (getParticleDescriptorRecord(value) !== void 0) return value;
|
|
55
|
+
const prototype = Object.getPrototypeOf(value);
|
|
56
|
+
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
seen.add(value);
|
|
60
|
+
for (const entry of Object.values(value)) freezeParticleRecord(entry, seen);
|
|
61
|
+
return Object.freeze(value);
|
|
62
|
+
}
|
|
63
|
+
function cloneParticleRecord(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
64
|
+
if (value === null || typeof value !== "object") return value;
|
|
65
|
+
if (getParticleDescriptorRecord(value) !== void 0) return value;
|
|
66
|
+
const existing = seen.get(value);
|
|
67
|
+
if (existing !== void 0) return existing;
|
|
68
|
+
if (Array.isArray(value)) {
|
|
69
|
+
const clone2 = [];
|
|
70
|
+
seen.set(value, clone2);
|
|
71
|
+
for (const entry of value) clone2.push(cloneParticleRecord(entry, seen));
|
|
72
|
+
return Object.freeze(clone2);
|
|
73
|
+
}
|
|
74
|
+
const prototype = Object.getPrototypeOf(value);
|
|
75
|
+
if (prototype !== Object.prototype && prototype !== null) return value;
|
|
76
|
+
const clone = Object.create(prototype);
|
|
77
|
+
seen.set(value, clone);
|
|
78
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
79
|
+
clone[key] = cloneParticleRecord(entry, seen);
|
|
80
|
+
}
|
|
81
|
+
return Object.freeze(clone);
|
|
82
|
+
}
|
|
83
|
+
function hashParticleEmitterName(name) {
|
|
84
|
+
let hash = 2166136261;
|
|
85
|
+
for (let index = 0; index < name.length; index += 1) {
|
|
86
|
+
hash = Math.imul(hash ^ name.charCodeAt(index), 16777619);
|
|
87
|
+
}
|
|
88
|
+
return hash >>> 0;
|
|
89
|
+
}
|
|
90
|
+
function normalizeParameters(parameters, debugName) {
|
|
91
|
+
if (parameters === void 0) return Object.freeze({});
|
|
92
|
+
if (parameters === null || typeof parameters !== "object" || Array.isArray(parameters)) {
|
|
93
|
+
particleDefinitionError({ debugName, property: "parameters" }, "must be a record", parameters);
|
|
94
|
+
}
|
|
95
|
+
const normalized = {};
|
|
96
|
+
for (const [name, definition] of Object.entries(parameters)) {
|
|
97
|
+
if (name.trim().length === 0) {
|
|
98
|
+
particleDefinitionError(
|
|
99
|
+
{ debugName, property: "parameters" },
|
|
100
|
+
"parameter names must be nonempty",
|
|
101
|
+
name
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
if (definition === null || typeof definition !== "object") {
|
|
105
|
+
particleDefinitionError(
|
|
106
|
+
{ debugName, module: `parameter "${name}"`, property: "definition" },
|
|
107
|
+
"must be a record",
|
|
108
|
+
definition
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
if (!["spawn", "simulation", "render"].includes(definition.timing)) {
|
|
112
|
+
particleDefinitionError(
|
|
113
|
+
{ debugName, module: `parameter "${name}"`, property: "timing" },
|
|
114
|
+
"must be spawn, simulation, or render",
|
|
115
|
+
definition.timing
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
switch (definition.type) {
|
|
119
|
+
case "number":
|
|
120
|
+
assertFiniteNumber(definition.default, {
|
|
121
|
+
debugName,
|
|
122
|
+
module: `parameter "${name}"`,
|
|
123
|
+
property: "default"
|
|
124
|
+
});
|
|
125
|
+
break;
|
|
126
|
+
case "vector2":
|
|
127
|
+
assertFiniteVector(definition.default, 2, {
|
|
128
|
+
debugName,
|
|
129
|
+
module: `parameter "${name}"`,
|
|
130
|
+
property: "default"
|
|
131
|
+
});
|
|
132
|
+
break;
|
|
133
|
+
case "color":
|
|
134
|
+
if (typeof definition.default !== "string" || definition.default.trim().length === 0) {
|
|
135
|
+
particleDefinitionError(
|
|
136
|
+
{ debugName, module: `parameter "${name}"`, property: "default" },
|
|
137
|
+
"must be a nonempty color string",
|
|
138
|
+
definition.default
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
particleDefinitionError(
|
|
144
|
+
{ debugName, module: `parameter "${name}"`, property: "type" },
|
|
145
|
+
"uses an unsupported parameter type",
|
|
146
|
+
definition.type
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
normalized[name] = cloneParticleRecord(definition);
|
|
150
|
+
}
|
|
151
|
+
return Object.freeze(normalized);
|
|
152
|
+
}
|
|
153
|
+
function descriptorScalarRange(value, parameters, context) {
|
|
154
|
+
const descriptor = getParticleDescriptorRecord(value);
|
|
155
|
+
if (descriptor === void 0) {
|
|
156
|
+
particleDefinitionError(
|
|
157
|
+
context,
|
|
158
|
+
"must use a descriptor created by particle",
|
|
159
|
+
value
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
switch (descriptor.type) {
|
|
163
|
+
case "between":
|
|
164
|
+
case "integer":
|
|
165
|
+
return Object.freeze({ min: descriptor.min, max: descriptor.max, dynamic: false });
|
|
166
|
+
case "choice": {
|
|
167
|
+
let min = Number.POSITIVE_INFINITY;
|
|
168
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
169
|
+
for (let index = 0; index < descriptor.choices.length; index += 1) {
|
|
170
|
+
const choice = descriptor.choices[index];
|
|
171
|
+
assertFiniteNumber(choice.value, {
|
|
172
|
+
...context,
|
|
173
|
+
property: `${context.property ?? "value"}.choices[${index}].value`
|
|
174
|
+
});
|
|
175
|
+
min = Math.min(min, choice.value);
|
|
176
|
+
max = Math.max(max, choice.value);
|
|
177
|
+
}
|
|
178
|
+
return Object.freeze({ min, max, dynamic: false });
|
|
179
|
+
}
|
|
180
|
+
case "parameter": {
|
|
181
|
+
const definition = parameters[descriptor.name];
|
|
182
|
+
if (definition === void 0) {
|
|
183
|
+
particleDefinitionError(
|
|
184
|
+
context,
|
|
185
|
+
"references an unknown parameter",
|
|
186
|
+
descriptor.name
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
if (definition.type !== "number") {
|
|
190
|
+
particleDefinitionError(
|
|
191
|
+
context,
|
|
192
|
+
"requires a number parameter",
|
|
193
|
+
`${descriptor.name}:${definition.type}`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
return Object.freeze({
|
|
197
|
+
min: definition.default,
|
|
198
|
+
max: definition.default,
|
|
199
|
+
dynamic: true
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
default:
|
|
203
|
+
particleDefinitionError(context, "must be a scalar particle descriptor", descriptor.type);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function particleScalarRange(value, parameters, context) {
|
|
207
|
+
if (typeof value === "number") {
|
|
208
|
+
assertFiniteNumber(value, context);
|
|
209
|
+
return Object.freeze({ min: value, max: value, dynamic: false });
|
|
210
|
+
}
|
|
211
|
+
if (value === null || typeof value !== "object") {
|
|
212
|
+
particleDefinitionError(context, "must be a finite particle scalar", value);
|
|
213
|
+
}
|
|
214
|
+
return descriptorScalarRange(value, parameters, context);
|
|
215
|
+
}
|
|
216
|
+
function validateScalarVector(value, dimension, parameters, context) {
|
|
217
|
+
if (!Array.isArray(value)) {
|
|
218
|
+
const descriptor = getParticleDescriptorRecord(value);
|
|
219
|
+
if (descriptor?.type !== "parameter") {
|
|
220
|
+
particleDefinitionError(context, `must be a ${dimension}-dimensional particle vector`, value);
|
|
221
|
+
}
|
|
222
|
+
const definition = parameters[descriptor.name];
|
|
223
|
+
if (definition === void 0) {
|
|
224
|
+
particleDefinitionError(context, "references an unknown parameter", descriptor.name);
|
|
225
|
+
}
|
|
226
|
+
if (definition.type !== "vector2") {
|
|
227
|
+
particleDefinitionError(
|
|
228
|
+
context,
|
|
229
|
+
`parameter "${descriptor.name}" has type ${definition.type}; expected a ${dimension}-dimensional vector parameter`
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
return Object.freeze(definition.default.map((entry) => Object.freeze({
|
|
233
|
+
min: entry,
|
|
234
|
+
max: entry,
|
|
235
|
+
dynamic: true
|
|
236
|
+
})));
|
|
237
|
+
}
|
|
238
|
+
if (value.length !== dimension) {
|
|
239
|
+
particleDefinitionError(context, `must be a ${dimension}-dimensional particle vector`, value);
|
|
240
|
+
}
|
|
241
|
+
return Object.freeze(value.map((entry, index) => particleScalarRange(
|
|
242
|
+
entry,
|
|
243
|
+
parameters,
|
|
244
|
+
{ ...context, property: `${context.property ?? "value"}[${index}]` }
|
|
245
|
+
)));
|
|
246
|
+
}
|
|
247
|
+
function validateRepeat(repeat, context) {
|
|
248
|
+
if (repeat === void 0) return;
|
|
249
|
+
if (repeat === null || typeof repeat !== "object") {
|
|
250
|
+
particleDefinitionError(context, "must be a record", repeat);
|
|
251
|
+
}
|
|
252
|
+
assertPositiveNumber(repeat.everyMilliseconds, {
|
|
253
|
+
...context,
|
|
254
|
+
property: `${context.property}.everyMilliseconds`
|
|
255
|
+
});
|
|
256
|
+
if (!Number.isSafeInteger(repeat.count) || repeat.count <= 0) {
|
|
257
|
+
particleDefinitionError(
|
|
258
|
+
{ ...context, property: `${context.property}.count` },
|
|
259
|
+
"must be a positive safe integer",
|
|
260
|
+
repeat.count,
|
|
261
|
+
RangeError
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function validateProbability(value, context) {
|
|
266
|
+
if (value === void 0) return;
|
|
267
|
+
assertFiniteNumber(value, context);
|
|
268
|
+
if (value < 0 || value > 1) {
|
|
269
|
+
particleDefinitionError(context, "must be within [0, 1]", value, RangeError);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function validateCount(value, context) {
|
|
273
|
+
if (typeof value === "number") {
|
|
274
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
275
|
+
particleDefinitionError(context, "must be a positive safe integer", value, RangeError);
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const descriptor = getParticleDescriptorRecord(value);
|
|
280
|
+
if (descriptor?.type !== "integer" || descriptor.min <= 0) {
|
|
281
|
+
particleDefinitionError(
|
|
282
|
+
context,
|
|
283
|
+
"must be a positive integer or positive particleInteger range",
|
|
284
|
+
value,
|
|
285
|
+
RangeError
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function normalizeEmission(emission, context) {
|
|
290
|
+
if (!Array.isArray(emission) || emission.length === 0) {
|
|
291
|
+
particleDefinitionError(
|
|
292
|
+
{ ...context, property: "emission" },
|
|
293
|
+
"must be a nonempty array",
|
|
294
|
+
emission
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
for (let index = 0; index < emission.length; index += 1) {
|
|
298
|
+
const source = emission[index];
|
|
299
|
+
if (source === null || typeof source !== "object") {
|
|
300
|
+
particleDefinitionError(
|
|
301
|
+
{ ...context, module: `emission[${index}]` },
|
|
302
|
+
"must be an emission record",
|
|
303
|
+
source
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
const module = `emission[${index}] ${String(source.type)}`;
|
|
307
|
+
switch (source.type) {
|
|
308
|
+
case "rate":
|
|
309
|
+
assertNonnegativeNumber(source.particlesPerSecond, {
|
|
310
|
+
...context,
|
|
311
|
+
module,
|
|
312
|
+
property: "particlesPerSecond"
|
|
313
|
+
});
|
|
314
|
+
if (source.startMilliseconds !== void 0) {
|
|
315
|
+
assertNonnegativeNumber(source.startMilliseconds, {
|
|
316
|
+
...context,
|
|
317
|
+
module,
|
|
318
|
+
property: "startMilliseconds"
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
if (source.durationMilliseconds !== void 0) {
|
|
322
|
+
assertNonnegativeNumber(source.durationMilliseconds, {
|
|
323
|
+
...context,
|
|
324
|
+
module,
|
|
325
|
+
property: "durationMilliseconds"
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
validateProbability(source.probability, {
|
|
329
|
+
...context,
|
|
330
|
+
module,
|
|
331
|
+
property: "probability"
|
|
332
|
+
});
|
|
333
|
+
validateRepeat(source.repeat, { ...context, module, property: "repeat" });
|
|
334
|
+
break;
|
|
335
|
+
case "burst":
|
|
336
|
+
assertNonnegativeNumber(source.atMilliseconds, {
|
|
337
|
+
...context,
|
|
338
|
+
module,
|
|
339
|
+
property: "atMilliseconds"
|
|
340
|
+
});
|
|
341
|
+
validateCount(source.count, { ...context, module, property: "count" });
|
|
342
|
+
validateProbability(source.probability, {
|
|
343
|
+
...context,
|
|
344
|
+
module,
|
|
345
|
+
property: "probability"
|
|
346
|
+
});
|
|
347
|
+
validateRepeat(source.repeat, { ...context, module, property: "repeat" });
|
|
348
|
+
break;
|
|
349
|
+
case "manual":
|
|
350
|
+
if (source.count !== void 0) {
|
|
351
|
+
validateCount(source.count, { ...context, module, property: "count" });
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
default:
|
|
355
|
+
particleDefinitionError(
|
|
356
|
+
{ ...context, module, property: "type" },
|
|
357
|
+
"uses an unsupported emission type",
|
|
358
|
+
source.type
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return cloneParticleRecord(emission);
|
|
363
|
+
}
|
|
364
|
+
function validateAppearance(appearance, context) {
|
|
365
|
+
if (appearance === void 0) return void 0;
|
|
366
|
+
if (appearance === null || typeof appearance !== "object" || Array.isArray(appearance)) {
|
|
367
|
+
particleDefinitionError(
|
|
368
|
+
{ ...context, property: "appearance" },
|
|
369
|
+
"must be a record",
|
|
370
|
+
appearance
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
for (const [property, descriptor] of Object.entries(appearance)) {
|
|
374
|
+
if (descriptor === void 0) continue;
|
|
375
|
+
const record = getParticleDescriptorRecord(descriptor);
|
|
376
|
+
const expected = property === "color" ? "gradient" : "curve";
|
|
377
|
+
if (record?.type !== expected) {
|
|
378
|
+
particleDefinitionError(
|
|
379
|
+
{ ...context, module: "appearance", property },
|
|
380
|
+
`must use particle.${expected}`,
|
|
381
|
+
descriptor
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return cloneParticleRecord(appearance);
|
|
386
|
+
}
|
|
387
|
+
function normalizeBounds2D(bounds, context) {
|
|
388
|
+
if (bounds === null || typeof bounds !== "object") {
|
|
389
|
+
particleDefinitionError({ ...context, property: "bounds" }, "must be a record", bounds);
|
|
390
|
+
}
|
|
391
|
+
assertFiniteVector(bounds.min, 2, { ...context, property: "bounds.min" });
|
|
392
|
+
assertFiniteVector(bounds.max, 2, { ...context, property: "bounds.max" });
|
|
393
|
+
for (let index = 0; index < 2; index += 1) {
|
|
394
|
+
if (bounds.min[index] > bounds.max[index]) {
|
|
395
|
+
particleDefinitionError(
|
|
396
|
+
{ ...context, property: `bounds.min[${index}]` },
|
|
397
|
+
`must be at most bounds.max[${index}]`,
|
|
398
|
+
bounds.min[index],
|
|
399
|
+
RangeError
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return cloneParticleRecord(bounds);
|
|
404
|
+
}
|
|
405
|
+
function normalizeRenderer2D(renderer, context) {
|
|
406
|
+
if (renderer === null || typeof renderer !== "object") {
|
|
407
|
+
particleDefinitionError(
|
|
408
|
+
{ ...context, property: "renderer" },
|
|
409
|
+
"must be a record",
|
|
410
|
+
renderer
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
const module = `renderer ${String(renderer.type)}`;
|
|
414
|
+
const blend = renderer.blend ?? "source-over";
|
|
415
|
+
if (blend !== "source-over" && blend !== "additive") {
|
|
416
|
+
particleDefinitionError({ ...context, module, property: "blend" }, "is unsupported", blend);
|
|
417
|
+
}
|
|
418
|
+
switch (renderer.type) {
|
|
419
|
+
case "circle":
|
|
420
|
+
return Object.freeze({ type: "circle", blend });
|
|
421
|
+
case "rectangle":
|
|
422
|
+
if (renderer.aspectRatio !== void 0) {
|
|
423
|
+
assertPositiveNumber(renderer.aspectRatio, {
|
|
424
|
+
...context,
|
|
425
|
+
module,
|
|
426
|
+
property: "aspectRatio"
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return Object.freeze({
|
|
430
|
+
type: "rectangle",
|
|
431
|
+
...renderer.aspectRatio === void 0 ? {} : { aspectRatio: renderer.aspectRatio },
|
|
432
|
+
blend
|
|
433
|
+
});
|
|
434
|
+
case "path":
|
|
435
|
+
if (renderer.path instanceof PathGeometry) {
|
|
436
|
+
return Object.freeze({ type: "path", path: toPath2D(renderer.path), blend });
|
|
437
|
+
}
|
|
438
|
+
if (typeof Path2D === "undefined" || !(renderer.path instanceof Path2D)) {
|
|
439
|
+
particleDefinitionError({ ...context, module, property: "path" }, "must be a Path2D or PathGeometry", renderer.path);
|
|
440
|
+
}
|
|
441
|
+
return Object.freeze({ type: "path", path: new Path2D(renderer.path), blend });
|
|
442
|
+
case "sprite":
|
|
443
|
+
if (renderer.source === null || typeof renderer.source !== "object" && typeof renderer.source !== "function") {
|
|
444
|
+
particleDefinitionError(
|
|
445
|
+
{ ...context, module, property: "source" },
|
|
446
|
+
"must be a CanvasImageSource",
|
|
447
|
+
renderer.source
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
if (renderer.anchor !== void 0) {
|
|
451
|
+
assertFiniteVector(renderer.anchor, 2, { ...context, module, property: "anchor" });
|
|
452
|
+
}
|
|
453
|
+
return Object.freeze({
|
|
454
|
+
type: "sprite",
|
|
455
|
+
source: renderer.source,
|
|
456
|
+
...renderer.anchor === void 0 ? {} : {
|
|
457
|
+
anchor: cloneParticleRecord(renderer.anchor)
|
|
458
|
+
},
|
|
459
|
+
blend
|
|
460
|
+
});
|
|
461
|
+
default:
|
|
462
|
+
particleDefinitionError(
|
|
463
|
+
{ ...context, module, property: "type" },
|
|
464
|
+
"uses an unsupported Canvas renderer",
|
|
465
|
+
renderer.type
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function createParticleEffect2D(record) {
|
|
470
|
+
const effect = Object.freeze({ dimension: 2 });
|
|
471
|
+
effect2DRecords.set(effect, freezeParticleRecord(record));
|
|
472
|
+
return effect;
|
|
473
|
+
}
|
|
474
|
+
function getParticleEffect2DRecord(effect) {
|
|
475
|
+
const record = effect2DRecords.get(effect);
|
|
476
|
+
if (record === void 0) {
|
|
477
|
+
throw new TypeError("Expected a 2D particle effect created by defineParticleEffect2D().");
|
|
478
|
+
}
|
|
479
|
+
return record;
|
|
480
|
+
}
|
|
481
|
+
export {
|
|
482
|
+
assertFiniteNumber,
|
|
483
|
+
assertFiniteVector,
|
|
484
|
+
assertNonnegativeNumber,
|
|
485
|
+
assertPositiveNumber,
|
|
486
|
+
cloneParticleRecord,
|
|
487
|
+
createParticleEffect2D,
|
|
488
|
+
freezeParticleRecord,
|
|
489
|
+
getParticleEffect2DRecord,
|
|
490
|
+
hashParticleEmitterName,
|
|
491
|
+
normalizeBounds2D,
|
|
492
|
+
normalizeEmission,
|
|
493
|
+
normalizeParameters,
|
|
494
|
+
normalizeRenderer2D,
|
|
495
|
+
particleDefinitionError,
|
|
496
|
+
particleScalarRange,
|
|
497
|
+
validateAppearance,
|
|
498
|
+
validateScalarVector
|
|
499
|
+
};
|
|
500
|
+
//# sourceMappingURL=definition-records.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/particles/lib/definition-records.ts"],
|
|
4
|
+
"sourcesContent": ["import { PathGeometry, toPath2D } from '@pibbl/core';\nimport type {\n PibblParticleAppearance,\n PibblParticleBounds2D,\n PibblParticleEffect2D,\n PibblParticleEmission,\n PibblParticleEmitter2D,\n PibblParticleParameterDefinition,\n PibblParticleParameterDefinitions,\n PibblParticleRenderer2D,\n PibblParticleScalar,\n} from './types.js';\nimport { getParticleDescriptorRecord } from './particle.js';\n\nexport interface ParticleDefinitionCapabilities {\n readonly statelessCanvas: boolean;\n readonly requiresStateful: readonly string[];\n}\n\ntype NativeParticleRenderer2D = Exclude<PibblParticleRenderer2D, { type: 'path' }> | Readonly<{ type: 'path'; path: Path2D; blend?: 'source-over' | 'additive' }>;\n\nexport interface ParticleEmitter2DRecord\n extends Omit<PibblParticleEmitter2D, 'bounds' | 'renderer'> {\n readonly renderer: NativeParticleRenderer2D;\n readonly nameHash: number;\n readonly bounds: PibblParticleBounds2D;\n readonly boundsSource: 'explicit' | 'derived';\n}\n\ninterface BaseParticleEffectRecord {\n readonly debugName: string | undefined;\n readonly parameters: PibblParticleParameterDefinitions;\n readonly emitterNames: readonly string[];\n readonly capabilities: ParticleDefinitionCapabilities;\n}\n\nexport interface ParticleEffect2DRecord extends BaseParticleEffectRecord {\n readonly dimension: 2;\n readonly emitters: readonly ParticleEmitter2DRecord[];\n}\n\nexport interface ParticleValidationContext {\n readonly debugName?: string;\n readonly emitter?: string;\n readonly module?: string;\n readonly property?: string;\n}\n\nexport interface ParticleScalarRange {\n readonly min: number;\n readonly max: number;\n readonly dynamic: boolean;\n}\n\nconst effect2DRecords = new WeakMap<PibblParticleEffect2D, ParticleEffect2DRecord>();\n\nfunction effectLabel(debugName: string | undefined): string {\n return debugName === undefined ? 'Pibbl particle effect' :\n `Pibbl particle effect \"${debugName}\"`;\n}\n\nfunction valueLabel(value: unknown): string {\n if (typeof value === 'string') return `\"${value}\"`;\n if (typeof value === 'number' || typeof value === 'boolean' || value == null) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\nexport function particleDefinitionError(\n context: ParticleValidationContext,\n message: string,\n value?: unknown,\n ErrorConstructor: typeof TypeError | typeof RangeError = TypeError,\n): never {\n const path = [\n effectLabel(context.debugName),\n context.emitter === undefined ? undefined : `emitter \"${context.emitter}\"`,\n context.module,\n context.property,\n ].filter((part): part is string => part !== undefined).join(' ');\n const received = arguments.length >= 3 ? `; received ${valueLabel(value)}` : '';\n throw new ErrorConstructor(`${path} ${message}${received}.`);\n}\n\nexport function assertFiniteNumber(\n value: unknown,\n context: ParticleValidationContext,\n): asserts value is number {\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n particleDefinitionError(context, 'must be finite', value, RangeError);\n }\n}\n\nexport function assertNonnegativeNumber(\n value: unknown,\n context: ParticleValidationContext,\n): asserts value is number {\n assertFiniteNumber(value, context);\n if (value < 0) particleDefinitionError(context, 'must be nonnegative', value, RangeError);\n}\n\nexport function assertPositiveNumber(\n value: unknown,\n context: ParticleValidationContext,\n): asserts value is number {\n assertFiniteNumber(value, context);\n if (value <= 0) particleDefinitionError(context, 'must be positive', value, RangeError);\n}\n\nexport function assertFiniteVector(\n value: unknown,\n dimension: 2,\n context: ParticleValidationContext,\n): asserts value is readonly number[] {\n if (!Array.isArray(value) || value.length !== dimension) {\n particleDefinitionError(context, `must be a ${dimension}-dimensional vector`, value);\n }\n for (let index = 0; index < dimension; index += 1) {\n assertFiniteNumber(value[index], {\n ...context,\n property: `${context.property ?? 'value'}[${index}]`,\n });\n }\n}\n\nexport function freezeParticleRecord<T>(\n value: T,\n seen = new WeakSet<object>(),\n): T {\n if (value === null || typeof value !== 'object' || seen.has(value)) return value;\n if (getParticleDescriptorRecord(value) !== undefined) return value;\n const prototype = Object.getPrototypeOf(value);\n if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) {\n return value;\n }\n seen.add(value);\n for (const entry of Object.values(value)) freezeParticleRecord(entry, seen);\n return Object.freeze(value);\n}\n\nexport function cloneParticleRecord<T>(\n value: T,\n seen = new WeakMap<object, unknown>(),\n): T {\n if (value === null || typeof value !== 'object') return value;\n if (getParticleDescriptorRecord(value) !== undefined) return value;\n const existing = seen.get(value);\n if (existing !== undefined) return existing as T;\n if (Array.isArray(value)) {\n const clone: unknown[] = [];\n seen.set(value, clone);\n for (const entry of value) clone.push(cloneParticleRecord(entry, seen));\n return Object.freeze(clone) as T;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return value;\n const clone: Record<string, unknown> = Object.create(prototype);\n seen.set(value, clone);\n for (const [key, entry] of Object.entries(value)) {\n clone[key] = cloneParticleRecord(entry, seen);\n }\n return Object.freeze(clone) as T;\n}\n\nexport function hashParticleEmitterName(name: string): number {\n let hash = 0x811c9dc5;\n for (let index = 0; index < name.length; index += 1) {\n hash = Math.imul(hash ^ name.charCodeAt(index), 0x01000193);\n }\n return hash >>> 0;\n}\n\nexport function normalizeParameters(\n parameters: PibblParticleParameterDefinitions | undefined,\n debugName: string | undefined,\n): PibblParticleParameterDefinitions {\n if (parameters === undefined) return Object.freeze({});\n if (parameters === null || typeof parameters !== 'object' || Array.isArray(parameters)) {\n particleDefinitionError({ debugName, property: 'parameters' }, 'must be a record', parameters);\n }\n const normalized: Record<string, PibblParticleParameterDefinition> = {};\n for (const [name, definition] of Object.entries(parameters)) {\n if (name.trim().length === 0) {\n particleDefinitionError(\n { debugName, property: 'parameters' },\n 'parameter names must be nonempty',\n name,\n );\n }\n if (definition === null || typeof definition !== 'object') {\n particleDefinitionError(\n { debugName, module: `parameter \"${name}\"`, property: 'definition' },\n 'must be a record',\n definition,\n );\n }\n if (!['spawn', 'simulation', 'render'].includes(definition.timing)) {\n particleDefinitionError(\n { debugName, module: `parameter \"${name}\"`, property: 'timing' },\n 'must be spawn, simulation, or render',\n definition.timing,\n );\n }\n switch (definition.type) {\n case 'number':\n assertFiniteNumber(definition.default, {\n debugName, module: `parameter \"${name}\"`, property: 'default',\n });\n break;\n case 'vector2':\n assertFiniteVector(definition.default, 2, {\n debugName, module: `parameter \"${name}\"`, property: 'default',\n });\n break;\n case 'color':\n if (typeof definition.default !== 'string' || definition.default.trim().length === 0) {\n particleDefinitionError(\n { debugName, module: `parameter \"${name}\"`, property: 'default' },\n 'must be a nonempty color string',\n definition.default,\n );\n }\n break;\n default:\n particleDefinitionError(\n { debugName, module: `parameter \"${name}\"`, property: 'type' },\n 'uses an unsupported parameter type',\n (definition as { type?: unknown }).type,\n );\n }\n normalized[name] = cloneParticleRecord(definition);\n }\n return Object.freeze(normalized);\n}\n\nfunction descriptorScalarRange(\n value: object,\n parameters: PibblParticleParameterDefinitions,\n context: ParticleValidationContext,\n): ParticleScalarRange {\n const descriptor = getParticleDescriptorRecord(value);\n if (descriptor === undefined) {\n particleDefinitionError(\n context,\n 'must use a descriptor created by particle',\n value,\n );\n }\n switch (descriptor.type) {\n case 'between':\n case 'integer':\n return Object.freeze({ min: descriptor.min, max: descriptor.max, dynamic: false });\n case 'choice': {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (let index = 0; index < descriptor.choices.length; index += 1) {\n const choice = descriptor.choices[index]!;\n assertFiniteNumber(choice.value, {\n ...context, property: `${context.property ?? 'value'}.choices[${index}].value`,\n });\n min = Math.min(min, choice.value);\n max = Math.max(max, choice.value);\n }\n return Object.freeze({ min, max, dynamic: false });\n }\n case 'parameter': {\n const definition = parameters[descriptor.name];\n if (definition === undefined) {\n particleDefinitionError(\n context,\n 'references an unknown parameter',\n descriptor.name,\n );\n }\n if (definition.type !== 'number') {\n particleDefinitionError(\n context,\n 'requires a number parameter',\n `${descriptor.name}:${definition.type}`,\n );\n }\n return Object.freeze({\n min: definition.default,\n max: definition.default,\n dynamic: true,\n });\n }\n default:\n particleDefinitionError(context, 'must be a scalar particle descriptor', descriptor.type);\n }\n}\n\nexport function particleScalarRange(\n value: PibblParticleScalar,\n parameters: PibblParticleParameterDefinitions,\n context: ParticleValidationContext,\n): ParticleScalarRange {\n if (typeof value === 'number') {\n assertFiniteNumber(value, context);\n return Object.freeze({ min: value, max: value, dynamic: false });\n }\n if (value === null || typeof value !== 'object') {\n particleDefinitionError(context, 'must be a finite particle scalar', value);\n }\n return descriptorScalarRange(value, parameters, context);\n}\n\nexport function validateScalarVector(\n value: unknown,\n dimension: 2,\n parameters: PibblParticleParameterDefinitions,\n context: ParticleValidationContext,\n): readonly ParticleScalarRange[] {\n if (!Array.isArray(value)) {\n const descriptor = getParticleDescriptorRecord(value);\n if (descriptor?.type !== 'parameter') {\n particleDefinitionError(context, `must be a ${dimension}-dimensional particle vector`, value);\n }\n const definition = parameters[descriptor.name];\n if (definition === undefined) {\n particleDefinitionError(context, 'references an unknown parameter', descriptor.name);\n }\n if (definition.type !== 'vector2') {\n particleDefinitionError(\n context,\n `parameter \"${descriptor.name}\" has type ${definition.type}; expected a ${dimension}-dimensional vector parameter`,\n );\n }\n return Object.freeze(definition.default.map(entry => Object.freeze({\n min: entry,\n max: entry,\n dynamic: true,\n })));\n }\n if (value.length !== dimension) {\n particleDefinitionError(context, `must be a ${dimension}-dimensional particle vector`, value);\n }\n return Object.freeze(value.map((entry, index) => particleScalarRange(\n entry as PibblParticleScalar,\n parameters,\n { ...context, property: `${context.property ?? 'value'}[${index}]` },\n )));\n}\n\nfunction validateRepeat(\n repeat: { readonly everyMilliseconds: number; readonly count: number } | undefined,\n context: ParticleValidationContext,\n): void {\n if (repeat === undefined) return;\n if (repeat === null || typeof repeat !== 'object') {\n particleDefinitionError(context, 'must be a record', repeat);\n }\n assertPositiveNumber(repeat.everyMilliseconds, {\n ...context, property: `${context.property}.everyMilliseconds`,\n });\n if (!Number.isSafeInteger(repeat.count) || repeat.count <= 0) {\n particleDefinitionError(\n { ...context, property: `${context.property}.count` },\n 'must be a positive safe integer',\n repeat.count,\n RangeError,\n );\n }\n}\n\nfunction validateProbability(value: number | undefined, context: ParticleValidationContext): void {\n if (value === undefined) return;\n assertFiniteNumber(value, context);\n if (value < 0 || value > 1) {\n particleDefinitionError(context, 'must be within [0, 1]', value, RangeError);\n }\n}\n\nfunction validateCount(\n value: number | PibblParticleScalar,\n context: ParticleValidationContext,\n): void {\n if (typeof value === 'number') {\n if (!Number.isSafeInteger(value) || value <= 0) {\n particleDefinitionError(context, 'must be a positive safe integer', value, RangeError);\n }\n return;\n }\n const descriptor = getParticleDescriptorRecord(value);\n if (descriptor?.type !== 'integer' || descriptor.min <= 0) {\n particleDefinitionError(\n context,\n 'must be a positive integer or positive particleInteger range',\n value,\n RangeError,\n );\n }\n}\n\nexport function normalizeEmission(\n emission: readonly PibblParticleEmission[],\n context: ParticleValidationContext,\n): readonly PibblParticleEmission[] {\n if (!Array.isArray(emission) || emission.length === 0) {\n particleDefinitionError(\n { ...context, property: 'emission' },\n 'must be a nonempty array',\n emission,\n );\n }\n for (let index = 0; index < emission.length; index += 1) {\n const source = emission[index]!;\n if (source === null || typeof source !== 'object') {\n particleDefinitionError(\n { ...context, module: `emission[${index}]` },\n 'must be an emission record',\n source,\n );\n }\n const module = `emission[${index}] ${String((source as { type?: unknown }).type)}`;\n switch (source.type) {\n case 'rate':\n assertNonnegativeNumber(source.particlesPerSecond, {\n ...context, module, property: 'particlesPerSecond',\n });\n if (source.startMilliseconds !== undefined) {\n assertNonnegativeNumber(source.startMilliseconds, {\n ...context, module, property: 'startMilliseconds',\n });\n }\n if (source.durationMilliseconds !== undefined) {\n assertNonnegativeNumber(source.durationMilliseconds, {\n ...context, module, property: 'durationMilliseconds',\n });\n }\n validateProbability(source.probability, {\n ...context, module, property: 'probability',\n });\n validateRepeat(source.repeat, { ...context, module, property: 'repeat' });\n break;\n case 'burst':\n assertNonnegativeNumber(source.atMilliseconds, {\n ...context, module, property: 'atMilliseconds',\n });\n validateCount(source.count, { ...context, module, property: 'count' });\n validateProbability(source.probability, {\n ...context, module, property: 'probability',\n });\n validateRepeat(source.repeat, { ...context, module, property: 'repeat' });\n break;\n case 'manual':\n if (source.count !== undefined) {\n validateCount(source.count, { ...context, module, property: 'count' });\n }\n break;\n default:\n particleDefinitionError(\n { ...context, module, property: 'type' },\n 'uses an unsupported emission type',\n (source as { type?: unknown }).type,\n );\n }\n }\n return cloneParticleRecord(emission);\n}\n\nexport function validateAppearance(\n appearance: PibblParticleAppearance | undefined,\n context: ParticleValidationContext,\n): PibblParticleAppearance | undefined {\n if (appearance === undefined) return undefined;\n if (appearance === null || typeof appearance !== 'object' || Array.isArray(appearance)) {\n particleDefinitionError(\n { ...context, property: 'appearance' }, 'must be a record', appearance,\n );\n }\n for (const [property, descriptor] of Object.entries(appearance)) {\n if (descriptor === undefined) continue;\n const record = getParticleDescriptorRecord(descriptor);\n const expected = property === 'color' ? 'gradient' : 'curve';\n if (record?.type !== expected) {\n particleDefinitionError(\n { ...context, module: 'appearance', property },\n `must use particle.${expected}`,\n descriptor,\n );\n }\n }\n return cloneParticleRecord(appearance);\n}\n\nexport function normalizeBounds2D(\n bounds: PibblParticleBounds2D,\n context: ParticleValidationContext,\n): PibblParticleBounds2D {\n if (bounds === null || typeof bounds !== 'object') {\n particleDefinitionError({ ...context, property: 'bounds' }, 'must be a record', bounds);\n }\n assertFiniteVector(bounds.min, 2, { ...context, property: 'bounds.min' });\n assertFiniteVector(bounds.max, 2, { ...context, property: 'bounds.max' });\n for (let index = 0; index < 2; index += 1) {\n if (bounds.min[index]! > bounds.max[index]!) {\n particleDefinitionError(\n { ...context, property: `bounds.min[${index}]` },\n `must be at most bounds.max[${index}]`,\n bounds.min[index],\n RangeError,\n );\n }\n }\n return cloneParticleRecord(bounds);\n}\n\nexport function normalizeRenderer2D(\n renderer: PibblParticleRenderer2D,\n context: ParticleValidationContext,\n): NativeParticleRenderer2D {\n if (renderer === null || typeof renderer !== 'object') {\n particleDefinitionError(\n { ...context, property: 'renderer' }, 'must be a record', renderer,\n );\n }\n const module = `renderer ${String((renderer as { type?: unknown }).type)}`;\n const blend = renderer.blend ?? 'source-over';\n if (blend !== 'source-over' && blend !== 'additive') {\n particleDefinitionError({ ...context, module, property: 'blend' }, 'is unsupported', blend);\n }\n switch (renderer.type) {\n case 'circle':\n return Object.freeze({ type: 'circle', blend });\n case 'rectangle':\n if (renderer.aspectRatio !== undefined) {\n assertPositiveNumber(renderer.aspectRatio, {\n ...context, module, property: 'aspectRatio',\n });\n }\n return Object.freeze({\n type: 'rectangle',\n ...(renderer.aspectRatio === undefined ? {} : { aspectRatio: renderer.aspectRatio }),\n blend,\n });\n case 'path':\n if (renderer.path instanceof PathGeometry) {\n return Object.freeze({ type: 'path', path: toPath2D(renderer.path), blend });\n }\n if (typeof Path2D === 'undefined' || !(renderer.path instanceof Path2D)) {\n particleDefinitionError({ ...context, module, property: 'path' }, 'must be a Path2D or PathGeometry', renderer.path);\n }\n return Object.freeze({ type: 'path', path: new Path2D(renderer.path), blend });\n case 'sprite':\n if (renderer.source === null ||\n (typeof renderer.source !== 'object' && typeof renderer.source !== 'function')) {\n particleDefinitionError(\n { ...context, module, property: 'source' },\n 'must be a CanvasImageSource',\n renderer.source,\n );\n }\n if (renderer.anchor !== undefined) {\n assertFiniteVector(renderer.anchor, 2, { ...context, module, property: 'anchor' });\n }\n return Object.freeze({\n type: 'sprite',\n source: renderer.source,\n ...(renderer.anchor === undefined ? {} : {\n anchor: cloneParticleRecord(renderer.anchor),\n }),\n blend,\n });\n default:\n particleDefinitionError(\n { ...context, module, property: 'type' },\n 'uses an unsupported Canvas renderer',\n (renderer as { type?: unknown }).type,\n );\n }\n}\n\nexport function createParticleEffect2D(\n record: ParticleEffect2DRecord,\n): PibblParticleEffect2D {\n const effect = Object.freeze({ dimension: 2 as const }) as PibblParticleEffect2D;\n effect2DRecords.set(effect, freezeParticleRecord(record));\n return effect;\n}\n\n/** @internal Returns the immutable normalized record for a package-created 2D effect. */\nexport function getParticleEffect2DRecord(effect: PibblParticleEffect2D): ParticleEffect2DRecord {\n const record = effect2DRecords.get(effect);\n if (record === undefined) {\n throw new TypeError('Expected a 2D particle effect created by defineParticleEffect2D().');\n }\n return record;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc,gBAAgB;AAYvC,SAAS,mCAAmC;AA0C5C,MAAM,kBAAkB,oBAAI,QAAuD;AAEnF,SAAS,YAAY,WAAuC;AAC1D,SAAO,cAAc,SAAY,0BAC/B,0BAA0B,SAAS;AACvC;AAEA,SAAS,WAAW,OAAwB;AAC1C,MAAI,OAAO,UAAU,SAAU,QAAO,IAAI,KAAK;AAC/C,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,SAAS,MAAM;AAC5E,WAAO,OAAO,KAAK;AAAA,EACrB;AACA,MAAI;AACF,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B,QAAQ;AACN,WAAO,OAAO,UAAU,SAAS,KAAK,KAAK;AAAA,EAC7C;AACF;AAEO,SAAS,wBACd,SACA,SACA,OACA,mBAAyD,WAClD;AACP,QAAM,OAAO;AAAA,IACX,YAAY,QAAQ,SAAS;AAAA,IAC7B,QAAQ,YAAY,SAAY,SAAY,YAAY,QAAQ,OAAO;AAAA,IACvE,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV,EAAE,OAAO,CAAC,SAAyB,SAAS,MAAS,EAAE,KAAK,GAAG;AAC/D,QAAM,WAAW,UAAU,UAAU,IAAI,cAAc,WAAW,KAAK,CAAC,KAAK;AAC7E,QAAM,IAAI,iBAAiB,GAAG,IAAI,IAAI,OAAO,GAAG,QAAQ,GAAG;AAC7D;AAEO,SAAS,mBACd,OACA,SACyB;AACzB,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG;AACxD,4BAAwB,SAA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