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