@applicaster/zapp-react-native-utils 14.0.0-alpha.1718713411 → 14.0.0-alpha.1740013076

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 (80) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +60 -84
  2. package/actionsExecutor/ScreenActions.ts +164 -0
  3. package/actionsExecutor/StorageActions.ts +110 -0
  4. package/actionsExecutor/feedDecorator.ts +171 -0
  5. package/actionsExecutor/screenResolver.ts +11 -0
  6. package/analyticsUtils/AnalyticsEvents/helper.ts +1 -1
  7. package/analyticsUtils/AnalyticsEvents/sendHeaderClickEvent.ts +1 -1
  8. package/analyticsUtils/AnalyticsEvents/sendMenuClickEvent.ts +2 -1
  9. package/analyticsUtils/__tests__/analyticsUtils.test.js +0 -11
  10. package/analyticsUtils/index.tsx +3 -4
  11. package/analyticsUtils/manager.ts +1 -1
  12. package/analyticsUtils/playerAnalyticsTracker.ts +2 -1
  13. package/appUtils/HooksManager/Hook.ts +4 -4
  14. package/appUtils/HooksManager/index.ts +11 -1
  15. package/appUtils/accessibilityManager/const.ts +13 -0
  16. package/appUtils/accessibilityManager/hooks.ts +35 -1
  17. package/appUtils/accessibilityManager/index.ts +150 -29
  18. package/appUtils/accessibilityManager/utils.ts +24 -0
  19. package/appUtils/contextKeysManager/contextResolver.ts +42 -1
  20. package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +5 -0
  21. package/appUtils/focusManager/__tests__/focusManager.test.js +1 -1
  22. package/appUtils/focusManager/index.ios.ts +10 -0
  23. package/appUtils/focusManager/index.ts +82 -11
  24. package/appUtils/focusManager/treeDataStructure/Tree/index.js +1 -1
  25. package/appUtils/focusManagerAux/utils/index.ts +106 -3
  26. package/appUtils/platform/platformUtils.ts +31 -1
  27. package/arrayUtils/index.ts +1 -1
  28. package/componentsUtils/__tests__/isTabsScreen.test.ts +38 -0
  29. package/componentsUtils/index.ts +4 -1
  30. package/configurationUtils/__tests__/manifestKeyParser.test.ts +546 -0
  31. package/configurationUtils/index.ts +1 -1
  32. package/configurationUtils/manifestKeyParser.ts +57 -32
  33. package/index.d.ts +1 -10
  34. package/manifestUtils/defaultManifestConfigurations/player.js +16 -150
  35. package/manifestUtils/index.js +0 -4
  36. package/manifestUtils/keys.js +0 -12
  37. package/manifestUtils/sharedConfiguration/screenPicker/stylesFields.js +0 -6
  38. package/navigationUtils/__tests__/mapContentTypesToRivers.test.ts +130 -0
  39. package/navigationUtils/index.ts +7 -5
  40. package/package.json +2 -3
  41. package/playerUtils/PlayerTTS/PlayerTTS.ts +359 -0
  42. package/playerUtils/PlayerTTS/index.ts +1 -0
  43. package/playerUtils/usePlayerTTS.ts +21 -0
  44. package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +15 -14
  45. package/reactHooks/cell-click/__tests__/index.test.js +3 -0
  46. package/reactHooks/cell-click/index.ts +8 -1
  47. package/reactHooks/debugging/__tests__/index.test.js +0 -1
  48. package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +47 -90
  49. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +71 -31
  50. package/reactHooks/feed/index.ts +2 -0
  51. package/reactHooks/feed/useBatchLoading.ts +15 -8
  52. package/reactHooks/feed/useFeedLoader.tsx +36 -34
  53. package/reactHooks/feed/useLoadPipesDataDispatch.ts +63 -0
  54. package/reactHooks/feed/usePipesCacheReset.ts +2 -2
  55. package/reactHooks/flatList/useSequentialRenderItem.tsx +3 -3
  56. package/reactHooks/layout/__tests__/index.test.tsx +3 -1
  57. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +34 -36
  58. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -3
  59. package/reactHooks/layout/useLayoutVersion.ts +5 -5
  60. package/reactHooks/navigation/index.ts +7 -5
  61. package/reactHooks/navigation/useRoute.ts +7 -2
  62. package/reactHooks/navigation/useScreenStateStore.ts +8 -0
  63. package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +4 -0
  64. package/reactHooks/state/index.ts +1 -1
  65. package/reactHooks/state/useHomeRiver.ts +4 -2
  66. package/reactHooks/state/useRivers.ts +7 -8
  67. package/screenPickerUtils/index.ts +7 -0
  68. package/storage/ScreenSingleValueProvider.ts +204 -0
  69. package/storage/ScreenStateMultiSelectProvider.ts +293 -0
  70. package/storage/StorageMultiSelectProvider.ts +192 -0
  71. package/storage/StorageSingleSelectProvider.ts +108 -0
  72. package/testUtils/index.tsx +7 -8
  73. package/time/BackgroundTimer.ts +1 -1
  74. package/utils/__tests__/find.test.ts +36 -0
  75. package/utils/__tests__/pathOr.test.ts +37 -0
  76. package/utils/__tests__/startsWith.test.ts +30 -0
  77. package/utils/find.ts +3 -0
  78. package/utils/index.ts +8 -0
  79. package/utils/pathOr.ts +5 -0
  80. package/utils/startsWith.ts +9 -0
@@ -0,0 +1,30 @@
1
+ import { startsWith } from "../startsWith";
2
+
3
+ describe("startsWith", () => {
4
+ it("returns false when str is null", () => {
5
+ expect(startsWith("a", null)).toBe(false);
6
+ });
7
+
8
+ it("returns false when str is undefined", () => {
9
+ expect(startsWith("a", undefined)).toBe(false);
10
+ });
11
+
12
+ it("returns true when string starts with target", () => {
13
+ expect(startsWith("he", "hello")).toBe(true);
14
+ expect(startsWith("", "hello")).toBe(true); // empty target always matches
15
+ });
16
+
17
+ it("returns false when string does not start with target", () => {
18
+ expect(startsWith("yo", "hello")).toBe(false);
19
+ });
20
+
21
+ it("works with single character target", () => {
22
+ expect(startsWith("h", "hello")).toBe(true);
23
+ expect(startsWith("x", "hello")).toBe(false);
24
+ });
25
+
26
+ it("is case-sensitive", () => {
27
+ expect(startsWith("He", "hello")).toBe(false);
28
+ expect(startsWith("he", "hello")).toBe(true);
29
+ });
30
+ });
package/utils/find.ts ADDED
@@ -0,0 +1,3 @@
1
+ export const find = (predicate, xs) => {
2
+ return (xs || []).find((x, index) => predicate(x, index));
3
+ };
package/utils/index.ts CHANGED
@@ -2,6 +2,12 @@ export { chunk } from "./chunk";
2
2
 
3
3
  export { times } from "./times";
4
4
 
5
+ export { startsWith } from "./startsWith";
6
+
7
+ export { find } from "./find";
8
+
9
+ export { pathOr } from "./pathOr";
10
+
5
11
  export {
6
12
  cloneDeep as clone,
7
13
  flatten,
@@ -14,7 +20,9 @@ export {
14
20
  flatMap,
15
21
  difference,
16
22
  take,
23
+ pick,
17
24
  map,
18
25
  trim,
19
26
  toString,
27
+ last,
20
28
  } from "lodash";
@@ -0,0 +1,5 @@
1
+ import { get } from "lodash";
2
+
3
+ export const pathOr = (defaultValue, path, record) => {
4
+ return get(record, path, defaultValue);
5
+ };
@@ -0,0 +1,9 @@
1
+ import { isNil } from "lodash";
2
+
3
+ export const startsWith = (target, str) => {
4
+ if (isNil(str)) {
5
+ return false;
6
+ }
7
+
8
+ return str.startsWith(target);
9
+ };