@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,207 @@
|
|
|
1
|
+
import { resolveDocumentWorkspaceProjectionCapability, resolveDocumentWorkspaceProjectionRenderer, } from './document-workspace-runtime.js';
|
|
2
|
+
import { createPresentationEnumDiscriminator, matchesPresentationEnum, } from '@cohesivesystems/presentation-core';
|
|
3
|
+
import { coordinationActionKinds, coordinationTriggerKinds, } from '@cohesivesystems/presentation-contracts';
|
|
4
|
+
/**
|
|
5
|
+
* Reports projection renderer coverage for the document views exposed by the
|
|
6
|
+
* active workspace runtime. The same semantic resolver used for rendering is
|
|
7
|
+
* used here so the developer toolbar reports stale component bindings and
|
|
8
|
+
* unhandled IR projection semantics as actionable frontend TODOs.
|
|
9
|
+
*/
|
|
10
|
+
export function projectDocumentWorkspaceProjectionRendererDiagnostics({ componentSet, module, projectionRenderers, runtime, sourceId = 'document-workspace-projection-renderers', }) {
|
|
11
|
+
return [
|
|
12
|
+
...runtime.projectionViewIds.flatMap((viewId) => projectProjectionRendererDiagnostics({
|
|
13
|
+
componentSet,
|
|
14
|
+
module,
|
|
15
|
+
projectionRenderers,
|
|
16
|
+
runtime,
|
|
17
|
+
sourceId,
|
|
18
|
+
viewId,
|
|
19
|
+
})),
|
|
20
|
+
...projectProjectionCoordinationDiagnostics({
|
|
21
|
+
componentSet,
|
|
22
|
+
module,
|
|
23
|
+
projectionRenderers,
|
|
24
|
+
runtime,
|
|
25
|
+
sourceId,
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function projectProjectionRendererDiagnostics({ componentSet, module, projectionRenderers, runtime, sourceId, viewId, }) {
|
|
30
|
+
const resolution = resolveDocumentWorkspaceProjectionRenderer({
|
|
31
|
+
componentSet,
|
|
32
|
+
module,
|
|
33
|
+
registry: projectionRenderers,
|
|
34
|
+
runtime,
|
|
35
|
+
viewId,
|
|
36
|
+
});
|
|
37
|
+
const projection = resolution.projection;
|
|
38
|
+
if (!projection) {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
details: { viewId },
|
|
42
|
+
id: `document-projection.${viewId}.missing-projection`,
|
|
43
|
+
message: `Document workspace view '${viewId}' does not resolve to a declared ` +
|
|
44
|
+
'document projection.',
|
|
45
|
+
severity: 'warning',
|
|
46
|
+
source: sourceId ?? 'document-workspace-projection-renderers',
|
|
47
|
+
subject: {
|
|
48
|
+
id: viewId,
|
|
49
|
+
kind: 'document-projection-view',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
const diagnostics = [];
|
|
55
|
+
if (!resolution.renderer) {
|
|
56
|
+
diagnostics.push({
|
|
57
|
+
details: createProjectionRendererDiagnosticDetails(resolution, viewId),
|
|
58
|
+
id: `document-projection.${projection.Id}.missing-renderer`,
|
|
59
|
+
message: `Document projection '${projection.Name}' has no frontend renderer binding.`,
|
|
60
|
+
severity: 'warning',
|
|
61
|
+
source: sourceId ?? 'document-workspace-projection-renderers',
|
|
62
|
+
subject: {
|
|
63
|
+
id: projection.Id,
|
|
64
|
+
kind: 'document-projection',
|
|
65
|
+
name: projection.Name,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (resolution.renderer && isCompatibilityRendererSource(resolution.resolutionSource)) {
|
|
70
|
+
diagnostics.push({
|
|
71
|
+
details: createProjectionRendererDiagnosticDetails(resolution, viewId),
|
|
72
|
+
id: `document-projection.${projection.Id}.semantic-renderer-fallback`,
|
|
73
|
+
category: resolution.componentRole ? 'unbound' : 'missing-binding',
|
|
74
|
+
interpretation: {
|
|
75
|
+
status: resolution.componentRole ? 'unbound' : 'locally-interpreted',
|
|
76
|
+
target: 'document-projection-component-role',
|
|
77
|
+
},
|
|
78
|
+
message: resolution.componentRole
|
|
79
|
+
? `Document projection '${projection.Name}' declares component role ` +
|
|
80
|
+
`'${resolution.componentRole}', but rendering fell back to ` +
|
|
81
|
+
`'${resolution.resolutionSource}'.`
|
|
82
|
+
: `Document projection '${projection.Name}' rendered through ` +
|
|
83
|
+
`'${resolution.resolutionSource}' because it has no ProjectionRenderer ` +
|
|
84
|
+
'target component role binding.',
|
|
85
|
+
severity: 'warning',
|
|
86
|
+
source: sourceId ?? 'document-workspace-projection-renderers',
|
|
87
|
+
suggestedNextStep: resolution.componentRole
|
|
88
|
+
? `Bind frontend component role '${resolution.componentRole}' in the document projection component pack.`
|
|
89
|
+
: 'Declare a ProjectionRenderer target binding with ComponentRole for this projection and bind that role in the frontend component pack.',
|
|
90
|
+
subject: {
|
|
91
|
+
id: projection.Id,
|
|
92
|
+
kind: 'document-projection',
|
|
93
|
+
name: projection.Name,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (resolution.renderer &&
|
|
98
|
+
resolution.componentKey &&
|
|
99
|
+
resolution.resolutionSource === 'component-key') {
|
|
100
|
+
diagnostics.push({
|
|
101
|
+
category: 'escape-hatch',
|
|
102
|
+
details: createProjectionRendererDiagnosticDetails(resolution, viewId),
|
|
103
|
+
id: `document-projection.${projection.Id}.component-key-escape-hatch`,
|
|
104
|
+
interpretation: {
|
|
105
|
+
status: 'escape-hatch',
|
|
106
|
+
target: 'document-projection-component-key',
|
|
107
|
+
},
|
|
108
|
+
message: `Document projection '${projection.Name}' rendered through concrete ` +
|
|
109
|
+
`component key '${resolution.componentKey}' as an escape hatch.`,
|
|
110
|
+
severity: 'warning',
|
|
111
|
+
source: sourceId ?? 'document-workspace-projection-renderers',
|
|
112
|
+
suggestedNextStep: 'Prefer ComponentRole for document projections and keep ComponentKey only for adapter-specific overrides.',
|
|
113
|
+
subject: {
|
|
114
|
+
id: projection.Id,
|
|
115
|
+
kind: 'document-projection',
|
|
116
|
+
name: projection.Name,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (resolution.rendererKey) {
|
|
121
|
+
diagnostics.push({
|
|
122
|
+
category: 'escape-hatch',
|
|
123
|
+
details: createProjectionRendererDiagnosticDetails(resolution, viewId),
|
|
124
|
+
id: `document-projection.${projection.Id}.legacy-renderer-key`,
|
|
125
|
+
interpretation: {
|
|
126
|
+
status: 'escape-hatch',
|
|
127
|
+
target: 'document-projection-component-role',
|
|
128
|
+
},
|
|
129
|
+
message: `Document projection '${projection.Name}' declares renderer key ` +
|
|
130
|
+
`'${resolution.rendererKey}'. Document projection dispatch now uses ` +
|
|
131
|
+
'ProjectionRenderer target component roles and semantic projection interpretation.',
|
|
132
|
+
severity: 'warning',
|
|
133
|
+
source: sourceId ?? 'document-workspace-projection-renderers',
|
|
134
|
+
suggestedNextStep: 'Replace the renderer key with a ProjectionRenderer target binding that declares ComponentRole.',
|
|
135
|
+
subject: {
|
|
136
|
+
id: projection.Id,
|
|
137
|
+
kind: 'document-projection',
|
|
138
|
+
name: projection.Name,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return diagnostics;
|
|
143
|
+
}
|
|
144
|
+
function isCompatibilityRendererSource(source) {
|
|
145
|
+
return source === 'projection-kind' ||
|
|
146
|
+
source === 'semantic-reference-kind' ||
|
|
147
|
+
source === 'subject-kind';
|
|
148
|
+
}
|
|
149
|
+
function projectProjectionCoordinationDiagnostics({ componentSet, module, projectionRenderers, runtime, sourceId = 'document-workspace-projection-renderers', }) {
|
|
150
|
+
const revealTargetProjectionIds = new Set(runtime.documentProfile.Coordination
|
|
151
|
+
.filter((coordination) => matchesPresentationEnum(coordination.Trigger.Kind, selectionChangedTriggerKind) &&
|
|
152
|
+
matchesPresentationEnum(coordination.Action.Kind, revealSemanticSelectionActionKind))
|
|
153
|
+
.flatMap((coordination) => coordination.Action.TargetProjectionIds));
|
|
154
|
+
return [...revealTargetProjectionIds].flatMap((projectionId) => {
|
|
155
|
+
const projection = runtime.projections.find((candidate) => candidate.Id === projectionId);
|
|
156
|
+
if (!projection) {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
const hasRevealCapability = resolveDocumentWorkspaceProjectionCapability({
|
|
160
|
+
capability: 'revealSemanticSelection',
|
|
161
|
+
componentSet,
|
|
162
|
+
module,
|
|
163
|
+
projection,
|
|
164
|
+
registry: projectionRenderers,
|
|
165
|
+
});
|
|
166
|
+
if (hasRevealCapability) {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
details: {
|
|
172
|
+
coordinationActionKind: 'RevealSemanticSelection',
|
|
173
|
+
projectionKind: projection.Kind,
|
|
174
|
+
semanticReferenceKind: projection.Coordinates?.SemanticReferenceKind ?? null,
|
|
175
|
+
subjectKind: projection.Subject.Kind,
|
|
176
|
+
viewId: projection.ViewId,
|
|
177
|
+
},
|
|
178
|
+
id: `document-projection.${projection.Id}.missing-reveal-semantic-selection`,
|
|
179
|
+
message: `Document projection '${projection.Name}' is targeted by semantic ` +
|
|
180
|
+
'selection reveal coordination, but this frontend adapter has not ' +
|
|
181
|
+
'declared a reveal interpretation for it.',
|
|
182
|
+
severity: 'warning',
|
|
183
|
+
source: sourceId,
|
|
184
|
+
subject: {
|
|
185
|
+
id: projection.Id,
|
|
186
|
+
kind: 'document-projection',
|
|
187
|
+
name: projection.Name,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function createProjectionRendererDiagnosticDetails(resolution, viewId) {
|
|
194
|
+
return {
|
|
195
|
+
componentKey: resolution.componentKey,
|
|
196
|
+
componentRole: resolution.componentRole,
|
|
197
|
+
projectionKind: resolution.projection?.Kind ?? null,
|
|
198
|
+
rendererKey: resolution.rendererKey,
|
|
199
|
+
resolutionSource: resolution.resolutionSource,
|
|
200
|
+
semanticReferenceKind: resolution.projection?.Coordinates?.SemanticReferenceKind ?? null,
|
|
201
|
+
subjectKind: resolution.projection?.Subject.Kind ?? null,
|
|
202
|
+
viewId,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const selectionChangedTriggerKind = createPresentationEnumDiscriminator(coordinationTriggerKinds, 'selectionChanged', 'SelectionChanged');
|
|
206
|
+
const revealSemanticSelectionActionKind = createPresentationEnumDiscriminator(coordinationActionKinds, 'revealSemanticSelection', 'RevealSemanticSelection');
|
|
207
|
+
//# sourceMappingURL=projected-document-workspace-projection-renderer-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-document-workspace-projection-renderer-diagnostics.js","sourceRoot":"","sources":["../src/projected-document-workspace-projection-renderer-diagnostics.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,4CAA4C,EAC5C,0CAA0C,GAC3C,MAAM,8BAA8B,CAAA;AAIrC,OAAO,EACL,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,yCAAyC,CAAA;AAkBhD;;;;;GAKG;AACH,MAAM,UAAU,qDAAqD,CAInE,EACA,YAAY,EACZ,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,QAAQ,GAAG,yCAAyC,GAKrD;IACC,OAAO;QACL,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAC9C,oCAAoC,CAAC;YACnC,YAAY;YACZ,MAAM;YACN,mBAAmB;YACnB,OAAO;YACP,QAAQ;YACR,MAAM;SACP,CAAC,CACH;QACD,GAAG,wCAAwC,CAAC;YAC1C,YAAY;YACZ,MAAM;YACN,mBAAmB;YACnB,OAAO;YACP,QAAQ;SACT,CAAC;KACH,CAAA;AACH,CAAC;AAED,SAAS,oCAAoC,CAI3C,EACA,YAAY,EACZ,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,QAAQ,EACR,MAAM,GAOP;IACC,MAAM,UAAU,GAAG,0CAA0C,CAAC;QAC5D,YAAY;QACZ,MAAM;QACN,QAAQ,EAAE,mBAAmB;QAC7B,OAAO;QACP,MAAM;KACP,CAAC,CAAA;IACF,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;IAExC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;YACL;gBACE,OAAO,EAAE,EAAE,MAAM,EAAE;gBACnB,EAAE,EAAE,uBAAuB,MAAM,qBAAqB;gBACtD,OAAO,EACL,4BAA4B,M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Ac;IAEd,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,cAAc,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,IAAI,IAAI;QACnD,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;QAC7C,qBAAqB,EAAE,UAAU,CAAC,UAAU,EAAE,WAAW,EAAE,qBAAqB,IAAI,IAAI;QACxF,WAAW,EAAE,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;QACxD,MAAM;KACP,CAAA;AACH,CAAC;AAED,MAAM,2BAA2B,GAAG,mCAAmC,CACrE,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,CACnB,CAAA;AAED,MAAM,iCAAiC,GAAG,mCAAmC,CAC3E,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,CAC1B,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PresentationModuleDefinition } from '@cohesivesystems/presentation-core';
|
|
2
|
+
import { type PresentationProjectionDiagnostic } from '@cohesivesystems/presentation-core';
|
|
3
|
+
import type { DocumentWorkspaceRuntimeSnapshot } from './document-workspace-runtime.js';
|
|
4
|
+
export interface ProjectDocumentWorkspaceRuntimeBindingDiagnosticsOptions {
|
|
5
|
+
readonly componentSet?: string | null;
|
|
6
|
+
readonly module: PresentationModuleDefinition | null;
|
|
7
|
+
readonly runtime: DocumentWorkspaceRuntimeSnapshot;
|
|
8
|
+
readonly sourceId?: string;
|
|
9
|
+
readonly supportedComponentRoles?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reports whether the backend WorkspaceRuntime target binding is projected as
|
|
13
|
+
* a semantic component role that this frontend document workspace host
|
|
14
|
+
* interprets. The host still mounts the runtime locally, but this diagnostic
|
|
15
|
+
* keeps the target binding honest and prevents concrete ComponentKey bindings
|
|
16
|
+
* from quietly lingering.
|
|
17
|
+
*/
|
|
18
|
+
export declare function projectDocumentWorkspaceRuntimeBindingDiagnostics({ componentSet, module, runtime, sourceId, supportedComponentRoles, }: ProjectDocumentWorkspaceRuntimeBindingDiagnosticsOptions): readonly PresentationProjectionDiagnostic[];
|
|
19
|
+
//# sourceMappingURL=projected-document-workspace-runtime-binding-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-document-workspace-runtime-binding-diagnostics.d.ts","sourceRoot":"","sources":["../src/projected-document-workspace-runtime-binding-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC7B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,oCAAoC,CAAA;AAK3C,OAAO,KAAK,EACV,gCAAgC,EACjC,MAAM,8BAA8B,CAAA;AASrC,MAAM,WAAW,wDAAwD;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI,CAAA;IACpD,QAAQ,CAAC,OAAO,EAAE,gCAAgC,CAAA;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACrD;AAMD;;;;;;GAMG;AACH,wBAAgB,iDAAiD,CAAC,EAChE,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAA+C,EAC/C,uBAAuE,GACxE,EAAE,wDAAwD,GAAG,SAAS,gCAAgC,EAAE,CA8GxG"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createPresentationProjectionDiagnostic, } from '@cohesivesystems/presentation-core';
|
|
2
|
+
import { createPresentationEnumDiscriminator, findPresentationComponentBinding, } from '@cohesivesystems/presentation-core';
|
|
3
|
+
import { workspaceRuntimeComponentRoles, } from '@cohesivesystems/presentation-contracts';
|
|
4
|
+
import { presentationBindingKinds, presentationTargetKinds, } from '@cohesivesystems/presentation-contracts';
|
|
5
|
+
const defaultSupportedDocumentWorkspaceRuntimeRoles = [
|
|
6
|
+
workspaceRuntimeComponentRoles.documentWorkspace,
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Reports whether the backend WorkspaceRuntime target binding is projected as
|
|
10
|
+
* a semantic component role that this frontend document workspace host
|
|
11
|
+
* interprets. The host still mounts the runtime locally, but this diagnostic
|
|
12
|
+
* keeps the target binding honest and prevents concrete ComponentKey bindings
|
|
13
|
+
* from quietly lingering.
|
|
14
|
+
*/
|
|
15
|
+
export function projectDocumentWorkspaceRuntimeBindingDiagnostics({ componentSet, module, runtime, sourceId = 'document-workspace-runtime-binding', supportedComponentRoles = defaultSupportedDocumentWorkspaceRuntimeRoles, }) {
|
|
16
|
+
if (!module) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const binding = findPresentationComponentBinding(module, {
|
|
20
|
+
bindingKind: createPresentationEnumDiscriminator(presentationBindingKinds, 'workspaceRuntime', 'WorkspaceRuntime'),
|
|
21
|
+
componentSet,
|
|
22
|
+
id: runtime.workspace.Id,
|
|
23
|
+
targetKind: createPresentationEnumDiscriminator(presentationTargetKinds, 'react', 'React'),
|
|
24
|
+
});
|
|
25
|
+
const componentKey = binding?.ComponentKey ?? null;
|
|
26
|
+
const componentRole = binding?.ComponentRole ?? null;
|
|
27
|
+
const supportedRoleSet = new Set(supportedComponentRoles);
|
|
28
|
+
const diagnostics = [];
|
|
29
|
+
if (!binding) {
|
|
30
|
+
diagnostics.push(createWorkspaceRuntimeDiagnostic({
|
|
31
|
+
category: 'missing-binding',
|
|
32
|
+
componentKey,
|
|
33
|
+
componentRole,
|
|
34
|
+
idSuffix: 'missing-binding',
|
|
35
|
+
message: `Document workspace '${runtime.workspace.Id}' has no WorkspaceRuntime ` +
|
|
36
|
+
'target binding for the active frontend target.',
|
|
37
|
+
severity: 'warning',
|
|
38
|
+
sourceId,
|
|
39
|
+
status: 'unbound',
|
|
40
|
+
suggestedNextStep: 'Declare a WorkspaceRuntime target binding with ComponentRole for this document workspace.',
|
|
41
|
+
runtime,
|
|
42
|
+
}));
|
|
43
|
+
return diagnostics;
|
|
44
|
+
}
|
|
45
|
+
if (componentKey) {
|
|
46
|
+
diagnostics.push(createWorkspaceRuntimeDiagnostic({
|
|
47
|
+
category: 'escape-hatch',
|
|
48
|
+
componentKey,
|
|
49
|
+
componentRole,
|
|
50
|
+
idSuffix: 'component-key-escape-hatch',
|
|
51
|
+
message: `Document workspace '${runtime.workspace.Id}' declares concrete ` +
|
|
52
|
+
`workspace runtime component key '${componentKey}'.`,
|
|
53
|
+
severity: 'warning',
|
|
54
|
+
sourceId,
|
|
55
|
+
status: 'escape-hatch',
|
|
56
|
+
suggestedNextStep: 'Use WorkspaceRuntime ComponentRole for document workspace runtimes and reserve ComponentKey for adapter-specific overrides.',
|
|
57
|
+
runtime,
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
if (!componentRole) {
|
|
61
|
+
diagnostics.push(createWorkspaceRuntimeDiagnostic({
|
|
62
|
+
category: 'missing-binding',
|
|
63
|
+
componentKey,
|
|
64
|
+
componentRole,
|
|
65
|
+
idSuffix: 'missing-component-role',
|
|
66
|
+
message: `Document workspace '${runtime.workspace.Id}' WorkspaceRuntime binding ` +
|
|
67
|
+
'does not declare a component role.',
|
|
68
|
+
severity: 'warning',
|
|
69
|
+
sourceId,
|
|
70
|
+
status: 'unbound',
|
|
71
|
+
suggestedNextStep: `Set ComponentRole to '${workspaceRuntimeComponentRoles.documentWorkspace}'.`,
|
|
72
|
+
runtime,
|
|
73
|
+
}));
|
|
74
|
+
return diagnostics;
|
|
75
|
+
}
|
|
76
|
+
const isSupportedRole = supportedRoleSet.has(componentRole);
|
|
77
|
+
diagnostics.push(createWorkspaceRuntimeDiagnostic({
|
|
78
|
+
category: isSupportedRole ? 'local-interpretation' : 'missing-binding',
|
|
79
|
+
componentKey,
|
|
80
|
+
componentRole,
|
|
81
|
+
idSuffix: 'component-role-coverage',
|
|
82
|
+
message: isSupportedRole
|
|
83
|
+
? `Document workspace '${runtime.workspace.Id}' WorkspaceRuntime role ` +
|
|
84
|
+
`'${componentRole}' is interpreted by the local document workspace host.`
|
|
85
|
+
: `Document workspace '${runtime.workspace.Id}' WorkspaceRuntime role ` +
|
|
86
|
+
`'${componentRole}' is not interpreted by the local document workspace host.`,
|
|
87
|
+
severity: isSupportedRole ? 'info' : 'warning',
|
|
88
|
+
sourceId,
|
|
89
|
+
status: isSupportedRole ? 'locally-interpreted' : 'unbound',
|
|
90
|
+
suggestedNextStep: isSupportedRole
|
|
91
|
+
? undefined
|
|
92
|
+
: 'Bind this WorkspaceRuntime component role in the frontend document workspace host adapter.',
|
|
93
|
+
runtime,
|
|
94
|
+
}));
|
|
95
|
+
return diagnostics;
|
|
96
|
+
}
|
|
97
|
+
function createWorkspaceRuntimeDiagnostic({ category, componentKey, componentRole, idSuffix, message, runtime, severity, sourceId, status, suggestedNextStep, }) {
|
|
98
|
+
return createPresentationProjectionDiagnostic({
|
|
99
|
+
category,
|
|
100
|
+
details: {
|
|
101
|
+
componentKey,
|
|
102
|
+
componentRole,
|
|
103
|
+
documentProfileId: runtime.documentProfile.Id,
|
|
104
|
+
pageViewId: runtime.pageView.Id,
|
|
105
|
+
workspaceId: runtime.workspace.Id,
|
|
106
|
+
workspaceViewId: runtime.workspaceView.Id,
|
|
107
|
+
},
|
|
108
|
+
id: `document-workspace-runtime.${runtime.workspace.Id}.${idSuffix}`,
|
|
109
|
+
interpretation: {
|
|
110
|
+
status,
|
|
111
|
+
target: 'workspace-runtime-component-role',
|
|
112
|
+
},
|
|
113
|
+
message,
|
|
114
|
+
severity,
|
|
115
|
+
source: sourceId,
|
|
116
|
+
subject: {
|
|
117
|
+
id: runtime.workspace.Id,
|
|
118
|
+
kind: 'document-workspace-runtime',
|
|
119
|
+
name: runtime.workspace.Name,
|
|
120
|
+
},
|
|
121
|
+
suggestedNextStep,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=projected-document-workspace-runtime-binding-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-document-workspace-runtime-binding-diagnostics.js","sourceRoot":"","sources":["../src/projected-document-workspace-runtime-binding-diagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,sCAAsC,GAEvC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,mCAAmC,EACnC,gCAAgC,GACjC,MAAM,oCAAoC,CAAA;AAI3C,OAAO,EACL,8BAA8B,GAC/B,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,yCAAyC,CAAA;AAUhD,MAAM,6CAA6C,GAAG;IACpD,8BAA8B,CAAC,iBAAiB;CACxC,CAAA;AAEV;;;;;;GAMG;AACH,MAAM,UAAU,iDAAiD,CAAC,EAChE,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,GAAG,oCAAoC,EAC/C,uBAAuB,GAAG,6CAA6C,GACd;IACzD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,OAAO,GAAG,gCAAgC,CAAC,MAAM,EAAE;QACvD,WAAW,EAAE,mCAAmC,CAC9C,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,CACnB;QACD,YAAY;QACZ,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE;QACxB,UAAU,EAAE,mCAAmC,CAC7C,uBAAuB,EACvB,OAAO,EACP,OAAO,CACR;KACF,CAAC,CAAA;IACF,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAA;IAClD,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,IAAI,CAAA;IACpD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,uBAAuB,CA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B,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,QAAQ,EAAE;QACpE,cAAc,EAAE;YACd,MAAM;YACN,MAAM,EAAE,kCAAkC;SAC3C;QACD,OAAO;QACP,QAAQ;QACR,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE;YACP,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,EAAE,4BAA4B;YAClC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI;SAC7B;QACD,iBAAiB;KAClB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Context, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type NavigationDefinitionProjection, type PresentationNavigationRuntime } from '@cohesivesystems/presentation-core';
|
|
3
|
+
export interface ProjectedNavigationContextValue<TNavigation extends NavigationDefinitionProjection = NavigationDefinitionProjection> extends PresentationNavigationRuntime {
|
|
4
|
+
readonly navigation: TNavigation | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ProjectedNavigationProviderProps<TNavigation extends NavigationDefinitionProjection> extends PropsWithChildren {
|
|
7
|
+
readonly context?: Context<ProjectedNavigationContextValue<TNavigation>>;
|
|
8
|
+
readonly navigation: TNavigation | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generic React binding for semantic navigation definitions. App-specific
|
|
12
|
+
* navigation contexts can be layered on top, but href creation and route
|
|
13
|
+
* execution stay owned by the presentation projection runtime.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ProjectedNavigationProvider<TNavigation extends NavigationDefinitionProjection>({ children, context, navigation, }: ProjectedNavigationProviderProps<TNavigation>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=projected-navigation-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-navigation-provider.d.ts","sourceRoot":"","sources":["../src/projected-navigation-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGlF,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,oCAAoC,CAAA;AAK3C,MAAM,WAAW,+BAA+B,CAAC,WAAW,SAAS,8BAA8B,GAAG,8BAA8B,CAAE,SAAQ,6BAA6B;IACzK,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAA;CACxC;AAED,MAAM,WAAW,gCAAgC,CAC/C,WAAW,SAAS,8BAA8B,CAClD,SAAQ,iBAAiB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,WAAW,CAAC,CAAC,CAAA;IACxE,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAA;CACxC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,SAAS,8BAA8B,EAClD,EACA,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,gCAAgC,CAAC,WAAW,CAAC,2CAwD/C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { useNavigate, useResolvedPath } from 'react-router';
|
|
4
|
+
import { createNavigationHref, } from '@cohesivesystems/presentation-core';
|
|
5
|
+
import { PresentationNavigationRuntimeContext, } from './navigation-runtime-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* Generic React binding for semantic navigation definitions. App-specific
|
|
8
|
+
* navigation contexts can be layered on top, but href creation and route
|
|
9
|
+
* execution stay owned by the presentation projection runtime.
|
|
10
|
+
*/
|
|
11
|
+
export function ProjectedNavigationProvider({ children, context, navigation, }) {
|
|
12
|
+
const navigate = useNavigate();
|
|
13
|
+
const rootPath = useResolvedPath('/');
|
|
14
|
+
const createHref = useCallback((routeId, parameters) => navigation ? createNavigationHref(navigation, routeId, parameters) : null, [navigation]);
|
|
15
|
+
const navigateHref = useCallback((href) => {
|
|
16
|
+
if (href.length > 0) {
|
|
17
|
+
void navigate(toRootRelativeHref(href, rootPath.pathname), {
|
|
18
|
+
flushSync: true,
|
|
19
|
+
relative: 'path',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}, [navigate, rootPath.pathname]);
|
|
23
|
+
const navigateRoute = useCallback((routeId, parameters) => {
|
|
24
|
+
const href = createHref(routeId, parameters);
|
|
25
|
+
if (href) {
|
|
26
|
+
navigateHref(href);
|
|
27
|
+
}
|
|
28
|
+
}, [createHref, navigateHref]);
|
|
29
|
+
const runtime = useMemo(() => ({
|
|
30
|
+
createHref,
|
|
31
|
+
navigateHref,
|
|
32
|
+
navigateRoute,
|
|
33
|
+
}), [createHref, navigateHref, navigateRoute]);
|
|
34
|
+
const contextValue = useMemo(() => ({
|
|
35
|
+
...runtime,
|
|
36
|
+
navigation,
|
|
37
|
+
}), [navigation, runtime]);
|
|
38
|
+
const ApplicationNavigationContext = context;
|
|
39
|
+
return (_jsx(PresentationNavigationRuntimeContext.Provider, { value: runtime, children: ApplicationNavigationContext ? (_jsx(ApplicationNavigationContext.Provider, { value: contextValue, children: children })) : (children) }));
|
|
40
|
+
}
|
|
41
|
+
function toRootRelativeHref(href, rootPathname) {
|
|
42
|
+
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(href) || href.startsWith('//')) {
|
|
43
|
+
return href;
|
|
44
|
+
}
|
|
45
|
+
if (href.startsWith('/')) {
|
|
46
|
+
return href;
|
|
47
|
+
}
|
|
48
|
+
const root = rootPathname === '/' ? '' : rootPathname.replace(/\/+$/g, '');
|
|
49
|
+
return `${root}/${href.replace(/^\/+/g, '')}`;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=projected-navigation-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-navigation-provider.js","sourceRoot":"","sources":["../src/projected-navigation-provider.tsx"],"names":[],"mappings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inition, FlowStateDefinition, ViewDefinition } from '@cohesivesystems/presentation-core';
|
|
3
|
+
import type { PresentationFlowInstance, PresentationFlowRuntimeSnapshot } from './presentation-flow-runtime.js';
|
|
4
|
+
export interface ProjectedPresentationFlowHostProps {
|
|
5
|
+
readonly fallback?: ReactNode;
|
|
6
|
+
readonly renderView: (context: ProjectedPresentationFlowViewRenderContext) => ReactNode;
|
|
7
|
+
readonly runtime: PresentationFlowRuntimeSnapshot;
|
|
8
|
+
}
|
|
9
|
+
export interface ProjectedPresentationFlowViewRenderContext {
|
|
10
|
+
readonly flow: FlowDefinition;
|
|
11
|
+
readonly instance: PresentationFlowInstance;
|
|
12
|
+
readonly state: FlowStateDefinition;
|
|
13
|
+
readonly view: ViewDefinition;
|
|
14
|
+
}
|
|
15
|
+
export declare function ProjectedPresentationFlowHost({ fallback, renderView, runtime, }: ProjectedPresentationFlowHostProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=projected-presentation-flow-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-presentation-flow-host.d.ts","sourceRoot":"","sources":["../src/projected-presentation-flow-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACf,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,6BAA6B,CAAA;AAEpC,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,0CAA0C,KAAK,SAAS,CAAA;IACvF,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAA;CAClD;AAED,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAA;IAC3C,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAC9B;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,QAAe,EACf,UAAU,EACV,OAAO,GACR,EAAE,kCAAkC,2CAgBpC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function ProjectedPresentationFlowHost({ fallback = null, renderView, runtime, }) {
|
|
3
|
+
const { activeFlow, activeInstance, activeState, activeView } = runtime;
|
|
4
|
+
if (!activeFlow || !activeInstance || !activeState || !activeView) {
|
|
5
|
+
return _jsx(_Fragment, { children: fallback });
|
|
6
|
+
}
|
|
7
|
+
return (_jsx(_Fragment, { children: renderView({
|
|
8
|
+
flow: activeFlow,
|
|
9
|
+
instance: activeInstance,
|
|
10
|
+
state: activeState,
|
|
11
|
+
view: activeView,
|
|
12
|
+
}) }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=projected-presentation-flow-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-presentation-flow-host.js","sourceRoot":"","sources":["../src/projected-presentation-flow-host.tsx"],"names":[],"mappings":";AAyBA,MAAM,UAAU,6BAA6B,CAAC,EAC5C,QAAQ,GAAG,IAAI,EACf,UAAU,EACV,OAAO,GAC4B;IACnC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IACvE,IAAI,CAAC,UAAU,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU,EAAE,CAAC;QAClE,OAAO,4BAAG,QAAQ,GAAI,CAAA;IACxB,CAAC;IAED,OAAO,CACL,4BACG,UAAU,CAAC;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,cAAc;YACxB,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,UAAU;SACjB,CAAC,GACD,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PresentationQueryFormStateAdapter } from './presentation-query-form-state.js';
|
|
2
|
+
type ProjectedQueryFormValue = Record<string, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* Creates the default frontend interpretation for an IR-declared query form.
|
|
5
|
+
*
|
|
6
|
+
* The adapter derives draft/applied state shape, normalization, and URL state
|
|
7
|
+
* from the query form's backing input-form fields. Targets can still override a
|
|
8
|
+
* query form by registering an adapter with the same query form id.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createProjectedQueryFormStateAdapter(queryFormId: string): PresentationQueryFormStateAdapter<ProjectedQueryFormValue>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=projected-query-form-state-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projected-query-form-state-adapter.d.ts","sourceRoot":"","sources":["../src/projected-query-form-state-adapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iCAAiC,EAElC,MAAM,iCAAiC,CAAA;AA2BxC,KAAK,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAItD;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,MAAM,GAClB,iCAAiC,CAAC,uBAAuB,CAAC,CAwE5D"}
|