@flozy/editor 9.8.5 → 9.8.7

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 (137) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +119 -17
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +17 -9
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Button/EditorButton.js +25 -9
  8. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  11. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  12. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
  15. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +5 -1
  16. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +3 -2
  17. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +11 -0
  18. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  19. package/dist/Editor/Elements/Embed/Image.js +2 -2
  20. package/dist/Editor/Elements/Embed/Video.js +1 -1
  21. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  22. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +48 -22
  23. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +25 -4
  24. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +46 -3
  25. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -2
  26. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  27. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  28. package/dist/Editor/Elements/List/CheckList.js +4 -1
  29. package/dist/Editor/Elements/SimpleText/index.js +9 -1
  30. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  31. package/dist/Editor/Elements/Table/Table.js +3 -3
  32. package/dist/Editor/Elements/Title/title.js +6 -6
  33. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  34. package/dist/Editor/MiniEditor.js +2 -1
  35. package/dist/Editor/Styles/EditorStyles.js +5 -5
  36. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  37. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  38. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  39. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  40. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
  44. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  45. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +72 -12
  46. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +95 -23
  47. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  48. package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
  49. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  50. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  51. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  52. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  53. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  54. package/dist/Editor/common/ColorPickerButton.js +38 -16
  55. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  56. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  57. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  58. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  59. package/dist/Editor/common/CustomSelect.js +43 -0
  60. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  61. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  62. package/dist/Editor/common/Icon.js +31 -1
  63. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  64. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +24 -0
  65. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  66. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  68. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  69. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  70. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  71. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  72. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  73. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
  74. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  75. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  76. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
  77. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  78. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  79. package/dist/Editor/common/RnD/Utils/gridDropItem.js +73 -9
  80. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  81. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  82. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  83. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  84. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  85. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  86. package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
  87. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  88. package/dist/Editor/common/RnD/index.js +59 -3
  89. package/dist/Editor/common/Shorthands/elements.js +54 -0
  90. package/dist/Editor/common/SnackBar/index.js +43 -0
  91. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  100. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  101. package/dist/Editor/common/Uploader.js +8 -0
  102. package/dist/Editor/common/iconslist.js +7 -8
  103. package/dist/Editor/commonStyle.js +95 -60
  104. package/dist/Editor/helper/textIndeces.js +58 -0
  105. package/dist/Editor/helper/theme.js +202 -2
  106. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  107. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  108. package/dist/Editor/hooks/useMouseMove.js +9 -3
  109. package/dist/Editor/hooks/useThemeValues.js +63 -0
  110. package/dist/Editor/plugins/withEmbeds.js +1 -1
  111. package/dist/Editor/plugins/withHTML.js +10 -7
  112. package/dist/Editor/plugins/withLinks.js +9 -10
  113. package/dist/Editor/plugins/withTable.js +1 -1
  114. package/dist/Editor/theme/ThemeList.js +50 -173
  115. package/dist/Editor/theme/index.js +149 -0
  116. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  117. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  118. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  119. package/dist/Editor/themeSettings/colorTheme/index.js +309 -0
  120. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  121. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  122. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  123. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  124. package/dist/Editor/themeSettings/icons.js +60 -0
  125. package/dist/Editor/themeSettings/index.js +361 -0
  126. package/dist/Editor/themeSettings/style.js +292 -0
  127. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  128. package/dist/Editor/themeSettingsAI/index.js +355 -0
  129. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  130. package/dist/Editor/themeSettingsAI/style.js +324 -0
  131. package/dist/Editor/utils/SlateUtilityFunctions.js +171 -45
  132. package/dist/Editor/utils/button.js +1 -17
  133. package/dist/Editor/utils/draftToSlate.js +3 -2
  134. package/dist/Editor/utils/font.js +40 -37
  135. package/dist/Editor/utils/freegrid.js +2 -3
  136. package/dist/Editor/utils/helper.js +90 -19
  137. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import { Editor, Transforms, Element as SlateElement, Range, Text, Element } from "slate";
1
+ import { Editor, Transforms, Element as SlateElement, Range } from "slate";
2
2
  import { Box } from "@mui/material";
3
3
  import { sizeMap } from "./font";
4
4
  import Link from "../Elements/Link/Link";
@@ -34,12 +34,12 @@ import SimpleText from "../Elements/SimpleText";
34
34
  import CheckList from "../Elements/List/CheckList";
35
35
  import { getTextColor, isEmptyTextNode } from "../helper";
36
36
  import Attachments from "../Elements/Attachments/Attachments";
37
- import { getBreakPointsValue, groupByBreakpoint } from "../helper/theme";
37
+ import { getBreakPointsValue, textThemeFields, getElementProperty } from "../helper/theme";
38
38
  import Variables from "../Elements/Variables/Variable";
39
- import insertNewLine from "./insertNewLine";
40
39
  import Divider from "../Elements/Divider/Divider";
41
40
  import { getBorderColor, getSlateDom } from "./helper";
42
41
  import Code from "../Elements/EmbedScript/Code";
42
+ import { ReactEditor } from "slate-react";
43
43
  import FreeGrid from "../Elements/FreeGrid/FreeGrid";
44
44
  import FreeGridItem from "../Elements/FreeGrid/FreeGridItem";
45
45
  import FreeGridBox from "../Elements/FreeGrid/FreeGridBox";
@@ -47,7 +47,7 @@ import DataView from "../Elements/DataView/DataView";
47
47
  import ViewData from "../Elements/DataView/Layouts/ViewData";
48
48
  import ColumnView from "../Elements/DataView/Layouts/ColumnView";
49
49
  import SearchAttachment from "../Elements/Search/SearchAttachment";
50
- // import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
50
+ import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
51
51
  import { jsx as _jsx } from "react/jsx-runtime";
52
52
  import { jsxs as _jsxs } from "react/jsx-runtime";
53
53
  const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
@@ -56,7 +56,17 @@ const LIST_FORMAT_TYPE = {
56
56
  orderedList: "list-item",
57
57
  unorderedList: "list-item"
58
58
  };
59
- const NEWLINESAFTER = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix"];
59
+
60
+ // const NEWLINESAFTER = [
61
+ // "headingOne",
62
+ // "headingTwo",
63
+ // "headingThree",
64
+ // "headingFour",
65
+ // "headingFive",
66
+ // "headingSix",
67
+ // ];
68
+
69
+ const THEME_BLOCK_FIELDS = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree"];
60
70
  export const toggleBlock = (editor, format, selection = true, attr = {}) => {
61
71
  const isActive = isBlockActive(editor, format);
62
72
  const isList = list_types.includes(format);
@@ -89,8 +99,9 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
89
99
  if (!selection) {
90
100
  Transforms.insertText(editor, "");
91
101
  }
102
+ const forActiveType = THEME_BLOCK_FIELDS.some(f => f === format) ? format : "paragraph";
92
103
  Transforms.setNodes(editor, {
93
- type: isActive ? "paragraph" : isList ? LIST_FORMAT_TYPE[format] : format,
104
+ type: isActive ? forActiveType : isList ? LIST_FORMAT_TYPE[format] : format,
94
105
  ...attr
95
106
  });
96
107
  if (isList && !isActive) {
@@ -99,10 +110,12 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
99
110
  children: []
100
111
  });
101
112
  }
102
- if (NEWLINESAFTER.indexOf(format) > -1) {
103
- insertNewLine(editor);
104
- }
113
+
114
+ // if (NEWLINESAFTER.indexOf(format) > -1) {
115
+ // insertNewLine(editor);
116
+ // }
105
117
  };
118
+
106
119
  export const addMarkData = (editor, data) => {
107
120
  try {
108
121
  Editor.addMark(editor, data.format, data.value);
@@ -111,9 +124,14 @@ export const addMarkData = (editor, data) => {
111
124
  }
112
125
  };
113
126
  export const toggleMark = (editor, format) => {
114
- const isActive = isMarkActive(editor, format);
127
+ const isActive = isMarkBtnActive(editor, format);
115
128
  if (isActive) {
116
- Editor.removeMark(editor, format);
129
+ const isThemeSupportedMark = textThemeFields.some(f => f === format);
130
+ if (isThemeSupportedMark) {
131
+ Editor.addMark(editor, format, false);
132
+ } else {
133
+ Editor.removeMark(editor, format);
134
+ }
117
135
  } else {
118
136
  Editor.addMark(editor, format, true);
119
137
  }
@@ -127,6 +145,58 @@ export const isMarkActive = (editor, format) => {
127
145
  return null;
128
146
  }
129
147
  };
148
+ export const isMarkBtnActive = (editor, format) => {
149
+ switch (format) {
150
+ case "bold":
151
+ {
152
+ const style = getSelectedElementStyle("font-weight", editor);
153
+ return style === "700";
154
+ }
155
+ case "italic":
156
+ {
157
+ const style = getSelectedElementStyle("font-style", editor);
158
+ return style === format;
159
+ }
160
+ // case "underline": {
161
+ // const style = getSelectedElementStyle("text-decoration");
162
+
163
+ // return style?.includes(format);
164
+ // }
165
+ // case "strikethrough": {
166
+ // const style = getSelectedElementStyle("text-decoration");
167
+
168
+ // return style?.includes("line-through");
169
+ // }
170
+ default:
171
+ return isMarkActive(editor, format);
172
+ }
173
+ };
174
+ export const getSelectedElementStyle = (styleProperty, editor, format) => {
175
+ try {
176
+ if (!editor.selection) {
177
+ return "";
178
+ }
179
+ if (Range.isCollapsed(editor.selection)) {
180
+ return "";
181
+ }
182
+ if (format) {
183
+ const value = activeMark(editor, format, true);
184
+ if (value) {
185
+ return value;
186
+ }
187
+ }
188
+ const domRange = ReactEditor.toDOMRange(editor, editor.selection);
189
+ const selectedDomNode = domRange.commonAncestorContainer;
190
+
191
+ // If it's a text node, get its parent element
192
+ const selectedElement = selectedDomNode.nodeType === 3 ? selectedDomNode.parentElement : selectedDomNode;
193
+ if (selectedElement) {
194
+ return getElementProperty(selectedElement, styleProperty);
195
+ }
196
+ } catch (err) {
197
+ console.log(err);
198
+ }
199
+ };
130
200
  export const isBlockActive = (editor, format) => {
131
201
  const [match] = Editor.nodes(editor, {
132
202
  match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
@@ -152,7 +222,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
152
222
  });
153
223
  }
154
224
  };
155
- export const activeMark = (editor, format) => {
225
+ export const activeMark = (editor, format, noDefaultValue) => {
156
226
  const defaultMarkData = {
157
227
  color: "#000000",
158
228
  bgColor: "#FFFFFF",
@@ -162,7 +232,7 @@ export const activeMark = (editor, format) => {
162
232
  };
163
233
  try {
164
234
  const marks = Editor.marks(editor);
165
- let defaultValue = defaultMarkData[format];
235
+ let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
166
236
  const {
167
237
  selection
168
238
  } = editor || {};
@@ -179,6 +249,31 @@ export const activeMark = (editor, format) => {
179
249
  return null;
180
250
  }
181
251
  };
252
+
253
+ // to avoid the styles, that automatically assign from themes
254
+ const getThemeMarkedLeaf = (leaf, children) => {
255
+ const {
256
+ italic,
257
+ bold
258
+ } = leaf || {};
259
+ const style = {};
260
+ if (italic === false) {
261
+ style.fontStyle = "normal";
262
+ }
263
+ if (bold === false) {
264
+ style.fontWeight = "normal";
265
+ }
266
+ if (Object.keys(style).length) {
267
+ children = /*#__PURE__*/_jsx(Box, {
268
+ component: "span",
269
+ sx: {
270
+ "& span": style
271
+ },
272
+ children: children
273
+ });
274
+ }
275
+ return children;
276
+ };
182
277
  export const getMarked = (leaf, children, theme) => {
183
278
  const className = leaf?.doublequote ? "doublequote" : "";
184
279
  if (leaf.highlight) {
@@ -205,6 +300,7 @@ export const getMarked = (leaf, children, theme) => {
205
300
  children: children
206
301
  });
207
302
  }
303
+ children = getThemeMarkedLeaf(leaf, children);
208
304
  if (leaf.strikethrough) {
209
305
  children = /*#__PURE__*/_jsx("span", {
210
306
  style: {
@@ -232,20 +328,27 @@ export const getMarked = (leaf, children, theme) => {
232
328
  if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
233
329
  const family = leaf?.fontFamily;
234
330
  const textStyles = getTextColor(leaf?.color);
331
+ const fontSize = {
332
+ lg: sizeMap[leaf.fontSize] || leaf.fontSize,
333
+ ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
334
+ };
335
+ const fontSizesImportant = {};
336
+ Object.entries(fontSize).forEach(([key, value]) => {
337
+ fontSizesImportant[key] = `${value} !important`;
338
+ });
339
+ const fontSizeWithBreakpoints = wrapThemeBreakpoints(fontSizesImportant, "fontSize", theme);
235
340
  children = /*#__PURE__*/_jsx("span", {
236
- style: {
237
- background: leaf.bgColor
238
- },
239
341
  children: /*#__PURE__*/_jsx(Box, {
240
- className: className,
342
+ className: `${className} leaf-item`,
241
343
  component: "span",
242
344
  sx: {
243
- ...groupByBreakpoint({
244
- fontSize: {
245
- lg: sizeMap[leaf.fontSize] || leaf.fontSize,
246
- ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
247
- }
248
- }, theme),
345
+ "& span": {
346
+ // fontSize: fontSizesImportant,
347
+ // ...groupByBreakpoint(fontSizesImportant, theme),
348
+ background: leaf.bgColor,
349
+ ...fontSizeWithBreakpoints
350
+ },
351
+ ...fontSizeWithBreakpoints,
249
352
  // ...wrapThemeBreakpoints(
250
353
  // {
251
354
  // lg: sizeMap[leaf.fontSize] || leaf.fontSize,
@@ -265,6 +368,9 @@ export const getMarked = (leaf, children, theme) => {
265
368
  fontWeight: leaf.fontWeight,
266
369
  WebkitTextFillColor: "unset !important"
267
370
  },
371
+ style: {
372
+ "--fontSize_xs": leaf?.fontSize?.xs || "auto"
373
+ },
268
374
  children: children
269
375
  })
270
376
  });
@@ -289,17 +395,28 @@ export const getBlock = props => {
289
395
  children,
290
396
  customProps
291
397
  } = props;
398
+ const {
399
+ customLineHeight
400
+ } = customProps || {};
292
401
  const attributes = props.attributes ?? {};
293
402
  const isEmpty = isEmptyTextNode(element);
294
403
  const {
295
404
  translation
296
405
  } = customProps;
406
+ const commonHeadingProps = () => ({
407
+ ...attributes,
408
+ ...element.attr,
409
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} theme-element`
410
+ });
411
+ const commonParaProps = paraType => ({
412
+ ...attributes,
413
+ ...element.attr,
414
+ className: `edt-paragraphs content-editable ${isEmpty ? "empty" : ""} theme-element ${paraType}`
415
+ });
297
416
  switch (element.type) {
298
417
  case "headingOne":
299
418
  return /*#__PURE__*/_jsxs("h1", {
300
- ...attributes,
301
- ...element.attr,
302
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
419
+ ...commonHeadingProps(),
303
420
  placeholder: translation("Heading 1"),
304
421
  children: [children, /*#__PURE__*/_jsx("span", {
305
422
  contentEditable: false
@@ -307,9 +424,7 @@ export const getBlock = props => {
307
424
  });
308
425
  case "headingTwo":
309
426
  return /*#__PURE__*/_jsxs("h2", {
310
- ...attributes,
311
- ...element.attr,
312
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
427
+ ...commonHeadingProps(),
313
428
  placeholder: translation("Heading 2"),
314
429
  children: [children, /*#__PURE__*/_jsx("span", {
315
430
  contentEditable: false
@@ -317,9 +432,7 @@ export const getBlock = props => {
317
432
  });
318
433
  case "headingThree":
319
434
  return /*#__PURE__*/_jsxs("h3", {
320
- ...attributes,
321
- ...element.attr,
322
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
435
+ ...commonHeadingProps(),
323
436
  placeholder: translation("Heading 3"),
324
437
  children: [children, /*#__PURE__*/_jsx("span", {
325
438
  contentEditable: false
@@ -327,9 +440,7 @@ export const getBlock = props => {
327
440
  });
328
441
  case "headingFour":
329
442
  return /*#__PURE__*/_jsxs("h4", {
330
- ...attributes,
331
- ...element.attr,
332
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
443
+ ...commonHeadingProps(),
333
444
  placeholder: translation("Heading 4"),
334
445
  children: [children, /*#__PURE__*/_jsx("span", {
335
446
  contentEditable: false
@@ -337,9 +448,7 @@ export const getBlock = props => {
337
448
  });
338
449
  case "headingFive":
339
450
  return /*#__PURE__*/_jsxs("h5", {
340
- ...attributes,
341
- ...element.attr,
342
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
451
+ ...commonHeadingProps(),
343
452
  placeholder: translation("Heading 5"),
344
453
  children: [children, /*#__PURE__*/_jsx("span", {
345
454
  contentEditable: false
@@ -347,14 +456,30 @@ export const getBlock = props => {
347
456
  });
348
457
  case "headingSix":
349
458
  return /*#__PURE__*/_jsxs("h6", {
350
- ...attributes,
351
- ...element.attr,
352
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
459
+ ...commonHeadingProps(),
353
460
  placeholder: translation("Heading 6"),
354
461
  children: [children, /*#__PURE__*/_jsx("span", {
355
462
  contentEditable: false
356
463
  })]
357
464
  });
465
+ case "paragraphOne":
466
+ return /*#__PURE__*/_jsx("p", {
467
+ ...commonParaProps("para1"),
468
+ placeholder: "Paragraph 1",
469
+ children: children
470
+ });
471
+ case "paragraphTwo":
472
+ return /*#__PURE__*/_jsx("p", {
473
+ ...commonParaProps("para2"),
474
+ placeholder: "Paragraph 2",
475
+ children: children
476
+ });
477
+ case "paragraphThree":
478
+ return /*#__PURE__*/_jsx("p", {
479
+ ...commonParaProps("para3"),
480
+ placeholder: "Paragraph 3",
481
+ children: children
482
+ });
358
483
  case "blockquote":
359
484
  return /*#__PURE__*/_jsx("blockquote", {
360
485
  ...attributes,
@@ -368,7 +493,7 @@ export const getBlock = props => {
368
493
  margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
369
494
  width: element?.bgColor ? "calc(100% - 16px)" : "100%",
370
495
  borderWidth: element?.color ? "0px 0px 0px 3px" : "0px",
371
- lineHeight: 1.43
496
+ lineHeight: `${customLineHeight} !important`
372
497
  },
373
498
  children: children
374
499
  });
@@ -422,14 +547,15 @@ export const getBlock = props => {
422
547
  className: `content-editable ${isEmpty ? "empty" : ""}`,
423
548
  placeholder: translation("List"),
424
549
  style: {
425
- color: firstChildren?.color
550
+ color: firstChildren?.color,
551
+ lineHeight: `${customLineHeight} !important`
426
552
  },
427
553
  children: children
428
554
  });
429
555
  case "orderedList":
430
556
  return /*#__PURE__*/_jsx("ol", {
431
557
  style: {
432
- lineHeight: 1.43
558
+ lineHeight: `${customLineHeight} !important`
433
559
  },
434
560
  className: "listItemMargin",
435
561
  type: "1",
@@ -439,7 +565,7 @@ export const getBlock = props => {
439
565
  case "unorderedList":
440
566
  return /*#__PURE__*/_jsx("ul", {
441
567
  style: {
442
- lineHeight: 1.43
568
+ lineHeight: `${customLineHeight} !important`
443
569
  },
444
570
  className: "listItemMargin",
445
571
  ...attributes,
@@ -1,6 +1,5 @@
1
1
  import { Path, Transforms } from "slate";
2
2
  import insertNewLine from "./insertNewLine";
3
- import { windowVar } from "./helper";
4
3
  import { getCurrentElementText } from "../plugins/withHTML";
5
4
  export const insertButton = editor => {
6
5
  const button = {
@@ -11,22 +10,7 @@ export const insertButton = editor => {
11
10
  buttonLink: {
12
11
  linkType: "webAddress"
13
12
  },
14
- iconPosition: "start",
15
- bgColor: "#2563EB",
16
- textColor: "#FFF",
17
- borderRadius: {
18
- topLeft: 30,
19
- topRight: 30,
20
- bottomLeft: 30,
21
- bottomRight: 30
22
- },
23
- bannerSpacing: {
24
- left: 16,
25
- top: 8,
26
- right: 16,
27
- bottom: 8
28
- },
29
- ...(windowVar.lastButtonProps || {})
13
+ iconPosition: "start"
30
14
  };
31
15
  const hasText = getCurrentElementText(editor);
32
16
  const insertPath = hasText ? Path.next(Path.parent(editor?.selection.focus.path)) : editor?.selection.focus.path;
@@ -82,7 +82,8 @@ const splitInlineStyleRanges = (text, inlineStyleRanges, data) => {
82
82
  };
83
83
  export const draftToSlate = props => {
84
84
  const {
85
- data
85
+ data,
86
+ needLayout
86
87
  } = props;
87
88
  if (data?.blocks && data?.blocks?.length > 0) {
88
89
  const converted = data?.blocks?.reduce((a, b) => {
@@ -104,7 +105,7 @@ export const draftToSlate = props => {
104
105
  return data;
105
106
  } else {
106
107
  return [{
107
- type: "paragraph",
108
+ type: needLayout ? "title" : "paragraph",
108
109
  children: [{
109
110
  text: ""
110
111
  }]
@@ -7,43 +7,43 @@ export const sizeMap = {
7
7
  export const fontFamilyMap = {
8
8
  PoppinsRegular: "PoppinsRegular",
9
9
  PoppinsBold: "PoppinsBold",
10
- sans: "Helvetica,Arial, sans serif",
11
- serif: "Georgia, Times New Roaman,serif",
12
- monospace: "Monaco, Courier New,monospace",
13
- roboto: "'Roboto', sans-serif",
14
- qwitcher: "'Qwitcher Grypen', cursive",
15
- garamond: "'EB Garamond', serif",
16
- anton: "'Anton', sans-serif",
17
- dmserif: "'DM Serif Text', serif",
18
- inter: "'Inter', sans-serif",
19
- libre: "'Libre Baskerville', serif",
20
- montserrat: "'Montserrat', sans-serif",
21
- opensans: "'Open Sans', sans-serif",
22
- publicsans: "'Public Sans', sans-serif",
23
- raleway: "'Raleway', sans-serif",
24
- spacemono: "'Space Mono', sans-serif",
25
- bulgarian: "'Bulgarian Garamond', monospace",
26
- impact: "'Impact', serif",
27
- redacted: "'Redacted Script', cursive",
28
- greatVibes: "'Great Vibes', cursive",
29
- zeyada: "'Zeyada', cursive",
30
- allura: "'Allura', cursive",
31
- pinyon: "'Pinyon Script', cursive",
32
- muellerhoff: "'Herr Von Muellerhoff', cursive",
33
- dawning: "'Dawning of a New Day', cursive",
10
+ sans: 'Helvetica, Arial, "sans serif"',
11
+ serif: 'Georgia, "Times New Roaman", serif',
12
+ monospace: 'Monaco, "Courier New", monospace',
13
+ roboto: "Roboto, sans-serif",
14
+ qwitcher: '"Qwitcher Grypen", cursive',
15
+ garamond: '"EB Garamond", serif',
16
+ anton: "Anton, sans-serif",
17
+ dmserif: '"DM Serif Text", serif',
18
+ inter: "Inter, sans-serif",
19
+ libre: '"Libre Baskerville", serif',
20
+ montserrat: "Montserrat, sans-serif",
21
+ opensans: '"Open Sans", sans-serif',
22
+ publicsans: '"Public Sans", sans-serif',
23
+ raleway: "Raleway, sans-serif",
24
+ spacemono: '"Space Mono", sans-serif',
25
+ bulgarian: '"Bulgarian Garamond", monospace',
26
+ impact: "Impact, serif",
27
+ redacted: '"Redacted Script", cursive',
28
+ greatVibes: '"Great Vibes", cursive',
29
+ zeyada: "Zeyada, cursive",
30
+ allura: "Allura, cursive",
31
+ pinyon: '"Pinyon Script", cursive',
32
+ muellerhoff: '"Herr Von Muellerhoff", cursive',
33
+ dawning: '"Dawning of a New Day", cursive',
34
34
  // New Font Added for Type Signature
35
- comingsoon: "'Coming Soon', cursive",
36
- dancingScript: "'Dancing Script', cursive",
37
- engagement: "'Engagement', cursive",
38
- gaegu: "'Gaegu', cursive",
39
- ingridDarling: "'Ingrid Darling', cursive",
40
- kitaOne: "'Kite One', sans - serif",
41
- laBelleAurore: "'La Belle Aurore', cursive",
42
- lobster: "'Lobster', cursive",
43
- meaCulpa: "'Mea Culpa', cursive",
44
- meddon: "'Meddon', cursive",
45
- merriWeather: "'Merriweather', serif",
46
- theGirlNextDoor: "'The Girl Next Door', cursive"
35
+ comingsoon: '"Coming Soon", cursive',
36
+ dancingScript: '"Dancing Script", cursive',
37
+ engagement: "Engagement, cursive",
38
+ gaegu: "Gaegu, cursive",
39
+ ingridDarling: '"Ingrid Darling", cursive',
40
+ kitaOne: "Times",
41
+ laBelleAurore: '"La Belle Aurore", cursive',
42
+ lobster: "Lobster, cursive",
43
+ meaCulpa: '"Mea Culpa", cursive',
44
+ meddon: "Meddon, cursive",
45
+ merriWeather: "Merriweather, serif",
46
+ theGirlNextDoor: '"The Girl Next Door", cursive'
47
47
  };
48
48
  export const fontOptions = Object.keys(fontFamilyMap).map(m => {
49
49
  return {
@@ -62,7 +62,10 @@ export const signedTextFonts = Object.keys(fontFamilyMap).slice(-12).map(m => {
62
62
  export const headingMap = {
63
63
  headingOne: "32px",
64
64
  headingTwo: "24px",
65
- headingThree: "19px"
65
+ headingThree: "19px",
66
+ headingFour: "16px",
67
+ headingFive: "13px",
68
+ headingSix: "11px"
66
69
  };
67
70
  export const fontWeightOptions = [{
68
71
  text: "Bold",
@@ -1,5 +1,4 @@
1
1
  import { Transforms } from "slate";
2
- import insertNewLine from "./insertNewLine";
3
2
  import scrollToNewSection from "../helper/RnD/scrollToNewSection";
4
3
  const Default_text_Node = {
5
4
  type: "paragraph",
@@ -22,8 +21,8 @@ export const insertFreeGridItem = (childType, childTypeNode, extProps = {}, type
22
21
  top_xs: 24,
23
22
  marginTop_xs: 12,
24
23
  width_xs: 250,
25
- height_xs: 300,
26
- gridArea_xs: "1 / 1 / 2 / 2",
24
+ // height_xs: 300,
25
+ // gridArea_xs: "1 / 1 / 2 / 2",
27
26
  sectionBgColor: "rgb(240, 108, 131)",
28
27
  ...(extProps || {})
29
28
  };