authscape 1.0.243 → 1.0.244
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/index.js +53 -17
- package/package.json +1 -1
- package/src/components/FileUploader.js +2 -0
- package/src/components/OEMEditor.js +30 -16
package/index.js
CHANGED
|
@@ -609,6 +609,8 @@ var FileUploader = function FileUploader(_ref) {
|
|
|
609
609
|
primaryColor = _ref$primaryColor === void 0 ? "#000" : _ref$primaryColor,
|
|
610
610
|
_ref$onConfirmDelete = _ref.onConfirmDelete,
|
|
611
611
|
onConfirmDelete = _ref$onConfirmDelete === void 0 ? null : _ref$onConfirmDelete,
|
|
612
|
+
_ref$accept = _ref.accept,
|
|
613
|
+
accept = _ref$accept === void 0 ? "" : _ref$accept,
|
|
612
614
|
_ref$variant = _ref.variant,
|
|
613
615
|
variant = _ref$variant === void 0 ? "filemanager" : _ref$variant,
|
|
614
616
|
_ref$onUploadComplete = _ref.onUploadCompleted,
|
|
@@ -804,6 +806,7 @@ var FileUploader = function FileUploader(_ref) {
|
|
|
804
806
|
type: "file",
|
|
805
807
|
name: "file",
|
|
806
808
|
multiple: multiple,
|
|
809
|
+
accept: accept,
|
|
807
810
|
ref: fileUploader,
|
|
808
811
|
onChange: handleUpload,
|
|
809
812
|
style: {
|
|
@@ -1483,10 +1486,14 @@ function OEMEditor(_ref) {
|
|
|
1483
1486
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
1484
1487
|
selectedFont = _useState10[0],
|
|
1485
1488
|
setSelectedFont = _useState10[1];
|
|
1486
|
-
var _useState11 = (0, _react.useState)(
|
|
1489
|
+
var _useState11 = (0, _react.useState)(null),
|
|
1487
1490
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
1488
|
-
|
|
1489
|
-
|
|
1491
|
+
fontUri = _useState12[0],
|
|
1492
|
+
setFontUri = _useState12[1];
|
|
1493
|
+
var _useState13 = (0, _react.useState)(''),
|
|
1494
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
1495
|
+
stateBaseUri = _useState14[0],
|
|
1496
|
+
setBaseUri = _useState14[1];
|
|
1490
1497
|
var handleChange = function handleChange(event, newValue) {
|
|
1491
1498
|
setValue(newValue);
|
|
1492
1499
|
};
|
|
@@ -1502,7 +1509,7 @@ function OEMEditor(_ref) {
|
|
|
1502
1509
|
while (1) switch (_context.prev = _context.next) {
|
|
1503
1510
|
case 0:
|
|
1504
1511
|
_context.next = 2;
|
|
1505
|
-
return apiService().get("/
|
|
1512
|
+
return apiService().get("/WhiteLabel/GetFonts");
|
|
1506
1513
|
case 2:
|
|
1507
1514
|
response = _context.sent;
|
|
1508
1515
|
if (response != null && response.status == 200) {
|
|
@@ -1510,7 +1517,7 @@ function OEMEditor(_ref) {
|
|
|
1510
1517
|
}
|
|
1511
1518
|
domain = GetBaseUrl();
|
|
1512
1519
|
_context.next = 7;
|
|
1513
|
-
return apiService().get("/
|
|
1520
|
+
return apiService().get("/WhiteLabel/GetFields?domain=" + domain + (companyId != null ? "&companyId=" + companyId : ""));
|
|
1514
1521
|
case 7:
|
|
1515
1522
|
responseFields = _context.sent;
|
|
1516
1523
|
if (responseFields != null && responseFields.status == 200) {
|
|
@@ -1545,8 +1552,8 @@ function OEMEditor(_ref) {
|
|
|
1545
1552
|
var columns = [{
|
|
1546
1553
|
field: "label",
|
|
1547
1554
|
headerName: "Fonts",
|
|
1548
|
-
width: 200,
|
|
1549
1555
|
editable: false,
|
|
1556
|
+
width: 300,
|
|
1550
1557
|
renderCell: function renderCell(params) {
|
|
1551
1558
|
var RenderData = function RenderData(row) {
|
|
1552
1559
|
// const { id, value, field } = params;
|
|
@@ -1554,7 +1561,8 @@ function OEMEditor(_ref) {
|
|
|
1554
1561
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1555
1562
|
sx: {
|
|
1556
1563
|
fontFamily: row.value,
|
|
1557
|
-
fontSize: 20
|
|
1564
|
+
fontSize: 20,
|
|
1565
|
+
cursor: "pointer"
|
|
1558
1566
|
}
|
|
1559
1567
|
}, row.value), /*#__PURE__*/_react["default"].createElement("link", {
|
|
1560
1568
|
href: "https://fonts.googleapis.com/css2?family=" + row.value,
|
|
@@ -1577,12 +1585,13 @@ function OEMEditor(_ref) {
|
|
|
1577
1585
|
baseUri = GetBaseUrl();
|
|
1578
1586
|
setBaseUri(baseUri);
|
|
1579
1587
|
_context2.next = 4;
|
|
1580
|
-
return apiService().get("/
|
|
1588
|
+
return apiService().get("/WhiteLabel/GetEditorData?domain=" + baseUri + (companyId != null ? "&companyId=" + companyId : ""));
|
|
1581
1589
|
case 4:
|
|
1582
1590
|
response = _context2.sent;
|
|
1583
1591
|
if (response.status == 200) {
|
|
1584
1592
|
setData(response.data);
|
|
1585
1593
|
setSelectedFont(response.data.fontFamily);
|
|
1594
|
+
setFontUri(response.data.fontUrl);
|
|
1586
1595
|
}
|
|
1587
1596
|
case 6:
|
|
1588
1597
|
case "end":
|
|
@@ -1600,7 +1609,7 @@ function OEMEditor(_ref) {
|
|
|
1600
1609
|
sx: {
|
|
1601
1610
|
width: '100%'
|
|
1602
1611
|
}
|
|
1603
|
-
}, selectedFont != null && /*#__PURE__*/_react["default"].createElement("link", {
|
|
1612
|
+
}, selectedFont != null && fontUri == null && /*#__PURE__*/_react["default"].createElement("link", {
|
|
1604
1613
|
href: "https://fonts.googleapis.com/css2?family=" + selectedFont,
|
|
1605
1614
|
rel: "stylesheet"
|
|
1606
1615
|
}), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
@@ -1637,7 +1646,8 @@ function OEMEditor(_ref) {
|
|
|
1637
1646
|
width: 200,
|
|
1638
1647
|
height: 200
|
|
1639
1648
|
}), /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
1640
|
-
url: "/
|
|
1649
|
+
url: "/WhiteLabel/UploadAppIcon",
|
|
1650
|
+
accept: ".jpg,.jpeg,.png,.gif",
|
|
1641
1651
|
params: {
|
|
1642
1652
|
domain: stateBaseUri
|
|
1643
1653
|
},
|
|
@@ -1671,7 +1681,7 @@ function OEMEditor(_ref) {
|
|
|
1671
1681
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1672
1682
|
case 0:
|
|
1673
1683
|
_context3.next = 2;
|
|
1674
|
-
return apiService().post("/
|
|
1684
|
+
return apiService().post("/WhiteLabel/SetFieldValue", {
|
|
1675
1685
|
id: dnsField.id,
|
|
1676
1686
|
fieldId: dnsField.fieldId,
|
|
1677
1687
|
value: hex
|
|
@@ -1702,7 +1712,8 @@ function OEMEditor(_ref) {
|
|
|
1702
1712
|
rows: fonts,
|
|
1703
1713
|
columns: columns,
|
|
1704
1714
|
sx: {
|
|
1705
|
-
height: "80vh"
|
|
1715
|
+
height: "80vh",
|
|
1716
|
+
width: "100%"
|
|
1706
1717
|
},
|
|
1707
1718
|
pagination: true,
|
|
1708
1719
|
disableSelectionOnClick: true,
|
|
@@ -1720,7 +1731,7 @@ function OEMEditor(_ref) {
|
|
|
1720
1731
|
case 0:
|
|
1721
1732
|
baseUri = GetBaseUrl();
|
|
1722
1733
|
_context4.next = 3;
|
|
1723
|
-
return apiService().post("/
|
|
1734
|
+
return apiService().post("/WhiteLabel/SetFont", {
|
|
1724
1735
|
companyId: companyId,
|
|
1725
1736
|
domain: baseUri,
|
|
1726
1737
|
value: params.row.label
|
|
@@ -1729,6 +1740,7 @@ function OEMEditor(_ref) {
|
|
|
1729
1740
|
response = _context4.sent;
|
|
1730
1741
|
if (response != null && response.status == 200) {
|
|
1731
1742
|
setSelectedFont(params.row.label);
|
|
1743
|
+
setFontUri(null);
|
|
1732
1744
|
notification("Font saved!");
|
|
1733
1745
|
}
|
|
1734
1746
|
case 5:
|
|
@@ -1743,11 +1755,35 @@ function OEMEditor(_ref) {
|
|
|
1743
1755
|
}()
|
|
1744
1756
|
}))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
1745
1757
|
item: true,
|
|
1746
|
-
xs: 6
|
|
1758
|
+
xs: 6
|
|
1759
|
+
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
1760
|
+
url: "/WhiteLabel/UploadCustomFont",
|
|
1761
|
+
accept: ".otf,.ttf,.woff",
|
|
1762
|
+
params: {
|
|
1763
|
+
domain: stateBaseUri
|
|
1764
|
+
},
|
|
1765
|
+
multiple: true,
|
|
1766
|
+
variant: "custom",
|
|
1767
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
1768
|
+
window.location.reload();
|
|
1769
|
+
}
|
|
1770
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
1771
|
+
color: "primary",
|
|
1772
|
+
variant: "contained",
|
|
1773
|
+
fullWidth: true,
|
|
1774
|
+
sx: {
|
|
1775
|
+
height: 50
|
|
1776
|
+
},
|
|
1777
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null)
|
|
1778
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], null, "Upload Font"), "\xA0", /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1779
|
+
sx: {
|
|
1780
|
+
textAlign: "center"
|
|
1781
|
+
}
|
|
1782
|
+
}, /*#__PURE__*/_react["default"].createElement("small", null, "(.OTF, .TTF, OR .WOFF)")))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1747
1783
|
sx: {
|
|
1748
1784
|
marginTop: 4
|
|
1749
1785
|
}
|
|
1750
|
-
},
|
|
1786
|
+
}, "Font Selected:"), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
1751
1787
|
sx: {
|
|
1752
1788
|
marginBottom: 2,
|
|
1753
1789
|
fontWeight: "bold",
|
|
@@ -1789,7 +1825,7 @@ function OEMEditor(_ref) {
|
|
|
1789
1825
|
case 0:
|
|
1790
1826
|
baseUri = GetBaseUrl();
|
|
1791
1827
|
_context5.next = 3;
|
|
1792
|
-
return apiService().post("/
|
|
1828
|
+
return apiService().post("/WhiteLabel/SetGlobalCSS", {
|
|
1793
1829
|
companyId: companyId,
|
|
1794
1830
|
domain: baseUri,
|
|
1795
1831
|
value: cssEditorRef.current.getValue()
|
|
@@ -1847,7 +1883,7 @@ function OEMEditor(_ref) {
|
|
|
1847
1883
|
case 0:
|
|
1848
1884
|
baseUri = GetBaseUrl();
|
|
1849
1885
|
_context6.next = 3;
|
|
1850
|
-
return apiService().post("/
|
|
1886
|
+
return apiService().post("/WhiteLabel/SetGlobalHTML", {
|
|
1851
1887
|
companyId: companyId,
|
|
1852
1888
|
domain: baseUri,
|
|
1853
1889
|
value: htmlEditorRef.current.getValue()
|
package/package.json
CHANGED
|
@@ -29,6 +29,7 @@ export const FileUploader = ({
|
|
|
29
29
|
refOveride = null,
|
|
30
30
|
primaryColor = "#000",
|
|
31
31
|
onConfirmDelete = null,
|
|
32
|
+
accept = "",
|
|
32
33
|
variant = "filemanager", // custom vs filemanager
|
|
33
34
|
onUploadCompleted = null
|
|
34
35
|
}) => {
|
|
@@ -165,6 +166,7 @@ export const FileUploader = ({
|
|
|
165
166
|
type="file"
|
|
166
167
|
name="file"
|
|
167
168
|
multiple={multiple}
|
|
169
|
+
accept={accept}
|
|
168
170
|
ref={fileUploader}
|
|
169
171
|
onChange={handleUpload}
|
|
170
172
|
style={{ display: "none" }}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
3
|
import Editor, { useMonaco } from "@monaco-editor/react";
|
|
3
4
|
import Button from '@mui/material/Button';
|
|
@@ -22,6 +23,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
22
23
|
const [fonts, setFonts] = useState([]);
|
|
23
24
|
const [dnsFields, setDnsFields] = useState([]);
|
|
24
25
|
const [selectedFont, setSelectedFont] = useState(null);
|
|
26
|
+
const [fontUri, setFontUri] = useState(null);
|
|
25
27
|
|
|
26
28
|
const [stateBaseUri, setBaseUri] = useState('');
|
|
27
29
|
|
|
@@ -39,14 +41,14 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
39
41
|
{
|
|
40
42
|
const fetchData = async () => {
|
|
41
43
|
|
|
42
|
-
let response = await apiService().get("/
|
|
44
|
+
let response = await apiService().get("/WhiteLabel/GetFonts");
|
|
43
45
|
if (response != null && response.status == 200)
|
|
44
46
|
{
|
|
45
47
|
setFonts(response.data);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
var domain = GetBaseUrl();
|
|
49
|
-
let responseFields = await apiService().get("/
|
|
51
|
+
let responseFields = await apiService().get("/WhiteLabel/GetFields?domain=" + domain + (companyId != null ? ("&companyId=" + companyId) : ""));
|
|
50
52
|
if (responseFields != null && responseFields.status == 200)
|
|
51
53
|
{
|
|
52
54
|
setDnsFields(responseFields.data);
|
|
@@ -73,21 +75,19 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
73
75
|
htmlEditorRef.current = editor;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
78
|
const columns = [
|
|
79
79
|
{
|
|
80
80
|
field: "label",
|
|
81
81
|
headerName: "Fonts",
|
|
82
|
-
width: 200,
|
|
83
82
|
editable: false,
|
|
83
|
+
width:300,
|
|
84
84
|
renderCell: (params) => {
|
|
85
85
|
const RenderData = (row) => {
|
|
86
86
|
// const { id, value, field } = params;
|
|
87
87
|
// const apiRef = useGridApiContext();
|
|
88
88
|
return (
|
|
89
89
|
<>
|
|
90
|
-
<Box sx={{fontFamily: row.value, fontSize:20}}>{row.value}</Box>
|
|
90
|
+
<Box sx={{fontFamily: row.value, fontSize:20, cursor:"pointer"}}>{row.value}</Box>
|
|
91
91
|
<link href={"https://fonts.googleapis.com/css2?family=" + row.value} rel="stylesheet"></link>
|
|
92
92
|
</>
|
|
93
93
|
);
|
|
@@ -108,11 +108,12 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
108
108
|
var baseUri = GetBaseUrl();
|
|
109
109
|
setBaseUri(baseUri);
|
|
110
110
|
|
|
111
|
-
let response = await apiService().get("/
|
|
111
|
+
let response = await apiService().get("/WhiteLabel/GetEditorData?domain=" + baseUri + (companyId != null ? ("&companyId=" + companyId) : ""));
|
|
112
112
|
if (response.status == 200)
|
|
113
113
|
{
|
|
114
114
|
setData(response.data);
|
|
115
115
|
setSelectedFont(response.data.fontFamily);
|
|
116
|
+
setFontUri(response.data.fontUrl);
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
fetchData();
|
|
@@ -123,7 +124,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
123
124
|
<>
|
|
124
125
|
<Box sx={{ width: '100%' }}>
|
|
125
126
|
|
|
126
|
-
{selectedFont != null &&
|
|
127
|
+
{(selectedFont != null && fontUri == null) &&
|
|
127
128
|
<link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
|
|
128
129
|
}
|
|
129
130
|
|
|
@@ -151,7 +152,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
151
152
|
<Image src={data.appIconUrl} width={200} height={200} />
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
<FileUploader url={"/
|
|
155
|
+
<FileUploader url={"/WhiteLabel/UploadAppIcon"} accept={".jpg,.jpeg,.png,.gif"} params={{
|
|
155
156
|
domain: stateBaseUri
|
|
156
157
|
}} multiple={true} variant='custom' onUploadCompleted={() => {
|
|
157
158
|
window.location.reload();
|
|
@@ -177,7 +178,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
177
178
|
|
|
178
179
|
<ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
|
|
179
180
|
|
|
180
|
-
await apiService().post("/
|
|
181
|
+
await apiService().post("/WhiteLabel/SetFieldValue", {
|
|
181
182
|
id: dnsField.id,
|
|
182
183
|
fieldId: dnsField.fieldId,
|
|
183
184
|
value: hex
|
|
@@ -209,7 +210,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
209
210
|
<DataGrid
|
|
210
211
|
rows={fonts}
|
|
211
212
|
columns={columns}
|
|
212
|
-
sx={{height:"80vh"}}
|
|
213
|
+
sx={{height:"80vh", width:"100%"}}
|
|
213
214
|
pagination
|
|
214
215
|
disableSelectionOnClick={true}
|
|
215
216
|
onPaginationModelChange={setPaginationModel}
|
|
@@ -220,7 +221,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
220
221
|
onRowClick={async (params) => {
|
|
221
222
|
|
|
222
223
|
var baseUri = GetBaseUrl();
|
|
223
|
-
let response = await apiService().post("/
|
|
224
|
+
let response = await apiService().post("/WhiteLabel/SetFont", {
|
|
224
225
|
companyId: companyId,
|
|
225
226
|
domain: baseUri,
|
|
226
227
|
value: params.row.label
|
|
@@ -228,6 +229,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
228
229
|
if (response != null && response.status == 200)
|
|
229
230
|
{
|
|
230
231
|
setSelectedFont(params.row.label);
|
|
232
|
+
setFontUri(null);
|
|
231
233
|
notification("Font saved!");
|
|
232
234
|
}
|
|
233
235
|
}}
|
|
@@ -237,8 +239,20 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
237
239
|
|
|
238
240
|
|
|
239
241
|
</Grid>
|
|
240
|
-
<Grid item xs={6}
|
|
241
|
-
|
|
242
|
+
<Grid item xs={6} >
|
|
243
|
+
|
|
244
|
+
<FileUploader url={"/WhiteLabel/UploadCustomFont"} accept={".otf,.ttf,.woff"} params={{
|
|
245
|
+
domain: stateBaseUri
|
|
246
|
+
}} multiple={true} variant='custom' onUploadCompleted={() => {
|
|
247
|
+
window.location.reload();
|
|
248
|
+
}}>
|
|
249
|
+
|
|
250
|
+
<Button color="primary" variant="contained" fullWidth={true} sx={{height:50}} startIcon={<PublishRoundedIcon/>}><Box>Upload Font</Box> <Box sx={{textAlign:"center"}}><small>(.OTF, .TTF, OR .WOFF)</small></Box></Button>
|
|
251
|
+
|
|
252
|
+
</FileUploader>
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
<Box sx={{marginTop:4}}>Font Selected:</Box>
|
|
242
256
|
<Box sx={{marginBottom:2, fontWeight:"bold", fontSize:20}}> {selectedFont}</Box>
|
|
243
257
|
<hr />
|
|
244
258
|
<Box sx={{fontFamily: selectedFont}}>
|
|
@@ -270,7 +284,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
270
284
|
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
271
285
|
|
|
272
286
|
var baseUri = GetBaseUrl();
|
|
273
|
-
let response = await apiService().post("/
|
|
287
|
+
let response = await apiService().post("/WhiteLabel/SetGlobalCSS", {
|
|
274
288
|
companyId: companyId,
|
|
275
289
|
domain: baseUri,
|
|
276
290
|
value: cssEditorRef.current.getValue()
|
|
@@ -314,7 +328,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
|
|
|
314
328
|
<Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
|
|
315
329
|
|
|
316
330
|
var baseUri = GetBaseUrl();
|
|
317
|
-
let response = await apiService().post("/
|
|
331
|
+
let response = await apiService().post("/WhiteLabel/SetGlobalHTML", {
|
|
318
332
|
companyId: companyId,
|
|
319
333
|
domain: baseUri,
|
|
320
334
|
value: htmlEditorRef.current.getValue()
|