@wix/web5-core 1.63.23 → 1.63.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/registry/ComponentRegistry.js +35 -8
- package/dist/cjs/registry/ComponentRegistry.js.map +1 -1
- package/dist/esm/registry/ComponentRegistry.js +35 -8
- package/dist/esm/registry/ComponentRegistry.js.map +1 -1
- package/dist/types/registry/ComponentRegistry.d.ts +4 -0
- package/dist/types/registry/ComponentRegistry.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -25,6 +25,27 @@ function normalizeResolveOptions(intentOrOptions, semantic) {
|
|
|
25
25
|
}
|
|
26
26
|
return intentOrOptions;
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Intent keys are matched case-insensitively.
|
|
31
|
+
*
|
|
32
|
+
* The intent that reaches resolution has already been through
|
|
33
|
+
* `intent.trim().toUpperCase()` — in this package's `intentExtractor`, and
|
|
34
|
+
* again in `web50-server-ui`'s own copy of it, which calls it with no
|
|
35
|
+
* `validIntents` and passes the result as `providedIntent`, bypassing the
|
|
36
|
+
* validated path here. A client that registers its variants in the lowercase
|
|
37
|
+
* spelling its own taxonomy doc uses therefore matched nothing, and every
|
|
38
|
+
* intent-scoped variant silently fell through to the section default.
|
|
39
|
+
*
|
|
40
|
+
* That is not hypothetical: it was true of the whole seed registry. Measured
|
|
41
|
+
* across 11 live answers, 10 rendered the same hero whatever the intent, and
|
|
42
|
+
* one registered hero component never rendered at all. Nothing errors, nothing
|
|
43
|
+
* logs, and the page looks plausible — which is why this belongs at the Map
|
|
44
|
+
* rather than in either extractor.
|
|
45
|
+
*
|
|
46
|
+
* Normalizing on write AND on read makes the spelling a client's own business.
|
|
47
|
+
*/
|
|
48
|
+
const normalizeIntentKey = intent => intent.trim().toUpperCase();
|
|
28
49
|
class ComponentRegistry {
|
|
29
50
|
constructor(fallback) {
|
|
30
51
|
this.fallback = fallback;
|
|
@@ -151,14 +172,14 @@ class ComponentRegistry {
|
|
|
151
172
|
}
|
|
152
173
|
if (intent && semantic) {
|
|
153
174
|
var _node$byIntent;
|
|
154
|
-
const found = (_node$byIntent = node.byIntent) == null || (_node$byIntent = _node$byIntent.get(intent)) == null || (_node$byIntent = _node$byIntent.bySemantic) == null ? void 0 : _node$byIntent.get(semantic);
|
|
175
|
+
const found = (_node$byIntent = node.byIntent) == null || (_node$byIntent = _node$byIntent.get(normalizeIntentKey(intent))) == null || (_node$byIntent = _node$byIntent.bySemantic) == null ? void 0 : _node$byIntent.get(semantic);
|
|
155
176
|
if (found) {
|
|
156
177
|
return found;
|
|
157
178
|
}
|
|
158
179
|
}
|
|
159
180
|
if (intent) {
|
|
160
181
|
var _node$byIntent2;
|
|
161
|
-
const found = (_node$byIntent2 = node.byIntent) == null || (_node$byIntent2 = _node$byIntent2.get(intent)) == null ? void 0 : _node$byIntent2.default;
|
|
182
|
+
const found = (_node$byIntent2 = node.byIntent) == null || (_node$byIntent2 = _node$byIntent2.get(normalizeIntentKey(intent))) == null ? void 0 : _node$byIntent2.default;
|
|
162
183
|
if (found) {
|
|
163
184
|
return found;
|
|
164
185
|
}
|
|
@@ -229,14 +250,14 @@ class ComponentRegistry {
|
|
|
229
250
|
}
|
|
230
251
|
if (intent && semantic) {
|
|
231
252
|
var _node$byIntent3;
|
|
232
|
-
const found = (_node$byIntent3 = node.byIntent) == null || (_node$byIntent3 = _node$byIntent3.get(intent)) == null || (_node$byIntent3 = _node$byIntent3.bySemantic) == null ? void 0 : _node$byIntent3.get(semantic);
|
|
253
|
+
const found = (_node$byIntent3 = node.byIntent) == null || (_node$byIntent3 = _node$byIntent3.get(normalizeIntentKey(intent))) == null || (_node$byIntent3 = _node$byIntent3.bySemantic) == null ? void 0 : _node$byIntent3.get(semantic);
|
|
233
254
|
if (found) {
|
|
234
255
|
return found;
|
|
235
256
|
}
|
|
236
257
|
}
|
|
237
258
|
if (intent) {
|
|
238
259
|
var _node$byIntent4;
|
|
239
|
-
const found = (_node$byIntent4 = node.byIntent) == null || (_node$byIntent4 = _node$byIntent4.get(intent)) == null ? void 0 : _node$byIntent4.default;
|
|
260
|
+
const found = (_node$byIntent4 = node.byIntent) == null || (_node$byIntent4 = _node$byIntent4.get(normalizeIntentKey(intent))) == null ? void 0 : _node$byIntent4.default;
|
|
240
261
|
if (found) {
|
|
241
262
|
return found;
|
|
242
263
|
}
|
|
@@ -268,6 +289,10 @@ class ComponentRegistry {
|
|
|
268
289
|
* registered. Assembly uses this to validate an incoming intent before it
|
|
269
290
|
* becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only
|
|
270
291
|
* when a client registers no intent variants at all.
|
|
292
|
+
*
|
|
293
|
+
* Returned NORMALIZED (upper case), whatever spelling the client registered,
|
|
294
|
+
* because these are the map keys. Both consumers compare case-insensitively,
|
|
295
|
+
* so the only visible difference is in a debug view.
|
|
271
296
|
*/
|
|
272
297
|
getKnownIntents() {
|
|
273
298
|
const intents = new Set();
|
|
@@ -435,10 +460,11 @@ class ComponentRegistry {
|
|
|
435
460
|
if (!node.byIntent) {
|
|
436
461
|
node.byIntent = new Map();
|
|
437
462
|
}
|
|
438
|
-
|
|
463
|
+
const key = normalizeIntentKey(intent);
|
|
464
|
+
let intentNode = node.byIntent.get(key);
|
|
439
465
|
if (!intentNode) {
|
|
440
466
|
intentNode = {};
|
|
441
|
-
node.byIntent.set(
|
|
467
|
+
node.byIntent.set(key, intentNode);
|
|
442
468
|
}
|
|
443
469
|
return intentNode;
|
|
444
470
|
}
|
|
@@ -446,10 +472,11 @@ class ComponentRegistry {
|
|
|
446
472
|
if (!node.byIntent) {
|
|
447
473
|
node.byIntent = new Map();
|
|
448
474
|
}
|
|
449
|
-
|
|
475
|
+
const key = normalizeIntentKey(intent);
|
|
476
|
+
let intentNode = node.byIntent.get(key);
|
|
450
477
|
if (!intentNode) {
|
|
451
478
|
intentNode = {};
|
|
452
|
-
node.byIntent.set(
|
|
479
|
+
node.byIntent.set(key, intentNode);
|
|
453
480
|
}
|
|
454
481
|
return intentNode;
|
|
455
482
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["normalizeResolveOptions","intentOrOptions","semantic","intent","ComponentRegistry","constructor","fallback","_defineProperty2","default","Map","registerSlot","name","component","options","node","slots","get","set","intentNode","ensureSlotIntent","bySemantic","register","definition","variants","console","warn","definitions","sectionType","registration","sections","placement","placementId","forPlacementById","forPlacement","ensureSectionIntent","registerAction","handler","actions","resolveSlot","_node$byIntent","found","byIntent","_node$byIntent2","_node$bySemantic","resolveSection","resolveSectionRegistration","resolveSectionOptions","_this$resolveSectionR","undefined","_node$forPlacementByI","byId","_node$byIntent3","_node$byIntent4","_node$bySemantic2","getAllSlots","Array","from","keys","getAllSections","getKnownIntents","intents","Set","values","_node$byIntent5","forEach","_variant","key","add","_node$byIntent6","getAllDefinitions","entries","map","getDefinition","isPlacementOnly","_node$forPlacementByI2","_node$byIntent7","_node$bySemantic3","hasPlacement","size","hasNonPlacement","getSlotVariants","push","getSectionVariants","hasAction","has","executeAction","params","success","message","getRegisteredActions","getCatalog","exports"],"sources":["../../../src/registry/ComponentRegistry.ts"],"sourcesContent":["import type { SectionDefinition } from '../component/componentDefinitions';\nimport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionNode,\n SectionIntentNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ResolveSectionOptions,\n ActionHandler,\n ActionResult,\n} from './types';\n\n/**\n * Accept the legacy positional form `(intent, semantic)` and the new\n * options-object form `({ intent, semantic, placement })`. Returns a\n * normalized `ResolveSectionOptions`.\n */\nfunction normalizeResolveOptions(\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n): ResolveSectionOptions {\n if (intentOrOptions == null) {\n return semantic ? { semantic } : {};\n }\n if (typeof intentOrOptions === 'string') {\n return semantic ? { intent: intentOrOptions, semantic } : { intent: intentOrOptions };\n }\n return intentOrOptions;\n}\n\nexport class ComponentRegistry<C> {\n private slots = new Map<string, SlotNode<C>>();\n private sections = new Map<string, SectionNode<C>>();\n private definitions = new Map<string, SectionDefinition>();\n private actions = new Map<string, ActionHandler>();\n\n constructor(private fallback: C) {}\n\n // ---------------------------------------------------------------------------\n // Registration\n // ---------------------------------------------------------------------------\n\n registerSlot(name: string, component: C, options?: SlotOptions): this {\n let node = this.slots.get(name);\n if (!node) {\n node = {};\n this.slots.set(name, node);\n }\n\n const { intent, semantic } = options ?? {};\n\n if (intent && semantic) {\n const intentNode = this.ensureSlotIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, component);\n } else if (intent) {\n const intentNode = this.ensureSlotIntent(node, intent);\n intentNode.default = component;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, component);\n } else {\n node.default = component;\n }\n\n return this;\n }\n\n register(\n definition: SectionDefinition,\n variants?: SectionRegistration<C>[],\n ): this {\n // Tolerate missing definitions instead of crashing app init. This\n // happens when a client UMD references a `SectionDefinition` symbol\n // that doesn't exist on the consuming bundle's `Web5Core` global\n // (e.g. UMD built against newer `web5-core` than the app bundle).\n // Without this guard a single missing export breaks every other\n // section the client tries to register.\n if (definition == null) {\n // eslint-disable-next-line no-console\n console.warn(\n '[ComponentRegistry] register() called with a null/undefined SectionDefinition — ' +\n 'likely a version skew between the client UMD and web5-core ' +\n '(an exported definition the UMD imports does not exist on this Web5Core). Skipping.',\n );\n return this;\n }\n this.definitions.set(definition.sectionType, definition);\n\n if (variants) {\n const sectionType = definition.sectionType;\n for (const registration of variants) {\n let node = this.sections.get(sectionType);\n if (!node) {\n node = {};\n this.sections.set(sectionType, node);\n }\n const { intent, semantic, placement, placementId } =\n registration.options ?? {};\n\n // Placement variants are stored on their own slot — no further\n // intent/semantic sub-variants (DL #088 D3.1). If a developer also\n // supplies intent/semantic alongside placement, those are ignored for\n // the placement registration. To register both a placement variant AND\n // an intent variant, register them as separate entries.\n if (placement) {\n // Scoped to a specific placement slot id — keyed so one section type\n // can render differently per placement. An id-less placement variant\n // remains the generic fallback.\n if (placementId) {\n if (!node.forPlacementById) {\n node.forPlacementById = new Map();\n }\n node.forPlacementById.set(placementId, registration);\n } else {\n node.forPlacement = registration;\n }\n continue;\n }\n\n if (intent && semantic) {\n const intentNode = this.ensureSectionIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, registration);\n } else if (intent) {\n const intentNode = this.ensureSectionIntent(node, intent);\n intentNode.default = registration;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, registration);\n } else {\n node.default = registration;\n }\n }\n }\n\n return this;\n }\n\n registerAction(name: string, handler: ActionHandler): this {\n this.actions.set(name, handler);\n return this;\n }\n\n // ---------------------------------------------------------------------------\n // Resolution\n // ---------------------------------------------------------------------------\n\n resolveSlot(name: string, intent?: string, semantic?: string): C {\n const node = this.slots.get(name);\n if (!node) {\n return this.fallback;\n }\n\n if (intent && semantic) {\n const found = node.byIntent?.get(intent)?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(intent)?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default ?? this.fallback;\n }\n\n /**\n * Resolve a section component by type, optionally narrowed by intent /\n * semantic / placement.\n *\n * Accepts both call forms for backward compatibility:\n * resolveSection('hero') — default\n * resolveSection('hero', 'DISCOVERY') — intent (legacy positional)\n * resolveSection('hero', 'DISCOVERY', 'compact') — intent + semantic (legacy)\n * resolveSection('hero', { intent: 'DISCOVERY' }) — options object\n * resolveSection('hero', { placement: true }) — placement variant (DL #088 D3.1)\n * resolveSection('hero', { intent: 'X', placement: true }) — placement wins\n */\n resolveSection(sectionType: string, intent?: string, semantic?: string): C;\n resolveSection(sectionType: string, options: ResolveSectionOptions): C;\n resolveSection(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): C {\n const registration = this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n );\n return registration?.component ?? this.fallback;\n }\n\n /**\n * Resolve the options bundle associated with the matched registration.\n * Same overload semantics as `resolveSection`.\n */\n resolveSectionOptions(\n sectionType: string,\n intent?: string,\n semantic?: string,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): SectionOptions | undefined {\n return this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n )?.options;\n }\n\n private resolveSectionRegistration(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionRegistration<C> | undefined {\n const node = this.sections.get(sectionType);\n if (!node) {\n return undefined;\n }\n\n const { intent, semantic, placement, placementId } = options;\n\n // Placement wins over intent / semantic when requested AND a placement\n // variant is registered for this section (DL #088 D3.1). Cascade:\n // id-scoped variant → generic placement variant → regular chain.\n if (placement) {\n if (placementId) {\n const byId = node.forPlacementById?.get(placementId);\n if (byId) {\n return byId;\n }\n }\n if (node.forPlacement) {\n return node.forPlacement;\n }\n }\n\n if (intent && semantic) {\n const found = node.byIntent?.get(intent as string)?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(intent as string)?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default;\n }\n\n // ---------------------------------------------------------------------------\n // Introspection\n // ---------------------------------------------------------------------------\n\n getAllSlots(): string[] {\n return Array.from(this.slots.keys());\n }\n\n getAllSections(): string[] {\n return Array.from(this.sections.keys());\n }\n\n /**\n * Every intent that has at least one registered slot or section variant —\n * i.e. the client's own intent list, derived from what it actually\n * registered. Assembly uses this to validate an incoming intent before it\n * becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only\n * when a client registers no intent variants at all.\n */\n getKnownIntents(): string[] {\n const intents = new Set<string>();\n for (const node of this.slots.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n for (const node of this.sections.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n return Array.from(intents);\n }\n\n getAllDefinitions(): {\n sectionType: string;\n definition: SectionDefinition;\n }[] {\n return Array.from(this.definitions.entries()).map(\n ([sectionType, definition]) => ({\n sectionType,\n definition,\n }),\n );\n }\n\n getDefinition(sectionType: string): SectionDefinition | undefined {\n return this.definitions.get(sectionType);\n }\n\n /**\n * True when a section type was registered with placement variant(s) only —\n * a `{ placement: true }` (or `placementId`) registration and NO\n * non-placement variant (default / intent / semantic). Such a section is\n * meaningful only inside a placement render; the parser skips its definition\n * when matching in a non-placement context (the main app), so its markdown\n * falls through to the generic sections there.\n *\n * A definition registered with no variants at all (structural defs like\n * `skipNodes` / `htmlComment`) is NOT placement-only — it still matches\n * everywhere.\n */\n isPlacementOnly(sectionType: string): boolean {\n const node = this.sections.get(sectionType);\n if (!node) {\n return false;\n }\n const hasPlacement =\n node.forPlacement != null || (node.forPlacementById?.size ?? 0) > 0;\n const hasNonPlacement =\n node.default != null ||\n (node.byIntent?.size ?? 0) > 0 ||\n (node.bySemantic?.size ?? 0) > 0;\n return hasPlacement && !hasNonPlacement;\n }\n\n getSlotVariants(name: string): SlotVariant[] {\n const node = this.slots.get(name);\n if (!node) {\n return [];\n }\n\n const variants: SlotVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n return variants;\n }\n\n getSectionVariants(sectionType: string): SectionVariant[] {\n const node = this.sections.get(sectionType);\n if (!node) {\n return [];\n }\n\n const variants: SectionVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n if (node.forPlacement) {\n variants.push({ placement: true });\n }\n\n if (node.forPlacementById) {\n for (const placementId of node.forPlacementById.keys()) {\n variants.push({ placement: true, placementId });\n }\n }\n\n return variants;\n }\n\n hasAction(name: string): boolean {\n return this.actions.has(name);\n }\n\n async executeAction(\n name: string,\n params: Record<string, string>,\n ): Promise<ActionResult> {\n const handler = this.actions.get(name);\n if (!handler) {\n console.warn(`[Action] No handler for: \"${name}\"`);\n return { success: false, message: `Unknown action: ${name}` };\n }\n return handler(params);\n }\n\n getRegisteredActions(): string[] {\n return Array.from(this.actions.keys());\n }\n\n getCatalog(): RegistryCatalog {\n return {\n slots: this.getAllSlots().map((name) => ({\n name,\n variants: this.getSlotVariants(name),\n })),\n sections: this.getAllSections().map((sectionType) => ({\n name: sectionType,\n variants: this.getSectionVariants(sectionType),\n })),\n definitions: this.getAllDefinitions(),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Private helpers\n // ---------------------------------------------------------------------------\n\n private ensureSectionIntent(\n node: SectionNode<C>,\n intent: string,\n ): SectionIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n let intentNode = node.byIntent.get(intent);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(intent, intentNode);\n }\n return intentNode;\n }\n\n private ensureSlotIntent(\n node: SlotNode<C>,\n intent: string,\n ): SlotIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n let intentNode = node.byIntent.get(intent);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(intent, intentNode);\n }\n return intentNode;\n }\n}\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuBA,CAC9BC,eAAgD,EAChDC,QAAiB,EACM;EACvB,IAAID,eAAe,IAAI,IAAI,EAAE;IAC3B,OAAOC,QAAQ,GAAG;MAAEA;IAAS,CAAC,GAAG,CAAC,CAAC;EACrC;EACA,IAAI,OAAOD,eAAe,KAAK,QAAQ,EAAE;IACvC,OAAOC,QAAQ,GAAG;MAAEC,MAAM,EAAEF,eAAe;MAAEC;IAAS,CAAC,GAAG;MAAEC,MAAM,EAAEF;IAAgB,CAAC;EACvF;EACA,OAAOA,eAAe;AACxB;AAEO,MAAMG,iBAAiB,CAAI;EAMhCC,WAAWA,CAASC,QAAW,EAAE;IAAA,KAAbA,QAAW,GAAXA,QAAW;IAAA,IAAAC,gBAAA,CAAAC,OAAA,iBALf,IAAIC,GAAG,CAAsB,CAAC;IAAA,IAAAF,gBAAA,CAAAC,OAAA,oBAC3B,IAAIC,GAAG,CAAyB,CAAC;IAAA,IAAAF,gBAAA,CAAAC,OAAA,uBAC9B,IAAIC,GAAG,CAA4B,CAAC;IAAA,IAAAF,gBAAA,CAAAC,OAAA,mBACxC,IAAIC,GAAG,CAAwB,CAAC;EAEhB;;EAElC;EACA;EACA;;EAEAC,YAAYA,CAACC,IAAY,EAAEC,SAAY,EAAEC,OAAqB,EAAQ;IACpE,IAAIC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,GAAG,CAACL,IAAI,CAAC;IAC/B,IAAI,CAACG,IAAI,EAAE;MACTA,IAAI,GAAG,CAAC,CAAC;MACT,IAAI,CAACC,KAAK,CAACE,GAAG,CAACN,IAAI,EAAEG,IAAI,CAAC;IAC5B;IAEA,MAAM;MAAEX,MAAM;MAAED;IAAS,C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,CAAC6B,cAAc,CAAC,CAAC,CAACa,GAAG,CAAE5C,WAAW,KAAM;QACpDhB,IAAI,EAAEgB,WAAW;QACjBJ,QAAQ,EAAE,IAAI,CAAC2D,kBAAkB,CAACvD,WAAW;MAC/C,CAAC,CAAC,CAAC;MACHD,WAAW,EAAE,IAAI,CAAC2C,iBAAiB,CAAC;IACtC,CAAC;EACH;;EAEA;EACA;EACA;;EAEQnC,mBAAmBA,CACzBpB,IAAoB,EACpBX,MAAc,EACQ;IACtB,IAAI,CAACW,IAAI,CAAC2B,QAAQ,EAAE;MAClB3B,IAAI,CAAC2B,QAAQ,GAAG,IAAIhC,GAAG,CAAC,CAAC;IAC3B;IACA,IAAIS,UAAU,GAAGJ,IAAI,CAAC2B,QAAQ,CAACzB,GAAG,CAACb,MAAM,CAAC;IAC1C,IAAI,CAACe,UAAU,EAAE;MACfA,UAAU,GAAG,CAAC,CAAC;MACfJ,IAAI,CAAC2B,QAAQ,CAACxB,GAAG,CAACd,MAAM,EAAEe,UAAU,CAAC;IACvC;IACA,OAAOA,UAAU;EACnB;EAEQC,gBAAgBA,CACtBL,IAAiB,EACjBX,MAAc,EACK;IACnB,IAAI,CAACW,IAAI,CAAC2B,QAAQ,EAAE;MAClB3B,IAAI,CAAC2B,QAAQ,GAAG,IAAIhC,GAAG,CAAC,CAAC;IAC3B;IACA,IAAIS,UAAU,GAAGJ,IAAI,CAAC2B,QAAQ,CAACzB,GAAG,CAACb,MAAM,CAAC;IAC1C,IAAI,CAACe,UAAU,EAAE;MACfA,UAAU,GAAG,CAAC,CAAC;MACfJ,IAAI,CAAC2B,QAAQ,CAACxB,GAAG,CAACd,MAAM,EAAEe,UAAU,CAAC;IACvC;IACA,OAAOA,UAAU;EACnB;AACF;AAACyE,OAAA,CAAAvF,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["normalizeResolveOptions","intentOrOptions","semantic","intent","normalizeIntentKey","trim","toUpperCase","ComponentRegistry","constructor","fallback","_defineProperty2","default","Map","registerSlot","name","component","options","node","slots","get","set","intentNode","ensureSlotIntent","bySemantic","register","definition","variants","console","warn","definitions","sectionType","registration","sections","placement","placementId","forPlacementById","forPlacement","ensureSectionIntent","registerAction","handler","actions","resolveSlot","_node$byIntent","found","byIntent","_node$byIntent2","_node$bySemantic","resolveSection","resolveSectionRegistration","resolveSectionOptions","_this$resolveSectionR","undefined","_node$forPlacementByI","byId","_node$byIntent3","_node$byIntent4","_node$bySemantic2","getAllSlots","Array","from","keys","getAllSections","getKnownIntents","intents","Set","values","_node$byIntent5","forEach","_variant","key","add","_node$byIntent6","getAllDefinitions","entries","map","getDefinition","isPlacementOnly","_node$forPlacementByI2","_node$byIntent7","_node$bySemantic3","hasPlacement","size","hasNonPlacement","getSlotVariants","push","getSectionVariants","hasAction","has","executeAction","params","success","message","getRegisteredActions","getCatalog","exports"],"sources":["../../../src/registry/ComponentRegistry.ts"],"sourcesContent":["import type { SectionDefinition } from '../component/componentDefinitions';\nimport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionNode,\n SectionIntentNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ResolveSectionOptions,\n ActionHandler,\n ActionResult,\n} from './types';\n\n/**\n * Accept the legacy positional form `(intent, semantic)` and the new\n * options-object form `({ intent, semantic, placement })`. Returns a\n * normalized `ResolveSectionOptions`.\n */\nfunction normalizeResolveOptions(\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n): ResolveSectionOptions {\n if (intentOrOptions == null) {\n return semantic ? { semantic } : {};\n }\n if (typeof intentOrOptions === 'string') {\n return semantic ? { intent: intentOrOptions, semantic } : { intent: intentOrOptions };\n }\n return intentOrOptions;\n}\n\n/**\n * Intent keys are matched case-insensitively.\n *\n * The intent that reaches resolution has already been through\n * `intent.trim().toUpperCase()` — in this package's `intentExtractor`, and\n * again in `web50-server-ui`'s own copy of it, which calls it with no\n * `validIntents` and passes the result as `providedIntent`, bypassing the\n * validated path here. A client that registers its variants in the lowercase\n * spelling its own taxonomy doc uses therefore matched nothing, and every\n * intent-scoped variant silently fell through to the section default.\n *\n * That is not hypothetical: it was true of the whole seed registry. Measured\n * across 11 live answers, 10 rendered the same hero whatever the intent, and\n * one registered hero component never rendered at all. Nothing errors, nothing\n * logs, and the page looks plausible — which is why this belongs at the Map\n * rather than in either extractor.\n *\n * Normalizing on write AND on read makes the spelling a client's own business.\n */\nconst normalizeIntentKey = (intent: string): string =>\n intent.trim().toUpperCase();\n\nexport class ComponentRegistry<C> {\n private slots = new Map<string, SlotNode<C>>();\n private sections = new Map<string, SectionNode<C>>();\n private definitions = new Map<string, SectionDefinition>();\n private actions = new Map<string, ActionHandler>();\n\n constructor(private fallback: C) {}\n\n // ---------------------------------------------------------------------------\n // Registration\n // ---------------------------------------------------------------------------\n\n registerSlot(name: string, component: C, options?: SlotOptions): this {\n let node = this.slots.get(name);\n if (!node) {\n node = {};\n this.slots.set(name, node);\n }\n\n const { intent, semantic } = options ?? {};\n\n if (intent && semantic) {\n const intentNode = this.ensureSlotIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, component);\n } else if (intent) {\n const intentNode = this.ensureSlotIntent(node, intent);\n intentNode.default = component;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, component);\n } else {\n node.default = component;\n }\n\n return this;\n }\n\n register(\n definition: SectionDefinition,\n variants?: SectionRegistration<C>[],\n ): this {\n // Tolerate missing definitions instead of crashing app init. This\n // happens when a client UMD references a `SectionDefinition` symbol\n // that doesn't exist on the consuming bundle's `Web5Core` global\n // (e.g. UMD built against newer `web5-core` than the app bundle).\n // Without this guard a single missing export breaks every other\n // section the client tries to register.\n if (definition == null) {\n // eslint-disable-next-line no-console\n console.warn(\n '[ComponentRegistry] register() called with a null/undefined SectionDefinition — ' +\n 'likely a version skew between the client UMD and web5-core ' +\n '(an exported definition the UMD imports does not exist on this Web5Core). Skipping.',\n );\n return this;\n }\n this.definitions.set(definition.sectionType, definition);\n\n if (variants) {\n const sectionType = definition.sectionType;\n for (const registration of variants) {\n let node = this.sections.get(sectionType);\n if (!node) {\n node = {};\n this.sections.set(sectionType, node);\n }\n const { intent, semantic, placement, placementId } =\n registration.options ?? {};\n\n // Placement variants are stored on their own slot — no further\n // intent/semantic sub-variants (DL #088 D3.1). If a developer also\n // supplies intent/semantic alongside placement, those are ignored for\n // the placement registration. To register both a placement variant AND\n // an intent variant, register them as separate entries.\n if (placement) {\n // Scoped to a specific placement slot id — keyed so one section type\n // can render differently per placement. An id-less placement variant\n // remains the generic fallback.\n if (placementId) {\n if (!node.forPlacementById) {\n node.forPlacementById = new Map();\n }\n node.forPlacementById.set(placementId, registration);\n } else {\n node.forPlacement = registration;\n }\n continue;\n }\n\n if (intent && semantic) {\n const intentNode = this.ensureSectionIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, registration);\n } else if (intent) {\n const intentNode = this.ensureSectionIntent(node, intent);\n intentNode.default = registration;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, registration);\n } else {\n node.default = registration;\n }\n }\n }\n\n return this;\n }\n\n registerAction(name: string, handler: ActionHandler): this {\n this.actions.set(name, handler);\n return this;\n }\n\n // ---------------------------------------------------------------------------\n // Resolution\n // ---------------------------------------------------------------------------\n\n resolveSlot(name: string, intent?: string, semantic?: string): C {\n const node = this.slots.get(name);\n if (!node) {\n return this.fallback;\n }\n\n if (intent && semantic) {\n const found = node.byIntent\n ?.get(normalizeIntentKey(intent))\n ?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(normalizeIntentKey(intent))?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default ?? this.fallback;\n }\n\n /**\n * Resolve a section component by type, optionally narrowed by intent /\n * semantic / placement.\n *\n * Accepts both call forms for backward compatibility:\n * resolveSection('hero') — default\n * resolveSection('hero', 'DISCOVERY') — intent (legacy positional)\n * resolveSection('hero', 'DISCOVERY', 'compact') — intent + semantic (legacy)\n * resolveSection('hero', { intent: 'DISCOVERY' }) — options object\n * resolveSection('hero', { placement: true }) — placement variant (DL #088 D3.1)\n * resolveSection('hero', { intent: 'X', placement: true }) — placement wins\n */\n resolveSection(sectionType: string, intent?: string, semantic?: string): C;\n resolveSection(sectionType: string, options: ResolveSectionOptions): C;\n resolveSection(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): C {\n const registration = this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n );\n return registration?.component ?? this.fallback;\n }\n\n /**\n * Resolve the options bundle associated with the matched registration.\n * Same overload semantics as `resolveSection`.\n */\n resolveSectionOptions(\n sectionType: string,\n intent?: string,\n semantic?: string,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): SectionOptions | undefined {\n return this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n )?.options;\n }\n\n private resolveSectionRegistration(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionRegistration<C> | undefined {\n const node = this.sections.get(sectionType);\n if (!node) {\n return undefined;\n }\n\n const { intent, semantic, placement, placementId } = options;\n\n // Placement wins over intent / semantic when requested AND a placement\n // variant is registered for this section (DL #088 D3.1). Cascade:\n // id-scoped variant → generic placement variant → regular chain.\n if (placement) {\n if (placementId) {\n const byId = node.forPlacementById?.get(placementId);\n if (byId) {\n return byId;\n }\n }\n if (node.forPlacement) {\n return node.forPlacement;\n }\n }\n\n if (intent && semantic) {\n const found = node.byIntent\n ?.get(normalizeIntentKey(intent as string))\n ?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(normalizeIntentKey(intent as string))\n ?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default;\n }\n\n // ---------------------------------------------------------------------------\n // Introspection\n // ---------------------------------------------------------------------------\n\n getAllSlots(): string[] {\n return Array.from(this.slots.keys());\n }\n\n getAllSections(): string[] {\n return Array.from(this.sections.keys());\n }\n\n /**\n * Every intent that has at least one registered slot or section variant —\n * i.e. the client's own intent list, derived from what it actually\n * registered. Assembly uses this to validate an incoming intent before it\n * becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only\n * when a client registers no intent variants at all.\n *\n * Returned NORMALIZED (upper case), whatever spelling the client registered,\n * because these are the map keys. Both consumers compare case-insensitively,\n * so the only visible difference is in a debug view.\n */\n getKnownIntents(): string[] {\n const intents = new Set<string>();\n for (const node of this.slots.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n for (const node of this.sections.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n return Array.from(intents);\n }\n\n getAllDefinitions(): {\n sectionType: string;\n definition: SectionDefinition;\n }[] {\n return Array.from(this.definitions.entries()).map(\n ([sectionType, definition]) => ({\n sectionType,\n definition,\n }),\n );\n }\n\n getDefinition(sectionType: string): SectionDefinition | undefined {\n return this.definitions.get(sectionType);\n }\n\n /**\n * True when a section type was registered with placement variant(s) only —\n * a `{ placement: true }` (or `placementId`) registration and NO\n * non-placement variant (default / intent / semantic). Such a section is\n * meaningful only inside a placement render; the parser skips its definition\n * when matching in a non-placement context (the main app), so its markdown\n * falls through to the generic sections there.\n *\n * A definition registered with no variants at all (structural defs like\n * `skipNodes` / `htmlComment`) is NOT placement-only — it still matches\n * everywhere.\n */\n isPlacementOnly(sectionType: string): boolean {\n const node = this.sections.get(sectionType);\n if (!node) {\n return false;\n }\n const hasPlacement =\n node.forPlacement != null || (node.forPlacementById?.size ?? 0) > 0;\n const hasNonPlacement =\n node.default != null ||\n (node.byIntent?.size ?? 0) > 0 ||\n (node.bySemantic?.size ?? 0) > 0;\n return hasPlacement && !hasNonPlacement;\n }\n\n getSlotVariants(name: string): SlotVariant[] {\n const node = this.slots.get(name);\n if (!node) {\n return [];\n }\n\n const variants: SlotVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n return variants;\n }\n\n getSectionVariants(sectionType: string): SectionVariant[] {\n const node = this.sections.get(sectionType);\n if (!node) {\n return [];\n }\n\n const variants: SectionVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n if (node.forPlacement) {\n variants.push({ placement: true });\n }\n\n if (node.forPlacementById) {\n for (const placementId of node.forPlacementById.keys()) {\n variants.push({ placement: true, placementId });\n }\n }\n\n return variants;\n }\n\n hasAction(name: string): boolean {\n return this.actions.has(name);\n }\n\n async executeAction(\n name: string,\n params: Record<string, string>,\n ): Promise<ActionResult> {\n const handler = this.actions.get(name);\n if (!handler) {\n console.warn(`[Action] No handler for: \"${name}\"`);\n return { success: false, message: `Unknown action: ${name}` };\n }\n return handler(params);\n }\n\n getRegisteredActions(): string[] {\n return Array.from(this.actions.keys());\n }\n\n getCatalog(): RegistryCatalog {\n return {\n slots: this.getAllSlots().map((name) => ({\n name,\n variants: this.getSlotVariants(name),\n })),\n sections: this.getAllSections().map((sectionType) => ({\n name: sectionType,\n variants: this.getSectionVariants(sectionType),\n })),\n definitions: this.getAllDefinitions(),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Private helpers\n // ---------------------------------------------------------------------------\n\n private ensureSectionIntent(\n node: SectionNode<C>,\n intent: string,\n ): SectionIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n const key = normalizeIntentKey(intent);\n let intentNode = node.byIntent.get(key);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(key, intentNode);\n }\n return intentNode;\n }\n\n private ensureSlotIntent(\n node: SlotNode<C>,\n intent: string,\n ): SlotIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n const key = normalizeIntentKey(intent);\n let intentNode = node.byIntent.get(key);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(key, intentNode);\n }\n return intentNode;\n }\n}\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuBA,CAC9BC,eAAgD,EAChDC,QAAiB,EACM;EACvB,IAAID,eAAe,IAAI,IAAI,EAAE;IAC3B,OAAOC,QAAQ,GAAG;MAAEA;IAAS,CAAC,GAAG,CAAC,CAAC;EACrC;EACA,IAAI,OAAOD,eAAe,KAAK,QAAQ,EAAE;IACvC,OAAOC,QAAQ,GAAG;MAAEC,MAAM,EAAEF,eAAe;MAAEC;IAAS,CAAC,GAAG;MAAEC,MAAM,EAAEF;IAAgB,CAAC;EACvF;EACA,OAAOA,eAAe;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,kBAAkB,GAAID,MAAc,IACxCA,MAAM,CAACE,IAAI,CAAC,CAAC,CAAC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AG,CAAC,CAAC;IAC3B;IACA,MAAMyD,GAAG,GAAGjE,kBAAkB,CAACD,MAAM,CAAC;IACtC,IAAIkB,UAAU,GAAGJ,IAAI,CAAC2B,QAAQ,CAACzB,GAAG,CAACkD,GAAG,CAAC;IACvC,IAAI,CAAChD,UAAU,EAAE;MACfA,UAAU,GAAG,CAAC,CAAC;MACfJ,IAAI,CAAC2B,QAAQ,CAACxB,GAAG,CAACiD,GAAG,EAAEhD,UAAU,CAAC;IACpC;IACA,OAAOA,UAAU;EACnB;EAEQC,gBAAgBA,CACtBL,IAAiB,EACjBd,MAAc,EACK;IACnB,IAAI,CAACc,IAAI,CAAC2B,QAAQ,EAAE;MAClB3B,IAAI,CAAC2B,QAAQ,GAAG,IAAIhC,GAAG,CAAC,CAAC;IAC3B;IACA,MAAMyD,GAAG,GAAGjE,kBAAkB,CAACD,MAAM,CAAC;IACtC,IAAIkB,UAAU,GAAGJ,IAAI,CAAC2B,QAAQ,CAACzB,GAAG,CAACkD,GAAG,CAAC;IACvC,IAAI,CAAChD,UAAU,EAAE;MACfA,UAAU,GAAG,CAAC,CAAC;MACfJ,IAAI,CAAC2B,QAAQ,CAACxB,GAAG,CAACiD,GAAG,EAAEhD,UAAU,CAAC;IACpC;IACA,OAAOA,UAAU;EACnB;AACF;AAACyE,OAAA,CAAAvF,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -20,6 +20,27 @@ function normalizeResolveOptions(intentOrOptions, semantic) {
|
|
|
20
20
|
}
|
|
21
21
|
return intentOrOptions;
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Intent keys are matched case-insensitively.
|
|
26
|
+
*
|
|
27
|
+
* The intent that reaches resolution has already been through
|
|
28
|
+
* `intent.trim().toUpperCase()` — in this package's `intentExtractor`, and
|
|
29
|
+
* again in `web50-server-ui`'s own copy of it, which calls it with no
|
|
30
|
+
* `validIntents` and passes the result as `providedIntent`, bypassing the
|
|
31
|
+
* validated path here. A client that registers its variants in the lowercase
|
|
32
|
+
* spelling its own taxonomy doc uses therefore matched nothing, and every
|
|
33
|
+
* intent-scoped variant silently fell through to the section default.
|
|
34
|
+
*
|
|
35
|
+
* That is not hypothetical: it was true of the whole seed registry. Measured
|
|
36
|
+
* across 11 live answers, 10 rendered the same hero whatever the intent, and
|
|
37
|
+
* one registered hero component never rendered at all. Nothing errors, nothing
|
|
38
|
+
* logs, and the page looks plausible — which is why this belongs at the Map
|
|
39
|
+
* rather than in either extractor.
|
|
40
|
+
*
|
|
41
|
+
* Normalizing on write AND on read makes the spelling a client's own business.
|
|
42
|
+
*/
|
|
43
|
+
const normalizeIntentKey = intent => intent.trim().toUpperCase();
|
|
23
44
|
export class ComponentRegistry {
|
|
24
45
|
constructor(fallback) {
|
|
25
46
|
this.fallback = fallback;
|
|
@@ -146,14 +167,14 @@ export class ComponentRegistry {
|
|
|
146
167
|
}
|
|
147
168
|
if (intent && semantic) {
|
|
148
169
|
var _node$byIntent;
|
|
149
|
-
const found = (_node$byIntent = node.byIntent) == null || (_node$byIntent = _node$byIntent.get(intent)) == null || (_node$byIntent = _node$byIntent.bySemantic) == null ? void 0 : _node$byIntent.get(semantic);
|
|
170
|
+
const found = (_node$byIntent = node.byIntent) == null || (_node$byIntent = _node$byIntent.get(normalizeIntentKey(intent))) == null || (_node$byIntent = _node$byIntent.bySemantic) == null ? void 0 : _node$byIntent.get(semantic);
|
|
150
171
|
if (found) {
|
|
151
172
|
return found;
|
|
152
173
|
}
|
|
153
174
|
}
|
|
154
175
|
if (intent) {
|
|
155
176
|
var _node$byIntent2;
|
|
156
|
-
const found = (_node$byIntent2 = node.byIntent) == null || (_node$byIntent2 = _node$byIntent2.get(intent)) == null ? void 0 : _node$byIntent2.default;
|
|
177
|
+
const found = (_node$byIntent2 = node.byIntent) == null || (_node$byIntent2 = _node$byIntent2.get(normalizeIntentKey(intent))) == null ? void 0 : _node$byIntent2.default;
|
|
157
178
|
if (found) {
|
|
158
179
|
return found;
|
|
159
180
|
}
|
|
@@ -224,14 +245,14 @@ export class ComponentRegistry {
|
|
|
224
245
|
}
|
|
225
246
|
if (intent && semantic) {
|
|
226
247
|
var _node$byIntent3;
|
|
227
|
-
const found = (_node$byIntent3 = node.byIntent) == null || (_node$byIntent3 = _node$byIntent3.get(intent)) == null || (_node$byIntent3 = _node$byIntent3.bySemantic) == null ? void 0 : _node$byIntent3.get(semantic);
|
|
248
|
+
const found = (_node$byIntent3 = node.byIntent) == null || (_node$byIntent3 = _node$byIntent3.get(normalizeIntentKey(intent))) == null || (_node$byIntent3 = _node$byIntent3.bySemantic) == null ? void 0 : _node$byIntent3.get(semantic);
|
|
228
249
|
if (found) {
|
|
229
250
|
return found;
|
|
230
251
|
}
|
|
231
252
|
}
|
|
232
253
|
if (intent) {
|
|
233
254
|
var _node$byIntent4;
|
|
234
|
-
const found = (_node$byIntent4 = node.byIntent) == null || (_node$byIntent4 = _node$byIntent4.get(intent)) == null ? void 0 : _node$byIntent4.default;
|
|
255
|
+
const found = (_node$byIntent4 = node.byIntent) == null || (_node$byIntent4 = _node$byIntent4.get(normalizeIntentKey(intent))) == null ? void 0 : _node$byIntent4.default;
|
|
235
256
|
if (found) {
|
|
236
257
|
return found;
|
|
237
258
|
}
|
|
@@ -263,6 +284,10 @@ export class ComponentRegistry {
|
|
|
263
284
|
* registered. Assembly uses this to validate an incoming intent before it
|
|
264
285
|
* becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only
|
|
265
286
|
* when a client registers no intent variants at all.
|
|
287
|
+
*
|
|
288
|
+
* Returned NORMALIZED (upper case), whatever spelling the client registered,
|
|
289
|
+
* because these are the map keys. Both consumers compare case-insensitively,
|
|
290
|
+
* so the only visible difference is in a debug view.
|
|
266
291
|
*/
|
|
267
292
|
getKnownIntents() {
|
|
268
293
|
const intents = new Set();
|
|
@@ -433,10 +458,11 @@ export class ComponentRegistry {
|
|
|
433
458
|
if (!node.byIntent) {
|
|
434
459
|
node.byIntent = new Map();
|
|
435
460
|
}
|
|
436
|
-
|
|
461
|
+
const key = normalizeIntentKey(intent);
|
|
462
|
+
let intentNode = node.byIntent.get(key);
|
|
437
463
|
if (!intentNode) {
|
|
438
464
|
intentNode = {};
|
|
439
|
-
node.byIntent.set(
|
|
465
|
+
node.byIntent.set(key, intentNode);
|
|
440
466
|
}
|
|
441
467
|
return intentNode;
|
|
442
468
|
}
|
|
@@ -444,10 +470,11 @@ export class ComponentRegistry {
|
|
|
444
470
|
if (!node.byIntent) {
|
|
445
471
|
node.byIntent = new Map();
|
|
446
472
|
}
|
|
447
|
-
|
|
473
|
+
const key = normalizeIntentKey(intent);
|
|
474
|
+
let intentNode = node.byIntent.get(key);
|
|
448
475
|
if (!intentNode) {
|
|
449
476
|
intentNode = {};
|
|
450
|
-
node.byIntent.set(
|
|
477
|
+
node.byIntent.set(key, intentNode);
|
|
451
478
|
}
|
|
452
479
|
return intentNode;
|
|
453
480
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["normalizeResolveOptions","intentOrOptions","semantic","intent","ComponentRegistry","constructor","fallback","_defineProperty","Map","registerSlot","name","component","options","node","slots","get","set","intentNode","ensureSlotIntent","bySemantic","default","register","definition","variants","console","warn","definitions","sectionType","registration","sections","placement","placementId","forPlacementById","forPlacement","ensureSectionIntent","registerAction","handler","actions","resolveSlot","_node$byIntent","found","byIntent","_node$byIntent2","_node$bySemantic","resolveSection","resolveSectionRegistration","resolveSectionOptions","_this$resolveSectionR","undefined","_node$forPlacementByI","byId","_node$byIntent3","_node$byIntent4","_node$bySemantic2","getAllSlots","Array","from","keys","getAllSections","getKnownIntents","intents","Set","values","_node$byIntent5","forEach","_variant","key","add","_node$byIntent6","getAllDefinitions","entries","map","_ref","getDefinition","isPlacementOnly","_node$forPlacementByI2","_node$byIntent7","_node$bySemantic3","hasPlacement","size","hasNonPlacement","getSlotVariants","push","getSectionVariants","hasAction","has","executeAction","params","success","message","getRegisteredActions","getCatalog"],"sources":["../../../src/registry/ComponentRegistry.ts"],"sourcesContent":["import type { SectionDefinition } from '../component/componentDefinitions';\nimport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionNode,\n SectionIntentNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ResolveSectionOptions,\n ActionHandler,\n ActionResult,\n} from './types';\n\n/**\n * Accept the legacy positional form `(intent, semantic)` and the new\n * options-object form `({ intent, semantic, placement })`. Returns a\n * normalized `ResolveSectionOptions`.\n */\nfunction normalizeResolveOptions(\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n): ResolveSectionOptions {\n if (intentOrOptions == null) {\n return semantic ? { semantic } : {};\n }\n if (typeof intentOrOptions === 'string') {\n return semantic ? { intent: intentOrOptions, semantic } : { intent: intentOrOptions };\n }\n return intentOrOptions;\n}\n\nexport class ComponentRegistry<C> {\n private slots = new Map<string, SlotNode<C>>();\n private sections = new Map<string, SectionNode<C>>();\n private definitions = new Map<string, SectionDefinition>();\n private actions = new Map<string, ActionHandler>();\n\n constructor(private fallback: C) {}\n\n // ---------------------------------------------------------------------------\n // Registration\n // ---------------------------------------------------------------------------\n\n registerSlot(name: string, component: C, options?: SlotOptions): this {\n let node = this.slots.get(name);\n if (!node) {\n node = {};\n this.slots.set(name, node);\n }\n\n const { intent, semantic } = options ?? {};\n\n if (intent && semantic) {\n const intentNode = this.ensureSlotIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, component);\n } else if (intent) {\n const intentNode = this.ensureSlotIntent(node, intent);\n intentNode.default = component;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, component);\n } else {\n node.default = component;\n }\n\n return this;\n }\n\n register(\n definition: SectionDefinition,\n variants?: SectionRegistration<C>[],\n ): this {\n // Tolerate missing definitions instead of crashing app init. This\n // happens when a client UMD references a `SectionDefinition` symbol\n // that doesn't exist on the consuming bundle's `Web5Core` global\n // (e.g. UMD built against newer `web5-core` than the app bundle).\n // Without this guard a single missing export breaks every other\n // section the client tries to register.\n if (definition == null) {\n // eslint-disable-next-line no-console\n console.warn(\n '[ComponentRegistry] register() called with a null/undefined SectionDefinition — ' +\n 'likely a version skew between the client UMD and web5-core ' +\n '(an exported definition the UMD imports does not exist on this Web5Core). Skipping.',\n );\n return this;\n }\n this.definitions.set(definition.sectionType, definition);\n\n if (variants) {\n const sectionType = definition.sectionType;\n for (const registration of variants) {\n let node = this.sections.get(sectionType);\n if (!node) {\n node = {};\n this.sections.set(sectionType, node);\n }\n const { intent, semantic, placement, placementId } =\n registration.options ?? {};\n\n // Placement variants are stored on their own slot — no further\n // intent/semantic sub-variants (DL #088 D3.1). If a developer also\n // supplies intent/semantic alongside placement, those are ignored for\n // the placement registration. To register both a placement variant AND\n // an intent variant, register them as separate entries.\n if (placement) {\n // Scoped to a specific placement slot id — keyed so one section type\n // can render differently per placement. An id-less placement variant\n // remains the generic fallback.\n if (placementId) {\n if (!node.forPlacementById) {\n node.forPlacementById = new Map();\n }\n node.forPlacementById.set(placementId, registration);\n } else {\n node.forPlacement = registration;\n }\n continue;\n }\n\n if (intent && semantic) {\n const intentNode = this.ensureSectionIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, registration);\n } else if (intent) {\n const intentNode = this.ensureSectionIntent(node, intent);\n intentNode.default = registration;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, registration);\n } else {\n node.default = registration;\n }\n }\n }\n\n return this;\n }\n\n registerAction(name: string, handler: ActionHandler): this {\n this.actions.set(name, handler);\n return this;\n }\n\n // ---------------------------------------------------------------------------\n // Resolution\n // ---------------------------------------------------------------------------\n\n resolveSlot(name: string, intent?: string, semantic?: string): C {\n const node = this.slots.get(name);\n if (!node) {\n return this.fallback;\n }\n\n if (intent && semantic) {\n const found = node.byIntent?.get(intent)?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(intent)?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default ?? this.fallback;\n }\n\n /**\n * Resolve a section component by type, optionally narrowed by intent /\n * semantic / placement.\n *\n * Accepts both call forms for backward compatibility:\n * resolveSection('hero') — default\n * resolveSection('hero', 'DISCOVERY') — intent (legacy positional)\n * resolveSection('hero', 'DISCOVERY', 'compact') — intent + semantic (legacy)\n * resolveSection('hero', { intent: 'DISCOVERY' }) — options object\n * resolveSection('hero', { placement: true }) — placement variant (DL #088 D3.1)\n * resolveSection('hero', { intent: 'X', placement: true }) — placement wins\n */\n resolveSection(sectionType: string, intent?: string, semantic?: string): C;\n resolveSection(sectionType: string, options: ResolveSectionOptions): C;\n resolveSection(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): C {\n const registration = this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n );\n return registration?.component ?? this.fallback;\n }\n\n /**\n * Resolve the options bundle associated with the matched registration.\n * Same overload semantics as `resolveSection`.\n */\n resolveSectionOptions(\n sectionType: string,\n intent?: string,\n semantic?: string,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): SectionOptions | undefined {\n return this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n )?.options;\n }\n\n private resolveSectionRegistration(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionRegistration<C> | undefined {\n const node = this.sections.get(sectionType);\n if (!node) {\n return undefined;\n }\n\n const { intent, semantic, placement, placementId } = options;\n\n // Placement wins over intent / semantic when requested AND a placement\n // variant is registered for this section (DL #088 D3.1). Cascade:\n // id-scoped variant → generic placement variant → regular chain.\n if (placement) {\n if (placementId) {\n const byId = node.forPlacementById?.get(placementId);\n if (byId) {\n return byId;\n }\n }\n if (node.forPlacement) {\n return node.forPlacement;\n }\n }\n\n if (intent && semantic) {\n const found = node.byIntent?.get(intent as string)?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(intent as string)?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default;\n }\n\n // ---------------------------------------------------------------------------\n // Introspection\n // ---------------------------------------------------------------------------\n\n getAllSlots(): string[] {\n return Array.from(this.slots.keys());\n }\n\n getAllSections(): string[] {\n return Array.from(this.sections.keys());\n }\n\n /**\n * Every intent that has at least one registered slot or section variant —\n * i.e. the client's own intent list, derived from what it actually\n * registered. Assembly uses this to validate an incoming intent before it\n * becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only\n * when a client registers no intent variants at all.\n */\n getKnownIntents(): string[] {\n const intents = new Set<string>();\n for (const node of this.slots.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n for (const node of this.sections.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n return Array.from(intents);\n }\n\n getAllDefinitions(): {\n sectionType: string;\n definition: SectionDefinition;\n }[] {\n return Array.from(this.definitions.entries()).map(\n ([sectionType, definition]) => ({\n sectionType,\n definition,\n }),\n );\n }\n\n getDefinition(sectionType: string): SectionDefinition | undefined {\n return this.definitions.get(sectionType);\n }\n\n /**\n * True when a section type was registered with placement variant(s) only —\n * a `{ placement: true }` (or `placementId`) registration and NO\n * non-placement variant (default / intent / semantic). Such a section is\n * meaningful only inside a placement render; the parser skips its definition\n * when matching in a non-placement context (the main app), so its markdown\n * falls through to the generic sections there.\n *\n * A definition registered with no variants at all (structural defs like\n * `skipNodes` / `htmlComment`) is NOT placement-only — it still matches\n * everywhere.\n */\n isPlacementOnly(sectionType: string): boolean {\n const node = this.sections.get(sectionType);\n if (!node) {\n return false;\n }\n const hasPlacement =\n node.forPlacement != null || (node.forPlacementById?.size ?? 0) > 0;\n const hasNonPlacement =\n node.default != null ||\n (node.byIntent?.size ?? 0) > 0 ||\n (node.bySemantic?.size ?? 0) > 0;\n return hasPlacement && !hasNonPlacement;\n }\n\n getSlotVariants(name: string): SlotVariant[] {\n const node = this.slots.get(name);\n if (!node) {\n return [];\n }\n\n const variants: SlotVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n return variants;\n }\n\n getSectionVariants(sectionType: string): SectionVariant[] {\n const node = this.sections.get(sectionType);\n if (!node) {\n return [];\n }\n\n const variants: SectionVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n if (node.forPlacement) {\n variants.push({ placement: true });\n }\n\n if (node.forPlacementById) {\n for (const placementId of node.forPlacementById.keys()) {\n variants.push({ placement: true, placementId });\n }\n }\n\n return variants;\n }\n\n hasAction(name: string): boolean {\n return this.actions.has(name);\n }\n\n async executeAction(\n name: string,\n params: Record<string, string>,\n ): Promise<ActionResult> {\n const handler = this.actions.get(name);\n if (!handler) {\n console.warn(`[Action] No handler for: \"${name}\"`);\n return { success: false, message: `Unknown action: ${name}` };\n }\n return handler(params);\n }\n\n getRegisteredActions(): string[] {\n return Array.from(this.actions.keys());\n }\n\n getCatalog(): RegistryCatalog {\n return {\n slots: this.getAllSlots().map((name) => ({\n name,\n variants: this.getSlotVariants(name),\n })),\n sections: this.getAllSections().map((sectionType) => ({\n name: sectionType,\n variants: this.getSectionVariants(sectionType),\n })),\n definitions: this.getAllDefinitions(),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Private helpers\n // ---------------------------------------------------------------------------\n\n private ensureSectionIntent(\n node: SectionNode<C>,\n intent: string,\n ): SectionIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n let intentNode = node.byIntent.get(intent);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(intent, intentNode);\n }\n return intentNode;\n }\n\n private ensureSlotIntent(\n node: SlotNode<C>,\n intent: string,\n ): SlotIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n let intentNode = node.byIntent.get(intent);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(intent, intentNode);\n }\n return intentNode;\n }\n}\n"],"mappings":";AAiBA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuBA,CAC9BC,eAAgD,EAChDC,QAAiB,EACM;EACvB,IAAID,eAAe,IAAI,IAAI,EAAE;IAC3B,OAAOC,QAAQ,GAAG;MAAEA;IAAS,CAAC,GAAG,CAAC,CAAC;EACrC;EACA,IAAI,OAAOD,eAAe,KAAK,QAAQ,EAAE;IACvC,OAAOC,QAAQ,GAAG;MAAEC,MAAM,EAAEF,eAAe;MAAEC;IAAS,CAAC,GAAG;MAAEC,MAAM,EAAEF;IAAgB,CAAC;EACvF;EACA,OAAOA,eAAe;AACxB;AAEA,OAAO,MAAMG,iBAAiB,CAAI;EAMhCC,WAAWA,CAASC,QAAW,EAAE;IAAA,KAAbA,QAAW,GAAXA,QAAW;IAAAC,eAAA,gBALf,IAAIC,GAAG,CAAsB,CAAC;IAAAD,eAAA,mBAC3B,IAAIC,GAAG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IAAI,CAAC4B,QAAQ,EAAE;MAClB5B,IAAI,CAAC4B,QAAQ,GAAG,IAAIjC,GAAG,CAAC,CAAC;IAC3B;IACA,IAAIS,UAAU,GAAGJ,IAAI,CAAC4B,QAAQ,CAAC1B,GAAG,CAACZ,MAAM,CAAC;IAC1C,IAAI,CAACc,UAAU,EAAE;MACfA,UAAU,GAAG,CAAC,CAAC;MACfJ,IAAI,CAAC4B,QAAQ,CAACzB,GAAG,CAACb,MAAM,EAAEc,UAAU,CAAC;IACvC;IACA,OAAOA,UAAU;EACnB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["normalizeResolveOptions","intentOrOptions","semantic","intent","normalizeIntentKey","trim","toUpperCase","ComponentRegistry","constructor","fallback","_defineProperty","Map","registerSlot","name","component","options","node","slots","get","set","intentNode","ensureSlotIntent","bySemantic","default","register","definition","variants","console","warn","definitions","sectionType","registration","sections","placement","placementId","forPlacementById","forPlacement","ensureSectionIntent","registerAction","handler","actions","resolveSlot","_node$byIntent","found","byIntent","_node$byIntent2","_node$bySemantic","resolveSection","resolveSectionRegistration","resolveSectionOptions","_this$resolveSectionR","undefined","_node$forPlacementByI","byId","_node$byIntent3","_node$byIntent4","_node$bySemantic2","getAllSlots","Array","from","keys","getAllSections","getKnownIntents","intents","Set","values","_node$byIntent5","forEach","_variant","key","add","_node$byIntent6","getAllDefinitions","entries","map","_ref","getDefinition","isPlacementOnly","_node$forPlacementByI2","_node$byIntent7","_node$bySemantic3","hasPlacement","size","hasNonPlacement","getSlotVariants","push","getSectionVariants","hasAction","has","executeAction","params","success","message","getRegisteredActions","getCatalog"],"sources":["../../../src/registry/ComponentRegistry.ts"],"sourcesContent":["import type { SectionDefinition } from '../component/componentDefinitions';\nimport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionNode,\n SectionIntentNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ResolveSectionOptions,\n ActionHandler,\n ActionResult,\n} from './types';\n\n/**\n * Accept the legacy positional form `(intent, semantic)` and the new\n * options-object form `({ intent, semantic, placement })`. Returns a\n * normalized `ResolveSectionOptions`.\n */\nfunction normalizeResolveOptions(\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n): ResolveSectionOptions {\n if (intentOrOptions == null) {\n return semantic ? { semantic } : {};\n }\n if (typeof intentOrOptions === 'string') {\n return semantic ? { intent: intentOrOptions, semantic } : { intent: intentOrOptions };\n }\n return intentOrOptions;\n}\n\n/**\n * Intent keys are matched case-insensitively.\n *\n * The intent that reaches resolution has already been through\n * `intent.trim().toUpperCase()` — in this package's `intentExtractor`, and\n * again in `web50-server-ui`'s own copy of it, which calls it with no\n * `validIntents` and passes the result as `providedIntent`, bypassing the\n * validated path here. A client that registers its variants in the lowercase\n * spelling its own taxonomy doc uses therefore matched nothing, and every\n * intent-scoped variant silently fell through to the section default.\n *\n * That is not hypothetical: it was true of the whole seed registry. Measured\n * across 11 live answers, 10 rendered the same hero whatever the intent, and\n * one registered hero component never rendered at all. Nothing errors, nothing\n * logs, and the page looks plausible — which is why this belongs at the Map\n * rather than in either extractor.\n *\n * Normalizing on write AND on read makes the spelling a client's own business.\n */\nconst normalizeIntentKey = (intent: string): string =>\n intent.trim().toUpperCase();\n\nexport class ComponentRegistry<C> {\n private slots = new Map<string, SlotNode<C>>();\n private sections = new Map<string, SectionNode<C>>();\n private definitions = new Map<string, SectionDefinition>();\n private actions = new Map<string, ActionHandler>();\n\n constructor(private fallback: C) {}\n\n // ---------------------------------------------------------------------------\n // Registration\n // ---------------------------------------------------------------------------\n\n registerSlot(name: string, component: C, options?: SlotOptions): this {\n let node = this.slots.get(name);\n if (!node) {\n node = {};\n this.slots.set(name, node);\n }\n\n const { intent, semantic } = options ?? {};\n\n if (intent && semantic) {\n const intentNode = this.ensureSlotIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, component);\n } else if (intent) {\n const intentNode = this.ensureSlotIntent(node, intent);\n intentNode.default = component;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, component);\n } else {\n node.default = component;\n }\n\n return this;\n }\n\n register(\n definition: SectionDefinition,\n variants?: SectionRegistration<C>[],\n ): this {\n // Tolerate missing definitions instead of crashing app init. This\n // happens when a client UMD references a `SectionDefinition` symbol\n // that doesn't exist on the consuming bundle's `Web5Core` global\n // (e.g. UMD built against newer `web5-core` than the app bundle).\n // Without this guard a single missing export breaks every other\n // section the client tries to register.\n if (definition == null) {\n // eslint-disable-next-line no-console\n console.warn(\n '[ComponentRegistry] register() called with a null/undefined SectionDefinition — ' +\n 'likely a version skew between the client UMD and web5-core ' +\n '(an exported definition the UMD imports does not exist on this Web5Core). Skipping.',\n );\n return this;\n }\n this.definitions.set(definition.sectionType, definition);\n\n if (variants) {\n const sectionType = definition.sectionType;\n for (const registration of variants) {\n let node = this.sections.get(sectionType);\n if (!node) {\n node = {};\n this.sections.set(sectionType, node);\n }\n const { intent, semantic, placement, placementId } =\n registration.options ?? {};\n\n // Placement variants are stored on their own slot — no further\n // intent/semantic sub-variants (DL #088 D3.1). If a developer also\n // supplies intent/semantic alongside placement, those are ignored for\n // the placement registration. To register both a placement variant AND\n // an intent variant, register them as separate entries.\n if (placement) {\n // Scoped to a specific placement slot id — keyed so one section type\n // can render differently per placement. An id-less placement variant\n // remains the generic fallback.\n if (placementId) {\n if (!node.forPlacementById) {\n node.forPlacementById = new Map();\n }\n node.forPlacementById.set(placementId, registration);\n } else {\n node.forPlacement = registration;\n }\n continue;\n }\n\n if (intent && semantic) {\n const intentNode = this.ensureSectionIntent(node, intent);\n if (!intentNode.bySemantic) {\n intentNode.bySemantic = new Map();\n }\n intentNode.bySemantic.set(semantic, registration);\n } else if (intent) {\n const intentNode = this.ensureSectionIntent(node, intent);\n intentNode.default = registration;\n } else if (semantic) {\n if (!node.bySemantic) {\n node.bySemantic = new Map();\n }\n node.bySemantic.set(semantic, registration);\n } else {\n node.default = registration;\n }\n }\n }\n\n return this;\n }\n\n registerAction(name: string, handler: ActionHandler): this {\n this.actions.set(name, handler);\n return this;\n }\n\n // ---------------------------------------------------------------------------\n // Resolution\n // ---------------------------------------------------------------------------\n\n resolveSlot(name: string, intent?: string, semantic?: string): C {\n const node = this.slots.get(name);\n if (!node) {\n return this.fallback;\n }\n\n if (intent && semantic) {\n const found = node.byIntent\n ?.get(normalizeIntentKey(intent))\n ?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(normalizeIntentKey(intent))?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default ?? this.fallback;\n }\n\n /**\n * Resolve a section component by type, optionally narrowed by intent /\n * semantic / placement.\n *\n * Accepts both call forms for backward compatibility:\n * resolveSection('hero') — default\n * resolveSection('hero', 'DISCOVERY') — intent (legacy positional)\n * resolveSection('hero', 'DISCOVERY', 'compact') — intent + semantic (legacy)\n * resolveSection('hero', { intent: 'DISCOVERY' }) — options object\n * resolveSection('hero', { placement: true }) — placement variant (DL #088 D3.1)\n * resolveSection('hero', { intent: 'X', placement: true }) — placement wins\n */\n resolveSection(sectionType: string, intent?: string, semantic?: string): C;\n resolveSection(sectionType: string, options: ResolveSectionOptions): C;\n resolveSection(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): C {\n const registration = this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n );\n return registration?.component ?? this.fallback;\n }\n\n /**\n * Resolve the options bundle associated with the matched registration.\n * Same overload semantics as `resolveSection`.\n */\n resolveSectionOptions(\n sectionType: string,\n intent?: string,\n semantic?: string,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionOptions | undefined;\n resolveSectionOptions(\n sectionType: string,\n intentOrOptions?: string | ResolveSectionOptions,\n semantic?: string,\n ): SectionOptions | undefined {\n return this.resolveSectionRegistration(\n sectionType,\n normalizeResolveOptions(intentOrOptions, semantic),\n )?.options;\n }\n\n private resolveSectionRegistration(\n sectionType: string,\n options: ResolveSectionOptions,\n ): SectionRegistration<C> | undefined {\n const node = this.sections.get(sectionType);\n if (!node) {\n return undefined;\n }\n\n const { intent, semantic, placement, placementId } = options;\n\n // Placement wins over intent / semantic when requested AND a placement\n // variant is registered for this section (DL #088 D3.1). Cascade:\n // id-scoped variant → generic placement variant → regular chain.\n if (placement) {\n if (placementId) {\n const byId = node.forPlacementById?.get(placementId);\n if (byId) {\n return byId;\n }\n }\n if (node.forPlacement) {\n return node.forPlacement;\n }\n }\n\n if (intent && semantic) {\n const found = node.byIntent\n ?.get(normalizeIntentKey(intent as string))\n ?.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n if (intent) {\n const found = node.byIntent?.get(normalizeIntentKey(intent as string))\n ?.default;\n if (found) {\n return found;\n }\n }\n if (semantic) {\n const found = node.bySemantic?.get(semantic);\n if (found) {\n return found;\n }\n }\n\n return node.default;\n }\n\n // ---------------------------------------------------------------------------\n // Introspection\n // ---------------------------------------------------------------------------\n\n getAllSlots(): string[] {\n return Array.from(this.slots.keys());\n }\n\n getAllSections(): string[] {\n return Array.from(this.sections.keys());\n }\n\n /**\n * Every intent that has at least one registered slot or section variant —\n * i.e. the client's own intent list, derived from what it actually\n * registered. Assembly uses this to validate an incoming intent before it\n * becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only\n * when a client registers no intent variants at all.\n *\n * Returned NORMALIZED (upper case), whatever spelling the client registered,\n * because these are the map keys. Both consumers compare case-insensitively,\n * so the only visible difference is in a debug view.\n */\n getKnownIntents(): string[] {\n const intents = new Set<string>();\n for (const node of this.slots.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n for (const node of this.sections.values()) {\n node.byIntent?.forEach((_variant, key) => intents.add(key));\n }\n return Array.from(intents);\n }\n\n getAllDefinitions(): {\n sectionType: string;\n definition: SectionDefinition;\n }[] {\n return Array.from(this.definitions.entries()).map(\n ([sectionType, definition]) => ({\n sectionType,\n definition,\n }),\n );\n }\n\n getDefinition(sectionType: string): SectionDefinition | undefined {\n return this.definitions.get(sectionType);\n }\n\n /**\n * True when a section type was registered with placement variant(s) only —\n * a `{ placement: true }` (or `placementId`) registration and NO\n * non-placement variant (default / intent / semantic). Such a section is\n * meaningful only inside a placement render; the parser skips its definition\n * when matching in a non-placement context (the main app), so its markdown\n * falls through to the generic sections there.\n *\n * A definition registered with no variants at all (structural defs like\n * `skipNodes` / `htmlComment`) is NOT placement-only — it still matches\n * everywhere.\n */\n isPlacementOnly(sectionType: string): boolean {\n const node = this.sections.get(sectionType);\n if (!node) {\n return false;\n }\n const hasPlacement =\n node.forPlacement != null || (node.forPlacementById?.size ?? 0) > 0;\n const hasNonPlacement =\n node.default != null ||\n (node.byIntent?.size ?? 0) > 0 ||\n (node.bySemantic?.size ?? 0) > 0;\n return hasPlacement && !hasNonPlacement;\n }\n\n getSlotVariants(name: string): SlotVariant[] {\n const node = this.slots.get(name);\n if (!node) {\n return [];\n }\n\n const variants: SlotVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n return variants;\n }\n\n getSectionVariants(sectionType: string): SectionVariant[] {\n const node = this.sections.get(sectionType);\n if (!node) {\n return [];\n }\n\n const variants: SectionVariant[] = [];\n if (node.default) {\n variants.push({});\n }\n\n if (node.bySemantic) {\n for (const semantic of node.bySemantic.keys()) {\n variants.push({ semantic });\n }\n }\n\n if (node.byIntent) {\n for (const [intent, intentNode] of node.byIntent) {\n if (intentNode.default) {\n variants.push({ intent });\n }\n if (intentNode.bySemantic) {\n for (const semantic of intentNode.bySemantic.keys()) {\n variants.push({ intent, semantic });\n }\n }\n }\n }\n\n if (node.forPlacement) {\n variants.push({ placement: true });\n }\n\n if (node.forPlacementById) {\n for (const placementId of node.forPlacementById.keys()) {\n variants.push({ placement: true, placementId });\n }\n }\n\n return variants;\n }\n\n hasAction(name: string): boolean {\n return this.actions.has(name);\n }\n\n async executeAction(\n name: string,\n params: Record<string, string>,\n ): Promise<ActionResult> {\n const handler = this.actions.get(name);\n if (!handler) {\n console.warn(`[Action] No handler for: \"${name}\"`);\n return { success: false, message: `Unknown action: ${name}` };\n }\n return handler(params);\n }\n\n getRegisteredActions(): string[] {\n return Array.from(this.actions.keys());\n }\n\n getCatalog(): RegistryCatalog {\n return {\n slots: this.getAllSlots().map((name) => ({\n name,\n variants: this.getSlotVariants(name),\n })),\n sections: this.getAllSections().map((sectionType) => ({\n name: sectionType,\n variants: this.getSectionVariants(sectionType),\n })),\n definitions: this.getAllDefinitions(),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Private helpers\n // ---------------------------------------------------------------------------\n\n private ensureSectionIntent(\n node: SectionNode<C>,\n intent: string,\n ): SectionIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n const key = normalizeIntentKey(intent);\n let intentNode = node.byIntent.get(key);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(key, intentNode);\n }\n return intentNode;\n }\n\n private ensureSlotIntent(\n node: SlotNode<C>,\n intent: string,\n ): SlotIntentNode<C> {\n if (!node.byIntent) {\n node.byIntent = new Map();\n }\n const key = normalizeIntentKey(intent);\n let intentNode = node.byIntent.get(key);\n if (!intentNode) {\n intentNode = {};\n node.byIntent.set(key, intentNode);\n }\n return intentNode;\n }\n}\n"],"mappings":";AAiBA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuBA,CAC9BC,eAAgD,EAChDC,QAAiB,EACM;EACvB,IA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ACF","ignoreList":[]}
|
|
@@ -40,6 +40,10 @@ export declare class ComponentRegistry<C> {
|
|
|
40
40
|
* registered. Assembly uses this to validate an incoming intent before it
|
|
41
41
|
* becomes a resolution key, falling back to core's `DEFAULT_INTENTS` only
|
|
42
42
|
* when a client registers no intent variants at all.
|
|
43
|
+
*
|
|
44
|
+
* Returned NORMALIZED (upper case), whatever spelling the client registered,
|
|
45
|
+
* because these are the map keys. Both consumers compare case-insensitively,
|
|
46
|
+
* so the only visible difference is in a debug view.
|
|
43
47
|
*/
|
|
44
48
|
getKnownIntents(): string[];
|
|
45
49
|
getAllDefinitions(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentRegistry.d.ts","sourceRoot":"","sources":["../../../src/registry/ComponentRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EAKnB,WAAW,EACX,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ComponentRegistry.d.ts","sourceRoot":"","sources":["../../../src/registry/ComponentRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EAKnB,WAAW,EACX,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AA0CjB,qBAAa,iBAAiB,CAAC,CAAC;IAMlB,OAAO,CAAC,QAAQ;IAL5B,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,OAAO,CAAoC;gBAE/B,QAAQ,EAAE,CAAC;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IAAI,EAAE,MAAM,GAAG,WAAW,EAAE;IAiC5C,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE;IA2CzD,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,aAAa,CACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,YAAY,CAAC;IASxB,oBAAoB,IAAI,MAAM,EAAE;IAIhC,UAAU,IAAI,eAAe;IAkB7B,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,gBAAgB;CAezB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/web5-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.63.
|
|
4
|
+
"version": "1.63.24",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tsachis",
|
|
7
7
|
"email": "tsachis@wix.com"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"wallaby": {
|
|
101
101
|
"autoDetect": true
|
|
102
102
|
},
|
|
103
|
-
"falconPackageHash": "
|
|
103
|
+
"falconPackageHash": "cf2a34e70436a1a11df28a8c6e7d92b7ab726480ed923f8d756fd9b3"
|
|
104
104
|
}
|