@gooddata/sdk-ui-kit 11.69.0-alpha.1 → 11.69.0-alpha.3

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 (43) hide show
  1. package/NOTICE +15 -15
  2. package/esm/@ui/UiConfigEditor/configEditorYamlIndent.js +1 -1
  3. package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.js +3 -2
  4. package/esm/@ui/hooks/useCloseOnEscape.d.ts +2 -0
  5. package/esm/@ui/hooks/useCloseOnEscape.d.ts.map +1 -1
  6. package/esm/@ui/hooks/useCloseOnEscape.js +2 -0
  7. package/esm/Dropdown/DropdownList.d.ts +12 -1
  8. package/esm/Dropdown/DropdownList.d.ts.map +1 -1
  9. package/esm/Dropdown/DropdownList.js +101 -34
  10. package/esm/Header/HeaderWorkspacePicker.d.ts.map +1 -1
  11. package/esm/Header/HeaderWorkspacePicker.js +3 -3
  12. package/esm/Header/HeaderWorkspacePickerItem.d.ts +5 -1
  13. package/esm/Header/HeaderWorkspacePickerItem.d.ts.map +1 -1
  14. package/esm/Header/HeaderWorkspacePickerItem.js +2 -1
  15. package/esm/Header/colors.d.ts +1 -1
  16. package/esm/Header/colors.js +3 -3
  17. package/esm/Messages/toasts/ToastsCenter.d.ts.map +1 -1
  18. package/esm/Messages/toasts/ToastsCenter.js +7 -4
  19. package/esm/RichText/RichText.d.ts +10 -0
  20. package/esm/RichText/RichText.d.ts.map +1 -1
  21. package/esm/RichText/RichText.js +2 -1
  22. package/esm/RichText/plugins/mdast-typed-whitespace.d.ts +27 -0
  23. package/esm/RichText/plugins/mdast-typed-whitespace.d.ts.map +1 -0
  24. package/esm/RichText/plugins/mdast-typed-whitespace.js +115 -0
  25. package/esm/RichText/plugins/remark-markdown-features.d.ts +1 -1
  26. package/esm/RichText/plugins/remark-markdown-features.d.ts.map +1 -1
  27. package/esm/RichText/plugins/remark-markdown-features.js +4 -0
  28. package/esm/measureNumberFormat/validation/currencyFormatValidator.js +2 -2
  29. package/esm/sdk-ui-kit.d.ts +27 -2
  30. package/esm/syntaxHighlightingInput/yamlPosition.js +2 -2
  31. package/esm/utils/domUtilities.d.ts +2 -0
  32. package/esm/utils/domUtilities.d.ts.map +1 -1
  33. package/esm/utils/domUtilities.js +2 -0
  34. package/package.json +12 -11
  35. package/styles/css/header.css +5 -0
  36. package/styles/css/header.css.map +1 -1
  37. package/styles/css/main.css +13 -1
  38. package/styles/css/main.css.map +1 -1
  39. package/styles/css/richText.css +8 -1
  40. package/styles/css/richText.css.map +1 -1
  41. package/styles/icons/file.svg +5 -0
  42. package/styles/scss/header.scss +5 -0
  43. package/styles/scss/richText.scss +13 -1
package/NOTICE CHANGED
@@ -3,11 +3,11 @@ Copyright (c) 2017-2026 GoodData Corporation
3
3
  This product includes a number of subcomponents with separate copyright notices and license terms below. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license. This GoodData project does not necessarily use all the open source software referred to below and may also only use portions of a given package. With respect to the open source software listed in this document, if you (i) have any questions, (ii) wish to receive source code for packages under licenses that require their source code to be made available (such as the GNU Lesser Public License), or (iii) discover any errors or omissions in the licensing information provided, please contact us at legal@gooddata.com. Please identify in source code requests: (i) the packages for which you are requesting corresponding source, (ii) the GoodData product (including any available version) with which the package was provided; and (iii) an email address (if available) or postal address at which GoodData may contact you.
4
4
 
5
5
  --------------------------------------------------------------------------------
6
- Attribution Notice for @gooddata/sdk-ui-kit (11.69.0-alpha.1)
6
+ Attribution Notice for @gooddata/sdk-ui-kit (11.69.0-alpha.3)
7
7
  Package License: MIT
8
8
  Own License File: LICENSE
9
- Date generated: 2026-11-12
10
- Revision ID: c56f4e258b22c698a7b4595c97b12a469452f25a
9
+ Date generated: 2026-11-16
10
+ Revision ID: 916dc843984d70f22c7ba476032676ba4f31a88b
11
11
 
12
12
  This notice lists the components that @gooddata/sdk-ui-kit depends on, directly or through other
13
13
  packages, with the license and copyright information reported for each of them.
@@ -19,12 +19,12 @@ change those terms.
19
19
  Dependencies
20
20
 
21
21
  Local GoodData SDK components
22
- - @gooddata/sdk-backend-spi (11.69.0-alpha.1) [MIT] — Direct
23
- - @gooddata/sdk-code-schemas (11.69.0-alpha.1) [MIT] — Transitive
24
- - @gooddata/sdk-model (11.69.0-alpha.1) [MIT] — Direct
25
- - @gooddata/sdk-ui (11.69.0-alpha.1) [MIT] — Direct
26
- - @gooddata/sdk-ui-theme-provider (11.69.0-alpha.1) [MIT] — Direct
27
- - @gooddata/util (11.69.0-alpha.1) [MIT] — Direct
22
+ - @gooddata/sdk-backend-spi (11.69.0-alpha.3) [MIT] — Direct
23
+ - @gooddata/sdk-code-schemas (11.69.0-alpha.3) [MIT] — Transitive
24
+ - @gooddata/sdk-model (11.69.0-alpha.3) [MIT] — Direct
25
+ - @gooddata/sdk-ui (11.69.0-alpha.3) [MIT] — Direct
26
+ - @gooddata/sdk-ui-theme-provider (11.69.0-alpha.3) [MIT] — Direct
27
+ - @gooddata/util (11.69.0-alpha.3) [MIT] — Direct
28
28
 
29
29
  External components
30
30
  - @aaronhayes/react-use-hubspot-form (2.1.2) [MIT] — Direct
@@ -297,7 +297,7 @@ Local GoodData SDK components
297
297
  ================================================================================
298
298
 
299
299
  --------------------------------------------------------------------------------
300
- Package Title: @gooddata/sdk-backend-spi (11.69.0-alpha.1)
300
+ Package Title: @gooddata/sdk-backend-spi (11.69.0-alpha.3)
301
301
  Package Source: Local workspace
302
302
  Package Depth: Direct
303
303
  --------------------------------------------------------------------------------
@@ -315,7 +315,7 @@ The above copyright notice and this permission notice shall be included in all c
315
315
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
316
316
 
317
317
  --------------------------------------------------------------------------------
318
- Package Title: @gooddata/sdk-code-schemas (11.69.0-alpha.1)
318
+ Package Title: @gooddata/sdk-code-schemas (11.69.0-alpha.3)
319
319
  Package Source: Local workspace
320
320
  Package Depth: Transitive
321
321
  --------------------------------------------------------------------------------
@@ -345,7 +345,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
345
345
  SOFTWARE.
346
346
 
347
347
  --------------------------------------------------------------------------------
348
- Package Title: @gooddata/sdk-model (11.69.0-alpha.1)
348
+ Package Title: @gooddata/sdk-model (11.69.0-alpha.3)
349
349
  Package Source: Local workspace
350
350
  Package Depth: Direct
351
351
  --------------------------------------------------------------------------------
@@ -363,7 +363,7 @@ The above copyright notice and this permission notice shall be included in all c
363
363
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
364
364
 
365
365
  --------------------------------------------------------------------------------
366
- Package Title: @gooddata/sdk-ui (11.69.0-alpha.1)
366
+ Package Title: @gooddata/sdk-ui (11.69.0-alpha.3)
367
367
  Package Source: Local workspace
368
368
  Package Depth: Direct
369
369
  --------------------------------------------------------------------------------
@@ -381,7 +381,7 @@ The above copyright notice and this permission notice shall be included in all c
381
381
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
382
382
 
383
383
  --------------------------------------------------------------------------------
384
- Package Title: @gooddata/sdk-ui-theme-provider (11.69.0-alpha.1)
384
+ Package Title: @gooddata/sdk-ui-theme-provider (11.69.0-alpha.3)
385
385
  Package Source: Local workspace
386
386
  Package Depth: Direct
387
387
  --------------------------------------------------------------------------------
@@ -399,7 +399,7 @@ The above copyright notice and this permission notice shall be included in all c
399
399
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
400
400
 
401
401
  --------------------------------------------------------------------------------
402
- Package Title: @gooddata/util (11.69.0-alpha.1)
402
+ Package Title: @gooddata/util (11.69.0-alpha.3)
403
403
  Package Source: Local workspace
404
404
  Package Depth: Direct
405
405
  --------------------------------------------------------------------------------
@@ -26,7 +26,7 @@ function indentAfterOpenBlock(context, pos) {
26
26
  return undefined;
27
27
  }
28
28
  function opensBlock(text) {
29
- return /^\s*-$/.test(text) || /^\s*(?:-\s+)*("[^"]*"|'[^']*'|[^\s:]+):$/.test(text);
29
+ return /^\s*-$/.test(text) || /^\s*(?:-\s+)*(?:"[^"]*"|'[^']*'|[^\s:]+):$/.test(text);
30
30
  }
31
31
  function blockColumn(text) {
32
32
  return /^\s*(?:-\s+)*/.exec(text)?.[0].length ?? 0;
@@ -209,8 +209,9 @@ function useVirtualList({ items, itemHeight, itemHeightGetter, itemsGap, contain
209
209
  ]);
210
210
  // Add scroll into view effect
211
211
  useEffect(() => {
212
- // Reset the ref when scrollToItem becomes undefined so future scrolls work
213
- if (!scrollToItem) {
212
+ // Reset the ref when scrollToItem becomes undefined so future scrolls work.
213
+ // Items may be falsy (e.g. 0), so only undefined and null mean that no target is set.
214
+ if (scrollToItem === undefined || scrollToItem === null) {
214
215
  prevScrollToItemRef.current = undefined;
215
216
  return;
216
217
  }
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Hook to trigger a callback when pressing the Escape key.
3
3
  *
4
+ * @param isOpen - Whether the listener is active.
5
+ * @param onClose - Called when Escape is pressed.
4
6
  * @param capture - When true, listens in the capture phase and stops propagation, so a nested
5
7
  * overlay can dismiss on Escape without an ancestor (e.g. a Dropdown) also closing.
6
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useCloseOnEscape.d.ts","sourceRoot":"","sources":["../../../src/@ui/hooks/useCloseOnEscape.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,OAAO,UAAQ,GAAG,IAAI,CAkB5F"}
1
+ {"version":3,"file":"useCloseOnEscape.d.ts","sourceRoot":"","sources":["../../../src/@ui/hooks/useCloseOnEscape.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,OAAO,UAAQ,GAAG,IAAI,CAkB5F"}
@@ -3,6 +3,8 @@ import { useEffect } from "react";
3
3
  /**
4
4
  * Hook to trigger a callback when pressing the Escape key.
5
5
  *
6
+ * @param isOpen - Whether the listener is active.
7
+ * @param onClose - Called when Escape is pressed.
6
8
  * @param capture - When true, listens in the capture phase and stops propagation, so a nested
7
9
  * overlay can dismiss on Escape without an ancestor (e.g. a Dropdown) also closing.
8
10
  *
@@ -70,6 +70,17 @@ export interface IDropdownListProps<T> {
70
70
  * `aria-selected` and the `isSelected` render prop.
71
71
  */
72
72
  getIsItemSelected?: (item: T) => boolean;
73
+ /**
74
+ * Returns a key that is unique for each item. When it is provided together with the `listbox` role,
75
+ * the options get unique ids, so that the active option can be exposed by `aria-activedescendant`.
76
+ *
77
+ * @remarks
78
+ * If the search is shown as well, the search input becomes a combobox that drives the listbox:
79
+ * ArrowDown and ArrowUp move the active option and Enter confirms it. Escape clears a typed filter
80
+ * first and closes the dropdown when the filter is empty, as in the other dropdowns.
81
+ * The listbox is then taken out of the Tab order.
82
+ */
83
+ getItemKey?: (item: T) => string;
73
84
  accessibilityConfig?: Pick<IAccessibilityConfigBase, "ariaLabel" | "ariaLabelledBy" | "role">;
74
85
  body?: ReactNode | ((closeDropdown: () => void) => ReactNode);
75
86
  onScroll?: () => void;
@@ -103,5 +114,5 @@ export declare const DEFAULT_MOBILE_ITEM_HEIGHT = 40;
103
114
  * @internal
104
115
  *
105
116
  */
106
- export declare function DropdownList<T>({ id, title, className, tabsClassName, width, height, maxHeight, onKeyDownSelect, onKeyDownConfirm, isMobile, isLoading, items, itemsCount, itemHeight, containerPadding, listPadding, mobileItemHeight, showSearch, disableAutofocus, searchString, searchLabel, searchPlaceholder, searchFieldSize, onSearch, showTabs, tabs, selectedTabId, onTabSelect, renderNoData, footer, closeDropdown, accessibilityConfig, renderItem, body, itemHeightGetter, itemTitleGetter, getIsItemSelected, loadNextPage, hasNextPage, skeletonItemsCount, shouldLoadNextPage, isNextPageLoading, SkeletonItem, onScroll, scrollToItem, scrollToItemKeyExtractor, }: IDropdownListProps<T>): ReactElement;
117
+ export declare function DropdownList<T>({ id, title, className, tabsClassName, width, height, maxHeight, onKeyDownSelect, onKeyDownConfirm, isMobile, isLoading, items, itemsCount, itemHeight, containerPadding, listPadding, mobileItemHeight, showSearch, disableAutofocus, searchString, searchLabel, searchPlaceholder, searchFieldSize, onSearch, showTabs, tabs, selectedTabId, onTabSelect, renderNoData, footer, closeDropdown, accessibilityConfig, renderItem, body, itemHeightGetter, itemTitleGetter, getIsItemSelected, getItemKey, loadNextPage, hasNextPage, skeletonItemsCount, shouldLoadNextPage, isNextPageLoading, SkeletonItem, onScroll, scrollToItem, scrollToItemKeyExtractor, }: IDropdownListProps<T>): ReactElement;
107
118
  //# sourceMappingURL=DropdownList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownList.d.ts","sourceRoot":"","sources":["../../src/Dropdown/DropdownList.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AAKf,OAAO,EACH,KAAK,oCAAoC,EAE5C,MAAM,iDAAiD,CAAC;AASzD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAK5E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,iBAAiB,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB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D;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAoB7C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC5B,EAAE,EACF,KAAK,EACL,SAAc,EACd,aAAkB,EAElB,KAAK,EACL,MAAM,EACN,SAAS,EAET,eAAe,EACf,gBAAgB,EAEhB,QAAQ,EACR,SAAS,EAET,KAAU,EACV,UAAyB,EACzB,UAAgC,EAChC,gBAAoB,EACpB,WAAW,EACX,gBAA6C,EAE7C,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,QAAQ,EAER,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,WAAW,EAEX,YAA4B,EAC5B,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,kBAAsB,EACtB,kBAAkB,EAClB,iBAAyB,EACzB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,wBAAwB,GAC3B,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,YAAY,CAiNtC"}
1
+ {"version":3,"file":"DropdownList.d.ts","sourceRoot":"","sources":["../../src/Dropdown/DropdownList.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AAOf,OAAO,EACH,KAAK,oCAAoC,EAE5C,MAAM,iDAAiD,CAAC;AASzD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAM5E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IA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AAkB,CAAC,CAAC,CAAC,GAAG,YAAY,CAoStC"}
@@ -3,6 +3,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
3
3
  import { Fragment, useCallback, useEffect, useState, } from "react";
4
4
  import cx from "classnames";
5
5
  import { useIntl } from "react-intl";
6
+ import { SELECT_ITEM_ACTION } from "../@ui/hooks/useListWithActionsKeyboardNavigation.js";
7
+ import { ScopedIdStore, useScopedIdStoreValue } from "../@ui/hooks/useScopedId.js";
6
8
  import { UiPagedVirtualList, } from "../@ui/UiPagedVirtualList/UiPagedVirtualList.js";
7
9
  import { DETAILED_ANNOUNCEMENT_THRESHOLD, UiSearchResultsAnnouncement, } from "../@ui/UiSearchResultsAnnouncement/UiSearchResultsAnnouncement.js";
8
10
  import { AutoSize } from "../AutoSize/AutoSize.js";
@@ -10,6 +12,7 @@ import { Input } from "../Form/Input.js";
10
12
  import { LoadingMask } from "../LoadingMask/LoadingMask.js";
11
13
  import { NoData } from "../NoData/NoData.js";
12
14
  import { isTypingKey } from "../utils/events.js";
15
+ import { useIdPrefixed } from "../utils/useId.js";
13
16
  import { DropdownTabs } from "./DropdownTabs.js";
14
17
  /**
15
18
  * @internal
@@ -35,7 +38,7 @@ const defaultNoData = (props) => {
35
38
  * @internal
36
39
  *
37
40
  */
38
- export function DropdownList({ id, title, className = "", tabsClassName = "", width, height, maxHeight, onKeyDownSelect, onKeyDownConfirm, isMobile, isLoading, items = [], itemsCount = items.length, itemHeight = DEFAULT_ITEM_HEIGHT, containerPadding = 0, listPadding, mobileItemHeight = DEFAULT_MOBILE_ITEM_HEIGHT, showSearch, disableAutofocus, searchString, searchLabel, searchPlaceholder, searchFieldSize, onSearch, showTabs, tabs, selectedTabId, onTabSelect, renderNoData = defaultNoData, footer, closeDropdown, accessibilityConfig, renderItem, body, itemHeightGetter, itemTitleGetter, getIsItemSelected, loadNextPage, hasNextPage, skeletonItemsCount = 0, shouldLoadNextPage, isNextPageLoading = false, SkeletonItem, onScroll, scrollToItem, scrollToItemKeyExtractor, }) {
41
+ export function DropdownList({ id, title, className = "", tabsClassName = "", width, height, maxHeight, onKeyDownSelect, onKeyDownConfirm, isMobile, isLoading, items = [], itemsCount = items.length, itemHeight = DEFAULT_ITEM_HEIGHT, containerPadding = 0, listPadding, mobileItemHeight = DEFAULT_MOBILE_ITEM_HEIGHT, showSearch, disableAutofocus, searchString, searchLabel, searchPlaceholder, searchFieldSize, onSearch, showTabs, tabs, selectedTabId, onTabSelect, renderNoData = defaultNoData, footer, closeDropdown, accessibilityConfig, renderItem, body, itemHeightGetter, itemTitleGetter, getIsItemSelected, getItemKey, loadNextPage, hasNextPage, skeletonItemsCount = 0, shouldLoadNextPage, isNextPageLoading = false, SkeletonItem, onScroll, scrollToItem, scrollToItemKeyExtractor, }) {
39
42
  const [currentSearchString, setCurrentSearchString] = useState(searchString);
40
43
  const hasNoData = !isLoading && itemsCount === 0;
41
44
  const hasNoMatchingData = hasNoData && !!currentSearchString;
@@ -60,10 +63,62 @@ export function DropdownList({ id, title, className = "", tabsClassName = "", wi
60
63
  }
61
64
  return body;
62
65
  };
66
+ const hasOptionIds = accessibilityConfig?.role === "listbox" && !!getItemKey;
67
+ const isCombobox = !!showSearch && hasOptionIds;
68
+ const isListShown = !isLoading && itemsCount > 0;
69
+ const listboxId = useIdPrefixed("dropdown-listbox");
70
+ const scopedIdStoreValue = useScopedIdStoreValue(getItemKey ?? String);
71
+ const [activeItemKey, setActiveItemKey] = useState(undefined);
72
+ const activeIndex = isCombobox && isListShown && activeItemKey !== undefined
73
+ ? items.findIndex((item) => item !== undefined && item !== null && getItemKey(item) === activeItemKey)
74
+ : -1;
75
+ // items may be falsy (e.g. 0), so the presence of the active item is checked by its index
76
+ const hasActiveItem = activeIndex >= 0;
77
+ const activeItem = hasActiveItem ? items[activeIndex] : undefined;
63
78
  const onChange = useCallback((search) => {
64
79
  onSearch?.(search.toString());
65
80
  setCurrentSearchString(search.toString());
81
+ setActiveItemKey(undefined);
66
82
  }, [onSearch]);
83
+ const moveActiveItem = (direction) => {
84
+ const loadedCount = items.length;
85
+ if (!isListShown || loadedCount === 0) {
86
+ return;
87
+ }
88
+ let nextIndex;
89
+ if (direction === "next") {
90
+ const isLast = activeIndex >= loadedCount - 1;
91
+ // when more items can be loaded, stay on the last one; showing it loads the next page
92
+ nextIndex = isLast ? (hasNextPage ? activeIndex : 0) : activeIndex + 1;
93
+ }
94
+ else {
95
+ nextIndex = activeIndex <= 0 ? loadedCount - 1 : activeIndex - 1;
96
+ }
97
+ const nextItem = items[nextIndex];
98
+ if (nextItem !== undefined && nextItem !== null) {
99
+ setActiveItemKey(getItemKey(nextItem));
100
+ }
101
+ };
102
+ const onSearchKeyDown = (e) => {
103
+ if (isCombobox && !e.nativeEvent.isComposing) {
104
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
105
+ e.preventDefault();
106
+ e.stopPropagation();
107
+ moveActiveItem(e.key === "ArrowDown" ? "next" : "previous");
108
+ return;
109
+ }
110
+ // only Enter in the input itself; Enter on the clear button must still clear the filter
111
+ if (e.key === "Enter" && hasActiveItem && e.target instanceof HTMLInputElement) {
112
+ e.preventDefault();
113
+ e.stopPropagation();
114
+ (onKeyDownConfirm ?? onKeyDownSelect)?.(activeItem);
115
+ return;
116
+ }
117
+ }
118
+ if (isTypingKey(e)) {
119
+ e.stopPropagation();
120
+ }
121
+ };
67
122
  const searchFilled = (currentSearchString ?? "").length > 0;
68
123
  const onEscKeyPress = useCallback((e) => {
69
124
  if (searchFilled) {
@@ -77,13 +132,23 @@ export function DropdownList({ id, title, className = "", tabsClassName = "", wi
77
132
  // update string if dropdown is not getting unmounted on close to not have previous search on re-open
78
133
  setCurrentSearchString(searchString);
79
134
  }, [searchString]);
80
- return (_jsxs(Fragment, { children: [title ? _jsx("div", { className: "gd-list-title", children: title }) : null, showSearch ? (_jsxs(_Fragment, { children: [_jsx("div", { style: searchWrapperStyle, onKeyDown: (e) => {
81
- if (isTypingKey(e)) {
82
- e.stopPropagation();
83
- }
84
- }, children: _jsx(Input, { className: searchFieldClassNames, value: currentSearchString, onChange: onChange, isSmall: searchFieldSize === "small", placeholder: searchPlaceholder, clearOnEsc: true, onEscKeyPress: onEscKeyPress, isSearch: true, autofocus: !disableAutofocus, accessibilityConfig: {
85
- ariaLabel: searchLabel,
86
- } }) }), _jsx(UiSearchResultsAnnouncement, { totalResults: currentSearchString ? itemsCount : undefined, resultValues: itemsCount <= DETAILED_ANNOUNCEMENT_THRESHOLD && itemTitleGetter
135
+ return (_jsxs(Fragment, { children: [title ? _jsx("div", { className: "gd-list-title", children: title }) : null, showSearch ? (_jsxs(_Fragment, { children: [_jsx("div", { style: searchWrapperStyle, onKeyDown: onSearchKeyDown, children: _jsx(Input, { className: searchFieldClassNames, value: currentSearchString, onChange: onChange, isSmall: searchFieldSize === "small", placeholder: searchPlaceholder, clearOnEsc: true, onEscKeyPress: onEscKeyPress, isSearch: true, autofocus: !disableAutofocus, accessibilityConfig: isCombobox
136
+ ? {
137
+ ariaLabel: searchLabel,
138
+ role: "combobox",
139
+ ariaExpanded: isListShown,
140
+ ariaControls: isListShown ? listboxId : undefined,
141
+ ariaAutocomplete: "list",
142
+ ariaActiveDescendant: hasActiveItem
143
+ ? scopedIdStoreValue.makeId({
144
+ item: activeItem,
145
+ specifier: SELECT_ITEM_ACTION,
146
+ })
147
+ : undefined,
148
+ }
149
+ : {
150
+ ariaLabel: searchLabel,
151
+ } }) }), _jsx(UiSearchResultsAnnouncement, { totalResults: currentSearchString ? itemsCount : undefined, resultValues: itemsCount <= DETAILED_ANNOUNCEMENT_THRESHOLD && itemTitleGetter
87
152
  ? items.map(itemTitleGetter)
88
153
  : undefined })] })) : null, showTabs ? (_jsx(DropdownTabs, { tabs: tabs, selectedTabId: selectedTabId, onTabSelect: onTabSelect, className: tabsClassName })) : null, renderBody(), hasNoData ? (_jsx("div", { style: { width: isMobile ? "auto" : width }, children: renderNoData({ hasNoMatchingData }) })) : null, isLoading ? _jsx(LoadingMask, { width: isMobile ? "100%" : width, height: LOADING_HEIGHT }) : null, !isLoading && itemsCount > 0 ? (_jsx(AutoSize, { children: (autoSize) => {
89
154
  const listWidth = isMobile ? autoSize.width : (width ?? (autoSize.width || 200));
@@ -92,6 +157,33 @@ export function DropdownList({ id, title, className = "", tabsClassName = "", wi
92
157
  ? Math.max(mobileItemHeight, itemHeight)
93
158
  : itemHeight;
94
159
  const effectiveMaxHeight = maxHeight || listHeight || 300;
160
+ const list = (_jsx(UiPagedVirtualList, { maxHeight: effectiveMaxHeight, items: items, itemHeight: effectiveItemHeight, itemsGap: 0, itemPadding: 0, containerPadding: containerPadding, listPadding: listPadding, onKeyDownSelect: onKeyDownSelect, onKeyDownConfirm: onKeyDownConfirm, closeDropdown: closeDropdown, itemHeightGetter: itemHeightGetter, getIsItemSelected: getIsItemSelected, hasNextPage: hasNextPage, loadNextPage: loadNextPage, skeletonItemsCount: skeletonItemsCount, SkeletonItem: SkeletonItem, shouldLoadNextPage: shouldLoadNextPage, isLoading: isNextPageLoading, onScroll: onScroll, scrollToItem: hasActiveItem ? activeItem : scrollToItem, scrollToItemKeyExtractor: hasActiveItem ? getItemKey : scrollToItemKeyExtractor,
161
+ // the combobox drives the listbox, so the listbox is out of the Tab order
162
+ tabIndex: isCombobox ? -1 : undefined, focusedItem: activeItem, representAs: accessibilityConfig?.role === "listbox"
163
+ ? "listbox"
164
+ : accessibilityConfig?.role === "list"
165
+ ? "list"
166
+ : undefined, listboxProps: accessibilityConfig?.role === "listbox" ||
167
+ accessibilityConfig?.role === "list"
168
+ ? {
169
+ id: isCombobox ? listboxId : undefined,
170
+ "aria-label": accessibilityConfig?.ariaLabel,
171
+ "aria-labelledby": accessibilityConfig?.ariaLabelledBy,
172
+ }
173
+ : undefined, children: (item) => {
174
+ const rowIndex = items.indexOf(item);
175
+ const rowHeight = itemHeightGetter?.(rowIndex) ?? effectiveItemHeight;
176
+ return renderItem({
177
+ rowIndex,
178
+ item,
179
+ width: listWidth,
180
+ height: rowHeight,
181
+ isFirst: rowIndex === 0,
182
+ isLast: rowIndex === itemsCount - 1,
183
+ focused: isCombobox ? rowIndex === activeIndex : undefined,
184
+ isSelected: getIsItemSelected?.(item),
185
+ });
186
+ } }));
95
187
  return (_jsx("div", { "data-testid": "gd-dropdown-list", id: id, style: { width: listWidth }, className: listClassNames, role: accessibilityConfig?.role === "listbox" ||
96
188
  accessibilityConfig?.role === "list"
97
189
  ? undefined
@@ -101,31 +193,6 @@ export function DropdownList({ id, title, className = "", tabsClassName = "", wi
101
193
  : accessibilityConfig?.ariaLabel, "aria-labelledby": accessibilityConfig?.role === "listbox" ||
102
194
  accessibilityConfig?.role === "list"
103
195
  ? undefined
104
- : accessibilityConfig?.ariaLabelledBy, children: _jsx(UiPagedVirtualList, { maxHeight: effectiveMaxHeight, items: items, itemHeight: effectiveItemHeight, itemsGap: 0, itemPadding: 0, containerPadding: containerPadding, listPadding: listPadding, onKeyDownSelect: onKeyDownSelect, onKeyDownConfirm: onKeyDownConfirm, closeDropdown: closeDropdown, itemHeightGetter: itemHeightGetter, getIsItemSelected: getIsItemSelected, hasNextPage: hasNextPage, loadNextPage: loadNextPage, skeletonItemsCount: skeletonItemsCount, SkeletonItem: SkeletonItem, shouldLoadNextPage: shouldLoadNextPage, isLoading: isNextPageLoading, onScroll: onScroll, scrollToItem: scrollToItem, scrollToItemKeyExtractor: scrollToItemKeyExtractor, representAs: accessibilityConfig?.role === "listbox"
105
- ? "listbox"
106
- : accessibilityConfig?.role === "list"
107
- ? "list"
108
- : undefined, listboxProps: accessibilityConfig?.role === "listbox" ||
109
- accessibilityConfig?.role === "list"
110
- ? {
111
- "aria-label": accessibilityConfig?.ariaLabel,
112
- "aria-labelledby": accessibilityConfig?.ariaLabelledBy,
113
- }
114
- : undefined, children: (item) => {
115
- const rowIndex = items.indexOf(item);
116
- const rowHeight = itemHeightGetter?.(rowIndex) ?? effectiveItemHeight;
117
- const listWidth = isMobile
118
- ? autoSize.width
119
- : (width ?? (autoSize.width || 200));
120
- return renderItem({
121
- rowIndex,
122
- item,
123
- width: listWidth,
124
- height: rowHeight,
125
- isFirst: rowIndex === 0,
126
- isLast: rowIndex === itemsCount - 1,
127
- isSelected: getIsItemSelected?.(item),
128
- });
129
- } }) }));
196
+ : accessibilityConfig?.ariaLabelledBy, children: hasOptionIds ? (_jsx(ScopedIdStore, { value: scopedIdStoreValue, children: list })) : (list) }));
130
197
  } })) : null, renderFooter()] }));
131
198
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderWorkspacePicker.d.ts","sourceRoot":"","sources":["../../src/Header/HeaderWorkspacePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBvC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACrC,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C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S,CAAC;IAEhC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3G;AA4BD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAElB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACrB,EAAE,2BAA2B,2CAqI7B"}
@@ -55,12 +55,12 @@ loadNextPage, hasNextPage, skeletonItemsCount, isNextPageLoading, shouldLoadNext
55
55
  id: "gs.header.projectPicker.searchPlaceholder.aria",
56
56
  }), renderNoData: ({ hasNoMatchingData }) => (_jsx(NoData, { className: "s-noMatchingProjects", noDataLabel: intl.formatMessage({ id: "gs.noData.noDataAvailable" }), notFoundLabel: intl.formatMessage({
57
57
  id: "gs.header.projectPicker.noMatchingWorkspaces",
58
- }), hasNoMatchingData: hasNoMatchingData })), renderItem: ({ item }) => {
58
+ }), hasNoMatchingData: hasNoMatchingData })), renderItem: ({ item, focused }) => {
59
59
  const title = item?.title;
60
60
  const isDemo = item?.isDemo;
61
61
  const workspaceId = item?.id;
62
62
  const isSelected = selectedWorkspace?.id === item?.id;
63
- return (_jsx(HeaderWorkspacePickerItem, { workspaceId: workspaceId, title: title, isDemo: isDemo, isSelected: isSelected, isLoading: !item, onClick: () => {
63
+ return (_jsx(HeaderWorkspacePickerItem, { workspaceId: workspaceId, title: title, isDemo: isDemo, isSelected: isSelected, isFocused: focused, isLoading: !item, onClick: () => {
64
64
  if (item && onSelect) {
65
65
  onSelect(item);
66
66
  closeDropdown();
@@ -71,7 +71,7 @@ loadNextPage, hasNextPage, skeletonItemsCount, isNextPageLoading, shouldLoadNext
71
71
  onSelect(item);
72
72
  closeDropdown();
73
73
  }
74
- }, itemTitleGetter: (item) => item?.title || item?.id || "", accessibilityConfig: {
74
+ }, itemTitleGetter: (item) => item?.title || item?.id || "", getItemKey: (item) => item.id, getIsItemSelected: (item) => !!item && selectedWorkspace?.id === item.id, accessibilityConfig: {
75
75
  role: "listbox",
76
76
  ariaLabel: intl.formatMessage({ id: "gs.header.projectPicker.workspaces" }),
77
77
  } }) })) }));
@@ -4,8 +4,12 @@ export interface IHeaderWorkspacePickerItemProps {
4
4
  workspaceId: string;
5
5
  isDemo?: boolean;
6
6
  isSelected?: boolean;
7
+ /**
8
+ * The item is the active option of the workspace search combobox.
9
+ */
10
+ isFocused?: boolean;
7
11
  isLoading?: boolean;
8
12
  onClick: (e: MouseEvent<HTMLButtonElement>) => void;
9
13
  }
10
- export declare function HeaderWorkspacePickerItem({ workspaceId, title, isLoading, isSelected, isDemo, onClick, }: IHeaderWorkspacePickerItemProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function HeaderWorkspacePickerItem({ workspaceId, title, isLoading, isSelected, isFocused, isDemo, onClick, }: IHeaderWorkspacePickerItemProps): import("react/jsx-runtime").JSX.Element;
11
15
  //# sourceMappingURL=HeaderWorkspacePickerItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderWorkspacePickerItem.d.ts","sourceRoot":"","sources":["../../src/Header/HeaderWorkspacePickerItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAOxC,MAAM,WAAW,+BAA+B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACvD;AAED,wBAAgB,yBAAyB,CAAC,EACtC,WAAW,EACX,KAAK,EACL,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,GACV,EAAE,+BAA+B,2CA+BjC"}
1
+ {"version":3,"file":"HeaderWorkspacePickerItem.d.ts","sourceRoot":"","sources":["../../src/Header/HeaderWorkspacePickerItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAOxC,MAAM,WAAW,+BAA+B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACvD;AAED,wBAAgB,yBAAyB,CAAC,EACtC,WAAW,EACX,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,GACV,EAAE,+BAA+B,2CAgCjC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import cx from "classnames";
3
3
  import { useIntl } from "react-intl";
4
4
  import { simplifyText } from "@gooddata/util";
5
- export function HeaderWorkspacePickerItem({ workspaceId, title, isLoading, isSelected, isDemo, onClick, }) {
5
+ export function HeaderWorkspacePickerItem({ workspaceId, title, isLoading, isSelected, isFocused, isDemo, onClick, }) {
6
6
  const intl = useIntl();
7
7
  const t = intl.formatMessage;
8
8
  if (isLoading) {
@@ -13,6 +13,7 @@ export function HeaderWorkspacePickerItem({ workspaceId, title, isLoading, isSel
13
13
  "gd-project-list-item": true,
14
14
  [`s-${simplifyText(title)}`]: true,
15
15
  "gd-is-selected": isSelected,
16
+ "is-focused": isFocused,
16
17
  "gd-is-demo": isDemo,
17
18
  });
18
19
  const workspaceTitle = title || workspaceId;
@@ -20,7 +20,7 @@ export declare function luminanceOf(color: IRgbaColor): number;
20
20
  * Function that chooses from two colors based on luminance
21
21
  * of control color. This luminance is compared to specified threshold value.
22
22
  *
23
- * @param color - color as a String
23
+ * @param hexColor - color as a hex String
24
24
  * @param threshold - Luminance threshold value in interval 1 - 255
25
25
  * @param dark - Dark color variant for when control color luminance is higher than threshold
26
26
  * @param light - Light color variant for when control color luminance is lower or equal than threshold
@@ -1,7 +1,7 @@
1
- // (C) 2020-2025 GoodData Corporation
1
+ // (C) 2020-2026 GoodData Corporation
2
2
  import { GD_COLOR_HIGHLIGHT } from "../utils/constants.js";
3
3
  const HEX3_REGEX = /^#([\da-f])([\da-f])([\da-f])/i;
4
- const HEX6_REGEX = /^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})/;
4
+ const HEX6_REGEX = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})/i;
5
5
  /**
6
6
  * Helper function that transforms any string representation of a color
7
7
  * into dojo.Color object.
@@ -43,7 +43,7 @@ export function luminanceOf(color) {
43
43
  * Function that chooses from two colors based on luminance
44
44
  * of control color. This luminance is compared to specified threshold value.
45
45
  *
46
- * @param color - color as a String
46
+ * @param hexColor - color as a hex String
47
47
  * @param threshold - Luminance threshold value in interval 1 - 255
48
48
  * @param dark - Dark color variant for when control color luminance is higher than threshold
49
49
  * @param light - Light color variant for when control color luminance is lower or equal than threshold
@@ -1 +1 @@
1
- {"version":3,"file":"ToastsCenter.d.ts","sourceRoot":"","sources":["../../../src/Messages/toasts/ToastsCenter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAU7E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EACzB,kBAAkB,GACrB,EAAE;IACC,2FAA2F;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,kDA2BA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,4CAShC;AAwFD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,EACxC,6BAA6B,EAC7B,kBAAkB,EAClB,QAAQ,GACX,EAAE;IACC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACvB,2CAQA"}
1
+ {"version":3,"file":"ToastsCenter.d.ts","sourceRoot":"","sources":["../../../src/Messages/toasts/ToastsCenter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAU7E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EACzB,kBAAkB,GACrB,EAAE;IACC,2FAA2F;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,kDA2BA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,4CAoBhC;AA6FD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,EACxC,6BAA6B,EAC7B,kBAAkB,EAClB,QAAQ,GACX,EAAE;IACC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACvB,2CAQA"}
@@ -30,8 +30,11 @@ export function ToastsCenter({ containerClassName, }) {
30
30
  */
31
31
  export function ScreenReaderToast() {
32
32
  const latestMessage = ToastsCenterContext.useContextStoreOptional((ctx) => ctx.latestMessage);
33
- const messageForScreenReader = useMessageForScreenReader(latestMessage);
34
- return (_jsx("div", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: messageForScreenReader }));
33
+ // the text with the type it was shown for, so a region never gets the text of the previous message
34
+ const { text, type } = useMessageForScreenReader(latestMessage);
35
+ // an error interrupts the reading, the other messages wait for it to pause
36
+ const isError = type === "error";
37
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: isError ? null : text }), isError && text ? (_jsx("div", { className: "sr-only", role: "alert", "aria-live": "assertive", "aria-atomic": "true", children: text })) : null] }));
35
38
  }
36
39
  // Our silent characters: different kinds of spaces. See https://en.wikipedia.org/wiki/Whitespace_character.
37
40
  const SILENT_CHARACTERS = [" ", " ", " ", " ", " ", " "];
@@ -47,7 +50,7 @@ const MESSAGE_FRESH_TIME = 1000; // ms
47
50
  * We cycle through the silent characters to make sure each new message is unique to the one before it.
48
51
  */
49
52
  function useMessageForScreenReader(message) {
50
- const [displayedMessage, setDisplayedMessage] = useState("");
53
+ const [displayedMessage, setDisplayedMessage] = useState({ text: "" });
51
54
  // Do not read the old existing message on the first render.
52
55
  // There is an exception to this, if the message is fresh, we still want to read it.
53
56
  // This can happen when a new message is added and a new dialog is opened immediately.
@@ -66,7 +69,7 @@ function useMessageForScreenReader(message) {
66
69
  // Support both text and node content for screen readers
67
70
  // when we pass parameters (like count), the toast system stores the formatted content in message.node instead.
68
71
  const messageContent = message.text || (typeof message.node === "string" ? message.node : "");
69
- setDisplayedMessage(augmentWithSilentCharacter(messageContent));
72
+ setDisplayedMessage({ text: augmentWithSilentCharacter(messageContent), type: message.type });
70
73
  }, [message]);
71
74
  return displayedMessage;
72
75
  }
@@ -27,6 +27,16 @@ export interface IRichTextProps {
27
27
  * `html` only governs whether HTML syntax is *recognised*, which affects block structure.
28
28
  * A tag is rendered as the characters that were typed either way — there is no `rehype-raw`.
29
29
  *
30
+ * `typedWhitespace` keeps the whitespace CommonMark drops. Blank lines at the start and the end
31
+ * of the text, every blank line beyond the first between two blocks, and every line of text
32
+ * that holds only blank lines or spaces become `.gd-rich-text-blank-line` elements one line
33
+ * tall, which this component's stylesheet lays out. Spaces and newlines inside paragraphs and
34
+ * headings, and the indentation of a paragraph's lines, stay in the text, but only show where
35
+ * the host lays that text out with `white-space: pre-wrap`: in paragraphs, headings and list
36
+ * items that hold only inline text, not in a list item that holds blocks, whose newlines sit
37
+ * between the blocks. The host must also hide `<br>`, which arrives followed by a newline of
38
+ * its own and would break the line twice. Blank lines between list items are not kept.
39
+ *
30
40
  * Applies to `renderMode="view"`; the editor takes whatever is typed either way.
31
41
  */
32
42
  allowedMarkdown?: readonly RichTextFeature[];
@@ -1 +1 @@
1
- {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/RichText/RichText.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,aAAa,EAGlB,KAAK,YAAY,EAIpB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,EAAiC,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAItG,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,uCAAuC,CAAC;AAwBrG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,U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,gBAAgB,CAAC,EAAE,aAAa,CAAC;CACpC;AA6OD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,2CAM7C"}
@@ -6,6 +6,7 @@ import { useIntl } from "react-intl";
6
6
  import Markdown from "react-markdown";
7
7
  import { IntlWrapper, LoadingComponent } from "@gooddata/sdk-ui";
8
8
  import { useEvaluatedReferences } from "./hooks/useEvaluatedReferences.js";
9
+ import { TYPED_WHITESPACE_TO_HAST } from "./plugins/mdast-typed-whitespace.js";
9
10
  import { rehypeReferences } from "./plugins/rehype-references.js";
10
11
  import { remarkMarkdownFeatures } from "./plugins/remark-markdown-features.js";
11
12
  import { remarkReferences } from "./plugins/remark-references.js";
@@ -106,7 +107,7 @@ function RichTextView({ value, referencesEnabled, allowedMarkdown, emptyElement,
106
107
  if (loading) {
107
108
  return _jsx(LoadingComponent, {});
108
109
  }
109
- return (_jsx(Markdown, { components: components, remarkPlugins: [
110
+ return (_jsx(Markdown, { components: components, remarkRehypeOptions: allowedMarkdown?.includes("typedWhitespace") ? TYPED_WHITESPACE_TO_HAST : undefined, remarkPlugins: [
110
111
  ...(allowedMarkdown === undefined ? [] : [remarkMarkdownFeatures(allowedMarkdown)]),
111
112
  ...(referencesEnabled ? [remarkReferences()] : []),
112
113
  ], rehypePlugins: referencesEnabled
@@ -0,0 +1,27 @@
1
+ import { type Data, type Node } from "mdast";
2
+ import { type Options as MarkdownOptions } from "react-markdown";
3
+ import { type Data as ProcessorData } from "unified";
4
+ type FromMarkdownExtension = Exclude<NonNullable<ProcessorData["fromMarkdownExtensions"]>[number], unknown[]>;
5
+ type ToHastOptions = NonNullable<MarkdownOptions["remarkRehypeOptions"]>;
6
+ interface IBlankLineData extends Data {
7
+ hName?: string;
8
+ hProperties?: {
9
+ className: string[];
10
+ };
11
+ }
12
+ interface IBlankLine extends Node {
13
+ type: "blankLine";
14
+ data?: IBlankLineData;
15
+ }
16
+ declare module "mdast" {
17
+ interface BlockContentMap {
18
+ blankLine: IBlankLine;
19
+ }
20
+ interface RootContentMap {
21
+ blankLine: IBlankLine;
22
+ }
23
+ }
24
+ export declare const TYPED_WHITESPACE_TO_HAST: ToHastOptions;
25
+ export declare function typedWhitespace(): FromMarkdownExtension;
26
+ export {};
27
+ //# sourceMappingURL=mdast-typed-whitespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdast-typed-whitespace.d.ts","sourceRoot":"","sources":["../../../src/RichText/plugins/mdast-typed-whitespace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAuD,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,KAAK,OAAO,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,KAAK,IAAI,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAErD,KAAK,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAI9G,KAAK,aAAa,GAAG,WAAW,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAMzE,UAAU,cAAe,SAAQ,IAAI;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACzC;AAID,UAAU,UAAW,SAAQ,IAAI;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,OAAO,QAAQ,OAAO,CAAC;IAEnB,UAAU,eAAe;QACrB,SAAS,EAAE,UAAU,CAAC;KACzB;IAGD,UAAU,cAAc;QACpB,SAAS,EAAE,UAAU,CAAC;KACzB;CACJ;AAqFD,eAAO,MAAM,wBAAwB,EAAE,aAAqD,CAAC;AAE7F,wBAAgB,eAAe,IAAI,qBAAqB,CAuCvD"}