@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,364 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NavigationDefinition,
|
|
3
|
+
NavigationHistoryDefinition,
|
|
4
|
+
NavigationRouteDefinition,
|
|
5
|
+
NavigationShellRegionDefinition,
|
|
6
|
+
PageHostDefinition,
|
|
7
|
+
PageHostKind,
|
|
8
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
9
|
+
import {
|
|
10
|
+
layoutNodeKinds,
|
|
11
|
+
layoutOrientations,
|
|
12
|
+
navigationContextKinds,
|
|
13
|
+
navigationHistoryKinds,
|
|
14
|
+
navigationRouteInstanceIdentityKinds,
|
|
15
|
+
navigationRouteKinds,
|
|
16
|
+
navigationRouteUpdateModes,
|
|
17
|
+
pageHostKinds,
|
|
18
|
+
pageRegionKinds,
|
|
19
|
+
workspaceInstantiationModes,
|
|
20
|
+
} from '@cohesivesystems/presentation-contracts'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Primitive parameter bag used when resolving semantic navigation route
|
|
24
|
+
* templates into concrete hrefs.
|
|
25
|
+
*/
|
|
26
|
+
export type NavigationRouteParameters = Record<
|
|
27
|
+
string,
|
|
28
|
+
boolean | number | string | null | undefined
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a semantic route id and optional route parameters into a concrete
|
|
33
|
+
* href, or `null` when the route cannot be represented for the active
|
|
34
|
+
* navigation definition.
|
|
35
|
+
*/
|
|
36
|
+
export type PresentationNavigationHrefFactory = (
|
|
37
|
+
routeId: string,
|
|
38
|
+
parameters?: NavigationRouteParameters,
|
|
39
|
+
) => string | null
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Executes navigation to a concrete href that has already been resolved from a
|
|
43
|
+
* presentation navigation route.
|
|
44
|
+
*
|
|
45
|
+
* The href may be absolute, root-relative, or application-relative depending on
|
|
46
|
+
* the active host router binding.
|
|
47
|
+
*/
|
|
48
|
+
export type PresentationHrefNavigator = (href: string) => void
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Executes navigation by semantic route id using the active presentation
|
|
52
|
+
* navigation definition.
|
|
53
|
+
*
|
|
54
|
+
* Implementations are responsible for resolving route parameters into a href
|
|
55
|
+
* and ignoring navigation when the route cannot be resolved.
|
|
56
|
+
*/
|
|
57
|
+
export type PresentationRouteNavigator = (
|
|
58
|
+
routeId: string,
|
|
59
|
+
parameters?: NavigationRouteParameters,
|
|
60
|
+
) => void
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Runtime navigation services exposed to projected presentation components.
|
|
64
|
+
*
|
|
65
|
+
* This keeps projected components coupled to Cohesive navigation semantics
|
|
66
|
+
* rather than to a concrete host router such as React Router.
|
|
67
|
+
*/
|
|
68
|
+
export interface PresentationNavigationRuntime {
|
|
69
|
+
/** Resolves a semantic route id and optional parameters into a concrete href. */
|
|
70
|
+
readonly createHref: PresentationNavigationHrefFactory
|
|
71
|
+
|
|
72
|
+
/** Navigates to an already resolved href in the active host application. */
|
|
73
|
+
readonly navigateHref: PresentationHrefNavigator
|
|
74
|
+
|
|
75
|
+
/** Resolves and navigates to a semantic route in the active host application. */
|
|
76
|
+
readonly navigateRoute: PresentationRouteNavigator
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type NavigationDefinitionProjection<
|
|
80
|
+
TRoute extends NavigationRouteDefinition = NavigationRouteDefinition,
|
|
81
|
+
TPageHost extends PageHostDefinition = PageHostDefinition,
|
|
82
|
+
> = Omit<NavigationDefinition, 'PageHosts' | 'Routes'> & {
|
|
83
|
+
readonly Routes: readonly TRoute[]
|
|
84
|
+
readonly PageHosts: readonly TPageHost[]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function createNavigationHref<TRoute extends NavigationRouteDefinition>(
|
|
88
|
+
navigation: NavigationDefinitionProjection<TRoute>,
|
|
89
|
+
routeId: string,
|
|
90
|
+
parameters?: NavigationRouteParameters,
|
|
91
|
+
) {
|
|
92
|
+
const route = findNavigationRoute(navigation, routeId)
|
|
93
|
+
if (!route) {
|
|
94
|
+
return null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let href = route.PathTemplate
|
|
98
|
+
for (const parameter of route.Parameters) {
|
|
99
|
+
const token = `{${parameter.Name}}`
|
|
100
|
+
if (!href.includes(token)) {
|
|
101
|
+
continue
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const value = parameters?.[parameter.Name]
|
|
105
|
+
if (value === null || value === undefined || String(value).length === 0) {
|
|
106
|
+
if (parameter.IsRequired) {
|
|
107
|
+
return null
|
|
108
|
+
}
|
|
109
|
+
continue
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
href = href.replace(token, encodeURIComponent(String(value)))
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return /\{[^}]+\}/.test(href) ? null : href
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function findNavigationRoute<
|
|
119
|
+
TRoute extends NavigationRouteDefinition,
|
|
120
|
+
>(
|
|
121
|
+
navigation: Pick<NavigationDefinitionProjection<TRoute>, 'Routes'>,
|
|
122
|
+
routeId: string,
|
|
123
|
+
): TRoute | null {
|
|
124
|
+
return navigation.Routes.find((route) => route.Id === routeId) ?? null
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function findNavigationPageHost<
|
|
128
|
+
TPageHost extends PageHostDefinition,
|
|
129
|
+
>(
|
|
130
|
+
navigation: Pick<
|
|
131
|
+
NavigationDefinitionProjection<NavigationRouteDefinition, TPageHost>,
|
|
132
|
+
'PageHosts'
|
|
133
|
+
>,
|
|
134
|
+
pageHostId: string,
|
|
135
|
+
): TPageHost | null {
|
|
136
|
+
return navigation.PageHosts?.find((pageHost) => pageHost.Id === pageHostId) ?? null
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function createNavigationRoute({
|
|
140
|
+
id,
|
|
141
|
+
kind,
|
|
142
|
+
label,
|
|
143
|
+
pageHostId,
|
|
144
|
+
parameterName,
|
|
145
|
+
pathTemplate,
|
|
146
|
+
parameterType = 'string',
|
|
147
|
+
}: {
|
|
148
|
+
readonly id: string
|
|
149
|
+
readonly kind?: NavigationRouteDefinition['Kind']
|
|
150
|
+
readonly label?: string
|
|
151
|
+
readonly pageHostId: string
|
|
152
|
+
readonly parameterName?: string
|
|
153
|
+
readonly parameterType?: string
|
|
154
|
+
readonly pathTemplate: string
|
|
155
|
+
}): NavigationRouteDefinition {
|
|
156
|
+
return {
|
|
157
|
+
Id: id,
|
|
158
|
+
Kind: kind ?? (parameterName
|
|
159
|
+
? navigationRouteKinds.entityDetail
|
|
160
|
+
: navigationRouteKinds.page),
|
|
161
|
+
Label: label ?? createNavigationLabel(id),
|
|
162
|
+
PageHostId: pageHostId,
|
|
163
|
+
Parameters: parameterName
|
|
164
|
+
? [{ IsRequired: true, Name: parameterName, Type: parameterType }]
|
|
165
|
+
: [],
|
|
166
|
+
PathTemplate: pathTemplate,
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function createPageHost({
|
|
171
|
+
id,
|
|
172
|
+
kind = pageHostKinds.singleView,
|
|
173
|
+
viewId,
|
|
174
|
+
}: {
|
|
175
|
+
readonly id: string
|
|
176
|
+
readonly kind?: PageHostKind
|
|
177
|
+
readonly viewId: string
|
|
178
|
+
}): PageHostDefinition {
|
|
179
|
+
return {
|
|
180
|
+
Annotations: [],
|
|
181
|
+
Id: id,
|
|
182
|
+
Kind: kind,
|
|
183
|
+
Layout: createSingleViewPageHostLayout(viewId),
|
|
184
|
+
Regions: [
|
|
185
|
+
{
|
|
186
|
+
Annotations: [],
|
|
187
|
+
Id: 'content',
|
|
188
|
+
Kind: pageRegionKinds.content,
|
|
189
|
+
Name: 'Content',
|
|
190
|
+
PageHostIds: [],
|
|
191
|
+
Placement: 'main',
|
|
192
|
+
ProjectionIds: [],
|
|
193
|
+
ViewIds: [viewId],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
State: null,
|
|
197
|
+
View: { Annotations: [], ViewId: viewId },
|
|
198
|
+
Workspace: null,
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function createWorkspacePageHost({
|
|
203
|
+
documentProfileId,
|
|
204
|
+
id,
|
|
205
|
+
viewId,
|
|
206
|
+
workspaceId,
|
|
207
|
+
}: {
|
|
208
|
+
readonly documentProfileId: string
|
|
209
|
+
readonly id: string
|
|
210
|
+
readonly viewId: string
|
|
211
|
+
readonly workspaceId: string
|
|
212
|
+
}): PageHostDefinition {
|
|
213
|
+
return {
|
|
214
|
+
...createPageHost({ id, kind: pageHostKinds.workspace, viewId }),
|
|
215
|
+
Workspace: {
|
|
216
|
+
DocumentProfileId: documentProfileId,
|
|
217
|
+
DocumentBinding: null,
|
|
218
|
+
InitialProjectionIds: [],
|
|
219
|
+
Instantiation: workspaceInstantiationModes.shared,
|
|
220
|
+
LayoutProfileId: null,
|
|
221
|
+
WorkspaceId: workspaceId,
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function hasNavigationShellRegion(
|
|
227
|
+
navigation: Pick<NavigationDefinition, 'Shell'> | null,
|
|
228
|
+
regionId: string,
|
|
229
|
+
) {
|
|
230
|
+
return navigation?.Shell.Regions.some((region) => region.Id === regionId) ?? false
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function getNavigationShellRegions(
|
|
234
|
+
navigation: Pick<NavigationDefinition, 'Shell'> | null,
|
|
235
|
+
options: {
|
|
236
|
+
readonly placement?: string
|
|
237
|
+
readonly regionIds?: readonly string[]
|
|
238
|
+
} = {},
|
|
239
|
+
): readonly NavigationShellRegionDefinition[] {
|
|
240
|
+
const regionIds = options.regionIds ? new Set(options.regionIds) : null
|
|
241
|
+
return navigation?.Shell.Regions.filter((region) =>
|
|
242
|
+
(!options.placement || region.Placement === options.placement) &&
|
|
243
|
+
(!regionIds || regionIds.has(region.Id)),
|
|
244
|
+
) ?? []
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function resolveNavigationRouteId(
|
|
248
|
+
navigation: Pick<NavigationDefinitionProjection, 'Routes'> | null,
|
|
249
|
+
pathname: string,
|
|
250
|
+
) {
|
|
251
|
+
if (!navigation) {
|
|
252
|
+
return null
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return (
|
|
256
|
+
navigation.Routes.find((route) =>
|
|
257
|
+
doesRouteTemplateMatch(pathname, route.PathTemplate),
|
|
258
|
+
)?.Id ?? null
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function shouldUseNavigationRouteTransitions(
|
|
263
|
+
navigation: Pick<NavigationDefinition, 'Contexts'> | null,
|
|
264
|
+
) {
|
|
265
|
+
return (
|
|
266
|
+
resolveNavigationHistory(navigation)?.RouteUpdateMode ??
|
|
267
|
+
navigationRouteUpdateModes.transition
|
|
268
|
+
) !== navigationRouteUpdateModes.synchronous
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function createNavigationRouteInstanceKey(
|
|
272
|
+
navigation: Pick<NavigationDefinitionProjection, 'Contexts' | 'Routes'> | null,
|
|
273
|
+
location: {
|
|
274
|
+
readonly hash?: string
|
|
275
|
+
readonly pathname: string
|
|
276
|
+
readonly search?: string
|
|
277
|
+
},
|
|
278
|
+
) {
|
|
279
|
+
const identity =
|
|
280
|
+
resolveNavigationHistory(navigation)?.RouteInstanceIdentity ??
|
|
281
|
+
navigationRouteInstanceIdentityKinds.matchedRoute
|
|
282
|
+
|
|
283
|
+
switch (identity) {
|
|
284
|
+
case navigationRouteInstanceIdentityKinds.fullLocation:
|
|
285
|
+
return `${location.pathname}${location.search ?? ''}${location.hash ?? ''}`
|
|
286
|
+
case navigationRouteInstanceIdentityKinds.pathAndSearch:
|
|
287
|
+
return `${location.pathname}${location.search ?? ''}`
|
|
288
|
+
case navigationRouteInstanceIdentityKinds.path:
|
|
289
|
+
return location.pathname
|
|
290
|
+
case navigationRouteInstanceIdentityKinds.matchedRoute:
|
|
291
|
+
default:
|
|
292
|
+
return resolveNavigationRouteId(navigation, location.pathname) ?? location.pathname
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function resolveNavigationHistory(
|
|
297
|
+
navigation: Pick<NavigationDefinition, 'Contexts'> | null,
|
|
298
|
+
): NavigationHistoryDefinition | null {
|
|
299
|
+
return (
|
|
300
|
+
navigation?.Contexts.find(
|
|
301
|
+
(context) =>
|
|
302
|
+
context.Kind === navigationContextKinds.browser &&
|
|
303
|
+
context.History.Kind === navigationHistoryKinds.browser,
|
|
304
|
+
)?.History ??
|
|
305
|
+
navigation?.Contexts.find((context) => context.Kind === navigationContextKinds.browser)
|
|
306
|
+
?.History ??
|
|
307
|
+
navigation?.Contexts[0]?.History ??
|
|
308
|
+
null
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function doesRouteTemplateMatch(pathname: string, template: string) {
|
|
313
|
+
const pathSegments = toPathSegments(pathname)
|
|
314
|
+
const templateSegments = toPathSegments(template)
|
|
315
|
+
if (pathSegments.length !== templateSegments.length) {
|
|
316
|
+
return false
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
for (let index = 0; index < templateSegments.length; index += 1) {
|
|
320
|
+
const templateSegment = templateSegments[index]
|
|
321
|
+
if (templateSegment.startsWith('{') && templateSegment.endsWith('}')) {
|
|
322
|
+
continue
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (templateSegment !== pathSegments[index]) {
|
|
326
|
+
return false
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return true
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function toPathSegments(path: string) {
|
|
334
|
+
const pathname = path.split(/[?#]/)[0] ?? '/'
|
|
335
|
+
if (pathname === '/') {
|
|
336
|
+
return []
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return pathname.replace(/^\/+|\/+$/g, '').split('/').filter(Boolean)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function createSingleViewPageHostLayout(viewId: string) {
|
|
343
|
+
return {
|
|
344
|
+
DefaultRegionId: 'content',
|
|
345
|
+
Root: {
|
|
346
|
+
Children: [],
|
|
347
|
+
Id: 'content',
|
|
348
|
+
Kind: layoutNodeKinds.view,
|
|
349
|
+
Orientation: layoutOrientations.none,
|
|
350
|
+
Placement: 'main',
|
|
351
|
+
ProjectionIds: [],
|
|
352
|
+
Size: null,
|
|
353
|
+
ViewIds: [viewId],
|
|
354
|
+
},
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function createNavigationLabel(id: string) {
|
|
359
|
+
return id
|
|
360
|
+
.split(/[-_.\s]+/)
|
|
361
|
+
.filter(Boolean)
|
|
362
|
+
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
363
|
+
.join(' ')
|
|
364
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export type ObjectPath = string
|
|
2
|
+
|
|
3
|
+
export interface ObjectPathOptions {
|
|
4
|
+
readonly caseInsensitive?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parses a dot-separated object path into normalized path segments.
|
|
9
|
+
*/
|
|
10
|
+
export function parseObjectPath(path: ObjectPath | null | undefined) {
|
|
11
|
+
return (path ?? '').split('.').map((segment) => segment.trim()).filter(Boolean)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Reads a dot-separated object path.
|
|
16
|
+
*
|
|
17
|
+
* Case-insensitive segment fallback is enabled by default because generated API
|
|
18
|
+
* payload casing can differ from semantic field metadata.
|
|
19
|
+
*/
|
|
20
|
+
export function readObjectPath(
|
|
21
|
+
value: unknown,
|
|
22
|
+
path: ObjectPath | null | undefined,
|
|
23
|
+
options: ObjectPathOptions = {},
|
|
24
|
+
) {
|
|
25
|
+
if (path === null || path === undefined) {
|
|
26
|
+
return undefined
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (path === '') {
|
|
30
|
+
return value
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return parseObjectPath(path).reduce<unknown>((current, segment) => {
|
|
34
|
+
return readObjectProperty(current, segment, options)
|
|
35
|
+
}, value)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function readObjectProperty(
|
|
39
|
+
value: unknown,
|
|
40
|
+
propertyName: string,
|
|
41
|
+
options: ObjectPathOptions = {},
|
|
42
|
+
) {
|
|
43
|
+
if (value === null || value === undefined || typeof value !== 'object') {
|
|
44
|
+
return undefined
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const record = value as Record<string, unknown>
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(record, propertyName)) {
|
|
49
|
+
return record[propertyName]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (options.caseInsensitive === false) {
|
|
53
|
+
return undefined
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const match = Object.keys(record).find(
|
|
57
|
+
(candidate) => candidate.toLocaleLowerCase() === propertyName.toLocaleLowerCase(),
|
|
58
|
+
)
|
|
59
|
+
return match ? record[match] : undefined
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Writes a value to a dot-separated object path, creating object parents as
|
|
64
|
+
* needed. Empty paths are ignored.
|
|
65
|
+
*/
|
|
66
|
+
export function writeObjectPath(
|
|
67
|
+
target: Record<string, unknown>,
|
|
68
|
+
path: ObjectPath | null | undefined,
|
|
69
|
+
value: unknown,
|
|
70
|
+
) {
|
|
71
|
+
const segments = parseObjectPath(path)
|
|
72
|
+
if (segments.length === 0) {
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let current = target
|
|
77
|
+
for (const segment of segments.slice(0, -1)) {
|
|
78
|
+
const next = current[segment]
|
|
79
|
+
if (!next || typeof next !== 'object' || Array.isArray(next)) {
|
|
80
|
+
current[segment] = {}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
current = current[segment] as Record<string, unknown>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
current[segments[segments.length - 1]] = value
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function writeObjectPathIfDefined(
|
|
90
|
+
target: Record<string, unknown>,
|
|
91
|
+
path: ObjectPath | null | undefined,
|
|
92
|
+
value: unknown,
|
|
93
|
+
) {
|
|
94
|
+
if (value === undefined || !path) {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
writeObjectPath(target, path, value)
|
|
99
|
+
}
|