@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.
- package/CHANGELOG.md +27 -1
- package/README.md +12 -0
- package/dist/AssetBrowser.d.ts +26 -1
- package/dist/AssetBrowser.js +54 -1
- package/dist/AssetDropZone.d.ts +9 -0
- package/dist/AssetDropZone.js +65 -0
- package/dist/CatalogsPanel.d.ts +4 -2
- package/dist/CatalogsPanel.js +162 -9
- package/dist/CityPreview.d.ts +11 -0
- package/dist/CityPreview.js +45 -0
- package/dist/CollectionsPanel.js +5 -5
- package/dist/DebugDraw.d.ts +3 -1
- package/dist/DebugDraw.js +37 -19
- package/dist/EditorApp.d.ts +9 -1
- package/dist/EditorApp.js +208 -37
- package/dist/EditorChrome.d.ts +25 -6
- package/dist/EditorChrome.js +310 -118
- package/dist/InspectorPanel.d.ts +17 -7
- package/dist/InspectorPanel.js +173 -27
- package/dist/LightingPanel.d.ts +11 -0
- package/dist/LightingPanel.js +99 -0
- package/dist/MaterialsWorkspacePanel.d.ts +12 -0
- package/dist/MaterialsWorkspacePanel.js +86 -0
- package/dist/ParentPickerMenu.d.ts +13 -0
- package/dist/ParentPickerMenu.js +33 -0
- package/dist/PerfProbe.js +69 -2
- package/dist/PrefabsPanel.js +5 -5
- package/dist/RuntimePlayBridge.d.ts +5 -3
- package/dist/RuntimePlayBridge.js +6 -13
- package/dist/ScatterPreview.d.ts +3 -1
- package/dist/ScatterPreview.js +10 -7
- package/dist/SchemaInspector.js +21 -8
- package/dist/ScriptingPanel.d.ts +15 -0
- package/dist/ScriptingPanel.js +46 -0
- package/dist/SelectionGizmo.js +114 -30
- package/dist/StandaloneEditor.d.ts +16 -9
- package/dist/StandaloneEditor.js +19 -20
- package/dist/TerrainPanel.d.ts +3 -2
- package/dist/TerrainPanel.js +16 -5
- package/dist/TerrainReadout.d.ts +17 -0
- package/dist/TerrainReadout.js +163 -0
- package/dist/TerrainReadoutHud.d.ts +9 -0
- package/dist/TerrainReadoutHud.js +20 -0
- package/dist/TerrainSculpt.js +98 -59
- package/dist/agent/AgentPanel.d.ts +5 -2
- package/dist/agent/AgentPanel.js +11 -6
- package/dist/agent/toolBridge.js +5 -0
- package/dist/assetImport.d.ts +36 -0
- package/dist/assetImport.js +66 -0
- package/dist/authoredComponentMeta.d.ts +25 -0
- package/dist/authoredComponentMeta.js +65 -0
- package/dist/gizmoPivot.d.ts +4 -0
- package/dist/gizmoPivot.js +34 -0
- package/dist/handlers/catalogs.d.ts +3 -0
- package/dist/handlers/catalogs.js +137 -0
- package/dist/handlers/collections.d.ts +3 -0
- package/dist/handlers/collections.js +57 -0
- package/dist/handlers/context.d.ts +36 -0
- package/dist/handlers/context.js +1 -0
- package/dist/handlers/document.d.ts +3 -0
- package/dist/handlers/document.js +350 -0
- package/dist/handlers/grids.d.ts +3 -0
- package/dist/handlers/grids.js +142 -0
- package/dist/handlers/hierarchy.d.ts +3 -0
- package/dist/handlers/hierarchy.js +55 -0
- package/dist/handlers/index.d.ts +8 -0
- package/dist/handlers/index.js +23 -0
- package/dist/handlers/minimap.d.ts +9 -0
- package/dist/handlers/minimap.js +32 -0
- package/dist/handlers/runtime.d.ts +3 -0
- package/dist/handlers/runtime.js +191 -0
- package/dist/handlers/terrain.d.ts +3 -0
- package/dist/handlers/terrain.js +204 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/listDocumentTriggers.d.ts +42 -0
- package/dist/listDocumentTriggers.js +49 -0
- package/dist/materialAssignments.d.ts +63 -0
- package/dist/materialAssignments.js +84 -0
- package/dist/mcp/fieldSpec.d.ts +32 -0
- package/dist/mcp/fieldSpec.js +173 -0
- package/dist/mcp/rpcRequest.d.ts +8 -5
- package/dist/mcp/rpcRequest.js +72 -83
- package/dist/mcp/tools.js +104 -763
- package/dist/networkSnapshot.d.ts +82 -0
- package/dist/networkSnapshot.js +73 -0
- package/dist/parentCandidates.d.ts +12 -0
- package/dist/parentCandidates.js +25 -0
- package/dist/perfPill.d.ts +21 -0
- package/dist/perfPill.js +20 -0
- package/dist/session.d.ts +167 -5
- package/dist/session.js +36 -879
- package/dist/shell/AnimationPanel.d.ts +17 -0
- package/dist/shell/AnimationPanel.js +134 -0
- package/dist/shell/AssetThumbnail.d.ts +12 -0
- package/dist/shell/AssetThumbnail.js +23 -0
- package/dist/shell/BottomDock.d.ts +25 -0
- package/dist/shell/BottomDock.js +40 -0
- package/dist/shell/CommandPalette.d.ts +12 -0
- package/dist/shell/CommandPalette.js +56 -0
- package/dist/shell/ConsolePanel.d.ts +8 -0
- package/dist/shell/ConsolePanel.js +45 -0
- package/dist/shell/ContentBrowser.d.ts +21 -0
- package/dist/shell/ContentBrowser.js +130 -0
- package/dist/shell/HierarchyPanel.d.ts +26 -0
- package/dist/shell/HierarchyPanel.js +387 -0
- package/dist/shell/NetworkWorkspacePanel.d.ts +11 -0
- package/dist/shell/NetworkWorkspacePanel.js +49 -0
- package/dist/shell/PlayModeBar.d.ts +12 -0
- package/dist/shell/PlayModeBar.js +27 -0
- package/dist/shell/ProfilerPanel.d.ts +10 -0
- package/dist/shell/ProfilerPanel.js +41 -0
- package/dist/shell/SceneToolbar.d.ts +43 -0
- package/dist/shell/SceneToolbar.js +122 -0
- package/dist/shell/StatusBar.d.ts +18 -0
- package/dist/shell/StatusBar.js +41 -0
- package/dist/shell/TopAppBar.d.ts +33 -0
- package/dist/shell/TopAppBar.js +64 -0
- package/dist/shell/ViewportOverlays.d.ts +23 -0
- package/dist/shell/ViewportOverlays.js +136 -0
- package/dist/shell/WorkspaceRail.d.ts +20 -0
- package/dist/shell/WorkspaceRail.js +31 -0
- package/dist/shell/cameraTelemetry.d.ts +27 -0
- package/dist/shell/cameraTelemetry.js +24 -0
- package/dist/shell/commandRegistry.d.ts +58 -0
- package/dist/shell/commandRegistry.js +133 -0
- package/dist/shell/consoleSink.d.ts +11 -0
- package/dist/shell/consoleSink.js +17 -0
- package/dist/shell/consoleStore.d.ts +27 -0
- package/dist/shell/consoleStore.js +43 -0
- package/dist/shell/fields.d.ts +39 -0
- package/dist/shell/fields.js +104 -0
- package/dist/shell/formatSavedRelative.d.ts +2 -0
- package/dist/shell/formatSavedRelative.js +14 -0
- package/dist/shell/glbThumbnailCache.d.ts +45 -0
- package/dist/shell/glbThumbnailCache.js +241 -0
- package/dist/shell/hierarchyA11y.d.ts +21 -0
- package/dist/shell/hierarchyA11y.js +35 -0
- package/dist/shell/icons.d.ts +13 -0
- package/dist/shell/icons.js +85 -0
- package/dist/shell/layoutStore.d.ts +68 -0
- package/dist/shell/layoutStore.js +156 -0
- package/dist/shell/pathFlythrough.d.ts +37 -0
- package/dist/shell/pathFlythrough.js +54 -0
- package/dist/shell/perfHistory.d.ts +70 -0
- package/dist/shell/perfHistory.js +130 -0
- package/dist/shell/renameObject.d.ts +3 -0
- package/dist/shell/renameObject.js +25 -0
- package/dist/shell/theme.d.ts +36 -0
- package/dist/shell/theme.js +37 -0
- package/dist/shell/ui.d.ts +84 -0
- package/dist/shell/ui.js +90 -0
- package/dist/shell/useGlbThumbnail.d.ts +8 -0
- package/dist/shell/useGlbThumbnail.js +19 -0
- package/dist/terrainReadoutStore.d.ts +19 -0
- package/dist/terrainReadoutStore.js +36 -0
- package/dist/uiStore.d.ts +33 -0
- package/dist/uiStore.js +13 -0
- package/dist/viewportContextMenu.d.ts +4 -2
- package/dist/viewportContextMenu.js +5 -1
- package/package.json +4 -4
- package/skills/jgengine/SKILL.md +35 -804
- package/skills/jgengine/api.md +190 -79
- package/skills/jgengine/capabilities.md +112 -2
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-editor/SKILL.md +29 -362
- package/skills/jgengine-editor/api.md +519 -18
- package/skills/jgengine-editor/capabilities.md +91 -0
- package/skills/jgengine-editor/reference.md +113 -0
- package/skills/level-design/SKILL.md +54 -0
- package/skills/level-design/agents/openai.yaml +4 -0
- package/skills/level-design/references/application-playbook.md +192 -0
- package/skills/level-design/references/field-guide.md +337 -0
- package/skills/level-design/references/live-editor-loop.md +179 -0
- package/dist/OutlinerPanel.d.ts +0 -14
- package/dist/OutlinerPanel.js +0 -84
- package/skills/jgengine/reference-cartridge.md +0 -72
- package/skills/jgengine/reference-orphans.md +0 -9
- 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.
|
|
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.
|
|
35
|
-
"@jgengine/react": "^0.
|
|
36
|
-
"@jgengine/shell": "^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",
|