@flozy/editor 9.3.0 → 9.3.2

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 (243) hide show
  1. package/dist/Editor/ChatEditor.js +10 -45
  2. package/dist/Editor/CommonEditor.js +20 -126
  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 +12 -57
  26. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  27. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -5
  28. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  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/FilterSort/SortOptions/ChooseSort.js +12 -13
  33. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +4 -7
  34. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +5 -7
  35. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +7 -9
  36. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +2 -3
  37. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +3 -5
  38. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +5 -6
  39. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +3 -5
  40. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +6 -7
  41. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +12 -15
  42. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +2 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +2 -3
  44. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +6 -12
  45. package/dist/Editor/Elements/DataView/Layouts/TableView.js +4 -6
  46. package/dist/Editor/Elements/DataView/Layouts/index.js +1 -3
  47. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +2 -5
  48. package/dist/Editor/Elements/Divider/Divider.js +3 -5
  49. package/dist/Editor/Elements/Divider/DividerButton.js +2 -6
  50. package/dist/Editor/Elements/Divider/DividerPopup.js +2 -3
  51. package/dist/Editor/Elements/Embed/Embed.js +1 -4
  52. package/dist/Editor/Elements/Embed/EmbedPopup.js +1 -4
  53. package/dist/Editor/Elements/Embed/Image.js +11 -16
  54. package/dist/Editor/Elements/Embed/Video.js +7 -10
  55. package/dist/Editor/Elements/EmbedScript/Code.js +4 -7
  56. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +2 -6
  57. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +5 -8
  58. package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -6
  59. package/dist/Editor/Elements/Form/FieldPopup.js +1 -4
  60. package/dist/Editor/Elements/Form/Form.js +9 -12
  61. package/dist/Editor/Elements/Form/FormButton.js +2 -6
  62. package/dist/Editor/Elements/Form/FormPopup.js +2 -3
  63. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -18
  64. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +8 -13
  65. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +2 -3
  66. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -4
  67. package/dist/Editor/Elements/Form/Workflow/index.js +9 -15
  68. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +18 -21
  69. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -6
  70. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
  71. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -8
  72. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +2 -3
  73. package/dist/Editor/Elements/FreeGrid/Options/More.js +3 -4
  74. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  75. package/dist/Editor/Elements/Grid/Grid.js +10 -13
  76. package/dist/Editor/Elements/Grid/GridButton.js +5 -9
  77. package/dist/Editor/Elements/Grid/GridItem.js +8 -14
  78. package/dist/Editor/Elements/Grid/GridItemPopup.js +1 -4
  79. package/dist/Editor/Elements/Grid/GridPopup.js +1 -4
  80. package/dist/Editor/Elements/Grid/SectionPopup.js +1 -4
  81. package/dist/Editor/Elements/Link/Link.js +7 -14
  82. package/dist/Editor/Elements/Link/LinkButton.js +1 -4
  83. package/dist/Editor/Elements/List/CheckList.js +9 -14
  84. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -6
  85. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +5 -16
  86. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +1 -4
  87. package/dist/Editor/Elements/Search/SearchButton.js +3 -6
  88. package/dist/Editor/Elements/Search/SearchList.js +3 -7
  89. package/dist/Editor/Elements/Signature/SignatureButton.js +2 -6
  90. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -6
  91. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -4
  92. package/dist/Editor/Elements/Signature/SignaturePopup.js +16 -17
  93. package/dist/Editor/Elements/SimpleText/index.js +4 -5
  94. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  95. package/dist/Editor/Elements/Table/DragButton.js +2 -4
  96. package/dist/Editor/Elements/Table/Table.js +25 -48
  97. package/dist/Editor/Elements/Table/TableCell.js +27 -6
  98. package/dist/Editor/Elements/Table/TablePopup.js +1 -4
  99. package/dist/Editor/Elements/Table/TableSelector.js +6 -10
  100. package/dist/Editor/Elements/Table/TableTool.js +4 -8
  101. package/dist/Editor/Elements/Title/title.js +0 -10
  102. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +1 -4
  103. package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
  104. package/dist/Editor/MiniEditor.js +3 -9
  105. package/dist/Editor/Styles/EditorStyles.js +5 -5
  106. package/dist/Editor/Toolbar/Basic/index.js +1 -2
  107. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +2 -6
  108. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  109. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  110. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +4 -8
  111. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -7
  112. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +15 -20
  113. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +5 -10
  114. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +4 -10
  115. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +4 -10
  116. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -6
  117. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +35 -42
  118. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  119. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +51 -58
  120. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +22 -29
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -226
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -15
  123. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +4 -8
  124. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +9 -16
  125. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +5 -11
  126. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +41 -120
  127. package/dist/Editor/Toolbar/PopupTool/index.js +8 -3
  128. package/dist/Editor/Toolbar/Toolbar.js +10 -20
  129. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  130. package/dist/Editor/assets/svg/CalenderIconTick.js +0 -1
  131. package/dist/Editor/common/ColorPickerButton.js +9 -35
  132. package/dist/Editor/common/CustomDialog/index.js +10 -8
  133. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  134. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  135. package/dist/Editor/common/Icon.js +0 -28
  136. package/dist/Editor/common/ImageSelector/ImageSelector.js +8 -10
  137. package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -6
  138. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  139. package/dist/Editor/common/LinkSettings/NavComponents.js +10 -14
  140. package/dist/Editor/common/LinkSettings/index.js +14 -20
  141. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  142. package/dist/Editor/common/MentionsPopup/Styles.js +68 -106
  143. package/dist/Editor/common/MentionsPopup/index.js +4 -8
  144. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  145. package/dist/Editor/common/RnD/ContextMenu/index.js +2 -3
  146. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -7
  147. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +3 -8
  148. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +3 -7
  149. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  150. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  151. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  152. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  153. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -7
  154. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  155. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  156. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +2 -4
  157. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  158. package/dist/Editor/common/RnD/OptionsPopup/index.js +3 -4
  159. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
  160. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +8 -20
  161. package/dist/Editor/common/RnD/Utils/index.js +0 -45
  162. package/dist/Editor/common/RnD/VirtualElement/index.js +2 -1
  163. package/dist/Editor/common/RnD/index.js +7 -34
  164. package/dist/Editor/common/Section/index.js +4 -7
  165. package/dist/Editor/common/Shorthands/elements.js +10 -93
  166. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  167. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  168. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -6
  169. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  170. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  171. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  172. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +9 -13
  173. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -11
  174. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +5 -19
  175. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +10 -22
  176. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -6
  177. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +13 -27
  178. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +14 -41
  179. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +6 -10
  180. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -19
  181. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +2 -6
  182. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -5
  183. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -9
  184. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +2 -8
  185. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +11 -12
  186. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -6
  187. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -8
  188. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +2 -6
  189. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -21
  190. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  191. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  192. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  193. package/dist/Editor/common/StyleBuilder/index.js +5 -8
  194. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
  195. package/dist/Editor/common/Uploader.js +5 -16
  196. package/dist/Editor/commonStyle.js +65 -55
  197. package/dist/Editor/helper/index.js +12 -8
  198. package/dist/Editor/helper/theme.js +2 -200
  199. package/dist/Editor/hooks/useDrag.js +10 -16
  200. package/dist/Editor/hooks/useEditorScroll.js +5 -10
  201. package/dist/Editor/hooks/useMouseMove.js +13 -25
  202. package/dist/Editor/hooks/useTable.js +1 -1
  203. package/dist/Editor/plugins/withEmbeds.js +1 -1
  204. package/dist/Editor/plugins/withHTML.js +13 -18
  205. package/dist/Editor/plugins/withLayout.js +2 -3
  206. package/dist/Editor/plugins/withTable.js +1 -1
  207. package/dist/Editor/theme/ThemeList.js +173 -50
  208. package/dist/Editor/utils/SlateUtilityFunctions.js +45 -162
  209. package/dist/Editor/utils/button.js +14 -0
  210. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -23
  211. package/dist/Editor/utils/divider.js +0 -8
  212. package/dist/Editor/utils/draftToSlate.js +2 -3
  213. package/dist/Editor/utils/embed.js +4 -9
  214. package/dist/Editor/utils/font.js +37 -40
  215. package/dist/Editor/utils/helper.js +19 -65
  216. package/dist/Editor/utils/table.js +0 -8
  217. package/package.json +1 -1
  218. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  219. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  220. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  221. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  222. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  223. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  224. package/dist/Editor/common/CustomSelect.js +0 -33
  225. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  226. package/dist/Editor/helper/textIndeces.js +0 -58
  227. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  228. package/dist/Editor/theme/index.js +0 -144
  229. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  230. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  231. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  232. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  233. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  234. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  235. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  236. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  237. package/dist/Editor/themeSettings/icons.js +0 -60
  238. package/dist/Editor/themeSettings/index.js +0 -320
  239. package/dist/Editor/themeSettings/style.js +0 -152
  240. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  241. package/dist/Editor/themeSettingsAI/index.js +0 -356
  242. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  243. package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -1,220 +0,0 @@
1
- import React from "react";
2
- import { Accordion, AccordionDetails, AccordionSummary, Checkbox, Divider, Fade, FormControlLabel, Grid, 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 { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
19
- const Fonts = props => {
20
- const {
21
- className
22
- } = props;
23
- const [anchorEl, setAnchorEl] = React.useState();
24
- const [selectedField, setSelectedField] = React.useState("");
25
- const [settings, setSettings] = React.useState({});
26
- const updateSettings = update => {
27
- setSettings(prev => {
28
- return {
29
- ...prev,
30
- ...update
31
- };
32
- });
33
- };
34
- const onClose = () => {
35
- setAnchorEl(null);
36
- setSelectedField("");
37
- setSettings({});
38
- };
39
- const {
40
- theme,
41
- fontFamilies
42
- } = useEditorContext();
43
- const classes = usePopupStyle(theme);
44
- const [size] = useWindowResize();
45
- const {
46
- selectedTheme,
47
- updateTheme
48
- } = useEditorTheme();
49
- const {
50
- otherProps = {}
51
- } = selectedTheme || {};
52
- const {
53
- isHeadingCustomized,
54
- headingFontFamily,
55
- isParagraphCustomized,
56
- paragraphFontFamily
57
- } = otherProps;
58
- const onSaveTextSettings = () => {
59
- updateTheme(settings, {
60
- action: "ELEMENT_PROPS_CHANGE",
61
- fieldName: selectedField
62
- });
63
- onClose();
64
- };
65
- const updateOtherThemeProps = update => {
66
- updateTheme(update, {
67
- action: "OTHER_PROPS_CHANGE"
68
- });
69
- };
70
- const updateFont = (update, fieldType) => {
71
- updateTheme(update, {
72
- action: "FONT_CHANGE",
73
- fieldType
74
- });
75
- };
76
- const tabs = [{
77
- title: "Heading Font family",
78
- onFontFamilyChange: ({
79
- fontFamily
80
- }) => {
81
- updateFont({
82
- fontFamily
83
- }, "HEADING");
84
- updateSettings({
85
- fontFamily
86
- });
87
- },
88
- fontFamily: headingFontFamily || defaultFonts[0],
89
- isCustomized: isHeadingCustomized,
90
- onCustomizeClick: event => {
91
- updateOtherThemeProps({
92
- isHeadingCustomized: event.target.checked
93
- });
94
- },
95
- fields: HEADING_THEME_FIELDS
96
- }, {
97
- title: "Paragraph Font family",
98
- onFontFamilyChange: ({
99
- fontFamily
100
- }) => {
101
- updateFont({
102
- fontFamily
103
- }, "PARAGRAPH");
104
- updateSettings({
105
- fontFamily
106
- });
107
- },
108
- fontFamily: paragraphFontFamily || defaultFonts[0],
109
- isCustomized: isParagraphCustomized,
110
- onCustomizeClick: event => {
111
- updateOtherThemeProps({
112
- isParagraphCustomized: event.target.checked
113
- });
114
- },
115
- fields: PARAGRAPH_THEME_FIELDS
116
- }];
117
- return /*#__PURE__*/_jsxs(Grid, {
118
- className: className,
119
- children: [/*#__PURE__*/_jsxs(Accordion, {
120
- className: "settingAccordion",
121
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
122
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
123
- "aria-controls": "panel1-content",
124
- id: "panel1-header",
125
- children: "Fonts"
126
- }), /*#__PURE__*/_jsx(AccordionDetails, {
127
- children: tabs?.map((tab, i) => {
128
- const {
129
- title,
130
- onFontFamilyChange,
131
- fontFamily,
132
- isCustomized = "",
133
- onCustomizeClick,
134
- fields
135
- } = tab;
136
- return /*#__PURE__*/_jsxs(React.Fragment, {
137
- children: [/*#__PURE__*/_jsxs(Grid, {
138
- sx: {
139
- pt: 2
140
- },
141
- children: [/*#__PURE__*/_jsx(Typography, {
142
- variant: "body2",
143
- sx: {
144
- pb: 1
145
- },
146
- className: "fs-14 fw-500",
147
- children: title
148
- }), /*#__PURE__*/_jsx(FontFamilyAutocomplete, {
149
- editor: {},
150
- format: "fontFamily",
151
- options: fontFamilies.options,
152
- width: "100%",
153
- onChange: onFontFamilyChange,
154
- val: fontFamily,
155
- webFont: true
156
- }), /*#__PURE__*/_jsx(FormControlLabel, {
157
- control: /*#__PURE__*/_jsx(Checkbox, {
158
- checked: isCustomized,
159
- onChange: onCustomizeClick,
160
- size: "small"
161
- }),
162
- label: /*#__PURE__*/_jsx(Typography, {
163
- variant: "body2",
164
- className: "fs-12",
165
- children: "Customize Font style"
166
- })
167
- }), isCustomized && /*#__PURE__*/_jsx(Grid, {
168
- ref: anchorEl,
169
- children: fields.map((field, index) => {
170
- return /*#__PURE__*/_jsx(PreviewElement, {
171
- field: field,
172
- settings: settings,
173
- setSettings: setSettings,
174
- setAnchorEl: setAnchorEl,
175
- selectedField: selectedField,
176
- setSelectedField: setSelectedField
177
- }, index);
178
- })
179
- })]
180
- }), i === 0 && /*#__PURE__*/_jsx(Divider, {
181
- sx: {
182
- mt: 1,
183
- mb: 1
184
- }
185
- })]
186
- }, i);
187
- })
188
- })]
189
- }), /*#__PURE__*/_jsx(Popper, {
190
- open: Boolean(anchorEl),
191
- anchorEl: anchorEl,
192
- transition: true,
193
- placement: "left-start",
194
- sx: classes.popupWrapper,
195
- className: `tools-drawer ${size?.device} textSettings`,
196
- children: ({
197
- TransitionProps
198
- }) => /*#__PURE__*/_jsx(Fade, {
199
- ...TransitionProps,
200
- children: /*#__PURE__*/_jsxs(Paper, {
201
- style: {
202
- borderRadius: "10px",
203
- position: "relative"
204
- },
205
- children: [/*#__PURE__*/_jsx(PopperHeader, {
206
- title: "Text Settings",
207
- classes: classes,
208
- onClose: onClose
209
- }), /*#__PURE__*/_jsx(ThemeTextFormat, {
210
- settings: settings,
211
- updateSettings: updateSettings,
212
- onSaveTextSettings: onSaveTextSettings,
213
- onClose: onClose
214
- })]
215
- })
216
- })
217
- })]
218
- });
219
- };
220
- export default styled(Fonts)(Style);
@@ -1,44 +0,0 @@
1
- const Style = () => ({
2
- ".settingAccordion": {
3
- ".MuiOutlinedInput-root": {
4
- borderRadius: "8px",
5
- boxShadow: "0px 4px 16px 0px #0000000D"
6
- }
7
- },
8
- ".fontTypeItem": {
9
- padding: "6px 10px",
10
- width: "calc(100% + 20px)",
11
- margin: "0 -10px",
12
- "&:hover": {
13
- background: "#ECF2FF",
14
- ".editIcon": {
15
- opacity: "1",
16
- visibility: "visible"
17
- }
18
- },
19
- ".editIcon": {
20
- opacity: "0",
21
- visibility: "hidden",
22
- width: "30px",
23
- height: "30px"
24
- }
25
- },
26
- ".typeValue": {
27
- fontSize: "12px",
28
- color: "#64748B",
29
- ".dotColor": {
30
- width: "12px",
31
- height: "12px",
32
- borderRadius: "12px",
33
- background: "#0F172A",
34
- marginRight: "3px"
35
- }
36
- },
37
- ".preview-theme-text": {
38
- width: "200px",
39
- whiteSpace: "nowrap",
40
- overflow: "hidden",
41
- textOverflow: "ellipsis"
42
- }
43
- });
44
- 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
- });
@@ -1,320 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import { CircularProgress, Drawer, Grid, IconButton, Tab, Tabs, Typography, styled } from "@mui/material";
3
-
4
- // Style
5
- import Style from "./style";
6
-
7
- // icons
8
- import { CloseIcon } from "../common/iconslist";
9
- import { ChevronLeft } from "@mui/icons-material";
10
- import { TickIcon } from "./icons";
11
- import ColorTheme from "./colorTheme";
12
- import Buttons from "./buttons";
13
- import Fonts from "./fonts";
14
- import { useEditorTheme } from "../hooks/useEditorTheme";
15
- import ActiveTheme from "./ActiveTheme";
16
- import SaveTheme from "../themeSettingsAI/saveTheme";
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
19
- import { Fragment as _Fragment } from "react/jsx-runtime";
20
- function getColors(themeColors) {
21
- const colors = Object.values(themeColors || {});
22
- const primaryColors = colors.slice(0, 2);
23
- const otherColors = colors.slice(2);
24
- return {
25
- primaryColors,
26
- otherColors
27
- };
28
- }
29
- const ThemeSettings = props => {
30
- const {
31
- className,
32
- open,
33
- setOpen,
34
- services
35
- } = props;
36
-
37
- // State
38
- // const [themeDrawer, setThemeDrawer] = useState(true);
39
- const [themeTabType, setThemeTabType] = React.useState(0);
40
- const [themeMoodboard, setThemeMoodboard] = React.useState(false);
41
- const [themes, setThemes] = useState([]);
42
- const [loading, setLoading] = useState(false);
43
- const [savingTheme, setSavingTheme] = useState(false);
44
- const {
45
- theme: userSelectedTheme,
46
- updateTheme
47
- } = useEditorTheme();
48
- const {
49
- colors = {}
50
- } = userSelectedTheme?.theme?.cssVars || {};
51
- const {
52
- id,
53
- name,
54
- mood_name
55
- } = userSelectedTheme || {};
56
- const onClose = () => setOpen(false);
57
- const getThemesList = async themeTabType => {
58
- setLoading(true);
59
- setThemes([]);
60
- try {
61
- const themeType = themeTabType === 0 ? "default" : "";
62
- const result = await services("getThemes", {
63
- type: themeType
64
- });
65
- setThemes(result?.data || []);
66
- } catch (err) {
67
- console.log(err);
68
- }
69
- setLoading(false);
70
- };
71
- useEffect(() => {
72
- getThemesList(themeTabType);
73
- }, []);
74
- const handleThemeChange = theme => {
75
- updateTheme(theme, {
76
- action: "THEME_CHANGE"
77
- });
78
- };
79
- const onColorChange = (color, colorIndex) => {
80
- updateTheme({
81
- [`color${colorIndex}`]: color
82
- }, {
83
- action: "CSS_VAR_CHANGE",
84
- fieldName: "colors"
85
- });
86
- };
87
- const handleTabChange = (event, newValue) => {
88
- setThemeTabType(newValue);
89
- getThemesList(newValue);
90
- };
91
- const isUpdateTheme = Number(userSelectedTheme?.type) === 2;
92
- const onSaveTheme = async (formData = {}) => {
93
- setSavingTheme(true);
94
- try {
95
- const type = isUpdateTheme ? "update" : "create";
96
- const result = await services("saveTheme", {
97
- type,
98
- id,
99
- ...formData,
100
- theme: userSelectedTheme?.theme
101
- });
102
- const update = {
103
- ...userSelectedTheme,
104
- ...formData,
105
- type: "2"
106
- };
107
- const createdId = result?.data?.id;
108
- if (createdId) {
109
- update.id = createdId;
110
- }
111
- updateTheme(update);
112
- getThemesList(themeTabType);
113
- } catch (err) {
114
- console.log(err);
115
- }
116
- setSavingTheme(false);
117
- };
118
-
119
- // themeCard
120
- const ThemeCard = ({
121
- theme
122
- }) => {
123
- const {
124
- name,
125
- mood_name = ""
126
- } = theme;
127
- const {
128
- colors = {}
129
- } = theme?.theme?.cssVars || {};
130
- const {
131
- primaryColors,
132
- otherColors
133
- } = getColors(colors);
134
- const isSelected = theme.id === userSelectedTheme?.id;
135
- return /*#__PURE__*/_jsxs(Grid, {
136
- className: `themeCardWrapper ${isSelected ? "activeWrapper" : ""}`,
137
- onClick: () => handleThemeChange(theme),
138
- children: [isSelected ? /*#__PURE__*/_jsx(TickIcon, {}) : null, /*#__PURE__*/_jsxs(Grid, {
139
- container: true,
140
- justifyContent: "space-between",
141
- className: "themeCard",
142
- gap: 2,
143
- children: [/*#__PURE__*/_jsxs(Grid, {
144
- children: [/*#__PURE__*/_jsx(Typography, {
145
- variant: "body1",
146
- className: "title",
147
- style: {
148
- whiteSpace: "nowrap",
149
- maxWidth: "100px",
150
- textOverflow: "ellipsis",
151
- overflow: "hidden"
152
- },
153
- children: name
154
- }), /*#__PURE__*/_jsx(Typography, {
155
- variant: "body2",
156
- color: "textSecondary",
157
- className: "fs-12",
158
- children: mood_name
159
- })]
160
- }), /*#__PURE__*/_jsxs(Grid, {
161
- className: "flexAlign",
162
- sx: {
163
- gap: "5px"
164
- },
165
- children: [primaryColors?.map((color, i) => {
166
- return /*#__PURE__*/_jsx(Grid, {
167
- className: "primaryCard",
168
- style: {
169
- backgroundColor: color
170
- }
171
- }, i);
172
- }), /*#__PURE__*/_jsx(Grid, {
173
- className: "otherColors",
174
- sx: {
175
- gap: "5px"
176
- },
177
- children: otherColors.map((color, i) => {
178
- return /*#__PURE__*/_jsx(Grid, {
179
- className: "smallCard",
180
- style: {
181
- backgroundColor: color
182
- }
183
- }, i);
184
- })
185
- })]
186
- })]
187
- })]
188
- });
189
- };
190
- return /*#__PURE__*/_jsx(Grid, {
191
- className: className,
192
- children: /*#__PURE__*/_jsx(Drawer, {
193
- className: className,
194
- open: open,
195
- onClose: onClose,
196
- anchor: "right",
197
- children: /*#__PURE__*/_jsxs(Grid, {
198
- className: "settingsContainer",
199
- children: [/*#__PURE__*/_jsxs(Grid, {
200
- container: true,
201
- justifyContent: "space-between",
202
- wrap: "nowrap",
203
- className: "header",
204
- sx: {
205
- px: 2
206
- },
207
- children: [/*#__PURE__*/_jsxs(Grid, {
208
- children: [/*#__PURE__*/_jsx(Typography, {
209
- variant: "body1",
210
- className: "title",
211
- children: "Theme/Brand Setting"
212
- }), /*#__PURE__*/_jsxs(Typography, {
213
- variant: "body1",
214
- color: "textSecondary",
215
- className: "fs-12",
216
- children: ["Change the entire style of your website with a single click.", " "]
217
- })]
218
- }), /*#__PURE__*/_jsx(IconButton, {
219
- className: "closeBtn",
220
- onClick: onClose,
221
- children: /*#__PURE__*/_jsx(CloseIcon, {})
222
- })]
223
- }), /*#__PURE__*/_jsx(Grid, {
224
- className: "activeTheme",
225
- children: !themeMoodboard ? /*#__PURE__*/_jsx(ActiveTheme, {
226
- onExplore: () => setThemeMoodboard(true)
227
- }) : /*#__PURE__*/_jsxs(Grid, {
228
- className: "sectionDetail",
229
- children: [/*#__PURE__*/_jsxs(Typography, {
230
- variant: "body1",
231
- className: "sectionTitle flexAlign",
232
- children: [/*#__PURE__*/_jsx(IconButton, {
233
- onClick: () => setThemeMoodboard(false),
234
- children: /*#__PURE__*/_jsx(ChevronLeft, {})
235
- }), "Theme Moodboard"]
236
- }), /*#__PURE__*/_jsxs(Grid, {
237
- className: "activeWrapper",
238
- children: [/*#__PURE__*/_jsx(TickIcon, {}), /*#__PURE__*/_jsx(ActiveTheme, {
239
- explore: false
240
- })]
241
- }), /*#__PURE__*/_jsxs(Tabs, {
242
- value: themeTabType,
243
- onChange: handleTabChange,
244
- variant: "scrollable",
245
- scrollButtons: false,
246
- "aria-label": "scrollable prevent tabs example",
247
- children: [/*#__PURE__*/_jsx(Tab, {
248
- label: /*#__PURE__*/_jsx(Typography, {
249
- variant: "body1",
250
- className: "fs-14 fw-500 transformNone",
251
- children: "Key themes"
252
- })
253
- }), /*#__PURE__*/_jsx(Tab, {
254
- label: /*#__PURE__*/_jsx(Typography, {
255
- variant: "body1",
256
- className: "fs-14 fw-500 transformNone",
257
- children: "Saved themes"
258
- })
259
- })]
260
- }), loading ? /*#__PURE__*/_jsx("div", {
261
- style: {
262
- display: "flex",
263
- justifyContent: "center",
264
- alignItems: "center",
265
- margin: 0,
266
- padding: 0,
267
- height: "50px",
268
- overflow: "hidden"
269
- },
270
- children: /*#__PURE__*/_jsx(CircularProgress, {})
271
- }) : null, themes.map((theme, i) => {
272
- return /*#__PURE__*/_jsx(ThemeCard, {
273
- theme: theme
274
- }, i);
275
- })]
276
- })
277
- }), id ? /*#__PURE__*/_jsxs(_Fragment, {
278
- children: [/*#__PURE__*/_jsx(Grid, {
279
- sx: {
280
- px: 1
281
- },
282
- children: /*#__PURE__*/_jsx(ColorTheme, {
283
- colors: getColors(colors),
284
- onColorChange: onColorChange,
285
- openDefault: open === "editThemeColor"
286
- })
287
- }), /*#__PURE__*/_jsx(Grid, {
288
- sx: {
289
- px: 1
290
- },
291
- children: /*#__PURE__*/_jsx(Fonts, {})
292
- }), /*#__PURE__*/_jsx(Grid, {
293
- sx: {
294
- px: 1
295
- },
296
- children: /*#__PURE__*/_jsx(Buttons, {})
297
- }), /*#__PURE__*/_jsx("div", {
298
- style: {
299
- width: "100%",
300
- display: "flex",
301
- justifyContent: "center",
302
- alignItems: "center",
303
- marginTop: "10px"
304
- },
305
- children: /*#__PURE__*/_jsx(SaveTheme, {
306
- saveBtnLabel: isUpdateTheme ? "Update theme" : "Save Theme",
307
- loading: savingTheme,
308
- onSave: onSaveTheme,
309
- defaultFormData: {
310
- name,
311
- mood_name
312
- }
313
- })
314
- })]
315
- }) : null]
316
- })
317
- })
318
- });
319
- };
320
- export default styled(ThemeSettings)(Style);