@wildo-ai/saas-frontend-lib 1.1.5 → 1.1.6
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/dist/esm/components/actions/action-bar.d.ts +15 -0
- package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
- package/dist/esm/components/actions/action-bar.js +15 -0
- package/dist/esm/components/actions/action-bar.js.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.d.ts +97 -7
- package/dist/esm/components/ai-elements/decision/approval.d.ts.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.js.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +8 -3
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.js +5 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.js.map +1 -1
- package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_Main.js +1 -4
- package/dist/esm/components/auth/Auth_Main.js.map +1 -1
- package/dist/esm/components/auth/Auth_Register.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_Register.js +1 -3
- package/dist/esm/components/auth/Auth_Register.js.map +1 -1
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts +7 -0
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
- package/dist/esm/components/auth/StepUpAuthDialog.js +13 -7
- package/dist/esm/components/auth/StepUpAuthDialog.js.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.d.ts.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js +32 -33
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.d.ts.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js +18 -20
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.d.ts.map +1 -1
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js +2 -3
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js.map +1 -1
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts +13 -16
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts.map +1 -1
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js +18 -15
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js.map +1 -1
- package/dist/esm/components/billing/billing-invoice-history.js +2 -2
- package/dist/esm/components/billing/billing-invoice-history.js.map +1 -1
- package/dist/esm/components/billing/billing-portal-link.js +2 -2
- package/dist/esm/components/billing/billing-portal-link.js.map +1 -1
- package/dist/esm/components/billing/billing-pricing-table.d.ts +33 -1
- package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-pricing-table.js +34 -5
- package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
- package/dist/esm/components/billing/billing-subscription-status.js +2 -2
- package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.d.ts +2 -0
- package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.js +1 -0
- package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
- package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayField.js +15 -1
- package/dist/esm/components/data-display/DisplayField.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldArray.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldArray.js +11 -0
- package/dist/esm/components/data-display/DisplayFieldArray.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.js +2 -2
- package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts +12 -2
- package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditableArray.js +3 -2
- package/dist/esm/components/data-display/DisplayFieldEditableArray.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnly.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnly.js +2 -2
- package/dist/esm/components/data-display/DisplayFieldReadOnly.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js +8 -2
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +18 -4
- package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +61 -3
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts +7 -5
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts +11 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts.map +1 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js +36 -11
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js.map +1 -1
- package/dist/esm/components/data-display/display-field-resolved-props.d.ts +6 -0
- package/dist/esm/components/data-display/display-field-resolved-props.d.ts.map +1 -1
- package/dist/esm/components/data-display/display-field-resolved-props.js.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts +23 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js +35 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts +47 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +124 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts +8 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js +46 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js.map +1 -0
- package/dist/esm/components/feedback/resource-empty-state.d.ts +21 -8
- package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
- package/dist/esm/components/feedback/resource-empty-state.js +56 -26
- package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts +29 -7
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +231 -101
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.js +57 -0
- package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.js +4 -4
- package/dist/esm/components/flows-actors/system-catalog.js.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.labels.js +0 -5
- package/dist/esm/components/flows-actors/system-catalog.labels.js.map +1 -1
- package/dist/esm/components/form/Form.d.ts +2 -2
- package/dist/esm/components/form/Form.js +2 -2
- package/dist/esm/components/form/Form.js.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.d.ts +28 -3
- package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.js +43 -14
- package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
- package/dist/esm/components/form/automated/FormField.d.ts +3 -0
- package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/FormField.js +60 -21
- package/dist/esm/components/form/automated/FormField.js.map +1 -1
- package/dist/esm/components/form/automated/FormFieldArray.d.ts +6 -3
- package/dist/esm/components/form/automated/FormFieldArray.d.ts.map +1 -1
- package/dist/esm/components/form/automated/FormFieldArray.js +3 -2
- package/dist/esm/components/form/automated/FormFieldArray.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +5 -4
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +148 -55
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts +30 -0
- package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.js +30 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.js.map +1 -1
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts +79 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts.map +1 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js +203 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js.map +1 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts +12 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts.map +1 -1
- package/dist/esm/components/form/automated/automated-form-submit.utils.js +11 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.js.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.d.ts.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js +2 -2
- package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
- package/dist/esm/components/form/combobox.d.ts +7 -0
- package/dist/esm/components/form/combobox.d.ts.map +1 -1
- package/dist/esm/components/form/combobox.js.map +1 -1
- package/dist/esm/components/form/controls/form-field-checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/form/controls/form-field-checkbox-group.js +13 -0
- package/dist/esm/components/form/controls/form-field-checkbox-group.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.d.ts +58 -0
- package/dist/esm/components/form/fields/form-field-address.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.js +34 -6
- package/dist/esm/components/form/fields/form-field-address.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.labels.js +60 -1
- package/dist/esm/components/form/fields/form-field-address.labels.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.d.ts +0 -12
- package/dist/esm/components/form/fields/form-field-file.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.js +34 -13
- package/dist/esm/components/form/fields/form-field-file.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.labels.js +46 -0
- package/dist/esm/components/form/fields/form-field-file.labels.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts +73 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts.map +1 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.js +64 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.js.map +1 -0
- package/dist/esm/components/form/fields/form-field-string.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.js +8 -1
- package/dist/esm/components/form/fields/form-field-string.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.labels.js +4 -0
- package/dist/esm/components/form/fields/form-field-string.labels.js.map +1 -1
- package/dist/esm/components/form/validation-errors/FormErrorSummary.js +1 -1
- package/dist/esm/components/form/validation-errors/FormErrorSummary.js.map +1 -1
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts +31 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts.map +1 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.js +81 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.js.map +1 -0
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +14 -1
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js +14 -0
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts +22 -0
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.js +1 -22
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.js.map +1 -1
- package/dist/esm/components/layout/resizable.d.ts +11 -0
- package/dist/esm/components/layout/resizable.d.ts.map +1 -1
- package/dist/esm/components/layout/resizable.js.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +11 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +15 -3
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.js.map +1 -1
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js +2 -2
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js.map +1 -1
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +18 -20
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +7 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +4 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +18 -2
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.js +82 -10
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js +8 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts +8 -2
- package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionToolbar.js +6 -2
- package/dist/esm/components/resources/ResourceCollectionToolbar.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js +31 -16
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js +23 -8
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerNested.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_ContainerNested.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Header.d.ts +13 -0
- package/dist/esm/components/resources/ResourceLayout_Header.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Header.js +55 -28
- package/dist/esm/components/resources/ResourceLayout_Header.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.js +41 -20
- package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.labels.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.labels.js +1 -2
- package/dist/esm/components/resources/ResourceLayout_List.labels.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Read.d.ts +9 -4
- package/dist/esm/components/resources/ResourceLayout_Read.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Read.js +30 -11
- package/dist/esm/components/resources/ResourceLayout_Read.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.js +4 -2
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js +6 -2
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.js +30 -14
- package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js +14 -198
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Update.d.ts +2 -2
- package/dist/esm/components/resources/ResourceLayout_Update.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_Update.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +69 -39
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts +32 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts.map +1 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.js +130 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.js.map +1 -0
- package/dist/esm/components/resources/collection-create-placement.utils.d.ts +32 -0
- package/dist/esm/components/resources/collection-create-placement.utils.d.ts.map +1 -0
- package/dist/esm/components/resources/collection-create-placement.utils.js +37 -0
- package/dist/esm/components/resources/collection-create-placement.utils.js.map +1 -0
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.js +5 -1
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.js.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +8 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.js +49 -2
- package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +22 -0
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js +85 -2
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
- package/dist/esm/components/resources/resourceLayout.utils.d.ts +14 -0
- package/dist/esm/components/resources/resourceLayout.utils.d.ts.map +1 -1
- package/dist/esm/components/resources/resourceLayout.utils.js +22 -0
- package/dist/esm/components/resources/resourceLayout.utils.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ArrayField.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/ArrayField.js +3 -0
- package/dist/esm/components/resources/skeleton/ArrayField.js.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.js +33 -1
- package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ObjectScope.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/ObjectScope.js +3 -0
- package/dist/esm/components/resources/skeleton/ObjectScope.js.map +1 -1
- package/dist/esm/components/resources/skeleton/Section.d.ts +12 -0
- package/dist/esm/components/resources/skeleton/Section.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/Section.js +28 -2
- package/dist/esm/components/resources/skeleton/Section.js.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +70 -0
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +157 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardLayout.d.ts +6 -0
- package/dist/esm/components/resources/skeleton/WizardLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardLayout.js +13 -2
- package/dist/esm/components/resources/skeleton/WizardLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardStep.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardStep.js +2 -1
- package/dist/esm/components/resources/skeleton/WizardStep.js.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +61 -15
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts +24 -2
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js +69 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js +18 -19
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.js +5 -4
- package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
- package/dist/esm/components/sections/stepper.d.ts +5 -0
- package/dist/esm/components/sections/stepper.d.ts.map +1 -1
- package/dist/esm/components/sections/stepper.js.map +1 -1
- package/dist/esm/components/sections/surface.d.ts.map +1 -1
- package/dist/esm/components/sections/surface.js +12 -3
- package/dist/esm/components/sections/surface.js.map +1 -1
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts +43 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js +129 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts +3 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js +34 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js.map +1 -0
- package/dist/esm/components/settings/AppPage_AppearanceSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.js +9 -11
- package/dist/esm/components/settings/AppPage_AppearanceSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js +3 -2
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.d.ts +4 -2
- package/dist/esm/components/settings/AppPage_BillingSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.js +21 -3
- package/dist/esm/components/settings/AppPage_BillingSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.js +5 -10
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +58 -0
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +243 -40
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js +67 -6
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.js +19 -11
- package/dist/esm/components/settings/AppPage_InvitationsSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js +4 -2
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsHub.js +3 -0
- package/dist/esm/components/settings/SettingsHub.js.map +1 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.js +16 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.js.map +1 -1
- package/dist/esm/components/settings/useOwnerProviderConnections.d.ts +59 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.d.ts.map +1 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.js +136 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.js.map +1 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.d.ts +5 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/chart-view.utils.js +5 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.js.map +1 -1
- package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +50 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.d.ts.map +1 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.js +72 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -0
- package/dist/esm/components/views/composite-view/CompositeLayout.d.ts.map +1 -1
- package/dist/esm/components/views/composite-view/CompositeLayout.js +2 -1
- package/dist/esm/components/views/composite-view/CompositeLayout.js.map +1 -1
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +86 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts.map +1 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +187 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -0
- package/dist/esm/core/app-shell/PortalContainerContext.d.ts +5 -2
- package/dist/esm/core/app-shell/PortalContainerContext.d.ts.map +1 -1
- package/dist/esm/core/app-shell/PortalContainerContext.js +5 -2
- package/dist/esm/core/app-shell/PortalContainerContext.js.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts +18 -9
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.js +1 -0
- package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
- package/dist/esm/core/app-shell/useAppShellLayout.d.ts +10 -0
- package/dist/esm/core/app-shell/useAppShellLayout.d.ts.map +1 -1
- package/dist/esm/core/app-shell/useAppShellLayout.js +28 -5
- package/dist/esm/core/app-shell/useAppShellLayout.js.map +1 -1
- package/dist/esm/core/app-shell/usePublicShellLayout.d.ts.map +1 -1
- package/dist/esm/core/app-shell/usePublicShellLayout.js +38 -0
- package/dist/esm/core/app-shell/usePublicShellLayout.js.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js +47 -13
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/BillingContext.d.ts +25 -2
- package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
- package/dist/esm/core/billing/BillingContext.js +16 -25
- package/dist/esm/core/billing/BillingContext.js.map +1 -1
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts +11 -3
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.js +14 -8
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/useBillingPlanChange.d.ts.map +1 -1
- package/dist/esm/core/billing/useBillingPlanChange.js +2 -0
- package/dist/esm/core/billing/useBillingPlanChange.js.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +1 -0
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts +29 -229
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js +29 -327
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts +17 -27
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js +28 -48
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +21 -11
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.js +4 -4
- package/dist/esm/core/config/app-configuration-frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts +17 -0
- package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/app-level-components.frontend.schemas.js +17 -0
- package/dist/esm/core/config/app-level-components.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +10 -10
- package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
- package/dist/esm/core/config/engine-settings-destinations.js +221 -6
- package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -0
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/launcher-items.frontend.schemas.js +1 -0
- package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +10 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.js +9 -0
- package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.js +30 -19
- package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
- package/dist/esm/core/errors/ErrorContext.d.ts.map +1 -1
- package/dist/esm/core/errors/ErrorContext.js +9 -1
- package/dist/esm/core/errors/ErrorContext.js.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.js +5 -4
- package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
- package/dist/esm/core/errors/RouterErrorBoundary.js +1 -1
- package/dist/esm/core/errors/RouterErrorBoundary.js.map +1 -1
- package/dist/esm/core/errors/errors-builder.frontend.services.d.ts +2 -2
- package/dist/esm/core/errors/errors-builder.frontend.services.d.ts.map +1 -1
- package/dist/esm/core/errors/errors-builder.frontend.services.js +4 -4
- package/dist/esm/core/errors/errors-builder.frontend.services.js.map +1 -1
- package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js +1 -1
- package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js.map +1 -1
- package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
- package/dist/esm/core/events/NotificationContext.js +23 -5
- package/dist/esm/core/events/NotificationContext.js.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.d.ts +110 -43
- package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.js +89 -15
- package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts +2 -0
- package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.js +2 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.js.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.js +5 -2
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.js.map +1 -1
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +63 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +131 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts +61 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js +178 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts +52 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.js +144 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts +22 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts.map +1 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js +23 -3
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js.map +1 -1
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts +55 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts.map +1 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js +65 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js.map +1 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts +63 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts.map +1 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js +100 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js.map +1 -0
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +45 -7
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.js +112 -28
- package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
- package/dist/esm/core/flows-actors/usePendingDecisions.d.ts +32 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.d.ts.map +1 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.js +91 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.js.map +1 -0
- package/dist/esm/core/guidance/GuidanceRenderer.d.ts.map +1 -1
- package/dist/esm/core/guidance/GuidanceRenderer.js +3 -2
- package/dist/esm/core/guidance/GuidanceRenderer.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts +22 -8
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +21 -9
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts +5 -3
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js +5 -3
- package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
- package/dist/esm/core/i18n/useI18n.d.ts +2 -1
- package/dist/esm/core/i18n/useI18n.d.ts.map +1 -1
- package/dist/esm/core/i18n/useI18n.js +2 -1
- package/dist/esm/core/i18n/useI18n.js.map +1 -1
- package/dist/esm/core/loading/LoadingContext.d.ts.map +1 -1
- package/dist/esm/core/loading/LoadingContext.js +7 -1
- package/dist/esm/core/loading/LoadingContext.js.map +1 -1
- package/dist/esm/core/loading/LoadingGate.d.ts.map +1 -1
- package/dist/esm/core/loading/LoadingGate.js +19 -1
- package/dist/esm/core/loading/LoadingGate.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +15 -2
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +183 -20
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +2 -2
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts +7 -15
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js +8 -26
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts +12 -3
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js +3 -2
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts +42 -0
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js +89 -5
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts +2 -0
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js +2 -0
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.d.ts +78 -0
- package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.js +264 -16
- package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.d.ts +8 -0
- package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.js +137 -30
- package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +1 -0
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/navigation-cascade.d.ts +46 -0
- package/dist/esm/core/navigation/navigation-cascade.d.ts.map +1 -0
- package/dist/esm/core/navigation/navigation-cascade.js +222 -0
- package/dist/esm/core/navigation/navigation-cascade.js.map +1 -0
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js +21 -2
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts +71 -0
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -0
- package/dist/esm/core/navigation/navigation-controller-internals.js +84 -0
- package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -0
- package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts +86 -2
- package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-policy-resolver.service.js +242 -124
- package/dist/esm/core/navigation/navigation-policy-resolver.service.js.map +1 -1
- package/dist/esm/core/navigation/navigation.schemas.d.ts +170 -8
- package/dist/esm/core/navigation/navigation.schemas.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation.schemas.js +121 -2
- package/dist/esm/core/navigation/navigation.schemas.js.map +1 -1
- package/dist/esm/core/navigation/navigation.utils.d.ts +102 -6
- package/dist/esm/core/navigation/navigation.utils.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation.utils.js +283 -34
- package/dist/esm/core/navigation/navigation.utils.js.map +1 -1
- package/dist/esm/core/navigation/useIsStackEntryActive.d.ts +0 -10
- package/dist/esm/core/navigation/useIsStackEntryActive.d.ts.map +0 -1
- package/dist/esm/core/navigation/useIsStackEntryActive.js.map +0 -1
- package/dist/esm/core/navigation/useNavigationController.d.ts +28 -157
- package/dist/esm/core/navigation/useNavigationController.d.ts.map +1 -1
- package/dist/esm/core/navigation/useNavigationController.js +211 -1189
- package/dist/esm/core/navigation/useNavigationController.js.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts +174 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.js +977 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -0
- package/dist/esm/core/navigation/useOverlayTitle.d.ts +13 -1
- package/dist/esm/core/navigation/useOverlayTitle.d.ts.map +1 -1
- package/dist/esm/core/navigation/useOverlayTitle.js +15 -10
- package/dist/esm/core/navigation/useOverlayTitle.js.map +1 -1
- package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts +43 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts.map +1 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.js +44 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.js.map +1 -0
- package/dist/esm/core/navigation/zone-collapse-migration.d.ts +83 -0
- package/dist/esm/core/navigation/zone-collapse-migration.d.ts.map +1 -0
- package/dist/esm/core/navigation/zone-collapse-migration.js +116 -0
- package/dist/esm/core/navigation/zone-collapse-migration.js.map +1 -0
- package/dist/esm/core/navigation/zone-collapse.d.ts +51 -0
- package/dist/esm/core/navigation/zone-collapse.d.ts.map +1 -0
- package/dist/esm/core/navigation/zone-collapse.js +59 -0
- package/dist/esm/core/navigation/zone-collapse.js.map +1 -0
- package/dist/esm/core/navigation/zone-emphasis.d.ts +3 -0
- package/dist/esm/core/navigation/zone-emphasis.d.ts.map +1 -1
- package/dist/esm/core/navigation/zone-emphasis.js +26 -4
- package/dist/esm/core/navigation/zone-emphasis.js.map +1 -1
- package/dist/esm/core/navigation/zone-visible-entry.d.ts +22 -0
- package/dist/esm/core/navigation/zone-visible-entry.d.ts.map +1 -1
- package/dist/esm/core/navigation/zone-visible-entry.js +25 -0
- package/dist/esm/core/navigation/zone-visible-entry.js.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketContext.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketContext.js +53 -18
- package/dist/esm/core/requests/websockets/WebSocketContext.js.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +3 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
- package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts +22 -0
- package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/useNotificationBadges.js +72 -3
- package/dist/esm/core/requests/websockets/useNotificationBadges.js.map +1 -1
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts +28 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts.map +1 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js +86 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js.map +1 -0
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +38 -3
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +57 -2
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js +4 -2
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts +30 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.js +47 -4
- package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/ResourceRegistryContext.d.ts.map +1 -1
- package/dist/esm/core/resources/ResourceRegistryContext.js +22 -1
- package/dist/esm/core/resources/ResourceRegistryContext.js.map +1 -1
- package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js +1 -1
- package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/frontend-resource.utils.d.ts +22 -1
- package/dist/esm/core/resources/frontend-resource.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/frontend-resource.utils.js +25 -2
- package/dist/esm/core/resources/frontend-resource.utils.js.map +1 -1
- package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts +113 -13
- package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/operation-semantics.frontend.utils.js +173 -20
- package/dist/esm/core/resources/operation-semantics.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts +11 -0
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js +7 -0
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts +3 -2
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js +13 -5
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.d.ts +6 -0
- package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.js +90 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts +139 -16
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.js +110 -11
- package/dist/esm/core/resources/resources.frontend.schemas.js.map +1 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.js +3 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts +10 -0
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js +8 -0
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js.map +1 -1
- package/dist/esm/core/resources/rmm/useResourceRMM.d.ts +7 -0
- package/dist/esm/core/resources/rmm/useResourceRMM.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/useResourceRMM.js +9 -2
- package/dist/esm/core/resources/rmm/useResourceRMM.js.map +1 -1
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts +59 -0
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -0
- package/dist/esm/core/resources/useOperationDirectExecution.js +278 -0
- package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -0
- package/dist/esm/core/resources/useResourceOperationActions.d.ts +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.js +69 -22
- package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
- package/dist/esm/core/resources/useResourceOperationSurface.d.ts +8 -6
- package/dist/esm/core/resources/useResourceOperationSurface.d.ts.map +1 -1
- package/dist/esm/core/resources/useResourceOperationSurface.js +3 -2
- package/dist/esm/core/resources/useResourceOperationSurface.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +23 -2
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationContext.shared.d.ts +4 -2
- package/dist/esm/core/runtime/ApplicationContext.shared.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationContext.shared.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts +12 -2
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.js +5 -2
- package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +25 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js +37 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts +21 -2
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.js +51 -4
- package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.d.ts +11 -0
- package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.js +70 -22
- package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.js +10 -2
- package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +72 -8
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts +7 -0
- package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/security/route-organization-access.frontend.utils.js +8 -2
- package/dist/esm/core/security/route-organization-access.frontend.utils.js.map +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.d.ts +30 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.d.ts.map +1 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.js +38 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -0
- package/dist/esm/core/ui/UIContext.d.ts.map +1 -1
- package/dist/esm/core/ui/UIContext.js +10 -6
- package/dist/esm/core/ui/UIContext.js.map +1 -1
- package/dist/esm/core/ui/color-conversion.utils.d.ts +20 -0
- package/dist/esm/core/ui/color-conversion.utils.d.ts.map +1 -1
- package/dist/esm/core/ui/color-conversion.utils.js +39 -5
- package/dist/esm/core/ui/color-conversion.utils.js.map +1 -1
- package/dist/esm/core/ui/themes/default.theme.d.ts.map +1 -1
- package/dist/esm/core/ui/themes/default.theme.js +22 -2
- package/dist/esm/core/ui/themes/default.theme.js.map +1 -1
- package/dist/esm/core/ui/ui.frontend.schemas.d.ts +6 -6
- package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/ui/ui.frontend.schemas.js +3 -3
- package/dist/esm/core/ui/ui.frontend.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +19 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/testing/app-shell-placement-coverage.d.ts +43 -0
- package/dist/esm/testing/app-shell-placement-coverage.d.ts.map +1 -0
- package/dist/esm/testing/app-shell-placement-coverage.js +114 -0
- package/dist/esm/testing/app-shell-placement-coverage.js.map +1 -0
- package/dist/esm/testing/mock-builders.d.ts.map +1 -1
- package/dist/esm/testing/mock-builders.js +5 -0
- package/dist/esm/testing/mock-builders.js.map +1 -1
- package/dist/esm/testing.d.ts +1 -0
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/testing.js +1 -0
- package/dist/esm/testing.js.map +1 -1
- package/package.json +9 -7
- package/dist/esm/core/navigation/useIsStackEntryActive.js +0 -15
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a collection offers "create" — the toolbar, or the empty state — decided in ONE place.
|
|
3
|
+
*
|
|
4
|
+
* One create, one place. While the collection is genuinely EMPTY and its empty state offers the
|
|
5
|
+
* first-item action, that call to action IS the create affordance: a toolbar button beside it was the
|
|
6
|
+
* same verb twice, often under two labels ("Add draft" above, "Add note" below — measured on Wonder
|
|
7
|
+
* Todos). A NARROWED listing — an inline search, or any active filter such as a status tab or a preset
|
|
8
|
+
* pill — is not empty: it matched nothing. It shows the "no matching items" message rather than the
|
|
9
|
+
* empty state (whose "none yet" would be false), and the toolbar keeps its button.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Whether one filter value narrows the listing. Unset shapes — `undefined`, `null`, `''`, an empty array,
|
|
13
|
+
* an empty object — narrow nothing; anything else (a scalar, a picked set, a preset's relative range)
|
|
14
|
+
* does.
|
|
15
|
+
*/
|
|
16
|
+
export function isActiveFilterValue(value) {
|
|
17
|
+
if (value === undefined || value === null || value === '')
|
|
18
|
+
return false;
|
|
19
|
+
if (Array.isArray(value))
|
|
20
|
+
return value.length > 0;
|
|
21
|
+
if (typeof value === 'object')
|
|
22
|
+
return Object.keys(value).length > 0;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
/** Whether the listing is narrowed by a search or by any active filter. */
|
|
26
|
+
export function isCollectionNarrowed(args) {
|
|
27
|
+
return args.isSearchActive || Object.values(args.filterValues).some(isActiveFilterValue);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Whether the TOOLBAR shows the create action. `false` exactly when the empty state renders and visibly
|
|
31
|
+
* offers it; `hasLoadedOnce` keeps the button from blinking out during the initial fetch.
|
|
32
|
+
*/
|
|
33
|
+
export function toolbarOffersCreate(args) {
|
|
34
|
+
const emptyStateOwnsCreate = args.hasLoadedOnce && args.itemCount === 0 && !args.isNarrowed && args.emptyStateOffersCreate;
|
|
35
|
+
return !emptyStateOwnsCreate;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=collection-create-placement.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-create-placement.utils.js","sourceRoot":"","sources":["../../../../../src/components/resources/collection-create-placement.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACxE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/F,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,oBAAoB,CAAC,IAAwE;IAC3G,OAAO,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC3F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAKnC;IACC,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,sBAAsB,CAAC;IAC3H,OAAO,CAAC,oBAAoB,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * Where a collection offers \"create\" — the toolbar, or the empty state — decided in ONE place.\n *\n * One create, one place. While the collection is genuinely EMPTY and its empty state offers the\n * first-item action, that call to action IS the create affordance: a toolbar button beside it was the\n * same verb twice, often under two labels (\"Add draft\" above, \"Add note\" below — measured on Wonder\n * Todos). A NARROWED listing — an inline search, or any active filter such as a status tab or a preset\n * pill — is not empty: it matched nothing. It shows the \"no matching items\" message rather than the\n * empty state (whose \"none yet\" would be false), and the toolbar keeps its button.\n */\n\n/**\n * Whether one filter value narrows the listing. Unset shapes — `undefined`, `null`, `''`, an empty array,\n * an empty object — narrow nothing; anything else (a scalar, a picked set, a preset's relative range)\n * does.\n */\nexport function isActiveFilterValue(value: unknown): boolean {\n if (value === undefined || value === null || value === '') return false;\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') return Object.keys(value as Record<string, unknown>).length > 0;\n return true;\n}\n\n/** Whether the listing is narrowed by a search or by any active filter. */\nexport function isCollectionNarrowed(args: { isSearchActive: boolean; filterValues: Record<string, unknown> }): boolean {\n return args.isSearchActive || Object.values(args.filterValues).some(isActiveFilterValue);\n}\n\n/**\n * Whether the TOOLBAR shows the create action. `false` exactly when the empty state renders and visibly\n * offers it; `hasLoadedOnce` keeps the button from blinking out during the initial fetch.\n */\nexport function toolbarOffersCreate(args: {\n hasLoadedOnce: boolean;\n itemCount: number;\n isNarrowed: boolean;\n emptyStateOffersCreate: boolean;\n}): boolean {\n const emptyStateOwnsCreate = args.hasLoadedOnce && args.itemCount === 0 && !args.isNarrowed && args.emptyStateOffersCreate;\n return !emptyStateOwnsCreate;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedResourcePreview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourcePreview.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,EAAE,qBAAqB,EAAyB,MAAM,4DAA4D,CAAC;AAa1H,OAAO,EAAE,KAAK,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,kCAAkC;IACjD,4EAA4E;IAC5E,YAAY,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,0BAA0B,CAAC,CAAC;IAClF,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,eAAe,EAAE,OAAO,CAAC;IACzB,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,YAAY,EACZ,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,SAAS,GACV,EAAE,kCAAkC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"RelatedResourcePreview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourcePreview.tsx"],"names":[],"mappings":"AA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
50
50
|
*/
|
|
51
51
|
export function RelatedResourcePreviewSurface({ childContext, inlineLimit, showViewAllLink, childResourceType, onViewAll, }) {
|
|
52
52
|
const { registry, doOperation } = useResourceRegistry();
|
|
53
|
-
const { tComponent, isReady } = useI18n({
|
|
53
|
+
const { t: tChildLabel, formatDate, formatDateTime, tComponent, isReady } = useI18n({
|
|
54
54
|
component: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,
|
|
55
55
|
resource: childContext.resourceType,
|
|
56
56
|
});
|
|
@@ -159,10 +159,14 @@ export function RelatedResourcePreviewSurface({ childContext, inlineLimit, showV
|
|
|
159
159
|
});
|
|
160
160
|
return (_jsxs("div", { className: "space-y-xs", children: [_jsx("ul", { className: "space-y-xs", children: items.map((item, idx) => {
|
|
161
161
|
const id = item._id ?? item.id ?? idx;
|
|
162
|
+
/* The translator reaches the label callback, as in every other caller (see ResourceListItemRenderer). */
|
|
162
163
|
const label = FrontendResourceUtils.computeFrontendResourceLabel({
|
|
163
164
|
resourceType: childResourceType,
|
|
164
165
|
registry,
|
|
165
166
|
currentObject: item,
|
|
167
|
+
t: tChildLabel,
|
|
168
|
+
formatDate,
|
|
169
|
+
formatDateTime,
|
|
166
170
|
}) ?? String(id);
|
|
167
171
|
return (_jsx("li", { className: "text-sm px-sm py-xs rounded-radius border border-border bg-card", children: label }, id));
|
|
168
172
|
}) }), showViewAllLink && hasMore && (_jsx(Button, { variant: ButtonVariants_Variant.LINK, size: ButtonSize.SM, className: "px-0", onClick: onViewAll, children: viewAllLabel }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedResourcePreview.js","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourcePreview.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE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AACJ,CAAC;AAcD,oEAAoE;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,YAAY,EACZ,KAAK,EACL,eAAe,GAAG,IAAI,EACtB,aAAa,EACb,SAAS,GACmB;IAC5B,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,EAAE,qBAAqB,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAC/D,MAAM,EAAE,cAAc,EAAE,GAAG,8BAA8B,EAAE,CAAC;IAC5D,MAAM,EAAE,QAAQ,EAAE,GAAG,uBAAuB,EAAE,CAAC;IAE/C,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,qBAAqB,CAAC;QAC1B,YAAY;QACZ,aAAa,EAAE,MAAM,CAAC,IAAI;QAC1B,0BAA0B,EAAE,aAAa;KAC1C,CAAC;IACF,2EAA2E;IAC3E,8EAA8E;IAC9E,iCAAiC;IACjC,uDAAuD;IACvD,CAAC,qBAAqB,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC,CAC7E,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,YACvB,KAAC,6BAA6B,IAC5B,YAAY,EAAE,YAAqB,EACnC,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,YAAY;YAC/B,iEAAiE;YACjE,yEAAyE;YACzE,0EAA0E;YAC1E,kEAAkE;YAClE,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC;gBACxB,OAAO,EAAE;oBACP,WAAW,EAAE,qBAAqB,CAAC,kBAAkB;oBACrD,eAAe,EAAE,YAAY;iBAC9B;gBACD,SAAS,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE;aACjC,CAAC,GACX,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\n/**\n * A compact PREVIEW of a related collection — a few rows plus a \"view all\" link,\n * instead of the full list surface with its toolbar, filters and pagination.\n *\n * ## Why this is its own component rather than a mode on the embed\n *\n * A preview and an embedded LIST are different things: one summarises, the other\n * is the collection. Folding them into one component behind a `limit` prop is how\n * the configuration surface this migration removes got started — a single knob\n * that quietly changes what a thing IS rather than how it looks.\n *\n * ## It was unreachable before this\n *\n * The behaviour below is moved verbatim out of the automatic children container,\n * where it was selected by an `inParentView.inlineLimit` config key that NOTHING\n * in the repository authored — measured 2026-08-20, zero occurrences across the\n * engine presets and every example app, while a sibling key in the same files was\n * authored four times. So this is a second dark capability in the same component\n * as the one that motivated this workstream: real, working, and reachable by no\n * one. Exposing it as a component a template can place is what makes it usable.\n */\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CoreResourceOperation, ResourcesConfig_OperationPathUtils, type Resources_PaginatedResult } from '@wildo-ai/saas-models';\nimport { ButtonSize, FrontendComponentType } from '@wildo-ai/presets-components-models';\n\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { LoadingSpinner } from '~wildo-frontend-lib/components/feedback/loading-spinner';\nimport { resolveComponentLabel } from '~wildo-frontend-lib/core/i18n/component-label-resolution.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { frontendResourceUtils, FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport {\n pickPreferredOperationForCoreSemantic,\n resolveEffectiveCoreOperationFromOperation,\n} from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { isListOperationAddressableForChildContext } from './child-operation-addressability.utils';\nimport { CoreResourceOperation as CoreOp } from '@wildo-ai/saas-models';\nimport { useNavigationController } from '~wildo-frontend-lib/core/navigation/useNavigationController';\nimport { NavigationContentType } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { useEmbeddedResourceHostContext } from './EmbeddedResourceHostContext';\nimport { useEmbeddedResourceContext } from './useEmbeddedResourceContext';\nimport { useRegisterComposedChild } from './ComposedChildrenRegistry';\nimport { type EmbedRelatedResourceEdgeSelector } from './ResourceEmbeds';\n\nexport interface RelatedResourcePreviewSurfaceProps {\n /** Resolved child context (target resource + parent-scoped identifiers). */\n childContext: ReturnType<typeof frontendResourceUtils.deriveChildResourceContext>;\n /** Rows to show. `0` renders only the \"view all\" affordance. */\n inlineLimit: number;\n /** Whether to offer the \"view all\" link when more rows exist. */\n showViewAllLink: boolean;\n /** Child resource type, used to compute each row's display label. */\n childResourceType: string;\n /** Invoked when the reader asks for the full collection. */\n onViewAll: () => void;\n}\n\n/**\n * Lightweight inline preview for 1:N / N:N children when `inlineLimit` is set.\n *\n * Fetches `limit` items via the child's LIST operation, renders them as a\n * compact vertical list of resource display names, and optionally shows a\n * \"View all (N total)\" link that navigates to the full list.\n *\n * This avoids mounting the full `ResourceLayout_List` (with search, sort,\n * filter, pagination) when the relationship is configured for a quick preview.\n */\nexport function RelatedResourcePreviewSurface({\n childContext,\n inlineLimit,\n showViewAllLink,\n childResourceType,\n onViewAll,\n}: RelatedResourcePreviewSurfaceProps): React.JSX.Element | null {\n const { registry, doOperation } = useResourceRegistry();\n const { tComponent, isReady } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n resource: childContext.resourceType,\n });\n const [items, setItems] = useState<Record<string, unknown>[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [isLoading, setIsLoading] = useState(true);\n const [loadFailed, setLoadFailed] = useState(false);\n const doOperationRef = useRef(doOperation);\n doOperationRef.current = doOperation;\n\n const limit = inlineLimit;\n\n // Stable key for the child context — prevents re-fetches when the parent\n // re-renders and `deriveChildResourceContext` returns a new object ref\n // with identical content.\n const contextIdKey = useMemo(\n () => FrontendResourceUtils.buildContextResourceIdentifiersKey(childContext.contextResourceIdentifiers),\n [childContext.contextResourceIdentifiers],\n );\n\n useEffect(() => {\n // inlineLimit: 0 means \"show no items, just the View All link\"\n if (limit === 0) {\n setIsLoading(false);\n return;\n }\n\n let cancelled = false;\n\n const fetchPreview = async () => {\n setIsLoading(true);\n setLoadFailed(false);\n\n const childConfig = registry.resourceConfigurations[childResourceType];\n const contextualParameters = FrontendResourceUtils.buildContextualParameters(childContext.contextResourceIdentifiers, registry);\n const listOperation = childContext.operation\n && resolveEffectiveCoreOperationFromOperation(childContext.operation) === CoreResourceOperation.LIST\n ? childContext.operation\n : childConfig\n ? pickPreferredOperationForCoreSemantic(\n (childConfig.operations ?? []).filter((candidate) =>\n isListOperationAddressableForChildContext(\n candidate,\n childContext,\n contextualParameters,\n )\n ),\n CoreResourceOperation.LIST,\n )\n : undefined;\n if (!listOperation) {\n setIsLoading(false);\n return;\n }\n\n const operationPathKey = ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(listOperation);\n\n try {\n const result = await doOperationRef.current(operationPathKey, {\n contextualParameters,\n queryParameters: { page: 1, limit },\n parentResourcesRequirements: childContext.parentResourcesRequirements,\n });\n\n if (cancelled) return;\n\n if (result && typeof result === 'object' && 'data' in result && 'pagination' in result) {\n const paginated = result as Resources_PaginatedResult<Record<string, unknown>>;\n setItems(paginated.data);\n setTotalCount(paginated.pagination.total);\n } else if (Array.isArray(result)) {\n setItems(result);\n setTotalCount(result.length);\n }\n } catch {\n if (!cancelled) setLoadFailed(true);\n } finally {\n if (!cancelled) setIsLoading(false);\n }\n };\n\n fetchPreview();\n return () => { cancelled = true; };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [childResourceType, limit, registry, contextIdKey]);\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center py-card-sm\">\n <LoadingSpinner size={20} className=\"text-muted-foreground\" />\n </div>\n );\n }\n\n if (loadFailed) {\n return <p className=\"text-sm text-destructive\">{tComponent(FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED, 'previewLoadFailed')}</p>;\n }\n\n if (!isReady) return null;\n\n // inlineLimit: 0 → skip items, render only the \"View all\" quick-link\n if (limit === 0) {\n if (!showViewAllLink) return null;\n const viewAllLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'viewAll',\n });\n return (\n <Button variant={ButtonVariants_Variant.LINK} size={ButtonSize.SM} className=\"px-0\" onClick={onViewAll}>\n {viewAllLabel}\n </Button>\n );\n }\n\n if (items.length === 0) {\n const emptyStateLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'emptyState',\n });\n return <p className=\"text-sm text-muted-foreground\">{emptyStateLabel}</p>;\n }\n\n const hasMore = totalCount > limit;\n // `viewAllWithCount` rather than `viewAll` + a hardcoded \" (N)\": the count has\n // to sit INSIDE the translated string, because languages disagree on where a\n // number goes and how it is bracketed. The count-free `viewAll` is used by the\n // `limit === 0` branch above, where no total has been fetched.\n const viewAllLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'viewAllWithCount',\n params: { total: totalCount },\n });\n\n return (\n <div className=\"space-y-xs\">\n <ul className=\"space-y-xs\">\n {items.map((item, idx) => {\n const id = (item as any)._id ?? (item as any).id ?? idx;\n const label = FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType: childResourceType,\n registry,\n currentObject: item,\n }) ?? String(id);\n return (\n <li key={id} className=\"text-sm px-sm py-xs rounded-radius border border-border bg-card\">\n {label}\n </li>\n );\n })}\n </ul>\n {showViewAllLink && hasMore && (\n <Button\n variant={ButtonVariants_Variant.LINK}\n size={ButtonSize.SM}\n className=\"px-0\"\n onClick={onViewAll}\n >\n {viewAllLabel}\n </Button>\n )}\n </div>\n );\n}\n\n/** @wildo_source:part:start saas.frontend.related-resource-preview facet:layer:frontend facet:family:component */\nexport interface RelatedResourcePreviewProps {\n /** Child resource type to preview. */\n resourceType: string;\n /** Rows to show. `0` renders only the \"view all\" affordance. */\n limit: number;\n /** Offer a \"view all\" link when more rows exist. Defaults to `true`. */\n showViewAllLink?: boolean;\n /** Disambiguates WHICH edge when the host has several to this target. */\n viaForeignKey?: EmbedRelatedResourceEdgeSelector;\n className?: string;\n}\n/** @wildo_source:part:end saas.frontend.related-resource-preview */\n\n/**\n * Template-facing preview: a few rows of a related collection plus a \"view all\".\n *\n * ## Why this wrapper has to exist\n *\n * The preview behaviour was previously reachable ONLY through the automatic\n * container, selected by an `inParentView.inlineLimit` key that nothing in the\n * repository ever authored — one of the two dark capabilities that motivated this\n * whole migration. Deleting that config without giving the preview a door a\n * template can open would make it dark a THIRD time, this time by our own hand.\n *\n * It derives the child context from the HOST, exactly as the operation embed does,\n * so an author never passes an id — the record DTO exposes `_id`, never the\n * context key, so an id-taking API would be unusable from a display template.\n *\n * It registers placement, so using it makes the template own the child region.\n */\nexport function RelatedResourcePreview({\n resourceType,\n limit,\n showViewAllLink = true,\n viaForeignKey,\n className,\n}: RelatedResourcePreviewProps): React.JSX.Element | null {\n useRegisterComposedChild(resourceType);\n const { buildOperationContext } = useEmbeddedResourceContext();\n const { navigationZone } = useEmbeddedResourceHostContext();\n const { navigate } = useNavigationController();\n\n const childContext = useMemo(\n () => buildOperationContext({\n resourceType,\n operationLike: CoreOp.LIST,\n relationshipFieldOverrides: viaForeignKey,\n }),\n // Keyed by VALUE, not by the fresh-every-render selector object identity —\n // rebuilding the context each render clones resource configs and re-fires the\n // effects keyed on its identity.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [buildOperationContext, resourceType, JSON.stringify(viaForeignKey ?? null)],\n );\n\n return (\n <div className={className}>\n <RelatedResourcePreviewSurface\n childContext={childContext as never}\n inlineLimit={limit}\n showViewAllLink={showViewAllLink}\n childResourceType={resourceType}\n // Same navigation shape the automatic container uses for its own\n // \"view all\": route to the child's LIST as a resource-operation content,\n // carrying the host's zone as the initiator so the target lands where the\n // reader expects rather than replacing the record they came from.\n onViewAll={() => navigate({\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: childContext,\n },\n initiator: { sourceZone: navigationZone },\n } as never)}\n />\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RelatedResourcePreview.js","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourcePreview.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,kCAAkC,EAAkC,MAAM,uBAAuB,CAAC;AAClI,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAExF,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAyB,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAC1H,OAAO,EACL,qCAAqC,EACrC,0CAA0C,GAC3C,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,yCAAyC,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6DAA6D,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA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,EACnC,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,YAAY;YAC/B,iEAAiE;YACjE,yEAAyE;YACzE,0EAA0E;YAC1E,kEAAkE;YAClE,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC;gBACxB,OAAO,EAAE;oBACP,WAAW,EAAE,qBAAqB,CAAC,kBAAkB;oBACrD,eAAe,EAAE,YAAY;iBAC9B;gBACD,SAAS,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE;aACjC,CAAC,GACX,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\n/**\n * A compact PREVIEW of a related collection — a few rows plus a \"view all\" link,\n * instead of the full list surface with its toolbar, filters and pagination.\n *\n * ## Why this is its own component rather than a mode on the embed\n *\n * A preview and an embedded LIST are different things: one summarises, the other\n * is the collection. Folding them into one component behind a `limit` prop is how\n * the configuration surface this migration removes got started — a single knob\n * that quietly changes what a thing IS rather than how it looks.\n *\n * ## It was unreachable before this\n *\n * The behaviour below is moved verbatim out of the automatic children container,\n * where it was selected by an `inParentView.inlineLimit` config key that NOTHING\n * in the repository authored — measured 2026-08-20, zero occurrences across the\n * engine presets and every example app, while a sibling key in the same files was\n * authored four times. So this is a second dark capability in the same component\n * as the one that motivated this workstream: real, working, and reachable by no\n * one. Exposing it as a component a template can place is what makes it usable.\n */\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CoreResourceOperation, ResourcesConfig_OperationPathUtils, type Resources_PaginatedResult } from '@wildo-ai/saas-models';\nimport { ButtonSize, FrontendComponentType } from '@wildo-ai/presets-components-models';\n\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { LoadingSpinner } from '~wildo-frontend-lib/components/feedback/loading-spinner';\nimport { resolveComponentLabel } from '~wildo-frontend-lib/core/i18n/component-label-resolution.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { frontendResourceUtils, FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport {\n pickPreferredOperationForCoreSemantic,\n resolveEffectiveCoreOperationFromOperation,\n} from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { isListOperationAddressableForChildContext } from './child-operation-addressability.utils';\nimport { CoreResourceOperation as CoreOp } from '@wildo-ai/saas-models';\nimport { useNavigationController } from '~wildo-frontend-lib/core/navigation/useNavigationController';\nimport { NavigationContentType } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { useEmbeddedResourceHostContext } from './EmbeddedResourceHostContext';\nimport { useEmbeddedResourceContext } from './useEmbeddedResourceContext';\nimport { useRegisterComposedChild } from './ComposedChildrenRegistry';\nimport { type EmbedRelatedResourceEdgeSelector } from './ResourceEmbeds';\n\nexport interface RelatedResourcePreviewSurfaceProps {\n /** Resolved child context (target resource + parent-scoped identifiers). */\n childContext: ReturnType<typeof frontendResourceUtils.deriveChildResourceContext>;\n /** Rows to show. `0` renders only the \"view all\" affordance. */\n inlineLimit: number;\n /** Whether to offer the \"view all\" link when more rows exist. */\n showViewAllLink: boolean;\n /** Child resource type, used to compute each row's display label. */\n childResourceType: string;\n /** Invoked when the reader asks for the full collection. */\n onViewAll: () => void;\n}\n\n/**\n * Lightweight inline preview for 1:N / N:N children when `inlineLimit` is set.\n *\n * Fetches `limit` items via the child's LIST operation, renders them as a\n * compact vertical list of resource display names, and optionally shows a\n * \"View all (N total)\" link that navigates to the full list.\n *\n * This avoids mounting the full `ResourceLayout_List` (with search, sort,\n * filter, pagination) when the relationship is configured for a quick preview.\n */\nexport function RelatedResourcePreviewSurface({\n childContext,\n inlineLimit,\n showViewAllLink,\n childResourceType,\n onViewAll,\n}: RelatedResourcePreviewSurfaceProps): React.JSX.Element | null {\n const { registry, doOperation } = useResourceRegistry();\n const { t: tChildLabel, formatDate, formatDateTime, tComponent, isReady } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n resource: childContext.resourceType,\n });\n const [items, setItems] = useState<Record<string, unknown>[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [isLoading, setIsLoading] = useState(true);\n const [loadFailed, setLoadFailed] = useState(false);\n const doOperationRef = useRef(doOperation);\n doOperationRef.current = doOperation;\n\n const limit = inlineLimit;\n\n // Stable key for the child context — prevents re-fetches when the parent\n // re-renders and `deriveChildResourceContext` returns a new object ref\n // with identical content.\n const contextIdKey = useMemo(\n () => FrontendResourceUtils.buildContextResourceIdentifiersKey(childContext.contextResourceIdentifiers),\n [childContext.contextResourceIdentifiers],\n );\n\n useEffect(() => {\n // inlineLimit: 0 means \"show no items, just the View All link\"\n if (limit === 0) {\n setIsLoading(false);\n return;\n }\n\n let cancelled = false;\n\n const fetchPreview = async () => {\n setIsLoading(true);\n setLoadFailed(false);\n\n const childConfig = registry.resourceConfigurations[childResourceType];\n const contextualParameters = FrontendResourceUtils.buildContextualParameters(childContext.contextResourceIdentifiers, registry);\n const listOperation = childContext.operation\n && resolveEffectiveCoreOperationFromOperation(childContext.operation) === CoreResourceOperation.LIST\n ? childContext.operation\n : childConfig\n ? pickPreferredOperationForCoreSemantic(\n (childConfig.operations ?? []).filter((candidate) =>\n isListOperationAddressableForChildContext(\n candidate,\n childContext,\n contextualParameters,\n )\n ),\n CoreResourceOperation.LIST,\n )\n : undefined;\n if (!listOperation) {\n setIsLoading(false);\n return;\n }\n\n const operationPathKey = ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(listOperation);\n\n try {\n const result = await doOperationRef.current(operationPathKey, {\n contextualParameters,\n queryParameters: { page: 1, limit },\n parentResourcesRequirements: childContext.parentResourcesRequirements,\n });\n\n if (cancelled) return;\n\n if (result && typeof result === 'object' && 'data' in result && 'pagination' in result) {\n const paginated = result as Resources_PaginatedResult<Record<string, unknown>>;\n setItems(paginated.data);\n setTotalCount(paginated.pagination.total);\n } else if (Array.isArray(result)) {\n setItems(result);\n setTotalCount(result.length);\n }\n } catch {\n if (!cancelled) setLoadFailed(true);\n } finally {\n if (!cancelled) setIsLoading(false);\n }\n };\n\n fetchPreview();\n return () => { cancelled = true; };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [childResourceType, limit, registry, contextIdKey]);\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center py-card-sm\">\n <LoadingSpinner size={20} className=\"text-muted-foreground\" />\n </div>\n );\n }\n\n if (loadFailed) {\n return <p className=\"text-sm text-destructive\">{tComponent(FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED, 'previewLoadFailed')}</p>;\n }\n\n if (!isReady) return null;\n\n // inlineLimit: 0 → skip items, render only the \"View all\" quick-link\n if (limit === 0) {\n if (!showViewAllLink) return null;\n const viewAllLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'viewAll',\n });\n return (\n <Button variant={ButtonVariants_Variant.LINK} size={ButtonSize.SM} className=\"px-0\" onClick={onViewAll}>\n {viewAllLabel}\n </Button>\n );\n }\n\n if (items.length === 0) {\n const emptyStateLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'emptyState',\n });\n return <p className=\"text-sm text-muted-foreground\">{emptyStateLabel}</p>;\n }\n\n const hasMore = totalCount > limit;\n // `viewAllWithCount` rather than `viewAll` + a hardcoded \" (N)\": the count has\n // to sit INSIDE the translated string, because languages disagree on where a\n // number goes and how it is bracketed. The count-free `viewAll` is used by the\n // `limit === 0` branch above, where no total has been fetched.\n const viewAllLabel = resolveComponentLabel({\n tComponent,\n componentType: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n key: 'viewAllWithCount',\n params: { total: totalCount },\n });\n\n return (\n <div className=\"space-y-xs\">\n <ul className=\"space-y-xs\">\n {items.map((item, idx) => {\n const id = (item as any)._id ?? (item as any).id ?? idx;\n /* The translator reaches the label callback, as in every other caller (see ResourceListItemRenderer). */\n const label = FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType: childResourceType,\n registry,\n currentObject: item,\n t: tChildLabel,\n formatDate,\n formatDateTime,\n }) ?? String(id);\n return (\n <li key={id} className=\"text-sm px-sm py-xs rounded-radius border border-border bg-card\">\n {label}\n </li>\n );\n })}\n </ul>\n {showViewAllLink && hasMore && (\n <Button\n variant={ButtonVariants_Variant.LINK}\n size={ButtonSize.SM}\n className=\"px-0\"\n onClick={onViewAll}\n >\n {viewAllLabel}\n </Button>\n )}\n </div>\n );\n}\n\n/** @wildo_source:part:start saas.frontend.related-resource-preview facet:layer:frontend facet:family:component */\nexport interface RelatedResourcePreviewProps {\n /** Child resource type to preview. */\n resourceType: string;\n /** Rows to show. `0` renders only the \"view all\" affordance. */\n limit: number;\n /** Offer a \"view all\" link when more rows exist. Defaults to `true`. */\n showViewAllLink?: boolean;\n /** Disambiguates WHICH edge when the host has several to this target. */\n viaForeignKey?: EmbedRelatedResourceEdgeSelector;\n className?: string;\n}\n/** @wildo_source:part:end saas.frontend.related-resource-preview */\n\n/**\n * Template-facing preview: a few rows of a related collection plus a \"view all\".\n *\n * ## Why this wrapper has to exist\n *\n * The preview behaviour was previously reachable ONLY through the automatic\n * container, selected by an `inParentView.inlineLimit` key that nothing in the\n * repository ever authored — one of the two dark capabilities that motivated this\n * whole migration. Deleting that config without giving the preview a door a\n * template can open would make it dark a THIRD time, this time by our own hand.\n *\n * It derives the child context from the HOST, exactly as the operation embed does,\n * so an author never passes an id — the record DTO exposes `_id`, never the\n * context key, so an id-taking API would be unusable from a display template.\n *\n * It registers placement, so using it makes the template own the child region.\n */\nexport function RelatedResourcePreview({\n resourceType,\n limit,\n showViewAllLink = true,\n viaForeignKey,\n className,\n}: RelatedResourcePreviewProps): React.JSX.Element | null {\n useRegisterComposedChild(resourceType);\n const { buildOperationContext } = useEmbeddedResourceContext();\n const { navigationZone } = useEmbeddedResourceHostContext();\n const { navigate } = useNavigationController();\n\n const childContext = useMemo(\n () => buildOperationContext({\n resourceType,\n operationLike: CoreOp.LIST,\n relationshipFieldOverrides: viaForeignKey,\n }),\n // Keyed by VALUE, not by the fresh-every-render selector object identity —\n // rebuilding the context each render clones resource configs and re-fires the\n // effects keyed on its identity.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [buildOperationContext, resourceType, JSON.stringify(viaForeignKey ?? null)],\n );\n\n return (\n <div className={className}>\n <RelatedResourcePreviewSurface\n childContext={childContext as never}\n inlineLimit={limit}\n showViewAllLink={showViewAllLink}\n childResourceType={resourceType}\n // Same navigation shape the automatic container uses for its own\n // \"view all\": route to the child's LIST as a resource-operation content,\n // carrying the host's zone as the initiator so the target lands where the\n // reader expects rather than replacing the record they came from.\n onViewAll={() => navigate({\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: childContext,\n },\n initiator: { sourceZone: navigationZone },\n } as never)}\n />\n </div>\n );\n}\n"]}
|
|
@@ -38,7 +38,14 @@ export interface RelatedResourceSectionTarget {
|
|
|
38
38
|
operationLike?: CoreResourceOperation;
|
|
39
39
|
}
|
|
40
40
|
export interface RelatedResourceSectionsProps {
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Children to place, in render order. Order here replaces the old `orderIndex`.
|
|
43
|
+
*
|
|
44
|
+
* A target whose every edge from the host carries a relationship `discriminator` or `condition` the
|
|
45
|
+
* DISPLAYED row does not satisfy is omitted, silently, exactly as automatic composition omits it: a
|
|
46
|
+
* recurring todo's occurrences section appears only on a recurring todo. Inside a display template a
|
|
47
|
+
* constrained target waits for the row to load; with no display template there is no row to judge.
|
|
48
|
+
*/
|
|
42
49
|
targets: ReadonlyArray<RelatedResourceSectionTarget | string>;
|
|
43
50
|
/** How the sections arrange — the real section vocabulary, not a serializable subset. */
|
|
44
51
|
config: SectionConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedResourceSections.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourceSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,
|
|
1
|
+
{"version":3,"file":"RelatedResourceSections.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourceSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EACL,qBAAqB,EAItB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAMhG,OAAO,EAAiC,KAAK,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAMxG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,mHAAmH;AACnH,MAAM,WAAW,4BAA4B;IAC3C,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,aAAa,CAAC,EAAE,gCAAgC,CAAC;IACjD,wEAAwE;IACxE,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;;;;OAOG;IACH,OAAO,EAAE,aAAa,CAAC,4BAA4B,GAAG,MAAM,CAAC,CAAC;IAC9D,yFAAyF;IACzF,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8DD,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,MAAM,EACN,SAAS,GACV,EAAE,4BAA4B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CA8FzD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { CoreResourceOperation } from '@wildo-ai/saas-models';
|
|
4
|
+
import { CoreResourceOperation, Resources_SharedUtils, getChildDirectionRelationships, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { FrontendComponentType } from '@wildo-ai/presets-components-models';
|
|
6
6
|
import { ContentSectionContainer } from '../../../components/sections/ContentSectionContainer.js';
|
|
7
7
|
import { resolveResourceHeaderLabel } from '../../../core/i18n/component-label-resolution.utils.js';
|
|
@@ -10,8 +10,40 @@ import { SectionHostHeadingContext } from '../../../components/resources/skeleto
|
|
|
10
10
|
import { EmbedRelatedResourceOperation } from './ResourceEmbeds.js';
|
|
11
11
|
import { useClaimChildComposition } from './ComposedChildrenRegistry.js';
|
|
12
12
|
import { useOptionalCompositeResourceContext } from './useEmbeddedResourceContext.js';
|
|
13
|
+
import { useOptionalDisplayTemplateContext } from '../../../components/data-display/DisplayTemplateContext.js';
|
|
13
14
|
import { LoggerFrontendService } from '../../../core/monitoring/logger.frontend.service.js';
|
|
14
15
|
/** @wildo_source:part:end saas.frontend.related-resource-sections */
|
|
16
|
+
/**
|
|
17
|
+
* Is a placed child ruled out by the HOST ROW itself — every edge from the host to it carrying a
|
|
18
|
+
* relationship `discriminator` or `condition` the displayed row does not satisfy?
|
|
19
|
+
*
|
|
20
|
+
* The automatic composition (`ResourceLayout_ContainerNested`) has always asked this through
|
|
21
|
+
* `isRelationshipActiveForParent`; a template placing the same child did not, so a discriminated
|
|
22
|
+
* edge — Wonder Todos' recurring occurrences, which exist only for a RECURRING todo — rendered a tab
|
|
23
|
+
* on every todo, and the backend refused its LIST for the ones it does not apply to (#1787). Same
|
|
24
|
+
* predicate, same options, so the two composition paths cannot disagree about which children a row has.
|
|
25
|
+
*
|
|
26
|
+
* - `undefined` host row with no display template around the sections: nothing to judge, so no
|
|
27
|
+
* opinion — a composite view placing children keeps the behaviour it had.
|
|
28
|
+
* - `undefined` host row INSIDE a template: the row is still loading, and a constrained edge stays out
|
|
29
|
+
* until it arrives (`onMissingParentResource: 'exclude'`), rather than flashing a tab it may retract.
|
|
30
|
+
* - Conservative across edges: the child is ruled out only when EVERY edge to it is inactive. A target
|
|
31
|
+
* narrowed by `viaForeignKey` to one of several edges is not judged per edge, which would need the
|
|
32
|
+
* registry's field identifiers; no application has a discriminated edge beside a second one to the
|
|
33
|
+
* same child, and this errs toward showing rather than hiding.
|
|
34
|
+
*/
|
|
35
|
+
function isPlacedChildInactiveForHostRow(params) {
|
|
36
|
+
if (!params.hostRelationships) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const edges = getChildDirectionRelationships(params.hostRelationships).filter((relationship) => {
|
|
40
|
+
const childResourceType = relationship.resourceType1 === params.hostResourceType
|
|
41
|
+
? relationship.resourceType2
|
|
42
|
+
: relationship.resourceType1;
|
|
43
|
+
return childResourceType === params.targetResourceType;
|
|
44
|
+
});
|
|
45
|
+
return edges.length > 0 && edges.every((relationship) => !Resources_SharedUtils.isRelationshipActiveForParent(relationship, params.hostRecord, { onMissingParentResource: 'exclude', onConditionError: 'exclude' }));
|
|
46
|
+
}
|
|
15
47
|
/** One warning per (host, target) — a surface re-renders freely. */
|
|
16
48
|
const warnedUnembeddableTargets = new Set();
|
|
17
49
|
function warnUnembeddableTarget(hostResourceType, targetResourceType) {
|
|
@@ -39,6 +71,11 @@ export function RelatedResourceSections({ targets, config, className, }) {
|
|
|
39
71
|
// the embeds below fail as they always did.
|
|
40
72
|
const embeddedContext = useOptionalCompositeResourceContext();
|
|
41
73
|
const hostResourceType = embeddedContext?.hostResourceType ?? '';
|
|
74
|
+
const hostRelationships = embeddedContext?.hostResourceConfig?.resourceRelationships;
|
|
75
|
+
// The row this block sits under, when it sits inside a display template. See
|
|
76
|
+
// `isPlacedChildInactiveForHostRow` for why "no template" and "still loading" differ.
|
|
77
|
+
const displayTemplate = useOptionalDisplayTemplateContext();
|
|
78
|
+
const hostRecord = displayTemplate?.data;
|
|
42
79
|
// One i18n scope for the host; each section title is resolved per child below
|
|
43
80
|
// from that child's own header label, which is what keeps this free of new keys.
|
|
44
81
|
const { tResourceHeader, isReady } = useI18n({
|
|
@@ -58,6 +95,16 @@ export function RelatedResourceSections({ targets, config, className, }) {
|
|
|
58
95
|
if (!embeddedContext) {
|
|
59
96
|
return true;
|
|
60
97
|
}
|
|
98
|
+
// A child the host ROW rules out is omitted SILENTLY: it is a declared condition doing its job,
|
|
99
|
+
// not a misplaced target, so it earns no warning.
|
|
100
|
+
if (displayTemplate && isPlacedChildInactiveForHostRow({
|
|
101
|
+
hostResourceType,
|
|
102
|
+
hostRelationships,
|
|
103
|
+
targetResourceType: target.resourceType,
|
|
104
|
+
hostRecord,
|
|
105
|
+
})) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
61
108
|
const ok = embeddedContext.canBuildOperationContext({
|
|
62
109
|
resourceType: target.resourceType,
|
|
63
110
|
operationLike: target.operationLike ?? CoreResourceOperation.LIST,
|
|
@@ -67,7 +114,7 @@ export function RelatedResourceSections({ targets, config, className, }) {
|
|
|
67
114
|
warnUnembeddableTarget(hostResourceType, target.resourceType);
|
|
68
115
|
}
|
|
69
116
|
return ok;
|
|
70
|
-
}), [normalized, embeddedContext, hostResourceType]);
|
|
117
|
+
}), [normalized, embeddedContext, hostResourceType, hostRelationships, displayTemplate, hostRecord]);
|
|
71
118
|
const sections = useMemo(() => embeddable.map((target) => ({
|
|
72
119
|
id: target.resourceType,
|
|
73
120
|
title: resolveResourceHeaderLabel({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedResourceSections.js","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourceSections.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAsB,MAAM,qCAAqC,CAAC;AAEhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,O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AC;YAChC,eAAe;YACf,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,GAAG,EAAE,OAAO;SACb,CAAC;QACF,OAAO,EAAE;QACP,uEAAuE;QACvE,4DAA4D;QAC5D,KAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAC7C,KAAC,6BAA6B,IAC5B,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,qBAAqB,CAAC,IAAI,EACjE,0BAA0B,EAAE,MAAM,CAAC,aAAa,GAChD,GACiC,CACtC;KACF,CAAC,CAAC,EACH,CAAC,UAAU,EAAE,eAAe,CAAC,CAC9B,CAAC;IAEF,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnD,OAAO,KAAC,uBAAuB,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;AAC/F,CAAC","sourcesContent":["'use client';\n\nimport React, { useMemo } from 'react';\n\nimport { CoreResourceOperation } from '@wildo-ai/saas-models';\nimport { FrontendComponentType, type SectionConfig } from '@wildo-ai/presets-components-models';\n\nimport { ContentSectionContainer } from '~wildo-frontend-lib/components/sections/ContentSectionContainer';\nimport { resolveResourceHeaderLabel } from '~wildo-frontend-lib/core/i18n/component-label-resolution.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { SectionHostHeadingContext } from '~wildo-frontend-lib/components/resources/skeleton/SectionHostHeadingContext';\nimport { EmbedRelatedResourceOperation, type EmbedRelatedResourceEdgeSelector } from './ResourceEmbeds';\nimport { useClaimChildComposition } from './ComposedChildrenRegistry';\nimport { useOptionalCompositeResourceContext } from './useEmbeddedResourceContext';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\n\n/**\n * The standard child block — scoped to the children a view actually wants.\n *\n * ## Why this exists rather than \"compose it yourself\"\n *\n * Placing children in a template must not be harder than letting them compose\n * automatically, or authors will keep the automatic mode and the configuration\n * axis it needed. Doing it by hand means wiring `ContentSectionContainer`,\n * resolving each child's title through i18n, and threading the heading context —\n * three chances to get it subtly wrong, per surface.\n *\n * Worse, hand-wiring invites NAMED `<Section>`s, and a named section is a\n * THREE-PLACE obligation: the JSX name, the hand-authored `layout.refs.sections`\n * manifest, and a documented slot with `textSlots` in the resource specification.\n * Miss the third and `validateStructuralSlotDescriptions` THROWS at ESM import,\n * crash-looping the companion. This component takes each section's title from the\n * CHILD RESOURCE's own header label — the same source automatic composition uses\n * — so placing children adds no refs entry, no spec slot, and no new i18n key.\n *\n * ## What it means for composition ownership\n *\n * It renders through `EmbedRelatedResourceOperation`, so it registers placement:\n * a template using it owns the child region and the automatic block stands down.\n * That is the point — \"these children, in this order\" replaces \"all owned\n * children, minus a per-edge suppression flag on each one you did not want\".\n */\n/** @wildo_source:part:start saas.frontend.related-resource-sections facet:layer:frontend facet:family:component */\nexport interface RelatedResourceSectionTarget {\n /** Child resource type. */\n resourceType: string;\n /** Disambiguates WHICH edge when the host has several to this target. */\n viaForeignKey?: EmbedRelatedResourceEdgeSelector;\n /** Defaults to LIST — the collection case. Use READ for a 1:1 child. */\n operationLike?: CoreResourceOperation;\n}\n\nexport interface RelatedResourceSectionsProps {\n /** Children to place, in render order. Order here replaces the old `orderIndex`. */\n targets: ReadonlyArray<RelatedResourceSectionTarget | string>;\n /** How the sections arrange — the real section vocabulary, not a serializable subset. */\n config: SectionConfig;\n className?: string;\n}\n/** @wildo_source:part:end saas.frontend.related-resource-sections */\n\n/** One warning per (host, target) — a surface re-renders freely. */\nconst warnedUnembeddableTargets = new Set<string>();\n\nfunction warnUnembeddableTarget(hostResourceType: string, targetResourceType: string): void {\n const key = `${hostResourceType}::${targetResourceType}`;\n if (warnedUnembeddableTargets.has(key)) {\n return;\n }\n warnedUnembeddableTargets.add(key);\n LoggerFrontendService.getLogger().warn(\n `[related-resource-sections] \"${targetResourceType}\" was placed on \"${hostResourceType}\" but cannot be `\n + 'embedded here, so its section is omitted. The usual cause is that the target exposes no ADDRESSABLE '\n + 'variant of the requested operation — a core verb declared REPOSITORY_ONLY or INTERNAL_CALL has no HTTP '\n + 'surface to embed. Either give the target an addressable variant, point `operationLike` at one it does '\n + 'expose, or stop placing it.',\n );\n}\n\nexport function RelatedResourceSections({\n targets,\n config,\n className,\n}: RelatedResourceSectionsProps): React.JSX.Element | null {\n // Claim the region even when `targets` is empty: `targets={[]}` is how a\n // surface says \"composes no children\", which is a different statement from a\n // template that simply never mentioned them.\n useClaimChildComposition();\n\n const normalized = useMemo(\n () => targets.map((t) => (typeof t === 'string' ? { resourceType: t } : t)),\n [targets],\n );\n\n // OPTIONAL on purpose. `useEmbeddedResourceContext()` throws when there is no\n // resource-scoped host, which would make this component a NEW crash source for\n // any host that is not resource-scoped — the opposite of the fix. With no host\n // there is nothing to probe a target against, so filtering is simply skipped and\n // the embeds below fail as they always did.\n const embeddedContext = useOptionalCompositeResourceContext();\n const hostResourceType = embeddedContext?.hostResourceType ?? '';\n\n // One i18n scope for the host; each section title is resolved per child below\n // from that child's own header label, which is what keeps this free of new keys.\n const { tResourceHeader, isReady } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n });\n\n // Drop targets this host cannot embed, rather than letting the first one take the\n // whole surface down. A target being un-embeddable is a NORMAL authorable state —\n // a resource may expose a core verb with no addressable HTTP variant (Wonder's\n // recurring occurrences declare LIST as INTERNAL_CALL only, deliberately) — and\n // the automatic container has always simply skipped such a child. The template\n // path threw instead, so ONE bad target rendered an error surface in place of the\n // entire page. Same shape as F7: one undisplayable child must not crash the parent.\n //\n // Skipped LOUDLY, not silently: the author named this target explicitly, so a\n // silent drop would be the \"dark capability\" failure this migration exists to end.\n const embeddable = useMemo(\n () => normalized.filter((target) => {\n if (!embeddedContext) {\n return true;\n }\n const ok = embeddedContext.canBuildOperationContext({\n resourceType: target.resourceType,\n operationLike: target.operationLike ?? CoreResourceOperation.LIST,\n relationshipFieldOverrides: target.viaForeignKey,\n });\n if (!ok) {\n warnUnembeddableTarget(hostResourceType, target.resourceType);\n }\n return ok;\n }),\n [normalized, embeddedContext, hostResourceType],\n );\n\n const sections = useMemo(\n () => embeddable.map((target) => ({\n id: target.resourceType,\n title: resolveResourceHeaderLabel({\n tResourceHeader,\n resourceType: target.resourceType,\n key: 'title',\n }),\n content: (\n // The host renders the visible heading for the region, so the embedded\n // surface must not stack its own page chrome underneath it.\n <SectionHostHeadingContext.Provider value={true}>\n <EmbedRelatedResourceOperation\n resourceType={target.resourceType}\n operationLike={target.operationLike ?? CoreResourceOperation.LIST}\n relationshipFieldOverrides={target.viaForeignKey}\n />\n </SectionHostHeadingContext.Provider>\n ),\n })),\n [embeddable, tResourceHeader],\n );\n\n if (!isReady || sections.length === 0) return null;\n\n return <ContentSectionContainer sections={sections} config={config} className={className} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RelatedResourceSections.js","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/RelatedResourceSections.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,8BAA8B,GAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAsB,MAAM,qCAAqC,CAAC;AAEhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6EAA6E,CAAC;AACxH,OAAO,EAAE,6BAA6B,EAAyC,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC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7C,KAAC,6BAA6B,IAC5B,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,qBAAqB,CAAC,IAAI,EACjE,0BAA0B,EAAE,MAAM,CAAC,aAAa,GAChD,GACiC,CACtC;KACF,CAAC,CAAC,EACH,CAAC,UAAU,EAAE,eAAe,CAAC,CAC9B,CAAC;IAEF,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnD,OAAO,KAAC,uBAAuB,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;AAC/F,CAAC","sourcesContent":["'use client';\n\nimport React, { useMemo } from 'react';\n\nimport {\n CoreResourceOperation,\n Resources_SharedUtils,\n getChildDirectionRelationships,\n type ResourceConfiguration_ResourceRelationships,\n} from '@wildo-ai/saas-models';\nimport { FrontendComponentType, type SectionConfig } from '@wildo-ai/presets-components-models';\n\nimport { ContentSectionContainer } from '~wildo-frontend-lib/components/sections/ContentSectionContainer';\nimport { resolveResourceHeaderLabel } from '~wildo-frontend-lib/core/i18n/component-label-resolution.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { SectionHostHeadingContext } from '~wildo-frontend-lib/components/resources/skeleton/SectionHostHeadingContext';\nimport { EmbedRelatedResourceOperation, type EmbedRelatedResourceEdgeSelector } from './ResourceEmbeds';\nimport { useClaimChildComposition } from './ComposedChildrenRegistry';\nimport { useOptionalCompositeResourceContext } from './useEmbeddedResourceContext';\nimport { useOptionalDisplayTemplateContext } from '~wildo-frontend-lib/components/data-display/DisplayTemplateContext';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\n\n/**\n * The standard child block — scoped to the children a view actually wants.\n *\n * ## Why this exists rather than \"compose it yourself\"\n *\n * Placing children in a template must not be harder than letting them compose\n * automatically, or authors will keep the automatic mode and the configuration\n * axis it needed. Doing it by hand means wiring `ContentSectionContainer`,\n * resolving each child's title through i18n, and threading the heading context —\n * three chances to get it subtly wrong, per surface.\n *\n * Worse, hand-wiring invites NAMED `<Section>`s, and a named section is a\n * THREE-PLACE obligation: the JSX name, the hand-authored `layout.refs.sections`\n * manifest, and a documented slot with `textSlots` in the resource specification.\n * Miss the third and `validateStructuralSlotDescriptions` THROWS at ESM import,\n * crash-looping the companion. This component takes each section's title from the\n * CHILD RESOURCE's own header label — the same source automatic composition uses\n * — so placing children adds no refs entry, no spec slot, and no new i18n key.\n *\n * ## What it means for composition ownership\n *\n * It renders through `EmbedRelatedResourceOperation`, so it registers placement:\n * a template using it owns the child region and the automatic block stands down.\n * That is the point — \"these children, in this order\" replaces \"all owned\n * children, minus a per-edge suppression flag on each one you did not want\".\n */\n/** @wildo_source:part:start saas.frontend.related-resource-sections facet:layer:frontend facet:family:component */\nexport interface RelatedResourceSectionTarget {\n /** Child resource type. */\n resourceType: string;\n /** Disambiguates WHICH edge when the host has several to this target. */\n viaForeignKey?: EmbedRelatedResourceEdgeSelector;\n /** Defaults to LIST — the collection case. Use READ for a 1:1 child. */\n operationLike?: CoreResourceOperation;\n}\n\nexport interface RelatedResourceSectionsProps {\n /**\n * Children to place, in render order. Order here replaces the old `orderIndex`.\n *\n * A target whose every edge from the host carries a relationship `discriminator` or `condition` the\n * DISPLAYED row does not satisfy is omitted, silently, exactly as automatic composition omits it: a\n * recurring todo's occurrences section appears only on a recurring todo. Inside a display template a\n * constrained target waits for the row to load; with no display template there is no row to judge.\n */\n targets: ReadonlyArray<RelatedResourceSectionTarget | string>;\n /** How the sections arrange — the real section vocabulary, not a serializable subset. */\n config: SectionConfig;\n className?: string;\n}\n/** @wildo_source:part:end saas.frontend.related-resource-sections */\n\n/**\n * Is a placed child ruled out by the HOST ROW itself — every edge from the host to it carrying a\n * relationship `discriminator` or `condition` the displayed row does not satisfy?\n *\n * The automatic composition (`ResourceLayout_ContainerNested`) has always asked this through\n * `isRelationshipActiveForParent`; a template placing the same child did not, so a discriminated\n * edge — Wonder Todos' recurring occurrences, which exist only for a RECURRING todo — rendered a tab\n * on every todo, and the backend refused its LIST for the ones it does not apply to (#1787). Same\n * predicate, same options, so the two composition paths cannot disagree about which children a row has.\n *\n * - `undefined` host row with no display template around the sections: nothing to judge, so no\n * opinion — a composite view placing children keeps the behaviour it had.\n * - `undefined` host row INSIDE a template: the row is still loading, and a constrained edge stays out\n * until it arrives (`onMissingParentResource: 'exclude'`), rather than flashing a tab it may retract.\n * - Conservative across edges: the child is ruled out only when EVERY edge to it is inactive. A target\n * narrowed by `viaForeignKey` to one of several edges is not judged per edge, which would need the\n * registry's field identifiers; no application has a discriminated edge beside a second one to the\n * same child, and this errs toward showing rather than hiding.\n */\nfunction isPlacedChildInactiveForHostRow(params: {\n hostResourceType: string;\n hostRelationships: ResourceConfiguration_ResourceRelationships | undefined;\n targetResourceType: string;\n hostRecord: Record<string, unknown> | undefined;\n}): boolean {\n if (!params.hostRelationships) {\n return false;\n }\n const edges = getChildDirectionRelationships(params.hostRelationships).filter((relationship) => {\n const childResourceType = relationship.resourceType1 === params.hostResourceType\n ? relationship.resourceType2\n : relationship.resourceType1;\n return childResourceType === params.targetResourceType;\n });\n return edges.length > 0 && edges.every((relationship) => !Resources_SharedUtils.isRelationshipActiveForParent(\n relationship,\n params.hostRecord,\n { onMissingParentResource: 'exclude', onConditionError: 'exclude' },\n ));\n}\n\n/** One warning per (host, target) — a surface re-renders freely. */\nconst warnedUnembeddableTargets = new Set<string>();\n\nfunction warnUnembeddableTarget(hostResourceType: string, targetResourceType: string): void {\n const key = `${hostResourceType}::${targetResourceType}`;\n if (warnedUnembeddableTargets.has(key)) {\n return;\n }\n warnedUnembeddableTargets.add(key);\n LoggerFrontendService.getLogger().warn(\n `[related-resource-sections] \"${targetResourceType}\" was placed on \"${hostResourceType}\" but cannot be `\n + 'embedded here, so its section is omitted. The usual cause is that the target exposes no ADDRESSABLE '\n + 'variant of the requested operation — a core verb declared REPOSITORY_ONLY or INTERNAL_CALL has no HTTP '\n + 'surface to embed. Either give the target an addressable variant, point `operationLike` at one it does '\n + 'expose, or stop placing it.',\n );\n}\n\nexport function RelatedResourceSections({\n targets,\n config,\n className,\n}: RelatedResourceSectionsProps): React.JSX.Element | null {\n // Claim the region even when `targets` is empty: `targets={[]}` is how a\n // surface says \"composes no children\", which is a different statement from a\n // template that simply never mentioned them.\n useClaimChildComposition();\n\n const normalized = useMemo(\n () => targets.map((t) => (typeof t === 'string' ? { resourceType: t } : t)),\n [targets],\n );\n\n // OPTIONAL on purpose. `useEmbeddedResourceContext()` throws when there is no\n // resource-scoped host, which would make this component a NEW crash source for\n // any host that is not resource-scoped — the opposite of the fix. With no host\n // there is nothing to probe a target against, so filtering is simply skipped and\n // the embeds below fail as they always did.\n const embeddedContext = useOptionalCompositeResourceContext();\n const hostResourceType = embeddedContext?.hostResourceType ?? '';\n const hostRelationships = embeddedContext?.hostResourceConfig?.resourceRelationships;\n // The row this block sits under, when it sits inside a display template. See\n // `isPlacedChildInactiveForHostRow` for why \"no template\" and \"still loading\" differ.\n const displayTemplate = useOptionalDisplayTemplateContext();\n const hostRecord = displayTemplate?.data;\n\n // One i18n scope for the host; each section title is resolved per child below\n // from that child's own header label, which is what keeps this free of new keys.\n const { tResourceHeader, isReady } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_CONTAINER_NESTED,\n });\n\n // Drop targets this host cannot embed, rather than letting the first one take the\n // whole surface down. A target being un-embeddable is a NORMAL authorable state —\n // a resource may expose a core verb with no addressable HTTP variant (Wonder's\n // recurring occurrences declare LIST as INTERNAL_CALL only, deliberately) — and\n // the automatic container has always simply skipped such a child. The template\n // path threw instead, so ONE bad target rendered an error surface in place of the\n // entire page. Same shape as F7: one undisplayable child must not crash the parent.\n //\n // Skipped LOUDLY, not silently: the author named this target explicitly, so a\n // silent drop would be the \"dark capability\" failure this migration exists to end.\n const embeddable = useMemo(\n () => normalized.filter((target) => {\n if (!embeddedContext) {\n return true;\n }\n // A child the host ROW rules out is omitted SILENTLY: it is a declared condition doing its job,\n // not a misplaced target, so it earns no warning.\n if (displayTemplate && isPlacedChildInactiveForHostRow({\n hostResourceType,\n hostRelationships,\n targetResourceType: target.resourceType,\n hostRecord,\n })) {\n return false;\n }\n const ok = embeddedContext.canBuildOperationContext({\n resourceType: target.resourceType,\n operationLike: target.operationLike ?? CoreResourceOperation.LIST,\n relationshipFieldOverrides: target.viaForeignKey,\n });\n if (!ok) {\n warnUnembeddableTarget(hostResourceType, target.resourceType);\n }\n return ok;\n }),\n [normalized, embeddedContext, hostResourceType, hostRelationships, displayTemplate, hostRecord],\n );\n\n const sections = useMemo(\n () => embeddable.map((target) => ({\n id: target.resourceType,\n title: resolveResourceHeaderLabel({\n tResourceHeader,\n resourceType: target.resourceType,\n key: 'title',\n }),\n content: (\n // The host renders the visible heading for the region, so the embedded\n // surface must not stack its own page chrome underneath it.\n <SectionHostHeadingContext.Provider value={true}>\n <EmbedRelatedResourceOperation\n resourceType={target.resourceType}\n operationLike={target.operationLike ?? CoreResourceOperation.LIST}\n relationshipFieldOverrides={target.viaForeignKey}\n />\n </SectionHostHeadingContext.Provider>\n ),\n })),\n [embeddable, tResourceHeader],\n );\n\n if (!isReady || sections.length === 0) return null;\n\n return <ContentSectionContainer sections={sections} config={config} className={className} />;\n}\n"]}
|
|
@@ -88,6 +88,28 @@ export interface EmbedRelatedResourceListProps {
|
|
|
88
88
|
* place that code exists, so a shortcut can never drift from it.
|
|
89
89
|
*/
|
|
90
90
|
export declare function EmbedRelatedResourceList({ resourceType, viaForeignKey, className, }: EmbedRelatedResourceListProps): React.JSX.Element;
|
|
91
|
+
/** @wildo_source:part:start saas.frontend.linked-conversations-embed facet:layer:frontend facet:family:component facet:audience:app-developer */
|
|
92
|
+
export interface EmbedLinkedConversationsProps {
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The conversations linked to the host record (#1630) — email threads an inbound channel handler tied to this
|
|
97
|
+
* record with `ctx.thread.link`, newest first. Each opens to its messages in both directions, and an organization
|
|
98
|
+
* administrator can close it.
|
|
99
|
+
*
|
|
100
|
+
* Place it in a READ template or a record composite of the resource your threads are linked to. It is the
|
|
101
|
+
* `conversationThreads` LIST, pinned to this record through `pinnedFilters`: the reader cannot widen it to another
|
|
102
|
+
* record, and it shows only what the reader's own roles may read (organization members read their organization's
|
|
103
|
+
* conversations).
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* // frontend/src/modules/<slug>/resources/matters/MatterReadCustomView.tsx
|
|
107
|
+
* <ResourceLayoutPreset_Read_Default {...props}>
|
|
108
|
+
* <Section name="conversations"><EmbedLinkedConversations /></Section>
|
|
109
|
+
* </ResourceLayoutPreset_Read_Default>
|
|
110
|
+
*/
|
|
111
|
+
export declare function EmbedLinkedConversations({ className }: EmbedLinkedConversationsProps): React.JSX.Element;
|
|
112
|
+
/** @wildo_source:part:end saas.frontend.linked-conversations-embed */
|
|
91
113
|
export interface EmbedRelatedResourceSearchProps extends EmbedRelatedResourceListProps {
|
|
92
114
|
}
|
|
93
115
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceEmbeds.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/ResourceEmbeds.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ResourceEmbeds.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources/embeds/ResourceEmbeds.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AAOtH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qEAAqE,CAAC;AAmB/G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,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,+BAA+B;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS,EACT,GAAG,MAAM,EACV,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA0BzC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS,EACT,GAAG,MAAM,EACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAoC5C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,SAAS,EACT,GAAG,MAAM,EACV,EAAE,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA6B7C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,YAAY,EACZ,OAAO,EACP,SAAS,EACT,GAAG,MAAM,EACV,EAAE,0BAA0B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4BhD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { CoreResourceOperation, ErrorCustomMessageReference, } from '@wildo-ai/saas-models';
|
|
3
|
+
import { CONVERSATION_THREAD_LINKED_RESOURCE_FILTER, CoreResourceOperation, CoreResourceType, ErrorCustomMessageReference, getChildDirectionRelationships, } from '@wildo-ai/saas-models';
|
|
4
|
+
import { resolveRelationshipNestedReadSurface } from '../../../core/resources/relationship-surface-runtime.frontend.utils.js';
|
|
4
5
|
// ChartView MUST come from the `.lazy` wrapper — a static import of the real
|
|
5
6
|
// module merges the whole ECharts payload into the entry chunk (Rollup merges
|
|
6
7
|
// a module that is both statically and dynamically imported; no warning).
|
|
@@ -107,8 +108,51 @@ export function EmbedRelatedResourceOperation({ className, ...target }) {
|
|
|
107
108
|
// automatic composition skips it instead of rendering a second copy below.
|
|
108
109
|
// A no-op outside a registry host, so composite views are unaffected.
|
|
109
110
|
useRegisterComposedChild(target.resourceType);
|
|
110
|
-
const { navigationZone, navigationInitiator } = useEmbeddedResourceHostContext();
|
|
111
|
+
const { navigationZone, navigationInitiator: hostNavigationInitiator } = useEmbeddedResourceHostContext();
|
|
111
112
|
const compositeResourceContext = useEmbeddedResourceContext();
|
|
113
|
+
const { registry } = useResourceRegistry();
|
|
114
|
+
/*
|
|
115
|
+
* The EDGE this child sits on, carried on every navigation it starts — what the automatic composition
|
|
116
|
+
* (`ResourceLayout_ContainerNested`) already attaches as `sourceRelationship`.
|
|
117
|
+
*
|
|
118
|
+
* Without it a record opened from a TEMPLATE-placed relation never learnt its parent: the READ derives
|
|
119
|
+
* its parent reference from `sourceRelationship`, so the child's declared `inChildView` presentation
|
|
120
|
+
* could not apply. Wonder Todos declares a todo read inside its list as a linked BADGE back to the
|
|
121
|
+
* list; its list page places the todos through `RelatedResourceSections`, and the badge never
|
|
122
|
+
* appeared (#1945). Placing a child yourself must not cost the child its relationship.
|
|
123
|
+
*
|
|
124
|
+
* Resolved through `resolveRelationshipNestedReadSurface`, the same predicate the automatic
|
|
125
|
+
* composition uses, so the two paths cannot disagree about which edge a child sits on. An edge the
|
|
126
|
+
* target does not single out (no match, or several with no `viaForeignKey`) attaches nothing — the
|
|
127
|
+
* behaviour before this, rather than a guess.
|
|
128
|
+
*/
|
|
129
|
+
const sourceRelationship = useMemo(() => {
|
|
130
|
+
const { hostResourceType, hostResourceId, hostResourceConfig } = compositeResourceContext;
|
|
131
|
+
if (!target.resourceType || target.resourceType === hostResourceType || !hostResourceConfig?.resourceRelationships) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const selectedForeignKey = target.relationshipFieldOverrides?.[hostResourceType];
|
|
135
|
+
const edges = getChildDirectionRelationships(hostResourceConfig.resourceRelationships)
|
|
136
|
+
.map((relationship) => resolveRelationshipNestedReadSurface({ parentResourceType: hostResourceType, relationship, registry }))
|
|
137
|
+
.filter((edge) => edge !== undefined)
|
|
138
|
+
.filter((edge) => edge.childResourceType === target.resourceType)
|
|
139
|
+
.filter((edge) => selectedForeignKey === undefined || edge.foreignKeyField === selectedForeignKey);
|
|
140
|
+
if (edges.length !== 1)
|
|
141
|
+
return undefined;
|
|
142
|
+
const edge = edges[0];
|
|
143
|
+
return {
|
|
144
|
+
parentResourceType: hostResourceType,
|
|
145
|
+
parentResourceId: hostResourceId || undefined,
|
|
146
|
+
childResourceType: edge.childResourceType,
|
|
147
|
+
foreignKeyField: edge.foreignKeyField,
|
|
148
|
+
relationshipEdgeKey: edge.relationshipEdgeKey,
|
|
149
|
+
inChildView: edge.inChildView,
|
|
150
|
+
};
|
|
151
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed by the target's value, like the context below
|
|
152
|
+
}, [compositeResourceContext, registry, JSON.stringify(target)]);
|
|
153
|
+
const navigationInitiator = useMemo(() => (sourceRelationship
|
|
154
|
+
? { ...(hostNavigationInitiator ?? { sourceZone: navigationZone }), sourceRelationship }
|
|
155
|
+
: hostNavigationInitiator), [hostNavigationInitiator, navigationZone, sourceRelationship]);
|
|
112
156
|
const resourceContext = useMemo(() => {
|
|
113
157
|
if (!target.resourceType) {
|
|
114
158
|
throw buildResourceEmbedConfigurationError('EmbedRelatedResourceOperation() requires a target resourceType.', { target });
|
|
@@ -130,6 +174,45 @@ export function EmbedRelatedResourceOperation({ className, ...target }) {
|
|
|
130
174
|
export function EmbedRelatedResourceList({ resourceType, viaForeignKey, className, }) {
|
|
131
175
|
return (_jsx(EmbedRelatedResourceOperation, { resourceType: resourceType, operationLike: CoreResourceOperation.LIST, relationshipFieldOverrides: viaForeignKey, className: className }));
|
|
132
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* The conversations linked to the host record (#1630) — email threads an inbound channel handler tied to this
|
|
179
|
+
* record with `ctx.thread.link`, newest first. Each opens to its messages in both directions, and an organization
|
|
180
|
+
* administrator can close it.
|
|
181
|
+
*
|
|
182
|
+
* Place it in a READ template or a record composite of the resource your threads are linked to. It is the
|
|
183
|
+
* `conversationThreads` LIST, pinned to this record through `pinnedFilters`: the reader cannot widen it to another
|
|
184
|
+
* record, and it shows only what the reader's own roles may read (organization members read their organization's
|
|
185
|
+
* conversations).
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* // frontend/src/modules/<slug>/resources/matters/MatterReadCustomView.tsx
|
|
189
|
+
* <ResourceLayoutPreset_Read_Default {...props}>
|
|
190
|
+
* <Section name="conversations"><EmbedLinkedConversations /></Section>
|
|
191
|
+
* </ResourceLayoutPreset_Read_Default>
|
|
192
|
+
*/
|
|
193
|
+
export function EmbedLinkedConversations({ className }) {
|
|
194
|
+
const { navigationZone, navigationInitiator } = useEmbeddedResourceHostContext();
|
|
195
|
+
const compositeResourceContext = useEmbeddedResourceContext();
|
|
196
|
+
const { hostResourceType, hostResourceId } = compositeResourceContext;
|
|
197
|
+
const resourceContext = useMemo(() => {
|
|
198
|
+
if (!hostResourceId) {
|
|
199
|
+
throw buildResourceEmbedConfigurationError('EmbedLinkedConversations() needs a host RECORD: place it on a READ surface, where the record it lists conversations for exists.', { hostResourceType });
|
|
200
|
+
}
|
|
201
|
+
const threads = compositeResourceContext.buildOperationContext({
|
|
202
|
+
resourceType: CoreResourceType.CONVERSATION_THREADS,
|
|
203
|
+
operationLike: CoreResourceOperation.LIST,
|
|
204
|
+
requireAddressable: false,
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
...threads,
|
|
208
|
+
pinnedFilters: {
|
|
209
|
+
[CONVERSATION_THREAD_LINKED_RESOURCE_FILTER.RESOURCE_TYPE]: hostResourceType,
|
|
210
|
+
[CONVERSATION_THREAD_LINKED_RESOURCE_FILTER.RESOURCE_ID]: hostResourceId,
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
}, [compositeResourceContext, hostResourceType, hostResourceId]);
|
|
214
|
+
return renderEmbeddedResourceOperation(resourceContext, navigationZone, navigationInitiator, className);
|
|
215
|
+
}
|
|
133
216
|
/**
|
|
134
217
|
* Embed a related resource's SEARCH surface. Same delegation contract as
|
|
135
218
|
* {@link EmbedRelatedResourceList} — only the semantic operation differs.
|