@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,356 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
NavigationDefinitionProjection,
|
|
5
|
+
NavigationTarget,
|
|
6
|
+
} from '@cohesivesystems/presentation-core'
|
|
7
|
+
import type {
|
|
8
|
+
NavigationRouteDefinition,
|
|
9
|
+
PageHostDefinition,
|
|
10
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Route parameter values resolved by the frontend router for a projected
|
|
14
|
+
* navigation route. Values are strings because this sits at the router binding
|
|
15
|
+
* boundary; semantic conversion belongs in the page-host or data-source layer.
|
|
16
|
+
*/
|
|
17
|
+
export type RouteParameterValues = Readonly<Record<string, string | undefined>>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Complete rendering context for a resolved page host. Page-host renderers are
|
|
21
|
+
* the adapting boundary between semantic navigation/page-host IR and concrete
|
|
22
|
+
* React route components.
|
|
23
|
+
*
|
|
24
|
+
* @typeParam TModule - Presentation module shape available to the renderer.
|
|
25
|
+
* @typeParam TNavigation - Navigation graph shape used to resolve the route.
|
|
26
|
+
* @typeParam TRoute - Concrete navigation route type.
|
|
27
|
+
* @typeParam TPageHost - Concrete page-host type mounted by the route.
|
|
28
|
+
* @typeParam TProjectionContext - App-specific runtime context supplied by the navigation projection.
|
|
29
|
+
*/
|
|
30
|
+
export interface PageHostRenderContext<
|
|
31
|
+
TModule,
|
|
32
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
33
|
+
TRoute extends NavigationRouteDefinition,
|
|
34
|
+
TPageHost extends PageHostDefinition,
|
|
35
|
+
TProjectionContext,
|
|
36
|
+
> {
|
|
37
|
+
/** App-specific projection context carried through navigation rendering. */
|
|
38
|
+
readonly context: TProjectionContext
|
|
39
|
+
|
|
40
|
+
/** Presentation module that owns views, targets, workspaces, and bindings. */
|
|
41
|
+
readonly module: TModule
|
|
42
|
+
|
|
43
|
+
/** Navigation graph that produced the current route/page-host pairing. */
|
|
44
|
+
readonly navigation: TNavigation
|
|
45
|
+
|
|
46
|
+
/** Resolved semantic target for the active route. */
|
|
47
|
+
readonly navigationTarget: NavigationTarget<TRoute, TPageHost>
|
|
48
|
+
|
|
49
|
+
/** Page host mounted by the active route. */
|
|
50
|
+
readonly pageHost: TPageHost
|
|
51
|
+
|
|
52
|
+
/** Raw route parameters captured by the frontend router. */
|
|
53
|
+
readonly parameters: RouteParameterValues
|
|
54
|
+
|
|
55
|
+
/** Active route definition from the navigation graph. */
|
|
56
|
+
readonly route: TRoute
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* React renderer for a resolved page host.
|
|
61
|
+
*/
|
|
62
|
+
export type PageHostComponentRenderer<
|
|
63
|
+
TModule,
|
|
64
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
65
|
+
TRoute extends NavigationRouteDefinition,
|
|
66
|
+
TPageHost extends PageHostDefinition,
|
|
67
|
+
TProjectionContext,
|
|
68
|
+
> = (
|
|
69
|
+
context: PageHostRenderContext<
|
|
70
|
+
TModule,
|
|
71
|
+
TNavigation,
|
|
72
|
+
TRoute,
|
|
73
|
+
TPageHost,
|
|
74
|
+
TProjectionContext
|
|
75
|
+
>,
|
|
76
|
+
) => ReactNode
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Registry of concrete page-host renderers keyed by adapter component key.
|
|
80
|
+
* The semantic navigation runtime resolves which component key applies; this
|
|
81
|
+
* registry supplies the React implementation for that key.
|
|
82
|
+
*/
|
|
83
|
+
export type PageHostComponentRegistry<
|
|
84
|
+
TComponentKey extends string,
|
|
85
|
+
TModule,
|
|
86
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
87
|
+
TRoute extends NavigationRouteDefinition,
|
|
88
|
+
TPageHost extends PageHostDefinition,
|
|
89
|
+
TProjectionContext,
|
|
90
|
+
> = Readonly<
|
|
91
|
+
Partial<
|
|
92
|
+
Record<
|
|
93
|
+
TComponentKey,
|
|
94
|
+
PageHostComponentRenderer<
|
|
95
|
+
TModule,
|
|
96
|
+
TNavigation,
|
|
97
|
+
TRoute,
|
|
98
|
+
TPageHost,
|
|
99
|
+
TProjectionContext
|
|
100
|
+
>
|
|
101
|
+
>
|
|
102
|
+
>
|
|
103
|
+
>
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Convenience registry type for apps that use the standard generated
|
|
107
|
+
* navigation, route, and page-host shapes.
|
|
108
|
+
*/
|
|
109
|
+
export type SimplePageHostComponentRegistry<
|
|
110
|
+
TComponentKey extends string,
|
|
111
|
+
TModule,
|
|
112
|
+
TProjectionContext,
|
|
113
|
+
> = PageHostComponentRegistry<
|
|
114
|
+
TComponentKey,
|
|
115
|
+
TModule,
|
|
116
|
+
NavigationDefinitionProjection,
|
|
117
|
+
NavigationRouteDefinition,
|
|
118
|
+
PageHostDefinition,
|
|
119
|
+
TProjectionContext
|
|
120
|
+
>
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Convenience render-context type for apps that use the standard generated
|
|
124
|
+
* navigation, route, and page-host shapes.
|
|
125
|
+
*/
|
|
126
|
+
export type SimplePageHostRenderContext<
|
|
127
|
+
TModule,
|
|
128
|
+
TProjectionContext,
|
|
129
|
+
> = PageHostRenderContext<
|
|
130
|
+
TModule,
|
|
131
|
+
NavigationDefinitionProjection,
|
|
132
|
+
NavigationRouteDefinition,
|
|
133
|
+
PageHostDefinition,
|
|
134
|
+
TProjectionContext
|
|
135
|
+
>
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Convenience unknown-renderer type for apps that use the standard generated
|
|
139
|
+
* navigation, route, and page-host shapes.
|
|
140
|
+
*/
|
|
141
|
+
export type SimpleUnknownPageHostRenderer<
|
|
142
|
+
TModule,
|
|
143
|
+
TProjectionContext,
|
|
144
|
+
> = UnknownPageHostRenderer<
|
|
145
|
+
TModule,
|
|
146
|
+
NavigationDefinitionProjection,
|
|
147
|
+
NavigationRouteDefinition,
|
|
148
|
+
PageHostDefinition,
|
|
149
|
+
TProjectionContext
|
|
150
|
+
>
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Context passed when a route cannot be projected to a concrete page-host
|
|
154
|
+
* renderer. Unknown renderers should produce diagnostics, not throw, so route
|
|
155
|
+
* and binding problems remain visible inside the app shell.
|
|
156
|
+
*/
|
|
157
|
+
export interface UnknownPageHostRenderContext<
|
|
158
|
+
TModule,
|
|
159
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
160
|
+
TRoute extends NavigationRouteDefinition,
|
|
161
|
+
TPageHost extends PageHostDefinition,
|
|
162
|
+
TProjectionContext,
|
|
163
|
+
> {
|
|
164
|
+
/** Component key that failed to resolve, when one was present. */
|
|
165
|
+
readonly componentKey?: string | null
|
|
166
|
+
|
|
167
|
+
/** App-specific projection context carried through navigation rendering. */
|
|
168
|
+
readonly context: TProjectionContext
|
|
169
|
+
|
|
170
|
+
/** Presentation module available during route projection. */
|
|
171
|
+
readonly module: TModule
|
|
172
|
+
|
|
173
|
+
/** Navigation graph being projected. */
|
|
174
|
+
readonly navigation: TNavigation
|
|
175
|
+
|
|
176
|
+
/** Resolved navigation target, or null when no route matched. */
|
|
177
|
+
readonly navigationTarget: NavigationTarget<TRoute, TPageHost> | null
|
|
178
|
+
|
|
179
|
+
/** Page host selected by the route, or null when the route references none. */
|
|
180
|
+
readonly pageHost: TPageHost | null
|
|
181
|
+
|
|
182
|
+
/** Raw route parameters captured by the frontend router. */
|
|
183
|
+
readonly parameters: RouteParameterValues
|
|
184
|
+
|
|
185
|
+
/** Failure mode that prevented a page host from rendering. */
|
|
186
|
+
readonly reason:
|
|
187
|
+
| 'missing-page-host'
|
|
188
|
+
| 'missing-component-binding'
|
|
189
|
+
| 'unknown-component-key'
|
|
190
|
+
| 'unmatched-route'
|
|
191
|
+
|
|
192
|
+
/** Active route, or null when no route matched the current URL. */
|
|
193
|
+
readonly route: TRoute | null
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Renderer for page-host projection failures.
|
|
198
|
+
*/
|
|
199
|
+
export type UnknownPageHostRenderer<
|
|
200
|
+
TModule,
|
|
201
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
202
|
+
TRoute extends NavigationRouteDefinition,
|
|
203
|
+
TPageHost extends PageHostDefinition,
|
|
204
|
+
TProjectionContext,
|
|
205
|
+
> = (
|
|
206
|
+
context: UnknownPageHostRenderContext<
|
|
207
|
+
TModule,
|
|
208
|
+
TNavigation,
|
|
209
|
+
TRoute,
|
|
210
|
+
TPageHost,
|
|
211
|
+
TProjectionContext
|
|
212
|
+
>,
|
|
213
|
+
) => ReactNode
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Inputs required to render a page host after router matching and semantic
|
|
217
|
+
* navigation resolution have already occurred.
|
|
218
|
+
*/
|
|
219
|
+
export interface RenderPageHostOptions<
|
|
220
|
+
TComponentKey extends string,
|
|
221
|
+
TModule,
|
|
222
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
223
|
+
TRoute extends NavigationRouteDefinition,
|
|
224
|
+
TPageHost extends PageHostDefinition,
|
|
225
|
+
TProjectionContext,
|
|
226
|
+
> {
|
|
227
|
+
/** Concrete component key resolved from target bindings or caller policy. */
|
|
228
|
+
readonly componentKey?: string | null
|
|
229
|
+
|
|
230
|
+
/** Registry that maps component keys to React page-host renderers. */
|
|
231
|
+
readonly componentRegistry: PageHostComponentRegistry<
|
|
232
|
+
TComponentKey,
|
|
233
|
+
TModule,
|
|
234
|
+
TNavigation,
|
|
235
|
+
TRoute,
|
|
236
|
+
TPageHost,
|
|
237
|
+
TProjectionContext
|
|
238
|
+
>
|
|
239
|
+
|
|
240
|
+
/** App-specific projection context carried through navigation rendering. */
|
|
241
|
+
readonly context: TProjectionContext
|
|
242
|
+
|
|
243
|
+
/** Presentation module available during route projection. */
|
|
244
|
+
readonly module: TModule
|
|
245
|
+
|
|
246
|
+
/** Navigation graph being projected. */
|
|
247
|
+
readonly navigation: TNavigation
|
|
248
|
+
|
|
249
|
+
/** Resolved semantic target for the active route. */
|
|
250
|
+
readonly navigationTarget: NavigationTarget<TRoute, TPageHost>
|
|
251
|
+
|
|
252
|
+
/** Page host selected by the route. Null is rendered through diagnostics. */
|
|
253
|
+
readonly pageHost: TPageHost | null
|
|
254
|
+
|
|
255
|
+
/** Raw route parameters captured by the frontend router. */
|
|
256
|
+
readonly parameters: RouteParameterValues
|
|
257
|
+
|
|
258
|
+
/** Diagnostic renderer used when the page host cannot be projected. */
|
|
259
|
+
readonly renderUnknownPageHost: UnknownPageHostRenderer<
|
|
260
|
+
TModule,
|
|
261
|
+
TNavigation,
|
|
262
|
+
TRoute,
|
|
263
|
+
TPageHost,
|
|
264
|
+
TProjectionContext
|
|
265
|
+
>
|
|
266
|
+
|
|
267
|
+
/** Active route definition from the navigation graph. */
|
|
268
|
+
readonly route: TRoute
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Projects a resolved semantic page host into a concrete React renderer.
|
|
273
|
+
*
|
|
274
|
+
* The function does only three things: validate that a page host exists,
|
|
275
|
+
* validate that a component key exists, and look up the corresponding renderer.
|
|
276
|
+
* Higher-level code owns route matching and component-key resolution; unknown
|
|
277
|
+
* cases are delegated to `renderUnknownPageHost` so projection failures remain
|
|
278
|
+
* visible and recoverable.
|
|
279
|
+
*/
|
|
280
|
+
export function renderPageHost<
|
|
281
|
+
TComponentKey extends string,
|
|
282
|
+
TModule,
|
|
283
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
284
|
+
TRoute extends NavigationRouteDefinition,
|
|
285
|
+
TPageHost extends PageHostDefinition,
|
|
286
|
+
TProjectionContext,
|
|
287
|
+
>({
|
|
288
|
+
componentKey,
|
|
289
|
+
componentRegistry,
|
|
290
|
+
context,
|
|
291
|
+
module,
|
|
292
|
+
navigation,
|
|
293
|
+
navigationTarget,
|
|
294
|
+
pageHost,
|
|
295
|
+
parameters,
|
|
296
|
+
renderUnknownPageHost,
|
|
297
|
+
route,
|
|
298
|
+
}: RenderPageHostOptions<
|
|
299
|
+
TComponentKey,
|
|
300
|
+
TModule,
|
|
301
|
+
TNavigation,
|
|
302
|
+
TRoute,
|
|
303
|
+
TPageHost,
|
|
304
|
+
TProjectionContext
|
|
305
|
+
>) {
|
|
306
|
+
if (!pageHost) {
|
|
307
|
+
return renderUnknownPageHost({
|
|
308
|
+
context,
|
|
309
|
+
module,
|
|
310
|
+
navigation,
|
|
311
|
+
navigationTarget,
|
|
312
|
+
pageHost,
|
|
313
|
+
parameters,
|
|
314
|
+
reason: 'missing-page-host',
|
|
315
|
+
route,
|
|
316
|
+
})
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (!componentKey) {
|
|
320
|
+
return renderUnknownPageHost({
|
|
321
|
+
context,
|
|
322
|
+
module,
|
|
323
|
+
navigation,
|
|
324
|
+
navigationTarget,
|
|
325
|
+
pageHost,
|
|
326
|
+
parameters,
|
|
327
|
+
reason: 'missing-component-binding',
|
|
328
|
+
route,
|
|
329
|
+
})
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const renderer = componentRegistry[componentKey as TComponentKey]
|
|
333
|
+
if (!renderer) {
|
|
334
|
+
return renderUnknownPageHost({
|
|
335
|
+
componentKey,
|
|
336
|
+
context,
|
|
337
|
+
module,
|
|
338
|
+
navigation,
|
|
339
|
+
navigationTarget,
|
|
340
|
+
pageHost,
|
|
341
|
+
parameters,
|
|
342
|
+
reason: 'unknown-component-key',
|
|
343
|
+
route,
|
|
344
|
+
})
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return renderer({
|
|
348
|
+
context,
|
|
349
|
+
module,
|
|
350
|
+
navigation,
|
|
351
|
+
navigationTarget,
|
|
352
|
+
pageHost,
|
|
353
|
+
parameters,
|
|
354
|
+
route,
|
|
355
|
+
})
|
|
356
|
+
}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
presentationTargetKinds,
|
|
5
|
+
type NavigationRouteDefinition,
|
|
6
|
+
type PageHostDefinition,
|
|
7
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
8
|
+
import {
|
|
9
|
+
createPresentationEnumDiscriminator,
|
|
10
|
+
presentationPageHostComponentRoles,
|
|
11
|
+
resolveDefaultPresentationPageHostComponentRole,
|
|
12
|
+
resolvePageHostRenderer as resolveCorePageHostRenderer,
|
|
13
|
+
type NavigationDefinitionProjection,
|
|
14
|
+
type PageHostRendererRegistry as CorePageHostRendererRegistry,
|
|
15
|
+
type PageHostRendererResolution as CorePageHostRendererResolution,
|
|
16
|
+
type PageHostRendererResolutionSource,
|
|
17
|
+
type PageHostTargetBindingSource,
|
|
18
|
+
type PresentationPageHostRendererModuleProjection,
|
|
19
|
+
} from '@cohesivesystems/presentation-core'
|
|
20
|
+
import type {
|
|
21
|
+
PageHostComponentRenderer,
|
|
22
|
+
PageHostRenderContext,
|
|
23
|
+
} from './page-host-projection'
|
|
24
|
+
import type {
|
|
25
|
+
ProjectedNavigationTargetRenderContext,
|
|
26
|
+
ProjectedNavigationTargetRenderer,
|
|
27
|
+
} from './react-router-binding'
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
presentationPageHostComponentRoles,
|
|
31
|
+
resolveDefaultPresentationPageHostComponentRole,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type {
|
|
35
|
+
PageHostRendererResolutionSource,
|
|
36
|
+
PageHostTargetBindingSource,
|
|
37
|
+
PresentationPageHostRendererModuleProjection,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Renders a semantic page host after navigation has resolved the target route.
|
|
42
|
+
* These renderers sit at the projection boundary: they choose React components
|
|
43
|
+
* for page-host semantics without letting the router own application meaning.
|
|
44
|
+
*/
|
|
45
|
+
export type PageHostRenderer<
|
|
46
|
+
TModule,
|
|
47
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
48
|
+
TRoute extends NavigationRouteDefinition,
|
|
49
|
+
TPageHost extends PageHostDefinition,
|
|
50
|
+
TProjectionContext,
|
|
51
|
+
> = PageHostComponentRenderer<
|
|
52
|
+
TModule,
|
|
53
|
+
TNavigation,
|
|
54
|
+
TRoute,
|
|
55
|
+
TPageHost,
|
|
56
|
+
TProjectionContext
|
|
57
|
+
>
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* React component type that consumes the fully resolved page-host context.
|
|
61
|
+
* Use `createPageHostComponentRenderer` to adapt one of these into a registry
|
|
62
|
+
* entry.
|
|
63
|
+
*/
|
|
64
|
+
export type PageHostRendererComponent<
|
|
65
|
+
TModule,
|
|
66
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
67
|
+
TRoute extends NavigationRouteDefinition,
|
|
68
|
+
TPageHost extends PageHostDefinition,
|
|
69
|
+
TProjectionContext,
|
|
70
|
+
> = ComponentType<
|
|
71
|
+
PageHostRenderContext<
|
|
72
|
+
TModule,
|
|
73
|
+
TNavigation,
|
|
74
|
+
TRoute,
|
|
75
|
+
TPageHost,
|
|
76
|
+
TProjectionContext
|
|
77
|
+
>
|
|
78
|
+
>
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Adapts a React component that consumes the resolved page-host context into a
|
|
82
|
+
* registry renderer. This keeps the registry declarative while allowing route
|
|
83
|
+
* hosts to remain ordinary components at the projection boundary.
|
|
84
|
+
*/
|
|
85
|
+
export function createPageHostComponentRenderer<
|
|
86
|
+
TModule,
|
|
87
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
88
|
+
TRoute extends NavigationRouteDefinition,
|
|
89
|
+
TPageHost extends PageHostDefinition,
|
|
90
|
+
TProjectionContext,
|
|
91
|
+
>(
|
|
92
|
+
Component: PageHostRendererComponent<
|
|
93
|
+
TModule,
|
|
94
|
+
TNavigation,
|
|
95
|
+
TRoute,
|
|
96
|
+
TPageHost,
|
|
97
|
+
TProjectionContext
|
|
98
|
+
>,
|
|
99
|
+
): PageHostRenderer<
|
|
100
|
+
TModule,
|
|
101
|
+
TNavigation,
|
|
102
|
+
TRoute,
|
|
103
|
+
TPageHost,
|
|
104
|
+
TProjectionContext
|
|
105
|
+
> {
|
|
106
|
+
return function renderPageHostWithComponent(context) {
|
|
107
|
+
return <Component {...context} />
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type PageHostRendererRegistry<
|
|
112
|
+
TModule,
|
|
113
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
114
|
+
TRoute extends NavigationRouteDefinition,
|
|
115
|
+
TPageHost extends PageHostDefinition,
|
|
116
|
+
TProjectionContext,
|
|
117
|
+
> = CorePageHostRendererRegistry<
|
|
118
|
+
PageHostRenderer<
|
|
119
|
+
TModule,
|
|
120
|
+
TNavigation,
|
|
121
|
+
TRoute,
|
|
122
|
+
TPageHost,
|
|
123
|
+
TProjectionContext
|
|
124
|
+
>
|
|
125
|
+
>
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Convenience registry type for apps that use the standard generated
|
|
129
|
+
* navigation, route, and page-host shapes.
|
|
130
|
+
*/
|
|
131
|
+
export type SimplePageHostRendererRegistry<
|
|
132
|
+
TModule,
|
|
133
|
+
TProjectionContext,
|
|
134
|
+
> = PageHostRendererRegistry<
|
|
135
|
+
TModule,
|
|
136
|
+
NavigationDefinitionProjection,
|
|
137
|
+
NavigationRouteDefinition,
|
|
138
|
+
PageHostDefinition,
|
|
139
|
+
TProjectionContext
|
|
140
|
+
>
|
|
141
|
+
|
|
142
|
+
export type PageHostRendererResolution<
|
|
143
|
+
TModule,
|
|
144
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
145
|
+
TRoute extends NavigationRouteDefinition,
|
|
146
|
+
TPageHost extends PageHostDefinition,
|
|
147
|
+
TProjectionContext,
|
|
148
|
+
> = CorePageHostRendererResolution<
|
|
149
|
+
PageHostRenderer<
|
|
150
|
+
TModule,
|
|
151
|
+
TNavigation,
|
|
152
|
+
TRoute,
|
|
153
|
+
TPageHost,
|
|
154
|
+
TProjectionContext
|
|
155
|
+
>
|
|
156
|
+
>
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Options for adapting a page-host registry into a navigation-target renderer
|
|
160
|
+
* that can be passed to router projection.
|
|
161
|
+
*/
|
|
162
|
+
export interface CreatePageHostTargetRendererOptions<
|
|
163
|
+
TComponentKey extends string,
|
|
164
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
165
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
166
|
+
TRoute extends NavigationRouteDefinition,
|
|
167
|
+
TPageHost extends PageHostDefinition,
|
|
168
|
+
TProjectionContext,
|
|
169
|
+
> {
|
|
170
|
+
/** Registry used to resolve semantic page hosts to concrete renderers. */
|
|
171
|
+
readonly registry: PageHostRendererRegistry<
|
|
172
|
+
TModule,
|
|
173
|
+
TNavigation,
|
|
174
|
+
TRoute,
|
|
175
|
+
TPageHost,
|
|
176
|
+
TProjectionContext
|
|
177
|
+
>
|
|
178
|
+
|
|
179
|
+
/** Adapter component set to use when reading target bindings. */
|
|
180
|
+
readonly componentSet?: string | null
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Optional caller-supplied component-key resolver. When provided, this value
|
|
184
|
+
* takes precedence over PageHostComponent target bindings.
|
|
185
|
+
*/
|
|
186
|
+
readonly resolveComponentKey?: (
|
|
187
|
+
context: ProjectedNavigationTargetRenderContext<
|
|
188
|
+
TComponentKey,
|
|
189
|
+
TModule,
|
|
190
|
+
TNavigation,
|
|
191
|
+
TRoute,
|
|
192
|
+
TPageHost,
|
|
193
|
+
TProjectionContext
|
|
194
|
+
>,
|
|
195
|
+
) => string | null
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Optional caller-supplied component-role resolver. When provided, this value
|
|
199
|
+
* takes precedence over PageHostComponent target bindings.
|
|
200
|
+
*/
|
|
201
|
+
readonly resolveComponentRole?: (
|
|
202
|
+
context: ProjectedNavigationTargetRenderContext<
|
|
203
|
+
TComponentKey,
|
|
204
|
+
TModule,
|
|
205
|
+
TNavigation,
|
|
206
|
+
TRoute,
|
|
207
|
+
TPageHost,
|
|
208
|
+
TProjectionContext
|
|
209
|
+
>,
|
|
210
|
+
) => string | null
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface ResolvePageHostRendererOptions<
|
|
214
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
215
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
216
|
+
TRoute extends NavigationRouteDefinition,
|
|
217
|
+
TPageHost extends PageHostDefinition,
|
|
218
|
+
TProjectionContext,
|
|
219
|
+
> {
|
|
220
|
+
readonly componentKey?: string | null
|
|
221
|
+
readonly componentRole?: string | null
|
|
222
|
+
readonly componentSet?: string | null
|
|
223
|
+
readonly module: TModule
|
|
224
|
+
readonly pageHost: TPageHost | null
|
|
225
|
+
readonly registry: PageHostRendererRegistry<
|
|
226
|
+
TModule,
|
|
227
|
+
TNavigation,
|
|
228
|
+
TRoute,
|
|
229
|
+
TPageHost,
|
|
230
|
+
TProjectionContext
|
|
231
|
+
>
|
|
232
|
+
readonly route?: TRoute | null
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Creates a navigation-target renderer from a page-host registry. Resolution
|
|
237
|
+
* starts from the semantic page-host shape, resolves an adapter component role,
|
|
238
|
+
* then invokes the frontend interpreter registered for that role.
|
|
239
|
+
*/
|
|
240
|
+
export function createPageHostTargetRenderer<
|
|
241
|
+
TComponentKey extends string,
|
|
242
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
243
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
244
|
+
TRoute extends NavigationRouteDefinition,
|
|
245
|
+
TPageHost extends PageHostDefinition,
|
|
246
|
+
TProjectionContext,
|
|
247
|
+
>({
|
|
248
|
+
componentSet,
|
|
249
|
+
registry,
|
|
250
|
+
resolveComponentKey,
|
|
251
|
+
resolveComponentRole,
|
|
252
|
+
}: CreatePageHostTargetRendererOptions<
|
|
253
|
+
TComponentKey,
|
|
254
|
+
TModule,
|
|
255
|
+
TNavigation,
|
|
256
|
+
TRoute,
|
|
257
|
+
TPageHost,
|
|
258
|
+
TProjectionContext
|
|
259
|
+
>): ProjectedNavigationTargetRenderer<
|
|
260
|
+
TComponentKey,
|
|
261
|
+
TModule,
|
|
262
|
+
TNavigation,
|
|
263
|
+
TRoute,
|
|
264
|
+
TPageHost,
|
|
265
|
+
TProjectionContext
|
|
266
|
+
> {
|
|
267
|
+
return function renderPageHostTarget(context) {
|
|
268
|
+
const componentKey = resolveComponentKey?.(context) ?? null
|
|
269
|
+
const componentRole = resolveComponentRole?.(context) ?? null
|
|
270
|
+
const resolution = resolvePageHostRenderer({
|
|
271
|
+
componentKey,
|
|
272
|
+
componentRole,
|
|
273
|
+
componentSet,
|
|
274
|
+
module: context.module,
|
|
275
|
+
pageHost: context.pageHost,
|
|
276
|
+
registry,
|
|
277
|
+
route: context.route,
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
if (context.pageHost && resolution.renderer) {
|
|
281
|
+
return resolution.renderer({
|
|
282
|
+
context: context.context,
|
|
283
|
+
module: context.module,
|
|
284
|
+
navigation: context.navigation,
|
|
285
|
+
navigationTarget: context.navigationTarget,
|
|
286
|
+
pageHost: context.pageHost,
|
|
287
|
+
parameters: context.parameters,
|
|
288
|
+
route: context.route,
|
|
289
|
+
})
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return context.renderBoundPageHost(componentKey)
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Resolves a page-host renderer without rendering it.
|
|
298
|
+
*/
|
|
299
|
+
export function resolvePageHostRenderer<
|
|
300
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
301
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
302
|
+
TRoute extends NavigationRouteDefinition,
|
|
303
|
+
TPageHost extends PageHostDefinition,
|
|
304
|
+
TProjectionContext,
|
|
305
|
+
>({
|
|
306
|
+
componentKey,
|
|
307
|
+
componentRole,
|
|
308
|
+
componentSet,
|
|
309
|
+
module,
|
|
310
|
+
pageHost,
|
|
311
|
+
registry,
|
|
312
|
+
route,
|
|
313
|
+
}: ResolvePageHostRendererOptions<
|
|
314
|
+
TModule,
|
|
315
|
+
TNavigation,
|
|
316
|
+
TRoute,
|
|
317
|
+
TPageHost,
|
|
318
|
+
TProjectionContext
|
|
319
|
+
>): PageHostRendererResolution<
|
|
320
|
+
TModule,
|
|
321
|
+
TNavigation,
|
|
322
|
+
TRoute,
|
|
323
|
+
TPageHost,
|
|
324
|
+
TProjectionContext
|
|
325
|
+
> {
|
|
326
|
+
return resolveCorePageHostRenderer<
|
|
327
|
+
PageHostRenderer<
|
|
328
|
+
TModule,
|
|
329
|
+
TNavigation,
|
|
330
|
+
TRoute,
|
|
331
|
+
TPageHost,
|
|
332
|
+
TProjectionContext
|
|
333
|
+
>,
|
|
334
|
+
TModule,
|
|
335
|
+
TRoute,
|
|
336
|
+
TPageHost
|
|
337
|
+
>({
|
|
338
|
+
componentKey,
|
|
339
|
+
componentRole,
|
|
340
|
+
componentSet,
|
|
341
|
+
module,
|
|
342
|
+
pageHost,
|
|
343
|
+
registry,
|
|
344
|
+
route,
|
|
345
|
+
targetKind: reactPresentationTargetKind,
|
|
346
|
+
})
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const reactPresentationTargetKind = createPresentationEnumDiscriminator(
|
|
350
|
+
presentationTargetKinds,
|
|
351
|
+
'react',
|
|
352
|
+
'React',
|
|
353
|
+
)
|