@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.
- package/LICENSE +55 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts +12 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.js +12 -0
- package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
- package/dist/collection-selection-state-context.d.ts +6 -0
- package/dist/collection-selection-state-context.d.ts.map +1 -0
- package/dist/collection-selection-state-context.js +25 -0
- package/dist/collection-selection-state-context.js.map +1 -0
- package/dist/collection-selection-state.d.ts +3 -0
- package/dist/collection-selection-state.d.ts.map +1 -0
- package/dist/collection-selection-state.js +52 -0
- package/dist/collection-selection-state.js.map +1 -0
- package/dist/document-workspace-runtime.d.ts +262 -0
- package/dist/document-workspace-runtime.d.ts.map +1 -0
- package/dist/document-workspace-runtime.js +699 -0
- package/dist/document-workspace-runtime.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/input-form-endpoint-runtime.d.ts +140 -0
- package/dist/input-form-endpoint-runtime.d.ts.map +1 -0
- package/dist/input-form-endpoint-runtime.js +280 -0
- package/dist/input-form-endpoint-runtime.js.map +1 -0
- package/dist/local-flow-state-data-source-projection.d.ts +21 -0
- package/dist/local-flow-state-data-source-projection.d.ts.map +1 -0
- package/dist/local-flow-state-data-source-projection.js +65 -0
- package/dist/local-flow-state-data-source-projection.js.map +1 -0
- package/dist/navigation-runtime-context.d.ts +22 -0
- package/dist/navigation-runtime-context.d.ts.map +1 -0
- package/dist/navigation-runtime-context.js +23 -0
- package/dist/navigation-runtime-context.js.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts +20 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.js +9 -0
- package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
- package/dist/navigation-shell-region-component-registry.d.ts +50 -0
- package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
- package/dist/navigation-shell-region-component-registry.js +44 -0
- package/dist/navigation-shell-region-component-registry.js.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts +22 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.js +9 -0
- package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
- package/dist/page-host-projection.d.ts +127 -0
- package/dist/page-host-projection.d.ts.map +1 -0
- package/dist/page-host-projection.js +59 -0
- package/dist/page-host-projection.js.map +1 -0
- package/dist/page-host-renderer-registry.d.ts +72 -0
- package/dist/page-host-renderer-registry.d.ts.map +1 -0
- package/dist/page-host-renderer-registry.js +63 -0
- package/dist/page-host-renderer-registry.js.map +1 -0
- package/dist/presentation-action-group-runtime-options.d.ts +36 -0
- package/dist/presentation-action-group-runtime-options.d.ts.map +1 -0
- package/dist/presentation-action-group-runtime-options.js +50 -0
- package/dist/presentation-action-group-runtime-options.js.map +1 -0
- package/dist/presentation-action-runtime.d.ts +52 -0
- package/dist/presentation-action-runtime.d.ts.map +1 -0
- package/dist/presentation-action-runtime.js +78 -0
- package/dist/presentation-action-runtime.js.map +1 -0
- package/dist/presentation-data-source-binding-runtime.d.ts +3 -0
- package/dist/presentation-data-source-binding-runtime.d.ts.map +1 -0
- package/dist/presentation-data-source-binding-runtime.js +65 -0
- package/dist/presentation-data-source-binding-runtime.js.map +1 -0
- package/dist/presentation-data-source-binding.d.ts +12 -0
- package/dist/presentation-data-source-binding.d.ts.map +1 -0
- package/dist/presentation-data-source-binding.js +13 -0
- package/dist/presentation-data-source-binding.js.map +1 -0
- package/dist/presentation-flow-runtime.d.ts +139 -0
- package/dist/presentation-flow-runtime.d.ts.map +1 -0
- package/dist/presentation-flow-runtime.js +514 -0
- package/dist/presentation-flow-runtime.js.map +1 -0
- package/dist/presentation-module-context.d.ts +4 -0
- package/dist/presentation-module-context.d.ts.map +1 -0
- package/dist/presentation-module-context.js +6 -0
- package/dist/presentation-module-context.js.map +1 -0
- package/dist/presentation-module-provider.d.ts +7 -0
- package/dist/presentation-module-provider.d.ts.map +1 -0
- package/dist/presentation-module-provider.js +7 -0
- package/dist/presentation-module-provider.js.map +1 -0
- package/dist/presentation-projection-diagnostics-context.d.ts +8 -0
- package/dist/presentation-projection-diagnostics-context.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics-context.js +3 -0
- package/dist/presentation-projection-diagnostics-context.js.map +1 -0
- package/dist/presentation-projection-diagnostics-hooks.d.ts +4 -0
- package/dist/presentation-projection-diagnostics-hooks.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics-hooks.js +17 -0
- package/dist/presentation-projection-diagnostics-hooks.js.map +1 -0
- package/dist/presentation-projection-diagnostics-runtime.d.ts +12 -0
- package/dist/presentation-projection-diagnostics-runtime.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics-runtime.js +54 -0
- package/dist/presentation-projection-diagnostics-runtime.js.map +1 -0
- package/dist/presentation-projection-trace.d.ts +27 -0
- package/dist/presentation-projection-trace.d.ts.map +1 -0
- package/dist/presentation-projection-trace.js +54 -0
- package/dist/presentation-projection-trace.js.map +1 -0
- package/dist/presentation-query-form-runtime.d.ts +30 -0
- package/dist/presentation-query-form-runtime.d.ts.map +1 -0
- package/dist/presentation-query-form-runtime.js +75 -0
- package/dist/presentation-query-form-runtime.js.map +1 -0
- package/dist/presentation-query-form-state-adapter-registry.d.ts +4 -0
- package/dist/presentation-query-form-state-adapter-registry.d.ts.map +1 -0
- package/dist/presentation-query-form-state-adapter-registry.js +13 -0
- package/dist/presentation-query-form-state-adapter-registry.js.map +1 -0
- package/dist/presentation-query-form-state-context.d.ts +20 -0
- package/dist/presentation-query-form-state-context.d.ts.map +1 -0
- package/dist/presentation-query-form-state-context.js +20 -0
- package/dist/presentation-query-form-state-context.js.map +1 -0
- package/dist/presentation-query-form-state.d.ts +29 -0
- package/dist/presentation-query-form-state.d.ts.map +1 -0
- package/dist/presentation-query-form-state.js +99 -0
- package/dist/presentation-query-form-state.js.map +1 -0
- package/dist/presentation-renderer-registry.d.ts +109 -0
- package/dist/presentation-renderer-registry.d.ts.map +1 -0
- package/dist/presentation-renderer-registry.js +25 -0
- package/dist/presentation-renderer-registry.js.map +1 -0
- package/dist/presentation-standards-context.d.ts +4 -0
- package/dist/presentation-standards-context.d.ts.map +1 -0
- package/dist/presentation-standards-context.js +12 -0
- package/dist/presentation-standards-context.js.map +1 -0
- package/dist/presentation-standards-provider.d.ts +14 -0
- package/dist/presentation-standards-provider.d.ts.map +1 -0
- package/dist/presentation-standards-provider.js +16 -0
- package/dist/presentation-standards-provider.js.map +1 -0
- package/dist/projected-document-action-runtime-bindings.d.ts +20 -0
- package/dist/projected-document-action-runtime-bindings.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-bindings.js +88 -0
- package/dist/projected-document-action-runtime-bindings.js.map +1 -0
- package/dist/projected-document-action-runtime.d.ts +76 -0
- package/dist/projected-document-action-runtime.d.ts.map +1 -0
- package/dist/projected-document-action-runtime.js +224 -0
- package/dist/projected-document-action-runtime.js.map +1 -0
- package/dist/projected-document-process-preview-action-runtime-bindings.d.ts +26 -0
- package/dist/projected-document-process-preview-action-runtime-bindings.d.ts.map +1 -0
- package/dist/projected-document-process-preview-action-runtime-bindings.js +106 -0
- package/dist/projected-document-process-preview-action-runtime-bindings.js.map +1 -0
- package/dist/projected-document-process-preview-action-runtime.d.ts +321 -0
- package/dist/projected-document-process-preview-action-runtime.d.ts.map +1 -0
- package/dist/projected-document-process-preview-action-runtime.js +729 -0
- package/dist/projected-document-process-preview-action-runtime.js.map +1 -0
- package/dist/projected-document-process-preview-capability-runtime.d.ts +47 -0
- package/dist/projected-document-process-preview-capability-runtime.d.ts.map +1 -0
- package/dist/projected-document-process-preview-capability-runtime.js +49 -0
- package/dist/projected-document-process-preview-capability-runtime.js.map +1 -0
- package/dist/projected-document-workspace-action-runtime.d.ts +87 -0
- package/dist/projected-document-workspace-action-runtime.d.ts.map +1 -0
- package/dist/projected-document-workspace-action-runtime.js +150 -0
- package/dist/projected-document-workspace-action-runtime.js.map +1 -0
- package/dist/projected-document-workspace-projection-renderer-diagnostics.d.ts +18 -0
- package/dist/projected-document-workspace-projection-renderer-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-workspace-projection-renderer-diagnostics.js +207 -0
- package/dist/projected-document-workspace-projection-renderer-diagnostics.js.map +1 -0
- package/dist/projected-document-workspace-runtime-binding-diagnostics.d.ts +19 -0
- package/dist/projected-document-workspace-runtime-binding-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-workspace-runtime-binding-diagnostics.js +124 -0
- package/dist/projected-document-workspace-runtime-binding-diagnostics.js.map +1 -0
- package/dist/projected-navigation-provider.d.ts +16 -0
- package/dist/projected-navigation-provider.d.ts.map +1 -0
- package/dist/projected-navigation-provider.js +51 -0
- package/dist/projected-navigation-provider.js.map +1 -0
- package/dist/projected-presentation-flow-host.d.ts +16 -0
- package/dist/projected-presentation-flow-host.d.ts.map +1 -0
- package/dist/projected-presentation-flow-host.js +14 -0
- package/dist/projected-presentation-flow-host.js.map +1 -0
- package/dist/projected-query-form-state-adapter.d.ts +12 -0
- package/dist/projected-query-form-state-adapter.d.ts.map +1 -0
- package/dist/projected-query-form-state-adapter.js +361 -0
- package/dist/projected-query-form-state-adapter.js.map +1 -0
- package/dist/react-router-binding.d.ts +133 -0
- package/dist/react-router-binding.d.ts.map +1 -0
- package/dist/react-router-binding.js +76 -0
- package/dist/react-router-binding.js.map +1 -0
- package/dist/react-router-path.d.ts +4 -0
- package/dist/react-router-path.d.ts.map +1 -0
- package/dist/react-router-path.js +11 -0
- package/dist/react-router-path.js.map +1 -0
- package/dist/scope-selection-context.d.ts +28 -0
- package/dist/scope-selection-context.d.ts.map +1 -0
- package/dist/scope-selection-context.js +13 -0
- package/dist/scope-selection-context.js.map +1 -0
- package/dist/scope-selection-provider.d.ts +33 -0
- package/dist/scope-selection-provider.d.ts.map +1 -0
- package/dist/scope-selection-provider.js +162 -0
- package/dist/scope-selection-provider.js.map +1 -0
- package/dist/scope-selection-request.d.ts +6 -0
- package/dist/scope-selection-request.d.ts.map +1 -0
- package/dist/scope-selection-request.js +12 -0
- package/dist/scope-selection-request.js.map +1 -0
- package/dist/standard-navigation-shell-frame-renderers.d.ts +15 -0
- package/dist/standard-navigation-shell-frame-renderers.d.ts.map +1 -0
- package/dist/standard-navigation-shell-frame-renderers.js +22 -0
- package/dist/standard-navigation-shell-frame-renderers.js.map +1 -0
- package/dist/standard-navigation-shell-slot-renderers.d.ts +59 -0
- package/dist/standard-navigation-shell-slot-renderers.d.ts.map +1 -0
- package/dist/standard-navigation-shell-slot-renderers.js +67 -0
- package/dist/standard-navigation-shell-slot-renderers.js.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts +12 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.js +12 -0
- package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
- package/package.json +60 -0
- package/src/collection-chrome-slot-renderer-registry.ts +66 -0
- package/src/collection-selection-state-context.ts +51 -0
- package/src/collection-selection-state.tsx +101 -0
- package/src/document-workspace-runtime.tsx +1505 -0
- package/src/index.ts +50 -0
- package/src/input-form-endpoint-runtime.ts +632 -0
- package/src/local-flow-state-data-source-projection.ts +133 -0
- package/src/navigation-runtime-context.ts +40 -0
- package/src/navigation-shell-frame-renderer-registry.ts +54 -0
- package/src/navigation-shell-region-component-registry.tsx +127 -0
- package/src/navigation-shell-slot-renderer-registry.ts +88 -0
- package/src/page-host-projection.ts +356 -0
- package/src/page-host-renderer-registry.tsx +353 -0
- package/src/presentation-action-group-runtime-options.ts +121 -0
- package/src/presentation-action-runtime.ts +190 -0
- package/src/presentation-data-source-binding-runtime.ts +109 -0
- package/src/presentation-data-source-binding.tsx +24 -0
- package/src/presentation-flow-runtime.tsx +835 -0
- package/src/presentation-module-context.ts +10 -0
- package/src/presentation-module-provider.tsx +19 -0
- package/src/presentation-projection-diagnostics-context.ts +17 -0
- package/src/presentation-projection-diagnostics-hooks.ts +29 -0
- package/src/presentation-projection-diagnostics-runtime.tsx +95 -0
- package/src/presentation-projection-trace.ts +117 -0
- package/src/presentation-query-form-runtime.ts +148 -0
- package/src/presentation-query-form-state-adapter-registry.ts +25 -0
- package/src/presentation-query-form-state-context.ts +56 -0
- package/src/presentation-query-form-state.tsx +250 -0
- package/src/presentation-renderer-registry.ts +214 -0
- package/src/presentation-standards-context.ts +21 -0
- package/src/presentation-standards-provider.tsx +44 -0
- package/src/projected-document-action-runtime-bindings.ts +132 -0
- package/src/projected-document-action-runtime.ts +414 -0
- package/src/projected-document-process-preview-action-runtime-bindings.ts +231 -0
- package/src/projected-document-process-preview-action-runtime.ts +1725 -0
- package/src/projected-document-process-preview-capability-runtime.ts +216 -0
- package/src/projected-document-workspace-action-runtime.ts +402 -0
- package/src/projected-document-workspace-projection-renderer-diagnostics.ts +342 -0
- package/src/projected-document-workspace-runtime-binding-diagnostics.ts +208 -0
- package/src/projected-navigation-provider.tsx +104 -0
- package/src/projected-presentation-flow-host.tsx +46 -0
- package/src/projected-query-form-state-adapter.ts +578 -0
- package/src/react-router-binding.tsx +417 -0
- package/src/react-router-path.ts +16 -0
- package/src/scope-selection-context.ts +58 -0
- package/src/scope-selection-provider.tsx +324 -0
- package/src/scope-selection-request.ts +21 -0
- package/src/standard-navigation-shell-frame-renderers.tsx +106 -0
- package/src/standard-navigation-shell-slot-renderers.tsx +289 -0
- package/src/view-chrome-slot-renderer-registry.ts +66 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ProjectedDocumentResource,
|
|
3
|
+
} from '@cohesivesystems/presentation-core'
|
|
4
|
+
import type {
|
|
5
|
+
PresentationActionRuntimeBinding,
|
|
6
|
+
} from '@cohesivesystems/presentation-core'
|
|
7
|
+
import type {
|
|
8
|
+
ProjectedActionStatusSource,
|
|
9
|
+
} from '@cohesivesystems/presentation-core'
|
|
10
|
+
import {
|
|
11
|
+
useProjectedDocumentProcessPreviewActionRuntime,
|
|
12
|
+
type ProjectedDocumentProcessPreviewActionRuntime,
|
|
13
|
+
type ProjectedDocumentProcessPreviewState,
|
|
14
|
+
type UseProjectedDocumentProcessPreviewActionRuntimeOptions,
|
|
15
|
+
} from './projected-document-process-preview-action-runtime'
|
|
16
|
+
import {
|
|
17
|
+
projectDocumentProcessPreviewActionRuntimeBindings,
|
|
18
|
+
projectDocumentProcessPreviewActionStatusSources,
|
|
19
|
+
type ProjectDocumentProcessPreviewActionRuntimeBindingsOptions,
|
|
20
|
+
} from './projected-document-process-preview-action-runtime-bindings'
|
|
21
|
+
import type {
|
|
22
|
+
ProjectedInputFormRuntime,
|
|
23
|
+
} from '@cohesivesystems/presentation-core'
|
|
24
|
+
import type {
|
|
25
|
+
PresentationProjectionDiagnostic,
|
|
26
|
+
} from '@cohesivesystems/presentation-core'
|
|
27
|
+
import type {
|
|
28
|
+
ProjectedPromptDocumentPreviewResource,
|
|
29
|
+
} from '@cohesivesystems/presentation-core'
|
|
30
|
+
|
|
31
|
+
export type ProjectedDocumentProcessPreviewCapabilityState<
|
|
32
|
+
TPreviewResponse = unknown,
|
|
33
|
+
TPreviewRequest extends object = object,
|
|
34
|
+
TPreviewValues extends Readonly<Record<string, unknown>> =
|
|
35
|
+
Readonly<Record<string, never>>,
|
|
36
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource =
|
|
37
|
+
ProjectedPromptDocumentPreviewResource,
|
|
38
|
+
> = ProjectedDocumentProcessPreviewState<
|
|
39
|
+
TPreviewResponse,
|
|
40
|
+
TPreviewRequest,
|
|
41
|
+
TPreviewValues,
|
|
42
|
+
TPreviewResource
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
export interface UseProjectedDocumentProcessPreviewCapabilityRuntimeOptions<
|
|
46
|
+
TPreviewRequest extends object,
|
|
47
|
+
TPreviewResponse,
|
|
48
|
+
TStartInput,
|
|
49
|
+
TStartResult,
|
|
50
|
+
TLabel = string,
|
|
51
|
+
TPreviewValues extends Readonly<Record<string, unknown>> =
|
|
52
|
+
Readonly<Record<string, never>>,
|
|
53
|
+
TResource extends ProjectedDocumentResource = ProjectedDocumentResource,
|
|
54
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource =
|
|
55
|
+
ProjectedPromptDocumentPreviewResource,
|
|
56
|
+
> extends UseProjectedDocumentProcessPreviewActionRuntimeOptions<
|
|
57
|
+
TPreviewRequest,
|
|
58
|
+
TPreviewResponse,
|
|
59
|
+
TStartInput,
|
|
60
|
+
TStartResult,
|
|
61
|
+
TPreviewValues,
|
|
62
|
+
TResource,
|
|
63
|
+
TPreviewResource
|
|
64
|
+
> {
|
|
65
|
+
readonly hasResource: boolean
|
|
66
|
+
readonly pendingLabels?: ProjectDocumentProcessPreviewActionRuntimeBindingsOptions<
|
|
67
|
+
TLabel,
|
|
68
|
+
TPreviewRequest,
|
|
69
|
+
TPreviewResponse,
|
|
70
|
+
TPreviewValues,
|
|
71
|
+
TPreviewResource
|
|
72
|
+
>['pendingLabels']
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ProjectedDocumentProcessPreviewCapabilityRuntime<
|
|
76
|
+
TExecuteContext,
|
|
77
|
+
TLabel,
|
|
78
|
+
TPreviewRequest extends object,
|
|
79
|
+
TPreviewResponse,
|
|
80
|
+
TPreviewValues extends Readonly<Record<string, unknown>>,
|
|
81
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource,
|
|
82
|
+
> {
|
|
83
|
+
readonly actionBindings: readonly PresentationActionRuntimeBinding<TExecuteContext, TLabel>[]
|
|
84
|
+
readonly actionRuntime: ProjectedDocumentProcessPreviewActionRuntime<
|
|
85
|
+
TPreviewRequest,
|
|
86
|
+
TPreviewResponse,
|
|
87
|
+
TPreviewValues,
|
|
88
|
+
TPreviewResource
|
|
89
|
+
>
|
|
90
|
+
readonly actionStatuses: readonly ProjectedActionStatusSource[]
|
|
91
|
+
readonly activePreview: ProjectedDocumentProcessPreviewState<
|
|
92
|
+
TPreviewResponse,
|
|
93
|
+
TPreviewRequest,
|
|
94
|
+
TPreviewValues,
|
|
95
|
+
TPreviewResource
|
|
96
|
+
> | null
|
|
97
|
+
readonly cancelPreview: () => void
|
|
98
|
+
readonly cancelPrompt: () => void
|
|
99
|
+
readonly diagnosticActionPlacements: ProjectedDocumentProcessPreviewActionRuntime<
|
|
100
|
+
TPreviewRequest,
|
|
101
|
+
TPreviewResponse,
|
|
102
|
+
TPreviewValues,
|
|
103
|
+
TPreviewResource
|
|
104
|
+
>['diagnosticActionPlacements']
|
|
105
|
+
readonly diagnostics: readonly PresentationProjectionDiagnostic[]
|
|
106
|
+
readonly input: {
|
|
107
|
+
readonly runtime: ProjectedInputFormRuntime<TPreviewRequest> | null
|
|
108
|
+
}
|
|
109
|
+
readonly preview: {
|
|
110
|
+
readonly error: unknown
|
|
111
|
+
readonly isPending: boolean
|
|
112
|
+
}
|
|
113
|
+
readonly reset: () => void
|
|
114
|
+
readonly start: {
|
|
115
|
+
readonly error: unknown
|
|
116
|
+
readonly isPending: boolean
|
|
117
|
+
}
|
|
118
|
+
readonly startPreview: () => void
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Projects a document-scoped process-preview action into the full runtime
|
|
123
|
+
* surface expected by document workspace hosts.
|
|
124
|
+
*
|
|
125
|
+
* The lower-level action runtime owns flow state and endpoint execution; this
|
|
126
|
+
* capability wrapper adds action bindings and status sources so product hosts
|
|
127
|
+
* can consume any IR-declared process-preview action without writing a
|
|
128
|
+
* per-process capability wrapper.
|
|
129
|
+
*/
|
|
130
|
+
export function useProjectedDocumentProcessPreviewCapabilityRuntime<
|
|
131
|
+
TPreviewRequest extends object,
|
|
132
|
+
TPreviewResponse,
|
|
133
|
+
TStartInput,
|
|
134
|
+
TStartResult,
|
|
135
|
+
TExecuteContext = unknown,
|
|
136
|
+
TLabel = string,
|
|
137
|
+
TPreviewValues extends Readonly<Record<string, unknown>> =
|
|
138
|
+
Readonly<Record<string, never>>,
|
|
139
|
+
TResource extends ProjectedDocumentResource = ProjectedDocumentResource,
|
|
140
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource =
|
|
141
|
+
ProjectedPromptDocumentPreviewResource,
|
|
142
|
+
>({
|
|
143
|
+
hasResource,
|
|
144
|
+
isActionAvailable = true,
|
|
145
|
+
isPreviewBlocked = false,
|
|
146
|
+
pendingLabels,
|
|
147
|
+
...runtimeOptions
|
|
148
|
+
}: UseProjectedDocumentProcessPreviewCapabilityRuntimeOptions<
|
|
149
|
+
TPreviewRequest,
|
|
150
|
+
TPreviewResponse,
|
|
151
|
+
TStartInput,
|
|
152
|
+
TStartResult,
|
|
153
|
+
TLabel,
|
|
154
|
+
TPreviewValues,
|
|
155
|
+
TResource,
|
|
156
|
+
TPreviewResource
|
|
157
|
+
>): ProjectedDocumentProcessPreviewCapabilityRuntime<
|
|
158
|
+
TExecuteContext,
|
|
159
|
+
TLabel,
|
|
160
|
+
TPreviewRequest,
|
|
161
|
+
TPreviewResponse,
|
|
162
|
+
TPreviewValues,
|
|
163
|
+
TPreviewResource
|
|
164
|
+
> {
|
|
165
|
+
const actionRuntime = useProjectedDocumentProcessPreviewActionRuntime<
|
|
166
|
+
TPreviewRequest,
|
|
167
|
+
TPreviewResponse,
|
|
168
|
+
TStartInput,
|
|
169
|
+
TStartResult,
|
|
170
|
+
TPreviewValues,
|
|
171
|
+
TResource,
|
|
172
|
+
TPreviewResource
|
|
173
|
+
>({
|
|
174
|
+
...runtimeOptions,
|
|
175
|
+
isActionAvailable,
|
|
176
|
+
isPreviewBlocked,
|
|
177
|
+
})
|
|
178
|
+
const actionBindings = projectDocumentProcessPreviewActionRuntimeBindings<
|
|
179
|
+
TExecuteContext,
|
|
180
|
+
TLabel,
|
|
181
|
+
TPreviewRequest,
|
|
182
|
+
TPreviewResponse,
|
|
183
|
+
TPreviewValues,
|
|
184
|
+
TPreviewResource
|
|
185
|
+
>({
|
|
186
|
+
hasResource,
|
|
187
|
+
isActionAvailable,
|
|
188
|
+
isPreviewBlocked,
|
|
189
|
+
pendingLabels,
|
|
190
|
+
runtime: actionRuntime,
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
actionBindings,
|
|
195
|
+
actionRuntime,
|
|
196
|
+
actionStatuses: projectDocumentProcessPreviewActionStatusSources(actionRuntime),
|
|
197
|
+
activePreview: actionRuntime.activePreview,
|
|
198
|
+
cancelPreview: actionRuntime.cancelPreview,
|
|
199
|
+
cancelPrompt: actionRuntime.cancelPrompt,
|
|
200
|
+
diagnosticActionPlacements: actionRuntime.diagnosticActionPlacements,
|
|
201
|
+
diagnostics: actionRuntime.diagnostics,
|
|
202
|
+
input: {
|
|
203
|
+
runtime: actionRuntime.input.runtime,
|
|
204
|
+
},
|
|
205
|
+
preview: {
|
|
206
|
+
error: actionRuntime.preview.error,
|
|
207
|
+
isPending: actionRuntime.preview.isPending,
|
|
208
|
+
},
|
|
209
|
+
reset: actionRuntime.reset,
|
|
210
|
+
start: {
|
|
211
|
+
error: actionRuntime.start.error,
|
|
212
|
+
isPending: actionRuntime.start.isPending,
|
|
213
|
+
},
|
|
214
|
+
startPreview: actionRuntime.acceptPreview,
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
DocumentWorkspaceProfileProjection,
|
|
5
|
+
ProjectedDocumentResource,
|
|
6
|
+
} from '@cohesivesystems/presentation-core'
|
|
7
|
+
import type {
|
|
8
|
+
ActionDefinition,
|
|
9
|
+
ActionPlacementDefinition,
|
|
10
|
+
PresentationModuleDefinition,
|
|
11
|
+
} from '@cohesivesystems/presentation-core'
|
|
12
|
+
import type {
|
|
13
|
+
PresentationActionRenderContext,
|
|
14
|
+
PresentationActionGroupOptions,
|
|
15
|
+
} from './presentation-action-group-runtime-options'
|
|
16
|
+
import {
|
|
17
|
+
createPresentationActionGroupRuntimeOptions,
|
|
18
|
+
} from './presentation-action-group-runtime-options'
|
|
19
|
+
import type {
|
|
20
|
+
PresentationActionEndpointExecutor,
|
|
21
|
+
PresentationActionSuccessContext,
|
|
22
|
+
} from './presentation-action-runtime'
|
|
23
|
+
import {
|
|
24
|
+
projectPresentationActionRuntimeBindingDiagnostics,
|
|
25
|
+
} from '@cohesivesystems/presentation-core'
|
|
26
|
+
import type {
|
|
27
|
+
PresentationActionRuntimeRegistry,
|
|
28
|
+
} from '@cohesivesystems/presentation-core'
|
|
29
|
+
import {
|
|
30
|
+
projectPresentationActionRuntimeRegistry,
|
|
31
|
+
} from '@cohesivesystems/presentation-core'
|
|
32
|
+
import {
|
|
33
|
+
projectPresentationNavigationActionRuntimeBindings,
|
|
34
|
+
} from '@cohesivesystems/presentation-core'
|
|
35
|
+
import type {
|
|
36
|
+
PresentationFlowRuntimeRegistrySnapshot,
|
|
37
|
+
} from './presentation-flow-runtime'
|
|
38
|
+
import {
|
|
39
|
+
mergePresentationProjectionDiagnostics,
|
|
40
|
+
type PresentationProjectionDiagnostic,
|
|
41
|
+
} from '@cohesivesystems/presentation-core'
|
|
42
|
+
import {
|
|
43
|
+
projectDocumentActionRuntimeBindings,
|
|
44
|
+
} from './projected-document-action-runtime-bindings'
|
|
45
|
+
import type {
|
|
46
|
+
ProjectedDocumentActionRuntimeProfileSpec,
|
|
47
|
+
} from '@cohesivesystems/presentation-core'
|
|
48
|
+
import {
|
|
49
|
+
mergeActionPlacements,
|
|
50
|
+
useProjectedDocumentActionRuntime,
|
|
51
|
+
type ProjectedDocumentJsonValidationState,
|
|
52
|
+
} from './projected-document-action-runtime'
|
|
53
|
+
import {
|
|
54
|
+
useProjectedDocumentProcessPreviewCapabilityRuntime,
|
|
55
|
+
type ProjectedDocumentProcessPreviewCapabilityRuntime,
|
|
56
|
+
type ProjectedDocumentProcessPreviewCapabilityState,
|
|
57
|
+
} from './projected-document-process-preview-capability-runtime'
|
|
58
|
+
import {
|
|
59
|
+
projectDocumentActionStatusMap,
|
|
60
|
+
type ProjectedDocumentActionStatusMap,
|
|
61
|
+
type ProjectedActionStatusSource,
|
|
62
|
+
} from '@cohesivesystems/presentation-core'
|
|
63
|
+
import type {
|
|
64
|
+
ProjectedInputFormRuntime,
|
|
65
|
+
} from '@cohesivesystems/presentation-core'
|
|
66
|
+
import type {
|
|
67
|
+
ProcessTask,
|
|
68
|
+
ProcessTaskSelector,
|
|
69
|
+
ProcessTaskStartRegistration,
|
|
70
|
+
} from '@cohesivesystems/presentation-core'
|
|
71
|
+
import type {
|
|
72
|
+
ProjectedPromptDocumentPreviewResource,
|
|
73
|
+
} from '@cohesivesystems/presentation-core'
|
|
74
|
+
|
|
75
|
+
type DocumentWorkspaceActionExecuteContext<TActionContext> =
|
|
76
|
+
PresentationActionRenderContext<TActionContext>
|
|
77
|
+
|
|
78
|
+
type DocumentWorkspaceActionRuntimeRegistry<TActionContext> =
|
|
79
|
+
PresentationActionRuntimeRegistry<
|
|
80
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
81
|
+
ReactNode
|
|
82
|
+
>
|
|
83
|
+
|
|
84
|
+
export interface UseProjectedDocumentWorkspaceActionRuntimeOptions<
|
|
85
|
+
TActionContext,
|
|
86
|
+
TResource extends ProjectedDocumentResource = ProjectedDocumentResource,
|
|
87
|
+
> {
|
|
88
|
+
readonly actionPlacements: readonly ActionPlacementDefinition[]
|
|
89
|
+
readonly createActionGroupOptions?: (context: {
|
|
90
|
+
readonly runtimes: DocumentWorkspaceActionRuntimeRegistry<TActionContext>
|
|
91
|
+
}) => PresentationActionGroupOptions<TActionContext>
|
|
92
|
+
readonly createHref?: ((routeId: string) => string | null) | null
|
|
93
|
+
readonly dataSourceQueryKey?: (dataSourceId: string) => readonly unknown[]
|
|
94
|
+
readonly executeEndpoint: PresentationActionEndpointExecutor
|
|
95
|
+
readonly findActiveTask?: (selector: ProcessTaskSelector) => ProcessTask | null
|
|
96
|
+
readonly formatDocument?: (value: unknown) => string
|
|
97
|
+
readonly isEditorDirty: boolean
|
|
98
|
+
readonly jsonValidation: ProjectedDocumentJsonValidationState
|
|
99
|
+
readonly module: PresentationModuleDefinition | null
|
|
100
|
+
readonly navigateHref: (href: string) => void
|
|
101
|
+
readonly onResetEditorState: () => void
|
|
102
|
+
readonly onSetEditorText: (text: string) => void
|
|
103
|
+
readonly processActionRuntimeProfile?: Pick<
|
|
104
|
+
ProjectedDocumentActionRuntimeProfileSpec,
|
|
105
|
+
'actionId' | 'flowId'
|
|
106
|
+
> | null
|
|
107
|
+
readonly processInputStateKey?: string | null
|
|
108
|
+
readonly projection: Pick<
|
|
109
|
+
DocumentWorkspaceProfileProjection,
|
|
110
|
+
'dataSourceId' | 'profile'
|
|
111
|
+
>
|
|
112
|
+
readonly registerProcessTaskStart?: (started: ProcessTaskStartRegistration) => void
|
|
113
|
+
readonly resolveNavigationHref: (action: ActionDefinition) => string | null
|
|
114
|
+
readonly resource: TResource | undefined
|
|
115
|
+
readonly resourceId: string
|
|
116
|
+
readonly resourceKey: string | null
|
|
117
|
+
readonly setSaveResultQueryData?: (
|
|
118
|
+
context: PresentationActionSuccessContext<void, TResource>,
|
|
119
|
+
) => void
|
|
120
|
+
readonly source?: string
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface ProjectedDocumentWorkspaceActionRuntimeState<
|
|
124
|
+
TActionContext,
|
|
125
|
+
TPreviewRequest extends object,
|
|
126
|
+
TPreviewResponse,
|
|
127
|
+
TPreviewValues extends Readonly<Record<string, unknown>> =
|
|
128
|
+
Readonly<Record<string, never>>,
|
|
129
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource =
|
|
130
|
+
ProjectedPromptDocumentPreviewResource,
|
|
131
|
+
> {
|
|
132
|
+
readonly actionGroupOptions: PresentationActionGroupOptions<TActionContext>
|
|
133
|
+
readonly actionRuntimes: DocumentWorkspaceActionRuntimeRegistry<TActionContext>
|
|
134
|
+
readonly actionStatuses: ProjectedDocumentActionStatusMap
|
|
135
|
+
readonly activeProcessPreview: ProjectedDocumentProcessPreviewCapabilityState<
|
|
136
|
+
TPreviewResponse,
|
|
137
|
+
TPreviewRequest,
|
|
138
|
+
TPreviewValues,
|
|
139
|
+
TPreviewResource
|
|
140
|
+
> | null
|
|
141
|
+
readonly acceptProcessPreview: () => void
|
|
142
|
+
readonly cancelProcessPreview: () => void
|
|
143
|
+
readonly cancelProcessPrompt: () => void
|
|
144
|
+
readonly diagnostics: readonly PresentationProjectionDiagnostic[]
|
|
145
|
+
readonly flowRegistry: PresentationFlowRuntimeRegistrySnapshot
|
|
146
|
+
readonly processInput: {
|
|
147
|
+
readonly runtime: ProjectedInputFormRuntime<TPreviewRequest> | null
|
|
148
|
+
}
|
|
149
|
+
readonly processPreview: {
|
|
150
|
+
readonly error: unknown
|
|
151
|
+
readonly isPending: boolean
|
|
152
|
+
}
|
|
153
|
+
readonly processStart: {
|
|
154
|
+
readonly error: unknown
|
|
155
|
+
readonly isPending: boolean
|
|
156
|
+
}
|
|
157
|
+
readonly processPreviewCapability: ProjectedDocumentProcessPreviewCapabilityRuntime<
|
|
158
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
159
|
+
ReactNode,
|
|
160
|
+
TPreviewRequest,
|
|
161
|
+
TPreviewResponse,
|
|
162
|
+
TPreviewValues,
|
|
163
|
+
TPreviewResource
|
|
164
|
+
>
|
|
165
|
+
readonly promptDocumentPreview: {
|
|
166
|
+
readonly data: ProjectedDocumentProcessPreviewCapabilityState<
|
|
167
|
+
TPreviewResponse,
|
|
168
|
+
TPreviewRequest,
|
|
169
|
+
TPreviewValues,
|
|
170
|
+
TPreviewResource
|
|
171
|
+
> | null
|
|
172
|
+
readonly error: unknown
|
|
173
|
+
readonly isPending: boolean
|
|
174
|
+
}
|
|
175
|
+
readonly resetTransientState: () => void
|
|
176
|
+
readonly save: {
|
|
177
|
+
readonly error: unknown
|
|
178
|
+
readonly isPending: boolean
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Composes the standard projected document workspace action runtime.
|
|
184
|
+
*
|
|
185
|
+
* This hook joins document-local actions, parameterless navigation actions,
|
|
186
|
+
* process-preview actions, runtime diagnostics, and action-group projection
|
|
187
|
+
* without knowing any product-specific document type.
|
|
188
|
+
*/
|
|
189
|
+
export function useProjectedDocumentWorkspaceActionRuntime<
|
|
190
|
+
TActionContext,
|
|
191
|
+
TPreviewRequest extends object,
|
|
192
|
+
TPreviewResponse,
|
|
193
|
+
TStartInput = TPreviewRequest,
|
|
194
|
+
TStartResult = unknown,
|
|
195
|
+
TPreviewValues extends Readonly<Record<string, unknown>> =
|
|
196
|
+
Readonly<Record<string, never>>,
|
|
197
|
+
TResource extends ProjectedDocumentResource = ProjectedDocumentResource,
|
|
198
|
+
TPreviewResource extends ProjectedPromptDocumentPreviewResource =
|
|
199
|
+
ProjectedPromptDocumentPreviewResource,
|
|
200
|
+
>({
|
|
201
|
+
actionPlacements,
|
|
202
|
+
createActionGroupOptions = ({ runtimes }) =>
|
|
203
|
+
createPresentationActionGroupRuntimeOptions<TActionContext>({ runtimes }),
|
|
204
|
+
createHref,
|
|
205
|
+
dataSourceQueryKey,
|
|
206
|
+
executeEndpoint,
|
|
207
|
+
findActiveTask,
|
|
208
|
+
formatDocument,
|
|
209
|
+
isEditorDirty,
|
|
210
|
+
jsonValidation,
|
|
211
|
+
module,
|
|
212
|
+
navigateHref,
|
|
213
|
+
onResetEditorState,
|
|
214
|
+
onSetEditorText,
|
|
215
|
+
processActionRuntimeProfile,
|
|
216
|
+
processInputStateKey,
|
|
217
|
+
projection,
|
|
218
|
+
registerProcessTaskStart,
|
|
219
|
+
resolveNavigationHref,
|
|
220
|
+
resource,
|
|
221
|
+
resourceId,
|
|
222
|
+
resourceKey,
|
|
223
|
+
setSaveResultQueryData,
|
|
224
|
+
source = 'projected-document-workspace-action-runtime',
|
|
225
|
+
}: UseProjectedDocumentWorkspaceActionRuntimeOptions<
|
|
226
|
+
TActionContext,
|
|
227
|
+
TResource
|
|
228
|
+
>): ProjectedDocumentWorkspaceActionRuntimeState<
|
|
229
|
+
TActionContext,
|
|
230
|
+
TPreviewRequest,
|
|
231
|
+
TPreviewResponse,
|
|
232
|
+
TPreviewValues,
|
|
233
|
+
TPreviewResource
|
|
234
|
+
> {
|
|
235
|
+
const formatDocumentValue = formatDocument ?? formatJsonDocumentValue
|
|
236
|
+
const documentActionRuntime = useProjectedDocumentActionRuntime<TResource>({
|
|
237
|
+
actionPlacements,
|
|
238
|
+
dataSourceId: projection.dataSourceId,
|
|
239
|
+
dataSourceQueryKey,
|
|
240
|
+
executeEndpoint,
|
|
241
|
+
formatDocument: formatDocumentValue,
|
|
242
|
+
jsonValidation,
|
|
243
|
+
module,
|
|
244
|
+
onResetEditorState,
|
|
245
|
+
onSetEditorText,
|
|
246
|
+
resource,
|
|
247
|
+
resourceId,
|
|
248
|
+
resourceKey,
|
|
249
|
+
setSaveResultQueryData,
|
|
250
|
+
})
|
|
251
|
+
const flowRegistry = documentActionRuntime.flowRegistry
|
|
252
|
+
const processPreviewCapability = useProjectedDocumentProcessPreviewCapabilityRuntime<
|
|
253
|
+
TPreviewRequest,
|
|
254
|
+
TPreviewResponse,
|
|
255
|
+
TStartInput,
|
|
256
|
+
TStartResult,
|
|
257
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
258
|
+
ReactNode,
|
|
259
|
+
TPreviewValues,
|
|
260
|
+
TResource,
|
|
261
|
+
TPreviewResource
|
|
262
|
+
>({
|
|
263
|
+
actionId: processActionRuntimeProfile?.actionId ?? null,
|
|
264
|
+
actionPlacements,
|
|
265
|
+
createHref,
|
|
266
|
+
dataSourceId: projection.dataSourceId,
|
|
267
|
+
dataSourceQueryKey,
|
|
268
|
+
executeEndpoint,
|
|
269
|
+
findActiveTask,
|
|
270
|
+
flowRegistry,
|
|
271
|
+
flowId: processActionRuntimeProfile?.flowId ?? null,
|
|
272
|
+
hasResource: Boolean(resource),
|
|
273
|
+
inputStateKey: processInputStateKey ?? null,
|
|
274
|
+
localActionEnablement: {
|
|
275
|
+
isDocumentDirty: isEditorDirty,
|
|
276
|
+
isDocumentValid: jsonValidation.ok,
|
|
277
|
+
pendingActionIds:
|
|
278
|
+
documentActionRuntime.save.isPending && documentActionRuntime.actions.save
|
|
279
|
+
? [documentActionRuntime.actions.save.Id]
|
|
280
|
+
: [],
|
|
281
|
+
},
|
|
282
|
+
module,
|
|
283
|
+
processTaskContext: { resourceId },
|
|
284
|
+
processTaskSelectors: projection.profile.ProcessTaskSelectors ?? [],
|
|
285
|
+
registerProcessTaskStart,
|
|
286
|
+
resource,
|
|
287
|
+
resourceId,
|
|
288
|
+
resourceKey,
|
|
289
|
+
})
|
|
290
|
+
const diagnosticActionPlacements = useMemo(
|
|
291
|
+
() =>
|
|
292
|
+
mergeActionPlacements(
|
|
293
|
+
documentActionRuntime.diagnosticActionPlacements,
|
|
294
|
+
processPreviewCapability.diagnosticActionPlacements,
|
|
295
|
+
),
|
|
296
|
+
[
|
|
297
|
+
documentActionRuntime.diagnosticActionPlacements,
|
|
298
|
+
processPreviewCapability.diagnosticActionPlacements,
|
|
299
|
+
],
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
function resetTransientState() {
|
|
303
|
+
documentActionRuntime.resetTransientState()
|
|
304
|
+
processPreviewCapability.reset()
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function resetDocument() {
|
|
308
|
+
resetTransientState()
|
|
309
|
+
onResetEditorState()
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function formatCurrentDocument() {
|
|
313
|
+
if (jsonValidation.ok && resourceKey) {
|
|
314
|
+
resetTransientState()
|
|
315
|
+
onSetEditorText(formatDocumentValue(jsonValidation.value))
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const actionRuntimes = projectPresentationActionRuntimeRegistry<
|
|
320
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
321
|
+
ReactNode
|
|
322
|
+
>({
|
|
323
|
+
module,
|
|
324
|
+
projections: [
|
|
325
|
+
...projectPresentationNavigationActionRuntimeBindings<
|
|
326
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
327
|
+
ReactNode
|
|
328
|
+
>({
|
|
329
|
+
navigateHref,
|
|
330
|
+
resolveHref: resolveNavigationHref,
|
|
331
|
+
}),
|
|
332
|
+
...projectDocumentActionRuntimeBindings<
|
|
333
|
+
DocumentWorkspaceActionExecuteContext<TActionContext>,
|
|
334
|
+
ReactNode
|
|
335
|
+
>({
|
|
336
|
+
formatDocument: formatCurrentDocument,
|
|
337
|
+
hasResource: Boolean(resource),
|
|
338
|
+
isEditorDirty,
|
|
339
|
+
jsonValidation,
|
|
340
|
+
resetDocument,
|
|
341
|
+
runtime: documentActionRuntime,
|
|
342
|
+
}),
|
|
343
|
+
...processPreviewCapability.actionBindings,
|
|
344
|
+
],
|
|
345
|
+
})
|
|
346
|
+
const actionStatuses = projectDocumentActionStatusMap([
|
|
347
|
+
{
|
|
348
|
+
action: documentActionRuntime.save.action,
|
|
349
|
+
error: documentActionRuntime.save.error,
|
|
350
|
+
isPending: documentActionRuntime.save.isPending,
|
|
351
|
+
},
|
|
352
|
+
...processPreviewCapability.actionStatuses,
|
|
353
|
+
] satisfies readonly ProjectedActionStatusSource[])
|
|
354
|
+
const diagnostics = mergePresentationProjectionDiagnostics(
|
|
355
|
+
documentActionRuntime.diagnostics,
|
|
356
|
+
processPreviewCapability.diagnostics,
|
|
357
|
+
projectPresentationActionRuntimeBindingDiagnostics({
|
|
358
|
+
actionPlacements: diagnosticActionPlacements,
|
|
359
|
+
module,
|
|
360
|
+
runtimes: actionRuntimes,
|
|
361
|
+
source,
|
|
362
|
+
}),
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
actionGroupOptions: createActionGroupOptions({ runtimes: actionRuntimes }),
|
|
367
|
+
actionRuntimes,
|
|
368
|
+
actionStatuses,
|
|
369
|
+
activeProcessPreview: processPreviewCapability.activePreview,
|
|
370
|
+
acceptProcessPreview: processPreviewCapability.startPreview,
|
|
371
|
+
cancelProcessPreview: processPreviewCapability.cancelPreview,
|
|
372
|
+
cancelProcessPrompt: processPreviewCapability.cancelPrompt,
|
|
373
|
+
diagnostics,
|
|
374
|
+
flowRegistry,
|
|
375
|
+
processInput: {
|
|
376
|
+
runtime: processPreviewCapability.input.runtime,
|
|
377
|
+
},
|
|
378
|
+
processPreview: {
|
|
379
|
+
error: processPreviewCapability.preview.error,
|
|
380
|
+
isPending: processPreviewCapability.preview.isPending,
|
|
381
|
+
},
|
|
382
|
+
processPreviewCapability,
|
|
383
|
+
processStart: {
|
|
384
|
+
error: processPreviewCapability.start.error,
|
|
385
|
+
isPending: processPreviewCapability.start.isPending,
|
|
386
|
+
},
|
|
387
|
+
promptDocumentPreview: {
|
|
388
|
+
data: processPreviewCapability.activePreview,
|
|
389
|
+
error: processPreviewCapability.preview.error,
|
|
390
|
+
isPending: processPreviewCapability.preview.isPending,
|
|
391
|
+
},
|
|
392
|
+
resetTransientState,
|
|
393
|
+
save: {
|
|
394
|
+
error: documentActionRuntime.save.error,
|
|
395
|
+
isPending: documentActionRuntime.save.isPending,
|
|
396
|
+
},
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function formatJsonDocumentValue(value: unknown) {
|
|
401
|
+
return JSON.stringify(value ?? null, null, 2)
|
|
402
|
+
}
|