@flozy/editor 3.8.9 → 3.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. package/dist/Editor/ChatEditor.js +55 -45
  2. package/dist/Editor/CommonEditor.js +175 -168
  3. package/dist/Editor/DialogWrapper.js +3 -4
  4. package/dist/Editor/Editor.css +7 -4
  5. package/dist/Editor/Elements/AI/AIInput.js +17 -18
  6. package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
  7. package/dist/Editor/Elements/AI/PopoverAIInput.js +58 -74
  8. package/dist/Editor/Elements/AI/Styles.js +2 -1
  9. package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
  10. package/dist/Editor/Elements/AI/VoiceToText/index.js +177 -0
  11. package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +49 -40
  13. package/dist/Editor/Elements/Button/EditorButton.js +38 -33
  14. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -17
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  16. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  17. package/dist/Editor/Elements/Color Picker/Styles.js +2 -1
  18. package/dist/Editor/Elements/Embed/Image.js +14 -15
  19. package/dist/Editor/Elements/Embed/Video.js +8 -12
  20. package/dist/Editor/Elements/Emoji/EmojiButton.js +7 -11
  21. package/dist/Editor/Elements/Emoji/EmojiPicker.js +4 -2
  22. package/dist/Editor/Elements/Form/Form.js +1 -1
  23. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -3
  24. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -1
  25. package/dist/Editor/Elements/Grid/Grid.js +34 -14
  26. package/dist/Editor/Elements/Grid/GridItem.js +23 -31
  27. package/dist/Editor/Elements/Link/Link.js +6 -1
  28. package/dist/Editor/Elements/Link/LinkButton.js +4 -2
  29. package/dist/Editor/Elements/Link/LinkPopup.js +10 -3
  30. package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
  31. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +8 -4
  32. package/dist/Editor/Elements/Redo/RedoButton.js +14 -0
  33. package/dist/Editor/Elements/Signature/SignaturePopup.js +14 -3
  34. package/dist/Editor/Elements/SimpleText/index.js +8 -9
  35. package/dist/Editor/Elements/SimpleText/style.js +0 -37
  36. package/dist/Editor/Elements/Table/Styles.js +23 -1
  37. package/dist/Editor/Elements/Table/Table.js +2 -1
  38. package/dist/Editor/Elements/Table/TableCell.js +69 -7
  39. package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +1 -0
  40. package/dist/Editor/Elements/Undo/UndoButton.js +14 -0
  41. package/dist/Editor/MiniEditor.js +3 -1
  42. package/dist/Editor/Styles/EditorStyles.js +1 -24
  43. package/dist/Editor/Toolbar/Basic/index.js +4 -2
  44. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +26 -2
  45. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  46. package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -18
  47. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +29 -3
  48. package/dist/Editor/Toolbar/Mini/Options/Options.js +10 -0
  49. package/dist/Editor/Toolbar/Mini/Styles.js +7 -0
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  53. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +22 -16
  54. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +52 -8
  55. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
  56. package/dist/Editor/Toolbar/PopupTool/index.js +7 -25
  57. package/dist/Editor/Toolbar/Toolbar.js +0 -7
  58. package/dist/Editor/Toolbar/toolbarGroups.js +48 -11
  59. package/dist/Editor/assets/svg/AIIcons.js +153 -1
  60. package/dist/Editor/assets/svg/AddTemplateIcon.js +13 -10
  61. package/dist/Editor/assets/svg/RedoIcon.js +27 -0
  62. package/dist/Editor/assets/svg/SettingsIcon.js +28 -0
  63. package/dist/Editor/assets/svg/TextIcon.js +8 -5
  64. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  65. package/dist/Editor/assets/svg/UndoIcon.js +27 -0
  66. package/dist/Editor/common/ColorPickerButton.js +25 -9
  67. package/dist/Editor/common/CustomColorPicker/index.js +106 -0
  68. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  69. package/dist/Editor/common/CustomDialog/index.js +94 -0
  70. package/dist/Editor/common/CustomDialog/style.js +67 -0
  71. package/dist/Editor/common/CustomSelect.js +33 -0
  72. package/dist/Editor/common/DnD/DragHandleButton.js +56 -47
  73. package/dist/Editor/common/Icon.js +41 -8
  74. package/dist/Editor/common/LinkSettings/NavComponents.js +5 -2
  75. package/dist/Editor/common/LinkSettings/index.js +4 -2
  76. package/dist/Editor/common/LinkSettings/navOptions.js +7 -2
  77. package/dist/Editor/common/LinkSettings/style.js +11 -8
  78. package/dist/Editor/common/MentionsPopup/MentionsListCard.js +6 -1
  79. package/dist/Editor/common/MentionsPopup/index.js +8 -12
  80. package/dist/Editor/common/Section/index.js +69 -28
  81. package/dist/Editor/common/Section/styles.js +12 -6
  82. package/dist/Editor/common/Shorthands/elements.js +54 -12
  83. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  84. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -16
  85. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  86. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
  87. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +31 -7
  88. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  89. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +14 -3
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +2 -4
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +14 -4
  92. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  93. package/dist/Editor/common/StyleBuilder/sectionStyle.js +2 -13
  94. package/dist/Editor/common/iconslist.js +0 -31
  95. package/dist/Editor/helper/index.js +0 -139
  96. package/dist/Editor/helper/theme.js +185 -48
  97. package/dist/Editor/hooks/useEditorTheme.js +139 -0
  98. package/dist/Editor/hooks/useMouseMove.js +12 -37
  99. package/dist/Editor/hooks/useWindowMessage.js +10 -7
  100. package/dist/Editor/hooks/withCommon.js +1 -2
  101. package/dist/Editor/plugins/withEmbeds.js +1 -1
  102. package/dist/Editor/plugins/withHTML.js +1 -1
  103. package/dist/Editor/plugins/withTable.js +1 -1
  104. package/dist/Editor/theme/ThemeList.js +50 -173
  105. package/dist/Editor/theme/index.js +144 -0
  106. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  107. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  108. package/dist/Editor/themeSettings/buttons/style.js +21 -0
  109. package/dist/Editor/themeSettings/colorTheme/index.js +290 -0
  110. package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
  111. package/dist/Editor/themeSettings/fonts/PreviewElement.js +123 -0
  112. package/dist/Editor/themeSettings/fonts/index.js +213 -0
  113. package/dist/Editor/themeSettings/fonts/style.js +44 -0
  114. package/dist/Editor/themeSettings/icons.js +60 -0
  115. package/dist/Editor/themeSettings/index.js +320 -0
  116. package/dist/Editor/themeSettings/style.js +152 -0
  117. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  118. package/dist/Editor/themeSettingsAI/index.js +356 -0
  119. package/dist/Editor/themeSettingsAI/saveTheme.js +190 -0
  120. package/dist/Editor/themeSettingsAI/style.js +247 -0
  121. package/dist/Editor/utils/SlateUtilityFunctions.js +163 -47
  122. package/dist/Editor/utils/button.js +1 -17
  123. package/dist/Editor/utils/draftToSlate.js +1 -1
  124. package/dist/Editor/utils/events.js +54 -7
  125. package/dist/Editor/utils/font.js +40 -37
  126. package/dist/Editor/utils/helper.js +31 -31
  127. package/dist/Editor/utils/table.js +51 -43
  128. package/package.json +4 -6
  129. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -391
  130. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +0 -193
  131. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +0 -23
  132. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +0 -184
  133. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +0 -36
  134. package/dist/Editor/Elements/FreeGrid/Options/More.js +0 -24
  135. package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +0 -47
  136. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +0 -11
  137. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +0 -75
  138. package/dist/Editor/Elements/FreeGrid/styles.js +0 -159
  139. package/dist/Editor/ErrorBoundary.js +0 -30
  140. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +0 -105
  141. package/dist/Editor/common/RnD/ContextMenu/index.js +0 -38
  142. package/dist/Editor/common/RnD/ContextMenu/styles.js +0 -21
  143. package/dist/Editor/common/RnD/DragInfo/index.js +0 -31
  144. package/dist/Editor/common/RnD/DragInfo/styles.js +0 -15
  145. package/dist/Editor/common/RnD/DragOver/index.js +0 -46
  146. package/dist/Editor/common/RnD/DragOver/styles.js +0 -23
  147. package/dist/Editor/common/RnD/ElementOptions/Actions.js +0 -82
  148. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -26
  149. package/dist/Editor/common/RnD/ElementOptions/index.js +0 -93
  150. package/dist/Editor/common/RnD/ElementOptions/styles.js +0 -41
  151. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +0 -153
  152. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +0 -58
  153. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +0 -7
  154. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +0 -46
  155. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +0 -46
  156. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +0 -46
  157. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +0 -30
  158. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +0 -46
  159. package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +0 -13
  160. package/dist/Editor/common/RnD/ElementSettings/index.js +0 -17
  161. package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +0 -14
  162. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -76
  163. package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +0 -52
  164. package/dist/Editor/common/RnD/GuideLines/index.js +0 -33
  165. package/dist/Editor/common/RnD/GuideLines/styles.js +0 -60
  166. package/dist/Editor/common/RnD/OptionsPopup/index.js +0 -50
  167. package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -36
  168. package/dist/Editor/common/RnD/RnDCopy.js +0 -23
  169. package/dist/Editor/common/RnD/ShadowElement.js +0 -34
  170. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +0 -40
  171. package/dist/Editor/common/RnD/SwitchViewport/styles.js +0 -24
  172. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +0 -63
  173. package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +0 -19
  174. package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +0 -13
  175. package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +0 -18
  176. package/dist/Editor/common/RnD/TransformHandles/index.js +0 -62
  177. package/dist/Editor/common/RnD/Utils/alignmentDetection.js +0 -26
  178. package/dist/Editor/common/RnD/Utils/calculateDropItem.js +0 -98
  179. package/dist/Editor/common/RnD/Utils/collisionDetection.js +0 -52
  180. package/dist/Editor/common/RnD/Utils/gridDropItem.js +0 -148
  181. package/dist/Editor/common/RnD/Utils/index.js +0 -251
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +0 -76
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -27
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +0 -28
  185. package/dist/Editor/common/RnD/index.js +0 -503
  186. package/dist/Editor/common/RnD/styles.js +0 -4
  187. package/dist/Editor/common/StyleBuilder/boxStyle.js +0 -30
  188. package/dist/Editor/helper/RnD/focusOnNewItem.js +0 -39
  189. package/dist/Editor/helper/RnD/scrollToNewSection.js +0 -24
  190. package/dist/Editor/helper/breakpoint.js +0 -5
  191. package/dist/Editor/hooks/useBreakpoints.js +0 -34
  192. package/dist/Editor/hooks/withErrorHandling.js +0 -14
  193. package/dist/Editor/utils/RnD/RnDCtrlCmds.js +0 -168
  194. package/dist/Editor/utils/freegrid.js +0 -49
@@ -2,8 +2,11 @@ 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 } from "../../../helper/theme";
5
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue, isTextCustomized as isCustomized, textThemeFields as themeFields } from "../../../helper/theme";
6
6
  import { sizeMap } from "../../../utils/font";
7
+ import { Editor } from "slate";
8
+ import { MenuItem, Select } from "@mui/material";
9
+ import { useEditorTheme } from "../../../hooks/useEditorTheme";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
12
  function Label({
@@ -17,93 +20,194 @@ function Label({
17
20
  });
18
21
  }
19
22
  function DisplayHeaderLabel({
20
- type
23
+ type,
24
+ isCustomized,
25
+ isPara = false
21
26
  }) {
22
27
  return /*#__PURE__*/_jsxs("div", {
23
- children: ["H", /*#__PURE__*/_jsx("sub", {
28
+ children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
24
29
  children: type
25
30
  })]
26
31
  });
27
32
  }
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, {
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
+ id: 14,
165
+ format: "fontSize",
166
+ type: "mark",
167
+ title: /*#__PURE__*/_jsx(Label, {
168
+ label: "L",
169
+ type: "Large"
170
+ }),
72
171
  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, {
172
+ group: "typography",
173
+ value: "huge"
174
+ }, {
175
+ id: 15,
176
+ format: "fontSize",
177
+ type: "mark",
178
+ title: /*#__PURE__*/_jsx(Label, {
179
+ label: "M",
180
+ type: "Medium"
181
+ }),
83
182
  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, {
183
+ group: "typography",
184
+ value: "medium"
185
+ }, {
186
+ id: 16,
187
+ format: "fontSize",
188
+ type: "mark",
189
+ title: /*#__PURE__*/_jsx(Label, {
190
+ label: "S",
191
+ type: "Small"
192
+ }),
94
193
  label: "S",
95
- type: "Small"
96
- }),
97
- label: "S",
98
- group: "typography",
99
- value: "small"
100
- }];
194
+ group: "typography",
195
+ value: "small"
196
+ }];
197
+ return typographyOptions;
198
+ }
101
199
  function SelectTypography({
102
200
  editor,
103
201
  classes,
104
- closeMainPopup
202
+ closeMainPopup,
203
+ type
105
204
  }) {
106
205
  const [size] = useWindowResize();
206
+ const {
207
+ theme
208
+ } = useEditorTheme();
209
+ const isTextCustomized = theme?.id ? isCustomized(editor) : false;
210
+ const typographyOptions = getTypographyOptions(isTextCustomized);
107
211
  const updateMarkData = newVal => {
108
212
  const val = activeMark(editor, "fontSize");
109
213
  let upData = {
@@ -148,26 +252,49 @@ function SelectTypography({
148
252
  });
149
253
  }, [typographyOptions, activeMark, isBlockActive, editor]);
150
254
  const onChange = (format, option) => {
151
- // add/reset block elements
152
- toggleBlock(editor, format);
153
255
  if (option.type === "block") {
154
- // reset old font size
155
- addMarkData(editor, {
156
- format: "fontSize",
157
- value: {}
256
+ themeFields.forEach(field => {
257
+ Editor.removeMark(editor, field);
158
258
  });
259
+
260
+ // add/reset block elements
261
+ toggleBlock(editor, format);
159
262
  } else if (option.type === "mark") {
160
263
  const size = sizeMap[option.value] || "";
161
264
  const [sizeInNumber] = size.split("px");
162
265
  updateMarkData(Number(sizeInNumber));
163
266
  }
164
267
  };
165
- return /*#__PURE__*/_jsx(CustomSelectTool, {
166
- options: typographyOptions,
167
- editor: editor,
168
- onChange: onChange,
169
- value: selectedBlock?.value || "headingOne",
170
- classes: classes
268
+ const typographyValue = selectedBlock?.value || "headingOne";
269
+ if (type === "miniToolBar") {
270
+ return /*#__PURE__*/_jsx(CustomSelectTool, {
271
+ options: typographyOptions,
272
+ editor: editor,
273
+ onChange: onChange,
274
+ value: typographyValue,
275
+ classes: classes
276
+ });
277
+ }
278
+ return /*#__PURE__*/_jsx(Select, {
279
+ value: typographyValue,
280
+ className: "editor-dd",
281
+ onChange: e => {
282
+ const {
283
+ value
284
+ } = e.target;
285
+ const option = typographyOptions?.find(o => o.value === value);
286
+ onChange(value, option);
287
+ },
288
+ style: {
289
+ width: "100%",
290
+ height: "36px",
291
+ borderRadius: "10px",
292
+ fontSize: "14px"
293
+ },
294
+ children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
295
+ value: item.value,
296
+ children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
297
+ }, index))
171
298
  });
172
299
  }
173
300
  export default SelectTypography;
@@ -53,7 +53,8 @@ const MiniTextFormat = props => {
53
53
  children: [customProps?.hideTools?.includes("infinityAI") ? null : /*#__PURE__*/_jsx(InfinityAITool, {}), /*#__PURE__*/_jsx(SelectTypography, {
54
54
  classes: classes,
55
55
  editor: editor,
56
- closeMainPopup: closeMainPopup
56
+ closeMainPopup: closeMainPopup,
57
+ type: "miniToolBar"
57
58
  }), /*#__PURE__*/_jsx("div", {
58
59
  className: "verticalLine"
59
60
  }), /*#__PURE__*/_jsx(SelectList, {
@@ -3,9 +3,8 @@ const usePopupStyle = theme => ({
3
3
  boxShadow: "0px 4px 10px 0px rgba(0, 0, 0, 0.16)",
4
4
  zIndex: 1300,
5
5
  marginBottom: "12px !important",
6
- border: "1px solid #E0E0E0",
7
- borderRadius: "10px",
8
- maxWidth: "100%",
6
+ borderRadius: "6px",
7
+ maxWidth: "96%",
9
8
  "&.fullscreen": {
10
9
  marginBottom: "0px !important",
11
10
  "& .papper-wrpr": {
@@ -19,7 +18,7 @@ const usePopupStyle = theme => ({
19
18
  backgroundColor: theme?.palette?.editor?.background
20
19
  },
21
20
  "&.textSettings": {
22
- '@media only screen and (max-width: 600px)': {
21
+ "@media only screen and (max-width: 600px)": {
23
22
  margin: "4px !important",
24
23
  marginBottom: "54px !important"
25
24
  }
@@ -78,7 +77,7 @@ const usePopupStyle = theme => ({
78
77
  paddingTop: "4px"
79
78
  },
80
79
  "@media only screen and (max-width: 599px)": {
81
- width: '330px'
80
+ width: "330px"
82
81
  }
83
82
  },
84
83
  "&.templates": {
@@ -89,7 +88,7 @@ const usePopupStyle = theme => ({
89
88
  maxHeight: "fit-content"
90
89
  },
91
90
  "@media only screen and (max-width: 599px)": {
92
- width: '330px'
91
+ width: "330px"
93
92
  }
94
93
  },
95
94
  "& .headerContainer": {},
@@ -144,7 +143,7 @@ const usePopupStyle = theme => ({
144
143
  }
145
144
  },
146
145
  "@media only screen and (max-width: 599px)": {
147
- width: '330px'
146
+ width: "330px"
148
147
  }
149
148
  },
150
149
  textFormatLabel: {
@@ -155,13 +154,13 @@ const usePopupStyle = theme => ({
155
154
  lineHeight: "25px",
156
155
  marginTop: "12px",
157
156
  marginBottom: "8px",
158
- '& .searchContainer': {
157
+ "& .searchContainer": {
159
158
  position: "absolute",
160
159
  right: 0,
161
160
  zIndex: 3
162
161
  },
163
- '& .MuiFormControl-root.MuiTextField-root input': {
164
- padding: '8px 35px 6px 12px'
162
+ "& .MuiFormControl-root.MuiTextField-root input": {
163
+ padding: "8px 35px 6px 12px"
165
164
  }
166
165
  },
167
166
  textFormatField: {
@@ -205,7 +204,8 @@ const usePopupStyle = theme => ({
205
204
  fontSize: "14px",
206
205
  marginBottom: "5px",
207
206
  paddingLeft: "5px",
208
- fontWeight: 500
207
+ fontWeight: 500,
208
+ color: "#000000"
209
209
  },
210
210
  templateCard: {
211
211
  borderRadius: "10px",
@@ -327,8 +327,13 @@ const usePopupStyle = theme => ({
327
327
  }
328
328
  },
329
329
  defaultBtn: {
330
- color: "#0F172A",
331
- textTransform: "none"
330
+ color: "#2563EB !important",
331
+ textTransform: "none",
332
+ textDecoration: "underline",
333
+ "&.Mui-disabled": {
334
+ color: "#A0AEC0 !important",
335
+ textDecoration: "none"
336
+ }
332
337
  },
333
338
  templateCardBtnGrp: {
334
339
  display: "none",
@@ -413,7 +418,8 @@ const usePopupStyle = theme => ({
413
418
  colorPopper: {
414
419
  "& .MuiPaper-root": {
415
420
  backgroundColor: theme?.palette?.editor?.background,
416
- '@media only screen and (max-width: 600px)': {
421
+ padding: "4px 14px",
422
+ "@media only screen and (max-width: 600px)": {
417
423
  marginTop: "-40px"
418
424
  }
419
425
  }
@@ -524,9 +530,9 @@ const usePopupStyle = theme => ({
524
530
  },
525
531
  customSelectPopoverWrapper: {
526
532
  "& .MuiPopover-paper": {
527
- maxHeight: '140px',
533
+ maxHeight: "140px",
528
534
  background: theme?.palette?.editor?.background,
529
- '@media only screen and (max-width: 600px)': {
535
+ "@media only screen and (max-width: 600px)": {
530
536
  marginTop: "-40px"
531
537
  }
532
538
  },
@@ -14,6 +14,9 @@ import { getPageSettings, updatePageSettings } from "../../utils/pageSettings";
14
14
  import { AllColors } from "../../Elements/Color Picker/ColorButtons";
15
15
  import { fontFamilyMap } from "../../utils/font";
16
16
  import { getBorderColor } from "../../utils/helper";
17
+ import SelectTypography from "./MiniTextFormat/SelectTypography";
18
+ import { isTextCustomized, saveToTheme } from "../../helper/theme";
19
+ import { useEditorTheme } from "../../hooks/useEditorTheme";
17
20
  import { jsx as _jsx } from "react/jsx-runtime";
18
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
22
  const allTools = toolbarGroups.flat();
@@ -34,7 +37,6 @@ const TextFormat = props => {
34
37
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
35
38
  const link = allTools.find(f => f.format?.indexOf("link") >= 0);
36
39
  const lists = allTools.filter(f => f.group?.indexOf("list") >= 0);
37
- const typo = allTools.filter(f => f.group?.indexOf("typography") >= 0);
38
40
  const {
39
41
  pageProps
40
42
  } = getPageSettings(editor)?.element || {};
@@ -52,6 +54,11 @@ const TextFormat = props => {
52
54
  color: "",
53
55
  bgColor: ""
54
56
  };
57
+ const {
58
+ theme,
59
+ updateTheme
60
+ } = useEditorTheme();
61
+ const customized = isTextCustomized(editor);
55
62
  const handlePageWidth = width => () => {
56
63
  updatePageSettings(editor, {
57
64
  ...(pageProps || {}),
@@ -100,8 +107,50 @@ const TextFormat = props => {
100
107
  return /*#__PURE__*/_jsxs(Grid, {
101
108
  container: true,
102
109
  sx: classes.textFormatWrapper,
103
- className: "text-formatter-popup",
104
110
  children: [/*#__PURE__*/_jsxs(Grid, {
111
+ item: true,
112
+ xs: 12,
113
+ children: [/*#__PURE__*/_jsxs(Grid, {
114
+ container: true,
115
+ justifyContent: "space-between",
116
+ alignItems: "center",
117
+ children: [/*#__PURE__*/_jsx(Grid, {
118
+ item: true,
119
+ children: /*#__PURE__*/_jsx(Typography, {
120
+ variant: "body1",
121
+ color: "primary",
122
+ sx: classes.typoLabel,
123
+ children: "Theme Style"
124
+ })
125
+ }), /*#__PURE__*/_jsx(Grid, {
126
+ item: true,
127
+ children: theme?.id ? /*#__PURE__*/_jsx(Button, {
128
+ sx: classes.defaultBtn,
129
+ onClick: () => {
130
+ const {
131
+ field,
132
+ theme
133
+ } = saveToTheme(editor) || {};
134
+ updateTheme(theme, {
135
+ action: "ELEMENT_PROPS_CHANGE",
136
+ fieldName: field
137
+ });
138
+ },
139
+ disabled: !customized,
140
+ children: "Save to theme"
141
+ }) : null
142
+ })]
143
+ }), /*#__PURE__*/_jsx(Grid, {
144
+ item: true,
145
+ xs: 12,
146
+ sx: classes.textFormatField,
147
+ children: /*#__PURE__*/_jsx(SelectTypography, {
148
+ editor: editor,
149
+ classes: classes,
150
+ closeMainPopup: () => {}
151
+ })
152
+ })]
153
+ }), /*#__PURE__*/_jsxs(Grid, {
105
154
  item: true,
106
155
  xs: 12,
107
156
  children: [/*#__PURE__*/_jsxs(Grid, {
@@ -320,12 +369,7 @@ const TextFormat = props => {
320
369
  xs: 12,
321
370
  className: "typo-icons",
322
371
  sx: classes.evenSpace,
323
- children: [typo?.map((m, i) => {
324
- return /*#__PURE__*/_jsx(BlockButton, {
325
- editor: editor,
326
- ...m
327
- }, `pptool_mark_${i}_${m.id}`);
328
- }), fontStyle?.map((m, i) => {
372
+ children: [fontStyle?.map((m, i) => {
329
373
  return /*#__PURE__*/_jsx(MarkButton, {
330
374
  editor: editor,
331
375
  ...m