@opsydyn/effect-three-foldkit 0.6.4 → 1.0.0-next.0

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.
Files changed (120) hide show
  1. package/README.md +26 -21
  2. package/dist/boxSelect.d.ts +91 -117
  3. package/dist/boxSelect.d.ts.map +1 -1
  4. package/dist/browser.d.ts +3 -0
  5. package/dist/browser.d.ts.map +1 -0
  6. package/dist/browser.js +32 -0
  7. package/dist/browser.js.map +10 -0
  8. package/dist/element.d.ts +11 -909
  9. package/dist/element.d.ts.map +1 -1
  10. package/dist/index.d.ts +17 -17
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +173 -2565
  13. package/dist/index.js.map +14 -39
  14. package/dist/inspector.d.ts +4 -21
  15. package/dist/inspector.d.ts.map +1 -1
  16. package/dist/measuringTape.d.ts +39 -46
  17. package/dist/measuringTape.d.ts.map +1 -1
  18. package/dist/mount.d.ts +17 -11
  19. package/dist/mount.d.ts.map +1 -1
  20. package/dist/overlayView.d.ts +7 -18
  21. package/dist/overlayView.d.ts.map +1 -1
  22. package/dist/pivotControls.d.ts +64 -76
  23. package/dist/pivotControls.d.ts.map +1 -1
  24. package/dist/transformGizmo.d.ts +113 -125
  25. package/dist/transformGizmo.d.ts.map +1 -1
  26. package/dist/view.d.ts +21 -4
  27. package/dist/view.d.ts.map +1 -1
  28. package/dist/viewportGizmo.d.ts +107 -119
  29. package/dist/viewportGizmo.d.ts.map +1 -1
  30. package/package.json +15 -10
  31. package/src/boxSelect.ts +12 -133
  32. package/src/browser.ts +16 -0
  33. package/src/element.ts +19 -110
  34. package/src/index.ts +32 -16
  35. package/src/inspector.ts +70 -93
  36. package/src/measuringTape.ts +28 -92
  37. package/src/mount.ts +53 -309
  38. package/src/overlayView.ts +36 -57
  39. package/src/pivotControls.ts +8 -94
  40. package/src/transformGizmo.ts +8 -108
  41. package/src/view.ts +73 -54
  42. package/src/viewportGizmo.ts +8 -97
  43. package/dist/assetRegistry.d.ts +0 -49
  44. package/dist/assetRegistry.d.ts.map +0 -1
  45. package/dist/assets.d.ts +0 -66
  46. package/dist/assets.d.ts.map +0 -1
  47. package/dist/dom/animationFrames.d.ts +0 -12
  48. package/dist/dom/animationFrames.d.ts.map +0 -1
  49. package/dist/dom/canvas.d.ts +0 -33
  50. package/dist/dom/canvas.d.ts.map +0 -1
  51. package/dist/dom/latch.d.ts +0 -15
  52. package/dist/dom/latch.d.ts.map +0 -1
  53. package/dist/dom/models.d.ts +0 -10
  54. package/dist/dom/models.d.ts.map +0 -1
  55. package/dist/dom/overlays.d.ts +0 -24
  56. package/dist/dom/overlays.d.ts.map +0 -1
  57. package/dist/dom/pointer.d.ts +0 -49
  58. package/dist/dom/pointer.d.ts.map +0 -1
  59. package/dist/dom/postprocessing.d.ts +0 -22
  60. package/dist/dom/postprocessing.d.ts.map +0 -1
  61. package/dist/dom/property.d.ts +0 -15
  62. package/dist/dom/property.d.ts.map +0 -1
  63. package/dist/dom/reconciled.d.ts +0 -10
  64. package/dist/dom/reconciled.d.ts.map +0 -1
  65. package/dist/dom/renderSettings.d.ts +0 -58
  66. package/dist/dom/renderSettings.d.ts.map +0 -1
  67. package/dist/dom/typedScenes.d.ts +0 -14
  68. package/dist/dom/typedScenes.d.ts.map +0 -1
  69. package/dist/dom/updates.d.ts +0 -8
  70. package/dist/dom/updates.d.ts.map +0 -1
  71. package/dist/dom/viewport.d.ts +0 -40
  72. package/dist/dom/viewport.d.ts.map +0 -1
  73. package/dist/dom/webgl.d.ts +0 -12
  74. package/dist/dom/webgl.d.ts.map +0 -1
  75. package/dist/dom/webgpu.d.ts +0 -24
  76. package/dist/dom/webgpu.d.ts.map +0 -1
  77. package/dist/dom/webgpuPostprocessing.d.ts +0 -4
  78. package/dist/dom/webgpuPostprocessing.d.ts.map +0 -1
  79. package/dist/dom/xr.d.ts +0 -53
  80. package/dist/dom/xr.d.ts.map +0 -1
  81. package/dist/dom/xrGlide.d.ts +0 -49
  82. package/dist/dom/xrGlide.d.ts.map +0 -1
  83. package/dist/dom/xrHub.d.ts +0 -45
  84. package/dist/dom/xrHub.d.ts.map +0 -1
  85. package/dist/dom/xrInputs.d.ts +0 -40
  86. package/dist/dom/xrInputs.d.ts.map +0 -1
  87. package/dist/dom/xrSpaces.d.ts +0 -33
  88. package/dist/dom/xrSpaces.d.ts.map +0 -1
  89. package/dist/dom/xrTarget.d.ts +0 -36
  90. package/dist/dom/xrTarget.d.ts.map +0 -1
  91. package/dist/environment.d.ts +0 -70
  92. package/dist/environment.d.ts.map +0 -1
  93. package/dist/xr.d.ts +0 -34
  94. package/dist/xr.d.ts.map +0 -1
  95. package/src/assetRegistry.ts +0 -218
  96. package/src/assets.ts +0 -208
  97. package/src/dom/animationFrames.ts +0 -32
  98. package/src/dom/canvas.ts +0 -66
  99. package/src/dom/latch.ts +0 -36
  100. package/src/dom/models.ts +0 -37
  101. package/src/dom/overlays.ts +0 -63
  102. package/src/dom/pointer.ts +0 -176
  103. package/src/dom/postprocessing.ts +0 -116
  104. package/src/dom/property.ts +0 -43
  105. package/src/dom/reconciled.ts +0 -51
  106. package/src/dom/renderSettings.ts +0 -117
  107. package/src/dom/typedScenes.ts +0 -21
  108. package/src/dom/updates.ts +0 -14
  109. package/src/dom/viewport.ts +0 -97
  110. package/src/dom/webgl.ts +0 -231
  111. package/src/dom/webgpu.ts +0 -220
  112. package/src/dom/webgpuPostprocessing.ts +0 -102
  113. package/src/dom/xr.ts +0 -211
  114. package/src/dom/xrGlide.ts +0 -114
  115. package/src/dom/xrHub.ts +0 -118
  116. package/src/dom/xrInputs.ts +0 -309
  117. package/src/dom/xrSpaces.ts +0 -287
  118. package/src/dom/xrTarget.ts +0 -71
  119. package/src/environment.ts +0 -83
  120. package/src/xr.ts +0 -36
package/README.md CHANGED
@@ -1,32 +1,37 @@
1
1
  # @opsydyn/effect-three-foldkit
2
2
 
3
- A thin Foldkit adapter for [`@opsydyn/effect-three`](../effect-three/README.md): derive a Three.js scene from your Model, get pointer interaction back as your own typed Messages, and let Foldkit's runtime own the scene's lifetime.
3
+ An Effect UI adapter for [`@opsydyn/effect-three`](../effect-three/README.md). Derive the scene from your component model, handle typed scene events, and let Effect UI scope the renderer to its element.
4
4
 
5
- > Status: `0.x`, released with the core at one version ([Stability](../effect-three/README.md#stability), [Limits](../effect-three/README.md#limits)). The API is documented in [`etc/effect-three-foldkit.api.md`](etc/effect-three-foldkit.api.md). Live samples are in `apps/web` at `/effect-three` and on the effect-three promo site (`apps/three-promo`); their source is in [`packages/effect-three-samples`](../effect-three-samples/).
5
+ > Releases use the same version as the core ([Stability](../effect-three/README.md#stability), [Limits](../effect-three/README.md#limits)). The API is documented in [`etc/effect-three-foldkit.api.md`](etc/effect-three-foldkit.api.md). Live samples are in `apps/web` at `/effect-three` and on the effect-three promo site (`apps/three-promo`); their source is in [`packages/effect-three-samples`](../effect-three-samples/).
6
6
 
7
7
  ```sh
8
- npm install @opsydyn/effect-three-foldkit @opsydyn/effect-three effect foldkit three
8
+ npm install ./opsydyn-effect-three-foldkit-1.0.0-next.0.tgz ./opsydyn-effect-three-1.0.0-next.0.tgz effect@4.1.6 three https://pkg.pr.new/Effect-TS/ui/@effect/ui@77dcd92
9
9
  ```
10
10
 
11
+ The command uses the coordinated local prerelease archives. For a FoldKit runtime, use the previous `0.x` release and its corresponding documentation.
12
+
11
13
  ## Use it
12
14
 
13
15
  ```ts
14
16
  // entry: once per application
15
- import * as EffectThreeFoldkit from '@opsydyn/effect-three-foldkit';
17
+ import * as EffectThreeUi from '@opsydyn/effect-three-foldkit';
16
18
 
17
- export const environment = EffectThreeFoldkit.makeEnvironment(window);
18
- export const sceneMount = EffectThreeFoldkit.makeSceneMount(environment);
19
+ export const environment = EffectThreeUi.makeEnvironment(window);
20
+ export const sceneMount = EffectThreeUi.makeSceneMount(environment);
19
21
  ```
20
22
 
21
23
  ```ts
22
24
  // message.ts
23
- export const Message = defineMessageUnion({
25
+ import { UiSchema } from '@effect/ui';
26
+ import { Schema } from 'effect';
27
+
28
+ export const Message = UiSchema.TaggedEnum({
24
29
  ClickedCube: { key: Schema.String },
25
- ReceivedSceneLifecycle: { lifecycle: EffectThreeFoldkit.SceneLifecycle },
30
+ ReceivedSceneLifecycle: { lifecycle: EffectThreeUi.SceneLifecycle },
26
31
  });
27
32
 
28
33
  // view.ts
29
- EffectThreeFoldkit.view(
34
+ EffectThreeUi.view(
30
35
  {
31
36
  scene: sceneFor(model), // plain data derived from the Model
32
37
  mount: sceneMount,
@@ -38,8 +43,8 @@ EffectThreeFoldkit.view(
38
43
  );
39
44
  ```
40
45
 
41
- - **Updates are in place.** Foldkit hands the element a new scene on every render, and the core diffs it, so unchanged scenes cost no host changes and changed ones reuse their three.js objects.
42
- - **Animation never touches the Model.** Behaviours such as `spin` run in the frame loop, outside Foldkit's `update`.
46
+ - **Updates are in place.** Effect UI delivers changed mount arguments and the core reconciles each new scene, so unchanged scenes cost no host changes and changed ones reuse their three.js objects.
47
+ - **Animation never touches the Model.** Behaviours such as `spin` run in the frame loop, outside the component's `update`.
43
48
  - **Events are typed and opt-in:** `onClick`, `onDoubleClick`, `onContextMenu`, `onPointerDown`, `onPointerUp`, `onPointerEnter`, `onPointerMove`, `onPointerLeave`, `onPointerMissed`, `onWheel`, `onDrag`, `onDragEnd`, `onGesture`, `onGestureEnd`, `onAutoRotated`, `onCollision`, `onContactForce`, `onPhysicsReached`, `onMeasured`, `onLabelMeasured`, `onXRSession`, `onXRStick`, `onXRButton`, `onXRSurface`, `onXRMoved`, `onXRPlanes`, `onXRMeshes`, `onPerformanceChange`, `onError`, `onReconciled`, `onAssetLoaded` and `onAssetFailed`. Only the handlers you pass are bound. Hits carry the mesh key (and instance), world-space point, distance, face normal and uv.
44
49
  - **Controls:** with `scene({ gestures: 'scene' })`, `onGesture` reports drags, the wheel and pinches; `orbit(model.camera, gesture)` moves a camera kept in the Model ([ADR-006](../../docs/effect-three/adr/006-controls-as-data.md)).
45
50
  - **Editing widgets as submodels:** `TransformGizmo` (three's `TransformControls`), `PivotControls` (Drei's), `BoxSelect` (three's `SelectionBox`, from shift-drags), `ViewportGizmo` (Drei's `GizmoHelper`, in a scene's `hud`) and `MeasuringTape` each keep a Model, take Messages from the scene's events and report OutMessages (`Moved`, `Finished`, `Selected`, `Turned`, `Measured`) for the parent to apply; `inspectorView` draws the fields `Inspector.fields` reads from a schema as a form. The core keeps the maths pure and checked against three's and Drei's own ([ADR-006](../../docs/effect-three/adr/006-controls-as-data.md)).
@@ -52,20 +57,20 @@ EffectThreeFoldkit.view(
52
57
  - **XR:** `environment.xr.supported(mode)`, `enter(mode)` and `exit` are Effects for Commands; `enter` (from a click) presents the mounted scene that describes `xr`, in VR or AR. Controllers and hands hover, click and drag; sticks, buttons and AR surfaces arrive through `onXRStick`, `onXRButton` and `onXRSurface` ([ADR-008](../../docs/effect-three/adr/008-immersive-sessions.md)).
53
58
  - **Browser defaults:** a context menu over an interactive mesh keeps the browser's menu shut; elsewhere it opens as usual. Wheel listening is passive, so the page still scrolls.
54
59
  - **Update telemetry:** `onReconciled` reports what each update did (created, updated, moved, removed, replaced, reordered) and the GPU resources held afterwards. It fires at startup and after updates that changed something, never for no-ops, so storing it in the Model can't loop.
55
- - **Lifecycle:** `StartedScene` once the scene is running, or `FailedScene { reason }` (malformed or invalid scene, or no WebGL2).
60
+ - **Lifecycle:** `StartedScene` once the scene is running, or `FailedScene { reason }` (invalid scene, unavailable renderer, or unavailable physics).
56
61
 
57
62
  ## What the Mount handles
58
63
 
59
- | Concern | Behaviour |
60
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
- | Unmount | Releases the renderer, the WebGL context (`forceContextLoss`), GPU resources, pointer listeners, observers and the frame subscription. |
62
- | Resize | `ResizeObserver` updates the camera aspect and drawing buffer; device pixel ratio is capped at 2. |
63
- | Off-screen | `IntersectionObserver` pauses frames while the element isn't visible. |
64
- | Reduced motion | `prefers-reduced-motion: reduce` freezes behaviours; frames still render. |
65
- | DevTools time travel | While Foldkit reports the view as `Paused`, pointer input and scene events are dropped. |
66
- | Validation | Scenes passed through `view` are type-checked at compile time and skip runtime validation. Any other value assigned to the element is Schema-decoded, and failures arrive as `onError` with `MalformedScene`. |
64
+ | Concern | Behaviour |
65
+ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | Unmount | Releases the renderer, the WebGL context (`forceContextLoss`), GPU resources, pointer listeners, observers and the frame subscription. |
67
+ | Resize | `ResizeObserver` updates the camera aspect and drawing buffer; device pixel ratio is capped at 2. |
68
+ | Off-screen | `IntersectionObserver` pauses frames while the element isn't visible. |
69
+ | Reduced motion | `prefers-reduced-motion: reduce` freezes behaviours; frames still render. |
70
+ | Input gate | Set `live: false` to drop pointer and scene events while showing the scene. |
71
+ | Scene updates | A rejected description reports `onError`; the renderer keeps its last valid scene. |
67
72
 
68
- `<effect-three-scene>` is never registered with `customElements`, so there's nothing to re-register under HMR or guard during SSR. See [ADR-002](../../docs/effect-three/adr/002-foldkit-adapter-seam.md).
73
+ The mount receives the description as an Effect UI argument. The browser host reconciles later arguments and releases the canvas and GPU resources with the element's scope. Scene events are Schema-decoded by `sceneElement`. For a server-rendered component, use `defineScopedSceneMount` with an Effect that acquires the browser environment when the mount runs.
69
74
 
70
75
  ## Options
71
76
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Box selection as a Foldkit submodel (roadmap, "Beyond parity" 5), after Drei's `Select`
2
+ * Box selection as an Effect UI submodel (roadmap, "Beyond parity" 5), after Drei's `Select`
3
3
  * over three.js's `SelectionBox`: a shift-drag that begins on nothing draws a box, and
4
4
  * its release selects what the box holds, through the core's pure `boxSelect`. The parent
5
5
  * owns what is selected; the submodel owns only the box:
@@ -17,134 +17,108 @@
17
17
  *
18
18
  * @module
19
19
  */
20
- import { type Camera, type Gesture } from '@opsydyn/effect-three';
21
- import { Option, Schema } from 'effect';
22
- import type { ReturnWithOutMessage } from 'foldkit/update';
23
- /** Something the box can select: its key, and the point that must fall inside. */
24
- declare const Selectable: Schema.Struct<{
25
- readonly key: Schema.String;
26
- readonly at: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
27
- }>;
28
- /** A box being drawn: its corners in the canvas's normalised coordinates, −1 to 1, y up. */
29
- export declare const Box: Schema.Struct<{
30
- readonly from: Schema.Struct<{
31
- readonly x: Schema.Finite;
32
- readonly y: Schema.Finite;
20
+ import { UiSchema } from '@effect/ui';
21
+ import { BoxSelect as Controller } from '@opsydyn/effect-three/browser';
22
+ export declare const Box: import("effect/Schema").Struct<{
23
+ readonly from: import("effect/Schema").Struct<{
24
+ readonly x: import("effect/Schema").Finite;
25
+ readonly y: import("effect/Schema").Finite;
33
26
  }>;
34
- readonly to: Schema.Struct<{
35
- readonly x: Schema.Finite;
36
- readonly y: Schema.Finite;
27
+ readonly to: import("effect/Schema").Struct<{
28
+ readonly x: import("effect/Schema").Finite;
29
+ readonly y: import("effect/Schema").Finite;
37
30
  }>;
38
- readonly width: Schema.Finite;
39
- readonly height: Schema.Finite;
40
- }>;
41
- export type Box = typeof Box.Type;
42
- export declare const Model: Schema.Struct<{
43
- readonly box: Schema.Option<Schema.Struct<{
44
- readonly from: Schema.Struct<{
45
- readonly x: Schema.Finite;
46
- readonly y: Schema.Finite;
31
+ readonly width: import("effect/Schema").Finite;
32
+ readonly height: import("effect/Schema").Finite;
33
+ }>, Model: import("effect/Schema").Struct<{
34
+ readonly box: import("effect/Schema").Option<import("effect/Schema").Struct<{
35
+ readonly from: import("effect/Schema").Struct<{
36
+ readonly x: import("effect/Schema").Finite;
37
+ readonly y: import("effect/Schema").Finite;
47
38
  }>;
48
- readonly to: Schema.Struct<{
49
- readonly x: Schema.Finite;
50
- readonly y: Schema.Finite;
39
+ readonly to: import("effect/Schema").Struct<{
40
+ readonly x: import("effect/Schema").Finite;
41
+ readonly y: import("effect/Schema").Finite;
51
42
  }>;
52
- readonly width: Schema.Finite;
53
- readonly height: Schema.Finite;
43
+ readonly width: import("effect/Schema").Finite;
44
+ readonly height: import("effect/Schema").Finite;
54
45
  }>>;
55
- }>;
56
- export type Model = typeof Model.Type;
57
- export declare const Message: import("foldkit/message").MessageUnion<{
58
- readonly Dragged: {
59
- x: Schema.Finite;
60
- y: Schema.Finite;
61
- deltaX: Schema.Finite;
62
- deltaY: Schema.Finite;
63
- width: Schema.Finite;
64
- height: Schema.Finite;
65
- };
66
- readonly Ended: {
67
- camera: Schema.Union<readonly [Schema.TaggedStruct<"Perspective", {
68
- readonly fov: Schema.Finite;
69
- readonly near: Schema.Finite;
70
- readonly far: Schema.Finite;
71
- readonly position: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
72
- readonly lookAt: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
73
- readonly damping: Schema.Finite;
74
- readonly autoRotate: Schema.Finite;
75
- readonly shake: Schema.withDecodingDefaultKey<Schema.NullOr<Schema.Struct<{
76
- readonly intensity: Schema.Finite;
77
- readonly decay: Schema.Boolean;
78
- readonly decayRate: Schema.Finite;
79
- readonly maxYaw: Schema.Finite;
80
- readonly maxPitch: Schema.Finite;
81
- readonly maxRoll: Schema.Finite;
82
- readonly yawFrequency: Schema.Finite;
83
- readonly pitchFrequency: Schema.Finite;
84
- readonly rollFrequency: Schema.Finite;
85
- readonly trigger: Schema.Finite;
46
+ }>, init: () => Controller.Model, drawing: (model: Controller.Model) => boolean, claims: (model: Controller.Model, drag: Controller.DragGesture) => boolean, inside: (model: Controller.Model, camera: import("@opsydyn/effect-three").Camera, selectable: readonly {
47
+ readonly key: string;
48
+ readonly at: readonly [number, number, number];
49
+ }[]) => ReadonlyArray<string>, rectangle: (model: Controller.Model) => import("effect/Option").Option<Controller.Rectangle>;
50
+ export type Model = Controller.Model;
51
+ export type DragGesture = Controller.DragGesture;
52
+ export type Rectangle = Controller.Rectangle;
53
+ export declare const Message: UiSchema.TaggedEnum<{
54
+ readonly Cancelled: import("effect/Schema").TaggedStruct<"Cancelled", {}>;
55
+ readonly Dragged: import("effect/Schema").TaggedStruct<"Dragged", {
56
+ readonly x: import("effect/Schema").Finite;
57
+ readonly y: import("effect/Schema").Finite;
58
+ readonly deltaX: import("effect/Schema").Finite;
59
+ readonly deltaY: import("effect/Schema").Finite;
60
+ readonly width: import("effect/Schema").Finite;
61
+ readonly height: import("effect/Schema").Finite;
62
+ }>;
63
+ readonly Ended: import("effect/Schema").TaggedStruct<"Ended", {
64
+ readonly camera: import("effect/Schema").Union<readonly [import("effect/Schema").TaggedStruct<"Perspective", {
65
+ readonly fov: import("effect/Schema").Finite;
66
+ readonly near: import("effect/Schema").Finite;
67
+ readonly far: import("effect/Schema").Finite;
68
+ readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
69
+ readonly lookAt: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
70
+ readonly damping: import("effect/Schema").Finite;
71
+ readonly autoRotate: import("effect/Schema").Finite;
72
+ readonly shake: import("effect/Schema").withDecodingDefaultKey<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
73
+ readonly intensity: import("effect/Schema").Finite;
74
+ readonly decay: import("effect/Schema").Boolean;
75
+ readonly decayRate: import("effect/Schema").Finite;
76
+ readonly maxYaw: import("effect/Schema").Finite;
77
+ readonly maxPitch: import("effect/Schema").Finite;
78
+ readonly maxRoll: import("effect/Schema").Finite;
79
+ readonly yawFrequency: import("effect/Schema").Finite;
80
+ readonly pitchFrequency: import("effect/Schema").Finite;
81
+ readonly rollFrequency: import("effect/Schema").Finite;
82
+ readonly trigger: import("effect/Schema").Finite;
86
83
  }>>, never>;
87
- }>, Schema.TaggedStruct<"Orthographic", {
88
- readonly zoom: Schema.Finite;
89
- readonly near: Schema.Finite;
90
- readonly far: Schema.Finite;
91
- readonly position: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
92
- readonly lookAt: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
93
- readonly damping: Schema.Finite;
94
- readonly autoRotate: Schema.Finite;
95
- readonly shake: Schema.withDecodingDefaultKey<Schema.NullOr<Schema.Struct<{
96
- readonly intensity: Schema.Finite;
97
- readonly decay: Schema.Boolean;
98
- readonly decayRate: Schema.Finite;
99
- readonly maxYaw: Schema.Finite;
100
- readonly maxPitch: Schema.Finite;
101
- readonly maxRoll: Schema.Finite;
102
- readonly yawFrequency: Schema.Finite;
103
- readonly pitchFrequency: Schema.Finite;
104
- readonly rollFrequency: Schema.Finite;
105
- readonly trigger: Schema.Finite;
84
+ }>, import("effect/Schema").TaggedStruct<"Orthographic", {
85
+ readonly zoom: import("effect/Schema").Finite;
86
+ readonly near: import("effect/Schema").Finite;
87
+ readonly far: import("effect/Schema").Finite;
88
+ readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
89
+ readonly lookAt: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
90
+ readonly damping: import("effect/Schema").Finite;
91
+ readonly autoRotate: import("effect/Schema").Finite;
92
+ readonly shake: import("effect/Schema").withDecodingDefaultKey<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
93
+ readonly intensity: import("effect/Schema").Finite;
94
+ readonly decay: import("effect/Schema").Boolean;
95
+ readonly decayRate: import("effect/Schema").Finite;
96
+ readonly maxYaw: import("effect/Schema").Finite;
97
+ readonly maxPitch: import("effect/Schema").Finite;
98
+ readonly maxRoll: import("effect/Schema").Finite;
99
+ readonly yawFrequency: import("effect/Schema").Finite;
100
+ readonly pitchFrequency: import("effect/Schema").Finite;
101
+ readonly rollFrequency: import("effect/Schema").Finite;
102
+ readonly trigger: import("effect/Schema").Finite;
106
103
  }>>, never>;
107
104
  }>]>;
108
- selectable: Schema.$Array<Schema.Struct<{
109
- readonly key: Schema.String;
110
- readonly at: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
105
+ readonly selectable: import("effect/Schema").$Array<import("effect/Schema").Struct<{
106
+ readonly key: import("effect/Schema").String;
107
+ readonly at: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
111
108
  }>>;
112
- };
113
- readonly Cancelled: {};
109
+ }>;
114
110
  }>;
115
111
  export type Message = typeof Message.Type;
116
- export declare const OutMessage: import("foldkit/message").MessageUnion<{
117
- /** The box was let go: the keys inside it, for the new selection. */
118
- readonly Selected: {
119
- keys: Schema.$Array<Schema.String>;
120
- };
112
+ export declare const OutMessage: UiSchema.TaggedEnum<{
113
+ readonly Selected: import("effect/Schema").TaggedStruct<"Selected", {
114
+ readonly keys: import("effect/Schema").$Array<import("effect/Schema").String>;
115
+ }>;
121
116
  }>;
122
117
  export type OutMessage = typeof OutMessage.Type;
123
- /** No box drawn. */
124
- export declare const init: () => Model;
125
- type Return = ReturnWithOutMessage<Model, Message, OutMessage>;
126
- type Selectables = ReadonlyArray<typeof Selectable.Type>;
127
- export declare const update: (model: Model, message: Message) => Return;
128
- /** Whether a box is being drawn: the parent leaves the camera alone while it is. */
129
- export declare const drawing: (model: Model) => boolean;
130
- /** A scene `Drag` gesture: the only kind a box takes. */
131
- export type DragGesture = Extract<Gesture, {
132
- readonly _tag: 'Drag';
133
- }>;
134
- /** Whether the box takes `drag`: every drag while one is drawn, and one that starts it. */
135
- export declare const claims: (model: Model, drag: DragGesture) => boolean;
136
- /** The `Dragged` Message for a drag the box claims. */
137
- export declare const dragOf: (gesture: DragGesture) => Message;
138
- /** What the box holds so far, seen through `camera`: none while no box is drawn. */
139
- export declare const inside: (model: Model, camera: Camera, selectable: Selectables) => ReadonlyArray<string>;
140
- /** A box on the canvas, in CSS pixels from its top left. */
141
- export type Rectangle = {
142
- readonly left: number;
143
- readonly top: number;
144
- readonly width: number;
145
- readonly height: number;
118
+ export declare const update: (model: Controller.Model, message: Controller.Message) => {
119
+ readonly model: Controller.Model;
120
+ readonly outMessage?: Controller.OutMessage;
146
121
  };
147
- /** Where the box sits on the canvas, while one is drawn. */
148
- export declare const rectangle: (model: Model) => Option.Option<Rectangle>;
149
- export {};
122
+ /** Turns the scene's drag gesture into the box selection's message. */
123
+ export declare const dragOf: (gesture: DragGesture) => Message;
150
124
  //# sourceMappingURL=boxSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boxSelect.d.ts","sourceRoot":"","sources":["../src/boxSelect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,OAAO,EAAe,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,kFAAkF;AAClF,QAAA,MAAM,UAAU;;;EAA8D,CAAC;AAE/E,4FAA4F;AAC5F,eAAO,MAAM,GAAG;;;;;;;;;;;EAKd,CAAC;AACH,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,IAAI,CAAC;AAElC,eAAO,MAAM,KAAK;;;;;;;;;;;;;EAA6C,CAAC;AAChE,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAEtC,eAAO,MAAM,OAAO;;QAEhB,CAAC;QACD,CAAC;QACD,MAAM;QACN,MAAM;QACN,KAAK;QACL,MAAM;;;QAEC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAsB,UAAU;;;;;;EAE/C,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,eAAO,MAAM,UAAU;IACrB,qEAAqE;;QACzD,IAAI;;EAChB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,oBAAoB;AACpB,eAAO,MAAM,IAAI,QAAO,KAAiC,CAAC;AAE1D,KAAK,MAAM,GAAG,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAe/D,KAAK,WAAW,GAAG,aAAa,CAAC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAczD,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO,KAAG,MAKpD,CAAC;AAEL,oFAAoF;AACpF,eAAO,MAAM,OAAO,UAAW,KAAK,KAAG,OAAmC,CAAC;AAE3E,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAStE,2FAA2F;AAC3F,eAAO,MAAM,MAAM,UAAW,KAAK,QAAQ,WAAW,KAAG,OACtB,CAAC;AAEpC,uDAAuD;AACvD,eAAO,MAAM,MAAM,YAAa,WAAW,KAAG,OAQ1C,CAAC;AAEL,oFAAoF;AACpF,eAAO,MAAM,MAAM,UACV,KAAK,UACJ,MAAM,cACF,WAAW,KACtB,aAAa,CAAC,MAAM,CAInB,CAAC;AAEL,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAUF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAC/B,CAAC"}
1
+ {"version":3,"file":"boxSelect.d.ts","sourceRoot":"","sources":["../src/boxSelect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAExE,eAAO,MAAQ,GAAG;;;;;;;;;;;IAAE,KAAK;;;;;;;;;;;;;IAAE,IAAI,0BAAE,OAAO,wCAAE,MAAM,sEAAE,MAAM;;;+BAAE,SAAS,mFAAe,CAAC;AACnF,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;AACjD,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;AAE7C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgD,CAAC;AACrE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAC1C,eAAO,MAAM,UAAU;;;;EAAmD,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,eAAO,MAAM,MAAM;;;CAAoB,CAAC;AAExC,uEAAuE;AACvE,eAAO,MAAM,MAAM,YAAa,WAAW,KAAG,OAAqC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** @deprecated Use @opsydyn/effect-three/browser. */
2
+ export { BoxSelect, type Environment, makeEnvironment, MeasuringTape, mountSceneHost, overlayData, PivotControls, ReconciledDetail, sceneEventSchemas, TransformGizmo, ViewportGizmo, webglRendererFactory, webgpuRendererFactory, } from '@opsydyn/effect-three/browser';
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EACL,SAAS,EACT,KAAK,WAAW,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,32 @@
1
+ // src/browser.ts
2
+ import {
3
+ BoxSelect,
4
+ makeEnvironment,
5
+ MeasuringTape,
6
+ mountSceneHost,
7
+ overlayData,
8
+ PivotControls,
9
+ ReconciledDetail,
10
+ sceneEventSchemas,
11
+ TransformGizmo,
12
+ ViewportGizmo,
13
+ webglRendererFactory,
14
+ webgpuRendererFactory
15
+ } from "@opsydyn/effect-three/browser";
16
+ export {
17
+ BoxSelect,
18
+ MeasuringTape,
19
+ PivotControls,
20
+ ReconciledDetail,
21
+ TransformGizmo,
22
+ ViewportGizmo,
23
+ makeEnvironment,
24
+ mountSceneHost,
25
+ overlayData,
26
+ sceneEventSchemas,
27
+ webglRendererFactory,
28
+ webgpuRendererFactory
29
+ };
30
+
31
+ //# debugId=2B6D5EA924DBBEC264756E2164756E21
32
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/browser.ts"],
4
+ "sourcesContent": [
5
+ "/** @deprecated Use @opsydyn/effect-three/browser. */\nexport {\n BoxSelect,\n type Environment,\n makeEnvironment,\n MeasuringTape,\n mountSceneHost,\n overlayData,\n PivotControls,\n ReconciledDetail,\n sceneEventSchemas,\n TransformGizmo,\n ViewportGizmo,\n webglRendererFactory,\n webgpuRendererFactory,\n} from '@opsydyn/effect-three/browser';\n"
6
+ ],
7
+ "mappings": ";AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
8
+ "debugId": "2B6D5EA924DBBEC264756E2164756E21",
9
+ "names": []
10
+ }