@tomorrowevening/hermes 0.0.42 → 0.0.44

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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "module": "./dist/hermes.esm.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "type": "module",
10
- "version": "0.0.42",
10
+ "version": "0.0.44",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -76,6 +76,7 @@
76
76
  "tweakpane": "^4.0.0",
77
77
  "typescript": "^5.0.2",
78
78
  "vite": "^4.4.5",
79
+ "vite-plugin-glsl": "^1.2.1",
79
80
  "ws": "^8.16.0"
80
81
  }
81
82
  }
@@ -10,7 +10,6 @@ export default class Application {
10
10
  protected _connected: boolean;
11
11
  protected _useBC: boolean;
12
12
  constructor(id: string, debugEnabled: boolean, useBC?: boolean);
13
- init(): Promise<void>;
14
13
  addComponent(name: string, component: BaseRemote): void;
15
14
  dispose(): void;
16
15
  send(data: BroadcastData): void;
@@ -1,2 +1,18 @@
1
1
  import Application from './Application';
2
- export default function RemoteController(app: Application): void;
2
+ import type { BroadcastData } from './types';
3
+ export type RemoteCallback = (app: Application, remote: any, msg: BroadcastData) => void;
4
+ interface RemoteCall {
5
+ remote: any;
6
+ callback: RemoteCallback;
7
+ }
8
+ export default class RemoteController {
9
+ appHandlers: RemoteCall[];
10
+ editorHandlers: RemoteCall[];
11
+ private _app;
12
+ private static _instance;
13
+ handleAppBroadcast: (msg: BroadcastData) => void;
14
+ handleEditorBroadcast: (msg: BroadcastData) => void;
15
+ set app(app: Application);
16
+ static get instance(): RemoteController;
17
+ }
18
+ export {};
@@ -1,9 +1,6 @@
1
1
  import Application from '../Application';
2
- import { BroadcastData } from '../types';
3
2
  export default class BaseRemote {
4
3
  app: Application;
5
4
  constructor(app: Application);
6
5
  dispose(): void;
7
- handleApp(_: BroadcastData): void;
8
- handleEditor(_: BroadcastData): void;
9
6
  }
@@ -1,7 +1,5 @@
1
1
  import BaseRemote from './BaseRemote';
2
- import { BroadcastData } from '../types';
3
2
  export default class RemoteComponents extends BaseRemote {
4
3
  selectDropdown(dropdown: string, value: any): void;
5
4
  updateDropdown(dropdown: string, list: string[]): void;
6
- handleApp(msg: BroadcastData): void;
7
5
  }
@@ -1,6 +1,6 @@
1
1
  import { IProject, IRafDriver, ISheet, ISheetObject } from '@theatre/core';
2
2
  import BaseRemote from './BaseRemote';
3
- import { BroadcastData, DataUpdateCallback, VoidCallback } from '../types';
3
+ import { DataUpdateCallback, VoidCallback } from '../types';
4
4
  export default class RemoteTheatre extends BaseRemote {
5
5
  project: IProject | undefined;
6
6
  sheets: Map<string, ISheet>;
@@ -16,6 +16,4 @@ export default class RemoteTheatre extends BaseRemote {
16
16
  clearSheetObjects(sheetName: string): void;
17
17
  sheetObject(sheetName: string, key: string, props: any, onUpdate?: DataUpdateCallback): ISheetObject | undefined;
18
18
  unsubscribe(sheetObject: ISheetObject): undefined;
19
- handleApp(msg: BroadcastData): void;
20
- handleEditor(msg: BroadcastData): void;
21
19
  }
@@ -1,6 +1,5 @@
1
1
  import { Camera, Scene } from 'three';
2
2
  import BaseRemote from './BaseRemote';
3
- import { BroadcastData } from '../types';
4
3
  export default class RemoteThree extends BaseRemote {
5
4
  scene?: Scene;
6
5
  getObject(uuid: string): void;
@@ -11,6 +10,4 @@ export default class RemoteThree extends BaseRemote {
11
10
  setScene(value: Scene): void;
12
11
  addCamera(camera: Camera): void;
13
12
  removeCamera(camera: Camera): void;
14
- handleApp(msg: BroadcastData): void;
15
- handleEditor(msg: BroadcastData): void;
16
13
  }
@@ -1,7 +1,7 @@
1
1
  import { Pane } from 'tweakpane';
2
2
  import Application from '../Application';
3
3
  import BaseRemote from './BaseRemote';
4
- import { BroadcastData, DataUpdateCallback, VoidCallback } from '../types';
4
+ import { DataUpdateCallback, VoidCallback } from '../types';
5
5
  export default class RemoteTweakpane extends BaseRemote {
6
6
  bindCBs: Map<string, DataUpdateCallback>;
7
7
  buttonCBs: Map<string, VoidCallback>;
@@ -20,5 +20,4 @@ export default class RemoteTweakpane extends BaseRemote {
20
20
  triggerButton(id: string): void;
21
21
  createInspector(): void;
22
22
  clearInspector(): void;
23
- handleApp(msg: BroadcastData): void;
24
23
  }
@@ -0,0 +1,4 @@
1
+ import Application from '../Application';
2
+ import RemoteComponents from './RemoteComponents';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function componentsApp(app: Application, remote: RemoteComponents, msg: BroadcastData): void;
@@ -0,0 +1,5 @@
1
+ import Application from '../Application';
2
+ import RemoteTheatre from './RemoteTheatre';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function theatreApp(app: Application, remote: RemoteTheatre, msg: BroadcastData): void;
5
+ export declare function theatreEditor(app: Application, remote: RemoteTheatre, msg: BroadcastData): void;
@@ -0,0 +1,5 @@
1
+ import Application from '../Application';
2
+ import RemoteThree from './RemoteThree';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function threeApp(app: Application, remote: RemoteThree, msg: BroadcastData): void;
5
+ export declare function threeEditor(app: Application, remote: RemoteThree, msg: BroadcastData): void;
@@ -0,0 +1,4 @@
1
+ import Application from '../Application';
2
+ import RemoteTweakpane from './RemoteTweakpane';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function tweakpaneApp(app: Application, remote: RemoteTweakpane, msg: BroadcastData): void;
@@ -1,7 +1,7 @@
1
1
  import { Scene } from 'three';
2
+ import RemoteThree from '@/core/remote/RemoteThree';
2
3
  import { MultiViewMode } from './MultiViewData';
3
4
  import './MultiView.scss';
4
- import RemoteThree from '@/core/remote/RemoteThree';
5
5
  interface MultiViewProps {
6
6
  three: RemoteThree;
7
7
  mode?: MultiViewMode;
@@ -1,16 +1,2 @@
1
- import { Camera, CameraHelper, MeshBasicMaterial, MeshDepthMaterial, MeshNormalMaterial, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
2
- import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
- import UVMaterial from './UVMaterial';
4
1
  export type MultiViewMode = 'Single' | 'Side by Side' | 'Stacked' | 'Quad';
5
- export declare const ModeOptions: MultiViewMode[];
6
- export declare const cameras: Map<string, Camera>;
7
- export declare const controls: Map<string, OrbitControls>;
8
- export declare const helpers: Map<string, CameraHelper>;
9
- export declare function createOrtho(name: string, position: Vector3): OrthographicCamera;
10
- export declare const debugCamera: PerspectiveCamera;
11
2
  export type RenderMode = 'Depth' | 'Normals' | 'Renderer' | 'UVs' | 'Wireframe';
12
- export declare const renderOptions: RenderMode[];
13
- export declare const depthMaterial: MeshDepthMaterial;
14
- export declare const normalsMaterial: MeshNormalMaterial;
15
- export declare const uvMaterial: UVMaterial;
16
- export declare const wireframeMaterial: MeshBasicMaterial;
package/types/index.d.ts CHANGED
@@ -4,6 +4,10 @@ export { default as Application } from './core/Application';
4
4
  export { debugDispatcher, ToolEvents } from './editor/global';
5
5
  export { default as BaseRemote } from './core/remote/BaseRemote';
6
6
  export { default as RemoteComponents } from './core/remote/RemoteComponents';
7
+ export * from './core/remote/componentsUtils';
8
+ export * from './core/remote/theatreUtils';
9
+ export * from './core/remote/threeUtils';
10
+ export * from './core/remote/tweakpaneUtils';
7
11
  export * from './editor/theatreUtils';
8
12
  export { default as RemoteTheatre } from './core/remote/RemoteTheatre';
9
13
  export { default as RemoteThree } from './core/remote/RemoteThree';
@@ -14,8 +18,6 @@ export { default as Draggable } from './editor/components/Draggable';
14
18
  export { default as DropdownItem } from './editor/components/DropdownItem';
15
19
  export { default as Dropdown } from './editor/components/Dropdown';
16
20
  export { default as RemoteController } from './core/RemoteController';
17
- export { default as InfiniteGridHelper } from './editor/multiView/InfiniteGridHelper';
18
- export { default as UVMaterial } from './editor/multiView/UVMaterial';
19
21
  export { default as SidePanel } from './editor/sidePanel/SidePanel';
20
22
  export { default as Accordion } from './editor/sidePanel/Accordion';
21
23
  export { default as ChildObject } from './editor/sidePanel/ChildObject';