@rrstudioapps/ngx-command-palette 0.0.0-stage → 0.1.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rrstudioapps-ngx-command-palette.mjs","names":[],"sources":["../../../projects/ngx-command-palette/src/lib/config.ts","../../../projects/ngx-command-palette/src/lib/fuzzy.ts","../../../projects/ngx-command-palette/src/lib/recent-store.ts","../../../projects/ngx-command-palette/src/lib/command-palette.service.ts","../../../projects/ngx-command-palette/src/lib/list-navigation.ts","../../../projects/ngx-command-palette/src/lib/shortcut.ts","../../../projects/ngx-command-palette/src/lib/templates.directive.ts","../../../projects/ngx-command-palette/src/lib/command-palette.component.ts","../../../projects/ngx-command-palette/src/lib/command-palette.component.html"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\n\nexport type CommandPaletteTheme = 'light' | 'dark' | 'auto';\n\n/** Texts of the palette, for translations. */\nexport interface CommandPaletteLabels {\n readonly placeholder: string;\n readonly dialog: string;\n readonly listbox: string;\n readonly empty: string;\n readonly loading: string;\n readonly recent: string;\n readonly defaultGroup: string;\n /** Screen reader announcement, `{count}` is replaced by the number of results. */\n readonly results: string;\n readonly closeHint: string;\n}\n\nexport interface CommandPaletteRecentOptions {\n /** Max number of recents shown. Default: 5. */\n readonly max?: number;\n /** localStorage key. Default: `rr-cp:recent`. */\n readonly storageKey?: string;\n}\n\nexport interface CommandPaletteConfig {\n /** Shortcut(s) that toggle the palette. Default: `mod+k` (⌘K on macOS, Ctrl+K elsewhere). */\n readonly shortcut: string | readonly string[];\n /** `auto` follows `prefers-color-scheme`. Default: `auto`. */\n readonly theme: CommandPaletteTheme;\n /** \"Recent\" section shown with an empty query; `false` disables it. */\n readonly recent: CommandPaletteRecentOptions | false;\n /** Debounce for async providers, in ms. Default: 200. */\n readonly debounceMs: number;\n /** Max results of local commands for a non-empty query. Default: 50. */\n readonly maxResults: number;\n readonly labels: CommandPaletteLabels;\n}\n\nexport type CommandPaletteOptions = Partial<Omit<CommandPaletteConfig, 'labels'>> & {\n readonly labels?: Partial<CommandPaletteLabels>;\n};\n\nexport const DEFAULT_COMMAND_PALETTE_LABELS: CommandPaletteLabels = {\n placeholder: 'Type a command or search…',\n dialog: 'Command palette',\n listbox: 'Commands',\n empty: 'No results found.',\n loading: 'Loading…',\n recent: 'Recent',\n defaultGroup: 'Commands',\n results: '{count} results',\n closeHint: 'Esc',\n};\n\nexport const DEFAULT_COMMAND_PALETTE_CONFIG: CommandPaletteConfig = {\n shortcut: 'mod+k',\n theme: 'auto',\n recent: { max: 5, storageKey: 'rr-cp:recent' },\n debounceMs: 200,\n maxResults: 50,\n labels: DEFAULT_COMMAND_PALETTE_LABELS,\n};\n\nexport const COMMAND_PALETTE_CONFIG = new InjectionToken<CommandPaletteConfig>(\n 'COMMAND_PALETTE_CONFIG',\n {\n providedIn: 'root',\n factory: () => DEFAULT_COMMAND_PALETTE_CONFIG,\n },\n);\n\n/** Merges options with the defaults. */\nexport function resolveConfig(options: CommandPaletteOptions = {}): CommandPaletteConfig {\n return {\n ...DEFAULT_COMMAND_PALETTE_CONFIG,\n ...options,\n recent:\n options.recent === false\n ? false\n : {\n ...(DEFAULT_COMMAND_PALETTE_CONFIG.recent as CommandPaletteRecentOptions),\n ...options.recent,\n },\n labels: { ...DEFAULT_COMMAND_PALETTE_LABELS, ...options.labels },\n };\n}\n\n/** Configures the command palette. Optional: without it the defaults are used. */\nexport function provideCommandPalette(options: CommandPaletteOptions = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: COMMAND_PALETTE_CONFIG, useValue: resolveConfig(options) },\n ]);\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport type { Command, HighlightSegment } from './command.model';\n\nexport interface FuzzyMatch {\n /** Higher is better. Only meaningful to compare matches of the same query. */\n readonly score: number;\n /** Indices of `text` matched by the query, ascending. */\n readonly indices: readonly number[];\n}\n\n// Scoring weights: consecutive letters and word starts are worth more, gaps cost.\nconst SCORE_CHAR = 1;\nconst BONUS_CONSECUTIVE = 5;\nconst BONUS_WORD_START = 8;\nconst BONUS_STRING_START = 4;\nconst PENALTY_GAP = 1;\nconst PENALTY_LEADING = 0.2;\nconst SEPARATORS = new Set([' ', '-', '_', '.', '/', ':', '(', '[', ',']);\n\n/** Lowercase and without accents, one character in → one character out (keeps indices aligned). */\nfunction fold(char: string): string {\n const base = char.normalize('NFD').replace(/\\p{M}/gu, '');\n return (base[0] ?? char).toLowerCase();\n}\n\nfunction isWordStart(text: string, i: number): boolean {\n if (i === 0) return true;\n const prev = text[i - 1];\n if (SEPARATORS.has(prev)) return true;\n // camelCase: lowercase followed by uppercase\n const cur = text[i];\n return prev === prev.toLowerCase() && cur !== cur.toLowerCase() && cur === cur.toUpperCase();\n}\n\n/**\n * Fuzzy subsequence match: every character of `query` (spaces ignored) must appear in\n * `text` in order. Returns the best scoring alignment or `null`. Case and accent insensitive.\n */\nexport function fuzzyMatch(query: string, text: string): FuzzyMatch | null {\n const q = query.replace(/\\s+/g, '').split('').map(fold);\n if (q.length === 0) return { score: 0, indices: [] };\n // Work on UTF-16 units so indices stay those of `text`.\n const t: string[] = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of -- for-of iterates code points and would shift the indices\n for (let i = 0; i < text.length; i++) t.push(fold(text[i]));\n const m = q.length;\n const n = t.length;\n if (m > n) return null;\n\n const NEG = -Infinity;\n // M[i][j]: best score with q[i] matched to t[j]\n // D[i][j]: best score with q[0..i] matched within t[0..j] (minus a penalty for characters skipped after)\n const M: Float64Array[] = [];\n const D: Float64Array[] = [];\n const bonus = new Float64Array(n);\n for (let j = 0; j < n; j++) {\n bonus[j] =\n SCORE_CHAR +\n (isWordStart(text, j) ? BONUS_WORD_START : 0) +\n (j === 0 ? BONUS_STRING_START : 0);\n }\n\n // For the traceback: where each M comes from (consecutive or jump) and which k gives each D\n const consec: Uint8Array[] = [];\n const Dk: Int32Array[] = [];\n for (let i = 0; i < m; i++) {\n const Mi = new Float64Array(n).fill(NEG);\n const Di = new Float64Array(n).fill(NEG);\n const Ci = new Uint8Array(n);\n const Ki = new Int32Array(n).fill(-1);\n for (let j = i; j < n; j++) {\n if (t[j] === q[i]) {\n if (i === 0) {\n Mi[j] = bonus[j] - PENALTY_LEADING * j;\n } else if (j > 0) {\n const consecutive = M[i - 1][j - 1] + BONUS_CONSECUTIVE;\n const jump = D[i - 1][j - 1];\n if (consecutive >= jump && consecutive > NEG) {\n Mi[j] = consecutive + bonus[j];\n Ci[j] = 1;\n } else if (jump > NEG) {\n Mi[j] = jump + bonus[j];\n }\n }\n }\n const carried = j > 0 ? Di[j - 1] - PENALTY_GAP : NEG;\n if (Mi[j] > NEG && Mi[j] >= carried) {\n Di[j] = Mi[j];\n Ki[j] = j;\n } else if (j > 0) {\n Di[j] = carried;\n Ki[j] = Ki[j - 1];\n }\n }\n M.push(Mi);\n D.push(Di);\n consec.push(Ci);\n Dk.push(Ki);\n }\n\n // End of the alignment: the best M on the last row\n let end = -1;\n let best = NEG;\n for (let j = m - 1; j < n; j++) {\n if (M[m - 1][j] > best) {\n best = M[m - 1][j];\n end = j;\n }\n }\n if (end < 0) return null;\n\n // Rebuild the indices backwards\n const indices = new Array<number>(m);\n let j = end;\n for (let i = m - 1; i >= 0; i--) {\n indices[i] = j;\n if (i === 0) break;\n j = consec[i][j] ? j - 1 : Dk[i - 1][j - 1];\n }\n\n // Small bonus for short strings: with equal matches the text closest to the query wins\n const score = best - (n - m) * 0.01;\n return { score, indices };\n}\n\n/** Splits `text` into matched / unmatched segments for highlighting. */\nexport function highlightSegments(text: string, indices: readonly number[]): HighlightSegment[] {\n if (indices.length === 0) return text ? [{ text, match: false }] : [];\n const set = new Set(indices);\n const out: HighlightSegment[] = [];\n let buf = '';\n let bufMatch = set.has(0);\n for (let i = 0; i < text.length; i++) {\n const match = set.has(i);\n if (match !== bufMatch && buf) {\n out.push({ text: buf, match: bufMatch });\n buf = '';\n }\n bufMatch = match;\n buf += text[i];\n }\n if (buf) out.push({ text: buf, match: bufMatch });\n return out;\n}\n\n// Field weights: label first, then keywords, then description.\nconst WEIGHT_KEYWORD = 0.8;\nconst WEIGHT_DESCRIPTION = 0.5;\n/**\n * Minimum quality (average points per character) for keywords and description: long texts\n * contain almost any scattered letter sequence, so there we require word starts or close letters.\n */\nconst MIN_SECONDARY_QUALITY = 4;\n\nfunction strongEnough(match: FuzzyMatch | null, query: string): match is FuzzyMatch {\n const length = query.replace(/\\s+/g, '').length;\n return !!match && length > 0 && match.score / length >= MIN_SECONDARY_QUALITY;\n}\n\n/**\n * Matches a command against the query using label, keywords and description.\n * `indices` refer to the label (empty when only keywords/description matched).\n */\nexport function matchCommand(query: string, command: Command): FuzzyMatch | null {\n const label = fuzzyMatch(query, command.label);\n let best: FuzzyMatch | null = label;\n for (const keyword of command.keywords ?? []) {\n const m = fuzzyMatch(query, keyword);\n if (strongEnough(m, query) && (!best || m.score * WEIGHT_KEYWORD > best.score)) {\n best = { score: m.score * WEIGHT_KEYWORD, indices: label?.indices ?? [] };\n }\n }\n if (command.description) {\n const m = fuzzyMatch(query, command.description);\n if (strongEnough(m, query) && (!best || m.score * WEIGHT_DESCRIPTION > best.score)) {\n best = { score: m.score * WEIGHT_DESCRIPTION, indices: label?.indices ?? [] };\n }\n }\n return best;\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport type { Command } from './command.model';\n\n/** What is saved for a recent command: only serializable fields, never functions. */\nexport interface RecentEntry {\n readonly id: string;\n readonly label: string;\n readonly group?: string;\n readonly description?: string;\n readonly route?: string | readonly unknown[];\n}\n\n/**\n * Recent commands in `localStorage` (most recent first). Every access is guarded:\n * private windows, SSR or blocked storage just mean \"no recents\".\n */\nexport class RecentStore {\n constructor(\n private readonly storageKey: string,\n private readonly max: number,\n private readonly storage: Pick<\n Storage,\n 'getItem' | 'setItem' | 'removeItem'\n > | null = defaultStorage(),\n ) {}\n\n load(): RecentEntry[] {\n if (!this.storage || this.max <= 0) return [];\n try {\n const raw = this.storage.getItem(this.storageKey);\n if (!raw) return [];\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) return [];\n return parsed.filter(isEntry).slice(0, this.max);\n } catch {\n return [];\n }\n }\n\n /** Moves `command` to the top and returns the new list. */\n add(command: Command, current: readonly RecentEntry[] = this.load()): RecentEntry[] {\n if (this.max <= 0) return [];\n const entry: RecentEntry = {\n id: command.id,\n label: command.label,\n ...(command.group ? { group: command.group } : {}),\n ...(command.description ? { description: command.description } : {}),\n ...(command.route !== undefined && isSerializable(command.route)\n ? { route: command.route }\n : {}),\n };\n const next = [entry, ...current.filter((e) => e.id !== command.id)].slice(0, this.max);\n this.save(next);\n return next;\n }\n\n clear(): void {\n try {\n this.storage?.removeItem(this.storageKey);\n } catch {\n /* storage not available */\n }\n }\n\n private save(entries: readonly RecentEntry[]): void {\n try {\n this.storage?.setItem(this.storageKey, JSON.stringify(entries));\n } catch {\n /* quota exceeded or storage blocked: recents stay in memory only */\n }\n }\n}\n\nfunction defaultStorage(): Storage | null {\n try {\n return typeof localStorage === 'undefined' ? null : localStorage;\n } catch {\n return null;\n }\n}\n\nfunction isEntry(value: unknown): value is RecentEntry {\n if (!value || typeof value !== 'object') return false;\n const v = value as Record<string, unknown>;\n return typeof v['id'] === 'string' && typeof v['label'] === 'string';\n}\n\nfunction isSerializable(route: unknown): boolean {\n try {\n JSON.stringify(route);\n return typeof route === 'string' || Array.isArray(route);\n } catch {\n return false;\n }\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport {\n DestroyRef,\n DOCUMENT,\n Injectable,\n Signal,\n assertInInjectionContext,\n computed,\n inject,\n isSignal,\n signal,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport type {\n Command,\n CommandProvider,\n CommandResult,\n CommandSection,\n CommandSubscribable,\n} from './command.model';\nimport { COMMAND_PALETTE_CONFIG, type CommandPaletteRecentOptions } from './config';\nimport { fuzzyMatch, highlightSegments, matchCommand } from './fuzzy';\nimport { RecentStore, type RecentEntry } from './recent-store';\n\ninterface Registration {\n readonly source: () => readonly Command[];\n}\n\ninterface ProviderState {\n readonly items: readonly Command[];\n readonly loading: boolean;\n readonly error?: unknown;\n}\n\n/** In-flight provider request: debounce timer, abort controller and subscription. */\ninterface PendingRequest {\n timer?: ReturnType<typeof setTimeout>;\n controller?: AbortController;\n subscription?: { unsubscribe(): void };\n}\n\nexport const RECENT_SECTION_ID = 'recent';\n\n/**\n * State of the command palette. Register commands from any component: they are removed\n * automatically when that component is destroyed.\n */\n@Injectable({ providedIn: 'root' })\nexport class CommandPaletteService {\n private readonly config = inject(COMMAND_PALETTE_CONFIG);\n private readonly router = inject(Router, { optional: true });\n private readonly document = inject(DOCUMENT);\n\n private readonly recentStore = this.config.recent\n ? new RecentStore(\n (this.config.recent as CommandPaletteRecentOptions).storageKey ?? 'rr-cp:recent',\n (this.config.recent as CommandPaletteRecentOptions).max ?? 5,\n )\n : null;\n\n private readonly _isOpen = signal(false);\n private readonly _query = signal('');\n private readonly registrations = signal<readonly Registration[]>([]);\n private readonly providers = signal<readonly CommandProvider[]>([]);\n private readonly providerState = signal<ReadonlyMap<string, ProviderState>>(new Map());\n private readonly recents = signal<readonly RecentEntry[]>(this.recentStore?.load() ?? []);\n private readonly pending = new Map<string, PendingRequest>();\n private returnFocus: HTMLElement | null = null;\n\n /** Whether the palette is open. */\n readonly isOpen = this._isOpen.asReadonly();\n /** Current search text. */\n readonly query = this._query.asReadonly();\n\n /** All registered (synchronous) commands. When two share an id, the last registered wins. */\n readonly commands: Signal<readonly Command[]> = computed(() => {\n const byId = new Map<string, Command>();\n for (const registration of this.registrations()) {\n for (const command of registration.source()) {\n byId.delete(command.id);\n byId.set(command.id, command);\n }\n }\n return [...byId.values()];\n });\n\n /** True while at least one async provider is waiting for results. */\n readonly loading = computed(() => [...this.providerState().values()].some((s) => s.loading));\n\n /** Sections shown in the list, already filtered and sorted. */\n readonly sections: Signal<readonly CommandSection[]> = computed(() =>\n this.buildSections(this._query().trim()),\n );\n\n /** Opens the palette, optionally with an initial query. */\n open(query = ''): void {\n if (!this._isOpen()) {\n const active = this.document.activeElement;\n // No instanceof HTMLElement: the class does not exist during SSR\n this.returnFocus =\n active &&\n active !== this.document.body &&\n typeof (active as HTMLElement).focus === 'function'\n ? (active as HTMLElement)\n : null;\n }\n this._isOpen.set(true);\n this.setQuery(query);\n }\n\n /** Closes the palette, cancels pending searches and restores the focus. */\n close(): void {\n if (!this._isOpen()) return;\n this._isOpen.set(false);\n this.cancelAll();\n this._query.set('');\n this.providerState.set(new Map());\n const target = this.returnFocus;\n this.returnFocus = null;\n if (target?.isConnected) target.focus({ preventScroll: true });\n }\n\n toggle(): void {\n if (this._isOpen()) this.close();\n else this.open();\n }\n\n /** Updates the search text and schedules the async providers. */\n setQuery(query: string): void {\n this._query.set(query);\n if (this._isOpen()) this.scheduleProviders();\n }\n\n /**\n * Registers commands (an array or a signal of arrays). Called in an injection context\n * (constructor, field initializer) they are removed when that context is destroyed.\n * Returns a function that removes them earlier.\n */\n register(\n commands: readonly Command[] | Signal<readonly Command[]>,\n destroyRef?: DestroyRef,\n ): () => void {\n const registration: Registration = { source: isSignal(commands) ? commands : () => commands };\n this.registrations.update((list) => [...list, registration]);\n const remove = () =>\n this.registrations.update((list) => list.filter((r) => r !== registration));\n return this.bindToDestroy(remove, destroyRef);\n }\n\n /** Registers an async provider. Same lifetime rules as {@link register}. */\n registerProvider(provider: CommandProvider, destroyRef?: DestroyRef): () => void {\n this.providers.update((list) => [...list.filter((p) => p.id !== provider.id), provider]);\n if (this._isOpen()) this.scheduleProvider(provider, this._query());\n const remove = () => {\n if (!this.providers().includes(provider)) return;\n this.cancel(provider.id);\n this.providers.update((list) => list.filter((p) => p !== provider));\n this.providerState.update((map) => {\n const next = new Map(map);\n next.delete(provider.id);\n return next;\n });\n };\n return this.bindToDestroy(remove, destroyRef);\n }\n\n /** Executes a command: saves it in the recents, closes the palette, then navigates or runs it. */\n async execute(command: Command): Promise<void> {\n if (command.disabled) return;\n const query = this._query();\n if (this.recentStore) this.recents.set(this.recentStore.add(command, this.recents()));\n this.close();\n if (command.route !== undefined) {\n if (!this.router) throw new Error('ngx-command-palette: route commands need provideRouter()');\n const { route, navigationExtras } = command;\n await (typeof route === 'string'\n ? this.router.navigateByUrl(route, navigationExtras)\n : this.router.navigate(route as unknown[], navigationExtras));\n } else {\n await command.run({ query });\n }\n }\n\n /** Removes all recents. */\n clearRecent(): void {\n this.recentStore?.clear();\n this.recents.set([]);\n }\n\n // ---- internals ----\n\n private bindToDestroy(remove: () => void, destroyRef?: DestroyRef): () => void {\n const ref = destroyRef ?? currentDestroyRef();\n const unsubscribe = ref?.onDestroy(remove);\n return () => {\n unsubscribe?.();\n remove();\n };\n }\n\n private buildSections(query: string): CommandSection[] {\n const defaultGroup = this.config.labels.defaultGroup;\n const commands = this.commands();\n const groups = new Map<string, CommandResult[]>();\n const push = (group: string, result: CommandResult) => {\n const list = groups.get(group);\n if (list) list.push(result);\n else groups.set(group, [result]);\n };\n const sections: CommandSection[] = [];\n\n if (!query) {\n const recent = this.recentResults(commands);\n if (recent.length)\n sections.push({ id: RECENT_SECTION_ID, label: this.config.labels.recent, items: recent });\n for (const command of commands) {\n const group = command.group ?? defaultGroup;\n push(group, toResult(command, `g:${group}:${command.id}`, 0, []));\n }\n } else {\n const scored: CommandResult[] = [];\n for (const command of commands) {\n const match = matchCommand(query, command);\n if (!match) continue;\n const group = command.group ?? defaultGroup;\n scored.push(toResult(command, `g:${group}:${command.id}`, match.score, match.indices));\n }\n // Stable sort: equal scores keep the registration order\n scored.sort((a, b) => b.score - a.score);\n for (const result of scored.slice(0, this.config.maxResults)) {\n push(result.command.group ?? defaultGroup, result);\n }\n }\n for (const [label, items] of groups) sections.push({ id: `g:${label}`, label, items });\n\n // Async results: server order, highlighted when the label matches\n const states = this.providerState();\n for (const provider of this.providers()) {\n const state = states.get(provider.id);\n if (!state?.items.length) continue;\n const items = state.items.map((command) => {\n const match = query ? fuzzyMatch(query, command.label) : null;\n return toResult(\n command,\n `p:${provider.id}:${command.id}`,\n match?.score ?? 0,\n match?.indices ?? [],\n );\n });\n sections.push({ id: `p:${provider.id}`, label: provider.group, items });\n }\n return sections;\n }\n\n private recentResults(commands: readonly Command[]): CommandResult[] {\n if (!this.recentStore) return [];\n const byId = new Map(commands.map((c) => [c.id, c]));\n const results: CommandResult[] = [];\n for (const entry of this.recents()) {\n // Still registered, or rebuilt from the saved route (e.g. a customer from an API)\n const command: Command | undefined =\n byId.get(entry.id) ??\n (entry.route !== undefined\n ? {\n id: entry.id,\n label: entry.label,\n route: entry.route,\n ...(entry.group ? { group: entry.group } : {}),\n ...(entry.description ? { description: entry.description } : {}),\n }\n : undefined);\n if (command && !command.disabled) results.push(toResult(command, `r:${entry.id}`, 0, []));\n }\n return results;\n }\n\n private scheduleProviders(): void {\n const query = this._query();\n for (const provider of this.providers()) this.scheduleProvider(provider, query);\n }\n\n private scheduleProvider(provider: CommandProvider, rawQuery: string): void {\n this.cancel(provider.id);\n const query = rawQuery.trim();\n if (query.length < (provider.minQueryLength ?? 1)) {\n this.setProviderState(provider.id, null);\n return;\n }\n const previous = this.providerState().get(provider.id);\n this.setProviderState(provider.id, { items: previous?.items ?? [], loading: true });\n const request: PendingRequest = {};\n this.pending.set(provider.id, request);\n request.timer = setTimeout(() => {\n request.timer = undefined;\n const controller = new AbortController();\n request.controller = controller;\n const done = (state: ProviderState) => {\n if (!controller.signal.aborted && this.pending.get(provider.id) === request) {\n this.setProviderState(provider.id, state);\n }\n };\n let result: ReturnType<CommandProvider['search']>;\n try {\n result = provider.search(query, controller.signal);\n } catch (error) {\n done({ items: [], loading: false, error });\n return;\n }\n if (isSubscribable(result)) {\n request.subscription = result.subscribe({\n next: (items) => done({ items, loading: false }),\n error: (error) => done({ items: [], loading: false, error }),\n complete: () => {\n const state = this.providerState().get(provider.id);\n if (state?.loading) done({ items: state.items, loading: false });\n },\n });\n } else {\n Promise.resolve(result).then(\n (items) => done({ items, loading: false }),\n (error: unknown) => done({ items: [], loading: false, error }),\n );\n }\n }, provider.debounceMs ?? this.config.debounceMs);\n }\n\n private setProviderState(id: string, state: ProviderState | null): void {\n this.providerState.update((map) => {\n const next = new Map(map);\n if (state) next.set(id, state);\n else next.delete(id);\n return next;\n });\n }\n\n private cancel(id: string): void {\n const request = this.pending.get(id);\n if (!request) return;\n this.pending.delete(id);\n if (request.timer) clearTimeout(request.timer);\n request.controller?.abort();\n request.subscription?.unsubscribe();\n }\n\n private cancelAll(): void {\n for (const id of [...this.pending.keys()]) this.cancel(id);\n }\n}\n\nfunction toResult(\n command: Command,\n key: string,\n score: number,\n indices: readonly number[],\n): CommandResult {\n return { command, key, score, indices, segments: highlightSegments(command.label, indices) };\n}\n\nfunction isSubscribable<T>(value: unknown): value is CommandSubscribable<T> {\n return !!value && typeof (value as { subscribe?: unknown }).subscribe === 'function';\n}\n\nfunction currentDestroyRef(): DestroyRef | null {\n try {\n return inject(DestroyRef, { optional: true });\n } catch {\n // Outside an injection context: removal stays manual\n return null;\n }\n}\n\n/**\n * Registers commands for the lifetime of the current component/service.\n * Must be called in an injection context.\n */\nexport function injectCommands(\n commands: readonly Command[] | Signal<readonly Command[]>,\n): () => void {\n assertInInjectionContext(injectCommands);\n return inject(CommandPaletteService).register(commands, inject(DestroyRef));\n}\n\n/** Registers an async provider for the lifetime of the current component/service. */\nexport function injectCommandProvider(provider: CommandProvider): () => void {\n assertInInjectionContext(injectCommandProvider);\n return inject(CommandPaletteService).registerProvider(provider, inject(DestroyRef));\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nexport type NavigationAction = 'next' | 'prev' | 'first' | 'last' | 'select' | 'close';\n\ntype KeyLike = Pick<\n KeyboardEvent,\n 'key' | 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'isComposing'\n>;\n\n/** Maps a keydown inside the palette to a list action, or `null` to let the input handle it. */\nexport function keyToAction(event: KeyLike): NavigationAction | null {\n // During IME composition Enter and arrows belong to the text editor\n if (event.isComposing) return null;\n switch (event.key) {\n case 'ArrowDown':\n return 'next';\n case 'ArrowUp':\n return 'prev';\n case 'Home':\n return event.shiftKey ? null : 'first';\n case 'End':\n return event.shiftKey ? null : 'last';\n case 'PageUp':\n return 'first';\n case 'PageDown':\n return 'last';\n case 'Enter':\n return 'select';\n case 'Escape':\n return 'close';\n // Ctrl+N / Ctrl+P as in Emacs and many palettes (not Ctrl+J/K: Ctrl+K toggles the palette)\n case 'n':\n return event.ctrlKey && !event.metaKey && !event.altKey ? 'next' : null;\n case 'p':\n return event.ctrlKey && !event.metaKey && !event.altKey ? 'prev' : null;\n default:\n return null;\n }\n}\n\n/**\n * Index of the next selectable item. `disabled[i]` marks rows that cannot be active.\n * Returns -1 when no item is selectable. `next`/`prev` wrap around.\n */\nexport function moveIndex(\n disabled: readonly boolean[],\n current: number,\n action: 'next' | 'prev' | 'first' | 'last',\n): number {\n const count = disabled.length;\n if (count === 0) return -1;\n const findFrom = (start: number, step: 1 | -1, wrap: boolean): number => {\n for (let n = 0, i = start; n < count; n++, i += step) {\n if (wrap) i = (i + count) % count;\n else if (i < 0 || i >= count) return -1;\n if (!disabled[i]) return i;\n }\n return -1;\n };\n switch (action) {\n case 'first':\n return findFrom(0, 1, false);\n case 'last':\n return findFrom(count - 1, -1, false);\n case 'next':\n return current < 0 ? findFrom(0, 1, false) : findFrom(current + 1, 1, true);\n case 'prev':\n return current < 0 ? findFrom(count - 1, -1, false) : findFrom(current - 1, -1, true);\n }\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\n/** A parsed keyboard shortcut such as `mod+k` or `ctrl+shift+p`. */\nexport interface ParsedShortcut {\n readonly key: string;\n readonly mod: boolean;\n readonly ctrl: boolean;\n readonly meta: boolean;\n readonly alt: boolean;\n readonly shift: boolean;\n}\n\nconst MODIFIERS: Record<string, keyof Omit<ParsedShortcut, 'key'>> = {\n mod: 'mod',\n ctrl: 'ctrl',\n control: 'ctrl',\n meta: 'meta',\n cmd: 'meta',\n command: 'meta',\n alt: 'alt',\n option: 'alt',\n shift: 'shift',\n};\n\nconst KEY_ALIASES: Record<string, string> = {\n space: ' ',\n esc: 'escape',\n slash: '/',\n plus: '+',\n};\n\n/**\n * Parses a shortcut string. Parts are separated by `+`; `mod` means ⌘ on Apple\n * platforms and Ctrl elsewhere. Examples: `mod+k`, `ctrl+shift+p`, `/`.\n */\nexport function parseShortcut(shortcut: string): ParsedShortcut {\n const parts = shortcut\n .toLowerCase()\n .split('+')\n .map((p) => p.trim())\n .filter(Boolean);\n if (shortcut.trim().endsWith('++') || shortcut.trim() === '+') parts.push('+');\n const result = { key: '', mod: false, ctrl: false, meta: false, alt: false, shift: false };\n for (const part of parts) {\n const modifier = MODIFIERS[part];\n if (modifier) result[modifier] = true;\n else result.key = KEY_ALIASES[part] ?? part;\n }\n if (!result.key) throw new Error(`ngx-command-palette: invalid shortcut \"${shortcut}\"`);\n return result;\n}\n\n/** True on macOS / iOS, where `mod` maps to the ⌘ key. */\nexport function isApplePlatform(nav: Navigator | undefined = globalThis.navigator): boolean {\n if (!nav) return false;\n const platform =\n (nav as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform ??\n nav.platform ??\n '';\n return /mac|iphone|ipad|ipod/i.test(platform);\n}\n\ntype KeyEventLike = Pick<\n KeyboardEvent,\n 'key' | 'code' | 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey'\n>;\n\n/** True when `event` matches `shortcut`. Letters also match by physical key (non-Latin layouts). */\nexport function matchesShortcut(\n event: KeyEventLike,\n shortcut: ParsedShortcut,\n apple: boolean,\n): boolean {\n const wantCtrl = shortcut.ctrl || (shortcut.mod && !apple);\n const wantMeta = shortcut.meta || (shortcut.mod && apple);\n if (event.ctrlKey !== wantCtrl || event.metaKey !== wantMeta || event.altKey !== shortcut.alt) {\n return false;\n }\n const key = (event.key ?? '').toLowerCase();\n // Shift matters only when requested or for letters (\"?\" needs Shift, but nobody writes it)\n const isLetter = /^[a-z]$/.test(shortcut.key);\n if ((shortcut.shift || isLetter) && event.shiftKey !== shortcut.shift) return false;\n if (key === shortcut.key) return true;\n // With Alt or non-Latin layouts event.key changes: fall back to the physical key\n if (isLetter && event.code === `Key${shortcut.key.toUpperCase()}`) return true;\n if (/^[0-9]$/.test(shortcut.key) && event.code === `Digit${shortcut.key}`) return true;\n return false;\n}\n\n/** Human readable label, e.g. `⌘K` on macOS and `Ctrl+K` elsewhere. */\nexport function formatShortcut(shortcut: ParsedShortcut, apple: boolean): string {\n const key =\n shortcut.key === ' '\n ? 'Space'\n : shortcut.key.length === 1\n ? shortcut.key.toUpperCase()\n : capitalize(shortcut.key);\n if (apple) {\n return (\n (shortcut.ctrl ? '⌃' : '') +\n (shortcut.alt ? '⌥' : '') +\n (shortcut.shift ? '⇧' : '') +\n (shortcut.meta || shortcut.mod ? '⌘' : '') +\n key\n );\n }\n const parts: string[] = [];\n if (shortcut.ctrl || shortcut.mod) parts.push('Ctrl');\n if (shortcut.meta) parts.push('Win');\n if (shortcut.alt) parts.push('Alt');\n if (shortcut.shift) parts.push('Shift');\n parts.push(key);\n return parts.join('+');\n}\n\nfunction capitalize(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { Command, CommandResult, HighlightSegment } from './command.model';\n\nexport interface CommandItemContext {\n /** The command. */\n readonly $implicit: Command;\n readonly result: CommandResult;\n /** Label split into matched / unmatched parts. */\n readonly segments: readonly HighlightSegment[];\n /** True for the row selected with the keyboard or the mouse. */\n readonly active: boolean;\n readonly query: string;\n}\n\nexport interface CommandEmptyContext {\n /** The search text. */\n readonly $implicit: string;\n}\n\n/**\n * Custom template for each row:\n * `<ng-template rrCommandItem let-command let-segments=\"segments\">…</ng-template>`\n */\n@Directive({ selector: 'ng-template[rrCommandItem]' })\nexport class CommandItemTemplate {\n readonly template = inject<TemplateRef<CommandItemContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: CommandItemTemplate,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- signature required by Angular\n ctx: unknown,\n ): ctx is CommandItemContext {\n return true;\n }\n}\n\n/** Custom empty state: `<ng-template rrCommandEmpty let-query>…</ng-template>` */\n@Directive({ selector: 'ng-template[rrCommandEmpty]' })\nexport class CommandEmptyTemplate {\n readonly template = inject<TemplateRef<CommandEmptyContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: CommandEmptyTemplate,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- signature required by Angular\n ctx: unknown,\n ): ctx is CommandEmptyContext {\n return true;\n }\n}\n","// SPDX-License-Identifier: MIT\n// © 2026 rrstudio — ngx-command-palette\n\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n DestroyRef,\n ElementRef,\n TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n computed,\n contentChild,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport type { CommandResult } from './command.model';\nimport { CommandPaletteService } from './command-palette.service';\nimport { COMMAND_PALETTE_CONFIG, type CommandPaletteTheme } from './config';\nimport { keyToAction, moveIndex } from './list-navigation';\nimport { formatShortcut, isApplePlatform, matchesShortcut, parseShortcut } from './shortcut';\nimport { CommandEmptyTemplate, CommandItemTemplate } from './templates.directive';\n\nlet nextId = 0;\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * The command palette dialog. Place it once, usually in the root component template.\n * It listens to the global shortcut and renders nothing while closed.\n */\n@Component({\n selector: 'rr-command-palette',\n imports: [NgTemplateOutlet],\n templateUrl: './command-palette.component.html',\n styleUrl: './command-palette.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'rr-cp-host',\n '(document:keydown)': 'onDocumentKeydown($event)',\n '(document:focusin)': 'onDocumentFocusin($event)',\n },\n})\nexport class CommandPaletteComponent {\n protected readonly service = inject(CommandPaletteService);\n protected readonly config = inject(COMMAND_PALETTE_CONFIG);\n private readonly document = inject(DOCUMENT);\n\n /** Overrides the `theme` of `provideCommandPalette()`, e.g. to follow your app's theme toggle. */\n readonly theme = input<CommandPaletteTheme | undefined>(undefined);\n\n protected readonly itemTemplate = contentChild(CommandItemTemplate);\n protected readonly emptyTemplate = contentChild(CommandEmptyTemplate);\n private readonly input = viewChild<ElementRef<HTMLInputElement>>('input');\n private readonly dialog = viewChild<ElementRef<HTMLElement>>('dialog');\n\n protected readonly uid = `rr-cp-${nextId++}`;\n protected readonly labels = this.config.labels;\n private readonly apple = isApplePlatform();\n private readonly shortcuts = (typeof this.config.shortcut === 'string'\n ? [this.config.shortcut]\n : this.config.shortcut\n ).map(parseShortcut);\n /** Label of the first shortcut, e.g. `⌘K` or `Ctrl+K`, for a \"search\" button in your UI. */\n readonly shortcutLabel = this.shortcuts.length\n ? formatShortcut(this.shortcuts[0], this.apple)\n : '';\n\n private readonly prefersDark = signal(false);\n protected readonly resolvedTheme = computed(() => {\n const theme = this.theme() ?? this.config.theme;\n return theme === 'auto' ? (this.prefersDark() ? 'dark' : 'light') : theme;\n });\n\n /** Sections with the flat index of each row (used for ids and keyboard navigation). */\n protected readonly view = computed(() => {\n let index = 0;\n return this.service.sections().map((section, sectionIndex) => ({\n section,\n headingId: `${this.uid}-group-${sectionIndex}`,\n rows: section.items.map((item) => ({ item, index: index++ })),\n }));\n });\n protected readonly items = computed<readonly CommandResult[]>(() =>\n this.service.sections().flatMap((s) => s.items),\n );\n private readonly activeKey = signal<string | null>(null);\n protected readonly activeIndex = computed(() => {\n const items = this.items();\n const key = this.activeKey();\n const found = key === null ? -1 : items.findIndex((i) => i.key === key);\n if (found >= 0 && !items[found].command.disabled) return found;\n return moveIndex(\n items.map((i) => !!i.command.disabled),\n -1,\n 'first',\n );\n });\n protected readonly activeDescendant = computed(() => {\n const index = this.activeIndex();\n return index >= 0 ? this.optionId(index) : null;\n });\n protected readonly status = computed(() => {\n if (this.service.loading()) return this.labels.loading;\n const count = this.items().length;\n return count === 0 ? this.labels.empty : this.labels.results.replace('{count}', String(count));\n });\n\n constructor() {\n const view = this.document.defaultView;\n const media = view?.matchMedia?.('(prefers-color-scheme: dark)');\n if (media) {\n this.prefersDark.set(media.matches);\n const listener = (e: MediaQueryListEvent) => this.prefersDark.set(e.matches);\n media.addEventListener?.('change', listener);\n inject(DestroyRef).onDestroy(() => media.removeEventListener?.('change', listener));\n }\n\n // Focus the search field as soon as the dialog appears\n afterRenderEffect(() => {\n const input = this.input()?.nativeElement;\n if (input && this.document.activeElement !== input) input.focus({ preventScroll: true });\n });\n // Keep the active row visible during keyboard navigation\n afterRenderEffect(() => {\n const id = this.activeDescendant();\n if (!id) return;\n const option = this.document.getElementById(id);\n option?.scrollIntoView?.({ block: 'nearest' });\n });\n }\n\n protected optionId(index: number): string {\n return `${this.uid}-option-${index}`;\n }\n\n protected isTemplate(icon: unknown): icon is TemplateRef<unknown> {\n return icon instanceof TemplateRef;\n }\n\n protected onInput(event: Event): void {\n this.activeKey.set(null);\n this.service.setQuery((event.target as HTMLInputElement).value);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Tab') {\n this.trapTab(event);\n return;\n }\n const action = keyToAction(event);\n if (!action) return;\n event.preventDefault();\n event.stopPropagation();\n const items = this.items();\n switch (action) {\n case 'close':\n this.service.close();\n return;\n case 'select': {\n const item = items[this.activeIndex()];\n if (item) void this.service.execute(item.command);\n return;\n }\n default: {\n const next = moveIndex(\n items.map((i) => !!i.command.disabled),\n this.activeIndex(),\n action,\n );\n if (next >= 0) this.activeKey.set(items[next].key);\n }\n }\n }\n\n protected onPointerMove(item: CommandResult): void {\n if (!item.command.disabled && this.activeKey() !== item.key) this.activeKey.set(item.key);\n }\n\n protected onSelect(item: CommandResult): void {\n void this.service.execute(item.command);\n }\n\n protected onOverlayDown(event: MouseEvent): void {\n // Only a click on the backdrop, not inside the dialog\n if (event.target === event.currentTarget) this.service.close();\n }\n\n protected onDocumentKeydown(event: KeyboardEvent): void {\n if (event.repeat || event.isComposing) return;\n // Shortcuts without Ctrl/⌘/Alt (e.g. \"/\") do not fire while typing in a field\n const typing = isEditable(event.target);\n const hit = this.shortcuts.some(\n (s) =>\n (!typing || s.mod || s.ctrl || s.meta || s.alt) && matchesShortcut(event, s, this.apple),\n );\n if (hit) {\n event.preventDefault();\n this.activeKey.set(null);\n this.service.toggle();\n }\n }\n\n protected onDocumentFocusin(event: FocusEvent): void {\n if (!this.service.isOpen()) return;\n const dialog = this.dialog()?.nativeElement;\n // Focus trap: if focus leaves the dialog (e.g. an iframe click or a scripted focus) it returns to the input\n if (dialog && event.target instanceof Node && !dialog.contains(event.target)) {\n this.input()?.nativeElement.focus({ preventScroll: true });\n }\n }\n\n private trapTab(event: KeyboardEvent): void {\n const dialog = this.dialog()?.nativeElement;\n if (!dialog) return;\n const focusable = Array.from(dialog.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (focusable.length <= 1) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = this.document.activeElement;\n if (event.shiftKey && active === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n }\n}\n\nfunction isEditable(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n if (!el || typeof el.tagName !== 'string') return false;\n const tag = el.tagName.toLowerCase();\n return tag === 'input' || tag === 'textarea' || tag === 'select' || el.isContentEditable;\n}\n","@if (service.isOpen()) {\n <div class=\"rr-cp\" [attr.data-theme]=\"resolvedTheme()\" (mousedown)=\"onOverlayDown($event)\">\n <div\n #dialog\n class=\"rr-cp-dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"labels.dialog\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"rr-cp-search\">\n <svg\n class=\"rr-cp-search-icon\"\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n aria-hidden=\"true\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n <path\n d=\"m20 20-3.5-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n <input\n #input\n class=\"rr-cp-input\"\n type=\"text\"\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"uid + '-listbox'\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-label]=\"labels.placeholder\"\n [placeholder]=\"labels.placeholder\"\n [value]=\"service.query()\"\n (input)=\"onInput($event)\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n />\n @if (service.loading()) {\n <span class=\"rr-cp-spinner\" aria-hidden=\"true\"></span>\n }\n <kbd class=\"rr-cp-esc\" aria-hidden=\"true\">{{ labels.closeHint }}</kbd>\n </div>\n\n <div\n class=\"rr-cp-list\"\n role=\"listbox\"\n [id]=\"uid + '-listbox'\"\n [attr.aria-label]=\"labels.listbox\"\n [attr.aria-busy]=\"service.loading()\"\n >\n @for (group of view(); track group.section.id) {\n <div class=\"rr-cp-group\" role=\"group\" [attr.aria-labelledby]=\"group.headingId\">\n <!-- prettier-ignore -->\n <div class=\"rr-cp-group-label\" [id]=\"group.headingId\" aria-hidden=\"true\">{{ group.section.label }}</div>\n @for (row of group.rows; track row.item.key) {\n <!-- Combobox pattern: options never get focus, the keyboard goes through the input (aria-activedescendant) -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"rr-cp-item\"\n role=\"option\"\n [id]=\"optionId(row.index)\"\n [class.rr-cp-item-active]=\"row.index === activeIndex()\"\n [attr.aria-selected]=\"row.index === activeIndex()\"\n [attr.aria-disabled]=\"row.item.command.disabled ? true : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mousemove)=\"onPointerMove(row.item)\"\n (click)=\"onSelect(row.item)\"\n >\n @if (itemTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.item.command,\n result: row.item,\n segments: row.item.segments,\n active: row.index === activeIndex(),\n query: service.query(),\n }\"\n />\n } @else {\n @if (row.item.command.icon; as icon) {\n <span class=\"rr-cp-icon\" aria-hidden=\"true\">\n @if (isTemplate(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n {{ icon }}\n }\n </span>\n }\n <span class=\"rr-cp-text\">\n <!-- Single line: line breaks would become spaces inside the label -->\n <!-- prettier-ignore -->\n <span class=\"rr-cp-label\">@for (segment of row.item.segments; track $index) {@if (segment.match) {<mark class=\"rr-cp-match\">{{ segment.text }}</mark>} @else {{{ segment.text }}}}</span>\n @if (row.item.command.description) {\n <span class=\"rr-cp-description\">{{ row.item.command.description }}</span>\n }\n </span>\n @if (row.item.command.shortcut?.length) {\n <span class=\"rr-cp-shortcut\" aria-hidden=\"true\">\n @for (key of row.item.command.shortcut; track $index) {\n <kbd>{{ key }}</kbd>\n }\n </span>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n\n @if (items().length === 0) {\n <div class=\"rr-cp-empty\">\n @if (service.loading()) {\n {{ labels.loading }}\n } @else if (emptyTemplate(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: service.query() }\"\n />\n } @else {\n {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G;AACzE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rrstudioapps/ngx-command-palette",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Accessible ⌘K / Ctrl+K command palette for Angular: fuzzy search, sections, recents, async providers. Standalone, signals, zoneless, zero dependencies.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"command-palette",
|
|
8
|
+
"cmdk",
|
|
9
|
+
"kbar",
|
|
10
|
+
"command-menu",
|
|
11
|
+
"spotlight",
|
|
12
|
+
"fuzzy-search",
|
|
13
|
+
"keyboard",
|
|
14
|
+
"a11y",
|
|
15
|
+
"signals",
|
|
16
|
+
"zoneless",
|
|
17
|
+
"standalone"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "rrstudio (https://github.com/rrstudioapps)",
|
|
21
|
+
"homepage": "https://github.com/rrstudioapps/ngx-command-palette#readme",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/rrstudioapps/ngx-command-palette.git",
|
|
25
|
+
"directory": "projects/ngx-command-palette"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/rrstudioapps/ngx-command-palette/issues"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@angular/common": ">=21.0.0 <23.0.0",
|
|
32
|
+
"@angular/core": ">=21.0.0 <23.0.0",
|
|
33
|
+
"@angular/router": ">=21.0.0 <23.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tslib": "^2.3.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"provenance": true
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"module": "fesm2022/rrstudioapps-ngx-command-palette.mjs",
|
|
44
|
+
"typings": "types/rrstudioapps-ngx-command-palette.d.ts",
|
|
45
|
+
"exports": {
|
|
46
|
+
"./package.json": {
|
|
47
|
+
"default": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./types/rrstudioapps-ngx-command-palette.d.ts",
|
|
51
|
+
"default": "./fesm2022/rrstudioapps-ngx-command-palette.mjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"type": "module"
|
|
6
55
|
}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, EnvironmentProviders, InjectionToken, Signal, TemplateRef } from "@angular/core";
|
|
3
|
+
import { NavigationExtras } from "@angular/router";
|
|
4
|
+
/** Context passed to a command's `run` function. */
|
|
5
|
+
interface CommandRunContext {
|
|
6
|
+
/** The search text typed when the command was executed. */
|
|
7
|
+
readonly query: string;
|
|
8
|
+
}
|
|
9
|
+
interface CommandBase {
|
|
10
|
+
/** Unique, stable id. Used for recents and as DOM id suffix. */
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/** Text shown in the list and matched by the fuzzy search. */
|
|
13
|
+
readonly label: string;
|
|
14
|
+
/** Section the command belongs to. Defaults to `labels.defaultGroup`. */
|
|
15
|
+
readonly group?: string;
|
|
16
|
+
/** Secondary text shown below the label. Also searchable, with a lower weight. */
|
|
17
|
+
readonly description?: string;
|
|
18
|
+
/** Text/emoji (or an icon font ligature) or a template rendered before the label. */
|
|
19
|
+
readonly icon?: string | TemplateRef<unknown>;
|
|
20
|
+
/** Keys shown on the right, e.g. `['⌘', 'S']`. Display only: it does not bind anything. */
|
|
21
|
+
readonly shortcut?: readonly string[];
|
|
22
|
+
/** Extra words matched by the search but not shown. */
|
|
23
|
+
readonly keywords?: readonly string[];
|
|
24
|
+
/** A disabled command is shown but cannot be executed or selected. */
|
|
25
|
+
readonly disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** A command that navigates to an Angular route. */
|
|
28
|
+
interface RouteCommand extends CommandBase {
|
|
29
|
+
readonly route: string | readonly unknown[];
|
|
30
|
+
readonly navigationExtras?: NavigationExtras;
|
|
31
|
+
readonly run?: never;
|
|
32
|
+
}
|
|
33
|
+
/** A command that runs a function. */
|
|
34
|
+
interface ActionCommand extends CommandBase {
|
|
35
|
+
readonly run: (context: CommandRunContext) => void | Promise<unknown>;
|
|
36
|
+
readonly route?: never;
|
|
37
|
+
}
|
|
38
|
+
type Command = RouteCommand | ActionCommand;
|
|
39
|
+
/** Minimal subscribable shape, so the library does not depend on RxJS. */
|
|
40
|
+
interface CommandSubscribable<T> {
|
|
41
|
+
subscribe(observer: {
|
|
42
|
+
next?: (value: T) => void;
|
|
43
|
+
error?: (error: unknown) => void;
|
|
44
|
+
complete?: () => void;
|
|
45
|
+
}): {
|
|
46
|
+
unsubscribe(): void;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Source of commands loaded on demand (e.g. a customer search on your API). */
|
|
50
|
+
interface CommandProvider {
|
|
51
|
+
/** Unique id of the provider. */
|
|
52
|
+
readonly id: string;
|
|
53
|
+
/** Section title for the results. */
|
|
54
|
+
readonly group: string;
|
|
55
|
+
/** Minimum query length before `search` is called. Default: 1. */
|
|
56
|
+
readonly minQueryLength?: number;
|
|
57
|
+
/** Debounce in ms. Default: the global `debounceMs`. */
|
|
58
|
+
readonly debounceMs?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the commands for `query`. The `signal` is aborted when the query changes
|
|
61
|
+
* or the palette closes: pass it to `fetch` to cancel the request.
|
|
62
|
+
*/
|
|
63
|
+
search(query: string, signal: AbortSignal): Promise<readonly Command[]> | CommandSubscribable<readonly Command[]>;
|
|
64
|
+
}
|
|
65
|
+
/** A piece of a label: `match` is true for characters found by the search. */
|
|
66
|
+
interface HighlightSegment {
|
|
67
|
+
readonly text: string;
|
|
68
|
+
readonly match: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** A command as shown in the list. */
|
|
71
|
+
interface CommandResult {
|
|
72
|
+
readonly command: Command;
|
|
73
|
+
/** Unique key of the row (section + command id). */
|
|
74
|
+
readonly key: string;
|
|
75
|
+
readonly score: number;
|
|
76
|
+
/** Indices of the label characters matched by the search. */
|
|
77
|
+
readonly indices: readonly number[];
|
|
78
|
+
readonly segments: readonly HighlightSegment[];
|
|
79
|
+
}
|
|
80
|
+
interface CommandSection {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly label: string;
|
|
83
|
+
readonly items: readonly CommandResult[];
|
|
84
|
+
}
|
|
85
|
+
type CommandPaletteTheme = 'light' | 'dark' | 'auto';
|
|
86
|
+
/** Texts of the palette, for translations. */
|
|
87
|
+
interface CommandPaletteLabels {
|
|
88
|
+
readonly placeholder: string;
|
|
89
|
+
readonly dialog: string;
|
|
90
|
+
readonly listbox: string;
|
|
91
|
+
readonly empty: string;
|
|
92
|
+
readonly loading: string;
|
|
93
|
+
readonly recent: string;
|
|
94
|
+
readonly defaultGroup: string;
|
|
95
|
+
/** Screen reader announcement, `{count}` is replaced by the number of results. */
|
|
96
|
+
readonly results: string;
|
|
97
|
+
readonly closeHint: string;
|
|
98
|
+
}
|
|
99
|
+
interface CommandPaletteRecentOptions {
|
|
100
|
+
/** Max number of recents shown. Default: 5. */
|
|
101
|
+
readonly max?: number;
|
|
102
|
+
/** localStorage key. Default: `rr-cp:recent`. */
|
|
103
|
+
readonly storageKey?: string;
|
|
104
|
+
}
|
|
105
|
+
interface CommandPaletteConfig {
|
|
106
|
+
/** Shortcut(s) that toggle the palette. Default: `mod+k` (⌘K on macOS, Ctrl+K elsewhere). */
|
|
107
|
+
readonly shortcut: string | readonly string[];
|
|
108
|
+
/** `auto` follows `prefers-color-scheme`. Default: `auto`. */
|
|
109
|
+
readonly theme: CommandPaletteTheme;
|
|
110
|
+
/** "Recent" section shown with an empty query; `false` disables it. */
|
|
111
|
+
readonly recent: CommandPaletteRecentOptions | false;
|
|
112
|
+
/** Debounce for async providers, in ms. Default: 200. */
|
|
113
|
+
readonly debounceMs: number;
|
|
114
|
+
/** Max results of local commands for a non-empty query. Default: 50. */
|
|
115
|
+
readonly maxResults: number;
|
|
116
|
+
readonly labels: CommandPaletteLabels;
|
|
117
|
+
}
|
|
118
|
+
type CommandPaletteOptions = Partial<Omit<CommandPaletteConfig, 'labels'>> & {
|
|
119
|
+
readonly labels?: Partial<CommandPaletteLabels>;
|
|
120
|
+
};
|
|
121
|
+
export declare const DEFAULT_COMMAND_PALETTE_LABELS: CommandPaletteLabels;
|
|
122
|
+
export declare const DEFAULT_COMMAND_PALETTE_CONFIG: CommandPaletteConfig;
|
|
123
|
+
export declare const COMMAND_PALETTE_CONFIG: InjectionToken<CommandPaletteConfig>;
|
|
124
|
+
/** Configures the command palette. Optional: without it the defaults are used. */
|
|
125
|
+
export declare function provideCommandPalette(options?: CommandPaletteOptions): EnvironmentProviders;
|
|
126
|
+
export declare const RECENT_SECTION_ID = "recent";
|
|
127
|
+
/**
|
|
128
|
+
* State of the command palette. Register commands from any component: they are removed
|
|
129
|
+
* automatically when that component is destroyed.
|
|
130
|
+
*/
|
|
131
|
+
export declare class CommandPaletteService {
|
|
132
|
+
private readonly config;
|
|
133
|
+
private readonly router;
|
|
134
|
+
private readonly document;
|
|
135
|
+
private readonly recentStore;
|
|
136
|
+
private readonly _isOpen;
|
|
137
|
+
private readonly _query;
|
|
138
|
+
private readonly registrations;
|
|
139
|
+
private readonly providers;
|
|
140
|
+
private readonly providerState;
|
|
141
|
+
private readonly recents;
|
|
142
|
+
private readonly pending;
|
|
143
|
+
private returnFocus;
|
|
144
|
+
/** Whether the palette is open. */
|
|
145
|
+
readonly isOpen: Signal<boolean>;
|
|
146
|
+
/** Current search text. */
|
|
147
|
+
readonly query: Signal<string>;
|
|
148
|
+
/** All registered (synchronous) commands. When two share an id, the last registered wins. */
|
|
149
|
+
readonly commands: Signal<readonly Command[]>;
|
|
150
|
+
/** True while at least one async provider is waiting for results. */
|
|
151
|
+
readonly loading: Signal<boolean>;
|
|
152
|
+
/** Sections shown in the list, already filtered and sorted. */
|
|
153
|
+
readonly sections: Signal<readonly CommandSection[]>;
|
|
154
|
+
/** Opens the palette, optionally with an initial query. */
|
|
155
|
+
open(query?: string): void;
|
|
156
|
+
/** Closes the palette, cancels pending searches and restores the focus. */
|
|
157
|
+
close(): void;
|
|
158
|
+
toggle(): void;
|
|
159
|
+
/** Updates the search text and schedules the async providers. */
|
|
160
|
+
setQuery(query: string): void;
|
|
161
|
+
/**
|
|
162
|
+
* Registers commands (an array or a signal of arrays). Called in an injection context
|
|
163
|
+
* (constructor, field initializer) they are removed when that context is destroyed.
|
|
164
|
+
* Returns a function that removes them earlier.
|
|
165
|
+
*/
|
|
166
|
+
register(commands: readonly Command[] | Signal<readonly Command[]>, destroyRef?: DestroyRef): () => void;
|
|
167
|
+
/** Registers an async provider. Same lifetime rules as {@link register}. */
|
|
168
|
+
registerProvider(provider: CommandProvider, destroyRef?: DestroyRef): () => void;
|
|
169
|
+
/** Executes a command: saves it in the recents, closes the palette, then navigates or runs it. */
|
|
170
|
+
execute(command: Command): Promise<void>;
|
|
171
|
+
/** Removes all recents. */
|
|
172
|
+
clearRecent(): void;
|
|
173
|
+
private bindToDestroy;
|
|
174
|
+
private buildSections;
|
|
175
|
+
private recentResults;
|
|
176
|
+
private scheduleProviders;
|
|
177
|
+
private scheduleProvider;
|
|
178
|
+
private setProviderState;
|
|
179
|
+
private cancel;
|
|
180
|
+
private cancelAll;
|
|
181
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandPaletteService, never>;
|
|
182
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Registers commands for the lifetime of the current component/service.
|
|
186
|
+
* Must be called in an injection context.
|
|
187
|
+
*/
|
|
188
|
+
export declare function injectCommands(commands: readonly Command[] | Signal<readonly Command[]>): () => void;
|
|
189
|
+
/** Registers an async provider for the lifetime of the current component/service. */
|
|
190
|
+
export declare function injectCommandProvider(provider: CommandProvider): () => void;
|
|
191
|
+
interface CommandItemContext {
|
|
192
|
+
/** The command. */
|
|
193
|
+
readonly $implicit: Command;
|
|
194
|
+
readonly result: CommandResult;
|
|
195
|
+
/** Label split into matched / unmatched parts. */
|
|
196
|
+
readonly segments: readonly HighlightSegment[];
|
|
197
|
+
/** True for the row selected with the keyboard or the mouse. */
|
|
198
|
+
readonly active: boolean;
|
|
199
|
+
readonly query: string;
|
|
200
|
+
}
|
|
201
|
+
interface CommandEmptyContext {
|
|
202
|
+
/** The search text. */
|
|
203
|
+
readonly $implicit: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Custom template for each row:
|
|
207
|
+
* `<ng-template rrCommandItem let-command let-segments="segments">…</ng-template>`
|
|
208
|
+
*/
|
|
209
|
+
export declare class CommandItemTemplate {
|
|
210
|
+
readonly template: TemplateRef<CommandItemContext>;
|
|
211
|
+
static ngTemplateContextGuard(_dir: CommandItemTemplate, ctx: unknown): ctx is CommandItemContext;
|
|
212
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandItemTemplate, never>;
|
|
213
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CommandItemTemplate, "ng-template[rrCommandItem]", never, {}, {}, never, never, true, never>;
|
|
214
|
+
}
|
|
215
|
+
/** Custom empty state: `<ng-template rrCommandEmpty let-query>…</ng-template>` */
|
|
216
|
+
export declare class CommandEmptyTemplate {
|
|
217
|
+
readonly template: TemplateRef<CommandEmptyContext>;
|
|
218
|
+
static ngTemplateContextGuard(_dir: CommandEmptyTemplate, ctx: unknown): ctx is CommandEmptyContext;
|
|
219
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandEmptyTemplate, never>;
|
|
220
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CommandEmptyTemplate, "ng-template[rrCommandEmpty]", never, {}, {}, never, never, true, never>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* The command palette dialog. Place it once, usually in the root component template.
|
|
224
|
+
* It listens to the global shortcut and renders nothing while closed.
|
|
225
|
+
*/
|
|
226
|
+
export declare class CommandPaletteComponent {
|
|
227
|
+
protected readonly service: CommandPaletteService;
|
|
228
|
+
protected readonly config: import("@rrstudioapps/ngx-command-palette").CommandPaletteConfig;
|
|
229
|
+
private readonly document;
|
|
230
|
+
/** Overrides the `theme` of `provideCommandPalette()`, e.g. to follow your app's theme toggle. */
|
|
231
|
+
readonly theme: import("@angular/core").InputSignal<CommandPaletteTheme | undefined>;
|
|
232
|
+
protected readonly itemTemplate: import("@angular/core").Signal<CommandItemTemplate | undefined>;
|
|
233
|
+
protected readonly emptyTemplate: import("@angular/core").Signal<CommandEmptyTemplate | undefined>;
|
|
234
|
+
private readonly input;
|
|
235
|
+
private readonly dialog;
|
|
236
|
+
protected readonly uid: string;
|
|
237
|
+
protected readonly labels: import("@rrstudioapps/ngx-command-palette").CommandPaletteLabels;
|
|
238
|
+
private readonly apple;
|
|
239
|
+
private readonly shortcuts;
|
|
240
|
+
/** Label of the first shortcut, e.g. `⌘K` or `Ctrl+K`, for a "search" button in your UI. */
|
|
241
|
+
readonly shortcutLabel: string;
|
|
242
|
+
private readonly prefersDark;
|
|
243
|
+
protected readonly resolvedTheme: import("@angular/core").Signal<"light" | "dark">;
|
|
244
|
+
/** Sections with the flat index of each row (used for ids and keyboard navigation). */
|
|
245
|
+
protected readonly view: import("@angular/core").Signal<{
|
|
246
|
+
section: import("@rrstudioapps/ngx-command-palette").CommandSection;
|
|
247
|
+
headingId: string;
|
|
248
|
+
rows: {
|
|
249
|
+
item: CommandResult;
|
|
250
|
+
index: number;
|
|
251
|
+
}[];
|
|
252
|
+
}[]>;
|
|
253
|
+
protected readonly items: import("@angular/core").Signal<readonly CommandResult[]>;
|
|
254
|
+
private readonly activeKey;
|
|
255
|
+
protected readonly activeIndex: import("@angular/core").Signal<number>;
|
|
256
|
+
protected readonly activeDescendant: import("@angular/core").Signal<string | null>;
|
|
257
|
+
protected readonly status: import("@angular/core").Signal<string>;
|
|
258
|
+
constructor();
|
|
259
|
+
protected optionId(index: number): string;
|
|
260
|
+
protected isTemplate(icon: unknown): icon is TemplateRef<unknown>;
|
|
261
|
+
protected onInput(event: Event): void;
|
|
262
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
263
|
+
protected onPointerMove(item: CommandResult): void;
|
|
264
|
+
protected onSelect(item: CommandResult): void;
|
|
265
|
+
protected onOverlayDown(event: MouseEvent): void;
|
|
266
|
+
protected onDocumentKeydown(event: KeyboardEvent): void;
|
|
267
|
+
protected onDocumentFocusin(event: FocusEvent): void;
|
|
268
|
+
private trapTab;
|
|
269
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandPaletteComponent, never>;
|
|
270
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommandPaletteComponent, "rr-command-palette", never, {
|
|
271
|
+
"theme": {
|
|
272
|
+
"alias": "theme";
|
|
273
|
+
"required": false;
|
|
274
|
+
"isSignal": true;
|
|
275
|
+
};
|
|
276
|
+
}, {}, ["itemTemplate", "emptyTemplate"], never, true, never>;
|
|
277
|
+
}
|
|
278
|
+
interface FuzzyMatch {
|
|
279
|
+
/** Higher is better. Only meaningful to compare matches of the same query. */
|
|
280
|
+
readonly score: number;
|
|
281
|
+
/** Indices of `text` matched by the query, ascending. */
|
|
282
|
+
readonly indices: readonly number[];
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Fuzzy subsequence match: every character of `query` (spaces ignored) must appear in
|
|
286
|
+
* `text` in order. Returns the best scoring alignment or `null`. Case and accent insensitive.
|
|
287
|
+
*/
|
|
288
|
+
export declare function fuzzyMatch(query: string, text: string): FuzzyMatch | null;
|
|
289
|
+
/** Splits `text` into matched / unmatched segments for highlighting. */
|
|
290
|
+
export declare function highlightSegments(text: string, indices: readonly number[]): HighlightSegment[];
|
|
291
|
+
/**
|
|
292
|
+
* Matches a command against the query using label, keywords and description.
|
|
293
|
+
* `indices` refer to the label (empty when only keywords/description matched).
|
|
294
|
+
*/
|
|
295
|
+
export declare function matchCommand(query: string, command: Command): FuzzyMatch | null;
|
|
296
|
+
/** A parsed keyboard shortcut such as `mod+k` or `ctrl+shift+p`. */
|
|
297
|
+
interface ParsedShortcut {
|
|
298
|
+
readonly key: string;
|
|
299
|
+
readonly mod: boolean;
|
|
300
|
+
readonly ctrl: boolean;
|
|
301
|
+
readonly meta: boolean;
|
|
302
|
+
readonly alt: boolean;
|
|
303
|
+
readonly shift: boolean;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Parses a shortcut string. Parts are separated by `+`; `mod` means ⌘ on Apple
|
|
307
|
+
* platforms and Ctrl elsewhere. Examples: `mod+k`, `ctrl+shift+p`, `/`.
|
|
308
|
+
*/
|
|
309
|
+
export declare function parseShortcut(shortcut: string): ParsedShortcut;
|
|
310
|
+
/** True on macOS / iOS, where `mod` maps to the ⌘ key. */
|
|
311
|
+
export declare function isApplePlatform(nav?: Navigator | undefined): boolean;
|
|
312
|
+
type KeyEventLike = Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey'>;
|
|
313
|
+
/** True when `event` matches `shortcut`. Letters also match by physical key (non-Latin layouts). */
|
|
314
|
+
export declare function matchesShortcut(event: KeyEventLike, shortcut: ParsedShortcut, apple: boolean): boolean;
|
|
315
|
+
/** Human readable label, e.g. `⌘K` on macOS and `Ctrl+K` elsewhere. */
|
|
316
|
+
export declare function formatShortcut(shortcut: ParsedShortcut, apple: boolean): string;
|
|
317
|
+
export type { ActionCommand, Command, CommandEmptyContext, CommandItemContext, CommandPaletteConfig, CommandPaletteLabels, CommandPaletteOptions, CommandPaletteRecentOptions, CommandPaletteTheme, CommandProvider, CommandResult, CommandRunContext, CommandSection, CommandSubscribable, FuzzyMatch, HighlightSegment, ParsedShortcut, RouteCommand };
|