@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
@@ -10,8 +10,12 @@ const SelectBox = props => {
10
10
  value,
11
11
  data,
12
12
  onChange,
13
- elementProps
13
+ elementProps,
14
+ customProps
14
15
  } = props;
16
+ const {
17
+ translation
18
+ } = customProps;
15
19
  const {
16
20
  key,
17
21
  placeholder
@@ -59,7 +63,7 @@ const SelectBox = props => {
59
63
  className: "unCheckedIcon"
60
64
  })
61
65
  }),
62
- label: placeholder
66
+ label: translation(placeholder)
63
67
  }), /*#__PURE__*/_jsx(FormHelperText, {
64
68
  children: data?.helperText
65
69
  })]
@@ -6,8 +6,12 @@ const Text = props => {
6
6
  const {
7
7
  value: pro_value,
8
8
  data,
9
- onChange
9
+ onChange,
10
+ customProps
10
11
  } = props;
12
+ const {
13
+ translation
14
+ } = customProps;
11
15
  const {
12
16
  key,
13
17
  placeholder,
@@ -39,10 +43,10 @@ const Text = props => {
39
43
  fontWeight: "500",
40
44
  marginBottom: "8px"
41
45
  },
42
- children: data?.label
46
+ children: translation(data?.label)
43
47
  }), /*#__PURE__*/_jsx(TextField, {
44
48
  name: key,
45
- placeholder: placeholder || "",
49
+ placeholder: placeholder && translation(placeholder) || "",
46
50
  type: "text",
47
51
  value: value,
48
52
  onChange: handleChange,
@@ -50,7 +54,7 @@ const Text = props => {
50
54
  fullWidth: true,
51
55
  required: required,
52
56
  error: error,
53
- helperText: error ? 'This field is required' : '',
57
+ helperText: error ? translation("This field is required") : '',
54
58
  sx: {
55
59
  '& .MuiFormHelperText-root': {
56
60
  color: '#d32f2f !important'
@@ -7,8 +7,12 @@ const TextAlign = props => {
7
7
  const {
8
8
  value,
9
9
  data,
10
- onChange
10
+ onChange,
11
+ customProps
11
12
  } = props;
13
+ const {
14
+ translation
15
+ } = customProps;
12
16
  const {
13
17
  key,
14
18
  label
@@ -31,7 +35,7 @@ const TextAlign = props => {
31
35
  fontWeight: 500,
32
36
  fontSize: "14px"
33
37
  },
34
- children: label || "Text Alignment"
38
+ children: translation(label) || translation("Text Alignment")
35
39
  })
36
40
  }), /*#__PURE__*/_jsxs(RadioGroup, {
37
41
  row: true,
@@ -1,13 +1,13 @@
1
- import React from "react";
1
+ import React, { useMemo } from "react";
2
2
  import { FormControl, Grid, ListItemIcon, ListSubheader, MenuItem, Select, Typography } from "@mui/material";
3
- import { getBreakPointsValue } from "../../../helper/theme";
3
+ import { getBreakPointsValue, getElementStyle } from "../../../helper/theme";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
5
  import { useEditorContext } from "../../../hooks/useMouseMove";
6
6
  import FontFamilyAutocomplete from "../../../Toolbar/FormatTools/FontFamilyAutocomplete";
7
7
  import { useSlate } from "slate-react";
8
8
  import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
9
9
 
10
- // hideMetaDataOptions -- pass true to hide metadata option in select field
10
+ // hideMetaDataOptions -- pass true to hide metadata option in select field
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -21,7 +21,8 @@ const TextOptions = props => {
21
21
  customProps
22
22
  } = props;
23
23
  const {
24
- metaMappings
24
+ metaMappings,
25
+ translation
25
26
  } = customProps;
26
27
  const {
27
28
  key,
@@ -30,14 +31,22 @@ const TextOptions = props => {
30
31
  renderOption,
31
32
  width,
32
33
  webFont = false,
33
- hideMetaDataOptions = false
34
+ hideMetaDataOptions = false,
35
+ themeEnabled
34
36
  } = data;
35
37
  const {
36
38
  fontFamilies
37
39
  } = useEditorContext();
38
- const editor = useSlate();
39
40
  const [size] = useWindowResize();
40
- const value = isBreakpoint ? getBreakPointsValue(val, size?.device) : val;
41
+ const editor = useSlate();
42
+ const value = useMemo(() => {
43
+ const userValue = isBreakpoint ? getBreakPointsValue(val, size?.device) : val;
44
+ if (themeEnabled) {
45
+ // editor takes a little amount of time to update the new style in element, in that case userValue will be returned
46
+ return getElementStyle(editor, elementProps, key) || userValue;
47
+ }
48
+ return userValue;
49
+ }, [editor, isBreakpoint, val, size?.device]);
41
50
  const metaDataMappingOptions = metaMappings?.boards || [];
42
51
  const updatedOption = !hideMetaDataOptions && elementProps?.metadatamapping ? [...options, ...metaDataMappingOptions] : webFont ? fontFamilies?.options : options;
43
52
  const handleChange = (e, d) => {
@@ -71,7 +80,7 @@ const TextOptions = props => {
71
80
  fontWeight: "500",
72
81
  marginBottom: "4px"
73
82
  },
74
- children: data?.label
83
+ children: translation(data?.label)
75
84
  }), /*#__PURE__*/_jsx(FormControl, {
76
85
  sx: {
77
86
  "& .MuiSelect-select": {
@@ -84,7 +93,7 @@ const TextOptions = props => {
84
93
  children: !webFont ? /*#__PURE__*/_jsx(Select, {
85
94
  onChange: handleChange,
86
95
  value: value || updatedOption[0]?.value,
87
- placeholder: data?.label,
96
+ placeholder: translation(data?.label),
88
97
  fullWidth: true,
89
98
  size: "small",
90
99
  style: {
@@ -99,7 +108,7 @@ const TextOptions = props => {
99
108
  },
100
109
  children: updatedOption?.map((m, i) => {
101
110
  return m?.value === "listSubHeader" ? /*#__PURE__*/_jsx(ListSubheader, {
102
- children: m?.label
111
+ children: translation(m?.label || m?.text)
103
112
  }, `subHeader_${i}`) : /*#__PURE__*/_jsxs(MenuItem, {
104
113
  value: m?.value,
105
114
  item: m?.metaDataKey,
@@ -109,14 +118,14 @@ const TextOptions = props => {
109
118
  minWidth: "25px"
110
119
  },
111
120
  children: m?.icon
112
- }), renderOption ? renderOption(m, elementProps) : m.label || m.text]
121
+ }), renderOption ? renderOption(m, elementProps, translation) : translation(m?.label || m?.text)]
113
122
  }, `${key}_${i}`);
114
123
  })
115
124
  }) : /*#__PURE__*/_jsx(FontFamilyAutocomplete, {
116
125
  editor: editor,
117
126
  format: key,
118
127
  options: fontFamilies.options,
119
- width: '100%',
128
+ width: "100%",
120
129
  onChange: onChange,
121
130
  val: value,
122
131
  webFont: true
@@ -16,7 +16,7 @@ export const formStyle = [{
16
16
  label: "Send Form to Email",
17
17
  key: "email",
18
18
  type: "text",
19
- placeholder: "Enter Email to send the response..."
19
+ placeholder: "emailResponsePlaceHolder"
20
20
  }, {
21
21
  label: "Save Response",
22
22
  key: "saveResponse",
@@ -93,9 +93,9 @@ export const formStyle = [{
93
93
  text: "Dashed",
94
94
  value: "dashed"
95
95
  }],
96
- renderOption: option => {
96
+ renderOption: (option, elementProps, translation) => {
97
97
  return /*#__PURE__*/_jsx("span", {
98
- children: option.text
98
+ children: translation(option.text)
99
99
  });
100
100
  }
101
101
  }]
@@ -204,12 +204,12 @@ export const formStyle = [{
204
204
  width: 5,
205
205
  options: fontWeightOptions,
206
206
  hideMetaDataOptions: true,
207
- renderOption: option => {
207
+ renderOption: (option, elementProps, translation) => {
208
208
  return /*#__PURE__*/_jsx("span", {
209
209
  style: {
210
210
  fontWeight: option.value
211
211
  },
212
- children: option.text
212
+ children: translation(option.text)
213
213
  });
214
214
  }
215
215
  }]
@@ -277,9 +277,9 @@ export const formStyle = [{
277
277
  text: "Dashed",
278
278
  value: "dashed"
279
279
  }],
280
- renderOption: option => {
280
+ renderOption: (option, elementProps, translation) => {
281
281
  return /*#__PURE__*/_jsx("span", {
282
- children: option.text
282
+ children: translation(option.text)
283
283
  });
284
284
  }
285
285
  }]
@@ -66,9 +66,9 @@ const gridItemStyle = [{
66
66
  text: "Dashed",
67
67
  value: "dashed"
68
68
  }],
69
- renderOption: option => {
69
+ renderOption: (option, elementProps, translation) => {
70
70
  return /*#__PURE__*/_jsx("span", {
71
- children: option.text
71
+ children: translation(option.text)
72
72
  });
73
73
  }
74
74
  }]
@@ -96,9 +96,9 @@ const gridItemStyle = [{
96
96
  text: "Full",
97
97
  value: "100%"
98
98
  }],
99
- renderOption: option => {
99
+ renderOption: (option, elementProps, translation) => {
100
100
  return /*#__PURE__*/_jsx("span", {
101
- children: option.text
101
+ children: translation(option.text)
102
102
  });
103
103
  }
104
104
  }]
@@ -122,9 +122,9 @@ const gridItemStyle = [{
122
122
  text: "Bounce In Left",
123
123
  value: "animate__animated animate__bounceInLeft"
124
124
  }],
125
- renderOption: option => {
125
+ renderOption: (option, elementProps, translation) => {
126
126
  return /*#__PURE__*/_jsx("span", {
127
- children: option.text
127
+ children: translation(option.text)
128
128
  });
129
129
  }
130
130
  }]
@@ -6,7 +6,7 @@ const gridStyle = [{
6
6
  label: "Section Name",
7
7
  key: "id",
8
8
  type: "text",
9
- placeholder: "Id should be unique for the page..."
9
+ placeholder: "sectionNamePlaceHolder"
10
10
  }]
11
11
  }, {
12
12
  tab: "Colors",
@@ -85,9 +85,9 @@ const gridStyle = [{
85
85
  text: "Dashed",
86
86
  value: "dashed"
87
87
  }],
88
- renderOption: option => {
88
+ renderOption: (option, elementProps, translation) => {
89
89
  return /*#__PURE__*/_jsx("span", {
90
- children: option.text
90
+ children: translation(option.text)
91
91
  });
92
92
  }
93
93
  }]
@@ -113,9 +113,9 @@ const gridStyle = [{
113
113
  text: "No Wrap",
114
114
  value: "nowrap"
115
115
  }],
116
- renderOption: option => {
116
+ renderOption: (option, elementProps, translation) => {
117
117
  return /*#__PURE__*/_jsx("span", {
118
- children: option.text
118
+ children: translation(option.text)
119
119
  });
120
120
  }
121
121
  }]
@@ -21,7 +21,8 @@ export const StyleContent = props => {
21
21
  } = props;
22
22
  const element = customElement ? customElement : propsElement;
23
23
  const {
24
- hideTools
24
+ hideTools,
25
+ translation
25
26
  } = customProps || {};
26
27
  const {
27
28
  theme
@@ -47,7 +48,8 @@ export const StyleContent = props => {
47
48
  elementProps: element,
48
49
  customProps: customProps,
49
50
  handleClose: handleClose,
50
- classes: classes
51
+ classes: classes,
52
+ translation: translation
51
53
  }, `ei_stt_tab_${value}_${m.key}_${i}`) : null;
52
54
  })
53
55
  }, value);
@@ -77,7 +79,8 @@ const StyleBuilder = props => {
77
79
  needActions: true
78
80
  };
79
81
  const {
80
- hideTools
82
+ hideTools,
83
+ translation
81
84
  } = customProps || {};
82
85
  const muiTheme = createTheme({
83
86
  components: {
@@ -242,12 +245,12 @@ const StyleBuilder = props => {
242
245
  onClick: onDelete,
243
246
  color: "error",
244
247
  className: "deleteBtn",
245
- children: "Delete"
248
+ children: translation("Delete")
246
249
  }) : null, /*#__PURE__*/_jsx(Button, {
247
250
  onClick: handleSave,
248
251
  disabled: saveDisable,
249
252
  className: "primaryBtn",
250
- children: "Save"
253
+ children: translation("Save")
251
254
  })]
252
255
  }) : null]
253
256
  });
@@ -25,13 +25,11 @@ const pageSettingsStyle = [{
25
25
  label: "Padding",
26
26
  key: "bannerSpacing",
27
27
  type: "bannerSpacing"
28
- }
29
- // {
30
- // label: "Line Spacing",
31
- // key: "lineHeight",
32
- // type: "lineSpacing",
33
- // },
34
- ]
28
+ }, {
29
+ label: "Line Spacing",
30
+ key: "lineHeight",
31
+ type: "lineSpacing"
32
+ }]
35
33
  }, {
36
34
  tab: "Max Width",
37
35
  value: "maxWidth",
@@ -29,8 +29,8 @@ function SwipeableDrawerComponent({
29
29
  } = useEditorContext();
30
30
  const classes = DrawerStyles(theme);
31
31
  const handleClose = e => {
32
+ e.stopPropagation();
32
33
  onClose();
33
- e?.stopPropagation();
34
34
  };
35
35
  return /*#__PURE__*/_jsx(Fragment, {
36
36
  children: swipeableDrawer ? /*#__PURE__*/_jsxs(SwipeableDrawer, {
@@ -4,6 +4,7 @@ import { convertBase64 } from "../utils/helper";
4
4
  import { uploadFile } from "../service/fileupload";
5
5
  import Icon from "./Icon";
6
6
  import UploadStyles from "../common/ImageSelector/UploadStyles";
7
+ import { useEditorContext } from "../hooks/useMouseMove";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { Fragment as _Fragment } from "react/jsx-runtime";
9
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -18,6 +19,9 @@ const Uploader = props => {
18
19
  const [base64, setBase64] = useState(value?.url);
19
20
  const [fileName, setFileName] = useState("");
20
21
  const [uploading, setUploading] = useState(false);
22
+ const {
23
+ theme
24
+ } = useEditorContext();
21
25
  const handleChange = async e => {
22
26
  const uFile = e.target.files[0];
23
27
  const strImage = await convertBase64(uFile);
@@ -37,6 +41,9 @@ const Uploader = props => {
37
41
  onUploaded(result?.imageURL[0]);
38
42
  }
39
43
  };
44
+ const {
45
+ translation
46
+ } = customProps;
40
47
  const onRemoveBG = () => {
41
48
  setBase64(null);
42
49
  onUploaded("none");
@@ -68,14 +75,14 @@ const Uploader = props => {
68
75
  }), /*#__PURE__*/_jsx(Grid, {
69
76
  className: "removeImageText",
70
77
  onClick: onRemoveBG,
71
- children: "REMOVE"
78
+ children: translation("Remove")
72
79
  })]
73
80
  });
74
81
  default:
75
82
  return /*#__PURE__*/_jsx(Grid, {
76
83
  className: "removeImageText",
77
84
  onClick: onRemoveBG,
78
- children: "REMOVE"
85
+ children: translation("Remove")
79
86
  });
80
87
  }
81
88
  };
@@ -83,7 +90,7 @@ const Uploader = props => {
83
90
  children: [/*#__PURE__*/_jsx(Grid, {
84
91
  item: true,
85
92
  xs: 12,
86
- children: uploading ? "Uploading..." : ""
93
+ children: uploading ? translation("uploadingText") : ""
87
94
  }), /*#__PURE__*/_jsx(Grid, {
88
95
  container: true,
89
96
  sx: classes.uploadContainer,
@@ -99,6 +106,10 @@ const Uploader = props => {
99
106
  className: "uploadImageSection",
100
107
  children: base64 ? renderThumb() : /*#__PURE__*/_jsx(Grid, {
101
108
  className: "uploadImageText",
109
+ sx: {
110
+ background: `${theme?.palette?.editor?.inputFieldBgColor}`,
111
+ border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
112
+ },
102
113
  children: /*#__PURE__*/_jsxs(Button, {
103
114
  component: "label",
104
115
  variant: "text",
@@ -116,11 +127,11 @@ const Uploader = props => {
116
127
  onChange: handleChange
117
128
  }), /*#__PURE__*/_jsx(Icon, {
118
129
  icon: "fileUpload"
119
- }), /*#__PURE__*/_jsxs("span", {
130
+ }), /*#__PURE__*/_jsx("span", {
120
131
  style: {
121
132
  paddingLeft: "8px"
122
133
  },
123
- children: ["upload ", title || "image"]
134
+ children: `${translation("upload")} ${translation(title) || translation("image")}`
124
135
  })]
125
136
  })
126
137
  })
@@ -49,15 +49,19 @@ const useCommonStyle = theme => ({
49
49
  fontWeight: "500",
50
50
  fontFamily: "Inter, sans-serif"
51
51
  },
52
+ "& .MuiPaper-root": {
53
+ border: `unset !important`,
54
+ borderRadius: "0px",
55
+ height: "fit-content",
56
+ padding: "2px"
57
+ },
52
58
  "& p": {
53
59
  marginBottom: "7px",
54
60
  marginTop: "4px"
55
61
  },
56
- "& .MuiPaper-root": {
57
- border: 'unset !important',
58
- borderRadius: '0px',
59
- height: 'fit-content',
60
- padding: '2px'
62
+ "& p": {
63
+ marginBottom: "7px",
64
+ marginTop: "4px"
61
65
  },
62
66
  "& .muiIconsListParent": {
63
67
  "& svg": {
@@ -65,15 +69,12 @@ const useCommonStyle = theme => ({
65
69
  },
66
70
  "&::-webkit-scrollbar-thumb": {
67
71
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
68
- },
69
- "&::-webkit-scrollbar-track": {
70
- visibility: "hidden"
71
72
  }
72
73
  },
73
74
  "& .MuiGrid-root>.MuiGrid-item": {
74
75
  paddingRight: "0px !important",
75
76
  fontFamily: "Inter, sans-serif",
76
- height: 'fit-content'
77
+ height: "fit-content"
77
78
  },
78
79
  "& .MuiInputBase-root": {
79
80
  borderRadius: "10px",
@@ -134,14 +135,14 @@ const useCommonStyle = theme => ({
134
135
  borderRadius: "10px",
135
136
  width: "46px !important",
136
137
  marginLeft: "10px",
137
- height: '36px !important'
138
+ height: "36px !important"
138
139
  },
139
140
  "& .spacingSlider": {
140
141
  width: "calc(100% - 18px)"
141
142
  }
142
143
  },
143
- '& .MuiFormHelperText-root': {
144
- margin: '4px 0px 0px 0px',
144
+ "& .MuiFormHelperText-root": {
145
+ margin: "4px 0px 0px 0px",
145
146
  color: theme?.palette?.editor?.closeButtonSvgStroke,
146
147
  fontFamily: "Inter, sans-serif"
147
148
  }
@@ -249,6 +250,16 @@ const useCommonStyle = theme => ({
249
250
  backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
250
251
  color: theme?.palette?.editor?.textColor
251
252
  }
253
+ },
254
+ "& .colorPickerActionBtns": {
255
+ backgroundColor: theme?.palette?.editor?.background,
256
+ display: "flex",
257
+ justifyContent: "end",
258
+ padding: "10px",
259
+ position: "sticky",
260
+ bottom: 0,
261
+ right: 0,
262
+ boxShadow: "0px -3px 12px 0px #00000017"
252
263
  }
253
264
  },
254
265
  colorPickerBtnBorder: {
@@ -397,14 +408,14 @@ const useCommonStyle = theme => ({
397
408
  padding: "8px 12px",
398
409
  fontSize: "12px",
399
410
  color: theme?.palette?.editor?.menuOptionTextColor,
400
- fontWeight: '500',
411
+ fontWeight: "500",
401
412
  fontFamily: "Inter, sans-serif",
402
- minHeight: '36px',
413
+ minHeight: "36px",
403
414
  "&:hover": {
404
415
  backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
405
416
  }
406
417
  },
407
- '& .Mui-selected': {
418
+ "& .Mui-selected": {
408
419
  background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
409
420
  },
410
421
  "& .MuiListSubheader-root": {
@@ -413,16 +424,16 @@ const useCommonStyle = theme => ({
413
424
  fontSize: "12px"
414
425
  },
415
426
  "& .MuiPaper-root": {
416
- borderRadius: '8px',
417
- padding: '0px',
427
+ borderRadius: "8px",
428
+ padding: "0px",
418
429
  background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
419
430
  },
420
- '& .MuiButtonBase-root': {
421
- margin: '4px',
422
- borderRadius: '6px'
431
+ "& .MuiButtonBase-root": {
432
+ margin: "4px",
433
+ borderRadius: "6px"
423
434
  },
424
- '& .MuiList-root': {
425
- padding: '0px'
435
+ "& .MuiList-root": {
436
+ padding: "0px"
426
437
  }
427
438
  },
428
439
  datePicker: {
@@ -522,27 +533,27 @@ const useCommonStyle = theme => ({
522
533
  }
523
534
  }
524
535
  },
525
- pageSettingPopUpRoot: {
526
- padding: "16px 8px 16px 10px!important",
527
- height: "100%"
528
- },
529
536
  buttonMoreOption: {
530
537
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
531
538
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
532
- padding: '4px !important',
533
- '& svg': {
534
- width: '18px !important',
535
- height: '18px !important',
536
- '& path': {
539
+ padding: "4px !important",
540
+ "& svg": {
541
+ width: "18px !important",
542
+ height: "18px !important",
543
+ "& path": {
537
544
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
538
545
  }
539
546
  }
540
547
  },
548
+ pageSettingPopUpRoot: {
549
+ padding: "16px 8px 16px 10px!important",
550
+ height: "100%"
551
+ },
541
552
  buttonMoreOption2: {
542
553
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
543
554
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
544
- '& svg': {
545
- '& path': {
555
+ "& svg": {
556
+ "& path": {
546
557
  fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
547
558
  }
548
559
  }
@@ -550,11 +561,11 @@ const useCommonStyle = theme => ({
550
561
  buttonMoreOption3: {
551
562
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
552
563
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
553
- padding: '5px !important',
554
- '& svg': {
555
- width: '16px !important',
556
- height: '16px !important',
557
- '& path': {
564
+ padding: "5px !important",
565
+ "& svg": {
566
+ width: "16px !important",
567
+ height: "16px !important",
568
+ "& path": {
558
569
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
559
570
  }
560
571
  }
@@ -562,37 +573,37 @@ const useCommonStyle = theme => ({
562
573
  resizeButton: {
563
574
  background: theme?.palette?.editor?.aiInputBackground,
564
575
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
565
- padding: '5px !important',
566
- borderRadius: '50% !important',
567
- '& svg': {
568
- width: '18px',
569
- height: '18px',
570
- '& path': {
576
+ padding: "5px !important",
577
+ borderRadius: "50% !important",
578
+ "& svg": {
579
+ width: "18px",
580
+ height: "18px",
581
+ "& path": {
571
582
  fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
572
583
  }
573
584
  },
574
- '&:hover': {
585
+ "&:hover": {
575
586
  background: theme?.palette?.editor?.aiInputBackground
576
587
  }
577
588
  },
578
589
  gradientFillBtn: {
579
590
  background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
580
- textTransform: 'math-auto !important',
581
- color: '#FFFFFF !important',
582
- padding: '0px 12px !important',
583
- height: '32px',
584
- borderRadius: '8px',
585
- fontWeight: '500',
586
- fontSize: '14px'
591
+ textTransform: "math-auto !important",
592
+ color: "#FFFFFF !important",
593
+ padding: "0px 12px !important",
594
+ height: "32px",
595
+ borderRadius: "8px",
596
+ fontWeight: "500",
597
+ fontSize: "14px"
587
598
  },
588
599
  emptyThumbBtn: {
589
600
  background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
590
601
  color: `${theme?.palette?.editor?.textColor} !important`,
591
- fontSize: '14px !important',
592
- '& svg': {
593
- width: '20px !important',
594
- height: '20px !important',
595
- '& path': {
602
+ fontSize: "14px !important",
603
+ "& svg": {
604
+ width: "20px !important",
605
+ height: "20px !important",
606
+ "& path": {
596
607
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
597
608
  }
598
609
  }