@deckdeckgo/utils
Advanced tools
Comparing version 1.8.1 to 2.0.0
@@ -0,1 +1,13 @@ | ||
# 2.0.0 (2021-05-15) | ||
### Breaking Changes | ||
- build to ECMAScript module (`esm`) | ||
- output `esnext` | ||
- drop `iife` and `cjs` format | ||
### Build | ||
- migrate to `esbuild` | ||
<a name="1.8.1"></a> | ||
@@ -2,0 +14,0 @@ |
@@ -1,4 +0,2 @@ | ||
export * from './utils/utils'; | ||
export * from './utils/image-utils'; | ||
export * from './utils/inject-utils'; | ||
export * from './utils/color-utils'; | ||
function f(e){return e.changedTouches?e.changedTouches[0]:e}function m(e,n){let t;return(...i)=>{let r=()=>e(...i);t&&clearTimeout(t),t=setTimeout(r,n&&n>0?n:300)}}function s(){return window?window.matchMedia("(any-pointer:coarse)").matches:!1}function p(){if(!window||!navigator)return!1;let e=o();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=o();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function g(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function b(){if(!window||!navigator)return!1;let e=o();return/firefox/i.test(e)}function x(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function w(){return!d()}function d(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var u=()=>{if(!window)return!1;let e=o();return/android|sink/i.test(e)},y=()=>{if(!window)return!1;let e=o();return u()&&!/mobile/i.test(e)},o=()=>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()})}function S(e){return new Promise(n=>{if(!e){n();return}e.forEach(async t=>{await t.lazyLoad()}),n()})}function L(e,n){return new Promise((t,i)=>{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",()=>i("Error loading script.")),r.addEventListener("abort",()=>i("Script loading aborted.")),document.head.appendChild(r)})}function P(e,n){return new Promise((t,i)=>{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",()=>i("Error loading css.")),r.addEventListener("abort",()=>i("CSS loading aborted.")),document.head.appendChild(r)})}async function T(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 M(e){return e?(t=>{if(!!t)return`#${t.map(i=>i.toString(16).padStart(2,"0")).join("")}`})(c(e)):void 0}function c(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function I(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}export{m as debounce,c as extractRgb,I as extractRgba,T as hexToRgb,P as injectCSS,L as injectJS,u as isAndroid,y as isAndroidTablet,b as isFirefox,g as isFullscreen,p as isIOS,a as isIPad,w as isLandscape,s as isMobile,d as isPortrait,x as isRTL,h as lazyLoadSelectedImages,S as lazyLoadSelectedLazyImagesComponent,M as rgbToHex,f as unifyEvent}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@deckdeckgo/utils", | ||
"version": "1.8.1", | ||
"version": "2.0.0", | ||
"author": "David Dal Busco", | ||
@@ -13,12 +13,9 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo", | ||
"devDependencies": { | ||
"@types/node": "^14.0.27", | ||
"husky": "^4.2.5", | ||
"prettier": "2.0.5", | ||
"pretty-quick": "^2.0.1", | ||
"@types/node": "^15.3.0", | ||
"esbuild": "^0.11.22", | ||
"husky": "^6.0.0", | ||
"prettier": "2.3.0", | ||
"pretty-quick": "^3.1.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.23.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"tslib": "^2.0.0", | ||
"typescript": "^3.9.7" | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -30,3 +27,4 @@ "main": "lib/index.cjs.js", | ||
"prepare": "npm run build", | ||
"build": "rimraf lib && rollup -c && tsc" | ||
"ts-declaration": " tsc --emitDeclarationOnly --outDir lib", | ||
"build": "rimraf lib && rimraf css && node ./esbuild.js && npm run ts-declaration" | ||
}, | ||
@@ -33,0 +31,0 @@ "files": [ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19670
7
11
37
1