@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,345 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findPresentationView,
|
|
3
|
+
type FlowDefinition,
|
|
4
|
+
type PresentationModuleDefinition,
|
|
5
|
+
type PromptDocumentPreviewDefinition,
|
|
6
|
+
type ViewDefinition,
|
|
7
|
+
} from './module'
|
|
8
|
+
import { conventionalPreviewResourceFields } from '@cohesivesystems/presentation-contracts'
|
|
9
|
+
import {
|
|
10
|
+
presentationDataSourceBindings,
|
|
11
|
+
type PresentationDataSourceAuthorizationRequirement,
|
|
12
|
+
type PresentationDataSourceBinding,
|
|
13
|
+
} from './presentation-data-source-binding-model'
|
|
14
|
+
import { readObjectProperty } from './object-path'
|
|
15
|
+
import {
|
|
16
|
+
resolvePresentationContent,
|
|
17
|
+
} from './presentation-content-resolution'
|
|
18
|
+
import {
|
|
19
|
+
formatPresentationValue,
|
|
20
|
+
readPresentationFieldValue,
|
|
21
|
+
resolvePresentationTemplate,
|
|
22
|
+
resolvePresentationValue,
|
|
23
|
+
} from './presentation-value-resolution'
|
|
24
|
+
|
|
25
|
+
export type ProjectedPromptDocumentPreviewResource = Readonly<Record<string, unknown>> & {
|
|
26
|
+
readonly Document?: unknown
|
|
27
|
+
readonly Id?: string | null
|
|
28
|
+
readonly Name?: string | null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ProjectedPromptDocumentPreviewData<
|
|
32
|
+
TResponse = unknown,
|
|
33
|
+
TRequest = unknown,
|
|
34
|
+
TResource extends ProjectedPromptDocumentPreviewResource =
|
|
35
|
+
ProjectedPromptDocumentPreviewResource,
|
|
36
|
+
TValues extends Readonly<Record<string, unknown>> = Readonly<Record<string, never>>,
|
|
37
|
+
> = TValues & {
|
|
38
|
+
readonly request: TRequest
|
|
39
|
+
readonly response: TResponse
|
|
40
|
+
readonly resource: TResource
|
|
41
|
+
readonly text: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ProjectPromptDocumentPreviewDataOptions<
|
|
45
|
+
TResponse,
|
|
46
|
+
TRequest,
|
|
47
|
+
TResource extends ProjectedPromptDocumentPreviewResource,
|
|
48
|
+
TValues extends Readonly<Record<string, unknown>>,
|
|
49
|
+
> {
|
|
50
|
+
readonly definition?: PromptDocumentPreviewDefinition | null
|
|
51
|
+
readonly request?: TRequest
|
|
52
|
+
readonly resource?: TResource | null
|
|
53
|
+
readonly response: TResponse
|
|
54
|
+
readonly values?: TValues
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface PromptDocumentPreviewDataSourceState {
|
|
58
|
+
readonly data?: unknown
|
|
59
|
+
readonly error?: unknown
|
|
60
|
+
readonly isFetching?: boolean
|
|
61
|
+
readonly isPending?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface PromptDocumentPreviewFlowEntryProjection {
|
|
65
|
+
readonly flow: Pick<FlowDefinition, 'Id'>
|
|
66
|
+
readonly view: ViewDefinition | null
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function findPromptDocumentPreviewView(
|
|
70
|
+
module: PresentationModuleDefinition | null,
|
|
71
|
+
promptView: ViewDefinition | null | undefined,
|
|
72
|
+
): ViewDefinition | null {
|
|
73
|
+
if (!module || !promptView) {
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (promptView.PromptDocumentPreview) {
|
|
78
|
+
return promptView
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
for (const region of promptView.Regions) {
|
|
82
|
+
for (const viewId of region.ViewIds) {
|
|
83
|
+
const view = findPresentationView<ViewDefinition>(module, viewId)
|
|
84
|
+
if (view?.PromptDocumentPreview) {
|
|
85
|
+
return view
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return null
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function createPromptDocumentPreviewDataSourceBindings({
|
|
94
|
+
activeEntries,
|
|
95
|
+
authorization,
|
|
96
|
+
module,
|
|
97
|
+
state,
|
|
98
|
+
statesByFlowId,
|
|
99
|
+
}: {
|
|
100
|
+
readonly activeEntries: readonly PromptDocumentPreviewFlowEntryProjection[]
|
|
101
|
+
readonly authorization: PresentationDataSourceAuthorizationRequirement
|
|
102
|
+
readonly module: PresentationModuleDefinition | null
|
|
103
|
+
readonly state?: PromptDocumentPreviewDataSourceState | null
|
|
104
|
+
readonly statesByFlowId?: Readonly<Record<string, PromptDocumentPreviewDataSourceState | null | undefined>>
|
|
105
|
+
}): readonly PresentationDataSourceBinding[] {
|
|
106
|
+
return activeEntries.flatMap((entry) => {
|
|
107
|
+
const previewState = statesByFlowId?.[entry.flow.Id] ?? state
|
|
108
|
+
const dataSourceIds = resolvePromptDocumentPreviewDataSourceIds(module, entry.view)
|
|
109
|
+
return dataSourceIds.map((dataSourceId) =>
|
|
110
|
+
presentationDataSourceBindings.localValue({
|
|
111
|
+
authorization,
|
|
112
|
+
data: previewState?.data ?? null,
|
|
113
|
+
dataSourceId,
|
|
114
|
+
error: previewState?.error,
|
|
115
|
+
isFetching: previewState?.isFetching,
|
|
116
|
+
isPending: previewState?.isPending,
|
|
117
|
+
}),
|
|
118
|
+
)
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function resolvePromptDocumentPreviewDataSourceIds(
|
|
123
|
+
module: PresentationModuleDefinition | null,
|
|
124
|
+
promptView: ViewDefinition | null | undefined,
|
|
125
|
+
) {
|
|
126
|
+
const previewView = findPromptDocumentPreviewView(module, promptView)
|
|
127
|
+
return previewView?.PromptDocumentPreview?.DataSourceId
|
|
128
|
+
? [previewView.PromptDocumentPreview.DataSourceId]
|
|
129
|
+
: []
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function findPromptDocumentPreviewRegionId(
|
|
133
|
+
promptView: ViewDefinition,
|
|
134
|
+
previewViewId: string,
|
|
135
|
+
) {
|
|
136
|
+
return promptView.Regions.find((region) => region.ViewIds.includes(previewViewId))?.Id ?? null
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function findPromptDocumentPreviewStatusRegionId(
|
|
140
|
+
promptView: ViewDefinition,
|
|
141
|
+
previewViewId: string,
|
|
142
|
+
) {
|
|
143
|
+
const previewRegionId = findPromptDocumentPreviewRegionId(promptView, previewViewId)
|
|
144
|
+
const messages = promptView.PromptStatusMessages ?? []
|
|
145
|
+
const statusMessages = messages.filter(
|
|
146
|
+
(message) =>
|
|
147
|
+
message.Region !== previewRegionId &&
|
|
148
|
+
message.Region.toLocaleLowerCase().includes('status'),
|
|
149
|
+
)
|
|
150
|
+
if (previewRegionId) {
|
|
151
|
+
const previewRegionStatusMessage = statusMessages.find((message) =>
|
|
152
|
+
message.Region.toLocaleLowerCase().includes(previewRegionId.toLocaleLowerCase()),
|
|
153
|
+
)
|
|
154
|
+
if (previewRegionStatusMessage) {
|
|
155
|
+
return previewRegionStatusMessage.Region
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return statusMessages[0]?.Region ?? null
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function projectPromptDocumentPreviewData<
|
|
163
|
+
TResponse,
|
|
164
|
+
TRequest = unknown,
|
|
165
|
+
TResource extends ProjectedPromptDocumentPreviewResource =
|
|
166
|
+
ProjectedPromptDocumentPreviewResource,
|
|
167
|
+
TValues extends Readonly<Record<string, unknown>> = Readonly<Record<string, never>>,
|
|
168
|
+
>({
|
|
169
|
+
definition,
|
|
170
|
+
request,
|
|
171
|
+
resource,
|
|
172
|
+
response,
|
|
173
|
+
values,
|
|
174
|
+
}: ProjectPromptDocumentPreviewDataOptions<
|
|
175
|
+
TResponse,
|
|
176
|
+
TRequest,
|
|
177
|
+
TResource,
|
|
178
|
+
TValues
|
|
179
|
+
>): ProjectedPromptDocumentPreviewData<TResponse, TRequest, TResource, TValues> {
|
|
180
|
+
const responseFields = isRecord(response) ? response : {}
|
|
181
|
+
const responseResource = (
|
|
182
|
+
readRecord(responseFields, 'resource') ??
|
|
183
|
+
readRecord(responseFields, 'Resource')
|
|
184
|
+
) as TResource | null
|
|
185
|
+
const projectedResource =
|
|
186
|
+
resource ??
|
|
187
|
+
responseResource ??
|
|
188
|
+
createConventionalPreviewResource(responseFields, response) as TResource
|
|
189
|
+
const data = {
|
|
190
|
+
...responseFields,
|
|
191
|
+
...values,
|
|
192
|
+
request,
|
|
193
|
+
response,
|
|
194
|
+
resource: projectedResource,
|
|
195
|
+
}
|
|
196
|
+
const text = resolvePromptDocumentPreviewText(definition, data)
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
...data,
|
|
200
|
+
text,
|
|
201
|
+
} as ProjectedPromptDocumentPreviewData<TResponse, TRequest, TResource, TValues>
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function resolvePromptDocumentPreviewText(
|
|
205
|
+
definition: PromptDocumentPreviewDefinition | null | undefined,
|
|
206
|
+
data: unknown,
|
|
207
|
+
) {
|
|
208
|
+
const contentText = resolvePromptDocumentPreviewContentText(definition, data)
|
|
209
|
+
if (contentText !== null) {
|
|
210
|
+
return contentText
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const definedValue = resolvePresentationValue(definition?.DocumentText, data)
|
|
214
|
+
if (definedValue !== undefined && definedValue !== null) {
|
|
215
|
+
return formatPromptDocumentText(definedValue)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const resourceDocument = readPresentationFieldValue(data, 'resource.Document')
|
|
219
|
+
if (resourceDocument !== undefined && resourceDocument !== null) {
|
|
220
|
+
return formatPromptDocumentText(resourceDocument)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const responseDocument = readPresentationFieldValue(data, 'response.Document')
|
|
224
|
+
if (responseDocument !== undefined && responseDocument !== null) {
|
|
225
|
+
return formatPromptDocumentText(responseDocument)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return formatPromptDocumentText(data)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function resolvePromptDocumentPreviewTitle(
|
|
232
|
+
definition: PromptDocumentPreviewDefinition | null | undefined,
|
|
233
|
+
data: unknown,
|
|
234
|
+
fallback = 'Document preview',
|
|
235
|
+
) {
|
|
236
|
+
const content = resolvePresentationContent(definition?.Content, data)
|
|
237
|
+
return (
|
|
238
|
+
content.title ??
|
|
239
|
+
formatPresentationValue(resolvePresentationValue(definition?.Title, data)) ??
|
|
240
|
+
fallback
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function resolvePromptDocumentPreviewPath(
|
|
245
|
+
definition: PromptDocumentPreviewDefinition | null | undefined,
|
|
246
|
+
data: unknown,
|
|
247
|
+
fallback = 'document-preview.json',
|
|
248
|
+
) {
|
|
249
|
+
return resolvePresentationTemplate(definition?.DocumentPathTemplate, data) ?? fallback
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function resolvePromptDocumentPreviewContentText(
|
|
253
|
+
definition: PromptDocumentPreviewDefinition | null | undefined,
|
|
254
|
+
data: unknown,
|
|
255
|
+
) {
|
|
256
|
+
const content = definition?.Content
|
|
257
|
+
if (!content) {
|
|
258
|
+
return null
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const description = resolvePresentationValue(content.Description, data)
|
|
262
|
+
if (description !== undefined && description !== null) {
|
|
263
|
+
return formatPromptDocumentText(description)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const descriptionTemplate = resolvePresentationTemplate(content.DescriptionTemplate, data)
|
|
267
|
+
if (descriptionTemplate !== null) {
|
|
268
|
+
return descriptionTemplate
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const subtitle = resolvePresentationValue(content.Subtitle, data)
|
|
272
|
+
return subtitle === undefined || subtitle === null ? null : formatPromptDocumentText(subtitle)
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function createConventionalPreviewResource(
|
|
276
|
+
responseFields: Readonly<Record<string, unknown>>,
|
|
277
|
+
response: unknown,
|
|
278
|
+
): ProjectedPromptDocumentPreviewResource {
|
|
279
|
+
const document = readPreviewField(responseFields, 'Document') ?? response
|
|
280
|
+
const id =
|
|
281
|
+
readPreviewStringField(responseFields, 'Id') ??
|
|
282
|
+
readPreviewStringField(responseFields, 'ShapeGraphId') ??
|
|
283
|
+
readPreviewStringField(responseFields, 'DocumentId')
|
|
284
|
+
const name =
|
|
285
|
+
readPreviewStringField(responseFields, 'Name') ??
|
|
286
|
+
readPreviewStringField(responseFields, 'Title') ??
|
|
287
|
+
id
|
|
288
|
+
const resource: Record<string, unknown> = {
|
|
289
|
+
Document: document,
|
|
290
|
+
Id: id,
|
|
291
|
+
Name: name,
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
for (const field of Object.values(conventionalPreviewResourceFields)) {
|
|
295
|
+
const value = readPreviewField(responseFields, field)
|
|
296
|
+
if (value !== undefined) {
|
|
297
|
+
resource[field] = value
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return resource
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function formatPromptDocumentText(value: unknown) {
|
|
305
|
+
if (typeof value === 'string') {
|
|
306
|
+
return value
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (value === null || value === undefined) {
|
|
310
|
+
return ''
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
try {
|
|
314
|
+
return JSON.stringify(value, null, 2)
|
|
315
|
+
} catch {
|
|
316
|
+
return String(value)
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function readRecord(
|
|
321
|
+
source: Readonly<Record<string, unknown>>,
|
|
322
|
+
key: string,
|
|
323
|
+
) {
|
|
324
|
+
const value = readObjectProperty(source, key)
|
|
325
|
+
return isRecord(value) ? value : null
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function readPreviewStringField(
|
|
329
|
+
source: Readonly<Record<string, unknown>>,
|
|
330
|
+
key: string,
|
|
331
|
+
) {
|
|
332
|
+
const value = readPreviewField(source, key)
|
|
333
|
+
return typeof value === 'string' ? value : null
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function readPreviewField(
|
|
337
|
+
source: Readonly<Record<string, unknown>>,
|
|
338
|
+
key: string,
|
|
339
|
+
) {
|
|
340
|
+
return readObjectProperty(source, key)
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
344
|
+
return Boolean(value && typeof value === 'object' && !Array.isArray(value))
|
|
345
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getErrorMessage,
|
|
3
|
+
} from './projected-activity-state-model'
|
|
4
|
+
import type { ProjectedDocumentActionStatusMap } from './projected-action-status-projection'
|
|
5
|
+
import {
|
|
6
|
+
resolvePresentationContent,
|
|
7
|
+
} from './presentation-content-resolution'
|
|
8
|
+
import {
|
|
9
|
+
formatPresentationValue,
|
|
10
|
+
resolvePresentationTemplate,
|
|
11
|
+
} from './presentation-value-resolution'
|
|
12
|
+
import type { PresentationDataSourceResolver } from './presentation-data-source-runtime'
|
|
13
|
+
import type { ViewDefinition } from './module'
|
|
14
|
+
import {
|
|
15
|
+
promptStatusMessageKinds,
|
|
16
|
+
type PromptStatusMessageDefinition,
|
|
17
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
18
|
+
|
|
19
|
+
export interface ProjectedPromptStatusMessage {
|
|
20
|
+
readonly definition: PromptStatusMessageDefinition
|
|
21
|
+
readonly label: string
|
|
22
|
+
readonly tone: 'default' | 'error'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ResolvePromptStatusMessagesOptions {
|
|
26
|
+
readonly actionStatuses: ProjectedDocumentActionStatusMap
|
|
27
|
+
readonly dataSourceResolver: PresentationDataSourceResolver
|
|
28
|
+
readonly region?: string
|
|
29
|
+
readonly view: Pick<ViewDefinition, 'PromptStatusMessages'>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function resolvePromptStatusMessages({
|
|
33
|
+
actionStatuses,
|
|
34
|
+
dataSourceResolver,
|
|
35
|
+
region,
|
|
36
|
+
view,
|
|
37
|
+
}: ResolvePromptStatusMessagesOptions): readonly ProjectedPromptStatusMessage[] {
|
|
38
|
+
return (view.PromptStatusMessages ?? []).flatMap((definition) => {
|
|
39
|
+
if (region && definition.Region !== region) {
|
|
40
|
+
return []
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const label = resolvePromptStatusMessageLabel({
|
|
44
|
+
actionStatuses,
|
|
45
|
+
dataSourceResolver,
|
|
46
|
+
definition,
|
|
47
|
+
})
|
|
48
|
+
if (!label) {
|
|
49
|
+
return []
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return [{
|
|
53
|
+
definition,
|
|
54
|
+
label,
|
|
55
|
+
tone: isErrorTone(definition) ? 'error' : 'default',
|
|
56
|
+
}]
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function resolvePromptStatusMessageText(
|
|
61
|
+
options: ResolvePromptStatusMessagesOptions,
|
|
62
|
+
) {
|
|
63
|
+
return resolvePromptStatusMessages(options)[0]?.label ?? null
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function resolvePromptStatusMessageLabel({
|
|
67
|
+
actionStatuses,
|
|
68
|
+
dataSourceResolver,
|
|
69
|
+
definition,
|
|
70
|
+
}: {
|
|
71
|
+
readonly actionStatuses: ProjectedDocumentActionStatusMap
|
|
72
|
+
readonly dataSourceResolver: PresentationDataSourceResolver
|
|
73
|
+
readonly definition: PromptStatusMessageDefinition
|
|
74
|
+
}) {
|
|
75
|
+
if (definition.Kind === promptStatusMessageKinds.actionPending) {
|
|
76
|
+
return definition.ActionId && actionStatuses[definition.ActionId]?.isPending
|
|
77
|
+
? resolvePromptStatusMessageContent(
|
|
78
|
+
definition,
|
|
79
|
+
actionStatuses[definition.ActionId],
|
|
80
|
+
definition.Message,
|
|
81
|
+
)
|
|
82
|
+
: null
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (definition.Kind === promptStatusMessageKinds.actionError) {
|
|
86
|
+
const error = definition.ActionId
|
|
87
|
+
? actionStatuses[definition.ActionId]?.error
|
|
88
|
+
: null
|
|
89
|
+
const errorMessage = error ? getErrorMessage(error) : null
|
|
90
|
+
return errorMessage
|
|
91
|
+
? resolvePromptStatusMessageContent(definition, { error, errorMessage }, errorMessage)
|
|
92
|
+
: null
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (
|
|
96
|
+
definition.Kind === promptStatusMessageKinds.dataFieldEquals ||
|
|
97
|
+
definition.Kind === promptStatusMessageKinds.dataFieldTruthy
|
|
98
|
+
) {
|
|
99
|
+
const dataSourceId = definition.DataSourceId
|
|
100
|
+
if (!dataSourceId) {
|
|
101
|
+
return null
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const value = dataSourceResolver.readPath(dataSourceId, definition.FieldPath)
|
|
105
|
+
if (
|
|
106
|
+
definition.Kind === promptStatusMessageKinds.dataFieldEquals &&
|
|
107
|
+
!doesPromptStatusValueEqual(value, definition.ExpectedValue)
|
|
108
|
+
) {
|
|
109
|
+
return null
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
definition.Kind === promptStatusMessageKinds.dataFieldTruthy &&
|
|
114
|
+
!isPromptStatusTruthy(value)
|
|
115
|
+
) {
|
|
116
|
+
return null
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const data = dataSourceResolver.read(dataSourceId)
|
|
120
|
+
const legacyLabel =
|
|
121
|
+
resolvePresentationTemplate(definition.MessageTemplate, data) ??
|
|
122
|
+
definition.Message
|
|
123
|
+
return (
|
|
124
|
+
resolvePromptStatusMessageContent(definition, data, legacyLabel)
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function resolvePromptStatusMessageContent(
|
|
132
|
+
definition: PromptStatusMessageDefinition,
|
|
133
|
+
data: unknown,
|
|
134
|
+
fallbackLabel: string,
|
|
135
|
+
) {
|
|
136
|
+
const content = resolvePresentationContent(definition.Content, data)
|
|
137
|
+
return content.description ?? content.title ?? content.subtitle ?? fallbackLabel
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function doesPromptStatusValueEqual(value: unknown, expected: string | null | undefined) {
|
|
141
|
+
if (expected === null || expected === undefined) {
|
|
142
|
+
return isPromptStatusTruthy(value)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return formatPresentationValue(value) === expected
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function isPromptStatusTruthy(value: unknown) {
|
|
149
|
+
return Boolean(value) && value !== 'false' && value !== '0'
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function isErrorTone(definition: PromptStatusMessageDefinition) {
|
|
153
|
+
return (
|
|
154
|
+
definition.Kind === promptStatusMessageKinds.actionError ||
|
|
155
|
+
definition.Tone === 'danger' ||
|
|
156
|
+
definition.Tone === 'error'
|
|
157
|
+
)
|
|
158
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InputFormDefinition,
|
|
3
|
+
InputFormFieldDefinition,
|
|
4
|
+
PresentationModuleDefinition,
|
|
5
|
+
QueryFormDefinition,
|
|
6
|
+
} from './module'
|
|
7
|
+
import { readObjectPath } from './object-path'
|
|
8
|
+
|
|
9
|
+
export interface QueryFormFieldValueNormalizationContext {
|
|
10
|
+
readonly field: InputFormFieldDefinition
|
|
11
|
+
readonly inputForm: InputFormDefinition
|
|
12
|
+
readonly queryForm: QueryFormDefinition
|
|
13
|
+
readonly value: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface LowerQueryFormEndpointRequestOptions {
|
|
17
|
+
readonly normalizeFieldValue?: (context: QueryFormFieldValueNormalizationContext) => unknown
|
|
18
|
+
readonly inputForm: InputFormDefinition
|
|
19
|
+
readonly queryForm: QueryFormDefinition
|
|
20
|
+
readonly value: object
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function findPresentationQueryFormForResultDataSource(
|
|
24
|
+
module: PresentationModuleDefinition | null,
|
|
25
|
+
dataSourceId: string,
|
|
26
|
+
) {
|
|
27
|
+
return module?.QueryForms.find(
|
|
28
|
+
(queryForm) =>
|
|
29
|
+
queryForm.Target.Result.DataSourceId === dataSourceId ||
|
|
30
|
+
queryForm.Target.State.ResultDataSourceId === dataSourceId ||
|
|
31
|
+
queryForm.Target.State.SynchronizedDataSourceIds.includes(dataSourceId),
|
|
32
|
+
) ?? null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function lowerQueryFormEndpointRequest({
|
|
36
|
+
inputForm,
|
|
37
|
+
normalizeFieldValue,
|
|
38
|
+
queryForm,
|
|
39
|
+
value,
|
|
40
|
+
}: LowerQueryFormEndpointRequestOptions): Record<string, unknown> {
|
|
41
|
+
const fieldsById = new Map(inputForm.Fields.map((field) => [field.Id, field]))
|
|
42
|
+
const request: Record<string, unknown> = {}
|
|
43
|
+
|
|
44
|
+
for (const binding of queryForm.Target.Result.RequestBindings) {
|
|
45
|
+
const field = fieldsById.get(binding.FieldId)
|
|
46
|
+
if (!field) {
|
|
47
|
+
continue
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const rawFieldValue = readObjectPath(value, field.ValuePath)
|
|
51
|
+
const normalizedFieldValue = normalizeFieldValue
|
|
52
|
+
? normalizeFieldValue({ field, inputForm, queryForm, value: rawFieldValue })
|
|
53
|
+
: rawFieldValue
|
|
54
|
+
const requestValue = binding.ValuePath
|
|
55
|
+
? readObjectPath(normalizedFieldValue, binding.ValuePath)
|
|
56
|
+
: normalizedFieldValue
|
|
57
|
+
|
|
58
|
+
if (binding.OmitWhenEmpty && isEmptyRequestValue(requestValue)) {
|
|
59
|
+
continue
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
request[binding.RequestField] = requestValue
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (queryForm.Target.Result.DefaultLimit !== null && queryForm.Target.Result.DefaultLimit !== undefined) {
|
|
66
|
+
request.Limit ??= queryForm.Target.Result.DefaultLimit
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return request
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function isEmptyRequestValue(value: unknown) {
|
|
73
|
+
return value === null ||
|
|
74
|
+
value === undefined ||
|
|
75
|
+
value === '' ||
|
|
76
|
+
(Array.isArray(value) && value.length === 0)
|
|
77
|
+
}
|