tiny-essentials 1.18.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/node_modules/firebase-functions/lib/common/trace.cjs +0 -1
- package/dist/node_modules/firebase-functions/lib/logger/index.cjs +1 -0
- package/dist/v1/ColorSafeStringify.min.js +1 -1
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyBasicsEs.js +13 -6
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyClipboard.min.js +1 -1
- package/dist/v1/TinyColorConverter.js +617 -0
- package/dist/v1/TinyColorConverter.min.js +1 -0
- package/dist/v1/TinyDomReadyManager.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.js +2635 -482
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyEvents.js +402 -0
- package/dist/v1/TinyEvents.min.js +1 -0
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyLocalStorage.js +1292 -0
- package/dist/v1/TinyLocalStorage.min.js +1 -0
- package/dist/v1/TinyNotifications.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyPromiseQueue.min.js +1 -1
- package/dist/v1/TinyRateLimiter.js +2 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinySmartScroller.js +570 -52
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyTextRangeEditor.min.js +1 -1
- package/dist/v1/TinyTimeout.js +233 -0
- package/dist/v1/TinyTimeout.min.js +1 -0
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.js +1457 -106
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/UltraRandomMsgGen.min.js +1 -1
- package/dist/v1/basics/html.cjs +13 -6
- package/dist/v1/basics/html.d.mts +12 -4
- package/dist/v1/basics/html.mjs +13 -6
- package/dist/v1/build/TinyColorConverter.cjs +7 -0
- package/dist/v1/build/TinyColorConverter.d.mts +3 -0
- package/dist/v1/build/TinyColorConverter.mjs +2 -0
- package/dist/v1/build/TinyEvents.cjs +7 -0
- package/dist/v1/build/TinyEvents.d.mts +3 -0
- package/dist/v1/build/TinyEvents.mjs +2 -0
- package/dist/v1/build/TinyLocalStorage.cjs +7 -0
- package/dist/v1/build/TinyLocalStorage.d.mts +3 -0
- package/dist/v1/build/TinyLocalStorage.mjs +2 -0
- package/dist/v1/build/TinyTimeout.cjs +7 -0
- package/dist/v1/build/TinyTimeout.d.mts +3 -0
- package/dist/v1/build/TinyTimeout.mjs +2 -0
- package/dist/v1/index.cjs +8 -0
- package/dist/v1/index.d.mts +5 -1
- package/dist/v1/index.mjs +5 -1
- package/dist/v1/libs/TinyColorConverter.cjs +578 -0
- package/dist/v1/libs/TinyColorConverter.d.mts +396 -0
- package/dist/v1/libs/TinyColorConverter.mjs +520 -0
- package/dist/v1/libs/TinyEvents.cjs +363 -0
- package/dist/v1/libs/TinyEvents.d.mts +160 -0
- package/dist/v1/libs/TinyEvents.mjs +328 -0
- package/dist/v1/libs/TinyLocalStorage.cjs +847 -0
- package/dist/v1/libs/TinyLocalStorage.d.mts +407 -0
- package/dist/v1/libs/TinyLocalStorage.mjs +740 -0
- package/dist/v1/libs/TinySmartScroller.cjs +207 -52
- package/dist/v1/libs/TinySmartScroller.d.mts +164 -16
- package/dist/v1/libs/TinySmartScroller.mjs +181 -52
- package/dist/v1/libs/TinyTimeout.cjs +194 -0
- package/dist/v1/libs/TinyTimeout.d.mts +89 -0
- package/dist/v1/libs/TinyTimeout.mjs +179 -0
- package/dist/v1/libs/TinyUploadClicker.cjs +1 -0
- package/docs/v1/README.md +4 -0
- package/docs/v1/libs/TinyColorConverter.md +220 -0
- package/docs/v1/libs/TinyEvents.md +199 -0
- package/docs/v1/libs/TinyLocalStorage.md +350 -0
- package/docs/v1/libs/TinyRateLimiter.md +0 -3
- package/docs/v1/libs/TinyTimeout.md +190 -0
- package/package.json +28 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{TinyToastNotify:()=>i});const i=class{#t;#e;#i;#n;#a;#r;constructor(t="top",e="right",i=3e3,n=50,a=300,r=".notify-container"){this.#o(t),this.#s(e),this.#l(i,"baseDuration"),this.#l(n,"extraPerChar"),this.#l(a,"fadeOutDuration"),this.#t=t,this.#e=e,this.#i=i,this.#n=n,this.#a=a;const o=document.querySelector(`${r}.${t}.${e}`);o instanceof HTMLElement?this.#r=o:(this.#r=document.createElement("div"),this.#r.className=`notify-container ${t} ${e}`,document.body.appendChild(this.#r))}getContainer(){if(!(this.#r instanceof HTMLElement))throw new Error("Container is not a valid HTMLElement.");return this.#r}#o(t){if(!["top","bottom"].includes(t))throw new Error(`Invalid vertical direction "${t}". Expected "top" or "bottom".`)}#s(t){if(!["left","right","center"].includes(t))throw new Error(`Invalid horizontal position "${t}". Expected "left", "right" or "center".`)}#l(t,e){if("number"!=typeof t||t<0||!Number.isFinite(t))throw new Error(`Invalid value for "${e}": ${t}. Must be a non-negative finite number.`)}getY(){return this.#t}setY(t){this.#o(t);const e=this.getContainer();e.classList.remove(this.#t),e.classList.add(t),this.#t=t}getX(){return this.#e}setX(t){this.#s(t);const e=this.getContainer();e.classList.remove(this.#e),e.classList.add(t),this.#e=t}getBaseDuration(){return this.#i}setBaseDuration(t){this.#l(t,"baseDuration"),this.#i=t}getExtraPerChar(){return this.#n}setExtraPerChar(t){this.#l(t,"extraPerChar"),this.#n=t}getFadeOutDuration(){return this.#a}setFadeOutDuration(t){this.#l(t,"fadeOutDuration"),this.#a=t}show(t){let e="",i="",n=null,a=!1,r=null;const o=document.createElement("div");if(o.className="notify enter","string"==typeof t)e=t;else{if("object"!=typeof t||null===t||"string"!=typeof t.message)throw new Error("Invalid argument for show(): expected string or { message: string, title?: string, onClick?: function, html?: boolean, avatar?: string }");if(e=t.message,i="string"==typeof t.title?t.title:"",a=!0===t.html,r="string"==typeof t.avatar?t.avatar:null,void 0!==t.onClick){if("function"!=typeof t.onClick)throw new Error("onClick must be a function if defined");n=t.onClick,o.classList.add("clickable")}}const s=document.createElement("button");if(s.innerHTML="×",s.className="close",s.setAttribute("aria-label","Close"),s.addEventListener("mouseenter",(
|
|
1
|
+
(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{TinyToastNotify:()=>i});const i=class{#t;#e;#i;#n;#a;#r;constructor(t="top",e="right",i=3e3,n=50,a=300,r=".notify-container"){this.#o(t),this.#s(e),this.#l(i,"baseDuration"),this.#l(n,"extraPerChar"),this.#l(a,"fadeOutDuration"),this.#t=t,this.#e=e,this.#i=i,this.#n=n,this.#a=a;const o=document.querySelector(`${r}.${t}.${e}`);o instanceof HTMLElement?this.#r=o:(this.#r=document.createElement("div"),this.#r.className=`notify-container ${t} ${e}`,document.body.appendChild(this.#r))}getContainer(){if(!(this.#r instanceof HTMLElement))throw new Error("Container is not a valid HTMLElement.");return this.#r}#o(t){if(!["top","bottom"].includes(t))throw new Error(`Invalid vertical direction "${t}". Expected "top" or "bottom".`)}#s(t){if(!["left","right","center"].includes(t))throw new Error(`Invalid horizontal position "${t}". Expected "left", "right" or "center".`)}#l(t,e){if("number"!=typeof t||t<0||!Number.isFinite(t))throw new Error(`Invalid value for "${e}": ${t}. Must be a non-negative finite number.`)}getY(){return this.#t}setY(t){this.#o(t);const e=this.getContainer();e.classList.remove(this.#t),e.classList.add(t),this.#t=t}getX(){return this.#e}setX(t){this.#s(t);const e=this.getContainer();e.classList.remove(this.#e),e.classList.add(t),this.#e=t}getBaseDuration(){return this.#i}setBaseDuration(t){this.#l(t,"baseDuration"),this.#i=t}getExtraPerChar(){return this.#n}setExtraPerChar(t){this.#l(t,"extraPerChar"),this.#n=t}getFadeOutDuration(){return this.#a}setFadeOutDuration(t){this.#l(t,"fadeOutDuration"),this.#a=t}show(t){let e="",i="",n=null,a=!1,r=null;const o=document.createElement("div");if(o.className="notify enter","string"==typeof t)e=t;else{if("object"!=typeof t||null===t||"string"!=typeof t.message)throw new Error("Invalid argument for show(): expected string or { message: string, title?: string, onClick?: function, html?: boolean, avatar?: string }");if(e=t.message,i="string"==typeof t.title?t.title:"",a=!0===t.html,r="string"==typeof t.avatar?t.avatar:null,void 0!==t.onClick){if("function"!=typeof t.onClick)throw new Error("onClick must be a function if defined");n=t.onClick,o.classList.add("clickable")}}const s=document.createElement("button");if(s.innerHTML="×",s.className="close",s.setAttribute("aria-label","Close"),s.addEventListener("mouseenter",()=>{s.style.color="var(--notif-close-color-hover)"}),s.addEventListener("mouseleave",()=>{s.style.color="var(--notif-close-color)"}),r){const t=document.createElement("img");t.src=r,t.alt="avatar",t.className="avatar",o.appendChild(t)}if(i){const t=document.createElement("strong");t.textContent=i,t.style.display="block",o.appendChild(t)}if(a){const t=document.createElement("div");t.innerHTML=e,o.appendChild(t)}else o.appendChild(document.createTextNode(e));o.appendChild(s),this.getContainer().appendChild(o);const l=this.#i+e.length*this.#n+this.#a;let c=!1;const d=()=>{c||(c=!0,o.classList.remove("enter","show"),o.classList.add("exit"),setTimeout(()=>o.remove(),this.#a))};"function"==typeof n&&o.addEventListener("click",t=>{t.target!==s&&n(t,d)}),s.addEventListener("click",t=>{t.stopPropagation(),d()}),setTimeout(()=>{o.classList.remove("enter"),o.classList.add("show")},1),setTimeout(()=>d(),l)}destroy(){this.#r instanceof HTMLElement&&(this.#r.querySelectorAll(".notify").forEach(t=>t.remove()),this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r),this.#r=null)}};window.TinyToastNotify=e.TinyToastNotify})();
|