code7-leia 0.2.22 → 0.2.24
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/code7-leia.cjs.development.js +60 -34
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +60 -34
- package/dist/code7-leia.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TestArea/components/TextArea/styles.tsx +5 -3
- package/src/components/TestArea/index.tsx +1 -1
- package/src/contexts/SharedPropsProvider.tsx +4 -3
package/dist/code7-leia.esm.js
CHANGED
|
@@ -1222,6 +1222,10 @@ var url = 'https://api.leia.digitalcontact.cloud';
|
|
|
1222
1222
|
axios.defaults.baseURL = "" + url;
|
|
1223
1223
|
var api = /*#__PURE__*/axios.create();
|
|
1224
1224
|
|
|
1225
|
+
var url$1 = 'http://localhost:5000';
|
|
1226
|
+
axios.defaults.baseURL = "" + url$1;
|
|
1227
|
+
var apiHml = /*#__PURE__*/axios.create();
|
|
1228
|
+
|
|
1225
1229
|
var _excluded$5 = ["children"];
|
|
1226
1230
|
var SharedPropsContext = /*#__PURE__*/createContext(undefined);
|
|
1227
1231
|
var useSharedProps = function useSharedProps() {
|
|
@@ -1235,7 +1239,8 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
|
|
|
1235
1239
|
var children = _ref.children,
|
|
1236
1240
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
1237
1241
|
var id = props.id,
|
|
1238
|
-
language = props.language
|
|
1242
|
+
language = props.language,
|
|
1243
|
+
env = props.env;
|
|
1239
1244
|
var _useState = useState(null),
|
|
1240
1245
|
tags = _useState[0],
|
|
1241
1246
|
setTags = _useState[1];
|
|
@@ -1245,68 +1250,94 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
|
|
|
1245
1250
|
useEffect(function () {
|
|
1246
1251
|
var fetchData = /*#__PURE__*/function () {
|
|
1247
1252
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1248
|
-
var
|
|
1253
|
+
var _ref3, data;
|
|
1249
1254
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1250
1255
|
while (1) switch (_context.prev = _context.next) {
|
|
1251
1256
|
case 0:
|
|
1252
1257
|
_context.prev = 0;
|
|
1253
|
-
|
|
1258
|
+
if (!(env.toLowerCase() === 'prod')) {
|
|
1259
|
+
_context.next = 7;
|
|
1260
|
+
break;
|
|
1261
|
+
}
|
|
1262
|
+
_context.next = 4;
|
|
1254
1263
|
return api.get("/tags/" + id);
|
|
1255
|
-
case
|
|
1256
|
-
|
|
1257
|
-
|
|
1264
|
+
case 4:
|
|
1265
|
+
_context.t0 = _context.sent;
|
|
1266
|
+
_context.next = 10;
|
|
1267
|
+
break;
|
|
1268
|
+
case 7:
|
|
1269
|
+
_context.next = 9;
|
|
1270
|
+
return apiHml.get("/tags/" + id);
|
|
1271
|
+
case 9:
|
|
1272
|
+
_context.t0 = _context.sent;
|
|
1273
|
+
case 10:
|
|
1274
|
+
_ref3 = _context.t0;
|
|
1275
|
+
data = _ref3.data;
|
|
1258
1276
|
if (data) {
|
|
1259
1277
|
setTags(data);
|
|
1260
1278
|
} else {
|
|
1261
1279
|
console.error('Erro ao fazer a solicitação');
|
|
1262
1280
|
}
|
|
1263
|
-
_context.next =
|
|
1281
|
+
_context.next = 18;
|
|
1264
1282
|
break;
|
|
1265
|
-
case
|
|
1266
|
-
_context.prev =
|
|
1267
|
-
_context.
|
|
1268
|
-
console.error('Erro ao fazer a solicitação:', _context.
|
|
1269
|
-
case
|
|
1283
|
+
case 15:
|
|
1284
|
+
_context.prev = 15;
|
|
1285
|
+
_context.t1 = _context["catch"](0);
|
|
1286
|
+
console.error('Erro ao fazer a solicitação:', _context.t1);
|
|
1287
|
+
case 18:
|
|
1270
1288
|
case "end":
|
|
1271
1289
|
return _context.stop();
|
|
1272
1290
|
}
|
|
1273
|
-
}, _callee, null, [[0,
|
|
1291
|
+
}, _callee, null, [[0, 15]]);
|
|
1274
1292
|
}));
|
|
1275
1293
|
return function fetchData() {
|
|
1276
1294
|
return _ref2.apply(this, arguments);
|
|
1277
1295
|
};
|
|
1278
1296
|
}();
|
|
1279
1297
|
var personas = /*#__PURE__*/function () {
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1298
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1299
|
+
var _ref5, data;
|
|
1282
1300
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1283
1301
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1284
1302
|
case 0:
|
|
1285
1303
|
_context2.prev = 0;
|
|
1286
|
-
|
|
1304
|
+
if (!(env.toLowerCase() === 'prod')) {
|
|
1305
|
+
_context2.next = 7;
|
|
1306
|
+
break;
|
|
1307
|
+
}
|
|
1308
|
+
_context2.next = 4;
|
|
1287
1309
|
return api.get("/personas?language=" + language);
|
|
1288
|
-
case
|
|
1289
|
-
|
|
1290
|
-
|
|
1310
|
+
case 4:
|
|
1311
|
+
_context2.t0 = _context2.sent;
|
|
1312
|
+
_context2.next = 10;
|
|
1313
|
+
break;
|
|
1314
|
+
case 7:
|
|
1315
|
+
_context2.next = 9;
|
|
1316
|
+
return apiHml.get("/personas?language=" + language);
|
|
1317
|
+
case 9:
|
|
1318
|
+
_context2.t0 = _context2.sent;
|
|
1319
|
+
case 10:
|
|
1320
|
+
_ref5 = _context2.t0;
|
|
1321
|
+
data = _ref5.data;
|
|
1291
1322
|
if (data) {
|
|
1292
1323
|
setPersonas(data);
|
|
1293
1324
|
} else {
|
|
1294
1325
|
console.error('Erro ao fazer a solicitação');
|
|
1295
1326
|
}
|
|
1296
|
-
_context2.next =
|
|
1327
|
+
_context2.next = 18;
|
|
1297
1328
|
break;
|
|
1298
|
-
case
|
|
1299
|
-
_context2.prev =
|
|
1300
|
-
_context2.
|
|
1301
|
-
console.error('Erro ao fazer a solicitação:', _context2.
|
|
1302
|
-
case
|
|
1329
|
+
case 15:
|
|
1330
|
+
_context2.prev = 15;
|
|
1331
|
+
_context2.t1 = _context2["catch"](0);
|
|
1332
|
+
console.error('Erro ao fazer a solicitação:', _context2.t1);
|
|
1333
|
+
case 18:
|
|
1303
1334
|
case "end":
|
|
1304
1335
|
return _context2.stop();
|
|
1305
1336
|
}
|
|
1306
|
-
}, _callee2, null, [[0,
|
|
1337
|
+
}, _callee2, null, [[0, 15]]);
|
|
1307
1338
|
}));
|
|
1308
1339
|
return function personas() {
|
|
1309
|
-
return
|
|
1340
|
+
return _ref4.apply(this, arguments);
|
|
1310
1341
|
};
|
|
1311
1342
|
}();
|
|
1312
1343
|
fetchData();
|
|
@@ -1836,9 +1867,9 @@ var Container$6 = /*#__PURE__*/styled.div(_templateObject$c || (_templateObject$
|
|
|
1836
1867
|
var marginBottom = _ref.marginBottom;
|
|
1837
1868
|
return marginBottom;
|
|
1838
1869
|
});
|
|
1839
|
-
var InputWrapper = /*#__PURE__*/styled.div(_templateObject2$8 || (_templateObject2$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n position: relative;\n\n .icon {\n position: absolute;\n color: #5a5d68;\n\n &.start-icon {\n left: 12px;\n }\n &.end-icon {\n right: 12px;\n }\n }\n\n & .pass-view {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n padding: 14px;\n font-size: 1rem;\n color: #5a5d68;\n }\n"])));
|
|
1870
|
+
var InputWrapper = /*#__PURE__*/styled.div(_templateObject2$8 || (_templateObject2$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n position: relative;\n margin-right: 5px;\n width: 300px;\n\n .icon {\n position: absolute;\n color: #5a5d68;\n\n &.start-icon {\n left: 12px;\n }\n &.end-icon {\n right: 12px;\n }\n }\n\n & .pass-view {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n padding: 14px;\n font-size: 1rem;\n color: #5a5d68;\n }\n"])));
|
|
1840
1871
|
var LabelWrapper = /*#__PURE__*/styled.label(_templateObject3$6 || (_templateObject3$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 8px;\n\n .label {\n display: block;\n color: #5a5d68;\n\n font-style: normal;\n font-weight: 600;\n font-size: 0.875rem;\n line-height: 114%;\n letter-spacing: -0.02em;\n }\n\n .description {\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n color: #5a5d68;\n display: block;\n }\n"])));
|
|
1841
|
-
var CustomTextArea = /*#__PURE__*/styled.textarea(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Monospace', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n letter-spacing: -0.02em;\n resize: vertical;\n padding: 8px 12px;\n\n border-radius: 4px;\n border: 1px solid #979aa5;\n color: #5a5d68 !important;\n width: 100%;\n\n background: #ffffff;\n transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out,\n border 0.2s ease-in-out;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n\n &:hover {\n border: 1px solid #102693;\n }\n &:active {\n border: 1px solid #102693;\n }\n &:disabled {\n border: 1px solid #dadce3;\n background: #f3f5f9;\n color: #dadce3;\n }\n\n &.small {\n
|
|
1872
|
+
var CustomTextArea = /*#__PURE__*/styled.textarea(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Monospace', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n letter-spacing: -0.02em;\n resize: vertical;\n padding: 8px 12px;\n\n border-radius: 4px;\n border: 1px solid #979aa5;\n color: #5a5d68 !important;\n width: 100%;\n\n background: #ffffff;\n transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out,\n border 0.2s ease-in-out;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n\n &:hover {\n border: 1px solid #102693;\n }\n &:active {\n border: 1px solid #102693;\n }\n &:disabled {\n border: 1px solid #dadce3;\n background: #f3f5f9;\n color: #dadce3;\n }\n\n &.small {\n height: 32px;\n }\n\n &.medium {\n height: 45px;\n }\n\n &.large {\n height: 48px;\n font-size: 1rem;\n }\n\n &.success {\n background: #e3f8cc;\n border: 1px solid #19660a;\n color: #19660a;\n }\n\n &.danger {\n background: #fae0d2;\n border: 1px solid #871821;\n color: #871821;\n }\n\n &.error {\n background: #fae0d2;\n border: 1px solid #871821;\n color: #871821;\n }\n\n &.has-start-icon {\n padding-left: 40px;\n }\n &.has-end-icon {\n padding-right: 40px;\n }\n"])));
|
|
1842
1873
|
var Helper = /*#__PURE__*/styled.div(_templateObject5$3 || (_templateObject5$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &.helper {\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n color: #5a5d68;\n display: block;\n margin-top: 4px;\n\n &.success {\n color: #19660a;\n }\n\n &.danger {\n color: #871821;\n }\n }\n"])));
|
|
1843
1874
|
var Error$1 = /*#__PURE__*/styled.div(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n display: block;\n margin-top: 4px;\n color: #871821;\n"])));
|
|
1844
1875
|
|
|
@@ -1972,7 +2003,6 @@ var TestArea = function TestArea() {
|
|
|
1972
2003
|
onSelect: handleSelectPersona
|
|
1973
2004
|
}), profile === "Custom" && React.createElement(TextArea, {
|
|
1974
2005
|
className: "textarea-message",
|
|
1975
|
-
label: "Prompt",
|
|
1976
2006
|
placeholder: t.testArea.typePrompt,
|
|
1977
2007
|
value: prompt,
|
|
1978
2008
|
onChange: function onChange(e) {
|
|
@@ -2098,10 +2128,6 @@ function filesReducer(state, action) {
|
|
|
2098
2128
|
});
|
|
2099
2129
|
}
|
|
2100
2130
|
|
|
2101
|
-
var url$1 = 'http://localhost:5000';
|
|
2102
|
-
axios.defaults.baseURL = "" + url$1;
|
|
2103
|
-
var apiHml = /*#__PURE__*/axios.create();
|
|
2104
|
-
|
|
2105
2131
|
var CustomToastContent = function CustomToastContent(_ref) {
|
|
2106
2132
|
var title = _ref.title,
|
|
2107
2133
|
description = _ref.description;
|