@cohesivesystems/presentation-react 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/LICENSE +55 -0
  2. package/dist/collection-chrome-slot-renderer-registry.d.ts +12 -0
  3. package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
  4. package/dist/collection-chrome-slot-renderer-registry.js +12 -0
  5. package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
  6. package/dist/collection-selection-state-context.d.ts +6 -0
  7. package/dist/collection-selection-state-context.d.ts.map +1 -0
  8. package/dist/collection-selection-state-context.js +25 -0
  9. package/dist/collection-selection-state-context.js.map +1 -0
  10. package/dist/collection-selection-state.d.ts +3 -0
  11. package/dist/collection-selection-state.d.ts.map +1 -0
  12. package/dist/collection-selection-state.js +52 -0
  13. package/dist/collection-selection-state.js.map +1 -0
  14. package/dist/document-workspace-runtime.d.ts +262 -0
  15. package/dist/document-workspace-runtime.d.ts.map +1 -0
  16. package/dist/document-workspace-runtime.js +699 -0
  17. package/dist/document-workspace-runtime.js.map +1 -0
  18. package/dist/index.d.ts +51 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +51 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/input-form-endpoint-runtime.d.ts +140 -0
  23. package/dist/input-form-endpoint-runtime.d.ts.map +1 -0
  24. package/dist/input-form-endpoint-runtime.js +280 -0
  25. package/dist/input-form-endpoint-runtime.js.map +1 -0
  26. package/dist/local-flow-state-data-source-projection.d.ts +21 -0
  27. package/dist/local-flow-state-data-source-projection.d.ts.map +1 -0
  28. package/dist/local-flow-state-data-source-projection.js +65 -0
  29. package/dist/local-flow-state-data-source-projection.js.map +1 -0
  30. package/dist/navigation-runtime-context.d.ts +22 -0
  31. package/dist/navigation-runtime-context.d.ts.map +1 -0
  32. package/dist/navigation-runtime-context.js +23 -0
  33. package/dist/navigation-runtime-context.js.map +1 -0
  34. package/dist/navigation-shell-frame-renderer-registry.d.ts +20 -0
  35. package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
  36. package/dist/navigation-shell-frame-renderer-registry.js +9 -0
  37. package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
  38. package/dist/navigation-shell-region-component-registry.d.ts +50 -0
  39. package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
  40. package/dist/navigation-shell-region-component-registry.js +44 -0
  41. package/dist/navigation-shell-region-component-registry.js.map +1 -0
  42. package/dist/navigation-shell-slot-renderer-registry.d.ts +22 -0
  43. package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
  44. package/dist/navigation-shell-slot-renderer-registry.js +9 -0
  45. package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
  46. package/dist/page-host-projection.d.ts +127 -0
  47. package/dist/page-host-projection.d.ts.map +1 -0
  48. package/dist/page-host-projection.js +59 -0
  49. package/dist/page-host-projection.js.map +1 -0
  50. package/dist/page-host-renderer-registry.d.ts +72 -0
  51. package/dist/page-host-renderer-registry.d.ts.map +1 -0
  52. package/dist/page-host-renderer-registry.js +63 -0
  53. package/dist/page-host-renderer-registry.js.map +1 -0
  54. package/dist/presentation-action-group-runtime-options.d.ts +36 -0
  55. package/dist/presentation-action-group-runtime-options.d.ts.map +1 -0
  56. package/dist/presentation-action-group-runtime-options.js +50 -0
  57. package/dist/presentation-action-group-runtime-options.js.map +1 -0
  58. package/dist/presentation-action-runtime.d.ts +52 -0
  59. package/dist/presentation-action-runtime.d.ts.map +1 -0
  60. package/dist/presentation-action-runtime.js +78 -0
  61. package/dist/presentation-action-runtime.js.map +1 -0
  62. package/dist/presentation-data-source-binding-runtime.d.ts +3 -0
  63. package/dist/presentation-data-source-binding-runtime.d.ts.map +1 -0
  64. package/dist/presentation-data-source-binding-runtime.js +65 -0
  65. package/dist/presentation-data-source-binding-runtime.js.map +1 -0
  66. package/dist/presentation-data-source-binding.d.ts +12 -0
  67. package/dist/presentation-data-source-binding.d.ts.map +1 -0
  68. package/dist/presentation-data-source-binding.js +13 -0
  69. package/dist/presentation-data-source-binding.js.map +1 -0
  70. package/dist/presentation-flow-runtime.d.ts +139 -0
  71. package/dist/presentation-flow-runtime.d.ts.map +1 -0
  72. package/dist/presentation-flow-runtime.js +514 -0
  73. package/dist/presentation-flow-runtime.js.map +1 -0
  74. package/dist/presentation-module-context.d.ts +4 -0
  75. package/dist/presentation-module-context.d.ts.map +1 -0
  76. package/dist/presentation-module-context.js +6 -0
  77. package/dist/presentation-module-context.js.map +1 -0
  78. package/dist/presentation-module-provider.d.ts +7 -0
  79. package/dist/presentation-module-provider.d.ts.map +1 -0
  80. package/dist/presentation-module-provider.js +7 -0
  81. package/dist/presentation-module-provider.js.map +1 -0
  82. package/dist/presentation-projection-diagnostics-context.d.ts +8 -0
  83. package/dist/presentation-projection-diagnostics-context.d.ts.map +1 -0
  84. package/dist/presentation-projection-diagnostics-context.js +3 -0
  85. package/dist/presentation-projection-diagnostics-context.js.map +1 -0
  86. package/dist/presentation-projection-diagnostics-hooks.d.ts +4 -0
  87. package/dist/presentation-projection-diagnostics-hooks.d.ts.map +1 -0
  88. package/dist/presentation-projection-diagnostics-hooks.js +17 -0
  89. package/dist/presentation-projection-diagnostics-hooks.js.map +1 -0
  90. package/dist/presentation-projection-diagnostics-runtime.d.ts +12 -0
  91. package/dist/presentation-projection-diagnostics-runtime.d.ts.map +1 -0
  92. package/dist/presentation-projection-diagnostics-runtime.js +54 -0
  93. package/dist/presentation-projection-diagnostics-runtime.js.map +1 -0
  94. package/dist/presentation-projection-trace.d.ts +27 -0
  95. package/dist/presentation-projection-trace.d.ts.map +1 -0
  96. package/dist/presentation-projection-trace.js +54 -0
  97. package/dist/presentation-projection-trace.js.map +1 -0
  98. package/dist/presentation-query-form-runtime.d.ts +30 -0
  99. package/dist/presentation-query-form-runtime.d.ts.map +1 -0
  100. package/dist/presentation-query-form-runtime.js +75 -0
  101. package/dist/presentation-query-form-runtime.js.map +1 -0
  102. package/dist/presentation-query-form-state-adapter-registry.d.ts +4 -0
  103. package/dist/presentation-query-form-state-adapter-registry.d.ts.map +1 -0
  104. package/dist/presentation-query-form-state-adapter-registry.js +13 -0
  105. package/dist/presentation-query-form-state-adapter-registry.js.map +1 -0
  106. package/dist/presentation-query-form-state-context.d.ts +20 -0
  107. package/dist/presentation-query-form-state-context.d.ts.map +1 -0
  108. package/dist/presentation-query-form-state-context.js +20 -0
  109. package/dist/presentation-query-form-state-context.js.map +1 -0
  110. package/dist/presentation-query-form-state.d.ts +29 -0
  111. package/dist/presentation-query-form-state.d.ts.map +1 -0
  112. package/dist/presentation-query-form-state.js +99 -0
  113. package/dist/presentation-query-form-state.js.map +1 -0
  114. package/dist/presentation-renderer-registry.d.ts +109 -0
  115. package/dist/presentation-renderer-registry.d.ts.map +1 -0
  116. package/dist/presentation-renderer-registry.js +25 -0
  117. package/dist/presentation-renderer-registry.js.map +1 -0
  118. package/dist/presentation-standards-context.d.ts +4 -0
  119. package/dist/presentation-standards-context.d.ts.map +1 -0
  120. package/dist/presentation-standards-context.js +12 -0
  121. package/dist/presentation-standards-context.js.map +1 -0
  122. package/dist/presentation-standards-provider.d.ts +14 -0
  123. package/dist/presentation-standards-provider.d.ts.map +1 -0
  124. package/dist/presentation-standards-provider.js +16 -0
  125. package/dist/presentation-standards-provider.js.map +1 -0
  126. package/dist/projected-document-action-runtime-bindings.d.ts +20 -0
  127. package/dist/projected-document-action-runtime-bindings.d.ts.map +1 -0
  128. package/dist/projected-document-action-runtime-bindings.js +88 -0
  129. package/dist/projected-document-action-runtime-bindings.js.map +1 -0
  130. package/dist/projected-document-action-runtime.d.ts +76 -0
  131. package/dist/projected-document-action-runtime.d.ts.map +1 -0
  132. package/dist/projected-document-action-runtime.js +224 -0
  133. package/dist/projected-document-action-runtime.js.map +1 -0
  134. package/dist/projected-document-process-preview-action-runtime-bindings.d.ts +26 -0
  135. package/dist/projected-document-process-preview-action-runtime-bindings.d.ts.map +1 -0
  136. package/dist/projected-document-process-preview-action-runtime-bindings.js +106 -0
  137. package/dist/projected-document-process-preview-action-runtime-bindings.js.map +1 -0
  138. package/dist/projected-document-process-preview-action-runtime.d.ts +321 -0
  139. package/dist/projected-document-process-preview-action-runtime.d.ts.map +1 -0
  140. package/dist/projected-document-process-preview-action-runtime.js +729 -0
  141. package/dist/projected-document-process-preview-action-runtime.js.map +1 -0
  142. package/dist/projected-document-process-preview-capability-runtime.d.ts +47 -0
  143. package/dist/projected-document-process-preview-capability-runtime.d.ts.map +1 -0
  144. package/dist/projected-document-process-preview-capability-runtime.js +49 -0
  145. package/dist/projected-document-process-preview-capability-runtime.js.map +1 -0
  146. package/dist/projected-document-workspace-action-runtime.d.ts +87 -0
  147. package/dist/projected-document-workspace-action-runtime.d.ts.map +1 -0
  148. package/dist/projected-document-workspace-action-runtime.js +150 -0
  149. package/dist/projected-document-workspace-action-runtime.js.map +1 -0
  150. package/dist/projected-document-workspace-projection-renderer-diagnostics.d.ts +18 -0
  151. package/dist/projected-document-workspace-projection-renderer-diagnostics.d.ts.map +1 -0
  152. package/dist/projected-document-workspace-projection-renderer-diagnostics.js +207 -0
  153. package/dist/projected-document-workspace-projection-renderer-diagnostics.js.map +1 -0
  154. package/dist/projected-document-workspace-runtime-binding-diagnostics.d.ts +19 -0
  155. package/dist/projected-document-workspace-runtime-binding-diagnostics.d.ts.map +1 -0
  156. package/dist/projected-document-workspace-runtime-binding-diagnostics.js +124 -0
  157. package/dist/projected-document-workspace-runtime-binding-diagnostics.js.map +1 -0
  158. package/dist/projected-navigation-provider.d.ts +16 -0
  159. package/dist/projected-navigation-provider.d.ts.map +1 -0
  160. package/dist/projected-navigation-provider.js +51 -0
  161. package/dist/projected-navigation-provider.js.map +1 -0
  162. package/dist/projected-presentation-flow-host.d.ts +16 -0
  163. package/dist/projected-presentation-flow-host.d.ts.map +1 -0
  164. package/dist/projected-presentation-flow-host.js +14 -0
  165. package/dist/projected-presentation-flow-host.js.map +1 -0
  166. package/dist/projected-query-form-state-adapter.d.ts +12 -0
  167. package/dist/projected-query-form-state-adapter.d.ts.map +1 -0
  168. package/dist/projected-query-form-state-adapter.js +361 -0
  169. package/dist/projected-query-form-state-adapter.js.map +1 -0
  170. package/dist/react-router-binding.d.ts +133 -0
  171. package/dist/react-router-binding.d.ts.map +1 -0
  172. package/dist/react-router-binding.js +76 -0
  173. package/dist/react-router-binding.js.map +1 -0
  174. package/dist/react-router-path.d.ts +4 -0
  175. package/dist/react-router-path.d.ts.map +1 -0
  176. package/dist/react-router-path.js +11 -0
  177. package/dist/react-router-path.js.map +1 -0
  178. package/dist/scope-selection-context.d.ts +28 -0
  179. package/dist/scope-selection-context.d.ts.map +1 -0
  180. package/dist/scope-selection-context.js +13 -0
  181. package/dist/scope-selection-context.js.map +1 -0
  182. package/dist/scope-selection-provider.d.ts +33 -0
  183. package/dist/scope-selection-provider.d.ts.map +1 -0
  184. package/dist/scope-selection-provider.js +162 -0
  185. package/dist/scope-selection-provider.js.map +1 -0
  186. package/dist/scope-selection-request.d.ts +6 -0
  187. package/dist/scope-selection-request.d.ts.map +1 -0
  188. package/dist/scope-selection-request.js +12 -0
  189. package/dist/scope-selection-request.js.map +1 -0
  190. package/dist/standard-navigation-shell-frame-renderers.d.ts +15 -0
  191. package/dist/standard-navigation-shell-frame-renderers.d.ts.map +1 -0
  192. package/dist/standard-navigation-shell-frame-renderers.js +22 -0
  193. package/dist/standard-navigation-shell-frame-renderers.js.map +1 -0
  194. package/dist/standard-navigation-shell-slot-renderers.d.ts +59 -0
  195. package/dist/standard-navigation-shell-slot-renderers.d.ts.map +1 -0
  196. package/dist/standard-navigation-shell-slot-renderers.js +67 -0
  197. package/dist/standard-navigation-shell-slot-renderers.js.map +1 -0
  198. package/dist/view-chrome-slot-renderer-registry.d.ts +12 -0
  199. package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
  200. package/dist/view-chrome-slot-renderer-registry.js +12 -0
  201. package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
  202. package/package.json +60 -0
  203. package/src/collection-chrome-slot-renderer-registry.ts +66 -0
  204. package/src/collection-selection-state-context.ts +51 -0
  205. package/src/collection-selection-state.tsx +101 -0
  206. package/src/document-workspace-runtime.tsx +1505 -0
  207. package/src/index.ts +50 -0
  208. package/src/input-form-endpoint-runtime.ts +632 -0
  209. package/src/local-flow-state-data-source-projection.ts +133 -0
  210. package/src/navigation-runtime-context.ts +40 -0
  211. package/src/navigation-shell-frame-renderer-registry.ts +54 -0
  212. package/src/navigation-shell-region-component-registry.tsx +127 -0
  213. package/src/navigation-shell-slot-renderer-registry.ts +88 -0
  214. package/src/page-host-projection.ts +356 -0
  215. package/src/page-host-renderer-registry.tsx +353 -0
  216. package/src/presentation-action-group-runtime-options.ts +121 -0
  217. package/src/presentation-action-runtime.ts +190 -0
  218. package/src/presentation-data-source-binding-runtime.ts +109 -0
  219. package/src/presentation-data-source-binding.tsx +24 -0
  220. package/src/presentation-flow-runtime.tsx +835 -0
  221. package/src/presentation-module-context.ts +10 -0
  222. package/src/presentation-module-provider.tsx +19 -0
  223. package/src/presentation-projection-diagnostics-context.ts +17 -0
  224. package/src/presentation-projection-diagnostics-hooks.ts +29 -0
  225. package/src/presentation-projection-diagnostics-runtime.tsx +95 -0
  226. package/src/presentation-projection-trace.ts +117 -0
  227. package/src/presentation-query-form-runtime.ts +148 -0
  228. package/src/presentation-query-form-state-adapter-registry.ts +25 -0
  229. package/src/presentation-query-form-state-context.ts +56 -0
  230. package/src/presentation-query-form-state.tsx +250 -0
  231. package/src/presentation-renderer-registry.ts +214 -0
  232. package/src/presentation-standards-context.ts +21 -0
  233. package/src/presentation-standards-provider.tsx +44 -0
  234. package/src/projected-document-action-runtime-bindings.ts +132 -0
  235. package/src/projected-document-action-runtime.ts +414 -0
  236. package/src/projected-document-process-preview-action-runtime-bindings.ts +231 -0
  237. package/src/projected-document-process-preview-action-runtime.ts +1725 -0
  238. package/src/projected-document-process-preview-capability-runtime.ts +216 -0
  239. package/src/projected-document-workspace-action-runtime.ts +402 -0
  240. package/src/projected-document-workspace-projection-renderer-diagnostics.ts +342 -0
  241. package/src/projected-document-workspace-runtime-binding-diagnostics.ts +208 -0
  242. package/src/projected-navigation-provider.tsx +104 -0
  243. package/src/projected-presentation-flow-host.tsx +46 -0
  244. package/src/projected-query-form-state-adapter.ts +578 -0
  245. package/src/react-router-binding.tsx +417 -0
  246. package/src/react-router-path.ts +16 -0
  247. package/src/scope-selection-context.ts +58 -0
  248. package/src/scope-selection-provider.tsx +324 -0
  249. package/src/scope-selection-request.ts +21 -0
  250. package/src/standard-navigation-shell-frame-renderers.tsx +106 -0
  251. package/src/standard-navigation-shell-slot-renderers.tsx +289 -0
  252. package/src/view-chrome-slot-renderer-registry.ts +66 -0
@@ -0,0 +1,289 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ import {
4
+ navigationShellSlotKinds,
5
+ type NavigationDefinition,
6
+ type NavigationNodeDefinition,
7
+ type NavigationShellRegionDefinition,
8
+ type NavigationShellSlotDefinition,
9
+ } from '@cohesivesystems/presentation-contracts'
10
+ import {
11
+ createProjectedNavigationShellItems,
12
+ isProjectedNavigationShellItemActive,
13
+ resolveNavigationShellSlotRegions,
14
+ type ProjectedNavigationShellItem,
15
+ } from '@cohesivesystems/presentation-core'
16
+ import {
17
+ createNavigationShellSlotRendererRegistry,
18
+ getNavigationShellSlotRendererRegistryKeys,
19
+ resolveNavigationShellSlotRenderer,
20
+ type ProjectedNavigationShellSlotRenderContext,
21
+ } from './navigation-shell-slot-renderer-registry'
22
+
23
+ export type StandardNavigationShellBadgeVariant =
24
+ | 'default'
25
+ | 'destructive'
26
+ | 'ghost'
27
+ | 'link'
28
+ | 'outline'
29
+ | 'secondary'
30
+
31
+ export interface StandardNavigationShellBadgeProps {
32
+ readonly children?: ReactNode
33
+ readonly className?: string
34
+ readonly variant?: StandardNavigationShellBadgeVariant
35
+ }
36
+
37
+ export interface StandardNavigationShellNavigationLinkProps {
38
+ readonly children?: ReactNode
39
+ readonly className?: string
40
+ readonly isActive?: boolean
41
+ readonly to: string
42
+ }
43
+
44
+ export interface StandardNavigationShellComponentSystem {
45
+ readonly badges: {
46
+ readonly Badge: (props: StandardNavigationShellBadgeProps) => ReactNode
47
+ }
48
+ readonly navigation: {
49
+ readonly NavigationLink: (
50
+ props: StandardNavigationShellNavigationLinkProps
51
+ ) => ReactNode
52
+ }
53
+ }
54
+
55
+ export interface StandardNavigationShellSlotLayout {
56
+ readonly brandBadgeClassName: string
57
+ readonly brandSubtitleClassName: string
58
+ readonly brandTitleClassName: string
59
+ readonly navigationItemClassName: string
60
+ readonly rootClassName: string
61
+ }
62
+
63
+ export type StandardNavigationShellSlotRenderContext<
64
+ TComponentSystem extends StandardNavigationShellComponentSystem =
65
+ StandardNavigationShellComponentSystem,
66
+ > = ProjectedNavigationShellSlotRenderContext<
67
+ StandardNavigationShellSlotLayout,
68
+ TComponentSystem
69
+ >
70
+
71
+ export const standardNavigationShellSlotRenderers =
72
+ createNavigationShellSlotRendererRegistry<
73
+ StandardNavigationShellSlotLayout,
74
+ StandardNavigationShellComponentSystem
75
+ >([
76
+ {
77
+ kind: navigationShellSlotKinds.brand,
78
+ render: renderStandardNavigationShellBrand,
79
+ },
80
+ {
81
+ kind: navigationShellSlotKinds.primaryNavigation,
82
+ render: renderStandardNavigationShellPrimaryNavigation,
83
+ },
84
+ {
85
+ kind: navigationShellSlotKinds.utilityActions,
86
+ render: renderStandardNavigationShellRegionSlot,
87
+ },
88
+ {
89
+ kind: navigationShellSlotKinds.systemNotices,
90
+ render: renderStandardNavigationShellRegionSlot,
91
+ },
92
+ {
93
+ kind: navigationShellSlotKinds.routedContent,
94
+ render: renderStandardNavigationShellRoutedContent,
95
+ },
96
+ ])
97
+
98
+ export const standardNavigationShellSlotRendererKeys =
99
+ getNavigationShellSlotRendererRegistryKeys(standardNavigationShellSlotRenderers)
100
+
101
+ export function renderStandardNavigationShellSlot(
102
+ context: StandardNavigationShellSlotRenderContext,
103
+ ) {
104
+ const renderer = resolveNavigationShellSlotRenderer(
105
+ standardNavigationShellSlotRenderers,
106
+ context.slot,
107
+ )
108
+
109
+ return renderer?.(context) ?? null
110
+ }
111
+
112
+ export function StandardNavigationShellBrandSlot({
113
+ brandLabel,
114
+ componentSystem,
115
+ renderShellIcon,
116
+ shellIcon,
117
+ slotLayout,
118
+ subtitle,
119
+ title,
120
+ }: {
121
+ readonly brandLabel: string | null
122
+ readonly componentSystem: StandardNavigationShellComponentSystem
123
+ readonly renderShellIcon?: (icon: string) => ReactNode
124
+ readonly shellIcon: string | null
125
+ readonly slotLayout: StandardNavigationShellSlotLayout
126
+ readonly subtitle: string | null
127
+ readonly title: string | null
128
+ }) {
129
+ const Badge = componentSystem.badges.Badge
130
+
131
+ return (
132
+ <div className={slotLayout.rootClassName}>
133
+ {shellIcon && renderShellIcon ? renderShellIcon(shellIcon) : null}
134
+ {brandLabel ? (
135
+ <Badge className={slotLayout.brandBadgeClassName} variant="outline">
136
+ {brandLabel}
137
+ </Badge>
138
+ ) : null}
139
+ {title ? (
140
+ <span className={slotLayout.brandTitleClassName}>{title}</span>
141
+ ) : null}
142
+ {subtitle ? (
143
+ <span className={slotLayout.brandSubtitleClassName}>{subtitle}</span>
144
+ ) : null}
145
+ </div>
146
+ )
147
+ }
148
+
149
+ export function StandardNavigationShellPrimaryNavigationSlot({
150
+ activePath,
151
+ componentSystem,
152
+ items,
153
+ navigation,
154
+ renderNodeIcon,
155
+ slotLayout,
156
+ }: {
157
+ readonly activePath: string
158
+ readonly componentSystem: StandardNavigationShellComponentSystem
159
+ readonly items: readonly ProjectedNavigationShellItem[]
160
+ readonly navigation: NavigationDefinition
161
+ readonly renderNodeIcon?: (node: NavigationNodeDefinition) => ReactNode
162
+ readonly slotLayout: StandardNavigationShellSlotLayout
163
+ }) {
164
+ if (items.length === 0) {
165
+ return null
166
+ }
167
+
168
+ const NavigationLink = componentSystem.navigation.NavigationLink
169
+
170
+ return (
171
+ <nav className={slotLayout.rootClassName}>
172
+ {items.map((item) => (
173
+ <NavigationLink
174
+ className={slotLayout.navigationItemClassName}
175
+ isActive={isProjectedNavigationShellItemActive(
176
+ activePath,
177
+ item,
178
+ navigation,
179
+ )}
180
+ key={item.node.Id}
181
+ to={item.href}
182
+ >
183
+ {renderNodeIcon?.(item.node)}
184
+ {item.label}
185
+ </NavigationLink>
186
+ ))}
187
+ </nav>
188
+ )
189
+ }
190
+
191
+ export function StandardNavigationShellRegionSlot({
192
+ navigation,
193
+ renderShellRegion,
194
+ slot,
195
+ slotLayout,
196
+ }: {
197
+ readonly navigation: NavigationDefinition
198
+ readonly renderShellRegion?: (region: NavigationShellRegionDefinition) => ReactNode
199
+ readonly slot: NavigationShellSlotDefinition
200
+ readonly slotLayout: StandardNavigationShellSlotLayout
201
+ }) {
202
+ const regions = resolveNavigationShellSlotRegions(navigation, slot)
203
+
204
+ return (
205
+ <div className={slotLayout.rootClassName}>
206
+ {regions.map((region) => (
207
+ <ShellRegion key={region.Id} region={region} renderShellRegion={renderShellRegion} />
208
+ ))}
209
+ </div>
210
+ )
211
+ }
212
+
213
+ function renderStandardNavigationShellBrand({
214
+ componentSystem,
215
+ navigation,
216
+ renderShellIcon,
217
+ slotLayout,
218
+ }: StandardNavigationShellSlotRenderContext) {
219
+ const chrome = navigation.Shell.Chrome
220
+ const brandLabel = chrome?.BrandLabel ?? null
221
+ const title = chrome?.Title ?? navigation.Label
222
+ const subtitle = chrome?.Subtitle ?? null
223
+ const shellIcon = chrome?.Icon ?? null
224
+
225
+ return (
226
+ <StandardNavigationShellBrandSlot
227
+ brandLabel={brandLabel}
228
+ componentSystem={componentSystem}
229
+ renderShellIcon={renderShellIcon}
230
+ shellIcon={shellIcon}
231
+ slotLayout={slotLayout}
232
+ subtitle={subtitle}
233
+ title={title}
234
+ />
235
+ )
236
+ }
237
+
238
+ function renderStandardNavigationShellPrimaryNavigation({
239
+ activePath,
240
+ componentSystem,
241
+ navigation,
242
+ renderNodeIcon,
243
+ slot,
244
+ slotLayout,
245
+ }: StandardNavigationShellSlotRenderContext) {
246
+ return (
247
+ <StandardNavigationShellPrimaryNavigationSlot
248
+ activePath={activePath}
249
+ componentSystem={componentSystem}
250
+ items={createProjectedNavigationShellItems(navigation, slot)}
251
+ navigation={navigation}
252
+ renderNodeIcon={renderNodeIcon}
253
+ slotLayout={slotLayout}
254
+ />
255
+ )
256
+ }
257
+
258
+ function renderStandardNavigationShellRegionSlot({
259
+ navigation,
260
+ renderShellRegion,
261
+ slot,
262
+ slotLayout,
263
+ }: StandardNavigationShellSlotRenderContext) {
264
+ return (
265
+ <StandardNavigationShellRegionSlot
266
+ navigation={navigation}
267
+ renderShellRegion={renderShellRegion}
268
+ slot={slot}
269
+ slotLayout={slotLayout}
270
+ />
271
+ )
272
+ }
273
+
274
+ function renderStandardNavigationShellRoutedContent({
275
+ children,
276
+ slotLayout,
277
+ }: StandardNavigationShellSlotRenderContext) {
278
+ return <div className={slotLayout.rootClassName}>{children}</div>
279
+ }
280
+
281
+ function ShellRegion({
282
+ region,
283
+ renderShellRegion,
284
+ }: {
285
+ readonly region: NavigationShellRegionDefinition
286
+ readonly renderShellRegion?: (region: NavigationShellRegionDefinition) => ReactNode
287
+ }) {
288
+ return renderShellRegion?.(region) ?? null
289
+ }
@@ -0,0 +1,66 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ import {
4
+ createViewChromeSlotRendererKey,
5
+ createViewChromeSlotRendererRegistry as createCoreViewChromeSlotRendererRegistry,
6
+ getViewChromeSlotRendererCandidateKeys,
7
+ getViewChromeSlotRendererRegistryKeys as getCoreViewChromeSlotRendererRegistryKeys,
8
+ hasViewChromeSlotRendererBinding,
9
+ isViewChromeSlotKind,
10
+ isViewChromeSlotPlacement,
11
+ isViewChromeSlotPlacementValue,
12
+ resolveViewChromeSlotRenderer as resolveCoreViewChromeSlotRenderer,
13
+ viewChromeSlotAnyPlacement,
14
+ type ViewChromeSlotRendererBinding as CoreViewChromeSlotRendererBinding,
15
+ type ViewChromeSlotRendererRegistry as CoreViewChromeSlotRendererRegistry,
16
+ } from '@cohesivesystems/presentation-core'
17
+ import type {
18
+ ViewChromeSlotDefinition,
19
+ ViewChromeSlotKind,
20
+ ViewChromeSlotPlacement,
21
+ } from '@cohesivesystems/presentation-contracts'
22
+
23
+ export {
24
+ createViewChromeSlotRendererKey,
25
+ getViewChromeSlotRendererCandidateKeys,
26
+ hasViewChromeSlotRendererBinding,
27
+ isViewChromeSlotKind,
28
+ isViewChromeSlotPlacement,
29
+ isViewChromeSlotPlacementValue,
30
+ viewChromeSlotAnyPlacement,
31
+ }
32
+
33
+ export type ViewChromeSlotRenderer<TContext> = (
34
+ context: TContext,
35
+ ) => ReactNode
36
+
37
+ export type ViewChromeSlotRendererRegistry<TContext> =
38
+ CoreViewChromeSlotRendererRegistry<TContext, ReactNode>
39
+
40
+ export type ViewChromeSlotRendererBinding<TContext> =
41
+ CoreViewChromeSlotRendererBinding<TContext, ReactNode>
42
+
43
+ export function createViewChromeSlotRendererRegistry<TContext>(
44
+ bindings: readonly ViewChromeSlotRendererBinding<TContext>[],
45
+ ): ViewChromeSlotRendererRegistry<TContext> {
46
+ return createCoreViewChromeSlotRendererRegistry<TContext, ReactNode>(bindings)
47
+ }
48
+
49
+ export function getViewChromeSlotRendererRegistryKeys<TContext>(
50
+ registry: ViewChromeSlotRendererRegistry<TContext> | null | undefined,
51
+ ) {
52
+ return getCoreViewChromeSlotRendererRegistryKeys<TContext, ReactNode>(registry)
53
+ }
54
+
55
+ export function resolveViewChromeSlotRenderer<TContext>(
56
+ registry: ViewChromeSlotRendererRegistry<TContext> | null | undefined,
57
+ slot: ViewChromeSlotDefinition,
58
+ ) {
59
+ return resolveCoreViewChromeSlotRenderer<TContext, ReactNode>(registry, slot)
60
+ }
61
+
62
+ export type {
63
+ ViewChromeSlotDefinition,
64
+ ViewChromeSlotKind,
65
+ ViewChromeSlotPlacement,
66
+ }