@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,28 @@
1
+ import type { PresentationScopeAccess } from '@cohesivesystems/presentation-core';
2
+ /**
3
+ * React scope-selection state shared by a presentation host.
4
+ */
5
+ export interface PresentationScopeSelectionContextValue<TScopeContext = unknown, TScopeMetadata = unknown> {
6
+ /** Source context that produced the accessible scopes. */
7
+ readonly scopeContext: TScopeContext | null;
8
+ /** Whether scope context is currently loading. */
9
+ readonly isLoading: boolean;
10
+ /** Scopes accessible to the current principal. */
11
+ readonly scopes: readonly PresentationScopeAccess<TScopeMetadata>[];
12
+ /** Primary single selected scope id. */
13
+ readonly selectedScopeId: string | null;
14
+ /** Selects the primary single scope. */
15
+ readonly setSelectedScopeId: (scopeId: string) => void;
16
+ /** Reads selected scope ids for a named multi-scope purpose. */
17
+ readonly getSelectedScopeIds: (purpose: string, fallbackScopeIds?: readonly string[]) => readonly string[];
18
+ /** Stores selected scope ids for a named multi-scope purpose. */
19
+ readonly setSelectedScopeIds: (purpose: string, scopeIds: readonly string[]) => void;
20
+ /** Stable query/cache suffix for the primary single selected scope. */
21
+ readonly singleScopeQuerySuffix: string;
22
+ }
23
+ export declare const PresentationScopeSelectionContext: import("react").Context<PresentationScopeSelectionContextValue<unknown, unknown> | null>;
24
+ /**
25
+ * Reads the nearest presentation scope-selection context.
26
+ */
27
+ export declare function usePresentationScopeSelection<TScopeContext = unknown, TScopeMetadata = unknown>(): PresentationScopeSelectionContextValue<TScopeContext, TScopeMetadata>;
28
+ //# sourceMappingURL=scope-selection-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-context.d.ts","sourceRoot":"","sources":["../src/scope-selection-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EACxB,MAAM,oCAAoC,CAAA;AAE3C;;GAEG;AACH,MAAM,WAAW,sCAAsC,CACrD,aAAa,GAAG,OAAO,EACvB,cAAc,GAAG,OAAO;IAExB,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI,CAAA;IAE3C,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAE3B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAAE,CAAA;IAEnE,wCAAwC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC,wCAAwC;IACxC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAEtD,gEAAgE;IAChE,QAAQ,CAAC,mBAAmB,EAAE,CAC5B,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,KACjC,SAAS,MAAM,EAAE,CAAA;IAEtB,iEAAiE;IACjE,QAAQ,CAAC,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAA;IAEpF,uEAAuE;IACvE,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAA;CACxC;AAED,eAAO,MAAM,iCAAiC,0FACsB,CAAA;AAEpE;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,GAAG,OAAO,EACvB,cAAc,GAAG,OAAO,KAOR,sCAAsC,CAAC,aAAa,EAAE,cAAc,CAAC,CACtF"}
@@ -0,0 +1,13 @@
1
+ import { createContext, useContext } from 'react';
2
+ export const PresentationScopeSelectionContext = createContext(null);
3
+ /**
4
+ * Reads the nearest presentation scope-selection context.
5
+ */
6
+ export function usePresentationScopeSelection() {
7
+ const value = useContext(PresentationScopeSelectionContext);
8
+ if (!value) {
9
+ throw new Error('usePresentationScopeSelection must be used inside PresentationScopeSelectionProvider.');
10
+ }
11
+ return value;
12
+ }
13
+ //# sourceMappingURL=scope-selection-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-context.js","sourceRoot":"","sources":["../src/scope-selection-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAyCjD,MAAM,CAAC,MAAM,iCAAiC,GAC5C,aAAa,CAAgD,IAAI,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,UAAU,6BAA6B;IAI3C,MAAM,KAAK,GAAG,UAAU,CAAC,iCAAiC,CAAC,CAAA;IAC3D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;IAC1G,CAAC;IAED,OAAO,KAA8E,CAAA;AACvF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type QueryKey } from '@tanstack/react-query';
2
+ import { type PropsWithChildren } from 'react';
3
+ import { type PresentationScopeAccess, type PresentationScopeRequestStore } from '@cohesivesystems/presentation-core';
4
+ /**
5
+ * Options for the generic presentation scope-selection provider.
6
+ */
7
+ export interface PresentationScopeSelectionProviderProps<TScopeContext, TScopeMetadata = unknown> extends PropsWithChildren {
8
+ /** Whether scope context may be loaded. */
9
+ readonly enabled: boolean;
10
+ /** Identity/session partition key used for cache and persisted selection state. */
11
+ readonly identityKey: string;
12
+ /** Query key used to load the source scope context. */
13
+ readonly queryKey: QueryKey;
14
+ /** Loads the source scope context. */
15
+ readonly loadScopeContext: () => Promise<TScopeContext>;
16
+ /** Projects accessible scopes from the source context. */
17
+ readonly getScopes: (scopeContext: TScopeContext) => readonly PresentationScopeAccess<TScopeMetadata>[];
18
+ /** Resolves the default scope id from the source context and projected scopes. */
19
+ readonly getDefaultScopeId?: (scopeContext: TScopeContext, scopes: readonly PresentationScopeAccess<TScopeMetadata>[]) => string | null;
20
+ /** Prefix used for persisted local selection keys. */
21
+ readonly storageKeyPrefix: string;
22
+ /** Optional request-scope store to synchronize with the primary selected scope. */
23
+ readonly requestStore?: PresentationScopeRequestStore;
24
+ /** Label used for single-scope query/cache suffixes. */
25
+ readonly singleScopeQueryLabel?: string;
26
+ /** Label used for multi-scope query/cache suffixes. */
27
+ readonly multipleScopesQueryLabel?: string;
28
+ }
29
+ /**
30
+ * Provides generic authorized-scope selection state for presentation hosts.
31
+ */
32
+ export declare function PresentationScopeSelectionProvider<TScopeContext, TScopeMetadata = unknown>({ children, enabled, getDefaultScopeId, getScopes, identityKey, loadScopeContext, multipleScopesQueryLabel, queryKey, requestStore, singleScopeQueryLabel, storageKeyPrefix, }: PresentationScopeSelectionProviderProps<TScopeContext, TScopeMetadata>): import("react/jsx-runtime").JSX.Element;
33
+ //# sourceMappingURL=scope-selection-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-provider.d.ts","sourceRoot":"","sources":["../src/scope-selection-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAA;AAEd,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EACnC,MAAM,oCAAoC,CAAA;AAgB3C;;GAEG;AACH,MAAM,WAAW,uCAAuC,CACtD,aAAa,EACb,cAAc,GAAG,OAAO,CACxB,SAAQ,iBAAiB;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IAEzB,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAE3B,sCAAsC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAA;IAEvD,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,CAClB,YAAY,EAAE,aAAa,KACxB,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAAE,CAAA;IAEvD,kFAAkF;IAClF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAC3B,YAAY,EAAE,aAAa,EAC3B,MAAM,EAAE,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAAE,KACvD,MAAM,GAAG,IAAI,CAAA;IAElB,sDAAsD;IACtD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IAEjC,mFAAmF;IACnF,QAAQ,CAAC,YAAY,CAAC,EAAE,6BAA6B,CAAA;IAErD,wDAAwD;IACxD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAEvC,uDAAuD;IACvD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAC3C;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,EACb,cAAc,GAAG,OAAO,EACxB,EACA,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,GACjB,EAAE,uCAAuC,CAAC,aAAa,EAAE,cAAc,CAAC,2CAwIxE"}
@@ -0,0 +1,162 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useQuery } from '@tanstack/react-query';
3
+ import { useCallback, useLayoutEffect, useMemo, useState, } from 'react';
4
+ import { formatPresentationScopeSelectionQuerySuffix, normalizeScopeIds, } from '@cohesivesystems/presentation-core';
5
+ import { PresentationScopeSelectionContext, } from './scope-selection-context.js';
6
+ /**
7
+ * Provides generic authorized-scope selection state for presentation hosts.
8
+ */
9
+ export function PresentationScopeSelectionProvider({ children, enabled, getDefaultScopeId, getScopes, identityKey, loadScopeContext, multipleScopesQueryLabel, queryKey, requestStore, singleScopeQueryLabel, storageKeyPrefix, }) {
10
+ const [selectedScopeOverride, setSelectedScopeOverride] = useState(null);
11
+ const [selectedScopeIdsOverrides, setSelectedScopeIdsOverrides] = useState({});
12
+ const scopeContextQuery = useQuery({
13
+ enabled,
14
+ queryFn: loadScopeContext,
15
+ queryKey,
16
+ retry: false,
17
+ });
18
+ const scopeContext = scopeContextQuery.data ?? null;
19
+ const scopes = useMemo(() => scopeContext ? getScopes(scopeContext) : [], [getScopes, scopeContext]);
20
+ const scopeIdSet = useMemo(() => new Set(scopes.map((scope) => scope.id)), [scopes]);
21
+ const selectedScopeId = useMemo(() => {
22
+ if (!enabled || !scopeContext) {
23
+ return null;
24
+ }
25
+ if (selectedScopeOverride?.identityKey === identityKey &&
26
+ isAllowedScope(selectedScopeOverride.scopeId, scopeIdSet)) {
27
+ return selectedScopeOverride.scopeId;
28
+ }
29
+ const storedScopeId = readStoredScopeId(storageKeyPrefix, identityKey, 'single');
30
+ if (isAllowedScope(storedScopeId, scopeIdSet)) {
31
+ return storedScopeId;
32
+ }
33
+ return resolveDefaultScopeId(scopeContext, scopes, getDefaultScopeId);
34
+ }, [
35
+ enabled,
36
+ getDefaultScopeId,
37
+ identityKey,
38
+ scopeContext,
39
+ scopeIdSet,
40
+ scopes,
41
+ selectedScopeOverride,
42
+ storageKeyPrefix,
43
+ ]);
44
+ const singleScopeQuerySuffix = formatPresentationScopeSelectionQuerySuffix({
45
+ mode: 'single',
46
+ scopeId: selectedScopeId,
47
+ }, {
48
+ multipleScopesLabel: multipleScopesQueryLabel,
49
+ singleScopeLabel: singleScopeQueryLabel,
50
+ });
51
+ useLayoutEffect(() => {
52
+ requestStore?.setSelection({
53
+ mode: 'single',
54
+ scopeId: selectedScopeId,
55
+ });
56
+ }, [requestStore, selectedScopeId]);
57
+ const setSelectedScopeId = useCallback((scopeId) => {
58
+ if (!scopeIdSet.has(scopeId)) {
59
+ return;
60
+ }
61
+ setSelectedScopeOverride({ identityKey, scopeId });
62
+ writeStoredScopeId(storageKeyPrefix, identityKey, 'single', scopeId);
63
+ }, [identityKey, scopeIdSet, storageKeyPrefix]);
64
+ const getSelectedScopeIds = useCallback((purpose, fallbackScopeIds = []) => {
65
+ const scopeIds = selectedScopeIdsOverrides[purpose]?.identityKey === identityKey
66
+ ? selectedScopeIdsOverrides[purpose].scopeIds
67
+ : readStoredScopeIds(storageKeyPrefix, identityKey, purpose);
68
+ return normalizeSelectedScopeIds(scopeIds, scopeIdSet, fallbackScopeIds);
69
+ }, [
70
+ identityKey,
71
+ scopeIdSet,
72
+ selectedScopeIdsOverrides,
73
+ storageKeyPrefix,
74
+ ]);
75
+ const setSelectedScopeIds = useCallback((purpose, scopeIds) => {
76
+ const fallbackScopeIds = selectedScopeId ? [selectedScopeId] : [];
77
+ const nextScopeIds = normalizeSelectedScopeIds(scopeIds, scopeIdSet, fallbackScopeIds);
78
+ setSelectedScopeIdsOverrides((current) => ({
79
+ ...current,
80
+ [purpose]: {
81
+ identityKey,
82
+ scopeIds: nextScopeIds,
83
+ },
84
+ }));
85
+ writeStoredScopeIds(storageKeyPrefix, identityKey, purpose, nextScopeIds);
86
+ }, [identityKey, scopeIdSet, selectedScopeId, storageKeyPrefix]);
87
+ const value = useMemo(() => ({
88
+ getSelectedScopeIds,
89
+ isLoading: scopeContextQuery.isLoading,
90
+ scopes,
91
+ scopeContext,
92
+ selectedScopeId,
93
+ setSelectedScopeId,
94
+ setSelectedScopeIds,
95
+ singleScopeQuerySuffix,
96
+ }), [
97
+ getSelectedScopeIds,
98
+ scopeContext,
99
+ scopeContextQuery.isLoading,
100
+ scopes,
101
+ selectedScopeId,
102
+ setSelectedScopeId,
103
+ setSelectedScopeIds,
104
+ singleScopeQuerySuffix,
105
+ ]);
106
+ return (_jsx(PresentationScopeSelectionContext.Provider, { value: value, children: children }));
107
+ }
108
+ function resolveDefaultScopeId(scopeContext, scopes, getDefaultScopeId) {
109
+ const scopeIds = new Set(scopes.map((scope) => scope.id));
110
+ const defaultScopeId = getDefaultScopeId?.(scopeContext, scopes);
111
+ if (defaultScopeId && scopeIds.has(defaultScopeId)) {
112
+ return defaultScopeId;
113
+ }
114
+ return scopes.find((scope) => scope.isDefault)?.id ?? scopes[0]?.id ?? null;
115
+ }
116
+ function normalizeSelectedScopeIds(scopeIds, allowedScopeIds, fallbackScopeIds) {
117
+ const selected = normalizeScopeIds(scopeIds)
118
+ .filter((scopeId) => allowedScopeIds.has(scopeId));
119
+ if (selected.length > 0) {
120
+ return selected;
121
+ }
122
+ return normalizeScopeIds(fallbackScopeIds)
123
+ .filter((scopeId) => allowedScopeIds.has(scopeId));
124
+ }
125
+ function isAllowedScope(scopeId, allowedScopeIds) {
126
+ return scopeId !== null && allowedScopeIds.has(scopeId);
127
+ }
128
+ function readStoredScopeId(storageKeyPrefix, identityKey, purpose) {
129
+ if (typeof window === 'undefined') {
130
+ return null;
131
+ }
132
+ const value = window.localStorage.getItem(createStorageKey(storageKeyPrefix, identityKey, purpose));
133
+ return value && value.trim().length > 0 ? value : null;
134
+ }
135
+ function writeStoredScopeId(storageKeyPrefix, identityKey, purpose, scopeId) {
136
+ if (typeof window === 'undefined') {
137
+ return;
138
+ }
139
+ window.localStorage.setItem(createStorageKey(storageKeyPrefix, identityKey, purpose), scopeId);
140
+ }
141
+ function readStoredScopeIds(storageKeyPrefix, identityKey, purpose) {
142
+ if (typeof window === 'undefined') {
143
+ return [];
144
+ }
145
+ try {
146
+ const value = window.localStorage.getItem(createStorageKey(storageKeyPrefix, identityKey, purpose));
147
+ return value ? JSON.parse(value) : [];
148
+ }
149
+ catch {
150
+ return [];
151
+ }
152
+ }
153
+ function writeStoredScopeIds(storageKeyPrefix, identityKey, purpose, scopeIds) {
154
+ if (typeof window === 'undefined') {
155
+ return;
156
+ }
157
+ window.localStorage.setItem(createStorageKey(storageKeyPrefix, identityKey, purpose), JSON.stringify(scopeIds));
158
+ }
159
+ function createStorageKey(storageKeyPrefix, identityKey, purpose) {
160
+ return `${storageKeyPrefix}.${purpose}.${identityKey}`;
161
+ }
162
+ //# sourceMappingURL=scope-selection-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-provider.js","sourceRoot":"","sources":["../src/scope-selection-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EACL,WAAW,EACX,eAAe,EACf,OAAO,EACP,QAAQ,GAET,MAAM,OAAO,CAAA;AAEd,OAAO,EACL,2CAA2C,EAC3C,iBAAiB,GAGlB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,iCAAiC,GAElC,MAAM,2BAA2B,CAAA;AAuDlC;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAGhD,EACA,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,GACuD;IACvE,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GACrD,QAAQ,CAA+B,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,GAC7D,QAAQ,CAA2C,EAAE,CAAC,CAAA;IACxD,MAAM,iBAAiB,GAAG,QAAQ,CAAgB;QAChD,OAAO;QACP,OAAO,EAAE,gBAAgB;QACzB,QAAQ;QACR,KAAK,EAAE,KAAK;KACb,CAAC,CAAA;IACF,MAAM,YAAY,GAAG,iBAAiB,CAAC,IAAI,IAAI,IAAI,CAAA;IACnD,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,YAAY,CA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CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;AAChG,CAAC;AAED,SAAS,kBAAkB,CAAC,gBAAwB,EAAE,WAAmB,EAAE,OAAe;IACxF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;QACnG,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAa,CAAC,CAAC,CAAC,EAAE,CAAA;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,gBAAwB,EACxB,WAAmB,EACnB,OAAe,EACf,QAA2B;IAE3B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAM;IACR,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAO,CACzB,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,EAAE,OAAO,CAAC,EACxD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CACzB,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,gBAAwB,EAAE,WAAmB,EAAE,OAAe;IACtF,OAAO,GAAG,gBAAgB,IAAI,OAAO,IAAI,WAAW,EAAE,CAAA;AACxD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PresentationScopeRequestSelection, PresentationScopeRequestStore } from '@cohesivesystems/presentation-core';
2
+ /**
3
+ * Synchronizes a mounted route or surface with the current request-scope store.
4
+ */
5
+ export declare function usePresentationScopeRequestSelection(store: PresentationScopeRequestStore, selection: PresentationScopeRequestSelection): void;
6
+ //# sourceMappingURL=scope-selection-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-request.d.ts","sourceRoot":"","sources":["../src/scope-selection-request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iCAAiC,EACjC,6BAA6B,EAC9B,MAAM,oCAAoC,CAAA;AAE3C;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,6BAA6B,EACpC,SAAS,EAAE,iCAAiC,QAQ7C"}
@@ -0,0 +1,12 @@
1
+ import { useLayoutEffect } from 'react';
2
+ /**
3
+ * Synchronizes a mounted route or surface with the current request-scope store.
4
+ */
5
+ export function usePresentationScopeRequestSelection(store, selection) {
6
+ const selectionKey = store.formatQuerySuffix(selection);
7
+ useLayoutEffect(() => {
8
+ store.setSelection(selection);
9
+ return () => store.setSelection({ mode: 'default' });
10
+ }, [selection, selectionKey, store]);
11
+ }
12
+ //# sourceMappingURL=scope-selection-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-selection-request.js","sourceRoot":"","sources":["../src/scope-selection-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAOvC;;GAEG;AACH,MAAM,UAAU,oCAAoC,CAClD,KAAoC,EACpC,SAA4C;IAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAEvD,eAAe,CAAC,GAAG,EAAE;QACnB,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAC7B,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;IACtD,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;AACtC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ProjectedNavigationShellLayout } from '@cohesivesystems/presentation-core';
3
+ import { type ProjectedNavigationShellFrameRenderContext } from './navigation-shell-frame-renderer-registry.js';
4
+ export interface StandardNavigationShellFrameLayout {
5
+ readonly headerClassName: string;
6
+ readonly headerContentClassName: string;
7
+ readonly headerNavigationClassName: string;
8
+ readonly rootClassName: string;
9
+ }
10
+ export type StandardNavigationShellLayout<TSlotLayout = unknown> = ProjectedNavigationShellLayout<StandardNavigationShellFrameLayout, TSlotLayout>;
11
+ export type StandardNavigationShellFrameRenderContext<TSlotLayout = unknown> = ProjectedNavigationShellFrameRenderContext<StandardNavigationShellLayout<TSlotLayout>>;
12
+ export declare const standardNavigationShellFrameRenderers: Readonly<Record<string, import('./navigation-shell-frame-renderer-registry.js').NavigationShellFrameRenderer<StandardNavigationShellLayout<unknown>>>>;
13
+ export declare const standardNavigationShellFrameRendererKeys: string[];
14
+ export declare function renderStandardNavigationShellFrame(context: StandardNavigationShellFrameRenderContext): ReactNode;
15
+ //# sourceMappingURL=standard-navigation-shell-frame-renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-navigation-shell-frame-renderers.d.ts","sourceRoot":"","sources":["../src/standard-navigation-shell-frame-renderers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EACV,8BAA8B,EAC/B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAIL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAA;AAEnD,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAA;IACvC,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,MAAM,MAAM,6BAA6B,CAAC,WAAW,GAAG,OAAO,IAC7D,8BAA8B,CAC5B,kCAAkC,EAClC,WAAW,CACZ,CAAA;AAEH,MAAM,MAAM,yCAAyC,CAAC,WAAW,GAAG,OAAO,IACzE,0CAA0C,CACxC,6BAA6B,CAAC,WAAW,CAAC,CAC3C,CAAA;AAEH,eAAO,MAAM,qCAAqC,qJAM9C,CAAA;AAEJ,eAAO,MAAM,wCAAwC,UAC+B,CAAA;AAEpF,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,yCAAyC,aAQnD"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { navigationShellKinds, } from '@cohesivesystems/presentation-contracts';
3
+ import { createNavigationShellFrameRendererRegistry, getNavigationShellFrameRendererRegistryKeys, resolveNavigationShellFrameRenderer, } from './navigation-shell-frame-renderer-registry.js';
4
+ export const standardNavigationShellFrameRenderers = createNavigationShellFrameRendererRegistry([
5
+ {
6
+ kind: navigationShellKinds.topNavigation,
7
+ render: renderStandardTopNavigationShellFrame,
8
+ },
9
+ ]);
10
+ export const standardNavigationShellFrameRendererKeys = getNavigationShellFrameRendererRegistryKeys(standardNavigationShellFrameRenderers);
11
+ export function renderStandardNavigationShellFrame(context) {
12
+ const renderer = resolveNavigationShellFrameRenderer(standardNavigationShellFrameRenderers, context.navigation.Shell.Kind);
13
+ return renderer?.(context) ?? context.children;
14
+ }
15
+ function renderStandardTopNavigationShellFrame({ children, layout, renderSlot, }) {
16
+ const frame = layout.frame;
17
+ return (_jsxs("div", { className: frame.rootClassName, children: [_jsx("header", { className: frame.headerClassName, children: _jsxs("div", { className: frame.headerContentClassName, children: [layout.brandSlot ? (_jsx(ShellSlot, { slot: layout.brandSlot, children: renderSlot(layout.brandSlot) })) : null, _jsxs("div", { className: frame.headerNavigationClassName, children: [layout.primaryNavigationSlot ? (_jsx(ShellSlot, { slot: layout.primaryNavigationSlot, children: renderSlot(layout.primaryNavigationSlot) })) : null, layout.utilityActionSlots.map((slot) => (_jsx(ShellSlot, { slot: slot, children: renderSlot(slot) }, slot.Id)))] })] }) }), layout.systemNoticeSlots.map((slot) => (_jsx(ShellSlot, { slot: slot, children: renderSlot(slot) }, slot.Id))), _jsx(ShellSlot, { slot: layout.routedContentSlot, children: layout.routedContentSlot ? renderSlot(layout.routedContentSlot) : children })] }));
18
+ }
19
+ function ShellSlot({ children, }) {
20
+ return _jsx(_Fragment, { children: children });
21
+ }
22
+ //# sourceMappingURL=standard-navigation-shell-frame-renderers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-navigation-shell-frame-renderers.js","sourceRoot":"","sources":["../src/standard-navigation-shell-frame-renderers.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,oBAAoB,GAErB,MAAM,yCAAyC,CAAA;AAIhD,OAAO,EACL,0CAA0C,EAC1C,2CAA2C,EAC3C,mCAAmC,GAEpC,MAAM,4CAA4C,CAAA;AAoBnD,MAAM,CAAC,MAAM,qCAAqC,GAChD,0CAA0C,CAAC;IACzC;QACE,IAAI,EAAE,oBAAoB,CAAC,aAAa;QACxC,MAAM,EAAE,qCAAqC;KAC9C;CACF,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,wCAAwC,GACnD,2CAA2C,CAAC,qCAAqC,CAAC,CAAA;AAEpF,MAAM,UAAU,kCAAkC,CAChD,OAAkD;IAElD,MAAM,QAAQ,GAAG,mCAAmC,CAClD,qCAAqC,EACrC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAC9B,CAAA;IAED,OAAO,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAA;AAChD,CAAC;AAED,SAAS,qCAAqC,CAAC,EAC7C,QAAQ,EACR,MAAM,EACN,UAAU,GACgC;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;IAE1B,OAAO,CACL,eAAK,SAAS,EAAE,KAAK,CAAC,aAAa,aACjC,iBAAQ,SAAS,EAAE,KAAK,CAAC,eAAe,YACtC,eAAK,SAAS,EAAE,KAAK,CAAC,sBAAsB,aACzC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAClB,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,CAAC,SAAS,YAC9B,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,GACnB,CACb,CAAC,CAAC,CAAC,IAAI,EACR,eAAK,SAAS,EAAE,KAAK,CAAC,yBAAyB,aAC5C,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAC9B,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,CAAC,qBAAqB,YAC1C,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAC/B,CACb,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACvC,KAAC,SAAS,IAAe,IAAI,EAAE,IAAI,YAChC,UAAU,CAAC,IAAI,CAAC,IADH,IAAI,CAAC,EAAE,CAEX,CACb,CAAC,IACE,IACF,GACC,EACR,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACtC,KAAC,SAAS,IAAe,IAAI,EAAE,IAAI,YAChC,UAAU,CAAC,IAAI,CAAC,IADH,IAAI,CAAC,EAAE,CAEX,CACb,CAAC,EACF,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,YACtC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,GACjE,IACR,CACP,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,QAAQ,GAIT;IACC,OAAO,4BAAG,QAAQ,GAAI,CAAA;AACxB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type NavigationDefinition, type NavigationNodeDefinition, type NavigationShellRegionDefinition, type NavigationShellSlotDefinition } from '@cohesivesystems/presentation-contracts';
3
+ import { type ProjectedNavigationShellItem } from '@cohesivesystems/presentation-core';
4
+ import { type ProjectedNavigationShellSlotRenderContext } from './navigation-shell-slot-renderer-registry.js';
5
+ export type StandardNavigationShellBadgeVariant = 'default' | 'destructive' | 'ghost' | 'link' | 'outline' | 'secondary';
6
+ export interface StandardNavigationShellBadgeProps {
7
+ readonly children?: ReactNode;
8
+ readonly className?: string;
9
+ readonly variant?: StandardNavigationShellBadgeVariant;
10
+ }
11
+ export interface StandardNavigationShellNavigationLinkProps {
12
+ readonly children?: ReactNode;
13
+ readonly className?: string;
14
+ readonly isActive?: boolean;
15
+ readonly to: string;
16
+ }
17
+ export interface StandardNavigationShellComponentSystem {
18
+ readonly badges: {
19
+ readonly Badge: (props: StandardNavigationShellBadgeProps) => ReactNode;
20
+ };
21
+ readonly navigation: {
22
+ readonly NavigationLink: (props: StandardNavigationShellNavigationLinkProps) => ReactNode;
23
+ };
24
+ }
25
+ export interface StandardNavigationShellSlotLayout {
26
+ readonly brandBadgeClassName: string;
27
+ readonly brandSubtitleClassName: string;
28
+ readonly brandTitleClassName: string;
29
+ readonly navigationItemClassName: string;
30
+ readonly rootClassName: string;
31
+ }
32
+ export type StandardNavigationShellSlotRenderContext<TComponentSystem extends StandardNavigationShellComponentSystem = StandardNavigationShellComponentSystem> = ProjectedNavigationShellSlotRenderContext<StandardNavigationShellSlotLayout, TComponentSystem>;
33
+ export declare const standardNavigationShellSlotRenderers: Readonly<Record<string, import('./navigation-shell-slot-renderer-registry.js').NavigationShellSlotRenderer<StandardNavigationShellSlotLayout, StandardNavigationShellComponentSystem>>>;
34
+ export declare const standardNavigationShellSlotRendererKeys: string[];
35
+ export declare function renderStandardNavigationShellSlot(context: StandardNavigationShellSlotRenderContext): string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null;
36
+ export declare function StandardNavigationShellBrandSlot({ brandLabel, componentSystem, renderShellIcon, shellIcon, slotLayout, subtitle, title, }: {
37
+ readonly brandLabel: string | null;
38
+ readonly componentSystem: StandardNavigationShellComponentSystem;
39
+ readonly renderShellIcon?: (icon: string) => ReactNode;
40
+ readonly shellIcon: string | null;
41
+ readonly slotLayout: StandardNavigationShellSlotLayout;
42
+ readonly subtitle: string | null;
43
+ readonly title: string | null;
44
+ }): import("react/jsx-runtime").JSX.Element;
45
+ export declare function StandardNavigationShellPrimaryNavigationSlot({ activePath, componentSystem, items, navigation, renderNodeIcon, slotLayout, }: {
46
+ readonly activePath: string;
47
+ readonly componentSystem: StandardNavigationShellComponentSystem;
48
+ readonly items: readonly ProjectedNavigationShellItem[];
49
+ readonly navigation: NavigationDefinition;
50
+ readonly renderNodeIcon?: (node: NavigationNodeDefinition) => ReactNode;
51
+ readonly slotLayout: StandardNavigationShellSlotLayout;
52
+ }): import("react/jsx-runtime").JSX.Element | null;
53
+ export declare function StandardNavigationShellRegionSlot({ navigation, renderShellRegion, slot, slotLayout, }: {
54
+ readonly navigation: NavigationDefinition;
55
+ readonly renderShellRegion?: (region: NavigationShellRegionDefinition) => ReactNode;
56
+ readonly slot: NavigationShellSlotDefinition;
57
+ readonly slotLayout: StandardNavigationShellSlotLayout;
58
+ }): import("react/jsx-runtime").JSX.Element;
59
+ //# sourceMappingURL=standard-navigation-shell-slot-renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-navigation-shell-slot-renderers.d.ts","sourceRoot":"","sources":["../src/standard-navigation-shell-slot-renderers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EACnC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAIL,KAAK,yCAA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CAAC,EAAE,CAAC,MAAM,EAAE,+BAA+B,KAAK,SAAS,CAAA;IACnF,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAA;IAC5C,QAAQ,CAAC,UAAU,EAAE,iCAAiC,CAAA;CACvD,2CAUA"}
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { navigationShellSlotKinds, } from '@cohesivesystems/presentation-contracts';
3
+ import { createProjectedNavigationShellItems, isProjectedNavigationShellItemActive, resolveNavigationShellSlotRegions, } from '@cohesivesystems/presentation-core';
4
+ import { createNavigationShellSlotRendererRegistry, getNavigationShellSlotRendererRegistryKeys, resolveNavigationShellSlotRenderer, } from './navigation-shell-slot-renderer-registry.js';
5
+ export const standardNavigationShellSlotRenderers = createNavigationShellSlotRendererRegistry([
6
+ {
7
+ kind: navigationShellSlotKinds.brand,
8
+ render: renderStandardNavigationShellBrand,
9
+ },
10
+ {
11
+ kind: navigationShellSlotKinds.primaryNavigation,
12
+ render: renderStandardNavigationShellPrimaryNavigation,
13
+ },
14
+ {
15
+ kind: navigationShellSlotKinds.utilityActions,
16
+ render: renderStandardNavigationShellRegionSlot,
17
+ },
18
+ {
19
+ kind: navigationShellSlotKinds.systemNotices,
20
+ render: renderStandardNavigationShellRegionSlot,
21
+ },
22
+ {
23
+ kind: navigationShellSlotKinds.routedContent,
24
+ render: renderStandardNavigationShellRoutedContent,
25
+ },
26
+ ]);
27
+ export const standardNavigationShellSlotRendererKeys = getNavigationShellSlotRendererRegistryKeys(standardNavigationShellSlotRenderers);
28
+ export function renderStandardNavigationShellSlot(context) {
29
+ const renderer = resolveNavigationShellSlotRenderer(standardNavigationShellSlotRenderers, context.slot);
30
+ return renderer?.(context) ?? null;
31
+ }
32
+ export function StandardNavigationShellBrandSlot({ brandLabel, componentSystem, renderShellIcon, shellIcon, slotLayout, subtitle, title, }) {
33
+ const Badge = componentSystem.badges.Badge;
34
+ return (_jsxs("div", { className: slotLayout.rootClassName, children: [shellIcon && renderShellIcon ? renderShellIcon(shellIcon) : null, brandLabel ? (_jsx(Badge, { className: slotLayout.brandBadgeClassName, variant: "outline", children: brandLabel })) : null, title ? (_jsx("span", { className: slotLayout.brandTitleClassName, children: title })) : null, subtitle ? (_jsx("span", { className: slotLayout.brandSubtitleClassName, children: subtitle })) : null] }));
35
+ }
36
+ export function StandardNavigationShellPrimaryNavigationSlot({ activePath, componentSystem, items, navigation, renderNodeIcon, slotLayout, }) {
37
+ if (items.length === 0) {
38
+ return null;
39
+ }
40
+ const NavigationLink = componentSystem.navigation.NavigationLink;
41
+ return (_jsx("nav", { className: slotLayout.rootClassName, children: items.map((item) => (_jsxs(NavigationLink, { className: slotLayout.navigationItemClassName, isActive: isProjectedNavigationShellItemActive(activePath, item, navigation), to: item.href, children: [renderNodeIcon?.(item.node), item.label] }, item.node.Id))) }));
42
+ }
43
+ export function StandardNavigationShellRegionSlot({ navigation, renderShellRegion, slot, slotLayout, }) {
44
+ const regions = resolveNavigationShellSlotRegions(navigation, slot);
45
+ return (_jsx("div", { className: slotLayout.rootClassName, children: regions.map((region) => (_jsx(ShellRegion, { region: region, renderShellRegion: renderShellRegion }, region.Id))) }));
46
+ }
47
+ function renderStandardNavigationShellBrand({ componentSystem, navigation, renderShellIcon, slotLayout, }) {
48
+ const chrome = navigation.Shell.Chrome;
49
+ const brandLabel = chrome?.BrandLabel ?? null;
50
+ const title = chrome?.Title ?? navigation.Label;
51
+ const subtitle = chrome?.Subtitle ?? null;
52
+ const shellIcon = chrome?.Icon ?? null;
53
+ return (_jsx(StandardNavigationShellBrandSlot, { brandLabel: brandLabel, componentSystem: componentSystem, renderShellIcon: renderShellIcon, shellIcon: shellIcon, slotLayout: slotLayout, subtitle: subtitle, title: title }));
54
+ }
55
+ function renderStandardNavigationShellPrimaryNavigation({ activePath, componentSystem, navigation, renderNodeIcon, slot, slotLayout, }) {
56
+ return (_jsx(StandardNavigationShellPrimaryNavigationSlot, { activePath: activePath, componentSystem: componentSystem, items: createProjectedNavigationShellItems(navigation, slot), navigation: navigation, renderNodeIcon: renderNodeIcon, slotLayout: slotLayout }));
57
+ }
58
+ function renderStandardNavigationShellRegionSlot({ navigation, renderShellRegion, slot, slotLayout, }) {
59
+ return (_jsx(StandardNavigationShellRegionSlot, { navigation: navigation, renderShellRegion: renderShellRegion, slot: slot, slotLayout: slotLayout }));
60
+ }
61
+ function renderStandardNavigationShellRoutedContent({ children, slotLayout, }) {
62
+ return _jsx("div", { className: slotLayout.rootClassName, children: children });
63
+ }
64
+ function ShellRegion({ region, renderShellRegion, }) {
65
+ return renderShellRegion?.(region) ?? null;
66
+ }
67
+ //# sourceMappingURL=standard-navigation-shell-slot-renderers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-navigation-shell-slot-renderers.js","sourceRoot":"","sources":["../src/standard-navigation-shell-slot-renderers.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,wBAAwB,GAKzB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,mCAAmC,EACnC,oCAAoC,EACpC,iCAAiC,GAElC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,yCAAyC,EACzC,0CAA0C,EAC1C,kCAAkC,GAEnC,MAAM,2CAA2C,CAAA;AAkDlD,MAAM,CAAC,MAAM,oCAAoC,GAC/C,yCAAyC,CAGvC;IACA;QACE,IAAI,EAAE,wBAAwB,CAAC,KAAK;QACpC,MAAM,EAAE,kCAAkC;KAC3C;IACD;QACE,IAAI,EAAE,wBAAwB,CAAC,iBAAiB;QAChD,MAAM,EAAE,8CAA8C;KACvD;IACD;QACE,IAAI,EAAE,wBAAwB,CAAC,cAAc;QAC7C,MAAM,EAAE,uCAAuC;KAChD;IACD;QACE,IAAI,EAAE,wBAAwB,CAAC,aAAa;QAC5C,MAAM,EAAE,uCAAuC;KAChD;IACD;QACE,IAAI,EAAE,wBAAwB,CAAC,aAAa;QAC5C,MAAM,EAAE,0CAA0C;KACnD;CACF,CAAC,CAAA;AA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GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,CAAA;IAEtC,OAAO,CACL,KAAC,gCAAgC,IAC/B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,CACH,CAAA;AACH,CAAC;AAED,SAAS,8CAA8C,CAAC,EACtD,UAAU,EACV,eAAe,EACf,UAAU,EACV,cAAc,EACd,IAAI,EACJ,UAAU,GAC+B;IACzC,OAAO,CACL,KAAC,4CAA4C,IAC3C,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,mCAAmC,CAAC,UAAU,EAAE,IAAI,CAAC,EAC5D,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACtB,CACH,CAAA;AACH,CAAC;AAED,SAAS,uCAAuC,CAAC,EAC/C,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,UAAU,GAC+B;IACzC,OAAO,CACL,KAAC,iCAAiC,IAChC,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,GACtB,CACH,CAAA;AACH,CAAC;AAED,SAAS,0CAA0C,CAAC,EAClD,QAAQ,EACR,UAAU,GAC+B;IACzC,OAAO,cAAK,SAAS,EAAE,UAAU,CAAC,aAAa,YAAG,QAAQ,GAAO,CAAA;AACnE,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,MAAM,EACN,iBAAiB,GAIlB;IACC,OAAO,iBAAiB,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import { createViewChromeSlotRendererKey, getViewChromeSlotRendererCandidateKeys, hasViewChromeSlotRendererBinding, isViewChromeSlotKind, isViewChromeSlotPlacement, isViewChromeSlotPlacementValue, viewChromeSlotAnyPlacement, type ViewChromeSlotRendererBinding as CoreViewChromeSlotRendererBinding, type ViewChromeSlotRendererRegistry as CoreViewChromeSlotRendererRegistry } from '@cohesivesystems/presentation-core';
3
+ import type { ViewChromeSlotDefinition, ViewChromeSlotKind, ViewChromeSlotPlacement } from '@cohesivesystems/presentation-contracts';
4
+ export { createViewChromeSlotRendererKey, getViewChromeSlotRendererCandidateKeys, hasViewChromeSlotRendererBinding, isViewChromeSlotKind, isViewChromeSlotPlacement, isViewChromeSlotPlacementValue, viewChromeSlotAnyPlacement, };
5
+ export type ViewChromeSlotRenderer<TContext> = (context: TContext) => ReactNode;
6
+ export type ViewChromeSlotRendererRegistry<TContext> = CoreViewChromeSlotRendererRegistry<TContext, ReactNode>;
7
+ export type ViewChromeSlotRendererBinding<TContext> = CoreViewChromeSlotRendererBinding<TContext, ReactNode>;
8
+ export declare function createViewChromeSlotRendererRegistry<TContext>(bindings: readonly ViewChromeSlotRendererBinding<TContext>[]): ViewChromeSlotRendererRegistry<TContext>;
9
+ export declare function getViewChromeSlotRendererRegistryKeys<TContext>(registry: ViewChromeSlotRendererRegistry<TContext> | null | undefined): string[];
10
+ export declare function resolveViewChromeSlotRenderer<TContext>(registry: ViewChromeSlotRendererRegistry<TContext> | null | undefined, slot: ViewChromeSlotDefinition): import("@cohesivesystems/presentation-core").ViewChromeSlotRenderer<TContext, ReactNode> | null;
11
+ export type { ViewChromeSlotDefinition, ViewChromeSlotKind, ViewChromeSlotPlacement, };
12
+ //# sourceMappingURL=view-chrome-slot-renderer-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-chrome-slot-renderer-registry.d.ts","sourceRoot":"","sources":["../src/view-chrome-slot-renderer-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EACL,+BAA+B,EAE/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otRendererCandidateKeys, getViewChromeSlotRendererRegistryKeys as getCoreViewChromeSlotRendererRegistryKeys, hasViewChromeSlotRendererBinding, isViewChromeSlotKind, isViewChromeSlotPlacement, isViewChromeSlotPlacementValue, resolveViewChromeSlotRenderer as resolveCoreViewChromeSlotRenderer, viewChromeSlotAnyPlacement, } from '@cohesivesystems/presentation-core';
2
+ export { createViewChromeSlotRendererKey, getViewChromeSlotRendererCandidateKeys, hasViewChromeSlotRendererBinding, isViewChromeSlotKind, isViewChromeSlotPlacement, isViewChromeSlotPlacementValue, viewChromeSlotAnyPlacement, };
3
+ export function createViewChromeSlotRendererRegistry(bindings) {
4
+ return createCoreViewChromeSlotRendererRegistry(bindings);
5
+ }
6
+ export function getViewChromeSlotRendererRegistryKeys(registry) {
7
+ return getCoreViewChromeSlotRendererRegistryKeys(registry);
8
+ }
9
+ export function resolveViewChromeSlotRenderer(registry, slot) {
10
+ return resolveCoreViewChromeSlotRenderer(registry, slot);
11
+ }
12
+ //# sourceMappingURL=view-chrome-slot-renderer-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-chrome-slot-renderer-registry.js","sourceRoot":"","sources":["../src/view-chrome-slot-renderer-registry.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,IAAI,wCAAwC,EAChF,sCAAsC,EACtC,qCAAqC,IAAI,yCAAyC,EAClF,gCAAgC,EAChC,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,IAAI,iCAAiC,EAClE,0BAA0B,GAG3B,MAAM,oCAAoC,CAAA;AAO3C,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,gCAAgC,EAChC,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,GAC3B,CAAA;AAYD,MAAM,UAAU,oCAAoC,CAClD,QAA4D;IAE5D,OAAO,wCAAwC,CAAsB,QAAQ,CAAC,CAAA;AAChF,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,QAAqE;IAErE,OAAO,yCAAyC,CAAsB,QAAQ,CAAC,CAAA;AACjF,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,QAAqE,EACrE,IAA8B;IAE9B,OAAO,iCAAiC,CAAsB,QAAQ,EAAE,IAAI,CAAC,CAAA;AAC/E,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@cohesivesystems/presentation-react",
3
+ "version": "0.1.0-alpha.1",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "src/**/*.ts",
15
+ "src/**/*.tsx",
16
+ "!src/**/*.test.ts",
17
+ "!src/**/*.test.tsx"
18
+ ],
19
+ "dependencies": {
20
+ "@cohesivesystems/presentation-contracts": "0.1.0-alpha.1",
21
+ "@cohesivesystems/presentation-core": "0.1.0-alpha.1"
22
+ },
23
+ "peerDependencies": {
24
+ "@tanstack/react-query": ">=5",
25
+ "react": ">=19",
26
+ "react-dom": ">=19",
27
+ "react-router": ">=7"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "^19.2.14",
31
+ "@types/react-dom": "^19.2.3",
32
+ "typescript": "~5.9.3",
33
+ "vitest": "^4.1.7"
34
+ },
35
+ "license": "Apache-2.0",
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "description": "React runtime bindings for Cohesive presentation modules.",
40
+ "keywords": [
41
+ "cohesive",
42
+ "presentation",
43
+ "react",
44
+ "runtime"
45
+ ],
46
+ "author": "Cohesive Systems",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/cohesivesystems/cohesive.git",
50
+ "directory": "src/frontend/presentation-react"
51
+ },
52
+ "bugs": {
53
+ "url": "https://github.com/cohesivesystems/cohesive/issues"
54
+ },
55
+ "homepage": "https://github.com/cohesivesystems/cohesive#readme",
56
+ "scripts": {
57
+ "build": "tsc -p tsconfig.json && node ../../../eng/fix-package-js-imports.mjs dist",
58
+ "test": "vitest run --passWithNoTests"
59
+ }
60
+ }