@cratis/components 4.42.3 → 4.43.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.
@@ -10,7 +10,8 @@
10
10
  "@cratis/components.conformance",
11
11
  "@cratis/components.mui",
12
12
  "@cratis/components.primereact",
13
- "@cratis/components.primereact10"
13
+ "@cratis/components.primereact10",
14
+ "@cratis/components.designsystemet"
14
15
  ],
15
16
  "privateEvidence": [
16
17
  {
@@ -60,7 +61,8 @@
60
61
  "@cratis/components.conformance": ">=4 <5",
61
62
  "@cratis/components.mui": ">=4 <5",
62
63
  "@cratis/components.primereact": ">=4 <5",
63
- "@cratis/components.primereact10": ">=4 <5"
64
+ "@cratis/components.primereact10": ">=4 <5",
65
+ "@cratis/components.designsystemet": ">=4 <5"
64
66
  }
65
67
  }
66
68
  },
@@ -68,7 +70,7 @@
68
70
  {
69
71
  "name": "@cratis/components",
70
72
  "role": "core",
71
- "version": "4.42.3",
73
+ "version": "4.43.0",
72
74
  "releaseMajorRange": ">=4 <5",
73
75
  "independentRelease": false,
74
76
  "private": false,
@@ -92,7 +94,7 @@
92
94
  {
93
95
  "name": "@cratis/eslint-plugin-components",
94
96
  "role": "eslint",
95
- "version": "4.42.3",
97
+ "version": "4.43.0",
96
98
  "releaseMajorRange": ">=4 <5",
97
99
  "independentRelease": false,
98
100
  "private": false,
@@ -105,7 +107,7 @@
105
107
  {
106
108
  "name": "@cratis/components.migrator",
107
109
  "role": "migrator",
108
- "version": "4.42.3",
110
+ "version": "4.43.0",
109
111
  "releaseMajorRange": ">=4 <5",
110
112
  "independentRelease": false,
111
113
  "private": false,
@@ -116,13 +118,13 @@
116
118
  {
117
119
  "name": "@cratis/components.conformance",
118
120
  "role": "conformance",
119
- "version": "4.42.3",
121
+ "version": "4.43.0",
120
122
  "releaseMajorRange": ">=4 <5",
121
123
  "independentRelease": false,
122
124
  "private": false,
123
125
  "packageAccess": "public",
124
126
  "peerDependencies": {
125
- "@cratis/components": "4.42.3",
127
+ "@cratis/components": "4.43.0",
126
128
  "react": "^19.0.0",
127
129
  "react-dom": "^19.0.0"
128
130
  },
@@ -132,13 +134,13 @@
132
134
  {
133
135
  "name": "@cratis/components.mui",
134
136
  "role": "renderer-adapter",
135
- "version": "4.42.3",
137
+ "version": "4.43.0",
136
138
  "releaseMajorRange": ">=4 <5",
137
139
  "independentRelease": false,
138
140
  "private": false,
139
141
  "packageAccess": "public",
140
142
  "peerDependencies": {
141
- "@cratis/components": "4.42.3",
143
+ "@cratis/components": "4.43.0",
142
144
  "@emotion/react": ">=11.5 <12",
143
145
  "@emotion/styled": ">=11.11 <12",
144
146
  "@mui/material": ">=9 <10",
@@ -188,13 +190,13 @@
188
190
  {
189
191
  "name": "@cratis/components.primereact",
190
192
  "role": "renderer-adapter",
191
- "version": "4.42.3",
193
+ "version": "4.43.0",
192
194
  "releaseMajorRange": ">=4 <5",
193
195
  "independentRelease": false,
194
196
  "private": false,
195
197
  "packageAccess": "public",
196
198
  "peerDependencies": {
197
- "@cratis/components": "4.42.3",
199
+ "@cratis/components": "4.43.0",
198
200
  "@primereact/core": ">=11 <12",
199
201
  "@primereact/ui": ">=11 <12",
200
202
  "@primeuix/themes": ">=3 <4",
@@ -256,13 +258,13 @@
256
258
  {
257
259
  "name": "@cratis/components.primereact10",
258
260
  "role": "renderer-adapter",
259
- "version": "4.42.3",
261
+ "version": "4.43.0",
260
262
  "releaseMajorRange": ">=4 <5",
261
263
  "independentRelease": false,
262
264
  "private": false,
263
265
  "packageAccess": "public",
264
266
  "peerDependencies": {
265
- "@cratis/components": "4.42.3",
267
+ "@cratis/components": "4.43.0",
266
268
  "primereact": ">=10.9.9 <11",
267
269
  "react": "^19.0.0",
268
270
  "react-dom": "^19.0.0"
@@ -300,6 +302,58 @@
300
302
  "tsyringe": "4.10.0"
301
303
  }
302
304
  }
305
+ },
306
+ {
307
+ "name": "@cratis/components.designsystemet",
308
+ "role": "renderer-adapter",
309
+ "version": "4.43.0",
310
+ "releaseMajorRange": ">=4 <5",
311
+ "independentRelease": false,
312
+ "private": false,
313
+ "packageAccess": "public",
314
+ "peerDependencies": {
315
+ "@cratis/components": "4.43.0",
316
+ "@digdir/designsystemet-css": ">=1.24 <2",
317
+ "@digdir/designsystemet-react": ">=1.24 <2",
318
+ "react": "^19.0.0",
319
+ "react-dom": "^19.0.0"
320
+ },
321
+ "upstream": {
322
+ "@digdir/designsystemet-css": ">=1.24 <2",
323
+ "@digdir/designsystemet-react": ">=1.24 <2",
324
+ "react": "^19.0.0",
325
+ "react-dom": "^19.0.0"
326
+ },
327
+ "rendererAbi": 1,
328
+ "rendererProfile": "stable-presentation/v1",
329
+ "verifiedPeers": {
330
+ "minimum": {
331
+ "@cratis/arc": "22.16.0",
332
+ "@cratis/arc.react": "22.16.0",
333
+ "@cratis/fundamentals": "7.19.2",
334
+ "@digdir/designsystemet-css": "1.24.0",
335
+ "@digdir/designsystemet-react": "1.24.0",
336
+ "@types/react": "19.0.0",
337
+ "react": "19.0.0",
338
+ "react-dom": "19.0.0",
339
+ "reflect-metadata": "0.2.2",
340
+ "rxjs": "7.8.2",
341
+ "tsyringe": "4.10.0"
342
+ },
343
+ "current": {
344
+ "@cratis/arc": "22.16.0",
345
+ "@cratis/arc.react": "22.16.0",
346
+ "@cratis/fundamentals": "7.19.2",
347
+ "@digdir/designsystemet-css": "1.24.0",
348
+ "@digdir/designsystemet-react": "1.24.0",
349
+ "@types/react": "19.2.18",
350
+ "react": "19.2.8",
351
+ "react-dom": "19.2.8",
352
+ "reflect-metadata": "0.2.2",
353
+ "rxjs": "7.8.2",
354
+ "tsyringe": "4.10.0"
355
+ }
356
+ }
303
357
  }
304
358
  ]
305
359
  }
@@ -54,7 +54,7 @@ export type { unstable_CapabilityId } from './capabilities.js';
54
54
  export { unstable_AdapterError, unstable_adapterErrorCodes, type unstable_AdapterDiagnostic, type unstable_AdapterErrorCode, } from './errors.js';
55
55
  export { unstable_CRATIS_UI_ABI_VERSION, unstable_composeUiLibraries, unstable_defineUiLibrary, type CratisPresentationUiLibraryProviderProps, type CratisRendererSetup, type CratisRendererSetupExtensions, type unstable_RendererSetup, type unstable_RendererSetupExtensions, type unstable_UiLibrary, type unstable_UiLibraryProviderProps, } from './manifest.js';
56
56
  export { unstable_defaultOverlayEnvironment, type CratisOverlayEnvironment, type unstable_CratisOverlayEnvironment, } from './overlayEnvironment.js';
57
- export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisPresentationSlotIds, definePresentationUiLibrary, type CratisPresentationCapabilities, type CratisPresentationCapabilityId, type CratisPresentationSlotDeclaration, type CratisPresentationSlotId, type CratisPresentationSlotMap, type CratisPresentationSlots, type CratisPresentationUiLibrary, } from './presentation.js';
57
+ export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisPresentationSlotIds, definePresentationUiLibrary, type CratisPresentationCapabilities, type CratisPresentationCapabilityId, type CratisPresentationSlotDeclaration, type CratisPresentationSlotId, type CratisPresentationSlotMap, type CratisPresentationSlots, type CratisPresentationUiLibrary, cratisAtomicSlotIds, type CratisAtomicSlotDeclaration, type CratisAtomicSlotId, type CratisAtomicSlotMap, type CratisAtomicSlots, } from './presentation.js';
58
58
  export { unstable_useCapability, unstable_useOverlayEnvironment, unstable_useRendererId, } from './RendererContext.js';
59
59
  export { unstable_RendererScope, type unstable_RendererScopeProps, } from './RendererScope.js';
60
60
  export type { unstable_BehaviorMode, unstable_CratisSlots, unstable_Fidelity, unstable_SlotDeclaration, unstable_SlotId, unstable_SlotMap, } from './slots.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../renderer/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA2B,CAAC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ACH,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACzB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EACH,sBAAsB,EACtB,KAAK,2BAA2B,GACnC,MAAM,oBAAiB,CAAC;AACzB,YAAY,EACR,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,GACnB,MAAM,YAAS,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export { unstable_AdapterError, unstable_adapterErrorCodes } from './errors.js';
2
2
  export { unstable_CRATIS_UI_ABI_VERSION, unstable_composeUiLibraries, unstable_defineUiLibrary } from './manifest.js';
3
3
  export { unstable_defaultOverlayEnvironment } from './overlayEnvironment.js';
4
- export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisPresentationSlotIds, definePresentationUiLibrary } from './presentation.js';
4
+ export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisAtomicSlotIds, cratisPresentationSlotIds, definePresentationUiLibrary } from './presentation.js';
5
5
  export { unstable_useCapability, unstable_useOverlayEnvironment, unstable_useRendererId } from './RendererContext.js';
6
6
  export { unstable_RendererScope } from './RendererScope.js';
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../renderer/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEjE;;;GAGG;AAIH,MAAM,WAAW,6BAA8B,SAAQ,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;CAAG;AAE9E;;;;G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AAEvF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvE,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACnD,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,wCAAwC,CAAC,CAAC;IAC5E,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,SAAS,0BAA0B,EAAE,CAAC;CACpE;AAoCD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,KAAK,CAAC,CAAC,SAAS,kBAAkB,WAC9D,CAAC,KACX,CAQQ,CAAC;AAEZ;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,iBACtB,SAAS,kBAAkB,EAAE,KAC5C,kBAiBF,CAAC"}
@@ -1,12 +1,32 @@
1
+ import { stableAtomicSlotsOf } from './presentation.js';
2
+
1
3
  const unstable_CRATIS_UI_ABI_VERSION = 1;
4
+ const defineOwnSlot = (target, slotId, value) => {
5
+ Object.defineProperty(target, slotId, {
6
+ value,
7
+ enumerable: true,
8
+ writable: true,
9
+ configurable: true,
10
+ });
11
+ };
2
12
  const frozenSlots = (slots) => {
3
13
  const copy = {};
4
14
  for (const [slotId, declaration] of Object.entries(slots)) {
5
15
  if (declaration)
6
- copy[slotId] = Object.freeze({ ...declaration });
16
+ defineOwnSlot(copy, slotId, Object.freeze({ ...declaration }));
7
17
  }
8
18
  return Object.freeze(copy);
9
19
  };
20
+ const mergedSlots = (libraries) => {
21
+ const slots = {};
22
+ for (const library of libraries) {
23
+ const librarySlots = { ...library.slots, ...stableAtomicSlotsOf(library) };
24
+ for (const [slotId, declaration] of Object.entries(librarySlots)) {
25
+ defineOwnSlot(slots, slotId, declaration);
26
+ }
27
+ }
28
+ return slots;
29
+ };
10
30
  const unstable_defineUiLibrary = (library) => Object.freeze({
11
31
  ...library,
12
32
  capabilities: Object.freeze([...library.capabilities]),
@@ -23,7 +43,7 @@ const unstable_composeUiLibraries = (...libraries) => {
23
43
  const capabilities = [
24
44
  ...new Set(libraries.flatMap((library) => library.capabilities)),
25
45
  ];
26
- const slots = Object.assign({}, ...libraries.map((library) => library.slots));
46
+ const slots = mergedSlots(libraries);
27
47
  return unstable_defineUiLibrary({
28
48
  ...last,
29
49
  capabilities,
@@ -32,5 +52,5 @@ const unstable_composeUiLibraries = (...libraries) => {
32
52
  });
33
53
  };
34
54
 
35
- export { unstable_CRATIS_UI_ABI_VERSION, unstable_composeUiLibraries, unstable_defineUiLibrary };
55
+ export { defineOwnSlot, unstable_CRATIS_UI_ABI_VERSION, unstable_composeUiLibraries, unstable_defineUiLibrary };
36
56
  //# sourceMappingURL=manifest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sources":["../../../renderer/manifest.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ComponentType, ReactNode } from 'react';\nimport type { unstable_CapabilityId } from './capabilities';\nimport type { unstable_AdapterDiagnostic } from './errors';\nimport type { unstable_SlotId, unstable_SlotMap } from './slots';\n\n/**\n * Open declaration-merging surface for renderer-specific, non-secret setup attestations.\n * Adapter packages add boolean keys only; credentials never belong in this interface.\n */\n// Adapter packages add only non-secret boolean attestations through declaration merging.\n// biome-ignore lint/style/useConsistentTypeDefinitions: declaration merging requires an interface.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CratisRendererSetupExtensions extends Record<never, never> {}\n\n/**\n * Compatibility declaration-merging surface for renderer setup attestations.\n *\n * @deprecated Merge new adapter keys into {@link CratisRendererSetupExtensions}.\n */\n// biome-ignore lint/style/useConsistentTypeDefinitions: declaration merging requires an interface.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface unstable_RendererSetupExtensions extends CratisRendererSetupExtensions {}\n\n/** Non-secret application setup attestations supplied to a renderer provider. */\nexport type CratisRendererSetup = Readonly<{\n [\n Key in\n keyof CratisRendererSetupExtensions | keyof unstable_RendererSetupExtensions\n ]?: boolean;\n}>;\n\n/**\n * Compatibility alias for {@link CratisRendererSetup}.\n *\n * @deprecated Use {@link CratisRendererSetup}.\n */\nexport type unstable_RendererSetup = CratisRendererSetup;\n\n/** Props supplied to a stable presentation renderer library provider. */\nexport interface CratisPresentationUiLibraryProviderProps {\n /** Non-secret application setup attestations. Never credentials or license tokens. */\n readonly setup: CratisRendererSetup;\n /** Application content. */\n readonly children: ReactNode;\n}\n\n/**\n * Compatibility alias for {@link CratisPresentationUiLibraryProviderProps}.\n *\n * @deprecated Use {@link CratisPresentationUiLibraryProviderProps}.\n */\nexport type unstable_UiLibraryProviderProps = CratisPresentationUiLibraryProviderProps;\n\n/**\n * Renderer ABI major implemented by this package.\n *\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_CRATIS_UI_ABI_VERSION = 1;\n\n/**\n * Runtime renderer manifest. Manifests are immutable values and are never passed through the\n * Components configuration deep-merge path.\n *\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport interface unstable_UiLibrary {\n /** Stable, package-local renderer identity used for diagnostics and telemetry. */\n readonly id: string;\n /** Human-readable renderer name. */\n readonly displayName: string;\n /** Renderer ABI major implemented by this library. */\n readonly abi: number;\n /** Breadth and ownership level offered by the library. */\n readonly level: 'full' | 'primitive' | 'behavior' | 'portal' | 'theme';\n /** Named contract profile promised by the library. */\n readonly profile: string;\n /**\n * Slots promised by the named profile. When omitted, the library promises its own slot keys.\n */\n readonly profileSlots?: readonly unstable_SlotId[];\n /** Core-owned capabilities honestly supported by the library. */\n readonly capabilities: readonly unstable_CapabilityId[];\n /** Typed partial slot implementation table. */\n readonly slots: unstable_SlotMap;\n /** Optional library-level provider mounted once around the selected renderer scope. */\n readonly Provider?: ComponentType<CratisPresentationUiLibraryProviderProps>;\n /** Optional static diagnostic preflight evaluated by renderer providers and scopes. */\n readonly preflight?: () => readonly unstable_AdapterDiagnostic[];\n}\n\nconst frozenSlots = (slots: unstable_SlotMap): unstable_SlotMap => {\n const copy: Record<string, object> = {};\n for (const [slotId, declaration] of Object.entries(slots)) {\n if (declaration) copy[slotId] = Object.freeze({ ...declaration });\n }\n return Object.freeze(copy) as unstable_SlotMap;\n};\n\n/**\n * Defines a renderer library while preserving its inferred literal type. The helper is\n * side-effect-free and defensively copies/freezes mutable manifest containers; component and\n * callback references remain untouched.\n *\n * @param library Renderer library to define.\n * @returns A frozen defensive copy with the same inferred public type.\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_defineUiLibrary = <const T extends unstable_UiLibrary>(\n library: T,\n): T =>\n Object.freeze({\n ...library,\n capabilities: Object.freeze([...library.capabilities]),\n profileSlots: Object.freeze([\n ...(library.profileSlots ?? Object.keys(library.slots)),\n ]),\n slots: frozenSlots(library.slots),\n }) as T;\n\n/**\n * Composes one or more renderer libraries. Slot declarations and metadata use last-library-wins\n * semantics; capabilities are de-duplicated in first-seen order for deterministic diagnostics.\n * The result is defensively copied and frozen through {@link unstable_defineUiLibrary}.\n *\n * @param libraries Libraries in increasing precedence order.\n * @returns One frozen renderer library containing the union of capabilities and slots.\n * @throws {RangeError} When no libraries are supplied.\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_composeUiLibraries = (\n ...libraries: readonly unstable_UiLibrary[]\n): unstable_UiLibrary => {\n if (libraries.length === 0) {\n throw new RangeError('At least one UI library is required for composition.');\n }\n\n const last = libraries[libraries.length - 1];\n const capabilities = [\n ...new Set(libraries.flatMap((library) => library.capabilities)),\n ];\n const slots = Object.assign({}, ...libraries.map((library) => library.slots));\n\n return unstable_defineUiLibrary({\n ...last,\n capabilities,\n profileSlots: last.profileSlots ?? (Object.keys(slots) as unstable_SlotId[]),\n slots,\n });\n};\n"],"names":[],"mappings":"AA6DO,MAAM,8BAA8B,GAAG;AAiC9C,MAAM,WAAW,GAAG,CAAC,KAAuB,KAAsB;IAC9D,MAAM,IAAI,GAA2B,EAAE;AACvC,IAAA,KAAK,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACvD,QAAA,IAAI,WAAW;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;IACrE;AACA,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAqB;AAClD,CAAC;AAWM,MAAM,wBAAwB,GAAG,CACpC,OAAU,KAEV,MAAM,CAAC,MAAM,CAAC;AACV,IAAA,GAAG,OAAO;IACV,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACtD,IAAA,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC1D,CAAC;AACF,IAAA,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;AACpC,CAAA;MAYQ,2BAA2B,GAAG,CACvC,GAAG,SAAwC,KACvB;AACpB,IAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AACxB,QAAA,MAAM,IAAI,UAAU,CAAC,sDAAsD,CAAC;IAChF;IAEA,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5C,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;KACnE;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;AAE7E,IAAA,OAAO,wBAAwB,CAAC;AAC5B,QAAA,GAAG,IAAI;QACP,YAAY;QACZ,YAAY,EAAE,IAAI,CAAC,YAAY,IAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAuB;QAC5E,KAAK;AACR,KAAA,CAAC;AACN;;"}
1
+ {"version":3,"file":"manifest.js","sources":["../../../renderer/manifest.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ComponentType, ReactNode } from 'react';\nimport type { unstable_CapabilityId } from './capabilities';\nimport type { unstable_AdapterDiagnostic } from './errors';\nimport { stableAtomicSlotsOf } from './presentation';\nimport type { unstable_SlotId, unstable_SlotMap } from './slots';\n\n/**\n * Open declaration-merging surface for renderer-specific, non-secret setup attestations.\n * Adapter packages add boolean keys only; credentials never belong in this interface.\n */\n// Adapter packages add only non-secret boolean attestations through declaration merging.\n// biome-ignore lint/style/useConsistentTypeDefinitions: declaration merging requires an interface.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CratisRendererSetupExtensions extends Record<never, never> {}\n\n/**\n * Compatibility declaration-merging surface for renderer setup attestations.\n *\n * @deprecated Merge new adapter keys into {@link CratisRendererSetupExtensions}.\n */\n// biome-ignore lint/style/useConsistentTypeDefinitions: declaration merging requires an interface.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface unstable_RendererSetupExtensions extends CratisRendererSetupExtensions {}\n\n/** Non-secret application setup attestations supplied to a renderer provider. */\nexport type CratisRendererSetup = Readonly<{\n [\n Key in\n keyof CratisRendererSetupExtensions | keyof unstable_RendererSetupExtensions\n ]?: boolean;\n}>;\n\n/**\n * Compatibility alias for {@link CratisRendererSetup}.\n *\n * @deprecated Use {@link CratisRendererSetup}.\n */\nexport type unstable_RendererSetup = CratisRendererSetup;\n\n/** Props supplied to a stable presentation renderer library provider. */\nexport interface CratisPresentationUiLibraryProviderProps {\n /** Non-secret application setup attestations. Never credentials or license tokens. */\n readonly setup: CratisRendererSetup;\n /** Application content. */\n readonly children: ReactNode;\n}\n\n/**\n * Compatibility alias for {@link CratisPresentationUiLibraryProviderProps}.\n *\n * @deprecated Use {@link CratisPresentationUiLibraryProviderProps}.\n */\nexport type unstable_UiLibraryProviderProps = CratisPresentationUiLibraryProviderProps;\n\n/**\n * Renderer ABI major implemented by this package.\n *\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_CRATIS_UI_ABI_VERSION = 1;\n\n/**\n * Runtime renderer manifest. Manifests are immutable values and are never passed through the\n * Components configuration deep-merge path.\n *\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport interface unstable_UiLibrary {\n /** Stable, package-local renderer identity used for diagnostics and telemetry. */\n readonly id: string;\n /** Human-readable renderer name. */\n readonly displayName: string;\n /** Renderer ABI major implemented by this library. */\n readonly abi: number;\n /** Breadth and ownership level offered by the library. */\n readonly level: 'full' | 'primitive' | 'behavior' | 'portal' | 'theme';\n /** Named contract profile promised by the library. */\n readonly profile: string;\n /**\n * Slots promised by the named profile. When omitted, the library promises its own slot keys.\n */\n readonly profileSlots?: readonly unstable_SlotId[];\n /** Core-owned capabilities honestly supported by the library. */\n readonly capabilities: readonly unstable_CapabilityId[];\n /** Typed partial slot implementation table. */\n readonly slots: unstable_SlotMap;\n /** Optional library-level provider mounted once around the selected renderer scope. */\n readonly Provider?: ComponentType<CratisPresentationUiLibraryProviderProps>;\n /** Optional static diagnostic preflight evaluated by renderer providers and scopes. */\n readonly preflight?: () => readonly unstable_AdapterDiagnostic[];\n}\n\n/**\n * Sets an own enumerable data property. Unlike assignment, an own `__proto__` key cannot change\n * the target's prototype.\n *\n * @internal Slot-map construction helper; not part of the public package surface.\n */\nexport const defineOwnSlot = (target: Record<string, unknown>, slotId: string, value: unknown) => {\n Object.defineProperty(target, slotId, {\n value,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n};\n\nconst frozenSlots = (slots: unstable_SlotMap): unstable_SlotMap => {\n const copy: Record<string, object> = {};\n for (const [slotId, declaration] of Object.entries(slots)) {\n if (declaration) defineOwnSlot(copy, slotId, Object.freeze({ ...declaration }));\n }\n return Object.freeze(copy) as unstable_SlotMap;\n};\n\nconst mergedSlots = (libraries: readonly unstable_UiLibrary[]): unstable_SlotMap => {\n const slots: Record<string, unknown> = {};\n for (const library of libraries) {\n const librarySlots = { ...library.slots, ...stableAtomicSlotsOf(library) };\n for (const [slotId, declaration] of Object.entries(librarySlots)) {\n defineOwnSlot(slots, slotId, declaration);\n }\n }\n return slots as unstable_SlotMap;\n};\n\n/**\n * Defines a renderer library while preserving its inferred literal type. The helper is\n * side-effect-free and defensively copies/freezes mutable manifest containers; component and\n * callback references remain untouched.\n *\n * @param library Renderer library to define.\n * @returns A frozen defensive copy with the same inferred public type.\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_defineUiLibrary = <const T extends unstable_UiLibrary>(\n library: T,\n): T =>\n Object.freeze({\n ...library,\n capabilities: Object.freeze([...library.capabilities]),\n profileSlots: Object.freeze([\n ...(library.profileSlots ?? Object.keys(library.slots)),\n ]),\n slots: frozenSlots(library.slots),\n }) as T;\n\n/**\n * Composes one or more renderer libraries. Slot declarations and metadata use last-library-wins\n * semantics; capabilities are de-duplicated in first-seen order for deterministic diagnostics.\n * The result is defensively copied and frozen through {@link unstable_defineUiLibrary}.\n *\n * @param libraries Libraries in increasing precedence order.\n * @returns One frozen renderer library containing the union of capabilities and slots.\n * @throws {RangeError} When no libraries are supplied.\n * @unstable Adapter-author contract. Expect changes until renderer conformance gates promote it.\n */\nexport const unstable_composeUiLibraries = (\n ...libraries: readonly unstable_UiLibrary[]\n): unstable_UiLibrary => {\n if (libraries.length === 0) {\n throw new RangeError('At least one UI library is required for composition.');\n }\n\n const last = libraries[libraries.length - 1];\n const capabilities = [\n ...new Set(libraries.flatMap((library) => library.capabilities)),\n ];\n const slots = mergedSlots(libraries);\n\n return unstable_defineUiLibrary({\n ...last,\n capabilities,\n profileSlots: last.profileSlots ?? (Object.keys(slots) as unstable_SlotId[]),\n slots,\n });\n};\n"],"names":[],"mappings":";;AA8DO,MAAM,8BAA8B,GAAG;AAuCvC,MAAM,aAAa,GAAG,CAAC,MAA+B,EAAE,MAAc,EAAE,KAAc,KAAI;AAC7F,IAAA,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE;QAClC,KAAK;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,YAAY,EAAE,IAAI;AACrB,KAAA,CAAC;AACN;AAEA,MAAM,WAAW,GAAG,CAAC,KAAuB,KAAsB;IAC9D,MAAM,IAAI,GAA2B,EAAE;AACvC,IAAA,KAAK,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACvD,QAAA,IAAI,WAAW;AAAE,YAAA,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;IACn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AAC,CAAC,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;KACnE;AACD,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC;AAEpC,IAAA,OAAO,wBAAwB,CAAC;AAC5B,QAAA,GAAG,IAAI;QACP,YAAY;QACZ,YAAY,EAAE,IAAI,CAAC,YAAY,IAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAuB;QAC5E,KAAK;AACR,KAAA,CAAC;AACN;;"}
@@ -7,6 +7,7 @@ import type { SurfaceProps } from '../Common/Surface.js';
7
7
  import type { SwitchProps } from '../Common/Switch.js';
8
8
  import type { TextAreaProps } from '../Common/TextArea.js';
9
9
  import type { TextInputProps } from '../Common/TextInput.js';
10
+ import type { TablePaginatorProps } from '../DataTables/TablePaginator.js';
10
11
  import type { ProgressBarProps } from '../Display/ProgressBar.js';
11
12
  import type { CratisPresentationUiLibraryProviderProps } from './manifest.js';
12
13
  /** Stable renderer profile implemented by certified presentation adapters. */
@@ -51,6 +52,35 @@ export interface CratisPresentationSlotDeclaration<SlotId extends CratisPresenta
51
52
  export type CratisPresentationSlotMap = {
52
53
  readonly [SlotId in CratisPresentationSlotId]: CratisPresentationSlotDeclaration<SlotId>;
53
54
  };
55
+ /**
56
+ * Immutable list of the atomic slots whose contracts are stable. A stable presentation library may
57
+ * implement any of them through {@link CratisPresentationUiLibrary.atomicSlots}; new ids are only
58
+ * ever appended.
59
+ */
60
+ export declare const cratisAtomicSlotIds: readonly ["datatables.paginator"];
61
+ /** Identifier of one stable atomic slot. */
62
+ export type CratisAtomicSlotId = (typeof cratisAtomicSlotIds)[number];
63
+ /** Exact public component prop contracts covered by the stable atomic slots. */
64
+ export interface CratisAtomicSlots {
65
+ /**
66
+ * Table paginator contract: zero-based `page`, `pageCount`, zero-based `onPageChange`, the
67
+ * `TablePaginatorParts` parts and no ref.
68
+ */
69
+ readonly 'datatables.paginator': TablePaginatorProps;
70
+ }
71
+ /** One stable, adapter-owned atomic slot declaration. */
72
+ export interface CratisAtomicSlotDeclaration<SlotId extends CratisAtomicSlotId> {
73
+ /** Stable atomic slots give the adapter ownership of the complete interaction. */
74
+ readonly mode: 'atomic';
75
+ /** Unsupported declarations are expressed by omitting the slot. */
76
+ readonly fidelity: 'native' | 'emulated';
77
+ /** Component implementing the slot's exact public props contract. */
78
+ readonly render: ComponentType<CratisAtomicSlots[SlotId]>;
79
+ }
80
+ /** Optional atomic implementations. An omitted slot keeps the built-in Components implementation. */
81
+ export type CratisAtomicSlotMap = {
82
+ readonly [SlotId in CratisAtomicSlotId]?: CratisAtomicSlotDeclaration<SlotId>;
83
+ };
54
84
  /** Capabilities whose meaning is stable for the bounded presentation profile. */
55
85
  export type CratisPresentationCapabilityId = 'slot.render' | 'parts.passthrough' | 'ssr.staticRender' | 'rtl' | 'forcedColors' | 'motion.reduced';
56
86
  type CratisPresentationOptionalCapabilityId = Exclude<CratisPresentationCapabilityId, 'slot.render' | 'parts.passthrough' | 'ssr.staticRender'>;
@@ -81,14 +111,27 @@ export interface CratisPresentationUiLibrary {
81
111
  readonly slots: CratisPresentationSlotMap;
82
112
  /** Optional provider mounted once around the selected renderer scope. */
83
113
  readonly Provider?: ComponentType<CratisPresentationUiLibraryProviderProps>;
114
+ /**
115
+ * Optional adapter-owned implementations of stable atomic slots. Omitted slots resolve to the
116
+ * built-in Components implementation.
117
+ */
118
+ readonly atomicSlots?: CratisAtomicSlotMap;
84
119
  }
85
120
  /**
86
- * Defines and freezes a complete implementation of the stable nine-slot presentation profile.
87
- * Runtime validation protects JavaScript callers from claiming a profile they do not implement.
121
+ * Defines and freezes a complete implementation of the stable nine-slot presentation profile,
122
+ * plus any optional stable atomic slots. Runtime validation protects JavaScript callers from
123
+ * claiming a profile they do not implement.
88
124
  *
89
125
  * @param library Stable presentation library declaration.
90
126
  * @returns A defensive, deeply frozen manifest copy.
91
127
  */
92
128
  export declare const definePresentationUiLibrary: (library: CratisPresentationUiLibrary) => CratisPresentationUiLibrary;
129
+ /** One reason a stable presentation library's atomic slot cannot be resolved. */
130
+ export interface StableAtomicSlotProblem {
131
+ /** Offending slot id, when the problem concerns a single entry. */
132
+ readonly slotId?: string;
133
+ /** Human-readable reason. */
134
+ readonly message: string;
135
+ }
93
136
  export {};
94
137
  //# sourceMappingURL=presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../renderer/presentation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,eAAY,CAAC;AAE3E,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,EAAG,wBAAiC,CAAC;AAE7E,8DAA8D;AAC9D,eAAO,MAAM,+BAA+B,EAAG,CAAU,CAAC;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,iLAU3B,CAAC;AAEZ,kDAAkD;AAClD,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,gGAAgG;AAChG,MAAM,WAAW,uBAAuB;IACpC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-11,6 +11,7 @@ const cratisPresentationSlotIds = Object.freeze([
11
11
  'common.progress',
12
12
  'common.surface',
13
13
  ]);
14
+ const cratisAtomicSlotIds = Object.freeze(['datatables.paginator']);
14
15
  const requiredCapabilityIds = [
15
16
  'slot.render',
16
17
  'parts.passthrough',
@@ -27,23 +28,30 @@ const invalidPresentationLibrary = (reason) => {
27
28
  };
28
29
  const hasCanonicalProfileSlots = (profileSlots) => profileSlots.length === cratisPresentationSlotIds.length &&
29
30
  profileSlots.every((slotId, index) => slotId === cratisPresentationSlotIds[index]);
30
- const definePresentationUiLibrary = (library) => {
31
+ const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
32
+ const isRendererIdentity = (id) => typeof id === 'string' &&
33
+ id.length <= 128 &&
34
+ /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u.test(id);
35
+ const isDisplayName = (displayName) => typeof displayName === 'string' &&
36
+ displayName.trim().length > 0 &&
37
+ displayName.length <= 128;
38
+ const isComponent = (render) => render !== null && (typeof render === 'function' || typeof render === 'object');
39
+ const isStableFidelity = (fidelity) => fidelity === 'native' || fidelity === 'emulated';
40
+ const validateIdentity = (library) => {
31
41
  if (library === null || typeof library !== 'object') {
32
42
  invalidPresentationLibrary('manifest must be an object');
33
43
  }
34
- if (typeof library.id !== 'string' ||
35
- library.id.length > 128 ||
36
- !/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u.test(library.id)) {
44
+ if (!isRendererIdentity(library.id)) {
37
45
  invalidPresentationLibrary('id must be a valid package-local renderer identity');
38
46
  }
39
- if (typeof library.displayName !== 'string' ||
40
- library.displayName.trim().length === 0 ||
41
- library.displayName.length > 128) {
47
+ if (!isDisplayName(library.displayName)) {
42
48
  invalidPresentationLibrary('displayName must contain between 1 and 128 characters');
43
49
  }
44
50
  if (library.Provider !== undefined && typeof library.Provider !== 'function') {
45
51
  invalidPresentationLibrary('Provider must be a React component when supplied');
46
52
  }
53
+ };
54
+ const validateProfile = (library) => {
47
55
  if (library.profile !== CRATIS_PRESENTATION_PROFILE) {
48
56
  invalidPresentationLibrary(`profile must be '${CRATIS_PRESENTATION_PROFILE}'`);
49
57
  }
@@ -57,6 +65,23 @@ const definePresentationUiLibrary = (library) => {
57
65
  !hasCanonicalProfileSlots(library.profileSlots)) {
58
66
  invalidPresentationLibrary('profileSlots must be the canonical nine-slot profile');
59
67
  }
68
+ };
69
+ const declarationProblem = (declaration, label, mode) => {
70
+ if (declaration.mode !== mode)
71
+ return `${label} must use ${mode} mode`;
72
+ if (!isStableFidelity(declaration.fidelity)) {
73
+ return `${label} must use native or emulated fidelity`;
74
+ }
75
+ if (!isComponent(declaration.render))
76
+ return `${label} must provide a component`;
77
+ return undefined;
78
+ };
79
+ const validateDeclaration = (declaration, label, mode) => {
80
+ const problem = declarationProblem(declaration, label, mode);
81
+ if (problem)
82
+ invalidPresentationLibrary(problem);
83
+ };
84
+ const validateSlots = (library) => {
60
85
  if (!library.slots || typeof library.slots !== 'object') {
61
86
  invalidPresentationLibrary('slots must be an object');
62
87
  }
@@ -68,20 +93,12 @@ const definePresentationUiLibrary = (library) => {
68
93
  for (const slotId of cratisPresentationSlotIds) {
69
94
  const declaration = library.slots[slotId];
70
95
  if (!declaration) {
71
- throw new TypeError(`Invalid stable presentation UI library: slot '${slotId}' must provide a declaration.`);
72
- }
73
- if (declaration.mode !== 'presentation') {
74
- invalidPresentationLibrary(`slot '${slotId}' must use presentation mode`);
75
- }
76
- if (declaration.fidelity !== 'native' && declaration.fidelity !== 'emulated') {
77
- invalidPresentationLibrary(`slot '${slotId}' must use native or emulated fidelity`);
78
- }
79
- if (declaration.render === null ||
80
- (typeof declaration.render !== 'function' &&
81
- typeof declaration.render !== 'object')) {
82
- invalidPresentationLibrary(`slot '${slotId}' must provide a component`);
96
+ invalidPresentationLibrary(`slot '${slotId}' must provide a declaration`);
83
97
  }
98
+ validateDeclaration(declaration, `slot '${slotId}'`, 'presentation');
84
99
  }
100
+ };
101
+ const validateCapabilities = (library) => {
85
102
  if (!Array.isArray(library.capabilities) ||
86
103
  library.capabilities.some((capability) => !stableCapabilityIds.has(capability))) {
87
104
  invalidPresentationLibrary('capabilities must stay within the stable presentation subset');
@@ -92,14 +109,70 @@ const definePresentationUiLibrary = (library) => {
92
109
  if (new Set(library.capabilities).size !== library.capabilities.length) {
93
110
  invalidPresentationLibrary('capabilities must not contain duplicates');
94
111
  }
95
- const slots = Object.freeze(Object.fromEntries(cratisPresentationSlotIds.map((slotId) => [
96
- slotId,
97
- Object.freeze({
98
- mode: library.slots[slotId].mode,
99
- fidelity: library.slots[slotId].fidelity,
100
- render: library.slots[slotId].render,
101
- }),
102
- ])));
112
+ };
113
+ const isStableAtomicSlotId = (slotId) => cratisAtomicSlotIds.includes(slotId);
114
+ const snapshotDeclaration = (declaration) => ({
115
+ mode: declaration.mode,
116
+ fidelity: declaration.fidelity,
117
+ render: declaration.render,
118
+ });
119
+ const inspectAtomicSlot = (slotId, value) => {
120
+ const label = `atomic slot '${slotId}'`;
121
+ if (!isStableAtomicSlotId(slotId)) {
122
+ return { slotId, problem: `${label} is not a stable atomic slot` };
123
+ }
124
+ if (value === undefined)
125
+ return { slotId };
126
+ if (!isRecord(value))
127
+ return { slotId, problem: `${label} must provide a declaration` };
128
+ const declaration = snapshotDeclaration(value);
129
+ return { slotId, declaration, problem: declarationProblem(declaration, label, 'atomic') };
130
+ };
131
+ const isPlainPrototype = (prototype) => prototype === null || prototype === Object.prototype;
132
+ const inspectAtomicSlots = (atomicSlots) => {
133
+ if (atomicSlots === undefined)
134
+ return { entries: [] };
135
+ if (!isRecord(atomicSlots)) {
136
+ return { problem: 'atomicSlots must be an object when supplied', entries: [] };
137
+ }
138
+ if (!isPlainPrototype(Object.getPrototypeOf(atomicSlots))) {
139
+ return {
140
+ problem: 'atomicSlots must be a plain object; inherited declarations are not allowed',
141
+ entries: [],
142
+ };
143
+ }
144
+ return {
145
+ entries: Object.keys(atomicSlots).map((slotId) => inspectAtomicSlot(slotId, atomicSlots[slotId])),
146
+ };
147
+ };
148
+ const isUsableAtomicSlot = (entry) => entry.problem === undefined && entry.declaration !== undefined;
149
+ const usableAtomicSlots = (entries) => Object.freeze(Object.fromEntries(entries
150
+ .filter(isUsableAtomicSlot)
151
+ .map(({ slotId, declaration }) => [slotId, Object.freeze(declaration)])));
152
+ const frozenValidAtomicSlots = (atomicSlots) => {
153
+ if (atomicSlots === undefined)
154
+ return undefined;
155
+ const inspection = inspectAtomicSlots(atomicSlots);
156
+ const problem = inspection.problem ?? inspection.entries.find((entry) => entry.problem)?.problem;
157
+ if (problem)
158
+ invalidPresentationLibrary(problem);
159
+ return usableAtomicSlots(inspection.entries);
160
+ };
161
+ const freezeDeclaration = (declaration) => Object.freeze({
162
+ mode: declaration.mode,
163
+ fidelity: declaration.fidelity,
164
+ render: declaration.render,
165
+ });
166
+ const freezePresentationSlots = (slots) => Object.freeze(Object.fromEntries(cratisPresentationSlotIds.map((slotId) => [
167
+ slotId,
168
+ freezeDeclaration(slots[slotId]),
169
+ ])));
170
+ const definePresentationUiLibrary = (library) => {
171
+ validateIdentity(library);
172
+ validateProfile(library);
173
+ validateSlots(library);
174
+ validateCapabilities(library);
175
+ const atomicSlots = frozenValidAtomicSlots(library.atomicSlots);
103
176
  return Object.freeze({
104
177
  id: library.id,
105
178
  displayName: library.displayName,
@@ -110,10 +183,21 @@ const definePresentationUiLibrary = (library) => {
110
183
  capabilities: Object.freeze([
111
184
  ...library.capabilities,
112
185
  ]),
113
- slots,
186
+ slots: freezePresentationSlots(library.slots),
114
187
  Provider: library.Provider,
188
+ ...(atomicSlots === undefined ? {} : { atomicSlots }),
115
189
  });
116
190
  };
191
+ const atomicSlotsInspectionOf = (library) => library.profile === CRATIS_PRESENTATION_PROFILE
192
+ ? inspectAtomicSlots(library.atomicSlots)
193
+ : { entries: [] };
194
+ const stableAtomicSlotProblemsOf = (library) => {
195
+ const inspection = atomicSlotsInspectionOf(library);
196
+ if (inspection.problem)
197
+ return [{ message: inspection.problem }];
198
+ return inspection.entries.flatMap(({ slotId, problem }) => problem ? [{ slotId, message: problem }] : []);
199
+ };
200
+ const stableAtomicSlotsOf = (library) => usableAtomicSlots(atomicSlotsInspectionOf(library).entries);
117
201
 
118
- export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisPresentationSlotIds, definePresentationUiLibrary };
202
+ export { CRATIS_PRESENTATION_ABI_VERSION, CRATIS_PRESENTATION_PROFILE, cratisAtomicSlotIds, cratisPresentationSlotIds, definePresentationUiLibrary, stableAtomicSlotProblemsOf, stableAtomicSlotsOf };
119
203
  //# sourceMappingURL=presentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.js","sources":["../../../renderer/presentation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ComponentType } from 'react';\nimport type { ButtonProps } from '../Common/Button';\nimport type { CheckboxProps } from '../Common/Checkbox';\nimport type { IconButtonProps } from '../Common/IconButton';\nimport type { RadioProps } from '../Common/Radio';\nimport type { SurfaceProps } from '../Common/Surface';\nimport type { SwitchProps } from '../Common/Switch';\nimport type { TextAreaProps } from '../Common/TextArea';\nimport type { TextInputProps } from '../Common/TextInput';\nimport type { ProgressBarProps } from '../Display/ProgressBar';\nimport type { CratisPresentationUiLibraryProviderProps } from './manifest';\n\n/** Stable renderer profile implemented by certified presentation adapters. */\nexport const CRATIS_PRESENTATION_PROFILE = 'stable-presentation/v1' as const;\n\n/** Renderer ABI major for the stable presentation profile. */\nexport const CRATIS_PRESENTATION_ABI_VERSION = 1 as const;\n\n/** Immutable, canonical slot order for the stable presentation profile. */\nexport const cratisPresentationSlotIds = Object.freeze([\n 'common.button',\n 'common.iconButton',\n 'common.textInput',\n 'common.textArea',\n 'common.checkbox',\n 'common.radio',\n 'common.switch',\n 'common.progress',\n 'common.surface',\n] as const);\n\n/** Identifier of one stable presentation slot. */\nexport type CratisPresentationSlotId = (typeof cratisPresentationSlotIds)[number];\n\n/** Exact public component prop and ref contracts covered by the stable presentation profile. */\nexport interface CratisPresentationSlots {\n /** Cratis button presentation contract, including native button refs and form behavior. */\n readonly 'common.button': ButtonProps;\n /** Accessible icon-only button contract with native button ownership. */\n readonly 'common.iconButton': IconButtonProps;\n /** Native text-input contract with semantic value-first change events. */\n readonly 'common.textInput': TextInputProps;\n /** Native multiline text-input contract with semantic value-first change events. */\n readonly 'common.textArea': TextAreaProps;\n /** Native checkbox contract with checked state, form participation, and input refs. */\n readonly 'common.checkbox': CheckboxProps;\n /** Native radio-option contract with selection state, form participation, and input refs. */\n readonly 'common.radio': RadioProps;\n /** Boolean switch contract preserving switch semantics and input ownership. */\n readonly 'common.switch': SwitchProps;\n /** Determinate or indeterminate progress presentation contract. */\n readonly 'common.progress': ProgressBarProps;\n /** Non-interactive semantic surface and native-element presentation contract. */\n readonly 'common.surface': SurfaceProps;\n}\n\n/** One stable, presentation-owned renderer slot declaration. */\nexport interface CratisPresentationSlotDeclaration<\n SlotId extends CratisPresentationSlotId,\n> {\n /** Stable presentation slots always preserve Components behavior ownership. */\n readonly mode: 'presentation';\n /** Unsupported declarations cannot claim the stable profile. */\n readonly fidelity: 'native' | 'emulated';\n /** Component implementing the slot's exact public props and ref contract. */\n readonly render: ComponentType<CratisPresentationSlots[SlotId]>;\n}\n\n/** Complete implementation table required by the stable presentation profile. */\nexport type CratisPresentationSlotMap = {\n readonly [\n SlotId in CratisPresentationSlotId\n ]: CratisPresentationSlotDeclaration<SlotId>;\n};\n\n/** Capabilities whose meaning is stable for the bounded presentation profile. */\nexport type CratisPresentationCapabilityId =\n | 'slot.render'\n | 'parts.passthrough'\n | 'ssr.staticRender'\n | 'rtl'\n | 'forcedColors'\n | 'motion.reduced';\n\ntype CratisPresentationOptionalCapabilityId = Exclude<\n CratisPresentationCapabilityId,\n 'slot.render' | 'parts.passthrough' | 'ssr.staticRender'\n>;\n\n/** Required presentation capabilities followed by optional stable evidence capabilities. */\nexport type CratisPresentationCapabilities = readonly [\n 'slot.render',\n 'parts.passthrough',\n 'ssr.staticRender',\n ...CratisPresentationOptionalCapabilityId[],\n];\n\n/** Immutable manifest for one implementation of the stable presentation profile. */\nexport interface CratisPresentationUiLibrary {\n /** Stable, package-local renderer identity used for diagnostics and telemetry. */\n readonly id: string;\n /** Human-readable renderer name. */\n readonly displayName: string;\n /** Stable presentation renderer ABI major. */\n readonly abi: typeof CRATIS_PRESENTATION_ABI_VERSION;\n /** The bounded profile is a primitive presentation adapter. */\n readonly level: 'primitive';\n /** Exact stable presentation profile identifier. */\n readonly profile: typeof CRATIS_PRESENTATION_PROFILE;\n /** Canonical immutable list of all nine stable slots. */\n readonly profileSlots: typeof cratisPresentationSlotIds;\n /** Required presentation capabilities followed by any optional stable capabilities. */\n readonly capabilities: CratisPresentationCapabilities;\n /** Complete nine-slot presentation implementation. */\n readonly slots: CratisPresentationSlotMap;\n /** Optional provider mounted once around the selected renderer scope. */\n readonly Provider?: ComponentType<CratisPresentationUiLibraryProviderProps>;\n}\n\nconst requiredCapabilityIds = [\n 'slot.render',\n 'parts.passthrough',\n 'ssr.staticRender',\n] as const;\n\nconst stableCapabilityIds = new Set<CratisPresentationCapabilityId>([\n ...requiredCapabilityIds,\n 'rtl',\n 'forcedColors',\n 'motion.reduced',\n]);\n\nconst invalidPresentationLibrary = (reason: string): never => {\n throw new TypeError(`Invalid stable presentation UI library: ${reason}.`);\n};\n\nconst hasCanonicalProfileSlots = (profileSlots: readonly unknown[]): boolean =>\n profileSlots.length === cratisPresentationSlotIds.length &&\n profileSlots.every((slotId, index) => slotId === cratisPresentationSlotIds[index]);\n\n/**\n * Defines and freezes a complete implementation of the stable nine-slot presentation profile.\n * Runtime validation protects JavaScript callers from claiming a profile they do not implement.\n *\n * @param library Stable presentation library declaration.\n * @returns A defensive, deeply frozen manifest copy.\n */\nexport const definePresentationUiLibrary = (\n library: CratisPresentationUiLibrary,\n): CratisPresentationUiLibrary => {\n if (library === null || typeof library !== 'object') {\n invalidPresentationLibrary('manifest must be an object');\n }\n if (\n typeof library.id !== 'string' ||\n library.id.length > 128 ||\n !/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u.test(library.id)\n ) {\n invalidPresentationLibrary('id must be a valid package-local renderer identity');\n }\n if (\n typeof library.displayName !== 'string' ||\n library.displayName.trim().length === 0 ||\n library.displayName.length > 128\n ) {\n invalidPresentationLibrary(\n 'displayName must contain between 1 and 128 characters',\n );\n }\n if (library.Provider !== undefined && typeof library.Provider !== 'function') {\n invalidPresentationLibrary('Provider must be a React component when supplied');\n }\n if (library.profile !== CRATIS_PRESENTATION_PROFILE) {\n invalidPresentationLibrary(`profile must be '${CRATIS_PRESENTATION_PROFILE}'`);\n }\n if (library.abi !== CRATIS_PRESENTATION_ABI_VERSION) {\n invalidPresentationLibrary(`ABI must be ${CRATIS_PRESENTATION_ABI_VERSION}`);\n }\n if (library.level !== 'primitive') {\n invalidPresentationLibrary(\"level must be 'primitive'\");\n }\n if (\n !Array.isArray(library.profileSlots) ||\n !hasCanonicalProfileSlots(library.profileSlots)\n ) {\n invalidPresentationLibrary(\n 'profileSlots must be the canonical nine-slot profile',\n );\n }\n if (!library.slots || typeof library.slots !== 'object') {\n invalidPresentationLibrary('slots must be an object');\n }\n\n const slotIds = Object.keys(library.slots);\n if (\n slotIds.length !== cratisPresentationSlotIds.length ||\n cratisPresentationSlotIds.some((slotId) => !slotIds.includes(slotId))\n ) {\n invalidPresentationLibrary(\n 'slots must contain exactly the nine stable presentation slots',\n );\n }\n\n for (const slotId of cratisPresentationSlotIds) {\n // SAFETY: the canonical slot list indexes the complete stable map; the wider record view\n // exists only so runtime JavaScript callers can be checked before their value is frozen.\n const declaration = library.slots[slotId] as unknown as\n Record<string, unknown> | undefined;\n if (!declaration) {\n throw new TypeError(\n `Invalid stable presentation UI library: slot '${slotId}' must provide a declaration.`,\n );\n }\n if (declaration.mode !== 'presentation') {\n invalidPresentationLibrary(`slot '${slotId}' must use presentation mode`);\n }\n if (declaration.fidelity !== 'native' && declaration.fidelity !== 'emulated') {\n invalidPresentationLibrary(\n `slot '${slotId}' must use native or emulated fidelity`,\n );\n }\n if (\n declaration.render === null ||\n (typeof declaration.render !== 'function' &&\n typeof declaration.render !== 'object')\n ) {\n invalidPresentationLibrary(`slot '${slotId}' must provide a component`);\n }\n }\n\n if (\n !Array.isArray(library.capabilities) ||\n library.capabilities.some((capability) => !stableCapabilityIds.has(capability))\n ) {\n invalidPresentationLibrary(\n 'capabilities must stay within the stable presentation subset',\n );\n }\n if (\n requiredCapabilityIds.some(\n (capability, index) => library.capabilities[index] !== capability,\n )\n ) {\n invalidPresentationLibrary(\n 'capabilities must begin with slot.render, parts.passthrough, and ssr.staticRender',\n );\n }\n if (new Set(library.capabilities).size !== library.capabilities.length) {\n invalidPresentationLibrary('capabilities must not contain duplicates');\n }\n\n const slots = Object.freeze(\n Object.fromEntries(\n cratisPresentationSlotIds.map((slotId) => [\n slotId,\n Object.freeze({\n mode: library.slots[slotId].mode,\n fidelity: library.slots[slotId].fidelity,\n render: library.slots[slotId].render,\n }),\n ]),\n ),\n ) as CratisPresentationSlotMap;\n\n return Object.freeze({\n id: library.id,\n displayName: library.displayName,\n abi: library.abi,\n level: library.level,\n profile: library.profile,\n profileSlots: cratisPresentationSlotIds,\n capabilities: Object.freeze([\n ...library.capabilities,\n ]) as CratisPresentationCapabilities,\n slots,\n Provider: library.Provider,\n });\n};\n"],"names":[],"mappings":"AAgBO,MAAM,2BAA2B,GAAG;AAGpC,MAAM,+BAA+B,GAAG;AAGxC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACnD,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,gBAAgB;AACV,CAAA;AA0FV,MAAM,qBAAqB,GAAG;IAC1B,aAAa;IACb,mBAAmB;IACnB,kBAAkB;CACZ;AAEV,MAAM,m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,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ;YACxC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM;SACvC,CAAC;KACL,CAAC,CACL,CACyB;IAE9B,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO;AACxB,QAAA,YAAY,EAAE,yBAAyB;AACvC,QAAA,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;YACxB,GAAG,OAAO,CAAC,YAAY;SAC1B,CAAmC;QACpC,KAAK;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAC7B,KAAA,CAAC;AACN;;"}
1
+ {"version":3,"file":"presentation.js","sources":["../../../renderer/presentation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ComponentType } from 'react';\nimport type { ButtonProps } from '../Common/Button';\nimport type { CheckboxProps } from '../Common/Checkbox';\nimport type { IconButtonProps } from '../Common/IconButton';\nimport type { RadioProps } from '../Common/Radio';\nimport type { SurfaceProps } from '../Common/Surface';\nimport type { SwitchProps } from '../Common/Switch';\nimport type { TextAreaProps } from '../Common/TextArea';\nimport type { TextInputProps } from '../Common/TextInput';\nimport type { TablePaginatorProps } from '../DataTables/TablePaginator';\nimport type { ProgressBarProps } from '../Display/ProgressBar';\nimport type { CratisPresentationUiLibraryProviderProps } from './manifest';\nimport type { unstable_SlotMap } from './slots';\n\n/** Stable renderer profile implemented by certified presentation adapters. */\nexport const CRATIS_PRESENTATION_PROFILE = 'stable-presentation/v1' as const;\n\n/** Renderer ABI major for the stable presentation profile. */\nexport const CRATIS_PRESENTATION_ABI_VERSION = 1 as const;\n\n/** Immutable, canonical slot order for the stable presentation profile. */\nexport const cratisPresentationSlotIds = Object.freeze([\n 'common.button',\n 'common.iconButton',\n 'common.textInput',\n 'common.textArea',\n 'common.checkbox',\n 'common.radio',\n 'common.switch',\n 'common.progress',\n 'common.surface',\n] as const);\n\n/** Identifier of one stable presentation slot. */\nexport type CratisPresentationSlotId = (typeof cratisPresentationSlotIds)[number];\n\n/** Exact public component prop and ref contracts covered by the stable presentation profile. */\nexport interface CratisPresentationSlots {\n /** Cratis button presentation contract, including native button refs and form behavior. */\n readonly 'common.button': ButtonProps;\n /** Accessible icon-only button contract with native button ownership. */\n readonly 'common.iconButton': IconButtonProps;\n /** Native text-input contract with semantic value-first change events. */\n readonly 'common.textInput': TextInputProps;\n /** Native multiline text-input contract with semantic value-first change events. */\n readonly 'common.textArea': TextAreaProps;\n /** Native checkbox contract with checked state, form participation, and input refs. */\n readonly 'common.checkbox': CheckboxProps;\n /** Native radio-option contract with selection state, form participation, and input refs. */\n readonly 'common.radio': RadioProps;\n /** Boolean switch contract preserving switch semantics and input ownership. */\n readonly 'common.switch': SwitchProps;\n /** Determinate or indeterminate progress presentation contract. */\n readonly 'common.progress': ProgressBarProps;\n /** Non-interactive semantic surface and native-element presentation contract. */\n readonly 'common.surface': SurfaceProps;\n}\n\n/** One stable, presentation-owned renderer slot declaration. */\nexport interface CratisPresentationSlotDeclaration<\n SlotId extends CratisPresentationSlotId,\n> {\n /** Stable presentation slots always preserve Components behavior ownership. */\n readonly mode: 'presentation';\n /** Unsupported declarations cannot claim the stable profile. */\n readonly fidelity: 'native' | 'emulated';\n /** Component implementing the slot's exact public props and ref contract. */\n readonly render: ComponentType<CratisPresentationSlots[SlotId]>;\n}\n\n/** Complete implementation table required by the stable presentation profile. */\nexport type CratisPresentationSlotMap = {\n readonly [\n SlotId in CratisPresentationSlotId\n ]: CratisPresentationSlotDeclaration<SlotId>;\n};\n\n/**\n * Immutable list of the atomic slots whose contracts are stable. A stable presentation library may\n * implement any of them through {@link CratisPresentationUiLibrary.atomicSlots}; new ids are only\n * ever appended.\n */\nexport const cratisAtomicSlotIds = Object.freeze(['datatables.paginator'] as const);\n\n/** Identifier of one stable atomic slot. */\nexport type CratisAtomicSlotId = (typeof cratisAtomicSlotIds)[number];\n\n/** Exact public component prop contracts covered by the stable atomic slots. */\nexport interface CratisAtomicSlots {\n /**\n * Table paginator contract: zero-based `page`, `pageCount`, zero-based `onPageChange`, the\n * `TablePaginatorParts` parts and no ref.\n */\n readonly 'datatables.paginator': TablePaginatorProps;\n}\n\n/** One stable, adapter-owned atomic slot declaration. */\nexport interface CratisAtomicSlotDeclaration<SlotId extends CratisAtomicSlotId> {\n /** Stable atomic slots give the adapter ownership of the complete interaction. */\n readonly mode: 'atomic';\n /** Unsupported declarations are expressed by omitting the slot. */\n readonly fidelity: 'native' | 'emulated';\n /** Component implementing the slot's exact public props contract. */\n readonly render: ComponentType<CratisAtomicSlots[SlotId]>;\n}\n\n/** Optional atomic implementations. An omitted slot keeps the built-in Components implementation. */\nexport type CratisAtomicSlotMap = {\n readonly [SlotId in CratisAtomicSlotId]?: CratisAtomicSlotDeclaration<SlotId>;\n};\n\n/** Capabilities whose meaning is stable for the bounded presentation profile. */\nexport type CratisPresentationCapabilityId =\n | 'slot.render'\n | 'parts.passthrough'\n | 'ssr.staticRender'\n | 'rtl'\n | 'forcedColors'\n | 'motion.reduced';\n\ntype CratisPresentationOptionalCapabilityId = Exclude<\n CratisPresentationCapabilityId,\n 'slot.render' | 'parts.passthrough' | 'ssr.staticRender'\n>;\n\n/** Required presentation capabilities followed by optional stable evidence capabilities. */\nexport type CratisPresentationCapabilities = readonly [\n 'slot.render',\n 'parts.passthrough',\n 'ssr.staticRender',\n ...CratisPresentationOptionalCapabilityId[],\n];\n\n/** Immutable manifest for one implementation of the stable presentation profile. */\nexport interface CratisPresentationUiLibrary {\n /** Stable, package-local renderer identity used for diagnostics and telemetry. */\n readonly id: string;\n /** Human-readable renderer name. */\n readonly displayName: string;\n /** Stable presentation renderer ABI major. */\n readonly abi: typeof CRATIS_PRESENTATION_ABI_VERSION;\n /** The bounded profile is a primitive presentation adapter. */\n readonly level: 'primitive';\n /** Exact stable presentation profile identifier. */\n readonly profile: typeof CRATIS_PRESENTATION_PROFILE;\n /** Canonical immutable list of all nine stable slots. */\n readonly profileSlots: typeof cratisPresentationSlotIds;\n /** Required presentation capabilities followed by any optional stable capabilities. */\n readonly capabilities: CratisPresentationCapabilities;\n /** Complete nine-slot presentation implementation. */\n readonly slots: CratisPresentationSlotMap;\n /** Optional provider mounted once around the selected renderer scope. */\n readonly Provider?: ComponentType<CratisPresentationUiLibraryProviderProps>;\n /**\n * Optional adapter-owned implementations of stable atomic slots. Omitted slots resolve to the\n * built-in Components implementation.\n */\n readonly atomicSlots?: CratisAtomicSlotMap;\n}\n\nconst requiredCapabilityIds = [\n 'slot.render',\n 'parts.passthrough',\n 'ssr.staticRender',\n] as const;\n\nconst stableCapabilityIds = new Set<CratisPresentationCapabilityId>([\n ...requiredCapabilityIds,\n 'rtl',\n 'forcedColors',\n 'motion.reduced',\n]);\n\nconst invalidPresentationLibrary: (reason: string) => never = (reason) => {\n throw new TypeError(`Invalid stable presentation UI library: ${reason}.`);\n};\n\nconst hasCanonicalProfileSlots = (profileSlots: readonly unknown[]): boolean =>\n profileSlots.length === cratisPresentationSlotIds.length &&\n profileSlots.every((slotId, index) => slotId === cratisPresentationSlotIds[index]);\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\n\nconst isRendererIdentity = (id: unknown): boolean =>\n typeof id === 'string' &&\n id.length <= 128 &&\n /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u.test(id);\n\nconst isDisplayName = (displayName: unknown): boolean =>\n typeof displayName === 'string' &&\n displayName.trim().length > 0 &&\n displayName.length <= 128;\n\nconst isComponent = (render: unknown): boolean =>\n render !== null && (typeof render === 'function' || typeof render === 'object');\n\nconst isStableFidelity = (fidelity: unknown): boolean =>\n fidelity === 'native' || fidelity === 'emulated';\n\nconst validateIdentity = (library: CratisPresentationUiLibrary) => {\n if (library === null || typeof library !== 'object') {\n invalidPresentationLibrary('manifest must be an object');\n }\n if (!isRendererIdentity(library.id)) {\n invalidPresentationLibrary('id must be a valid package-local renderer identity');\n }\n if (!isDisplayName(library.displayName)) {\n invalidPresentationLibrary(\n 'displayName must contain between 1 and 128 characters',\n );\n }\n if (library.Provider !== undefined && typeof library.Provider !== 'function') {\n invalidPresentationLibrary('Provider must be a React component when supplied');\n }\n};\n\nconst validateProfile = (library: CratisPresentationUiLibrary) => {\n if (library.profile !== CRATIS_PRESENTATION_PROFILE) {\n invalidPresentationLibrary(`profile must be '${CRATIS_PRESENTATION_PROFILE}'`);\n }\n if (library.abi !== CRATIS_PRESENTATION_ABI_VERSION) {\n invalidPresentationLibrary(`ABI must be ${CRATIS_PRESENTATION_ABI_VERSION}`);\n }\n if (library.level !== 'primitive') {\n invalidPresentationLibrary(\"level must be 'primitive'\");\n }\n if (\n !Array.isArray(library.profileSlots) ||\n !hasCanonicalProfileSlots(library.profileSlots)\n ) {\n invalidPresentationLibrary(\n 'profileSlots must be the canonical nine-slot profile',\n );\n }\n};\n\nconst declarationProblem = (\n declaration: Record<string, unknown>,\n label: string,\n mode: 'presentation' | 'atomic',\n): string | undefined => {\n if (declaration.mode !== mode) return `${label} must use ${mode} mode`;\n if (!isStableFidelity(declaration.fidelity)) {\n return `${label} must use native or emulated fidelity`;\n }\n if (!isComponent(declaration.render)) return `${label} must provide a component`;\n return undefined;\n};\n\nconst validateDeclaration = (\n declaration: Record<string, unknown>,\n label: string,\n mode: 'presentation' | 'atomic',\n) => {\n const problem = declarationProblem(declaration, label, mode);\n if (problem) invalidPresentationLibrary(problem);\n};\n\nconst validateSlots = (library: CratisPresentationUiLibrary) => {\n if (!library.slots || typeof library.slots !== 'object') {\n invalidPresentationLibrary('slots must be an object');\n }\n\n const slotIds = Object.keys(library.slots);\n if (\n slotIds.length !== cratisPresentationSlotIds.length ||\n cratisPresentationSlotIds.some((slotId) => !slotIds.includes(slotId))\n ) {\n invalidPresentationLibrary(\n 'slots must contain exactly the nine stable presentation slots',\n );\n }\n\n for (const slotId of cratisPresentationSlotIds) {\n // SAFETY: the canonical slot list indexes the complete stable map; the wider record view\n // exists only so runtime JavaScript callers can be checked before their value is frozen.\n const declaration = library.slots[slotId] as unknown as\n Record<string, unknown> | undefined;\n if (!declaration) {\n invalidPresentationLibrary(`slot '${slotId}' must provide a declaration`);\n }\n validateDeclaration(declaration, `slot '${slotId}'`, 'presentation');\n }\n};\n\nconst validateCapabilities = (library: CratisPresentationUiLibrary) => {\n if (\n !Array.isArray(library.capabilities) ||\n library.capabilities.some((capability) => !stableCapabilityIds.has(capability))\n ) {\n invalidPresentationLibrary(\n 'capabilities must stay within the stable presentation subset',\n );\n }\n if (\n requiredCapabilityIds.some(\n (capability, index) => library.capabilities[index] !== capability,\n )\n ) {\n invalidPresentationLibrary(\n 'capabilities must begin with slot.render, parts.passthrough, and ssr.staticRender',\n );\n }\n if (new Set(library.capabilities).size !== library.capabilities.length) {\n invalidPresentationLibrary('capabilities must not contain duplicates');\n }\n};\n\nconst isStableAtomicSlotId = (slotId: string): slotId is CratisAtomicSlotId =>\n (cratisAtomicSlotIds as readonly string[]).includes(slotId);\n\n/** One atomic slot entry inspected from a single own-enumerable snapshot of `atomicSlots`. */\ninterface AtomicSlotEntry {\n readonly slotId: string;\n /** Declaration read exactly once, or undefined for an explicitly omitted slot. */\n readonly declaration?: Readonly<Record<string, unknown>>;\n /** Why the entry cannot be used; undefined when it is valid. */\n readonly problem?: string;\n}\n\n/** Inspection of a library's `atomicSlots`: one problem for the map, or one result per own key. */\ninterface AtomicSlotInspection {\n readonly problem?: string;\n readonly entries: readonly AtomicSlotEntry[];\n}\n\nconst snapshotDeclaration = (declaration: Record<string, unknown>) => ({\n mode: declaration.mode,\n fidelity: declaration.fidelity,\n render: declaration.render,\n});\n\nconst inspectAtomicSlot = (slotId: string, value: unknown): AtomicSlotEntry => {\n const label = `atomic slot '${slotId}'`;\n if (!isStableAtomicSlotId(slotId)) {\n return { slotId, problem: `${label} is not a stable atomic slot` };\n }\n if (value === undefined) return { slotId };\n if (!isRecord(value)) return { slotId, problem: `${label} must provide a declaration` };\n\n const declaration = snapshotDeclaration(value);\n return { slotId, declaration, problem: declarationProblem(declaration, label, 'atomic') };\n};\n\nconst isPlainPrototype = (prototype: unknown): boolean =>\n prototype === null || prototype === Object.prototype;\n\n/**\n * Inspects `atomicSlots` through ONE snapshot of its own enumerable keys, reading each value\n * once. Inherited and non-enumerable declarations never take part in validation or resolution.\n */\nconst inspectAtomicSlots = (atomicSlots: unknown): AtomicSlotInspection => {\n if (atomicSlots === undefined) return { entries: [] };\n if (!isRecord(atomicSlots)) {\n return { problem: 'atomicSlots must be an object when supplied', entries: [] };\n }\n if (!isPlainPrototype(Object.getPrototypeOf(atomicSlots))) {\n return {\n problem: 'atomicSlots must be a plain object; inherited declarations are not allowed',\n entries: [],\n };\n }\n return {\n entries: Object.keys(atomicSlots).map((slotId) =>\n inspectAtomicSlot(slotId, atomicSlots[slotId]),\n ),\n };\n};\n\nconst isUsableAtomicSlot = (\n entry: AtomicSlotEntry,\n): entry is AtomicSlotEntry & { readonly declaration: Readonly<Record<string, unknown>> } =>\n entry.problem === undefined && entry.declaration !== undefined;\n\n/** Builds a frozen slot-id keyed map of the usable entries; keys are own data properties. */\nconst usableAtomicSlots = (entries: readonly AtomicSlotEntry[]): Readonly<Record<string, object>> =>\n Object.freeze(\n Object.fromEntries(\n entries\n .filter(isUsableAtomicSlot)\n .map(({ slotId, declaration }) => [slotId, Object.freeze(declaration)]),\n ),\n );\n\nconst frozenValidAtomicSlots = (atomicSlots: unknown): CratisAtomicSlotMap | undefined => {\n if (atomicSlots === undefined) return undefined;\n const inspection = inspectAtomicSlots(atomicSlots);\n const problem =\n inspection.problem ?? inspection.entries.find((entry) => entry.problem)?.problem;\n if (problem) invalidPresentationLibrary(problem);\n return usableAtomicSlots(inspection.entries) as CratisAtomicSlotMap;\n};\n\nconst freezeDeclaration = <\n Declaration extends {\n readonly mode: string;\n readonly fidelity: string;\n readonly render: unknown;\n },\n>(\n declaration: Declaration,\n): Declaration =>\n Object.freeze({\n mode: declaration.mode,\n fidelity: declaration.fidelity,\n render: declaration.render,\n }) as Declaration;\n\nconst freezePresentationSlots = (\n slots: CratisPresentationSlotMap,\n): CratisPresentationSlotMap =>\n Object.freeze(\n Object.fromEntries(\n cratisPresentationSlotIds.map((slotId) => [\n slotId,\n freezeDeclaration(slots[slotId]),\n ]),\n ),\n ) as CratisPresentationSlotMap;\n\n/**\n * Defines and freezes a complete implementation of the stable nine-slot presentation profile,\n * plus any optional stable atomic slots. Runtime validation protects JavaScript callers from\n * claiming a profile they do not implement.\n *\n * @param library Stable presentation library declaration.\n * @returns A defensive, deeply frozen manifest copy.\n */\nexport const definePresentationUiLibrary = (\n library: CratisPresentationUiLibrary,\n): CratisPresentationUiLibrary => {\n validateIdentity(library);\n validateProfile(library);\n validateSlots(library);\n validateCapabilities(library);\n const atomicSlots = frozenValidAtomicSlots(library.atomicSlots);\n\n return Object.freeze({\n id: library.id,\n displayName: library.displayName,\n abi: library.abi,\n level: library.level,\n profile: library.profile,\n profileSlots: cratisPresentationSlotIds,\n capabilities: Object.freeze([\n ...library.capabilities,\n ]) as CratisPresentationCapabilities,\n slots: freezePresentationSlots(library.slots),\n Provider: library.Provider,\n ...(atomicSlots === undefined ? {} : { atomicSlots }),\n });\n};\n\nconst atomicSlotsInspectionOf = (library: { readonly profile: string }) =>\n library.profile === CRATIS_PRESENTATION_PROFILE\n ? inspectAtomicSlots((library as { readonly atomicSlots?: unknown }).atomicSlots)\n : { entries: [] };\n\n/** One reason a stable presentation library's atomic slot cannot be resolved. */\nexport interface StableAtomicSlotProblem {\n /** Offending slot id, when the problem concerns a single entry. */\n readonly slotId?: string;\n /** Human-readable reason. */\n readonly message: string;\n}\n\n/**\n * Lists why a stable presentation library's atomic slots cannot all be resolved. Libraries built\n * with the generic definer or as raw manifests can claim the stable profile without passing\n * {@link definePresentationUiLibrary}; resolution skips their invalid entries and this reports them.\n *\n * @param library Renderer library being validated.\n * @returns Problems in key order; empty for valid or absent atomic slots and for other profiles.\n * @internal Resolution helper; not part of the public package surface.\n */\nexport const stableAtomicSlotProblemsOf = (library: {\n readonly profile: string;\n}): readonly StableAtomicSlotProblem[] => {\n const inspection: AtomicSlotInspection = atomicSlotsInspectionOf(library);\n if (inspection.problem) return [{ message: inspection.problem }];\n return inspection.entries.flatMap(({ slotId, problem }) =>\n problem ? [{ slotId, message: problem }] : [],\n );\n};\n\n/**\n * Returns the stable atomic slot declarations a stable presentation library adds to resolution.\n * Only own enumerable, fully valid declarations take part; invalid ones fail closed to the\n * built-in implementation and are reported by {@link stableAtomicSlotProblemsOf}. Libraries of any\n * other profile, and libraries without `atomicSlots`, contribute nothing, so their slot tables\n * resolve exactly as before.\n *\n * @param library Renderer library being resolved.\n * @returns The library's stable atomic declarations keyed by slot id; empty when it has none.\n * @internal Resolution helper; not part of the public package surface.\n */\nexport const stableAtomicSlotsOf = (library: {\n readonly profile: string;\n}): unstable_SlotMap =>\n usableAtomicSlots(atomicSlotsInspectionOf(library).entries) as unstable_SlotMap;\n"],"names":[],"mappings":"AAkBO,MAAM,2BAA2B,GAAG;AAGpC,MAAM,+BAA+B,GAAG;AAGxC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACnD,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,gBAAgB;AACV,CAAA;AAmDH,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAU;AA8ElF,MAAM,qBAAqB,GAAG;IAC1B,aAAa;IACb,mBAAmB;IACnB,kBAAkB;CACZ;AAEV,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAiC;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: unknown) => value is unstable_SlotId;
19
19
  /** Normalizes one library or an ordered last-wins composition without deep merging it. */
20
20
  export declare const unstable_resolveLibraryInput: (input: unstable_UiLibrary | readonly unstable_UiLibrary[] | undefined) => unstable_ResolvedLibraryInput;
21
- /** Creates one immutable slot lookup snapshot for a manifest and optional scope filter. */
21
+ /**
22
+ * Creates one immutable slot lookup snapshot for a manifest and optional scope filter. A stable
23
+ * presentation library's optional atomic slots join its nine presentation slots here.
24
+ */
22
25
  export declare const unstable_createRendererLayer: (library: unstable_UiLibrary, only?: readonly unstable_SlotId[]) => unstable_RendererLayer;
23
26
  /** Runs ABI, profile, capability, and adapter preflight validation. */
24
27
  export declare const unstable_validateUiLibrary: (library: unstable_UiLibrary) => readonly unstable_AdapterDiagnostic[];
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../renderer/resolve.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAU,CAAC;AAE3D,OAAO,EAGH,KAAK,kBAAkB,EAC1B,MAAM,eAAY,CAAC;AACpB,OAAO,KAAK,EACR,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EACnB,MAAM,YAAS,CAAC;AAmBjB,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;CAChD;AAED,sFAAsF;AACtF,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACtD;AAED,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B,EAAE,gBAAoC,CAAC;AAEnF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,UA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CAAC,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAUxE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,sBAAsB,eAAgB,0BAA0B,KAAG,MAMjE,CAAC;AAEhB,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,eAAgB,0BAA0B,KAAG,IAI/E,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { unstable_adapterErrorCodes } from './errors.js';
2
- import { unstable_composeUiLibraries, unstable_CRATIS_UI_ABI_VERSION } from './manifest.js';
2
+ import { unstable_composeUiLibraries, unstable_CRATIS_UI_ABI_VERSION, defineOwnSlot } from './manifest.js';
3
+ import { stableAtomicSlotsOf, stableAtomicSlotProblemsOf } from './presentation.js';
3
4
 
4
5
  const knownSlots = new Set([
5
6
  'common.button',
@@ -35,7 +36,7 @@ const unstable_resolveLibraryInput = (input) => {
35
36
  };
36
37
  const unstable_createRendererLayer = (library, only) => Object.freeze({
37
38
  library,
38
- slots: Object.freeze({ ...library.slots }),
39
+ slots: Object.freeze({ ...library.slots, ...stableAtomicSlotsOf(library) }),
39
40
  only: only ? new Set(only) : undefined,
40
41
  });
41
42
  const missingRequirement = (library, message, remedy, slotId) => ({
@@ -45,6 +46,16 @@ const missingRequirement = (library, message, remedy, slotId) => ({
45
46
  message,
46
47
  remedy,
47
48
  });
49
+ const profileSlotDiagnostic = (library, profileSlot) => {
50
+ if (!unstable_isKnownSlot(profileSlot)) {
51
+ return missingRequirement(library, `Profile '${library.profile}' promises unknown slot '${String(profileSlot)}'.`, 'Remove the unknown slot or install a Core version that declares it.');
52
+ }
53
+ const declaration = library.slots[profileSlot];
54
+ if (declaration && declaration.fidelity !== 'unsupported')
55
+ return undefined;
56
+ return missingRequirement(library, `Profile '${library.profile}' does not support promised slot '${profileSlot}'.`, `Provide a supported '${profileSlot}' declaration or remove it from profileSlots.`, profileSlot);
57
+ };
58
+ const atomicSlotDiagnostics = (library) => stableAtomicSlotProblemsOf(library).map(({ slotId, message }) => missingRequirement(library, `Invalid stable atomic slot declaration: ${message}.`, 'Correct or remove the atomic slot declaration; the built-in implementation is used instead.', unstable_isKnownSlot(slotId) ? slotId : undefined));
48
59
  const unstable_validateUiLibrary = (library) => {
49
60
  const diagnostics = [];
50
61
  if (library.abi !== unstable_CRATIS_UI_ABI_VERSION) {
@@ -60,15 +71,11 @@ const unstable_validateUiLibrary = (library) => {
60
71
  diagnostics.push(missingRequirement(library, `Profile '${library.profile}' promises slots without the 'slot.render' capability.`, "Declare 'slot.render' only after the adapter can render every promised slot."));
61
72
  }
62
73
  for (const profileSlot of profileSlots) {
63
- if (!unstable_isKnownSlot(profileSlot)) {
64
- diagnostics.push(missingRequirement(library, `Profile '${library.profile}' promises unknown slot '${String(profileSlot)}'.`, 'Remove the unknown slot or install a Core version that declares it.'));
65
- continue;
66
- }
67
- const declaration = library.slots[profileSlot];
68
- if (!declaration || declaration.fidelity === 'unsupported') {
69
- diagnostics.push(missingRequirement(library, `Profile '${library.profile}' does not support promised slot '${profileSlot}'.`, `Provide a supported '${profileSlot}' declaration or remove it from profileSlots.`, profileSlot));
70
- }
74
+ const diagnostic = profileSlotDiagnostic(library, profileSlot);
75
+ if (diagnostic)
76
+ diagnostics.push(diagnostic);
71
77
  }
78
+ diagnostics.push(...atomicSlotDiagnostics(library));
72
79
  if (library.preflight) {
73
80
  try {
74
81
  diagnostics.push(...library.preflight());
@@ -86,15 +93,17 @@ const unstable_validateUiLibrary = (library) => {
86
93
  };
87
94
  const unstable_sameLibraryReferences = (left, right) => left.length === right.length &&
88
95
  left.every((library, index) => library === right[index]);
96
+ const isResolvable = (layer, slotId, declaration) => {
97
+ if (!declaration || declaration.fidelity === 'unsupported')
98
+ return false;
99
+ return !layer.only || layer.only.has(slotId);
100
+ };
89
101
  const unstable_createResolvedSlotTable = (layers) => {
90
102
  const resolved = {};
91
103
  for (const layer of layers) {
92
104
  for (const [slotId, declaration] of Object.entries(layer.slots)) {
93
- if (!declaration ||
94
- declaration.fidelity === 'unsupported' ||
95
- (layer.only && !layer.only.has(slotId)))
96
- continue;
97
- resolved[slotId] = declaration;
105
+ if (isResolvable(layer, slotId, declaration))
106
+ defineOwnSlot(resolved, slotId, declaration);
98
107
  }
99
108
  }
100
109
  return Object.freeze(resolved);
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sources":["../../../renderer/resolve.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { unstable_AdapterDiagnostic } from './errors';\nimport { unstable_adapterErrorCodes } from './errors';\nimport {\n unstable_composeUiLibraries,\n unstable_CRATIS_UI_ABI_VERSION,\n type unstable_UiLibrary,\n} from './manifest';\nimport type {\n unstable_SlotDeclaration,\n unstable_SlotId,\n unstable_SlotMap,\n} from './slots';\n\nconst knownSlots = new Set<unstable_SlotId>([\n 'common.button',\n 'common.iconButton',\n 'common.textInput',\n 'common.textArea',\n 'common.checkbox',\n 'common.radio',\n 'common.switch',\n 'common.progress',\n 'common.surface',\n 'common.tooltip',\n 'dropdown.select',\n 'dialogs.dialog',\n 'display.datePicker',\n 'datatables.paginator',\n]);\n\n/** Internal immutable renderer layer used by context resolution. */\nexport interface unstable_RendererLayer {\n readonly library: unstable_UiLibrary;\n readonly slots: unstable_SlotMap;\n readonly only?: ReadonlySet<unstable_SlotId>;\n}\n\n/** Identity-preserving normalization result for a provider or scope library input. */\nexport interface unstable_ResolvedLibraryInput {\n readonly library?: unstable_UiLibrary;\n readonly references: readonly unstable_UiLibrary[];\n}\n\n/** Empty D2 Core fallback table. Slice E can inject its built-in table without a registry. */\nexport const unstable_emptyCoreRendererSlots: unstable_SlotMap = Object.freeze({});\n\n/** Returns whether a value is one of the Core-owned slot identifiers. */\nexport const unstable_isKnownSlot = (value: unknown): value is unstable_SlotId =>\n typeof value === 'string' && knownSlots.has(value as unstable_SlotId);\n\n/** Normalizes one library or an ordered last-wins composition without deep merging it. */\nexport const unstable_resolveLibraryInput = (\n input: unstable_UiLibrary | readonly unstable_UiLibrary[] | undefined,\n): unstable_ResolvedLibraryInput => {\n if (!input) return Object.freeze({ references: Object.freeze([]) });\n\n const references = Object.freeze(Array.isArray(input) ? [...input] : [input]);\n if (references.length === 0) {\n return Object.freeze({ references });\n }\n\n return Object.freeze({\n library:\n references.length === 1\n ? references[0]\n : unstable_composeUiLibraries(...references),\n references,\n });\n};\n\n/** Creates one immutable slot lookup snapshot for a manifest and optional scope filter. */\nexport const unstable_createRendererLayer = (\n library: unstable_UiLibrary,\n only?: readonly unstable_SlotId[],\n): unstable_RendererLayer =>\n Object.freeze({\n library,\n slots: Object.freeze({ ...library.slots }),\n only: only ? new Set(only) : undefined,\n });\n\nconst missingRequirement = (\n library: unstable_UiLibrary,\n message: string,\n remedy: string,\n slotId?: unstable_SlotId,\n): unstable_AdapterDiagnostic => ({\n code: unstable_adapterErrorCodes.missingRequirement,\n adapterId: library.id,\n slotId,\n message,\n remedy,\n});\n\n/** Runs ABI, profile, capability, and adapter preflight validation. */\nexport const unstable_validateUiLibrary = (\n library: unstable_UiLibrary,\n): readonly unstable_AdapterDiagnostic[] => {\n const diagnostics: unstable_AdapterDiagnostic[] = [];\n\n if (library.abi !== unstable_CRATIS_UI_ABI_VERSION) {\n diagnostics.push({\n code: unstable_adapterErrorCodes.abiMismatch,\n adapterId: library.id,\n message: `Renderer ABI ${library.abi} does not match Core ABI ${unstable_CRATIS_UI_ABI_VERSION}.`,\n remedy: `Install a renderer that targets ABI ${unstable_CRATIS_UI_ABI_VERSION}.`,\n });\n }\n\n const profileSlots = library.profileSlots ?? Object.keys(library.slots);\n if (profileSlots.length > 0 && !library.capabilities.includes('slot.render')) {\n diagnostics.push(\n missingRequirement(\n library,\n `Profile '${library.profile}' promises slots without the 'slot.render' capability.`,\n \"Declare 'slot.render' only after the adapter can render every promised slot.\",\n ),\n );\n }\n\n for (const profileSlot of profileSlots) {\n if (!unstable_isKnownSlot(profileSlot)) {\n diagnostics.push(\n missingRequirement(\n library,\n `Profile '${library.profile}' promises unknown slot '${String(profileSlot)}'.`,\n 'Remove the unknown slot or install a Core version that declares it.',\n ),\n );\n continue;\n }\n\n const declaration = library.slots[profileSlot];\n if (!declaration || declaration.fidelity === 'unsupported') {\n diagnostics.push(\n missingRequirement(\n library,\n `Profile '${library.profile}' does not support promised slot '${profileSlot}'.`,\n `Provide a supported '${profileSlot}' declaration or remove it from profileSlots.`,\n profileSlot,\n ),\n );\n }\n }\n\n if (library.preflight) {\n try {\n diagnostics.push(...library.preflight());\n } catch (error: unknown) {\n diagnostics.push({\n code: unstable_adapterErrorCodes.missingUpstreamPeer,\n adapterId: library.id,\n message: `Renderer preflight failed: ${error instanceof Error ? error.message : String(error)}.`,\n remedy: 'Correct the renderer installation so its preflight can complete.',\n });\n }\n }\n\n return Object.freeze([...diagnostics]);\n};\n\n/** Compares normalized library identities without comparing or cloning manifest contents. */\nexport const unstable_sameLibraryReferences = (\n left: readonly unstable_UiLibrary[],\n right: readonly unstable_UiLibrary[],\n): boolean =>\n left.length === right.length &&\n left.every((library, index) => library === right[index]);\n\n/** Flattens outer-to-inner layers into one frozen, last-wins lookup table. */\nexport const unstable_createResolvedSlotTable = (\n layers: readonly unstable_RendererLayer[],\n): unstable_SlotMap => {\n const resolved: Record<string, object> = {};\n for (const layer of layers) {\n for (const [slotId, declaration] of Object.entries(layer.slots)) {\n if (\n !declaration ||\n declaration.fidelity === 'unsupported' ||\n (layer.only && !layer.only.has(slotId as unstable_SlotId))\n )\n continue;\n resolved[slotId] = declaration;\n }\n }\n return Object.freeze(resolved) as unstable_SlotMap;\n};\n\n/** Resolves a slot through external layers, a facade-local Core declaration, then Core context. */\nexport const unstable_resolveSlot = <K extends unstable_SlotId>(\n slotId: K,\n slots: unstable_SlotMap,\n localCoreDeclaration: unstable_SlotDeclaration<K> | undefined,\n coreSlots: unstable_SlotMap,\n): { declaration?: unstable_SlotDeclaration<K>; usedCoreFallback: boolean } => {\n const declaration = slots[slotId] as unstable_SlotDeclaration<K> | undefined;\n if (declaration) return { declaration, usedCoreFallback: false };\n\n return {\n declaration:\n localCoreDeclaration ??\n (coreSlots[slotId] as unstable_SlotDeclaration<K> | undefined),\n usedCoreFallback: true,\n };\n};\n\n/** Stable log key used to de-duplicate diagnostics within one provider identity. */\nexport const unstable_diagnosticKey = (diagnostic: unstable_AdapterDiagnostic): string =>\n [\n diagnostic.code,\n diagnostic.adapterId,\n diagnostic.slotId ?? '',\n diagnostic.message,\n ].join('|');\n\n/** Emits one actionable renderer diagnostic without exposing manifest contents. */\nexport const unstable_logDiagnostic = (diagnostic: unstable_AdapterDiagnostic): void => {\n console.error(\n `[${diagnostic.code}] ${diagnostic.message} Remedy: ${diagnostic.remedy}`,\n );\n};\n"],"names":[],"mappings":";;;AAgBA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAkB;IACxC,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;AACzB,CAAA,CAAC;AAgBK,MAAM,+BAA+B,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE;MAGpE,oBAAoB,GAAG,CAAC,KAAc,KAC/C,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAwB;AAGjE,MAAM,4BAA4B,GAAG,CACxC,KAAqE,KACtC;AAC/B,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAEnE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7E,IAAA,IAAI,UAA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AAO;AACH,QAAA,WAAW,EACP,oBAAoB;YACnB,SAAS,CAAC,MAAM,CAA6C;AAClE,QAAA,gBAAgB,EAAE,IAAI;KACzB;AACL;MAGa,sBAAsB,GAAG,CAAC,UAAsC,KACzE;AACI,IAAA,UAAU,CAAC,IAAI;AACf,IAAA,UAAU,CAAC,SAAS;IACpB,UAAU,CAAC,MAAM,IAAI,EAAE;AACvB,IAAA,UAAU,CAAC,OAAO;AACrB,CAAA,CAAC,IAAI,CAAC,GAAG;AAGP,MAAM,sBAAsB,GAAG,CAAC,UAAsC,KAAU;AACnF,IAAA,OAAO,CAAC,KAAK,CACT,CAAA,CAAA,EAAI,UAAU,CAAC,IAAI,CAAA,EAAA,EAAK,UAAU,CAAC,OAAO,CAAA,SAAA,EAAY,UAAU,CAAC,MAAM,CAAA,CAAE,CAC5E;AACL;;"}
1
+ {"version":3,"file":"resolve.js","sources":["../../../renderer/resolve.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { unstable_AdapterDiagnostic } from './errors';\nimport { unstable_adapterErrorCodes } from './errors';\nimport {\n defineOwnSlot,\n unstable_composeUiLibraries,\n unstable_CRATIS_UI_ABI_VERSION,\n type unstable_UiLibrary,\n} from './manifest';\nimport { stableAtomicSlotProblemsOf, stableAtomicSlotsOf } from './presentation';\nimport type {\n unstable_SlotDeclaration,\n unstable_SlotId,\n unstable_SlotMap,\n} from './slots';\n\nconst knownSlots = new Set<unstable_SlotId>([\n 'common.button',\n 'common.iconButton',\n 'common.textInput',\n 'common.textArea',\n 'common.checkbox',\n 'common.radio',\n 'common.switch',\n 'common.progress',\n 'common.surface',\n 'common.tooltip',\n 'dropdown.select',\n 'dialogs.dialog',\n 'display.datePicker',\n 'datatables.paginator',\n]);\n\n/** Internal immutable renderer layer used by context resolution. */\nexport interface unstable_RendererLayer {\n readonly library: unstable_UiLibrary;\n readonly slots: unstable_SlotMap;\n readonly only?: ReadonlySet<unstable_SlotId>;\n}\n\n/** Identity-preserving normalization result for a provider or scope library input. */\nexport interface unstable_ResolvedLibraryInput {\n readonly library?: unstable_UiLibrary;\n readonly references: readonly unstable_UiLibrary[];\n}\n\n/** Empty D2 Core fallback table. Slice E can inject its built-in table without a registry. */\nexport const unstable_emptyCoreRendererSlots: unstable_SlotMap = Object.freeze({});\n\n/** Returns whether a value is one of the Core-owned slot identifiers. */\nexport const unstable_isKnownSlot = (value: unknown): value is unstable_SlotId =>\n typeof value === 'string' && knownSlots.has(value as unstable_SlotId);\n\n/** Normalizes one library or an ordered last-wins composition without deep merging it. */\nexport const unstable_resolveLibraryInput = (\n input: unstable_UiLibrary | readonly unstable_UiLibrary[] | undefined,\n): unstable_ResolvedLibraryInput => {\n if (!input) return Object.freeze({ references: Object.freeze([]) });\n\n const references = Object.freeze(Array.isArray(input) ? [...input] : [input]);\n if (references.length === 0) {\n return Object.freeze({ references });\n }\n\n return Object.freeze({\n library:\n references.length === 1\n ? references[0]\n : unstable_composeUiLibraries(...references),\n references,\n });\n};\n\n/**\n * Creates one immutable slot lookup snapshot for a manifest and optional scope filter. A stable\n * presentation library's optional atomic slots join its nine presentation slots here.\n */\nexport const unstable_createRendererLayer = (\n library: unstable_UiLibrary,\n only?: readonly unstable_SlotId[],\n): unstable_RendererLayer =>\n Object.freeze({\n library,\n slots: Object.freeze({ ...library.slots, ...stableAtomicSlotsOf(library) }),\n only: only ? new Set(only) : undefined,\n });\n\nconst missingRequirement = (\n library: unstable_UiLibrary,\n message: string,\n remedy: string,\n slotId?: unstable_SlotId,\n): unstable_AdapterDiagnostic => ({\n code: unstable_adapterErrorCodes.missingRequirement,\n adapterId: library.id,\n slotId,\n message,\n remedy,\n});\n\nconst profileSlotDiagnostic = (\n library: unstable_UiLibrary,\n profileSlot: string,\n): unstable_AdapterDiagnostic | undefined => {\n if (!unstable_isKnownSlot(profileSlot)) {\n return missingRequirement(\n library,\n `Profile '${library.profile}' promises unknown slot '${String(profileSlot)}'.`,\n 'Remove the unknown slot or install a Core version that declares it.',\n );\n }\n\n const declaration = library.slots[profileSlot];\n if (declaration && declaration.fidelity !== 'unsupported') return undefined;\n return missingRequirement(\n library,\n `Profile '${library.profile}' does not support promised slot '${profileSlot}'.`,\n `Provide a supported '${profileSlot}' declaration or remove it from profileSlots.`,\n profileSlot,\n );\n};\n\n/** Reports stable atomic slots that resolution skipped, so they fail closed but visibly. */\nconst atomicSlotDiagnostics = (library: unstable_UiLibrary) =>\n stableAtomicSlotProblemsOf(library).map(({ slotId, message }) =>\n missingRequirement(\n library,\n `Invalid stable atomic slot declaration: ${message}.`,\n 'Correct or remove the atomic slot declaration; the built-in implementation is used instead.',\n unstable_isKnownSlot(slotId) ? slotId : undefined,\n ),\n );\n\n/** Runs ABI, profile, capability, and adapter preflight validation. */\nexport const unstable_validateUiLibrary = (\n library: unstable_UiLibrary,\n): readonly unstable_AdapterDiagnostic[] => {\n const diagnostics: unstable_AdapterDiagnostic[] = [];\n\n if (library.abi !== unstable_CRATIS_UI_ABI_VERSION) {\n diagnostics.push({\n code: unstable_adapterErrorCodes.abiMismatch,\n adapterId: library.id,\n message: `Renderer ABI ${library.abi} does not match Core ABI ${unstable_CRATIS_UI_ABI_VERSION}.`,\n remedy: `Install a renderer that targets ABI ${unstable_CRATIS_UI_ABI_VERSION}.`,\n });\n }\n\n const profileSlots = library.profileSlots ?? Object.keys(library.slots);\n if (profileSlots.length > 0 && !library.capabilities.includes('slot.render')) {\n diagnostics.push(\n missingRequirement(\n library,\n `Profile '${library.profile}' promises slots without the 'slot.render' capability.`,\n \"Declare 'slot.render' only after the adapter can render every promised slot.\",\n ),\n );\n }\n\n for (const profileSlot of profileSlots) {\n const diagnostic = profileSlotDiagnostic(library, profileSlot);\n if (diagnostic) diagnostics.push(diagnostic);\n }\n diagnostics.push(...atomicSlotDiagnostics(library));\n\n if (library.preflight) {\n try {\n diagnostics.push(...library.preflight());\n } catch (error: unknown) {\n diagnostics.push({\n code: unstable_adapterErrorCodes.missingUpstreamPeer,\n adapterId: library.id,\n message: `Renderer preflight failed: ${error instanceof Error ? error.message : String(error)}.`,\n remedy: 'Correct the renderer installation so its preflight can complete.',\n });\n }\n }\n\n return Object.freeze([...diagnostics]);\n};\n\n/** Compares normalized library identities without comparing or cloning manifest contents. */\nexport const unstable_sameLibraryReferences = (\n left: readonly unstable_UiLibrary[],\n right: readonly unstable_UiLibrary[],\n): boolean =>\n left.length === right.length &&\n left.every((library, index) => library === right[index]);\n\nconst isResolvable = (\n layer: unstable_RendererLayer,\n slotId: string,\n declaration: { readonly fidelity: string } | undefined,\n): declaration is { readonly fidelity: string } => {\n if (!declaration || declaration.fidelity === 'unsupported') return false;\n return !layer.only || layer.only.has(slotId as unstable_SlotId);\n};\n\n/** Flattens outer-to-inner layers into one frozen, last-wins lookup table. */\nexport const unstable_createResolvedSlotTable = (\n layers: readonly unstable_RendererLayer[],\n): unstable_SlotMap => {\n const resolved: Record<string, object> = {};\n for (const layer of layers) {\n for (const [slotId, declaration] of Object.entries(layer.slots)) {\n if (isResolvable(layer, slotId, declaration))\n defineOwnSlot(resolved, slotId, declaration);\n }\n }\n return Object.freeze(resolved) as unstable_SlotMap;\n};\n\n/** Resolves a slot through external layers, a facade-local Core declaration, then Core context. */\nexport const unstable_resolveSlot = <K extends unstable_SlotId>(\n slotId: K,\n slots: unstable_SlotMap,\n localCoreDeclaration: unstable_SlotDeclaration<K> | undefined,\n coreSlots: unstable_SlotMap,\n): { declaration?: unstable_SlotDeclaration<K>; usedCoreFallback: boolean } => {\n const declaration = slots[slotId] as unstable_SlotDeclaration<K> | undefined;\n if (declaration) return { declaration, usedCoreFallback: false };\n\n return {\n declaration:\n localCoreDeclaration ??\n (coreSlots[slotId] as unstable_SlotDeclaration<K> | undefined),\n usedCoreFallback: true,\n };\n};\n\n/** Stable log key used to de-duplicate diagnostics within one provider identity. */\nexport const unstable_diagnosticKey = (diagnostic: unstable_AdapterDiagnostic): string =>\n [\n diagnostic.code,\n diagnostic.adapterId,\n diagnostic.slotId ?? '',\n diagnostic.message,\n ].join('|');\n\n/** Emits one actionable renderer diagnostic without exposing manifest contents. */\nexport const unstable_logDiagnostic = (diagnostic: unstable_AdapterDiagnostic): void => {\n console.error(\n `[${diagnostic.code}] ${diagnostic.message} Remedy: ${diagnostic.remedy}`,\n );\n};\n"],"names":[],"mappings":";;;;AAkBA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAkB;IACxC,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;AACzB,CAAA,CAAC;AAgBK,MAAM,+BAA+B,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE;MAGpE,oBAAoB,GAAG,CAAC,KAAc,KAC/C,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAwB;AAGjE,MAAM,4BAA4B,GAAG,CACxC,KAAqE,KACtC;AAC/B,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAEnE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7E,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACxC;IAEA,OAAO,MAAM,CAAC,MAAM,CAAC;AACjB,QAAA,OAAO,EACH,UAAU,CAAC,MAAM,KAAK;AAClB,cAAE,UAAU,CAAC,CAAC;AACd,cAAE,2BAA2B,CAAC,G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C,MAAM,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AAC7D,YAAA,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC;AACxC,gBAAA,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC;QACpD;IACJ;AACA,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAqB;AACtD;AAGO,MAAM,oBAAoB,GAAG,CAChC,MAAS,EACT,KAAuB,EACvB,oBAA6D,EAC7D,SAA2B,KAC+C;AAC1E,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAA4C;AAC5E,IAAA,IAAI,WAAW;AAAE,QAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE;IAEhE,OAAO;AACH,QAAA,WAAW,EACP,oBAAoB;YACnB,SAAS,CAAC,MAAM,CAA6C;AAClE,QAAA,gBAAgB,EAAE,IAAI;KACzB;AACL;MAGa,sBAAsB,GAAG,CAAC,UAAsC,KACzE;AACI,IAAA,UAAU,CAAC,IAAI;AACf,IAAA,UAAU,CAAC,SAAS;IACpB,UAAU,CAAC,MAAM,IAAI,EAAE;AACvB,IAAA,UAAU,CAAC,OAAO;AACrB,CAAA,CAAC,IAAI,CAAC,GAAG;AAGP,MAAM,sBAAsB,GAAG,CAAC,UAAsC,KAAU;AACnF,IAAA,OAAO,CAAC,KAAK,CACT,CAAA,CAAA,EAAI,UAAU,CAAC,IAAI,CAAA,EAAA,EAAK,UAAU,CAAC,OAAO,CAAA,SAAA,EAAY,UAAU,CAAC,MAAM,CAAA,CAAE,CAC5E;AACL;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/components",
3
- "version": "4.42.3",
3
+ "version": "4.43.0",
4
4
  "description": "React components for CQRS and event-sourced apps — command dialogs, typed forms, and query-backed data tables for Cratis Arc",
5
5
  "keywords": [
6
6
  "react",