@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,1028 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findPresentationDataSource,
|
|
3
|
+
findPresentationInputForm,
|
|
4
|
+
findPresentationQueryForm,
|
|
5
|
+
findPresentationView,
|
|
6
|
+
findPresentationWorkspace,
|
|
7
|
+
type ActionPlacementDefinition,
|
|
8
|
+
type CollectionRowActionDefinition,
|
|
9
|
+
type CollectionSelectionActionDefinition,
|
|
10
|
+
type DataSourceDefinition,
|
|
11
|
+
type FieldPresentationDefinition,
|
|
12
|
+
type InputFormDefinition,
|
|
13
|
+
type PresentationModuleDefinition,
|
|
14
|
+
type QueryFormDefinition,
|
|
15
|
+
type ViewDefinition,
|
|
16
|
+
type ViewRegionDefinition,
|
|
17
|
+
type WorkspaceDefinition,
|
|
18
|
+
} from './module'
|
|
19
|
+
import {
|
|
20
|
+
findNavigationPageHost,
|
|
21
|
+
type NavigationDefinitionProjection,
|
|
22
|
+
} from './navigation'
|
|
23
|
+
import {
|
|
24
|
+
createCollectionChromeRuntime,
|
|
25
|
+
resolveCollectionChromeDataSourceIds,
|
|
26
|
+
} from './collection-chrome-runtime'
|
|
27
|
+
import { getRegionViewIds } from './presentation-view-tree'
|
|
28
|
+
import {
|
|
29
|
+
type NavigationRouteDefinition,
|
|
30
|
+
navigationRouteKinds,
|
|
31
|
+
type PageHostDefinition,
|
|
32
|
+
collectionSelectionActionParameterSources,
|
|
33
|
+
type ViewKind,
|
|
34
|
+
viewChromeSlotKinds,
|
|
35
|
+
viewKinds,
|
|
36
|
+
type WorkspaceRefDefinition,
|
|
37
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Semantic navigation state resolved from a route. The route is addressable;
|
|
41
|
+
* the surface it activates is resolved separately because navigation targets
|
|
42
|
+
* and display surfaces are not always one-to-one.
|
|
43
|
+
*/
|
|
44
|
+
export interface NavigationTarget<
|
|
45
|
+
TRoute extends NavigationRouteDefinition = NavigationRouteDefinition,
|
|
46
|
+
TPageHost extends PageHostDefinition = PageHostDefinition,
|
|
47
|
+
> {
|
|
48
|
+
/** Stable route identifier used as the navigation target identity. */
|
|
49
|
+
readonly id: string
|
|
50
|
+
|
|
51
|
+
/** Page host resolved from the route, or null when the module is incomplete. */
|
|
52
|
+
readonly pageHost: TPageHost | null
|
|
53
|
+
|
|
54
|
+
/** Identifier of the page host the route targets. */
|
|
55
|
+
readonly pageHostId: string
|
|
56
|
+
|
|
57
|
+
/** Concrete route definition that produced this navigation target. */
|
|
58
|
+
readonly route: TRoute
|
|
59
|
+
|
|
60
|
+
/** URL path template declared by the route. */
|
|
61
|
+
readonly urlPathTemplate: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Top-level semantic scene activated by navigation/runtime state. Current
|
|
66
|
+
* generated IR stores this as a page host with a root view; this type is the
|
|
67
|
+
* compatibility surface over that representation.
|
|
68
|
+
*/
|
|
69
|
+
export interface PresentationSurface<
|
|
70
|
+
TRoute extends NavigationRouteDefinition = NavigationRouteDefinition,
|
|
71
|
+
TPageHost extends PageHostDefinition = PageHostDefinition,
|
|
72
|
+
TView extends ViewDefinition = ViewDefinition,
|
|
73
|
+
TWorkspace extends WorkspaceDefinition = WorkspaceDefinition,
|
|
74
|
+
> {
|
|
75
|
+
/** Stable surface identity, currently backed by the resolved page host id. */
|
|
76
|
+
readonly id: string
|
|
77
|
+
|
|
78
|
+
/** Navigation target that activates this semantic surface. */
|
|
79
|
+
readonly navigationTarget: NavigationTarget<TRoute, TPageHost>
|
|
80
|
+
|
|
81
|
+
/** Root view rendered by the surface, when the page host references one. */
|
|
82
|
+
readonly rootView: TView | null
|
|
83
|
+
|
|
84
|
+
/** Identifier of the root view declared by the page host. */
|
|
85
|
+
readonly rootViewId: string | null
|
|
86
|
+
|
|
87
|
+
/** Workspace resolved for the page host, when declared. */
|
|
88
|
+
readonly workspace: TWorkspace | null
|
|
89
|
+
|
|
90
|
+
/** Workspace reference declared by the page host, before module resolution. */
|
|
91
|
+
readonly workspaceRef: WorkspaceRefDefinition | null
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Union of semantic nodes projected from a presentation surface. Consumers use
|
|
96
|
+
* these nodes to inspect the view tree without coupling to rendering runtime
|
|
97
|
+
* structure.
|
|
98
|
+
*/
|
|
99
|
+
export type PresentationSemanticNode =
|
|
100
|
+
| PresentationSurfaceSemanticNode
|
|
101
|
+
| PresentationViewSemanticNode
|
|
102
|
+
| PresentationRegionSemanticNode
|
|
103
|
+
| PresentationFieldSemanticNode
|
|
104
|
+
| PresentationActionSemanticNode
|
|
105
|
+
| WorkspaceSemanticNode
|
|
106
|
+
|
|
107
|
+
/** Semantic graph node representing the activated presentation surface. */
|
|
108
|
+
export interface PresentationSurfaceSemanticNode {
|
|
109
|
+
/** Surface definition represented by this node. */
|
|
110
|
+
readonly definition: PresentationSurface
|
|
111
|
+
|
|
112
|
+
/** Stable node identity. */
|
|
113
|
+
readonly id: string
|
|
114
|
+
|
|
115
|
+
/** Node discriminator. */
|
|
116
|
+
readonly kind: 'surface'
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Semantic graph node representing a view in the surface tree. */
|
|
120
|
+
export interface PresentationViewSemanticNode {
|
|
121
|
+
/** View definition represented by this node. */
|
|
122
|
+
readonly definition: ViewDefinition
|
|
123
|
+
|
|
124
|
+
/** Stable view identifier. */
|
|
125
|
+
readonly id: string
|
|
126
|
+
|
|
127
|
+
/** Node discriminator. */
|
|
128
|
+
readonly kind: 'view'
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Semantic graph node representing a region owned by a view. */
|
|
132
|
+
export interface PresentationRegionSemanticNode {
|
|
133
|
+
/** Region definition represented by this node. */
|
|
134
|
+
readonly definition: ViewRegionDefinition
|
|
135
|
+
|
|
136
|
+
/** Stable node identity scoped by owner view and region id. */
|
|
137
|
+
readonly id: string
|
|
138
|
+
|
|
139
|
+
/** Node discriminator. */
|
|
140
|
+
readonly kind: 'region'
|
|
141
|
+
|
|
142
|
+
/** Identifier of the view that owns this region. */
|
|
143
|
+
readonly ownerViewId: string
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Semantic graph node representing a field projected into a view. */
|
|
147
|
+
export interface PresentationFieldSemanticNode {
|
|
148
|
+
/** Field definition represented by this node. */
|
|
149
|
+
readonly definition: FieldPresentationDefinition
|
|
150
|
+
|
|
151
|
+
/** Stable node identity including the projection source. */
|
|
152
|
+
readonly id: string
|
|
153
|
+
|
|
154
|
+
/** Node discriminator. */
|
|
155
|
+
readonly kind: 'field'
|
|
156
|
+
|
|
157
|
+
/** Identifier of the view that projected this field. */
|
|
158
|
+
readonly ownerViewId: string
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Semantic graph node representing an action projected into a view. */
|
|
162
|
+
export interface PresentationActionSemanticNode {
|
|
163
|
+
/** Projected action reference represented by this node. */
|
|
164
|
+
readonly definition: PresentationViewProjectedActionRef
|
|
165
|
+
|
|
166
|
+
/** Stable node identity including the projection source. */
|
|
167
|
+
readonly id: string
|
|
168
|
+
|
|
169
|
+
/** Node discriminator. */
|
|
170
|
+
readonly kind: 'action'
|
|
171
|
+
|
|
172
|
+
/** Identifier of the view that projected this action. */
|
|
173
|
+
readonly ownerViewId: string
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Semantic graph node representing a workspace attached to the surface. */
|
|
177
|
+
export interface WorkspaceSemanticNode {
|
|
178
|
+
/** Workspace definition represented by this node. */
|
|
179
|
+
readonly definition: WorkspaceDefinition
|
|
180
|
+
|
|
181
|
+
/** Stable workspace identifier. */
|
|
182
|
+
readonly id: string
|
|
183
|
+
|
|
184
|
+
/** Node discriminator. */
|
|
185
|
+
readonly kind: 'workspace'
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Reference to a field projected into a view by direct view fields or
|
|
190
|
+
* collection chrome declarations.
|
|
191
|
+
*/
|
|
192
|
+
export interface PresentationViewProjectedFieldRef {
|
|
193
|
+
/** Identifier of the field resolved against the containing module. */
|
|
194
|
+
readonly fieldId: string
|
|
195
|
+
|
|
196
|
+
/** Projection source used for diagnostics and stable semantic node ids. */
|
|
197
|
+
readonly source: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Source category for an action projected into a view. */
|
|
201
|
+
export type PresentationViewProjectedActionKind =
|
|
202
|
+
| 'view-action-placement'
|
|
203
|
+
| 'view-chrome-action-placement'
|
|
204
|
+
| 'collection-slot-action'
|
|
205
|
+
| 'collection-row-action'
|
|
206
|
+
| 'collection-selection-action'
|
|
207
|
+
|
|
208
|
+
/** Runtime context in which a projected action can be invoked. */
|
|
209
|
+
export type PresentationActionContextKind =
|
|
210
|
+
| 'view'
|
|
211
|
+
| 'collection-row'
|
|
212
|
+
| 'collection-selection'
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Invocation context contributed by the view projection. This captures the
|
|
216
|
+
* collection/view state required to bind an action without making the module
|
|
217
|
+
* action definition collection-aware.
|
|
218
|
+
*/
|
|
219
|
+
export interface PresentationViewProjectedActionContext {
|
|
220
|
+
/** Collection view that projected the action, when applicable. */
|
|
221
|
+
readonly collectionViewId?: string | null
|
|
222
|
+
|
|
223
|
+
/** Invocation context for the projected action. */
|
|
224
|
+
readonly contextKind: PresentationActionContextKind
|
|
225
|
+
|
|
226
|
+
/** Object path used to derive the active row identity. */
|
|
227
|
+
readonly rowIdentityPath?: string | null
|
|
228
|
+
|
|
229
|
+
/** Row value paths required to bind row action parameters. */
|
|
230
|
+
readonly requiredRowValuePaths?: readonly string[]
|
|
231
|
+
|
|
232
|
+
/** Selected-row value paths required to bind selection action parameters. */
|
|
233
|
+
readonly requiredSelectedRowValuePaths?: readonly string[]
|
|
234
|
+
|
|
235
|
+
/** Object path used to derive selected row identities. */
|
|
236
|
+
readonly selectedRowIdentityPath?: string | null
|
|
237
|
+
|
|
238
|
+
/** Selection state id shared by collection chrome slots. */
|
|
239
|
+
readonly selectionStateId?: string | null
|
|
240
|
+
|
|
241
|
+
/** Collection or view chrome slot that projected the action. */
|
|
242
|
+
readonly slotId?: string | null
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// TODO: Model projected action refs as placement/context enrichment over the
|
|
246
|
+
// resolved ActionDefinition instead of carrying duplicated action identity and
|
|
247
|
+
// collection action metadata through downstream runtime shapes.
|
|
248
|
+
/**
|
|
249
|
+
* View-local projection of a module action. The ref preserves placement,
|
|
250
|
+
* context, source, and collection binding metadata that are not owned by the
|
|
251
|
+
* canonical ActionDefinition.
|
|
252
|
+
*/
|
|
253
|
+
export interface PresentationViewProjectedActionRef {
|
|
254
|
+
/** Identifier of the module action being projected. */
|
|
255
|
+
readonly actionId: string
|
|
256
|
+
|
|
257
|
+
/** View-projected invocation context. */
|
|
258
|
+
readonly context: PresentationViewProjectedActionContext
|
|
259
|
+
|
|
260
|
+
/** Convenience discriminator mirrored from context.contextKind. */
|
|
261
|
+
readonly contextKind: PresentationActionContextKind
|
|
262
|
+
|
|
263
|
+
/** Stable projected-action identity scoped by projection kind and source. */
|
|
264
|
+
readonly id: string
|
|
265
|
+
|
|
266
|
+
/** Source category that introduced the projected action. */
|
|
267
|
+
readonly kind: PresentationViewProjectedActionKind
|
|
268
|
+
|
|
269
|
+
/** Placement metadata used by action surfaces and renderers. */
|
|
270
|
+
readonly placement: ActionPlacementDefinition
|
|
271
|
+
|
|
272
|
+
/** Collection row action binding metadata, when this is row-scoped. */
|
|
273
|
+
readonly rowAction?: CollectionRowActionDefinition
|
|
274
|
+
|
|
275
|
+
/** Collection selection action binding metadata, when this is selection-scoped. */
|
|
276
|
+
readonly selectionAction?: CollectionSelectionActionDefinition
|
|
277
|
+
|
|
278
|
+
/** Chrome slot that introduced the action, when known. */
|
|
279
|
+
readonly slotId?: string
|
|
280
|
+
|
|
281
|
+
/** Human-readable projection source for diagnostics and stable ids. */
|
|
282
|
+
readonly source: string
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
type PresentationDataSourceDiscoveryModule = {
|
|
286
|
+
readonly DataSources?: readonly DataSourceDefinition[]
|
|
287
|
+
readonly InputForms?: readonly InputFormDefinition[]
|
|
288
|
+
readonly QueryForms?: readonly QueryFormDefinition[]
|
|
289
|
+
readonly Views: readonly ViewDefinition[]
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Resolves the semantic navigation target for a route. The returned value keeps
|
|
294
|
+
* the original route and the resolved page host together so later projection
|
|
295
|
+
* steps can preserve both route semantics and display host metadata.
|
|
296
|
+
*
|
|
297
|
+
* @param navigation Navigation projection that owns page hosts.
|
|
298
|
+
* @param route Route definition to resolve.
|
|
299
|
+
*/
|
|
300
|
+
export function resolveNavigationTarget<
|
|
301
|
+
TNavigation extends NavigationDefinitionProjection<TRoute, TPageHost>,
|
|
302
|
+
TRoute extends NavigationRouteDefinition,
|
|
303
|
+
TPageHost extends PageHostDefinition,
|
|
304
|
+
>(
|
|
305
|
+
navigation: TNavigation,
|
|
306
|
+
route: TRoute,
|
|
307
|
+
): NavigationTarget<TRoute, TPageHost> {
|
|
308
|
+
const pageHost = findNavigationPageHost<TPageHost>(navigation, route.PageHostId)
|
|
309
|
+
return {
|
|
310
|
+
id: route.Id,
|
|
311
|
+
pageHost,
|
|
312
|
+
pageHostId: route.PageHostId,
|
|
313
|
+
route,
|
|
314
|
+
urlPathTemplate: route.PathTemplate,
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Resolves the presentation surface activated by a navigation target. Returns
|
|
320
|
+
* null when the target cannot be connected to a page host.
|
|
321
|
+
*
|
|
322
|
+
* @param module Presentation module fragment containing views and workspaces.
|
|
323
|
+
* @param navigationTarget Route-derived target to resolve into a surface.
|
|
324
|
+
*/
|
|
325
|
+
export function resolvePresentationSurface<
|
|
326
|
+
TRoute extends NavigationRouteDefinition,
|
|
327
|
+
TPageHost extends PageHostDefinition,
|
|
328
|
+
TView extends ViewDefinition = ViewDefinition,
|
|
329
|
+
TWorkspace extends WorkspaceDefinition = WorkspaceDefinition,
|
|
330
|
+
>(
|
|
331
|
+
module: Pick<PresentationModuleDefinition, 'Views' | 'Workspaces'> | null,
|
|
332
|
+
navigationTarget: NavigationTarget<TRoute, TPageHost>,
|
|
333
|
+
): PresentationSurface<TRoute, TPageHost, TView, TWorkspace> | null {
|
|
334
|
+
const pageHost = navigationTarget.pageHost
|
|
335
|
+
if (!pageHost) {
|
|
336
|
+
return null
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const rootViewId = pageHost.View?.ViewId ?? null
|
|
340
|
+
const rootView = rootViewId ? findPresentationView<TView>(module, rootViewId) : null
|
|
341
|
+
const workspaceRef = pageHost.Workspace ?? null
|
|
342
|
+
const workspace = workspaceRef
|
|
343
|
+
? findPresentationWorkspace<TWorkspace>(module, workspaceRef.WorkspaceId)
|
|
344
|
+
: null
|
|
345
|
+
|
|
346
|
+
return {
|
|
347
|
+
id: pageHost.Id,
|
|
348
|
+
navigationTarget,
|
|
349
|
+
rootView,
|
|
350
|
+
rootViewId,
|
|
351
|
+
workspace,
|
|
352
|
+
workspaceRef,
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Creates a lightweight surface around a known root view. This is useful for
|
|
358
|
+
* runtimes and tests that start from a view instead of a navigation route.
|
|
359
|
+
*
|
|
360
|
+
* @param rootView Root view to expose as a surface.
|
|
361
|
+
* @param options Optional synthetic identity and URL path template.
|
|
362
|
+
*/
|
|
363
|
+
export function createPresentationSurfaceFromRootView<
|
|
364
|
+
TView extends ViewDefinition = ViewDefinition,
|
|
365
|
+
>(
|
|
366
|
+
rootView: TView | null,
|
|
367
|
+
options?: {
|
|
368
|
+
readonly id?: string
|
|
369
|
+
readonly urlPathTemplate?: string
|
|
370
|
+
},
|
|
371
|
+
): PresentationSurface<
|
|
372
|
+
NavigationRouteDefinition,
|
|
373
|
+
PageHostDefinition,
|
|
374
|
+
TView,
|
|
375
|
+
WorkspaceDefinition
|
|
376
|
+
> {
|
|
377
|
+
const id = options?.id ?? rootView?.Id ?? 'presentation-surface'
|
|
378
|
+
const urlPathTemplate = options?.urlPathTemplate ?? ''
|
|
379
|
+
const route: NavigationRouteDefinition = {
|
|
380
|
+
Id: id,
|
|
381
|
+
Kind: navigationRouteKinds.page,
|
|
382
|
+
Label: id,
|
|
383
|
+
PageHostId: id,
|
|
384
|
+
Parameters: [],
|
|
385
|
+
PathTemplate: urlPathTemplate,
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return {
|
|
389
|
+
id,
|
|
390
|
+
navigationTarget: {
|
|
391
|
+
id,
|
|
392
|
+
pageHost: null,
|
|
393
|
+
pageHostId: id,
|
|
394
|
+
route,
|
|
395
|
+
urlPathTemplate,
|
|
396
|
+
},
|
|
397
|
+
rootView,
|
|
398
|
+
rootViewId: rootView?.Id ?? options?.id ?? null,
|
|
399
|
+
workspace: null,
|
|
400
|
+
workspaceRef: null,
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Determines whether a view should be treated as the root of a presentation
|
|
406
|
+
* surface based on generated view kind or design role.
|
|
407
|
+
*
|
|
408
|
+
* @param view View fragment to classify.
|
|
409
|
+
*/
|
|
410
|
+
export function isPresentationSurfaceRootView(
|
|
411
|
+
view: Pick<ViewDefinition, 'Design' | 'Kind'> | null,
|
|
412
|
+
) {
|
|
413
|
+
return (
|
|
414
|
+
matchesPresentationViewKind(view?.Kind, viewKinds.page, 'Page') ||
|
|
415
|
+
view?.Design?.Role === 'page' ||
|
|
416
|
+
view?.Design?.Role === 'surface-root'
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Resolves the semantic role a view plays inside a surface. Design roles win
|
|
422
|
+
* when they provide specific intent; generated view kinds provide fallback
|
|
423
|
+
* semantics for page, workspace, and surface-section views.
|
|
424
|
+
*
|
|
425
|
+
* @param view View fragment to classify.
|
|
426
|
+
*/
|
|
427
|
+
export function getPresentationViewSemanticRole(
|
|
428
|
+
view: Pick<ViewDefinition, 'Design' | 'Kind'> | null,
|
|
429
|
+
) {
|
|
430
|
+
if (!view) {
|
|
431
|
+
return 'unknown'
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (isPresentationSurfaceRootView(view)) {
|
|
435
|
+
return 'surface-root'
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (matchesPresentationViewKind(view.Kind, viewKinds.documentWorkspace, 'DocumentWorkspace')) {
|
|
439
|
+
return 'workspace-view'
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const designRole = view.Design?.Role
|
|
443
|
+
if (designRole && designRole !== 'surface' && designRole !== 'tabs') {
|
|
444
|
+
return designRole
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (
|
|
448
|
+
matchesPresentationViewKind(view.Kind, viewKinds.surface, 'Surface') ||
|
|
449
|
+
matchesPresentationViewKind(view.Kind, viewKinds.tabbedSurface, 'TabbedSurface')
|
|
450
|
+
) {
|
|
451
|
+
return 'surface-section'
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return designRole ?? 'view'
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Returns every data source directly projected by a view, including subject
|
|
459
|
+
* data, direct view data sources, and collection chrome data sources.
|
|
460
|
+
*
|
|
461
|
+
* @param view View fragment containing data-source projection declarations.
|
|
462
|
+
*/
|
|
463
|
+
export function getPresentationViewProjectedDataSourceIds(
|
|
464
|
+
view: Pick<ViewDefinition, 'Collection' | 'DataSourceIds' | 'Subject'>,
|
|
465
|
+
) {
|
|
466
|
+
return uniqueStrings([
|
|
467
|
+
...view.DataSourceIds,
|
|
468
|
+
...(view.Subject.DataSourceId ? [view.Subject.DataSourceId] : []),
|
|
469
|
+
...resolveCollectionChromeDataSourceIds(view.Collection),
|
|
470
|
+
])
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Returns unique field ids projected by a view through direct fields,
|
|
475
|
+
* collection body columns, and collection chrome field slots.
|
|
476
|
+
*
|
|
477
|
+
* @param view View fragment containing field projection declarations.
|
|
478
|
+
*/
|
|
479
|
+
export function getPresentationViewProjectedFieldIds(
|
|
480
|
+
view: Pick<ViewDefinition, 'Collection' | 'FieldIds'>,
|
|
481
|
+
) {
|
|
482
|
+
return uniqueStrings(getPresentationViewProjectedFieldRefs(view).map((ref) => ref.fieldId))
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Returns field references projected by a view with source provenance for each
|
|
487
|
+
* projection. The same field can appear through multiple sources.
|
|
488
|
+
*
|
|
489
|
+
* @param view View fragment containing direct and collection field projections.
|
|
490
|
+
*/
|
|
491
|
+
export function getPresentationViewProjectedFieldRefs(
|
|
492
|
+
view: Pick<ViewDefinition, 'Collection' | 'FieldIds'>,
|
|
493
|
+
): readonly PresentationViewProjectedFieldRef[] {
|
|
494
|
+
const refs: PresentationViewProjectedFieldRef[] = [
|
|
495
|
+
...view.FieldIds.map((fieldId) => ({ fieldId, source: 'view-field' })),
|
|
496
|
+
]
|
|
497
|
+
|
|
498
|
+
const chrome = createCollectionChromeRuntime(view.Collection)
|
|
499
|
+
for (const column of chrome.bodySlot?.Columns ?? []) {
|
|
500
|
+
refs.push({
|
|
501
|
+
fieldId: column.FieldId,
|
|
502
|
+
source: `collection-body-column.${column.Id}`,
|
|
503
|
+
})
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
for (const slot of chrome.slots) {
|
|
507
|
+
for (const fieldId of slot.FieldIds) {
|
|
508
|
+
refs.push({
|
|
509
|
+
fieldId,
|
|
510
|
+
source: `collection-chrome-slot-field.${slot.Id}`,
|
|
511
|
+
})
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return refs
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Returns all actions projected into a view. The result normalizes direct view
|
|
520
|
+
* placements, view chrome actions, collection slot actions, row actions, and
|
|
521
|
+
* selection actions into a single view-local action reference model.
|
|
522
|
+
*
|
|
523
|
+
* @param view View fragment containing action and collection declarations.
|
|
524
|
+
*/
|
|
525
|
+
export function getPresentationViewProjectedActions(
|
|
526
|
+
view: Pick<ViewDefinition, 'Actions' | 'Chrome' | 'Collection' | 'Id'> | null,
|
|
527
|
+
): readonly PresentationViewProjectedActionRef[] {
|
|
528
|
+
if (!view) {
|
|
529
|
+
return []
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const actions: PresentationViewProjectedActionRef[] = []
|
|
533
|
+
|
|
534
|
+
for (const placement of view.Actions) {
|
|
535
|
+
actions.push(createProjectedActionRef({
|
|
536
|
+
kind: 'view-action-placement',
|
|
537
|
+
placement,
|
|
538
|
+
context: {
|
|
539
|
+
contextKind: 'view',
|
|
540
|
+
},
|
|
541
|
+
source: `view-action.${placement.Region}.${placement.ActionId}`,
|
|
542
|
+
}))
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
for (const slot of view.Chrome?.Slots ?? []) {
|
|
546
|
+
if (!isViewActionsChromeSlotKind(slot.Kind)) {
|
|
547
|
+
continue
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
for (const placement of slot.Actions) {
|
|
551
|
+
actions.push(createProjectedActionRef({
|
|
552
|
+
kind: 'view-chrome-action-placement',
|
|
553
|
+
placement,
|
|
554
|
+
context: {
|
|
555
|
+
contextKind: 'view',
|
|
556
|
+
slotId: slot.Id,
|
|
557
|
+
},
|
|
558
|
+
slotId: slot.Id,
|
|
559
|
+
source: `view-chrome-slot.${slot.Id}.${placement.Region}.${placement.ActionId}`,
|
|
560
|
+
}))
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const chrome = createCollectionChromeRuntime(view.Collection)
|
|
565
|
+
const collectionViewId = view.Id
|
|
566
|
+
const bodySlot = chrome.bodySlot
|
|
567
|
+
const selectionStateId = bodySlot?.StateId ??
|
|
568
|
+
chrome.selectionActionsSlot?.StateId ??
|
|
569
|
+
chrome.detailSlot?.StateId ??
|
|
570
|
+
null
|
|
571
|
+
|
|
572
|
+
for (const slot of chrome.slots) {
|
|
573
|
+
const explicitlyBoundSlotActionIds = new Set([
|
|
574
|
+
...slot.RowActions.map((rowAction) => rowAction.ActionId),
|
|
575
|
+
...slot.SelectionActions.map((selectionAction) => selectionAction.ActionId),
|
|
576
|
+
])
|
|
577
|
+
for (const actionId of slot.ActionIds) {
|
|
578
|
+
if (explicitlyBoundSlotActionIds.has(actionId)) {
|
|
579
|
+
continue
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
actions.push(createProjectedActionRef({
|
|
583
|
+
kind: 'collection-slot-action',
|
|
584
|
+
placement: {
|
|
585
|
+
ActionId: actionId,
|
|
586
|
+
Region: `collection:${slot.Id}`,
|
|
587
|
+
},
|
|
588
|
+
context: {
|
|
589
|
+
collectionViewId,
|
|
590
|
+
contextKind: 'view',
|
|
591
|
+
slotId: slot.Id,
|
|
592
|
+
},
|
|
593
|
+
slotId: slot.Id,
|
|
594
|
+
source: `collection-chrome-slot.${slot.Id}.action.${actionId}`,
|
|
595
|
+
}))
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
for (const rowAction of slot.RowActions) {
|
|
599
|
+
actions.push(createProjectedActionRef({
|
|
600
|
+
kind: 'collection-row-action',
|
|
601
|
+
placement: {
|
|
602
|
+
ActionId: rowAction.ActionId,
|
|
603
|
+
Icon: rowAction.Icon,
|
|
604
|
+
Label: rowAction.Label,
|
|
605
|
+
Region: `collection:${slot.Id}:row`,
|
|
606
|
+
},
|
|
607
|
+
context: {
|
|
608
|
+
collectionViewId,
|
|
609
|
+
contextKind: 'collection-row',
|
|
610
|
+
requiredRowValuePaths: rowAction.Parameters.map((parameter) => parameter.ValuePath),
|
|
611
|
+
rowIdentityPath: bodySlot?.RowIdentityPath ?? null,
|
|
612
|
+
slotId: slot.Id,
|
|
613
|
+
},
|
|
614
|
+
rowAction,
|
|
615
|
+
slotId: slot.Id,
|
|
616
|
+
source: `collection-row-action.${slot.Id}.${rowAction.Id}`,
|
|
617
|
+
}))
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
for (const selectionAction of slot.SelectionActions) {
|
|
621
|
+
actions.push(createProjectedActionRef({
|
|
622
|
+
kind: 'collection-selection-action',
|
|
623
|
+
placement: {
|
|
624
|
+
ActionId: selectionAction.ActionId,
|
|
625
|
+
Icon: selectionAction.Icon,
|
|
626
|
+
Label: selectionAction.Label,
|
|
627
|
+
Region: `collection:${slot.Id}:selection`,
|
|
628
|
+
},
|
|
629
|
+
context: {
|
|
630
|
+
collectionViewId,
|
|
631
|
+
contextKind: 'collection-selection',
|
|
632
|
+
requiredSelectedRowValuePaths:
|
|
633
|
+
resolveSelectionActionRequiredSelectedRowValuePaths(selectionAction),
|
|
634
|
+
selectedRowIdentityPath: bodySlot?.RowIdentityPath ?? null,
|
|
635
|
+
selectionStateId,
|
|
636
|
+
slotId: slot.Id,
|
|
637
|
+
},
|
|
638
|
+
selectionAction,
|
|
639
|
+
slotId: slot.Id,
|
|
640
|
+
source: `collection-selection-action.${slot.Id}.${selectionAction.Id}`,
|
|
641
|
+
}))
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
return uniqueProjectedActionRefs(actions)
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Returns normalized action placements projected by a view, optionally filtered
|
|
650
|
+
* by invocation context. Defaults to view-scoped actions.
|
|
651
|
+
*
|
|
652
|
+
* @param view View fragment containing action and collection declarations.
|
|
653
|
+
* @param options Projection filters.
|
|
654
|
+
*/
|
|
655
|
+
export function getPresentationViewProjectedActionPlacements(
|
|
656
|
+
view: Pick<ViewDefinition, 'Actions' | 'Chrome' | 'Collection' | 'Id'> | null,
|
|
657
|
+
options?: {
|
|
658
|
+
readonly contextKinds?: readonly PresentationActionContextKind[]
|
|
659
|
+
},
|
|
660
|
+
): readonly ActionPlacementDefinition[] {
|
|
661
|
+
const contextKinds = new Set(options?.contextKinds ?? ['view'])
|
|
662
|
+
return getPresentationViewProjectedActions(view)
|
|
663
|
+
.filter((action) => contextKinds.has(action.contextKind))
|
|
664
|
+
.map((action) => action.placement)
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function matchesPresentationViewKind(
|
|
668
|
+
value: ViewDefinition['Kind'] | null | undefined,
|
|
669
|
+
numericValue: ViewKind,
|
|
670
|
+
label: string,
|
|
671
|
+
) {
|
|
672
|
+
return (
|
|
673
|
+
value === numericValue ||
|
|
674
|
+
String(value) === String(numericValue) ||
|
|
675
|
+
String(value) === label ||
|
|
676
|
+
String(value) === label.charAt(0).toLowerCase() + label.slice(1)
|
|
677
|
+
)
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Returns the depth-first view tree for a presentation surface root. Region
|
|
682
|
+
* child view references determine traversal order, and repeated references are
|
|
683
|
+
* visited once.
|
|
684
|
+
*
|
|
685
|
+
* @param module Module fragment containing views available for traversal.
|
|
686
|
+
* @param surface Surface whose root view anchors the tree.
|
|
687
|
+
*/
|
|
688
|
+
export function getPresentationSurfaceViewTree(
|
|
689
|
+
module: { readonly Views: readonly ViewDefinition[] } | null,
|
|
690
|
+
surface: Pick<PresentationSurface, 'rootView'> | null,
|
|
691
|
+
) {
|
|
692
|
+
const rootView = surface?.rootView ?? null
|
|
693
|
+
if (!module || !rootView) {
|
|
694
|
+
return []
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
const viewsById = new Map(module.Views.map((view) => [view.Id, view] as const))
|
|
698
|
+
const visited = new Set<string>()
|
|
699
|
+
const orderedViews: ViewDefinition[] = []
|
|
700
|
+
|
|
701
|
+
visit(rootView)
|
|
702
|
+
return orderedViews
|
|
703
|
+
|
|
704
|
+
function visit(view: ViewDefinition) {
|
|
705
|
+
if (visited.has(view.Id)) {
|
|
706
|
+
return
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
visited.add(view.Id)
|
|
710
|
+
orderedViews.push(view)
|
|
711
|
+
|
|
712
|
+
for (const region of view.Regions) {
|
|
713
|
+
for (const childViewId of getRegionViewIds(region)) {
|
|
714
|
+
const childView = viewsById.get(childViewId)
|
|
715
|
+
if (childView) {
|
|
716
|
+
visit(childView)
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Returns the transitive data-source closure needed by a presentation surface.
|
|
725
|
+
* The closure includes view projections, subject forms, query forms, collection
|
|
726
|
+
* slot forms, region data sources, and data-source dependencies.
|
|
727
|
+
*
|
|
728
|
+
* @param module Module fragment containing views, forms, and data sources.
|
|
729
|
+
* @param surface Surface whose view tree determines required data sources.
|
|
730
|
+
*/
|
|
731
|
+
export function getPresentationSurfaceDataSourceIds(
|
|
732
|
+
module: PresentationDataSourceDiscoveryModule | null,
|
|
733
|
+
surface: Pick<PresentationSurface, 'rootView'> | null,
|
|
734
|
+
) {
|
|
735
|
+
const dataSourceIds = new Set<string>()
|
|
736
|
+
for (const view of getPresentationSurfaceViewTree(module, surface)) {
|
|
737
|
+
collectPresentationViewDataSourceIds(dataSourceIds, module, view)
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
expandPresentationDataSourceDependencies(dataSourceIds, module)
|
|
741
|
+
return Array.from(dataSourceIds)
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function collectPresentationViewDataSourceIds(
|
|
745
|
+
dataSourceIds: Set<string>,
|
|
746
|
+
module: PresentationDataSourceDiscoveryModule | null,
|
|
747
|
+
view: ViewDefinition,
|
|
748
|
+
) {
|
|
749
|
+
addDataSourceIds(dataSourceIds, getPresentationViewProjectedDataSourceIds(view))
|
|
750
|
+
collectInputFormDataSourceIds(dataSourceIds, module, view.Subject.InputFormId)
|
|
751
|
+
collectQueryFormDataSourceIds(dataSourceIds, module, view.Subject.QueryFormId)
|
|
752
|
+
|
|
753
|
+
const collection = view.Collection
|
|
754
|
+
if (collection) {
|
|
755
|
+
for (const slot of createCollectionChromeRuntime(collection).slots) {
|
|
756
|
+
collectQueryFormDataSourceIds(dataSourceIds, module, slot.QueryFormId)
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
for (const region of view.Regions) {
|
|
761
|
+
addDataSourceIds(dataSourceIds, region.DataSourceIds)
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function collectQueryFormDataSourceIds(
|
|
766
|
+
dataSourceIds: Set<string>,
|
|
767
|
+
module: PresentationDataSourceDiscoveryModule | null,
|
|
768
|
+
queryFormId: string | null | undefined,
|
|
769
|
+
) {
|
|
770
|
+
if (!queryFormId) {
|
|
771
|
+
return
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const queryForm = module?.QueryForms
|
|
775
|
+
? findPresentationQueryForm({ QueryForms: module.QueryForms }, queryFormId)
|
|
776
|
+
: null
|
|
777
|
+
if (!queryForm) {
|
|
778
|
+
return
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
const state = queryForm.Target.State
|
|
782
|
+
addDataSourceIds(dataSourceIds, [
|
|
783
|
+
state.DraftDataSourceId,
|
|
784
|
+
state.AppliedDataSourceId,
|
|
785
|
+
state.ResultDataSourceId,
|
|
786
|
+
...state.SynchronizedDataSourceIds,
|
|
787
|
+
queryForm.Target.Result.DataSourceId,
|
|
788
|
+
])
|
|
789
|
+
collectInputFormDataSourceIds(dataSourceIds, module, queryForm.FormId)
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function collectInputFormDataSourceIds(
|
|
793
|
+
dataSourceIds: Set<string>,
|
|
794
|
+
module: PresentationDataSourceDiscoveryModule | null,
|
|
795
|
+
inputFormId: string | null | undefined,
|
|
796
|
+
) {
|
|
797
|
+
if (!inputFormId) {
|
|
798
|
+
return
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
const inputForm = module?.InputForms
|
|
802
|
+
? findPresentationInputForm({ InputForms: module.InputForms }, inputFormId)
|
|
803
|
+
: null
|
|
804
|
+
if (!inputForm) {
|
|
805
|
+
return
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
addDataSourceIds(dataSourceIds, [
|
|
809
|
+
inputForm.StateDataSourceId,
|
|
810
|
+
inputForm.Target.DataSourceId,
|
|
811
|
+
])
|
|
812
|
+
|
|
813
|
+
for (const field of inputForm.Fields) {
|
|
814
|
+
addDataSourceId(dataSourceIds, field.ChoiceSource?.DataSourceId)
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
for (const suggestion of inputForm.Suggestions) {
|
|
818
|
+
addDataSourceId(dataSourceIds, suggestion.DataSourceId)
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function expandPresentationDataSourceDependencies(
|
|
823
|
+
dataSourceIds: Set<string>,
|
|
824
|
+
module: PresentationDataSourceDiscoveryModule | null,
|
|
825
|
+
) {
|
|
826
|
+
if (!module?.DataSources) {
|
|
827
|
+
return
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const pending = Array.from(dataSourceIds)
|
|
831
|
+
const visited = new Set<string>()
|
|
832
|
+
for (let index = 0; index < pending.length; index += 1) {
|
|
833
|
+
const dataSourceId = pending[index]
|
|
834
|
+
if (visited.has(dataSourceId)) {
|
|
835
|
+
continue
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
visited.add(dataSourceId)
|
|
839
|
+
const dataSource = findPresentationDataSource(
|
|
840
|
+
{ DataSources: module.DataSources },
|
|
841
|
+
dataSourceId,
|
|
842
|
+
)
|
|
843
|
+
if (!dataSource) {
|
|
844
|
+
continue
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
for (const dependencyId of resolveDataSourceDependencyIds(dataSource)) {
|
|
848
|
+
if (!dataSourceIds.has(dependencyId)) {
|
|
849
|
+
dataSourceIds.add(dependencyId)
|
|
850
|
+
pending.push(dependencyId)
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function resolveDataSourceDependencyIds(dataSource: DataSourceDefinition) {
|
|
857
|
+
return [
|
|
858
|
+
...(dataSource.Query?.FactDataSourceIds ?? []),
|
|
859
|
+
...(dataSource.Query?.Fields.flatMap((field) =>
|
|
860
|
+
field.ChoiceDataSourceId ? [field.ChoiceDataSourceId] : []) ?? []),
|
|
861
|
+
dataSource.Query?.Pagination?.Response.TotalCountDataSourceId,
|
|
862
|
+
dataSource.Aggregation?.SourceDataSourceId,
|
|
863
|
+
].filter((dataSourceId): dataSourceId is string => Boolean(dataSourceId))
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
function addDataSourceIds(
|
|
867
|
+
dataSourceIds: Set<string>,
|
|
868
|
+
ids: readonly (string | null | undefined)[],
|
|
869
|
+
) {
|
|
870
|
+
for (const id of ids) {
|
|
871
|
+
addDataSourceId(dataSourceIds, id)
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
function addDataSourceId(
|
|
876
|
+
dataSourceIds: Set<string>,
|
|
877
|
+
id: string | null | undefined,
|
|
878
|
+
) {
|
|
879
|
+
if (id) {
|
|
880
|
+
dataSourceIds.add(id)
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
function uniqueStrings(values: readonly string[]) {
|
|
885
|
+
return Array.from(new Set(values))
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
function createProjectedActionRef({
|
|
889
|
+
context,
|
|
890
|
+
kind,
|
|
891
|
+
placement,
|
|
892
|
+
rowAction,
|
|
893
|
+
selectionAction,
|
|
894
|
+
slotId,
|
|
895
|
+
source,
|
|
896
|
+
}: {
|
|
897
|
+
readonly context: PresentationViewProjectedActionContext
|
|
898
|
+
readonly kind: PresentationViewProjectedActionKind
|
|
899
|
+
readonly placement: ActionPlacementDefinition
|
|
900
|
+
readonly rowAction?: CollectionRowActionDefinition
|
|
901
|
+
readonly selectionAction?: CollectionSelectionActionDefinition
|
|
902
|
+
readonly slotId?: string
|
|
903
|
+
readonly source: string
|
|
904
|
+
}): PresentationViewProjectedActionRef {
|
|
905
|
+
return {
|
|
906
|
+
actionId: placement.ActionId,
|
|
907
|
+
context,
|
|
908
|
+
contextKind: context.contextKind,
|
|
909
|
+
id: `${kind}:${source}`,
|
|
910
|
+
kind,
|
|
911
|
+
placement,
|
|
912
|
+
rowAction,
|
|
913
|
+
selectionAction,
|
|
914
|
+
slotId,
|
|
915
|
+
source,
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
function resolveSelectionActionRequiredSelectedRowValuePaths(
|
|
920
|
+
selectionAction: CollectionSelectionActionDefinition,
|
|
921
|
+
) {
|
|
922
|
+
return selectionAction.Parameters.flatMap((parameter) =>
|
|
923
|
+
isSelectedRowValueSelectionActionParameterSource(parameter.Source) && parameter.ValuePath
|
|
924
|
+
? [parameter.ValuePath]
|
|
925
|
+
: [])
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
function isSelectedRowValueSelectionActionParameterSource(source: unknown) {
|
|
929
|
+
return source === collectionSelectionActionParameterSources.selectedRowValue ||
|
|
930
|
+
source === collectionSelectionActionParameterSources.selectedRowValueList ||
|
|
931
|
+
String(source).toLocaleLowerCase() === 'selectedrowvalue' ||
|
|
932
|
+
String(source).toLocaleLowerCase() === 'selectedrowvaluelist'
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
function uniqueProjectedActionRefs(
|
|
936
|
+
actions: readonly PresentationViewProjectedActionRef[],
|
|
937
|
+
) {
|
|
938
|
+
const seen = new Set<string>()
|
|
939
|
+
return actions.filter((action) => {
|
|
940
|
+
const key = `${action.kind}:${action.source}:${action.actionId}`
|
|
941
|
+
if (seen.has(key)) {
|
|
942
|
+
return false
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
seen.add(key)
|
|
946
|
+
return true
|
|
947
|
+
})
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function isViewActionsChromeSlotKind(value: string | number) {
|
|
951
|
+
return value === viewChromeSlotKinds.actions ||
|
|
952
|
+
String(value).toLocaleLowerCase() === 'actions'
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Projects a surface into semantic graph nodes for inspection, diagnostics, and
|
|
957
|
+
* renderer-independent traversal. The graph includes the surface, workspace,
|
|
958
|
+
* reachable views, regions, projected fields, and projected actions.
|
|
959
|
+
*
|
|
960
|
+
* @param module Module fragment containing fields, views, and workspaces.
|
|
961
|
+
* @param surface Surface to project into semantic nodes.
|
|
962
|
+
*/
|
|
963
|
+
export function getPresentationSurfaceSemanticNodes(
|
|
964
|
+
module: Pick<PresentationModuleDefinition, 'Fields' | 'Views' | 'Workspaces'> | null,
|
|
965
|
+
surface: PresentationSurface | null,
|
|
966
|
+
): readonly PresentationSemanticNode[] {
|
|
967
|
+
if (!module || !surface) {
|
|
968
|
+
return []
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
const fieldsById = new Map(module.Fields.map((field) => [field.Id, field] as const))
|
|
972
|
+
const nodes: PresentationSemanticNode[] = [
|
|
973
|
+
{
|
|
974
|
+
definition: surface,
|
|
975
|
+
id: surface.id,
|
|
976
|
+
kind: 'surface',
|
|
977
|
+
},
|
|
978
|
+
]
|
|
979
|
+
|
|
980
|
+
if (surface.workspace) {
|
|
981
|
+
nodes.push({
|
|
982
|
+
definition: surface.workspace,
|
|
983
|
+
id: surface.workspace.Id,
|
|
984
|
+
kind: 'workspace',
|
|
985
|
+
})
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
for (const view of getPresentationSurfaceViewTree(module, surface)) {
|
|
989
|
+
nodes.push({
|
|
990
|
+
definition: view,
|
|
991
|
+
id: view.Id,
|
|
992
|
+
kind: 'view',
|
|
993
|
+
})
|
|
994
|
+
|
|
995
|
+
for (const region of view.Regions) {
|
|
996
|
+
nodes.push({
|
|
997
|
+
definition: region,
|
|
998
|
+
id: `${view.Id}:${region.Id}`,
|
|
999
|
+
kind: 'region',
|
|
1000
|
+
ownerViewId: view.Id,
|
|
1001
|
+
})
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
for (const fieldRef of getPresentationViewProjectedFieldRefs(view)) {
|
|
1005
|
+
const fieldId = fieldRef.fieldId
|
|
1006
|
+
const field = fieldsById.get(fieldId)
|
|
1007
|
+
if (field) {
|
|
1008
|
+
nodes.push({
|
|
1009
|
+
definition: field,
|
|
1010
|
+
id: `${view.Id}:${fieldRef.source}:${field.Id}`,
|
|
1011
|
+
kind: 'field',
|
|
1012
|
+
ownerViewId: view.Id,
|
|
1013
|
+
})
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
for (const action of getPresentationViewProjectedActions(view)) {
|
|
1018
|
+
nodes.push({
|
|
1019
|
+
definition: action,
|
|
1020
|
+
id: `${view.Id}:${action.source}`,
|
|
1021
|
+
kind: 'action',
|
|
1022
|
+
ownerViewId: view.Id,
|
|
1023
|
+
})
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
return nodes
|
|
1028
|
+
}
|