@applicaster/zapp-react-native-ui-components 16.0.0-rc.34 → 16.0.0-rc.36
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/MasterCell/DefaultComponents/PressableView.tsx +27 -7
- package/Components/MasterCell/DefaultComponents/Text/hooks/useText.ts +4 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/ActionButton.tsx +154 -138
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/TextLabelsContainer.ts +0 -1
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/PressableView.test.tsx +32 -21
- package/Components/MasterCell/contexts/PressedStateContext.ts +3 -0
- package/Components/MasterCell/hooks/index.ts +2 -0
- package/Components/MasterCell/hooks/usePressedState.ts +4 -0
- package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +33 -69
- package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +25 -47
- package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +122 -39
- package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +671 -0
- package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +257 -88
- package/Components/ModalComponent/AudioPlayer/Components/index.ts +6 -4
- package/package.json +5 -5
|
@@ -12,7 +12,14 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import React from "react";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
Image,
|
|
17
|
+
Platform,
|
|
18
|
+
Pressable,
|
|
19
|
+
StyleSheet,
|
|
20
|
+
Text,
|
|
21
|
+
View,
|
|
22
|
+
} from "react-native";
|
|
16
23
|
|
|
17
24
|
const styles = StyleSheet.create({
|
|
18
25
|
row: {
|
|
@@ -133,6 +140,7 @@ export interface SecondaryAction {
|
|
|
133
140
|
}
|
|
134
141
|
|
|
135
142
|
export interface MenuItem {
|
|
143
|
+
trailingButton?: ItemButtonAction;
|
|
136
144
|
title: string;
|
|
137
145
|
summary?: string;
|
|
138
146
|
icon?: string;
|
|
@@ -191,14 +199,18 @@ export type ItemData = {
|
|
|
191
199
|
leadingButton?: ItemButtonAction;
|
|
192
200
|
/** Button 1 (right most) — hardcoded action decides icon. */
|
|
193
201
|
trailingButton?: ItemButtonAction;
|
|
202
|
+
isSelected?: boolean;
|
|
194
203
|
};
|
|
195
204
|
|
|
196
|
-
export type
|
|
205
|
+
export type AudioPlayerTrackItemProps = {
|
|
197
206
|
configuration: ItemConfiguration;
|
|
198
207
|
data: ItemData;
|
|
199
208
|
focused?: boolean;
|
|
200
209
|
focusedLeadingButton?: boolean;
|
|
201
210
|
focusedTrailingButton?: boolean;
|
|
211
|
+
onPress?: () => void;
|
|
212
|
+
onLeadingButtonPress?: () => void;
|
|
213
|
+
onTrailingButtonPress?: () => void;
|
|
202
214
|
};
|
|
203
215
|
|
|
204
216
|
// ---------------------------------------------------------------------------
|
|
@@ -234,9 +246,9 @@ const CONTAINER_SPEC_LARGE_IMAGE: ContainerSpec = {
|
|
|
234
246
|
|
|
235
247
|
const CONTAINER_SPEC_DEFAULT: ContainerSpec = {
|
|
236
248
|
paddingTop: 8,
|
|
237
|
-
paddingRight:
|
|
249
|
+
paddingRight: 20,
|
|
238
250
|
paddingBottom: 8,
|
|
239
|
-
paddingLeft:
|
|
251
|
+
paddingLeft: 20,
|
|
240
252
|
horizontalGutter: 12,
|
|
241
253
|
verticalGutter: 2,
|
|
242
254
|
};
|
|
@@ -297,16 +309,6 @@ const DEFAULT_THUMB_ASSET =
|
|
|
297
309
|
const DEFAULT_EQUALIZER_ASSET =
|
|
298
310
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAI0lEQVR42mNgGNTgPxTQzwB0DVQ3gKCBowbQwYAhkBIHBAAA9TvPMeOFaLMAAAAASUVORK5CYII=";
|
|
299
311
|
|
|
300
|
-
const BUTTON_ASSETS: Record<ItemButtonAction, string> = {
|
|
301
|
-
playPause:
|
|
302
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAdklEQVR42u3ZwRUAERAEUfkn3TaF5TFTrSuCf3CgjZGg6ast7G8YaAlcB8JAj8F1MRR2G63CUNglNAqsRvmB1TAfsBoXcMABV4MFKEci4IADNrkAed2H80R66SHqvUvglh/ktoZcL5H7MHKBx/5xYH+RsP90t5t2UpF6+22a+AAAAABJRU5ErkJggg==",
|
|
303
|
-
drag: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIklEQVR42mNgGAWjYGiC/2SCwWPBaByMxsFoHIyCUTDYAAAqhk7AVXdZJwAAAABJRU5ErkJggg==",
|
|
304
|
-
multiSelect:
|
|
305
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAWklEQVR42t2VUQ4AIAhCvf+lrQsULJJZbH7GM1cS0Uk5dd0Qqcz4GJSCSs0pSCkAHNoWBfkTgIxpgGK+ujyEKABqRGyn9FO1A+yfrf+qsGxTSx5YEs2WyU9oAKBJKg8Kfq4dAAAAAElFTkSuQmCC",
|
|
306
|
-
remove:
|
|
307
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAUklEQVR42mNgGPbgPx5AVYOJlSPJcGqrJU8DKXooCVui9FIacXj1UyNl4DWDLhYgc8nA+INpeFgwtCOZ5vmALjmZ5mURXUpTutQHdKnRRgEMAACwjWWprU1B+AAAAABJRU5ErkJggg==",
|
|
308
|
-
};
|
|
309
|
-
|
|
310
312
|
function getTextTransformStyle(
|
|
311
313
|
textTransform: TextTransform
|
|
312
314
|
): "none" | "lowercase" | "uppercase" | "capitalize" {
|
|
@@ -324,32 +326,35 @@ function resolveContainerSpec(image: ImageConfiguration): ContainerSpec {
|
|
|
324
326
|
: CONTAINER_SPEC_DEFAULT;
|
|
325
327
|
}
|
|
326
328
|
|
|
327
|
-
function mapMenuItemToNowPlayingData(item: MenuItem): ItemData {
|
|
329
|
+
export function mapMenuItemToNowPlayingData(item: MenuItem): ItemData {
|
|
328
330
|
return {
|
|
329
331
|
imageUri: item.icon,
|
|
330
332
|
textLabel1: item.title,
|
|
331
333
|
textLabel2: item.summary ?? "",
|
|
332
334
|
nowPlayingLabel: "Now Playing",
|
|
333
335
|
trailingButton: "playPause",
|
|
336
|
+
isSelected: item.isSelected,
|
|
334
337
|
};
|
|
335
338
|
}
|
|
336
339
|
|
|
337
|
-
function mapMenuItemToQueuedData(item: MenuItem): ItemData {
|
|
340
|
+
export function mapMenuItemToQueuedData(item: MenuItem): ItemData {
|
|
338
341
|
return {
|
|
339
342
|
imageUri: item.icon,
|
|
340
343
|
textLabel1: item.title,
|
|
341
344
|
textLabel2: item.summary ?? "",
|
|
342
345
|
leadingButton: "remove",
|
|
343
346
|
trailingButton: "drag",
|
|
347
|
+
isSelected: item.isSelected,
|
|
344
348
|
};
|
|
345
349
|
}
|
|
346
350
|
|
|
347
|
-
function mapMenuItemToPlaylistData(item: MenuItem): ItemData {
|
|
351
|
+
export function mapMenuItemToPlaylistData(item: MenuItem): ItemData {
|
|
348
352
|
return {
|
|
349
353
|
imageUri: item.icon,
|
|
350
354
|
textLabel1: item.title,
|
|
351
355
|
textLabel2: item.summary ?? "",
|
|
352
|
-
trailingButton: "multiSelect",
|
|
356
|
+
trailingButton: item.trailingButton || ("multiSelect" as ItemButtonAction),
|
|
357
|
+
isSelected: item.isSelected,
|
|
353
358
|
};
|
|
354
359
|
}
|
|
355
360
|
|
|
@@ -362,6 +367,7 @@ type ItemContainerProps = {
|
|
|
362
367
|
background: BackgroundConfiguration;
|
|
363
368
|
focused: boolean;
|
|
364
369
|
children: React.ReactNode;
|
|
370
|
+
onPress?: () => void;
|
|
365
371
|
};
|
|
366
372
|
|
|
367
373
|
function ItemContainer({
|
|
@@ -369,23 +375,25 @@ function ItemContainer({
|
|
|
369
375
|
background,
|
|
370
376
|
focused,
|
|
371
377
|
children,
|
|
378
|
+
onPress,
|
|
372
379
|
}: ItemContainerProps) {
|
|
373
380
|
const container = resolveContainerSpec(image);
|
|
374
381
|
const bg = focused ? background.focusedColor : background.defaultColor;
|
|
375
382
|
|
|
376
383
|
return (
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
<Pressable
|
|
385
|
+
onPress={onPress}
|
|
386
|
+
style={({ pressed }) => ({
|
|
387
|
+
backgroundColor: pressed ? background.focusedColor : bg,
|
|
380
388
|
borderRadius: background.cornerRadius,
|
|
381
389
|
paddingTop: container.paddingTop,
|
|
382
390
|
paddingRight: container.paddingRight,
|
|
383
391
|
paddingBottom: container.paddingBottom,
|
|
384
392
|
paddingLeft: container.paddingLeft,
|
|
385
|
-
}}
|
|
393
|
+
})}
|
|
386
394
|
>
|
|
387
395
|
{children}
|
|
388
|
-
</
|
|
396
|
+
</Pressable>
|
|
389
397
|
);
|
|
390
398
|
}
|
|
391
399
|
|
|
@@ -486,27 +494,205 @@ function NowPlayingRow({
|
|
|
486
494
|
type ItemButtonProps = {
|
|
487
495
|
action: ItemButtonAction;
|
|
488
496
|
focused?: boolean;
|
|
497
|
+
onPress?: () => void;
|
|
498
|
+
isSelected?: boolean;
|
|
489
499
|
};
|
|
490
500
|
|
|
491
|
-
function ItemButton({
|
|
501
|
+
function ItemButton({
|
|
502
|
+
action,
|
|
503
|
+
focused = false,
|
|
504
|
+
onPress,
|
|
505
|
+
isSelected = false,
|
|
506
|
+
}: ItemButtonProps) {
|
|
492
507
|
const layout = BUTTON_LAYOUT_SPEC[action];
|
|
493
508
|
|
|
509
|
+
const renderIcon = () => {
|
|
510
|
+
switch (action) {
|
|
511
|
+
case "playPause": {
|
|
512
|
+
const iconSize = layout.assetWidth;
|
|
513
|
+
const iconRadius = iconSize / 2;
|
|
514
|
+
|
|
515
|
+
return (
|
|
516
|
+
<View
|
|
517
|
+
style={{
|
|
518
|
+
width: iconSize,
|
|
519
|
+
height: iconSize,
|
|
520
|
+
borderRadius: iconRadius,
|
|
521
|
+
backgroundColor: "#FFFFFF",
|
|
522
|
+
justifyContent: "center",
|
|
523
|
+
alignItems: "center",
|
|
524
|
+
}}
|
|
525
|
+
>
|
|
526
|
+
{isSelected ? (
|
|
527
|
+
<View
|
|
528
|
+
style={{
|
|
529
|
+
flexDirection: "row",
|
|
530
|
+
justifyContent: "space-between",
|
|
531
|
+
width: 10,
|
|
532
|
+
height: 16,
|
|
533
|
+
}}
|
|
534
|
+
>
|
|
535
|
+
<View
|
|
536
|
+
style={{
|
|
537
|
+
width: 3.5,
|
|
538
|
+
height: 16,
|
|
539
|
+
backgroundColor: "#1e1e1e",
|
|
540
|
+
borderRadius: 1,
|
|
541
|
+
}}
|
|
542
|
+
/>
|
|
543
|
+
<View
|
|
544
|
+
style={{
|
|
545
|
+
width: 3.5,
|
|
546
|
+
height: 16,
|
|
547
|
+
backgroundColor: "#1e1e1e",
|
|
548
|
+
borderRadius: 1,
|
|
549
|
+
}}
|
|
550
|
+
/>
|
|
551
|
+
</View>
|
|
552
|
+
) : (
|
|
553
|
+
<View
|
|
554
|
+
style={{
|
|
555
|
+
width: 0,
|
|
556
|
+
height: 0,
|
|
557
|
+
backgroundColor: "transparent",
|
|
558
|
+
borderStyle: "solid",
|
|
559
|
+
borderLeftWidth: 14,
|
|
560
|
+
borderRightWidth: 0,
|
|
561
|
+
borderTopWidth: 8,
|
|
562
|
+
borderBottomWidth: 8,
|
|
563
|
+
borderLeftColor: "#1e1e1e",
|
|
564
|
+
borderRightColor: "transparent",
|
|
565
|
+
borderTopColor: "transparent",
|
|
566
|
+
borderBottomColor: "transparent",
|
|
567
|
+
marginLeft: 3,
|
|
568
|
+
}}
|
|
569
|
+
/>
|
|
570
|
+
)}
|
|
571
|
+
</View>
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
case "drag": {
|
|
576
|
+
return (
|
|
577
|
+
<View
|
|
578
|
+
style={{
|
|
579
|
+
width: 20,
|
|
580
|
+
height: 12,
|
|
581
|
+
justifyContent: "space-between",
|
|
582
|
+
}}
|
|
583
|
+
>
|
|
584
|
+
<View
|
|
585
|
+
style={{
|
|
586
|
+
height: 2,
|
|
587
|
+
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
588
|
+
borderRadius: 1,
|
|
589
|
+
}}
|
|
590
|
+
/>
|
|
591
|
+
<View
|
|
592
|
+
style={{
|
|
593
|
+
height: 2,
|
|
594
|
+
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
595
|
+
borderRadius: 1,
|
|
596
|
+
}}
|
|
597
|
+
/>
|
|
598
|
+
<View
|
|
599
|
+
style={{
|
|
600
|
+
height: 2,
|
|
601
|
+
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
602
|
+
borderRadius: 1,
|
|
603
|
+
}}
|
|
604
|
+
/>
|
|
605
|
+
</View>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
case "remove": {
|
|
610
|
+
return (
|
|
611
|
+
<View
|
|
612
|
+
style={{
|
|
613
|
+
width: 24,
|
|
614
|
+
height: 24,
|
|
615
|
+
borderRadius: 12,
|
|
616
|
+
borderWidth: 1.5,
|
|
617
|
+
borderColor: "rgba(255, 255, 255, 0.7)",
|
|
618
|
+
justifyContent: "center",
|
|
619
|
+
alignItems: "center",
|
|
620
|
+
}}
|
|
621
|
+
>
|
|
622
|
+
<View
|
|
623
|
+
style={{
|
|
624
|
+
width: 10,
|
|
625
|
+
height: 1.5,
|
|
626
|
+
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
627
|
+
borderRadius: 1,
|
|
628
|
+
}}
|
|
629
|
+
/>
|
|
630
|
+
</View>
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
case "multiSelect": {
|
|
635
|
+
if (!isSelected) {
|
|
636
|
+
return (
|
|
637
|
+
<View
|
|
638
|
+
style={{
|
|
639
|
+
width: layout.assetWidth,
|
|
640
|
+
height: layout.assetHeight,
|
|
641
|
+
borderRadius: layout.assetWidth / 2,
|
|
642
|
+
borderWidth: 1.5,
|
|
643
|
+
borderColor: "rgba(255, 255, 255, 0.7)",
|
|
644
|
+
backgroundColor: "transparent",
|
|
645
|
+
}}
|
|
646
|
+
/>
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
return (
|
|
651
|
+
<View
|
|
652
|
+
style={{
|
|
653
|
+
width: 24,
|
|
654
|
+
height: 24,
|
|
655
|
+
borderRadius: 12,
|
|
656
|
+
backgroundColor: "#FFFFFF",
|
|
657
|
+
justifyContent: "center",
|
|
658
|
+
alignItems: "center",
|
|
659
|
+
}}
|
|
660
|
+
>
|
|
661
|
+
<View
|
|
662
|
+
style={{
|
|
663
|
+
width: 6,
|
|
664
|
+
height: 10,
|
|
665
|
+
borderBottomWidth: 2,
|
|
666
|
+
borderRightWidth: 2,
|
|
667
|
+
borderColor: "#1e1e1e",
|
|
668
|
+
transform: [{ rotate: "45deg" }],
|
|
669
|
+
marginTop: -2,
|
|
670
|
+
}}
|
|
671
|
+
/>
|
|
672
|
+
</View>
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
default:
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
494
681
|
return (
|
|
495
|
-
<
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
682
|
+
<Pressable
|
|
683
|
+
onPress={onPress}
|
|
684
|
+
style={({ pressed }) => [
|
|
685
|
+
{
|
|
686
|
+
paddingTop: layout.paddingTop,
|
|
687
|
+
paddingRight: layout.paddingRight,
|
|
688
|
+
paddingBottom: layout.paddingBottom,
|
|
689
|
+
paddingLeft: layout.paddingLeft,
|
|
690
|
+
opacity: pressed || focused ? 0.7 : 1,
|
|
691
|
+
},
|
|
692
|
+
]}
|
|
503
693
|
>
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
style={{ width: layout.assetWidth, height: layout.assetHeight }}
|
|
507
|
-
resizeMode="contain"
|
|
508
|
-
/>
|
|
509
|
-
</View>
|
|
694
|
+
{renderIcon()}
|
|
695
|
+
</Pressable>
|
|
510
696
|
);
|
|
511
697
|
}
|
|
512
698
|
|
|
@@ -515,6 +701,9 @@ type ItemButtonsProps = {
|
|
|
515
701
|
trailingButton?: ItemButtonAction;
|
|
516
702
|
focusedLeadingButton?: boolean;
|
|
517
703
|
focusedTrailingButton?: boolean;
|
|
704
|
+
onLeadingButtonPress?: () => void;
|
|
705
|
+
onTrailingButtonPress?: () => void;
|
|
706
|
+
isSelected?: boolean;
|
|
518
707
|
};
|
|
519
708
|
|
|
520
709
|
function ItemButtons({
|
|
@@ -522,6 +711,9 @@ function ItemButtons({
|
|
|
522
711
|
trailingButton,
|
|
523
712
|
focusedLeadingButton = false,
|
|
524
713
|
focusedTrailingButton = false,
|
|
714
|
+
onLeadingButtonPress,
|
|
715
|
+
onTrailingButtonPress,
|
|
716
|
+
isSelected = false,
|
|
525
717
|
}: ItemButtonsProps) {
|
|
526
718
|
if (!leadingButton && !trailingButton) {
|
|
527
719
|
return null;
|
|
@@ -531,28 +723,41 @@ function ItemButtons({
|
|
|
531
723
|
<View style={styles.buttonsRow}>
|
|
532
724
|
{leadingButton ? (
|
|
533
725
|
<>
|
|
534
|
-
<ItemButton
|
|
726
|
+
<ItemButton
|
|
727
|
+
action={leadingButton}
|
|
728
|
+
focused={focusedLeadingButton}
|
|
729
|
+
onPress={onLeadingButtonPress}
|
|
730
|
+
isSelected={isSelected}
|
|
731
|
+
/>
|
|
535
732
|
<View style={{ width: BUTTONS_CONTAINER_HORIZONTAL_GUTTER }} />
|
|
536
733
|
</>
|
|
537
734
|
) : null}
|
|
538
735
|
{trailingButton ? (
|
|
539
|
-
<ItemButton
|
|
736
|
+
<ItemButton
|
|
737
|
+
action={trailingButton}
|
|
738
|
+
focused={focusedTrailingButton}
|
|
739
|
+
onPress={onTrailingButtonPress}
|
|
740
|
+
isSelected={isSelected}
|
|
741
|
+
/>
|
|
540
742
|
) : null}
|
|
541
743
|
</View>
|
|
542
744
|
);
|
|
543
745
|
}
|
|
544
746
|
|
|
545
747
|
// ---------------------------------------------------------------------------
|
|
546
|
-
//
|
|
748
|
+
// AudioPlayerTrackItem
|
|
547
749
|
// ---------------------------------------------------------------------------
|
|
548
750
|
|
|
549
|
-
export function
|
|
751
|
+
export function AudioPlayerTrackItem({
|
|
550
752
|
configuration,
|
|
551
753
|
data,
|
|
552
754
|
focused = false,
|
|
553
755
|
focusedLeadingButton = false,
|
|
554
756
|
focusedTrailingButton = false,
|
|
555
|
-
|
|
757
|
+
onPress,
|
|
758
|
+
onLeadingButtonPress,
|
|
759
|
+
onTrailingButtonPress,
|
|
760
|
+
}: AudioPlayerTrackItemProps) {
|
|
556
761
|
const {
|
|
557
762
|
background,
|
|
558
763
|
image,
|
|
@@ -566,7 +771,12 @@ export function Item({
|
|
|
566
771
|
const showNowPlaying = !!data.nowPlayingLabel;
|
|
567
772
|
|
|
568
773
|
return (
|
|
569
|
-
<ItemContainer
|
|
774
|
+
<ItemContainer
|
|
775
|
+
image={image}
|
|
776
|
+
background={background}
|
|
777
|
+
focused={focused}
|
|
778
|
+
onPress={onPress}
|
|
779
|
+
>
|
|
570
780
|
<View style={styles.row}>
|
|
571
781
|
<ItemThumbnail configuration={image} imageUri={data.imageUri} />
|
|
572
782
|
<View style={{ width: container.horizontalGutter }} />
|
|
@@ -594,6 +804,9 @@ export function Item({
|
|
|
594
804
|
trailingButton={data.trailingButton}
|
|
595
805
|
focusedLeadingButton={focusedLeadingButton}
|
|
596
806
|
focusedTrailingButton={focusedTrailingButton}
|
|
807
|
+
onLeadingButtonPress={onLeadingButtonPress}
|
|
808
|
+
onTrailingButtonPress={onTrailingButtonPress}
|
|
809
|
+
isSelected={data.isSelected}
|
|
597
810
|
/>
|
|
598
811
|
</View>
|
|
599
812
|
</ItemContainer>
|
|
@@ -663,47 +876,3 @@ export const VARIANT_PLAYLIST_ITEM: ItemConfiguration = {
|
|
|
663
876
|
textLabel1: DEFAULT_TEXT_LABEL_1_CONFIGURATION,
|
|
664
877
|
textLabel2: DEFAULT_TEXT_LABEL_2_CONFIGURATION,
|
|
665
878
|
};
|
|
666
|
-
|
|
667
|
-
export default function App() {
|
|
668
|
-
// Hardcoded core mock data objects matching user types framework
|
|
669
|
-
const sharedMockItem: MenuItem = {
|
|
670
|
-
title: "Content Title",
|
|
671
|
-
summary: "Artist",
|
|
672
|
-
icon: "https://picsum.photos/200",
|
|
673
|
-
action: { type: "PLAY_AUDIO" },
|
|
674
|
-
secondaryAction: { action: { type: "OPEN_CONTEXT_MENU" } },
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
const playlistMockItem: MenuItem = {
|
|
678
|
-
title: "Playlist Name",
|
|
679
|
-
summary: "12 Songs",
|
|
680
|
-
icon: "https://picsum.photos/201",
|
|
681
|
-
isSelected: true,
|
|
682
|
-
action: { type: "NAVIGATE_PLAYLIST" },
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
return (
|
|
686
|
-
<View style={styles.demoScreen}>
|
|
687
|
-
<Text style={styles.demoHeading}>Modal Item Building Block</Text>
|
|
688
|
-
|
|
689
|
-
<Text style={styles.demoLabel}>Now Playing</Text>
|
|
690
|
-
<Item
|
|
691
|
-
configuration={VARIANT_NOW_PLAYING}
|
|
692
|
-
data={mapMenuItemToNowPlayingData(sharedMockItem)}
|
|
693
|
-
/>
|
|
694
|
-
|
|
695
|
-
<Text style={styles.demoLabel}>Queued Item</Text>
|
|
696
|
-
<Item
|
|
697
|
-
configuration={VARIANT_QUEUED_ITEM}
|
|
698
|
-
data={mapMenuItemToQueuedData(sharedMockItem)}
|
|
699
|
-
focused
|
|
700
|
-
/>
|
|
701
|
-
|
|
702
|
-
<Text style={styles.demoLabel}>Playlist Item</Text>
|
|
703
|
-
<Item
|
|
704
|
-
configuration={VARIANT_PLAYLIST_ITEM}
|
|
705
|
-
data={mapMenuItemToPlaylistData(playlistMockItem)}
|
|
706
|
-
/>
|
|
707
|
-
</View>
|
|
708
|
-
);
|
|
709
|
-
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { AudioPlayerAction } from "./Action";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { AudioPlayerButton } from "./Button";
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export { AudioPlayerHeader } from "./Header";
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { AudioPlayerTrackItem } from "./Item";
|
|
8
|
+
|
|
9
|
+
export { AudioPlayerInput } from "./Input";
|
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.36",
|
|
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.36",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.36",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "16.0.0-rc.36",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "16.0.0-rc.36",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"url": "^0.11.0",
|