@adobe/data 0.5.3 → 0.5.5
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/dist/ecs/database/create-database.d.ts +2 -2
- package/dist/ecs/database/database-schema/create-database-schema-test.d.ts +1 -0
- package/dist/ecs/database/database-schema/create-database-schema-test.js +42 -0
- package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -0
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +14 -0
- package/dist/ecs/database/database-schema/create-database-schema.js +32 -0
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/database-schema.d.ts +13 -0
- package/dist/ecs/database/database-schema/database-schema.js +23 -0
- package/dist/ecs/database/database-schema/database-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/index.d.ts +2 -0
- package/dist/{services → ecs/database/database-schema}/index.js +2 -3
- package/dist/ecs/database/database-schema/index.js.map +1 -0
- package/dist/ecs/database/database.d.ts +3 -1
- package/dist/ecs/database/index.d.ts +1 -0
- package/dist/ecs/database/index.js +1 -0
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/ecs/index.d.ts +2 -1
- package/dist/ecs/index.js +2 -1
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/store/archetype-components.d.ts +3 -1
- package/dist/ecs/store/core/core.d.ts +1 -8
- package/dist/ecs/store/core/create-core.js +9 -4
- package/dist/ecs/store/core/create-core.js.map +1 -1
- package/dist/ecs/store/core/create-core.test.js +0 -109
- package/dist/ecs/store/core/create-core.test.js.map +1 -1
- package/dist/ecs/store/create-store.js +21 -0
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema-test.js +4 -7
- package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema.d.ts +2 -0
- package/dist/ecs/store/store-schema/create-store-schema.js +5 -0
- package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -1
- package/dist/ecs/store/store-schema/index.d.ts +1 -1
- package/dist/ecs/store/store-schema/index.js +1 -1
- package/dist/ecs/store/store-schema/index.js.map +1 -1
- package/dist/ecs/store/store-schema/store-schema.d.ts +1 -1
- package/dist/ecs/world/create-world.d.ts +7 -0
- package/dist/ecs/world/create-world.js +108 -0
- package/dist/ecs/world/create-world.js.map +1 -0
- package/dist/ecs/world/create-world.test.d.ts +1 -0
- package/dist/ecs/world/create-world.test.js +499 -0
- package/dist/ecs/world/create-world.test.js.map +1 -0
- package/dist/ecs/world/index.d.ts +4 -0
- package/dist/ecs/world/index.js +26 -0
- package/dist/ecs/world/index.js.map +1 -0
- package/dist/ecs/world/system.d.ts +20 -0
- package/dist/ecs/world/system.js +2 -0
- package/dist/ecs/world/system.js.map +1 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.d.ts +1 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.js +55 -0
- package/dist/ecs/world/world-schema/create-world-schema-test.js.map +1 -0
- package/dist/ecs/world/world-schema/create-world-schema.d.ts +19 -0
- package/dist/ecs/world/world-schema/create-world-schema.js +33 -0
- package/dist/ecs/world/world-schema/create-world-schema.js.map +1 -0
- package/dist/ecs/world/world-schema/index.d.ts +2 -0
- package/dist/ecs/world/world-schema/index.js +24 -0
- package/dist/ecs/world/world-schema/index.js.map +1 -0
- package/dist/ecs/world/world-schema/world-schema.d.ts +18 -0
- package/dist/ecs/world/world-schema/world-schema.js +23 -0
- package/dist/ecs/world/world-schema/world-schema.js.map +1 -0
- package/dist/ecs/world/world.d.ts +9 -0
- package/dist/ecs/world/world.js +2 -0
- package/dist/ecs/world/world.js.map +1 -0
- package/dist/functions/serialization/serialization.test.js +78 -0
- package/dist/functions/serialization/serialization.test.js.map +1 -1
- package/dist/graphics/camera/camera.d.ts +62 -0
- package/dist/graphics/camera/camera.js +17 -0
- package/dist/graphics/camera/camera.js.map +1 -0
- package/dist/graphics/camera/index.d.ts +4 -0
- package/dist/graphics/camera/index.js +5 -0
- package/dist/graphics/camera/index.js.map +1 -0
- package/dist/graphics/camera/screen-to-world-ray.d.ts +12 -0
- package/dist/graphics/camera/screen-to-world-ray.js +49 -0
- package/dist/graphics/camera/screen-to-world-ray.js.map +1 -0
- package/dist/graphics/camera/screen-to-world-ray.test.d.ts +1 -0
- package/dist/graphics/camera/screen-to-world-ray.test.js +171 -0
- package/dist/graphics/camera/screen-to-world-ray.test.js.map +1 -0
- package/dist/graphics/camera/to-view-projection.d.ts +3 -0
- package/dist/graphics/camera/to-view-projection.js +8 -0
- package/dist/graphics/camera/to-view-projection.js.map +1 -0
- package/dist/graphics/camera/world-to-screen.d.ts +12 -0
- package/dist/graphics/camera/world-to-screen.js +38 -0
- package/dist/graphics/camera/world-to-screen.js.map +1 -0
- package/dist/graphics/camera/world-to-screen.test.d.ts +1 -0
- package/dist/graphics/camera/world-to-screen.test.js +124 -0
- package/dist/graphics/camera/world-to-screen.test.js.map +1 -0
- package/dist/graphics/create-struct-gpu-buffer.d.ts +7 -0
- package/dist/graphics/create-struct-gpu-buffer.js +17 -0
- package/dist/graphics/create-struct-gpu-buffer.js.map +1 -0
- package/dist/graphics/extract-wgsl-bindings.d.ts +5 -0
- package/dist/graphics/extract-wgsl-bindings.js +10 -0
- package/dist/graphics/extract-wgsl-bindings.js.map +1 -0
- package/dist/graphics/frame.d.ts +22 -0
- package/dist/graphics/frame.js +12 -0
- package/dist/graphics/frame.js.map +1 -0
- package/dist/graphics/get-web-gpu-device-and-context.d.ts +2 -0
- package/dist/graphics/get-web-gpu-device-and-context.js +21 -0
- package/dist/graphics/get-web-gpu-device-and-context.js.map +1 -0
- package/dist/graphics/graphics-context.d.ts +5 -0
- package/dist/graphics/graphics-context.js +2 -0
- package/dist/graphics/graphics-context.js.map +1 -0
- package/dist/graphics/index.d.ts +5 -0
- package/dist/graphics/index.js +5 -0
- package/dist/graphics/index.js.map +1 -0
- package/dist/graphics/to-gpu-buffer.d.ts +2 -0
- package/dist/graphics/to-gpu-buffer.js +14 -0
- package/dist/graphics/to-gpu-buffer.js.map +1 -0
- package/dist/internal/array/index.d.ts +1 -0
- package/dist/internal/array/index.js +23 -0
- package/dist/internal/array/index.js.map +1 -0
- package/dist/internal/array/topological-sort.d.ts +26 -0
- package/dist/internal/array/topological-sort.js +79 -0
- package/dist/internal/array/topological-sort.js.map +1 -0
- package/dist/internal/array/topological-sort.test.d.ts +1 -0
- package/dist/internal/array/topological-sort.test.js +100 -0
- package/dist/internal/array/topological-sort.test.js.map +1 -0
- package/dist/internal/function/debounce.d.ts +70 -0
- package/dist/internal/function/debounce.js +155 -0
- package/dist/internal/function/debounce.js.map +1 -0
- package/dist/internal/function/debounce.test.d.ts +1 -0
- package/dist/internal/function/debounce.test.js +306 -0
- package/dist/internal/function/debounce.test.js.map +1 -0
- package/dist/lit/elements/application-element.d.ts +9 -0
- package/dist/lit/elements/application-element.js +62 -0
- package/dist/lit/elements/application-element.js.map +1 -0
- package/dist/lit/elements/application-host.d.ts +16 -0
- package/dist/lit/elements/application-host.js +59 -0
- package/dist/lit/elements/application-host.js.map +1 -0
- package/dist/lit/elements/index.d.ts +2 -0
- package/dist/lit/elements/index.js +2 -0
- package/dist/lit/elements/index.js.map +1 -1
- package/dist/lit/elements/service-application.js +4 -1
- package/dist/lit/elements/service-application.js.map +1 -1
- package/dist/lit/functions/index.d.ts +1 -0
- package/dist/lit/functions/index.js +23 -0
- package/dist/lit/functions/index.js.map +1 -0
- package/dist/lit/functions/iterate-self-and-ancestors.d.ts +1 -0
- package/dist/lit/functions/iterate-self-and-ancestors.js +44 -0
- package/dist/lit/functions/iterate-self-and-ancestors.js.map +1 -0
- package/dist/lit/hooks/attach-decorator.d.ts +4 -0
- package/dist/lit/hooks/attach-decorator.js +46 -0
- package/dist/lit/hooks/attach-decorator.js.map +1 -0
- package/dist/lit/hooks/index.d.ts +4 -0
- package/dist/lit/hooks/index.js +4 -0
- package/dist/lit/hooks/index.js.map +1 -1
- package/dist/lit/hooks/use-drag-observe.d.ts +22 -0
- package/dist/lit/hooks/use-drag-observe.js +55 -0
- package/dist/lit/hooks/use-drag-observe.js.map +1 -0
- package/dist/lit/hooks/use-drag-transaction.d.ts +7 -0
- package/dist/lit/hooks/use-drag-transaction.js +56 -0
- package/dist/lit/hooks/use-drag-transaction.js.map +1 -0
- package/dist/lit/hooks/use-draggable.d.ts +16 -0
- package/dist/lit/hooks/use-draggable.js +122 -0
- package/dist/lit/hooks/use-draggable.js.map +1 -0
- package/dist/math/aabb/aabb.d.ts +48 -0
- package/dist/math/aabb/aabb.js +86 -0
- package/dist/math/aabb/aabb.js.map +1 -0
- package/dist/math/aabb/line-intersection.test.d.ts +1 -0
- package/dist/math/aabb/line-intersection.test.js +210 -0
- package/dist/math/aabb/line-intersection.test.js.map +1 -0
- package/dist/math/constants.d.ts +4 -0
- package/dist/math/constants.js +26 -0
- package/dist/math/constants.js.map +1 -0
- package/dist/math/index.d.ts +18 -0
- package/dist/math/index.js +40 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/line2/intersects.test.d.ts +1 -0
- package/dist/math/line2/intersects.test.js +104 -0
- package/dist/math/line2/intersects.test.js.map +1 -0
- package/dist/math/line2/line2.d.ts +42 -0
- package/dist/math/line2/line2.js +78 -0
- package/dist/math/line2/line2.js.map +1 -0
- package/dist/math/line3/closest-point-on-line.test.d.ts +1 -0
- package/dist/math/line3/closest-point-on-line.test.js +107 -0
- package/dist/math/line3/closest-point-on-line.test.js.map +1 -0
- package/dist/math/line3/interpolate.test.d.ts +1 -0
- package/dist/math/line3/interpolate.test.js +66 -0
- package/dist/math/line3/interpolate.test.js.map +1 -0
- package/dist/math/line3/line3.d.ts +49 -0
- package/dist/math/line3/line3.js +77 -0
- package/dist/math/line3/line3.js.map +1 -0
- package/dist/math/line3/sub-line.test.d.ts +1 -0
- package/dist/math/line3/sub-line.test.js +70 -0
- package/dist/math/line3/sub-line.test.js.map +1 -0
- package/dist/math/mat4x4/mat4x4.d.ts +37 -0
- package/dist/math/mat4x4/mat4x4.js +246 -0
- package/dist/math/mat4x4/mat4x4.js.map +1 -0
- package/dist/math/picking/index.d.ts +1 -0
- package/dist/math/picking/index.js +23 -0
- package/dist/math/picking/index.js.map +1 -0
- package/dist/math/picking/pick-from-tables.d.ts +18 -0
- package/dist/math/picking/pick-from-tables.js +154 -0
- package/dist/math/picking/pick-from-tables.js.map +1 -0
- package/dist/math/picking/pick-result.d.ts +7 -0
- package/dist/{services/service.js → math/picking/pick-result.js} +1 -1
- package/dist/math/picking/pick-result.js.map +1 -0
- package/dist/math/quat/quat.d.ts +42 -0
- package/dist/math/quat/quat.js +220 -0
- package/dist/math/quat/quat.js.map +1 -0
- package/dist/math/vec2/vec2.d.ts +63 -0
- package/dist/math/vec2/vec2.js +114 -0
- package/dist/math/vec2/vec2.js.map +1 -0
- package/dist/math/vec3/vec3.d.ts +65 -0
- package/dist/math/vec3/vec3.js +154 -0
- package/dist/math/vec3/vec3.js.map +1 -0
- package/dist/math/vec4/vec4.d.ts +63 -0
- package/dist/math/vec4/vec4.js +154 -0
- package/dist/math/vec4/vec4.js.map +1 -0
- package/dist/observe/to-async-generator.js +4 -0
- package/dist/observe/to-async-generator.js.map +1 -1
- package/dist/observe/with-filter.d.ts +1 -1
- package/dist/observe/with-filter.js.map +1 -1
- package/dist/samples/index.d.ts +13 -0
- package/dist/samples/index.js +27 -0
- package/dist/samples/index.js.map +1 -0
- package/dist/samples/todo/elements/todo-list/todo-list-presentation.d.ts +25 -0
- package/dist/samples/todo/elements/todo-list/todo-list-presentation.js +12 -0
- package/dist/samples/todo/elements/todo-list/todo-list-presentation.js.map +1 -0
- package/dist/samples/todo/elements/todo-list/todo-list.css.d.ts +18 -0
- package/dist/samples/todo/elements/todo-list/todo-list.css.js +27 -0
- package/dist/samples/todo/elements/todo-list/todo-list.css.js.map +1 -0
- package/dist/samples/todo/elements/todo-list/todo-list.d.ts +12 -0
- package/dist/samples/todo/elements/todo-list/todo-list.js +60 -0
- package/dist/samples/todo/elements/todo-list/todo-list.js.map +1 -0
- package/dist/samples/todo/elements/todo-row/index.d.ts +18 -0
- package/dist/samples/todo/elements/todo-row/index.js +19 -0
- package/dist/samples/todo/elements/todo-row/index.js.map +1 -0
- package/dist/samples/todo/elements/todo-row/todo-row-presentation.d.ts +18 -0
- package/dist/samples/todo/elements/todo-row/todo-row-presentation.js +66 -0
- package/dist/samples/todo/elements/todo-row/todo-row-presentation.js.map +1 -0
- package/dist/samples/todo/elements/todo-row/todo-row.css.d.ts +1 -0
- package/dist/samples/todo/elements/todo-row/todo-row.css.js +65 -0
- package/dist/samples/todo/elements/todo-row/todo-row.css.js.map +1 -0
- package/dist/samples/todo/elements/todo-row/todo-row.d.ts +14 -0
- package/dist/samples/todo/elements/todo-row/todo-row.js +60 -0
- package/dist/samples/todo/elements/todo-row/todo-row.js.map +1 -0
- package/dist/samples/todo/elements/todo-toolbar/index.d.ts +18 -0
- package/dist/samples/todo/elements/todo-toolbar/index.js +19 -0
- package/dist/samples/todo/elements/todo-toolbar/index.js.map +1 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.d.ts +22 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +57 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +1 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.d.ts +1 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +50 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +1 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.d.ts +11 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js +77 -0
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +1 -0
- package/dist/samples/todo/elements/todo-undo-redo/index.d.ts +18 -0
- package/dist/samples/todo/elements/todo-undo-redo/index.js +19 -0
- package/dist/samples/todo/elements/todo-undo-redo/index.js.map +1 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.d.ts +17 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +45 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +1 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.d.ts +1 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +28 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +1 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.d.ts +11 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +52 -0
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.d.ts +6 -0
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js +21 -0
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +19 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.js +2 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +19 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js +2 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +19 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js +2 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.d.ts +20 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js +21 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js.map +1 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state-service.d.ts +19 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state-service.js +2 -0
- package/dist/samples/todo/services/dependent-state-service/dependent-state-service.js.map +1 -0
- package/dist/samples/todo/services/main-service/create-main-service.d.ts +25 -0
- package/dist/samples/todo/services/main-service/create-main-service.js +39 -0
- package/dist/samples/todo/services/main-service/create-main-service.js.map +1 -0
- package/dist/samples/todo/services/main-service/todo-main-service.d.ts +35 -0
- package/dist/samples/todo/services/main-service/todo-main-service.js +2 -0
- package/dist/samples/todo/services/main-service/todo-main-service.js.map +1 -0
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +13 -0
- package/dist/samples/todo/services/state-service/create-todo-database.js +26 -0
- package/dist/samples/todo/services/state-service/create-todo-database.js.map +1 -0
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +13 -0
- package/dist/samples/todo/services/state-service/create-todo-store.js +41 -0
- package/dist/samples/todo/services/state-service/create-todo-store.js.map +1 -0
- package/dist/samples/todo/services/state-service/todo-state-service.d.ts +22 -0
- package/dist/samples/todo/services/state-service/todo-state-service.js +2 -0
- package/dist/samples/todo/services/state-service/todo-state-service.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.d.ts +2 -0
- package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js +26 -0
- package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.d.ts +22 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.js +13 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.test.d.ts +1 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.test.js +32 -0
- package/dist/samples/todo/services/state-service/transactions/create-todo.test.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/delete-all-todos.d.ts +19 -0
- package/dist/samples/todo/services/state-service/transactions/delete-all-todos.js +16 -0
- package/dist/samples/todo/services/state-service/transactions/delete-all-todos.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.d.ts +3 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.js +24 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.test.d.ts +1 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js +40 -0
- package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/drag-todo.d.ts +7 -0
- package/dist/samples/todo/services/state-service/transactions/drag-todo.js +33 -0
- package/dist/samples/todo/services/state-service/transactions/drag-todo.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/index.d.ts +23 -0
- package/dist/samples/todo/services/state-service/transactions/index.js +25 -0
- package/dist/samples/todo/services/state-service/transactions/index.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/reorder-todos.d.ts +23 -0
- package/dist/samples/todo/services/state-service/transactions/reorder-todos.js +11 -0
- package/dist/samples/todo/services/state-service/transactions/reorder-todos.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.d.ts +20 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js +11 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.d.ts +1 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js +81 -0
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +1 -0
- package/dist/samples/todo/todo-element.d.ts +21 -0
- package/dist/samples/todo/todo-element.js +4 -0
- package/dist/samples/todo/todo-element.js.map +1 -0
- package/dist/samples/todo/todo-host.d.ts +8 -0
- package/dist/samples/todo/todo-host.js +55 -0
- package/dist/samples/todo/todo-host.js.map +1 -0
- package/dist/samples/todo/todo-main-element.d.ts +27 -0
- package/dist/samples/todo/todo-main-element.js +63 -0
- package/dist/samples/todo/todo-main-element.js.map +1 -0
- package/dist/samples/todo/todo-sample.d.ts +3 -0
- package/dist/samples/todo/todo-sample.js +39 -0
- package/dist/samples/todo/todo-sample.js.map +1 -0
- package/dist/schema/schema.d.ts +7 -6
- package/dist/schema/schema.js.map +1 -1
- package/dist/service/disposable.d.ts +4 -0
- package/dist/{services/is-service.js → service/disposable.js} +3 -3
- package/dist/service/disposable.js.map +1 -0
- package/dist/service/progressive-result.d.ts +7 -10
- package/dist/service/progressive-result.js +0 -6
- package/dist/service/progressive-result.js.map +1 -1
- package/dist/service/service.d.ts +11 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/register-typed-buffer-codecs.js +39 -22
- package/dist/typed-buffer/register-typed-buffer-codecs.js.map +1 -1
- package/dist/typed-buffer/structs/get-struct-layout.js +3 -0
- package/dist/typed-buffer/structs/get-struct-layout.js.map +1 -1
- package/package.json +20 -3
- package/dist/services/add-observable-actions.d.ts +0 -29
- package/dist/services/add-observable-actions.js +0 -108
- package/dist/services/add-observable-actions.js.map +0 -1
- package/dist/services/index.d.ts +0 -4
- package/dist/services/index.js.map +0 -1
- package/dist/services/is-service.d.ts +0 -2
- package/dist/services/is-service.js.map +0 -1
- package/dist/services/progressive-result.d.ts +0 -96
- package/dist/services/progressive-result.js +0 -99
- package/dist/services/progressive-result.js.map +0 -1
- package/dist/services/service.d.ts +0 -4
- package/dist/services/service.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { useEffect } from './use-effect.js';
|
|
23
|
+
function toCssUnitString(value) {
|
|
24
|
+
return `${value}px`;
|
|
25
|
+
}
|
|
26
|
+
export function useDraggable(element, propsFunction, dependencies) {
|
|
27
|
+
const props = propsFunction();
|
|
28
|
+
const { minDragDistance = 10, dragCursor = 'grab', addPlaceholder = false, initialDownPosition = null, stopPropagation = false } = props;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
let downPosition = null;
|
|
31
|
+
let isDragging = false;
|
|
32
|
+
let startPosition;
|
|
33
|
+
let originalCursor = '';
|
|
34
|
+
let placeholder = null;
|
|
35
|
+
let lastPosition = [0, 0];
|
|
36
|
+
function getRelativePosition(e) {
|
|
37
|
+
if (!downPosition) {
|
|
38
|
+
throw new Error("This cannot happen as we don't listen to pointermove until pointerdown occurs.");
|
|
39
|
+
}
|
|
40
|
+
return [e.clientX - downPosition[0], e.clientY - downPosition[1]];
|
|
41
|
+
}
|
|
42
|
+
function onPointerMove(e) {
|
|
43
|
+
const relative = getRelativePosition(e);
|
|
44
|
+
const distance = Math.sqrt(Math.pow(relative[0], 2) + Math.pow(relative[1], 2));
|
|
45
|
+
if (distance >= minDragDistance) {
|
|
46
|
+
if (!isDragging) {
|
|
47
|
+
isDragging = true;
|
|
48
|
+
startPosition = props.onDragStart(e) ?? [0, 0];
|
|
49
|
+
if (dragCursor) {
|
|
50
|
+
originalCursor = element.style.cursor;
|
|
51
|
+
element.style.cursor = dragCursor;
|
|
52
|
+
}
|
|
53
|
+
// add a placeholder so the parent element doesn't change size when the element is dragged.
|
|
54
|
+
if (addPlaceholder) {
|
|
55
|
+
placeholder = document.createElement('div');
|
|
56
|
+
Object.assign(placeholder.style, {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
backgroundColor: 'pink',
|
|
59
|
+
left: toCssUnitString(element.offsetLeft),
|
|
60
|
+
top: toCssUnitString(element.offsetTop),
|
|
61
|
+
width: toCssUnitString(element.offsetWidth),
|
|
62
|
+
height: toCssUnitString(element.offsetHeight),
|
|
63
|
+
visibility: 'hidden',
|
|
64
|
+
});
|
|
65
|
+
element.parentElement?.appendChild(placeholder);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (isDragging) {
|
|
70
|
+
lastPosition = [startPosition[0] + relative[0], startPosition[1] + relative[1]];
|
|
71
|
+
props.onDrag(e, lastPosition, relative);
|
|
72
|
+
}
|
|
73
|
+
if (stopPropagation)
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
}
|
|
76
|
+
function cleanup() {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
78
|
+
window.removeEventListener('pointerup', onPointerUp);
|
|
79
|
+
window.removeEventListener('pointermove', onPointerMove);
|
|
80
|
+
if (dragCursor) {
|
|
81
|
+
element.style.cursor = originalCursor;
|
|
82
|
+
}
|
|
83
|
+
if (placeholder) {
|
|
84
|
+
placeholder.remove();
|
|
85
|
+
placeholder = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function onPointerUp(e) {
|
|
89
|
+
cleanup();
|
|
90
|
+
if (isDragging) {
|
|
91
|
+
props.onDragEnd?.(e, lastPosition);
|
|
92
|
+
}
|
|
93
|
+
if (stopPropagation)
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
downPosition = null;
|
|
96
|
+
isDragging = false;
|
|
97
|
+
}
|
|
98
|
+
function onPointerDown(e) {
|
|
99
|
+
window.addEventListener('pointermove', onPointerMove);
|
|
100
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
101
|
+
downPosition = [e.clientX, e.clientY];
|
|
102
|
+
if (stopPropagation)
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
}
|
|
105
|
+
if (initialDownPosition) {
|
|
106
|
+
window.addEventListener('pointermove', onPointerMove);
|
|
107
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
108
|
+
downPosition = initialDownPosition;
|
|
109
|
+
}
|
|
110
|
+
element?.addEventListener('pointerdown', onPointerDown);
|
|
111
|
+
return () => {
|
|
112
|
+
element?.removeEventListener('pointerdown', onPointerDown);
|
|
113
|
+
if (downPosition) {
|
|
114
|
+
cleanup();
|
|
115
|
+
}
|
|
116
|
+
if (isDragging) {
|
|
117
|
+
props.onDragCancel?.();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, [element, initialDownPosition, ...(dependencies ?? [])]);
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=use-draggable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-draggable.js","sourceRoot":"","sources":["../../../src/lit/hooks/use-draggable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,SAAS,eAAe,CAAC,KAAa;IAClC,OAAO,GAAG,KAAK,IAAI,CAAC;AACxB,CAAC;AAkBD,MAAM,UAAU,YAAY,CAAC,OAAoB,EAAE,aAAmC,EAAE,YAAuB;IAC3G,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;I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AY,EAAE,EAAE,CAAC;YAC3B,CAAC;QACL,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FromSchema } from "../../schema/index.js";
|
|
2
|
+
import { Vec3 } from "../index.js";
|
|
3
|
+
export declare const schema: {
|
|
4
|
+
readonly type: "object";
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly min: {
|
|
7
|
+
readonly type: "array";
|
|
8
|
+
readonly items: {
|
|
9
|
+
readonly type: "number";
|
|
10
|
+
readonly precision: 1;
|
|
11
|
+
readonly default: number;
|
|
12
|
+
};
|
|
13
|
+
readonly minItems: 3;
|
|
14
|
+
readonly maxItems: 3;
|
|
15
|
+
readonly default: readonly [0, 0, 0];
|
|
16
|
+
};
|
|
17
|
+
readonly max: {
|
|
18
|
+
readonly type: "array";
|
|
19
|
+
readonly items: {
|
|
20
|
+
readonly type: "number";
|
|
21
|
+
readonly precision: 1;
|
|
22
|
+
readonly default: number;
|
|
23
|
+
};
|
|
24
|
+
readonly minItems: 3;
|
|
25
|
+
readonly maxItems: 3;
|
|
26
|
+
readonly default: readonly [0, 0, 0];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly required: readonly ["min", "max"];
|
|
30
|
+
readonly additionalProperties: false;
|
|
31
|
+
readonly default: {
|
|
32
|
+
readonly min: readonly [0, 0, 0];
|
|
33
|
+
readonly max: readonly [0, 0, 0];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type Type = FromSchema<typeof schema>;
|
|
37
|
+
type Aabb = Type;
|
|
38
|
+
export declare const layout: import("../../typed-buffer/index.js").StructLayout;
|
|
39
|
+
export declare const center: (aabb: Aabb) => Vec3;
|
|
40
|
+
/**
|
|
41
|
+
* @returns the alpha distance along the line (0-1) where the line intersects the box or -1 if it does not.
|
|
42
|
+
* @param radius - The radius of the line (treats line as a cylinder). Defaults to 0.
|
|
43
|
+
*/
|
|
44
|
+
export declare const lineIntersection: (box: Aabb, line: {
|
|
45
|
+
a: Vec3;
|
|
46
|
+
b: Vec3;
|
|
47
|
+
}, radius?: number) => number;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { getStructLayout } from "../../typed-buffer/index.js";
|
|
23
|
+
import { Vec3 } from "../index.js";
|
|
24
|
+
const { schema: Vec3Schema } = Vec3;
|
|
25
|
+
export const schema = {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
min: Vec3Schema,
|
|
29
|
+
max: Vec3Schema,
|
|
30
|
+
},
|
|
31
|
+
required: ['min', 'max'],
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
default: {
|
|
34
|
+
min: Vec3Schema.default,
|
|
35
|
+
max: Vec3Schema.default,
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const layout = getStructLayout(schema);
|
|
39
|
+
// AABB utility functions
|
|
40
|
+
export const center = (aabb) => [
|
|
41
|
+
(aabb.min[0] + aabb.max[0]) / 2,
|
|
42
|
+
(aabb.min[1] + aabb.max[1]) / 2,
|
|
43
|
+
(aabb.min[2] + aabb.max[2]) / 2,
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* @returns the alpha distance along the line (0-1) where the line intersects the box or -1 if it does not.
|
|
47
|
+
* @param radius - The radius of the line (treats line as a cylinder). Defaults to 0.
|
|
48
|
+
*/
|
|
49
|
+
export const lineIntersection = (box, line, radius = 0) => {
|
|
50
|
+
const { min, max } = box;
|
|
51
|
+
const { a, b } = line;
|
|
52
|
+
// Expand the box by the radius to treat the line as a cylinder
|
|
53
|
+
const expandedMin = [min[0] - radius, min[1] - radius, min[2] - radius];
|
|
54
|
+
const expandedMax = [max[0] + radius, max[1] + radius, max[2] + radius];
|
|
55
|
+
// Calculate line direction vector
|
|
56
|
+
const dir = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
|
|
57
|
+
// Calculate intersection parameters for each axis
|
|
58
|
+
const tMinX = (expandedMin[0] - a[0]) / dir[0];
|
|
59
|
+
const tMaxX = (expandedMax[0] - a[0]) / dir[0];
|
|
60
|
+
const tMinY = (expandedMin[1] - a[1]) / dir[1];
|
|
61
|
+
const tMaxY = (expandedMax[1] - a[1]) / dir[1];
|
|
62
|
+
const tMinZ = (expandedMin[2] - a[2]) / dir[2];
|
|
63
|
+
const tMaxZ = (expandedMax[2] - a[2]) / dir[2];
|
|
64
|
+
// Handle division by zero (line parallel to axis)
|
|
65
|
+
const tMinXFinal = dir[0] >= 0 ? tMinX : tMaxX;
|
|
66
|
+
const tMaxXFinal = dir[0] >= 0 ? tMaxX : tMinX;
|
|
67
|
+
const tMinYFinal = dir[1] >= 0 ? tMinY : tMaxY;
|
|
68
|
+
const tMaxYFinal = dir[1] >= 0 ? tMaxY : tMinY;
|
|
69
|
+
const tMinZFinal = dir[2] >= 0 ? tMinZ : tMaxZ;
|
|
70
|
+
const tMaxZFinal = dir[2] >= 0 ? tMaxZ : tMinZ;
|
|
71
|
+
// Find the largest minimum and smallest maximum
|
|
72
|
+
const tMin = Math.max(tMinXFinal, tMinYFinal, tMinZFinal);
|
|
73
|
+
const tMax = Math.min(tMaxXFinal, tMaxYFinal, tMaxZFinal);
|
|
74
|
+
// Check if intersection exists
|
|
75
|
+
if (tMax < tMin || tMax < 0) {
|
|
76
|
+
return -1;
|
|
77
|
+
}
|
|
78
|
+
// If tMin is negative, the line starts inside the box
|
|
79
|
+
const alpha = tMin < 0 ? 0 : tMin;
|
|
80
|
+
// Check if the intersection point is within the line segment (0-1)
|
|
81
|
+
if (alpha > 1) {
|
|
82
|
+
return -1;
|
|
83
|
+
}
|
|
84
|
+
return alpha;
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=aabb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aabb.js","sourceRoot":"","sources":["../../../src/math/aabb/aabb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;AAEpC,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,GAAG,EAAE,UAAU;QACf,GAAG,EA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|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { describe, it, expect } from 'vitest';
|
|
23
|
+
import { Aabb } from '../index.js';
|
|
24
|
+
describe('Aabb.lineIntersection', () => {
|
|
25
|
+
const box = {
|
|
26
|
+
min: [0, 0, 0],
|
|
27
|
+
max: [2, 2, 2]
|
|
28
|
+
};
|
|
29
|
+
it('should return 0 when line starts inside the box', () => {
|
|
30
|
+
const line = {
|
|
31
|
+
a: [1, 1, 1],
|
|
32
|
+
b: [3, 3, 3]
|
|
33
|
+
};
|
|
34
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0);
|
|
35
|
+
});
|
|
36
|
+
it('should return correct alpha when line intersects box from outside', () => {
|
|
37
|
+
const line = {
|
|
38
|
+
a: [-1, 1, 1],
|
|
39
|
+
b: [3, 1, 1]
|
|
40
|
+
};
|
|
41
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
42
|
+
});
|
|
43
|
+
it('should return -1 when line does not intersect box', () => {
|
|
44
|
+
const line = {
|
|
45
|
+
a: [3, 3, 3],
|
|
46
|
+
b: [5, 5, 5]
|
|
47
|
+
};
|
|
48
|
+
expect(Aabb.lineIntersection(box, line)).toBe(-1);
|
|
49
|
+
});
|
|
50
|
+
it('should return -1 when line intersects but segment is too short', () => {
|
|
51
|
+
const line = {
|
|
52
|
+
a: [-2, 1, 1],
|
|
53
|
+
b: [-1, 1, 1]
|
|
54
|
+
};
|
|
55
|
+
expect(Aabb.lineIntersection(box, line)).toBe(-1);
|
|
56
|
+
});
|
|
57
|
+
it('should handle line parallel to x-axis', () => {
|
|
58
|
+
const line = {
|
|
59
|
+
a: [-1, 1, 1],
|
|
60
|
+
b: [3, 1, 1]
|
|
61
|
+
};
|
|
62
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
63
|
+
});
|
|
64
|
+
it('should handle line parallel to y-axis', () => {
|
|
65
|
+
const line = {
|
|
66
|
+
a: [1, -1, 1],
|
|
67
|
+
b: [1, 3, 1]
|
|
68
|
+
};
|
|
69
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
70
|
+
});
|
|
71
|
+
it('should handle line parallel to z-axis', () => {
|
|
72
|
+
const line = {
|
|
73
|
+
a: [1, 1, -1],
|
|
74
|
+
b: [1, 1, 3]
|
|
75
|
+
};
|
|
76
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
77
|
+
});
|
|
78
|
+
it('should handle line that goes through corner', () => {
|
|
79
|
+
const line = {
|
|
80
|
+
a: [-1, -1, -1],
|
|
81
|
+
b: [3, 3, 3]
|
|
82
|
+
};
|
|
83
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
84
|
+
});
|
|
85
|
+
it('should handle line that starts at box boundary', () => {
|
|
86
|
+
const line = {
|
|
87
|
+
a: [0, 1, 1],
|
|
88
|
+
b: [3, 1, 1]
|
|
89
|
+
};
|
|
90
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0);
|
|
91
|
+
});
|
|
92
|
+
it('should handle line that ends at box boundary', () => {
|
|
93
|
+
const line = {
|
|
94
|
+
a: [-1, 1, 1],
|
|
95
|
+
b: [2, 1, 1]
|
|
96
|
+
};
|
|
97
|
+
expect(Aabb.lineIntersection(box, line)).toBe(1 / 3);
|
|
98
|
+
});
|
|
99
|
+
it('should handle negative coordinates', () => {
|
|
100
|
+
const negativeBox = {
|
|
101
|
+
min: [-2, -2, -2],
|
|
102
|
+
max: [0, 0, 0]
|
|
103
|
+
};
|
|
104
|
+
const line = {
|
|
105
|
+
a: [-3, -1, -1],
|
|
106
|
+
b: [1, -1, -1]
|
|
107
|
+
};
|
|
108
|
+
expect(Aabb.lineIntersection(negativeBox, line)).toBe(0.25);
|
|
109
|
+
});
|
|
110
|
+
describe('with radius parameter', () => {
|
|
111
|
+
it('should behave identically when radius is 0 (default)', () => {
|
|
112
|
+
const line = {
|
|
113
|
+
a: [-1, 1, 1],
|
|
114
|
+
b: [3, 1, 1]
|
|
115
|
+
};
|
|
116
|
+
expect(Aabb.lineIntersection(box, line)).toBe(Aabb.lineIntersection(box, line, 0));
|
|
117
|
+
});
|
|
118
|
+
it('should intersect when line is outside but within radius', () => {
|
|
119
|
+
const line = {
|
|
120
|
+
a: [-1, 1, 1],
|
|
121
|
+
b: [3, 1, 1]
|
|
122
|
+
};
|
|
123
|
+
// Without radius, this line intersects at alpha = 0.25
|
|
124
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
125
|
+
// With radius 0.5, expanded box is [-0.5, -0.5, -0.5] to [2.5, 2.5, 2.5]
|
|
126
|
+
// Line from -1 to 3 intersects at alpha = 0.125 (from -1 to -0.5 is 0.5 units, total line is 4 units)
|
|
127
|
+
expect(Aabb.lineIntersection(box, line, 0.5)).toBe(0.125);
|
|
128
|
+
});
|
|
129
|
+
it('should intersect when line passes near corner with sufficient radius', () => {
|
|
130
|
+
const line = {
|
|
131
|
+
a: [-1, -1, 1],
|
|
132
|
+
b: [3, 3, 1]
|
|
133
|
+
};
|
|
134
|
+
// Without radius, this line intersects at alpha = 0.25
|
|
135
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0.25);
|
|
136
|
+
// With radius 0.5, expanded box is [-0.5, -0.5, -0.5] to [2.5, 2.5, 2.5]
|
|
137
|
+
// Line from (-1, -1, 1) to (3, 3, 1) intersects at alpha = 0.125
|
|
138
|
+
expect(Aabb.lineIntersection(box, line, 0.5)).toBe(0.125);
|
|
139
|
+
});
|
|
140
|
+
it('should still not intersect when line is too far even with radius', () => {
|
|
141
|
+
const line = {
|
|
142
|
+
a: [-2, 1, 1],
|
|
143
|
+
b: [4, 1, 1]
|
|
144
|
+
};
|
|
145
|
+
// Even with radius 0.5, expanded box is [-0.5, -0.5, -0.5] to [2.5, 2.5, 2.5]
|
|
146
|
+
// Line from -2 to 4 should intersect at alpha = 0.25
|
|
147
|
+
expect(Aabb.lineIntersection(box, line, 0.5)).toBe(0.25);
|
|
148
|
+
});
|
|
149
|
+
it('should handle radius larger than box size', () => {
|
|
150
|
+
const line = {
|
|
151
|
+
a: [-5, 1, 1],
|
|
152
|
+
b: [7, 1, 1]
|
|
153
|
+
};
|
|
154
|
+
// With radius 3, the expanded box is [-3, -3, -3] to [5, 5, 5]
|
|
155
|
+
// Line from -5 to 7 should intersect at alpha = 1/6 (from -5 to -3 is 2 units, total line is 12 units)
|
|
156
|
+
expect(Aabb.lineIntersection(box, line, 3)).toBe(1 / 6);
|
|
157
|
+
});
|
|
158
|
+
it('should work with negative radius (shrinks box)', () => {
|
|
159
|
+
const line = {
|
|
160
|
+
a: [0.5, 1, 1],
|
|
161
|
+
b: [1.5, 1, 1]
|
|
162
|
+
};
|
|
163
|
+
// Without radius, this line intersects
|
|
164
|
+
expect(Aabb.lineIntersection(box, line)).toBe(0);
|
|
165
|
+
// With negative radius -0.5, the box shrinks to [0.5, 0.5, 0.5] to [1.5, 1.5, 1.5]
|
|
166
|
+
// Line from 0.5 to 1.5 should still intersect
|
|
167
|
+
expect(Aabb.lineIntersection(box, line, -0.5)).toBe(0);
|
|
168
|
+
});
|
|
169
|
+
it('should handle radius with line parallel to each axis', () => {
|
|
170
|
+
// X-axis
|
|
171
|
+
const lineX = {
|
|
172
|
+
a: [-0.5, 1, 1],
|
|
173
|
+
b: [2.5, 1, 1]
|
|
174
|
+
};
|
|
175
|
+
expect(Aabb.lineIntersection(box, lineX, 0.5)).toBe(0);
|
|
176
|
+
// Y-axis
|
|
177
|
+
const lineY = {
|
|
178
|
+
a: [1, -0.5, 1],
|
|
179
|
+
b: [1, 2.5, 1]
|
|
180
|
+
};
|
|
181
|
+
expect(Aabb.lineIntersection(box, lineY, 0.5)).toBe(0);
|
|
182
|
+
// Z-axis
|
|
183
|
+
const lineZ = {
|
|
184
|
+
a: [1, 1, -0.5],
|
|
185
|
+
b: [1, 1, 2.5]
|
|
186
|
+
};
|
|
187
|
+
expect(Aabb.lineIntersection(box, lineZ, 0.5)).toBe(0);
|
|
188
|
+
});
|
|
189
|
+
it('should handle radius with line that starts inside expanded box', () => {
|
|
190
|
+
const line = {
|
|
191
|
+
a: [-0.5, 1, 1],
|
|
192
|
+
b: [2.5, 1, 1]
|
|
193
|
+
};
|
|
194
|
+
// Line starts at -0.5, but with radius 0.5, expanded box starts at -0.5
|
|
195
|
+
// So line starts exactly at the boundary of expanded box
|
|
196
|
+
expect(Aabb.lineIntersection(box, line, 0.5)).toBe(0);
|
|
197
|
+
});
|
|
198
|
+
it('should handle radius with line that ends inside expanded box', () => {
|
|
199
|
+
const line = {
|
|
200
|
+
a: [-1, 1, 1],
|
|
201
|
+
b: [2.5, 1, 1]
|
|
202
|
+
};
|
|
203
|
+
// Line ends at 2.5, but with radius 0.5, expanded box ends at 2.5
|
|
204
|
+
// Line from -1 to 2.5 (3.5 units total), intersection at -0.5 (0.5 units from start)
|
|
205
|
+
// Alpha = 0.5 / 3.5 = 1/7 ≈ 0.142857
|
|
206
|
+
expect(Aabb.lineIntersection(box, line, 0.5)).toBe(1 / 7);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
//# sourceMappingURL=line-intersection.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-intersection.test.js","sourceRoot":"","sources":["../../../src/math/aabb/line-intersection.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACnC,MAAM,GAAG,GAAS;QACd,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAU;YAChB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACZ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SACf,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QACzE,MAAM,IAAI,GAAU;YAChB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACb,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CA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M,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;YACpE,MAAM,IAAI,GAAU;gBAChB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACb,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;aACjB,CAAC;YACF,kEAAkE;YAClE,qFAAqF;YACrF,qCAAqC;YACrC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
/**
|
|
23
|
+
* Small value used for floating point comparisons
|
|
24
|
+
*/
|
|
25
|
+
export const epsilon = 1e-10;
|
|
26
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/math/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./constants.js";
|
|
2
|
+
export type Mat4x4 = import("./mat4x4/mat4x4.js").Type;
|
|
3
|
+
export * as Mat4x4 from "./mat4x4/mat4x4.js";
|
|
4
|
+
export type Vec2 = import("./vec2/vec2.js").Type;
|
|
5
|
+
export * as Vec2 from "./vec2/vec2.js";
|
|
6
|
+
export type Vec3 = import("./vec3/vec3.js").Type;
|
|
7
|
+
export * as Vec3 from "./vec3/vec3.js";
|
|
8
|
+
export type Vec4 = import("./vec4/vec4.js").Type;
|
|
9
|
+
export * as Vec4 from "./vec4/vec4.js";
|
|
10
|
+
export type Quat = import("./quat/quat.js").Type;
|
|
11
|
+
export * as Quat from "./quat/quat.js";
|
|
12
|
+
export type Aabb = import("./aabb/aabb.js").Type;
|
|
13
|
+
export * as Aabb from "./aabb/aabb.js";
|
|
14
|
+
export type Line2 = import("./line2/line2.js").Type;
|
|
15
|
+
export * as Line2 from "./line2/line2.js";
|
|
16
|
+
export type Line3 = import("./line3/line3.js").Type;
|
|
17
|
+
export * as Line3 from "./line3/line3.js";
|
|
18
|
+
export * from "./picking/index.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
export * from "./constants.js";
|
|
23
|
+
// Export the namespace Mat4x4
|
|
24
|
+
export * as Mat4x4 from "./mat4x4/mat4x4.js";
|
|
25
|
+
// Export the namespace Vec2
|
|
26
|
+
export * as Vec2 from "./vec2/vec2.js";
|
|
27
|
+
// Export the namespace Vec3
|
|
28
|
+
export * as Vec3 from "./vec3/vec3.js";
|
|
29
|
+
// Export the namespace Vec4
|
|
30
|
+
export * as Vec4 from "./vec4/vec4.js";
|
|
31
|
+
// Export the namespace Quat
|
|
32
|
+
export * as Quat from "./quat/quat.js";
|
|
33
|
+
// Export the namespace Aabb
|
|
34
|
+
export * as Aabb from "./aabb/aabb.js";
|
|
35
|
+
// Export the namespace Line2
|
|
36
|
+
export * as Line2 from "./line2/line2.js";
|
|
37
|
+
// Export the namespace Line3
|
|
38
|
+
export * as Line3 from "./line3/line3.js";
|
|
39
|
+
export * from "./picking/index.js";
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/math/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,cAAc,gBAAgB,CAAC;AAG/B,8BAA8B;AAC9B,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAI7C,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAGvC,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,4BAA4B;AAC5B,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,6BAA6B;AAC7B,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAI1C,6BAA6B;AAC7B,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|