@tomorrowevening/hermes 0.0.172 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -24
- package/dist/hermes.cjs.js +47 -47
- package/dist/hermes.es.js +3292 -3437
- package/package.json +1 -1
- package/types/core/Application.d.ts +2 -68
- package/types/core/remote/BaseRemote.d.ts +11 -5
- package/types/core/remote/RemoteTheatre.d.ts +3 -2
- package/types/core/remote/RemoteThree.d.ts +34 -2
- package/types/core/types.d.ts +2 -2
- package/types/editor/ThreeEditor.d.ts +1 -4
- package/types/editor/multiView/MultiView.d.ts +1 -8
- package/types/editor/sidePanel/Accordion.d.ts +2 -2
- package/types/editor/sidePanel/DebugData.d.ts +3 -5
- package/types/editor/sidePanel/inspector/InspectorField.d.ts +1 -1
- package/types/editor/sidePanel/inspector/InspectorGroup.d.ts +4 -4
- package/types/editor/sidePanel/inspector/SceneInspector.d.ts +1 -3
- package/types/editor/sidePanel/inspector/utils/InspectAnimation.d.ts +1 -3
- package/types/editor/sidePanel/inspector/utils/InspectCamera.d.ts +2 -3
- package/types/editor/sidePanel/inspector/utils/InspectLight.d.ts +2 -3
- package/types/editor/sidePanel/inspector/utils/InspectMaterial.d.ts +2 -3
- package/types/editor/sidePanel/inspector/utils/InspectRenderer.d.ts +1 -4
- package/types/editor/sidePanel/inspector/utils/InspectTransform.d.ts +1 -4
- package/types/editor/sidePanel/types.d.ts +1 -5
- package/types/editor/theatreUtils.d.ts +0 -3
- package/types/editor/tools/Transform.d.ts +2 -4
- package/types/editor/tools/splineEditor/Spline.d.ts +1 -1
- package/types/editor/tools/splineEditor/index.d.ts +3 -3
- package/types/index.d.ts +0 -1
- package/types/utils/post.d.ts +3 -4
- package/types/core/remote/RemoteComponents.d.ts +0 -7
package/README.md
CHANGED
|
@@ -10,22 +10,31 @@ This example uses [React](https://react.dev/), [ThreeJS](https://threejs.org/),
|
|
|
10
10
|
|
|
11
11
|
### Create an `Application`
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
An application isn't required, however it's nice to maintain multiple remotes. Alternatively, Remotes can be created independent.
|
|
14
14
|
|
|
15
15
|
The `CustomEditor` is used as a multi-view editor for [ThreeJS](https://threejs.org/), and should be limited to only the Editor app.
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
+
const IS_DEV = true;
|
|
19
|
+
const IS_EDITOR = IS_DEV && document.location.hash.search('editor') > -1;
|
|
20
|
+
|
|
18
21
|
export default function AppWrapper() {
|
|
19
22
|
const [app, setApp] = useState<Application | null>(null);
|
|
20
23
|
|
|
21
24
|
useEffect(() => {
|
|
22
|
-
const
|
|
23
|
-
const IS_EDITOR = IS_DEV && document.location.hash.search('editor') > -1;
|
|
24
|
-
const instance = new Application('My App');
|
|
25
|
+
const instance = new Application();
|
|
25
26
|
instance.detectSettings(IS_DEV, IS_EDITOR).then(() => {
|
|
26
|
-
|
|
27
|
-
instance.addComponent('theatre', new RemoteTheatre(
|
|
28
|
-
|
|
27
|
+
// TheatreJS
|
|
28
|
+
instance.addComponent('theatre', new RemoteTheatre(IS_DEV, IS_EDITOR));
|
|
29
|
+
|
|
30
|
+
// ThreeJS
|
|
31
|
+
const scenes: Map<string, any> = new Map();
|
|
32
|
+
scenes.set('ExampleScene', ExampleScene); // extends Scene class
|
|
33
|
+
const three = new RemoteThree('Hermes Example', IS_DEV, IS_EDITOR);
|
|
34
|
+
three.scenes = scenes;
|
|
35
|
+
instance.addComponent('three', three);
|
|
36
|
+
|
|
37
|
+
// Ready
|
|
29
38
|
setApp(instance);
|
|
30
39
|
});
|
|
31
40
|
}, []);
|
|
@@ -34,8 +43,8 @@ export default function AppWrapper() {
|
|
|
34
43
|
<>
|
|
35
44
|
{app !== null && (
|
|
36
45
|
<>
|
|
37
|
-
{
|
|
38
|
-
{
|
|
46
|
+
{IS_DEV && <RemoteSetup app={app} />}
|
|
47
|
+
{IS_EDITOR && <CustomEditor app={app} />}
|
|
39
48
|
<Wrapper app={app} />
|
|
40
49
|
</>
|
|
41
50
|
)}
|
|
@@ -55,26 +64,16 @@ In this example it's added to add custom Remote Component support for:
|
|
|
55
64
|
|
|
56
65
|
```
|
|
57
66
|
type RemoteProps = {
|
|
58
|
-
|
|
67
|
+
three: RemoteThree
|
|
68
|
+
theatre: RemoteTheatre
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
export default function RemoteSetup(props: RemoteProps) {
|
|
62
|
-
const app = props.app;
|
|
63
|
-
const three = app.components.get('three') as RemoteThree;
|
|
64
|
-
|
|
65
72
|
// Remote Theatre setup
|
|
66
|
-
|
|
67
|
-
theatre.
|
|
68
|
-
theatre.handleEditorApp();
|
|
69
|
-
|
|
70
|
-
// Custom component support (optional)
|
|
71
|
-
app.addComponent('components', new RemoteComponents(app));
|
|
73
|
+
props.theatre.studio = studio;
|
|
74
|
+
props.theatre.handleEditorApp();
|
|
72
75
|
|
|
73
|
-
return
|
|
74
|
-
<>
|
|
75
|
-
{app.debugEnabled ? <SceneInspector app={app} three={three} /> : null}
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
76
|
+
return <SceneInspector three={props.three} />;
|
|
78
77
|
}
|
|
79
78
|
```
|
|
80
79
|
|