@tomorrowevening/hermes 0.1.9 → 0.1.10

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/dist/hermes.es.js CHANGED
@@ -1951,6 +1951,12 @@ class RP extends ig {
1951
1951
  data: t
1952
1952
  });
1953
1953
  }
1954
+ requestSize() {
1955
+ this.send({
1956
+ event: "requestSize",
1957
+ target: "app"
1958
+ });
1959
+ }
1954
1960
  // Cameras
1955
1961
  addCamera(e) {
1956
1962
  if (!this.debug) return;
@@ -2029,6 +2035,18 @@ class RP extends ig {
2029
2035
  } else if (t.event === "createTexture") {
2030
2036
  this.onCreateTexture(t.data.uuid, t.data.key, t.data.value);
2031
2037
  return;
2038
+ } else if (t.event === "requestSize") {
2039
+ t.target === "app" ? this.send({
2040
+ event: "requestSize",
2041
+ target: "editor",
2042
+ data: {
2043
+ width: this.width,
2044
+ height: this.height
2045
+ }
2046
+ }) : this.scenes.forEach((s) => {
2047
+ s.resize !== void 0 && s.resize(t.data.width, t.data.height);
2048
+ });
2049
+ return;
2032
2050
  }
2033
2051
  t.target === "app" ? this.handleApp(t) : this.handleEditor(t);
2034
2052
  }
@@ -44469,6 +44487,13 @@ class iP extends Ha {
44469
44487
  title: "Type",
44470
44488
  value: this.type,
44471
44489
  disabled: !0
44490
+ },
44491
+ {
44492
+ type: "button",
44493
+ title: "Resize Scenes from Source",
44494
+ onChange: () => {
44495
+ this.props.three.requestSize();
44496
+ }
44472
44497
  }
44473
44498
  ],
44474
44499
  onToggle: (t) => {
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.1.9",
10
+ "version": "0.1.10",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -63,6 +63,7 @@ export default class RemoteThree extends BaseRemote implements EventDispatcher<T
63
63
  removeAllScenes(): void;
64
64
  getScene(uuid: string): Scene | null;
65
65
  setScene(value: Scene): void;
66
+ requestSize(): void;
66
67
  addCamera(camera: Camera): void;
67
68
  removeCamera(camera: Camera): void;
68
69
  handleApp(msg: BroadcastData): void;
@@ -32,7 +32,7 @@ export interface GroupCallback {
32
32
  export type ApplicationMode = 'app' | 'editor';
33
33
  export type VoidCallback = () => void;
34
34
  export type DataUpdateCallback = (data: any) => void;
35
- export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addRenderer' | 'updateRenderer' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'addGroup' | 'removeGroup' | 'updateGroup';
35
+ export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addRenderer' | 'updateRenderer' | 'requestSize' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'addGroup' | 'removeGroup' | 'updateGroup';
36
36
  export type VoidFunc = () => void;
37
37
  export type BroadcastCallback = (data: BroadcastData) => void;
38
38
  export type TheatreUpdateCallback = (data: any) => void;