@dfosco/storyboard-core 4.2.0-beta.2 → 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 +1 -1
- package/src/mountStoryboardCore.js +10 -3
package/package.json
CHANGED
|
@@ -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
|
|
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 {
|
|
172
|
-
|
|
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
|
}
|