@draftbit/core 54.0.3 → 54.0.4-11e01d.2
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/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.d.ts +3 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +69 -54
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlaybackWrapper.d.ts +3 -2
- package/lib/typescript/src/components/MediaPlayer/MediaPlaybackWrapper.js +19 -21
- package/lib/typescript/src/components/MediaPlayer/MediaPlaybackWrapper.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.d.ts +5 -4
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js +3 -26
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.d.ts +14 -4
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +125 -62
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +84 -72
- package/src/components/MediaPlayer/MediaPlaybackWrapper.tsx +21 -24
- package/src/components/MediaPlayer/MediaPlayerCommon.ts +8 -34
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +213 -86
- package/src/Provider.js +0 -10
- package/src/Provider.js.map +0 -1
- package/src/components/AccordionGroup.js +0 -51
- package/src/components/AccordionGroup.js.map +0 -1
- package/src/components/ActionSheet/ActionSheet.js +0 -46
- package/src/components/ActionSheet/ActionSheet.js.map +0 -1
- package/src/components/ActionSheet/ActionSheetCancel.js +0 -7
- package/src/components/ActionSheet/ActionSheetCancel.js.map +0 -1
- package/src/components/ActionSheet/ActionSheetItem.js +0 -31
- package/src/components/ActionSheet/ActionSheetItem.js.map +0 -1
- package/src/components/ActionSheet/index.js +0 -4
- package/src/components/ActionSheet/index.js.map +0 -1
- package/src/components/AspectRatio.js +0 -19
- package/src/components/AspectRatio.js.map +0 -1
- package/src/components/BottomSheet/BottomSheet.js +0 -76
- package/src/components/BottomSheet/BottomSheet.js.map +0 -1
- package/src/components/BottomSheet/index.js +0 -2
- package/src/components/BottomSheet/index.js.map +0 -1
- package/src/components/Button.js +0 -119
- package/src/components/Button.js.map +0 -1
- package/src/components/Checkbox/Checkbox.js +0 -63
- package/src/components/Checkbox/Checkbox.js.map +0 -1
- package/src/components/Checkbox/CheckboxGroupRow.js +0 -77
- package/src/components/Checkbox/CheckboxGroupRow.js.map +0 -1
- package/src/components/Checkbox/CheckboxRow.js +0 -79
- package/src/components/Checkbox/CheckboxRow.js.map +0 -1
- package/src/components/Checkbox/context.js +0 -15
- package/src/components/Checkbox/context.js.map +0 -1
- package/src/components/Checkbox/index.js +0 -3
- package/src/components/Checkbox/index.js.map +0 -1
- package/src/components/Config.js +0 -65
- package/src/components/Config.js.map +0 -1
- package/src/components/DatePicker/DatePicker.js +0 -418
- package/src/components/DatePicker/DatePicker.js.map +0 -1
- package/src/components/DatePicker/DatePickerComponent.js +0 -17
- package/src/components/DatePicker/DatePickerComponent.js.map +0 -1
- package/src/components/DatePicker/DatePickerComponent.web.js +0 -57
- package/src/components/DatePicker/DatePickerComponent.web.js.map +0 -1
- package/src/components/DatePicker/DatePickerComponentType.js +0 -2
- package/src/components/DatePicker/DatePickerComponentType.js.map +0 -1
- package/src/components/DatePicker/parseDate.js +0 -12
- package/src/components/DatePicker/parseDate.js.map +0 -1
- package/src/components/DeckSwiper/DeckSwiper.js +0 -116
- package/src/components/DeckSwiper/DeckSwiper.js.map +0 -1
- package/src/components/DeckSwiper/DeckSwiperCard.js +0 -21
- package/src/components/DeckSwiper/DeckSwiperCard.js.map +0 -1
- package/src/components/DeckSwiper/index.js +0 -3
- package/src/components/DeckSwiper/index.js.map +0 -1
- package/src/components/Divider.js +0 -14
- package/src/components/Divider.js.map +0 -1
- package/src/components/Elevation.js +0 -20
- package/src/components/Elevation.js.map +0 -1
- package/src/components/ExpoImage.js +0 -44
- package/src/components/ExpoImage.js.map +0 -1
- package/src/components/FlatList.js +0 -7
- package/src/components/FlatList.js.map +0 -1
- package/src/components/FormRow.js +0 -20
- package/src/components/FormRow.js.map +0 -1
- package/src/components/IconButton.js +0 -36
- package/src/components/IconButton.js.map +0 -1
- package/src/components/Image.js +0 -48
- package/src/components/Image.js.map +0 -1
- package/src/components/KeyboardAvoidingView.js +0 -29
- package/src/components/KeyboardAvoidingView.js.map +0 -1
- package/src/components/Layout/AspectRatio.js +0 -7
- package/src/components/Layout/AspectRatio.js.map +0 -1
- package/src/components/Layout/Center.js +0 -15
- package/src/components/Layout/Center.js.map +0 -1
- package/src/components/Layout/Circle.js +0 -16
- package/src/components/Layout/Circle.js.map +0 -1
- package/src/components/Layout/HStack.js +0 -12
- package/src/components/Layout/HStack.js.map +0 -1
- package/src/components/Layout/LayoutCommon.js +0 -8
- package/src/components/Layout/LayoutCommon.js.map +0 -1
- package/src/components/Layout/Spacer.js +0 -15
- package/src/components/Layout/Spacer.js.map +0 -1
- package/src/components/Layout/Square.js +0 -25
- package/src/components/Layout/Square.js.map +0 -1
- package/src/components/Layout/VStack.js +0 -12
- package/src/components/Layout/VStack.js.map +0 -1
- package/src/components/Layout/ZStack.js +0 -58
- package/src/components/Layout/ZStack.js.map +0 -1
- package/src/components/Layout/index.js +0 -9
- package/src/components/Layout/index.js.map +0 -1
- package/src/components/LoadingIndicator.js +0 -38
- package/src/components/LoadingIndicator.js.map +0 -1
- package/src/components/LottieAnimation.js +0 -12
- package/src/components/LottieAnimation.js.map +0 -1
- package/src/components/Markdown.js +0 -33
- package/src/components/Markdown.js.map +0 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +0 -2
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js.map +0 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +0 -123
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +0 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +0 -90
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +0 -1
- package/src/components/MediaPlayer/AudioPlayer/index.js +0 -13
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +0 -1
- package/src/components/MediaPlayer/MediaPlaybackWrapper.js +0 -42
- package/src/components/MediaPlayer/MediaPlaybackWrapper.js.map +0 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.js +0 -71
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +0 -1
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +0 -109
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +0 -1
- package/src/components/MediaPlayer/VideoPlayer/index.js +0 -2
- package/src/components/MediaPlayer/VideoPlayer/index.js.map +0 -1
- package/src/components/NumberInput.js +0 -63
- package/src/components/NumberInput.js.map +0 -1
- package/src/components/Picker/NativePicker.ios.js +0 -77
- package/src/components/Picker/NativePicker.ios.js.map +0 -1
- package/src/components/Picker/NativePicker.js +0 -73
- package/src/components/Picker/NativePicker.js.map +0 -1
- package/src/components/Picker/PickerCommon.js +0 -36
- package/src/components/Picker/PickerCommon.js.map +0 -1
- package/src/components/Picker/PickerInputContainer.js +0 -36
- package/src/components/Picker/PickerInputContainer.js.map +0 -1
- package/src/components/Picker/dropdown/DropDownModalPicker.js +0 -70
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +0 -1
- package/src/components/Picker/dropdown/DropDownPicker.js +0 -61
- package/src/components/Picker/dropdown/DropDownPicker.js.map +0 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.js +0 -9
- package/src/components/Picker/dropdown/MultiSelectPicker.js.map +0 -1
- package/src/components/Picker/dropdown/PickerItem.js +0 -9
- package/src/components/Picker/dropdown/PickerItem.js.map +0 -1
- package/src/components/Picker/index.js +0 -22
- package/src/components/Picker/index.js.map +0 -1
- package/src/components/PinInput/CustomPinInputCell.js +0 -11
- package/src/components/PinInput/CustomPinInputCell.js.map +0 -1
- package/src/components/PinInput/PinInput.js +0 -89
- package/src/components/PinInput/PinInput.js.map +0 -1
- package/src/components/PinInput/PinInputText.js +0 -14
- package/src/components/PinInput/PinInputText.js.map +0 -1
- package/src/components/PinInput/index.js +0 -4
- package/src/components/PinInput/index.js.map +0 -1
- package/src/components/Portal/Portal.js +0 -34
- package/src/components/Portal/Portal.js.map +0 -1
- package/src/components/Portal/PortalConsumer.js +0 -28
- package/src/components/Portal/PortalConsumer.js.map +0 -1
- package/src/components/Portal/PortalHost.js +0 -109
- package/src/components/Portal/PortalHost.js.map +0 -1
- package/src/components/Portal/PortalManager.js +0 -33
- package/src/components/Portal/PortalManager.js.map +0 -1
- package/src/components/Pressable.js +0 -23
- package/src/components/Pressable.js.map +0 -1
- package/src/components/Progress/CircularProgress/CircularProgress.js +0 -103
- package/src/components/Progress/CircularProgress/CircularProgress.js.map +0 -1
- package/src/components/Progress/CircularProgress/index.js +0 -14
- package/src/components/Progress/CircularProgress/index.js.map +0 -1
- package/src/components/Progress/IndeterminateProgress.js +0 -39
- package/src/components/Progress/IndeterminateProgress.js.map +0 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js +0 -57
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +0 -1
- package/src/components/Progress/LinearProgress/index.js +0 -14
- package/src/components/Progress/LinearProgress/index.js.map +0 -1
- package/src/components/Progress/ProgressCommon.js +0 -2
- package/src/components/Progress/ProgressCommon.js.map +0 -1
- package/src/components/ProgressIndicator.js +0 -28
- package/src/components/ProgressIndicator.js.map +0 -1
- package/src/components/RadioButton/RadioButton.js +0 -18
- package/src/components/RadioButton/RadioButton.js.map +0 -1
- package/src/components/RadioButton/RadioButtonGroup.js +0 -44
- package/src/components/RadioButton/RadioButtonGroup.js.map +0 -1
- package/src/components/RadioButton/RadioButtonRow.js +0 -79
- package/src/components/RadioButton/RadioButtonRow.js.map +0 -1
- package/src/components/RadioButton/context.js +0 -15
- package/src/components/RadioButton/context.js.map +0 -1
- package/src/components/RadioButton/index.js +0 -4
- package/src/components/RadioButton/index.js.map +0 -1
- package/src/components/Row.js +0 -49
- package/src/components/Row.js.map +0 -1
- package/src/components/SVG.js +0 -8
- package/src/components/SVG.js.map +0 -1
- package/src/components/SVG.native.js +0 -10
- package/src/components/SVG.native.js.map +0 -1
- package/src/components/ScreenContainer.js +0 -42
- package/src/components/ScreenContainer.js.map +0 -1
- package/src/components/SectionList/SectionHeader.js +0 -14
- package/src/components/SectionList/SectionHeader.js.map +0 -1
- package/src/components/SectionList/SectionList.js +0 -111
- package/src/components/SectionList/SectionList.js.map +0 -1
- package/src/components/SectionList/index.js +0 -3
- package/src/components/SectionList/index.js.map +0 -1
- package/src/components/Shadow.js +0 -26
- package/src/components/Shadow.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +0 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +0 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +0 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +0 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +0 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +0 -15
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +0 -15
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +0 -91
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +0 -1
- package/src/components/Slider.js +0 -84
- package/src/components/Slider.js.map +0 -1
- package/src/components/StarRating.js +0 -51
- package/src/components/StarRating.js.map +0 -1
- package/src/components/StepIndicator.js +0 -347
- package/src/components/StepIndicator.js.map +0 -1
- package/src/components/Stepper.js +0 -43
- package/src/components/Stepper.js.map +0 -1
- package/src/components/Surface.js +0 -55
- package/src/components/Surface.js.map +0 -1
- package/src/components/SwipeableItem/SwipeableItem.js +0 -124
- package/src/components/SwipeableItem/SwipeableItem.js.map +0 -1
- package/src/components/SwipeableItem/SwipeableItemButton.js +0 -6
- package/src/components/SwipeableItem/SwipeableItemButton.js.map +0 -1
- package/src/components/SwipeableItem/SwipeableItemCommon.js +0 -44
- package/src/components/SwipeableItem/SwipeableItemCommon.js.map +0 -1
- package/src/components/SwipeableItem/SwipeableList.js +0 -29
- package/src/components/SwipeableItem/SwipeableList.js.map +0 -1
- package/src/components/SwipeableItem/index.js +0 -4
- package/src/components/SwipeableItem/index.js.map +0 -1
- package/src/components/Swiper/Swiper.js +0 -99
- package/src/components/Swiper/Swiper.js.map +0 -1
- package/src/components/Swiper/SwiperItem.js +0 -10
- package/src/components/Swiper/SwiperItem.js.map +0 -1
- package/src/components/Swiper/index.js +0 -3
- package/src/components/Swiper/index.js.map +0 -1
- package/src/components/Switch.js +0 -56
- package/src/components/Switch.js.map +0 -1
- package/src/components/TabView/TabView.js +0 -65
- package/src/components/TabView/TabView.js.map +0 -1
- package/src/components/TabView/TabViewItem.js +0 -12
- package/src/components/TabView/TabViewItem.js.map +0 -1
- package/src/components/TabView/index.js +0 -3
- package/src/components/TabView/index.js.map +0 -1
- package/src/components/Table/Table.js +0 -94
- package/src/components/Table/Table.js.map +0 -1
- package/src/components/Table/TableCell.js +0 -34
- package/src/components/Table/TableCell.js.map +0 -1
- package/src/components/Table/TableCommon.js +0 -13
- package/src/components/Table/TableCommon.js.map +0 -1
- package/src/components/Table/TableRow.js +0 -42
- package/src/components/Table/TableRow.js.map +0 -1
- package/src/components/Table/index.js +0 -4
- package/src/components/Table/index.js.map +0 -1
- package/src/components/Text.js +0 -25
- package/src/components/Text.js.map +0 -1
- package/src/components/TextField.js +0 -411
- package/src/components/TextField.js.map +0 -1
- package/src/components/TextInput.js +0 -25
- package/src/components/TextInput.js.map +0 -1
- package/src/components/Timer.js +0 -87
- package/src/components/Timer.js.map +0 -1
- package/src/components/Touchable.js +0 -13
- package/src/components/Touchable.js.map +0 -1
- package/src/components/Touchable.web.js +0 -3
- package/src/components/Touchable.web.js.map +0 -1
- package/src/components/Typography.js +0 -37
- package/src/components/Typography.js.map +0 -1
- package/src/components/YoutubePlayer/YoutubePlayer.js +0 -21
- package/src/components/YoutubePlayer/YoutubePlayer.js.map +0 -1
- package/src/components/YoutubePlayer/YoutubePlayer.native.js +0 -36
- package/src/components/YoutubePlayer/YoutubePlayer.native.js.map +0 -1
- package/src/components/YoutubePlayer/YoutubePlayerProps.js +0 -2
- package/src/components/YoutubePlayer/YoutubePlayerProps.js.map +0 -1
- package/src/components/YoutubePlayer/index.js +0 -2
- package/src/components/YoutubePlayer/index.js.map +0 -1
- package/src/components/useAuthState.js +0 -35
- package/src/components/useAuthState.js.map +0 -1
- package/src/constants.js +0 -11
- package/src/constants.js.map +0 -1
- package/src/deprecated-components/AccordionItem.js +0 -36
- package/src/deprecated-components/AccordionItem.js.map +0 -1
- package/src/deprecated-components/AnimatedCircularProgress.js +0 -47
- package/src/deprecated-components/AnimatedCircularProgress.js.map +0 -1
- package/src/deprecated-components/AvatarEdit.js +0 -34
- package/src/deprecated-components/AvatarEdit.js.map +0 -1
- package/src/deprecated-components/AvoidKeyboardView.js +0 -36
- package/src/deprecated-components/AvoidKeyboardView.js.map +0 -1
- package/src/deprecated-components/Banner.js +0 -112
- package/src/deprecated-components/Banner.js.map +0 -1
- package/src/deprecated-components/Card.js +0 -61
- package/src/deprecated-components/Card.js.map +0 -1
- package/src/deprecated-components/CheckboxGroup.js +0 -25
- package/src/deprecated-components/CheckboxGroup.js.map +0 -1
- package/src/deprecated-components/CircleImage.js +0 -12
- package/src/deprecated-components/CircleImage.js.map +0 -1
- package/src/deprecated-components/CircularProgress.js +0 -85
- package/src/deprecated-components/CircularProgress.js.map +0 -1
- package/src/deprecated-components/Container.js +0 -46
- package/src/deprecated-components/Container.js.map +0 -1
- package/src/deprecated-components/DeprecatedButton.js +0 -87
- package/src/deprecated-components/DeprecatedButton.js.map +0 -1
- package/src/deprecated-components/DeprecatedCardWrapper.js +0 -22
- package/src/deprecated-components/DeprecatedCardWrapper.js.map +0 -1
- package/src/deprecated-components/DeprecatedFAB.js +0 -111
- package/src/deprecated-components/DeprecatedFAB.js.map +0 -1
- package/src/deprecated-components/FAB.js +0 -50
- package/src/deprecated-components/FAB.js.map +0 -1
- package/src/deprecated-components/FieldSearchBarFull.js +0 -57
- package/src/deprecated-components/FieldSearchBarFull.js.map +0 -1
- package/src/deprecated-components/Layout.js +0 -69
- package/src/deprecated-components/Layout.js.map +0 -1
- package/src/deprecated-components/ProgressBar.js +0 -122
- package/src/deprecated-components/ProgressBar.js.map +0 -1
- package/src/deprecated-components/ProgressCircle.js +0 -17
- package/src/deprecated-components/ProgressCircle.js.map +0 -1
- package/src/deprecated-components/RadioButtonFieldGroup.js +0 -21
- package/src/deprecated-components/RadioButtonFieldGroup.js.map +0 -1
- package/src/deprecated-components/RowBodyIcon.js +0 -12
- package/src/deprecated-components/RowBodyIcon.js.map +0 -1
- package/src/deprecated-components/RowHeadlineImageCaption.js +0 -16
- package/src/deprecated-components/RowHeadlineImageCaption.js.map +0 -1
- package/src/deprecated-components/RowHeadlineImageIcon.js +0 -18
- package/src/deprecated-components/RowHeadlineImageIcon.js.map +0 -1
- package/src/deprecated-components/ToggleButton.js +0 -43
- package/src/deprecated-components/ToggleButton.js.map +0 -1
- package/src/hooks.js +0 -35
- package/src/hooks.js.map +0 -1
- package/src/index.js +0 -77
- package/src/index.js.map +0 -1
- package/src/interfaces/Icon.js +0 -9
- package/src/interfaces/Icon.js.map +0 -1
- package/src/utilities.js +0 -223
- package/src/utilities.js.map +0 -1
|
@@ -1,136 +1,230 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ImageResizeMode, Platform } from "react-native";
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
Image,
|
|
4
|
+
ImageProps,
|
|
5
|
+
ImageResizeMode,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
View,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import {
|
|
10
|
+
VideoView as VideoPlayerComponent,
|
|
11
|
+
VideoViewProps as ExpoVideoProps,
|
|
12
|
+
VideoContentFit,
|
|
13
|
+
useVideoPlayer,
|
|
14
|
+
TimeUpdateEventPayload,
|
|
15
|
+
VideoPlayer as VideoPlayerType,
|
|
16
|
+
VideoSource,
|
|
17
|
+
} from "expo-video";
|
|
18
|
+
import { setAudioModeAsync } from "expo-audio";
|
|
12
19
|
import { extractSizeStyles } from "../../../utilities";
|
|
13
20
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
14
|
-
import type { Playback } from "expo-av/src/AV";
|
|
15
21
|
import {
|
|
16
|
-
mapToMediaPlayerStatus,
|
|
17
22
|
normalizeBase64Source,
|
|
18
23
|
useSourceDeepCompareEffect,
|
|
24
|
+
useSourceDeepCompareMemoize,
|
|
25
|
+
} from "../MediaPlayerCommon";
|
|
26
|
+
import type {
|
|
27
|
+
MediaPlayerRef,
|
|
28
|
+
MediaPlayerProps,
|
|
29
|
+
MediaPlayerStatus,
|
|
19
30
|
} from "../MediaPlayerCommon";
|
|
20
|
-
import type { MediaPlayerRef, MediaPlayerProps } from "../MediaPlayerCommon";
|
|
21
31
|
|
|
22
32
|
type ResizeMode = "contain" | "cover" | "stretch";
|
|
23
|
-
type ExpoVideoPropsOmitted = Omit<
|
|
24
|
-
ExpoVideoProps,
|
|
25
|
-
"videoStyle" | "resizeMode" | "onPlaybackStatusUpdate" | "source"
|
|
26
|
-
>;
|
|
33
|
+
type ExpoVideoPropsOmitted = Omit<ExpoVideoProps, "player" | "nativeControls">;
|
|
27
34
|
|
|
28
35
|
interface VideoPlayerProps extends ExpoVideoPropsOmitted, MediaPlayerProps {
|
|
29
36
|
resizeMode?: ResizeMode;
|
|
30
37
|
posterResizeMode?: ImageResizeMode;
|
|
38
|
+
posterSource?: ImageProps["source"];
|
|
39
|
+
usePoster?: boolean;
|
|
31
40
|
playsInSilentModeIOS?: boolean;
|
|
41
|
+
isMuted?: boolean;
|
|
42
|
+
useNativeControls?: boolean;
|
|
43
|
+
shouldPlay?: boolean;
|
|
44
|
+
isLooping?: boolean;
|
|
45
|
+
positionMillis?: number;
|
|
46
|
+
rate?: number;
|
|
47
|
+
volume?: number;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
export interface VideoPlayerRef extends MediaPlayerRef {
|
|
35
51
|
toggleFullscreen: () => void;
|
|
36
52
|
}
|
|
37
53
|
|
|
38
|
-
// Setting playsInSilentModeIOS prop directly on Video component is unreliable,
|
|
39
|
-
// so we need to set the audio mode globally before playing.
|
|
40
|
-
// See:
|
|
41
|
-
// https://github.com/expo/expo/issues/7485
|
|
42
|
-
// https://stackoverflow.com/questions/57371543/how-to-fix-video-play-but-dont-have-sound-on-ios-with-expo
|
|
43
|
-
const triggerAudio = async (ref: React.RefObject<MediaPlayerRef | null>) => {
|
|
44
|
-
if (ref && ref?.current && Platform.OS === "ios") {
|
|
45
|
-
await Audio.setAudioModeAsync({ playsInSilentModeIOS: true });
|
|
46
|
-
ref.current.play();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
54
|
const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
51
55
|
(
|
|
52
56
|
{
|
|
53
57
|
style,
|
|
54
58
|
resizeMode = "contain",
|
|
55
59
|
posterResizeMode = "cover",
|
|
60
|
+
posterSource,
|
|
61
|
+
usePoster = false,
|
|
56
62
|
onPlaybackStatusUpdate: onPlaybackStatusUpdateProp,
|
|
57
63
|
onPlaybackFinish,
|
|
58
64
|
source,
|
|
59
65
|
playsInSilentModeIOS = false,
|
|
66
|
+
isMuted = false,
|
|
67
|
+
useNativeControls = true,
|
|
68
|
+
shouldPlay = false,
|
|
69
|
+
isLooping = false,
|
|
70
|
+
positionMillis,
|
|
71
|
+
allowsFullscreen = true,
|
|
72
|
+
rate = 1,
|
|
73
|
+
volume = 1,
|
|
60
74
|
...rest
|
|
61
75
|
},
|
|
62
76
|
ref
|
|
63
77
|
) => {
|
|
64
|
-
const
|
|
65
|
-
|
|
78
|
+
const stableSource = useSourceDeepCompareMemoize(
|
|
79
|
+
normalizeBase64Source(source, "video")
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const player = useVideoPlayer(stableSource, (p) => {
|
|
83
|
+
p.loop = isLooping;
|
|
84
|
+
p.muted = isMuted;
|
|
85
|
+
p.volume = volume;
|
|
86
|
+
p.playbackRate = rate;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const videoPlayerRef = React.useRef<VideoPlayerComponent>(null);
|
|
66
90
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
67
91
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
68
|
-
const [
|
|
69
|
-
|
|
92
|
+
const [showPoster, setShowPoster] = React.useState(
|
|
93
|
+
usePoster && !!posterSource
|
|
94
|
+
);
|
|
95
|
+
|
|
70
96
|
const mediaPlaybackWrapperRef = React.useRef<MediaPlayerRef>(null);
|
|
71
97
|
|
|
72
98
|
const sizeStyles = extractSizeStyles(style);
|
|
73
99
|
|
|
74
|
-
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
player.muted = isMuted;
|
|
102
|
+
}, [player, isMuted]);
|
|
103
|
+
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
player.loop = isLooping;
|
|
106
|
+
}, [player, isLooping]);
|
|
107
|
+
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
player.volume = volume;
|
|
110
|
+
}, [player, volume]);
|
|
111
|
+
|
|
112
|
+
React.useEffect(() => {
|
|
113
|
+
player.playbackRate = rate;
|
|
114
|
+
}, [player, rate]);
|
|
115
|
+
|
|
116
|
+
// Refs so statusChange can read latest shouldPlay/positionMillis
|
|
117
|
+
const shouldPlayRef = React.useRef(shouldPlay);
|
|
118
|
+
const positionMillisRef = React.useRef(positionMillis);
|
|
119
|
+
shouldPlayRef.current = shouldPlay;
|
|
120
|
+
positionMillisRef.current = positionMillis;
|
|
121
|
+
|
|
122
|
+
const hasAppliedInitialState = React.useRef(false);
|
|
123
|
+
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
const timeUpdateSub = player.addListener("timeUpdate", (status) => {
|
|
126
|
+
onPlaybackStatusUpdateProp?.(mapToMediaPlayerStatus(status, player));
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const playingChangeSub = player.addListener(
|
|
130
|
+
"playingChange",
|
|
131
|
+
({ isPlaying: playing }) => {
|
|
132
|
+
setIsPlaying(playing);
|
|
133
|
+
onPlaybackStatusUpdateProp?.(mapPlayerToMediaPlayerStatus(player));
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
const playToEndSub = player.addListener("playToEnd", () => {
|
|
138
|
+
onPlaybackFinish?.();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const statusChangeSub = player.addListener(
|
|
142
|
+
"statusChange",
|
|
143
|
+
({ status, error }) => {
|
|
144
|
+
if (status === "readyToPlay") {
|
|
145
|
+
setShowPoster(false);
|
|
146
|
+
if (!hasAppliedInitialState.current) {
|
|
147
|
+
hasAppliedInitialState.current = true;
|
|
148
|
+
if (positionMillisRef.current) {
|
|
149
|
+
player.currentTime = positionMillisRef.current / 1000;
|
|
150
|
+
}
|
|
151
|
+
if (shouldPlayRef.current) {
|
|
152
|
+
player.play();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const mappedStatus = mapPlayerToMediaPlayerStatus(player);
|
|
157
|
+
onPlaybackStatusUpdateProp?.(
|
|
158
|
+
status === "error" && error
|
|
159
|
+
? { ...mappedStatus, isError: true, error: error.message }
|
|
160
|
+
: mappedStatus
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
return () => {
|
|
166
|
+
timeUpdateSub.remove();
|
|
167
|
+
playingChangeSub.remove();
|
|
168
|
+
playToEndSub.remove();
|
|
169
|
+
statusChangeSub.remove();
|
|
170
|
+
};
|
|
171
|
+
}, []);
|
|
172
|
+
|
|
173
|
+
// Replace video source when it changes (deep comparison on URI to avoid unnecessary reloads)
|
|
174
|
+
const isFirstSourceRender = React.useRef(true);
|
|
175
|
+
useSourceDeepCompareEffect(() => {
|
|
176
|
+
if (isFirstSourceRender.current) {
|
|
177
|
+
isFirstSourceRender.current = false;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
hasAppliedInitialState.current = false;
|
|
181
|
+
player.replace(normalizeBase64Source(source, "video") as VideoSource);
|
|
182
|
+
}, [source]);
|
|
183
|
+
|
|
184
|
+
let mappedVideoContentFit: VideoContentFit;
|
|
75
185
|
switch (resizeMode) {
|
|
76
186
|
case "contain":
|
|
77
|
-
|
|
187
|
+
mappedVideoContentFit = "contain";
|
|
78
188
|
break;
|
|
79
189
|
case "cover":
|
|
80
|
-
|
|
190
|
+
mappedVideoContentFit = "cover";
|
|
81
191
|
break;
|
|
82
192
|
case "stretch":
|
|
83
|
-
|
|
193
|
+
mappedVideoContentFit = "fill";
|
|
84
194
|
break;
|
|
85
195
|
}
|
|
86
196
|
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (status.isLoaded) {
|
|
92
|
-
if (status.didJustFinish) {
|
|
93
|
-
onPlaybackFinish?.();
|
|
94
|
-
}
|
|
95
|
-
setIsPlaying(status.isPlaying);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const onFullscreenUpdate = (fullscreenUpdate: VideoFullscreenUpdate) => {
|
|
100
|
-
switch (fullscreenUpdate) {
|
|
101
|
-
case VideoFullscreenUpdate.PLAYER_DID_PRESENT:
|
|
102
|
-
case VideoFullscreenUpdate.PLAYER_WILL_PRESENT:
|
|
197
|
+
const onFullscreenUpdate = (type: "entered" | "exited") => {
|
|
198
|
+
switch (type) {
|
|
199
|
+
case "entered":
|
|
103
200
|
setIsFullscreen(true);
|
|
104
201
|
break;
|
|
105
|
-
case
|
|
106
|
-
case VideoFullscreenUpdate.PLAYER_WILL_DISMISS:
|
|
202
|
+
case "exited":
|
|
107
203
|
setIsFullscreen(false);
|
|
108
204
|
break;
|
|
109
205
|
}
|
|
110
206
|
};
|
|
111
207
|
|
|
112
208
|
const toggleFullscreen = React.useCallback(async () => {
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
209
|
+
if (videoPlayerRef) {
|
|
210
|
+
if (isFullscreen) {
|
|
211
|
+
await videoPlayerRef.current?.exitFullscreen();
|
|
212
|
+
} else {
|
|
213
|
+
await videoPlayerRef.current?.enterFullscreen();
|
|
214
|
+
}
|
|
117
215
|
}
|
|
118
|
-
}, [isFullscreen
|
|
216
|
+
}, [isFullscreen]);
|
|
119
217
|
|
|
120
218
|
const updateAudioMode = React.useCallback(async () => {
|
|
121
219
|
try {
|
|
122
|
-
await
|
|
123
|
-
playsInSilentModeIOS,
|
|
220
|
+
await setAudioModeAsync({
|
|
221
|
+
playsInSilentMode: playsInSilentModeIOS,
|
|
124
222
|
});
|
|
125
223
|
} catch (e) {
|
|
126
224
|
console.error("Failed to set audio mode. Error details:", e);
|
|
127
225
|
}
|
|
128
226
|
}, [playsInSilentModeIOS]);
|
|
129
227
|
|
|
130
|
-
React.useEffect(() => {
|
|
131
|
-
if (isPlaying) triggerAudio(mediaPlaybackWrapperRef);
|
|
132
|
-
}, [mediaPlaybackWrapperRef, isPlaying]);
|
|
133
|
-
|
|
134
228
|
React.useImperativeHandle(
|
|
135
229
|
ref,
|
|
136
230
|
() => ({
|
|
@@ -147,36 +241,69 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
147
241
|
[toggleFullscreen, isPlaying]
|
|
148
242
|
);
|
|
149
243
|
|
|
150
|
-
useSourceDeepCompareEffect(() => {
|
|
151
|
-
const updateSource = async () => {
|
|
152
|
-
const finalSource = await normalizeBase64Source(source, "video");
|
|
153
|
-
setCurrentSource(finalSource);
|
|
154
|
-
};
|
|
155
|
-
updateSource();
|
|
156
|
-
}, [source]);
|
|
157
|
-
|
|
158
244
|
return (
|
|
159
245
|
<MediaPlaybackWrapper
|
|
160
|
-
|
|
246
|
+
player={player}
|
|
161
247
|
isPlaying={isPlaying}
|
|
162
248
|
ref={mediaPlaybackWrapperRef}
|
|
163
249
|
onTogglePlayback={updateAudioMode}
|
|
164
250
|
>
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
251
|
+
<View style={[style, styles.container]}>
|
|
252
|
+
<VideoPlayerComponent
|
|
253
|
+
ref={videoPlayerRef}
|
|
254
|
+
player={player}
|
|
255
|
+
nativeControls={useNativeControls}
|
|
256
|
+
style={sizeStyles}
|
|
257
|
+
contentFit={mappedVideoContentFit}
|
|
258
|
+
onFullscreenEnter={() => onFullscreenUpdate("entered")}
|
|
259
|
+
onFullscreenExit={() => onFullscreenUpdate("exited")}
|
|
260
|
+
allowsFullscreen={allowsFullscreen}
|
|
261
|
+
{...rest}
|
|
262
|
+
/>
|
|
263
|
+
{showPoster && posterSource && (
|
|
264
|
+
<View style={StyleSheet.absoluteFill} pointerEvents="none">
|
|
265
|
+
<Image
|
|
266
|
+
source={posterSource}
|
|
267
|
+
resizeMode={posterResizeMode}
|
|
268
|
+
style={[StyleSheet.absoluteFill, sizeStyles]}
|
|
269
|
+
/>
|
|
270
|
+
</View>
|
|
271
|
+
)}
|
|
272
|
+
</View>
|
|
177
273
|
</MediaPlaybackWrapper>
|
|
178
274
|
);
|
|
179
275
|
}
|
|
180
276
|
);
|
|
181
277
|
|
|
278
|
+
const styles = StyleSheet.create({
|
|
279
|
+
container: {
|
|
280
|
+
overflow: "hidden",
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
function mapPlayerToMediaPlayerStatus(
|
|
285
|
+
player: VideoPlayerType
|
|
286
|
+
): MediaPlayerStatus {
|
|
287
|
+
return {
|
|
288
|
+
isPlaying: player.playing,
|
|
289
|
+
isLoading: player.status === "loading",
|
|
290
|
+
isBuffering: player.status === "loading",
|
|
291
|
+
currentPositionMillis: player.currentTime * 1000,
|
|
292
|
+
durationMillis: player.duration * 1000,
|
|
293
|
+
bufferedDurationMillis: player.bufferedPosition * 1000,
|
|
294
|
+
isError: player.status === "error",
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function mapToMediaPlayerStatus(
|
|
299
|
+
status: TimeUpdateEventPayload,
|
|
300
|
+
player: VideoPlayerType
|
|
301
|
+
): MediaPlayerStatus {
|
|
302
|
+
return {
|
|
303
|
+
...mapPlayerToMediaPlayerStatus(player),
|
|
304
|
+
currentPositionMillis: status.currentTime * 1000,
|
|
305
|
+
bufferedDurationMillis: status.bufferedPosition * 1000,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
182
309
|
export default VideoPlayer;
|
package/src/Provider.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import PortalHost from "./components/Portal/PortalHost";
|
|
3
|
-
import { ThemeProvider } from "@draftbit/theme";
|
|
4
|
-
export default class Provider extends React.Component {
|
|
5
|
-
render() {
|
|
6
|
-
return (React.createElement(ThemeProvider, { themes: this.props.themes, breakpoints: this.props.breakpoints, initialThemeName: this.props.initialThemeName },
|
|
7
|
-
React.createElement(PortalHost, null, this.props.children)));
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=Provider.js.map
|
package/src/Provider.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAShD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,KAAK,CAAC,SAAwB;IAClE,MAAM;QACJ,OAAO,CACL,oBAAC,aAAa,IACZ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB;YAE7C,oBAAC,UAAU,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAc,CAChC,CACjB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet, Pressable, } from "react-native";
|
|
3
|
-
import Text from "./Text";
|
|
4
|
-
import { withTheme } from "@draftbit/theme";
|
|
5
|
-
import { extractStyles } from "../utilities";
|
|
6
|
-
const AccordionGroup = ({ label, expanded: expandedProp = false, openColor, closedColor, caretColor: caretColorProp, caretSize = 24, icon, iconSize = 24, style, children, theme, Icon, }) => {
|
|
7
|
-
const [expanded, setExpanded] = React.useState(expandedProp);
|
|
8
|
-
const { textStyles, viewStyles } = extractStyles(style);
|
|
9
|
-
const expandedColor = openColor || theme.colors.branding.primary;
|
|
10
|
-
const collapsedColor = closedColor || theme.colors.branding.primary;
|
|
11
|
-
const labelColor = expanded ? expandedColor : collapsedColor;
|
|
12
|
-
const caretColor = caretColorProp || labelColor;
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
if (expandedProp !== expanded) {
|
|
15
|
-
setExpanded(expandedProp);
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
}, [expandedProp]);
|
|
19
|
-
const handlePressAction = () => {
|
|
20
|
-
setExpanded(!expanded);
|
|
21
|
-
};
|
|
22
|
-
return (React.createElement(React.Fragment, null,
|
|
23
|
-
React.createElement(Pressable, { style: [styles.row, viewStyles], onPress: handlePressAction, accessibilityRole: "button" },
|
|
24
|
-
icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
|
|
25
|
-
React.createElement(View, { style: styles.content },
|
|
26
|
-
React.createElement(Text, { selectable: false, style: [
|
|
27
|
-
textStyles,
|
|
28
|
-
{
|
|
29
|
-
color: labelColor,
|
|
30
|
-
},
|
|
31
|
-
] }, label)),
|
|
32
|
-
React.createElement(Icon, { name: expanded
|
|
33
|
-
? "MaterialIcons/keyboard-arrow-up"
|
|
34
|
-
: "MaterialIcons/keyboard-arrow-down", color: caretColor, size: caretSize })),
|
|
35
|
-
expanded ? children : null));
|
|
36
|
-
};
|
|
37
|
-
const styles = StyleSheet.create({
|
|
38
|
-
row: {
|
|
39
|
-
flexDirection: "row",
|
|
40
|
-
alignItems: "center",
|
|
41
|
-
},
|
|
42
|
-
content: {
|
|
43
|
-
flex: 1,
|
|
44
|
-
justifyContent: "center",
|
|
45
|
-
},
|
|
46
|
-
icon: {
|
|
47
|
-
marginRight: 8,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
export default withTheme(AccordionGroup);
|
|
51
|
-
//# sourceMappingURL=AccordionGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionGroup.js","sourceRoot":"","sources":["AccordionGroup.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import Portal from "../Portal/Portal";
|
|
4
|
-
import Touchable from "../Touchable";
|
|
5
|
-
import ActionSheetCancel from "./ActionSheetCancel";
|
|
6
|
-
const ActionSheet = ({ visible = false, onClose, children }) => {
|
|
7
|
-
return visible ? (React.createElement(Portal, null,
|
|
8
|
-
React.createElement(Touchable, { style: styles.wrapper, onPress: onClose },
|
|
9
|
-
React.createElement(View, { style: styles.overlay }),
|
|
10
|
-
React.createElement(View, { style: styles.groupWrapper },
|
|
11
|
-
React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => (child === null || child === void 0 ? void 0 : child.type) !== ActionSheetCancel)),
|
|
12
|
-
React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child.type === ActionSheetCancel)))))) : (React.createElement(React.Fragment, null));
|
|
13
|
-
};
|
|
14
|
-
const styles = StyleSheet.create({
|
|
15
|
-
wrapper: {
|
|
16
|
-
flex: 1,
|
|
17
|
-
display: "flex",
|
|
18
|
-
flexDirection: "column",
|
|
19
|
-
},
|
|
20
|
-
overlay: {
|
|
21
|
-
position: "absolute",
|
|
22
|
-
top: 0,
|
|
23
|
-
left: 0,
|
|
24
|
-
right: 0,
|
|
25
|
-
bottom: 0,
|
|
26
|
-
backgroundColor: "#000000",
|
|
27
|
-
opacity: 0.3,
|
|
28
|
-
},
|
|
29
|
-
groupWrapper: {
|
|
30
|
-
flex: 1,
|
|
31
|
-
flexDirection: "column",
|
|
32
|
-
justifyContent: "flex-end",
|
|
33
|
-
display: "flex",
|
|
34
|
-
marginBottom: 25,
|
|
35
|
-
},
|
|
36
|
-
group: {
|
|
37
|
-
display: "flex",
|
|
38
|
-
flexDirection: "column",
|
|
39
|
-
borderRadius: 10,
|
|
40
|
-
marginHorizontal: 7,
|
|
41
|
-
marginVertical: 2.5,
|
|
42
|
-
overflow: "hidden",
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
export default ActionSheet;
|
|
46
|
-
//# sourceMappingURL=ActionSheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheet.js","sourceRoot":"","sources":["ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAQpD,MAAM,WAAW,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAS,EAAE,EAAE;IACpE,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,oBAAC,MAAM;QACL,oBAAC,SAAS,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO;YAChD,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,GAAI;YAC/B,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,YAAY;gBAC9B,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IACtB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACtC,CAAC,KAAU,EAAE,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,iBAAiB,CAClD,CACI;gBACP,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IACtB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACtC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,iBAAiB,CACjD,CACI,CACF,CACG,CACL,CACV,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;KACxB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,GAAG;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,UAAU;QAC1B,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,EAAE;KACjB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,YAAY,EAAE,EAAE;QAChB,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,GAAG;QACnB,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ActionSheetItem from "./ActionSheetItem";
|
|
3
|
-
const ActionSheetCancel = ({ label = "Cancel", color, style, onPress, }) => {
|
|
4
|
-
return (React.createElement(ActionSheetItem, { label: label, color: color || "#FF453A", style: style, onPress: onPress }));
|
|
5
|
-
};
|
|
6
|
-
export default ActionSheetCancel;
|
|
7
|
-
//# sourceMappingURL=ActionSheetCancel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetCancel.js","sourceRoot":"","sources":["ActionSheetCancel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAShD,MAAM,iBAAiB,GAA6C,CAAC,EACnE,KAAK,GAAG,QAAQ,EAChB,KAAK,EACL,KAAK,EACL,OAAO,GACR,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Text, StyleSheet, TouchableOpacity, } from "react-native";
|
|
3
|
-
import { extractStyles } from "../../utilities";
|
|
4
|
-
const ActionSheetItem = ({ label, style, color, onPress, activeOpacity = 0.7, }) => {
|
|
5
|
-
const { textStyles, viewStyles } = extractStyles(style);
|
|
6
|
-
return (React.createElement(TouchableOpacity, { activeOpacity: activeOpacity, style: [styles.wrapper, viewStyles], onPress: onPress },
|
|
7
|
-
React.createElement(Text, { style: [styles.label, textStyles, { color }] }, label)));
|
|
8
|
-
};
|
|
9
|
-
const styles = StyleSheet.create({
|
|
10
|
-
wrapper: {
|
|
11
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
12
|
-
borderBottomColor: "#CCCCCC",
|
|
13
|
-
backgroundColor: "#F1F1F1",
|
|
14
|
-
minHeight: 50,
|
|
15
|
-
overflow: "hidden",
|
|
16
|
-
display: "flex",
|
|
17
|
-
justifyContent: "center",
|
|
18
|
-
},
|
|
19
|
-
label: {
|
|
20
|
-
fontSize: 16,
|
|
21
|
-
textAlign: "center",
|
|
22
|
-
color: "#0A84FF",
|
|
23
|
-
fontWeight: "500",
|
|
24
|
-
overflow: "hidden",
|
|
25
|
-
paddingHorizontal: 20,
|
|
26
|
-
paddingVertical: 10,
|
|
27
|
-
alignSelf: "center",
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
export default ActionSheetItem;
|
|
31
|
-
//# sourceMappingURL=ActionSheetItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetItem.js","sourceRoot":"","sources":["ActionSheetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,UAAU,EAEV,gBAAgB,GAGjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUhD,MAAM,eAAe,GAA6C,CAAC,EACjE,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,aAAa,GAAG,GAAG,GACpB,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,CACL,oBAAC,gBAAgB,IACf,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,EACnC,OAAO,EAAE,OAAO;QAEhB,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,IAAG,KAAK,CAAQ,CACjD,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,iBAAiB,EAAE,UAAU,CAAC,aAAa;QAC3C,iBAAiB,EAAE,SAAS;QAC5B,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,QAAQ;QAClB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, StyleSheet, } from "react-native";
|
|
3
|
-
const AspectRatio = (props) => {
|
|
4
|
-
const [layout, setLayout] = React.useState(null);
|
|
5
|
-
const { aspectRatio = 1, ...inputStyle } = StyleSheet.flatten(props.style) || {};
|
|
6
|
-
const style = [inputStyle, { aspectRatio }];
|
|
7
|
-
if (layout) {
|
|
8
|
-
const { width = 0, height = 0 } = layout;
|
|
9
|
-
if (width === 0) {
|
|
10
|
-
style.push({ width: height * (1 / +aspectRatio), height });
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
style.push({ width, height: width * (1 / +aspectRatio) });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return (React.createElement(View, { ...props, style: style, onLayout: ({ nativeEvent: { layout: l } }) => setLayout(l) }, props.children));
|
|
17
|
-
};
|
|
18
|
-
export default AspectRatio;
|
|
19
|
-
//# sourceMappingURL=AspectRatio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AspectRatio.js","sourceRoot":"","sources":["AspectRatio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,UAAU,GAIX,MAAM,cAAc,CAAC;AAOtB,MAAM,WAAW,GAA6C,CAAC,KAAK,EAAE,EAAE;IACtE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAyB,IAAI,CAAC,CAAC;IACzE,MAAM,EAAE,WAAW,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,GACtC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAE5C,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,CACL,oBAAC,IAAI,OACC,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,IAEzD,KAAK,CAAC,QAAQ,CACV,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|