@tomorrowevening/hermes 0.0.142 → 0.0.143
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.cjs.js +32 -32
- package/dist/hermes.es.js +311 -311
- package/package.json +1 -1
- package/types/core/types.d.ts +40 -40
- package/types/editor/multiView/MultiView.d.ts +124 -124
- package/types/editor/sidePanel/inspector/InspectorField.d.ts +17 -17
- package/types/editor/theatreUtils.d.ts +4 -4
- package/types/editor/tools/splineEditor/Spline.d.ts +1 -1
- package/types/editor/tools/splineEditor/index.d.ts +4 -0
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.
|
10
|
+
"version": "0.0.143",
|
11
11
|
"homepage": "https://github.com/tomorrowevening/hermes#readme",
|
12
12
|
"bugs": {
|
13
13
|
"url": "https://github.com/tomorrowevening/hermes/issues"
|
package/types/core/types.d.ts
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
import { InspectorFieldType } from '@/editor/sidePanel/inspector/InspectorField';
|
2
|
-
export interface BroadcastData {
|
3
|
-
target: ApplicationMode;
|
4
|
-
event: EditorEvent;
|
5
|
-
data?: any;
|
6
|
-
}
|
7
|
-
export type OptionInfo = {
|
8
|
-
title: string;
|
9
|
-
value: any;
|
10
|
-
};
|
11
|
-
export interface GroupItemData {
|
12
|
-
type: InspectorFieldType;
|
13
|
-
prop: string;
|
14
|
-
title?: string;
|
15
|
-
value?: any;
|
16
|
-
min?: number;
|
17
|
-
max?: number;
|
18
|
-
step?: number;
|
19
|
-
disabled?: boolean;
|
20
|
-
options?: OptionInfo[];
|
21
|
-
}
|
22
|
-
export interface GroupData {
|
23
|
-
title: string;
|
24
|
-
expanded?: boolean;
|
25
|
-
items: GroupItemData[];
|
26
|
-
onUpdate: (prop: string, value: any) => void;
|
27
|
-
}
|
28
|
-
export interface GroupCallback {
|
29
|
-
title: string;
|
30
|
-
onUpdate: (prop: string, value: any) => void;
|
31
|
-
}
|
32
|
-
export type ApplicationMode = 'app' | 'editor';
|
33
|
-
export type VoidCallback = () => void;
|
34
|
-
export type DataUpdateCallback = (data: any) => void;
|
35
|
-
export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'getObject' | 'setObject' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'requestMethod' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addRenderer' | 'updateRenderer' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'selectComponent' | 'draggableListUpdate' | 'addGroup' | 'removeGroup' | 'updateGroup';
|
36
|
-
export type VoidFunc = () => void;
|
37
|
-
export type BroadcastCallback = (data: BroadcastData) => void;
|
38
|
-
export type TheatreUpdateCallback = (data: any) => void;
|
39
|
-
export declare const noop: () => void;
|
40
|
-
export declare const defaultTheatreCallback: TheatreUpdateCallback;
|
1
|
+
import { InspectorFieldType } from '@/editor/sidePanel/inspector/InspectorField';
|
2
|
+
export interface BroadcastData {
|
3
|
+
target: ApplicationMode;
|
4
|
+
event: EditorEvent;
|
5
|
+
data?: any;
|
6
|
+
}
|
7
|
+
export type OptionInfo = {
|
8
|
+
title: string;
|
9
|
+
value: any;
|
10
|
+
};
|
11
|
+
export interface GroupItemData {
|
12
|
+
type: InspectorFieldType;
|
13
|
+
prop: string;
|
14
|
+
title?: string;
|
15
|
+
value?: any;
|
16
|
+
min?: number;
|
17
|
+
max?: number;
|
18
|
+
step?: number;
|
19
|
+
disabled?: boolean;
|
20
|
+
options?: OptionInfo[];
|
21
|
+
}
|
22
|
+
export interface GroupData {
|
23
|
+
title: string;
|
24
|
+
expanded?: boolean;
|
25
|
+
items: GroupItemData[];
|
26
|
+
onUpdate: (prop: string, value: any) => void;
|
27
|
+
}
|
28
|
+
export interface GroupCallback {
|
29
|
+
title: string;
|
30
|
+
onUpdate: (prop: string, value: any) => void;
|
31
|
+
}
|
32
|
+
export type ApplicationMode = 'app' | 'editor';
|
33
|
+
export type VoidCallback = () => void;
|
34
|
+
export type DataUpdateCallback = (data: any) => void;
|
35
|
+
export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'getObject' | 'setObject' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'requestMethod' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addRenderer' | 'updateRenderer' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'selectComponent' | 'draggableListUpdate' | 'addGroup' | 'removeGroup' | 'updateGroup';
|
36
|
+
export type VoidFunc = () => void;
|
37
|
+
export type BroadcastCallback = (data: BroadcastData) => void;
|
38
|
+
export type TheatreUpdateCallback = (data: any) => void;
|
39
|
+
export declare const noop: () => void;
|
40
|
+
export declare const defaultTheatreCallback: TheatreUpdateCallback;
|
@@ -1,124 +1,124 @@
|
|
1
|
-
import { Component, ReactNode } from 'react';
|
2
|
-
import { Camera, Group, Object3D, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
|
3
|
-
import WebGPURenderer from 'three/src/renderers/webgpu/WebGPURenderer';
|
4
|
-
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
5
|
-
import RemoteThree from '@/core/remote/RemoteThree';
|
6
|
-
import { InteractionMode, MultiViewMode } from './MultiViewData';
|
7
|
-
import { Application } from '@/core/Application';
|
8
|
-
import './MultiView.scss';
|
9
|
-
type MultiViewProps = {
|
10
|
-
app: Application;
|
11
|
-
three: RemoteThree;
|
12
|
-
scenes: Map<string, any>;
|
13
|
-
onSceneSet?: (scene: Scene) => void;
|
14
|
-
onSceneUpdate?: (scene: Scene) => void;
|
15
|
-
onSceneResize?: (scene: Scene, width: number, height: number) => void;
|
16
|
-
};
|
17
|
-
type MultiViewState = {
|
18
|
-
mode: MultiViewMode;
|
19
|
-
modeOpen: boolean;
|
20
|
-
renderModeOpen: boolean;
|
21
|
-
interactionMode: InteractionMode;
|
22
|
-
interactionModeOpen: boolean;
|
23
|
-
lastUpdate: number;
|
24
|
-
};
|
25
|
-
export default class MultiView extends Component<MultiViewProps, MultiViewState> {
|
26
|
-
static instance: MultiView | null;
|
27
|
-
app: Application;
|
28
|
-
scene: Scene;
|
29
|
-
renderer?: WebGLRenderer | WebGPURenderer | null;
|
30
|
-
currentScene?: Scene;
|
31
|
-
cameras: Map<string, Camera>;
|
32
|
-
controls: Map<string, OrbitControls>;
|
33
|
-
currentCamera: PerspectiveCamera | OrthographicCamera;
|
34
|
-
currentWindow: any;
|
35
|
-
helpersContainer: Group<import("three").Object3DEventMap>;
|
36
|
-
private cameraHelpers;
|
37
|
-
private lightHelpers;
|
38
|
-
private grid;
|
39
|
-
private interactionHelper;
|
40
|
-
private currentTransform?;
|
41
|
-
private splineEditor;
|
42
|
-
private depthMaterial;
|
43
|
-
private normalsMaterial;
|
44
|
-
private uvMaterial;
|
45
|
-
private wireframeMaterial;
|
46
|
-
private playing;
|
47
|
-
private rafID;
|
48
|
-
private cameraControlsRafID;
|
49
|
-
private width;
|
50
|
-
private height;
|
51
|
-
private sceneSet;
|
52
|
-
private tlCam;
|
53
|
-
private trCam;
|
54
|
-
private blCam;
|
55
|
-
private brCam;
|
56
|
-
private tlRender;
|
57
|
-
private trRender;
|
58
|
-
private blRender;
|
59
|
-
private brRender;
|
60
|
-
private cameraVisibility;
|
61
|
-
private lightVisibility;
|
62
|
-
private gridVisibility;
|
63
|
-
selectedItem: Object3D | undefined;
|
64
|
-
private debugCamera;
|
65
|
-
private raycaster;
|
66
|
-
private pointer;
|
67
|
-
private cameraControls;
|
68
|
-
private canvasRef;
|
69
|
-
private containerRef;
|
70
|
-
private tlWindow;
|
71
|
-
private trWindow;
|
72
|
-
private blWindow;
|
73
|
-
private brWindow;
|
74
|
-
constructor(props: MultiViewProps);
|
75
|
-
componentDidMount(): void;
|
76
|
-
componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
|
77
|
-
componentWillUnmount(): void;
|
78
|
-
render(): ReactNode;
|
79
|
-
private setupRenderer;
|
80
|
-
private setupScene;
|
81
|
-
private setupTools;
|
82
|
-
play(): void;
|
83
|
-
pause(): void;
|
84
|
-
toggleOrbitControls(value: boolean): void;
|
85
|
-
private update;
|
86
|
-
private draw;
|
87
|
-
private onUpdate;
|
88
|
-
private enable;
|
89
|
-
private disable;
|
90
|
-
private resize;
|
91
|
-
private sceneUpdate;
|
92
|
-
private addCamera;
|
93
|
-
private removeCamera;
|
94
|
-
private onMouseMove;
|
95
|
-
private onClick;
|
96
|
-
private onKey;
|
97
|
-
private onSetSelectedItem;
|
98
|
-
private updateSelectedItemHelper;
|
99
|
-
private onUpdateTransform;
|
100
|
-
private clearLightHelpers;
|
101
|
-
private addLightHelpers;
|
102
|
-
private createControls;
|
103
|
-
private clearCamera;
|
104
|
-
private killControls;
|
105
|
-
private assignControls;
|
106
|
-
private updateCamera;
|
107
|
-
private updateCameraControls;
|
108
|
-
private clearControls;
|
109
|
-
private saveExpandedCameraVisibility;
|
110
|
-
private saveExpandedLightVisibility;
|
111
|
-
private saveExpandedGridVisibility;
|
112
|
-
private getSceneOverride;
|
113
|
-
private drawTo;
|
114
|
-
private drawSingle;
|
115
|
-
private drawDouble;
|
116
|
-
private drawQuad;
|
117
|
-
get appID(): string;
|
118
|
-
get mode(): MultiViewMode;
|
119
|
-
get three(): RemoteThree;
|
120
|
-
get expandedCameraVisibility(): string;
|
121
|
-
get expandedLightVisibility(): string;
|
122
|
-
get expandedGridVisibility(): string;
|
123
|
-
}
|
124
|
-
export {};
|
1
|
+
import { Component, ReactNode } from 'react';
|
2
|
+
import { Camera, Group, Object3D, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
|
3
|
+
import WebGPURenderer from 'three/src/renderers/webgpu/WebGPURenderer';
|
4
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
5
|
+
import RemoteThree from '@/core/remote/RemoteThree';
|
6
|
+
import { InteractionMode, MultiViewMode } from './MultiViewData';
|
7
|
+
import { Application } from '@/core/Application';
|
8
|
+
import './MultiView.scss';
|
9
|
+
type MultiViewProps = {
|
10
|
+
app: Application;
|
11
|
+
three: RemoteThree;
|
12
|
+
scenes: Map<string, any>;
|
13
|
+
onSceneSet?: (scene: Scene) => void;
|
14
|
+
onSceneUpdate?: (scene: Scene) => void;
|
15
|
+
onSceneResize?: (scene: Scene, width: number, height: number) => void;
|
16
|
+
};
|
17
|
+
type MultiViewState = {
|
18
|
+
mode: MultiViewMode;
|
19
|
+
modeOpen: boolean;
|
20
|
+
renderModeOpen: boolean;
|
21
|
+
interactionMode: InteractionMode;
|
22
|
+
interactionModeOpen: boolean;
|
23
|
+
lastUpdate: number;
|
24
|
+
};
|
25
|
+
export default class MultiView extends Component<MultiViewProps, MultiViewState> {
|
26
|
+
static instance: MultiView | null;
|
27
|
+
app: Application;
|
28
|
+
scene: Scene;
|
29
|
+
renderer?: WebGLRenderer | WebGPURenderer | null;
|
30
|
+
currentScene?: Scene;
|
31
|
+
cameras: Map<string, Camera>;
|
32
|
+
controls: Map<string, OrbitControls>;
|
33
|
+
currentCamera: PerspectiveCamera | OrthographicCamera;
|
34
|
+
currentWindow: any;
|
35
|
+
helpersContainer: Group<import("three").Object3DEventMap>;
|
36
|
+
private cameraHelpers;
|
37
|
+
private lightHelpers;
|
38
|
+
private grid;
|
39
|
+
private interactionHelper;
|
40
|
+
private currentTransform?;
|
41
|
+
private splineEditor;
|
42
|
+
private depthMaterial;
|
43
|
+
private normalsMaterial;
|
44
|
+
private uvMaterial;
|
45
|
+
private wireframeMaterial;
|
46
|
+
private playing;
|
47
|
+
private rafID;
|
48
|
+
private cameraControlsRafID;
|
49
|
+
private width;
|
50
|
+
private height;
|
51
|
+
private sceneSet;
|
52
|
+
private tlCam;
|
53
|
+
private trCam;
|
54
|
+
private blCam;
|
55
|
+
private brCam;
|
56
|
+
private tlRender;
|
57
|
+
private trRender;
|
58
|
+
private blRender;
|
59
|
+
private brRender;
|
60
|
+
private cameraVisibility;
|
61
|
+
private lightVisibility;
|
62
|
+
private gridVisibility;
|
63
|
+
selectedItem: Object3D | undefined;
|
64
|
+
private debugCamera;
|
65
|
+
private raycaster;
|
66
|
+
private pointer;
|
67
|
+
private cameraControls;
|
68
|
+
private canvasRef;
|
69
|
+
private containerRef;
|
70
|
+
private tlWindow;
|
71
|
+
private trWindow;
|
72
|
+
private blWindow;
|
73
|
+
private brWindow;
|
74
|
+
constructor(props: MultiViewProps);
|
75
|
+
componentDidMount(): void;
|
76
|
+
componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
|
77
|
+
componentWillUnmount(): void;
|
78
|
+
render(): ReactNode;
|
79
|
+
private setupRenderer;
|
80
|
+
private setupScene;
|
81
|
+
private setupTools;
|
82
|
+
play(): void;
|
83
|
+
pause(): void;
|
84
|
+
toggleOrbitControls(value: boolean): void;
|
85
|
+
private update;
|
86
|
+
private draw;
|
87
|
+
private onUpdate;
|
88
|
+
private enable;
|
89
|
+
private disable;
|
90
|
+
private resize;
|
91
|
+
private sceneUpdate;
|
92
|
+
private addCamera;
|
93
|
+
private removeCamera;
|
94
|
+
private onMouseMove;
|
95
|
+
private onClick;
|
96
|
+
private onKey;
|
97
|
+
private onSetSelectedItem;
|
98
|
+
private updateSelectedItemHelper;
|
99
|
+
private onUpdateTransform;
|
100
|
+
private clearLightHelpers;
|
101
|
+
private addLightHelpers;
|
102
|
+
private createControls;
|
103
|
+
private clearCamera;
|
104
|
+
private killControls;
|
105
|
+
private assignControls;
|
106
|
+
private updateCamera;
|
107
|
+
private updateCameraControls;
|
108
|
+
private clearControls;
|
109
|
+
private saveExpandedCameraVisibility;
|
110
|
+
private saveExpandedLightVisibility;
|
111
|
+
private saveExpandedGridVisibility;
|
112
|
+
private getSceneOverride;
|
113
|
+
private drawTo;
|
114
|
+
private drawSingle;
|
115
|
+
private drawDouble;
|
116
|
+
private drawQuad;
|
117
|
+
get appID(): string;
|
118
|
+
get mode(): MultiViewMode;
|
119
|
+
get three(): RemoteThree;
|
120
|
+
get expandedCameraVisibility(): string;
|
121
|
+
get expandedLightVisibility(): string;
|
122
|
+
get expandedGridVisibility(): string;
|
123
|
+
}
|
124
|
+
export {};
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { KeyboardEvent } from 'react';
|
2
|
-
import { OptionInfo } from '@/core/types';
|
3
|
-
export type InspectorFieldType = 'string' | 'field' | 'number' | 'boolean' | 'range' | 'color' | 'button' | 'image' | 'option' | 'vector2' | 'grid3' | 'grid4' | 'euler';
|
4
|
-
export interface InspectorFieldProps {
|
5
|
-
title: string;
|
6
|
-
type: InspectorFieldType;
|
7
|
-
prop?: string;
|
8
|
-
value?: any;
|
9
|
-
min?: number;
|
10
|
-
max?: number;
|
11
|
-
step?: number;
|
12
|
-
disabled?: boolean;
|
13
|
-
options?: OptionInfo[];
|
14
|
-
onChange?: (prop: string, value: any) => void;
|
15
|
-
onKeyDown?: (evt: KeyboardEvent) => void;
|
16
|
-
}
|
17
|
-
export default function InspectorField(props: InspectorFieldProps): import("react/jsx-runtime").JSX.Element;
|
1
|
+
import { KeyboardEvent } from 'react';
|
2
|
+
import { OptionInfo } from '@/core/types';
|
3
|
+
export type InspectorFieldType = 'string' | 'field' | 'number' | 'boolean' | 'range' | 'color' | 'button' | 'image' | 'option' | 'vector2' | 'grid3' | 'grid4' | 'euler';
|
4
|
+
export interface InspectorFieldProps {
|
5
|
+
title: string;
|
6
|
+
type: InspectorFieldType;
|
7
|
+
prop?: string;
|
8
|
+
value?: any;
|
9
|
+
min?: number;
|
10
|
+
max?: number;
|
11
|
+
step?: number;
|
12
|
+
disabled?: boolean;
|
13
|
+
options?: OptionInfo[];
|
14
|
+
onChange?: (prop: string, value: any) => void;
|
15
|
+
onKeyDown?: (evt: KeyboardEvent) => void;
|
16
|
+
}
|
17
|
+
export default function InspectorField(props: InspectorFieldProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Application } from '../core/Application';
|
2
|
-
import RemoteTheatre from '../core/remote/RemoteTheatre';
|
3
|
-
export declare function theatreEditorApp(app: Application, theatre: RemoteTheatre, studio: any): void;
|
4
|
-
export declare function customizeTheatreElements(): Promise<void>;
|
1
|
+
import { Application } from '../core/Application';
|
2
|
+
import RemoteTheatre from '../core/remote/RemoteTheatre';
|
3
|
+
export declare function theatreEditorApp(app: Application, theatre: RemoteTheatre, studio: any): void;
|
4
|
+
export declare function customizeTheatreElements(): Promise<void>;
|
@@ -33,10 +33,10 @@ export default class Spline extends Object3D {
|
|
33
33
|
removePoint: (child: Object3D) => void;
|
34
34
|
removePointAt: (index: number) => void;
|
35
35
|
removeSelectedPt: () => void;
|
36
|
+
updateLastPoint(value: Vector3): void;
|
36
37
|
updateSpline: () => void;
|
37
38
|
private onMouseClick;
|
38
39
|
getPointAt(percentage: number): Vector3;
|
39
|
-
getPoints(): Vector3[];
|
40
40
|
getTangentAt(percentage: number): Vector3;
|
41
41
|
get points(): Array<Vector3>;
|
42
42
|
get total(): number;
|
@@ -26,9 +26,13 @@ export default class SplineEditor extends Object3D {
|
|
26
26
|
createSplineFromJSON: (data: SplineJSON) => Spline;
|
27
27
|
showPoints: (visible?: boolean) => void;
|
28
28
|
private onAddSpline;
|
29
|
+
private isMouseDown;
|
29
30
|
private enableClickToDraw;
|
30
31
|
private disableClickToDraw;
|
31
32
|
private onClickCanvas;
|
33
|
+
private onMouseMove;
|
34
|
+
private onMouseUp;
|
35
|
+
private mouseToSplinePos;
|
32
36
|
get camera(): Camera;
|
33
37
|
set camera(value: Camera);
|
34
38
|
}
|