@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.
Files changed (30) hide show
  1. package/README.md +23 -24
  2. package/dist/hermes.cjs.js +47 -47
  3. package/dist/hermes.es.js +3292 -3437
  4. package/package.json +1 -1
  5. package/types/core/Application.d.ts +2 -68
  6. package/types/core/remote/BaseRemote.d.ts +11 -5
  7. package/types/core/remote/RemoteTheatre.d.ts +3 -2
  8. package/types/core/remote/RemoteThree.d.ts +34 -2
  9. package/types/core/types.d.ts +2 -2
  10. package/types/editor/ThreeEditor.d.ts +1 -4
  11. package/types/editor/multiView/MultiView.d.ts +1 -8
  12. package/types/editor/sidePanel/Accordion.d.ts +2 -2
  13. package/types/editor/sidePanel/DebugData.d.ts +3 -5
  14. package/types/editor/sidePanel/inspector/InspectorField.d.ts +1 -1
  15. package/types/editor/sidePanel/inspector/InspectorGroup.d.ts +4 -4
  16. package/types/editor/sidePanel/inspector/SceneInspector.d.ts +1 -3
  17. package/types/editor/sidePanel/inspector/utils/InspectAnimation.d.ts +1 -3
  18. package/types/editor/sidePanel/inspector/utils/InspectCamera.d.ts +2 -3
  19. package/types/editor/sidePanel/inspector/utils/InspectLight.d.ts +2 -3
  20. package/types/editor/sidePanel/inspector/utils/InspectMaterial.d.ts +2 -3
  21. package/types/editor/sidePanel/inspector/utils/InspectRenderer.d.ts +1 -4
  22. package/types/editor/sidePanel/inspector/utils/InspectTransform.d.ts +1 -4
  23. package/types/editor/sidePanel/types.d.ts +1 -5
  24. package/types/editor/theatreUtils.d.ts +0 -3
  25. package/types/editor/tools/Transform.d.ts +2 -4
  26. package/types/editor/tools/splineEditor/Spline.d.ts +1 -1
  27. package/types/editor/tools/splineEditor/index.d.ts +3 -3
  28. package/types/index.d.ts +0 -1
  29. package/types/utils/post.d.ts +3 -4
  30. 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
- This acts as the Remote Controller between all components.
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 IS_DEV = true;
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
- if (IS_DEV) instance.setupRemote();
27
- instance.addComponent('theatre', new RemoteTheatre(instance));
28
- instance.addComponent('three', new RemoteThree(instance));
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
- {app.debugEnabled && <RemoteSetup app={app} />}
38
- {app.editor && <CustomEditor app={app} />}
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
- app: Application
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
- const theatre = app.components.get('theatre') as RemoteTheatre;
67
- theatre.studio = studio;
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