New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

brahmos

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brahmos - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

.editorconfig

28

dist/brahmos.js
/**
* brahmos - 0.6.0
* brahmos - 0.7.1
* Author : s-yadav <sudhanshuyadav2@gmail.com>

@@ -1505,4 +1505,13 @@ * Copyright (c) 2016, 2019 to s-yadav <sudhanshuyadav2@gmail.com>, released under the MIT license.

};
// associate instance on node using last rendered node
associateInstance(node, target.__brahmosNode);
// pass the context as empty object
updater([part], [node], [], {}, true);
// store the node reference on target
target.__brahmosNode = node;
return node.componentInstance;
}

@@ -1534,6 +1543,4 @@

this.__batchStateChange().then(function (state) {
this$1.__updatesPromise = null;
reRender(this$1);
if (callback) { callback(state); }
this.__batchStateChange().then(function () {
if (callback) { callback(this$1.state); }
});

@@ -1545,4 +1552,11 @@ };

if (this.__updatesPromise) { return this.__updatesPromise; }
this.__updatesPromise = new Promise(function (resolve) {
resolve(this$1.state);
this.__updatesPromise = Promise.resolve().then(function () {
this$1.__updatesPromise = null;
/**
* reRender only if there are uncommitted state
* __unCommittedState state may have have been applied by
* force update or calling render method on parent node.
*/
if (this$1.__unCommittedState) { reRender(this$1); }
});

@@ -1549,0 +1563,0 @@ return this.__updatesPromise;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Brahmos={})}(this,function(e){"use strict";function v(e,t){var n=e;if(J(n)||Array.isArray(n)){var r=Array.isArray(n)?[]:{},o=t||r;if(Array.isArray(n))for(var i=n,a=function(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[z(o,n)]=o}return t}(o),u=0,s=i.length;u<s;u++){var c=i[u],f=a[z(c,u)];f&&v(c,f)}else if(n.__$isBrahmosTag$__){if(n.template!==o.template||n.element!==o.element)return;n.templateNode=o.templateNode,n.oldValues=o.values,o.isReused=!0;for(var p=0,l=n.values.length;p<l;p++){var d=o.values||[];v(n.values[p],d[p])}}else if(n.__$isBrahmosComponent$__){if(n.type!==o.type)return;n.componentInstance=o.componentInstance,o.isReused=!0}}}function t(r){function e(e){var t=e.ref,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["ref"]);return r(n,t)}return e.__isForwardRef=!0,e}function n(){return{current:null}}function N(e,t){var n=typeof e;"function"==n?e(t):"object"==n&&(e.current=t)}var c={doubleclick:"dblclick"},f=new WeakMap;function p(e){var t=e.type,n=K(e);return"input"!==n||"radio"!==t&&"checkbox"!==t?"input"===n||"select"===n||"textarea"===n?"value":void 0:"checked"}function l(e,t,n,r){var o=function(e){return 0===e.indexOf("on")}(t);if(t in e||o){var i=p(e);if(o){var a=function(e){return e.replace("on","").toLowerCase()}(t);a=function(e,t){var n=K(t);return c[e]?c[e]:"input"===n&&"change"===e?"input":e}(a,e);var u=function(t,n){var e=f.get(n);if(e)return e;function r(){var e=t.checkedProp;e!==t.checked&&(t.checked=e)}function o(){var e=t.valueProp;e!==t.value&&(t.value=e)}var i=p(t);return e=function(e){if("checked"===i)void 0!==t.checkedProp&&requestAnimationFrame(r);else if("value"===i){void 0!==t.valueProp&&requestAnimationFrame(o)}n&&n.call(this,e)},f.set(n,e),e}(e,n);if(r){var s=f.get(r)||r;e.removeEventListener(a,s)}e.addEventListener(a,u)}else i?function(e,t,n,r){"checked"===e?"checked"===n?(t.checked=r,t.checkedProp=r):"defaultChecked"===n&&void 0===t.checkedProp?t.checked=r:t[n]=r:"value"===e&&("value"===n?(t.value=r,t.valueProp=r):"defaultValue"===n&&void 0===t.valueProp?t.value=r:t[n]=r)}(i,e,t,n):e[t]=n}else e.setAttribute(t.toLowerCase(),n)}var h=/[<>"]/g,r=/(^|\s)([^\s"'=<]+)(?=[\s=>])/g,_="data-brahmos-attr",o="{{brahmos}}";function m(e){for(var t,n=[];null!==(t=r.exec(e));){t[2]&&n.push(t[2])}return n}function i(e){this.strings=e}i.prototype.create=function(){this.template||(this.partsMeta=this.getPartsMeta(),this.createTemplate())},i.prototype.getPartsMeta=function(){for(var e,t,n=this.strings,r=[],o=[],i=0,a=n.length;i<a;i++){for(var u=n[i],s=void 0,c=void 0,f=void 0,p=void 0,l=void 0;null!==(s=h.exec(u));)"<"!==s[0]||t?'"'===s[0]?t=!t:e&&">"===s[0]&&!t&&(e=!1,l=s.index):(e=!0,r=[],p=s.index,l=void 0);if(e){var d=u.substring(p||0,l||u.length);r.push.apply(r,m(d))}e?c=!0:f=!0,i<a-1&&o.push({tagAttrs:r,attrIndex:r.length,isAttribute:c,isNode:f})}return o},i.prototype.createTemplate=function(){for(var e=this.partsMeta,t=this.strings,n=document.createElement("template"),r="",o=0,i=t.length-1;o<i;o++){var a=t[o];r=e[o].isNode?r+a+"\x3c!--{{brahmos}}--\x3e":r+a+_}r+=t[t.length-1],n.innerHTML=r,this.template=n};var g=function(e){(this.templateResult=e).create(),this.fragment=this.createNode(),this.parts=this.getParts(),this.nodes=G(this.fragment.childNodes)};g.prototype.createNode=function(){var e=this.templateResult.template;return document.importNode(e.content,!0)},g.prototype.createWalker=function(e){return document.createTreeWalker(e,NodeFilter.SHOW_ALL,function(e){var t=e.nodeType;return 1===t||8===t?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},!1)},g.prototype.isBrahmosCommentNode=function(e){return e&&8===e.nodeType&&e.textContent===o},g.prototype.getParts=function(){for(var e=this.fragment,t=this.templateResult,n=this.isBrahmosCommentNode,r=t.partsMeta,o=this.createWalker(e),i=0,a=r[i],u=[],s=[],c=function(){a=r[++i]};o.nextNode();){var f=o.currentNode,p=f.nodeType,l=f.parentNode;if(1===p&&f.hasAttribute(_)){f.removeAttribute(_);for(var d=a.tagAttrs;a&&a.isAttribute&&a.tagAttrs===d;)u.push(Object.assign({},a,{node:f})),c()}else if(n(f)){var v=f.previousSibling,h=f.nextSibling;n(v)&&(v=oe(f)),n(h)&&(h=oe(f)),u.push(Object.assign({},a,{parentNode:l,previousSibling:v,nextSibling:h})),c(),s.push(f)}}return function(e){Array.isArray(e)||(e=[e]);for(var t=e.length-1;0<=t;t--){var n=e[t];n.parentNode.removeChild(n)}}(s),u},g.prototype.patchParts=function(e){var t=this.parts,n=e.parentNode,r=e.nextSibling,o=e.previousSibling;if(!this.patched){for(var i=0,a=t.length;i<a;i++){var u=t[i];u.isNode&&u.parentNode instanceof DocumentFragment&&(u.parentNode=n,u.nextSibling=u.nextSibling||r,u.previousSibling=u.previousSibling||o)}this.patched=!0}};var a,u=1;function s(t){return function(e){setTimeout(function(){t.context!==e&&(t.context=e,U(t))})}}function d(e){var t="cC"+u++,n=function(t){function e(e){t.call(this,e),this.subs=[]}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.shouldComponentUpdate=function(t){return this.props.value!==t.value&&this.subs.forEach(function(e){return e(t.value)}),!0},e.prototype.sub=function(e){var t=this.subs,n=s(e);t.push(n);var r=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(n),1),r&&r()}},e.prototype.render=function(){return this.props.children},e}(V);n.__ccId=t;var r=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.render=function(){return this.props.children(this.context)},t}(V),o={id:t,defaultValue:e,Provider:n,Consumer:r};return r.contextType=o}function y(e,t){if(!e||!t||e.length!==t.length)return!0;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!0;return!1}function b(e,t,n){Object.is(t,n)||U(e)}function C(e,t,n){void 0===t&&(t=function(e){return!1}),void 0===n&&(n=function(e){return e});var r=a.pointer,o=a.hooks,i=o[r];return i&&!t(i)||(i=e(),o[r]=i),a.pointer+=1,n(i)}function x(e){var r=a;return C(function(){var n=[e,function(e){var t=n[0];n[0]=e,b(r,e,t)}];return n})}function S(e){return C(function(){return{current:e}})}function $(o,e,t){var i=a;return C(function(){var r=[t?t(e):e,function(e){var t=r[0],n=o(t,e);r[0]=n,b(i,n,t)}];return r})}function k(e,t){return C(function(){return{value:e(),dependencies:t}},function(e){return y(t,e.dependencies)},function(e){return e.value})}function A(e,t){return k(function(){return e},t)}function B(e,t){var n=a.pointer,r=a.hooks,o=r[n]||{},i=Object.assign({},o,{isDependenciesChanged:y(t,o.dependencies),dependencies:t,effect:function(){i.isDependenciesChanged&&e(i)}});r[n]=i,a.pointer+=1}function P(t,e){B(function(e){cancelAnimationFrame(e.animationFrame),e.animationFrame=requestAnimationFrame(function(){setTimeout(function(){e.cleanEffect=t()})})},e)}function T(t,e){B(function(e){e.cleanEffect=t()},e)}function E(e){var t=e.id,n=e.defaultValue,r=a.__context[t],o=r?r.props.value:n;return T(function(){if(r){var e=r.subs,t=s(a);return e.push(t),function(){e.splice(e.indexOf(t),1)}}},[]),a.context=o}function F(e,t){for(var n=e.hooks,r=0,o=n.length;r<o;r++){var i=n[r];i.cleanEffect&&(i.isDependenciesChanged||t)&&i.cleanEffect()}}function O(n){return{hooks:[],__render:function(e){!function(e){(a=e).pointer=0,e.hooks=e.hooks||[]}(this);var t=n(e);return v(t,this.__nodes),this.__nodes=t}}}var j=[];function R(e,t,n,r,o){var i=t.type,a=t.props;void 0===a&&(a={});var u=t.__$isBrahmosClassComponent$__,s=t.ref,c=!1,f=!0,p=t.componentInstance;p||((p=u?new i(a):O(i)).__part=e,t.componentInstance=p,c=!0),r=function(e,t,n){var r=e.__ccId,o=t.__context;if(!r)return n;if(o)return o;var i=Object.create(n);return i[r]=t,i}(i,p,r),p.__context=r,p.__componentNode=t;var l,d=p.__unCommittedState,v=p.shouldComponentUpdate,h=p.props,_=p.state;if(u){var m=d||_;m=ne(m,re(i,"getDerivedStateFromProps",[a,m])),p instanceof q&&(f=m!==p.state||a!==p.props),v&&f&&!c&&(f=v.call(p,a,m));var g,y=i.contextType;if(y){var b=y.id,C=y.defaultValue,x=r[b];g=x?x.props.value:C,x&&c&&x.sub(p)}p.state=m,p.props=a,p.context=g,p.__unCommittedState=void 0,N(s,p),l=re(p,"getSnapshotBeforeUpdate",[h,_])}return f&&function t(n,r,o,i,a,u){var s=r.type,c=r.componentInstance,f=r.props,p=r.__$isBrahmosClassComponent$__,e=c.__render(f);a||p||F(c);try{c.__lastNode=D(n,e,null,o,i)}catch(e){if(!p||!u)throw e;var l=c.state,d=c.componentDidCatch,v=s.getDerivedStateFromError,h=re(s,"getDerivedStateFromError",[f,l]);if(h&&(l=ne(l,h),c.state=l,t(n,r,o,i,a,!1)),re(c,"componentDidCatch",[e]),!d&&!v)throw e}}(e,t,r,o,c,!0),u?c?function(e,t,n){j.push({object:e,method:t,args:n})}(p,"componentDidMount"):re(p,"componentDidUpdate",[h,_,l]):function(e){for(var t=e.hooks,n=0,r=t.length;n<r;n++){var o=t[n];o.effect&&o.effect()}}(p),p.__lastNode}function w(e,t){e&&e.isReused||(function(e){if(X(e)){var t=e.componentInstance,n=e.ref;if(e.__$isBrahmosClassComponent$__?(re(t,"componentWillUnmount"),N(n,null)):e.__$isBrahmosFunctionalComponent$__&&F(t,!0),Array.isArray(e))for(var r=0,o=e.length;r<o;r++)w(e[r]);else if(e.__$isBrahmosTag$__)for(var i=e.values,a=0,u=e.parts.length;a<u;a++){var s=s[a],c=i[a];s.isNode&&w(c),s.isAttribute&&Object.entries(c).forEach(function(e){var t=e[0],n=e[1];"ref"===t&&N(n,null)})}else e.__$isBrahmosComponent$__&&w(t.__nodes)}}(e),t&&Z(t.parentNode,t.previousSibling,t.nextSibling))}function I(e,t,n,r){for(var o,i,a=t[e];J(a)&&!a.isReused;)w(a,{parentNode:n,previousSibling:r,nextSibling:(o=a,i=void 0,o.__$isBrahmosTag$__?i=Y(o.templateNode.nodes):o.__$isBrahmosComponent$__&&(i=o.componentInstance.__lastNode),i&&i.nextSibling)}),t.splice(e,1),a=t[e];return a}function L(e,t,n,r,o){var i,a=e.parentNode,u=e.previousSibling,s=e.nextSibling,c=t.templateNode,f=t.values,p=t.oldValues,l=t.__$isBrahmosTagElement$__;c?c.patchParts(e):(i=!0,c=l?function(e){var t=e.element,n=e.values,r=document.createElement(t);return{fragment:r,nodes:[r],parts:[{isAttribute:!0,tagAttrs:[],attrIndex:0,node:r},{parentNode:r,isNode:!0}],values:n}}(t):new g(t.template),t.templateNode=c),M(c.parts,f,p,r),i&&(w(n,e),c.nodes=G(c.fragment.children),ee(a,s,c.fragment));var d=c.nodes[0],v=d&&d.previousSibling===u;return d&&o&&!v&&ee(a,s,c.nodes),Y(c.nodes)}function D(e,t,n,r,o){if(X(t)){if(Array.isArray(t))return function(e,t,n,r){void 0===n&&(n=[]);for(var o=e.parentNode,i=e.previousSibling,a=e.nextSibling,u=t.length,s=i,c=0;c<u;c++){var f=t[c],p=I(c,n,o,s),l=!(f&&p&&f.key===p.key);s=D({parentNode:o,previousSibling:s,nextSibling:s?s.nextSibling:o.firstChild,isNode:!0},f,p,r,l)}for(var d=u,v=n.length;d<v;d++)w(n[d]);return s&&Z(o,s,a),s}(e,t,n,r);if(t.__$isBrahmosComponent$__)return R(e,t,0,r,o);if(t.__$isBrahmosTag$__)return L(e,t,n,r,o);if(Q(t)&&t!==n)return function(e,t,n){var r=e.parentNode,o=e.previousSibling,i=e.nextSibling,a=te(r,o,i);return Q(n)?te(r,o,i).textContent=t:(void 0!==n&&w(n,e),a=ee(r,i,t)),a}(e,t,n)}else void 0!==n&&w(n,e)}function M(u,s,c,f,e){void 0===c&&(c=[]);for(var t=function(e,t){var o=u[e],n=s[e],i=c[e],r=o.isAttribute,a=o.isNode;r?Object.entries(n).forEach(function(e){var t=e[0],n=e[1],r=i&&i[t];!function(e,t,n,r){var o=e.node,i=e.tagAttrs,a=e.attrIndex;n===r||function(e,t,n){var r=e.lastIndexOf(t);return-1!==r&&r!==n}(i,t,a)||H[t]?"ref"===t&&N(n,o):l(o,t,n,r)}(o,t,n,r)}):a&&D(o,n,i,f)},n=0,r=u.length;n<r;n++)t(n);e&&function(){for(var e=0,t=j.length;e<t;e++){var n=j[e];re(n.object,n.method,n.args)}j=[]}()}function W(e,t){M([{parentNode:t,isNode:!0}],[e],[],{},!0)}function U(e){M([e.__part],[e.__componentNode],[],e.__context,!0)}var V=function(e){this.props=e};V.prototype.setState=function(e,t){var n=this,r=this.__unCommittedState||this.state||{};r=ne(r,"function"==typeof e?e(r):e),this.__unCommittedState=r,this.__batchStateChange().then(function(e){n.__updatesPromise=null,U(n),t&&t(e)})},V.prototype.__batchStateChange=function(){var t=this;return this.__updatesPromise||(this.__updatesPromise=new Promise(function(e){e(t.state)})),this.__updatesPromise},V.prototype.__render=function(){var e=this.render();return v(e,this.__nodes),this.__nodes=e};var q=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(V),H={key:1,ref:1};function K(e){return e.nodeName.toLowerCase()}function z(e,t){var n=e&&e.key;if(void 0===n&&e&&e.__$isBrahmosTag$__){for(var r=e.values,o=0,i=r.length;o<i;o++){var a=r[o];if(void 0!==a.key){n=a.key;break}}e.key=n}return(void 0!==n?n:t).toString()}function G(e){return Array.prototype.slice.call(e)}function J(e){return e&&(e.__$isBrahmosComponent$__||e.__$isBrahmosTag$__)}function Q(e){return"string"==typeof e||"number"==typeof e}function X(e){return Q(e)||J(e)||Array.isArray(e)}function Y(e){return Array.isArray(e)?e[e.length-1]:e}function Z(e,t,n){var r;if(t||n)for(r=t?t.nextSibling:e.firstChild;r&&r!==n;){var o=r.nextSibling;e.removeChild(r),r=o}else e.innerHTML=""}function ee(e,t,n){void 0===t&&(t=null);var r=function(e){if(e instanceof Node)return e;if(Array.isArray(e)||e instanceof NodeList){for(var t=document.createDocumentFragment(),n=0,r=e.length;n<r;n++)t.appendChild(e[n]);return t}return document.createTextNode(e.toString())}(n),o=r instanceof DocumentFragment?G(r.childNodes):r;return e.insertBefore(r,t),o}function te(e,t,n){return t?t.nextSibling:n?n.previousSibling:e.firstChild}function ne(e,t){return t&&"object"==typeof t&&(e=Object.assign({},e,t)),e}function re(e,t,n){if(e[t])return e[t].apply(e,n)}function oe(e){var t=e.parentNode,n=document.createTextNode("");return t.insertBefore(n,e),n}function ie(e,t,n){if("string"==typeof e)return function(e,t,n){return{element:e,values:[t,n],__$isBrahmosTag$__:!0,__$isBrahmosTagElement$__:!0}}(e,t,n);var r=function(e,t){for(var n={},r=Object.keys(e),o=0,i=r.length;o<i;o++){var a=r[o];t[a]||(n[a]=e[a])}return n}(t,{key:1,ref:!e.__isForwardRef});r.children=n;var o=t.key,i=t.ref,a=function(e){return e.prototype instanceof V}(e);return{type:e,props:r,key:o,ref:a?i:null,children:n,__$isBrahmosComponent$__:!0,__$isBrahmosClassComponent$__:a,__$isBrahmosFunctionalComponent$__:!a}}var ae=new WeakMap;function ue(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];var r=ae.get(e);return r||(r=new i(e),ae.set(e,r)),function(){return{template:r,values:t,__$isBrahmosTag$__:!0}}}var se={createElement:ie,render:W,Component:V,PureComponent:q,html:ue,useState:x,useEffect:P,useRef:S,useReducer:$,useMemo:k,useCallback:A,useLayoutEffect:T,useContext:E,createContext:d,forwardRef:t,createRef:n};e.Component=V,e.PureComponent=q,e.createContext=d,e.createElement=ie,e.createRef=n,e.default=se,e.forwardRef=t,e.html=ue,e.render=W,e.useCallback=A,e.useContext=E,e.useEffect=P,e.useLayoutEffect=T,e.useMemo=k,e.useReducer=$,e.useRef=S,e.useState=x,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Brahmos={})}(this,function(e){"use strict";function v(e,t){var n=e;if(J(n)||Array.isArray(n)){var r=Array.isArray(n)?[]:{},o=t||r;if(Array.isArray(n))for(var i=n,a=function(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[z(o,n)]=o}return t}(o),u=0,s=i.length;u<s;u++){var c=i[u],f=a[z(c,u)];f&&v(c,f)}else if(n.__$isBrahmosTag$__){if(n.template!==o.template||n.element!==o.element)return;n.templateNode=o.templateNode,n.oldValues=o.values,o.isReused=!0;for(var p=0,l=n.values.length;p<l;p++){var d=o.values||[];v(n.values[p],d[p])}}else if(n.__$isBrahmosComponent$__){if(n.type!==o.type)return;n.componentInstance=o.componentInstance,o.isReused=!0}}}function t(r){function e(e){var t=e.ref,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["ref"]);return r(n,t)}return e.__isForwardRef=!0,e}function n(){return{current:null}}function N(e,t){var n=typeof e;"function"==n?e(t):"object"==n&&(e.current=t)}var c={doubleclick:"dblclick"},f=new WeakMap;function p(e){var t=e.type,n=K(e);return"input"!==n||"radio"!==t&&"checkbox"!==t?"input"===n||"select"===n||"textarea"===n?"value":void 0:"checked"}function l(e,t,n,r){var o=function(e){return 0===e.indexOf("on")}(t);if(t in e||o){var i=p(e);if(o){var a=function(e){return e.replace("on","").toLowerCase()}(t);a=function(e,t){var n=K(t);return c[e]?c[e]:"input"===n&&"change"===e?"input":e}(a,e);var u=function(t,n){var e=f.get(n);if(e)return e;function r(){var e=t.checkedProp;e!==t.checked&&(t.checked=e)}function o(){var e=t.valueProp;e!==t.value&&(t.value=e)}var i=p(t);return e=function(e){if("checked"===i)void 0!==t.checkedProp&&requestAnimationFrame(r);else if("value"===i){void 0!==t.valueProp&&requestAnimationFrame(o)}n&&n.call(this,e)},f.set(n,e),e}(e,n);if(r){var s=f.get(r)||r;e.removeEventListener(a,s)}e.addEventListener(a,u)}else i?function(e,t,n,r){"checked"===e?"checked"===n?(t.checked=r,t.checkedProp=r):"defaultChecked"===n&&void 0===t.checkedProp?t.checked=r:t[n]=r:"value"===e&&("value"===n?(t.value=r,t.valueProp=r):"defaultValue"===n&&void 0===t.valueProp?t.value=r:t[n]=r)}(i,e,t,n):e[t]=n}else e.setAttribute(t.toLowerCase(),n)}var h=/[<>"]/g,r=/(^|\s)([^\s"'=<]+)(?=[\s=>])/g,_="data-brahmos-attr",o="{{brahmos}}";function m(e){for(var t,n=[];null!==(t=r.exec(e));){t[2]&&n.push(t[2])}return n}function i(e){this.strings=e}i.prototype.create=function(){this.template||(this.partsMeta=this.getPartsMeta(),this.createTemplate())},i.prototype.getPartsMeta=function(){for(var e,t,n=this.strings,r=[],o=[],i=0,a=n.length;i<a;i++){for(var u=n[i],s=void 0,c=void 0,f=void 0,p=void 0,l=void 0;null!==(s=h.exec(u));)"<"!==s[0]||t?'"'===s[0]?t=!t:e&&">"===s[0]&&!t&&(e=!1,l=s.index):(e=!0,r=[],p=s.index,l=void 0);if(e){var d=u.substring(p||0,l||u.length);r.push.apply(r,m(d))}e?c=!0:f=!0,i<a-1&&o.push({tagAttrs:r,attrIndex:r.length,isAttribute:c,isNode:f})}return o},i.prototype.createTemplate=function(){for(var e=this.partsMeta,t=this.strings,n=document.createElement("template"),r="",o=0,i=t.length-1;o<i;o++){var a=t[o];r=e[o].isNode?r+a+"\x3c!--{{brahmos}}--\x3e":r+a+_}r+=t[t.length-1],n.innerHTML=r,this.template=n};var g=function(e){(this.templateResult=e).create(),this.fragment=this.createNode(),this.parts=this.getParts(),this.nodes=G(this.fragment.childNodes)};g.prototype.createNode=function(){var e=this.templateResult.template;return document.importNode(e.content,!0)},g.prototype.createWalker=function(e){return document.createTreeWalker(e,NodeFilter.SHOW_ALL,function(e){var t=e.nodeType;return 1===t||8===t?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},!1)},g.prototype.isBrahmosCommentNode=function(e){return e&&8===e.nodeType&&e.textContent===o},g.prototype.getParts=function(){for(var e=this.fragment,t=this.templateResult,n=this.isBrahmosCommentNode,r=t.partsMeta,o=this.createWalker(e),i=0,a=r[i],u=[],s=[],c=function(){a=r[++i]};o.nextNode();){var f=o.currentNode,p=f.nodeType,l=f.parentNode;if(1===p&&f.hasAttribute(_)){f.removeAttribute(_);for(var d=a.tagAttrs;a&&a.isAttribute&&a.tagAttrs===d;)u.push(Object.assign({},a,{node:f})),c()}else if(n(f)){var v=f.previousSibling,h=f.nextSibling;n(v)&&(v=oe(f)),n(h)&&(h=oe(f)),u.push(Object.assign({},a,{parentNode:l,previousSibling:v,nextSibling:h})),c(),s.push(f)}}return function(e){Array.isArray(e)||(e=[e]);for(var t=e.length-1;0<=t;t--){var n=e[t];n.parentNode.removeChild(n)}}(s),u},g.prototype.patchParts=function(e){var t=this.parts,n=e.parentNode,r=e.nextSibling,o=e.previousSibling;if(!this.patched){for(var i=0,a=t.length;i<a;i++){var u=t[i];u.isNode&&u.parentNode instanceof DocumentFragment&&(u.parentNode=n,u.nextSibling=u.nextSibling||r,u.previousSibling=u.previousSibling||o)}this.patched=!0}};var a,u=1;function s(t){return function(e){setTimeout(function(){t.context!==e&&(t.context=e,U(t))})}}function d(e){var t="cC"+u++,n=function(t){function e(e){t.call(this,e),this.subs=[]}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.shouldComponentUpdate=function(t){return this.props.value!==t.value&&this.subs.forEach(function(e){return e(t.value)}),!0},e.prototype.sub=function(e){var t=this.subs,n=s(e);t.push(n);var r=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(n),1),r&&r()}},e.prototype.render=function(){return this.props.children},e}(V);n.__ccId=t;var r=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.render=function(){return this.props.children(this.context)},t}(V),o={id:t,defaultValue:e,Provider:n,Consumer:r};return r.contextType=o}function y(e,t){if(!e||!t||e.length!==t.length)return!0;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!0;return!1}function b(e,t,n){Object.is(t,n)||U(e)}function C(e,t,n){void 0===t&&(t=function(e){return!1}),void 0===n&&(n=function(e){return e});var r=a.pointer,o=a.hooks,i=o[r];return i&&!t(i)||(i=e(),o[r]=i),a.pointer+=1,n(i)}function x(e){var r=a;return C(function(){var n=[e,function(e){var t=n[0];n[0]=e,b(r,e,t)}];return n})}function S(e){return C(function(){return{current:e}})}function $(o,e,t){var i=a;return C(function(){var r=[t?t(e):e,function(e){var t=r[0],n=o(t,e);r[0]=n,b(i,n,t)}];return r})}function k(e,t){return C(function(){return{value:e(),dependencies:t}},function(e){return y(t,e.dependencies)},function(e){return e.value})}function A(e,t){return k(function(){return e},t)}function B(e,t){var n=a.pointer,r=a.hooks,o=r[n]||{},i=Object.assign({},o,{isDependenciesChanged:y(t,o.dependencies),dependencies:t,effect:function(){i.isDependenciesChanged&&e(i)}});r[n]=i,a.pointer+=1}function P(t,e){B(function(e){cancelAnimationFrame(e.animationFrame),e.animationFrame=requestAnimationFrame(function(){setTimeout(function(){e.cleanEffect=t()})})},e)}function T(t,e){B(function(e){e.cleanEffect=t()},e)}function E(e){var t=e.id,n=e.defaultValue,r=a.__context[t],o=r?r.props.value:n;return T(function(){if(r){var e=r.subs,t=s(a);return e.push(t),function(){e.splice(e.indexOf(t),1)}}},[]),a.context=o}function F(e,t){for(var n=e.hooks,r=0,o=n.length;r<o;r++){var i=n[r];i.cleanEffect&&(i.isDependenciesChanged||t)&&i.cleanEffect()}}function O(n){return{hooks:[],__render:function(e){!function(e){(a=e).pointer=0,e.hooks=e.hooks||[]}(this);var t=n(e);return v(t,this.__nodes),this.__nodes=t}}}var j=[];function R(e,t,n,r,o){var i=t.type,a=t.props;void 0===a&&(a={});var u=t.__$isBrahmosClassComponent$__,s=t.ref,c=!1,f=!0,p=t.componentInstance;p||((p=u?new i(a):O(i)).__part=e,t.componentInstance=p,c=!0),r=function(e,t,n){var r=e.__ccId,o=t.__context;if(!r)return n;if(o)return o;var i=Object.create(n);return i[r]=t,i}(i,p,r),p.__context=r,p.__componentNode=t;var l,d=p.__unCommittedState,v=p.shouldComponentUpdate,h=p.props,_=p.state;if(u){var m=d||_;m=ne(m,re(i,"getDerivedStateFromProps",[a,m])),p instanceof q&&(f=m!==p.state||a!==p.props),v&&f&&!c&&(f=v.call(p,a,m));var g,y=i.contextType;if(y){var b=y.id,C=y.defaultValue,x=r[b];g=x?x.props.value:C,x&&c&&x.sub(p)}p.state=m,p.props=a,p.context=g,p.__unCommittedState=void 0,N(s,p),l=re(p,"getSnapshotBeforeUpdate",[h,_])}return f&&function t(n,r,o,i,a,u){var s=r.type,c=r.componentInstance,f=r.props,p=r.__$isBrahmosClassComponent$__,e=c.__render(f);a||p||F(c);try{c.__lastNode=D(n,e,null,o,i)}catch(e){if(!p||!u)throw e;var l=c.state,d=c.componentDidCatch,v=s.getDerivedStateFromError,h=re(s,"getDerivedStateFromError",[f,l]);if(h&&(l=ne(l,h),c.state=l,t(n,r,o,i,a,!1)),re(c,"componentDidCatch",[e]),!d&&!v)throw e}}(e,t,r,o,c,!0),u?c?function(e,t,n){j.push({object:e,method:t,args:n})}(p,"componentDidMount"):re(p,"componentDidUpdate",[h,_,l]):function(e){for(var t=e.hooks,n=0,r=t.length;n<r;n++){var o=t[n];o.effect&&o.effect()}}(p),p.__lastNode}function I(e,t){e&&e.isReused||(function(e){if(X(e)){var t=e.componentInstance,n=e.ref;if(e.__$isBrahmosClassComponent$__?(re(t,"componentWillUnmount"),N(n,null)):e.__$isBrahmosFunctionalComponent$__&&F(t,!0),Array.isArray(e))for(var r=0,o=e.length;r<o;r++)I(e[r]);else if(e.__$isBrahmosTag$__)for(var i=e.values,a=0,u=e.parts.length;a<u;a++){var s=s[a],c=i[a];s.isNode&&I(c),s.isAttribute&&Object.entries(c).forEach(function(e){var t=e[0],n=e[1];"ref"===t&&N(n,null)})}else e.__$isBrahmosComponent$__&&I(t.__nodes)}}(e),t&&Z(t.parentNode,t.previousSibling,t.nextSibling))}function w(e,t,n,r){for(var o,i,a=t[e];J(a)&&!a.isReused;)I(a,{parentNode:n,previousSibling:r,nextSibling:(o=a,i=void 0,o.__$isBrahmosTag$__?i=Y(o.templateNode.nodes):o.__$isBrahmosComponent$__&&(i=o.componentInstance.__lastNode),i&&i.nextSibling)}),t.splice(e,1),a=t[e];return a}function L(e,t,n,r,o){var i,a=e.parentNode,u=e.previousSibling,s=e.nextSibling,c=t.templateNode,f=t.values,p=t.oldValues,l=t.__$isBrahmosTagElement$__;c?c.patchParts(e):(i=!0,c=l?function(e){var t=e.element,n=e.values,r=document.createElement(t);return{fragment:r,nodes:[r],parts:[{isAttribute:!0,tagAttrs:[],attrIndex:0,node:r},{parentNode:r,isNode:!0}],values:n}}(t):new g(t.template),t.templateNode=c),M(c.parts,f,p,r),i&&(I(n,e),c.nodes=G(c.fragment.children),ee(a,s,c.fragment));var d=c.nodes[0],v=d&&d.previousSibling===u;return d&&o&&!v&&ee(a,s,c.nodes),Y(c.nodes)}function D(e,t,n,r,o){if(X(t)){if(Array.isArray(t))return function(e,t,n,r){void 0===n&&(n=[]);for(var o=e.parentNode,i=e.previousSibling,a=e.nextSibling,u=t.length,s=i,c=0;c<u;c++){var f=t[c],p=w(c,n,o,s),l=!(f&&p&&f.key===p.key);s=D({parentNode:o,previousSibling:s,nextSibling:s?s.nextSibling:o.firstChild,isNode:!0},f,p,r,l)}for(var d=u,v=n.length;d<v;d++)I(n[d]);return s&&Z(o,s,a),s}(e,t,n,r);if(t.__$isBrahmosComponent$__)return R(e,t,0,r,o);if(t.__$isBrahmosTag$__)return L(e,t,n,r,o);if(Q(t)&&t!==n)return function(e,t,n){var r=e.parentNode,o=e.previousSibling,i=e.nextSibling,a=te(r,o,i);return Q(n)?te(r,o,i).textContent=t:(void 0!==n&&I(n,e),a=ee(r,i,t)),a}(e,t,n)}else void 0!==n&&I(n,e)}function M(u,s,c,f,e){void 0===c&&(c=[]);for(var t=function(e,t){var o=u[e],n=s[e],i=c[e],r=o.isAttribute,a=o.isNode;r?Object.entries(n).forEach(function(e){var t=e[0],n=e[1],r=i&&i[t];!function(e,t,n,r){var o=e.node,i=e.tagAttrs,a=e.attrIndex;n===r||function(e,t,n){var r=e.lastIndexOf(t);return-1!==r&&r!==n}(i,t,a)||H[t]?"ref"===t&&N(n,o):l(o,t,n,r)}(o,t,n,r)}):a&&D(o,n,i,f)},n=0,r=u.length;n<r;n++)t(n);e&&function(){for(var e=0,t=j.length;e<t;e++){var n=j[e];re(n.object,n.method,n.args)}j=[]}()}function W(e,t){var n={parentNode:t,isNode:!0};return v(e,t.__brahmosNode),M([n],[e],[],{},!0),(t.__brahmosNode=e).componentInstance}function U(e){M([e.__part],[e.__componentNode],[],e.__context,!0)}var V=function(e){this.props=e};V.prototype.setState=function(e,t){var n=this,r=this.__unCommittedState||this.state||{};r=ne(r,"function"==typeof e?e(r):e),this.__unCommittedState=r,this.__batchStateChange().then(function(){t&&t(n.state)})},V.prototype.__batchStateChange=function(){var e=this;return this.__updatesPromise||(this.__updatesPromise=Promise.resolve().then(function(){e.__updatesPromise=null,e.__unCommittedState&&U(e)})),this.__updatesPromise},V.prototype.__render=function(){var e=this.render();return v(e,this.__nodes),this.__nodes=e};var q=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(V),H={key:1,ref:1};function K(e){return e.nodeName.toLowerCase()}function z(e,t){var n=e&&e.key;if(void 0===n&&e&&e.__$isBrahmosTag$__){for(var r=e.values,o=0,i=r.length;o<i;o++){var a=r[o];if(void 0!==a.key){n=a.key;break}}e.key=n}return(void 0!==n?n:t).toString()}function G(e){return Array.prototype.slice.call(e)}function J(e){return e&&(e.__$isBrahmosComponent$__||e.__$isBrahmosTag$__)}function Q(e){return"string"==typeof e||"number"==typeof e}function X(e){return Q(e)||J(e)||Array.isArray(e)}function Y(e){return Array.isArray(e)?e[e.length-1]:e}function Z(e,t,n){var r;if(t||n)for(r=t?t.nextSibling:e.firstChild;r&&r!==n;){var o=r.nextSibling;e.removeChild(r),r=o}else e.innerHTML=""}function ee(e,t,n){void 0===t&&(t=null);var r=function(e){if(e instanceof Node)return e;if(Array.isArray(e)||e instanceof NodeList){for(var t=document.createDocumentFragment(),n=0,r=e.length;n<r;n++)t.appendChild(e[n]);return t}return document.createTextNode(e.toString())}(n),o=r instanceof DocumentFragment?G(r.childNodes):r;return e.insertBefore(r,t),o}function te(e,t,n){return t?t.nextSibling:n?n.previousSibling:e.firstChild}function ne(e,t){return t&&"object"==typeof t&&(e=Object.assign({},e,t)),e}function re(e,t,n){if(e[t])return e[t].apply(e,n)}function oe(e){var t=e.parentNode,n=document.createTextNode("");return t.insertBefore(n,e),n}function ie(e,t,n){if("string"==typeof e)return function(e,t,n){return{element:e,values:[t,n],__$isBrahmosTag$__:!0,__$isBrahmosTagElement$__:!0}}(e,t,n);var r=function(e,t){for(var n={},r=Object.keys(e),o=0,i=r.length;o<i;o++){var a=r[o];t[a]||(n[a]=e[a])}return n}(t,{key:1,ref:!e.__isForwardRef});r.children=n;var o=t.key,i=t.ref,a=function(e){return e.prototype instanceof V}(e);return{type:e,props:r,key:o,ref:a?i:null,children:n,__$isBrahmosComponent$__:!0,__$isBrahmosClassComponent$__:a,__$isBrahmosFunctionalComponent$__:!a}}var ae=new WeakMap;function ue(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];var r=ae.get(e);return r||(r=new i(e),ae.set(e,r)),function(){return{template:r,values:t,__$isBrahmosTag$__:!0}}}var se={createElement:ie,render:W,Component:V,PureComponent:q,html:ue,useState:x,useEffect:P,useRef:S,useReducer:$,useMemo:k,useCallback:A,useLayoutEffect:T,useContext:E,createContext:d,forwardRef:t,createRef:n};e.Component=V,e.PureComponent=q,e.createContext=d,e.createElement=ie,e.createRef=n,e.default=se,e.forwardRef=t,e.html=ue,e.render=W,e.useCallback=A,e.useContext=E,e.useEffect=P,e.useLayoutEffect=T,e.useMemo=k,e.useReducer=$,e.useRef=S,e.useState=x,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "brahmos",
"version": "0.7.0",
"version": "0.7.1",
"description": "Super charged UI library with modern React API and native templates.",

@@ -10,2 +10,5 @@ "main": "dist/brahmos.js",

"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --runInBand --watch",
"start": "webpack-dev-server --open",

@@ -35,5 +38,6 @@ "build": "babel src --out-dir lib",

"cross-env": "^5.2.0",
"eslint": "^5.9.0",
"eslint": "^6.0.1",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^22.7.1",
"eslint-plugin-node": "^8.0.0",

@@ -43,2 +47,3 @@ "eslint-plugin-promise": "^4.0.1",

"html-webpack-plugin": "^3.2.0",
"jest": "^24.8.0",
"rollup": "^1.12.3",

@@ -45,0 +50,0 @@ "rollup-plugin-buble": "^0.19.6",

@@ -110,3 +110,3 @@ <p align="center">

- [x] Context API
- [x] Ref Api, createRef, ref as callback, forwardRef
- [x] Refs Api, createRef, ref as callback, forwardRef
- [ ] React Utilities and Methods

@@ -113,0 +113,0 @@ - [ ] SVG Support

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