@applicaster/zapp-react-dom-app 13.0.0-alpha.9270615060 → 13.0.0-alpha.9946926334
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.
|
@@ -335,14 +335,37 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
onKeyUp(event: KeyboardEvent) {
|
|
338
|
+
const { setDisplayState } = this.props;
|
|
339
|
+
|
|
338
340
|
if (this.keySupportsLongPress(event)) {
|
|
339
341
|
this.longPressDetector.endKeyPressMonitoring(event.code);
|
|
340
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
|
+
}
|
|
341
366
|
}
|
|
342
367
|
|
|
343
368
|
onKeyDown(event) {
|
|
344
|
-
// console.log("Anton: event", event);
|
|
345
|
-
// debugger;
|
|
346
369
|
const { displayState, setDisplayState, navigator } = this.props;
|
|
347
370
|
const { isKeyboardVisible } = this.state;
|
|
348
371
|
|
|
@@ -364,7 +387,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
364
387
|
}
|
|
365
388
|
|
|
366
389
|
// None of the logic below should be executed for repeated keys
|
|
367
|
-
if (event.repeat) return;
|
|
390
|
+
if (event.repeat && !keyCode(event).matchesAny(...ARROW_KEYS)) return;
|
|
368
391
|
|
|
369
392
|
/**
|
|
370
393
|
When the player is displayed, we listen to Native Play / Pause / Stop
|
|
@@ -405,7 +428,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
405
428
|
|
|
406
429
|
if (
|
|
407
430
|
keyCode(event).matches(KEYS.Forward) ||
|
|
408
|
-
keyCode(event).matches(KEYS.C)
|
|
431
|
+
(__DEV__ && keyCode(event).matches(KEYS.C))
|
|
409
432
|
) {
|
|
410
433
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
411
434
|
KeyInputHandler.getInstance().onForwardPress();
|
|
@@ -415,7 +438,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
415
438
|
|
|
416
439
|
if (
|
|
417
440
|
keyCode(event).matches(KEYS.Rewind) ||
|
|
418
|
-
keyCode(event).matches(KEYS.Z)
|
|
441
|
+
(__DEV__ && keyCode(event).matches(KEYS.Z))
|
|
419
442
|
) {
|
|
420
443
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
421
444
|
KeyInputHandler.getInstance().onRewindPress();
|
|
@@ -456,7 +479,9 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
456
479
|
const isHookInHomescreen = entryData?.payload?.home;
|
|
457
480
|
|
|
458
481
|
const isHookFlowBlocker =
|
|
459
|
-
entryData?.hookPlugin?.module?.isFlowBlocker
|
|
482
|
+
typeof entryData?.hookPlugin?.module?.isFlowBlocker === "function"
|
|
483
|
+
? entryData?.hookPlugin?.module?.isFlowBlocker()
|
|
484
|
+
: entryData?.hookPlugin?.module?.isFlowBlocker;
|
|
460
485
|
|
|
461
486
|
if (isHookInHomescreen && isHookFlowBlocker) {
|
|
462
487
|
this.platformBack();
|
|
@@ -478,7 +503,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
478
503
|
}
|
|
479
504
|
}
|
|
480
505
|
|
|
481
|
-
if (
|
|
506
|
+
if (
|
|
507
|
+
keyCode(event).matches(KEYS.Enter) ||
|
|
508
|
+
(__DEV__ && keyCode(event).matches(KEYS.X))
|
|
509
|
+
) {
|
|
482
510
|
if (displayState === DISPLAY_STATES.PLAYER) {
|
|
483
511
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
484
512
|
} else {
|
|
@@ -595,6 +623,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
595
623
|
|
|
596
624
|
if (
|
|
597
625
|
(target.tagName === "INPUT" && target.type === "text") ||
|
|
626
|
+
(target.tagName === "INPUT" && target.type === "password") ||
|
|
598
627
|
target.tagName === "TEXTAREA"
|
|
599
628
|
) {
|
|
600
629
|
this.setState({
|
|
@@ -693,27 +722,13 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
693
722
|
}, SEQUENCE_ENTRY_TIME);
|
|
694
723
|
}
|
|
695
724
|
|
|
725
|
+
// TODO: Delete it on next PR if not needed
|
|
696
726
|
private handleLongPress = (event: CustomEvent) => {
|
|
697
727
|
const { keyCode } = event.detail;
|
|
698
|
-
const { displayState } = this.props;
|
|
699
|
-
const playerState = displayState === DISPLAY_STATES.PLAYER;
|
|
700
|
-
const hudState = displayState === DISPLAY_STATES.HUD;
|
|
701
|
-
const playbackState = playerState || hudState;
|
|
702
728
|
this.longPressActive = true;
|
|
703
729
|
this.cancelHudTimeout();
|
|
704
730
|
|
|
705
731
|
switch (keyCode) {
|
|
706
|
-
case KEYS.Forward.code:
|
|
707
|
-
case KEYS.C.code:
|
|
708
|
-
playbackState && KeyInputHandler.getInstance().onForwardLongPress();
|
|
709
|
-
|
|
710
|
-
break;
|
|
711
|
-
|
|
712
|
-
case KEYS.Rewind.code:
|
|
713
|
-
case KEYS.Z.code:
|
|
714
|
-
playbackState && KeyInputHandler.getInstance().onRewindLongPress();
|
|
715
|
-
break;
|
|
716
|
-
|
|
717
732
|
case KEYS.Enter.code:
|
|
718
733
|
case KEYS.X.code:
|
|
719
734
|
focusManager.longPress();
|
|
@@ -721,26 +736,16 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
721
736
|
}
|
|
722
737
|
};
|
|
723
738
|
|
|
739
|
+
// TODO: Delete it on next PR if not needed
|
|
724
740
|
private handleLongPressRelease = (event: CustomEvent) => {
|
|
725
741
|
const { keyCode } = event.detail;
|
|
726
742
|
this.longPressActive = false;
|
|
727
743
|
this.resetHudTimeout();
|
|
728
|
-
// debugger;
|
|
729
744
|
|
|
730
745
|
switch (keyCode) {
|
|
731
|
-
case KEYS.Forward.code:
|
|
732
|
-
case KEYS.C.code:
|
|
733
|
-
KeyInputHandler.getInstance().onForwardPressOut();
|
|
734
|
-
break;
|
|
735
|
-
|
|
736
|
-
case KEYS.Rewind.code:
|
|
737
|
-
case KEYS.Z.code:
|
|
738
|
-
KeyInputHandler.getInstance().onRewindPressOut();
|
|
739
|
-
break;
|
|
740
|
-
|
|
741
746
|
case KEYS.Enter.code:
|
|
742
747
|
case KEYS.X.code:
|
|
743
|
-
focusManager.pressOut();
|
|
748
|
+
// focusManager.pressOut();
|
|
744
749
|
break;
|
|
745
750
|
}
|
|
746
751
|
};
|
|
@@ -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
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"could not initialize plugin Plugin with Dom node & no init method - it doesn't have an init method",
|
|
7
|
-
|
|
8
|
-
"plugin":
|
|
9
|
-
"configuration":
|
|
7
|
+
{
|
|
8
|
+
"plugin": {
|
|
9
|
+
"configuration": {
|
|
10
10
|
"foo": "bar",
|
|
11
11
|
},
|
|
12
|
-
"module":
|
|
12
|
+
"module": {
|
|
13
13
|
"requiresAppendingDomNode": true,
|
|
14
14
|
},
|
|
15
15
|
"name": "Plugin with Dom node & no init method",
|
|
@@ -11,11 +11,28 @@ import {
|
|
|
11
11
|
PLATFORMS,
|
|
12
12
|
} from "./const";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {"tv" | "web" | "other"} DeviceType
|
|
16
|
+
* @typedef {"samsung_tv" | "lg_tv" | unknown} CustomPlatformTypes
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the user agent string from the browser or global navigator.
|
|
21
|
+
* @returns {string} The user agent string.
|
|
22
|
+
*/
|
|
14
23
|
export const getUserAgent = () =>
|
|
15
24
|
window?.navigator?.userAgent || global?.navigator?.userAgent;
|
|
16
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the device is HD (1280 width).
|
|
28
|
+
* @returns {boolean} True if the device is HD, false otherwise.
|
|
29
|
+
*/
|
|
17
30
|
export const isHD = () => window.innerWidth === 1280;
|
|
18
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the platform is LG.
|
|
34
|
+
* @returns {boolean} True if the platform is LG, false otherwise.
|
|
35
|
+
*/
|
|
19
36
|
export const isLgPlatform = () => {
|
|
20
37
|
const userAgent = getUserAgent();
|
|
21
38
|
|
|
@@ -23,10 +40,13 @@ export const isLgPlatform = () => {
|
|
|
23
40
|
return false;
|
|
24
41
|
}
|
|
25
42
|
|
|
26
|
-
// Note: LG uses the number 0 in their userAgent, possibly because of Palm WebOS
|
|
27
43
|
return hasWebOS || userAgent.includes(PLATFORMS.webos);
|
|
28
44
|
};
|
|
29
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the platform is Samsung.
|
|
48
|
+
* @returns {boolean} True if the platform is Samsung, false otherwise.
|
|
49
|
+
*/
|
|
30
50
|
export const isSamsungPlatform = () => {
|
|
31
51
|
const userAgent = getUserAgent();
|
|
32
52
|
|
|
@@ -42,42 +62,39 @@ export const isSamsungPlatform = () => {
|
|
|
42
62
|
};
|
|
43
63
|
|
|
44
64
|
/**
|
|
45
|
-
* Checks if
|
|
46
|
-
*
|
|
47
|
-
* Use this method when you need to identify the platform on runtime
|
|
48
|
-
* before the VIZIO Companion Library has loaded
|
|
65
|
+
* Checks if the platform is Vizio by using the user agent string.
|
|
66
|
+
* @returns {boolean} True if the platform is Vizio, false otherwise.
|
|
49
67
|
*/
|
|
50
68
|
export const isVizioPlatform = () => {
|
|
51
69
|
const userAgent = getUserAgent();
|
|
52
70
|
|
|
53
|
-
|
|
71
|
+
return (
|
|
54
72
|
userAgent.includes(PLATFORMS.vizio) ||
|
|
55
73
|
userAgent.includes(PLATFORMS.smartcast) ||
|
|
56
|
-
userAgent.includes(PLATFORMS.conjure)
|
|
57
|
-
|
|
58
|
-
return isVizioAgent;
|
|
74
|
+
userAgent.includes(PLATFORMS.conjure)
|
|
75
|
+
);
|
|
59
76
|
};
|
|
60
77
|
|
|
61
78
|
/**
|
|
62
|
-
* Checks if
|
|
63
|
-
*
|
|
64
|
-
* because it mainly checks whether we have access to apis, which may not be available yet
|
|
79
|
+
* Checks if the Vizio APIs are available.
|
|
80
|
+
* @returns {boolean} True if the Vizio APIs are available, false otherwise.
|
|
65
81
|
*/
|
|
66
82
|
export const hasVizioAPIs = () => {
|
|
67
|
-
|
|
83
|
+
return (
|
|
68
84
|
typeof window.VIZIO !== "undefined" &&
|
|
69
|
-
window?.applicaster?.vizioLibraryDidLoad
|
|
70
|
-
|
|
71
|
-
return hasAPIs;
|
|
85
|
+
window?.applicaster?.vizioLibraryDidLoad
|
|
86
|
+
);
|
|
72
87
|
};
|
|
73
88
|
|
|
74
89
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @returns {"tv" | "web" | "other"} value
|
|
90
|
+
* Determines the device type based on the platform.
|
|
91
|
+
* @returns {DeviceType} The device type ("tv", "web", or "other").
|
|
78
92
|
*/
|
|
79
93
|
export const getDeviceType = () => {
|
|
80
|
-
|
|
94
|
+
/** @type {CustomPlatformTypes} */
|
|
95
|
+
const platformOS = Platform.OS;
|
|
96
|
+
|
|
97
|
+
switch (platformOS) {
|
|
81
98
|
case "samsung_tv":
|
|
82
99
|
return isSamsungPlatform() ? "tv" : "web";
|
|
83
100
|
case "lg_tv":
|
|
@@ -88,14 +105,15 @@ export const getDeviceType = () => {
|
|
|
88
105
|
};
|
|
89
106
|
|
|
90
107
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @param {string} key - key
|
|
108
|
+
* Renames keys based on a predefined map.
|
|
109
|
+
* @param {string} key - The key to rename.
|
|
110
|
+
* @returns {string} The renamed key.
|
|
93
111
|
*/
|
|
94
112
|
export const renameKeys = (key) => desiredKeysMap?.[key] || key;
|
|
95
113
|
|
|
96
114
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
115
|
+
* Retrieves the connection info from WebOS.
|
|
116
|
+
* @returns {Promise<{networkType: string} | null>} A promise that resolves with the connection info or null.
|
|
99
117
|
*/
|
|
100
118
|
export const getWebOSConnectionInfo = () => {
|
|
101
119
|
return new Promise((resolve, reject) => {
|
|
@@ -108,7 +126,6 @@ export const getWebOSConnectionInfo = () => {
|
|
|
108
126
|
webOS.service.request("luna://com.palm.connectionmanager", {
|
|
109
127
|
method: "getStatus",
|
|
110
128
|
parameters: { subscribe: false },
|
|
111
|
-
|
|
112
129
|
onSuccess: (args) => {
|
|
113
130
|
const types = Object.keys(args)
|
|
114
131
|
.filter((key) => args[key].state === "connected")
|
|
@@ -116,7 +133,6 @@ export const getWebOSConnectionInfo = () => {
|
|
|
116
133
|
|
|
117
134
|
resolve({ networkType: types });
|
|
118
135
|
},
|
|
119
|
-
|
|
120
136
|
onFailure: (error) => {
|
|
121
137
|
console.error(
|
|
122
138
|
"getWebOSConnectionInfo: There was an error getting connection info",
|
|
@@ -129,6 +145,10 @@ export const getWebOSConnectionInfo = () => {
|
|
|
129
145
|
});
|
|
130
146
|
};
|
|
131
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves the connection info from Tizen.
|
|
150
|
+
* @returns {Promise<{networkType: string} | null>} A promise that resolves with the connection info or null.
|
|
151
|
+
*/
|
|
132
152
|
export const getTizenConnectionInfo = () => {
|
|
133
153
|
return new Promise((resolve, reject) => {
|
|
134
154
|
if (!isSamsungPlatform) {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
+
{
|
|
30
30
|
"foo": "baz",
|
|
31
31
|
"otherKey": "otherValue",
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-dom-app",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.9946926334",
|
|
4
4
|
"description": "Zapp App Component for Applicaster's Quick Brick React Native App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,11 +22,11 @@
|
|
|
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.
|
|
26
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
27
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
28
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
29
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
25
|
+
"@applicaster/zapp-react-dom-ui-components": "13.0.0-alpha.9946926334",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9946926334",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.9946926334",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9946926334",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.9946926334",
|
|
30
30
|
"abortcontroller-polyfill": "^1.7.5",
|
|
31
31
|
"history": "^4.7.2",
|
|
32
32
|
"react-router-dom": "^5.1.2",
|
|
@@ -36,9 +36,19 @@
|
|
|
36
36
|
"videojs-contrib-quality-levels": "3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
+
"@applicaster/zapp-pipes-v2-client": "*",
|
|
40
|
+
"@react-native-community/netinfo": "*",
|
|
41
|
+
"@types/node": "*",
|
|
39
42
|
"core-js": "3.29.1",
|
|
43
|
+
"immer": "*",
|
|
40
44
|
"react": "17.0.2",
|
|
41
45
|
"react-dom": "17.0.2",
|
|
42
|
-
"react-native
|
|
46
|
+
"react-native": "*",
|
|
47
|
+
"react-native-safe-area-context": "*",
|
|
48
|
+
"react-native-svg": "*",
|
|
49
|
+
"react-native-web": "0.18.11",
|
|
50
|
+
"uglify-js": "*",
|
|
51
|
+
"validate-color": "*",
|
|
52
|
+
"zustand": "*"
|
|
43
53
|
}
|
|
44
54
|
}
|