Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
(function(s,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(s=typeof globalThis<"u"?globalThis:s||self,n(s.Winkblue={}))})(this,function(s){"use strict";class n{static new(){return new n}constructor(){this._internal_selector_mem=Object.create(null),this.option={forgetHiddenElement:!1}}on(o,i){const e=new Set,t=new MutationObserver(()=>{const l=Array.from(document.querySelectorAll(o));for(const r of l)r&&!e.has(r)&&(e.add(r),setTimeout(()=>i(r),0));if(this.option.forgetHiddenElement)for(const r of e)l.includes(r)||e.delete(r)});t.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),this._internal_selector_mem[o]||(this._internal_selector_mem[o]=new Set),this._internal_selector_mem[o].add({cb:i,mo:t})}off(o,i){const e=this._internal_selector_mem[o];if(e)if(i){const t=Array.from(e).find(l=>l.cb===i);if(!t)return;t.mo.disconnect(),e.delete(t)}else for(const t of e)t.mo.disconnect(),e.delete(t)}reset(){for(const o of Object.keys(this._internal_selector_mem)){const i=this._internal_selector_mem[o];for(const e of i)e.mo.disconnect(),i.delete(e)}}}const c=n.new();s.Winkblue=n,s.winkblue=c,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}); | ||
(function(i,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i.Winkblue={}))})(this,function(i){"use strict";class n{static new(){return new n}constructor(){this._internal_selector_mem=Object.create(null),this.option={forgetHiddenElement:!1}}on(o,s){const e=new Set,t=new MutationObserver(()=>{const l=Array.from(document.querySelectorAll(o));for(const r of l)r&&!e.has(r)&&(e.add(r),setTimeout(()=>s(r),0));if(this.option.forgetHiddenElement)for(const r of e)l.includes(r)||e.delete(r)});t.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),this._internal_selector_mem[o]||(this._internal_selector_mem[o]=new Set),this._internal_selector_mem[o].add({cb:s,mo:t})}off(o,s){const e=this._internal_selector_mem[o];if(e)if(s){const t=Array.from(e).find(l=>l.cb===s);if(!t)return;t.mo.disconnect(),e.delete(t)}else for(const t of e)t.mo.disconnect(),e.delete(t)}reset(){for(const o of Object.keys(this._internal_selector_mem)){const s=this._internal_selector_mem[o];for(const e of s)e.mo.disconnect()}this._internal_selector_mem=Object.create(null)}}const c=n.new();i.Winkblue=n,i.winkblue=c,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); | ||
//# sourceMappingURL=winkblue.umd.js.map |
{ | ||
"name": "winkblue", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A simple DOM observer", | ||
@@ -6,0 +6,0 @@ "author": "FlandreDaisuki <vbnm123c+github@gmail.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14593
62