@applicaster/zapp-react-native-ui-components 16.0.0-alpha.1535029240 → 16.0.0-alpha.1701179921

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.
Files changed (92) hide show
  1. package/Components/AudioPlayer/tv/__tests__/audioPlayer.test.js +19 -0
  2. package/Components/AudioPlayer/tv/__tests__/index.test.tsx +120 -0
  3. package/Components/AudioPlayer/tv/index.tsx +5 -1
  4. package/Components/Cell/Cell.tsx +3 -6
  5. package/Components/Cell/TvOSCellComponent.tsx +0 -1
  6. package/Components/GeneralContentScreen/GeneralContentScreenHookAdapter.tsx +15 -0
  7. package/Components/GeneralContentScreen/hookAdapter/__tests__/skipExpression.test.ts +294 -0
  8. package/Components/GeneralContentScreen/hookAdapter/__tests__/validationHelper.test.ts +64 -0
  9. package/Components/GeneralContentScreen/hookAdapter/skipExpression.ts +252 -0
  10. package/Components/GeneralContentScreen/hookAdapter/validationHelper.ts +18 -0
  11. package/Components/LinkHandler/LinkHandler.tsx +2 -7
  12. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +5 -1
  13. package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/ActionButtonController.tsx +19 -4
  14. package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/__tests__/ActionButtonController.test.tsx +43 -1
  15. package/Components/MasterCell/DefaultComponents/Button.tsx +1 -0
  16. package/Components/MasterCell/DefaultComponents/Image/hoc/utils/__tests__/withDimensions.test.ts +420 -125
  17. package/Components/MasterCell/DefaultComponents/Image/hoc/utils/index.ts +114 -19
  18. package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +19 -8
  19. package/Components/MasterCell/DefaultComponents/LiveImage/executePreloadHooks.ts +2 -4
  20. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -3
  21. package/Components/MasterCell/DefaultComponents/Toggle.tsx +36 -14
  22. package/Components/MasterCell/DefaultComponents/__tests__/Toggle.test.tsx +167 -0
  23. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/factory.test.ts +32 -0
  24. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +1 -2
  25. package/Components/ModalComponent/ActionsBottomSheet/ActionButton.tsx +56 -0
  26. package/Components/ModalComponent/ActionsBottomSheet/__tests__/openActionsBottomSheet.test.ts +38 -0
  27. package/Components/ModalComponent/ActionsBottomSheet/boundActionButton.tsx +24 -0
  28. package/Components/ModalComponent/ActionsBottomSheet/index.ts +9 -0
  29. package/Components/ModalComponent/ActionsBottomSheet/openActionsBottomSheet.ts +61 -0
  30. package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +87 -97
  31. package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +87 -126
  32. package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +140 -83
  33. package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +252 -123
  34. package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +205 -0
  35. package/Components/ModalComponent/AudioPlayer/Components/__tests__/Item.test.tsx +113 -0
  36. package/Components/ModalComponent/AudioPlayer/Components/__tests__/NowPlayingHeaderSection.test.tsx +36 -0
  37. package/Components/ModalComponent/AudioPlayer/Components/index.ts +3 -3
  38. package/Components/ModalComponent/AudioPlayer/utils/__tests__/mergeStyles.test.ts +356 -0
  39. package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +521 -0
  40. package/Components/ModalComponent/BottomSheetDragArea.tsx +33 -0
  41. package/Components/ModalComponent/BottomSheetModalContent.tsx +505 -66
  42. package/Components/ModalComponent/Button/index.tsx +5 -3
  43. package/Components/ModalComponent/Header/CloseButton.tsx +12 -0
  44. package/Components/ModalComponent/Header/__tests__/CloseButton.test.tsx +72 -0
  45. package/Components/ModalComponent/Header/index.tsx +20 -7
  46. package/Components/ModalComponent/Header/utils.ts +1 -1
  47. package/Components/ModalComponent/ModalBlocksStyleContext.tsx +10 -0
  48. package/Components/ModalComponent/SortableList.tsx +156 -0
  49. package/Components/ModalComponent/SortableList.web.tsx +34 -0
  50. package/Components/ModalComponent/TextInputContent.tsx +135 -0
  51. package/Components/ModalComponent/__tests__/BottomSheetDragArea.test.tsx +74 -0
  52. package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +343 -0
  53. package/Components/ModalComponent/__tests__/SortableList.web.test.tsx +16 -0
  54. package/Components/ModalComponent/__tests__/TextInputContent.test.tsx +169 -0
  55. package/Components/ModalComponent/__tests__/showTextInput.test.ts +95 -0
  56. package/Components/ModalComponent/index.tsx +18 -9
  57. package/Components/ModalComponent/presets/__tests__/getCell.test.ts +90 -0
  58. package/Components/ModalComponent/presets/dynamicCollectionCell.tsx +78 -0
  59. package/Components/ModalComponent/presets/index.ts +27 -0
  60. package/Components/ModalComponent/presets/selectableCell.tsx +28 -0
  61. package/Components/ModalComponent/presets/standardCell.tsx +41 -0
  62. package/Components/ModalComponent/presets/types.ts +35 -0
  63. package/Components/ModalComponent/showTextInput.ts +52 -0
  64. package/Components/ModalComponent/utils.ts +82 -21
  65. package/Components/OfflineHandler/hooks.ts +0 -12
  66. package/Components/PlayerContainer/PlayerContainer.tsx +19 -8
  67. package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -4
  68. package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +66 -13
  69. package/Components/River/ComponentsMap/ComponentsMap.tsx +85 -59
  70. package/Components/River/River.tsx +4 -0
  71. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +138 -75
  72. package/Components/River/__tests__/componentsMap.test.js +8 -3
  73. package/Components/River/__tests__/resultCallback.test.tsx +47 -0
  74. package/Components/Screen/__tests__/Screen.test.tsx +24 -0
  75. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -0
  76. package/Components/Screen/index.tsx +5 -0
  77. package/Components/Screen/navigationHandler.ts +8 -8
  78. package/Components/ScreenRevealManager/ScreenRevealManager.ts +18 -2
  79. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +36 -0
  80. package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +56 -0
  81. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +21 -4
  82. package/Components/Transitioner/Transitioner.tsx +2 -3
  83. package/Components/Transitioner/__tests__/transitioner.test.js +83 -2
  84. package/Components/VideoLive/LiveImageManager.ts +9 -3
  85. package/Components/VideoLive/__tests__/LiveImageManager.test.ts +59 -0
  86. package/Contexts/ModalNavigationContext/__tests__/index.test.tsx +15 -0
  87. package/Contexts/ModalNavigationContext/index.tsx +2 -2
  88. package/Hooks/useEntryActionsExpander.ts +63 -0
  89. package/assets/empty-Info.png +0 -0
  90. package/package.json +6 -5
  91. package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +0 -332
  92. /package/Decorators/ZappPipesDataConnector/__tests__/{Hero.js → Hero.tsx} +0 -0
@@ -18,11 +18,42 @@ import {
18
18
  View,
19
19
  } from "react-native";
20
20
 
21
+ import { resolveDefaultAssetUri } from "@applicaster/zapp-react-native-utils/actionUtils";
22
+
21
23
  const styles = StyleSheet.create({
22
24
  column: {
23
25
  alignItems: "center",
24
26
  width: "100%",
25
27
  },
28
+ validationMessage: {
29
+ flexDirection: "row",
30
+ alignItems: "center",
31
+ alignSelf: "center",
32
+ overflow: "hidden",
33
+ backgroundColor: "rgba(229,30,37,1.00)",
34
+ borderRadius: 100,
35
+ marginTop: 16,
36
+ paddingLeft: 8,
37
+ paddingRight: 12,
38
+ paddingTop: 8,
39
+ paddingBottom: 8,
40
+ gap: 8,
41
+ },
42
+ validationMessageIcon: {
43
+ width: 20,
44
+ height: 20,
45
+ alignSelf: "flex-start",
46
+ },
47
+ validationMessageText: {
48
+ color: "rgba(255,255,255,1.00)",
49
+ fontFamily: Platform.select({
50
+ ios: "GreycliffCF-Bold",
51
+ android: "Greycliff-Bold",
52
+ default: "Greycliff-Bold",
53
+ }),
54
+ fontSize: 13,
55
+ lineHeight: 20,
56
+ },
26
57
  textInput: {
27
58
  padding: 0,
28
59
  margin: 0,
@@ -37,24 +68,6 @@ const styles = StyleSheet.create({
37
68
  underline: {
38
69
  alignSelf: "stretch",
39
70
  },
40
- demoScreen: {
41
- flex: 1,
42
- backgroundColor: "#1C1C1E",
43
- paddingTop: 64,
44
- paddingHorizontal: 16,
45
- gap: 24,
46
- },
47
- demoHeading: {
48
- color: "#FFFFFF",
49
- fontSize: 20,
50
- fontWeight: "600",
51
- marginBottom: 8,
52
- },
53
- demoLabel: {
54
- color: "#999999",
55
- fontSize: 13,
56
- marginTop: 8,
57
- },
58
71
  });
59
72
 
60
73
  // ---------------------------------------------------------------------------
@@ -69,14 +82,22 @@ export type TextTransform =
69
82
 
70
83
  export type TextAlignment = "left" | "center";
71
84
 
85
+ export type UnderlineConfiguration = {
86
+ focusedBorderColor: string;
87
+ borderColor: string;
88
+ /** Bottom underline height; 0 = none (pill search uses borderWidth instead) */
89
+ underlineHeight: number;
90
+ underlineMarginTop: number;
91
+ /** Radius of the underline bar itself (bottom border style). */
92
+ underlineCornerRadius: number;
93
+ };
94
+
72
95
  export type BackgroundConfiguration = {
73
96
  defaultColor: string;
74
97
  focusedColor: string;
75
98
  borderColor: string;
76
99
  focusedBorderColor: string;
77
100
  borderWidth: number;
78
- /** Bottom underline height; 0 = none (pill search uses borderWidth instead) */
79
- underlineHeight: number;
80
101
  cornerRadius: number;
81
102
  paddingTop: number;
82
103
  paddingRight: number;
@@ -113,6 +134,9 @@ export type TextConfiguration = {
113
134
  androidLetterSpacing: number;
114
135
  textTransform: TextTransform;
115
136
  alignment: TextAlignment;
137
+ /** Vertical spacing around the input text; drives the gap above the underline. */
138
+ marginTop: number;
139
+ marginBottom: number;
116
140
  };
117
141
 
118
142
  export type LeadingIconConfiguration = {
@@ -135,6 +159,7 @@ export type IconsConfiguration = {
135
159
  };
136
160
 
137
161
  export type InputConfiguration = {
162
+ underline: UnderlineConfiguration;
138
163
  background: BackgroundConfiguration;
139
164
  label: LabelConfiguration;
140
165
  text: TextConfiguration;
@@ -147,7 +172,6 @@ export const DEFAULT_BACKGROUND_CONFIGURATION: BackgroundConfiguration = {
147
172
  borderColor: "rgba(255, 255, 255, 0.55)",
148
173
  focusedBorderColor: "rgba(255, 255, 255, 0.85)",
149
174
  borderWidth: 1,
150
- underlineHeight: 0,
151
175
  cornerRadius: 24,
152
176
  paddingTop: 10,
153
177
  paddingRight: 10,
@@ -183,6 +207,8 @@ export const DEFAULT_TEXT_CONFIGURATION: TextConfiguration = {
183
207
  androidLetterSpacing: 0,
184
208
  textTransform: "default",
185
209
  alignment: "left",
210
+ marginTop: 0,
211
+ marginBottom: 0,
186
212
  };
187
213
 
188
214
  export const DEFAULT_ICONS_CONFIGURATION: IconsConfiguration = {
@@ -198,8 +224,17 @@ export const DEFAULT_ICONS_CONFIGURATION: IconsConfiguration = {
198
224
  },
199
225
  };
200
226
 
227
+ export const DEFAULT_UNDERLINE_CONFIGURATION: UnderlineConfiguration = {
228
+ borderColor: "rgba(255, 255, 255, 0.55)",
229
+ focusedBorderColor: "rgba(255, 255, 255, 0.85)",
230
+ underlineHeight: 0,
231
+ underlineMarginTop: 0,
232
+ underlineCornerRadius: 0,
233
+ };
234
+
201
235
  export const DEFAULT_INPUT_CONFIGURATION: InputConfiguration = {
202
236
  background: DEFAULT_BACKGROUND_CONFIGURATION,
237
+ underline: DEFAULT_UNDERLINE_CONFIGURATION,
203
238
  label: DEFAULT_LABEL_CONFIGURATION,
204
239
  text: DEFAULT_TEXT_CONFIGURATION,
205
240
  icons: DEFAULT_ICONS_CONFIGURATION,
@@ -221,6 +256,7 @@ export type ItemProps = {
221
256
  value?: string;
222
257
  focused?: boolean;
223
258
  focusedClearButton?: boolean;
259
+ validationMessage?: string;
224
260
  onChangeText?: (text: string) => void;
225
261
  onClearPress?: () => void;
226
262
  onFocus?: () => void;
@@ -261,7 +297,7 @@ function shouldShowLabel(label: LabelConfiguration, labelText?: string) {
261
297
  }
262
298
 
263
299
  function isUnderlineLayout(configuration: InputConfiguration) {
264
- return configuration.background.underlineHeight > 0;
300
+ return configuration.underline.underlineHeight > 0;
265
301
  }
266
302
 
267
303
  // ---------------------------------------------------------------------------
@@ -341,7 +377,7 @@ function InputContainer({
341
377
  }
342
378
 
343
379
  type InputUnderlineProps = {
344
- configuration: BackgroundConfiguration;
380
+ configuration: UnderlineConfiguration;
345
381
  focused: boolean;
346
382
  };
347
383
 
@@ -355,7 +391,9 @@ function InputUnderline({ configuration, focused }: InputUnderlineProps) {
355
391
  style={[
356
392
  styles.underline,
357
393
  {
394
+ marginTop: configuration.underlineMarginTop,
358
395
  height: configuration.underlineHeight,
396
+ borderRadius: configuration.underlineCornerRadius,
359
397
  backgroundColor: focused
360
398
  ? configuration.focusedBorderColor
361
399
  : configuration.borderColor,
@@ -445,6 +483,8 @@ function InputField({
445
483
  }),
446
484
  textTransform: getTextTransformStyle(configuration.textTransform),
447
485
  textAlign: configuration.alignment,
486
+ marginTop: configuration.marginTop,
487
+ marginBottom: configuration.marginBottom,
448
488
  },
449
489
  ]}
450
490
  />
@@ -497,12 +537,13 @@ export function AudioPlayerInput({
497
537
  value = "",
498
538
  focused = false,
499
539
  focusedClearButton = false,
540
+ validationMessage,
500
541
  onChangeText,
501
542
  onClearPress,
502
543
  onFocus,
503
544
  onBlur,
504
545
  }: ItemProps) {
505
- const { background, label, text, icons } = configuration;
546
+ const { background, label, text, icons, underline } = configuration;
506
547
  const inputRef = useRef<TextInputRef>(null);
507
548
  const underlineLayout = isUnderlineLayout(configuration);
508
549
  const showLabel = shouldShowLabel(label, data.label);
@@ -563,109 +604,125 @@ export function AudioPlayerInput({
563
604
  </>
564
605
  ) : null}
565
606
  {underlineLayout ? (
566
- <InputUnderline configuration={background} focused={focused} />
607
+ <InputUnderline configuration={underline} focused={focused} />
567
608
  ) : null}
568
609
  </InputContainer>
569
610
  </Pressable>
570
611
  );
571
612
 
572
- if (!showLabel || !data.label) {
573
- return inputRow;
574
- }
575
-
576
613
  return (
577
614
  <View style={styles.column}>
578
- <InputLabel text={data.label} configuration={label} />
579
- <View style={{ height: background.verticalGutter }} />
615
+ {showLabel && data.label ? (
616
+ <>
617
+ <InputLabel text={data.label} configuration={label} />
618
+ <View style={{ height: background.verticalGutter }} />
619
+ </>
620
+ ) : null}
580
621
  {inputRow}
622
+ {validationMessage ? (
623
+ <View style={styles.validationMessage} accessibilityRole="alert">
624
+ <Image
625
+ source={{
626
+ uri: resolveDefaultAssetUri(
627
+ require("../../../../assets/empty-Info.png")
628
+ ),
629
+ }}
630
+ style={styles.validationMessageIcon}
631
+ />
632
+ <Text
633
+ style={styles.validationMessageText}
634
+ numberOfLines={1}
635
+ ellipsizeMode="tail"
636
+ >
637
+ {validationMessage}
638
+ </Text>
639
+ </View>
640
+ ) : null}
581
641
  </View>
582
642
  );
583
643
  }
584
644
 
585
645
  // ---------------------------------------------------------------------------
586
- // Variant presets — collections of configuration keys (not a variant field)
646
+ // Variant configurations
587
647
  // ---------------------------------------------------------------------------
588
648
 
589
649
  /** Search pill — leading icon + clear button */
590
650
  export const VARIANT_SEARCH_INPUT: InputConfiguration =
591
651
  DEFAULT_INPUT_CONFIGURATION;
592
652
 
593
- /** Name playlist — centered title + label + underline (screenshot) */
653
+ /**
654
+ * Name playlist — centered title + 32pt text over a rounded bottom underline.
655
+ *
656
+ * Values mirror the manifest configuration the
657
+ * `quick-brick-component-text-field` plugin renders from; the comment on each
658
+ * line names the reference key it comes from.
659
+ */
594
660
  export const VARIANT_NAME_PLAYLIST_INPUT: InputConfiguration = {
595
661
  background: {
596
- defaultColor: "transparent",
597
- focusedColor: "transparent",
598
- borderColor: "rgba(255, 255, 255, 0.35)",
599
- focusedBorderColor: "rgba(255, 255, 255, 0.55)",
662
+ // text_input_background_*_background_color
663
+ defaultColor: "rgba(30,30,30,0.00)",
664
+ focusedColor: "rgba(46,46,46,0.00)",
665
+ // text_input_style_border_*_border_color
666
+ borderColor: "rgba(255,255,255,0.25)",
667
+ focusedBorderColor: "rgba(255,255,255,1.00)",
668
+ // border_border_style is "bottom", so the box border is off and the
669
+ // underline below draws the border instead.
600
670
  borderWidth: 0,
601
- underlineHeight: 1,
602
671
  cornerRadius: 0,
672
+ // text_input_style_input_padding_*
603
673
  paddingTop: 0,
604
674
  paddingRight: 0,
605
- paddingBottom: 10,
675
+ paddingBottom: 0,
606
676
  paddingLeft: 0,
607
- horizontalGutter: 0,
608
- verticalGutter: 16,
609
- height: 0,
677
+ horizontalGutter: 0, // text_input_style_input_horizontal_gutter
678
+ verticalGutter: 0, // component_style_vertical_gutter
679
+ height: 0, // hug content
680
+ },
681
+ underline: {
682
+ borderColor: "rgba(255,255,255,0.25)",
683
+ focusedBorderColor: "rgba(255,255,255,1.00)",
684
+ underlineHeight: 2, // text_input_style_border_border_size
685
+ // The gap above the bar comes from the text's marginBottom, matching how
686
+ // the plugin applies `text_label_margin_bottom` to the input itself.
687
+ underlineMarginTop: 0,
688
+ underlineCornerRadius: 4, // ..._border_bottom_border_corner_radius
610
689
  },
611
690
  label: {
612
- enabled: true,
613
- fontColor: "rgba(142, 142, 147, 1)",
614
- iosFontFamily: "SFProText-Regular",
615
- androidFontFamily: "Roboto",
616
- fontSize: 15,
617
- lineHeight: 20,
618
- iosLetterSpacing: -0.2,
691
+ enabled: true, // title_enable
692
+ fontColor: "rgba(255,255,255,0.50)", // title_style_color
693
+ iosFontFamily: "GreycliffCF-Bold", // title_style_ios_font_family
694
+ androidFontFamily: "Greycliff-Bold", // title_style_android_font_family
695
+ fontSize: 14, // title_style_font_size
696
+ lineHeight: 32, // title_style_line_height
697
+ iosLetterSpacing: 0,
619
698
  androidLetterSpacing: 0,
620
- textTransform: "default",
699
+ textTransform: "default", // title_style_text_transform: "none"
621
700
  },
622
701
  text: {
623
- fontColor: "#FFFFFF",
624
- focusedFontColor: "#FFFFFF",
625
- placeholderColor: "rgba(142, 142, 147, 1)",
626
- cursorColor: "#FFFFFF",
627
- iosFontFamily: "SFProText-Bold",
628
- androidFontFamily: "Roboto-Bold",
702
+ // text_input_style_text_label_*
703
+ fontColor: "rgba(255,255,255,1.00)", // active_label_color
704
+ focusedFontColor: "rgba(255,255,255,1.00)",
705
+ placeholderColor: "rgba(255,255,255,0.50)", // placeholder_label_color
706
+ cursorColor: "rgba(249,183,72,1.00)", // text_input_style_cursor_cursor_color
707
+ iosFontFamily: "GreycliffCF-Bold",
708
+ androidFontFamily: "Greycliff-Bold",
629
709
  fontSize: 32,
630
710
  lineHeight: 40,
631
- iosLetterSpacing: -0.6,
711
+ iosLetterSpacing: 0,
632
712
  androidLetterSpacing: 0,
633
713
  textTransform: "default",
634
714
  alignment: "center",
715
+ marginTop: 20, // text_label_margin_top
716
+ marginBottom: 20, // text_label_margin_bottom
635
717
  },
636
718
  icons: {
637
719
  width: 20,
638
720
  height: 20,
639
721
  leadingIcon: { enabled: false },
640
722
  trailingIcon: {
641
- enabled: false,
723
+ enabled: false, // clear_button_enable
642
724
  backgroundColor: "rgba(58, 58, 60, 1)",
643
725
  focusedBackgroundColor: "rgba(72, 72, 74, 1)",
644
726
  },
645
727
  },
646
728
  };
647
-
648
- /** Text only search pill — no leading icon */
649
- export const VARIANT_TEXT_ONLY_INPUT: InputConfiguration = {
650
- background: DEFAULT_BACKGROUND_CONFIGURATION,
651
- label: DEFAULT_LABEL_CONFIGURATION,
652
- text: DEFAULT_TEXT_CONFIGURATION,
653
- icons: {
654
- ...DEFAULT_ICONS_CONFIGURATION,
655
- leadingIcon: { enabled: false },
656
- },
657
- };
658
-
659
- /** Search without clear button */
660
- export const VARIANT_SEARCH_WITHOUT_CLEAR: InputConfiguration = {
661
- background: DEFAULT_BACKGROUND_CONFIGURATION,
662
- label: DEFAULT_LABEL_CONFIGURATION,
663
- text: DEFAULT_TEXT_CONFIGURATION,
664
- icons: {
665
- ...DEFAULT_ICONS_CONFIGURATION,
666
- trailingIcon: {
667
- ...DEFAULT_ICONS_CONFIGURATION.trailingIcon,
668
- enabled: false,
669
- },
670
- },
671
- };