@applicaster/zapp-react-dom-app 13.0.0-alpha.9433330286 → 13.0.0-alpha.9814200105

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.
@@ -23,8 +23,6 @@ import {
23
23
 
24
24
  import { showConfirmationDialog } from "@applicaster/zapp-react-native-utils/alertUtils";
25
25
 
26
- import { withUseSeek } from "@applicaster/zapp-react-native-utils/reactHooks/player";
27
-
28
26
  import {
29
27
  DISPLAY_STATES,
30
28
  DisplayStateContext,
@@ -48,6 +46,7 @@ import {
48
46
 
49
47
  import { OnScreenKeyboard } from "@applicaster/zapp-react-dom-ui-components/Components/OnScreenKeyboard";
50
48
  import { KeyboardLongPressManager } from "@applicaster/zapp-react-dom-ui-components/Utils/KeyboardLongPressManager";
49
+ import { KeyInputHandler } from "@applicaster/zapp-react-native-utils/appUtils/keyInputHandler/KeyInputHandler";
51
50
 
52
51
  const { withXray } = getXray();
53
52
  const globalAny: any = global;
@@ -62,14 +61,6 @@ type Props = {
62
61
  navigator: QuickBrickAppNavigator;
63
62
  rivers: {};
64
63
  xray: XRayContext;
65
- seekMethods: {
66
- onRewindPress: () => void;
67
- onRewindLongPress: () => void;
68
- onForwardPress: () => void;
69
- onForwardLongPress: () => void;
70
- onRewindPressOut: () => void;
71
- onForwardPressOut: () => void;
72
- };
73
64
  confirmDialog: typeof confirmationDialogStore;
74
65
  };
75
66
 
@@ -181,6 +172,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
181
172
 
182
173
  window.addEventListener("onLongPress", this.handleLongPress.bind(this));
183
174
 
175
+ window.addEventListener(
176
+ "onPressRelease",
177
+ this.handleLongPressRelease.bind(this)
178
+ );
179
+
184
180
  window.addEventListener(
185
181
  "onLongPressRelease",
186
182
  this.handleLongPressRelease.bind(this)
@@ -339,9 +335,34 @@ class InteractionManagerClass extends React.Component<Props, State> {
339
335
  }
340
336
 
341
337
  onKeyUp(event: KeyboardEvent) {
338
+ const { setDisplayState } = this.props;
339
+
342
340
  if (this.keySupportsLongPress(event)) {
343
341
  this.longPressDetector.endKeyPressMonitoring(event.code);
344
342
  }
343
+
344
+ if (
345
+ keyCode(event).matches(KEYS.Enter) ||
346
+ (__DEV__ && keyCode(event).matches(KEYS.X))
347
+ ) {
348
+ focusManager.pressOut();
349
+ }
350
+
351
+ if (
352
+ keyCode(event).matches(KEYS.Forward) ||
353
+ (__DEV__ && keyCode(event).matches(KEYS.C))
354
+ ) {
355
+ setDisplayState(DISPLAY_STATES.HUD);
356
+ KeyInputHandler.getInstance().onForwardPressOut();
357
+ }
358
+
359
+ if (
360
+ keyCode(event).matches(KEYS.Rewind) ||
361
+ (__DEV__ && keyCode(event).matches(KEYS.Z))
362
+ ) {
363
+ setDisplayState(DISPLAY_STATES.HUD);
364
+ KeyInputHandler.getInstance().onRewindPressOut();
365
+ }
345
366
  }
346
367
 
347
368
  onKeyDown(event) {
@@ -365,13 +386,14 @@ class InteractionManagerClass extends React.Component<Props, State> {
365
386
  this.longPressDetector.monitorKeyPress(event.code, event);
366
387
  }
367
388
 
368
- // None of the logic below should be executed for repeated keys
369
- if (event.repeat) return;
389
+ // Only handle repeat events for arrow keys
390
+ if (event.repeat && !keyCode(event).matchesAny(...ARROW_KEYS)) return;
370
391
 
371
392
  /**
372
393
  When the player is displayed, we listen to Native Play / Pause / Stop
373
394
  buttons. Any other key press will display the transport controls
374
395
  */
396
+
375
397
  if (
376
398
  displayState === DISPLAY_STATES.PLAYER ||
377
399
  displayState === DISPLAY_STATES.HUD
@@ -404,16 +426,22 @@ class InteractionManagerClass extends React.Component<Props, State> {
404
426
  return;
405
427
  }
406
428
 
407
- if (keyCode(event).matches(KEYS.Forward)) {
429
+ if (
430
+ keyCode(event).matches(KEYS.Forward) ||
431
+ (__DEV__ && keyCode(event).matches(KEYS.C))
432
+ ) {
408
433
  setDisplayState(DISPLAY_STATES.HUD);
409
- this.props.seekMethods.onForwardPress();
434
+ KeyInputHandler.getInstance().onForwardPress();
410
435
 
411
436
  return;
412
437
  }
413
438
 
414
- if (keyCode(event).matches(KEYS.Rewind)) {
439
+ if (
440
+ keyCode(event).matches(KEYS.Rewind) ||
441
+ (__DEV__ && keyCode(event).matches(KEYS.Z))
442
+ ) {
415
443
  setDisplayState(DISPLAY_STATES.HUD);
416
- this.props.seekMethods.onRewindPress();
444
+ KeyInputHandler.getInstance().onRewindPress();
417
445
 
418
446
  return;
419
447
  }
@@ -475,7 +503,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
475
503
  }
476
504
  }
477
505
 
478
- if (keyCode(event).matches(KEYS.Enter)) {
506
+ if (
507
+ keyCode(event).matches(KEYS.Enter) ||
508
+ (__DEV__ && keyCode(event).matches(KEYS.X))
509
+ ) {
479
510
  if (displayState === DISPLAY_STATES.PLAYER) {
480
511
  setDisplayState(DISPLAY_STATES.HUD);
481
512
  } else {
@@ -511,12 +542,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
511
542
  focusManager.moveFocus(direction);
512
543
  }
513
544
 
514
- if (!isDialogVisible) {
515
- // run focus recovery on user interaction attempt
516
- // probably we failed to set initial focus for some reason
517
- focusManager.recoverFocus();
518
- }
519
-
520
545
  if (
521
546
  displayState === DISPLAY_STATES.PLAYER ||
522
547
  displayState === DISPLAY_STATES.HUD
@@ -592,6 +617,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
592
617
 
593
618
  if (
594
619
  (target.tagName === "INPUT" && target.type === "text") ||
620
+ (target.tagName === "INPUT" && target.type === "password") ||
595
621
  target.tagName === "TEXTAREA"
596
622
  ) {
597
623
  this.setState({
@@ -690,54 +716,43 @@ class InteractionManagerClass extends React.Component<Props, State> {
690
716
  }, SEQUENCE_ENTRY_TIME);
691
717
  }
692
718
 
719
+ // TODO: Delete it on next PR if not needed
693
720
  private handleLongPress = (event: CustomEvent) => {
694
721
  const { keyCode } = event.detail;
695
- const { displayState } = this.props;
696
- const playerState = displayState === DISPLAY_STATES.PLAYER;
697
- const hudState = displayState === DISPLAY_STATES.HUD;
698
- const playbackState = playerState || hudState;
699
722
  this.longPressActive = true;
700
723
  this.cancelHudTimeout();
701
724
 
702
725
  switch (keyCode) {
703
- case KEYS.Forward.code:
704
- playbackState && this.props.seekMethods.onForwardLongPress();
705
- break;
706
-
707
- case KEYS.Rewind.code:
708
- playbackState && this.props.seekMethods.onRewindLongPress();
709
- break;
710
-
711
726
  case KEYS.Enter.code:
727
+ case KEYS.X.code:
712
728
  focusManager.longPress();
713
729
  break;
714
730
  }
715
731
  };
716
732
 
733
+ // TODO: Delete it on next PR if not needed
717
734
  private handleLongPressRelease = (event: CustomEvent) => {
718
735
  const { keyCode } = event.detail;
719
736
  this.longPressActive = false;
720
737
  this.resetHudTimeout();
721
738
 
722
739
  switch (keyCode) {
723
- case KEYS.Forward.code:
724
- this.props.seekMethods.onForwardPressOut();
725
- break;
726
-
727
- case KEYS.Rewind.code:
728
- this.props.seekMethods.onRewindPressOut();
729
- break;
730
-
731
740
  case KEYS.Enter.code:
732
- focusManager.pressOut();
741
+ case KEYS.X.code:
742
+ // focusManager.pressOut();
733
743
  break;
734
744
  }
735
745
  };
736
746
 
737
747
  private keySupportsLongPress(event: KeyboardEvent): boolean {
738
- return [KEYS.Forward.code, KEYS.Rewind.code, KEYS.Enter.code].includes(
739
- event.code
740
- );
748
+ return [
749
+ KEYS.Forward.code,
750
+ KEYS.Rewind.code,
751
+ KEYS.Enter.code,
752
+ KEYS.Z.code,
753
+ KEYS.X.code,
754
+ KEYS.C.code,
755
+ ].includes(event.code);
741
756
  }
742
757
 
743
758
  render() {
@@ -756,7 +771,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
756
771
 
757
772
  export const InteractionManager = R.compose(
758
773
  withNavigator,
759
- withUseSeek,
760
774
  withXray,
761
775
  connectToStore(R.pick(["rivers"])),
762
776
  PlayerContentContext.withConsumer,
@@ -1,15 +1,15 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`loadDomPlugins when there are plugins requiring to write to the dom skips plugins without init method 1`] = `
4
- Array [
5
- Array [
4
+ [
5
+ [
6
6
  "could not initialize plugin Plugin with Dom node & no init method - it doesn't have an init method",
7
- Object {
8
- "plugin": Object {
9
- "configuration": Object {
7
+ {
8
+ "plugin": {
9
+ "configuration": {
10
10
  "foo": "bar",
11
11
  },
12
- "module": Object {
12
+ "module": {
13
13
  "requiresAppendingDomNode": true,
14
14
  },
15
15
  "name": "Plugin with Dom node & no init method",
@@ -4,8 +4,8 @@ import { QuickBrickCommunicationModule } from "../../Polyfills/QuickBrickCommuni
4
4
  import { loadLocaleImpl, getLanguageCode } from "./utils";
5
5
 
6
6
  type Locale = {
7
- language: string,
8
- country: string,
7
+ language: string;
8
+ country: string;
9
9
  };
10
10
 
11
11
  async function getBrowserLocale() {
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`storageObject when the requested storage exists getAllItems returns all keys 1`] = `
4
- Object {
4
+ {
5
5
  "baz_::_foo": "baz",
6
6
  "baz_::_otherKey": "otherValue",
7
7
  "foo": "bar",
@@ -10,7 +10,7 @@ Object {
10
10
  `;
11
11
 
12
12
  exports[`storageObject when the requested storage exists getAllItems returns all keys 2`] = `
13
- Object {
13
+ {
14
14
  "baz_::_foo": "baz",
15
15
  "baz_::_otherKey": "otherValue",
16
16
  "foo": "bar",
@@ -19,14 +19,14 @@ Object {
19
19
  `;
20
20
 
21
21
  exports[`storageObject when the requested storage exists getAllItems returns all keys in the namespace if provided 1`] = `
22
- Object {
22
+ {
23
23
  "foo": "baz",
24
24
  "otherKey": "otherValue",
25
25
  }
26
26
  `;
27
27
 
28
28
  exports[`storageObject when the requested storage exists getAllItems returns all keys in the namespace if provided 2`] = `
29
- Object {
29
+ {
30
30
  "foo": "baz",
31
31
  "otherKey": "otherValue",
32
32
  }
package/index.js CHANGED
@@ -1,13 +1,11 @@
1
1
  /// <reference types="@applicaster/applicaster-types" />
2
2
  import * as R from "ramda";
3
- import { useHistory, useLocation } from "react-router-dom";
4
3
 
5
4
  import { createQuickBrickApp } from "@applicaster/quick-brick-core";
6
5
  import * as QuickBrickManager from "@applicaster/zapp-react-native-bridge/QuickBrick";
7
6
  import * as Contexts from "@applicaster/zapp-react-native-ui-components/Contexts";
8
7
  import { OfflineHandler } from "@applicaster/zapp-react-native-ui-components/Components/OfflineHandler";
9
8
  import { getXray } from "@applicaster/zapp-react-native-utils/logger";
10
- import { ZappDomRouter } from "./App/Router";
11
9
  import { Layout } from "./App/Layout";
12
10
  import { SplashLoader } from "./App/Loader/SplashLoader";
13
11
  import { appLoader } from "./App/Loader";
@@ -24,11 +22,6 @@ const contextProviders = R.map(R.prop("withProvider"), R.values(Contexts));
24
22
  if (withXray) contextProviders.push(withXray);
25
23
 
26
24
  export const ZappApp = createQuickBrickApp({
27
- navigations: {
28
- Router: ZappDomRouter,
29
- useLocation,
30
- useHistory,
31
- },
32
25
  QuickBrickManager,
33
26
  Layout,
34
27
  OfflineHandler,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "13.0.0-alpha.9433330286",
3
+ "version": "13.0.0-alpha.9814200105",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,13 +22,12 @@
22
22
  },
23
23
  "homepage": "https://github.com/applicaster/zapp-react-dom-app#readme",
24
24
  "dependencies": {
25
- "@applicaster/zapp-react-dom-ui-components": "13.0.0-alpha.9433330286",
26
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9433330286",
27
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.9433330286",
28
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9433330286",
29
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.9433330286",
25
+ "@applicaster/zapp-react-dom-ui-components": "13.0.0-alpha.9814200105",
26
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9814200105",
27
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.9814200105",
28
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9814200105",
29
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.9814200105",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
- "history": "^4.7.2",
32
31
  "react-router-dom": "^5.1.2",
33
32
  "typeface-montserrat": "^0.0.54",
34
33
  "video.js": "7.14.3",
@@ -36,9 +35,19 @@
36
35
  "videojs-contrib-quality-levels": "3.0.0"
37
36
  },
38
37
  "peerDependencies": {
38
+ "@applicaster/zapp-pipes-v2-client": "*",
39
+ "@react-native-community/netinfo": "*",
40
+ "@types/node": "*",
39
41
  "core-js": "3.29.1",
42
+ "immer": "*",
40
43
  "react": "17.0.2",
41
44
  "react-dom": "17.0.2",
42
- "react-native-web": "0.18.11"
45
+ "react-native": "*",
46
+ "react-native-safe-area-context": "*",
47
+ "react-native-svg": "*",
48
+ "react-native-web": "0.18.11",
49
+ "uglify-js": "*",
50
+ "validate-color": "*",
51
+ "zustand": "*"
43
52
  }
44
53
  }
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Router } from "react-router";
5
- import { createMemoryHistory } from "history";
6
-
7
- const history = createMemoryHistory();
8
-
9
- export const ZappDomRouter = ({ children, ...otherProps }) => (
10
- <Router history={history} {...otherProps}>
11
- {children}
12
- </Router>
13
- );
14
-
15
- ZappDomRouter.propTypes = {
16
- children: PropTypes.node.isRequired,
17
- };
@@ -1,30 +0,0 @@
1
- import React from "react";
2
-
3
- import "./spinner-styles.css";
4
-
5
- export const Spinner = (color) => {
6
- const spinnerColor = {
7
- background: color.color,
8
- };
9
-
10
- return (
11
- <div>
12
- <div id="progress">
13
- <div className="spinner">
14
- <div style={spinnerColor} className="bar1" />
15
- <div style={spinnerColor} className="bar2" />
16
- <div style={spinnerColor} className="bar3" />
17
- <div style={spinnerColor} className="bar4" />
18
- <div style={spinnerColor} className="bar5" />
19
- <div style={spinnerColor} className="bar6" />
20
- <div style={spinnerColor} className="bar7" />
21
- <div style={spinnerColor} className="bar8" />
22
- <div style={spinnerColor} className="bar9" />
23
- <div style={spinnerColor} className="bar10" />
24
- <div style={spinnerColor} className="bar11" />
25
- <div style={spinnerColor} className="bar12" />
26
- </div>
27
- </div>
28
- </div>
29
- );
30
- };
@@ -1,81 +0,0 @@
1
- div.spinner {
2
- position: absolute;
3
- width: 100px;
4
- height: 100px;
5
- display: inline-block;
6
- top: 50%;
7
- left: 50%;
8
- margin: -60px 0 0 -70px;
9
- }
10
-
11
- div.spinner div {
12
- width: 6%;
13
- height: 16%;
14
- position: absolute;
15
- left: 49%;
16
- top: 43%;
17
- opacity: 0;
18
- -webkit-border-radius: 50px;
19
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
20
- -webkit-animation: fade 1s linear infinite;
21
- }
22
-
23
- @-webkit-keyframes fade {
24
- from {
25
- opacity: 1;
26
- }
27
- to {
28
- opacity: 0.25;
29
- }
30
- }
31
-
32
- div.spinner div.bar1 {
33
- -webkit-transform: rotate(0deg) translate(0, -130%);
34
- -webkit-animation-delay: 0s;
35
- }
36
-
37
- div.spinner div.bar2 {
38
- -webkit-transform: rotate(30deg) translate(0, -130%);
39
- -webkit-animation-delay: -0.9167s;
40
- }
41
-
42
- div.spinner div.bar3 {
43
- -webkit-transform: rotate(60deg) translate(0, -130%);
44
- -webkit-animation-delay: -0.833s;
45
- }
46
- div.spinner div.bar4 {
47
- -webkit-transform: rotate(90deg) translate(0, -130%);
48
- -webkit-animation-delay: -0.7497s;
49
- }
50
- div.spinner div.bar5 {
51
- -webkit-transform: rotate(120deg) translate(0, -130%);
52
- -webkit-animation-delay: -0.667s;
53
- }
54
- div.spinner div.bar6 {
55
- -webkit-transform: rotate(150deg) translate(0, -130%);
56
- -webkit-animation-delay: -0.5837s;
57
- }
58
- div.spinner div.bar7 {
59
- -webkit-transform: rotate(180deg) translate(0, -130%);
60
- -webkit-animation-delay: -0.5s;
61
- }
62
- div.spinner div.bar8 {
63
- -webkit-transform: rotate(210deg) translate(0, -130%);
64
- -webkit-animation-delay: -0.4167s;
65
- }
66
- div.spinner div.bar9 {
67
- -webkit-transform: rotate(240deg) translate(0, -130%);
68
- -webkit-animation-delay: -0.333s;
69
- }
70
- div.spinner div.bar10 {
71
- -webkit-transform: rotate(270deg) translate(0, -130%);
72
- -webkit-animation-delay: -0.2497s;
73
- }
74
- div.spinner div.bar11 {
75
- -webkit-transform: rotate(300deg) translate(0, -130%);
76
- -webkit-animation-delay: -0.167s;
77
- }
78
- div.spinner div.bar12 {
79
- -webkit-transform: rotate(330deg) translate(0, -130%);
80
- -webkit-animation-delay: -0.0833s;
81
- }