@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,25 @@
1
+ import { createPresentationEnumDiscriminator, mergePresentationRendererRegistries as mergeCorePresentationRendererRegistries, resolvePresentationViewRenderer as resolveCorePresentationViewRenderer, } from '@cohesivesystems/presentation-core';
2
+ import { presentationTargetKinds } from '@cohesivesystems/presentation-contracts';
3
+ /**
4
+ * Combines renderer registries in declaration order, with later registries
5
+ * overriding earlier renderer keys and fallback renderers.
6
+ */
7
+ export function mergePresentationRendererRegistries(...registries) {
8
+ return mergeCorePresentationRendererRegistries(...registries);
9
+ }
10
+ /**
11
+ * Resolves the React renderer for a semantic view while keeping binding
12
+ * resolution in the framework-neutral core package.
13
+ */
14
+ export function resolvePresentationViewRenderer({ componentSet, module, registry, routeId, view, }) {
15
+ return resolveCorePresentationViewRenderer({
16
+ componentSet,
17
+ module,
18
+ registry,
19
+ routeId,
20
+ targetKind: reactPresentationTargetKind,
21
+ view,
22
+ });
23
+ }
24
+ const reactPresentationTargetKind = createPresentationEnumDiscriminator(presentationTargetKinds, 'react', 'React');
25
+ //# sourceMappingURL=presentation-renderer-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-renderer-registry.js","sourceRoot":"","sources":["../src/presentation-renderer-registry.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,IAAI,uCAAuC,EAC9E,+BAA+B,IAAI,mCAAmC,GAWvE,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAmJjF;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,GAAG,UAA6D;IAEhE,OAAO,uCAAuC,CAI5C,GAAG,UAAU,CAA2C,CAAA;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAI7C,EACA,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAI,GAIL;IACC,OAAO,mCAAmC,CAGxC;QACA,YAAY;QACZ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,UAAU,EAAE,2BAA2B;QACvC,IAAI;KACL,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,2BAA2B,GAAG,mCAAmC,CACrE,uBAAuB,EACvB,OAAO,EACP,OAAO,CACR,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Context } from 'react';
2
+ export declare function createPresentationStandardsContext<TStandards>(): Context<TStandards | null>;
3
+ export declare function usePresentationStandards<TStandards>(context: Context<TStandards | null>, label?: string): NonNullable<TStandards>;
4
+ //# sourceMappingURL=presentation-standards-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-standards-context.d.ts","sourceRoot":"","sources":["../src/presentation-standards-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,OAAO,CAAA;AAEd,wBAAgB,kCAAkC,CAAC,UAAU,gCAE5D;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EACjD,OAAO,EAAE,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,EACnC,KAAK,SAA2B,2BAQjC"}
@@ -0,0 +1,12 @@
1
+ import { createContext, useContext, } from 'react';
2
+ export function createPresentationStandardsContext() {
3
+ return createContext(null);
4
+ }
5
+ export function usePresentationStandards(context, label = 'Presentation standards') {
6
+ const standards = useContext(context);
7
+ if (!standards) {
8
+ throw new Error(`${label} are not available.`);
9
+ }
10
+ return standards;
11
+ }
12
+ //# sourceMappingURL=presentation-standards-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-standards-context.js","sourceRoot":"","sources":["../src/presentation-standards-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,GAEX,MAAM,OAAO,CAAA;AAEd,MAAM,UAAU,kCAAkC;IAChD,OAAO,aAAa,CAAoB,IAAI,CAAC,CAAA;AAC/C,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAAmC,EACnC,KAAK,GAAG,wBAAwB;IAEhC,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACrC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qBAAqB,CAAC,CAAA;IAChD,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type Context, type PropsWithChildren } from 'react';
2
+ import type { PresentationStandardsComposer } from '@cohesivesystems/presentation-core';
3
+ export interface PresentationStandardsProviderProps<TStandards, TContribution> extends PropsWithChildren {
4
+ readonly compose: PresentationStandardsComposer<TStandards, TContribution>;
5
+ readonly context: Context<TStandards | null>;
6
+ readonly standards: TContribution;
7
+ }
8
+ /**
9
+ * Generic standards provider. Nested providers compose their local contribution
10
+ * over the inherited standards, so feature areas can override or enrich app
11
+ * defaults without replacing the whole standards object.
12
+ */
13
+ export declare function PresentationStandardsProvider<TStandards, TContribution>({ children, compose, context, standards, }: PresentationStandardsProviderProps<TStandards, TContribution>): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=presentation-standards-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-standards-provider.d.ts","sourceRoot":"","sources":["../src/presentation-standards-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAEvF,MAAM,WAAW,kCAAkC,CAAC,UAAU,EAAE,aAAa,CAC3E,SAAQ,iBAAiB;IACzB,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAC5C,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;CAClC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,aAAa,EAAE,EACvE,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,GACV,EAAE,kCAAkC,CAAC,UAAU,EAAE,aAAa,CAAC,2CAiB/D"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext, useMemo, } from 'react';
3
+ /**
4
+ * Generic standards provider. Nested providers compose their local contribution
5
+ * over the inherited standards, so feature areas can override or enrich app
6
+ * defaults without replacing the whole standards object.
7
+ */
8
+ export function PresentationStandardsProvider({ children, compose, context, standards, }) {
9
+ const StandardsContext = context;
10
+ const parent = useContext(StandardsContext);
11
+ const value = useMemo(() => (parent
12
+ ? compose(parent, standards)
13
+ : compose(standards)), [compose, parent, standards]);
14
+ return (_jsx(StandardsContext.Provider, { value: value, children: children }));
15
+ }
16
+ //# sourceMappingURL=presentation-standards-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-standards-provider.js","sourceRoot":"","sources":["../src/presentation-standards-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,OAAO,GAGR,MAAM,OAAO,CAAA;AAWd;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAA4B,EACvE,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,GACqD;IAC9D,MAAM,gBAAgB,GAAG,OAAO,CAAA;IAChC,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CACJ,MAAM;QACJ,CAAC,CAAC,OAAO,CAAC,MAAkC,EAAE,SAAS,CAAC;QACxD,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CACvB,EACD,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAC7B,CAAA;IAED,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpC,QAAQ,GACiB,CAC7B,CAAA;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { PresentationActionRuntimeBinding } from '@cohesivesystems/presentation-core';
2
+ import type { ProjectedDocumentActionRuntime, ProjectedDocumentJsonValidationState } from './projected-document-action-runtime.js';
3
+ export interface ProjectDocumentActionRuntimeBindingsOptions<TLabel = string> {
4
+ readonly formatDocument?: () => void;
5
+ readonly hasResource: boolean;
6
+ readonly isEditorDirty: boolean;
7
+ readonly jsonValidation: ProjectedDocumentJsonValidationState;
8
+ readonly pendingLabels?: {
9
+ readonly save?: TLabel;
10
+ };
11
+ readonly resetDocument?: () => void;
12
+ readonly runtime: ProjectedDocumentActionRuntime;
13
+ }
14
+ /**
15
+ * Projects generic document action runtime state into adapter-neutral action
16
+ * bindings. The runtime owns the semantic document mechanics; UI adapters own
17
+ * how these bindings become concrete controls.
18
+ */
19
+ export declare function projectDocumentActionRuntimeBindings<TExecuteContext = unknown, TLabel = string>({ formatDocument, hasResource, isEditorDirty, jsonValidation, pendingLabels, resetDocument, runtime, }: ProjectDocumentActionRuntimeBindingsOptions<TLabel>): readonly PresentationActionRuntimeBinding<TExecuteContext, TLabel>[];
20
+ //# sourceMappingURL=projected-document-action-runtime-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projected-document-action-runtime-bindings.d.ts","sourceRoot":"","sources":["../src/projected-document-action-runtime-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EACjC,MAAM,oCAAoC,CAAA;AAO3C,OAAO,KAAK,EACV,8BAA8B,EAC9B,oCAAoC,EACrC,MAAM,qCAAqC,CAAA;AAO5C,MAAM,WAAW,2CAA2C,CAC1D,MAAM,GAAG,MAAM;IAEf,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,cAAc,EAAE,oCAAoC,CAAA;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE;QACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,8BAA8B,CAAA;CACjD;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,eAAe,GAAG,OAAO,EACzB,MAAM,GAAG,MAAM,EACf,EACA,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,OAAO,GACR,EAAE,2CAA2C,CAC5C,MAAM,CACP,GAAG,SAAS,gCAAgC,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE,CAgFvE"}
@@ -0,0 +1,88 @@
1
+ import { createPresentationActionRuntimeBinding, } from '@cohesivesystems/presentation-core';
2
+ import { resolveActionPendingLabel, } from '@cohesivesystems/presentation-core';
3
+ import { actionSemanticsKinds, documentWorkspaceActionKinds, localDocumentEditorActionKinds, } from '@cohesivesystems/presentation-contracts';
4
+ /**
5
+ * Projects generic document action runtime state into adapter-neutral action
6
+ * bindings. The runtime owns the semantic document mechanics; UI adapters own
7
+ * how these bindings become concrete controls.
8
+ */
9
+ export function projectDocumentActionRuntimeBindings({ formatDocument, hasResource, isEditorDirty, jsonValidation, pendingLabels, resetDocument, runtime, }) {
10
+ const savePendingLabel = resolveActionPendingLabel({
11
+ action: runtime.actions.save,
12
+ fallback: pendingLabels?.save ?? 'Saving',
13
+ });
14
+ const saveCommitPendingLabel = resolveActionPendingLabel({
15
+ action: runtime.actions.saveCommit,
16
+ fallback: savePendingLabel,
17
+ });
18
+ return [
19
+ createPresentationActionRuntimeBinding({
20
+ documentWorkspaceKind: documentWorkspaceActionKinds.saveReview,
21
+ id: 'document-save-preview-flow',
22
+ semanticsKind: actionSemanticsKinds.documentWorkspace,
23
+ project: () => ({
24
+ execute: runtime.requestSaveReview,
25
+ isDisabled: !isEditorDirty ||
26
+ !jsonValidation.ok ||
27
+ !runtime.save.endpointId ||
28
+ runtime.save.isPending ||
29
+ runtime.isSaveReviewOpen,
30
+ isHidden: !hasResource,
31
+ isPending: runtime.save.isPending,
32
+ pendingLabel: savePendingLabel,
33
+ }),
34
+ }),
35
+ createPresentationActionRuntimeBinding({
36
+ documentWorkspaceKind: documentWorkspaceActionKinds.saveCommit,
37
+ id: 'accept-save-review',
38
+ semanticsKind: actionSemanticsKinds.documentWorkspace,
39
+ project: () => ({
40
+ execute: runtime.acceptSaveReview,
41
+ isDisabled: runtime.save.isPending,
42
+ isHidden: !runtime.isSaveReviewOpen,
43
+ isPending: runtime.save.isPending,
44
+ pendingLabel: saveCommitPendingLabel,
45
+ }),
46
+ }),
47
+ createPresentationActionRuntimeBinding({
48
+ documentWorkspaceKind: documentWorkspaceActionKinds.saveCancel,
49
+ id: 'cancel-save-review',
50
+ semanticsKind: actionSemanticsKinds.documentWorkspace,
51
+ project: () => ({
52
+ execute: runtime.cancelSaveReview,
53
+ isDisabled: runtime.save.isPending,
54
+ isHidden: !runtime.isSaveReviewOpen,
55
+ }),
56
+ }),
57
+ createPresentationActionRuntimeBinding({
58
+ documentWorkspaceKind: documentWorkspaceActionKinds.saveRevert,
59
+ id: 'revert-save-review',
60
+ semanticsKind: actionSemanticsKinds.documentWorkspace,
61
+ project: () => ({
62
+ execute: runtime.resetSaveReview,
63
+ isDisabled: runtime.save.isPending,
64
+ isHidden: !runtime.isSaveReviewOpen,
65
+ }),
66
+ }),
67
+ createPresentationActionRuntimeBinding({
68
+ id: 'reset-json-document',
69
+ localDocumentEditorKind: localDocumentEditorActionKinds.reset,
70
+ semanticsKind: actionSemanticsKinds.localDocumentEditor,
71
+ project: () => ({
72
+ execute: resetDocument ?? runtime.resetDocument,
73
+ isHidden: !hasResource,
74
+ }),
75
+ }),
76
+ createPresentationActionRuntimeBinding({
77
+ id: 'format-json-document',
78
+ localDocumentEditorKind: localDocumentEditorActionKinds.format,
79
+ semanticsKind: actionSemanticsKinds.localDocumentEditor,
80
+ project: () => ({
81
+ execute: formatDocument ?? runtime.formatDocument,
82
+ isDisabled: !jsonValidation.ok,
83
+ isHidden: !hasResource,
84
+ }),
85
+ }),
86
+ ];
87
+ }
88
+ //# sourceMappingURL=projected-document-action-runtime-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projected-document-action-runtime-bindings.js","sourceRoot":"","sources":["../src/projected-document-action-runtime-bindings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,sCAAsC,GACvC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,yBAAyB,GAC1B,MAAM,oCAAoC,CAAA;AAK3C,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,yCAAyC,CAAA;AAgBhD;;;;GAIG;AACH,MAAM,UAAU,oCAAoC,CAGlD,EACA,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,OAAO,GAGR;IACC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;QACjD,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;QAC5B,QAAQ,EAAE,aAAa,EAAE,IAAI,IAAK,QAAmB;KACtD,CAAC,CAAA;IACF,MA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AC;gBACd,OAAO,EAAE,OAAO,CAAC,gBAAgB;gBACjC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS;gBAClC,QAAQ,EAAE,CAAC,OAAO,CAAC,gBAAgB;aACpC,CAAC;SACH,CAAC;QACF,sCAAsC,CAA0B;YAC9D,qBAAqB,EAAE,4BAA4B,CAAC,UAAU;YAC9D,EAAE,EAAE,oBAAoB;YACxB,aAAa,EAAE,oBAAoB,CAAC,iBAAiB;YACrD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;gBACd,OAAO,EAAE,OAAO,CAAC,eAAe;gBAChC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS;gBAClC,QAAQ,EAAE,CAAC,OAAO,CAAC,gBAAgB;aACpC,CAAC;SACH,CAAC;QACF,sCAAsC,CAA0B;YAC9D,EAAE,EAAE,qBAAqB;YACzB,uBAAuB,EAAE,8BAA8B,CAAC,KAAK;YAC7D,aAAa,EAAE,oBAAoB,CAAC,mBAAmB;YACvD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;gBACd,OAAO,EAAE,aAAa,IAAI,OAAO,CAAC,aAAa;gBAC/C,QAAQ,EAAE,CAAC,WAAW;aACvB,CAAC;SACH,CAAC;QACF,sCAAsC,CAA0B;YAC9D,EAAE,EAAE,sBAAsB;YAC1B,uBAAuB,EAAE,8BAA8B,CAAC,MAAM;YAC9D,aAAa,EAAE,oBAAoB,CAAC,mBAAmB;YACvD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;gBACd,OAAO,EAAE,cAAc,IAAI,OAAO,CAAC,cAAc;gBACjD,UAAU,EAAE,CAAC,cAAc,CAAC,EAAE;gBAC9B,QAAQ,EAAE,CAAC,WAAW;aACvB,CAAC;SACH,CAAC;KACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,76 @@
1
+ import type { ProjectedDocumentResource } from '@cohesivesystems/presentation-core';
2
+ import type { ActionDefinition, ActionPlacementDefinition, FlowDefinition, PresentationModuleDefinition, ViewDefinition } from '@cohesivesystems/presentation-core';
3
+ import type { PresentationActionEndpointExecutor, PresentationActionSuccessContext } from './presentation-action-runtime.js';
4
+ import { type PresentationFlowRuntimeRegistrySnapshot, type PresentationFlowRuntimeSnapshot } from './presentation-flow-runtime.js';
5
+ import { type PresentationProjectionDiagnostic } from '@cohesivesystems/presentation-core';
6
+ export interface ProjectedDocumentJsonValidationState {
7
+ readonly ok: boolean;
8
+ readonly value?: unknown;
9
+ }
10
+ export interface UseProjectedDocumentActionRuntimeOptions<TResource extends ProjectedDocumentResource = ProjectedDocumentResource> {
11
+ readonly actionPlacements: readonly ActionPlacementDefinition[];
12
+ readonly additionalDiagnosticActionPlacements?: readonly ActionPlacementDefinition[];
13
+ readonly dataSourceId: string;
14
+ readonly dataSourceQueryKey?: (dataSourceId: string) => readonly unknown[];
15
+ readonly executeEndpoint: PresentationActionEndpointExecutor;
16
+ readonly formatDocument?: (value: unknown) => string;
17
+ readonly jsonValidation: ProjectedDocumentJsonValidationState;
18
+ readonly module: PresentationModuleDefinition | null;
19
+ readonly onResetEditorState: () => void;
20
+ readonly onSetEditorText: (text: string) => void;
21
+ readonly resource: TResource | undefined;
22
+ readonly resourceId: string;
23
+ readonly resourceKey: string | null;
24
+ readonly setSaveResultQueryData?: (context: PresentationActionSuccessContext<void, TResource>) => void;
25
+ }
26
+ export interface ProjectedDocumentActionRuntime {
27
+ readonly actions: {
28
+ readonly formatDocument: ActionDefinition | null;
29
+ readonly resetDocument: ActionDefinition | null;
30
+ readonly save: ActionDefinition | null;
31
+ readonly saveCommit: ActionDefinition | null;
32
+ readonly saveDismiss: ActionDefinition | null;
33
+ readonly saveRevert: ActionDefinition | null;
34
+ };
35
+ readonly actionIds: {
36
+ readonly formatDocument: string;
37
+ readonly resetDocument: string;
38
+ readonly save: string;
39
+ readonly saveCommit: string;
40
+ readonly saveDismiss: string;
41
+ readonly saveRevert: string;
42
+ };
43
+ readonly acceptSaveReview: () => void;
44
+ readonly cancelSaveReview: () => void;
45
+ readonly diagnosticActionPlacements: readonly ActionPlacementDefinition[];
46
+ readonly diagnostics: readonly PresentationProjectionDiagnostic[];
47
+ readonly flowRegistry: PresentationFlowRuntimeRegistrySnapshot;
48
+ readonly formatDocument: () => void;
49
+ readonly isSaveReviewOpen: boolean;
50
+ readonly promptView: ViewDefinition | null;
51
+ readonly resetDocument: () => void;
52
+ readonly resetSaveReview: () => void;
53
+ readonly resetTransientState: () => void;
54
+ readonly requestSaveReview: () => void;
55
+ readonly save: {
56
+ readonly action: ActionDefinition | null;
57
+ readonly endpointId: string | null;
58
+ readonly error: unknown;
59
+ readonly isPending: boolean;
60
+ readonly reset: () => void;
61
+ };
62
+ readonly saveFlow: FlowDefinition | null;
63
+ readonly saveFlowId: string;
64
+ readonly saveFlowRuntime: PresentationFlowRuntimeSnapshot;
65
+ }
66
+ /**
67
+ * Generic runtime for document-local actions declared in the presentation IR.
68
+ *
69
+ * It owns save review flow mechanics and local editor actions, while callers
70
+ * still supply endpoint execution, action rendering, and product-specific
71
+ * extension actions.
72
+ */
73
+ export declare function useProjectedDocumentActionRuntime<TResource extends ProjectedDocumentResource = ProjectedDocumentResource>({ actionPlacements, additionalDiagnosticActionPlacements, dataSourceId, dataSourceQueryKey, executeEndpoint, formatDocument: formatDocumentValue, jsonValidation, module, onResetEditorState, onSetEditorText, resource, resourceId, resourceKey, setSaveResultQueryData, }: UseProjectedDocumentActionRuntimeOptions<TResource>): ProjectedDocumentActionRuntime;
74
+ export declare function mergeActionPlacements(...groups: readonly (readonly ActionPlacementDefinition[])[]): ActionPlacementDefinition[];
75
+ export declare function optionalActionId(action: Pick<ActionDefinition, 'Id'> | null | undefined, fallback: string): string;
76
+ //# sourceMappingURL=projected-document-action-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projected-document-action-runtime.d.ts","sourceRoot":"","sources":["../src/projected-document-action-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EAC1B,MAAM,o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M,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,EACvD,QAAQ,EAAE,MAAM,UAGjB"}
@@ -0,0 +1,224 @@
1
+ import { useMemo } from 'react';
2
+ import { findPresentationFlow, findPresentationView, } from '@cohesivesystems/presentation-core';
3
+ import { getPresentationViewProjectedActionPlacements, } from '@cohesivesystems/presentation-core';
4
+ import { usePresentationActionExecutor, } from './presentation-action-runtime.js';
5
+ import { projectRequiredPresentationActionEndpointRequest, } from '@cohesivesystems/presentation-core';
6
+ import { advancePresentationFlowToStateKind, findPresentationFlowErrorSurfaceState, findPresentationFlowSurfaceState, isPresentationFlowSurfaceOpenForData, resolvePresentationActionPreparedFlow, usePresentationFlowRuntimeRegistry, } from './presentation-flow-runtime.js';
7
+ import {} from '@cohesivesystems/presentation-core';
8
+ import { findDocumentSaveAction, findLocalDocumentEditorAction, findPromptCommitAction, findPromptDismissAction, findPromptLocalAction, } from '@cohesivesystems/presentation-core';
9
+ import { projectLocalDocumentEditorActionBindingDiagnostics, } from '@cohesivesystems/presentation-core';
10
+ import { flowStateKinds } from '@cohesivesystems/presentation-contracts';
11
+ /**
12
+ * Generic runtime for document-local actions declared in the presentation IR.
13
+ *
14
+ * It owns save review flow mechanics and local editor actions, while callers
15
+ * still supply endpoint execution, action rendering, and product-specific
16
+ * extension actions.
17
+ */
18
+ export function useProjectedDocumentActionRuntime({ actionPlacements, additionalDiagnosticActionPlacements = emptyActionPlacements, dataSourceId, dataSourceQueryKey, executeEndpoint, formatDocument: formatDocumentValue = formatJsonDocumentValue, jsonValidation, module, onResetEditorState, onSetEditorText, resource, resourceId, resourceKey, setSaveResultQueryData, }) {
19
+ const flowRegistry = usePresentationFlowRuntimeRegistry({ module });
20
+ const saveAction = useMemo(() => findDocumentSaveAction({
21
+ actionPlacements,
22
+ dataSourceId,
23
+ module,
24
+ }), [actionPlacements, dataSourceId, module]);
25
+ const saveActionFlow = useMemo(() => resolvePresentationActionPreparedFlow(saveAction), [saveAction]);
26
+ const saveFlowId = saveActionFlow?.flowId ?? '';
27
+ const saveFlow = useMemo(() => findPresentationFlow(module, saveFlowId), [module, saveFlowId]);
28
+ const savePromptView = useMemo(() => {
29
+ const promptViewId = saveActionFlow?.promptViewId ??
30
+ findPresentationFlowSurfaceState(saveFlow)?.ViewId;
31
+ return promptViewId
32
+ ? findPresentationView(module, promptViewId)
33
+ : null;
34
+ }, [module, saveActionFlow?.promptViewId, saveFlow]);
35
+ const saveCommitAction = useMemo(() => findPromptCommitAction({ module, view: savePromptView }), [module, savePromptView]);
36
+ const saveDismissAction = useMemo(() => findPromptDismissAction({ module, view: savePromptView }), [module, savePromptView]);
37
+ const saveRevertAction = useMemo(() => findPromptLocalAction({ intent: 'revert', module, view: savePromptView }), [module, savePromptView]);
38
+ const resetDocumentAction = useMemo(() => findLocalDocumentEditorAction({ actionPlacements, intent: 'reset', module }), [actionPlacements, module]);
39
+ const formatDocumentAction = useMemo(() => findLocalDocumentEditorAction({ actionPlacements, intent: 'format', module }), [actionPlacements, module]);
40
+ const diagnosticActionPlacements = useMemo(() => mergeActionPlacements(actionPlacements, getPresentationViewProjectedActionPlacements(savePromptView), additionalDiagnosticActionPlacements), [actionPlacements, additionalDiagnosticActionPlacements, savePromptView]);
41
+ const diagnostics = useMemo(() => projectLocalDocumentEditorActionBindingDiagnostics({
42
+ actionPlacements: diagnosticActionPlacements,
43
+ module,
44
+ supportedIntents: supportedLocalDocumentEditorActionIntents,
45
+ }), [diagnosticActionPlacements, module]);
46
+ const saveFlowRuntime = flowRegistry.getRuntime(saveFlowId);
47
+ const isSaveReviewOpen = isPresentationFlowSurfaceOpenForData({
48
+ dataKey: 'resourceKey',
49
+ dataValue: resourceKey,
50
+ flowId: saveFlowId,
51
+ runtime: saveFlowRuntime,
52
+ });
53
+ const saveActionId = optionalActionId(saveAction, 'document-save');
54
+ const saveCommitActionId = optionalActionId(saveCommitAction, 'save-commit');
55
+ const saveDismissActionId = optionalActionId(saveDismissAction, 'save-dismiss');
56
+ const saveRevertActionId = optionalActionId(saveRevertAction, 'save-revert');
57
+ const resetDocumentActionId = optionalActionId(resetDocumentAction, 'document-reset');
58
+ const formatDocumentActionId = optionalActionId(formatDocumentAction, 'document-format');
59
+ const save = usePresentationActionExecutor({
60
+ actionId: saveActionId,
61
+ dataSourceId,
62
+ dataSourceQueryKey,
63
+ executeEndpoint,
64
+ module,
65
+ prepareRequest: ({ action, endpointId }) => {
66
+ if (!resource) {
67
+ throw new Error('A loaded resource is required before saving.');
68
+ }
69
+ if (!jsonValidation.ok) {
70
+ throw new Error('Valid JSON is required before saving.');
71
+ }
72
+ return projectRequiredPresentationActionEndpointRequest({
73
+ action,
74
+ actionId: saveActionId,
75
+ dataSourceId,
76
+ endpointId,
77
+ sources: {
78
+ document: { value: jsonValidation.value },
79
+ resource,
80
+ route: { id: resourceId },
81
+ },
82
+ });
83
+ },
84
+ setResultQueryData: setSaveResultQueryData,
85
+ });
86
+ function resetTransientState() {
87
+ save.reset();
88
+ saveFlowRuntime.clearFlow();
89
+ }
90
+ function resetDocument() {
91
+ resetTransientState();
92
+ onResetEditorState();
93
+ }
94
+ function formatDocument() {
95
+ if (jsonValidation.ok && resourceKey) {
96
+ resetTransientState();
97
+ onSetEditorText(formatDocumentValue(jsonValidation.value));
98
+ }
99
+ }
100
+ function requestSaveReview() {
101
+ if (!resource || !resourceKey || !jsonValidation.ok || !save.endpointId || save.isPending) {
102
+ return;
103
+ }
104
+ save.reset();
105
+ const started = saveFlowRuntime.startFlow({
106
+ actionId: saveActionId,
107
+ data: { resourceKey },
108
+ flowId: saveFlowId,
109
+ });
110
+ if (!started) {
111
+ const surfaceState = findPresentationFlowSurfaceState(saveFlow);
112
+ saveFlowRuntime.startFlow({
113
+ data: { resourceKey },
114
+ flowId: saveFlowId,
115
+ stateId: surfaceState?.Id,
116
+ });
117
+ }
118
+ }
119
+ function acceptSaveReview() {
120
+ if (!resource || !jsonValidation.ok || save.isPending) {
121
+ return;
122
+ }
123
+ saveFlowRuntime.dispatchAction(saveCommitActionId);
124
+ void save.executeAsync(undefined)
125
+ .then(() => {
126
+ onResetEditorState();
127
+ advancePresentationFlowToStateKind({
128
+ flow: saveFlow,
129
+ runtime: saveFlowRuntime,
130
+ stateKinds: [flowStateKinds.terminal],
131
+ });
132
+ saveFlowRuntime.clearFlow();
133
+ })
134
+ .catch(() => {
135
+ const failed = advancePresentationFlowToStateKind({
136
+ flow: saveFlow,
137
+ runtime: saveFlowRuntime,
138
+ stateKinds: [flowStateKinds.error],
139
+ });
140
+ if (!failed) {
141
+ const errorState = findPresentationFlowErrorSurfaceState(saveFlow);
142
+ if (errorState) {
143
+ saveFlowRuntime.transitionTo(errorState.Id, { flowId: saveFlowId });
144
+ }
145
+ }
146
+ });
147
+ }
148
+ function cancelSaveReview() {
149
+ save.reset();
150
+ if (!saveFlowRuntime.dispatchAction(saveDismissActionId)) {
151
+ saveFlowRuntime.clearFlow();
152
+ return;
153
+ }
154
+ saveFlowRuntime.clearFlow();
155
+ }
156
+ function resetSaveReview() {
157
+ save.reset();
158
+ if (!saveFlowRuntime.dispatchAction(saveRevertActionId)) {
159
+ saveFlowRuntime.clearFlow();
160
+ }
161
+ saveFlowRuntime.clearFlow();
162
+ onResetEditorState();
163
+ }
164
+ return {
165
+ actions: {
166
+ formatDocument: formatDocumentAction,
167
+ resetDocument: resetDocumentAction,
168
+ save: save.action,
169
+ saveCommit: saveCommitAction,
170
+ saveDismiss: saveDismissAction,
171
+ saveRevert: saveRevertAction,
172
+ },
173
+ actionIds: {
174
+ formatDocument: formatDocumentActionId,
175
+ resetDocument: resetDocumentActionId,
176
+ save: saveActionId,
177
+ saveCommit: saveCommitActionId,
178
+ saveDismiss: saveDismissActionId,
179
+ saveRevert: saveRevertActionId,
180
+ },
181
+ acceptSaveReview,
182
+ cancelSaveReview,
183
+ diagnosticActionPlacements,
184
+ diagnostics,
185
+ flowRegistry,
186
+ formatDocument,
187
+ isSaveReviewOpen,
188
+ promptView: savePromptView,
189
+ resetDocument,
190
+ resetSaveReview,
191
+ resetTransientState,
192
+ requestSaveReview,
193
+ save: {
194
+ action: save.action,
195
+ endpointId: save.endpointId,
196
+ error: save.error,
197
+ isPending: save.isPending,
198
+ reset: save.reset,
199
+ },
200
+ saveFlow,
201
+ saveFlowId,
202
+ saveFlowRuntime,
203
+ };
204
+ }
205
+ const supportedLocalDocumentEditorActionIntents = ['reset', 'format'];
206
+ const emptyActionPlacements = [];
207
+ export function mergeActionPlacements(...groups) {
208
+ const seen = new Set();
209
+ return groups.flatMap((group) => group.filter((placement) => {
210
+ const key = `${placement.Region}:${placement.ActionId}`;
211
+ if (seen.has(key)) {
212
+ return false;
213
+ }
214
+ seen.add(key);
215
+ return true;
216
+ }));
217
+ }
218
+ export function optionalActionId(action, fallback) {
219
+ return action?.Id ?? `missing:${fallback}`;
220
+ }
221
+ function formatJsonDocumentValue(value) {
222
+ return JSON.stringify(value ?? null, null, 2);
223
+ }
224
+ //# sourceMappingURL=projected-document-action-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projected-document-action-runtime.js","sourceRoot":"","sources":["../src/projected-document-action-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAY/B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,4CAA4C,GAC7C,MAAM,oCAAoC,CAAA;AAK3C,OAAO,EACL,6BAA6B,GAC9B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,gDAAgD,GACjD,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,kCAAkC,EAClC,qCAAqC,EACrC,gCAAgC,EAChC,oCAAoC,EACpC,qCAAqC,EACrC,kCAAkC,GAGnC,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAEN,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB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ACnC,GAAG,MAAyD;IAE5D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9B,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QACzB,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAA;QACvD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACb,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,MAAuD,EACvD,QAAgB;IAEhB,OAAO,MAAM,EAAE,EAAE,IAAI,WAAW,QAAQ,EAAE,CAAA;AAC5C,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC/C,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { PresentationActionRuntimeBinding } from '@cohesivesystems/presentation-core';
2
+ import type { ProjectedActionStatusSource } from '@cohesivesystems/presentation-core';
3
+ import type { ProjectedDocumentProcessPreviewActionRuntime } from './projected-document-process-preview-action-runtime.js';
4
+ import type { ProjectedPromptDocumentPreviewResource } from '@cohesivesystems/presentation-core';
5
+ export interface ProjectDocumentProcessPreviewActionRuntimeBindingsOptions<TLabel = string, TPreviewRequest extends object = object, TPreviewResponse = unknown, TPreviewValues extends Readonly<Record<string, unknown>> = Readonly<Record<string, never>>, TPreviewResource extends ProjectedPromptDocumentPreviewResource = ProjectedPromptDocumentPreviewResource> {
6
+ readonly hasResource: boolean;
7
+ readonly isActionAvailable: boolean;
8
+ readonly isPreviewBlocked?: boolean;
9
+ readonly pendingLabels?: {
10
+ readonly preview?: TLabel;
11
+ readonly start?: TLabel | ((runtime: ProjectedDocumentProcessPreviewActionRuntime<TPreviewRequest, TPreviewResponse, TPreviewValues, TPreviewResource>) => TLabel);
12
+ };
13
+ readonly runtime: ProjectedDocumentProcessPreviewActionRuntime<TPreviewRequest, TPreviewResponse, TPreviewValues, TPreviewResource>;
14
+ }
15
+ /**
16
+ * Projects document process-preview runtime state into adapter-neutral action
17
+ * bindings. Product code can still provide presentation labels and additional
18
+ * blocking policy while the runtime owns the IR flow mechanics.
19
+ */
20
+ export declare function projectDocumentProcessPreviewActionRuntimeBindings<TExecuteContext = unknown, TLabel = string, TPreviewRequest extends object = object, TPreviewResponse = unknown, TPreviewValues extends Readonly<Record<string, unknown>> = Readonly<Record<string, never>>, TPreviewResource extends ProjectedPromptDocumentPreviewResource = ProjectedPromptDocumentPreviewResource>({ hasResource, isActionAvailable, isPreviewBlocked, pendingLabels, runtime, }: ProjectDocumentProcessPreviewActionRuntimeBindingsOptions<TLabel, TPreviewRequest, TPreviewResponse, TPreviewValues, TPreviewResource>): readonly PresentationActionRuntimeBinding<TExecuteContext, TLabel>[];
21
+ /**
22
+ * Projects a document process-preview runtime into action status sources used
23
+ * by document-profile action status notices.
24
+ */
25
+ export declare function projectDocumentProcessPreviewActionStatusSources<TPreviewRequest extends object, TPreviewResponse, TPreviewValues extends Readonly<Record<string, unknown>>, TPreviewResource extends ProjectedPromptDocumentPreviewResource>(runtime: ProjectedDocumentProcessPreviewActionRuntime<TPreviewRequest, TPreviewResponse, TPreviewValues, TPreviewResource>): readonly ProjectedActionStatusSource[];
26
+ //# sourceMappingURL=projected-document-process-preview-action-runtime-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projected-document-process-preview-action-runtime-bindings.d.ts","sourceRoot":"","sources":["../src/projected-document-process-preview-action-runtime-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EACjC,MAAM,oCAAo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