@draftbit/core 50.1.1-1cea51.2 → 50.1.1-eb22bb.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.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/PickerCommon.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +1 -0
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/typescript/src/components/Button.js +4 -3
- package/lib/typescript/src/components/Button.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/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/PickerCommon.d.ts +4 -1
- package/lib/typescript/src/components/Picker/PickerCommon.js +11 -0
- package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
- package/lib/typescript/src/components/Picker/{modal/ModalPicker.d.ts → dropdown/DropDownModalPicker.d.ts} +3 -3
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +3 -9
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/index.d.ts +3 -3
- package/lib/typescript/src/components/Picker/index.js +4 -4
- package/lib/typescript/src/components/Picker/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/components/Button.js +4 -3
- package/src/components/Button.js.map +1 -1
- package/src/components/Button.tsx +14 -2
- 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/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/PickerCommon.js +11 -0
- package/src/components/Picker/PickerCommon.js.map +1 -1
- package/src/components/Picker/PickerCommon.ts +19 -1
- package/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.tsx +155 -0
- package/src/components/Picker/dropdown/DropDownPicker.js +3 -9
- package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownPicker.tsx +3 -16
- package/src/components/Picker/index.js +4 -4
- package/src/components/Picker/index.js.map +1 -1
- package/src/components/Picker/index.tsx +7 -7
- package/lib/commonjs/components/Picker/modal/ModalPicker.js +0 -1
- package/lib/typescript/src/components/Picker/modal/ModalPicker.js +0 -88
- package/lib/typescript/src/components/Picker/modal/ModalPicker.js.map +0 -1
- package/src/components/Picker/modal/ModalPicker.js +0 -88
- package/src/components/Picker/modal/ModalPicker.js.map +0 -1
- package/src/components/Picker/modal/ModalPicker.tsx +0 -179
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "50.1.1-
|
|
3
|
+
"version": "50.1.1-eb22bb.2+eb22bbc",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^50.1.1-
|
|
44
|
+
"@draftbit/types": "^50.1.1-eb22bb.2+eb22bbc",
|
|
45
45
|
"@expo/vector-icons": "^14.0.0",
|
|
46
46
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
47
47
|
"@material-ui/core": "^4.11.0",
|
|
@@ -74,7 +74,8 @@
|
|
|
74
74
|
"react-native-typography": "^1.4.1",
|
|
75
75
|
"react-native-web-swiper": "^2.2.3",
|
|
76
76
|
"react-native-youtube-iframe": "^2.2.2",
|
|
77
|
-
"react-youtube": "^10.1.0"
|
|
77
|
+
"react-youtube": "^10.1.0",
|
|
78
|
+
"uuid": "^9.0.1"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
80
81
|
"react-native-avoid-softinput": "^4.0.1"
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
"@types/lodash.isnumber": "^3.0.6",
|
|
93
94
|
"@types/lodash.omit": "^4.5.6",
|
|
94
95
|
"@types/lodash.tonumber": "^4.0.6",
|
|
96
|
+
"@types/uuid": "^9.0.8",
|
|
95
97
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
96
98
|
"react-native-avoid-softinput": "^4.0.1"
|
|
97
99
|
},
|
|
@@ -115,5 +117,5 @@
|
|
|
115
117
|
],
|
|
116
118
|
"testEnvironment": "node"
|
|
117
119
|
},
|
|
118
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "eb22bbcc0d7a89a1f39508d33c222b229764cc20"
|
|
119
121
|
}
|
package/src/components/Button.js
CHANGED
|
@@ -7,7 +7,7 @@ const CONSTANTS = {
|
|
|
7
7
|
padding: 8,
|
|
8
8
|
icon: 24,
|
|
9
9
|
};
|
|
10
|
-
function Base({ Icon, icon, title, loading, disabled, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) {
|
|
10
|
+
function Base({ Icon, icon, iconPosition = "left", iconSize = CONSTANTS.icon, title, loading, disabled, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) {
|
|
11
11
|
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...buttonStyles } = StyleSheet.flatten(style || {});
|
|
12
12
|
const titleStyles = {
|
|
13
13
|
color,
|
|
@@ -38,8 +38,9 @@ function Base({ Icon, icon, title, loading, disabled, style, activeOpacity = 0.8
|
|
|
38
38
|
];
|
|
39
39
|
}, ...props },
|
|
40
40
|
loading ? (React.createElement(ActivityIndicator, { size: "small", color: color, style: styles.loading })) : null,
|
|
41
|
-
icon && !loading ? (React.createElement(Icon, { name: icon, color: color, style: styles.icon, size:
|
|
42
|
-
React.createElement(Text, { style: titleStyles }, title)
|
|
41
|
+
iconPosition === "left" && icon && !loading ? (React.createElement(Icon, { name: icon, color: color, style: styles.icon, size: iconSize })) : null,
|
|
42
|
+
React.createElement(Text, { style: titleStyles }, title),
|
|
43
|
+
iconPosition === "right" && icon && !loading ? (React.createElement(Icon, { name: icon, color: color, style: styles.icon, size: iconSize })) : null));
|
|
43
44
|
}
|
|
44
45
|
const Solid = ({ style, theme, ...props }) => {
|
|
45
46
|
return (React.createElement(Base, { style: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,SAAS,EAET,QAAQ,EACR,UAAU,EAEV,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,MAAM,SAAS,GAAG;IAChB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;CACT,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,SAAS,EAET,QAAQ,EACR,UAAU,EAEV,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,MAAM,SAAS,GAAG;IAChB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;CACT,CAAC;AAmCF,SAAS,IAAI,CAAC,EACZ,IAAI,EACJ,IAAI,EACJ,YAAY,GAAG,MAAM,EACrB,QAAQ,GAAG,SAAS,CAAC,IAAI,EACzB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,KAAK,EACL,aAAa,GAAG,GAAG,EACnB,eAAe,GAAG,GAAG,EACrB,GAAG,KAAK,EACE;IACV,MAAM,EACJ,KAAK,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,GAAG,YAAY,EAChB,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,IAAK,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B,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,SAAS,CAAC,UAAU;QAC/B,iBAAiB,EAAE,EAAE;QACrB,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,KAAK;QACjB,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;IACD,OAAO,EAAE;QACP,eAAe,EAAE,aAAa;QAC9B,WAAW,EAAE,CAAC;KACf;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,aAAa;QAC9B,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,SAAS;KACrB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,CAAC;KACf;IACD,IAAI,EAAE;QACJ,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,SAAS,EAAE,CAAC;gBACZ,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,QAAQ;aACpB;YACD,OAAO,EAAE;gBACP,YAAY,EAAE,CAAC;gBACf,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,QAAQ;aACpB;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
|
|
@@ -33,6 +33,8 @@ type BaseProps = {
|
|
|
33
33
|
delayLongPress?: number;
|
|
34
34
|
hitSlop?: number;
|
|
35
35
|
icon?: string;
|
|
36
|
+
iconSize?: number;
|
|
37
|
+
iconPosition?: "left" | "right";
|
|
36
38
|
} & PressableProps &
|
|
37
39
|
IconSlot;
|
|
38
40
|
|
|
@@ -55,6 +57,8 @@ type Props = {
|
|
|
55
57
|
function Base({
|
|
56
58
|
Icon,
|
|
57
59
|
icon,
|
|
60
|
+
iconPosition = "left",
|
|
61
|
+
iconSize = CONSTANTS.icon,
|
|
58
62
|
title,
|
|
59
63
|
loading,
|
|
60
64
|
disabled,
|
|
@@ -117,15 +121,23 @@ function Base({
|
|
|
117
121
|
{loading ? (
|
|
118
122
|
<ActivityIndicator size="small" color={color} style={styles.loading} />
|
|
119
123
|
) : null}
|
|
120
|
-
{icon && !loading ? (
|
|
124
|
+
{iconPosition === "left" && icon && !loading ? (
|
|
121
125
|
<Icon
|
|
122
126
|
name={icon}
|
|
123
127
|
color={color as string}
|
|
124
128
|
style={styles.icon}
|
|
125
|
-
size={
|
|
129
|
+
size={iconSize}
|
|
126
130
|
/>
|
|
127
131
|
) : null}
|
|
128
132
|
<Text style={titleStyles}>{title}</Text>
|
|
133
|
+
{iconPosition === "right" && icon && !loading ? (
|
|
134
|
+
<Icon
|
|
135
|
+
name={icon}
|
|
136
|
+
color={color as string}
|
|
137
|
+
style={styles.icon}
|
|
138
|
+
size={iconSize}
|
|
139
|
+
/>
|
|
140
|
+
) : null}
|
|
129
141
|
</Pressable>
|
|
130
142
|
);
|
|
131
143
|
}
|
|
@@ -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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C,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,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,KAAK;YAChB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,qBAAqB,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC;YACjD,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC;YAC1C,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,CAAC;YAC1D,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IAED,OAAO;QACL,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,qBAAqB,EAAE,CAAC;QACxB,cAAc,EAAE,CAAC;QACjB,sBAAsB,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;AACJ,CAAC;AAED,8CAA8C;AAC9C,MAAM,aAAa,GACjB,kEAAkE,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAwB;IAExB,MAAM,GAAG,GAAwB,MAAc,aAAd,MAAM,uBAAN,MAAM,CAAU,GAAG,CAAC;IAErD,IAAI,QAAQ,CAAC,EAAE,KAAK,KA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} 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,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAkB9B,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,gBAAgB,GAAG,OAAO,EAC1B,sBAAsB,EAAE,0BAA0B,EAClD,gBAAgB,EAChB,MAAM,EACN,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAC3C,KAAK,CAAC,QAAQ,EAA+B,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,KAAK,CAAC,QAAQ,EAAoB,C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/C,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,uBAAuB;QAE5B,oBAAC,oBAAoB;QACnB,iGAAiG;;YAAjG,iGAAiG;YACjG,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAClD,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,EAC3D,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB,CAAC,EACjE,MAAM,EAAE,aAAa,KACjB,IAAI,GACR,CACmB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -6,11 +6,16 @@ import {
|
|
|
6
6
|
ResizeMode as ExpoResizeMode,
|
|
7
7
|
AVPlaybackStatus,
|
|
8
8
|
VideoFullscreenUpdate,
|
|
9
|
+
AVPlaybackSource,
|
|
9
10
|
} from "expo-av";
|
|
10
11
|
import { extractSizeStyles } from "../../../utilities";
|
|
11
12
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
12
13
|
import type { Playback } from "expo-av/src/AV";
|
|
13
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
mapToMediaPlayerStatus,
|
|
16
|
+
normalizeBase64Source,
|
|
17
|
+
useSourceDeepCompareEffect,
|
|
18
|
+
} from "../MediaPlayerCommon";
|
|
14
19
|
import type { MediaPlayerRef, MediaPlayerProps } from "../MediaPlayerCommon";
|
|
15
20
|
|
|
16
21
|
type ResizeMode = "contain" | "cover" | "stretch";
|
|
@@ -36,6 +41,7 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
36
41
|
posterResizeMode = "cover",
|
|
37
42
|
onPlaybackStatusUpdate: onPlaybackStatusUpdateProp,
|
|
38
43
|
onPlaybackFinish,
|
|
44
|
+
source,
|
|
39
45
|
...rest
|
|
40
46
|
},
|
|
41
47
|
ref
|
|
@@ -44,6 +50,8 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
44
50
|
React.useState<VideoPlayerComponent | null>();
|
|
45
51
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
46
52
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
53
|
+
const [currentSource, setCurrentSource] =
|
|
54
|
+
React.useState<AVPlaybackSource>();
|
|
47
55
|
const mediaPlaybackWrapperRef = React.useRef<MediaPlayerRef>(null);
|
|
48
56
|
|
|
49
57
|
const sizeStyles = extractSizeStyles(style);
|
|
@@ -110,6 +118,14 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
110
118
|
[toggleFullscreen, isPlaying]
|
|
111
119
|
);
|
|
112
120
|
|
|
121
|
+
useSourceDeepCompareEffect(() => {
|
|
122
|
+
const updateSource = async () => {
|
|
123
|
+
const finalSource = await normalizeBase64Source(source);
|
|
124
|
+
setCurrentSource(finalSource);
|
|
125
|
+
};
|
|
126
|
+
updateSource();
|
|
127
|
+
}, [source]);
|
|
128
|
+
|
|
113
129
|
return (
|
|
114
130
|
<MediaPlaybackWrapper
|
|
115
131
|
media={videoMediaObject as Playback | undefined}
|
|
@@ -125,6 +141,7 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>(
|
|
|
125
141
|
posterStyle={[sizeStyles, { resizeMode: posterResizeMode }]}
|
|
126
142
|
onPlaybackStatusUpdate={onPlaybackStatusUpdate}
|
|
127
143
|
onFullscreenUpdate={(e) => onFullscreenUpdate(e.fullscreenUpdate)}
|
|
144
|
+
source={currentSource}
|
|
128
145
|
{...rest}
|
|
129
146
|
/>
|
|
130
147
|
</MediaPlaybackWrapper>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { isObject } from "lodash";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { flattenReactFragments } from "../../utilities";
|
|
4
|
+
import PickerItem from "./dropdown/PickerItem";
|
|
2
5
|
export function normalizeToPickerOptions(options) {
|
|
3
6
|
if (options.length === 0) {
|
|
4
7
|
return [];
|
|
@@ -22,4 +25,12 @@ export function normalizeToPickerOptions(options) {
|
|
|
22
25
|
}
|
|
23
26
|
throw new Error('Picker options must be either an array of strings, numbers, or an array of { "label": string | number; "value": string | number; } objects.');
|
|
24
27
|
}
|
|
28
|
+
export function usePickerItemProps(childrenProp) {
|
|
29
|
+
return React.useMemo(() => {
|
|
30
|
+
const children = flattenReactFragments(React.Children.toArray(childrenProp));
|
|
31
|
+
// Only the props of the first PickerItem are used, any others are ignored
|
|
32
|
+
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
33
|
+
return (firstPickerItem === null || firstPickerItem === void 0 ? void 0 : firstPickerItem.props) || {};
|
|
34
|
+
}, [childrenProp]);
|
|
35
|
+
}
|
|
25
36
|
//# sourceMappingURL=PickerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,UAA+B,MAAM,uBAAuB,CAAC;AAsDpE,MAAM,UAAU,wBAAwB,CACtC,OAA6C;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/B,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACtE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK,EAAE,MAAyB;YAChC,KAAK,EAAE,MAAyB;SACjC,CAAC,CAAC,CAAC;KACL;IAED,IACE,QAAQ,CAAC,WAAW,CAAC;QACrB,WAAW,CAAC,KAAK,KAAK,SAAS;QAC/B,WAAW,CAAC,KAAK,KAAK,SAAS,EAC/B;QACA,OAAQ,OAA0B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAChD,OAAO;gBACL,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,IAAI,KAAK,CACb,6IAA6I,CAC9I,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,YAA6B;IAE7B,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,QAAQ,GAAG,qBAAqB,CACpC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAyB,CAC7D,CAAC;QAEF,0EAA0E;QAC1E,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;QAE5E,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,KAAI,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -2,6 +2,9 @@ import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
|
2
2
|
import { IconSlot } from "../../interfaces/Icon";
|
|
3
3
|
import { isObject } from "lodash";
|
|
4
4
|
import { Theme } from "../../styles/DefaultTheme";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { flattenReactFragments } from "../../utilities";
|
|
7
|
+
import PickerItem, { PickerItemProps } from "./dropdown/PickerItem";
|
|
5
8
|
|
|
6
9
|
export interface PickerOption {
|
|
7
10
|
value: string | number;
|
|
@@ -40,7 +43,7 @@ export interface MultiSelectPickerProps {
|
|
|
40
43
|
onValueChange: (value: (string | number)[]) => void;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
export interface
|
|
46
|
+
export interface DropDownModalPickerProps {
|
|
44
47
|
dropdownOverlayColor?: string;
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -88,3 +91,18 @@ export function normalizeToPickerOptions(
|
|
|
88
91
|
'Picker options must be either an array of strings, numbers, or an array of { "label": string | number; "value": string | number; } objects.'
|
|
89
92
|
);
|
|
90
93
|
}
|
|
94
|
+
|
|
95
|
+
export function usePickerItemProps(
|
|
96
|
+
childrenProp: React.ReactNode
|
|
97
|
+
): PickerItemProps {
|
|
98
|
+
return React.useMemo(() => {
|
|
99
|
+
const children = flattenReactFragments(
|
|
100
|
+
React.Children.toArray(childrenProp) as React.ReactElement[]
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// Only the props of the first PickerItem are used, any others are ignored
|
|
104
|
+
const firstPickerItem = children.find((child) => child.type === PickerItem);
|
|
105
|
+
|
|
106
|
+
return firstPickerItem?.props || {};
|
|
107
|
+
}, [childrenProp]);
|
|
108
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Keyboard } from "react-native";
|
|
3
|
+
import { extractStyles, useDeepCompareMemo } from "../../../utilities";
|
|
4
|
+
import { normalizeToPickerOptions, usePickerItemProps, } from "../PickerCommon";
|
|
5
|
+
import PickerInputContainer from "../PickerInputContainer";
|
|
6
|
+
import ModalPickerComponent from "react-native-select-dropdown";
|
|
7
|
+
import { withTheme } from "../../../theming";
|
|
8
|
+
import { useOnUpdate } from "../../../hooks";
|
|
9
|
+
const ModalPicker = ({ theme, options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, selectedIconName = "Feather/check", selectedIconColor = theme.colors.strong, selectedIconSize = 20, dropDownBackgroundColor = theme.colors.background, dropDownBorderColor = theme.colors.divider, dropDownTextColor = theme.colors.strong, dropDownBorderWidth = 1, dropDownBorderRadius = 8, children: childrenProp, disabled, dropdownOverlayColor, ...rest }) => {
|
|
10
|
+
const dropdownRef = React.useRef();
|
|
11
|
+
const [internalValue, setInternalValue] = React.useState(value);
|
|
12
|
+
const pickerItemProps = usePickerItemProps(childrenProp);
|
|
13
|
+
const { viewStyles: pickerItemViewStyles, textStyles: pickerItemTextStyles } = extractStyles(pickerItemProps.style);
|
|
14
|
+
const options = useDeepCompareMemo(() => normalizeToPickerOptions(optionsProp).map((option) => ({
|
|
15
|
+
label: option.label.toString(),
|
|
16
|
+
value: option.value,
|
|
17
|
+
})), [optionsProp]);
|
|
18
|
+
useOnUpdate(() => {
|
|
19
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(internalValue !== null && internalValue !== void 0 ? internalValue : "");
|
|
20
|
+
// onValueChange excluded to prevent running on every re-render when using an anoymous function, which is the common case
|
|
21
|
+
}, [internalValue]);
|
|
22
|
+
return (React.createElement(PickerInputContainer, { testID: "dropdown-modal-picker", Icon: Icon, placeholder: placeholder, selectedValue: value, options: options, onPress: () => {
|
|
23
|
+
var _a;
|
|
24
|
+
(_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.openDropdown();
|
|
25
|
+
if (autoDismissKeyboard) {
|
|
26
|
+
Keyboard.dismiss();
|
|
27
|
+
}
|
|
28
|
+
}, disabled: disabled, ...rest },
|
|
29
|
+
React.createElement(ModalPickerComponent, { ref: dropdownRef, data: options, defaultValue: internalValue, onSelect: (selectedItem) => {
|
|
30
|
+
setInternalValue(selectedItem.value);
|
|
31
|
+
}, renderButton: () => {
|
|
32
|
+
return React.createElement(React.Fragment, null);
|
|
33
|
+
}, renderItem: (item, _, isSelected) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const backgroundColor = isSelected
|
|
36
|
+
? (_a = pickerItemProps.selectedBackgroundColor) !== null && _a !== void 0 ? _a : pickerItemViewStyles.backgroundColor
|
|
37
|
+
: pickerItemViewStyles.backgroundColor;
|
|
38
|
+
const textColor = isSelected
|
|
39
|
+
? (_b = pickerItemProps.selectedTextColor) !== null && _b !== void 0 ? _b : dropDownTextColor
|
|
40
|
+
: dropDownTextColor;
|
|
41
|
+
const textSize = isSelected
|
|
42
|
+
? (_c = pickerItemProps.selectedTextSize) !== null && _c !== void 0 ? _c : 14
|
|
43
|
+
: 14;
|
|
44
|
+
return (React.createElement(View, { style: [
|
|
45
|
+
{
|
|
46
|
+
padding: 10,
|
|
47
|
+
flexDirection: "row",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
backgroundColor: backgroundColor,
|
|
50
|
+
},
|
|
51
|
+
pickerItemViewStyles,
|
|
52
|
+
] },
|
|
53
|
+
React.createElement(Text, { style: [
|
|
54
|
+
{
|
|
55
|
+
color: textColor,
|
|
56
|
+
fontSize: textSize,
|
|
57
|
+
flex: 1,
|
|
58
|
+
},
|
|
59
|
+
pickerItemTextStyles,
|
|
60
|
+
] }, item.label),
|
|
61
|
+
isSelected ? (React.createElement(Icon, { name: selectedIconName, size: selectedIconSize, color: selectedIconColor })) : null));
|
|
62
|
+
}, showsVerticalScrollIndicator: false, dropdownOverlayColor: dropdownOverlayColor, dropdownStyle: {
|
|
63
|
+
borderColor: dropDownBorderColor,
|
|
64
|
+
borderWidth: dropDownBorderWidth,
|
|
65
|
+
borderRadius: dropDownBorderRadius,
|
|
66
|
+
backgroundColor: dropDownBackgroundColor,
|
|
67
|
+
}, disableAutoScroll: true, statusBarTranslucent: true })));
|
|
68
|
+
};
|
|
69
|
+
export default withTheme(ModalPicker);
|
|
70
|
+
//# sourceMappingURL=DropDownModalPicker.js.map
|
|
@@ -0,0 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