code7-leia 0.1.116 → 0.1.118
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 +54 -27
- 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 +54 -27
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/components/TestArea/styles.d.ts +5 -1
- package/dist/store/modules/sagas.d.ts +8 -14
- package/package.json +1 -1
- package/src/components/FileArea/index.tsx +4 -2
- package/src/components/FileArea/styles.tsx +1 -1
- package/src/components/TestArea/index.tsx +2 -1
- package/src/components/TestArea/styles.tsx +38 -2
- package/src/store/modules/sagas.ts +6 -0
|
@@ -656,7 +656,7 @@ var getLanguage = function getLanguage(language) {
|
|
|
656
656
|
|
|
657
657
|
var _templateObject$1, _templateObject2$1, _templateObject3;
|
|
658
658
|
var Container = /*#__PURE__*/styled__default.div(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n\n\n .tag {\n padding: 4px 8px 4px 8px;\n background: #C7F9ED;\n border-radius: 4px;\n }\n\n .tags {\n display: flex;\n justify-content: left;\n gap: 4px;\n }\n\n .divDelete {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n }\n\n .buttonDelete {\n color: #5b0a1f;\n background: #fae0d2;\n padding: 12px 20px;\n border-radius: 4px;\n }\n\n .buttonDelete:hover {\n background: #f5bba7;\n }\n\n .button {\n padding: 8px 16px 8px 16px;\n border-radius: 4px;\n gap: 10px;\n }\n\n .cancel {\n background: #F3F5F9;\n color: #5A5D68;\n }\n\n .send {\n background: #102693;\n color: white;\n }\n\n .delete {\n background: #871821;\n color: white;\n }\n\n .presset {\n padding-top: 10px;\n display: flex;\n flex-direction: column;\n }\n\n #warning {\n padding: 10px;\n background: #FAE0D2;\n color: #871821;\n }\n"])), function (props) {
|
|
659
|
-
return props.isLoading && styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n #loading {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color:
|
|
659
|
+
return props.isLoading && styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n #loading {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgb(151,154,165, 0.7);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n }\n\n #loading::after {\n content: \"\";\n border: 4px solid #f3f3f3; /* Cor do s\xEDmbolo de carregamento */\n border-top: 4px solid #3498db; /* Cor do s\xEDmbolo de carregamento */\n border-radius: 50%;\n width: 30px;\n height: 30px;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "])));
|
|
660
660
|
});
|
|
661
661
|
var Header = /*#__PURE__*/styled__default.div(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n\n .actions {\n display: flex;\n justify-content: space-between;\n padding-bottom: 14px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n }\n }\n\n"])));
|
|
662
662
|
|
|
@@ -1349,8 +1349,6 @@ var FileArea = function FileArea() {
|
|
|
1349
1349
|
if (!!initFiles) {
|
|
1350
1350
|
setFiles(initFiles);
|
|
1351
1351
|
setInitialFiles(initFiles);
|
|
1352
|
-
setModal(false);
|
|
1353
|
-
setModalDelete(false);
|
|
1354
1352
|
}
|
|
1355
1353
|
}, [initFiles]);
|
|
1356
1354
|
var optionsPresset = tags.map(function (tag) {
|
|
@@ -1376,9 +1374,13 @@ var FileArea = function FileArea() {
|
|
|
1376
1374
|
};
|
|
1377
1375
|
var deleteFile = function deleteFile() {
|
|
1378
1376
|
dispatch(deleteFilesAction(fileDelete, id, language));
|
|
1377
|
+
setModalDelete(false);
|
|
1379
1378
|
};
|
|
1380
1379
|
var handleUploadFile = function handleUploadFile() {
|
|
1381
1380
|
dispatch(uploadFilesAction(uploadFile, id, [presset], language));
|
|
1381
|
+
setModal(false);
|
|
1382
|
+
setUploadFile(undefined);
|
|
1383
|
+
setPresset('');
|
|
1382
1384
|
};
|
|
1383
1385
|
var renderFiles = function renderFiles() {
|
|
1384
1386
|
return React__default.createElement(Container, {
|
|
@@ -1487,11 +1489,13 @@ var FileArea = function FileArea() {
|
|
|
1487
1489
|
}, React__default.createElement(Container, null, renderFiles()));
|
|
1488
1490
|
};
|
|
1489
1491
|
|
|
1490
|
-
var _templateObject$8, _templateObject2$4, _templateObject3$3, _templateObject4$1;
|
|
1491
|
-
var Container$4 = /*#__PURE__*/styled__default.div(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\n"])))
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
var
|
|
1492
|
+
var _templateObject$8, _templateObject2$4, _templateObject3$3, _templateObject4$1, _templateObject5$1;
|
|
1493
|
+
var Container$4 = /*#__PURE__*/styled__default.div(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n\n"])), function (props) {
|
|
1494
|
+
return props.isLoading && styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n #loading {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgb(151,154,165, 0.7);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n }\n\n #loading::after {\n content: \"\";\n border: 4px solid #f3f3f3; /* Cor do s\xEDmbolo de carregamento */\n border-top: 4px solid #3498db; /* Cor do s\xEDmbolo de carregamento */\n border-radius: 50%;\n width: 30px;\n height: 30px;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "])));
|
|
1495
|
+
});
|
|
1496
|
+
var Header$1 = /*#__PURE__*/styled__default.div(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n .infos {\n display: flex;\n flex-direction: column;\n padding: 14px 0;\n\n h2 {\n font-size: 20px\n }\n\n p {\n font-size: 14px\n }\n }\n"])));
|
|
1497
|
+
var Inputs = /*#__PURE__*/styled__default.div(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 10px;\n\n button {\n background: #102693;\n padding: 10px 20px;\n color: white;\n border-radius: 4px;\n width: 190px;\n height: 40px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n width: 23px;\n height: 23px;\n }\n }\n"])));
|
|
1498
|
+
var Result = /*#__PURE__*/styled__default.div(_templateObject5$1 || (_templateObject5$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: left;\n background: #F3F5F9;\n padding: 15px;\n border-radius: 5px;\n margin-top: 15px;\n\n .text{\n margin-left: 5px;\n font-size: 14px;\n line-height: 1.5;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 5px;\n\n svg {\n width: 35px;\n height: 35px;\n }\n }\n\n"])));
|
|
1495
1499
|
|
|
1496
1500
|
var _templateObject$9, _templateObject2$5, _templateObject3$4, _templateObject4$2;
|
|
1497
1501
|
var Container$5 = /*#__PURE__*/styled__default.div(_templateObject$9 || (_templateObject$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n margin-right: 5px;\n"])));
|
|
@@ -1524,6 +1528,9 @@ var TestArea = function TestArea() {
|
|
|
1524
1528
|
var results = reactRedux.useSelector(function (state) {
|
|
1525
1529
|
return state.message;
|
|
1526
1530
|
});
|
|
1531
|
+
var isLoading = reactRedux.useSelector(function (state) {
|
|
1532
|
+
return state.isLoading;
|
|
1533
|
+
});
|
|
1527
1534
|
var _useState = React.useState(''),
|
|
1528
1535
|
search = _useState[0],
|
|
1529
1536
|
setSearch = _useState[1];
|
|
@@ -1569,7 +1576,9 @@ var TestArea = function TestArea() {
|
|
|
1569
1576
|
tags: []
|
|
1570
1577
|
},
|
|
1571
1578
|
personas: personas
|
|
1572
|
-
}, React__default.createElement(Container$4,
|
|
1579
|
+
}, React__default.createElement(Container$4, {
|
|
1580
|
+
isLoading: isLoading
|
|
1581
|
+
}, React__default.createElement(Header$1, null, React__default.createElement("div", {
|
|
1573
1582
|
className: 'infos'
|
|
1574
1583
|
}, React__default.createElement("h2", null, t.test), React__default.createElement("p", null, t.testArea.description))), React__default.createElement(Inputs, null, React__default.createElement(InputTest, {
|
|
1575
1584
|
placeholder: t.testArea.typeSentence,
|
|
@@ -1741,28 +1750,37 @@ function getFilesSaga(action) {
|
|
|
1741
1750
|
while (1) switch (_context.prev = _context.next) {
|
|
1742
1751
|
case 0:
|
|
1743
1752
|
_context.prev = 0;
|
|
1753
|
+
_context.next = 3;
|
|
1754
|
+
return effects.put(commonLoadingStart());
|
|
1755
|
+
case 3:
|
|
1744
1756
|
id = action.payload.id;
|
|
1745
|
-
_context.next =
|
|
1757
|
+
_context.next = 6;
|
|
1746
1758
|
return effects.call(api.get, "/files/" + id);
|
|
1747
|
-
case
|
|
1759
|
+
case 6:
|
|
1748
1760
|
_yield$call = _context.sent;
|
|
1749
1761
|
data = _yield$call.data;
|
|
1750
|
-
_context.next =
|
|
1762
|
+
_context.next = 10;
|
|
1751
1763
|
return effects.put(getFilesActionSuccess({
|
|
1752
1764
|
files: data.files
|
|
1753
1765
|
}));
|
|
1754
|
-
case 8:
|
|
1755
|
-
_context.next = 13;
|
|
1756
|
-
break;
|
|
1757
1766
|
case 10:
|
|
1758
|
-
_context.
|
|
1767
|
+
_context.next = 15;
|
|
1768
|
+
break;
|
|
1769
|
+
case 12:
|
|
1770
|
+
_context.prev = 12;
|
|
1759
1771
|
_context.t0 = _context["catch"](0);
|
|
1760
1772
|
console.log('-----------getFiles.error------------------->', _context.t0);
|
|
1761
|
-
case
|
|
1773
|
+
case 15:
|
|
1774
|
+
_context.prev = 15;
|
|
1775
|
+
_context.next = 18;
|
|
1776
|
+
return effects.put(commonLoadingFinish());
|
|
1777
|
+
case 18:
|
|
1778
|
+
return _context.finish(15);
|
|
1779
|
+
case 19:
|
|
1762
1780
|
case "end":
|
|
1763
1781
|
return _context.stop();
|
|
1764
1782
|
}
|
|
1765
|
-
}, _marked, null, [[0,
|
|
1783
|
+
}, _marked, null, [[0, 12, 15, 19]]);
|
|
1766
1784
|
}
|
|
1767
1785
|
function deleteFilesSaga(action) {
|
|
1768
1786
|
var t, _action$payload, id, name, _yield$call2, data;
|
|
@@ -1817,33 +1835,42 @@ function testSaga(action) {
|
|
|
1817
1835
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1818
1836
|
case 0:
|
|
1819
1837
|
_context3.prev = 0;
|
|
1838
|
+
_context3.next = 3;
|
|
1839
|
+
return effects.put(commonLoadingStart());
|
|
1840
|
+
case 3:
|
|
1820
1841
|
_action$payload2 = action.payload, question = _action$payload2.question, profile = _action$payload2.profile, presset = _action$payload2.presset, files_directory = _action$payload2.files_directory;
|
|
1821
|
-
_context3.next =
|
|
1842
|
+
_context3.next = 6;
|
|
1822
1843
|
return effects.call(api.post, "/ask", {
|
|
1823
1844
|
question: question,
|
|
1824
1845
|
profile: profile,
|
|
1825
1846
|
tag: presset,
|
|
1826
1847
|
files_directory: files_directory
|
|
1827
1848
|
});
|
|
1828
|
-
case
|
|
1849
|
+
case 6:
|
|
1829
1850
|
_yield$call3 = _context3.sent;
|
|
1830
1851
|
data = _yield$call3.data;
|
|
1831
|
-
_context3.next =
|
|
1852
|
+
_context3.next = 10;
|
|
1832
1853
|
return effects.put(testActionSuccess({
|
|
1833
1854
|
message: data.message
|
|
1834
1855
|
}));
|
|
1835
|
-
case 8:
|
|
1836
|
-
_context3.next = 13;
|
|
1837
|
-
break;
|
|
1838
1856
|
case 10:
|
|
1839
|
-
_context3.
|
|
1857
|
+
_context3.next = 15;
|
|
1858
|
+
break;
|
|
1859
|
+
case 12:
|
|
1860
|
+
_context3.prev = 12;
|
|
1840
1861
|
_context3.t0 = _context3["catch"](0);
|
|
1841
1862
|
console.log('-----------testSaga.error------------------->', _context3.t0);
|
|
1842
|
-
case
|
|
1863
|
+
case 15:
|
|
1864
|
+
_context3.prev = 15;
|
|
1865
|
+
_context3.next = 18;
|
|
1866
|
+
return effects.put(commonLoadingFinish());
|
|
1867
|
+
case 18:
|
|
1868
|
+
return _context3.finish(15);
|
|
1869
|
+
case 19:
|
|
1843
1870
|
case "end":
|
|
1844
1871
|
return _context3.stop();
|
|
1845
1872
|
}
|
|
1846
|
-
}, _marked3, null, [[0,
|
|
1873
|
+
}, _marked3, null, [[0, 12, 15, 19]]);
|
|
1847
1874
|
}
|
|
1848
1875
|
function uploadFilesSaga(action) {
|
|
1849
1876
|
var t, _action$payload3, id, file, pressets, tags, blob, formData, queryParams, _yield$call4, data;
|