@draftbit/core 50.2.5-ecf5e5.2 → 50.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "50.2.5-ecf5e5.2+ecf5e56",
3
+ "version": "50.2.5",
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/theme": "^50.2.5-ecf5e5.2+ecf5e56",
44
+ "@draftbit/theme": "50.2.4",
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",
@@ -118,5 +118,5 @@
118
118
  ],
119
119
  "testEnvironment": "node"
120
120
  },
121
- "gitHead": "ecf5e56fdb194a09501d742e450123bcec4cdc4a"
121
+ "gitHead": "f1bde42b091a8e9a79bbd54b624beeccb107b02e"
122
122
  }
@@ -8,6 +8,7 @@ export interface HeadlessAudioPlayerProps extends MediaPlayerProps {
8
8
  playsInBackground?: boolean;
9
9
  playsInSilentModeIOS?: boolean;
10
10
  playThroughEarpieceAndroid?: boolean;
11
+ isLooping?: boolean;
11
12
  }
12
13
 
13
14
  export interface AudioPlayerInterfaceProps {
@@ -6,9 +6,12 @@ import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
6
6
  * Audio Player component without an interface (UI).
7
7
  * Only handles playing of the audio and provides callbacks and ref functions
8
8
  */
9
- const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lower volume", playsInBackground = false, playsInSilentModeIOS = false, playThroughEarpieceAndroid = false, onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, }, ref) => {
9
+ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lower volume", playsInBackground = false, playsInSilentModeIOS = false, playThroughEarpieceAndroid = false, onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, isLooping = false, }, ref) => {
10
10
  const [currentSound, setCurrentSound] = React.useState();
11
11
  const [isPlaying, setIsPlaying] = React.useState(false);
12
+ React.useEffect(() => {
13
+ currentSound === null || currentSound === void 0 ? void 0 : currentSound.setIsLoopingAsync(isLooping);
14
+ }, [currentSound, isLooping]);
12
15
  const updateAudioMode = React.useCallback(async () => {
13
16
  try {
14
17
  await Audio.setAudioModeAsync({
@@ -37,6 +40,9 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
37
40
  onPlaybackStatusUpdateProp === null || onPlaybackStatusUpdateProp === void 0 ? void 0 : onPlaybackStatusUpdateProp(mappedStatus);
38
41
  if (status.isLoaded) {
39
42
  if (status.didJustFinish) {
43
+ if (isLooping) {
44
+ return;
45
+ }
40
46
  onPlaybackFinish === null || onPlaybackFinish === void 0 ? void 0 : onPlaybackFinish();
41
47
  }
42
48
  setIsPlaying(status.isPlaying);
@@ -1 +1 @@
1
- {"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,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,0BAA0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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"}
@@ -31,12 +31,17 @@ const HeadlessAudioPlayer = React.forwardRef<
31
31
  playThroughEarpieceAndroid = false,
32
32
  onPlaybackStatusUpdate: onPlaybackStatusUpdateProp,
33
33
  onPlaybackFinish,
34
+ isLooping = false,
34
35
  },
35
36
  ref
36
37
  ) => {
37
38
  const [currentSound, setCurrentSound] = React.useState<Audio.Sound>();
38
39
  const [isPlaying, setIsPlaying] = React.useState(false);
39
40
 
41
+ React.useEffect(() => {
42
+ currentSound?.setIsLoopingAsync(isLooping);
43
+ }, [currentSound, isLooping]);
44
+
40
45
  const updateAudioMode = React.useCallback(async () => {
41
46
  try {
42
47
  await Audio.setAudioModeAsync({
@@ -71,6 +76,9 @@ const HeadlessAudioPlayer = React.forwardRef<
71
76
 
72
77
  if (status.isLoaded) {
73
78
  if (status.didJustFinish) {
79
+ if (isLooping) {
80
+ return;
81
+ }
74
82
  onPlaybackFinish?.();
75
83
  }
76
84
  setIsPlaying(status.isPlaying);
@@ -1,13 +1,13 @@
1
1
  import React from "react";
2
- import { ScrollView } from "react-native";
2
+ import { ScrollView, RefreshControl } from "react-native";
3
3
  import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
4
4
  /**
5
5
  * A ScrollView wrapper that takes a single `style` prop and internally extracts
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
- const SimpleStyleScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
8
+ const SimpleStyleScrollView = React.forwardRef(({ style: styleProp, onRefresh, refreshing = false, ...rest }, ref) => {
9
9
  const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
10
- return (React.createElement(ScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
10
+ return (React.createElement(ScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, refreshControl: onRefresh ? (React.createElement(RefreshControl, { refreshing: refreshing, onRefresh: onRefresh })) : undefined, ...rest }));
11
11
  });
12
12
  export default SimpleStyleScrollView;
13
13
  //# sourceMappingURL=SimpleStyleScrollView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACwC,EACjD,GAA0B,EAC1B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAO9E;;;GAGG;AACH,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,IAAI,EAAS,EACnE,GAA0B,EAC1B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EACZ,SAAS,CAAC,CAAC,CAAC,CACV,oBAAC,cAAc,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAI,CACjE,CAAC,CAAC,CAAC,SAAS,KAEX,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,18 +1,20 @@
1
1
  import React from "react";
2
- import { ScrollView } from "react-native";
2
+ import { ScrollView, RefreshControl } from "react-native";
3
3
  import type { ScrollViewProps } from "react-native";
4
4
  import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
5
5
 
6
+ interface Props extends Omit<ScrollViewProps, "contentContainerStyle"> {
7
+ onRefresh?: () => void;
8
+ refreshing?: boolean;
9
+ }
10
+
6
11
  /**
7
12
  * A ScrollView wrapper that takes a single `style` prop and internally extracts
8
13
  * the appropriate style keys into the `contentContainerStyle`
9
14
  */
10
15
  const SimpleStyleScrollView = React.forwardRef(
11
16
  (
12
- {
13
- style: styleProp,
14
- ...rest
15
- }: Omit<ScrollViewProps, "contentContainerStyle">,
17
+ { style: styleProp, onRefresh, refreshing = false, ...rest }: Props,
16
18
  ref: React.Ref<ScrollView>
17
19
  ) => {
18
20
  const { style, contentContainerStyle } =
@@ -23,6 +25,11 @@ const SimpleStyleScrollView = React.forwardRef(
23
25
  ref={ref}
24
26
  style={style}
25
27
  contentContainerStyle={contentContainerStyle}
28
+ refreshControl={
29
+ onRefresh ? (
30
+ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
31
+ ) : undefined
32
+ }
26
33
  {...rest}
27
34
  />
28
35
  );