Socket
Socket
Sign inDemoInstall

uhooks-dom

Package Overview
Dependencies
5
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.2.2

6

async.js

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

self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,c)=>{const o=new WeakMap,a=new WeakMap,r=new WeakMap,l=e=>o.has(e),u=e=>{l(e)&&(i(e,e.removeEventListener,o.get(e)),o.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:c}=e,o=0;o<c;o++)d(e[o],t,n,s)},d=(e,s,c,o)=>{l(e)&&!c.has(e)&&(o.delete(e),c.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,c,o)},p=new(c||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",r,a),h(s,"connected",a,r)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:l,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),o.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var c=Promise;let o=null,a=new Set;const r=new WeakMap,l=e=>{const{$:t,r:n,h:s}=e;v(n)&&(i.get(s).delete(e),n()),v(e.r=t())&&i.get(s).add(e)},u=()=>{const e=a;a=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},i=new WeakMap,h=[],d=[];function p(e,t){return e!==this[t]}const f=()=>r.get(o),v=e=>"function"==typeof e,w=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return r.set(n,t),n;function n(){const s=o;o=n,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{o=s,h.length&&y.then(h.forEach.bind(h.splice(0),l)),d.length&&d.splice(0).forEach(l)}}},y=new c((e=>e()));function g(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const E=(e,t)=>{const n=f(),{i:s,s:c}=n;return s!==c.length&&t&&!t.some(p,c[s]._)||(c[s]={$:e(),_:t}),c[n.i++].$},k=e=>(t,n)=>{const s=f(),{i:c,s:o,h:a}=s,r=c===o.length;s.i++,r&&(i.has(a)||i.set(a,new Set),o[c]={$:t,_:n,r:null,h:a}),(r||!n||n.some(p,o[c]._))&&e.push(o[c]),o[c].$=t,o[c]._=n},M=k(h),m=k(d),_=(e,t)=>v(t)?t(e):t,b=(e,t,n)=>{const s=f(),{i:c,s:o}=s;c===o.length&&o.push({$:v(n)?n(t):_(void 0,t),set:t=>{o[c].$=e(o[c].$,t),(e=>{a.has(e)||(e.e=1,a.add(e),y.then(u))})(s)}});const{$:r,set:l}=o[s.i++];return[r,l]},$=new WeakMap,W=e=>(e=>{const t=i.get(e);t&&y.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))})($.get(e)),S=e=>(e=>i.has(e))($.get(e)),C=e=>{const t=w(e);return $.set(n,t),n;async function n(){return await t.apply(this,arguments)}};
self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,c)=>{const o=new WeakMap,a=new WeakMap,r=new WeakMap,l=e=>o.has(e),u=e=>{l(e)&&(i(e,e.removeEventListener,o.get(e)),o.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:c}=e,o=0;o<c;o++)d(e[o],t,n,s)},d=(e,s,c,o)=>{l(e)&&!c.has(e)&&(o.delete(e),c.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,c,o)},p=new(c||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",r,a),h(s,"connected",a,r)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:l,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),o.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var c=Promise;let o=null,a=new Set;const r=e=>{const{$:t,r:n,h:s}=e;f(n)&&(u.get(s).delete(e),n()),f(e.r=t())&&u.get(s).add(e)},l=()=>{const e=a;a=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},u=new WeakMap,i=[],h=[];function d(e,t){return e!==this[t]}const p=()=>o,f=e=>"function"==typeof e,v=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return n;function n(){const n=o;o=t,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{o=n,i.length&&w.then(i.forEach.bind(i.splice(0),r)),h.length&&h.splice(0).forEach(r)}}},w=new c((e=>e()));function y(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const g=(e,t)=>{const n=p(),{i:s,s:c}=n;return s!==c.length&&t&&!t.some(d,c[s]._)||(c[s]={$:e(),_:t}),c[n.i++].$},E=e=>(t,n)=>{const s=p(),{i:c,s:o,h:a}=s,r=c===o.length;s.i++,r&&(u.has(a)||u.set(a,new Set),o[c]={$:t,_:n,r:null,h:a}),(r||!n||n.some(d,o[c]._))&&e.push(o[c]),o[c].$=t,o[c]._=n},k=E(i),m=E(h),M=(e,t)=>f(t)?t(e):t,_=(e,t,n)=>{const s=p(),{i:c,s:o}=s;c===o.length&&o.push({$:f(n)?n(t):M(void 0,t),set:t=>{o[c].$=e(o[c].$,t),(e=>{a.has(e)||(e.e=1,a.add(e),w.then(l))})(s)}});const{$:r,set:u}=o[s.i++];return[r,u]},b=new WeakMap,$=e=>(e=>{const t=u.get(e);t&&w.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))})(b.get(e)),S=e=>(e=>u.has(e))(b.get(e)),W=e=>{const t=v(e);return b.set(n,t),n;async function n(){return await t.apply(this,arguments)}};
/*! (c) Andrea Giammarchi - ISC */
let L=null,O=null,x=null;const D=new WeakMap,N=new WeakMap,P=(e,t,n,s)=>{const c=c=>{D.has(e)||(D.set(e,0),y.then((()=>{D.delete(e),e.apply(t,n)}))),s(c)};return N.set(s,c),c},R=(e,t,n,s)=>e?[s[0],N.get(s[1])||P(e,t,n,s[1])]:s,T=(e,t)=>{const n=C(t?async function(){const[t,s,c]=[L,O,x];[L,O,x]=[n,this,arguments];try{return await e.apply(O,x)}finally{[L,O,x]=[t,s,c]}}:e);return n};
let C=null,L=null,O=null;const x=new WeakMap,D=new WeakMap,N=(e,t,n,s)=>{const c=c=>{x.has(e)||(x.set(e,0),w.then((()=>{x.delete(e),e.apply(t,n)}))),s(c)};return D.set(s,c),c},P=(e,t,n,s)=>e?[s[0],D.get(s[1])||N(e,t,n,s[1])]:s,R=(e,t)=>{const n=W(t?async function(){const[t,s,c]=[C,L,O];[C,L,O]=[n,this,arguments];try{return await e.apply(L,O)}finally{[C,L,O]=[t,s,c]}}:e);return n};
/*! (c) Andrea Giammarchi - ISC */
let j=null;const q=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},z=e=>{const{nodeType:t}=e;if(t)return 1===t?e:q(e);{const t=e.valueOf();return t!==e?z(t):q(t)}};return e.createContext=e=>({_:new Set,provide:g,value:e}),e.hooked=(e,s)=>{const c=T(e,s);return async function(){const e=await c.apply(this,arguments);if(S(c)){const s=z(e);j||(j=n(s.ownerDocument,"children",t)),j.has(s)||j.connect(s,{disconnected(){W(c)}})}return e}},e.useCallback=(e,t)=>E((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(f()),t),e.useEffect=M,e.useLayoutEffect=m,e.useMemo=E,e.useReducer=(e,t,n)=>R(L,O,x,b(e,t,n)),e.useRef=e=>{const t=f(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>R(L,O,x,(e=>b(_,e))(e)),e.wait=y,e}({});
let T=null;const j=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},q=e=>{const{nodeType:t}=e;if(t)return 1===t?e:j(e);{const t=e.valueOf();return t!==e?q(t):j(t)}};return e.createContext=e=>({_:new Set,provide:y,value:e}),e.hooked=(e,s)=>{const c=R(e,s);return async function(){const e=await c.apply(this,arguments);if(S(c)){const s=q(e);T||(T=n(s.ownerDocument,"children",t)),T.has(s)||T.connect(s,{disconnected(){$(c)}})}return e}},e.useCallback=(e,t)=>g((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(p()),t),e.useEffect=k,e.useLayoutEffect=m,e.useMemo=g,e.useReducer=(e,t,n)=>P(C,L,O,_(e,t,n)),e.useRef=e=>{const t=p(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>P(C,L,O,(e=>_(M,e))(e)),e.wait=w,e}({});

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

self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,o)=>{const c=new WeakMap,r=new WeakMap,l=new WeakMap,a=e=>c.has(e),u=e=>{a(e)&&(i(e,e.removeEventListener,c.get(e)),c.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:o}=e,c=0;c<o;c++)d(e[c],t,n,s)},d=(e,s,o,c)=>{a(e)&&!o.has(e)&&(c.delete(e),o.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,o,c)},p=new(o||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",l,r),h(s,"connected",r,l)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:a,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),c.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var o=Promise;let c=null,r=new Set;const l=new WeakMap,a=e=>{const{$:t,r:n,h:s}=e;y(n)&&(i.get(s).delete(e),n()),y(e.r=t())&&i.get(s).add(e)},u=()=>{const e=r;r=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},i=new WeakMap,h=[],d=[];function p(e,t){return e!==this[t]}const f=e=>{const t=i.get(e);t&&E.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},v=()=>l.get(c),w=e=>i.has(e),y=e=>"function"==typeof e,g=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return l.set(n,t),n;function n(){const s=c;c=n,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{c=s,h.length&&E.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},E=new o((e=>e()));function k(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const m=(e,t)=>{const n=v(),{i:s,s:o}=n;return s!==o.length&&t&&!t.some(p,o[s]._)||(o[s]={$:e(),_:t}),o[n.i++].$},M=e=>(t,n)=>{const s=v(),{i:o,s:c,h:r}=s,l=o===c.length;s.i++,l&&(i.has(r)||i.set(r,new Set),c[o]={$:t,_:n,r:null,h:r}),(l||!n||n.some(p,c[o]._))&&e.push(c[o]),c[o].$=t,c[o]._=n},_=M(h),b=M(d),$=(e,t)=>y(t)?t(e):t,S=(e,t,n)=>{const s=v(),{i:o,s:c}=s;o===c.length&&c.push({$:y(n)?n(t):$(void 0,t),set:t=>{c[o].$=e(c[o].$,t),(e=>{r.has(e)||(e.e=1,r.add(e),E.then(u))})(s)}});const{$:l,set:a}=c[s.i++];return[l,a]};
self.uhooksDOM=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,o)=>{const c=new WeakMap,r=new WeakMap,l=new WeakMap,a=e=>c.has(e),u=e=>{a(e)&&(i(e,e.removeEventListener,c.get(e)),c.delete(e))},i=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,s)=>{for(let{length:o}=e,c=0;c<o;c++)d(e[c],t,n,s)},d=(e,s,o,c)=>{a(e)&&!o.has(e)&&(c.delete(e),o.set(e,0),e.dispatchEvent(new(n||CustomEvent)(s))),h(e[t||"children"]||[],s,o,c)},p=new(o||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:s}=e[n];h(t,"disconnected",l,r),h(s,"connected",r,l)}}));return p.observe(e||document,{subtree:!0,childList:!0}),{has:a,connect:(e,t)=>{u(e),(t||(t={})).handleEvent||(t.handleEvent=s),i(e,e.addEventListener,t),c.set(e,t)},disconnect:u,kill(){p.disconnect()}}};function s(e){e.type in this&&this[e.type](e)}var o=Promise;let c=null,r=new Set;const l=e=>{const{$:t,r:n,h:s}=e;w(n)&&(u.get(s).delete(e),n()),w(e.r=t())&&u.get(s).add(e)},a=()=>{const e=r;r=new Set,e.forEach((({h:e,c:t,a:n,e:s})=>{s&&e.apply(t,n)}))},u=new WeakMap,i=[],h=[];function d(e,t){return e!==this[t]}const p=e=>{const t=u.get(e);t&&E.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},f=()=>c,v=e=>u.has(e),w=e=>"function"==typeof e,y=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return n;function n(){const n=c;c=t,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{c=n,i.length&&E.then(i.forEach.bind(i.splice(0),l)),h.length&&h.splice(0).forEach(l)}}},E=new o((e=>e()));function g(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach((({h:e,c:t,a:n})=>{e.apply(t,n)})))}const m=(e,t)=>{const n=f(),{i:s,s:o}=n;return s!==o.length&&t&&!t.some(d,o[s]._)||(o[s]={$:e(),_:t}),o[n.i++].$},_=e=>(t,n)=>{const s=f(),{i:o,s:c,h:r}=s,l=o===c.length;s.i++,l&&(u.has(r)||u.set(r,new Set),c[o]={$:t,_:n,r:null,h:r}),(l||!n||n.some(d,c[o]._))&&e.push(c[o]),c[o].$=t,c[o]._=n},k=_(i),M=_(h),b=(e,t)=>w(t)?t(e):t,$=(e,t,n)=>{const s=f(),{i:o,s:c}=s;o===c.length&&c.push({$:w(n)?n(t):b(void 0,t),set:t=>{c[o].$=e(c[o].$,t),(e=>{r.has(e)||(e.e=1,r.add(e),E.then(a))})(s)}});const{$:l,set:u}=c[s.i++];return[l,u]};
/*! (c) Andrea Giammarchi - ISC */
let W=null,C=null,L=null;const O=new WeakMap,x=new WeakMap,D=(e,t,n,s)=>{const o=o=>{O.has(e)||(O.set(e,0),E.then((()=>{O.delete(e),e.apply(t,n)}))),s(o)};return x.set(s,o),o},N=(e,t,n,s)=>e?[s[0],x.get(s[1])||D(e,t,n,s[1])]:s,P=(e,t)=>{const n=g(t?function(){const[t,s,o]=[W,C,L];[W,C,L]=[n,this,arguments];try{return e.apply(C,L)}finally{[W,C,L]=[t,s,o]}}:e);return n};
let S=null,C=null,W=null;const L=new WeakMap,O=new WeakMap,x=(e,t,n,s)=>{const o=o=>{L.has(e)||(L.set(e,0),E.then((()=>{L.delete(e),e.apply(t,n)}))),s(o)};return O.set(s,o),o},D=(e,t,n,s)=>e?[s[0],O.get(s[1])||x(e,t,n,s[1])]:s,N=(e,t)=>{const n=y(t?function(){const[t,s,o]=[S,C,W];[S,C,W]=[n,this,arguments];try{return e.apply(C,W)}finally{[S,C,W]=[t,s,o]}}:e);return n};
/*! (c) Andrea Giammarchi - ISC */
let R=null;const T=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},j=e=>{const{nodeType:t}=e;if(t)return 1===t?e:T(e);{const t=e.valueOf();return t!==e?j(t):T(t)}};return e.createContext=e=>({_:new Set,provide:k,value:e}),e.hooked=(e,s)=>{const o=P(e,s);return function(){const e=o.apply(this,arguments);if(w(o)){const s=j(e);R||(R=n(s.ownerDocument,"children",t)),R.has(s)||R.connect(s,{disconnected(){f(o)}})}return e}},e.useCallback=(e,t)=>m((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(v()),t),e.useEffect=_,e.useLayoutEffect=b,e.useMemo=m,e.useReducer=(e,t,n)=>N(W,C,L,S(e,t,n)),e.useRef=e=>{const t=v(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>N(W,C,L,(e=>S($,e))(e)),e.wait=E,e}({});
let P=null;const R=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},T=e=>{const{nodeType:t}=e;if(t)return 1===t?e:R(e);{const t=e.valueOf();return t!==e?T(t):R(t)}};return e.createContext=e=>({_:new Set,provide:g,value:e}),e.hooked=(e,s)=>{const o=N(e,s);return function(){const e=o.apply(this,arguments);if(v(o)){const s=T(e);P||(P=n(s.ownerDocument,"children",t)),P.has(s)||P.connect(s,{disconnected(){p(o)}})}return e}},e.useCallback=(e,t)=>m((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(f()),t),e.useEffect=k,e.useLayoutEffect=M,e.useMemo=m,e.useReducer=(e,t,n)=>D(S,C,W,$(e,t,n)),e.useRef=e=>{const t=f(),{i:n,s:s}=t;return n===s.length&&s.push({current:e}),s[t.i++]},e.useState=e=>D(S,C,W,(e=>$(b,e))(e)),e.wait=E,e}({});

@@ -130,5 +130,4 @@ self.uhooksDOM = (function (exports) {

var h = null,
var info = null,
schedule = new Set();
var hooks = new WeakMap();

@@ -179,3 +178,3 @@ var invoke = function invoke(effect) {

var getInfo = function getInfo() {
return hooks.get(h);
return info;
};

@@ -189,3 +188,3 @@ var hasEffect = function hasEffect(hook) {

var hooked = function hooked(callback) {
var info = {
var current = {
h: hook,

@@ -198,14 +197,13 @@ c: null,

};
hooks.set(hook, info);
return hook;
function hook() {
var p = h;
h = hook;
info.e = info.i = 0;
var prev = info;
info = current;
current.e = current.i = 0;
try {
return callback.apply(info.c = this, info.a = arguments);
return callback.apply(current.c = this, current.a = arguments);
} finally {
h = p;
info = prev;
if (effects.length) wait.then(effects.forEach.bind(effects.splice(0), invoke));

@@ -339,3 +337,3 @@ if (layoutEffects.length) layoutEffects.splice(0).forEach(invoke);

/*! (c) Andrea Giammarchi - ISC */
var h$1 = null,
var h = null,
c = null,

@@ -371,6 +369,6 @@ a = null;

function () {
var ph = h$1,
var ph = h,
pc = c,
pa = a;
h$1 = hook;
h = hook;
c = this;

@@ -385,3 +383,3 @@ a = arguments;

} finally {
h$1 = ph;
h = ph;
c = pc;

@@ -394,6 +392,6 @@ a = pa;

var useReducer$1 = function useReducer$1(reducer, value, init) {
return wrap(h$1, c, a, useReducer(reducer, value, init));
return wrap(h, c, a, useReducer(reducer, value, init));
};
var useState$1 = function useState$1(value) {
return wrap(h$1, c, a, useState(value));
return wrap(h, c, a, useState(value));
};

@@ -400,0 +398,0 @@

self.uhooksDOM=function(n){"use strict";
/*! (c) Andrea Giammarchi - ISC */var e={};e.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(n){return e[n]=new e("").constructor[n],e;function e(n,e){e||(e={});var t=document.createEvent("CustomEvent");return t.initCustomEvent(n,!!e.bubbles,!!e.cancelable,e.detail),t}}("prototype");var t=e.CustomEvent,r=function(n,e,t,r){var o=new WeakMap,i=new WeakMap,c=new WeakMap,a=function(n){return o.has(n)},f=function(n){a(n)&&(s(n,n.removeEventListener,o.get(n)),o.delete(n))},s=function(n,e,t){e.call(n,"disconnected",t),e.call(n,"connected",t)},l=function(n,e,t,r){for(var u=n.length,o=0;o<u;o++)v(n[o],e,t,r)},v=function(n,r,u,o){a(n)&&!u.has(n)&&(o.delete(n),u.set(n,0),n.dispatchEvent(new(t||CustomEvent)(r))),l(n[e||"children"]||[],r,u,o)},h=new(r||MutationObserver)((function(n){for(var e=n.length,t=0;t<e;t++){var r=n[t],u=r.removedNodes,o=r.addedNodes;l(u,"disconnected",c,i),l(o,"connected",i,c)}}));return h.observe(n||document,{subtree:!0,childList:!0}),{has:a,connect:function(n,e){f(n),(e||(e={})).handleEvent||(e.handleEvent=u),s(n,n.addEventListener,e),o.set(n,e)},disconnect:f,kill:function(){h.disconnect()}}};function u(n){n.type in this&&this[n.type](n)}var o="function"==typeof Promise?Promise:function(n){var e,t=[],r=0;return n((function(n){e=n,r=1,t.splice(0).forEach(u)})),{then:u};function u(n){return r?setTimeout(n,0,e):t.push(n),this}},i=null,c=new Set,a=new WeakMap,f=function(n){var e=n.$,t=n.r,r=n.h;w(t)&&(l.get(r).delete(n),t()),w(n.r=e())&&l.get(r).add(n)},s=function(){var n=c;c=new Set,n.forEach((function(n){var e=n.h,t=n.c,r=n.a;n.e&&e.apply(t,r)}))},l=new WeakMap,v=[],h=[];function d(n,e){return n!==this[e]}var p=function(n){var e=l.get(n);e&&y.then((function(){e.forEach((function(n){n.r(),n.r=null})),e.clear()}))},E=function(){return a.get(i)},m=function(n){return l.has(n)},w=function(n){return"function"==typeof n},y=new o((function(n){return n()}));function g(n){var e=this._;this.value!==n&&(this._=new Set,this.value=n,e.forEach((function(n){var e=n.h,t=n.c,r=n.a;e.apply(t,r)})))}var b=function(n,e){var t=E(),r=t.i,u=t.s;return r!==u.length&&e&&!e.some(d,u[r]._)||(u[r]={$:n(),_:e}),u[t.i++].$},k=function(n){return function(e,t){var r=E(),u=r.i,o=r.s,i=r.h,c=u===o.length;r.i++,c&&(l.has(i)||l.set(i,new Set),o[u]={$:e,_:t,r:null,h:i}),(c||!t||t.some(d,o[u]._))&&n.push(o[u]),o[u].$=e,o[u]._=t}},C=k(v),M=k(h),$=function(n,e){return w(e)?e(n):e},_=function(n,e,t){var r=E(),u=r.i,o=r.s;u===o.length&&o.push({$:w(t)?t(e):$(void 0,e),set:function(e){o[u].$=n(o[u].$,e),function(n){c.has(n)||(n.e=1,c.add(n),y.then(s))}(r)}});var i=o[r.i++];return[i.$,i.set]},S=null,W=null,L=null,x=new WeakMap,O=new WeakMap,T=function(n,e,t,r){var u=function(u){x.has(n)||(x.set(n,0),y.then((function(){x.delete(n),n.apply(e,t)}))),r(u)};return O.set(r,u),u},D=function(n,e,t,r){return n?[r[0],O.get(r[1])||T(n,e,t,r[1])]:r},N=function(n,e){var t=function(n){var e={h:t,c:null,a:null,e:0,i:0,s:[]};return a.set(t,e),t;function t(){var r=i;i=t,e.e=e.i=0;try{return n.apply(e.c=this,e.a=arguments)}finally{i=r,v.length&&y.then(v.forEach.bind(v.splice(0),f)),h.length&&h.splice(0).forEach(f)}}}(e?function(){var e=S,r=W,u=L;S=t,W=this,L=arguments;try{return n.apply(W,L)}finally{S=e,W=r,L=u}}:n);return t},P=null,R=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},j=function n(e){var t=e.nodeType;if(t)return 1===t?e:R(e);var r=e.valueOf();return r!==e?n(r):R(r)};return n.createContext=function(n){return{_:new Set,provide:g,value:n}},n.hooked=function(n,e){var u=N(n,e);return function(){var n=u.apply(this,arguments);if(m(u)){var e=j(n);P||(P=r(e.ownerDocument,"children",t)),P.has(e)||P.connect(e,{disconnected:function(){p(u)}})}return n}},n.useCallback=function(n,e){return b((function(){return n}),e)},n.useContext=function(n){var e=n._,t=n.value;return e.add(E()),t},n.useEffect=C,n.useLayoutEffect=M,n.useMemo=b,n.useReducer=function(n,e,t){return D(S,W,L,_(n,e,t))},n.useRef=function(n){var e=E(),t=e.i,r=e.s;return t===r.length&&r.push({current:n}),r[e.i++]},n.useState=function(n){return D(S,W,L,function(n){return _($,n)}(n))},n.wait=y,n}({});
/*! (c) Andrea Giammarchi - ISC */var e={};e.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(n){return e[n]=new e("").constructor[n],e;function e(n,e){e||(e={});var t=document.createEvent("CustomEvent");return t.initCustomEvent(n,!!e.bubbles,!!e.cancelable,e.detail),t}}("prototype");var t=e.CustomEvent,r=function(n,e,t,r){var o=new WeakMap,i=new WeakMap,c=new WeakMap,a=function(n){return o.has(n)},f=function(n){a(n)&&(s(n,n.removeEventListener,o.get(n)),o.delete(n))},s=function(n,e,t){e.call(n,"disconnected",t),e.call(n,"connected",t)},l=function(n,e,t,r){for(var u=n.length,o=0;o<u;o++)v(n[o],e,t,r)},v=function(n,r,u,o){a(n)&&!u.has(n)&&(o.delete(n),u.set(n,0),n.dispatchEvent(new(t||CustomEvent)(r))),l(n[e||"children"]||[],r,u,o)},h=new(r||MutationObserver)((function(n){for(var e=n.length,t=0;t<e;t++){var r=n[t],u=r.removedNodes,o=r.addedNodes;l(u,"disconnected",c,i),l(o,"connected",i,c)}}));return h.observe(n||document,{subtree:!0,childList:!0}),{has:a,connect:function(n,e){f(n),(e||(e={})).handleEvent||(e.handleEvent=u),s(n,n.addEventListener,e),o.set(n,e)},disconnect:f,kill:function(){h.disconnect()}}};function u(n){n.type in this&&this[n.type](n)}var o="function"==typeof Promise?Promise:function(n){var e,t=[],r=0;return n((function(n){e=n,r=1,t.splice(0).forEach(u)})),{then:u};function u(n){return r?setTimeout(n,0,e):t.push(n),this}},i=null,c=new Set,a=function(n){var e=n.$,t=n.r,r=n.h;m(t)&&(s.get(r).delete(n),t()),m(n.r=e())&&s.get(r).add(n)},f=function(){var n=c;c=new Set,n.forEach((function(n){var e=n.h,t=n.c,r=n.a;n.e&&e.apply(t,r)}))},s=new WeakMap,l=[],v=[];function h(n,e){return n!==this[e]}var d=function(n){var e=s.get(n);e&&y.then((function(){e.forEach((function(n){n.r(),n.r=null})),e.clear()}))},p=function(){return i},E=function(n){return s.has(n)},m=function(n){return"function"==typeof n},y=new o((function(n){return n()}));function w(n){var e=this._;this.value!==n&&(this._=new Set,this.value=n,e.forEach((function(n){var e=n.h,t=n.c,r=n.a;e.apply(t,r)})))}var g=function(n,e){var t=p(),r=t.i,u=t.s;return r!==u.length&&e&&!e.some(h,u[r]._)||(u[r]={$:n(),_:e}),u[t.i++].$},b=function(n){return function(e,t){var r=p(),u=r.i,o=r.s,i=r.h,c=u===o.length;r.i++,c&&(s.has(i)||s.set(i,new Set),o[u]={$:e,_:t,r:null,h:i}),(c||!t||t.some(h,o[u]._))&&n.push(o[u]),o[u].$=e,o[u]._=t}},C=b(l),k=b(v),M=function(n,e){return m(e)?e(n):e},$=function(n,e,t){var r=p(),u=r.i,o=r.s;u===o.length&&o.push({$:m(t)?t(e):M(void 0,e),set:function(e){o[u].$=n(o[u].$,e),function(n){c.has(n)||(n.e=1,c.add(n),y.then(f))}(r)}});var i=o[r.i++];return[i.$,i.set]},_=null,S=null,W=null,L=new WeakMap,x=new WeakMap,O=function(n,e,t,r){var u=function(u){L.has(n)||(L.set(n,0),y.then((function(){L.delete(n),n.apply(e,t)}))),r(u)};return x.set(r,u),u},T=function(n,e,t,r){return n?[r[0],x.get(r[1])||O(n,e,t,r[1])]:r},D=function(n,e){var t=function(n){var e={h:t,c:null,a:null,e:0,i:0,s:[]};return t;function t(){var t=i;i=e,e.e=e.i=0;try{return n.apply(e.c=this,e.a=arguments)}finally{i=t,l.length&&y.then(l.forEach.bind(l.splice(0),a)),v.length&&v.splice(0).forEach(a)}}}(e?function(){var e=_,r=S,u=W;_=t,S=this,W=arguments;try{return n.apply(S,W)}finally{_=e,S=r,W=u}}:n);return t},N=null,P=function(n){var e=n.firstChild;if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},R=function n(e){var t=e.nodeType;if(t)return 1===t?e:P(e);var r=e.valueOf();return r!==e?n(r):P(r)};return n.createContext=function(n){return{_:new Set,provide:w,value:n}},n.hooked=function(n,e){var u=D(n,e);return function(){var n=u.apply(this,arguments);if(E(u)){var e=R(n);N||(N=r(e.ownerDocument,"children",t)),N.has(e)||N.connect(e,{disconnected:function(){d(u)}})}return n}},n.useCallback=function(n,e){return g((function(){return n}),e)},n.useContext=function(n){var e=n._,t=n.value;return e.add(p()),t},n.useEffect=C,n.useLayoutEffect=k,n.useMemo=g,n.useReducer=function(n,e,t){return T(_,S,W,$(n,e,t))},n.useRef=function(n){var e=p(),t=e.i,r=e.s;return t===r.length&&r.push({current:n}),r[e.i++]},n.useState=function(n){return T(_,S,W,function(n){return $(M,n)}(n))},n.wait=y,n}({});
{
"name": "uhooks-dom",
"version": "0.2.1",
"version": "0.2.2",
"description": "A uhooks + uconnect based alternative to dom-augmentor",

@@ -30,3 +30,3 @@ "main": "./cjs/index.js",

"ascjs": "^4.0.3",
"rollup": "^2.35.1",
"rollup": "^2.36.0",
"rollup-plugin-includepaths": "^0.2.4",

@@ -53,3 +53,3 @@ "rollup-plugin-terser": "^7.0.2",

"uconnect": "^0.2.7",
"uhooks-fx": "^0.2.1"
"uhooks-fx": "^0.2.2"
},

@@ -56,0 +56,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc