@flozy/editor 9.8.3 → 9.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +141 -26
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +11 -7
  5. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  6. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  7. package/dist/Editor/Elements/AI/PopoverAIInput.js +15 -5
  8. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  9. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  10. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  11. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  13. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  14. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  15. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  16. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  17. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  18. package/dist/Editor/Elements/Button/EditorButton.js +43 -30
  19. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  20. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  21. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  22. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  23. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  24. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  25. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
  26. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  27. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  28. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  29. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  30. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  31. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  32. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
  35. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  36. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  38. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  39. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  40. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  42. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  44. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  45. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  46. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  47. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  48. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  49. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  50. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  51. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  52. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  53. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  54. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  55. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  56. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  57. package/dist/Editor/Elements/Embed/Image.js +16 -11
  58. package/dist/Editor/Elements/Embed/Video.js +10 -7
  59. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  60. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  61. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  62. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  63. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  64. package/dist/Editor/Elements/Form/Form.js +12 -9
  65. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  66. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  67. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  68. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  69. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  70. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  71. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  72. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  73. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  74. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
  75. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  76. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
  77. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  78. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  79. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  80. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  81. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  82. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  83. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  84. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  85. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  86. package/dist/Editor/Elements/Link/Link.js +8 -5
  87. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  88. package/dist/Editor/Elements/List/CheckList.js +18 -10
  89. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  90. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  91. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  92. package/dist/Editor/Elements/Search/SearchButton.js +7 -4
  93. package/dist/Editor/Elements/Search/SearchList.js +10 -5
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
  96. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  97. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  98. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  99. package/dist/Editor/Elements/SimpleText/index.js +14 -5
  100. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  101. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  102. package/dist/Editor/Elements/Table/Table.js +23 -11
  103. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  104. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  105. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  106. package/dist/Editor/Elements/Title/title.js +9 -8
  107. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  108. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  109. package/dist/Editor/MiniEditor.js +10 -3
  110. package/dist/Editor/Styles/EditorStyles.js +5 -5
  111. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  112. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  113. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  114. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  115. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  116. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  117. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  118. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  119. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  128. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  129. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  130. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  131. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  132. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  133. package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
  134. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  135. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  136. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  137. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  138. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  139. package/dist/Editor/common/ColorPickerButton.js +39 -14
  140. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  141. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  142. package/dist/Editor/common/CustomDialog/index.js +8 -10
  143. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  144. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  145. package/dist/Editor/common/CustomSelect.js +43 -0
  146. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  147. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  148. package/dist/Editor/common/Icon.js +31 -1
  149. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  150. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  151. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  152. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  153. package/dist/Editor/common/LinkSettings/index.js +20 -14
  154. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  155. package/dist/Editor/common/MUIIcon/index.js +0 -3
  156. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  157. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  158. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  159. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  160. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  161. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  171. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  172. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  173. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  174. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  175. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  176. package/dist/Editor/common/RnD/Utils/gridDropItem.js +73 -9
  177. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  178. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +69 -13
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +72 -3
  188. package/dist/Editor/common/SnackBar/index.js +43 -0
  189. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  190. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  191. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  192. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  193. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  194. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  213. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  214. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  215. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  216. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  217. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  218. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  219. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  220. package/dist/Editor/common/Uploader.js +16 -5
  221. package/dist/Editor/commonStyle.js +68 -57
  222. package/dist/Editor/helper/index.js +27 -3
  223. package/dist/Editor/helper/textIndeces.js +58 -0
  224. package/dist/Editor/helper/theme.js +202 -2
  225. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +9 -3
  228. package/dist/Editor/hooks/useThemeValues.js +63 -0
  229. package/dist/Editor/plugins/withEmbeds.js +1 -1
  230. package/dist/Editor/plugins/withHTML.js +11 -9
  231. package/dist/Editor/plugins/withLayout.js +3 -2
  232. package/dist/Editor/plugins/withLinks.js +10 -0
  233. package/dist/Editor/plugins/withTable.js +1 -1
  234. package/dist/Editor/theme/ThemeList.js +50 -173
  235. package/dist/Editor/theme/index.js +149 -0
  236. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  237. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  238. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  239. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  240. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  241. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  242. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  243. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  244. package/dist/Editor/themeSettings/icons.js +60 -0
  245. package/dist/Editor/themeSettings/index.js +351 -0
  246. package/dist/Editor/themeSettings/style.js +220 -0
  247. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  248. package/dist/Editor/themeSettingsAI/index.js +355 -0
  249. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  250. package/dist/Editor/themeSettingsAI/style.js +259 -0
  251. package/dist/Editor/utils/SlateUtilityFunctions.js +186 -54
  252. package/dist/Editor/utils/brains.js +1 -2
  253. package/dist/Editor/utils/draftToSlate.js +3 -2
  254. package/dist/Editor/utils/font.js +40 -37
  255. package/dist/Editor/utils/freegrid.js +3 -3
  256. package/dist/Editor/utils/helper.js +92 -21
  257. package/package.json +4 -4
@@ -0,0 +1,290 @@
1
+ import React, { useRef, useState } from "react";
2
+ import { Accordion, AccordionDetails, AccordionSummary, Button, Fade, Grid, IconButton, Popper, Typography, styled } from "@mui/material";
3
+ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
+
5
+ // Style
6
+ import Style from "./style";
7
+ import { PenIcon } from "../icons";
8
+ import StyleBuilder from "../../common/StyleBuilder";
9
+ import { fontOptions } from "../../utils/font";
10
+ import { useEditorTheme } from "../../hooks/useEditorTheme";
11
+ import { getBreakPointsValue, getElementProperty, getTRBLBreakPoints } from "../../helper/theme";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ const buttonStyle = [{
15
+ tab: "General",
16
+ value: "size",
17
+ fields: [{
18
+ label: "Font Family",
19
+ key: "fontFamily",
20
+ type: "textOptions",
21
+ options: fontOptions,
22
+ webFont: true,
23
+ width: 7,
24
+ renderOption: option => {
25
+ return /*#__PURE__*/_jsx("span", {
26
+ style: {
27
+ fontFamily: option.value
28
+ },
29
+ children: option.text
30
+ });
31
+ }
32
+ }, {
33
+ label: "Font Size",
34
+ key: "textSize",
35
+ type: "fontSize",
36
+ width: 5,
37
+ placeholder: "16px or 1em"
38
+ }]
39
+ }, {
40
+ tab: "Colors",
41
+ value: "colors",
42
+ fields: [{
43
+ label: "Text Color",
44
+ key: "textColor",
45
+ type: "color",
46
+ needPreview: true
47
+ }, {
48
+ label: "Button Color",
49
+ key: "bgColor",
50
+ type: "color",
51
+ themeEnabled: true
52
+ }]
53
+ }, {
54
+ tab: "Banner Spacing",
55
+ value: "bannerSpacing",
56
+ fields: [{
57
+ label: "Banner Spacing",
58
+ key: "bannerSpacing",
59
+ type: "bannerSpacing"
60
+ }]
61
+ }, {
62
+ tab: "Border",
63
+ value: "border",
64
+ fields: [{
65
+ label: "Border Radius",
66
+ key: "borderRadius",
67
+ type: "borderRadius"
68
+ }]
69
+ }, {
70
+ tab: "Hover Colors",
71
+ value: "hoverColors",
72
+ fields: [{
73
+ label: "Hover Text Color",
74
+ key: "textColorHover",
75
+ type: "color",
76
+ needPreview: true
77
+ }, {
78
+ label: "Hover Button Color",
79
+ key: "bgColorHover",
80
+ type: "color"
81
+ }]
82
+ }];
83
+ function getBtnSxProps(buttonStyle = {}) {
84
+ const newStyle = {
85
+ ...buttonStyle
86
+ };
87
+ if (newStyle?.bannerSpacing) {
88
+ newStyle.padding = newStyle?.bannerSpacing;
89
+ }
90
+ newStyle.borderRadius = {
91
+ ...getBreakPointsValue(newStyle?.borderRadius || {}, null, "overrideBorderRadius", true)
92
+ };
93
+ newStyle.padding = {
94
+ ...getTRBLBreakPoints(newStyle?.bannerSpacing || {})
95
+ };
96
+ delete newStyle?.bannerSpacing;
97
+ if (newStyle?.hover) {
98
+ newStyle["&:hover"] = newStyle.hover;
99
+ delete newStyle.hover;
100
+ }
101
+ return newStyle;
102
+ }
103
+ const MAP_HOVER_KEYS = {
104
+ color: "textColorHover",
105
+ background: "bgColorHover"
106
+ };
107
+ const MAP_THEME_TO_ELEMENT_KEYS = {
108
+ color: "textColor",
109
+ background: "bgColor",
110
+ fontFamily: (value, prev, buttonEl) => {
111
+ if (!buttonEl?.current) {
112
+ return prev;
113
+ }
114
+ const val = getElementProperty(buttonEl?.current, "font-family");
115
+ return {
116
+ ...prev,
117
+ fontFamily: val
118
+ };
119
+ },
120
+ fontSize: "textSize",
121
+ borderRadius: "borderRadius",
122
+ bannerSpacing: "bannerSpacing",
123
+ lockRadius: "lockRadius",
124
+ lockbannerSpacing: "lockbannerSpacing",
125
+ // fontWeight
126
+
127
+ hover: (value = {}, prev = {}) => {
128
+ const props = getProps(value, MAP_HOVER_KEYS);
129
+ return {
130
+ ...prev,
131
+ ...props
132
+ };
133
+ }
134
+ };
135
+ const MAP_ELEMENT_TO_THEME_KEYS = {
136
+ textSize: "fontSize",
137
+ textColor: "color",
138
+ bgColor: "background",
139
+ bannerSpacing: "bannerSpacing",
140
+ borderRadius: "borderRadius",
141
+ lockRadius: "lockRadius",
142
+ lockbannerSpacing: "lockbannerSpacing",
143
+ textColorHover: (value, prev) => {
144
+ const hover = {
145
+ ...(prev?.hover || {})
146
+ };
147
+ hover.color = value;
148
+ return {
149
+ ...prev,
150
+ hover
151
+ };
152
+ },
153
+ bgColorHover: (value, prev) => {
154
+ const hover = {
155
+ ...(prev?.hover || {})
156
+ };
157
+ hover.background = value;
158
+ return {
159
+ ...prev,
160
+ hover
161
+ };
162
+ },
163
+ fontFamily: "fontFamily"
164
+ };
165
+ function getProps(buttonStyle, MAP_KEYS, buttonEl) {
166
+ let props = {};
167
+ Object.entries(buttonStyle).forEach(([key, value]) => {
168
+ const elementKey = MAP_KEYS[key];
169
+ if (elementKey) {
170
+ if (typeof elementKey === "string") {
171
+ props[elementKey] = value;
172
+ } else {
173
+ props = elementKey(value, props, buttonEl);
174
+ }
175
+ }
176
+ });
177
+ return props;
178
+ }
179
+ function convertThemeToElementProps(button = {}, buttonEl) {
180
+ const props = getProps(button, MAP_THEME_TO_ELEMENT_KEYS, buttonEl);
181
+ return props;
182
+ }
183
+
184
+ // icons
185
+
186
+ const Buttons = props => {
187
+ const {
188
+ className,
189
+ customProps,
190
+ openSettings,
191
+ onSettingsChange,
192
+ type
193
+ } = props;
194
+ const [anchorEl, setAnchorEl] = useState();
195
+ const {
196
+ selectedTheme,
197
+ updateTheme
198
+ } = useEditorTheme();
199
+ const {
200
+ button
201
+ } = selectedTheme?.elementProps || {};
202
+ const buttonEl = useRef();
203
+ const elementProps = convertThemeToElementProps(button, buttonEl);
204
+
205
+ // State
206
+ return /*#__PURE__*/_jsxs(Grid, {
207
+ className: className,
208
+ children: [/*#__PURE__*/_jsxs(Accordion, {
209
+ className: "settingAccordion",
210
+ onChange: () => onSettingsChange(type),
211
+ expanded: openSettings === type,
212
+ children: [/*#__PURE__*/_jsx(AccordionSummary, {
213
+ expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
214
+ "aria-controls": "panel1-content",
215
+ id: "panel1-header",
216
+ children: "Buttons"
217
+ }), /*#__PURE__*/_jsx(AccordionDetails, {
218
+ children: /*#__PURE__*/_jsxs(Grid, {
219
+ container: true,
220
+ className: "buttonTypeItem",
221
+ justifyContent: "space-between",
222
+ alignItems: "center",
223
+ wrap: "nowrap",
224
+ onClick: e => setAnchorEl(e.currentTarget),
225
+ children: [/*#__PURE__*/_jsxs(Grid, {
226
+ item: true,
227
+ style: {
228
+ maxWidth: "calc(100% - 50px)",
229
+ overflowX: "auto"
230
+ },
231
+ children: [/*#__PURE__*/_jsx(Typography, {
232
+ variant: "body1",
233
+ className: "fw-600 fs-14",
234
+ style: {
235
+ marginBottom: "10px"
236
+ },
237
+ children: "Theme Button"
238
+ }), /*#__PURE__*/_jsx(Button, {
239
+ sx: getBtnSxProps(button),
240
+ ref: buttonEl,
241
+ children: "Button"
242
+ })]
243
+ }), /*#__PURE__*/_jsx(IconButton, {
244
+ className: "editIcon",
245
+ children: /*#__PURE__*/_jsx(PenIcon, {})
246
+ })]
247
+ })
248
+ })]
249
+ }), /*#__PURE__*/_jsx(Popper, {
250
+ open: Boolean(anchorEl),
251
+ anchorEl: anchorEl,
252
+ transition: true,
253
+ sx: {
254
+ zIndex: "100000",
255
+ background: "white"
256
+ },
257
+ placement: "left-start",
258
+ children: ({
259
+ TransitionProps
260
+ }) => /*#__PURE__*/_jsx(Fade, {
261
+ ...TransitionProps,
262
+ timeout: 350,
263
+ children: /*#__PURE__*/_jsx("div", {
264
+ children: /*#__PURE__*/_jsx(StyleBuilder, {
265
+ title: "Button",
266
+ type: "buttonStyle",
267
+ element: elementProps,
268
+ onSave: data => {
269
+ const props = getProps(data, MAP_ELEMENT_TO_THEME_KEYS);
270
+ updateTheme(props, {
271
+ action: "ELEMENT_PROPS_CHANGE",
272
+ fieldName: "button"
273
+ });
274
+ setAnchorEl(null);
275
+ },
276
+ onClose: () => {
277
+ setAnchorEl(null);
278
+ },
279
+ renderTabs: buttonStyle,
280
+ customProps: {
281
+ disableEditTheme: true,
282
+ translation: customProps?.translation || (() => {})
283
+ }
284
+ })
285
+ })
286
+ })
287
+ })]
288
+ });
289
+ };
290
+ export default styled(Buttons)(Style);
@@ -0,0 +1,23 @@
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;
@@ -0,0 +1,310 @@
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
+ openSettings,
24
+ onSettingsChange,
25
+ type
26
+ } = props;
27
+ const classes = useCommonStyle(appTheme);
28
+ const {
29
+ primaryColors,
30
+ otherColors = []
31
+ } = colors || {};
32
+
33
+ // State
34
+ const [customizeTheme, setCustomizeTheme] = React.useState(false);
35
+ const [buttonType, setButtonType] = React.useState("regular");
36
+ const customTheme = [{
37
+ title: "Text & Line Colors",
38
+ data: [{
39
+ title: "Headings",
40
+ color: "#ccc"
41
+ }, {
42
+ title: "Subheading text",
43
+ color: "#ccc"
44
+ }, {
45
+ title: "Body text",
46
+ color: "#ccc"
47
+ }, {
48
+ title: "Subtext",
49
+ color: "#ccc"
50
+ }, {
51
+ title: "Lines & dividers",
52
+ color: "#ccc"
53
+ }]
54
+ }, {
55
+ title: "Background Colors",
56
+ data: [{
57
+ title: "Primary background color",
58
+ color: "#ccc"
59
+ }, {
60
+ title: "Secondary background color",
61
+ color: "#ccc"
62
+ }]
63
+ }];
64
+ const buttonData = [{
65
+ title: "Button background",
66
+ color: "#ccc"
67
+ }, {
68
+ title: "Button text",
69
+ color: "#ccc"
70
+ }, {
71
+ title: "Button border",
72
+ color: "#ccc"
73
+ }];
74
+
75
+ //button
76
+ const handleButtonType = (event, buttonType) => {
77
+ if (buttonType !== null) {
78
+ setButtonType(buttonType);
79
+ }
80
+ };
81
+ return /*#__PURE__*/_jsx(Grid, {
82
+ className: className,
83
+ children: !customizeTheme ? /*#__PURE__*/_jsxs(Accordion, {
84
+ className: "settingAccordion",
85
+ defaultExpanded: openDefault,
86
+ onChange: () => onSettingsChange(type),
87
+ expanded: openSettings === type,
88
+ children: [/*#__PURE__*/_jsx(AccordionSummary, {
89
+ expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
90
+ "aria-controls": "panel1-content",
91
+ id: "panel1-header",
92
+ children: "Color Theme"
93
+ }), /*#__PURE__*/_jsxs(AccordionDetails, {
94
+ children: [/*#__PURE__*/_jsx(Typography, {
95
+ variant: "body2",
96
+ sx: {
97
+ pb: 1
98
+ },
99
+ className: "fs-12 fw-600",
100
+ children: "Primary Color"
101
+ }), /*#__PURE__*/_jsx(Grid, {
102
+ container: true,
103
+ spacing: 1,
104
+ sx: {
105
+ pb: 2
106
+ },
107
+ className: "primaryColorBoxes",
108
+ wrap: "nowrap",
109
+ children: primaryColors?.map((color, i) => {
110
+ const textColor = getContrastColor(color);
111
+ return /*#__PURE__*/_jsx(Grid, {
112
+ item: true,
113
+ xs: 6,
114
+ children: /*#__PURE__*/_jsx(ColorPickerButton, {
115
+ onSave: selectedColor => {
116
+ if (selectedColor) {
117
+ onColorChange(selectedColor, i);
118
+ }
119
+ },
120
+ hideThemeColors: true
121
+ // hideGradient={true}
122
+ ,
123
+ classes: classes,
124
+ value: color,
125
+ children: /*#__PURE__*/_jsxs(Grid, {
126
+ className: "pmBox",
127
+ style: {
128
+ background: color
129
+ },
130
+ children: [/*#__PURE__*/_jsx(IconButton, {
131
+ className: "editBtn",
132
+ children: /*#__PURE__*/_jsx(EditIcon, {})
133
+ }), /*#__PURE__*/_jsx(Typography, {
134
+ variant: "body2",
135
+ className: "fs-12 valyeText",
136
+ style: {
137
+ color: textColor
138
+ },
139
+ children: color
140
+ })]
141
+ })
142
+ })
143
+ }, i);
144
+ })
145
+ }), /*#__PURE__*/_jsx(Typography, {
146
+ variant: "body2",
147
+ sx: {
148
+ pb: 1
149
+ },
150
+ className: "fs-12 fw-600",
151
+ children: "Secondary Colors"
152
+ }), /*#__PURE__*/_jsx(Grid, {
153
+ container: true,
154
+ className: "secondaryColorBoxes",
155
+ wrap: "nowrap",
156
+ sx: {
157
+ mb: 1
158
+ },
159
+ children: otherColors?.slice(0, 4)?.map((color, i) => {
160
+ const noOfPrimaryColors = 2;
161
+ const colorIndex = noOfPrimaryColors + i;
162
+ const textColor = getContrastColor(color);
163
+ return /*#__PURE__*/_jsx(Grid, {
164
+ item: true,
165
+ xs: 6,
166
+ children: /*#__PURE__*/_jsx(ColorPickerButton, {
167
+ onSave: selectedColor => {
168
+ if (selectedColor) {
169
+ onColorChange(selectedColor, colorIndex);
170
+ }
171
+ },
172
+ hideThemeColors: true
173
+ // hideGradient={true}
174
+ ,
175
+ classes: classes,
176
+ value: color,
177
+ children: /*#__PURE__*/_jsxs(Grid, {
178
+ className: "sdBox",
179
+ style: {
180
+ background: color
181
+ },
182
+ children: [/*#__PURE__*/_jsx(IconButton, {
183
+ className: "editBtn",
184
+ children: /*#__PURE__*/_jsx(EditIcon, {})
185
+ }), /*#__PURE__*/_jsx(Typography, {
186
+ variant: "body2",
187
+ className: "fs-12 valyeText",
188
+ style: {
189
+ color: textColor
190
+ },
191
+ children: color
192
+ })]
193
+ })
194
+ })
195
+ }, i);
196
+ })
197
+ })]
198
+ })]
199
+ }) : /*#__PURE__*/_jsxs(Grid, {
200
+ className: "sectionDetail",
201
+ children: [/*#__PURE__*/_jsxs(Typography, {
202
+ variant: "body1",
203
+ className: "sectionTitle flexAlign",
204
+ children: [/*#__PURE__*/_jsx(IconButton, {
205
+ onClick: () => setCustomizeTheme(false),
206
+ children: /*#__PURE__*/_jsx(ChevronLeft, {})
207
+ }), "Customize Theme settings"]
208
+ }), customTheme.map((item, index) => /*#__PURE__*/_jsxs(Grid, {
209
+ className: "settingsSection",
210
+ children: [/*#__PURE__*/_jsx(Typography, {
211
+ variant: "body1",
212
+ className: "sectionTitle",
213
+ sx: {
214
+ pb: 1
215
+ },
216
+ children: item.title
217
+ }), item.data.map((childitem, childIndex) => /*#__PURE__*/_jsxs(Grid, {
218
+ container: true,
219
+ justifyContent: "space-between",
220
+ sx: {
221
+ pt: 2
222
+ },
223
+ children: [/*#__PURE__*/_jsx(Typography, {
224
+ variant: "body1",
225
+ className: "fs-14",
226
+ children: childitem.title
227
+ }), /*#__PURE__*/_jsx(Grid, {
228
+ className: "xsColorBox",
229
+ sx: {
230
+ background: childitem.color
231
+ }
232
+ })]
233
+ }, childIndex))]
234
+ }, index)), /*#__PURE__*/_jsxs(Grid, {
235
+ className: "settingsSection",
236
+ children: [/*#__PURE__*/_jsx(Typography, {
237
+ variant: "body1",
238
+ className: "sectionTitle",
239
+ sx: {
240
+ pb: 1
241
+ },
242
+ children: "Button Colors"
243
+ }), /*#__PURE__*/_jsxs(ToggleButtonGroup, {
244
+ sx: {
245
+ mt: 2
246
+ },
247
+ className: "toggleType",
248
+ value: buttonType,
249
+ exclusive: true,
250
+ onChange: handleButtonType,
251
+ children: [/*#__PURE__*/_jsx(ToggleButton, {
252
+ value: "regular",
253
+ "aria-label": "regulard",
254
+ children: "Regular"
255
+ }), /*#__PURE__*/_jsx(ToggleButton, {
256
+ value: "hover",
257
+ "aria-label": "hover",
258
+ children: "Hover"
259
+ })]
260
+ }), /*#__PURE__*/_jsx(Divider, {
261
+ sx: {
262
+ mt: 2,
263
+ mb: 1
264
+ }
265
+ }), /*#__PURE__*/_jsxs(RadioGroup, {
266
+ sx: {
267
+ mt: 1
268
+ },
269
+ "aria-labelledby": "demo-radio-buttons-group-label",
270
+ defaultValue: "primary",
271
+ name: "radio-buttons-group",
272
+ children: [/*#__PURE__*/_jsx(FormControlLabel, {
273
+ value: "primary",
274
+ control: /*#__PURE__*/_jsx(Radio, {}),
275
+ label: /*#__PURE__*/_jsx(Typography, {
276
+ variant: "body1",
277
+ className: "fs-14",
278
+ children: "Primary button"
279
+ })
280
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
281
+ value: "secondary",
282
+ control: /*#__PURE__*/_jsx(Radio, {}),
283
+ label: /*#__PURE__*/_jsx(Typography, {
284
+ variant: "body1",
285
+ className: "fs-14",
286
+ children: "Secondary button"
287
+ })
288
+ })]
289
+ }), buttonData.map((item, Index) => /*#__PURE__*/_jsxs(Grid, {
290
+ container: true,
291
+ justifyContent: "space-between",
292
+ sx: {
293
+ pt: 2
294
+ },
295
+ children: [/*#__PURE__*/_jsx(Typography, {
296
+ variant: "body1",
297
+ className: "fs-14",
298
+ children: item.title
299
+ }), /*#__PURE__*/_jsx(Grid, {
300
+ className: "xsColorBox",
301
+ sx: {
302
+ background: item.color
303
+ }
304
+ })]
305
+ }, Index))]
306
+ })]
307
+ })
308
+ });
309
+ };
310
+ export default styled(ColorTheme)(Style);
@@ -0,0 +1,81 @@
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;