@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,177 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
PresentationModuleDefinition,
|
|
4
|
+
} from './module'
|
|
5
|
+
import {
|
|
6
|
+
actionKindLabels,
|
|
7
|
+
actionSemanticsKindLabels,
|
|
8
|
+
actionScopeKindLabels,
|
|
9
|
+
documentWorkspaceActionKindLabels,
|
|
10
|
+
localDocumentEditorActionKindLabels,
|
|
11
|
+
preparationKindLabels,
|
|
12
|
+
presentationBindingKindLabels,
|
|
13
|
+
type ActionKind,
|
|
14
|
+
type ActionScopeKind,
|
|
15
|
+
type ActionSemanticsKind,
|
|
16
|
+
type DocumentWorkspaceActionKind,
|
|
17
|
+
type LocalDocumentEditorActionKind,
|
|
18
|
+
type PreparationKind,
|
|
19
|
+
type PresentationBindingKind,
|
|
20
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
21
|
+
|
|
22
|
+
export interface PresentationActionRuntime<TExecuteContext = unknown, TLabel = string> {
|
|
23
|
+
readonly canExecute?: (context: TExecuteContext) => boolean
|
|
24
|
+
readonly disabledReason?: TLabel
|
|
25
|
+
readonly execute?: (context: TExecuteContext) => Promise<void> | void
|
|
26
|
+
readonly isDisabled?: boolean
|
|
27
|
+
readonly isHidden?: boolean
|
|
28
|
+
readonly isPending?: boolean
|
|
29
|
+
readonly label?: TLabel
|
|
30
|
+
readonly pendingLabel?: TLabel
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface PresentationActionRuntimeBindingContext {
|
|
34
|
+
readonly action: ActionDefinition
|
|
35
|
+
readonly actionId: string
|
|
36
|
+
readonly module: PresentationModuleDefinition
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface PresentationActionRuntimeBinding<TExecuteContext = unknown, TLabel = string> {
|
|
40
|
+
readonly id: string
|
|
41
|
+
readonly matches: (context: PresentationActionRuntimeBindingContext) => boolean
|
|
42
|
+
readonly project: (context: PresentationActionRuntimeBindingContext) => PresentationActionRuntime<TExecuteContext, TLabel> | null | undefined
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PresentationActionRuntimeBindingSpec<TExecuteContext = unknown, TLabel = string> {
|
|
46
|
+
/** Optional exact action id match for narrowly scoped or legacy bindings. */
|
|
47
|
+
readonly actionId?: string | readonly string[]
|
|
48
|
+
|
|
49
|
+
/** Optional infrastructure binding match, such as endpoint, flow event, or local state. */
|
|
50
|
+
readonly bindingKind?: PresentationBindingKind | readonly PresentationBindingKind[]
|
|
51
|
+
|
|
52
|
+
/** Optional sub-kind match for DocumentWorkspace action semantics. */
|
|
53
|
+
readonly documentWorkspaceKind?:
|
|
54
|
+
| DocumentWorkspaceActionKind
|
|
55
|
+
| readonly DocumentWorkspaceActionKind[]
|
|
56
|
+
|
|
57
|
+
readonly id: string
|
|
58
|
+
|
|
59
|
+
/** Optional semantic action kind match. Prefer semantics-specific fields when possible. */
|
|
60
|
+
readonly kind?: ActionKind | readonly ActionKind[]
|
|
61
|
+
|
|
62
|
+
/** Optional sub-kind match for LocalDocumentEditor action semantics. */
|
|
63
|
+
readonly localDocumentEditorKind?:
|
|
64
|
+
| LocalDocumentEditorActionKind
|
|
65
|
+
| readonly LocalDocumentEditorActionKind[]
|
|
66
|
+
|
|
67
|
+
readonly predicate?: (context: PresentationActionRuntimeBindingContext) => boolean
|
|
68
|
+
|
|
69
|
+
readonly preparationKind?: PreparationKind | readonly PreparationKind[]
|
|
70
|
+
|
|
71
|
+
/** Optional first-class action semantics match. */
|
|
72
|
+
readonly semanticsKind?: ActionSemanticsKind | readonly ActionSemanticsKind[]
|
|
73
|
+
|
|
74
|
+
readonly project: (context: PresentationActionRuntimeBindingContext) => PresentationActionRuntime<TExecuteContext, TLabel> | null | undefined
|
|
75
|
+
|
|
76
|
+
readonly scope?: ActionScopeKind | readonly ActionScopeKind[]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Creates an adapter-neutral runtime binding for a semantic presentation
|
|
81
|
+
* action. The binding decides whether an ActionDefinition matches, then
|
|
82
|
+
* projects frontend-local runtime state for that action.
|
|
83
|
+
*/
|
|
84
|
+
export function createPresentationActionRuntimeBinding<
|
|
85
|
+
TExecuteContext = unknown,
|
|
86
|
+
TLabel = string,
|
|
87
|
+
>({
|
|
88
|
+
actionId,
|
|
89
|
+
bindingKind,
|
|
90
|
+
documentWorkspaceKind,
|
|
91
|
+
id,
|
|
92
|
+
kind,
|
|
93
|
+
localDocumentEditorKind,
|
|
94
|
+
predicate,
|
|
95
|
+
preparationKind,
|
|
96
|
+
project,
|
|
97
|
+
semanticsKind,
|
|
98
|
+
scope,
|
|
99
|
+
}: PresentationActionRuntimeBindingSpec<
|
|
100
|
+
TExecuteContext,
|
|
101
|
+
TLabel
|
|
102
|
+
>): PresentationActionRuntimeBinding<TExecuteContext, TLabel> {
|
|
103
|
+
return {
|
|
104
|
+
id,
|
|
105
|
+
matches: (context) =>
|
|
106
|
+
matchesStringOption(context.action.Id, actionId) &&
|
|
107
|
+
matchesEnumOption(context.action.Kind, kind, actionKindLabels) &&
|
|
108
|
+
matchesEnumOption(context.action.Scope, scope, actionScopeKindLabels) &&
|
|
109
|
+
matchesEnumOption(context.action.Binding.Kind, bindingKind, presentationBindingKindLabels) &&
|
|
110
|
+
matchesEnumOption(context.action.Preparation?.Kind, preparationKind, preparationKindLabels) &&
|
|
111
|
+
matchesEnumOption(context.action.Semantics?.Kind, semanticsKind, actionSemanticsKindLabels) &&
|
|
112
|
+
matchesEnumOption(
|
|
113
|
+
context.action.Semantics?.DocumentWorkspace?.Kind,
|
|
114
|
+
documentWorkspaceKind,
|
|
115
|
+
documentWorkspaceActionKindLabels,
|
|
116
|
+
) &&
|
|
117
|
+
matchesEnumOption(
|
|
118
|
+
context.action.Semantics?.LocalDocumentEditor?.Kind,
|
|
119
|
+
localDocumentEditorKind,
|
|
120
|
+
localDocumentEditorActionKindLabels,
|
|
121
|
+
) &&
|
|
122
|
+
(predicate?.(context) ?? true),
|
|
123
|
+
project,
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function matchesStringOption(
|
|
128
|
+
value: string | null | undefined,
|
|
129
|
+
expected: string | readonly string[] | null | undefined,
|
|
130
|
+
) {
|
|
131
|
+
if (!expected) {
|
|
132
|
+
return true
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return toArray(expected).includes(value ?? '')
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function matchesEnumOption<TValue extends string | number>(
|
|
139
|
+
value: string | number | null | undefined,
|
|
140
|
+
expected: TValue | readonly TValue[] | null | undefined,
|
|
141
|
+
labels: Readonly<Record<number, string>>,
|
|
142
|
+
) {
|
|
143
|
+
if (expected === null || expected === undefined) {
|
|
144
|
+
return true
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return toArray(expected).some((candidate) =>
|
|
148
|
+
matchesGeneratedEnumValue(value, candidate, labels),
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function matchesGeneratedEnumValue<TValue extends string | number>(
|
|
153
|
+
value: string | number | null | undefined,
|
|
154
|
+
expected: TValue,
|
|
155
|
+
labels: Readonly<Record<number, string>>,
|
|
156
|
+
) {
|
|
157
|
+
if (value === expected) {
|
|
158
|
+
return true
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const expectedLabel = typeof expected === 'number'
|
|
162
|
+
? labels[expected] ?? String(expected)
|
|
163
|
+
: String(expected)
|
|
164
|
+
const actualLabel = typeof value === 'number'
|
|
165
|
+
? labels[value] ?? String(value)
|
|
166
|
+
: String(value ?? '')
|
|
167
|
+
|
|
168
|
+
return normalizeEnumLabel(actualLabel) === normalizeEnumLabel(expectedLabel)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function normalizeEnumLabel(value: string) {
|
|
172
|
+
return value.replace(/[^a-zA-Z0-9]+/g, '').toLocaleLowerCase()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function toArray<TValue>(value: TValue | readonly TValue[]) {
|
|
176
|
+
return Array.isArray(value) ? value : [value]
|
|
177
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
ActionPlacementDefinition,
|
|
4
|
+
PresentationModuleDefinition,
|
|
5
|
+
} from './module'
|
|
6
|
+
import {
|
|
7
|
+
findPresentationAction,
|
|
8
|
+
} from './module'
|
|
9
|
+
import type {
|
|
10
|
+
PresentationActionRuntimeRegistry,
|
|
11
|
+
} from './presentation-action-runtime-projection'
|
|
12
|
+
import type {
|
|
13
|
+
PresentationProjectionDiagnostic,
|
|
14
|
+
} from './presentation-projection-diagnostics'
|
|
15
|
+
|
|
16
|
+
export interface ProjectPresentationActionRuntimeBindingDiagnosticsOptions<
|
|
17
|
+
TExecuteContext,
|
|
18
|
+
TLabel,
|
|
19
|
+
> {
|
|
20
|
+
readonly actionPlacements: readonly ActionPlacementDefinition[]
|
|
21
|
+
readonly module: Pick<PresentationModuleDefinition, 'Actions'> | null
|
|
22
|
+
readonly runtimes: PresentationActionRuntimeRegistry<TExecuteContext, TLabel>
|
|
23
|
+
readonly source: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Reports placed actions that reached the frontend but did not receive an
|
|
28
|
+
* executable runtime interpretation.
|
|
29
|
+
*
|
|
30
|
+
* This keeps IR expansion honest: adding a backend action should either bind a
|
|
31
|
+
* frontend runtime or show up as a projection TODO.
|
|
32
|
+
*/
|
|
33
|
+
export function projectPresentationActionRuntimeBindingDiagnostics<
|
|
34
|
+
TExecuteContext,
|
|
35
|
+
TLabel,
|
|
36
|
+
>({
|
|
37
|
+
actionPlacements,
|
|
38
|
+
module,
|
|
39
|
+
runtimes,
|
|
40
|
+
source,
|
|
41
|
+
}: ProjectPresentationActionRuntimeBindingDiagnosticsOptions<
|
|
42
|
+
TExecuteContext,
|
|
43
|
+
TLabel
|
|
44
|
+
>): readonly PresentationProjectionDiagnostic[] {
|
|
45
|
+
return actionPlacements.flatMap((placement) => {
|
|
46
|
+
const action = findPresentationAction<ActionDefinition>(module, placement.ActionId)
|
|
47
|
+
if (!action) {
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
details: {
|
|
51
|
+
actionId: placement.ActionId,
|
|
52
|
+
placementIntent: placement.Intent,
|
|
53
|
+
placementRegion: placement.Region,
|
|
54
|
+
},
|
|
55
|
+
id: `action-runtime.${placement.ActionId}.missing-action`,
|
|
56
|
+
message:
|
|
57
|
+
`Placed action '${placement.ActionId}' is referenced by the presentation IR ` +
|
|
58
|
+
'but is not present in the action catalog.',
|
|
59
|
+
severity: 'error',
|
|
60
|
+
source,
|
|
61
|
+
subject: {
|
|
62
|
+
id: placement.ActionId,
|
|
63
|
+
kind: 'action',
|
|
64
|
+
},
|
|
65
|
+
} satisfies PresentationProjectionDiagnostic,
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const runtime = runtimes[action.Id]
|
|
70
|
+
if (runtime?.execute) {
|
|
71
|
+
return []
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return [
|
|
75
|
+
createActionRuntimeDiagnostic({
|
|
76
|
+
action,
|
|
77
|
+
message:
|
|
78
|
+
`Action '${action.Name}' is placed in '${placement.Region}' but has no ` +
|
|
79
|
+
'frontend runtime binding.',
|
|
80
|
+
placement,
|
|
81
|
+
reason: 'missing-execute-binding',
|
|
82
|
+
source,
|
|
83
|
+
}),
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function createActionRuntimeDiagnostic({
|
|
89
|
+
action,
|
|
90
|
+
message,
|
|
91
|
+
placement,
|
|
92
|
+
reason,
|
|
93
|
+
source,
|
|
94
|
+
}: {
|
|
95
|
+
readonly action: ActionDefinition
|
|
96
|
+
readonly message: string
|
|
97
|
+
readonly placement: ActionPlacementDefinition
|
|
98
|
+
readonly reason: string
|
|
99
|
+
readonly source: string
|
|
100
|
+
}): PresentationProjectionDiagnostic {
|
|
101
|
+
return {
|
|
102
|
+
details: {
|
|
103
|
+
actionId: action.Id,
|
|
104
|
+
bindingKind: action.Binding.Kind,
|
|
105
|
+
kind: action.Kind,
|
|
106
|
+
placementIntent: placement.Intent,
|
|
107
|
+
placementRegion: placement.Region,
|
|
108
|
+
scope: action.Scope,
|
|
109
|
+
},
|
|
110
|
+
id: `action-runtime.${action.Id}.${reason}`,
|
|
111
|
+
message,
|
|
112
|
+
severity: 'warning',
|
|
113
|
+
source,
|
|
114
|
+
subject: {
|
|
115
|
+
id: action.Id,
|
|
116
|
+
kind: 'action',
|
|
117
|
+
name: action.Name,
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
import {
|
|
5
|
+
formatPresentationValue,
|
|
6
|
+
resolvePresentationValue,
|
|
7
|
+
} from './presentation-value-resolution'
|
|
8
|
+
|
|
9
|
+
export interface ResolveActionPendingLabelOptions<TLabel> {
|
|
10
|
+
readonly action: Pick<ActionDefinition, 'RuntimePresentation'> | null | undefined
|
|
11
|
+
readonly data?: unknown
|
|
12
|
+
readonly fallback?: TLabel
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a pending action label from presentation IR runtime metadata.
|
|
17
|
+
*
|
|
18
|
+
* Label variants are checked before the default pending label, which lets a
|
|
19
|
+
* process-preview action describe response-dependent labels such as overwrite
|
|
20
|
+
* vs create without product-specific frontend branches.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveActionPendingLabel<TLabel = string>({
|
|
23
|
+
action,
|
|
24
|
+
data,
|
|
25
|
+
fallback,
|
|
26
|
+
}: ResolveActionPendingLabelOptions<TLabel>): TLabel | undefined {
|
|
27
|
+
const runtimePresentation = action?.RuntimePresentation
|
|
28
|
+
const variant = runtimePresentation?.PendingLabelVariants.find((candidate) =>
|
|
29
|
+
actionRuntimeLabelVariantMatches({
|
|
30
|
+
data,
|
|
31
|
+
expectedValue: candidate.ExpectedValue,
|
|
32
|
+
value: resolvePresentationValue(candidate.Condition, data),
|
|
33
|
+
}),
|
|
34
|
+
)
|
|
35
|
+
const label = variant?.Label ?? runtimePresentation?.PendingLabel
|
|
36
|
+
|
|
37
|
+
return label === null || label === undefined || label === ''
|
|
38
|
+
? fallback
|
|
39
|
+
: label as TLabel
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function actionRuntimeLabelVariantMatches({
|
|
43
|
+
data,
|
|
44
|
+
expectedValue,
|
|
45
|
+
value,
|
|
46
|
+
}: {
|
|
47
|
+
readonly data: unknown
|
|
48
|
+
readonly expectedValue: string
|
|
49
|
+
readonly value: unknown
|
|
50
|
+
}) {
|
|
51
|
+
if (data === null || data === undefined) {
|
|
52
|
+
return false
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const formatted = formatPresentationValue(value)
|
|
56
|
+
return formatted?.toLocaleLowerCase() === expectedValue.toLocaleLowerCase()
|
|
57
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PresentationModuleDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
import type {
|
|
5
|
+
PresentationActionRuntime,
|
|
6
|
+
PresentationActionRuntimeBinding,
|
|
7
|
+
PresentationActionRuntimeBindingContext,
|
|
8
|
+
} from './presentation-action-runtime-binding'
|
|
9
|
+
|
|
10
|
+
export type PresentationActionRuntimeRegistry<TExecuteContext, TLabel> = Readonly<
|
|
11
|
+
Record<string, PresentationActionRuntime<TExecuteContext, TLabel> | null | undefined>
|
|
12
|
+
>
|
|
13
|
+
|
|
14
|
+
export interface ProjectPresentationActionRuntimeRegistryOptions<
|
|
15
|
+
TExecuteContext,
|
|
16
|
+
TLabel,
|
|
17
|
+
> {
|
|
18
|
+
readonly actionIds?: readonly string[]
|
|
19
|
+
readonly module: PresentationModuleDefinition | null
|
|
20
|
+
readonly projections: readonly PresentationActionRuntimeBinding<TExecuteContext, TLabel>[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Interprets backend-declared actions through ordered frontend runtime
|
|
25
|
+
* projections.
|
|
26
|
+
*
|
|
27
|
+
* The IR owns action identity and semantics; the frontend contributes concrete
|
|
28
|
+
* local effects by registering projection bindings that match those semantics.
|
|
29
|
+
*/
|
|
30
|
+
export function projectPresentationActionRuntimeRegistry<TExecuteContext, TLabel>({
|
|
31
|
+
actionIds,
|
|
32
|
+
module,
|
|
33
|
+
projections,
|
|
34
|
+
}: ProjectPresentationActionRuntimeRegistryOptions<
|
|
35
|
+
TExecuteContext,
|
|
36
|
+
TLabel
|
|
37
|
+
>): PresentationActionRuntimeRegistry<TExecuteContext, TLabel> {
|
|
38
|
+
if (!module) {
|
|
39
|
+
return {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const actionsById = new Map(module.Actions.map((action) => [action.Id, action]))
|
|
43
|
+
const candidateActionIds = actionIds ?? module.Actions.map((action) => action.Id)
|
|
44
|
+
const registry: Record<
|
|
45
|
+
string,
|
|
46
|
+
PresentationActionRuntime<TExecuteContext, TLabel> | null | undefined
|
|
47
|
+
> = {}
|
|
48
|
+
|
|
49
|
+
for (const actionId of new Set(candidateActionIds)) {
|
|
50
|
+
const action = actionsById.get(actionId)
|
|
51
|
+
if (!action) {
|
|
52
|
+
continue
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const context = { action, actionId, module } satisfies PresentationActionRuntimeBindingContext
|
|
56
|
+
for (const projection of projections) {
|
|
57
|
+
if (!projection.matches(context)) {
|
|
58
|
+
continue
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
registry[actionId] = projection.project(context)
|
|
62
|
+
break
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return registry
|
|
67
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findPresentationField,
|
|
3
|
+
} from './module'
|
|
4
|
+
import type {
|
|
5
|
+
FieldPresentationDefinition,
|
|
6
|
+
PresentationBadgeDefinition,
|
|
7
|
+
PresentationModuleDefinition,
|
|
8
|
+
} from './module'
|
|
9
|
+
import {
|
|
10
|
+
resolvePresentationContent,
|
|
11
|
+
} from './presentation-content-resolution'
|
|
12
|
+
import {
|
|
13
|
+
formatPresentationValue,
|
|
14
|
+
isEmptyPresentationValue,
|
|
15
|
+
readPresentationFieldValue,
|
|
16
|
+
resolvePresentationTemplate,
|
|
17
|
+
resolvePresentationValue,
|
|
18
|
+
} from './presentation-value-resolution'
|
|
19
|
+
|
|
20
|
+
export interface ResolvedPresentationBadge {
|
|
21
|
+
readonly id?: string
|
|
22
|
+
readonly label: string
|
|
23
|
+
readonly tone?: string | null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function resolvePresentationBadges(
|
|
27
|
+
badges: readonly PresentationBadgeDefinition[] | null | undefined,
|
|
28
|
+
data: unknown,
|
|
29
|
+
module: Pick<PresentationModuleDefinition, 'Fields'> | null,
|
|
30
|
+
): readonly ResolvedPresentationBadge[] {
|
|
31
|
+
return badges?.flatMap((badge) =>
|
|
32
|
+
resolvePresentationBadge(badge, data, module),
|
|
33
|
+
) ?? []
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function resolvePresentationBadge(
|
|
37
|
+
badge: PresentationBadgeDefinition,
|
|
38
|
+
data: unknown,
|
|
39
|
+
module: Pick<PresentationModuleDefinition, 'Fields'> | null,
|
|
40
|
+
): readonly ResolvedPresentationBadge[] {
|
|
41
|
+
const field = badge.FieldId
|
|
42
|
+
? findPresentationField<FieldPresentationDefinition>(module, badge.FieldId)
|
|
43
|
+
: null
|
|
44
|
+
if (badge.FieldId && !field && !badge.Value && !badge.ValueTemplate && !badge.Content) {
|
|
45
|
+
return []
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const value = badge.Value
|
|
49
|
+
? resolvePresentationValue(badge.Value, data)
|
|
50
|
+
: readPresentationFieldValue(data, field?.Field)
|
|
51
|
+
const hasValue = Boolean(badge.Value || field?.Field)
|
|
52
|
+
if (
|
|
53
|
+
hasValue &&
|
|
54
|
+
(
|
|
55
|
+
(badge.OmitWhenEmpty && isEmptyPresentationValue(value)) ||
|
|
56
|
+
(badge.OmitWhenZero && isZeroPresentationValue(value))
|
|
57
|
+
)
|
|
58
|
+
) {
|
|
59
|
+
return []
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const formattedValue =
|
|
63
|
+
formatPresentationBadgeFieldValue(value, field) ??
|
|
64
|
+
formatPresentationValue(value)
|
|
65
|
+
const label =
|
|
66
|
+
resolvePresentationBadgeContentLabel(badge, data, field) ??
|
|
67
|
+
resolvePresentationTemplate(badge.ValueTemplate, data) ??
|
|
68
|
+
formatFieldBackedBadgeLabel(formattedValue, badge, field) ??
|
|
69
|
+
badge.Name
|
|
70
|
+
if (badge.OmitWhenEmpty && isEmptyPresentationValue(label)) {
|
|
71
|
+
return []
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return [{
|
|
75
|
+
id: badge.Id,
|
|
76
|
+
label,
|
|
77
|
+
tone: badge.Tone,
|
|
78
|
+
}]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function formatFieldBackedBadgeLabel(
|
|
82
|
+
formattedValue: string | null,
|
|
83
|
+
badge: PresentationBadgeDefinition,
|
|
84
|
+
field: FieldPresentationDefinition | null,
|
|
85
|
+
) {
|
|
86
|
+
if (!formattedValue) {
|
|
87
|
+
return null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (badge.Value || badge.ValueTemplate || !badge.FieldId) {
|
|
91
|
+
return formattedValue
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const label = field?.Label ?? badge.Name
|
|
95
|
+
return label ? `${label}: ${formattedValue}` : formattedValue
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function resolvePresentationBadgeContentLabel(
|
|
99
|
+
badge: PresentationBadgeDefinition,
|
|
100
|
+
data: unknown,
|
|
101
|
+
field: FieldPresentationDefinition | null,
|
|
102
|
+
) {
|
|
103
|
+
const content = badge.Content
|
|
104
|
+
if (!content) {
|
|
105
|
+
return null
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const descriptionValue = resolvePresentationValue(content.Description, data)
|
|
109
|
+
if (descriptionValue !== undefined && descriptionValue !== null) {
|
|
110
|
+
return (
|
|
111
|
+
formatPresentationBadgeFieldValue(descriptionValue, field) ??
|
|
112
|
+
formatPresentationValue(descriptionValue)
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const resolvedContent = resolvePresentationContent(content, data)
|
|
117
|
+
return resolvedContent.description ?? resolvedContent.title ?? resolvedContent.subtitle
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function isZeroPresentationValue(value: unknown) {
|
|
121
|
+
return value === 0 || value === '0'
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function formatPresentationBadgeFieldValue(
|
|
125
|
+
value: unknown,
|
|
126
|
+
field: FieldPresentationDefinition | null,
|
|
127
|
+
) {
|
|
128
|
+
const labels = field?.Display?.ValueLabels
|
|
129
|
+
if (!labels || value === null || value === undefined) {
|
|
130
|
+
return null
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const key = String(value)
|
|
134
|
+
return labels.find((label) =>
|
|
135
|
+
label.Value === key ||
|
|
136
|
+
label.Value.toLocaleLowerCase() === key.toLocaleLowerCase(),
|
|
137
|
+
)?.Label ?? null
|
|
138
|
+
}
|