letalkui 0.0.19 → 0.0.21
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.js +1 -1
- package/package.json +3 -5
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,o,i,u){try{var a=e[i](u);var l=a.value}catch(e){t(e);return}if(a.done){r(l)}else{Promise.resolve(l).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var u=e.apply(r,n);function a(e){t(u,o,i,a,l,"next",e)}function l(e){t(u,o,i,a,l,"throw",e)}a(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function i(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var u,a;try{for(t=t.call(e);!(o=(u=t.next()).done);o=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){i=true;a=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw a}}return n}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function c(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,r){if(e==null)return{};var t=f(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function f(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function d(e,t){return r(e)||i(e,t)||v(e,t)||u()}function b(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function v(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function y(e,r){var t,n,o,i,u={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(r){return l([e,r])}}function l(i){if(t)throw new TypeError("Generator is already executing.");while(u)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:u.label++;return{value:i[1],done:false};case 5:u.label++;n=i[1];i=[0];continue;case 7:i=u.ops.pop();u.trys.pop();continue;default:if(!(o=u.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){u=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(i[0]===6&&u.label<o[1]){u.label=o[1];o=i;break}if(o&&u.label<o[2]){u.label=o[2];u.ops.push(i);break}if(o[2])u.ops.pop();u.trys.pop();continue}i=r.call(e,u)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var p=Object.create;var h=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var x=function(e,r){for(var t in r)h(e,t,{get:r[t],enumerable:!0})},w=function(e,r,t,n){var o=true,i=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":b(r))=="object"||typeof r=="function")try{var a=function(){var o=c.value;!g.call(e,o)&&o!==t&&h(e,o,{get:function(){return r[o]},enumerable:!(n=m(r,o))||n.enumerable})};for(var l=j(r)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)a()}catch(e){i=true;u=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(i){throw u}}}return e};var S=function(e,r,t){return t=e!=null?p(O(e)):{},w(r||!e||!e.__esModule?h(t,"default",{value:e,enumerable:!0}):t,e)},P=function(e){return w(h({},"__esModule",{value:!0}),e)};var k={};x(k,{Button:function(){return q},JsonEditor:function(){return Q},JsonView:function(){return Y}});module.exports=P(k);var C=require("react/jsx-runtime"),q=function(e){var r=e.backgroundColor,t=e.label,n=e.size,o=e.primary,i=o?"storybook-button--primary":"storybook-button--secondary";return(0,C.jsx)("button",c(a({type:"button",className:["storybook-button","storybook-button--".concat(n),i].join(""),style:{backgroundColor:r}},e),{children:t}))};var E=require("react");var A=require("@mui/material"),J=require("react/jsx-runtime"),B=function(e){return(0,J.jsx)(A.Grid2,{container:!0,direction:"column",spacing:2,children:e.children})};var T=require("@mui/material"),V=require("react/jsx-runtime"),_=function(e){var r=e.onSave,t=e.loading;return(0,V.jsx)(T.Button,{onClick:function(){r()},color:"primary",variant:"contained",disableElevation:!0,disabled:t,endIcon:t&&(0,V.jsx)(T.CircularProgress,{size:20,color:"inherit"}),children:"Salvar"})};var D=require("@mui/material"),G=require("react/jsx-runtime"),N=function(e){return(0,G.jsx)(D.Grid2,{container:!0,justifyContent:"flex-end",children:(0,G.jsx)(D.Grid2,{size:12,children:e.children})})};var z=S(require("react-ace")),I=require("@mui/material"),H=require("react/jsx-runtime"),M="json-editor",R=function(e){var r=e.value,t=e.onChange,n=e.currentError,o=e.currentHelperText,i=s(e,["value","onChange","currentError","currentHelperText"]),u=JSON.stringify(r,null,2);return(0,H.jsxs)(I.Grid2,{children:[(0,H.jsx)(I.FormControl,{error:n,fullWidth:!0,children:(0,H.jsx)(z.default,c(a({},i),{name:M,value:u,wrapEnabled:!0,mode:"json",theme:"textmate",onChange:t,fontSize:16,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,editorProps:{$blockScrolling:!0},setOptions:{showLineNumbers:!0,tabSize:2}}))}),o&&(0,H.jsx)(I.FormHelperText,{error:n,children:o})]})};var F={Root:B,ActionButton:_,ActionsButtons:N,Content:R};var L=require("react"),U=function(){var e=d((0,L.useState)({}),2),r=e[0],t=e[1];return{addValidation:function(e){t(function(r){return a({},r,e)})},clearValidation:function(e){e in r&&t(function(r){var t=a({},r);return delete t[e],t})},clearAllValidations:function(){t({})},validation:r}},$=U;var W=require("react/jsx-runtime"),K="json-editor",Q=function(e){var r=e.value,t=e.onChange,i=e.onSave,u=e.helperText,l=e.error,f=s(e,["value","onChange","onSave","helperText","error"]),b=$(),v=b.addValidation,p=b.clearValidation,h=b.validation,m=JSON.stringify(r,null,2),j=d((0,E.useState)(m),2),O=j[0],g=j[1],x=d((0,E.useState)(!1),2),w=x[0],S=x[1],P=function(){return K in h&&l||!1},k=function(){return K in h&&u||"Ocorreu um erro inesperado. Por favor, tente novamente mais tarde."},C=function(e){p(K),g(e),t===null||t===void 0?void 0:t(e)},q=/*#__PURE__*/function(){var e=n(function(){var e,r;return y(this,function(t){switch(t.label){case 0:if(!(S(!0),i))return[3,4];t.label=1;case 1:t.trys.push([1,3,,4]);e=JSON.parse(O);return[4,i(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();v(o({},K,r));return[3,4];case 4:S(!1);return[2]}})});return function r(){return e.apply(this,arguments)}}();return(0,W.jsxs)(F.Root,{children:[(0,W.jsx)(F.Content,c(a({},f),{value:r,onChange:C,currentError:P(),currentHelperText:k()})),(0,W.jsx)(F.ActionsButtons,{children:(0,W.jsx)(F.ActionButton,{onSave:q,loading:w})})]})};var X=require("react/jsx-runtime"),Y=function(e){var r=e.value,t=s(e,["value"]);return(0,X.jsx)(F.Root,{children:(0,X.jsx)(F.Content,c(a({},t),{value:r}))})};0&&(module.exports={Button:Button,JsonEditor:JsonEditor,JsonView:JsonView});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letalkui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.21",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -22,12 +22,10 @@
|
|
|
22
22
|
"build": "tsup",
|
|
23
23
|
"build:storybook": "storybook build"
|
|
24
24
|
},
|
|
25
|
-
"
|
|
25
|
+
"dependencies": {
|
|
26
26
|
"@emotion/react": "^11.14.0",
|
|
27
27
|
"@emotion/styled": "^11.14.0",
|
|
28
|
-
"@mui/material": "^6.4.3"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
28
|
+
"@mui/material": "^6.4.3",
|
|
31
29
|
"react": "^18.3.1",
|
|
32
30
|
"react-ace": "^10.1.0",
|
|
33
31
|
"react-dom": "^18.3.1"
|