@flozy/editor 10.8.9 → 10.9.0

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 (152) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +138 -27
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +39 -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 +28 -22
  8. package/dist/Editor/Elements/Accordion/AccordionButton.js +12 -3
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  10. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  11. package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
  12. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
  13. package/dist/Editor/Elements/Button/EditorButton.js +23 -7
  14. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  16. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  17. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
  21. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  22. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  23. package/dist/Editor/Elements/Embed/Embed.js +36 -43
  24. package/dist/Editor/Elements/Embed/Image.js +240 -23
  25. package/dist/Editor/Elements/Embed/Video.js +246 -15
  26. package/dist/Editor/Elements/Form/FormField.js +1 -1
  27. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  28. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  29. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +39 -33
  30. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
  31. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
  32. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  33. package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
  34. package/dist/Editor/Elements/FreeGrid/styles.js +9 -0
  35. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  36. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  37. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  38. package/dist/Editor/Elements/Table/Table.js +3 -3
  39. package/dist/Editor/Elements/Title/title.js +6 -6
  40. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  41. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  42. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  43. package/dist/Editor/MiniEditor.js +2 -1
  44. package/dist/Editor/Styles/EditorStyles.js +20 -5
  45. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  46. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  47. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  48. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  49. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +23 -23
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
  53. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  54. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
  55. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  56. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
  57. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
  58. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  59. package/dist/Editor/Toolbar/PopupTool/index.js +5 -2
  60. package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
  61. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  62. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  63. package/dist/Editor/common/ColorPickerButton.js +38 -16
  64. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  65. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  66. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  67. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  68. package/dist/Editor/common/CustomSelect.js +43 -0
  69. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  70. package/dist/Editor/common/FontLoader/FontLoader.js +4 -0
  71. package/dist/Editor/common/Icon.js +28 -0
  72. package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
  73. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  74. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  75. package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
  76. package/dist/Editor/common/MentionsPopup/index.js +9 -1
  77. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  78. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  80. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  82. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  83. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  87. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  88. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -2
  89. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  90. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  91. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -18
  92. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  93. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +45 -58
  94. package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
  95. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  96. package/dist/Editor/common/RnD/index.js +48 -13
  97. package/dist/Editor/common/Shorthands/elements.js +62 -4
  98. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  99. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  100. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  103. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  104. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  105. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  106. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  107. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  108. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  109. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  110. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  111. package/dist/Editor/common/StyleBuilder/index.js +8 -4
  112. package/dist/Editor/common/Uploader.js +125 -17
  113. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  114. package/dist/Editor/common/iconslist.js +21 -0
  115. package/dist/Editor/commonStyle.js +107 -64
  116. package/dist/Editor/helper/index.js +10 -2
  117. package/dist/Editor/helper/textIndeces.js +58 -0
  118. package/dist/Editor/helper/theme.js +203 -2
  119. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  120. package/dist/Editor/hooks/useMouseMove.js +9 -3
  121. package/dist/Editor/hooks/useThemeValues.js +63 -0
  122. package/dist/Editor/plugins/withEmbeds.js +12 -1
  123. package/dist/Editor/plugins/withHTML.js +58 -3
  124. package/dist/Editor/plugins/withTable.js +1 -1
  125. package/dist/Editor/service/fileupload.js +53 -0
  126. package/dist/Editor/theme/ThemeList.js +50 -173
  127. package/dist/Editor/theme/index.js +149 -0
  128. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  129. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  130. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  131. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  132. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  133. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  134. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  135. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  136. package/dist/Editor/themeSettings/icons.js +60 -0
  137. package/dist/Editor/themeSettings/index.js +380 -0
  138. package/dist/Editor/themeSettings/style.js +299 -0
  139. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  140. package/dist/Editor/themeSettingsAI/index.js +355 -0
  141. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  142. package/dist/Editor/themeSettingsAI/style.js +332 -0
  143. package/dist/Editor/utils/SlateUtilityFunctions.js +183 -21
  144. package/dist/Editor/utils/accordion.js +68 -40
  145. package/dist/Editor/utils/button.js +1 -17
  146. package/dist/Editor/utils/draftToSlate.js +3 -2
  147. package/dist/Editor/utils/events.js +94 -89
  148. package/dist/Editor/utils/font.js +40 -37
  149. package/dist/Editor/utils/helper.js +97 -21
  150. package/dist/Editor/utils/insertAppHeader.js +8 -4
  151. package/package.json +4 -4
  152. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import { Transforms, Node } from "slate";
2
+ import { Transforms } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
4
  import { IconButton, Tooltip, Grid, useTheme } from "@mui/material";
5
5
  import FormElements from "./FormElements";
@@ -9,20 +9,20 @@ const FormStyles = theme => ({
9
9
  color: "#94A3B8"
10
10
  },
11
11
  bodyTextArea: {
12
- '& .mini-editor-cls': {
13
- padding: '12px',
14
- '&:focus-visible': {
15
- outline: 'none',
16
- border: 'none'
12
+ "& .mini-editor-cls": {
13
+ padding: "12px",
14
+ "&:focus-visible": {
15
+ outline: "none",
16
+ border: "none"
17
17
  }
18
18
  },
19
19
  "& .editorWorkflow": {
20
- minHeight: '130px',
21
- padding: '12px',
20
+ minHeight: "130px",
21
+ padding: "12px",
22
22
  paddingBottom: 0,
23
- '&:focus-visible': {
24
- outline: 'none',
25
- border: 'none'
23
+ "&:focus-visible": {
24
+ outline: "none",
25
+ border: "none"
26
26
  }
27
27
  }
28
28
  },
@@ -105,7 +105,7 @@ const FormStyles = theme => ({
105
105
  padding: "4px 22px",
106
106
  textTransform: "none",
107
107
  border: "1px solid #D8DDE1",
108
- minWidth: '126px',
108
+ minWidth: "126px",
109
109
  "& svg": {
110
110
  "& path": {
111
111
  stroke: "#64748B"
@@ -169,17 +169,19 @@ const FormStyles = theme => ({
169
169
  }
170
170
  },
171
171
  colorButtonSingle: {
172
+ border: "1.5px solid #DCE4EC !important",
172
173
  "&.active": {
173
- "&:before": {
174
- content: '" "',
175
- position: "absolute",
176
- top: "-5px",
177
- left: "-5px",
178
- width: "calc(100% + 4px)",
179
- height: "calc(100% + 4px)",
180
- border: "3px solid blue",
181
- borderRadius: "50%"
182
- }
174
+ // "&:before": {
175
+ // content: '" "',
176
+ // position: "absolute",
177
+ // top: "-5px",
178
+ // left: "-5px",
179
+ // width: "calc(100% + 4px)",
180
+ // height: "calc(100% + 4px)",
181
+ // border: "3px solid blue",
182
+ // borderRadius: "50%",
183
+ // },
184
+ outline: "2px solid #2563EB"
183
185
  }
184
186
  },
185
187
  colorButtonsInner: {
@@ -249,7 +251,7 @@ const FormStyles = theme => ({
249
251
  }
250
252
  },
251
253
  root: {
252
- padding: '10px'
254
+ padding: "10px"
253
255
  }
254
256
  });
255
257
  export default FormStyles;
@@ -1,3 +1,27 @@
1
1
  export const minutes = [30, 35, 40, 45, 50, 55];
2
2
  export const hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
3
- export const days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
3
+ export const days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
4
+ export const allowedFormat = {
5
+ Document: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf",
6
+ Image: "image/*",
7
+ Video: ".mp4,.webm,.ogg,.mov,.avi,.mkv",
8
+ Embed: "*"
9
+ };
10
+ export const maxSizeMap = {
11
+ Image: 25 * 1024 * 1024,
12
+ // Test -> 5 * 1024 * 1024 -> 5MB
13
+ Video: 1024 * 1024 * 1024,
14
+ Document: 25 * 1024 * 1024,
15
+ Embed: Infinity
16
+ };
17
+ export const allowedTypes = {
18
+ Document: ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "text/plain", "application/rtf"],
19
+ Image: ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"],
20
+ Video: ["video/mp4", "video/webm", "video/ogg", "video/quicktime", "video/x-msvideo", "video/x-matroska"],
21
+ Embed: ["*"]
22
+ };
23
+ export const extensionMap = {
24
+ Video: ["mp4", "webm", "ogg", "mov", "avi", "mkv"],
25
+ Image: ["jpg", "jpeg", "png", "gif", "webp", "svg"],
26
+ Document: ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf"]
27
+ };
@@ -22,6 +22,7 @@ import { DEFAULT_TABLE_NODE } from "../../utils/table";
22
22
  import itemOptions from "./Options/sectionItemOptions";
23
23
  import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
24
24
  import { useDebouncedCallback } from "use-debounce";
25
+ import { getNewElementXsValues } from "./helper";
25
26
  import updateFormName from "../../utils/updateFormName";
26
27
  import { jsx as _jsx } from "react/jsx-runtime";
27
28
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -183,6 +184,11 @@ const FreeGrid = props => {
183
184
  const handleAddElementClick = type => () => {
184
185
  const isEmpty = isEmptySection();
185
186
  const insertAt = isEmpty ? [...path, 0] : [...path, childrenCountRef.current];
187
+ const {
188
+ xsVal,
189
+ sectionHeightXs
190
+ } = getNewElementXsValues(type, element?.children);
191
+ const id = crypto?.randomUUID();
186
192
  switch (type) {
187
193
  case "addText":
188
194
  Transforms.insertNodes(editor, [{
@@ -199,7 +205,8 @@ const FreeGrid = props => {
199
205
  marginTop: 0,
200
206
  top: 0,
201
207
  width: 170,
202
- height: 30
208
+ height: 30,
209
+ ...(xsVal || {})
203
210
  }], {
204
211
  at: [...insertAt]
205
212
  });
@@ -217,20 +224,6 @@ const FreeGrid = props => {
217
224
  linkType: "webAddress"
218
225
  },
219
226
  iconPosition: "start",
220
- bgColor: "#2563EB",
221
- textColor: "#FFF",
222
- borderRadius: {
223
- topLeft: 30,
224
- topRight: 30,
225
- bottomLeft: 30,
226
- bottomRight: 30
227
- },
228
- bannerSpacing: {
229
- left: 12,
230
- top: 12,
231
- right: 12,
232
- bottom: 12
233
- },
234
227
  textAlign: "center",
235
228
  label: "Get Started"
236
229
  }],
@@ -239,7 +232,8 @@ const FreeGrid = props => {
239
232
  marginTop: 0,
240
233
  top: 0,
241
234
  width: 143,
242
- height: 50
235
+ height: 50,
236
+ ...(xsVal || {})
243
237
  }], {
244
238
  at: [...insertAt]
245
239
  });
@@ -265,8 +259,9 @@ const FreeGrid = props => {
265
259
  top: 0,
266
260
  width: 217,
267
261
  height: 173,
268
- width_xs: 217,
269
- height_xs: 173
262
+ // width_xs: 217,
263
+ // height_xs: 173,
264
+ ...(xsVal || {})
270
265
  }], {
271
266
  at: [...insertAt]
272
267
  });
@@ -282,14 +277,17 @@ const FreeGrid = props => {
282
277
  images: [],
283
278
  children: [{
284
279
  text: ""
285
- }]
280
+ }],
281
+ fromFreeGrid: true,
282
+ uniqueId: id
286
283
  }],
287
284
  gridArea: "3 / 1 / 4 / 2",
288
285
  left: 50,
289
286
  marginTop: 0,
290
287
  top: 0,
291
- width: 170,
292
- height: 80
288
+ width: 650,
289
+ height: 80,
290
+ ...(xsVal || {})
293
291
  }], {
294
292
  at: [...insertAt]
295
293
  });
@@ -299,10 +297,13 @@ const FreeGrid = props => {
299
297
  ...insertFreeGridItem("video", createEmbedNode("video", {
300
298
  url: "",
301
299
  alt: "",
302
- images: []
300
+ images: [],
301
+ fromFreeGrid: true,
302
+ uniqueId: id
303
303
  }), {
304
304
  height: 370,
305
- width: 650
305
+ width: 650,
306
+ ...(xsVal || {})
306
307
  })
307
308
  }], {
308
309
  at: [...insertAt]
@@ -314,7 +315,8 @@ const FreeGrid = props => {
314
315
  ...DEFAULT_TABLE_NODE()
315
316
  }, {
316
317
  height: 150,
317
- width: 400
318
+ width: 400,
319
+ ...(xsVal || {})
318
320
  })
319
321
  }], {
320
322
  at: [...insertAt]
@@ -338,7 +340,8 @@ const FreeGrid = props => {
338
340
  marginTop: 0,
339
341
  top: 0,
340
342
  width: 400,
341
- height: 300
343
+ height: 300,
344
+ ...(xsVal || {})
342
345
  }], {
343
346
  at: [...insertAt]
344
347
  });
@@ -350,7 +353,9 @@ const FreeGrid = props => {
350
353
  children: [{
351
354
  text: ""
352
355
  }]
353
- }, {}, "freegridBox")
356
+ }, {
357
+ ...(xsVal || {})
358
+ }, "freegridBox")
354
359
  }], {
355
360
  at: [...insertAt]
356
361
  });
@@ -361,7 +366,8 @@ const FreeGrid = props => {
361
366
  ...FORM_NODE()
362
367
  }, {
363
368
  height: 92,
364
- width: 400
369
+ width: 400,
370
+ ...(xsVal || {})
365
371
  })
366
372
  }], {
367
373
  at: [...insertAt]
@@ -375,7 +381,8 @@ const FreeGrid = props => {
375
381
  })
376
382
  }, {
377
383
  height: 60,
378
- width: 400
384
+ width: 400,
385
+ ...(xsVal || {})
379
386
  })
380
387
  }], {
381
388
  at: [...insertAt]
@@ -396,19 +403,18 @@ const FreeGrid = props => {
396
403
  marginTop: 0,
397
404
  top: 0,
398
405
  width: 170,
399
- height: 30
406
+ height: 30,
407
+ ...(xsVal || {})
400
408
  }], {
401
409
  at: [...insertAt]
402
410
  });
403
411
  break;
404
412
  default:
405
413
  }
406
- if (breakpoint === "lg") {
414
+ if (xsVal) {
407
415
  setSelectedElement({});
408
-
409
- // auto align in mobile
410
416
  Transforms.setNodes(editor, {
411
- xs_updatedOn: null,
417
+ height_xs: sectionHeightXs,
412
418
  updated_at: new Date().getTime()
413
419
  }, {
414
420
  at: path
@@ -8,7 +8,7 @@ import { onDropItem, ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
8
8
  import useBreakpoints from "../../hooks/useBreakpoints";
9
9
  import { breakpointValues, formatBreakpointValues } from "./breakpointConstants";
10
10
  import { useEditorContext } from "../../hooks/useMouseMove";
11
- import { getBreakPointsValue } from "../../helper/theme";
11
+ import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
12
12
  import focusOnNewItem from "../../helper/RnD/focusOnNewItem";
13
13
  import { bringItemToFB } from "../../helper";
14
14
  import itemOptions from "./Options/sectionItemOptions";
@@ -160,6 +160,11 @@ const FreeGridBox = props => {
160
160
  const isBoxHeader = useMemo(() => {
161
161
  return element?.children?.some(c => c.childType === "appHeader" && !c.xs_updatedOn);
162
162
  }, [element]);
163
+ const boxSp = groupByBreakpoint({
164
+ borderRadius: {
165
+ ...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
166
+ }
167
+ }, theme);
163
168
  return /*#__PURE__*/_jsx(RnD, {
164
169
  id: `freegrid_box_item_${path.join("|")}_${updated_at}_${breakpoint}`,
165
170
  className: `freegrid-item path-${path.length} breakpoint-${breakpoint} freegrid-box_${path.join("_")}`,
@@ -226,9 +231,7 @@ const FreeGridBox = props => {
226
231
  "--rows": `repeat(${repeatTimes}, ${ROW_HEIGHT}px)`
227
232
  },
228
233
  sx: {
229
- borderRadius: {
230
- ...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
231
- },
234
+ ...boxSp,
232
235
  background: sectionBgColor,
233
236
  backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
234
237
  borderColor: borderColor || "transparent",
@@ -321,6 +321,7 @@ const FreeGridItem = props => {
321
321
  customProps: customProps,
322
322
  translation: translation,
323
323
  xsHidden: xsHidden,
324
+ disableClick: element?.children?.[0]?.isUploading,
324
325
  children: /*#__PURE__*/_jsxs(Box, {
325
326
  component: "div",
326
327
  ...attributes,
@@ -5,8 +5,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
5
5
  const More = props => {
6
6
  const {
7
7
  handleClick,
8
- breakpoint,
9
- translation
8
+ translation,
9
+ breakpoint
10
10
  } = props;
11
11
  return /*#__PURE__*/_jsx(Box, {
12
12
  children: /*#__PURE__*/_jsxs(List, {
@@ -19,15 +19,15 @@ const More = props => {
19
19
  className: "item-wrapper",
20
20
  onClick: handleClick("duplicateSection"),
21
21
  children: translation?.translation("Duplicate Section")
22
- }), /*#__PURE__*/_jsx(ListItemButton, {
23
- className: "item-wrapper",
24
- onClick: handleClick("deleteSection"),
25
- children: "Delete Section"
26
22
  }), breakpoint === "xs" ? /*#__PURE__*/_jsx(ListItemButton, {
27
23
  className: "item-wrapper",
28
24
  onClick: handleClick("forceAutoAlignment"),
29
25
  children: "Force Auto Alignment"
30
- }) : null]
26
+ }) : null, /*#__PURE__*/_jsx(ListItemButton, {
27
+ className: "item-wrapper",
28
+ onClick: handleClick("deleteSection"),
29
+ children: "Delete Section"
30
+ })]
31
31
  })
32
32
  });
33
33
  };
@@ -0,0 +1,115 @@
1
+ import { ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
2
+ import { getElementOffset } from "../../common/RnD/VirtualElement/VirtualTextElement";
3
+ import { RND_ITEMS } from "../../helper";
4
+ export const ELEMENT_CASE = {
5
+ ADD_TEXT: "addText",
6
+ ADD_BUTTON: "addButton",
7
+ ADD_SIGNATURE: "addSignature",
8
+ ADD_IMAGE: "addImage",
9
+ ADD_VIDEO: "addVideo",
10
+ ADD_TABLE: "addTable",
11
+ ADD_CODE: "addCode",
12
+ ADD_BOX: "addBox",
13
+ ADD_FORM: "addForm",
14
+ ADD_APP_HEADER: "addAppHeader",
15
+ ADD_DIVIDER: "addDivider"
16
+ };
17
+ const commonXsValues = {
18
+ top_xs: 0,
19
+ marginTop_xs: 12,
20
+ left_xs: 24,
21
+ width_xs: 272,
22
+ xs_updatedOn: new Date().getTime()
23
+ };
24
+ const elementXsValues = {
25
+ [ELEMENT_CASE.ADD_TEXT]: {
26
+ ...commonXsValues,
27
+ height_xs: 50
28
+ },
29
+ [ELEMENT_CASE.ADD_BUTTON]: {
30
+ ...commonXsValues,
31
+ height_xs: 50
32
+ },
33
+ [ELEMENT_CASE.ADD_SIGNATURE]: {
34
+ ...commonXsValues,
35
+ height_xs: 173
36
+ },
37
+ [ELEMENT_CASE.ADD_IMAGE]: {
38
+ ...commonXsValues,
39
+ height_xs: 80
40
+ },
41
+ [ELEMENT_CASE.ADD_VIDEO]: {
42
+ ...commonXsValues,
43
+ height_xs: 300
44
+ },
45
+ [ELEMENT_CASE.ADD_TABLE]: {
46
+ ...commonXsValues,
47
+ height_xs: 165
48
+ },
49
+ [ELEMENT_CASE.ADD_CODE]: {
50
+ ...commonXsValues,
51
+ height: 300
52
+ },
53
+ [ELEMENT_CASE.ADD_BOX]: {
54
+ ...commonXsValues,
55
+ height_xs: 300
56
+ },
57
+ [ELEMENT_CASE.ADD_FORM]: {
58
+ ...commonXsValues,
59
+ height_xs: 80
60
+ },
61
+ [ELEMENT_CASE.ADD_APP_HEADER]: {
62
+ ...commonXsValues,
63
+ height_xs: 80
64
+ },
65
+ [ELEMENT_CASE.ADD_DIVIDER]: {
66
+ ...commonXsValues,
67
+ height_xs: 24
68
+ }
69
+ };
70
+ export const findMaxYValue = (sectionItems, breakpoint) => {
71
+ let maxY = 0;
72
+ sectionItems.forEach(item => {
73
+ const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
74
+ if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
75
+ const {
76
+ bottom
77
+ } = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
78
+ maxY = Math.max(maxY, bottom);
79
+ }
80
+ });
81
+ return maxY;
82
+ };
83
+ export const convertToGridArea = y => {
84
+ // Calculate grid position
85
+ const row = Math.floor(y / ROW_HEIGHT) + 1;
86
+
87
+ // to calculate difference inside the grid
88
+ const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
89
+
90
+ // Update grid area
91
+ const gridArea = `${row} / 1 / ${row + 1} / 2`;
92
+ return {
93
+ gridArea,
94
+ marginTop
95
+ };
96
+ };
97
+ export const getNewElementXsValues = (type, sectionItems) => {
98
+ const values = elementXsValues[type] || {};
99
+ const y = sectionItems?.length ? findMaxYValue(sectionItems) : 0;
100
+ const {
101
+ gridArea,
102
+ marginTop
103
+ } = convertToGridArea(y);
104
+ const BUFFER_MARGIN_TOP = 12;
105
+ const xsVal = {
106
+ ...values,
107
+ gridArea_xs: gridArea,
108
+ marginTop_xs: marginTop + BUFFER_MARGIN_TOP
109
+ };
110
+ const sectionHeightXs = y + values?.height_xs + BUFFER_MARGIN_TOP + 12;
111
+ return {
112
+ xsVal,
113
+ sectionHeightXs
114
+ };
115
+ };
@@ -247,6 +247,9 @@ const useFreeGridStyles = ({
247
247
  },
248
248
  "& > .simple-text": {
249
249
  display: "none"
250
+ },
251
+ "& > .edt-paragraphs": {
252
+ display: "none"
250
253
  }
251
254
  },
252
255
  "& .fgi_type_form": {
@@ -350,6 +353,12 @@ const useFreeGridStyles = ({
350
353
  "& .fgi_type_text": {
351
354
  "& .edt-headings": {
352
355
  margin: "0px"
356
+ },
357
+ "& .edt-paragraphs": {
358
+ margin: "0px"
359
+ },
360
+ "& blockquote": {
361
+ margin: "0px !important"
353
362
  }
354
363
  },
355
364
  /** element toolbar hide */
@@ -292,7 +292,7 @@ const GridItem = props => {
292
292
  ...getBRProps,
293
293
  display: "flex",
294
294
  flexDirection: flexDirection || "column",
295
- background: bgColor || "transparent",
295
+ background: bgColor,
296
296
  borderColor: getBorderColor(),
297
297
  borderWidth: borderWidth || "1px",
298
298
  borderStyle: borderStyle || "solid",
@@ -46,7 +46,8 @@ const PageSettingsButton = props => {
46
46
  const onSave = data => {
47
47
  try {
48
48
  const updateData = {
49
- ...data
49
+ ...data,
50
+ isUploading: false
50
51
  };
51
52
  delete updateData.children;
52
53
  updatePageSettings(editor, updateData);
@@ -35,8 +35,8 @@ const SimpleTextStyle = ({
35
35
  height: "24px",
36
36
  overflow: "hidden",
37
37
  fontSize: "14px",
38
- display: 'inline-flex',
39
- alignItems: 'center',
38
+ display: "inline-flex",
39
+ alignItems: "center",
40
40
  "& .bg-pad-sl": {
41
41
  padding: "2px 4px 2px 4px",
42
42
  background: "transparent",
@@ -307,7 +307,7 @@ const Table = props => {
307
307
  onScroll: handleScroll,
308
308
  onMouseOver: onMouseOver,
309
309
  onMouseLeave: onMouseLeave,
310
- className: !hideTools.includes("add_column") ? "custom-scroll" : '',
310
+ className: "custom-scroll",
311
311
  children: [/*#__PURE__*/_jsx(TableComp, {
312
312
  className: readOnly ? "readOnly" : "",
313
313
  sx: {
@@ -345,8 +345,8 @@ const Table = props => {
345
345
  handleAction: handleAction,
346
346
  exandTools: exandTools,
347
347
  openSetttings: openSetttings,
348
- translation: translation,
349
- hideTools: hideTools
348
+ hideTools: hideTools,
349
+ translation: translation
350
350
  }), /*#__PURE__*/_jsx(MoreTableSettings, {
351
351
  exandTools: exandTools,
352
352
  handleAction: handleAction,
@@ -3,6 +3,12 @@ import { Editor, Text } from "slate";
3
3
  import { useSlate } from "slate-react";
4
4
  import { getNodeText } from "../../utils/helper";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ const isEmptyTextNode = node => {
7
+ if (Text.isText(node)) {
8
+ return !node.text.trim();
9
+ }
10
+ return false;
11
+ };
6
12
  const Title = props => {
7
13
  const {
8
14
  attributes,
@@ -47,10 +53,4 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
47
53
  }
48
54
  }, [editor.selection]);
49
55
  return null;
50
- };
51
- const isEmptyTextNode = node => {
52
- if (Text.isText(node)) {
53
- return !node.text.trim();
54
- }
55
- return false;
56
56
  };
@@ -28,8 +28,9 @@ export const TopBannerToolbar = props => {
28
28
  }
29
29
  };
30
30
  const onSelectImage = img => {
31
+ const embedURL = typeof img === "string" ? img : img?.embedURL ? img?.embedURL : null;
31
32
  updateTopBanner(editor, {
32
- url: img
33
+ url: embedURL
33
34
  });
34
35
  handleClose();
35
36
  };
@@ -56,7 +57,8 @@ export const TopBannerToolbar = props => {
56
57
  open: open,
57
58
  onClose: handleClose,
58
59
  customProps: customProps,
59
- onSelectImage: onSelectImage
60
+ onSelectImage: onSelectImage,
61
+ disableProgress: true
60
62
  })]
61
63
  });
62
64
  };
@@ -17,9 +17,10 @@ const TopBannerButton = props => {
17
17
  translation
18
18
  } = customProps;
19
19
  const onSelectImage = url => {
20
- if (url) {
20
+ const embedURL = typeof url === "string" ? url : url?.embedURL ? url?.embedURL : null;
21
+ if (embedURL) {
21
22
  insertTopBanner(editor, {
22
- url
23
+ url: embedURL
23
24
  });
24
25
  }
25
26
  setOpen(false);
@@ -42,7 +43,8 @@ const TopBannerButton = props => {
42
43
  open: open,
43
44
  onClose: handleClose,
44
45
  customProps: customProps,
45
- onSelectImage: onSelectImage
46
+ onSelectImage: onSelectImage,
47
+ disableProgress: true
46
48
  })]
47
49
  });
48
50
  };
@@ -34,7 +34,8 @@ const VariableButton = props => {
34
34
  PaperProps: {
35
35
  style: {
36
36
  maxHeight: 300,
37
- overflowY: "auto"
37
+ overflowY: "auto",
38
+ transformOrigin: 'top left'
38
39
  },
39
40
  sx: {
40
41
  "&::-webkit-scrollbar-track": {
@@ -44,6 +45,14 @@ const VariableButton = props => {
44
45
  borderRadius: "16px"
45
46
  }
46
47
  }
48
+ },
49
+ anchorOrigin: {
50
+ vertical: 'bottom',
51
+ horizontal: 'right'
52
+ },
53
+ transformOrigin: {
54
+ vertical: 'top',
55
+ horizontal: 'right'
47
56
  }
48
57
  },
49
58
  children: [/*#__PURE__*/_jsx(MenuItem, {
@@ -45,12 +45,13 @@ const MiniEditor = props => {
45
45
  const {
46
46
  translationMock
47
47
  } = otherProps;
48
+ const dummyTranslation = () => {};
48
49
  const customProps = {
49
50
  ...(otherProps || {}),
50
51
  readOnly: isReadOnly,
51
52
  editorPlaceholder: miniEditorPlaceholder,
52
53
  page_id: id,
53
- translation: translation || translationMock
54
+ translation: translation || translationMock || dummyTranslation
54
55
  };
55
56
  const [mentions, setMentions] = useMentions({
56
57
  editor,