Socket
Socket
Sign inDemoInstall

@sidiousvic/phantom

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sidiousvic/phantom - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

7

CHANGELOG.md

@@ -9,6 +9,10 @@ # Changelog

## [v2.1.1] — 2020.07.20
- [x] Fixed exporting/importing bug.
## [v2.1.0] — 2020.07.20
- [x] Using `rollup` for builds.
- [x] Package exports type definitions
- [x] Package exports type definitions.
- [x] [Added tsc types test](./spec/types.test.ts)

@@ -62,2 +66,3 @@

[unreleased]: https://github.com/sidiousvic/phantom/compare/v2.1.0...HEAD
[v2.1.1]: https://github.com/sidiousvic/phantom/compare/v2.1.0...v2.1.1
[v2.1.0]: https://github.com/sidiousvic/phantom/compare/v2.0.0...v2.1.0

@@ -64,0 +69,0 @@ [v2.0.0]: https://github.com/sidiousvic/phantom/compare/v1.7.7...v2.0.0

43

dist/phantom.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.Phantom = factory());
}(this, (function () { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.Phantom = {}));
}(this, (function (exports) { 'use strict';
function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
/*

@@ -451,8 +436,22 @@ phantomExorciser tag, attrribute, and CSS allowlists

// functions
function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
PHANTOM.createPhantomStore = createPhantomStore;
exports.createPhantomStore = createPhantomStore;
exports.default = PHANTOM;
return PHANTOM;
Object.defineProperty(exports, '__esModule', { value: true });
})));

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Phantom=t()}(this,(function(){"use strict";function e(e){return e}const t={abbr:e,accept:e,"accept-charset":e,accesskey:e,action:e,align:e,alt:e,autocomplete:e,autosave:e,axis:e,bgcolor:e,border:e,cellpadding:e,cellspacing:e,challenge:e,char:e,charoff:e,charset:e,checked:e,cite:e,class:e,clear:e,color:e,cols:e,colspan:e,compact:e,contenteditable:e,coords:e,datetime:e,dir:e,disabled:e,draggable:e,dropzone:e,enctype:e,for:e,frame:e,headers:e,height:e,high:e,href:e,hreflang:e,hspace:e,ismap:e,id:e,keytype:e,label:e,lang:e,list:e,longdesc:e,low:e,max:e,maxlength:e,media:e,method:e,min:e,multiple:e,name:e,nohref:e,noshade:e,novalidate:e,nowrap:e,open:e,optimum:e,pattern:e,placeholder:e,prompt:e,pubdate:e,radiogroup:e,readonly:e,rel:e,required:e,rev:e,reversed:e,rows:e,rowspan:e,rules:e,scope:e,selected:e,shape:e,size:e,span:e,spellcheck:e,src:e,start:e,step:e,style:e,summary:e,tabindex:e,target:e,title:e,type:e,usemap:e,valign:e,value:e,vspace:e,width:e,wrap:e},r={a:t,abbr:t,acronym:t,address:t,area:t,article:t,aside:t,b:t,bdi:t,big:t,blockquote:t,br:t,button:t,caption:t,center:t,cite:t,code:t,col:t,colgroup:t,data:t,datalist:t,dd:t,del:t,details:t,dfn:t,dir:t,div:t,dl:t,dt:t,em:t,fieldset:t,figcaption:t,figure:t,font:t,footer:t,form:t,h1:t,h2:t,h3:t,h4:t,h5:t,h6:t,header:t,hr:t,i:t,img:t,input:t,ins:t,kbd:t,keygen:t,label:t,legend:t,li:t,main:t,map:t,mark:t,menu:t,menuitem:t,meter:t,nav:t,ol:t,optgroup:t,option:t,output:t,p:t,pre:t,progress:t,q:t,rp:t,rt:t,ruby:t,s:t,samp:t,section:t,select:t,small:t,span:t,strike:t,strong:t,sub:t,summary:t,sup:t,table:t,tbody:t,td:t,textarea:t,tfoot:t,th:t,thead:t,time:t,tr:t,tt:t,u:t,ul:t,var:t,wbr:t},o=["background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","caption-side","clear","clip","color","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","float","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","height","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","opacity","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","quotes","right","table-layout","text-align","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-indent","text-transform","top","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-spacing","z-index"];function i(e){const t=document.implementation.createHTMLDocument().createElement("div");return t.innerHTML=e,function e(t){var i;const n=document.implementation.createHTMLDocument(),a=t.nodeName.toLowerCase();if("#text"==a)return t;if("#comment"==a)return n.createTextNode("");if(!r.hasOwnProperty(a))throw Error(a);const d=n.createElement(a);for(let e=0;t.attributes.length>e;e++){const o=null===(i=t.attributes.item(e))||void 0===i?void 0:i.name;if(r[a].hasOwnProperty(o)){d.setAttribute(o,(0,r[a][o])(t.getAttribute(o)))}}for(let e in o)d.style[Number(o[e])]=t.style[Number(o[e])];for(;t.childNodes.length>0;){const r=t.removeChild(t.childNodes[0]);d.appendChild(e(r))}return d}(t).innerHTML}function n(e,t){let r={test:{tagName:"div",attributes:{id:"PHANTOM"},children:[],innerHTML:"",dataset:{}}};function o(e=function e(t){"string"!=typeof t&&(t=t.outerHTML);t=t.replace(/>,/g,">");const r=(new DOMParser).parseFromString(t,"text/html").body.firstChild,{tagName:o,children:i,id:n,dataset:a,classList:d,innerHTML:s,outerHTML:l}=r;let c=[];i&&i.length&&(c=Array.prototype.map.call(i,t=>e(t)));return{tagName:o,attributes:{id:n,class:d},dataset:a,children:c,innerHTML:s,outerHTML:l}}(function(){return`\n <div id="PHANTOM">\n ${t()}\n </div> \n `}())){const{tagName:a,attributes:d,innerHTML:s,children:l}=e;let c,u=[];l&&l.length&&(u=Array.prototype.map.call(l,e=>{o(e)})),Object.values(r).map(t=>{if(t.attributes.id===e.attributes.id&&JSON.stringify(t.dataset)!==JSON.stringify(e.dataset)){let e=document.createElement(a);for(const[t,r]of Object.entries(d))e.setAttribute(t,r);try{e.innerHTML=i(s),n(e,document.getElementById(d.id)),c=e}catch(e){throw Error(e)}}}),r[d.id]=e,c=document.createElement(a);for(const[e,t]of Object.entries(d))c.setAttribute(e,t);try{return c.innerHTML=i(s),c}catch(e){throw Error(e)}}function n(e,t){return null==t||t.replaceWith(e),e}return e.subscribe(()=>{o()}),{fire:e.fire,data:e.data,appear:function(){const e=document.body;if(!document.querySelector("#PHANTOM")){const t=document.createElement("div");t.id="PHANTOM",null==e||e.appendChild(t)}try{const e=o();return n(e,document.querySelector("#PHANTOM")),e}catch(e){throw new DOMException(`🚫Potentially dangerous node, <${e}>. Phantom has destroyed it. If you think this is a mistake, please raise an issue at: https://github.com/sidiousvic/phantom/issues`)}}}}return n.createPhantomStore=function(e){let t=e(void 0,{});const r=[];return{data:()=>t,fire:o=>{t=e(t,o),r.forEach(e=>e())},subscribe:e=>{r.push(e)}}},n}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Phantom={})}(this,(function(e){"use strict";function t(e){return e}const r={abbr:t,accept:t,"accept-charset":t,accesskey:t,action:t,align:t,alt:t,autocomplete:t,autosave:t,axis:t,bgcolor:t,border:t,cellpadding:t,cellspacing:t,challenge:t,char:t,charoff:t,charset:t,checked:t,cite:t,class:t,clear:t,color:t,cols:t,colspan:t,compact:t,contenteditable:t,coords:t,datetime:t,dir:t,disabled:t,draggable:t,dropzone:t,enctype:t,for:t,frame:t,headers:t,height:t,high:t,href:t,hreflang:t,hspace:t,ismap:t,id:t,keytype:t,label:t,lang:t,list:t,longdesc:t,low:t,max:t,maxlength:t,media:t,method:t,min:t,multiple:t,name:t,nohref:t,noshade:t,novalidate:t,nowrap:t,open:t,optimum:t,pattern:t,placeholder:t,prompt:t,pubdate:t,radiogroup:t,readonly:t,rel:t,required:t,rev:t,reversed:t,rows:t,rowspan:t,rules:t,scope:t,selected:t,shape:t,size:t,span:t,spellcheck:t,src:t,start:t,step:t,style:t,summary:t,tabindex:t,target:t,title:t,type:t,usemap:t,valign:t,value:t,vspace:t,width:t,wrap:t},o={a:r,abbr:r,acronym:r,address:r,area:r,article:r,aside:r,b:r,bdi:r,big:r,blockquote:r,br:r,button:r,caption:r,center:r,cite:r,code:r,col:r,colgroup:r,data:r,datalist:r,dd:r,del:r,details:r,dfn:r,dir:r,div:r,dl:r,dt:r,em:r,fieldset:r,figcaption:r,figure:r,font:r,footer:r,form:r,h1:r,h2:r,h3:r,h4:r,h5:r,h6:r,header:r,hr:r,i:r,img:r,input:r,ins:r,kbd:r,keygen:r,label:r,legend:r,li:r,main:r,map:r,mark:r,menu:r,menuitem:r,meter:r,nav:r,ol:r,optgroup:r,option:r,output:r,p:r,pre:r,progress:r,q:r,rp:r,rt:r,ruby:r,s:r,samp:r,section:r,select:r,small:r,span:r,strike:r,strong:r,sub:r,summary:r,sup:r,table:r,tbody:r,td:r,textarea:r,tfoot:r,th:r,thead:r,time:r,tr:r,tt:r,u:r,ul:r,var:r,wbr:r},i=["background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","caption-side","clear","clip","color","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","float","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","height","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","opacity","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","quotes","right","table-layout","text-align","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-indent","text-transform","top","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-spacing","z-index"];function n(e){const t=document.implementation.createHTMLDocument().createElement("div");return t.innerHTML=e,function e(t){var r;const n=document.implementation.createHTMLDocument(),a=t.nodeName.toLowerCase();if("#text"==a)return t;if("#comment"==a)return n.createTextNode("");if(!o.hasOwnProperty(a))throw Error(a);const d=n.createElement(a);for(let e=0;t.attributes.length>e;e++){const i=null===(r=t.attributes.item(e))||void 0===r?void 0:r.name;if(o[a].hasOwnProperty(i)){d.setAttribute(i,(0,o[a][i])(t.getAttribute(i)))}}for(let e in i)d.style[Number(i[e])]=t.style[Number(i[e])];for(;t.childNodes.length>0;){const r=t.removeChild(t.childNodes[0]);d.appendChild(e(r))}return d}(t).innerHTML}e.createPhantomStore=function(e){let t=e(void 0,{});const r=[];return{data:()=>t,fire:o=>{t=e(t,o),r.forEach(e=>e())},subscribe:e=>{r.push(e)}}},e.default=function(e,t){let r={test:{tagName:"div",attributes:{id:"PHANTOM"},children:[],innerHTML:"",dataset:{}}};function o(e=function e(t){"string"!=typeof t&&(t=t.outerHTML);t=t.replace(/>,/g,">");const r=(new DOMParser).parseFromString(t,"text/html").body.firstChild,{tagName:o,children:i,id:n,dataset:a,classList:d,innerHTML:s,outerHTML:l}=r;let c=[];i&&i.length&&(c=Array.prototype.map.call(i,t=>e(t)));return{tagName:o,attributes:{id:n,class:d},dataset:a,children:c,innerHTML:s,outerHTML:l}}(function(){return`\n <div id="PHANTOM">\n ${t()}\n </div> \n `}())){const{tagName:a,attributes:d,innerHTML:s,children:l}=e;let c,u=[];l&&l.length&&(u=Array.prototype.map.call(l,e=>{o(e)})),Object.values(r).map(t=>{if(t.attributes.id===e.attributes.id&&JSON.stringify(t.dataset)!==JSON.stringify(e.dataset)){let e=document.createElement(a);for(const[t,r]of Object.entries(d))e.setAttribute(t,r);try{e.innerHTML=n(s),i(e,document.getElementById(d.id)),c=e}catch(e){throw Error(e)}}}),r[d.id]=e,c=document.createElement(a);for(const[e,t]of Object.entries(d))c.setAttribute(e,t);try{return c.innerHTML=n(s),c}catch(e){throw Error(e)}}function i(e,t){return null==t||t.replaceWith(e),e}return e.subscribe(()=>{o()}),{fire:e.fire,data:e.data,appear:function(){const e=document.body;if(!document.querySelector("#PHANTOM")){const t=document.createElement("div");t.id="PHANTOM",null==e||e.appendChild(t)}try{const e=o();return i(e,document.querySelector("#PHANTOM")),e}catch(e){throw new DOMException(`🚫Potentially dangerous node, <${e}>. Phantom has destroyed it. If you think this is a mistake, please raise an issue at: https://github.com/sidiousvic/phantom/issues`)}}}},Object.defineProperty(e,"__esModule",{value:!0})}));

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

function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
/*

@@ -445,6 +430,18 @@ phantomExorciser tag, attrribute, and CSS allowlists

// functions
function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
PHANTOM.createPhantomStore = createPhantomStore;
export default PHANTOM;
export { createPhantomStore };
'use strict';
function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
Object.defineProperty(exports, '__esModule', { value: true });

@@ -447,6 +434,18 @@ /*

// functions
function createPhantomStore(reducer) {
let state = reducer(undefined, {});
const subscriptions = [];
return {
data: () => state,
fire: action => {
state = reducer(state, action);
subscriptions.forEach(subscription => subscription());
},
subscribe: subscription => {
subscriptions.push(subscription);
}
};
}
PHANTOM.createPhantomStore = createPhantomStore;
module.exports = PHANTOM;
exports.createPhantomStore = createPhantomStore;
exports.default = PHANTOM;
{
"name": "@sidiousvic/phantom",
"version": "2.1.0",
"version": "2.1.1",
"description": "A state—reactive DOM rendering engine for building UIs. 👻",

@@ -5,0 +5,0 @@ "main": "lib/phantom.js",

@@ -1,5 +0,3 @@

// functions
import phantom from "./phantom";
import createPhantomStore from "./createPhantomStore";
import phantom from "./phantom";
// types

@@ -17,4 +15,3 @@ export {

// API exports
phantom.createPhantomStore = createPhantomStore;
export { createPhantomStore };
export default phantom;
import phantom from "./phantom";
import createPhantomStore from "./createPhantomStore";
export { PhantomElement, PhantomDOMFunction, PhantomDOM, } from "./types/phantomDOM";
export { PhantomAction, PhantomReducer, Subscription, } from "./types/phantomStore";
export { createPhantomStore };
export default phantom;

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