@flozy/editor 5.1.3 → 5.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +7 -13
  3. package/dist/Editor/Editor.css +10 -52
  4. package/dist/Editor/Elements/AI/AIInput.js +1 -0
  5. package/dist/Editor/Elements/AI/CustomSelect.js +10 -17
  6. package/dist/Editor/Elements/AI/Styles.js +1 -7
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
  8. package/dist/Editor/Elements/Color Picker/Styles.js +3 -7
  9. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  10. package/dist/Editor/Elements/Form/Form.js +2 -38
  11. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  12. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  13. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  14. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  15. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  16. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  17. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  18. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  19. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  20. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  21. package/dist/Editor/Elements/Grid/GridButton.js +1 -2
  22. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  23. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  24. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  25. package/dist/Editor/Elements/Signature/SignaturePopup.js +48 -13
  26. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  27. package/dist/Editor/Elements/SimpleText/style.js +1 -8
  28. package/dist/Editor/Elements/Table/Styles.js +43 -25
  29. package/dist/Editor/Elements/Table/Table.js +138 -206
  30. package/dist/Editor/Elements/Table/TableCell.js +102 -355
  31. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  32. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  33. package/dist/Editor/Styles/EditorStyles.js +1 -3
  34. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  35. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +11 -7
  36. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -10
  37. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  38. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
  39. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +6 -3
  40. package/dist/Editor/Toolbar/Mini/Styles.js +1 -4
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
  42. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +11 -16
  43. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +49 -416
  44. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +8 -62
  45. package/dist/Editor/Toolbar/PopupTool/index.js +6 -5
  46. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  47. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  48. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  49. package/dist/Editor/common/ColorPickerButton.js +2 -3
  50. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  51. package/dist/Editor/common/Icon.js +23 -24
  52. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  53. package/dist/Editor/common/LinkSettings/index.js +1 -2
  54. package/dist/Editor/common/MentionsPopup/Styles.js +3 -151
  55. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  56. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -108
  57. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  58. package/dist/Editor/common/Shorthands/elements.js +1 -13
  59. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  60. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  61. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  62. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -5
  63. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  64. package/dist/Editor/common/StyleBuilder/index.js +11 -84
  65. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  66. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  67. package/dist/Editor/common/Uploader.js +0 -8
  68. package/dist/Editor/common/iconListV2.js +40 -378
  69. package/dist/Editor/common/iconslist.js +5 -8
  70. package/dist/Editor/commonStyle.js +9 -117
  71. package/dist/Editor/helper/deserialize/index.js +1 -4
  72. package/dist/Editor/helper/index.js +2 -2
  73. package/dist/Editor/helper/theme.js +1 -24
  74. package/dist/Editor/hooks/useMouseMove.js +2 -5
  75. package/dist/Editor/plugins/withCustomDeleteBackward.js +2 -3
  76. package/dist/Editor/plugins/withHTML.js +1 -17
  77. package/dist/Editor/plugins/withLayout.js +1 -48
  78. package/dist/Editor/utils/SlateUtilityFunctions.js +0 -18
  79. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -21
  80. package/dist/Editor/utils/embed.js +1 -2
  81. package/dist/Editor/utils/events.js +1 -0
  82. package/dist/Editor/utils/font.js +4 -11
  83. package/dist/Editor/utils/formfield.js +4 -8
  84. package/dist/Editor/utils/helper.js +1 -34
  85. package/dist/Editor/utils/insertNewLine.js +1 -19
  86. package/dist/Editor/utils/pageSettings.js +2 -14
  87. package/dist/Editor/utils/serializeToText.js +0 -2
  88. package/dist/Editor/utils/table.js +24 -228
  89. package/package.json +1 -1
  90. package/dist/Editor/Elements/DataView/DataView.js +0 -101
  91. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  92. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -59
  93. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -30
  94. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -140
  95. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -40
  96. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -59
  97. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -26
  98. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -38
  99. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  100. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  101. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  102. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  103. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  104. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  105. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  106. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -74
  107. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -64
  108. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -106
  109. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -174
  110. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  111. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  112. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -37
  113. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -111
  114. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -62
  115. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -36
  116. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  117. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -160
  118. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -190
  119. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -42
  120. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -30
  121. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  122. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -179
  123. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -100
  124. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -227
  125. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -70
  126. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  127. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -288
  128. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  129. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -72
  130. package/dist/Editor/Elements/DataView/styles.js +0 -143
  131. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  132. package/dist/Editor/Elements/Table/DragButton.js +0 -141
  133. package/dist/Editor/Elements/Table/DragStyles.js +0 -69
  134. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  135. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  136. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  137. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  138. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  139. package/dist/Editor/common/Select/index.js +0 -20
  140. package/dist/Editor/common/Select/styles.js +0 -17
  141. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  142. package/dist/Editor/hooks/useTable.js +0 -175
  143. package/dist/Editor/utils/dataView.js +0 -43
@@ -138,8 +138,8 @@ export const StrikethroughIcon = props => /*#__PURE__*/_jsx("svg", {
138
138
  children: /*#__PURE__*/_jsx("path", {
139
139
  className: "strokeFillPath",
140
140
  d: "M2.7607 11.125C2.7607 13.0718 4.33885 14.65 6.28568 14.65H8.21432C10.1611 14.65 11.7393 13.0718 11.7393 11.125V10.6429C11.7393 9.78254 11.4309 8.99403 10.9189 8.38214H13.5179C13.867 8.38214 14.15 8.0991 14.15 7.75C14.15 7.4009 13.867 7.11786 13.5179 7.11786H8.21597H8.21435H6.28579C5.03727 7.11786 4.02509 6.10568 4.02509 4.85714V4.375C4.02509 3.12647 5.03727 2.11429 6.28579 2.11429H8.21435C9.46288 2.11429 10.4751 3.12647 10.4751 4.375V4.84874C10.4751 5.19784 10.7581 5.48088 11.1072 5.48088C11.4563 5.48088 11.7393 5.19784 11.7393 4.84874V4.375C11.7393 2.42817 10.1612 0.85 8.21435 0.85H6.28579C4.33897 0.85 2.76081 2.42817 2.76081 4.375V4.85714C2.76081 5.71746 3.06916 6.50597 3.58108 7.11786H0.982141C0.633044 7.11786 0.35 7.4009 0.35 7.75C0.35 8.0991 0.633044 8.38214 0.982141 8.38214H8.21424L8.21556 8.38214C8.21559 8.38214 8.21562 8.38214 8.21564 8.38214C9.46353 8.38289 10.4749 9.39474 10.4749 10.6429V11.125C10.4749 12.3735 9.46276 13.3857 8.21424 13.3857H6.28568C5.03715 13.3857 4.02498 12.3735 4.02498 11.125V10.6429C4.02498 10.2938 3.74193 10.0107 3.39284 10.0107C3.04374 10.0107 2.7607 10.2938 2.7607 10.6429V11.125Z",
141
- fill: "currentColor",
142
- stroke: "currentColor",
141
+ fill: "#64748B",
142
+ stroke: "#64748B",
143
143
  strokeWidth: "0.3"
144
144
  })
145
145
  });
@@ -1343,22 +1343,19 @@ export const GridAddSectionIcon = props => /*#__PURE__*/_jsxs("svg", {
1343
1343
  stroke: "#64748B",
1344
1344
  strokeWidth: "1.5",
1345
1345
  strokeLinecap: "round",
1346
- strokeLinejoin: "round",
1347
- className: "fillStroke"
1346
+ strokeLinejoin: "round"
1348
1347
  }), /*#__PURE__*/_jsx("path", {
1349
1348
  d: "M10.1733 6.125V14.875",
1350
1349
  stroke: "#64748B",
1351
1350
  strokeWidth: "1.5",
1352
1351
  strokeLinecap: "round",
1353
- strokeLinejoin: "round",
1354
- className: "fillStroke"
1352
+ strokeLinejoin: "round"
1355
1353
  }), /*#__PURE__*/_jsx("path", {
1356
1354
  d: "M5.79834 10.5H14.5483",
1357
1355
  stroke: "#64748B",
1358
1356
  strokeWidth: "1.5",
1359
1357
  strokeLinecap: "round",
1360
- strokeLinejoin: "round",
1361
- className: "fillStroke"
1358
+ strokeLinejoin: "round"
1362
1359
  })]
1363
1360
  });
1364
1361
  export const FormIcon = () => {
@@ -68,9 +68,9 @@ const useCommonStyle = theme => ({
68
68
  },
69
69
  signaturePopup: {
70
70
  "& .MuiPaper-root": {
71
- backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
71
+ backgroundColor: theme?.palette?.editor?.background,
72
72
  "& .signature-canvas": {
73
- backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`
73
+ backgroundColor: "#FFF"
74
74
  },
75
75
  "& label": {
76
76
  color: theme?.palette?.editor?.textColor
@@ -97,97 +97,26 @@ const useCommonStyle = theme => ({
97
97
  borderColor: theme?.palette?.editor?.textColor
98
98
  },
99
99
  "& .upload-wrapper-ui": {
100
- backgroundColor: theme?.palette?.type === "dark" ? "#2563EB0F" : "#F8F9FF",
100
+ backgroundColor: theme?.palette?.type === "dark" ? "transparent" : "#F8F9FF",
101
101
  "& .MuiTypography-root": {
102
102
  color: theme?.palette?.editor?.textColor
103
103
  }
104
104
  },
105
- "& .typesignature-input-wrapper": {
106
- "& .MuiInputBase-root": {
107
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
108
- borderRadius: "7px !important",
109
- paddingRight: "6px !important"
110
- },
111
- "& .MuiInputBase-input": {
112
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`
113
- },
114
- "& .MuiOutlinedInput-notchedOutline": {
115
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder}`
116
- },
117
- "& .Mui-focused": {
118
- "& .MuiOutlinedInput-notchedOutline": {
119
- border: `1px solid #2563EB !important`
120
- }
121
- },
122
- "& button": {
123
- background: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
124
- color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
125
- }
126
- },
127
105
  "& .typesignature-fontfamily": {
128
106
  "& button": {
129
- color: theme?.palette?.editor?.textColor,
130
- background: `${theme?.palette?.editor?.signatureFontBtnBg} !important`,
131
- border: `1px solid ${theme?.palette?.editor?.sectionSettingIconHover} !important`,
132
- "& p": {
133
- fontSize: "13px !important"
134
- }
135
- },
136
- "& .active ": {
137
- border: `1px solid #2563EB !important`
107
+ color: theme?.palette?.editor?.textColor
138
108
  }
139
109
  },
140
110
  "& .MuiTab-root": {
141
- color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`,
142
- backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
143
- opacity: "unset",
144
- fontSize: "12px !important",
145
- fontWeight: "500 !important",
146
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonBorder} !important`
147
- },
148
- "& .Mui-selected": {
149
- background: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBg} !important`,
150
- color: `${theme?.palette?.editor?.textColor} !important`,
151
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBorder} !important`,
152
- "& .MuiGrid-root": {
153
- "& svg": {
154
- "& path": {
155
- fill: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedSvg} !important`
156
- }
157
- }
158
- }
111
+ color: theme?.palette?.editor?.textColor,
112
+ backgroundColor: theme?.palette?.editor?.background
159
113
  },
160
114
  "& .close-popupbtn": {
161
- color: theme?.palette?.editor?.closeButtonSvgStroke,
162
- background: `${theme?.palette?.editor?.closeButtonBgColor} !important`
115
+ color: theme?.palette?.editor?.textColor
163
116
  },
164
117
  "& .deleteBtn": {
165
- background: "transparent",
166
- margin: '0px !important'
167
- },
168
- "& .MuiGrid-container": {
169
- "& .workFlowButton": {
170
- background: `${theme?.palette?.editor?.workFlowButtonBackground} !important`,
171
- textTransform: "unset !important",
172
- color: `${theme?.palette?.editor?.textColor} !important`,
173
- fontSize: "14px !important",
174
- fontWeight: "500 !important",
175
- borderRadius: "25px",
176
- padding: "5px 15px"
177
- }
178
- },
179
- "& .MuiDialogActions-root": {
180
- "& .deleteButtonSignature": {
181
- background: `${theme?.palette?.editor?.closeButtonBackground} !important`,
182
- color: `${theme?.palette?.editor?.deletePopUpButtonTextColor} !important`,
183
- border: `1px solid ${theme?.palette?.editor?.closeButtonBorder} !important`
184
- }
118
+ background: "transparent"
185
119
  }
186
- },
187
- "& .disabledSaveBtn": {
188
- background: "#2563EB33 !important",
189
- color: theme?.palette?.type === "dark" && "#FFFFFF33 !important",
190
- border: "1px solid #2563EB33 !important"
191
120
  }
192
121
  },
193
122
  popupTitle2: {
@@ -201,44 +130,7 @@ const useCommonStyle = theme => ({
201
130
  },
202
131
  datePicker: {
203
132
  "& .react-datepicker-wrapper": {
204
- width: "100%",
205
- "& .react-datepicker__input-container": {
206
- "& .MuiInputBase-root": {
207
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
208
- "& .MuiInputBase-input": {
209
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
210
- color: `${theme?.palette?.editor?.textColor} !important`
211
- },
212
- "& .MuiOutlinedInput-notchedOutline": {
213
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
214
- }
215
- }
216
- }
217
- }
218
- },
219
- signaturePopUpNameField: {
220
- background: "transparent !important",
221
- "& .MuiInputBase-root": {
222
- borderRadius: "10px !important",
223
- background: "transparent !important",
224
- "& .MuiOutlinedInput-input": {
225
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
226
- borderRadius: "10px !important",
227
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`,
228
- fontSize: "14px !important",
229
- fontWeight: "500 !important"
230
- },
231
- "& .MuiOutlinedInput-notchedOutline": {
232
- border: `1px solid transparent !important`
233
- }
234
- },
235
- "& .Mui-focused": {
236
- "& .MuiOutlinedInput-input": {
237
- border: `1px solid #2563EB !important`
238
- },
239
- "& .MuiOutlinedInput-notchedOutline": {
240
- border: `1px solid transparent !important`
241
- }
133
+ width: "100%"
242
134
  }
243
135
  }
244
136
  });
@@ -14,10 +14,7 @@ const handleTableCell = (el, children) => {
14
14
  });
15
15
  return {
16
16
  type: "table-cell",
17
- overwriteChild: wrapChild,
18
- size: {
19
- width: 120
20
- }
17
+ overwriteChild: wrapChild
21
18
  };
22
19
  };
23
20
  const ELEMENT_TAGS = {
@@ -331,14 +331,14 @@ export const isCarouselSelected = editor => {
331
331
  return false;
332
332
  }
333
333
  const [nodeEntry] = Editor.nodes(editor, {
334
- match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "carousel"
334
+ match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === 'carousel'
335
335
  });
336
336
  if (!nodeEntry) {
337
337
  return false;
338
338
  }
339
339
  const [node] = nodeEntry;
340
340
  const carouselDom = ReactEditor.toDOMNode(editor, node);
341
- const isEdit = carouselDom.classList.contains("carousel_slider_edit");
341
+ const isEdit = carouselDom.classList.contains('carousel_slider_edit');
342
342
  return !isEdit;
343
343
  } catch (err) {
344
344
  console.log(err);
@@ -147,27 +147,4 @@ export const groupByBreakpoint = (styleProps, theme) => {
147
147
  }
148
148
  };
149
149
  };
150
- export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
151
- export const getBreakpointLineSpacing = (value, breakpoint) => {
152
- try {
153
- const values = getBreakPointsValue(value, breakpoint);
154
- const cssVal = BREAKPOINTS_DEVICES.reduce((a, b) => {
155
- if (values[b] || values["lg"]) {
156
- const value = values[b] || values["lg"];
157
- return {
158
- ...a,
159
- [b]: value
160
- };
161
- } else {
162
- return a;
163
- }
164
- }, {});
165
- if (breakpoint) {
166
- return value[breakpoint] || value["lg"] || value;
167
- } else {
168
- return cssVal["lg"];
169
- }
170
- } catch (err) {
171
- // console.log(err);
172
- }
173
- };
150
+ export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
@@ -35,7 +35,6 @@ export const EditorProvider = ({
35
35
  path: null
36
36
  });
37
37
  const [fontFamilies, setFontFamilies] = useState({});
38
- const [activeBreakPoint, setActiveBreakPoint] = useState("");
39
38
  useEffect(() => {
40
39
  window.updateSelectedItem = d => {
41
40
  setSelectedElement(d);
@@ -98,10 +97,8 @@ export const EditorProvider = ({
98
97
  setOpenAI,
99
98
  updateDragging,
100
99
  fontFamilies,
101
- setFontFamilies,
102
- activeBreakPoint,
103
- setActiveBreakPoint
104
- }), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, activeBreakPoint]);
100
+ setFontFamilies
101
+ }), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop]);
105
102
  return /*#__PURE__*/_jsx(EditorContext.Provider, {
106
103
  value: otherValues,
107
104
  children: children
@@ -1,6 +1,5 @@
1
1
  import { Editor, Node, Path, Point, Transforms } from "slate";
2
2
  import { getNextNode } from "../utils/helper";
3
- const BACKWARD_BLOCKS = ["list-item", "signature"];
4
3
  const isNodeTextEmpty = node => {
5
4
  const nodeText = Node.string(node);
6
5
  return nodeText.trim() === "";
@@ -30,9 +29,9 @@ const withCustomDeleteBackward = editor => {
30
29
  }
31
30
  }
32
31
 
33
- // Check if current node is a list item and is the last one, signature node
32
+ // Check if current node is a list item and is the last one
34
33
  const [node] = Editor.nodes(editor, {
35
- match: n => BACKWARD_BLOCKS.includes(n.type) // Adjust based on your list item type
34
+ match: n => n.type === "list-item" // Adjust based on your list item type
36
35
  });
37
36
 
38
37
  if (node) {
@@ -68,12 +68,6 @@ const handleInsert = (editor, defaultInsert, fragment = []) => {
68
68
  defaultInsert();
69
69
  }
70
70
  };
71
- const getTableCellChild = (fragment = []) => {
72
- const table = fragment.find(node => node.type === "table");
73
- const row = table?.children?.find(node => node.type === "table-row");
74
- const cell = row?.children?.find(node => node.type === "table-cell");
75
- return cell?.children || [];
76
- };
77
71
  const formatFragment = {
78
72
  "list-item": fragment => {
79
73
  let refactorFragment = [];
@@ -120,19 +114,9 @@ const withHtml = editor => {
120
114
  const slateHTML = data?.getData("application/x-slate-fragment");
121
115
  const html = data?.getData("text/html");
122
116
  const currentEl = getCurrentElement(editor);
123
- let eltype = currentEl?.type;
117
+ const eltype = currentEl?.type;
124
118
  if (slateHTML && !formatFragment[eltype]) {
125
- const [tableCellNode] = Editor.nodes(editor, {
126
- match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table-cell"
127
- });
128
119
  const decoded = decodeAndParseBase64(slateHTML);
129
- if (tableCellNode) {
130
- const tableCellChild = getTableCellChild(decoded);
131
- if (tableCellChild?.length) {
132
- Transforms.insertFragment(editor, tableCellChild);
133
- return;
134
- }
135
- }
136
120
  const tableNode = getFocusedNode(editor, "table");
137
121
  const onlyTextNode = getFocusedNode(editor, "freegrid");
138
122
 
@@ -56,55 +56,8 @@ const withLayout = editor => {
56
56
  }]
57
57
  };
58
58
  Transforms.insertNodes(editor, paragraph, {
59
- at: [0]
59
+ at: path.concat(1)
60
60
  });
61
- return;
62
- }
63
- const extractFirstText = node => {
64
- if (node.text) {
65
- return node.text;
66
- }
67
- if (node.children) {
68
- for (const child of node.children) {
69
- const text = extractFirstText(child);
70
- if (text) {
71
- return text;
72
- }
73
- }
74
- }
75
- return "";
76
- };
77
- const extractRemainingNodes = node => {
78
- if (!node.children) {
79
- return [];
80
- }
81
- const [, ...remainingChildren] = node.children;
82
- return remainingChildren.map(child => ({
83
- ...child
84
- }));
85
- };
86
- const firstNode = editor.children[0];
87
- const firstContent = extractFirstText(firstNode);
88
- if (firstNode.type !== "title") {
89
- const titleNode = {
90
- type: "title",
91
- children: [{
92
- text: firstContent
93
- }]
94
- };
95
- Transforms.removeNodes(editor, {
96
- at: [0]
97
- });
98
- Transforms.insertNodes(editor, titleNode, {
99
- at: [0],
100
- select: true
101
- });
102
- const remainingNodes = extractRemainingNodes(firstNode);
103
- if (remainingNodes.length > 0) {
104
- Transforms.insertNodes(editor, remainingNodes, {
105
- at: [1]
106
- });
107
- }
108
61
  }
109
62
  ORDERS_LAYOUT.forEach((enforce, index) => {
110
63
  if (index < editor.children.length) {
@@ -43,9 +43,6 @@ import Code from "../Elements/EmbedScript/Code";
43
43
  import FreeGrid from "../Elements/FreeGrid/FreeGrid";
44
44
  import FreeGridItem from "../Elements/FreeGrid/FreeGridItem";
45
45
  import FreeGridBox from "../Elements/FreeGrid/FreeGridBox";
46
- import DataView from "../Elements/DataView/DataView";
47
- import ViewData from "../Elements/DataView/Layouts/ViewData";
48
- import ColumnView from "../Elements/DataView/Layouts/ColumnView";
49
46
  import SearchAttachment from "../Elements/Search/SearchAttachment";
50
47
  // import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
51
48
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -372,14 +369,12 @@ export const getBlock = props => {
372
369
  });
373
370
  case "orderedList":
374
371
  return /*#__PURE__*/_jsx("ol", {
375
- className: "listItemMargin",
376
372
  type: "1",
377
373
  ...attributes,
378
374
  children: children
379
375
  });
380
376
  case "unorderedList":
381
377
  return /*#__PURE__*/_jsx("ul", {
382
- className: "listItemMargin",
383
378
  ...attributes,
384
379
  children: children
385
380
  });
@@ -567,19 +562,6 @@ export const getBlock = props => {
567
562
  contentEditable: false,
568
563
  children: children
569
564
  });
570
- // Data View
571
- case "dataView":
572
- return /*#__PURE__*/_jsx(DataView, {
573
- ...props
574
- });
575
- case "viewData":
576
- return /*#__PURE__*/_jsx(ViewData, {
577
- ...props
578
- });
579
- case "columnView":
580
- return /*#__PURE__*/_jsx(ColumnView, {
581
- ...props
582
- });
583
565
  default:
584
566
  return /*#__PURE__*/_jsx(SimpleText, {
585
567
  ...props,
@@ -15,20 +15,6 @@ const LIST_FORMAT_TYPE = {
15
15
  unorderedList: "list-item"
16
16
  };
17
17
  const NEWLINESAFTER = ["headingOne", "headingTwo", "headingThree"];
18
- export const serializeMentions = node => {
19
- try {
20
- if (node?.type === 'mention') {
21
- return [node.character];
22
- }
23
- let children = Array.isArray(node) ? node : node?.children;
24
- children = children && Array.isArray(children) ? children : [];
25
- let mentions = children.map(child => serializeMentions(child)).flat();
26
- return mentions.filter(Boolean);
27
- } catch (err) {
28
- console.log(err);
29
- return [];
30
- }
31
- };
32
18
  export const toggleBlock = (editor, format, selection = true, attr = {}) => {
33
19
  const isActive = isBlockActive(editor, format);
34
20
  const isList = list_types.includes(format);
@@ -259,13 +245,6 @@ export const getBlock = props => {
259
245
  ,
260
246
  children: children
261
247
  });
262
- case "title":
263
- return /*#__PURE__*/_jsx("h3", {
264
- ...attributes,
265
- ...element.attr,
266
- className: `content-editable ${isEmpty ? "empty" : ""}`,
267
- children: children
268
- });
269
248
  case "headingThree":
270
249
  return /*#__PURE__*/_jsx("h3", {
271
250
  ...attributes,
@@ -1,5 +1,5 @@
1
1
  import { Transforms } from "slate";
2
- import insertNewLine, { insertNewLineAfterCurrentPath } from "./insertNewLine";
2
+ import insertNewLine from "./insertNewLine";
3
3
  export const insertDefaultEmbed = (editor, type, defaultURL = "", extProps = {}) => {
4
4
  try {
5
5
  const url = defaultURL ? defaultURL : type === "image" ? "" : "";
@@ -56,7 +56,6 @@ export const insertEmbed = (editor, embedData, format) => {
56
56
  at: editor.selection.anchor.path
57
57
  });
58
58
  insertNewLine(editor);
59
- insertNewLineAfterCurrentPath(editor);
60
59
  } catch (err) {
61
60
  console.log(err);
62
61
  }
@@ -5,6 +5,7 @@ import { insertAccordion } from "./accordion";
5
5
  import { isListItem } from "./helper";
6
6
  import RnDCtrlCmds from "./RnD/RnDCtrlCmds";
7
7
  import EDITORCMDS from "../common/EditorCmds";
8
+ import { ReactEditor } from "slate-react";
8
9
  const HOTKEYS = {
9
10
  b: "bold",
10
11
  i: "italic",
@@ -60,14 +60,7 @@ export const signedTextFonts = Object.keys(fontFamilyMap).slice(-12).map(m => {
60
60
  };
61
61
  });
62
62
  export const headingMap = {
63
- headingOne: "32px",
64
- headingTwo: "24px",
65
- headingThree: "19px"
66
- };
67
- export const fontWeightOptions = [{
68
- text: "Bold",
69
- value: "500"
70
- }, {
71
- text: "Bolder",
72
- value: "600"
73
- }];
63
+ "headingOne": "32px",
64
+ "headingTwo": "24px",
65
+ "headingThree": "19px"
66
+ };
@@ -1,5 +1,5 @@
1
1
  import { Transforms } from "slate";
2
- export const formField = data => {
2
+ export const formField = () => {
3
3
  return {
4
4
  type: "form-field",
5
5
  grid: 6,
@@ -12,18 +12,14 @@ export const formField = data => {
12
12
  text: ""
13
13
  }],
14
14
  field_type: "text",
15
- bgColor: data?.bgColor ? data?.bgColor : "rgba(255, 255, 255, 1)",
16
- borderColor: data?.borderColor ? data?.borderColor : "#ccc",
15
+ bgColor: "rgba(255, 255, 255, 1)",
16
+ borderColor: "#ccc",
17
17
  bannerSpacing: {
18
18
  left: 16,
19
19
  right: 16,
20
20
  top: 16,
21
21
  bottom: 16
22
- },
23
- fontFamily: data?.fontFamily ? data?.fontFamily : "",
24
- textSize: data?.textSize ? data?.textSize : "",
25
- textColor: data?.textColor ? data?.textColor : "",
26
- fontWeight: data?.fontWeight ? data?.fontWeight : "500"
22
+ }
27
23
  };
28
24
  };
29
25
  export const insertGridItem = editor => {
@@ -212,7 +212,7 @@ export const isListItem = editor => {
212
212
  });
213
213
  return node;
214
214
  };
215
- export const getNode = (editor, path) => {
215
+ const getNode = (editor, path) => {
216
216
  try {
217
217
  return Node.get(editor, path);
218
218
  } catch (err) {
@@ -264,17 +264,6 @@ export const decodeAndParseBase64 = encodedString => {
264
264
  const jsonData = JSON.parse(decodedURLString);
265
265
  return jsonData;
266
266
  };
267
- export const encodeToBase64 = data => {
268
- // Convert the data to a JSON string
269
- const jsonString = JSON.stringify(data);
270
-
271
- // URL-encode the JSON string
272
- const encodedURLString = encodeURIComponent(jsonString);
273
-
274
- // Base64-encode the URL-encoded string
275
- const base64EncodedString = btoa(encodedURLString);
276
- return base64EncodedString;
277
- };
278
267
  export const hasVerticalScrollbar = (element = {}) => {
279
268
  return element.scrollHeight > element.clientHeight;
280
269
  };
@@ -622,26 +611,4 @@ export const isPageSettings = (event, editor) => {
622
611
  isPageSettingsNode = true;
623
612
  return isPageSettingsNode;
624
613
  }
625
- };
626
- export function capitalizeFirstLetter(str) {
627
- if (!str) return str;
628
- return str.charAt(0).toUpperCase() + str.slice(1);
629
- }
630
- export const insertLineBreakAtEndOfPath = (editor, path) => {
631
- try {
632
- const [node, nodePath] = Editor.node(editor, path); // Get the node at the specified path
633
- if (node) {
634
- // Insert the line break
635
- Transforms.insertNodes(editor, {
636
- type: "paragraph",
637
- children: [{
638
- text: ""
639
- }]
640
- }, {
641
- at: nodePath
642
- });
643
- }
644
- } catch (err) {
645
- console.log(err);
646
- }
647
614
  };
@@ -1,4 +1,4 @@
1
- import { Editor, Element, Path, Transforms } from "slate";
1
+ import { Transforms } from "slate";
2
2
  const insertNewLine = editor => {
3
3
  Transforms.insertNodes(editor, {
4
4
  type: "paragraph",
@@ -9,22 +9,4 @@ const insertNewLine = editor => {
9
9
  at: [editor.children.length]
10
10
  });
11
11
  };
12
- export const insertNewLineAfterCurrentPath = editor => {
13
- const currentPath = editor?.selection?.anchor?.path;
14
- const [tableNode] = Editor.nodes(editor, {
15
- match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
16
- });
17
- if (currentPath && tableNode) {
18
- const currentParentPath = Path.parent(currentPath);
19
- const nextPath = Path.next(currentParentPath);
20
- Transforms.insertNodes(editor, {
21
- type: "paragraph",
22
- children: [{
23
- text: ""
24
- }]
25
- }, {
26
- at: nextPath
27
- });
28
- }
29
- };
30
12
  export default insertNewLine;
@@ -9,13 +9,7 @@ export const findPageSettings = editor => {
9
9
  path: null,
10
10
  element: {
11
11
  pageProps: {
12
- pageWidth: "fixed",
13
- "lineHeight": {
14
- "xs": 1.43,
15
- "sm": 1.43,
16
- "md": 1.43,
17
- "lg": 1.43
18
- }
12
+ pageWidth: "fixed"
19
13
  }
20
14
  }
21
15
  };
@@ -40,13 +34,7 @@ export const getPageSettings = editor => {
40
34
  path: null,
41
35
  element: {
42
36
  pageProps: {
43
- pageWidth: "fixed",
44
- "lineHeight": {
45
- "xs": 1.43,
46
- "sm": 1.43,
47
- "md": 1.43,
48
- "lg": 1.43
49
- }
37
+ pageWidth: "fixed"
50
38
  }
51
39
  }
52
40
  };
@@ -2,8 +2,6 @@ export const serializeToText = node => {
2
2
  try {
3
3
  if (!node?.type && node?.text) {
4
4
  return node?.text;
5
- } else if (node?.type === 'mention') {
6
- return '@' + node?.character?.name || '';
7
5
  }
8
6
  let n = Array.isArray(node) ? node : node?.children;
9
7
  n = n && Array.isArray(n) ? n : n ? [n] : [];