@draftbit/core 50.2.5-f5433f.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/lib/commonjs/components/LoadingIndicator.js +1 -0
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/typescript/src/components/{ActivityIndicator.d.ts → LoadingIndicator.d.ts} +3 -4
- package/lib/typescript/src/components/LoadingIndicator.js +38 -0
- package/lib/typescript/src/components/LoadingIndicator.js.map +1 -0
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.d.ts +1 -0
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +7 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerInputContainer.js +1 -2
- package/lib/typescript/src/components/Picker/PickerInputContainer.js.map +1 -1
- package/lib/typescript/src/components/TextField.js +14 -11
- package/lib/typescript/src/components/TextField.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.js +1 -1
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/LoadingIndicator.js +38 -0
- package/src/components/LoadingIndicator.js.map +1 -0
- package/src/components/LoadingIndicator.tsx +70 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.ts +1 -0
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +7 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +8 -0
- package/src/components/Picker/PickerInputContainer.js +1 -2
- package/src/components/Picker/PickerInputContainer.js.map +1 -1
- package/src/components/Picker/PickerInputContainer.tsx +0 -2
- package/src/components/TextField.js +14 -11
- package/src/components/TextField.js.map +1 -1
- package/src/components/TextField.tsx +26 -21
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/index.tsx +1 -1
- package/lib/commonjs/components/ActivityIndicator.js +0 -1
- package/lib/typescript/src/components/ActivityIndicator.js +0 -74
- package/lib/typescript/src/components/ActivityIndicator.js.map +0 -1
- package/src/components/ActivityIndicator.js +0 -74
- package/src/components/ActivityIndicator.js.map +0 -1
- package/src/components/ActivityIndicator.tsx +0 -140
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ActivityIndicator as ActivityIndicatorRN, View, Platform, } from "react-native";
|
|
3
|
-
import { withTheme } from "@draftbit/theme";
|
|
4
|
-
import { Bounce, Chase, Circle, CircleFade, Flow, Fold, Grid, Plane, Pulse, Swing, Wander, Wave, } from "react-native-animated-spinkit";
|
|
5
|
-
export var ActivityIndicatorType;
|
|
6
|
-
(function (ActivityIndicatorType) {
|
|
7
|
-
ActivityIndicatorType["default"] = "default";
|
|
8
|
-
ActivityIndicatorType["plane"] = "plane";
|
|
9
|
-
ActivityIndicatorType["chase"] = "chase";
|
|
10
|
-
ActivityIndicatorType["bounce"] = "bounce";
|
|
11
|
-
ActivityIndicatorType["wave"] = "wave";
|
|
12
|
-
ActivityIndicatorType["pulse"] = "pulse";
|
|
13
|
-
ActivityIndicatorType["flow"] = "flow";
|
|
14
|
-
ActivityIndicatorType["swing"] = "swing";
|
|
15
|
-
ActivityIndicatorType["circle"] = "circle";
|
|
16
|
-
ActivityIndicatorType["circleFade"] = "circleFade";
|
|
17
|
-
ActivityIndicatorType["grid"] = "grid";
|
|
18
|
-
ActivityIndicatorType["fold"] = "fold";
|
|
19
|
-
ActivityIndicatorType["wander"] = "wander";
|
|
20
|
-
})(ActivityIndicatorType || (ActivityIndicatorType = {}));
|
|
21
|
-
const SPINNER_COMPONENTS = {
|
|
22
|
-
[ActivityIndicatorType.plane]: Plane,
|
|
23
|
-
[ActivityIndicatorType.chase]: Chase,
|
|
24
|
-
[ActivityIndicatorType.bounce]: Bounce,
|
|
25
|
-
[ActivityIndicatorType.wave]: Wave,
|
|
26
|
-
[ActivityIndicatorType.pulse]: Pulse,
|
|
27
|
-
[ActivityIndicatorType.flow]: Flow,
|
|
28
|
-
[ActivityIndicatorType.swing]: Swing,
|
|
29
|
-
[ActivityIndicatorType.circle]: Circle,
|
|
30
|
-
[ActivityIndicatorType.circleFade]: CircleFade,
|
|
31
|
-
[ActivityIndicatorType.grid]: Grid,
|
|
32
|
-
[ActivityIndicatorType.fold]: Fold,
|
|
33
|
-
[ActivityIndicatorType.wander]: Wander,
|
|
34
|
-
};
|
|
35
|
-
const smallActivityIndicatorSize = 20;
|
|
36
|
-
const largeActivityIndicatorSize = 40;
|
|
37
|
-
const getLoadingSizeNumber = (size) => {
|
|
38
|
-
if (typeof size === "number")
|
|
39
|
-
return size;
|
|
40
|
-
return size === "large"
|
|
41
|
-
? largeActivityIndicatorSize
|
|
42
|
-
: smallActivityIndicatorSize;
|
|
43
|
-
};
|
|
44
|
-
const getScaleLevel = (size) => {
|
|
45
|
-
if (typeof size === "number")
|
|
46
|
-
return size / smallActivityIndicatorSize;
|
|
47
|
-
return size === "large" ? 2 : 1;
|
|
48
|
-
};
|
|
49
|
-
const ActivityIndicator = ({ theme, color = theme.colors.branding.primary, type = ActivityIndicatorType.default, size = "small", style, ...rest }) => {
|
|
50
|
-
const sizeNumber = getLoadingSizeNumber(size);
|
|
51
|
-
const spinnerColor = color !== null && color !== void 0 ? color : theme.colors.branding.primary;
|
|
52
|
-
// Handle display spinner type
|
|
53
|
-
if (type !== ActivityIndicatorType.default) {
|
|
54
|
-
if (type && SPINNER_COMPONENTS[type]) {
|
|
55
|
-
const SpinnerComponent = SPINNER_COMPONENTS[type];
|
|
56
|
-
return (React.createElement(SpinnerComponent, { size: sizeNumber, color: spinnerColor, style: style }));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// This is due to limitations with iOS UIActivityIndicator
|
|
60
|
-
// Refer: https://github.com/facebook/react-native/issues/12250
|
|
61
|
-
const scaleLevel = getScaleLevel(size);
|
|
62
|
-
if (Platform.OS === "ios") {
|
|
63
|
-
return (React.createElement(View, { style: [
|
|
64
|
-
style,
|
|
65
|
-
{
|
|
66
|
-
transform: [{ scale: scaleLevel }],
|
|
67
|
-
},
|
|
68
|
-
] },
|
|
69
|
-
React.createElement(ActivityIndicatorRN, { animating: true, hidesWhenStopped: true, size: "small", color: spinnerColor, ...rest })));
|
|
70
|
-
}
|
|
71
|
-
return (React.createElement(ActivityIndicatorRN, { animating: true, hidesWhenStopped: true, size: size, color: spinnerColor, style: style, ...rest }));
|
|
72
|
-
};
|
|
73
|
-
export default withTheme(ActivityIndicator);
|
|
74
|
-
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["ActivityIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,iBAAiB,IAAI,mBAAmB,EACxC,IAAI,EACJ,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,GACL,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAN,IAAY,qBAcX;AAdD,WAAY,qBAAqB;IAC/B,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,wCAAe,CAAA;IACf,0CAAiB,CAAA;IACjB,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,sC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ACD,OAAO,CACL,oBAAC,mBAAmB,IAClB,SAAS,EAAE,IAAI,EACf,gBAAgB,EAAE,IAAI,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,KAAK,KACR,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
StyleProp,
|
|
4
|
-
ViewStyle,
|
|
5
|
-
ActivityIndicator as ActivityIndicatorRN,
|
|
6
|
-
View,
|
|
7
|
-
Platform,
|
|
8
|
-
} from "react-native";
|
|
9
|
-
import { withTheme } from "@draftbit/theme";
|
|
10
|
-
import type { ReadTheme } from "@draftbit/theme";
|
|
11
|
-
import {
|
|
12
|
-
Bounce,
|
|
13
|
-
Chase,
|
|
14
|
-
Circle,
|
|
15
|
-
CircleFade,
|
|
16
|
-
Flow,
|
|
17
|
-
Fold,
|
|
18
|
-
Grid,
|
|
19
|
-
Plane,
|
|
20
|
-
Pulse,
|
|
21
|
-
Swing,
|
|
22
|
-
Wander,
|
|
23
|
-
Wave,
|
|
24
|
-
} from "react-native-animated-spinkit";
|
|
25
|
-
|
|
26
|
-
export enum ActivityIndicatorType {
|
|
27
|
-
default = "default",
|
|
28
|
-
plane = "plane",
|
|
29
|
-
chase = "chase",
|
|
30
|
-
bounce = "bounce",
|
|
31
|
-
wave = "wave",
|
|
32
|
-
pulse = "pulse",
|
|
33
|
-
flow = "flow",
|
|
34
|
-
swing = "swing",
|
|
35
|
-
circle = "circle",
|
|
36
|
-
circleFade = "circleFade",
|
|
37
|
-
grid = "grid",
|
|
38
|
-
fold = "fold",
|
|
39
|
-
wander = "wander",
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
type Props = {
|
|
43
|
-
style?: StyleProp<ViewStyle>;
|
|
44
|
-
color?: string;
|
|
45
|
-
theme: ReadTheme;
|
|
46
|
-
type?: ActivityIndicatorType;
|
|
47
|
-
size?: number | "small" | "large";
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const SPINNER_COMPONENTS = {
|
|
51
|
-
[ActivityIndicatorType.plane]: Plane,
|
|
52
|
-
[ActivityIndicatorType.chase]: Chase,
|
|
53
|
-
[ActivityIndicatorType.bounce]: Bounce,
|
|
54
|
-
[ActivityIndicatorType.wave]: Wave,
|
|
55
|
-
[ActivityIndicatorType.pulse]: Pulse,
|
|
56
|
-
[ActivityIndicatorType.flow]: Flow,
|
|
57
|
-
[ActivityIndicatorType.swing]: Swing,
|
|
58
|
-
[ActivityIndicatorType.circle]: Circle,
|
|
59
|
-
[ActivityIndicatorType.circleFade]: CircleFade,
|
|
60
|
-
[ActivityIndicatorType.grid]: Grid,
|
|
61
|
-
[ActivityIndicatorType.fold]: Fold,
|
|
62
|
-
[ActivityIndicatorType.wander]: Wander,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const smallActivityIndicatorSize = 20;
|
|
66
|
-
const largeActivityIndicatorSize = 40;
|
|
67
|
-
|
|
68
|
-
const getLoadingSizeNumber = (size?: number | "small" | "large"): number => {
|
|
69
|
-
if (typeof size === "number") return size;
|
|
70
|
-
return size === "large"
|
|
71
|
-
? largeActivityIndicatorSize
|
|
72
|
-
: smallActivityIndicatorSize;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const getScaleLevel = (size?: number | "small" | "large"): number => {
|
|
76
|
-
if (typeof size === "number") return size / smallActivityIndicatorSize;
|
|
77
|
-
return size === "large" ? 2 : 1;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const ActivityIndicator: React.FC<React.PropsWithChildren<Props>> = ({
|
|
81
|
-
theme,
|
|
82
|
-
color = theme.colors.branding.primary,
|
|
83
|
-
type = ActivityIndicatorType.default,
|
|
84
|
-
size = "small",
|
|
85
|
-
style,
|
|
86
|
-
...rest
|
|
87
|
-
}) => {
|
|
88
|
-
const sizeNumber = getLoadingSizeNumber(size);
|
|
89
|
-
const spinnerColor = color ?? theme.colors.branding.primary;
|
|
90
|
-
|
|
91
|
-
// Handle display spinner type
|
|
92
|
-
if (type !== ActivityIndicatorType.default) {
|
|
93
|
-
if (type && SPINNER_COMPONENTS[type]) {
|
|
94
|
-
const SpinnerComponent = SPINNER_COMPONENTS[type];
|
|
95
|
-
return (
|
|
96
|
-
<SpinnerComponent
|
|
97
|
-
size={sizeNumber}
|
|
98
|
-
color={spinnerColor}
|
|
99
|
-
style={style}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// This is due to limitations with iOS UIActivityIndicator
|
|
106
|
-
// Refer: https://github.com/facebook/react-native/issues/12250
|
|
107
|
-
const scaleLevel = getScaleLevel(size);
|
|
108
|
-
if (Platform.OS === "ios") {
|
|
109
|
-
return (
|
|
110
|
-
<View
|
|
111
|
-
style={[
|
|
112
|
-
style,
|
|
113
|
-
{
|
|
114
|
-
transform: [{ scale: scaleLevel }],
|
|
115
|
-
},
|
|
116
|
-
]}
|
|
117
|
-
>
|
|
118
|
-
<ActivityIndicatorRN
|
|
119
|
-
animating={true}
|
|
120
|
-
hidesWhenStopped={true}
|
|
121
|
-
size={"small"}
|
|
122
|
-
color={spinnerColor}
|
|
123
|
-
{...rest}
|
|
124
|
-
/>
|
|
125
|
-
</View>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
return (
|
|
129
|
-
<ActivityIndicatorRN
|
|
130
|
-
animating={true}
|
|
131
|
-
hidesWhenStopped={true}
|
|
132
|
-
size={size}
|
|
133
|
-
color={spinnerColor}
|
|
134
|
-
style={style}
|
|
135
|
-
{...rest}
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export default withTheme(ActivityIndicator);
|