@gooddata/sdk-ui-dashboard 11.52.0-alpha.6 → 11.52.0

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.
Files changed (177) hide show
  1. package/esm/__version.d.ts +1 -1
  2. package/esm/__version.d.ts.map +1 -1
  3. package/esm/__version.js +1 -1
  4. package/esm/index.d.ts +5 -4
  5. package/esm/index.d.ts.map +1 -1
  6. package/esm/index.js +5 -4
  7. package/esm/kdaDialog/composition/hooks/usePeriodChangeHandler.js +5 -0
  8. package/esm/model/store/config/configSelectors.d.ts +6 -0
  9. package/esm/model/store/config/configSelectors.d.ts.map +1 -1
  10. package/esm/model/store/config/configSelectors.js +8 -0
  11. package/esm/model/store/keyDriverAnalysis/const.d.ts +6 -6
  12. package/esm/model/store/keyDriverAnalysis/const.d.ts.map +1 -1
  13. package/esm/model/store/keyDriverAnalysis/const.js +12 -26
  14. package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
  15. package/esm/model/store/widgetDrills/widgetDrillSelectors.js +5 -5
  16. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts +1 -1
  17. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.d.ts.map +1 -1
  18. package/esm/presentation/automations/alerting/DefaultAlertingDialog/DefaultAlertingDialog.js +3 -4
  19. package/esm/presentation/automations/alerting/state/AlertingDialogStateProvider.d.ts +5 -1
  20. package/esm/presentation/automations/alerting/state/AlertingDialogStateProvider.d.ts.map +1 -1
  21. package/esm/presentation/automations/alerting/state/AlertingDialogStateProvider.js +5 -1
  22. package/esm/presentation/automations/alerting/types.d.ts +15 -1
  23. package/esm/presentation/automations/alerting/types.d.ts.map +1 -1
  24. package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts +26 -0
  25. package/esm/presentation/automations/contexts/AlertingDialogContext.d.ts.map +1 -1
  26. package/esm/presentation/automations/contexts/AlertingDialogContext.js +26 -0
  27. package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts +10 -1
  28. package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.d.ts.map +1 -1
  29. package/esm/presentation/automations/contexts/ScheduledEmailDialogContext.js +9 -0
  30. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts +1 -1
  31. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.d.ts.map +1 -1
  32. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/DefaultScheduledEmailDialog.js +19 -17
  33. package/esm/presentation/automations/scheduledEmail/ScheduledEmailDialog.d.ts +3 -0
  34. package/esm/presentation/automations/scheduledEmail/ScheduledEmailDialog.d.ts.map +1 -1
  35. package/esm/presentation/automations/scheduledEmail/ScheduledEmailDialog.js +5 -1
  36. package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.d.ts +22 -0
  37. package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.d.ts.map +1 -0
  38. package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.js +150 -0
  39. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts +28 -0
  40. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.d.ts.map +1 -0
  41. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportActionsContext.js +20 -0
  42. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDataContext.d.ts +25 -0
  43. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDataContext.d.ts.map +1 -0
  44. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDataContext.js +20 -0
  45. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts +25 -0
  46. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.d.ts.map +1 -0
  47. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.js +20 -0
  48. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.d.ts +26 -0
  49. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.d.ts.map +1 -0
  50. package/esm/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.js +20 -0
  51. package/esm/presentation/automations/scheduledEmail/state/exportDefinitions.d.ts.map +1 -0
  52. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/utils → state}/exportDefinitions.js +1 -1
  53. package/esm/presentation/automations/scheduledEmail/state/missingScheduledExportStateProvider.d.ts +7 -0
  54. package/esm/presentation/automations/scheduledEmail/state/missingScheduledExportStateProvider.d.ts.map +1 -0
  55. package/esm/presentation/automations/scheduledEmail/state/missingScheduledExportStateProvider.js +9 -0
  56. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailEffectiveFilters.d.ts +2 -2
  57. package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailEffectiveFilters.d.ts.map +1 -0
  58. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailEffectiveFilters.js +4 -4
  59. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailExportSettings.d.ts +12 -25
  60. package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.d.ts.map +1 -0
  61. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailExportSettings.js +38 -86
  62. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts → state/useScheduledEmailFiltersModel.d.ts} +7 -7
  63. package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFiltersModel.d.ts.map +1 -0
  64. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.js → state/useScheduledEmailFiltersModel.js} +26 -9
  65. package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.d.ts.map +1 -0
  66. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailFormState.js +25 -25
  67. package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailFormValidity.d.ts.map +1 -0
  68. package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailFormValidity.js +3 -3
  69. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportAttachments.d.ts +39 -0
  70. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportAttachments.d.ts.map +1 -0
  71. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportAttachments.js +102 -0
  72. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportDialogValidity.d.ts +13 -0
  73. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportDialogValidity.d.ts.map +1 -0
  74. package/esm/presentation/automations/scheduledEmail/state/useScheduledExportDialogValidity.js +34 -0
  75. package/esm/presentation/automations/scheduledEmail/types.d.ts +15 -1
  76. package/esm/presentation/automations/scheduledEmail/types.d.ts.map +1 -1
  77. package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts +2 -1
  78. package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts.map +1 -1
  79. package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.js +6 -2
  80. package/esm/presentation/drill/utils/kdaUtils.d.ts +1 -1
  81. package/esm/presentation/drill/utils/kdaUtils.d.ts.map +1 -1
  82. package/esm/presentation/drill/utils/kdaUtils.js +6 -5
  83. package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.d.ts +1 -1
  84. package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.d.ts.map +1 -1
  85. package/esm/presentation/filterBar/dateFilter/DefaultDashboardDateFilter.js +2 -2
  86. package/esm/presentation/filterBar/dateFilter/types.d.ts +8 -1
  87. package/esm/presentation/filterBar/dateFilter/types.d.ts.map +1 -1
  88. package/esm/presentation/filterBar/dateFilter/types.js +1 -1
  89. package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +2 -0
  90. package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
  91. package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +9 -7
  92. package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +2 -0
  93. package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
  94. package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +9 -7
  95. package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +2 -0
  96. package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
  97. package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +9 -7
  98. package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +2 -0
  99. package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
  100. package/esm/presentation/localization/bundles/es-419.localization-bundle.js +9 -7
  101. package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +2 -0
  102. package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
  103. package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +9 -7
  104. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +2 -0
  105. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
  106. package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +9 -7
  107. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +2 -0
  108. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
  109. package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +9 -7
  110. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +2 -0
  111. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
  112. package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +9 -7
  113. package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +2 -0
  114. package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
  115. package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +9 -7
  116. package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +2 -0
  117. package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
  118. package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +9 -7
  119. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +2 -0
  120. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
  121. package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +9 -7
  122. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +2 -0
  123. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
  124. package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +9 -7
  125. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +2 -0
  126. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
  127. package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +9 -7
  128. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +2 -0
  129. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
  130. package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +9 -7
  131. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +2 -0
  132. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
  133. package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +9 -7
  134. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +2 -0
  135. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
  136. package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +9 -7
  137. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +2 -0
  138. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
  139. package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +9 -7
  140. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +2 -0
  141. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
  142. package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +9 -7
  143. package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +2 -0
  144. package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
  145. package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +9 -7
  146. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +2 -0
  147. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
  148. package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +9 -7
  149. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +2 -0
  150. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
  151. package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +9 -7
  152. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +2 -0
  153. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
  154. package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +9 -7
  155. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +2 -0
  156. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
  157. package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +9 -7
  158. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +2 -0
  159. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
  160. package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +9 -7
  161. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +2 -0
  162. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
  163. package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +9 -7
  164. package/esm/sdk-ui-dashboard.d.ts +126 -18
  165. package/package.json +21 -21
  166. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts +0 -89
  167. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.d.ts.map +0 -1
  168. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useEditScheduledEmail.js +0 -131
  169. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailEffectiveFilters.d.ts.map +0 -1
  170. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailExportSettings.d.ts.map +0 -1
  171. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFilters.d.ts.map +0 -1
  172. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormState.d.ts.map +0 -1
  173. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/hooks/useScheduledEmailFormValidity.d.ts.map +0 -1
  174. package/esm/presentation/automations/scheduledEmail/DefaultScheduledEmailDialog/utils/exportDefinitions.d.ts.map +0 -1
  175. /package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/utils → state}/exportDefinitions.d.ts +0 -0
  176. /package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailFormState.d.ts +0 -0
  177. /package/esm/presentation/automations/scheduledEmail/{DefaultScheduledEmailDialog/hooks → state}/useScheduledEmailFormValidity.d.ts +0 -0
@@ -0,0 +1,20 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { createContext, useContext } from "react";
3
+ import { missingScheduledExportStateProvider } from "./missingScheduledExportStateProvider.js";
4
+ const ScheduledExportDataContext = createContext(undefined);
5
+ ScheduledExportDataContext.displayName = "ScheduledExportDataContext";
6
+ export const ScheduledExportDataContextProvider = ScheduledExportDataContext.Provider;
7
+ /**
8
+ * Reads the scheduled-export dialog's recipient defaults.
9
+ *
10
+ * Throws outside the scheduled-export dialog's state providers, which mount only once
11
+ * `useScheduledEmailDialogContext().isLoading` is false — a replacement for
12
+ * `ScheduledEmailDialogComponent` must check that flag before calling this. That state is on the
13
+ * ordinary path here: a widget export renders while its filters load.
14
+ *
15
+ * @internal
16
+ */
17
+ export function useScheduledExportData() {
18
+ return (useContext(ScheduledExportDataContext) ??
19
+ missingScheduledExportStateProvider("useScheduledExportData"));
20
+ }
@@ -0,0 +1,25 @@
1
+ import { type useScheduledEmailFormState } from "./useScheduledEmailFormState.js";
2
+ /**
3
+ * The scheduled-export dialog's edit draft: the automation being edited, the baseline it is
4
+ * compared against for the submit gate, the normalized start date, and the per-field validity
5
+ * flags the form fields report back.
6
+ *
7
+ * Changes on every keystroke; consumers re-render by design. The shape is derived from
8
+ * `useScheduledEmailFormState`, which owns these values.
9
+ *
10
+ * @internal
11
+ */
12
+ export type IScheduledExportDraftContextValue = Pick<ReturnType<typeof useScheduledEmailFormState>, "editedAutomation" | "originalAutomation" | "startDate" | "isCronValid" | "isTitleValid" | "isSubjectValid" | "isOnMessageValid">;
13
+ export declare const ScheduledExportDraftContextProvider: import("react").Provider<IScheduledExportDraftContextValue | undefined>;
14
+ /**
15
+ * Reads the scheduled-export dialog's edit draft.
16
+ *
17
+ * Throws outside the scheduled-export dialog's state providers, which mount only once
18
+ * `useScheduledEmailDialogContext().isLoading` is false — a replacement for
19
+ * `ScheduledEmailDialogComponent` must check that flag before calling this. That state is on the
20
+ * ordinary path here: a widget export renders while its filters load.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare function useScheduledExportDraft(): IScheduledExportDraftContextValue;
25
+ //# sourceMappingURL=ScheduledExportDraftContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScheduledExportDraftContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/ScheduledExportDraftContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF;;;;;;;;;GASG;AACH,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAChD,UAAU,CAAC,OAAO,0BAA0B,CAAC,EAC3C,kBAAkB,GAClB,oBAAoB,GACpB,WAAW,GACX,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,kBAAkB,CACvB,CAAC;AAKF,eAAO,MAAM,mCAAmC,yEAAuC,CAAC;AAExF;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,IAAI,iCAAiC,CAK3E"}
@@ -0,0 +1,20 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { createContext, useContext } from "react";
3
+ import { missingScheduledExportStateProvider } from "./missingScheduledExportStateProvider.js";
4
+ const ScheduledExportDraftContext = createContext(undefined);
5
+ ScheduledExportDraftContext.displayName = "ScheduledExportDraftContext";
6
+ export const ScheduledExportDraftContextProvider = ScheduledExportDraftContext.Provider;
7
+ /**
8
+ * Reads the scheduled-export dialog's edit draft.
9
+ *
10
+ * Throws outside the scheduled-export dialog's state providers, which mount only once
11
+ * `useScheduledEmailDialogContext().isLoading` is false — a replacement for
12
+ * `ScheduledEmailDialogComponent` must check that flag before calling this. That state is on the
13
+ * ordinary path here: a widget export renders while its filters load.
14
+ *
15
+ * @internal
16
+ */
17
+ export function useScheduledExportDraft() {
18
+ return (useContext(ScheduledExportDraftContext) ??
19
+ missingScheduledExportStateProvider("useScheduledExportDraft"));
20
+ }
@@ -0,0 +1,26 @@
1
+ import { type useScheduledEmailFiltersModel } from "./useScheduledEmailFiltersModel.js";
2
+ /**
3
+ * The scheduled-export dialog's filter and export-parameter model: the current selection and the
4
+ * available filters, flat and per-tab, the handlers that mutate them and mirror the result into the
5
+ * draft, the store-filters toggle, the staleness gate that opens the apply-current-filters dialog,
6
+ * and the parameter chips with their add, change, delete and apply-latest handlers.
7
+ *
8
+ * The model's whole return is the context value rather than a selection from it, because the model
9
+ * is the unit a replacement reads: a member cannot be dropped from it.
10
+ *
11
+ * @internal
12
+ */
13
+ export type IScheduledExportFiltersContextValue = ReturnType<typeof useScheduledEmailFiltersModel>;
14
+ export declare const ScheduledExportFiltersContextProvider: import("react").Provider<import("./useScheduledEmailFiltersModel.js").IUseScheduledEmailFiltersModel | undefined>;
15
+ /**
16
+ * Reads the scheduled-export dialog's filter and export-parameter model.
17
+ *
18
+ * Throws outside the scheduled-export dialog's state providers, which mount only once
19
+ * `useScheduledEmailDialogContext().isLoading` is false — a replacement for
20
+ * `ScheduledEmailDialogComponent` must check that flag before calling this. That state is on the
21
+ * ordinary path here: a widget export renders while its filters load.
22
+ *
23
+ * @internal
24
+ */
25
+ export declare function useScheduledExportFilters(): IScheduledExportFiltersContextValue;
26
+ //# sourceMappingURL=ScheduledExportFiltersContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScheduledExportFiltersContext.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/ScheduledExportFiltersContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mCAAmC,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAOnG,eAAO,MAAM,qCAAqC,mHAAyC,CAAC;AAE5F;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,IAAI,mCAAmC,CAK/E"}
@@ -0,0 +1,20 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { createContext, useContext } from "react";
3
+ import { missingScheduledExportStateProvider } from "./missingScheduledExportStateProvider.js";
4
+ const ScheduledExportFiltersContext = createContext(undefined);
5
+ ScheduledExportFiltersContext.displayName = "ScheduledExportFiltersContext";
6
+ export const ScheduledExportFiltersContextProvider = ScheduledExportFiltersContext.Provider;
7
+ /**
8
+ * Reads the scheduled-export dialog's filter and export-parameter model.
9
+ *
10
+ * Throws outside the scheduled-export dialog's state providers, which mount only once
11
+ * `useScheduledEmailDialogContext().isLoading` is false — a replacement for
12
+ * `ScheduledEmailDialogComponent` must check that flag before calling this. That state is on the
13
+ * ordinary path here: a widget export renders while its filters load.
14
+ *
15
+ * @internal
16
+ */
17
+ export function useScheduledExportFilters() {
18
+ return (useContext(ScheduledExportFiltersContext) ??
19
+ missingScheduledExportStateProvider("useScheduledExportFilters"));
20
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exportDefinitions.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/exportDefinitions.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,yCAAyC,EAC9C,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAE5B,MAAM,qBAAqB,CAAC;AAI7B;;;;GAIG;AACH,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,mCAAmC,EAC/C,iBAAiB,EAAE,WAAW,CAAC,mCAAmC,CAAC,mBAAmB,CAAC,CAAC,EACxF,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,GAAG,SAAS,GACzE,mCAAmC,CAGrC;AAED,wBAAgB,oDAAoD,CAAC,EACjE,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,UAAU,EACb,EAAE;IACC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACnD,MAAM,EAAE,uBAAuB,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,yCAAyC,CAyB5C;AAED,wBAAgB,iDAAiD,CAAC,EAC9D,OAAO,EACP,MAAM,EACN,WAAW,EACX,MAAM,EACN,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACtB,EAAE;IACC,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvC,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;IAC9E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,yCAAyC,CAiE5C"}
@@ -1,6 +1,6 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
2
  import { insightProperties, } from "@gooddata/sdk-model";
3
- import { setExportParametersByTab } from "../../../../../_staging/automation/index.js";
3
+ import { setExportParametersByTab } from "../../../../_staging/automation/index.js";
4
4
  /**
5
5
  * Rebuilds the export definitions and re-applies the parameter wire (fresh definitions carry no
6
6
  * `content.parametersByTab`). The wire is passed in rather than read off `automation` so it survives
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The single error every scheduled-export dialog state accessor throws when no provider is above it.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare function missingScheduledExportStateProvider(accessor: string): never;
7
+ //# sourceMappingURL=missingScheduledExportStateProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingScheduledExportStateProvider.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/missingScheduledExportStateProvider.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAI3E"}
@@ -0,0 +1,9 @@
1
+ // (C) 2026 GoodData Corporation
2
+ /**
3
+ * The single error every scheduled-export dialog state accessor throws when no provider is above it.
4
+ *
5
+ * @internal
6
+ */
7
+ export function missingScheduledExportStateProvider(accessor) {
8
+ throw new Error(`${accessor} must be used within ScheduledEmailDialogStateProvider. The provider mounts only once the dialog's data has loaded, so check useScheduledEmailDialogContext().isLoading before reading scheduled-export dialog state.`);
9
+ }
@@ -1,5 +1,5 @@
1
1
  import { type FilterContextItem, type IAutomationVisibleFilter, type IDashboardExportParameter, type IFilter, type IInsight, type IWidget } from "@gooddata/sdk-model";
2
- import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
2
+ import type { IAutomationFiltersTab } from "../../../../model/store/filtering/types.js";
3
3
  export interface IUseScheduledEmailEffectiveFiltersProps {
4
4
  widget?: IWidget;
5
5
  insight?: IInsight;
@@ -17,7 +17,7 @@ export interface IUseScheduledEmailEffectiveFiltersProps {
17
17
  *
18
18
  * This has to run before the draft exists, because `useScheduledEmailFormState` and
19
19
  * `useScheduledEmailExportSettings` consume these values while initializing it. The handlers that
20
- * *change* filters live in {@link useScheduledEmailFilters} and necessarily run later — they write
20
+ * *change* filters live in {@link useScheduledEmailFiltersModel} and necessarily run later — they write
21
21
  * through the draft's setter. That ordering is why reading and writing filters are two hooks rather
22
22
  * than one.
23
23
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScheduledEmailEffectiveFilters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailEffectiveFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C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- import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
4
- import { shouldStoreExportParameters } from "../../../shared/automationFilters/automationParameters.js";
5
- import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/filters/index.js";
3
+ import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
4
+ import { shouldStoreExportParameters } from "../../shared/automationFilters/automationParameters.js";
5
+ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../shared/filters/index.js";
6
6
  /**
7
7
  * Derives the filter sets a scheduled export actually runs with: the widget and dashboard filters left
8
8
  * after hidden filters are removed, their visible-filter counterparts for display, and the per-tab
@@ -10,7 +10,7 @@ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersB
10
10
  *
11
11
  * This has to run before the draft exists, because `useScheduledEmailFormState` and
12
12
  * `useScheduledEmailExportSettings` consume these values while initializing it. The handlers that
13
- * *change* filters live in {@link useScheduledEmailFilters} and necessarily run later — they write
13
+ * *change* filters live in {@link useScheduledEmailFiltersModel} and necessarily run later — they write
14
14
  * through the draft's setter. That ordering is why reading and writing filters are two hooks rather
15
15
  * than one.
16
16
  *
@@ -12,31 +12,19 @@ export interface IUseScheduledEmailExportSettingsProps {
12
12
  effectiveWidgetFiltersWithInsight: IFilter[];
13
13
  defaultPdfPageSize?: IExportDefinitionVisualizationObjectSettings["pageSize"];
14
14
  }
15
+ /**
16
+ * Owns the scheduled export's attachment write path: the per-tab export-parameter wire, which is
17
+ * held outside the automation so it survives an export-definition rebuild, and every handler that
18
+ * rebuilds or patches export definitions and therefore captures that wire.
19
+ *
20
+ * The wire must exist once per dialog, so this hook is called once, by the state provider, and its
21
+ * handlers are published on the actions context. What the attachment section *displays* is a pure
22
+ * function of the draft and is derived per consumer in {@link useScheduledExportAttachments}.
23
+ *
24
+ * @internal
25
+ */
15
26
  export declare function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget, storeFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, defaultPdfPageSize }: IUseScheduledEmailExportSettingsProps): {
16
- selectedAttachments: ("CSV" | "CSV_RAW" | "HTML" | "PDF" | "PDF_SLIDES" | "PDF_TABULAR" | "PNG" | "PPTX" | "XLSX")[];
17
- isDashboardExportSelected: boolean;
18
- isCsvExportSelected: boolean;
19
- isXlsxExportSelected: boolean;
20
- xlsxSettings: {
21
- mergeHeaders: boolean;
22
- exportInfo: boolean;
23
- };
24
- pdfSettings: {
25
- pageSize: "A3" | "A4" | "LETTER";
26
- orientation: "landscape" | "portrait";
27
- exportInfo: boolean;
28
- };
29
- csvSettings: {
30
- delimiter: string;
31
- };
32
- csvRawSettings: {
33
- delimiter: string;
34
- };
35
- slidesTemplateIds: {
36
- PPTX: string | undefined;
37
- PDF_SLIDES: string | undefined;
38
- PDF: string | undefined;
39
- };
27
+ setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
40
28
  onDashboardAttachmentsChange: (formats: DashboardAttachmentType[]) => void;
41
29
  onWidgetAttachmentsChange: (formats: WidgetAttachmentType[]) => void;
42
30
  onXlsxSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
@@ -44,6 +32,5 @@ export declare function useScheduledEmailExportSettings({ editedAutomation, setE
44
32
  onCsvSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
45
33
  onCsvRawSettingsChange: (settings: IExportDefinitionVisualizationObjectSettings) => void;
46
34
  onSlidesTemplateIdChange: (templateId: string | undefined, format: "PDF" | "PDF_SLIDES" | "PPTX") => void;
47
- setParametersWire: (wire: Record<string, IDashboardExportParameter[]> | undefined) => void;
48
35
  };
49
36
  //# sourceMappingURL=useScheduledEmailExportSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScheduledEmailExportSettings.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailExportSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAIhF,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAG5B,MAAM,qBAAqB,CAAC;AAc7B,MAAM,WAAW,qCAAqC;IAClD,gBAAgB,EAAE,mCAAmC,CAAC;IACtD,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yBAAyB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3D,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;IAChF,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,iCAAiC,EAAE,OAAO,EAAE,CAAC;IAC7C,kBAAkB,CAAC,EAAE,4CAA4C,CAAC,UAAU,CAAC,CAAC;CACjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,YAAY,EACZ,yBAAyB,EACzB,8BAA8B,EAC9B,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EACrB,EAAE,qCAAqC;;;;;;;;;EAsRvC"}
@@ -1,15 +1,23 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
- import { useCallback, useMemo, useRef } from "react";
2
+ import { useCallback, useRef } from "react";
3
3
  import { invariant } from "ts-invariant";
4
- import { DEFAULT_CSV_DELIMITER, isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
5
- import { getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../../_staging/automation/index.js";
6
- import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
7
- import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
8
- import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDefinitionMetadataObjectDefinition, withRebuiltExportDefinitions, } from "../utils/exportDefinitions.js";
4
+ import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, } from "@gooddata/sdk-model";
5
+ import { getAutomationExportParametersByTab, setExportParametersByTab, } from "../../../../_staging/automation/index.js";
6
+ import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
7
+ import { newDashboardExportDefinitionMetadataObjectDefinition, newWidgetExportDefinitionMetadataObjectDefinition, withRebuiltExportDefinitions, } from "./exportDefinitions.js";
8
+ /**
9
+ * Owns the scheduled export's attachment write path: the per-tab export-parameter wire, which is
10
+ * held outside the automation so it survives an export-definition rebuild, and every handler that
11
+ * rebuilds or patches export definitions and therefore captures that wire.
12
+ *
13
+ * The wire must exist once per dialog, so this hook is called once, by the state provider, and its
14
+ * handlers are published on the actions context. What the attachment section *displays* is a pure
15
+ * function of the draft and is derived per consumer in {@link useScheduledExportAttachments}.
16
+ *
17
+ * @internal
18
+ */
9
19
  export function useScheduledEmailExportSettings({ editedAutomation, setEditedAutomation, insight, widget, storeFilters, effectiveDashboardFilters, effectiveDashboardFiltersByTab, effectiveWidgetFilters, effectiveWidgetFiltersWithInsight, defaultPdfPageSize, }) {
10
- const { settings } = useAutomationsContext();
11
20
  const { dashboardId, dashboardTitle } = useScheduledEmailDialogContext();
12
- const resolvedDefaultCsvDelimiter = settings?.exportCsvCustomDelimiter ?? DEFAULT_CSV_DELIMITER;
13
21
  // Holds the wire outside the automation so it survives a rebuild from zero export definitions —
14
22
  // with no definitions `setExportParametersByTab` has nowhere to store it.
15
23
  // Seeded from the stored wire.
@@ -25,12 +33,7 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
25
33
  // `widget`/`insight` via TS's aliased-condition control-flow analysis — this requires the boolean
26
34
  // to be declared from those exact variables in this same scope, same as in the parent.
27
35
  const isWidget = !!widget && !!insight;
28
- const selectedAttachments = useMemo(() => {
29
- return (editedAutomation.exportDefinitions
30
- ?.map((exportDefinition) => exportDefinition.requestPayload.format)
31
- .filter(Boolean) ?? []);
32
- }, [editedAutomation.exportDefinitions]);
33
- const onDashboardAttachmentsChange = (formats) => {
36
+ const onDashboardAttachmentsChange = useCallback((formats) => {
34
37
  setEditedAutomation((s) => {
35
38
  const currentExportDefinitions = s.exportDefinitions || [];
36
39
  const currentDashboardExportDefinitions = currentExportDefinitions.filter((exportDefinition) => isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload));
@@ -48,8 +51,15 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
48
51
  const updatedExportDefinitions = [...keptExportDefinitions, ...newExportDefinitions];
49
52
  return withRebuiltExportDefinitions(s, updatedExportDefinitions, latestParametersWireRef.current);
50
53
  });
51
- };
52
- const onWidgetAttachmentsChange = (formats) => {
54
+ }, [
55
+ setEditedAutomation,
56
+ dashboardId,
57
+ dashboardTitle,
58
+ storeFilters,
59
+ effectiveDashboardFilters,
60
+ effectiveDashboardFiltersByTab,
61
+ ]);
62
+ const onWidgetAttachmentsChange = useCallback((formats) => {
53
63
  invariant(isWidget, "Widget or insight is missing in scheduling dialog context.");
54
64
  setEditedAutomation((s) => {
55
65
  const currentExportDefinitions = s.exportDefinitions || [];
@@ -71,7 +81,17 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
71
81
  const updatedExportDefinitions = [...keptExportDefinitions, ...newExportDefinitions];
72
82
  return withRebuiltExportDefinitions(s, updatedExportDefinitions, latestParametersWireRef.current);
73
83
  });
74
- };
84
+ }, [
85
+ setEditedAutomation,
86
+ isWidget,
87
+ insight,
88
+ widget,
89
+ dashboardId,
90
+ effectiveWidgetFilters,
91
+ effectiveWidgetFiltersWithInsight,
92
+ effectiveDashboardFilters,
93
+ defaultPdfPageSize,
94
+ ]);
75
95
  const onXlsxSettingsChange = useCallback((settings) => {
76
96
  setEditedAutomation((s) => ({
77
97
  ...s,
@@ -178,75 +198,8 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
178
198
  }),
179
199
  }));
180
200
  }, [setEditedAutomation, isWidget]);
181
- const isDashboardExportSelected = editedAutomation.exportDefinitions?.some((exportDefinition) => isExportDefinitionDashboardRequestPayload(exportDefinition.requestPayload)) ?? true;
182
- const isCsvExportSelected = editedAutomation.exportDefinitions?.some((exportDefinition) => {
183
- if (isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload)) {
184
- return exportDefinition.requestPayload.format === "CSV";
185
- }
186
- return false;
187
- }) ?? false;
188
- const isXlsxExportSelected = editedAutomation.exportDefinitions?.some((exportDefinition) => {
189
- if (isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload)) {
190
- return exportDefinition.requestPayload.format === "XLSX";
191
- }
192
- return false;
193
- }) ?? false;
194
- const xlsxExportSettings = editedAutomation.exportDefinitions?.find((exportDefinition) => exportDefinition.requestPayload.format === "XLSX")?.requestPayload.settings;
195
- const xlsxSettings = {
196
- mergeHeaders: xlsxExportSettings?.mergeHeaders ?? true,
197
- exportInfo: xlsxExportSettings?.exportInfo ?? true,
198
- };
199
- const pdfVisualizationSettings = editedAutomation.exportDefinitions?.find((exportDefinition) => isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload) &&
200
- exportDefinition.requestPayload.format === "PDF_TABULAR")?.requestPayload.settings;
201
- const pdfTabularSettings = pdfVisualizationSettings && "pageSize" in pdfVisualizationSettings
202
- ? pdfVisualizationSettings
203
- : undefined;
204
- const pdfSettings = {
205
- pageSize: pdfTabularSettings?.pageSize ?? defaultPdfPageSize ?? "A4",
206
- orientation: pdfTabularSettings?.orientation ?? "portrait",
207
- exportInfo: pdfTabularSettings?.exportInfo ?? true,
208
- };
209
- const csvExportDefinition = editedAutomation.exportDefinitions?.find((exportDefinition) => isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload) &&
210
- exportDefinition.requestPayload.format === "CSV");
211
- const csvExportSettings = csvExportDefinition &&
212
- isExportDefinitionVisualizationObjectRequestPayload(csvExportDefinition.requestPayload)
213
- ? csvExportDefinition.requestPayload.settings
214
- : undefined;
215
- const csvSettings = {
216
- delimiter: csvExportSettings?.delimiter ?? resolvedDefaultCsvDelimiter,
217
- };
218
- const csvRawExportDefinition = editedAutomation.exportDefinitions?.find((exportDefinition) => isExportDefinitionVisualizationObjectRequestPayload(exportDefinition.requestPayload) &&
219
- exportDefinition.requestPayload.format === "CSV_RAW");
220
- const csvRawExportSettings = csvRawExportDefinition &&
221
- isExportDefinitionVisualizationObjectRequestPayload(csvRawExportDefinition.requestPayload)
222
- ? csvRawExportDefinition.requestPayload.settings
223
- : undefined;
224
- const csvRawSettings = {
225
- delimiter: csvRawExportSettings?.delimiter ?? resolvedDefaultCsvDelimiter,
226
- };
227
- // Extract templateId per slides format, scoped to the current dialog mode
228
- const getTemplateIdForFormat = (format) => {
229
- const def = editedAutomation.exportDefinitions?.find((ed) => ed.requestPayload.format === format &&
230
- (isWidget
231
- ? isExportDefinitionVisualizationObjectRequestPayload(ed.requestPayload)
232
- : isExportDefinitionDashboardRequestPayload(ed.requestPayload)));
233
- return def?.requestPayload.templateId;
234
- };
235
- const slidesTemplateIds = {
236
- PPTX: getTemplateIdForFormat("PPTX"),
237
- PDF_SLIDES: getTemplateIdForFormat("PDF_SLIDES"),
238
- PDF: getTemplateIdForFormat("PDF"),
239
- };
240
201
  return {
241
- selectedAttachments,
242
- isDashboardExportSelected,
243
- isCsvExportSelected,
244
- isXlsxExportSelected,
245
- xlsxSettings,
246
- pdfSettings,
247
- csvSettings,
248
- csvRawSettings,
249
- slidesTemplateIds,
202
+ setParametersWire,
250
203
  onDashboardAttachmentsChange,
251
204
  onWidgetAttachmentsChange,
252
205
  onXlsxSettingsChange,
@@ -254,6 +207,5 @@ export function useScheduledEmailExportSettings({ editedAutomation, setEditedAut
254
207
  onCsvSettingsChange,
255
208
  onCsvRawSettingsChange,
256
209
  onSlidesTemplateIdChange,
257
- setParametersWire,
258
210
  };
259
211
  }
@@ -1,8 +1,8 @@
1
1
  import { type Dispatch, type SetStateAction } from "react";
2
2
  import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IDashboardExportParameter, type IInsight, type IWidget } from "@gooddata/sdk-model";
3
- import type { IAutomationFiltersTab } from "../../../../../model/store/filtering/types.js";
4
- import { type IUseAutomationExportParameters } from "../../../shared/automationFilters/useAutomationExportParameters.js";
5
- export interface IUseScheduledEmailFiltersProps {
3
+ import type { IAutomationFiltersTab } from "../../../../model/store/filtering/types.js";
4
+ import { type IUseAutomationExportParameters } from "../../shared/automationFilters/useAutomationExportParameters.js";
5
+ export interface IUseScheduledEmailFiltersModelProps {
6
6
  setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition>>;
7
7
  scheduledExportToEdit?: IAutomationMetadataObject;
8
8
  widget?: IWidget;
@@ -34,13 +34,13 @@ export interface IUseScheduledEmailFiltersProps {
34
34
  *
35
35
  * @internal
36
36
  */
37
- export declare function useScheduledEmailFilters({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire }: IUseScheduledEmailFiltersProps): IUseScheduledEmailFilters;
37
+ export declare function useScheduledEmailFiltersModel({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire }: IUseScheduledEmailFiltersModelProps): IUseScheduledEmailFiltersModel;
38
38
  /**
39
- * Return type of {@link useScheduledEmailFilters}: its own filter model plus the whole absorbed
39
+ * Return type of {@link useScheduledEmailFiltersModel}: its own filter model plus the whole absorbed
40
40
  * {@link useAutomationExportParameters} model, spread in verbatim so its member names stay canonical.
41
41
  * @internal
42
42
  */
43
- export interface IUseScheduledEmailFilters extends IUseAutomationExportParameters {
43
+ export interface IUseScheduledEmailFiltersModel extends IUseAutomationExportParameters {
44
44
  selectedFilters: FilterContextItem[];
45
45
  availableFilters: FilterContextItem[] | undefined;
46
46
  storeFilters: boolean;
@@ -53,4 +53,4 @@ export interface IUseScheduledEmailFilters extends IUseAutomationExportParameter
53
53
  automationIsValid: boolean;
54
54
  filtersAreStale: boolean;
55
55
  }
56
- //# sourceMappingURL=useScheduledEmailFilters.d.ts.map
56
+ //# sourceMappingURL=useScheduledEmailFiltersModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScheduledEmailFiltersModel.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailFiltersModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEhF,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,EACb,KAAK,OAAO,EAIf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAGxF,OAAO,EACH,KAAK,8BAA8B,E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CAAqC,EACrC,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACpB,EAAE,mCAAmC,GAAG,8BAA8B,CAiRtE;AAkBD;;;;GAIG;AACH,MAAM,WAAW,8BAA+B,SAAQ,8BAA8B;IAClF,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAClD,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IAClD,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;IACpE,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrF,oBAAoB,EAAE,CAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EACpD,iBAAiB,CAAC,EAAE,OAAO,KAC1B,IAAI,CAAC;IACV,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,oBAAoB,EAAE,CAClB,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,iBAAiB,EAAE,EAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,KACtD,IAAI,CAAC;IACV,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC5B"}
@@ -1,11 +1,12 @@
1
1
  // (C) 2026 GoodData Corporation
2
- import { useCallback } from "react";
2
+ import { useCallback, useRef } from "react";
3
3
  import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, } from "@gooddata/sdk-model";
4
- import { useScheduledEmailDialogContext } from "../../../contexts/ScheduledEmailDialogContext.js";
5
- import { useValidateExistingAutomationFilters } from "../../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
6
- import { useAutomationExportParameters, } from "../../../shared/automationFilters/useAutomationExportParameters.js";
7
- import { getDefaultSelectedFiltersFromFiltersByTab } from "../../../shared/automationFilters/useAutomationFiltersSelect.js";
8
- import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../../shared/filters/index.js";
4
+ import { shallowEqualObjects } from "@gooddata/util";
5
+ import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
6
+ import { useValidateExistingAutomationFilters } from "../../shared/automationFilters/hooks/useValidateExistingAutomationFilters.js";
7
+ import { useAutomationExportParameters, } from "../../shared/automationFilters/useAutomationExportParameters.js";
8
+ import { getDefaultSelectedFiltersFromFiltersByTab } from "../../shared/automationFilters/useAutomationFiltersSelect.js";
9
+ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../shared/filters/index.js";
9
10
  /**
10
11
  * The scheduled-email dialog's single filter model: the current selection and available filters
11
12
  * (flat and per-tab), the handlers that mutate them and mirror the result into the draft, the
@@ -20,7 +21,7 @@ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersB
20
21
  *
21
22
  * @internal
22
23
  */
23
- export function useScheduledEmailFilters({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire, }) {
24
+ export function useScheduledEmailFiltersModel({ setEditedAutomation, scheduledExportToEdit, widget, insight, editedAutomationFilters, setEditedAutomationFilters, editedAutomationFiltersByTab, setEditedAutomationFiltersByTab, availableFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, storeFilters, setStoreFilters, filtersForNewAutomation, setParametersWire, }) {
24
25
  const { hiddenFilters: dashboardHiddenFilters, commonDateFilterId, exportParametersByTab, } = useScheduledEmailDialogContext();
25
26
  // Re-derived locally (not passed as a prop) so that the `if (isWidget)` branch below narrows
26
27
  // `widget`/`insight` via TS's aliased-condition control-flow analysis — this requires the boolean
@@ -200,7 +201,10 @@ export function useScheduledEmailFilters({ setEditedAutomation, scheduledExportT
200
201
  }
201
202
  onStoreParametersChange(value);
202
203
  }, [onFiltersChange, onFiltersByTabChange, setStoreFilters, onStoreParametersChange]);
203
- return {
204
+ // Held stable member-wise, not just internally: this whole object is the filter context's value,
205
+ // so its identity is what every consumer re-renders on. The model never reads the draft, so a
206
+ // keystroke changes no member — and without this a fresh literal would re-render every consumer.
207
+ return useShallowStable({
204
208
  selectedFilters: editedAutomationFilters,
205
209
  availableFilters,
206
210
  storeFilters,
@@ -213,5 +217,18 @@ export function useScheduledEmailFilters({ setEditedAutomation, scheduledExportT
213
217
  automationIsValid,
214
218
  filtersAreStale,
215
219
  ...parameters,
216
- };
220
+ });
221
+ }
222
+ /**
223
+ * Returns the previous object while every member keeps its identity, so a caller can hold a whole
224
+ * model stable without naming its members. Preferred over `useMemo` here because the roster is the
225
+ * hook's return shape: a dependency array would have to restate all of it, and a missed entry would
226
+ * serve a stale member rather than fail loudly.
227
+ */
228
+ function useShallowStable(value) {
229
+ const previous = useRef(value);
230
+ if (!shallowEqualObjects(previous.current, value)) {
231
+ previous.current = value;
232
+ }
233
+ return previous.current;
217
234
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScheduledEmailFormState.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailFormState.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4CAA4C,EACjD,KAAK,OAAO,EACZ,KAAK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