@applicaster/zapp-react-native-utils 14.0.0-alpha.7900711229 → 14.0.0-alpha.9567513212

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 (47) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +83 -60
  2. package/appUtils/contextKeysManager/contextResolver.ts +1 -14
  3. package/arrayUtils/__tests__/isFilledArray.test.ts +1 -1
  4. package/arrayUtils/index.ts +2 -7
  5. package/configurationUtils/__tests__/configurationUtils.test.js +31 -0
  6. package/configurationUtils/index.ts +34 -63
  7. package/manifestUtils/{_internals/index.js → _internals.js} +25 -2
  8. package/manifestUtils/createConfig.js +1 -4
  9. package/manifestUtils/defaultManifestConfigurations/player.js +200 -1231
  10. package/manifestUtils/progressBar/__tests__/mobileProgressBar.test.js +30 -0
  11. package/package.json +2 -2
  12. package/playerUtils/__tests__/configurationUtils.test.ts +65 -1
  13. package/playerUtils/configurationGenerator.ts +2572 -0
  14. package/playerUtils/configurationUtils.ts +44 -0
  15. package/playerUtils/index.ts +51 -2
  16. package/playerUtils/useValidatePlayerConfig.tsx +19 -22
  17. package/reactHooks/cell-click/index.ts +1 -8
  18. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +0 -20
  19. package/reactHooks/feed/useBatchLoading.ts +2 -2
  20. package/reactHooks/feed/useFeedLoader.tsx +5 -12
  21. package/reactHooks/navigation/useRoute.ts +2 -7
  22. package/utils/index.ts +1 -12
  23. package/actionsExecutor/ScreenActions.ts +0 -163
  24. package/actionsExecutor/StorageActions.ts +0 -110
  25. package/actionsExecutor/feedDecorator.ts +0 -171
  26. package/actionsExecutor/screenResolver.ts +0 -11
  27. package/arrayUtils/__tests__/isEmptyArray.test.ts +0 -63
  28. package/audioPlayerUtils/__tests__/getArtworkImage.test.ts +0 -144
  29. package/audioPlayerUtils/__tests__/getBackgroundImage.test.ts +0 -72
  30. package/audioPlayerUtils/__tests__/getImageFromEntry.test.ts +0 -110
  31. package/audioPlayerUtils/assets/index.ts +0 -2
  32. package/audioPlayerUtils/index.ts +0 -242
  33. package/conf/player/__tests__/selectors.test.ts +0 -34
  34. package/conf/player/selectors.ts +0 -10
  35. package/configurationUtils/__tests__/getMediaItems.test.ts +0 -65
  36. package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +0 -34
  37. package/manifestUtils/_internals/getDefaultConfiguration.js +0 -28
  38. package/playerUtils/__tests__/getPlayerActionButtons.test.ts +0 -54
  39. package/playerUtils/_internals/__tests__/utils.test.ts +0 -71
  40. package/playerUtils/_internals/index.ts +0 -1
  41. package/playerUtils/_internals/utils.ts +0 -31
  42. package/playerUtils/getPlayerActionButtons.ts +0 -17
  43. package/reactHooks/navigation/useScreenStateStore.ts +0 -11
  44. package/storage/ScreenSingleValueProvider.ts +0 -197
  45. package/storage/ScreenStateMultiSelectProvider.ts +0 -282
  46. package/storage/StorageMultiSelectProvider.ts +0 -192
  47. package/storage/StorageSingleSelectProvider.ts +0 -108
@@ -18,6 +18,36 @@ describe("mobileProgressBar", () => {
18
18
  ]),
19
19
  });
20
20
 
21
+ // const timeRemainingLabelConditions = (condition) => ({
22
+ // rules: "all_conditions",
23
+ // conditional_fields: compact([
24
+ // {
25
+ // key: "assets/progress_bar_switch",
26
+ // condition_value: true,
27
+ // },
28
+ // {
29
+ // key: "assets/progress_bar_time_remaining_label_enable",
30
+ // condition_value: true,
31
+ // },
32
+ // condition,
33
+ // ]),
34
+ // });
35
+
36
+ // const watchedLabelConditions = (condition) => ({
37
+ // rules: "all_conditions",
38
+ // conditional_fields: compact([
39
+ // {
40
+ // key: "assets/progress_bar_switch",
41
+ // condition_value: true,
42
+ // },
43
+ // {
44
+ // key: "assets/progress_bar_watched_label_enable",
45
+ // condition_value: true,
46
+ // },
47
+ // condition,
48
+ // ]),
49
+ // });
50
+
21
51
  it("generate progress-bar configuration - enabled and with bottom_of_cell", () => {
22
52
  const enable = true;
23
53
  const hideUnwatched = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "14.0.0-alpha.7900711229",
3
+ "version": "14.0.0-alpha.9567513212",
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": "14.0.0-alpha.7900711229",
30
+ "@applicaster/applicaster-types": "14.0.0-alpha.9567513212",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -1,8 +1,72 @@
1
1
  import * as utils from "../configurationUtils";
2
2
 
3
- const { parseLanguageTracks } = utils;
3
+ const { modifyDefaultConfigValues, parseLanguageTracks } = utils;
4
+
5
+ const configuration = {
6
+ general: { fields: [{ key: "general_1", initial_value: true }] },
7
+ styles: { fields: [{ key: "styles_1", initial_value: true }] },
8
+ localizations: {
9
+ fields: [{ key: "localizations_1", initial_value: true, label: "label" }],
10
+ },
11
+ custom_configuration_fields: [
12
+ { key: "custom_configuration_fields_1", initial_value: true },
13
+ { key: "custom_configuration_fields_2", initial_value: "black" },
14
+ {
15
+ group: true,
16
+ fields: [{ key: "custom_configuration_fields_3", initial_value: "red" }],
17
+ },
18
+ ],
19
+ };
4
20
 
5
21
  describe("utilities", () => {
22
+ describe("modifyDefaultConfigValues", () => {
23
+ it("should not modify the configuration if a map key doesn't exist in configuration ", function () {
24
+ const res = modifyDefaultConfigValues(configuration, {
25
+ custom_configuration_fields: {
26
+ non_existing_key: { initial_value: "true" },
27
+ },
28
+ });
29
+
30
+ expect(res).toEqual(configuration);
31
+ });
32
+
33
+ it("should modify the key from mapping", function () {
34
+ const currentResult = modifyDefaultConfigValues(configuration, {
35
+ styles: { styles_1: { initial_value: false } },
36
+ });
37
+
38
+ expect(currentResult.styles.fields[0].initial_value).toBe(false);
39
+ });
40
+
41
+ it("should add extra keys the key from mapping", function () {
42
+ const currentResult = modifyDefaultConfigValues(configuration, {
43
+ styles: { styles_1: { extra_key: false } },
44
+ });
45
+
46
+ expect(currentResult.styles.fields[0].extra_key).toBeDefined();
47
+ });
48
+
49
+ it("should not remove existing keys that aren't being overwritten", function () {
50
+ const currentResult = modifyDefaultConfigValues(configuration, {
51
+ localizations: { localizations_1: { initial_value: false } },
52
+ });
53
+
54
+ expect(currentResult.localizations.fields[0].label).toBeDefined();
55
+ });
56
+
57
+ it("should modify values in groups as well", function () {
58
+ const currentResult = modifyDefaultConfigValues(configuration, {
59
+ custom_configuration_fields: {
60
+ custom_configuration_fields_3: { initial_value: "blue" },
61
+ },
62
+ });
63
+
64
+ expect(
65
+ currentResult.custom_configuration_fields[2].fields[0].initial_value
66
+ ).toBe("blue");
67
+ });
68
+ });
69
+
6
70
  describe("parseLanguageTracks", () => {
7
71
  const textTrack = { index: 0, id: "text-0" };
8
72
  const audioTrack = { index: 0, id: "audio-0" };