@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,704 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Arc,
|
|
3
|
+
Circle,
|
|
4
|
+
Ellipse,
|
|
5
|
+
Group,
|
|
6
|
+
HorizontalLine,
|
|
7
|
+
Image,
|
|
8
|
+
Line,
|
|
9
|
+
Path,
|
|
10
|
+
Polygon,
|
|
11
|
+
Rectangle,
|
|
12
|
+
RegularPolygon,
|
|
13
|
+
Star,
|
|
14
|
+
SvgPath,
|
|
15
|
+
Text,
|
|
16
|
+
VerticalLine,
|
|
17
|
+
Wedge
|
|
18
|
+
} from "@pibbl/core";
|
|
19
|
+
import {
|
|
20
|
+
arcShape2D,
|
|
21
|
+
boxShape2D,
|
|
22
|
+
chainShape2D,
|
|
23
|
+
circleShape2D,
|
|
24
|
+
ellipseShape2D,
|
|
25
|
+
polygonShape2D,
|
|
26
|
+
roundedBoxShape2D,
|
|
27
|
+
wedgeShape2D
|
|
28
|
+
} from "../shapes.js";
|
|
29
|
+
import {
|
|
30
|
+
canonicalizeContour2D,
|
|
31
|
+
polygonMassData2D,
|
|
32
|
+
triangulateContour2D
|
|
33
|
+
} from "../math.js";
|
|
34
|
+
import {
|
|
35
|
+
createShape2D,
|
|
36
|
+
requireShapeRecord2D
|
|
37
|
+
} from "../shape-records.js";
|
|
38
|
+
const customShapeResolvers2D = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
function installCustomShapeResolver2D(component, resolver) {
|
|
40
|
+
if (customShapeResolvers2D.has(component)) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
"A Pibbl primitive may have only one physics 2D shape resolver."
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
customShapeResolvers2D.set(component, resolver);
|
|
46
|
+
}
|
|
47
|
+
function inferCanvasColliderShape2D(input) {
|
|
48
|
+
const { componentType, componentName, style } = input;
|
|
49
|
+
const customResolver = customShapeResolvers2D.get(componentType);
|
|
50
|
+
if (customResolver) return requireShape(customResolver(style), componentName);
|
|
51
|
+
if (componentType === Rectangle) {
|
|
52
|
+
const width = positive(style, "width", componentName), height = positive(style, "height", componentName);
|
|
53
|
+
const center = [width / 2, height / 2];
|
|
54
|
+
const radii = resolvedRadii(style, 4);
|
|
55
|
+
return radii.some((radius) => radius > 0) ? roundedBoxShape2D({
|
|
56
|
+
width,
|
|
57
|
+
height,
|
|
58
|
+
center,
|
|
59
|
+
radius: radii
|
|
60
|
+
}) : boxShape2D({ width, height, center });
|
|
61
|
+
}
|
|
62
|
+
if (componentType === Circle) {
|
|
63
|
+
return circleShape2D({
|
|
64
|
+
center: [number(style, "cx", 0), number(style, "cy", 0)],
|
|
65
|
+
radius: positive(style, "radius", componentName)
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (componentType === Ellipse) {
|
|
69
|
+
return ellipseShape2D({
|
|
70
|
+
center: [number(style, "cx", 0), number(style, "cy", 0)],
|
|
71
|
+
radiusX: positive(style, "radiusX", componentName),
|
|
72
|
+
radiusY: positive(style, "radiusY", componentName),
|
|
73
|
+
rotationDegrees: number(style, "rotation", 0) * 180 / Math.PI
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (componentType === Arc) {
|
|
77
|
+
return arcShape2D({
|
|
78
|
+
center: [number(style, "cx", 0), number(style, "cy", 0)],
|
|
79
|
+
radius: positive(style, "radius", componentName),
|
|
80
|
+
startAngleRadians: number(style, "startAngle"),
|
|
81
|
+
endAngleRadians: number(style, "endAngle"),
|
|
82
|
+
counterclockwise: style.counterclockwise === true,
|
|
83
|
+
thickness: positive(style, "strokeWidth", componentName)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (componentType === Wedge) {
|
|
87
|
+
return wedgeShape2D({
|
|
88
|
+
center: [number(style, "cx", 0), number(style, "cy", 0)],
|
|
89
|
+
radius: positive(style, "radius", componentName),
|
|
90
|
+
startAngleRadians: number(style, "startAngle"),
|
|
91
|
+
endAngleRadians: number(style, "endAngle"),
|
|
92
|
+
counterclockwise: style.counterclockwise === true
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (componentType === Polygon) {
|
|
96
|
+
const vertices = points(style.coords, `${componentName}.coords`);
|
|
97
|
+
const radii = resolvedRadii(style, vertices.length);
|
|
98
|
+
return shapeFromClosedContour(
|
|
99
|
+
roundedContour(vertices, radii),
|
|
100
|
+
`${componentName}.coords`,
|
|
101
|
+
radii.some((radius) => radius > 0)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
if (componentType === RegularPolygon) {
|
|
105
|
+
const sides = integer(style, "sides", 3, componentName);
|
|
106
|
+
const radius = regularPolygonRadius(style, sides, componentName);
|
|
107
|
+
const cx = number(style, "cx", 0), cy = number(style, "cy", 0), rotation = number(style, "rotation", -Math.PI / 2);
|
|
108
|
+
const vertices = Array.from({ length: sides }, (_, index) => {
|
|
109
|
+
const angle = rotation + index * Math.PI * 2 / sides;
|
|
110
|
+
return [
|
|
111
|
+
cx + radius * Math.cos(angle),
|
|
112
|
+
cy + radius * Math.sin(angle)
|
|
113
|
+
];
|
|
114
|
+
});
|
|
115
|
+
const radii = resolvedRadii(style, sides);
|
|
116
|
+
return shapeFromClosedContour(
|
|
117
|
+
roundedContour(vertices, radii),
|
|
118
|
+
`${componentName}.vertices`,
|
|
119
|
+
radii.some((value) => value > 0)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
if (componentType === Star) {
|
|
123
|
+
const count = integer(style, "points", 3, componentName);
|
|
124
|
+
const outer = positive(style, "outerRadius", componentName), inner = positive(style, "innerRadius", componentName);
|
|
125
|
+
if (inner > outer)
|
|
126
|
+
throw new RangeError(
|
|
127
|
+
`${componentName}.innerRadius must not exceed outerRadius.`
|
|
128
|
+
);
|
|
129
|
+
const cx = number(style, "cx", 0), cy = number(style, "cy", 0), rotation = number(style, "rotation", -Math.PI / 2);
|
|
130
|
+
const vertices = Array.from({ length: count * 2 }, (_, index) => {
|
|
131
|
+
const angle = rotation + index * Math.PI / count;
|
|
132
|
+
const radius = index % 2 === 0 ? outer : inner;
|
|
133
|
+
return [
|
|
134
|
+
cx + radius * Math.cos(angle),
|
|
135
|
+
cy + radius * Math.sin(angle)
|
|
136
|
+
];
|
|
137
|
+
});
|
|
138
|
+
const radii = resolvedRadii(style, count * 2);
|
|
139
|
+
return shapeFromClosedContour(
|
|
140
|
+
roundedContour(vertices, radii),
|
|
141
|
+
`${componentName}.vertices`,
|
|
142
|
+
true
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
if (componentType === Line)
|
|
146
|
+
return lineShape(
|
|
147
|
+
points(style.coords, `${componentName}.coords`),
|
|
148
|
+
number(style, "strokeWidth", 0)
|
|
149
|
+
);
|
|
150
|
+
if (componentType === HorizontalLine) {
|
|
151
|
+
const y = number(style, "y");
|
|
152
|
+
return lineShape(
|
|
153
|
+
[
|
|
154
|
+
[number(style, "x1", 0), y],
|
|
155
|
+
[number(style, "x2"), y]
|
|
156
|
+
],
|
|
157
|
+
number(style, "strokeWidth", 0)
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
if (componentType === VerticalLine) {
|
|
161
|
+
const x = number(style, "x");
|
|
162
|
+
return lineShape(
|
|
163
|
+
[
|
|
164
|
+
[x, number(style, "y1", 0)],
|
|
165
|
+
[x, number(style, "y2")]
|
|
166
|
+
],
|
|
167
|
+
number(style, "strokeWidth", 0)
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
if (componentType === SvgPath) return inferSvgPath(style, componentName);
|
|
171
|
+
if (componentType === Path)
|
|
172
|
+
throw explicitShapeError(
|
|
173
|
+
componentName,
|
|
174
|
+
"its opaque Path2D commands cannot be inspected"
|
|
175
|
+
);
|
|
176
|
+
if (componentType === Text || componentType === Image) {
|
|
177
|
+
if (typeof style.width !== "number" || typeof style.height !== "number") {
|
|
178
|
+
throw explicitShapeError(
|
|
179
|
+
componentName,
|
|
180
|
+
"stable width and height are not declared"
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
const width = positive(style, "width", componentName), height = positive(style, "height", componentName);
|
|
184
|
+
return boxShape2D({ width, height, center: [width / 2, height / 2] });
|
|
185
|
+
}
|
|
186
|
+
if (componentType === Group)
|
|
187
|
+
throw explicitShapeError(
|
|
188
|
+
componentName,
|
|
189
|
+
"Group has no self geometry; attach colliders to physical descendants"
|
|
190
|
+
);
|
|
191
|
+
throw explicitShapeError(
|
|
192
|
+
componentName,
|
|
193
|
+
"the primitive has no stable physics shape adapter"
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function bakeCanvasShapeTransform2D(shape, transform) {
|
|
197
|
+
if (isIdentity(transform)) return shape;
|
|
198
|
+
const source = requireShapeRecord2D(shape);
|
|
199
|
+
const local = new DOMMatrix().translate(source.localPose.x, source.localPose.y).rotate(source.localPose.rotationRadians * 180 / Math.PI);
|
|
200
|
+
const combined = new DOMMatrix([
|
|
201
|
+
transform.a,
|
|
202
|
+
transform.b,
|
|
203
|
+
transform.c,
|
|
204
|
+
transform.d,
|
|
205
|
+
transform.e,
|
|
206
|
+
transform.f
|
|
207
|
+
]).multiply(local);
|
|
208
|
+
const parts = [];
|
|
209
|
+
for (const leaf of source.leaves) {
|
|
210
|
+
if (leaf.kind === "segment") {
|
|
211
|
+
parts.push(
|
|
212
|
+
chainShape2D({
|
|
213
|
+
points: [
|
|
214
|
+
transformPoint(combined, leaf.start),
|
|
215
|
+
transformPoint(combined, leaf.end)
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const contour = leafContour(leaf).map(
|
|
222
|
+
(point) => transformPoint(combined, point)
|
|
223
|
+
);
|
|
224
|
+
parts.push(
|
|
225
|
+
shapeFromClosedContour(
|
|
226
|
+
contour,
|
|
227
|
+
"transformed collider contour",
|
|
228
|
+
leaf.kind === "rounded-box" || leaf.kind === "capsule"
|
|
229
|
+
)
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
return combineShapes(parts);
|
|
233
|
+
}
|
|
234
|
+
function inferSvgPath(style, componentName) {
|
|
235
|
+
if (typeof style.d !== "string")
|
|
236
|
+
throw explicitShapeError(componentName, "SVG path data is not a string");
|
|
237
|
+
const contours = parseSvgContours(style.d, componentName);
|
|
238
|
+
if (contours.length !== 1)
|
|
239
|
+
throw explicitShapeError(
|
|
240
|
+
componentName,
|
|
241
|
+
"multiple SVG contours have ambiguous fill or winding semantics"
|
|
242
|
+
);
|
|
243
|
+
const contour = contours[0];
|
|
244
|
+
if (contour.closed) {
|
|
245
|
+
if (style.fill === void 0)
|
|
246
|
+
throw explicitShapeError(
|
|
247
|
+
componentName,
|
|
248
|
+
"a closed SVG contour without a resolved fill is ambiguous"
|
|
249
|
+
);
|
|
250
|
+
try {
|
|
251
|
+
return shapeFromClosedContour(contour.points, `${componentName}.d`);
|
|
252
|
+
} catch {
|
|
253
|
+
throw explicitShapeError(
|
|
254
|
+
componentName,
|
|
255
|
+
"its SVG contour is self-intersecting, degenerate, or cannot be decomposed deterministically"
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (style.fill !== void 0)
|
|
260
|
+
throw explicitShapeError(
|
|
261
|
+
componentName,
|
|
262
|
+
"an open filled SVG contour is ambiguous"
|
|
263
|
+
);
|
|
264
|
+
try {
|
|
265
|
+
return lineShape(contour.points, number(style, "strokeWidth", 0));
|
|
266
|
+
} catch {
|
|
267
|
+
throw explicitShapeError(
|
|
268
|
+
componentName,
|
|
269
|
+
"its open SVG contour is degenerate or has an invalid resolved stroke width"
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function lineShape(source, strokeWidth) {
|
|
274
|
+
if (source.length < 2)
|
|
275
|
+
throw new RangeError("A line collider requires at least two points.");
|
|
276
|
+
if (!Number.isFinite(strokeWidth) || strokeWidth < 0)
|
|
277
|
+
throw new TypeError(
|
|
278
|
+
"Resolved strokeWidth must be a finite nonnegative number."
|
|
279
|
+
);
|
|
280
|
+
return chainShape2D({ points: source, radius: strokeWidth / 2 });
|
|
281
|
+
}
|
|
282
|
+
function shapeFromClosedContour(source, path, forceCompound = false) {
|
|
283
|
+
if (!forceCompound) {
|
|
284
|
+
try {
|
|
285
|
+
return polygonShape2D({ points: source });
|
|
286
|
+
} catch {
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
{
|
|
290
|
+
const contour = canonicalizeContour2D(source, {
|
|
291
|
+
strictlyConvex: false,
|
|
292
|
+
path
|
|
293
|
+
});
|
|
294
|
+
const triangles = triangulateContour2D(contour);
|
|
295
|
+
const leaves = triangles.map(
|
|
296
|
+
(vertices, canonicalLeafIndex) => Object.freeze({ kind: "polygon", vertices, canonicalLeafIndex })
|
|
297
|
+
);
|
|
298
|
+
const entries = leaves.map((leaf) => polygonMassData2D(leaf.vertices));
|
|
299
|
+
const area = entries.reduce((sum, entry) => sum + entry.area, 0);
|
|
300
|
+
const centroidX = entries.reduce((sum, entry) => sum + entry.area * entry.centroidX, 0) / area;
|
|
301
|
+
const centroidY = entries.reduce((sum, entry) => sum + entry.area * entry.centroidY, 0) / area;
|
|
302
|
+
const unitInertia = entries.reduce((sum, entry) => {
|
|
303
|
+
const dx = entry.centroidX - centroidX, dy = entry.centroidY - centroidY;
|
|
304
|
+
return sum + entry.unitInertia + entry.area * (dx * dx + dy * dy);
|
|
305
|
+
}, 0);
|
|
306
|
+
const xs = leaves.flatMap(
|
|
307
|
+
(leaf) => Array.from(leaf.vertices).filter((_, index) => index % 2 === 0)
|
|
308
|
+
);
|
|
309
|
+
const ys = leaves.flatMap(
|
|
310
|
+
(leaf) => Array.from(leaf.vertices).filter((_, index) => index % 2 === 1)
|
|
311
|
+
);
|
|
312
|
+
return createShape2D({
|
|
313
|
+
leaves,
|
|
314
|
+
localBounds: new Float64Array([
|
|
315
|
+
Math.min(...xs),
|
|
316
|
+
Math.min(...ys),
|
|
317
|
+
Math.max(...xs),
|
|
318
|
+
Math.max(...ys)
|
|
319
|
+
]),
|
|
320
|
+
area,
|
|
321
|
+
centroidX,
|
|
322
|
+
centroidY,
|
|
323
|
+
unitInertia
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function combineShapes(shapes) {
|
|
328
|
+
if (shapes.length === 1) return shapes[0];
|
|
329
|
+
const records = shapes.map(requireShapeRecord2D);
|
|
330
|
+
const leaves = records.flatMap((record) => record.leaves);
|
|
331
|
+
const area = records.reduce((sum, record) => sum + record.area, 0);
|
|
332
|
+
const centroidX = area === 0 ? 0 : records.reduce(
|
|
333
|
+
(sum, record) => sum + record.area * record.centroidX,
|
|
334
|
+
0
|
|
335
|
+
) / area;
|
|
336
|
+
const centroidY = area === 0 ? 0 : records.reduce(
|
|
337
|
+
(sum, record) => sum + record.area * record.centroidY,
|
|
338
|
+
0
|
|
339
|
+
) / area;
|
|
340
|
+
const unitInertia = records.reduce((sum, record) => {
|
|
341
|
+
const dx = record.centroidX - centroidX, dy = record.centroidY - centroidY;
|
|
342
|
+
return sum + record.unitInertia + record.area * (dx * dx + dy * dy);
|
|
343
|
+
}, 0);
|
|
344
|
+
return createShape2D({
|
|
345
|
+
leaves,
|
|
346
|
+
localBounds: new Float64Array([
|
|
347
|
+
Math.min(...records.map((record) => record.localBounds[0])),
|
|
348
|
+
Math.min(...records.map((record) => record.localBounds[1])),
|
|
349
|
+
Math.max(...records.map((record) => record.localBounds[2])),
|
|
350
|
+
Math.max(...records.map((record) => record.localBounds[3]))
|
|
351
|
+
]),
|
|
352
|
+
area,
|
|
353
|
+
centroidX,
|
|
354
|
+
centroidY,
|
|
355
|
+
unitInertia
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function leafContour(leaf) {
|
|
359
|
+
switch (leaf.kind) {
|
|
360
|
+
case "circle":
|
|
361
|
+
return ellipseContour(leaf.center, leaf.radius, leaf.radius, 0);
|
|
362
|
+
case "ellipse":
|
|
363
|
+
return ellipseContour(
|
|
364
|
+
leaf.center,
|
|
365
|
+
leaf.radiusX,
|
|
366
|
+
leaf.radiusY,
|
|
367
|
+
leaf.rotationRadians
|
|
368
|
+
);
|
|
369
|
+
case "box":
|
|
370
|
+
return [
|
|
371
|
+
[leaf.center[0] - leaf.halfWidth, leaf.center[1] - leaf.halfHeight],
|
|
372
|
+
[leaf.center[0] + leaf.halfWidth, leaf.center[1] - leaf.halfHeight],
|
|
373
|
+
[leaf.center[0] + leaf.halfWidth, leaf.center[1] + leaf.halfHeight],
|
|
374
|
+
[leaf.center[0] - leaf.halfWidth, leaf.center[1] + leaf.halfHeight]
|
|
375
|
+
];
|
|
376
|
+
case "rounded-box": {
|
|
377
|
+
const cx = leaf.center[0], cy = leaf.center[1];
|
|
378
|
+
const corners = [
|
|
379
|
+
[
|
|
380
|
+
cx + leaf.halfWidth - leaf.radii[1],
|
|
381
|
+
cy - leaf.halfHeight + leaf.radii[1],
|
|
382
|
+
-Math.PI / 2,
|
|
383
|
+
0,
|
|
384
|
+
leaf.radii[1]
|
|
385
|
+
],
|
|
386
|
+
[
|
|
387
|
+
cx + leaf.halfWidth - leaf.radii[2],
|
|
388
|
+
cy + leaf.halfHeight - leaf.radii[2],
|
|
389
|
+
0,
|
|
390
|
+
Math.PI / 2,
|
|
391
|
+
leaf.radii[2]
|
|
392
|
+
],
|
|
393
|
+
[
|
|
394
|
+
cx - leaf.halfWidth + leaf.radii[3],
|
|
395
|
+
cy + leaf.halfHeight - leaf.radii[3],
|
|
396
|
+
Math.PI / 2,
|
|
397
|
+
Math.PI,
|
|
398
|
+
leaf.radii[3]
|
|
399
|
+
],
|
|
400
|
+
[
|
|
401
|
+
cx - leaf.halfWidth + leaf.radii[0],
|
|
402
|
+
cy - leaf.halfHeight + leaf.radii[0],
|
|
403
|
+
Math.PI,
|
|
404
|
+
Math.PI * 1.5,
|
|
405
|
+
leaf.radii[0]
|
|
406
|
+
]
|
|
407
|
+
];
|
|
408
|
+
return corners.flatMap(
|
|
409
|
+
([x, y, start, end, radius]) => arcContour(x, y, radius, start, end, 8)
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
case "capsule": {
|
|
413
|
+
const angle = Math.atan2(
|
|
414
|
+
leaf.end[1] - leaf.start[1],
|
|
415
|
+
leaf.end[0] - leaf.start[0]
|
|
416
|
+
);
|
|
417
|
+
return [
|
|
418
|
+
...arcContour(
|
|
419
|
+
leaf.end[0],
|
|
420
|
+
leaf.end[1],
|
|
421
|
+
leaf.radius,
|
|
422
|
+
angle - Math.PI / 2,
|
|
423
|
+
angle + Math.PI / 2,
|
|
424
|
+
16
|
|
425
|
+
),
|
|
426
|
+
...arcContour(
|
|
427
|
+
leaf.start[0],
|
|
428
|
+
leaf.start[1],
|
|
429
|
+
leaf.radius,
|
|
430
|
+
angle + Math.PI / 2,
|
|
431
|
+
angle + Math.PI * 1.5,
|
|
432
|
+
16
|
|
433
|
+
)
|
|
434
|
+
];
|
|
435
|
+
}
|
|
436
|
+
case "polygon": {
|
|
437
|
+
const result = [];
|
|
438
|
+
for (let index = 0; index < leaf.vertices.length; index += 2)
|
|
439
|
+
result.push([leaf.vertices[index], leaf.vertices[index + 1]]);
|
|
440
|
+
return result;
|
|
441
|
+
}
|
|
442
|
+
case "segment":
|
|
443
|
+
return [];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
function ellipseContour(center, radiusX, radiusY, rotation) {
|
|
447
|
+
const cosine = Math.cos(rotation), sine = Math.sin(rotation);
|
|
448
|
+
return Array.from({ length: 32 }, (_, index) => {
|
|
449
|
+
const angle = index * Math.PI * 2 / 32, x = radiusX * Math.cos(angle), y = radiusY * Math.sin(angle);
|
|
450
|
+
return [
|
|
451
|
+
center[0] + x * cosine - y * sine,
|
|
452
|
+
center[1] + x * sine + y * cosine
|
|
453
|
+
];
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function arcContour(cx, cy, radius, start, end, steps) {
|
|
457
|
+
if (radius === 0) return [[cx, cy]];
|
|
458
|
+
return Array.from({ length: steps + 1 }, (_, index) => {
|
|
459
|
+
const angle = start + (end - start) * index / steps;
|
|
460
|
+
return [
|
|
461
|
+
cx + radius * Math.cos(angle),
|
|
462
|
+
cy + radius * Math.sin(angle)
|
|
463
|
+
];
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
function transformPoint(matrix, point) {
|
|
467
|
+
return [
|
|
468
|
+
matrix.a * point[0] + matrix.c * point[1] + matrix.e,
|
|
469
|
+
matrix.b * point[0] + matrix.d * point[1] + matrix.f
|
|
470
|
+
];
|
|
471
|
+
}
|
|
472
|
+
function isIdentity(matrix) {
|
|
473
|
+
return matrix.a === 1 && matrix.b === 0 && matrix.c === 0 && matrix.d === 1 && matrix.e === 0 && matrix.f === 0;
|
|
474
|
+
}
|
|
475
|
+
function roundedContour(source, radii) {
|
|
476
|
+
if (radii.every((radius) => radius === 0))
|
|
477
|
+
return source.map((point) => [point[0], point[1]]);
|
|
478
|
+
const corners = source.map((point, index) => {
|
|
479
|
+
const previous = source[(index + source.length - 1) % source.length], next = source[(index + 1) % source.length];
|
|
480
|
+
const previousLength = Math.hypot(
|
|
481
|
+
previous[0] - point[0],
|
|
482
|
+
previous[1] - point[1]
|
|
483
|
+
);
|
|
484
|
+
const nextLength = Math.hypot(next[0] - point[0], next[1] - point[1]);
|
|
485
|
+
const previousUnit = [
|
|
486
|
+
(previous[0] - point[0]) / previousLength,
|
|
487
|
+
(previous[1] - point[1]) / previousLength
|
|
488
|
+
];
|
|
489
|
+
const nextUnit = [
|
|
490
|
+
(next[0] - point[0]) / nextLength,
|
|
491
|
+
(next[1] - point[1]) / nextLength
|
|
492
|
+
];
|
|
493
|
+
const dot = Math.max(
|
|
494
|
+
-1,
|
|
495
|
+
Math.min(
|
|
496
|
+
1,
|
|
497
|
+
previousUnit[0] * nextUnit[0] + previousUnit[1] * nextUnit[1]
|
|
498
|
+
)
|
|
499
|
+
);
|
|
500
|
+
return {
|
|
501
|
+
point,
|
|
502
|
+
previousUnit,
|
|
503
|
+
nextUnit,
|
|
504
|
+
demand: radii[index] / Math.tan(Math.acos(dot) / 2),
|
|
505
|
+
radius: radii[index],
|
|
506
|
+
previousLength
|
|
507
|
+
};
|
|
508
|
+
});
|
|
509
|
+
const scale = corners.reduce((current, corner, index) => {
|
|
510
|
+
const demand = corner.demand + corners[(index + 1) % corners.length].demand;
|
|
511
|
+
return demand > 0 ? Math.min(
|
|
512
|
+
current,
|
|
513
|
+
corners[(index + 1) % corners.length].previousLength / demand
|
|
514
|
+
) : current;
|
|
515
|
+
}, 1);
|
|
516
|
+
const output = [];
|
|
517
|
+
for (const corner of corners) {
|
|
518
|
+
const demand = corner.demand * scale;
|
|
519
|
+
if (corner.radius === 0 || !Number.isFinite(demand)) {
|
|
520
|
+
output.push([corner.point[0], corner.point[1]]);
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
const start = [
|
|
524
|
+
corner.point[0] + corner.previousUnit[0] * demand,
|
|
525
|
+
corner.point[1] + corner.previousUnit[1] * demand
|
|
526
|
+
];
|
|
527
|
+
const end = [
|
|
528
|
+
corner.point[0] + corner.nextUnit[0] * demand,
|
|
529
|
+
corner.point[1] + corner.nextUnit[1] * demand
|
|
530
|
+
];
|
|
531
|
+
output.push(start);
|
|
532
|
+
appendQuadratic(output, start, corner.point, end, 0);
|
|
533
|
+
}
|
|
534
|
+
return output;
|
|
535
|
+
}
|
|
536
|
+
function appendQuadratic(output, start, control, end, depth) {
|
|
537
|
+
const midpoint = [
|
|
538
|
+
(start[0] + 2 * control[0] + end[0]) / 4,
|
|
539
|
+
(start[1] + 2 * control[1] + end[1]) / 4
|
|
540
|
+
];
|
|
541
|
+
const chord = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2];
|
|
542
|
+
if (Math.hypot(midpoint[0] - chord[0], midpoint[1] - chord[1]) <= 0.05 || depth >= 12) {
|
|
543
|
+
output.push([end[0], end[1]]);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const firstControl = midpointOf(start, control), secondControl = midpointOf(control, end);
|
|
547
|
+
appendQuadratic(output, start, firstControl, midpoint, depth + 1);
|
|
548
|
+
appendQuadratic(output, midpoint, secondControl, end, depth + 1);
|
|
549
|
+
}
|
|
550
|
+
function parseSvgContours(data, componentName) {
|
|
551
|
+
const tokens = data.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g) ?? [];
|
|
552
|
+
const contours = [];
|
|
553
|
+
let output = [], closed = false, command = "", index = 0;
|
|
554
|
+
let current = [0, 0], start = [0, 0];
|
|
555
|
+
const finish = () => {
|
|
556
|
+
if (output.length > 0) contours.push({ points: output, closed });
|
|
557
|
+
output = [];
|
|
558
|
+
closed = false;
|
|
559
|
+
};
|
|
560
|
+
const read = () => {
|
|
561
|
+
const value = Number(tokens[index++]);
|
|
562
|
+
if (!Number.isFinite(value))
|
|
563
|
+
throw explicitShapeError(componentName, "SVG path data is malformed");
|
|
564
|
+
return value;
|
|
565
|
+
};
|
|
566
|
+
while (index < tokens.length) {
|
|
567
|
+
if (/^[a-zA-Z]$/.test(tokens[index])) command = tokens[index++];
|
|
568
|
+
if (!command)
|
|
569
|
+
throw explicitShapeError(
|
|
570
|
+
componentName,
|
|
571
|
+
"SVG path data must begin with a command"
|
|
572
|
+
);
|
|
573
|
+
const relative = command === command.toLowerCase(), upper = command.toUpperCase();
|
|
574
|
+
const point = (x, y) => relative ? [current[0] + x, current[1] + y] : [x, y];
|
|
575
|
+
if (upper === "M") {
|
|
576
|
+
finish();
|
|
577
|
+
current = point(read(), read());
|
|
578
|
+
start = current;
|
|
579
|
+
output.push(current);
|
|
580
|
+
command = relative ? "l" : "L";
|
|
581
|
+
} else if (upper === "L") {
|
|
582
|
+
current = point(read(), read());
|
|
583
|
+
output.push(current);
|
|
584
|
+
} else if (upper === "H") {
|
|
585
|
+
current = relative ? [current[0] + read(), current[1]] : [read(), current[1]];
|
|
586
|
+
output.push(current);
|
|
587
|
+
} else if (upper === "V") {
|
|
588
|
+
current = relative ? [current[0], current[1] + read()] : [current[0], read()];
|
|
589
|
+
output.push(current);
|
|
590
|
+
} else if (upper === "Q") {
|
|
591
|
+
const control = point(read(), read()), end = point(read(), read());
|
|
592
|
+
appendQuadratic(output, current, control, end, 0);
|
|
593
|
+
current = end;
|
|
594
|
+
} else if (upper === "C") {
|
|
595
|
+
const first = point(read(), read()), second = point(read(), read()), end = point(read(), read());
|
|
596
|
+
appendCubic(output, current, first, second, end, 0);
|
|
597
|
+
current = end;
|
|
598
|
+
} else if (upper === "Z") {
|
|
599
|
+
closed = true;
|
|
600
|
+
current = start;
|
|
601
|
+
command = "";
|
|
602
|
+
} else
|
|
603
|
+
throw explicitShapeError(
|
|
604
|
+
componentName,
|
|
605
|
+
`SVG command ${command} is not supported for deterministic collider inference`
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
finish();
|
|
609
|
+
return contours;
|
|
610
|
+
}
|
|
611
|
+
function appendCubic(output, start, first, second, end, depth) {
|
|
612
|
+
const error = Math.max(
|
|
613
|
+
pointLineDistance(first, start, end),
|
|
614
|
+
pointLineDistance(second, start, end)
|
|
615
|
+
);
|
|
616
|
+
if (error <= 0.05 || depth >= 12) {
|
|
617
|
+
output.push([end[0], end[1]]);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const a = midpointOf(start, first), b = midpointOf(first, second), c = midpointOf(second, end), d = midpointOf(a, b), e = midpointOf(b, c), middle = midpointOf(d, e);
|
|
621
|
+
appendCubic(output, start, a, d, middle, depth + 1);
|
|
622
|
+
appendCubic(output, middle, e, c, end, depth + 1);
|
|
623
|
+
}
|
|
624
|
+
function midpointOf(a, b) {
|
|
625
|
+
return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
626
|
+
}
|
|
627
|
+
function pointLineDistance(point, start, end) {
|
|
628
|
+
const dx = end[0] - start[0], dy = end[1] - start[1], length = Math.hypot(dx, dy);
|
|
629
|
+
return length === 0 ? Math.hypot(point[0] - start[0], point[1] - start[1]) : Math.abs(
|
|
630
|
+
dy * point[0] - dx * point[1] + end[0] * start[1] - end[1] * start[0]
|
|
631
|
+
) / length;
|
|
632
|
+
}
|
|
633
|
+
function resolvedRadii(style, count) {
|
|
634
|
+
const fallback = number(style, "cornerRadius", 0), source = Array.isArray(style.cornerRadii) ? style.cornerRadii : [];
|
|
635
|
+
return Array.from({ length: count }, (_, index) => {
|
|
636
|
+
const value = source[index] ?? fallback;
|
|
637
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0)
|
|
638
|
+
throw new TypeError(
|
|
639
|
+
`cornerRadii[${index}] must be a finite nonnegative number.`
|
|
640
|
+
);
|
|
641
|
+
return value;
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
function regularPolygonRadius(style, sides, componentName) {
|
|
645
|
+
if (style.circumradius !== void 0)
|
|
646
|
+
return positive(style, "circumradius", componentName);
|
|
647
|
+
if (style.inradius !== void 0)
|
|
648
|
+
return positive(style, "inradius", componentName) / Math.cos(Math.PI / sides);
|
|
649
|
+
if (style.sideLength !== void 0)
|
|
650
|
+
return positive(style, "sideLength", componentName) / (2 * Math.sin(Math.PI / sides));
|
|
651
|
+
throw new TypeError(`${componentName} requires one resolved size.`);
|
|
652
|
+
}
|
|
653
|
+
function points(value, path) {
|
|
654
|
+
if (!Array.isArray(value))
|
|
655
|
+
throw new TypeError(`${path} must be an array of points.`);
|
|
656
|
+
return value.map((entry, index) => {
|
|
657
|
+
if (!Array.isArray(entry) || entry.length !== 2 || !entry.every((item) => typeof item === "number" && Number.isFinite(item)))
|
|
658
|
+
throw new TypeError(
|
|
659
|
+
`${path}[${index}] must be a finite two-dimensional point.`
|
|
660
|
+
);
|
|
661
|
+
return [entry[0], entry[1]];
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
function number(style, key, fallback) {
|
|
665
|
+
const value = style[key] ?? fallback;
|
|
666
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
667
|
+
throw new TypeError(`Resolved ${key} must be a finite number.`);
|
|
668
|
+
return value;
|
|
669
|
+
}
|
|
670
|
+
function positive(style, key, componentName) {
|
|
671
|
+
const value = number(style, key);
|
|
672
|
+
if (value <= 0)
|
|
673
|
+
throw new RangeError(`${componentName}.${key} must be greater than zero.`);
|
|
674
|
+
return value;
|
|
675
|
+
}
|
|
676
|
+
function integer(style, key, minimum, componentName) {
|
|
677
|
+
const value = number(style, key);
|
|
678
|
+
if (!Number.isSafeInteger(value) || value < minimum)
|
|
679
|
+
throw new RangeError(
|
|
680
|
+
`${componentName}.${key} must be a safe integer of at least ${minimum}.`
|
|
681
|
+
);
|
|
682
|
+
return value;
|
|
683
|
+
}
|
|
684
|
+
function requireShape(shape, componentName) {
|
|
685
|
+
try {
|
|
686
|
+
requireShapeRecord2D(shape);
|
|
687
|
+
return shape;
|
|
688
|
+
} catch {
|
|
689
|
+
throw new TypeError(
|
|
690
|
+
`${componentName} physics shape resolver must return a Pibbl physics 2D shape.`
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function explicitShapeError(componentName, reason) {
|
|
695
|
+
return new Error(
|
|
696
|
+
`${componentName} cannot infer a collider because ${reason}; provide an explicit shape.`
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
export {
|
|
700
|
+
bakeCanvasShapeTransform2D,
|
|
701
|
+
inferCanvasColliderShape2D,
|
|
702
|
+
installCustomShapeResolver2D
|
|
703
|
+
};
|
|
704
|
+
//# sourceMappingURL=inference.js.map
|