@flozy/editor 10.7.0 → 10.7.1

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.
Files changed (140) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +126 -15
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +45 -11
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AI/Styles.js +1 -0
  7. package/dist/Editor/Elements/Accordion/Accordion.js +25 -17
  8. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  9. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  10. package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
  11. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
  12. package/dist/Editor/Elements/Button/EditorButton.js +23 -7
  13. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  14. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  16. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  17. package/dist/Editor/Elements/Embed/Embed.js +36 -43
  18. package/dist/Editor/Elements/Embed/Image.js +240 -23
  19. package/dist/Editor/Elements/Embed/Video.js +246 -15
  20. package/dist/Editor/Elements/Form/FormField.js +1 -1
  21. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  22. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  23. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +39 -33
  24. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
  25. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
  26. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  27. package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
  28. package/dist/Editor/Elements/FreeGrid/styles.js +9 -0
  29. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  30. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  31. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  32. package/dist/Editor/Elements/Table/Table.js +3 -3
  33. package/dist/Editor/Elements/Title/title.js +6 -6
  34. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  35. package/dist/Editor/MiniEditor.js +2 -1
  36. package/dist/Editor/Styles/EditorStyles.js +20 -5
  37. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  38. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  39. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  40. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  41. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  44. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +4 -2
  45. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  46. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
  47. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  48. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +69 -9
  49. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +58 -10
  50. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  51. package/dist/Editor/Toolbar/PopupTool/index.js +5 -2
  52. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  53. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  54. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  55. package/dist/Editor/common/ColorPickerButton.js +38 -16
  56. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  57. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  58. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  59. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  60. package/dist/Editor/common/CustomSelect.js +43 -0
  61. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  62. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  63. package/dist/Editor/common/Icon.js +28 -0
  64. package/dist/Editor/common/ImageSelector/ImageSelector.js +46 -8
  65. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  66. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  67. package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
  68. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  69. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  70. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  71. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  72. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  73. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  74. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  75. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  76. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
  77. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  78. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -2
  79. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  80. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  81. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -18
  82. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  83. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +45 -58
  84. package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
  85. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  86. package/dist/Editor/common/RnD/index.js +48 -13
  87. package/dist/Editor/common/Shorthands/elements.js +54 -0
  88. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  89. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  100. package/dist/Editor/common/StyleBuilder/index.js +8 -4
  101. package/dist/Editor/common/Uploader.js +125 -17
  102. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  103. package/dist/Editor/common/iconslist.js +21 -0
  104. package/dist/Editor/commonStyle.js +107 -64
  105. package/dist/Editor/helper/index.js +10 -2
  106. package/dist/Editor/helper/textIndeces.js +58 -0
  107. package/dist/Editor/helper/theme.js +203 -2
  108. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  109. package/dist/Editor/hooks/useMouseMove.js +9 -3
  110. package/dist/Editor/hooks/useThemeValues.js +63 -0
  111. package/dist/Editor/plugins/withEmbeds.js +1 -1
  112. package/dist/Editor/plugins/withHTML.js +7 -3
  113. package/dist/Editor/plugins/withTable.js +1 -1
  114. package/dist/Editor/service/fileupload.js +53 -0
  115. package/dist/Editor/theme/ThemeList.js +50 -173
  116. package/dist/Editor/theme/index.js +149 -0
  117. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  118. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  119. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  120. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  121. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  122. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  123. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  124. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  125. package/dist/Editor/themeSettings/icons.js +60 -0
  126. package/dist/Editor/themeSettings/index.js +380 -0
  127. package/dist/Editor/themeSettings/style.js +299 -0
  128. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  129. package/dist/Editor/themeSettingsAI/index.js +355 -0
  130. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  131. package/dist/Editor/themeSettingsAI/style.js +332 -0
  132. package/dist/Editor/utils/SlateUtilityFunctions.js +231 -25
  133. package/dist/Editor/utils/accordion.js +62 -34
  134. package/dist/Editor/utils/button.js +1 -17
  135. package/dist/Editor/utils/draftToSlate.js +3 -2
  136. package/dist/Editor/utils/font.js +40 -37
  137. package/dist/Editor/utils/helper.js +97 -21
  138. package/dist/Editor/utils/insertAppHeader.js +8 -4
  139. package/package.json +4 -4
  140. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -0,0 +1,94 @@
1
+ import Dialog from "@mui/material/Dialog";
2
+ import DialogTitle from "@mui/material/DialogTitle";
3
+ import DialogContent from "@mui/material/DialogContent";
4
+ import DialogActions from "@mui/material/DialogActions";
5
+ import IconButton from "@mui/material/IconButton";
6
+ import CloseIcon from "@mui/icons-material/Close";
7
+ import { Box, Typography, Button } from "@mui/material";
8
+ import SwipeableDrawer from "../SwipeableDrawer";
9
+ import customDialogStyles from "./style";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { Fragment as _Fragment } from "react/jsx-runtime";
13
+ function CustomDialog(props) {
14
+ const {
15
+ handleClose,
16
+ customProps,
17
+ children,
18
+ onSubmit
19
+ } = props;
20
+ const {
21
+ isMobile
22
+ } = customProps;
23
+ const classes = customDialogStyles();
24
+ if (isMobile) {
25
+ return /*#__PURE__*/_jsx(Box, {
26
+ sx: classes.dialogContainer,
27
+ children: /*#__PURE__*/_jsxs(SwipeableDrawer, {
28
+ onClose: handleClose,
29
+ children: [/*#__PURE__*/_jsx(Typography, {
30
+ variant: "subtitle1",
31
+ gutterBottom: true,
32
+ sx: {
33
+ fontWeight: 600
34
+ },
35
+ children: "What do you want to link to?"
36
+ }), /*#__PURE__*/_jsx(Box, {
37
+ sx: classes.mobileDialogContent,
38
+ children: children
39
+ }), /*#__PURE__*/_jsx(Box, {
40
+ component: "div",
41
+ sx: classes.mobileActionBtns,
42
+ children: /*#__PURE__*/_jsx(ActionsButtons, {
43
+ classes: classes,
44
+ onCancel: handleClose,
45
+ onSave: onSubmit
46
+ })
47
+ })]
48
+ })
49
+ });
50
+ } else {
51
+ return /*#__PURE__*/_jsxs(Dialog, {
52
+ onClose: handleClose,
53
+ open: true,
54
+ sx: classes.dialogContainer,
55
+ fullWidth: true,
56
+ maxWidth: "sm",
57
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
58
+ children: "What do you want to link to?"
59
+ }), /*#__PURE__*/_jsx(IconButton, {
60
+ "aria-label": "close",
61
+ onClick: handleClose,
62
+ sx: classes.closeIcon,
63
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
64
+ }), /*#__PURE__*/_jsx(DialogContent, {
65
+ dividers: true,
66
+ children: children
67
+ }), /*#__PURE__*/_jsx(DialogActions, {
68
+ children: /*#__PURE__*/_jsx(ActionsButtons, {
69
+ classes: classes,
70
+ onCancel: handleClose,
71
+ onSave: onSubmit
72
+ })
73
+ })]
74
+ });
75
+ }
76
+ }
77
+ export default CustomDialog;
78
+ function ActionsButtons({
79
+ classes,
80
+ onCancel,
81
+ onSave
82
+ }) {
83
+ return /*#__PURE__*/_jsxs(_Fragment, {
84
+ children: [/*#__PURE__*/_jsx(Button, {
85
+ onClick: onCancel,
86
+ sx: classes.closeBtn,
87
+ children: "Cancel"
88
+ }), /*#__PURE__*/_jsx(Button, {
89
+ onClick: onSave,
90
+ sx: classes.saveBtn,
91
+ children: "Save"
92
+ })]
93
+ });
94
+ }
@@ -0,0 +1,67 @@
1
+ const styles = () => ({
2
+ dialogContainer: {
3
+ "& .MuiDialogContent-root": {
4
+ padding: "0px 20px"
5
+ },
6
+ "& .MuiDialogActions-root": {
7
+ padding: "10px"
8
+ },
9
+ "& .MuiTypography-h6": {
10
+ fontWeight: 600,
11
+ fontSize: "16px",
12
+ paddingRight: "20px"
13
+ },
14
+ "& .MuiGrid-container": {
15
+ marginTop: "0px"
16
+ },
17
+ "& .MuiGrid-item": {
18
+ padding: "14px"
19
+ }
20
+ },
21
+ saveBtn: {
22
+ color: "#fff",
23
+ background: "#2563EB",
24
+ fontSize: "14px",
25
+ fontWeight: 500,
26
+ padding: "4px 24px",
27
+ textTransform: "none",
28
+ "&:hover": {
29
+ color: "#fff",
30
+ background: "#2563EB"
31
+ }
32
+ },
33
+ closeBtn: {
34
+ backgroundColor: "#F4F6F9",
35
+ color: "#64748B",
36
+ fontSize: "14px",
37
+ fontWeight: 500,
38
+ padding: "4px 22px",
39
+ textTransform: "none",
40
+ border: "1px solid #D8DDE1",
41
+ "&:hover": {
42
+ border: "1px solid #64748B"
43
+ }
44
+ },
45
+ closeIcon: {
46
+ position: "absolute",
47
+ right: 8,
48
+ top: 8,
49
+ color: theme => theme.palette.grey[500]
50
+ },
51
+ gridDivider: {
52
+ borderRight: "1px solid rgba(0, 0, 0, 0.12)"
53
+ },
54
+ mobileActionBtns: {
55
+ display: "flex",
56
+ justifyContent: "flex-end",
57
+ gap: "8px",
58
+ paddingTop: "14px",
59
+ marginTop: "14px",
60
+ borderTop: theme => `1px solid ${theme.palette.grey[300]}`
61
+ },
62
+ mobileDialogContent: {
63
+ borderTop: theme => `1px solid ${theme.palette.grey[300]}`,
64
+ paddingTop: "14px"
65
+ }
66
+ });
67
+ export default styles;
@@ -0,0 +1,43 @@
1
+ import { MenuItem, Select } from "@mui/material";
2
+ import { fontFamilyMap } from "../utils/font";
3
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ function CustomSelect(props) {
6
+ const {
7
+ classes,
8
+ onChange,
9
+ options = [],
10
+ value
11
+ } = props;
12
+ return /*#__PURE__*/_jsx(Select, {
13
+ fullWidth: true,
14
+ value: value,
15
+ onChange: onChange,
16
+ className: "editor-dd",
17
+ style: {
18
+ fontFamily: fontFamilyMap[value],
19
+ width: "100%",
20
+ height: "36px",
21
+ borderRadius: "10px",
22
+ fontSize: "14px"
23
+ },
24
+ MenuProps: {
25
+ PaperProps: {
26
+ sx: classes?.textOptions
27
+ }
28
+ },
29
+ sx: classes.textFormatSelect,
30
+ IconComponent: KeyboardArrowDownRoundedIcon,
31
+ children: options.map((option, i) => {
32
+ return /*#__PURE__*/_jsx(MenuItem, {
33
+ value: option.value,
34
+ style: {
35
+ fontFamily: option.text || "inherit"
36
+ },
37
+ sx: classes.textFormatSelectOptions,
38
+ children: option?.label || option?.text
39
+ }, i);
40
+ })
41
+ });
42
+ }
43
+ export default CustomSelect;
@@ -7,7 +7,7 @@ import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { Transforms } from "slate";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
10
+ const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "grid"];
11
11
  const DragHandleStyle = fromPopper => {
12
12
  const handleDragStyle = fromPopper ? {
13
13
  position: "absolute",
@@ -19,6 +19,8 @@ const FontLoader = props => {
19
19
  const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
20
20
  let currentIndex = 0;
21
21
  let retryCount = 0;
22
+ // let hideLoaderOn = 30;
23
+
22
24
  const loadNextBatch = () => {
23
25
  try {
24
26
  if (currentIndex >= families?.length) {
@@ -79,6 +81,7 @@ const FontLoader = props => {
79
81
  // console.log(err);
80
82
  // setLoading(false);
81
83
  });
84
+ // setLoading(true);
82
85
  } else {
83
86
  function correctFontArray(fontString) {
84
87
  let fontsArray = fontString?.split(",");
@@ -48,6 +48,16 @@ import ChervUp from "../assets/svg/ChervUp";
48
48
  import ResetIconNew from "../assets/svg/ResetIconNew";
49
49
  import { jsx as _jsx } from "react/jsx-runtime";
50
50
  import { jsxs as _jsxs } from "react/jsx-runtime";
51
+ const HeadingIcon = ({
52
+ variant
53
+ }) => {
54
+ return /*#__PURE__*/_jsx("div", {
55
+ style: {
56
+ color: "#64748B"
57
+ },
58
+ children: variant
59
+ });
60
+ };
51
61
  const iconList = {
52
62
  fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
53
63
  size: 20
@@ -80,6 +90,24 @@ const iconList = {
80
90
  size: 18,
81
91
  fill: "#64748B"
82
92
  }),
93
+ headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
94
+ variant: "H4"
95
+ }),
96
+ headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
97
+ variant: "H5"
98
+ }),
99
+ headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
100
+ variant: "H6"
101
+ }),
102
+ paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
103
+ variant: "P1"
104
+ }),
105
+ paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
106
+ variant: "P2"
107
+ }),
108
+ paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
109
+ variant: "P3"
110
+ }),
83
111
  blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
84
112
  size: 20,
85
113
  fill: "#64748B",
@@ -17,7 +17,7 @@ const IMAGE_SLECTOR_OPTIONS = {
17
17
  };
18
18
  const TAB_SHOW = {
19
19
  Image: ["upload", "choose", "addLink"],
20
- Video: ["addLink"],
20
+ Video: ["upload", "addLink"],
21
21
  Embed: ["addLink"],
22
22
  Document: ["addLink", "upload"]
23
23
  };
@@ -31,21 +31,54 @@ const ImageSelector = props => {
31
31
  onClose,
32
32
  open,
33
33
  onSelectImage,
34
- title,
35
- customProps
34
+ customProps,
35
+ setUploadStatus,
36
+ disableProgress
36
37
  } = props;
38
+ const {
39
+ uploadTerminator
40
+ } = customProps;
41
+ const [uniqueId, setUniqueId] = useState(null);
42
+ const title = props.title || "Image";
37
43
  const translation = customProps?.translation;
38
- const [tabValue, setTabValue] = useState(title === "Image" ? "choose" : "addLink");
44
+ const [tabValue, setTabValue] = useState(title === "Image" ? "choose" : "Video" ? "upload" : "addLink");
39
45
  const [image, setImage] = useState(value || "");
46
+ const [s3UploadProp, setS3UploadProp] = useState({
47
+ file: null,
48
+ pageId: null,
49
+ services: customProps?.services,
50
+ setUploadStatus: setUploadStatus
51
+ });
40
52
  const handleTabChange = (e, newValue) => {
41
53
  setImage("");
42
54
  setTabValue(newValue);
55
+ setS3UploadProp({
56
+ file: null,
57
+ pageId: null,
58
+ services: customProps?.services,
59
+ setUploadStatus: setUploadStatus
60
+ });
43
61
  };
44
62
  const onUploaded = url => {
45
63
  setImage(url);
46
64
  };
47
65
  const onSave = () => {
48
- onSelectImage(image);
66
+ if (tabValue === "upload") {
67
+ if (disableProgress) {
68
+ onSelectImage(image);
69
+ } else {
70
+ onSelectImage(s3UploadProp);
71
+ }
72
+ } else {
73
+ onSelectImage({
74
+ embedURL: image,
75
+ isUpload: false
76
+ });
77
+ }
78
+ };
79
+ const onCloseUpload = () => {
80
+ uploadTerminator(uniqueId, setUploadStatus);
81
+ onClose();
49
82
  };
50
83
  const isActive = val => tabValue === val ? "active" : "";
51
84
  const Comp = IMAGE_SLECTOR_OPTIONS[tabValue] || /*#__PURE__*/_jsx(_Fragment, {});
@@ -129,7 +162,12 @@ const ImageSelector = props => {
129
162
  children: /*#__PURE__*/_jsx(Comp, {
130
163
  ...props,
131
164
  classes: classes,
132
- onUploaded: onUploaded
165
+ onUploaded: onUploaded,
166
+ setS3UploadProp: setS3UploadProp,
167
+ s3UploadProp: s3UploadProp,
168
+ disableProgress: disableProgress,
169
+ setUniqueId: setUniqueId,
170
+ uniqueId: uniqueId
133
171
  })
134
172
  })]
135
173
  })
@@ -143,12 +181,12 @@ const ImageSelector = props => {
143
181
  p: 2
144
182
  },
145
183
  children: [/*#__PURE__*/_jsx(Button, {
146
- onClick: onClose,
184
+ onClick: onCloseUpload,
147
185
  className: "secondaryBtn",
148
186
  sx: classes.closeBtn,
149
187
  children: translation("Cancel")
150
188
  }), /*#__PURE__*/_jsx(Button, {
151
- disabled: !image,
189
+ disabled: tabValue === "upload" ? !s3UploadProp?.file : !image,
152
190
  onClick: onSave,
153
191
  className: `primaryBtn ${!image ? "disabled" : ""}`,
154
192
  sx: classes.saveBtn,
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { Grid } from "@mui/material";
3
+ import UploaderWithProgress from "../../UploaderWithProgress";
3
4
  import Uploader from "../../Uploader";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const Upload = props => {
@@ -9,11 +10,31 @@ const Upload = props => {
9
10
  onUploaded,
10
11
  customProps,
11
12
  disableUpload = false,
12
- title
13
+ title,
14
+ setS3UploadProp,
15
+ s3UploadProp,
16
+ disableProgress,
17
+ setUniqueId,
18
+ uniqueId
13
19
  } = props;
14
20
  const onDone = img => {
15
21
  onUploaded(img);
16
22
  };
23
+ const commonProps = {
24
+ classes,
25
+ value,
26
+ data: {
27
+ key: "url"
28
+ },
29
+ customProps,
30
+ onUploaded: onDone,
31
+ disableUpload,
32
+ title,
33
+ setS3UploadProp,
34
+ s3UploadProp,
35
+ setUniqueId,
36
+ uniqueId
37
+ };
17
38
  return /*#__PURE__*/_jsx(Grid, {
18
39
  item: true,
19
40
  xs: 12,
@@ -22,16 +43,10 @@ const Upload = props => {
22
43
  height: '100%'
23
44
  },
24
45
  className: "ims-right",
25
- children: /*#__PURE__*/_jsx(Uploader, {
26
- classes: classes,
27
- value: value,
28
- data: {
29
- key: "url"
30
- },
31
- customProps: customProps,
32
- onUploaded: onDone,
33
- disableUpload: disableUpload,
34
- title: title
46
+ children: disableProgress ? /*#__PURE__*/_jsx(Uploader, {
47
+ ...commonProps
48
+ }) : /*#__PURE__*/_jsx(UploaderWithProgress, {
49
+ ...commonProps
35
50
  })
36
51
  });
37
52
  };
@@ -76,7 +76,7 @@ const ImageSelectorStyles = theme => ({
76
76
  background: theme?.palette?.editor?.deviderBgColor,
77
77
  "@media only screen and (min-width: 899px)": {
78
78
  margin: "0px 24px",
79
- width: 'calc(100% - 48px)'
79
+ width: "calc(100% - 48px)"
80
80
  }
81
81
  },
82
82
  "& .primaryBtn": {
@@ -104,12 +104,6 @@ const ImageSelectorStyles = theme => ({
104
104
  marginRight: "8px !important"
105
105
  },
106
106
  "& .MuiGrid-root": {
107
- "&::-webkit-scrollbar-thumb": {
108
- background: `none !important`
109
- },
110
- "&::-webkit-scrollbar-track": {
111
- visibility: "hidden"
112
- },
113
107
  "&::-webkit-scrollbar-thumb": {
114
108
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
115
109
  },
@@ -118,10 +112,10 @@ const ImageSelectorStyles = theme => ({
118
112
  }
119
113
  },
120
114
  "& .MuiImageList-root": {
121
- margin: '0px'
115
+ margin: "0px"
122
116
  },
123
117
  "& .MuiDialogContent-root": {
124
- padding: '20px 24px 5px 24px'
118
+ padding: "20px 24px 5px 24px"
125
119
  }
126
120
  },
127
121
  titleTypo: {
@@ -175,7 +175,8 @@ export const ScrollTopBottom = props => {
175
175
  const {
176
176
  value,
177
177
  onChange,
178
- translation
178
+ translation,
179
+ classes
179
180
  } = props;
180
181
  return /*#__PURE__*/_jsx(Select, {
181
182
  options: scrollToOptions,
@@ -183,7 +184,10 @@ export const ScrollTopBottom = props => {
183
184
  onChange: e => onChange(e.target.value),
184
185
  label: translation("Choose Top/Bottom of page"),
185
186
  showDefault: true,
186
- translation: translation
187
+ translation: translation,
188
+ MenuProps: {
189
+ sx: classes.customSelect
190
+ }
187
191
  });
188
192
  };
189
193
  const filter = createFilterOptions();
@@ -68,7 +68,8 @@ const Settings = props => {
68
68
  editor: editor,
69
69
  path: path,
70
70
  customProps: customProps,
71
- theme: theme
71
+ theme: theme,
72
+ onClose: onClose
72
73
  }) : null
73
74
  })]
74
75
  })
@@ -8,7 +8,8 @@ const AppHeaderSettings = props => {
8
8
  const {
9
9
  editor,
10
10
  path,
11
- customProps
11
+ customProps,
12
+ onClose
12
13
  } = props;
13
14
  const item_path = path?.split("|").map(m => parseInt(m));
14
15
  const element_path = [...item_path, 0];
@@ -27,7 +28,7 @@ const AppHeaderSettings = props => {
27
28
  });
28
29
  };
29
30
  const handleClose = () => {
30
- console.log("close");
31
+ onClose();
31
32
  };
32
33
  return /*#__PURE__*/_jsx(Box, {
33
34
  component: "div",
@@ -8,7 +8,8 @@ const BoxSettings = props => {
8
8
  const {
9
9
  editor,
10
10
  path,
11
- customProps
11
+ customProps,
12
+ onClose
12
13
  } = props;
13
14
  const item_path = path?.split("|").map(m => parseInt(m));
14
15
  const element_path = [...item_path];
@@ -27,7 +28,7 @@ const BoxSettings = props => {
27
28
  });
28
29
  };
29
30
  const handleClose = () => {
30
- console.log("close");
31
+ onClose();
31
32
  };
32
33
  return /*#__PURE__*/_jsx(Box, {
33
34
  component: "div",
@@ -8,7 +8,8 @@ const ButtonSettings = props => {
8
8
  const {
9
9
  editor,
10
10
  path,
11
- customProps
11
+ customProps,
12
+ onClose
12
13
  } = props;
13
14
  const item_path = path?.split("|").map(m => parseInt(m));
14
15
  const element_path = [...item_path, 0];
@@ -28,7 +29,7 @@ const ButtonSettings = props => {
28
29
  });
29
30
  };
30
31
  const handleClose = () => {
31
- console.log("close");
32
+ onClose();
32
33
  };
33
34
  return /*#__PURE__*/_jsx(Box, {
34
35
  component: "div",
@@ -8,7 +8,8 @@ const CodeSettings = props => {
8
8
  const {
9
9
  editor,
10
10
  path,
11
- customProps
11
+ customProps,
12
+ onClose
12
13
  } = props;
13
14
  const item_path = path?.split("|").map(m => parseInt(m));
14
15
  const element_path = [...item_path, 0];
@@ -27,7 +28,7 @@ const CodeSettings = props => {
27
28
  });
28
29
  };
29
30
  const handleClose = () => {
30
- console.log("close");
31
+ onClose();
31
32
  };
32
33
  return /*#__PURE__*/_jsx(Box, {
33
34
  component: "div",
@@ -12,7 +12,8 @@ const FormSettings = props => {
12
12
  const {
13
13
  editor,
14
14
  path,
15
- customProps
15
+ customProps,
16
+ onClose
16
17
  } = props;
17
18
  const item_path = path?.split("|").map(m => parseInt(m));
18
19
  const element_path = [...item_path];
@@ -56,13 +57,14 @@ const FormSettings = props => {
56
57
  }
57
58
  };
58
59
  const handleClose = () => {
59
- console.log("close");
60
+ onClose();
60
61
  };
61
62
  const muiTheme = createTheme({
62
63
  components: {
63
64
  MuiAccordion: {
64
65
  styleOverrides: {
65
66
  root: {
67
+ background: theme?.palette?.editor?.miniToolBarBackground,
66
68
  "& .MuiAccordionSummary-root": {
67
69
  flexDirection: "row-reverse",
68
70
  "& .MuiSvgIcon-root": {
@@ -8,17 +8,30 @@ const ImageSettings = props => {
8
8
  const {
9
9
  editor,
10
10
  path,
11
- customProps
11
+ customProps,
12
+ onClose
12
13
  } = props;
13
14
  const item_path = path?.split("|").map(m => parseInt(m));
14
15
  const element_path = [...item_path, 0];
15
16
  const element = Node.get(editor, element_path);
16
17
  const onChange = data => {
17
- const updated_props = {
18
- ...element,
19
- ...data,
20
- field_type: data?.element
21
- };
18
+ let updated_props = {};
19
+ if (data?.url?.embedURL) {
20
+ updated_props = {
21
+ url: data?.url?.embedURL
22
+ };
23
+ } else if (data?.url?.file) {
24
+ updated_props = {
25
+ fromFreeGrid: true,
26
+ isUpload: true,
27
+ file: data?.url?.file,
28
+ url: ""
29
+ };
30
+ } else {
31
+ updated_props = {
32
+ ...data
33
+ };
34
+ }
22
35
  delete updated_props.children;
23
36
  Transforms.setNodes(editor, {
24
37
  ...updated_props
@@ -27,7 +40,7 @@ const ImageSettings = props => {
27
40
  });
28
41
  };
29
42
  const handleClose = () => {
30
- console.log("close");
43
+ onClose();
31
44
  };
32
45
  return /*#__PURE__*/_jsx(Box, {
33
46
  component: "div",
@@ -9,7 +9,8 @@ const TableSettings = props => {
9
9
  const {
10
10
  editor,
11
11
  path,
12
- customProps
12
+ customProps,
13
+ onClose
13
14
  } = props;
14
15
  const item_path = path?.split("|").map(m => parseInt(m));
15
16
  const element_path = [...item_path, 0];
@@ -57,7 +58,7 @@ const TableSettings = props => {
57
58
  }
58
59
  };
59
60
  const handleClose = () => {
60
- console.log("close");
61
+ onClose();
61
62
  };
62
63
  return /*#__PURE__*/_jsx(Box, {
63
64
  component: "div",
@@ -9,6 +9,7 @@ const TextSettings = props => {
9
9
  editor,
10
10
  path,
11
11
  theme,
12
+ onClose,
12
13
  customProps
13
14
  } = props;
14
15
  const item_path = path.split("|").map(m => parseInt(m));
@@ -27,7 +28,8 @@ const TextSettings = props => {
27
28
  return /*#__PURE__*/_jsx(TextFormat, {
28
29
  classes: classes,
29
30
  editor: editor,
30
- customProps: customProps
31
+ customProps: customProps,
32
+ closeMainPopup: onClose
31
33
  });
32
34
  };
33
35
  export default TextSettings;