@hero-design/rn 8.24.0-alpha.1 → 8.24.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/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-publish:npm.log +0 -9
- package/es/index.js +78 -142
- package/lib/index.js +78 -142
- package/package.json +5 -5
- package/src/components/RichTextEditor/RichTextEditor.tsx +3 -4
- package/src/components/Success/__tests__/index.spec.tsx +6 -0
- package/src/components/Success/index.tsx +19 -0
- package/src/components/Tabs/{ScrollableTabsV2/SceneView.tsx → SceneView.tsx} +2 -2
- package/src/components/Tabs/ScrollableTabs.tsx +54 -48
- package/src/components/Tabs/{ScrollableTabsV2/__tests__ → __tests__}/SceneView.spec.tsx +3 -3
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +86 -28
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1687 -49
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1213 -29
- package/src/components/Tabs/__tests__/index.spec.tsx +58 -14
- package/src/components/Tabs/index.tsx +108 -102
- package/src/components/Tabs/useIsFocused.tsx +19 -0
- package/types/components/Accordion/AccordionItem.d.ts +0 -0
- package/types/components/Accordion/StyledAccordion.d.ts +0 -0
- package/types/components/Accordion/index.d.ts +0 -0
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -0
- package/types/components/Attachment/StyledAttachment.d.ts +0 -0
- package/types/components/Attachment/index.d.ts +0 -0
- package/types/components/Avatar/Avatar.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/ScrollView.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Box/StyledBox.d.ts +0 -0
- package/types/components/Box/config.d.ts +0 -0
- package/types/components/Box/index.d.ts +0 -0
- package/types/components/Box/types.d.ts +0 -0
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
- package/types/components/Calendar/StyledCalendar.d.ts +0 -0
- package/types/components/Calendar/helpers.d.ts +0 -0
- package/types/components/Calendar/index.d.ts +0 -0
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Carousel/CardCarousel.d.ts +0 -0
- package/types/components/Carousel/CarouselItem.d.ts +0 -0
- package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
- package/types/components/Carousel/StyledCarousel.d.ts +0 -0
- package/types/components/Carousel/contants.d.ts +0 -0
- package/types/components/Carousel/index.d.ts +0 -0
- package/types/components/Carousel/types.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +0 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
- package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
- package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
- package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
- package/types/components/DatePicker/index.d.ts +0 -0
- package/types/components/DatePicker/types.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/Empty/StyledEmpty.d.ts +0 -0
- package/types/components/Empty/index.d.ts +0 -0
- package/types/components/Error/StyledError.d.ts +0 -0
- package/types/components/Error/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/AnimatedIcon.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/components/Icon/IconList.d.ts +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +0 -0
- package/types/components/Image/index.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +0 -0
- package/types/components/List/ListItem.d.ts +0 -0
- package/types/components/List/StyledBasicListItem.d.ts +0 -0
- package/types/components/List/StyledListItem.d.ts +0 -0
- package/types/components/List/index.d.ts +0 -0
- package/types/components/PageControl/StyledPageControl.d.ts +0 -0
- package/types/components/PageControl/index.d.ts +0 -0
- package/types/components/PinInput/PinCell.d.ts +0 -0
- package/types/components/PinInput/StyledPinInput.d.ts +0 -0
- package/types/components/PinInput/index.d.ts +0 -0
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/constants.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +0 -0
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/Radio/types.d.ts +0 -0
- package/types/components/RefreshControl/index.d.ts +0 -0
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/MentionList.d.ts +0 -0
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/constants.d.ts +0 -0
- package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/index.d.ts +0 -0
- package/types/components/RichTextEditor/types.d.ts +0 -0
- package/types/components/RichTextEditor/utils/events.d.ts +0 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/BaseOptionList.d.ts +0 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +0 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +0 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +0 -0
- package/types/components/Select/helpers.d.ts +0 -0
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +0 -0
- package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
- package/types/components/Skeleton/index.d.ts +0 -0
- package/types/components/Slider/index.d.ts +0 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Success/StyledSuccess.d.ts +0 -0
- package/types/components/Success/index.d.ts +8 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
- package/types/components/Swipeable/index.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
- package/types/components/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/index.d.ts +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/SceneView.d.ts +4 -3
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabsHeader.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/TabWithBadge.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +1 -3
- package/types/components/Tabs/useIsFocused.d.ts +6 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +0 -0
- package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
- package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
- package/types/components/TimePicker/index.d.ts +0 -0
- package/types/components/TimePicker/types.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/components/Typography/Text/index.d.ts +0 -0
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +0 -0
- package/types/theme/components/accordion.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/attachment.d.ts +0 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/calendar.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/cardCarousel.d.ts +0 -0
- package/types/theme/components/carousel.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +0 -0
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/datePicker.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/empty.d.ts +0 -0
- package/types/theme/components/error.d.ts +0 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/image.d.ts +0 -0
- package/types/theme/components/list.d.ts +0 -0
- package/types/theme/components/pageControl.d.ts +0 -0
- package/types/theme/components/pinInput.d.ts +0 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/refreshControl.d.ts +0 -0
- package/types/theme/components/richTextEditor.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +0 -0
- package/types/theme/components/skeleton.d.ts +0 -0
- package/types/theme/components/slider.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/success.d.ts +0 -0
- package/types/theme/components/swipeable.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +0 -0
- package/types/theme/components/timePicker.d.ts +0 -0
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +0 -0
- package/types/theme/components/typography.d.ts +0 -0
- package/types/theme/getTheme.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors/eBens.d.ts +0 -0
- package/types/theme/global/colors/global.d.ts +0 -0
- package/types/theme/global/colors/globalDark.d.ts +0 -0
- package/types/theme/global/colors/jobs.d.ts +0 -0
- package/types/theme/global/colors/swag.d.ts +0 -0
- package/types/theme/global/colors/swagDark.d.ts +0 -0
- package/types/theme/global/colors/types.d.ts +0 -0
- package/types/theme/global/colors/wallet.d.ts +0 -0
- package/types/theme/global/colors/work.d.ts +0 -0
- package/types/theme/global/index.d.ts +0 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/sizes.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +0 -0
- package/types/types.d.ts +0 -0
- package/types/utils/functions.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
- package/.turbo/turbo-build:types.log +0 -2
- package/.turbo/turbo-lint.log +0 -146
- package/.turbo/turbo-test.log +0 -451
- package/.turbo/turbo-type-check.log +0 -1
- package/src/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.tsx +0 -120
- package/src/components/Tabs/ScrollableTabsV2/__tests__/ScrollableTabsV2.spec.tsx +0 -166
- package/src/components/Tabs/ScrollableTabsV2/__tests__/__snapshots__/ScrollableTabsV2.spec.tsx.snap +0 -2497
- package/src/components/Tabs/ScrollableTabsV2/index.tsx +0 -5
- package/types/components/Tabs/ScrollableTabsV2/SceneView.d.ts +0 -10
- package/types/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.d.ts +0 -9
- package/types/components/Tabs/ScrollableTabsV2/index.d.ts +0 -4
- /package/src/components/Tabs/{ScrollableTabsV2/__tests__ → __tests__}/__snapshots__/SceneView.spec.tsx.snap +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[36m@hero-design/rn:build[0m: cache hit, replaying output [
|
|
1
|
+
[36m@hero-design/rn:build[0m: cache hit, replaying output [2m5e28173315c89cb6[0m
|
|
2
2
|
[36m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
3
|
[36m@hero-design/rn:build: [0m$ rollup -c
|
|
4
4
|
[36m@hero-design/rn:build: [0m[36m
|
|
5
5
|
[36m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
6
|
[36m@hero-design/rn:build: [0m[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
7
|
-
[36m@hero-design/rn:build: [0m[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/
|
|
8
|
-
[36m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
7
|
+
[36m@hero-design/rn:build: [0m[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
8
|
+
[36m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m27.7s[22m[39m
|
|
9
9
|
[36m@hero-design/rn:build: [0m$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
[36m@hero-design/rn:publish:npm[0m: cache hit, replaying output [2m507c34f3e0a508f6[0m
|
|
2
|
-
[36m@hero-design/rn:publish:npm: [0m$ yarn publish --access public
|
|
3
|
-
[36m@hero-design/rn:publish:npm: [0m[1/4] Bumping version...
|
|
4
|
-
[36m@hero-design/rn:publish:npm: [0minfo Current version: 8.12.0-rc.0
|
|
5
|
-
[36m@hero-design/rn:publish:npm: [0m[2/4] Logging in...
|
|
6
|
-
[36m@hero-design/rn:publish:npm: [0m[3/4] Publishing...
|
|
7
|
-
[36m@hero-design/rn:publish:npm: [0msuccess Published.
|
|
8
|
-
[36m@hero-design/rn:publish:npm: [0m[4/4] Revoking token...
|
|
9
|
-
[36m@hero-design/rn:publish:npm: [0minfo Not revoking login token, specified via config file.
|
package/es/index.js
CHANGED
|
@@ -14938,7 +14938,7 @@ var StyledSuccessModal = index$a(Modal)({
|
|
|
14938
14938
|
width: '100%'
|
|
14939
14939
|
});
|
|
14940
14940
|
|
|
14941
|
-
var _excluded$2 = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress"];
|
|
14941
|
+
var _excluded$2 = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
|
|
14942
14942
|
var renderImage = function renderImage(image) {
|
|
14943
14943
|
if ( /*#__PURE__*/isValidElement(image)) {
|
|
14944
14944
|
return /*#__PURE__*/React.cloneElement(image, {
|
|
@@ -14962,13 +14962,20 @@ var SuccessPage = function SuccessPage(_ref) {
|
|
|
14962
14962
|
ctaText = _ref.ctaText,
|
|
14963
14963
|
_ref$onCtaPress = _ref.onCtaPress,
|
|
14964
14964
|
onCtaPress = _ref$onCtaPress === void 0 ? noop$1 : _ref$onCtaPress,
|
|
14965
|
+
secondaryCtaText = _ref.secondaryCtaText,
|
|
14966
|
+
onSecondaryCtaPress = _ref.onSecondaryCtaPress,
|
|
14965
14967
|
nativeProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
14968
|
+
var showSecondaryButton = secondaryCtaText && onSecondaryCtaPress;
|
|
14966
14969
|
return /*#__PURE__*/React.createElement(StyledSuccessContainer, _extends$1({
|
|
14967
14970
|
testID: testID,
|
|
14968
14971
|
themeVariant: variant
|
|
14969
14972
|
}, nativeProps), /*#__PURE__*/React.createElement(StyledSuccessContent, null, !!image && /*#__PURE__*/React.createElement(StyledSuccessImageContainer, null, renderImage(image)), /*#__PURE__*/React.createElement(StyledSuccessTitle, null, title), !!description && /*#__PURE__*/React.createElement(StyledSuccessDescription, null, description)), !!ctaText && /*#__PURE__*/React.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React.createElement(StyledSuccessButtonPrimary, {
|
|
14970
14973
|
text: ctaText,
|
|
14971
14974
|
onPress: onCtaPress
|
|
14975
|
+
}), !!showSecondaryButton && /*#__PURE__*/React.createElement(StyledSuccessButtonPrimary, {
|
|
14976
|
+
variant: "text",
|
|
14977
|
+
text: secondaryCtaText,
|
|
14978
|
+
onPress: onSecondaryCtaPress
|
|
14972
14979
|
})));
|
|
14973
14980
|
};
|
|
14974
14981
|
/**
|
|
@@ -15183,7 +15190,7 @@ var HeaderTabItem$1 = index$a(View)(function (_ref2) {
|
|
|
15183
15190
|
var ContentWrapper$1 = index$a(AnimatedPagerView)({
|
|
15184
15191
|
flex: 1
|
|
15185
15192
|
});
|
|
15186
|
-
|
|
15193
|
+
index$a(View)({
|
|
15187
15194
|
flex: 1
|
|
15188
15195
|
});
|
|
15189
15196
|
var StyledIndicator = index$a(Animated.View)(function (_ref3) {
|
|
@@ -15272,6 +15279,48 @@ var HeaderTabItemWrapper = index$a(View)(function (_ref5) {
|
|
|
15272
15279
|
};
|
|
15273
15280
|
});
|
|
15274
15281
|
|
|
15282
|
+
var SceneView = function SceneView(_ref) {
|
|
15283
|
+
var _ref$lazy = _ref.lazy,
|
|
15284
|
+
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15285
|
+
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15286
|
+
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15287
|
+
children = _ref.children,
|
|
15288
|
+
index = _ref.index,
|
|
15289
|
+
selectedIndex = _ref.selectedIndex,
|
|
15290
|
+
testID = _ref.testID;
|
|
15291
|
+
var _React$useState = React.useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
|
|
15292
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15293
|
+
isLoading = _React$useState2[0],
|
|
15294
|
+
setIsLoading = _React$useState2[1];
|
|
15295
|
+
var focused = index === selectedIndex;
|
|
15296
|
+
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
15297
|
+
// Always render the route when it becomes focused
|
|
15298
|
+
setIsLoading(false);
|
|
15299
|
+
}
|
|
15300
|
+
React.useEffect(function () {
|
|
15301
|
+
var timer;
|
|
15302
|
+
if (!lazy && isLoading) {
|
|
15303
|
+
// If lazy mode is not enabled, render the scene with a delay if not loaded already
|
|
15304
|
+
// This improves the initial startup time as the scene is no longer blocking
|
|
15305
|
+
timer = setTimeout(function () {
|
|
15306
|
+
return setIsLoading(false);
|
|
15307
|
+
}, 0);
|
|
15308
|
+
}
|
|
15309
|
+
return function () {
|
|
15310
|
+
clearTimeout(timer);
|
|
15311
|
+
};
|
|
15312
|
+
}, [index, isLoading, lazy, focused]);
|
|
15313
|
+
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15314
|
+
accessibilityElementsHidden: !focused,
|
|
15315
|
+
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
15316
|
+
style: [{
|
|
15317
|
+
flex: 1,
|
|
15318
|
+
overflow: 'hidden'
|
|
15319
|
+
}, focused ? StyleSheet$1.absoluteFill : null],
|
|
15320
|
+
testID: testID
|
|
15321
|
+
}, focused || !isLoading ? children : null);
|
|
15322
|
+
};
|
|
15323
|
+
|
|
15275
15324
|
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15276
15325
|
var refs = React.useRef([]);
|
|
15277
15326
|
refs.current.length = initialValues.length;
|
|
@@ -15442,121 +15491,6 @@ var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
|
|
|
15442
15491
|
}));
|
|
15443
15492
|
};
|
|
15444
15493
|
|
|
15445
|
-
var ScrollableTab$1 = function ScrollableTab(_ref) {
|
|
15446
|
-
var onTabPress = _ref.onTabPress,
|
|
15447
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
15448
|
-
tabs = _ref.tabs,
|
|
15449
|
-
containerStyle = _ref.containerStyle,
|
|
15450
|
-
barStyle = _ref.barStyle,
|
|
15451
|
-
_ref$lazy = _ref.lazy,
|
|
15452
|
-
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15453
|
-
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15454
|
-
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15455
|
-
_ref$swipeEnabled = _ref.swipeEnabled,
|
|
15456
|
-
swipeEnabled = _ref$swipeEnabled === void 0 ? true : _ref$swipeEnabled,
|
|
15457
|
-
componentTestID = _ref.testID;
|
|
15458
|
-
var pagerViewRef = React.useRef(null);
|
|
15459
|
-
var insets = useSafeAreaInsets();
|
|
15460
|
-
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15461
|
-
return item.key === selectedTabKey;
|
|
15462
|
-
});
|
|
15463
|
-
React.useEffect(function () {
|
|
15464
|
-
var timeoutHandle = null;
|
|
15465
|
-
if (selectedTabIndex !== -1) {
|
|
15466
|
-
// If the selected tab is changed too quickly, the setPage is crashed and not work anymore
|
|
15467
|
-
// We apply throttle to prevent this issue https://github.com/Thinkei/hero-design/issues/1715
|
|
15468
|
-
timeoutHandle = setTimeout(function () {
|
|
15469
|
-
var _pagerViewRef$current;
|
|
15470
|
-
// use no animation to prevent unexpected behavior if users select tab too quickly
|
|
15471
|
-
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPageWithoutAnimation(selectedTabIndex);
|
|
15472
|
-
}, 200);
|
|
15473
|
-
}
|
|
15474
|
-
return function () {
|
|
15475
|
-
if (timeoutHandle) {
|
|
15476
|
-
clearTimeout(timeoutHandle);
|
|
15477
|
-
}
|
|
15478
|
-
};
|
|
15479
|
-
}, [selectedTabIndex, pagerViewRef]);
|
|
15480
|
-
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
15481
|
-
style: containerStyle,
|
|
15482
|
-
testID: componentTestID
|
|
15483
|
-
}, /*#__PURE__*/React.createElement(ScrollableTabHeader, {
|
|
15484
|
-
tabs: tabs,
|
|
15485
|
-
selectedIndex: selectedTabIndex,
|
|
15486
|
-
onTabPress: onTabPress,
|
|
15487
|
-
barStyle: barStyle,
|
|
15488
|
-
insets: insets,
|
|
15489
|
-
testID: componentTestID ? "".concat(componentTestID, "-tab-bar") : undefined
|
|
15490
|
-
}), /*#__PURE__*/React.createElement(ContentWrapper, {
|
|
15491
|
-
initialPage: selectedTabIndex,
|
|
15492
|
-
ref: pagerViewRef,
|
|
15493
|
-
onPageSelected: function onPageSelected(e) {
|
|
15494
|
-
var index = e.nativeEvent.position;
|
|
15495
|
-
var selectedItem = tabs[index];
|
|
15496
|
-
if (selectedItem) {
|
|
15497
|
-
onTabPress(selectedItem.key);
|
|
15498
|
-
}
|
|
15499
|
-
},
|
|
15500
|
-
scrollEnabled: swipeEnabled
|
|
15501
|
-
}, tabs.map(function (tab, index) {
|
|
15502
|
-
var key = tab.key,
|
|
15503
|
-
component = tab.component,
|
|
15504
|
-
testID = tab.testID;
|
|
15505
|
-
var active = selectedTabKey === key;
|
|
15506
|
-
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
15507
|
-
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15508
|
-
key: key,
|
|
15509
|
-
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
15510
|
-
pointerEvents: active ? 'auto' : 'none',
|
|
15511
|
-
accessibilityElementsHidden: !active,
|
|
15512
|
-
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
15513
|
-
collapsable: false
|
|
15514
|
-
}, isLazyScreen ? null : component);
|
|
15515
|
-
})));
|
|
15516
|
-
};
|
|
15517
|
-
|
|
15518
|
-
var SceneView = function SceneView(_ref) {
|
|
15519
|
-
var _ref$lazy = _ref.lazy,
|
|
15520
|
-
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15521
|
-
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15522
|
-
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15523
|
-
children = _ref.children,
|
|
15524
|
-
index = _ref.index,
|
|
15525
|
-
selectedIndex = _ref.selectedIndex,
|
|
15526
|
-
testID = _ref.testID;
|
|
15527
|
-
var _React$useState = React.useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
|
|
15528
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15529
|
-
isLoading = _React$useState2[0],
|
|
15530
|
-
setIsLoading = _React$useState2[1];
|
|
15531
|
-
var focused = index === selectedIndex;
|
|
15532
|
-
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
15533
|
-
// Always render the route when it becomes focused
|
|
15534
|
-
setIsLoading(false);
|
|
15535
|
-
}
|
|
15536
|
-
React.useEffect(function () {
|
|
15537
|
-
var timer;
|
|
15538
|
-
if (!lazy && isLoading) {
|
|
15539
|
-
// If lazy mode is not enabled, render the scene with a delay if not loaded already
|
|
15540
|
-
// This improves the initial startup time as the scene is no longer blocking
|
|
15541
|
-
timer = setTimeout(function () {
|
|
15542
|
-
return setIsLoading(false);
|
|
15543
|
-
}, 0);
|
|
15544
|
-
}
|
|
15545
|
-
return function () {
|
|
15546
|
-
clearTimeout(timer);
|
|
15547
|
-
};
|
|
15548
|
-
}, [index, isLoading, lazy, focused]);
|
|
15549
|
-
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15550
|
-
accessibilityElementsHidden: !focused,
|
|
15551
|
-
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
15552
|
-
style: [{
|
|
15553
|
-
flex: 1,
|
|
15554
|
-
overflow: 'hidden'
|
|
15555
|
-
}, focused ? StyleSheet$1.absoluteFill : null],
|
|
15556
|
-
testID: testID
|
|
15557
|
-
}, focused || !isLoading ? children : null);
|
|
15558
|
-
};
|
|
15559
|
-
|
|
15560
15494
|
var TabContext = /*#__PURE__*/React.createContext(null);
|
|
15561
15495
|
var ScreenContext = /*#__PURE__*/React.createContext(null);
|
|
15562
15496
|
var useIsFocused = function useIsFocused() {
|
|
@@ -15568,6 +15502,7 @@ var useIsFocused = function useIsFocused() {
|
|
|
15568
15502
|
var isFocused = context.selectedTabKey === key;
|
|
15569
15503
|
return isFocused;
|
|
15570
15504
|
};
|
|
15505
|
+
|
|
15571
15506
|
var ScrollableTab = function ScrollableTab(_ref) {
|
|
15572
15507
|
var onTabPress = _ref.onTabPress,
|
|
15573
15508
|
selectedTabKey = _ref.selectedTabKey,
|
|
@@ -15603,7 +15538,6 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15603
15538
|
}
|
|
15604
15539
|
};
|
|
15605
15540
|
}, [selectedTabIndex, pagerViewRef]);
|
|
15606
|
-
var indexRef = React.useRef(selectedTabIndex);
|
|
15607
15541
|
var tabContextProviderValue = React.useMemo(function () {
|
|
15608
15542
|
return {
|
|
15609
15543
|
selectedTabKey: selectedTabKey
|
|
@@ -15632,7 +15566,6 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15632
15566
|
onTabPress(selectedItem.key);
|
|
15633
15567
|
});
|
|
15634
15568
|
}
|
|
15635
|
-
indexRef.current = index;
|
|
15636
15569
|
},
|
|
15637
15570
|
scrollEnabled: swipeEnabled
|
|
15638
15571
|
}, tabs.map(function (tab, index) {
|
|
@@ -15640,22 +15573,18 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15640
15573
|
component = tab.component,
|
|
15641
15574
|
testID = tab.testID;
|
|
15642
15575
|
return /*#__PURE__*/React.createElement(ScreenContext.Provider, {
|
|
15643
|
-
value: key
|
|
15576
|
+
value: key,
|
|
15577
|
+
key: key
|
|
15644
15578
|
}, /*#__PURE__*/React.createElement(SceneView, {
|
|
15645
15579
|
testID: testID,
|
|
15646
|
-
key: key,
|
|
15647
15580
|
index: index,
|
|
15648
|
-
selectedIndex:
|
|
15581
|
+
selectedIndex: selectedTabIndex,
|
|
15649
15582
|
lazy: lazy,
|
|
15650
15583
|
lazyPreloadDistance: lazyPreloadDistance
|
|
15651
15584
|
}, component));
|
|
15652
15585
|
}))));
|
|
15653
15586
|
};
|
|
15654
15587
|
|
|
15655
|
-
var ScrollableTabsV2 = Object.assign(ScrollableTab, {
|
|
15656
|
-
useIsFocused: useIsFocused
|
|
15657
|
-
});
|
|
15658
|
-
|
|
15659
15588
|
var getTabItem = function getTabItem(_ref) {
|
|
15660
15589
|
var item = _ref.item,
|
|
15661
15590
|
color = _ref.color,
|
|
@@ -15704,7 +15633,14 @@ var Tabs = function Tabs(_ref2) {
|
|
|
15704
15633
|
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(selectedTabIndex);
|
|
15705
15634
|
}
|
|
15706
15635
|
}, [selectedTabIndex]);
|
|
15707
|
-
|
|
15636
|
+
var tabContextProviderValue = React.useMemo(function () {
|
|
15637
|
+
return {
|
|
15638
|
+
selectedTabKey: selectedTabKey
|
|
15639
|
+
};
|
|
15640
|
+
}, [selectedTabKey]);
|
|
15641
|
+
return /*#__PURE__*/React.createElement(TabContext.Provider, {
|
|
15642
|
+
value: tabContextProviderValue
|
|
15643
|
+
}, /*#__PURE__*/React.createElement(TabContainer$1, {
|
|
15708
15644
|
style: containerStyle,
|
|
15709
15645
|
testID: componentTestID
|
|
15710
15646
|
}, /*#__PURE__*/React.createElement(HeaderTabWrapper$1, {
|
|
@@ -15769,21 +15705,22 @@ var Tabs = function Tabs(_ref2) {
|
|
|
15769
15705
|
var key = tab.key,
|
|
15770
15706
|
component = tab.component,
|
|
15771
15707
|
testID = tab.testID;
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15708
|
+
return /*#__PURE__*/React.createElement(ScreenContext.Provider, {
|
|
15709
|
+
value: key,
|
|
15710
|
+
key: key
|
|
15711
|
+
}, /*#__PURE__*/React.createElement(SceneView, {
|
|
15712
|
+
testID: testID,
|
|
15775
15713
|
key: key,
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15782
|
-
})));
|
|
15714
|
+
index: index,
|
|
15715
|
+
selectedIndex: selectedTabIndex,
|
|
15716
|
+
lazy: lazy,
|
|
15717
|
+
lazyPreloadDistance: lazyPreloadDistance
|
|
15718
|
+
}, component));
|
|
15719
|
+
}))));
|
|
15783
15720
|
};
|
|
15784
15721
|
var index$2 = Object.assign(Tabs, {
|
|
15785
|
-
Scroll: ScrollableTab
|
|
15786
|
-
|
|
15722
|
+
Scroll: ScrollableTab,
|
|
15723
|
+
useIsFocused: useIsFocused
|
|
15787
15724
|
});
|
|
15788
15725
|
|
|
15789
15726
|
var getFilledStyles = function getFilledStyles(themeIntent, theme) {
|
|
@@ -32672,11 +32609,10 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
32672
32609
|
return "\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0\">\n <style>\n body {\n margin: 0;\n }\n </style>\n </head>\n <body>\n <div id=\"root\"></div>\n <script>\n window.__editorConfigs = {\n placeholder: \"".concat(placeholder, "\",\n initialValue: ").concat(initialValueString, ",\n isAndroid: ").concat(isAndroid ? 'true' : 'false', ",\n autoFocus: ").concat(autoFocus, ",\n style: {\n padding: '0 !important',\n fontSize: ").concat(theme.__hd__.richTextEditor.fontSizes.editor, ",\n color: '").concat(theme.__hd__.richTextEditor.colors.text, "'\n }\n };\n ").concat(heroEditorApp, "\n </script>\n </body>\n </html>\n ");
|
|
32673
32610
|
}, []);
|
|
32674
32611
|
var requestBlur = useCallback(function () {
|
|
32675
|
-
if (webview.current) {
|
|
32612
|
+
if (webview.current && isFocused) {
|
|
32676
32613
|
requestBlurEditor(webview.current);
|
|
32677
|
-
Keyboard.dismiss();
|
|
32678
32614
|
}
|
|
32679
|
-
}, []);
|
|
32615
|
+
}, [isFocused]);
|
|
32680
32616
|
useImperativeHandle(forwardedRef, function () {
|
|
32681
32617
|
return {
|
|
32682
32618
|
requestBlur: requestBlur
|
package/lib/index.js
CHANGED
|
@@ -14968,7 +14968,7 @@ var StyledSuccessModal = index$a(reactNative.Modal)({
|
|
|
14968
14968
|
width: '100%'
|
|
14969
14969
|
});
|
|
14970
14970
|
|
|
14971
|
-
var _excluded$2 = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress"];
|
|
14971
|
+
var _excluded$2 = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
|
|
14972
14972
|
var renderImage = function renderImage(image) {
|
|
14973
14973
|
if ( /*#__PURE__*/React.isValidElement(image)) {
|
|
14974
14974
|
return /*#__PURE__*/React__default["default"].cloneElement(image, {
|
|
@@ -14992,13 +14992,20 @@ var SuccessPage = function SuccessPage(_ref) {
|
|
|
14992
14992
|
ctaText = _ref.ctaText,
|
|
14993
14993
|
_ref$onCtaPress = _ref.onCtaPress,
|
|
14994
14994
|
onCtaPress = _ref$onCtaPress === void 0 ? noop$1 : _ref$onCtaPress,
|
|
14995
|
+
secondaryCtaText = _ref.secondaryCtaText,
|
|
14996
|
+
onSecondaryCtaPress = _ref.onSecondaryCtaPress,
|
|
14995
14997
|
nativeProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
14998
|
+
var showSecondaryButton = secondaryCtaText && onSecondaryCtaPress;
|
|
14996
14999
|
return /*#__PURE__*/React__default["default"].createElement(StyledSuccessContainer, _extends$1({
|
|
14997
15000
|
testID: testID,
|
|
14998
15001
|
themeVariant: variant
|
|
14999
15002
|
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledSuccessContent, null, !!image && /*#__PURE__*/React__default["default"].createElement(StyledSuccessImageContainer, null, renderImage(image)), /*#__PURE__*/React__default["default"].createElement(StyledSuccessTitle, null, title), !!description && /*#__PURE__*/React__default["default"].createElement(StyledSuccessDescription, null, description)), !!ctaText && /*#__PURE__*/React__default["default"].createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__default["default"].createElement(StyledSuccessButtonPrimary, {
|
|
15000
15003
|
text: ctaText,
|
|
15001
15004
|
onPress: onCtaPress
|
|
15005
|
+
}), !!showSecondaryButton && /*#__PURE__*/React__default["default"].createElement(StyledSuccessButtonPrimary, {
|
|
15006
|
+
variant: "text",
|
|
15007
|
+
text: secondaryCtaText,
|
|
15008
|
+
onPress: onSecondaryCtaPress
|
|
15002
15009
|
})));
|
|
15003
15010
|
};
|
|
15004
15011
|
/**
|
|
@@ -15213,7 +15220,7 @@ var HeaderTabItem$1 = index$a(reactNative.View)(function (_ref2) {
|
|
|
15213
15220
|
var ContentWrapper$1 = index$a(AnimatedPagerView)({
|
|
15214
15221
|
flex: 1
|
|
15215
15222
|
});
|
|
15216
|
-
|
|
15223
|
+
index$a(reactNative.View)({
|
|
15217
15224
|
flex: 1
|
|
15218
15225
|
});
|
|
15219
15226
|
var StyledIndicator = index$a(reactNative.Animated.View)(function (_ref3) {
|
|
@@ -15302,6 +15309,48 @@ var HeaderTabItemWrapper = index$a(reactNative.View)(function (_ref5) {
|
|
|
15302
15309
|
};
|
|
15303
15310
|
});
|
|
15304
15311
|
|
|
15312
|
+
var SceneView = function SceneView(_ref) {
|
|
15313
|
+
var _ref$lazy = _ref.lazy,
|
|
15314
|
+
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15315
|
+
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15316
|
+
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15317
|
+
children = _ref.children,
|
|
15318
|
+
index = _ref.index,
|
|
15319
|
+
selectedIndex = _ref.selectedIndex,
|
|
15320
|
+
testID = _ref.testID;
|
|
15321
|
+
var _React$useState = React__default["default"].useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
|
|
15322
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15323
|
+
isLoading = _React$useState2[0],
|
|
15324
|
+
setIsLoading = _React$useState2[1];
|
|
15325
|
+
var focused = index === selectedIndex;
|
|
15326
|
+
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
15327
|
+
// Always render the route when it becomes focused
|
|
15328
|
+
setIsLoading(false);
|
|
15329
|
+
}
|
|
15330
|
+
React__default["default"].useEffect(function () {
|
|
15331
|
+
var timer;
|
|
15332
|
+
if (!lazy && isLoading) {
|
|
15333
|
+
// If lazy mode is not enabled, render the scene with a delay if not loaded already
|
|
15334
|
+
// This improves the initial startup time as the scene is no longer blocking
|
|
15335
|
+
timer = setTimeout(function () {
|
|
15336
|
+
return setIsLoading(false);
|
|
15337
|
+
}, 0);
|
|
15338
|
+
}
|
|
15339
|
+
return function () {
|
|
15340
|
+
clearTimeout(timer);
|
|
15341
|
+
};
|
|
15342
|
+
}, [index, isLoading, lazy, focused]);
|
|
15343
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
15344
|
+
accessibilityElementsHidden: !focused,
|
|
15345
|
+
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
15346
|
+
style: [{
|
|
15347
|
+
flex: 1,
|
|
15348
|
+
overflow: 'hidden'
|
|
15349
|
+
}, focused ? reactNative.StyleSheet.absoluteFill : null],
|
|
15350
|
+
testID: testID
|
|
15351
|
+
}, focused || !isLoading ? children : null);
|
|
15352
|
+
};
|
|
15353
|
+
|
|
15305
15354
|
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15306
15355
|
var refs = React__default["default"].useRef([]);
|
|
15307
15356
|
refs.current.length = initialValues.length;
|
|
@@ -15472,121 +15521,6 @@ var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
|
|
|
15472
15521
|
}));
|
|
15473
15522
|
};
|
|
15474
15523
|
|
|
15475
|
-
var ScrollableTab$1 = function ScrollableTab(_ref) {
|
|
15476
|
-
var onTabPress = _ref.onTabPress,
|
|
15477
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
15478
|
-
tabs = _ref.tabs,
|
|
15479
|
-
containerStyle = _ref.containerStyle,
|
|
15480
|
-
barStyle = _ref.barStyle,
|
|
15481
|
-
_ref$lazy = _ref.lazy,
|
|
15482
|
-
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15483
|
-
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15484
|
-
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15485
|
-
_ref$swipeEnabled = _ref.swipeEnabled,
|
|
15486
|
-
swipeEnabled = _ref$swipeEnabled === void 0 ? true : _ref$swipeEnabled,
|
|
15487
|
-
componentTestID = _ref.testID;
|
|
15488
|
-
var pagerViewRef = React__default["default"].useRef(null);
|
|
15489
|
-
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
15490
|
-
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15491
|
-
return item.key === selectedTabKey;
|
|
15492
|
-
});
|
|
15493
|
-
React__default["default"].useEffect(function () {
|
|
15494
|
-
var timeoutHandle = null;
|
|
15495
|
-
if (selectedTabIndex !== -1) {
|
|
15496
|
-
// If the selected tab is changed too quickly, the setPage is crashed and not work anymore
|
|
15497
|
-
// We apply throttle to prevent this issue https://github.com/Thinkei/hero-design/issues/1715
|
|
15498
|
-
timeoutHandle = setTimeout(function () {
|
|
15499
|
-
var _pagerViewRef$current;
|
|
15500
|
-
// use no animation to prevent unexpected behavior if users select tab too quickly
|
|
15501
|
-
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPageWithoutAnimation(selectedTabIndex);
|
|
15502
|
-
}, 200);
|
|
15503
|
-
}
|
|
15504
|
-
return function () {
|
|
15505
|
-
if (timeoutHandle) {
|
|
15506
|
-
clearTimeout(timeoutHandle);
|
|
15507
|
-
}
|
|
15508
|
-
};
|
|
15509
|
-
}, [selectedTabIndex, pagerViewRef]);
|
|
15510
|
-
return /*#__PURE__*/React__default["default"].createElement(TabContainer, {
|
|
15511
|
-
style: containerStyle,
|
|
15512
|
-
testID: componentTestID
|
|
15513
|
-
}, /*#__PURE__*/React__default["default"].createElement(ScrollableTabHeader, {
|
|
15514
|
-
tabs: tabs,
|
|
15515
|
-
selectedIndex: selectedTabIndex,
|
|
15516
|
-
onTabPress: onTabPress,
|
|
15517
|
-
barStyle: barStyle,
|
|
15518
|
-
insets: insets,
|
|
15519
|
-
testID: componentTestID ? "".concat(componentTestID, "-tab-bar") : undefined
|
|
15520
|
-
}), /*#__PURE__*/React__default["default"].createElement(ContentWrapper, {
|
|
15521
|
-
initialPage: selectedTabIndex,
|
|
15522
|
-
ref: pagerViewRef,
|
|
15523
|
-
onPageSelected: function onPageSelected(e) {
|
|
15524
|
-
var index = e.nativeEvent.position;
|
|
15525
|
-
var selectedItem = tabs[index];
|
|
15526
|
-
if (selectedItem) {
|
|
15527
|
-
onTabPress(selectedItem.key);
|
|
15528
|
-
}
|
|
15529
|
-
},
|
|
15530
|
-
scrollEnabled: swipeEnabled
|
|
15531
|
-
}, tabs.map(function (tab, index) {
|
|
15532
|
-
var key = tab.key,
|
|
15533
|
-
component = tab.component,
|
|
15534
|
-
testID = tab.testID;
|
|
15535
|
-
var active = selectedTabKey === key;
|
|
15536
|
-
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
15537
|
-
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
15538
|
-
key: key,
|
|
15539
|
-
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
15540
|
-
pointerEvents: active ? 'auto' : 'none',
|
|
15541
|
-
accessibilityElementsHidden: !active,
|
|
15542
|
-
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
15543
|
-
collapsable: false
|
|
15544
|
-
}, isLazyScreen ? null : component);
|
|
15545
|
-
})));
|
|
15546
|
-
};
|
|
15547
|
-
|
|
15548
|
-
var SceneView = function SceneView(_ref) {
|
|
15549
|
-
var _ref$lazy = _ref.lazy,
|
|
15550
|
-
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15551
|
-
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15552
|
-
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15553
|
-
children = _ref.children,
|
|
15554
|
-
index = _ref.index,
|
|
15555
|
-
selectedIndex = _ref.selectedIndex,
|
|
15556
|
-
testID = _ref.testID;
|
|
15557
|
-
var _React$useState = React__default["default"].useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
|
|
15558
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15559
|
-
isLoading = _React$useState2[0],
|
|
15560
|
-
setIsLoading = _React$useState2[1];
|
|
15561
|
-
var focused = index === selectedIndex;
|
|
15562
|
-
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
15563
|
-
// Always render the route when it becomes focused
|
|
15564
|
-
setIsLoading(false);
|
|
15565
|
-
}
|
|
15566
|
-
React__default["default"].useEffect(function () {
|
|
15567
|
-
var timer;
|
|
15568
|
-
if (!lazy && isLoading) {
|
|
15569
|
-
// If lazy mode is not enabled, render the scene with a delay if not loaded already
|
|
15570
|
-
// This improves the initial startup time as the scene is no longer blocking
|
|
15571
|
-
timer = setTimeout(function () {
|
|
15572
|
-
return setIsLoading(false);
|
|
15573
|
-
}, 0);
|
|
15574
|
-
}
|
|
15575
|
-
return function () {
|
|
15576
|
-
clearTimeout(timer);
|
|
15577
|
-
};
|
|
15578
|
-
}, [index, isLoading, lazy, focused]);
|
|
15579
|
-
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
15580
|
-
accessibilityElementsHidden: !focused,
|
|
15581
|
-
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
15582
|
-
style: [{
|
|
15583
|
-
flex: 1,
|
|
15584
|
-
overflow: 'hidden'
|
|
15585
|
-
}, focused ? reactNative.StyleSheet.absoluteFill : null],
|
|
15586
|
-
testID: testID
|
|
15587
|
-
}, focused || !isLoading ? children : null);
|
|
15588
|
-
};
|
|
15589
|
-
|
|
15590
15524
|
var TabContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
15591
15525
|
var ScreenContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
15592
15526
|
var useIsFocused = function useIsFocused() {
|
|
@@ -15598,6 +15532,7 @@ var useIsFocused = function useIsFocused() {
|
|
|
15598
15532
|
var isFocused = context.selectedTabKey === key;
|
|
15599
15533
|
return isFocused;
|
|
15600
15534
|
};
|
|
15535
|
+
|
|
15601
15536
|
var ScrollableTab = function ScrollableTab(_ref) {
|
|
15602
15537
|
var onTabPress = _ref.onTabPress,
|
|
15603
15538
|
selectedTabKey = _ref.selectedTabKey,
|
|
@@ -15633,7 +15568,6 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15633
15568
|
}
|
|
15634
15569
|
};
|
|
15635
15570
|
}, [selectedTabIndex, pagerViewRef]);
|
|
15636
|
-
var indexRef = React__default["default"].useRef(selectedTabIndex);
|
|
15637
15571
|
var tabContextProviderValue = React__default["default"].useMemo(function () {
|
|
15638
15572
|
return {
|
|
15639
15573
|
selectedTabKey: selectedTabKey
|
|
@@ -15662,7 +15596,6 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15662
15596
|
onTabPress(selectedItem.key);
|
|
15663
15597
|
});
|
|
15664
15598
|
}
|
|
15665
|
-
indexRef.current = index;
|
|
15666
15599
|
},
|
|
15667
15600
|
scrollEnabled: swipeEnabled
|
|
15668
15601
|
}, tabs.map(function (tab, index) {
|
|
@@ -15670,22 +15603,18 @@ var ScrollableTab = function ScrollableTab(_ref) {
|
|
|
15670
15603
|
component = tab.component,
|
|
15671
15604
|
testID = tab.testID;
|
|
15672
15605
|
return /*#__PURE__*/React__default["default"].createElement(ScreenContext.Provider, {
|
|
15673
|
-
value: key
|
|
15606
|
+
value: key,
|
|
15607
|
+
key: key
|
|
15674
15608
|
}, /*#__PURE__*/React__default["default"].createElement(SceneView, {
|
|
15675
15609
|
testID: testID,
|
|
15676
|
-
key: key,
|
|
15677
15610
|
index: index,
|
|
15678
|
-
selectedIndex:
|
|
15611
|
+
selectedIndex: selectedTabIndex,
|
|
15679
15612
|
lazy: lazy,
|
|
15680
15613
|
lazyPreloadDistance: lazyPreloadDistance
|
|
15681
15614
|
}, component));
|
|
15682
15615
|
}))));
|
|
15683
15616
|
};
|
|
15684
15617
|
|
|
15685
|
-
var ScrollableTabsV2 = Object.assign(ScrollableTab, {
|
|
15686
|
-
useIsFocused: useIsFocused
|
|
15687
|
-
});
|
|
15688
|
-
|
|
15689
15618
|
var getTabItem = function getTabItem(_ref) {
|
|
15690
15619
|
var item = _ref.item,
|
|
15691
15620
|
color = _ref.color,
|
|
@@ -15734,7 +15663,14 @@ var Tabs = function Tabs(_ref2) {
|
|
|
15734
15663
|
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(selectedTabIndex);
|
|
15735
15664
|
}
|
|
15736
15665
|
}, [selectedTabIndex]);
|
|
15737
|
-
|
|
15666
|
+
var tabContextProviderValue = React__default["default"].useMemo(function () {
|
|
15667
|
+
return {
|
|
15668
|
+
selectedTabKey: selectedTabKey
|
|
15669
|
+
};
|
|
15670
|
+
}, [selectedTabKey]);
|
|
15671
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContext.Provider, {
|
|
15672
|
+
value: tabContextProviderValue
|
|
15673
|
+
}, /*#__PURE__*/React__default["default"].createElement(TabContainer$1, {
|
|
15738
15674
|
style: containerStyle,
|
|
15739
15675
|
testID: componentTestID
|
|
15740
15676
|
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper$1, {
|
|
@@ -15799,21 +15735,22 @@ var Tabs = function Tabs(_ref2) {
|
|
|
15799
15735
|
var key = tab.key,
|
|
15800
15736
|
component = tab.component,
|
|
15801
15737
|
testID = tab.testID;
|
|
15802
|
-
|
|
15803
|
-
|
|
15804
|
-
|
|
15738
|
+
return /*#__PURE__*/React__default["default"].createElement(ScreenContext.Provider, {
|
|
15739
|
+
value: key,
|
|
15740
|
+
key: key
|
|
15741
|
+
}, /*#__PURE__*/React__default["default"].createElement(SceneView, {
|
|
15742
|
+
testID: testID,
|
|
15805
15743
|
key: key,
|
|
15806
|
-
|
|
15807
|
-
|
|
15808
|
-
|
|
15809
|
-
|
|
15810
|
-
|
|
15811
|
-
|
|
15812
|
-
})));
|
|
15744
|
+
index: index,
|
|
15745
|
+
selectedIndex: selectedTabIndex,
|
|
15746
|
+
lazy: lazy,
|
|
15747
|
+
lazyPreloadDistance: lazyPreloadDistance
|
|
15748
|
+
}, component));
|
|
15749
|
+
}))));
|
|
15813
15750
|
};
|
|
15814
15751
|
var index$2 = Object.assign(Tabs, {
|
|
15815
|
-
Scroll: ScrollableTab
|
|
15816
|
-
|
|
15752
|
+
Scroll: ScrollableTab,
|
|
15753
|
+
useIsFocused: useIsFocused
|
|
15817
15754
|
});
|
|
15818
15755
|
|
|
15819
15756
|
var getFilledStyles = function getFilledStyles(themeIntent, theme) {
|
|
@@ -32702,11 +32639,10 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
32702
32639
|
return "\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0\">\n <style>\n body {\n margin: 0;\n }\n </style>\n </head>\n <body>\n <div id=\"root\"></div>\n <script>\n window.__editorConfigs = {\n placeholder: \"".concat(placeholder, "\",\n initialValue: ").concat(initialValueString, ",\n isAndroid: ").concat(isAndroid ? 'true' : 'false', ",\n autoFocus: ").concat(autoFocus, ",\n style: {\n padding: '0 !important',\n fontSize: ").concat(theme.__hd__.richTextEditor.fontSizes.editor, ",\n color: '").concat(theme.__hd__.richTextEditor.colors.text, "'\n }\n };\n ").concat(heroEditorApp, "\n </script>\n </body>\n </html>\n ");
|
|
32703
32640
|
}, []);
|
|
32704
32641
|
var requestBlur = React.useCallback(function () {
|
|
32705
|
-
if (webview.current) {
|
|
32642
|
+
if (webview.current && isFocused) {
|
|
32706
32643
|
requestBlurEditor(webview.current);
|
|
32707
|
-
reactNative.Keyboard.dismiss();
|
|
32708
32644
|
}
|
|
32709
|
-
}, []);
|
|
32645
|
+
}, [isFocused]);
|
|
32710
32646
|
React.useImperativeHandle(forwardedRef, function () {
|
|
32711
32647
|
return {
|
|
32712
32648
|
requestBlur: requestBlur
|