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

panel

Package Overview
Dependencies
Maintainers
2
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

panel - npm Package Compare versions

Comparing version 0.9.1 to 0.10.0-rc1

build/dom-patcher.js

45

build/component.js

@@ -9,26 +9,14 @@ 'use strict';

var _mainLoop = require('main-loop');
var _h = require('snabbdom-tdumitrescu/h');
var _mainLoop2 = _interopRequireDefault(_mainLoop);
var _h2 = _interopRequireDefault(_h);
var _createElement = require('virtual-dom/create-element');
var _webcomponent = require('webcomponent');
var _createElement2 = _interopRequireDefault(_createElement);
var _webcomponent2 = _interopRequireDefault(_webcomponent);
var _diff = require('virtual-dom/diff');
var _domPatcher = require('./dom-patcher');
var _diff2 = _interopRequireDefault(_diff);
var _domPatcher2 = _interopRequireDefault(_domPatcher);
var _patch = require('virtual-dom/patch');
var _patch2 = _interopRequireDefault(_patch);
var _virtualHyperscript = require('virtual-dom/virtual-hyperscript');
var _virtualHyperscript2 = _interopRequireDefault(_virtualHyperscript);
var _webcomponent = require('webcomponent');
var _webcomponent2 = _interopRequireDefault(_webcomponent);
var _router = require('./router');

@@ -48,3 +36,3 @@

var DOCUMENT_FRAGMENT_NODE = 11;
var EMPTY_DIV = (0, _virtualHyperscript2.default)('div');
var EMPTY_DIV = (0, _h2.default)('div');

@@ -98,3 +86,3 @@ /**

* to be created
* @param {object} [attrs={}] - HTML attributes to assign to the child
* @param {object} [config={}] - snabbdom node config (second argument of h())
* @returns {object} virtual-dom node

@@ -105,7 +93,6 @@ * @example

value: function child(tagName) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var config = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
attrs = Object.assign({}, attrs);
attrs.attributes = Object.assign({}, attrs.attributes, { 'panel-parent': this.panelID });
return (0, _virtualHyperscript2.default)(tagName, attrs);
config.attrs = Object.assign({}, config.attrs, { 'panel-parent': this.panelID });
return (0, _h2.default)(tagName, config);
}

@@ -292,6 +279,2 @@

this.loop = (0, _mainLoop2.default)(this.state, this._render.bind(this), { create: _createElement2.default, diff: _diff2.default, patch: _patch2.default });
this.el.appendChild(this.loop.target);
this.initialized = true;
if (Object.keys(this.getConfig('routes')).length) {

@@ -301,2 +284,6 @@ this.router = new _router2.default(this, { historyMethod: this.historyMethod });

}
this.domPatcher = new _domPatcher2.default(this.state, this._render.bind(this));
this.el.appendChild(this.domPatcher.el);
this.initialized = true;
}

@@ -345,3 +332,3 @@ }, {

if (this.initialized && this.shouldUpdate(state)) {
this.loop.update(state);
this.domPatcher.update(state);
var _iteratorNormalCompletion = true;

@@ -348,0 +335,0 @@ var _didIteratorError = false;

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

var _virtualHyperscript = require('virtual-dom/virtual-hyperscript');
var _h = require('snabbdom-tdumitrescu/h');
var _virtualHyperscript2 = _interopRequireDefault(_virtualHyperscript);
var _h2 = _interopRequireDefault(_h);

@@ -29,12 +29,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.
/** {@link Component} class, to be subclassed by apps */
Component = _component2.default;
exports.
/**
* [virtual-dom]{@link https://github.com/Matt-Esch/virtual-dom} function to create Hyperscript nodes,
* exported here for user convenience
*/
h = _virtualHyperscript2.default;
exports.Component = _component2.default;
exports.h = _h2.default;

@@ -1,8 +0,5 @@

import MainLoop from 'main-loop';
import create from 'virtual-dom/create-element';
import diff from 'virtual-dom/diff';
import patch from 'virtual-dom/patch';
import h from 'virtual-dom/virtual-hyperscript';
import h from 'snabbdom-tdumitrescu/h';
import WebComponent from 'webcomponent';
import DOMPatcher from './dom-patcher';
import Router from './router';

@@ -73,3 +70,3 @@

* to be created
* @param {object} [attrs={}] - HTML attributes to assign to the child
* @param {object} [config={}] - snabbdom node config (second argument of h())
* @returns {object} virtual-dom node

@@ -79,6 +76,5 @@ * @example

*/
child(tagName, attrs={}) {
attrs = Object.assign({}, attrs);
attrs.attributes = Object.assign({}, attrs.attributes, {'panel-parent': this.panelID});
return h(tagName, attrs);
child(tagName, config={}) {
config.attrs = Object.assign({}, config.attrs, {'panel-parent': this.panelID});
return h(tagName, config);
}

@@ -244,6 +240,2 @@

this.loop = MainLoop(this.state, this._render.bind(this), {create, diff, patch});
this.el.appendChild(this.loop.target);
this.initialized = true;
if (Object.keys(this.getConfig('routes')).length) {

@@ -253,2 +245,6 @@ this.router = new Router(this, {historyMethod: this.historyMethod});

}
this.domPatcher = new DOMPatcher(this.state, this._render.bind(this));
this.el.appendChild(this.domPatcher.el);
this.initialized = true;
}

@@ -289,3 +285,3 @@

if (this.initialized && this.shouldUpdate(state)) {
this.loop.update(state);
this.domPatcher.update(state);
for (let child of this.$panelChildren) {

@@ -292,0 +288,0 @@ child.updateSelfAndChildren(state);

@@ -12,3 +12,3 @@ /**

import Component from './component';
import h from 'virtual-dom/virtual-hyperscript';
import h from 'snabbdom-tdumitrescu/h';

@@ -21,3 +21,3 @@ export {

/**
* [virtual-dom]{@link https://github.com/Matt-Esch/virtual-dom} function to create Hyperscript nodes,
* [snabbdom]{@link https://github.com/snabbdom/snabbdom} function to create Hyperscript nodes,
* exported here for user convenience

@@ -24,0 +24,0 @@ */

{
"name": "panel",
"version": "0.9.1",
"version": "0.10.0-rc1",
"description": "Web Components with Virtual DOM: lightweight composable web apps",

@@ -22,3 +22,3 @@ "main": "build/index.js",

"web components",
"virtual-dom",
"virtual dom",
"react",

@@ -35,6 +35,6 @@ "jade",

"dependencies": {
"html-element": "^2.1.1",
"main-loop": "3.2.0",
"raf": "^3.2.0",
"virtual-dom": "2.1.1",
"html-element": "2.2.0",
"raf": "3.2.0",
"snabbdom-delayed-class": "0.1.1",
"snabbdom-tdumitrescu": "0.6.1",
"webcomponent": "0.1.2"

@@ -54,3 +54,3 @@ },

"mocha": "^2.5.3",
"web-component-tester": "4.2.2",
"web-component-tester": "5.0.0",
"webcomponents.js": "0.7.22",

@@ -57,0 +57,0 @@ "webpack": "1.13.0"

@@ -38,4 +38,4 @@ # panel

.controls
button.decr(onclick=$helpers.decr) -
button.incr(onclick=$helpers.incr) +
button.decr(on={click: $helpers.decr}) -
button.incr(on={click: $helpers.incr}) +
```

@@ -42,0 +42,0 @@

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