@applicaster/zapp-react-native-ui-components 16.0.0-rc.91 → 16.0.0-rc.92
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/Components/ModalComponent/AudioPlayer/Components/Item.tsx +40 -15
- package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +6 -18
- package/Components/ModalComponent/AudioPlayer/utils/__tests__/mergeStyles.test.ts +6 -6
- package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +0 -12
- package/package.json +5 -5
|
@@ -54,6 +54,8 @@ export type BackgroundConfiguration = {
|
|
|
54
54
|
paddingRight?: number;
|
|
55
55
|
paddingBottom?: number;
|
|
56
56
|
paddingLeft?: number;
|
|
57
|
+
highlightInsetLeft?: number;
|
|
58
|
+
highlightInsetRight?: number;
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
export type ImageConfiguration = {
|
|
@@ -203,9 +205,9 @@ const CONTAINER_SPEC_LARGE_IMAGE: ContainerSpec = {
|
|
|
203
205
|
|
|
204
206
|
const CONTAINER_SPEC_DEFAULT: ContainerSpec = {
|
|
205
207
|
paddingTop: 8,
|
|
206
|
-
paddingRight:
|
|
208
|
+
paddingRight: 10,
|
|
207
209
|
paddingBottom: 8,
|
|
208
|
-
paddingLeft:
|
|
210
|
+
paddingLeft: 10,
|
|
209
211
|
horizontalGutter: 12,
|
|
210
212
|
verticalGutter: 2,
|
|
211
213
|
};
|
|
@@ -350,21 +352,30 @@ function ItemContainer({
|
|
|
350
352
|
onPress,
|
|
351
353
|
}: ItemContainerProps) {
|
|
352
354
|
const container = resolveContainerSpec(image);
|
|
353
|
-
const
|
|
355
|
+
const insetLeft = background.highlightInsetLeft ?? 0;
|
|
356
|
+
const insetRight = background.highlightInsetRight ?? 0;
|
|
354
357
|
|
|
355
358
|
return (
|
|
356
|
-
<Pressable
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
359
|
+
<Pressable onPress={onPress}>
|
|
360
|
+
{({ pressed }) => (
|
|
361
|
+
<View
|
|
362
|
+
style={{
|
|
363
|
+
marginLeft: insetLeft,
|
|
364
|
+
marginRight: insetRight,
|
|
365
|
+
backgroundColor:
|
|
366
|
+
pressed || focused
|
|
367
|
+
? background.focusedColor
|
|
368
|
+
: background.defaultColor,
|
|
369
|
+
borderRadius: background.cornerRadius,
|
|
370
|
+
paddingTop: background.paddingTop ?? container.paddingTop,
|
|
371
|
+
paddingRight: background.paddingRight ?? container.paddingRight,
|
|
372
|
+
paddingBottom: background.paddingBottom ?? container.paddingBottom,
|
|
373
|
+
paddingLeft: background.paddingLeft ?? container.paddingLeft,
|
|
374
|
+
}}
|
|
375
|
+
>
|
|
376
|
+
{children}
|
|
377
|
+
</View>
|
|
378
|
+
)}
|
|
368
379
|
</Pressable>
|
|
369
380
|
);
|
|
370
381
|
}
|
|
@@ -927,6 +938,10 @@ export const VARIANT_NOW_PLAYING: ItemConfiguration = {
|
|
|
927
938
|
defaultColor: "transparent",
|
|
928
939
|
focusedColor: "transparent",
|
|
929
940
|
cornerRadius: 0,
|
|
941
|
+
paddingTop: 8,
|
|
942
|
+
paddingRight: 20,
|
|
943
|
+
paddingBottom: 8,
|
|
944
|
+
paddingLeft: 20,
|
|
930
945
|
},
|
|
931
946
|
image: {
|
|
932
947
|
width: 72,
|
|
@@ -947,6 +962,12 @@ export const VARIANT_QUEUED_ITEM: ItemConfiguration = {
|
|
|
947
962
|
defaultColor: "transparent",
|
|
948
963
|
focusedColor: "rgba(62, 62, 62, 1)",
|
|
949
964
|
cornerRadius: 12,
|
|
965
|
+
paddingTop: 8,
|
|
966
|
+
paddingRight: 10,
|
|
967
|
+
paddingBottom: 8,
|
|
968
|
+
paddingLeft: 10,
|
|
969
|
+
highlightInsetLeft: 10,
|
|
970
|
+
highlightInsetRight: 10,
|
|
950
971
|
},
|
|
951
972
|
image: {
|
|
952
973
|
width: 48,
|
|
@@ -967,6 +988,10 @@ export const VARIANT_PLAYLIST_ITEM: ItemConfiguration = {
|
|
|
967
988
|
defaultColor: "transparent",
|
|
968
989
|
focusedColor: "rgba(62, 62, 62, 1)",
|
|
969
990
|
cornerRadius: 12,
|
|
991
|
+
paddingTop: 8,
|
|
992
|
+
paddingRight: 10,
|
|
993
|
+
paddingBottom: 8,
|
|
994
|
+
paddingLeft: 10,
|
|
970
995
|
},
|
|
971
996
|
image: {
|
|
972
997
|
width: 48,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
AudioPlayerTrackItem,
|
|
5
5
|
VARIANT_NOW_PLAYING,
|
|
@@ -10,15 +10,6 @@ import type { MenuItem } from "@applicaster/zapp-react-native-utils/modalState/t
|
|
|
10
10
|
import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
|
|
11
11
|
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
12
12
|
|
|
13
|
-
const styles = StyleSheet.create({
|
|
14
|
-
divider: {
|
|
15
|
-
height: StyleSheet.hairlineWidth,
|
|
16
|
-
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
17
|
-
marginHorizontal: 20,
|
|
18
|
-
marginVertical: 8,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
13
|
type NowPlayingHeaderSectionProps = {
|
|
23
14
|
onClear?: () => void;
|
|
24
15
|
nextUpTitle?: string;
|
|
@@ -70,14 +61,11 @@ export function NowPlayingHeaderSection({
|
|
|
70
61
|
};
|
|
71
62
|
|
|
72
63
|
return (
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/>
|
|
79
|
-
<View style={styles.divider} />
|
|
80
|
-
</View>
|
|
64
|
+
<AudioPlayerTrackItem
|
|
65
|
+
configuration={VARIANT_NOW_PLAYING}
|
|
66
|
+
data={data}
|
|
67
|
+
onTrailingButtonPress={handlePlayPause}
|
|
68
|
+
/>
|
|
81
69
|
);
|
|
82
70
|
};
|
|
83
71
|
|
|
@@ -57,7 +57,7 @@ describe("mergeItemConfiguration background", () => {
|
|
|
57
57
|
expect(merged.textLabel1.lineHeight).toBe(40);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
it("
|
|
60
|
+
it("does not merge Studio item background padding (white spec field)", () => {
|
|
61
61
|
const merged = mergeItemConfiguration(base as any, {
|
|
62
62
|
background: {
|
|
63
63
|
default: {
|
|
@@ -70,11 +70,11 @@ describe("mergeItemConfiguration background", () => {
|
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
expect(merged.background.
|
|
74
|
-
expect(merged.background.
|
|
75
|
-
expect(merged.background.
|
|
76
|
-
expect(merged.background.
|
|
77
|
-
|
|
73
|
+
expect(merged.background.defaultColor).toBe("#2E7D32");
|
|
74
|
+
expect(merged.background.paddingTop).toBeUndefined();
|
|
75
|
+
expect(merged.background.paddingBottom).toBeUndefined();
|
|
76
|
+
expect(merged.background.paddingLeft).toBeUndefined();
|
|
77
|
+
expect(merged.background.paddingRight).toBeUndefined();
|
|
78
78
|
expect(merged.background.focusedColor).toBe("rgba(62, 62, 62, 1)");
|
|
79
79
|
});
|
|
80
80
|
|
|
@@ -45,18 +45,6 @@ function mergeItemBackground(
|
|
|
45
45
|
...(defaultOverride?.borderRadius !== undefined
|
|
46
46
|
? { cornerRadius: defaultOverride.borderRadius }
|
|
47
47
|
: {}),
|
|
48
|
-
...(defaultOverride?.paddingTop !== undefined
|
|
49
|
-
? { paddingTop: defaultOverride.paddingTop }
|
|
50
|
-
: {}),
|
|
51
|
-
...(defaultOverride?.paddingRight !== undefined
|
|
52
|
-
? { paddingRight: defaultOverride.paddingRight }
|
|
53
|
-
: {}),
|
|
54
|
-
...(defaultOverride?.paddingBottom !== undefined
|
|
55
|
-
? { paddingBottom: defaultOverride.paddingBottom }
|
|
56
|
-
: {}),
|
|
57
|
-
...(defaultOverride?.paddingLeft !== undefined
|
|
58
|
-
? { paddingLeft: defaultOverride.paddingLeft }
|
|
59
|
-
: {}),
|
|
60
48
|
};
|
|
61
49
|
}
|
|
62
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "16.0.0-rc.
|
|
3
|
+
"version": "16.0.0-rc.92",
|
|
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": "16.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "16.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "16.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "16.0.0-rc.92",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.92",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "16.0.0-rc.92",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "16.0.0-rc.92",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"react-native-sortables": "1.7.1",
|