letalkui 0.0.8 → 0.0.9
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.
- package/dist/index.cjs +0 -1
- package/dist/index.js +0 -1
- package/package.json +57 -54
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
"use strict";var U=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var K=(o,t)=>{for(var r in t)m(o,r,{get:t[r],enumerable:!0})},V=(o,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of $(t))!q.call(o,e)&&e!==r&&m(o,e,{get:()=>t[e],enumerable:!(n=_(t,e))||n.enumerable});return o};var Q=(o,t,r)=>(r=o!=null?U(W(o)):{},V(t||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),X=o=>V(m({},"__esModule",{value:!0}),o);var ro={};K(ro,{Button:()=>Y,JsonEditor:()=>oo,JsonView:()=>to});module.exports=X(ro);var C=require("react/jsx-runtime"),Y=o=>{let{backgroundColor:t,label:r,size:n,primary:e}=o,i=e?"storybook-button--primary":"storybook-button--secondary";return(0,C.jsx)("button",{type:"button",className:["storybook-button",`storybook-button--${n}`,i].join(""),style:{backgroundColor:t},...o,children:r})};var J=require("react");var A=require("@mui/material"),S=require("react/jsx-runtime"),x=o=>(0,S.jsx)(A.Grid2,{container:!0,direction:"column",spacing:2,children:o.children});var f=require("@mui/material"),g=require("react/jsx-runtime"),T=o=>{let{onSave:t,loading:r}=o;return(0,g.jsx)(f.Button,{onClick:()=>{t()},color:"primary",variant:"contained",disableElevation:!0,disabled:r,endIcon:r&&(0,g.jsx)(f.CircularProgress,{size:20,color:"inherit"}),children:"Salvar"})};var y=require("@mui/material"),b=require("react/jsx-runtime"),w=o=>(0,b.jsx)(y.Grid2,{container:!0,justify:"flex-end",children:(0,b.jsx)(y.Grid2,{item:!0,children:o.children})});var E=Q(require("react-ace"),1),p=require("@mui/material"),c=require("react/jsx-runtime"),Z="json-editor",B=o=>{let{value:t,onChange:r,currentError:n,currentHelperText:e,...i}=o,s=JSON.stringify(t,null,2);return(0,c.jsxs)(p.Grid2,{children:[(0,c.jsx)(p.FormControl,{error:n,fullWidth:!0,children:(0,c.jsx)(E.default,{...i,name:Z,value:s,wrapEnabled:!0,mode:"json",theme:"textmate",onChange:r,fontSize:16,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,editorProps:{$blockScrolling:!0},setOptions:{showLineNumbers:!0,tabSize:2}})}),e&&(0,c.jsx)(p.FormHelperText,{error:n,children:e})]})};var a={Root:x,ActionButton:T,ActionsButtons:w,Content:B};var F=require("react"),j=()=>{let[o,t]=(0,F.useState)({});return{addValidation:i=>{t(s=>({...s,...i}))},clearValidation:i=>{i in o&&t(s=>{let d={...s};return delete d[i],d})},clearAllValidations:()=>{t({})},validation:o}},N=j;var u=require("react/jsx-runtime"),v="json-editor",oo=o=>{let{value:t,onChange:r,onSave:n,helperText:e,error:i,...s}=o,{addValidation:d,clearValidation:O,validation:h}=N(),k=JSON.stringify(t,null,2),[G,I]=(0,J.useState)(k),[H,R]=(0,J.useState)(!1),z=()=>v in h&&i||!1,D=()=>v in h&&e||"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.",L=l=>{O(v),I(l),r?.(l)},M=async()=>{if(R(!0),n)try{let l=JSON.parse(G);await n(l)}catch(l){d({[v]:l})}R(!1)};return(0,u.jsxs)(a.Root,{children:[(0,u.jsx)(a.Content,{...s,value:t,onChange:L,currentError:z(),currentHelperText:D()}),(0,u.jsx)(a.ActionsButtons,{children:(0,u.jsx)(a.ActionButton,{onSave:M,loading:H})})]})};var P=require("react/jsx-runtime"),to=o=>{let{value:t,...r}=o;return(0,P.jsx)(a.Root,{children:(0,P.jsx)(a.Content,{...r,value:t})})};0&&(module.exports={Button,JsonEditor,JsonView});
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
import{jsx as O}from"react/jsx-runtime";var K=o=>{let{backgroundColor:t,label:r,size:n,primary:i}=o,e=i?"storybook-button--primary":"storybook-button--secondary";return O("button",{type:"button",className:["storybook-button",`storybook-button--${n}`,e].join(""),style:{backgroundColor:t},...o,children:r})};import{useState as V}from"react";import{Grid2 as k}from"@mui/material";import{jsx as G}from"react/jsx-runtime";var v=o=>G(k,{container:!0,direction:"column",spacing:2,children:o.children});import{Button as I,CircularProgress as H}from"@mui/material";import{jsx as g}from"react/jsx-runtime";var y=o=>{let{onSave:t,loading:r}=o;return g(I,{onClick:()=>{t()},color:"primary",variant:"contained",disableElevation:!0,disabled:r,endIcon:r&&g(H,{size:20,color:"inherit"}),children:"Salvar"})};import{Grid2 as b}from"@mui/material";import{jsx as J}from"react/jsx-runtime";var P=o=>J(b,{container:!0,justify:"flex-end",children:J(b,{item:!0,children:o.children})});import z from"react-ace";import{FormControl as D,FormHelperText as L,Grid2 as M}from"@mui/material";import{jsx as u,jsxs as _}from"react/jsx-runtime";var U="json-editor",h=o=>{let{value:t,onChange:r,currentError:n,currentHelperText:i,...e}=o,s=JSON.stringify(t,null,2);return _(M,{children:[u(D,{error:n,fullWidth:!0,children:u(z,{...e,name:U,value:s,wrapEnabled:!0,mode:"json",theme:"textmate",onChange:r,fontSize:16,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,editorProps:{$blockScrolling:!0},setOptions:{showLineNumbers:!0,tabSize:2}})}),i&&u(L,{error:n,children:i})]})};var a={Root:v,ActionButton:y,ActionsButtons:P,Content:h};import{useState as $}from"react";var W=()=>{let[o,t]=$({});return{addValidation:e=>{t(s=>({...s,...e}))},clearValidation:e=>{e in o&&t(s=>{let c={...s};return delete c[e],c})},clearAllValidations:()=>{t({})},validation:o}},R=W;import{jsx as d,jsxs as q}from"react/jsx-runtime";var p="json-editor",Vo=o=>{let{value:t,onChange:r,onSave:n,helperText:i,error:e,...s}=o,{addValidation:c,clearValidation:A,validation:m}=R(),x=JSON.stringify(t,null,2),[S,T]=V(x),[w,f]=V(!1),E=()=>p in m&&e||!1,B=()=>p in m&&i||"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.",F=l=>{A(p),T(l),r?.(l)},N=async()=>{if(f(!0),n)try{let l=JSON.parse(S);await n(l)}catch(l){c({[p]:l})}f(!1)};return q(a.Root,{children:[d(a.Content,{...s,value:t,onChange:F,currentError:E(),currentHelperText:B()}),d(a.ActionsButtons,{children:d(a.ActionButton,{onSave:N,loading:w})})]})};import{jsx as C}from"react/jsx-runtime";var So=o=>{let{value:t,...r}=o;return C(a.Root,{children:C(a.Content,{...r,value:t})})};export{K as Button,Vo as JsonEditor,So as JsonView};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,60 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "letalkui",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.9",
|
|
5
|
+
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.cjs",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
9
12
|
"scripts": {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"dev": "storybook dev -p 6006",
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"build:storybook": "storybook build"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@emotion/react": "^11.14.0",
|
|
20
|
+
"@emotion/styled": "^11.14.0",
|
|
21
|
+
"@mui/material": "^6.4.3",
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-ace": "^10.1.0",
|
|
24
|
+
"react-dom": "^18.3.1"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@eslint/compat": "^1.2.5",
|
|
28
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
29
|
+
"@eslint/js": "^9.17.0",
|
|
30
|
+
"@storybook/addon-essentials": "^8.4.7",
|
|
31
|
+
"@storybook/blocks": "^8.4.7",
|
|
32
|
+
"@storybook/react": "^8.4.7",
|
|
33
|
+
"@storybook/react-vite": "^8.4.7",
|
|
34
|
+
"@storybook/test": "^8.4.7",
|
|
35
|
+
"@types/node": "18.19",
|
|
36
|
+
"@types/react": "^18.3.18",
|
|
37
|
+
"@types/react-dom": "^18.3.5",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
40
|
+
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
41
|
+
"eslint": "^9.17.0",
|
|
42
|
+
"eslint-plugin-import": "^2.31.0",
|
|
43
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
44
|
+
"eslint-plugin-react": "^7.37.4",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
47
|
+
"eslint-plugin-storybook": "^0.11.2",
|
|
48
|
+
"globals": "^15.14.0",
|
|
49
|
+
"storybook": "^8.4.7",
|
|
50
|
+
"tsup": "^8.3.5",
|
|
51
|
+
"typescript": "~5.6.2",
|
|
52
|
+
"typescript-eslint": "^8.18.2",
|
|
53
|
+
"vite": "^6.0.5"
|
|
54
|
+
},
|
|
55
|
+
"eslintConfig": {
|
|
56
|
+
"extends": [
|
|
57
|
+
"plugin:storybook/recommended"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": "18.20.3"
|
|
62
|
+
}
|
|
60
63
|
}
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/Button/index.tsx","../src/components/JsonEditor/index.tsx","../src/componentPatterns/JsonForm/Root.tsx","../src/componentPatterns/JsonForm/ActionButton.tsx","../src/componentPatterns/JsonForm/ActionsButtons.tsx","../src/componentPatterns/JsonForm/Content.tsx","../src/componentPatterns/JsonForm/index.ts","../src/hooks/useValidation.tsx","../src/components/JsonView/index.tsx"],"sourcesContent":["export * from \"@/components/Button\"\nexport * from \"@/components/JsonEditor\"\nexport * from \"@/components/JsonView\"\n","import React from \"react\"\n\nexport interface ButtonProps {\n\tprimary?: boolean\n\tbackgroundColor?: string\n\tsize?: \"small\" | \"medium\" | \"large\"\n\tlabel: string\n\tonClick?: () => void\n}\n\nexport const Button = (props: ButtonProps) => {\n\tconst {\n\t\tbackgroundColor,\n\t\tlabel,\n\t\tsize,\n\t\tprimary\n\t} = props\n\n\tconst mode = primary ? \"storybook-button--primary\" : \"storybook-button--secondary\"\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={[\"storybook-button\", `storybook-button--${size}`, mode].join(\"\")}\n\t\t\tstyle={{ backgroundColor }}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label}\n\t\t</button>\n\t)\n}\n","import React, { useState } from \"react\"\nimport { IAceEditorProps } from \"react-ace\"\n\nimport { JsonForm } from \"@/componentPatterns/JsonForm\"\nimport {\n\tJsonValue,\n\tOverwrite\n} from \"@/componentPatterns/JsonForm/Content\"\n\nimport useValidation from \"@/hooks/useValidation\"\n\ntype JsonEditorProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n\tonChange?: (value: string) => void\n\tonSave?: (value: JsonValue) => Promise<JsonValue>\n\thelperText?: string\n\terror?: boolean\n}>\n\nconst INPUT_NAME = \"json-editor\"\n\nexport const JsonEditor: React.FC<JsonEditorProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tonSave,\n\t\thelperText,\n\t\terror,\n\t\t...rest\n\t} = props\n\n\tconst { addValidation, clearValidation, validation } = useValidation()\n\n\tconst stringifyValue = JSON.stringify(value, null, 2)\n\n\tconst [jsonData, setJsonData] = useState<string>(stringifyValue)\n\tconst [loadingSaveJson, setLoadingSaveJson] = useState<boolean>(false)\n\n\tconst currentError = (): boolean => {\n\t\tif (INPUT_NAME in validation) {\n\t\t\tif (error) return error\n\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tconst currentHelperText = (): string => {\n\t\tif (INPUT_NAME in validation) {\n\t\t\tif (helperText) return helperText\n\n\t\t\treturn \"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.\"\n\t\t}\n\n\t\treturn \"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.\"\n\t}\n\n\tconst handleChange = (newValue: string) => {\n\t\tclearValidation(INPUT_NAME)\n\n\t\tsetJsonData(newValue)\n\n\t\tonChange?.(newValue)\n\t}\n\n\tconst handleSave = async () => {\n\t\tsetLoadingSaveJson(true)\n\n\t\tif (onSave) {\n\t\t\ttry {\n\t\t\t\tconst parseJsonData = JSON.parse(jsonData)\n\n\t\t\t\tawait onSave(parseJsonData)\n\t\t\t} catch (error) {\n\t\t\t\taddValidation({ [INPUT_NAME]: error })\n\t\t\t}\n\t\t}\n\n\t\tsetLoadingSaveJson(false)\n\t}\n\n\treturn (\n\t\t<JsonForm.Root>\n\t\t\t<JsonForm.Content\n\t\t\t\t{...rest}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tcurrentError={currentError()}\n\t\t\t\tcurrentHelperText={currentHelperText()}\n\t\t\t/>\n\n\t\t\t<JsonForm.ActionsButtons>\n\t\t\t\t<JsonForm.ActionButton\n\t\t\t\t\tonSave={handleSave}\n\t\t\t\t\tloading={loadingSaveJson}\n\t\t\t\t/>\n\t\t\t</JsonForm.ActionsButtons>\n\t\t</JsonForm.Root>\n\t)\n}\n","import React from \"react\"\n\nimport {\n\tGrid2 as Grid\n} from \"@mui/material\"\n\ntype RootProps = {\n\tchildren: React.ReactNode\n}\n\nexport const Root: React.FC<RootProps> = (props) => {\n\treturn (\n\t\t<Grid\n\t\t\tcontainer\n\t\t\tdirection=\"column\"\n\t\t\tspacing={2}\n\t\t>\n\t\t\t{props.children}\n\t\t</Grid>\n\t)\n}\n","import React from \"react\"\n\nimport {\n\tButton,\n\tCircularProgress\n} from \"@mui/material\"\n\ntype ActionButtonProps = {\n\tonSave: () => void\n\tloading: boolean\n}\n\nexport const ActionButton: React.FC<ActionButtonProps> = (props) => {\n\tconst {\n\t\tonSave,\n\t\tloading\n\t} = props\n\n\tconst handleSave = () => {\n\t\tonSave()\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={handleSave}\n\t\t\tcolor=\"primary\"\n\t\t\tvariant=\"contained\"\n\t\t\tdisableElevation\n\t\t\tdisabled={loading}\n\t\t\tendIcon={loading && <CircularProgress size={20} color=\"inherit\" />}\n\t\t>\n\t\t\tSalvar\n\t\t</Button>\n\t)\n}\n","import React from \"react\"\nimport {\n\tGrid2 as Grid\n} from \"@mui/material\"\n\ntype ActionsButtonsProps = {\n\tchildren: React.ReactNode\n}\n\nexport const ActionsButtons: React.FC<ActionsButtonsProps> = (props) => {\n\treturn (\n\t\t<Grid\n\t\t\tcontainer\n\t\t\tjustify=\"flex-end\"\n\t\t>\n\t\t\t<Grid\n\t\t\t\titem\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</Grid>\n\t\t</Grid>\n\t)\n}\n","import React from \"react\"\nimport AceEditor, { IAceEditorProps } from \"react-ace\"\nimport {\n\tFormControl,\n\tFormHelperText,\n\tGrid2 as Grid\n} from \"@mui/material\"\n\nexport type JsonValue = Record<string | number, unknown>\n\nexport type Overwrite<T, NewT> = Omit<T, keyof NewT> & NewT;\n\nexport type ContentProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n\tonChange?: (updatedJson: string) => void\n\tcurrentError?: boolean\n\tcurrentHelperText?: string\n}>\n\nconst INPUT_NAME = \"json-editor\"\n\nexport const Content: React.FC<ContentProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tcurrentError,\n\t\tcurrentHelperText,\n\t\t...rest\n\t} = props\n\n\tconst stringifyValue = JSON.stringify(value, null, 2)\n\n\treturn (\n\t\t<Grid>\n\t\t\t<FormControl\n\t\t\t\terror={currentError}\n\t\t\t\tfullWidth\n\t\t\t>\n\t\t\t\t<AceEditor\n\t\t\t\t\t{...rest}\n\t\t\t\t\tname={INPUT_NAME}\n\t\t\t\t\tvalue={stringifyValue}\n\t\t\t\t\twrapEnabled={true}\n\t\t\t\t\tmode=\"json\"\n\t\t\t\t\ttheme=\"textmate\"\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tfontSize={16}\n\t\t\t\t\tshowPrintMargin={true}\n\t\t\t\t\tshowGutter={true}\n\t\t\t\t\thighlightActiveLine={true}\n\t\t\t\t\teditorProps={{ $blockScrolling: true }}\n\t\t\t\t\tsetOptions={{\n\t\t\t\t\t\tshowLineNumbers: true,\n\t\t\t\t\t\ttabSize: 2\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FormControl>\n\t\t\t{currentHelperText && (\n\t\t\t\t<FormHelperText\n\t\t\t\t\terror={currentError}\n\t\t\t\t>\n\t\t\t\t\t{currentHelperText}\n\t\t\t\t</FormHelperText>\n\t\t\t)}\n\t\t</Grid>\n\t)\n}\n","import { Root } from \"@/componentPatterns/JsonForm/Root\"\nimport { ActionButton } from \"@/componentPatterns/JsonForm/ActionButton\"\nimport { ActionsButtons } from \"@/componentPatterns/JsonForm/ActionsButtons\"\nimport { Content } from \"@/componentPatterns/JsonForm/Content\"\n\nexport const JsonForm = {\n\tRoot,\n\tActionButton,\n\tActionsButtons,\n\tContent\n}\n","import { useState } from \"react\"\n\nexport type ValidationType = Record<string, unknown>\n\nconst useValidation = () => {\n\tconst [validation, setValidation] = useState<ValidationType>({})\n\n\tconst addValidation = (newValidation: ValidationType) => {\n\t\tsetValidation((lastValidation) => ({\n\t\t\t...lastValidation,\n\t\t\t...newValidation\n\t\t}))\n\t}\n\n\tconst clearValidation = (key: string) => {\n\t\tif (key in validation) {\n\t\t\tsetValidation((lastValidation) => {\n\t\t\t\tconst updatedData: ValidationType = { ...lastValidation }\n\n\t\t\t\tdelete updatedData[key]\n\n\t\t\t\treturn updatedData\n\t\t\t})\n\t\t}\n\t}\n\n\tconst clearAllValidations = () => {\n\t\tsetValidation({})\n\t}\n\n\treturn {\n\t\taddValidation,\n\t\tclearValidation,\n\t\tclearAllValidations,\n\t\tvalidation\n\t}\n}\n\nexport default useValidation\n","import React from \"react\"\nimport { IAceEditorProps } from \"react-ace\"\n\nimport { JsonForm } from \"@/componentPatterns/JsonForm\"\n\nimport {\n\tJsonValue,\n\tOverwrite\n} from \"@/componentPatterns/JsonForm/Content\"\n\ntype JsonViewProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n}>\n\nexport const JsonView: React.FC<JsonViewProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\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e,gBAAAC,EAAiB,WAAAC,CAAW,EAAIC,EAAc,EAE/DC,EAAiB,KAAK,UAAUV,EAAO,KAAM,CAAC,EAE9C,CAACW,EAAUC,CAAW,KAAI,YAAiBF,CAAc,EACzD,CAACG,EAAiBC,CAAkB,KAAI,YAAkB,EAAK,EAE/DC,EAAe,IAChBlB,KAAcW,GACbJ,GAEG,GAMHY,EAAoB,IACrBnB,KAAcW,GACbL,GAEG,qEAMHc,EAAgBC,GAAqB,CAC1CX,EAAgBV,CAAU,EAE1Be,EAAYM,CAAQ,EAEpBjB,IAAWiB,CAAQ,CACpB,EAEMC,EAAa,SAAY,CAG9B,GAFAL,EAAmB,EAAI,EAEnBZ,EACH,GAAI,CACH,IAAMkB,EAAgB,KAAK,MAAMT,CAAQ,EAEzC,MAAMT,EAAOkB,CAAa,CAC3B,OAAShB,EAAO,CACfE,EAAc,CAAE,CAACT,CAAU,EAAGO,CAAM,CAAC,CACtC,CAGDU,EAAmB,EAAK,CACzB,EAEA,SACC,QAACO,EAAS,KAAT,CACA,oBAACA,EAAS,QAAT,CACC,GAAGhB,EACJ,MAAOL,EACP,SAAUiB,EACV,aAAcF,EAAa,EAC3B,kBAAmBC,EAAkB,EACtC,KAEA,OAACK,EAAS,eAAT,CACA,mBAACA,EAAS,aAAT,CACA,OAAQF,EACR,QAASN,EACV,EACD,GACD,CAEF,EO9EG,IAAAS,EAAA,6BARUC,GAAqCC,GAAU,CAC3D,GAAM,CACL,MAAAC,EACA,GAAGC,CACJ,EAAIF,EAEJ,SACC,OAACG,EAAS,KAAT,CACA,mBAACA,EAAS,QAAT,CACC,GAAGD,EACJ,MAAOD,EACR,EACD,CAEF","names":["index_exports","__export","Button","JsonEditor","JsonView","__toCommonJS","import_jsx_runtime","Button","props","backgroundColor","label","size","primary","mode","import_react","import_material","import_jsx_runtime","Root","props","Grid","import_material","import_jsx_runtime","ActionButton","props","onSave","loading","import_material","import_jsx_runtime","ActionsButtons","props","Grid","import_react_ace","import_material","import_jsx_runtime","INPUT_NAME","Content","props","value","onChange","currentError","currentHelperText","rest","stringifyValue","Grid","AceEditor","JsonForm","Root","ActionButton","ActionsButtons","Content","import_react","useValidation","validation","setValidation","newValidation","lastValidation","key","updatedData","useValidation_default","import_jsx_runtime","INPUT_NAME","JsonEditor","props","value","onChange","onSave","helperText","error","rest","addValidation","clearValidation","validation","useValidation_default","stringifyValue","jsonData","setJsonData","loadingSaveJson","setLoadingSaveJson","currentError","currentHelperText","handleChange","newValue","handleSave","parseJsonData","JsonForm","import_jsx_runtime","JsonView","props","value","rest","JsonForm"]}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Button/index.tsx","../src/components/JsonEditor/index.tsx","../src/componentPatterns/JsonForm/Root.tsx","../src/componentPatterns/JsonForm/ActionButton.tsx","../src/componentPatterns/JsonForm/ActionsButtons.tsx","../src/componentPatterns/JsonForm/Content.tsx","../src/componentPatterns/JsonForm/index.ts","../src/hooks/useValidation.tsx","../src/components/JsonView/index.tsx"],"sourcesContent":["import React from \"react\"\n\nexport interface ButtonProps {\n\tprimary?: boolean\n\tbackgroundColor?: string\n\tsize?: \"small\" | \"medium\" | \"large\"\n\tlabel: string\n\tonClick?: () => void\n}\n\nexport const Button = (props: ButtonProps) => {\n\tconst {\n\t\tbackgroundColor,\n\t\tlabel,\n\t\tsize,\n\t\tprimary\n\t} = props\n\n\tconst mode = primary ? \"storybook-button--primary\" : \"storybook-button--secondary\"\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={[\"storybook-button\", `storybook-button--${size}`, mode].join(\"\")}\n\t\t\tstyle={{ backgroundColor }}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label}\n\t\t</button>\n\t)\n}\n","import React, { useState } from \"react\"\nimport { IAceEditorProps } from \"react-ace\"\n\nimport { JsonForm } from \"@/componentPatterns/JsonForm\"\nimport {\n\tJsonValue,\n\tOverwrite\n} from \"@/componentPatterns/JsonForm/Content\"\n\nimport useValidation from \"@/hooks/useValidation\"\n\ntype JsonEditorProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n\tonChange?: (value: string) => void\n\tonSave?: (value: JsonValue) => Promise<JsonValue>\n\thelperText?: string\n\terror?: boolean\n}>\n\nconst INPUT_NAME = \"json-editor\"\n\nexport const JsonEditor: React.FC<JsonEditorProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tonSave,\n\t\thelperText,\n\t\terror,\n\t\t...rest\n\t} = props\n\n\tconst { addValidation, clearValidation, validation } = useValidation()\n\n\tconst stringifyValue = JSON.stringify(value, null, 2)\n\n\tconst [jsonData, setJsonData] = useState<string>(stringifyValue)\n\tconst [loadingSaveJson, setLoadingSaveJson] = useState<boolean>(false)\n\n\tconst currentError = (): boolean => {\n\t\tif (INPUT_NAME in validation) {\n\t\t\tif (error) return error\n\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tconst currentHelperText = (): string => {\n\t\tif (INPUT_NAME in validation) {\n\t\t\tif (helperText) return helperText\n\n\t\t\treturn \"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.\"\n\t\t}\n\n\t\treturn \"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde.\"\n\t}\n\n\tconst handleChange = (newValue: string) => {\n\t\tclearValidation(INPUT_NAME)\n\n\t\tsetJsonData(newValue)\n\n\t\tonChange?.(newValue)\n\t}\n\n\tconst handleSave = async () => {\n\t\tsetLoadingSaveJson(true)\n\n\t\tif (onSave) {\n\t\t\ttry {\n\t\t\t\tconst parseJsonData = JSON.parse(jsonData)\n\n\t\t\t\tawait onSave(parseJsonData)\n\t\t\t} catch (error) {\n\t\t\t\taddValidation({ [INPUT_NAME]: error })\n\t\t\t}\n\t\t}\n\n\t\tsetLoadingSaveJson(false)\n\t}\n\n\treturn (\n\t\t<JsonForm.Root>\n\t\t\t<JsonForm.Content\n\t\t\t\t{...rest}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tcurrentError={currentError()}\n\t\t\t\tcurrentHelperText={currentHelperText()}\n\t\t\t/>\n\n\t\t\t<JsonForm.ActionsButtons>\n\t\t\t\t<JsonForm.ActionButton\n\t\t\t\t\tonSave={handleSave}\n\t\t\t\t\tloading={loadingSaveJson}\n\t\t\t\t/>\n\t\t\t</JsonForm.ActionsButtons>\n\t\t</JsonForm.Root>\n\t)\n}\n","import React from \"react\"\n\nimport {\n\tGrid2 as Grid\n} from \"@mui/material\"\n\ntype RootProps = {\n\tchildren: React.ReactNode\n}\n\nexport const Root: React.FC<RootProps> = (props) => {\n\treturn (\n\t\t<Grid\n\t\t\tcontainer\n\t\t\tdirection=\"column\"\n\t\t\tspacing={2}\n\t\t>\n\t\t\t{props.children}\n\t\t</Grid>\n\t)\n}\n","import React from \"react\"\n\nimport {\n\tButton,\n\tCircularProgress\n} from \"@mui/material\"\n\ntype ActionButtonProps = {\n\tonSave: () => void\n\tloading: boolean\n}\n\nexport const ActionButton: React.FC<ActionButtonProps> = (props) => {\n\tconst {\n\t\tonSave,\n\t\tloading\n\t} = props\n\n\tconst handleSave = () => {\n\t\tonSave()\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={handleSave}\n\t\t\tcolor=\"primary\"\n\t\t\tvariant=\"contained\"\n\t\t\tdisableElevation\n\t\t\tdisabled={loading}\n\t\t\tendIcon={loading && <CircularProgress size={20} color=\"inherit\" />}\n\t\t>\n\t\t\tSalvar\n\t\t</Button>\n\t)\n}\n","import React from \"react\"\nimport {\n\tGrid2 as Grid\n} from \"@mui/material\"\n\ntype ActionsButtonsProps = {\n\tchildren: React.ReactNode\n}\n\nexport const ActionsButtons: React.FC<ActionsButtonsProps> = (props) => {\n\treturn (\n\t\t<Grid\n\t\t\tcontainer\n\t\t\tjustify=\"flex-end\"\n\t\t>\n\t\t\t<Grid\n\t\t\t\titem\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</Grid>\n\t\t</Grid>\n\t)\n}\n","import React from \"react\"\nimport AceEditor, { IAceEditorProps } from \"react-ace\"\nimport {\n\tFormControl,\n\tFormHelperText,\n\tGrid2 as Grid\n} from \"@mui/material\"\n\nexport type JsonValue = Record<string | number, unknown>\n\nexport type Overwrite<T, NewT> = Omit<T, keyof NewT> & NewT;\n\nexport type ContentProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n\tonChange?: (updatedJson: string) => void\n\tcurrentError?: boolean\n\tcurrentHelperText?: string\n}>\n\nconst INPUT_NAME = \"json-editor\"\n\nexport const Content: React.FC<ContentProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tcurrentError,\n\t\tcurrentHelperText,\n\t\t...rest\n\t} = props\n\n\tconst stringifyValue = JSON.stringify(value, null, 2)\n\n\treturn (\n\t\t<Grid>\n\t\t\t<FormControl\n\t\t\t\terror={currentError}\n\t\t\t\tfullWidth\n\t\t\t>\n\t\t\t\t<AceEditor\n\t\t\t\t\t{...rest}\n\t\t\t\t\tname={INPUT_NAME}\n\t\t\t\t\tvalue={stringifyValue}\n\t\t\t\t\twrapEnabled={true}\n\t\t\t\t\tmode=\"json\"\n\t\t\t\t\ttheme=\"textmate\"\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tfontSize={16}\n\t\t\t\t\tshowPrintMargin={true}\n\t\t\t\t\tshowGutter={true}\n\t\t\t\t\thighlightActiveLine={true}\n\t\t\t\t\teditorProps={{ $blockScrolling: true }}\n\t\t\t\t\tsetOptions={{\n\t\t\t\t\t\tshowLineNumbers: true,\n\t\t\t\t\t\ttabSize: 2\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FormControl>\n\t\t\t{currentHelperText && (\n\t\t\t\t<FormHelperText\n\t\t\t\t\terror={currentError}\n\t\t\t\t>\n\t\t\t\t\t{currentHelperText}\n\t\t\t\t</FormHelperText>\n\t\t\t)}\n\t\t</Grid>\n\t)\n}\n","import { Root } from \"@/componentPatterns/JsonForm/Root\"\nimport { ActionButton } from \"@/componentPatterns/JsonForm/ActionButton\"\nimport { ActionsButtons } from \"@/componentPatterns/JsonForm/ActionsButtons\"\nimport { Content } from \"@/componentPatterns/JsonForm/Content\"\n\nexport const JsonForm = {\n\tRoot,\n\tActionButton,\n\tActionsButtons,\n\tContent\n}\n","import { useState } from \"react\"\n\nexport type ValidationType = Record<string, unknown>\n\nconst useValidation = () => {\n\tconst [validation, setValidation] = useState<ValidationType>({})\n\n\tconst addValidation = (newValidation: ValidationType) => {\n\t\tsetValidation((lastValidation) => ({\n\t\t\t...lastValidation,\n\t\t\t...newValidation\n\t\t}))\n\t}\n\n\tconst clearValidation = (key: string) => {\n\t\tif (key in validation) {\n\t\t\tsetValidation((lastValidation) => {\n\t\t\t\tconst updatedData: ValidationType = { ...lastValidation }\n\n\t\t\t\tdelete updatedData[key]\n\n\t\t\t\treturn updatedData\n\t\t\t})\n\t\t}\n\t}\n\n\tconst clearAllValidations = () => {\n\t\tsetValidation({})\n\t}\n\n\treturn {\n\t\taddValidation,\n\t\tclearValidation,\n\t\tclearAllValidations,\n\t\tvalidation\n\t}\n}\n\nexport default useValidation\n","import React from \"react\"\nimport { IAceEditorProps } from \"react-ace\"\n\nimport { JsonForm } from \"@/componentPatterns/JsonForm\"\n\nimport {\n\tJsonValue,\n\tOverwrite\n} from \"@/componentPatterns/JsonForm/Content\"\n\ntype JsonViewProps = Overwrite<IAceEditorProps, {\n\tvalue?: JsonValue | null\n}>\n\nexport const JsonView: React.FC<JsonViewProps> = (props) => {\n\tconst {\n\t\tvalue,\n\t\t...rest\n\t} = props\n\n\treturn (\n\t\t<JsonForm.Root>\n\t\t\t<JsonForm.Content\n\t\t\t\t{...rest}\n\t\t\t\tvalue={value}\n\t\t\t/>\n\t\t</JsonForm.Root>\n\t)\n}\n"],"mappings":"AAoBE,cAAAA,MAAA,oBAVK,IAAMC,EAAUC,GAAuB,CAC7C,GAAM,CACL,gBAAAC,EACA,MAAAC,EACA,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C,CAAkB,EAAIF,EAAkB,EAAK,EAE/DG,EAAe,IAChBnB,KAAcW,GACbJ,GAEG,GAMHa,EAAoB,IACrBpB,KAAcW,GACbL,GAEG,qEAMHe,EAAgBC,GAAqB,CAC1CZ,EAAgBV,CAAU,EAE1Be,EAAYO,CAAQ,EAEpBlB,IAAWkB,CAAQ,CACpB,EAEMC,EAAa,SAAY,CAG9B,GAFAL,EAAmB,EAAI,EAEnBb,EACH,GAAI,CACH,IAAMmB,EAAgB,KAAK,MAAMV,CAAQ,EAEzC,MAAMT,EAAOmB,CAAa,CAC3B,OAASjB,EAAO,CACfE,EAAc,CAAE,CAACT,CAAU,EAAGO,CAAM,CAAC,CACtC,CAGDW,EAAmB,EAAK,CACzB,EAEA,OACCnB,EAAC0B,EAAS,KAAT,CACA,UAAA3B,EAAC2B,EAAS,QAAT,CACC,GAAGjB,EACJ,MAAOL,EACP,SAAUkB,EACV,aAAcF,EAAa,EAC3B,kBAAmBC,EAAkB,EACtC,EAEAtB,EAAC2B,EAAS,eAAT,CACA,SAAA3B,EAAC2B,EAAS,aAAT,CACA,OAAQF,EACR,QAASN,EACV,EACD,GACD,CAEF,EO9EG,cAAAS,MAAA,oBARI,IAAMC,GAAqCC,GAAU,CAC3D,GAAM,CACL,MAAAC,EACA,GAAGC,CACJ,EAAIF,EAEJ,OACCF,EAACK,EAAS,KAAT,CACA,SAAAL,EAACK,EAAS,QAAT,CACC,GAAGD,EACJ,MAAOD,EACR,EACD,CAEF","names":["jsx","Button","props","backgroundColor","label","size","primary","mode","useState","Grid","jsx","Root","props","Button","CircularProgress","jsx","ActionButton","props","onSave","loading","Grid","jsx","ActionsButtons","props","AceEditor","FormControl","FormHelperText","Grid","jsx","jsxs","INPUT_NAME","Content","props","value","onChange","currentError","currentHelperText","rest","stringifyValue","JsonForm","Root","ActionButton","ActionsButtons","Content","useState","useValidation","validation","setValidation","newValidation","lastValidation","key","updatedData","useValidation_default","jsx","jsxs","INPUT_NAME","JsonEditor","props","value","onChange","onSave","helperText","error","rest","addValidation","clearValidation","validation","useValidation_default","stringifyValue","jsonData","setJsonData","useState","loadingSaveJson","setLoadingSaveJson","currentError","currentHelperText","handleChange","newValue","handleSave","parseJsonData","JsonForm","jsx","JsonView","props","value","rest","JsonForm"]}
|