Socket
Socket
Sign inDemoInstall

@deckdeckgo/utils

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.1.0

lib/esm/chunk-MPAE6ITZ.js

2

lib/cjs/index.cjs.js

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

var d=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var E=e=>d(e,"__esModule",{value:!0});var y=(e,n)=>{for(var t in n)d(e,t,{get:n[t],enumerable:!0})},S=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of w(n))!b.call(e,r)&&(t||r!=="default")&&d(e,r,{get:()=>n[r],enumerable:!(o=x(n,r))||o.enumerable});return e};var h=(e=>(n,t)=>e&&e.get(n)||(t=S(E({}),n,1),e&&e.set(n,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var $={};y($,{caretPosition:()=>K,catchTab:()=>X,clearTheSelection:()=>O,debounce:()=>L,extractRgb:()=>f,extractRgba:()=>F,getAnchorElement:()=>J,getSelection:()=>a,hexToRgb:()=>z,injectCSS:()=>k,injectJS:()=>I,isAndroid:()=>l,isAndroidTablet:()=>P,isFirefox:()=>M,isFullscreen:()=>R,isIOS:()=>v,isIPad:()=>c,isLandscape:()=>N,isMobile:()=>s,isPortrait:()=>u,isRTL:()=>A,lazyLoadSelectedImages:()=>C,lazyLoadSelectedLazyImagesComponent:()=>H,moveCursorToEnd:()=>B,moveCursorToOffset:()=>j,moveCursorToStart:()=>_,rgbToHex:()=>D,unifyEvent:()=>T});function T(e){return e.changedTouches?e.changedTouches[0]:e}function L(e,n){let t;return(...o)=>{let r=()=>e(...o);t&&clearTimeout(t),t=setTimeout(r,n&&n>0?n:300)}}function s(){if(!window)return!1;let e=window.matchMedia("(any-pointer:coarse)").matches,n=window.matchMedia("(any-pointer:fine)").matches;return e&&!n}function v(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||c()}function c(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function R(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function M(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}function A(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function N(){return!u()}function u(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var l=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},P=()=>{if(!window)return!1;let e=i();return l()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function C(e){return new Promise(n=>{if(!e){n();return}e.forEach(t=>{t.hasAttribute("data-src")&&(t.setAttribute("src",`${t.getAttribute("data-src")}`),t.removeAttribute("data-src"),t.classList.contains("deckgo-reveal")||t.style.setProperty("visibility","inherit")),t.style.setProperty("pointer-events","none")}),n()})}var H=async e=>{let n=e.map(t=>t.lazyLoad());await Promise.all(n)};function I(e,n){return new Promise((t,o)=>{if(document.getElementById(e)){t("JS already loaded.");return}let r=document.createElement("script");r.id=e,r.async=!0,r.defer=!0,r.src=n,r.addEventListener("load",()=>t("JS loaded.")),r.addEventListener("error",()=>o("Error loading script.")),r.addEventListener("abort",()=>o("Script loading aborted.")),document.head.appendChild(r)})}function k(e,n){return new Promise((t,o)=>{if(document.getElementById(e)){t("CSS already loaded.");return}let r=document.createElement("link");r.id=e,r.setAttribute("rel","stylesheet"),r.setAttribute("href",n),r.addEventListener("load",()=>t("CSS loaded.")),r.addEventListener("error",()=>o("Error loading css.")),r.addEventListener("abort",()=>o("CSS loading aborted.")),document.head.appendChild(r)})}function z(e){if(!e||e===void 0||e==="")return;let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?`${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}`:void 0}function D(e){return e?(t=>{if(!!t)return`#${t.map(o=>o.toString(16).padStart(2,"0")).join("")}`})(f(e)):void 0}function f(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function F(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}var O=()=>{var e,n,t,o;window&&window.getSelection?((e=window.getSelection())==null?void 0:e.empty)?(n=window.getSelection())==null||n.empty():((t=window.getSelection())==null?void 0:t.removeAllRanges)&&((o=window.getSelection())==null||o.removeAllRanges()):document&&document.selection&&document.selection.empty()},a=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,J=e=>{let n=e==null?void 0:e.anchorNode;return n?n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE?n:n.parentElement:null},B=e=>{m({element:e,collapse:"end"})},_=e=>{m({element:e,collapse:"start"})},m=({element:e,collapse:n})=>{if(!e)return;let t=document.createRange();t.selectNodeContents(e),t.collapse(n==="start"),g(t)},j=({element:e,offset:n})=>{if(!e)return;let t=document.createRange();t.setStart(e,n),g(t)},g=e=>{let n=a();n==null||n.removeAllRanges(),n==null||n.addRange(e),e.detach()},K=({target:e})=>{let n=a(),t=n==null?void 0:n.getRangeAt(0),o=t==null?void 0:t.cloneRange();if(!o||!t)return;let{endContainer:r,endOffset:p}=t;return o.selectNodeContents(e),o.setEnd(r,p),o.toString().length};var X=e=>{(e==null?void 0:e.key)==="Tab"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"&#009"))};module.exports=h($);0&&(module.exports={caretPosition,catchTab,clearTheSelection,debounce,extractRgb,extractRgba,getAnchorElement,getSelection,hexToRgb,injectCSS,injectJS,isAndroid,isAndroidTablet,isFirefox,isFullscreen,isIOS,isIPad,isLandscape,isMobile,isPortrait,isRTL,lazyLoadSelectedImages,lazyLoadSelectedLazyImagesComponent,moveCursorToEnd,moveCursorToOffset,moveCursorToStart,rgbToHex,unifyEvent});
var d=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var E=e=>d(e,"__esModule",{value:!0});var y=(e,n)=>{for(var t in n)d(e,t,{get:n[t],enumerable:!0})},S=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of w(n))!b.call(e,o)&&(t||o!=="default")&&d(e,o,{get:()=>n[o],enumerable:!(r=x(n,o))||r.enumerable});return e};var h=(e=>(n,t)=>e&&e.get(n)||(t=S(E({}),n,1),e&&e.set(n,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var q={};y(q,{caretPosition:()=>X,catchTab:()=>$,clearTheSelection:()=>J,debounce:()=>L,extractRgb:()=>f,extractRgba:()=>O,getAnchorElement:()=>B,getSelection:()=>a,hexToRgb:()=>D,injectCSS:()=>z,injectJS:()=>k,isAndroid:()=>l,isAndroidTablet:()=>C,isFirefox:()=>M,isFullscreen:()=>R,isIOS:()=>v,isIPad:()=>c,isLandscape:()=>P,isMobile:()=>s,isPortrait:()=>u,isRTL:()=>N,isSafari:()=>A,lazyLoadSelectedImages:()=>H,lazyLoadSelectedLazyImagesComponent:()=>I,moveCursorToEnd:()=>_,moveCursorToOffset:()=>K,moveCursorToStart:()=>j,rgbToHex:()=>F,unifyEvent:()=>T});function T(e){return e.changedTouches?e.changedTouches[0]:e}function L(e,n){let t;return(...r)=>{let o=()=>e(...r);t&&clearTimeout(t),t=setTimeout(o,n&&n>0?n:300)}}function s(){if(!window)return!1;let e=window.matchMedia("(any-pointer:coarse)").matches,n=window.matchMedia("(any-pointer:fine)").matches;return e&&!n}function v(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||c()}function c(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function R(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function M(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}var A=()=>/apple/i.test(navigator.vendor);function N(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function P(){return!u()}function u(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var l=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},C=()=>{if(!window)return!1;let e=i();return l()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function H(e){return new Promise(n=>{if(!e){n();return}e.forEach(t=>{t.hasAttribute("data-src")&&(t.setAttribute("src",`${t.getAttribute("data-src")}`),t.removeAttribute("data-src"),t.classList.contains("deckgo-reveal")||t.style.setProperty("visibility","inherit")),t.style.setProperty("pointer-events","none")}),n()})}var I=async e=>{let n=e.map(t=>t.lazyLoad());await Promise.all(n)};function k(e,n){return new Promise((t,r)=>{if(document.getElementById(e)){t("JS already loaded.");return}let o=document.createElement("script");o.id=e,o.async=!0,o.defer=!0,o.src=n,o.addEventListener("load",()=>t("JS loaded.")),o.addEventListener("error",()=>r("Error loading script.")),o.addEventListener("abort",()=>r("Script loading aborted.")),document.head.appendChild(o)})}function z(e,n){return new Promise((t,r)=>{if(document.getElementById(e)){t("CSS already loaded.");return}let o=document.createElement("link");o.id=e,o.setAttribute("rel","stylesheet"),o.setAttribute("href",n),o.addEventListener("load",()=>t("CSS loaded.")),o.addEventListener("error",()=>r("Error loading css.")),o.addEventListener("abort",()=>r("CSS loading aborted.")),document.head.appendChild(o)})}function D(e){if(!e||e===void 0||e==="")return;let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?`${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}`:void 0}function F(e){return e?(t=>{if(!!t)return`#${t.map(r=>r.toString(16).padStart(2,"0")).join("")}`})(f(e)):void 0}function f(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function O(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}var J=()=>{var e,n,t,r;window&&window.getSelection?((e=window.getSelection())==null?void 0:e.empty)?(n=window.getSelection())==null||n.empty():((t=window.getSelection())==null?void 0:t.removeAllRanges)&&((r=window.getSelection())==null||r.removeAllRanges()):document&&document.selection&&document.selection.empty()},a=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,B=e=>{let n=e==null?void 0:e.anchorNode;return n?n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE?n:n.parentElement:null},_=e=>{m({element:e,collapse:"end"})},j=e=>{m({element:e,collapse:"start"})},m=({element:e,collapse:n})=>{if(!e)return;let t=document.createRange();t.selectNodeContents(e),t.collapse(n==="start"),p(t)},K=({element:e,offset:n})=>{if(!e)return;let t=document.createRange();t.setStart(e,n),p(t)},p=e=>{let n=a();n==null||n.removeAllRanges(),n==null||n.addRange(e),e.detach()},X=({target:e})=>{let n=a(),t=n==null?void 0:n.getRangeAt(0),r=t==null?void 0:t.cloneRange();if(!r||!t)return;let{endContainer:o,endOffset:g}=t;return r.selectNodeContents(e),r.setEnd(o,g),r.toString().length};var $=e=>{(e==null?void 0:e.key)==="Tab"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"&#009"))};module.exports=h(q);0&&(module.exports={caretPosition,catchTab,clearTheSelection,debounce,extractRgb,extractRgba,getAnchorElement,getSelection,hexToRgb,injectCSS,injectJS,isAndroid,isAndroidTablet,isFirefox,isFullscreen,isIOS,isIPad,isLandscape,isMobile,isPortrait,isRTL,isSafari,lazyLoadSelectedImages,lazyLoadSelectedLazyImagesComponent,moveCursorToEnd,moveCursorToOffset,moveCursorToStart,rgbToHex,unifyEvent});
//# sourceMappingURL=index.cjs.js.map

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

import{a as o,b as r,c as e,d as f}from"./chunk-5HBDM4GG.js";import{a as m}from"./chunk-AAHN4EGO.js";import{a as p,b as t}from"./chunk-HCIHXSOP.js";import{a as q,b as s}from"./chunk-QUZGMKEP.js";import{a as u,b as v,c as w,d as y,e as z,f as A,g as B}from"./chunk-T5D2FC6D.js";import{a as x,b as a,c as b,d as c,e as d,f as g,g as h,h as i,i as j,j as k,k as l,l as n}from"./chunk-WJ3YUCU2.js";export{B as caretPosition,m as catchTab,u as clearTheSelection,a as debounce,e as extractRgb,f as extractRgba,w as getAnchorElement,v as getSelection,o as hexToRgb,s as injectCSS,q as injectJS,l as isAndroid,n as isAndroidTablet,h as isFirefox,g as isFullscreen,c as isIOS,d as isIPad,j as isLandscape,b as isMobile,k as isPortrait,i as isRTL,p as lazyLoadSelectedImages,t as lazyLoadSelectedLazyImagesComponent,y as moveCursorToEnd,A as moveCursorToOffset,z as moveCursorToStart,r as rgbToHex,x as unifyEvent};
import{a as o,b as r,c as e,d as f}from"./chunk-5HBDM4GG.js";import{a as m}from"./chunk-AAHN4EGO.js";import{a as p,b as t}from"./chunk-HCIHXSOP.js";import{a as s,b as u}from"./chunk-QUZGMKEP.js";import{a as v,b as w,c as y,d as z,e as A,f as B,g as C}from"./chunk-T5D2FC6D.js";import{a as x,b as a,c as b,d as c,e as d,f as g,g as h,h as i,i as j,j as k,k as l,l as n,m as q}from"./chunk-MPAE6ITZ.js";export{C as caretPosition,m as catchTab,v as clearTheSelection,a as debounce,e as extractRgb,f as extractRgba,y as getAnchorElement,w as getSelection,o as hexToRgb,u as injectCSS,s as injectJS,n as isAndroid,q as isAndroidTablet,h as isFirefox,g as isFullscreen,c as isIOS,d as isIPad,k as isLandscape,b as isMobile,l as isPortrait,j as isRTL,i as isSafari,p as lazyLoadSelectedImages,t as lazyLoadSelectedLazyImagesComponent,z as moveCursorToEnd,B as moveCursorToOffset,A as moveCursorToStart,r as rgbToHex,x as unifyEvent};
//# sourceMappingURL=index.js.map

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

import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-WJ3YUCU2.js";export{b as debounce,k as isAndroid,l as isAndroidTablet,g as isFirefox,f as isFullscreen,d as isIOS,e as isIPad,i as isLandscape,c as isMobile,j as isPortrait,h as isRTL,a as unifyEvent};
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-MPAE6ITZ.js";export{b as debounce,l as isAndroid,m as isAndroidTablet,g as isFirefox,f as isFullscreen,d as isIOS,e as isIPad,j as isLandscape,c as isMobile,k as isPortrait,i as isRTL,h as isSafari,a as unifyEvent};
//# sourceMappingURL=utils.js.map

@@ -8,2 +8,3 @@ export declare function unifyEvent(e: any): any;

export declare function isFirefox(): boolean;
export declare const isSafari: () => boolean;
export declare function isRTL(): boolean;

@@ -10,0 +11,0 @@ export declare function isLandscape(): boolean;

{
"name": "@deckdeckgo/utils",
"version": "5.0.0",
"version": "5.1.0",
"author": "David Dal Busco",

@@ -5,0 +5,0 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc