@cohesivesystems/presentation-core 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/api-scope-request.d.ts +43 -0
- package/dist/api-scope-request.d.ts.map +1 -0
- package/dist/api-scope-request.js +96 -0
- package/dist/api-scope-request.js.map +1 -0
- package/dist/collection-chrome-icons.d.ts +18 -0
- package/dist/collection-chrome-icons.d.ts.map +1 -0
- package/dist/collection-chrome-icons.js +57 -0
- package/dist/collection-chrome-icons.js.map +1 -0
- package/dist/collection-chrome-runtime.d.ts +25 -0
- package/dist/collection-chrome-runtime.d.ts.map +1 -0
- package/dist/collection-chrome-runtime.js +72 -0
- package/dist/collection-chrome-runtime.js.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts +110 -0
- package/dist/collection-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/collection-chrome-slot-renderer-registry.js +136 -0
- package/dist/collection-chrome-slot-renderer-registry.js.map +1 -0
- package/dist/collection-selection-state.d.ts +18 -0
- package/dist/collection-selection-state.d.ts.map +1 -0
- package/dist/collection-selection-state.js +2 -0
- package/dist/collection-selection-state.js.map +1 -0
- package/dist/data-source-projection.d.ts +475 -0
- package/dist/data-source-projection.d.ts.map +1 -0
- package/dist/data-source-projection.js +880 -0
- package/dist/data-source-projection.js.map +1 -0
- package/dist/data-source-query-lowering.d.ts +35 -0
- package/dist/data-source-query-lowering.d.ts.map +1 -0
- package/dist/data-source-query-lowering.js +104 -0
- package/dist/data-source-query-lowering.js.map +1 -0
- package/dist/date-time-filter-model.d.ts +20 -0
- package/dist/date-time-filter-model.d.ts.map +1 -0
- package/dist/date-time-filter-model.js +115 -0
- package/dist/date-time-filter-model.js.map +1 -0
- package/dist/document-badge-icons.d.ts +4 -0
- package/dist/document-badge-icons.d.ts.map +1 -0
- package/dist/document-badge-icons.js +4 -0
- package/dist/document-badge-icons.js.map +1 -0
- package/dist/document-module.d.ts +268 -0
- package/dist/document-module.d.ts.map +1 -0
- package/dist/document-module.js +347 -0
- package/dist/document-module.js.map +1 -0
- package/dist/document-summary-model.d.ts +2 -0
- package/dist/document-summary-model.d.ts.map +1 -0
- package/dist/document-summary-model.js +2 -0
- package/dist/document-summary-model.js.map +1 -0
- package/dist/document-workspace-chrome-projection.d.ts +18 -0
- package/dist/document-workspace-chrome-projection.d.ts.map +1 -0
- package/dist/document-workspace-chrome-projection.js +35 -0
- package/dist/document-workspace-chrome-projection.js.map +1 -0
- package/dist/document-workspace-surface-slots.d.ts +75 -0
- package/dist/document-workspace-surface-slots.d.ts.map +1 -0
- package/dist/document-workspace-surface-slots.js +268 -0
- package/dist/document-workspace-surface-slots.js.map +1 -0
- package/dist/endpoint-executor.d.ts +62 -0
- package/dist/endpoint-executor.d.ts.map +1 -0
- package/dist/endpoint-executor.js +35 -0
- package/dist/endpoint-executor.js.map +1 -0
- package/dist/field-display-resolution.d.ts +5 -0
- package/dist/field-display-resolution.d.ts.map +1 -0
- package/dist/field-display-resolution.js +50 -0
- package/dist/field-display-resolution.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +48 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +108 -0
- package/dist/module.js.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts +12 -0
- package/dist/navigation-shell-frame-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-frame-renderer-registry.js +29 -0
- package/dist/navigation-shell-frame-renderer-registry.js.map +1 -0
- package/dist/navigation-shell-layout-runtime.d.ts +29 -0
- package/dist/navigation-shell-layout-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-layout-runtime.js +50 -0
- package/dist/navigation-shell-layout-runtime.js.map +1 -0
- package/dist/navigation-shell-region-component-registry.d.ts +96 -0
- package/dist/navigation-shell-region-component-registry.d.ts.map +1 -0
- package/dist/navigation-shell-region-component-registry.js +108 -0
- package/dist/navigation-shell-region-component-registry.js.map +1 -0
- package/dist/navigation-shell-runtime.d.ts +48 -0
- package/dist/navigation-shell-runtime.d.ts.map +1 -0
- package/dist/navigation-shell-runtime.js +457 -0
- package/dist/navigation-shell-runtime.js.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts +15 -0
- package/dist/navigation-shell-slot-renderer-registry.d.ts.map +1 -0
- package/dist/navigation-shell-slot-renderer-registry.js +48 -0
- package/dist/navigation-shell-slot-renderer-registry.js.map +1 -0
- package/dist/navigation.d.ts +84 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +167 -0
- package/dist/navigation.js.map +1 -0
- package/dist/object-path.d.ts +23 -0
- package/dist/object-path.d.ts.map +1 -0
- package/dist/object-path.js +63 -0
- package/dist/object-path.js.map +1 -0
- package/dist/page-host-renderer-registry.d.ts +119 -0
- package/dist/page-host-renderer-registry.d.ts.map +1 -0
- package/dist/page-host-renderer-registry.js +305 -0
- package/dist/page-host-renderer-registry.js.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts +23 -0
- package/dist/presentation-action-endpoint-request-projection.d.ts.map +1 -0
- package/dist/presentation-action-endpoint-request-projection.js +117 -0
- package/dist/presentation-action-endpoint-request-projection.js.map +1 -0
- package/dist/presentation-action-endpoint.d.ts +24 -0
- package/dist/presentation-action-endpoint.d.ts.map +1 -0
- package/dist/presentation-action-endpoint.js +56 -0
- package/dist/presentation-action-endpoint.js.map +1 -0
- package/dist/presentation-action-icons.d.ts +4 -0
- package/dist/presentation-action-icons.d.ts.map +1 -0
- package/dist/presentation-action-icons.js +4 -0
- package/dist/presentation-action-icons.js.map +1 -0
- package/dist/presentation-action-result-state.d.ts +48 -0
- package/dist/presentation-action-result-state.d.ts.map +1 -0
- package/dist/presentation-action-result-state.js +109 -0
- package/dist/presentation-action-result-state.js.map +1 -0
- package/dist/presentation-action-runtime-binding.d.ts +48 -0
- package/dist/presentation-action-runtime-binding.d.ts.map +1 -0
- package/dist/presentation-action-runtime-binding.js +52 -0
- package/dist/presentation-action-runtime-binding.js.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts +18 -0
- package/dist/presentation-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/presentation-action-runtime-diagnostics.js +69 -0
- package/dist/presentation-action-runtime-diagnostics.js.map +1 -0
- package/dist/presentation-action-runtime-labels.d.ts +15 -0
- package/dist/presentation-action-runtime-labels.d.ts.map +1 -0
- package/dist/presentation-action-runtime-labels.js +28 -0
- package/dist/presentation-action-runtime-labels.js.map +1 -0
- package/dist/presentation-action-runtime-projection.d.ts +17 -0
- package/dist/presentation-action-runtime-projection.d.ts.map +1 -0
- package/dist/presentation-action-runtime-projection.js +31 -0
- package/dist/presentation-action-runtime-projection.js.map +1 -0
- package/dist/presentation-badge-resolution.d.ts +8 -0
- package/dist/presentation-badge-resolution.d.ts.map +1 -0
- package/dist/presentation-badge-resolution.js +73 -0
- package/dist/presentation-badge-resolution.js.map +1 -0
- package/dist/presentation-collection-pagination.d.ts +32 -0
- package/dist/presentation-collection-pagination.d.ts.map +1 -0
- package/dist/presentation-collection-pagination.js +275 -0
- package/dist/presentation-collection-pagination.js.map +1 -0
- package/dist/presentation-content-diagnostics.d.ts +17 -0
- package/dist/presentation-content-diagnostics.d.ts.map +1 -0
- package/dist/presentation-content-diagnostics.js +61 -0
- package/dist/presentation-content-diagnostics.js.map +1 -0
- package/dist/presentation-content-resolution.d.ts +9 -0
- package/dist/presentation-content-resolution.d.ts.map +1 -0
- package/dist/presentation-content-resolution.js +19 -0
- package/dist/presentation-content-resolution.js.map +1 -0
- package/dist/presentation-data-source-binding-model.d.ts +81 -0
- package/dist/presentation-data-source-binding-model.d.ts.map +1 -0
- package/dist/presentation-data-source-binding-model.js +56 -0
- package/dist/presentation-data-source-binding-model.js.map +1 -0
- package/dist/presentation-data-source-runtime.d.ts +62 -0
- package/dist/presentation-data-source-runtime.d.ts.map +1 -0
- package/dist/presentation-data-source-runtime.js +80 -0
- package/dist/presentation-data-source-runtime.js.map +1 -0
- package/dist/presentation-design-intent-diagnostics.d.ts +25 -0
- package/dist/presentation-design-intent-diagnostics.d.ts.map +1 -0
- package/dist/presentation-design-intent-diagnostics.js +55 -0
- package/dist/presentation-design-intent-diagnostics.js.map +1 -0
- package/dist/presentation-icon-diagnostics.d.ts +45 -0
- package/dist/presentation-icon-diagnostics.d.ts.map +1 -0
- package/dist/presentation-icon-diagnostics.js +235 -0
- package/dist/presentation-icon-diagnostics.js.map +1 -0
- package/dist/presentation-icon-registry.d.ts +36 -0
- package/dist/presentation-icon-registry.d.ts.map +1 -0
- package/dist/presentation-icon-registry.js +81 -0
- package/dist/presentation-icon-registry.js.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts +13 -0
- package/dist/presentation-navigation-action-runtime-bindings.d.ts.map +1 -0
- package/dist/presentation-navigation-action-runtime-bindings.js +29 -0
- package/dist/presentation-navigation-action-runtime-bindings.js.map +1 -0
- package/dist/presentation-pagination.d.ts +98 -0
- package/dist/presentation-pagination.d.ts.map +1 -0
- package/dist/presentation-pagination.js +427 -0
- package/dist/presentation-pagination.js.map +1 -0
- package/dist/presentation-projection-coverage.d.ts +38 -0
- package/dist/presentation-projection-coverage.d.ts.map +1 -0
- package/dist/presentation-projection-coverage.js +2429 -0
- package/dist/presentation-projection-coverage.js.map +1 -0
- package/dist/presentation-projection-diagnostics.d.ts +33 -0
- package/dist/presentation-projection-diagnostics.d.ts.map +1 -0
- package/dist/presentation-projection-diagnostics.js +17 -0
- package/dist/presentation-projection-diagnostics.js.map +1 -0
- package/dist/presentation-projection-trace.d.ts +97 -0
- package/dist/presentation-projection-trace.d.ts.map +1 -0
- package/dist/presentation-projection-trace.js +110 -0
- package/dist/presentation-projection-trace.js.map +1 -0
- package/dist/presentation-query-form-state.d.ts +15 -0
- package/dist/presentation-query-form-state.d.ts.map +1 -0
- package/dist/presentation-query-form-state.js +20 -0
- package/dist/presentation-query-form-state.js.map +1 -0
- package/dist/presentation-renderer-registry.d.ts +86 -0
- package/dist/presentation-renderer-registry.d.ts.map +1 -0
- package/dist/presentation-renderer-registry.js +108 -0
- package/dist/presentation-renderer-registry.js.map +1 -0
- package/dist/presentation-semantics.d.ts +288 -0
- package/dist/presentation-semantics.d.ts.map +1 -0
- package/dist/presentation-semantics.js +560 -0
- package/dist/presentation-semantics.js.map +1 -0
- package/dist/presentation-standards.d.ts +8 -0
- package/dist/presentation-standards.d.ts.map +1 -0
- package/dist/presentation-standards.js +9 -0
- package/dist/presentation-standards.js.map +1 -0
- package/dist/presentation-test-selectors.d.ts +146 -0
- package/dist/presentation-test-selectors.d.ts.map +1 -0
- package/dist/presentation-test-selectors.js +113 -0
- package/dist/presentation-test-selectors.js.map +1 -0
- package/dist/presentation-value-formatting.d.ts +12 -0
- package/dist/presentation-value-formatting.d.ts.map +1 -0
- package/dist/presentation-value-formatting.js +33 -0
- package/dist/presentation-value-formatting.js.map +1 -0
- package/dist/presentation-value-resolution.d.ts +7 -0
- package/dist/presentation-value-resolution.d.ts.map +1 -0
- package/dist/presentation-value-resolution.js +69 -0
- package/dist/presentation-value-resolution.js.map +1 -0
- package/dist/presentation-view-tree.d.ts +6 -0
- package/dist/presentation-view-tree.d.ts.map +1 -0
- package/dist/presentation-view-tree.js +15 -0
- package/dist/presentation-view-tree.js.map +1 -0
- package/dist/process-task-model.d.ts +80 -0
- package/dist/process-task-model.d.ts.map +1 -0
- package/dist/process-task-model.js +52 -0
- package/dist/process-task-model.js.map +1 -0
- package/dist/process-task-projection.d.ts +46 -0
- package/dist/process-task-projection.d.ts.map +1 -0
- package/dist/process-task-projection.js +233 -0
- package/dist/process-task-projection.js.map +1 -0
- package/dist/projected-action-status-projection.d.ts +18 -0
- package/dist/projected-action-status-projection.d.ts.map +1 -0
- package/dist/projected-action-status-projection.js +19 -0
- package/dist/projected-action-status-projection.js.map +1 -0
- package/dist/projected-activity-state-model.d.ts +22 -0
- package/dist/projected-activity-state-model.d.ts.map +1 -0
- package/dist/projected-activity-state-model.js +87 -0
- package/dist/projected-activity-state-model.js.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts +12 -0
- package/dist/projected-collection-action-runtime-bindings.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-bindings.js +37 -0
- package/dist/projected-collection-action-runtime-bindings.js.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts +23 -0
- package/dist/projected-collection-action-runtime-diagnostics.d.ts.map +1 -0
- package/dist/projected-collection-action-runtime-diagnostics.js +168 -0
- package/dist/projected-collection-action-runtime-diagnostics.js.map +1 -0
- package/dist/projected-collection-runtime.d.ts +475 -0
- package/dist/projected-collection-runtime.d.ts.map +1 -0
- package/dist/projected-collection-runtime.js +832 -0
- package/dist/projected-collection-runtime.js.map +1 -0
- package/dist/projected-document-action-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-diagnostics.js +113 -0
- package/dist/projected-document-action-diagnostics.js.map +1 -0
- package/dist/projected-document-action-enablements.d.ts +25 -0
- package/dist/projected-document-action-enablements.d.ts.map +1 -0
- package/dist/projected-document-action-enablements.js +38 -0
- package/dist/projected-document-action-enablements.js.map +1 -0
- package/dist/projected-document-action-projection.d.ts +45 -0
- package/dist/projected-document-action-projection.d.ts.map +1 -0
- package/dist/projected-document-action-projection.js +201 -0
- package/dist/projected-document-action-projection.js.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts +16 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js +168 -0
- package/dist/projected-document-action-runtime-profile-diagnostics.js.map +1 -0
- package/dist/projected-document-action-runtime-profile.d.ts +64 -0
- package/dist/projected-document-action-runtime-profile.d.ts.map +1 -0
- package/dist/projected-document-action-runtime-profile.js +33 -0
- package/dist/projected-document-action-runtime-profile.js.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts +10 -0
- package/dist/projected-document-action-status-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-action-status-notice-diagnostics.js +64 -0
- package/dist/projected-document-action-status-notice-diagnostics.js.map +1 -0
- package/dist/projected-document-badge-formatting.d.ts +2 -0
- package/dist/projected-document-badge-formatting.d.ts.map +1 -0
- package/dist/projected-document-badge-formatting.js +7 -0
- package/dist/projected-document-badge-formatting.js.map +1 -0
- package/dist/projected-document-editor-model.d.ts +4 -0
- package/dist/projected-document-editor-model.d.ts.map +1 -0
- package/dist/projected-document-editor-model.js +2 -0
- package/dist/projected-document-editor-model.js.map +1 -0
- package/dist/projected-document-field-navigation.d.ts +72 -0
- package/dist/projected-document-field-navigation.d.ts.map +1 -0
- package/dist/projected-document-field-navigation.js +143 -0
- package/dist/projected-document-field-navigation.js.map +1 -0
- package/dist/projected-document-field-semantics.d.ts +5 -0
- package/dist/projected-document-field-semantics.d.ts.map +1 -0
- package/dist/projected-document-field-semantics.js +16 -0
- package/dist/projected-document-field-semantics.js.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts +69 -0
- package/dist/projected-document-workspace-data-source-bindings.d.ts.map +1 -0
- package/dist/projected-document-workspace-data-source-bindings.js +81 -0
- package/dist/projected-document-workspace-data-source-bindings.js.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts +12 -0
- package/dist/projected-document-workspace-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-document-workspace-notice-diagnostics.js +13 -0
- package/dist/projected-document-workspace-notice-diagnostics.js.map +1 -0
- package/dist/projected-input-form-runtime.d.ts +62 -0
- package/dist/projected-input-form-runtime.d.ts.map +1 -0
- package/dist/projected-input-form-runtime.js +2 -0
- package/dist/projected-input-form-runtime.js.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts +13 -0
- package/dist/projected-process-task-notice-diagnostics.d.ts.map +1 -0
- package/dist/projected-process-task-notice-diagnostics.js +170 -0
- package/dist/projected-process-task-notice-diagnostics.js.map +1 -0
- package/dist/projected-query-form-runtime.d.ts +46 -0
- package/dist/projected-query-form-runtime.d.ts.map +1 -0
- package/dist/projected-query-form-runtime.js +2 -0
- package/dist/projected-query-form-runtime.js.map +1 -0
- package/dist/prompt-document-preview-projection.d.ts +46 -0
- package/dist/prompt-document-preview-projection.d.ts.map +1 -0
- package/dist/prompt-document-preview-projection.js +173 -0
- package/dist/prompt-document-preview-projection.js.map +1 -0
- package/dist/prompt-icons.d.ts +4 -0
- package/dist/prompt-icons.d.ts.map +1 -0
- package/dist/prompt-icons.js +4 -0
- package/dist/prompt-icons.js.map +1 -0
- package/dist/prompt-status-message-resolution.d.ts +18 -0
- package/dist/prompt-status-message-resolution.d.ts.map +1 -0
- package/dist/prompt-status-message-resolution.js +83 -0
- package/dist/prompt-status-message-resolution.js.map +1 -0
- package/dist/query-form-lowering.d.ts +16 -0
- package/dist/query-form-lowering.d.ts.map +1 -0
- package/dist/query-form-lowering.js +38 -0
- package/dist/query-form-lowering.js.map +1 -0
- package/dist/query-form-url-state.d.ts +44 -0
- package/dist/query-form-url-state.d.ts.map +1 -0
- package/dist/query-form-url-state.js +197 -0
- package/dist/query-form-url-state.js.map +1 -0
- package/dist/query-offset-page.d.ts +13 -0
- package/dist/query-offset-page.d.ts.map +1 -0
- package/dist/query-offset-page.js +24 -0
- package/dist/query-offset-page.js.map +1 -0
- package/dist/relation-query-input-form-target.d.ts +10 -0
- package/dist/relation-query-input-form-target.d.ts.map +1 -0
- package/dist/relation-query-input-form-target.js +30 -0
- package/dist/relation-query-input-form-target.js.map +1 -0
- package/dist/scope-selection.d.ts +94 -0
- package/dist/scope-selection.d.ts.map +1 -0
- package/dist/scope-selection.js +95 -0
- package/dist/scope-selection.js.map +1 -0
- package/dist/target-bindings.d.ts +39 -0
- package/dist/target-bindings.d.ts.map +1 -0
- package/dist/target-bindings.js +40 -0
- package/dist/target-bindings.js.map +1 -0
- package/dist/view-chrome-content-diagnostics.d.ts +8 -0
- package/dist/view-chrome-content-diagnostics.d.ts.map +1 -0
- package/dist/view-chrome-content-diagnostics.js +84 -0
- package/dist/view-chrome-content-diagnostics.js.map +1 -0
- package/dist/view-chrome-icons.d.ts +12 -0
- package/dist/view-chrome-icons.d.ts.map +1 -0
- package/dist/view-chrome-icons.js +50 -0
- package/dist/view-chrome-icons.js.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts +19 -0
- package/dist/view-chrome-slot-renderer-registry.d.ts.map +1 -0
- package/dist/view-chrome-slot-renderer-registry.js +62 -0
- package/dist/view-chrome-slot-renderer-registry.js.map +1 -0
- package/package.json +53 -0
- package/src/api-scope-request.ts +186 -0
- package/src/collection-chrome-icons.ts +89 -0
- package/src/collection-chrome-runtime.ts +151 -0
- package/src/collection-chrome-slot-renderer-registry.ts +227 -0
- package/src/collection-selection-state.ts +32 -0
- package/src/data-source-projection.ts +2149 -0
- package/src/data-source-query-lowering.ts +217 -0
- package/src/date-time-filter-model.ts +156 -0
- package/src/document-badge-icons.ts +3 -0
- package/src/document-module.ts +741 -0
- package/src/document-summary-model.ts +1 -0
- package/src/document-workspace-chrome-projection.ts +62 -0
- package/src/document-workspace-surface-slots.ts +458 -0
- package/src/endpoint-executor.ts +122 -0
- package/src/field-display-resolution.ts +99 -0
- package/src/index.ts +104 -0
- package/src/module.ts +281 -0
- package/src/navigation-shell-frame-renderer-registry.ts +65 -0
- package/src/navigation-shell-layout-runtime.ts +124 -0
- package/src/navigation-shell-region-component-registry.ts +242 -0
- package/src/navigation-shell-runtime.ts +579 -0
- package/src/navigation-shell-slot-renderer-registry.ts +94 -0
- package/src/navigation.ts +364 -0
- package/src/object-path.ts +99 -0
- package/src/page-host-renderer-registry.ts +615 -0
- package/src/presentation-action-endpoint-request-projection.ts +223 -0
- package/src/presentation-action-endpoint.ts +130 -0
- package/src/presentation-action-icons.ts +3 -0
- package/src/presentation-action-result-state.ts +189 -0
- package/src/presentation-action-runtime-binding.ts +177 -0
- package/src/presentation-action-runtime-diagnostics.ts +120 -0
- package/src/presentation-action-runtime-labels.ts +57 -0
- package/src/presentation-action-runtime-projection.ts +67 -0
- package/src/presentation-badge-resolution.ts +138 -0
- package/src/presentation-collection-pagination.ts +436 -0
- package/src/presentation-content-diagnostics.ts +121 -0
- package/src/presentation-content-resolution.ts +46 -0
- package/src/presentation-data-source-binding-model.ts +140 -0
- package/src/presentation-data-source-runtime.ts +190 -0
- package/src/presentation-design-intent-diagnostics.ts +104 -0
- package/src/presentation-icon-diagnostics.ts +368 -0
- package/src/presentation-icon-registry.ts +181 -0
- package/src/presentation-navigation-action-runtime-bindings.ts +54 -0
- package/src/presentation-pagination.ts +694 -0
- package/src/presentation-projection-coverage.ts +3257 -0
- package/src/presentation-projection-diagnostics.ts +71 -0
- package/src/presentation-projection-trace.ts +293 -0
- package/src/presentation-query-form-state.ts +54 -0
- package/src/presentation-renderer-registry.ts +269 -0
- package/src/presentation-semantics.ts +1028 -0
- package/src/presentation-standards.ts +14 -0
- package/src/presentation-test-selectors.ts +312 -0
- package/src/presentation-value-formatting.ts +65 -0
- package/src/presentation-value-resolution.ts +100 -0
- package/src/presentation-view-tree.ts +33 -0
- package/src/process-task-model.ts +158 -0
- package/src/process-task-projection.ts +398 -0
- package/src/projected-action-status-projection.ts +43 -0
- package/src/projected-activity-state-model.ts +123 -0
- package/src/projected-collection-action-runtime-bindings.ts +76 -0
- package/src/projected-collection-action-runtime-diagnostics.ts +289 -0
- package/src/projected-collection-runtime.ts +1772 -0
- package/src/projected-document-action-diagnostics.ts +196 -0
- package/src/projected-document-action-enablements.ts +99 -0
- package/src/projected-document-action-projection.ts +464 -0
- package/src/projected-document-action-runtime-profile-diagnostics.ts +250 -0
- package/src/projected-document-action-runtime-profile.ts +133 -0
- package/src/projected-document-action-status-notice-diagnostics.ts +116 -0
- package/src/projected-document-badge-formatting.ts +7 -0
- package/src/projected-document-editor-model.ts +7 -0
- package/src/projected-document-field-navigation.ts +300 -0
- package/src/projected-document-field-semantics.ts +27 -0
- package/src/projected-document-workspace-data-source-bindings.ts +182 -0
- package/src/projected-document-workspace-notice-diagnostics.ts +41 -0
- package/src/projected-input-form-runtime.ts +86 -0
- package/src/projected-process-task-notice-diagnostics.ts +283 -0
- package/src/projected-query-form-runtime.ts +62 -0
- package/src/prompt-document-preview-projection.ts +345 -0
- package/src/prompt-icons.ts +3 -0
- package/src/prompt-status-message-resolution.ts +158 -0
- package/src/query-form-lowering.ts +77 -0
- package/src/query-form-url-state.ts +346 -0
- package/src/query-offset-page.ts +50 -0
- package/src/relation-query-input-form-target.ts +61 -0
- package/src/scope-selection.ts +201 -0
- package/src/target-bindings.ts +123 -0
- package/src/view-chrome-content-diagnostics.ts +139 -0
- package/src/view-chrome-icons.ts +81 -0
- package/src/view-chrome-slot-renderer-registry.ts +128 -0
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pageHostComponentRoles,
|
|
3
|
+
presentationBindingKinds,
|
|
4
|
+
type NavigationRouteDefinition,
|
|
5
|
+
type PageHostDefinition,
|
|
6
|
+
type PresentationBindingDefinition,
|
|
7
|
+
type ViewDefinition,
|
|
8
|
+
type ViewKind,
|
|
9
|
+
viewKindLabels,
|
|
10
|
+
viewKinds,
|
|
11
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
12
|
+
import { getPresentationViewSemanticRole } from './presentation-semantics'
|
|
13
|
+
import {
|
|
14
|
+
createPresentationEnumDiscriminator,
|
|
15
|
+
resolvePresentationComponentBinding,
|
|
16
|
+
type PresentationEnumDiscriminator,
|
|
17
|
+
} from './target-bindings'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Minimal presentation module shape needed to resolve page-host renderer
|
|
21
|
+
* defaults and target bindings. Apps can pass richer generated module types as
|
|
22
|
+
* long as they expose these structural members.
|
|
23
|
+
*/
|
|
24
|
+
export interface PresentationPageHostRendererModuleProjection {
|
|
25
|
+
/** Target adapter bindings, including optional PageHostComponent bindings. */
|
|
26
|
+
readonly Targets?: readonly {
|
|
27
|
+
readonly Bindings: readonly PresentationBindingDefinition[]
|
|
28
|
+
readonly ComponentSet?: string | null
|
|
29
|
+
readonly Target: string | number
|
|
30
|
+
}[]
|
|
31
|
+
|
|
32
|
+
/** Presentation views used to infer semantic roles and view-kind defaults. */
|
|
33
|
+
readonly Views?: readonly ViewDefinition[]
|
|
34
|
+
|
|
35
|
+
/** Workspaces used to distinguish generic workspaces from document workspaces. */
|
|
36
|
+
readonly Workspaces?: readonly {
|
|
37
|
+
readonly DocumentProfiles?: readonly unknown[]
|
|
38
|
+
readonly Id: string
|
|
39
|
+
}[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const presentationPageHostComponentRoles = pageHostComponentRoles
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Ordered registry of page-host renderer overrides and defaults. Resolution
|
|
46
|
+
* prefers semantic page-host shape first: workspace defaults, root-view semantic
|
|
47
|
+
* roles, view kinds, and target-declared component roles. Id and component-key
|
|
48
|
+
* bindings remain available as explicit escape hatches for hosts not yet
|
|
49
|
+
* modeled by first-class IR semantics.
|
|
50
|
+
*/
|
|
51
|
+
export interface PageHostRendererRegistry<TRenderer = unknown> {
|
|
52
|
+
/** Renderers keyed by concrete adapter component keys. */
|
|
53
|
+
readonly byComponentKey?: Readonly<Record<string, TRenderer>>
|
|
54
|
+
|
|
55
|
+
/** Renderers keyed by semantic adapter component roles. */
|
|
56
|
+
readonly byComponentRole?: Readonly<Record<string, TRenderer>>
|
|
57
|
+
|
|
58
|
+
/** Exact page-host id overrides. These win over route and workspace matches. */
|
|
59
|
+
readonly byPageHostId?: Readonly<Record<string, TRenderer>>
|
|
60
|
+
|
|
61
|
+
/** Renderers keyed by semantic role, such as `surface-root`. */
|
|
62
|
+
readonly bySemanticRole?: Readonly<Record<string, TRenderer>>
|
|
63
|
+
|
|
64
|
+
/** Exact route id overrides. Useful when multiple routes share a page host. */
|
|
65
|
+
readonly byRouteId?: Readonly<Record<string, TRenderer>>
|
|
66
|
+
|
|
67
|
+
/** Exact root-view id overrides for page hosts that mount a view. */
|
|
68
|
+
readonly byViewId?: Readonly<Record<string, TRenderer>>
|
|
69
|
+
|
|
70
|
+
/** Renderers keyed by generated `ViewKind` value or compatible string form. */
|
|
71
|
+
readonly byViewKind?: Readonly<Record<string, TRenderer>>
|
|
72
|
+
|
|
73
|
+
/** Exact workspace id overrides for workspace-backed page hosts. */
|
|
74
|
+
readonly byWorkspaceId?: Readonly<Record<string, TRenderer>>
|
|
75
|
+
|
|
76
|
+
/** Last-resort renderer when no explicit or inferred renderer matches. */
|
|
77
|
+
readonly fallback?: TRenderer
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Convenience registry type for apps that use the standard generated
|
|
82
|
+
* navigation, route, and page-host shapes.
|
|
83
|
+
*/
|
|
84
|
+
export type SimplePageHostRendererRegistry<TRenderer = unknown> =
|
|
85
|
+
PageHostRendererRegistry<TRenderer>
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Describes which resolution branch selected a page-host renderer. These
|
|
89
|
+
* values are intentionally stable because projection diagnostics display them.
|
|
90
|
+
*/
|
|
91
|
+
export type PageHostRendererResolutionSource =
|
|
92
|
+
| 'component-key'
|
|
93
|
+
| 'component-role'
|
|
94
|
+
| 'fallback'
|
|
95
|
+
| 'page-host-id'
|
|
96
|
+
| 'route-id'
|
|
97
|
+
| 'semantic-role'
|
|
98
|
+
| 'view-id'
|
|
99
|
+
| 'view-kind'
|
|
100
|
+
| 'workspace-id'
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Result of resolving a page-host renderer. The resolution includes both the
|
|
104
|
+
* selected renderer and the semantic facts used for diagnostics and tracing.
|
|
105
|
+
*/
|
|
106
|
+
export interface PageHostRendererResolution<TRenderer = unknown> {
|
|
107
|
+
/** Effective component key after caller and target bindings are considered. */
|
|
108
|
+
readonly componentKey: string | null
|
|
109
|
+
|
|
110
|
+
/** Effective component role after caller and target bindings are considered. */
|
|
111
|
+
readonly componentRole: string | null
|
|
112
|
+
|
|
113
|
+
/** Renderer selected from the registry, or null when no renderer matched. */
|
|
114
|
+
readonly renderer: TRenderer | null
|
|
115
|
+
|
|
116
|
+
/** Registry branch or target binding source that selected the renderer. */
|
|
117
|
+
readonly resolutionSource: PageHostRendererResolutionSource | null
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Legacy renderer key declared by a target binding, when present. Page-host
|
|
121
|
+
* dispatch no longer consumes renderer keys; this value is retained only so
|
|
122
|
+
* diagnostics can point at unprojected legacy IR.
|
|
123
|
+
*/
|
|
124
|
+
readonly rendererKey: string | null
|
|
125
|
+
|
|
126
|
+
/** Semantic role inferred from the root view, when available. */
|
|
127
|
+
readonly semanticRole: string | null
|
|
128
|
+
|
|
129
|
+
/** Target-binding source that supplied a role, key, or renderer key, when any. */
|
|
130
|
+
readonly targetBindingSource: PageHostTargetBindingSource | null
|
|
131
|
+
|
|
132
|
+
/** Root view mounted by the page host, when the page host references one. */
|
|
133
|
+
readonly view: ViewDefinition | null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Resolves a page-host renderer without rendering it.
|
|
138
|
+
*
|
|
139
|
+
* Resolution order is:
|
|
140
|
+
* semantic role, component role, view kind, component key, explicit id
|
|
141
|
+
* overrides, fallback. Id and component-key branches are treated as escape
|
|
142
|
+
* hatches by diagnostics.
|
|
143
|
+
*/
|
|
144
|
+
export function resolvePageHostRenderer<
|
|
145
|
+
TRenderer,
|
|
146
|
+
TModule extends PresentationPageHostRendererModuleProjection =
|
|
147
|
+
PresentationPageHostRendererModuleProjection,
|
|
148
|
+
TRoute extends NavigationRouteDefinition = NavigationRouteDefinition,
|
|
149
|
+
TPageHost extends PageHostDefinition = PageHostDefinition,
|
|
150
|
+
>({
|
|
151
|
+
componentKey,
|
|
152
|
+
componentRole,
|
|
153
|
+
componentSet,
|
|
154
|
+
module,
|
|
155
|
+
pageHost,
|
|
156
|
+
registry,
|
|
157
|
+
route,
|
|
158
|
+
targetKind,
|
|
159
|
+
}: {
|
|
160
|
+
readonly componentKey?: string | null
|
|
161
|
+
readonly componentRole?: string | null
|
|
162
|
+
readonly componentSet?: string | null
|
|
163
|
+
readonly module: TModule
|
|
164
|
+
readonly pageHost: TPageHost | null
|
|
165
|
+
readonly registry: PageHostRendererRegistry<TRenderer>
|
|
166
|
+
readonly route?: TRoute | null
|
|
167
|
+
readonly targetKind?: PresentationEnumDiscriminator | null
|
|
168
|
+
}): PageHostRendererResolution<TRenderer> {
|
|
169
|
+
const resolvedComponentKey = componentKey ?? null
|
|
170
|
+
const resolvedComponentRole = componentRole ?? null
|
|
171
|
+
const view = findPageHostView(module, pageHost)
|
|
172
|
+
const semanticRole = view ? getPresentationViewSemanticRole(view) : null
|
|
173
|
+
const targetBinding = resolvePageHostTargetRendererBinding({
|
|
174
|
+
componentSet,
|
|
175
|
+
module,
|
|
176
|
+
pageHost,
|
|
177
|
+
route,
|
|
178
|
+
targetKind,
|
|
179
|
+
view,
|
|
180
|
+
})
|
|
181
|
+
const targetRendererKey = targetBinding?.rendererKey ?? null
|
|
182
|
+
const targetComponentKey = targetBinding?.componentKey ?? null
|
|
183
|
+
const targetComponentRole = targetBinding?.componentRole ?? null
|
|
184
|
+
const defaultComponentRole = resolveDefaultPresentationPageHostComponentRole({
|
|
185
|
+
module,
|
|
186
|
+
pageHost,
|
|
187
|
+
view,
|
|
188
|
+
})
|
|
189
|
+
const effectiveComponentKey = resolvedComponentKey ?? targetComponentKey
|
|
190
|
+
const effectiveComponentRole =
|
|
191
|
+
resolvedComponentRole ?? targetComponentRole ?? defaultComponentRole
|
|
192
|
+
const pageHostId = pageHost?.Id
|
|
193
|
+
const routeId = route?.Id
|
|
194
|
+
const workspaceId = pageHost?.Workspace?.WorkspaceId
|
|
195
|
+
const viewId = pageHost?.View?.ViewId
|
|
196
|
+
|
|
197
|
+
if (semanticRole) {
|
|
198
|
+
const renderer = registry.bySemanticRole?.[semanticRole]
|
|
199
|
+
if (renderer !== undefined && renderer !== null) {
|
|
200
|
+
return createResolution<TRenderer>({
|
|
201
|
+
componentKey: effectiveComponentKey,
|
|
202
|
+
componentRole: effectiveComponentRole,
|
|
203
|
+
renderer,
|
|
204
|
+
rendererKey: targetRendererKey,
|
|
205
|
+
resolutionSource: 'semantic-role',
|
|
206
|
+
semanticRole,
|
|
207
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
208
|
+
view,
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (effectiveComponentRole) {
|
|
214
|
+
const renderer = registry.byComponentRole?.[effectiveComponentRole]
|
|
215
|
+
if (renderer !== undefined && renderer !== null) {
|
|
216
|
+
return createResolution<TRenderer>({
|
|
217
|
+
componentKey: effectiveComponentKey,
|
|
218
|
+
componentRole: effectiveComponentRole,
|
|
219
|
+
renderer,
|
|
220
|
+
rendererKey: targetRendererKey,
|
|
221
|
+
resolutionSource: 'component-role',
|
|
222
|
+
semanticRole,
|
|
223
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
224
|
+
view,
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (view) {
|
|
230
|
+
const renderer = findPageHostViewKindRenderer(registry, view)
|
|
231
|
+
if (renderer !== undefined && renderer !== null) {
|
|
232
|
+
return createResolution<TRenderer>({
|
|
233
|
+
componentKey: effectiveComponentKey,
|
|
234
|
+
componentRole: effectiveComponentRole,
|
|
235
|
+
renderer,
|
|
236
|
+
rendererKey: targetRendererKey,
|
|
237
|
+
resolutionSource: 'view-kind',
|
|
238
|
+
semanticRole,
|
|
239
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
240
|
+
view,
|
|
241
|
+
})
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (effectiveComponentKey) {
|
|
246
|
+
const renderer = registry.byComponentKey?.[effectiveComponentKey]
|
|
247
|
+
if (renderer !== undefined && renderer !== null) {
|
|
248
|
+
return createResolution<TRenderer>({
|
|
249
|
+
componentKey: effectiveComponentKey,
|
|
250
|
+
componentRole: effectiveComponentRole,
|
|
251
|
+
renderer,
|
|
252
|
+
rendererKey: targetRendererKey,
|
|
253
|
+
resolutionSource: 'component-key',
|
|
254
|
+
semanticRole,
|
|
255
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
256
|
+
view,
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (pageHostId) {
|
|
262
|
+
const renderer = registry.byPageHostId?.[pageHostId]
|
|
263
|
+
if (renderer !== undefined && renderer !== null) {
|
|
264
|
+
return createResolution<TRenderer>({
|
|
265
|
+
componentKey: effectiveComponentKey,
|
|
266
|
+
componentRole: effectiveComponentRole,
|
|
267
|
+
renderer,
|
|
268
|
+
rendererKey: targetRendererKey,
|
|
269
|
+
resolutionSource: 'page-host-id',
|
|
270
|
+
semanticRole,
|
|
271
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
272
|
+
view,
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (routeId) {
|
|
278
|
+
const renderer = registry.byRouteId?.[routeId]
|
|
279
|
+
if (renderer !== undefined && renderer !== null) {
|
|
280
|
+
return createResolution<TRenderer>({
|
|
281
|
+
componentKey: effectiveComponentKey,
|
|
282
|
+
componentRole: effectiveComponentRole,
|
|
283
|
+
renderer,
|
|
284
|
+
rendererKey: targetRendererKey,
|
|
285
|
+
resolutionSource: 'route-id',
|
|
286
|
+
semanticRole,
|
|
287
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
288
|
+
view,
|
|
289
|
+
})
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (workspaceId) {
|
|
294
|
+
const renderer = registry.byWorkspaceId?.[workspaceId]
|
|
295
|
+
if (renderer !== undefined && renderer !== null) {
|
|
296
|
+
return createResolution<TRenderer>({
|
|
297
|
+
componentKey: effectiveComponentKey,
|
|
298
|
+
componentRole: effectiveComponentRole,
|
|
299
|
+
renderer,
|
|
300
|
+
rendererKey: targetRendererKey,
|
|
301
|
+
resolutionSource: 'workspace-id',
|
|
302
|
+
semanticRole,
|
|
303
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
304
|
+
view,
|
|
305
|
+
})
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (viewId) {
|
|
310
|
+
const renderer = registry.byViewId?.[viewId]
|
|
311
|
+
if (renderer !== undefined && renderer !== null) {
|
|
312
|
+
return createResolution<TRenderer>({
|
|
313
|
+
componentKey: effectiveComponentKey,
|
|
314
|
+
componentRole: effectiveComponentRole,
|
|
315
|
+
renderer,
|
|
316
|
+
rendererKey: targetRendererKey,
|
|
317
|
+
resolutionSource: 'view-id',
|
|
318
|
+
semanticRole,
|
|
319
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
320
|
+
view,
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (registry.fallback !== undefined && registry.fallback !== null) {
|
|
326
|
+
return createResolution<TRenderer>({
|
|
327
|
+
componentKey: effectiveComponentKey,
|
|
328
|
+
componentRole: effectiveComponentRole,
|
|
329
|
+
renderer: registry.fallback,
|
|
330
|
+
rendererKey: targetRendererKey,
|
|
331
|
+
resolutionSource: 'fallback',
|
|
332
|
+
semanticRole,
|
|
333
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
334
|
+
view,
|
|
335
|
+
})
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return createResolution<TRenderer>({
|
|
339
|
+
componentKey: effectiveComponentKey,
|
|
340
|
+
componentRole: effectiveComponentRole,
|
|
341
|
+
renderer: null,
|
|
342
|
+
rendererKey: targetRendererKey,
|
|
343
|
+
resolutionSource: null,
|
|
344
|
+
semanticRole,
|
|
345
|
+
targetBindingSource: targetBinding?.source ?? null,
|
|
346
|
+
view,
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Infers the standard component role for a page host from its workspace and
|
|
352
|
+
* root view semantics. Target bindings can override this when a host needs a
|
|
353
|
+
* more specific frontend interpretation.
|
|
354
|
+
*/
|
|
355
|
+
export function resolveDefaultPresentationPageHostComponentRole({
|
|
356
|
+
module,
|
|
357
|
+
pageHost,
|
|
358
|
+
view,
|
|
359
|
+
}: {
|
|
360
|
+
readonly module: PresentationPageHostRendererModuleProjection
|
|
361
|
+
readonly pageHost: PageHostDefinition | null
|
|
362
|
+
readonly view: ViewDefinition | null
|
|
363
|
+
}) {
|
|
364
|
+
const workspaceRef = pageHost?.Workspace
|
|
365
|
+
if (workspaceRef) {
|
|
366
|
+
const workspace = module.Workspaces?.find(
|
|
367
|
+
(candidate) => candidate.Id === workspaceRef.WorkspaceId,
|
|
368
|
+
)
|
|
369
|
+
return workspace?.DocumentProfiles && workspace.DocumentProfiles.length > 0
|
|
370
|
+
? presentationPageHostComponentRoles.documentWorkspace
|
|
371
|
+
: presentationPageHostComponentRoles.routedSurface
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (!view) {
|
|
375
|
+
return null
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const semanticRole = getPresentationViewSemanticRole(view)
|
|
379
|
+
if (semanticRole === 'surface-root' || semanticRole === 'surface-section') {
|
|
380
|
+
return presentationPageHostComponentRoles.routedSurface
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return viewKindComponentRoles[String(view.Kind)] ?? null
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export type PageHostTargetBindingSource =
|
|
387
|
+
| 'target-page-host-binding'
|
|
388
|
+
| 'target-route-binding'
|
|
389
|
+
| 'target-view-binding'
|
|
390
|
+
| 'target-workspace-binding'
|
|
391
|
+
|
|
392
|
+
interface PageHostTargetRendererBindingResolution {
|
|
393
|
+
readonly componentKey: string | null
|
|
394
|
+
readonly componentRole: string | null
|
|
395
|
+
readonly rendererKey: string | null
|
|
396
|
+
readonly source: PageHostTargetBindingSource
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function findPageHostView<
|
|
400
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
401
|
+
>(
|
|
402
|
+
module: TModule,
|
|
403
|
+
pageHost: PageHostDefinition | null,
|
|
404
|
+
) {
|
|
405
|
+
const viewId = pageHost?.View?.ViewId
|
|
406
|
+
if (!viewId) {
|
|
407
|
+
return null
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return module.Views?.find((view) => view.Id === viewId) ?? null
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function findPageHostViewKindRenderer<TRenderer>(
|
|
414
|
+
registry: PageHostRendererRegistry<TRenderer>,
|
|
415
|
+
view: ViewDefinition,
|
|
416
|
+
) {
|
|
417
|
+
const keys = new Set<string>([String(view.Kind)])
|
|
418
|
+
const label = viewKindLabels[view.Kind as ViewKind]
|
|
419
|
+
if (label) {
|
|
420
|
+
keys.add(label)
|
|
421
|
+
keys.add(label.charAt(0).toLowerCase() + label.slice(1))
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
for (const key of keys) {
|
|
425
|
+
const renderer = registry.byViewKind?.[key]
|
|
426
|
+
if (renderer !== undefined && renderer !== null) {
|
|
427
|
+
return renderer
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return undefined
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function resolvePageHostTargetRendererBinding<
|
|
435
|
+
TModule extends PresentationPageHostRendererModuleProjection,
|
|
436
|
+
TRoute extends NavigationRouteDefinition,
|
|
437
|
+
TPageHost extends PageHostDefinition,
|
|
438
|
+
>({
|
|
439
|
+
componentSet,
|
|
440
|
+
module,
|
|
441
|
+
pageHost,
|
|
442
|
+
route,
|
|
443
|
+
targetKind,
|
|
444
|
+
view,
|
|
445
|
+
}: {
|
|
446
|
+
readonly componentSet?: string | null
|
|
447
|
+
readonly module: TModule
|
|
448
|
+
readonly pageHost: TPageHost | null
|
|
449
|
+
readonly route?: TRoute | null
|
|
450
|
+
readonly targetKind?: PresentationEnumDiscriminator | null
|
|
451
|
+
readonly view: ViewDefinition | null
|
|
452
|
+
}): PageHostTargetRendererBindingResolution | null {
|
|
453
|
+
if (!module.Targets) {
|
|
454
|
+
return null
|
|
455
|
+
}
|
|
456
|
+
const targetBindingModule = { Targets: module.Targets }
|
|
457
|
+
|
|
458
|
+
const candidates = [
|
|
459
|
+
pageHost ? { id: pageHost.Id, source: 'target-page-host-binding' as const } : null,
|
|
460
|
+
route ? { id: route.Id, source: 'target-route-binding' as const } : null,
|
|
461
|
+
pageHost?.Workspace?.WorkspaceId
|
|
462
|
+
? {
|
|
463
|
+
id: pageHost.Workspace.WorkspaceId,
|
|
464
|
+
source: 'target-workspace-binding' as const,
|
|
465
|
+
}
|
|
466
|
+
: null,
|
|
467
|
+
view ? { id: view.Id, source: 'target-view-binding' as const } : null,
|
|
468
|
+
].filter((candidate): candidate is {
|
|
469
|
+
readonly id: string
|
|
470
|
+
readonly source: PageHostTargetBindingSource
|
|
471
|
+
} => candidate !== null)
|
|
472
|
+
|
|
473
|
+
for (const candidate of candidates) {
|
|
474
|
+
const resolvedBinding = resolvePresentationComponentBinding(targetBindingModule, {
|
|
475
|
+
bindingKind: createPresentationEnumDiscriminator(
|
|
476
|
+
presentationBindingKinds,
|
|
477
|
+
'pageHostComponent',
|
|
478
|
+
'PageHostComponent',
|
|
479
|
+
),
|
|
480
|
+
componentSet,
|
|
481
|
+
id: candidate.id,
|
|
482
|
+
routeId: route?.Id,
|
|
483
|
+
targetKind,
|
|
484
|
+
})
|
|
485
|
+
const binding = resolvedBinding.binding
|
|
486
|
+
|
|
487
|
+
if (!binding) {
|
|
488
|
+
continue
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const rendererKey = readPageHostRendererKey(binding)
|
|
492
|
+
if (resolvedBinding.componentRole || resolvedBinding.componentKey || rendererKey) {
|
|
493
|
+
return {
|
|
494
|
+
componentKey: resolvedBinding.componentKey,
|
|
495
|
+
componentRole: resolvedBinding.componentRole,
|
|
496
|
+
rendererKey,
|
|
497
|
+
source: candidate.source,
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return null
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function createResolution<TRenderer>(
|
|
506
|
+
resolution: PageHostRendererResolution<TRenderer>,
|
|
507
|
+
): PageHostRendererResolution<TRenderer> {
|
|
508
|
+
return resolution
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
const viewKindComponentRoles = createViewKindComponentRoles()
|
|
512
|
+
|
|
513
|
+
function createViewKindComponentRoles() {
|
|
514
|
+
const keys: Record<string, string> = {}
|
|
515
|
+
addViewKindComponentRole(
|
|
516
|
+
keys,
|
|
517
|
+
viewKinds.collection,
|
|
518
|
+
'Collection',
|
|
519
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
520
|
+
)
|
|
521
|
+
addViewKindComponentRole(
|
|
522
|
+
keys,
|
|
523
|
+
viewKinds.dashboard,
|
|
524
|
+
'Dashboard',
|
|
525
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
526
|
+
)
|
|
527
|
+
addViewKindComponentRole(
|
|
528
|
+
keys,
|
|
529
|
+
viewKinds.documentWorkspace,
|
|
530
|
+
'DocumentWorkspace',
|
|
531
|
+
presentationPageHostComponentRoles.documentWorkspace,
|
|
532
|
+
)
|
|
533
|
+
addViewKindComponentRole(
|
|
534
|
+
keys,
|
|
535
|
+
viewKinds.form,
|
|
536
|
+
'Form',
|
|
537
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
538
|
+
)
|
|
539
|
+
addViewKindComponentRole(
|
|
540
|
+
keys,
|
|
541
|
+
viewKinds.graph,
|
|
542
|
+
'Graph',
|
|
543
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
544
|
+
)
|
|
545
|
+
addViewKindComponentRole(
|
|
546
|
+
keys,
|
|
547
|
+
viewKinds.page,
|
|
548
|
+
'Page',
|
|
549
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
550
|
+
)
|
|
551
|
+
addViewKindComponentRole(
|
|
552
|
+
keys,
|
|
553
|
+
viewKinds.prompt,
|
|
554
|
+
'Prompt',
|
|
555
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
556
|
+
)
|
|
557
|
+
addViewKindComponentRole(
|
|
558
|
+
keys,
|
|
559
|
+
viewKinds.recordDetail,
|
|
560
|
+
'RecordDetail',
|
|
561
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
562
|
+
)
|
|
563
|
+
addViewKindComponentRole(
|
|
564
|
+
keys,
|
|
565
|
+
viewKinds.search,
|
|
566
|
+
'Search',
|
|
567
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
568
|
+
)
|
|
569
|
+
addViewKindComponentRole(
|
|
570
|
+
keys,
|
|
571
|
+
viewKinds.surface,
|
|
572
|
+
'Surface',
|
|
573
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
574
|
+
)
|
|
575
|
+
addViewKindComponentRole(
|
|
576
|
+
keys,
|
|
577
|
+
viewKinds.tabbedSurface,
|
|
578
|
+
'TabbedSurface',
|
|
579
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
580
|
+
)
|
|
581
|
+
addViewKindComponentRole(
|
|
582
|
+
keys,
|
|
583
|
+
viewKinds.timeline,
|
|
584
|
+
'Timeline',
|
|
585
|
+
presentationPageHostComponentRoles.routedSurface,
|
|
586
|
+
)
|
|
587
|
+
return keys
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
function addViewKindComponentRole(
|
|
591
|
+
keys: Record<string, string>,
|
|
592
|
+
numericValue: ViewKind,
|
|
593
|
+
label: string,
|
|
594
|
+
componentRole: string,
|
|
595
|
+
) {
|
|
596
|
+
keys[String(numericValue)] = componentRole
|
|
597
|
+
keys[label] = componentRole
|
|
598
|
+
keys[label.charAt(0).toLowerCase() + label.slice(1)] = componentRole
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function readPageHostRendererKey(binding: PresentationBindingDefinition) {
|
|
602
|
+
const options = binding.Options
|
|
603
|
+
if (!isRecord(options)) {
|
|
604
|
+
return null
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
const rendererKey = options.rendererKey ?? options.RendererKey
|
|
608
|
+
return typeof rendererKey === 'string' && rendererKey.length > 0
|
|
609
|
+
? rendererKey
|
|
610
|
+
: null
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
614
|
+
return typeof value === 'object' && value !== null
|
|
615
|
+
}
|