@forgeax/interface 0.7.0 → 0.8.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.
@@ -1,9 +1,9 @@
1
1
  // packages/interface/src/core/extensions/builtin-menus.ts
2
2
  //
3
- // Declares the built-in top-menu-bar items via `menu-registry.registerMenuItem`.
3
+ // Declares built-in top-menu-bar items through the current App Host's menus.
4
4
  // One extension declaratively populates BRAND / FILE / EDIT / WINDOW / BUILD /
5
5
  // SELECT / HELP so the web renderer (T6/T7) and the Tauri native bridge (T5)
6
- // share the exact same SSOT (menu-registry) same UI, one place to edit.
6
+ // share the same host-owned registry and resolve labels from the current locale.
7
7
  //
8
8
  // An item WITHOUT a `commandId` is intentionally disabled — it renders as a
9
9
  // greyed-out placeholder for a capability we haven't wired yet (the registry
@@ -54,9 +54,8 @@ export const builtinMenusExtension = {
54
54
  setup({ host }) {
55
55
  const cleanups = [];
56
56
  // Every item to register — sorted by menu / group / order so the shape
57
- // reads top-to-bottom the way it renders. The registrar itself re-sorts
58
- // by group-first-seen then `order`, so declaration order below is
59
- // documentation only (except for stable in-group tie-breaks).
57
+ // reads top-to-bottom the way it renders. The host sorts by explicit
58
+ // groupOrder then order, independent of extension activation order.
60
59
  const items = [
61
60
  // ─── BRAND ────────────────────────────────────────────────────────────
62
61
  { id: 'brand.settings', menu: 'brand', group: 'app', order: 10,
@@ -95,9 +94,6 @@ export const builtinMenusExtension = {
95
94
  })) },
96
95
  { id: 'file.closeGame', menu: 'file', group: 'game', order: 40,
97
96
  labelKey: 'menu.file.closeGame', icon: 'x' },
98
- { id: 'file.save', menu: 'file', group: 'file', order: 10,
99
- labelKey: 'menu.file.save', icon: 'save',
100
- commandId: 'editor.save', keybinding: 'Ctrl+S' },
101
97
  { id: 'file.saveAll', menu: 'file', group: 'file', order: 20,
102
98
  labelKey: 'menu.file.saveAll', icon: 'save-all', keybinding: 'Ctrl+Shift+S' },
103
99
  // reveal + import: capabilities not confirmed wired yet — leave DISABLED
@@ -111,12 +107,6 @@ export const builtinMenusExtension = {
111
107
  { id: 'file.package', menu: 'file', group: 'io', order: 30,
112
108
  labelKey: 'menu.file.package', icon: 'globe' },
113
109
  // ─── EDIT ─────────────────────────────────────────────────────────────
114
- { id: 'edit.undo', menu: 'edit', group: 'history', order: 10,
115
- labelKey: 'menu.edit.undo', icon: 'undo-2',
116
- commandId: 'editor.undo', keybinding: 'Ctrl+Z' },
117
- { id: 'edit.redo', menu: 'edit', group: 'history', order: 20,
118
- labelKey: 'menu.edit.redo', icon: 'redo-2',
119
- commandId: 'editor.redo', keybinding: 'Ctrl+Shift+Z' },
120
110
  { id: 'edit.cut', menu: 'edit', group: 'clipboard', order: 10,
121
111
  labelKey: 'menu.edit.cut', icon: 'scissors',
122
112
  commandId: 'text.cut', keybinding: 'Ctrl+X' },
@@ -126,9 +116,6 @@ export const builtinMenusExtension = {
126
116
  { id: 'edit.paste', menu: 'edit', group: 'clipboard', order: 30,
127
117
  labelKey: 'menu.edit.paste', icon: 'clipboard',
128
118
  commandId: 'text.paste', keybinding: 'Ctrl+V' },
129
- { id: 'edit.delete', menu: 'edit', group: 'clipboard', order: 40,
130
- labelKey: 'menu.edit.delete', icon: 'trash-2', danger: true,
131
- commandId: 'editor.delete' },
132
119
  { id: 'edit.copyPath', menu: 'edit', group: 'clipboard', order: 50,
133
120
  labelKey: 'menu.edit.copyPath', icon: 'copy' },
134
121
  { id: 'edit.copyGuid', menu: 'edit', group: 'clipboard', order: 60,
@@ -138,22 +125,8 @@ export const builtinMenusExtension = {
138
125
  { id: 'edit.rollback', menu: 'edit', group: 'version', order: 10,
139
126
  labelKey: 'menu.edit.rollback', icon: 'rotate-ccw' },
140
127
  // ─── WINDOW ───────────────────────────────────────────────────────────
141
- // Runtime dock ids: editor sub-panels live under `ep:*` (see panelRegistry
142
- // `buildEditorPanelComponents`), so the toggle args + `checked()` mirror
143
- // those exact ids. `viewport` is an interface-owned core panel with a bare
144
- // id. `chat` uses a dedicated store toggle instead of dock-visibility.
145
- { id: 'window.outline', menu: 'window', group: 'panels', order: 10,
146
- labelKey: 'menu.window.outline',
147
- commandId: 'app.panel.toggle', args: { id: 'ep:hierarchy' },
148
- checked: isVisible('ep:hierarchy') },
149
- { id: 'window.inspector', menu: 'window', group: 'panels', order: 20,
150
- labelKey: 'menu.window.inspector',
151
- commandId: 'app.panel.toggle', args: { id: 'ep:inspector' },
152
- checked: isVisible('ep:inspector') },
153
- { id: 'window.files', menu: 'window', group: 'panels', order: 30,
154
- labelKey: 'menu.window.files',
155
- commandId: 'app.panel.toggle', args: { id: 'ep:assets' },
156
- checked: isVisible('ep:assets') },
128
+ // Editor contributes its own sub-panel rows. The product viewport uses
129
+ // a bare dock id; Chat uses a dedicated store toggle instead of dock visibility.
157
130
  { id: 'window.timeline', menu: 'window', group: 'panels', order: 40,
158
131
  labelKey: 'menu.window.timeline' },
159
132
  { id: 'window.runtime', menu: 'window', group: 'panels', order: 50,
@@ -173,15 +146,6 @@ export const builtinMenusExtension = {
173
146
  labelKey: 'menu.window.fullscreen', icon: 'maximize',
174
147
  commandId: 'app.set_fullscreen', args: { value: true } },
175
148
  // ─── BUILD ────────────────────────────────────────────────────────────
176
- { id: 'build.play', menu: 'build', group: 'run', order: 10,
177
- labelKey: 'menu.build.play', icon: 'play',
178
- commandId: 'editor.play' },
179
- { id: 'build.stop', menu: 'build', group: 'run', order: 20,
180
- labelKey: 'menu.build.stop', icon: 'square',
181
- commandId: 'editor.stop' },
182
- { id: 'build.editScene', menu: 'build', group: 'run', order: 30,
183
- labelKey: 'menu.build.editScene', icon: 'pencil',
184
- commandId: 'editor.toggleDisplay' },
185
149
  // reload: `editor.reloadPreview` currently only emits `preview:reload` on
186
150
  // the bus with no consumer wired — clicking would silently no-op (a
187
151
  // mock-success path, forbidden by the no-silent-fallback rule). Leave the
@@ -193,12 +157,6 @@ export const builtinMenusExtension = {
193
157
  { id: 'build.settings', menu: 'build', group: 'export', order: 20,
194
158
  labelKey: 'menu.build.settings', icon: 'settings' },
195
159
  // ─── SELECT ───────────────────────────────────────────────────────────
196
- { id: 'select.all', menu: 'select', group: 'basic', order: 10,
197
- labelKey: 'menu.select.all', icon: 'box-select',
198
- commandId: 'editor.selectAll', keybinding: 'Ctrl+A' },
199
- { id: 'select.none', menu: 'select', group: 'basic', order: 20,
200
- labelKey: 'menu.select.none', icon: 'square-dashed',
201
- commandId: 'editor.deselect' },
202
160
  { id: 'select.invert', menu: 'select', group: 'basic', order: 30,
203
161
  labelKey: 'menu.select.invert', icon: 'flip-horizontal-2' },
204
162
  { id: 'select.byType', menu: 'select', group: 'byCond', order: 10,
@@ -215,9 +173,6 @@ export const builtinMenusExtension = {
215
173
  ] },
216
174
  { id: 'select.marquee', menu: 'select', group: 'byCond', order: 20,
217
175
  labelKey: 'menu.select.marquee', icon: 'scan' },
218
- { id: 'select.frame', menu: 'select', group: 'view', order: 10,
219
- labelKey: 'menu.select.frame', icon: 'focus',
220
- commandId: 'editor.frameSelected' },
221
176
  // ─── HELP ─────────────────────────────────────────────────────────────
222
177
  { id: 'help.docs', menu: 'help', group: 'docs', order: 10,
223
178
  labelKey: 'menu.help.docs', icon: 'book-open',
@@ -1,9 +1,9 @@
1
1
  // packages/interface/src/core/extensions/builtin-menus.ts
2
2
  //
3
- // Declares the built-in top-menu-bar items via `menu-registry.registerMenuItem`.
3
+ // Declares built-in top-menu-bar items through the current App Host's menus.
4
4
  // One extension declaratively populates BRAND / FILE / EDIT / WINDOW / BUILD /
5
5
  // SELECT / HELP so the web renderer (T6/T7) and the Tauri native bridge (T5)
6
- // share the exact same SSOT (menu-registry) same UI, one place to edit.
6
+ // share the same host-owned registry and resolve labels from the current locale.
7
7
  //
8
8
  // An item WITHOUT a `commandId` is intentionally disabled — it renders as a
9
9
  // greyed-out placeholder for a capability we haven't wired yet (the registry
@@ -54,9 +54,8 @@ export const builtinMenusExtension = {
54
54
  setup({ host }) {
55
55
  const cleanups = [];
56
56
  // Every item to register — sorted by menu / group / order so the shape
57
- // reads top-to-bottom the way it renders. The registrar itself re-sorts
58
- // by group-first-seen then `order`, so declaration order below is
59
- // documentation only (except for stable in-group tie-breaks).
57
+ // reads top-to-bottom the way it renders. The host sorts by explicit
58
+ // groupOrder then order, independent of extension activation order.
60
59
  const items = [
61
60
  // ─── BRAND ────────────────────────────────────────────────────────────
62
61
  { id: 'brand.settings', menu: 'brand', group: 'app', order: 10,
@@ -95,9 +94,6 @@ export const builtinMenusExtension = {
95
94
  })) },
96
95
  { id: 'file.closeGame', menu: 'file', group: 'game', order: 40,
97
96
  labelKey: 'menu.file.closeGame', icon: 'x' },
98
- { id: 'file.save', menu: 'file', group: 'file', order: 10,
99
- labelKey: 'menu.file.save', icon: 'save',
100
- commandId: 'editor.save', keybinding: 'Ctrl+S' },
101
97
  { id: 'file.saveAll', menu: 'file', group: 'file', order: 20,
102
98
  labelKey: 'menu.file.saveAll', icon: 'save-all', keybinding: 'Ctrl+Shift+S' },
103
99
  // reveal + import: capabilities not confirmed wired yet — leave DISABLED
@@ -111,12 +107,6 @@ export const builtinMenusExtension = {
111
107
  { id: 'file.package', menu: 'file', group: 'io', order: 30,
112
108
  labelKey: 'menu.file.package', icon: 'globe' },
113
109
  // ─── EDIT ─────────────────────────────────────────────────────────────
114
- { id: 'edit.undo', menu: 'edit', group: 'history', order: 10,
115
- labelKey: 'menu.edit.undo', icon: 'undo-2',
116
- commandId: 'editor.undo', keybinding: 'Ctrl+Z' },
117
- { id: 'edit.redo', menu: 'edit', group: 'history', order: 20,
118
- labelKey: 'menu.edit.redo', icon: 'redo-2',
119
- commandId: 'editor.redo', keybinding: 'Ctrl+Shift+Z' },
120
110
  { id: 'edit.cut', menu: 'edit', group: 'clipboard', order: 10,
121
111
  labelKey: 'menu.edit.cut', icon: 'scissors',
122
112
  commandId: 'text.cut', keybinding: 'Ctrl+X' },
@@ -126,9 +116,6 @@ export const builtinMenusExtension = {
126
116
  { id: 'edit.paste', menu: 'edit', group: 'clipboard', order: 30,
127
117
  labelKey: 'menu.edit.paste', icon: 'clipboard',
128
118
  commandId: 'text.paste', keybinding: 'Ctrl+V' },
129
- { id: 'edit.delete', menu: 'edit', group: 'clipboard', order: 40,
130
- labelKey: 'menu.edit.delete', icon: 'trash-2', danger: true,
131
- commandId: 'editor.delete' },
132
119
  { id: 'edit.copyPath', menu: 'edit', group: 'clipboard', order: 50,
133
120
  labelKey: 'menu.edit.copyPath', icon: 'copy' },
134
121
  { id: 'edit.copyGuid', menu: 'edit', group: 'clipboard', order: 60,
@@ -138,22 +125,8 @@ export const builtinMenusExtension = {
138
125
  { id: 'edit.rollback', menu: 'edit', group: 'version', order: 10,
139
126
  labelKey: 'menu.edit.rollback', icon: 'rotate-ccw' },
140
127
  // ─── WINDOW ───────────────────────────────────────────────────────────
141
- // Runtime dock ids: editor sub-panels live under `ep:*` (see panelRegistry
142
- // `buildEditorPanelComponents`), so the toggle args + `checked()` mirror
143
- // those exact ids. `viewport` is an interface-owned core panel with a bare
144
- // id. `chat` uses a dedicated store toggle instead of dock-visibility.
145
- { id: 'window.outline', menu: 'window', group: 'panels', order: 10,
146
- labelKey: 'menu.window.outline',
147
- commandId: 'app.panel.toggle', args: { id: 'ep:hierarchy' },
148
- checked: isVisible('ep:hierarchy') },
149
- { id: 'window.inspector', menu: 'window', group: 'panels', order: 20,
150
- labelKey: 'menu.window.inspector',
151
- commandId: 'app.panel.toggle', args: { id: 'ep:inspector' },
152
- checked: isVisible('ep:inspector') },
153
- { id: 'window.files', menu: 'window', group: 'panels', order: 30,
154
- labelKey: 'menu.window.files',
155
- commandId: 'app.panel.toggle', args: { id: 'ep:assets' },
156
- checked: isVisible('ep:assets') },
128
+ // Editor contributes its own sub-panel rows. The product viewport uses
129
+ // a bare dock id; Chat uses a dedicated store toggle instead of dock visibility.
157
130
  { id: 'window.timeline', menu: 'window', group: 'panels', order: 40,
158
131
  labelKey: 'menu.window.timeline' },
159
132
  { id: 'window.runtime', menu: 'window', group: 'panels', order: 50,
@@ -173,15 +146,6 @@ export const builtinMenusExtension = {
173
146
  labelKey: 'menu.window.fullscreen', icon: 'maximize',
174
147
  commandId: 'app.set_fullscreen', args: { value: true } },
175
148
  // ─── BUILD ────────────────────────────────────────────────────────────
176
- { id: 'build.play', menu: 'build', group: 'run', order: 10,
177
- labelKey: 'menu.build.play', icon: 'play',
178
- commandId: 'editor.play' },
179
- { id: 'build.stop', menu: 'build', group: 'run', order: 20,
180
- labelKey: 'menu.build.stop', icon: 'square',
181
- commandId: 'editor.stop' },
182
- { id: 'build.editScene', menu: 'build', group: 'run', order: 30,
183
- labelKey: 'menu.build.editScene', icon: 'pencil',
184
- commandId: 'editor.toggleDisplay' },
185
149
  // reload: `editor.reloadPreview` currently only emits `preview:reload` on
186
150
  // the bus with no consumer wired — clicking would silently no-op (a
187
151
  // mock-success path, forbidden by the no-silent-fallback rule). Leave the
@@ -193,12 +157,6 @@ export const builtinMenusExtension = {
193
157
  { id: 'build.settings', menu: 'build', group: 'export', order: 20,
194
158
  labelKey: 'menu.build.settings', icon: 'settings' },
195
159
  // ─── SELECT ───────────────────────────────────────────────────────────
196
- { id: 'select.all', menu: 'select', group: 'basic', order: 10,
197
- labelKey: 'menu.select.all', icon: 'box-select',
198
- commandId: 'editor.selectAll', keybinding: 'Ctrl+A' },
199
- { id: 'select.none', menu: 'select', group: 'basic', order: 20,
200
- labelKey: 'menu.select.none', icon: 'square-dashed',
201
- commandId: 'editor.deselect' },
202
160
  { id: 'select.invert', menu: 'select', group: 'basic', order: 30,
203
161
  labelKey: 'menu.select.invert', icon: 'flip-horizontal-2' },
204
162
  { id: 'select.byType', menu: 'select', group: 'byCond', order: 10,
@@ -215,9 +173,6 @@ export const builtinMenusExtension = {
215
173
  ] },
216
174
  { id: 'select.marquee', menu: 'select', group: 'byCond', order: 20,
217
175
  labelKey: 'menu.select.marquee', icon: 'scan' },
218
- { id: 'select.frame', menu: 'select', group: 'view', order: 10,
219
- labelKey: 'menu.select.frame', icon: 'focus',
220
- commandId: 'editor.frameSelected' },
221
176
  // ─── HELP ─────────────────────────────────────────────────────────────
222
177
  { id: 'help.docs', menu: 'help', group: 'docs', order: 10,
223
178
  labelKey: 'menu.help.docs', icon: 'book-open',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/interface",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "ForgeaX product interface shell and application composition boundary.",
6
6
  "license": "Apache-2.0",