@sendbird/uikit-react-native-foundation 3.7.5 → 3.8.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/commonjs/assets/bundle-icons.js.map +1 -1
- package/lib/commonjs/assets/icon/icon-thread.png +0 -0
- package/lib/commonjs/assets/icon/icon-thread@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-thread@3x.png +0 -0
- package/lib/commonjs/assets/icon/index.js +1 -2
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Box/index.js +8 -10
- package/lib/commonjs/components/Box/index.js.map +1 -1
- package/lib/commonjs/components/Divider/index.js +6 -8
- package/lib/commonjs/components/Divider/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +36 -18
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Image/FastImageInternal.js +1 -2
- package/lib/commonjs/components/Image/FastImageInternal.js.map +1 -1
- package/lib/commonjs/components/Image/Image.fastimage.js +14 -17
- package/lib/commonjs/components/Image/Image.fastimage.js.map +1 -1
- package/lib/commonjs/components/Image/Image.reactnative.js +10 -12
- package/lib/commonjs/components/Image/Image.reactnative.js.map +1 -1
- package/lib/commonjs/components/Image/index.js +1 -2
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/components/ImageWithPlaceholder/index.js +5 -7
- package/lib/commonjs/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +28 -37
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/PressBox/index.js +17 -20
- package/lib/commonjs/components/PressBox/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +24 -16
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib/commonjs/components/RegexText/index.js +11 -14
- package/lib/commonjs/components/RegexText/index.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +19 -19
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +46 -29
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/TextInput/index.js +38 -18
- package/lib/commonjs/components/TextInput/index.js.map +1 -1
- package/lib/commonjs/components/VideoThumbnail/index.js +11 -13
- package/lib/commonjs/components/VideoThumbnail/index.js.map +1 -1
- package/lib/commonjs/index.js +3 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js +8 -10
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createScaleFactor.js +3 -6
- package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
- package/lib/commonjs/styles/createSelectByColorScheme.js +1 -2
- package/lib/commonjs/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/commonjs/styles/createStyleSheet.js +9 -4
- package/lib/commonjs/styles/createStyleSheet.js.map +1 -1
- package/lib/commonjs/styles/createTypography.js +2 -5
- package/lib/commonjs/styles/createTypography.js.map +1 -1
- package/lib/commonjs/styles/getDefaultHeaderHeight.js +1 -2
- package/lib/commonjs/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/styles/useHeaderStyle.js +1 -2
- package/lib/commonjs/styles/useHeaderStyle.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +2 -3
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +2 -3
- package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/Palette.js +1 -2
- package/lib/commonjs/theme/Palette.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeContext.js +2 -3
- package/lib/commonjs/theme/UIKitThemeContext.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeProvider.js +6 -8
- package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/createTheme.js +11 -13
- package/lib/commonjs/theme/createTheme.js.map +1 -1
- package/lib/commonjs/theme/useUIKitTheme.js +2 -3
- package/lib/commonjs/theme/useUIKitTheme.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +17 -17
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js +23 -29
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js +13 -15
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js +8 -10
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarStack.js +13 -15
- package/lib/commonjs/ui/Avatar/AvatarStack.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +14 -17
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +10 -12
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +30 -39
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js +19 -23
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js +8 -10
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogBox.js +6 -8
- package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js +23 -22
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js +11 -12
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.admin.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.admin.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.image.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.image.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.js +6 -8
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js +8 -9
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js +5 -7
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.js +8 -12
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.og.js +16 -20
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.og.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageBubbleWithText.js +28 -24
- package/lib/commonjs/ui/GroupChannelMessage/MessageBubbleWithText.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js +29 -31
- package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js +38 -43
- package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/index.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +55 -61
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +45 -56
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js +14 -18
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +23 -21
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js +6 -8
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js +6 -8
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js +28 -20
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js +54 -49
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js +16 -19
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/index.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelPreview/index.js +25 -30
- package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/OutlinedButton/index.js +7 -9
- package/lib/commonjs/ui/OutlinedButton/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js +9 -11
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/ProfileCard/index.js +11 -12
- package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js +30 -37
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js +21 -27
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/commonjs/ui/TypingIndicatorBubble/index.js +25 -32
- package/lib/commonjs/ui/TypingIndicatorBubble/index.js.map +1 -1
- package/lib/module/assets/bundle-icons.js.map +1 -1
- package/lib/module/assets/icon/icon-thread.png +0 -0
- package/lib/module/assets/icon/icon-thread@2x.png +0 -0
- package/lib/module/assets/icon/icon-thread@3x.png +0 -0
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Box/index.js +6 -7
- package/lib/module/components/Box/index.js.map +1 -1
- package/lib/module/components/Divider/index.js +4 -5
- package/lib/module/components/Divider/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +35 -16
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Image/FastImageInternal.js.map +1 -1
- package/lib/module/components/Image/Image.fastimage.js +12 -14
- package/lib/module/components/Image/Image.fastimage.js.map +1 -1
- package/lib/module/components/Image/Image.reactnative.js +8 -9
- package/lib/module/components/Image/Image.reactnative.js.map +1 -1
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/components/ImageWithPlaceholder/index.js +1 -2
- package/lib/module/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +24 -32
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/PressBox/index.js +10 -12
- package/lib/module/components/PressBox/index.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +21 -12
- package/lib/module/components/ProgressBar/index.js.map +1 -1
- package/lib/module/components/RegexText/index.js +9 -11
- package/lib/module/components/RegexText/index.js.map +1 -1
- package/lib/module/components/Switch/index.js +16 -15
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Text/index.js +45 -27
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/TextInput/index.js +37 -16
- package/lib/module/components/TextInput/index.js.map +1 -1
- package/lib/module/components/VideoThumbnail/index.js +8 -10
- package/lib/module/components/VideoThumbnail/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js +6 -7
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createScaleFactor.js +1 -2
- package/lib/module/styles/createScaleFactor.js.map +1 -1
- package/lib/module/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/module/styles/createStyleSheet.js +8 -2
- package/lib/module/styles/createStyleSheet.js.map +1 -1
- package/lib/module/styles/createTypography.js +1 -3
- package/lib/module/styles/createTypography.js.map +1 -1
- package/lib/module/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/styles/useHeaderStyle.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js.map +1 -1
- package/lib/module/theme/Palette.js.map +1 -1
- package/lib/module/theme/UIKitThemeContext.js.map +1 -1
- package/lib/module/theme/UIKitThemeProvider.js +4 -5
- package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/module/theme/createTheme.js +9 -10
- package/lib/module/theme/createTheme.js.map +1 -1
- package/lib/module/theme/useUIKitTheme.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +13 -12
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js +21 -26
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js +11 -12
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js +6 -7
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarStack.js +11 -12
- package/lib/module/ui/Avatar/AvatarStack.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +10 -12
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js +8 -9
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +28 -36
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js +17 -20
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js +6 -7
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogBox.js +4 -5
- package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js +21 -19
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/Dialog/index.js +8 -9
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.admin.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.image.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.js +4 -5
- package/lib/module/ui/GroupChannelMessage/Message.file.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js +4 -4
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js +3 -4
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.user.js +6 -9
- package/lib/module/ui/GroupChannelMessage/Message.user.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.user.og.js +14 -17
- package/lib/module/ui/GroupChannelMessage/Message.user.og.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageBubbleWithText.js +26 -21
- package/lib/module/ui/GroupChannelMessage/MessageBubbleWithText.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageContainer.js +27 -28
- package/lib/module/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js +36 -40
- package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +53 -58
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +44 -54
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js +10 -13
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +21 -18
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.js +4 -5
- package/lib/module/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js +4 -5
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.js +26 -17
- package/lib/module/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js +52 -46
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js +14 -16
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/module/ui/OpenChannelPreview/index.js +23 -27
- package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/module/ui/OutlinedButton/index.js +5 -6
- package/lib/module/ui/OutlinedButton/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js +7 -8
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/ProfileCard/index.js +9 -9
- package/lib/module/ui/ProfileCard/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js +26 -32
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js +17 -22
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/module/ui/TypingIndicatorBubble/index.js +21 -27
- package/lib/module/ui/TypingIndicatorBubble/index.js.map +1 -1
- package/lib/typescript/src/components/Box/index.d.ts +12 -2
- package/lib/typescript/src/components/Icon/index.d.ts +2 -1
- package/lib/typescript/src/components/Text/index.d.ts +14 -2
- package/lib/typescript/src/components/TextInput/index.d.ts +2 -1
- package/package.json +3 -3
- package/src/assets/icon/icon-thread.png +0 -0
- package/src/assets/icon/icon-thread@2x.png +0 -0
- package/src/assets/icon/icon-thread@3x.png +0 -0
- package/src/components/Box/index.tsx +16 -5
- package/src/components/Icon/index.tsx +35 -3
- package/src/components/ProgressBar/index.tsx +23 -12
- package/src/components/Switch/index.tsx +10 -6
- package/src/components/Text/index.tsx +48 -7
- package/src/components/TextInput/index.tsx +39 -12
- package/src/styles/createStyleSheet.ts +8 -2
- package/src/ui/ActionMenu/index.tsx +3 -1
- package/src/ui/Alert/index.tsx +4 -4
- package/src/ui/Avatar/AvatarGroup.tsx +6 -6
- package/src/ui/Avatar/AvatarStack.tsx +3 -3
- package/src/ui/BottomSheet/index.tsx +5 -4
- package/src/ui/Button/index.tsx +1 -1
- package/src/ui/Dialog/DialogSheet.tsx +15 -12
- package/src/ui/GroupChannelMessage/Message.file.tsx +1 -1
- package/src/ui/GroupChannelMessage/Message.file.voice.tsx +1 -1
- package/src/ui/GroupChannelMessage/MessageBubbleWithText.tsx +5 -2
- package/src/ui/GroupChannelMessage/MessageContainer.tsx +7 -7
- package/src/ui/GroupChannelPreview/index.tsx +46 -48
- package/src/ui/Header/index.tsx +4 -5
- package/src/ui/MenuBar/index.tsx +9 -6
- package/src/ui/OpenChannelMessage/Message.file.tsx +1 -1
- package/src/ui/OpenChannelMessage/Message.user.og.tsx +43 -29
- package/src/ui/OpenChannelMessage/Message.user.tsx +46 -29
- package/src/ui/OpenChannelMessage/MessageContainer.tsx +4 -4
- package/src/ui/OpenChannelPreview/index.tsx +9 -9
- package/src/ui/ProfileCard/index.tsx +1 -0
- package/src/ui/Prompt/index.tsx +4 -5
- package/src/ui/Toast/index.tsx +1 -1
- package/src/ui/TypingIndicatorBubble/index.tsx +2 -2
|
@@ -9,10 +9,10 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _createStyleSheet = _interopRequireDefault(require("../../styles/createStyleSheet"));
|
|
10
10
|
var _useHeaderStyle = _interopRequireDefault(require("../../styles/useHeaderStyle"));
|
|
11
11
|
var _useUIKitTheme = _interopRequireDefault(require("../../theme/useUIKitTheme"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
16
|
/**
|
|
17
17
|
* Modal Open: Triggered by Modal.props.visible state changed to true
|
|
18
18
|
* - visible true -> modalVisible true -> animation start
|
|
@@ -20,19 +20,18 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
20
20
|
* Modal Close: Triggered by Modal.props.onClose() call
|
|
21
21
|
* - Modal.props.onClose() -> visible false -> animation start -> modalVisible false
|
|
22
22
|
* */
|
|
23
|
-
const Modal =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref;
|
|
23
|
+
const Modal = ({
|
|
24
|
+
children,
|
|
25
|
+
onClose,
|
|
26
|
+
backgroundStyle,
|
|
27
|
+
onDismiss,
|
|
28
|
+
type = 'fade',
|
|
29
|
+
visible = false,
|
|
30
|
+
disableBackgroundClose = false,
|
|
31
|
+
enableKeyboardAvoid = false,
|
|
32
|
+
statusBarTranslucent,
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
36
35
|
const {
|
|
37
36
|
palette
|
|
38
37
|
} = (0, _useUIKitTheme.default)();
|
|
@@ -108,26 +107,19 @@ const useModalPanResponder = (type, translateY, show, hide) => {
|
|
|
108
107
|
panHandlers: {}
|
|
109
108
|
};
|
|
110
109
|
return _react.default.useRef(_reactNative.PanResponder.create({
|
|
111
|
-
onMoveShouldSetPanResponderCapture: (_,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
} = _ref2;
|
|
115
|
-
return dy > 8;
|
|
116
|
-
},
|
|
110
|
+
onMoveShouldSetPanResponderCapture: (_, {
|
|
111
|
+
dy
|
|
112
|
+
}) => dy > 8,
|
|
117
113
|
// @ts-ignore
|
|
118
114
|
onPanResponderGrant: () => translateY.setOffset(translateY.__getValue()),
|
|
119
|
-
onPanResponderMove: (_,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} = _ref3;
|
|
123
|
-
return dy >= 0 && translateY.setValue(dy);
|
|
124
|
-
},
|
|
115
|
+
onPanResponderMove: (_, {
|
|
116
|
+
dy
|
|
117
|
+
}) => dy >= 0 && translateY.setValue(dy),
|
|
125
118
|
// Animated.event([null, { dy: translateY }], { useNativeDriver: false }),
|
|
126
|
-
onPanResponderRelease: (_,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} = _ref4;
|
|
119
|
+
onPanResponderRelease: (_, {
|
|
120
|
+
dy,
|
|
121
|
+
vy
|
|
122
|
+
}) => {
|
|
131
123
|
if (isHideGesture(dy, vy)) hide();else show();
|
|
132
124
|
}
|
|
133
125
|
})).current;
|
|
@@ -175,7 +167,7 @@ const useOnDismiss = (visible, onDismiss) => {
|
|
|
175
167
|
const prevVisible = usePrevProp(visible);
|
|
176
168
|
(0, _react.useEffect)(() => {
|
|
177
169
|
if (_reactNative.Platform.OS === 'ios') return;
|
|
178
|
-
if (prevVisible && !visible) onDismiss === null || onDismiss === void 0
|
|
170
|
+
if (prevVisible && !visible) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
179
171
|
}, [prevVisible, visible]);
|
|
180
172
|
};
|
|
181
173
|
const usePrevProp = prop => {
|
|
@@ -192,6 +184,5 @@ const styles = (0, _createStyleSheet.default)({
|
|
|
192
184
|
flex: 1
|
|
193
185
|
}
|
|
194
186
|
});
|
|
195
|
-
var _default = Modal;
|
|
196
|
-
exports.default = _default;
|
|
187
|
+
var _default = exports.default = Modal;
|
|
197
188
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createStyleSheet","_interopRequireDefault","_useHeaderStyle","_useUIKitTheme","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Modal","_ref","children","onClose","backgroundStyle","onDismiss","type","visible","disableBackgroundClose","enableKeyboardAvoid","statusBarTranslucent","props","palette","useUIKitTheme","content","backdrop","showTransition","hideTransition","useModalAnimation","panResponder","useModalPanResponder","translateY","topInset","useHeaderStyle","modalVisible","setModalVisible","useState","showAction","hideAction","width","height","useWindowDimensions","useEffect","useOnDismiss","createElement","transparent","hardwareAccelerated","onRequestClose","onShow","supportedOrientations","animationType","TouchableWithoutFeedback","onPress","undefined","Animated","View","style","StyleSheet","absoluteFill","opacity","backgroundColor","onBackgroundLight03","KeyboardAvoidingView","Platform","OS","enabled","styles","background","behavior","select","ios","pointerEvents","keyboardVerticalOffset","transform","panHandlers","Pressable","isHideGesture","distanceY","velocityY","show","hide","React","useRef","PanResponder","create","onMoveShouldSetPanResponderCapture","_","_ref2","dy","onPanResponderGrant","setOffset","__getValue","onPanResponderMove","_ref3","setValue","onPanResponderRelease","_ref4","vy","current","initialY","Dimensions","baseAnimBackground","Value","baseAnimContent","interpolate","inputRange","outputRange","createTransition","toValue","config","duration","useNativeDriver","parallel","timing","start","prevVisible","usePrevProp","prop","prev","curr","createStyleSheet","flex","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n Dimensions,\n KeyboardAvoidingView,\n ModalProps,\n PanResponder,\n Platform,\n Pressable,\n Modal as RNModal,\n StyleProp,\n StyleSheet,\n TouchableWithoutFeedback,\n ViewStyle,\n useWindowDimensions,\n} from 'react-native';\n\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ModalAnimationType = 'slide' | 'slide-no-gesture' | 'fade';\ntype Props = {\n type?: ModalAnimationType;\n onClose: () => void;\n backgroundStyle?: StyleProp<ViewStyle>;\n disableBackgroundClose?: boolean;\n enableKeyboardAvoid?: boolean;\n} & Omit<ModalProps, 'animationType' | 'onRequestClose'>;\n\n/**\n * Modal Open: Triggered by Modal.props.visible state changed to true\n * - visible true -> modalVisible true -> animation start\n *\n * Modal Close: Triggered by Modal.props.onClose() call\n * - Modal.props.onClose() -> visible false -> animation start -> modalVisible false\n * */\nconst Modal = ({\n children,\n onClose,\n backgroundStyle,\n onDismiss,\n type = 'fade',\n visible = false,\n disableBackgroundClose = false,\n enableKeyboardAvoid = false,\n statusBarTranslucent,\n ...props\n}: Props) => {\n const { palette } = useUIKitTheme();\n const { content, backdrop, showTransition, hideTransition } = useModalAnimation(type);\n const panResponder = useModalPanResponder(type, content.translateY, showTransition, onClose);\n const { topInset } = useHeaderStyle();\n\n const [modalVisible, setModalVisible] = useState(false);\n const showAction = () => setModalVisible(true);\n const hideAction = () => hideTransition(() => setModalVisible(false));\n\n const { width, height } = useWindowDimensions();\n\n useEffect(() => {\n if (visible) showAction();\n else hideAction();\n }, [visible]);\n\n useOnDismiss(modalVisible, onDismiss);\n\n return (\n <RNModal\n statusBarTranslucent={statusBarTranslucent}\n transparent\n hardwareAccelerated\n visible={modalVisible}\n onRequestClose={onClose}\n onShow={() => showTransition()}\n onDismiss={onDismiss}\n supportedOrientations={['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']}\n animationType={'none'}\n {...props}\n >\n <TouchableWithoutFeedback onPress={disableBackgroundClose ? undefined : onClose}>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: backdrop.opacity, backgroundColor: palette.onBackgroundLight03 }]}\n />\n </TouchableWithoutFeedback>\n <KeyboardAvoidingView\n // NOTE: This is trick for Android.\n // When orientation is changed on Android, the offset that to avoid soft-keyboard is not updated normally.\n key={Platform.OS === 'android' && enableKeyboardAvoid ? `${width}-${height}` : undefined}\n enabled={enableKeyboardAvoid}\n style={styles.background}\n behavior={Platform.select({ ios: 'padding', default: 'height' })}\n pointerEvents={'box-none'}\n keyboardVerticalOffset={enableKeyboardAvoid && statusBarTranslucent ? -topInset : 0}\n >\n <Animated.View\n style={[\n styles.background,\n backgroundStyle,\n { opacity: content.opacity, transform: [{ translateY: content.translateY }] },\n ]}\n pointerEvents={'box-none'}\n {...panResponder.panHandlers}\n >\n <Pressable\n // NOTE: https://github.com/facebook/react-native/issues/14295\n // Due to 'Pressable', the width of the children must be explicitly specified as a number.\n >\n {children}\n </Pressable>\n </Animated.View>\n </KeyboardAvoidingView>\n </RNModal>\n );\n};\n\nconst isHideGesture = (distanceY: number, velocityY: number) => {\n return distanceY > 125 || (distanceY > 0 && velocityY > 0.1);\n};\nconst useModalPanResponder = (\n type: ModalAnimationType,\n translateY: Animated.Value,\n show: () => void,\n hide: () => void,\n) => {\n if (type === 'fade' || type === 'slide-no-gesture') return { panHandlers: {} };\n return React.useRef(\n PanResponder.create({\n onMoveShouldSetPanResponderCapture: (_, { dy }) => dy > 8,\n // @ts-ignore\n onPanResponderGrant: () => translateY.setOffset(translateY.__getValue()),\n onPanResponderMove: (_, { dy }) => dy >= 0 && translateY.setValue(dy), // Animated.event([null, { dy: translateY }], { useNativeDriver: false }),\n onPanResponderRelease: (_, { dy, vy }) => {\n if (isHideGesture(dy, vy)) hide();\n else show();\n },\n }),\n ).current;\n};\n\nconst useModalAnimation = (type: ModalAnimationType) => {\n const initialY = type === 'fade' ? 0 : Dimensions.get('window').height;\n const baseAnimBackground = useRef(new Animated.Value(0)).current;\n const baseAnimContent = useRef(new Animated.Value(initialY)).current;\n\n const content = {\n opacity: baseAnimBackground.interpolate({\n inputRange: [0, 1],\n outputRange: [type === 'fade' ? 0 : 1, 1],\n }),\n translateY: baseAnimContent,\n };\n const backdrop = {\n opacity: baseAnimBackground.interpolate({\n inputRange: [0, 1],\n outputRange: [0, 1],\n }),\n };\n const createTransition = (toValue: 0 | 1) => {\n const config = { duration: 250, useNativeDriver: false };\n return Animated.parallel([\n Animated.timing(baseAnimBackground, { toValue, ...config }),\n Animated.timing(baseAnimContent, { toValue: toValue === 0 ? initialY : 0, ...config }),\n ]).start;\n };\n return {\n content,\n backdrop,\n showTransition: createTransition(1),\n hideTransition: createTransition(0),\n };\n};\n\n// NOTE: onDismiss is supports iOS only\nconst useOnDismiss = (visible: boolean, onDismiss?: () => void) => {\n const prevVisible = usePrevProp(visible);\n useEffect(() => {\n if (Platform.OS === 'ios') return;\n if (prevVisible && !visible) onDismiss?.();\n }, [prevVisible, visible]);\n};\n\nconst usePrevProp = <T,>(prop: T) => {\n const prev = useRef(prop);\n const curr = useRef(prop);\n useEffect(() => {\n prev.current = curr.current;\n curr.current = prop;\n });\n return prev.current;\n};\n\nconst styles = createStyleSheet({\n background: { flex: 1 },\n});\n\nexport default Modal;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAgBA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAsD,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAO,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,q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yleSheet","_interopRequireDefault","_useHeaderStyle","_useUIKitTheme","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Modal","children","onClose","backgroundStyle","onDismiss","type","visible","disableBackgroundClose","enableKeyboardAvoid","statusBarTranslucent","props","palette","useUIKitTheme","content","backdrop","showTransition","hideTransition","useModalAnimation","panResponder","useModalPanResponder","translateY","topInset","useHeaderStyle","modalVisible","setModalVisible","useState","showAction","hideAction","width","height","useWindowDimensions","useEffect","useOnDismiss","createElement","transparent","hardwareAccelerated","onRequestClose","onShow","supportedOrientations","animationType","TouchableWithoutFeedback","onPress","undefined","Animated","View","style","StyleSheet","absoluteFill","opacity","backgroundColor","onBackgroundLight03","KeyboardAvoidingView","key","Platform","OS","enabled","styles","background","behavior","select","ios","pointerEvents","keyboardVerticalOffset","transform","panHandlers","Pressable","isHideGesture","distanceY","velocityY","show","hide","React","useRef","PanResponder","create","onMoveShouldSetPanResponderCapture","_","dy","onPanResponderGrant","setOffset","__getValue","onPanResponderMove","setValue","onPanResponderRelease","vy","current","initialY","Dimensions","baseAnimBackground","Value","baseAnimContent","interpolate","inputRange","outputRange","createTransition","toValue","config","duration","useNativeDriver","parallel","timing","start","prevVisible","usePrevProp","prop","prev","curr","createStyleSheet","flex","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n Dimensions,\n KeyboardAvoidingView,\n ModalProps,\n PanResponder,\n Platform,\n Pressable,\n Modal as RNModal,\n StyleProp,\n StyleSheet,\n TouchableWithoutFeedback,\n ViewStyle,\n useWindowDimensions,\n} from 'react-native';\n\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ModalAnimationType = 'slide' | 'slide-no-gesture' | 'fade';\ntype Props = {\n type?: ModalAnimationType;\n onClose: () => void;\n backgroundStyle?: StyleProp<ViewStyle>;\n disableBackgroundClose?: boolean;\n enableKeyboardAvoid?: boolean;\n} & Omit<ModalProps, 'animationType' | 'onRequestClose'>;\n\n/**\n * Modal Open: Triggered by Modal.props.visible state changed to true\n * - visible true -> modalVisible true -> animation start\n *\n * Modal Close: Triggered by Modal.props.onClose() call\n * - Modal.props.onClose() -> visible false -> animation start -> modalVisible false\n * */\nconst Modal = ({\n children,\n onClose,\n backgroundStyle,\n onDismiss,\n type = 'fade',\n visible = false,\n disableBackgroundClose = false,\n enableKeyboardAvoid = false,\n statusBarTranslucent,\n ...props\n}: Props) => {\n const { palette } = useUIKitTheme();\n const { content, backdrop, showTransition, hideTransition } = useModalAnimation(type);\n const panResponder = useModalPanResponder(type, content.translateY, showTransition, onClose);\n const { topInset } = useHeaderStyle();\n\n const [modalVisible, setModalVisible] = useState(false);\n const showAction = () => setModalVisible(true);\n const hideAction = () => hideTransition(() => setModalVisible(false));\n\n const { width, height } = useWindowDimensions();\n\n useEffect(() => {\n if (visible) showAction();\n else hideAction();\n }, [visible]);\n\n useOnDismiss(modalVisible, onDismiss);\n\n return (\n <RNModal\n statusBarTranslucent={statusBarTranslucent}\n transparent\n hardwareAccelerated\n visible={modalVisible}\n onRequestClose={onClose}\n onShow={() => showTransition()}\n onDismiss={onDismiss}\n supportedOrientations={['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']}\n animationType={'none'}\n {...props}\n >\n <TouchableWithoutFeedback onPress={disableBackgroundClose ? undefined : onClose}>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: backdrop.opacity, backgroundColor: palette.onBackgroundLight03 }]}\n />\n </TouchableWithoutFeedback>\n <KeyboardAvoidingView\n // NOTE: This is trick for Android.\n // When orientation is changed on Android, the offset that to avoid soft-keyboard is not updated normally.\n key={Platform.OS === 'android' && enableKeyboardAvoid ? `${width}-${height}` : undefined}\n enabled={enableKeyboardAvoid}\n style={styles.background}\n behavior={Platform.select({ ios: 'padding', default: 'height' })}\n pointerEvents={'box-none'}\n keyboardVerticalOffset={enableKeyboardAvoid && statusBarTranslucent ? -topInset : 0}\n >\n <Animated.View\n style={[\n styles.background,\n backgroundStyle,\n { opacity: content.opacity, transform: [{ translateY: content.translateY }] },\n ]}\n pointerEvents={'box-none'}\n {...panResponder.panHandlers}\n >\n <Pressable\n // NOTE: https://github.com/facebook/react-native/issues/14295\n // Due to 'Pressable', the width of the children must be explicitly specified as a number.\n >\n {children}\n </Pressable>\n </Animated.View>\n </KeyboardAvoidingView>\n </RNModal>\n );\n};\n\nconst isHideGesture = (distanceY: number, velocityY: number) => {\n return distanceY > 125 || (distanceY > 0 && velocityY > 0.1);\n};\nconst useModalPanResponder = (\n type: ModalAnimationType,\n translateY: Animated.Value,\n show: () => void,\n hide: () => void,\n) => {\n if (type === 'fade' || type === 'slide-no-gesture') return { panHandlers: {} };\n return React.useRef(\n PanResponder.create({\n onMoveShouldSetPanResponderCapture: (_, { dy }) => dy > 8,\n // @ts-ignore\n onPanResponderGrant: () => translateY.setOffset(translateY.__getValue()),\n onPanResponderMove: (_, { dy }) => dy >= 0 && translateY.setValue(dy), // Animated.event([null, { dy: translateY }], { useNativeDriver: false }),\n onPanResponderRelease: (_, { dy, vy }) => {\n if (isHideGesture(dy, vy)) hide();\n else show();\n },\n }),\n ).current;\n};\n\nconst useModalAnimation = (type: ModalAnimationType) => {\n const initialY = type === 'fade' ? 0 : Dimensions.get('window').height;\n const baseAnimBackground = useRef(new Animated.Value(0)).current;\n const baseAnimContent = useRef(new Animated.Value(initialY)).current;\n\n const content = {\n opacity: baseAnimBackground.interpolate({\n inputRange: [0, 1],\n outputRange: [type === 'fade' ? 0 : 1, 1],\n }),\n translateY: baseAnimContent,\n };\n const backdrop = {\n opacity: baseAnimBackground.interpolate({\n inputRange: [0, 1],\n outputRange: [0, 1],\n }),\n };\n const createTransition = (toValue: 0 | 1) => {\n const config = { duration: 250, useNativeDriver: false };\n return Animated.parallel([\n Animated.timing(baseAnimBackground, { toValue, ...config }),\n Animated.timing(baseAnimContent, { toValue: toValue === 0 ? initialY : 0, ...config }),\n ]).start;\n };\n return {\n content,\n backdrop,\n showTransition: createTransition(1),\n hideTransition: createTransition(0),\n };\n};\n\n// NOTE: onDismiss is supports iOS only\nconst useOnDismiss = (visible: boolean, onDismiss?: () => void) => {\n const prevVisible = usePrevProp(visible);\n useEffect(() => {\n if (Platform.OS === 'ios') return;\n if (prevVisible && !visible) onDismiss?.();\n }, [prevVisible, visible]);\n};\n\nconst usePrevProp = <T,>(prop: T) => {\n const prev = useRef(prop);\n const curr = useRef(prop);\n useEffect(() => {\n prev.current = curr.current;\n curr.current = prop;\n });\n return prev.current;\n};\n\nconst styles = createStyleSheet({\n background: { flex: 1 },\n});\n\nexport default Modal;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAgBA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAsD,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAA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__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.DEFAULT_LONG_PRESS_DELAY = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var React = _react;
|
|
8
9
|
var _reactNative = require("react-native");
|
|
9
10
|
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
13
|
-
const DEFAULT_LONG_PRESS_DELAY = 350;
|
|
14
|
-
exports.DEFAULT_LONG_PRESS_DELAY = DEFAULT_LONG_PRESS_DELAY;
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
const DEFAULT_LONG_PRESS_DELAY = exports.DEFAULT_LONG_PRESS_DELAY = 350;
|
|
15
15
|
const PressBox = props => {
|
|
16
16
|
if (props.activeOpacity && props.activeOpacity < 1) return /*#__PURE__*/React.createElement(PressBoxWithTouchableOpacity, props);
|
|
17
17
|
return /*#__PURE__*/React.createElement(PressBoxWithPressable, props);
|
|
18
18
|
};
|
|
19
|
-
const PressBoxWithPressable =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
19
|
+
const PressBoxWithPressable = ({
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}) => {
|
|
24
23
|
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
25
24
|
disabled: !props.onPress && !props.onLongPress,
|
|
26
25
|
delayLongPress: DEFAULT_LONG_PRESS_DELAY
|
|
27
26
|
}, props), state => (0, _uikitUtils.isFunction)(children) ? children(state) : children);
|
|
28
27
|
};
|
|
29
|
-
const PressBoxWithTouchableOpacity =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const [pressed, setPressed] = (0, React.useState)(false);
|
|
28
|
+
const PressBoxWithTouchableOpacity = ({
|
|
29
|
+
children,
|
|
30
|
+
style,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const [pressed, setPressed] = (0, _react.useState)(false);
|
|
36
34
|
const state = {
|
|
37
35
|
pressed
|
|
38
36
|
};
|
|
@@ -44,6 +42,5 @@ const PressBoxWithTouchableOpacity = _ref2 => {
|
|
|
44
42
|
onPressOut: () => setPressed(false)
|
|
45
43
|
}, props), (0, _uikitUtils.isFunction)(children) ? children(state) : children);
|
|
46
44
|
};
|
|
47
|
-
var _default = PressBox;
|
|
48
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = PressBox;
|
|
49
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","React","_reactNative","_uikitUtils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","DEFAULT_LONG_PRESS_DELAY","exports","PressBox","props","activeOpacity","createElement","PressBoxWithTouchableOpacity","PressBoxWithPressable","children","Pressable","disabled","onPress","onLongPress","delayLongPress","state","isFunction","style","pressed","setPressed","useState","TouchableOpacity","onPressIn","onPressOut","_default"],"sources":["index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useState } from 'react';\nimport type { GestureResponderEvent, StyleProp, ViewProps, ViewStyle } from 'react-native';\nimport { Pressable, TouchableOpacity } from 'react-native';\n\nimport { isFunction } from '@sendbird/uikit-utils';\n\ntype PressBoxStateParams = {\n pressed: boolean;\n};\n\ntype Props = {\n disabled?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n onLongPress?: (event: GestureResponderEvent) => void;\n delayLongPress?: number;\n activeOpacity?: number;\n style?: StyleProp<ViewStyle> | ((state: PressBoxStateParams) => StyleProp<ViewStyle>);\n hitSlop?: ViewProps['hitSlop'];\n children?: React.ReactNode | ((params: PressBoxStateParams) => React.ReactNode);\n};\n\nexport const DEFAULT_LONG_PRESS_DELAY = 350;\n\nconst PressBox = (props: Props) => {\n if (props.activeOpacity && props.activeOpacity < 1) return <PressBoxWithTouchableOpacity {...props} />;\n return <PressBoxWithPressable {...props} />;\n};\n\nconst PressBoxWithPressable = ({ children, ...props }: Props) => {\n return (\n <Pressable disabled={!props.onPress && !props.onLongPress} delayLongPress={DEFAULT_LONG_PRESS_DELAY} {...props}>\n {(state) => (isFunction(children) ? children(state) : children)}\n </Pressable>\n );\n};\n\nconst PressBoxWithTouchableOpacity = ({ children, style, ...props }: Props) => {\n const [pressed, setPressed] = useState(false);\n const state: PressBoxStateParams = { pressed };\n return (\n <TouchableOpacity\n disabled={!props.onPress && !props.onLongPress}\n delayLongPress={DEFAULT_LONG_PRESS_DELAY}\n style={isFunction(style) ? style(state) : style}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n {...props}\n >\n {isFunction(children) ? children(state) :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AAK;EAAE,GAAGb;AAAa,CAAC,KAAK;EAC7E,MAAM,CAACc,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAC7C,MAAML,KAA0B,GAAG;IAAEG;EAAQ,CAAC;EAC9C,oBACE9C,KAAA,CAAAkC,aAAA,CAACjC,YAAA,CAAAgD,gBAAgB,EAAA1B,QAAA;IACfgB,QAAQ,EAAE,CAACP,KAAK,CAACQ,OAAO,IAAI,CAACR,KAAK,CAACS,WAAY;IAC/CC,cAAc,EAAEb,wBAAyB;IACzCgB,KAAK,EAAE,IAAAD,sBAAU,EAACC,KAAK,CAAC,GAAGA,KAAK,CAACF,KAAK,CAAC,GAAGE,KAAM;IAChDK,SAAS,EAAEA,CAAA,KAAMH,UAAU,CAAC,IAAI,CAAE;IAClCI,UAAU,EAAEA,CAAA,KAAMJ,UAAU,CAAC,KAAK;EAAE,GAChCf,KAAK,GAER,IAAAY,sBAAU,EAACP,QAAQ,CAAC,GAAGA,QAAQ,CAACM,KAAK,CAAC,GAAGN,QAC1B,CAAC;AAEvB,CAAC;AAAC,IAAAe,QAAA,GAAAtB,OAAA,CAAArB,OAAA,GAEasB,QAAQ","ignoreList":[]}
|
|
@@ -9,18 +9,17 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
10
10
|
var _useUIKitTheme = _interopRequireDefault(require("../../theme/useUIKitTheme"));
|
|
11
11
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
const ProgressBar =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const ProgressBar = ({
|
|
16
|
+
current = 100,
|
|
17
|
+
total = 100,
|
|
18
|
+
trackColor,
|
|
19
|
+
barColor,
|
|
20
|
+
overlay,
|
|
21
|
+
style
|
|
22
|
+
}) => {
|
|
24
23
|
const {
|
|
25
24
|
colors
|
|
26
25
|
} = (0, _useUIKitTheme.default)();
|
|
@@ -44,6 +43,16 @@ const ProgressBar = _ref => {
|
|
|
44
43
|
}
|
|
45
44
|
return _uikitUtils.NOOP;
|
|
46
45
|
}, [percent]);
|
|
46
|
+
const progressBarPosition = (() => {
|
|
47
|
+
if (_reactNative.I18nManager.isRTL && _reactNative.I18nManager.doLeftAndRightSwapInRTL) {
|
|
48
|
+
return {
|
|
49
|
+
right: 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
left: 0
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
47
56
|
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
48
57
|
height: 36,
|
|
49
58
|
flexDirection: 'row',
|
|
@@ -52,7 +61,7 @@ const ProgressBar = _ref => {
|
|
|
52
61
|
overflow: 'hidden',
|
|
53
62
|
style: style
|
|
54
63
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
55
|
-
style: {
|
|
64
|
+
style: [progressBarPosition, {
|
|
56
65
|
position: 'absolute',
|
|
57
66
|
width: progress.interpolate({
|
|
58
67
|
inputRange: [0, 1],
|
|
@@ -62,11 +71,10 @@ const ProgressBar = _ref => {
|
|
|
62
71
|
height: '100%',
|
|
63
72
|
opacity: 0.38,
|
|
64
73
|
backgroundColor: uiColors.bar
|
|
65
|
-
}
|
|
74
|
+
}]
|
|
66
75
|
}), /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
67
76
|
style: _reactNative.StyleSheet.absoluteFill
|
|
68
77
|
}, overlay));
|
|
69
78
|
};
|
|
70
|
-
var _default = ProgressBar;
|
|
71
|
-
exports.default = _default;
|
|
79
|
+
var _default = exports.default = ProgressBar;
|
|
72
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uikitUtils","_useUIKitTheme","_interopRequireDefault","_Box","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uikitUtils","_useUIKitTheme","_interopRequireDefault","_Box","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ProgressBar","current","total","trackColor","barColor","overlay","style","colors","useUIKitTheme","uiColors","track","primary","bar","onBackground01","progress","useRef","Animated","Value","percent","stopped","useEffect","Number","isNaN","animation","timing","toValue","duration","useNativeDriver","easing","Easing","linear","start","stop","NOOP","progressBarPosition","I18nManager","isRTL","doLeftAndRightSwapInRTL","right","left","createElement","height","flexDirection","backgroundColor","alignItems","overflow","View","position","width","interpolate","inputRange","outputRange","extrapolate","opacity","StyleSheet","absoluteFill","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef } from 'react';\nimport { Animated, Easing, I18nManager, StyleSheet, ViewStyle } from 'react-native';\n\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Box from '../Box';\n\ntype Props = {\n current: number;\n total: number;\n trackColor?: string;\n barColor?: string;\n overlay?: ReactNode | undefined;\n style?: ViewStyle;\n};\nconst ProgressBar = ({ current = 100, total = 100, trackColor, barColor, overlay, style }: Props) => {\n const { colors } = useUIKitTheme();\n\n const uiColors = {\n track: trackColor ?? colors.primary,\n bar: barColor ?? colors.onBackground01,\n };\n\n const progress = useRef(new Animated.Value(0)).current;\n const percent = current / total;\n const stopped = percent === 0;\n\n useEffect(() => {\n if (!Number.isNaN(percent)) {\n const animation = Animated.timing(progress, {\n toValue: stopped ? 0 : percent,\n duration: stopped ? 0 : 100,\n useNativeDriver: false,\n easing: Easing.linear,\n });\n\n animation.start();\n return () => animation.stop();\n }\n\n return NOOP;\n }, [percent]);\n\n const progressBarPosition = (() => {\n if (I18nManager.isRTL && I18nManager.doLeftAndRightSwapInRTL) {\n return { right: 0 };\n }\n\n return { left: 0 };\n })();\n\n return (\n <Box\n height={36}\n flexDirection={'row'}\n backgroundColor={uiColors.track}\n alignItems={'center'}\n overflow={'hidden'}\n style={style}\n >\n <Animated.View\n style={[\n progressBarPosition,\n {\n position: 'absolute',\n width: progress.interpolate({\n inputRange: [0, 1],\n outputRange: ['0%', '100%'],\n extrapolate: 'clamp',\n }),\n height: '100%',\n opacity: 0.38,\n backgroundColor: uiColors.bar,\n },\n ]}\n />\n <Box style={StyleSheet.absoluteFill}>{overlay}</Box>\n </Box>\n );\n};\n\nexport default ProgressBar;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAAyB,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD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IACF2D,MAAM,EAAE,EAAG;IACXC,aAAa,EAAE,KAAM;IACrBC,eAAe,EAAElC,QAAQ,CAACC,KAAM;IAChCkC,UAAU,EAAE,QAAS;IACrBC,QAAQ,EAAE,QAAS;IACnBvC,KAAK,EAAEA;EAAM,gBAEblC,MAAA,CAAAU,OAAA,CAAA0D,aAAA,CAACjE,YAAA,CAAAyC,QAAQ,CAAC8B,IAAI;IACZxC,KAAK,EAAE,CACL4B,mBAAmB,EACnB;MACEa,QAAQ,EAAE,UAAU;MACpBC,KAAK,EAAElC,QAAQ,CAACmC,WAAW,CAAC;QAC1BC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAClBC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;QAC3BC,WAAW,EAAE;MACf,CAAC,CAAC;MACFX,MAAM,EAAE,MAAM;MACdY,OAAO,EAAE,IAAI;MACbV,eAAe,EAAElC,QAAQ,CAACG;IAC5B,CAAC;EACD,CACH,CAAC,eACFxC,MAAA,CAAAU,OAAA,CAAA0D,aAAA,CAAC7D,IAAA,CAAAG,OAAG;IAACwB,KAAK,EAAEgD,uBAAU,CAACC;EAAa,GAAElD,OAAa,CAChD,CAAC;AAEV,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAA3E,OAAA,GAEakB,WAAW","ignoreList":[]}
|
|
@@ -7,20 +7,18 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _uikitUtils = require("@sendbird/uikit-utils");
|
|
9
9
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
const RegexText =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = _ref;
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const RegexText = ({
|
|
12
|
+
children,
|
|
13
|
+
patterns,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
17
16
|
if (patterns.length === 0 || typeof children !== 'string') return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
18
17
|
const matchedTexts = [children];
|
|
19
|
-
patterns.forEach((
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref2;
|
|
18
|
+
patterns.forEach(({
|
|
19
|
+
regex,
|
|
20
|
+
replacer
|
|
21
|
+
}, patterIndex) => {
|
|
24
22
|
const matchedTextsTemp = matchedTexts.concat();
|
|
25
23
|
let offset = 0;
|
|
26
24
|
matchedTextsTemp.forEach((text, index) => {
|
|
@@ -39,6 +37,5 @@ const RegexText = _ref => {
|
|
|
39
37
|
});
|
|
40
38
|
return /*#__PURE__*/_react.default.createElement(_Text.default, props, matchedTexts);
|
|
41
39
|
};
|
|
42
|
-
var _default = RegexText;
|
|
43
|
-
exports.default = _default;
|
|
40
|
+
var _default = exports.default = RegexText;
|
|
44
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_uikitUtils","_Text","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_uikitUtils","_Text","e","__esModule","default","RegexText","children","patterns","props","length","createElement","Fragment","matchedTexts","forEach","regex","replacer","patterIndex","matchedTextsTemp","concat","offset","text","index","replaceWithRegex","params","parentProps","keyPrefix","String","splice","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport { replaceWithRegex } from '@sendbird/uikit-utils';\n\nimport Text, { TextProps } from '../Text';\n\nexport interface RegexTextPattern {\n regex: RegExp;\n replacer(params: {\n match: string;\n groups: string[];\n index: number;\n keyPrefix: string;\n parentProps?: TextProps;\n }): string | ReactNode;\n}\n\ntype Props = { patterns: RegexTextPattern[] } & TextProps;\n\nconst RegexText = ({ children, patterns, ...props }: Props) => {\n if (patterns.length === 0 || typeof children !== 'string') return <>{children}</>;\n\n const matchedTexts: Array<string | ReactNode> = [children];\n\n patterns.forEach(({ regex, replacer }, patterIndex) => {\n const matchedTextsTemp = matchedTexts.concat();\n let offset = 0;\n matchedTextsTemp.forEach((text, index) => {\n if (typeof text === 'string' && text) {\n const children = replaceWithRegex(\n text,\n regex,\n (params) => replacer({ ...params, parentProps: props, keyPrefix: index + params.keyPrefix }),\n String(patterIndex),\n );\n\n if (children.length > 1) {\n matchedTexts.splice(index + offset, 1, ...children);\n offset += children.length - 1;\n }\n }\n });\n });\n\n return <Text {...props}>{matchedTexts}</Text>;\n};\n\nexport default RegexText;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAe1C,MAAMG,SAAS,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAa,CAAC,KAAK;EAC7D,IAAID,QAAQ,CAACE,MAAM,KAAK,CAAC,IAAI,OAAOH,QAAQ,KAAK,QAAQ,EAAE,oBAAOT,MAAA,CAAAO,OAAA,CAAAM,aAAA,CAAAb,MAAA,CAAAO,OAAA,CAAAO,QAAA,QAAGL,QAAW,CAAC;EAEjF,MAAMM,YAAuC,GAAG,CAACN,QAAQ,CAAC;EAE1DC,QAAQ,CAACM,OAAO,CAAC,CAAC;IAAEC,KAAK;IAAEC;EAAS,CAAC,EAAEC,WAAW,KAAK;IACrD,MAAMC,gBAAgB,GAAGL,YAAY,CAACM,MAAM,CAAC,CAAC;IAC9C,IAAIC,MAAM,GAAG,CAAC;IACdF,gBAAgB,CAACJ,OAAO,CAAC,CAACO,IAAI,EAAEC,KAAK,KAAK;MACxC,IAAI,OAAOD,IAAI,KAAK,QAAQ,IAAIA,IAAI,EAAE;QACpC,MAAMd,QAAQ,GAAG,IAAAgB,4BAAgB,EAC/BF,IAAI,EACJN,KAAK,EACJS,MAAM,IAAKR,QAAQ,CAAC;UAAE,GAAGQ,MAAM;UAAEC,WAAW,EAAEhB,KAAK;UAAEiB,SAAS,EAAEJ,KAAK,GAAGE,MAAM,CAACE;QAAU,CAAC,CAAC,EAC5FC,MAAM,CAACV,WAAW,CACpB,CAAC;QAED,IAAIV,QAAQ,CAACG,MAAM,GAAG,CAAC,EAAE;UACvBG,YAAY,CAACe,MAAM,CAACN,KAAK,GAAGF,MAAM,EAAE,CAAC,EAAE,GAAGb,QAAQ,CAAC;UACnDa,MAAM,IAAIb,QAAQ,CAACG,MAAM,GAAG,CAAC;QAC/B;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,oBAAOZ,MAAA,CAAAO,OAAA,CAAAM,aAAA,CAACT,KAAA,CAAAG,OAAI,EAAKI,KAAK,EAAGI,YAAmB,CAAC;AAC/C,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEaC,SAAS","ignoreList":[]}
|
|
@@ -8,27 +8,28 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _createStyleSheet = _interopRequireDefault(require("../../styles/createStyleSheet"));
|
|
10
10
|
var _useUIKitTheme = _interopRequireDefault(require("../../theme/useUIKitTheme"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
14
|
-
const Switch =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const Switch = ({
|
|
15
|
+
value,
|
|
16
|
+
onChangeValue,
|
|
17
|
+
inactiveThumbColor,
|
|
18
|
+
inactiveTrackColor,
|
|
19
|
+
trackColor,
|
|
20
|
+
thumbColor
|
|
21
|
+
}) => {
|
|
23
22
|
const {
|
|
24
23
|
select,
|
|
25
24
|
palette,
|
|
26
25
|
colors
|
|
27
26
|
} = (0, _useUIKitTheme.default)();
|
|
28
27
|
const position = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
28
|
+
const start = _reactNative.I18nManager.isRTL ? styles.thumbOn.start : styles.thumbOff.start;
|
|
29
|
+
const end = _reactNative.I18nManager.isRTL ? styles.thumbOff.start : styles.thumbOn.start;
|
|
29
30
|
(0, _react.useEffect)(() => {
|
|
30
31
|
const animation = _reactNative.Animated.timing(position, {
|
|
31
|
-
toValue: value ?
|
|
32
|
+
toValue: value ? end : start,
|
|
32
33
|
duration: 150,
|
|
33
34
|
useNativeDriver: false
|
|
34
35
|
});
|
|
@@ -37,8 +38,8 @@ const Switch = _ref => {
|
|
|
37
38
|
}, [value]);
|
|
38
39
|
const createInterpolate = (offValue, onValue) => {
|
|
39
40
|
return position.interpolate({
|
|
40
|
-
inputRange: [styles.thumbOff.
|
|
41
|
-
outputRange: [offValue, onValue],
|
|
41
|
+
inputRange: [styles.thumbOff.start, styles.thumbOn.start],
|
|
42
|
+
outputRange: _reactNative.I18nManager.isRTL ? [onValue, offValue] : [offValue, onValue],
|
|
42
43
|
extrapolate: 'clamp'
|
|
43
44
|
});
|
|
44
45
|
};
|
|
@@ -100,12 +101,11 @@ const styles = (0, _createStyleSheet.default)({
|
|
|
100
101
|
})
|
|
101
102
|
},
|
|
102
103
|
thumbOn: {
|
|
103
|
-
|
|
104
|
+
start: OFFSET.H / 2
|
|
104
105
|
},
|
|
105
106
|
thumbOff: {
|
|
106
|
-
|
|
107
|
+
start: -OFFSET.H / 2
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
|
-
var _default = Switch;
|
|
110
|
-
exports.default = _default;
|
|
110
|
+
var _default = exports.default = Switch;
|
|
111
111
|
//# sourceMappingURL=index.js.map
|