@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,62 @@
|
|
|
1
|
+
import { viewChromeSlotKindLabels, viewChromeSlotPlacementLabels, } from '@cohesivesystems/presentation-contracts';
|
|
2
|
+
export const viewChromeSlotAnyPlacement = '*';
|
|
3
|
+
export function createViewChromeSlotRendererRegistry(bindings) {
|
|
4
|
+
return Object.fromEntries(bindings.map((binding) => [
|
|
5
|
+
createViewChromeSlotRendererKey(binding.kind, binding.placement),
|
|
6
|
+
binding.render,
|
|
7
|
+
]));
|
|
8
|
+
}
|
|
9
|
+
export function createViewChromeSlotRendererKey(kind, placement) {
|
|
10
|
+
return `${normalizeViewChromeSlotKind(kind)}:${placement == null
|
|
11
|
+
? viewChromeSlotAnyPlacement
|
|
12
|
+
: normalizeViewChromeSlotPlacement(placement)}`;
|
|
13
|
+
}
|
|
14
|
+
export function getViewChromeSlotRendererRegistryKeys(registry) {
|
|
15
|
+
return Object.keys(registry ?? {});
|
|
16
|
+
}
|
|
17
|
+
export function getViewChromeSlotRendererCandidateKeys(slot) {
|
|
18
|
+
return [
|
|
19
|
+
createViewChromeSlotRendererKey(slot.Kind, slot.Placement),
|
|
20
|
+
createViewChromeSlotRendererKey(slot.Kind),
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
export function hasViewChromeSlotRendererBinding(keys, slot) {
|
|
24
|
+
return getViewChromeSlotRendererCandidateKeys(slot).some((key) => keys.includes(key));
|
|
25
|
+
}
|
|
26
|
+
export function resolveViewChromeSlotRenderer(registry, slot) {
|
|
27
|
+
const renderers = registry ?? {};
|
|
28
|
+
for (const key of getViewChromeSlotRendererCandidateKeys(slot)) {
|
|
29
|
+
const renderer = renderers[key];
|
|
30
|
+
if (renderer) {
|
|
31
|
+
return renderer;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
export function isViewChromeSlotPlacement(slot, placement) {
|
|
37
|
+
return isViewChromeSlotPlacementValue(slot.Placement, placement);
|
|
38
|
+
}
|
|
39
|
+
export function isViewChromeSlotKind(slot, kind) {
|
|
40
|
+
return normalizeViewChromeSlotKind(slot.Kind) ===
|
|
41
|
+
normalizeViewChromeSlotKind(kind);
|
|
42
|
+
}
|
|
43
|
+
export function isViewChromeSlotPlacementValue(value, placement) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return normalizeViewChromeSlotPlacement(value) ===
|
|
48
|
+
normalizeViewChromeSlotPlacement(placement);
|
|
49
|
+
}
|
|
50
|
+
function normalizeViewChromeSlotKind(value) {
|
|
51
|
+
return normalizeGeneratedEnumToken(value, viewChromeSlotKindLabels);
|
|
52
|
+
}
|
|
53
|
+
function normalizeViewChromeSlotPlacement(value) {
|
|
54
|
+
return normalizeGeneratedEnumToken(value, viewChromeSlotPlacementLabels);
|
|
55
|
+
}
|
|
56
|
+
function normalizeGeneratedEnumToken(value, labels) {
|
|
57
|
+
const label = typeof value === 'number'
|
|
58
|
+
? labels[value] ?? String(value)
|
|
59
|
+
: String(value);
|
|
60
|
+
return label.replace(/[^a-z0-9]/gi, '').toLocaleLowerCase();
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=view-chrome-slot-renderer-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-chrome-slot-renderer-registry.js","sourceRoot":"","sources":["../src/view-chrome-slot-renderer-registry.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cohesivesystems/presentation-core",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"src/**/*.ts",
|
|
15
|
+
"src/**/*.tsx",
|
|
16
|
+
"!src/**/*.test.ts",
|
|
17
|
+
"!src/**/*.test.tsx"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@cohesivesystems/presentation-contracts": "0.1.0-alpha.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^24.12.0",
|
|
24
|
+
"typescript": "~5.9.3",
|
|
25
|
+
"vitest": "^4.1.7"
|
|
26
|
+
},
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"description": "Runtime-agnostic TypeScript helpers for interpreting Cohesive presentation IR.",
|
|
32
|
+
"keywords": [
|
|
33
|
+
"cohesive",
|
|
34
|
+
"presentation",
|
|
35
|
+
"ir",
|
|
36
|
+
"runtime",
|
|
37
|
+
"typescript"
|
|
38
|
+
],
|
|
39
|
+
"author": "Cohesive Systems",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/cohesivesystems/cohesive.git",
|
|
43
|
+
"directory": "src/frontend/presentation-core"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/cohesivesystems/cohesive/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/cohesivesystems/cohesive#readme",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.json && node ../../../eng/fix-package-js-imports.mjs dist",
|
|
51
|
+
"test": "vitest run"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizePresentationScopeRequestSelection,
|
|
3
|
+
type PresentationScopeRequestSelection,
|
|
4
|
+
} from './scope-selection'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generated API scope policy metadata projected into frontend runtimes.
|
|
8
|
+
*/
|
|
9
|
+
export interface ApiScopePolicyMetadata {
|
|
10
|
+
readonly kind: string
|
|
11
|
+
readonly cardinality: 'single' | 'multiple'
|
|
12
|
+
readonly binding: 'ambient' | 'header' | 'query' | 'route' | 'body' | 'resource'
|
|
13
|
+
readonly access: 'requireSelected' | 'filterToAccessible' | 'validateAccessible'
|
|
14
|
+
readonly singleScopeParameterName?: string
|
|
15
|
+
readonly multipleScopesParameterName?: string
|
|
16
|
+
readonly scopeModeParameterName?: string
|
|
17
|
+
readonly resourceParameterName?: string
|
|
18
|
+
readonly resourceDerivation?: {
|
|
19
|
+
readonly strategy: string
|
|
20
|
+
readonly format?: string
|
|
21
|
+
readonly scopeField?: string
|
|
22
|
+
}
|
|
23
|
+
readonly allowDefaultScope: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Minimal HTTP client contract used by generated API clients.
|
|
28
|
+
*/
|
|
29
|
+
export type ApiRequestHttpClient = (
|
|
30
|
+
path: string,
|
|
31
|
+
init: RequestInit,
|
|
32
|
+
) => Promise<unknown>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Projected request after scope policies have been applied.
|
|
36
|
+
*/
|
|
37
|
+
export interface ScopedApiRequest {
|
|
38
|
+
readonly path: string
|
|
39
|
+
readonly init: RequestInit
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Applies generated API scope policies to a request using the current ambient selection.
|
|
44
|
+
*/
|
|
45
|
+
export function projectApiScopeRequest(
|
|
46
|
+
path: string,
|
|
47
|
+
init: RequestInit,
|
|
48
|
+
selection: PresentationScopeRequestSelection,
|
|
49
|
+
policies: readonly ApiScopePolicyMetadata[],
|
|
50
|
+
): ScopedApiRequest {
|
|
51
|
+
const normalizedSelection = normalizePresentationScopeRequestSelection(selection)
|
|
52
|
+
let projectedPath = path
|
|
53
|
+
let projectedInit = init
|
|
54
|
+
|
|
55
|
+
for (const policy of policies) {
|
|
56
|
+
if (policy.binding === 'header') {
|
|
57
|
+
const next = applyHeaderScopePolicy(
|
|
58
|
+
projectedPath,
|
|
59
|
+
projectedInit,
|
|
60
|
+
normalizedSelection,
|
|
61
|
+
policy,
|
|
62
|
+
)
|
|
63
|
+
projectedPath = next.path
|
|
64
|
+
projectedInit = next.init
|
|
65
|
+
continue
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (policy.binding === 'query') {
|
|
69
|
+
const next = applyQueryScopePolicy(
|
|
70
|
+
projectedPath,
|
|
71
|
+
projectedInit,
|
|
72
|
+
normalizedSelection,
|
|
73
|
+
policy,
|
|
74
|
+
)
|
|
75
|
+
projectedPath = next.path
|
|
76
|
+
projectedInit = next.init
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
init: projectedInit,
|
|
82
|
+
path: projectedPath,
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Wraps an HTTP client so scope metadata is applied at request time.
|
|
88
|
+
*/
|
|
89
|
+
export function createScopedApiHttpClient<TClient extends ApiRequestHttpClient>(
|
|
90
|
+
http: TClient,
|
|
91
|
+
{
|
|
92
|
+
getSelection,
|
|
93
|
+
policies,
|
|
94
|
+
}: {
|
|
95
|
+
readonly getSelection: () => PresentationScopeRequestSelection
|
|
96
|
+
readonly policies: readonly ApiScopePolicyMetadata[]
|
|
97
|
+
},
|
|
98
|
+
): TClient {
|
|
99
|
+
return (async (path, init) => {
|
|
100
|
+
const projected = projectApiScopeRequest(path, init, getSelection(), policies)
|
|
101
|
+
return await http(projected.path, projected.init)
|
|
102
|
+
}) as TClient
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function applyHeaderScopePolicy(
|
|
106
|
+
path: string,
|
|
107
|
+
init: RequestInit,
|
|
108
|
+
selection: PresentationScopeRequestSelection,
|
|
109
|
+
policy: ApiScopePolicyMetadata,
|
|
110
|
+
): ScopedApiRequest {
|
|
111
|
+
if (policy.cardinality !== 'single' || !policy.singleScopeParameterName) {
|
|
112
|
+
return { init, path }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (selection.mode !== 'single' || selection.scopeId === null) {
|
|
116
|
+
return { init, path }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const headers = new Headers(init.headers)
|
|
120
|
+
if (headers.has(policy.singleScopeParameterName)) {
|
|
121
|
+
return { init, path }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
headers.set(policy.singleScopeParameterName, selection.scopeId)
|
|
125
|
+
return {
|
|
126
|
+
init: {
|
|
127
|
+
...init,
|
|
128
|
+
headers,
|
|
129
|
+
},
|
|
130
|
+
path,
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function applyQueryScopePolicy(
|
|
135
|
+
path: string,
|
|
136
|
+
init: RequestInit,
|
|
137
|
+
selection: PresentationScopeRequestSelection,
|
|
138
|
+
policy: ApiScopePolicyMetadata,
|
|
139
|
+
): ScopedApiRequest {
|
|
140
|
+
if (policy.cardinality !== 'multiple' || !policy.multipleScopesParameterName) {
|
|
141
|
+
return { init, path }
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const scopeIds = readRequestedScopeIds(selection)
|
|
145
|
+
if (scopeIds.length === 0) {
|
|
146
|
+
return { init, path }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const url = new URL(path, scopeProjectionBaseUrl)
|
|
150
|
+
if (url.searchParams.has(policy.multipleScopesParameterName)) {
|
|
151
|
+
return { init, path }
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
for (const scopeId of scopeIds) {
|
|
155
|
+
url.searchParams.append(policy.multipleScopesParameterName, scopeId)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
init,
|
|
160
|
+
path: formatProjectedPath(path, url),
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function readRequestedScopeIds(selection: PresentationScopeRequestSelection) {
|
|
165
|
+
switch (selection.mode) {
|
|
166
|
+
case 'single':
|
|
167
|
+
return selection.scopeId ? [selection.scopeId] : []
|
|
168
|
+
case 'multiple':
|
|
169
|
+
return [...selection.scopeIds]
|
|
170
|
+
case 'all':
|
|
171
|
+
case 'default':
|
|
172
|
+
return []
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function formatProjectedPath(originalPath: string, url: URL) {
|
|
177
|
+
return isAbsoluteUrl(originalPath)
|
|
178
|
+
? url.toString()
|
|
179
|
+
: `${url.pathname}${url.search}${url.hash}`
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function isAbsoluteUrl(value: string) {
|
|
183
|
+
return /^[a-zA-Z][a-zA-Z\d+.-]*:/.test(value)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const scopeProjectionBaseUrl = 'https://cohesive.local'
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CollectionChromeRuntime,
|
|
3
|
+
} from './collection-chrome-runtime'
|
|
4
|
+
|
|
5
|
+
export const collectionChromeIconIds = {
|
|
6
|
+
detailClose: 'collection.detail.close',
|
|
7
|
+
paginationFirstPage: 'collection.pagination.first-page',
|
|
8
|
+
paginationLoading: 'collection.pagination.loading',
|
|
9
|
+
paginationNextPage: 'collection.pagination.next-page',
|
|
10
|
+
paginationPreviousPage: 'collection.pagination.previous-page',
|
|
11
|
+
rowActionsMenu: 'collection.row-actions.menu',
|
|
12
|
+
} as const
|
|
13
|
+
|
|
14
|
+
export interface CollectionChromeIconSubject {
|
|
15
|
+
readonly details?: Readonly<Record<string, unknown>>
|
|
16
|
+
readonly icon: string
|
|
17
|
+
readonly id: string
|
|
18
|
+
readonly kind: string
|
|
19
|
+
readonly label?: string | null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function resolveCollectionChromeIconSubjects(
|
|
23
|
+
chrome: CollectionChromeRuntime,
|
|
24
|
+
): readonly CollectionChromeIconSubject[] {
|
|
25
|
+
const subjects: CollectionChromeIconSubject[] = []
|
|
26
|
+
|
|
27
|
+
if (chrome.paginationSlot) {
|
|
28
|
+
subjects.push(
|
|
29
|
+
createCollectionChromeIconSubject({
|
|
30
|
+
icon: collectionChromeIconIds.paginationLoading,
|
|
31
|
+
label: 'Pagination loading',
|
|
32
|
+
slotId: chrome.paginationSlot.Id,
|
|
33
|
+
}),
|
|
34
|
+
createCollectionChromeIconSubject({
|
|
35
|
+
icon: collectionChromeIconIds.paginationFirstPage,
|
|
36
|
+
label: 'First page',
|
|
37
|
+
slotId: chrome.paginationSlot.Id,
|
|
38
|
+
}),
|
|
39
|
+
createCollectionChromeIconSubject({
|
|
40
|
+
icon: collectionChromeIconIds.paginationPreviousPage,
|
|
41
|
+
label: 'Previous page',
|
|
42
|
+
slotId: chrome.paginationSlot.Id,
|
|
43
|
+
}),
|
|
44
|
+
createCollectionChromeIconSubject({
|
|
45
|
+
icon: collectionChromeIconIds.paginationNextPage,
|
|
46
|
+
label: 'Next page',
|
|
47
|
+
slotId: chrome.paginationSlot.Id,
|
|
48
|
+
}),
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (chrome.rowActionsSlot) {
|
|
53
|
+
subjects.push(createCollectionChromeIconSubject({
|
|
54
|
+
icon: collectionChromeIconIds.rowActionsMenu,
|
|
55
|
+
label: 'Row actions menu',
|
|
56
|
+
slotId: chrome.rowActionsSlot.Id,
|
|
57
|
+
}))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (chrome.detailSlot) {
|
|
61
|
+
subjects.push(createCollectionChromeIconSubject({
|
|
62
|
+
icon: collectionChromeIconIds.detailClose,
|
|
63
|
+
label: 'Close detail panel',
|
|
64
|
+
slotId: chrome.detailSlot.Id,
|
|
65
|
+
}))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return subjects
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function createCollectionChromeIconSubject({
|
|
72
|
+
icon,
|
|
73
|
+
label,
|
|
74
|
+
slotId,
|
|
75
|
+
}: {
|
|
76
|
+
readonly icon: string
|
|
77
|
+
readonly label: string
|
|
78
|
+
readonly slotId: string
|
|
79
|
+
}): CollectionChromeIconSubject {
|
|
80
|
+
return {
|
|
81
|
+
details: {
|
|
82
|
+
slotId,
|
|
83
|
+
},
|
|
84
|
+
icon,
|
|
85
|
+
id: `${slotId}:${icon}`,
|
|
86
|
+
kind: 'collection-chrome-icon',
|
|
87
|
+
label,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CollectionChromeDefinition,
|
|
3
|
+
CollectionChromeSlotDefinition,
|
|
4
|
+
CollectionChromeSlotKind,
|
|
5
|
+
CollectionChromeSlotPlacement,
|
|
6
|
+
ViewDefinition,
|
|
7
|
+
} from './module'
|
|
8
|
+
import {
|
|
9
|
+
collectionChromeSlotKinds,
|
|
10
|
+
collectionChromeSlotPlacements,
|
|
11
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
12
|
+
|
|
13
|
+
export type CollectionChromeRuntimeDefinition = NonNullable<ViewDefinition['Collection']>
|
|
14
|
+
|
|
15
|
+
export interface CollectionChromeRuntime {
|
|
16
|
+
readonly bodySlot: CollectionChromeSlotDefinition | null
|
|
17
|
+
readonly definition: CollectionChromeDefinition | null
|
|
18
|
+
readonly detailSlot: CollectionChromeSlotDefinition | null
|
|
19
|
+
readonly paginationFooterSlot: CollectionChromeSlotDefinition | null
|
|
20
|
+
readonly paginationSlot: CollectionChromeSlotDefinition | null
|
|
21
|
+
readonly queryFormSlot: CollectionChromeSlotDefinition | null
|
|
22
|
+
readonly rowActionsSlot: CollectionChromeSlotDefinition | null
|
|
23
|
+
readonly selectionActionsSlot: CollectionChromeSlotDefinition | null
|
|
24
|
+
readonly slots: readonly CollectionChromeSlotDefinition[]
|
|
25
|
+
readonly summarySlot: CollectionChromeSlotDefinition | null
|
|
26
|
+
readonly findSlot: (
|
|
27
|
+
kind: CollectionChromeSlotKind,
|
|
28
|
+
placement?: CollectionChromeSlotPlacement,
|
|
29
|
+
) => CollectionChromeSlotDefinition | null
|
|
30
|
+
readonly findSlots: (
|
|
31
|
+
kind: CollectionChromeSlotKind,
|
|
32
|
+
placement?: CollectionChromeSlotPlacement,
|
|
33
|
+
) => readonly CollectionChromeSlotDefinition[]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createCollectionChromeRuntime(
|
|
37
|
+
collection: CollectionChromeRuntimeDefinition | null | undefined,
|
|
38
|
+
): CollectionChromeRuntime {
|
|
39
|
+
const slots = resolveCollectionChromeSlots(collection)
|
|
40
|
+
const findSlots = (
|
|
41
|
+
kind: CollectionChromeSlotKind,
|
|
42
|
+
placement?: CollectionChromeSlotPlacement,
|
|
43
|
+
) =>
|
|
44
|
+
slots.filter((slot) =>
|
|
45
|
+
isCollectionChromeSlotKind(slot, kind) &&
|
|
46
|
+
(placement === undefined || isCollectionChromeSlotPlacement(slot, placement)))
|
|
47
|
+
const findSlot = (
|
|
48
|
+
kind: CollectionChromeSlotKind,
|
|
49
|
+
placement?: CollectionChromeSlotPlacement,
|
|
50
|
+
) => findSlots(kind, placement)[0] ?? null
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
bodySlot: findSlot(collectionChromeSlotKinds.body),
|
|
54
|
+
definition: collection?.Chrome ?? null,
|
|
55
|
+
detailSlot: findSlot(collectionChromeSlotKinds.detail),
|
|
56
|
+
findSlot,
|
|
57
|
+
findSlots,
|
|
58
|
+
paginationFooterSlot: findSlot(
|
|
59
|
+
collectionChromeSlotKinds.pagination,
|
|
60
|
+
collectionChromeSlotPlacements.footer,
|
|
61
|
+
),
|
|
62
|
+
paginationSlot: findSlot(collectionChromeSlotKinds.pagination),
|
|
63
|
+
queryFormSlot: findSlot(collectionChromeSlotKinds.queryForm),
|
|
64
|
+
rowActionsSlot: findSlot(collectionChromeSlotKinds.rowActions),
|
|
65
|
+
selectionActionsSlot: findSlot(collectionChromeSlotKinds.selectionActions),
|
|
66
|
+
slots,
|
|
67
|
+
summarySlot: findSlot(collectionChromeSlotKinds.summary),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function resolveCollectionChromeSlots(
|
|
72
|
+
collection: CollectionChromeRuntimeDefinition | null | undefined,
|
|
73
|
+
): readonly CollectionChromeSlotDefinition[] {
|
|
74
|
+
return collection?.Chrome?.Slots ?? []
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function resolveCollectionChromeDataSourceIds(
|
|
78
|
+
collection: CollectionChromeRuntimeDefinition | null | undefined,
|
|
79
|
+
) {
|
|
80
|
+
return resolveCollectionChromeSlots(collection).flatMap((slot) => slot.DataSourceIds)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function resolveCollectionChromePrimaryDataSourceId(
|
|
84
|
+
collection: CollectionChromeRuntimeDefinition | null | undefined,
|
|
85
|
+
) {
|
|
86
|
+
const chrome = createCollectionChromeRuntime(collection)
|
|
87
|
+
return chrome.bodySlot?.DataSourceIds[0] ??
|
|
88
|
+
chrome.slots.flatMap((slot) => slot.DataSourceIds)[0] ??
|
|
89
|
+
null
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function isCollectionChromeSlotKind(
|
|
93
|
+
slot: CollectionChromeSlotDefinition,
|
|
94
|
+
kind: CollectionChromeSlotKind,
|
|
95
|
+
) {
|
|
96
|
+
return matchesCollectionChromeSlotKind(slot.Kind, kind)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function isCollectionChromeSlotPlacement(
|
|
100
|
+
slot: CollectionChromeSlotDefinition,
|
|
101
|
+
placement: CollectionChromeSlotPlacement,
|
|
102
|
+
) {
|
|
103
|
+
return matchesCollectionChromeSlotPlacement(slot.Placement, placement)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function matchesCollectionChromeSlotKind(
|
|
107
|
+
value: unknown,
|
|
108
|
+
kind: CollectionChromeSlotKind,
|
|
109
|
+
) {
|
|
110
|
+
const labelsByKind: Readonly<Record<CollectionChromeSlotKind, string>> = {
|
|
111
|
+
[collectionChromeSlotKinds.queryForm]: 'queryForm',
|
|
112
|
+
[collectionChromeSlotKinds.pagination]: 'pagination',
|
|
113
|
+
[collectionChromeSlotKinds.selectionActions]: 'selectionActions',
|
|
114
|
+
[collectionChromeSlotKinds.rowActions]: 'rowActions',
|
|
115
|
+
[collectionChromeSlotKinds.detail]: 'detail',
|
|
116
|
+
[collectionChromeSlotKinds.summary]: 'summary',
|
|
117
|
+
[collectionChromeSlotKinds.custom]: 'custom',
|
|
118
|
+
[collectionChromeSlotKinds.body]: 'body',
|
|
119
|
+
}
|
|
120
|
+
return matchesGeneratedEnumValue(value, kind, labelsByKind[kind])
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function matchesCollectionChromeSlotPlacement(
|
|
124
|
+
value: unknown,
|
|
125
|
+
placement: CollectionChromeSlotPlacement,
|
|
126
|
+
) {
|
|
127
|
+
const labelsByPlacement: Readonly<Record<CollectionChromeSlotPlacement, string>> = {
|
|
128
|
+
[collectionChromeSlotPlacements.none]: 'none',
|
|
129
|
+
[collectionChromeSlotPlacements.header]: 'header',
|
|
130
|
+
[collectionChromeSlotPlacements.toolbar]: 'toolbar',
|
|
131
|
+
[collectionChromeSlotPlacements.above]: 'above',
|
|
132
|
+
[collectionChromeSlotPlacements.inline]: 'inline',
|
|
133
|
+
[collectionChromeSlotPlacements.footer]: 'footer',
|
|
134
|
+
[collectionChromeSlotPlacements.sidePanel]: 'sidePanel',
|
|
135
|
+
[collectionChromeSlotPlacements.drawer]: 'drawer',
|
|
136
|
+
}
|
|
137
|
+
return matchesGeneratedEnumValue(value, placement, labelsByPlacement[placement])
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function matchesGeneratedEnumValue<TValue extends number>(
|
|
141
|
+
value: unknown,
|
|
142
|
+
numericValue: TValue,
|
|
143
|
+
camelLabel: string,
|
|
144
|
+
) {
|
|
145
|
+
const normalizedValue = String(value).toLocaleLowerCase()
|
|
146
|
+
return (
|
|
147
|
+
value === numericValue ||
|
|
148
|
+
String(value) === String(numericValue) ||
|
|
149
|
+
normalizedValue === camelLabel.toLocaleLowerCase()
|
|
150
|
+
)
|
|
151
|
+
}
|