@flozy/editor 9.8.1 → 9.8.3

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 (255) hide show
  1. package/dist/Editor/ChatEditor.js +19 -26
  2. package/dist/Editor/CommonEditor.js +25 -139
  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 +5 -15
  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 +30 -43
  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 +13 -15
  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 -4
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +6 -21
  34. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +12 -13
  35. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +4 -7
  36. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +5 -7
  37. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +7 -9
  38. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +3 -8
  39. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +3 -5
  40. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +5 -6
  41. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +3 -5
  42. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -9
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +12 -15
  44. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +2 -3
  45. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +2 -3
  46. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +6 -23
  47. package/dist/Editor/Elements/DataView/Layouts/TableView.js +4 -6
  48. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +4 -8
  49. package/dist/Editor/Elements/DataView/Layouts/index.js +1 -3
  50. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +2 -5
  51. package/dist/Editor/Elements/Divider/Divider.js +3 -5
  52. package/dist/Editor/Elements/Divider/DividerButton.js +2 -6
  53. package/dist/Editor/Elements/Divider/DividerPopup.js +2 -3
  54. package/dist/Editor/Elements/Embed/Embed.js +1 -4
  55. package/dist/Editor/Elements/Embed/EmbedPopup.js +1 -4
  56. package/dist/Editor/Elements/Embed/Image.js +11 -16
  57. package/dist/Editor/Elements/Embed/Video.js +6 -9
  58. package/dist/Editor/Elements/EmbedScript/Code.js +4 -7
  59. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +2 -6
  60. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +5 -8
  61. package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -6
  62. package/dist/Editor/Elements/Form/FieldPopup.js +1 -4
  63. package/dist/Editor/Elements/Form/Form.js +9 -12
  64. package/dist/Editor/Elements/Form/FormButton.js +2 -6
  65. package/dist/Editor/Elements/Form/FormPopup.js +2 -3
  66. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -18
  67. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +8 -13
  68. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +2 -3
  69. package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
  70. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -4
  71. package/dist/Editor/Elements/Form/Workflow/index.js +9 -15
  72. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +23 -67
  73. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -31
  74. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
  75. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +6 -54
  76. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +2 -3
  77. package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -10
  78. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  79. package/dist/Editor/Elements/Grid/Grid.js +10 -13
  80. package/dist/Editor/Elements/Grid/GridButton.js +5 -9
  81. package/dist/Editor/Elements/Grid/GridItem.js +8 -14
  82. package/dist/Editor/Elements/Grid/GridItemPopup.js +1 -4
  83. package/dist/Editor/Elements/Grid/GridPopup.js +1 -4
  84. package/dist/Editor/Elements/Grid/SectionPopup.js +1 -4
  85. package/dist/Editor/Elements/Link/Link.js +5 -8
  86. package/dist/Editor/Elements/Link/LinkButton.js +1 -4
  87. package/dist/Editor/Elements/List/CheckList.js +9 -14
  88. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -6
  89. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -4
  90. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +1 -4
  91. package/dist/Editor/Elements/Search/SearchButton.js +4 -7
  92. package/dist/Editor/Elements/Search/SearchList.js +5 -10
  93. package/dist/Editor/Elements/Signature/SignatureButton.js +2 -6
  94. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +8 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -6
  96. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -4
  97. package/dist/Editor/Elements/Signature/SignaturePopup.js +16 -17
  98. package/dist/Editor/Elements/SimpleText/index.js +4 -5
  99. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  100. package/dist/Editor/Elements/Table/DragButton.js +2 -4
  101. package/dist/Editor/Elements/Table/Table.js +12 -24
  102. package/dist/Editor/Elements/Table/TablePopup.js +1 -4
  103. package/dist/Editor/Elements/Table/TableSelector.js +6 -10
  104. package/dist/Editor/Elements/Table/TableTool.js +4 -8
  105. package/dist/Editor/Elements/Title/title.js +8 -9
  106. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +1 -4
  107. package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
  108. package/dist/Editor/MiniEditor.js +3 -10
  109. package/dist/Editor/Styles/EditorStyles.js +5 -5
  110. package/dist/Editor/Toolbar/Basic/index.js +1 -2
  111. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +2 -6
  112. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  113. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  114. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +4 -8
  115. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
  116. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -17
  117. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +5 -10
  118. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +4 -10
  119. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +4 -10
  120. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +3 -9
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +35 -42
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +51 -58
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +22 -29
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -226
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +10 -20
  127. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +5 -10
  128. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +11 -71
  129. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +5 -11
  130. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +42 -122
  131. package/dist/Editor/Toolbar/PopupTool/index.js +2 -18
  132. package/dist/Editor/Toolbar/Toolbar.js +10 -20
  133. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  134. package/dist/Editor/common/ColorPickerButton.js +14 -39
  135. package/dist/Editor/common/CustomDialog/index.js +10 -8
  136. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  137. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  138. package/dist/Editor/common/Icon.js +1 -31
  139. package/dist/Editor/common/ImageSelector/ImageSelector.js +8 -10
  140. package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -6
  141. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  142. package/dist/Editor/common/LinkSettings/NavComponents.js +10 -14
  143. package/dist/Editor/common/LinkSettings/index.js +14 -20
  144. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  145. package/dist/Editor/common/MUIIcon/index.js +3 -0
  146. package/dist/Editor/common/MentionsPopup/index.js +2 -6
  147. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -46
  148. package/dist/Editor/common/RnD/ContextMenu/index.js +2 -3
  149. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -7
  150. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +3 -8
  151. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +3 -7
  152. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  153. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  154. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  155. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  156. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -7
  157. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  158. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  159. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +2 -6
  160. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  161. package/dist/Editor/common/RnD/OptionsPopup/index.js +3 -4
  162. package/dist/Editor/common/RnD/ShadowElement.js +1 -2
  163. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
  164. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  165. package/dist/Editor/common/RnD/Utils/gridDropItem.js +8 -55
  166. package/dist/Editor/common/RnD/Utils/index.js +0 -3
  167. package/dist/Editor/common/RnD/VirtualElement/index.js +103 -187
  168. package/dist/Editor/common/RnD/VirtualElement/styles.js +7 -155
  169. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +3 -5
  170. package/dist/Editor/common/RnD/index.js +13 -69
  171. package/dist/Editor/common/Section/index.js +4 -7
  172. package/dist/Editor/common/Shorthands/elements.js +3 -74
  173. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  174. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  175. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -6
  176. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  177. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  178. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  179. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +9 -13
  180. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -11
  181. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +5 -19
  182. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +10 -22
  183. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -6
  184. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +13 -27
  185. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +14 -43
  186. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +6 -10
  187. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -19
  188. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +2 -6
  189. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -5
  190. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -9
  191. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +2 -8
  192. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +11 -12
  193. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -6
  194. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -8
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +2 -6
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -21
  197. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  198. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  199. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  200. package/dist/Editor/common/StyleBuilder/index.js +5 -8
  201. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
  202. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  203. package/dist/Editor/common/Uploader.js +5 -16
  204. package/dist/Editor/commonStyle.js +57 -68
  205. package/dist/Editor/helper/index.js +3 -27
  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 +9 -11
  210. package/dist/Editor/plugins/withLayout.js +2 -3
  211. package/dist/Editor/plugins/withLinks.js +0 -10
  212. package/dist/Editor/plugins/withTable.js +1 -1
  213. package/dist/Editor/theme/ThemeList.js +173 -50
  214. package/dist/Editor/utils/SlateUtilityFunctions.js +50 -178
  215. package/dist/Editor/utils/draftToSlate.js +2 -3
  216. package/dist/Editor/utils/font.js +37 -40
  217. package/dist/Editor/utils/freegrid.js +3 -3
  218. package/dist/Editor/utils/helper.js +21 -92
  219. package/package.json +4 -4
  220. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -444
  221. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -436
  222. package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
  223. package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
  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 -43
  230. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  231. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +0 -43
  232. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +0 -44
  233. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +0 -134
  234. package/dist/Editor/common/RnD/VirtualElement/helper.js +0 -381
  235. package/dist/Editor/common/SnackBar/index.js +0 -43
  236. package/dist/Editor/helper/textIndeces.js +0 -58
  237. package/dist/Editor/hooks/useAutoScroll.js +0 -38
  238. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  239. package/dist/Editor/hooks/useThemeValues.js +0 -63
  240. package/dist/Editor/theme/index.js +0 -149
  241. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  242. package/dist/Editor/themeSettings/buttons/index.js +0 -290
  243. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  244. package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
  245. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  246. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  247. package/dist/Editor/themeSettings/fonts/index.js +0 -240
  248. package/dist/Editor/themeSettings/fonts/style.js +0 -61
  249. package/dist/Editor/themeSettings/icons.js +0 -60
  250. package/dist/Editor/themeSettings/index.js +0 -351
  251. package/dist/Editor/themeSettings/style.js +0 -220
  252. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  253. package/dist/Editor/themeSettingsAI/index.js +0 -355
  254. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -205
  255. package/dist/Editor/themeSettingsAI/style.js +0 -259
@@ -1,121 +0,0 @@
1
- import { Grid, IconButton, Typography } from "@mui/material";
2
- import { useEditorTheme } from "../../hooks/useEditorTheme";
3
- import { PenIcon } from "../icons";
4
- import useWindowResize from "../../hooks/useWindowResize";
5
- import { getElementProperty } from "../../helper/theme";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const MAP_TEXT_PLACEHOLDER = {
9
- h1: "Heading 1",
10
- h2: "Heading 2",
11
- h3: "Heading 3",
12
- h4: "Heading 4",
13
- h5: "Heading 5",
14
- h6: "Heading 6",
15
- para1: "Paragraph 1",
16
- para2: "Paragraph 2",
17
- para3: "Paragraph 3"
18
- };
19
- const MAP_COMP = {
20
- para1: "p",
21
- para2: "p",
22
- para3: "p"
23
- };
24
- function getPreviewElementStyle(styleProperty, elementId) {
25
- const element = document.getElementById(elementId);
26
- return getElementProperty(element, styleProperty);
27
- }
28
- function getTextSettings(elementId, otherStyles = {}) {
29
- return {
30
- fontFamily: getPreviewElementStyle("font-family", elementId),
31
- fontSize: getPreviewElementStyle("font-size", elementId),
32
- fontWeight: getPreviewElementStyle("font-weight", elementId),
33
- fontStyle: getPreviewElementStyle("font-style", elementId),
34
- textDecoration: getPreviewElementStyle("text-decoration", elementId),
35
- ...otherStyles
36
- };
37
- }
38
- function getFontSize(fontSize = "", windowSize) {
39
- let size = "";
40
- if (typeof fontSize === "string") {
41
- size = fontSize;
42
- } else if (typeof fontSize === "object") {
43
- size = fontSize[windowSize?.device];
44
- }
45
- return size?.includes("px") ? size : size + "px";
46
- }
47
- function PreviewElement(props) {
48
- const {
49
- field,
50
- selectedField,
51
- setSelectedField,
52
- settings,
53
- setSettings,
54
- setAnchorEl
55
- } = props;
56
- const {
57
- selectedTheme
58
- } = useEditorTheme();
59
- const {
60
- elementProps = {}
61
- } = selectedTheme || {};
62
- const previewElementId = `theme-heading-element-preview-${field}`;
63
- const Comp = MAP_COMP[field] || field;
64
- const selectedSettings = selectedField === field ? settings : {};
65
- const themeStyles = elementProps[field] || {};
66
- const placeholder = MAP_TEXT_PLACEHOLDER[field];
67
- const [windowSize] = useWindowResize();
68
- const fontFamily = getPreviewElementStyle("font-family", previewElementId);
69
- const {
70
- fontSize = "",
71
- color
72
- } = themeStyles;
73
- const size = getFontSize(fontSize, windowSize);
74
- return /*#__PURE__*/_jsxs(Grid, {
75
- container: true,
76
- className: "fontTypeItem",
77
- justifyContent: "space-between",
78
- alignItems: "center",
79
- wrap: "nowrap",
80
- children: [/*#__PURE__*/_jsxs(Grid, {
81
- item: true,
82
- children: [/*#__PURE__*/_jsx(Typography, {
83
- variant: "body1",
84
- children: /*#__PURE__*/_jsx(Comp, {
85
- id: previewElementId,
86
- style: {
87
- ...themeStyles,
88
- ...selectedSettings,
89
- fontSize: size
90
- },
91
- className: "preview-theme-text",
92
- children: placeholder
93
- })
94
- }), /*#__PURE__*/_jsxs(Typography, {
95
- variant: "body2",
96
- className: "flexAlign typeValue",
97
- children: [/*#__PURE__*/_jsx(Grid, {
98
- component: "span",
99
- className: "dotColor",
100
- style: {
101
- background: selectedSettings?.color || color
102
- }
103
- }), /*#__PURE__*/_jsxs(Grid, {
104
- component: "span",
105
- children: [fontFamily, ", ", size]
106
- })]
107
- })]
108
- }), /*#__PURE__*/_jsx(IconButton, {
109
- className: "editIcon",
110
- onClick: e => {
111
- setSettings(getTextSettings(previewElementId, {
112
- color
113
- }));
114
- setSelectedField(field);
115
- setAnchorEl(e.currentTarget);
116
- },
117
- children: /*#__PURE__*/_jsx(PenIcon, {})
118
- })]
119
- });
120
- }
121
- export default PreviewElement;
@@ -1,240 +0,0 @@
1
- import React from "react";
2
- import { Accordion, AccordionDetails, AccordionSummary, Checkbox, Divider, Fade, FormControlLabel, Grid, IconButton, Paper, Popper, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
-
5
- // Style
6
- import Style from "./style";
7
- import ThemeTextFormat from "../../Toolbar/PopupTool/ThemeTextFormat";
8
- import { useEditorContext } from "../../hooks/useMouseMove";
9
- import usePopupStyle from "../../Toolbar/PopupTool/PopupToolStyle";
10
- import useWindowResize from "../../hooks/useWindowResize";
11
- import PopperHeader from "../../Toolbar/PopupTool/PopperHeader";
12
- import { useEditorTheme } from "../../hooks/useEditorTheme";
13
- import { HEADING_THEME_FIELDS, PARAGRAPH_THEME_FIELDS } from "../../helper/theme";
14
- import PreviewElement from "./PreviewElement";
15
- import FontFamilyAutocomplete from "../../Toolbar/FormatTools/FontFamilyAutocomplete";
16
- import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList";
17
- import { CheckedBoxCheckIcon } from "../../common/iconListV2";
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- import { jsxs as _jsxs } from "react/jsx-runtime";
20
- const Fonts = props => {
21
- const {
22
- className,
23
- customProps,
24
- openSettings,
25
- onSettingsChange,
26
- type
27
- } = props;
28
- const [anchorEl, setAnchorEl] = React.useState();
29
- const [selectedField, setSelectedField] = React.useState("");
30
- const [settings, setSettings] = React.useState({});
31
- const updateSettings = update => {
32
- setSettings(prev => {
33
- return {
34
- ...prev,
35
- ...update
36
- };
37
- });
38
- };
39
- const onClose = () => {
40
- setAnchorEl(null);
41
- setSelectedField("");
42
- setSettings({});
43
- };
44
- const {
45
- theme,
46
- fontFamilies
47
- } = useEditorContext();
48
- const classes = usePopupStyle(theme);
49
- const [size] = useWindowResize();
50
- const {
51
- selectedTheme,
52
- updateTheme
53
- } = useEditorTheme();
54
- const {
55
- otherProps = {}
56
- } = selectedTheme || {};
57
- const {
58
- isHeadingCustomized,
59
- headingFontFamily,
60
- isParagraphCustomized,
61
- paragraphFontFamily
62
- } = otherProps;
63
- const onSaveTextSettings = () => {
64
- updateTheme(settings, {
65
- action: "ELEMENT_PROPS_CHANGE",
66
- fieldName: selectedField
67
- });
68
- onClose();
69
- };
70
- const updateOtherThemeProps = update => {
71
- updateTheme(update, {
72
- action: "OTHER_PROPS_CHANGE"
73
- });
74
- };
75
- const updateFont = (update, fieldType) => {
76
- updateTheme(update, {
77
- action: "FONT_CHANGE",
78
- fieldType
79
- });
80
- };
81
- const tabs = [{
82
- title: "Heading Font family",
83
- onFontFamilyChange: ({
84
- fontFamily
85
- }) => {
86
- updateFont({
87
- fontFamily
88
- }, "HEADING");
89
- updateSettings({
90
- fontFamily
91
- });
92
- },
93
- fontFamily: headingFontFamily || defaultFonts[0],
94
- isCustomized: isHeadingCustomized,
95
- onCustomizeClick: event => {
96
- updateOtherThemeProps({
97
- isHeadingCustomized: event.target.checked
98
- });
99
- },
100
- fields: HEADING_THEME_FIELDS
101
- }, {
102
- title: "Paragraph Font family",
103
- onFontFamilyChange: ({
104
- fontFamily
105
- }) => {
106
- updateFont({
107
- fontFamily
108
- }, "PARAGRAPH");
109
- updateSettings({
110
- fontFamily
111
- });
112
- },
113
- fontFamily: paragraphFontFamily || defaultFonts[0],
114
- isCustomized: isParagraphCustomized,
115
- onCustomizeClick: event => {
116
- updateOtherThemeProps({
117
- isParagraphCustomized: event.target.checked
118
- });
119
- },
120
- fields: PARAGRAPH_THEME_FIELDS
121
- }];
122
- return /*#__PURE__*/_jsxs(Grid, {
123
- className: className,
124
- children: [/*#__PURE__*/_jsxs(Accordion, {
125
- className: "settingAccordion",
126
- onChange: () => onSettingsChange(type),
127
- expanded: openSettings === type,
128
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
129
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
130
- "aria-controls": "panel1-content",
131
- id: "panel1-header",
132
- children: "Fonts"
133
- }), /*#__PURE__*/_jsx(AccordionDetails, {
134
- children: tabs?.map((tab, i) => {
135
- const {
136
- title,
137
- onFontFamilyChange,
138
- fontFamily,
139
- isCustomized = "",
140
- onCustomizeClick,
141
- fields
142
- } = tab;
143
- return /*#__PURE__*/_jsxs(React.Fragment, {
144
- children: [/*#__PURE__*/_jsxs(Grid, {
145
- sx: {
146
- pt: 1
147
- },
148
- children: [/*#__PURE__*/_jsx(Typography, {
149
- variant: "body2",
150
- sx: {
151
- pb: 1
152
- },
153
- className: "fs-14 fw-500",
154
- children: title
155
- }), /*#__PURE__*/_jsx(FontFamilyAutocomplete, {
156
- editor: {},
157
- format: "fontFamily",
158
- options: fontFamilies.options,
159
- width: "100%",
160
- onChange: onFontFamilyChange,
161
- val: fontFamily,
162
- webFont: true
163
- }), /*#__PURE__*/_jsx(FormControlLabel, {
164
- className: "ccheckbox-primary",
165
- sx: {
166
- ...classes.customCheckBox
167
- },
168
- control: /*#__PURE__*/_jsx(Checkbox, {
169
- value: isCustomized,
170
- checked: isCustomized,
171
- onChange: onCustomizeClick,
172
- variant: "outlined",
173
- className: "checkBox",
174
- checkedIcon: /*#__PURE__*/_jsx(IconButton, {
175
- className: "checkedIcon",
176
- children: /*#__PURE__*/_jsx(CheckedBoxCheckIcon, {})
177
- }),
178
- icon: /*#__PURE__*/_jsx(IconButton, {
179
- className: "unCheckedIcon"
180
- })
181
- }),
182
- label: /*#__PURE__*/_jsx(Typography, {
183
- variant: "body1",
184
- children: "Customize Font style"
185
- })
186
- }), isCustomized && /*#__PURE__*/_jsx(Grid, {
187
- ref: anchorEl,
188
- children: fields.map((field, index) => {
189
- return /*#__PURE__*/_jsx(PreviewElement, {
190
- field: field,
191
- settings: settings,
192
- setSettings: setSettings,
193
- setAnchorEl: setAnchorEl,
194
- selectedField: selectedField,
195
- setSelectedField: setSelectedField
196
- }, index);
197
- })
198
- })]
199
- }), i === 0 && /*#__PURE__*/_jsx(Divider, {
200
- sx: {
201
- mt: 1,
202
- mb: 1
203
- }
204
- })]
205
- }, i);
206
- })
207
- })]
208
- }), /*#__PURE__*/_jsx(Popper, {
209
- open: Boolean(anchorEl),
210
- anchorEl: anchorEl,
211
- transition: true,
212
- placement: "left-start",
213
- sx: classes.popupWrapper,
214
- className: `tools-drawer ${size?.device} textSettings`,
215
- children: ({
216
- TransitionProps
217
- }) => /*#__PURE__*/_jsx(Fade, {
218
- ...TransitionProps,
219
- children: /*#__PURE__*/_jsxs(Paper, {
220
- style: {
221
- borderRadius: "10px",
222
- position: "relative"
223
- },
224
- children: [/*#__PURE__*/_jsx(PopperHeader, {
225
- title: "Text Settings",
226
- classes: classes,
227
- onClose: onClose,
228
- customProps: customProps
229
- }), /*#__PURE__*/_jsx(ThemeTextFormat, {
230
- settings: settings,
231
- updateSettings: updateSettings,
232
- onSaveTextSettings: onSaveTextSettings,
233
- onClose: onClose
234
- })]
235
- })
236
- })
237
- })]
238
- });
239
- };
240
- export default styled(Fonts)(Style);
@@ -1,61 +0,0 @@
1
- const Style = ({
2
- appTheme
3
- }) => ({
4
- ".settingAccordion": {
5
- ".MuiOutlinedInput-root": {
6
- borderRadius: "8px",
7
- boxShadow: "0px 4px 16px 0px #0000000D"
8
- }
9
- },
10
- ".fontTypeItem": {
11
- padding: "6px 10px",
12
- width: "calc(100% + 20px)",
13
- margin: "0 -10px",
14
- "&:hover": {
15
- background: appTheme?.palette?.editor?.tv_hover_bg,
16
- ".editIcon": {
17
- opacity: "1",
18
- visibility: "visible"
19
- }
20
- },
21
- ".editIcon": {
22
- opacity: "0",
23
- visibility: "hidden",
24
- width: "30px",
25
- height: "30px"
26
- }
27
- },
28
- ".typeValue": {
29
- fontSize: "12px",
30
- color: "#64748B",
31
- ".dotColor": {
32
- width: "16px",
33
- height: "16px",
34
- borderRadius: "12px",
35
- background: "#0F172A",
36
- marginRight: "4px",
37
- border: "1.5px solid #DCE4EC"
38
- }
39
- },
40
- ".preview-theme-text": {
41
- width: "200px",
42
- whiteSpace: "nowrap",
43
- overflow: "hidden",
44
- textOverflow: "ellipsis",
45
- color: `${appTheme?.palette?.editor?.textColor} !important`
46
- },
47
- ".MuiAutocomplete-input": {
48
- color: appTheme?.palette?.editor?.textColor
49
- },
50
- ".MuiCheckbox-root": {
51
- "& svg": {
52
- fill: appTheme?.palette?.editor?.textColor
53
- }
54
- },
55
- ".MuiCheckbox-root.Mui-checked": {
56
- "& svg": {
57
- fill: "#1976d2"
58
- }
59
- }
60
- });
61
- export default Style;
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { jsxs as _jsxs } from "react/jsx-runtime";
3
- export const TickIcon = () => /*#__PURE__*/_jsxs("svg", {
4
- className: "tickIcon",
5
- xmlns: "http://www.w3.org/2000/svg",
6
- width: "26",
7
- height: "26",
8
- viewBox: "0 0 26 26",
9
- fill: "none",
10
- children: [/*#__PURE__*/_jsx("rect", {
11
- x: "0.5",
12
- y: "0.5",
13
- width: "25",
14
- height: "25",
15
- rx: "12.5",
16
- fill: "#2563EB",
17
- stroke: "white"
18
- }), /*#__PURE__*/_jsx("path", {
19
- d: "M7 13.105L11.0011 17.21L19 9",
20
- stroke: "white",
21
- strokeWidth: "1.5",
22
- strokeLinecap: "round",
23
- strokeLinejoin: "round"
24
- })]
25
- });
26
- export const EditIcon = () => /*#__PURE__*/_jsxs("svg", {
27
- className: "editIcon",
28
- xmlns: "http://www.w3.org/2000/svg",
29
- width: "16",
30
- height: "16",
31
- viewBox: "0 0 16 16",
32
- fill: "none",
33
- children: [/*#__PURE__*/_jsx("circle", {
34
- cx: "8",
35
- cy: "8",
36
- r: "8",
37
- fill: "#2563EB",
38
- fillOpacity: "0.14"
39
- }), /*#__PURE__*/_jsx("path", {
40
- d: "M11.3066 4.69573C10.3941 3.77831 9.50211 3.75792 8.5642 4.69573L7.98821 5.26658C7.93723 5.31754 7.92194 5.3889 7.94233 5.45516C8.29914 6.70387 9.29822 7.70284 10.5471 8.05962C10.5623 8.06472 10.5878 8.06472 10.6031 8.06472C10.6541 8.06472 10.7051 8.04433 10.7408 8.00865L11.3066 7.43781C11.7704 6.974 11.9998 6.53058 11.9998 6.07697C11.9998 5.61825 11.7704 5.16464 11.3066 4.69573Z",
41
- fill: "#2563EB"
42
- }), /*#__PURE__*/_jsx("path", {
43
- d: "M9.69545 8.48831C9.55783 8.42206 9.4253 8.3558 9.30296 8.27935C9.20102 8.21819 9.09907 8.15193 9.00223 8.08058C8.92067 8.02961 8.82892 7.95316 8.73717 7.87671C8.72697 7.87161 8.69639 7.84613 8.65561 7.80535C8.4976 7.67793 8.32939 7.50464 8.17137 7.31606C8.16118 7.30587 8.1306 7.27529 8.10511 7.22942C8.05414 7.17336 7.97768 7.07652 7.91141 6.96949C7.85534 6.89813 7.78908 6.7962 7.72791 6.68916C7.65145 6.56175 7.58519 6.43433 7.52402 6.30181C7.45776 6.1591 7.40679 6.02659 7.36091 5.89917L4.61859 8.64122C4.44019 8.8196 4.26688 9.15599 4.2312 9.40573L4.01202 10.9246C3.96614 11.2457 4.0528 11.5464 4.25159 11.7451C4.4198 11.9133 4.64917 12 4.90404 12C4.96011 12 5.01618 11.9949 5.07225 11.9898L6.58613 11.7757C6.83589 11.74 7.17231 11.5718 7.35072 11.3884L10.093 8.64631C9.96561 8.60554 9.83818 8.54948 9.69545 8.48831Z",
44
- fill: "#2563EB"
45
- })]
46
- });
47
- export const PenIcon = () => /*#__PURE__*/_jsxs("svg", {
48
- xmlns: "http://www.w3.org/2000/svg",
49
- width: "14",
50
- height: "14",
51
- viewBox: "0 0 14 14",
52
- fill: "none",
53
- children: [/*#__PURE__*/_jsx("path", {
54
- d: "M12.7874 1.21754C11.1907 -0.387958 9.62966 -0.423636 7.98833 1.21754L6.98034 2.21652C6.89114 2.30571 6.86438 2.43058 6.90006 2.54653C7.52448 4.7318 9.27285 6.48 11.4583 7.10436C11.4851 7.11328 11.5297 7.11328 11.5564 7.11328C11.6456 7.11328 11.7349 7.07761 11.7973 7.01517L12.7874 6.01619C13.5992 5.20452 14.0006 4.42853 14.0006 3.63471C14.0006 2.83196 13.5992 2.03813 12.7874 1.21754Z",
55
- fill: "#2563EB"
56
- }), /*#__PURE__*/_jsx("path", {
57
- d: "M9.96704 7.85451C9.7262 7.73856 9.49427 7.62261 9.28019 7.48882C9.10178 7.38178 8.92338 7.26583 8.75389 7.14096C8.61117 7.05177 8.45061 6.91798 8.29004 6.78419C8.2722 6.77527 8.21868 6.73067 8.14732 6.65932C7.8708 6.43633 7.57643 6.13308 7.2999 5.80306C7.28206 5.78522 7.22854 5.73171 7.18394 5.65143C7.09474 5.55332 6.96094 5.38385 6.84497 5.19655C6.74685 5.07168 6.63089 4.89329 6.52385 4.70598C6.39005 4.483 6.27408 4.26002 6.16704 4.02811C6.05108 3.77837 5.96188 3.54647 5.88159 3.32349L1.08253 8.12209C0.770327 8.43427 0.46704 9.02294 0.404599 9.45999L0.0210312 12.118C-0.0592505 12.6799 0.0923925 13.2061 0.44028 13.554C0.734646 13.8483 1.13605 13.9999 1.58206 13.9999C1.68019 13.9999 1.77831 13.991 1.87643 13.9821L4.52573 13.6075C4.96282 13.545 5.55155 13.2507 5.86375 12.9296L10.6628 8.13101C10.4398 8.05965 10.2168 7.96154 9.96704 7.85451Z",
58
- fill: "#2563EB"
59
- })]
60
- });