@enact/webos 4.7.3 → 4.7.5
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.
- package/CHANGELOG.md +8 -0
- package/LS2Request/LS2Request.js +8 -7
- package/application/application.js +9 -5
- package/deviceinfo/deviceinfo.js +3 -1
- package/keyboard/keyboard.js +3 -1
- package/package.json +2 -2
- package/platform/platform.js +5 -3
- package/pmloglib/pmloglib.js +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact webos module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [4.7.5] - 2023-09-12
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.7.4] - 2023-08-31
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
5
13
|
## [4.7.3] - 2023-08-10
|
|
6
14
|
|
|
7
15
|
No significant changes.
|
package/LS2Request/LS2Request.js
CHANGED
|
@@ -86,6 +86,7 @@ var LS2Request = /*#__PURE__*/function () {
|
|
|
86
86
|
_createClass(LS2Request, [{
|
|
87
87
|
key: "send",
|
|
88
88
|
value: function send(_ref4) {
|
|
89
|
+
var _window$WebOSServiceB;
|
|
89
90
|
var _ref4$service = _ref4.service,
|
|
90
91
|
service = _ref4$service === void 0 ? '' : _ref4$service,
|
|
91
92
|
_ref4$method = _ref4.method,
|
|
@@ -104,23 +105,25 @@ var LS2Request = /*#__PURE__*/function () {
|
|
|
104
105
|
subscribe = _ref4$subscribe === void 0 ? false : _ref4$subscribe,
|
|
105
106
|
_ref4$timeout = _ref4.timeout,
|
|
106
107
|
timeout = _ref4$timeout === void 0 ? 0 : _ref4$timeout;
|
|
108
|
+
var WebOSServiceBridge = typeof window === 'object' ? (_window$WebOSServiceB = window.WebOSServiceBridge) !== null && _window$WebOSServiceB !== void 0 ? _window$WebOSServiceB : window.PalmServiceBridge : null;
|
|
107
109
|
this.cancelled = false;
|
|
108
110
|
if (!onFailure && !onComplete) {
|
|
109
111
|
onFailure = failureHandler;
|
|
110
112
|
}
|
|
111
|
-
if (typeof
|
|
113
|
+
if (typeof WebOSServiceBridge !== 'function') {
|
|
114
|
+
var errorText = 'WebOSServiceBridge not found.';
|
|
112
115
|
/* eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
|
|
113
116
|
if (onFailure) onFailure({
|
|
114
117
|
errorCode: -1,
|
|
115
|
-
errorText:
|
|
118
|
+
errorText: errorText,
|
|
116
119
|
returnValue: false
|
|
117
120
|
});
|
|
118
121
|
if (onComplete) onComplete({
|
|
119
122
|
errorCode: -1,
|
|
120
|
-
errorText:
|
|
123
|
+
errorText: errorText,
|
|
121
124
|
returnValue: false
|
|
122
125
|
});
|
|
123
|
-
console.error(
|
|
126
|
+
console.error(errorText);
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
129
|
if (this.ts && refs[this.ts]) {
|
|
@@ -135,9 +138,7 @@ var LS2Request = /*#__PURE__*/function () {
|
|
|
135
138
|
}
|
|
136
139
|
this.ts = performance.now();
|
|
137
140
|
refs[this.ts] = this;
|
|
138
|
-
|
|
139
|
-
// eslint-disable-next-line no-undef
|
|
140
|
-
this.bridge = new PalmServiceBridge();
|
|
141
|
+
this.bridge = new WebOSServiceBridge();
|
|
141
142
|
this.bridge.onservicecallback = this.callback.bind(this, onSuccess, onFailure, onComplete);
|
|
142
143
|
if (timeout) {
|
|
143
144
|
this.timeoutJob.startAfter(timeout, {
|
|
@@ -27,9 +27,11 @@ var appInfo = {};
|
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
29
|
var fetchAppId = function fetchAppId() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
var _window$webOSSystem;
|
|
31
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
32
|
+
if (webOSSystem && webOSSystem.identifier) {
|
|
33
|
+
// webOSSystem.identifier: <appid> <processid>
|
|
34
|
+
return webOSSystem.identifier.split(' ')[0];
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
37
|
|
|
@@ -128,8 +130,10 @@ var fetchAppRootPath = function fetchAppRootPath() {
|
|
|
128
130
|
*/
|
|
129
131
|
exports.fetchAppRootPath = fetchAppRootPath;
|
|
130
132
|
var platformBack = function platformBack() {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
var _window$webOSSystem2;
|
|
134
|
+
var webOSSystem = (_window$webOSSystem2 = window.webOSSystem) !== null && _window$webOSSystem2 !== void 0 ? _window$webOSSystem2 : window.PalmSystem;
|
|
135
|
+
if (webOSSystem && webOSSystem.platformBack) {
|
|
136
|
+
return webOSSystem.platformBack();
|
|
133
137
|
}
|
|
134
138
|
};
|
|
135
139
|
exports.platformBack = platformBack;
|
package/deviceinfo/deviceinfo.js
CHANGED
|
@@ -46,7 +46,9 @@ var device = {};
|
|
|
46
46
|
var deviceinfo = function deviceinfo(callback) {
|
|
47
47
|
if (Object.keys(device).length === 0) {
|
|
48
48
|
try {
|
|
49
|
-
var
|
|
49
|
+
var _window$webOSSystem;
|
|
50
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
51
|
+
var info = JSON.parse(webOSSystem.deviceInfo);
|
|
50
52
|
device.modelName = info.modelName;
|
|
51
53
|
device.modelNameAscii = info.modelNameAscii;
|
|
52
54
|
device.version = info.platformVersion;
|
package/keyboard/keyboard.js
CHANGED
|
@@ -20,6 +20,8 @@ exports.isShowing = void 0;
|
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
22
|
var isShowing = function isShowing() {
|
|
23
|
-
|
|
23
|
+
var _window$webOSSystem;
|
|
24
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
25
|
+
return webOSSystem && webOSSystem.isKeyboardVisible;
|
|
24
26
|
};
|
|
25
27
|
exports.isShowing = isShowing;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/webos",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.5",
|
|
4
4
|
"description": "webOS support library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@enact/core": "^4.7.
|
|
34
|
+
"@enact/core": "^4.7.5",
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0"
|
package/platform/platform.js
CHANGED
|
@@ -31,7 +31,7 @@ function detect() {
|
|
|
31
31
|
if (_platform) {
|
|
32
32
|
// if we've already determined the platform, we'll use that determination
|
|
33
33
|
return _platform;
|
|
34
|
-
} else if (typeof window === 'undefined' || !window.PalmSystem) {
|
|
34
|
+
} else if (typeof window === 'undefined' || !window.webOSSystem && !window.PalmSystem) {
|
|
35
35
|
// if window isn't available (in prerendering or snapshot runs), bail out early
|
|
36
36
|
return {
|
|
37
37
|
unknown: true
|
|
@@ -45,8 +45,10 @@ function detect() {
|
|
|
45
45
|
} else if (is('SmartTV') || is('Large Screen')) {
|
|
46
46
|
_platform.tv = true;
|
|
47
47
|
} else {
|
|
48
|
+
var _window$webOSSystem;
|
|
49
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
48
50
|
try {
|
|
49
|
-
var legacyInfo = JSON.parse(
|
|
51
|
+
var legacyInfo = JSON.parse(webOSSystem.deviceInfo || '{}');
|
|
50
52
|
if (legacyInfo.platformVersionMajor && legacyInfo.platformVersionMinor) {
|
|
51
53
|
var major = parseInt(legacyInfo.platformVersionMajor);
|
|
52
54
|
var minor = parseInt(legacyInfo.platformVersionMinor);
|
|
@@ -66,7 +68,7 @@ function detect() {
|
|
|
66
68
|
window.Mojo = window.Mojo || {
|
|
67
69
|
relaunch: function relaunch() {}
|
|
68
70
|
};
|
|
69
|
-
if (
|
|
71
|
+
if (webOSSystem.stageReady) webOSSystem.stageReady();
|
|
70
72
|
}
|
|
71
73
|
return _platform;
|
|
72
74
|
}
|
package/pmloglib/pmloglib.js
CHANGED
|
@@ -35,7 +35,8 @@ var isObject = function isObject(obj) {
|
|
|
35
35
|
|
|
36
36
|
// Log function stringifies and escapes keyVals, and passes to PmLogString
|
|
37
37
|
var log = function log(level, messageId, keyVals, freeText) {
|
|
38
|
-
if (typeof window !== 'undefined' && window.PalmSystem) {
|
|
38
|
+
if (typeof window !== 'undefined' && (window.webOSSystem || window.PalmSystem)) {
|
|
39
|
+
var _window$webOSSystem;
|
|
39
40
|
if (keyVals && !isObject(keyVals)) {
|
|
40
41
|
level = levelError;
|
|
41
42
|
keyVals = {
|
|
@@ -51,15 +52,16 @@ var log = function log(level, messageId, keyVals, freeText) {
|
|
|
51
52
|
if (keyVals) {
|
|
52
53
|
keyVals = JSON.stringify(keyVals);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
56
|
+
if (webOSSystem.PmLogString) {
|
|
55
57
|
if (level === levelDebug) {
|
|
56
58
|
// debug only accepts 2 arguments
|
|
57
|
-
|
|
59
|
+
webOSSystem.PmLogString(level, null, null, freeText);
|
|
58
60
|
} else {
|
|
59
|
-
|
|
61
|
+
webOSSystem.PmLogString(level, messageId, keyVals, freeText);
|
|
60
62
|
}
|
|
61
63
|
} else {
|
|
62
|
-
console.error('Unable to send log: PmLogString not found in this version of
|
|
64
|
+
console.error('Unable to send log: PmLogString not found in this version of webOSSystem');
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
};
|
|
@@ -203,14 +205,16 @@ var debug = function debug(freeText) {
|
|
|
203
205
|
*/
|
|
204
206
|
exports.debug = debug;
|
|
205
207
|
var perfLog = function perfLog(messageId, perfType, perfGroup) {
|
|
206
|
-
if (typeof window !== 'undefined' && window.PalmSystem) {
|
|
208
|
+
if (typeof window !== 'undefined' && (window.webOSSystem || window.PalmSystem)) {
|
|
209
|
+
var _window$webOSSystem2;
|
|
207
210
|
if (!messageId) {
|
|
208
211
|
console.warn('PmLogInfoWithClock called with invalid format: messageId was empty');
|
|
209
212
|
}
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
var webOSSystem = (_window$webOSSystem2 = window.webOSSystem) !== null && _window$webOSSystem2 !== void 0 ? _window$webOSSystem2 : window.PalmSystem;
|
|
214
|
+
if (webOSSystem.PmLogInfoWithClock) {
|
|
215
|
+
webOSSystem.PmLogInfoWithClock(messageId, perfType ? perfType : '', perfGroup ? perfGroup : '');
|
|
212
216
|
} else {
|
|
213
|
-
console.error('Unable to send log: PmLogInfoWithClock not found in this version of
|
|
217
|
+
console.error('Unable to send log: PmLogInfoWithClock not found in this version of webOSSystem');
|
|
214
218
|
}
|
|
215
219
|
}
|
|
216
220
|
};
|