Comparing version 3.2.1-0 to 3.2.1
# Changelog | ||
## 3.2.1 | ||
Changed rendering of children to replace `undefined` children with `null` | ||
children, because `React.Fragment` apparently does not like `undefined` | ||
children. | ||
## 3.0.0 | ||
@@ -4,0 +10,0 @@ |
@@ -39,2 +39,3 @@ 'use strict'; | ||
var w = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
if (w === undefined) w = null; | ||
if (v !== w) { | ||
@@ -171,4 +172,2 @@ if (newChildren === children) newChildren = children.slice(0); | ||
var empty = /*#__PURE__*/React.createElement(React.Fragment); | ||
var FromClass = /*#__PURE__*/I.inherit(function FromClass(props) { | ||
@@ -210,7 +209,9 @@ React.Component.call(this, props); | ||
var v = args[i]; | ||
newArgs[i] = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
v = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
if (v === undefined) v = null; | ||
newArgs[i] = v; | ||
} | ||
return React.createElement.apply(null, newArgs); | ||
} else { | ||
return empty; | ||
return null; | ||
} | ||
@@ -217,0 +218,0 @@ } |
import { isArray, inherit, object0, isString, dissocPartialU, assocPartialU } from 'infestines'; | ||
import { createElement, Fragment, Component, forwardRef } from 'react'; | ||
import { Component, createElement, Fragment, forwardRef } from 'react'; | ||
export { Fragment } from 'react'; | ||
@@ -36,2 +36,3 @@ import { Property } from 'kefir'; | ||
var w = isProperty(v) ? valueOf(v) : isArray(v) ? renderChildren(v) : v; | ||
if (w === undefined) w = null; | ||
if (v !== w) { | ||
@@ -168,4 +169,2 @@ if (newChildren === children) newChildren = children.slice(0); | ||
var empty = /*#__PURE__*/createElement(Fragment); | ||
var FromClass = /*#__PURE__*/inherit(function FromClass(props) { | ||
@@ -207,7 +206,9 @@ Component.call(this, props); | ||
var v = args[i]; | ||
newArgs[i] = isProperty(v) ? valueOf(v) : isArray(v) ? renderChildren(v) : v; | ||
v = isProperty(v) ? valueOf(v) : isArray(v) ? renderChildren(v) : v; | ||
if (v === undefined) v = null; | ||
newArgs[i] = v; | ||
} | ||
return createElement.apply(null, newArgs); | ||
} else { | ||
return empty; | ||
return null; | ||
} | ||
@@ -214,0 +215,0 @@ } |
@@ -37,2 +37,3 @@ (function (global, factory) { | ||
var w = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
if (w === undefined) w = null; | ||
if (v !== w) { | ||
@@ -169,4 +170,2 @@ if (newChildren === children) newChildren = children.slice(0); | ||
var empty = /*#__PURE__*/React.createElement(React.Fragment); | ||
var FromClass = /*#__PURE__*/I.inherit(function FromClass(props) { | ||
@@ -208,7 +207,9 @@ React.Component.call(this, props); | ||
var v = args[i]; | ||
newArgs[i] = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
v = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v; | ||
if (v === undefined) v = null; | ||
newArgs[i] = v; | ||
} | ||
return React.createElement.apply(null, newArgs); | ||
} else { | ||
return empty; | ||
return null; | ||
} | ||
@@ -215,0 +216,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("infestines"),require("react"),require("kefir")):"function"==typeof define&&define.amd?define(["exports","infestines","react","kefir"],e):e(r.karet={},r.I,r.React,r.Kefir)}(this,function(r,e,n,t){"use strict";function i(r){var e=r._currentEvent;if(e)return e.value}function f(r){for(var n=r,t=0,a=r.length;t<a;++t){var o=r[t],u=U(o)?i(o):e.isArray(o)?f(o):o;o!==u&&(n===r&&(n=r.slice(0)),n[t]=u)}return n}function a(r){var e=null;for(var n in r){var t=r[n];if(U(t)){if(!e)for(var f in e={},r){if(f===n)break;e[f]=r[f]}e[n]=i(t)}else e&&(e[n]=t)}return e||r}function o(r,n,t,i){for(var f=n.length;r<f;++r){var a=n[r];U(a)?i(t,a):e.isArray(a)&&o(0,a,t,i)}}function u(r,n,t){for(var i in r){var f=r[i];if(U(f))t(n,f);else if(w===i)e.isArray(f)&&o(0,f,n,t);else if(k===i||E===i)for(var a in f){var u=f[a];U(u)&&t(n,u)}}}function l(r,e){e.offAny(r)}function s(r,e){e.onAny(r)}function c(r,e){var n=e.args,t=r.h;t||(t=r.h=function(e){var n=e.type;if(n===m)r.forceUpdate();else if(n===A)throw e.value}),u(n[1],t,s),o(2,n,t,s)}function v(r,e){var n=e.args,t=r.h;t&&(o(2,n,t,l),u(n[1],t,l))}function p(r,e){r.set(e,(r.get(e)||0)-1)}function h(r,e){r.set(e,(r.get(e)||0)+1)}function y(r,e,n){if(r<0)do{e.offAny(n.h)}while(++r);else if(0<r)do{e.onAny(n.h)}while(--r)}function d(r,n){for(var t=n.length;r<t;++r){var i=n[r];if(U(i)||e.isArray(i)&&d(0,i))return!0}return!1}function g(r){var t=r[1];if(function(r){for(var n in r){var t=r[n];if(U(t))return!0;if(w===n){if(e.isArray(t)&&d(0,t))return!0}else if(k===n||E===n)for(var i in t)if(U(t[i]))return!0}return!1}(t)||d(2,r)){var i={args:r};if(t){var f=t.key;null!=f&&(i.key=f)}return n.createElement(P,i)}return n.createElement.apply(null,r)}var m="value",A="error",k="style",E="dangerouslySetInnerHTML",w="children",U=function(r){return r instanceof t.Property},b="undefined"==typeof window?{h:null,forceUpdate:function(){}}:null,F=n.createElement(n.Fragment),P=e.inherit(function(r){n.Component.call(this,r),(this.h=b)&&(this.state=e.object0)},n.Component,{componentDidMount:function(){c(this,this.props)},componentDidUpdate:function(r){var e=r.args,n=this.props.args,t=new Map;t.h=this.h,u(e[1],t,p),o(2,e,t,p),u(n[1],t,h),o(2,n,t,h),t.forEach(y)},componentWillUnmount:function(){v(this,this.props)},render:function(){if(this.h){var r=this.props.args,t=r.length,o=Array(t);o[0]=r[0],o[1]=function(r){var n=null;for(var t in r){var o=r[t],u=U(o)?i(o):w===t?e.isArray(o)?f(o):o:k===t||E===t?a(o):o;if(o!==u){if(!n)for(var l in n={},r){if(l===t)break;n[l]=r[l]}n[t]=u}else n&&(n[t]=u)}return n||r}(r[1]);for(var u=2;u<t;++u){var l=r[u];o[u]=U(l)?i(l):e.isArray(l)?f(l):l}return n.createElement.apply(null,o)}return F}},b&&{getDerivedStateFromProps:function(r){return c(b,r),v(b,r),null}});r.Fragment=n.Fragment,r.createElement=function(r,t,i){var f=t&&t["karet-lift"];if(f||e.isString(r)||n.Fragment===r){var a=arguments.length,o=Array(a);o[0]=r,o[1]=f?e.dissocPartialU("karet-lift",t):t;for(var u=2;u<a;++u)o[u]=arguments[u];return g(o)}return n.createElement.apply(null,arguments)},r.fromClass=function(r){return n.forwardRef(function(n,t){return g([r,null==t?n:e.assocPartialU("ref",t,n)])})},Object.defineProperty(r,"__esModule",{value:!0})}); | ||
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("infestines"),require("react"),require("kefir")):"function"==typeof define&&define.amd?define(["exports","infestines","react","kefir"],n):n(r.karet={},r.I,r.React,r.Kefir)}(this,function(r,n,e,t){"use strict";function i(r){var n=r._currentEvent;if(n)return n.value}function f(r){for(var e=r,t=0,o=r.length;t<o;++t){var a=r[t],u=U(a)?i(a):n.isArray(a)?f(a):a;void 0===u&&(u=null),a!==u&&(e===r&&(e=r.slice(0)),e[t]=u)}return e}function o(r){var n=null;for(var e in r){var t=r[e];if(U(t)){if(!n)for(var f in n={},r){if(f===e)break;n[f]=r[f]}n[e]=i(t)}else n&&(n[e]=t)}return n||r}function a(r,e,t,i){for(var f=e.length;r<f;++r){var o=e[r];U(o)?i(t,o):n.isArray(o)&&a(0,o,t,i)}}function u(r,e,t){for(var i in r){var f=r[i];if(U(f))t(e,f);else if(E===i)n.isArray(f)&&a(0,f,e,t);else if(k===i||w===i)for(var o in f){var u=f[o];U(u)&&t(e,u)}}}function l(r,n){n.offAny(r)}function s(r,n){n.onAny(r)}function c(r,n){var e=n.args,t=r.h;t||(t=r.h=function(n){var e=n.type;if(e===m)r.forceUpdate();else if(e===A)throw n.value}),u(e[1],t,s),a(2,e,t,s)}function v(r,n){var e=n.args,t=r.h;t&&(a(2,e,t,l),u(e[1],t,l))}function p(r,n){r.set(n,(r.get(n)||0)-1)}function h(r,n){r.set(n,(r.get(n)||0)+1)}function d(r,n,e){if(r<0)do{n.offAny(e.h)}while(++r);else if(0<r)do{n.onAny(e.h)}while(--r)}function y(r,e){for(var t=e.length;r<t;++r){var i=e[r];if(U(i)||n.isArray(i)&&y(0,i))return!0}return!1}function g(r){var t=r[1];if(function(r){for(var e in r){var t=r[e];if(U(t))return!0;if(E===e){if(n.isArray(t)&&y(0,t))return!0}else if(k===e||w===e)for(var i in t)if(U(t[i]))return!0}return!1}(t)||y(2,r)){var i={args:r};if(t){var f=t.key;null!=f&&(i.key=f)}return e.createElement(P,i)}return e.createElement.apply(null,r)}var m="value",A="error",k="style",w="dangerouslySetInnerHTML",E="children",U=function(r){return r instanceof t.Property},b="undefined"==typeof window?{h:null,forceUpdate:function(){}}:null,P=n.inherit(function(r){e.Component.call(this,r),(this.h=b)&&(this.state=n.object0)},e.Component,{componentDidMount:function(){c(this,this.props)},componentDidUpdate:function(r){var n=r.args,e=this.props.args,t=new Map;t.h=this.h,u(n[1],t,p),a(2,n,t,p),u(e[1],t,h),a(2,e,t,h),t.forEach(d)},componentWillUnmount:function(){v(this,this.props)},render:function(){if(this.h){var r=this.props.args,t=r.length,a=Array(t);a[0]=r[0],a[1]=function(r){var e=null;for(var t in r){var a=r[t],u=U(a)?i(a):E===t?n.isArray(a)?f(a):a:k===t||w===t?o(a):a;if(a!==u){if(!e)for(var l in e={},r){if(l===t)break;e[l]=r[l]}e[t]=u}else e&&(e[t]=u)}return e||r}(r[1]);for(var u=2;u<t;++u){var l=r[u];void 0===(l=U(l)?i(l):n.isArray(l)?f(l):l)&&(l=null),a[u]=l}return e.createElement.apply(null,a)}return null}},b&&{getDerivedStateFromProps:function(r){return c(b,r),v(b,r),null}});r.Fragment=e.Fragment,r.createElement=function(r,t,i){var f=t&&t["karet-lift"];if(f||n.isString(r)||e.Fragment===r){var o=arguments.length,a=Array(o);a[0]=r,a[1]=f?n.dissocPartialU("karet-lift",t):t;for(var u=2;u<o;++u)a[u]=arguments[u];return g(a)}return e.createElement.apply(null,arguments)},r.fromClass=function(r){return e.forwardRef(function(e,t){return g([r,null==t?e:n.assocPartialU("ref",t,e)])})},Object.defineProperty(r,"__esModule",{value:!0})}); |
{ | ||
"name": "karet", | ||
"version": "3.2.1-0", | ||
"version": "3.2.1", | ||
"description": "Karet is a library that allows you to embed Kefir properties into React VDOM", | ||
@@ -5,0 +5,0 @@ "module": "dist/karet.es.js", |
@@ -32,3 +32,4 @@ import * as I from 'infestines' | ||
const v = children[i] | ||
const w = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v | ||
let w = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v | ||
if (w === undefined) w = null | ||
if (v !== w) { | ||
@@ -169,4 +170,2 @@ if (newChildren === children) newChildren = children.slice(0) | ||
const empty = React.createElement(React.Fragment) | ||
const FromClass = I.inherit( | ||
@@ -207,10 +206,10 @@ function FromClass(props) { | ||
for (let i = 2; i < n; ++i) { | ||
const v = args[i] | ||
newArgs[i] = isProperty(v) | ||
? valueOf(v) | ||
: I.isArray(v) ? renderChildren(v) : v | ||
let v = args[i] | ||
v = isProperty(v) ? valueOf(v) : I.isArray(v) ? renderChildren(v) : v | ||
if (v === undefined) v = null | ||
newArgs[i] = v | ||
} | ||
return React.createElement.apply(null, newArgs) | ||
} else { | ||
return empty | ||
return null | ||
} | ||
@@ -217,0 +216,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
113885
1527
1