@pega/cosmos-react-core 5.0.0-dev.2.1 → 5.0.0-dev.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AIButton/AIButton.d.ts +1 -1
- package/lib/components/Actions/Actions.d.ts +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +4 -2
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +2 -1
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.js +2 -2
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +10 -11
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +11 -15
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts +2 -0
- package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.test-ids.js +3 -0
- package/lib/components/Avatar/Avatar.test-ids.js.map +1 -0
- package/lib/components/Backdrop/Backdrop.d.ts +6 -4
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +7 -5
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts +2 -0
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -0
- package/lib/components/Backdrop/Backdrop.test-ids.js +3 -0
- package/lib/components/Backdrop/Backdrop.test-ids.js.map +1 -0
- package/lib/components/Badges/Alert.d.ts +7 -5
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js +7 -3
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Badges/Badges.test-ids.d.ts +7 -0
- package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -0
- package/lib/components/Badges/Badges.test-ids.js +8 -0
- package/lib/components/Badges/Badges.test-ids.js.map +1 -0
- package/lib/components/Badges/Count.d.ts +5 -3
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +7 -4
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts +5 -3
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +7 -3
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts +6 -4
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +7 -5
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +7 -5
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +7 -4
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.d.ts +6 -4
- package/lib/components/Badges/Tag.d.ts.map +1 -1
- package/lib/components/Badges/Tag.js +7 -4
- package/lib/components/Badges/Tag.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +27 -16
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +2 -2
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +47 -29
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js +1 -7
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -5
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -10
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +1 -12
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +19 -9
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +49 -27
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +2 -13
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DangerButton/DangerButton.d.ts +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +1 -12
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +26 -20
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +1 -12
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +2 -11
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +1 -11
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +1 -11
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -12
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +1 -11
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/Drawer/Drawer.js +1 -1
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +1 -5
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +1 -11
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +1 -1
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js +15 -11
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/Form/Form.d.ts +6 -4
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +7 -4
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/Form/Form.test-ids.d.ts +2 -0
- package/lib/components/Form/Form.test-ids.d.ts.map +1 -0
- package/lib/components/Form/Form.test-ids.js +3 -0
- package/lib/components/Form/Form.test-ids.js.map +1 -0
- package/lib/components/HTML/HTML.d.ts +6 -4
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js +7 -4
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts +2 -0
- package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -0
- package/lib/components/HTML/HTML.test-ids.js +3 -0
- package/lib/components/HTML/HTML.test-ids.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts +37 -8
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +98 -11
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/{flag-solid.icon.d.ts → flag-wave-solid.icon.d.ts} +2 -2
- package/lib/components/Icon/streamline-icons/flag-wave-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/{flag-solid.icon.js → flag-wave-solid.icon.js} +2 -2
- package/lib/components/Icon/streamline-icons/flag-wave-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/{flag.icon.d.ts → flag-wave.icon.d.ts} +2 -2
- package/lib/components/Icon/streamline-icons/flag-wave.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/{flag.icon.js → flag-wave.icon.js} +2 -2
- package/lib/components/Icon/streamline-icons/flag-wave.icon.js.map +1 -0
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +2 -2
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +2 -27
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +4 -2
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +11 -9
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +3 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +2 -0
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.test-ids.js +12 -0
- package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts +2 -2
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +6 -4
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +8 -6
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.test-ids.d.ts +2 -0
- package/lib/components/Link/Link.test-ids.d.ts.map +1 -0
- package/lib/components/Link/Link.test-ids.js +7 -0
- package/lib/components/Link/Link.test-ids.js.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +10 -8
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +1 -6
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +3 -30
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +3 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +2 -2
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.js +1 -2
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +3 -15
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +1 -12
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +3 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -8
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +2 -2
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +69 -19
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +4 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +1 -14
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +2 -12
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +2 -30
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +4 -2
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +18 -16
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts +2 -0
- package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -0
- package/lib/components/Toaster/Toaster.test-ids.js +3 -0
- package/lib/components/Toaster/Toaster.test-ids.js.map +1 -0
- package/lib/components/Toaster/Toaster.types.d.ts +2 -1
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +6 -4
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +7 -5
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts +2 -0
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -0
- package/lib/components/Tooltip/Tooltip.test-ids.js +3 -0
- package/lib/components/Tooltip/Tooltip.test-ids.js.map +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts +5 -3
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
- package/lib/components/Tree/Tree.d.ts +6 -4
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.js +7 -3
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/Tree.test-ids.d.ts +3 -0
- package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -0
- package/lib/components/Tree/Tree.test-ids.js +4 -0
- package/lib/components/Tree/Tree.test-ids.js.map +1 -0
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +4 -1
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +38 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +38 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +40 -1
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +38 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/theme/theme.d.ts +37 -6
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +12 -4
- package/lib/theme/themeOverrides.schema.json +22 -3
- package/lib/theme/themes/aries2023DarkTheme.json +1 -3
- package/lib/theme/themes/aries2023Theme.json +1 -1
- package/lib/theme/themes/darkTheme.json +1 -3
- package/package.json +6 -6
- package/lib/components/Icon/streamline-icons/flag-solid.icon.d.ts.map +0 -1
- package/lib/components/Icon/streamline-icons/flag-solid.icon.js.map +0 -1
- package/lib/components/Icon/streamline-icons/flag.icon.d.ts.map +0 -1
- package/lib/components/Icon/streamline-icons/flag.icon.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getTreeTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
2
|
+
export declare const getStandardTreeTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
3
|
+
//# sourceMappingURL=Tree.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iFAAqC,CAAC;AAEjE,eAAO,MAAM,sBAAsB,iFAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.test-ids.js","sourceRoot":"","sources":["../../../src/components/Tree/Tree.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,EAAE,EAAW,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC,eAAe,EAAE,EAAW,CAAC,CAAC","sourcesContent":["import { createTestIds } from '../../utils';\n\nexport const getTreeTestIds = createTestIds('tree', [] as const);\n\nexport const getStandardTreeTestIds = createTestIds('standard-tree', [] as const);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveDescendant.d.ts","sourceRoot":"","sources":["../../src/hooks/useActiveDescendant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAuB,MAAM,OAAO,CAAC;AAMjF,MAAM,WAAW,yBAAyB;IACxC,4DAA4D;IAC5D,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,wCAAwC;IACxC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,qDAAqD;IACrD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC;;OAEG;IACH,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,WAAW,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,KAAK,iBAAiB,GAAG,WAAW,GAAG,SAAS,CAAC;AACjD,KAAK,WAAW,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC;AAUxC,QAAA,MAAM,mBAAmB,0OAgBpB,yBAAyB;sBAGV,iBAAiB;iBACtB,WAAW;
|
|
1
|
+
{"version":3,"file":"useActiveDescendant.d.ts","sourceRoot":"","sources":["../../src/hooks/useActiveDescendant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAA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AAI;;UAmC/D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -62,7 +62,10 @@ const useActiveDescendant = ({ focusEl, scope, scopeSelector, selector, orientat
|
|
|
62
62
|
else {
|
|
63
63
|
clearThenSetDescendants(null);
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
if (currentIndex === null) {
|
|
66
|
+
setCurrentIndex(0);
|
|
67
|
+
}
|
|
68
|
+
}, [scope, scopeSelector, selector, pauseDescendantEvaluation, currentIndex]);
|
|
66
69
|
// Update paused ref
|
|
67
70
|
useEffect(() => {
|
|
68
71
|
paused.current = pauseDescendantEvaluation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveDescendant.js","sourceRoot":"","sources":["../../src/hooks/useActiveDescendant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AA0D1C,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAEtE,MAAM,mBAAmB,GAAG,CAC1B,EACE,OAAO,EACP,KAAK,EACL,aAAa,EACb,QAAQ,EACR,WAAW,GAAG,UAAU,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,oBAAoB,EACpB,yBAAyB,GAAG,KAAK,EACjC,kBAAkB,EACQ,EAC5B,kBAAkC,EAAE,EAIpC,EAAE;IACF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,MAAM,MAAM,G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mB,CAAC","sourcesContent":["import { useEffect, useState, DependencyList, useCallback, useRef } from 'react';\n\nimport { createUID, getActiveElement } from '../utils';\n\nimport useDirection from './useDirection';\n\nexport interface UseActiveDescendantConfig {\n /** DOM element which controls and has active descendants */\n focusEl: HTMLElement | null;\n /** Root scope for descendant options */\n scope: HTMLElement | null;\n /** Custom selector for specific descendant scope in root descendant scope */\n scopeSelector?: string;\n /** Custom selector for descendant options */\n selector?: string;\n /** Orientation of descendant navigation\n * @default 'vertical'\n */\n orientation?: 'horizontal' | 'vertical';\n /** One-time override for the focused descendant, triggers re-evaluation.\n * Include `clearFocusDescendantEl` for cleanup.\n */\n focusDescendantEl?: HTMLElement | null;\n /** Callback to clear focusDescendantEl after use. */\n clearFocusDescendant?: () => void;\n /** One-time override for focused element on NEXT re-evaluation of active descendants.\n * Include `clearFocusReturn` for cleanup.\n */\n focusReturnEl?: HTMLElement | null;\n /** Callback to clear focusReturnEl after use. */\n clearFocusReturn?: () => void;\n /**\n * Descendant ID used for continuous override of current active descendant,\n * used for external focus control / keyDown bindings (see RTE).\n * NOTE: setting currentDescendantId once effectively disables the keybindings of this hook.\n * If you only need to set the current element once, use focusReturnEl & clearFocusReturn.\n * @deprecated\n */\n currentDescendantId?: string;\n /** Explicit onClick handler called on keydown 'enter' event */\n onClick?: (currentDescendantEl: HTMLElement) => void;\n /** Prevent scrolling to the active descendant on the initial render.\n * Include `preventInitialScroll` for cleanup.\n */\n preventInitialScroll?: boolean;\n /** Callback to clear preventInitialScroll after use. */\n clearPreventScroll?: () => void;\n /** Boolean to prevent descendant evaluation.\n * @default false\n */\n pauseDescendantEvaluation?: boolean;\n}\n\ntype CurrentDescendant = HTMLElement | undefined;\ntype Descendants = HTMLElement[] | null;\ntype InteractiveElementTypes =\n | HTMLButtonElement\n | HTMLAnchorElement\n | HTMLInputElement\n | HTMLLIElement\n | HTMLLegendElement;\n\nconst interactiveNodeNames = ['button', 'a', 'input', 'li', 'legend'];\n\nconst useActiveDescendant = (\n {\n focusEl,\n scope,\n scopeSelector,\n selector,\n orientation = 'vertical',\n focusDescendantEl,\n clearFocusDescendant,\n focusReturnEl,\n clearFocusReturn,\n currentDescendantId,\n onClick,\n preventInitialScroll,\n pauseDescendantEvaluation = false,\n clearPreventScroll\n }: UseActiveDescendantConfig,\n dependencyArray: DependencyList = []\n): {\n activeDescendant: CurrentDescendant;\n descendants: Descendants;\n} => {\n const [resetId, setResetId] = useState(0);\n const previousActiveId = useRef('');\n const paused = useRef(pauseDescendantEvaluation);\n const [focusDescendantElIndex, setFocusDescendantElIndex] = useState<number | null>(null);\n const [currentIndex, setCurrentIndex] = useState<number | null>(null);\n const [descendants, setDescendants] = useState<Descendants>();\n const { rtl } = useDirection();\n\n const clearDescendants = useCallback(() => {\n descendants?.forEach(node => {\n node.setAttribute('data-current', 'false');\n });\n }, [descendants]);\n\n const clearThenSetDescendants = useCallback(\n (setVal: NodeListOf<Element> | null) => {\n clearDescendants();\n setDescendants(\n setVal\n ? Array.from(setVal).filter((item): item is HTMLElement => item instanceof HTMLElement)\n : null\n );\n },\n [descendants]\n );\n\n const setIdsAndOwns = useCallback(\n ({ clear }: { clear: boolean } = { clear: false }) => {\n const ownedIds: string[] = [];\n\n if (descendants && descendants.length) {\n descendants.forEach(node => {\n node.id = node.id || createUID();\n ownedIds.push(node.id);\n });\n }\n\n if (clear) {\n const currentOwnedIds = focusEl?.getAttribute('aria-owns')?.split(' ');\n const clearedIds = currentOwnedIds?.filter(id => !ownedIds.includes(id));\n focusEl?.setAttribute('aria-owns', clearedIds?.join(' ') || '');\n } else {\n focusEl?.setAttribute('aria-owns', ownedIds.join(' '));\n }\n },\n [focusEl, descendants]\n );\n\n const updateDescendants = useCallback(() => {\n if (pauseDescendantEvaluation) return;\n\n let hasScope = scope;\n\n if (hasScope && hasScope instanceof HTMLElement) {\n if (scopeSelector) {\n hasScope = hasScope.querySelector(scopeSelector);\n }\n\n if (!hasScope) {\n clearThenSetDescendants(null);\n return;\n }\n\n if (selector) {\n const setVal = hasScope.querySelectorAll(selector);\n clearThenSetDescendants(setVal);\n } else {\n const setVal = hasScope.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n );\n clearThenSetDescendants(setVal);\n }\n } else {\n clearThenSetDescendants(null);\n }\n }, [scope, scopeSelector, selector, pauseDescendantEvaluation]);\n\n // Update paused ref\n useEffect(() => {\n paused.current = pauseDescendantEvaluation;\n }, [pauseDescendantEvaluation]);\n\n // Toggle active scope data attr.\n useEffect(() => {\n if (!scope || !focusEl) return;\n\n scope.setAttribute('data-active-scope', getActiveElement() === focusEl ? 'true' : 'false');\n\n const onFocus = () => {\n scope.setAttribute('data-active-scope', 'true');\n };\n const onBlur = () => {\n scope.setAttribute('data-active-scope', 'false');\n };\n\n focusEl.addEventListener('focus', onFocus);\n focusEl.addEventListener('blur', onBlur);\n\n return () => {\n focusEl.removeEventListener('focus', onFocus);\n focusEl.removeEventListener('blur', onBlur);\n };\n }, [scope, focusEl]);\n\n // Update descendants when un-paused\n useEffect(() => {\n if (!pauseDescendantEvaluation) {\n updateDescendants();\n }\n }, [pauseDescendantEvaluation]);\n\n // Update descendants & reset current index when dependencies change\n useEffect(() => {\n /**\n * 0 second timeout added because descendantScope needs to be\n * up to date before running query after dependencyArray change\n */\n const timeoutId = setTimeout(() => {\n updateDescendants();\n if (!paused.current) {\n setCurrentIndex(0);\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }, [...dependencyArray]);\n\n // Set IDs and aria-owns\n useEffect(() => {\n if (!pauseDescendantEvaluation) {\n setIdsAndOwns();\n setResetId(Math.random());\n } else {\n clearDescendants();\n setIdsAndOwns({ clear: true });\n }\n }, [pauseDescendantEvaluation, focusEl, descendants]);\n\n // Bind focus el keyDown\n useEffect(() => {\n const nextIndex = () => {\n // Focus next or first\n clearFocusReturn?.();\n clearPreventScroll?.();\n if (currentIndex !== null && currentIndex + 1 < descendants!.length) {\n setCurrentIndex(currentIndex + 1);\n } else {\n setCurrentIndex(0);\n }\n };\n const prevIndex = () => {\n // Focus previous or last\n clearFocusReturn?.();\n clearPreventScroll?.();\n if (currentIndex !== null && currentIndex - 1 > -1) {\n setCurrentIndex(currentIndex - 1);\n } else {\n setCurrentIndex(descendants!.length - 1);\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (descendants?.length) {\n if (['ArrowDown', 'ArrowUp'].includes(e.key) && orientation === 'vertical') {\n e.preventDefault();\n }\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.key) && orientation === 'horizontal') {\n e.preventDefault();\n }\n\n // 0 second timeout to execute after explicitly defined onKeyDown event handlers.\n setTimeout(() => {\n switch (e.key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n nextIndex();\n }\n break;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n prevIndex();\n }\n break;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n if (rtl) {\n prevIndex();\n } else {\n nextIndex();\n }\n }\n break;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n if (rtl) {\n nextIndex();\n } else {\n prevIndex();\n }\n }\n break;\n case 'Enter':\n // Click focused item\n if (currentIndex !== null) {\n if (onClick) {\n onClick(descendants[currentIndex]);\n break;\n }\n\n const nodeName = descendants[currentIndex].nodeName.toLowerCase();\n if (interactiveNodeNames.includes(nodeName)) {\n descendants[currentIndex].click();\n } else {\n descendants[currentIndex]\n .querySelector<InteractiveElementTypes>(`${interactiveNodeNames.join(',')}`)\n ?.click();\n }\n }\n break;\n default:\n break;\n }\n }, 0);\n }\n };\n\n // Do not rebind once / if `currentDescendantId` (deprecated) control is defined\n if (!pauseDescendantEvaluation && focusEl && descendants?.length && !currentDescendantId) {\n focusEl.addEventListener('keydown', onKeyDown);\n }\n\n return () => {\n focusEl?.removeEventListener('keydown', onKeyDown);\n };\n }, [focusEl, currentIndex, descendants, pauseDescendantEvaluation]);\n\n // Handle independent control update (deprecated)\n useEffect(() => {\n if (!pauseDescendantEvaluation && descendants && currentDescendantId) {\n descendants.forEach((node, index) => {\n if (node.id === currentDescendantId) {\n setCurrentIndex(index);\n }\n });\n }\n }, [currentDescendantId, descendants, pauseDescendantEvaluation]);\n\n // Set and scroll to current descendant\n useEffect(() => {\n if (paused.current) {\n return;\n }\n const nextIndex = focusDescendantElIndex || currentIndex;\n const focusReturnId = focusReturnEl?.id;\n let focusReturnIndex;\n const focusDescendantElId = focusDescendantEl?.id;\n let focusDescendantIndex;\n let foundFocusDescendantEl = false;\n\n if (descendants && descendants.length) {\n // clear previous & catch focusReturn / focusDescendantEl index\n descendants.forEach((node, index) => {\n if (focusDescendantElIndex === null && node.id === focusDescendantElId) {\n focusDescendantIndex = index;\n foundFocusDescendantEl = true;\n setFocusDescendantElIndex(index);\n }\n if (node.id === focusReturnId) {\n focusReturnIndex = index;\n }\n node.setAttribute('data-current', 'false');\n });\n\n // early return for focusReturn / focusDescendantEl\n if (focusReturnIndex && focusReturnIndex !== currentIndex) {\n setCurrentIndex(focusReturnIndex);\n clearFocusReturn?.();\n return;\n }\n if (foundFocusDescendantEl && focusDescendantIndex !== undefined) {\n // hard reset to continue focusDescendantEl process even if it is the active descendant\n setResetId(Math.random());\n setCurrentIndex(focusDescendantIndex);\n return;\n }\n\n // set new\n if (nextIndex !== null && descendants[nextIndex]) {\n const itemEl = descendants[nextIndex!];\n itemEl.setAttribute('data-current', 'true');\n focusEl?.setAttribute('aria-activedescendant', itemEl.id);\n\n // scroll to element\n if (itemEl.id !== previousActiveId.current && !preventInitialScroll) {\n const scrollTo: (this: Element, arg: boolean) => void =\n Element.prototype.scrollIntoViewIfNeeded ?? Element.prototype.scrollIntoView;\n\n scrollTo?.call(itemEl, false);\n }\n\n // focusDescendantEl cleanup\n if (focusDescendantElIndex !== null) {\n setFocusDescendantElIndex(null);\n clearFocusDescendant?.();\n }\n\n previousActiveId.current = itemEl.id;\n }\n }\n\n return () => {\n focusEl?.removeAttribute('aria-activedescendant');\n };\n }, [descendants, currentIndex, focusDescendantEl, focusEl, resetId]);\n\n return {\n activeDescendant: currentIndex !== null && descendants ? descendants[currentIndex] : undefined,\n descendants: descendants || null\n };\n};\n\nexport const useLazyDescendant = ({\n loading,\n descendants,\n previousActiveDescendant,\n activeDescendant,\n focusReturnEl,\n setFocusReturnEl,\n scrollEl\n}: {\n loading: boolean;\n descendants: Descendants;\n previousActiveDescendant: CurrentDescendant;\n activeDescendant: CurrentDescendant;\n focusReturnEl: UseActiveDescendantConfig['focusReturnEl'];\n setFocusReturnEl: (el: HTMLElement | null | undefined) => void;\n scrollEl?: HTMLElement | null;\n}) => {\n // Bump scroll & set return element when descendant focused in loading state.\n useEffect(() => {\n if (loading && descendants && descendants.length && activeDescendant) {\n const descendantList = [...descendants];\n const lastItem = descendantList.pop();\n const lastId = lastItem?.id || undefined;\n let timeoutId: ReturnType<typeof setTimeout>;\n\n if (lastId === activeDescendant.id) {\n if (scrollEl) {\n scrollEl.scrollTop = scrollEl.scrollHeight - scrollEl.offsetHeight;\n }\n\n if (focusReturnEl?.id !== activeDescendant.id) {\n // Set focus return to AD on 'nextTick', to avoid reset of AD on update\n timeoutId = setTimeout(() => {\n setFocusReturnEl(lastItem);\n }, 0);\n }\n }\n // If not last item\n else if (focusReturnEl?.id !== activeDescendant.id) {\n // Set focus return to AD on 'nextTick' to avoid reset of AD on update\n // Do not D.R.Y to avoid conflicting calls with immediately prior elements.\n timeoutId = setTimeout(() => {\n setFocusReturnEl(activeDescendant);\n }, 0);\n }\n\n return () => clearTimeout(timeoutId);\n }\n }, [loading, descendants, previousActiveDescendant, activeDescendant, scrollEl, focusReturnEl]);\n};\n\nexport default useActiveDescendant;\n"]}
|
|
1
|
+
{"version":3,"file":"useActiveDescendant.js","sourceRoot":"","sources":["../../src/hooks/useActiveDescendant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,gBAAgB,E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AAC,YAAY,CAAC;iBACpE;gBAED,IAAI,aAAa,EAAE,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;oBAC7C,uEAAuE;oBACvE,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;wBAC1B,gBAAgB,CAAC,QAAQ,CAAC,CAAC;oBAC7B,CAAC,EAAE,CAAC,CAAC,CAAC;iBACP;aACF;YACD,mBAAmB;iBACd,IAAI,aAAa,EAAE,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;gBAClD,sEAAsE;gBACtE,2EAA2E;gBAC3E,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;oBAC1B,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;gBACrC,CAAC,EAAE,CAAC,CAAC,CAAC;aACP;YAED,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SACtC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;AAClG,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useEffect, useState, DependencyList, useCallback, useRef } from 'react';\n\nimport { createUID, getActiveElement } from '../utils';\n\nimport useDirection from './useDirection';\n\nexport interface UseActiveDescendantConfig {\n /** DOM element which controls and has active descendants */\n focusEl: HTMLElement | null;\n /** Root scope for descendant options */\n scope: HTMLElement | null;\n /** Custom selector for specific descendant scope in root descendant scope */\n scopeSelector?: string;\n /** Custom selector for descendant options */\n selector?: string;\n /** Orientation of descendant navigation\n * @default 'vertical'\n */\n orientation?: 'horizontal' | 'vertical';\n /** One-time override for the focused descendant, triggers re-evaluation.\n * Include `clearFocusDescendantEl` for cleanup.\n */\n focusDescendantEl?: HTMLElement | null;\n /** Callback to clear focusDescendantEl after use. */\n clearFocusDescendant?: () => void;\n /** One-time override for focused element on NEXT re-evaluation of active descendants.\n * Include `clearFocusReturn` for cleanup.\n */\n focusReturnEl?: HTMLElement | null;\n /** Callback to clear focusReturnEl after use. */\n clearFocusReturn?: () => void;\n /**\n * Descendant ID used for continuous override of current active descendant,\n * used for external focus control / keyDown bindings (see RTE).\n * NOTE: setting currentDescendantId once effectively disables the keybindings of this hook.\n * If you only need to set the current element once, use focusReturnEl & clearFocusReturn.\n * @deprecated\n */\n currentDescendantId?: string;\n /** Explicit onClick handler called on keydown 'enter' event */\n onClick?: (currentDescendantEl: HTMLElement) => void;\n /** Prevent scrolling to the active descendant on the initial render.\n * Include `preventInitialScroll` for cleanup.\n */\n preventInitialScroll?: boolean;\n /** Callback to clear preventInitialScroll after use. */\n clearPreventScroll?: () => void;\n /** Boolean to prevent descendant evaluation.\n * @default false\n */\n pauseDescendantEvaluation?: boolean;\n}\n\ntype CurrentDescendant = HTMLElement | undefined;\ntype Descendants = HTMLElement[] | null;\ntype InteractiveElementTypes =\n | HTMLButtonElement\n | HTMLAnchorElement\n | HTMLInputElement\n | HTMLLIElement\n | HTMLLegendElement;\n\nconst interactiveNodeNames = ['button', 'a', 'input', 'li', 'legend'];\n\nconst useActiveDescendant = (\n {\n focusEl,\n scope,\n scopeSelector,\n selector,\n orientation = 'vertical',\n focusDescendantEl,\n clearFocusDescendant,\n focusReturnEl,\n clearFocusReturn,\n currentDescendantId,\n onClick,\n preventInitialScroll,\n pauseDescendantEvaluation = false,\n clearPreventScroll\n }: UseActiveDescendantConfig,\n dependencyArray: DependencyList = []\n): {\n activeDescendant: CurrentDescendant;\n descendants: Descendants;\n} => {\n const [resetId, setResetId] = useState(0);\n const previousActiveId = useRef('');\n const paused = useRef(pauseDescendantEvaluation);\n const [focusDescendantElIndex, setFocusDescendantElIndex] = useState<number | null>(null);\n const [currentIndex, setCurrentIndex] = useState<number | null>(null);\n const [descendants, setDescendants] = useState<Descendants>();\n const { rtl } = useDirection();\n\n const clearDescendants = useCallback(() => {\n descendants?.forEach(node => {\n node.setAttribute('data-current', 'false');\n });\n }, [descendants]);\n\n const clearThenSetDescendants = useCallback(\n (setVal: NodeListOf<Element> | null) => {\n clearDescendants();\n setDescendants(\n setVal\n ? Array.from(setVal).filter((item): item is HTMLElement => item instanceof HTMLElement)\n : null\n );\n },\n [descendants]\n );\n\n const setIdsAndOwns = useCallback(\n ({ clear }: { clear: boolean } = { clear: false }) => {\n const ownedIds: string[] = [];\n\n if (descendants && descendants.length) {\n descendants.forEach(node => {\n node.id = node.id || createUID();\n ownedIds.push(node.id);\n });\n }\n\n if (clear) {\n const currentOwnedIds = focusEl?.getAttribute('aria-owns')?.split(' ');\n const clearedIds = currentOwnedIds?.filter(id => !ownedIds.includes(id));\n focusEl?.setAttribute('aria-owns', clearedIds?.join(' ') || '');\n } else {\n focusEl?.setAttribute('aria-owns', ownedIds.join(' '));\n }\n },\n [focusEl, descendants]\n );\n\n const updateDescendants = useCallback(() => {\n if (pauseDescendantEvaluation) return;\n\n let hasScope = scope;\n\n if (hasScope && hasScope instanceof HTMLElement) {\n if (scopeSelector) {\n hasScope = hasScope.querySelector(scopeSelector);\n }\n\n if (!hasScope) {\n clearThenSetDescendants(null);\n return;\n }\n\n if (selector) {\n const setVal = hasScope.querySelectorAll(selector);\n clearThenSetDescendants(setVal);\n } else {\n const setVal = hasScope.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n );\n clearThenSetDescendants(setVal);\n }\n } else {\n clearThenSetDescendants(null);\n }\n\n if (currentIndex === null) {\n setCurrentIndex(0);\n }\n }, [scope, scopeSelector, selector, pauseDescendantEvaluation, currentIndex]);\n\n // Update paused ref\n useEffect(() => {\n paused.current = pauseDescendantEvaluation;\n }, [pauseDescendantEvaluation]);\n\n // Toggle active scope data attr.\n useEffect(() => {\n if (!scope || !focusEl) return;\n\n scope.setAttribute('data-active-scope', getActiveElement() === focusEl ? 'true' : 'false');\n\n const onFocus = () => {\n scope.setAttribute('data-active-scope', 'true');\n };\n const onBlur = () => {\n scope.setAttribute('data-active-scope', 'false');\n };\n\n focusEl.addEventListener('focus', onFocus);\n focusEl.addEventListener('blur', onBlur);\n\n return () => {\n focusEl.removeEventListener('focus', onFocus);\n focusEl.removeEventListener('blur', onBlur);\n };\n }, [scope, focusEl]);\n\n // Update descendants when un-paused\n useEffect(() => {\n if (!pauseDescendantEvaluation) {\n updateDescendants();\n }\n }, [pauseDescendantEvaluation]);\n\n // Update descendants & reset current index when dependencies change\n useEffect(() => {\n /**\n * 0 second timeout added because descendantScope needs to be\n * up to date before running query after dependencyArray change\n */\n const timeoutId = setTimeout(() => {\n updateDescendants();\n if (!paused.current) {\n setCurrentIndex(0);\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }, [...dependencyArray]);\n\n // Set IDs and aria-owns\n useEffect(() => {\n if (!pauseDescendantEvaluation) {\n setIdsAndOwns();\n setResetId(Math.random());\n } else {\n clearDescendants();\n setIdsAndOwns({ clear: true });\n }\n }, [pauseDescendantEvaluation, focusEl, descendants]);\n\n // Bind focus el keyDown\n useEffect(() => {\n const nextIndex = () => {\n // Focus next or first\n clearFocusReturn?.();\n clearPreventScroll?.();\n if (currentIndex !== null && currentIndex + 1 < descendants!.length) {\n setCurrentIndex(currentIndex + 1);\n } else {\n setCurrentIndex(0);\n }\n };\n const prevIndex = () => {\n // Focus previous or last\n clearFocusReturn?.();\n clearPreventScroll?.();\n if (currentIndex !== null && currentIndex - 1 > -1) {\n setCurrentIndex(currentIndex - 1);\n } else {\n setCurrentIndex(descendants!.length - 1);\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (descendants?.length) {\n if (['ArrowDown', 'ArrowUp'].includes(e.key) && orientation === 'vertical') {\n e.preventDefault();\n }\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.key) && orientation === 'horizontal') {\n e.preventDefault();\n }\n\n // 0 second timeout to execute after explicitly defined onKeyDown event handlers.\n setTimeout(() => {\n switch (e.key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n nextIndex();\n }\n break;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n prevIndex();\n }\n break;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n if (rtl) {\n prevIndex();\n } else {\n nextIndex();\n }\n }\n break;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n if (rtl) {\n nextIndex();\n } else {\n prevIndex();\n }\n }\n break;\n case 'Enter':\n // Click focused item\n if (currentIndex !== null) {\n if (onClick) {\n onClick(descendants[currentIndex]);\n break;\n }\n\n const nodeName = descendants[currentIndex].nodeName.toLowerCase();\n if (interactiveNodeNames.includes(nodeName)) {\n descendants[currentIndex].click();\n } else {\n descendants[currentIndex]\n .querySelector<InteractiveElementTypes>(`${interactiveNodeNames.join(',')}`)\n ?.click();\n }\n }\n break;\n default:\n break;\n }\n }, 0);\n }\n };\n\n // Do not rebind once / if `currentDescendantId` (deprecated) control is defined\n if (!pauseDescendantEvaluation && focusEl && descendants?.length && !currentDescendantId) {\n focusEl.addEventListener('keydown', onKeyDown);\n }\n\n return () => {\n focusEl?.removeEventListener('keydown', onKeyDown);\n };\n }, [focusEl, currentIndex, descendants, pauseDescendantEvaluation]);\n\n // Handle independent control update (deprecated)\n useEffect(() => {\n if (!pauseDescendantEvaluation && descendants && currentDescendantId) {\n descendants.forEach((node, index) => {\n if (node.id === currentDescendantId) {\n setCurrentIndex(index);\n }\n });\n }\n }, [currentDescendantId, descendants, pauseDescendantEvaluation]);\n\n // Set and scroll to current descendant\n useEffect(() => {\n if (paused.current) {\n return;\n }\n const nextIndex = focusDescendantElIndex || currentIndex;\n const focusReturnId = focusReturnEl?.id;\n let focusReturnIndex;\n const focusDescendantElId = focusDescendantEl?.id;\n let focusDescendantIndex;\n let foundFocusDescendantEl = false;\n\n if (descendants && descendants.length) {\n // clear previous & catch focusReturn / focusDescendantEl index\n descendants.forEach((node, index) => {\n if (focusDescendantElIndex === null && node.id === focusDescendantElId) {\n focusDescendantIndex = index;\n foundFocusDescendantEl = true;\n setFocusDescendantElIndex(index);\n }\n if (node.id === focusReturnId) {\n focusReturnIndex = index;\n }\n node.setAttribute('data-current', 'false');\n });\n\n // early return for focusReturn / focusDescendantEl\n if (focusReturnIndex && focusReturnIndex !== currentIndex) {\n setCurrentIndex(focusReturnIndex);\n clearFocusReturn?.();\n return;\n }\n if (foundFocusDescendantEl && focusDescendantIndex !== undefined) {\n // hard reset to continue focusDescendantEl process even if it is the active descendant\n setResetId(Math.random());\n setCurrentIndex(focusDescendantIndex);\n return;\n }\n\n // set new\n if (nextIndex !== null && descendants[nextIndex]) {\n const itemEl = descendants[nextIndex!];\n itemEl.setAttribute('data-current', 'true');\n focusEl?.setAttribute('aria-activedescendant', itemEl.id);\n\n // scroll to element\n if (itemEl.id !== previousActiveId.current && !preventInitialScroll) {\n const scrollTo: (this: Element, arg: boolean) => void =\n Element.prototype.scrollIntoViewIfNeeded ?? Element.prototype.scrollIntoView;\n\n scrollTo?.call(itemEl, false);\n }\n\n // focusDescendantEl cleanup\n if (focusDescendantElIndex !== null) {\n setFocusDescendantElIndex(null);\n clearFocusDescendant?.();\n }\n\n previousActiveId.current = itemEl.id;\n }\n }\n\n return () => {\n focusEl?.removeAttribute('aria-activedescendant');\n };\n }, [descendants, currentIndex, focusDescendantEl, focusEl, resetId]);\n\n return {\n activeDescendant: currentIndex !== null && descendants ? descendants[currentIndex] : undefined,\n descendants: descendants || null\n };\n};\n\nexport const useLazyDescendant = ({\n loading,\n descendants,\n previousActiveDescendant,\n activeDescendant,\n focusReturnEl,\n setFocusReturnEl,\n scrollEl\n}: {\n loading: boolean;\n descendants: Descendants;\n previousActiveDescendant: CurrentDescendant;\n activeDescendant: CurrentDescendant;\n focusReturnEl: UseActiveDescendantConfig['focusReturnEl'];\n setFocusReturnEl: (el: HTMLElement | null | undefined) => void;\n scrollEl?: HTMLElement | null;\n}) => {\n // Bump scroll & set return element when descendant focused in loading state.\n useEffect(() => {\n if (loading && descendants && descendants.length && activeDescendant) {\n const descendantList = [...descendants];\n const lastItem = descendantList.pop();\n const lastId = lastItem?.id || undefined;\n let timeoutId: ReturnType<typeof setTimeout>;\n\n if (lastId === activeDescendant.id) {\n if (scrollEl) {\n scrollEl.scrollTop = scrollEl.scrollHeight - scrollEl.offsetHeight;\n }\n\n if (focusReturnEl?.id !== activeDescendant.id) {\n // Set focus return to AD on 'nextTick', to avoid reset of AD on update\n timeoutId = setTimeout(() => {\n setFocusReturnEl(lastItem);\n }, 0);\n }\n }\n // If not last item\n else if (focusReturnEl?.id !== activeDescendant.id) {\n // Set focus return to AD on 'nextTick' to avoid reset of AD on update\n // Do not D.R.Y to avoid conflicting calls with immediately prior elements.\n timeoutId = setTimeout(() => {\n setFocusReturnEl(activeDescendant);\n }, 0);\n }\n\n return () => clearTimeout(timeoutId);\n }\n }, [loading, descendants, previousActiveDescendant, activeDescendant, scrollEl, focusReturnEl]);\n};\n\nexport default useActiveDescendant;\n"]}
|
package/lib/hooks/useI18n.d.ts
CHANGED
|
@@ -113,6 +113,9 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
113
113
|
error: string;
|
|
114
114
|
warning: string;
|
|
115
115
|
success: string;
|
|
116
|
+
pass: string;
|
|
117
|
+
fail: string;
|
|
118
|
+
did_not_ask: string;
|
|
116
119
|
day_placeholder: string;
|
|
117
120
|
month_placeholder: string;
|
|
118
121
|
year_placeholder: string;
|
|
@@ -303,6 +306,7 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
303
306
|
stages_case_lifecycle: string;
|
|
304
307
|
stages_default_case_lifecycle: string;
|
|
305
308
|
stages_stage_label: string;
|
|
309
|
+
stages_description: string;
|
|
306
310
|
predictions: string;
|
|
307
311
|
all_predictions: string;
|
|
308
312
|
learn_more: string;
|
|
@@ -619,6 +623,7 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
619
623
|
transcripts: string;
|
|
620
624
|
verbatim: string;
|
|
621
625
|
dialog: string;
|
|
626
|
+
download_transcript: string;
|
|
622
627
|
sentiment_positive: string;
|
|
623
628
|
sentiment_negative: string;
|
|
624
629
|
sentiment_neutral: string;
|
|
@@ -955,6 +960,39 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
955
960
|
dev_tools: string;
|
|
956
961
|
active_session_info: string;
|
|
957
962
|
continue_debugging: string;
|
|
963
|
+
action_task: string;
|
|
964
|
+
task_object: string;
|
|
965
|
+
view_rule: string;
|
|
966
|
+
system_rule: string;
|
|
967
|
+
record_rule: string;
|
|
968
|
+
portal_rule: string;
|
|
969
|
+
persona_rule: string;
|
|
970
|
+
permission_rule: string;
|
|
971
|
+
live_data_rule: string;
|
|
972
|
+
integration_system_rule: string;
|
|
973
|
+
insight_rule: string;
|
|
974
|
+
field_rule: string;
|
|
975
|
+
data_page_rule: string;
|
|
976
|
+
connector_rule: string;
|
|
977
|
+
configuration_rule: string;
|
|
978
|
+
authenticate_rule: string;
|
|
979
|
+
when_logic: string;
|
|
980
|
+
validation_logic: string;
|
|
981
|
+
function_logic: string;
|
|
982
|
+
decision_step_logic: string;
|
|
983
|
+
case_wait: string;
|
|
984
|
+
case_stage: string;
|
|
985
|
+
case_sla: string;
|
|
986
|
+
case_process: string;
|
|
987
|
+
case_go_to: string;
|
|
988
|
+
case_object: string;
|
|
989
|
+
set_automation: string;
|
|
990
|
+
return_automation: string;
|
|
991
|
+
for_each_automation: string;
|
|
992
|
+
call_automation: string;
|
|
993
|
+
append_automation: string;
|
|
994
|
+
automation_object: string;
|
|
995
|
+
ai_object: string;
|
|
958
996
|
}>>;
|
|
959
997
|
export default useI18n;
|
|
960
998
|
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAC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AAe,OAAO,CAAC"}
|
package/lib/i18n/default.d.ts
CHANGED
|
@@ -109,6 +109,9 @@ declare const _default: {
|
|
|
109
109
|
error: string;
|
|
110
110
|
warning: string;
|
|
111
111
|
success: string;
|
|
112
|
+
pass: string;
|
|
113
|
+
fail: string;
|
|
114
|
+
did_not_ask: string;
|
|
112
115
|
day_placeholder: string;
|
|
113
116
|
month_placeholder: string;
|
|
114
117
|
year_placeholder: string;
|
|
@@ -299,6 +302,7 @@ declare const _default: {
|
|
|
299
302
|
stages_case_lifecycle: string;
|
|
300
303
|
stages_default_case_lifecycle: string;
|
|
301
304
|
stages_stage_label: string;
|
|
305
|
+
stages_description: string;
|
|
302
306
|
predictions: string;
|
|
303
307
|
all_predictions: string;
|
|
304
308
|
learn_more: string;
|
|
@@ -615,6 +619,7 @@ declare const _default: {
|
|
|
615
619
|
transcripts: string;
|
|
616
620
|
verbatim: string;
|
|
617
621
|
dialog: string;
|
|
622
|
+
download_transcript: string;
|
|
618
623
|
sentiment_positive: string;
|
|
619
624
|
sentiment_negative: string;
|
|
620
625
|
sentiment_neutral: string;
|
|
@@ -951,6 +956,39 @@ declare const _default: {
|
|
|
951
956
|
dev_tools: string;
|
|
952
957
|
active_session_info: string;
|
|
953
958
|
continue_debugging: string;
|
|
959
|
+
action_task: string;
|
|
960
|
+
task_object: string;
|
|
961
|
+
view_rule: string;
|
|
962
|
+
system_rule: string;
|
|
963
|
+
record_rule: string;
|
|
964
|
+
portal_rule: string;
|
|
965
|
+
persona_rule: string;
|
|
966
|
+
permission_rule: string;
|
|
967
|
+
live_data_rule: string;
|
|
968
|
+
integration_system_rule: string;
|
|
969
|
+
insight_rule: string;
|
|
970
|
+
field_rule: string;
|
|
971
|
+
data_page_rule: string;
|
|
972
|
+
connector_rule: string;
|
|
973
|
+
configuration_rule: string;
|
|
974
|
+
authenticate_rule: string;
|
|
975
|
+
when_logic: string;
|
|
976
|
+
validation_logic: string;
|
|
977
|
+
function_logic: string;
|
|
978
|
+
decision_step_logic: string;
|
|
979
|
+
case_wait: string;
|
|
980
|
+
case_stage: string;
|
|
981
|
+
case_sla: string;
|
|
982
|
+
case_process: string;
|
|
983
|
+
case_go_to: string;
|
|
984
|
+
case_object: string;
|
|
985
|
+
set_automation: string;
|
|
986
|
+
return_automation: string;
|
|
987
|
+
for_each_automation: string;
|
|
988
|
+
call_automation: string;
|
|
989
|
+
append_automation: string;
|
|
990
|
+
automation_object: string;
|
|
991
|
+
ai_object: string;
|
|
954
992
|
};
|
|
955
993
|
export default _default;
|
|
956
994
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA2nCE"}
|
package/lib/i18n/default.js
CHANGED
|
@@ -117,6 +117,9 @@ export default {
|
|
|
117
117
|
error: 'Error',
|
|
118
118
|
warning: 'Warning',
|
|
119
119
|
success: 'Success',
|
|
120
|
+
pass: 'Pass',
|
|
121
|
+
fail: 'Fail',
|
|
122
|
+
did_not_ask: 'Did not ask',
|
|
120
123
|
/* Date and time */
|
|
121
124
|
day_placeholder: 'DD',
|
|
122
125
|
month_placeholder: 'MM',
|
|
@@ -347,6 +350,7 @@ export default {
|
|
|
347
350
|
stages_case_lifecycle: '{0} lifecycle',
|
|
348
351
|
stages_default_case_lifecycle: 'Case lifecycle',
|
|
349
352
|
stages_stage_label: 'Stage {0}, {1}',
|
|
353
|
+
stages_description: 'Use horizontal arrow keys to navigate.',
|
|
350
354
|
/* work:Predictions */
|
|
351
355
|
predictions: 'Predictions',
|
|
352
356
|
all_predictions: 'All predictions',
|
|
@@ -674,6 +678,7 @@ export default {
|
|
|
674
678
|
transcripts: 'Transcripts',
|
|
675
679
|
verbatim: 'Verbatim',
|
|
676
680
|
dialog: 'Dialog',
|
|
681
|
+
download_transcript: 'Download transcript',
|
|
677
682
|
/* cs:Sentiment */
|
|
678
683
|
sentiment_positive: 'Positive',
|
|
679
684
|
sentiment_negative: 'Negative',
|
|
@@ -1024,6 +1029,40 @@ export default {
|
|
|
1024
1029
|
dev_tools: 'dev tools',
|
|
1025
1030
|
/* tools: DevTools */
|
|
1026
1031
|
active_session_info: 'Debugging for this session is active in another window',
|
|
1027
|
-
continue_debugging: 'Continue debugging'
|
|
1032
|
+
continue_debugging: 'Continue debugging',
|
|
1033
|
+
/* Launchpad: IconTiles */
|
|
1034
|
+
action_task: 'Action task',
|
|
1035
|
+
task_object: 'Task object',
|
|
1036
|
+
view_rule: 'View rule',
|
|
1037
|
+
system_rule: 'System rule',
|
|
1038
|
+
record_rule: 'Record rule',
|
|
1039
|
+
portal_rule: 'Portal rule',
|
|
1040
|
+
persona_rule: 'Persona rule',
|
|
1041
|
+
permission_rule: 'Permission rule',
|
|
1042
|
+
live_data_rule: 'Live data rule',
|
|
1043
|
+
integration_system_rule: 'Integration system rule',
|
|
1044
|
+
insight_rule: 'Insight rule',
|
|
1045
|
+
field_rule: 'Field rule',
|
|
1046
|
+
data_page_rule: 'Data page rule',
|
|
1047
|
+
connector_rule: 'Connector rule',
|
|
1048
|
+
configuration_rule: 'Configuration rule',
|
|
1049
|
+
authenticate_rule: 'Authenticate rule',
|
|
1050
|
+
when_logic: 'When logic',
|
|
1051
|
+
validation_logic: 'Validation logic',
|
|
1052
|
+
function_logic: 'Function logic',
|
|
1053
|
+
decision_step_logic: 'Decision step logic',
|
|
1054
|
+
case_wait: 'Case wait object',
|
|
1055
|
+
case_stage: 'Case stage object',
|
|
1056
|
+
case_sla: 'Case SLA object',
|
|
1057
|
+
case_process: 'Case process object',
|
|
1058
|
+
case_go_to: 'Case go-to object',
|
|
1059
|
+
case_object: 'Case object',
|
|
1060
|
+
set_automation: 'Set automation',
|
|
1061
|
+
return_automation: 'Return automation',
|
|
1062
|
+
for_each_automation: 'For each automation',
|
|
1063
|
+
call_automation: 'Call automation',
|
|
1064
|
+
append_automation: 'Append automation',
|
|
1065
|
+
automation_object: 'Automation object',
|
|
1066
|
+
ai_object: 'AI object'
|
|
1028
1067
|
};
|
|
1029
1068
|
//# sourceMappingURL=default.js.map
|