@gooddata/sdk-ui-analytical-designer 11.67.0-alpha.2 → 11.67.0-alpha.4

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 (170) hide show
  1. package/NOTICE +798 -2473
  2. package/README.md +13 -5
  3. package/esm/Root.d.ts +0 -2
  4. package/esm/Root.d.ts.map +1 -1
  5. package/esm/Root.js +0 -4
  6. package/esm/actions/app_context_actions.d.ts.map +1 -1
  7. package/esm/actions/app_context_actions.js +2 -4
  8. package/esm/actions/dialogs_actions.d.ts +2 -2
  9. package/esm/actions/dialogs_actions.js +2 -2
  10. package/esm/components/DeleteReportDialog.d.ts.map +1 -1
  11. package/esm/components/DeleteReportDialog.js +30 -11
  12. package/esm/components/DeleteReportDialogUsageList.d.ts +6 -2
  13. package/esm/components/DeleteReportDialogUsageList.d.ts.map +1 -1
  14. package/esm/components/DeleteReportDialogUsageList.js +29 -16
  15. package/esm/components/DeleteReportDialogUsageListItem.d.ts +2 -3
  16. package/esm/components/DeleteReportDialogUsageListItem.d.ts.map +1 -1
  17. package/esm/components/DeleteReportDialogUsageListItem.js +2 -3
  18. package/esm/components/Editor.d.ts.map +1 -1
  19. package/esm/components/Editor.js +31 -2
  20. package/esm/components/EditorHeader.d.ts +19 -1
  21. package/esm/components/EditorHeader.d.ts.map +1 -1
  22. package/esm/components/EditorHeader.js +38 -86
  23. package/esm/components/ReportDescription.d.ts +8 -1
  24. package/esm/components/ReportDescription.d.ts.map +1 -1
  25. package/esm/components/ReportDescription.js +37 -7
  26. package/esm/components/buckets/MeasureAttributeFilterOrganized.d.ts.map +1 -1
  27. package/esm/components/buckets/MeasureAttributeFilterOrganized.js +1 -1
  28. package/esm/components/buckets/MeasureDateFilter.d.ts.map +1 -1
  29. package/esm/components/buckets/MeasureDateFilter.js +1 -1
  30. package/esm/components/buckets/categories/DateDatasetsDropdown.d.ts.map +1 -1
  31. package/esm/components/filterBar/dateFilter/TimeComparisonSection/TimeComparisonTypesDropdown.d.ts.map +1 -1
  32. package/esm/components/header/CancelButton.d.ts +13 -0
  33. package/esm/components/header/CancelButton.d.ts.map +1 -0
  34. package/esm/components/header/CancelButton.js +32 -0
  35. package/esm/components/header/ClearButton.d.ts +7 -0
  36. package/esm/components/header/ClearButton.d.ts.map +1 -0
  37. package/esm/components/header/ClearButton.js +24 -0
  38. package/esm/components/header/EditorActions.d.ts +14 -0
  39. package/esm/components/header/EditorActions.d.ts.map +1 -0
  40. package/esm/components/header/EditorActions.js +71 -0
  41. package/esm/components/header/Embed/EmbedButton.d.ts +6 -1
  42. package/esm/components/header/Embed/EmbedButton.d.ts.map +1 -1
  43. package/esm/components/header/Embed/EmbedButton.js +48 -48
  44. package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts +6 -0
  45. package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts.map +1 -0
  46. package/esm/components/header/Embed/EmbedInsightDialogContainer.js +52 -0
  47. package/esm/components/header/Embed/EmbedMenu.d.ts +6 -4
  48. package/esm/components/header/Embed/EmbedMenu.d.ts.map +1 -1
  49. package/esm/components/header/Embed/EmbedMenu.js +2 -6
  50. package/esm/components/header/InsightPickerDialog.d.ts +5 -1
  51. package/esm/components/header/InsightPickerDialog.d.ts.map +1 -1
  52. package/esm/components/header/InsightPickerDialog.js +9 -29
  53. package/esm/components/header/OpenControl.d.ts +7 -0
  54. package/esm/components/header/OpenControl.d.ts.map +1 -0
  55. package/esm/components/header/OpenControl.js +69 -0
  56. package/esm/components/header/OptionsMenu/OptionsButton.d.ts +5 -1
  57. package/esm/components/header/OptionsMenu/OptionsButton.d.ts.map +1 -1
  58. package/esm/components/header/OptionsMenu/OptionsButton.js +19 -9
  59. package/esm/components/header/OptionsMenu/OptionsMenu.d.ts +8 -60
  60. package/esm/components/header/OptionsMenu/OptionsMenu.d.ts.map +1 -1
  61. package/esm/components/header/OptionsMenu/OptionsMenu.js +56 -112
  62. package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts +3 -4
  63. package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts.map +1 -1
  64. package/esm/components/header/OptionsMenu/OptionsMenuItem.js +5 -9
  65. package/esm/components/header/OptionsMenu/useOptionsProps.d.ts +26 -0
  66. package/esm/components/header/OptionsMenu/useOptionsProps.d.ts.map +1 -0
  67. package/esm/components/header/OptionsMenu/useOptionsProps.js +188 -0
  68. package/esm/components/header/SaveAsNewReportButton.d.ts +6 -1
  69. package/esm/components/header/SaveAsNewReportButton.d.ts.map +1 -1
  70. package/esm/components/header/SaveAsNewReportButton.js +20 -10
  71. package/esm/components/header/SaveReportButton.d.ts +6 -1
  72. package/esm/components/header/SaveReportButton.d.ts.map +1 -1
  73. package/esm/components/header/SaveReportButton.js +41 -18
  74. package/esm/components/header/TimezoneDialog.d.ts +1 -1
  75. package/esm/components/header/TimezoneDialog.js +1 -1
  76. package/esm/components/header/UndoRedoButtons.d.ts +7 -0
  77. package/esm/components/header/UndoRedoButtons.d.ts.map +1 -0
  78. package/esm/components/header/UndoRedoButtons.js +31 -0
  79. package/esm/components/header/VisualizationInfo.d.ts +11 -0
  80. package/esm/components/header/VisualizationInfo.d.ts.map +1 -0
  81. package/esm/components/header/VisualizationInfo.js +47 -0
  82. package/esm/components/header/VisualizationTitle.d.ts +7 -0
  83. package/esm/components/header/VisualizationTitle.d.ts.map +1 -0
  84. package/esm/components/header/VisualizationTitle.js +36 -0
  85. package/esm/components/header/VisualizationsDropdown.d.ts +5 -1
  86. package/esm/components/header/VisualizationsDropdown.d.ts.map +1 -1
  87. package/esm/components/header/VisualizationsDropdown.js +7 -33
  88. package/esm/components/header/editorHeaderContext.d.ts +20 -0
  89. package/esm/components/header/editorHeaderContext.d.ts.map +1 -0
  90. package/esm/components/header/editorHeaderContext.js +58 -0
  91. package/esm/components/header/share/InsightAccess.d.ts +30 -1
  92. package/esm/components/header/share/InsightAccess.d.ts.map +1 -1
  93. package/esm/components/header/share/InsightAccess.js +81 -18
  94. package/esm/components/header/share/InsightAccessChip.d.ts +2 -2
  95. package/esm/components/header/share/InsightAccessChip.d.ts.map +1 -1
  96. package/esm/components/header/share/InsightAccessChip.js +3 -3
  97. package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +1 -1
  98. package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -1
  99. package/esm/embedding/editorHeaderSlotTypes.d.ts +569 -0
  100. package/esm/embedding/editorHeaderSlotTypes.d.ts.map +1 -0
  101. package/esm/embedding/editorHeaderSlotTypes.js +2 -0
  102. package/esm/embedding/slots.d.ts +73 -0
  103. package/esm/embedding/slots.d.ts.map +1 -1
  104. package/esm/index.d.ts +1 -0
  105. package/esm/index.d.ts.map +1 -1
  106. package/esm/postMessageApi/outgoing/metrics_changed_events.d.ts +1 -1
  107. package/esm/postMessageApi/outgoing/metrics_changed_events.js +1 -1
  108. package/esm/postMessageApi/outgoing/post_event_helper.d.ts +1 -1
  109. package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
  110. package/esm/postMessageApi/outgoing/post_event_helper.js +1 -1
  111. package/esm/postMessageApi/sagas/control_filtering_saga.js +1 -1
  112. package/esm/sdk-ui-analytical-designer.d.ts +664 -0
  113. package/esm/selectors/dialogs_selector.d.ts +26 -2
  114. package/esm/selectors/dialogs_selector.d.ts.map +1 -1
  115. package/esm/selectors/dialogs_selector.js +3 -2
  116. package/esm/selectors/editor_header_selector.d.ts +225 -0
  117. package/esm/selectors/editor_header_selector.d.ts.map +1 -1
  118. package/esm/selectors/editor_header_selector.js +8 -1
  119. package/esm/selectors/feature_flag_selector.d.ts +2 -23
  120. package/esm/selectors/feature_flag_selector.d.ts.map +1 -1
  121. package/esm/selectors/feature_flag_selector.js +0 -2
  122. package/esm/selectors/insight_access_selector.d.ts +185 -4
  123. package/esm/selectors/insight_access_selector.d.ts.map +1 -1
  124. package/esm/selectors/insight_access_selector.js +5 -3
  125. package/esm/selectors/report_title_selector.d.ts +6 -6
  126. package/esm/selectors/report_title_selector.d.ts.map +1 -1
  127. package/esm/selectors/report_title_selector.js +4 -3
  128. package/esm/selectors/report_visualization_selector.d.ts +4 -4
  129. package/esm/selectors/save_report_selector.d.ts +7 -0
  130. package/esm/selectors/save_report_selector.d.ts.map +1 -1
  131. package/esm/selectors/save_report_selector.js +11 -1
  132. package/esm/selectors/uri_selector.d.ts +22 -0
  133. package/esm/selectors/uri_selector.d.ts.map +1 -1
  134. package/esm/selectors/uri_selector.js +1 -0
  135. package/esm/store/app_context/app_context_slices.d.ts.map +1 -1
  136. package/esm/store/app_context/app_context_slices.js +2 -3
  137. package/esm/store/app_context/session_id_reducer.d.ts +2 -3
  138. package/esm/store/app_context/session_id_reducer.d.ts.map +1 -1
  139. package/esm/store/app_context/session_id_reducer.js +2 -3
  140. package/esm/store/intl/intl_slice.d.ts.map +1 -1
  141. package/esm/store/intl/intl_slice.js +2 -3
  142. package/esm/translations/en-US.json +22 -2
  143. package/esm/utils/browser_detect.d.ts +2 -1
  144. package/esm/utils/browser_detect.d.ts.map +1 -1
  145. package/esm/utils/browser_detect.js +21 -3
  146. package/esm/utils/dropdown.d.ts +6 -2
  147. package/esm/utils/dropdown.d.ts.map +1 -1
  148. package/esm/utils/dropdown.js +10 -3
  149. package/package.json +26 -34
  150. package/styles/css/catalog.css +2 -2
  151. package/styles/css/catalog_sidebar.css +1 -1
  152. package/styles/css/catalog_sidebar.css.map +1 -1
  153. package/styles/css/delete_report_dialog.css +6 -2
  154. package/styles/css/delete_report_dialog.css.map +1 -1
  155. package/styles/css/editor_canvas.css +1 -1
  156. package/styles/css/editor_header.css +16 -1
  157. package/styles/css/editor_header.css.map +1 -1
  158. package/styles/css/main.css +26 -7
  159. package/styles/css/main.css.map +1 -1
  160. package/styles/scss/catalog.scss +2 -2
  161. package/styles/scss/catalog_sidebar.scss +2 -1
  162. package/styles/scss/delete_report_dialog.scss +8 -2
  163. package/styles/scss/editor_canvas.scss +1 -1
  164. package/styles/scss/editor_header.scss +20 -1
  165. package/esm/components/ReportTitle.d.ts +0 -2
  166. package/esm/components/ReportTitle.d.ts.map +0 -1
  167. package/esm/components/ReportTitle.js +0 -51
  168. package/esm/components/header/Embed/utils.d.ts +0 -4
  169. package/esm/components/header/Embed/utils.d.ts.map +0 -1
  170. package/esm/components/header/Embed/utils.js +0 -5
@@ -0,0 +1,188 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { useMemo } from "react";
3
+ import { defineMessage, defineMessages, useIntl } from "react-intl";
4
+ import { useSelector } from "react-redux";
5
+ import { showDialogExportCsv, showDialogExportPdf, showDialogExportReport, } from "../../../actions/export_report_actions.js";
6
+ import { supportsExportToCsv, supportsExportToXlsx, } from "../../../selectors/backend_capabilities_selector.js";
7
+ import { isOpenInAnalyticalDesignerVisible } from "../../../selectors/editor_header_selector.js";
8
+ import { enableRawExports, isAccessibilityModeEnabled, isEnableTimezoneChange, } from "../../../selectors/feature_flag_selector.js";
9
+ import { getExportBubbleTextProvider, getExportRawBubbleTextProvider, getExportVisible, getIsExportCSVDisabled, getIsExportCSVRawDisabled, getIsExportPDFDisabled, getIsExportXLSXDisabled, isTableVisualization, } from "../../../selectors/options_menu_selector.js";
10
+ import { hasPartialDataLimitBreaks } from "../../../selectors/report_selector.js";
11
+ import { openInAnalyticalDesignerAction } from "../../../store/router/router_actions.js";
12
+ import { useGuardedCallback } from "../editorHeaderContext.js";
13
+ /**
14
+ * Identifiers of the built-in options menu items.
15
+ */
16
+ export const OPTIONS_ITEM_IDS = {
17
+ openInAnalyticalDesigner: "openInAnalyticalDesigner",
18
+ exportSection: "exportSection",
19
+ exportXlsx: "exportXlsx",
20
+ exportPdf: "exportPdf",
21
+ exportCsv: "exportCsv",
22
+ exportCsvRaw: "exportCsvRaw",
23
+ timezoneSeparator: "timezoneSeparator",
24
+ changeTimezone: "changeTimezone",
25
+ };
26
+ const partialResultMessage = defineMessage({ id: "options.menu.export_data.partial_result_disabled" });
27
+ const csvMessages = defineMessages({
28
+ csv: { id: "export.type.CSV" },
29
+ csvFormatted: { id: "export.type.CSV.formatted" },
30
+ });
31
+ // Formatted exports are refused while the result is partial; raw exports are not.
32
+ const isXlsxAllowed = (state) => !getIsExportXLSXDisabled(state) && !hasPartialDataLimitBreaks(state);
33
+ const isPdfAllowed = (state) => !getIsExportPDFDisabled(state) && !hasPartialDataLimitBreaks(state);
34
+ const isCsvAllowed = (state) => !getIsExportCSVDisabled(state) && !hasPartialDataLimitBreaks(state);
35
+ const isCsvRawAllowed = (state) => !getIsExportCSVRawDisabled(state);
36
+ const runExportXlsx = (dispatch) => dispatch(showDialogExportReport());
37
+ const runExportPdf = (dispatch) => dispatch(showDialogExportPdf());
38
+ const runExportCsv = (dispatch) => dispatch(showDialogExportCsv("formatted"));
39
+ const runExportCsvRaw = (dispatch) => dispatch(showDialogExportCsv("raw"));
40
+ const runOpenInAnalyticalDesigner = (dispatch) => dispatch(openInAnalyticalDesignerAction());
41
+ const tooltip = (text) => (text ? { disabledTooltip: text } : {});
42
+ const noBubbleText = (_intl) => "";
43
+ /**
44
+ * Props of the Options slot.
45
+ *
46
+ * @param onChangeTimezone - opens the time zone dialog, which the editor actions own so that it opens for a
47
+ * host's own Options menu too
48
+ */
49
+ export function useOptionsProps(context, onChangeTimezone) {
50
+ const intl = useIntl();
51
+ const exportBubbleTextProvider = useSelector(getExportBubbleTextProvider) ?? noBubbleText;
52
+ const exportRawBubbleTextProvider = useSelector(getExportRawBubbleTextProvider) ?? noBubbleText;
53
+ const isExportVisible = useSelector(getExportVisible);
54
+ const isExportCSVDisabled = useSelector(getIsExportCSVDisabled);
55
+ const isExportRawCSVDisabled = useSelector(getIsExportCSVRawDisabled);
56
+ const isExportXLSXDisabled = useSelector(getIsExportXLSXDisabled);
57
+ const isExportPDFDisabled = useSelector(getIsExportPDFDisabled);
58
+ const exportToCsvSupported = useSelector(supportsExportToCsv);
59
+ const exportToXlsxSupported = useSelector(supportsExportToXlsx);
60
+ const exportToPdfSupported = useSelector(isTableVisualization);
61
+ const isRawExportEnabled = useSelector(enableRawExports);
62
+ const isPartialResult = useSelector(hasPartialDataLimitBreaks);
63
+ const isAccessibilityMode = useSelector(isAccessibilityModeEnabled);
64
+ const isTimezoneChangeEnabled = useSelector(isEnableTimezoneChange);
65
+ const isOpenInAnalyticalDesignerShown = useSelector(isOpenInAnalyticalDesignerVisible);
66
+ const onExportXlsx = useGuardedCallback(isXlsxAllowed, runExportXlsx);
67
+ const onExportPdf = useGuardedCallback(isPdfAllowed, runExportPdf);
68
+ const onExportCsv = useGuardedCallback(isCsvAllowed, runExportCsv);
69
+ const onExportCsvRaw = useGuardedCallback(isCsvRawAllowed, runExportCsvRaw);
70
+ const onOpenInAnalyticalDesigner = useGuardedCallback(isOpenInAnalyticalDesignerVisible, runOpenInAnalyticalDesigner);
71
+ const items = useMemo(() => {
72
+ const formattedTooltip = isPartialResult
73
+ ? intl.formatMessage(partialResultMessage)
74
+ : exportBubbleTextProvider(intl);
75
+ const result = [];
76
+ if (isOpenInAnalyticalDesignerShown) {
77
+ result.push({
78
+ type: "action",
79
+ id: OPTIONS_ITEM_IDS.openInAnalyticalDesigner,
80
+ label: intl.formatMessage({ id: "options.menu.open.in.analytical.designer" }),
81
+ isDisabled: false,
82
+ onSelect: onOpenInAnalyticalDesigner,
83
+ });
84
+ }
85
+ if (isExportVisible) {
86
+ result.push({
87
+ type: "section",
88
+ id: OPTIONS_ITEM_IDS.exportSection,
89
+ label: intl.formatMessage({ id: "options.menu.export_data" }),
90
+ });
91
+ if (exportToXlsxSupported) {
92
+ result.push({
93
+ type: "action",
94
+ id: OPTIONS_ITEM_IDS.exportXlsx,
95
+ label: intl.formatMessage({ id: "export.type.XLSX" }),
96
+ isDisabled: isExportXLSXDisabled || isPartialResult,
97
+ ...tooltip(formattedTooltip),
98
+ onSelect: onExportXlsx,
99
+ });
100
+ }
101
+ if (exportToPdfSupported && !isAccessibilityMode) {
102
+ result.push({
103
+ type: "action",
104
+ id: OPTIONS_ITEM_IDS.exportPdf,
105
+ label: intl.formatMessage({ id: "export.type.PDF" }),
106
+ isDisabled: isExportPDFDisabled || isPartialResult,
107
+ ...tooltip(formattedTooltip),
108
+ onSelect: onExportPdf,
109
+ });
110
+ }
111
+ if (exportToCsvSupported) {
112
+ result.push({
113
+ type: "action",
114
+ id: OPTIONS_ITEM_IDS.exportCsv,
115
+ label: intl.formatMessage(isRawExportEnabled ? csvMessages.csvFormatted : csvMessages.csv),
116
+ isDisabled: isExportCSVDisabled || isPartialResult,
117
+ ...tooltip(formattedTooltip),
118
+ onSelect: onExportCsv,
119
+ });
120
+ if (isRawExportEnabled) {
121
+ result.push({
122
+ type: "action",
123
+ id: OPTIONS_ITEM_IDS.exportCsvRaw,
124
+ label: intl.formatMessage({ id: "export.type.CSV.raw" }),
125
+ isDisabled: isExportRawCSVDisabled,
126
+ ...tooltip(exportRawBubbleTextProvider(intl)),
127
+ onSelect: onExportCsvRaw,
128
+ });
129
+ }
130
+ }
131
+ }
132
+ if (isTimezoneChangeEnabled) {
133
+ result.push({ type: "separator", id: OPTIONS_ITEM_IDS.timezoneSeparator }, {
134
+ type: "action",
135
+ id: OPTIONS_ITEM_IDS.changeTimezone,
136
+ label: intl.formatMessage({ id: "options.menu.changeTimezone" }),
137
+ isDisabled: false,
138
+ onSelect: onChangeTimezone,
139
+ });
140
+ }
141
+ return normalizeOptionsItems(result);
142
+ }, [
143
+ intl,
144
+ exportBubbleTextProvider,
145
+ exportRawBubbleTextProvider,
146
+ isExportVisible,
147
+ isExportCSVDisabled,
148
+ isExportRawCSVDisabled,
149
+ isExportXLSXDisabled,
150
+ isExportPDFDisabled,
151
+ exportToCsvSupported,
152
+ exportToXlsxSupported,
153
+ exportToPdfSupported,
154
+ isRawExportEnabled,
155
+ isPartialResult,
156
+ isAccessibilityMode,
157
+ isTimezoneChangeEnabled,
158
+ isOpenInAnalyticalDesignerShown,
159
+ onExportXlsx,
160
+ onExportPdf,
161
+ onExportCsv,
162
+ onExportCsvRaw,
163
+ onOpenInAnalyticalDesigner,
164
+ onChangeTimezone,
165
+ ]);
166
+ const label = "⋯";
167
+ const accessibleName = intl.formatMessage({ id: "options.menu.ariaLabel" });
168
+ return useMemo(() => ({ ...context, label, accessibleName, isDisabled: false, items }), [context, accessibleName, items]);
169
+ }
170
+ /**
171
+ * Drops the sections with no action after them and the separators that separate nothing.
172
+ */
173
+ export function normalizeOptionsItems(items) {
174
+ // a section labels the actions up to the next section or separator
175
+ const withoutEmptySections = items.filter((item, index) => item.type !== "section" || items[index + 1]?.type === "action");
176
+ const result = [];
177
+ for (const item of withoutEmptySections) {
178
+ const previous = result[result.length - 1];
179
+ if (item.type === "separator" && (!previous || previous.type === "separator")) {
180
+ continue;
181
+ }
182
+ result.push(item);
183
+ }
184
+ while (result[result.length - 1]?.type === "separator") {
185
+ result.pop();
186
+ }
187
+ return result;
188
+ }
@@ -1,2 +1,7 @@
1
- export declare function SaveAsNewReportButton(): import("react/jsx-runtime").JSX.Element;
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerSaveAsProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useSaveAsProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerSaveAsProps;
3
+ /**
4
+ * Default of the SaveAs slot.
5
+ */
6
+ export declare function DefaultSaveAs({ label, isDisabled, onSaveAs }: IAnalyticalDesignerSaveAsProps): import("react/jsx-runtime").JSX.Element;
2
7
  //# sourceMappingURL=SaveAsNewReportButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveAsNewReportButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/SaveAsNewReportButton.tsx"],"names":[],"mappings":"AAaA,wBAAgB,qBAAqB,4CAmBpC"}
1
+ {"version":3,"file":"SaveAsNewReportButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/SaveAsNewReportButton.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACtC,MAAM,0CAA0C,CAAC;AAclD,wBAAgB,cAAc,CAAC,OAAO,EAAE,gCAAgC,GAAG,8BAA8B,CAWxG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,8BAA8B,2CAS5F"}
@@ -1,19 +1,29 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { useCallback } from "react";
4
- import { defineMessage, useIntl } from "react-intl";
5
- import { useDispatch, useSelector } from "react-redux";
3
+ import { useMemo } from "react";
4
+ import { defineMessages, useIntl } from "react-intl";
5
+ import { useSelector } from "react-redux";
6
6
  import { Button } from "@gooddata/sdk-ui-kit";
7
7
  import { saveReportCheck } from "../../actions/save_actions.js";
8
8
  import { isSaveAsNewDisabledSelector, isSavingAsNewSelector } from "../../selectors/save_report_selector.js";
9
- export function SaveAsNewReportButton() {
9
+ import { useGuardedCallback } from "./editorHeaderContext.js";
10
+ const messages = defineMessages({
11
+ saveAsNew: { id: "save_as_new" },
12
+ saving: { id: "saving" },
13
+ });
14
+ const canSaveAs = (state) => !isSaveAsNewDisabledSelector(state);
15
+ const runSaveAs = (dispatch) => dispatch(saveReportCheck(true));
16
+ export function useSaveAsProps(context) {
10
17
  const intl = useIntl();
11
- const dispatch = useDispatch();
12
18
  const isSaving = useSelector(isSavingAsNewSelector);
13
19
  const isDisabled = useSelector(isSaveAsNewDisabledSelector);
14
- const onClick = useCallback(() => {
15
- dispatch(saveReportCheck(true));
16
- }, [dispatch]);
17
- const value = isSaving ? defineMessage({ id: "saving" }).id : defineMessage({ id: "save_as_new" }).id;
18
- return (_jsx(Button, { className: "s-save-as-new-button save-as-new-button gd-button-secondary editor-header-item", onClick: onClick, value: intl.formatMessage({ id: value }), disabled: isDisabled }));
20
+ const onSaveAs = useGuardedCallback(canSaveAs, runSaveAs);
21
+ const label = intl.formatMessage(isSaving ? messages.saving : messages.saveAsNew);
22
+ return useMemo(() => ({ ...context, label, isDisabled, isSaving, onSaveAs }), [context, label, isDisabled, isSaving, onSaveAs]);
23
+ }
24
+ /**
25
+ * Default of the SaveAs slot.
26
+ */
27
+ export function DefaultSaveAs({ label, isDisabled, onSaveAs }) {
28
+ return (_jsx(Button, { className: "s-save-as-new-button save-as-new-button gd-button-secondary editor-header-item", onClick: onSaveAs, value: label, disabled: isDisabled }));
19
29
  }
@@ -1,2 +1,7 @@
1
- export declare function SaveReportButton(): import("react/jsx-runtime").JSX.Element;
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerSaveProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useSaveProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerSaveProps;
3
+ /**
4
+ * Default of the Save slot.
5
+ */
6
+ export declare function DefaultSave({ label, isDisabled, disabledTooltip, onSave }: IAnalyticalDesignerSaveProps): import("react/jsx-runtime").JSX.Element;
2
7
  //# sourceMappingURL=SaveReportButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveReportButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/SaveReportButton.tsx"],"names":[],"mappings":"AAWA,wBAAgB,gBAAgB,4CA6C/B"}
1
+ {"version":3,"file":"SaveReportButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/SaveReportButton.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACpC,MAAM,0CAA0C,CAAC;AAsBlD,wBAAgB,YAAY,CAAC,OAAO,EAAE,gCAAgC,GAAG,4BAA4B,CAwBpG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,4BAA4B,2CAsBvG"}
@@ -1,29 +1,52 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { defineMessage, useIntl } from "react-intl";
4
- import { useDispatch, useSelector } from "react-redux";
3
+ import { useMemo } from "react";
4
+ import { defineMessages, useIntl } from "react-intl";
5
+ import { useSelector } from "react-redux";
5
6
  import { Bubble, BubbleHoverTrigger, Button } from "@gooddata/sdk-ui-kit";
6
7
  import { saveReportCheck, saveReportFromKD } from "../../actions/save_actions.js";
7
8
  import { saveReportSelector } from "../../selectors/save_report_selector.js";
8
- export function SaveReportButton() {
9
+ import { useGuardedCallback } from "./editorHeaderContext.js";
10
+ const BUBBLE_ALIGN_POINTS = [{ align: "bc tr", offset: { x: 0, y: 10 } }];
11
+ const messages = defineMessages({
12
+ save: { id: "save" },
13
+ saving: { id: "saving" },
14
+ });
15
+ const canSave = (state) => !saveReportSelector(state).isDisabled;
16
+ const runSave = (dispatch, state) => {
17
+ if (saveReportSelector(state).displaySaveInsightFromKDDialog) {
18
+ dispatch(saveReportFromKD());
19
+ }
20
+ else {
21
+ dispatch(saveReportCheck(false));
22
+ }
23
+ };
24
+ export function useSaveProps(context) {
9
25
  const intl = useIntl();
10
- const dispatch = useDispatch();
11
26
  const isSaving = useSelector((state) => saveReportSelector(state).isSaving);
12
27
  const isDisabled = useSelector((state) => saveReportSelector(state).isDisabled);
13
- const displaySaveInsightFromKDDialog = useSelector((state) => saveReportSelector(state).displaySaveInsightFromKDDialog);
14
28
  const showDisabledTooltip = useSelector((state) => saveReportSelector(state).showDisabledTooltip);
15
- const value = isSaving ? defineMessage({ id: "saving" }).id : defineMessage({ id: "save" }).id;
16
- const handleSaveButtonClick = () => {
17
- if (displaySaveInsightFromKDDialog) {
18
- dispatch(saveReportFromKD());
19
- }
20
- else {
21
- dispatch(saveReportCheck(false));
22
- }
23
- };
24
- const SaveButton = (_jsx(Button, { className: "s-save-button save-button gd-button-action editor-header-item", onClick: handleSaveButtonClick, value: intl.formatMessage({ id: value }), disabled: isDisabled }));
25
- if (showDisabledTooltip) {
26
- return (_jsxs(BubbleHoverTrigger, { children: [SaveButton, _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tr", offset: { x: 0, y: 10 } }], children: intl.formatMessage({ id: "save.disabledTooltip.executionTimestamp" }) })] }));
29
+ const onSave = useGuardedCallback(canSave, runSave);
30
+ const label = intl.formatMessage(isSaving ? messages.saving : messages.save);
31
+ const disabledTooltip = showDisabledTooltip
32
+ ? intl.formatMessage({ id: "save.disabledTooltip.executionTimestamp" })
33
+ : undefined;
34
+ return useMemo(() => ({
35
+ ...context,
36
+ label,
37
+ isDisabled,
38
+ isSaving,
39
+ ...(disabledTooltip ? { disabledTooltip } : {}),
40
+ onSave,
41
+ }), [context, label, isDisabled, isSaving, disabledTooltip, onSave]);
42
+ }
43
+ /**
44
+ * Default of the Save slot.
45
+ */
46
+ export function DefaultSave({ label, isDisabled, disabledTooltip, onSave }) {
47
+ const saveButton = (_jsx(Button, { className: "s-save-button save-button gd-button-action editor-header-item", onClick: onSave, value: label, disabled: isDisabled }));
48
+ if (!disabledTooltip) {
49
+ return saveButton;
27
50
  }
28
- return SaveButton;
51
+ return (_jsxs(BubbleHoverTrigger, { children: [saveButton, _jsx(Bubble, { className: "bubble-primary", alignPoints: BUBBLE_ALIGN_POINTS, children: disabledTooltip })] }));
29
52
  }
@@ -6,7 +6,7 @@ export interface ITimezoneDialogProps {
6
6
  * Dialog for the ad-hoc, session-only change of the insight timezone in Analytical Designer.
7
7
  *
8
8
  * @remarks
9
- * Mirrors the KD {@code TimezoneDialog}: hosts the shared timezone picker with "Default" (clears
9
+ * Mirrors the KD `TimezoneDialog`: hosts the shared timezone picker with "Default" (clears
10
10
  * the override so the workspace configuration applies again) and "From browser" special items.
11
11
  * Applying a selection resolves the browser-detected sentinel locally so the session-only Redux
12
12
  * state always stores a concrete IANA timezone ID. The override is never persisted with the insight.
@@ -12,7 +12,7 @@ import { getTimezoneOverride } from "../../selectors/timezone_override_selectors
12
12
  * Dialog for the ad-hoc, session-only change of the insight timezone in Analytical Designer.
13
13
  *
14
14
  * @remarks
15
- * Mirrors the KD {@code TimezoneDialog}: hosts the shared timezone picker with "Default" (clears
15
+ * Mirrors the KD `TimezoneDialog`: hosts the shared timezone picker with "Default" (clears
16
16
  * the override so the workspace configuration applies again) and "From browser" special items.
17
17
  * Applying a selection resolves the browser-detected sentinel locally so the session-only Redux
18
18
  * state always stores a concrete IANA timezone ID. The override is never persisted with the insight.
@@ -0,0 +1,7 @@
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerUndoRedoProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useUndoRedoProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerUndoRedoProps;
3
+ /**
4
+ * Default of the UndoRedo slot: both buttons in one group, with their own tooltips and accessible names.
5
+ */
6
+ export declare function DefaultUndoRedo({ isUndoDisabled, isRedoDisabled, onUndo, onRedo, }: IAnalyticalDesignerUndoRedoProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=UndoRedoButtons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UndoRedoButtons.d.ts","sourceRoot":"","sources":["../../../src/components/header/UndoRedoButtons.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACxC,MAAM,0CAA0C,CAAC;AAgBlD,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,gCAAgC,GAC1C,gCAAgC,CAUlC;AA4BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC5B,cAAc,EACd,cAAc,EACd,MAAM,EACN,MAAM,GACT,EAAE,gCAAgC,2CAmBlC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // (C) 2007-2026 GoodData Corporation
3
+ import { useMemo } from "react";
4
+ import { useIntl } from "react-intl";
5
+ import { useSelector } from "react-redux";
6
+ import { Bubble, BubbleHoverTrigger, Button } from "@gooddata/sdk-ui-kit";
7
+ import { redo, undo } from "../../actions/time_travel_actions.js";
8
+ import { isRedoDisabled as isRedoDisabledSelector, isUndoDisabled as isUndoDisabledSelector, } from "../../selectors/editor_header_selector.js";
9
+ import { useGuardedCallback } from "./editorHeaderContext.js";
10
+ const BUBBLE_ALIGN_POINTS = [{ align: "bc tc", offset: { x: 0, y: 12 } }];
11
+ const canUndo = (state) => !isUndoDisabledSelector(state);
12
+ const canRedo = (state) => !isRedoDisabledSelector(state);
13
+ const runUndo = (dispatch) => dispatch(undo());
14
+ const runRedo = (dispatch) => dispatch(redo());
15
+ export function useUndoRedoProps(context) {
16
+ const isUndoDisabled = useSelector(isUndoDisabledSelector);
17
+ const isRedoDisabled = useSelector(isRedoDisabledSelector);
18
+ const onUndo = useGuardedCallback(canUndo, runUndo);
19
+ const onRedo = useGuardedCallback(canRedo, runRedo);
20
+ return useMemo(() => ({ ...context, isUndoDisabled, isRedoDisabled, onUndo, onRedo }), [context, isUndoDisabled, isRedoDisabled, onUndo, onRedo]);
21
+ }
22
+ function HistoryButton({ className, label, isDisabled, onClick }) {
23
+ return (_jsx("span", { children: _jsxs(BubbleHoverTrigger, { children: [_jsx(Button, { className: `gd-button-secondary gd-button-icon-only ${className}`, value: "", disabled: isDisabled, onClick: onClick, accessibilityConfig: { ariaLabel: label } }), _jsx(Bubble, { className: "bubble-primary", alignPoints: BUBBLE_ALIGN_POINTS, children: label })] }) }));
24
+ }
25
+ /**
26
+ * Default of the UndoRedo slot: both buttons in one group, with their own tooltips and accessible names.
27
+ */
28
+ export function DefaultUndoRedo({ isUndoDisabled, isRedoDisabled, onUndo, onRedo, }) {
29
+ const intl = useIntl();
30
+ return (_jsxs("div", { className: "gd-button-group editor-header-item", children: [_jsx(HistoryButton, { className: "gd-icon-undo undo s-undo", label: intl.formatMessage({ id: "undo" }), isDisabled: isUndoDisabled, onClick: onUndo }), _jsx(HistoryButton, { className: "gd-icon-redo redo s-redo", label: intl.formatMessage({ id: "redo" }), isDisabled: isRedoDisabled, onClick: onRedo })] }));
31
+ }
@@ -0,0 +1,11 @@
1
+ import { type ReactElement } from "react";
2
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerVisualizationInfoProps } from "../../embedding/editorHeaderSlotTypes.js";
3
+ /**
4
+ * The VisualizationInfo region with its title, description and access slots resolved.
5
+ */
6
+ export declare function useVisualizationInfo(context: IAnalyticalDesignerHeaderContext): ReactElement;
7
+ /**
8
+ * Default of the VisualizationInfo slot: the indicators, then the title with its description, access and usages.
9
+ */
10
+ export declare function DefaultVisualizationInfo({ hasUnsavedChanges, indicators, visualizationTitle, visualizationDescription, visualizationAccess, usages, }: IAnalyticalDesignerVisualizationInfoProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=VisualizationInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizationInfo.d.ts","sourceRoot":"","sources":["../../../src/components/header/VisualizationInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EACjD,MAAM,0CAA0C,CAAC;AAiDlD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gCAAgC,GAAG,YAAY,CAkC5F;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,GACT,EAAE,yCAAyC,2CAY3C"}
@@ -0,0 +1,47 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useIntl } from "react-intl";
3
+ import { useSelector } from "react-redux";
4
+ import { Bubble, BubbleHoverTrigger } from "@gooddata/sdk-ui-kit";
5
+ import { renderSlot, useAdSlots } from "../../embedding/slots.js";
6
+ import { isNavigationDisabled as isNavigationDisabledSelector } from "../../selectors/editor_header_selector.js";
7
+ import { isEnabledInsightUsageOnDashboards } from "../../selectors/report_selector.js";
8
+ import { InsightUsageOnDashboards } from "../InsightUsageOnDashboards.js";
9
+ import { DefaultVisualizationDescription, useVisualizationDescriptionProps } from "../ReportDescription.js";
10
+ import { useRequestCancellation } from "./CancelButton.js";
11
+ import { DefaultVisualizationAccess, InsightAccessDialogProvider, useVisualizationAccess, } from "./share/InsightAccess.js";
12
+ import { DefaultVisualizationTitle, useVisualizationTitleProps } from "./VisualizationTitle.js";
13
+ const LOCK_ALIGN_POINTS = [{ align: "bc tl" }];
14
+ const UNSAVED_ALIGN_POINTS = [{ align: "bc tl", offset: { x: 0, y: 0 } }];
15
+ function VisualizationIndicators({ isLocked, hasUnsavedChanges }) {
16
+ const intl = useIntl();
17
+ return (_jsxs(_Fragment, { children: [isLocked ? (_jsxs(BubbleHoverTrigger, { className: "gd-icon-lock-wrapper", showDelay: 0, hideDelay: 0, children: [_jsx("i", { className: "gd-icon-lock" }), _jsx(Bubble, { className: "bubble-primary", alignPoints: LOCK_ALIGN_POINTS, children: intl.formatMessage({ id: "inherited_report" }) })] })) : null, hasUnsavedChanges ? (_jsxs(BubbleHoverTrigger, { children: [_jsx("i", { className: "gd-icon-circle unsaved-notification" }), _jsx(Bubble, { className: "bubble-primary", alignPoints: UNSAVED_ALIGN_POINTS, children: intl.formatMessage({ id: "unsaved_changes" }) })] })) : null] }));
18
+ }
19
+ /**
20
+ * The VisualizationInfo region with its title, description and access slots resolved.
21
+ */
22
+ export function useVisualizationInfo(context) {
23
+ const slots = useAdSlots();
24
+ const titleProps = useVisualizationTitleProps(context);
25
+ const descriptionProps = useVisualizationDescriptionProps(context);
26
+ const { props: accessProps, dialogContext } = useVisualizationAccess(context);
27
+ const isEnabledUsages = useSelector(isEnabledInsightUsageOnDashboards);
28
+ const isNavigationDisabled = useSelector(isNavigationDisabledSelector);
29
+ const onRequestBack = useRequestCancellation();
30
+ const props = {
31
+ ...context,
32
+ visualizationTitle: renderSlot(slots.VisualizationTitle, DefaultVisualizationTitle, titleProps),
33
+ visualizationDescription: renderSlot(slots.VisualizationDescription, DefaultVisualizationDescription, descriptionProps),
34
+ visualizationAccess: (_jsx(InsightAccessDialogProvider, { value: dialogContext, children: renderSlot(slots.VisualizationAccess, DefaultVisualizationAccess, accessProps) })),
35
+ indicators: (_jsx(VisualizationIndicators, { isLocked: titleProps.isLocked, hasUnsavedChanges: context.hasUnsavedChanges })),
36
+ usages: isEnabledUsages ? _jsx(InsightUsageOnDashboards, {}) : null,
37
+ isNavigationDisabled,
38
+ onRequestBack,
39
+ };
40
+ return renderSlot(slots.VisualizationInfo, DefaultVisualizationInfo, props);
41
+ }
42
+ /**
43
+ * Default of the VisualizationInfo slot: the indicators, then the title with its description, access and usages.
44
+ */
45
+ export function DefaultVisualizationInfo({ hasUnsavedChanges, indicators, visualizationTitle, visualizationDescription, visualizationAccess, usages, }) {
46
+ return (_jsxs("div", { className: "report-title-wrapper", children: [indicators, _jsxs("div", { className: hasUnsavedChanges ? "move-right-animation" : "", children: [visualizationTitle, visualizationDescription, visualizationAccess, usages] })] }));
47
+ }
@@ -0,0 +1,7 @@
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerVisualizationTitleProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useVisualizationTitleProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerVisualizationTitleProps;
3
+ /**
4
+ * Default of the VisualizationTitle slot: an editable label, or plain text when the title cannot change.
5
+ */
6
+ export declare function DefaultVisualizationTitle({ title, placeholder, maxLength, isEditable, onTitleChange, }: IAnalyticalDesignerVisualizationTitleProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=VisualizationTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizationTitle.d.ts","sourceRoot":"","sources":["../../../src/components/header/VisualizationTitle.tsx"],"names":[],"mappings":"AAYA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,0CAA0C,EAClD,MAAM,0CAA0C,CAAC;AAUlD,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,gCAAgC,GAC1C,0CAA0C,CAiB5C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACtC,KAAK,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,0CAA0C,2CAiB5C"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2007-2026 GoodData Corporation
3
+ import { useMemo } from "react";
4
+ import classNames from "classnames";
5
+ import { useIntl } from "react-intl";
6
+ import { useSelector } from "react-redux";
7
+ import { EditableLabel } from "@gooddata/sdk-ui-kit";
8
+ import { reportTitleChange } from "../../actions/report_actions.js";
9
+ import { MAX_TITLE_LENGTH } from "../../constants/report.js";
10
+ import { reportTitleSelector } from "../../selectors/report_title_selector.js";
11
+ import { useGuardedCallback } from "./editorHeaderContext.js";
12
+ const canEditTitle = (state) => reportTitleSelector(state).canEditTitle;
13
+ const runTitleChange = (dispatch, _state, title) => dispatch(reportTitleChange(title));
14
+ export function useVisualizationTitleProps(context) {
15
+ const intl = useIntl();
16
+ const { isReportLocked, canEditTitle: isEditable } = useSelector(reportTitleSelector);
17
+ const onTitleChange = useGuardedCallback(canEditTitle, runTitleChange);
18
+ const placeholder = intl.formatMessage({ id: "dialogs.savingUntitledReportConfirmation.placeholder" });
19
+ return useMemo(() => ({
20
+ ...context,
21
+ placeholder,
22
+ maxLength: MAX_TITLE_LENGTH,
23
+ isEditable,
24
+ isLocked: isReportLocked,
25
+ onTitleChange,
26
+ }), [context, placeholder, isEditable, isReportLocked, onTitleChange]);
27
+ }
28
+ /**
29
+ * Default of the VisualizationTitle slot: an editable label, or plain text when the title cannot change.
30
+ */
31
+ export function DefaultVisualizationTitle({ title, placeholder, maxLength, isEditable, onTitleChange, }) {
32
+ if (!isEditable) {
33
+ return _jsx("span", { className: "report-title report-title-locked s-report-title", children: title });
34
+ }
35
+ return (_jsx(EditableLabel, { textareaInOverlay: false, value: title, maxLength: maxLength, maxRows: 1, onSubmit: onTitleChange, className: classNames("report-title", "s-report-title", { "has-defined-title": title !== "" }), placeholder: placeholder, isEditableLabelWidthDynamic: true }));
36
+ }
@@ -1,2 +1,6 @@
1
- export declare function VisualizationsDropdown(): import("react/jsx-runtime").JSX.Element;
1
+ import { type IAnalyticalDesignerOpenProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ /**
3
+ * The Open control as a dropdown list of visualizations.
4
+ */
5
+ export declare function VisualizationsDropdown({ workspace: workspaceId, label: buttonText, isDisabled, selectedInsightId: openInsightId, includeTags: tags, excludeTags, enabledVisualizationUrls: enabledVisualizationClassesUrls, isSemanticSearchEnabled: isSmartSearchResultsEnabled, onOpenInsight, }: IAnalyticalDesignerOpenProps): import("react/jsx-runtime").JSX.Element;
2
6
  //# sourceMappingURL=VisualizationsDropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VisualizationsDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/header/VisualizationsDropdown.tsx"],"names":[],"mappings":"AAwGA,wBAAgB,sBAAsB,4CA6SrC"}
1
+ {"version":3,"file":"VisualizationsDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/header/VisualizationsDropdown.tsx"],"names":[],"mappings":"AA0CA,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAmD7F;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACnC,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,UAAU,EACjB,UAAU,EACV,iBAAiB,EAAE,aAAa,EAChC,WAAW,EAAE,IAAI,EACjB,WAAW,EACX,wBAAwB,EAAE,+BAA+B,EACzD,uBAAuB,EAAE,2BAA2B,EACpD,aAAa,GAChB,EAAE,4BAA4B,2CAgR9B"}
@@ -5,21 +5,16 @@ import { isEmpty } from "lodash-es";
5
5
  import { defineMessage, useIntl } from "react-intl";
6
6
  import { useDispatch, useSelector } from "react-redux";
7
7
  import { createSelector, createStructuredSelector } from "reselect";
8
- import { insightCreated, insightId, insightIsLocked, insightSummary, insightTitle, insightUpdated, insightUri, insightVisualizationUrl, objRefToString, uriRef, } from "@gooddata/sdk-model";
8
+ import { insightCreated, insightId, insightIsLocked, insightSummary, insightTitle, insightUpdated, insightUri, insightVisualizationUrl, uriRef, } from "@gooddata/sdk-model";
9
9
  import { useBackend } from "@gooddata/sdk-ui";
10
10
  import { useInsightPagedList } from "@gooddata/sdk-ui-ext";
11
11
  import { Dropdown, DropdownButton, DropdownList, InsightListItem, NoData, UiIcon, UiSkeleton, } from "@gooddata/sdk-ui-kit";
12
12
  import { customMatcher, useHybridSearch, } from "@gooddata/sdk-ui-semantic-search";
13
13
  import { deleteReport } from "../../actions/delete_actions.js";
14
- import { openReport } from "../../actions/open_actions.js";
15
14
  import { descriptionTooltipOpened } from "../../sagas/description_tooltip/description_tooltip_ui_actions.js";
16
15
  import { isOwnershipSupported, supportsObjectUris } from "../../selectors/backend_capabilities_selector.js";
17
- import { getProjectId, getUserLoginMD5, getUserUri } from "../../selectors/bootstrap_selector.js";
18
- import { enableCatalogSmartSearchResults, enableVisualizationFilteringByTags, getMetadataTimeZone, } from "../../selectors/feature_flag_selector.js";
19
- import { canOpenReport } from "../../selectors/open_report_selector.js";
20
- import { openReportIdSelector } from "../../selectors/report_selector.js";
21
- import { getTagsConfiguration } from "../../selectors/route_selector.js";
22
- import { getEnabledVisualizationClassesUrls } from "../../services/visualization_class_service.js";
16
+ import { getUserLoginMD5, getUserUri } from "../../selectors/bootstrap_selector.js";
17
+ import { getMetadataTimeZone } from "../../selectors/feature_flag_selector.js";
23
18
  import { getIsReadOnlyMode } from "../../store/embedding/embedding_selectors.js";
24
19
  const INSIGHT_DROPDOWN_MY_TAB_ID = defineMessage({ id: "gs.visualizationsList.tabs.my" }).id;
25
20
  const INSIGHT_DROPDOWN_ALL_TAB_ID = defineMessage({ id: "gs.visualizationsList.tabs.all" }).id;
@@ -40,49 +35,28 @@ const insightItemBuilder = (item, { ref }) => ({
40
35
  created: item.createdAt,
41
36
  updated: item.modifiedAt,
42
37
  });
43
- const isDisabledSelector = createSelector([canOpenReport], (canOpenReport) => !canOpenReport);
44
38
  const authorSelector = createSelector(supportsObjectUris, getUserUri, getUserLoginMD5, (isObjectUriSupported, userUri, userLoginMd5) => {
45
39
  return isObjectUriSupported ? userUri : userLoginMd5;
46
40
  });
47
41
  const tabsIds = { my: INSIGHT_DROPDOWN_MY_TAB_ID, all: INSIGHT_DROPDOWN_ALL_TAB_ID };
48
42
  const divider = { divider: true };
49
- export function VisualizationsDropdown() {
43
+ /**
44
+ * The Open control as a dropdown list of visualizations.
45
+ */
46
+ export function VisualizationsDropdown({ workspace: workspaceId, label: buttonText, isDisabled, selectedInsightId: openInsightId, includeTags: tags, excludeTags, enabledVisualizationUrls: enabledVisualizationClassesUrls, isSemanticSearchEnabled: isSmartSearchResultsEnabled, onOpenInsight, }) {
50
47
  const intl = useIntl();
51
48
  const dispatch = useDispatch();
52
- const workspaceId = useSelector(getProjectId);
53
49
  const author = useSelector(authorSelector);
54
- const isDisabled = useSelector(isDisabledSelector);
55
- const openInsightId = useSelector(openReportIdSelector);
56
- const enabledVisualizationClassesUrls = useSelector(getEnabledVisualizationClassesUrls);
57
50
  const hasOwnershipSupport = useSelector(isOwnershipSupported);
58
- const isSmartSearchResultsEnabled = useSelector(enableCatalogSmartSearchResults);
59
51
  const metadataTimeZone = useSelector(getMetadataTimeZone);
60
- const isFilteringByTagsEnabled = useSelector(enableVisualizationFilteringByTags);
61
- const tagsConfiguration = useSelector(getTagsConfiguration);
62
52
  const isReadOnly = useSelector(getIsReadOnlyMode);
63
- const onOpenInsight = useCallback((insightRef) => {
64
- dispatch(openReport(insightRef, false));
65
- }, [dispatch]);
66
53
  const onDeleteInsight = useCallback((insightRef, title) => {
67
54
  dispatch(deleteReport(insightRef, false, { title }));
68
55
  }, [dispatch]);
69
56
  const onDescriptionTooltipOpened = useCallback((description) => {
70
57
  dispatch(descriptionTooltipOpened(description));
71
58
  }, [dispatch]);
72
- const buttonText = intl.formatMessage({ id: "openReportPlaceholder" });
73
59
  const backend = useBackend();
74
- // Extract tag identifiers from tags configuration only when the feature flag is enabled
75
- // Tags come as ObjRef (idRef) from route selector, extract identifier directly as the method expects
76
- // just strings
77
- const [tags, excludeTags] = useMemo(() => {
78
- const tags = isFilteringByTagsEnabled
79
- ? tagsConfiguration?.includeObjectsWithTags?.map((tag) => objRefToString(tag))
80
- : undefined;
81
- const excludeTags = isFilteringByTagsEnabled
82
- ? tagsConfiguration?.excludeObjectsWithTags?.map((tag) => objRefToString(tag))
83
- : undefined;
84
- return [tags, excludeTags];
85
- }, [isFilteringByTagsEnabled, tagsConfiguration]);
86
60
  const { items, totalItemsCount: totalInsightsCount, isLoading, isNextPageLoading, initialLoadCompleted, search, selectedTabId, hasNextPage, skeletonItemsCount, fetchItems, loadNextPage, onSearch, onTabSelect, reset, } = useInsightPagedList({
87
61
  backend,
88
62
  workspaceId,
@@ -0,0 +1,20 @@
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerHeaderLayout } from "../../embedding/editorHeaderSlotTypes.js";
2
+ import { type AppDispatch, type IAppState } from "../../store/types.js";
3
+ /**
4
+ * Layout of the editor header: the collapsible catalog takes precedence, then the right panel flag removes the
5
+ * catalog-width offset of the legacy header.
6
+ */
7
+ export declare function useEditorHeaderLayout(): IAnalyticalDesignerHeaderLayout;
8
+ /**
9
+ * The data every editor header slot receives.
10
+ */
11
+ export declare function useEditorHeaderContext(): IAnalyticalDesignerHeaderContext;
12
+ /**
13
+ * A callback for a slot that checks the current state when called, so that a control shown as enabled, or a
14
+ * host calling it at any time, cannot run an operation AD would refuse.
15
+ *
16
+ * @param isAllowed - whether the operation may run in the current state; keep it stable
17
+ * @param run - the operation; keep it stable
18
+ */
19
+ export declare function useGuardedCallback<TArgs extends unknown[]>(isAllowed: (state: IAppState) => boolean, run: (dispatch: AppDispatch, state: IAppState, ...args: TArgs) => void): (...args: TArgs) => void;
20
+ //# sourceMappingURL=editorHeaderContext.d.ts.map