@bbodek/utils 0.0.4 → 0.0.5
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUUID.d.ts","sourceRoot":"","sources":["../../src/getUUID/getUUID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2DAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/getUUID/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t,{Toaster as r}from"react-hot-toast";import{TOAST_TYPES as o,Toast as n}from"@bbodek/internal-ui";const s=({internalEventHandler:e,externalEventHandler:t})=>(r,...o)=>{r.stopPropagation(),e(r,...o),t&&t(r,...o)},i=({disabled:e=!1,fn:t})=>e?void 0:t,a={PNG:"png",JPEG:"jpeg",HEIC:"heic",WEBP:"webp",PDF:"pdf",XLSX:"xlsx",DOCX:"docx",JPG:"jpg"},c=Object.values(a),p=({accept:e=c,str:t})=>e.reduce(((e,r)=>t.toLowerCase().endsWith(r)?r:e),""),d=({text:t,targetText:r})=>{if(""===r||""===t)return t;const o=new RegExp(`(${r})`,"gi");return t.split(o).map(((t,o)=>t.toLowerCase()===r.toLowerCase()?e("span",{className:"text-in-primary-06",children:t},o):t))},
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t,{Toaster as r}from"react-hot-toast";import{TOAST_TYPES as o,Toast as n}from"@bbodek/internal-ui";const s=({internalEventHandler:e,externalEventHandler:t})=>(r,...o)=>{r.stopPropagation(),e(r,...o),t&&t(r,...o)},i=({disabled:e=!1,fn:t})=>e?void 0:t,a={PNG:"png",JPEG:"jpeg",HEIC:"heic",WEBP:"webp",PDF:"pdf",XLSX:"xlsx",DOCX:"docx",JPG:"jpg"},c=Object.values(a),p=({accept:e=c,str:t})=>e.reduce(((e,r)=>t.toLowerCase().endsWith(r)?r:e),""),d=()=>self.crypto.randomUUID(),l=({text:t,targetText:r})=>{if(""===r||""===t)return t;const o=new RegExp(`(${r})`,"gi");return t.split(o).map(((t,o)=>t.toLowerCase()===r.toLowerCase()?e("span",{className:"text-in-primary-06",children:t},o):t))},u=()=>"undefined"==typeof window,m=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},f=({accept:e=c,str:t})=>e.reduce(((e,t)=>e.endsWith(t)?e.replace(t,""):e),t.toLowerCase()),x=({accept:e=c,str:t})=>{const r={removedExt:"",ext:""};return t?e.reduce(((e,r)=>t.toLowerCase().endsWith(r)?{removedExt:f({str:t}),ext:p({str:t})}:e),r):r},C=()=>e(r,{containerStyle:{top:24,left:24,bottom:24,right:24}}),E=({useClose:r,duration:o=3e3,onClose:s,...i})=>t.custom((o=>e(n,{visible:o.visible,useClose:r,onClose:()=>(({id:e})=>{r&&(t.dismiss(e),s?.())})({id:o.id}),...i})),{position:"top-center",duration:o,ariaProps:{role:"alert","aria-live":"assertive"}}),v={info:(e,t)=>E({type:o.INFO,content:e,...t}),success:(e,t)=>E({type:o.SUCCESS,content:e,...t}),warning:(e,t)=>E({type:o.WARNING,content:e,...t}),error:(e,t)=>E({type:o.ERROR,content:e,...t})};export{c as ACCEPT_FILES,a as ACCEPT_FILE_EXT,C as Toaster,s as composeEventHandler,i as executeFunction,p as extractExt,d as getUUID,l as highlightText,u as isServer,m as mergeRefs,x as parseExt,f as removeExt,v as toast};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|