@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,123 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PresentationBindingDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
|
|
5
|
+
export interface PresentationEnumDiscriminator {
|
|
6
|
+
readonly label?: string
|
|
7
|
+
readonly value: string | number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FindPresentationComponentBindingOptions {
|
|
11
|
+
readonly bindingKind: PresentationEnumDiscriminator
|
|
12
|
+
readonly componentSet?: string | null
|
|
13
|
+
readonly id: string
|
|
14
|
+
readonly routeId?: string | null
|
|
15
|
+
readonly targetKind?: PresentationEnumDiscriminator | null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ResolvedPresentationComponentBinding<
|
|
19
|
+
TBinding extends PresentationBindingDefinition = PresentationBindingDefinition,
|
|
20
|
+
> {
|
|
21
|
+
readonly binding: TBinding | null
|
|
22
|
+
readonly componentKey: string | null
|
|
23
|
+
readonly componentRole: string | null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface PresentationTargetBindingProjection {
|
|
27
|
+
readonly Bindings: readonly PresentationBindingDefinition[]
|
|
28
|
+
readonly ComponentSet?: string | null
|
|
29
|
+
readonly Target: string | number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function findPresentationComponentBinding<
|
|
33
|
+
TBinding extends PresentationBindingDefinition,
|
|
34
|
+
>(
|
|
35
|
+
module: { readonly Targets: readonly PresentationTargetBindingProjection[] },
|
|
36
|
+
{
|
|
37
|
+
bindingKind,
|
|
38
|
+
componentSet,
|
|
39
|
+
id,
|
|
40
|
+
routeId,
|
|
41
|
+
targetKind,
|
|
42
|
+
}: FindPresentationComponentBindingOptions,
|
|
43
|
+
): TBinding | null {
|
|
44
|
+
const targetMatches = module.Targets.filter((target) => {
|
|
45
|
+
if (targetKind && !matchesPresentationEnum(target.Target, targetKind)) {
|
|
46
|
+
return false
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return !componentSet || target.ComponentSet === componentSet
|
|
50
|
+
})
|
|
51
|
+
const targets = targetMatches.length > 0 ? targetMatches : module.Targets
|
|
52
|
+
const bindings = targets
|
|
53
|
+
.flatMap((target) => target.Bindings)
|
|
54
|
+
.filter(
|
|
55
|
+
(binding) =>
|
|
56
|
+
matchesPresentationEnum(binding.Kind, bindingKind) && binding.Id === id,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
(bindings.find((binding) => routeId && binding.RouteId === routeId) as
|
|
61
|
+
| TBinding
|
|
62
|
+
| undefined) ??
|
|
63
|
+
(bindings.find((binding) => !binding.RouteId) as TBinding | undefined) ??
|
|
64
|
+
(bindings[0] as TBinding | undefined) ??
|
|
65
|
+
null
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function resolvePresentationComponentBinding<
|
|
70
|
+
TBinding extends PresentationBindingDefinition = PresentationBindingDefinition,
|
|
71
|
+
>(
|
|
72
|
+
module: { readonly Targets: readonly PresentationTargetBindingProjection[] },
|
|
73
|
+
options: FindPresentationComponentBindingOptions,
|
|
74
|
+
): ResolvedPresentationComponentBinding<TBinding> {
|
|
75
|
+
const binding = findPresentationComponentBinding<TBinding>(module, options)
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
binding,
|
|
79
|
+
componentKey: binding?.ComponentKey ?? null,
|
|
80
|
+
componentRole: binding?.ComponentRole ?? null,
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function matchesPresentationEnum(
|
|
85
|
+
value: string | number,
|
|
86
|
+
discriminator: PresentationEnumDiscriminator,
|
|
87
|
+
) {
|
|
88
|
+
return value === discriminator.value || value === discriminator.label
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function createPresentationEnumDiscriminator<
|
|
92
|
+
TValues extends Readonly<Record<string, string | number>>,
|
|
93
|
+
>(
|
|
94
|
+
values: TValues,
|
|
95
|
+
key: keyof TValues,
|
|
96
|
+
label?: string,
|
|
97
|
+
): PresentationEnumDiscriminator {
|
|
98
|
+
return { label, value: values[key] }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function createPresentationComponentBinding<
|
|
102
|
+
TComponentKey extends string,
|
|
103
|
+
>({
|
|
104
|
+
componentKey,
|
|
105
|
+
componentRole,
|
|
106
|
+
id,
|
|
107
|
+
kind,
|
|
108
|
+
routeId,
|
|
109
|
+
}: {
|
|
110
|
+
readonly componentKey?: TComponentKey
|
|
111
|
+
readonly componentRole?: string
|
|
112
|
+
readonly id: string
|
|
113
|
+
readonly kind: PresentationBindingDefinition['Kind']
|
|
114
|
+
readonly routeId?: string
|
|
115
|
+
}): PresentationBindingDefinition {
|
|
116
|
+
return {
|
|
117
|
+
ComponentKey: componentKey ?? null,
|
|
118
|
+
ComponentRole: componentRole,
|
|
119
|
+
Id: id,
|
|
120
|
+
Kind: kind,
|
|
121
|
+
RouteId: routeId,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findPresentationView,
|
|
3
|
+
} from './module'
|
|
4
|
+
import type {
|
|
5
|
+
PresentationModuleDefinition,
|
|
6
|
+
ViewDefinition,
|
|
7
|
+
} from './module'
|
|
8
|
+
import type {
|
|
9
|
+
PresentationProjectionDiagnostic,
|
|
10
|
+
} from './presentation-projection-diagnostics'
|
|
11
|
+
|
|
12
|
+
export interface ProjectViewChromeContentDiagnosticsOptions {
|
|
13
|
+
readonly module: Pick<PresentationModuleDefinition, 'Views'> | null
|
|
14
|
+
readonly view: ViewDefinition | null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function projectViewChromeContentDiagnostics({
|
|
18
|
+
module,
|
|
19
|
+
view,
|
|
20
|
+
}: ProjectViewChromeContentDiagnosticsOptions): readonly PresentationProjectionDiagnostic[] {
|
|
21
|
+
return collectViewTree(module, view).flatMap(projectSingleViewChromeContentDiagnostics)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function projectSingleViewChromeContentDiagnostics(
|
|
25
|
+
view: ViewDefinition,
|
|
26
|
+
): readonly PresentationProjectionDiagnostic[] {
|
|
27
|
+
const chrome = view.Chrome
|
|
28
|
+
if (!chrome) {
|
|
29
|
+
return []
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const hasLegacyTitle = Boolean(chrome.Title)
|
|
33
|
+
const hasLegacySubtitle = Boolean(chrome.Subtitle)
|
|
34
|
+
const content = chrome.Content
|
|
35
|
+
if (!content && (hasLegacyTitle || hasLegacySubtitle)) {
|
|
36
|
+
return [
|
|
37
|
+
createViewChromeContentDiagnostic({
|
|
38
|
+
fields: [
|
|
39
|
+
hasLegacyTitle ? 'Title' : null,
|
|
40
|
+
hasLegacySubtitle ? 'Subtitle' : null,
|
|
41
|
+
].filter((field): field is string => Boolean(field)),
|
|
42
|
+
message:
|
|
43
|
+
`View '${view.Name}' chrome still declares legacy title/subtitle fields ` +
|
|
44
|
+
'without Content; the frontend will use legacy chrome content fallback semantics.',
|
|
45
|
+
reason: 'legacy-content-fallback',
|
|
46
|
+
view,
|
|
47
|
+
}),
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const diagnostics: PresentationProjectionDiagnostic[] = []
|
|
52
|
+
if (content && hasLegacyTitle && !content.Title) {
|
|
53
|
+
diagnostics.push(
|
|
54
|
+
createViewChromeContentDiagnostic({
|
|
55
|
+
fields: ['Title'],
|
|
56
|
+
message:
|
|
57
|
+
`View '${view.Name}' chrome Content does not declare a title, but legacy Title is present; ` +
|
|
58
|
+
'the frontend will use legacy title fallback semantics.',
|
|
59
|
+
reason: 'legacy-title-fallback',
|
|
60
|
+
view,
|
|
61
|
+
}),
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const hasContentDescription = Boolean(
|
|
66
|
+
content?.Description ??
|
|
67
|
+
content?.DescriptionTemplate ??
|
|
68
|
+
content?.Subtitle,
|
|
69
|
+
)
|
|
70
|
+
if (content && hasLegacySubtitle && !hasContentDescription) {
|
|
71
|
+
diagnostics.push(
|
|
72
|
+
createViewChromeContentDiagnostic({
|
|
73
|
+
fields: ['Subtitle'],
|
|
74
|
+
message:
|
|
75
|
+
`View '${view.Name}' chrome Content does not declare description or subtitle content, ` +
|
|
76
|
+
'but legacy Subtitle is present; the frontend will use legacy subtitle fallback semantics.',
|
|
77
|
+
reason: 'legacy-subtitle-fallback',
|
|
78
|
+
view,
|
|
79
|
+
}),
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return diagnostics
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function collectViewTree(
|
|
87
|
+
module: Pick<PresentationModuleDefinition, 'Views'> | null,
|
|
88
|
+
view: ViewDefinition | null,
|
|
89
|
+
seen = new Set<string>(),
|
|
90
|
+
): readonly ViewDefinition[] {
|
|
91
|
+
if (!view || seen.has(view.Id)) {
|
|
92
|
+
return []
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
seen.add(view.Id)
|
|
96
|
+
return [
|
|
97
|
+
view,
|
|
98
|
+
...view.Regions.flatMap((region) =>
|
|
99
|
+
region.ViewIds.flatMap((viewId) =>
|
|
100
|
+
collectViewTree(module, findPresentationView(module, viewId), seen),
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function createViewChromeContentDiagnostic({
|
|
107
|
+
fields,
|
|
108
|
+
message,
|
|
109
|
+
reason,
|
|
110
|
+
view,
|
|
111
|
+
}: {
|
|
112
|
+
readonly fields: readonly string[]
|
|
113
|
+
readonly message: string
|
|
114
|
+
readonly reason: string
|
|
115
|
+
readonly view: ViewDefinition
|
|
116
|
+
}): PresentationProjectionDiagnostic {
|
|
117
|
+
return {
|
|
118
|
+
category: 'incomplete-projection',
|
|
119
|
+
details: {
|
|
120
|
+
fields,
|
|
121
|
+
viewId: view.Id,
|
|
122
|
+
},
|
|
123
|
+
id: `view-chrome.${view.Id}.content.${reason}`,
|
|
124
|
+
interpretation: {
|
|
125
|
+
status: 'locally-interpreted',
|
|
126
|
+
target: 'react',
|
|
127
|
+
},
|
|
128
|
+
message,
|
|
129
|
+
severity: 'warning',
|
|
130
|
+
source: 'view-chrome-content-projection',
|
|
131
|
+
subject: {
|
|
132
|
+
id: view.Id,
|
|
133
|
+
kind: 'view-chrome',
|
|
134
|
+
name: view.Name,
|
|
135
|
+
},
|
|
136
|
+
suggestedNextStep:
|
|
137
|
+
'Declare View.Chrome.Content with PresentationContentDefinition and remove legacy title/subtitle fallback fields.',
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ViewChromeSlotDefinition,
|
|
3
|
+
} from './module'
|
|
4
|
+
import type {
|
|
5
|
+
PresentationIconDiagnosticSubject,
|
|
6
|
+
} from './presentation-icon-diagnostics'
|
|
7
|
+
import {
|
|
8
|
+
isViewChromeSlotKind,
|
|
9
|
+
} from './view-chrome-slot-renderer-registry'
|
|
10
|
+
import {
|
|
11
|
+
viewChromeSlotKinds,
|
|
12
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
13
|
+
|
|
14
|
+
export const viewChromeIconIds = {
|
|
15
|
+
layoutSingle: 'view-chrome.layout.single',
|
|
16
|
+
layoutSplit: 'view-chrome.layout.split',
|
|
17
|
+
viewDefault: 'view-chrome.view.default',
|
|
18
|
+
viewJson: 'view-chrome.view.json',
|
|
19
|
+
viewStructure: 'view-chrome.view.structure',
|
|
20
|
+
viewTypes: 'view-chrome.view.types',
|
|
21
|
+
} as const
|
|
22
|
+
|
|
23
|
+
export function resolveViewChromeIconSubjects(
|
|
24
|
+
slots: readonly ViewChromeSlotDefinition[],
|
|
25
|
+
): readonly PresentationIconDiagnosticSubject[] {
|
|
26
|
+
return slots.flatMap((slot) => {
|
|
27
|
+
if (isViewChromeSlotKind(slot, viewChromeSlotKinds.layoutSwitch)) {
|
|
28
|
+
return [
|
|
29
|
+
createViewChromeIconSubject(slot, viewChromeIconIds.layoutSingle, 'Single layout'),
|
|
30
|
+
createViewChromeIconSubject(slot, viewChromeIconIds.layoutSplit, 'Split layout'),
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (isViewChromeSlotKind(slot, viewChromeSlotKinds.viewSwitch)) {
|
|
35
|
+
return slot.ViewIds.map((viewId) =>
|
|
36
|
+
createViewChromeIconSubject(
|
|
37
|
+
slot,
|
|
38
|
+
resolveViewChromeViewIconId(viewId),
|
|
39
|
+
`View switch: ${viewId}`,
|
|
40
|
+
{ viewId },
|
|
41
|
+
))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return []
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function createViewChromeIconSubject(
|
|
49
|
+
slot: ViewChromeSlotDefinition,
|
|
50
|
+
icon: string,
|
|
51
|
+
label: string,
|
|
52
|
+
details: Readonly<Record<string, unknown>> = {},
|
|
53
|
+
): PresentationIconDiagnosticSubject {
|
|
54
|
+
return {
|
|
55
|
+
details: {
|
|
56
|
+
slotId: slot.Id,
|
|
57
|
+
...details,
|
|
58
|
+
},
|
|
59
|
+
icon,
|
|
60
|
+
id: `${slot.Id}:${icon}`,
|
|
61
|
+
kind: 'view-chrome-icon',
|
|
62
|
+
label,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function resolveViewChromeViewIconId(viewId: string) {
|
|
67
|
+
const normalized = viewId.toLocaleLowerCase()
|
|
68
|
+
if (normalized.includes('json')) {
|
|
69
|
+
return viewChromeIconIds.viewJson
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (normalized.includes('type')) {
|
|
73
|
+
return viewChromeIconIds.viewTypes
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (normalized.includes('structure')) {
|
|
77
|
+
return viewChromeIconIds.viewStructure
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return viewChromeIconIds.viewDefault
|
|
81
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ViewChromeSlotDefinition,
|
|
3
|
+
ViewChromeSlotKind,
|
|
4
|
+
ViewChromeSlotPlacement,
|
|
5
|
+
} from './module'
|
|
6
|
+
import {
|
|
7
|
+
viewChromeSlotKindLabels,
|
|
8
|
+
viewChromeSlotPlacementLabels,
|
|
9
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
10
|
+
|
|
11
|
+
export const viewChromeSlotAnyPlacement = '*'
|
|
12
|
+
|
|
13
|
+
export type ViewChromeSlotRenderer<TContext, TResult = unknown> = (
|
|
14
|
+
context: TContext,
|
|
15
|
+
) => TResult
|
|
16
|
+
|
|
17
|
+
export type ViewChromeSlotRendererRegistry<TContext, TResult = unknown> = Readonly<
|
|
18
|
+
Record<string, ViewChromeSlotRenderer<TContext, TResult>>
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
export interface ViewChromeSlotRendererBinding<TContext, TResult = unknown> {
|
|
22
|
+
readonly kind: ViewChromeSlotKind | string | number
|
|
23
|
+
readonly placement?: ViewChromeSlotPlacement | string | number | null
|
|
24
|
+
readonly render: ViewChromeSlotRenderer<TContext, TResult>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function createViewChromeSlotRendererRegistry<TContext, TResult = unknown>(
|
|
28
|
+
bindings: readonly ViewChromeSlotRendererBinding<TContext, TResult>[],
|
|
29
|
+
): ViewChromeSlotRendererRegistry<TContext, TResult> {
|
|
30
|
+
return Object.fromEntries(
|
|
31
|
+
bindings.map((binding) => [
|
|
32
|
+
createViewChromeSlotRendererKey(binding.kind, binding.placement),
|
|
33
|
+
binding.render,
|
|
34
|
+
]),
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function createViewChromeSlotRendererKey(
|
|
39
|
+
kind: ViewChromeSlotKind | string | number,
|
|
40
|
+
placement?: ViewChromeSlotPlacement | string | number | null,
|
|
41
|
+
) {
|
|
42
|
+
return `${normalizeViewChromeSlotKind(kind)}:${placement == null
|
|
43
|
+
? viewChromeSlotAnyPlacement
|
|
44
|
+
: normalizeViewChromeSlotPlacement(placement)}`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getViewChromeSlotRendererRegistryKeys<TContext, TResult = unknown>(
|
|
48
|
+
registry: ViewChromeSlotRendererRegistry<TContext, TResult> | null | undefined,
|
|
49
|
+
) {
|
|
50
|
+
return Object.keys(registry ?? {})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getViewChromeSlotRendererCandidateKeys(
|
|
54
|
+
slot: ViewChromeSlotDefinition,
|
|
55
|
+
) {
|
|
56
|
+
return [
|
|
57
|
+
createViewChromeSlotRendererKey(slot.Kind, slot.Placement),
|
|
58
|
+
createViewChromeSlotRendererKey(slot.Kind),
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function hasViewChromeSlotRendererBinding(
|
|
63
|
+
keys: readonly string[],
|
|
64
|
+
slot: ViewChromeSlotDefinition,
|
|
65
|
+
) {
|
|
66
|
+
return getViewChromeSlotRendererCandidateKeys(slot).some((key) =>
|
|
67
|
+
keys.includes(key))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function resolveViewChromeSlotRenderer<TContext, TResult = unknown>(
|
|
71
|
+
registry: ViewChromeSlotRendererRegistry<TContext, TResult> | null | undefined,
|
|
72
|
+
slot: ViewChromeSlotDefinition,
|
|
73
|
+
) {
|
|
74
|
+
const renderers = registry ?? {}
|
|
75
|
+
for (const key of getViewChromeSlotRendererCandidateKeys(slot)) {
|
|
76
|
+
const renderer = renderers[key]
|
|
77
|
+
if (renderer) {
|
|
78
|
+
return renderer
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function isViewChromeSlotPlacement(
|
|
86
|
+
slot: ViewChromeSlotDefinition,
|
|
87
|
+
placement: ViewChromeSlotPlacement | string | number,
|
|
88
|
+
) {
|
|
89
|
+
return isViewChromeSlotPlacementValue(slot.Placement, placement)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function isViewChromeSlotKind(
|
|
93
|
+
slot: ViewChromeSlotDefinition,
|
|
94
|
+
kind: ViewChromeSlotKind | string | number,
|
|
95
|
+
) {
|
|
96
|
+
return normalizeViewChromeSlotKind(slot.Kind) ===
|
|
97
|
+
normalizeViewChromeSlotKind(kind)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function isViewChromeSlotPlacementValue(
|
|
101
|
+
value: ViewChromeSlotPlacement | string | number | null | undefined,
|
|
102
|
+
placement: ViewChromeSlotPlacement | string | number,
|
|
103
|
+
) {
|
|
104
|
+
if (value == null) {
|
|
105
|
+
return false
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return normalizeViewChromeSlotPlacement(value) ===
|
|
109
|
+
normalizeViewChromeSlotPlacement(placement)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function normalizeViewChromeSlotKind(value: unknown) {
|
|
113
|
+
return normalizeGeneratedEnumToken(value, viewChromeSlotKindLabels)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function normalizeViewChromeSlotPlacement(value: unknown) {
|
|
117
|
+
return normalizeGeneratedEnumToken(value, viewChromeSlotPlacementLabels)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function normalizeGeneratedEnumToken(
|
|
121
|
+
value: unknown,
|
|
122
|
+
labels: Readonly<Record<number, string>>,
|
|
123
|
+
) {
|
|
124
|
+
const label = typeof value === 'number'
|
|
125
|
+
? labels[value] ?? String(value)
|
|
126
|
+
: String(value)
|
|
127
|
+
return label.replace(/[^a-z0-9]/gi, '').toLocaleLowerCase()
|
|
128
|
+
}
|