@gooddata/sdk-ui-analytical-designer 11.67.0-alpha.3 → 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 (152) hide show
  1. package/NOTICE +16 -233
  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/Editor.d.ts.map +1 -1
  11. package/esm/components/Editor.js +31 -2
  12. package/esm/components/EditorHeader.d.ts +19 -1
  13. package/esm/components/EditorHeader.d.ts.map +1 -1
  14. package/esm/components/EditorHeader.js +38 -86
  15. package/esm/components/ReportDescription.d.ts +8 -1
  16. package/esm/components/ReportDescription.d.ts.map +1 -1
  17. package/esm/components/ReportDescription.js +37 -7
  18. package/esm/components/buckets/MeasureAttributeFilterOrganized.d.ts.map +1 -1
  19. package/esm/components/buckets/MeasureAttributeFilterOrganized.js +1 -1
  20. package/esm/components/buckets/MeasureDateFilter.d.ts.map +1 -1
  21. package/esm/components/buckets/MeasureDateFilter.js +1 -1
  22. package/esm/components/buckets/categories/DateDatasetsDropdown.d.ts.map +1 -1
  23. package/esm/components/filterBar/dateFilter/TimeComparisonSection/TimeComparisonTypesDropdown.d.ts.map +1 -1
  24. package/esm/components/header/CancelButton.d.ts +13 -0
  25. package/esm/components/header/CancelButton.d.ts.map +1 -0
  26. package/esm/components/header/CancelButton.js +32 -0
  27. package/esm/components/header/ClearButton.d.ts +7 -0
  28. package/esm/components/header/ClearButton.d.ts.map +1 -0
  29. package/esm/components/header/ClearButton.js +24 -0
  30. package/esm/components/header/EditorActions.d.ts +14 -0
  31. package/esm/components/header/EditorActions.d.ts.map +1 -0
  32. package/esm/components/header/EditorActions.js +71 -0
  33. package/esm/components/header/Embed/EmbedButton.d.ts +6 -1
  34. package/esm/components/header/Embed/EmbedButton.d.ts.map +1 -1
  35. package/esm/components/header/Embed/EmbedButton.js +48 -48
  36. package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts +6 -0
  37. package/esm/components/header/Embed/EmbedInsightDialogContainer.d.ts.map +1 -0
  38. package/esm/components/header/Embed/EmbedInsightDialogContainer.js +52 -0
  39. package/esm/components/header/Embed/EmbedMenu.d.ts +6 -4
  40. package/esm/components/header/Embed/EmbedMenu.d.ts.map +1 -1
  41. package/esm/components/header/Embed/EmbedMenu.js +2 -6
  42. package/esm/components/header/InsightPickerDialog.d.ts +5 -1
  43. package/esm/components/header/InsightPickerDialog.d.ts.map +1 -1
  44. package/esm/components/header/InsightPickerDialog.js +9 -29
  45. package/esm/components/header/OpenControl.d.ts +7 -0
  46. package/esm/components/header/OpenControl.d.ts.map +1 -0
  47. package/esm/components/header/OpenControl.js +69 -0
  48. package/esm/components/header/OptionsMenu/OptionsButton.d.ts +5 -1
  49. package/esm/components/header/OptionsMenu/OptionsButton.d.ts.map +1 -1
  50. package/esm/components/header/OptionsMenu/OptionsButton.js +19 -9
  51. package/esm/components/header/OptionsMenu/OptionsMenu.d.ts +8 -60
  52. package/esm/components/header/OptionsMenu/OptionsMenu.d.ts.map +1 -1
  53. package/esm/components/header/OptionsMenu/OptionsMenu.js +56 -112
  54. package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts +3 -4
  55. package/esm/components/header/OptionsMenu/OptionsMenuItem.d.ts.map +1 -1
  56. package/esm/components/header/OptionsMenu/OptionsMenuItem.js +5 -9
  57. package/esm/components/header/OptionsMenu/useOptionsProps.d.ts +26 -0
  58. package/esm/components/header/OptionsMenu/useOptionsProps.d.ts.map +1 -0
  59. package/esm/components/header/OptionsMenu/useOptionsProps.js +188 -0
  60. package/esm/components/header/SaveAsNewReportButton.d.ts +6 -1
  61. package/esm/components/header/SaveAsNewReportButton.d.ts.map +1 -1
  62. package/esm/components/header/SaveAsNewReportButton.js +20 -10
  63. package/esm/components/header/SaveReportButton.d.ts +6 -1
  64. package/esm/components/header/SaveReportButton.d.ts.map +1 -1
  65. package/esm/components/header/SaveReportButton.js +41 -18
  66. package/esm/components/header/TimezoneDialog.d.ts +1 -1
  67. package/esm/components/header/TimezoneDialog.js +1 -1
  68. package/esm/components/header/UndoRedoButtons.d.ts +7 -0
  69. package/esm/components/header/UndoRedoButtons.d.ts.map +1 -0
  70. package/esm/components/header/UndoRedoButtons.js +31 -0
  71. package/esm/components/header/VisualizationInfo.d.ts +11 -0
  72. package/esm/components/header/VisualizationInfo.d.ts.map +1 -0
  73. package/esm/components/header/VisualizationInfo.js +47 -0
  74. package/esm/components/header/VisualizationTitle.d.ts +7 -0
  75. package/esm/components/header/VisualizationTitle.d.ts.map +1 -0
  76. package/esm/components/header/VisualizationTitle.js +36 -0
  77. package/esm/components/header/VisualizationsDropdown.d.ts +5 -1
  78. package/esm/components/header/VisualizationsDropdown.d.ts.map +1 -1
  79. package/esm/components/header/VisualizationsDropdown.js +7 -33
  80. package/esm/components/header/editorHeaderContext.d.ts +20 -0
  81. package/esm/components/header/editorHeaderContext.d.ts.map +1 -0
  82. package/esm/components/header/editorHeaderContext.js +58 -0
  83. package/esm/components/header/share/InsightAccess.d.ts +30 -1
  84. package/esm/components/header/share/InsightAccess.d.ts.map +1 -1
  85. package/esm/components/header/share/InsightAccess.js +81 -18
  86. package/esm/components/header/share/InsightAccessChip.d.ts +2 -2
  87. package/esm/components/header/share/InsightAccessChip.d.ts.map +1 -1
  88. package/esm/components/header/share/InsightAccessChip.js +3 -3
  89. package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +1 -1
  90. package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -1
  91. package/esm/embedding/editorHeaderSlotTypes.d.ts +569 -0
  92. package/esm/embedding/editorHeaderSlotTypes.d.ts.map +1 -0
  93. package/esm/embedding/editorHeaderSlotTypes.js +2 -0
  94. package/esm/embedding/slots.d.ts +73 -0
  95. package/esm/embedding/slots.d.ts.map +1 -1
  96. package/esm/index.d.ts +1 -0
  97. package/esm/index.d.ts.map +1 -1
  98. package/esm/postMessageApi/outgoing/metrics_changed_events.d.ts +1 -1
  99. package/esm/postMessageApi/outgoing/metrics_changed_events.js +1 -1
  100. package/esm/postMessageApi/outgoing/post_event_helper.d.ts +1 -1
  101. package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
  102. package/esm/postMessageApi/outgoing/post_event_helper.js +1 -1
  103. package/esm/postMessageApi/sagas/control_filtering_saga.js +1 -1
  104. package/esm/sdk-ui-analytical-designer.d.ts +664 -0
  105. package/esm/selectors/editor_header_selector.d.ts +225 -0
  106. package/esm/selectors/editor_header_selector.d.ts.map +1 -1
  107. package/esm/selectors/editor_header_selector.js +8 -1
  108. package/esm/selectors/insight_access_selector.d.ts +185 -4
  109. package/esm/selectors/insight_access_selector.d.ts.map +1 -1
  110. package/esm/selectors/insight_access_selector.js +5 -3
  111. package/esm/selectors/report_title_selector.d.ts +6 -6
  112. package/esm/selectors/report_title_selector.d.ts.map +1 -1
  113. package/esm/selectors/report_title_selector.js +4 -3
  114. package/esm/selectors/report_visualization_selector.d.ts +4 -0
  115. package/esm/selectors/report_visualization_selector.d.ts.map +1 -1
  116. package/esm/selectors/save_report_selector.d.ts +7 -0
  117. package/esm/selectors/save_report_selector.d.ts.map +1 -1
  118. package/esm/selectors/save_report_selector.js +11 -1
  119. package/esm/selectors/uri_selector.js +1 -1
  120. package/esm/store/app_context/app_context_slices.d.ts.map +1 -1
  121. package/esm/store/app_context/app_context_slices.js +2 -3
  122. package/esm/store/app_context/session_id_reducer.d.ts +2 -3
  123. package/esm/store/app_context/session_id_reducer.d.ts.map +1 -1
  124. package/esm/store/app_context/session_id_reducer.js +2 -3
  125. package/esm/store/intl/intl_slice.d.ts.map +1 -1
  126. package/esm/store/intl/intl_slice.js +2 -3
  127. package/esm/translations/en-US.json +8 -0
  128. package/esm/utils/browser_detect.d.ts +2 -1
  129. package/esm/utils/browser_detect.d.ts.map +1 -1
  130. package/esm/utils/browser_detect.js +21 -3
  131. package/esm/utils/dropdown.d.ts +6 -2
  132. package/esm/utils/dropdown.d.ts.map +1 -1
  133. package/esm/utils/dropdown.js +10 -3
  134. package/package.json +23 -31
  135. package/styles/css/catalog.css +2 -2
  136. package/styles/css/catalog_sidebar.css +1 -1
  137. package/styles/css/catalog_sidebar.css.map +1 -1
  138. package/styles/css/editor_canvas.css +1 -1
  139. package/styles/css/editor_header.css +16 -1
  140. package/styles/css/editor_header.css.map +1 -1
  141. package/styles/css/main.css +20 -5
  142. package/styles/css/main.css.map +1 -1
  143. package/styles/scss/catalog.scss +2 -2
  144. package/styles/scss/catalog_sidebar.scss +2 -1
  145. package/styles/scss/editor_canvas.scss +1 -1
  146. package/styles/scss/editor_header.scss +20 -1
  147. package/esm/components/ReportTitle.d.ts +0 -2
  148. package/esm/components/ReportTitle.d.ts.map +0 -1
  149. package/esm/components/ReportTitle.js +0 -51
  150. package/esm/components/header/Embed/utils.d.ts +0 -4
  151. package/esm/components/header/Embed/utils.d.ts.map +0 -1
  152. package/esm/components/header/Embed/utils.js +0 -5
@@ -1,92 +1,44 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2007-2026 GoodData Corporation
3
- import { useCallback } from "react";
3
+ import { useCallback, useState } from "react";
4
4
  import classNames from "classnames";
5
- import { useIntl } from "react-intl";
6
- import { useDispatch, useSelector } from "react-redux";
7
- import { Bubble, BubbleHoverTrigger, Button } from "@gooddata/sdk-ui-kit";
8
- import { resetApplication } from "../actions/app_context_actions.js";
9
- import { cancelEditFromKDAction } from "../actions/cancel_edit_from_kd_actions.js";
10
- import { redo, undo } from "../actions/time_travel_actions.js";
11
- import { AVAILABLE_DISPLAYED_ACTIONS, AVAILABLE_HIDDEN_ACTIONS, displayedActions as displayedActionsSelector, hiddenActions as hiddenActionsSelector, isEditorHeaderResetDisabled, isEmbedButtonVisible as isEmbedButtonVisibleSelector, isOptionsMenuEnabled as isOptionsMenuEnabledSelector, isRedoDisabled as isRedoDisabledSelector, isSaveAsVisible as isSaveAsVisibleSelector, isSaveVisible as isSaveVisibleSelector, isUndoDisabled as isUndoDisabledSelector, } from "../selectors/editor_header_selector.js";
12
- import { enableEnhancedInsightPicker, enableGenAiRightPanel } from "../selectors/feature_flag_selector.js";
13
- import { isEditFromKD as isEditFromKDSelector, isExploreFromKD as isExploreFromKDSelector, } from "../selectors/route_selector.js";
5
+ import { useSelector } from "react-redux";
6
+ import { renderSlot, useAdSlots } from "../embedding/slots.js";
7
+ import { enableEnhancedInsightPicker } from "../selectors/feature_flag_selector.js";
14
8
  import { CatalogSidebarRestoreToggle } from "./catalogSidebar/CatalogSidebarToggle.js";
15
- import { EmbedButton } from "./header/Embed/EmbedButton.js";
16
- import { InsightPickerDialog } from "./header/InsightPickerDialog.js";
17
- import { OptionsButton } from "./header/OptionsMenu/OptionsButton.js";
18
- import { SaveAsNewReportButton } from "./header/SaveAsNewReportButton.js";
19
- import { SaveReportButton } from "./header/SaveReportButton.js";
20
- import { VisualizationsDropdown } from "./header/VisualizationsDropdown.js";
21
- import { ReportTitle } from "./ReportTitle.js";
22
- export function EditorHeader() {
23
- const intl = useIntl();
24
- const dispatch = useDispatch();
25
- const isUndoDisabled = useSelector(isUndoDisabledSelector);
26
- const isRedoDisabled = useSelector(isRedoDisabledSelector);
27
- const isResetDisabled = useSelector(isEditorHeaderResetDisabled);
9
+ import { useEditorActions } from "./header/EditorActions.js";
10
+ import { useEditorHeaderContext } from "./header/editorHeaderContext.js";
11
+ import { EmbedInsightDialogContainer } from "./header/Embed/EmbedInsightDialogContainer.js";
12
+ import { TimezoneDialog } from "./header/TimezoneDialog.js";
13
+ import { useVisualizationInfo } from "./header/VisualizationInfo.js";
14
+ /**
15
+ * The header shell. It keeps the catalog restore control and the dialogs of the header flows outside the
16
+ * EditorHeader slot, so a host that replaces or hides the header cannot strand a collapsed catalog or break a
17
+ * flow its own controls start.
18
+ */
19
+ export function EditorHeader({ containerRef }) {
20
+ const slots = useAdSlots();
21
+ const context = useEditorHeaderContext();
28
22
  const isEnhancedInsightPickerEnabled = useSelector(enableEnhancedInsightPicker);
29
- const isGenAiRightPanelEnabled = useSelector(enableGenAiRightPanel);
30
- const isOptionsMenuEnabled = useSelector(isOptionsMenuEnabledSelector);
31
- const isEditFromKD = useSelector(isEditFromKDSelector);
32
- const isExploreFromKD = useSelector(isExploreFromKDSelector);
33
- const hiddenActions = useSelector(hiddenActionsSelector);
34
- const displayedActions = useSelector(displayedActionsSelector);
35
- const isSaveVisible = useSelector(isSaveVisibleSelector);
36
- const isSaveAsVisible = useSelector(isSaveAsVisibleSelector);
37
- const isEmbedButtonVisible = useSelector(isEmbedButtonVisibleSelector);
38
- const onCancelEditFromKD = useCallback(() => {
39
- dispatch(cancelEditFromKDAction());
40
- }, [dispatch]);
41
- const onUndo = useCallback(() => {
42
- dispatch(undo());
43
- }, [dispatch]);
44
- const onRedo = useCallback(() => {
45
- dispatch(redo());
46
- }, [dispatch]);
47
- const onResetReport = useCallback(() => {
48
- dispatch(resetApplication());
49
- }, [dispatch]);
50
- const getEditorHeaderClassName = () => {
51
- return classNames("adi-editor-header", "without-dataset-picker", {
23
+ const [isTimezoneDialogOpen, setIsTimezoneDialogOpen] = useState(false);
24
+ const openTimezoneDialog = useCallback(() => setIsTimezoneDialogOpen(true), []);
25
+ const closeTimezoneDialog = useCallback(() => setIsTimezoneDialogOpen(false), []);
26
+ const visualizationInfo = useVisualizationInfo(context);
27
+ const editorActions = useEditorActions(context, openTimezoneDialog);
28
+ const headerProps = {
29
+ ...context,
30
+ visualizationInfo,
31
+ editorActions,
32
+ };
33
+ return (_jsxs("div", { ref: containerRef, className: classNames("adi-editor-header", "without-dataset-picker", {
52
34
  "enhanced-insight-picker": isEnhancedInsightPickerEnabled,
53
- "without-title-space": isGenAiRightPanelEnabled,
54
- });
55
- };
56
- const renderSaveButtons = () => {
57
- return (_jsxs(_Fragment, { children: [isSaveAsVisible ? _jsx(SaveAsNewReportButton, {}) : null, isSaveVisible ? _jsx(SaveReportButton, {}) : null] }));
58
- };
59
- const renderCancelButton = () => {
60
- const isFromKD = isEditFromKD || isExploreFromKD;
61
- const displayCancel = isFromKD || displayedActions.includes(AVAILABLE_DISPLAYED_ACTIONS.CANCEL);
62
- return (displayCancel && (_jsx(Button, { value: intl.formatMessage({ id: "cancel" }), className: `gd-button-secondary cancel-edit-from-kd s-cancel-edit-from-kd editor-header-item`, onClick: onCancelEditFromKD })));
63
- };
64
- const renderUndoButton = () => {
65
- return (_jsx("span", { children: _jsxs(BubbleHoverTrigger, { children: [_jsx(Button, { className: "gd-button-secondary gd-button-icon-only gd-icon-undo undo s-undo", value: "", disabled: isUndoDisabled, onClick: onUndo }), _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tc", offset: { x: 0, y: 12 } }], children: intl.formatMessage({ id: "undo" }) })] }) }));
66
- };
67
- const renderRedoButton = () => {
68
- return (_jsx("span", { children: _jsxs(BubbleHoverTrigger, { children: [_jsx(Button, { className: "gd-button-secondary gd-button-icon-only gd-icon-redo redo s-redo", value: "", disabled: isRedoDisabled, onClick: onRedo }), _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tc", offset: { x: 0, y: 12 } }], children: intl.formatMessage({ id: "redo" }) })] }) }));
69
- };
70
- const renderUndoRedoButtons = () => {
71
- const isUndoRedoVisible = !hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.UNDO_REDO);
72
- return (isUndoRedoVisible && (_jsxs("div", { className: "gd-button-group editor-header-item", children: [renderUndoButton(), renderRedoButton()] })));
73
- };
74
- const renderClearButton = () => {
75
- const isClearVisible = !hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.CLEAR);
76
- return (isClearVisible && (_jsx(Button, { value: intl.formatMessage({ id: "reset" }), className: "gd-button-secondary reset s-reset-report editor-header-item", disabled: isResetDisabled, onClick: onResetReport })));
77
- };
78
- const renderOpenDropdown = () => {
79
- const isOpenVisible = !isExploreFromKD && !hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.OPEN);
80
- if (!isOpenVisible) {
81
- return null;
82
- }
83
- return isEnhancedInsightPickerEnabled ? _jsx(InsightPickerDialog, {}) : _jsx(VisualizationsDropdown, {});
84
- };
85
- const renderOptionsButton = () => {
86
- return isOptionsMenuEnabled && _jsx(OptionsButton, {});
87
- };
88
- const renderEmbedButton = () => {
89
- return isEmbedButtonVisible && _jsx(EmbedButton, {});
90
- };
91
- return (_jsxs("div", { className: getEditorHeaderClassName(), children: [_jsx(CatalogSidebarRestoreToggle, {}), _jsx("h1", { className: "s-adi-application-title" }), _jsx("div", { className: "left-actions-wrapper", children: _jsx(ReportTitle, {}) }), _jsxs("div", { className: "export-wrapper", children: [renderUndoRedoButtons(), renderClearButton(), renderOpenDropdown(), renderCancelButton(), renderSaveButtons(), renderEmbedButton(), renderOptionsButton()] })] }));
35
+ // the compact layout drops the catalog-width offset; the catalog sidebar layout positions the header
36
+ "without-title-space": context.layout.mode === "compact",
37
+ }), children: [_jsx(CatalogSidebarRestoreToggle, {}), _jsx("h1", { className: "s-adi-application-title" }), _jsx("div", { className: "adi-editor-header-content", children: renderSlot(slots.EditorHeader, DefaultEditorHeader, headerProps) }), _jsx(EmbedInsightDialogContainer, {}), isTimezoneDialogOpen ? _jsx(TimezoneDialog, { onClose: closeTimezoneDialog }) : null] }));
38
+ }
39
+ /**
40
+ * Default of the EditorHeader slot: the visualization information on the left and the actions on the right.
41
+ */
42
+ export function DefaultEditorHeader({ visualizationInfo, editorActions, }) {
43
+ return (_jsxs("div", { className: "adi-editor-header-row", children: [_jsx("div", { className: "left-actions-wrapper", children: visualizationInfo }), _jsx("div", { className: "export-wrapper", children: editorActions })] }));
92
44
  }
@@ -1,2 +1,9 @@
1
- export declare function ReportDescription(): import("react/jsx-runtime").JSX.Element;
1
+ import { type IAnalyticalDesignerHeaderContext, type IAnalyticalDesignerVisualizationDescriptionProps } from "../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useVisualizationDescriptionProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerVisualizationDescriptionProps;
3
+ /**
4
+ * Default of the VisualizationDescription slot: an icon with a bubble that shows the description and edits it
5
+ * in place. The draft is committed when the bubble closes. Renders nothing for an empty description that cannot
6
+ * be changed.
7
+ */
8
+ export declare function DefaultVisualizationDescription({ description: currentDescription, addLabel, placeholder, isEditable, filters, separators, onDescriptionChange, }: IAnalyticalDesignerVisualizationDescriptionProps): import("react/jsx-runtime").JSX.Element | null;
2
9
  //# sourceMappingURL=ReportDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportDescription.d.ts","sourceRoot":"","sources":["../../src/components/ReportDescription.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,iBAAiB,4CA0GhC"}
1
+ {"version":3,"file":"ReportDescription.d.ts","sourceRoot":"","sources":["../../src/components/ReportDescription.tsx"],"names":[],"mappings":"AAYA,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gDAAgD,EACxD,MAAM,uCAAuC,CAAC;AAsB/C,wBAAgB,gCAAgC,CAC5C,OAAO,EAAE,gCAAgC,GAC1C,gDAAgD,CAoBlD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,WAAW,EAAE,kBAAkB,EAC/B,QAAQ,EACR,WAAW,EACX,UAAU,EACV,OAAO,EACP,UAAU,EACV,mBAAmB,GACtB,EAAE,gDAAgD,kDA6GlD"}
@@ -1,13 +1,15 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2022-2026 GoodData Corporation
3
- import { useCallback, useEffect, useState } from "react";
3
+ import { useCallback, useEffect, useMemo, useState } from "react";
4
4
  import cx from "classnames";
5
5
  import { isEmpty } from "lodash-es";
6
6
  import { useIntl } from "react-intl";
7
- import { useDispatch, useSelector } from "react-redux";
7
+ import { useSelector } from "react-redux";
8
8
  import { Bubble, RichText, RichTextWithTooltip } from "@gooddata/sdk-ui-kit";
9
9
  import { reportDescriptionChange } from "../actions/report_actions.js";
10
10
  import { reportDescriptionSelector } from "../selectors/report_description_selector.js";
11
+ import { reportTitleSelector } from "../selectors/report_title_selector.js";
12
+ import { useGuardedCallback } from "./header/editorHeaderContext.js";
11
13
  import { ReportDescriptionTrigger } from "./ReportDescriptionTrigger.js";
12
14
  const ALIGN_POINTS = [{ align: "bl tl" }];
13
15
  const ARROW_OFFSETS = { "bl tl": [0, 5] };
@@ -16,15 +18,36 @@ const richTextTooltipAlignPoints = [
16
18
  { align: "bc tc", offset: { x: 0, y: 5 } },
17
19
  { align: "tc bc", offset: { x: 0, y: -5 } },
18
20
  ];
19
- export function ReportDescription() {
21
+ // The description follows the title: it can change unless the visualization is locked or AD is read-only.
22
+ const canEditDescription = (state) => reportTitleSelector(state).canEditTitle;
23
+ const runDescriptionChange = (dispatch, _state, description) => dispatch(reportDescriptionChange(description));
24
+ export function useVisualizationDescriptionProps(context) {
20
25
  const intl = useIntl();
21
- const dispatch = useDispatch();
22
26
  const { currentDescription, filters, separators } = useSelector(reportDescriptionSelector);
27
+ const { canEditTitle: isEditable } = useSelector(reportTitleSelector);
28
+ const onDescriptionChange = useGuardedCallback(canEditDescription, runDescriptionChange);
29
+ const addLabel = intl.formatMessage({ id: "report.description.add" });
30
+ return useMemo(() => ({
31
+ ...context,
32
+ description: currentDescription,
33
+ addLabel,
34
+ placeholder: addLabel,
35
+ isEditable,
36
+ filters,
37
+ ...(separators ? { separators } : {}),
38
+ onDescriptionChange,
39
+ }), [context, currentDescription, addLabel, isEditable, filters, separators, onDescriptionChange]);
40
+ }
41
+ /**
42
+ * Default of the VisualizationDescription slot: an icon with a bubble that shows the description and edits it
43
+ * in place. The draft is committed when the bubble closes. Renders nothing for an empty description that cannot
44
+ * be changed.
45
+ */
46
+ export function DefaultVisualizationDescription({ description: currentDescription, addLabel, placeholder, isEditable, filters, separators, onDescriptionChange, }) {
23
47
  const currentDescriptionTrimmed = currentDescription.trim();
24
48
  const [description, setDescription] = useState(currentDescriptionTrimmed);
25
49
  const [preventClose, setPreventClose] = useState(false);
26
50
  const [editMode, setEditMode] = useState(false);
27
- const placeholder = intl.formatMessage({ id: "report.description.add" });
28
51
  useEffect(() => {
29
52
  setDescription(currentDescriptionTrimmed);
30
53
  }, [currentDescriptionTrimmed]);
@@ -34,7 +57,7 @@ export function ReportDescription() {
34
57
  setPreventClose(false);
35
58
  setEditMode(false);
36
59
  if (trimmedDescription !== currentDescriptionTrimmed) {
37
- dispatch(reportDescriptionChange(trimmedDescription));
60
+ onDescriptionChange(trimmedDescription);
38
61
  }
39
62
  };
40
63
  const handleBlur = () => {
@@ -42,18 +65,25 @@ export function ReportDescription() {
42
65
  setEditMode(false);
43
66
  };
44
67
  const handleClick = () => {
68
+ if (!isEditable) {
69
+ return;
70
+ }
45
71
  setPreventClose(true);
46
72
  setEditMode(true);
47
73
  };
48
74
  const onRichTextChange = useCallback((value) => {
49
75
  setDescription(value);
50
76
  }, []);
77
+ // nothing to read and nothing to add
78
+ if (!isEditable && isEmpty(currentDescriptionTrimmed)) {
79
+ return null;
80
+ }
51
81
  const renderContent = () => {
52
82
  const getClassNames = (ownClass) => {
53
83
  return cx("adi-description-tooltip-base", "s-adi-description-tooltip-content", ownClass);
54
84
  };
55
85
  if (isEmpty(description) && !editMode) {
56
- return (_jsx("div", { className: getClassNames("adi-description-tooltip-placeholder"), onClick: handleClick, children: intl.formatMessage({ id: "report.description.add" }) }));
86
+ return (_jsx("div", { className: getClassNames("adi-description-tooltip-placeholder"), onClick: handleClick, children: addLabel }));
57
87
  }
58
88
  if (editMode) {
59
89
  return (_jsx("div", { className: "adi-description-tooltip-rich-text s-adi-description-tooltip-content", onBlur: handleBlur, children: _jsx(RichTextWithTooltip, { className: "adi-description-tooltip-rich-text-content", value: description, renderMode: editMode ? "edit" : "view", onChange: onRichTextChange, editRows: 20, tooltipAlignPoints: richTextTooltipAlignPoints, showTooltip: editMode, editPlaceholder: placeholder, emptyElement: _jsx(_Fragment, { children: placeholder }), referencesEnabled: true, filters: filters, separators: separators }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"MeasureAttributeFilterOrganized.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/MeasureAttributeFilterOrganized.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAOjE,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EACH,KAAK,iCAAiC,EAEzC,MAAM,qCAAqC,CAAC;AAI7C,MAAM,WAAW,qCAAqC;IAClD,UAAU,EAAE,oBAAoB,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,WAAW,CAAC,EAAE,iCAAiC,CAAC;IAChD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,yBAAiC,GACpC,EAAE,qCAAqC,2CA+GvC"}
1
+ {"version":3,"file":"MeasureAttributeFilterOrganized.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/MeasureAttributeFilterOrganized.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAYjE,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EACH,KAAK,iCAAiC,EAEzC,MAAM,qCAAqC,CAAC;AAI7C,MAAM,WAAW,qCAAqC;IAClD,UAAU,EAAE,oBAAoB,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,WAAW,CAAC,EAAE,iCAAiC,CAAC;IAChD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,yBAAiC,GACpC,EAAE,qCAAqC,2CA+GvC"}
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import classNames from "classnames";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Button, Overlay } from "@gooddata/sdk-ui-kit";
7
- import { DROPDOWN_ALIGNMENTS, getDialogHeight, subscribeEvents } from "../../utils/dropdown.js";
7
+ import { DROPDOWN_ALIGNMENTS, getDialogHeight, subscribeEvents, } from "../../utils/dropdown.js";
8
8
  import { MEASURE_ATTRIBUTE_PICKER_SEARCHBOX_HEIGHT, MeasureAttributeFilterPickerBody, } from "./MeasureAttributeFilterPickerBody.js";
9
9
  import { useMeasureAttributeFilterItems, } from "./useMeasureAttributeFilterItems.js";
10
10
  const PADDING = 14;
@@ -1 +1 @@
1
- {"version":3,"file":"MeasureDateFilter.d.ts","sourceRoot":"","sources":["../../../src/components/buckets/MeasureDateFilter.tsx"],"names":[],"mapp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AAoB,EAAE,UAAU,EAAE,oBAAoB,KAAK,IAAI;cACxE,CAAC,YAAY,EAAE,uBAAuB,EAAE,2BAA2B,CAAC,EAAE,OAAO,KAAK,IAAI;wBAC5E,CAAC,iBAAiB,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,KAAK,IAAI;yCAClD,CACjC,iBAAiB,EAAE,MAAM,EACzB,6BAA6B,EAAE,MAAM,KACpC,IAAI;iCACoB,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,4BAA4B,CAAC;yCAC/D,CAAC,iBAAiB,EAAE,OAAO,KAAK,IAAI;4BAKjD,uBAAuB,EAAE;cAKvC,CAAC,OAAO,EAAE,6BAA6B,KAAK,IAAI;0BAMpC,OAAO;+BACF,MAAM;eAKtB,OAAO;uBAEC,MAAM,IAAI;EAg+BT,CAAC"}
@@ -21,7 +21,7 @@ import { enableImprovedMetricDateFilter, getWeekStart } from "../../selectors/fe
21
21
  import { measureDateFilterSelector } from "../../selectors/measure_date_filter_selector.js";
22
22
  import { metricFilterToAttributeFilter } from "../../store/bucket_filters/metric_additional_date_filters.js";
23
23
  import { getDateAttributes } from "../../store/date_datasets_meta/date_datasets_meta_selectors.js";
24
- import { DROPDOWN_ALIGNMENTS, getDialogHeight, subscribeEvents } from "../../utils/dropdown.js";
24
+ import { DROPDOWN_ALIGNMENTS, getDialogHeight, subscribeEvents, } from "../../utils/dropdown.js";
25
25
  import { getIsoDate } from "../../utils/timers.js";
26
26
  import { DateFilterPresets } from "../DateFilterPresets.js";
27
27
  import { ALL_TIME_FILTER_OPTION } from "../filterBar/dateFilter/defaultFilterOptions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"DateDatasetsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/buckets/categories/DateDatasetsDropdown.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAQvF,MAAM,WAAW,0BAA0B;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACnD,iBAAiB,EAAE,qBAAqB,CAAC;IAEzC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAE3D,4BAA4B,EAAE,OAAO,CAAC;IACtC,kBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAE9C,gCAAgC,EAAE,OAAO,CAAC;CAC7C;AAoDD,wBAAgB,oBAAoB,CAAC,EACjC,SAAmC,EACnC,mBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,gCAAgC,GACnC,EAAE,0BAA0B,2CAmL5B"}
1
+ {"version":3,"file":"DateDatasetsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/buckets/categories/DateDatasetsDropdown.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AASvF,MAAM,WAAW,0BAA0B;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACnD,iBAAiB,EAAE,qBAAqB,CAAC;IAEzC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAE3D,4BAA4B,EAAE,OAAO,CAAC;IACtC,kBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAE9C,gCAAgC,EAAE,OAAO,CAAC;CAC7C;AAoDD,wBAAgB,oBAAoB,CAAC,EACjC,SAAmC,EACnC,mBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,gCAAgC,GACnC,EAAE,0BAA0B,2CAmL5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"TimeComparisonTypesDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/filterBar/dateFilter/TimeComparisonSection/TimeComparisonTypesDropdown.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,sBAAsB,EAA2B,MAAM,kBAAkB,CAAC;AAaxF,MAAM,WAAW,iCAAiC;IAC9C,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,YAAY,EAAE,sBAAsB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;CAC3B;AAeD,wBAAgB,2BAA2B,CAAC,EACxC,QAAmB,EACnB,YAAY,EACZ,UAAU,EACV,SAAsC,EACtC,mBAAyC,EACzC,mBAAmB,EACnB,cAAc,EACd,cAAc,GACjB,EAAE,iCAAiC,2CA4HnC"}
1
+ {"version":3,"file":"TimeComparisonTypesDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/filterBar/dateFilter/TimeComparisonSection/TimeComparisonTypesDropdown.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,sBAAsB,EAA2B,MAAM,kBAAkB,CAAC;AAcxF,MAAM,WAAW,iCAAiC;IAC9C,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,YAAY,EAAE,sBAAsB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;CAC3B;AAeD,wBAAgB,2BAA2B,CAAC,EACxC,QAAmB,EACnB,YAAY,EACZ,UAAU,EACV,SAAsC,EACtC,mBAAyC,EACzC,mBAAmB,EACnB,cAAc,EACd,cAAc,GACjB,EAAE,iCAAiC,2CA4HnC"}
@@ -0,0 +1,13 @@
1
+ import { type IAnalyticalDesignerCancelProps, type IAnalyticalDesignerHeaderContext } from "../../embedding/editorHeaderSlotTypes.js";
2
+ /**
3
+ * Requests leaving the editor through the cancellation flow that `IAnalyticalDesignerApi.requestCancellation()`
4
+ * starts too: a confirmation when there are unsaved changes, then the `insightEditingCancelled` event. Unlike
5
+ * that command, it is refused while the visualization is being saved.
6
+ */
7
+ export declare function useRequestCancellation(): () => void;
8
+ export declare function useCancelProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerCancelProps;
9
+ /**
10
+ * Default of the Cancel slot.
11
+ */
12
+ export declare function DefaultCancel({ label, isDisabled, onCancel }: IAnalyticalDesignerCancelProps): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=CancelButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/CancelButton.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACxC,MAAM,0CAA0C,CAAC;AASlD;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,IAAI,CAEnD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gCAAgC,GAAG,8BAA8B,CAUxG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,8BAA8B,2CAS5F"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } 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 { Button } from "@gooddata/sdk-ui-kit";
7
+ import { cancelEditFromKDAction } from "../../actions/cancel_edit_from_kd_actions.js";
8
+ import { isNavigationDisabled } from "../../selectors/editor_header_selector.js";
9
+ import { useGuardedCallback } from "./editorHeaderContext.js";
10
+ const canNavigate = (state) => !isNavigationDisabled(state);
11
+ const runCancellation = (dispatch) => dispatch(cancelEditFromKDAction());
12
+ /**
13
+ * Requests leaving the editor through the cancellation flow that `IAnalyticalDesignerApi.requestCancellation()`
14
+ * starts too: a confirmation when there are unsaved changes, then the `insightEditingCancelled` event. Unlike
15
+ * that command, it is refused while the visualization is being saved.
16
+ */
17
+ export function useRequestCancellation() {
18
+ return useGuardedCallback(canNavigate, runCancellation);
19
+ }
20
+ export function useCancelProps(context) {
21
+ const intl = useIntl();
22
+ const isDisabled = useSelector(isNavigationDisabled);
23
+ const onCancel = useRequestCancellation();
24
+ const label = intl.formatMessage({ id: "cancel" });
25
+ return useMemo(() => ({ ...context, label, isDisabled, onCancel }), [context, label, isDisabled, onCancel]);
26
+ }
27
+ /**
28
+ * Default of the Cancel slot.
29
+ */
30
+ export function DefaultCancel({ label, isDisabled, onCancel }) {
31
+ return (_jsx(Button, { value: label, className: "gd-button-secondary cancel-edit-from-kd s-cancel-edit-from-kd editor-header-item", disabled: isDisabled, onClick: onCancel }));
32
+ }
@@ -0,0 +1,7 @@
1
+ import { type IAnalyticalDesignerClearProps, type IAnalyticalDesignerHeaderContext } from "../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useClearProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerClearProps;
3
+ /**
4
+ * Default of the Clear slot.
5
+ */
6
+ export declare function DefaultClear({ label, isDisabled, onClear }: IAnalyticalDesignerClearProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ClearButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClearButton.d.ts","sourceRoot":"","sources":["../../../src/components/header/ClearButton.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACxC,MAAM,0CAA0C,CAAC;AASlD,wBAAgB,aAAa,CAAC,OAAO,EAAE,gCAAgC,GAAG,6BAA6B,CAOtG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CASzF"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } 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 { Button } from "@gooddata/sdk-ui-kit";
7
+ import { resetApplication } from "../../actions/app_context_actions.js";
8
+ import { isEditorHeaderResetDisabled } from "../../selectors/editor_header_selector.js";
9
+ import { useGuardedCallback } from "./editorHeaderContext.js";
10
+ const canClear = (state) => !isEditorHeaderResetDisabled(state);
11
+ const runClear = (dispatch) => dispatch(resetApplication());
12
+ export function useClearProps(context) {
13
+ const intl = useIntl();
14
+ const isDisabled = useSelector(isEditorHeaderResetDisabled);
15
+ const onClear = useGuardedCallback(canClear, runClear);
16
+ const label = intl.formatMessage({ id: "reset" });
17
+ return useMemo(() => ({ ...context, label, isDisabled, onClear }), [context, label, isDisabled, onClear]);
18
+ }
19
+ /**
20
+ * Default of the Clear slot.
21
+ */
22
+ export function DefaultClear({ label, isDisabled, onClear }) {
23
+ return (_jsx(Button, { value: label, className: "gd-button-secondary reset s-reset-report editor-header-item", disabled: isDisabled, onClick: onClear }));
24
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactElement } from "react";
2
+ import { type IAnalyticalDesignerEditorActionsProps, type IAnalyticalDesignerHeaderContext } from "../../embedding/editorHeaderSlotTypes.js";
3
+ /**
4
+ * The EditorActions region with the slots of the controls AD shows resolved. A control AD does not show for its
5
+ * permissions, configuration or mode is not in the items, so its slot does not render.
6
+ *
7
+ * @param onChangeTimezone - opens the time zone dialog owned by the header
8
+ */
9
+ export declare function useEditorActions(context: IAnalyticalDesignerHeaderContext, onChangeTimezone: () => void): ReactElement;
10
+ /**
11
+ * Default of the EditorActions slot: the items in their order.
12
+ */
13
+ export declare function DefaultEditorActions({ items }: IAnalyticalDesignerEditorActionsProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=EditorActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorActions.d.ts","sourceRoot":"","sources":["../../../src/components/header/EditorActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAIpD,OAAO,EAEH,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACxC,MAAM,0CAA0C,CAAC;AAuBlD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,gCAAgC,EACzC,gBAAgB,EAAE,MAAM,IAAI,GAC7B,YAAY,CA+Cd;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,qCAAqC,2CAQpF"}
@@ -0,0 +1,71 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2026 GoodData Corporation
3
+ import { Fragment } from "react";
4
+ import { useSelector } from "react-redux";
5
+ import { renderSlot, useAdSlots } from "../../embedding/slots.js";
6
+ import { AVAILABLE_HIDDEN_ACTIONS, hiddenActions as hiddenActionsSelector, isCancelVisible as isCancelVisibleSelector, isEmbedButtonVisible as isEmbedButtonVisibleSelector, isOpenVisible as isOpenVisibleSelector, isOptionsMenuEnabled as isOptionsMenuEnabledSelector, isSaveAsVisible as isSaveAsVisibleSelector, isSaveVisible as isSaveVisibleSelector, } from "../../selectors/editor_header_selector.js";
7
+ import { DefaultCancel, useCancelProps } from "./CancelButton.js";
8
+ import { DefaultClear, useClearProps } from "./ClearButton.js";
9
+ import { DefaultEmbed, useEmbedProps } from "./Embed/EmbedButton.js";
10
+ import { DefaultOpen, useOpenProps } from "./OpenControl.js";
11
+ import { DefaultOptions } from "./OptionsMenu/OptionsButton.js";
12
+ import { useOptionsProps } from "./OptionsMenu/useOptionsProps.js";
13
+ import { DefaultSaveAs, useSaveAsProps } from "./SaveAsNewReportButton.js";
14
+ import { DefaultSave, useSaveProps } from "./SaveReportButton.js";
15
+ import { DefaultUndoRedo, useUndoRedoProps } from "./UndoRedoButtons.js";
16
+ /**
17
+ * The EditorActions region with the slots of the controls AD shows resolved. A control AD does not show for its
18
+ * permissions, configuration or mode is not in the items, so its slot does not render.
19
+ *
20
+ * @param onChangeTimezone - opens the time zone dialog owned by the header
21
+ */
22
+ export function useEditorActions(context, onChangeTimezone) {
23
+ const slots = useAdSlots();
24
+ const hiddenActions = useSelector(hiddenActionsSelector);
25
+ const isOpenVisible = useSelector(isOpenVisibleSelector);
26
+ const isCancelVisible = useSelector(isCancelVisibleSelector);
27
+ const isSaveAsVisible = useSelector(isSaveAsVisibleSelector);
28
+ const isSaveVisible = useSelector(isSaveVisibleSelector);
29
+ const isEmbedVisible = useSelector(isEmbedButtonVisibleSelector);
30
+ const isOptionsVisible = useSelector(isOptionsMenuEnabledSelector);
31
+ const undoRedoProps = useUndoRedoProps(context);
32
+ const clearProps = useClearProps(context);
33
+ const openProps = useOpenProps(context);
34
+ const cancelProps = useCancelProps(context);
35
+ const saveAsProps = useSaveAsProps(context);
36
+ const saveProps = useSaveProps(context);
37
+ const embedProps = useEmbedProps(context);
38
+ const optionsProps = useOptionsProps(context, onChangeTimezone);
39
+ const items = [];
40
+ if (!hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.UNDO_REDO)) {
41
+ items.push({ id: "undoRedo", content: renderSlot(slots.UndoRedo, DefaultUndoRedo, undoRedoProps) });
42
+ }
43
+ if (!hiddenActions.includes(AVAILABLE_HIDDEN_ACTIONS.CLEAR)) {
44
+ items.push({ id: "clear", content: renderSlot(slots.Clear, DefaultClear, clearProps) });
45
+ }
46
+ if (isOpenVisible) {
47
+ items.push({ id: "open", content: renderSlot(slots.Open, DefaultOpen, openProps) });
48
+ }
49
+ if (isCancelVisible) {
50
+ items.push({ id: "cancel", content: renderSlot(slots.Cancel, DefaultCancel, cancelProps) });
51
+ }
52
+ if (isSaveAsVisible) {
53
+ items.push({ id: "saveAs", content: renderSlot(slots.SaveAs, DefaultSaveAs, saveAsProps) });
54
+ }
55
+ if (isSaveVisible) {
56
+ items.push({ id: "save", content: renderSlot(slots.Save, DefaultSave, saveProps) });
57
+ }
58
+ if (isEmbedVisible) {
59
+ items.push({ id: "embed", content: renderSlot(slots.Embed, DefaultEmbed, embedProps) });
60
+ }
61
+ if (isOptionsVisible) {
62
+ items.push({ id: "options", content: renderSlot(slots.Options, DefaultOptions, optionsProps) });
63
+ }
64
+ return renderSlot(slots.EditorActions, DefaultEditorActions, { ...context, items });
65
+ }
66
+ /**
67
+ * Default of the EditorActions slot: the items in their order.
68
+ */
69
+ export function DefaultEditorActions({ items }) {
70
+ return (_jsx(_Fragment, { children: items.map((item) => (_jsx(Fragment, { children: item.content }, item.id))) }));
71
+ }
@@ -1,2 +1,7 @@
1
- export declare function EmbedButton(): import("react/jsx-runtime").JSX.Element;
1
+ import { type IAnalyticalDesignerEmbedProps, type IAnalyticalDesignerHeaderContext } from "../../../embedding/editorHeaderSlotTypes.js";
2
+ export declare function useEmbedProps(context: IAnalyticalDesignerHeaderContext): IAnalyticalDesignerEmbedProps;
3
+ /**
4
+ * Default of the Embed slot: an icon button with a menu of the embedding choices.
5
+ */
6
+ export declare function DefaultEmbed({ label, embedInsightLabel, isEmbedInsightDisabled, embedInsightDisabledReason, documentationLabel, documentationUrl, onEmbedInsight, }: IAnalyticalDesignerEmbedProps): import("react/jsx-runtime").JSX.Element;
2
7
  //# sourceMappingURL=EmbedButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmbedButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Embed/EmbedButton.tsx"],"names":[],"mappings":"AAuCA,wBAAgB,WAAW,4CA6F1B"}
1
+ {"version":3,"file":"EmbedButton.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Embed/EmbedButton.tsx"],"names":[],"mappings":"AAWA,OAAO,EACH,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACxC,MAAM,6CAA6C,CAAC;AAcrD,wBAAgB,aAAa,CAAC,OAAO,EAAE,gCAAgC,GAAG,6BAA6B,CAsCtG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACjB,EAAE,6BAA6B,2CAsC/B"}