@applicaster/zapp-react-native-utils 13.0.0-rc.14 → 13.0.0-rc.141

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 (185) hide show
  1. package/README.md +0 -10
  2. package/actionsExecutor/ActionExecutor.ts +16 -9
  3. package/actionsExecutor/ActionExecutorContext.tsx +214 -16
  4. package/actionsExecutor/consts.ts +4 -0
  5. package/alertUtils/alert.ts +148 -0
  6. package/alertUtils/index.ts +1 -148
  7. package/analyticsUtils/AnalyticPlayerListener.ts +18 -1
  8. package/analyticsUtils/__tests__/__snapshots__/analyticsManagerNoModule.test.js.snap +9 -9
  9. package/analyticsUtils/currentScreenProperities.ts +6 -4
  10. package/analyticsUtils/helpers/hooks.ts +1 -1
  11. package/appUtils/HooksManager/Hook.ts +6 -2
  12. package/appUtils/HooksManager/__tests__/__snapshots__/hook.test.js.snap +7 -7
  13. package/appUtils/HooksManager/__tests__/__snapshots__/hooksManager.test.js.snap +186 -186
  14. package/appUtils/HooksManager/index.ts +3 -1
  15. package/appUtils/HooksManager/types.ts +5 -2
  16. package/appUtils/__tests__/__snapshots__/localizationsHelper.test.ts.snap +151 -0
  17. package/appUtils/__tests__/allZappLocales.ts +79 -0
  18. package/appUtils/__tests__/{localizationsHelper.test.js → localizationsHelper.test.ts} +11 -0
  19. package/appUtils/accessibilityManager/const.ts +18 -0
  20. package/appUtils/accessibilityManager/index.ts +46 -2
  21. package/appUtils/contextKeysManager/contextResolver.ts +66 -0
  22. package/appUtils/contextKeysManager/index.ts +2 -2
  23. package/appUtils/contextKeysManager/utils/index.ts +2 -1
  24. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +9 -6
  25. package/appUtils/focusManager/index.ios.ts +14 -4
  26. package/appUtils/focusManager/index.ts +108 -69
  27. package/appUtils/focusManager/treeDataStructure/Tree/index.js +23 -0
  28. package/appUtils/focusManager/utils/__tests__/findChild.test.ts +35 -0
  29. package/appUtils/focusManager/utils/enums.ts +4 -0
  30. package/appUtils/focusManager/utils/index.ts +5 -0
  31. package/appUtils/focusManagerAux/utils/index.ts +4 -3
  32. package/appUtils/keyCodes/__tests__/__snapshots__/keyCodes.test.js.snap +2 -2
  33. package/appUtils/keyCodes/__tests__/keyCodes.test.js +1 -1
  34. package/appUtils/keyCodes/index.ts +11 -7
  35. package/appUtils/keyCodes/keys/keysByPlatform.ts +4 -0
  36. package/appUtils/keyInputHandler/KeyInputHandler.ts +68 -0
  37. package/appUtils/localizationsHelper.ts +31 -0
  38. package/appUtils/orientationHelper.ts +11 -13
  39. package/appUtils/platform/const.ts +14 -0
  40. package/appUtils/platform/platformUtils.ts +47 -4
  41. package/appUtils/playerManager/index.ts +1 -1
  42. package/appUtils/playerManager/player.ts +42 -18
  43. package/appUtils/playerManager/playerHooks/usePlayerCurrentTime.tsx +11 -7
  44. package/appUtils/playerManager/playerNative.ts +18 -2
  45. package/appUtils/playerManager/usePlayerControllerSetup.tsx +3 -3
  46. package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +7 -1
  47. package/arrayUtils/__tests__/__snapshots__/arrayUtils.test.ts.snap +4 -4
  48. package/arrayUtils/__tests__/isEmptyArray.test.ts +63 -0
  49. package/arrayUtils/__tests__/isFilledArray.test.ts +1 -1
  50. package/arrayUtils/index.ts +7 -2
  51. package/audioPlayerUtils/__tests__/getArtworkImage.test.ts +144 -0
  52. package/audioPlayerUtils/__tests__/getBackgroundImage.test.ts +72 -0
  53. package/audioPlayerUtils/__tests__/getImageFromEntry.test.ts +110 -0
  54. package/audioPlayerUtils/assets/index.ts +2 -0
  55. package/audioPlayerUtils/index.ts +242 -0
  56. package/cellUtils/index.ts +9 -5
  57. package/componentsUtils/__tests__/isFirstComponentGallery.test.ts +33 -0
  58. package/componentsUtils/__tests__/isFirstComponentScreenPicker.test.ts +33 -0
  59. package/componentsUtils/__tests__/isGallery.test.ts +33 -0
  60. package/componentsUtils/__tests__/isScreenPicker.test.ts +33 -0
  61. package/componentsUtils/index.ts +39 -0
  62. package/configurationUtils/__tests__/configurationUtils.test.js +0 -31
  63. package/configurationUtils/__tests__/getMediaItems.test.ts +65 -0
  64. package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +34 -0
  65. package/configurationUtils/index.ts +63 -34
  66. package/dateUtils/index.ts +19 -0
  67. package/equalUtils/__tests__/isEqual/combination.test.ts +263 -0
  68. package/equalUtils/index.ts +49 -30
  69. package/focusManager/FocusManager.ts +14 -2
  70. package/focusManager/index.ts +23 -4
  71. package/functionUtils/__tests__/__snapshots__/functionUtils.test.js.snap +4 -4
  72. package/functionUtils/index.ts +46 -8
  73. package/idleUtils/__tests__/withTimeout$.test.ts +37 -0
  74. package/idleUtils/index.ts +1 -1
  75. package/idleUtils/withTimeout.ts +15 -2
  76. package/index.d.ts +0 -12
  77. package/localizationUtils/index.ts +8 -13
  78. package/logger/const.ts +9 -67
  79. package/manifestUtils/__tests__/createConfig.test.js +16 -16
  80. package/manifestUtils/defaultManifestConfigurations/generalContent.js +13 -0
  81. package/manifestUtils/defaultManifestConfigurations/player.js +9 -3
  82. package/manifestUtils/fonts/index.js +5 -6
  83. package/manifestUtils/index.js +2 -0
  84. package/manifestUtils/keys.js +27 -2
  85. package/manifestUtils/sharedConfiguration/screenPicker/__tests__/utils.test.js +304 -0
  86. package/manifestUtils/sharedConfiguration/screenPicker/stylesFields.js +874 -0
  87. package/manifestUtils/sharedConfiguration/screenPicker/utils.js +130 -0
  88. package/modalState/__tests__/index.test.ts +51 -0
  89. package/modalState/index.ts +32 -2
  90. package/navigationUtils/__tests__/__snapshots__/navigationUtils.test.js.snap +7 -6
  91. package/navigationUtils/__tests__/itemTypes.test.js +2 -2
  92. package/navigationUtils/__tests__/navigationUtils.test.js +2 -2
  93. package/navigationUtils/index.ts +6 -4
  94. package/numberUtils/__tests__/toPositiveNumberWithDefault.test.ts +23 -3
  95. package/numberUtils/index.ts +11 -5
  96. package/package.json +5 -10
  97. package/playerUtils/configurationGenerator.ts +9 -11
  98. package/playerUtils/index.ts +23 -0
  99. package/reactHooks/advertising/index.ts +5 -5
  100. package/reactHooks/app/useAppState.ts +2 -2
  101. package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +1 -1
  102. package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +6 -8
  103. package/reactHooks/autoscrolling/useTrackedView.ts +12 -1
  104. package/reactHooks/cell-click/__tests__/index.test.js +10 -2
  105. package/reactHooks/cell-click/index.ts +7 -1
  106. package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +4 -4
  107. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +10 -11
  108. package/reactHooks/feed/useBatchLoading.ts +12 -14
  109. package/reactHooks/feed/useFeedLoader.tsx +18 -9
  110. package/reactHooks/feed/usePipesCacheReset.ts +5 -5
  111. package/reactHooks/flatList/__tests__/index.test.tsx +30 -21
  112. package/reactHooks/hookModal/hooks/useHookModalScreenData.ts +39 -0
  113. package/reactHooks/layout/__tests__/index.test.tsx +10 -10
  114. package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.native.test.js +14 -28
  115. package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.test.js +1 -1
  116. package/reactHooks/layout/useDimensions/useDimensions.ts +8 -0
  117. package/reactHooks/navigation/__mocks__/useNavigation.ts +3 -0
  118. package/reactHooks/navigation/__tests__/index.test.tsx +6 -21
  119. package/reactHooks/navigation/getTabBarHeight.ts +10 -0
  120. package/reactHooks/navigation/index.ts +34 -236
  121. package/reactHooks/navigation/useGetBottomTabBarHeight.ts +19 -0
  122. package/reactHooks/navigation/useGetNavBarTopBorderWidth.ts +14 -0
  123. package/reactHooks/navigation/useIsScreenActive.ts +17 -0
  124. package/reactHooks/navigation/useNavigationPluginData.ts +19 -0
  125. package/reactHooks/navigation/useNavigationType.ts +17 -0
  126. package/reactHooks/navigation/usePathname.ts +4 -0
  127. package/reactHooks/navigation/useProfilerLogging.ts +15 -0
  128. package/reactHooks/navigation/useRoute.ts +98 -0
  129. package/reactHooks/navigation/useUniqueRouteSuffix.ts +41 -0
  130. package/reactHooks/player/TVSeekControlller/ISeekController.ts +32 -0
  131. package/reactHooks/player/TVSeekControlller/LongPressSeekController.ts +71 -0
  132. package/reactHooks/player/TVSeekControlller/TVSeekController.ts +258 -0
  133. package/reactHooks/player/TVSeekControlller/TapSeekController.ts +53 -0
  134. package/reactHooks/player/__tests__/{useAutoSeek.test.tsx → useAutoSeek._test.tsx} +2 -3
  135. package/reactHooks/player/const.ts +0 -4
  136. package/reactHooks/player/index.ts +0 -6
  137. package/reactHooks/screen/__tests__/useScreenBackgroundColor.test.tsx +69 -0
  138. package/reactHooks/screen/useScreenBackgroundColor.ts +3 -15
  139. package/reactHooks/state/README.md +79 -0
  140. package/reactHooks/state/ZStoreProvider.tsx +71 -0
  141. package/reactHooks/state/__tests__/ZStoreProvider.test.tsx +66 -0
  142. package/reactHooks/state/index.ts +2 -0
  143. package/reactHooks/state/useRefWithInitialValue.ts +14 -0
  144. package/reactHooks/state/useStateFromSubscribe.ts +23 -0
  145. package/reactHooks/useListenEventBusEvent.ts +1 -1
  146. package/reactHooks/usePluginConfiguration.ts +1 -1
  147. package/reactHooks/useSubscriberFor.ts +4 -3
  148. package/reactUtils/__tests__/__snapshots__/reactUtilsHelpers.test.js.snap +16 -4
  149. package/reactUtils/__tests__/reactUtils.test.js +1 -37
  150. package/reactUtils/__tests__/reactUtilsHelpers.test.js +72 -71
  151. package/reactUtils/createContext/__tests__/__snapshots__/helpers.test.js.snap +13 -79
  152. package/reactUtils/createContext/__tests__/__snapshots__/{index.test.js.snap → index.test.ts.snap} +2 -2
  153. package/reactUtils/createContext/__tests__/__snapshots__/provider.test.js.snap +3 -28
  154. package/reactUtils/createContext/__tests__/__snapshots__/withConsumer.test.js.snap +3 -4
  155. package/reactUtils/createContext/__tests__/__snapshots__/withProvider.test.js.snap +7 -3
  156. package/reactUtils/createContext/__tests__/helpers.test.js +107 -121
  157. package/reactUtils/createContext/__tests__/{index.test.js → index.test.ts} +2 -2
  158. package/reactUtils/createContext/__tests__/provider.test.js +4 -6
  159. package/reactUtils/createContext/__tests__/withConsumer.test.js +12 -12
  160. package/reactUtils/createContext/__tests__/withProvider.test.js +4 -4
  161. package/reactUtils/createContext/helpers.ts +6 -1
  162. package/reactUtils/createContext/index.ts +11 -25
  163. package/reactUtils/index.ts +9 -11
  164. package/screenState/index.ts +24 -10
  165. package/services/js2native.ts +673 -0
  166. package/testUtils/index.tsx +0 -10
  167. package/theme/__mocks__/index.ts +4 -0
  168. package/theme/index.ts +1 -1
  169. package/time/BackgroundTimer.ts +55 -0
  170. package/time/Timer.ts +9 -6
  171. package/typeGuards/index.ts +3 -0
  172. package/types.ts +1 -0
  173. package/utils/README.md +30 -0
  174. package/utils/chunk.ts +5 -0
  175. package/utils/index.ts +16 -0
  176. package/utils/times.ts +5 -0
  177. package/zappFrameworkUtils/localStorageHelper.ts +38 -10
  178. package/zappFrameworkUtils/loginPluginUtils.ts +6 -2
  179. package/zappFrameworkUtils/presentPluginOneTime.ts +2 -3
  180. package/zappFrameworkUtils/types.ts +11 -0
  181. package/reactHooks/player/useAutoSeek.tsx +0 -87
  182. package/reactHooks/player/useSeek.tsx +0 -66
  183. package/reactHooks/player/useTapSeek.tsx +0 -58
  184. package/reactUtils/createContext/__tests__/index-no-react.test.js +0 -27
  185. /package/reactHooks/player/__tests__/{useTapSeek.test.ts → useTapSeek._test.ts} +0 -0
@@ -0,0 +1,874 @@
1
+ const {
2
+ fieldsGroup,
3
+ } = require("@applicaster/zapp-react-native-utils/manifestUtils");
4
+
5
+ const {
6
+ generateFontConfiguration,
7
+ createVariationFields,
8
+ conditional_horizontal_type,
9
+ conditional_vertical_type,
10
+ conditional_horizontal_type_item_fixed,
11
+ conditional_horizontal_asset_on,
12
+ conditional_horizontal_display_type_fixed,
13
+ } = require("./utils");
14
+
15
+ const TRANSPARENT = "rgba(0, 0, 0, 0)";
16
+ const fontFamily = "Ubuntu-Medium";
17
+
18
+ const componentConfigurationFields = [
19
+ {
20
+ type: "select",
21
+ key: "screen_picker_type",
22
+ label: "Screen picker type",
23
+ initial_value: "vertical",
24
+ options: [
25
+ { text: "Vertical", value: "vertical" },
26
+ { text: "Horizontal", value: "horizontal" },
27
+ ],
28
+ },
29
+ {
30
+ type: "select",
31
+ key: "screen_picker_horizontal_display_type",
32
+ label: "Display",
33
+ initial_value: "fixed",
34
+ options: [
35
+ { text: "Fixed", value: "fixed" },
36
+ { text: "Dynamic", value: "dynamic" },
37
+ ],
38
+ ...conditional_horizontal_type,
39
+ },
40
+ {
41
+ type: "select",
42
+ label: "Alignment for Picker container",
43
+ key: "screen_picker_items_alignment",
44
+ initial_value: "left",
45
+ options: [
46
+ { text: "Left", value: "left" },
47
+ { text: "Right", value: "right" },
48
+ { text: "Center", value: "center" },
49
+ ],
50
+ ...conditional_horizontal_type,
51
+ },
52
+ {
53
+ type: "select",
54
+ label: "Alignment for Picker container items",
55
+ key: "screen_picker_horizontal_items_alignment_inner",
56
+ initial_value: "left",
57
+ options: [
58
+ { text: "Left", value: "left" },
59
+ { text: "Right", value: "right" },
60
+ { text: "Center", value: "center" },
61
+ ],
62
+ ...conditional_horizontal_display_type_fixed,
63
+ },
64
+ {
65
+ type: "number_input",
66
+ label: "Width",
67
+ key: "screen_picker_vertical_width",
68
+ initial_value: 300,
69
+ ...conditional_vertical_type,
70
+ },
71
+ {
72
+ type: "number_input",
73
+ label: "Width",
74
+ key: "screen_picker_horizontal_width",
75
+ initial_value: 1920,
76
+ ...conditional_horizontal_display_type_fixed,
77
+ },
78
+ ...createVariationFields({
79
+ label: "X position",
80
+ key: "x_position",
81
+ variants: [
82
+ {
83
+ initial_value: 124,
84
+ },
85
+ {
86
+ initial_value: 0,
87
+ },
88
+ ],
89
+ }),
90
+ ...createVariationFields({
91
+ label: "Y position",
92
+ key: "y_position",
93
+ variants: [
94
+ {
95
+ initial_value: 200,
96
+ },
97
+ {
98
+ initial_value: 200,
99
+ },
100
+ ],
101
+ }),
102
+ {
103
+ type: "number_input",
104
+ label: "Padding Top",
105
+ key: "component_padding_top",
106
+ initial_value: 0,
107
+ ...conditional_horizontal_type,
108
+ },
109
+ {
110
+ type: "number_input",
111
+ label: "Padding Right",
112
+ key: "component_padding_right",
113
+ initial_value: 124,
114
+ ...conditional_horizontal_type,
115
+ },
116
+ {
117
+ type: "number_input",
118
+ label: "Padding Bottom",
119
+ key: "component_padding_bottom",
120
+ initial_value: 0,
121
+ ...conditional_horizontal_type,
122
+ },
123
+ {
124
+ type: "number_input",
125
+ label: "Padding Left",
126
+ key: "component_padding_left",
127
+ initial_value: 124,
128
+ },
129
+ {
130
+ type: "color_picker_rgba",
131
+ label: "Background color",
132
+ key: "screen_picker_background_color",
133
+ initial_value: TRANSPARENT,
134
+ ...conditional_horizontal_type,
135
+ },
136
+ {
137
+ type: "uploader",
138
+ label: "Background image",
139
+ key: "screen_picker_background_image",
140
+ initial_value: null,
141
+ ...conditional_horizontal_type,
142
+ },
143
+ {
144
+ type: "color_picker_rgba",
145
+ label: "Border color",
146
+ key: "screen_picker_border_color",
147
+ initial_value: TRANSPARENT,
148
+ ...conditional_horizontal_type,
149
+ },
150
+ {
151
+ type: "number_input",
152
+ label: "Border thickness",
153
+ key: "screen_picker_border_thickness",
154
+ initial_value: 0,
155
+ ...conditional_horizontal_type,
156
+ },
157
+ {
158
+ type: "number_input",
159
+ label: "Corner Radius",
160
+ key: "screen_picker_corner_radius",
161
+ initial_value: 0,
162
+ ...conditional_horizontal_type,
163
+ },
164
+ /* Disabled due to blocker issues with Android TV
165
+ Task: https://applicaster.monday.com/boards/1615228456/pulses/4130776042
166
+ Discussion: https://applicaster.monday.com/boards/1615228456/pulses/4130775820/posts/2031049491
167
+ */
168
+ // ...loopFields
169
+ ];
170
+
171
+ const assetFields = [
172
+ {
173
+ type: "switch",
174
+ key: "screen_picker_asset_switch",
175
+ label: "Enable",
176
+ initial_value: false,
177
+ ...conditional_horizontal_type,
178
+ },
179
+ {
180
+ type: "text_input",
181
+ key: "screen_picker_asset_key",
182
+ label: "Default data key",
183
+ initial_value: "image_base",
184
+ ...conditional_horizontal_asset_on,
185
+ },
186
+ {
187
+ type: "switch",
188
+ key: "screen_picker_asset_focused_switch",
189
+ label: "Enable focused asset",
190
+ initial_value: false,
191
+ ...conditional_horizontal_asset_on,
192
+ },
193
+ {
194
+ type: "text_input",
195
+ key: "screen_picker_asset_focused_key",
196
+ label: "Focused data key",
197
+ initial_value: "thumb_1",
198
+ ...conditional_horizontal_asset_on,
199
+ },
200
+ {
201
+ type: "switch",
202
+ key: "screen_picker_asset_selected_switch",
203
+ label: "Enable selected asset",
204
+ initial_value: false,
205
+ ...conditional_horizontal_asset_on,
206
+ },
207
+ {
208
+ type: "text_input",
209
+ key: "screen_picker_asset_selected_key",
210
+ label: "Selected data key",
211
+ initial_value: "thumb_2",
212
+ ...conditional_horizontal_asset_on,
213
+ },
214
+ {
215
+ type: "switch",
216
+ key: "screen_picker_asset_selectedfocused_switch",
217
+ label: "Enable selected & focused asset",
218
+ initial_value: false,
219
+ ...conditional_horizontal_asset_on,
220
+ },
221
+ {
222
+ type: "text_input",
223
+ key: "screen_picker_asset_selectedfocused_key",
224
+ label: "Selected & Focused data key",
225
+ initial_value: "thumb_3",
226
+ ...conditional_horizontal_asset_on,
227
+ },
228
+ {
229
+ type: "number_input",
230
+ key: "screen_picker_asset_width",
231
+ label: "Width",
232
+ initial_value: 40,
233
+ ...conditional_horizontal_asset_on,
234
+ },
235
+ {
236
+ type: "number_input",
237
+ key: "screen_picker_asset_height",
238
+ label: "Height",
239
+ initial_value: 40,
240
+ ...conditional_horizontal_asset_on,
241
+ },
242
+ {
243
+ type: "number_input",
244
+ key: "screen_picker_asset_margin_top",
245
+ label: "Margin Top",
246
+ initial_value: 0,
247
+ ...conditional_horizontal_asset_on,
248
+ },
249
+ {
250
+ type: "number_input",
251
+ key: "screen_picker_asset_margin_right",
252
+ label: "Margin Right",
253
+ initial_value: 16,
254
+ ...conditional_horizontal_asset_on,
255
+ },
256
+ {
257
+ type: "number_input",
258
+ key: "screen_picker_asset_margin_bottom",
259
+ label: "Margin Bottom",
260
+ initial_value: 0,
261
+ ...conditional_horizontal_asset_on,
262
+ },
263
+ {
264
+ type: "number_input",
265
+ key: "screen_picker_asset_margin_left",
266
+ label: "Margin Left",
267
+ initial_value: 0,
268
+ ...conditional_horizontal_asset_on,
269
+ },
270
+ {
271
+ type: "select",
272
+ label: "Alignment",
273
+ key: "screen_picker_asset_alignment",
274
+ initial_value: "left",
275
+ options: [
276
+ { text: "Top", value: "top" },
277
+ { text: "Right", value: "right" },
278
+ { text: "Bottom", value: "bottom" },
279
+ { text: "Left", value: "left" },
280
+ ],
281
+ ...conditional_horizontal_asset_on,
282
+ },
283
+ ];
284
+
285
+ const screenPickerItemsFields = [
286
+ ...createVariationFields({
287
+ key: "gutter",
288
+ variants: [
289
+ {
290
+ label: "Vertical gutter",
291
+ initial_value: 10,
292
+ },
293
+ {
294
+ label: "Horizontal gutter",
295
+ initial_value: 80,
296
+ },
297
+ ],
298
+ }),
299
+ {
300
+ type: "select",
301
+ label: "Item Size",
302
+ key: "screen_picker_item_size",
303
+ initial_value: "dynamic",
304
+ options: [
305
+ { text: "Dynamic", value: "dynamic" },
306
+ { text: "Fixed", value: "fixed" },
307
+ ],
308
+ ...conditional_horizontal_type,
309
+ },
310
+ {
311
+ type: "number_input",
312
+ label: "Item Width",
313
+ key: "screen_picker_item_width",
314
+ initial_value: 200,
315
+ ...conditional_horizontal_type_item_fixed,
316
+ },
317
+ {
318
+ type: "select",
319
+ label: "Alignment for item content",
320
+ key: "screen_picker_item_alignment",
321
+ initial_value: "left",
322
+ options: [
323
+ { text: "Left", value: "left" },
324
+ { text: "Right", value: "right" },
325
+ { text: "Center", value: "center" },
326
+ ],
327
+ ...conditional_horizontal_type_item_fixed,
328
+ },
329
+ ];
330
+
331
+ const titleFields = [
332
+ {
333
+ type: "switch",
334
+ label: "Enable",
335
+ key: "title_enable",
336
+ initial_value: true,
337
+ ...conditional_horizontal_type,
338
+ },
339
+ // font color
340
+ ...createVariationFields({
341
+ prefix: "default",
342
+ type: "color_picker_rgba",
343
+ label: "Default font color",
344
+ key: "font_color",
345
+ variants: [
346
+ {
347
+ initial_value: "rgba(239, 239, 239, 0.5)",
348
+ },
349
+ {
350
+ initial_value: "rgba(239, 239, 239, 0.5)",
351
+ },
352
+ ],
353
+ }),
354
+ ...createVariationFields({
355
+ prefix: "focused",
356
+ type: "color_picker_rgba",
357
+ label: "Focused font color",
358
+ key: "font_color",
359
+ variants: [
360
+ {
361
+ initial_value: "rgba(239, 239, 239, 1)",
362
+ },
363
+ {
364
+ initial_value: "rgba(254, 20, 72, 1)",
365
+ },
366
+ ],
367
+ }),
368
+ ...createVariationFields({
369
+ prefix: "selected",
370
+ type: "color_picker_rgba",
371
+ label: "Selected font color",
372
+ key: "font_color",
373
+ variants: [
374
+ {
375
+ initial_value: "rgba(239, 239, 239, 1)",
376
+ },
377
+ {
378
+ initial_value: "rgba(239, 239, 239, 1)",
379
+ },
380
+ ],
381
+ }),
382
+ ...createVariationFields({
383
+ prefix: "selected_focused",
384
+ type: "color_picker_rgba",
385
+ label: "Selected & Focused font color",
386
+ key: "font_color",
387
+ variants: [
388
+ {
389
+ initial_value: "rgba(239, 239, 239, 1)",
390
+ },
391
+ {
392
+ initial_value: "rgba(254, 20, 72, 1)",
393
+ },
394
+ ],
395
+ }),
396
+ // fonts
397
+ {
398
+ type: "tvos_font_selector",
399
+ label: "tvOS Font Family",
400
+ key: "tvos_font_family",
401
+ initial_value: fontFamily,
402
+ },
403
+ {
404
+ type: "android_font_selector",
405
+ label: "Android TV Font Family",
406
+ key: "android_tv_font_family",
407
+ initial_value: fontFamily,
408
+ },
409
+ {
410
+ type: "lg_tv_font_selector",
411
+ label: "LG TV Font Family",
412
+ key: "lg_tv_font_family",
413
+ initial_value: fontFamily,
414
+ },
415
+ {
416
+ type: "samsung_font_selector",
417
+ label: "Samsung TV Font Family",
418
+ key: "samsung_tv_font_family",
419
+ initial_value: fontFamily,
420
+ },
421
+ {
422
+ type: "vizio_font_selector",
423
+ label: "Vizio TV Font Family",
424
+ key: "vizio_font_family",
425
+ initial_value: fontFamily,
426
+ },
427
+ ...generateFontConfiguration(),
428
+ // text transform
429
+ {
430
+ type: "select",
431
+ label: "Text Transform",
432
+ key: "text_transform",
433
+ initial_value: "uppercase",
434
+ options: ["default", "uppercase", "lowercase", "capitalize"],
435
+ },
436
+ // number of lines
437
+ {
438
+ type: "number_input",
439
+ label: "number of lines",
440
+ key: "number_of_lines",
441
+ initial_value: 1,
442
+ ...conditional_vertical_type,
443
+ },
444
+ ];
445
+
446
+ const itemFields = [
447
+ // underline color
448
+ ...createVariationFields({
449
+ prefix: "default",
450
+ type: "color_picker_rgba",
451
+ label: "Default underline color",
452
+ key: "underline_color",
453
+ variants: [
454
+ {
455
+ initial_value: TRANSPARENT,
456
+ },
457
+ {
458
+ initial_value: TRANSPARENT,
459
+ },
460
+ ],
461
+ }),
462
+ ...createVariationFields({
463
+ prefix: "focused",
464
+ type: "color_picker_rgba",
465
+ label: "Focused underline color",
466
+ key: "underline_color",
467
+ variants: [
468
+ {
469
+ initial_value: TRANSPARENT,
470
+ },
471
+ {
472
+ initial_value: "rgba(254, 20, 72, 1)",
473
+ },
474
+ ],
475
+ }),
476
+ ...createVariationFields({
477
+ prefix: "selected",
478
+ type: "color_picker_rgba",
479
+ label: "Selected underline color",
480
+ key: "underline_color",
481
+ variants: [
482
+ {
483
+ initial_value: TRANSPARENT,
484
+ },
485
+ {
486
+ initial_value: "rgba(239, 239, 239, 1)",
487
+ },
488
+ ],
489
+ }),
490
+ ...createVariationFields({
491
+ prefix: "selected_focused",
492
+ type: "color_picker_rgba",
493
+ label: "Selected & Focused underline color",
494
+ key: "underline_color",
495
+ variants: [
496
+ {
497
+ initial_value: TRANSPARENT,
498
+ },
499
+ {
500
+ initial_value: "rgba(254, 20, 72, 1)",
501
+ },
502
+ ],
503
+ }),
504
+ // underline thickness
505
+ ...createVariationFields({
506
+ prefix: "",
507
+ label: "Underline Thickness",
508
+ key: "underline_thickness",
509
+ variants: [
510
+ {
511
+ initial_value: 0,
512
+ },
513
+ {
514
+ initial_value: 6,
515
+ },
516
+ ],
517
+ }),
518
+ // underline corner radius
519
+ ...createVariationFields({
520
+ prefix: "",
521
+ label: "Underline corner radius",
522
+ key: "underline_corner_radius",
523
+ variants: [
524
+ {
525
+ initial_value: 0,
526
+ },
527
+ {
528
+ initial_value: 3,
529
+ },
530
+ ],
531
+ }),
532
+ // text bg color
533
+ {
534
+ type: "color_picker_rgba",
535
+ label: "Default Text Background color",
536
+ key: "default_text_background_color",
537
+ initial_value: TRANSPARENT,
538
+ ...conditional_vertical_type,
539
+ },
540
+ {
541
+ type: "color_picker_rgba",
542
+ label: "Focused Text Background color",
543
+ key: "focused_text_background_color",
544
+ initial_value: TRANSPARENT,
545
+ ...conditional_vertical_type,
546
+ },
547
+ {
548
+ type: "color_picker_rgba",
549
+ label: "Selected Text Background color",
550
+ key: "selected_text_background_color",
551
+ initial_value: TRANSPARENT,
552
+ ...conditional_vertical_type,
553
+ },
554
+ {
555
+ type: "color_picker_rgba",
556
+ label: "Selected & Focused Text Background color",
557
+ key: "selected_focused_text_background_color",
558
+ initial_value: TRANSPARENT,
559
+ ...conditional_vertical_type,
560
+ },
561
+ // text item border_thickness
562
+ {
563
+ type: "number_input",
564
+ label: "Text Item border thickness",
565
+ key: "text_border_thickness",
566
+ initial_value: 0,
567
+ ...conditional_vertical_type,
568
+ },
569
+ // text item corner radius
570
+ {
571
+ type: "number_input",
572
+ label: "Text Item corner radius",
573
+ key: "text_corner_radius",
574
+ initial_value: 0,
575
+ ...conditional_vertical_type,
576
+ },
577
+ // text border color
578
+ {
579
+ type: "color_picker_rgba",
580
+ label: "Default Text border color",
581
+ key: "default_text_border_color",
582
+ initial_value: TRANSPARENT,
583
+ ...conditional_vertical_type,
584
+ },
585
+ {
586
+ type: "color_picker_rgba",
587
+ label: "Focused Text border color",
588
+ key: "focused_text_border_color",
589
+ initial_value: TRANSPARENT,
590
+ ...conditional_vertical_type,
591
+ },
592
+ {
593
+ type: "color_picker_rgba",
594
+ label: "Selected Text border color",
595
+ key: "selected_text_border_color",
596
+ initial_value: TRANSPARENT,
597
+ ...conditional_vertical_type,
598
+ },
599
+ {
600
+ type: "color_picker_rgba",
601
+ label: "Selected & Focused Text border color",
602
+ key: "selected_focused_text_border_color",
603
+ initial_value: TRANSPARENT,
604
+ ...conditional_vertical_type,
605
+ },
606
+ // item margin
607
+ {
608
+ type: "number_input",
609
+ label: "Item Margin top",
610
+ key: "item_margin_top",
611
+ initial_value: 0,
612
+ },
613
+ {
614
+ type: "number_input",
615
+ label: "Item Margin Right",
616
+ key: "item_margin_right",
617
+ initial_value: 0,
618
+ },
619
+ {
620
+ type: "number_input",
621
+ label: "Item Margin Bottom",
622
+ key: "item_margin_bottom",
623
+ initial_value: 0,
624
+ },
625
+ {
626
+ type: "number_input",
627
+ label: "Item Margin Left",
628
+ key: "item_margin_left",
629
+ initial_value: 0,
630
+ },
631
+ // text item padding
632
+ {
633
+ type: "number_input",
634
+ label: "Text Item Padding Top",
635
+ key: "item_padding_top",
636
+ initial_value: 12,
637
+ ...conditional_vertical_type,
638
+ },
639
+ {
640
+ type: "number_input",
641
+ label: "Text Item Padding Right",
642
+ key: "item_padding_right",
643
+ initial_value: 24,
644
+ ...conditional_vertical_type,
645
+ },
646
+ {
647
+ type: "number_input",
648
+ label: "Text Item Padding Bottom",
649
+ key: "item_padding_bottom",
650
+ initial_value: 12,
651
+ ...conditional_vertical_type,
652
+ },
653
+ {
654
+ type: "number_input",
655
+ label: "Text Item Padding Left",
656
+ key: "item_padding_left",
657
+ initial_value: 24,
658
+ ...conditional_vertical_type,
659
+ },
660
+ // text padding
661
+ ...createVariationFields({
662
+ prefix: "text",
663
+ type: "number_input",
664
+ label: "Text Padding Top",
665
+ key: "padding_top",
666
+ variants: [
667
+ {
668
+ initial_value: 0,
669
+ },
670
+ {
671
+ initial_value: 12,
672
+ },
673
+ ],
674
+ }),
675
+ ...createVariationFields({
676
+ prefix: "text",
677
+ type: "number_input",
678
+ label: "Text Padding Right",
679
+ key: "padding_right",
680
+ variants: [
681
+ {
682
+ initial_value: 0,
683
+ },
684
+ {
685
+ initial_value: 0,
686
+ },
687
+ ],
688
+ }),
689
+ ...createVariationFields({
690
+ prefix: "text",
691
+ type: "number_input",
692
+ label: "Text Padding Bottom",
693
+ key: "padding_bottom",
694
+ variants: [
695
+ {
696
+ initial_value: 0,
697
+ },
698
+ {
699
+ initial_value: 12,
700
+ },
701
+ ],
702
+ }),
703
+ ...createVariationFields({
704
+ prefix: "text",
705
+ type: "number_input",
706
+ label: "Text Padding Left",
707
+ key: "padding_left",
708
+ variants: [
709
+ {
710
+ initial_value: 0,
711
+ },
712
+ {
713
+ initial_value: 0,
714
+ },
715
+ ],
716
+ }),
717
+ // item bg color
718
+ ...createVariationFields({
719
+ prefix: "default",
720
+ type: "color_picker_rgba",
721
+ label: "Default Item background color",
722
+ key: "item_background_color",
723
+ variants: [
724
+ {
725
+ initial_value: TRANSPARENT,
726
+ },
727
+ {
728
+ initial_value: TRANSPARENT,
729
+ },
730
+ ],
731
+ }),
732
+ ...createVariationFields({
733
+ prefix: "focused",
734
+ type: "color_picker_rgba",
735
+ label: "Focused Item background color",
736
+ key: "item_background_color",
737
+ variants: [
738
+ {
739
+ initial_value: "rgba(254, 20, 72, 1)",
740
+ },
741
+ {
742
+ initial_value: TRANSPARENT,
743
+ },
744
+ ],
745
+ }),
746
+ ...createVariationFields({
747
+ prefix: "selected",
748
+ type: "color_picker_rgba",
749
+ label: "Selected Item background color",
750
+ key: "item_background_color",
751
+ variants: [
752
+ {
753
+ initial_value: TRANSPARENT,
754
+ },
755
+ {
756
+ initial_value: TRANSPARENT,
757
+ },
758
+ ],
759
+ }),
760
+ ...createVariationFields({
761
+ prefix: "selected_focused",
762
+ type: "color_picker_rgba",
763
+ label: "Selected & Focused Item background color",
764
+ key: "item_background_color",
765
+ variants: [
766
+ {
767
+ initial_value: "rgba(254, 20, 72, 1)",
768
+ },
769
+ {
770
+ initial_value: TRANSPARENT,
771
+ },
772
+ ],
773
+ }),
774
+ // item border color
775
+ ...createVariationFields({
776
+ prefix: "default",
777
+ type: "color_picker_rgba",
778
+ label: "Default Item border color",
779
+ key: "item_border_color",
780
+ variants: [
781
+ {
782
+ initial_value: TRANSPARENT,
783
+ },
784
+ {
785
+ initial_value: TRANSPARENT,
786
+ },
787
+ ],
788
+ }),
789
+ ...createVariationFields({
790
+ prefix: "focused",
791
+ type: "color_picker_rgba",
792
+ label: "Focused Item border color",
793
+ key: "item_border_color",
794
+ variants: [
795
+ {
796
+ initial_value: TRANSPARENT,
797
+ },
798
+ {
799
+ initial_value: TRANSPARENT,
800
+ },
801
+ ],
802
+ }),
803
+ ...createVariationFields({
804
+ prefix: "selected",
805
+ type: "color_picker_rgba",
806
+ label: "Selected Item border color",
807
+ key: "item_border_color",
808
+ variants: [
809
+ {
810
+ initial_value: "rgba(239, 239, 239, 0.5)",
811
+ },
812
+ {
813
+ initial_value: TRANSPARENT,
814
+ },
815
+ ],
816
+ }),
817
+ ...createVariationFields({
818
+ prefix: "selected_focused",
819
+ type: "color_picker_rgba",
820
+ label: "Selected & Focused Item border color",
821
+ key: "item_border_color",
822
+ variants: [
823
+ {
824
+ initial_value: TRANSPARENT,
825
+ },
826
+ {
827
+ initial_value: TRANSPARENT,
828
+ },
829
+ ],
830
+ }),
831
+ // item border thickness
832
+ ...createVariationFields({
833
+ prefix: "",
834
+ label: "Item Border Thickness",
835
+ key: "item_border_thickness",
836
+ variants: [
837
+ {
838
+ initial_value: 2,
839
+ },
840
+ {
841
+ initial_value: 0,
842
+ },
843
+ ],
844
+ }),
845
+ // item corner radius
846
+ ...createVariationFields({
847
+ prefix: "",
848
+ label: "Item Corner radius",
849
+ key: "item_corner_radius",
850
+ variants: [
851
+ {
852
+ initial_value: 8,
853
+ },
854
+ {
855
+ initial_value: 0,
856
+ },
857
+ ],
858
+ }),
859
+ ];
860
+
861
+ const stylesFields = [
862
+ fieldsGroup(
863
+ "Component Configuration",
864
+ "",
865
+ componentConfigurationFields,
866
+ false
867
+ ),
868
+ fieldsGroup("Screen Picker Items", "", screenPickerItemsFields, false),
869
+ fieldsGroup("Asset", "", assetFields, false),
870
+ fieldsGroup("Title", "", titleFields, false),
871
+ fieldsGroup("Item", "", itemFields, false),
872
+ ];
873
+
874
+ module.exports = stylesFields;