@applicaster/zapp-react-native-ui-components 15.0.0-rc.98 → 15.1.0-alpha.1852552014

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 (138) hide show
  1. package/Components/BackgroundImage/BackgroundImage.tv.android.tsx +28 -0
  2. package/Components/BackgroundImage/BackgroundImage.tv.ios.tsx +24 -0
  3. package/Components/BackgroundImage/BackgroundImage.tv.web.tsx +42 -0
  4. package/Components/BackgroundImage/index.ts +8 -0
  5. package/Components/BaseFocusable/index.ios.ts +2 -12
  6. package/Components/Cell/FocusableWrapper.tsx +0 -3
  7. package/Components/Cell/TvOSCellComponent.tsx +0 -5
  8. package/Components/CellRendererResolver/index.ts +1 -1
  9. package/Components/ComponentResolver/__tests__/componentResolver.test.js +1 -1
  10. package/Components/Focusable/Focusable.tsx +2 -4
  11. package/Components/Focusable/FocusableTvOS.tsx +1 -18
  12. package/Components/Focusable/__tests__/__snapshots__/FocusableTvOS.test.tsx.snap +0 -1
  13. package/Components/FocusableGroup/FocusableTvOS.tsx +12 -37
  14. package/Components/GeneralContentScreen/GeneralContentScreen.tsx +39 -28
  15. package/Components/GeneralContentScreen/__tests__/GeneralContentScreen.test.tsx +104 -0
  16. package/Components/GeneralContentScreen/utils/__tests__/getScreenDataSource.test.ts +19 -0
  17. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +1 -1
  18. package/Components/GeneralContentScreen/utils/getScreenDataSource.ts +9 -0
  19. package/Components/HandlePlayable/HandlePlayable.tsx +24 -42
  20. package/Components/HandlePlayable/utils.ts +31 -0
  21. package/Components/HookRenderer/HookRenderer.tsx +40 -10
  22. package/Components/HookRenderer/__tests__/HookRenderer.test.tsx +60 -0
  23. package/Components/Layout/FullWidthRow.tsx +38 -0
  24. package/Components/Layout/TV/ScreenContainer.tsx +11 -2
  25. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +5 -1
  26. package/Components/Layout/TV/index.tsx +6 -6
  27. package/Components/Layout/TV/index.web.tsx +6 -6
  28. package/Components/LinkHandler/LinkHandler.tsx +2 -2
  29. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +10 -4
  30. package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +1 -5
  31. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +3 -11
  32. package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +1 -9
  33. package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +14 -15
  34. package/Components/MasterCell/DefaultComponents/LiveImage/__tests__/prepareEntry.test.ts +352 -0
  35. package/Components/MasterCell/DefaultComponents/LiveImage/executePreloadHooks.ts +136 -0
  36. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +34 -16
  37. package/Components/MasterCell/DefaultComponents/SecondaryImage/hooks/__tests__/useGetImageDimensions.test.ts +6 -7
  38. package/Components/MasterCell/DefaultComponents/Text/index.tsx +2 -6
  39. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +2 -6
  40. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/getPluginIdentifier.test.ts +11 -233
  41. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/index.ts +15 -19
  42. package/Components/MasterCell/dataAdapter.ts +15 -5
  43. package/Components/MasterCell/index.tsx +10 -1
  44. package/Components/MasterCell/utils/__tests__/resolveColor.test.js +169 -132
  45. package/Components/MasterCell/utils/__tests__/resolveColorForProp.test.js +92 -0
  46. package/Components/MasterCell/utils/index.ts +89 -46
  47. package/Components/Navigator/StackNavigator.tsx +6 -0
  48. package/Components/OfflineHandler/NotificationView/NotificationView.tsx +2 -2
  49. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +18 -17
  50. package/Components/OfflineHandler/__tests__/index.test.tsx +18 -27
  51. package/Components/PlayerContainer/PlayerContainer.tsx +20 -34
  52. package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +286 -0
  53. package/Components/PreloaderWrapper/__tests__/index.test.tsx +26 -0
  54. package/Components/PreloaderWrapper/index.tsx +15 -0
  55. package/Components/River/ComponentsMap/ComponentsMap.tsx +15 -0
  56. package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +1 -1
  57. package/Components/River/RefreshControl.tsx +9 -3
  58. package/Components/River/RiverItem.tsx +26 -20
  59. package/Components/River/TV/River.tsx +14 -31
  60. package/Components/River/TV/index.tsx +4 -8
  61. package/Components/River/TV/withTVEventHandler.tsx +36 -0
  62. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +1 -15
  63. package/Components/Screen/TV/hooks/__tests__/useAfterPaint.test.ts +60 -0
  64. package/Components/Screen/TV/hooks/index.ts +2 -0
  65. package/Components/Screen/TV/hooks/useAfterPaint.ts +23 -0
  66. package/Components/Screen/TV/index.web.tsx +18 -11
  67. package/Components/Screen/__tests__/Screen.test.tsx +43 -65
  68. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +44 -68
  69. package/Components/Screen/hooks.ts +76 -5
  70. package/Components/Screen/index.tsx +18 -7
  71. package/Components/Screen/orientationHandler.ts +3 -3
  72. package/Components/ScreenFeedLoader/ScreenFeedLoader.tsx +46 -0
  73. package/Components/ScreenFeedLoader/__tests__/ScreenFeedLoader.test.tsx +94 -0
  74. package/Components/ScreenFeedLoader/index.ts +1 -0
  75. package/Components/ScreenResolver/__tests__/screenResolver.test.js +24 -0
  76. package/Components/ScreenResolver/hooks/index.ts +3 -0
  77. package/Components/ScreenResolver/hooks/useGetComponent.ts +15 -0
  78. package/Components/ScreenResolver/hooks/useScreenComponentResolver.tsx +90 -0
  79. package/Components/ScreenResolver/index.tsx +9 -115
  80. package/Components/ScreenResolver/utils/__tests__/getScreenTypeProps.test.ts +45 -0
  81. package/Components/ScreenResolver/utils/getScreenTypeProps.ts +43 -0
  82. package/Components/ScreenResolver/utils/index.ts +1 -0
  83. package/Components/ScreenResolver/withDefaultScreenContext.tsx +16 -0
  84. package/Components/ScreenResolverFeedProvider/ScreenResolverFeedProvider.tsx +25 -0
  85. package/Components/ScreenResolverFeedProvider/__tests__/ScreenResolverFeedProvider.test.tsx +44 -0
  86. package/Components/ScreenResolverFeedProvider/index.ts +1 -0
  87. package/Components/ScreenRevealManager/Overlay.tsx +34 -0
  88. package/Components/ScreenRevealManager/ScreenRevealManager.ts +8 -40
  89. package/Components/ScreenRevealManager/__tests__/Overlay.test.tsx +88 -0
  90. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +69 -86
  91. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +10 -18
  92. package/Components/Tabs/TabContent.tsx +4 -7
  93. package/Components/Transitioner/Scene.tsx +9 -15
  94. package/Components/Transitioner/index.js +3 -3
  95. package/Components/VideoLive/LiveImageManager.ts +209 -53
  96. package/Components/VideoLive/PlayerLiveImageComponent.tsx +32 -32
  97. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +2 -17
  98. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +5 -5
  99. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +7 -15
  100. package/Components/VideoModal/utils.ts +16 -13
  101. package/Components/Viewport/ViewportEvents/__tests__/viewportEvents.test.js +1 -1
  102. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +12 -5
  103. package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +2 -2
  104. package/Components/ZappUIComponent/index.tsx +12 -6
  105. package/Components/index.js +1 -1
  106. package/Contexts/CachedDimensionsContext/index.ts +17 -2
  107. package/Contexts/ScreenContext/__tests__/index.test.tsx +57 -0
  108. package/Contexts/ScreenContext/index.tsx +64 -26
  109. package/Contexts/ScreenTrackedViewPositionsContext/__tests__/index.test.tsx +1 -1
  110. package/Contexts/ZappPipesContext/ZappPipesContextFactory.tsx +18 -7
  111. package/Decorators/Analytics/index.tsx +5 -6
  112. package/Decorators/ConfigurationWrapper/__tests__/__snapshots__/withConfigurationProvider.test.tsx.snap +0 -1
  113. package/Decorators/ConfigurationWrapper/const.ts +0 -1
  114. package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -7
  115. package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +212 -5
  116. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +1 -1
  117. package/Decorators/ZappPipesDataConnector/index.tsx +2 -2
  118. package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +1 -1
  119. package/Helpers/ComponentCellSelectionHelper/index.js +0 -6
  120. package/Helpers/DataSourceHelper/index.js +19 -0
  121. package/Helpers/index.js +7 -40
  122. package/events/index.ts +2 -0
  123. package/events/scrollEndReached.ts +15 -0
  124. package/package.json +5 -5
  125. package/Components/Layout/TV/LayoutBackground.tsx +0 -31
  126. package/Components/MasterCell/DefaultComponents/Text/utils/__tests__/withAdjustedLineHeight.test.ts +0 -46
  127. package/Components/MasterCell/DefaultComponents/Text/utils/index.ts +0 -21
  128. package/Components/PlayerContainer/ErrorDisplay/ErrorDisplay.tsx +0 -57
  129. package/Components/PlayerContainer/ErrorDisplay/index.ts +0 -9
  130. package/Components/PlayerContainer/useRestrictMobilePlayback.tsx +0 -101
  131. package/Components/River/TV/utils/__tests__/toStringOrEmpty.test.ts +0 -30
  132. package/Components/River/TV/utils/index.ts +0 -4
  133. package/Components/River/TV/withFocusableGroupForContent.tsx +0 -71
  134. package/Components/Screen/utils.ts +0 -16
  135. package/Helpers/Analytics/index.js +0 -95
  136. package/Helpers/DataSourceHelper/__tests__/itemLimitForData.test.ts +0 -80
  137. package/Helpers/DataSourceHelper/index.ts +0 -19
  138. /package/Components/HookRenderer/{index.tsx → index.ts} +0 -0
@@ -1,15 +1,9 @@
1
- import { getPluginIdentifier, memoizedGetPluginIdentifier } from "..";
1
+ import { getPluginIdentifier } from "..";
2
2
 
3
3
  describe("getPluginIdentifier", () => {
4
4
  const prefix = "tv_buttons";
5
5
 
6
- beforeAll(() => {
7
- memoizedGetPluginIdentifier.clear();
8
- });
9
-
10
- it("returns the first valid plugin identifier", () => {
11
- expect.assertions(2);
12
-
6
+ it("get first plugin identifier", () => {
13
7
  const configuration = {
14
8
  tv_buttons_button_1_other: "value",
15
9
  tv_buttons_button_1_assign_action:
@@ -19,21 +13,13 @@ describe("getPluginIdentifier", () => {
19
13
  };
20
14
 
21
15
  const index = 0;
22
- const result = getPluginIdentifier(configuration, prefix, index);
23
16
 
24
- const memoizedResult = memoizedGetPluginIdentifier(
25
- configuration,
26
- prefix,
27
- index
28
- );
17
+ const result = getPluginIdentifier(configuration, prefix, index);
29
18
 
30
19
  expect(result).toEqual(configuration.tv_buttons_button_1_assign_action);
31
- expect(memoizedResult).toEqual(result);
32
20
  });
33
21
 
34
- it("returns the second valid plugin identifier", () => {
35
- expect.assertions(2);
36
-
22
+ it("get second plugin identifier", () => {
37
23
  const configuration = {
38
24
  tv_buttons_button_1_other: "value_1",
39
25
  tv_buttons_button_1_assign_action:
@@ -44,216 +30,24 @@ describe("getPluginIdentifier", () => {
44
30
  };
45
31
 
46
32
  const index = 1;
47
- const result = getPluginIdentifier(configuration, prefix, index);
48
33
 
49
- const memoizedResult = memoizedGetPluginIdentifier(
50
- configuration,
51
- prefix,
52
- index
53
- );
34
+ const result = getPluginIdentifier(configuration, prefix, index);
54
35
 
55
36
  expect(result).toEqual(configuration.tv_buttons_button_2_assign_action);
56
- expect(memoizedResult).toEqual(result);
57
37
  });
58
38
 
59
- it("returns undefined when there are no assign_action keys", () => {
60
- expect.assertions(2);
61
-
39
+ it("get undefined if no assign_actions at all", () => {
62
40
  const configuration = {};
63
- const index = 0;
64
-
65
- const result = getPluginIdentifier(configuration, prefix, index);
66
-
67
- const memoizedResult = memoizedGetPluginIdentifier(
68
- configuration,
69
- prefix,
70
- index
71
- );
72
-
73
- expect(result).toBeUndefined();
74
- expect(memoizedResult).toBeUndefined();
75
- });
76
-
77
- it("skips undefined values and returns the correct plugin identifier", () => {
78
- expect.assertions(2);
79
-
80
- const configuration = {
81
- tv_buttons_button_1_assign_action: "tv_buttons_button_1_assign_action",
82
- tv_buttons_button_2_assign_action: undefined,
83
- tv_buttons_button_3_assign_action: "tv_buttons_button_3_assign_action",
84
- };
85
-
86
- const index = 1;
87
- const result = getPluginIdentifier(configuration, prefix, index);
88
-
89
- const memoizedResult = memoizedGetPluginIdentifier(
90
- configuration,
91
- prefix,
92
- index
93
- );
94
-
95
- expect(result).toEqual(configuration.tv_buttons_button_3_assign_action);
96
- expect(memoizedResult).toEqual(result);
97
- });
98
-
99
- it("handles missing intermediate keys and returns the correct plugin identifier", () => {
100
- expect.assertions(2);
101
-
102
- const configuration = {
103
- tv_buttons_button_1_assign_action: "tv_buttons_button_1_assign_action",
104
- tv_buttons_button_3_assign_action: "tv_buttons_button_3_assign_action",
105
- };
106
-
107
- const index = 1;
108
- const result = getPluginIdentifier(configuration, prefix, index);
109
-
110
- const memoizedResult = memoizedGetPluginIdentifier(
111
- configuration,
112
- prefix,
113
- index
114
- );
115
-
116
- expect(result).toEqual(configuration.tv_buttons_button_3_assign_action);
117
- expect(memoizedResult).toEqual(result);
118
- });
119
-
120
- it("skips empty string values and returns the first non-empty assign_action", () => {
121
- expect.assertions(2);
122
-
123
- const configuration = {
124
- tv_buttons_button_1_assign_action: "",
125
- tv_buttons_button_2_assign_action: "tv_buttons_button_2_assign_action",
126
- };
127
41
 
128
42
  const index = 0;
129
- const result = getPluginIdentifier(configuration, prefix, index);
130
-
131
- const memoizedResult = memoizedGetPluginIdentifier(
132
- configuration,
133
- prefix,
134
- index
135
- );
136
-
137
- expect(result).toEqual(configuration.tv_buttons_button_2_assign_action);
138
- expect(memoizedResult).toEqual(result);
139
- });
140
-
141
- it("returns undefined for negative index", () => {
142
- expect.assertions(2);
143
-
144
- const configuration = {
145
- tv_buttons_button_1_assign_action: "a",
146
- tv_buttons_button_2_assign_action: "b",
147
- };
148
43
 
149
- const index = -1;
150
44
  const result = getPluginIdentifier(configuration, prefix, index);
151
45
 
152
- const memoizedResult = memoizedGetPluginIdentifier(
153
- configuration,
154
- prefix,
155
- index
156
- );
157
-
158
46
  expect(result).toBeUndefined();
159
- expect(memoizedResult).toBeUndefined();
160
- });
161
-
162
- it("returns undefined for out-of-bounds index", () => {
163
- expect.assertions(2);
164
-
165
- const configuration = {
166
- tv_buttons_button_1_assign_action: "a",
167
- tv_buttons_button_2_assign_action: "b",
168
- };
169
-
170
- const index = 5;
171
- const result = getPluginIdentifier(configuration, prefix, index);
172
-
173
- const memoizedResult = memoizedGetPluginIdentifier(
174
- configuration,
175
- prefix,
176
- index
177
- );
178
-
179
- expect(result).toBeUndefined();
180
- expect(memoizedResult).toBeUndefined();
181
- });
182
-
183
- it("ignores keys with wrong prefix or format", () => {
184
- expect.assertions(2);
185
-
186
- const configuration = {
187
- tv_buttons_button_1_assign_action: "a",
188
- tv_buttons_wrongprefix_2_assign_action: "b",
189
- tv_buttons_button_x_assign_action: "c",
190
- };
191
-
192
- const index = 1;
193
- const result = getPluginIdentifier(configuration, prefix, index);
194
-
195
- const memoizedResult = memoizedGetPluginIdentifier(
196
- configuration,
197
- prefix,
198
- index
199
- );
200
-
201
- expect(result).toBeUndefined();
202
- expect(memoizedResult).toBeUndefined();
203
- });
204
-
205
- it("returns undefined if all assign_actions are null or empty", () => {
206
- expect.assertions(2);
207
-
208
- const configuration = {
209
- tv_buttons_button_1_assign_action: null,
210
- tv_buttons_button_2_assign_action: undefined,
211
- tv_buttons_button_3_assign_action: "",
212
- };
213
-
214
- const index = 0;
215
- const result = getPluginIdentifier(configuration, prefix, index);
216
-
217
- const memoizedResult = memoizedGetPluginIdentifier(
218
- configuration,
219
- prefix,
220
- index
221
- );
222
-
223
- expect(result).toBeUndefined();
224
- expect(memoizedResult).toBeUndefined();
225
- });
226
-
227
- it("handles non-string values correctly", () => {
228
- expect.assertions(6);
229
-
230
- const configuration = {
231
- tv_buttons_button_1_assign_action: 123,
232
- tv_buttons_button_2_assign_action: true,
233
- tv_buttons_button_3_assign_action: { nested: "value" },
234
- };
235
-
236
- expect(getPluginIdentifier(configuration, prefix, 0)).toEqual(123);
237
- expect(getPluginIdentifier(configuration, prefix, 1)).toEqual(true);
238
-
239
- expect(getPluginIdentifier(configuration, prefix, 2)).toEqual({
240
- nested: "value",
241
- });
242
-
243
- expect(memoizedGetPluginIdentifier(configuration, prefix, 0)).toEqual(123);
244
- expect(memoizedGetPluginIdentifier(configuration, prefix, 1)).toEqual(true);
245
-
246
- expect(memoizedGetPluginIdentifier(configuration, prefix, 2)).toEqual({
247
- nested: "value",
248
- });
249
47
  });
250
48
  });
251
49
 
252
- describe("getPluginIdentifier - when configuration has duplicate values", () => {
253
- beforeAll(() => {
254
- memoizedGetPluginIdentifier.clear();
255
- });
256
-
50
+ describe("getPluginIdentifier - when configuration has same values for different keys", () => {
257
51
  const prefix = "tv_buttons";
258
52
 
259
53
  const configuration = {
@@ -261,35 +55,19 @@ describe("getPluginIdentifier - when configuration has duplicate values", () =>
261
55
  tv_buttons_button_2_assign_action: "navigation_action",
262
56
  };
263
57
 
264
- it("returns the first plugin identifier when values are identical", () => {
265
- expect.assertions(2);
266
-
58
+ it("get first plugin identifier", () => {
267
59
  const index = 0;
268
- const result = getPluginIdentifier(configuration, prefix, index);
269
60
 
270
- const memoizedResult = memoizedGetPluginIdentifier(
271
- configuration,
272
- prefix,
273
- index
274
- );
61
+ const result = getPluginIdentifier(configuration, prefix, index);
275
62
 
276
63
  expect(result).toEqual(configuration.tv_buttons_button_1_assign_action);
277
- expect(memoizedResult).toEqual(result);
278
64
  });
279
65
 
280
- it("returns the second plugin identifier when values are identical", () => {
281
- expect.assertions(2);
282
-
66
+ it("get second plugin identifier", () => {
283
67
  const index = 1;
284
- const result = getPluginIdentifier(configuration, prefix, index);
285
68
 
286
- const memoizedResult = memoizedGetPluginIdentifier(
287
- configuration,
288
- prefix,
289
- index
290
- );
69
+ const result = getPluginIdentifier(configuration, prefix, index);
291
70
 
292
71
  expect(result).toEqual(configuration.tv_buttons_button_2_assign_action);
293
- expect(memoizedResult).toEqual(result);
294
72
  });
295
73
  });
@@ -1,7 +1,7 @@
1
1
  import * as R from "ramda";
2
- import memoizee from "memoizee";
3
2
 
4
3
  import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
4
+ import { isNotNil } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
5
5
 
6
6
  export const getButtonsCount = (
7
7
  configuration: Record<string, unknown>,
@@ -21,26 +21,22 @@ export const getPluginIdentifier = (
21
21
  configuration: Record<string, unknown>,
22
22
  prefix: string,
23
23
  index: number
24
- ): string | undefined => {
25
- const re = new RegExp(`${prefix}_button_\\d_assign_action`);
26
- let count = 0;
27
-
28
- for (const [key, value] of Object.entries(configuration)) {
29
- if (
30
- key.startsWith(`${prefix}_button`) &&
31
- re.test(key) &&
32
- value != null &&
33
- value !== ""
34
- ) {
35
- if (count === index) return value as string;
36
- count++;
37
- }
38
- }
24
+ ): string => {
25
+ const match = `${prefix}_button_\\d_assign_action`;
26
+ const re = new RegExp(match);
39
27
 
40
- return undefined;
41
- };
28
+ const rejectNils = R.compose(R.path([index]), R.filter(isNotNil));
42
29
 
43
- export const memoizedGetPluginIdentifier = memoizee(getPluginIdentifier);
30
+ return rejectNils(
31
+ R.toPairs(configuration)
32
+ .filter(([key]) => R.startsWith(`${prefix}_button`, key))
33
+ .map(([key, value]) => {
34
+ const matched = key.match(re);
35
+
36
+ return matched ? value : undefined;
37
+ })
38
+ );
39
+ };
44
40
 
45
41
  type Label = {
46
42
  name: string;
@@ -1,5 +1,6 @@
1
1
  import * as R from "ramda";
2
2
  import { isFunction } from "@applicaster/zapp-react-native-utils/functionUtils";
3
+ import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
3
4
 
4
5
  import { functionForName } from "./MappingFunctions";
5
6
  import { resolveColor } from "./utils";
@@ -50,7 +51,8 @@ export function configInflater(
50
51
  additionalProps?: Record<string, any>;
51
52
  data?: Array<{ propName: string; func: Function; args: any[] }>;
52
53
  elements?: any[];
53
- }
54
+ },
55
+ allowDynamicColorsOutsideExtensions: boolean
54
56
  ) {
55
57
  const props = data.reduce(
56
58
  (acc, curr) => {
@@ -65,13 +67,13 @@ export function configInflater(
65
67
 
66
68
  if (Array.isArray(elements)) {
67
69
  adjustedElements = elements.map((element) =>
68
- configInflater(entry, element as any)
70
+ configInflater(entry, element as any, allowDynamicColorsOutsideExtensions)
69
71
  );
70
72
  }
71
73
 
72
74
  return {
73
75
  type,
74
- style: resolveColor(entry, style),
76
+ style: resolveColor(entry, style, allowDynamicColorsOutsideExtensions),
75
77
  props,
76
78
  elements: adjustedElements,
77
79
  };
@@ -95,9 +97,17 @@ function resolveElementsNode(entry, state, elements) {
95
97
  }
96
98
 
97
99
  export function defaultDataAdapter(elements) {
98
- return function elementsBuilder({ entry, state = "default" }) {
100
+ return function elementsBuilder({
101
+ entry,
102
+ state = "default",
103
+ allowDynamicColorsOutsideExtensions,
104
+ }) {
99
105
  return resolveElementsNode(entry, state, elements).map((element) =>
100
- configInflater(entry, element)
106
+ configInflater(
107
+ entry,
108
+ element,
109
+ toBooleanWithDefaultFalse(allowDynamicColorsOutsideExtensions)
110
+ )
101
111
  );
102
112
  };
103
113
  }
@@ -3,6 +3,7 @@ import * as React from "react";
3
3
  import { v4 as uuid } from "uuid";
4
4
 
5
5
  import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
6
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
6
7
  import { useScreenState } from "@applicaster/zapp-react-native-utils/screenState";
7
8
  import { defaultComponents } from "./DefaultComponents";
8
9
  import { defaultDataAdapter } from "./dataAdapter";
@@ -65,6 +66,7 @@ export function masterCellBuilder({
65
66
  */
66
67
  function MasterCell({ item, state, ...otherProps }: Props) {
67
68
  const { screenData } = useRoute();
69
+ const theme = useTheme();
68
70
 
69
71
  const screenId =
70
72
  screenData && "targetScreen" in screenData
@@ -85,8 +87,15 @@ export function masterCellBuilder({
85
87
  elementsBuilder({
86
88
  entry: item,
87
89
  state: getEntryState(state, entryIsSelected),
90
+ allowDynamicColorsOutsideExtensions:
91
+ theme?.allow_dynamic_colors_outside_extensions,
88
92
  }),
89
- [state, item, entryIsSelected] // Assuming that item won't mutate
93
+ [
94
+ state,
95
+ item,
96
+ entryIsSelected,
97
+ theme?.allow_dynamic_colors_outside_extensions,
98
+ ] // Assuming that item won't mutate
90
99
  );
91
100
 
92
101
  const wrapperRef = React.useRef(null);