@applicaster/zapp-react-native-utils 12.0.0-rc.13 → 12.0.0-rc.130

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 (129) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +16 -8
  2. package/analyticsUtils/AnalyticPlayerListener.ts +141 -0
  3. package/analyticsUtils/AnalyticsEvents/index.ts +13 -0
  4. package/analyticsUtils/AnalyticsEvents/searchEvents.ts +21 -0
  5. package/analyticsUtils/AnalyticsEvents/sendShareEvent.ts +21 -0
  6. package/analyticsUtils/PlayerAnalyticsManager.ts +90 -0
  7. package/analyticsUtils/__tests__/analyticsManager.test.js +75 -73
  8. package/analyticsUtils/analyticsPlugins.ts +25 -0
  9. package/analyticsUtils/events.ts +12 -0
  10. package/analyticsUtils/helpers/hooks.ts +1 -1
  11. package/analyticsUtils/index.tsx +12 -0
  12. package/analyticsUtils/{analyticsTracker.ts → playerAnalyticsTracker.ts} +19 -10
  13. package/appUtils/HooksManager/index.js +3 -1
  14. package/appUtils/accessibilityManager/const.ts +50 -0
  15. package/appUtils/accessibilityManager/hooks.ts +40 -0
  16. package/appUtils/accessibilityManager/index.ts +166 -0
  17. package/appUtils/accessibilityManager/logger.ts +5 -0
  18. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +2 -3
  19. package/appUtils/focusManager/__tests__/focusManager.test.js +4 -24
  20. package/appUtils/focusManager/__tests__/index.test.ts +2 -3
  21. package/appUtils/focusManager/index.ts +76 -57
  22. package/appUtils/focusManager/treeDataStructure/Utils/index.js +75 -35
  23. package/appUtils/focusManager/utils/index.ts +100 -0
  24. package/appUtils/focusManagerAux/index.ts +76 -0
  25. package/appUtils/focusManagerAux/utils/index.ts +100 -0
  26. package/appUtils/index.js +2 -0
  27. package/appUtils/keyCodes/__tests__/__snapshots__/keyCodes.test.js.snap +1 -1
  28. package/appUtils/keyCodes/__tests__/keyCodes.test.js +80 -85
  29. package/appUtils/keyCodes/keys.web.js +9 -0
  30. package/appUtils/keyCodes/keysByPlatform.js +11 -1
  31. package/appUtils/platform/const.ts +25 -0
  32. package/appUtils/platform/index.ts +3 -0
  33. package/appUtils/platform/platformUtils.ts +218 -0
  34. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +53 -0
  35. package/appUtils/playerManager/conts.ts +6 -0
  36. package/appUtils/playerManager/index.ts +20 -32
  37. package/appUtils/playerManager/nativePlayerManager.ts +12 -0
  38. package/appUtils/playerManager/player.ts +56 -7
  39. package/appUtils/playerManager/playerFactory.ts +15 -1
  40. package/appUtils/playerManager/playerHooks/usePlayerCurrentTime.tsx +57 -0
  41. package/appUtils/playerManager/playerNative.ts +41 -15
  42. package/appUtils/playerManager/usePlayerControllerSetup.tsx +8 -2
  43. package/appUtils/playerManager/usePlayerState.tsx +20 -23
  44. package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +50 -0
  45. package/arrayUtils/__tests__/isFilledArray.test.ts +63 -0
  46. package/arrayUtils/index.ts +16 -0
  47. package/booleanUtils/index.ts +4 -4
  48. package/cellUtils/__tests__/cellUtils.test.ts +48 -0
  49. package/cellUtils/__tests__/fixtures.ts +13 -0
  50. package/cellUtils/index.ts +78 -7
  51. package/dateUtils/index.ts +11 -0
  52. package/focusManager/FocusManager.ts +20 -5
  53. package/focusManager/__tests__/FocusManager.test.ts +0 -1
  54. package/focusManager/index.ts +1 -1
  55. package/functionUtils/__tests__/__snapshots__/functionUtils.test.js.snap +2 -2
  56. package/functionUtils/__tests__/functionUtils.test.js +244 -248
  57. package/functionUtils/index.ts +38 -0
  58. package/headersUtils/index.ts +1 -0
  59. package/index.d.ts +15 -0
  60. package/inflatedUrlUtils/index.ts +4 -4
  61. package/keyboardState/index.ts +0 -0
  62. package/localizationUtils/__tests__/localizationUtils.test.ts +78 -55
  63. package/localizationUtils/index.ts +13 -19
  64. package/logger/index.ts +1 -1
  65. package/manifestUtils/defaultManifestConfigurations/generalContent.js +6 -0
  66. package/manifestUtils/defaultManifestConfigurations/player.js +131 -1
  67. package/manifestUtils/index.js +5 -1
  68. package/manifestUtils/keys.js +2 -1
  69. package/manifestUtils/secondaryImage/index.js +18 -15
  70. package/modalState/index.ts +57 -0
  71. package/navigationUtils/index.ts +105 -8
  72. package/numberUtils/__tests__/isLikeNumber.test.ts +18 -0
  73. package/numberUtils/__tests__/toNumber.test.ts +2 -2
  74. package/numberUtils/__tests__/toPositiveNumberWithDefault.test.ts +66 -0
  75. package/numberUtils/__tests__/toPositiveNumberWithDefaultZero.test.ts +66 -0
  76. package/numberUtils/index.ts +27 -16
  77. package/package.json +3 -2
  78. package/playerUtils/configurationGenerator.ts +131 -1
  79. package/playerUtils/imaScriptDom.ts +59 -0
  80. package/pluginUtils/index.ts +20 -7
  81. package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +2 -0
  82. package/reactHooks/autoscrolling/__tests__/{useTrackedView.test.ts → useTrackedView.test.tsx} +18 -1
  83. package/reactHooks/cell-click/__tests__/index.test.js +19 -6
  84. package/reactHooks/cell-click/index.ts +30 -16
  85. package/reactHooks/debugging/__tests__/index.test.js +81 -11
  86. package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +69 -6
  87. package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +30 -70
  88. package/reactHooks/feed/__tests__/useFeedRefresh.test.tsx +6 -2
  89. package/reactHooks/feed/__tests__/useInflatedUrl.test.ts +18 -3
  90. package/reactHooks/feed/useBatchLoading.ts +52 -28
  91. package/reactHooks/feed/useBuildPipesUrl.ts +7 -10
  92. package/reactHooks/feed/useFeedRefresh.tsx +9 -7
  93. package/reactHooks/feed/useInflatedUrl.ts +44 -15
  94. package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +16 -9
  95. package/reactHooks/index.ts +2 -0
  96. package/reactHooks/layout/__tests__/{index.test.js → index.test.tsx} +66 -59
  97. package/reactHooks/layout/getDeviceInfo/index.ts +4 -2
  98. package/reactHooks/layout/types/index.ts +2 -0
  99. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +134 -0
  100. package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.native.test.js +11 -16
  101. package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.test.js +12 -14
  102. package/reactHooks/layout/useDimensions/useDimensions.ts +15 -7
  103. package/reactHooks/navigation/__mocks__/index.ts +15 -0
  104. package/reactHooks/navigation/__mocks__/useNavigation.ts +7 -0
  105. package/reactHooks/navigation/__tests__/index.test.tsx +240 -81
  106. package/reactHooks/navigation/index.ts +240 -81
  107. package/reactHooks/player/useAutoSeek.tsx +9 -7
  108. package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +3 -1
  109. package/reactHooks/resolvers/useCellResolver.ts +5 -1
  110. package/reactHooks/screen/__mocks__/useScreenContext.ts +3 -1
  111. package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +21 -23
  112. package/reactHooks/screen/index.ts +4 -0
  113. package/reactHooks/screen/useScreenBackgroundColor.ts +23 -0
  114. package/reactHooks/screen/useScreenContext.ts +4 -4
  115. package/reactHooks/screen/useScreenData.ts +1 -1
  116. package/reactHooks/screen/useTargetScreenData.ts +7 -0
  117. package/reactHooks/state/useRivers.ts +3 -1
  118. package/reactHooks/useConfiguration.ts +2 -2
  119. package/reactHooks/useListenEventBusEvent.ts +1 -4
  120. package/reactHooks/videoModal/hooks/useVideoModalScreenData.tsx +10 -9
  121. package/reactUtils/index.ts +104 -0
  122. package/riverComponetsMeasurementProvider/index.tsx +2 -2
  123. package/stringUtils/index.ts +5 -0
  124. package/testUtils/getByTestId.ts +14 -0
  125. package/testUtils/index.tsx +71 -23
  126. package/types.ts +4 -0
  127. package/appUtils/focusManager/FocusableEvents.ts +0 -8
  128. package/appUtils/focusManager/treeDataStructure/Utils/__tests__/Utils_android.test.js +0 -1094
  129. package/appUtils/focusManager/treeDataStructure/Utils/index.android.js +0 -261
@@ -1,4 +1,4 @@
1
- import { last, head, isNil, includes, all, pathOr } from "ramda";
1
+ import { last, head, isNil, includes, pathOr } from "ramda";
2
2
 
3
3
  const stripBrackets = (path) => {
4
4
  const withoutPrepened = last(path.split("{{"));
@@ -13,15 +13,15 @@ const hasValue = (context) => (path) => {
13
13
  return !isNil(value);
14
14
  };
15
15
 
16
- export const isEnoughDataToInflateString = (context, string): boolean => {
16
+ export const getMissingValues = (context, string): string[] => {
17
17
  if (!includes("{{", string)) {
18
- return true;
18
+ return [];
19
19
  }
20
20
 
21
21
  const SEARCH_REGEX = new RegExp(/{{.*?}}/g);
22
22
  const paths = string.toString().match(SEARCH_REGEX);
23
23
 
24
- return all(hasValue(context), paths);
24
+ return paths.filter((path) => !hasValue(context)(path));
25
25
  };
26
26
 
27
27
  export const isNonInflatedUrl = (url: string): boolean =>
File without changes
@@ -1,55 +1,59 @@
1
- const mocked_state = {
2
- remoteConfigurations: { localizations: {} },
3
- appData: {
4
- languageCode: "en",
5
- countryCode: "US",
6
- },
7
- };
8
-
9
- let mocked_locale = ["en-US"];
1
+ import { NativeModules } from "react-native";
10
2
 
11
- jest.doMock("react-redux", () => ({
12
- useSelector: jest.fn((fn) => fn(mocked_state)),
13
- }));
3
+ const settingsManagerMock = {
4
+ getConstants: jest.fn(() => ({
5
+ settings: { AppleLanguages: ["en-US"] },
6
+ })),
7
+ };
14
8
 
15
- jest.doMock("react-native", () => ({
16
- NativeModules: {
17
- SettingsManager: {
18
- getConstants: jest.fn(() => ({
19
- settings: { AppleLanguages: mocked_locale },
20
- })),
21
- },
22
- QuickBrickCommunicationModule: {
23
- languageLocale: "en",
24
- countryLocale: "US",
25
- },
26
- },
27
- }));
9
+ const qbCommunicationModuleMock = {
10
+ languageLocale: "en",
11
+ countryLocale: "US",
12
+ uiLanguage: "en-US",
13
+ };
28
14
 
29
- const { useIsRTL } = require("../index");
15
+ NativeModules.SettingsManager = settingsManagerMock;
16
+ NativeModules.QuickBrickCommunicationModule = qbCommunicationModuleMock;
30
17
 
31
18
  describe("localizationUtils", () => {
19
+ beforeEach(() => {
20
+ jest.resetModules();
21
+ });
22
+
32
23
  describe("when the app has a single locale", () => {
33
24
  describe("when the app has only a RTL language as locale", () => {
34
25
  beforeEach(() => {
35
- mocked_state.remoteConfigurations.localizations = {
36
- he: "http://url.com",
26
+ jest.resetModules();
27
+ const RN = require("react-native");
28
+
29
+ RN.NativeModules.QuickBrickCommunicationModule = {
30
+ languageLocale: "he",
31
+ countryLocale: "IL",
32
+ uiLanguage: "he-HE",
37
33
  };
38
34
  });
39
35
 
40
36
  it("useIsRTL returns true", () => {
37
+ const { useIsRTL } = require("../index");
41
38
  expect(useIsRTL()).toBe(true);
42
39
  });
43
40
  });
44
41
 
45
42
  describe("when the app has only a LTR language as locale", () => {
46
43
  beforeEach(() => {
47
- mocked_state.remoteConfigurations.localizations = {
48
- en: "http://url.com",
44
+ jest.resetModules();
45
+
46
+ const RN = require("react-native");
47
+
48
+ RN.NativeModules.QuickBrickCommunicationModule = {
49
+ languageLocale: "en",
50
+ countryLocale: "US",
51
+ uiLanguage: "en",
49
52
  };
50
53
  });
51
54
 
52
55
  it("useIsRTL returns false", () => {
56
+ const { useIsRTL } = require("../index");
53
57
  expect(useIsRTL()).toBe(false);
54
58
  });
55
59
  });
@@ -59,45 +63,56 @@ describe("localizationUtils", () => {
59
63
  describe("when device locale is in the app's locales", () => {
60
64
  describe("when device locale is LTR", () => {
61
65
  beforeEach(() => {
62
- mocked_state.remoteConfigurations.localizations = {
63
- he: "http://url.com",
64
- en: "http://url.com",
65
- };
66
+ jest.resetModules();
67
+
68
+ const RN = require("react-native");
66
69
 
67
- mocked_locale = ["en-US"];
70
+ RN.NativeModules.QuickBrickCommunicationModule = {
71
+ languageLocale: "en",
72
+ countryLocale: "US",
73
+ uiLanguage: "en-US",
74
+ };
68
75
  });
69
76
 
70
77
  it("useIsRTL returns false", () => {
78
+ const { useIsRTL } = require("../index");
71
79
  expect(useIsRTL()).toBe(false);
72
80
  });
73
81
  });
74
82
 
75
83
  describe("when device locale is RTL", () => {
76
84
  beforeEach(() => {
77
- mocked_state.remoteConfigurations.localizations = {
78
- he: "http://url.com",
79
- en: "http://url.com",
80
- };
85
+ jest.resetModules();
86
+ const RN = require("react-native");
81
87
 
82
- mocked_locale = ["he-HE"];
88
+ RN.NativeModules.QuickBrickCommunicationModule = {
89
+ languageLocale: "he",
90
+ countryLocale: "IL",
91
+ uiLanguage: "he",
92
+ };
83
93
  });
84
94
 
85
95
  it("useIsRTL returns true", () => {
96
+ const { useIsRTL } = require("../index");
86
97
  expect(useIsRTL()).toBe(true);
87
98
  });
88
99
  });
89
100
 
90
101
  describe("when a device has a secondary language in a supported language", () => {
91
102
  beforeEach(() => {
92
- mocked_state.remoteConfigurations.localizations = {
93
- en: "http://url.com",
94
- he: "http://url.com",
95
- };
103
+ jest.resetModules();
96
104
 
97
- mocked_locale = ["es-SP", "he-HE"];
105
+ const RN = require("react-native");
106
+
107
+ RN.NativeModules.QuickBrickCommunicationModule = {
108
+ languageLocale: "he",
109
+ countryLocale: "IL",
110
+ uiLanguage: "he",
111
+ };
98
112
  });
99
113
 
100
114
  it("useIsRTL returns true", () => {
115
+ const { useIsRTL } = require("../index");
101
116
  expect(useIsRTL()).toBe(true);
102
117
  });
103
118
  });
@@ -106,30 +121,38 @@ describe("localizationUtils", () => {
106
121
  describe("when device locale is not in the app's locales", () => {
107
122
  describe("when first app locale is LTR", () => {
108
123
  beforeEach(() => {
109
- mocked_state.remoteConfigurations.localizations = {
110
- en: "http://url.com",
111
- he: "http://url.com",
112
- };
124
+ jest.resetModules();
113
125
 
114
- mocked_locale = ["fr-FR"];
126
+ const RN = require("react-native");
127
+
128
+ RN.NativeModules.QuickBrickCommunicationModule = {
129
+ languageLocale: "fr",
130
+ countryLocale: "FR",
131
+ uiLanguage: "fr-FR",
132
+ };
115
133
  });
116
134
 
117
135
  it("useIsRTL returns false", () => {
136
+ const { useIsRTL } = require("../index");
118
137
  expect(useIsRTL()).toBe(false);
119
138
  });
120
139
  });
121
140
 
122
141
  describe("when first app locale is RTL", () => {
123
142
  beforeEach(() => {
124
- mocked_state.remoteConfigurations.localizations = {
125
- he: "http://url.com",
126
- en: "http://url.com",
127
- };
143
+ jest.resetModules();
128
144
 
129
- mocked_locale = ["fr-FR"];
145
+ const RN = require("react-native");
146
+
147
+ RN.NativeModules.QuickBrickCommunicationModule = {
148
+ languageLocale: "he",
149
+ countryLocale: "HE",
150
+ uiLanguage: "he",
151
+ };
130
152
  });
131
153
 
132
154
  it("useIsRTL returns true", () => {
155
+ const { useIsRTL } = require("../index");
133
156
  expect(useIsRTL()).toBe(true);
134
157
  });
135
158
  });
@@ -1,10 +1,9 @@
1
1
  import * as R from "ramda";
2
2
  import { ViewStyle } from "react-native";
3
- import { useSelector } from "react-redux";
4
3
 
5
- import { getDeviceLocales } from "./deviceLocales";
6
4
  import { useMemo } from "react";
7
5
  import { getUILanguage } from "../appUtils/localizationsHelper";
6
+ import { utilsLogger } from "../logger";
8
7
 
9
8
  export {
10
9
  getLocale,
@@ -45,31 +44,26 @@ export function useLocalizedStrings({ localizations }) {
45
44
  return result;
46
45
  }
47
46
 
48
- function getLocaleToUse(languageCodes, localizations) {
49
- const matchingLanguages = languageCodes.filter(
50
- R.contains(R.__, localizations)
51
- );
47
+ export function getIsRTL(): boolean {
48
+ const uiLanguage = getUILanguage();
49
+
50
+ if (!uiLanguage) {
51
+ utilsLogger.error({ message: "getUILanguage returned null or undefined" });
52
52
 
53
- if (matchingLanguages?.length) {
54
- return R.head(matchingLanguages);
53
+ return false;
55
54
  }
56
55
 
57
- return R.head(localizations);
58
- }
56
+ const [languageCode] = uiLanguage.split("-");
59
57
 
60
- export function getIsRTLFromLocalizations(localizations): boolean {
61
- const deviceLocales = getDeviceLocales() || [];
62
- const localeToUse = getLocaleToUse(deviceLocales, R.keys(localizations));
58
+ const lowerCaseLanguageCode = languageCode.toLocaleLowerCase();
63
59
 
64
- return R.contains(localeToUse, RTL_LOCALES);
60
+ const isRTL = R.contains(lowerCaseLanguageCode, RTL_LOCALES);
61
+
62
+ return isRTL;
65
63
  }
66
64
 
67
65
  export function useIsRTL(): boolean {
68
- const localizations = useSelector(
69
- R.path(["remoteConfigurations", "localizations"])
70
- );
71
-
72
- return getIsRTLFromLocalizations(localizations);
66
+ return getIsRTL();
73
67
  }
74
68
 
75
69
  export const applyRTLStylesIfNeeded = (
package/logger/index.ts CHANGED
@@ -72,7 +72,7 @@ const { quickBrickLogger, coreLogger, logger, logLevels, utilsLogger } =
72
72
  function useLogger(
73
73
  logger: XRayLoggerI,
74
74
  eventData: UseLoggerHookArgs,
75
- deps = []
75
+ deps: string[] = []
76
76
  ) {
77
77
  const {
78
78
  level = logLevels.verbose,
@@ -245,6 +245,12 @@ const generalContent = () => ({
245
245
  ],
246
246
  initial_value: "reloading...",
247
247
  },
248
+ {
249
+ type: "text_input",
250
+ label: "Navigation Bar Screen Title",
251
+ key: "screen_title",
252
+ initial_value: null,
253
+ },
248
254
  ],
249
255
  },
250
256
  advertising: {
@@ -18,6 +18,7 @@ function getDevice(platform) {
18
18
  case "lg_tv":
19
19
  case "samsung_tv":
20
20
  case "web":
21
+ case "vizio":
21
22
  return "tv";
22
23
  }
23
24
  }
@@ -41,6 +42,14 @@ function getPlayerConfiguration({ platform }) {
41
42
  label_tooltip:
42
43
  "Enable if you want to have adaptive background gradient based on audio background image.",
43
44
  },
45
+ {
46
+ key: "audio_player_background_image_query",
47
+ label: "Audio Player Image Query",
48
+ initial_value: "",
49
+ type: "text_input",
50
+ label_tooltip:
51
+ "Set the query params which control the size of the image e.g width, height. This will help to optimize the loading time, when magic background is enabled.",
52
+ },
44
53
  ],
45
54
  };
46
55
 
@@ -1655,7 +1664,8 @@ function getPlayerConfiguration({ platform }) {
1655
1664
  platform.includes("lg") ||
1656
1665
  platform.includes("samsung") ||
1657
1666
  platform.includes("android_tv") ||
1658
- platform.includes("amazon")
1667
+ platform.includes("amazon") ||
1668
+ platform.includes("vizio")
1659
1669
  ) {
1660
1670
  styles.fields.push(
1661
1671
  // Captions Menu
@@ -1786,6 +1796,30 @@ function getPlayerConfiguration({ platform }) {
1786
1796
  key: "menu_header_samsung_letter_spacing",
1787
1797
  initial_value: 0,
1788
1798
  },
1799
+ {
1800
+ type: "vizio_font_selector",
1801
+ label: "Vizio Font Family",
1802
+ key: "menu_header_vizio_font_family",
1803
+ initial_value: "SmsungOneUI-Bold",
1804
+ },
1805
+ {
1806
+ type: "number_input",
1807
+ label: "Vizio Font Size",
1808
+ key: "menu_header_vizio_font_size",
1809
+ initial_value: 30,
1810
+ },
1811
+ {
1812
+ type: "number_input",
1813
+ label: "Vizio Line Height",
1814
+ key: "menu_header_vizio_line_height",
1815
+ initial_value: 60,
1816
+ },
1817
+ {
1818
+ type: "number_input",
1819
+ label: "Vizio Letter Spacing",
1820
+ key: "menu_header_vizio_letter_spacing",
1821
+ initial_value: 0,
1822
+ },
1789
1823
  ]
1790
1824
  ),
1791
1825
  // Captions Menu - Item Text Label
@@ -1865,6 +1899,30 @@ function getPlayerConfiguration({ platform }) {
1865
1899
  key: "menu_item_samsung_letter_spacing",
1866
1900
  initial_value: 0,
1867
1901
  },
1902
+ {
1903
+ type: "vizio_font_selector",
1904
+ label: "Vizio Font Family",
1905
+ key: "menu_item_vizio_font_family",
1906
+ initial_value: "SmsungOneUI-Bold",
1907
+ },
1908
+ {
1909
+ type: "number_input",
1910
+ label: "Vizio Font Size",
1911
+ key: "menu_item_vizio_font_size",
1912
+ initial_value: 25,
1913
+ },
1914
+ {
1915
+ type: "number_input",
1916
+ label: "Vizio Line Height",
1917
+ key: "menu_item_vizio_line_height",
1918
+ initial_value: 40,
1919
+ },
1920
+ {
1921
+ type: "number_input",
1922
+ label: "Vizio Letter Spacing",
1923
+ key: "menu_item_vizio_letter_spacing",
1924
+ initial_value: 0,
1925
+ },
1868
1926
  ]
1869
1927
  ),
1870
1928
  // Captions Menu - Item Border
@@ -2008,6 +2066,18 @@ function getPlayerConfiguration({ platform }) {
2008
2066
  key: "samsung_tv_video_player_title_font_size",
2009
2067
  initial_value: 64,
2010
2068
  },
2069
+ {
2070
+ type: "vizio_font_selector",
2071
+ label: "Vizio Font Family",
2072
+ key: "vizio_video_player_title_font_family",
2073
+ initial_value: "Ubuntu-Bold",
2074
+ },
2075
+ {
2076
+ type: "number_input",
2077
+ label: "Vizio Font Size",
2078
+ key: "vizio_video_player_title_font_size",
2079
+ initial_value: 64,
2080
+ },
2011
2081
  {
2012
2082
  type: "tvos_font_selector",
2013
2083
  label: "tvOS Font Family",
@@ -2081,6 +2151,18 @@ function getPlayerConfiguration({ platform }) {
2081
2151
  key: "samsung_tv_video_player_summary_font_size",
2082
2152
  initial_value: 30,
2083
2153
  },
2154
+ {
2155
+ type: "vizio_font_selector",
2156
+ label: "Vizio Font Family",
2157
+ key: "vizio_video_player_summary_font_family",
2158
+ initial_value: "Ubuntu-Bold",
2159
+ },
2160
+ {
2161
+ type: "number_input",
2162
+ label: "Vizio Font Size",
2163
+ key: "vizio_video_player_summary_font_size",
2164
+ initial_value: 30,
2165
+ },
2084
2166
  {
2085
2167
  type: "tvos_font_selector",
2086
2168
  label: "tvOS Font Family",
@@ -2148,6 +2230,18 @@ function getPlayerConfiguration({ platform }) {
2148
2230
  key: "samsung_tv_audio_player_title_font_size",
2149
2231
  initial_value: 38,
2150
2232
  },
2233
+ {
2234
+ type: "vizio_font_selector",
2235
+ label: "Vizio Font Family",
2236
+ key: "vizio_tv_audio_player_title_font_family",
2237
+ initial_value: "Ubuntu-Bold",
2238
+ },
2239
+ {
2240
+ type: "number_input",
2241
+ label: "Vizio Font Size",
2242
+ key: "vizio_audio_player_title_font_size",
2243
+ initial_value: 38,
2244
+ },
2151
2245
  {
2152
2246
  type: "tvos_font_selector",
2153
2247
  label: "tvOS Font Family",
@@ -2203,6 +2297,18 @@ function getPlayerConfiguration({ platform }) {
2203
2297
  key: "samsung_tv_audio_player_summary_font_size",
2204
2298
  initial_value: 20,
2205
2299
  },
2300
+ {
2301
+ type: "vizio_font_selector",
2302
+ label: "Vizio Font Family",
2303
+ key: "vizio_audio_player_summary_font_family",
2304
+ initial_value: "Ubuntu-Bold",
2305
+ },
2306
+ {
2307
+ type: "number_input",
2308
+ label: "Vizio Font Size",
2309
+ key: "vizio_audio_player_summary_font_size",
2310
+ initial_value: 20,
2311
+ },
2206
2312
  {
2207
2313
  type: "tvos_font_selector",
2208
2314
  label: "tvOS Font Family",
@@ -2258,6 +2364,18 @@ function getPlayerConfiguration({ platform }) {
2258
2364
  key: "samsung_tv_player_time_font_size",
2259
2365
  initial_value: 20,
2260
2366
  },
2367
+ {
2368
+ type: "vizio_font_selector",
2369
+ label: "Vizio Font Family",
2370
+ key: "vizio_player_time_font_family",
2371
+ initial_value: "Ubuntu-Bold",
2372
+ },
2373
+ {
2374
+ type: "number_input",
2375
+ label: "Vizio Font Size",
2376
+ key: "vizio_player_time_font_size",
2377
+ initial_value: 20,
2378
+ },
2261
2379
  {
2262
2380
  type: "android_font_selector",
2263
2381
  label: "Android TV Font Family",
@@ -2313,6 +2431,18 @@ function getPlayerConfiguration({ platform }) {
2313
2431
  key: "samsung_tv_audio_player_run_time_font_size",
2314
2432
  initial_value: 20,
2315
2433
  },
2434
+ {
2435
+ type: "vizio_font_selector",
2436
+ label: "Vizio Font Family",
2437
+ key: "vizio_audio_player_run_time_font_family",
2438
+ initial_value: "Ubuntu-Bold",
2439
+ },
2440
+ {
2441
+ type: "number_input",
2442
+ label: "Vizio Font Size",
2443
+ key: "vizio_audio_player_run_time_font_size",
2444
+ initial_value: 20,
2445
+ },
2316
2446
  {
2317
2447
  type: "tvos_font_selector",
2318
2448
  label: "tvOS Font Family",
@@ -22,7 +22,11 @@ const {
22
22
  const { buttonKey } = require("./buttons");
23
23
  const { tvBadges } = require("./tvBadges");
24
24
  const { mobileProgressBar, tvProgressBar } = require("./progressBar");
25
- const { secondaryImage, getUpdatedSecondaryImageKeys } = require("./secondaryImage");
25
+
26
+ const {
27
+ secondaryImage,
28
+ getUpdatedSecondaryImageKeys,
29
+ } = require("./secondaryImage");
26
30
 
27
31
  module.exports = {
28
32
  fontKey,
@@ -17,10 +17,11 @@ const ZAPPIFEST_FIELDS = {
17
17
  lg: "lg_tv_font_selector",
18
18
  samsung: "samsung_font_selector",
19
19
  roku: "roku_font_selector",
20
+ vizio: "vizio_font_selector",
20
21
  },
21
22
  };
22
23
 
23
- const TV_PLATFORMS = ["tvOS", "android", "LG", "samsung", "roku"];
24
+ const TV_PLATFORMS = ["tvOS", "android", "LG", "samsung", "roku", "vizio"];
24
25
 
25
26
  const FontPropsForTVPlatform = (platform) => ({
26
27
  [`${R.toLower(platform)}FontFamily`]: {
@@ -132,29 +132,32 @@ function secondaryImage({
132
132
 
133
133
  const POSITION_OVER_IMAGE = toSnakeCase(position_over_image);
134
134
 
135
- const getUpdatedSecondaryImageKeys = (secondaryImageManifest) => secondaryImageManifest.fields.reduce((acc, item) => {
136
- const key = item.key;
135
+ const getUpdatedSecondaryImageKeys = (secondaryImageManifest) =>
136
+ secondaryImageManifest.fields.reduce((acc, item) => {
137
+ const key = item.key;
137
138
 
138
- const conditionalFields = (item.conditional_fields || []).map((field) => field.key);
139
+ const conditionalFields = (item.conditional_fields || []).map(
140
+ (field) => field.key
141
+ );
139
142
 
140
- const updatedConditionalFields = conditionalFields.reduce((acc, field) => {
141
- const updatedKey = field.replace("secondary_image_", "nested_image_");
143
+ const updatedConditionalFields = conditionalFields.reduce((acc, field) => {
144
+ const updatedKey = field.replace("secondary_image_", "nested_image_");
145
+
146
+ return {
147
+ ...acc,
148
+ [updatedKey]: field,
149
+ };
150
+ }, {});
151
+
152
+ const updatedKey = key.replace("secondary_image_", "nested_image_");
142
153
 
143
154
  return {
144
155
  ...acc,
145
- [updatedKey]: field,
156
+ ...updatedConditionalFields,
157
+ [updatedKey]: key,
146
158
  };
147
159
  }, {});
148
160
 
149
- const updatedKey = key.replace("secondary_image_", "nested_image_");
150
-
151
- return {
152
- ...acc,
153
- ...updatedConditionalFields,
154
- [updatedKey]: key,
155
- };
156
- }, {});
157
-
158
161
  module.exports = {
159
162
  secondaryImage,
160
163
  getUpdatedSecondaryImageKeys,
@@ -0,0 +1,57 @@
1
+ import { create } from "zustand";
2
+
3
+ interface ModalState {
4
+ visible: boolean;
5
+ screen: any;
6
+ options: Record<string, unknown>;
7
+ props: Record<string, unknown>;
8
+ }
9
+
10
+ interface ModalStore {
11
+ modalState: ModalState;
12
+ setModalState: (newState: Partial<ModalState>) => void;
13
+ openModal: (
14
+ item: any,
15
+ options?: Record<string, unknown>,
16
+ props?: Record<string, unknown>
17
+ ) => void;
18
+ dismissModal: () => void;
19
+ }
20
+
21
+ const initialModalState: ModalState = {
22
+ visible: false,
23
+ screen: null,
24
+ options: {},
25
+ props: {},
26
+ };
27
+
28
+ export const useModalStore = create<ModalStore>((set) => ({
29
+ modalState: initialModalState,
30
+ setModalState: (newState) =>
31
+ set((state) => ({
32
+ modalState: { ...state.modalState, ...newState },
33
+ })),
34
+ openModal: ({
35
+ item,
36
+ options = {},
37
+ props = { screenData: {} },
38
+ }: OpenModalArg) =>
39
+ set({
40
+ modalState: {
41
+ visible: true,
42
+ screen: item,
43
+ options: {
44
+ animated: true,
45
+ animationType: "slide",
46
+ onShow: () => {},
47
+ presentationStyle: "overFullScreen",
48
+ transparent: true,
49
+ ...options,
50
+ onDismiss: () => set({ modalState: initialModalState }),
51
+ onRequestClose: () => set({ modalState: initialModalState }),
52
+ },
53
+ props,
54
+ },
55
+ }),
56
+ dismissModal: () => set(() => ({ modalState: initialModalState })),
57
+ }));