meticulous-ui 3.9.4 → 3.10.0

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.
@@ -1,4 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),n=require("prop-types"),r=require("styled-components"),t=e=>e&&e.__esModule?e:{default:e},d=t(n),l=t(r),i=l.default.div`
2
- font-size: 62.5%;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),n=require("prop-types"),r=require("react"),d=require("styled-components"),t=e=>e&&e.__esModule?e:{default:e},l=t(n),c=t(d),i=c.default.div`
3
2
  -webkit-text-size-adjust: 100%;
4
- `,o=({children:e,...s})=>u.jsx(i,{...s,children:e});o.propTypes={children:d.default.node};exports.default=o;
3
+ `,o=({children:e,...s})=>(r.useMemo(()=>{document.documentElement.style.fontSize="62.5%",document.body.style.fontSize="1.6rem"},[]),u.jsx(i,{...s,children:e}));o.propTypes={children:l.default.node};exports.default=o;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=r=>new Promise((o,t)=>{const e=new FileReader;e.onload=()=>o(e.result),e.onerror=a=>t(a),e.readAsDataURL(r)});exports.default=l;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=async(a,n)=>{const o=`https://vision.googleapis.com/v1/images:annotate?key=${n}`,r={requests:[{image:{content:a.replace(/^data:image\/(png|jpeg|jpg);base64,/,"")},features:[{type:"TEXT_DETECTION"}]}]};try{const t=await(await fetch(o,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})).json(),s=t.responses[0].fullTextAnnotation;return{success:!0,detectedLanguage:s.pages[0].property.detectedLanguages[0].languageCode,text:s.text,rawJson:t.responses[0]}}catch(e){return{success:!1,error:e.message}}};exports.default=c;
@@ -1,14 +1,15 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import r from "prop-types";
3
- import p from "styled-components";
4
- const s = p.div`
5
- font-size: 62.5%;
2
+ import m from "prop-types";
3
+ import { useMemo as r } from "react";
4
+ import n from "styled-components";
5
+ const s = n.div`
6
6
  -webkit-text-size-adjust: 100%;
7
- `, i = ({ children: o, ...t }) => /* @__PURE__ */ e(s, { ...t, children: o });
8
- i.propTypes = {
9
- /** Content to render inside the root wrapper */
10
- children: r.node
7
+ `, p = ({ children: o, ...t }) => (r(() => {
8
+ document.documentElement.style.fontSize = "62.5%", document.body.style.fontSize = "1.6rem";
9
+ }, []), /* @__PURE__ */ e(s, { ...t, children: o }));
10
+ p.propTypes = {
11
+ children: m.node
11
12
  };
12
13
  export {
13
- i as default
14
+ p as default
14
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.9.4",
3
+ "version": "3.10.0",
4
4
  "license": "ISC",
5
5
  "description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
6
6
  "types": "./index.d.ts",
@@ -0,0 +1,7 @@
1
+ const n = (r) => new Promise((a, o) => {
2
+ const e = new FileReader();
3
+ e.onload = () => a(e.result), e.onerror = (s) => o(s), e.readAsDataURL(r);
4
+ });
5
+ export {
6
+ n as default
7
+ };
@@ -0,0 +1,30 @@
1
+ const g = async (a, n) => {
2
+ const o = `https://vision.googleapis.com/v1/images:annotate?key=${n}`, r = {
3
+ requests: [
4
+ {
5
+ image: { content: a.replace(/^data:image\/(png|jpeg|jpg);base64,/, "") },
6
+ features: [{ type: "TEXT_DETECTION" }]
7
+ // Works for any language
8
+ }
9
+ ]
10
+ };
11
+ try {
12
+ const t = await (await fetch(o, {
13
+ method: "POST",
14
+ body: JSON.stringify(r),
15
+ headers: { "Content-Type": "application/json" }
16
+ })).json(), s = t.responses[0].fullTextAnnotation;
17
+ return {
18
+ success: !0,
19
+ detectedLanguage: s.pages[0].property.detectedLanguages[0].languageCode,
20
+ text: s.text,
21
+ rawJson: t.responses[0]
22
+ // Full metadata including coordinates
23
+ };
24
+ } catch (e) {
25
+ return { success: !1, error: e.message };
26
+ }
27
+ };
28
+ export {
29
+ g as default
30
+ };