@flozy/editor 6.0.3 → 6.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 (129) hide show
  1. package/dist/Editor/ChatEditor.js +7 -7
  2. package/dist/Editor/CommonEditor.js +25 -81
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +16 -22
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Button/EditorButton.js +9 -26
  8. package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  11. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  12. package/dist/Editor/Elements/DataView/DataView.js +3 -4
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
  15. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
  16. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  17. package/dist/Editor/Elements/Embed/Image.js +2 -2
  18. package/dist/Editor/Elements/Form/Form.js +0 -1
  19. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -0
  20. package/dist/Editor/Elements/FreeGrid/styles.js +0 -4
  21. package/dist/Editor/Elements/Grid/GridItem.js +3 -2
  22. package/dist/Editor/Elements/Link/Link.js +43 -70
  23. package/dist/Editor/Elements/List/CheckList.js +1 -2
  24. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  25. package/dist/Editor/Elements/Search/SearchList.js +1 -8
  26. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  27. package/dist/Editor/Elements/SimpleText/style.js +1 -5
  28. package/dist/Editor/Elements/Table/Table.js +3 -3
  29. package/dist/Editor/Elements/Table/TableCell.js +9 -14
  30. package/dist/Editor/Elements/Title/title.js +1 -13
  31. package/dist/Editor/Elements/Variables/Style.js +2 -28
  32. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  33. package/dist/Editor/MiniEditor.js +2 -4
  34. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  35. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  36. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  37. package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
  38. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +36 -46
  39. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
  40. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +91 -211
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -11
  44. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
  45. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  46. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +7 -99
  47. package/dist/Editor/Toolbar/PopupTool/index.js +0 -2
  48. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  49. package/dist/Editor/common/ColorPickerButton.js +9 -32
  50. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  51. package/dist/Editor/common/DnD/Draggable.js +1 -0
  52. package/dist/Editor/common/FontLoader/FontList.js +9 -1
  53. package/dist/Editor/common/FontLoader/FontLoader.js +4 -6
  54. package/dist/Editor/common/Icon.js +0 -28
  55. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  56. package/dist/Editor/common/MentionsPopup/Styles.js +9 -3
  57. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  66. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  67. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  68. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  69. package/dist/Editor/common/RnD/Utils/index.js +0 -40
  70. package/dist/Editor/common/RnD/index.js +3 -23
  71. package/dist/Editor/common/Shorthands/elements.js +0 -54
  72. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  73. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  81. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  82. package/dist/Editor/common/Uploader.js +0 -8
  83. package/dist/Editor/commonStyle.js +63 -58
  84. package/dist/Editor/helper/deserialize/index.js +1 -1
  85. package/dist/Editor/helper/index.js +2 -2
  86. package/dist/Editor/helper/theme.js +3 -224
  87. package/dist/Editor/hooks/useMouseMove.js +5 -13
  88. package/dist/Editor/plugins/withEmbeds.js +1 -1
  89. package/dist/Editor/plugins/withHTML.js +2 -2
  90. package/dist/Editor/plugins/withLayout.js +1 -1
  91. package/dist/Editor/plugins/withTable.js +1 -1
  92. package/dist/Editor/theme/ThemeList.js +173 -50
  93. package/dist/Editor/utils/SlateUtilityFunctions.js +42 -161
  94. package/dist/Editor/utils/button.js +14 -0
  95. package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
  96. package/dist/Editor/utils/draftToSlate.js +2 -3
  97. package/dist/Editor/utils/font.js +37 -40
  98. package/dist/Editor/utils/helper.js +19 -88
  99. package/dist/Editor/utils/link.js +1 -1
  100. package/dist/Editor/utils/pageSettings.js +2 -14
  101. package/dist/Editor/utils/table.js +0 -21
  102. package/package.json +2 -5
  103. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  104. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  105. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  106. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  107. package/dist/Editor/common/CustomDialog/index.js +0 -94
  108. package/dist/Editor/common/CustomDialog/style.js +0 -67
  109. package/dist/Editor/common/CustomSelect.js +0 -33
  110. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  111. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  112. package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
  113. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  114. package/dist/Editor/theme/index.js +0 -144
  115. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  116. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  117. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  118. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  119. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  120. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  121. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  122. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  123. package/dist/Editor/themeSettings/icons.js +0 -60
  124. package/dist/Editor/themeSettings/index.js +0 -320
  125. package/dist/Editor/themeSettings/style.js +0 -152
  126. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  127. package/dist/Editor/themeSettingsAI/index.js +0 -356
  128. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  129. package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -2,11 +2,8 @@ import { useMemo } from "react";
2
2
  import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
3
3
  import CustomSelectTool from "./CustomSelectTool";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
- import { BREAKPOINTS_DEVICES, getBreakPointsValue, isTextCustomized as isCustomized, textThemeFields as themeFields } from "../../../helper/theme";
5
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
6
6
  import { sizeMap } from "../../../utils/font";
7
- import { Editor } from "slate";
8
- import { useEditorTheme } from "../../../hooks/useEditorTheme";
9
- import { MenuItem, Select } from "@mui/material";
10
7
  import { jsx as _jsx } from "react/jsx-runtime";
11
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
9
  function Label({
@@ -20,190 +17,93 @@ function Label({
20
17
  });
21
18
  }
22
19
  function DisplayHeaderLabel({
23
- type,
24
- isCustomized,
25
- isPara = false
20
+ type
26
21
  }) {
27
22
  return /*#__PURE__*/_jsxs("div", {
28
- children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
23
+ children: ["H", /*#__PURE__*/_jsx("sub", {
29
24
  children: type
30
25
  })]
31
26
  });
32
27
  }
33
- function getTypographyOptions(isCustomized) {
34
- const typographyOptions = [{
35
- id: 11,
36
- format: "headingOne",
37
- type: "block",
38
- title: /*#__PURE__*/_jsx(Label, {
39
- label: "H1",
40
- type: "Heading"
41
- }),
42
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
43
- type: 1,
44
- isCustomized: isCustomized
45
- }),
46
- group: "typography",
47
- value: "headingOne"
48
- }, {
49
- id: 12,
50
- format: "headingTwo",
51
- type: "block",
52
- title: /*#__PURE__*/_jsx(Label, {
53
- label: "H2",
54
- type: "Heading"
55
- }),
56
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
57
- type: 2,
58
- isCustomized: isCustomized
59
- }),
60
- group: "typography",
61
- value: "headingTwo"
62
- }, {
63
- id: 13,
64
- format: "headingThree",
65
- type: "block",
66
- title: /*#__PURE__*/_jsx(Label, {
67
- label: "H3",
68
- type: "Heading"
69
- }),
70
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
71
- type: 3,
72
- isCustomized: isCustomized
73
- }),
74
- group: "typography",
75
- value: "headingThree"
76
- }, {
77
- id: 17,
78
- format: "headingFour",
79
- type: "block",
80
- title: /*#__PURE__*/_jsx(Label, {
81
- label: "H4",
82
- type: "Heading"
83
- }),
84
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
85
- type: 4,
86
- isCustomized: isCustomized
87
- }),
88
- group: "typography",
89
- value: "headingFour"
90
- }, {
91
- id: 18,
92
- format: "headingFive",
93
- type: "block",
94
- title: /*#__PURE__*/_jsx(Label, {
95
- label: "H5",
96
- type: "Heading"
97
- }),
98
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
99
- type: 5,
100
- isCustomized: isCustomized
101
- }),
102
- group: "typography",
103
- value: "headingFive"
104
- }, {
105
- id: 19,
106
- format: "headingSix",
107
- type: "block",
108
- title: /*#__PURE__*/_jsx(Label, {
109
- label: "H6",
110
- type: "Heading"
111
- }),
112
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
113
- type: 6,
114
- isCustomized: isCustomized
115
- }),
116
- group: "typography",
117
- value: "headingSix"
118
- }, {
119
- id: 20,
120
- format: "paragraphOne",
121
- type: "block",
122
- title: /*#__PURE__*/_jsx(Label, {
123
- label: "P1",
124
- type: "Paragraph"
125
- }),
126
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
127
- type: 1,
128
- isCustomized: isCustomized,
129
- isPara: true
130
- }),
131
- group: "typography",
132
- value: "paragraphOne"
133
- }, {
134
- id: 21,
135
- format: "paragraphTwo",
136
- type: "block",
137
- title: /*#__PURE__*/_jsx(Label, {
138
- label: "P2",
139
- type: "Paragraph"
140
- }),
141
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
142
- type: 2,
143
- isCustomized: isCustomized,
144
- isPara: true
145
- }),
146
- group: "typography",
147
- value: "paragraphTwo"
148
- }, {
149
- id: 22,
150
- format: "paragraphThree",
151
- type: "block",
152
- title: /*#__PURE__*/_jsx(Label, {
153
- label: "P3",
154
- type: "Paragraph"
155
- }),
156
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
157
- type: 3,
158
- isCustomized: isCustomized,
159
- isPara: true
160
- }),
161
- group: "typography",
162
- value: "paragraphThree"
163
- }
164
- // {
165
- // id: 14,
166
- // format: "fontSize",
167
- // type: "mark",
168
- // title: <Label label="L" type="Large" />,
169
- // label: "L",
170
- // group: "typography",
171
- // value: "huge",
172
- // },
173
- // {
174
- // id: 15,
175
- // format: "fontSize",
176
- // type: "mark",
177
- // title: <Label label="M" type="Medium" />,
178
- // label: "M",
179
- // group: "typography",
180
- // value: "medium",
181
- // },
182
- // {
183
- // id: 16,
184
- // format: "fontSize",
185
- // type: "mark",
186
- // title: <Label label="S" type="Small" />,
187
- // label: "S",
188
- // group: "typography",
189
- // value: "small",
190
- // },
191
- ];
192
-
193
- return typographyOptions;
194
- }
28
+ const typographyOptions = [{
29
+ id: 11,
30
+ format: "headingOne",
31
+ type: "block",
32
+ title: /*#__PURE__*/_jsx(Label, {
33
+ label: "H1",
34
+ type: "Header"
35
+ }),
36
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
37
+ type: 1
38
+ }),
39
+ group: "typography",
40
+ value: "headingOne"
41
+ }, {
42
+ id: 12,
43
+ format: "headingTwo",
44
+ type: "block",
45
+ title: /*#__PURE__*/_jsx(Label, {
46
+ label: "H2",
47
+ type: "Header"
48
+ }),
49
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
50
+ type: 2
51
+ }),
52
+ group: "typography",
53
+ value: "headingTwo"
54
+ }, {
55
+ id: 13,
56
+ format: "headingThree",
57
+ type: "block",
58
+ title: /*#__PURE__*/_jsx(Label, {
59
+ label: "H3",
60
+ type: "Header"
61
+ }),
62
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
63
+ type: 3
64
+ }),
65
+ group: "typography",
66
+ value: "headingThree"
67
+ }, {
68
+ id: 14,
69
+ format: "fontSize",
70
+ type: "mark",
71
+ title: /*#__PURE__*/_jsx(Label, {
72
+ label: "L",
73
+ type: "Large"
74
+ }),
75
+ label: "L",
76
+ group: "typography",
77
+ value: "huge"
78
+ }, {
79
+ id: 15,
80
+ format: "fontSize",
81
+ type: "mark",
82
+ title: /*#__PURE__*/_jsx(Label, {
83
+ label: "M",
84
+ type: "Medium"
85
+ }),
86
+ label: "M",
87
+ group: "typography",
88
+ value: "medium"
89
+ }, {
90
+ id: 16,
91
+ format: "fontSize",
92
+ type: "mark",
93
+ title: /*#__PURE__*/_jsx(Label, {
94
+ label: "S",
95
+ type: "Small"
96
+ }),
97
+ label: "S",
98
+ group: "typography",
99
+ value: "small"
100
+ }];
195
101
  function SelectTypography({
196
102
  editor,
197
103
  classes,
198
- closeMainPopup,
199
- type
104
+ closeMainPopup
200
105
  }) {
201
106
  const [size] = useWindowResize();
202
- const {
203
- theme
204
- } = useEditorTheme();
205
- const isTextCustomized = theme?.id ? isCustomized(editor) : false;
206
- const typographyOptions = getTypographyOptions(isTextCustomized);
207
107
  const updateMarkData = newVal => {
208
108
  const val = activeMark(editor, "fontSize");
209
109
  let upData = {
@@ -225,10 +125,8 @@ function SelectTypography({
225
125
  ...upData
226
126
  }
227
127
  });
228
-
229
- // closeMainPopup();
128
+ closeMainPopup();
230
129
  };
231
-
232
130
  const selectedBlock = useMemo(() => {
233
131
  return typographyOptions.find(t => {
234
132
  if (t.type === "block") {
@@ -250,49 +148,31 @@ function SelectTypography({
250
148
  });
251
149
  }, [typographyOptions, activeMark, isBlockActive, editor]);
252
150
  const onChange = (format, option) => {
151
+ // add/reset block elements
152
+ toggleBlock(editor, format);
253
153
  if (option.type === "block") {
254
- themeFields.forEach(field => {
255
- Editor.removeMark(editor, field);
154
+ // reset old font size
155
+ let updatedValue = !selectedBlock ? {} : {
156
+ xs: "16px",
157
+ sm: "16px",
158
+ md: "16px",
159
+ lg: "16px"
160
+ };
161
+ addMarkData(editor, {
162
+ format: "fontSize",
163
+ value: updatedValue
256
164
  });
257
-
258
- // add/reset block elements
259
- toggleBlock(editor, format);
260
165
  } else if (option.type === "mark") {
261
166
  const size = sizeMap[option.value] || "";
262
167
  const [sizeInNumber] = size.split("px");
263
168
  updateMarkData(Number(sizeInNumber));
264
169
  }
265
- closeMainPopup();
266
170
  };
267
- const typographyValue = selectedBlock?.value || "headingOne";
268
- if (type === "fullWidth") {
269
- return /*#__PURE__*/_jsx(Select, {
270
- value: typographyValue,
271
- className: "editor-dd",
272
- onChange: e => {
273
- const {
274
- value
275
- } = e.target;
276
- const option = typographyOptions?.find(o => o.value === value);
277
- onChange(value, option);
278
- },
279
- style: {
280
- width: "100%",
281
- height: "36px",
282
- borderRadius: "10px",
283
- fontSize: "14px"
284
- },
285
- children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
286
- value: item.value,
287
- children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
288
- }, index))
289
- });
290
- }
291
171
  return /*#__PURE__*/_jsx(CustomSelectTool, {
292
172
  options: typographyOptions,
293
173
  editor: editor,
294
174
  onChange: onChange,
295
- value: typographyValue,
175
+ value: selectedBlock?.value || "headingOne",
296
176
  classes: classes
297
177
  });
298
178
  }
@@ -14,7 +14,6 @@ import MiniColorPicker from "./MiniColorPicker";
14
14
  import SelectAlignment from "./SelectAlignment";
15
15
  import SelectFontSize from "./SelectFontSize";
16
16
  import InfinityAITool from "./InfinityAITool";
17
- import { viewSlateSelection } from "../../../utils/helper";
18
17
  import { jsx as _jsx } from "react/jsx-runtime";
19
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
19
  const DEFAULT_COLOR = {
@@ -56,21 +55,18 @@ const MiniTextFormat = props => {
56
55
  }), /*#__PURE__*/_jsx(SelectTypography, {
57
56
  classes: classes,
58
57
  editor: editor,
59
- closeMainPopup: closeMainPopup,
60
- type: "miniToolBar"
58
+ closeMainPopup: closeMainPopup
61
59
  }), /*#__PURE__*/_jsx("div", {
62
60
  className: "verticalLine"
63
61
  }), /*#__PURE__*/_jsx(SelectList, {
64
62
  classes: classes,
65
- editor: editor,
66
- closeMainPopup: closeMainPopup
63
+ editor: editor
67
64
  }), /*#__PURE__*/_jsx("div", {
68
65
  className: "verticalLine mr-1"
69
66
  }), /*#__PURE__*/_jsx(SelectAlignment, {
70
67
  fontAlign: fontAlign,
71
68
  classes: classes,
72
- editor: editor,
73
- closeMainPopup: closeMainPopup
69
+ editor: editor
74
70
  }), /*#__PURE__*/_jsx("div", {
75
71
  className: "verticalLine mr-1"
76
72
  }), /*#__PURE__*/_jsx(SelectFontSize, {
@@ -102,10 +98,7 @@ const MiniTextFormat = props => {
102
98
  editor: editor,
103
99
  customProps: customProps
104
100
  }, link.id), /*#__PURE__*/_jsx(IconButton, {
105
- onClick: e => {
106
- viewSlateSelection();
107
- setAnchorEl(document.getElementById("mini-text-editor-wrapper"));
108
- },
101
+ onClick: e => setAnchorEl(document.getElementById("mini-text-editor-wrapper")),
109
102
  className: `textSettingsIcon ${open ? "btnActive" : ""}`,
110
103
  children: /*#__PURE__*/_jsx(TextToolIcon, {})
111
104
  }), /*#__PURE__*/_jsx(Popper, {
@@ -130,7 +130,7 @@ const usePopupStyle = theme => ({
130
130
  },
131
131
  "& .accordionIcon": {
132
132
  "& p": {
133
- textAlign: "left"
133
+ textAlign: 'left'
134
134
  }
135
135
  }
136
136
  },
@@ -416,11 +416,6 @@ const usePopupStyle = theme => ({
416
416
  "& .MuiOutlinedInput-notchedOutline": {
417
417
  border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
418
418
  },
419
- '& .MuiInputBase-root': {
420
- '& input': {
421
- border: "none !important"
422
- }
423
- },
424
419
  "& svg": {
425
420
  width: "20px",
426
421
  height: "24px"
@@ -429,6 +424,12 @@ const usePopupStyle = theme => ({
429
424
  fontFamilyListOptions: {
430
425
  "& .MuiAutocomplete-listbox": {
431
426
  padding: "0px",
427
+ "&::-webkit-scrollbar-thumb": {
428
+ background: `none !important`
429
+ },
430
+ "&::-webkit-scrollbar-track": {
431
+ visibility: "hidden"
432
+ },
432
433
  "&::-webkit-scrollbar-thumb": {
433
434
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
434
435
  },
@@ -439,8 +440,8 @@ const usePopupStyle = theme => ({
439
440
  margin: "5px",
440
441
  borderRadius: "8px",
441
442
  color: theme?.palette?.editor?.menuOptionTextColor,
442
- fontSize: "14px",
443
- padding: "8px 12px",
443
+ fontSize: '14px',
444
+ padding: '8px 12px',
444
445
  '&[aria-selected="true"]': {
445
446
  backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
446
447
  }
@@ -539,7 +540,7 @@ const usePopupStyle = theme => ({
539
540
  }
540
541
  },
541
542
  alignItems: "flexStart",
542
- // justifyContent: "center",
543
+ justifyContent: "center",
543
544
  flexDirection: "row",
544
545
  "&:hover": {
545
546
  background: "unset"
@@ -788,13 +789,8 @@ const usePopupStyle = theme => ({
788
789
  padding: "0px"
789
790
  },
790
791
  defaultBtn: {
791
- color: "#2563EB !important",
792
- textTransform: "none",
793
- textDecoration: "underline",
794
- "&.Mui-disabled": {
795
- color: "#A0AEC0 !important",
796
- textDecoration: "none"
797
- }
792
+ color: "#0F172A",
793
+ textTransform: "none"
798
794
  },
799
795
  templateCardBtnGrp: {
800
796
  display: "none",
@@ -47,7 +47,7 @@ const TemplateCard = props => {
47
47
  }), /*#__PURE__*/_jsx(CardMedia, {
48
48
  className: `template-card-media ${fullScreen ? "fullscreen" : ""}`,
49
49
  component: "div",
50
- image: m?.compressedThum || m?.thumbnail,
50
+ image: m?.thumbnail,
51
51
  alt: m?.title,
52
52
  sx: classes.templateCardMedia
53
53
  }), /*#__PURE__*/_jsx(PreviewAndSelect, {
@@ -10,14 +10,10 @@ import { AllColors } from "../../Elements/Color Picker/ColorButtons";
10
10
  import { fontFamilyMap } from "../../utils/font";
11
11
  import { getBorderColor } from "../../utils/helper";
12
12
  import SelectTypography from "./MiniTextFormat/SelectTypography";
13
- import { isTextCustomized, saveToTheme } from "../../helper/theme";
14
- import { useEditorTheme } from "../../hooks/useEditorTheme";
15
13
  import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
16
14
  import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
17
15
  import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
18
16
  import { useEditorContext } from "../../hooks/useMouseMove";
19
- import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
20
- import { getPageSettings } from "../../utils/pageSettings";
21
17
  import { jsx as _jsx } from "react/jsx-runtime";
22
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
19
  const allTools = toolbarGroups.flat();
@@ -35,18 +31,10 @@ const TextFormat = props => {
35
31
  const [anchorEl, setAnchorEl] = useState(null);
36
32
  const [type, setType] = useState(null);
37
33
  const open = Boolean(anchorEl);
38
- const {
39
- element: pageSt
40
- } = getPageSettings(editor) || {};
41
- const pageSettingLine = pageSt?.pageProps?.lineHeight;
42
34
  const {
43
35
  fontFamilies,
44
- theme: appTheme
45
- } = useEditorContext();
46
- const {
47
- activeBreakPoint
36
+ theme
48
37
  } = useEditorContext();
49
- const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
50
38
  const fontWeight = allTools.find(f => f.format === "fontWeight");
51
39
  const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
52
40
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
@@ -63,13 +51,6 @@ const TextFormat = props => {
63
51
  color: "",
64
52
  bgColor: ""
65
53
  };
66
- const {
67
- theme,
68
- updateTheme
69
- } = useEditorTheme();
70
- const customized = isTextCustomized(editor);
71
- let lineSpacingValue = activeMark(editor, "lineHeight");
72
- lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
73
54
  const handleColorPicker = type => e => {
74
55
  setType(type);
75
56
  setAnchorEl(e.currentTarget);
@@ -110,62 +91,11 @@ const TextFormat = props => {
110
91
  value
111
92
  });
112
93
  };
113
- const handleLineSpacing = data => {
114
- const [[format, value]] = Object.entries(data);
115
- addMarkData(editor, {
116
- format,
117
- value
118
- });
119
- };
120
94
  return /*#__PURE__*/_jsxs(Grid, {
121
95
  container: true,
122
96
  sx: classes.textFormatWrapper,
123
97
  className: "text-formatter-popup",
124
98
  children: [/*#__PURE__*/_jsxs(Grid, {
125
- item: true,
126
- xs: 12,
127
- children: [/*#__PURE__*/_jsxs(Grid, {
128
- container: true,
129
- justifyContent: "space-between",
130
- alignItems: "center",
131
- children: [/*#__PURE__*/_jsx(Grid, {
132
- item: true,
133
- children: /*#__PURE__*/_jsx(Typography, {
134
- variant: "body1",
135
- color: "primary",
136
- sx: classes.typoLabel,
137
- children: "Style"
138
- })
139
- }), /*#__PURE__*/_jsx(Grid, {
140
- item: true,
141
- children: theme?.id ? /*#__PURE__*/_jsx(Button, {
142
- sx: classes.defaultBtn,
143
- onClick: () => {
144
- const {
145
- field,
146
- theme
147
- } = saveToTheme(editor) || {};
148
- updateTheme(theme, {
149
- action: "ELEMENT_PROPS_CHANGE",
150
- fieldName: field
151
- });
152
- },
153
- disabled: !customized,
154
- children: "Save to theme"
155
- }) : null
156
- })]
157
- }), /*#__PURE__*/_jsx(Grid, {
158
- item: true,
159
- xs: 12,
160
- sx: classes.textFormatField,
161
- children: /*#__PURE__*/_jsx(SelectTypography, {
162
- editor: editor,
163
- classes: classes,
164
- closeMainPopup: () => {},
165
- type: "fullWidth"
166
- })
167
- })]
168
- }), /*#__PURE__*/_jsxs(Grid, {
169
99
  item: true,
170
100
  xs: 12,
171
101
  children: [/*#__PURE__*/_jsxs(Grid, {
@@ -318,7 +248,7 @@ const TextFormat = props => {
318
248
  children: /*#__PURE__*/_jsx(Button, {
319
249
  sx: classes.defaultBtn2,
320
250
  startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {
321
- stroke: appTheme?.palette?.type === "dark" ? "#505359" : "#A2B0B9"
251
+ stroke: theme?.palette?.type === "dark" ? "#505359" : "#A2B0B9"
322
252
  }),
323
253
  onClick: handleDefault({
324
254
  format: "bgColor"
@@ -406,7 +336,11 @@ const TextFormat = props => {
406
336
  xs: 12,
407
337
  className: "typo-icons",
408
338
  sx: classes.evenSpace,
409
- children: [fontStyle?.map((m, i) => {
339
+ children: [/*#__PURE__*/_jsx(SelectTypography, {
340
+ classes: classes,
341
+ editor: editor,
342
+ closeMainPopup: closeMainPopup || onClose
343
+ }), fontStyle?.map((m, i) => {
410
344
  return /*#__PURE__*/_jsx(MarkButton, {
411
345
  editor: editor,
412
346
  ...m
@@ -426,32 +360,6 @@ const TextFormat = props => {
426
360
  xs: 12,
427
361
  sx: classes.dividerGrid,
428
362
  children: /*#__PURE__*/_jsx(Divider, {})
429
- }), /*#__PURE__*/_jsxs(Grid, {
430
- item: true,
431
- xs: 12,
432
- children: [/*#__PURE__*/_jsx(Typography, {
433
- variant: "body1",
434
- color: "primary",
435
- sx: classes.typoLabel,
436
- children: "Line Spacing"
437
- }), /*#__PURE__*/_jsx(Grid, {
438
- item: true,
439
- xs: 12,
440
- className: "typo-icons",
441
- sx: classes.evenSpace,
442
- children: /*#__PURE__*/_jsx(LineSpacing, {
443
- value: lineSpacingValue,
444
- onChange: handleLineSpacing,
445
- data: {
446
- key: "lineHeight"
447
- }
448
- })
449
- })]
450
- }), /*#__PURE__*/_jsx(Grid, {
451
- item: true,
452
- xs: 12,
453
- sx: classes.dividerGrid,
454
- children: /*#__PURE__*/_jsx(Divider, {})
455
363
  }), /*#__PURE__*/_jsx(Grid, {
456
364
  item: true,
457
365
  xs: 12,
@@ -9,7 +9,6 @@ import { useEditorContext } from "../../hooks/useMouseMove";
9
9
  import usePopupStyles from "../PopupTool/PopupToolStyle";
10
10
  import useEditorScroll from "../../hooks/useEditorScroll";
11
11
  import { isCarouselSelected } from "../../helper";
12
- import { hideSlateSelection } from "../../utils/helper";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
  const PopupTool = props => {
15
14
  const {
@@ -87,7 +86,6 @@ const PopupTool = props => {
87
86
  setAnchorEl(null);
88
87
  } else {
89
88
  updateAnchorEl();
90
- hideSlateSelection(); // removes slate selection background, when there is no selection
91
89
  }
92
90
  }, [selection, event, selectedElement?.enable]);
93
91
  const handleClose = () => {