@jgengine/editor 0.10.0 → 0.12.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 (179) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +12 -0
  3. package/dist/AssetBrowser.d.ts +26 -1
  4. package/dist/AssetBrowser.js +54 -1
  5. package/dist/AssetDropZone.d.ts +9 -0
  6. package/dist/AssetDropZone.js +65 -0
  7. package/dist/CatalogsPanel.d.ts +4 -2
  8. package/dist/CatalogsPanel.js +162 -9
  9. package/dist/CityPreview.d.ts +11 -0
  10. package/dist/CityPreview.js +45 -0
  11. package/dist/CollectionsPanel.js +5 -5
  12. package/dist/DebugDraw.d.ts +3 -1
  13. package/dist/DebugDraw.js +37 -19
  14. package/dist/EditorApp.d.ts +9 -1
  15. package/dist/EditorApp.js +208 -37
  16. package/dist/EditorChrome.d.ts +25 -6
  17. package/dist/EditorChrome.js +310 -118
  18. package/dist/InspectorPanel.d.ts +17 -7
  19. package/dist/InspectorPanel.js +173 -27
  20. package/dist/LightingPanel.d.ts +11 -0
  21. package/dist/LightingPanel.js +99 -0
  22. package/dist/MaterialsWorkspacePanel.d.ts +12 -0
  23. package/dist/MaterialsWorkspacePanel.js +86 -0
  24. package/dist/ParentPickerMenu.d.ts +13 -0
  25. package/dist/ParentPickerMenu.js +33 -0
  26. package/dist/PerfProbe.js +69 -2
  27. package/dist/PrefabsPanel.js +5 -5
  28. package/dist/RuntimePlayBridge.d.ts +5 -3
  29. package/dist/RuntimePlayBridge.js +6 -13
  30. package/dist/ScatterPreview.d.ts +3 -1
  31. package/dist/ScatterPreview.js +10 -7
  32. package/dist/SchemaInspector.js +21 -8
  33. package/dist/ScriptingPanel.d.ts +15 -0
  34. package/dist/ScriptingPanel.js +46 -0
  35. package/dist/SelectionGizmo.js +114 -30
  36. package/dist/StandaloneEditor.d.ts +16 -9
  37. package/dist/StandaloneEditor.js +19 -20
  38. package/dist/TerrainPanel.d.ts +3 -2
  39. package/dist/TerrainPanel.js +16 -5
  40. package/dist/TerrainReadout.d.ts +17 -0
  41. package/dist/TerrainReadout.js +163 -0
  42. package/dist/TerrainReadoutHud.d.ts +9 -0
  43. package/dist/TerrainReadoutHud.js +20 -0
  44. package/dist/TerrainSculpt.js +98 -59
  45. package/dist/agent/AgentPanel.d.ts +5 -2
  46. package/dist/agent/AgentPanel.js +11 -6
  47. package/dist/agent/toolBridge.js +5 -0
  48. package/dist/assetImport.d.ts +36 -0
  49. package/dist/assetImport.js +66 -0
  50. package/dist/authoredComponentMeta.d.ts +25 -0
  51. package/dist/authoredComponentMeta.js +65 -0
  52. package/dist/gizmoPivot.d.ts +4 -0
  53. package/dist/gizmoPivot.js +34 -0
  54. package/dist/handlers/catalogs.d.ts +3 -0
  55. package/dist/handlers/catalogs.js +137 -0
  56. package/dist/handlers/collections.d.ts +3 -0
  57. package/dist/handlers/collections.js +57 -0
  58. package/dist/handlers/context.d.ts +36 -0
  59. package/dist/handlers/context.js +1 -0
  60. package/dist/handlers/document.d.ts +3 -0
  61. package/dist/handlers/document.js +350 -0
  62. package/dist/handlers/grids.d.ts +3 -0
  63. package/dist/handlers/grids.js +142 -0
  64. package/dist/handlers/hierarchy.d.ts +3 -0
  65. package/dist/handlers/hierarchy.js +55 -0
  66. package/dist/handlers/index.d.ts +8 -0
  67. package/dist/handlers/index.js +23 -0
  68. package/dist/handlers/minimap.d.ts +9 -0
  69. package/dist/handlers/minimap.js +32 -0
  70. package/dist/handlers/runtime.d.ts +3 -0
  71. package/dist/handlers/runtime.js +191 -0
  72. package/dist/handlers/terrain.d.ts +3 -0
  73. package/dist/handlers/terrain.js +204 -0
  74. package/dist/index.d.ts +3 -2
  75. package/dist/index.js +3 -2
  76. package/dist/listDocumentTriggers.d.ts +42 -0
  77. package/dist/listDocumentTriggers.js +49 -0
  78. package/dist/materialAssignments.d.ts +63 -0
  79. package/dist/materialAssignments.js +84 -0
  80. package/dist/mcp/fieldSpec.d.ts +32 -0
  81. package/dist/mcp/fieldSpec.js +173 -0
  82. package/dist/mcp/rpcRequest.d.ts +8 -5
  83. package/dist/mcp/rpcRequest.js +72 -83
  84. package/dist/mcp/tools.js +104 -763
  85. package/dist/networkSnapshot.d.ts +82 -0
  86. package/dist/networkSnapshot.js +73 -0
  87. package/dist/parentCandidates.d.ts +12 -0
  88. package/dist/parentCandidates.js +25 -0
  89. package/dist/perfPill.d.ts +21 -0
  90. package/dist/perfPill.js +20 -0
  91. package/dist/session.d.ts +167 -5
  92. package/dist/session.js +36 -879
  93. package/dist/shell/AnimationPanel.d.ts +17 -0
  94. package/dist/shell/AnimationPanel.js +134 -0
  95. package/dist/shell/AssetThumbnail.d.ts +12 -0
  96. package/dist/shell/AssetThumbnail.js +23 -0
  97. package/dist/shell/BottomDock.d.ts +25 -0
  98. package/dist/shell/BottomDock.js +40 -0
  99. package/dist/shell/CommandPalette.d.ts +12 -0
  100. package/dist/shell/CommandPalette.js +56 -0
  101. package/dist/shell/ConsolePanel.d.ts +8 -0
  102. package/dist/shell/ConsolePanel.js +45 -0
  103. package/dist/shell/ContentBrowser.d.ts +21 -0
  104. package/dist/shell/ContentBrowser.js +130 -0
  105. package/dist/shell/HierarchyPanel.d.ts +26 -0
  106. package/dist/shell/HierarchyPanel.js +387 -0
  107. package/dist/shell/NetworkWorkspacePanel.d.ts +11 -0
  108. package/dist/shell/NetworkWorkspacePanel.js +49 -0
  109. package/dist/shell/PlayModeBar.d.ts +12 -0
  110. package/dist/shell/PlayModeBar.js +27 -0
  111. package/dist/shell/ProfilerPanel.d.ts +10 -0
  112. package/dist/shell/ProfilerPanel.js +41 -0
  113. package/dist/shell/SceneToolbar.d.ts +43 -0
  114. package/dist/shell/SceneToolbar.js +122 -0
  115. package/dist/shell/StatusBar.d.ts +18 -0
  116. package/dist/shell/StatusBar.js +41 -0
  117. package/dist/shell/TopAppBar.d.ts +33 -0
  118. package/dist/shell/TopAppBar.js +64 -0
  119. package/dist/shell/ViewportOverlays.d.ts +23 -0
  120. package/dist/shell/ViewportOverlays.js +136 -0
  121. package/dist/shell/WorkspaceRail.d.ts +20 -0
  122. package/dist/shell/WorkspaceRail.js +31 -0
  123. package/dist/shell/cameraTelemetry.d.ts +27 -0
  124. package/dist/shell/cameraTelemetry.js +24 -0
  125. package/dist/shell/commandRegistry.d.ts +58 -0
  126. package/dist/shell/commandRegistry.js +133 -0
  127. package/dist/shell/consoleSink.d.ts +11 -0
  128. package/dist/shell/consoleSink.js +17 -0
  129. package/dist/shell/consoleStore.d.ts +27 -0
  130. package/dist/shell/consoleStore.js +43 -0
  131. package/dist/shell/fields.d.ts +39 -0
  132. package/dist/shell/fields.js +104 -0
  133. package/dist/shell/formatSavedRelative.d.ts +2 -0
  134. package/dist/shell/formatSavedRelative.js +14 -0
  135. package/dist/shell/glbThumbnailCache.d.ts +45 -0
  136. package/dist/shell/glbThumbnailCache.js +241 -0
  137. package/dist/shell/hierarchyA11y.d.ts +21 -0
  138. package/dist/shell/hierarchyA11y.js +35 -0
  139. package/dist/shell/icons.d.ts +13 -0
  140. package/dist/shell/icons.js +85 -0
  141. package/dist/shell/layoutStore.d.ts +68 -0
  142. package/dist/shell/layoutStore.js +156 -0
  143. package/dist/shell/pathFlythrough.d.ts +37 -0
  144. package/dist/shell/pathFlythrough.js +54 -0
  145. package/dist/shell/perfHistory.d.ts +70 -0
  146. package/dist/shell/perfHistory.js +130 -0
  147. package/dist/shell/renameObject.d.ts +3 -0
  148. package/dist/shell/renameObject.js +25 -0
  149. package/dist/shell/theme.d.ts +36 -0
  150. package/dist/shell/theme.js +37 -0
  151. package/dist/shell/ui.d.ts +84 -0
  152. package/dist/shell/ui.js +90 -0
  153. package/dist/shell/useGlbThumbnail.d.ts +8 -0
  154. package/dist/shell/useGlbThumbnail.js +19 -0
  155. package/dist/terrainReadoutStore.d.ts +19 -0
  156. package/dist/terrainReadoutStore.js +36 -0
  157. package/dist/uiStore.d.ts +33 -0
  158. package/dist/uiStore.js +13 -0
  159. package/dist/viewportContextMenu.d.ts +4 -2
  160. package/dist/viewportContextMenu.js +5 -1
  161. package/package.json +4 -4
  162. package/skills/jgengine/SKILL.md +35 -804
  163. package/skills/jgengine/api.md +190 -79
  164. package/skills/jgengine/capabilities.md +112 -2
  165. package/skills/jgengine/recipes/minimal-game.md +88 -0
  166. package/skills/jgengine-editor/SKILL.md +29 -362
  167. package/skills/jgengine-editor/api.md +519 -18
  168. package/skills/jgengine-editor/capabilities.md +91 -0
  169. package/skills/jgengine-editor/reference.md +113 -0
  170. package/skills/level-design/SKILL.md +54 -0
  171. package/skills/level-design/agents/openai.yaml +4 -0
  172. package/skills/level-design/references/application-playbook.md +192 -0
  173. package/skills/level-design/references/field-guide.md +337 -0
  174. package/skills/level-design/references/live-editor-loop.md +179 -0
  175. package/dist/OutlinerPanel.d.ts +0 -14
  176. package/dist/OutlinerPanel.js +0 -84
  177. package/skills/jgengine/reference-cartridge.md +0 -72
  178. package/skills/jgengine/reference-orphans.md +0 -9
  179. package/skills/jgengine/reference-systems.md +0 -60
package/dist/uiStore.d.ts CHANGED
@@ -47,8 +47,23 @@ export interface SculptSettings {
47
47
  export declare const DEFAULT_SCULPT_SETTINGS: SculptSettings;
48
48
  /** Which transform gizmo is active for the current selection. */
49
49
  export type GizmoMode = "translate" | "rotate" | "scale";
50
+ /** Gizmo handle orientation: world axes, or the selection's local (yaw-rotated) axes. */
51
+ export type GizmoSpace = "world" | "local";
52
+ /**
53
+ * Where multi-select gizmo handles sit:
54
+ * - `origin` — primary selection (first selected id)
55
+ * - `center` — arithmetic mean of selected object positions
56
+ * - `median` — per-axis median of selected object positions
57
+ */
58
+ export type GizmoPivot = "origin" | "center" | "median";
50
59
  /** How gizmo drags land: stick to terrain height, quantize to a grid, or free. */
51
60
  export type SnapMode = "ground" | "grid" | "off";
61
+ /** Editor viewport camera projection — perspective (default) or orthographic top-down-friendly view. */
62
+ export type CameraProjectionMode = "perspective" | "orthographic";
63
+ /** Rotation snap increments (degrees) offered by the toolbar snap menu. */
64
+ export declare const ROTATION_SNAP_CHOICES_DEG: readonly number[];
65
+ /** Scale snap increments offered by the toolbar snap menu. */
66
+ export declare const SCALE_SNAP_CHOICES: readonly number[];
52
67
  /** The active creation tool — what a viewport click places next. */
53
68
  export type PlacementTool = {
54
69
  tool: "marker";
@@ -73,15 +88,33 @@ export interface EditorContextMenuState {
73
88
  /** Transient editor UI state shared between chrome, viewport, and gizmos. */
74
89
  export interface EditorUiState {
75
90
  gizmoMode: GizmoMode;
91
+ /** Whether gizmo handles align to world axes or the selection's yaw. */
92
+ gizmoSpace: GizmoSpace;
93
+ /** Multi-select gizmo pivot policy. */
94
+ gizmoPivot: GizmoPivot;
76
95
  snapMode: SnapMode;
77
96
  gridSize: number;
97
+ /** Rotation snap increment in degrees; `null` rotates freely. */
98
+ rotationSnapDeg: number | null;
99
+ /** Scale snap increment; `null` scales freely. */
100
+ scaleSnap: number | null;
101
+ /** Viewport camera projection (perspective vs orthographic). */
102
+ cameraProjection: CameraProjectionMode;
78
103
  showGrid: boolean;
104
+ /** Surface-following iso-elevation contour overlay (terrain readability). */
105
+ showContours: boolean;
106
+ /** Terrain-draped reference grid overlay that climbs relief instead of being occluded by it. */
107
+ showSurfaceGrid: boolean;
108
+ /** Measurable elevation HUD: cursor height/delta, region min/max/mean, contour interval. */
109
+ showElevation: boolean;
79
110
  placement: PlacementTool | null;
80
111
  pathDraft: readonly EditorVec3[];
81
112
  pathPoint: {
82
113
  pathId: string;
83
114
  index: number;
84
115
  } | null;
116
+ /** Viewport pre-selection hover (object under cursor); null when nothing is hovered. */
117
+ hoverId: string | null;
85
118
  tool: EditorTool;
86
119
  terrainMode: TerrainMode;
87
120
  sculpt: SculptSettings;
package/dist/uiStore.js CHANGED
@@ -30,6 +30,10 @@ export const DEFAULT_SCULPT_SETTINGS = {
30
30
  invert: false,
31
31
  heightLimit: { min: null, max: null },
32
32
  };
33
+ /** Rotation snap increments (degrees) offered by the toolbar snap menu. */
34
+ export const ROTATION_SNAP_CHOICES_DEG = [5, 15, 45, 90];
35
+ /** Scale snap increments offered by the toolbar snap menu. */
36
+ export const SCALE_SNAP_CHOICES = [0.1, 0.25, 0.5, 1];
33
37
  function placementId(prefix) {
34
38
  return `${prefix}_${Date.now().toString(36)}_${Math.floor(Math.random() * 1296).toString(36)}`;
35
39
  }
@@ -37,12 +41,21 @@ function placementId(prefix) {
37
41
  export function createEditorUiStore() {
38
42
  let state = {
39
43
  gizmoMode: "translate",
44
+ gizmoSpace: "world",
45
+ gizmoPivot: "center",
40
46
  snapMode: "ground",
41
47
  gridSize: 1,
48
+ rotationSnapDeg: 15,
49
+ scaleSnap: null,
50
+ cameraProjection: "perspective",
42
51
  showGrid: true,
52
+ showContours: false,
53
+ showSurfaceGrid: false,
54
+ showElevation: false,
43
55
  placement: null,
44
56
  pathDraft: [],
45
57
  pathPoint: null,
58
+ hoverId: null,
46
59
  tool: "select",
47
60
  terrainMode: "sculpt",
48
61
  sculpt: { ...DEFAULT_SCULPT_SETTINGS },
@@ -3,7 +3,7 @@ export declare const RIGHT_CLICK_SLOP_PX = 4;
3
3
  /** @internal True when the pointer released within the drag-vs-click threshold of its down position. */
4
4
  export declare function isPointerClick(startX: number, startY: number, endX: number, endY: number, thresholdPx?: number): boolean;
5
5
  /** @internal One entry in the editor viewport context menu. */
6
- export type EditorContextActionId = "frame" | "frameAll" | "duplicate" | "delete" | "createPrefab" | "copy" | "paste" | "addMarker" | "addVolume" | "addPath" | "addNote" | "openAssets";
6
+ export type EditorContextActionId = "frame" | "frameAll" | "duplicate" | "delete" | "createPrefab" | "parentTo" | "unparent" | "copy" | "paste" | "addMarker" | "addVolume" | "addPath" | "addNote" | "openAssets";
7
7
  /** @internal Label + id for one editor context-menu verb. */
8
8
  export interface EditorContextAction {
9
9
  id: EditorContextActionId;
@@ -16,9 +16,11 @@ export interface BuildEditorContextMenuInput {
16
16
  hitId: string | null;
17
17
  selection: readonly string[];
18
18
  canPaste: boolean;
19
+ /** True when at least one selected/hit object has a parent (offers Unparent). */
20
+ canUnparent?: boolean;
19
21
  }
20
22
  /**
21
23
  * @internal Selection-aware editor context verbs (#866). Hit/selection → frame/duplicate/delete/copy/prefab;
22
- * empty ground → place tools + paste when clipboard has content.
24
+ * empty ground → place tools + paste when clipboard has content. Shared by viewport and hierarchy rows.
23
25
  */
24
26
  export declare function buildEditorContextMenu(input: BuildEditorContextMenuInput): readonly EditorContextAction[];
@@ -6,7 +6,7 @@ export function isPointerClick(startX, startY, endX, endY, thresholdPx = RIGHT_C
6
6
  }
7
7
  /**
8
8
  * @internal Selection-aware editor context verbs (#866). Hit/selection → frame/duplicate/delete/copy/prefab;
9
- * empty ground → place tools + paste when clipboard has content.
9
+ * empty ground → place tools + paste when clipboard has content. Shared by viewport and hierarchy rows.
10
10
  */
11
11
  export function buildEditorContextMenu(input) {
12
12
  const hasSelection = input.selection.length > 0 || input.hitId !== null;
@@ -17,6 +17,10 @@ export function buildEditorContextMenu(input) {
17
17
  { id: "copy", label: "Copy" },
18
18
  { id: "delete", label: "Delete", separatorBefore: true },
19
19
  { id: "createPrefab", label: "Create prefab…", separatorBefore: true },
20
+ { id: "parentTo", label: "Parent to…", separatorBefore: true },
21
+ ...(input.canUnparent === true
22
+ ? [{ id: "unparent", label: "Unparent" }]
23
+ : []),
20
24
  { id: "paste", label: "Paste", disabled: !input.canPaste, separatorBefore: true },
21
25
  ];
22
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jgengine/editor",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Scene/world/asset editor for JGengine — loaded lazily by the runner; never import from game entrypoints.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -31,9 +31,9 @@
31
31
  "test": "bun test src"
32
32
  },
33
33
  "dependencies": {
34
- "@jgengine/core": "^0.10.0",
35
- "@jgengine/react": "^0.10.0",
36
- "@jgengine/shell": "^0.10.0"
34
+ "@jgengine/core": "^0.12.0",
35
+ "@jgengine/react": "^0.12.0",
36
+ "@jgengine/shell": "^0.12.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@react-three/drei": "^10.0.0",