@wildo-ai/saas-frontend-lib 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +114 -26
- package/LICENSE.enterprise +129 -0
- package/dist/esm/companion-exports.d.ts +5 -2
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js +4 -2
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/components/actions/action-bar.d.ts +16 -1
- package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
- package/dist/esm/components/actions/action-bar.js.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +6 -14
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
- package/dist/esm/components/app/AppLayout_DecisionInbox.d.ts.map +1 -1
- package/dist/esm/components/app/AppLayout_DecisionInbox.js +2 -4
- package/dist/esm/components/app/AppLayout_DecisionInbox.js.map +1 -1
- package/dist/esm/components/app/AppLayout_Home.d.ts.map +1 -1
- package/dist/esm/components/app/AppLayout_Home.js +14 -7
- package/dist/esm/components/app/AppLayout_Home.js.map +1 -1
- package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts +13 -0
- package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts.map +1 -0
- package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js +16 -0
- package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js.map +1 -0
- package/dist/esm/components/app/DecisionInboxSection.d.ts +10 -0
- package/dist/esm/components/app/DecisionInboxSection.d.ts.map +1 -0
- package/dist/esm/components/app/DecisionInboxSection.js +15 -0
- package/dist/esm/components/app/DecisionInboxSection.js.map +1 -0
- package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts +13 -0
- package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts.map +1 -0
- package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js +28 -0
- package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js.map +1 -0
- package/dist/esm/components/app/IdentityPortalPage_Home.d.ts +10 -0
- package/dist/esm/components/app/IdentityPortalPage_Home.d.ts.map +1 -0
- package/dist/esm/components/app/IdentityPortalPage_Home.js +40 -0
- package/dist/esm/components/app/IdentityPortalPage_Home.js.map +1 -0
- package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts +16 -0
- package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts.map +1 -0
- package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js +41 -0
- package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js.map +1 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts +15 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts.map +1 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js +268 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js.map +1 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts +3 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts.map +1 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js +35 -0
- package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js.map +1 -0
- package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_Main.js +5 -0
- package/dist/esm/components/auth/Auth_Main.js.map +1 -1
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts +19 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts.map +1 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js +156 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js.map +1 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts +3 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts.map +1 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js +107 -0
- package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js.map +1 -0
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts +31 -10
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
- package/dist/esm/components/auth/StepUpAuthDialog.js +81 -17
- package/dist/esm/components/auth/StepUpAuthDialog.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 +19 -0
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
- package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts +11 -0
- package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts.map +1 -0
- package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js +25 -0
- package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js.map +1 -0
- package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts +11 -0
- package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts.map +1 -0
- package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js +25 -0
- package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js.map +1 -0
- package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-pricing-table.js +40 -7
- package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
- package/dist/esm/components/billing/billing-subscription-status.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-subscription-status.js +9 -1
- package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.js +3 -2
- package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
- package/dist/esm/components/data-display/AutomaticDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/AutomaticDisplayer.js +7 -2
- package/dist/esm/components/data-display/AutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayField.js +67 -45
- package/dist/esm/components/data-display/DisplayField.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.js +4 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +16 -6
- 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 +3 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/feedback/empty-state-marker.d.ts +16 -0
- package/dist/esm/components/feedback/empty-state-marker.d.ts.map +1 -0
- package/dist/esm/components/feedback/empty-state-marker.js +16 -0
- package/dist/esm/components/feedback/empty-state-marker.js.map +1 -0
- package/dist/esm/components/feedback/empty-state.d.ts.map +1 -1
- package/dist/esm/components/feedback/empty-state.js +2 -1
- package/dist/esm/components/feedback/empty-state.js.map +1 -1
- package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts +7 -1
- package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts.map +1 -1
- package/dist/esm/components/feedback/features/feature-unavailable-prompt.js +8 -2
- package/dist/esm/components/feedback/features/feature-unavailable-prompt.js.map +1 -1
- package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
- package/dist/esm/components/feedback/resource-empty-state.js +2 -1
- package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts +25 -1
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +14 -9
- 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 +30 -0
- package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/flow-node.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/flow-node.labels.js +4 -1
- package/dist/esm/components/flows-actors/flow-node.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/flow-step-visuals.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/flow-step-visuals.js +8 -2
- package/dist/esm/components/flows-actors/flow-step-visuals.js.map +1 -1
- package/dist/esm/components/flows-actors/human-decision-form.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/human-decision-form.js +4 -1
- package/dist/esm/components/flows-actors/human-decision-form.js.map +1 -1
- package/dist/esm/components/form/Form.d.ts +2 -0
- package/dist/esm/components/form/Form.d.ts.map +1 -1
- package/dist/esm/components/form/Form.js +1 -0
- package/dist/esm/components/form/Form.js.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.js +7 -4
- package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
- package/dist/esm/components/form/automated/AutosaveContext.d.ts.map +1 -1
- package/dist/esm/components/form/automated/AutosaveContext.js +8 -0
- package/dist/esm/components/form/automated/AutosaveContext.js.map +1 -1
- package/dist/esm/components/form/automated/FormField.d.ts +5 -3
- package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/FormField.js +38 -13
- package/dist/esm/components/form/automated/FormField.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +31 -18
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js.map +1 -1
- package/dist/esm/components/form/validation-errors/form-validation.d.ts +5 -7
- package/dist/esm/components/form/validation-errors/form-validation.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/form-validation.js +7 -22
- package/dist/esm/components/form/validation-errors/form-validation.js.map +1 -1
- package/dist/esm/components/form/validation-errors/getFieldError.d.ts +25 -2
- package/dist/esm/components/form/validation-errors/getFieldError.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/getFieldError.js +29 -2
- package/dist/esm/components/form/validation-errors/getFieldError.js.map +1 -1
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +5 -0
- 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 +3 -0
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
- package/dist/esm/components/form/validation-errors/save-attempt.d.ts +9 -0
- package/dist/esm/components/form/validation-errors/save-attempt.d.ts.map +1 -0
- package/dist/esm/components/form/validation-errors/save-attempt.js +42 -0
- package/dist/esm/components/form/validation-errors/save-attempt.js.map +1 -0
- package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts +3 -1
- package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/unstarted-field-visit.js +3 -1
- package/dist/esm/components/form/validation-errors/unstarted-field-visit.js.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts +2 -2
- package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.js +3 -0
- package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.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 +5 -3
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts +19 -0
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js +47 -11
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.js +17 -7
- package/dist/esm/components/resources/ResourceLayout_InsertedViews.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.js +13 -6
- package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.js +12 -8
- package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
- package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts +1 -1
- package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js +11 -4
- package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +5 -5
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js +21 -14
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
- package/dist/esm/components/resources/skeleton/DisplayLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/DisplayLayout.js +40 -4
- package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.js +22 -6
- package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts +1 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js +1 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +21 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +53 -9
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
- package/dist/esm/components/settings/SettingsHub.d.ts +15 -0
- package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsHub.js +14 -4
- package/dist/esm/components/settings/SettingsHub.js.map +1 -1
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +3 -2
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +4 -3
- package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +1 -1
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -1
- package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts +33 -0
- package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartKpiFigure.js +63 -4
- package/dist/esm/components/views/chart-view/ChartKpiFigure.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.js +33 -7
- package/dist/esm/components/views/chart-view/ChartView.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.labels.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.labels.js +69 -3
- package/dist/esm/components/views/chart-view/ChartView.labels.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.lazy.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartView.lazy.js +2 -1
- package/dist/esm/components/views/chart-view/ChartView.lazy.js.map +1 -1
- package/dist/esm/components/views/chart-view/ChartWidget.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/ChartWidget.js +12 -4
- package/dist/esm/components/views/chart-view/ChartWidget.js.map +1 -1
- package/dist/esm/components/views/chart-view/chart-export.utils.d.ts +8 -0
- package/dist/esm/components/views/chart-view/chart-export.utils.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/chart-export.utils.js +15 -25
- package/dist/esm/components/views/chart-view/chart-export.utils.js.map +1 -1
- package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts +6 -0
- package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts.map +1 -0
- package/dist/esm/components/views/chart-view/chart-view-defaults.js +6 -0
- package/dist/esm/components/views/chart-view/chart-view-defaults.js.map +1 -0
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts +35 -9
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.js +69 -21
- package/dist/esm/components/views/chart-view/option-builder/builder-utils.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js +6 -7
- package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js +2 -2
- package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js +7 -7
- package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js +6 -8
- package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js +4 -1
- package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js +13 -13
- package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js.map +1 -1
- package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +1 -1
- package/dist/esm/components/views/chart-view/useResourceChartData.js +1 -1
- package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -1
- package/dist/esm/components/views/composite-view/CompositeView.d.ts +6 -0
- package/dist/esm/components/views/composite-view/CompositeView.d.ts.map +1 -1
- package/dist/esm/components/views/composite-view/CompositeView.js +6 -2
- package/dist/esm/components/views/composite-view/CompositeView.js.map +1 -1
- package/dist/esm/components/views/execution-view/ExecutionView.d.ts +7 -0
- package/dist/esm/components/views/execution-view/ExecutionView.d.ts.map +1 -1
- package/dist/esm/components/views/execution-view/ExecutionView.js +11 -1
- package/dist/esm/components/views/execution-view/ExecutionView.js.map +1 -1
- package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts +7 -0
- package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts.map +1 -1
- package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js +6 -2
- package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js.map +1 -1
- package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts +7 -0
- package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts.map +1 -1
- package/dist/esm/components/views/full-custom-view/FullCustomView.js +8 -3
- package/dist/esm/components/views/full-custom-view/FullCustomView.js.map +1 -1
- package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts +7 -0
- package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts.map +1 -1
- package/dist/esm/components/views/onboarding-view/OnboardingView.js +11 -1
- package/dist/esm/components/views/onboarding-view/OnboardingView.js.map +1 -1
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +2 -2
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +2 -2
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +4 -4
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +3 -3
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
- package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts +45 -0
- package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts.map +1 -0
- package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js +72 -0
- package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js.map +1 -0
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts +4 -3
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js +4 -3
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -8
- 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 +22 -21
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/BillingContext.d.ts +27 -4
- package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
- package/dist/esm/core/billing/BillingContext.js +61 -2
- package/dist/esm/core/billing/BillingContext.js.map +1 -1
- package/dist/esm/core/billing/useBillingAction.d.ts.map +1 -1
- package/dist/esm/core/billing/useBillingAction.js +3 -2
- package/dist/esm/core/billing/useBillingAction.js.map +1 -1
- package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts +19 -0
- package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts.map +1 -0
- package/dist/esm/core/components-registry/RegisteredComponentRoot.js +23 -0
- package/dist/esm/core/components-registry/RegisteredComponentRoot.js.map +1 -0
- package/dist/esm/core/components-registry/register-framework-layouts.d.ts.map +1 -1
- package/dist/esm/core/components-registry/register-framework-layouts.js +4 -0
- package/dist/esm/core/components-registry/register-framework-layouts.js.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +159 -0
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.js +68 -3
- 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 +2 -2
- package/dist/esm/core/config/app-level-components.frontend.schemas.js +2 -2
- 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 +59 -18
- package/dist/esm/core/config/chart-view.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/chart-view.frontend.schemas.js +42 -7
- package/dist/esm/core/config/chart-view.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/composite-view.schemas.d.ts +8 -1
- package/dist/esm/core/config/composite-view.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/composite-view.schemas.js +1 -0
- package/dist/esm/core/config/composite-view.schemas.js.map +1 -1
- package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts +1 -1
- package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js +1 -1
- package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js.map +1 -1
- package/dist/esm/core/config/engine-settings-destinations.d.ts +6 -0
- package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
- package/dist/esm/core/config/engine-settings-destinations.js +12 -0
- package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
- package/dist/esm/core/config/execution-view.schemas.d.ts +1 -1
- package/dist/esm/core/config/execution-view.schemas.js.map +1 -1
- package/dist/esm/core/config/identity-portal-settings.frontend.d.ts +17 -0
- package/dist/esm/core/config/identity-portal-settings.frontend.d.ts.map +1 -0
- package/dist/esm/core/config/identity-portal-settings.frontend.js +64 -0
- package/dist/esm/core/config/identity-portal-settings.frontend.js.map +1 -0
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -8
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts +1 -1
- package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/config/settings-hub-gating.frontend.utils.js +1 -1
- package/dist/esm/core/config/settings-hub-gating.frontend.utils.js.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +17 -6
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/useSettingsHubConfig.d.ts.map +1 -1
- package/dist/esm/core/config/useSettingsHubConfig.js +1 -0
- package/dist/esm/core/config/useSettingsHubConfig.js.map +1 -1
- package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts +7 -0
- package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts.map +1 -1
- package/dist/esm/core/config/useVisibleSettingsHubConfig.js +9 -1
- package/dist/esm/core/config/useVisibleSettingsHubConfig.js.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.d.ts +7 -1
- package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.js +31 -0
- package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.js +10 -0
- package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
- package/dist/esm/core/errors/backend-refusal.frontend.d.ts +1 -1
- package/dist/esm/core/errors/backend-refusal.frontend.d.ts.map +1 -1
- package/dist/esm/core/errors/backend-refusal.frontend.js.map +1 -1
- package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
- package/dist/esm/core/events/NotificationContext.js +19 -2
- package/dist/esm/core/events/NotificationContext.js.map +1 -1
- package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts +21 -2
- package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/events/notification-display-policy.frontend.schemas.js +25 -4
- package/dist/esm/core/events/notification-display-policy.frontend.schemas.js.map +1 -1
- package/dist/esm/core/execution/useExecution.d.ts +3 -3
- package/dist/esm/core/execution/useExecution.js.map +1 -1
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +1 -1
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +1 -1
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -1
- package/dist/esm/core/features/FeatureGate.d.ts +13 -1
- package/dist/esm/core/features/FeatureGate.d.ts.map +1 -1
- package/dist/esm/core/features/FeatureGate.js +6 -1
- package/dist/esm/core/features/FeatureGate.js.map +1 -1
- package/dist/esm/core/features/InPlaceFeatureLock.d.ts +28 -0
- package/dist/esm/core/features/InPlaceFeatureLock.d.ts.map +1 -0
- package/dist/esm/core/features/InPlaceFeatureLock.js +49 -0
- package/dist/esm/core/features/InPlaceFeatureLock.js.map +1 -0
- package/dist/esm/core/features/PlanRefusalPrompt.d.ts +12 -0
- package/dist/esm/core/features/PlanRefusalPrompt.d.ts.map +1 -0
- package/dist/esm/core/features/PlanRefusalPrompt.js +90 -0
- package/dist/esm/core/features/PlanRefusalPrompt.js.map +1 -0
- package/dist/esm/core/features/RequiredFeaturesGate.d.ts +39 -0
- package/dist/esm/core/features/RequiredFeaturesGate.d.ts.map +1 -0
- package/dist/esm/core/features/RequiredFeaturesGate.js +51 -0
- package/dist/esm/core/features/RequiredFeaturesGate.js.map +1 -0
- package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts +6 -0
- package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/features/feature-unavailability.frontend.utils.js +27 -10
- package/dist/esm/core/features/feature-unavailability.frontend.utils.js.map +1 -1
- package/dist/esm/core/features/plan-refusal.frontend.d.ts +43 -0
- package/dist/esm/core/features/plan-refusal.frontend.d.ts.map +1 -0
- package/dist/esm/core/features/plan-refusal.frontend.js +67 -0
- package/dist/esm/core/features/plan-refusal.frontend.js.map +1 -0
- package/dist/esm/core/features/required-features-gate-presentation.d.ts +21 -0
- package/dist/esm/core/features/required-features-gate-presentation.d.ts.map +1 -0
- package/dist/esm/core/features/required-features-gate-presentation.js +26 -0
- package/dist/esm/core/features/required-features-gate-presentation.js.map +1 -0
- package/dist/esm/core/features/useFeatureAvailability.d.ts.map +1 -1
- package/dist/esm/core/features/useFeatureAvailability.js +4 -0
- package/dist/esm/core/features/useFeatureAvailability.js.map +1 -1
- package/dist/esm/core/features/useOperationFeatureAvailability.d.ts +2 -0
- package/dist/esm/core/features/useOperationFeatureAvailability.d.ts.map +1 -1
- package/dist/esm/core/features/useOperationFeatureAvailability.js +6 -1
- package/dist/esm/core/features/useOperationFeatureAvailability.js.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +11 -0
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.js +117 -3
- package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
- package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.d.ts.map +1 -1
- package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js +3 -1
- package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.js +28 -9
- package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
- package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.d.ts → core/navigation/chart-read-gate.d.ts} +11 -7
- package/dist/esm/core/navigation/chart-read-gate.d.ts.map +1 -0
- package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.js → core/navigation/chart-read-gate.js} +27 -11
- package/dist/esm/core/navigation/chart-read-gate.js.map +1 -0
- package/dist/esm/core/navigation/home-resolution.d.ts +36 -0
- package/dist/esm/core/navigation/home-resolution.d.ts.map +1 -0
- package/dist/esm/core/navigation/home-resolution.js +46 -0
- package/dist/esm/core/navigation/home-resolution.js.map +1 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -34
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +13 -18
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/launcher-runtime-availability.d.ts +1 -1
- package/dist/esm/core/navigation/launcher-runtime-availability.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-runtime-availability.js +7 -2
- package/dist/esm/core/navigation/launcher-runtime-availability.js.map +1 -1
- package/dist/esm/core/navigation/primary-destination-layout.d.ts +2 -2
- package/dist/esm/core/navigation/primary-destination-layout.d.ts.map +1 -1
- package/dist/esm/core/navigation/primary-destination-layout.js +1 -1
- package/dist/esm/core/navigation/primary-destination-layout.js.map +1 -1
- package/dist/esm/core/navigation/useChartReadDecision.d.ts +26 -0
- package/dist/esm/core/navigation/useChartReadDecision.d.ts.map +1 -0
- package/dist/esm/core/navigation/useChartReadDecision.js +58 -0
- package/dist/esm/core/navigation/useChartReadDecision.js.map +1 -0
- package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts +1 -1
- package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts.map +1 -1
- package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.js.map +1 -1
- package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts +1 -1
- package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts.map +1 -1
- package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.js.map +1 -1
- package/dist/esm/core/navigation/view-title-resolution.d.ts +21 -0
- package/dist/esm/core/navigation/view-title-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/view-title-resolution.js +25 -0
- package/dist/esm/core/navigation/view-title-resolution.js.map +1 -1
- package/dist/esm/core/navigation/viewer-field-reader.d.ts +81 -0
- package/dist/esm/core/navigation/viewer-field-reader.d.ts.map +1 -0
- package/dist/esm/core/navigation/viewer-field-reader.js +113 -0
- package/dist/esm/core/navigation/viewer-field-reader.js.map +1 -0
- package/dist/esm/core/navigation/viewer-roles.d.ts +40 -0
- package/dist/esm/core/navigation/viewer-roles.d.ts.map +1 -0
- package/dist/esm/core/navigation/viewer-roles.js +26 -0
- package/dist/esm/core/navigation/viewer-roles.js.map +1 -0
- package/dist/esm/core/requests/user-interaction-clock.d.ts +32 -0
- package/dist/esm/core/requests/user-interaction-clock.d.ts.map +1 -0
- package/dist/esm/core/requests/user-interaction-clock.js +47 -0
- package/dist/esm/core/requests/user-interaction-clock.js.map +1 -0
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +2 -0
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +27 -6
- 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 +30 -7
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -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 +13 -0
- package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/hooks/useOperationEnabled.d.ts.map +1 -1
- package/dist/esm/core/resources/hooks/useOperationEnabled.js +4 -0
- package/dist/esm/core/resources/hooks/useOperationEnabled.js.map +1 -1
- package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts +1 -1
- package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/resource-addressability.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.js +2 -0
- package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts +29 -23
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.js +20 -20
- 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 +4 -0
- package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.js +7 -7
- package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +11 -33
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts +15 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.js +41 -23
- package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
- package/dist/esm/core/runtime/IdentityPortalRouter.d.ts +20 -0
- package/dist/esm/core/runtime/IdentityPortalRouter.d.ts.map +1 -0
- package/dist/esm/core/runtime/IdentityPortalRouter.js +31 -0
- package/dist/esm/core/runtime/IdentityPortalRouter.js.map +1 -0
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +9 -0
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js +3 -2
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
- package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts +21 -0
- package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts.map +1 -1
- package/dist/esm/core/runtime/frontend-companion-resource-inputs.js +19 -1
- package/dist/esm/core/runtime/frontend-companion-resource-inputs.js.map +1 -1
- package/dist/esm/core/runtime/identity-routes.d.ts +13 -0
- package/dist/esm/core/runtime/identity-routes.d.ts.map +1 -0
- package/dist/esm/core/runtime/identity-routes.js +50 -0
- package/dist/esm/core/runtime/identity-routes.js.map +1 -0
- package/dist/esm/core/runtime/routes.frontend.definitions.d.ts +19 -0
- package/dist/esm/core/runtime/routes.frontend.definitions.d.ts.map +1 -1
- package/dist/esm/core/runtime/routes.frontend.definitions.js +20 -1
- package/dist/esm/core/runtime/routes.frontend.definitions.js.map +1 -1
- package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts +3 -1
- package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/runtime/runtime.frontend.schemas.js +2 -0
- package/dist/esm/core/runtime/runtime.frontend.schemas.js.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts +7 -0
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.js +4 -2
- package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.js +4 -0
- package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.d.ts +3 -2
- package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.js +7 -2
- package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
- package/dist/esm/core/security/federated-reauthentication.frontend.d.ts +13 -2
- package/dist/esm/core/security/federated-reauthentication.frontend.d.ts.map +1 -1
- package/dist/esm/core/security/federated-reauthentication.frontend.js +21 -1
- package/dist/esm/core/security/federated-reauthentication.frontend.js.map +1 -1
- package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts +24 -0
- package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts.map +1 -0
- package/dist/esm/core/security/useAuthenticatedRouteEntry.js +37 -0
- package/dist/esm/core/security/useAuthenticatedRouteEntry.js.map +1 -0
- package/dist/esm/core/ui/design-token.utils.d.ts +9 -0
- package/dist/esm/core/ui/design-token.utils.d.ts.map +1 -1
- package/dist/esm/core/ui/design-token.utils.js +24 -3
- package/dist/esm/core/ui/design-token.utils.js.map +1 -1
- package/dist/esm/core/ui/themes/focus-indicator.d.ts +1 -1
- package/dist/esm/core/ui/themes/focus-indicator.js +1 -1
- package/dist/esm/core/ui/themes/focus-indicator.js.map +1 -1
- package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/index.d.ts +14 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/testing/mock-builders.d.ts +1 -1
- package/dist/esm/testing/mock-builders.d.ts.map +1 -1
- package/dist/esm/testing/mock-builders.js +1 -0
- package/dist/esm/testing/mock-builders.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -6
- package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.d.ts.map +0 -1
- package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,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CAAC;gBAC/C,OAAO,EAAE,CACP,KAAC,qBAAqB,IACpB,YAAY,EAAE,EAAE,CAAC,KAAK,EACtB,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAC/C,CACH;aACF,CAAC,CAAC,CAAC;YAEJ,OAAO,CACL,KAAC,uBAAuB,IAEtB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,MAAM,IAFT,SAAS,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,CAGjC,CACH,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,EACrC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { z } from 'zod';\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { responsiveMaxWidthToCssValue } from '../../sections/surface';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ErrorBoundary } from '~wildo-frontend-lib/core/errors/ErrorBoundary';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport {\n FormLayoutSlotContext,\n type FormLayoutSlotType,\n} from './FormLayoutSlotContext';\nimport { FormErrorSummarySlot } from './FormErrorSummarySlot';\nimport { SubmitButton } from './SubmitButton';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalResourceFormActions } from '../../form/automated/ResourceFormActionsContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { listPlacedFieldSlots } from './SectionFieldsContext';\nimport { useTemplatePlacedFieldsOf } from '../../form/automated/TemplatePlacedFieldsContext';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { GroupedSectionHostKind } from './Section.shared';\n\nexport interface FormLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the form column lets its content grow, named in the framework's own vocabulary.\n *\n * Defaults to `'measure'` — the reading-measure cap (~42rem, themeable via `--measure-max-width`)\n * that keeps a single-column form readable rather than stretched edge to edge. That default is the\n * long-standing behaviour and is what almost every form wants.\n *\n * The prop exists so the tier is REACHABLE. It was previously a literal Tailwind class spelling the\n * same value the `'measure'` tier already names, which meant a host could not select a different one\n * — see {@link DisplayLayout}'s twin, where a composed template needed `'none'` and had no way to\n * ask for it.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n /**\n * Context field values to inject into form state.\n * Fields present here are hidden from rendering but populate\n * the form state for validation and submission (e.g., parent IDs).\n */\n contextFieldValues?: Record<string, unknown>;\n /**\n * When `false`, suppresses automatic `<SubmitButton>` injection even if no\n * submit slot is registered by children. The generated-template path sets\n * this via `generateDefaultFormTemplate({ includeSubmitButton: false })`.\n *\n * Note: under `ResourceAutomatedForm`, suppression is automatic regardless\n * of this prop — the host provides `ResourceFormActionsContext` and renders\n * its own operation-aware submit row after the template, so developer-\n * authored templates can use a bare `<FormLayout>` without ending up with\n * two submit buttons. This prop only matters for standalone usage\n * (direct `AutomatedForm` callers outside a resource form host).\n * @default true\n */\n autoInjectSubmitButton?: boolean;\n children?: ReactNode;\n}\n\ninterface AutoSlotsState {\n errorSummary: boolean;\n submitButton: boolean;\n}\n\n/**\n * Root wrapper for edit layout templates.\n *\n * Renders inside `<Form>` (RHF provider). Handles:\n * - Root `FieldScopeContext` with empty prefix\n * - Slot auto-detection: default error summary / submit when omitted (DT-6); no default submit under wizard,\n * nor when a resource-form host owns the submit row (`ResourceFormActionsContext` present —\n * `ResourceAutomatedForm` appends its operation-aware buttons after the template)\n * - Guidance marker for automated testing (DT-9)\n *\n * TODO(F-10): AutoFocus resolution — scan children for first focusable FormField and call focus().\n * Note: `contextFieldValues` are injected upstream by `AutomatedForm`; generated\n * templates hide those fields before rendering, while handwritten templates can\n * still opt into custom treatment when needed.\n *\n * @example\n * ```tsx\n * <FormLayout>\n * <Section name=\"general\">\n * <FormField name=\"title\" />\n * </Section>\n * <SubmitButton />\n * </FormLayout>\n * ```\n */\nexport function FormLayout({\n className,\n children,\n contextFieldValues: _contextFieldValues,\n autoInjectSubmitButton = true,\n responsiveMaxWidth = 'measure',\n}: FormLayoutProps): ReactNode {\n const registeredSlots = useRef(new Set<FormLayoutSlotType>());\n const wizardRootRegistered = useRef(false);\n const [autoSlots, setAutoSlots] = useState<AutoSlotsState>({\n errorSummary: false,\n submitButton: false,\n });\n\n // A non-null ResourceFormActionsContext means a resource-form host\n // (ResourceAutomatedForm) renders its own operation-aware submit row after\n // the template — auto-injecting a generic SubmitButton here would produce a\n // second submit button. Explicit templates authored app-side use a bare\n // <FormLayout>, so this suppression cannot be a prop on the call site.\n const hostOwnsSubmitRow = useOptionalResourceFormActions() !== null;\n\n const registerSlot = useCallback((slot: FormLayoutSlotType) => {\n registeredSlots.current.add(slot);\n }, []);\n\n const registerWizardRoot = useCallback(() => {\n wizardRootRegistered.current = true;\n }, []);\n\n const slotContextValue = useMemo(\n () => ({ registerSlot, registerWizardRoot }),\n [registerSlot, registerWizardRoot],\n );\n\n // After children mount and register their slots, detect missing ones (next frame so layout effects have run).\n useLayoutEffect(() => {\n const frame = requestAnimationFrame(() => {\n const missing: AutoSlotsState = {\n errorSummary: !registeredSlots.current.has('errorSummary'),\n submitButton:\n autoInjectSubmitButton &&\n !hostOwnsSubmitRow &&\n !wizardRootRegistered.current &&\n !registeredSlots.current.has('submitButton'),\n };\n if (missing.errorSummary || missing.submitButton) {\n setAutoSlots(missing);\n }\n });\n return () => cancelAnimationFrame(frame);\n }, [autoInjectSubmitButton, hostOwnsSubmitRow]);\n\n const formCtx = useOptionalFormTemplateContext();\n // Every slot among this layout's children, read from the elements: a tab's panel, a later wizard step\n // or an unchosen variant is not mounted, so its fields cannot report themselves (see\n // `TemplatePlacedFieldsContext`). From an empty prefix: this layout resets its children's scope to \"\".\n useTemplatePlacedFieldsOf(children, '');\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, formCtx),\n [children, formCtx],\n );\n\n return (\n <FormLayoutSlotContext.Provider value={slotContextValue}>\n {/* A form keeps the heading voice for its sections even inside a read body (an inline editor) — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={undefined}>\n <FieldScopeProvider pathPrefix=\"\">\n {/*\n T4c — reading-measure cap. A single-column form column caps at\n `--measure-max-width` (~42rem) and aligns to the LEFT of the content\n zone, so detail/settings forms stop stretching edge-to-edge while\n staying flush with the left-aligned resource header (no centred\n gutter). `max-w` only engages when the container is wider than the\n measure, so a form inside a narrow dialog / panel is unaffected.\n Retune/opt-out via the CSS var or by overriding `className`.\n */}\n <div\n className={cn('mr-auto w-full', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n data-inline-size-tier={responsiveMaxWidth}\n data-guidance-form=\"\"\n // A RESOURCE form, as opposed to any other form on the page (a listing's search box, a chat\n // composer): what automation waits on when it opens a record for editing.\n data-slot=\"form-layout\"\n >\n <ErrorBoundary>\n {autoSlots.errorSummary ? <FormErrorSummarySlot className=\"mb-4\" /> : null}\n {/* `space-y-section` separates stacked SECTIONS with a clear gap (see\n DisplayLayout for the rationale). Wrapped separately from the\n error-summary / submit slots so it never compounds their own\n margins. Bare SETTINGS_ROW field rows are self-delimiting list\n items (`py-card-sm` + `border-b`), so consecutive rows stack\n FLUSH — same pairwise rule as DisplayLayout (see its comment for\n why the attribute match must be `^=settings`, never the\n underscore-carrying `=settings_row`). */}\n <div className=\"space-y-section [&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0\">{renderedChildren}</div>\n {autoSlots.submitButton ? <SubmitButton className=\"mt-6\" /> : null}\n </ErrorBoundary>\n </div>\n </FieldScopeProvider>\n </SectionLegendVoiceHost>\n </FormLayoutSlotContext.Provider>\n );\n}\n\n/**\n * Whether a GROUPED section (grid, tabs, accordion, …) has nothing to show for this form's operation.\n *\n * One template serves several operations, and a `FormField` whose field the operation's schema lacks\n * renders nothing. A solo `Section` hides itself from what its fields report once mounted; a grouped\n * section cannot, because its container draws its title and panel and a tab's panel is not even mounted\n * until it is chosen. So the host decides from the section's elements: when they are only field slots\n * (`listPlacedFieldSlots`) and none of their paths resolves in the form's schema, the section is dropped.\n *\n * This reads the SCHEMA, not visibility: a field hidden by a condition is still in the schema, so its\n * section stays. Dropping a section there would take it out of its container on a value change.\n */\nfunction groupedSectionShowsNoField(children: ReactNode, schema: z.ZodTypeAny | undefined): boolean {\n if (!schema) return false;\n const placed = listPlacedFieldSlots(children);\n return placed !== null\n && placed.length > 0\n && placed.every((slot) => !slot.hasOwnSchema && AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path) === undefined);\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n formCtx: ReturnType<typeof useOptionalFormTemplateContext>,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n // A grouped section none of whose fields this operation has is dropped from its container, and a\n // container left with no section renders nothing (see `groupedSectionShowsNoField`).\n const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema));\n if (shownSections.length === 0) return null;\n const group = { ...item.group, sections: shownSections };\n const config = buildSectionConfigFromGroup(group);\n const sectionLabels = formCtx?.sectionLabels ?? {};\n const sectionDescriptions = formCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (chromeMode, saveable) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'saveable' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.FORM}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FormLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,qBAAqB,GAEtB,MAAM,yBAAy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EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { z } from 'zod';\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { responsiveMaxWidthToCssValue } from '../../sections/surface';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ErrorBoundary } from '~wildo-frontend-lib/core/errors/ErrorBoundary';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport {\n FormLayoutSlotContext,\n type FormLayoutSlotType,\n} from './FormLayoutSlotContext';\nimport { FormErrorSummarySlot } from './FormErrorSummarySlot';\nimport { SubmitButton } from './SubmitButton';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalResourceFormActions } from '../../form/automated/ResourceFormActionsContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { listPlacedFieldSlots } from './SectionFieldsContext';\nimport { CoreResourceOperation, type FieldReader } from '@wildo-ai/saas-models';\nimport { useViewerFieldReader, viewerMaySeeFieldOnPath } from '~wildo-frontend-lib/core/navigation/viewer-field-reader';\nimport { useOptionalFormSchemaContext } from '~wildo-frontend-lib/components/form/useFormSchemaContext';\nimport { useTemplatePlacedFieldsOf } from '../../form/automated/TemplatePlacedFieldsContext';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { GroupedSectionHostKind } from './Section.shared';\n\nexport interface FormLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the form column lets its content grow, named in the framework's own vocabulary.\n *\n * Defaults to `'measure'` — the reading-measure cap (~42rem, themeable via `--measure-max-width`)\n * that keeps a single-column form readable rather than stretched edge to edge. That default is the\n * long-standing behaviour and is what almost every form wants.\n *\n * The prop exists so the tier is REACHABLE. It was previously a literal Tailwind class spelling the\n * same value the `'measure'` tier already names, which meant a host could not select a different one\n * — see {@link DisplayLayout}'s twin, where a composed template needed `'none'` and had no way to\n * ask for it.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n /**\n * Context field values to inject into form state.\n * Fields present here are hidden from rendering but populate\n * the form state for validation and submission (e.g., parent IDs).\n */\n contextFieldValues?: Record<string, unknown>;\n /**\n * When `false`, suppresses automatic `<SubmitButton>` injection even if no\n * submit slot is registered by children. The generated-template path sets\n * this via `generateDefaultFormTemplate({ includeSubmitButton: false })`.\n *\n * Note: under `ResourceAutomatedForm`, suppression is automatic regardless\n * of this prop — the host provides `ResourceFormActionsContext` and renders\n * its own operation-aware submit row after the template, so developer-\n * authored templates can use a bare `<FormLayout>` without ending up with\n * two submit buttons. This prop only matters for standalone usage\n * (direct `AutomatedForm` callers outside a resource form host).\n * @default true\n */\n autoInjectSubmitButton?: boolean;\n children?: ReactNode;\n}\n\ninterface AutoSlotsState {\n errorSummary: boolean;\n submitButton: boolean;\n}\n\n/**\n * Root wrapper for edit layout templates.\n *\n * Renders inside `<Form>` (RHF provider). Handles:\n * - Root `FieldScopeContext` with empty prefix\n * - Slot auto-detection: default error summary / submit when omitted (DT-6); no default submit under wizard,\n * nor when a resource-form host owns the submit row (`ResourceFormActionsContext` present —\n * `ResourceAutomatedForm` appends its operation-aware buttons after the template)\n * - Guidance marker for automated testing (DT-9)\n *\n * TODO(F-10): AutoFocus resolution — scan children for first focusable FormField and call focus().\n * Note: `contextFieldValues` are injected upstream by `AutomatedForm`; generated\n * templates hide those fields before rendering, while handwritten templates can\n * still opt into custom treatment when needed.\n *\n * @example\n * ```tsx\n * <FormLayout>\n * <Section name=\"general\">\n * <FormField name=\"title\" />\n * </Section>\n * <SubmitButton />\n * </FormLayout>\n * ```\n */\nexport function FormLayout({\n className,\n children,\n contextFieldValues: _contextFieldValues,\n autoInjectSubmitButton = true,\n responsiveMaxWidth = 'measure',\n}: FormLayoutProps): ReactNode {\n const registeredSlots = useRef(new Set<FormLayoutSlotType>());\n const wizardRootRegistered = useRef(false);\n const [autoSlots, setAutoSlots] = useState<AutoSlotsState>({\n errorSummary: false,\n submitButton: false,\n });\n\n // A non-null ResourceFormActionsContext means a resource-form host\n // (ResourceAutomatedForm) renders its own operation-aware submit row after\n // the template — auto-injecting a generic SubmitButton here would produce a\n // second submit button. Explicit templates authored app-side use a bare\n // <FormLayout>, so this suppression cannot be a prop on the call site.\n const hostOwnsSubmitRow = useOptionalResourceFormActions() !== null;\n\n const registerSlot = useCallback((slot: FormLayoutSlotType) => {\n registeredSlots.current.add(slot);\n }, []);\n\n const registerWizardRoot = useCallback(() => {\n wizardRootRegistered.current = true;\n }, []);\n\n const slotContextValue = useMemo(\n () => ({ registerSlot, registerWizardRoot }),\n [registerSlot, registerWizardRoot],\n );\n\n // After children mount and register their slots, detect missing ones (next frame so layout effects have run).\n useLayoutEffect(() => {\n const frame = requestAnimationFrame(() => {\n const missing: AutoSlotsState = {\n errorSummary: !registeredSlots.current.has('errorSummary'),\n submitButton:\n autoInjectSubmitButton &&\n !hostOwnsSubmitRow &&\n !wizardRootRegistered.current &&\n !registeredSlots.current.has('submitButton'),\n };\n if (missing.errorSummary || missing.submitButton) {\n setAutoSlots(missing);\n }\n });\n return () => cancelAnimationFrame(frame);\n }, [autoInjectSubmitButton, hostOwnsSubmitRow]);\n\n const formCtx = useOptionalFormTemplateContext();\n // Every slot among this layout's children, read from the elements: a tab's panel, a later wizard step\n // or an unchosen variant is not mounted, so its fields cannot report themselves (see\n // `TemplatePlacedFieldsContext`). From an empty prefix: this layout resets its children's scope to \"\".\n useTemplatePlacedFieldsOf(children, '');\n // The viewer and the operation, for the grouped sections none of whose fields it is offered (#4459 review D1).\n const fieldReader = useViewerFieldReader();\n const operationType = useOptionalFormSchemaContext()?.operationType;\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, formCtx, { fieldReader, operationType }),\n [children, formCtx, fieldReader, operationType],\n );\n\n return (\n <FormLayoutSlotContext.Provider value={slotContextValue}>\n {/* A form keeps the heading voice for its sections even inside a read body (an inline editor) — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={undefined}>\n <FieldScopeProvider pathPrefix=\"\">\n {/*\n T4c — reading-measure cap. A single-column form column caps at\n `--measure-max-width` (~42rem) and aligns to the LEFT of the content\n zone, so detail/settings forms stop stretching edge-to-edge while\n staying flush with the left-aligned resource header (no centred\n gutter). `max-w` only engages when the container is wider than the\n measure, so a form inside a narrow dialog / panel is unaffected.\n Retune/opt-out via the CSS var or by overriding `className`.\n */}\n <div\n className={cn('mr-auto w-full', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n data-inline-size-tier={responsiveMaxWidth}\n data-guidance-form=\"\"\n // A RESOURCE form, as opposed to any other form on the page (a listing's search box, a chat\n // composer): what automation waits on when it opens a record for editing.\n data-slot=\"form-layout\"\n >\n <ErrorBoundary>\n {autoSlots.errorSummary ? <FormErrorSummarySlot className=\"mb-4\" /> : null}\n {/* `space-y-section` separates stacked SECTIONS with a clear gap (see\n DisplayLayout for the rationale). Wrapped separately from the\n error-summary / submit slots so it never compounds their own\n margins. Bare SETTINGS_ROW field rows are self-delimiting list\n items (`py-card-sm` + `border-b`), so consecutive rows stack\n FLUSH — same pairwise rule as DisplayLayout (see its comment for\n why the attribute match must be `^=settings`, never the\n underscore-carrying `=settings_row`). */}\n <div className=\"space-y-section [&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0\">{renderedChildren}</div>\n {autoSlots.submitButton ? <SubmitButton className=\"mt-6\" /> : null}\n </ErrorBoundary>\n </div>\n </FieldScopeProvider>\n </SectionLegendVoiceHost>\n </FormLayoutSlotContext.Provider>\n );\n}\n\n/**\n * Whether a GROUPED section (grid, tabs, accordion, …) has nothing to show for this form's operation.\n *\n * One template serves several operations, and a `FormField` whose field the operation's schema lacks\n * renders nothing. A solo `Section` hides itself from what its fields report once mounted; a grouped\n * section cannot, because its container draws its title and panel and a tab's panel is not even mounted\n * until it is chosen. So the host decides from the section's elements: when they are only field slots\n * (`listPlacedFieldSlots`) and none of their paths resolves in the form's schema, the section is dropped.\n *\n * A field the viewer may not read (`.readableBy`, or under such an ancestor) is not offered either, outside a CREATE\n * form, exactly as `FormField` decides it (#4459 review D1); so a section of only such fields is dropped too.\n *\n * This reads the SCHEMA and the VIEWER, not visibility: a field hidden by a condition is still in the schema, so its\n * section stays. Dropping a section there would take it out of its container on a value change.\n */\nfunction groupedSectionShowsNoField(children: ReactNode, schema: z.ZodTypeAny | undefined, viewer: GroupedSectionViewer): boolean {\n if (!schema) return false;\n const placed = listPlacedFieldSlots(children);\n return placed !== null\n && placed.length > 0\n && placed.every((slot) => {\n if (slot.hasOwnSchema) return false;\n const fieldSchema = AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path);\n return fieldSchema === undefined\n || (viewer.operationType !== CoreResourceOperation.CREATE\n && !viewerMaySeeFieldOnPath(fieldSchema, slot.path, (prefix) => AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, prefix), viewer.fieldReader));\n });\n}\n\n/** Who the form is shown to, and for which operation: what decides whether a field the viewer may not read is offered. */\ninterface GroupedSectionViewer {\n readonly fieldReader: FieldReader;\n readonly operationType: string | undefined;\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n formCtx: ReturnType<typeof useOptionalFormTemplateContext>,\n viewer: GroupedSectionViewer,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n // A grouped section none of whose fields this operation has is dropped from its container, and a\n // container left with no section renders nothing (see `groupedSectionShowsNoField`).\n const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema, viewer));\n if (shownSections.length === 0) return null;\n const group = { ...item.group, sections: shownSections };\n const config = buildSectionConfigFromGroup(group);\n const sectionLabels = formCtx?.sectionLabels ?? {};\n const sectionDescriptions = formCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (chromeMode, saveable) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'saveable' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.FORM}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
|
|
@@ -118,7 +118,7 @@ export interface ResourceHeaderTitleProps {
|
|
|
118
118
|
*
|
|
119
119
|
* `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a
|
|
120
120
|
* listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once
|
|
121
|
-
* left generated screens with no level-one heading at all
|
|
121
|
+
* left generated screens with no level-one heading at all). `h2` under a host section that owns
|
|
122
122
|
* the heading. The level is structure; the recipe is appearance, and the two are decoupled.
|
|
123
123
|
*/
|
|
124
124
|
export declare function ResourceHeaderTitleHeading({ title, hostProvidesHeading, className, }: {
|
|
@@ -71,7 +71,7 @@ export function useOptionalResourceHeaderContext() {
|
|
|
71
71
|
*
|
|
72
72
|
* `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a
|
|
73
73
|
* listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once
|
|
74
|
-
* left generated screens with no level-one heading at all
|
|
74
|
+
* left generated screens with no level-one heading at all). `h2` under a host section that owns
|
|
75
75
|
* the heading. The level is structure; the recipe is appearance, and the two are decoupled.
|
|
76
76
|
*/
|
|
77
77
|
export function ResourceHeaderTitleHeading({ title, hostProvidesHeading, className, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceHeaderTitle.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/ResourceHeaderTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,kDAAkD,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AA8DhF,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAOrF,8EAA8E;AAC9E,MAAM,UAAU,6BAA6B,CAAC,EAC5C,KAAK,EACL,QAAQ,GAC2B;IACnC,OAAO,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAkC,CAAC;AACnG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC;I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CAAC,iBAAiB,CAAC,YAAY,GAAG,IAAI,CAAC;IAE5E,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,CAAC;IAC5B,MAAM,OAAO,GAAG,KAAK;QACnB,CAAC,CAAC,KAAC,0BAA0B,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,GAAI;QACtH,gGAAgG;QAChG,uDAAuD;QACvD,CAAC,CAAC,MAAM,EAAE,YAAY;YACpB,CAAC,CAAC,KAAC,8BAA8B,KAAG;YACpC,CAAC,CAAC,IAAI,CAAC;IACX,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,sGAAsG;IACtG,IAAI,MAAM,EAAE,WAAW,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAE,QAAQ,EAAiC;IAC/E,MAAM,MAAM,GAAG,gCAAgC,EAAE,CAAC;IAClD,IAAI,MAAM,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IACD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC","sourcesContent":["'use client';\n\n/**\n * ResourceHeaderTitle — the record's page TITLE as a first-class, composable\n * element of an authored `layout.header` template.\n *\n * ## Why the header needs a template flow at all\n *\n * The READ page header owns a fixed band: back button, breadcrumb, resource\n * icon, the record's name, and the operation action cluster. Everything a\n * resource wanted to show ABOUT the record (a status badge, a visibility\n * marker, an accent colour) could previously only render in the `layout.display`\n * body BELOW that band — so the identity line said the record's name and nothing\n * else, while \"is this archived? is it public?\" sat in a separate labelled strip\n * underneath.\n *\n * `layout.header` closes that by letting the resource compose the middle of the\n * band itself. It is the same shape the SUMMARY surface already uses\n * (`SummaryLayout` / `SummaryTitle`), for the same reason recorded there: a\n * host-owned title plus a bolt-on accessory slot cannot express \"badge AFTER the\n * name\" or \"swatch BEFORE it\", whereas a template that places the title element\n * itself can express any of them with no extra config axis.\n *\n * ## Contract\n *\n * The header cedes the record's identity to the template the moment `layout.header`\n * exists, so a template that never mounts `<ResourceHeaderTitle />` renders a\n * page with NO record name. That is loud in development (see the diagnostic in\n * `ResourceLayout_Header`) rather than silent.\n *\n * ## Where the title lands (2026-09-30)\n *\n * The header is three lines: a bar (back, breadcrumb, a pane's own controls), the TITLE LINE (the\n * name and the record's actions), and the FACTS line (the rest of the template: status, priority,\n * the parent chip). A template places `<ResourceHeaderTitle />` among its facts as it always did; the\n * header renders the title on the title line and the rest of the template on the facts line. So the\n * name always sits beside the actions it is the subject of, and the facts never push the actions off\n * the name's line, which is what a single wrapping row did: measured on Wonder Todos, a todo in the\n * split pane had its title 41px above its own back arrow and actions.\n *\n * Renders nothing when the host resolved no label (a surface that shows a\n * generic operation title rather than one record's name) — the presence of a\n * label is the single data-driven signal that there is a title to place.\n */\n\nimport React, { createContext, useContext } from 'react';\nimport { createPortal } from 'react-dom';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\n\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { defaultTheme } from '~wildo-frontend-lib/core/ui/themes/default.theme';\n\n// =============================================================================\n// CONTEXT\n// =============================================================================\n\nexport interface ResourceHeaderContextValue {\n /** Resource type key of the record whose header is rendering. */\n resourceType: string;\n\n /**\n * Resolved record title (the `getFrontendResourceLabel` result, or the\n * operation/resource title fallback), or `null` when this surface has no\n * record-specific name to show — `<ResourceHeaderTitle />` then renders nothing.\n */\n title: string | null;\n\n /**\n * `true` while the record's name is still being fetched and nothing else stands in for it.\n * `<ResourceHeaderTitle />` then RESERVES the title's line with a skeleton instead of rendering\n * nothing.\n *\n * An empty band is a defect, not a flicker. The header withholds the label during the first fetch\n * on purpose (it would otherwise flash `#id` and then the real name), and the title element used to\n * render nothing meanwhile — so the band had no height and the name's arrival pushed everything\n * beneath it down by a line. Measured 2026-09-21 in the creation workbench's actor-task modal:\n * `mousedown` landed on a tab, the record arrived, `mouseup` one millisecond later landed on the\n * heading, and the browser dispatched the click to their common ancestor. The tab never changed\n * and nothing reported why.\n */\n titlePending?: boolean;\n\n /**\n * Dev-diagnostic seam: `<ResourceHeaderTitle />` flips `titleMounted` when it\n * renders, letting the header detect an authored template that never places\n * the title. Mutable-ref shape (not state) on purpose — the flag is read only\n * after render and must never schedule a re-render.\n */\n titleMountTracker?: { titleMounted: boolean };\n\n /**\n * `true` when an enclosing section already renders the heading for this region (an embedded READ inside\n * a host section). The record's name is then not the PAGE title, so `<ResourceHeaderTitle />` renders an\n * `h2` beneath the host's heading instead of a second `h1` — the same rule the default header applies.\n */\n hostProvidesHeading?: boolean;\n\n /**\n * The header's TITLE LINE, when the header has one: `<ResourceHeaderTitle />` renders the name THERE,\n * beside the record's actions, instead of in the template's own flow (the facts line). `undefined`\n * means the template's own flow (a template previewed outside a header); `null` means the line is\n * not attached yet — the title then renders nothing for the one layout pass it takes to attach.\n */\n titleTarget?: HTMLElement | null;\n\n /**\n * The header's LEADING slot on the title line, just before the name: `<ResourceHeaderLeading>` renders\n * there. Same `undefined` / `null` reading as {@link titleTarget}.\n */\n leadingTarget?: HTMLElement | null;\n}\n\nconst ResourceHeaderContext = createContext<ResourceHeaderContextValue | null>(null);\n\nexport interface ResourceHeaderContextProviderProps {\n value: ResourceHeaderContextValue;\n children: React.ReactNode;\n}\n\n/** Provides the resolved record title to an authored header template tree. */\nexport function ResourceHeaderContextProvider({\n value,\n children,\n}: ResourceHeaderContextProviderProps): React.JSX.Element {\n return <ResourceHeaderContext.Provider value={value}>{children}</ResourceHeaderContext.Provider>;\n}\n\n/**\n * Read the header context, or `null` when a header template is rendered outside\n * `ResourceLayout_Header` (e.g. previewed in isolation).\n */\nexport function useOptionalResourceHeaderContext(): ResourceHeaderContextValue | null {\n return useContext(ResourceHeaderContext);\n}\n\n// =============================================================================\n// TITLE ELEMENT\n// =============================================================================\n\n/** @wildo_source:part:start saas.frontend.resource-header-title facet:layer:frontend facet:family:resource-ui */\nexport interface ResourceHeaderTitleProps {\n /** Extra classes merged over the theme's resource-title typography. */\n className?: string;\n}\n\n/**\n * The name a resource page is about, set in the theme's `TypographyVariant.RESOURCE_TITLE` voice —\n * quieter than a document heading, because it shares its line with the record's actions. Used by the\n * header's default title and by `<ResourceHeaderTitle />`, so authoring a header template never\n * changes how the title looks.\n *\n * ## It is a real heading, and the level is not cosmetic\n *\n * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a\n * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once\n * left generated screens with no level-one heading at all, #533). `h2` under a host section that owns\n * the heading. The level is structure; the recipe is appearance, and the two are decoupled.\n */\nexport function ResourceHeaderTitleHeading({\n title,\n hostProvidesHeading,\n className,\n}: {\n title: string;\n hostProvidesHeading?: boolean;\n className?: string;\n}): React.JSX.Element {\n // `min-w-0` + truncate so a long record name shrinks rather than pushing the actions off its line.\n const classes = cn('min-w-0 truncate', useResourceTitleVoice(), className);\n return hostProvidesHeading\n ? <h2 className={classes}>{title}</h2>\n : <h1 className={classes}>{title}</h1>;\n}\n\n/**\n * The line a resource title holds while the name is on its way: one skeleton exactly one line box of\n * the theme's `RESOURCE_TITLE` voice tall. It is set in that voice and sized in `lh`, so it matches the\n * real title's line in every theme (text-lg by default, text-xl in cozy and editorial, text-base in\n * dense) and the name's arrival moves nothing beneath it. A fixed height could match only one theme.\n *\n * For a custom header preset: render it where the title will land while the name is on its way.\n * `<ResourceHeaderTitle />` already uses it, so a header TEMPLATE never needs to.\n */\nexport function ResourceHeaderTitlePlaceholder({ className }: { className?: string }): React.JSX.Element {\n return (\n <div className={cn('min-w-0', useResourceTitleVoice(), className)} aria-hidden=\"true\" data-resource-header-title-pending=\"true\">\n <Skeleton className=\"h-[1lh] w-48 max-w-full\" />\n </div>\n );\n}\n\n/**\n * The theme's resource-title typography classes. Read defensively: a header template can be previewed\n * outside the app's `UIProvider`, and a title must not throw there. Without a theme it takes the default\n * theme's voice.\n */\nfunction useResourceTitleVoice(): string | undefined {\n const ui = useContext(UIContext);\n const recipe = ui\n ? ui.getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.RESOURCE_TITLE)\n : defaultTheme.typography?.[TypographyVariant.RESOURCE_TITLE];\n return recipe?.base;\n}\n\n/**\n * The record's name, placed by an authored `layout.header` template. Inside a resource header it\n * renders on the header's title line, beside the record's actions (see \"Where the title lands\"\n * above); the rest of the template stays on the facts line below.\n */\nexport function ResourceHeaderTitle({ className }: ResourceHeaderTitleProps): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n // Register with the missing-title diagnostic BEFORE the empty-title early\n // return: mounting the element discharges the template's contract even when\n // this particular record resolves no label (data-driven, not an authoring bug).\n if (header?.titleMountTracker) header.titleMountTracker.titleMounted = true;\n\n const title = header?.title;\n const element = title\n ? <ResourceHeaderTitleHeading title={title} hostProvidesHeading={header?.hostProvidesHeading} className={className} />\n // A name that is on its way reserves its line, so its arrival moves nothing beneath the header;\n // a surface with no name at all still renders nothing.\n : header?.titlePending\n ? <ResourceHeaderTitlePlaceholder />\n : null;\n if (!element) return null;\n\n // Inside a header: onto its title line. `null` = the line is attaching; render nothing for that pass.\n if (header?.titleTarget !== undefined) {\n return header.titleTarget ? createPortal(element, header.titleTarget) : null;\n }\n return element;\n}\n/**\n * Something that belongs BEFORE the record's name on the title line — an accent swatch, a family glyph —\n * placed by an authored `layout.header` template:\n *\n * ```tsx\n * header: () => (\n * <div className=\"flex min-w-0 flex-wrap items-center gap-field\">\n * <ResourceHeaderLeading><span className=\"size-3 rounded-full\" style={{ background: color }} /></ResourceHeaderLeading>\n * <ResourceHeaderTitle />\n * <DisplayField name=\"status\" labelPlacement=\"hidden\" hideDescription className=\"w-auto\" />\n * </div>\n * ),\n * ```\n *\n * The header lifts the title onto its title line and leaves the rest of the template on the facts line\n * below, so an element a template puts before the title stays with the facts unless it says it leads the\n * name. That is this: inside a header it renders just before the name; outside one (a template previewed\n * in isolation) it renders where it is written. A resource whose glyph replaces the resource icon\n * (`HeaderIconPlacement.TEMPLATE_OWNED`) places it here, so the title line keeps a glyph.\n */\nexport function ResourceHeaderLeading({ children }: { children: React.ReactNode }): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n if (header?.leadingTarget !== undefined) {\n return header.leadingTarget ? createPortal(children, header.leadingTarget) : null;\n }\n return <>{children}</>;\n}\n/** @wildo_source:part:end saas.frontend.resource-header-title */\n"]}
|
|
1
|
+
{"version":3,"file":"ResourceHeaderTitle.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/ResourceHeaderTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,kDAAkD,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AA8DhF,MAAM,qB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,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IACD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC","sourcesContent":["'use client';\n\n/**\n * ResourceHeaderTitle — the record's page TITLE as a first-class, composable\n * element of an authored `layout.header` template.\n *\n * ## Why the header needs a template flow at all\n *\n * The READ page header owns a fixed band: back button, breadcrumb, resource\n * icon, the record's name, and the operation action cluster. Everything a\n * resource wanted to show ABOUT the record (a status badge, a visibility\n * marker, an accent colour) could previously only render in the `layout.display`\n * body BELOW that band — so the identity line said the record's name and nothing\n * else, while \"is this archived? is it public?\" sat in a separate labelled strip\n * underneath.\n *\n * `layout.header` closes that by letting the resource compose the middle of the\n * band itself. It is the same shape the SUMMARY surface already uses\n * (`SummaryLayout` / `SummaryTitle`), for the same reason recorded there: a\n * host-owned title plus a bolt-on accessory slot cannot express \"badge AFTER the\n * name\" or \"swatch BEFORE it\", whereas a template that places the title element\n * itself can express any of them with no extra config axis.\n *\n * ## Contract\n *\n * The header cedes the record's identity to the template the moment `layout.header`\n * exists, so a template that never mounts `<ResourceHeaderTitle />` renders a\n * page with NO record name. That is loud in development (see the diagnostic in\n * `ResourceLayout_Header`) rather than silent.\n *\n * ## Where the title lands (2026-09-30)\n *\n * The header is three lines: a bar (back, breadcrumb, a pane's own controls), the TITLE LINE (the\n * name and the record's actions), and the FACTS line (the rest of the template: status, priority,\n * the parent chip). A template places `<ResourceHeaderTitle />` among its facts as it always did; the\n * header renders the title on the title line and the rest of the template on the facts line. So the\n * name always sits beside the actions it is the subject of, and the facts never push the actions off\n * the name's line, which is what a single wrapping row did: measured on Wonder Todos, a todo in the\n * split pane had its title 41px above its own back arrow and actions.\n *\n * Renders nothing when the host resolved no label (a surface that shows a\n * generic operation title rather than one record's name) — the presence of a\n * label is the single data-driven signal that there is a title to place.\n */\n\nimport React, { createContext, useContext } from 'react';\nimport { createPortal } from 'react-dom';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\n\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { defaultTheme } from '~wildo-frontend-lib/core/ui/themes/default.theme';\n\n// =============================================================================\n// CONTEXT\n// =============================================================================\n\nexport interface ResourceHeaderContextValue {\n /** Resource type key of the record whose header is rendering. */\n resourceType: string;\n\n /**\n * Resolved record title (the `getFrontendResourceLabel` result, or the\n * operation/resource title fallback), or `null` when this surface has no\n * record-specific name to show — `<ResourceHeaderTitle />` then renders nothing.\n */\n title: string | null;\n\n /**\n * `true` while the record's name is still being fetched and nothing else stands in for it.\n * `<ResourceHeaderTitle />` then RESERVES the title's line with a skeleton instead of rendering\n * nothing.\n *\n * An empty band is a defect, not a flicker. The header withholds the label during the first fetch\n * on purpose (it would otherwise flash `#id` and then the real name), and the title element used to\n * render nothing meanwhile — so the band had no height and the name's arrival pushed everything\n * beneath it down by a line. Measured 2026-09-21 in the creation workbench's actor-task modal:\n * `mousedown` landed on a tab, the record arrived, `mouseup` one millisecond later landed on the\n * heading, and the browser dispatched the click to their common ancestor. The tab never changed\n * and nothing reported why.\n */\n titlePending?: boolean;\n\n /**\n * Dev-diagnostic seam: `<ResourceHeaderTitle />` flips `titleMounted` when it\n * renders, letting the header detect an authored template that never places\n * the title. Mutable-ref shape (not state) on purpose — the flag is read only\n * after render and must never schedule a re-render.\n */\n titleMountTracker?: { titleMounted: boolean };\n\n /**\n * `true` when an enclosing section already renders the heading for this region (an embedded READ inside\n * a host section). The record's name is then not the PAGE title, so `<ResourceHeaderTitle />` renders an\n * `h2` beneath the host's heading instead of a second `h1` — the same rule the default header applies.\n */\n hostProvidesHeading?: boolean;\n\n /**\n * The header's TITLE LINE, when the header has one: `<ResourceHeaderTitle />` renders the name THERE,\n * beside the record's actions, instead of in the template's own flow (the facts line). `undefined`\n * means the template's own flow (a template previewed outside a header); `null` means the line is\n * not attached yet — the title then renders nothing for the one layout pass it takes to attach.\n */\n titleTarget?: HTMLElement | null;\n\n /**\n * The header's LEADING slot on the title line, just before the name: `<ResourceHeaderLeading>` renders\n * there. Same `undefined` / `null` reading as {@link titleTarget}.\n */\n leadingTarget?: HTMLElement | null;\n}\n\nconst ResourceHeaderContext = createContext<ResourceHeaderContextValue | null>(null);\n\nexport interface ResourceHeaderContextProviderProps {\n value: ResourceHeaderContextValue;\n children: React.ReactNode;\n}\n\n/** Provides the resolved record title to an authored header template tree. */\nexport function ResourceHeaderContextProvider({\n value,\n children,\n}: ResourceHeaderContextProviderProps): React.JSX.Element {\n return <ResourceHeaderContext.Provider value={value}>{children}</ResourceHeaderContext.Provider>;\n}\n\n/**\n * Read the header context, or `null` when a header template is rendered outside\n * `ResourceLayout_Header` (e.g. previewed in isolation).\n */\nexport function useOptionalResourceHeaderContext(): ResourceHeaderContextValue | null {\n return useContext(ResourceHeaderContext);\n}\n\n// =============================================================================\n// TITLE ELEMENT\n// =============================================================================\n\n/** @wildo_source:part:start saas.frontend.resource-header-title facet:layer:frontend facet:family:resource-ui */\nexport interface ResourceHeaderTitleProps {\n /** Extra classes merged over the theme's resource-title typography. */\n className?: string;\n}\n\n/**\n * The name a resource page is about, set in the theme's `TypographyVariant.RESOURCE_TITLE` voice —\n * quieter than a document heading, because it shares its line with the record's actions. Used by the\n * header's default title and by `<ResourceHeaderTitle />`, so authoring a header template never\n * changes how the title looks.\n *\n * ## It is a real heading, and the level is not cosmetic\n *\n * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a\n * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once\n * left generated screens with no level-one heading at all). `h2` under a host section that owns\n * the heading. The level is structure; the recipe is appearance, and the two are decoupled.\n */\nexport function ResourceHeaderTitleHeading({\n title,\n hostProvidesHeading,\n className,\n}: {\n title: string;\n hostProvidesHeading?: boolean;\n className?: string;\n}): React.JSX.Element {\n // `min-w-0` + truncate so a long record name shrinks rather than pushing the actions off its line.\n const classes = cn('min-w-0 truncate', useResourceTitleVoice(), className);\n return hostProvidesHeading\n ? <h2 className={classes}>{title}</h2>\n : <h1 className={classes}>{title}</h1>;\n}\n\n/**\n * The line a resource title holds while the name is on its way: one skeleton exactly one line box of\n * the theme's `RESOURCE_TITLE` voice tall. It is set in that voice and sized in `lh`, so it matches the\n * real title's line in every theme (text-lg by default, text-xl in cozy and editorial, text-base in\n * dense) and the name's arrival moves nothing beneath it. A fixed height could match only one theme.\n *\n * For a custom header preset: render it where the title will land while the name is on its way.\n * `<ResourceHeaderTitle />` already uses it, so a header TEMPLATE never needs to.\n */\nexport function ResourceHeaderTitlePlaceholder({ className }: { className?: string }): React.JSX.Element {\n return (\n <div className={cn('min-w-0', useResourceTitleVoice(), className)} aria-hidden=\"true\" data-resource-header-title-pending=\"true\">\n <Skeleton className=\"h-[1lh] w-48 max-w-full\" />\n </div>\n );\n}\n\n/**\n * The theme's resource-title typography classes. Read defensively: a header template can be previewed\n * outside the app's `UIProvider`, and a title must not throw there. Without a theme it takes the default\n * theme's voice.\n */\nfunction useResourceTitleVoice(): string | undefined {\n const ui = useContext(UIContext);\n const recipe = ui\n ? ui.getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.RESOURCE_TITLE)\n : defaultTheme.typography?.[TypographyVariant.RESOURCE_TITLE];\n return recipe?.base;\n}\n\n/**\n * The record's name, placed by an authored `layout.header` template. Inside a resource header it\n * renders on the header's title line, beside the record's actions (see \"Where the title lands\"\n * above); the rest of the template stays on the facts line below.\n */\nexport function ResourceHeaderTitle({ className }: ResourceHeaderTitleProps): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n // Register with the missing-title diagnostic BEFORE the empty-title early\n // return: mounting the element discharges the template's contract even when\n // this particular record resolves no label (data-driven, not an authoring bug).\n if (header?.titleMountTracker) header.titleMountTracker.titleMounted = true;\n\n const title = header?.title;\n const element = title\n ? <ResourceHeaderTitleHeading title={title} hostProvidesHeading={header?.hostProvidesHeading} className={className} />\n // A name that is on its way reserves its line, so its arrival moves nothing beneath the header;\n // a surface with no name at all still renders nothing.\n : header?.titlePending\n ? <ResourceHeaderTitlePlaceholder />\n : null;\n if (!element) return null;\n\n // Inside a header: onto its title line. `null` = the line is attaching; render nothing for that pass.\n if (header?.titleTarget !== undefined) {\n return header.titleTarget ? createPortal(element, header.titleTarget) : null;\n }\n return element;\n}\n/**\n * Something that belongs BEFORE the record's name on the title line — an accent swatch, a family glyph —\n * placed by an authored `layout.header` template:\n *\n * ```tsx\n * header: () => (\n * <div className=\"flex min-w-0 flex-wrap items-center gap-field\">\n * <ResourceHeaderLeading><span className=\"size-3 rounded-full\" style={{ background: color }} /></ResourceHeaderLeading>\n * <ResourceHeaderTitle />\n * <DisplayField name=\"status\" labelPlacement=\"hidden\" hideDescription className=\"w-auto\" />\n * </div>\n * ),\n * ```\n *\n * The header lifts the title onto its title line and leaves the rest of the template on the facts line\n * below, so an element a template puts before the title stays with the facts unless it says it leads the\n * name. That is this: inside a header it renders just before the name; outside one (a template previewed\n * in isolation) it renders where it is written. A resource whose glyph replaces the resource icon\n * (`HeaderIconPlacement.TEMPLATE_OWNED`) places it here, so the title line keeps a glyph.\n */\nexport function ResourceHeaderLeading({ children }: { children: React.ReactNode }): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n if (header?.leadingTarget !== undefined) {\n return header.leadingTarget ? createPortal(children, header.leadingTarget) : null;\n }\n return <>{children}</>;\n}\n/** @wildo_source:part:end saas.frontend.resource-header-title */\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import type { z } from 'zod';
|
|
2
3
|
/**
|
|
3
4
|
* Registry contract a form-hosted section exposes to its descendants.
|
|
4
5
|
*
|
|
@@ -114,7 +115,14 @@ export declare enum SectionContentRole {
|
|
|
114
115
|
/** A slot that renders one field's control, or nothing when the operation's schema lacks it. */
|
|
115
116
|
FIELD_SLOT = "field_slot",
|
|
116
117
|
/** A wrapper whose children are judged in its place (it scopes field names and adds no content). */
|
|
117
|
-
FIELD_SLOT_CONTAINER = "field_slot_container"
|
|
118
|
+
FIELD_SLOT_CONTAINER = "field_slot_container",
|
|
119
|
+
/**
|
|
120
|
+
* A slot that DISPLAYS one field, or nothing when the viewer is not shown it (#4459 F6): it reports its presence like a
|
|
121
|
+
* field slot, so a display section of nothing but such slots hides when none renders. It writes nothing, so it is never
|
|
122
|
+
* a PLACED slot, and the static grouped-form decision (`listPlacedFieldSlots`) reads it as content of its own. A
|
|
123
|
+
* grouped DISPLAY host reads it statically instead (`listDisplayedFieldSlots`).
|
|
124
|
+
*/
|
|
125
|
+
DISPLAY_FIELD_SLOT = "display_field_slot"
|
|
118
126
|
}
|
|
119
127
|
/** The role a component declared, if any (read by the placement report as well as the hide decision). */
|
|
120
128
|
export declare function sectionContentRoleOf(type: unknown): SectionContentRole | undefined;
|
|
@@ -126,6 +134,12 @@ export interface PlacedFieldSlot {
|
|
|
126
134
|
/** The slot was handed its own schema, so the form's schema does not decide whether it renders. */
|
|
127
135
|
hasOwnSchema: boolean;
|
|
128
136
|
}
|
|
137
|
+
/** Which field a display slot shows, as `DisplayField` resolves it: the enclosing scopes' names joined to its own. */
|
|
138
|
+
export interface DisplayedFieldSlot {
|
|
139
|
+
path: string;
|
|
140
|
+
/** The schema the slot was handed, if any: `DisplayField` judges that one rather than the record's. */
|
|
141
|
+
ownSchema: z.ZodTypeAny | undefined;
|
|
142
|
+
}
|
|
129
143
|
/**
|
|
130
144
|
* True when `children` holds at least one field slot and nothing else. Fragments and declared containers
|
|
131
145
|
* are looked through, and so is a plain element that wraps field slots.
|
|
@@ -138,4 +152,10 @@ export declare function holdsOnlyFieldSlots(children: ReactNode): boolean;
|
|
|
138
152
|
* is not mounted — an inactive tab's panel is not.
|
|
139
153
|
*/
|
|
140
154
|
export declare function listPlacedFieldSlots(children: ReactNode, pathPrefix?: string): PlacedFieldSlot[] | null;
|
|
155
|
+
/**
|
|
156
|
+
* The display slots `children` places, or `null` when it holds anything besides display slots (a form slot included).
|
|
157
|
+
* Paths are resolved the way `DisplayField` resolves them, starting from `pathPrefix`. Read STATICALLY, for a grouped
|
|
158
|
+
* display host deciding about a section whose content is not mounted (#4459 review D1).
|
|
159
|
+
*/
|
|
160
|
+
export declare function listDisplayedFieldSlots(children: ReactNode, pathPrefix?: string): DisplayedFieldSlot[] | null;
|
|
141
161
|
//# sourceMappingURL=SectionFieldsContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionFieldsContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/SectionFieldsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6H,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionFieldsContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/SectionFieldsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6H,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClK,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;;OAKG;IACH,mBAAmB,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,2BAA2B,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAClE;;;;;OAKG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,oBAA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CAGnG;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,SAAK,GAAG,kBAAkB,EAAE,GAAG,IAAI,CAGzG"}
|
|
@@ -160,6 +160,13 @@ export var SectionContentRole;
|
|
|
160
160
|
SectionContentRole["FIELD_SLOT"] = "field_slot";
|
|
161
161
|
/** A wrapper whose children are judged in its place (it scopes field names and adds no content). */
|
|
162
162
|
SectionContentRole["FIELD_SLOT_CONTAINER"] = "field_slot_container";
|
|
163
|
+
/**
|
|
164
|
+
* A slot that DISPLAYS one field, or nothing when the viewer is not shown it (#4459 F6): it reports its presence like a
|
|
165
|
+
* field slot, so a display section of nothing but such slots hides when none renders. It writes nothing, so it is never
|
|
166
|
+
* a PLACED slot, and the static grouped-form decision (`listPlacedFieldSlots`) reads it as content of its own. A
|
|
167
|
+
* grouped DISPLAY host reads it statically instead (`listDisplayedFieldSlots`).
|
|
168
|
+
*/
|
|
169
|
+
SectionContentRole["DISPLAY_FIELD_SLOT"] = "display_field_slot";
|
|
163
170
|
})(SectionContentRole || (SectionContentRole = {}));
|
|
164
171
|
const SECTION_CONTENT_ROLE = Symbol.for('wildo.sectionContentRole');
|
|
165
172
|
/** The role a component declared, if any (read by the placement report as well as the hide decision). */
|
|
@@ -172,6 +179,19 @@ export function sectionContentRoleOf(type) {
|
|
|
172
179
|
export function declareSectionContentRole(component, role) {
|
|
173
180
|
Object.defineProperty(component, SECTION_CONTENT_ROLE, { value: role, enumerable: false });
|
|
174
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Which slots a static reading of a section's elements counts as its field slots. The three read the same tree and
|
|
184
|
+
* differ in what a slot of the OTHER kind is to them: content, which keeps the section.
|
|
185
|
+
*/
|
|
186
|
+
var SectionSlotReading;
|
|
187
|
+
(function (SectionSlotReading) {
|
|
188
|
+
/** Any slot that draws one field or nothing: the mounted presence decision (`holdsOnlyFieldSlots`). */
|
|
189
|
+
SectionSlotReading["PRESENCE"] = "presence";
|
|
190
|
+
/** Form slots, with their paths; a display slot is content (`listPlacedFieldSlots`). */
|
|
191
|
+
SectionSlotReading["PLACED"] = "placed";
|
|
192
|
+
/** Display slots, with their paths; a form slot is content (`listDisplayedFieldSlots`). */
|
|
193
|
+
SectionSlotReading["DISPLAYED"] = "displayed";
|
|
194
|
+
})(SectionSlotReading || (SectionSlotReading = {}));
|
|
175
195
|
/** What a subtree amounts to for `holdsOnlyFieldSlots`. */
|
|
176
196
|
var SectionSubtreeKind;
|
|
177
197
|
(function (SectionSubtreeKind) {
|
|
@@ -182,7 +202,7 @@ var SectionSubtreeKind;
|
|
|
182
202
|
/** Something a field-presence count cannot see: text, a component, a childless or custom element. */
|
|
183
203
|
SectionSubtreeKind["CONTENT"] = "content";
|
|
184
204
|
})(SectionSubtreeKind || (SectionSubtreeKind = {}));
|
|
185
|
-
function classifySectionSubtree(nodes, pathPrefix,
|
|
205
|
+
function classifySectionSubtree(nodes, pathPrefix, reading, slots) {
|
|
186
206
|
let sawFieldSlot = false;
|
|
187
207
|
for (const node of Children.toArray(nodes)) {
|
|
188
208
|
if (!isValidElement(node))
|
|
@@ -190,13 +210,13 @@ function classifySectionSubtree(nodes, pathPrefix, placed) {
|
|
|
190
210
|
const props = node.props;
|
|
191
211
|
let kind;
|
|
192
212
|
if (node.type === Fragment) {
|
|
193
|
-
kind = classifySectionSubtree(props.children, pathPrefix,
|
|
213
|
+
kind = classifySectionSubtree(props.children, pathPrefix, reading, slots);
|
|
194
214
|
}
|
|
195
215
|
else if (typeof node.type === 'string') {
|
|
196
216
|
// A plain element is a WRAPPER only when it wraps field slots (a layout `<div className="grid">`).
|
|
197
217
|
// Anything else is content: a childless element (an image, a rule, a spacer), one whose only child
|
|
198
218
|
// is a falsy branch (it may be drawn by CSS), and a custom element (it may render shadow content).
|
|
199
|
-
kind = !node.type.includes('-') && classifySectionSubtree(props.children, pathPrefix,
|
|
219
|
+
kind = !node.type.includes('-') && classifySectionSubtree(props.children, pathPrefix, reading, slots) === SectionSubtreeKind.FIELD_SLOTS
|
|
200
220
|
? SectionSubtreeKind.FIELD_SLOTS
|
|
201
221
|
: SectionSubtreeKind.CONTENT;
|
|
202
222
|
}
|
|
@@ -205,14 +225,29 @@ function classifySectionSubtree(nodes, pathPrefix, placed) {
|
|
|
205
225
|
const name = typeof props.name === 'string' ? props.name : undefined;
|
|
206
226
|
const scopedPath = name ? (pathPrefix ? `${pathPrefix}.${name}` : name) : pathPrefix;
|
|
207
227
|
if (role === SectionContentRole.FIELD_SLOT) {
|
|
208
|
-
|
|
209
|
-
|
|
228
|
+
if (reading === SectionSlotReading.DISPLAYED) {
|
|
229
|
+
kind = SectionSubtreeKind.CONTENT;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
slots.placed.push({ path: scopedPath, hasOwnSchema: props.schema !== undefined });
|
|
233
|
+
kind = SectionSubtreeKind.FIELD_SLOTS;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else if (role === SectionContentRole.DISPLAY_FIELD_SLOT) {
|
|
237
|
+
// A field slot to the presence decision and to a display host; never a placed (form) slot (see the role).
|
|
238
|
+
if (reading === SectionSlotReading.PLACED) {
|
|
239
|
+
kind = SectionSubtreeKind.CONTENT;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
slots.displayed.push({ path: scopedPath, ownSchema: props.schema });
|
|
243
|
+
kind = SectionSubtreeKind.FIELD_SLOTS;
|
|
244
|
+
}
|
|
210
245
|
}
|
|
211
246
|
else if (role === SectionContentRole.FIELD_SLOT_CONTAINER) {
|
|
212
247
|
// A declared container holding nothing adds nothing, even an `ObjectScope` given a `className`
|
|
213
248
|
// (which renders a styled div). Unlike a bare styled div it scopes names rather than decorating,
|
|
214
249
|
// and when a section's slots are all absent the whole frame hides anyway.
|
|
215
|
-
kind = classifySectionSubtree(props.children, scopedPath,
|
|
250
|
+
kind = classifySectionSubtree(props.children, scopedPath, reading, slots);
|
|
216
251
|
}
|
|
217
252
|
else {
|
|
218
253
|
kind = SectionSubtreeKind.CONTENT;
|
|
@@ -230,7 +265,7 @@ function classifySectionSubtree(nodes, pathPrefix, placed) {
|
|
|
230
265
|
* are looked through, and so is a plain element that wraps field slots.
|
|
231
266
|
*/
|
|
232
267
|
export function holdsOnlyFieldSlots(children) {
|
|
233
|
-
return classifySectionSubtree(children, '', []) === SectionSubtreeKind.FIELD_SLOTS;
|
|
268
|
+
return classifySectionSubtree(children, '', SectionSlotReading.PRESENCE, { placed: [], displayed: [] }) === SectionSubtreeKind.FIELD_SLOTS;
|
|
234
269
|
}
|
|
235
270
|
/**
|
|
236
271
|
* The field slots `children` places, or `null` when it holds anything besides field slots. Paths are
|
|
@@ -239,7 +274,16 @@ export function holdsOnlyFieldSlots(children) {
|
|
|
239
274
|
* is not mounted — an inactive tab's panel is not.
|
|
240
275
|
*/
|
|
241
276
|
export function listPlacedFieldSlots(children, pathPrefix = '') {
|
|
242
|
-
const
|
|
243
|
-
return classifySectionSubtree(children, pathPrefix,
|
|
277
|
+
const slots = { placed: [], displayed: [] };
|
|
278
|
+
return classifySectionSubtree(children, pathPrefix, SectionSlotReading.PLACED, slots) === SectionSubtreeKind.FIELD_SLOTS ? slots.placed : null;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* The display slots `children` places, or `null` when it holds anything besides display slots (a form slot included).
|
|
282
|
+
* Paths are resolved the way `DisplayField` resolves them, starting from `pathPrefix`. Read STATICALLY, for a grouped
|
|
283
|
+
* display host deciding about a section whose content is not mounted (#4459 review D1).
|
|
284
|
+
*/
|
|
285
|
+
export function listDisplayedFieldSlots(children, pathPrefix = '') {
|
|
286
|
+
const slots = { placed: [], displayed: [] };
|
|
287
|
+
return classifySectionSubtree(children, pathPrefix, SectionSlotReading.DISPLAYED, slots) === SectionSubtreeKind.FIELD_SLOTS ? slots.displayed : null;
|
|
244
288
|
}
|
|
245
289
|
//# sourceMappingURL=SectionFieldsContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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K,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjH,CAAC","sourcesContent":["import { Children, Fragment, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useState, useSyncExternalStore, type ReactNode } from 'react';\n\n/**\n * Registry contract a form-hosted section exposes to its descendants.\n *\n * IDENTITY CONTRACT: providers MUST keep the context value identity-stable for\n * the lifetime of the section (see `useSectionFieldsRegistry`). Every\n * `FormField` registers itself through an effect that depends on this value;\n * a value whose identity tracks the registry contents re-fires every field's\n * registration effect on each mutation (unregister + register → new contents\n * → new value → …), which loops until React throws \"Maximum update depth\n * exceeded\" (recovered 2026-06-10 on the Wonder Todos todoLists create form).\n */\nexport interface SectionFieldsContextValue {\n registerField: (name: string) => void;\n unregisterField: (name: string) => void;\n /**\n * Current registered field names (insertion-ordered, deduplicated).\n * Returns the live immutable snapshot — a new array identity is produced\n * only when the contents actually change, so it is safe to use as a\n * `useSyncExternalStore` snapshot.\n */\n getRegisteredFields: () => string[];\n /**\n * Subscribe to registry mutations. Returns the unsubscribe function.\n * Render-reactive consumers should prefer `useRegisteredSectionFields`\n * over wiring this manually.\n */\n subscribeToRegisteredFields: (listener: () => void) => () => void;\n /**\n * Records whether a field this section declares actually RENDERS a control here — its field is in\n * the operation's schema and not hidden by a condition. A template places its `FormField` slots\n * unconditionally and lets the operation's schema decide (a slot whose field the schema lacks\n * renders nothing), so a section can declare fields and show none of them.\n */\n reportSlotPresence: (slot: object, present: boolean) => void;\n clearSlotPresence: (slot: object) => void;\n /**\n * True when fields reported here and NONE of them renders. Measured on Wonder Todos, \"Reset to\n * defaults\" showed the preferences template's four section cards, every one empty. This is a fact\n * about FIELDS only: a section also holding other content (text, a custom control, a nested section)\n * is not empty because of it — `Section` combines it with `holdsOnlyFieldSlots`. Notifies through\n * `subscribeToRegisteredFields`.\n */\n showsNoField: () => boolean;\n}\n\nexport const SectionFieldsContext = createContext<SectionFieldsContextValue | null>(null);\n\n/**\n * Builds the identity-stable registry backing `SectionFieldsContext`.\n * Used by both section form hosts (`Section` solo modes and\n * `GroupedSectionBody` for grouped container panels) — keep them on this\n * single implementation so the identity contract cannot drift between hosts.\n *\n * Why the registry lives OUTSIDE React state: registrations arrive from\n * descendant effects. If the registered names were `useState` data baked into\n * the provider value (e.g. a `useMemo` with the names in its deps), every\n * registration would change the value identity, re-fire every field's\n * registration effect (cleanup unregister + register), change the state\n * again, and re-render forever — register/unregister pairs always transition\n * through fresh array identities, so any state-derived value loops by\n * construction. Instead the store is created once per section; mutations swap\n * an immutable snapshot and notify subscribers, so registry churn re-renders\n * only the components that opted in via `useRegisteredSectionFields` — never\n * the provider, never the registrants.\n *\n * Same family as the `WizardStep` field registry (stable mutable container),\n * extended with subscription because section save buttons render from the\n * registry contents (disabled-when-empty) and need to observe changes.\n */\nexport function useSectionFieldsRegistry(): SectionFieldsContextValue {\n const [registry] = useState((): SectionFieldsContextValue => {\n /** Immutable snapshot — swapped (never mutated) so subscribers can compare by identity. */\n let registeredFields: string[] = [];\n // One entry per MOUNTED SLOT, keyed by that slot's own token rather than by field name: the same\n // field placed twice is two slots, which may even disagree (one given a schema the other lacks), and\n // one copy unmounting must not erase or overwrite the other's answer.\n const slotPresence = new Map<object, boolean>();\n let showsNoField = false;\n const listeners = new Set<() => void>();\n const notify = (): void => {\n for (const listener of listeners) listener();\n };\n const recomputePresence = (): void => {\n const next = slotPresence.size > 0 && ![...slotPresence.values()].some(Boolean);\n if (next === showsNoField) return;\n showsNoField = next;\n notify();\n };\n return {\n registerField: (name: string): void => {\n if (registeredFields.includes(name)) return;\n registeredFields = [...registeredFields, name];\n notify();\n },\n unregisterField: (name: string): void => {\n if (!registeredFields.includes(name)) return;\n registeredFields = registeredFields.filter((current) => current !== name);\n notify();\n },\n getRegisteredFields: (): string[] => registeredFields,\n reportSlotPresence: (slot: object, present: boolean): void => {\n slotPresence.set(slot, present);\n recomputePresence();\n },\n clearSlotPresence: (slot: object): void => {\n if (!slotPresence.delete(slot)) return;\n recomputePresence();\n },\n showsNoField: (): boolean => showsNoField,\n subscribeToRegisteredFields: (listener: () => void): (() => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n });\n return registry;\n}\n\n/**\n * Hook for `FormField` to register with the enclosing saveable section so the\n * section save action can validate and submit only the fields it actually\n * owns. No-op outside a section provider.\n *\n * Depends on the context value identity on purpose (React contract: re-bind\n * if the provider genuinely changes). This is safe only because providers\n * honor the identity contract documented on `SectionFieldsContextValue` —\n * the effect then runs once per field mount.\n */\nexport function useSectionFieldRegistration(fieldName: string): void {\n const ctx = useContext(SectionFieldsContext);\n useEffect(() => {\n ctx?.registerField(fieldName);\n return () => {\n ctx?.unregisterField(fieldName);\n };\n }, [ctx, fieldName]);\n}\n\nconst EMPTY_REGISTERED_FIELDS: string[] = [];\nconst subscribeToNothing = (): (() => void) => () => {};\n\n/**\n * Render-reactive view of the enclosing section's registered field names.\n * Re-renders the caller when fields register/unregister (e.g. conditionally\n * shown fields), without ever invalidating the provider value. Returns a\n * stable empty array outside any section provider.\n */\nexport function useRegisteredSectionFields(): string[] {\n const ctx = useContext(SectionFieldsContext);\n return useSyncExternalStore(\n ctx ? ctx.subscribeToRegisteredFields : subscribeToNothing,\n ctx ? ctx.getRegisteredFields : (): string[] => EMPTY_REGISTERED_FIELDS,\n );\n}\n\n/**\n * Hook for `FormField` to tell its section whether it renders a control. A LAYOUT effect, so the\n * section knows before the browser paints and an empty section never flashes on screen.\n */\nexport function useSectionFieldPresence(present: boolean): void {\n // Two effects on purpose. The CLEAR runs only when the slot leaves this registry (unmount, or the\n // section provider changing), so a slot whose `present` flips is updated in place rather than deleted\n // and re-added; either way the section settles before paint. The REPORT runs on every change of\n // `present`, and after a provider change it reports into the new registry.\n const ctx = useContext(SectionFieldsContext);\n const [slot] = useState(() => ({}));\n useLayoutEffect(() => () => {\n ctx?.clearSlotPresence(slot);\n }, [ctx, slot]);\n useLayoutEffect(() => {\n ctx?.reportSlotPresence(slot, present);\n }, [ctx, slot, present]);\n}\n\n/**\n * Whether the section this registry backs has fields and shows none of them.\n *\n * Read in a LAYOUT effect rather than through `useSyncExternalStore`: the fields report in their own\n * layout effects, which run before their section's, so the section settles before the browser paints.\n * A store subscription is attached in a passive effect, after paint, and would let an empty frame show\n * for a frame on the first mount and on every keyed remount of the form.\n */\nexport function useSectionShowsNoField(registry: SectionFieldsContextValue): boolean {\n const [showsNoField, setShowsNoField] = useState(false);\n useLayoutEffect(() => {\n const update = (): void => setShowsNoField(registry.showsNoField());\n update();\n return registry.subscribeToRegisteredFields(update);\n }, [registry]);\n return showsNoField;\n}\n\n/**\n * What a component is to a section deciding whether it holds anything besides field slots.\n *\n * A section may hide when none of its fields renders only if fields are ALL it holds: text, a custom\n * control or a nested section beside them is content of its own, which a field-presence count cannot see.\n * Plain elements that wrap field slots (a layout `div`) are looked through. Components opt in by declaring\n * their role; any undeclared component counts as other content, so an unknown component can only keep a\n * section visible, never hide one. The role API is deliberately NOT exported from the package: an\n * application's own wrapper component keeps its section visible, which is the safe answer, and an author\n * who wants hiding places slots directly, in a plain element, or in `ObjectScope`.\n */\nexport enum SectionContentRole {\n /** A slot that renders one field's control, or nothing when the operation's schema lacks it. */\n FIELD_SLOT = 'field_slot',\n /** A wrapper whose children are judged in its place (it scopes field names and adds no content). */\n FIELD_SLOT_CONTAINER = 'field_slot_container',\n}\n\nconst SECTION_CONTENT_ROLE = Symbol.for('wildo.sectionContentRole');\n\n/** The role a component declared, if any (read by the placement report as well as the hide decision). */\nexport function sectionContentRoleOf(type: unknown): SectionContentRole | undefined {\n return (type !== null && (typeof type === 'function' || typeof type === 'object'))\n ? (type as { [SECTION_CONTENT_ROLE]?: SectionContentRole })[SECTION_CONTENT_ROLE]\n : undefined;\n}\n\n/** Declares what a component is to `holdsOnlyFieldSlots`. */\nexport function declareSectionContentRole(component: object, role: SectionContentRole): void {\n Object.defineProperty(component, SECTION_CONTENT_ROLE, { value: role, enumerable: false });\n}\n\n/** What a subtree amounts to for `holdsOnlyFieldSlots`. */\nenum SectionSubtreeKind {\n /** At least one field slot, and nothing else. */\n FIELD_SLOTS = 'field_slots',\n /** Nothing at all: no slot and no content (a falsy branch, an empty container). */\n NOTHING = 'nothing',\n /** Something a field-presence count cannot see: text, a component, a childless or custom element. */\n CONTENT = 'content',\n}\n\n/** Where a field slot writes, as `FormField` resolves it: the enclosing scopes' names joined to its own. */\nexport interface PlacedFieldSlot {\n path: string;\n /** The slot was handed its own schema, so the form's schema does not decide whether it renders. */\n hasOwnSchema: boolean;\n}\n\nfunction classifySectionSubtree(nodes: ReactNode, pathPrefix: string, placed: PlacedFieldSlot[]): SectionSubtreeKind {\n let sawFieldSlot = false;\n for (const node of Children.toArray(nodes)) {\n if (!isValidElement(node)) return SectionSubtreeKind.CONTENT;\n const props = node.props as { children?: ReactNode; name?: unknown; schema?: unknown };\n let kind: SectionSubtreeKind;\n if (node.type === Fragment) {\n kind = classifySectionSubtree(props.children, pathPrefix, placed);\n } else if (typeof node.type === 'string') {\n // A plain element is a WRAPPER only when it wraps field slots (a layout `<div className=\"grid\">`).\n // Anything else is content: a childless element (an image, a rule, a spacer), one whose only child\n // is a falsy branch (it may be drawn by CSS), and a custom element (it may render shadow content).\n kind = !node.type.includes('-') && classifySectionSubtree(props.children, pathPrefix, placed) === SectionSubtreeKind.FIELD_SLOTS\n ? SectionSubtreeKind.FIELD_SLOTS\n : SectionSubtreeKind.CONTENT;\n } else {\n const role = (node.type as { [SECTION_CONTENT_ROLE]?: SectionContentRole })[SECTION_CONTENT_ROLE];\n const name = typeof props.name === 'string' ? props.name : undefined;\n const scopedPath = name ? (pathPrefix ? `${pathPrefix}.${name}` : name) : pathPrefix;\n if (role === SectionContentRole.FIELD_SLOT) {\n placed.push({ path: scopedPath, hasOwnSchema: props.schema !== undefined });\n kind = SectionSubtreeKind.FIELD_SLOTS;\n } else if (role === SectionContentRole.FIELD_SLOT_CONTAINER) {\n // A declared container holding nothing adds nothing, even an `ObjectScope` given a `className`\n // (which renders a styled div). Unlike a bare styled div it scopes names rather than decorating,\n // and when a section's slots are all absent the whole frame hides anyway.\n kind = classifySectionSubtree(props.children, scopedPath, placed);\n } else {\n kind = SectionSubtreeKind.CONTENT;\n }\n }\n if (kind === SectionSubtreeKind.CONTENT) return SectionSubtreeKind.CONTENT;\n if (kind === SectionSubtreeKind.FIELD_SLOTS) sawFieldSlot = true;\n }\n return sawFieldSlot ? SectionSubtreeKind.FIELD_SLOTS : SectionSubtreeKind.NOTHING;\n}\n\n/**\n * True when `children` holds at least one field slot and nothing else. Fragments and declared containers\n * are looked through, and so is a plain element that wraps field slots.\n */\nexport function holdsOnlyFieldSlots(children: ReactNode): boolean {\n return classifySectionSubtree(children, '', []) === SectionSubtreeKind.FIELD_SLOTS;\n}\n\n/**\n * The field slots `children` places, or `null` when it holds anything besides field slots. Paths are\n * resolved the way `FormField` resolves them (scope names joined to the slot's `name`), starting from\n * `pathPrefix`. Read STATICALLY, from the elements, so a host can decide about a section whose content\n * is not mounted — an inactive tab's panel is not.\n */\nexport function listPlacedFieldSlots(children: ReactNode, pathPrefix = ''): PlacedFieldSlot[] | null {\n const placed: PlacedFieldSlot[] = [];\n return classifySectionSubtree(children, pathPrefix, placed) === SectionSubtreeKind.FIELD_SLOTS ? placed : null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SectionFieldsContext.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/SectionFieldsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,EAAkB,MAAM,OAAO,CAAC;AAgDlK,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAmC,IAAI,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,CAAC,QAAQ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D,OAAO,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC;AACpF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAmB;IACrD,OAAO,sBAAsB,CAAC,QAAQ,EAAE,EAAE,EAAE,kBAAkB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAK,kBAAkB,CAAC,WAAW,CAAC;AAC7I,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAmB,EAAE,UAAU,GAAG,EAAE;IACvE,MAAM,KAAK,GAAqB,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC9D,OAAO,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAmB,EAAE,UAAU,GAAG,EAAE;IAC1E,MAAM,KAAK,GAAqB,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC9D,OAAO,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACvJ,CAAC","sourcesContent":["import { Children, Fragment, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useState, useSyncExternalStore, type ReactNode } from 'react';\nimport type { z } from 'zod';\n\n/**\n * Registry contract a form-hosted section exposes to its descendants.\n *\n * IDENTITY CONTRACT: providers MUST keep the context value identity-stable for\n * the lifetime of the section (see `useSectionFieldsRegistry`). Every\n * `FormField` registers itself through an effect that depends on this value;\n * a value whose identity tracks the registry contents re-fires every field's\n * registration effect on each mutation (unregister + register → new contents\n * → new value → …), which loops until React throws \"Maximum update depth\n * exceeded\" (recovered 2026-06-10 on the Wonder Todos todoLists create form).\n */\nexport interface SectionFieldsContextValue {\n registerField: (name: string) => void;\n unregisterField: (name: string) => void;\n /**\n * Current registered field names (insertion-ordered, deduplicated).\n * Returns the live immutable snapshot — a new array identity is produced\n * only when the contents actually change, so it is safe to use as a\n * `useSyncExternalStore` snapshot.\n */\n getRegisteredFields: () => string[];\n /**\n * Subscribe to registry mutations. Returns the unsubscribe function.\n * Render-reactive consumers should prefer `useRegisteredSectionFields`\n * over wiring this manually.\n */\n subscribeToRegisteredFields: (listener: () => void) => () => void;\n /**\n * Records whether a field this section declares actually RENDERS a control here — its field is in\n * the operation's schema and not hidden by a condition. A template places its `FormField` slots\n * unconditionally and lets the operation's schema decide (a slot whose field the schema lacks\n * renders nothing), so a section can declare fields and show none of them.\n */\n reportSlotPresence: (slot: object, present: boolean) => void;\n clearSlotPresence: (slot: object) => void;\n /**\n * True when fields reported here and NONE of them renders. Measured on Wonder Todos, \"Reset to\n * defaults\" showed the preferences template's four section cards, every one empty. This is a fact\n * about FIELDS only: a section also holding other content (text, a custom control, a nested section)\n * is not empty because of it — `Section` combines it with `holdsOnlyFieldSlots`. Notifies through\n * `subscribeToRegisteredFields`.\n */\n showsNoField: () => boolean;\n}\n\nexport const SectionFieldsContext = createContext<SectionFieldsContextValue | null>(null);\n\n/**\n * Builds the identity-stable registry backing `SectionFieldsContext`.\n * Used by both section form hosts (`Section` solo modes and\n * `GroupedSectionBody` for grouped container panels) — keep them on this\n * single implementation so the identity contract cannot drift between hosts.\n *\n * Why the registry lives OUTSIDE React state: registrations arrive from\n * descendant effects. If the registered names were `useState` data baked into\n * the provider value (e.g. a `useMemo` with the names in its deps), every\n * registration would change the value identity, re-fire every field's\n * registration effect (cleanup unregister + register), change the state\n * again, and re-render forever — register/unregister pairs always transition\n * through fresh array identities, so any state-derived value loops by\n * construction. Instead the store is created once per section; mutations swap\n * an immutable snapshot and notify subscribers, so registry churn re-renders\n * only the components that opted in via `useRegisteredSectionFields` — never\n * the provider, never the registrants.\n *\n * Same family as the `WizardStep` field registry (stable mutable container),\n * extended with subscription because section save buttons render from the\n * registry contents (disabled-when-empty) and need to observe changes.\n */\nexport function useSectionFieldsRegistry(): SectionFieldsContextValue {\n const [registry] = useState((): SectionFieldsContextValue => {\n /** Immutable snapshot — swapped (never mutated) so subscribers can compare by identity. */\n let registeredFields: string[] = [];\n // One entry per MOUNTED SLOT, keyed by that slot's own token rather than by field name: the same\n // field placed twice is two slots, which may even disagree (one given a schema the other lacks), and\n // one copy unmounting must not erase or overwrite the other's answer.\n const slotPresence = new Map<object, boolean>();\n let showsNoField = false;\n const listeners = new Set<() => void>();\n const notify = (): void => {\n for (const listener of listeners) listener();\n };\n const recomputePresence = (): void => {\n const next = slotPresence.size > 0 && ![...slotPresence.values()].some(Boolean);\n if (next === showsNoField) return;\n showsNoField = next;\n notify();\n };\n return {\n registerField: (name: string): void => {\n if (registeredFields.includes(name)) return;\n registeredFields = [...registeredFields, name];\n notify();\n },\n unregisterField: (name: string): void => {\n if (!registeredFields.includes(name)) return;\n registeredFields = registeredFields.filter((current) => current !== name);\n notify();\n },\n getRegisteredFields: (): string[] => registeredFields,\n reportSlotPresence: (slot: object, present: boolean): void => {\n slotPresence.set(slot, present);\n recomputePresence();\n },\n clearSlotPresence: (slot: object): void => {\n if (!slotPresence.delete(slot)) return;\n recomputePresence();\n },\n showsNoField: (): boolean => showsNoField,\n subscribeToRegisteredFields: (listener: () => void): (() => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n });\n return registry;\n}\n\n/**\n * Hook for `FormField` to register with the enclosing saveable section so the\n * section save action can validate and submit only the fields it actually\n * owns. No-op outside a section provider.\n *\n * Depends on the context value identity on purpose (React contract: re-bind\n * if the provider genuinely changes). This is safe only because providers\n * honor the identity contract documented on `SectionFieldsContextValue` —\n * the effect then runs once per field mount.\n */\nexport function useSectionFieldRegistration(fieldName: string): void {\n const ctx = useContext(SectionFieldsContext);\n useEffect(() => {\n ctx?.registerField(fieldName);\n return () => {\n ctx?.unregisterField(fieldName);\n };\n }, [ctx, fieldName]);\n}\n\nconst EMPTY_REGISTERED_FIELDS: string[] = [];\nconst subscribeToNothing = (): (() => void) => () => {};\n\n/**\n * Render-reactive view of the enclosing section's registered field names.\n * Re-renders the caller when fields register/unregister (e.g. conditionally\n * shown fields), without ever invalidating the provider value. Returns a\n * stable empty array outside any section provider.\n */\nexport function useRegisteredSectionFields(): string[] {\n const ctx = useContext(SectionFieldsContext);\n return useSyncExternalStore(\n ctx ? ctx.subscribeToRegisteredFields : subscribeToNothing,\n ctx ? ctx.getRegisteredFields : (): string[] => EMPTY_REGISTERED_FIELDS,\n );\n}\n\n/**\n * Hook for `FormField` to tell its section whether it renders a control. A LAYOUT effect, so the\n * section knows before the browser paints and an empty section never flashes on screen.\n */\nexport function useSectionFieldPresence(present: boolean): void {\n // Two effects on purpose. The CLEAR runs only when the slot leaves this registry (unmount, or the\n // section provider changing), so a slot whose `present` flips is updated in place rather than deleted\n // and re-added; either way the section settles before paint. The REPORT runs on every change of\n // `present`, and after a provider change it reports into the new registry.\n const ctx = useContext(SectionFieldsContext);\n const [slot] = useState(() => ({}));\n useLayoutEffect(() => () => {\n ctx?.clearSlotPresence(slot);\n }, [ctx, slot]);\n useLayoutEffect(() => {\n ctx?.reportSlotPresence(slot, present);\n }, [ctx, slot, present]);\n}\n\n/**\n * Whether the section this registry backs has fields and shows none of them.\n *\n * Read in a LAYOUT effect rather than through `useSyncExternalStore`: the fields report in their own\n * layout effects, which run before their section's, so the section settles before the browser paints.\n * A store subscription is attached in a passive effect, after paint, and would let an empty frame show\n * for a frame on the first mount and on every keyed remount of the form.\n */\nexport function useSectionShowsNoField(registry: SectionFieldsContextValue): boolean {\n const [showsNoField, setShowsNoField] = useState(false);\n useLayoutEffect(() => {\n const update = (): void => setShowsNoField(registry.showsNoField());\n update();\n return registry.subscribeToRegisteredFields(update);\n }, [registry]);\n return showsNoField;\n}\n\n/**\n * What a component is to a section deciding whether it holds anything besides field slots.\n *\n * A section may hide when none of its fields renders only if fields are ALL it holds: text, a custom\n * control or a nested section beside them is content of its own, which a field-presence count cannot see.\n * Plain elements that wrap field slots (a layout `div`) are looked through. Components opt in by declaring\n * their role; any undeclared component counts as other content, so an unknown component can only keep a\n * section visible, never hide one. The role API is deliberately NOT exported from the package: an\n * application's own wrapper component keeps its section visible, which is the safe answer, and an author\n * who wants hiding places slots directly, in a plain element, or in `ObjectScope`.\n */\nexport enum SectionContentRole {\n /** A slot that renders one field's control, or nothing when the operation's schema lacks it. */\n FIELD_SLOT = 'field_slot',\n /** A wrapper whose children are judged in its place (it scopes field names and adds no content). */\n FIELD_SLOT_CONTAINER = 'field_slot_container',\n /**\n * A slot that DISPLAYS one field, or nothing when the viewer is not shown it (#4459 F6): it reports its presence like a\n * field slot, so a display section of nothing but such slots hides when none renders. It writes nothing, so it is never\n * a PLACED slot, and the static grouped-form decision (`listPlacedFieldSlots`) reads it as content of its own. A\n * grouped DISPLAY host reads it statically instead (`listDisplayedFieldSlots`).\n */\n DISPLAY_FIELD_SLOT = 'display_field_slot',\n}\n\nconst SECTION_CONTENT_ROLE = Symbol.for('wildo.sectionContentRole');\n\n/** The role a component declared, if any (read by the placement report as well as the hide decision). */\nexport function sectionContentRoleOf(type: unknown): SectionContentRole | undefined {\n return (type !== null && (typeof type === 'function' || typeof type === 'object'))\n ? (type as { [SECTION_CONTENT_ROLE]?: SectionContentRole })[SECTION_CONTENT_ROLE]\n : undefined;\n}\n\n/** Declares what a component is to `holdsOnlyFieldSlots`. */\nexport function declareSectionContentRole(component: object, role: SectionContentRole): void {\n Object.defineProperty(component, SECTION_CONTENT_ROLE, { value: role, enumerable: false });\n}\n\n/**\n * Which slots a static reading of a section's elements counts as its field slots. The three read the same tree and\n * differ in what a slot of the OTHER kind is to them: content, which keeps the section.\n */\nenum SectionSlotReading {\n /** Any slot that draws one field or nothing: the mounted presence decision (`holdsOnlyFieldSlots`). */\n PRESENCE = 'presence',\n /** Form slots, with their paths; a display slot is content (`listPlacedFieldSlots`). */\n PLACED = 'placed',\n /** Display slots, with their paths; a form slot is content (`listDisplayedFieldSlots`). */\n DISPLAYED = 'displayed',\n}\n\n/** What a subtree amounts to for `holdsOnlyFieldSlots`. */\nenum SectionSubtreeKind {\n /** At least one field slot, and nothing else. */\n FIELD_SLOTS = 'field_slots',\n /** Nothing at all: no slot and no content (a falsy branch, an empty container). */\n NOTHING = 'nothing',\n /** Something a field-presence count cannot see: text, a component, a childless or custom element. */\n CONTENT = 'content',\n}\n\n/** Where a field slot writes, as `FormField` resolves it: the enclosing scopes' names joined to its own. */\nexport interface PlacedFieldSlot {\n path: string;\n /** The slot was handed its own schema, so the form's schema does not decide whether it renders. */\n hasOwnSchema: boolean;\n}\n\n/** Which field a display slot shows, as `DisplayField` resolves it: the enclosing scopes' names joined to its own. */\nexport interface DisplayedFieldSlot {\n path: string;\n /** The schema the slot was handed, if any: `DisplayField` judges that one rather than the record's. */\n ownSchema: z.ZodTypeAny | undefined;\n}\n\n/** The slots a static reading collects, each kind in its own list. */\ninterface SectionSlotsRead {\n placed: PlacedFieldSlot[];\n displayed: DisplayedFieldSlot[];\n}\n\nfunction classifySectionSubtree(nodes: ReactNode, pathPrefix: string, reading: SectionSlotReading, slots: SectionSlotsRead): SectionSubtreeKind {\n let sawFieldSlot = false;\n for (const node of Children.toArray(nodes)) {\n if (!isValidElement(node)) return SectionSubtreeKind.CONTENT;\n const props = node.props as { children?: ReactNode; name?: unknown; schema?: unknown };\n let kind: SectionSubtreeKind;\n if (node.type === Fragment) {\n kind = classifySectionSubtree(props.children, pathPrefix, reading, slots);\n } else if (typeof node.type === 'string') {\n // A plain element is a WRAPPER only when it wraps field slots (a layout `<div className=\"grid\">`).\n // Anything else is content: a childless element (an image, a rule, a spacer), one whose only child\n // is a falsy branch (it may be drawn by CSS), and a custom element (it may render shadow content).\n kind = !node.type.includes('-') && classifySectionSubtree(props.children, pathPrefix, reading, slots) === SectionSubtreeKind.FIELD_SLOTS\n ? SectionSubtreeKind.FIELD_SLOTS\n : SectionSubtreeKind.CONTENT;\n } else {\n const role = (node.type as { [SECTION_CONTENT_ROLE]?: SectionContentRole })[SECTION_CONTENT_ROLE];\n const name = typeof props.name === 'string' ? props.name : undefined;\n const scopedPath = name ? (pathPrefix ? `${pathPrefix}.${name}` : name) : pathPrefix;\n if (role === SectionContentRole.FIELD_SLOT) {\n if (reading === SectionSlotReading.DISPLAYED) {\n kind = SectionSubtreeKind.CONTENT;\n } else {\n slots.placed.push({ path: scopedPath, hasOwnSchema: props.schema !== undefined });\n kind = SectionSubtreeKind.FIELD_SLOTS;\n }\n } else if (role === SectionContentRole.DISPLAY_FIELD_SLOT) {\n // A field slot to the presence decision and to a display host; never a placed (form) slot (see the role).\n if (reading === SectionSlotReading.PLACED) {\n kind = SectionSubtreeKind.CONTENT;\n } else {\n slots.displayed.push({ path: scopedPath, ownSchema: props.schema as z.ZodTypeAny | undefined });\n kind = SectionSubtreeKind.FIELD_SLOTS;\n }\n } else if (role === SectionContentRole.FIELD_SLOT_CONTAINER) {\n // A declared container holding nothing adds nothing, even an `ObjectScope` given a `className`\n // (which renders a styled div). Unlike a bare styled div it scopes names rather than decorating,\n // and when a section's slots are all absent the whole frame hides anyway.\n kind = classifySectionSubtree(props.children, scopedPath, reading, slots);\n } else {\n kind = SectionSubtreeKind.CONTENT;\n }\n }\n if (kind === SectionSubtreeKind.CONTENT) return SectionSubtreeKind.CONTENT;\n if (kind === SectionSubtreeKind.FIELD_SLOTS) sawFieldSlot = true;\n }\n return sawFieldSlot ? SectionSubtreeKind.FIELD_SLOTS : SectionSubtreeKind.NOTHING;\n}\n\n/**\n * True when `children` holds at least one field slot and nothing else. Fragments and declared containers\n * are looked through, and so is a plain element that wraps field slots.\n */\nexport function holdsOnlyFieldSlots(children: ReactNode): boolean {\n return classifySectionSubtree(children, '', SectionSlotReading.PRESENCE, { placed: [], displayed: [] }) === SectionSubtreeKind.FIELD_SLOTS;\n}\n\n/**\n * The field slots `children` places, or `null` when it holds anything besides field slots. Paths are\n * resolved the way `FormField` resolves them (scope names joined to the slot's `name`), starting from\n * `pathPrefix`. Read STATICALLY, from the elements, so a host can decide about a section whose content\n * is not mounted — an inactive tab's panel is not.\n */\nexport function listPlacedFieldSlots(children: ReactNode, pathPrefix = ''): PlacedFieldSlot[] | null {\n const slots: SectionSlotsRead = { placed: [], displayed: [] };\n return classifySectionSubtree(children, pathPrefix, SectionSlotReading.PLACED, slots) === SectionSubtreeKind.FIELD_SLOTS ? slots.placed : null;\n}\n\n/**\n * The display slots `children` places, or `null` when it holds anything besides display slots (a form slot included).\n * Paths are resolved the way `DisplayField` resolves them, starting from `pathPrefix`. Read STATICALLY, for a grouped\n * display host deciding about a section whose content is not mounted (#4459 review D1).\n */\nexport function listDisplayedFieldSlots(children: ReactNode, pathPrefix = ''): DisplayedFieldSlot[] | null {\n const slots: SectionSlotsRead = { placed: [], displayed: [] };\n return classifySectionSubtree(children, pathPrefix, SectionSlotReading.DISPLAYED, slots) === SectionSubtreeKind.FIELD_SLOTS ? slots.displayed : null;\n}\n"]}
|
|
@@ -20,6 +20,20 @@
|
|
|
20
20
|
* section: it wins whenever the gated config admits it (see `active` below).
|
|
21
21
|
*/
|
|
22
22
|
import React from 'react';
|
|
23
|
+
import type { SettingsSectionTarget } from '../../core/config/settings-hub.frontend.schemas';
|
|
24
|
+
/** Resolves a display label for a section/sub-tab ref, falling back to the authored label. */
|
|
25
|
+
type SettingsLabelResolver = (ref: string, fallbackLabel: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* One section's content, whatever its target: an engine panel, a registered component, a resource surface, or a strip
|
|
28
|
+
* of sub-tabs. Exported for the identity portal, which mounts some of the hub's destinations as pages of their own, with
|
|
29
|
+
* no rail, and renders them through this same renderer rather than a copy.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SettingsTargetRenderer({ target, resolveSubTabLabel, subTabRef, onSubTabChange, }: {
|
|
32
|
+
target: SettingsSectionTarget;
|
|
33
|
+
resolveSubTabLabel: SettingsLabelResolver;
|
|
34
|
+
subTabRef?: string;
|
|
35
|
+
onSubTabChange?: (subTabRef: string) => void;
|
|
36
|
+
}): React.JSX.Element;
|
|
23
37
|
export interface SettingsHubProps {
|
|
24
38
|
/** The section the URL names. It is open whenever the gated config admits it; until then, the config default. */
|
|
25
39
|
sectionRef?: string;
|
|
@@ -27,4 +41,5 @@ export interface SettingsHubProps {
|
|
|
27
41
|
subTabRef?: string;
|
|
28
42
|
}
|
|
29
43
|
export declare function SettingsHub({ sectionRef, subTabRef }: SettingsHubProps): React.JSX.Element;
|
|
44
|
+
export {};
|
|
30
45
|
//# sourceMappingURL=SettingsHub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsHub.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/SettingsHub.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsHub.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/SettingsHub.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,OAAO,KAAK,EAKV,qBAAqB,EAEtB,MAAM,+DAA+D,CAAC;AAkGvE,8FAA8F;AAC9F,KAAK,qBAAqB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,cAAc,GACf,EAAE;IACD,MAAM,EAAE,qBAAqB,CAAC;IAC9B,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsCpB;AAqED,MAAM,WAAW,gBAAgB;IAC/B,iHAAiH;IACjH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsV1F"}
|
|
@@ -45,12 +45,14 @@ import { AppPage_ModelCostBreakdownSettings, ModelCostBreakdownScope } from './A
|
|
|
45
45
|
import { AppPage_RepresentativeActivitySettings } from './AppPage_RepresentativeActivitySettings.js';
|
|
46
46
|
import { AppPage_AgentWorkEvaluationExportSettings } from './AppPage_AgentWorkEvaluationExportSettings.js';
|
|
47
47
|
import { ComponentRegistryService } from '../../core/components-registry/component-registry.frontend.service.js';
|
|
48
|
+
import { RegisteredComponentRoot } from '../../core/components-registry/RegisteredComponentRoot.js';
|
|
48
49
|
import { ComponentNotInjected } from '../../core/components-registry/ComponentNotInjected.js';
|
|
49
50
|
import { SettingsPanelRef, SettingsSectionTargetKind } from '../../core/config/settings-hub.frontend.schemas.js';
|
|
50
51
|
import { CommonRoutePaths } from '../../core/runtime/routes.frontend.definitions.js';
|
|
51
52
|
import { useVisibleSettingsHubConfig } from '../../core/config/useVisibleSettingsHubConfig.js';
|
|
52
53
|
import { useI18n } from '../../core/i18n/useI18n.js';
|
|
53
54
|
import { FeatureGate } from '../../core/features/FeatureGate.js';
|
|
55
|
+
import { RequiredFeaturesGatePresentation } from '../../core/features/required-features-gate-presentation.js';
|
|
54
56
|
import { useFeatureAvailability } from '../../core/features/useFeatureAvailability.js';
|
|
55
57
|
import { Alert, AlertDescription } from '../../components/overlays/containers/alert.js';
|
|
56
58
|
import { FeatureUnavailabilityBehavior } from '@wildo-ai/saas-models';
|
|
@@ -136,7 +138,12 @@ function SettingsEnginePanel({ panelRef }) {
|
|
|
136
138
|
return _jsx(AppPage_AgentWorkEvaluationExportSettings, {});
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
/**
|
|
142
|
+
* One section's content, whatever its target: an engine panel, a registered component, a resource surface, or a strip
|
|
143
|
+
* of sub-tabs. Exported for the identity portal, which mounts some of the hub's destinations as pages of their own, with
|
|
144
|
+
* no rail, and renders them through this same renderer rather than a copy.
|
|
145
|
+
*/
|
|
146
|
+
export function SettingsTargetRenderer({ target, resolveSubTabLabel, subTabRef, onSubTabChange, }) {
|
|
140
147
|
switch (target.kind) {
|
|
141
148
|
case SettingsSectionTargetKind.ENGINE_PANEL:
|
|
142
149
|
return _jsx(SettingsEnginePanel, { panelRef: target.panelRef });
|
|
@@ -145,7 +152,7 @@ function SettingsTargetRenderer({ target, resolveSubTabLabel, subTabRef, onSubTa
|
|
|
145
152
|
if (!CustomComponent) {
|
|
146
153
|
return _jsx(ComponentNotInjected, { componentType: target.componentRef, componentName: target.componentRef });
|
|
147
154
|
}
|
|
148
|
-
return (_jsx(React.Suspense, { fallback: _jsx("div", { className: "h-8 animate-pulse motion-reduce:animate-none bg-muted rounded", "aria-hidden": "true" }), children: _jsx(CustomComponent, {}) }));
|
|
155
|
+
return (_jsx(React.Suspense, { fallback: _jsx("div", { className: "h-8 animate-pulse motion-reduce:animate-none bg-muted rounded", "aria-hidden": "true" }), children: _jsx(RegisteredComponentRoot, { componentRef: target.componentRef, children: _jsx(CustomComponent, {}) }) }));
|
|
149
156
|
}
|
|
150
157
|
case SettingsSectionTargetKind.RESOURCE_OPERATION:
|
|
151
158
|
return (_jsx(SettingsResourceOperationPanel, { resourceType: target.resourceType, operation: target.operation, operationVariant: target.operationVariant }));
|
|
@@ -351,7 +358,10 @@ export function SettingsHub({ sectionRef, subTabRef }) {
|
|
|
351
358
|
// first cut of this lost the selected fill while every other class held.
|
|
352
359
|
railItemRecipe.base, railItemRecipe.states.focus, railItemRecipe.states.selected, railItemRecipe.motion.transition), children: [section.icon && renderIcon(section.icon, { size: IconSize.SM }), tSettingsHubSection(section.ref, section.label)] }, section.ref));
|
|
353
360
|
}) })] }, block.group?.ref ?? '__ungrouped'))) })] }, category.ref));
|
|
354
|
-
}) }), _jsx("div", { className: cn('min-w-0 flex-1 overflow-y-auto p-card-lg', isMobile && !mobileShowsSection && 'hidden'), children: config.sections.filter(section => section.ref === active).map(section => (_jsx(React.Fragment, { children: section.entitlementFeatureId ? (
|
|
361
|
+
}) }), _jsx("div", { className: cn('min-w-0 flex-1 overflow-y-auto p-card-lg', isMobile && !mobileShowsSection && 'hidden'), children: config.sections.filter(section => section.ref === active).map(section => (_jsx(React.Fragment, { children: section.entitlementFeatureId && section.entitlementWithholdsContent ? (
|
|
362
|
+
// The feature sells the CONTENT (the organization audit log): nothing is configured to keep, and the
|
|
363
|
+
// backend refuses the read without it, so the feature's prompt takes the content's place.
|
|
364
|
+
_jsx("div", { className: "space-y-card", children: _jsx(FeatureGate, { featureId: section.entitlementFeatureId, children: _jsx(SettingsTargetRenderer, { target: section.target, resolveSubTabLabel: tSettingsHubSection, subTabRef: section.ref === active ? subTabRef : undefined, onSubTabChange: handleSubTabChange }) }) })) : section.entitlementFeatureId ? (
|
|
355
365
|
// Section SURVIVED because the app OFFERS this feature (`runtimeAvailability`
|
|
356
366
|
// capability = plan-independent `isFeatureOffered`), or because something is still
|
|
357
367
|
// configured here (#3126). Render its body through the entitlement gate: entitled →
|
|
@@ -398,6 +408,6 @@ function EntitlementGatedSettingsSection({ featureId, keptConfigurationNotice, c
|
|
|
398
408
|
// Entitled, or a HIDE feature: the gate renders the content, or nothing.
|
|
399
409
|
return _jsx("div", { className: "space-y-card", children: _jsx(FeatureGate, { featureId: featureId, children: children }) });
|
|
400
410
|
}
|
|
401
|
-
return (_jsxs("div", { className: "space-y-card", children: [_jsx(Alert, { variant: "info", children: _jsx(AlertDescription, { children: keptConfigurationNotice }) }), hasUpgradePath && _jsx(FeatureGate, { featureId: featureId, children: null }), children] }));
|
|
411
|
+
return (_jsxs("div", { className: "space-y-card", children: [_jsx(Alert, { variant: "info", children: _jsx(AlertDescription, { children: keptConfigurationNotice }) }), hasUpgradePath && _jsx(FeatureGate, { featureId: featureId, presentation: RequiredFeaturesGatePresentation.TILE, children: null }), children] }));
|
|
402
412
|
}
|
|
403
413
|
//# sourceMappingURL=SettingsHub.js.map
|