@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9

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.
Files changed (69) hide show
  1. package/card/README.md +2 -1
  2. package/command/README.md +29 -0
  3. package/data/README.md +15 -3
  4. package/dialog/README.md +23 -1
  5. package/fesm2022/cngx-common-a11y.mjs +517 -184
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +62 -17
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-card.mjs +301 -46
  10. package/fesm2022/cngx-common-card.mjs.map +1 -1
  11. package/fesm2022/cngx-common-chart.mjs +1221 -479
  12. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  13. package/fesm2022/cngx-common-command.mjs +97 -16
  14. package/fesm2022/cngx-common-command.mjs.map +1 -1
  15. package/fesm2022/cngx-common-data.mjs +1496 -499
  16. package/fesm2022/cngx-common-data.mjs.map +1 -1
  17. package/fesm2022/cngx-common-dialog.mjs +236 -61
  18. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  19. package/fesm2022/cngx-common-display.mjs +364 -93
  20. package/fesm2022/cngx-common-display.mjs.map +1 -1
  21. package/fesm2022/cngx-common-interactive.mjs +2040 -1046
  22. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  23. package/fesm2022/cngx-common-layout.mjs +955 -125
  24. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  25. package/fesm2022/cngx-common-popover.mjs +1293 -89
  26. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  27. package/fesm2022/cngx-common-stepper.mjs +997 -453
  28. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  29. package/fesm2022/cngx-common-tabs.mjs +1794 -1265
  30. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  31. package/fesm2022/cngx-common-timeline.mjs +151 -61
  32. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  33. package/fesm2022/cngx-common.mjs +1 -1
  34. package/interactive/README.md +15 -4
  35. package/layout/README.md +37 -1
  36. package/package.json +20 -7
  37. package/popover/README.md +58 -2
  38. package/schematics/collection.json +9 -0
  39. package/schematics/ng-add/index.js +9 -0
  40. package/schematics/ng-add/schema.json +91 -0
  41. package/schematics/package.json +3 -0
  42. package/stepper/README.md +11 -8
  43. package/theming/components/cngx-accordion.css +1 -1
  44. package/theming/components/cngx-backdrop.css +12 -0
  45. package/theming/components/cngx-button-toggle.css +29 -3
  46. package/theming/components/cngx-data-grid.css +168 -1
  47. package/theming/components/cngx-dialog.css +13 -0
  48. package/theming/components/cngx-listbox.css +21 -12
  49. package/theming/components/cngx-menu.css +56 -16
  50. package/theming/components/cngx-popover-sheet.css +402 -0
  51. package/theming/components/cngx-popover.css +28 -0
  52. package/theming/components/cngx-recycler-placeholder.css +196 -0
  53. package/theming/components/cngx-ripple.css +1 -1
  54. package/theming/components/cngx-slider.css +32 -1
  55. package/theming/components/cngx-tooltip.css +12 -0
  56. package/timeline/README.md +155 -0
  57. package/types/cngx-common-a11y.d.ts +205 -28
  58. package/types/cngx-common-card.d.ts +201 -17
  59. package/types/cngx-common-chart.d.ts +345 -48
  60. package/types/cngx-common-command.d.ts +50 -10
  61. package/types/cngx-common-data.d.ts +743 -92
  62. package/types/cngx-common-dialog.d.ts +161 -10
  63. package/types/cngx-common-display.d.ts +356 -142
  64. package/types/cngx-common-interactive.d.ts +910 -226
  65. package/types/cngx-common-layout.d.ts +603 -32
  66. package/types/cngx-common-popover.d.ts +612 -49
  67. package/types/cngx-common-stepper.d.ts +526 -237
  68. package/types/cngx-common-tabs.d.ts +358 -75
  69. package/types/cngx-common-timeline.d.ts +108 -22
@@ -1,15 +1,29 @@
1
- import { InjectionToken, inject, computed } from '@angular/core';
1
+ import { InjectionToken, inject, EnvironmentInjector, computed } from '@angular/core';
2
+ import { foldForMatching, injectLocale } from '@cngx/core/utils';
2
3
 
3
4
  /**
4
5
  * Multi-token every `provideCommands` call contributes to. App parts register
5
6
  * command sets against it without a central list, mirroring `provideCngxMenu`.
6
7
  * The generic is the collected array (as with Angular's `HTTP_INTERCEPTORS`),
7
- * so `inject(CNGX_COMMAND_SOURCE)` returns every contributed source.
8
+ * so `inject(CNGX_COMMAND_SOURCE)` returns the sources of the nearest level
9
+ * that provides it.
10
+ *
11
+ * This is the low-level form. Register through `provideCommands`, which also
12
+ * carries a level's sources into every scope below it. A raw multi-provider on
13
+ * this token is carried down only from a level that also calls
14
+ * `provideCommands`; on any other level it is read only when that level is the
15
+ * one `injectCommands` resolves as nearest.
8
16
  *
9
17
  * @category common/command
10
18
  * @since 0.1.0
11
19
  */
12
20
  const CNGX_COMMAND_SOURCE = new InjectionToken('CNGX_COMMAND_SOURCE');
21
+ /**
22
+ * @internal Per-level registry: the sources of every `provideCommands` level
23
+ * above, plus this level's own. Resolved once per injector by the factory in
24
+ * `provideCommands`; not part of the public API.
25
+ */
26
+ const CNGX_COMMAND_REGISTRY = new InjectionToken('CNGX_COMMAND_REGISTRY');
13
27
  /**
14
28
  * Registers one or more command sources. Each source becomes a `multi` entry
15
29
  * on {@link CNGX_COMMAND_SOURCE}; call `provideCommands` from several app parts
@@ -20,9 +34,18 @@ const CNGX_COMMAND_SOURCE = new InjectionToken('CNGX_COMMAND_SOURCE');
20
34
  * `viewProviders` - letting a route or component contribute a scoped command
21
35
  * set without reaching for the raw {@link CNGX_COMMAND_SOURCE} multi-provider.
22
36
  *
37
+ * A scoped call adds to the sets above it and never hides them, across route
38
+ * and component scopes: root and route scopes come first (outer to inner), then
39
+ * component scopes outer to inner. The same source reference registered at two
40
+ * levels is listed once. Command ids are unique in the merged list: a command
41
+ * whose `id` is already registered further out replaces that command in place,
42
+ * so a scope can swap a global command for its own version.
43
+ *
23
44
  * ```ts
24
45
  * // app root
25
46
  * bootstrapApplication(AppComponent, { providers: [provideCommands(fileCommands)] });
47
+ * // a lazy route adds its set; its pages see fileCommands + reportCommands
48
+ * { path: 'reports', providers: [provideCommands(reportCommands)], component: Reports }
26
49
  * // or component scope
27
50
  * @Component({ viewProviders: [provideCommands(editorCommands)] })
28
51
  * ```
@@ -31,10 +54,23 @@ const CNGX_COMMAND_SOURCE = new InjectionToken('CNGX_COMMAND_SOURCE');
31
54
  * @since 0.1.0
32
55
  */
33
56
  function provideCommands(...sources) {
34
- return sources.map((source) => ({ provide: CNGX_COMMAND_SOURCE, useValue: source, multi: true }));
57
+ // Empty call: the parent registry flows through untouched.
58
+ if (sources.length === 0) {
59
+ return [];
60
+ }
61
+ return [
62
+ ...sources.map((source) => ({ provide: CNGX_COMMAND_SOURCE, useValue: source, multi: true })),
63
+ {
64
+ provide: CNGX_COMMAND_REGISTRY,
65
+ // The nearest CNGX_COMMAND_SOURCE is this level's own multi list, so the
66
+ // same factory works for environment, providers and viewProviders scopes.
67
+ useFactory: () => mergeSources(inject(CNGX_COMMAND_REGISTRY, { skipSelf: true, optional: true }) ?? [], inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? []),
68
+ },
69
+ ];
35
70
  }
36
71
  /**
37
- * Merges every registered {@link CNGX_COMMAND_SOURCE} into one reactive
72
+ * Merges the command sources registered at this injector level and every level
73
+ * above it - route and component scopes alike - into one reactive
38
74
  * `Signal<readonly CngxCommand[]>`. The merge carries an explicit `equal`
39
75
  * (length + per-command identity) so re-emitting an identical set - the same
40
76
  * command references in the same order - does not produce a fresh array and
@@ -46,8 +82,27 @@ function provideCommands(...sources) {
46
82
  * @since 0.1.0
47
83
  */
48
84
  function injectCommands() {
49
- const sources = inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? [];
50
- return computed(() => sources.flatMap(readSource), { equal: commandsEqual });
85
+ // A node resolves its element chain before its environment chain, so a
86
+ // routed component under a shell registry never reaches the route's
87
+ // registry. Read both trees once and join them: environment scopes first.
88
+ const sources = mergeSources(inject(EnvironmentInjector).get(CNGX_COMMAND_REGISTRY, null) ?? [], inject(CNGX_COMMAND_REGISTRY, { optional: true }) ?? [], inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? []);
89
+ return computed(() => dedupeById(sources.flatMap(readSource)), { equal: commandsEqual });
90
+ }
91
+ /**
92
+ * @internal Keeps one command per `id`: the last registration (the innermost
93
+ * scope) wins, at the position of the first. A Map keeps a key's insertion slot
94
+ * when its value is replaced.
95
+ */
96
+ function dedupeById(commands) {
97
+ const byId = new Map();
98
+ for (const command of commands) {
99
+ byId.set(command.id, command);
100
+ }
101
+ return byId.size === commands.length ? commands : [...byId.values()];
102
+ }
103
+ /** @internal Concatenates in argument order and drops repeated source references. */
104
+ function mergeSources(...lists) {
105
+ return [...new Set(lists.flat())];
51
106
  }
52
107
  /** @internal Reads a source, unwrapping a signal or passing an array through. */
53
108
  function readSource(source) {
@@ -74,19 +129,47 @@ function commandsEqual(a, b) {
74
129
  * label-exact > label-prefix > label-substring > keyword. The optional scope
75
130
  * filters to commands whose `group` equals it.
76
131
  *
132
+ * Query, labels and keywords are compared case- and accent-tolerant
133
+ * ({@link foldForMatching}): `uber` finds `Über`. Pass the app locale (the
134
+ * default `CNGX_COMMAND_MATCH_FACTORY` passes `injectLocale()`) so case folds
135
+ * by its rules, e.g. Turkish `I` / `ı`; read inside a `computed()`, a locale
136
+ * switch re-ranks.
137
+ *
77
138
  * @category common/command
78
139
  * @since 0.1.0
79
140
  */
80
- function createDefaultCommandMatcher() {
141
+ function createDefaultCommandMatcher(locale) {
142
+ // Folded label and keywords per command, re-folded only when the label, the
143
+ // keywords array or the locale changes - not on every keystroke.
144
+ const folded = new WeakMap();
145
+ const foldedFor = (command, activeLocale) => {
146
+ const hit = folded.get(command);
147
+ if (hit !== undefined &&
148
+ hit.locale === activeLocale &&
149
+ hit.sourceLabel === command.label &&
150
+ hit.sourceKeywords === command.keywords) {
151
+ return hit;
152
+ }
153
+ const entry = {
154
+ locale: activeLocale,
155
+ sourceLabel: command.label,
156
+ sourceKeywords: command.keywords,
157
+ label: foldForMatching(command.label, activeLocale),
158
+ keywords: (command.keywords ?? []).map((keyword) => foldForMatching(keyword, activeLocale)),
159
+ };
160
+ folded.set(command, entry);
161
+ return entry;
162
+ };
81
163
  return (commands, term, scope) => {
82
164
  const scoped = scope ? commands.filter((command) => command.group === scope) : commands;
83
- const query = term.trim().toLowerCase();
165
+ const activeLocale = locale?.();
166
+ const query = foldForMatching(term.trim(), activeLocale);
84
167
  if (query.length === 0) {
85
168
  return scoped.map((command) => ({ command, score: 0 }));
86
169
  }
87
170
  const ranked = [];
88
171
  for (const command of scoped) {
89
- const score = scoreCommand(command, query);
172
+ const score = scoreCommand(foldedFor(command, activeLocale), query);
90
173
  if (score > 0) {
91
174
  ranked.push({ command, score });
92
175
  }
@@ -97,9 +180,8 @@ function createDefaultCommandMatcher() {
97
180
  return ranked;
98
181
  };
99
182
  }
100
- /** @internal Scores one command against a lower-cased query; `0` means no match. */
101
- function scoreCommand(command, query) {
102
- const label = command.label.toLowerCase();
183
+ /** @internal Scores one folded command against a folded query; `0` means no match. */
184
+ function scoreCommand({ label, keywords }, query) {
103
185
  if (label === query) {
104
186
  return 100;
105
187
  }
@@ -109,8 +191,7 @@ function scoreCommand(command, query) {
109
191
  if (label.includes(query)) {
110
192
  return 60;
111
193
  }
112
- for (const keyword of command.keywords ?? []) {
113
- const value = keyword.toLowerCase();
194
+ for (const value of keywords) {
114
195
  if (value === query) {
115
196
  return 50;
116
197
  }
@@ -126,7 +207,7 @@ function scoreCommand(command, query) {
126
207
 
127
208
  /**
128
209
  * Swappable match-strategy seam. Defaults to {@link createDefaultCommandMatcher}
129
- * (pure label/keyword ranking). Override it - app-wide via `providers` or
210
+ * (pure label/keyword ranking, case- and accent-tolerant in the app locale). Override it - app-wide via `providers` or
130
211
  * per-component via `viewProviders` - to drop in a fuzzy/Levenshtein ranker
131
212
  * without touching the panel. The fuzzy engine stays a consumer swap; the
132
213
  * default bundle ships only the pure ranker.
@@ -134,7 +215,7 @@ function scoreCommand(command, query) {
134
215
  * @category common/command
135
216
  * @since 0.1.0
136
217
  */
137
- const CNGX_COMMAND_MATCH_FACTORY = new InjectionToken('CNGX_COMMAND_MATCH_FACTORY', { providedIn: 'root', factory: () => createDefaultCommandMatcher });
218
+ const CNGX_COMMAND_MATCH_FACTORY = new InjectionToken('CNGX_COMMAND_MATCH_FACTORY', { providedIn: 'root', factory: () => () => createDefaultCommandMatcher(injectLocale()) });
138
219
 
139
220
  /**
140
221
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-common-command.mjs","sources":["../../../projects/common/command/provide-commands.ts","../../../projects/common/command/match.ts","../../../projects/common/command/match-strategy.token.ts","../../../projects/common/command/cngx-common-command.ts"],"sourcesContent":["import {\n computed,\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n} from '@angular/core';\n\nimport type { CngxCommand } from './command';\n\n/**\n * A command contribution. Either a static list or a reactive `Signal` of\n * commands - a signal source lets a contributor add or remove commands (or\n * flip a command's `disabled`) live, and `injectCommands` tracks it.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandSource = Signal<readonly CngxCommand[]> | readonly CngxCommand[];\n\n/**\n * Multi-token every `provideCommands` call contributes to. App parts register\n * command sets against it without a central list, mirroring `provideCngxMenu`.\n * The generic is the collected array (as with Angular's `HTTP_INTERCEPTORS`),\n * so `inject(CNGX_COMMAND_SOURCE)` returns every contributed source.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport const CNGX_COMMAND_SOURCE = new InjectionToken<readonly CngxCommandSource[]>(\n 'CNGX_COMMAND_SOURCE',\n);\n\n/**\n * Registers one or more command sources. Each source becomes a `multi` entry\n * on {@link CNGX_COMMAND_SOURCE}; call `provideCommands` from several app parts\n * and `injectCommands` merges all of them.\n *\n * Returns `Provider[]` (not `EnvironmentProviders`), so it registers at any\n * injector scope - app root, a lazy route, or a component's `providers` /\n * `viewProviders` - letting a route or component contribute a scoped command\n * set without reaching for the raw {@link CNGX_COMMAND_SOURCE} multi-provider.\n *\n * ```ts\n * // app root\n * bootstrapApplication(AppComponent, { providers: [provideCommands(fileCommands)] });\n * // or component scope\n * @Component({ viewProviders: [provideCommands(editorCommands)] })\n * ```\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function provideCommands(...sources: CngxCommandSource[]): Provider[] {\n return sources.map((source) => ({ provide: CNGX_COMMAND_SOURCE, useValue: source, multi: true }));\n}\n\n/**\n * Merges every registered {@link CNGX_COMMAND_SOURCE} into one reactive\n * `Signal<readonly CngxCommand[]>`. The merge carries an explicit `equal`\n * (length + per-command identity) so re-emitting an identical set - the same\n * command references in the same order - does not produce a fresh array and\n * cascade the downstream match `computed()`.\n *\n * Must run in an injection context.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function injectCommands(): Signal<readonly CngxCommand[]> {\n const sources = inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? [];\n return computed(() => sources.flatMap(readSource), { equal: commandsEqual });\n}\n\n/** @internal Reads a source, unwrapping a signal or passing an array through. */\nfunction readSource(source: CngxCommandSource): readonly CngxCommand[] {\n return typeof source === 'function' ? source() : source;\n}\n\n/**\n * @internal Length + per-command identity. Identity subsumes id equality, so a\n * re-provided set of the same references short-circuits without re-emitting.\n */\nfunction commandsEqual(a: readonly CngxCommand[], b: readonly CngxCommand[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every((command, i) => command === b[i]);\n}\n","import type { CngxCommand } from './command';\n\n/**\n * A command paired with its match score for a given query. Higher scores rank\n * first. The palette renders these in order; the row slot reads `command` and\n * the term to highlight.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport interface RankedCommand {\n /** The matched command. */\n readonly command: CngxCommand;\n /** Relevance score for the query; higher ranks first. `0` for an empty query. */\n readonly score: number;\n}\n\n/**\n * Ranks and filters a command set against a query and optional scope. Swappable\n * via {@link CNGX_COMMAND_MATCH_FACTORY} - a consumer drops in Levenshtein or a\n * fuzzy engine without touching the panel.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandMatcher = (\n commands: readonly CngxCommand[],\n term: string,\n scope?: string,\n) => readonly RankedCommand[];\n\n/**\n * Builds the default matcher: a pure label/keyword ranker. An empty query\n * returns every (scoped) command at score `0` in registration order; a\n * non-empty query keeps only commands that match label or keyword, ranked\n * label-exact > label-prefix > label-substring > keyword. The optional scope\n * filters to commands whose `group` equals it.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function createDefaultCommandMatcher(): CngxCommandMatcher {\n return (commands, term, scope) => {\n const scoped = scope ? commands.filter((command) => command.group === scope) : commands;\n const query = term.trim().toLowerCase();\n if (query.length === 0) {\n return scoped.map((command) => ({ command, score: 0 }));\n }\n\n const ranked: RankedCommand[] = [];\n for (const command of scoped) {\n const score = scoreCommand(command, query);\n if (score > 0) {\n ranked.push({ command, score });\n }\n }\n // Stable within equal scores: the sort is stable in V8, so registration\n // order breaks ties.\n ranked.sort((a, b) => b.score - a.score);\n return ranked;\n };\n}\n\n/** @internal Scores one command against a lower-cased query; `0` means no match. */\nfunction scoreCommand(command: CngxCommand, query: string): number {\n const label = command.label.toLowerCase();\n if (label === query) {\n return 100;\n }\n if (label.startsWith(query)) {\n return 80;\n }\n if (label.includes(query)) {\n return 60;\n }\n for (const keyword of command.keywords ?? []) {\n const value = keyword.toLowerCase();\n if (value === query) {\n return 50;\n }\n if (value.startsWith(query)) {\n return 40;\n }\n if (value.includes(query)) {\n return 20;\n }\n }\n return 0;\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { createDefaultCommandMatcher, type CngxCommandMatcher } from './match';\n\n/**\n * Factory producing a {@link CngxCommandMatcher}. The exact signature is\n * captured so an override matches it precisely.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandMatchFactory = () => CngxCommandMatcher;\n\n/**\n * Swappable match-strategy seam. Defaults to {@link createDefaultCommandMatcher}\n * (pure label/keyword ranking). Override it - app-wide via `providers` or\n * per-component via `viewProviders` - to drop in a fuzzy/Levenshtein ranker\n * without touching the panel. The fuzzy engine stays a consumer swap; the\n * default bundle ships only the pure ranker.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport const CNGX_COMMAND_MATCH_FACTORY = new InjectionToken<CngxCommandMatchFactory>(\n 'CNGX_COMMAND_MATCH_FACTORY',\n { providedIn: 'root', factory: () => createDefaultCommandMatcher },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAoBA;;;;;;;;AAQG;MACU,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,eAAe,CAAC,GAAG,OAA4B,EAAA;IAC7D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACnG;AAEA;;;;;;;;;;;AAWG;SACa,cAAc,GAAA;AAC5B,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AACrE,IAAA,OAAO,QAAQ,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAC9E;AAEA;AACA,SAAS,UAAU,CAAC,MAAyB,EAAA;AAC3C,IAAA,OAAO,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM;AACzD;AAEA;;;AAGG;AACH,SAAS,aAAa,CAAC,CAAyB,EAAE,CAAyB,EAAA;AACzE,IAAA,IAAI,CAAC,KAAK,CAAC,EAAE;AACX,QAAA,OAAO,IAAI;IACb;IACA,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;AACzB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,KA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AK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,EAAE;IACX;IACA,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,EAAE,EAAE;AAC5C,QAAA,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE;AACnC,QAAA,IAAI,KAAK,KAAK,KAAK,EAAE;AACnB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AAC3B,YAAA,OAAO,EAAE;QACX;AACA,QAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACzB,YAAA,OAAO,EAAE;QACX;IACF;AACA,IAAA,OAAO,CAAC;AACV;;AC3EA;;;;;;;;;AASG;MACU,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B,EAC5B,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,2BAA2B,EAAE;;ACzBpE;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-common-command.mjs","sources":["../../../projects/common/command/provide-commands.ts","../../../projects/common/command/match.ts","../../../projects/common/command/match-strategy.token.ts","../../../projects/common/command/cngx-common-command.ts"],"sourcesContent":["import {\n computed,\n EnvironmentInjector,\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n} from '@angular/core';\n\nimport type { CngxCommand } from './command';\n\n/**\n * A command contribution. Either a static list or a reactive `Signal` of\n * commands - a signal source lets a contributor add or remove commands (or\n * flip a command's `disabled`) live, and `injectCommands` tracks it.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandSource = Signal<readonly CngxCommand[]> | readonly CngxCommand[];\n\n/**\n * Multi-token every `provideCommands` call contributes to. App parts register\n * command sets against it without a central list, mirroring `provideCngxMenu`.\n * The generic is the collected array (as with Angular's `HTTP_INTERCEPTORS`),\n * so `inject(CNGX_COMMAND_SOURCE)` returns the sources of the nearest level\n * that provides it.\n *\n * This is the low-level form. Register through `provideCommands`, which also\n * carries a level's sources into every scope below it. A raw multi-provider on\n * this token is carried down only from a level that also calls\n * `provideCommands`; on any other level it is read only when that level is the\n * one `injectCommands` resolves as nearest.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport const CNGX_COMMAND_SOURCE = new InjectionToken<readonly CngxCommandSource[]>(\n 'CNGX_COMMAND_SOURCE',\n);\n\n/**\n * @internal Per-level registry: the sources of every `provideCommands` level\n * above, plus this level's own. Resolved once per injector by the factory in\n * `provideCommands`; not part of the public API.\n */\nconst CNGX_COMMAND_REGISTRY = new InjectionToken<readonly CngxCommandSource[]>(\n 'CNGX_COMMAND_REGISTRY',\n);\n\n/**\n * Registers one or more command sources. Each source becomes a `multi` entry\n * on {@link CNGX_COMMAND_SOURCE}; call `provideCommands` from several app parts\n * and `injectCommands` merges all of them.\n *\n * Returns `Provider[]` (not `EnvironmentProviders`), so it registers at any\n * injector scope - app root, a lazy route, or a component's `providers` /\n * `viewProviders` - letting a route or component contribute a scoped command\n * set without reaching for the raw {@link CNGX_COMMAND_SOURCE} multi-provider.\n *\n * A scoped call adds to the sets above it and never hides them, across route\n * and component scopes: root and route scopes come first (outer to inner), then\n * component scopes outer to inner. The same source reference registered at two\n * levels is listed once. Command ids are unique in the merged list: a command\n * whose `id` is already registered further out replaces that command in place,\n * so a scope can swap a global command for its own version.\n *\n * ```ts\n * // app root\n * bootstrapApplication(AppComponent, { providers: [provideCommands(fileCommands)] });\n * // a lazy route adds its set; its pages see fileCommands + reportCommands\n * { path: 'reports', providers: [provideCommands(reportCommands)], component: Reports }\n * // or component scope\n * @Component({ viewProviders: [provideCommands(editorCommands)] })\n * ```\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function provideCommands(...sources: CngxCommandSource[]): Provider[] {\n // Empty call: the parent registry flows through untouched.\n if (sources.length === 0) {\n return [];\n }\n return [\n ...sources.map((source) => ({ provide: CNGX_COMMAND_SOURCE, useValue: source, multi: true })),\n {\n provide: CNGX_COMMAND_REGISTRY,\n // The nearest CNGX_COMMAND_SOURCE is this level's own multi list, so the\n // same factory works for environment, providers and viewProviders scopes.\n useFactory: () =>\n mergeSources(\n inject(CNGX_COMMAND_REGISTRY, { skipSelf: true, optional: true }) ?? [],\n inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? [],\n ),\n },\n ];\n}\n\n/**\n * Merges the command sources registered at this injector level and every level\n * above it - route and component scopes alike - into one reactive\n * `Signal<readonly CngxCommand[]>`. The merge carries an explicit `equal`\n * (length + per-command identity) so re-emitting an identical set - the same\n * command references in the same order - does not produce a fresh array and\n * cascade the downstream match `computed()`.\n *\n * Must run in an injection context.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function injectCommands(): Signal<readonly CngxCommand[]> {\n // A node resolves its element chain before its environment chain, so a\n // routed component under a shell registry never reaches the route's\n // registry. Read both trees once and join them: environment scopes first.\n const sources = mergeSources(\n inject(EnvironmentInjector).get(CNGX_COMMAND_REGISTRY, null) ?? [],\n inject(CNGX_COMMAND_REGISTRY, { optional: true }) ?? [],\n inject(CNGX_COMMAND_SOURCE, { optional: true }) ?? [],\n );\n return computed(() => dedupeById(sources.flatMap(readSource)), { equal: commandsEqual });\n}\n\n/**\n * @internal Keeps one command per `id`: the last registration (the innermost\n * scope) wins, at the position of the first. A Map keeps a key's insertion slot\n * when its value is replaced.\n */\nfunction dedupeById(commands: readonly CngxCommand[]): readonly CngxCommand[] {\n const byId = new Map<string, CngxCommand>();\n for (const command of commands) {\n byId.set(command.id, command);\n }\n return byId.size === commands.length ? commands : [...byId.values()];\n}\n\n/** @internal Concatenates in argument order and drops repeated source references. */\nfunction mergeSources(...lists: (readonly CngxCommandSource[])[]): readonly CngxCommandSource[] {\n return [...new Set(lists.flat())];\n}\n\n/** @internal Reads a source, unwrapping a signal or passing an array through. */\nfunction readSource(source: CngxCommandSource): readonly CngxCommand[] {\n return typeof source === 'function' ? source() : source;\n}\n\n/**\n * @internal Length + per-command identity. Identity subsumes id equality, so a\n * re-provided set of the same references short-circuits without re-emitting.\n */\nfunction commandsEqual(a: readonly CngxCommand[], b: readonly CngxCommand[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every((command, i) => command === b[i]);\n}\n","import type { Signal } from '@angular/core';\nimport { foldForMatching } from '@cngx/core/utils';\n\nimport type { CngxCommand } from './command';\n\n/**\n * A command paired with its match score for a given query. Higher scores rank\n * first. The palette renders these in order; the row slot reads `command` and\n * the term to highlight.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport interface CngxRankedCommand {\n /** The matched command. */\n readonly command: CngxCommand;\n /** Relevance score for the query; higher ranks first. `0` for an empty query. */\n readonly score: number;\n}\n\n/**\n * @deprecated Use {@link CngxRankedCommand}. Published under the unprefixed\n * name by mistake; the alias remains for compatibility and will be removed in\n * a future major.\n * @category common/command\n * @since 0.1.0\n */\nexport type RankedCommand = CngxRankedCommand;\n\n/**\n * Ranks and filters a command set against a query and optional scope. Swappable\n * via {@link CNGX_COMMAND_MATCH_FACTORY} - a consumer drops in Levenshtein or a\n * fuzzy engine without touching the panel.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandMatcher = (\n commands: readonly CngxCommand[],\n term: string,\n scope?: string,\n) => readonly CngxRankedCommand[];\n\n/**\n * Builds the default matcher: a pure label/keyword ranker. An empty query\n * returns every (scoped) command at score `0` in registration order; a\n * non-empty query keeps only commands that match label or keyword, ranked\n * label-exact > label-prefix > label-substring > keyword. The optional scope\n * filters to commands whose `group` equals it.\n *\n * Query, labels and keywords are compared case- and accent-tolerant\n * ({@link foldForMatching}): `uber` finds `Über`. Pass the app locale (the\n * default `CNGX_COMMAND_MATCH_FACTORY` passes `injectLocale()`) so case folds\n * by its rules, e.g. Turkish `I` / `ı`; read inside a `computed()`, a locale\n * switch re-ranks.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport function createDefaultCommandMatcher(locale?: Signal<string>): CngxCommandMatcher {\n // Folded label and keywords per command, re-folded only when the label, the\n // keywords array or the locale changes - not on every keystroke.\n const folded = new WeakMap<CngxCommand, FoldedCommand>();\n const foldedFor = (command: CngxCommand, activeLocale: string | undefined): FoldedCommand => {\n const hit = folded.get(command);\n if (\n hit !== undefined &&\n hit.locale === activeLocale &&\n hit.sourceLabel === command.label &&\n hit.sourceKeywords === command.keywords\n ) {\n return hit;\n }\n const entry: FoldedCommand = {\n locale: activeLocale,\n sourceLabel: command.label,\n sourceKeywords: command.keywords,\n label: foldForMatching(command.label, activeLocale),\n keywords: (command.keywords ?? []).map((keyword) => foldForMatching(keyword, activeLocale)),\n };\n folded.set(command, entry);\n return entry;\n };\n\n return (commands, term, scope) => {\n const scoped = scope ? commands.filter((command) => command.group === scope) : commands;\n const activeLocale = locale?.();\n const query = foldForMatching(term.trim(), activeLocale);\n if (query.length === 0) {\n return scoped.map((command) => ({ command, score: 0 }));\n }\n\n const ranked: CngxRankedCommand[] = [];\n for (const command of scoped) {\n const score = scoreCommand(foldedFor(command, activeLocale), query);\n if (score > 0) {\n ranked.push({ command, score });\n }\n }\n // Stable within equal scores: the sort is stable in V8, so registration\n // order breaks ties.\n ranked.sort((a, b) => b.score - a.score);\n return ranked;\n };\n}\n\n/** @internal A command's label and keywords, folded for one locale. */\ninterface FoldedCommand {\n readonly locale: string | undefined;\n readonly sourceLabel: string;\n readonly sourceKeywords: CngxCommand['keywords'];\n readonly label: string;\n readonly keywords: readonly string[];\n}\n\n/** @internal Scores one folded command against a folded query; `0` means no match. */\nfunction scoreCommand({ label, keywords }: FoldedCommand, query: string): number {\n if (label === query) {\n return 100;\n }\n if (label.startsWith(query)) {\n return 80;\n }\n if (label.includes(query)) {\n return 60;\n }\n for (const value of keywords) {\n if (value === query) {\n return 50;\n }\n if (value.startsWith(query)) {\n return 40;\n }\n if (value.includes(query)) {\n return 20;\n }\n }\n return 0;\n}\n","import { InjectionToken } from '@angular/core';\nimport { injectLocale } from '@cngx/core/utils';\n\nimport { createDefaultCommandMatcher, type CngxCommandMatcher } from './match';\n\n/**\n * Factory producing a {@link CngxCommandMatcher}. The exact signature is\n * captured so an override matches it precisely. The panel calls it in an\n * injection context, so a factory may `inject()` what its matcher needs.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport type CngxCommandMatchFactory = () => CngxCommandMatcher;\n\n/**\n * Swappable match-strategy seam. Defaults to {@link createDefaultCommandMatcher}\n * (pure label/keyword ranking, case- and accent-tolerant in the app locale). Override it - app-wide via `providers` or\n * per-component via `viewProviders` - to drop in a fuzzy/Levenshtein ranker\n * without touching the panel. The fuzzy engine stays a consumer swap; the\n * default bundle ships only the pure ranker.\n *\n * @category common/command\n * @since 0.1.0\n */\nexport const CNGX_COMMAND_MATCH_FACTORY = new InjectionToken<CngxCommandMatchFactory>(\n 'CNGX_COMMAND_MATCH_FACTORY',\n { providedIn: 'root', factory: () => () => createDefaultCommandMatcher(injectLocale()) },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAqBA;;;;;;;;;;;;;;;AAeG;MACU,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;;AAIG;AACH,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAC9C,uBAAuB,CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACG,SAAU,eAAe,CAAC,GAAG,OAA4B,EAAA;;AAE7D,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACxB,QAAA,OAAO,EAAE;IACX;IACA,OAAO;QACL,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7F,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;;;AAG9B,YAAA,UAAU,EAAE,MACV,YAAY,CACV,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,Q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