@applicaster/zapp-react-native-utils 13.0.0-alpha.9433330286 → 13.0.0-rc.10

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 (37) hide show
  1. package/appUtils/HooksManager/{Hook.ts → Hook.js} +23 -35
  2. package/appUtils/HooksManager/__tests__/__snapshots__/hook.test.js.snap +2 -4
  3. package/appUtils/HooksManager/__tests__/hook.test.js +184 -196
  4. package/appUtils/HooksManager/__tests__/hooksManager.test.js +99 -96
  5. package/appUtils/HooksManager/{constants.ts → constants.js} +1 -1
  6. package/appUtils/HooksManager/{index.ts → index.js} +112 -121
  7. package/appUtils/RiverFocusManager/index.js +12 -17
  8. package/appUtils/focusManager/treeDataStructure/Tree/index.js +3 -2
  9. package/appUtils/focusManager/treeDataStructure/Utils/index.js +3 -1
  10. package/appUtils/{index.ts → index.js} +1 -1
  11. package/appUtils/keyCodes/__tests__/keyCodes.test.js +3 -3
  12. package/appUtils/keyCodes/{index.ts → index.js} +0 -2
  13. package/appUtils/keyCodes/{keys/keyEventMapper.ts → keys.android.js} +19 -0
  14. package/appUtils/keyCodes/keys.ios.js +46 -0
  15. package/appUtils/platform/platformUtils.ts +14 -0
  16. package/appUtils/playerManager/index.ts +6 -2
  17. package/domUtils/{cookieManager.ts → cookieManager.js} +2 -1
  18. package/functionUtils/index.ts +11 -15
  19. package/modalState/index.ts +5 -1
  20. package/navigationUtils/index.ts +5 -14
  21. package/package.json +2 -2
  22. package/reactHooks/navigation/index.ts +4 -7
  23. package/reactUtils/index.ts +14 -0
  24. package/appUtils/HooksManager/__tests__/__snapshots__/hooksManager.test.js.snap +0 -693
  25. package/appUtils/HooksManager/types.ts +0 -116
  26. package/appUtils/keyCodes/keys/index.ts +0 -3
  27. package/appUtils/keyCodes/keys/keys.android.ts +0 -18
  28. package/appUtils/keyCodes/keys/keys.ios.ts +0 -25
  29. package/appUtils/keyCodes/keys/keys.ts +0 -15
  30. package/appUtils/keyCodes/keysByPlatform.ts +0 -8
  31. /package/appUtils/HooksManager/{logger.ts → logger.js} +0 -0
  32. /package/appUtils/{directionHelper.ts → directionHelper.js} +0 -0
  33. /package/appUtils/keyCodes/{androidTVKeys.ts → androidTVKeys.js} +0 -0
  34. /package/appUtils/keyCodes/{keys/keys.web.ts → keys.web.js} +0 -0
  35. /package/appUtils/keyCodes/{keys/keysByPlatform.ts → keysByPlatform.js} +0 -0
  36. /package/appUtils/{localizationsHelper.ts → localizationsHelper.js} +0 -0
  37. /package/domUtils/{logger.ts → logger.js} +0 -0
@@ -1,693 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`HooksManager when target route is playable executes the player hook 1`] = `
4
- Array [
5
- Object {
6
- "callback": [Function],
7
- "hookPlugin": Hook {
8
- "configuration": Object {
9
- "config_field": "bar",
10
- },
11
- "identifier": "headless_player_hook",
12
- "lastHook": true,
13
- "manager": Object {
14
- "executeHook": [Function],
15
- "handleHooks": [Function],
16
- "presentScreenHook": [Function],
17
- "runInBackground": [Function],
18
- "subscriber": Object {
19
- "handlers": Object {
20
- "complete": Array [
21
- [MockFunction] {
22
- "calls": Array [
23
- Array [
24
- Object {
25
- "callback": [Function],
26
- "hookPlugin": [Circular],
27
- "payload": Object {
28
- "foo": "bar",
29
- },
30
- },
31
- [Function],
32
- ],
33
- ],
34
- "results": Array [
35
- Object {
36
- "type": "return",
37
- "value": undefined,
38
- },
39
- ],
40
- },
41
- ],
42
- "presentScreenHook": Array [
43
- [MockFunction],
44
- ],
45
- "success": Array [
46
- [MockFunction] {
47
- "calls": Array [
48
- [Circular],
49
- ],
50
- "results": Array [
51
- Object {
52
- "type": "return",
53
- "value": undefined,
54
- },
55
- ],
56
- },
57
- ],
58
- },
59
- "invokeHandler": [Function],
60
- "on": [Function],
61
- "removeHandler": [Function],
62
- },
63
- },
64
- "module": Object {
65
- "hasPlayerHook": true,
66
- "run": [MockFunction] {
67
- "calls": Array [
68
- Array [
69
- Object {
70
- "foo": "bar",
71
- },
72
- [Function],
73
- Object {
74
- "config_field": "bar",
75
- },
76
- ],
77
- ],
78
- "results": Array [
79
- Object {
80
- "type": "return",
81
- "value": undefined,
82
- },
83
- ],
84
- },
85
- },
86
- "state": 7,
87
- "weight": 1,
88
- },
89
- "payload": Object {
90
- "foo": "bar",
91
- },
92
- },
93
- [Function],
94
- ]
95
- `;
96
-
97
- exports[`HooksManager when target route is playable executes the player hook 2`] = `
98
- Array [
99
- Object {
100
- "callback": [Function],
101
- "hookPlugin": Hook {
102
- "configuration": Object {
103
- "config_field": "bar",
104
- },
105
- "identifier": "headless_player_hook",
106
- "lastHook": true,
107
- "manager": Object {
108
- "executeHook": [Function],
109
- "handleHooks": [Function],
110
- "presentScreenHook": [Function],
111
- "runInBackground": [Function],
112
- "subscriber": Object {
113
- "handlers": Object {
114
- "complete": Array [
115
- [MockFunction] {
116
- "calls": Array [
117
- [Circular],
118
- ],
119
- "results": Array [
120
- Object {
121
- "type": "return",
122
- "value": undefined,
123
- },
124
- ],
125
- },
126
- ],
127
- "presentScreenHook": Array [
128
- [MockFunction],
129
- ],
130
- "success": Array [
131
- [MockFunction] {
132
- "calls": Array [
133
- Array [
134
- Object {
135
- "callback": [Function],
136
- "hookPlugin": [Circular],
137
- "payload": Object {
138
- "foo": "bar",
139
- },
140
- },
141
- [Function],
142
- ],
143
- ],
144
- "results": Array [
145
- Object {
146
- "type": "return",
147
- "value": undefined,
148
- },
149
- ],
150
- },
151
- ],
152
- },
153
- "invokeHandler": [Function],
154
- "on": [Function],
155
- "removeHandler": [Function],
156
- },
157
- },
158
- "module": Object {
159
- "hasPlayerHook": true,
160
- "run": [MockFunction] {
161
- "calls": Array [
162
- Array [
163
- Object {
164
- "foo": "bar",
165
- },
166
- [Function],
167
- Object {
168
- "config_field": "bar",
169
- },
170
- ],
171
- ],
172
- "results": Array [
173
- Object {
174
- "type": "return",
175
- "value": undefined,
176
- },
177
- ],
178
- },
179
- },
180
- "state": 7,
181
- "weight": 1,
182
- },
183
- "payload": Object {
184
- "foo": "bar",
185
- },
186
- },
187
- [Function],
188
- ]
189
- `;
190
-
191
- exports[`HooksManager when there are preload hooks hook with screen: executes 1`] = `
192
- Array [
193
- Object {
194
- "callback": [Function],
195
- "hookPlugin": Hook {
196
- "advertising": Object {},
197
- "configuration": Object {
198
- "name": "hook_screen",
199
- },
200
- "data": Object {},
201
- "general": Object {
202
- "allow_screen_plugin_presentation": true,
203
- "is_flow_blocker": true,
204
- },
205
- "home": false,
206
- "hooks": Object {
207
- "postload_plugins": Array [],
208
- "preload_plugins": Array [],
209
- },
210
- "id": "1bb8ad39-a42e-4096-a134-56aadbd35c83",
211
- "identifier": "hook_screen",
212
- "lastHook": true,
213
- "manager": Object {
214
- "executeHook": [Function],
215
- "handleHooks": [Function],
216
- "presentScreenHook": [Function],
217
- "runInBackground": [Function],
218
- "subscriber": Object {
219
- "handlers": Object {
220
- "complete": Array [
221
- [MockFunction] {
222
- "calls": Array [
223
- Array [
224
- Object {
225
- "callback": [Function],
226
- "hookPlugin": [Circular],
227
- "payload": Object {
228
- "foo": "bar",
229
- },
230
- },
231
- [Function],
232
- ],
233
- ],
234
- "results": Array [
235
- Object {
236
- "type": "return",
237
- "value": undefined,
238
- },
239
- ],
240
- },
241
- ],
242
- "presentScreenHook": Array [
243
- [MockFunction] {
244
- "calls": Array [
245
- Array [
246
- Object {
247
- "hookPlugin": [Circular],
248
- "payload": Object {
249
- "callback": [Function],
250
- "hookPlugin": [Circular],
251
- "payload": Object {
252
- "foo": "bar",
253
- },
254
- },
255
- "route": "/hooks/1bb8ad39-a42e-4096-a134-56aadbd35c83",
256
- },
257
- [Function],
258
- ],
259
- ],
260
- "results": Array [
261
- Object {
262
- "type": "return",
263
- "value": undefined,
264
- },
265
- ],
266
- },
267
- ],
268
- "success": Array [
269
- [MockFunction] {
270
- "calls": Array [
271
- [Circular],
272
- ],
273
- "results": Array [
274
- Object {
275
- "type": "return",
276
- "value": undefined,
277
- },
278
- ],
279
- },
280
- ],
281
- },
282
- "invokeHandler": [Function],
283
- "on": [Function],
284
- "removeHandler": [Function],
285
- },
286
- },
287
- "module": Object {
288
- "isFlowBlocker": [Function],
289
- "run": [MockFunction],
290
- },
291
- "name": "Hook: F_blocker, allow_P, present",
292
- "navigations": Array [
293
- Object {
294
- "assets": Object {
295
- "arrow_image_url": "https://assets-secure.applicaster.com/zapp/default_ui_components/default_assets/side_menu/arrow.png",
296
- "close_button_image_url": "https://assets-secure.applicaster.com/zapp/default_ui_components/default_assets/side_menu/close.png",
297
- },
298
- "category": "menu",
299
- "default": false,
300
- "id": "3d7b4d04-1526-4116-baeb-bfb28f40f07b",
301
- "name": "2-Level Menu",
302
- "nav_items": Array [
303
- Object {
304
- "assets": Object {},
305
- "data": Object {
306
- "connected": null,
307
- "source": null,
308
- "target": "29cf3064-6acd-4a7f-961a-503a7d4fa8f9",
309
- "type": null,
310
- },
311
- "general": Object {
312
- "home": false,
313
- "new": false,
314
- },
315
- "id": "f0387fba-636f-43e0-9a4f-e4fff551e1c0",
316
- "position": 1,
317
- "styles": Object {},
318
- "title": "Home",
319
- "type": "label",
320
- },
321
- Object {
322
- "assets": Object {},
323
- "data": Object {
324
- "connected": null,
325
- "source": null,
326
- "target": "b886e64a-1234-4cd5-96ce-69629f11cdf8",
327
- "type": null,
328
- },
329
- "general": Object {
330
- "home": false,
331
- "new": false,
332
- },
333
- "id": "c666eb1e-46d3-4dcb-8b8c-a7c0fe560deb",
334
- "position": 2,
335
- "styles": Object {},
336
- "title": "All Shows",
337
- "type": "label",
338
- },
339
- Object {
340
- "assets": Object {},
341
- "data": Object {
342
- "connected": null,
343
- "source": null,
344
- "target": "8b57d5ad-dc15-42b4-9e6d-1ce5a3c36922",
345
- "type": null,
346
- },
347
- "general": Object {
348
- "home": false,
349
- "new": false,
350
- },
351
- "id": "f969f1d8-e0cc-4ca6-ba71-5d219929f2b6",
352
- "position": 3,
353
- "styles": Object {},
354
- "title": "Screen Picker",
355
- "type": "label",
356
- },
357
- ],
358
- "navigation_type": "two_level_rn_menu",
359
- "rules": Object {
360
- "screen_transition": "slide-from-left",
361
- },
362
- "styles": Object {
363
- "align": "default",
364
- "android_font_family": "Roboto-Regular",
365
- "android_font_size": "13",
366
- "android_header_font_family": "Roboto-Regular",
367
- "android_header_font_size": "10",
368
- "background_color": "#fff8f8f8",
369
- "background_type": "color",
370
- "header_text_color": "#ffc4c4c4",
371
- "ios_font_family": "HelveticaNeue-Medium",
372
- "ios_font_size": "12",
373
- "ios_header_font_family": "HelveticaNeue-Medium",
374
- "ios_header_font_size": "10",
375
- "item_background_color": "#ff363c4a",
376
- "item_text_color": "#ffffffff",
377
- "selected_item_background_color": "#ff363c4a",
378
- "selected_item_text_color": "#ff27da86",
379
- "separation_line_color": "#00000000",
380
- },
381
- },
382
- Object {
383
- "assets": Object {},
384
- "category": "nav_bar",
385
- "default": true,
386
- "id": "357084dc-d2c0-4780-8dd6-295e18c7cc7f",
387
- "name": "Navigation Bar",
388
- "nav_items": Array [
389
- Object {
390
- "assets": Object {},
391
- "data": Object {
392
- "connected": null,
393
- "source": null,
394
- "target": "b886e64a-1234-4cd5-96ce-69629f11cdf8",
395
- "type": null,
396
- },
397
- "general": Object {
398
- "home": false,
399
- "new": false,
400
- },
401
- "id": "500f03b6-17ba-4533-ad20-985272484c1d",
402
- "position": 1,
403
- "styles": Object {},
404
- "title": "All Shows",
405
- "type": "button",
406
- },
407
- ],
408
- "navigation_type": "navigation_bar",
409
- "rules": Object {},
410
- "styles": Object {
411
- "android_font_family": "Roboto-Medium",
412
- "background_color": "#ff4a90e2",
413
- "background_type": "Color",
414
- "ios_font_family": "HelveticaNeue-Medium",
415
- "presentation_style": "title",
416
- "state": "on_top",
417
- "style": "center",
418
- "title_color": "#ffffffff",
419
- "title_size": "16",
420
- "title_size_tablet": "18",
421
- },
422
- },
423
- ],
424
- "rules": Object {},
425
- "screen_id": "1bb8ad39-a42e-4096-a134-56aadbd35c83",
426
- "state": 7,
427
- "styles": Object {
428
- "family": "FAMILY_1",
429
- "presentation": "present",
430
- },
431
- "type": "general",
432
- "ui_components": Array [],
433
- "weight": 7,
434
- },
435
- "payload": Object {
436
- "foo": "bar",
437
- },
438
- },
439
- [Function],
440
- ]
441
- `;
442
-
443
- exports[`HooksManager when there are preload hooks hook with screen: executes 2`] = `
444
- Array [
445
- Object {
446
- "callback": [Function],
447
- "hookPlugin": Hook {
448
- "advertising": Object {},
449
- "configuration": Object {
450
- "name": "hook_screen",
451
- },
452
- "data": Object {},
453
- "general": Object {
454
- "allow_screen_plugin_presentation": true,
455
- "is_flow_blocker": true,
456
- },
457
- "home": false,
458
- "hooks": Object {
459
- "postload_plugins": Array [],
460
- "preload_plugins": Array [],
461
- },
462
- "id": "1bb8ad39-a42e-4096-a134-56aadbd35c83",
463
- "identifier": "hook_screen",
464
- "lastHook": true,
465
- "manager": Object {
466
- "executeHook": [Function],
467
- "handleHooks": [Function],
468
- "presentScreenHook": [Function],
469
- "runInBackground": [Function],
470
- "subscriber": Object {
471
- "handlers": Object {
472
- "complete": Array [
473
- [MockFunction] {
474
- "calls": Array [
475
- [Circular],
476
- ],
477
- "results": Array [
478
- Object {
479
- "type": "return",
480
- "value": undefined,
481
- },
482
- ],
483
- },
484
- ],
485
- "presentScreenHook": Array [
486
- [MockFunction] {
487
- "calls": Array [
488
- Array [
489
- Object {
490
- "hookPlugin": [Circular],
491
- "payload": Object {
492
- "callback": [Function],
493
- "hookPlugin": [Circular],
494
- "payload": Object {
495
- "foo": "bar",
496
- },
497
- },
498
- "route": "/hooks/1bb8ad39-a42e-4096-a134-56aadbd35c83",
499
- },
500
- [Function],
501
- ],
502
- ],
503
- "results": Array [
504
- Object {
505
- "type": "return",
506
- "value": undefined,
507
- },
508
- ],
509
- },
510
- ],
511
- "success": Array [
512
- [MockFunction] {
513
- "calls": Array [
514
- Array [
515
- Object {
516
- "callback": [Function],
517
- "hookPlugin": [Circular],
518
- "payload": Object {
519
- "foo": "bar",
520
- },
521
- },
522
- [Function],
523
- ],
524
- ],
525
- "results": Array [
526
- Object {
527
- "type": "return",
528
- "value": undefined,
529
- },
530
- ],
531
- },
532
- ],
533
- },
534
- "invokeHandler": [Function],
535
- "on": [Function],
536
- "removeHandler": [Function],
537
- },
538
- },
539
- "module": Object {
540
- "isFlowBlocker": [Function],
541
- "run": [MockFunction],
542
- },
543
- "name": "Hook: F_blocker, allow_P, present",
544
- "navigations": Array [
545
- Object {
546
- "assets": Object {
547
- "arrow_image_url": "https://assets-secure.applicaster.com/zapp/default_ui_components/default_assets/side_menu/arrow.png",
548
- "close_button_image_url": "https://assets-secure.applicaster.com/zapp/default_ui_components/default_assets/side_menu/close.png",
549
- },
550
- "category": "menu",
551
- "default": false,
552
- "id": "3d7b4d04-1526-4116-baeb-bfb28f40f07b",
553
- "name": "2-Level Menu",
554
- "nav_items": Array [
555
- Object {
556
- "assets": Object {},
557
- "data": Object {
558
- "connected": null,
559
- "source": null,
560
- "target": "29cf3064-6acd-4a7f-961a-503a7d4fa8f9",
561
- "type": null,
562
- },
563
- "general": Object {
564
- "home": false,
565
- "new": false,
566
- },
567
- "id": "f0387fba-636f-43e0-9a4f-e4fff551e1c0",
568
- "position": 1,
569
- "styles": Object {},
570
- "title": "Home",
571
- "type": "label",
572
- },
573
- Object {
574
- "assets": Object {},
575
- "data": Object {
576
- "connected": null,
577
- "source": null,
578
- "target": "b886e64a-1234-4cd5-96ce-69629f11cdf8",
579
- "type": null,
580
- },
581
- "general": Object {
582
- "home": false,
583
- "new": false,
584
- },
585
- "id": "c666eb1e-46d3-4dcb-8b8c-a7c0fe560deb",
586
- "position": 2,
587
- "styles": Object {},
588
- "title": "All Shows",
589
- "type": "label",
590
- },
591
- Object {
592
- "assets": Object {},
593
- "data": Object {
594
- "connected": null,
595
- "source": null,
596
- "target": "8b57d5ad-dc15-42b4-9e6d-1ce5a3c36922",
597
- "type": null,
598
- },
599
- "general": Object {
600
- "home": false,
601
- "new": false,
602
- },
603
- "id": "f969f1d8-e0cc-4ca6-ba71-5d219929f2b6",
604
- "position": 3,
605
- "styles": Object {},
606
- "title": "Screen Picker",
607
- "type": "label",
608
- },
609
- ],
610
- "navigation_type": "two_level_rn_menu",
611
- "rules": Object {
612
- "screen_transition": "slide-from-left",
613
- },
614
- "styles": Object {
615
- "align": "default",
616
- "android_font_family": "Roboto-Regular",
617
- "android_font_size": "13",
618
- "android_header_font_family": "Roboto-Regular",
619
- "android_header_font_size": "10",
620
- "background_color": "#fff8f8f8",
621
- "background_type": "color",
622
- "header_text_color": "#ffc4c4c4",
623
- "ios_font_family": "HelveticaNeue-Medium",
624
- "ios_font_size": "12",
625
- "ios_header_font_family": "HelveticaNeue-Medium",
626
- "ios_header_font_size": "10",
627
- "item_background_color": "#ff363c4a",
628
- "item_text_color": "#ffffffff",
629
- "selected_item_background_color": "#ff363c4a",
630
- "selected_item_text_color": "#ff27da86",
631
- "separation_line_color": "#00000000",
632
- },
633
- },
634
- Object {
635
- "assets": Object {},
636
- "category": "nav_bar",
637
- "default": true,
638
- "id": "357084dc-d2c0-4780-8dd6-295e18c7cc7f",
639
- "name": "Navigation Bar",
640
- "nav_items": Array [
641
- Object {
642
- "assets": Object {},
643
- "data": Object {
644
- "connected": null,
645
- "source": null,
646
- "target": "b886e64a-1234-4cd5-96ce-69629f11cdf8",
647
- "type": null,
648
- },
649
- "general": Object {
650
- "home": false,
651
- "new": false,
652
- },
653
- "id": "500f03b6-17ba-4533-ad20-985272484c1d",
654
- "position": 1,
655
- "styles": Object {},
656
- "title": "All Shows",
657
- "type": "button",
658
- },
659
- ],
660
- "navigation_type": "navigation_bar",
661
- "rules": Object {},
662
- "styles": Object {
663
- "android_font_family": "Roboto-Medium",
664
- "background_color": "#ff4a90e2",
665
- "background_type": "Color",
666
- "ios_font_family": "HelveticaNeue-Medium",
667
- "presentation_style": "title",
668
- "state": "on_top",
669
- "style": "center",
670
- "title_color": "#ffffffff",
671
- "title_size": "16",
672
- "title_size_tablet": "18",
673
- },
674
- },
675
- ],
676
- "rules": Object {},
677
- "screen_id": "1bb8ad39-a42e-4096-a134-56aadbd35c83",
678
- "state": 7,
679
- "styles": Object {
680
- "family": "FAMILY_1",
681
- "presentation": "present",
682
- },
683
- "type": "general",
684
- "ui_components": Array [],
685
- "weight": 7,
686
- },
687
- "payload": Object {
688
- "foo": "bar",
689
- },
690
- },
691
- [Function],
692
- ]
693
- `;