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

@coorpacademy/components

Package Overview
Dependencies
Maintainers
12
Versions
2092
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coorpacademy/components - npm Package Compare versions

Comparing version 0.3.5 to 1.0.0

lib/components/atom/label-mod-name/index.js

4

lib/bundle-mooc.js

@@ -11,5 +11,5 @@ 'use strict';

var _ = require('./');
var _components = require('./components');
var components = _interopRequireWildcard(_);
var components = _interopRequireWildcard(_components);

@@ -16,0 +16,0 @@ 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; } }

@@ -11,5 +11,5 @@ 'use strict';

var _ = require('./');
var _components = require('./components');
var components = _interopRequireWildcard(_);
var components = _interopRequireWildcard(_components);

@@ -16,0 +16,0 @@ 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; } }

@@ -11,5 +11,5 @@ 'use strict';

var _ = require('./');
var _components = require('./components');
var components = _interopRequireWildcard(_);
var components = _interopRequireWildcard(_components);

@@ -16,0 +16,0 @@ 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; } }

@@ -11,5 +11,5 @@ 'use strict';

var _ = require('./');
var _components = require('./components');
var components = _interopRequireWildcard(_);
var components = _interopRequireWildcard(_components);

@@ -16,0 +16,0 @@ 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; } }

'use strict';
var _ = require('./');
var _components = require('./components');
var bundle = _interopRequireWildcard(_);
var bundle = _interopRequireWildcard(_components);

@@ -7,0 +7,0 @@ 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; } }

@@ -57,3 +57,9 @@ 'use strict';

if (!(0, _isArray2.default)(children)) children = [];
return _react.createElement.apply(undefined, [tag, props || null].concat(_toConsumableArray((0, _flatten2.default)(children))));
var _children = (0, _flatten2.default)(children);
if (process.env.NODE_ENV !== 'production' && (0, _isFunction2.default)(tag) && tag.validate) {
tag.validate(props, _children);
}
return _react.createElement.apply(undefined, [tag, props || null].concat(_toConsumableArray(_children)));
};

@@ -94,3 +100,4 @@

update: function update() {},
destroy: function destroy() {}
destroy: function destroy() {},
validate: null
}, options);

@@ -116,2 +123,3 @@

_widget.resolve = false;
_widget.validate = options.validate;
return _widget;

@@ -118,0 +126,0 @@ };

@@ -104,8 +104,18 @@ 'use strict';

var h = function h(tag, props, children) {
var _tag = (0, _isFunction2.default)(tag) ? 'div' : tag;
var _props = (0, _isFunction2.default)(tag) ? props : transformProps(props);
var _children = (0, _pipe2.default)(_compact2.default, _flatten2.default)(props && props.children || children || []);
var isComponent = (0, _isFunction2.default)(tag);
var _children = (0, _pipe2.default)(_compact2.default, _flatten2.default)(children);
if (process.env.NODE_ENV !== 'production' && isComponent && tag.validate) {
tag.validate(props, _children);
}
var _tag = isComponent ? 'div' : tag;
var _props = isComponent ? props : transformProps(props);
var vTree = (0, _h3.default)(_tag, _props || {}, _children);
if ((0, _isFunction2.default)(tag)) vTree.sel = tag;
if (isComponent) {
vTree.sel = tag;
}
return vTree;

@@ -147,6 +157,7 @@ };

update: function update() {},
destroy: function destroy() {}
destroy: function destroy() {},
validate: null
}, options);
return function (props) {
var Widget = function Widget(props) {
return (0, _h3.default)(options.tagName, {

@@ -167,2 +178,6 @@ props: props,

};
Widget.validate = options.validate;
return Widget;
};

@@ -169,0 +184,0 @@

@@ -17,3 +17,3 @@ 'use strict';

(0, _ava2.default)(name + ': should clone element', function (t) {
(0, _ava2.default)(name + ' › should clone element', function (t) {
var node = h(

@@ -35,3 +35,3 @@ 'span',

(0, _ava2.default)(name + ': should clone simple element', function (t) {
(0, _ava2.default)(name + ' › should clone simple element', function (t) {
var node = h(

@@ -53,3 +53,3 @@ 'span',

(0, _ava2.default)(name + ': should clone element and replace property', function (t) {
(0, _ava2.default)(name + ' › should clone element and replace property', function (t) {
var node = h(

@@ -70,3 +70,3 @@ 'span',

(0, _ava2.default)(name + ': should clone element and replace deep property', function (t) {
(0, _ava2.default)(name + ' › should clone element and replace deep property', function (t) {
var node = h(

@@ -88,3 +88,3 @@ 'h1',

(0, _ava2.default)(name + ': should clone element and add property', function (t) {
(0, _ava2.default)(name + ' › should clone element and add property', function (t) {
var node = h(

@@ -105,3 +105,3 @@ 'span',

(0, _ava2.default)(name + ': should clone element and add deep property', function (t) {
(0, _ava2.default)(name + ' › should clone element and add deep property', function (t) {
var node = h(

@@ -122,3 +122,3 @@ 'span',

(0, _ava2.default)(name + ': should clone element and replace children', function (t) {
(0, _ava2.default)(name + ' › should clone element and replace children', function (t) {
var node = h(

@@ -125,0 +125,0 @@ 'span',

@@ -20,3 +20,3 @@ 'use strict';

(0, _ava2.default)(name + ': should create element', function (t) {
(0, _ava2.default)(name + ' › should create element', function (t) {
var node1 = h('div');

@@ -33,3 +33,3 @@ var node2 = h(

(0, _ava2.default)(name + ': should create element with properties', function (t) {
(0, _ava2.default)(name + ' › should create element with properties', function (t) {
var node1 = h('div', { style: { color: 'blue' }, name: 'test' });

@@ -45,3 +45,3 @@ var node2 = h(

(0, _ava2.default)(name + ': should create element with null properties', function (t) {
(0, _ava2.default)(name + ' › should create element with null properties', function (t) {
var node1 = h('div', {});

@@ -59,3 +59,3 @@ var node2 = h('div', null);

(0, _ava2.default)(name + ': should create element with empty children', function (t) {
(0, _ava2.default)(name + ' › should create element with empty children', function (t) {
var node1 = h('div', null, []);

@@ -73,3 +73,3 @@ var node2 = h('div', {}, []);

(0, _ava2.default)(name + ': should create element with null children', function (t) {
(0, _ava2.default)(name + ' › should create element with null children', function (t) {
var node1 = h('div', null, null);

@@ -87,3 +87,3 @@ var node2 = h('div', {}, null);

(0, _ava2.default)(name + ': should create element with children', function (t) {
(0, _ava2.default)(name + ' › should create element with children', function (t) {
var children = ['title', h('span', null, ['sub-title'])];

@@ -103,3 +103,3 @@

(0, _ava2.default)(name + ': should create component', function (t) {
(0, _ava2.default)(name + ' › should create component', function (t) {
var Component = function Component() {

@@ -121,3 +121,3 @@ return h('h1');

(0, _ava2.default)(name + ': should create component with props', function (t) {
(0, _ava2.default)(name + ' › should create component with props', function (t) {
var Component = function Component(_ref2) {

@@ -140,3 +140,3 @@ var name = _ref2.name;

(0, _ava2.default)(name + ': should create component with children', function (t) {
(0, _ava2.default)(name + ' › should create component with children', function (t) {
var Component = function Component(_ref3) {

@@ -143,0 +143,0 @@ var foo = _ref3.foo;

@@ -18,3 +18,3 @@ 'use strict';

(0, _ava2.default)(name + ': should travel each children', function (t) {
(0, _ava2.default)(name + ' › should travel each children', function (t) {
var Component = function Component(props, children) {

@@ -44,3 +44,3 @@ return h(

(0, _ava2.default)(name + ': shouldn\'t process if there is no child', function (t) {
(0, _ava2.default)(name + ' › shouldn\'t process if there is no child', function (t) {
t.plan(0);

@@ -47,0 +47,0 @@ map(function () {

@@ -26,3 +26,3 @@ 'use strict';

(0, _ava2.default)(name + ': should render vTree', function (t) {
(0, _ava2.default)(name + ' › should render vTree', function (t) {
var root = render(document.createElement('div'))(h(

@@ -37,3 +37,3 @@ 'h1',

(0, _ava2.default)(name + ': should render vTree with Components', function (t) {
(0, _ava2.default)(name + ' › should render vTree with Components', function (t) {
var Component = function Component(props) {

@@ -75,3 +75,3 @@ return h(

(0, _ava2.default)(name + ': should render ' + key + ' attribute', function (t) {
(0, _ava2.default)(name + ' › should render ' + key + ' attribute', function (t) {
var root = render(document.createElement('div'))(h(tagName, _defineProperty({}, key, value)));

@@ -90,3 +90,3 @@

_ava2.default.cb(name + ': should attach ' + eventName + ' listener', function (t) {
_ava2.default.cb(name + ' › should attach ' + eventName + ' listener', function (t) {
t.plan(1);

@@ -93,0 +93,0 @@ var onEvent = function onEvent(e) {

@@ -17,3 +17,3 @@ 'use strict';

(0, _ava2.default)(name + ': should resolve component node', function (t) {
(0, _ava2.default)(name + ' › should resolve component node', function (t) {
var Component = function Component(props) {

@@ -40,3 +40,3 @@ return h(

(0, _ava2.default)(name + ': should resolve component node with properties', function (t) {
(0, _ava2.default)(name + ' › should resolve component node with properties', function (t) {
var Component = function Component(props) {

@@ -63,3 +63,3 @@ return h(

(0, _ava2.default)(name + ': should resolve component node with children', function (t) {
(0, _ava2.default)(name + ' › should resolve component node with children', function (t) {
var Component = function Component(props, children) {

@@ -66,0 +66,0 @@ return h(

@@ -18,3 +18,3 @@ 'use strict';

(0, _ava2.default)(name + ': should travel each tree\'s nodes', function (t) {
(0, _ava2.default)(name + ' › should travel each tree\'s nodes', function (t) {
var tree = h(

@@ -44,3 +44,3 @@ 'header',

(0, _ava2.default)(name + ': should resolve each nodes', function (t) {
(0, _ava2.default)(name + ' › should resolve each nodes', function (t) {
var Header = function Header(props, children) {

@@ -47,0 +47,0 @@ return h(

@@ -25,3 +25,3 @@ 'use strict';

(0, _ava2.default)(name + ': should create widget without options', function (t) {
(0, _ava2.default)(name + ' › should create widget without options', function (t) {
var Widget = widget();

@@ -39,3 +39,3 @@ var update = render(document.createElement('div'));

(0, _ava2.default)(name + ': should create widget with specified tagName', function (t) {
(0, _ava2.default)(name + ' › should create widget with specified tagName', function (t) {
var Widget = widget({

@@ -54,3 +54,3 @@ tagName: 'span'

(0, _ava2.default)(name + ': should create widget with specified namespace', function (t) {
(0, _ava2.default)(name + ' › should create widget with specified namespace', function (t) {
var Widget = widget({

@@ -71,3 +71,3 @@ tagName: 'svg',

(0, _ava2.default)(name + ': should implement initiation', function (t) {
(0, _ava2.default)(name + ' › should implement initiation', function (t) {
t.plan(2);

@@ -102,3 +102,3 @@

(0, _ava2.default)(name + ': should pass (props, el) on init', function (t) {
(0, _ava2.default)(name + ' › should pass (props, el) on init', function (t) {
t.plan(2);

@@ -122,3 +122,3 @@

(0, _ava2.default)(name + ': should have default destroy', function (t) {
(0, _ava2.default)(name + ' › should have default destroy', function (t) {
var Widget = widget();

@@ -141,3 +141,3 @@

(0, _ava2.default)(name + ': should implement destroy', function (t) {
(0, _ava2.default)(name + ' › should implement destroy', function (t) {
t.plan(1);

@@ -171,3 +171,3 @@

(0, _ava2.default)(name + ': should pass (el) on destroy', function (t) {
(0, _ava2.default)(name + ' › should pass (el) on destroy', function (t) {
t.plan(1);

@@ -197,3 +197,3 @@

(0, _ava2.default)(name + ': should implement update', function (t) {
(0, _ava2.default)(name + ' › should implement update', function (t) {
t.plan(2);

@@ -227,3 +227,3 @@

(0, _ava2.default)(name + ': should pass (props, prev, el) on update', function (t) {
(0, _ava2.default)(name + ' › should pass (props, prev, el) on update', function (t) {
t.plan(3);

@@ -255,3 +255,5 @@

});
(0, _ava2.default)(name + ' › should execute validation', function (t) {});
});
//# sourceMappingURL=widget.js.map

@@ -66,8 +66,18 @@ 'use strict';

var h = function h(tag, props, children) {
var _tag = (0, _isFunction2.default)(tag) ? 'div' : tag;
var _props = (0, _isFunction2.default)(tag) ? props : transformProps(props);
var isComponent = (0, _isFunction2.default)(tag);
var _children = (0, _flatten2.default)(children);
var vTree = (0, _h3.default)(_tag, _props, (0, _flatten2.default)(children));
if ((0, _isFunction2.default)(tag)) vTree.tagName = tag;
if (process.env.NODE_ENV !== 'production' && isComponent && tag.validate) {
tag.validate(props, _children);
}
var _tag = isComponent ? 'div' : tag;
var _props = isComponent ? props : transformProps(props);
var vTree = (0, _h3.default)(_tag, _props, _children);
if (isComponent) {
vTree.tagName = tag;
}
return vTree;

@@ -119,3 +129,4 @@ };

update: function update() {},
destroy: function destroy() {}
destroy: function destroy() {},
validate: null
}, options);

@@ -143,5 +154,8 @@

return function (props) {
var component = function component(props) {
return new Widget(props);
};
component.validate = options.validate;
return component;
};

@@ -148,0 +162,0 @@

@@ -19,3 +19,3 @@ 'use strict';

var createD3Widget = function createD3Widget(createChart) {
var createD3Widget = function createD3Widget(createChart, validate) {
return function (engine, options) {

@@ -46,3 +46,4 @@ var init = function init(props, el) {

update: update,
destroy: destroy
destroy: destroy,
validate: validate
});

@@ -49,0 +50,0 @@ };

@@ -7,27 +7,13 @@ 'use strict';

var _pipe = require('lodash/fp/pipe');
var _engines = require('../engines');
var _pipe2 = _interopRequireDefault(_pipe);
var _engines2 = _interopRequireDefault(_engines);
var _toPairs = require('lodash/fp/toPairs');
var _forEach = require('./for-each');
var _toPairs2 = _interopRequireDefault(_toPairs);
var _forEach2 = _interopRequireDefault(_forEach);
var _spread = require('lodash/fp/spread');
var _spread2 = _interopRequireDefault(_spread);
var _map = require('lodash/fp/map');
var _map2 = _interopRequireDefault(_map);
var _engines = require('../engines');
var _engines2 = _interopRequireDefault(_engines);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (fn) {
return (0, _pipe2.default)(_toPairs2.default, (0, _map2.default)((0, _spread2.default)(fn)))(_engines2.default);
};
exports.default = (0, _forEach2.default)(_engines2.default);
//# sourceMappingURL=for-each-engine.js.map

@@ -22,3 +22,3 @@ 'use strict';

(0, _ava2.default)(name + ': should extend children properties', function (t) {
(0, _ava2.default)(name + ' › should extend children properties', function (t) {
var Title = function Title(props, children) {

@@ -55,3 +55,3 @@ return h(

(0, _ava2.default)(name + ': should override children properties', function (t) {
(0, _ava2.default)(name + ' › should override children properties', function (t) {
var Title = function Title(props, children) {

@@ -58,0 +58,0 @@ return h(

@@ -23,3 +23,3 @@ 'use strict';

(0, _ava2.default)(name + ': should decorate element', function (t) {
(0, _ava2.default)(name + ' › should decorate element', function (t) {
var List = function List(props, children) {

@@ -59,3 +59,3 @@ return h(

(0, _ava2.default)(name + ': should pass properties to composite components', function (t) {
(0, _ava2.default)(name + ' › should pass properties to composite components', function (t) {
var List = function List(props, children) {

@@ -62,0 +62,0 @@ return h(

@@ -22,3 +22,3 @@ 'use strict';

(0, _ava2.default)(name + ': should extend children properties', function (t) {
(0, _ava2.default)(name + ' › should extend children properties', function (t) {
var Title = function Title(props, children) {

@@ -58,3 +58,44 @@ return h(

});
(0, _ava2.default)(name + ' › should override or use default children properties', function (t) {
var Title = function Title(props) {
return h(
'h1',
{ foo: props.foo },
[h(
'strong',
{ bar: props.bar },
[props.baz]
)]
);
};
var Wrapper = (0, _wrapper2.default)(function () {
return function (props) {
return props;
};
})(engine);
var titleDefault = h(
Title,
{ foo: 'foo', bar: 'bar', baz: 'baz' },
[]
);
var wrapper = h(
Wrapper,
{ foo: '__FOO' },
[titleDefault]
);
var expectedTitle = h(
'h1',
{ foo: '__FOO' },
[h(
'strong',
{ bar: 'bar' },
['baz']
)]
);
t.deepEqual(resolve(wrapper), expectedTitle);
});
});
//# sourceMappingURL=wrapper.js.map
{
"name": "@coorpacademy/components",
"version": "0.3.5",
"version": "1.0.0",
"description": "Component library for web front ends",
"main": "lib/index.js",
"main": "lib/components/index.js",
"scripts": {
"start": "babel-node sandbox/index.js",
"build": "npm run build:commonjs & npm run build:browser & wait",
"build:commonjs": "npm run clean:commonjs && babel src --out-dir lib -s",
"build:browser": "npm run clean:browser && webpack",
"build:dev-mooc": "npm run clean:browser && webpack --config webpack-dev-mooc.config.js",
"build:commonjs": "npm run build:bundle && npm run clean:commonjs && BABEL_ENV=production babel src --out-dir lib -s",
"build:browser": "npm run build:bundle && npm run clean:browser && webpack",
"build:dev-mooc": "npm run build:bundle && npm run clean:browser && webpack --config webpack-dev-mooc.config.js",
"build:bundle": "babel-node src/util/generate-bundle.js",
"prepublish": "npm run build",

@@ -19,6 +20,5 @@ "clean": "npm run clean:commonjs & npm run clean:browser & npm run clean:cov & wait",

"lint": "eslint src/",
"ava": "ava",
"nyc": "nyc ava",
"nyc:lcov": "nyc ava --reporter=text --reporter=lcov",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
"ava": "BABEL_ENV=test ava",
"nyc": "BABEL_ENV=test nyc ava --reporter=text --reporter=lcov",
"coveralls": "BABEL_ENV=test nyc report --reporter=text-lcov | coveralls"
},

@@ -38,2 +38,3 @@ "contributors": [

"angular": "^1.5.2",
"api-check": "^7.5.5",
"autoprefixer": "^6.3.3",

@@ -45,2 +46,3 @@ "ava": "^0.15.2",

"babel-loader": "^6.2.4",
"babel-plugin-css-modules-transform": "^0.1.0",
"babel-plugin-transform-h-jsx": "^1.0.0",

@@ -54,7 +56,8 @@ "babel-plugin-transform-react-jsx": "^6.6.5",

"css-loader": "^0.23.0",
"eslint": "^2.10.0",
"eslint": "^3.0.0",
"eslint-plugin-ava": "^2.3.1",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"file-loader": "^0.9.0",
"glob": "^7.0.3",
"jsdom": "^9.0.0",

@@ -64,2 +67,3 @@ "json-loader": "^0.5.4",

"nyc": "^6.4.2",
"pascal-case": "^1.1.2",
"postcss-loader": "^0.9.1",

@@ -90,2 +94,5 @@ "react": "^15.0.2",

"exclude": [
"src/bundle*",
"src/components/widget*",
"src/util/generation-bundle.js",
"src/**/test/**"

@@ -92,0 +99,0 @@ ],

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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