@enact/webos 4.7.3 → 4.7.4

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 CHANGED
@@ -2,6 +2,10 @@
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.4] - 2023-08-31
6
+
7
+ No significant changes.
8
+
5
9
  ## [4.7.3] - 2023-08-10
6
10
 
7
11
  No significant changes.
@@ -27,9 +27,11 @@ var appInfo = {};
27
27
  * @public
28
28
  */
29
29
  var fetchAppId = function fetchAppId() {
30
- if (window.PalmSystem && window.PalmSystem.identifier) {
31
- // PalmSystem.identifier: <appid> <processid>
32
- return window.PalmSystem.identifier.split(' ')[0];
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
- if (window.PalmSystem && window.PalmSystem.platformBack) {
132
- return window.PalmSystem.platformBack();
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;
@@ -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 info = JSON.parse(window.PalmSystem.deviceInfo);
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;
@@ -20,6 +20,8 @@ exports.isShowing = void 0;
20
20
  * @public
21
21
  */
22
22
  var isShowing = function isShowing() {
23
- return window.PalmSystem && window.PalmSystem.isKeyboardVisible;
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",
3
+ "version": "4.7.4",
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.3",
34
+ "@enact/core": "^4.7.4",
35
35
  "prop-types": "^15.8.1",
36
36
  "react": "^18.2.0",
37
37
  "react-dom": "^18.2.0"
@@ -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(window.PalmSystem.deviceInfo || '{}');
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 (window.PalmSystem.stageReady) window.PalmSystem.stageReady();
71
+ if (webOSSystem.stageReady) webOSSystem.stageReady();
70
72
  }
71
73
  return _platform;
72
74
  }
@@ -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
- if (window.PalmSystem.PmLogString) {
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
- window.PalmSystem.PmLogString(level, null, null, freeText);
59
+ webOSSystem.PmLogString(level, null, null, freeText);
58
60
  } else {
59
- window.PalmSystem.PmLogString(level, messageId, keyVals, freeText);
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 PalmSystem');
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
- if (window.PalmSystem.PmLogInfoWithClock) {
211
- window.PalmSystem.PmLogInfoWithClock(messageId, perfType ? perfType : '', perfGroup ? perfGroup : '');
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 PalmSystem');
217
+ console.error('Unable to send log: PmLogInfoWithClock not found in this version of webOSSystem');
214
218
  }
215
219
  }
216
220
  };