@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
@@ -1,44 +1,31 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { useIntl } from "react-intl";
5
5
  import { useDispatch, useSelector } from "react-redux";
6
6
  import { createSelector } from "reselect";
7
- import { idRef, objRefToString, uriRef } from "@gooddata/sdk-model";
7
+ import { idRef, uriRef } from "@gooddata/sdk-model";
8
8
  import { InsightPicker, useInsightPickerState, } from "@gooddata/sdk-ui-ext";
9
9
  import { Button, Dialog } from "@gooddata/sdk-ui-kit";
10
10
  import { deleteReport } from "../../actions/delete_actions.js";
11
- import { openReport } from "../../actions/open_actions.js";
12
11
  import { saveReportCheck } from "../../actions/save_actions.js";
13
12
  import { descriptionTooltipOpened } from "../../sagas/description_tooltip/description_tooltip_ui_actions.js";
14
13
  import { isOwnershipSupported, supportsObjectUris } from "../../selectors/backend_capabilities_selector.js";
15
- import { getProjectId, getUserLoginMD5, getUserUri } from "../../selectors/bootstrap_selector.js";
16
- import { enableCatalogSmartSearchResults, enableVisualizationFilteringByTags, getMetadataTimeZone, } from "../../selectors/feature_flag_selector.js";
17
- import { canOpenReport } from "../../selectors/open_report_selector.js";
18
- import { openReportIdSelector } from "../../selectors/report_selector.js";
19
- import { getTagsConfiguration } from "../../selectors/route_selector.js";
20
- import { getEnabledVisualizationClassesUrls } from "../../services/visualization_class_service.js";
14
+ import { getUserLoginMD5, getUserUri } from "../../selectors/bootstrap_selector.js";
15
+ import { getMetadataTimeZone } from "../../selectors/feature_flag_selector.js";
21
16
  import { getIsReadOnlyMode } from "../../store/embedding/embedding_selectors.js";
22
- const isDisabledSelector = createSelector([canOpenReport], (canOpenReport) => !canOpenReport);
23
17
  const authorSelector = createSelector(supportsObjectUris, getUserUri, getUserLoginMD5, (isObjectUriSupported, userUri, userLoginMd5) => {
24
18
  return isObjectUriSupported ? userUri : userLoginMd5;
25
19
  });
26
- export function InsightPickerDialog() {
27
- const workspaceId = useSelector(getProjectId);
20
+ /**
21
+ * The Open control as a button with the visualization picker in a dialog.
22
+ */
23
+ export function InsightPickerDialog({ workspace, label, isDisabled, selectedInsightId: openInsightId, includeTags, excludeTags, enabledVisualizationUrls, isSemanticSearchEnabled, onOpenInsight, }) {
28
24
  const author = useSelector(authorSelector);
29
- const isDisabled = useSelector(isDisabledSelector);
30
- const openInsightId = useSelector(openReportIdSelector);
31
- const enabledVisualizationClassesUrls = useSelector(getEnabledVisualizationClassesUrls);
32
25
  const hasOwnershipSupport = useSelector(isOwnershipSupported);
33
26
  const metadataTimeZone = useSelector(getMetadataTimeZone);
34
- const isFilteringByTagsEnabled = useSelector(enableVisualizationFilteringByTags);
35
27
  const isReadOnly = useSelector(getIsReadOnlyMode);
36
- const isSmartSearchResultsEnabled = useSelector(enableCatalogSmartSearchResults);
37
- const tagsConfiguration = useSelector(getTagsConfiguration);
38
28
  const dispatch = useDispatch();
39
- const onOpenInsight = useCallback((insightRef) => {
40
- dispatch(openReport(insightRef, false));
41
- }, [dispatch]);
42
29
  const onDeleteInsight = useCallback((insightRef, insightTitle) => {
43
30
  dispatch(deleteReport(insightRef, false, { title: insightTitle }));
44
31
  }, [dispatch]);
@@ -49,7 +36,6 @@ export function InsightPickerDialog() {
49
36
  dispatch(descriptionTooltipOpened(description));
50
37
  }, [dispatch]);
51
38
  const intl = useIntl();
52
- const buttonText = intl.formatMessage({ id: "openReportPlaceholder" });
53
39
  const [isDialogOpen, setIsDialogOpen] = useState(false);
54
40
  const pickerState = useInsightPickerState(hasOwnershipSupport ? author : undefined);
55
41
  const pendingSaveAsNew = useRef(null);
@@ -62,12 +48,6 @@ export function InsightPickerDialog() {
62
48
  onSaveAsNew(true);
63
49
  }
64
50
  }, [openInsightId, onSaveAsNew]);
65
- const includeTags = useMemo(() => isFilteringByTagsEnabled
66
- ? tagsConfiguration?.includeObjectsWithTags?.map((tag) => objRefToString(tag))
67
- : undefined, [isFilteringByTagsEnabled, tagsConfiguration?.includeObjectsWithTags]);
68
- const excludeTags = useMemo(() => isFilteringByTagsEnabled
69
- ? tagsConfiguration?.excludeObjectsWithTags?.map((tag) => objRefToString(tag))
70
- : undefined, [isFilteringByTagsEnabled, tagsConfiguration?.excludeObjectsWithTags]);
71
51
  const handleSelect = useCallback((insightRef) => {
72
52
  setIsDialogOpen(false);
73
53
  onOpenInsight(insightRef);
@@ -103,5 +83,5 @@ export function InsightPickerDialog() {
103
83
  },
104
84
  },
105
85
  ];
106
- return (_jsxs("div", { className: "s-report_select report-select editor-header-item", children: [_jsx(Button, { className: "gd-button-secondary type-metric customizable", value: buttonText, disabled: isDisabled, onClick: () => setIsDialogOpen(true) }), isDialogOpen ? (_jsx(Dialog, { className: "open-visualizations-dialog", containerClassName: "open-visualizations-dialog-container", isModal: false, shouldCloseOnClick: () => true, onClose: () => setIsDialogOpen(false), children: _jsx("div", { className: "open-visualizations s-open-visualizations", children: _jsx(InsightPicker, { workspace: workspaceId, author: hasOwnershipSupport ? author : undefined, includeTags: includeTags, excludeTags: excludeTags, enabledVisualizationClassesUrls: enabledVisualizationClassesUrls, selectedInsightId: openInsightId, metadataTimeZone: metadataTimeZone, enableSemanticSearch: isSmartSearchResultsEnabled, width: 740, ...pickerState, onSelect: handleSelect, onDescriptionPanelOpen: onDescriptionTooltipOpened, menuActions: menuActions }) }) })) : null] }));
86
+ return (_jsxs("div", { className: "s-report_select report-select editor-header-item", children: [_jsx(Button, { className: "gd-button-secondary type-metric customizable", value: label, disabled: isDisabled, onClick: () => setIsDialogOpen(true) }), isDialogOpen ? (_jsx(Dialog, { className: "open-visualizations-dialog", containerClassName: "open-visualizations-dialog-container", isModal: false, shouldCloseOnClick: () => true, onClose: () => setIsDialogOpen(false), children: _jsx("div", { className: "open-visualizations s-open-visualizations", children: _jsx(InsightPicker, { workspace: workspace, author: hasOwnershipSupport ? author : undefined, includeTags: includeTags, excludeTags: excludeTags, enabledVisualizationClassesUrls: enabledVisualizationUrls, selectedInsightId: openInsightId, metadataTimeZone: metadataTimeZone, enableSemanticSearch: isSemanticSearchEnabled, width: 740, ...pickerState, onSelect: handleSelect, onDescriptionPanelOpen: onDescriptionTooltipOpened, menuActions: menuActions }) }) })) : null] }));
107
87
  }
@@ -0,0 +1,7 @@
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerOpenProps } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useOpenProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerOpenProps;
3
+ /**
4
+ * Default of the Open slot: the picker variant the props ask for.
5
+ */
6
+ export declare function DefaultOpen(props: IAnalyticalDesignerOpenProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=OpenControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenControl.d.ts","sourceRoot":"","sources":["../../../src/components/header/OpenControl.tsx"],"names":[],"mappings":"AAWA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACpC,MAAM,0CAA0C,CAAC;AAgClD,wBAAgB,YAAY,CAAC,OAAO,EAAE,gCAAgC,GAAG,4BAA4B,CAwCpG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,4BAA4B,2CAM9D"}
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2026 GoodData Corporation
3
+ import { useMemo } from "react";
4
+ import { useIntl } from "react-intl";
5
+ import { useSelector } from "react-redux";
6
+ import { createSelector } from "reselect";
7
+ import { objRefToString } from "@gooddata/sdk-model";
8
+ import { openReport } from "../../actions/open_actions.js";
9
+ import { enableCatalogSmartSearchResults, enableEnhancedInsightPicker, enableVisualizationFilteringByTags, } from "../../selectors/feature_flag_selector.js";
10
+ import { canOpenReport, isReportOpeningSelector } from "../../selectors/open_report_selector.js";
11
+ import { openReportIdSelector } from "../../selectors/report_selector.js";
12
+ import { getTagsConfiguration } from "../../selectors/route_selector.js";
13
+ import { getEnabledVisualizationClassesUrls } from "../../services/visualization_class_service.js";
14
+ import { useGuardedCallback } from "./editorHeaderContext.js";
15
+ import { InsightPickerDialog } from "./InsightPickerDialog.js";
16
+ import { VisualizationsDropdown } from "./VisualizationsDropdown.js";
17
+ // Tags come as ObjRef (idRef) from the route; the pickers expect their identifiers, and only with the flag on.
18
+ const pickerTagsSelector = createSelector(enableVisualizationFilteringByTags, getTagsConfiguration, (isFilteringByTagsEnabled, tagsConfiguration) => ({
19
+ includeTags: isFilteringByTagsEnabled
20
+ ? tagsConfiguration?.includeObjectsWithTags?.map((tag) => objRefToString(tag))
21
+ : undefined,
22
+ excludeTags: isFilteringByTagsEnabled
23
+ ? tagsConfiguration?.excludeObjectsWithTags?.map((tag) => objRefToString(tag))
24
+ : undefined,
25
+ }));
26
+ const runOpen = (dispatch, _state, ref) => dispatch(openReport(ref, false));
27
+ export function useOpenProps(context) {
28
+ const intl = useIntl();
29
+ const isDisabled = !useSelector(canOpenReport);
30
+ const isLoading = useSelector(isReportOpeningSelector);
31
+ const selectedInsightId = useSelector(openReportIdSelector);
32
+ const isEnhancedInsightPickerEnabled = useSelector(enableEnhancedInsightPicker);
33
+ const { includeTags, excludeTags } = useSelector(pickerTagsSelector);
34
+ const enabledVisualizationUrls = useSelector(getEnabledVisualizationClassesUrls);
35
+ const isSemanticSearchEnabled = useSelector(enableCatalogSmartSearchResults);
36
+ const onOpenInsight = useGuardedCallback(canOpenReport, runOpen);
37
+ const label = intl.formatMessage({ id: "openReportPlaceholder" });
38
+ return useMemo(() => ({
39
+ ...context,
40
+ label,
41
+ isDisabled,
42
+ isLoading,
43
+ ...(selectedInsightId ? { selectedInsightId } : {}),
44
+ pickerVariant: isEnhancedInsightPickerEnabled ? "dialog" : "dropdown",
45
+ ...(includeTags ? { includeTags } : {}),
46
+ ...(excludeTags ? { excludeTags } : {}),
47
+ enabledVisualizationUrls,
48
+ isSemanticSearchEnabled,
49
+ onOpenInsight,
50
+ }), [
51
+ context,
52
+ label,
53
+ isDisabled,
54
+ isLoading,
55
+ selectedInsightId,
56
+ isEnhancedInsightPickerEnabled,
57
+ includeTags,
58
+ excludeTags,
59
+ enabledVisualizationUrls,
60
+ isSemanticSearchEnabled,
61
+ onOpenInsight,
62
+ ]);
63
+ }
64
+ /**
65
+ * Default of the Open slot: the picker variant the props ask for.
66
+ */
67
+ export function DefaultOpen(props) {
68
+ return props.pickerVariant === "dialog" ? (_jsx(InsightPickerDialog, { ...props })) : (_jsx(VisualizationsDropdown, { ...props }));
69
+ }
@@ -1,2 +1,6 @@
1
- export declare const OptionsButton: import("react").MemoExoticComponent<(_props: Record<string, unknown>) => import("react/jsx-runtime").JSX.Element>;
1
+ import { type IAnalyticalDesignerOptionsProps } from "../../../embedding/editorHeaderSlotTypes.js";
2
+ /**
3
+ * Default of the Options slot: a button that opens the menu of the given items.
4
+ */
5
+ export declare function DefaultOptions({ label, accessibleName, isDisabled, items, }: IAnalyticalDesignerOptionsProps): import("react/jsx-runtime").JSX.Element;
2
6
  //# sourceMappingURL=OptionsButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsButton.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,+CAAuC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,6CAiBtF,CAAC"}
1
+ {"version":3,"file":"OptionsButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsButton.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAInG;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,cAAc,EACd,UAAU,EACV,KAAK,GACR,EAAE,+BAA+B,2CA2BjC"}
@@ -1,12 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { Fragment, memo, useState } from "react";
3
+ import { useCallback, useState } from "react";
4
4
  import { Button } from "@gooddata/sdk-ui-kit";
5
5
  import { OptionsMenu } from "./OptionsMenu.js";
6
- export const OptionsButton = memo(function OptionsButton(_props) {
7
- const [isShowOptionsMenu, setIsShowOptionsMenu] = useState(false);
8
- const toggleOptionsMenu = () => {
9
- setIsShowOptionsMenu(!isShowOptionsMenu);
10
- };
11
- return (_jsxs(Fragment, { children: [_jsx(Button, { className: "gd-button-secondary s-options-button editor-header-item", value: "\u22EF", onClick: toggleOptionsMenu }), _jsx(OptionsMenu, { isShowOptionsMenu: isShowOptionsMenu, toggleOptionsMenu: toggleOptionsMenu })] }));
12
- });
6
+ /**
7
+ * Default of the Options slot: a button that opens the menu of the given items.
8
+ */
9
+ export function DefaultOptions({ label, accessibleName, isDisabled, items, }) {
10
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
11
+ const toggleMenu = useCallback(() => {
12
+ setIsMenuOpen((open) => !open);
13
+ }, []);
14
+ const closeMenu = useCallback(() => {
15
+ setIsMenuOpen(false);
16
+ }, []);
17
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { className: "gd-button-secondary s-options-button editor-header-item", value: label, disabled: isDisabled, onClick: toggleMenu, accessibilityConfig: {
18
+ ariaLabel: accessibleName,
19
+ ariaHaspopup: "menu",
20
+ ariaExpanded: isMenuOpen,
21
+ } }), isMenuOpen ? _jsx(OptionsMenu, { items: items, onClose: closeMenu }) : null] }));
22
+ }
@@ -1,63 +1,11 @@
1
- import { type IntlShape } from "react-intl";
2
- import { type ExportCsvMode } from "../../../actions/export_report_actions.js";
3
- import { openInAnalyticalDesignerAction } from "../../../store/router/router_actions.js";
4
- interface IOptionsMenuDispatchProps {
5
- onOpenAsReport: (title: string) => void;
6
- showDialogExportCsv: (mode: ExportCsvMode) => void;
7
- showDialogExportReport: () => void;
8
- showDialogExportPdf: () => void;
9
- openInAnalyticalDesigner: () => ReturnType<typeof openInAnalyticalDesignerAction>;
1
+ import { type AnalyticalDesignerOptionsItem } from "../../../embedding/editorHeaderSlotTypes.js";
2
+ interface IOptionsMenuProps {
3
+ items: readonly AnalyticalDesignerOptionsItem[];
4
+ onClose: () => void;
10
5
  }
11
- type BubbleTextProvider = (intl: IntlShape) => string;
12
- interface IOptionsMenuStateProps {
13
- bubbleTextProvider?: BubbleTextProvider;
14
- exportBubbleTextProvider?: BubbleTextProvider;
15
- exportRawBubbleTextProvider?: BubbleTextProvider;
16
- isOpenAsReportDisabled: boolean;
17
- isExportVisible: boolean;
18
- isExportCSVDisabled: boolean;
19
- isExportRawCSVDisabled: boolean;
20
- isExportXLSXDisabled: boolean;
21
- isExportPDFDisabled: boolean;
22
- exportToCsvSupported: boolean;
23
- exportToXlsxSupported: boolean;
24
- exportToPdfSupported: boolean;
25
- isEditFromKD: boolean;
26
- hiddenActions: string[];
27
- enableRawExports: boolean;
28
- hasPartialDataLimitBreaks: boolean;
29
- isAccessibilityModeEnabled: boolean;
30
- isEnableTimezoneChange: boolean;
31
- }
32
- interface IOptionsMenuOwnProps {
33
- isShowOptionsMenu: boolean;
34
- toggleOptionsMenu: () => void;
35
- }
36
- type IOptionsMenuProps = IOptionsMenuDispatchProps & IOptionsMenuStateProps & IOptionsMenuOwnProps;
37
- export declare const OptionsMenuBase: import("react").MemoExoticComponent<({ exportBubbleTextProvider, exportRawBubbleTextProvider, isExportVisible, isExportCSVDisabled, isExportRawCSVDisabled, isExportXLSXDisabled, isExportPDFDisabled, exportToCsvSupported, exportToXlsxSupported, exportToPdfSupported, isEditFromKD, hiddenActions, enableRawExports, hasPartialDataLimitBreaks, isAccessibilityModeEnabled, isEnableTimezoneChange, isShowOptionsMenu, toggleOptionsMenu, showDialogExportCsv, showDialogExportReport, showDialogExportPdf, openInAnalyticalDesigner, }: IOptionsMenuProps) => import("react/jsx-runtime").JSX.Element>;
38
- export declare const OptionsMenu: import("react-redux").ConnectedComponent<import("react").MemoExoticComponent<({ exportBubbleTextProvider, exportRawBubbleTextProvider, isExportVisible, isExportCSVDisabled, isExportRawCSVDisabled, isExportXLSXDisabled, isExportPDFDisabled, exportToCsvSupported, exportToXlsxSupported, exportToPdfSupported, isEditFromKD, hiddenActions, enableRawExports, hasPartialDataLimitBreaks, isAccessibilityModeEnabled, isEnableTimezoneChange, isShowOptionsMenu, toggleOptionsMenu, showDialogExportCsv, showDialogExportReport, showDialogExportPdf, openInAnalyticalDesigner, }: IOptionsMenuProps) => import("react/jsx-runtime").JSX.Element>, {
39
- context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null>;
40
- store?: import("redux").Store;
41
- bubbleTextProvider?: BubbleTextProvider;
42
- exportBubbleTextProvider?: BubbleTextProvider;
43
- exportRawBubbleTextProvider?: BubbleTextProvider;
44
- isOpenAsReportDisabled: boolean;
45
- isExportVisible: boolean;
46
- isExportCSVDisabled: boolean;
47
- isExportRawCSVDisabled: boolean;
48
- isExportXLSXDisabled: boolean;
49
- isExportPDFDisabled: boolean;
50
- exportToCsvSupported: boolean;
51
- exportToXlsxSupported: boolean;
52
- exportToPdfSupported: boolean;
53
- isEditFromKD: boolean;
54
- hiddenActions: string[];
55
- enableRawExports: boolean;
56
- hasPartialDataLimitBreaks: boolean;
57
- isAccessibilityModeEnabled: boolean;
58
- isEnableTimezoneChange: boolean;
59
- isShowOptionsMenu: boolean;
60
- toggleOptionsMenu: () => void;
61
- }>;
6
+ /**
7
+ * The options menu overlay. Selecting an action closes the menu and starts the action.
8
+ */
9
+ export declare function OptionsMenu({ items, onClose }: IOptionsMenuProps): import("react/jsx-runtime").JSX.Element;
62
10
  export {};
63
11
  //# sourceMappingURL=OptionsMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,YAAY,CAAC;AAMpE,OAAO,EACH,KAAK,aAAa,EAIrB,MAAM,2CAA2C,CAAC;AAyBnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAWzF,UAAU,yBAAyB;IAC/B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,mBAAmB,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACnD,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,wBAAwB,EAAE,MAAM,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;CACrF;AAED,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;AAEtD,UAAU,sBAAsB;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IAC9C,2BAA2B,CAAC,EAAE,kBAAkB,CAAC;IACjD,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yBAAyB,EAAE,OAAO,CAAC;IACnC,0BAA0B,EAAE,OAAO,CAAC;IACpC,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,oBAAoB;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,KAAK,iBAAiB,GAAG,yBAAyB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AA+BnG,eAAO,MAAM,eAAe,+gBAuBzB,iBAAiB,6CAiLlB,CAAC;AAEH,eAAO,MAAM,WAAW,wjBAnLrB,iBAAiB;;;yBA/EK,kBAAkB;+BACZ,kBAAkB;kCACf,kBAAkB;4BACxB,OAAO;qBACd,OAAO;yBACH,OAAO;4BACJ,OAAO;0BACT,OAAO;yBACR,OAAO;0BACN,OAAO;2BACN,OAAO;0BACR,OAAO;kBACf,OAAO;mBACN,MAAM,EAAE;sBACL,OAAO;+BACE,OAAO;gCACN,OAAO;4BACX,OAAO;uBAIZ,OAAO;uBACP,MAAM,IAAI;EAoPf,CAAC"}
1
+ {"version":3,"file":"OptionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,6BAA6B,EAErC,MAAM,6CAA6C,CAAC;AA6CrD,UAAU,iBAAiB;IACvB,KAAK,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,iBAAiB,2CAwChE"}
@@ -1,116 +1,60 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { memo, useCallback, useState } from "react";
4
- import { defineMessage, useIntl } from "react-intl";
5
- import { connect } from "react-redux";
6
- import { createStructuredSelector } from "reselect";
7
3
  import { Header, ItemsWrapper, Overlay, Separator } from "@gooddata/sdk-ui-kit";
8
- import { showDialogExportCsv, showDialogExportPdf, showDialogExportReport, } from "../../../actions/export_report_actions.js";
9
- import { exportReport } from "../../../actions/report_actions.js";
10
- import { supportsExportToCsv, supportsExportToXlsx, } from "../../../selectors/backend_capabilities_selector.js";
11
- import { AVAILABLE_HIDDEN_ACTIONS, hiddenActions } from "../../../selectors/editor_header_selector.js";
12
- import { getBubbleTextProvider, getIsExportDisabled } from "../../../selectors/export_button_selector.js";
13
- import { enableRawExports, isAccessibilityModeEnabled, isEnableTimezoneChange, } from "../../../selectors/feature_flag_selector.js";
14
- import { getExportBubbleTextProvider, getExportRawBubbleTextProvider, getExportVisible, getIsExportCSVDisabled, getIsExportCSVRawDisabled, getIsExportPDFDisabled, getIsExportXLSXDisabled, isTableVisualization, } from "../../../selectors/options_menu_selector.js";
15
- import { hasPartialDataLimitBreaks } from "../../../selectors/report_selector.js";
16
- import { isEditFromKD } from "../../../selectors/route_selector.js";
17
- import { openInAnalyticalDesignerAction } from "../../../store/router/router_actions.js";
18
- import { TimezoneDialog } from "../TimezoneDialog.js";
19
4
  import { OptionsMenuItem } from "./OptionsMenuItem.js";
20
- const noopString = () => "";
21
- const partialResultExportBubbleTextProvider = (intl) => intl.formatMessage(defineMessage({ id: "options.menu.export_data.partial_result_disabled" }));
22
- const mapStateToProps = createStructuredSelector({
23
- bubbleTextProvider: getBubbleTextProvider,
24
- exportBubbleTextProvider: getExportBubbleTextProvider,
25
- exportRawBubbleTextProvider: getExportRawBubbleTextProvider,
26
- isOpenAsReportDisabled: getIsExportDisabled,
27
- isExportCSVDisabled: getIsExportCSVDisabled,
28
- isExportRawCSVDisabled: getIsExportCSVRawDisabled,
29
- isExportXLSXDisabled: getIsExportXLSXDisabled,
30
- isExportPDFDisabled: getIsExportPDFDisabled,
31
- isExportVisible: getExportVisible,
32
- isEditFromKD,
33
- hiddenActions,
34
- exportToCsvSupported: supportsExportToCsv,
35
- exportToXlsxSupported: supportsExportToXlsx,
36
- exportToPdfSupported: isTableVisualization,
37
- enableRawExports: enableRawExports,
38
- hasPartialDataLimitBreaks,
39
- isAccessibilityModeEnabled: isAccessibilityModeEnabled,
40
- isEnableTimezoneChange,
41
- });
42
- const mapDispatchToProps = {
43
- showDialogExportCsv,
44
- onOpenAsReport: exportReport,
45
- showDialogExportReport,
46
- showDialogExportPdf,
47
- openInAnalyticalDesigner: openInAnalyticalDesignerAction,
5
+ import { OPTIONS_ITEM_IDS, normalizeOptionsItems } from "./useOptionsProps.js";
6
+ const MENU_ALIGN_POINTS = [{ align: "br tr" }];
7
+ // The class names and bubble ids of the built-in actions, which tests and styles select them by.
8
+ const BUILT_IN_ACTIONS = {
9
+ [OPTIONS_ITEM_IDS.openInAnalyticalDesigner]: {
10
+ className: "gd-open-in-analytical-designer s-open-in-analytical-designer",
11
+ bubbleId: "options.menu.open.in.analytical.designer",
12
+ },
13
+ [OPTIONS_ITEM_IDS.exportXlsx]: {
14
+ className: "gd-export-menu-export-xlsx s-gd-export-menu-export-xlsx gd-export-options-xlsx",
15
+ bubbleId: "ExportXLSXBubble",
16
+ },
17
+ [OPTIONS_ITEM_IDS.exportPdf]: {
18
+ className: "gd-export-menu-export-pdf s-gd-export-menu-export-pdf gd-export-options-pdf",
19
+ bubbleId: "ExportPDFBubble",
20
+ },
21
+ [OPTIONS_ITEM_IDS.exportCsv]: {
22
+ className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted",
23
+ bubbleId: "ExportCSVBubble",
24
+ },
25
+ [OPTIONS_ITEM_IDS.exportCsvRaw]: {
26
+ className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-raw",
27
+ bubbleId: "ExportCSVRawBubble",
28
+ },
29
+ [OPTIONS_ITEM_IDS.changeTimezone]: {
30
+ className: "gd-options-menu-timezone s-options-menu-timezone",
31
+ bubbleId: "options.menu.changeTimezone",
32
+ },
48
33
  };
49
- export const OptionsMenuBase = memo(function OptionsMenuBase({ exportBubbleTextProvider = noopString, exportRawBubbleTextProvider, isExportVisible, isExportCSVDisabled, isExportRawCSVDisabled, isExportXLSXDisabled, isExportPDFDisabled, exportToCsvSupported, exportToXlsxSupported, exportToPdfSupported, isEditFromKD, hiddenActions, enableRawExports, hasPartialDataLimitBreaks, isAccessibilityModeEnabled, isEnableTimezoneChange, isShowOptionsMenu, toggleOptionsMenu, showDialogExportCsv, showDialogExportReport, showDialogExportPdf, openInAnalyticalDesigner, }) {
50
- const intl = useIntl();
51
- const [isTimezoneDialogOpen, setIsTimezoneDialogOpen] = useState(false);
52
- const openTimezoneDialog = useCallback(() => {
53
- toggleOptionsMenu();
54
- setIsTimezoneDialogOpen(true);
55
- }, [toggleOptionsMenu]);
56
- const closeTimezoneDialog = useCallback(() => {
57
- setIsTimezoneDialogOpen(false);
58
- }, []);
59
- const openExportCsvDialog = useCallback((mode) => {
60
- showDialogExportCsv(mode);
61
- toggleOptionsMenu();
62
- }, [showDialogExportCsv, toggleOptionsMenu]);
63
- const exportToCSV = useCallback(() => {
64
- openExportCsvDialog("formatted");
65
- }, [openExportCsvDialog]);
66
- const exportToPDF = useCallback(() => {
67
- toggleOptionsMenu();
68
- showDialogExportPdf();
69
- }, [toggleOptionsMenu, showDialogExportPdf]);
70
- const showExportDialog = useCallback(() => {
71
- toggleOptionsMenu();
72
- showDialogExportReport();
73
- }, [showDialogExportReport, toggleOptionsMenu]);
74
- const exportToCSVRaw = useCallback(() => {
75
- openExportCsvDialog("raw");
76
- }, [openExportCsvDialog]);
77
- const onOpenInAnalyticalDesigner = useCallback(() => {
78
- openInAnalyticalDesigner();
79
- toggleOptionsMenu();
80
- }, [openInAnalyticalDesigner, toggleOptionsMenu]);
81
- const renderExportMenu = useCallback(() => {
82
- const isOpenInADVisible = isEditFromKD && !hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.OPEN_IN_ANALYTICAL_DESIGNER);
83
- const formattedExportBubbleTextProvider = hasPartialDataLimitBreaks
84
- ? partialResultExportBubbleTextProvider
85
- : exportBubbleTextProvider;
86
- const isFormattedExportDisabled = (isDisabled) => isDisabled || hasPartialDataLimitBreaks;
87
- return (_jsx(Overlay, { alignTo: ".s-options-button", alignPoints: [{ align: "br tr" }], className: "gd-export-menu-overlay s-gd-export-menu-overlay", closeOnMouseDrag: true, closeOnOutsideClick: true, onClose: toggleOptionsMenu, children: _jsxs(ItemsWrapper, { smallItemsSpacing: true, children: [isOpenInADVisible ? (_jsx(OptionsMenuItem, { bubbleId: "options.menu.open.in.analytical.designer", className: "gd-open-in-analytical-designer s-open-in-analytical-designer", titleId: defineMessage({ id: "options.menu.open.in.analytical.designer" }).id, isDisabled: false, onClick: onOpenInAnalyticalDesigner })) : null, isExportVisible ? (_jsxs(_Fragment, { children: [_jsx(Header, { children: intl.formatMessage({ id: "options.menu.export_data" }) }), exportToXlsxSupported ? (_jsx(OptionsMenuItem, { bubbleId: "ExportXLSXBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-xlsx s-gd-export-menu-export-xlsx gd-export-options-xlsx", isDisabled: isFormattedExportDisabled(isExportXLSXDisabled), titleId: defineMessage({ id: "export.type.XLSX" }).id, onClick: showExportDialog })) : null, exportToPdfSupported && !isAccessibilityModeEnabled ? (_jsx(OptionsMenuItem, { bubbleId: "ExportPDFBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-pdf s-gd-export-menu-export-pdf gd-export-options-pdf", isDisabled: isFormattedExportDisabled(isExportPDFDisabled), titleId: defineMessage({ id: "export.type.PDF" }).id, onClick: exportToPDF })) : null, exportToCsvSupported ? (enableRawExports ? (_jsxs(_Fragment, { children: [_jsx(OptionsMenuItem, { bubbleId: "ExportCSVFormattedBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted", isDisabled: isFormattedExportDisabled(isExportCSVDisabled), titleId: defineMessage({ id: "export.type.CSV.formatted" }).id, onClick: exportToCSV }), _jsx(OptionsMenuItem, { bubbleId: "ExportCSVRawBubble", bubbleTextProvider: exportRawBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-raw", isDisabled: isExportRawCSVDisabled, titleId: defineMessage({ id: "export.type.CSV.raw" }).id, onClick: exportToCSVRaw })] })) : (_jsx(OptionsMenuItem, { bubbleId: "ExportCSVBubble", bubbleTextProvider: formattedExportBubbleTextProvider, className: "gd-export-menu-export-csv s-gd-export-menu-export-csv gd-export-options-csv-formatted", isDisabled: isFormattedExportDisabled(isExportCSVDisabled), titleId: defineMessage({ id: "export.type.CSV" }).id, onClick: exportToCSV }))) : null] })) : null, isEnableTimezoneChange ? (_jsxs(_Fragment, { children: [isOpenInADVisible || isExportVisible ? _jsx(Separator, {}) : null, _jsx(OptionsMenuItem, { bubbleId: "options.menu.changeTimezone", className: "gd-options-menu-timezone s-options-menu-timezone", titleId: defineMessage({ id: "options.menu.changeTimezone" }).id, isDisabled: false, onClick: openTimezoneDialog })] })) : null] }) }, "OptionsMenu"));
88
- }, [
89
- exportBubbleTextProvider,
90
- exportRawBubbleTextProvider,
91
- intl,
92
- isExportCSVDisabled,
93
- isExportRawCSVDisabled,
94
- isExportXLSXDisabled,
95
- isExportPDFDisabled,
96
- toggleOptionsMenu,
97
- isExportVisible,
98
- isEditFromKD,
99
- hiddenActions,
100
- exportToCsvSupported,
101
- exportToXlsxSupported,
102
- exportToPdfSupported,
103
- enableRawExports,
104
- hasPartialDataLimitBreaks,
105
- onOpenInAnalyticalDesigner,
106
- showExportDialog,
107
- exportToCSV,
108
- exportToCSVRaw,
109
- exportToPDF,
110
- isAccessibilityModeEnabled,
111
- isEnableTimezoneChange,
112
- openTimezoneDialog,
113
- ]);
114
- return (_jsxs(_Fragment, { children: [isShowOptionsMenu ? renderExportMenu() : null, isTimezoneDialogOpen ? _jsx(TimezoneDialog, { onClose: closeTimezoneDialog }) : null] }));
115
- });
116
- export const OptionsMenu = connect(mapStateToProps, mapDispatchToProps)(OptionsMenuBase);
34
+ function getActionClasses(action) {
35
+ const simplifiedId = action.id.replace(/[^a-zA-Z0-9-]/g, "-");
36
+ return (BUILT_IN_ACTIONS[action.id] ?? {
37
+ className: `s-options-menu-item-${simplifiedId}`,
38
+ bubbleId: `options-menu-item-${simplifiedId}`,
39
+ });
40
+ }
41
+ /**
42
+ * The options menu overlay. Selecting an action closes the menu and starts the action.
43
+ */
44
+ export function OptionsMenu({ items, onClose }) {
45
+ return (_jsx(Overlay, { alignTo: ".s-options-button", alignPoints: MENU_ALIGN_POINTS, className: "gd-export-menu-overlay s-gd-export-menu-overlay", closeOnMouseDrag: true, closeOnOutsideClick: true, onClose: onClose, children: _jsx(ItemsWrapper, { smallItemsSpacing: true, children: normalizeOptionsItems(items).map((item) => {
46
+ switch (item.type) {
47
+ case "section":
48
+ return _jsx(Header, { children: item.label }, item.id);
49
+ case "separator":
50
+ return _jsx(Separator, {}, item.id);
51
+ default: {
52
+ const { className, bubbleId } = getActionClasses(item);
53
+ return (_jsx(OptionsMenuItem, { bubbleId: bubbleId, className: className, label: item.label, isDisabled: item.isDisabled, disabledTooltip: item.disabledTooltip, onClick: () => {
54
+ onClose();
55
+ item.onSelect();
56
+ } }, item.id));
57
+ }
58
+ }
59
+ }) }) }, "OptionsMenu"));
60
+ }
@@ -1,12 +1,11 @@
1
- import { type IntlShape } from "react-intl";
2
1
  interface IOptionsMenuItemProps {
3
2
  bubbleId: string;
4
- bubbleTextProvider?: (intl: IntlShape) => string;
3
+ disabledTooltip?: string;
5
4
  className: string;
6
5
  isDisabled: boolean;
7
- titleId: string;
6
+ label: string;
8
7
  onClick: () => void;
9
8
  }
10
- export declare const OptionsMenuItem: import("react").MemoExoticComponent<({ bubbleId, bubbleTextProvider, className, isDisabled, titleId, onClick, }: IOptionsMenuItemProps) => import("react/jsx-runtime").JSX.Element>;
9
+ export declare const OptionsMenuItem: import("react").MemoExoticComponent<({ bubbleId, disabledTooltip, className, isDisabled, label, onClick, }: IOptionsMenuItemProps) => import("react/jsx-runtime").JSX.Element>;
11
10
  export {};
12
11
  //# sourceMappingURL=OptionsMenuItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenuItem.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAMrD,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,mHAOzB,qBAAqB,6CAsCtB,CAAC"}
1
+ {"version":3,"file":"OptionsMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/OptionsMenuItem.tsx"],"names":[],"mappings":"AAQA,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,8GAOzB,qBAAqB,6CAmCtB,CAAC"}
@@ -2,11 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
3
  import { memo } from "react";
4
4
  import classNames from "classnames";
5
- import { useIntl } from "react-intl";
6
5
  import { Bubble, BubbleHoverTrigger, Item } from "@gooddata/sdk-ui-kit";
7
- const noopString = () => "";
8
- export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, bubbleTextProvider = noopString, className, isDisabled, titleId, onClick, }) {
9
- const intl = useIntl();
6
+ export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, disabledTooltip, className, isDisabled, label, onClick, }) {
10
7
  const getItemClasses = (customClassName, isDisabled) => {
11
8
  return classNames("gd-list-item", "gd-menu-item", customClassName, { "is-disabled": isDisabled });
12
9
  };
@@ -15,16 +12,15 @@ export const OptionsMenuItem = memo(function OptionsMenuItem({ bubbleId, bubbleT
15
12
  };
16
13
  const itemClasses = getItemClasses(className, isDisabled);
17
14
  if (isDisabled) {
18
- const button = _jsx(Item, { className: itemClasses, children: intl.formatMessage({ id: titleId }) });
19
- const bubbleMessage = bubbleTextProvider(intl);
20
- if (bubbleMessage) {
21
- return renderBubble(bubbleId, button, bubbleMessage);
15
+ const button = _jsx(Item, { className: itemClasses, children: label });
16
+ if (disabledTooltip) {
17
+ return renderBubble(bubbleId, button, disabledTooltip);
22
18
  }
23
19
  else {
24
20
  return button;
25
21
  }
26
22
  }
27
23
  else {
28
- return (_jsx(Item, { className: itemClasses, onClick: onClick, children: intl.formatMessage({ id: titleId }) }));
24
+ return (_jsx(Item, { className: itemClasses, onClick: onClick, children: label }));
29
25
  }
30
26
  });
@@ -0,0 +1,26 @@
1
+ import { type AnalyticalDesignerOptionsItem, type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerOptionsProps } from "../../../embedding/editorHeaderSlotTypes.js";
2
+ /**
3
+ * Identifiers of the built-in options menu items.
4
+ */
5
+ export declare const OPTIONS_ITEM_IDS: {
6
+ readonly openInAnalyticalDesigner: "openInAnalyticalDesigner";
7
+ readonly exportSection: "exportSection";
8
+ readonly exportXlsx: "exportXlsx";
9
+ readonly exportPdf: "exportPdf";
10
+ readonly exportCsv: "exportCsv";
11
+ readonly exportCsvRaw: "exportCsvRaw";
12
+ readonly timezoneSeparator: "timezoneSeparator";
13
+ readonly changeTimezone: "changeTimezone";
14
+ };
15
+ /**
16
+ * Props of the Options slot.
17
+ *
18
+ * @param onChangeTimezone - opens the time zone dialog, which the editor actions own so that it opens for a
19
+ * host's own Options menu too
20
+ */
21
+ export declare function useOptionsProps(context: IAnalyticalDesignerHeaderContext, onChangeTimezone: () => void): IAnalyticalDesignerOptionsProps;
22
+ /**
23
+ * Drops the sections with no action after them and the separators that separate nothing.
24
+ */
25
+ export declare function normalizeOptionsItems(items: readonly AnalyticalDesignerOptionsItem[]): AnalyticalDesignerOptionsItem[];
26
+ //# sourceMappingURL=useOptionsProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOptionsProps.d.ts","sourceRoot":"","sources":["../../../../src/components/header/OptionsMenu/useOptionsProps.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACvC,MAAM,6CAA6C,CAAC;AA0BrD;;GAEG;AACH,eAAO,MAAM,gBAAgB;aACzB,wBAAwB,EAAE,0BAA0B;aACpD,aAAa,EAAE,eAAe;aAC9B,UAAU,EAAE,YAAY;aACxB,SAAS,EAAE,WAAW;aACtB,SAAS,EAAE,WAAW;aACtB,YAAY,EAAE,cAAc;aAC5B,iBAAiB,EAAE,mBAAmB;aACtC,cAAc,EAAE,gBAAgB;CAC1B,CAAC;AA4BX;;;;;GAKG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,gCAAgC,EACzC,gBAAgB,EAAE,MAAM,IAAI,GAC7B,+BAA+B,CA4IjC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,SAAS,6BAA6B,EAAE,GAChD,6BAA6B,EAAE,CAkBjC"}