@flozy/editor 5.1.5 → 5.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +25 -34
- package/dist/Editor/CommonEditor.js +15 -9
- package/dist/Editor/Editor.css +56 -12
- package/dist/Editor/Elements/AI/AIInput.js +0 -1
- package/dist/Editor/Elements/AI/CustomSelect.js +17 -10
- package/dist/Editor/Elements/AI/Styles.js +7 -1
- package/dist/Editor/Elements/Button/EditorButton.js +1 -1
- package/dist/Editor/Elements/Carousel/CarouselItem.js +1 -1
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +7 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +7 -3
- package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
- package/dist/Editor/Elements/DataView/DataView.js +101 -0
- package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +59 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +140 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +40 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +59 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +26 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +38 -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 +62 -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 +100 -0
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +227 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +70 -0
- package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +288 -0
- package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +72 -0
- package/dist/Editor/Elements/DataView/styles.js +143 -0
- package/dist/Editor/Elements/Divider/Divider.js +15 -14
- package/dist/Editor/Elements/Form/Form.js +38 -2
- package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
- package/dist/Editor/Elements/Form/FormPopup.js +12 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
- package/dist/Editor/Elements/Grid/GridButton.js +2 -1
- package/dist/Editor/Elements/Grid/GridItem.js +12 -0
- package/dist/Editor/Elements/Link/LinkButton.js +1 -1
- package/dist/Editor/Elements/Signature/Signature.css +1 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +13 -48
- package/dist/Editor/Elements/SimpleText/index.js +8 -1
- package/dist/Editor/Elements/SimpleText/style.js +8 -1
- package/dist/Editor/Elements/Table/AddRowCol.js +77 -0
- package/dist/Editor/Elements/Table/DragButton.js +141 -0
- package/dist/Editor/Elements/Table/DragStyles.js +70 -0
- package/dist/Editor/Elements/Table/Draggable.js +25 -0
- package/dist/Editor/Elements/Table/Droppable.js +53 -0
- package/dist/Editor/Elements/Table/Styles.js +25 -43
- package/dist/Editor/Elements/Table/Table.js +205 -138
- package/dist/Editor/Elements/Table/TableCell.js +355 -102
- package/dist/Editor/Elements/Table/TablePopup.js +9 -3
- package/dist/Editor/Elements/Table/TableRow.js +10 -2
- package/dist/Editor/Elements/Table/TableTool.js +101 -0
- package/dist/Editor/Elements/Table/tableHelper.js +71 -0
- package/dist/Editor/Styles/EditorStyles.js +3 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +10 -0
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +7 -11
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +10 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +3 -0
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +0 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -6
- package/dist/Editor/Toolbar/Mini/Styles.js +4 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +16 -11
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +416 -49
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +62 -8
- package/dist/Editor/Toolbar/PopupTool/index.js +5 -6
- package/dist/Editor/Toolbar/Toolbar.js +6 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
- package/dist/Editor/assets/svg/BrainIcon.js +2 -2
- package/dist/Editor/assets/svg/TableIcons.js +220 -0
- package/dist/Editor/common/ColorPickerButton.js +3 -2
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
- package/dist/Editor/common/Icon.js +24 -23
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -1
- package/dist/Editor/common/LinkSettings/index.js +2 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +152 -7
- package/dist/Editor/common/MentionsPopup/index.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +108 -12
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
- package/dist/Editor/common/Select/index.js +20 -0
- package/dist/Editor/common/Select/styles.js +17 -0
- package/dist/Editor/common/Shorthands/elements.js +13 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- 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 +7 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +5 -2
- package/dist/Editor/common/StyleBuilder/formStyle.js +268 -149
- package/dist/Editor/common/StyleBuilder/index.js +84 -11
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/StyleBuilder/tableStyle.js +69 -25
- package/dist/Editor/common/SwipeableDrawer/style.js +15 -4
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconListV2.js +378 -40
- package/dist/Editor/common/iconslist.js +23 -17
- package/dist/Editor/commonStyle.js +126 -9
- package/dist/Editor/helper/deserialize/index.js +4 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/hooks/useTable.js +195 -0
- package/dist/Editor/plugins/withCustomDeleteBackward.js +3 -2
- package/dist/Editor/plugins/withHTML.js +17 -1
- package/dist/Editor/plugins/withLayout.js +48 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +18 -0
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +21 -0
- package/dist/Editor/utils/dataView.js +43 -0
- package/dist/Editor/utils/embed.js +2 -1
- package/dist/Editor/utils/events.js +0 -1
- package/dist/Editor/utils/font.js +11 -4
- package/dist/Editor/utils/formfield.js +8 -4
- package/dist/Editor/utils/helper.js +67 -2
- package/dist/Editor/utils/insertNewLine.js +19 -1
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/dist/Editor/utils/serializeToText.js +2 -0
- package/dist/Editor/utils/table.js +228 -24
- package/package.json +1 -1
@@ -138,8 +138,8 @@ export const StrikethroughIcon = props => /*#__PURE__*/_jsx("svg", {
|
|
138
138
|
children: /*#__PURE__*/_jsx("path", {
|
139
139
|
className: "strokeFillPath",
|
140
140
|
d: "M2.7607 11.125C2.7607 13.0718 4.33885 14.65 6.28568 14.65H8.21432C10.1611 14.65 11.7393 13.0718 11.7393 11.125V10.6429C11.7393 9.78254 11.4309 8.99403 10.9189 8.38214H13.5179C13.867 8.38214 14.15 8.0991 14.15 7.75C14.15 7.4009 13.867 7.11786 13.5179 7.11786H8.21597H8.21435H6.28579C5.03727 7.11786 4.02509 6.10568 4.02509 4.85714V4.375C4.02509 3.12647 5.03727 2.11429 6.28579 2.11429H8.21435C9.46288 2.11429 10.4751 3.12647 10.4751 4.375V4.84874C10.4751 5.19784 10.7581 5.48088 11.1072 5.48088C11.4563 5.48088 11.7393 5.19784 11.7393 4.84874V4.375C11.7393 2.42817 10.1612 0.85 8.21435 0.85H6.28579C4.33897 0.85 2.76081 2.42817 2.76081 4.375V4.85714C2.76081 5.71746 3.06916 6.50597 3.58108 7.11786H0.982141C0.633044 7.11786 0.35 7.4009 0.35 7.75C0.35 8.0991 0.633044 8.38214 0.982141 8.38214H8.21424L8.21556 8.38214C8.21559 8.38214 8.21562 8.38214 8.21564 8.38214C9.46353 8.38289 10.4749 9.39474 10.4749 10.6429V11.125C10.4749 12.3735 9.46276 13.3857 8.21424 13.3857H6.28568C5.03715 13.3857 4.02498 12.3735 4.02498 11.125V10.6429C4.02498 10.2938 3.74193 10.0107 3.39284 10.0107C3.04374 10.0107 2.7607 10.2938 2.7607 10.6429V11.125Z",
|
141
|
-
fill: "
|
142
|
-
stroke: "
|
141
|
+
fill: "currentColor",
|
142
|
+
stroke: "currentColor",
|
143
143
|
strokeWidth: "0.3"
|
144
144
|
})
|
145
145
|
});
|
@@ -864,19 +864,19 @@ export const TextLeftAlign = props => /*#__PURE__*/_jsxs("svg", {
|
|
864
864
|
children: [/*#__PURE__*/_jsx("path", {
|
865
865
|
className: "fillPath",
|
866
866
|
d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
|
867
|
-
fill: "#
|
867
|
+
fill: "#64748B"
|
868
868
|
}), /*#__PURE__*/_jsx("path", {
|
869
869
|
className: "fillPath",
|
870
870
|
d: "M12.47 11.0557H3C2.59 11.0557 2.25 10.7157 2.25 10.3057C2.25 9.89566 2.59 9.55566 3 9.55566H12.47C12.88 9.55566 13.22 9.89566 13.22 10.3057C13.22 10.7157 12.89 11.0557 12.47 11.0557Z",
|
871
|
-
fill: "#
|
871
|
+
fill: "#64748B"
|
872
872
|
}), /*#__PURE__*/_jsx("path", {
|
873
873
|
className: "fillPath",
|
874
874
|
d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
|
875
|
-
fill: "#
|
875
|
+
fill: "#64748B"
|
876
876
|
}), /*#__PURE__*/_jsx("path", {
|
877
877
|
className: "fillPath",
|
878
878
|
d: "M12.47 21.0557H3C2.59 21.0557 2.25 20.7157 2.25 20.3057C2.25 19.8957 2.59 19.5557 3 19.5557H12.47C12.88 19.5557 13.22 19.8957 13.22 20.3057C13.22 20.7157 12.89 21.0557 12.47 21.0557Z",
|
879
|
-
fill: "#
|
879
|
+
fill: "#64748B"
|
880
880
|
})]
|
881
881
|
});
|
882
882
|
export const TextCenterAlign = props => /*#__PURE__*/_jsxs("svg", {
|
@@ -888,19 +888,19 @@ export const TextCenterAlign = props => /*#__PURE__*/_jsxs("svg", {
|
|
888
888
|
children: [/*#__PURE__*/_jsx("path", {
|
889
889
|
className: "fillPath",
|
890
890
|
d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
|
891
|
-
fill: "#
|
891
|
+
fill: "#64748B"
|
892
892
|
}), /*#__PURE__*/_jsx("path", {
|
893
893
|
className: "fillPath",
|
894
894
|
d: "M16.7417 11.0557H7.26172C6.85172 11.0557 6.51172 10.7157 6.51172 10.3057C6.51172 9.89566 6.85172 9.55566 7.26172 9.55566H16.7317C17.1417 9.55566 17.4817 9.89566 17.4817 10.3057C17.4817 10.7157 17.1517 11.0557 16.7417 11.0557Z",
|
895
|
-
fill: "#
|
895
|
+
fill: "#64748B"
|
896
896
|
}), /*#__PURE__*/_jsx("path", {
|
897
897
|
className: "fillPath",
|
898
898
|
d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
|
899
|
-
fill: "#
|
899
|
+
fill: "#64748B"
|
900
900
|
}), /*#__PURE__*/_jsx("path", {
|
901
901
|
className: "fillPath",
|
902
902
|
d: "M16.7417 21.0557H7.26172C6.85172 21.0557 6.51172 20.7157 6.51172 20.3057C6.51172 19.8957 6.85172 19.5557 7.26172 19.5557H16.7317C17.1417 19.5557 17.4817 19.8957 17.4817 20.3057C17.4817 20.7157 17.1517 21.0557 16.7417 21.0557Z",
|
903
|
-
fill: "#
|
903
|
+
fill: "#64748B"
|
904
904
|
})]
|
905
905
|
});
|
906
906
|
export const TextRightAlign = props => /*#__PURE__*/_jsxs("svg", {
|
@@ -912,19 +912,19 @@ export const TextRightAlign = props => /*#__PURE__*/_jsxs("svg", {
|
|
912
912
|
children: [/*#__PURE__*/_jsx("path", {
|
913
913
|
className: "fillPath",
|
914
914
|
d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
|
915
|
-
fill: "#
|
915
|
+
fill: "#64748B"
|
916
916
|
}), /*#__PURE__*/_jsx("path", {
|
917
917
|
className: "fillPath",
|
918
918
|
d: "M21.0013 11.0557H11.5312C11.1213 11.0557 10.7812 10.7157 10.7812 10.3057C10.7812 9.89566 11.1213 9.55566 11.5312 9.55566H21.0013C21.4113 9.55566 21.7513 9.89566 21.7513 10.3057C21.7513 10.7157 21.4113 11.0557 21.0013 11.0557Z",
|
919
|
-
fill: "#
|
919
|
+
fill: "#64748B"
|
920
920
|
}), /*#__PURE__*/_jsx("path", {
|
921
921
|
className: "fillPath",
|
922
922
|
d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
|
923
|
-
fill: "#
|
923
|
+
fill: "#64748B"
|
924
924
|
}), /*#__PURE__*/_jsx("path", {
|
925
925
|
className: "fillPath",
|
926
926
|
d: "M21.0013 21.0557H11.5312C11.1213 21.0557 10.7812 20.7157 10.7812 20.3057C10.7812 19.8957 11.1213 19.5557 11.5312 19.5557H21.0013C21.4113 19.5557 21.7513 19.8957 21.7513 20.3057C21.7513 20.7157 21.4113 21.0557 21.0013 21.0557Z",
|
927
|
-
fill: "#
|
927
|
+
fill: "#64748B"
|
928
928
|
})]
|
929
929
|
});
|
930
930
|
export const JustifyStartIcon = props => /*#__PURE__*/_jsxs("svg", {
|
@@ -933,6 +933,9 @@ export const JustifyStartIcon = props => /*#__PURE__*/_jsxs("svg", {
|
|
933
933
|
height: "25",
|
934
934
|
viewBox: "0 0 24 25",
|
935
935
|
fill: "none",
|
936
|
+
style: {
|
937
|
+
color: "red"
|
938
|
+
},
|
936
939
|
children: [/*#__PURE__*/_jsx("path", {
|
937
940
|
d: "M5.10156 20.0557H16.9016C18.4016 20.0557 19.0016 19.4157 19.0016 17.8257V16.7857C19.0016 15.1957 18.4016 14.5557 16.9016 14.5557H5.10156",
|
938
941
|
stroke: "#64748B",
|
@@ -1343,19 +1346,22 @@ export const GridAddSectionIcon = props => /*#__PURE__*/_jsxs("svg", {
|
|
1343
1346
|
stroke: "#64748B",
|
1344
1347
|
strokeWidth: "1.5",
|
1345
1348
|
strokeLinecap: "round",
|
1346
|
-
strokeLinejoin: "round"
|
1349
|
+
strokeLinejoin: "round",
|
1350
|
+
className: "fillStroke"
|
1347
1351
|
}), /*#__PURE__*/_jsx("path", {
|
1348
1352
|
d: "M10.1733 6.125V14.875",
|
1349
1353
|
stroke: "#64748B",
|
1350
1354
|
strokeWidth: "1.5",
|
1351
1355
|
strokeLinecap: "round",
|
1352
|
-
strokeLinejoin: "round"
|
1356
|
+
strokeLinejoin: "round",
|
1357
|
+
className: "fillStroke"
|
1353
1358
|
}), /*#__PURE__*/_jsx("path", {
|
1354
1359
|
d: "M5.79834 10.5H14.5483",
|
1355
1360
|
stroke: "#64748B",
|
1356
1361
|
strokeWidth: "1.5",
|
1357
1362
|
strokeLinecap: "round",
|
1358
|
-
strokeLinejoin: "round"
|
1363
|
+
strokeLinejoin: "round",
|
1364
|
+
className: "fillStroke"
|
1359
1365
|
})]
|
1360
1366
|
});
|
1361
1367
|
export const FormIcon = () => {
|
@@ -17,12 +17,21 @@ const useCommonStyle = theme => ({
|
|
17
17
|
},
|
18
18
|
"& .close-popupbtn": {
|
19
19
|
color: theme?.palette?.editor?.textColor
|
20
|
+
},
|
21
|
+
"& .MuiSvgIcon-root": {
|
22
|
+
color: theme?.palette?.editor?.textColor
|
20
23
|
}
|
21
24
|
},
|
22
25
|
sapcingInput: {
|
23
26
|
backgroundColor: theme?.palette?.editor?.background,
|
24
27
|
color: theme?.palette?.editor?.textColor
|
25
28
|
},
|
29
|
+
customPaddingInput: {
|
30
|
+
background: theme?.palette?.editor?.inputFieldBgColor,
|
31
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
32
|
+
color: theme?.palette?.editor?.textColor,
|
33
|
+
borderRadius: '6px'
|
34
|
+
},
|
26
35
|
colorPickerPopup: {
|
27
36
|
"& .MuiPaper-root": {
|
28
37
|
overflow: "auto",
|
@@ -68,9 +77,9 @@ const useCommonStyle = theme => ({
|
|
68
77
|
},
|
69
78
|
signaturePopup: {
|
70
79
|
"& .MuiPaper-root": {
|
71
|
-
backgroundColor: theme?.palette?.editor?.
|
80
|
+
backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
|
72
81
|
"& .signature-canvas": {
|
73
|
-
backgroundColor:
|
82
|
+
backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`
|
74
83
|
},
|
75
84
|
"& label": {
|
76
85
|
color: theme?.palette?.editor?.textColor
|
@@ -97,26 +106,97 @@ const useCommonStyle = theme => ({
|
|
97
106
|
borderColor: theme?.palette?.editor?.textColor
|
98
107
|
},
|
99
108
|
"& .upload-wrapper-ui": {
|
100
|
-
backgroundColor: theme?.palette?.type === "dark" ? "
|
109
|
+
backgroundColor: theme?.palette?.type === "dark" ? "#2563EB0F" : "#F8F9FF",
|
101
110
|
"& .MuiTypography-root": {
|
102
111
|
color: theme?.palette?.editor?.textColor
|
103
112
|
}
|
104
113
|
},
|
114
|
+
"& .typesignature-input-wrapper": {
|
115
|
+
"& .MuiInputBase-root": {
|
116
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
117
|
+
borderRadius: "7px !important",
|
118
|
+
paddingRight: "6px !important"
|
119
|
+
},
|
120
|
+
"& .MuiInputBase-input": {
|
121
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`
|
122
|
+
},
|
123
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
124
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder}`
|
125
|
+
},
|
126
|
+
"& .Mui-focused": {
|
127
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
128
|
+
border: `1px solid #2563EB !important`
|
129
|
+
}
|
130
|
+
},
|
131
|
+
"& button": {
|
132
|
+
background: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
|
133
|
+
color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
134
|
+
}
|
135
|
+
},
|
105
136
|
"& .typesignature-fontfamily": {
|
106
137
|
"& button": {
|
107
|
-
color: theme?.palette?.editor?.textColor
|
138
|
+
color: theme?.palette?.editor?.textColor,
|
139
|
+
background: `${theme?.palette?.editor?.signatureFontBtnBg} !important`,
|
140
|
+
border: `1px solid ${theme?.palette?.editor?.sectionSettingIconHover} !important`,
|
141
|
+
"& p": {
|
142
|
+
fontSize: "13px !important"
|
143
|
+
}
|
144
|
+
},
|
145
|
+
"& .active ": {
|
146
|
+
border: `1px solid #2563EB !important`
|
108
147
|
}
|
109
148
|
},
|
110
149
|
"& .MuiTab-root": {
|
111
|
-
color: theme?.palette?.editor?.
|
112
|
-
backgroundColor: theme?.palette?.editor?.
|
150
|
+
color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`,
|
151
|
+
backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
152
|
+
opacity: "unset",
|
153
|
+
fontSize: "12px !important",
|
154
|
+
fontWeight: "500 !important",
|
155
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonBorder} !important`
|
156
|
+
},
|
157
|
+
"& .Mui-selected": {
|
158
|
+
background: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBg} !important`,
|
159
|
+
color: `${theme?.palette?.editor?.textColor} !important`,
|
160
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBorder} !important`,
|
161
|
+
"& .MuiGrid-root": {
|
162
|
+
"& svg": {
|
163
|
+
"& path": {
|
164
|
+
fill: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedSvg} !important`
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
113
168
|
},
|
114
169
|
"& .close-popupbtn": {
|
115
|
-
color: theme?.palette?.editor?.
|
170
|
+
color: theme?.palette?.editor?.closeButtonSvgStroke,
|
171
|
+
background: `${theme?.palette?.editor?.closeButtonBgColor} !important`
|
116
172
|
},
|
117
173
|
"& .deleteBtn": {
|
118
|
-
background: "transparent"
|
174
|
+
background: "transparent",
|
175
|
+
margin: '0px !important'
|
176
|
+
},
|
177
|
+
"& .MuiGrid-container": {
|
178
|
+
"& .workFlowButton": {
|
179
|
+
background: `${theme?.palette?.editor?.workFlowButtonBackground} !important`,
|
180
|
+
textTransform: "unset !important",
|
181
|
+
color: `${theme?.palette?.editor?.textColor} !important`,
|
182
|
+
fontSize: "14px !important",
|
183
|
+
fontWeight: "500 !important",
|
184
|
+
borderRadius: "25px",
|
185
|
+
padding: "5px 15px"
|
186
|
+
}
|
187
|
+
},
|
188
|
+
"& .MuiDialogActions-root": {
|
189
|
+
"& .deleteButtonSignature": {
|
190
|
+
background: `${theme?.palette?.editor?.closeButtonBackground} !important`,
|
191
|
+
color: `${theme?.palette?.editor?.deletePopUpButtonTextColor} !important`,
|
192
|
+
border: `1px solid ${theme?.palette?.editor?.closeButtonBorder} !important`
|
193
|
+
}
|
119
194
|
}
|
195
|
+
},
|
196
|
+
"& .disabledSaveBtn": {
|
197
|
+
background: "#2563EB33 !important",
|
198
|
+
color: theme?.palette?.type === "dark" && "#FFFFFF33 !important",
|
199
|
+
border: "1px solid #2563EB33 !important"
|
120
200
|
}
|
121
201
|
},
|
122
202
|
popupTitle2: {
|
@@ -130,7 +210,44 @@ const useCommonStyle = theme => ({
|
|
130
210
|
},
|
131
211
|
datePicker: {
|
132
212
|
"& .react-datepicker-wrapper": {
|
133
|
-
width: "100%"
|
213
|
+
width: "100%",
|
214
|
+
"& .react-datepicker__input-container": {
|
215
|
+
"& .MuiInputBase-root": {
|
216
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
217
|
+
"& .MuiInputBase-input": {
|
218
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
219
|
+
color: `${theme?.palette?.editor?.textColor} !important`
|
220
|
+
},
|
221
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
222
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
}
|
227
|
+
},
|
228
|
+
signaturePopUpNameField: {
|
229
|
+
background: "transparent !important",
|
230
|
+
"& .MuiInputBase-root": {
|
231
|
+
borderRadius: "10px !important",
|
232
|
+
background: "transparent !important",
|
233
|
+
"& .MuiOutlinedInput-input": {
|
234
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
235
|
+
borderRadius: "10px !important",
|
236
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`,
|
237
|
+
fontSize: "14px !important",
|
238
|
+
fontWeight: "500 !important"
|
239
|
+
},
|
240
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
241
|
+
border: `1px solid transparent !important`
|
242
|
+
}
|
243
|
+
},
|
244
|
+
"& .Mui-focused": {
|
245
|
+
"& .MuiOutlinedInput-input": {
|
246
|
+
border: `1px solid #2563EB !important`
|
247
|
+
},
|
248
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
249
|
+
border: `1px solid transparent !important`
|
250
|
+
}
|
134
251
|
}
|
135
252
|
}
|
136
253
|
});
|
@@ -331,14 +331,14 @@ export const isCarouselSelected = editor => {
|
|
331
331
|
return false;
|
332
332
|
}
|
333
333
|
const [nodeEntry] = Editor.nodes(editor, {
|
334
|
-
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type ===
|
334
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "carousel"
|
335
335
|
});
|
336
336
|
if (!nodeEntry) {
|
337
337
|
return false;
|
338
338
|
}
|
339
339
|
const [node] = nodeEntry;
|
340
340
|
const carouselDom = ReactEditor.toDOMNode(editor, node);
|
341
|
-
const isEdit = carouselDom.classList.contains(
|
341
|
+
const isEdit = carouselDom.classList.contains("carousel_slider_edit");
|
342
342
|
return !isEdit;
|
343
343
|
} catch (err) {
|
344
344
|
console.log(err);
|
@@ -147,4 +147,27 @@ export const groupByBreakpoint = (styleProps, theme) => {
|
|
147
147
|
}
|
148
148
|
};
|
149
149
|
};
|
150
|
-
export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
|
150
|
+
export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
|
151
|
+
export const getBreakpointLineSpacing = (value, breakpoint) => {
|
152
|
+
try {
|
153
|
+
const values = getBreakPointsValue(value, breakpoint);
|
154
|
+
const cssVal = BREAKPOINTS_DEVICES.reduce((a, b) => {
|
155
|
+
if (values[b] || values["lg"]) {
|
156
|
+
const value = values[b] || values["lg"];
|
157
|
+
return {
|
158
|
+
...a,
|
159
|
+
[b]: value
|
160
|
+
};
|
161
|
+
} else {
|
162
|
+
return a;
|
163
|
+
}
|
164
|
+
}, {});
|
165
|
+
if (breakpoint) {
|
166
|
+
return value[breakpoint] || value["lg"] || value;
|
167
|
+
} else {
|
168
|
+
return cssVal["lg"];
|
169
|
+
}
|
170
|
+
} catch (err) {
|
171
|
+
// console.log(err);
|
172
|
+
}
|
173
|
+
};
|
@@ -35,6 +35,7 @@ export const EditorProvider = ({
|
|
35
35
|
path: null
|
36
36
|
});
|
37
37
|
const [fontFamilies, setFontFamilies] = useState({});
|
38
|
+
const [activeBreakPoint, setActiveBreakPoint] = useState("");
|
38
39
|
useEffect(() => {
|
39
40
|
window.updateSelectedItem = d => {
|
40
41
|
setSelectedElement(d);
|
@@ -97,8 +98,10 @@ export const EditorProvider = ({
|
|
97
98
|
setOpenAI,
|
98
99
|
updateDragging,
|
99
100
|
fontFamilies,
|
100
|
-
setFontFamilies
|
101
|
-
|
101
|
+
setFontFamilies,
|
102
|
+
activeBreakPoint,
|
103
|
+
setActiveBreakPoint
|
104
|
+
}), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, activeBreakPoint]);
|
102
105
|
return /*#__PURE__*/_jsx(EditorContext.Provider, {
|
103
106
|
value: otherValues,
|
104
107
|
children: children
|
@@ -0,0 +1,195 @@
|
|
1
|
+
import { ClickAwayListener } from "@mui/material";
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
3
|
+
import { clearCellText } from "../utils/table";
|
4
|
+
import { Editor, Element, Transforms, Range } from "slate";
|
5
|
+
import { DndContext, DragOverlay, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
|
6
|
+
import { encodeToBase64, isHavingSelection } from "../utils/helper";
|
7
|
+
import { serializeToText } from "../utils/serializeToText";
|
8
|
+
import { createCopiedTableStructure, getRectangleBounds, tableNodeToDom } from "../Elements/Table/tableHelper";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
const handleDragEnd = (dragData, editor, resetAll) => {
|
12
|
+
const {
|
13
|
+
active,
|
14
|
+
over
|
15
|
+
} = dragData;
|
16
|
+
if (over) {
|
17
|
+
const {
|
18
|
+
dragType,
|
19
|
+
path: startCellPath
|
20
|
+
} = active?.data?.current || {};
|
21
|
+
const {
|
22
|
+
path: overCellPath
|
23
|
+
} = over?.data?.current || {};
|
24
|
+
if (startCellPath?.length) {
|
25
|
+
if (dragType === "row") {
|
26
|
+
const startRowPath = startCellPath.slice(0, -1);
|
27
|
+
const overRowPath = overCellPath.slice(0, -1);
|
28
|
+
Transforms.moveNodes(editor, {
|
29
|
+
at: startRowPath,
|
30
|
+
to: overRowPath
|
31
|
+
});
|
32
|
+
} else {
|
33
|
+
const [startCol] = startCellPath.slice(-1);
|
34
|
+
const [overCol] = overCellPath.slice(-1);
|
35
|
+
const [tableData] = Editor.nodes(editor, {
|
36
|
+
at: startCellPath,
|
37
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
|
38
|
+
});
|
39
|
+
const [tableNode, tablePath] = tableData;
|
40
|
+
const rows = tableNode?.rows || 0;
|
41
|
+
for (let row = 0; row < rows; row++) {
|
42
|
+
const startColPath = [...tablePath, row, startCol];
|
43
|
+
const overColPath = [...tablePath, row, overCol];
|
44
|
+
Transforms.moveNodes(editor, {
|
45
|
+
at: startColPath,
|
46
|
+
to: overColPath
|
47
|
+
});
|
48
|
+
}
|
49
|
+
}
|
50
|
+
resetAll();
|
51
|
+
}
|
52
|
+
}
|
53
|
+
};
|
54
|
+
const TableContext = /*#__PURE__*/createContext();
|
55
|
+
export function getDefaultTableSelection() {
|
56
|
+
return {
|
57
|
+
startCellPath: [],
|
58
|
+
endCellPath: [],
|
59
|
+
isDragging: false
|
60
|
+
};
|
61
|
+
}
|
62
|
+
export const TableProvider = ({
|
63
|
+
editor,
|
64
|
+
children,
|
65
|
+
otherProps = {}
|
66
|
+
}) => {
|
67
|
+
const {
|
68
|
+
openSetttings
|
69
|
+
} = otherProps;
|
70
|
+
const [hoverPath, setHoverPath] = useState(null);
|
71
|
+
const [tableSelection, setTableSelection] = useState(getDefaultTableSelection());
|
72
|
+
const [tableResizing, setTableResizing] = useState(null);
|
73
|
+
|
74
|
+
// for the button events (like onclick,...etc) inside draggable component to work correctly
|
75
|
+
const sensors = useSensors(useSensor(PointerSensor, {
|
76
|
+
activationConstraint: {
|
77
|
+
delay: 250,
|
78
|
+
distance: 0 // throws exceeded distance error
|
79
|
+
}
|
80
|
+
}));
|
81
|
+
|
82
|
+
const getSelectedCells = () => {
|
83
|
+
return getRectangleBounds(tableSelection);
|
84
|
+
};
|
85
|
+
const updateTableSelection = update => {
|
86
|
+
setTableSelection(prev => ({
|
87
|
+
...prev,
|
88
|
+
...update
|
89
|
+
}));
|
90
|
+
};
|
91
|
+
const resetAll = () => {
|
92
|
+
setTableSelection(getDefaultTableSelection());
|
93
|
+
Transforms.deselect(editor);
|
94
|
+
|
95
|
+
// hide drag icons after drag completion
|
96
|
+
setTimeout(() => setHoverPath(null), 200);
|
97
|
+
};
|
98
|
+
const values = useMemo(() => {
|
99
|
+
return {
|
100
|
+
hoverPath,
|
101
|
+
setHoverPath,
|
102
|
+
editor,
|
103
|
+
getSelectedCells,
|
104
|
+
updateTableSelection,
|
105
|
+
tableSelection,
|
106
|
+
tableResizing,
|
107
|
+
setTableResizing,
|
108
|
+
otherProps
|
109
|
+
};
|
110
|
+
}, [hoverPath, editor?.selection, tableSelection, tableResizing]);
|
111
|
+
useEffect(() => {
|
112
|
+
let isTextSelected;
|
113
|
+
const handleKeyDown = event => {
|
114
|
+
const isCutKey = (event.ctrlKey || event.metaKey) && event.key === "x";
|
115
|
+
if (isCutKey) {
|
116
|
+
isTextSelected = isHavingSelection(editor);
|
117
|
+
} else if (event.key === "Backspace") {
|
118
|
+
const selectedCells = getSelectedCells();
|
119
|
+
if (selectedCells?.length > 1) {
|
120
|
+
selectedCells.forEach(currentCellPath => {
|
121
|
+
clearCellText(editor, currentCellPath);
|
122
|
+
});
|
123
|
+
}
|
124
|
+
}
|
125
|
+
};
|
126
|
+
const handleCopy = (event, isCut) => {
|
127
|
+
try {
|
128
|
+
const isTextSelected = isHavingSelection(editor);
|
129
|
+
const {
|
130
|
+
startCellPath
|
131
|
+
} = tableSelection || {};
|
132
|
+
const customCopy = startCellPath?.length;
|
133
|
+
if (customCopy && !isTextSelected) {
|
134
|
+
event.preventDefault(); // Prevent default copy behavior
|
135
|
+
|
136
|
+
const {
|
137
|
+
tablePath
|
138
|
+
} = otherProps;
|
139
|
+
const [node] = Editor.node(editor, tablePath);
|
140
|
+
const copiedTableNode = createCopiedTableStructure(editor, tableSelection, node, tablePath);
|
141
|
+
const tableNode = [copiedTableNode];
|
142
|
+
const encodedTableNode = encodeToBase64(tableNode);
|
143
|
+
event.clipboardData.setData("application/x-slate-fragment", encodedTableNode);
|
144
|
+
const textData = serializeToText(tableNode);
|
145
|
+
event.clipboardData.setData("text/plain", textData);
|
146
|
+
const tableDom = tableNodeToDom(copiedTableNode);
|
147
|
+
event.clipboardData.setData("text/html", tableDom?.outerHTML);
|
148
|
+
if (isCut) {
|
149
|
+
clearCellText(editor, startCellPath);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
} catch (err) {
|
153
|
+
console.log(err);
|
154
|
+
}
|
155
|
+
};
|
156
|
+
const handleCut = e => {
|
157
|
+
// unable to find the text selected or not here, that why handling it on handleKeyDown
|
158
|
+
|
159
|
+
if (!isTextSelected) {
|
160
|
+
e.preventDefault();
|
161
|
+
handleCopy(e, true);
|
162
|
+
}
|
163
|
+
};
|
164
|
+
window.addEventListener("keydown", handleKeyDown);
|
165
|
+
window.addEventListener("copy", handleCopy);
|
166
|
+
window.addEventListener("cut", handleCut);
|
167
|
+
return () => {
|
168
|
+
window.removeEventListener("keydown", handleKeyDown);
|
169
|
+
window.removeEventListener("copy", handleCopy);
|
170
|
+
window.removeEventListener("cut", handleCut);
|
171
|
+
};
|
172
|
+
}, [tableSelection, editor, tableSelection]);
|
173
|
+
useEffect(() => {
|
174
|
+
if (!openSetttings) {
|
175
|
+
resetAll();
|
176
|
+
}
|
177
|
+
}, [openSetttings]);
|
178
|
+
return /*#__PURE__*/_jsx(TableContext.Provider, {
|
179
|
+
value: values,
|
180
|
+
children: /*#__PURE__*/_jsxs(DndContext, {
|
181
|
+
sensors: sensors,
|
182
|
+
onDragEnd: data => handleDragEnd(data, editor, resetAll),
|
183
|
+
children: [/*#__PURE__*/_jsx(ClickAwayListener, {
|
184
|
+
onClickAway: () => setTableSelection(getDefaultTableSelection()),
|
185
|
+
children: /*#__PURE__*/_jsx("div", {
|
186
|
+
children: children
|
187
|
+
})
|
188
|
+
}), /*#__PURE__*/_jsx(DragOverlay, {})]
|
189
|
+
})
|
190
|
+
});
|
191
|
+
};
|
192
|
+
function useTable() {
|
193
|
+
return useContext(TableContext);
|
194
|
+
}
|
195
|
+
export default useTable;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Editor, Node, Path, Point, Transforms } from "slate";
|
2
2
|
import { getNextNode } from "../utils/helper";
|
3
|
+
const BACKWARD_BLOCKS = ["list-item", "signature"];
|
3
4
|
const isNodeTextEmpty = node => {
|
4
5
|
const nodeText = Node.string(node);
|
5
6
|
return nodeText.trim() === "";
|
@@ -29,9 +30,9 @@ const withCustomDeleteBackward = editor => {
|
|
29
30
|
}
|
30
31
|
}
|
31
32
|
|
32
|
-
// Check if current node is a list item and is the last one
|
33
|
+
// Check if current node is a list item and is the last one, signature node
|
33
34
|
const [node] = Editor.nodes(editor, {
|
34
|
-
match: n => n.type
|
35
|
+
match: n => BACKWARD_BLOCKS.includes(n.type) // Adjust based on your list item type
|
35
36
|
});
|
36
37
|
|
37
38
|
if (node) {
|
@@ -68,6 +68,12 @@ const handleInsert = (editor, defaultInsert, fragment = []) => {
|
|
68
68
|
defaultInsert();
|
69
69
|
}
|
70
70
|
};
|
71
|
+
const getTableCellChild = (fragment = []) => {
|
72
|
+
const table = fragment.find(node => node.type === "table");
|
73
|
+
const row = table?.children?.find(node => node.type === "table-row");
|
74
|
+
const cell = row?.children?.find(node => node.type === "table-cell");
|
75
|
+
return cell?.children || [];
|
76
|
+
};
|
71
77
|
const formatFragment = {
|
72
78
|
"list-item": fragment => {
|
73
79
|
let refactorFragment = [];
|
@@ -114,9 +120,19 @@ const withHtml = editor => {
|
|
114
120
|
const slateHTML = data?.getData("application/x-slate-fragment");
|
115
121
|
const html = data?.getData("text/html");
|
116
122
|
const currentEl = getCurrentElement(editor);
|
117
|
-
|
123
|
+
let eltype = currentEl?.type;
|
118
124
|
if (slateHTML && !formatFragment[eltype]) {
|
125
|
+
const [tableCellNode] = Editor.nodes(editor, {
|
126
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table-cell"
|
127
|
+
});
|
119
128
|
const decoded = decodeAndParseBase64(slateHTML);
|
129
|
+
if (tableCellNode) {
|
130
|
+
const tableCellChild = getTableCellChild(decoded);
|
131
|
+
if (tableCellChild?.length) {
|
132
|
+
Transforms.insertFragment(editor, tableCellChild);
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
}
|
120
136
|
const tableNode = getFocusedNode(editor, "table");
|
121
137
|
const onlyTextNode = getFocusedNode(editor, "freegrid");
|
122
138
|
|