@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,2 @@
1
+ export declare const getUUID: () => `${string}-${string}-${string}-${string}-${string}`;
2
+ //# sourceMappingURL=getUUID.d.ts.map
@@ -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,2 @@
1
+ export * from './getUUID';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -1,6 +1,7 @@
1
1
  export * from './composeEventHandler';
2
2
  export * from './executeFunction';
3
3
  export * from './extractExt';
4
+ export * from './getUUID';
4
5
  export * from './highlightText';
5
6
  export * from './isServer';
6
7
  export * from './mergeRefs';
@@ -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))},l=()=>"undefined"==typeof window,u=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},m=({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:m({str:t}),ext:p({str:t})}:e),r):r},f=()=>e(r,{containerStyle:{top:24,left:24,bottom:24,right:24}}),C=({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"}}),E={info:(e,t)=>C({type:o.INFO,content:e,...t}),success:(e,t)=>C({type:o.SUCCESS,content:e,...t}),warning:(e,t)=>C({type:o.WARNING,content:e,...t}),error:(e,t)=>C({type:o.ERROR,content:e,...t})};export{c as ACCEPT_FILES,a as ACCEPT_FILE_EXT,f as Toaster,s as composeEventHandler,i as executeFunction,p as extractExt,d as highlightText,l as isServer,u as mergeRefs,x as parseExt,m as removeExt,E as toast};
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbodek/utils",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {