@dfosco/storyboard-core 4.2.0-beta.3 → 4.2.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard-core",
3
- "version": "4.2.0-beta.3",
3
+ "version": "4.2.0-beta.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -165,11 +165,18 @@ export async function mountStoryboardCore(config = {}, options = {}) {
165
165
 
166
166
  // Load and merge command palette config.
167
167
  // Core defaults come from commandpalette.config.json (bundled).
168
- // Client can provide overrides via config.commandPalette (legacy) or a commandpalette.config.json at repo root.
168
+ // Client can provide overrides via config.commandPalette.
169
+ // Sections are merged by `id` — client sections override matching defaults,
170
+ // default sections not in the client config are preserved (e.g. create-widget).
169
171
  const defaultCmdPaletteConfig = (await import('../commandpalette.config.json')).default
170
172
  if (config.commandPalette) {
171
- const { deepMerge: deepMergeCp } = await import('./loader.js')
172
- initCommandPaletteConfig(deepMergeCp(defaultCmdPaletteConfig, config.commandPalette))
173
+ const merged = { ...defaultCmdPaletteConfig, ...config.commandPalette }
174
+ if (config.commandPalette.sections && defaultCmdPaletteConfig.sections) {
175
+ const clientIds = new Set(config.commandPalette.sections.map(s => s.id))
176
+ const preserved = defaultCmdPaletteConfig.sections.filter(s => !clientIds.has(s.id))
177
+ merged.sections = [...config.commandPalette.sections, ...preserved]
178
+ }
179
+ initCommandPaletteConfig(merged)
173
180
  } else {
174
181
  initCommandPaletteConfig({ ...defaultCmdPaletteConfig })
175
182
  }