Socket
Socket
Sign inDemoInstall

@deckdeckgo/utils

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deckdeckgo/utils - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

lib/utils/color.utils.d.ts

7

lib/index.d.ts
export * from './utils/utils';
export * from './utils/image-utils';
export * from './utils/inject-utils';
export * from './utils/color-utils';
export * from './utils/image.utils';
export * from './utils/inject.utils';
export * from './utils/color.utils';
export * from './utils/selection.utils';
export * from './utils/editable.utils';

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

function f(e){return e.changedTouches?e.changedTouches[0]:e}function m(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 p(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||d()}function d(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function g(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function w(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}function x(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function y(){return!a()}function a(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var c=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},E=()=>{if(!window)return!1;let e=i();return c()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function S(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()})}function h(e){return new Promise(n=>{if(!e){n();return}e.forEach(async t=>{await t.lazyLoad()}),n()})}function v(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 L(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)})}async function M(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}async function P(e){return e?(t=>{if(!!t)return`#${t.map(o=>o.toString(16).padStart(2,"0")).join("")}`})(u(e)):void 0}function u(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function R(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}var C=()=>{window&&window.getSelection?window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges():document&&document.selection&&document.selection.empty()},l=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,H=e=>{let n=e?.anchorNode;return n?n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE?n:n.parentElement:null},I=e=>{if(window&&document&&document.createRange&&e){let n=document.createRange();n.selectNodeContents(e),n.collapse(!1);let t=l();t?.removeAllRanges(),t?.addRange(n)}};export{C as clearTheSelection,m as debounce,u as extractRgb,R as extractRgba,H as getAnchorElement,l as getSelection,M as hexToRgb,L as injectCSS,v as injectJS,c as isAndroid,E as isAndroidTablet,w as isFirefox,g as isFullscreen,p as isIOS,d as isIPad,y as isLandscape,s as isMobile,a as isPortrait,x as isRTL,S as lazyLoadSelectedImages,h as lazyLoadSelectedLazyImagesComponent,I as moveCursorToEnd,P as rgbToHex,f as unifyEvent};
function f(e){return e.changedTouches?e.changedTouches[0]:e}function m(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 p(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function g(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function w(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}function x(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function b(){return!d()}function d(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var c=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},y=()=>{if(!window)return!1;let e=i();return c()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function S(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()})}function h(e){return new Promise(n=>{if(!e){n();return}e.forEach(async t=>{await t.lazyLoad()}),n()})}function v(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 L(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)})}async function A(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}async function P(e){return e?(t=>{if(!!t)return`#${t.map(o=>o.toString(16).padStart(2,"0")).join("")}`})(u(e)):void 0}function u(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function R(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}var C=()=>{window&&window.getSelection?window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges():document&&document.selection&&document.selection.empty()},l=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,H=e=>{let n=e?.anchorNode;return n?n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE?n:n.parentElement:null},I=e=>{if(window&&document&&document.createRange&&e){let n=document.createRange();n.selectNodeContents(e),n.collapse(!1);let t=l();t?.removeAllRanges(),t?.addRange(n)}};var F=e=>{e?.key==="Tab"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"&#009"))};export{F as catchTab,C as clearTheSelection,m as debounce,u as extractRgb,R as extractRgba,H as getAnchorElement,l as getSelection,A as hexToRgb,L as injectCSS,v as injectJS,c as isAndroid,y as isAndroidTablet,w as isFirefox,g as isFullscreen,p as isIOS,a as isIPad,b as isLandscape,s as isMobile,d as isPortrait,x as isRTL,S as lazyLoadSelectedImages,h as lazyLoadSelectedLazyImagesComponent,I as moveCursorToEnd,P as rgbToHex,f as unifyEvent};
//# sourceMappingURL=index.js.map
{
"name": "@deckdeckgo/utils",
"version": "2.2.0",
"version": "2.3.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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc