@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,17 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DateFnsUtils from "@date-io/date-fns";
|
|
3
3
|
import { MuiPickersUtilsProvider, DatePicker, TimePicker, DateTimePicker, } from "@material-ui/pickers";
|
|
4
|
-
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
|
|
5
|
-
import { withTheme } from "
|
|
6
|
-
import Theme from "../../styles/DefaultTheme";
|
|
4
|
+
import { createMuiTheme, ThemeProvider as MuiThemeProvider, } from "@material-ui/core/styles";
|
|
5
|
+
import { withTheme, DefaultTheme } from "@draftbit/theme";
|
|
7
6
|
const DatePickerComponent = ({ value, onChange, mode, toggleVisibility, isVisible, minimumDate, maximumDate, theme, }) => {
|
|
7
|
+
var _a, _b;
|
|
8
8
|
const internalTheme = createMuiTheme({
|
|
9
9
|
palette: {
|
|
10
10
|
primary: {
|
|
11
|
-
main: theme.colors.primary ||
|
|
11
|
+
main: theme.colors.branding.primary ||
|
|
12
|
+
((_a = DefaultTheme.colors.branding) === null || _a === void 0 ? void 0 : _a.primary),
|
|
12
13
|
},
|
|
13
14
|
secondary: {
|
|
14
|
-
main: theme.colors.secondary ||
|
|
15
|
+
main: theme.colors.branding.secondary ||
|
|
16
|
+
((_b = DefaultTheme.colors.branding) === null || _b === void 0 ? void 0 : _b.secondary),
|
|
15
17
|
},
|
|
16
18
|
},
|
|
17
19
|
});
|
|
@@ -21,7 +23,7 @@ const DatePickerComponent = ({ value, onChange, mode, toggleVisibility, isVisibl
|
|
|
21
23
|
? TimePicker
|
|
22
24
|
: DateTimePicker;
|
|
23
25
|
return (React.createElement(MuiPickersUtilsProvider, { utils: DateFnsUtils },
|
|
24
|
-
React.createElement(
|
|
26
|
+
React.createElement(MuiThemeProvider, { theme: internalTheme },
|
|
25
27
|
React.createElement(Picker, { value: value, open: isVisible, onChange: (d) => {
|
|
26
28
|
toggleVisibility();
|
|
27
29
|
onChange(null, d);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerComponent.web.js","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePickerComponent.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"DatePickerComponent.web.js","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePickerComponent.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,aAAa,IAAI,gBAAgB,GAClC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,mBAAmB,GAA2C,CAAC,EACnE,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,WAAW,EACX,KAAK,GACN,EAAE,EAAE;;IACH,MAAM,aAAa,GAAG,cAAc,CAAC;QACnC,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EACF,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;qBAC7B,MAAA,YAAY,CAAC,MAAM,CAAC,QAAQ,0CAAE,OAAO,CAAA;aACxC;YACD,SAAS,EAAE;gBACT,IAAI,EACF,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;qBAC/B,MAAA,YAAY,CAAC,MAAM,CAAC,QAAQ,0CAAE,SAAS,CAAA;aAC1C;SACF;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GACV,IAAI,KAAK,MAAM;QACb,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,IAAI,KAAK,MAAM;YACjB,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,cAAc,CAAC;IAErB,OAAO,CACL,oBAAC,uBAAuB,IAAC,KAAK,EAAE,YAAY;QAC1C,oBAAC,gBAAgB,IAAC,KAAK,EAAE,aAAa;YACpC,oBAAC,MAAM,IACL,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACd,gBAAgB,EAAE,CAAC;oBACnB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBACpB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,EACjC,OAAO,EAAC,QAAQ,EAChB,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI,EAC9B,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,GACpB,CACe,CACK,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
2
2
|
export interface DatePickerComponentProps {
|
|
3
3
|
value: Date;
|
|
4
4
|
onChange: (e: any, data?: any) => void;
|
|
@@ -7,5 +7,5 @@ export interface DatePickerComponentProps {
|
|
|
7
7
|
isVisible?: boolean;
|
|
8
8
|
minimumDate?: Date;
|
|
9
9
|
maximumDate?: Date;
|
|
10
|
-
theme?:
|
|
10
|
+
theme?: ReadTheme;
|
|
11
11
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
4
4
|
export interface DeckSwiperCardProps {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
theme:
|
|
6
|
+
theme: ReadTheme;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.ComponentType<
|
|
9
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
10
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<DeckSwiperCardProps>> & React.FC<React.PropsWithChildren<DeckSwiperCardProps>>, {}>;
|
|
8
|
+
declare const _default: React.ComponentType<Omit<React.PropsWithChildren<DeckSwiperCardProps>, "theme">>;
|
|
11
9
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "@draftbit/theme";
|
|
4
4
|
const DeckSwiperCard = ({ style, children, theme }) => (React.createElement(View, { style: [
|
|
5
5
|
styles.card,
|
|
6
6
|
{
|
|
7
|
-
backgroundColor: theme.colors.background,
|
|
8
|
-
borderColor: theme.colors.
|
|
7
|
+
backgroundColor: theme.colors.background.brand,
|
|
8
|
+
borderColor: theme.colors.border.brand,
|
|
9
9
|
},
|
|
10
10
|
style,
|
|
11
11
|
] }, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiperCard.js","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DeckSwiperCard.js","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,MAAM,cAAc,GAEhB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAClC,oBAAC,IAAI,IACH,KAAK,EAAE;QACL,MAAM,CAAC,IAAI;QACX;YACE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK;YAC9C,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK;SACvC;QACD,KAAK;KACN,IAEA,QAAQ,CACJ,CACR,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import
|
|
3
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
color?: string;
|
|
7
|
-
theme:
|
|
7
|
+
theme: ReadTheme;
|
|
8
8
|
};
|
|
9
|
-
declare const _default: React.ComponentType<
|
|
10
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
11
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
9
|
+
declare const _default: React.ComponentType<Omit<React.PropsWithChildren<Props>, "theme">>;
|
|
12
10
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "@draftbit/theme";
|
|
4
4
|
const Divider = ({ style, color, theme: { colors }, ...rest }) => {
|
|
5
5
|
return (React.createElement(View, { style: [
|
|
6
6
|
{
|
|
7
|
-
backgroundColor: color || colors.
|
|
7
|
+
backgroundColor: color || colors.border.brand,
|
|
8
8
|
height: StyleSheet.hairlineWidth,
|
|
9
9
|
},
|
|
10
10
|
style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../src/components/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../src/components/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,GAA6C,CAAC,EACzD,KAAK,EACL,KAAK,EACL,KAAK,EAAE,EAAE,MAAM,EAAE,EACjB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,IAAI,IACH,KAAK,EAAE;YACL;gBACE,eAAe,EAAE,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK;gBAC7C,MAAM,EAAE,UAAU,CAAC,aAAa;aACjC;YACD,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
theme:
|
|
6
|
+
theme: ReadTheme;
|
|
7
7
|
} & ViewProps;
|
|
8
|
-
declare const _default: React.ComponentType<
|
|
9
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
10
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
8
|
+
declare const _default: React.ComponentType<Omit<React.PropsWithChildren<Props>, "theme">>;
|
|
11
9
|
export default _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Animated, StyleSheet, View, } from "react-native";
|
|
3
|
-
import
|
|
4
|
-
import { withTheme } from "../theming";
|
|
3
|
+
import { withTheme } from "@draftbit/theme";
|
|
5
4
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
6
5
|
const Elevation = ({ style, theme, children, ...rest }) => {
|
|
7
6
|
const { elevation = 4, borderRadius: radius } = StyleSheet.flatten(style) || {};
|
|
@@ -10,9 +9,9 @@ const Elevation = ({ style, theme, children, ...rest }) => {
|
|
|
10
9
|
return (React.createElement(Animated.View, { ...rest, style: [
|
|
11
10
|
{
|
|
12
11
|
borderRadius,
|
|
13
|
-
backgroundColor: colors.
|
|
12
|
+
backgroundColor: colors.background.brand,
|
|
14
13
|
},
|
|
15
|
-
elevation ?
|
|
14
|
+
elevation ? { elevation } : null,
|
|
16
15
|
style,
|
|
17
16
|
] },
|
|
18
17
|
React.createElement(View, { style: { overflow: "hidden", borderRadius } }, children)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Elevation.js","sourceRoot":"","sources":["../../../../src/components/Elevation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,UAAU,EAIV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"Elevation.js","sourceRoot":"","sources":["../../../../src/components/Elevation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,UAAU,EAIV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,mHAAmH;AACnH,MAAM,SAAS,GAA6C,CAAC,EAC3D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,EAAE,SAAS,GAAG,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,GAC3C,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,YAAY,GAAG,MAAM,CAAC;IAE5B,OAAO,CACL,oBAAC,QAAQ,CAAC,IAAI,OACR,IAAI,EACR,KAAK,EAAE;YACL;gBACE,YAAY;gBACZ,eAAe,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;aACzC;YACD,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI;YAChC,KAAK;SACN;QAED,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAG,QAAQ,CAAQ,CACtD,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { RowDirection } from "@draftbit/types";
|
|
4
3
|
declare type Props = {
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
label: string;
|
|
7
|
-
direction:
|
|
6
|
+
direction: "row" | "column";
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
style?: StyleProp<ViewStyle>;
|
|
10
9
|
onPress: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRow.js","sourceRoot":"","sources":["../../../../src/components/FormRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FormRow.js","sourceRoot":"","sources":["../../../../src/components/FormRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,SAAS,MAAM,aAAa,CAAC;AAWpC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,OAAO,EACP,GAAG,IAAI,EACD;IACN,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,KACzD,IAAI;QAER,oBAAC,IAAI,IAAC,KAAK,EAAE,UAAU,IAAG,KAAK,CAAQ;QACtC,QAAQ,CACC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, PressableProps } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ReadTheme } from "@draftbit/theme";
|
|
4
4
|
import type { IconSlot } from "../interfaces/Icon";
|
|
5
5
|
declare type Props = {
|
|
6
6
|
icon?: string;
|
|
@@ -9,12 +9,10 @@ declare type Props = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
onPress: () => void;
|
|
12
|
-
theme:
|
|
12
|
+
theme: ReadTheme;
|
|
13
13
|
style?: StyleProp<ViewStyle>;
|
|
14
14
|
activeOpacity?: number;
|
|
15
15
|
disabledOpacity?: number;
|
|
16
16
|
} & PressableProps & IconSlot;
|
|
17
|
-
declare const _default: React.ComponentType<
|
|
18
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
19
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
17
|
+
declare const _default: React.ComponentType<Omit<React.PropsWithChildren<Props>, "theme">>;
|
|
20
18
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, ActivityIndicator, Pressable, Platform, } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "@draftbit/theme";
|
|
4
4
|
const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled, loading = false, onPress, theme, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) => {
|
|
5
|
-
const iconColor = customColor || theme.colors.primary;
|
|
5
|
+
const iconColor = customColor || theme.colors.branding.primary;
|
|
6
6
|
return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
|
|
7
7
|
return [
|
|
8
8
|
styles.container,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../src/components/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":["../../../../src/components/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"}
|
|
@@ -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
|
export declare type AudioInterruptionMode = "lower volume" | "stop";
|
|
5
4
|
export interface HeadlessAudioPlayerProps extends MediaPlayerProps {
|
|
@@ -18,5 +17,4 @@ export interface AudioPlayerInterfaceProps {
|
|
|
18
17
|
hidePlaybackIcon?: boolean;
|
|
19
18
|
hideDuration?: boolean;
|
|
20
19
|
hideSlider?: boolean;
|
|
21
|
-
theme: Theme;
|
|
22
20
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { AudioPlayerInterfaceProps, HeadlessAudioPlayerProps } from "./AudioPlayerCommon";
|
|
3
3
|
import type { MediaPlayerRef } from "../MediaPlayerCommon";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Built on top of HeadlessAudioPlayer to provide a simple interface for playing audio
|
|
6
|
+
*/
|
|
7
|
+
declare const AudioPlayerWithInterface: React.ForwardRefExoticComponent<AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>>;
|
|
8
|
+
export default AudioPlayerWithInterface;
|
|
@@ -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
|
package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioPlayerWithInterface.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/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":["../../../../../../src/components/MediaPlayer/AudioPlayer/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,EAC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7D,MAAM,aAAa,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,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,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":["../../../../../../src/components/MediaPlayer/AudioPlayer/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":["../../../../../../src/components/MediaPlayer/AudioPlayer/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,EACrB,gBAAgB,KAAK,cAAc;oBACjC,CAAC,CAAC,uBAAuB,CAAC,UAAU;oBACpC,CAAC,CAAC,uBAAuB,CAAC,QAAQ;gBACtC,oBAAoB;gBAC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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"}
|
|
@@ -4,8 +4,6 @@ import type { MediaPlayerRef } from "../MediaPlayerCommon";
|
|
|
4
4
|
interface AudioPlayerProps {
|
|
5
5
|
mode?: "interface" | "headless";
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>> & React.ForwardRefExoticComponent<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>>, {}>;
|
|
10
|
-
export default _default;
|
|
7
|
+
declare const AudioPlayer: React.ForwardRefExoticComponent<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>>;
|
|
8
|
+
export default AudioPlayer;
|
|
11
9
|
export type { MediaPlayerRef as AudioPlayerRef } from "../MediaPlayerCommon";
|
|
@@ -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":["../../../../../../src/components/MediaPlayer/AudioPlayer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/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,4 +1,5 @@
|
|
|
1
1
|
import { AVPlaybackSource, AVPlaybackStatus } from "expo-av";
|
|
2
|
+
import React from "react";
|
|
2
3
|
export interface MediaPlayerStatus {
|
|
3
4
|
isPlaying: boolean;
|
|
4
5
|
isLoading: boolean;
|
|
@@ -21,3 +22,8 @@ export interface MediaPlayerProps {
|
|
|
21
22
|
source: AVPlaybackSource;
|
|
22
23
|
}
|
|
23
24
|
export declare function mapToMediaPlayerStatus(status: AVPlaybackStatus): MediaPlayerStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeBase64Source(source: AVPlaybackSource): Promise<AVPlaybackSource>;
|
|
29
|
+
export declare function useSourceDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList): void;
|
|
@@ -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":["../../../../../src/components/MediaPlayer/MediaPlayerCommon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["../../../../../src/components/MediaPlayer/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,Q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,EAAE,CAAC;KAC1B;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4EAA4E;AAC5E,2IAA2I;AAC3I,0DAA0D;AAC1D,EAAE;AACF,kHAAkH;AAClH,gDAAgD;AAChD,SAAS,uBAAuB,CAAC,CAAM,EAAE,CAAM;IAC7C,IAAI,CAAA,CAAC,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"}
|
|
@@ -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
|