@applicaster/zapp-react-native-utils 15.0.0-rc.5 → 15.0.0-rc.50

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 (63) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +3 -6
  2. package/actionsExecutor/feedDecorator.ts +6 -6
  3. package/adsUtils/index.ts +2 -2
  4. package/analyticsUtils/AnalyticPlayerListener.ts +5 -2
  5. package/analyticsUtils/README.md +1 -1
  6. package/appUtils/HooksManager/index.ts +10 -10
  7. package/appUtils/accessibilityManager/const.ts +4 -0
  8. package/appUtils/accessibilityManager/hooks.ts +20 -13
  9. package/appUtils/accessibilityManager/index.ts +28 -1
  10. package/appUtils/accessibilityManager/utils.ts +36 -5
  11. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +1 -0
  12. package/appUtils/focusManager/index.ios.ts +18 -1
  13. package/appUtils/focusManagerAux/utils/index.ts +18 -0
  14. package/appUtils/focusManagerAux/utils/utils.ios.ts +35 -0
  15. package/appUtils/keyCodes/keys/keys.web.ts +1 -4
  16. package/appUtils/orientationHelper.ts +2 -4
  17. package/appUtils/platform/platformUtils.ts +117 -18
  18. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +94 -4
  19. package/appUtils/playerManager/OverlayObserver/utils.ts +32 -20
  20. package/appUtils/playerManager/conts.ts +21 -0
  21. package/appUtils/playerManager/player.ts +4 -0
  22. package/appUtils/playerManager/playerNative.ts +29 -16
  23. package/appUtils/playerManager/usePlayerState.tsx +14 -2
  24. package/arrayUtils/__tests__/allTruthy.test.ts +24 -0
  25. package/arrayUtils/__tests__/anyThruthy.test.ts +24 -0
  26. package/arrayUtils/index.ts +5 -0
  27. package/cellUtils/index.ts +32 -0
  28. package/configurationUtils/__tests__/manifestKeyParser.test.ts +26 -26
  29. package/manifestUtils/defaultManifestConfigurations/player.js +75 -1
  30. package/manifestUtils/keys.js +21 -0
  31. package/manifestUtils/sharedConfiguration/screenPicker/utils.js +1 -0
  32. package/manifestUtils/tvAction/container/index.js +1 -1
  33. package/navigationUtils/index.ts +19 -16
  34. package/package.json +2 -2
  35. package/playerUtils/usePlayerTTS.ts +8 -3
  36. package/pluginUtils/index.ts +4 -0
  37. package/reactHooks/advertising/index.ts +2 -2
  38. package/reactHooks/debugging/__tests__/index.test.js +4 -4
  39. package/reactHooks/device/useMemoizedIsTablet.ts +3 -3
  40. package/reactHooks/feed/__tests__/useEntryScreenId.test.tsx +3 -0
  41. package/reactHooks/feed/useBatchLoading.ts +7 -1
  42. package/reactHooks/feed/useEntryScreenId.ts +2 -2
  43. package/reactHooks/feed/usePipesCacheReset.ts +3 -1
  44. package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +13 -16
  45. package/reactHooks/layout/index.ts +1 -1
  46. package/reactHooks/layout/useDimensions/__tests__/{useDimensions.test.ts → useDimensions.test.tsx} +105 -25
  47. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -2
  48. package/reactHooks/navigation/index.ts +7 -6
  49. package/reactHooks/navigation/useRoute.ts +8 -6
  50. package/reactHooks/player/TVSeekControlller/TVSeekController.ts +27 -10
  51. package/reactHooks/resolvers/useCellResolver.ts +6 -2
  52. package/reactHooks/resolvers/useComponentResolver.ts +8 -2
  53. package/reactHooks/screen/__tests__/useTargetScreenData.test.tsx +10 -2
  54. package/reactHooks/screen/useTargetScreenData.ts +4 -2
  55. package/reactHooks/state/useRivers.ts +1 -1
  56. package/reactHooks/usePluginConfiguration.ts +2 -2
  57. package/testUtils/index.tsx +29 -20
  58. package/utils/__tests__/mapAccum.test.ts +73 -0
  59. package/utils/__tests__/selectors.test.ts +124 -0
  60. package/utils/index.ts +10 -0
  61. package/utils/mapAccum.ts +23 -0
  62. package/utils/selectors.ts +46 -0
  63. package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +15 -1
@@ -0,0 +1,24 @@
1
+ import { anyTruthy } from "..";
2
+
3
+ describe("anyTruthy", () => {
4
+ it("should return true when at least one value is true", () => {
5
+ expect(anyTruthy([false, true, false])).toBe(true);
6
+ });
7
+
8
+ it("should return false when all values are false", () => {
9
+ expect(anyTruthy([false, false, false])).toBe(false);
10
+ });
11
+
12
+ it("should return true when all values are true", () => {
13
+ expect(anyTruthy([true, true, true])).toBe(true);
14
+ });
15
+
16
+ it("should return false for an empty array", () => {
17
+ expect(anyTruthy([])).toBe(false);
18
+ });
19
+
20
+ it("should handle single-element arrays correctly", () => {
21
+ expect(anyTruthy([true])).toBe(true);
22
+ expect(anyTruthy([false])).toBe(false);
23
+ });
24
+ });
@@ -116,3 +116,8 @@ export const sample = (xs: unknown[]): unknown => {
116
116
 
117
117
  return xs[index];
118
118
  };
119
+
120
+ export const allTruthy = (xs: boolean[]) =>
121
+ isFilledArray(xs) && xs.every(Boolean);
122
+
123
+ export const anyTruthy = (xs: boolean[]) => xs.some(Boolean);
@@ -505,3 +505,35 @@ export const getImageContainerMarginStyles = ({ value }: { value: any }) => {
505
505
  marginRight: value("image_margin_right"),
506
506
  };
507
507
  };
508
+
509
+ export const isTextLabel = (key: string): boolean =>
510
+ key.includes("text_label_") && key.endsWith("_switch");
511
+
512
+ export const hasTextLabelsEnabled = (
513
+ configuration: Record<string, any>
514
+ ): boolean => {
515
+ const textLabelsKeys = Object.keys(configuration).filter(isTextLabel);
516
+
517
+ const picked = textLabelsKeys.reduce(
518
+ (acc, key) => {
519
+ acc[key] = configuration[key];
520
+
521
+ return acc;
522
+ },
523
+ {} as Record<string, any>
524
+ );
525
+
526
+ const pickedValues = Object.values(picked);
527
+
528
+ return pickedValues.some((value) => {
529
+ if (typeof value === "boolean") {
530
+ return value === true;
531
+ }
532
+
533
+ if (typeof value === "string") {
534
+ return value !== "" && value.toLowerCase() !== "false";
535
+ }
536
+
537
+ return Boolean(value);
538
+ });
539
+ };
@@ -50,7 +50,7 @@ describe("getAllSpecificStyles", () => {
50
50
  });
51
51
 
52
52
  expect(outStyles).toHaveProperty("default");
53
- expect(outStyles["default"]).toEqual({});
53
+ expect(outStyles.default).toEqual({});
54
54
  });
55
55
 
56
56
  it("should handle empty configuration", () => {
@@ -83,7 +83,7 @@ describe("getAllSpecificStyles", () => {
83
83
  outStyles,
84
84
  });
85
85
 
86
- expect(outStyles["default"]).toEqual({
86
+ expect(outStyles.default).toEqual({
87
87
  backgroundColor: "#FF0000",
88
88
  borderWidth: 2,
89
89
  });
@@ -104,7 +104,7 @@ describe("getAllSpecificStyles", () => {
104
104
  outStyles,
105
105
  });
106
106
 
107
- expect(outStyles["default"]).toEqual({
107
+ expect(outStyles.default).toEqual({
108
108
  backgroundColor: "#FF0000",
109
109
  textSize: 16,
110
110
  });
@@ -126,7 +126,7 @@ describe("getAllSpecificStyles", () => {
126
126
  outStyles,
127
127
  });
128
128
 
129
- expect(outStyles["default"]).toEqual({
129
+ expect(outStyles.default).toEqual({
130
130
  backgroundColor: "#FF0000",
131
131
  });
132
132
  });
@@ -148,11 +148,11 @@ describe("getAllSpecificStyles", () => {
148
148
  outStyles,
149
149
  });
150
150
 
151
- expect(outStyles["default"]).toEqual({
151
+ expect(outStyles.default).toEqual({
152
152
  backgroundColor: "#FF0000",
153
153
  });
154
154
 
155
- expect(outStyles["pressed"]).toEqual({
155
+ expect(outStyles.pressed).toEqual({
156
156
  backgroundColor: "#00FF00",
157
157
  });
158
158
  });
@@ -171,7 +171,7 @@ describe("getAllSpecificStyles", () => {
171
171
  outStyles,
172
172
  });
173
173
 
174
- expect(outStyles["focused"]).toEqual({
174
+ expect(outStyles.focused).toEqual({
175
175
  borderWidth: 3,
176
176
  });
177
177
  });
@@ -190,7 +190,7 @@ describe("getAllSpecificStyles", () => {
190
190
  outStyles,
191
191
  });
192
192
 
193
- expect(outStyles["selected"]).toEqual({
193
+ expect(outStyles.selected).toEqual({
194
194
  opacity: 0.5,
195
195
  });
196
196
  });
@@ -209,7 +209,7 @@ describe("getAllSpecificStyles", () => {
209
209
  outStyles,
210
210
  });
211
211
 
212
- expect(outStyles["focused_selected"]).toEqual({
212
+ expect(outStyles.focused_selected).toEqual({
213
213
  scale: 1.2,
214
214
  });
215
215
  });
@@ -232,21 +232,21 @@ describe("getAllSpecificStyles", () => {
232
232
  outStyles,
233
233
  });
234
234
 
235
- expect(outStyles["default"]).toEqual({
235
+ expect(outStyles.default).toEqual({
236
236
  backgroundColor: "#FF0000",
237
237
  borderWidth: 1,
238
238
  opacity: 1,
239
239
  });
240
240
 
241
241
  // Pressed should have default styles merged with its specific override
242
- expect(outStyles["pressed"]).toEqual({
242
+ expect(outStyles.pressed).toEqual({
243
243
  backgroundColor: "#00FF00", // Override
244
244
  borderWidth: 1, // From default
245
245
  opacity: 1, // From default
246
246
  });
247
247
 
248
248
  // Focused should have default styles merged with its specific override
249
- expect(outStyles["focused"]).toEqual({
249
+ expect(outStyles.focused).toEqual({
250
250
  backgroundColor: "#FF0000", // From default
251
251
  borderWidth: 1, // From default
252
252
  opacity: 0.8, // Override
@@ -270,7 +270,7 @@ describe("getAllSpecificStyles", () => {
270
270
  outStyles,
271
271
  });
272
272
 
273
- expect(outStyles["pressed"]).toEqual({
273
+ expect(outStyles.pressed).toEqual({
274
274
  existingKey: "existingValue", // Should be preserved
275
275
  backgroundColor: "#FF0000", // From default
276
276
  textColor: "#FFFFFF", // New pressed style
@@ -294,7 +294,7 @@ describe("getAllSpecificStyles", () => {
294
294
  outStyles,
295
295
  });
296
296
 
297
- expect(outStyles["default"]).toEqual({
297
+ expect(outStyles.default).toEqual({
298
298
  backgroundColor: "#FF0000", // Samsung-specific should be included
299
299
  });
300
300
  });
@@ -317,7 +317,7 @@ describe("getAllSpecificStyles", () => {
317
317
  outStyles,
318
318
  });
319
319
 
320
- expect(outStyles["default"]).toEqual({
320
+ expect(outStyles.default).toEqual({
321
321
  backgroundColor: "#FFFFFF", // Only non-platform specific
322
322
  });
323
323
  });
@@ -336,7 +336,7 @@ describe("getAllSpecificStyles", () => {
336
336
  outStyles,
337
337
  });
338
338
 
339
- expect(outStyles["default"]).toEqual({
339
+ expect(outStyles.default).toEqual({
340
340
  color: "#FF0000",
341
341
  });
342
342
  });
@@ -356,7 +356,7 @@ describe("getAllSpecificStyles", () => {
356
356
  outStyles,
357
357
  });
358
358
 
359
- expect(outStyles["pressed"]).toEqual({
359
+ expect(outStyles.pressed).toEqual({
360
360
  backgroundColor: "#FF0000", // Only samsung style
361
361
  });
362
362
  });
@@ -377,7 +377,7 @@ describe("getAllSpecificStyles", () => {
377
377
  outStyles,
378
378
  });
379
379
 
380
- expect(outStyles["default"]).toEqual({
380
+ expect(outStyles.default).toEqual({
381
381
  backgroundColor: "#00FF00", // Samsung-specific should win
382
382
  });
383
383
  });
@@ -412,14 +412,14 @@ describe("getAllSpecificStyles", () => {
412
412
  outStyles,
413
413
  });
414
414
 
415
- expect(outStyles["default"]).toEqual({
415
+ expect(outStyles.default).toEqual({
416
416
  backgroundColor: "#FFFFFF",
417
417
  textColor: "#000000",
418
418
  borderWidth: 1,
419
419
  padding: 10,
420
420
  });
421
421
 
422
- expect(outStyles["pressed"]).toEqual({
422
+ expect(outStyles.pressed).toEqual({
423
423
  backgroundColor: "#EEEEEE",
424
424
  textColor: "#000000",
425
425
  borderWidth: 1,
@@ -427,7 +427,7 @@ describe("getAllSpecificStyles", () => {
427
427
  opacity: 0.8,
428
428
  });
429
429
 
430
- expect(outStyles["focused"]).toEqual({
430
+ expect(outStyles.focused).toEqual({
431
431
  backgroundColor: "#FFFFFF",
432
432
  textColor: "#000000",
433
433
  borderWidth: 1,
@@ -453,7 +453,7 @@ describe("getAllSpecificStyles", () => {
453
453
  outStyles,
454
454
  });
455
455
 
456
- expect(outStyles["default"]).toEqual({
456
+ expect(outStyles.default).toEqual({
457
457
  validKey: "included",
458
458
  });
459
459
  });
@@ -474,11 +474,11 @@ describe("getAllSpecificStyles", () => {
474
474
  outStyles,
475
475
  });
476
476
 
477
- expect(outStyles["focused_selected"]).toEqual({
477
+ expect(outStyles.focused_selected).toEqual({
478
478
  test: "focused_selected_value",
479
479
  });
480
480
 
481
- expect(outStyles["focused"]).toEqual({
481
+ expect(outStyles.focused).toEqual({
482
482
  another: "focused_value",
483
483
  });
484
484
  });
@@ -517,7 +517,7 @@ describe("getAllSpecificStyles", () => {
517
517
  outStyles,
518
518
  });
519
519
 
520
- expect(outStyles["pressed"]["backgroundColor"]).toBe("#222222");
520
+ expect(outStyles.pressed.backgroundColor).toBe("#222222");
521
521
  });
522
522
 
523
523
  it("should handle frozen outStyles properties", () => {
@@ -537,7 +537,7 @@ describe("getAllSpecificStyles", () => {
537
537
  });
538
538
 
539
539
  // Should create new object instead of mutating frozen one
540
- expect(outStyles["default"]).toEqual({
540
+ expect(outStyles.default).toEqual({
541
541
  existingProp: "value",
542
542
  backgroundColor: "#FF0000",
543
543
  });
@@ -335,6 +335,20 @@ function getPlayerConfiguration({ platform, version }) {
335
335
  };
336
336
 
337
337
  if (isTV(platform)) {
338
+ localizations.fields.push({
339
+ key: "back_to_live_label",
340
+ label: "Back to live label",
341
+ initial_value: "Back To Live",
342
+ type: "text_input",
343
+ });
344
+
345
+ localizations.fields.push({
346
+ key: "start_over_label",
347
+ label: "Start over label",
348
+ initial_value: "Start Over",
349
+ type: "text_input",
350
+ });
351
+
338
352
  styles.fields.push(
339
353
  fieldsGroup("Always Show Scrub Bar & Timestamp", "", [
340
354
  {
@@ -447,7 +461,7 @@ function getPlayerConfiguration({ platform, version }) {
447
461
  ),
448
462
  fieldsGroup(
449
463
  "Skip Button",
450
- "This section allows you to configure the skip button styles for tv",
464
+ "This section allows you to configure the skip button behaviour",
451
465
  [
452
466
  {
453
467
  type: "switch",
@@ -464,6 +478,12 @@ function getPlayerConfiguration({ platform, version }) {
464
478
  label: "Persistent Button Toggle",
465
479
  initial_value: true,
466
480
  },
481
+ ]
482
+ ),
483
+ fieldsGroup(
484
+ "Labeled Button Style",
485
+ "This section allows you to configure the labeled button styles",
486
+ [
467
487
  {
468
488
  type: "color_picker_rgba",
469
489
  label_tooltip: "",
@@ -619,6 +639,44 @@ function getPlayerConfiguration({ platform, version }) {
619
639
  );
620
640
  }
621
641
 
642
+ if (isTV(platform)) {
643
+ general.fields.push(
644
+ {
645
+ key: "liveSeekingEnabled",
646
+ label: "Live Seeking Enabled",
647
+ initial_value: false,
648
+ type: "switch",
649
+ label_tooltip: "Enable Live Seek",
650
+ },
651
+ {
652
+ key: "minimumAllowedSeekableDurationInSeconds",
653
+ label: "Minimum allowed seekable duration in seconds",
654
+ initial_value: 300,
655
+ type: "number_input",
656
+ label_tooltip:
657
+ "If duration less than this value, player will disable 'liveSeekingEnabled' value",
658
+ },
659
+ {
660
+ key: "live_image",
661
+ label: "Live badge",
662
+ type: "uploader",
663
+ label_tooltip: "Override default live badge / icon",
664
+ },
665
+ {
666
+ key: "live_width",
667
+ label: "Live badge width",
668
+ type: "number_input",
669
+ initial_value: 85,
670
+ },
671
+ {
672
+ key: "live_height",
673
+ label: "Live badge height",
674
+ type: "number_input",
675
+ initial_value: 50,
676
+ }
677
+ );
678
+ }
679
+
622
680
  if (isMobile(platform)) {
623
681
  general.fields.push(
624
682
  {
@@ -3429,6 +3487,22 @@ function getPlayerConfiguration({ platform, version }) {
3429
3487
  label_tooltip:
3430
3488
  "This field allows you to override the player configuration / initialization options. i.e. html5: { vhs: { limitRenditionByPlayerDimensions: false } } Please ensure your configuration matches the player you are targeting, and that it is a valid json. See config options here: https://videojs.com/guides/options/",
3431
3489
  },
3490
+ {
3491
+ key: "advanced_player_styles",
3492
+ label: "Advanced Player Styles",
3493
+ type: "text_input",
3494
+ multiline: true,
3495
+ initial_value: `.vjs-text-track-cue {
3496
+ inset: unset !important;
3497
+ top: 94% !important;
3498
+ bottom: 0 !important;
3499
+ left: 0 !important;
3500
+ right: 0 !important;
3501
+ width: 100% !important;
3502
+ }`,
3503
+ label_tooltip:
3504
+ "This field allows you to inject custom CSS styles to override default player styles. The styles will be injected into the document head and can be used to customize the appearance of the player. Leave empty to use only default styles.",
3505
+ },
3432
3506
  {
3433
3507
  key: "use_dashjs_player",
3434
3508
  label: "Use Enhanced Player for DASH streams",
@@ -959,6 +959,27 @@ const TV_CELL_LABEL_FIELDS = [
959
959
  rules: "conditional",
960
960
  conditions: [{ key: "switch", section: "styles", value: true }],
961
961
  },
962
+ {
963
+ type: ZAPPIFEST_FIELDS.font_selector.roku,
964
+ suffix: "roku font family",
965
+ tooltip: "",
966
+ rules: "conditional",
967
+ conditions: [{ key: "switch", section: "styles", value: true }],
968
+ },
969
+ {
970
+ type: ZAPPIFEST_FIELDS.number_input,
971
+ suffix: "roku font size",
972
+ tooltip: "",
973
+ rules: "conditional",
974
+ conditions: [{ key: "switch", section: "styles", value: true }],
975
+ },
976
+ {
977
+ type: ZAPPIFEST_FIELDS.number_input,
978
+ suffix: "roku line height",
979
+ tooltip: "",
980
+ rules: "conditional",
981
+ conditions: [{ key: "switch", section: "styles", value: true }],
982
+ },
962
983
  {
963
984
  type: ZAPPIFEST_FIELDS.select,
964
985
  suffix: "text alignment",
@@ -3,6 +3,7 @@ const defaultPlatforms = {
3
3
  android_tv: "Android TV",
4
4
  lg_tv: "LG TV",
5
5
  samsung_tv: "Samsung TV",
6
+ roku: "Roku TV",
6
7
  };
7
8
 
8
9
  const global_defaults = {
@@ -38,7 +38,7 @@ function tvActionButtonsContainer({ label, description, defaults }) {
38
38
  generateFieldsFromDefaultsWithoutPrefixedLabel(
39
39
  label,
40
40
  defaults,
41
- tvActionButtonContainerFields(defaults["position"])
41
+ tvActionButtonContainerFields(defaults.position)
42
42
  )
43
43
  );
44
44
 
@@ -575,24 +575,27 @@ export function routeIsPlayerScreen(currentRoute) {
575
575
  return currentRoute?.includes("/playable");
576
576
  }
577
577
 
578
- export const getNavBarProps =
579
- (currentRiver: ZappRiver, pathname: string, title: string) => () => {
580
- const props = getNavigationPropsV2({
581
- currentRiver,
582
- title,
583
- category: "nav_bar",
584
- });
578
+ export const getNavBarProps = (
579
+ currentRiver: ZappRiver,
580
+ pathname: string,
581
+ title: string
582
+ ) => {
583
+ const props = getNavigationPropsV2({
584
+ currentRiver,
585
+ title,
586
+ category: "nav_bar",
587
+ });
585
588
 
586
- if (props) {
587
- return {
588
- ...props,
589
- id: pathname,
590
- pathname: pathname,
591
- };
592
- }
589
+ if (props) {
590
+ return {
591
+ ...props,
592
+ id: pathname,
593
+ pathname: pathname,
594
+ };
595
+ }
593
596
 
594
- return null;
595
- };
597
+ return null;
598
+ };
596
599
 
597
600
  export const findMenuPlugin = (
598
601
  navigations: ZappNavigation[],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-rc.5",
3
+ "version": "15.0.0-rc.50",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "15.0.0-rc.5",
30
+ "@applicaster/applicaster-types": "15.0.0-rc.50",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -1,14 +1,19 @@
1
1
  import * as React from "react";
2
2
  import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
3
- import { useAccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
3
+ import {
4
+ useAccessibilityManager,
5
+ useAccessibilityState,
6
+ } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
4
7
  import { PlayerTTS } from "@applicaster/zapp-react-native-utils/playerUtils/PlayerTTS";
5
8
 
6
9
  export const usePlayerTTS = () => {
7
10
  const player = usePlayer();
8
11
  const accessibilityManager = useAccessibilityManager({});
12
+ const accessibilityState = useAccessibilityState();
13
+ const isScreenReaderEnabled = accessibilityState.screenReaderEnabled;
9
14
 
10
15
  React.useEffect(() => {
11
- if (player && accessibilityManager) {
16
+ if (player && accessibilityManager && isScreenReaderEnabled) {
12
17
  const playerTTS = new PlayerTTS(player, accessibilityManager);
13
18
  const unsubscribe = playerTTS.init();
14
19
 
@@ -17,5 +22,5 @@ export const usePlayerTTS = () => {
17
22
  playerTTS.destroy();
18
23
  };
19
24
  }
20
- }, [player, accessibilityManager]);
25
+ }, [player, accessibilityManager, isScreenReaderEnabled]);
21
26
  };
@@ -6,6 +6,7 @@ import { deprecationMessage } from "../appUtils";
6
6
 
7
7
  import { pluginUtilsLogger } from "./logger";
8
8
  import { platformSelect } from "../reactUtils";
9
+ import { get } from "../utils";
9
10
 
10
11
  type PluginModule = any;
11
12
  type Plugin = {
@@ -254,3 +255,6 @@ const getPluginType = R.pathOr("unknown_plugin_type", [
254
255
 
255
256
  export const isPlayerPlugin = (routeState): boolean =>
256
257
  getPluginType(routeState) === "player";
258
+
259
+ export const getPluginModuleUrlScheme = (plugin) =>
260
+ get(plugin, ["module", "urlScheme"]);
@@ -3,7 +3,7 @@ import { View } from "react-native";
3
3
  import * as R from "ramda";
4
4
 
5
5
  import { useNavigation } from "../navigation";
6
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
6
+ import { usePlugins } from "@applicaster/zapp-react-native-redux/hooks";
7
7
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
8
8
  import { dismissModal, openModal } from "../../modalState";
9
9
 
@@ -16,7 +16,7 @@ const ModalContainer = platformSelect({
16
16
 
17
17
  export function useAdvertisingInterstitial() {
18
18
  const { screenData, currentRoute } = useNavigation();
19
- const { plugins } = usePickFromState();
19
+ const plugins = usePlugins();
20
20
 
21
21
  return useEffect(() => {
22
22
  // TODD: typing problem: fix any type
@@ -27,20 +27,20 @@ describe("Debug utils", () => {
27
27
  it("should create new timer if timer with a label does not exist", () => {
28
28
  performanceNowMock.mockReturnValue(1000);
29
29
  time("timer1");
30
- expect(timers["timer1"]).toBeDefined();
31
- expect(timers["timer1"].startTime).toBe(1000);
30
+ expect(timers.timer1).toBeDefined();
31
+ expect(timers.timer1.startTime).toBe(1000);
32
32
  });
33
33
 
34
34
  it("should update start time of timer if timer with a label exists", () => {
35
35
  // First call to time()
36
36
  performanceNowMock.mockReturnValue(1000);
37
37
  time("timer1");
38
- const previousStartTime = timers["timer1"].startTime;
38
+ const previousStartTime = timers.timer1.startTime;
39
39
 
40
40
  // Second call to time()
41
41
  performanceNowMock.mockReturnValue(2000);
42
42
  time("timer1");
43
- const currentStartTime = timers["timer1"].startTime;
43
+ const currentStartTime = timers.timer1.startTime;
44
44
 
45
45
  expect(previousStartTime).toBe(1000);
46
46
  expect(currentStartTime).toBe(2000);
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
3
2
  import { useIsTablet } from "./useIsTablet";
3
+ import { useAppData } from "@applicaster/zapp-react-native-redux";
4
4
 
5
5
  export const useMemoizedIsTablet = () => {
6
6
  const isTablet = useIsTablet();
@@ -14,9 +14,9 @@ export const useMemoizedIsTablet = () => {
14
14
  };
15
15
 
16
16
  export const useIsTabletLandscape = (): boolean => {
17
- const { appData } = usePickFromState(["appData"]);
17
+ const { isTabletPortrait } = useAppData();
18
18
 
19
19
  const isTablet = useIsTablet();
20
20
 
21
- return isTablet && !appData.isTabletPortrait;
21
+ return isTablet && !isTabletPortrait;
22
22
  };
@@ -10,6 +10,9 @@ describe("useEntryScreenId", () => {
10
10
  const mappedScreenId = "mapped-id";
11
11
 
12
12
  const initialState = {
13
+ rivers: {
14
+ [mappedScreenId]: { id: mappedScreenId, type: "any" },
15
+ },
13
16
  contentTypes: { mappedEntry: { screen_id: mappedScreenId } },
14
17
  };
15
18
 
@@ -151,7 +151,13 @@ export const useBatchLoading = (
151
151
  }
152
152
  }
153
153
  });
154
- }, [feedUrls, feeds, loadPipesDataDispatcher]);
154
+ }, [
155
+ batchComponents,
156
+ feeds,
157
+ getUrl,
158
+ loadPipesDataDispatcher,
159
+ options.riverId,
160
+ ]);
155
161
 
156
162
  React.useEffect(() => {
157
163
  runBatchLoading();
@@ -1,7 +1,7 @@
1
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
1
+ import { useContentTypes } from "@applicaster/zapp-react-native-redux";
2
2
 
3
3
  export const useEntryScreenId = (entry?: ZappEntry): string | undefined => {
4
- const { contentTypes } = usePickFromState("contentTypes");
4
+ const contentTypes = useContentTypes();
5
5
 
6
6
  if (!entry) {
7
7
  return;
@@ -34,7 +34,9 @@ export const usePipesCacheReset = (riverId, riverComponents) => {
34
34
  component
35
35
  );
36
36
 
37
- dispatch(clearPipesData(url, { riverId }));
37
+ if (url) {
38
+ dispatch(clearPipesData(url, { riverId }));
39
+ }
38
40
  }
39
41
  });
40
42
  };