@flozy/editor 9.5.4 → 9.5.6

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 (256) 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 +3 -7
  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 +24 -2
  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 +8 -18
  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 +8 -20
  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 +105 -188
  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 +12 -8
  206. package/dist/Editor/helper/theme.js +2 -202
  207. package/dist/Editor/hooks/useDrag.js +10 -16
  208. package/dist/Editor/hooks/useEditorScroll.js +5 -10
  209. package/dist/Editor/hooks/useMouseMove.js +13 -25
  210. package/dist/Editor/hooks/useTable.js +1 -1
  211. package/dist/Editor/plugins/withEmbeds.js +1 -1
  212. package/dist/Editor/plugins/withHTML.js +7 -10
  213. package/dist/Editor/plugins/withLayout.js +2 -3
  214. package/dist/Editor/plugins/withTable.js +1 -1
  215. package/dist/Editor/theme/ThemeList.js +173 -50
  216. package/dist/Editor/utils/SlateUtilityFunctions.js +47 -164
  217. package/dist/Editor/utils/draftToSlate.js +2 -3
  218. package/dist/Editor/utils/embed.js +6 -8
  219. package/dist/Editor/utils/font.js +37 -40
  220. package/dist/Editor/utils/freegrid.js +2 -2
  221. package/dist/Editor/utils/helper.js +19 -90
  222. package/package.json +2 -2
  223. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -425
  224. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -441
  225. package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
  226. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  227. package/dist/Editor/common/CustomColorPicker/index.js +0 -131
  228. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  229. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  230. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  231. package/dist/Editor/common/CustomSelect.js +0 -33
  232. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  233. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +0 -117
  234. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +0 -134
  235. package/dist/Editor/common/RnD/VirtualElement/helper.js +0 -281
  236. package/dist/Editor/common/SnackBar/index.js +0 -43
  237. package/dist/Editor/helper/textIndeces.js +0 -58
  238. package/dist/Editor/hooks/useAutoScroll.js +0 -38
  239. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  240. package/dist/Editor/hooks/useThemeValues.js +0 -63
  241. package/dist/Editor/theme/index.js +0 -147
  242. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  243. package/dist/Editor/themeSettings/buttons/index.js +0 -285
  244. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  245. package/dist/Editor/themeSettings/colorTheme/index.js +0 -305
  246. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  247. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  248. package/dist/Editor/themeSettings/fonts/index.js +0 -222
  249. package/dist/Editor/themeSettings/fonts/style.js +0 -60
  250. package/dist/Editor/themeSettings/icons.js +0 -60
  251. package/dist/Editor/themeSettings/index.js +0 -331
  252. package/dist/Editor/themeSettings/style.js +0 -211
  253. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  254. package/dist/Editor/themeSettingsAI/index.js +0 -355
  255. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -205
  256. package/dist/Editor/themeSettingsAI/style.js +0 -259
@@ -1,23 +0,0 @@
1
- const Style = ({
2
- appTheme
3
- }) => ({
4
- ".buttonTypeItem": {
5
- padding: "8px 10px",
6
- width: "calc(100% + 20px)",
7
- margin: "0 -10px",
8
- "&:hover": {
9
- background: appTheme?.palette?.editor?.tv_hover_bg,
10
- ".editIcon": {
11
- opacity: "1",
12
- visibility: "visible"
13
- }
14
- },
15
- ".editIcon": {
16
- opacity: "0",
17
- visibility: "hidden",
18
- width: "30px",
19
- height: "30px"
20
- }
21
- }
22
- });
23
- export default Style;
@@ -1,305 +0,0 @@
1
- import React from "react";
2
- import { Accordion, AccordionDetails, AccordionSummary, Divider, FormControlLabel, Grid, IconButton, Radio, RadioGroup, ToggleButton, ToggleButtonGroup, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
-
5
- // Style
6
- import Style from "./style";
7
-
8
- // icons
9
- import { ChevronLeft } from "@mui/icons-material";
10
- import { EditIcon } from "../icons";
11
- import ColorPickerButton from "../../common/ColorPickerButton";
12
- import { getContrastColor } from "../../utils/helper";
13
- import useCommonStyle from "../../commonStyle";
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- const ColorTheme = props => {
17
- const {
18
- className,
19
- colors,
20
- onColorChange,
21
- openDefault,
22
- appTheme
23
- } = props;
24
- const classes = useCommonStyle(appTheme);
25
- const {
26
- primaryColors,
27
- otherColors = []
28
- } = colors || {};
29
-
30
- // State
31
- const [customizeTheme, setCustomizeTheme] = React.useState(false);
32
- const [buttonType, setButtonType] = React.useState("regular");
33
- const customTheme = [{
34
- title: "Text & Line Colors",
35
- data: [{
36
- title: "Headings",
37
- color: "#ccc"
38
- }, {
39
- title: "Subheading text",
40
- color: "#ccc"
41
- }, {
42
- title: "Body text",
43
- color: "#ccc"
44
- }, {
45
- title: "Subtext",
46
- color: "#ccc"
47
- }, {
48
- title: "Lines & dividers",
49
- color: "#ccc"
50
- }]
51
- }, {
52
- title: "Background Colors",
53
- data: [{
54
- title: "Primary background color",
55
- color: "#ccc"
56
- }, {
57
- title: "Secondary background color",
58
- color: "#ccc"
59
- }]
60
- }];
61
- const buttonData = [{
62
- title: "Button background",
63
- color: "#ccc"
64
- }, {
65
- title: "Button text",
66
- color: "#ccc"
67
- }, {
68
- title: "Button border",
69
- color: "#ccc"
70
- }];
71
-
72
- //button
73
- const handleButtonType = (event, buttonType) => {
74
- if (buttonType !== null) {
75
- setButtonType(buttonType);
76
- }
77
- };
78
- return /*#__PURE__*/_jsx(Grid, {
79
- className: className,
80
- children: !customizeTheme ? /*#__PURE__*/_jsxs(Accordion, {
81
- className: "settingAccordion",
82
- defaultExpanded: openDefault,
83
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
84
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
85
- "aria-controls": "panel1-content",
86
- id: "panel1-header",
87
- children: "Color Theme"
88
- }), /*#__PURE__*/_jsxs(AccordionDetails, {
89
- children: [/*#__PURE__*/_jsx(Typography, {
90
- variant: "body2",
91
- sx: {
92
- pb: 1
93
- },
94
- className: "fs-12 fw-600",
95
- children: "Primary Color"
96
- }), /*#__PURE__*/_jsx(Grid, {
97
- container: true,
98
- spacing: 1,
99
- sx: {
100
- pb: 2
101
- },
102
- className: "primaryColorBoxes",
103
- wrap: "nowrap",
104
- children: primaryColors?.map((color, i) => {
105
- const textColor = getContrastColor(color);
106
- return /*#__PURE__*/_jsx(Grid, {
107
- item: true,
108
- xs: 6,
109
- children: /*#__PURE__*/_jsx(ColorPickerButton, {
110
- onSave: selectedColor => {
111
- if (selectedColor) {
112
- onColorChange(selectedColor, i);
113
- }
114
- },
115
- hideThemeColors: true
116
- // hideGradient={true}
117
- ,
118
- classes: classes,
119
- value: color,
120
- children: /*#__PURE__*/_jsxs(Grid, {
121
- className: "pmBox",
122
- style: {
123
- background: color
124
- },
125
- children: [/*#__PURE__*/_jsx(IconButton, {
126
- className: "editBtn",
127
- children: /*#__PURE__*/_jsx(EditIcon, {})
128
- }), /*#__PURE__*/_jsx(Typography, {
129
- variant: "body2",
130
- className: "fs-12 valyeText",
131
- style: {
132
- color: textColor
133
- },
134
- children: color
135
- })]
136
- })
137
- })
138
- }, i);
139
- })
140
- }), /*#__PURE__*/_jsx(Typography, {
141
- variant: "body2",
142
- sx: {
143
- pb: 1
144
- },
145
- className: "fs-12 fw-600",
146
- children: "Secondary Colors"
147
- }), /*#__PURE__*/_jsx(Grid, {
148
- container: true,
149
- className: "secondaryColorBoxes",
150
- wrap: "nowrap",
151
- sx: {
152
- mb: 1
153
- },
154
- children: otherColors?.slice(0, 4)?.map((color, i) => {
155
- const noOfPrimaryColors = 2;
156
- const colorIndex = noOfPrimaryColors + i;
157
- const textColor = getContrastColor(color);
158
- return /*#__PURE__*/_jsx(Grid, {
159
- item: true,
160
- xs: 6,
161
- children: /*#__PURE__*/_jsx(ColorPickerButton, {
162
- onSave: selectedColor => {
163
- if (selectedColor) {
164
- onColorChange(selectedColor, colorIndex);
165
- }
166
- },
167
- hideThemeColors: true
168
- // hideGradient={true}
169
- ,
170
- classes: classes,
171
- value: color,
172
- children: /*#__PURE__*/_jsxs(Grid, {
173
- className: "sdBox",
174
- style: {
175
- background: color
176
- },
177
- children: [/*#__PURE__*/_jsx(IconButton, {
178
- className: "editBtn",
179
- children: /*#__PURE__*/_jsx(EditIcon, {})
180
- }), /*#__PURE__*/_jsx(Typography, {
181
- variant: "body2",
182
- className: "fs-12 valyeText",
183
- style: {
184
- color: textColor
185
- },
186
- children: color
187
- })]
188
- })
189
- })
190
- }, i);
191
- })
192
- })]
193
- })]
194
- }) : /*#__PURE__*/_jsxs(Grid, {
195
- className: "sectionDetail",
196
- children: [/*#__PURE__*/_jsxs(Typography, {
197
- variant: "body1",
198
- className: "sectionTitle flexAlign",
199
- children: [/*#__PURE__*/_jsx(IconButton, {
200
- onClick: () => setCustomizeTheme(false),
201
- children: /*#__PURE__*/_jsx(ChevronLeft, {})
202
- }), "Customize Theme settings"]
203
- }), customTheme.map((item, index) => /*#__PURE__*/_jsxs(Grid, {
204
- className: "settingsSection",
205
- children: [/*#__PURE__*/_jsx(Typography, {
206
- variant: "body1",
207
- className: "sectionTitle",
208
- sx: {
209
- pb: 1
210
- },
211
- children: item.title
212
- }), item.data.map((childitem, childIndex) => /*#__PURE__*/_jsxs(Grid, {
213
- container: true,
214
- justifyContent: "space-between",
215
- sx: {
216
- pt: 2
217
- },
218
- children: [/*#__PURE__*/_jsx(Typography, {
219
- variant: "body1",
220
- className: "fs-14",
221
- children: childitem.title
222
- }), /*#__PURE__*/_jsx(Grid, {
223
- className: "xsColorBox",
224
- sx: {
225
- background: childitem.color
226
- }
227
- })]
228
- }, childIndex))]
229
- }, index)), /*#__PURE__*/_jsxs(Grid, {
230
- className: "settingsSection",
231
- children: [/*#__PURE__*/_jsx(Typography, {
232
- variant: "body1",
233
- className: "sectionTitle",
234
- sx: {
235
- pb: 1
236
- },
237
- children: "Button Colors"
238
- }), /*#__PURE__*/_jsxs(ToggleButtonGroup, {
239
- sx: {
240
- mt: 2
241
- },
242
- className: "toggleType",
243
- value: buttonType,
244
- exclusive: true,
245
- onChange: handleButtonType,
246
- children: [/*#__PURE__*/_jsx(ToggleButton, {
247
- value: "regular",
248
- "aria-label": "regulard",
249
- children: "Regular"
250
- }), /*#__PURE__*/_jsx(ToggleButton, {
251
- value: "hover",
252
- "aria-label": "hover",
253
- children: "Hover"
254
- })]
255
- }), /*#__PURE__*/_jsx(Divider, {
256
- sx: {
257
- mt: 2,
258
- mb: 1
259
- }
260
- }), /*#__PURE__*/_jsxs(RadioGroup, {
261
- sx: {
262
- mt: 1
263
- },
264
- "aria-labelledby": "demo-radio-buttons-group-label",
265
- defaultValue: "primary",
266
- name: "radio-buttons-group",
267
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
268
- value: "primary",
269
- control: /*#__PURE__*/_jsx(Radio, {}),
270
- label: /*#__PURE__*/_jsx(Typography, {
271
- variant: "body1",
272
- className: "fs-14",
273
- children: "Primary button"
274
- })
275
- }), /*#__PURE__*/_jsx(FormControlLabel, {
276
- value: "secondary",
277
- control: /*#__PURE__*/_jsx(Radio, {}),
278
- label: /*#__PURE__*/_jsx(Typography, {
279
- variant: "body1",
280
- className: "fs-14",
281
- children: "Secondary button"
282
- })
283
- })]
284
- }), buttonData.map((item, Index) => /*#__PURE__*/_jsxs(Grid, {
285
- container: true,
286
- justifyContent: "space-between",
287
- sx: {
288
- pt: 2
289
- },
290
- children: [/*#__PURE__*/_jsx(Typography, {
291
- variant: "body1",
292
- className: "fs-14",
293
- children: item.title
294
- }), /*#__PURE__*/_jsx(Grid, {
295
- className: "xsColorBox",
296
- sx: {
297
- background: item.color
298
- }
299
- })]
300
- }, Index))]
301
- })]
302
- })
303
- });
304
- };
305
- export default styled(ColorTheme)(Style);
@@ -1,81 +0,0 @@
1
- const Style = () => ({
2
- ".primaryColorBoxes": {
3
- ".pmBox": {
4
- border: "1px solid #D1D1D1",
5
- height: "65px",
6
- borderRadius: "4px",
7
- position: "relative",
8
- flexShrink: 0,
9
- "&:hover": {
10
- ".editBtn": {
11
- opacity: "1",
12
- visibility: "visible"
13
- }
14
- }
15
- }
16
- },
17
- ".secondaryColorBoxes": {
18
- gap: "10px",
19
- ".sdBox": {
20
- border: "1px solid #D1D1D1",
21
- height: "60px",
22
- borderRadius: "4px",
23
- width: "100%",
24
- flexShrink: 0,
25
- position: "relative",
26
- "&:hover": {
27
- ".editBtn": {
28
- opacity: "1",
29
- visibility: "visible"
30
- }
31
- }
32
- }
33
- },
34
- ".valyeText": {
35
- position: "absolute",
36
- right: "5px",
37
- bottom: "5px",
38
- whiteSpace: "nowrap",
39
- overflow: "hidden",
40
- textOverflow: "ellipsis",
41
- maxWidth: "calc(100% - 10px)"
42
- },
43
- ".editBtn": {
44
- position: "absolute",
45
- right: "2px",
46
- top: "2px",
47
- padding: "2px",
48
- opacity: "0",
49
- visibility: "hidden"
50
- },
51
- ".settingsSection": {
52
- background: "#FFFFFF",
53
- border: "1px solid #E4E6E9",
54
- padding: "12px",
55
- marginTop: "10px",
56
- borderRadius: "7px"
57
- },
58
- ".toggleType": {
59
- width: "100%",
60
- border: "1px solid #2563EB",
61
- background: "#F5F6F9",
62
- borderRadius: "8px",
63
- padding: "3px",
64
- height: "40px",
65
- ".MuiToggleButton-root": {
66
- padding: "10px",
67
- width: "50%",
68
- border: "none",
69
- textTransform: "unset",
70
- fontSize: "14px",
71
- color: "#64748B",
72
- "&.Mui-selected": {
73
- borderRadius: "8px",
74
- background: "#2563EB",
75
- color: "#fff",
76
- fontWeight: "700"
77
- }
78
- }
79
- }
80
- });
81
- export default Style;
@@ -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;