@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,133 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DocumentProfileProjection,
|
|
3
|
+
} from './document-module'
|
|
4
|
+
import type {
|
|
5
|
+
ActionPlacementDefinition,
|
|
6
|
+
} from './module'
|
|
7
|
+
|
|
8
|
+
export type ProjectedDocumentActionRuntimeProfile =
|
|
9
|
+
NonNullable<DocumentProfileProjection['ActionRuntimeProfiles']>[number]
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Frontend runtime selection contract derived from a document action runtime
|
|
13
|
+
* profile declared by the presentation module.
|
|
14
|
+
*
|
|
15
|
+
* The spec keeps semantic identifiers and state conventions in core while
|
|
16
|
+
* allowing application adapters to supply concrete preview/start request and
|
|
17
|
+
* response types.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam TPreviewRequest - Request shape sent to the action preview endpoint.
|
|
20
|
+
* @typeParam TPreviewResponse - Response shape returned from the action preview endpoint.
|
|
21
|
+
* @typeParam TStartInput - Input shape used to start the action after preview.
|
|
22
|
+
* @typeParam TStartResult - Result shape returned when the action is started.
|
|
23
|
+
* @typeParam TMetadata - Metadata shape associated with the action runtime.
|
|
24
|
+
*/
|
|
25
|
+
export interface ProjectedDocumentActionRuntimeProfileSpec<
|
|
26
|
+
TPreviewRequest extends object = Record<string, unknown>,
|
|
27
|
+
TPreviewResponse = unknown,
|
|
28
|
+
TStartInput = TPreviewRequest,
|
|
29
|
+
TStartResult = unknown,
|
|
30
|
+
TMetadata = unknown,
|
|
31
|
+
> {
|
|
32
|
+
/** Action id that this runtime profile handles. */
|
|
33
|
+
readonly actionId?: string
|
|
34
|
+
|
|
35
|
+
/** Prefix used when registering diagnostics for this runtime profile. */
|
|
36
|
+
readonly diagnosticsKeyPrefix?: string
|
|
37
|
+
|
|
38
|
+
/** Presentation flow id used for preview/review UI, when one is modeled. */
|
|
39
|
+
readonly flowId?: string | null
|
|
40
|
+
|
|
41
|
+
/** Runtime profile id selected from the document profile projection. */
|
|
42
|
+
readonly profileId?: string
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Optional suffix used to partition process input state for this action.
|
|
46
|
+
*/
|
|
47
|
+
readonly processInputStateKeySuffix?: string | null
|
|
48
|
+
|
|
49
|
+
/** Source identifier for tracing where this runtime profile was projected. */
|
|
50
|
+
readonly source?: string
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Compile-time-only type anchors for application adapters. These values are
|
|
54
|
+
* not populated by projection; they preserve strongly typed request,
|
|
55
|
+
* response, result, and metadata shapes through generic inference.
|
|
56
|
+
*/
|
|
57
|
+
readonly typeHints?: {
|
|
58
|
+
/** Metadata shape associated with the runtime profile. */
|
|
59
|
+
readonly metadata?: TMetadata
|
|
60
|
+
|
|
61
|
+
/** Preview request shape sent before starting the action. */
|
|
62
|
+
readonly previewRequest?: TPreviewRequest
|
|
63
|
+
|
|
64
|
+
/** Preview response shape rendered by the review flow. */
|
|
65
|
+
readonly previewResponse?: TPreviewResponse
|
|
66
|
+
|
|
67
|
+
/** Start input shape submitted when the action is accepted. */
|
|
68
|
+
readonly startInput?: TStartInput
|
|
69
|
+
|
|
70
|
+
/** Start result shape returned after the action is accepted. */
|
|
71
|
+
readonly startResult?: TStartResult
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SelectDocumentActionRuntimeProfileOptions {
|
|
76
|
+
readonly actionPlacements?: readonly ActionPlacementDefinition[]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Selects the document action runtime profile that best matches placed actions
|
|
81
|
+
* for a document workspace profile.
|
|
82
|
+
*/
|
|
83
|
+
export function selectDocumentActionRuntimeProfile(
|
|
84
|
+
documentProfile: Pick<DocumentProfileProjection, 'ActionRuntimeProfiles' | 'Actions'> | null,
|
|
85
|
+
options: SelectDocumentActionRuntimeProfileOptions = {},
|
|
86
|
+
): ProjectedDocumentActionRuntimeProfile | null {
|
|
87
|
+
const profiles = documentProfile?.ActionRuntimeProfiles ?? []
|
|
88
|
+
if (profiles.length <= 1) {
|
|
89
|
+
return profiles[0] ?? null
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const actionPlacements = options.actionPlacements ?? documentProfile?.Actions ?? []
|
|
93
|
+
const placedActionIds = new Set(actionPlacements.map((placement) => placement.ActionId))
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
profiles.find((profile) => placedActionIds.has(profile.ActionId)) ??
|
|
97
|
+
profiles[0] ??
|
|
98
|
+
null
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Projects a backend-declared document action runtime profile into the frontend
|
|
104
|
+
* action-runtime spec consumed by document workspace adapters.
|
|
105
|
+
*/
|
|
106
|
+
export function projectDocumentActionRuntimeProfileSpec<
|
|
107
|
+
TPreviewRequest extends object = Record<string, unknown>,
|
|
108
|
+
TPreviewResponse = unknown,
|
|
109
|
+
TStartInput = TPreviewRequest,
|
|
110
|
+
TStartResult = unknown,
|
|
111
|
+
TMetadata = unknown,
|
|
112
|
+
>(
|
|
113
|
+
documentProfile: Pick<DocumentProfileProjection, 'ActionRuntimeProfiles' | 'Actions'> | null,
|
|
114
|
+
options: SelectDocumentActionRuntimeProfileOptions = {},
|
|
115
|
+
): ProjectedDocumentActionRuntimeProfileSpec<
|
|
116
|
+
TPreviewRequest,
|
|
117
|
+
TPreviewResponse,
|
|
118
|
+
TStartInput,
|
|
119
|
+
TStartResult,
|
|
120
|
+
TMetadata
|
|
121
|
+
> | null {
|
|
122
|
+
const profile = selectDocumentActionRuntimeProfile(documentProfile, options)
|
|
123
|
+
return profile
|
|
124
|
+
? {
|
|
125
|
+
actionId: profile.ActionId,
|
|
126
|
+
diagnosticsKeyPrefix: profile.DiagnosticsKeyPrefix,
|
|
127
|
+
flowId: profile.FlowId,
|
|
128
|
+
profileId: profile.Id,
|
|
129
|
+
processInputStateKeySuffix: profile.ProcessInputStateKeySuffix,
|
|
130
|
+
source: profile.Source,
|
|
131
|
+
}
|
|
132
|
+
: null
|
|
133
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { DocumentProfileProjection } from './document-module'
|
|
2
|
+
import {
|
|
3
|
+
findPresentationAction,
|
|
4
|
+
} from './module'
|
|
5
|
+
import type {
|
|
6
|
+
DocumentActionStatusNoticeDefinition,
|
|
7
|
+
PresentationModuleDefinition,
|
|
8
|
+
} from './module'
|
|
9
|
+
import {
|
|
10
|
+
projectPresentationContentDiagnostics,
|
|
11
|
+
} from './presentation-content-diagnostics'
|
|
12
|
+
import type {
|
|
13
|
+
PresentationProjectionDiagnostic,
|
|
14
|
+
} from './presentation-projection-diagnostics'
|
|
15
|
+
|
|
16
|
+
export interface ProjectDocumentActionStatusNoticeDiagnosticsOptions {
|
|
17
|
+
readonly module: Pick<PresentationModuleDefinition, 'Actions'> | null
|
|
18
|
+
readonly profile: Pick<DocumentProfileProjection, 'ActionStatusNotices'> | null
|
|
19
|
+
readonly region?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function projectDocumentActionStatusNoticeDiagnostics({
|
|
23
|
+
module,
|
|
24
|
+
profile,
|
|
25
|
+
region,
|
|
26
|
+
}: ProjectDocumentActionStatusNoticeDiagnosticsOptions): readonly PresentationProjectionDiagnostic[] {
|
|
27
|
+
return getRegionActionStatusNotices(profile, region).flatMap((notice) => [
|
|
28
|
+
...projectDocumentActionStatusNoticeContentDiagnostics(notice),
|
|
29
|
+
...projectDocumentActionStatusNoticeActionDiagnostics(module, notice),
|
|
30
|
+
])
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function projectDocumentActionStatusNoticeContentDiagnostics(
|
|
34
|
+
notice: DocumentActionStatusNoticeDefinition,
|
|
35
|
+
): readonly PresentationProjectionDiagnostic[] {
|
|
36
|
+
return projectPresentationContentDiagnostics({
|
|
37
|
+
content: notice.Content,
|
|
38
|
+
contentFallbackDescription: 'local action status error message fallback semantics',
|
|
39
|
+
descriptionFallbackDescription: 'local action status error message fallback semantics',
|
|
40
|
+
details: createDocumentActionStatusNoticeDiagnosticDetails(notice),
|
|
41
|
+
diagnosticIdPrefix: `action-status-notice.${notice.Id}.content`,
|
|
42
|
+
requireDescription: true,
|
|
43
|
+
source: 'document-workspace-notice-projection',
|
|
44
|
+
subject: createDocumentActionStatusNoticeDiagnosticSubject(notice),
|
|
45
|
+
surfaceLabel: `Action status notice '${notice.Name}'`,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function projectDocumentActionStatusNoticeActionDiagnostics(
|
|
50
|
+
module: Pick<PresentationModuleDefinition, 'Actions'> | null,
|
|
51
|
+
notice: DocumentActionStatusNoticeDefinition,
|
|
52
|
+
): readonly PresentationProjectionDiagnostic[] {
|
|
53
|
+
if (findPresentationAction(module, notice.ActionId)) {
|
|
54
|
+
return []
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return [
|
|
58
|
+
createDocumentActionStatusNoticeDiagnostic({
|
|
59
|
+
message:
|
|
60
|
+
`Action status notice '${notice.Name}' references action ` +
|
|
61
|
+
`'${notice.ActionId}', but the presentation module does not define it.`,
|
|
62
|
+
notice,
|
|
63
|
+
reason: 'missing-action',
|
|
64
|
+
severity: 'warning',
|
|
65
|
+
}),
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getRegionActionStatusNotices(
|
|
70
|
+
profile: Pick<DocumentProfileProjection, 'ActionStatusNotices'> | null,
|
|
71
|
+
region?: string,
|
|
72
|
+
) {
|
|
73
|
+
return profile?.ActionStatusNotices?.filter((notice) => !region || notice.Region === region) ?? []
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function createDocumentActionStatusNoticeDiagnostic({
|
|
77
|
+
message,
|
|
78
|
+
notice,
|
|
79
|
+
reason,
|
|
80
|
+
severity,
|
|
81
|
+
}: {
|
|
82
|
+
readonly message: string
|
|
83
|
+
readonly notice: DocumentActionStatusNoticeDefinition
|
|
84
|
+
readonly reason: string
|
|
85
|
+
readonly severity: PresentationProjectionDiagnostic['severity']
|
|
86
|
+
}): PresentationProjectionDiagnostic {
|
|
87
|
+
return {
|
|
88
|
+
details: createDocumentActionStatusNoticeDiagnosticDetails(notice),
|
|
89
|
+
id: `action-status-notice.${notice.Id}.${reason}`,
|
|
90
|
+
message,
|
|
91
|
+
severity,
|
|
92
|
+
source: 'document-workspace-notice-projection',
|
|
93
|
+
subject: createDocumentActionStatusNoticeDiagnosticSubject(notice),
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function createDocumentActionStatusNoticeDiagnosticDetails(
|
|
98
|
+
notice: DocumentActionStatusNoticeDefinition,
|
|
99
|
+
) {
|
|
100
|
+
return {
|
|
101
|
+
actionId: notice.ActionId,
|
|
102
|
+
kind: notice.Kind,
|
|
103
|
+
noticeId: notice.Id,
|
|
104
|
+
region: notice.Region,
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function createDocumentActionStatusNoticeDiagnosticSubject(
|
|
109
|
+
notice: DocumentActionStatusNoticeDefinition,
|
|
110
|
+
) {
|
|
111
|
+
return {
|
|
112
|
+
id: notice.Id,
|
|
113
|
+
kind: 'document-action-status-notice',
|
|
114
|
+
name: notice.Name,
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FieldPresentationDefinition,
|
|
3
|
+
PresentationModuleDefinition,
|
|
4
|
+
} from './module'
|
|
5
|
+
import type {
|
|
6
|
+
NavigationRouteParameters,
|
|
7
|
+
PresentationNavigationHrefFactory,
|
|
8
|
+
} from './navigation'
|
|
9
|
+
import {
|
|
10
|
+
readObjectPath,
|
|
11
|
+
} from './object-path'
|
|
12
|
+
import {
|
|
13
|
+
createPresentationEnumDiscriminator,
|
|
14
|
+
matchesPresentationEnum,
|
|
15
|
+
} from './target-bindings'
|
|
16
|
+
import {
|
|
17
|
+
presentationBindingKinds,
|
|
18
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Inputs used to project a document field value into a navigation binding.
|
|
22
|
+
*/
|
|
23
|
+
export interface ProjectDocumentFieldNavigationBindingOptions {
|
|
24
|
+
/** Optional route-to-href factory supplied by the host navigation runtime. */
|
|
25
|
+
readonly createHref?: PresentationNavigationHrefFactory
|
|
26
|
+
|
|
27
|
+
/** Presentation field whose target binding may declare a navigation route. */
|
|
28
|
+
readonly field: FieldPresentationDefinition
|
|
29
|
+
|
|
30
|
+
/** Presentation module target bindings used to find the field route binding. */
|
|
31
|
+
readonly module: Pick<PresentationModuleDefinition, 'Targets'> | null
|
|
32
|
+
|
|
33
|
+
/** Resource that contains route parameter source fields. */
|
|
34
|
+
readonly resource: unknown
|
|
35
|
+
|
|
36
|
+
/** Field value rendered as the navigation label and default route parameter. */
|
|
37
|
+
readonly value: unknown
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Concrete navigation binding projected from a document field.
|
|
42
|
+
*/
|
|
43
|
+
export interface ProjectedDocumentFieldNavigationBinding {
|
|
44
|
+
/** Host-generated href, or `null` when no href factory was supplied. */
|
|
45
|
+
readonly href: string | null
|
|
46
|
+
|
|
47
|
+
/** Scalar label rendered for the navigable field value. */
|
|
48
|
+
readonly label: string
|
|
49
|
+
|
|
50
|
+
/** Required route parameter names that could not be resolved. */
|
|
51
|
+
readonly missingParameterNames: readonly string[]
|
|
52
|
+
|
|
53
|
+
/** Route parameter values projected from the field value and resource. */
|
|
54
|
+
readonly parameters: NavigationRouteParameters
|
|
55
|
+
|
|
56
|
+
/** Human-facing prefix rendered before the navigation label. */
|
|
57
|
+
readonly prefix: string
|
|
58
|
+
|
|
59
|
+
/** Semantic navigation route id selected by the field target binding. */
|
|
60
|
+
readonly routeId: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Route projection for a document field before href generation is applied.
|
|
65
|
+
*/
|
|
66
|
+
export interface ProjectedDocumentFieldNavigationProjection {
|
|
67
|
+
/** Scalar label rendered for the navigable field value. */
|
|
68
|
+
readonly label: string
|
|
69
|
+
|
|
70
|
+
/** Required route parameter names that could not be resolved. */
|
|
71
|
+
readonly missingParameterNames: readonly string[]
|
|
72
|
+
|
|
73
|
+
/** Route parameter values projected from the field value and resource. */
|
|
74
|
+
readonly parameters: NavigationRouteParameters
|
|
75
|
+
|
|
76
|
+
/** Human-facing prefix rendered before the navigation label. */
|
|
77
|
+
readonly prefix: string
|
|
78
|
+
|
|
79
|
+
/** Semantic navigation route id selected by the field target binding. */
|
|
80
|
+
readonly routeId: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface DocumentFieldNavigationBindingOptions {
|
|
84
|
+
readonly labelPrefix?: string | null
|
|
85
|
+
readonly parameters?: readonly DocumentFieldNavigationParameterBinding[]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface DocumentFieldNavigationParameterBinding {
|
|
89
|
+
readonly fieldPath?: string | null
|
|
90
|
+
readonly name: string
|
|
91
|
+
readonly source?: 'resource' | 'value' | string | null
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Projects a document field into a complete navigation binding.
|
|
96
|
+
*
|
|
97
|
+
* Returns `null` when the field has no navigation route binding or the field
|
|
98
|
+
* value cannot be rendered as a scalar navigation label.
|
|
99
|
+
*/
|
|
100
|
+
export function projectDocumentFieldNavigationBinding({
|
|
101
|
+
createHref,
|
|
102
|
+
field,
|
|
103
|
+
module,
|
|
104
|
+
resource,
|
|
105
|
+
value,
|
|
106
|
+
}: ProjectDocumentFieldNavigationBindingOptions): ProjectedDocumentFieldNavigationBinding | null {
|
|
107
|
+
const projection = projectDocumentFieldNavigation({
|
|
108
|
+
field,
|
|
109
|
+
module,
|
|
110
|
+
resource,
|
|
111
|
+
value,
|
|
112
|
+
})
|
|
113
|
+
if (!projection) {
|
|
114
|
+
return null
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
...projection,
|
|
119
|
+
href: createHref?.(projection.routeId, projection.parameters) ?? null,
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Projects a document field into route id, label, prefix, and route parameters.
|
|
125
|
+
*
|
|
126
|
+
* The projection uses target binding options to map route parameters from the
|
|
127
|
+
* current field value or backing resource. If no parameter mapping is declared,
|
|
128
|
+
* it defaults to an `id` parameter sourced from the field value.
|
|
129
|
+
*/
|
|
130
|
+
export function projectDocumentFieldNavigation({
|
|
131
|
+
field,
|
|
132
|
+
module,
|
|
133
|
+
resource,
|
|
134
|
+
value,
|
|
135
|
+
}: Omit<ProjectDocumentFieldNavigationBindingOptions, 'createHref'>): ProjectedDocumentFieldNavigationProjection | null {
|
|
136
|
+
const binding = findDocumentFieldNavigationRouteBinding(module, field)
|
|
137
|
+
if (!binding?.RouteId) {
|
|
138
|
+
return null
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const label = readNavigationScalar(value)
|
|
142
|
+
if (!label) {
|
|
143
|
+
return null
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const options = readDocumentFieldNavigationBindingOptions(binding.Options)
|
|
147
|
+
const parameterProjection = projectNavigationRouteParameters({
|
|
148
|
+
options,
|
|
149
|
+
resource,
|
|
150
|
+
value,
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
label,
|
|
155
|
+
missingParameterNames: parameterProjection.missingParameterNames,
|
|
156
|
+
parameters: parameterProjection.parameters,
|
|
157
|
+
prefix: options.labelPrefix ?? field.Label,
|
|
158
|
+
routeId: binding.RouteId,
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Finds the navigation-route target binding declared for a presentation field.
|
|
164
|
+
*
|
|
165
|
+
* Route-bearing bindings are preferred when multiple target bindings share the
|
|
166
|
+
* same field id; otherwise the first matching binding is returned.
|
|
167
|
+
*/
|
|
168
|
+
export function findDocumentFieldNavigationRouteBinding(
|
|
169
|
+
module: Pick<PresentationModuleDefinition, 'Targets'> | null,
|
|
170
|
+
field: FieldPresentationDefinition,
|
|
171
|
+
) {
|
|
172
|
+
const bindings = module?.Targets
|
|
173
|
+
.flatMap((target) => target.Bindings)
|
|
174
|
+
.filter((binding) =>
|
|
175
|
+
matchesPresentationEnum(binding.Kind, navigationRouteBindingKind) &&
|
|
176
|
+
binding.Id === field.Id) ?? []
|
|
177
|
+
|
|
178
|
+
return bindings.find((binding) => binding.RouteId) ?? bindings[0] ?? null
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function projectNavigationRouteParameters({
|
|
182
|
+
options,
|
|
183
|
+
resource,
|
|
184
|
+
value,
|
|
185
|
+
}: {
|
|
186
|
+
readonly options: DocumentFieldNavigationBindingOptions
|
|
187
|
+
readonly resource: unknown
|
|
188
|
+
readonly value: unknown
|
|
189
|
+
}): {
|
|
190
|
+
readonly missingParameterNames: readonly string[]
|
|
191
|
+
readonly parameters: NavigationRouteParameters
|
|
192
|
+
} {
|
|
193
|
+
const parameterBindings = options.parameters?.length
|
|
194
|
+
? options.parameters
|
|
195
|
+
: [{ name: 'id', source: 'value' }]
|
|
196
|
+
const parameters: NavigationRouteParameters = {}
|
|
197
|
+
const missingParameterNames: string[] = []
|
|
198
|
+
|
|
199
|
+
for (const parameter of parameterBindings) {
|
|
200
|
+
const parameterValue = projectNavigationRouteParameterValue({
|
|
201
|
+
parameter,
|
|
202
|
+
resource,
|
|
203
|
+
value,
|
|
204
|
+
})
|
|
205
|
+
if (parameterValue === null || parameterValue === undefined) {
|
|
206
|
+
missingParameterNames.push(parameter.name)
|
|
207
|
+
continue
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
parameters[parameter.name] = parameterValue
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return {
|
|
214
|
+
missingParameterNames,
|
|
215
|
+
parameters,
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function projectNavigationRouteParameterValue({
|
|
220
|
+
parameter,
|
|
221
|
+
resource,
|
|
222
|
+
value,
|
|
223
|
+
}: {
|
|
224
|
+
readonly parameter: DocumentFieldNavigationParameterBinding
|
|
225
|
+
readonly resource: unknown
|
|
226
|
+
readonly value: unknown
|
|
227
|
+
}) {
|
|
228
|
+
const source = parameter.source ?? 'value'
|
|
229
|
+
const resolvedValue =
|
|
230
|
+
source === 'resource' && parameter.fieldPath
|
|
231
|
+
? readObjectPath(resource, parameter.fieldPath)
|
|
232
|
+
: value
|
|
233
|
+
|
|
234
|
+
return readNavigationScalar(resolvedValue)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function readDocumentFieldNavigationBindingOptions(
|
|
238
|
+
value: unknown,
|
|
239
|
+
): DocumentFieldNavigationBindingOptions {
|
|
240
|
+
if (!value || typeof value !== 'object') {
|
|
241
|
+
return {}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const source = value as Record<string, unknown>
|
|
245
|
+
const labelPrefix = readOptionalString(source.labelPrefix ?? source.LabelPrefix)
|
|
246
|
+
const rawParameters = source.parameters ?? source.Parameters
|
|
247
|
+
const parameters = Array.isArray(rawParameters)
|
|
248
|
+
? rawParameters
|
|
249
|
+
.map(readDocumentFieldNavigationParameterBinding)
|
|
250
|
+
.filter((parameter): parameter is DocumentFieldNavigationParameterBinding =>
|
|
251
|
+
Boolean(parameter))
|
|
252
|
+
: undefined
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
labelPrefix,
|
|
256
|
+
parameters,
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function readDocumentFieldNavigationParameterBinding(
|
|
261
|
+
value: unknown,
|
|
262
|
+
): DocumentFieldNavigationParameterBinding | null {
|
|
263
|
+
if (!value || typeof value !== 'object') {
|
|
264
|
+
return null
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const source = value as Record<string, unknown>
|
|
268
|
+
const name = readOptionalString(source.name ?? source.Name)
|
|
269
|
+
if (!name) {
|
|
270
|
+
return null
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
fieldPath: readOptionalString(source.fieldPath ?? source.FieldPath),
|
|
275
|
+
name,
|
|
276
|
+
source: readOptionalString(source.source ?? source.Source),
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function readNavigationScalar(value: unknown) {
|
|
281
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
282
|
+
return value
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') {
|
|
286
|
+
return value.toString()
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return null
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function readOptionalString(value: unknown) {
|
|
293
|
+
return typeof value === 'string' && value.length > 0 ? value : null
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const navigationRouteBindingKind = createPresentationEnumDiscriminator(
|
|
297
|
+
presentationBindingKinds,
|
|
298
|
+
'navigationRoute',
|
|
299
|
+
'NavigationRoute',
|
|
300
|
+
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FieldPresentationDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
import {
|
|
5
|
+
fieldDisplayKinds,
|
|
6
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
7
|
+
|
|
8
|
+
export function isProjectedDocumentBadgeField(field: FieldPresentationDefinition) {
|
|
9
|
+
return matchesFieldDisplayKind(field, fieldDisplayKinds.badge, 'Badge') ||
|
|
10
|
+
matchesFieldDisplayKind(field, fieldDisplayKinds.status, 'Status')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isProjectedDocumentEntityReferenceField(field: FieldPresentationDefinition) {
|
|
14
|
+
return matchesFieldDisplayKind(field, fieldDisplayKinds.entityReference, 'EntityReference') ||
|
|
15
|
+
(field.Capabilities.includes('navigate') &&
|
|
16
|
+
matchesFieldDisplayKind(field, fieldDisplayKinds.link, 'Link'))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function matchesFieldDisplayKind(
|
|
20
|
+
field: FieldPresentationDefinition,
|
|
21
|
+
numericValue: string | number,
|
|
22
|
+
label: string,
|
|
23
|
+
) {
|
|
24
|
+
return field.DisplayKind === numericValue ||
|
|
25
|
+
String(field.DisplayKind) === String(numericValue) ||
|
|
26
|
+
String(field.DisplayKind) === label
|
|
27
|
+
}
|