@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.
- package/README.md +26 -21
- package/dist/boxSelect.d.ts +91 -117
- package/dist/boxSelect.d.ts.map +1 -1
- package/dist/browser.d.ts +3 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +32 -0
- package/dist/browser.js.map +10 -0
- package/dist/element.d.ts +11 -909
- package/dist/element.d.ts.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +173 -2565
- package/dist/index.js.map +14 -39
- package/dist/inspector.d.ts +4 -21
- package/dist/inspector.d.ts.map +1 -1
- package/dist/measuringTape.d.ts +39 -46
- package/dist/measuringTape.d.ts.map +1 -1
- package/dist/mount.d.ts +17 -11
- package/dist/mount.d.ts.map +1 -1
- package/dist/overlayView.d.ts +7 -18
- package/dist/overlayView.d.ts.map +1 -1
- package/dist/pivotControls.d.ts +64 -76
- package/dist/pivotControls.d.ts.map +1 -1
- package/dist/transformGizmo.d.ts +113 -125
- package/dist/transformGizmo.d.ts.map +1 -1
- package/dist/view.d.ts +21 -4
- package/dist/view.d.ts.map +1 -1
- package/dist/viewportGizmo.d.ts +107 -119
- package/dist/viewportGizmo.d.ts.map +1 -1
- package/package.json +15 -10
- package/src/boxSelect.ts +12 -133
- package/src/browser.ts +16 -0
- package/src/element.ts +19 -110
- package/src/index.ts +32 -16
- package/src/inspector.ts +70 -93
- package/src/measuringTape.ts +28 -92
- package/src/mount.ts +53 -309
- package/src/overlayView.ts +36 -57
- package/src/pivotControls.ts +8 -94
- package/src/transformGizmo.ts +8 -108
- package/src/view.ts +73 -54
- package/src/viewportGizmo.ts +8 -97
- package/dist/assetRegistry.d.ts +0 -49
- package/dist/assetRegistry.d.ts.map +0 -1
- package/dist/assets.d.ts +0 -66
- package/dist/assets.d.ts.map +0 -1
- package/dist/dom/animationFrames.d.ts +0 -12
- package/dist/dom/animationFrames.d.ts.map +0 -1
- package/dist/dom/canvas.d.ts +0 -33
- package/dist/dom/canvas.d.ts.map +0 -1
- package/dist/dom/latch.d.ts +0 -15
- package/dist/dom/latch.d.ts.map +0 -1
- package/dist/dom/models.d.ts +0 -10
- package/dist/dom/models.d.ts.map +0 -1
- package/dist/dom/overlays.d.ts +0 -24
- package/dist/dom/overlays.d.ts.map +0 -1
- package/dist/dom/pointer.d.ts +0 -49
- package/dist/dom/pointer.d.ts.map +0 -1
- package/dist/dom/postprocessing.d.ts +0 -22
- package/dist/dom/postprocessing.d.ts.map +0 -1
- package/dist/dom/property.d.ts +0 -15
- package/dist/dom/property.d.ts.map +0 -1
- package/dist/dom/reconciled.d.ts +0 -10
- package/dist/dom/reconciled.d.ts.map +0 -1
- package/dist/dom/renderSettings.d.ts +0 -58
- package/dist/dom/renderSettings.d.ts.map +0 -1
- package/dist/dom/typedScenes.d.ts +0 -14
- package/dist/dom/typedScenes.d.ts.map +0 -1
- package/dist/dom/updates.d.ts +0 -8
- package/dist/dom/updates.d.ts.map +0 -1
- package/dist/dom/viewport.d.ts +0 -40
- package/dist/dom/viewport.d.ts.map +0 -1
- package/dist/dom/webgl.d.ts +0 -12
- package/dist/dom/webgl.d.ts.map +0 -1
- package/dist/dom/webgpu.d.ts +0 -24
- package/dist/dom/webgpu.d.ts.map +0 -1
- package/dist/dom/webgpuPostprocessing.d.ts +0 -4
- package/dist/dom/webgpuPostprocessing.d.ts.map +0 -1
- package/dist/dom/xr.d.ts +0 -53
- package/dist/dom/xr.d.ts.map +0 -1
- package/dist/dom/xrGlide.d.ts +0 -49
- package/dist/dom/xrGlide.d.ts.map +0 -1
- package/dist/dom/xrHub.d.ts +0 -45
- package/dist/dom/xrHub.d.ts.map +0 -1
- package/dist/dom/xrInputs.d.ts +0 -40
- package/dist/dom/xrInputs.d.ts.map +0 -1
- package/dist/dom/xrSpaces.d.ts +0 -33
- package/dist/dom/xrSpaces.d.ts.map +0 -1
- package/dist/dom/xrTarget.d.ts +0 -36
- package/dist/dom/xrTarget.d.ts.map +0 -1
- package/dist/environment.d.ts +0 -70
- package/dist/environment.d.ts.map +0 -1
- package/dist/xr.d.ts +0 -34
- package/dist/xr.d.ts.map +0 -1
- package/src/assetRegistry.ts +0 -218
- package/src/assets.ts +0 -208
- package/src/dom/animationFrames.ts +0 -32
- package/src/dom/canvas.ts +0 -66
- package/src/dom/latch.ts +0 -36
- package/src/dom/models.ts +0 -37
- package/src/dom/overlays.ts +0 -63
- package/src/dom/pointer.ts +0 -176
- package/src/dom/postprocessing.ts +0 -116
- package/src/dom/property.ts +0 -43
- package/src/dom/reconciled.ts +0 -51
- package/src/dom/renderSettings.ts +0 -117
- package/src/dom/typedScenes.ts +0 -21
- package/src/dom/updates.ts +0 -14
- package/src/dom/viewport.ts +0 -97
- package/src/dom/webgl.ts +0 -231
- package/src/dom/webgpu.ts +0 -220
- package/src/dom/webgpuPostprocessing.ts +0 -102
- package/src/dom/xr.ts +0 -211
- package/src/dom/xrGlide.ts +0 -114
- package/src/dom/xrHub.ts +0 -118
- package/src/dom/xrInputs.ts +0 -309
- package/src/dom/xrSpaces.ts +0 -287
- package/src/dom/xrTarget.ts +0 -71
- package/src/environment.ts +0 -83
- package/src/xr.ts +0 -36
package/dist/inspector.d.ts
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* An inspector panel for Foldkit views (roadmap, "Beyond parity" 4): the fields the
|
|
3
|
-
* core's `Inspector.fields` reads from a schema, drawn as a form. Each control reports
|
|
4
|
-
* an edit as the app's own Message, with the field's path and the new value; the app
|
|
5
|
-
* applies it with `Inspector.edit`, which the schema checks, and keeps the result (or
|
|
6
|
-
* shows why it was refused).
|
|
7
|
-
*
|
|
8
|
-
* Numbers, text and choices report when they change (on Enter or leaving the field),
|
|
9
|
-
* colours as they are picked, switches when clicked, and each of a vector's three
|
|
10
|
-
* numbers on its own. Kinds, absent parts and lists are shown, not edited.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
1
|
+
import type { Html } from '@effect/ui/html';
|
|
14
2
|
import type { FieldPath, FieldValue, InspectedField } from '@opsydyn/effect-three';
|
|
15
|
-
|
|
16
|
-
/** Turns an edit (where, and the new value) into the app's Message. */
|
|
3
|
+
/** Maps a field edit to an application message. */
|
|
17
4
|
export type OnEdit<Message> = (path: FieldPath, value: FieldValue) => Message;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
* with the classes `e3-inspector`, `e3-inspector-row`, `e3-inspector-name`,
|
|
21
|
-
* `e3-inspector-vector` and `e3-inspector-fixed`.
|
|
22
|
-
*/
|
|
23
|
-
export declare const inspectorView: <Message>(h: HtmlBuilder<Message>, fields: ReadonlyArray<InspectedField>, onEdit: OnEdit<Message>) => Html;
|
|
5
|
+
/** Displays schema-derived field controls and maps edits to application messages. */
|
|
6
|
+
export declare const inspectorView: <Message>(h: Html.H<Message>, fields: ReadonlyArray<InspectedField>, onEdit: OnEdit<Message>) => Html.Element<Message, never, Html.Events, HTMLDivElement, "div">;
|
|
24
7
|
//# sourceMappingURL=inspector.d.ts.map
|
package/dist/inspector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../src/inspector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../src/inspector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGnF,mDAAmD;AACnD,MAAM,MAAM,MAAM,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;AA8E9E,qFAAqF;AACrF,eAAO,MAAM,aAAa,GAAI,OAAO,KAChC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,UACV,aAAa,CAAC,cAAc,CAAC,UAC7B,MAAM,CAAC,OAAO,CAAC,qEACsE,CAAC"}
|
package/dist/measuringTape.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A measuring tape as a
|
|
2
|
+
* A measuring tape as a Effect UI submodel (roadmap, "Beyond parity" 5): the core's pure
|
|
3
3
|
* `tape` with Messages for clicks and pointer moves on the scene, an OutMessage when a
|
|
4
4
|
* length is measured, and its length as HTML at the tape's middle. The parent decides
|
|
5
5
|
* when the tape is in use and which clicks are on the scene:
|
|
@@ -15,62 +15,55 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @module
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
18
|
+
import { UiSchema } from '@effect/ui';
|
|
19
|
+
import type { Html } from '@effect/ui/html';
|
|
20
|
+
import { MeasuringTape as Controller } from '@opsydyn/effect-three/browser';
|
|
21
|
+
import { Option } from 'effect';
|
|
22
22
|
import type { OverlayView } from './overlayView.ts';
|
|
23
|
-
export declare const Model: Schema.Struct<{
|
|
24
|
-
|
|
25
|
-
readonly
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
|
|
23
|
+
export declare const Model: import("effect/Schema").Struct<{
|
|
24
|
+
readonly key: import("effect/Schema").String;
|
|
25
|
+
readonly tape: import("effect/Schema").Struct<{
|
|
26
|
+
readonly from: import("effect/Schema").NullOr<import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>>;
|
|
27
|
+
readonly to: import("effect/Schema").NullOr<import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>>;
|
|
28
|
+
readonly pointer: import("effect/Schema").NullOr<import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>>;
|
|
29
|
+
readonly snap: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
30
|
+
}>;
|
|
31
|
+
}>, init: (key: string, options?: {
|
|
32
|
+
readonly snap?: number | null;
|
|
33
|
+
}) => Controller.Model, length: (model: Controller.Model) => Option.Option<number>, nodes: (model: Controller.Model, look?: Partial<import("@opsydyn/effect-three").TapeLook>) => import("@opsydyn/effect-three").SceneNode;
|
|
34
|
+
export type Model = Controller.Model;
|
|
35
|
+
export declare const Message: UiSchema.TaggedEnum<{
|
|
36
|
+
readonly ChoseSnap: import("effect/Schema").TaggedStruct<"ChoseSnap", {
|
|
37
|
+
readonly snap: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
38
|
+
}>;
|
|
39
|
+
readonly Cleared: import("effect/Schema").TaggedStruct<"Cleared", {}>;
|
|
40
|
+
readonly Placed: import("effect/Schema").TaggedStruct<"Placed", {
|
|
41
|
+
readonly point: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
42
|
+
}>;
|
|
43
|
+
readonly Pointed: import("effect/Schema").TaggedStruct<"Pointed", {
|
|
44
|
+
readonly point: import("effect/Schema").NullOr<import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>>;
|
|
31
45
|
}>;
|
|
32
|
-
}>;
|
|
33
|
-
export type Model = typeof Model.Type;
|
|
34
|
-
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
35
|
-
readonly Placed: {
|
|
36
|
-
point: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
37
|
-
};
|
|
38
|
-
readonly Pointed: {
|
|
39
|
-
point: Schema.NullOr<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
40
|
-
};
|
|
41
|
-
readonly Cleared: {};
|
|
42
|
-
readonly ChoseSnap: {
|
|
43
|
-
snap: Schema.NullOr<Schema.Finite>;
|
|
44
|
-
};
|
|
45
46
|
}>;
|
|
46
47
|
export type Message = typeof Message.Type;
|
|
47
|
-
export declare const OutMessage:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
48
|
+
export declare const OutMessage: UiSchema.TaggedEnum<{
|
|
49
|
+
readonly Measured: import("effect/Schema").TaggedStruct<"Measured", {
|
|
50
|
+
readonly from: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
51
|
+
readonly to: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
52
|
+
readonly length: import("effect/Schema").Finite;
|
|
53
|
+
}>;
|
|
54
54
|
}>;
|
|
55
55
|
export type OutMessage = typeof OutMessage.Type;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
readonly
|
|
59
|
-
}
|
|
60
|
-
type Return = ReturnWithOutMessage<Model, Message, OutMessage>;
|
|
61
|
-
export declare const update: (model: Model, message: Message) => Return;
|
|
62
|
-
/** The tape's length, while it has one (to the pointer while the second end is placed). */
|
|
63
|
-
export declare const length: (model: Model) => Option.Option<number>;
|
|
64
|
-
/** The tape, for the parent's scene. */
|
|
65
|
-
export declare const nodes: (model: Model, look?: Partial<TapeLook>) => SceneNode;
|
|
56
|
+
export declare const update: (model: Controller.Model, message: Controller.Message) => {
|
|
57
|
+
readonly model: Controller.Model;
|
|
58
|
+
readonly outMessage?: Controller.OutMessage;
|
|
59
|
+
};
|
|
66
60
|
/**
|
|
67
61
|
* The length at the tape's middle, for the view's `overlays`: two decimals and `unit`
|
|
68
62
|
* (`m` unless given), in an element with the class `className` (unstyled unless given).
|
|
69
63
|
* Pointer events pass through it to the scene.
|
|
70
64
|
*/
|
|
71
|
-
export declare const label: <Message>(model: Model, h:
|
|
65
|
+
export declare const label: <Message>(model: Model, h: Html.H<Message>, options?: {
|
|
72
66
|
readonly unit?: string;
|
|
73
67
|
readonly className?: string;
|
|
74
|
-
}) => ReadonlyArray<OverlayView
|
|
75
|
-
export {};
|
|
68
|
+
}) => ReadonlyArray<OverlayView<Message>>;
|
|
76
69
|
//# sourceMappingURL=measuringTape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measuringTape.d.ts","sourceRoot":"","sources":["../src/measuringTape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"measuringTape.d.ts","sourceRoot":"","sources":["../src/measuringTape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAQ,KAAK;;;;;;;;IAAE,IAAI;;wBAAE,MAAM,sDAAE,KAAK,kIAAe,CAAC;AACzD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;AAErC,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;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,SACpB,KAAK,KACT,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YACT;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,KAC/D,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAelC,CAAC"}
|
package/dist/mount.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** Connects an Effect UI mount scope and arguments to the browser scene host. */
|
|
2
|
+
import { Mount } from '@effect/ui';
|
|
3
|
+
import { type SceneDescription } from '@opsydyn/effect-three';
|
|
4
|
+
import { type Environment } from '@opsydyn/effect-three/browser';
|
|
5
|
+
import { Effect, type Scope } from 'effect';
|
|
6
|
+
import { SceneLifecycle } from './element.ts';
|
|
7
|
+
/** Arguments supplied by a component whenever it renders the scene. */
|
|
8
|
+
export type SceneMountArgs = {
|
|
9
|
+
readonly scene: SceneDescription;
|
|
10
|
+
readonly live?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type SceneMount<R = never> = Mount.Factory<SceneMountArgs, SceneLifecycle, HTMLElement, R | Scope.Scope>;
|
|
3
13
|
/**
|
|
4
|
-
* Defines
|
|
5
|
-
*
|
|
14
|
+
* Defines a scene mount with access to the component's environment. The provided
|
|
15
|
+
* Effect can read a shared service or acquire an environment scoped to the scene.
|
|
6
16
|
*/
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly _tag: "FailedScene";
|
|
11
|
-
readonly reason: string;
|
|
12
|
-
}>;
|
|
13
|
-
export type SceneMount = ReturnType<typeof makeSceneMount>;
|
|
17
|
+
export declare const defineScopedSceneMount: <R>(environment: Effect.Effect<Environment, never, R>) => SceneMount<R>;
|
|
18
|
+
/** Defines a scene mount for a shared environment owned by the caller. */
|
|
19
|
+
export declare const makeSceneMount: (environment: Environment) => SceneMount;
|
|
14
20
|
//# sourceMappingURL=mount.d.ts.map
|
package/dist/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,MAAM,EAAU,KAAK,KAAK,EAAU,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,OAAO,CAC/C,cAAc,EACd,cAAc,EACd,WAAW,EACX,CAAC,GAAG,KAAK,CAAC,KAAK,CAChB,CAAC;AAmCF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,eAEzB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,KAChD,UAAU,CAAC,CAAC,CAGZ,CAAC;AAEJ,0EAA0E;AAC1E,eAAO,MAAM,cAAc,gBAAiB,WAAW,KAAG,UAIzD,CAAC"}
|
package/dist/overlayView.d.ts
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* element the scene moves to the overlay's point every frame it draws.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
1
|
+
import type { View } from '@effect/ui';
|
|
2
|
+
import type { Html } from '@effect/ui/html';
|
|
7
3
|
import type { Overlay, SceneDescription } from '@opsydyn/effect-three';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export type OverlayView = {
|
|
4
|
+
/** HTML shown at a point in the scene. */
|
|
5
|
+
export type OverlayView<Message> = {
|
|
11
6
|
readonly overlay: Overlay;
|
|
12
|
-
readonly content:
|
|
13
|
-
/**
|
|
14
|
-
* `'auto'` (the default, as Drei): the HTML takes pointer events. `'none'`: they pass
|
|
15
|
-
* through to the canvas, so the scene under a label stays pickable.
|
|
16
|
-
*/
|
|
7
|
+
readonly content: View.Input<Message, never>;
|
|
17
8
|
readonly pointerEvents?: 'auto' | 'none';
|
|
18
9
|
};
|
|
19
|
-
|
|
20
|
-
export declare const
|
|
21
|
-
/** The overlay layer, or nothing when there are no overlays. */
|
|
22
|
-
export declare const overlayLayer: <Message>(h: HtmlBuilder<Message>, overlays: ReadonlyArray<OverlayView>) => ReadonlyArray<Html>;
|
|
10
|
+
export declare const withOverlays: <Message>(scene: SceneDescription, overlays: ReadonlyArray<OverlayView<Message>>) => SceneDescription;
|
|
11
|
+
export declare const overlayLayer: <Message>(h: Html.H<Message>, overlays: ReadonlyArray<OverlayView<Message>>) => Html.Element<Message, never, Html.Events, HTMLDivElement, "div"> | null;
|
|
23
12
|
//# sourceMappingURL=overlayView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlayView.d.ts","sourceRoot":"","sources":["../src/overlayView.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"overlayView.d.ts","sourceRoot":"","sources":["../src/overlayView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGvE,0CAA0C;AAC1C,MAAM,MAAM,WAAW,CAAC,OAAO,IAAI;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,SAC3B,gBAAgB,YACb,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAC5C,gBAGyF,CAAC;AAE7F,eAAO,MAAM,YAAY,GAAI,OAAO,KAC/B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YACR,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,4EA2BtC,CAAC"}
|
package/dist/pivotControls.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pivot controls as
|
|
2
|
+
* Pivot controls as an Effect UI submodel (roadmap, "Beyond parity" 5): the core's pure
|
|
3
3
|
* `pivotNodes`, `pressPivot` and `dragPivot` (after Drei's `PivotControls`) with
|
|
4
4
|
* Messages for the scene's pointer events and OutMessages for what the parent does with
|
|
5
5
|
* them, as `TransformGizmo` is for three's controls. The parent owns where its objects
|
|
@@ -17,90 +17,78 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly
|
|
38
|
-
readonly rotation: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
39
|
-
readonly scale: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
20
|
+
import { UiSchema } from '@effect/ui';
|
|
21
|
+
import { PivotControls as Controller } from '@opsydyn/effect-three/browser';
|
|
22
|
+
export declare const Model: import("effect/Schema").Struct<{
|
|
23
|
+
readonly key: import("effect/Schema").String;
|
|
24
|
+
readonly pivot: import("effect/Schema").Struct<{
|
|
25
|
+
readonly scale: import("effect/Schema").Finite;
|
|
26
|
+
readonly depthTest: import("effect/Schema").Boolean;
|
|
27
|
+
readonly disableAxes: import("effect/Schema").Boolean;
|
|
28
|
+
readonly disableSliders: import("effect/Schema").Boolean;
|
|
29
|
+
readonly disableRotations: import("effect/Schema").Boolean;
|
|
30
|
+
readonly disableScaling: import("effect/Schema").Boolean;
|
|
31
|
+
readonly hovered: import("effect/Schema").NullOr<import("effect/Schema").Literals<("arrow-x" | "arrow-y" | "arrow-z" | "rotator-x" | "rotator-y" | "rotator-z" | "slider-x" | "slider-y" | "slider-z" | "sphere-x" | "sphere-y" | "sphere-z")[]>>;
|
|
32
|
+
readonly grab: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
33
|
+
readonly handle: import("effect/Schema").Literals<("arrow-x" | "arrow-y" | "arrow-z" | "rotator-x" | "rotator-y" | "rotator-z" | "slider-x" | "slider-y" | "slider-z" | "sphere-x" | "sphere-y" | "sphere-z")[]>;
|
|
34
|
+
readonly start: import("effect/Schema").Struct<{
|
|
35
|
+
readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
36
|
+
readonly rotation: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
37
|
+
readonly scale: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
40
38
|
}>;
|
|
41
|
-
readonly point: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
42
|
-
readonly e1: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
43
|
-
readonly e2: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
44
|
-
readonly normal: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
39
|
+
readonly point: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
40
|
+
readonly e1: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
41
|
+
readonly e2: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
42
|
+
readonly normal: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
45
43
|
}>>;
|
|
46
44
|
}>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly scale: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
45
|
+
readonly last: import("effect/Schema").Option<import("effect/Schema").Struct<{
|
|
46
|
+
readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
47
|
+
readonly rotation: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
48
|
+
readonly scale: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
52
49
|
}>>;
|
|
53
|
-
}
|
|
54
|
-
export type Model =
|
|
55
|
-
export declare const Message:
|
|
56
|
-
readonly
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
}>, init: (key: string, options?: Parameters<typeof import("@opsydyn/effect-three").pivot>[0]) => Controller.Model, handleOf: (model: Controller.Model, key: string) => import("effect/Option").Option<import("@opsydyn/effect-three").PivotHandle>, held: (model: Controller.Model) => boolean, nodes: (model: Controller.Model, placement: import("@opsydyn/effect-three").Placement) => import("@opsydyn/effect-three").SceneNode;
|
|
51
|
+
export type Model = Controller.Model;
|
|
52
|
+
export declare const Message: UiSchema.TaggedEnum<{
|
|
53
|
+
readonly Dragged: import("effect/Schema").TaggedStruct<"Dragged", {
|
|
54
|
+
readonly origin: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
55
|
+
readonly direction: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
56
|
+
readonly snap: import("effect/Schema").Boolean;
|
|
57
|
+
}>;
|
|
58
|
+
readonly Hovered: import("effect/Schema").TaggedStruct<"Hovered", {
|
|
59
|
+
readonly handle: import("effect/Schema").NullOr<import("effect/Schema").Literals<("arrow-x" | "arrow-y" | "arrow-z" | "rotator-x" | "rotator-y" | "rotator-z" | "slider-x" | "slider-y" | "slider-z" | "sphere-x" | "sphere-y" | "sphere-z")[]>>;
|
|
60
|
+
}>;
|
|
61
|
+
readonly Pressed: import("effect/Schema").TaggedStruct<"Pressed", {
|
|
62
|
+
readonly handle: import("effect/Schema").Literals<("arrow-x" | "arrow-y" | "arrow-z" | "rotator-x" | "rotator-y" | "rotator-z" | "slider-x" | "slider-y" | "slider-z" | "sphere-x" | "sphere-y" | "sphere-z")[]>;
|
|
63
|
+
readonly point: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
64
|
+
readonly placement: import("effect/Schema").Struct<{
|
|
65
|
+
readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
66
|
+
readonly rotation: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
67
|
+
readonly scale: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
63
68
|
}>;
|
|
64
|
-
}
|
|
65
|
-
readonly
|
|
66
|
-
origin: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
67
|
-
direction: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
68
|
-
snap: Schema.Boolean;
|
|
69
|
-
};
|
|
70
|
-
readonly Released: {};
|
|
71
|
-
readonly Hovered: {
|
|
72
|
-
handle: Schema.NullOr<Schema.Literals<("arrow-x" | "arrow-y" | "arrow-z" | "rotator-x" | "rotator-y" | "rotator-z" | "slider-x" | "slider-y" | "slider-z" | "sphere-x" | "sphere-y" | "sphere-z")[]>>;
|
|
73
|
-
};
|
|
69
|
+
}>;
|
|
70
|
+
readonly Released: import("effect/Schema").TaggedStruct<"Released", {}>;
|
|
74
71
|
}>;
|
|
75
72
|
export type Message = typeof Message.Type;
|
|
76
|
-
export declare const OutMessage:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly scale: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
73
|
+
export declare const OutMessage: UiSchema.TaggedEnum<{
|
|
74
|
+
readonly Finished: import("effect/Schema").TaggedStruct<"Finished", {
|
|
75
|
+
readonly placement: import("effect/Schema").Struct<{
|
|
76
|
+
readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
77
|
+
readonly rotation: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
78
|
+
readonly scale: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
83
79
|
}>;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
readonly
|
|
89
|
-
readonly
|
|
90
|
-
readonly scale: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
80
|
+
}>;
|
|
81
|
+
readonly Moved: import("effect/Schema").TaggedStruct<"Moved", {
|
|
82
|
+
readonly placement: import("effect/Schema").Struct<{
|
|
83
|
+
readonly position: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
84
|
+
readonly rotation: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
85
|
+
readonly scale: import("effect/Schema").Tuple<readonly [import("effect/Schema").Finite, import("effect/Schema").Finite, import("effect/Schema").Finite]>;
|
|
91
86
|
}>;
|
|
92
|
-
}
|
|
87
|
+
}>;
|
|
93
88
|
}>;
|
|
94
89
|
export type OutMessage = typeof OutMessage.Type;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/** Whether a hit `key` is one of these controls' handles, and which. */
|
|
100
|
-
export declare const handleOf: (model: Model, key: string) => Option.Option<PivotHandle>;
|
|
101
|
-
/** Whether a handle is held: the parent leaves the camera alone while it is. */
|
|
102
|
-
export declare const held: (model: Model) => boolean;
|
|
103
|
-
/** The handles for `placement`, for the parent's scene. */
|
|
104
|
-
export declare const nodes: (model: Model, placement: Placement) => SceneNode;
|
|
105
|
-
export {};
|
|
90
|
+
export declare const update: (model: Controller.Model, message: Controller.Message) => {
|
|
91
|
+
readonly model: Controller.Model;
|
|
92
|
+
readonly outMessage?: Controller.OutMessage;
|
|
93
|
+
};
|
|
106
94
|
//# sourceMappingURL=pivotControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivotControls.d.ts","sourceRoot":"","sources":["../src/pivotControls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"pivotControls.d.ts","sourceRoot":"","sources":["../src/pivotControls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE5E,eAAO,MAAQ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,IAAI,4GAAE,QAAQ,yHAAE,IAAI,wCAAE,KAAK,8HAAe,CAAC;AACjE,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;AAErC,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"}
|