babylon.quarks-editor 0.26.0 → 0.28.0
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/CHANGELOG.md +134 -0
- package/README.md +69 -9
- package/dist/core/assetDragSession.d.ts +1 -1
- package/dist/core/assetTree.d.ts +6 -1
- package/dist/core/assets.d.ts +7 -0
- package/dist/core/assets.js +11 -7
- package/dist/core/binding.d.ts +11 -2
- package/dist/core/binding.js +9 -1
- package/dist/core/collision.d.ts +4 -0
- package/dist/core/collision.js +4 -0
- package/dist/core/colors.d.ts +16 -0
- package/dist/core/colors.js +8 -0
- package/dist/core/defaultEffect.d.ts +5 -4
- package/dist/core/defaultEffect.js +4 -4
- package/dist/core/editorScene.d.ts +1 -1
- package/dist/core/editorSession.d.ts +229 -0
- package/dist/core/editorSession.js +983 -0
- package/dist/core/effectTree.d.ts +6 -1
- package/dist/core/effectTree.js +13 -88
- package/dist/core/emitterShapeWireframe.d.ts +2 -2
- package/dist/core/emitterShapeWireframe.js +45 -13
- package/dist/core/galleryDropMarker.d.ts +2 -2
- package/dist/core/galleryDropMarker.js +6 -6
- package/dist/core/galleryLayout.d.ts +3 -3
- package/dist/core/galleryLayout.js +1 -1
- package/dist/core/galleryPlayback.d.ts +1 -1
- package/dist/core/galleryPlayback.js +2 -1
- package/dist/core/galleryScene.d.ts +4 -4
- package/dist/core/galleryScene.js +3 -3
- package/dist/core/gallerySelectionMarker.d.ts +4 -4
- package/dist/core/gallerySelectionMarker.js +5 -5
- package/dist/core/groups.d.ts +1 -1
- package/dist/core/groups.js +1 -1
- package/dist/core/history.d.ts +7 -1
- package/dist/core/history.js +4 -0
- package/dist/core/indexedDbProjectStore.d.ts +14 -1
- package/dist/core/indexedDbProjectStore.js +13 -0
- package/dist/core/lineShaders.d.ts +2 -2
- package/dist/core/lineShaders.js +2 -2
- package/dist/core/loadEffect.d.ts +2 -2
- package/dist/core/loadEffect.js +1 -1
- package/dist/core/material.d.ts +12 -2
- package/dist/core/pickAssetFiles.js +1 -1
- package/dist/core/playback.d.ts +6 -0
- package/dist/core/projectStore.d.ts +26 -0
- package/dist/core/projectStore.js +1 -0
- package/dist/core/sceneEntries.d.ts +7 -4
- package/dist/core/sceneEntries.js +2 -2
- package/dist/core/scrub.d.ts +2 -2
- package/dist/core/scrub.js +2 -2
- package/dist/core/shapes.d.ts +25 -1
- package/dist/core/shapes.js +5 -0
- package/dist/core/systems.d.ts +4 -2
- package/dist/core/systems.js +3 -1
- package/dist/core/textureExport.d.ts +1 -1
- package/dist/core/timeline.d.ts +25 -5
- package/dist/core/transport.d.ts +3 -3
- package/dist/core/transport.js +2 -2
- package/dist/core/values.d.ts +21 -4
- package/dist/core/values.js +5 -0
- package/dist/core/viewportPicker.d.ts +4 -4
- package/dist/core/viewportPicker.js +8 -7
- package/dist/index.d.ts +25 -21
- package/dist/index.js +12 -12
- package/dist/react/AssetsPanel.d.ts +9 -2
- package/dist/react/AssetsPanel.js +6 -6
- package/dist/react/ChoiceDialog.d.ts +7 -0
- package/dist/react/ChoiceDialog.js +1 -1
- package/dist/react/ContextMenu.d.ts +10 -1
- package/dist/react/ContextMenu.js +1 -1
- package/dist/react/CurveEditor.d.ts +1 -1
- package/dist/react/CurveEditor.js +2 -2
- package/dist/react/EditorWorkspace.d.ts +9 -2
- package/dist/react/EditorWorkspace.js +10 -7
- package/dist/react/EffectEditor.d.ts +11 -5
- package/dist/react/EffectEditor.js +7 -7
- package/dist/react/EffectEditorHost.d.ts +33 -29
- package/dist/react/EffectEditorHost.js +247 -1674
- package/dist/react/EffectTreeView.d.ts +4 -1
- package/dist/react/EffectTreeView.js +3 -3
- package/dist/react/GradientEditor.d.ts +1 -1
- package/dist/react/GradientEditor.js +3 -3
- package/dist/react/InspectorInfoIcon.js +3 -3
- package/dist/react/InspectorLabel.js +3 -3
- package/dist/react/MessageDialog.d.ts +5 -0
- package/dist/react/MessageDialog.js +1 -1
- package/dist/react/ModuleSection.d.ts +10 -0
- package/dist/react/ModuleSection.js +8 -5
- package/dist/react/ObjectModule.d.ts +1 -1
- package/dist/react/ObjectModule.js +4 -4
- package/dist/react/ProjectsPage.d.ts +7 -1
- package/dist/react/ProjectsPage.js +33 -17
- package/dist/react/PromptDialog.d.ts +7 -0
- package/dist/react/PromptDialog.js +1 -1
- package/dist/react/ScenePanel.d.ts +9 -2
- package/dist/react/ScenePanel.js +12 -10
- package/dist/react/SubEmittersModule.d.ts +1 -1
- package/dist/react/SubEmittersModule.js +5 -5
- package/dist/react/TextureSelect.d.ts +24 -0
- package/dist/react/TextureSelect.js +74 -0
- package/dist/react/TextureUVField.d.ts +14 -0
- package/dist/react/TextureUVField.js +23 -0
- package/dist/react/TimelinePanel.d.ts +20 -7
- package/dist/react/TimelinePanel.js +21 -15
- package/dist/react/TimelineTrackRow.d.ts +13 -3
- package/dist/react/TimelineTrackRow.js +6 -6
- package/dist/react/TransportBar.d.ts +13 -4
- package/dist/react/TransportBar.js +3 -3
- package/dist/react/ValueField.d.ts +32 -5
- package/dist/react/ValueField.js +22 -11
- package/dist/react/behaviorModules.d.ts +19 -6
- package/dist/react/behaviorModules.js +68 -17
- package/dist/react/fields.d.ts +9 -0
- package/dist/react/fields.js +6 -3
- package/dist/react/host/BottomDocks.d.ts +36 -0
- package/dist/react/host/BottomDocks.js +63 -0
- package/dist/react/host/HostDialogs.d.ts +50 -0
- package/dist/react/host/HostDialogs.js +113 -0
- package/dist/react/host/InspectorSidebar.d.ts +32 -0
- package/dist/react/host/InspectorSidebar.js +59 -0
- package/dist/react/host/SceneSidebar.d.ts +53 -0
- package/dist/react/host/SceneSidebar.js +62 -0
- package/dist/react/host/ViewportPane.d.ts +56 -0
- package/dist/react/host/ViewportPane.js +91 -0
- package/dist/react/host/hostHooks.d.ts +44 -0
- package/dist/react/host/hostHooks.js +164 -0
- package/dist/react/host/hostStyles.d.ts +21 -0
- package/dist/react/host/hostStyles.js +57 -0
- package/dist/react/index.d.ts +42 -38
- package/dist/react/index.js +25 -23
- package/dist/react/inspectorHints.js +31 -0
- package/dist/react/modules.d.ts +19 -6
- package/dist/react/modules.js +134 -117
- package/dist/react/theme.d.ts +15 -0
- package/dist/react/theme.js +15 -0
- package/dist/session.d.ts +9 -0
- package/dist/session.js +8 -0
- package/package.json +18 -11
- package/src/core/assetDragSession.ts +1 -1
- package/src/core/assetTree.ts +15 -2
- package/src/core/assets.ts +25 -10
- package/src/core/binding.ts +12 -3
- package/src/core/collision.ts +4 -0
- package/src/core/colors.ts +21 -1
- package/src/core/defaultEffect.ts +8 -7
- package/src/core/editorScene.ts +1 -1
- package/src/core/editorSession.ts +1299 -0
- package/src/core/effectTree.ts +18 -101
- package/src/core/emitterShapeWireframe.ts +48 -16
- package/src/core/galleryDropMarker.ts +8 -8
- package/src/core/galleryLayout.ts +4 -4
- package/src/core/galleryPlayback.ts +3 -2
- package/src/core/galleryScene.ts +5 -5
- package/src/core/gallerySelectionMarker.ts +7 -7
- package/src/core/groups.ts +1 -1
- package/src/core/history.ts +7 -1
- package/src/core/indexedDbProjectStore.ts +14 -1
- package/src/core/lineShaders.ts +2 -2
- package/src/core/loadEffect.ts +4 -4
- package/src/core/material.ts +14 -4
- package/src/core/pickAssetFiles.ts +2 -2
- package/src/core/playback.ts +6 -0
- package/src/core/projectStore.ts +26 -0
- package/src/core/sceneEntries.ts +8 -5
- package/src/core/scrub.ts +3 -3
- package/src/core/shapes.ts +29 -2
- package/src/core/systems.ts +11 -4
- package/src/core/textureExport.ts +1 -1
- package/src/core/timeline.ts +43 -18
- package/src/core/transport.ts +4 -4
- package/src/core/values.ts +20 -4
- package/src/core/viewportPicker.ts +12 -11
- package/src/index.ts +25 -21
- package/src/react/AssetsPanel.tsx +13 -6
- package/src/react/ChoiceDialog.tsx +8 -1
- package/src/react/ContextMenu.tsx +11 -2
- package/src/react/CurveEditor.tsx +2 -2
- package/src/react/EditorWorkspace.tsx +16 -10
- package/src/react/EffectEditor.tsx +17 -9
- package/src/react/EffectEditorHost.tsx +415 -2354
- package/src/react/EffectTreeView.tsx +7 -4
- package/src/react/GradientEditor.tsx +3 -3
- package/src/react/InspectorInfoIcon.tsx +3 -3
- package/src/react/InspectorLabel.tsx +3 -3
- package/src/react/MessageDialog.tsx +6 -1
- package/src/react/ModuleSection.tsx +15 -4
- package/src/react/ObjectModule.tsx +5 -5
- package/src/react/ProjectsPage.tsx +44 -17
- package/src/react/PromptDialog.tsx +8 -1
- package/src/react/ScenePanel.tsx +21 -12
- package/src/react/SubEmittersModule.tsx +6 -6
- package/src/react/TextureSelect.tsx +118 -0
- package/src/react/TextureUVField.tsx +62 -0
- package/src/react/TimelinePanel.tsx +40 -21
- package/src/react/TimelineTrackRow.tsx +19 -9
- package/src/react/TransportBar.tsx +16 -7
- package/src/react/ValueField.tsx +60 -16
- package/src/react/behaviorModules.tsx +240 -55
- package/src/react/fields.tsx +22 -4
- package/src/react/host/BottomDocks.tsx +178 -0
- package/src/react/host/HostDialogs.tsx +228 -0
- package/src/react/host/InspectorSidebar.tsx +147 -0
- package/src/react/host/SceneSidebar.tsx +227 -0
- package/src/react/host/ViewportPane.tsx +300 -0
- package/src/react/host/hostHooks.ts +198 -0
- package/src/react/host/hostStyles.ts +65 -0
- package/src/react/index.ts +43 -38
- package/src/react/inspectorHints.ts +40 -0
- package/src/react/modules.tsx +440 -170
- package/src/react/theme.ts +15 -0
- package/src/session.ts +17 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, {useEffect, useMemo, useState} from 'react';
|
|
2
2
|
import {createRoot} from 'react-dom/client';
|
|
3
|
-
import {IndexedDbProjectStore} from '../core/indexedDbProjectStore';
|
|
4
|
-
import type {ProjectMeta, ProjectStore} from '../core/projectStore';
|
|
5
|
-
import {EffectEditorHost, type EffectEditorHostProps} from './EffectEditorHost';
|
|
6
|
-
import {ProjectsPage} from './ProjectsPage';
|
|
7
|
-
import {theme} from './theme';
|
|
3
|
+
import {IndexedDbProjectStore} from '../core/indexedDbProjectStore.js';
|
|
4
|
+
import type {ProjectMeta, ProjectStore} from '../core/projectStore.js';
|
|
5
|
+
import {EffectEditorHost, type EffectEditorHostProps} from './EffectEditorHost.js';
|
|
6
|
+
import {ProjectsPage} from './ProjectsPage.js';
|
|
7
|
+
import {theme} from './theme.js';
|
|
8
8
|
|
|
9
|
+
/** Props of {@link EditorWorkspace}: the editor's, plus where projects live. */
|
|
9
10
|
export interface EditorWorkspaceProps extends Omit<EffectEditorHostProps, 'project' | 'onExitProject' | 'effectJson'> {
|
|
10
11
|
/** Where projects are kept; defaults to the browser's IndexedDB. */
|
|
11
12
|
store?: ProjectStore;
|
|
@@ -23,10 +24,7 @@ export function EditorWorkspace(props: EditorWorkspaceProps): React.ReactElement
|
|
|
23
24
|
const [resolving, setResolving] = useState(Boolean(projectId));
|
|
24
25
|
|
|
25
26
|
useEffect(() => {
|
|
26
|
-
if (!projectId)
|
|
27
|
-
setResolving(false);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
27
|
+
if (!projectId) return;
|
|
30
28
|
let cancelled = false;
|
|
31
29
|
void store.getProject(projectId).then((meta) => {
|
|
32
30
|
if (cancelled) return;
|
|
@@ -87,7 +85,15 @@ export function EditorWorkspace(props: EditorWorkspaceProps): React.ReactElement
|
|
|
87
85
|
|
|
88
86
|
/** Imperative entry point, like QuarksEffectEditor.Show, for the project-based workspace. */
|
|
89
87
|
export const QuarksEditorWorkspace = {
|
|
90
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Mounts an {@link EditorWorkspace} into `hostElement`.
|
|
90
|
+
*
|
|
91
|
+
* @returns A handle whose `dispose()` unmounts it.
|
|
92
|
+
*/
|
|
93
|
+
Show(options: EditorWorkspaceProps & {hostElement: HTMLElement}): {
|
|
94
|
+
/** Unmounts the workspace. */
|
|
95
|
+
dispose: () => void;
|
|
96
|
+
} {
|
|
91
97
|
const {hostElement, ...props} = options;
|
|
92
98
|
const root = createRoot(hostElement);
|
|
93
99
|
root.render(<EditorWorkspace {...props} />);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {Texture} from '@babylonjs/core/Materials/Textures/texture.js';
|
|
2
|
+
import type {TransformNode} from '@babylonjs/core/Meshes/transformNode.js';
|
|
2
3
|
import type {ParticleSystem} from 'babylon.quarks';
|
|
3
4
|
import React, {useEffect, useSyncExternalStore} from 'react';
|
|
4
|
-
import {EffectBinding} from '../core/binding';
|
|
5
|
+
import {EffectBinding} from '../core/binding.js';
|
|
5
6
|
import {
|
|
7
|
+
AttractorModule,
|
|
6
8
|
CollisionModule,
|
|
7
9
|
ColorBySpeedModule,
|
|
8
10
|
EmitDirectionModule,
|
|
@@ -22,8 +24,8 @@ import {
|
|
|
22
24
|
TurbulenceModule,
|
|
23
25
|
VelocityOverLifeModule,
|
|
24
26
|
WidthOverTrailModule,
|
|
25
|
-
} from './behaviorModules';
|
|
26
|
-
import type {GeometryData, GeometryOption, TextureOption} from './modules';
|
|
27
|
+
} from './behaviorModules.js';
|
|
28
|
+
import type {GeometryData, GeometryOption, TextureOption} from './modules.js';
|
|
27
29
|
import {
|
|
28
30
|
ColorOverLifeModule,
|
|
29
31
|
EmissionModule,
|
|
@@ -31,22 +33,27 @@ import {
|
|
|
31
33
|
RendererModule,
|
|
32
34
|
ShapeModule,
|
|
33
35
|
SizeOverLifeModule,
|
|
34
|
-
} from './modules';
|
|
35
|
-
import {ObjectModule} from './ObjectModule';
|
|
36
|
-
import {SubEmittersModule} from './SubEmittersModule';
|
|
37
|
-
import {theme} from './theme';
|
|
36
|
+
} from './modules.js';
|
|
37
|
+
import {ObjectModule} from './ObjectModule.js';
|
|
38
|
+
import {SubEmittersModule} from './SubEmittersModule.js';
|
|
39
|
+
import {theme} from './theme.js';
|
|
38
40
|
|
|
41
|
+
/** Props of {@link EffectEditor}. */
|
|
39
42
|
export interface EffectEditorProps {
|
|
43
|
+
/** The effect the modules edit. */
|
|
40
44
|
binding: EffectBinding;
|
|
41
45
|
/** Currently selected system, lifted up so the timeline panel and this module stack agree. */
|
|
42
46
|
selectedSystem: ParticleSystem;
|
|
47
|
+
/** The node the Object module edits the transform of. */
|
|
43
48
|
gizmoTargetNode: TransformNode;
|
|
49
|
+
/** The Object module's title for that node. */
|
|
44
50
|
gizmoTargetLabel: string;
|
|
45
51
|
/** Texture presets offered in the Renderer module (host supplies the loader). */
|
|
46
52
|
textureOptions?: TextureOption[];
|
|
47
53
|
/** Mesh presets offered for the Mesh render mode (host supplies the geometry buffers). */
|
|
48
54
|
geometryOptions?: GeometryOption[];
|
|
49
|
-
|
|
55
|
+
/** Host texture loader for picked URLs; a plain `Texture` is made without it. */
|
|
56
|
+
resolveTexture?: (url: string) => Texture | null | undefined;
|
|
50
57
|
/** Host loader for "Load from file…" in the Mesh render mode (e.g. a GLB importer). */
|
|
51
58
|
resolveGeometry?: (file: File) => Promise<GeometryData>;
|
|
52
59
|
}
|
|
@@ -112,6 +119,7 @@ export const EffectEditor = React.memo(function EffectEditor(props: EffectEditor
|
|
|
112
119
|
<InheritVelocityModule binding={binding} />
|
|
113
120
|
<ForceOverLifeModule binding={binding} />
|
|
114
121
|
<GravityModule binding={binding} />
|
|
122
|
+
<AttractorModule binding={binding} />
|
|
115
123
|
<OrbitOverLifeModule binding={binding} />
|
|
116
124
|
<ColorOverLifeModule binding={binding} />
|
|
117
125
|
<ColorBySpeedModule binding={binding} />
|