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

grape-web

Package Overview
Dependencies
Maintainers
2
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grape-web - npm Package Compare versions

Comparing version 0.19.1 to 0.19.2

4

lib/jss-utils/mixins.js
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = {

@@ -5,0 +7,0 @@ clearfix: {

// Setup jss plugins.
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});

@@ -34,11 +36,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var jss = _jss.create();
var jss = (0, _jss.create)();
exports.jss = jss;
var useSheet = _reactJss2['default'](jss);
var useSheet = (0, _reactJss2['default'])(jss);
exports.useSheet = useSheet;
jss.use(_jssExtend2['default']());
jss.use(_jssNested2['default']());
jss.use(_jssCamelCase2['default']());
jss.use(_jssDefaultUnit2['default']());
jss.use(_jssVendorPrefixer2['default']());
jss.use((0, _jssExtend2['default'])());
jss.use((0, _jssNested2['default'])());
jss.use((0, _jssCamelCase2['default'])());
jss.use((0, _jssDefaultUnit2['default'])());
jss.use((0, _jssVendorPrefixer2['default'])());
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = findMatches;

@@ -24,3 +26,3 @@

var searchRegExpStr = searchArr.map(function (searchStr) {
return '(' + _lodashStringEscapeRegExp2['default'](searchStr) + ')';
return '(' + (0, _lodashStringEscapeRegExp2['default'])(searchStr) + ')';
}).join('|');

@@ -27,0 +29,0 @@ var regExp = new RegExp('\\b' + searchRegExpStr + '\\b', 'gi');

@@ -15,99 +15,99 @@ 'use strict';

it('should return single match', function () {
var matches = _findMatches2['default']('a', 'a');
_expectJs2['default'](matches.length).to.be(1);
_expectJs2['default'](matches[0].text).to.be('a');
_expectJs2['default'](matches[0].found).to.be.ok();
var matches = (0, _findMatches2['default'])('a', 'a');
(0, _expectJs2['default'])(matches.length).to.be(1);
(0, _expectJs2['default'])(matches[0].text).to.be('a');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
});
it('should return match with special chars', function () {
var matches = _findMatches2['default']('+', '+');
_expectJs2['default'](matches.length).to.be(1);
_expectJs2['default'](matches[0].text).to.be('+');
_expectJs2['default'](matches[0].found).to.be.ok();
var matches = (0, _findMatches2['default'])('+', '+');
(0, _expectJs2['default'])(matches.length).to.be(1);
(0, _expectJs2['default'])(matches[0].text).to.be('+');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
});
it('should return case insensitive match', function () {
var matches = _findMatches2['default']('a', 'A');
_expectJs2['default'](matches.length).to.be(1);
_expectJs2['default'](matches[0].text).to.be('a');
_expectJs2['default'](matches[0].found).to.be.ok();
var matches = (0, _findMatches2['default'])('a', 'A');
(0, _expectJs2['default'])(matches.length).to.be(1);
(0, _expectJs2['default'])(matches[0].text).to.be('a');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
});
it('should return word only match (0)', function () {
var matches = _findMatches2['default']('ab', 'a');
_expectJs2['default'](matches.length).to.be(1);
_expectJs2['default'](matches[0].text).to.be('ab');
_expectJs2['default'](matches[0].found).to.not.be.ok();
var matches = (0, _findMatches2['default'])('ab', 'a');
(0, _expectJs2['default'])(matches.length).to.be(1);
(0, _expectJs2['default'])(matches[0].text).to.be('ab');
(0, _expectJs2['default'])(matches[0].found).to.not.be.ok();
});
it('should return word only match (1)', function () {
var matches = _findMatches2['default']('ba', 'a');
_expectJs2['default'](matches.length).to.be(1);
_expectJs2['default'](matches[0].text).to.be('ba');
_expectJs2['default'](matches[0].found).to.not.be.ok();
var matches = (0, _findMatches2['default'])('ba', 'a');
(0, _expectJs2['default'])(matches.length).to.be(1);
(0, _expectJs2['default'])(matches[0].text).to.be('ba');
(0, _expectJs2['default'])(matches[0].found).to.not.be.ok();
});
it('should return word only match (2)', function () {
var matches = _findMatches2['default']('a,', 'a');
_expectJs2['default'](matches.length).to.be(2);
_expectJs2['default'](matches[0].text).to.be('a');
_expectJs2['default'](matches[0].found).to.be.ok();
_expectJs2['default'](matches[1].text).to.be(',');
_expectJs2['default'](matches[1].found).to.not.be.ok();
var matches = (0, _findMatches2['default'])('a,', 'a');
(0, _expectJs2['default'])(matches.length).to.be(2);
(0, _expectJs2['default'])(matches[0].text).to.be('a');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be(',');
(0, _expectJs2['default'])(matches[1].found).to.not.be.ok();
});
it('should return word only match (3)', function () {
var matches = _findMatches2['default'](',a', 'a');
_expectJs2['default'](matches.length).to.be(2);
_expectJs2['default'](matches[0].text).to.be(',');
_expectJs2['default'](matches[0].found).to.not.be.ok();
_expectJs2['default'](matches[1].text).to.be('a');
_expectJs2['default'](matches[1].found).to.be.ok();
var matches = (0, _findMatches2['default'])(',a', 'a');
(0, _expectJs2['default'])(matches.length).to.be(2);
(0, _expectJs2['default'])(matches[0].text).to.be(',');
(0, _expectJs2['default'])(matches[0].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be('a');
(0, _expectJs2['default'])(matches[1].found).to.be.ok();
});
it('should return multi match', function () {
var matches = _findMatches2['default']('a a', 'a');
_expectJs2['default'](matches.length).to.be(3);
_expectJs2['default'](matches[0].text).to.be('a');
_expectJs2['default'](matches[0].found).to.be.ok();
_expectJs2['default'](matches[1].text).to.be(' ');
_expectJs2['default'](matches[1].found).to.not.be.ok();
_expectJs2['default'](matches[2].text).to.be('a');
_expectJs2['default'](matches[2].found).to.be.ok();
var matches = (0, _findMatches2['default'])('a a', 'a');
(0, _expectJs2['default'])(matches.length).to.be(3);
(0, _expectJs2['default'])(matches[0].text).to.be('a');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be(' ');
(0, _expectJs2['default'])(matches[1].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[2].text).to.be('a');
(0, _expectJs2['default'])(matches[2].found).to.be.ok();
});
it('should use multi search', function () {
var matches = _findMatches2['default']('a b', ['a', 'b']);
_expectJs2['default'](matches.length).to.be(3);
_expectJs2['default'](matches[0].text).to.be('a');
_expectJs2['default'](matches[0].found).to.be.ok();
_expectJs2['default'](matches[1].text).to.be(' ');
_expectJs2['default'](matches[1].found).to.not.be.ok();
_expectJs2['default'](matches[2].text).to.be('b');
_expectJs2['default'](matches[2].found).to.be.ok();
var matches = (0, _findMatches2['default'])('a b', ['a', 'b']);
(0, _expectJs2['default'])(matches.length).to.be(3);
(0, _expectJs2['default'])(matches[0].text).to.be('a');
(0, _expectJs2['default'])(matches[0].found).to.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be(' ');
(0, _expectJs2['default'])(matches[1].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[2].text).to.be('b');
(0, _expectJs2['default'])(matches[2].found).to.be.ok();
});
it('shoud match word combination', function () {
var matches = _findMatches2['default']('a b c d', 'b c');
_expectJs2['default'](matches.length).to.be(3);
_expectJs2['default'](matches[0].text).to.be('a ');
_expectJs2['default'](matches[0].found).to.not.be.ok();
_expectJs2['default'](matches[1].text).to.be('b c');
_expectJs2['default'](matches[1].found).to.be.ok();
_expectJs2['default'](matches[2].text).to.be(' d');
_expectJs2['default'](matches[2].found).to.not.be.ok();
var matches = (0, _findMatches2['default'])('a b c d', 'b c');
(0, _expectJs2['default'])(matches.length).to.be(3);
(0, _expectJs2['default'])(matches[0].text).to.be('a ');
(0, _expectJs2['default'])(matches[0].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be('b c');
(0, _expectJs2['default'])(matches[1].found).to.be.ok();
(0, _expectJs2['default'])(matches[2].text).to.be(' d');
(0, _expectJs2['default'])(matches[2].found).to.not.be.ok();
});
it('shoud match multiple word combinations', function () {
var matches = _findMatches2['default']('a b c d e', ['b c', 'd e']);
_expectJs2['default'](matches.length).to.be(4);
_expectJs2['default'](matches[0].text).to.be('a ');
_expectJs2['default'](matches[0].found).to.not.be.ok();
_expectJs2['default'](matches[1].text).to.be('b c');
_expectJs2['default'](matches[1].found).to.be.ok();
_expectJs2['default'](matches[2].text).to.be(' ');
_expectJs2['default'](matches[2].found).to.not.be.ok();
_expectJs2['default'](matches[3].text).to.be('d e');
_expectJs2['default'](matches[3].found).to.be.ok();
var matches = (0, _findMatches2['default'])('a b c d e', ['b c', 'd e']);
(0, _expectJs2['default'])(matches.length).to.be(4);
(0, _expectJs2['default'])(matches[0].text).to.be('a ');
(0, _expectJs2['default'])(matches[0].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[1].text).to.be('b c');
(0, _expectJs2['default'])(matches[1].found).to.be.ok();
(0, _expectJs2['default'])(matches[2].text).to.be(' ');
(0, _expectJs2['default'])(matches[2].found).to.not.be.ok();
(0, _expectJs2['default'])(matches[3].text).to.be('d e');
(0, _expectJs2['default'])(matches[3].found).to.be.ok();
});
});
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});

@@ -9,2 +11,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -53,40 +57,47 @@

_Component.call(this, props);
_get(Object.getPrototypeOf(_Spinner.prototype), 'constructor', this).call(this, props);
this.state = this.createState(this.props);
}
Spinner.prototype.componentDidMount = function componentDidMount() {
var _this = this;
_createClass(Spinner, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this = this;
if (this.state.active) return;
this.timeoutId = setTimeout(function () {
_this.setState({ active: true });
}, this.props.delay);
};
if (this.state.active) return;
this.timeoutId = setTimeout(function () {
_this.setState({ active: true });
}, this.props.delay);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(props) {
this.setState(this.createState(props));
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
clearTimeout(this.timeoutId);
}
}, {
key: 'createState',
value: function createState(props) {
return _extends({}, props);
}
}, {
key: 'render',
value: function render() {
if (!this.state.active) return null;
var classes = this.props.sheet.classes;
Spinner.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
this.setState(this.createState(props));
};
var backgroundImage = 'url(' + this.props.image + ')';
var className = classes.spinner;
if (this.props.overlay) className += ' ' + classes.overlay;
// TODO use svg.
return _react2['default'].createElement('span', { className: className, style: { backgroundImage: backgroundImage } });
}
}]);
Spinner.prototype.componentWillUnmount = function componentWillUnmount() {
clearTimeout(this.timeoutId);
};
Spinner.prototype.createState = function createState(props) {
return _extends({}, props);
};
Spinner.prototype.render = function render() {
if (!this.state.active) return null;
var classes = this.props.sheet.classes;
var backgroundImage = 'url(' + this.props.image + ')';
var className = classes.spinner;
if (this.props.overlay) className += ' ' + classes.overlay;
// TODO use svg.
return _react2['default'].createElement('span', { className: className, style: { backgroundImage: backgroundImage } });
};
var _Spinner = Spinner;
Spinner = _jss.useSheet(_style2['default'])(Spinner) || Spinner;
Spinner = (0, _jss.useSheet)(_style2['default'])(Spinner) || Spinner;
return Spinner;

@@ -93,0 +104,0 @@ })(_react.Component);

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});

@@ -26,5 +28,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

overlay: {
backgroundColor: _color2['default'](_grapeThemeDistBaseColors2['default'].white).alpha(0.7).rgbaString()
backgroundColor: (0, _color2['default'])(_grapeThemeDistBaseColors2['default'].white).alpha(0.7).rgbaString()
}
};
module.exports = exports['default'];
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});

@@ -25,6 +27,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

var data = {};
_lodashCollectionEach2['default'](raw, function (svg, name) {
return data[name] = _toData2['default'](svg);
(0, _lodashCollectionEach2['default'])(raw, function (svg, name) {
return data[name] = (0, _toData2['default'])(svg);
});
exports['default'] = data;
module.exports = exports['default'];

@@ -7,3 +7,8 @@ /**

exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
var _createClass = (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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
exports['default'] = create;

@@ -28,29 +33,36 @@

this.dom = dom;
this.list = _lodashLangToArray2['default'](list);
this.list = (0, _lodashLangToArray2['default'])(list);
}
List.prototype.each = function each(fn) {
this.list.forEach(fn);
return this;
};
_createClass(List, [{
key: 'each',
value: function each(fn) {
this.list.forEach(fn);
return this;
}
}, {
key: 'attr',
value: function attr(name, value) {
this.each(function (node) {
return node.setAttribute(name, value);
});
return this;
}
}, {
key: 'data',
value: function data(encoding) {
return (0, _toData2['default'])(this.svg(), encoding);
}
}, {
key: 'svg',
value: function svg() {
return this.dom.el.innerHTML;
}
}, {
key: 'node',
value: function node() {
return this.dom.el.firstChild;
}
}]);
List.prototype.attr = function attr(name, value) {
this.each(function (node) {
return node.setAttribute(name, value);
});
return this;
};
List.prototype.data = function data(encoding) {
return _toData2['default'](this.svg(), encoding);
};
List.prototype.svg = function svg() {
return this.dom.el.innerHTML;
};
List.prototype.node = function node() {
return this.dom.el.firstChild;
};
return List;

@@ -67,5 +79,8 @@ })();

Dom.prototype.find = function find(query) {
return new List(this, this.el.querySelectorAll(query));
};
_createClass(Dom, [{
key: 'find',
value: function find(query) {
return new List(this, this.el.querySelectorAll(query));
}
}]);

@@ -72,0 +87,0 @@ return Dom;

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = getColored;

@@ -32,3 +34,3 @@

if (!cache[key]) {
cache[key] = _dom2['default'](raw[name]).find('path').attr('fill', color).each(function (node) {
cache[key] = (0, _dom2['default'])(raw[name]).find('path').attr('fill', color).each(function (node) {
if (!node.hasAttribute('stroke')) return;

@@ -35,0 +37,0 @@ node.setAttribute('stroke', color);

@@ -6,3 +6,5 @@ /**

exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});

@@ -9,0 +11,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = toData;

@@ -5,0 +7,0 @@ var defaultEncoding = 'base64';

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.createNotification = createNotification;

@@ -40,7 +42,7 @@ exports.addBadge = addBadge;

if (remote.getGlobal('isNotificationSupported')) {
_web.createNotification(options, callback);
(0, _web.createNotification)(options, callback);
return;
}
var event = _lodashNumberRandom2['default'](10000);
var event = (0, _lodashNumberRandom2['default'])(10000);
var title = options.title;

@@ -47,0 +49,0 @@ var content = options.content;

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.createNotification = createNotification;

@@ -5,0 +7,0 @@ exports.openUrl = openUrl;

"use strict";
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createNotification = createNotification;

@@ -5,0 +7,0 @@ exports.openUrl = openUrl;

'use strict';
exports.__esModule = true;
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.createNotification = createNotification;

@@ -5,0 +7,0 @@ exports.openUrl = openUrl;

{
"name": "grape-web",
"version": "0.19.1",
"version": "0.19.2",
"dependencies": {

@@ -5,0 +5,0 @@ "html5-desktop-notifications": "^1.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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