@draftbit/core 49.5.1-eca979.2 → 49.5.2-ace73d.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/Provider.js +1 -1
- package/lib/commonjs/components/AccordionGroup.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/lib/commonjs/components/Divider.js +1 -1
- package/lib/commonjs/components/Elevation.js +1 -1
- package/lib/commonjs/components/IconButton.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
- package/lib/commonjs/components/ProgressIndicator.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/Row.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
- package/lib/commonjs/components/Slider.js +1 -1
- package/lib/commonjs/components/StarRating.js +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Surface.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/commonjs/components/Switch.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/Table/Table.js +1 -1
- package/lib/commonjs/components/Table/TableRow.js +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/components/Typography.js +1 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
- package/lib/commonjs/deprecated-components/Banner.js +1 -1
- package/lib/commonjs/deprecated-components/Card.js +1 -1
- package/lib/commonjs/deprecated-components/Container.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
- package/lib/commonjs/deprecated-components/FAB.js +1 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/typescript/src/Provider.d.ts +7 -5
- package/lib/typescript/src/Provider.js +4 -4
- package/lib/typescript/src/Provider.js.map +1 -1
- package/lib/typescript/src/components/AccordionGroup.d.ts +3 -5
- package/lib/typescript/src/components/AccordionGroup.js +3 -3
- package/lib/typescript/src/components/AccordionGroup.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +3 -5
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js +4 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/typescript/src/components/Button.js +12 -9
- package/lib/typescript/src/components/Button.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.js +3 -3
- package/lib/typescript/src/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +4 -2
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +4 -3
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +3 -5
- package/lib/typescript/src/components/DatePicker/DatePicker.js +24 -23
- package/lib/typescript/src/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +4 -5010
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js +8 -6
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -2
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +3 -5
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts +3 -5
- package/lib/typescript/src/components/Divider.js +2 -2
- package/lib/typescript/src/components/Divider.js.map +1 -1
- package/lib/typescript/src/components/Elevation.d.ts +3 -5
- package/lib/typescript/src/components/Elevation.js +3 -4
- package/lib/typescript/src/components/Elevation.js.map +1 -1
- package/lib/typescript/src/components/FormRow.d.ts +1 -2
- package/lib/typescript/src/components/FormRow.js.map +1 -1
- package/lib/typescript/src/components/IconButton.d.ts +3 -5
- package/lib/typescript/src/components/IconButton.js +2 -2
- package/lib/typescript/src/components/IconButton.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.d.ts +0 -2
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.d.ts +5 -4
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +10 -13
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.d.ts +2 -4
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js +1 -3
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.d.ts +6 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/lib/typescript/src/components/Picker/NativePicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/NativePicker.js +5 -2
- package/lib/typescript/src/components/Picker/NativePicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerCommon.d.ts +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/index.d.ts +1 -3
- package/lib/typescript/src/components/Picker/index.js +1 -1
- package/lib/typescript/src/components/Picker/index.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.d.ts +3 -5
- package/lib/typescript/src/components/PinInput/PinInput.js +4 -4
- package/lib/typescript/src/components/PinInput/PinInput.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInputText.d.ts +3 -5
- package/lib/typescript/src/components/PinInput/PinInputText.js +2 -2
- package/lib/typescript/src/components/PinInput/PinInputText.js.map +1 -1
- package/lib/typescript/src/components/Portal/Portal.d.ts +1 -9
- package/lib/typescript/src/components/Portal/Portal.js +3 -5
- package/lib/typescript/src/components/Portal/Portal.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.d.ts +1 -3
- package/lib/typescript/src/components/Progress/CircularProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.d.ts +1 -3
- package/lib/typescript/src/components/Progress/LinearProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/ProgressCommon.d.ts +2 -2
- package/lib/typescript/src/components/ProgressIndicator.d.ts +10 -13
- package/lib/typescript/src/components/ProgressIndicator.js +1 -1
- package/lib/typescript/src/components/ProgressIndicator.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +2 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +4 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js +4 -3
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/typescript/src/components/Row.d.ts +3 -5
- package/lib/typescript/src/components/Row.js +1 -1
- package/lib/typescript/src/components/Row.js.map +1 -1
- package/lib/typescript/src/components/ScreenContainer.d.ts +3 -6
- package/lib/typescript/src/components/ScreenContainer.js +3 -2
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +3 -5
- package/lib/typescript/src/components/SectionList/SectionHeader.js +3 -3
- package/lib/typescript/src/components/SectionList/SectionHeader.js.map +1 -1
- package/lib/typescript/src/components/Slider.d.ts +3 -6
- package/lib/typescript/src/components/Slider.js +6 -6
- package/lib/typescript/src/components/Slider.js.map +1 -1
- package/lib/typescript/src/components/StarRating.d.ts +3 -5
- package/lib/typescript/src/components/StarRating.js +1 -1
- package/lib/typescript/src/components/StarRating.js.map +1 -1
- package/lib/typescript/src/components/Stepper.d.ts +3 -5
- package/lib/typescript/src/components/Stepper.js +3 -2
- package/lib/typescript/src/components/Stepper.js.map +1 -1
- package/lib/typescript/src/components/Surface.d.ts +3 -5
- package/lib/typescript/src/components/Surface.js +3 -10
- package/lib/typescript/src/components/Surface.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +3 -5
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js +10 -5
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +4 -2
- package/lib/typescript/src/components/Swiper/Swiper.js +3 -2
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/src/components/Switch.d.ts +7 -24
- package/lib/typescript/src/components/Switch.js +3 -4
- package/lib/typescript/src/components/Switch.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +3 -5
- package/lib/typescript/src/components/TabView/TabView.js +4 -4
- package/lib/typescript/src/components/TabView/TabView.js.map +1 -1
- package/lib/typescript/src/components/Table/Table.d.ts +3 -5
- package/lib/typescript/src/components/Table/Table.js +2 -2
- package/lib/typescript/src/components/Table/Table.js.map +1 -1
- package/lib/typescript/src/components/Table/TableRow.d.ts +3 -5
- package/lib/typescript/src/components/Table/TableRow.js +4 -2
- package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
- package/lib/typescript/src/components/Text.d.ts +3 -9
- package/lib/typescript/src/components/Text.js +2 -2
- package/lib/typescript/src/components/Text.js.map +1 -1
- package/lib/typescript/src/components/TextField.d.ts +4 -41
- package/lib/typescript/src/components/TextField.js +22 -20
- package/lib/typescript/src/components/TextField.js.map +1 -1
- package/lib/typescript/src/components/TextInput.js +3 -0
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/src/components/Typography.d.ts +5 -11
- package/lib/typescript/src/components/Typography.js +4 -4
- package/lib/typescript/src/components/Typography.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AccordionItem.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/AccordionItem.js +2 -2
- package/lib/typescript/src/deprecated-components/AccordionItem.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AvatarEdit.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/AvatarEdit.js +4 -4
- package/lib/typescript/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Banner.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/Banner.js +4 -5
- package/lib/typescript/src/deprecated-components/Banner.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Card.d.ts +6 -18
- package/lib/typescript/src/deprecated-components/Card.js +3 -3
- package/lib/typescript/src/deprecated-components/Card.js.map +1 -1
- package/lib/typescript/src/deprecated-components/CheckboxGroup.d.ts +2 -2
- package/lib/typescript/src/deprecated-components/Container.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/Container.js +1 -1
- package/lib/typescript/src/deprecated-components/Container.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedButton.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FAB.d.ts +3 -8
- package/lib/typescript/src/deprecated-components/FAB.js +2 -2
- package/lib/typescript/src/deprecated-components/FAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ProgressCircle.d.ts +5 -8
- package/lib/typescript/src/deprecated-components/ProgressCircle.js +3 -3
- package/lib/typescript/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.d.ts +1 -3
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowBodyIcon.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js +2 -2
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ToggleButton.d.ts +6 -9
- package/lib/typescript/src/deprecated-components/ToggleButton.js +5 -5
- package/lib/typescript/src/deprecated-components/ToggleButton.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.js +0 -2
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/src/Provider.js +4 -4
- package/src/Provider.js.map +1 -1
- package/src/Provider.tsx +15 -12
- package/src/components/AccordionGroup.js +3 -3
- package/src/components/AccordionGroup.js.map +1 -1
- package/src/components/AccordionGroup.tsx +5 -5
- package/src/components/BottomSheet/BottomSheet.js +4 -4
- package/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +7 -7
- package/src/components/Button.js +12 -9
- package/src/components/Button.js.map +1 -1
- package/src/components/Button.tsx +24 -12
- package/src/components/Checkbox/Checkbox.js +3 -3
- package/src/components/Checkbox/Checkbox.js.map +1 -1
- package/src/components/Checkbox/Checkbox.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +4 -3
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +9 -2
- package/src/components/DatePicker/DatePicker.js +24 -23
- package/src/components/DatePicker/DatePicker.js.map +1 -1
- package/src/components/DatePicker/DatePicker.tsx +25 -24
- package/src/components/DatePicker/DatePickerComponent.web.js +8 -6
- package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +15 -8
- package/src/components/DatePicker/DatePickerComponentType.ts +2 -3
- package/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +5 -5
- package/src/components/Divider.js +2 -2
- package/src/components/Divider.js.map +1 -1
- package/src/components/Divider.tsx +4 -4
- package/src/components/Elevation.js +3 -4
- package/src/components/Elevation.js.map +1 -1
- package/src/components/Elevation.tsx +5 -6
- package/src/components/FormRow.js.map +1 -1
- package/src/components/FormRow.tsx +1 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.js.map +1 -1
- package/src/components/IconButton.tsx +4 -4
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.ts +0 -2
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +10 -13
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +19 -19
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +8 -31
- package/src/components/MediaPlayer/AudioPlayer/index.js +1 -3
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/index.tsx +1 -3
- package/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.ts +56 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +18 -1
- package/src/components/Picker/NativePicker.js +5 -2
- package/src/components/Picker/NativePicker.js.map +1 -1
- package/src/components/Picker/NativePicker.tsx +5 -2
- package/src/components/Picker/PickerCommon.ts +2 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js +2 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownModalPicker.tsx +5 -5
- package/src/components/Picker/dropdown/DropDownPicker.js +2 -2
- package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownPicker.tsx +5 -5
- package/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.tsx +1 -1
- package/src/components/Picker/index.js +1 -1
- package/src/components/Picker/index.js.map +1 -1
- package/src/components/Picker/index.tsx +1 -1
- package/src/components/PinInput/PinInput.js +4 -4
- package/src/components/PinInput/PinInput.js.map +1 -1
- package/src/components/PinInput/PinInput.tsx +6 -6
- package/src/components/PinInput/PinInputText.js +2 -2
- package/src/components/PinInput/PinInputText.js.map +1 -1
- package/src/components/PinInput/PinInputText.tsx +4 -4
- package/src/components/Portal/Portal.js +3 -5
- package/src/components/Portal/Portal.js.map +1 -1
- package/src/components/Portal/Portal.tsx +3 -10
- package/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.tsx +2 -2
- package/src/components/Progress/CircularProgress/index.js +1 -1
- package/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/src/components/Progress/CircularProgress/index.tsx +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.tsx +2 -2
- package/src/components/Progress/LinearProgress/index.js +1 -1
- package/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/src/components/Progress/LinearProgress/index.tsx +1 -1
- package/src/components/Progress/ProgressCommon.ts +2 -2
- package/src/components/ProgressIndicator.js +1 -1
- package/src/components/ProgressIndicator.js.map +1 -1
- package/src/components/ProgressIndicator.tsx +10 -11
- package/src/components/RadioButton/RadioButtonGroup.tsx +2 -2
- package/src/components/RadioButton/RadioButtonRow.js +4 -3
- package/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/src/components/RadioButton/RadioButtonRow.tsx +9 -2
- package/src/components/Row.js +1 -1
- package/src/components/Row.js.map +1 -1
- package/src/components/Row.tsx +3 -3
- package/src/components/ScreenContainer.js +3 -2
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +5 -4
- package/src/components/SectionList/SectionHeader.js +3 -3
- package/src/components/SectionList/SectionHeader.js.map +1 -1
- package/src/components/SectionList/SectionHeader.tsx +5 -5
- package/src/components/Slider.js +6 -6
- package/src/components/Slider.js.map +1 -1
- package/src/components/Slider.tsx +8 -8
- package/src/components/StarRating.js +1 -1
- package/src/components/StarRating.js.map +1 -1
- package/src/components/StarRating.tsx +3 -3
- package/src/components/Stepper.js +3 -2
- package/src/components/Stepper.js.map +1 -1
- package/src/components/Stepper.tsx +5 -4
- package/src/components/Surface.js +3 -10
- package/src/components/Surface.js.map +1 -1
- package/src/components/Surface.tsx +5 -12
- package/src/components/SwipeableItem/SwipeableItem.js +10 -5
- package/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableItem.tsx +13 -7
- package/src/components/Swiper/Swiper.js +3 -2
- package/src/components/Swiper/Swiper.js.map +1 -1
- package/src/components/Swiper/Swiper.tsx +6 -3
- package/src/components/Switch.js +3 -4
- package/src/components/Switch.js.map +1 -1
- package/src/components/Switch.tsx +7 -7
- package/src/components/TabView/TabView.js +4 -4
- package/src/components/TabView/TabView.js.map +1 -1
- package/src/components/TabView/TabView.tsx +7 -7
- package/src/components/Table/Table.js +2 -2
- package/src/components/Table/Table.js.map +1 -1
- package/src/components/Table/Table.tsx +4 -4
- package/src/components/Table/TableRow.js +4 -2
- package/src/components/Table/TableRow.js.map +1 -1
- package/src/components/Table/TableRow.tsx +6 -4
- package/src/components/Text.js +2 -2
- package/src/components/Text.js.map +1 -1
- package/src/components/Text.tsx +4 -4
- package/src/components/TextField.js +22 -20
- package/src/components/TextField.js.map +1 -1
- package/src/components/TextField.tsx +26 -23
- package/src/components/TextInput.js +3 -0
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +3 -0
- package/src/components/Typography.js +4 -4
- package/src/components/Typography.js.map +1 -1
- package/src/components/Typography.tsx +6 -6
- package/src/deprecated-components/AccordionItem.js +2 -2
- package/src/deprecated-components/AccordionItem.js.map +1 -1
- package/src/deprecated-components/AccordionItem.tsx +4 -4
- package/src/deprecated-components/AvatarEdit.js +4 -4
- package/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/src/deprecated-components/AvatarEdit.tsx +6 -6
- package/src/deprecated-components/Banner.js +4 -5
- package/src/deprecated-components/Banner.js.map +1 -1
- package/src/deprecated-components/Banner.tsx +6 -10
- package/src/deprecated-components/Card.js +3 -3
- package/src/deprecated-components/Card.js.map +1 -1
- package/src/deprecated-components/Card.tsx +10 -6
- package/src/deprecated-components/CheckboxGroup.tsx +2 -2
- package/src/deprecated-components/Container.js +1 -1
- package/src/deprecated-components/Container.js.map +1 -1
- package/src/deprecated-components/Container.tsx +3 -3
- package/src/deprecated-components/DeprecatedButton.js +8 -8
- package/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/src/deprecated-components/DeprecatedButton.tsx +10 -10
- package/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.tsx +3 -3
- package/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/src/deprecated-components/DeprecatedFAB.tsx +10 -10
- package/src/deprecated-components/FAB.js +2 -2
- package/src/deprecated-components/FAB.js.map +1 -1
- package/src/deprecated-components/FAB.tsx +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/src/deprecated-components/FieldSearchBarFull.tsx +6 -6
- package/src/deprecated-components/ProgressCircle.js +3 -3
- package/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/src/deprecated-components/ProgressCircle.tsx +7 -8
- package/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.tsx +1 -1
- package/src/deprecated-components/RowBodyIcon.js +2 -2
- package/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/src/deprecated-components/RowBodyIcon.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageCaption.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageIcon.tsx +6 -6
- package/src/deprecated-components/ToggleButton.js +5 -5
- package/src/deprecated-components/ToggleButton.js.map +1 -1
- package/src/deprecated-components/ToggleButton.tsx +12 -11
- package/src/index.js +0 -2
- package/src/index.js.map +1 -1
- package/src/index.tsx +0 -2
- package/lib/commonjs/styles/DarkTheme.js +0 -1
- package/lib/commonjs/styles/DefaultTheme.js +0 -1
- package/lib/commonjs/styles/fonts.js +0 -1
- package/lib/commonjs/styles/overlay.js +0 -1
- package/lib/commonjs/styles/shadow.js +0 -1
- package/lib/commonjs/theming.js +0 -1
- package/lib/typescript/src/styles/DarkTheme.d.ts +0 -3
- package/lib/typescript/src/styles/DarkTheme.js +0 -27
- package/lib/typescript/src/styles/DarkTheme.js.map +0 -1
- package/lib/typescript/src/styles/DefaultTheme.d.ts +0 -1670
- package/lib/typescript/src/styles/DefaultTheme.js +0 -112
- package/lib/typescript/src/styles/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/styles/fonts.d.ts +0 -5
- package/lib/typescript/src/styles/fonts.js +0 -63
- package/lib/typescript/src/styles/fonts.js.map +0 -1
- package/lib/typescript/src/styles/overlay.d.ts +0 -2
- package/lib/typescript/src/styles/overlay.js +0 -61
- package/lib/typescript/src/styles/overlay.js.map +0 -1
- package/lib/typescript/src/styles/shadow.d.ts +0 -23
- package/lib/typescript/src/styles/shadow.js +0 -52
- package/lib/typescript/src/styles/shadow.js.map +0 -1
- package/lib/typescript/src/theming.d.ts +0 -8
- package/lib/typescript/src/theming.js +0 -4
- package/lib/typescript/src/theming.js.map +0 -1
- package/src/styles/DarkTheme.js +0 -27
- package/src/styles/DarkTheme.js.map +0 -1
- package/src/styles/DarkTheme.tsx +0 -30
- package/src/styles/DefaultTheme.js +0 -112
- package/src/styles/DefaultTheme.js.map +0 -1
- package/src/styles/DefaultTheme.tsx +0 -114
- package/src/styles/fonts.js +0 -63
- package/src/styles/fonts.js.map +0 -1
- package/src/styles/fonts.tsx +0 -67
- package/src/styles/overlay.js +0 -61
- package/src/styles/overlay.js.map +0 -1
- package/src/styles/overlay.tsx +0 -69
- package/src/styles/shadow.js +0 -52
- package/src/styles/shadow.js.map +0 -1
- package/src/styles/shadow.tsx +0 -55
- package/src/theming.js +0 -4
- package/src/theming.js.map +0 -1
- package/src/theming.tsx +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,EAGjB,SAAS,EAET,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,EAGjB,SAAS,EAET,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkB5C,MAAM,UAAU,GAA6C,CAAC,EAC5D,IAAI,EACJ,IAAI,EACJ,KAAK,EAAE,WAAW,EAClB,IAAI,GAAG,EAAE,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,OAAO,EACP,KAAK,EACL,KAAK,EACL,aAAa,GAAG,GAAG,EACnB,eAAe,GAAG,GAAG,EACrB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;IAE/D,OAAO,CACL,oBAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,OAAO;gBACL,MAAM,CAAC,SAAS;gBAChB;oBACE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;oBACjE,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;iBACzB;gBACD,KAAK;aACN,CAAC;QACJ,CAAC,KACG,KAAK;QAET,oBAAC,IAAI;YACF,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,GAAI,CACvD,CAAC,CAAC,CAAC,IAAI;YACP,OAAO,CAAC,CAAC,CAAC,oBAAC,iBAAiB,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,IAAI,CACjE,CACG,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
PressableProps,
|
|
10
10
|
Platform,
|
|
11
11
|
} from "react-native";
|
|
12
|
-
import { withTheme } from "
|
|
13
|
-
import type {
|
|
12
|
+
import { withTheme } from "@draftbit/theme";
|
|
13
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
14
14
|
import type { IconSlot } from "../interfaces/Icon";
|
|
15
15
|
|
|
16
16
|
type Props = {
|
|
@@ -20,7 +20,7 @@ type Props = {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
loading?: boolean;
|
|
22
22
|
onPress: () => void;
|
|
23
|
-
theme:
|
|
23
|
+
theme: ReadTheme;
|
|
24
24
|
style?: StyleProp<ViewStyle>;
|
|
25
25
|
activeOpacity?: number;
|
|
26
26
|
disabledOpacity?: number;
|
|
@@ -41,7 +41,7 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
41
41
|
disabledOpacity = 0.8,
|
|
42
42
|
...props
|
|
43
43
|
}) => {
|
|
44
|
-
const iconColor = customColor || theme.colors.primary;
|
|
44
|
+
const iconColor = customColor || theme.colors.branding.primary;
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<Pressable
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
2
|
-
import type { Theme } from "../../../styles/DefaultTheme";
|
|
3
2
|
import { MediaPlayerProps } from "../MediaPlayerCommon";
|
|
4
3
|
|
|
5
4
|
export type AudioInterruptionMode = "lower volume" | "stop";
|
|
@@ -21,5 +20,4 @@ export interface AudioPlayerInterfaceProps {
|
|
|
21
20
|
hidePlaybackIcon?: boolean;
|
|
22
21
|
hideDuration?: boolean;
|
|
23
22
|
hideSlider?: boolean;
|
|
24
|
-
theme: Theme;
|
|
25
23
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Text, View, StyleSheet } from "react-native";
|
|
3
3
|
import { AntDesign } from "@expo/vector-icons";
|
|
4
|
-
import {
|
|
4
|
+
import { useTheme } from "@draftbit/theme";
|
|
5
5
|
import Slider from "@react-native-community/slider";
|
|
6
6
|
import HeadlessAudioPlayer from "./HeadlessAudioPlayer";
|
|
7
7
|
import Pressable from "../../Pressable";
|
|
8
8
|
/**
|
|
9
9
|
* Built on top of HeadlessAudioPlayer to provide a simple interface for playing audio
|
|
10
10
|
*/
|
|
11
|
-
const AudioPlayerWithInterface = React.forwardRef(({ style,
|
|
11
|
+
const AudioPlayerWithInterface = React.forwardRef(({ style, thumbColor, completedTrackColor, remainingTrackColor, togglePlaybackIconSize = 24, togglePlaybackIconColor, onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish: onPlaybackFinishProp, hidePlaybackIcon = false, hideDuration = false, hideSlider = false, ...rest }, ref) => {
|
|
12
12
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
13
13
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
14
|
const [durationMillis, setDurationMillis] = React.useState(1);
|
|
15
15
|
const [isDraggingSlider, setIsDraggingSlider] = React.useState(false);
|
|
16
16
|
const [sliderPositionMillis, setSliderPositionMillis] = React.useState(0);
|
|
17
17
|
const newHeadlessAudioPlayerRef = React.useRef(null);
|
|
18
|
+
const theme = useTheme();
|
|
18
19
|
// Use the provided ref or default to new ref when not provided
|
|
19
20
|
const headlessAudioPlayerRef = ref
|
|
20
21
|
? ref
|
|
21
22
|
: newHeadlessAudioPlayerRef;
|
|
22
|
-
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
|
|
23
|
+
const { color = theme.colors.text.strong, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
|
|
23
24
|
const textStyles = {
|
|
24
25
|
color,
|
|
25
26
|
fontFamily,
|
|
@@ -74,24 +75,20 @@ const AudioPlayerWithInterface = React.forwardRef(({ style, theme, thumbColor =
|
|
|
74
75
|
React.createElement(HeadlessAudioPlayer, { ...rest, ref: headlessAudioPlayerRef, onPlaybackStatusUpdate: onPlaybackStatusUpdate, onPlaybackFinish: onPlaybackFinish }),
|
|
75
76
|
React.createElement(View, { testID: "audio-player-interface", style: [
|
|
76
77
|
{
|
|
77
|
-
backgroundColor: theme.colors.background,
|
|
78
|
-
borderColor: theme.colors.
|
|
78
|
+
backgroundColor: theme.colors.background.brand,
|
|
79
|
+
borderColor: theme.colors.border.brand,
|
|
79
80
|
},
|
|
80
81
|
styles.container,
|
|
81
82
|
viewStyles,
|
|
82
83
|
] },
|
|
83
84
|
!hidePlaybackIcon && (React.createElement(Pressable, { testID: "audio-player-playback-icon", onPress: () => { var _a; return (_a = headlessAudioPlayerRef.current) === null || _a === void 0 ? void 0 : _a.togglePlayback(); }, style: styles.spacingEnd },
|
|
84
|
-
React.createElement(AntDesign, { name: iconName, size: togglePlaybackIconSize, color: togglePlaybackIconColor }))),
|
|
85
|
-
!hideDuration && (React.createElement(Text, { testID: "audio-player-duration", style: [
|
|
86
|
-
{ color: theme.colors.strong },
|
|
87
|
-
styles.spacingEnd,
|
|
88
|
-
{ ...textStyles },
|
|
89
|
-
] },
|
|
85
|
+
React.createElement(AntDesign, { name: iconName, size: togglePlaybackIconSize, color: togglePlaybackIconColor !== null && togglePlaybackIconColor !== void 0 ? togglePlaybackIconColor : theme.colors.branding.primary }))),
|
|
86
|
+
!hideDuration && (React.createElement(Text, { testID: "audio-player-duration", style: [styles.spacingEnd, textStyles] },
|
|
90
87
|
formatDuration(sliderPositionMillis !== null && sliderPositionMillis !== void 0 ? sliderPositionMillis : 0),
|
|
91
88
|
" /",
|
|
92
89
|
" ",
|
|
93
90
|
formatDuration(durationMillis || 0))),
|
|
94
|
-
!hideSlider && (React.createElement(Slider, { testID: "audio-player-slider", style: styles.slider, minimumTrackTintColor: completedTrackColor, maximumTrackTintColor: remainingTrackColor, thumbTintColor: thumbColor, minimumValue: 0, value: sliderPositionMillis, maximumValue: durationMillis, onValueChange: onSliderChange, onSlidingComplete: onSlidingComplete })))));
|
|
91
|
+
!hideSlider && (React.createElement(Slider, { testID: "audio-player-slider", style: styles.slider, minimumTrackTintColor: completedTrackColor !== null && completedTrackColor !== void 0 ? completedTrackColor : theme.colors.branding.primary, maximumTrackTintColor: remainingTrackColor !== null && remainingTrackColor !== void 0 ? remainingTrackColor : theme.colors.border.brand, thumbTintColor: thumbColor !== null && thumbColor !== void 0 ? thumbColor : theme.colors.branding.primary, minimumValue: 0, value: sliderPositionMillis, maximumValue: durationMillis, onValueChange: onSliderChange, onSlidingComplete: onSlidingComplete })))));
|
|
95
92
|
});
|
|
96
93
|
const styles = StyleSheet.create({
|
|
97
94
|
container: {
|
|
@@ -122,5 +119,5 @@ function formatDuration(duration) {
|
|
|
122
119
|
}
|
|
123
120
|
return renderedMinutes + ":" + renderedSeconds;
|
|
124
121
|
}
|
|
125
|
-
export default
|
|
122
|
+
export default AudioPlayerWithInterface;
|
|
126
123
|
//# sourceMappingURL=AudioPlayerWithInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioPlayerWithInterface.js","sourceRoot":"","sources":["AudioPlayerWithInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AudioPlayerWithInterface.js","sourceRoot":"","sources":["AudioPlayerWithInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,MAAM,MAAM,gCAAgC,CAAC;AACpD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAKxD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAGxC;;GAEG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAI/C,CACE,EACE,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GAAG,EAAE,EAC3B,uBAAuB,EACvB,sBAAsB,EAAE,0BAA0B,EAClD,gBAAgB,EAAE,oBAAoB,EACtC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AG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,MAAM,eAAe,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,MAAM,eAAe,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAE/D,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,OAAO,aAAa,GAAG,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;KACtE;IAED,OAAO,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;AACjD,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Text, View, StyleSheet } from "react-native";
|
|
3
3
|
import { AntDesign } from "@expo/vector-icons";
|
|
4
|
-
import {
|
|
4
|
+
import { useTheme } from "@draftbit/theme";
|
|
5
5
|
import Slider from "@react-native-community/slider";
|
|
6
6
|
import HeadlessAudioPlayer from "./HeadlessAudioPlayer";
|
|
7
7
|
import {
|
|
@@ -21,12 +21,11 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
21
21
|
(
|
|
22
22
|
{
|
|
23
23
|
style,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
remainingTrackColor = theme.colors.divider,
|
|
24
|
+
thumbColor,
|
|
25
|
+
completedTrackColor,
|
|
26
|
+
remainingTrackColor,
|
|
28
27
|
togglePlaybackIconSize = 24,
|
|
29
|
-
togglePlaybackIconColor
|
|
28
|
+
togglePlaybackIconColor,
|
|
30
29
|
onPlaybackStatusUpdate: onPlaybackStatusUpdateProp,
|
|
31
30
|
onPlaybackFinish: onPlaybackFinishProp,
|
|
32
31
|
hidePlaybackIcon = false,
|
|
@@ -44,6 +43,7 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
44
43
|
const [isDraggingSlider, setIsDraggingSlider] = React.useState(false);
|
|
45
44
|
const [sliderPositionMillis, setSliderPositionMillis] = React.useState(0);
|
|
46
45
|
const newHeadlessAudioPlayerRef = React.useRef<MediaPlayerRef>(null);
|
|
46
|
+
const theme = useTheme();
|
|
47
47
|
|
|
48
48
|
// Use the provided ref or default to new ref when not provided
|
|
49
49
|
const headlessAudioPlayerRef = ref
|
|
@@ -51,7 +51,7 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
51
51
|
: newHeadlessAudioPlayerRef;
|
|
52
52
|
|
|
53
53
|
const {
|
|
54
|
-
color,
|
|
54
|
+
color = theme.colors.text.strong,
|
|
55
55
|
fontFamily,
|
|
56
56
|
fontWeight,
|
|
57
57
|
fontSize,
|
|
@@ -129,8 +129,8 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
129
129
|
testID="audio-player-interface"
|
|
130
130
|
style={[
|
|
131
131
|
{
|
|
132
|
-
backgroundColor: theme.colors.background,
|
|
133
|
-
borderColor: theme.colors.
|
|
132
|
+
backgroundColor: theme.colors.background.brand,
|
|
133
|
+
borderColor: theme.colors.border.brand,
|
|
134
134
|
},
|
|
135
135
|
styles.container,
|
|
136
136
|
viewStyles,
|
|
@@ -145,18 +145,14 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
145
145
|
<AntDesign
|
|
146
146
|
name={iconName as any}
|
|
147
147
|
size={togglePlaybackIconSize}
|
|
148
|
-
color={togglePlaybackIconColor}
|
|
148
|
+
color={togglePlaybackIconColor ?? theme.colors.branding.primary}
|
|
149
149
|
/>
|
|
150
150
|
</Pressable>
|
|
151
151
|
)}
|
|
152
152
|
{!hideDuration && (
|
|
153
153
|
<Text
|
|
154
154
|
testID="audio-player-duration"
|
|
155
|
-
style={[
|
|
156
|
-
{ color: theme.colors.strong },
|
|
157
|
-
styles.spacingEnd,
|
|
158
|
-
{ ...textStyles },
|
|
159
|
-
]}
|
|
155
|
+
style={[styles.spacingEnd, textStyles]}
|
|
160
156
|
>
|
|
161
157
|
{formatDuration(sliderPositionMillis ?? 0)} /{" "}
|
|
162
158
|
{formatDuration(durationMillis || 0)}
|
|
@@ -166,9 +162,13 @@ const AudioPlayerWithInterface = React.forwardRef<
|
|
|
166
162
|
<Slider
|
|
167
163
|
testID="audio-player-slider"
|
|
168
164
|
style={styles.slider}
|
|
169
|
-
minimumTrackTintColor={
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
minimumTrackTintColor={
|
|
166
|
+
completedTrackColor ?? theme.colors.branding.primary
|
|
167
|
+
}
|
|
168
|
+
maximumTrackTintColor={
|
|
169
|
+
remainingTrackColor ?? theme.colors.border.brand
|
|
170
|
+
}
|
|
171
|
+
thumbTintColor={thumbColor ?? theme.colors.branding.primary}
|
|
172
172
|
minimumValue={0}
|
|
173
173
|
value={sliderPositionMillis}
|
|
174
174
|
maximumValue={durationMillis}
|
|
@@ -216,4 +216,4 @@ function formatDuration(duration: number) {
|
|
|
216
216
|
return renderedMinutes + ":" + renderedSeconds;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
export default
|
|
219
|
+
export default AudioPlayerWithInterface;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Audio, InterruptionModeIOS, InterruptionModeAndroid, } from "expo-av";
|
|
3
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
3
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
5
|
/**
|
|
6
6
|
* Audio Player component without an interface (UI).
|
|
@@ -56,7 +56,8 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
56
56
|
bufferedDurationMillis: 0,
|
|
57
57
|
isError: false,
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
let finalSource = await normalizeBase64Source(source);
|
|
60
|
+
const { sound } = await Audio.Sound.createAsync(finalSource);
|
|
60
61
|
setCurrentSound(sound);
|
|
61
62
|
sound.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
|
|
62
63
|
};
|
|
@@ -66,28 +67,5 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
66
67
|
}, [source]);
|
|
67
68
|
return (React.createElement(MediaPlaybackWrapper, { ref: ref, isPlaying: isPlaying, media: currentSound, onTogglePlayback: onTogglePlayback }));
|
|
68
69
|
});
|
|
69
|
-
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
70
|
-
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
71
|
-
// This creates an issue with being a useEffect dependency
|
|
72
|
-
//
|
|
73
|
-
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
74
|
-
// Follows: https://stackoverflow.com/a/54096391
|
|
75
|
-
function sourceDeepCompareEquals(a, b) {
|
|
76
|
-
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
77
|
-
return a.uri === b.uri;
|
|
78
|
-
}
|
|
79
|
-
return a === b;
|
|
80
|
-
}
|
|
81
|
-
function useSourceDeepCompareMemoize(value) {
|
|
82
|
-
const ref = React.useRef();
|
|
83
|
-
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
84
|
-
ref.current = value;
|
|
85
|
-
}
|
|
86
|
-
return ref.current;
|
|
87
|
-
}
|
|
88
|
-
function useSourceDeepCompareEffect(callback, dependencies) {
|
|
89
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
-
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
91
|
-
}
|
|
92
70
|
export default HeadlessAudioPlayer;
|
|
93
71
|
//# sourceMappingURL=HeadlessAudioPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,
|
|
1
|
+
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAI1C,CACE,EACE,MAAM,EACN,gBAAgB,GAAG,cAAc,EACjC,iBAAiB,GAAG,KAAK,EACzB,oBAAoB,GAAG,KAAK,EAC5B,0BAA0B,GAAG,KAAK,EAClC,sBAAsB,EAAE,0BAA0B,EAClD,gBAAgB,GACjB,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAe,CAAC;IACtE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QACnD,IAAI;YACF,MAAM,KAAK,CAAC,iBAAiB,CAAC;gBAC5B,uBAAuB,EAAE,iBAAiB;gBAC1C,mBAAmB,EACjB,gBAAgB,KAAK,cAAc;oBACjC,CAAC,CAAC,mBAAmB,CAAC,UAAU;oBAChC,CAAC,CAAC,mBAAmB,CAAC,QAAQ;gBAClC,uBAAuB,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CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC7D,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,KAAK,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,0BAA0B,CAAC,GAAG,EAAE;QAC9B,SAAS,EAAE,CAAC;QAEZ,iCAAiC;IACnC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACL,oBAAC,oBAAoB,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
InterruptionModeAndroid,
|
|
7
7
|
} from "expo-av";
|
|
8
8
|
import { HeadlessAudioPlayerProps } from "./AudioPlayerCommon";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
mapToMediaPlayerStatus,
|
|
11
|
+
normalizeBase64Source,
|
|
12
|
+
useSourceDeepCompareEffect,
|
|
13
|
+
} from "../MediaPlayerCommon";
|
|
10
14
|
import type { MediaPlayerRef } from "../MediaPlayerCommon";
|
|
11
15
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
12
16
|
|
|
@@ -89,7 +93,9 @@ const HeadlessAudioPlayer = React.forwardRef<
|
|
|
89
93
|
isError: false,
|
|
90
94
|
});
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
let finalSource = await normalizeBase64Source(source);
|
|
97
|
+
|
|
98
|
+
const { sound } = await Audio.Sound.createAsync(finalSource);
|
|
93
99
|
setCurrentSound(sound);
|
|
94
100
|
sound.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
|
|
95
101
|
};
|
|
@@ -111,33 +117,4 @@ const HeadlessAudioPlayer = React.forwardRef<
|
|
|
111
117
|
}
|
|
112
118
|
);
|
|
113
119
|
|
|
114
|
-
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
115
|
-
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
116
|
-
// This creates an issue with being a useEffect dependency
|
|
117
|
-
//
|
|
118
|
-
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
119
|
-
// Follows: https://stackoverflow.com/a/54096391
|
|
120
|
-
function sourceDeepCompareEquals(a: any, b: any) {
|
|
121
|
-
if (a?.uri && b?.uri) {
|
|
122
|
-
return a.uri === b.uri;
|
|
123
|
-
}
|
|
124
|
-
return a === b;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function useSourceDeepCompareMemoize(value: any) {
|
|
128
|
-
const ref = React.useRef();
|
|
129
|
-
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
130
|
-
ref.current = value;
|
|
131
|
-
}
|
|
132
|
-
return ref.current;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function useSourceDeepCompareEffect(
|
|
136
|
-
callback: React.EffectCallback,
|
|
137
|
-
dependencies: React.DependencyList
|
|
138
|
-
) {
|
|
139
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
140
|
-
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
120
|
export default HeadlessAudioPlayer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../../../theming";
|
|
3
2
|
import HeadlessAudioPlayer from "./HeadlessAudioPlayer";
|
|
4
3
|
import AudioPlayerWithInterface from "./AudioPlayerWithInterface";
|
|
5
4
|
const AudioPlayer = React.forwardRef(({ mode = "interface", ...rest }, ref) => {
|
|
@@ -7,9 +6,8 @@ const AudioPlayer = React.forwardRef(({ mode = "interface", ...rest }, ref) => {
|
|
|
7
6
|
case "headless":
|
|
8
7
|
return React.createElement(HeadlessAudioPlayer, { ref: ref, ...rest });
|
|
9
8
|
case "interface":
|
|
10
|
-
//@ts-ignore Typescript unable to handle nested passing of theme
|
|
11
9
|
return React.createElement(AudioPlayerWithInterface, { ref: ref, ...rest });
|
|
12
10
|
}
|
|
13
11
|
});
|
|
14
|
-
export default
|
|
12
|
+
export default AudioPlayer;
|
|
15
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAOlE,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACzC,QAAQ,IAAI,EAAE;QACZ,KAAK,UAAU;YACb,OAAO,oBAAC,mBAAmB,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;QACrD,KAAK,WAAW;YACd,OAAO,oBAAC,wBAAwB,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;KAC3D;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../../../theming";
|
|
3
2
|
import {
|
|
4
3
|
AudioPlayerInterfaceProps,
|
|
5
4
|
HeadlessAudioPlayerProps,
|
|
@@ -20,11 +19,10 @@ const AudioPlayer = React.forwardRef<
|
|
|
20
19
|
case "headless":
|
|
21
20
|
return <HeadlessAudioPlayer ref={ref} {...rest} />;
|
|
22
21
|
case "interface":
|
|
23
|
-
//@ts-ignore Typescript unable to handle nested passing of theme
|
|
24
22
|
return <AudioPlayerWithInterface ref={ref} {...rest} />;
|
|
25
23
|
}
|
|
26
24
|
});
|
|
27
25
|
|
|
28
|
-
export default
|
|
26
|
+
export default AudioPlayer;
|
|
29
27
|
|
|
30
28
|
export type { MediaPlayerRef as AudioPlayerRef } from "../MediaPlayerCommon";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as FileSystem from "expo-file-system";
|
|
2
|
+
import { v4 as uuid } from "uuid";
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
import React from "react";
|
|
1
5
|
export function mapToMediaPlayerStatus(status) {
|
|
2
6
|
if (status.isLoaded) {
|
|
3
7
|
return {
|
|
@@ -21,4 +25,43 @@ export function mapToMediaPlayerStatus(status) {
|
|
|
21
25
|
error: status.error,
|
|
22
26
|
};
|
|
23
27
|
}
|
|
28
|
+
// https://stackoverflow.com/a/7874175/8805150
|
|
29
|
+
const BASE_64_REGEX = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
30
|
+
/**
|
|
31
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
32
|
+
*/
|
|
33
|
+
export async function normalizeBase64Source(source) {
|
|
34
|
+
const uri = source === null || source === void 0 ? void 0 : source.uri;
|
|
35
|
+
if (Platform.OS === "ios" && uri && uri.match(BASE_64_REGEX)) {
|
|
36
|
+
const fileName = `${FileSystem.cacheDirectory}${uuid()}`;
|
|
37
|
+
await FileSystem.writeAsStringAsync(fileName, uri, {
|
|
38
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
39
|
+
});
|
|
40
|
+
return { uri: fileName };
|
|
41
|
+
}
|
|
42
|
+
return source;
|
|
43
|
+
}
|
|
44
|
+
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
45
|
+
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
46
|
+
// This creates an issue with being a useEffect dependency
|
|
47
|
+
//
|
|
48
|
+
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
49
|
+
// Follows: https://stackoverflow.com/a/54096391
|
|
50
|
+
function sourceDeepCompareEquals(a, b) {
|
|
51
|
+
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
52
|
+
return a.uri === b.uri;
|
|
53
|
+
}
|
|
54
|
+
return a === b;
|
|
55
|
+
}
|
|
56
|
+
function useSourceDeepCompareMemoize(value) {
|
|
57
|
+
const ref = React.useRef();
|
|
58
|
+
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
59
|
+
ref.current = value;
|
|
60
|
+
}
|
|
61
|
+
return ref.current;
|
|
62
|
+
}
|
|
63
|
+
export function useSourceDeepCompareEffect(callback, dependencies) {
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
66
|
+
}
|
|
24
67
|
//# sourceMappingURL=MediaPlayerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["MediaPlayerCommon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["MediaPlayerCommon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,MAAM,UAAU,sBAAsB,CACpC,MAAwB;IAExB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE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aAAD,CAAC,uBAAD,CAAC,CAAE,GAAG,MAAI,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,GAAG,CAAA,EAAE;QACpB,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;KACxB;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAU;IAC7C,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QAChD,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACrB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,QAA8B,EAC9B,YAAkC;IAElC,uDAAuD;IACvD,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { AVPlaybackSource, AVPlaybackStatus } from "expo-av";
|
|
2
|
+
import * as FileSystem from "expo-file-system";
|
|
3
|
+
import { v4 as uuid } from "uuid";
|
|
4
|
+
import { Platform } from "react-native";
|
|
5
|
+
import React from "react";
|
|
2
6
|
|
|
3
7
|
export interface MediaPlayerStatus {
|
|
4
8
|
isPlaying: boolean;
|
|
@@ -50,3 +54,55 @@ export function mapToMediaPlayerStatus(
|
|
|
50
54
|
error: status.error,
|
|
51
55
|
};
|
|
52
56
|
}
|
|
57
|
+
|
|
58
|
+
// https://stackoverflow.com/a/7874175/8805150
|
|
59
|
+
const BASE_64_REGEX =
|
|
60
|
+
/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
64
|
+
*/
|
|
65
|
+
export async function normalizeBase64Source(
|
|
66
|
+
source: AVPlaybackSource
|
|
67
|
+
): Promise<AVPlaybackSource> {
|
|
68
|
+
const uri: string | undefined = (source as any)?.uri;
|
|
69
|
+
|
|
70
|
+
if (Platform.OS === "ios" && uri && uri.match(BASE_64_REGEX)) {
|
|
71
|
+
const fileName = `${FileSystem.cacheDirectory}${uuid()}`;
|
|
72
|
+
await FileSystem.writeAsStringAsync(fileName, uri, {
|
|
73
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
74
|
+
});
|
|
75
|
+
return { uri: fileName };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return source;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
82
|
+
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
83
|
+
// This creates an issue with being a useEffect dependency
|
|
84
|
+
//
|
|
85
|
+
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
86
|
+
// Follows: https://stackoverflow.com/a/54096391
|
|
87
|
+
function sourceDeepCompareEquals(a: any, b: any) {
|
|
88
|
+
if (a?.uri && b?.uri) {
|
|
89
|
+
return a.uri === b.uri;
|
|
90
|
+
}
|
|
91
|
+
return a === b;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function useSourceDeepCompareMemoize(value: any) {
|
|
95
|
+
const ref = React.useRef();
|
|
96
|
+
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
97
|
+
ref.current = value;
|
|
98
|
+
}
|
|
99
|
+
return ref.current;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function useSourceDeepCompareEffect(
|
|
103
|
+
callback: React.EffectCallback,
|
|
104
|
+
dependencies: React.DependencyList
|
|
105
|
+
) {
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
+
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
108
|
+
}
|
|
@@ -2,11 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { Video as VideoPlayerComponent, ResizeMode as ExpoResizeMode, VideoFullscreenUpdate, } from "expo-av";
|
|
3
3
|
import { extractSizeStyles } from "../../../utilities";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
6
|
-
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, ...rest }, ref) => {
|
|
5
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
6
|
+
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, source, ...rest }, ref) => {
|
|
7
7
|
const [videoMediaObject, setVideoMediaObject] = React.useState();
|
|
8
8
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
9
9
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
10
|
+
const [currentSource, setCurrentSource] = React.useState();
|
|
10
11
|
const mediaPlaybackWrapperRef = React.useRef(null);
|
|
11
12
|
const sizeStyles = extractSizeStyles(style);
|
|
12
13
|
let mappedResizeMode;
|
|
@@ -64,12 +65,19 @@ const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterRes
|
|
|
64
65
|
// Include 'isPlaying' as dependency because 'togglePlayback' changes when it changes
|
|
65
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
67
|
[toggleFullscreen, isPlaying]);
|
|
68
|
+
useSourceDeepCompareEffect(() => {
|
|
69
|
+
const updateSource = async () => {
|
|
70
|
+
const finalSource = await normalizeBase64Source(source);
|
|
71
|
+
setCurrentSource(finalSource);
|
|
72
|
+
};
|
|
73
|
+
updateSource();
|
|
74
|
+
}, [source]);
|
|
67
75
|
return (React.createElement(MediaPlaybackWrapper, { media: videoMediaObject, isPlaying: isPlaying, ref: mediaPlaybackWrapperRef },
|
|
68
76
|
React.createElement(VideoPlayerComponent
|
|
69
77
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
70
78
|
, {
|
|
71
79
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
72
|
-
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), ...rest })));
|
|
80
|
+
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), source: currentSource, ...rest })));
|
|
73
81
|
});
|
|
74
82
|
export default VideoPlayer;
|
|
75
83
|
//# sourceMappingURL=VideoPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayer.js","sourceRoot":"","sources":["VideoPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,IAAI,oBAAoB,EAE7B,UAAU,IAAI,cAAc,EAE5B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"VideoPlayer.js","sourceRoot":"","sources":["VideoPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,IAAI,oBAAoB,EAE7B,UAAU,IAAI,cAAc,EAE5B,qBAAqB,GAEtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EA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