@xemahq/ui-kernel 0.4.1 → 0.6.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.
Files changed (83) hide show
  1. package/README.md +19 -0
  2. package/dist/lib/biome-host/define-web-biome.d.ts +0 -1
  3. package/dist/lib/biome-host/define-web-biome.d.ts.map +1 -1
  4. package/dist/lib/biome-host/define-web-biome.js +0 -1
  5. package/dist/lib/biome-host/define-web-biome.js.map +1 -1
  6. package/dist/lib/biome-host/frontend-biome.d.ts +0 -2
  7. package/dist/lib/biome-host/frontend-biome.d.ts.map +1 -1
  8. package/dist/lib/biome-host/index.d.ts +2 -1
  9. package/dist/lib/biome-host/index.d.ts.map +1 -1
  10. package/dist/lib/biome-host/index.js +2 -1
  11. package/dist/lib/biome-host/index.js.map +1 -1
  12. package/dist/lib/biome-host/use-mutation-with-error-toast.d.ts +10 -0
  13. package/dist/lib/biome-host/use-mutation-with-error-toast.d.ts.map +1 -0
  14. package/dist/lib/biome-host/use-mutation-with-error-toast.js +35 -0
  15. package/dist/lib/biome-host/use-mutation-with-error-toast.js.map +1 -0
  16. package/dist/lib/biome-host/use-page-state.d.ts +4 -0
  17. package/dist/lib/biome-host/use-page-state.d.ts.map +1 -0
  18. package/dist/lib/biome-host/use-page-state.js +140 -0
  19. package/dist/lib/biome-host/use-page-state.js.map +1 -0
  20. package/dist/ui/chrome/confirm-delete-dialog.d.ts +11 -0
  21. package/dist/ui/chrome/confirm-delete-dialog.d.ts.map +1 -0
  22. package/dist/ui/chrome/confirm-delete-dialog.js +10 -0
  23. package/dist/ui/chrome/confirm-delete-dialog.js.map +1 -0
  24. package/dist/ui/chrome/page-shell.d.ts +27 -0
  25. package/dist/ui/chrome/page-shell.d.ts.map +1 -0
  26. package/dist/ui/chrome/page-shell.js +19 -0
  27. package/dist/ui/chrome/page-shell.js.map +1 -0
  28. package/dist/ui/chrome/scope-badge.d.ts +9 -0
  29. package/dist/ui/chrome/scope-badge.d.ts.map +1 -0
  30. package/dist/ui/chrome/scope-badge.js +10 -0
  31. package/dist/ui/chrome/scope-badge.js.map +1 -0
  32. package/dist/ui/chrome/status-badge.d.ts +11 -0
  33. package/dist/ui/chrome/status-badge.d.ts.map +1 -0
  34. package/dist/ui/chrome/status-badge.js +30 -0
  35. package/dist/ui/chrome/status-badge.js.map +1 -0
  36. package/dist/ui/design-tokens.d.ts +72 -0
  37. package/dist/ui/design-tokens.d.ts.map +1 -0
  38. package/dist/ui/design-tokens.js +251 -0
  39. package/dist/ui/design-tokens.js.map +1 -0
  40. package/dist/ui/hooks/use-debounced-value.d.ts +2 -0
  41. package/dist/ui/hooks/use-debounced-value.d.ts.map +1 -0
  42. package/dist/ui/hooks/use-debounced-value.js +13 -0
  43. package/dist/ui/hooks/use-debounced-value.js.map +1 -0
  44. package/dist/ui/index.d.ts +8 -0
  45. package/dist/ui/index.d.ts.map +1 -1
  46. package/dist/ui/index.js +14 -1
  47. package/dist/ui/index.js.map +1 -1
  48. package/dist/ui/primitives/async-combobox.d.ts +19 -0
  49. package/dist/ui/primitives/async-combobox.d.ts.map +1 -0
  50. package/dist/ui/primitives/async-combobox.js +42 -0
  51. package/dist/ui/primitives/async-combobox.js.map +1 -0
  52. package/dist/ui/primitives/form-stepper.d.ts +19 -0
  53. package/dist/ui/primitives/form-stepper.d.ts.map +1 -0
  54. package/dist/ui/primitives/form-stepper.js +23 -0
  55. package/dist/ui/primitives/form-stepper.js.map +1 -0
  56. package/package.json +1 -1
  57. package/src/lib/biome-host/define-web-biome.ts +5 -11
  58. package/src/lib/biome-host/frontend-biome.ts +2 -14
  59. package/src/lib/biome-host/index.ts +2 -1
  60. package/src/lib/biome-host/use-mutation-with-error-toast.ts +88 -0
  61. package/src/lib/biome-host/use-page-state.ts +231 -0
  62. package/src/ui/chrome/confirm-delete-dialog.tsx +59 -0
  63. package/src/ui/chrome/page-shell.tsx +165 -0
  64. package/src/ui/chrome/scope-badge.tsx +40 -0
  65. package/src/ui/chrome/status-badge.tsx +75 -0
  66. package/src/ui/design-tokens.ts +346 -0
  67. package/src/ui/hooks/use-debounced-value.ts +16 -0
  68. package/src/ui/index.ts +15 -0
  69. package/src/ui/primitives/async-combobox.tsx +178 -0
  70. package/src/ui/primitives/form-stepper.tsx +109 -0
  71. package/dist/lib/biome-host/composition-validation.d.ts +0 -22
  72. package/dist/lib/biome-host/composition-validation.d.ts.map +0 -1
  73. package/dist/lib/biome-host/composition-validation.js +0 -127
  74. package/dist/lib/biome-host/composition-validation.js.map +0 -1
  75. package/dist/lib/biome-host/nav.d.ts +0 -17
  76. package/dist/lib/biome-host/nav.d.ts.map +0 -1
  77. package/dist/lib/biome-host/nav.js +0 -52
  78. package/dist/lib/biome-host/nav.js.map +0 -1
  79. package/dist/registry/lib/composition-validation-host.d.ts +0 -3
  80. package/dist/registry/lib/composition-validation-host.d.ts.map +0 -1
  81. package/dist/registry/lib/composition-validation-host.js +0 -10
  82. package/dist/registry/lib/composition-validation-host.js.map +0 -1
  83. package/src/lib/biome-host/nav.ts +0 -83
@@ -1,22 +0,0 @@
1
- import type { FrontendBiome } from './frontend-biome';
2
- export declare enum CompositionDiagnosticSeverity {
3
- Error = "error",
4
- Warning = "warning"
5
- }
6
- export declare enum CompositionDiagnosticCode {
7
- DuplicateRoutePath = "duplicate_route_path",
8
- DuplicateNavId = "duplicate_nav_id",
9
- UnknownSlot = "unknown_slot",
10
- OrphanedPanelSlot = "orphaned_panel_slot"
11
- }
12
- export interface CompositionDiagnostic {
13
- readonly code: CompositionDiagnosticCode;
14
- readonly severity: CompositionDiagnosticSeverity;
15
- readonly biomeIds: readonly string[];
16
- readonly message: string;
17
- }
18
- export interface ValidateBiomeCompositionOptions {
19
- readonly knownSlots: ReadonlySet<string>;
20
- }
21
- export declare function validateBiomeComposition(biomes: readonly FrontendBiome[], options: ValidateBiomeCompositionOptions): readonly CompositionDiagnostic[];
22
- //# sourceMappingURL=composition-validation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition-validation.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/composition-validation.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,oBAAY,6BAA6B;IAMvC,KAAK,UAAU;IAOf,OAAO,YAAY;CACpB;AAGD,oBAAY,yBAAyB;IAEnC,kBAAkB,yBAAyB;IAE3C,cAAc,qBAAqB;IAKnC,WAAW,iBAAiB;IAK5B,iBAAiB,wBAAwB;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;IAEjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,+BAA+B;IAM9C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1C;AAwBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,+BAA+B,GACvC,SAAS,qBAAqB,EAAE,CA6FlC"}
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompositionDiagnosticCode = exports.CompositionDiagnosticSeverity = void 0;
4
- exports.validateBiomeComposition = validateBiomeComposition;
5
- var CompositionDiagnosticSeverity;
6
- (function (CompositionDiagnosticSeverity) {
7
- CompositionDiagnosticSeverity["Error"] = "error";
8
- CompositionDiagnosticSeverity["Warning"] = "warning";
9
- })(CompositionDiagnosticSeverity || (exports.CompositionDiagnosticSeverity = CompositionDiagnosticSeverity = {}));
10
- var CompositionDiagnosticCode;
11
- (function (CompositionDiagnosticCode) {
12
- CompositionDiagnosticCode["DuplicateRoutePath"] = "duplicate_route_path";
13
- CompositionDiagnosticCode["DuplicateNavId"] = "duplicate_nav_id";
14
- CompositionDiagnosticCode["UnknownSlot"] = "unknown_slot";
15
- CompositionDiagnosticCode["OrphanedPanelSlot"] = "orphaned_panel_slot";
16
- })(CompositionDiagnosticCode || (exports.CompositionDiagnosticCode = CompositionDiagnosticCode = {}));
17
- function biomeOwnedSlotOwner(slot) {
18
- const slashIndex = slot.indexOf('/');
19
- if (slashIndex <= 0)
20
- return null;
21
- if (slot.indexOf('/', slashIndex + 1) !== -1)
22
- return null;
23
- const owner = slot.slice(0, slashIndex);
24
- const name = slot.slice(slashIndex + 1);
25
- if (owner.length === 0 || name.length === 0)
26
- return null;
27
- return owner;
28
- }
29
- function validateBiomeComposition(biomes, options) {
30
- const diagnostics = [];
31
- const biomeIds = new Set(biomes.map((b) => b.id));
32
- const routeOwners = new Map();
33
- for (const biome of biomes) {
34
- for (const route of biome.routes ?? []) {
35
- const scope = route.projectScoped ? 'project' : 'root';
36
- const key = `${scope}:${route.path}`;
37
- const owners = routeOwners.get(key);
38
- if (owners)
39
- owners.push(biome.id);
40
- else
41
- routeOwners.set(key, [biome.id]);
42
- }
43
- }
44
- for (const [key, owners] of routeOwners) {
45
- if (owners.length < 2)
46
- continue;
47
- const [scope, path] = splitFirst(key, ':');
48
- diagnostics.push({
49
- code: CompositionDiagnosticCode.DuplicateRoutePath,
50
- severity: CompositionDiagnosticSeverity.Error,
51
- biomeIds: owners,
52
- message: `Route path '${path}' (${scope}-scoped) is contributed by multiple biomes: ` +
53
- `${owners.join(', ')}. Each route must be unique within its scope — ` +
54
- `only one would mount and the others would be unreachable.`,
55
- });
56
- }
57
- const navOwners = new Map();
58
- for (const biome of biomes) {
59
- for (const navItem of biome.navItems ?? []) {
60
- const owners = navOwners.get(navItem.id);
61
- if (owners)
62
- owners.push(biome.id);
63
- else
64
- navOwners.set(navItem.id, [biome.id]);
65
- }
66
- }
67
- for (const [navId, owners] of navOwners) {
68
- if (owners.length < 2)
69
- continue;
70
- diagnostics.push({
71
- code: CompositionDiagnosticCode.DuplicateNavId,
72
- severity: CompositionDiagnosticSeverity.Error,
73
- biomeIds: owners,
74
- message: `Nav id '${navId}' is contributed by multiple biomes: ${owners.join(', ')}. ` +
75
- `Nav ids must be unique — a duplicate silently overwrites the ` +
76
- `feature-route mapping and collides as a render key.`,
77
- });
78
- }
79
- for (const biome of biomes) {
80
- for (const panel of biome.panels ?? []) {
81
- if (options.knownSlots.has(panel.slot))
82
- continue;
83
- const owner = biomeOwnedSlotOwner(panel.slot);
84
- if (owner === null) {
85
- diagnostics.push({
86
- code: CompositionDiagnosticCode.UnknownSlot,
87
- severity: CompositionDiagnosticSeverity.Warning,
88
- biomeIds: [biome.id],
89
- message: `Biome '${biome.id}' panel '${panel.id}' targets slot '${panel.slot}', ` +
90
- `which is neither a known host slot nor a well-formed ` +
91
- `'<owner>/<name>' biome-owned slot. It will never render — ` +
92
- `check for a typo against the host slot catalog.`,
93
- });
94
- continue;
95
- }
96
- if (!biomeIds.has(owner)) {
97
- diagnostics.push({
98
- code: CompositionDiagnosticCode.OrphanedPanelSlot,
99
- severity: CompositionDiagnosticSeverity.Warning,
100
- biomeIds: [biome.id],
101
- message: `Biome '${biome.id}' panel '${panel.id}' targets biome-owned slot ` +
102
- `'${panel.slot}', but its owner biome '${owner}' is not registered. ` +
103
- `The panel will never render until '${owner}' is enabled.`,
104
- });
105
- }
106
- }
107
- }
108
- return sortDiagnostics(diagnostics);
109
- }
110
- function splitFirst(value, sep) {
111
- const idx = value.indexOf(sep);
112
- if (idx === -1)
113
- return [value, ''];
114
- return [value.slice(0, idx), value.slice(idx + sep.length)];
115
- }
116
- function sortDiagnostics(diagnostics) {
117
- return diagnostics.slice().sort((a, b) => {
118
- if (a.code !== b.code)
119
- return a.code.localeCompare(b.code);
120
- const ai = a.biomeIds.join(',');
121
- const bi = b.biomeIds.join(',');
122
- if (ai !== bi)
123
- return ai.localeCompare(bi);
124
- return a.message.localeCompare(b.message);
125
- });
126
- }
127
- //# sourceMappingURL=composition-validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition-validation.js","sourceRoot":"","sources":["../../../src/lib/biome-host/composition-validation.ts"],"names":[],"mappings":";;;AAkGA,4DAgGC;AA1KD,IAAY,6BAcX;AAdD,WAAY,6BAA6B;IAMvC,gDAAe,CAAA;IAOf,oDAAmB,CAAA;AACrB,CAAC,EAdW,6BAA6B,6CAA7B,6BAA6B,QAcxC;AAGD,IAAY,yBAeX;AAfD,WAAY,yBAAyB;IAEnC,wEAA2C,CAAA;IAE3C,gEAAmC,CAAA;IAKnC,yDAA4B,CAAA;IAK5B,sEAAyC,CAAA;AAC3C,CAAC,EAfW,yBAAyB,yCAAzB,yBAAyB,QAepC;AA0BD,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC;AAQD,SAAgB,wBAAwB,CACtC,MAAgC,EAChC,OAAwC;IAExC,MAAM,WAAW,GAA4B,EAAE,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAMlD,MAAM,WAAW,GAAG,IAAI,GAAG,E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AC3D,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { ComponentType } from 'react';
2
- export interface NavItem {
3
- readonly key: string;
4
- readonly label: string;
5
- readonly icon?: ComponentType<{
6
- className?: string | undefined;
7
- }> | undefined;
8
- readonly weight?: number | undefined;
9
- readonly fromBiome?: boolean | undefined;
10
- }
11
- export interface NavSection {
12
- readonly heading?: string | undefined;
13
- readonly items: readonly NavItem[];
14
- }
15
- export declare function mergeNavSections(coreSections: readonly NavSection[]): readonly NavSection[];
16
- export declare function mergeFeatureRouteMap(coreFeatureRoutes: Readonly<Record<string, string>>): Record<string, string>;
17
- //# sourceMappingURL=nav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;CACpC;AAUD,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,UAAU,EAAE,CAsC3F;AAQD,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAClD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeNavSections = mergeNavSections;
4
- exports.mergeFeatureRouteMap = mergeFeatureRouteMap;
5
- const biome_registry_1 = require("./biome-registry");
6
- function mergeNavSections(coreSections) {
7
- const sectionMap = new Map();
8
- const sectionOrder = [];
9
- for (const section of coreSections) {
10
- const heading = section.heading ?? '';
11
- sectionOrder.push(heading);
12
- sectionMap.set(heading, [...section.items]);
13
- }
14
- for (const biome of biome_registry_1.biomeRegistry.list()) {
15
- for (const navItem of biome.navItems ?? []) {
16
- const heading = navItem.section ?? '';
17
- let bucket = sectionMap.get(heading);
18
- if (!bucket) {
19
- bucket = [];
20
- sectionOrder.push(heading);
21
- sectionMap.set(heading, bucket);
22
- }
23
- bucket.push({
24
- key: navItem.id,
25
- label: navItem.label,
26
- icon: navItem.icon,
27
- weight: navItem.weight,
28
- fromBiome: true,
29
- });
30
- }
31
- }
32
- return sectionOrder.map((heading) => ({
33
- heading: heading === '' ? undefined : heading,
34
- items: (sectionMap.get(heading) ?? []).slice().sort((a, b) => {
35
- const wa = a.weight ?? 100;
36
- const wb = b.weight ?? 100;
37
- if (wa !== wb)
38
- return wa - wb;
39
- return a.key.localeCompare(b.key);
40
- }),
41
- }));
42
- }
43
- function mergeFeatureRouteMap(coreFeatureRoutes) {
44
- const out = { ...coreFeatureRoutes };
45
- for (const biome of biome_registry_1.biomeRegistry.list()) {
46
- for (const navItem of biome.navItems ?? []) {
47
- out[navItem.id] = navItem.route;
48
- }
49
- }
50
- return out;
51
- }
52
- //# sourceMappingURL=nav.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nav.js","sourceRoot":"","sources":["../../../src/lib/biome-host/nav.ts"],"names":[],"mappings":";;AA0BA,4CAsCC;AAQD,oDAUC;AAhFD,qDAAiD;AAwBjD,SAAgB,gBAAgB,CAAC,YAAmC;IAClE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAC;IAChD,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;QACtC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,8BAAa,CAAC,IAAI,EAAE,EAAE,CAAC;QACzC,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;YAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;YACtC,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,GAAG,EAAE,CAAC;gBACZ,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC3B,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,EAAE,OAAO,CA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ome } from '../../index';
2
- export declare function validateHostBiomeComposition(biomes: readonly FrontendBiome[]): readonly CompositionDiagnostic[];
3
- //# sourceMappingURL=composition-validation-host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition-validation-host.d.ts","sourceRoot":"","sources":["../../../src/registry/lib/composition-validation-host.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,SAAS,qBAAqB,EAAE,CAElC"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateHostBiomeComposition = validateHostBiomeComposition;
4
- const index_1 = require("../../index");
5
- const extension_points_1 = require("./extension-points");
6
- const HOST_SLOT_IDS = new Set(Object.values(extension_points_1.HostExtensionSlots));
7
- function validateHostBiomeComposition(biomes) {
8
- return (0, index_1.validateBiomeComposition)(biomes, { knownSlots: HOST_SLOT_IDS });
9
- }
10
- //# sourceMappingURL=composition-validation-host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition-validation-host.js","sourceRoot":"","sources":["../../../src/registry/lib/composition-validation-host.ts"],"names":[],"mappings":";;AAgCA,oEAIC;AA1BD,uCAIqB;AAErB,yDAAwD;AAOxD,MAAM,aAAa,GAAwB,IAAI,GAAG,CAChD,MAAM,CAAC,MAAM,CAAC,qCAAkB,CAAC,CAClC,CAAC;AAOF,SAAgB,4BAA4B,CAC1C,MAAgC;IAEhC,OAAO,IAAA,gCAAwB,EAAC,MAAM,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;AACzE,CAAC"}
@@ -1,83 +0,0 @@
1
- import type { ComponentType } from 'react';
2
-
3
- import { biomeRegistry } from './biome-registry';
4
-
5
- export interface NavItem {
6
- readonly key: string;
7
- readonly label: string;
8
- readonly icon?: ComponentType<{ className?: string | undefined }> | undefined;
9
- readonly weight?: number | undefined;
10
- /** True when this item came from a biome contribution. */
11
- readonly fromBiome?: boolean | undefined;
12
- }
13
-
14
- export interface NavSection {
15
- readonly heading?: string | undefined;
16
- readonly items: readonly NavItem[];
17
- }
18
-
19
- /**
20
- * Merge the host's core nav sections with biome nav contributions. Biome
21
- * items are bucketed into the section whose `heading` matches their
22
- * `section` field; if no match exists, a synthetic section is appended.
23
- *
24
- * Sort is deterministic: by `(weight, key)` — every host renders the same
25
- * order from the same registry state, so tests stay reproducible.
26
- */
27
- export function mergeNavSections(coreSections: readonly NavSection[]): readonly NavSection[] {
28
- const sectionMap = new Map<string, NavItem[]>();
29
- const sectionOrder: string[] = [];
30
-
31
- for (const section of coreSections) {
32
- const heading = section.heading ?? '';
33
- sectionOrder.push(heading);
34
- sectionMap.set(heading, [...section.items]);
35
- }
36
-
37
- for (const biome of biomeRegistry.list()) {
38
- for (const navItem of biome.navItems ?? []) {
39
- const heading = navItem.section ?? '';
40
- let bucket = sectionMap.get(heading);
41
- if (!bucket) {
42
- bucket = [];
43
- sectionOrder.push(heading);
44
- sectionMap.set(heading, bucket);
45
- }
46
- bucket.push({
47
- key: navItem.id,
48
- label: navItem.label,
49
- icon: navItem.icon,
50
- weight: navItem.weight,
51
- fromBiome: true,
52
- });
53
- }
54
- }
55
-
56
- return sectionOrder.map((heading) => ({
57
- heading: heading === '' ? undefined : heading,
58
- items: (sectionMap.get(heading) ?? []).slice().sort((a, b) => {
59
- const wa = a.weight ?? 100;
60
- const wb = b.weight ?? 100;
61
- if (wa !== wb) return wa - wb;
62
- return a.key.localeCompare(b.key);
63
- }),
64
- }));
65
- }
66
-
67
- /**
68
- * Build a `{ navKey: routePath }` map merging core feature-key→route entries
69
- * with biome nav-item route paths. Biome-contributed entries win over
70
- * core entries with the same key (intentional — biome authors who pick a
71
- * conflicting id are signalling override intent).
72
- */
73
- export function mergeFeatureRouteMap(
74
- coreFeatureRoutes: Readonly<Record<string, string>>,
75
- ): Record<string, string> {
76
- const out: Record<string, string> = { ...coreFeatureRoutes };
77
- for (const biome of biomeRegistry.list()) {
78
- for (const navItem of biome.navItems ?? []) {
79
- out[navItem.id] = navItem.route;
80
- }
81
- }
82
- return out;
83
- }