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

global-input-react

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-input-react - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

58

dist/GlobalInputReceiver.js

@@ -36,2 +36,10 @@ (function (global, factory) {

function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
var _createClass = function () {

@@ -55,10 +63,2 @@ function defineProperties(target, props) {

function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {

@@ -83,14 +83,27 @@ if (typeof superClass !== "function" && superClass !== null) {

function GlobalInputReceiver() {
_createClass(GlobalInputReceiver, [{
key: "getGlobalInputConfig",
value: function getGlobalInputConfig() {
var config = {
options: {
onInput: this.onInput.bind(this)
}
};
if (this.props.onRegistered) {
config.options.onRegistered = this.props.onRegistered;
}
return config;
}
}]);
function GlobalInputReceiver(props) {
_classCallCheck(this, GlobalInputReceiver);
return _possibleConstructorReturn(this, (GlobalInputReceiver.__proto__ || Object.getPrototypeOf(GlobalInputReceiver)).apply(this, arguments));
var _this = _possibleConstructorReturn(this, (GlobalInputReceiver.__proto__ || Object.getPrototypeOf(GlobalInputReceiver)).call(this, props));
_this.connector = (0, _globalInputMessage.createMessageConnector)();
return _this;
}
_createClass(GlobalInputReceiver, [{
key: "getGlobalInputConfig",
value: function getGlobalInputConfig() {
return {};
}
}, {
key: "onInput",

@@ -103,8 +116,7 @@ value: function onInput(inputMessage) {

value: function connectToMessenger() {
this.connector = (0, _globalInputMessage.createMessageConnector)();
var config = this.getGlobalInputConfig();
var options = { onInput: this.onInput.bind(this) };
if (this.props.onRegistered) {
options.onRegistered = this.props.onRegistered;
if (!config.options) {
config.options = {};
}
var options = Object.assign({}, config.options);
if (config.metadata) {

@@ -119,10 +131,2 @@ options.metadata = config.metadata.map(function (m) {

}
console.log("new metadata:" + options.metadata);
if (config.url) {
options.url = config.url;
}
if (config.onInput) {
options.onInput = config.onInput;
}
this.connector.connect(options);

@@ -129,0 +133,0 @@ }

@@ -36,2 +36,10 @@ (function (global, factory) {

function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
var _createClass = function () {

@@ -55,10 +63,2 @@ function defineProperties(target, props) {

function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {

@@ -83,2 +83,14 @@ if (typeof superClass !== "function" && superClass !== null) {

_createClass(GlobalInputSender, [{
key: "getGlobalInputConfig",
value: function getGlobalInputConfig() {
var config = {
options: {
onInputPermissionResult: this.onInputPermissionResult.bind(this)
}
};
return config;
}
}]);
function GlobalInputSender(props) {

@@ -113,15 +125,10 @@ _classCallCheck(this, GlobalInputSender);

var that = this;
var options = {
onInputPermissionResult: this.onInputPermissionResult.bind(this),
onSettings: this.onSettingsCodeData.bind(this)
};
var config = this.getGlobalInputConfig();
var options = {};
if (config && config.options) {
options = config.options;
}
this.connector.processCodeData(options, codedata);
}
}, {
key: "onSettingsCodeData",
value: function onSettingsCodeData(codedata, next) {
console.log("datadata received:" + JSON.stringify(codedata));
next();
}
}, {
key: "onInputPermissionResult",

@@ -128,0 +135,0 @@ value: function onInputPermissionResult(message) {

{
"name": "global-input-react",
"version": "1.1.6",
"version": "1.1.7",
"description": "global input react component",

@@ -5,0 +5,0 @@ "repository": {

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