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
|
@@ -1230,6 +1230,10 @@ var url = 'https://api.leia.digitalcontact.cloud';
|
|
|
1230
1230
|
axios.defaults.baseURL = "" + url;
|
|
1231
1231
|
var api = /*#__PURE__*/axios.create();
|
|
1232
1232
|
|
|
1233
|
+
var url$1 = 'http://localhost:5000';
|
|
1234
|
+
axios.defaults.baseURL = "" + url$1;
|
|
1235
|
+
var apiHml = /*#__PURE__*/axios.create();
|
|
1236
|
+
|
|
1233
1237
|
var _excluded$5 = ["children"];
|
|
1234
1238
|
var SharedPropsContext = /*#__PURE__*/React.createContext(undefined);
|
|
1235
1239
|
var useSharedProps = function useSharedProps() {
|
|
@@ -1243,7 +1247,8 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
|
|
|
1243
1247
|
var children = _ref.children,
|
|
1244
1248
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
1245
1249
|
var id = props.id,
|
|
1246
|
-
language = props.language
|
|
1250
|
+
language = props.language,
|
|
1251
|
+
env = props.env;
|
|
1247
1252
|
var _useState = React.useState(null),
|
|
1248
1253
|
tags = _useState[0],
|
|
1249
1254
|
setTags = _useState[1];
|
|
@@ -1253,68 +1258,94 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
|
|
|
1253
1258
|
React.useEffect(function () {
|
|
1254
1259
|
var fetchData = /*#__PURE__*/function () {
|
|
1255
1260
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1256
|
-
var
|
|
1261
|
+
var _ref3, data;
|
|
1257
1262
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1258
1263
|
while (1) switch (_context.prev = _context.next) {
|
|
1259
1264
|
case 0:
|
|
1260
1265
|
_context.prev = 0;
|
|
1261
|
-
|
|
1266
|
+
if (!(env.toLowerCase() === 'prod')) {
|
|
1267
|
+
_context.next = 7;
|
|
1268
|
+
break;
|
|
1269
|
+
}
|
|
1270
|
+
_context.next = 4;
|
|
1262
1271
|
return api.get("/tags/" + id);
|
|
1263
|
-
case
|
|
1264
|
-
|
|
1265
|
-
|
|
1272
|
+
case 4:
|
|
1273
|
+
_context.t0 = _context.sent;
|
|
1274
|
+
_context.next = 10;
|
|
1275
|
+
break;
|
|
1276
|
+
case 7:
|
|
1277
|
+
_context.next = 9;
|
|
1278
|
+
return apiHml.get("/tags/" + id);
|
|
1279
|
+
case 9:
|
|
1280
|
+
_context.t0 = _context.sent;
|
|
1281
|
+
case 10:
|
|
1282
|
+
_ref3 = _context.t0;
|
|
1283
|
+
data = _ref3.data;
|
|
1266
1284
|
if (data) {
|
|
1267
1285
|
setTags(data);
|
|
1268
1286
|
} else {
|
|
1269
1287
|
console.error('Erro ao fazer a solicitação');
|
|
1270
1288
|
}
|
|
1271
|
-
_context.next =
|
|
1289
|
+
_context.next = 18;
|
|
1272
1290
|
break;
|
|
1273
|
-
case
|
|
1274
|
-
_context.prev =
|
|
1275
|
-
_context.
|
|
1276
|
-
console.error('Erro ao fazer a solicitação:', _context.
|
|
1277
|
-
case
|
|
1291
|
+
case 15:
|
|
1292
|
+
_context.prev = 15;
|
|
1293
|
+
_context.t1 = _context["catch"](0);
|
|
1294
|
+
console.error('Erro ao fazer a solicitação:', _context.t1);
|
|
1295
|
+
case 18:
|
|
1278
1296
|
case "end":
|
|
1279
1297
|
return _context.stop();
|
|
1280
1298
|
}
|
|
1281
|
-
}, _callee, null, [[0,
|
|
1299
|
+
}, _callee, null, [[0, 15]]);
|
|
1282
1300
|
}));
|
|
1283
1301
|
return function fetchData() {
|
|
1284
1302
|
return _ref2.apply(this, arguments);
|
|
1285
1303
|
};
|
|
1286
1304
|
}();
|
|
1287
1305
|
var personas = /*#__PURE__*/function () {
|
|
1288
|
-
var
|
|
1289
|
-
var
|
|
1306
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1307
|
+
var _ref5, data;
|
|
1290
1308
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1291
1309
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1292
1310
|
case 0:
|
|
1293
1311
|
_context2.prev = 0;
|
|
1294
|
-
|
|
1312
|
+
if (!(env.toLowerCase() === 'prod')) {
|
|
1313
|
+
_context2.next = 7;
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
_context2.next = 4;
|
|
1295
1317
|
return api.get("/personas?language=" + language);
|
|
1296
|
-
case
|
|
1297
|
-
|
|
1298
|
-
|
|
1318
|
+
case 4:
|
|
1319
|
+
_context2.t0 = _context2.sent;
|
|
1320
|
+
_context2.next = 10;
|
|
1321
|
+
break;
|
|
1322
|
+
case 7:
|
|
1323
|
+
_context2.next = 9;
|
|
1324
|
+
return apiHml.get("/personas?language=" + language);
|
|
1325
|
+
case 9:
|
|
1326
|
+
_context2.t0 = _context2.sent;
|
|
1327
|
+
case 10:
|
|
1328
|
+
_ref5 = _context2.t0;
|
|
1329
|
+
data = _ref5.data;
|
|
1299
1330
|
if (data) {
|
|
1300
1331
|
setPersonas(data);
|
|
1301
1332
|
} else {
|
|
1302
1333
|
console.error('Erro ao fazer a solicitação');
|
|
1303
1334
|
}
|
|
1304
|
-
_context2.next =
|
|
1335
|
+
_context2.next = 18;
|
|
1305
1336
|
break;
|
|
1306
|
-
case
|
|
1307
|
-
_context2.prev =
|
|
1308
|
-
_context2.
|
|
1309
|
-
console.error('Erro ao fazer a solicitação:', _context2.
|
|
1310
|
-
case
|
|
1337
|
+
case 15:
|
|
1338
|
+
_context2.prev = 15;
|
|
1339
|
+
_context2.t1 = _context2["catch"](0);
|
|
1340
|
+
console.error('Erro ao fazer a solicitação:', _context2.t1);
|
|
1341
|
+
case 18:
|
|
1311
1342
|
case "end":
|
|
1312
1343
|
return _context2.stop();
|
|
1313
1344
|
}
|
|
1314
|
-
}, _callee2, null, [[0,
|
|
1345
|
+
}, _callee2, null, [[0, 15]]);
|
|
1315
1346
|
}));
|
|
1316
1347
|
return function personas() {
|
|
1317
|
-
return
|
|
1348
|
+
return _ref4.apply(this, arguments);
|
|
1318
1349
|
};
|
|
1319
1350
|
}();
|
|
1320
1351
|
fetchData();
|
|
@@ -1844,9 +1875,9 @@ var Container$6 = /*#__PURE__*/styled__default.div(_templateObject$c || (_templa
|
|
|
1844
1875
|
var marginBottom = _ref.marginBottom;
|
|
1845
1876
|
return marginBottom;
|
|
1846
1877
|
});
|
|
1847
|
-
var InputWrapper = /*#__PURE__*/styled__default.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"])));
|
|
1878
|
+
var InputWrapper = /*#__PURE__*/styled__default.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"])));
|
|
1848
1879
|
var LabelWrapper = /*#__PURE__*/styled__default.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"])));
|
|
1849
|
-
var CustomTextArea = /*#__PURE__*/styled__default.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
|
|
1880
|
+
var CustomTextArea = /*#__PURE__*/styled__default.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"])));
|
|
1850
1881
|
var Helper = /*#__PURE__*/styled__default.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"])));
|
|
1851
1882
|
var Error$1 = /*#__PURE__*/styled__default.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"])));
|
|
1852
1883
|
|
|
@@ -1980,7 +2011,6 @@ var TestArea = function TestArea() {
|
|
|
1980
2011
|
onSelect: handleSelectPersona
|
|
1981
2012
|
}), profile === "Custom" && React__default.createElement(TextArea, {
|
|
1982
2013
|
className: "textarea-message",
|
|
1983
|
-
label: "Prompt",
|
|
1984
2014
|
placeholder: t.testArea.typePrompt,
|
|
1985
2015
|
value: prompt,
|
|
1986
2016
|
onChange: function onChange(e) {
|
|
@@ -2106,10 +2136,6 @@ function filesReducer(state, action) {
|
|
|
2106
2136
|
});
|
|
2107
2137
|
}
|
|
2108
2138
|
|
|
2109
|
-
var url$1 = 'http://localhost:5000';
|
|
2110
|
-
axios.defaults.baseURL = "" + url$1;
|
|
2111
|
-
var apiHml = /*#__PURE__*/axios.create();
|
|
2112
|
-
|
|
2113
2139
|
var CustomToastContent = function CustomToastContent(_ref) {
|
|
2114
2140
|
var title = _ref.title,
|
|
2115
2141
|
description = _ref.description;
|