Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@enact/webos

Package Overview
Dependencies
Maintainers
1
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enact/webos - npm Package Compare versions

Comparing version 4.5.2 to 4.5.3

25

application/application.js

@@ -7,3 +7,2 @@ "use strict";

exports.platformBack = exports.fetchAppRootPath = exports.fetchAppInfo = exports.fetchAppId = void 0;
/* eslint-disable no-console */

@@ -20,3 +19,5 @@

*/
var appInfo = {};
/**

@@ -30,3 +31,2 @@ * Fetches the appID of the caller app.

*/
var fetchAppId = function fetchAppId() {

@@ -38,2 +38,3 @@ if (window.PalmSystem && window.PalmSystem.identifier) {

};
/**

@@ -57,6 +58,3 @@ * The callback signature for `fetchAppInfo`

*/
exports.fetchAppId = fetchAppId;
var fetchAppInfo = function fetchAppInfo(callback, path) {

@@ -77,5 +75,3 @@ if (Object.keys(appInfo).length === 0) {

};
var req = new window.XMLHttpRequest();
req.onreadystatechange = function () {

@@ -92,3 +88,2 @@ if (req.readyState === 4) {

};
try {

@@ -106,2 +101,3 @@ req.open('GET', path || 'appinfo.json', true);

};
/**

@@ -115,9 +111,5 @@ * Fetches the full root URI (path) of the caller app.

*/
exports.fetchAppInfo = fetchAppInfo;
var fetchAppRootPath = function fetchAppRootPath() {
var base = window.location.href;
if ('baseURI' in window.document) {

@@ -127,3 +119,2 @@ base = window.document.baseURI;

var baseTags = window.document.getElementsByTagName('base');
if (baseTags.length > 0) {

@@ -133,11 +124,9 @@ base = baseTags[0].href;

}
var match = base.match(new RegExp('.*://[^#]*/'));
if (match) {
return match[0];
}
return '';
};
/**

@@ -151,6 +140,3 @@ * Emulate the remote *back* key.

*/
exports.fetchAppRootPath = fetchAppRootPath;
var platformBack = function platformBack() {

@@ -161,3 +147,2 @@ if (window.PalmSystem && window.PalmSystem.platformBack) {

};
exports.platformBack = platformBack;

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Change Log

## [4.5.3] - 2023-04-06
No significant changes.
## [4.5.2] - 2022-08-17

@@ -7,0 +11,0 @@

@@ -7,9 +7,5 @@ "use strict";

exports.deviceinfo = exports["default"] = void 0;
var _LS2Request = _interopRequireDefault(require("../LS2Request"));
var _platform = require("../platform");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**

@@ -21,3 +17,5 @@ * Provides a function to get the device-specific information.

*/
var device = {};
/**

@@ -50,3 +48,2 @@ * Callback signature for `deviceinfo`

*/
var deviceinfo = function deviceinfo(callback) {

@@ -68,6 +65,4 @@ if (Object.keys(device).length === 0) {

}
device.screenHeight = device.screenHeight || window.screen.height;
device.screenWidth = device.screenWidth || window.screen.width;
if (_platform.platform.tv) {

@@ -85,7 +80,5 @@ new _LS2Request["default"]().send({

device.uhd = response.UHD === 'true';
if (!response.firmwareVersion || response.firmwareVersion === '0.0.0') {
response.firmwareVersion = response.sdkVersion;
}
if (response.firmwareVersion) {

@@ -95,3 +88,2 @@ device.version = response.firmwareVersion;

var keys = ['versionMajor', 'versionMinor', 'versionDot'];
for (var i = 0; i < keys.length; i++) {

@@ -105,3 +97,2 @@ try {

}
callback(device);

@@ -118,5 +109,4 @@ },

};
exports.deviceinfo = deviceinfo;
var _default = deviceinfo;
exports["default"] = _default;

@@ -7,3 +7,2 @@ "use strict";

exports.isShowing = void 0;
/**

@@ -27,3 +26,2 @@ * Provides a function to check visibility of virtual keyboard.

};
exports.isShowing = isShowing;

@@ -7,13 +7,7 @@ "use strict";

exports["default"] = void 0;
var _util = require("@enact/core/util");
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
var refs = {};
var adjustPath = function adjustPath(path) {

@@ -23,5 +17,5 @@ if (!/^(luna|palm):\/\//.test(path)) path = 'luna://' + path;

return path;
}; // default handlers
};
// default handlers
var failureHandler = function failureHandler(_ref) {

@@ -31,3 +25,2 @@ var errorText = _ref.errorText;

};
var timeoutHandler = function timeoutHandler(_ref2) {

@@ -37,2 +30,3 @@ var errorText = _ref2.errorText;

};
/**

@@ -44,4 +38,2 @@ * A class for managing LS2 Requests.

*/
var LS2Request = /*#__PURE__*/function () {

@@ -56,8 +48,6 @@ /**

var _this = this;
_classCallCheck(this, LS2Request);
this.timeoutJob = new _util.Job(function (_ref3) {
var onTimeout = _ref3.onTimeout,
timeout = _ref3.timeout;
timeout = _ref3.timeout;
onTimeout({

@@ -67,4 +57,4 @@ errorCode: -2,

returnValue: false
}); // cancel the request
});
// cancel the request
_this.cancel();

@@ -75,2 +65,3 @@ });

}
/**

@@ -96,4 +87,2 @@ * Send a request to an LS2 service method.

*/
_createClass(LS2Request, [{

@@ -103,25 +92,23 @@ key: "send",

var _ref4$service = _ref4.service,
service = _ref4$service === void 0 ? '' : _ref4$service,
_ref4$method = _ref4.method,
method = _ref4$method === void 0 ? '' : _ref4$method,
_ref4$parameters = _ref4.parameters,
parameters = _ref4$parameters === void 0 ? {} : _ref4$parameters,
_ref4$onSuccess = _ref4.onSuccess,
onSuccess = _ref4$onSuccess === void 0 ? null : _ref4$onSuccess,
_ref4$onFailure = _ref4.onFailure,
onFailure = _ref4$onFailure === void 0 ? null : _ref4$onFailure,
_ref4$onComplete = _ref4.onComplete,
onComplete = _ref4$onComplete === void 0 ? null : _ref4$onComplete,
_ref4$onTimeout = _ref4.onTimeout,
onTimeout = _ref4$onTimeout === void 0 ? timeoutHandler : _ref4$onTimeout,
_ref4$subscribe = _ref4.subscribe,
subscribe = _ref4$subscribe === void 0 ? false : _ref4$subscribe,
_ref4$timeout = _ref4.timeout,
timeout = _ref4$timeout === void 0 ? 0 : _ref4$timeout;
service = _ref4$service === void 0 ? '' : _ref4$service,
_ref4$method = _ref4.method,
method = _ref4$method === void 0 ? '' : _ref4$method,
_ref4$parameters = _ref4.parameters,
parameters = _ref4$parameters === void 0 ? {} : _ref4$parameters,
_ref4$onSuccess = _ref4.onSuccess,
onSuccess = _ref4$onSuccess === void 0 ? null : _ref4$onSuccess,
_ref4$onFailure = _ref4.onFailure,
onFailure = _ref4$onFailure === void 0 ? null : _ref4$onFailure,
_ref4$onComplete = _ref4.onComplete,
onComplete = _ref4$onComplete === void 0 ? null : _ref4$onComplete,
_ref4$onTimeout = _ref4.onTimeout,
onTimeout = _ref4$onTimeout === void 0 ? timeoutHandler : _ref4$onTimeout,
_ref4$subscribe = _ref4.subscribe,
subscribe = _ref4$subscribe === void 0 ? false : _ref4$subscribe,
_ref4$timeout = _ref4.timeout,
timeout = _ref4$timeout === void 0 ? 0 : _ref4$timeout;
this.cancelled = false;
if (!onFailure && !onComplete) {
onFailure = failureHandler;
}
if (typeof window !== 'object' || !window.PalmServiceBridge) {

@@ -142,23 +129,18 @@ /* eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/

}
if (this.ts && refs[this.ts]) {
delete refs[this.ts];
}
this.subscribe = subscribe;
if (this.subscribe) {
parameters.subscribe = this.subscribe;
}
if (parameters.subscribe) {
this.subscribe = parameters.subscribe;
}
this.ts = performance.now();
refs[this.ts] = this; // eslint-disable-next-line no-undef
refs[this.ts] = this;
// eslint-disable-next-line no-undef
this.bridge = new PalmServiceBridge();
this.bridge.onservicecallback = this.callback.bind(this, onSuccess, onFailure, onComplete);
if (timeout) {

@@ -170,3 +152,2 @@ this.timeoutJob.startAfter(timeout, {

}
this.bridge.call(adjustPath(service) + method, JSON.stringify(parameters));

@@ -180,8 +161,7 @@ return this;

return;
} // remove timeout job
}
// remove timeout job
this.timeoutJob.stop();
var parsedMsg;
if (msg == null) {

@@ -204,3 +184,2 @@ parsedMsg = {

}
if (parsedMsg.errorCode || parsedMsg.returnValue === false) {

@@ -213,7 +192,5 @@ if (onFailure) {

}
if (onComplete) {
onComplete(parsedMsg);
}
if (!this.subscribe) {

@@ -223,2 +200,3 @@ this.cancel();

}
/**

@@ -232,3 +210,2 @@ * Cancel the current LS2 request.

*/
}, {

@@ -240,3 +217,2 @@ key: "cancel",

this.cancelled = true;
if (this.bridge) {

@@ -246,3 +222,2 @@ this.bridge.cancel();

}
if (this.ts && refs[this.ts]) {

@@ -253,6 +228,4 @@ delete refs[this.ts];

}]);
return LS2Request;
}();
exports["default"] = LS2Request;
"use strict";
var _LS2Request = _interopRequireDefault(require("../LS2Request"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
describe('LS2Request', function () {
var nop = function nop() {};
describe('callback', function () {

@@ -11,0 +8,0 @@ var invalidResponse = '{invalid: json';

{
"name": "@enact/webos",
"version": "4.5.2",
"version": "4.5.3",
"description": "webOS support library",
"repository": {
"type": "git",
"url": "https://github.com/enactjs/enact.git",
"directory": "packages/webos"
},
"homepage": "https://enactjs.com",
"main": "index.js",

@@ -28,3 +34,3 @@ "scripts": {

"dependencies": {
"@enact/core": "^4.5.2",
"@enact/core": "^4.5.3",
"prop-types": "^15.8.1",

@@ -31,0 +37,0 @@ "react": "^18.2.0",

@@ -9,3 +9,2 @@ "use strict";

exports.platform = void 0;
/**

@@ -18,7 +17,8 @@ * Utilities for webOS platform detection.

*/
function is(type) {
return window.navigator.userAgent.indexOf(type) > -1;
}
var _platform;
var _platform;
/**

@@ -32,4 +32,2 @@ * Returns the {@link webos/platform.platform} object.

*/
function detect() {

@@ -44,7 +42,6 @@ if (_platform) {

};
} // build out our cached platform determination for future usage
}
// build out our cached platform determination for future usage
_platform = {};
if (is('SmartWatch')) {

@@ -57,7 +54,5 @@ _platform.watch = true;

var legacyInfo = JSON.parse(window.PalmSystem.deviceInfo || '{}');
if (legacyInfo.platformVersionMajor && legacyInfo.platformVersionMinor) {
var major = parseInt(legacyInfo.platformVersionMajor);
var minor = parseInt(legacyInfo.platformVersionMinor);
if (major < 3 || major === 3 && minor <= 0) {

@@ -73,5 +68,5 @@ _platform.legacy = true;

_platform.open = true;
} // TODO: clean these up. They shouldn't be here
}
// TODO: clean these up. They shouldn't be here
window.Mojo = window.Mojo || {

@@ -82,5 +77,5 @@ relaunch: function relaunch() {}

}
return _platform;
}
/**

@@ -99,4 +94,2 @@ * Provides identification of webOS variants.

*/
var platform = {};

@@ -103,0 +96,0 @@ exports.platform = platform;

@@ -7,5 +7,3 @@ "use strict";

exports.warning = exports.perfLog = exports.notice = exports.info = exports.error = exports.emergency = exports.debug = exports.critical = exports.alert = void 0;
/* eslint-disable no-console */
/**

@@ -25,2 +23,3 @@ * Provides a wrapper around PmLogLib logging API

*/
// Log level constants

@@ -35,8 +34,7 @@ var levelEmergency = 0;

var levelDebug = 7;
var isObject = function isObject(obj) {
return !!obj && typeof obj === 'object' && Object.prototype.toString.call(obj) !== '[object Array]';
}; // Log function stringifies and escapes keyVals, and passes to PmLogString
};
// Log function stringifies and escapes keyVals, and passes to PmLogString
var log = function log(level, messageId, keyVals, freeText) {

@@ -53,11 +51,8 @@ if (typeof window !== 'undefined' && window.PalmSystem) {

}
if (!messageId && level !== levelDebug) {
console.warn('webOSLog called with invalid format: messageId was empty');
}
if (keyVals) {
keyVals = JSON.stringify(keyVals);
}
if (window.PalmSystem.PmLogString) {

@@ -75,2 +70,3 @@ if (level === levelDebug) {

};
/**

@@ -87,7 +83,6 @@ * Logs with PmLogLib at the "emergency" level.

*/
var emergency = function emergency(messageId, keyVals, freeText) {
log(levelEmergency, messageId, keyVals, freeText);
};
/**

@@ -104,9 +99,7 @@ * Logs with PmLogLib at the "alert" level.

*/
exports.emergency = emergency;
var alert = function alert(messageId, keyVals, freeText) {
log(levelAlert, messageId, keyVals, freeText);
};
/**

@@ -123,9 +116,7 @@ * Logs with PmLogLib at the "critical" level.

*/
exports.alert = alert;
var critical = function critical(messageId, keyVals, freeText) {
log(levelCritical, messageId, keyVals, freeText);
};
/**

@@ -142,9 +133,7 @@ * Logs with PmLogLib at the "error" level.

*/
exports.critical = critical;
var error = function error(messageId, keyVals, freeText) {
log(levelError, messageId, keyVals, freeText);
};
/**

@@ -161,9 +150,7 @@ * Logs with PmLogLib at the "warning" level.

*/
exports.error = error;
var warning = function warning(messageId, keyVals, freeText) {
log(levelWarning, messageId, keyVals, freeText);
};
/**

@@ -180,9 +167,7 @@ * Logs with PmLogLib at the "notice" level.

*/
exports.warning = warning;
var notice = function notice(messageId, keyVals, freeText) {
log(levelNotice, messageId, keyVals, freeText);
};
/**

@@ -199,9 +184,7 @@ * Logs with PmLogLib at the "info" level.

*/
exports.notice = notice;
var info = function info(messageId, keyVals, freeText) {
log(levelInfo, messageId, keyVals, freeText);
};
/**

@@ -216,9 +199,7 @@ * Logs with PmLogLib at the "debug" level.

*/
exports.info = info;
var debug = function debug(freeText) {
log(levelDebug, '', '', freeText);
};
/**

@@ -236,6 +217,3 @@ * Places a time-stamped performance log entry into the system log using the `PmLogInfoWithClock()`

*/
exports.debug = debug;
var perfLog = function perfLog(messageId, perfType, perfGroup) {

@@ -246,3 +224,2 @@ if (typeof window !== 'undefined' && window.PalmSystem) {

}
if (window.PalmSystem.PmLogInfoWithClock) {

@@ -255,3 +232,2 @@ window.PalmSystem.PmLogInfoWithClock(messageId, perfType ? perfType : '', perfGroup ? perfGroup : '');

};
exports.perfLog = perfLog;

@@ -18,7 +18,4 @@ "use strict";

});
var _readAlert = _interopRequireDefault(require("./readAlert"));
var _VoiceControlDecorator = _interopRequireDefault(require("./VoiceControlDecorator"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -7,12 +7,8 @@ "use strict";

exports.readAlert = exports["default"] = void 0;
var _LS2Request = _interopRequireDefault(require("../LS2Request"));
var _platform = require("../platform");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/* eslint-disable no-console */
/* eslint-disable no-console */
var audioGuidanceEnabled = null;
var checkAudioGuidance = function checkAudioGuidance() {

@@ -35,3 +31,2 @@ return new Promise(function (resolve, reject) {

}
audioGuidanceEnabled = false;

@@ -51,3 +46,2 @@ reject();

};
var readAlertMessage = function readAlertMessage(string, clear) {

@@ -71,2 +65,3 @@ return function () {

};
/**

@@ -82,7 +77,4 @@ * Read alert text when accessibility audio guidance is enabled.

*/
var readAlert = function readAlert(string) {
var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (_platform.platform.tv) {

@@ -98,5 +90,4 @@ checkAudioGuidance().then(readAlertMessage(string, clear))["catch"](function (message) {

};
exports.readAlert = readAlert;
var _default = readAlert;
exports["default"] = _default;

@@ -7,41 +7,21 @@ "use strict";

exports["default"] = exports.VoiceControlDecorator = void 0;
var _react = require("react");
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactDom = require("react-dom");
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/**

@@ -100,14 +80,9 @@ * VoiceControlDecorator is a higher-order component that adds a callback for voice event

var _class;
return _class = /*#__PURE__*/function (_Component) {
_inherits(_class, _Component);
var _super = _createSuper(_class);
function _class() {
_classCallCheck(this, _class);
return _super.apply(this, arguments);
}
_createClass(_class, [{

@@ -117,7 +92,5 @@ key: "componentDidMount",

this.node = (0, _reactDom.findDOMNode)(this); // eslint-disable-line
if (this.node && !(this.node.hasAttribute('data-webos-voice-event-target') || this.node.hasAttribute('data-webos-voice-intent'))) {
this.node = this.node.querySelector('[data-webos-voice-event-target]') || this.node.querySelector('[data-webos-voice-intent]');
}
if (this.node) this.node.addEventListener('webOSVoice', this.props.onVoice);

@@ -134,3 +107,2 @@ }

var props = _objectSpread({}, this.props);
delete props.onVoice;

@@ -140,7 +112,4 @@ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, props));

}]);
return _class;
}(_react.Component), _class.displayName = 'VoiceControlDecorator', _class.propTypes =
/** @lends webos/speech.VoiceControlDecorator.prototype */
{
}(_react.Component), _class.displayName = 'VoiceControlDecorator', _class.propTypes = /** @lends webos/speech.VoiceControlDecorator.prototype */{
/**

@@ -147,0 +116,0 @@ * Callback to be executed when a wrapped element's `data-webos-voice-intent` is activated.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc