@flozy/editor 11.0.3 → 11.0.5

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 (146) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +129 -16
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +36 -8
  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/Embed/Embed.js +36 -43
  19. package/dist/Editor/Elements/Embed/Image.js +236 -23
  20. package/dist/Editor/Elements/Embed/Video.js +245 -15
  21. package/dist/Editor/Elements/Form/Form.js +16 -10
  22. package/dist/Editor/Elements/Form/FormField.js +1 -1
  23. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  24. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  25. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +31 -74
  26. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
  27. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
  28. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  29. package/dist/Editor/Elements/FreeGrid/helper.js +194 -0
  30. package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
  31. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  32. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  33. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
  34. package/dist/Editor/Elements/Signature/SignaturePopup.js +24 -6
  35. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  36. package/dist/Editor/Elements/Table/Table.js +3 -3
  37. package/dist/Editor/Elements/Title/title.js +6 -6
  38. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  39. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  40. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  41. package/dist/Editor/MiniEditor.js +2 -1
  42. package/dist/Editor/Styles/EditorStyles.js +19 -4
  43. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  44. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  45. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  46. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  47. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  48. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  49. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
  53. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  54. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
  55. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
  56. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  57. package/dist/Editor/Toolbar/PopupTool/index.js +4 -3
  58. package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
  59. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  60. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  61. package/dist/Editor/common/ColorPickerButton.js +38 -16
  62. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  63. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  64. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  65. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  66. package/dist/Editor/common/CustomSelect.js +43 -0
  67. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  68. package/dist/Editor/common/FontLoader/FontLoader.js +4 -0
  69. package/dist/Editor/common/Icon.js +28 -0
  70. package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
  71. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  72. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  73. package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
  74. package/dist/Editor/common/MentionsPopup/index.js +9 -1
  75. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  76. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  77. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  78. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  80. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  82. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  83. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  85. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -2
  86. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  87. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  88. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
  89. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  90. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
  91. package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
  92. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  93. package/dist/Editor/common/RnD/index.js +61 -14
  94. package/dist/Editor/common/Shorthands/elements.js +62 -4
  95. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  96. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  103. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  104. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  105. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  106. package/dist/Editor/common/StyleBuilder/index.js +8 -4
  107. package/dist/Editor/common/Uploader.js +125 -17
  108. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  109. package/dist/Editor/common/iconslist.js +21 -0
  110. package/dist/Editor/commonStyle.js +67 -18
  111. package/dist/Editor/helper/index.js +10 -2
  112. package/dist/Editor/helper/textIndeces.js +58 -0
  113. package/dist/Editor/helper/theme.js +203 -2
  114. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  115. package/dist/Editor/hooks/useMouseMove.js +9 -3
  116. package/dist/Editor/hooks/useThemeValues.js +63 -0
  117. package/dist/Editor/plugins/withEmbeds.js +12 -1
  118. package/dist/Editor/plugins/withHTML.js +3 -1
  119. package/dist/Editor/plugins/withTable.js +1 -1
  120. package/dist/Editor/service/fileupload.js +70 -0
  121. package/dist/Editor/theme/ThemeList.js +50 -173
  122. package/dist/Editor/theme/index.js +149 -0
  123. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  124. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  125. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  126. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  127. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  128. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  129. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  130. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  131. package/dist/Editor/themeSettings/icons.js +60 -0
  132. package/dist/Editor/themeSettings/index.js +380 -0
  133. package/dist/Editor/themeSettings/style.js +299 -0
  134. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  135. package/dist/Editor/themeSettingsAI/index.js +355 -0
  136. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  137. package/dist/Editor/themeSettingsAI/style.js +332 -0
  138. package/dist/Editor/utils/SlateUtilityFunctions.js +191 -40
  139. package/dist/Editor/utils/accordion.js +67 -39
  140. package/dist/Editor/utils/button.js +1 -17
  141. package/dist/Editor/utils/draftToSlate.js +3 -2
  142. package/dist/Editor/utils/events.js +94 -89
  143. package/dist/Editor/utils/font.js +40 -37
  144. package/dist/Editor/utils/helper.js +98 -22
  145. package/package.json +4 -4
  146. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -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 { getElementValues } 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
+ elValues,
189
+ sectionVal
190
+ } = getElementValues(type, element?.children, breakpoint);
191
+ const id = crypto?.randomUUID();
186
192
  switch (type) {
187
193
  case "addText":
188
194
  Transforms.insertNodes(editor, [{
@@ -194,12 +200,7 @@ const FreeGrid = props => {
194
200
  text: "Text"
195
201
  }]
196
202
  }],
197
- gridArea: "3 / 1 / 4 / 2",
198
- left: 50,
199
- marginTop: 0,
200
- top: 0,
201
- width: 170,
202
- height: 30
203
+ ...(elValues || {})
203
204
  }], {
204
205
  at: [...insertAt]
205
206
  });
@@ -217,29 +218,10 @@ const FreeGrid = props => {
217
218
  linkType: "webAddress"
218
219
  },
219
220
  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
221
  textAlign: "center",
235
222
  label: "Get Started"
236
223
  }],
237
- gridArea: "3 / 1 / 4 / 2",
238
- left: 50,
239
- marginTop: 0,
240
- top: 0,
241
- width: 143,
242
- height: 50
224
+ ...(elValues || {})
243
225
  }], {
244
226
  at: [...insertAt]
245
227
  });
@@ -259,14 +241,7 @@ const FreeGrid = props => {
259
241
  date: ""
260
242
  }
261
243
  }],
262
- gridArea: "3 / 1 / 4 / 2",
263
- left: 50,
264
- marginTop: 0,
265
- top: 0,
266
- width: 217,
267
- height: 173,
268
- width_xs: 217,
269
- height_xs: 173
244
+ ...(elValues || {})
270
245
  }], {
271
246
  at: [...insertAt]
272
247
  });
@@ -282,14 +257,11 @@ const FreeGrid = props => {
282
257
  images: [],
283
258
  children: [{
284
259
  text: ""
285
- }]
260
+ }],
261
+ fromFreeGrid: true,
262
+ uniqueId: id
286
263
  }],
287
- gridArea: "3 / 1 / 4 / 2",
288
- left: 50,
289
- marginTop: 0,
290
- top: 0,
291
- width: 170,
292
- height: 80
264
+ ...(elValues || {})
293
265
  }], {
294
266
  at: [...insertAt]
295
267
  });
@@ -301,8 +273,7 @@ const FreeGrid = props => {
301
273
  alt: "",
302
274
  images: []
303
275
  }), {
304
- height: 370,
305
- width: 650
276
+ ...(elValues || {})
306
277
  })
307
278
  }], {
308
279
  at: [...insertAt]
@@ -313,8 +284,7 @@ const FreeGrid = props => {
313
284
  ...insertFreeGridItem("table", {
314
285
  ...DEFAULT_TABLE_NODE()
315
286
  }, {
316
- height: 150,
317
- width: 400
287
+ ...(elValues || {})
318
288
  })
319
289
  }], {
320
290
  at: [...insertAt]
@@ -333,12 +303,7 @@ const FreeGrid = props => {
333
303
  isEncoded: true,
334
304
  isSanitized: true
335
305
  }],
336
- gridArea: "3 / 1 / 4 / 2",
337
- left: 50,
338
- marginTop: 0,
339
- top: 0,
340
- width: 400,
341
- height: 300
306
+ ...(elValues || {})
342
307
  }], {
343
308
  at: [...insertAt]
344
309
  });
@@ -350,7 +315,9 @@ const FreeGrid = props => {
350
315
  children: [{
351
316
  text: ""
352
317
  }]
353
- }, {}, "freegridBox")
318
+ }, {
319
+ ...(elValues || {})
320
+ }, "freegridBox")
354
321
  }], {
355
322
  at: [...insertAt]
356
323
  });
@@ -360,8 +327,7 @@ const FreeGrid = props => {
360
327
  ...insertFreeGridItem("form", {
361
328
  ...FORM_NODE()
362
329
  }, {
363
- height: 92,
364
- width: 400
330
+ ...(elValues || {})
365
331
  })
366
332
  }], {
367
333
  at: [...insertAt]
@@ -374,8 +340,7 @@ const FreeGrid = props => {
374
340
  menus: null
375
341
  })
376
342
  }, {
377
- height: 60,
378
- width: 400
343
+ ...(elValues || {})
379
344
  })
380
345
  }], {
381
346
  at: [...insertAt]
@@ -391,29 +356,21 @@ const FreeGrid = props => {
391
356
  text: ""
392
357
  }]
393
358
  }],
394
- gridArea: "3 / 1 / 4 / 2",
395
- left: 50,
396
- marginTop: 0,
397
- top: 0,
398
- width: 170,
399
- height: 30
359
+ ...(elValues || {})
400
360
  }], {
401
361
  at: [...insertAt]
402
362
  });
403
363
  break;
404
364
  default:
405
365
  }
406
- if (breakpoint === "lg") {
407
- setSelectedElement({});
408
-
409
- // auto align in mobile
410
- Transforms.setNodes(editor, {
411
- xs_updatedOn: null,
412
- updated_at: new Date().getTime()
413
- }, {
414
- at: path
415
- });
416
- }
366
+ setSelectedElement({});
367
+ // increase the section height if new element is inserted based on auto align
368
+ Transforms.setNodes(editor, {
369
+ ...sectionVal,
370
+ updated_at: new Date().getTime()
371
+ }, {
372
+ at: path
373
+ });
417
374
  count.current = count.current + 1;
418
375
 
419
376
  // focus on newly added element
@@ -519,7 +476,7 @@ const FreeGrid = props => {
519
476
  style: {
520
477
  position: "relative",
521
478
  "--height": `${height}px`,
522
- display: 'block' //for test purpose
479
+ display: "block" //for test purpose
523
480
  },
524
481
 
525
482
  dataSets: {
@@ -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("_")}`,
@@ -192,7 +197,8 @@ const FreeGridBox = props => {
192
197
  "data-margin-top-xs": marginTop_xs,
193
198
  "data-height-xs": height_xs,
194
199
  "data-width-xs": width_xs,
195
- "data-left-xs": left_xs
200
+ "data-left-xs": left_xs,
201
+ "data-width-lg": width
196
202
  },
197
203
  gridArea: gridArea,
198
204
  onChange: onChange,
@@ -226,9 +232,7 @@ const FreeGridBox = props => {
226
232
  "--rows": `repeat(${repeatTimes}, ${ROW_HEIGHT}px)`
227
233
  },
228
234
  sx: {
229
- borderRadius: {
230
- ...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
231
- },
235
+ ...boxSp,
232
236
  background: sectionBgColor,
233
237
  backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
234
238
  borderColor: borderColor || "transparent",
@@ -296,7 +296,8 @@ const FreeGridItem = props => {
296
296
  "data-margin-top-xs": marginTop_xs,
297
297
  "data-height-xs": height_xs,
298
298
  "data-width-xs": width_xs,
299
- "data-left-xs": left_xs
299
+ "data-left-xs": left_xs,
300
+ "data-width-lg": width
300
301
  },
301
302
  defaultStyle: {
302
303
  height: `${height}px`,
@@ -321,6 +322,7 @@ const FreeGridItem = props => {
321
322
  customProps: customProps,
322
323
  translation: translation,
323
324
  xsHidden: xsHidden,
325
+ disableClick: element?.children?.[0]?.isUploading && (element?.childType === "image" || element?.childType === "video"),
324
326
  children: /*#__PURE__*/_jsxs(Box, {
325
327
  component: "div",
326
328
  ...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,194 @@
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 elementValues = {
25
+ [ELEMENT_CASE.ADD_TEXT]: {
26
+ gridArea: "3 / 1 / 4 / 2",
27
+ left: 50,
28
+ marginTop: 0,
29
+ top: 0,
30
+ width: 170,
31
+ height: 30,
32
+ height_xs: 50,
33
+ ...commonXsValues
34
+ },
35
+ [ELEMENT_CASE.ADD_BUTTON]: {
36
+ gridArea: "3 / 1 / 4 / 2",
37
+ left: 50,
38
+ marginTop: 0,
39
+ top: 0,
40
+ width: 143,
41
+ height: 50,
42
+ height_xs: 50,
43
+ ...commonXsValues
44
+ },
45
+ [ELEMENT_CASE.ADD_SIGNATURE]: {
46
+ left: 50,
47
+ marginTop: 0,
48
+ top: 0,
49
+ width: 217,
50
+ height: 173,
51
+ height_xs: 173,
52
+ ...commonXsValues
53
+ },
54
+ [ELEMENT_CASE.ADD_IMAGE]: {
55
+ gridArea: "3 / 1 / 4 / 2",
56
+ left: 50,
57
+ marginTop: 0,
58
+ top: 0,
59
+ width: 170,
60
+ height: 80,
61
+ height_xs: 80,
62
+ ...commonXsValues
63
+ },
64
+ [ELEMENT_CASE.ADD_VIDEO]: {
65
+ height: 370,
66
+ width: 650,
67
+ height_xs: 300,
68
+ ...commonXsValues
69
+ },
70
+ [ELEMENT_CASE.ADD_TABLE]: {
71
+ height: 150,
72
+ width: 400,
73
+ height_xs: 165,
74
+ ...commonXsValues
75
+ },
76
+ [ELEMENT_CASE.ADD_CODE]: {
77
+ gridArea: "3 / 1 / 4 / 2",
78
+ left: 50,
79
+ marginTop: 0,
80
+ top: 0,
81
+ width: 400,
82
+ height: 300,
83
+ ...commonXsValues
84
+ },
85
+ [ELEMENT_CASE.ADD_BOX]: {
86
+ height_xs: 300,
87
+ ...commonXsValues
88
+ },
89
+ [ELEMENT_CASE.ADD_FORM]: {
90
+ height: 92,
91
+ width: 400,
92
+ height_xs: 80,
93
+ ...commonXsValues
94
+ },
95
+ [ELEMENT_CASE.ADD_APP_HEADER]: {
96
+ height: 60,
97
+ width: 400,
98
+ height_xs: 80,
99
+ ...commonXsValues
100
+ },
101
+ [ELEMENT_CASE.ADD_DIVIDER]: {
102
+ gridArea: "3 / 1 / 4 / 2",
103
+ left: 50,
104
+ marginTop: 0,
105
+ top: 0,
106
+ width: 170,
107
+ height: 30,
108
+ height_xs: 24,
109
+ ...commonXsValues
110
+ }
111
+ };
112
+ export const findMaxYValue = (sectionItems, breakpoint) => {
113
+ let maxY = 0;
114
+ sectionItems.forEach(item => {
115
+ if (!item?.type) {
116
+ return;
117
+ }
118
+ const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
119
+ if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
120
+ const {
121
+ bottom
122
+ } = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
123
+ maxY = Math.max(maxY, bottom);
124
+ }
125
+ });
126
+ return maxY;
127
+ };
128
+ export const convertToGridArea = y => {
129
+ // Calculate grid position
130
+ const row = Math.floor(y / ROW_HEIGHT) + 1;
131
+
132
+ // to calculate difference inside the grid
133
+ const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
134
+
135
+ // Update grid area
136
+ const gridArea = `${row} / 1 / ${row + 1} / 2`;
137
+ return {
138
+ gridArea,
139
+ marginTop
140
+ };
141
+ };
142
+ const BUFFER_MARGIN_TOP = 12;
143
+ const getInsertValues = (sectionItems, breakpoint, elValues) => {
144
+ const y_xs = sectionItems?.length ? findMaxYValue(sectionItems, breakpoint) : 0;
145
+ const {
146
+ gridArea,
147
+ marginTop
148
+ } = convertToGridArea(y_xs);
149
+ const appendBp = breakpoint === "lg" ? "" : "_xs";
150
+ const insertPos = {
151
+ [`gridArea${appendBp}`]: gridArea,
152
+ [`marginTop${appendBp}`]: marginTop + BUFFER_MARGIN_TOP
153
+ };
154
+ const sectionHeight = y_xs + elValues[`height${appendBp}`] + BUFFER_MARGIN_TOP + 12;
155
+ return {
156
+ insertPos,
157
+ sectionHeight
158
+ };
159
+ };
160
+ export const getElementValues = (type, sectionItems, breakpoint) => {
161
+ const elValues = elementValues[type] || {};
162
+ let elInsertPos = {};
163
+ let sectionVal = {};
164
+
165
+ // insert element on xs
166
+ const {
167
+ insertPos: insertPos_xs,
168
+ sectionHeight: sectionHeight_xs
169
+ } = getInsertValues(sectionItems, "xs", elValues);
170
+ elInsertPos = {
171
+ ...insertPos_xs
172
+ };
173
+ sectionVal.height_xs = sectionHeight_xs;
174
+
175
+ // if user in xs, auto-align lg
176
+ if (breakpoint === "xs") {
177
+ const {
178
+ insertPos: insertPos_lg,
179
+ sectionHeight
180
+ } = getInsertValues(sectionItems, "lg", elValues);
181
+ elInsertPos = {
182
+ ...elInsertPos,
183
+ ...insertPos_lg
184
+ };
185
+ sectionVal.height = sectionHeight;
186
+ }
187
+ return {
188
+ elValues: {
189
+ ...elValues,
190
+ ...elInsertPos
191
+ },
192
+ sectionVal
193
+ };
194
+ };
@@ -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": {
@@ -309,6 +312,12 @@ const useFreeGridStyles = ({
309
312
  "& .toolbtn.remove": {
310
313
  display: "none"
311
314
  }
315
+ },
316
+ "& .edt-headings": {
317
+ margin: "0px"
318
+ },
319
+ "& .edt-paragraphs": {
320
+ margin: "0px"
312
321
  }
313
322
  },
314
323
  "& .fgi_type_embedScript": {
@@ -350,6 +359,12 @@ const useFreeGridStyles = ({
350
359
  "& .fgi_type_text": {
351
360
  "& .edt-headings": {
352
361
  margin: "0px"
362
+ },
363
+ "& .edt-paragraphs": {
364
+ margin: "0px"
365
+ },
366
+ "& blockquote": {
367
+ margin: "0px !important"
353
368
  }
354
369
  },
355
370
  /** 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);
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { signedTextFonts } from "../../../utils/font";
3
3
  import { Grid, Button, TextField, InputAdornment, IconButton, Typography } from "@mui/material";
4
- import ClearRoundedIcon from '@mui/icons-material/ClearRounded';
4
+ import ClearRoundedIcon from "@mui/icons-material/ClearRounded";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  const TypeSignature = props => {
@@ -80,7 +80,8 @@ const TypeSignature = props => {
80
80
  children: /*#__PURE__*/_jsx(ClearRoundedIcon, {})
81
81
  })
82
82
  })
83
- }
83
+ },
84
+ autoComplete: "typeName"
84
85
  })
85
86
  })
86
87
  })
@@ -92,9 +92,17 @@ const SignaturePopup = props => {
92
92
  };
93
93
  const onChange = e => {
94
94
  e?.stopPropagation();
95
+ const {
96
+ name,
97
+ value
98
+ } = e.target;
99
+ const fieldMap = {
100
+ name: "signedBy",
101
+ email: "signedByEmail"
102
+ };
95
103
  setSignedData({
96
104
  ...signedData,
97
- [e.target.name]: e.target.value
105
+ [fieldMap[name] || name]: value
98
106
  });
99
107
  };
100
108
  const onBrushSize = val => () => {
@@ -311,15 +319,19 @@ const SignaturePopup = props => {
311
319
  xs: 12,
312
320
  children: /*#__PURE__*/_jsx(TextField, {
313
321
  fullWidth: true,
314
- id: "signedBy",
315
- name: "signedBy",
322
+ id: "name",
323
+ name: "name",
316
324
  placeholder: translation("Enter Name"),
317
325
  value: signedData.signedBy || ""
318
326
  // defaultValue={defaultName || ""}
319
327
  ,
320
328
  size: "small",
321
329
  onChange: onChange,
322
- sx: classes.signaturePopUpNameField
330
+ sx: classes.signaturePopUpNameField,
331
+ autoComplete: "name",
332
+ inputProps: {
333
+ autoComplete: "name"
334
+ }
323
335
  })
324
336
  })]
325
337
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -439,14 +451,20 @@ const SignaturePopup = props => {
439
451
  item: true,
440
452
  children: /*#__PURE__*/_jsx(TextField, {
441
453
  fullWidth: true,
442
- id: "signedByEmail",
443
- name: "signedByEmail",
454
+ id: "email",
455
+ name: "email",
456
+ type: "email",
444
457
  placeholder: translation("Enter Email"),
445
458
  size: "small",
446
459
  onChange: onChange,
447
460
  sx: classes.signaturePopUpNameField,
448
461
  value: signedData.signedByEmail || ""
449
462
  // defaultValue={defaultEmail || ""}
463
+ ,
464
+ autoComplete: "email",
465
+ inputProps: {
466
+ autoComplete: "email"
467
+ }
450
468
  })
451
469
  })]
452
470
  })]
@@ -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",
@@ -308,7 +308,7 @@ const Table = props => {
308
308
  onScroll: handleScroll,
309
309
  onMouseOver: onMouseOver,
310
310
  onMouseLeave: onMouseLeave,
311
- className: !hideTools.includes("add_column") ? "custom-scroll" : '',
311
+ className: "custom-scroll",
312
312
  children: [/*#__PURE__*/_jsx(TableComp, {
313
313
  className: readOnly ? "readOnly" : "",
314
314
  sx: {
@@ -346,8 +346,8 @@ const Table = props => {
346
346
  handleAction: handleAction,
347
347
  exandTools: exandTools,
348
348
  openSetttings: openSetttings,
349
- translation: translation,
350
- hideTools: hideTools
349
+ hideTools: hideTools,
350
+ translation: translation
351
351
  }), /*#__PURE__*/_jsx(MoreTableSettings, {
352
352
  exandTools: exandTools,
353
353
  handleAction: handleAction,
@@ -3,6 +3,12 @@ import { Text } from "slate";
3
3
  import { useSlate } from "slate-react";
4
4
  import { getNodeText, getNodeWithType } 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,
@@ -46,10 +52,4 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
46
52
  }
47
53
  }, [editor.selection]);
48
54
  return null;
49
- };
50
- const isEmptyTextNode = node => {
51
- if (Text.isText(node)) {
52
- return !node.text.trim();
53
- }
54
- return false;
55
55
  };