@flozy/editor 9.8.3 → 9.8.4

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 (257) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +141 -26
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +11 -7
  5. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  6. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  7. package/dist/Editor/Elements/AI/PopoverAIInput.js +15 -5
  8. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  9. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  10. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  11. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  13. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  14. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  15. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  16. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  17. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  18. package/dist/Editor/Elements/Button/EditorButton.js +43 -30
  19. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  20. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  21. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  22. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  23. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  24. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  25. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
  26. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  27. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  28. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  29. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  30. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  31. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  32. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
  35. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  36. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  38. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  39. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  40. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  42. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  44. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  45. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  46. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  47. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  48. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  49. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  50. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  51. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  52. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  53. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  54. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  55. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  56. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  57. package/dist/Editor/Elements/Embed/Image.js +16 -11
  58. package/dist/Editor/Elements/Embed/Video.js +10 -7
  59. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  60. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  61. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  62. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  63. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  64. package/dist/Editor/Elements/Form/Form.js +12 -9
  65. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  66. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  67. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  68. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  69. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  70. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  71. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  72. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  73. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  74. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
  75. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  76. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
  77. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  78. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  79. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  80. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  81. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  82. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  83. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  84. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  85. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  86. package/dist/Editor/Elements/Link/Link.js +8 -5
  87. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  88. package/dist/Editor/Elements/List/CheckList.js +18 -10
  89. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  90. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  91. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  92. package/dist/Editor/Elements/Search/SearchButton.js +7 -4
  93. package/dist/Editor/Elements/Search/SearchList.js +10 -5
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
  96. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  97. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  98. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  99. package/dist/Editor/Elements/SimpleText/index.js +14 -5
  100. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  101. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  102. package/dist/Editor/Elements/Table/Table.js +23 -11
  103. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  104. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  105. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  106. package/dist/Editor/Elements/Title/title.js +9 -8
  107. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  108. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  109. package/dist/Editor/MiniEditor.js +10 -3
  110. package/dist/Editor/Styles/EditorStyles.js +5 -5
  111. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  112. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  113. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  114. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  115. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  116. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  117. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  118. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  119. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  128. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  129. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  130. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  131. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  132. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  133. package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
  134. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  135. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  136. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  137. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  138. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  139. package/dist/Editor/common/ColorPickerButton.js +39 -14
  140. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  141. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  142. package/dist/Editor/common/CustomDialog/index.js +8 -10
  143. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  144. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  145. package/dist/Editor/common/CustomSelect.js +43 -0
  146. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  147. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  148. package/dist/Editor/common/Icon.js +31 -1
  149. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  150. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  151. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  152. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  153. package/dist/Editor/common/LinkSettings/index.js +20 -14
  154. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  155. package/dist/Editor/common/MUIIcon/index.js +0 -3
  156. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  157. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  158. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  159. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  160. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  161. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  171. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  172. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  173. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  174. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  175. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  176. package/dist/Editor/common/RnD/Utils/gridDropItem.js +73 -9
  177. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  178. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +69 -13
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +72 -3
  188. package/dist/Editor/common/SnackBar/index.js +43 -0
  189. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  190. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  191. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  192. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  193. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  194. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  213. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  214. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  215. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  216. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  217. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  218. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  219. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  220. package/dist/Editor/common/Uploader.js +16 -5
  221. package/dist/Editor/commonStyle.js +68 -57
  222. package/dist/Editor/helper/index.js +27 -3
  223. package/dist/Editor/helper/textIndeces.js +58 -0
  224. package/dist/Editor/helper/theme.js +202 -2
  225. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +9 -3
  228. package/dist/Editor/hooks/useThemeValues.js +63 -0
  229. package/dist/Editor/plugins/withEmbeds.js +1 -1
  230. package/dist/Editor/plugins/withHTML.js +11 -9
  231. package/dist/Editor/plugins/withLayout.js +3 -2
  232. package/dist/Editor/plugins/withLinks.js +10 -0
  233. package/dist/Editor/plugins/withTable.js +1 -1
  234. package/dist/Editor/theme/ThemeList.js +50 -173
  235. package/dist/Editor/theme/index.js +149 -0
  236. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  237. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  238. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  239. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  240. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  241. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  242. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  243. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  244. package/dist/Editor/themeSettings/icons.js +60 -0
  245. package/dist/Editor/themeSettings/index.js +351 -0
  246. package/dist/Editor/themeSettings/style.js +220 -0
  247. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  248. package/dist/Editor/themeSettingsAI/index.js +355 -0
  249. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  250. package/dist/Editor/themeSettingsAI/style.js +259 -0
  251. package/dist/Editor/utils/SlateUtilityFunctions.js +186 -54
  252. package/dist/Editor/utils/brains.js +1 -2
  253. package/dist/Editor/utils/draftToSlate.js +3 -2
  254. package/dist/Editor/utils/font.js +40 -37
  255. package/dist/Editor/utils/freegrid.js +3 -3
  256. package/dist/Editor/utils/helper.js +92 -21
  257. package/package.json +4 -4
@@ -0,0 +1,436 @@
1
+ import { Box, Button, Divider, Grid, IconButton, Popover, TextField, Tooltip, Typography } from "@mui/material";
2
+ import { useEditorContext } from "../../hooks/useMouseMove";
3
+ import FormatClearIcon from "@mui/icons-material/FormatClear";
4
+ import usePopupStyles from "../PopupTool/PopupToolStyle";
5
+ import { TextMinusIcon, TextPlusIcon } from "../../common/iconslist";
6
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue, getVariableValue } from "../../helper/theme";
7
+ import useWindowResize from "../../hooks/useWindowResize";
8
+ import { toolbarGroups } from "../toolbarGroups";
9
+ import Icon from "../../common/Icon";
10
+ import { useMemo, useState } from "react";
11
+ import CommonButton from "../../common/Button";
12
+ import CustomSelect from "../../common/CustomSelect";
13
+ import ColorButtons from "../../Elements/Color Picker/ColorButtons";
14
+ import FormatColorResetIcon from "@mui/icons-material/FormatColorReset";
15
+ import ColorPickerStyles from "../../Elements/Color Picker/Styles";
16
+ import colorWheel from "../../Elements/Color Picker/colorWheel.png";
17
+ import CustomColorPicker from "../../common/CustomColorPicker";
18
+ import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
19
+ import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { Fragment as _Fragment } from "react/jsx-runtime";
23
+ function getFontStyleProps(settings = {}, format) {
24
+ const {
25
+ fontWeight,
26
+ fontStyle
27
+ } = settings;
28
+ let isActive;
29
+ let onClick;
30
+ switch (format) {
31
+ case "bold":
32
+ isActive = fontWeight === "bold" || fontWeight === "700";
33
+ onClick = () => {
34
+ return {
35
+ fontWeight: isActive ? "normal" : "bold"
36
+ };
37
+ };
38
+ break;
39
+ case "italic":
40
+ isActive = fontStyle === "italic";
41
+ onClick = () => {
42
+ return {
43
+ fontStyle: isActive ? "unset" : "italic"
44
+ };
45
+ };
46
+ break;
47
+
48
+ // case "underline":
49
+ // isActive = textDecoration.includes("underline");
50
+ // onClick = () => {
51
+ // let otherTextDecoration = textDecoration?.includes("line-through")
52
+ // ? "line-through"
53
+ // : "";
54
+
55
+ // otherTextDecoration += isActive ? "" : " underline";
56
+
57
+ // return { textDecoration: otherTextDecoration };
58
+ // };
59
+ // break;
60
+ // case "strikethrough":
61
+ // isActive = textDecoration.includes("line-through");
62
+ // onClick = () => {
63
+ // let otherTextDecoration = textDecoration?.includes("underline")
64
+ // ? "underline"
65
+ // : "";
66
+
67
+ // otherTextDecoration += isActive ? "" : " line-through";
68
+
69
+ // return { textDecoration: otherTextDecoration };
70
+ // };
71
+ // break;
72
+
73
+ default:
74
+ isActive = false;
75
+ onClick = () => {};
76
+ break;
77
+ }
78
+ return {
79
+ isActive,
80
+ onClick
81
+ };
82
+ }
83
+ const allTools = toolbarGroups.flat();
84
+ function ThemeTextFormat(props) {
85
+ const {
86
+ settings,
87
+ updateSettings,
88
+ onSaveTextSettings,
89
+ onClose
90
+ } = props;
91
+ const {
92
+ theme,
93
+ fontFamilies
94
+ } = useEditorContext();
95
+ const classes = usePopupStyles(theme);
96
+ const pickerStyles = ColorPickerStyles(theme);
97
+ const fontStyle = allTools.filter(f => f.type === "mark" && f.themeEnabled);
98
+ const fontWeight = allTools.find(f => f.format === "fontWeight");
99
+ const fontFamilyVal = useMemo(() => {
100
+ const {
101
+ fontFamily = ""
102
+ } = settings;
103
+ let font = fontFamily.startsWith("var") ? getVariableValue(fontFamily) : fontFamily;
104
+ return font;
105
+ }, [settings]);
106
+ const fontWeightVal = useMemo(() => {
107
+ const {
108
+ options
109
+ } = fontWeight || {};
110
+ const selected = options?.find(o => o.value === settings?.fontWeight || o.numVal === settings?.fontWeight);
111
+ return selected?.value;
112
+ }, [settings?.fontWeight]);
113
+ return /*#__PURE__*/_jsxs(Box, {
114
+ sx: classes.textFormatContainer,
115
+ children: [/*#__PURE__*/_jsxs(Grid, {
116
+ container: true,
117
+ sx: classes.textFormatWrapper,
118
+ children: [/*#__PURE__*/_jsxs(Grid, {
119
+ item: true,
120
+ xs: 12,
121
+ children: [/*#__PURE__*/_jsxs(Grid, {
122
+ container: true,
123
+ justifyContent: "space-between",
124
+ alignItems: "center",
125
+ children: [/*#__PURE__*/_jsx(Grid, {
126
+ item: true,
127
+ children: /*#__PURE__*/_jsx(Typography, {
128
+ variant: "body1",
129
+ color: "primary",
130
+ sx: classes.typoLabel,
131
+ children: "Font Family"
132
+ })
133
+ }), /*#__PURE__*/_jsx(Grid, {
134
+ item: true,
135
+ children: /*#__PURE__*/_jsx(Button, {
136
+ sx: classes.defaultBtn,
137
+ startIcon: /*#__PURE__*/_jsx(FormatClearIcon, {}),
138
+ onClick: () => updateSettings({
139
+ fontFamily: defaultFonts[0]
140
+ }),
141
+ children: "Default"
142
+ })
143
+ })]
144
+ }), /*#__PURE__*/_jsx(Grid, {
145
+ item: true,
146
+ xs: 12,
147
+ sx: classes.textFormatField,
148
+ children: /*#__PURE__*/_jsx(FontFamilyAutocomplete, {
149
+ editor: {},
150
+ format: "fontFamily",
151
+ options: fontFamilies?.options,
152
+ width: "100%",
153
+ onChange: updateSettings,
154
+ val: fontFamilyVal || defaultFonts[0],
155
+ webFont: true
156
+ })
157
+ })]
158
+ }), /*#__PURE__*/_jsxs(Grid, {
159
+ container: true,
160
+ spacing: 2,
161
+ children: [/*#__PURE__*/_jsxs(Grid, {
162
+ item: true,
163
+ xs: 6,
164
+ children: [/*#__PURE__*/_jsx(Typography, {
165
+ variant: "body1",
166
+ color: "primary",
167
+ sx: classes.typoLabel,
168
+ children: "Font Weight"
169
+ }), /*#__PURE__*/_jsx(Grid, {
170
+ item: true,
171
+ xs: 12,
172
+ sx: classes.textFormatField,
173
+ children: /*#__PURE__*/_jsx(CustomSelect, {
174
+ options: fontWeight?.options || [],
175
+ classes: classes,
176
+ onChange: e => {
177
+ updateSettings({
178
+ fontWeight: e.target.value
179
+ });
180
+ },
181
+ value: fontWeightVal
182
+ })
183
+ })]
184
+ }), /*#__PURE__*/_jsxs(Grid, {
185
+ item: true,
186
+ xs: 6,
187
+ children: [/*#__PURE__*/_jsx(Typography, {
188
+ variant: "body1",
189
+ color: "primary",
190
+ sx: classes.typoLabel,
191
+ children: "Font Size"
192
+ }), /*#__PURE__*/_jsx(Grid, {
193
+ item: true,
194
+ xs: 12,
195
+ sx: classes.textFormatCG,
196
+ children: /*#__PURE__*/_jsx(TextSize, {
197
+ classes: classes,
198
+ value: settings?.fontSize || 16,
199
+ onChange: fontSize => updateSettings({
200
+ fontSize
201
+ }),
202
+ fullWidth: true
203
+ })
204
+ })]
205
+ })]
206
+ }), /*#__PURE__*/_jsx(Grid, {
207
+ item: true,
208
+ xs: 12,
209
+ sx: classes.dividerGrid,
210
+ children: /*#__PURE__*/_jsx(Divider, {})
211
+ }), /*#__PURE__*/_jsxs(Grid, {
212
+ item: true,
213
+ xs: 12,
214
+ children: [/*#__PURE__*/_jsxs(Grid, {
215
+ container: true,
216
+ justifyContent: "space-between",
217
+ alignItems: "center",
218
+ children: [/*#__PURE__*/_jsx(Grid, {
219
+ item: true,
220
+ children: /*#__PURE__*/_jsx(Typography, {
221
+ variant: "body1",
222
+ color: "primary",
223
+ sx: classes.typoLabel,
224
+ children: "Text Color"
225
+ })
226
+ }), /*#__PURE__*/_jsx(Grid, {
227
+ item: true,
228
+ children: /*#__PURE__*/_jsx(Button, {
229
+ sx: classes.defaultBtn,
230
+ startIcon: /*#__PURE__*/_jsx(FormatColorResetIcon, {}),
231
+ onClick: () => updateSettings({
232
+ color: "#ddd"
233
+ }),
234
+ children: "Default"
235
+ })
236
+ })]
237
+ }), /*#__PURE__*/_jsx(Grid, {
238
+ sx: classes.textFormatColorWrpr,
239
+ children: /*#__PURE__*/_jsx(ColorPicker, {
240
+ classes: classes,
241
+ pickerStyles: pickerStyles,
242
+ onChange: color => updateSettings({
243
+ color
244
+ }),
245
+ color: settings?.color,
246
+ disableEditTheme: true
247
+ })
248
+ })]
249
+ }), /*#__PURE__*/_jsx(Grid, {
250
+ item: true,
251
+ xs: 12,
252
+ sx: classes.dividerGrid,
253
+ children: /*#__PURE__*/_jsx(Divider, {})
254
+ }), /*#__PURE__*/_jsxs(Grid, {
255
+ item: true,
256
+ xs: 12,
257
+ children: [/*#__PURE__*/_jsx(Typography, {
258
+ variant: "body1",
259
+ color: "primary",
260
+ sx: classes.typoLabel,
261
+ children: "Typography"
262
+ }), /*#__PURE__*/_jsx(Grid, {
263
+ item: true,
264
+ xs: 12,
265
+ className: "typo-icons",
266
+ sx: classes.evenSpace,
267
+ children: fontStyle?.map((m, i) => {
268
+ const {
269
+ isActive,
270
+ onClick
271
+ } = getFontStyleProps(settings, m.format) || {};
272
+ return /*#__PURE__*/_jsx(CommonButton, {
273
+ active: isActive,
274
+ onClick: () => {
275
+ const style = onClick();
276
+ updateSettings(style);
277
+ },
278
+ children: /*#__PURE__*/_jsx(Icon, {
279
+ icon: m.format
280
+ })
281
+ }, i);
282
+ })
283
+ })]
284
+ })]
285
+ }), /*#__PURE__*/_jsxs("div", {
286
+ className: "saveThemeBtnsWrapper",
287
+ children: [/*#__PURE__*/_jsx(Button, {
288
+ onClick: onClose,
289
+ className: "secondaryBtn",
290
+ style: {
291
+ background: "none"
292
+ },
293
+ children: "Cancel"
294
+ }), /*#__PURE__*/_jsx(Button, {
295
+ onClick: onSaveTextSettings,
296
+ className: "primaryBtn",
297
+ children: "Save"
298
+ })]
299
+ })]
300
+ });
301
+ }
302
+ export default ThemeTextFormat;
303
+ function TextSize(props) {
304
+ const {
305
+ classes,
306
+ value: val,
307
+ onChange,
308
+ fullWidth
309
+ } = props;
310
+ const [size] = useWindowResize();
311
+ const value = getBreakPointsValue(val, size?.device);
312
+ const updateMarkData = newVal => {
313
+ let upData = {
314
+ ...getBreakPointsValue(val),
315
+ [size?.device]: `${newVal}px`
316
+ };
317
+
318
+ // if desktop update to all other devices
319
+ // to avoid default normal size
320
+ if (size?.device === "lg") {
321
+ upData = BREAKPOINTS_DEVICES.reduce((a, b) => {
322
+ a[b] = `${newVal}px`;
323
+ return a;
324
+ }, {});
325
+ }
326
+ onChange(upData);
327
+ };
328
+ const onChangeSize = e => {
329
+ let inc = parseInt(e.target.value) || 8;
330
+ inc = inc > 200 ? 200 : inc;
331
+ updateMarkData(inc || 8);
332
+ };
333
+ const getSizeVal = () => {
334
+ try {
335
+ return parseInt(value);
336
+ } catch (err) {
337
+ return "";
338
+ }
339
+ };
340
+ const combinedOldVal = getSizeVal();
341
+ const onIncreaseSize = () => {
342
+ let inc = (combinedOldVal || 0) + 1;
343
+ inc = inc > 200 ? 200 : inc;
344
+ updateMarkData(inc);
345
+ };
346
+ const onDecreaseSize = () => {
347
+ const newVal = combinedOldVal - 1 < 0 ? 0 : combinedOldVal - 1;
348
+ updateMarkData(newVal);
349
+ };
350
+ return /*#__PURE__*/_jsx(TextField, {
351
+ sx: classes?.textSize,
352
+ value: combinedOldVal,
353
+ onChange: onChangeSize,
354
+ size: "small",
355
+ inputProps: {
356
+ style: {
357
+ width: fullWidth ? "100%" : "30px",
358
+ textAlign: "center",
359
+ height: "19px",
360
+ fontSize: "14px"
361
+ }
362
+ },
363
+ fullWidth: fullWidth,
364
+ InputProps: {
365
+ style: {
366
+ borderRadius: "8px"
367
+ },
368
+ endAdornment: /*#__PURE__*/_jsxs("div", {
369
+ className: "textFontArrows",
370
+ children: [/*#__PURE__*/_jsx(IconButton, {
371
+ onClick: onIncreaseSize,
372
+ size: "small",
373
+ children: /*#__PURE__*/_jsx(TextPlusIcon, {})
374
+ }), /*#__PURE__*/_jsx(IconButton, {
375
+ onClick: onDecreaseSize,
376
+ size: "small",
377
+ children: /*#__PURE__*/_jsx(TextMinusIcon, {})
378
+ })]
379
+ })
380
+ }
381
+ });
382
+ }
383
+ function ColorPicker(props) {
384
+ const {
385
+ classes,
386
+ pickerStyles,
387
+ onChange,
388
+ color,
389
+ disableEditTheme
390
+ } = props;
391
+ const [anchorEl, setAnchorEl] = useState(null);
392
+ const open = Boolean(anchorEl);
393
+ const handleClose = () => {
394
+ setAnchorEl(null);
395
+ };
396
+ return /*#__PURE__*/_jsxs(_Fragment, {
397
+ children: [/*#__PURE__*/_jsx(Tooltip, {
398
+ title: "",
399
+ arrow: true,
400
+ children: /*#__PURE__*/_jsx(IconButton, {
401
+ sx: pickerStyles.colorPickerIcon,
402
+ onClick: e => {
403
+ setAnchorEl(e.currentTarget);
404
+ },
405
+ children: /*#__PURE__*/_jsx("img", {
406
+ src: colorWheel,
407
+ alt: "color wheel"
408
+ })
409
+ })
410
+ }), /*#__PURE__*/_jsx(ColorButtons, {
411
+ classes: pickerStyles,
412
+ onSelect: onChange,
413
+ activeColor: color,
414
+ disableEditTheme: disableEditTheme
415
+ }), /*#__PURE__*/_jsx(Popover, {
416
+ open: open,
417
+ anchorEl: anchorEl,
418
+ onClose: handleClose,
419
+ anchorOrigin: {
420
+ vertical: "top",
421
+ horizontal: "center"
422
+ },
423
+ transformOrigin: {
424
+ vertical: "bottom",
425
+ horizontal: "top"
426
+ },
427
+ sx: classes.colorPickerPopup,
428
+ children: /*#__PURE__*/_jsx(CustomColorPicker, {
429
+ gradient: true,
430
+ onChange: onChange,
431
+ color: color,
432
+ disableEditTheme: disableEditTheme
433
+ })
434
+ })]
435
+ });
436
+ }
@@ -11,6 +11,9 @@ import useEditorScroll from "../../hooks/useEditorScroll";
11
11
  import { isCarouselSelected } from "../../helper";
12
12
  import { hideSlateSelection } from "../../utils/helper";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const isSlateDOM = event => {
15
+ return event.target.getAttribute("data-slate-string") === "true";
16
+ };
14
17
  const PopupTool = props => {
15
18
  const {
16
19
  theme,
@@ -33,6 +36,7 @@ const PopupTool = props => {
33
36
  const [event] = useDrag(anchorEl);
34
37
  const id = open ? "popup-edit-tool" : "";
35
38
  const [size] = useWindowResize();
39
+ const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
36
40
  const updateAnchorEl = isScroll => {
37
41
  try {
38
42
  const isHavingSelection = selection && !Range.isCollapsed(selection);
@@ -91,9 +95,9 @@ const PopupTool = props => {
91
95
  const isFreeGridEnabled = enable === 1 && isFreeGridElement;
92
96
  if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || isFreeGridEnabled) {
93
97
  setAnchorEl(null);
98
+ hideSlateSelection(); // removes slate selection background, when there is no selection
94
99
  } else {
95
100
  updateAnchorEl();
96
- hideSlateSelection(); // removes slate selection background, when there is no selection
97
101
  }
98
102
  }, [selection, event, selectedElement?.enable]);
99
103
  const handleClose = () => {
@@ -104,8 +108,20 @@ const PopupTool = props => {
104
108
  return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
105
109
  onClickAway: e => {
106
110
  // close the mini toolbar, if user clicks outside the editor (in Flozy app.)
107
- if (e.target !== document.body) {
111
+
112
+ if (isSlateDOM(e)) {
113
+ return;
114
+ }
115
+ const wrapper = document.getElementById("slate-wrapper-scroll-container");
116
+ const isInsideWrapper = wrapper && wrapper.contains(e.target);
117
+ if (isInsideWrapper) {
118
+ return;
119
+ }
120
+ if (e.target === document.body) {
108
121
  // e.target returns body, if the user clicks material ui select popup inside the tool bar, on that time, we don't need to close
122
+ return;
123
+ }
124
+ if (!isMobile) {
109
125
  handleClose();
110
126
  }
111
127
  },
@@ -50,7 +50,8 @@ export const RenderToolbarIcon = props => {
50
50
  case "block":
51
51
  return /*#__PURE__*/_jsx(BlockButton, {
52
52
  ...element,
53
- editor: editor
53
+ editor: editor,
54
+ customProps: customProps
54
55
  }, element.id);
55
56
  case "mark":
56
57
  return /*#__PURE__*/_jsx(MarkButton, {
@@ -105,7 +106,8 @@ export const RenderToolbarIcon = props => {
105
106
  editor: editor,
106
107
  customProps: customProps,
107
108
  icoBtnType: icoBtnType,
108
- lbT: element.lbT
109
+ lbT: element.lbT,
110
+ onClose: () => {}
109
111
  }, element.id);
110
112
  case "color-picker":
111
113
  return /*#__PURE__*/_jsx(ColorPicker, {
@@ -117,12 +119,14 @@ export const RenderToolbarIcon = props => {
117
119
  case "table":
118
120
  return /*#__PURE__*/_jsx(TableSelector, {
119
121
  editor: editor,
120
- icoBtnType: icoBtnType
122
+ icoBtnType: icoBtnType,
123
+ customProps: customProps
121
124
  }, element.id);
122
125
  case "dataView":
123
126
  return /*#__PURE__*/_jsx(DataViewButton, {
124
127
  editor: editor,
125
- icoBtnType: icoBtnType
128
+ icoBtnType: icoBtnType,
129
+ customProps: customProps
126
130
  }, element.id);
127
131
  case "id":
128
132
  return /*#__PURE__*/_jsx(Id, {
@@ -151,21 +155,25 @@ export const RenderToolbarIcon = props => {
151
155
  case "newLine":
152
156
  return /*#__PURE__*/_jsx(NewLineButton, {
153
157
  editor: editor,
154
- icoBtnType: icoBtnType
158
+ icoBtnType: icoBtnType,
159
+ customProps: customProps
155
160
  }, element.id);
156
161
  case "accordion":
157
162
  return /*#__PURE__*/_jsx(AccordionButton, {
158
- editor: editor
163
+ editor: editor,
164
+ customProps: customProps
159
165
  }, element.id);
160
166
  case "signature":
161
167
  return /*#__PURE__*/_jsx(SignatureButton, {
162
168
  editor: editor,
163
- icoBtnType: icoBtnType
169
+ icoBtnType: icoBtnType,
170
+ customProps: customProps
164
171
  }, element.id);
165
172
  case "button":
166
173
  return /*#__PURE__*/_jsx(ButtonToolIcon, {
167
174
  editor: editor,
168
- icoBtnType: icoBtnType
175
+ icoBtnType: icoBtnType,
176
+ customProps: customProps
169
177
  }, element.id);
170
178
  case "page-settings":
171
179
  return /*#__PURE__*/_jsx(PageSettingsButton, {
@@ -176,7 +184,8 @@ export const RenderToolbarIcon = props => {
176
184
  case "carousel":
177
185
  return /*#__PURE__*/_jsx(CarouselButton, {
178
186
  editor: editor,
179
- icoBtnType: icoBtnType
187
+ icoBtnType: icoBtnType,
188
+ customProps: customProps
180
189
  }, element.id);
181
190
  case "chip-text":
182
191
  return /*#__PURE__*/_jsx(ChipTextButton, {
@@ -284,7 +293,8 @@ const Toolbar = props => {
284
293
  })
285
294
  }, index)), /*#__PURE__*/_jsx(HtmlContextMenu, {
286
295
  editor: editor,
287
- handleCodeToText: handleCodeToText
296
+ handleCodeToText: handleCodeToText,
297
+ customProps: customProps
288
298
  })]
289
299
  });
290
300
  };
@@ -28,16 +28,20 @@ export const toolbarGroups = [[{
28
28
  type: "dropdown",
29
29
  options: [{
30
30
  text: "Normal",
31
- value: "normal"
31
+ value: "normal",
32
+ numVal: "400"
32
33
  }, {
33
34
  text: "Bold",
34
- value: "bold"
35
+ value: "bold",
36
+ numVal: "700"
35
37
  }, {
36
38
  text: "Bolder",
37
- value: "bolder"
39
+ value: "bolder",
40
+ numVal: "700"
38
41
  }, {
39
42
  text: "Lighter",
40
- value: "lighter"
43
+ value: "lighter",
44
+ numVal: "100"
41
45
  }],
42
46
  icon: FormatBoldIcon,
43
47
  width: "100px"
@@ -46,7 +50,8 @@ export const toolbarGroups = [[{
46
50
  format: "bold",
47
51
  type: "mark",
48
52
  title: "Bold",
49
- basic: true
53
+ basic: true,
54
+ themeEnabled: true
50
55
  }, {
51
56
  id: 5,
52
57
  format: "underline",
@@ -57,7 +62,8 @@ export const toolbarGroups = [[{
57
62
  format: "italic",
58
63
  type: "mark",
59
64
  title: "Italic",
60
- basic: true
65
+ basic: true,
66
+ themeEnabled: true
61
67
  }, {
62
68
  id: 6,
63
69
  format: "strikethrough",
@@ -101,6 +107,42 @@ export const toolbarGroups = [[{
101
107
  type: "block",
102
108
  title: "H3",
103
109
  group: "typography"
110
+ }, {
111
+ id: 39,
112
+ format: "headingFour",
113
+ type: "block",
114
+ title: "H4",
115
+ group: "typography"
116
+ }, {
117
+ id: 40,
118
+ format: "headingFive",
119
+ type: "block",
120
+ title: "H5",
121
+ group: "typography"
122
+ }, {
123
+ id: 41,
124
+ format: "headingSix",
125
+ type: "block",
126
+ title: "H6",
127
+ group: "typography"
128
+ }, {
129
+ id: 42,
130
+ format: "paragraphOne",
131
+ type: "block",
132
+ title: "Paragraph 1",
133
+ group: "typography"
134
+ }, {
135
+ id: 43,
136
+ format: "paragraphTwo",
137
+ type: "block",
138
+ title: "Paragraph 2",
139
+ group: "typography"
140
+ }, {
141
+ id: 44,
142
+ format: "paragraphThree",
143
+ type: "block",
144
+ title: "Paragraph 3",
145
+ group: "typography"
104
146
  }, {
105
147
  id: 14,
106
148
  format: "doublequote",
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsxs as _jsxs } from "react/jsx-runtime";
3
+ const ClearAllIcon = () => /*#__PURE__*/_jsxs("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "20",
6
+ height: "20",
7
+ viewBox: "0 0 20 20",
8
+ children: [/*#__PURE__*/_jsx("rect", {
9
+ x: "4",
10
+ y: "5",
11
+ width: "12",
12
+ height: "2",
13
+ rx: "1",
14
+ fill: "currentColor"
15
+ }), /*#__PURE__*/_jsx("rect", {
16
+ x: "4",
17
+ y: "9",
18
+ width: "10",
19
+ height: "2",
20
+ rx: "1",
21
+ fill: "currentColor"
22
+ }), /*#__PURE__*/_jsx("rect", {
23
+ x: "4",
24
+ y: "13",
25
+ width: "12",
26
+ height: "2",
27
+ rx: "1",
28
+ fill: "currentColor"
29
+ })]
30
+ });
31
+ export default ClearAllIcon;