@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,398 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NavigationRouteParameters,
|
|
3
|
+
PresentationNavigationHrefFactory,
|
|
4
|
+
} from './navigation'
|
|
5
|
+
import type {
|
|
6
|
+
ActionDefinition,
|
|
7
|
+
ProcessTaskSelectorDefinition,
|
|
8
|
+
} from './module'
|
|
9
|
+
import {
|
|
10
|
+
type ProcessTask,
|
|
11
|
+
type ProcessTaskMetadata,
|
|
12
|
+
type ProcessTaskSelector,
|
|
13
|
+
type ProcessTaskStartRegistration,
|
|
14
|
+
} from './process-task-model'
|
|
15
|
+
import {
|
|
16
|
+
createPresentationEnumDiscriminator,
|
|
17
|
+
matchesPresentationEnum,
|
|
18
|
+
} from './target-bindings'
|
|
19
|
+
import {
|
|
20
|
+
actionEnablementCriterionKinds,
|
|
21
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
22
|
+
|
|
23
|
+
type ProcessTaskScalarMetadataKey = {
|
|
24
|
+
[K in keyof ProcessTaskMetadata]-?: NonNullable<ProcessTaskMetadata[K]> extends string
|
|
25
|
+
? K
|
|
26
|
+
: never
|
|
27
|
+
}[keyof ProcessTaskMetadata]
|
|
28
|
+
|
|
29
|
+
export interface ProjectProcessTaskActionEnablementOptions<TContext> {
|
|
30
|
+
readonly action: ActionDefinition | null | undefined
|
|
31
|
+
readonly context: TContext
|
|
32
|
+
readonly findActiveTask: (selector: ProcessTaskSelector) => ProcessTask | null
|
|
33
|
+
readonly projectSelector?: (
|
|
34
|
+
selector: ProcessTaskSelectorDefinition | null | undefined,
|
|
35
|
+
context: TContext,
|
|
36
|
+
) => ProcessTaskSelector | null
|
|
37
|
+
readonly selectors: readonly ProcessTaskSelectorDefinition[]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ProjectedProcessTaskActionEnablement {
|
|
41
|
+
readonly activeTask: ProcessTask | null
|
|
42
|
+
readonly blockingCriterionId: string | null
|
|
43
|
+
readonly isDisabled: boolean
|
|
44
|
+
readonly message: string | null
|
|
45
|
+
readonly selector: ProcessTaskSelectorDefinition | null
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ProjectProcessTaskStartRegistrationOptions {
|
|
49
|
+
readonly action?: ActionDefinition | null
|
|
50
|
+
readonly createHref?: PresentationNavigationHrefFactory | null
|
|
51
|
+
readonly dataSourceQueryKey?: (dataSourceId: string) => readonly unknown[]
|
|
52
|
+
readonly detailsHref?: string | null
|
|
53
|
+
readonly failureMessage?: string | null
|
|
54
|
+
readonly invalidateQueryKeys?: readonly (readonly unknown[])[]
|
|
55
|
+
readonly metadata?: ProcessTaskMetadata
|
|
56
|
+
readonly processTypeLabel?: string | null
|
|
57
|
+
readonly processTypeTone?: string | null
|
|
58
|
+
readonly result: unknown
|
|
59
|
+
readonly selector?: ProcessTaskSelectorDefinition | null
|
|
60
|
+
readonly sourceHref?: string | null
|
|
61
|
+
readonly startedToast?: ProcessTaskStartRegistration['startedToast']
|
|
62
|
+
readonly targetHref?: string | null
|
|
63
|
+
readonly terminalInvalidateQueryKeys?: readonly (readonly unknown[])[]
|
|
64
|
+
readonly context?: Readonly<Record<string, unknown>>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Interprets process-task-backed action enablement from presentation IR.
|
|
69
|
+
*
|
|
70
|
+
* The backend declares `NoActiveProcessTask` criteria; this projection resolves
|
|
71
|
+
* those criteria against process-task selector definitions and the host's
|
|
72
|
+
* active task lookup.
|
|
73
|
+
*/
|
|
74
|
+
export function projectProcessTaskActionEnablement<TContext>({
|
|
75
|
+
action,
|
|
76
|
+
context,
|
|
77
|
+
findActiveTask,
|
|
78
|
+
projectSelector = projectProcessTaskSelector,
|
|
79
|
+
selectors,
|
|
80
|
+
}: ProjectProcessTaskActionEnablementOptions<TContext>): ProjectedProcessTaskActionEnablement {
|
|
81
|
+
let firstSelector: ProcessTaskSelectorDefinition | null = null
|
|
82
|
+
|
|
83
|
+
for (const criterion of action?.Enablement ?? []) {
|
|
84
|
+
if (
|
|
85
|
+
!matchesPresentationEnum(
|
|
86
|
+
criterion.Kind,
|
|
87
|
+
noActiveProcessTaskCriterionKind,
|
|
88
|
+
) ||
|
|
89
|
+
!criterion.ProcessTaskSelectorId
|
|
90
|
+
) {
|
|
91
|
+
continue
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const selectorDefinition = selectors.find(
|
|
95
|
+
(selector) => selector.Id === criterion.ProcessTaskSelectorId,
|
|
96
|
+
) ?? null
|
|
97
|
+
firstSelector ??= selectorDefinition
|
|
98
|
+
const selector = projectSelector(selectorDefinition, context)
|
|
99
|
+
const activeTask = selector ? findActiveTask(selector) : null
|
|
100
|
+
if (activeTask) {
|
|
101
|
+
return {
|
|
102
|
+
activeTask,
|
|
103
|
+
blockingCriterionId: criterion.Id,
|
|
104
|
+
isDisabled: true,
|
|
105
|
+
message: criterion.Message ?? criterion.Name,
|
|
106
|
+
selector: selectorDefinition,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
activeTask: null,
|
|
113
|
+
blockingCriterionId: null,
|
|
114
|
+
isDisabled: false,
|
|
115
|
+
message: null,
|
|
116
|
+
selector: firstSelector,
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function projectProcessTaskSelector<TContext>(
|
|
121
|
+
selector: ProcessTaskSelectorDefinition | null | undefined,
|
|
122
|
+
context: TContext,
|
|
123
|
+
): ProcessTaskSelector | null {
|
|
124
|
+
if (!selector) {
|
|
125
|
+
return null
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const metadata = projectProcessTaskSelectorMetadata(selector, context)
|
|
129
|
+
if (!metadata) {
|
|
130
|
+
return null
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
activeOnly: selector.ActiveOnly,
|
|
135
|
+
metadata,
|
|
136
|
+
processType: selector.ProcessType,
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function projectProcessTaskStartRegistration({
|
|
141
|
+
action,
|
|
142
|
+
createHref,
|
|
143
|
+
dataSourceQueryKey,
|
|
144
|
+
context = {},
|
|
145
|
+
detailsHref,
|
|
146
|
+
failureMessage,
|
|
147
|
+
invalidateQueryKeys,
|
|
148
|
+
metadata,
|
|
149
|
+
processTypeLabel,
|
|
150
|
+
processTypeTone,
|
|
151
|
+
result,
|
|
152
|
+
selector,
|
|
153
|
+
sourceHref,
|
|
154
|
+
startedToast,
|
|
155
|
+
targetHref,
|
|
156
|
+
terminalInvalidateQueryKeys,
|
|
157
|
+
}: ProjectProcessTaskStartRegistrationOptions): ProcessTaskStartRegistration | null {
|
|
158
|
+
const processId = readStringPath(result, 'ProcessId') ?? readStringPath(result, 'processId')
|
|
159
|
+
if (!processId) {
|
|
160
|
+
return null
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const selectorMetadata = selector
|
|
164
|
+
? projectProcessTaskSelectorMetadata(selector, context)
|
|
165
|
+
: undefined
|
|
166
|
+
const processType = selector?.ProcessType ?? readStringPath(result, 'ProcessType') ?? 'process'
|
|
167
|
+
const actionInvalidateQueryKeys = projectActionInvalidationQueryKeys({
|
|
168
|
+
action,
|
|
169
|
+
dataSourceQueryKey,
|
|
170
|
+
})
|
|
171
|
+
return {
|
|
172
|
+
completedAtUtc: readStringPath(result, 'CompletedAtUtc'),
|
|
173
|
+
detailsHref: detailsHref ?? projectActionResultHref({ action, createHref, result }),
|
|
174
|
+
failureMessage,
|
|
175
|
+
invalidateQueryKeys: invalidateQueryKeys ?? actionInvalidateQueryKeys,
|
|
176
|
+
metadata: {
|
|
177
|
+
...selectorMetadata,
|
|
178
|
+
...readConventionalProcessTaskMetadata(result),
|
|
179
|
+
...metadata,
|
|
180
|
+
},
|
|
181
|
+
processId,
|
|
182
|
+
processName: readStringPath(result, 'ProcessName'),
|
|
183
|
+
processType,
|
|
184
|
+
processTypeLabel: processTypeLabel ?? formatProcessTypeLabel(processType),
|
|
185
|
+
processTypeTone,
|
|
186
|
+
sourceHref,
|
|
187
|
+
startedAtUtc: readStringPath(result, 'StartedAtUtc'),
|
|
188
|
+
startedToast,
|
|
189
|
+
status: readStringPath(result, 'Status'),
|
|
190
|
+
targetHref,
|
|
191
|
+
terminalInvalidateQueryKeys: terminalInvalidateQueryKeys ?? actionInvalidateQueryKeys,
|
|
192
|
+
updatedAtUtc: readStringPath(result, 'UpdatedAtUtc'),
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function projectActionInvalidationQueryKeys({
|
|
197
|
+
action,
|
|
198
|
+
dataSourceQueryKey,
|
|
199
|
+
}: {
|
|
200
|
+
readonly action?: ActionDefinition | null
|
|
201
|
+
readonly dataSourceQueryKey?: (dataSourceId: string) => readonly unknown[]
|
|
202
|
+
}) {
|
|
203
|
+
if (!dataSourceQueryKey) {
|
|
204
|
+
return undefined
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const dataSourceIds = action?.Result?.InvalidateDataSourceIds ?? []
|
|
208
|
+
if (dataSourceIds.length === 0) {
|
|
209
|
+
return undefined
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return dataSourceIds.map((dataSourceId) => dataSourceQueryKey(dataSourceId))
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function projectActionResultHref({
|
|
216
|
+
action,
|
|
217
|
+
createHref,
|
|
218
|
+
result,
|
|
219
|
+
}: {
|
|
220
|
+
readonly action?: ActionDefinition | null
|
|
221
|
+
readonly createHref?: PresentationNavigationHrefFactory | null
|
|
222
|
+
readonly result: unknown
|
|
223
|
+
}) {
|
|
224
|
+
const routeId = action?.Result?.NavigateToRouteId
|
|
225
|
+
if (!routeId || !createHref) {
|
|
226
|
+
return undefined
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return createHref(routeId, projectProcessResultRouteParameters(result))
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function projectProcessResultRouteParameters(result: unknown): NavigationRouteParameters {
|
|
233
|
+
const record = result && typeof result === 'object' && !Array.isArray(result)
|
|
234
|
+
? result as Readonly<Record<string, unknown>>
|
|
235
|
+
: {}
|
|
236
|
+
const parameters: NavigationRouteParameters = {}
|
|
237
|
+
|
|
238
|
+
for (const [key, value] of Object.entries(record)) {
|
|
239
|
+
if (!isNavigationRouteParameterValue(value)) {
|
|
240
|
+
continue
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
parameters[key] = value
|
|
244
|
+
parameters[lowerFirst(key)] = value
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
parameters.id ??=
|
|
248
|
+
readStringPath(result, 'Id') ??
|
|
249
|
+
readStringPath(result, 'EntityId') ??
|
|
250
|
+
readStringPath(result, 'ProcessId') ??
|
|
251
|
+
readStringPath(result, 'ShapeGraphId') ??
|
|
252
|
+
readStringPath(result, 'EdiSpecId')
|
|
253
|
+
|
|
254
|
+
return parameters
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function projectProcessTaskSelectorMetadata<TContext>(
|
|
258
|
+
selector: ProcessTaskSelectorDefinition,
|
|
259
|
+
context: TContext,
|
|
260
|
+
): ProcessTaskMetadata | null {
|
|
261
|
+
const metadata: Partial<Record<ProcessTaskScalarMetadataKey, string | null | undefined>> = {}
|
|
262
|
+
for (const match of selector.Matches ?? []) {
|
|
263
|
+
const metadataKey = readProcessTaskMetadataKey(match.TaskPath)
|
|
264
|
+
if (!metadataKey) {
|
|
265
|
+
return null
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const value = readProcessTaskSelectorValue(context, match.ValuePath)
|
|
269
|
+
if (value === undefined) {
|
|
270
|
+
return null
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
metadata[metadataKey] = value
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return metadata
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function readConventionalProcessTaskMetadata(result: unknown): ProcessTaskMetadata {
|
|
280
|
+
return {
|
|
281
|
+
correlationId: readStringPath(result, 'CorrelationId'),
|
|
282
|
+
ediSpecId: readStringPath(result, 'EdiSpecId'),
|
|
283
|
+
mode: readStringPath(result, 'Mode'),
|
|
284
|
+
modelId: readStringPath(result, 'ModelId'),
|
|
285
|
+
policyId: readStringPath(result, 'PolicyId'),
|
|
286
|
+
projectionIds: readStringArrayPath(result, 'ProjectionIds'),
|
|
287
|
+
shapeGraphId: readStringPath(result, 'ShapeGraphId'),
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function readProcessTaskMetadataKey(taskPath: string): ProcessTaskScalarMetadataKey | null {
|
|
292
|
+
const metadataPrefix = 'metadata.'
|
|
293
|
+
if (!taskPath.startsWith(metadataPrefix)) {
|
|
294
|
+
return null
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const metadataKey = taskPath.slice(metadataPrefix.length)
|
|
298
|
+
return scalarProcessTaskMetadataKeys.has(metadataKey as ProcessTaskScalarMetadataKey)
|
|
299
|
+
? (metadataKey as ProcessTaskScalarMetadataKey)
|
|
300
|
+
: null
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function readProcessTaskSelectorValue(
|
|
304
|
+
context: unknown,
|
|
305
|
+
valuePath: string,
|
|
306
|
+
) {
|
|
307
|
+
const value = readStringPath(context, valuePath)
|
|
308
|
+
if (value !== undefined) {
|
|
309
|
+
return value
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
switch (valuePath) {
|
|
313
|
+
case 'resource.Id':
|
|
314
|
+
case 'resource.id':
|
|
315
|
+
case 'route.Id':
|
|
316
|
+
case 'route.id':
|
|
317
|
+
return readStringPath(context, 'resourceId')
|
|
318
|
+
default:
|
|
319
|
+
return undefined
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function readStringPath(source: unknown, path: string) {
|
|
324
|
+
const value = readPath(source, path)
|
|
325
|
+
return typeof value === 'string' ? value : undefined
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function readStringArrayPath(source: unknown, path: string) {
|
|
329
|
+
const value = readPath(source, path)
|
|
330
|
+
return Array.isArray(value) && value.every((item): item is string => typeof item === 'string')
|
|
331
|
+
? value
|
|
332
|
+
: undefined
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function isNavigationRouteParameterValue(
|
|
336
|
+
value: unknown,
|
|
337
|
+
): value is boolean | number | string {
|
|
338
|
+
return (
|
|
339
|
+
typeof value === 'boolean' ||
|
|
340
|
+
typeof value === 'number' ||
|
|
341
|
+
typeof value === 'string'
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function lowerFirst(value: string) {
|
|
346
|
+
return value.length === 0
|
|
347
|
+
? value
|
|
348
|
+
: `${value.slice(0, 1).toLocaleLowerCase()}${value.slice(1)}`
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function readPath(source: unknown, path: string): unknown {
|
|
352
|
+
if (!path) {
|
|
353
|
+
return undefined
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return path.split('.').reduce<unknown>((current, segment) => {
|
|
357
|
+
if (!current || typeof current !== 'object') {
|
|
358
|
+
return undefined
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const record = current as Record<string, unknown>
|
|
362
|
+
if (Object.prototype.hasOwnProperty.call(record, segment)) {
|
|
363
|
+
return record[segment]
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const match = Object.keys(record).find(
|
|
367
|
+
(key) => key.toLocaleLowerCase() === segment.toLocaleLowerCase(),
|
|
368
|
+
)
|
|
369
|
+
return match ? record[match] : undefined
|
|
370
|
+
}, source)
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function formatProcessTypeLabel(processType: string) {
|
|
374
|
+
return processType
|
|
375
|
+
.split(/[-_\s]+/)
|
|
376
|
+
.filter(Boolean)
|
|
377
|
+
.map((part, index) =>
|
|
378
|
+
index === 0
|
|
379
|
+
? `${part.slice(0, 1).toLocaleUpperCase()}${part.slice(1)}`
|
|
380
|
+
: part,
|
|
381
|
+
)
|
|
382
|
+
.join(' ')
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const noActiveProcessTaskCriterionKind = createPresentationEnumDiscriminator(
|
|
386
|
+
actionEnablementCriterionKinds,
|
|
387
|
+
'noActiveProcessTask',
|
|
388
|
+
'NoActiveProcessTask',
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
const scalarProcessTaskMetadataKeys = new Set<ProcessTaskScalarMetadataKey>([
|
|
392
|
+
'correlationId',
|
|
393
|
+
'ediSpecId',
|
|
394
|
+
'mode',
|
|
395
|
+
'modelId',
|
|
396
|
+
'policyId',
|
|
397
|
+
'shapeGraphId',
|
|
398
|
+
])
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
|
|
5
|
+
export interface ProjectedDocumentActionStatus {
|
|
6
|
+
readonly error?: unknown
|
|
7
|
+
readonly isPending?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type ProjectedDocumentActionStatusMap = Readonly<
|
|
11
|
+
Record<string, ProjectedDocumentActionStatus | undefined>
|
|
12
|
+
>
|
|
13
|
+
|
|
14
|
+
export interface ProjectedActionStatusSource {
|
|
15
|
+
readonly action?: Pick<ActionDefinition, 'Id'> | null
|
|
16
|
+
readonly actionId?: string | null
|
|
17
|
+
readonly error?: unknown
|
|
18
|
+
readonly isPending?: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Projects action executor state into the action-id keyed status map consumed
|
|
23
|
+
* by document-profile status notices.
|
|
24
|
+
*/
|
|
25
|
+
export function projectDocumentActionStatusMap(
|
|
26
|
+
sources: readonly ProjectedActionStatusSource[],
|
|
27
|
+
): ProjectedDocumentActionStatusMap {
|
|
28
|
+
const statuses: Record<string, ProjectedDocumentActionStatusMap[string]> = {}
|
|
29
|
+
|
|
30
|
+
for (const source of sources) {
|
|
31
|
+
const actionId = source.action?.Id ?? source.actionId
|
|
32
|
+
if (!actionId) {
|
|
33
|
+
continue
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
statuses[actionId] = {
|
|
37
|
+
error: source.error,
|
|
38
|
+
isPending: source.isPending,
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return statuses
|
|
43
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export type ProjectedActivityState =
|
|
2
|
+
| { readonly kind: 'blocked'; readonly label: string }
|
|
3
|
+
| { readonly kind: 'pending'; readonly label: string }
|
|
4
|
+
| { readonly kind: 'error'; readonly label: string }
|
|
5
|
+
| { readonly kind: 'ready' }
|
|
6
|
+
|
|
7
|
+
export function createQueryActivityState({
|
|
8
|
+
blockedLabel,
|
|
9
|
+
error,
|
|
10
|
+
isBlocked,
|
|
11
|
+
isPending,
|
|
12
|
+
pendingLabel,
|
|
13
|
+
}: {
|
|
14
|
+
readonly blockedLabel: string
|
|
15
|
+
readonly error: unknown
|
|
16
|
+
readonly isBlocked: boolean
|
|
17
|
+
readonly isPending: boolean
|
|
18
|
+
readonly pendingLabel: string
|
|
19
|
+
}): ProjectedActivityState {
|
|
20
|
+
if (isBlocked) {
|
|
21
|
+
return { kind: 'blocked', label: blockedLabel }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isPending) {
|
|
25
|
+
return { kind: 'pending', label: pendingLabel }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (error) {
|
|
29
|
+
return { kind: 'error', label: getErrorMessage(error) }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return { kind: 'ready' }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getErrorMessage(error: unknown) {
|
|
36
|
+
if (error instanceof Error) {
|
|
37
|
+
const displayMessage = readErrorDisplayMessage(error)
|
|
38
|
+
if (displayMessage) {
|
|
39
|
+
return displayMessage
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const apiMessage = getApiErrorMessage(error)
|
|
43
|
+
if (apiMessage) {
|
|
44
|
+
return `${error.message}: ${apiMessage}`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return error.message
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return String(error)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getApiErrorMessage(error: Error) {
|
|
54
|
+
const responseBody = readErrorResponseBody(error)
|
|
55
|
+
if (!responseBody) {
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const body = JSON.parse(responseBody) as unknown
|
|
61
|
+
if (body && typeof body === 'object' && 'Diagnostics' in body) {
|
|
62
|
+
const diagnostics = (body as { readonly Diagnostics?: unknown }).Diagnostics
|
|
63
|
+
if (Array.isArray(diagnostics)) {
|
|
64
|
+
const firstMessage = diagnostics
|
|
65
|
+
.map((diagnostic) =>
|
|
66
|
+
diagnostic && typeof diagnostic === 'object' && 'Message' in diagnostic
|
|
67
|
+
? (diagnostic as { readonly Message?: unknown }).Message
|
|
68
|
+
: null,
|
|
69
|
+
)
|
|
70
|
+
.find((message): message is string => typeof message === 'string' && message.length > 0)
|
|
71
|
+
if (firstMessage) {
|
|
72
|
+
return firstMessage
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (body && typeof body === 'object' && 'message' in body) {
|
|
78
|
+
const message = (body as { readonly message?: unknown }).message
|
|
79
|
+
return typeof message === 'string' ? message : null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (body && typeof body === 'object' && 'Message' in body) {
|
|
83
|
+
const message = (body as { readonly Message?: unknown }).Message
|
|
84
|
+
return typeof message === 'string' ? message : null
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (body && typeof body === 'object' && 'detail' in body) {
|
|
88
|
+
const detail = (body as { readonly detail?: unknown }).detail
|
|
89
|
+
if (typeof detail === 'string' && detail.length > 0) {
|
|
90
|
+
return detail
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (body && typeof body === 'object' && 'title' in body) {
|
|
95
|
+
const title = (body as { readonly title?: unknown }).title
|
|
96
|
+
return typeof title === 'string' ? title : null
|
|
97
|
+
}
|
|
98
|
+
} catch {
|
|
99
|
+
return responseBody.length > 0 ? responseBody : null
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return null
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function readErrorDisplayMessage(error: Error) {
|
|
106
|
+
if (!('displayMessage' in error)) {
|
|
107
|
+
return null
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const displayMessage = (error as Error & { readonly displayMessage?: unknown }).displayMessage
|
|
111
|
+
return typeof displayMessage === 'string' && displayMessage.length > 0
|
|
112
|
+
? displayMessage
|
|
113
|
+
: null
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function readErrorResponseBody(error: Error) {
|
|
117
|
+
if (!('responseBody' in error)) {
|
|
118
|
+
return null
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const responseBody = (error as Error & { readonly responseBody?: unknown }).responseBody
|
|
122
|
+
return typeof responseBody === 'string' ? responseBody : null
|
|
123
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
import type {
|
|
5
|
+
PresentationActionRuntimeBinding,
|
|
6
|
+
} from './presentation-action-runtime-binding'
|
|
7
|
+
import {
|
|
8
|
+
createPresentationActionRuntimeBinding,
|
|
9
|
+
} from './presentation-action-runtime-binding'
|
|
10
|
+
import type {
|
|
11
|
+
ProjectedCollectionActionExecutionContext,
|
|
12
|
+
ProjectedNavigateHref,
|
|
13
|
+
} from './projected-collection-runtime'
|
|
14
|
+
import {
|
|
15
|
+
actionKinds,
|
|
16
|
+
presentationBindingKinds,
|
|
17
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
18
|
+
|
|
19
|
+
export interface ProjectProjectedCollectionActionRuntimeBindingsOptions {
|
|
20
|
+
readonly navigateHref?: ProjectedNavigateHref
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Projects collection row/selection action semantics onto frontend-local
|
|
25
|
+
* execution. The collection runtime supplies row or selection context at
|
|
26
|
+
* invocation time; these bindings only decide how an action id is interpreted.
|
|
27
|
+
*/
|
|
28
|
+
export function projectProjectedCollectionActionRuntimeBindings<
|
|
29
|
+
TData extends object,
|
|
30
|
+
TLabel = string,
|
|
31
|
+
>({
|
|
32
|
+
navigateHref,
|
|
33
|
+
}: ProjectProjectedCollectionActionRuntimeBindingsOptions): readonly PresentationActionRuntimeBinding<
|
|
34
|
+
ProjectedCollectionActionExecutionContext<TData>,
|
|
35
|
+
TLabel
|
|
36
|
+
>[] {
|
|
37
|
+
return [
|
|
38
|
+
createPresentationActionRuntimeBinding<
|
|
39
|
+
ProjectedCollectionActionExecutionContext<TData>,
|
|
40
|
+
TLabel
|
|
41
|
+
>({
|
|
42
|
+
id: 'collection-context-action',
|
|
43
|
+
predicate: ({ action }) => isCollectionNavigationAction(action),
|
|
44
|
+
project: () => ({
|
|
45
|
+
canExecute: (context) =>
|
|
46
|
+
canExecuteCollectionContextAction({
|
|
47
|
+
context,
|
|
48
|
+
navigateHref,
|
|
49
|
+
}),
|
|
50
|
+
execute: (context) => {
|
|
51
|
+
if (context.href) {
|
|
52
|
+
navigateHref?.(context.href)
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
}),
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function canExecuteCollectionContextAction<TData extends object>({
|
|
61
|
+
context,
|
|
62
|
+
navigateHref,
|
|
63
|
+
}: {
|
|
64
|
+
readonly context: ProjectedCollectionActionExecutionContext<TData>
|
|
65
|
+
readonly navigateHref?: ProjectedNavigateHref
|
|
66
|
+
}) {
|
|
67
|
+
return Boolean(navigateHref && context.href)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isCollectionNavigationAction(action: ActionDefinition) {
|
|
71
|
+
return action.Kind === actionKinds.navigationAction ||
|
|
72
|
+
String(action.Kind).toLocaleLowerCase() === 'navigationaction' ||
|
|
73
|
+
action.Binding.Kind === presentationBindingKinds.navigationRoute ||
|
|
74
|
+
String(action.Binding.Kind).toLocaleLowerCase() === 'navigationroute' ||
|
|
75
|
+
Boolean(action.Binding.RouteId || action.Result?.NavigateToRouteId)
|
|
76
|
+
}
|