react-native-boxes 1.4.43 → 1.4.45
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 +1 -1
- package/src/Analytics.ts +2 -2
- package/src/Bar.tsx +4 -4
- package/src/Button.tsx +6 -6
- package/src/Modal.tsx +5 -5
- package/src/index.js +1 -0
- package/src/index.tsx +2 -1
package/package.json
CHANGED
package/src/Analytics.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const TrackingViewType = {
|
|
2
2
|
BUTTON: 'button',
|
|
3
3
|
TEXT: 'text',
|
|
4
4
|
DIALOG: 'dialog',
|
|
@@ -21,7 +21,7 @@ export const TrackerUtils = {
|
|
|
21
21
|
return "undefined"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
export const
|
|
24
|
+
export const TrackingActionType = {
|
|
25
25
|
CLICK: 'click',
|
|
26
26
|
VIEW: 'view',
|
|
27
27
|
NAVIGATE: 'navigate'
|
package/src/Bar.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { Icon, getIcon } from "./Image";
|
|
|
8
8
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
9
|
import { PressableView } from "./Button";
|
|
10
10
|
import { isDesktop, isWeb } from "./utils";
|
|
11
|
-
import {
|
|
11
|
+
import { TrackingActionType, TrackingViewType } from "./Analytics";
|
|
12
12
|
|
|
13
13
|
export interface Option {
|
|
14
14
|
id: string,
|
|
@@ -89,7 +89,7 @@ export function SimpleToolbar(props: SimpleToolbarProps) {
|
|
|
89
89
|
margin: 0,
|
|
90
90
|
}}>
|
|
91
91
|
<PressableView onPress={() => {
|
|
92
|
-
theme.onTrack(
|
|
92
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.TOOLBAR, 'back')
|
|
93
93
|
props.onHomePress && props.onHomePress()
|
|
94
94
|
}}>
|
|
95
95
|
{HomeIcon && <HomeIcon color={props.forgroundColor || theme.colors.invert.text} />}
|
|
@@ -111,7 +111,7 @@ export function SimpleToolbar(props: SimpleToolbarProps) {
|
|
|
111
111
|
key={opt.id}
|
|
112
112
|
accessibilityHint={title}
|
|
113
113
|
onPress={() => {
|
|
114
|
-
theme.onTrack(
|
|
114
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.TOOLBAR, 'option-' + opt.id)
|
|
115
115
|
opt.onClick && opt.onClick(opt.id)
|
|
116
116
|
}}>
|
|
117
117
|
<ActionIcon
|
|
@@ -178,7 +178,7 @@ export function BottomNavBar(props: ViewProps &
|
|
|
178
178
|
key={op.id}
|
|
179
179
|
onPress={() => {
|
|
180
180
|
op.onClick && op.onClick(op.id)
|
|
181
|
-
theme.onTrack(
|
|
181
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.BOTTOMBAR, 'option-' + op.id)
|
|
182
182
|
props.onSelect(op.id)
|
|
183
183
|
}}>
|
|
184
184
|
<Center >
|
package/src/Button.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { ThemeContext } from "./ThemeContext";
|
|
|
4
4
|
import { Center, HBox } from "./Box";
|
|
5
5
|
import { TextView, TextViewProps } from "./Text";
|
|
6
6
|
import { getIcon } from "./Image";
|
|
7
|
-
import { TrackerUtils,
|
|
7
|
+
import { TrackerUtils, TrackingActionType, TrackingViewType } from "./Analytics";
|
|
8
8
|
|
|
9
9
|
export type ButtonViewProps = TextProps & TouchableHighlightProps & { icon?: any, text?: string, textStyle?: TextStyle, children?: any }
|
|
10
10
|
|
|
@@ -43,7 +43,7 @@ export function TransparentButton(props: TextProps & TouchableHighlightProps
|
|
|
43
43
|
{...props}
|
|
44
44
|
onPress={(e) => {
|
|
45
45
|
props.onPress && props.onPress(e)
|
|
46
|
-
theme.onTrack(
|
|
46
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.BUTTON, (props.text || TrackerUtils.textOf(props.children)))
|
|
47
47
|
}}
|
|
48
48
|
onPressIn={onPressIn}
|
|
49
49
|
onPressOut={onPressOut}
|
|
@@ -115,7 +115,7 @@ export function ButtonView(props: ButtonViewProps) {
|
|
|
115
115
|
{...props}
|
|
116
116
|
onPress={(e) => {
|
|
117
117
|
props.onPress && props.onPress(e)
|
|
118
|
-
theme.onTrack(
|
|
118
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.BUTTON, (props['aria-label'] ? props['aria-label'] + '-' : '') + (props.text || TrackerUtils.textOf(props.children)))
|
|
119
119
|
}}
|
|
120
120
|
onPressIn={onPressIn}
|
|
121
121
|
onPressOut={onPressOut}
|
|
@@ -193,7 +193,7 @@ export function RightIconButton(props: ButtonViewProps) {
|
|
|
193
193
|
{...props}
|
|
194
194
|
onPress={(e) => {
|
|
195
195
|
props.onPress && props.onPress(e)
|
|
196
|
-
theme.onTrack(
|
|
196
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.BUTTON, (props.text || TrackerUtils.textOf(props.children)))
|
|
197
197
|
}}
|
|
198
198
|
onPressIn={onPressIn}
|
|
199
199
|
onPressOut={onPressOut}
|
|
@@ -318,7 +318,7 @@ export function PressableView(props: PressableProps) {
|
|
|
318
318
|
return (<Pressable {...props} style={({ pressed }) => [{ opacity: pressed ? 0.7 : 1.0 }, props.style]} />)
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
export function SwitchView(props: SwitchProps & { text
|
|
321
|
+
export function SwitchView(props: SwitchProps & { text?: string, orientation?: 'row' | 'column' }) {
|
|
322
322
|
const theme = useContext(ThemeContext)
|
|
323
323
|
return (
|
|
324
324
|
<HBox style={[{
|
|
@@ -335,7 +335,7 @@ export function SwitchView(props: SwitchProps & { text: string, orientation: 'ro
|
|
|
335
335
|
ios_backgroundColor={theme.colors.caption}
|
|
336
336
|
onValueChange={(value) => {
|
|
337
337
|
props.onValueChange && props.onValueChange(value)
|
|
338
|
-
theme.onTrack(
|
|
338
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.SWITCH, (props.text) + '-' + value, { value })
|
|
339
339
|
}}
|
|
340
340
|
{...props}
|
|
341
341
|
/>
|
package/src/Modal.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { CompositeTextInputView, CompositeTextInputViewProps } from './Input';
|
|
|
11
11
|
import * as WebBrowser from 'expo-web-browser';
|
|
12
12
|
import { TransparentCenterToolbar } from './Bar';
|
|
13
13
|
import { GestureDetector, Gesture, Directions } from 'react-native-gesture-handler';
|
|
14
|
-
import { TrackerUtils,
|
|
14
|
+
import { TrackerUtils, TrackingActionType, TrackingViewType } from './Analytics';
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export type BottomSheetProps = {
|
|
@@ -39,7 +39,7 @@ export const BottomSheet = (props: BottomSheetProps) => {
|
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
setModalVisible(props.visible)
|
|
41
41
|
if (props.visible)
|
|
42
|
-
theme.onTrack(
|
|
42
|
+
theme.onTrack(TrackingActionType.VIEW, TrackingViewType.DIALOG, (TrackerUtils.textOf(props.title)))
|
|
43
43
|
}, [props.visible])
|
|
44
44
|
|
|
45
45
|
function cancel() {
|
|
@@ -267,7 +267,7 @@ export function Expand(props: ViewProps & {
|
|
|
267
267
|
const toggleExpand = () => {
|
|
268
268
|
let newValue = !expanded
|
|
269
269
|
setExpanded(newValue);
|
|
270
|
-
theme.onTrack(
|
|
270
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.DIALOG, (newValue ? 'expand' : 'collaps') + '-' + props.title)
|
|
271
271
|
};
|
|
272
272
|
var onLayoutContent = (event: LayoutChangeEvent) => {
|
|
273
273
|
if (!contentHeight) {
|
|
@@ -406,7 +406,7 @@ export const DropDownView = (props: DropDownViewProps) => {
|
|
|
406
406
|
};
|
|
407
407
|
const onSelect = (selectedId: string, opt: DropDownViewOption) => {
|
|
408
408
|
props.onSelect(selectedId, opt)
|
|
409
|
-
theme.onTrack(
|
|
409
|
+
theme.onTrack(TrackingActionType.CLICK, TrackingViewType.DROPDOWN, 'select-' + props.title, {
|
|
410
410
|
value: selectedId,
|
|
411
411
|
title: opt.title,
|
|
412
412
|
displayType: displayType
|
|
@@ -713,7 +713,7 @@ export function WebBrowserView(props: {
|
|
|
713
713
|
};
|
|
714
714
|
|
|
715
715
|
useEffect(() => {
|
|
716
|
-
theme.onTrack(
|
|
716
|
+
theme.onTrack(TrackingActionType.VIEW, TrackingViewType.WEBVIEW, 'webview-' + props.title, {
|
|
717
717
|
url: props.url,
|
|
718
718
|
message: props.openMessage
|
|
719
719
|
})
|
package/src/index.js
CHANGED
|
@@ -28,4 +28,5 @@ __exportStar(require("./demo"), exports);
|
|
|
28
28
|
__exportStar(require("./ThemeContext"), exports);
|
|
29
29
|
__exportStar(require("./I18n"), exports);
|
|
30
30
|
__exportStar(require("./List"), exports);
|
|
31
|
+
__exportStar(require("./Analytics"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
package/src/index.tsx
CHANGED