@flozy/editor 5.3.6 → 5.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +14 -8
- package/dist/Editor/Editor.css +58 -22
- package/dist/Editor/Elements/Accordion/Accordion.js +8 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
- package/dist/Editor/Elements/Button/EditorButton.js +9 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +4 -2
- package/dist/Editor/Elements/DataView/DataView.js +124 -0
- package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +67 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +33 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +162 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +40 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +67 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +35 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +39 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +29 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +74 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +64 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +106 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +174 -0
- package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +37 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +111 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +60 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +36 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +160 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +190 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +42 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +179 -0
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +112 -0
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +227 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +80 -0
- package/dist/Editor/Elements/DataView/Layouts/colStyles.js +10 -0
- package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +281 -0
- package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +74 -0
- package/dist/Editor/Elements/DataView/styles.js +154 -0
- package/dist/Editor/Elements/Divider/Divider.js +24 -9
- package/dist/Editor/Elements/Embed/Image.js +31 -12
- package/dist/Editor/Elements/Embed/Video.js +13 -2
- package/dist/Editor/Elements/Form/Form.js +1 -0
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +2 -1
- package/dist/Editor/Elements/Grid/GridItem.js +2 -0
- package/dist/Editor/Elements/Grid/Styles.js +44 -0
- package/dist/Editor/Elements/List/CheckList.js +2 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
- package/dist/Editor/Elements/Signature/SignaturePopup.js +4 -4
- package/dist/Editor/Elements/SimpleText/index.js +8 -1
- package/dist/Editor/Elements/SimpleText/style.js +10 -1
- package/dist/Editor/Elements/Table/Table.js +2 -4
- package/dist/Editor/Elements/Table/TableCell.js +5 -10
- package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -1
- package/dist/Editor/MiniEditor.js +15 -1
- package/dist/Editor/Styles/EditorStyles.js +5 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +17 -1
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -3
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +210 -72
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +56 -8
- package/dist/Editor/Toolbar/Toolbar.js +6 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
- package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
- package/dist/Editor/common/ColorPickerButton.js +5 -3
- package/dist/Editor/common/DnD/Draggable.js +2 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
- package/dist/Editor/common/Icon.js +6 -0
- package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -1
- package/dist/Editor/common/ImageSelector/Styles.js +47 -6
- package/dist/Editor/common/ImageSelector/UploadStyles.js +18 -6
- package/dist/Editor/common/MentionsPopup/Styles.js +109 -122
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
- package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
- package/dist/Editor/common/RnD/ShadowElement.js +1 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +9 -6
- package/dist/Editor/common/RnD/index.js +2 -1
- package/dist/Editor/common/Section/index.js +3 -3
- package/dist/Editor/common/Section/styles.js +5 -1
- package/dist/Editor/common/Shorthands/elements.js +13 -1
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +9 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +27 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +2 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +4 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +22 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +21 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +15 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -0
- package/dist/Editor/common/StyleBuilder/index.js +17 -9
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/ToolbarIcon.js +1 -1
- package/dist/Editor/common/Uploader.js +46 -36
- package/dist/Editor/common/iconListV2.js +348 -130
- package/dist/Editor/common/iconslist.js +6 -3
- package/dist/Editor/commonStyle.js +290 -4
- package/dist/Editor/helper/deserialize/index.js +19 -23
- package/dist/Editor/helper/enforceDateFormat.js +41 -0
- package/dist/Editor/helper/index.js +16 -3
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/hooks/useTable.js +22 -19
- package/dist/Editor/plugins/withCustomDeleteBackward.js +33 -2
- package/dist/Editor/plugins/withEmbeds.js +30 -26
- package/dist/Editor/utils/SlateUtilityFunctions.js +27 -4
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/dataView.js +43 -0
- package/dist/Editor/utils/helper.js +50 -10
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/package.json +2 -2
@@ -26,7 +26,7 @@ import editorStyles from "./Styles/EditorStyles";
|
|
26
26
|
import DragAndDrop from "./common/DnD";
|
27
27
|
import Section from "./common/Section";
|
28
28
|
import decorators from "./utils/Decorators";
|
29
|
-
import { getTRBLBreakPoints } from "./helper/theme";
|
29
|
+
import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
|
30
30
|
import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
|
31
31
|
import useWindowResize from "./hooks/useWindowResize";
|
32
32
|
import PopoverAIInput from "./Elements/AI/PopoverAIInput";
|
@@ -139,7 +139,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
139
139
|
pageColor,
|
140
140
|
color: pageTextColor,
|
141
141
|
pageWidth,
|
142
|
-
maxWidth: pageMaxWidth
|
142
|
+
maxWidth: pageMaxWidth,
|
143
|
+
lineHeight
|
143
144
|
} = pageSt?.pageProps || {
|
144
145
|
bannerSpacing: {
|
145
146
|
left: 0,
|
@@ -307,11 +308,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
307
308
|
hideTools: updatedHideTools || []
|
308
309
|
}) : [];
|
309
310
|
const handleEditorChange = newValue => {
|
310
|
-
if (
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
311
|
+
if (!readOnly) {
|
312
|
+
if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
|
313
|
+
updateTopBanner(newValue, setTopBanner);
|
314
|
+
debounced(newValue);
|
315
|
+
if (!isInteracted) {
|
316
|
+
setIsInteracted(true);
|
317
|
+
}
|
315
318
|
}
|
316
319
|
}
|
317
320
|
};
|
@@ -330,6 +333,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
330
333
|
onDrawerOpen: onDrawerOpen,
|
331
334
|
ICON_API: "https://assets.agenciflow.com"
|
332
335
|
};
|
336
|
+
const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
|
333
337
|
const renderElement = useCallback(props => {
|
334
338
|
return /*#__PURE__*/_jsx(Element, {
|
335
339
|
...props,
|
@@ -532,6 +536,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
532
536
|
padding: {
|
533
537
|
...getTRBLBreakPoints(bannerSpacing)
|
534
538
|
},
|
539
|
+
lineHeight: lineH,
|
535
540
|
width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
|
536
541
|
height: viewport.h ? `${viewport.h}px` : `100%`,
|
537
542
|
alignSelf: "center",
|
@@ -589,8 +594,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
589
594
|
setIsTextSelected: setIsTextSelected,
|
590
595
|
customProps: customProps,
|
591
596
|
editorWrapper: editorWrapper
|
592
|
-
}) : null, !readOnly
|
597
|
+
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
593
598
|
breakpoint: breakpoint,
|
599
|
+
show: showViewport,
|
594
600
|
onChange: b => onSwitchBreakpoint(b)
|
595
601
|
}) : null]
|
596
602
|
})
|
package/dist/Editor/Editor.css
CHANGED
@@ -31,7 +31,7 @@ blockquote {
|
|
31
31
|
border-left: 3px solid transparent;
|
32
32
|
margin-left: 0;
|
33
33
|
margin-right: 0;
|
34
|
-
padding-left: 10px;
|
34
|
+
/* padding-left: 10px; */
|
35
35
|
margin: 0px;
|
36
36
|
}
|
37
37
|
|
@@ -149,7 +149,7 @@ blockquote {
|
|
149
149
|
.grid-item-toolbar button,
|
150
150
|
.element-toolbar button,
|
151
151
|
.element-toolbar a {
|
152
|
-
border-radius:
|
152
|
+
border-radius: 50%;
|
153
153
|
border: 1px solid rgba(37, 99, 235, 0.32);
|
154
154
|
background: #fff;
|
155
155
|
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.16);
|
@@ -225,9 +225,13 @@ blockquote {
|
|
225
225
|
background-color: #0052cc;
|
226
226
|
padding: 8px 12px;
|
227
227
|
color: #ffffff;
|
228
|
-
font-weight:
|
228
|
+
font-weight: 600;
|
229
|
+
font-size: 14px;
|
229
230
|
opacity: 1;
|
230
231
|
border-radius: 32px;
|
232
|
+
text-transform: math-auto;
|
233
|
+
height: 36px;
|
234
|
+
padding: 0px 12px;
|
231
235
|
}
|
232
236
|
|
233
237
|
.signature-btn-container button:hover {
|
@@ -358,6 +362,10 @@ blockquote {
|
|
358
362
|
stroke: #2563eb;
|
359
363
|
}
|
360
364
|
|
365
|
+
.brushIcon:hover {
|
366
|
+
background: unset;
|
367
|
+
}
|
368
|
+
|
361
369
|
.react-datepicker__input-container {
|
362
370
|
display: flex !important;
|
363
371
|
align-items: center;
|
@@ -491,6 +499,14 @@ blockquote {
|
|
491
499
|
text-transform: none;
|
492
500
|
}
|
493
501
|
|
502
|
+
.MuiButton-root.primaryBtn:disabled {
|
503
|
+
background: #eee !important;
|
504
|
+
box-shadow: none !important;
|
505
|
+
color: #ccc !important;
|
506
|
+
border: 1px solid #ccc !important;
|
507
|
+
cursor: not-allowed;
|
508
|
+
}
|
509
|
+
|
494
510
|
.MuiButton-root.primaryBtn.disabled,
|
495
511
|
.MuiButton-root.secondaryBtn.disabled {
|
496
512
|
background: #eee;
|
@@ -516,7 +532,7 @@ blockquote {
|
|
516
532
|
}
|
517
533
|
|
518
534
|
.deleteBtn {
|
519
|
-
background: #
|
535
|
+
background: #d32f2f ;
|
520
536
|
border: 1px solid #d32f2f !important;
|
521
537
|
box-shadow: 0px 8px 24px rgba(30, 64, 175, 0.08);
|
522
538
|
border-radius: 8px !important;
|
@@ -526,6 +542,7 @@ blockquote {
|
|
526
542
|
margin-right: 15px !important;
|
527
543
|
color: #d32f2f;
|
528
544
|
width: auto !important;
|
545
|
+
text-transform: capitalize !important;
|
529
546
|
}
|
530
547
|
|
531
548
|
@media (max-width: 480px) {
|
@@ -663,7 +680,8 @@ blockquote {
|
|
663
680
|
}
|
664
681
|
|
665
682
|
.resize-br.img-resizer {
|
666
|
-
bottom:
|
683
|
+
bottom: 10px;
|
684
|
+
right: 5px;
|
667
685
|
}
|
668
686
|
|
669
687
|
.visible-on-hover {
|
@@ -1023,11 +1041,11 @@ blockquote {
|
|
1023
1041
|
width: 200px;
|
1024
1042
|
cursor: pointer;
|
1025
1043
|
color: #464646;
|
1026
|
-
background-color: #fff;
|
1044
|
+
/* background-color: #fff; */
|
1027
1045
|
padding: 4px 6px;
|
1028
1046
|
border-radius: 12px;
|
1029
1047
|
span {
|
1030
|
-
text-transform:
|
1048
|
+
text-transform: math-auto;
|
1031
1049
|
}
|
1032
1050
|
@media only screen and (max-width: 599px) {
|
1033
1051
|
background-color: unset;
|
@@ -1049,7 +1067,7 @@ blockquote {
|
|
1049
1067
|
}
|
1050
1068
|
|
1051
1069
|
.textFontArrows .MuiIconButton-root {
|
1052
|
-
padding:
|
1070
|
+
padding: 0px;
|
1053
1071
|
}
|
1054
1072
|
|
1055
1073
|
.tools-drawer .MuiTypography-root {
|
@@ -1236,6 +1254,19 @@ blockquote {
|
|
1236
1254
|
pointer-events: auto;
|
1237
1255
|
}
|
1238
1256
|
|
1257
|
+
@media (max-width: 899px) {
|
1258
|
+
.MuiPopover-root {
|
1259
|
+
z-index: 1302 !important;
|
1260
|
+
}
|
1261
|
+
canvas {
|
1262
|
+
max-width: 100% !important;
|
1263
|
+
}
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
.settingsHeader {
|
1267
|
+
font-size: 14px !important;
|
1268
|
+
font-weight: 500 !important;
|
1269
|
+
}
|
1239
1270
|
.hideScroll {
|
1240
1271
|
overflow-anchor: none;
|
1241
1272
|
}
|
@@ -1251,20 +1282,6 @@ blockquote {
|
|
1251
1282
|
.hideScroll::-webkit-scrollbar-thumb:hover {
|
1252
1283
|
background: none !important;
|
1253
1284
|
}
|
1254
|
-
@media (max-width: 899px) {
|
1255
|
-
.MuiPopover-root {
|
1256
|
-
z-index: 1302 !important;
|
1257
|
-
}
|
1258
|
-
|
1259
|
-
canvas {
|
1260
|
-
max-width: 100% !important;
|
1261
|
-
}
|
1262
|
-
}
|
1263
|
-
|
1264
|
-
.settingsHeader {
|
1265
|
-
font-size: 14px !important;
|
1266
|
-
font-weight: 500 !important;
|
1267
|
-
}
|
1268
1285
|
|
1269
1286
|
.custom-scroll::-webkit-scrollbar {
|
1270
1287
|
height: .6rem;
|
@@ -1284,3 +1301,22 @@ blockquote {
|
|
1284
1301
|
background: #A7AEC1;
|
1285
1302
|
}
|
1286
1303
|
|
1304
|
+
::selection {
|
1305
|
+
color: inherit;
|
1306
|
+
background: rgba(35, 131, 226, 0.35) !important;
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
::-moz-selection {
|
1310
|
+
background: rgba(35, 131, 226, 0.35) !important;
|
1311
|
+
color: inherit;
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
::-webkit-selection {
|
1315
|
+
background: rgba(35, 131, 226, 0.35) !important;
|
1316
|
+
color: inherit;
|
1317
|
+
}
|
1318
|
+
|
1319
|
+
.gradientFillBtn {
|
1320
|
+
background: linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important;
|
1321
|
+
text-transform: math-auto !important;
|
1322
|
+
}
|
@@ -6,7 +6,8 @@ import { IconButton, Tooltip, Box } from "@mui/material";
|
|
6
6
|
import DeleteIcon from "@mui/icons-material/Delete";
|
7
7
|
import { GridSettingsIcon } from "../../common/iconslist";
|
8
8
|
import Icon from "../../common/Icon";
|
9
|
-
import { useEditorSelection } from "../../hooks/useMouseMove";
|
9
|
+
import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
|
10
|
+
import useCommonStyle from "../../commonStyle";
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
13
|
const accordionBtnStyleKeys = {
|
@@ -78,6 +79,10 @@ const Accordion = props => {
|
|
78
79
|
textColor,
|
79
80
|
bgColor
|
80
81
|
} = element;
|
82
|
+
const {
|
83
|
+
theme
|
84
|
+
} = useEditorContext();
|
85
|
+
const classes = useCommonStyle(theme);
|
81
86
|
const onToggle = () => {
|
82
87
|
setToggle(!toggle);
|
83
88
|
};
|
@@ -97,6 +102,7 @@ const Accordion = props => {
|
|
97
102
|
children: /*#__PURE__*/_jsx(IconButton, {
|
98
103
|
size: "small",
|
99
104
|
onClick: onSettings,
|
105
|
+
sx: classes.buttonMoreOption,
|
100
106
|
children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
|
101
107
|
})
|
102
108
|
}), /*#__PURE__*/_jsx(Tooltip, {
|
@@ -105,6 +111,7 @@ const Accordion = props => {
|
|
105
111
|
children: /*#__PURE__*/_jsx(IconButton, {
|
106
112
|
size: "small",
|
107
113
|
onClick: onDelete,
|
114
|
+
sx: classes.buttonMoreOption2,
|
108
115
|
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
109
116
|
})
|
110
117
|
})]
|
@@ -250,10 +250,10 @@ function AppHeader(props) {
|
|
250
250
|
},
|
251
251
|
sx: {
|
252
252
|
mr: 2,
|
253
|
-
[theme
|
253
|
+
[theme?.breakpoints?.up("sm")]: {
|
254
254
|
display: "none"
|
255
255
|
},
|
256
|
-
[theme
|
256
|
+
[theme?.breakpoints.between("xs", "md")]: {
|
257
257
|
display: "block"
|
258
258
|
}
|
259
259
|
},
|
@@ -272,10 +272,10 @@ function AppHeader(props) {
|
|
272
272
|
},
|
273
273
|
sx: {
|
274
274
|
flexGrow: 1,
|
275
|
-
[theme
|
275
|
+
[theme?.breakpoints?.up("sm")]: {
|
276
276
|
display: "block"
|
277
277
|
},
|
278
|
-
[theme
|
278
|
+
[theme?.breakpoints?.between("xs", "md")]: {
|
279
279
|
display: "none"
|
280
280
|
},
|
281
281
|
"& img": {
|
@@ -293,10 +293,10 @@ function AppHeader(props) {
|
|
293
293
|
}) : null, appTitle]
|
294
294
|
}), /*#__PURE__*/_jsxs(Box, {
|
295
295
|
sx: {
|
296
|
-
[theme
|
296
|
+
[theme?.breakpoints?.up("sm")]: {
|
297
297
|
display: "block"
|
298
298
|
},
|
299
|
-
[theme
|
299
|
+
[theme?.breakpoints?.between("xs", "md")]: {
|
300
300
|
display: "none"
|
301
301
|
}
|
302
302
|
},
|
@@ -11,6 +11,7 @@ import { handleLinkType, windowVar } from "../../utils/helper";
|
|
11
11
|
import LinkSettings from "../../common/LinkSettings";
|
12
12
|
import Icon from "../../common/Icon";
|
13
13
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
14
|
+
import useCommonStyle from "../../commonStyle";
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
15
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -36,6 +37,7 @@ const EditorButton = props => {
|
|
36
37
|
const [edit, setEdit] = useState(false);
|
37
38
|
const [openNav, setOpenNav] = useState(false);
|
38
39
|
const [openMoreOptions, setOpenMoreOptions] = useState(false);
|
40
|
+
const classes = useCommonStyle(appTheme);
|
39
41
|
const {
|
40
42
|
label,
|
41
43
|
bgColor,
|
@@ -136,6 +138,7 @@ const EditorButton = props => {
|
|
136
138
|
arrow: true,
|
137
139
|
children: /*#__PURE__*/_jsx(IconButton, {
|
138
140
|
onClick: onMenuClick("edit"),
|
141
|
+
sx: classes.buttonMoreOption,
|
139
142
|
children: /*#__PURE__*/_jsx(Icon, {
|
140
143
|
icon: "pagesSettings"
|
141
144
|
})
|
@@ -145,6 +148,7 @@ const EditorButton = props => {
|
|
145
148
|
arrow: true,
|
146
149
|
children: /*#__PURE__*/_jsx(IconButton, {
|
147
150
|
onClick: onMenuClick("nav"),
|
151
|
+
sx: classes.buttonMoreOption,
|
148
152
|
children: /*#__PURE__*/_jsx(Icon, {
|
149
153
|
icon: "link"
|
150
154
|
})
|
@@ -157,7 +161,9 @@ const EditorButton = props => {
|
|
157
161
|
sx: {
|
158
162
|
display: "inline-flex",
|
159
163
|
color: "rgba(0, 0, 0, 0.54)",
|
160
|
-
marginBottom: "0px !important"
|
164
|
+
marginBottom: "0px !important",
|
165
|
+
...classes.buttonMoreOption,
|
166
|
+
...classes.buttonMoreOption3
|
161
167
|
},
|
162
168
|
...btnProps,
|
163
169
|
children: /*#__PURE__*/_jsx(Icon, {
|
@@ -259,11 +265,12 @@ const EditorButton = props => {
|
|
259
265
|
...btnSp,
|
260
266
|
borderStyle: borderStyle || "solid",
|
261
267
|
color: `${textColor || "#FFFFFF"}`,
|
262
|
-
fontSize: textSize || "
|
268
|
+
fontSize: textSize || "12px",
|
263
269
|
fontFamily: fontFamily || "PoppinsRegular",
|
264
270
|
display: "inline-flex",
|
265
271
|
alignItems: "center",
|
266
272
|
position: "relative",
|
273
|
+
lineHeight: 1.43,
|
267
274
|
"& .element-toolbar": {
|
268
275
|
display: "none"
|
269
276
|
},
|
@@ -109,11 +109,13 @@ const ColorButtons = props => {
|
|
109
109
|
forMiniTool,
|
110
110
|
openColorTool,
|
111
111
|
onClose,
|
112
|
-
onColorPickerClick
|
112
|
+
onColorPickerClick,
|
113
|
+
defaultColors = []
|
113
114
|
} = props;
|
114
115
|
const [row1, ...restRows] = ColorChunks([]);
|
115
116
|
const [anchorEl, setAnchorEl] = useState(null);
|
116
117
|
const open = Boolean(anchorEl);
|
118
|
+
const firstRow = defaultColors?.length ? defaultColors : row1;
|
117
119
|
const handleMore = e => {
|
118
120
|
setAnchorEl(e.currentTarget);
|
119
121
|
};
|
@@ -131,7 +133,7 @@ const ColorButtons = props => {
|
|
131
133
|
sx: classes.colorButtons,
|
132
134
|
children: [forMiniTool ? null : /*#__PURE__*/_jsx(Box, {
|
133
135
|
className: "buttonsWrpr first",
|
134
|
-
children: [
|
136
|
+
children: [firstRow].map((m, i) => {
|
135
137
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
136
138
|
id: `p1_${id}`,
|
137
139
|
crs: m,
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Node, Path, Transforms } from "slate";
|
3
|
+
import { ReactEditor, useSlateStatic } from "slate-react";
|
4
|
+
import { Box, useTheme } from "@mui/material";
|
5
|
+
import { DataViewProvider } from "./Providers/DataViewProvider";
|
6
|
+
import useDataViewStyles from "./styles";
|
7
|
+
import LayoutView from "./Layouts";
|
8
|
+
import FilterView from "./Layouts/FilterView";
|
9
|
+
import { insertLineBreakAtEndOfPath } from "../../utils/helper";
|
10
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
13
|
+
const DataView = props => {
|
14
|
+
const {
|
15
|
+
theme: appTheme
|
16
|
+
} = useEditorContext();
|
17
|
+
const theme = useTheme();
|
18
|
+
const editor = useSlateStatic();
|
19
|
+
const {
|
20
|
+
attributes,
|
21
|
+
children,
|
22
|
+
element,
|
23
|
+
customProps
|
24
|
+
} = props;
|
25
|
+
const {
|
26
|
+
CHARACTERS,
|
27
|
+
readOnly
|
28
|
+
} = customProps || {};
|
29
|
+
const {
|
30
|
+
properties,
|
31
|
+
layouts,
|
32
|
+
rows,
|
33
|
+
title
|
34
|
+
} = element;
|
35
|
+
const classes = useDataViewStyles(theme, appTheme);
|
36
|
+
const path = ReactEditor.findPath(editor, element);
|
37
|
+
const users = CHARACTERS?.map(m => {
|
38
|
+
const name = [m?.first_name || "", m?.last_name || ""]?.join(" ").trim();
|
39
|
+
return {
|
40
|
+
value: m?.email,
|
41
|
+
name: name || m?.username || m?.email,
|
42
|
+
avatar: m?.avatar || null
|
43
|
+
};
|
44
|
+
});
|
45
|
+
const onDuplicate = () => {
|
46
|
+
try {
|
47
|
+
const newPath = ReactEditor.findPath(editor, element);
|
48
|
+
const dataViewNode = Node.get(editor, newPath);
|
49
|
+
const cloneNode = JSON.parse(JSON.stringify(dataViewNode));
|
50
|
+
const toPath = Path.next(Path.parent(newPath));
|
51
|
+
Transforms.insertNodes(editor, [{
|
52
|
+
type: "paragraph",
|
53
|
+
children: [{
|
54
|
+
...cloneNode
|
55
|
+
}]
|
56
|
+
}], {
|
57
|
+
at: toPath
|
58
|
+
});
|
59
|
+
} catch (err) {
|
60
|
+
console.log(err);
|
61
|
+
}
|
62
|
+
};
|
63
|
+
const onDelete = () => {
|
64
|
+
try {
|
65
|
+
const newPath = ReactEditor.findPath(editor, element);
|
66
|
+
Transforms.removeNodes(editor, {
|
67
|
+
at: newPath
|
68
|
+
});
|
69
|
+
} catch (err) {
|
70
|
+
console.log(err);
|
71
|
+
}
|
72
|
+
};
|
73
|
+
const onEnter = () => {
|
74
|
+
try {
|
75
|
+
const newPath = ReactEditor.findPath(editor, element);
|
76
|
+
const toPath = Path.previous(Path.parent(newPath));
|
77
|
+
insertLineBreakAtEndOfPath(editor, toPath);
|
78
|
+
} catch (err) {
|
79
|
+
console.log(err);
|
80
|
+
}
|
81
|
+
};
|
82
|
+
const onTitleChange = value => {
|
83
|
+
try {
|
84
|
+
Transforms.setNodes(editor, {
|
85
|
+
title: value
|
86
|
+
}, {
|
87
|
+
at: path
|
88
|
+
});
|
89
|
+
} catch (err) {
|
90
|
+
console.log(err);
|
91
|
+
}
|
92
|
+
};
|
93
|
+
return /*#__PURE__*/_jsx(Box, {
|
94
|
+
...attributes,
|
95
|
+
className: "fe-dataview",
|
96
|
+
sx: classes.root,
|
97
|
+
contentEditable: false,
|
98
|
+
"data-title": title,
|
99
|
+
children: /*#__PURE__*/_jsxs(DataViewProvider, {
|
100
|
+
data: {
|
101
|
+
properties,
|
102
|
+
layouts,
|
103
|
+
rows
|
104
|
+
},
|
105
|
+
path: path,
|
106
|
+
editor: editor,
|
107
|
+
title: title,
|
108
|
+
users: users,
|
109
|
+
children: [/*#__PURE__*/_jsx(FilterView, {
|
110
|
+
classes: classes,
|
111
|
+
onEnter: onEnter,
|
112
|
+
onDelete: onDelete,
|
113
|
+
onDuplicate: onDuplicate,
|
114
|
+
readOnly: readOnly,
|
115
|
+
title: title,
|
116
|
+
onTitleChange: onTitleChange
|
117
|
+
}), /*#__PURE__*/_jsx(LayoutView, {
|
118
|
+
readOnly: readOnly,
|
119
|
+
children: children
|
120
|
+
})]
|
121
|
+
})
|
122
|
+
});
|
123
|
+
};
|
124
|
+
export default DataView;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import ToolbarIcon from "../../common/ToolbarIcon";
|
3
|
+
import Icon from "../../common/Icon";
|
4
|
+
import { insertDataView } from "../../utils/dataView";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const DataViewButton = props => {
|
7
|
+
const {
|
8
|
+
editor,
|
9
|
+
icoBtnType
|
10
|
+
} = props;
|
11
|
+
const onClick = () => {
|
12
|
+
insertDataView(editor);
|
13
|
+
};
|
14
|
+
return /*#__PURE__*/_jsx(ToolbarIcon, {
|
15
|
+
title: "Dynamic Table",
|
16
|
+
onClick: onClick,
|
17
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
18
|
+
icon: "dataView"
|
19
|
+
}),
|
20
|
+
icoBtnType: icoBtnType
|
21
|
+
});
|
22
|
+
};
|
23
|
+
export default DataViewButton;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
2
|
+
import { Box, Checkbox, Popper, useTheme } from "@mui/material";
|
3
|
+
import CheckBoxTwoToneIcon from "@mui/icons-material/CheckBoxTwoTone";
|
4
|
+
import DataTypes from "./DataTypes";
|
5
|
+
import useColumnStyles from "./colStyles";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
const ColumnView = props => {
|
9
|
+
const theme = useTheme();
|
10
|
+
const {
|
11
|
+
needAnchor,
|
12
|
+
rowIndex,
|
13
|
+
row,
|
14
|
+
property,
|
15
|
+
onSelect,
|
16
|
+
selected,
|
17
|
+
readOnly
|
18
|
+
} = props;
|
19
|
+
const DataType = DataTypes[property?.type] || DataTypes["text"];
|
20
|
+
const anchorRef = useRef(null);
|
21
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
22
|
+
const open = Boolean(anchorEl);
|
23
|
+
const classes = useColumnStyles(theme);
|
24
|
+
useEffect(() => {
|
25
|
+
if (anchorRef?.current) {
|
26
|
+
setAnchorEl(anchorRef?.current);
|
27
|
+
}
|
28
|
+
}, [anchorRef?.current]);
|
29
|
+
const handleSelect = id => e => {
|
30
|
+
onSelect(id, e.target.checked);
|
31
|
+
};
|
32
|
+
return /*#__PURE__*/_jsxs(Box, {
|
33
|
+
component: "td",
|
34
|
+
children: [needAnchor ? /*#__PURE__*/_jsx("span", {
|
35
|
+
ref: anchorRef,
|
36
|
+
style: {
|
37
|
+
position: "absolute",
|
38
|
+
width: "1px"
|
39
|
+
}
|
40
|
+
}) : null, /*#__PURE__*/_jsx(DataType, {
|
41
|
+
options: property?.options,
|
42
|
+
property: property?.key,
|
43
|
+
value: row[property?.key] || "",
|
44
|
+
rowIndex: rowIndex,
|
45
|
+
label: property?.label,
|
46
|
+
readOnly: readOnly
|
47
|
+
}), needAnchor && !readOnly ? /*#__PURE__*/_jsx(Popper, {
|
48
|
+
sx: classes.root,
|
49
|
+
open: open,
|
50
|
+
anchorEl: anchorEl,
|
51
|
+
placement: "left",
|
52
|
+
className: `tv-tr-pop ${selected ? "active" : ""}`,
|
53
|
+
disablePortal: true,
|
54
|
+
children: /*#__PURE__*/_jsx(Checkbox, {
|
55
|
+
onClick: handleSelect(row?.id),
|
56
|
+
size: "small",
|
57
|
+
className: "tv-ck-box",
|
58
|
+
sx: {
|
59
|
+
mr: 0
|
60
|
+
},
|
61
|
+
checked: selected,
|
62
|
+
checkedIcon: /*#__PURE__*/_jsx(CheckBoxTwoToneIcon, {})
|
63
|
+
})
|
64
|
+
}) : null]
|
65
|
+
});
|
66
|
+
};
|
67
|
+
export default ColumnView;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
+
import Checkbox from "@mui/material/Checkbox";
|
4
|
+
import Icon from "../../../../common/Icon";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const CheckType = props => {
|
7
|
+
const {
|
8
|
+
rowIndex,
|
9
|
+
property,
|
10
|
+
value,
|
11
|
+
readOnly
|
12
|
+
} = props;
|
13
|
+
const {
|
14
|
+
onChange
|
15
|
+
} = useDataView();
|
16
|
+
const handleChange = e => {
|
17
|
+
onChange(rowIndex, {
|
18
|
+
[property]: e?.target?.checked
|
19
|
+
});
|
20
|
+
};
|
21
|
+
return /*#__PURE__*/_jsx(Checkbox, {
|
22
|
+
checked: value || false,
|
23
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
24
|
+
icon: "checkListButton"
|
25
|
+
}),
|
26
|
+
checkedIcon: /*#__PURE__*/_jsx(Icon, {
|
27
|
+
icon: "checkListButtonActive"
|
28
|
+
}),
|
29
|
+
onChange: handleChange,
|
30
|
+
disabled: readOnly
|
31
|
+
}, rowIndex);
|
32
|
+
};
|
33
|
+
export default CheckType;
|