@enact/webos 3.4.9-experimental-3 → 3.4.9-experimental-7
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 +16 -0
- package/{build/LS2Request → LS2Request}/LS2Request.d.ts +0 -0
- package/LS2Request/LS2Request.js +228 -173
- package/LS2Request/tests/LS2Request-specs.js +85 -95
- package/{build/application → application}/application.d.ts +0 -0
- package/application/application.js +92 -70
- package/{build/deviceinfo → deviceinfo}/deviceinfo.d.ts +0 -0
- package/deviceinfo/deviceinfo.js +78 -62
- package/{build/index.d.ts → index.d.ts} +0 -0
- package/index.js +1 -0
- package/{build/keyboard → keyboard}/keyboard.d.ts +0 -0
- package/keyboard/keyboard.js +11 -4
- package/package.json +2 -2
- package/{build/platform → platform}/platform.d.ts +0 -0
- package/platform/platform.js +67 -65
- package/{build/pmloglib → pmloglib}/pmloglib.d.ts +0 -0
- package/pmloglib/pmloglib.js +116 -86
- package/speech/VoiceControlDecorator.js +99 -42
- package/{build/speech → speech}/index.d.ts +0 -0
- package/speech/index.js +23 -15
- package/speech/readAlert.js +78 -60
- package/build/CHANGELOG.md +0 -603
- package/build/LS2Request/LS2Request.js +0 -239
- package/build/LS2Request/package.json +0 -3
- package/build/LS2Request/tests/LS2Request-specs.js +0 -85
- package/build/README.md +0 -22
- package/build/application/application.js +0 -150
- package/build/application/package.json +0 -3
- package/build/deviceinfo/deviceinfo.js +0 -114
- package/build/deviceinfo/package.json +0 -3
- package/build/index.js +0 -2
- package/build/keyboard/keyboard.js +0 -27
- package/build/keyboard/package.json +0 -3
- package/build/package-lock.json +0 -221
- package/build/package.json +0 -33
- package/build/platform/package.json +0 -3
- package/build/platform/platform.js +0 -105
- package/build/pmloglib/package.json +0 -3
- package/build/pmloglib/pmloglib.js +0 -241
- package/build/speech/VoiceControlDecorator.js +0 -152
- package/build/speech/index.js +0 -23
- package/build/speech/package.json +0 -3
- package/build/speech/readAlert.js +0 -96
- package/docs/index.md +0 -8
- package/docs/luna-service-api.md +0 -35
- package/docs/webos-features.md +0 -37
package/build/package-lock.json
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@enact/webos",
|
|
3
|
-
"version": "3.2.5",
|
|
4
|
-
"lockfileVersion": 1,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@enact/core": {
|
|
8
|
-
"version": "3.2.5",
|
|
9
|
-
"resolved": "https://registry.npmjs.org/@enact/core/-/core-3.2.5.tgz",
|
|
10
|
-
"integrity": "sha512-BTMQrpClpIXi2RaVPOHT5tc++bnmQj3JVc+xv7kx9fN7jiFRhGkSGbgfgqf3Ai+aPSSKmSUcLqGixi1yri7GFA==",
|
|
11
|
-
"requires": {
|
|
12
|
-
"classnames": "^2.2.5",
|
|
13
|
-
"invariant": "^2.2.2",
|
|
14
|
-
"prop-types": "^15.7.2",
|
|
15
|
-
"ramda": "^0.24.1",
|
|
16
|
-
"react": "^16.8.0",
|
|
17
|
-
"react-dom": "^16.8.0",
|
|
18
|
-
"react-is": "^16.8.3",
|
|
19
|
-
"recompose": "^0.26.0"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"asap": {
|
|
23
|
-
"version": "2.0.6",
|
|
24
|
-
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
|
25
|
-
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
|
|
26
|
-
},
|
|
27
|
-
"change-emitter": {
|
|
28
|
-
"version": "0.1.6",
|
|
29
|
-
"resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz",
|
|
30
|
-
"integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU="
|
|
31
|
-
},
|
|
32
|
-
"classnames": {
|
|
33
|
-
"version": "2.2.6",
|
|
34
|
-
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
|
|
35
|
-
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
|
|
36
|
-
},
|
|
37
|
-
"core-js": {
|
|
38
|
-
"version": "1.2.7",
|
|
39
|
-
"resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
|
|
40
|
-
"integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY="
|
|
41
|
-
},
|
|
42
|
-
"encoding": {
|
|
43
|
-
"version": "0.1.12",
|
|
44
|
-
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
|
|
45
|
-
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
|
|
46
|
-
"requires": {
|
|
47
|
-
"iconv-lite": "~0.4.13"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"fbjs": {
|
|
51
|
-
"version": "0.8.17",
|
|
52
|
-
"resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz",
|
|
53
|
-
"integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=",
|
|
54
|
-
"requires": {
|
|
55
|
-
"core-js": "^1.0.0",
|
|
56
|
-
"isomorphic-fetch": "^2.1.1",
|
|
57
|
-
"loose-envify": "^1.0.0",
|
|
58
|
-
"object-assign": "^4.1.0",
|
|
59
|
-
"promise": "^7.1.1",
|
|
60
|
-
"setimmediate": "^1.0.5",
|
|
61
|
-
"ua-parser-js": "^0.7.18"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"hoist-non-react-statics": {
|
|
65
|
-
"version": "2.5.5",
|
|
66
|
-
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
|
|
67
|
-
"integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw=="
|
|
68
|
-
},
|
|
69
|
-
"iconv-lite": {
|
|
70
|
-
"version": "0.4.24",
|
|
71
|
-
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
72
|
-
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
73
|
-
"requires": {
|
|
74
|
-
"safer-buffer": ">= 2.1.2 < 3"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"invariant": {
|
|
78
|
-
"version": "2.2.4",
|
|
79
|
-
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
|
|
80
|
-
"integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
|
|
81
|
-
"requires": {
|
|
82
|
-
"loose-envify": "^1.0.0"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"is-stream": {
|
|
86
|
-
"version": "1.1.0",
|
|
87
|
-
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
|
88
|
-
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
|
89
|
-
},
|
|
90
|
-
"isomorphic-fetch": {
|
|
91
|
-
"version": "2.2.1",
|
|
92
|
-
"resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
|
|
93
|
-
"integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
|
|
94
|
-
"requires": {
|
|
95
|
-
"node-fetch": "^1.0.1",
|
|
96
|
-
"whatwg-fetch": ">=0.10.0"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"js-tokens": {
|
|
100
|
-
"version": "4.0.0",
|
|
101
|
-
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
|
102
|
-
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
|
103
|
-
},
|
|
104
|
-
"loose-envify": {
|
|
105
|
-
"version": "1.4.0",
|
|
106
|
-
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
|
107
|
-
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
|
|
108
|
-
"requires": {
|
|
109
|
-
"js-tokens": "^3.0.0 || ^4.0.0"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"node-fetch": {
|
|
113
|
-
"version": "1.7.3",
|
|
114
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
|
|
115
|
-
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
|
|
116
|
-
"requires": {
|
|
117
|
-
"encoding": "^0.1.11",
|
|
118
|
-
"is-stream": "^1.0.1"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"object-assign": {
|
|
122
|
-
"version": "4.1.1",
|
|
123
|
-
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
124
|
-
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
|
125
|
-
},
|
|
126
|
-
"promise": {
|
|
127
|
-
"version": "7.3.1",
|
|
128
|
-
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
|
|
129
|
-
"integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
|
|
130
|
-
"requires": {
|
|
131
|
-
"asap": "~2.0.3"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"prop-types": {
|
|
135
|
-
"version": "15.7.2",
|
|
136
|
-
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
|
|
137
|
-
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
|
|
138
|
-
"requires": {
|
|
139
|
-
"loose-envify": "^1.4.0",
|
|
140
|
-
"object-assign": "^4.1.1",
|
|
141
|
-
"react-is": "^16.8.1"
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"ramda": {
|
|
145
|
-
"version": "0.24.1",
|
|
146
|
-
"resolved": "https://registry.npmjs.org/ramda/-/ramda-0.24.1.tgz",
|
|
147
|
-
"integrity": "sha1-w7d1UZfzW43DUCIoJixMkd22uFc="
|
|
148
|
-
},
|
|
149
|
-
"react": {
|
|
150
|
-
"version": "16.13.0",
|
|
151
|
-
"resolved": "https://registry.npmjs.org/react/-/react-16.13.0.tgz",
|
|
152
|
-
"integrity": "sha512-TSavZz2iSLkq5/oiE7gnFzmURKZMltmi193rm5HEoUDAXpzT9Kzw6oNZnGoai/4+fUnm7FqS5dwgUL34TujcWQ==",
|
|
153
|
-
"requires": {
|
|
154
|
-
"loose-envify": "^1.1.0",
|
|
155
|
-
"object-assign": "^4.1.1",
|
|
156
|
-
"prop-types": "^15.6.2"
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"react-dom": {
|
|
160
|
-
"version": "16.13.0",
|
|
161
|
-
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz",
|
|
162
|
-
"integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==",
|
|
163
|
-
"requires": {
|
|
164
|
-
"loose-envify": "^1.1.0",
|
|
165
|
-
"object-assign": "^4.1.1",
|
|
166
|
-
"prop-types": "^15.6.2",
|
|
167
|
-
"scheduler": "^0.19.0"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"react-is": {
|
|
171
|
-
"version": "16.13.0",
|
|
172
|
-
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz",
|
|
173
|
-
"integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA=="
|
|
174
|
-
},
|
|
175
|
-
"recompose": {
|
|
176
|
-
"version": "0.26.0",
|
|
177
|
-
"resolved": "https://registry.npmjs.org/recompose/-/recompose-0.26.0.tgz",
|
|
178
|
-
"integrity": "sha512-KwOu6ztO0mN5vy3+zDcc45lgnaUoaQse/a5yLVqtzTK13czSWnFGmXbQVmnoMgDkI5POd1EwIKSbjU1V7xdZog==",
|
|
179
|
-
"requires": {
|
|
180
|
-
"change-emitter": "^0.1.2",
|
|
181
|
-
"fbjs": "^0.8.1",
|
|
182
|
-
"hoist-non-react-statics": "^2.3.1",
|
|
183
|
-
"symbol-observable": "^1.0.4"
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
"safer-buffer": {
|
|
187
|
-
"version": "2.1.2",
|
|
188
|
-
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
189
|
-
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
190
|
-
},
|
|
191
|
-
"scheduler": {
|
|
192
|
-
"version": "0.19.0",
|
|
193
|
-
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.0.tgz",
|
|
194
|
-
"integrity": "sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==",
|
|
195
|
-
"requires": {
|
|
196
|
-
"loose-envify": "^1.1.0",
|
|
197
|
-
"object-assign": "^4.1.1"
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
"setimmediate": {
|
|
201
|
-
"version": "1.0.5",
|
|
202
|
-
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
|
203
|
-
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
|
204
|
-
},
|
|
205
|
-
"symbol-observable": {
|
|
206
|
-
"version": "1.2.0",
|
|
207
|
-
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
|
|
208
|
-
"integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
|
|
209
|
-
},
|
|
210
|
-
"ua-parser-js": {
|
|
211
|
-
"version": "0.7.21",
|
|
212
|
-
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz",
|
|
213
|
-
"integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ=="
|
|
214
|
-
},
|
|
215
|
-
"whatwg-fetch": {
|
|
216
|
-
"version": "3.0.0",
|
|
217
|
-
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
|
|
218
|
-
"integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
package/build/package.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@enact/webos",
|
|
3
|
-
"version": "3.4.9-experimental-3",
|
|
4
|
-
"description": "webOS support library",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "enact clean",
|
|
8
|
-
"lint": "enact lint --strict",
|
|
9
|
-
"test": "enact test",
|
|
10
|
-
"test-json": "enact test --json",
|
|
11
|
-
"test-watch": "enact test --watch",
|
|
12
|
-
"transpile": "enact transpile"
|
|
13
|
-
},
|
|
14
|
-
"license": "Apache-2.0",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"framework",
|
|
17
|
-
"toolkit",
|
|
18
|
-
"components",
|
|
19
|
-
"mobile",
|
|
20
|
-
"webOS"
|
|
21
|
-
],
|
|
22
|
-
"enact": {
|
|
23
|
-
"ri": {
|
|
24
|
-
"baseSize": 24
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@enact/core": "^3.4.9-experimental-3",
|
|
29
|
-
"prop-types": "^15.7.2",
|
|
30
|
-
"react": "^16.8.0",
|
|
31
|
-
"react-dom": "^16.8.0"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.detect = detect;
|
|
7
|
-
exports.platform = exports["default"] = void 0;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Utilities for webOS platform detection.
|
|
11
|
-
*
|
|
12
|
-
* @module webos/platform
|
|
13
|
-
* @exports detect
|
|
14
|
-
* @exports platform
|
|
15
|
-
*/
|
|
16
|
-
function is(type) {
|
|
17
|
-
return window.navigator.userAgent.indexOf(type) > -1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var _platform;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the {@link webos/platform.platform} object.
|
|
23
|
-
*
|
|
24
|
-
* @function
|
|
25
|
-
* @returns {Object} The {@link webos/platform.platform} object
|
|
26
|
-
* @memberof webos/platform
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function detect() {
|
|
32
|
-
if (_platform) {
|
|
33
|
-
// if we've already determined the platform, we'll use that determination
|
|
34
|
-
return _platform;
|
|
35
|
-
} else if (typeof window === 'undefined' || !window.PalmSystem) {
|
|
36
|
-
// if window isn't available (in prerendering or snapshot runs), bail out early
|
|
37
|
-
return {
|
|
38
|
-
unknown: true
|
|
39
|
-
};
|
|
40
|
-
} // build out our cached platform determination for future usage
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_platform = {};
|
|
44
|
-
|
|
45
|
-
if (is('SmartWatch')) {
|
|
46
|
-
_platform.watch = true;
|
|
47
|
-
} else if (is('SmartTV') || is('Large Screen')) {
|
|
48
|
-
_platform.tv = true;
|
|
49
|
-
} else {
|
|
50
|
-
try {
|
|
51
|
-
var legacyInfo = JSON.parse(window.PalmSystem.deviceInfo || '{}');
|
|
52
|
-
|
|
53
|
-
if (legacyInfo.platformVersionMajor && legacyInfo.platformVersionMinor) {
|
|
54
|
-
var major = parseInt(legacyInfo.platformVersionMajor);
|
|
55
|
-
var minor = parseInt(legacyInfo.platformVersionMinor);
|
|
56
|
-
|
|
57
|
-
if (major < 3 || major === 3 && minor <= 0) {
|
|
58
|
-
_platform.legacy = true;
|
|
59
|
-
} else {
|
|
60
|
-
_platform.open = true;
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
_platform.unknown = true;
|
|
64
|
-
}
|
|
65
|
-
} catch (e) {
|
|
66
|
-
_platform.open = true;
|
|
67
|
-
} // TODO: clean these up. They shouldn't be here
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
window.Mojo = window.Mojo || {
|
|
71
|
-
relaunch: function relaunch() {}
|
|
72
|
-
};
|
|
73
|
-
if (window.PalmSystem.stageReady) window.PalmSystem.stageReady();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return _platform;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Provides identification of webOS variants.
|
|
80
|
-
*
|
|
81
|
-
* @readonly
|
|
82
|
-
* @type {Object}
|
|
83
|
-
* @property {Boolean} [tv] `true` for LG webOS SmartTV
|
|
84
|
-
* @property {Boolean} [watch] `true` for LG webOS SmartWatch
|
|
85
|
-
* @property {Boolean} [open] `true` for Open webOS
|
|
86
|
-
* @property {Boolean} [legacy] `true` for legacy webOS (Palm and HP hardware)
|
|
87
|
-
* @property {Boolean} [unknown] `true` for any unknown system
|
|
88
|
-
* @memberof webos/platform
|
|
89
|
-
* @public
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var platform = {};
|
|
94
|
-
exports.platform = platform;
|
|
95
|
-
['tv', 'watch', 'open', 'legacy', 'unknown'].forEach(function (name) {
|
|
96
|
-
Object.defineProperty(platform, name, {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function get() {
|
|
99
|
-
var p = detect();
|
|
100
|
-
return p[name];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
var _default = platform;
|
|
105
|
-
exports["default"] = _default;
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.perfLog = exports.debug = exports.info = exports.notice = exports.warning = exports.error = exports.critical = exports.alert = exports.emergency = void 0;
|
|
7
|
-
|
|
8
|
-
/* eslint-disable no-console */
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Provides a wrapper around PmLogLib logging API
|
|
12
|
-
*
|
|
13
|
-
* @module webos/pmloglib
|
|
14
|
-
* @exports emergency
|
|
15
|
-
* @exports alert
|
|
16
|
-
* @exports critical
|
|
17
|
-
* @exports error
|
|
18
|
-
* @exports warning
|
|
19
|
-
* @exports notice
|
|
20
|
-
* @exports info
|
|
21
|
-
* @exports debug
|
|
22
|
-
* @exports perfLog
|
|
23
|
-
*/
|
|
24
|
-
// Log level constants
|
|
25
|
-
var levelEmergency = 0;
|
|
26
|
-
var levelAlert = 1;
|
|
27
|
-
var levelCritical = 2;
|
|
28
|
-
var levelError = 3;
|
|
29
|
-
var levelWarning = 4;
|
|
30
|
-
var levelNotice = 5;
|
|
31
|
-
var levelInfo = 6;
|
|
32
|
-
var levelDebug = 7;
|
|
33
|
-
|
|
34
|
-
var isObject = function isObject(obj) {
|
|
35
|
-
return !!obj && typeof obj === 'object' && Object.prototype.toString.call(obj) !== '[object Array]';
|
|
36
|
-
}; // Log function stringifies and escapes keyVals, and passes to PmLogString
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var log = function log(level, messageId, keyVals, freeText) {
|
|
40
|
-
if (typeof window !== 'undefined' && window.PalmSystem) {
|
|
41
|
-
if (keyVals && !isObject(keyVals)) {
|
|
42
|
-
level = levelError;
|
|
43
|
-
keyVals = {
|
|
44
|
-
msgid: messageId
|
|
45
|
-
};
|
|
46
|
-
messageId = 'MISMATCHED_FMT';
|
|
47
|
-
freeText = null;
|
|
48
|
-
console.warn('webOSLog called with invalid format: keyVals must be an object');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!messageId && level !== levelDebug) {
|
|
52
|
-
console.warn('webOSLog called with invalid format: messageId was empty');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (keyVals) {
|
|
56
|
-
keyVals = JSON.stringify(keyVals);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (window.PalmSystem.PmLogString) {
|
|
60
|
-
if (level === levelDebug) {
|
|
61
|
-
// debug only accepts 2 arguments
|
|
62
|
-
window.PalmSystem.PmLogString(level, null, null, freeText);
|
|
63
|
-
} else {
|
|
64
|
-
window.PalmSystem.PmLogString(level, messageId, keyVals, freeText);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
console.error('Unable to send log: PmLogString not found in this version of PalmSystem');
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Logs with PmLogLib at the "emergency" level.
|
|
73
|
-
*
|
|
74
|
-
* @function
|
|
75
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
76
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
77
|
-
* @param {String} freeText Text string to log
|
|
78
|
-
* @returns {undefined}
|
|
79
|
-
* @memberof webos/pmloglib
|
|
80
|
-
* @public
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var emergency = function emergency(messageId, keyVals, freeText) {
|
|
85
|
-
log(levelEmergency, messageId, keyVals, freeText);
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Logs with PmLogLib at the "alert" level.
|
|
89
|
-
*
|
|
90
|
-
* @function
|
|
91
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
92
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
93
|
-
* @param {String} freeText Text string to log
|
|
94
|
-
* @returns {undefined}
|
|
95
|
-
* @memberof webos/pmloglib
|
|
96
|
-
* @public
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
exports.emergency = emergency;
|
|
101
|
-
|
|
102
|
-
var alert = function alert(messageId, keyVals, freeText) {
|
|
103
|
-
log(levelAlert, messageId, keyVals, freeText);
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Logs with PmLogLib at the "critical" level.
|
|
107
|
-
*
|
|
108
|
-
* @function
|
|
109
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
110
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
111
|
-
* @param {String} freeText Text string to log
|
|
112
|
-
* @returns {undefined}
|
|
113
|
-
* @memberof webos/pmloglib
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
exports.alert = alert;
|
|
119
|
-
|
|
120
|
-
var critical = function critical(messageId, keyVals, freeText) {
|
|
121
|
-
log(levelCritical, messageId, keyVals, freeText);
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Logs with PmLogLib at the "error" level.
|
|
125
|
-
*
|
|
126
|
-
* @function
|
|
127
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
128
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
129
|
-
* @param {String} freeText Text string to log
|
|
130
|
-
* @returns {undefined}
|
|
131
|
-
* @memberof webos/pmloglib
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
exports.critical = critical;
|
|
137
|
-
|
|
138
|
-
var error = function error(messageId, keyVals, freeText) {
|
|
139
|
-
log(levelError, messageId, keyVals, freeText);
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* Logs with PmLogLib at the "warning" level.
|
|
143
|
-
*
|
|
144
|
-
* @function
|
|
145
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
146
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
147
|
-
* @param {String} freeText Text string to log
|
|
148
|
-
* @returns {undefined}
|
|
149
|
-
* @memberof webos/pmloglib
|
|
150
|
-
* @public
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
exports.error = error;
|
|
155
|
-
|
|
156
|
-
var warning = function warning(messageId, keyVals, freeText) {
|
|
157
|
-
log(levelWarning, messageId, keyVals, freeText);
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Logs with PmLogLib at the "notice" level.
|
|
161
|
-
*
|
|
162
|
-
* @function
|
|
163
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
164
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
165
|
-
* @param {String} freeText Text string to log
|
|
166
|
-
* @returns {undefined}
|
|
167
|
-
* @memberof webos/pmloglib
|
|
168
|
-
* @public
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
exports.warning = warning;
|
|
173
|
-
|
|
174
|
-
var notice = function notice(messageId, keyVals, freeText) {
|
|
175
|
-
log(levelNotice, messageId, keyVals, freeText);
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Logs with PmLogLib at the "info" level.
|
|
179
|
-
*
|
|
180
|
-
* @function
|
|
181
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component
|
|
182
|
-
* @param {Object} keyVals Key-value pairs to log
|
|
183
|
-
* @param {String} freeText Text string to log
|
|
184
|
-
* @returns {undefined}
|
|
185
|
-
* @memberof webos/pmloglib
|
|
186
|
-
* @public
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
exports.notice = notice;
|
|
191
|
-
|
|
192
|
-
var info = function info(messageId, keyVals, freeText) {
|
|
193
|
-
log(levelInfo, messageId, keyVals, freeText);
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Logs with PmLogLib at the "debug" level.
|
|
197
|
-
*
|
|
198
|
-
* @function
|
|
199
|
-
* @param {String} freeText Text string to log
|
|
200
|
-
* @returns {undefined}
|
|
201
|
-
* @memberof webos/pmloglib
|
|
202
|
-
* @public
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
exports.info = info;
|
|
207
|
-
|
|
208
|
-
var debug = function debug(freeText) {
|
|
209
|
-
log(levelDebug, '', '', freeText);
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* Places a time-stamped performance log entry into the system log using the `PmLogInfoWithClock()`
|
|
213
|
-
* method.
|
|
214
|
-
*
|
|
215
|
-
* @function
|
|
216
|
-
* @param {String} messageId Short string that uniquely identifies the log message within a component.
|
|
217
|
-
* @param {String} perfType A string that identifies the type of perf message
|
|
218
|
-
* @param {String} perfGroup A string that identifies the group of the perf message
|
|
219
|
-
* @returns {undefined}
|
|
220
|
-
* @memberof webos/pmloglib
|
|
221
|
-
* @public
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
exports.debug = debug;
|
|
226
|
-
|
|
227
|
-
var perfLog = function perfLog(messageId, perfType, perfGroup) {
|
|
228
|
-
if (typeof window !== 'undefined' && window.PalmSystem) {
|
|
229
|
-
if (!messageId) {
|
|
230
|
-
console.warn('PmLogInfoWithClock called with invalid format: messageId was empty');
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (window.PalmSystem.PmLogInfoWithClock) {
|
|
234
|
-
window.PalmSystem.PmLogInfoWithClock(messageId, perfType ? perfType : '', perfGroup ? perfGroup : '');
|
|
235
|
-
} else {
|
|
236
|
-
console.error('Unable to send log: PmLogInfoWithClock not found in this version of PalmSystem');
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
exports.perfLog = perfLog;
|