babylon.quarks-editor 0.27.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +31 -4
  3. package/dist/core/assetTree.d.ts +5 -0
  4. package/dist/core/assets.d.ts +7 -0
  5. package/dist/core/assets.js +11 -7
  6. package/dist/core/binding.d.ts +9 -0
  7. package/dist/core/binding.js +8 -0
  8. package/dist/core/collision.d.ts +4 -0
  9. package/dist/core/collision.js +4 -0
  10. package/dist/core/colors.d.ts +16 -0
  11. package/dist/core/colors.js +8 -0
  12. package/dist/core/defaultEffect.d.ts +3 -2
  13. package/dist/core/defaultEffect.js +1 -1
  14. package/dist/core/editorSession.d.ts +229 -0
  15. package/dist/core/editorSession.js +983 -0
  16. package/dist/core/effectTree.d.ts +5 -0
  17. package/dist/core/galleryPlayback.js +2 -1
  18. package/dist/core/history.d.ts +6 -0
  19. package/dist/core/history.js +4 -0
  20. package/dist/core/indexedDbProjectStore.d.ts +13 -0
  21. package/dist/core/indexedDbProjectStore.js +13 -0
  22. package/dist/core/material.d.ts +12 -2
  23. package/dist/core/playback.d.ts +6 -0
  24. package/dist/core/projectStore.d.ts +26 -0
  25. package/dist/core/projectStore.js +1 -0
  26. package/dist/core/sceneEntries.d.ts +3 -0
  27. package/dist/core/scrub.d.ts +1 -1
  28. package/dist/core/scrub.js +2 -2
  29. package/dist/core/shapes.d.ts +24 -0
  30. package/dist/core/shapes.js +5 -0
  31. package/dist/core/systems.d.ts +2 -0
  32. package/dist/core/systems.js +3 -1
  33. package/dist/core/timeline.d.ts +23 -3
  34. package/dist/core/values.d.ts +21 -4
  35. package/dist/core/values.js +5 -0
  36. package/dist/index.d.ts +5 -1
  37. package/dist/react/AssetsPanel.d.ts +7 -0
  38. package/dist/react/ChoiceDialog.d.ts +7 -0
  39. package/dist/react/ContextMenu.d.ts +10 -1
  40. package/dist/react/EditorWorkspace.d.ts +7 -0
  41. package/dist/react/EditorWorkspace.js +6 -3
  42. package/dist/react/EffectEditor.d.ts +8 -2
  43. package/dist/react/EffectEditorHost.d.ts +32 -28
  44. package/dist/react/EffectEditorHost.js +241 -1665
  45. package/dist/react/EffectTreeView.d.ts +3 -0
  46. package/dist/react/MessageDialog.d.ts +5 -0
  47. package/dist/react/ModuleSection.d.ts +10 -0
  48. package/dist/react/ModuleSection.js +4 -1
  49. package/dist/react/ProjectsPage.d.ts +6 -0
  50. package/dist/react/ProjectsPage.js +27 -11
  51. package/dist/react/PromptDialog.d.ts +7 -0
  52. package/dist/react/ScenePanel.d.ts +7 -0
  53. package/dist/react/ScenePanel.js +7 -5
  54. package/dist/react/TextureSelect.d.ts +5 -5
  55. package/dist/react/TimelinePanel.d.ts +13 -0
  56. package/dist/react/TimelinePanel.js +10 -6
  57. package/dist/react/TimelineTrackRow.d.ts +10 -0
  58. package/dist/react/TransportBar.d.ts +9 -0
  59. package/dist/react/ValueField.d.ts +32 -5
  60. package/dist/react/ValueField.js +20 -9
  61. package/dist/react/behaviorModules.d.ts +16 -5
  62. package/dist/react/behaviorModules.js +16 -1
  63. package/dist/react/fields.d.ts +8 -0
  64. package/dist/react/fields.js +3 -0
  65. package/dist/react/host/BottomDocks.d.ts +36 -0
  66. package/dist/react/host/BottomDocks.js +63 -0
  67. package/dist/react/host/HostDialogs.d.ts +50 -0
  68. package/dist/react/host/HostDialogs.js +113 -0
  69. package/dist/react/host/InspectorSidebar.d.ts +32 -0
  70. package/dist/react/host/InspectorSidebar.js +59 -0
  71. package/dist/react/host/SceneSidebar.d.ts +53 -0
  72. package/dist/react/host/SceneSidebar.js +62 -0
  73. package/dist/react/host/ViewportPane.d.ts +56 -0
  74. package/dist/react/host/ViewportPane.js +91 -0
  75. package/dist/react/host/hostHooks.d.ts +44 -0
  76. package/dist/react/host/hostHooks.js +164 -0
  77. package/dist/react/host/hostStyles.d.ts +21 -0
  78. package/dist/react/host/hostStyles.js +57 -0
  79. package/dist/react/index.d.ts +3 -1
  80. package/dist/react/modules.d.ts +17 -6
  81. package/dist/react/modules.js +38 -20
  82. package/dist/react/theme.d.ts +15 -0
  83. package/dist/react/theme.js +15 -0
  84. package/dist/session.d.ts +9 -0
  85. package/dist/session.js +8 -0
  86. package/package.json +17 -11
  87. package/src/core/assetTree.ts +14 -1
  88. package/src/core/assets.ts +25 -10
  89. package/src/core/binding.ts +9 -0
  90. package/src/core/collision.ts +4 -0
  91. package/src/core/colors.ts +21 -1
  92. package/src/core/defaultEffect.ts +4 -3
  93. package/src/core/editorSession.ts +1299 -0
  94. package/src/core/effectTree.ts +5 -0
  95. package/src/core/galleryPlayback.ts +2 -1
  96. package/src/core/history.ts +6 -0
  97. package/src/core/indexedDbProjectStore.ts +13 -0
  98. package/src/core/loadEffect.ts +1 -1
  99. package/src/core/material.ts +14 -4
  100. package/src/core/playback.ts +6 -0
  101. package/src/core/projectStore.ts +26 -0
  102. package/src/core/sceneEntries.ts +3 -0
  103. package/src/core/scrub.ts +2 -2
  104. package/src/core/shapes.ts +28 -1
  105. package/src/core/systems.ts +9 -2
  106. package/src/core/timeline.ts +40 -15
  107. package/src/core/values.ts +20 -4
  108. package/src/index.ts +5 -1
  109. package/src/react/AssetsPanel.tsx +7 -0
  110. package/src/react/ChoiceDialog.tsx +7 -0
  111. package/src/react/ContextMenu.tsx +10 -1
  112. package/src/react/EditorWorkspace.tsx +11 -5
  113. package/src/react/EffectEditor.tsx +7 -1
  114. package/src/react/EffectEditorHost.tsx +406 -2340
  115. package/src/react/EffectTreeView.tsx +3 -0
  116. package/src/react/MessageDialog.tsx +5 -0
  117. package/src/react/ModuleSection.tsx +11 -0
  118. package/src/react/ProjectsPage.tsx +38 -11
  119. package/src/react/PromptDialog.tsx +7 -0
  120. package/src/react/ScenePanel.tsx +14 -5
  121. package/src/react/TextureSelect.tsx +6 -6
  122. package/src/react/TimelinePanel.tsx +23 -6
  123. package/src/react/TimelineTrackRow.tsx +10 -0
  124. package/src/react/TransportBar.tsx +9 -0
  125. package/src/react/ValueField.tsx +58 -14
  126. package/src/react/behaviorModules.tsx +34 -32
  127. package/src/react/fields.tsx +12 -1
  128. package/src/react/host/BottomDocks.tsx +178 -0
  129. package/src/react/host/HostDialogs.tsx +228 -0
  130. package/src/react/host/InspectorSidebar.tsx +147 -0
  131. package/src/react/host/SceneSidebar.tsx +227 -0
  132. package/src/react/host/ViewportPane.tsx +300 -0
  133. package/src/react/host/hostHooks.ts +198 -0
  134. package/src/react/host/hostStyles.ts +65 -0
  135. package/src/react/index.ts +3 -1
  136. package/src/react/modules.tsx +70 -44
  137. package/src/react/theme.ts +15 -0
  138. package/src/session.ts +17 -0
@@ -10,6 +10,7 @@ import type {
10
10
  ParticleErosionOptions,
11
11
  ParticleSystem,
12
12
  ParticleUVDistortionOptions,
13
+ RenderFace,
13
14
  ScalingMode,
14
15
  SortMode,
15
16
  TrailSettings,
@@ -36,7 +37,6 @@ import {
36
37
  normalizeTextureUV,
37
38
  } from 'babylon.quarks';
38
39
  import React, {useMemo} from 'react';
39
- import {EffectBinding} from '../core/binding.js';
40
40
  import {
41
41
  DEFAULT_GRADIENT_STOPS,
42
42
  GradientStop,
@@ -60,7 +60,7 @@ import {buildCurve, buildScalar, readPieces, readScalar} from '../core/values.js
60
60
  import {CurveEditor} from './CurveEditor.js';
61
61
  import {GradientEditor} from './GradientEditor.js';
62
62
  import {InspectorInfoIcon} from './InspectorInfoIcon.js';
63
- import {ModuleSection} from './ModuleSection.js';
63
+ import {ModuleSection, type ModuleProps} from './ModuleSection.js';
64
64
  import {TextureSelect} from './TextureSelect.js';
65
65
  import {TextureUVField} from './TextureUVField.js';
66
66
  import {ValueField} from './ValueField.js';
@@ -68,10 +68,6 @@ import {CheckboxField, NumberField, Row, SelectField} from './fields.js';
68
68
  import {iconStyle} from './icons.js';
69
69
  import {theme} from './theme.js';
70
70
 
71
- interface ModuleProps {
72
- binding: EffectBinding;
73
- }
74
-
75
71
  const MESH_QUAD_POSITIONS = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]);
76
72
  const MESH_QUAD_INDICES = new Uint32Array([0, 1, 2, 0, 2, 3]);
77
73
  const MESH_QUAD_UVS = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);
@@ -194,18 +190,20 @@ function ColorInput(props: {value: Vector4; onChange: (next: Vector4) => void})
194
190
  );
195
191
  }
196
192
 
193
+ /** The Main module (Unity's main module): duration, looping, start delay, life, speed, size, rotation and colour. */
197
194
  export function MainModule({binding}: ModuleProps) {
198
195
  const system = binding.system;
199
196
  const startColor = system.startColor;
200
197
  const colorMode =
201
198
  startColor instanceof RandomColor ? 'random' : startColor instanceof ColorRange ? 'range' : 'constant';
202
- const twoColors = startColor instanceof RandomColor || startColor instanceof ColorRange;
203
- const colorA = twoColors
204
- ? (startColor as never as {a: Vector4}).a
199
+ const twoColor = startColor instanceof RandomColor || startColor instanceof ColorRange ? startColor : null;
200
+ const colorA = twoColor
201
+ ? twoColor.a
205
202
  : startColor instanceof ConstantColor
206
203
  ? startColor.color
207
204
  : new Vector4(1, 1, 1, 1);
208
- const colorB = twoColors ? (startColor as never as {b: Vector4}).b : new Vector4(1, 0.5, 0.2, 1);
205
+ const colorB = twoColor ? twoColor.b : new Vector4(1, 0.5, 0.2, 1);
206
+ const twoColors = twoColor !== null;
209
207
  /** The two-colour generator of the current mode. */
210
208
  const makeTwoColors = (a: Vector4, b: Vector4) =>
211
209
  colorMode === 'range' ? new ColorRange(a, b) : new RandomColor(a, b);
@@ -219,17 +217,17 @@ export function MainModule({binding}: ModuleProps) {
219
217
  ? 'euler'
220
218
  : isAxisAngle
221
219
  ? 'axisAngle'
222
- : readScalar(rotation as never).mode === 'random'
220
+ : readScalar(rotation).mode === 'random'
223
221
  ? 'random'
224
222
  : 'angle';
225
223
  const rotationState = readScalar(
226
- rotation instanceof RandomQuatGenerator || isEuler || isAxisAngle ? undefined : (rotation as never)
224
+ rotation instanceof RandomQuatGenerator || isEuler || isAxisAngle ? undefined : rotation
227
225
  );
228
226
  const axisAngle = isAxisAngle ? (rotation as AxisAngleGenerator) : undefined;
229
227
  const eulerAngles = {
230
- x: isEuler ? readScalar((rotation as EulerGenerator).angleX as never).value : 0,
231
- y: isEuler ? readScalar((rotation as EulerGenerator).angleY as never).value : 0,
232
- z: isEuler ? readScalar((rotation as EulerGenerator).angleZ as never).value : 0,
228
+ x: isEuler ? readScalar((rotation as EulerGenerator).angleX).value : 0,
229
+ y: isEuler ? readScalar((rotation as EulerGenerator).angleY).value : 0,
230
+ z: isEuler ? readScalar((rotation as EulerGenerator).angleZ).value : 0,
233
231
  };
234
232
  const setEulerAxis = (axis: 'x' | 'y' | 'z', v: number) =>
235
233
  binding.apply((s) => {
@@ -240,8 +238,7 @@ export function MainModule({binding}: ModuleProps) {
240
238
  axis === 'z' ? new ConstantValue(v) : cur.angleZ
241
239
  );
242
240
  });
243
- const startSize = system.startSize as unknown as {type?: string; x?: never; y?: never; z?: never};
244
- const size3D = startSize.type === 'vec3function';
241
+ const startSize3D = system.startSize instanceof Vector3Function ? system.startSize : null;
245
242
  const colorGenMode =
246
243
  startColor instanceof RandomColorBetweenGradient
247
244
  ? 'gradient2'
@@ -349,50 +346,50 @@ export function MainModule({binding}: ModuleProps) {
349
346
  />
350
347
  <Row label="Start size">
351
348
  <SelectField
352
- value={size3D ? '3d' : 'uniform'}
349
+ value={startSize3D ? '3d' : 'uniform'}
353
350
  options={[
354
351
  {value: 'uniform', label: 'Uniform'},
355
352
  {value: '3d', label: '3D (per axis)'},
356
353
  ]}
357
354
  onChange={(mode) =>
358
355
  binding.apply((s) => {
359
- const cur = s.startSize as never as {clone: () => never; x?: never};
360
- if (mode === '3d') {
356
+ const cur = s.startSize;
357
+ if (mode === '3d' && cur.type !== 'vec3function') {
361
358
  // Seed all three axes from the current uniform generator.
362
359
  s.startSize = new Vector3Function(cur.clone(), cur.clone(), cur.clone());
363
- } else {
360
+ } else if (mode !== '3d' && cur instanceof Vector3Function) {
364
361
  // Collapse back to the X-axis generator.
365
- s.startSize = (s.startSize as never as {x: never}).x;
362
+ s.startSize = cur.x;
366
363
  }
367
364
  })
368
365
  }
369
366
  />
370
367
  </Row>
371
- {!size3D && (
368
+ {!startSize3D && (
372
369
  <ValueField
373
370
  label=""
374
- generator={system.startSize as never}
371
+ generator={system.startSize}
375
372
  min={0}
376
373
  curveMax={5}
377
374
  onChange={(g) => binding.apply((s) => (s.startSize = g))}
378
375
  />
379
376
  )}
380
- {size3D && (
377
+ {startSize3D && (
381
378
  <>
382
379
  {(['x', 'y', 'z'] as const).map((axis) => (
383
380
  <ValueField
384
381
  key={axis}
385
382
  label={axis.toUpperCase()}
386
- generator={startSize[axis] as never}
383
+ generator={startSize3D[axis]}
387
384
  min={0}
388
385
  curveMax={5}
389
386
  onChange={(g) =>
390
387
  binding.apply((s) => {
391
388
  const cur = s.startSize as Vector3Function;
392
389
  s.startSize = new Vector3Function(
393
- axis === 'x' ? (g as never) : cur.x,
394
- axis === 'y' ? (g as never) : cur.y,
395
- axis === 'z' ? (g as never) : cur.z
390
+ axis === 'x' ? g : cur.x,
391
+ axis === 'y' ? g : cur.y,
392
+ axis === 'z' ? g : cur.z
396
393
  );
397
394
  })
398
395
  }
@@ -585,6 +582,7 @@ export function MainModule({binding}: ModuleProps) {
585
582
  );
586
583
  }
587
584
 
585
+ /** The Emission module (Unity's Emission): rate over time and distance, and bursts. */
588
586
  export function EmissionModule({binding}: ModuleProps) {
589
587
  const system = binding.system;
590
588
  const bursts = system.emissionBursts ?? [];
@@ -634,7 +632,7 @@ export function EmissionModule({binding}: ModuleProps) {
634
632
  </Row>
635
633
  <Row label="Count">
636
634
  <NumberField
637
- value={readScalar(burst.count as never).value}
635
+ value={readScalar(burst.count).value}
638
636
  min={0}
639
637
  step={1}
640
638
  onChange={(count) =>
@@ -707,6 +705,7 @@ export function EmissionModule({binding}: ModuleProps) {
707
705
  // first texture" bug: a control that looks live but does nothing.
708
706
  const SHAPES_WITHOUT_MODE_SPREAD = new Set<ShapeType>(['point', 'grid', 'box', 'mesh_surface']);
709
707
 
708
+ /** The Shape module (Unity's Shape): the emitter shape and its settings. */
710
709
  export function ShapeModule({binding}: ModuleProps) {
711
710
  const system = binding.system;
712
711
  const type = getShapeType(system.emitterShape);
@@ -806,12 +805,11 @@ export function ShapeModule({binding}: ModuleProps) {
806
805
  );
807
806
  }
808
807
 
808
+ /** The Size over Lifetime module (Unity's Size over Lifetime): size by a curve over the particle's life. */
809
809
  export function SizeOverLifeModule({binding}: ModuleProps) {
810
810
  const system = binding.system;
811
811
  const behavior = findBehavior<SizeOverLife>(system.behaviors, 'SizeOverLife');
812
- const curve = behavior
813
- ? readScalar(behavior.size as never).curve
814
- : ([0.2, 1, 1, 0.4] as [number, number, number, number]);
812
+ const curve = behavior ? readScalar(behavior.size).curve : ([0.2, 1, 1, 0.4] as [number, number, number, number]);
815
813
  return (
816
814
  <ModuleSection
817
815
  title="Size over Lifetime"
@@ -820,21 +818,19 @@ export function SizeOverLifeModule({binding}: ModuleProps) {
820
818
  binding.apply((s) => {
821
819
  removeBehavior(s, 'SizeOverLife');
822
820
  if (enabled) {
823
- s.addBehavior(
824
- new SizeOverLife(buildScalar({mode: 'curve', value: 1, min: 0, max: 1, curve}) as never)
825
- );
821
+ s.addBehavior(new SizeOverLife(buildScalar({mode: 'curve', value: 1, min: 0, max: 1, curve})));
826
822
  }
827
823
  })
828
824
  }
829
825
  >
830
826
  <div style={{marginTop: 6}}>
831
827
  <CurveEditor
832
- pieces={behavior ? readPieces(behavior.size as never) : [{start: 0, p: curve}]}
828
+ pieces={behavior ? readPieces(behavior.size) : [{start: 0, p: curve}]}
833
829
  maxValue={2}
834
830
  onChange={(pieces) =>
835
831
  binding.apply((s) => {
836
832
  removeBehavior(s, 'SizeOverLife');
837
- s.addBehavior(new SizeOverLife(buildCurve(pieces) as never));
833
+ s.addBehavior(new SizeOverLife(buildCurve(pieces)));
838
834
  })
839
835
  }
840
836
  />
@@ -843,6 +839,7 @@ export function SizeOverLifeModule({binding}: ModuleProps) {
843
839
  );
844
840
  }
845
841
 
842
+ /** The Color over Lifetime module (Unity's Color over Lifetime): a gradient over the particle's life. */
846
843
  export function ColorOverLifeModule({binding}: ModuleProps) {
847
844
  const system = binding.system;
848
845
  const behavior = findBehavior<ColorOverLife>(system.behaviors, 'ColorOverLife');
@@ -873,8 +870,11 @@ export function ColorOverLifeModule({binding}: ModuleProps) {
873
870
  );
874
871
  }
875
872
 
873
+ /** A texture preset the host offers in the Renderer module's texture menus. */
876
874
  export interface TextureOption {
875
+ /** Its label in the menu. */
877
876
  label: string;
877
+ /** The URL the host's texture loader receives. */
878
878
  url: string;
879
879
  }
880
880
 
@@ -884,12 +884,17 @@ export interface TextureOption {
884
884
  * them into the system's instancing geometry.
885
885
  */
886
886
  export interface GeometryOption {
887
+ /** Its label in the menu. */
887
888
  label: string;
889
+ /** Vertex positions, three values per vertex. */
888
890
  positions: Float32Array | number[];
891
+ /** Triangle indices; without them the vertices are drawn in sequence. */
889
892
  indices?: Uint32Array | number[];
893
+ /** The first UV set, two values per vertex; without it the mesh samples UV (0, 0). */
890
894
  uvs?: Float32Array | number[];
891
895
  /** A second UV set (glTF `TEXCOORD_1`), what textures on UV channel 1 read on the mesh. */
892
896
  uvs2?: Float32Array | number[];
897
+ /** Vertex normals, three values per vertex; without them lighting uses +Z. */
893
898
  normals?: Float32Array | number[];
894
899
  }
895
900
 
@@ -982,6 +987,7 @@ function MeshPreview({
982
987
  );
983
988
  }
984
989
 
990
+ /** The Renderer module (Unity's Renderer): render mode, material, textures, sorting and mesh settings. */
985
991
  export function RendererModule({
986
992
  binding,
987
993
  textureOptions,
@@ -991,7 +997,7 @@ export function RendererModule({
991
997
  }: ModuleProps & {
992
998
  textureOptions?: TextureOption[];
993
999
  geometryOptions?: GeometryOption[];
994
- resolveTexture?: (url: string) => unknown;
1000
+ resolveTexture?: (url: string) => Texture | null | undefined;
995
1001
  resolveGeometry?: (file: File) => Promise<GeometryData>;
996
1002
  }) {
997
1003
  const system = binding.system;
@@ -1431,13 +1437,20 @@ export function RendererModule({
1431
1437
  const hostGeometry = geometryOptions ?? [];
1432
1438
  const applyGeometry = (g: GeometryData) =>
1433
1439
  binding.apply((s) => {
1440
+ // The previous mesh's sets go first, so the positions setter gives
1441
+ // this mesh the library's own fallback UVs and normals; then every set
1442
+ // this mesh has. An unindexed mesh draws its vertices in sequence.
1434
1443
  const settings = s.getRendererSettings();
1435
- // Positions first: the setter keeps or drops the other sets by vertex count.
1444
+ settings.instancingUVs = undefined;
1445
+ settings.instancingUVs2 = undefined;
1446
+ settings.instancingNormals = undefined;
1436
1447
  s.instancingGeometry = new Float32Array(g.positions);
1437
- settings.instancingIndices = (g.indices ? new Uint32Array(g.indices) : undefined) as never;
1438
- settings.instancingUVs = (g.uvs ? new Float32Array(g.uvs) : undefined) as never;
1439
- settings.instancingUVs2 = (g.uvs2 ? new Float32Array(g.uvs2) : undefined) as never;
1440
- settings.instancingNormals = (g.normals ? new Float32Array(g.normals) : undefined) as never;
1448
+ s.instancingIndices = g.indices
1449
+ ? new Uint32Array(g.indices)
1450
+ : Uint32Array.from({length: g.positions.length / 3}, (_, i) => i);
1451
+ if (g.uvs) s.instancingUVs = new Float32Array(g.uvs);
1452
+ if (g.uvs2) s.instancingUVs2 = new Float32Array(g.uvs2);
1453
+ if (g.normals) settings.instancingNormals = new Float32Array(g.normals);
1441
1454
  });
1442
1455
  return (
1443
1456
  <Row label="Geometry">
@@ -1658,6 +1671,19 @@ export function RendererModule({
1658
1671
  </Row>
1659
1672
  </>
1660
1673
  )}
1674
+ {isMesh && (
1675
+ <Row label="Render face">
1676
+ <SelectField
1677
+ value={system.renderFace}
1678
+ options={[
1679
+ {value: 'both', label: 'Both'},
1680
+ {value: 'front', label: 'Front'},
1681
+ {value: 'back', label: 'Back'},
1682
+ ]}
1683
+ onChange={(face) => binding.apply((s) => (s.renderFace = face as RenderFace))}
1684
+ />
1685
+ </Row>
1686
+ )}
1661
1687
  <Row label="Sort mode">
1662
1688
  <SelectField
1663
1689
  value={system.sortMode}
@@ -1,18 +1,30 @@
1
1
  import type {CSSProperties} from 'react';
2
2
 
3
+ /** The editor's colours and font, for hosts that style their own panels to match. */
3
4
  export const theme = {
5
+ /** Background of the side panels and docks. */
4
6
  panelBg: 'linear-gradient(180deg, rgba(12, 18, 38, 0.92), rgba(6, 10, 22, 0.94))',
7
+ /** Background of an inspector module or a framed list. */
5
8
  sectionBg: 'rgba(10, 16, 34, 0.6)',
9
+ /** Borders and separators. */
6
10
  border: '#2a365f',
11
+ /** The border of a selected or switched-on control. */
7
12
  borderActive: '#4f6fbe',
13
+ /** Body text. */
8
14
  text: '#eef3ff',
15
+ /** Labels and secondary text. */
9
16
  textDim: '#b7c6ea',
17
+ /** Highlights, such as a Save button with something to save. */
10
18
  accent: '#9eb9ff',
19
+ /** Background of inputs. */
11
20
  inputBg: 'rgba(7, 11, 22, 0.82)',
21
+ /** The line of curve editors. */
12
22
  curveStroke: '#78a5ff',
23
+ /** The editor's font stack. */
13
24
  font: 'Inter, Segoe UI, Roboto, sans-serif',
14
25
  };
15
26
 
27
+ /** Style of a text or number input. */
16
28
  export const inputStyle: CSSProperties = {
17
29
  background: theme.inputBg,
18
30
  border: `1px solid ${theme.border}`,
@@ -26,6 +38,7 @@ export const inputStyle: CSSProperties = {
26
38
  fontFamily: theme.font,
27
39
  };
28
40
 
41
+ /** Style of an inspector row: a label column, then the controls. */
29
42
  export const rowStyle: CSSProperties = {
30
43
  display: 'grid',
31
44
  gridTemplateColumns: '110px 1fr',
@@ -34,6 +47,7 @@ export const rowStyle: CSSProperties = {
34
47
  marginTop: 6,
35
48
  };
36
49
 
50
+ /** Style of an inspector row's label. */
37
51
  export const labelStyle: CSSProperties = {
38
52
  color: theme.textDim,
39
53
  fontSize: 12,
@@ -42,6 +56,7 @@ export const labelStyle: CSSProperties = {
42
56
  textOverflow: 'ellipsis',
43
57
  };
44
58
 
59
+ /** Style of a button. */
45
60
  export const buttonStyle: CSSProperties = {
46
61
  border: `1px solid #4563ad`,
47
62
  background: 'rgba(28, 48, 98, 0.55)',
package/src/session.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The editor's headless session: scene, camera, gizmos, history, scene entries, assets, prefab
3
+ * mode and project save/load, without React. It builds the whole viewport (grid, gizmos, markers),
4
+ * so it has its own entry point and the UI-free `babylon.quarks-editor` entry stays light.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ export {createEditorSession} from './core/editorSession.js';
9
+ export type {
10
+ EditorFrameStats,
11
+ EditorProject,
12
+ EditorSession,
13
+ EditorSessionOptions,
14
+ EditorSessionView,
15
+ EffectEditorHostHandle,
16
+ PrefabInfo,
17
+ } from './core/editorSession.js';