@applicaster/zapp-react-native-ui-components 15.0.0-rc.128 → 15.0.0-rc.129
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.
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import * as R from "ramda";
|
|
3
3
|
|
|
4
4
|
import { TouchableOpacity } from "react-native";
|
|
5
|
-
// import { SvgUri } from "react-native-svg";
|
|
6
5
|
|
|
7
6
|
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
8
7
|
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
@@ -35,20 +34,6 @@ type Props = {
|
|
|
35
34
|
cellUUID?: string;
|
|
36
35
|
};
|
|
37
36
|
|
|
38
|
-
// function Svg({
|
|
39
|
-
// uri,
|
|
40
|
-
// style,
|
|
41
|
-
// ...props
|
|
42
|
-
// }: {
|
|
43
|
-
// uri: {},
|
|
44
|
-
// style: { width: Number, height: number },
|
|
45
|
-
// }) {
|
|
46
|
-
// const width = style?.width;
|
|
47
|
-
// const height = style?.height;
|
|
48
|
-
|
|
49
|
-
// return <SvgUri width={width} height={height} uri={uri} />;
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
37
|
const components = {
|
|
53
38
|
Image,
|
|
54
39
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
dateFormat,
|
|
7
7
|
} from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
8
8
|
|
|
9
|
-
import { useTextLabel } from "./hooks";
|
|
9
|
+
import { useTextLabel, withFocusedStyles } from "./hooks";
|
|
10
10
|
import { toNumber } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
11
11
|
import { MeasurementPortalContext } from "../../../MeasurmentsPortal";
|
|
12
12
|
import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
|
|
@@ -69,7 +69,7 @@ const _Text = ({
|
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
71
|
<Text
|
|
72
|
-
style={[style, { height }]}
|
|
72
|
+
style={[withFocusedStyles({ style, otherProps }), { height }]}
|
|
73
73
|
{...withoutLabel(otherProps)}
|
|
74
74
|
allowFontScaling={false}
|
|
75
75
|
>
|
|
@@ -16,6 +16,7 @@ import { useShallow } from "zustand/react/shallow";
|
|
|
16
16
|
import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
17
17
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
18
18
|
import { useLoadPipesDataDispatch } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
19
|
+
import { useGetUrlInflater } from "@applicaster/zapp-react-native-utils/reactHooks/feed/useInflatedUrl";
|
|
19
20
|
|
|
20
21
|
const BRIGHTNESS_THRESHOLD = 160;
|
|
21
22
|
const ABOVE_DEFAULT_COLOR = "gray";
|
|
@@ -64,35 +65,51 @@ export const usePullToRefresh = (
|
|
|
64
65
|
|
|
65
66
|
const [refreshing, setRefreshing] = React.useState(false);
|
|
66
67
|
|
|
67
|
-
const
|
|
68
|
+
const feedSources = React.useMemo(
|
|
68
69
|
() =>
|
|
69
70
|
(riverComponents || [])
|
|
70
|
-
.map((riverComponent) =>
|
|
71
|
-
|
|
71
|
+
.map((riverComponent) => ({
|
|
72
|
+
source: path(["data", "source"], riverComponent),
|
|
73
|
+
mapping: path(["data", "mapping"], riverComponent),
|
|
74
|
+
}))
|
|
75
|
+
.filter(({ source }) => !isNilOrEmpty(source)),
|
|
72
76
|
[riverComponents]
|
|
73
77
|
);
|
|
74
78
|
|
|
75
|
-
const feedsLength =
|
|
79
|
+
const feedsLength = feedSources.length;
|
|
76
80
|
|
|
77
81
|
const [requestsCompletedCounter, setRequestsCompletedCounter] =
|
|
78
82
|
React.useState(0);
|
|
79
83
|
|
|
80
84
|
const loadPipesDataDispatcher = useLoadPipesDataDispatch();
|
|
85
|
+
const urlInflater = useGetUrlInflater();
|
|
81
86
|
|
|
82
87
|
React.useEffect(() => {
|
|
83
88
|
// will not work for pipes v1 on 1st level screens
|
|
84
89
|
if (refreshing && !isPipesV1) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
feedSources.forEach(({ source, mapping }) => {
|
|
91
|
+
const inflatedUrl = urlInflater(source, mapping);
|
|
92
|
+
|
|
93
|
+
if (inflatedUrl) {
|
|
94
|
+
loadPipesDataDispatcher(inflatedUrl, {
|
|
95
|
+
silentRefresh: true,
|
|
96
|
+
clearCache: true,
|
|
97
|
+
callback: () => {
|
|
98
|
+
setRequestsCompletedCounter(R.inc);
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
setRequestsCompletedCounter(R.inc);
|
|
103
|
+
}
|
|
93
104
|
});
|
|
94
105
|
}
|
|
95
|
-
}, [
|
|
106
|
+
}, [
|
|
107
|
+
refreshing,
|
|
108
|
+
isPipesV1,
|
|
109
|
+
feedSources,
|
|
110
|
+
loadPipesDataDispatcher,
|
|
111
|
+
urlInflater,
|
|
112
|
+
]);
|
|
96
113
|
|
|
97
114
|
React.useEffect(() => {
|
|
98
115
|
if (requestsCompletedCounter === feedsLength) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DefaultCell } from "./DefaultCell";
|
|
2
2
|
import { GridCell } from "./GridCell";
|
|
3
3
|
import { HeroCell } from "./HeroCell";
|
|
4
|
-
// import { ScreenSelectorLabel } from "./ScreenSelectorLabel";
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Return a view tree ready to be injected with styles etc. Mapping is done
|
|
@@ -15,8 +14,6 @@ export function viewTreeResolver({ component_type }) {
|
|
|
15
14
|
switch (component_type) {
|
|
16
15
|
case "hero":
|
|
17
16
|
return HeroCell;
|
|
18
|
-
// case "screen_picker":
|
|
19
|
-
// return ScreenSelectorLabel;
|
|
20
17
|
case "grid":
|
|
21
18
|
return GridCell;
|
|
22
19
|
case "horizontal_list":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.129",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "15.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "15.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.129",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.129",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.129",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.129",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"url": "^0.11.0",
|