@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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChartKpiValueFormat, } from '@wildo-ai/saas-models';
|
|
3
|
-
import { TypographyVariant } from '@wildo-ai/presets-components-models';
|
|
2
|
+
import { ChartKpiTargetDirection, ChartKpiValueFormat, } from '@wildo-ai/saas-models';
|
|
3
|
+
import { FrontendComponentType, TypographyVariant } from '@wildo-ai/presets-components-models';
|
|
4
4
|
import { cn } from '../../../core/ui/cn.js';
|
|
5
5
|
import { useI18n } from '../../../core/i18n/useI18n.js';
|
|
6
6
|
import { Text } from '../../../components/typography/text.js';
|
|
@@ -29,14 +29,73 @@ export function formatKpiFigure(value, config, formatNumber) {
|
|
|
29
29
|
? formatNumber(value / 100, { style: 'percent', maximumFractionDigits })
|
|
30
30
|
: formatNumber(value, { maximumFractionDigits });
|
|
31
31
|
}
|
|
32
|
+
/** The same figure over the period before, when the chart compares (`period.previous`); `null` when there is none. */
|
|
33
|
+
export function resolveKpiPreviousFigure(definition, data) {
|
|
34
|
+
const previous = data.period?.previous;
|
|
35
|
+
return previous ? resolveKpiFigure(definition, previous) : null;
|
|
36
|
+
}
|
|
37
|
+
/** Whether the figure meets its target: at or above it for {@link ChartKpiTargetDirection.AT_LEAST}, at or below otherwise. */
|
|
38
|
+
export function kpiMeetsTarget(value, target) {
|
|
39
|
+
return target.direction === ChartKpiTargetDirection.AT_LEAST ? value >= target.value : value <= target.value;
|
|
40
|
+
}
|
|
41
|
+
/** Whether a KPI's change since the previous period is good, bad or neither, which colours its line. */
|
|
42
|
+
export var KpiChangeTone;
|
|
43
|
+
(function (KpiChangeTone) {
|
|
44
|
+
/** Towards the side the target's direction calls good. */
|
|
45
|
+
KpiChangeTone["GOOD"] = "good";
|
|
46
|
+
/** Away from it. */
|
|
47
|
+
KpiChangeTone["BAD"] = "bad";
|
|
48
|
+
/** No target says which way is good, or nothing changed: shown uncoloured. */
|
|
49
|
+
KpiChangeTone["NEUTRAL"] = "neutral";
|
|
50
|
+
})(KpiChangeTone || (KpiChangeTone = {}));
|
|
51
|
+
/** Where a KPI stands against its target. */
|
|
52
|
+
export var KpiTargetVerdict;
|
|
53
|
+
(function (KpiTargetVerdict) {
|
|
54
|
+
KpiTargetVerdict["MET"] = "met";
|
|
55
|
+
KpiTargetVerdict["MISSED"] = "missed";
|
|
56
|
+
/** The figure has no value, so it neither meets nor misses the target. */
|
|
57
|
+
KpiTargetVerdict["UNKNOWN"] = "unknown";
|
|
58
|
+
})(KpiTargetVerdict || (KpiTargetVerdict = {}));
|
|
59
|
+
/**
|
|
60
|
+
* Whether a change is good, bad or neither: decided by the target's direction, the only statement of which way is good.
|
|
61
|
+
* Without a target, or with no change, it is neither, and the change is shown uncoloured.
|
|
62
|
+
*/
|
|
63
|
+
export function kpiChangeTone(change, target) {
|
|
64
|
+
if (!target || change === 0)
|
|
65
|
+
return KpiChangeTone.NEUTRAL;
|
|
66
|
+
return (change > 0) === (target.direction === ChartKpiTargetDirection.AT_LEAST) ? KpiChangeTone.GOOD : KpiChangeTone.BAD;
|
|
67
|
+
}
|
|
68
|
+
/** Where a figure stands against its target, {@link KpiTargetVerdict.UNKNOWN} when the figure has no value. */
|
|
69
|
+
export function kpiTargetVerdict(value, target) {
|
|
70
|
+
if (value === null)
|
|
71
|
+
return KpiTargetVerdict.UNKNOWN;
|
|
72
|
+
return kpiMeetsTarget(value, target) ? KpiTargetVerdict.MET : KpiTargetVerdict.MISSED;
|
|
73
|
+
}
|
|
32
74
|
/** The typographic sign for "no value". Not words, so nothing to translate: the figure is simply absent. */
|
|
33
75
|
const NO_VALUE = '—';
|
|
34
76
|
export function ChartKpiFigure({ definition, data, className }) {
|
|
35
|
-
const { formatNumber } = useI18n();
|
|
77
|
+
const { formatNumber, tComponent } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });
|
|
78
|
+
// The figure's words are the chart component's own labels, read where they live (`components.HIGH_LEVEL_VIEWS_CHART.*`).
|
|
79
|
+
const t = (key, params) => tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, key, params);
|
|
36
80
|
const config = definition.chartTypeConfig;
|
|
37
81
|
const value = resolveKpiFigure(definition, data);
|
|
38
82
|
const written = formatKpiFigure(value, config, formatNumber);
|
|
39
83
|
const showProgress = config?.showProgress === true && config.valueFormat === ChartKpiValueFormat.PERCENT && value !== null;
|
|
40
|
-
|
|
84
|
+
const target = config?.target;
|
|
85
|
+
const period = config?.period;
|
|
86
|
+
const previous = period?.comparePrevious ? resolveKpiPreviousFigure(definition, data) : null;
|
|
87
|
+
const change = value !== null && previous !== null ? value - previous : null;
|
|
88
|
+
// The change, signed. A percentage's change is in PERCENTAGE POINTS (42% after 37% is +5 points), written as a number with its
|
|
89
|
+
// own label: written with a percent sign it would read as a relative change (which is 13.5% there).
|
|
90
|
+
const isPercent = config?.valueFormat === ChartKpiValueFormat.PERCENT;
|
|
91
|
+
const writtenChange = change === null ? null : formatNumber(change, { maximumFractionDigits: config?.maximumFractionDigits ?? 0, signDisplay: 'exceptZero' });
|
|
92
|
+
const changeTone = change === null ? KpiChangeTone.NEUTRAL : kpiChangeTone(change, target);
|
|
93
|
+
const targetVerdict = target ? kpiTargetVerdict(value, target) : null;
|
|
94
|
+
const writtenTarget = target ? formatKpiFigure(target.value, config, formatNumber) ?? '' : '';
|
|
95
|
+
return (_jsxs("div", { className: cn('chart-view flex min-w-0 flex-col justify-center gap-element', className), "data-chart-kpi": definition.ref, children: [_jsx(Text, { as: "span", typography: TypographyVariant.DATA, className: "text-3xl font-semibold text-foreground", children: written ?? NO_VALUE }), showProgress && _jsx(Progress, { value: Math.min(100, Math.max(0, value)), "aria-hidden": true, className: "h-1.5" }), period && (_jsx(Text, { as: "span", className: "text-xs text-muted-foreground", children: t('kpiPeriod', { count: period.lengthDays }) })), writtenChange !== null && period && (
|
|
96
|
+
// The words say the change and its sign; the colour only repeats whether it is good, so nothing rests on colour.
|
|
97
|
+
_jsx(Text, { as: "span", className: cn('text-sm', changeTone === KpiChangeTone.GOOD && 'text-success', changeTone === KpiChangeTone.BAD && 'text-destructive', changeTone === KpiChangeTone.NEUTRAL && 'text-muted-foreground'), "data-kpi-change": changeTone, children: t(isPercent ? 'kpiChangeFromPreviousPoints' : 'kpiChangeFromPrevious', { change: writtenChange, count: period.lengthDays }) })), target && targetVerdict && (
|
|
98
|
+
// One label per verdict, so a translation orders the target and the verdict as its language does.
|
|
99
|
+
_jsx(Text, { as: "span", className: cn('text-sm', targetVerdict === KpiTargetVerdict.MET && 'text-success', targetVerdict === KpiTargetVerdict.MISSED && 'text-destructive', targetVerdict === KpiTargetVerdict.UNKNOWN && 'text-muted-foreground'), "data-kpi-target": targetVerdict, children: t(targetVerdict === KpiTargetVerdict.MET ? 'kpiTargetMet' : targetVerdict === KpiTargetVerdict.MISSED ? 'kpiTargetMissed' : 'kpiTarget', { target: writtenTarget }) }))] }));
|
|
41
100
|
}
|
|
42
101
|
//# sourceMappingURL=ChartKpiFigure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartKpiFigure.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartKpiFigure.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,mBAAmB,GAIpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,kDAAkD,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAA2C,EAAE,IAA4C;IACxH,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACpD,MAAM,GAAG,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAC9E,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACjG,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,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AAC,wCAAwC,YACnG,OAAO,IAAI,QAAQ,GACf,EAEN,YAAY,IAAI,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,uBAAc,SAAS,EAAC,OAAO,GAAG,IACjG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * ChartKpiFigure — a {@link ChartType.KPI} chart drawn as one figure (#2299)\n *\n * A KPI is a chart whose query groups by nothing: the aggregation answers one row, the whole scope's value of its\n * measures, and the chart's one series names the measure that IS the figure. It is fetched, authorized, scoped and\n * feature-gated exactly as every other chart (`ChartView` → `useChartData` → the aggregation gate); only the drawing\n * differs, so a dashboard can put a count, a sum or a rate beside its charts without a second mechanism.\n *\n * Rendered with the engine's typography and progress components, never ECharts: a figure has no axis to draw.\n * ────────────────────────────────────────────────────────────── */\n\nimport React from 'react';\nimport {\n ChartKpiValueFormat,\n type AggregationQueryResponse,\n type ChartDefinition,\n type ChartTypeConfig_Kpi,\n} from '@wildo-ai/saas-models';\nimport { TypographyVariant } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { Progress } from '~wildo-frontend-lib/components/feedback/progress';\n\n/**\n * The figure a KPI chart answers: its one series' measure in the one row, or `null` when there is no value (an average,\n * a sum or a minimum of nothing — the aggregation answers `null` there, and a rate over an empty scope too). A count is\n * never `null`: the aggregation answers 0 for an empty scope. A value the wire carries as a numeric string is read as\n * its number; anything else is not a figure.\n */\nexport function resolveKpiFigure(definition: Pick<ChartDefinition, 'series'>, data: Pick<AggregationQueryResponse, 'data'>): number | null {\n const measureRef = definition.series[0]?.measureRef;\n const raw = measureRef === undefined ? undefined : data.data[0]?.[measureRef];\n if (raw === null || raw === undefined || raw === '') return null;\n const value = typeof raw === 'number' ? raw : typeof raw === 'string' ? Number(raw) : Number.NaN;\n return Number.isFinite(value) ? value : null;\n}\n\n/** The figure written in the reader's locale, as its chart's `chartTypeConfig` says. `null` when there is no value. */\nexport function formatKpiFigure(\n value: number | null,\n config: ChartTypeConfig_Kpi | undefined,\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string,\n): string | null {\n if (value === null) return null;\n const maximumFractionDigits = config?.maximumFractionDigits ?? 0;\n // A PERCENT value is already in percent units (`completed / total * 100`); `Intl` wants the fraction.\n return config?.valueFormat === ChartKpiValueFormat.PERCENT\n ? formatNumber(value / 100, { style: 'percent', maximumFractionDigits })\n : formatNumber(value, { maximumFractionDigits });\n}\n\n/** The typographic sign for \"no value\". Not words, so nothing to translate: the figure is simply absent. */\nconst NO_VALUE = '—';\n\nexport interface ChartKpiFigureProps {\n definition: ChartDefinition;\n data: AggregationQueryResponse;\n className?: string;\n}\n\nexport function ChartKpiFigure({ definition, data, className }: ChartKpiFigureProps): React.JSX.Element {\n const { formatNumber } = useI18n();\n const config = definition.chartTypeConfig as ChartTypeConfig_Kpi | undefined;\n const value = resolveKpiFigure(definition, data);\n const written = formatKpiFigure(value, config, formatNumber);\n const showProgress = config?.showProgress === true && config.valueFormat === ChartKpiValueFormat.PERCENT && value !== null;\n\n return (\n <div className={cn('chart-view flex min-w-0 flex-col justify-center gap-element', className)} data-chart-kpi={definition.ref}>\n {/* The theme's DATA voice: the face and figures a theme gives numbers. */}\n <Text as=\"span\" typography={TypographyVariant.DATA} className=\"text-3xl font-semibold text-foreground\">\n {written ?? NO_VALUE}\n </Text>\n {/* Repeats the figure above as a bar, so it is hidden from assistive technology: the figure already says it. */}\n {showProgress && <Progress value={Math.min(100, Math.max(0, value))} aria-hidden className=\"h-1.5\" />}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ChartKpiFigure.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartKpiFigure.tsx"],"names":[],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,OAAO,IAAI,uBAAuB,CAAC,qBACzM,aAAa,YAE7B,CAAC,CAAC,aAAa,KAAK,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,GAC/J,CACR,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * ChartKpiFigure — a {@link ChartType.KPI} chart drawn as one figure (#2299)\n *\n * A KPI is a chart whose query groups by nothing: the aggregation answers one row, the whole scope's value of its\n * measures, and the chart's one series names the measure that IS the figure. It is fetched, authorized, scoped and\n * feature-gated exactly as every other chart (`ChartView` → `useChartData` → the aggregation gate); only the drawing\n * differs, so a dashboard can put a count, a sum or a rate beside its charts without a second mechanism.\n *\n * Rendered with the engine's typography and progress components, never ECharts: a figure has no axis to draw.\n *\n * A figure read at a glance carries what it is measured against, or a person cannot tell whether to act. So a KPI may\n * declare a TARGET (a value, and which side of it is good), shown with whether the figure meets it, and a PERIOD (the\n * last N days), shown as its caption and, when the chart compares, with the change since the N days before. The\n * backend reads the previous window through the same gate as the figure.\n * spec-cite: Stephen Few, \"Dashboard Confusion\" (2004), https://www.perceptualedge.com/articles/ie/dashboard_confusion.pdf: a dashboard's measures need context, such as a target or a comparison with an earlier period, to say whether they are good or bad.\n * ────────────────────────────────────────────────────────────── */\n\nimport React from 'react';\nimport {\n ChartKpiTargetDirection,\n ChartKpiValueFormat,\n type AggregationQueryResponse,\n type ChartDefinition,\n type ChartTypeConfig_Kpi,\n} from '@wildo-ai/saas-models';\nimport { FrontendComponentType, TypographyVariant } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { Progress } from '~wildo-frontend-lib/components/feedback/progress';\n\n/**\n * The figure a KPI chart answers: its one series' measure in the one row, or `null` when there is no value (an average,\n * a sum or a minimum of nothing — the aggregation answers `null` there, and a rate over an empty scope too). A count is\n * never `null`: the aggregation answers 0 for an empty scope. A value the wire carries as a numeric string is read as\n * its number; anything else is not a figure.\n */\nexport function resolveKpiFigure(definition: Pick<ChartDefinition, 'series'>, data: Pick<AggregationQueryResponse, 'data'>): number | null {\n const measureRef = definition.series[0]?.measureRef;\n const raw = measureRef === undefined ? undefined : data.data[0]?.[measureRef];\n if (raw === null || raw === undefined || raw === '') return null;\n const value = typeof raw === 'number' ? raw : typeof raw === 'string' ? Number(raw) : Number.NaN;\n return Number.isFinite(value) ? value : null;\n}\n\n/** The figure written in the reader's locale, as its chart's `chartTypeConfig` says. `null` when there is no value. */\nexport function formatKpiFigure(\n value: number | null,\n config: ChartTypeConfig_Kpi | undefined,\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string,\n): string | null {\n if (value === null) return null;\n const maximumFractionDigits = config?.maximumFractionDigits ?? 0;\n // A PERCENT value is already in percent units (`completed / total * 100`); `Intl` wants the fraction.\n return config?.valueFormat === ChartKpiValueFormat.PERCENT\n ? formatNumber(value / 100, { style: 'percent', maximumFractionDigits })\n : formatNumber(value, { maximumFractionDigits });\n}\n\n/** The same figure over the period before, when the chart compares (`period.previous`); `null` when there is none. */\nexport function resolveKpiPreviousFigure(definition: Pick<ChartDefinition, 'series'>, data: Pick<AggregationQueryResponse, 'period'>): number | null {\n const previous = data.period?.previous;\n return previous ? resolveKpiFigure(definition, previous) : null;\n}\n\n/** Whether the figure meets its target: at or above it for {@link ChartKpiTargetDirection.AT_LEAST}, at or below otherwise. */\nexport function kpiMeetsTarget(value: number, target: NonNullable<ChartTypeConfig_Kpi['target']>): boolean {\n return target.direction === ChartKpiTargetDirection.AT_LEAST ? value >= target.value : value <= target.value;\n}\n\n/** Whether a KPI's change since the previous period is good, bad or neither, which colours its line. */\nexport enum KpiChangeTone {\n /** Towards the side the target's direction calls good. */\n GOOD = 'good',\n /** Away from it. */\n BAD = 'bad',\n /** No target says which way is good, or nothing changed: shown uncoloured. */\n NEUTRAL = 'neutral',\n}\n\n/** Where a KPI stands against its target. */\nexport enum KpiTargetVerdict {\n MET = 'met',\n MISSED = 'missed',\n /** The figure has no value, so it neither meets nor misses the target. */\n UNKNOWN = 'unknown',\n}\n\n/**\n * Whether a change is good, bad or neither: decided by the target's direction, the only statement of which way is good.\n * Without a target, or with no change, it is neither, and the change is shown uncoloured.\n */\nexport function kpiChangeTone(change: number, target: ChartTypeConfig_Kpi['target']): KpiChangeTone {\n if (!target || change === 0) return KpiChangeTone.NEUTRAL;\n return (change > 0) === (target.direction === ChartKpiTargetDirection.AT_LEAST) ? KpiChangeTone.GOOD : KpiChangeTone.BAD;\n}\n\n/** Where a figure stands against its target, {@link KpiTargetVerdict.UNKNOWN} when the figure has no value. */\nexport function kpiTargetVerdict(value: number | null, target: NonNullable<ChartTypeConfig_Kpi['target']>): KpiTargetVerdict {\n if (value === null) return KpiTargetVerdict.UNKNOWN;\n return kpiMeetsTarget(value, target) ? KpiTargetVerdict.MET : KpiTargetVerdict.MISSED;\n}\n\n/** The typographic sign for \"no value\". Not words, so nothing to translate: the figure is simply absent. */\nconst NO_VALUE = '—';\n\nexport interface ChartKpiFigureProps {\n definition: ChartDefinition;\n data: AggregationQueryResponse;\n className?: string;\n}\n\nexport function ChartKpiFigure({ definition, data, className }: ChartKpiFigureProps): React.JSX.Element {\n const { formatNumber, tComponent } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });\n // The figure's words are the chart component's own labels, read where they live (`components.HIGH_LEVEL_VIEWS_CHART.*`).\n const t = (key: string, params?: Record<string, string | number>) => tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, key, params);\n const config = definition.chartTypeConfig as ChartTypeConfig_Kpi | undefined;\n const value = resolveKpiFigure(definition, data);\n const written = formatKpiFigure(value, config, formatNumber);\n const showProgress = config?.showProgress === true && config.valueFormat === ChartKpiValueFormat.PERCENT && value !== null;\n const target = config?.target;\n const period = config?.period;\n const previous = period?.comparePrevious ? resolveKpiPreviousFigure(definition, data) : null;\n const change = value !== null && previous !== null ? value - previous : null;\n // The change, signed. A percentage's change is in PERCENTAGE POINTS (42% after 37% is +5 points), written as a number with its\n // own label: written with a percent sign it would read as a relative change (which is 13.5% there).\n const isPercent = config?.valueFormat === ChartKpiValueFormat.PERCENT;\n const writtenChange = change === null ? null : formatNumber(change, { maximumFractionDigits: config?.maximumFractionDigits ?? 0, signDisplay: 'exceptZero' });\n const changeTone = change === null ? KpiChangeTone.NEUTRAL : kpiChangeTone(change, target);\n const targetVerdict = target ? kpiTargetVerdict(value, target) : null;\n const writtenTarget = target ? formatKpiFigure(target.value, config, formatNumber) ?? '' : '';\n\n return (\n <div className={cn('chart-view flex min-w-0 flex-col justify-center gap-element', className)} data-chart-kpi={definition.ref}>\n {/* The theme's DATA voice: the face and figures a theme gives numbers. */}\n <Text as=\"span\" typography={TypographyVariant.DATA} className=\"text-3xl font-semibold text-foreground\">\n {written ?? NO_VALUE}\n </Text>\n {/* Repeats the figure above as a bar, so it is hidden from assistive technology: the figure already says it. */}\n {showProgress && <Progress value={Math.min(100, Math.max(0, value))} aria-hidden className=\"h-1.5\" />}\n {period && (\n <Text as=\"span\" className=\"text-xs text-muted-foreground\">{t('kpiPeriod', { count: period.lengthDays })}</Text>\n )}\n {writtenChange !== null && period && (\n // The words say the change and its sign; the colour only repeats whether it is good, so nothing rests on colour.\n <Text\n as=\"span\"\n className={cn('text-sm', changeTone === KpiChangeTone.GOOD && 'text-success', changeTone === KpiChangeTone.BAD && 'text-destructive', changeTone === KpiChangeTone.NEUTRAL && 'text-muted-foreground')}\n data-kpi-change={changeTone}\n >\n {t(isPercent ? 'kpiChangeFromPreviousPoints' : 'kpiChangeFromPrevious', { change: writtenChange, count: period.lengthDays })}\n </Text>\n )}\n {target && targetVerdict && (\n // One label per verdict, so a translation orders the target and the verdict as its language does.\n <Text\n as=\"span\"\n className={cn('text-sm', targetVerdict === KpiTargetVerdict.MET && 'text-success', targetVerdict === KpiTargetVerdict.MISSED && 'text-destructive', targetVerdict === KpiTargetVerdict.UNKNOWN && 'text-muted-foreground')}\n data-kpi-target={targetVerdict}\n >\n {t(targetVerdict === KpiTargetVerdict.MET ? 'kpiTargetMet' : targetVerdict === KpiTargetVerdict.MISSED ? 'kpiTargetMissed' : 'kpiTarget', { target: writtenTarget })}\n </Text>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;oEAQoE;AAEpE,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartView.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;oEAQoE;AAEpE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAa,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAoB/F,OAAO,KAAK,EACV,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,6DAA6D,CAAC;AAYrE,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,kFAAkF;IAClF,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,+BAA+B,CAAC;IACpD,8DAA8D;IAC9D,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,qFAAqF;IACrF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAmP9C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* This file is lazy-loaded via React.lazy() in AppRouter.
|
|
10
10
|
* ────────────────────────────────────────────────────────────── */
|
|
11
11
|
import { useRef, useCallback, useMemo } from 'react';
|
|
12
|
+
import { CHART_VIEW_DEFAULT_HEIGHT } from './chart-view-defaults.js';
|
|
12
13
|
import { ChartType } from '@wildo-ai/saas-models';
|
|
13
14
|
import { FrontendComponentType } from '@wildo-ai/presets-components-models';
|
|
14
15
|
import { useUI } from '../../../core/ui/useUI.js';
|
|
@@ -20,12 +21,15 @@ import { useResolvedChartRuntimeDescriptor } from './chart-runtime.utils.js';
|
|
|
20
21
|
import { useChartTheme, getWildoThemeName } from './chart-theme-bridge.js';
|
|
21
22
|
import { buildDimensionEnumMeta } from './enum-color-bridge.js';
|
|
22
23
|
import { buildEChartsOption } from './option-builder/echarts-option-builder.js';
|
|
24
|
+
import { chartDefinitionLabelKeys, createChartLabelResolver, withSeriesLabelKeys } from './option-builder/builder-utils.js';
|
|
23
25
|
import { ChartLoadingSkeleton } from './ChartLoadingSkeleton.js';
|
|
24
26
|
import { ChartErrorState } from './ChartErrorState.js';
|
|
25
27
|
import { ChartEmptyState } from './ChartEmptyState.js';
|
|
26
28
|
import { ChartKpiFigure } from './ChartKpiFigure.js';
|
|
27
29
|
import { buildResolvedInsertedChartDescriptor, resolveInsertedChartView, } from '../../../core/config/chart-view.frontend.schemas.js';
|
|
28
30
|
import { useResourceRegistry } from '../../../core/resources/useResourceRegistry.js';
|
|
31
|
+
import { FrontendInsertedViewHostKind } from '../../../core/config/inserted-view.frontend.schemas.js';
|
|
32
|
+
import { buildChartMarkLabelKey, buildChartSeriesLabelKey, buildResourceViewTranslationRef } from '../../../core/navigation/view-title-resolution.js';
|
|
29
33
|
// Direct ECharts binding. Replaces `echarts-for-react`, whose `'finished'`-gated
|
|
30
34
|
// double-init hangs on ECharts 6.0.0 (see WildoEChart for the full analysis).
|
|
31
35
|
// ECharts stays behind this file's app-level React.lazy boundary via WildoEChart's
|
|
@@ -41,11 +45,11 @@ import { Text } from '../../../components/typography/text.js';
|
|
|
41
45
|
* 3. Build ECharts option from definition + data
|
|
42
46
|
* 4. Render with echarts-for-react
|
|
43
47
|
*/
|
|
44
|
-
export const ChartView = ({ viewRef, document: documentProp, viewDefinition: viewDefinitionProp, runtimeDescriptor, contextResourceIdentifiers, urlParamValues, inputs, className = '', width = '100%', height =
|
|
48
|
+
export const ChartView = ({ viewRef, document: documentProp, viewDefinition: viewDefinitionProp, runtimeDescriptor, contextResourceIdentifiers, urlParamValues, inputs, className = '', width = '100%', height = CHART_VIEW_DEFAULT_HEIGHT, localErrorOnly = false, }) => {
|
|
45
49
|
const { registry } = useResourceRegistry();
|
|
46
50
|
const { getChartStylePreset, isDark } = useUI();
|
|
47
51
|
const chartStylePreset = getChartStylePreset();
|
|
48
|
-
const { t, isReady, resolvedRegionalPreferences } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });
|
|
52
|
+
const { t, tComponent, isReady, resolvedRegionalPreferences } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });
|
|
49
53
|
const resizeObserverRef = useRef(null);
|
|
50
54
|
const echartsRef = useRef(null);
|
|
51
55
|
// Register/update chart theme with current style preset
|
|
@@ -67,7 +71,29 @@ export const ChartView = ({ viewRef, document: documentProp, viewDefinition: vie
|
|
|
67
71
|
explicitInputs: inputs,
|
|
68
72
|
urlParamValues,
|
|
69
73
|
});
|
|
70
|
-
const
|
|
74
|
+
const runtimeDefinition = runtime?.chartDefinition;
|
|
75
|
+
/*
|
|
76
|
+
* Each series is named by a LABEL (`resolveSeriesName`): the key the definition names in `nameKey`, else the series'
|
|
77
|
+
* own key under this chart view's label keys, which the labelling pipeline plans beside the chart's title. A chart
|
|
78
|
+
* drawn outside any resource view (a development preview) has no view keys, and its series show their refs.
|
|
79
|
+
*/
|
|
80
|
+
const identity = effectiveRuntimeDescriptor?.identity;
|
|
81
|
+
const seriesTranslationRef = identity?.hostKind === FrontendInsertedViewHostKind.RESOURCE
|
|
82
|
+
? buildResourceViewTranslationRef(identity.hostRef, identity.localRef)
|
|
83
|
+
: undefined;
|
|
84
|
+
const definition = useMemo(() => (runtimeDefinition && seriesTranslationRef
|
|
85
|
+
? withSeriesLabelKeys(runtimeDefinition, (seriesRef) => buildChartSeriesLabelKey(seriesTranslationRef, seriesRef), (markRef) => buildChartMarkLabelKey(seriesTranslationRef, markRef))
|
|
86
|
+
: runtimeDefinition), [runtimeDefinition, seriesTranslationRef]);
|
|
87
|
+
const seriesLabelKeys = useMemo(() => chartDefinitionLabelKeys(definition), [definition]);
|
|
88
|
+
const { isReady: isSeriesLabelsReady } = useI18n({ keys: seriesLabelKeys });
|
|
89
|
+
/*
|
|
90
|
+
* The builders' resolver (`createChartLabelResolver`): a bare ref is a chart component label, any other key a path
|
|
91
|
+
* from the root. The series keys are requested above only so they are loaded before the chart draws; they are read
|
|
92
|
+
* through the same `t`. Rebuilt when they settle, so the legend shows the words rather than the keys.
|
|
93
|
+
*/
|
|
94
|
+
const tChart = useMemo(() => createChartLabelResolver({ tComponent, t }),
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
[tComponent, t, isSeriesLabelsReady]);
|
|
71
97
|
// Fetch chart data
|
|
72
98
|
const { data, loading, error, refetch } = useChartData(definition, runtime?.executionChartRef, runtime?.resolvedInputs, runtime?.contextResourceIdentifiers, urlParamValues, localErrorOnly, resolvedRegionalPreferences.timezone);
|
|
73
99
|
// ResizeObserver for container.
|
|
@@ -141,8 +167,8 @@ export const ChartView = ({ viewRef, document: documentProp, viewDefinition: vie
|
|
|
141
167
|
// A KPI is a figure, not a drawing (#2299): it builds no ECharts option and renders `ChartKpiFigure` below.
|
|
142
168
|
const isKpi = definition?.chartType === ChartType.KPI;
|
|
143
169
|
const option = useMemo(() => (definition && !isKpi && data && data.data.length > 0)
|
|
144
|
-
? buildEChartsOption(definition, data, undefined, chartStylePreset,
|
|
145
|
-
: null, [definition, isKpi, data, chartStylePreset,
|
|
170
|
+
? buildEChartsOption(definition, data, undefined, chartStylePreset, tChart, dimensionEnumMeta, resolvedRegionalPreferences.locale)
|
|
171
|
+
: null, [definition, isKpi, data, chartStylePreset, tChart, dimensionEnumMeta, resolvedRegionalPreferences.locale]);
|
|
146
172
|
// Not found
|
|
147
173
|
if (!definition) {
|
|
148
174
|
return _jsx(ViewNotFound, { viewKind: "chart", viewRef: viewRef });
|
|
@@ -165,7 +191,7 @@ export const ChartView = ({ viewRef, document: documentProp, viewDefinition: vie
|
|
|
165
191
|
if (!option) {
|
|
166
192
|
return _jsx(ChartEmptyState, {});
|
|
167
193
|
}
|
|
168
|
-
if (!isReady || !isResourceLabelsReady)
|
|
194
|
+
if (!isReady || !isResourceLabelsReady || !isSeriesLabelsReady)
|
|
169
195
|
return null;
|
|
170
196
|
// #4084: groups of a resource declaring `auditReads` too small to show carry no figures, and are drawn as no value
|
|
171
197
|
// (`measureValueOrNull`). The line says so, so a missing slice or bar is not read as an empty group.
|
|
@@ -184,7 +210,7 @@ export const ChartView = ({ viewRef, document: documentProp, viewDefinition: vie
|
|
|
184
210
|
// properties of undefined (reading 'group')`. A synchronous flush runs
|
|
185
211
|
// the full resize→render pipeline in order and renders cleanly with
|
|
186
212
|
// animation intact.
|
|
187
|
-
lazyUpdate: false, onChartReady: onChartReady }, isDark ? 'dark' : 'light') }), suppressedGroupCount > 0 && (_jsx(Text, { className: "text-xs text-muted-foreground", children:
|
|
213
|
+
lazyUpdate: false, onChartReady: onChartReady }, isDark ? 'dark' : 'light') }), suppressedGroupCount > 0 && (_jsx(Text, { className: "text-xs text-muted-foreground", children: tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, 'suppressedGroupsNotice', { count: suppressedGroupCount }) }))] }));
|
|
188
214
|
};
|
|
189
215
|
export default ChartView;
|
|
190
216
|
//# sourceMappingURL=ChartView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;oEAQoE;AAEpE,OAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,SAAS,EAA+C,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EA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C,EAAE,SAAS,EAAE,CAAC,EAAE,YACrC,KAAC,WAAW;gBACV,wEAAwE;gBACxE,8DAA8D;oBAE9D,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,iBAAiB,EAAE,EAC1B,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EACxC,QAAQ,EAAE,IAAI;oBACZ,uEAAuE;oBACvE,wEAAwE;oBACxE,kEAAkE;oBAClE,sEAAsE;oBACtE,uEAAuE;oBACvE,uEAAuE;oBACvE,sEAAsE;oBACtE,uEAAuE;oBACvE,oEAAoE;oBACpE,oBAAoB;oBACtB,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,YAAY,IAhBrB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAiB9B,GACI,EACL,oBAAoB,GAAG,CAAC,IAAI,CAC3B,KAAC,IAAI,IAAC,SAAS,EAAC,+BAA+B,YAAE,CAAC,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,GAAQ,CACtH,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * ChartView — ECharts-based chart component\n *\n * Fetches data from backend via POST /api/charts/:chartRef/data,\n * combines with the visual encoding from the chart definition,\n * and renders via ECharts.\n *\n * This file is lazy-loaded via React.lazy() in AppRouter.\n * ────────────────────────────────────────────────────────────── */\n\nimport React, { useRef, useCallback, useMemo } from 'react';\nimport { ChartType, type ChartDefinition, type ChartInputValues } from '@wildo-ai/saas-models';\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { ViewNotFound } from '~wildo-frontend-lib/components/views/ViewNotFound';\nimport { useChartData } from './chart-view.utils';\nimport { useResolvedChartRuntimeDescriptor } from './chart-runtime.utils';\nimport { useChartTheme, getWildoThemeName } from './chart-theme-bridge';\nimport { buildDimensionEnumMeta } from './enum-color-bridge';\nimport { buildEChartsOption } from './option-builder/echarts-option-builder';\nimport { ChartLoadingSkeleton } from './ChartLoadingSkeleton';\nimport { ChartErrorState } from './ChartErrorState';\nimport { ChartEmptyState } from './ChartEmptyState';\nimport { ChartKpiFigure } from './ChartKpiFigure';\nimport {\n buildResolvedInsertedChartDescriptor,\n resolveInsertedChartView,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport type {\n InsertedChartDeclaration,\n ResolvedInsertedChartDescriptor,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\n\n// Direct ECharts binding. Replaces `echarts-for-react`, whose `'finished'`-gated\n// double-init hangs on ECharts 6.0.0 (see WildoEChart for the full analysis).\n// ECharts stays behind this file's app-level React.lazy boundary via WildoEChart's\n// static `echarts-setup` import.\nimport { WildoEChart } from './WildoEChart';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\n\nexport interface ChartViewProps {\n /** View reference — resolved from UIContext internally. */\n viewRef?: string;\n /** Pre-resolved bare chart definition. Useful for dev previews and direct renderers. */\n document?: ChartDefinition;\n /** Pre-resolved chart surface definition. When provided, `viewRef` is ignored. */\n viewDefinition?: InsertedChartDeclaration;\n /** Pre-resolved runtime descriptor for inserted or already-bound charts. */\n runtimeDescriptor?: ResolvedInsertedChartDescriptor;\n /** Explicit navigation-time or host-time context bindings. */\n contextResourceIdentifiers?: Record<string, string>;\n /** Explicit standalone-route URL param values for URL_PARAM chart bindings. */\n urlParamValues?: Record<string, string>;\n /** Explicit chart input overrides. These win over binding/default-derived values. */\n inputs?: ChartInputValues;\n /** Custom class name */\n className?: string;\n /** Width */\n width?: string | number;\n /** Height */\n height?: string | number;\n /**\n * When true, a data-fetch failure degrades LOCALLY (this chart card shows the\n * error, with retry) WITHOUT raising the global error toast. Set by EMBEDDED\n * hosts (composite tiles, detail-page charts) so one sub-surface's 403/5xx does\n * not read as a page-level failure. Standalone chart pages leave it `false` and\n * keep the global error pipeline. The error is still emitted/logged either way.\n */\n localErrorOnly?: boolean;\n}\n\n/**\n * ChartView — renders an ECharts chart from a ChartDefinition.\n *\n * Data flow:\n * 1. Resolve definition from UIContext or props\n * 2. Fetch aggregated data from backend\n * 3. Build ECharts option from definition + data\n * 4. Render with echarts-for-react\n */\nexport const ChartView: React.FC<ChartViewProps> = ({\n viewRef,\n document: documentProp,\n viewDefinition: viewDefinitionProp,\n runtimeDescriptor,\n contextResourceIdentifiers,\n urlParamValues,\n inputs,\n className = '',\n width = '100%',\n height = 400,\n localErrorOnly = false,\n}) => {\n const { registry } = useResourceRegistry();\n const { getChartStylePreset, isDark } = useUI();\n const chartStylePreset = getChartStylePreset();\n const { t, isReady, resolvedRegionalPreferences } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n const echartsRef = useRef<any>(null);\n\n // Register/update chart theme with current style preset\n useChartTheme(chartStylePreset);\n\n const resolvedInsertedChart = useMemo(\n () => (viewDefinitionProp ? undefined : resolveInsertedChartView({ viewRef, registry })),\n [viewDefinitionProp, viewRef, registry],\n );\n const viewDefinition = viewDefinitionProp ?? resolvedInsertedChart?.chartView;\n const effectiveRuntimeDescriptor = useMemo(\n () => runtimeDescriptor ?? (\n resolvedInsertedChart\n ? buildResolvedInsertedChartDescriptor({\n identity: resolvedInsertedChart.identity,\n chartView: resolvedInsertedChart.chartView,\n contextResourceIdentifiers: contextResourceIdentifiers ?? {},\n })\n : undefined\n ),\n [runtimeDescriptor, resolvedInsertedChart, contextResourceIdentifiers],\n );\n const runtime = useResolvedChartRuntimeDescriptor({\n surfaceDefinition: viewDefinition,\n chartDefinition: documentProp,\n runtimeDescriptor: effectiveRuntimeDescriptor,\n explicitContextResourceIdentifiers: contextResourceIdentifiers,\n explicitInputs: inputs,\n urlParamValues,\n });\n const definition = runtime?.chartDefinition;\n\n // Fetch chart data\n const { data, loading, error, refetch } = useChartData(\n definition,\n runtime?.executionChartRef,\n runtime?.resolvedInputs,\n runtime?.contextResourceIdentifiers,\n urlParamValues,\n localErrorOnly,\n resolvedRegionalPreferences.timezone,\n );\n\n // ResizeObserver for container.\n //\n // ECharts reflows to the container natively via `instance.resize()`; we do NOT\n // rebuild the ECharts `option` on resize. An earlier implementation pushed the\n // observed size into React state (a `containerSize` that fed `buildEChartsOption`\n // and sat in the `option` useMemo deps), so every resize tick produced a brand-new\n // option object. Combined with `notMerge`+`lazyUpdate` below, that scheduled a\n // frame-deferred atomic option replacement that raced the in-flight `resize()`\n // relayout — surfacing as `Cannot read properties of undefined (reading 'group')`\n // in ECharts' `CartesianAxisView.render` one frame late, plus the tell-tale\n // \"ResizeObserver loop completed with undelivered notifications\" (the observer\n // callback's state update re-triggered layout). `containerSize` was in any case\n // dead context — no chart-type builder reads it — so dropping the rebuild is\n // behaviour-preserving. Native resize is the whole job here.\n // The observer must arm when the REAL container mounts, which happens strictly\n // AFTER the loading/error/empty early returns below stop short-circuiting —\n // i.e. potentially many renders after the initial mount. A mount-time\n // `useEffect(…, [])` reading a plain ref (the previous implementation) ran\n // exactly once, while the container was still null (the first render always\n // takes the loading/skeleton branch), so the observer NEVER armed and charts\n // never reflowed to container resizes. A callback ref is the structural fix:\n // React invokes it at the moment the container node attaches (and with `null`\n // when it detaches, including unmount), so arming/disarming exactly tracks the\n // real DOM node regardless of which render branch produced it.\n const containerRefCallback = useCallback((el: HTMLDivElement | null) => {\n resizeObserverRef.current?.disconnect();\n resizeObserverRef.current = null;\n if (!el) return;\n\n const observer = new ResizeObserver(() => {\n const instance = echartsRef.current?.getEchartsInstance?.();\n // Guard against a disposed instance: on theme toggle the chart remounts\n // (see the `key` prop below) and the observer closure can fire against an\n // instance that ECharts has already torn down — `resize()` would throw.\n if (instance && !instance.isDisposed?.()) {\n instance.resize();\n }\n });\n\n observer.observe(el);\n resizeObserverRef.current = observer;\n }, []);\n\n // Save echarts instance ref\n const onChartReady = useCallback((instance: unknown) => {\n echartsRef.current = { getEchartsInstance: () => instance };\n }, []);\n\n // Build ECharts option — memoized, placed before early returns to respect Rules of Hooks.\n // Deliberately NOT keyed on container size: the option carries no size-dependent\n // fields (no builder reads `containerSize`), and rebuilding it on resize is what\n // raced the native `resize()` into the `CartesianAxisView` crash (see the observer\n // above). The option now rebuilds only on genuine content/appearance changes.\n // Enum coherence: when a chart dimension is an enum, resolve — once, from the\n // resource registry's decorated schema — both the value→color map (slices/bars\n // match the value's badge) and the enum's declared member order (categories sort\n // by declaration order, not the backend's alphabetical order). Keyed on `isDark`\n // because the colors resolve live CSS vars (`--info`, `--muted-foreground`, …)\n // that flip with the theme; ChartView does not remount on toggle (only its child\n // chart does), so without this the memo would keep the previous mode's colors.\n // See `enum-color-bridge.ts`.\n //\n // Labels ride the same pass: an enum dimension's values are DISPLAYED through the i18n tree (axis\n // categories, slice and split names) while the data stays keyed on the raw value. The resource's\n // label bundle is requested here so its enum labels are loaded before the chart renders.\n const { tResourceFieldEnumValue, isReady: isResourceLabelsReady } = useI18n({ resource: definition?.dataQuery.mainResourceType });\n const dimensionEnumMeta = useMemo(\n () => (definition\n ? buildDimensionEnumMeta(definition, (type) => registry.resourceConfigurations[type], tResourceFieldEnumValue)\n : { colors: {}, order: {}, labels: {} }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [definition, registry, isDark, tResourceFieldEnumValue, isResourceLabelsReady],\n );\n\n // A KPI is a figure, not a drawing (#2299): it builds no ECharts option and renders `ChartKpiFigure` below.\n const isKpi = definition?.chartType === ChartType.KPI;\n const option = useMemo(\n () => (definition && !isKpi && data && data.data.length > 0)\n ? buildEChartsOption(definition, data, undefined, chartStylePreset, t, dimensionEnumMeta, resolvedRegionalPreferences.locale)\n : null,\n [definition, isKpi, data, chartStylePreset, t, dimensionEnumMeta, resolvedRegionalPreferences.locale],\n );\n\n // Not found\n if (!definition) {\n return <ViewNotFound viewKind=\"chart\" viewRef={viewRef} />;\n }\n\n // Loading\n if (loading && !data) {\n return <ChartLoadingSkeleton height={height} />;\n }\n\n // Error\n if (error) {\n return <ChartErrorState error={error} onRetry={refetch} />;\n }\n\n // A figure: one row, always, from a backend that completes an empty scope; no row only from one that does not.\n if (isKpi) {\n return data && data.data.length > 0\n ? <ChartKpiFigure definition={definition} data={data} className={className} />\n : <ChartEmptyState />;\n }\n\n // Empty\n if (!option) {\n return <ChartEmptyState />;\n }\n\n if (!isReady || !isResourceLabelsReady) return null;\n\n // #4084: groups of a resource declaring `auditReads` too small to show carry no figures, and are drawn as no value\n // (`measureValueOrNull`). The line says so, so a missing slice or bar is not read as an empty group.\n const suppressedGroupCount = data?.queryMeta?.suppressedGroupCount ?? 0;\n\n return (\n <div\n ref={containerRefCallback}\n className={cn('chart-view', className)}\n style={{ width, height, position: 'relative', display: 'flex', flexDirection: 'column' }}\n >\n <div style={{ flex: 1, minHeight: 0 }}>\n <WildoEChart\n // Remount on dark-mode toggle: the theme name is stable but its content\n // is re-registered, and ECharts bakes the theme at init time.\n key={isDark ? 'dark' : 'light'}\n option={option}\n theme={getWildoThemeName()}\n style={{ width: '100%', height: '100%' }}\n notMerge={true}\n // lazyUpdate MUST stay false. With lazyUpdate={true}, ECharts 6 defers\n // the setOption flush to its next animation frame (`_onframe`); ECharts\n // 6.0.0 then crashes on that deferred path for cartesian charts —\n // `CartesianAxisView.render` dereferences `axisModel.axis.axisBuilder\n // .group` while `axisBuilder` is still undefined (ECharts 6 \"promoted\"\n // axis-element building to the coordinate-system resize stage, but the\n // deferred-flush ordering skips it). Symptom: `TypeError: Cannot read\n // properties of undefined (reading 'group')`. A synchronous flush runs\n // the full resize→render pipeline in order and renders cleanly with\n // animation intact.\n lazyUpdate={false}\n onChartReady={onChartReady}\n />\n </div>\n {suppressedGroupCount > 0 && (\n <Text className=\"text-xs text-muted-foreground\">{t('suppressedGroupsNotice', { count: suppressedGroupCount })}</Text>\n )}\n </div>\n );\n};\n\nexport default ChartView;\n"]}
|
|
1
|
+
{"version":3,"file":"ChartView.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;oEAQoE;AAEpE,OAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,SAAS,EAA+C,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,oCAAoC,EACpC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I;oBACZ,uEAAuE;oBACvE,wEAAwE;oBACxE,kEAAkE;oBAClE,sEAAsE;oBACtE,uEAAuE;oBACvE,uEAAuE;oBACvE,sEAAsE;oBACtE,uEAAuE;oBACvE,oEAAoE;oBACpE,oBAAoB;oBACtB,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,YAAY,IAhBrB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAiB9B,GACI,EACL,oBAAoB,GAAG,CAAC,IAAI,CAC3B,KAAC,IAAI,IAAC,SAAS,EAAC,+BAA+B,YAAE,UAAU,CAAC,qBAAqB,CAAC,sBAAsB,EAAE,wBAAwB,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,GAAQ,CAC7K,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * ChartView — ECharts-based chart component\n *\n * Fetches data from backend via POST /api/charts/:chartRef/data,\n * combines with the visual encoding from the chart definition,\n * and renders via ECharts.\n *\n * This file is lazy-loaded via React.lazy() in AppRouter.\n * ────────────────────────────────────────────────────────────── */\n\nimport React, { useRef, useCallback, useMemo } from 'react';\nimport { CHART_VIEW_DEFAULT_HEIGHT } from './chart-view-defaults';\nimport { ChartType, type ChartDefinition, type ChartInputValues } from '@wildo-ai/saas-models';\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { ViewNotFound } from '~wildo-frontend-lib/components/views/ViewNotFound';\nimport { useChartData } from './chart-view.utils';\nimport { useResolvedChartRuntimeDescriptor } from './chart-runtime.utils';\nimport { useChartTheme, getWildoThemeName } from './chart-theme-bridge';\nimport { buildDimensionEnumMeta } from './enum-color-bridge';\nimport { buildEChartsOption } from './option-builder/echarts-option-builder';\nimport { chartDefinitionLabelKeys, createChartLabelResolver, withSeriesLabelKeys } from './option-builder/builder-utils';\nimport { ChartLoadingSkeleton } from './ChartLoadingSkeleton';\nimport { ChartErrorState } from './ChartErrorState';\nimport { ChartEmptyState } from './ChartEmptyState';\nimport { ChartKpiFigure } from './ChartKpiFigure';\nimport {\n buildResolvedInsertedChartDescriptor,\n resolveInsertedChartView,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport type {\n InsertedChartDeclaration,\n ResolvedInsertedChartDescriptor,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { FrontendInsertedViewHostKind } from '~wildo-frontend-lib/core/config/inserted-view.frontend.schemas';\nimport { buildChartMarkLabelKey, buildChartSeriesLabelKey, buildResourceViewTranslationRef } from '~wildo-frontend-lib/core/navigation/view-title-resolution';\n\n// Direct ECharts binding. Replaces `echarts-for-react`, whose `'finished'`-gated\n// double-init hangs on ECharts 6.0.0 (see WildoEChart for the full analysis).\n// ECharts stays behind this file's app-level React.lazy boundary via WildoEChart's\n// static `echarts-setup` import.\nimport { WildoEChart } from './WildoEChart';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\n\nexport interface ChartViewProps {\n /** View reference — resolved from UIContext internally. */\n viewRef?: string;\n /** Pre-resolved bare chart definition. Useful for dev previews and direct renderers. */\n document?: ChartDefinition;\n /** Pre-resolved chart surface definition. When provided, `viewRef` is ignored. */\n viewDefinition?: InsertedChartDeclaration;\n /** Pre-resolved runtime descriptor for inserted or already-bound charts. */\n runtimeDescriptor?: ResolvedInsertedChartDescriptor;\n /** Explicit navigation-time or host-time context bindings. */\n contextResourceIdentifiers?: Record<string, string>;\n /** Explicit standalone-route URL param values for URL_PARAM chart bindings. */\n urlParamValues?: Record<string, string>;\n /** Explicit chart input overrides. These win over binding/default-derived values. */\n inputs?: ChartInputValues;\n /** Custom class name */\n className?: string;\n /** Width */\n width?: string | number;\n /** Height */\n height?: string | number;\n /**\n * When true, a data-fetch failure degrades LOCALLY (this chart card shows the\n * error, with retry) WITHOUT raising the global error toast. Set by EMBEDDED\n * hosts (composite tiles, detail-page charts) so one sub-surface's 403/5xx does\n * not read as a page-level failure. Standalone chart pages leave it `false` and\n * keep the global error pipeline. The error is still emitted/logged either way.\n */\n localErrorOnly?: boolean;\n}\n\n/**\n * ChartView — renders an ECharts chart from a ChartDefinition.\n *\n * Data flow:\n * 1. Resolve definition from UIContext or props\n * 2. Fetch aggregated data from backend\n * 3. Build ECharts option from definition + data\n * 4. Render with echarts-for-react\n */\nexport const ChartView: React.FC<ChartViewProps> = ({\n viewRef,\n document: documentProp,\n viewDefinition: viewDefinitionProp,\n runtimeDescriptor,\n contextResourceIdentifiers,\n urlParamValues,\n inputs,\n className = '',\n width = '100%',\n height = CHART_VIEW_DEFAULT_HEIGHT,\n localErrorOnly = false,\n}) => {\n const { registry } = useResourceRegistry();\n const { getChartStylePreset, isDark } = useUI();\n const chartStylePreset = getChartStylePreset();\n const { t, tComponent, isReady, resolvedRegionalPreferences } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART });\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n const echartsRef = useRef<any>(null);\n\n // Register/update chart theme with current style preset\n useChartTheme(chartStylePreset);\n\n const resolvedInsertedChart = useMemo(\n () => (viewDefinitionProp ? undefined : resolveInsertedChartView({ viewRef, registry })),\n [viewDefinitionProp, viewRef, registry],\n );\n const viewDefinition = viewDefinitionProp ?? resolvedInsertedChart?.chartView;\n const effectiveRuntimeDescriptor = useMemo(\n () => runtimeDescriptor ?? (\n resolvedInsertedChart\n ? buildResolvedInsertedChartDescriptor({\n identity: resolvedInsertedChart.identity,\n chartView: resolvedInsertedChart.chartView,\n contextResourceIdentifiers: contextResourceIdentifiers ?? {},\n })\n : undefined\n ),\n [runtimeDescriptor, resolvedInsertedChart, contextResourceIdentifiers],\n );\n const runtime = useResolvedChartRuntimeDescriptor({\n surfaceDefinition: viewDefinition,\n chartDefinition: documentProp,\n runtimeDescriptor: effectiveRuntimeDescriptor,\n explicitContextResourceIdentifiers: contextResourceIdentifiers,\n explicitInputs: inputs,\n urlParamValues,\n });\n const runtimeDefinition = runtime?.chartDefinition;\n\n /*\n * Each series is named by a LABEL (`resolveSeriesName`): the key the definition names in `nameKey`, else the series'\n * own key under this chart view's label keys, which the labelling pipeline plans beside the chart's title. A chart\n * drawn outside any resource view (a development preview) has no view keys, and its series show their refs.\n */\n const identity = effectiveRuntimeDescriptor?.identity;\n const seriesTranslationRef = identity?.hostKind === FrontendInsertedViewHostKind.RESOURCE\n ? buildResourceViewTranslationRef(identity.hostRef, identity.localRef)\n : undefined;\n const definition = useMemo(\n () => (runtimeDefinition && seriesTranslationRef\n ? withSeriesLabelKeys(\n runtimeDefinition,\n (seriesRef) => buildChartSeriesLabelKey(seriesTranslationRef, seriesRef),\n (markRef) => buildChartMarkLabelKey(seriesTranslationRef, markRef),\n )\n : runtimeDefinition),\n [runtimeDefinition, seriesTranslationRef],\n );\n const seriesLabelKeys = useMemo(() => chartDefinitionLabelKeys(definition), [definition]);\n const { isReady: isSeriesLabelsReady } = useI18n({ keys: seriesLabelKeys });\n /*\n * The builders' resolver (`createChartLabelResolver`): a bare ref is a chart component label, any other key a path\n * from the root. The series keys are requested above only so they are loaded before the chart draws; they are read\n * through the same `t`. Rebuilt when they settle, so the legend shows the words rather than the keys.\n */\n const tChart = useMemo(\n () => createChartLabelResolver({ tComponent, t }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [tComponent, t, isSeriesLabelsReady],\n );\n\n // Fetch chart data\n const { data, loading, error, refetch } = useChartData(\n definition,\n runtime?.executionChartRef,\n runtime?.resolvedInputs,\n runtime?.contextResourceIdentifiers,\n urlParamValues,\n localErrorOnly,\n resolvedRegionalPreferences.timezone,\n );\n\n // ResizeObserver for container.\n //\n // ECharts reflows to the container natively via `instance.resize()`; we do NOT\n // rebuild the ECharts `option` on resize. An earlier implementation pushed the\n // observed size into React state (a `containerSize` that fed `buildEChartsOption`\n // and sat in the `option` useMemo deps), so every resize tick produced a brand-new\n // option object. Combined with `notMerge`+`lazyUpdate` below, that scheduled a\n // frame-deferred atomic option replacement that raced the in-flight `resize()`\n // relayout — surfacing as `Cannot read properties of undefined (reading 'group')`\n // in ECharts' `CartesianAxisView.render` one frame late, plus the tell-tale\n // \"ResizeObserver loop completed with undelivered notifications\" (the observer\n // callback's state update re-triggered layout). `containerSize` was in any case\n // dead context — no chart-type builder reads it — so dropping the rebuild is\n // behaviour-preserving. Native resize is the whole job here.\n // The observer must arm when the REAL container mounts, which happens strictly\n // AFTER the loading/error/empty early returns below stop short-circuiting —\n // i.e. potentially many renders after the initial mount. A mount-time\n // `useEffect(…, [])` reading a plain ref (the previous implementation) ran\n // exactly once, while the container was still null (the first render always\n // takes the loading/skeleton branch), so the observer NEVER armed and charts\n // never reflowed to container resizes. A callback ref is the structural fix:\n // React invokes it at the moment the container node attaches (and with `null`\n // when it detaches, including unmount), so arming/disarming exactly tracks the\n // real DOM node regardless of which render branch produced it.\n const containerRefCallback = useCallback((el: HTMLDivElement | null) => {\n resizeObserverRef.current?.disconnect();\n resizeObserverRef.current = null;\n if (!el) return;\n\n const observer = new ResizeObserver(() => {\n const instance = echartsRef.current?.getEchartsInstance?.();\n // Guard against a disposed instance: on theme toggle the chart remounts\n // (see the `key` prop below) and the observer closure can fire against an\n // instance that ECharts has already torn down — `resize()` would throw.\n if (instance && !instance.isDisposed?.()) {\n instance.resize();\n }\n });\n\n observer.observe(el);\n resizeObserverRef.current = observer;\n }, []);\n\n // Save echarts instance ref\n const onChartReady = useCallback((instance: unknown) => {\n echartsRef.current = { getEchartsInstance: () => instance };\n }, []);\n\n // Build ECharts option — memoized, placed before early returns to respect Rules of Hooks.\n // Deliberately NOT keyed on container size: the option carries no size-dependent\n // fields (no builder reads `containerSize`), and rebuilding it on resize is what\n // raced the native `resize()` into the `CartesianAxisView` crash (see the observer\n // above). The option now rebuilds only on genuine content/appearance changes.\n // Enum coherence: when a chart dimension is an enum, resolve — once, from the\n // resource registry's decorated schema — both the value→color map (slices/bars\n // match the value's badge) and the enum's declared member order (categories sort\n // by declaration order, not the backend's alphabetical order). Keyed on `isDark`\n // because the colors resolve live CSS vars (`--info`, `--muted-foreground`, …)\n // that flip with the theme; ChartView does not remount on toggle (only its child\n // chart does), so without this the memo would keep the previous mode's colors.\n // See `enum-color-bridge.ts`.\n //\n // Labels ride the same pass: an enum dimension's values are DISPLAYED through the i18n tree (axis\n // categories, slice and split names) while the data stays keyed on the raw value. The resource's\n // label bundle is requested here so its enum labels are loaded before the chart renders.\n const { tResourceFieldEnumValue, isReady: isResourceLabelsReady } = useI18n({ resource: definition?.dataQuery.mainResourceType });\n const dimensionEnumMeta = useMemo(\n () => (definition\n ? buildDimensionEnumMeta(definition, (type) => registry.resourceConfigurations[type], tResourceFieldEnumValue)\n : { colors: {}, order: {}, labels: {} }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [definition, registry, isDark, tResourceFieldEnumValue, isResourceLabelsReady],\n );\n\n // A KPI is a figure, not a drawing (#2299): it builds no ECharts option and renders `ChartKpiFigure` below.\n const isKpi = definition?.chartType === ChartType.KPI;\n const option = useMemo(\n () => (definition && !isKpi && data && data.data.length > 0)\n ? buildEChartsOption(definition, data, undefined, chartStylePreset, tChart, dimensionEnumMeta, resolvedRegionalPreferences.locale)\n : null,\n [definition, isKpi, data, chartStylePreset, tChart, dimensionEnumMeta, resolvedRegionalPreferences.locale],\n );\n\n // Not found\n if (!definition) {\n return <ViewNotFound viewKind=\"chart\" viewRef={viewRef} />;\n }\n\n // Loading\n if (loading && !data) {\n return <ChartLoadingSkeleton height={height} />;\n }\n\n // Error\n if (error) {\n return <ChartErrorState error={error} onRetry={refetch} />;\n }\n\n // A figure: one row, always, from a backend that completes an empty scope; no row only from one that does not.\n if (isKpi) {\n return data && data.data.length > 0\n ? <ChartKpiFigure definition={definition} data={data} className={className} />\n : <ChartEmptyState />;\n }\n\n // Empty\n if (!option) {\n return <ChartEmptyState />;\n }\n\n if (!isReady || !isResourceLabelsReady || !isSeriesLabelsReady) return null;\n\n // #4084: groups of a resource declaring `auditReads` too small to show carry no figures, and are drawn as no value\n // (`measureValueOrNull`). The line says so, so a missing slice or bar is not read as an empty group.\n const suppressedGroupCount = data?.queryMeta?.suppressedGroupCount ?? 0;\n\n return (\n <div\n ref={containerRefCallback}\n className={cn('chart-view', className)}\n style={{ width, height, position: 'relative', display: 'flex', flexDirection: 'column' }}\n >\n <div style={{ flex: 1, minHeight: 0 }}>\n <WildoEChart\n // Remount on dark-mode toggle: the theme name is stable but its content\n // is re-registered, and ECharts bakes the theme at init time.\n key={isDark ? 'dark' : 'light'}\n option={option}\n theme={getWildoThemeName()}\n style={{ width: '100%', height: '100%' }}\n notMerge={true}\n // lazyUpdate MUST stay false. With lazyUpdate={true}, ECharts 6 defers\n // the setOption flush to its next animation frame (`_onframe`); ECharts\n // 6.0.0 then crashes on that deferred path for cartesian charts —\n // `CartesianAxisView.render` dereferences `axisModel.axis.axisBuilder\n // .group` while `axisBuilder` is still undefined (ECharts 6 \"promoted\"\n // axis-element building to the coordinate-system resize stage, but the\n // deferred-flush ordering skips it). Symptom: `TypeError: Cannot read\n // properties of undefined (reading 'group')`. A synchronous flush runs\n // the full resize→render pipeline in order and renders cleanly with\n // animation intact.\n lazyUpdate={false}\n onChartReady={onChartReady}\n />\n </div>\n {suppressedGroupCount > 0 && (\n <Text className=\"text-xs text-muted-foreground\">{tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, 'suppressedGroupsNotice', { count: suppressedGroupCount })}</Text>\n )}\n </div>\n );\n};\n\nexport default ChartView;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.labels.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAM7C,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ChartView.labels.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAM7C,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAsG1D,CAAC"}
|
|
@@ -23,17 +23,83 @@ export const HighLevelViewsChartLabels = [
|
|
|
23
23
|
params: [{ key: 'count', meaning: 'How many groups had their figures withheld', isCount: true }],
|
|
24
24
|
notes: ['Say the figures are withheld because the groups are too small, not that data is missing or an error occurred.'],
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
ref: 'densifiedSeriesName',
|
|
28
|
+
kind: LabelKind.LABEL,
|
|
29
|
+
purpose: 'Tooltip name of the dashed part of a line series: the buckets the chart filled in because no record fell in them (shown as zero)',
|
|
30
|
+
params: [{ key: 'series', meaning: 'The series\' own name, already in the reader\'s language' }],
|
|
31
|
+
notes: ['Default: "{{series}} (filled)". Say the values were filled in for buckets with no records, not that they are estimates.'],
|
|
32
|
+
},
|
|
33
|
+
// KPI figure context
|
|
34
|
+
{
|
|
35
|
+
ref: 'kpiPeriod',
|
|
36
|
+
kind: LabelKind.LABEL,
|
|
37
|
+
purpose: 'Caption under a KPI figure naming the period it covers: the last few days up to now',
|
|
38
|
+
params: [{ key: 'count', meaning: 'How many days the period covers', isCount: true }],
|
|
39
|
+
notes: ['Default: "Last {{count}} days".'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
ref: 'kpiChangeFromPrevious',
|
|
43
|
+
kind: LabelKind.LABEL,
|
|
44
|
+
purpose: 'Line under a KPI figure giving its change since the same number of days before its period',
|
|
45
|
+
params: [
|
|
46
|
+
{ key: 'change', meaning: 'The change, already written as a signed number in the figure\'s format, e.g. "+12" or "-3"' },
|
|
47
|
+
{ key: 'count', meaning: 'How many days each period covers', isCount: true },
|
|
48
|
+
],
|
|
49
|
+
notes: ['Default: "{{change}} vs the previous {{count}} days". Do not say whether the change is good: the colour and the target line say that.'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
ref: 'kpiChangeFromPreviousPoints',
|
|
53
|
+
kind: LabelKind.LABEL,
|
|
54
|
+
purpose: 'Line under a percentage KPI figure giving its change since the previous period, in percentage points',
|
|
55
|
+
params: [
|
|
56
|
+
{ key: 'change', meaning: 'The change in percentage points, already written as a signed number, e.g. "+5"' },
|
|
57
|
+
{ key: 'count', meaning: 'How many days each period covers', isCount: true },
|
|
58
|
+
],
|
|
59
|
+
notes: ['Default: "{{change}} pts vs the previous {{count}} days". Points, never a percent sign: 42% after 37% is +5 points, a 13.5% rise.'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
ref: 'kpiTarget',
|
|
63
|
+
kind: LabelKind.LABEL,
|
|
64
|
+
purpose: 'Line under a KPI figure naming the target it is measured against, when the figure has no value',
|
|
65
|
+
params: [{ key: 'target', meaning: 'The target value, already written in the figure\'s format' }],
|
|
66
|
+
notes: ['Default: "Target {{target}}".'],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
ref: 'kpiTargetMet',
|
|
70
|
+
kind: LabelKind.LABEL,
|
|
71
|
+
purpose: 'Line under a KPI figure naming its target and saying the figure meets it',
|
|
72
|
+
params: [{ key: 'target', meaning: 'The target value, already written in the figure\'s format' }],
|
|
73
|
+
notes: ['Default: "Target {{target}} · on target".'],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
ref: 'kpiTargetMissed',
|
|
77
|
+
kind: LabelKind.LABEL,
|
|
78
|
+
purpose: 'Line under a KPI figure naming its target and saying the figure does not meet it, shown in the destructive colour',
|
|
79
|
+
params: [{ key: 'target', meaning: 'The target value, already written in the figure\'s format' }],
|
|
80
|
+
notes: ['Default: "Target {{target}} · off target". A plain statement the reader acts on, not an alarm.'],
|
|
81
|
+
},
|
|
26
82
|
// Waterfall chart series labels
|
|
27
83
|
{ ref: 'waterfallGainLabel', kind: LabelKind.LABEL, purpose: 'Default series name for positive (gain) bars in a waterfall chart', notes: ['Default: "Increase"'] },
|
|
28
84
|
{ ref: 'waterfallLossLabel', kind: LabelKind.LABEL, purpose: 'Default series name for negative (loss) bars in a waterfall chart', notes: ['Default: "Decrease"'] },
|
|
29
|
-
// Densified overlay series labels
|
|
30
|
-
{ ref: 'densifiedOverlaySuffix', kind: LabelKind.LABEL, purpose: 'Suffix appended to a series name when it is rendered as a densified (gap-filled) overlay', notes: ['Default: "(filled)"'] },
|
|
31
85
|
// Pie chart labels
|
|
32
|
-
{
|
|
86
|
+
{
|
|
87
|
+
ref: 'pieItemFallback',
|
|
88
|
+
kind: LabelKind.LABEL,
|
|
89
|
+
purpose: 'Name of a pie-chart slice whose value has no name, numbered by its row in the chart\'s data',
|
|
90
|
+
params: [{ key: 'index', meaning: 'The slice\'s row number in the chart\'s data, counted from 1 (not its place once sorted)' }],
|
|
91
|
+
notes: ['Default: "Item {index}"'],
|
|
92
|
+
},
|
|
33
93
|
// Toolbox (ECharts toolbar) labels
|
|
34
94
|
{ ref: 'toolboxSaveAsImage', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that exports the chart as an image' },
|
|
35
95
|
{ ref: 'toolboxDataView', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that opens the raw data view' },
|
|
36
96
|
{ ref: 'toolboxRestore', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that restores the chart to its initial state' },
|
|
97
|
+
{ ref: 'toolboxDataViewClose', kind: LabelKind.BUTTON, purpose: 'Button that closes the chart toolbox\'s raw data view' },
|
|
98
|
+
{ ref: 'toolboxDataViewRefresh', kind: LabelKind.BUTTON, purpose: 'Button that refreshes the chart toolbox\'s raw data view' },
|
|
99
|
+
{ ref: 'toolboxSwitchToLine', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that redraws the chart as lines' },
|
|
100
|
+
{ ref: 'toolboxSwitchToBar', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that redraws the chart as bars' },
|
|
101
|
+
{ ref: 'toolboxSwitchToStack', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that stacks the chart\'s series' },
|
|
102
|
+
{ ref: 'toolboxSwitchToTiled', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action, shown once the series are stacked, that sets them side by side again' },
|
|
37
103
|
// Axis labels
|
|
38
104
|
{ ref: 'xAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart X axis when none is authored' },
|
|
39
105
|
{ ref: 'yAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart Y axis when none is authored' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.labels.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,SAAS,EAET,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAE7C,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAE/E,MAAM,CAAC,MAAM,yBAAyB,GAA0B;IAC9D,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,gEAAgE,EAAE;IACzH;QACE,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE,SAAS,CAAC,WAAW;QAC3B,OAAO,EAAE,wEAAwE;QACjF,qFAAqF;QACrF,mFAAmF;QACnF,2FAA2F;QAC3F,KAAK,EAAE,CAAC,gJAAgJ,CAAC;KAC1J;IACD,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,8DAA8D,EAAE;IACzH,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,gEAAgE,EAAE;IACtH,EAAE,GAAG,EAAE,OAAO,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E,EAAE;IAC/H,cAAc;IACd,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,0DAA0D,EAAE;IACjH,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,0DAA0D,EAAE;IACjH,EAAE,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,6DAA6D,EAAE;CAC9H,CAAC;AACF,uBAAuB,CAAC,qBAAqB,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import {\n FrontendComponentType,\n LabelKind,\n type LabellingUnitaryDef,\n registerComponentLabels,\n} from '@wildo-ai/presets-components-models';\n\n// Companion-only label metadata for this component: keys + params + (where\n// authored) per-key purpose / kind / variable meaning. Statically scanned by\n// the dev companion; NOT imported at runtime, so it never ships in the bundle.\n\nexport const HighLevelViewsChartLabels: LabellingUnitaryDef[] = [\n { ref: 'noData', kind: LabelKind.EMPTY_STATE, purpose: 'Empty-state heading shown when the chart query returns no data' },\n {\n ref: 'noDataDescription',\n kind: LabelKind.EMPTY_STATE,\n purpose: 'Empty-state supporting text shown when the chart query returns no data',\n // Steer the label generator away from filter-referencing copy: this state renders on\n // ANY chart surface, including dashboards and embedded metric cards that expose no\n // filter UI at all — \"Try adjusting your filters.\" (a previous generation) misleads there.\n notes: ['Must not reference filters or other UI the chart may not have. Neutral phrasing, e.g. \"Data will appear here once there is activity to chart.\"'],\n },\n { ref: 'errorLoading', kind: LabelKind.MESSAGE, purpose: 'Error-state text shown when the chart fails to load its data' },\n { ref: 'loading', kind: LabelKind.MESSAGE, purpose: 'Loading-state text shown while the chart data is being fetched' },\n { ref: 'retry', kind: LabelKind.BUTTON, purpose: 'Button that re-attempts the chart data fetch after a load error' },\n {\n ref: 'suppressedGroupsNotice',\n kind: LabelKind.MESSAGE,\n purpose: 'Line under a chart saying that some of its groups hold too few records to show their figures, so they are drawn with no value (a privacy protection on data whose reads are audited)',\n params: [{ key: 'count', meaning: 'How many groups had their figures withheld', isCount: true }],\n notes: ['Say the figures are withheld because the groups are too small, not that data is missing or an error occurred.'],\n },\n // Waterfall chart series labels\n { ref: 'waterfallGainLabel', kind: LabelKind.LABEL, purpose: 'Default series name for positive (gain) bars in a waterfall chart', notes: ['Default: \"Increase\"'] },\n { ref: 'waterfallLossLabel', kind: LabelKind.LABEL, purpose: 'Default series name for negative (loss) bars in a waterfall chart', notes: ['Default: \"Decrease\"'] },\n // Densified overlay series labels\n { ref: 'densifiedOverlaySuffix', kind: LabelKind.LABEL, purpose: 'Suffix appended to a series name when it is rendered as a densified (gap-filled) overlay', notes: ['Default: \"(filled)\"'] },\n // Pie chart labels\n { ref: 'pieItemFallback', kind: LabelKind.LABEL, purpose: 'Fallback display name used for pie-chart slices that have no name', notes: ['Default: \"Item\"'] },\n // Toolbox (ECharts toolbar) labels\n { ref: 'toolboxSaveAsImage', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that exports the chart as an image' },\n { ref: 'toolboxDataView', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that opens the raw data view' },\n { ref: 'toolboxRestore', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that restores the chart to its initial state' },\n // Axis labels\n { ref: 'xAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart X axis when none is authored' },\n { ref: 'yAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart Y axis when none is authored' },\n { ref: 'yAxisSecondaryLabel', kind: LabelKind.LABEL, purpose: 'Default title for the secondary Y axis on a dual-axis chart' },\n];\nregisterComponentLabels(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, HighLevelViewsChartLabels);\n"]}
|
|
1
|
+
{"version":3,"file":"ChartView.labels.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,SAA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D,EAAE;IACzH,EAAE,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,0DAA0D,EAAE;IAC9H,EAAE,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,sDAAsD,EAAE;IACvH,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,qDAAqD,EAAE;IACrH,EAAE,GAAG,EAAE,sBAAsB,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,sDAAsD,EAAE;IACxH,EAAE,GAAG,EAAE,sBAAsB,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,4FAA4F,EAAE;IAC9J,cAAc;IACd,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,0DAA0D,EAAE;IACjH,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,0DAA0D,EAAE;IACjH,EAAE,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,6DAA6D,EAAE;CAC9H,CAAC;AACF,uBAAuB,CAAC,qBAAqB,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import {\n FrontendComponentType,\n LabelKind,\n type LabellingUnitaryDef,\n registerComponentLabels,\n} from '@wildo-ai/presets-components-models';\n\n// Companion-only label metadata for this component: keys + params + (where\n// authored) per-key purpose / kind / variable meaning. Statically scanned by\n// the dev companion; NOT imported at runtime, so it never ships in the bundle.\n\nexport const HighLevelViewsChartLabels: LabellingUnitaryDef[] = [\n { ref: 'noData', kind: LabelKind.EMPTY_STATE, purpose: 'Empty-state heading shown when the chart query returns no data' },\n {\n ref: 'noDataDescription',\n kind: LabelKind.EMPTY_STATE,\n purpose: 'Empty-state supporting text shown when the chart query returns no data',\n // Steer the label generator away from filter-referencing copy: this state renders on\n // ANY chart surface, including dashboards and embedded metric cards that expose no\n // filter UI at all — \"Try adjusting your filters.\" (a previous generation) misleads there.\n notes: ['Must not reference filters or other UI the chart may not have. Neutral phrasing, e.g. \"Data will appear here once there is activity to chart.\"'],\n },\n { ref: 'errorLoading', kind: LabelKind.MESSAGE, purpose: 'Error-state text shown when the chart fails to load its data' },\n { ref: 'loading', kind: LabelKind.MESSAGE, purpose: 'Loading-state text shown while the chart data is being fetched' },\n { ref: 'retry', kind: LabelKind.BUTTON, purpose: 'Button that re-attempts the chart data fetch after a load error' },\n {\n ref: 'suppressedGroupsNotice',\n kind: LabelKind.MESSAGE,\n purpose: 'Line under a chart saying that some of its groups hold too few records to show their figures, so they are drawn with no value (a privacy protection on data whose reads are audited)',\n params: [{ key: 'count', meaning: 'How many groups had their figures withheld', isCount: true }],\n notes: ['Say the figures are withheld because the groups are too small, not that data is missing or an error occurred.'],\n },\n {\n ref: 'densifiedSeriesName',\n kind: LabelKind.LABEL,\n purpose: 'Tooltip name of the dashed part of a line series: the buckets the chart filled in because no record fell in them (shown as zero)',\n params: [{ key: 'series', meaning: 'The series\\' own name, already in the reader\\'s language' }],\n notes: ['Default: \"{{series}} (filled)\". Say the values were filled in for buckets with no records, not that they are estimates.'],\n },\n // KPI figure context\n {\n ref: 'kpiPeriod',\n kind: LabelKind.LABEL,\n purpose: 'Caption under a KPI figure naming the period it covers: the last few days up to now',\n params: [{ key: 'count', meaning: 'How many days the period covers', isCount: true }],\n notes: ['Default: \"Last {{count}} days\".'],\n },\n {\n ref: 'kpiChangeFromPrevious',\n kind: LabelKind.LABEL,\n purpose: 'Line under a KPI figure giving its change since the same number of days before its period',\n params: [\n { key: 'change', meaning: 'The change, already written as a signed number in the figure\\'s format, e.g. \"+12\" or \"-3\"' },\n { key: 'count', meaning: 'How many days each period covers', isCount: true },\n ],\n notes: ['Default: \"{{change}} vs the previous {{count}} days\". Do not say whether the change is good: the colour and the target line say that.'],\n },\n {\n ref: 'kpiChangeFromPreviousPoints',\n kind: LabelKind.LABEL,\n purpose: 'Line under a percentage KPI figure giving its change since the previous period, in percentage points',\n params: [\n { key: 'change', meaning: 'The change in percentage points, already written as a signed number, e.g. \"+5\"' },\n { key: 'count', meaning: 'How many days each period covers', isCount: true },\n ],\n notes: ['Default: \"{{change}} pts vs the previous {{count}} days\". Points, never a percent sign: 42% after 37% is +5 points, a 13.5% rise.'],\n },\n {\n ref: 'kpiTarget',\n kind: LabelKind.LABEL,\n purpose: 'Line under a KPI figure naming the target it is measured against, when the figure has no value',\n params: [{ key: 'target', meaning: 'The target value, already written in the figure\\'s format' }],\n notes: ['Default: \"Target {{target}}\".'],\n },\n {\n ref: 'kpiTargetMet',\n kind: LabelKind.LABEL,\n purpose: 'Line under a KPI figure naming its target and saying the figure meets it',\n params: [{ key: 'target', meaning: 'The target value, already written in the figure\\'s format' }],\n notes: ['Default: \"Target {{target}} · on target\".'],\n },\n {\n ref: 'kpiTargetMissed',\n kind: LabelKind.LABEL,\n purpose: 'Line under a KPI figure naming its target and saying the figure does not meet it, shown in the destructive colour',\n params: [{ key: 'target', meaning: 'The target value, already written in the figure\\'s format' }],\n notes: ['Default: \"Target {{target}} · off target\". A plain statement the reader acts on, not an alarm.'],\n },\n // Waterfall chart series labels\n { ref: 'waterfallGainLabel', kind: LabelKind.LABEL, purpose: 'Default series name for positive (gain) bars in a waterfall chart', notes: ['Default: \"Increase\"'] },\n { ref: 'waterfallLossLabel', kind: LabelKind.LABEL, purpose: 'Default series name for negative (loss) bars in a waterfall chart', notes: ['Default: \"Decrease\"'] },\n // Pie chart labels\n {\n ref: 'pieItemFallback',\n kind: LabelKind.LABEL,\n purpose: 'Name of a pie-chart slice whose value has no name, numbered by its row in the chart\\'s data',\n params: [{ key: 'index', meaning: 'The slice\\'s row number in the chart\\'s data, counted from 1 (not its place once sorted)' }],\n notes: ['Default: \"Item {index}\"'],\n },\n // Toolbox (ECharts toolbar) labels\n { ref: 'toolboxSaveAsImage', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that exports the chart as an image' },\n { ref: 'toolboxDataView', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that opens the raw data view' },\n { ref: 'toolboxRestore', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that restores the chart to its initial state' },\n { ref: 'toolboxDataViewClose', kind: LabelKind.BUTTON, purpose: 'Button that closes the chart toolbox\\'s raw data view' },\n { ref: 'toolboxDataViewRefresh', kind: LabelKind.BUTTON, purpose: 'Button that refreshes the chart toolbox\\'s raw data view' },\n { ref: 'toolboxSwitchToLine', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that redraws the chart as lines' },\n { ref: 'toolboxSwitchToBar', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that redraws the chart as bars' },\n { ref: 'toolboxSwitchToStack', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action that stacks the chart\\'s series' },\n { ref: 'toolboxSwitchToTiled', kind: LabelKind.BUTTON, purpose: 'Chart toolbox action, shown once the series are stacked, that sets them side by side again' },\n // Axis labels\n { ref: 'xAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart X axis when none is authored' },\n { ref: 'yAxisLabel', kind: LabelKind.LABEL, purpose: 'Default title for the chart Y axis when none is authored' },\n { ref: 'yAxisSecondaryLabel', kind: LabelKind.LABEL, purpose: 'Default title for the secondary Y axis on a dual-axis chart' },\n];\nregisterComponentLabels(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART, HighLevelViewsChartLabels);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.lazy.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.lazy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartView.lazy.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.lazy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA2BlD;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAM9C,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAe,SAAS,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { LazyDoorErrorBoundary } from '../../../components/feedback/lazy-door-er
|
|
|
6
6
|
import { StandardIconReference } from '../../../core/icons/icon-registry.frontend.schemas.js';
|
|
7
7
|
import { useI18n } from '../../../core/i18n/useI18n.js';
|
|
8
8
|
import { ChartLoadingSkeleton } from './ChartLoadingSkeleton.js';
|
|
9
|
+
import { CHART_VIEW_DEFAULT_HEIGHT } from './chart-view-defaults.js';
|
|
9
10
|
const LazyChartViewInner = React.lazy(() => import('./ChartView.js'));
|
|
10
11
|
/**
|
|
11
12
|
* What a chart degrades TO when the ECharts chunk never arrives (#963): the chart widget's own
|
|
@@ -29,6 +30,6 @@ function ChartUnavailableFallback({ height }) {
|
|
|
29
30
|
* chunk that fails to download rather than letting the failure take down the
|
|
30
31
|
* surface around the chart.
|
|
31
32
|
*/
|
|
32
|
-
export const ChartView = (props) => (_jsx(LazyDoorErrorBoundary, { doorName: "ChartView", fallback: _jsx(ChartUnavailableFallback, { height: props.height ??
|
|
33
|
+
export const ChartView = (props) => (_jsx(LazyDoorErrorBoundary, { doorName: "ChartView", fallback: _jsx(ChartUnavailableFallback, { height: props.height ?? CHART_VIEW_DEFAULT_HEIGHT }), children: _jsx(Suspense, { fallback: _jsx(ChartLoadingSkeleton, { height: props.height ?? CHART_VIEW_DEFAULT_HEIGHT }), children: _jsx(LazyChartViewInner, { ...props }) }) }));
|
|
33
34
|
export default ChartView;
|
|
34
35
|
//# sourceMappingURL=ChartView.lazy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartView.lazy.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.lazy.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartView.lazy.js","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartView.lazy.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,EAAE,MAAM,EAA+B;IACvE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,EAAE,SAAS,EAAE,qBAAqB,CAAC,6BAA6B,EAAE,CAAC,CAAC;IAC5G,qHAAqH;IACrH,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAiB,aAAa,YAC7D,KAAC,UAAU,IACT,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,qBAAqB,CAAC,iBAAiB,EAChD,KAAK,EAAE,UAAU,CAAC,qBAAqB,CAAC,6BAA6B,EAAE,aAAa,CAAC,EACrF,0BAA0B,EAAE,KAAK,EACjC,SAAS,EAAC,+BAA+B,GACzC,GACE,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5D,KAAC,qBAAqB,IAAC,QAAQ,EAAC,WAAW,EAAC,QAAQ,EAAE,KAAC,wBAAwB,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,yBAAyB,GAAI,YACnI,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,oBAAoB,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,yBAAyB,GAAI,YAC7F,KAAC,kBAAkB,OAAK,KAAK,GAAI,GACxB,GACW,CACzB,CAAC;AAIF,eAAe,SAAS,CAAC","sourcesContent":["import React, { Suspense } from 'react';\nimport { FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { EmptyState } from '~wildo-frontend-lib/components/feedback/empty-state';\nimport { LazyDoorErrorBoundary } from '~wildo-frontend-lib/components/feedback/lazy-door-error-boundary';\nimport { StandardIconReference } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { ChartLoadingSkeleton } from './ChartLoadingSkeleton';\nimport { CHART_VIEW_DEFAULT_HEIGHT } from './chart-view-defaults';\nimport type { ChartViewProps } from './ChartView';\n\nconst LazyChartViewInner = React.lazy(() => import('./ChartView'));\n\n/**\n * What a chart degrades TO when the ECharts chunk never arrives (#963): the chart widget's own\n * worded failure state, at the chart's height so the dashboard does not reflow. The word is the\n * `chartFailed` label the widget already authors — a door invents none of its own — and there is no\n * retry: a chunk that failed to download is not re-fetched by re-rendering.\n */\nfunction ChartUnavailableFallback({ height }: { height: string | number }): React.JSX.Element | null {\n const { tComponent, isReady } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_CHART_WIDGET });\n // Same gate as `ChartWidgetErrorFallback`: before the bundle settles there is no word to show, and a key is not one.\n if (!isReady) return null;\n return (\n <div style={{ minHeight: height }} data-lazy-door=\"unavailable\">\n <EmptyState\n variant=\"compact\"\n iconRef={StandardIconReference.ERROR_APPLICATION}\n title={tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_CHART_WIDGET, 'chartFailed')}\n respectSurfaceEmptyDisplay={false}\n className=\"h-full min-h-[120px] border-0\"\n />\n </div>\n );\n}\n\n/**\n * Lazy barrel-safe ChartView export.\n *\n * This wrapper keeps the ECharts runtime behind a dynamic import boundary so\n * package-root consumers can still render charts without pulling the heavy\n * chart bundle into the main application chunk — and, since #963, catches a\n * chunk that fails to download rather than letting the failure take down the\n * surface around the chart.\n */\nexport const ChartView: React.FC<ChartViewProps> = (props) => (\n <LazyDoorErrorBoundary doorName=\"ChartView\" fallback={<ChartUnavailableFallback height={props.height ?? CHART_VIEW_DEFAULT_HEIGHT} />}>\n <Suspense fallback={<ChartLoadingSkeleton height={props.height ?? CHART_VIEW_DEFAULT_HEIGHT} />}>\n <LazyChartViewInner {...props} />\n </Suspense>\n </LazyDoorErrorBoundary>\n);\n\nexport type { ChartViewProps } from './ChartView';\n\nexport default ChartView;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;oEAUoE;AAEpE,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/chart-view/ChartWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;oEAUoE;AAEpE,OAAO,KAA8B,MAAM,OAAO,CAAC;AA6EnD,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+BlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|