@flozy/editor 9.5.7 → 9.5.9

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 +26 -19
  2. package/dist/Editor/CommonEditor.js +139 -22
  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 +4 -2
  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 +31 -14
  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 +7 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +425 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  35. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +25 -5
  36. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +7 -2
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  38. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  39. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  40. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  42. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  44. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  45. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  46. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +64 -38
  47. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  48. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  49. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  50. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +4 -1
  51. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  52. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  53. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  54. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  55. package/dist/Editor/Elements/DataView/styles.js +13 -0
  56. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  57. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  58. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  59. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  60. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  61. package/dist/Editor/Elements/Embed/Image.js +16 -11
  62. package/dist/Editor/Elements/Embed/Video.js +9 -6
  63. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  64. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  65. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  66. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  67. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  68. package/dist/Editor/Elements/Form/Form.js +12 -9
  69. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  70. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  71. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  72. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  73. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  74. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  75. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  76. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  77. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  78. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +23 -4
  79. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  80. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +36 -5
  81. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  82. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  83. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  84. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  85. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  86. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  87. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  88. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  89. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  90. package/dist/Editor/Elements/Link/Link.js +8 -5
  91. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  92. package/dist/Editor/Elements/List/CheckList.js +14 -9
  93. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  94. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  95. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  96. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  97. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  98. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  99. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  100. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  101. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  102. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  103. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  104. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  105. package/dist/Editor/Elements/Table/Table.js +23 -11
  106. package/dist/Editor/Elements/Table/TableCell.js +2 -24
  107. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  108. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  109. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  110. package/dist/Editor/Elements/Title/title.js +10 -0
  111. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  112. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  113. package/dist/Editor/MiniEditor.js +10 -3
  114. package/dist/Editor/Styles/EditorStyles.js +5 -5
  115. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  116. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  117. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  118. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  119. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  120. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  121. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -3
  122. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  123. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  124. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  128. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  129. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  130. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  131. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  132. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  133. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  134. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  135. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  136. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  137. package/dist/Editor/Toolbar/PopupTool/index.js +18 -8
  138. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  139. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  140. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  141. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  142. package/dist/Editor/common/ColorPickerButton.js +39 -14
  143. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  144. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  145. package/dist/Editor/common/CustomDialog/index.js +8 -10
  146. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  147. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  148. package/dist/Editor/common/CustomSelect.js +43 -0
  149. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  150. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  151. package/dist/Editor/common/Icon.js +46 -1
  152. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  153. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  154. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  155. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  156. package/dist/Editor/common/LinkSettings/index.js +20 -14
  157. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  158. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  159. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  160. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  161. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  162. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  163. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  171. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  172. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  173. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  174. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  175. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  176. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +20 -8
  177. package/dist/Editor/common/RnD/Utils/gridDropItem.js +56 -7
  178. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +117 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +281 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +188 -105
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +123 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +59 -7
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +74 -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/menusArray.js +9 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  213. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  214. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  215. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  216. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  217. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  218. package/dist/Editor/common/Uploader.js +16 -5
  219. package/dist/Editor/commonStyle.js +68 -57
  220. package/dist/Editor/helper/index.js +35 -15
  221. package/dist/Editor/helper/textIndeces.js +58 -0
  222. package/dist/Editor/helper/theme.js +202 -2
  223. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  224. package/dist/Editor/hooks/useDrag.js +16 -10
  225. package/dist/Editor/hooks/useEditorScroll.js +10 -5
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +25 -13
  228. package/dist/Editor/hooks/useTable.js +1 -1
  229. package/dist/Editor/hooks/useThemeValues.js +63 -0
  230. package/dist/Editor/plugins/withEmbeds.js +1 -1
  231. package/dist/Editor/plugins/withHTML.js +10 -7
  232. package/dist/Editor/plugins/withLayout.js +3 -2
  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 +167 -48
  252. package/dist/Editor/utils/draftToSlate.js +3 -2
  253. package/dist/Editor/utils/font.js +40 -37
  254. package/dist/Editor/utils/freegrid.js +2 -2
  255. package/dist/Editor/utils/helper.js +90 -19
  256. package/package.json +2 -2
@@ -1,22 +1,49 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useEffect, useMemo, useState } from "react";
2
2
  import { Grid, TextField, InputAdornment, Typography, Tooltip } from "@mui/material";
3
3
  import ColorPickerButton from "../../ColorPickerButton";
4
+ import { getVariableValue } from "../../../helper/theme";
5
+ import { useButtonStyle } from "../../../hooks/useThemeValues";
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
5
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const MAP_STYLE_PROPS = {
9
+ bgColor: "background-color",
10
+ textColor: "color"
11
+ };
6
12
  const Color = props => {
7
13
  const {
8
- value,
14
+ value: val,
9
15
  data,
10
16
  onChange,
11
- classes
17
+ classes,
18
+ elementProps,
19
+ handleClose,
20
+ customProps
12
21
  } = props;
13
22
  const {
14
23
  key,
15
24
  label,
16
25
  hideGradient
17
26
  } = data;
27
+ const {
28
+ translation
29
+ } = customProps;
18
30
  const [recentColors, setRecentColors] = useState({});
19
- const getLable = label === 'Text' ? 'Select text color' : label === 'Background' ? 'Select background color' : label;
31
+ const {
32
+ buttonStyle
33
+ } = useButtonStyle(val, key, elementProps);
34
+ const newValue = buttonStyle?.color;
35
+ const {
36
+ value,
37
+ inputValue
38
+ } = useMemo(() => {
39
+ const isVariable = newValue && newValue.startsWith("var");
40
+ const inputValue = isVariable ? getVariableValue(newValue) : newValue;
41
+ return {
42
+ value: newValue,
43
+ inputValue: inputValue
44
+ };
45
+ }, [buttonStyle?.color]);
46
+ const getLable = label === "Text" ? translation("selectTextColor") : label === "Background" ? translation("selectBgColor") : translation(label);
20
47
  useEffect(() => {
21
48
  const storedColors = JSON.parse(localStorage.getItem("recentColors"));
22
49
  if (storedColors) {
@@ -54,27 +81,27 @@ const Color = props => {
54
81
  fontSize: "14px",
55
82
  fontWeight: 500,
56
83
  marginBottom: "5px",
57
- display: 'flex',
58
- alignItems: 'center',
59
- '& svg': {
60
- width: '20px',
61
- height: '20px'
84
+ display: "flex",
85
+ alignItems: "center",
86
+ "& svg": {
87
+ width: "20px",
88
+ height: "20px"
62
89
  }
63
90
  },
64
- children: [label, data?.infoIcon ? /*#__PURE__*/_jsx(Tooltip, {
91
+ children: [translation(label), data?.infoIcon ? /*#__PURE__*/_jsx(Tooltip, {
65
92
  arrow: true,
66
- title: "Note: If color gradient is used, divider styles will not apply",
93
+ title: translation("noteText"),
67
94
  children: /*#__PURE__*/_jsx("span", {
68
95
  style: {
69
- display: 'inline-block'
96
+ display: "inline-block"
70
97
  },
71
98
  children: data?.infoIcon
72
99
  })
73
100
  }) : null]
74
101
  }), /*#__PURE__*/_jsx(TextField, {
75
102
  fullWidth: true,
76
- value: value,
77
- placeholder: getLable || `${label} color code`,
103
+ value: inputValue,
104
+ placeholder: getLable || `${label} ${translation("color code")}`,
78
105
  InputLabelProps: {
79
106
  shrink: true
80
107
  },
@@ -86,6 +113,8 @@ const Color = props => {
86
113
  value: value,
87
114
  onSave: onSave,
88
115
  recentColors: recentColors[key],
116
+ handleClose: handleClose,
117
+ disableEditTheme: customProps?.disableEditTheme,
89
118
  hideGradient: hideGradient
90
119
  })
91
120
  })
@@ -7,8 +7,12 @@ const ElementSize = 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
  } = data;
@@ -45,13 +49,13 @@ const ElementSize = props => {
45
49
  fontWeight: "500",
46
50
  marginBottom: "5px"
47
51
  },
48
- children: "Width"
52
+ children: translation("Width")
49
53
  }), /*#__PURE__*/_jsx(TextField, {
50
54
  fullWidth: true,
51
55
  name: wkey,
52
56
  size: "small",
53
57
  value: value ? value[wkey] : "100",
54
- placeholder: "Width",
58
+ placeholder: translation("Width"),
55
59
  onChange: handleChange,
56
60
  InputProps: {
57
61
  endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
@@ -97,14 +101,14 @@ const ElementSize = props => {
97
101
  fontWeight: "500",
98
102
  marginBottom: "5px"
99
103
  },
100
- children: "Height"
104
+ children: translation("Height")
101
105
  }), /*#__PURE__*/_jsx(TextField, {
102
106
  fullWidth: true,
103
107
  name: "height",
104
108
  size: "small",
105
109
  value: value?.height,
106
- placeholder: "Height",
107
- helperText: "Leave it to auto if width is in % ",
110
+ placeholder: translation("Height"),
111
+ helperText: translation("heightHelperText"),
108
112
  onChange: handleChange,
109
113
  InputProps: {
110
114
  endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
@@ -1,19 +1,30 @@
1
- import React from "react";
1
+ import React, { useMemo } from "react";
2
2
  import { TextField, IconButton, Grid, Typography } from "@mui/material";
3
3
  import { sizeMap } from "../../../utils/font.js";
4
4
  import { TextMinusIcon, TextPlusIcon } from "../../../common/iconslist.js";
5
+ import { getElementStyle } from "../../../helper/theme.js";
6
+ import { useSlateStatic } from "slate-react";
5
7
  import { jsx as _jsx } from "react/jsx-runtime";
6
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
9
  const FontSize = props => {
8
10
  const {
9
- value,
11
+ value: val,
10
12
  data,
11
- onChange
13
+ onChange,
14
+ elementProps,
15
+ customProps
12
16
  } = props;
13
17
  const {
14
18
  key,
15
19
  width
16
20
  } = data;
21
+ const editor = useSlateStatic();
22
+ const value = useMemo(() => {
23
+ return getElementStyle(editor, elementProps, "font-size") || val;
24
+ }, [editor, val]);
25
+ const {
26
+ translation
27
+ } = customProps;
17
28
  const handleChange = e => {
18
29
  let inc = parseInt(e.target.value) || 16;
19
30
  inc = inc > 200 ? 200 : inc;
@@ -24,7 +35,9 @@ const FontSize = props => {
24
35
  const getSizeVal = () => {
25
36
  try {
26
37
  const size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
27
- return parseInt(size || 16);
38
+ const defaultSize = 16;
39
+ const val = parseInt(size || defaultSize);
40
+ return isNaN(val) ? defaultSize : val;
28
41
  } catch (err) {
29
42
  return "";
30
43
  }
@@ -58,7 +71,7 @@ const FontSize = props => {
58
71
  fontSize: "14px",
59
72
  fontWeight: "500"
60
73
  },
61
- children: data?.label
74
+ children: translation(data?.label)
62
75
  })
63
76
  }), /*#__PURE__*/_jsx(Grid, {
64
77
  item: true,
@@ -73,7 +86,7 @@ const FontSize = props => {
73
86
  size: "small",
74
87
  inputProps: {
75
88
  style: {
76
- // textAlign: "center",
89
+ // textAlign: "center",
77
90
  padding: "11px"
78
91
  }
79
92
  },
@@ -8,8 +8,12 @@ const GridSize = props => {
8
8
  const {
9
9
  value: val,
10
10
  data,
11
- onChange
11
+ onChange,
12
+ customProps
12
13
  } = props;
14
+ const {
15
+ translation
16
+ } = customProps;
13
17
  const {
14
18
  key
15
19
  } = data;
@@ -34,7 +38,7 @@ const GridSize = props => {
34
38
  fontWeight: 500,
35
39
  marginBottom: "5px"
36
40
  },
37
- children: [data?.label || "Grid Size", ": ", value || 12]
41
+ children: [translation(data?.label) || translation("Grid Size"), ": ", value || 12]
38
42
  }), /*#__PURE__*/_jsx("div", {
39
43
  className: "sld-wrpr",
40
44
  children: /*#__PURE__*/_jsx(Slider, {
@@ -12,6 +12,9 @@ const Icons = props => {
12
12
  onChange,
13
13
  customProps
14
14
  } = props;
15
+ const {
16
+ translation
17
+ } = customProps;
15
18
  const {
16
19
  key
17
20
  } = data;
@@ -58,7 +61,7 @@ const Icons = props => {
58
61
  children: /*#__PURE__*/_jsx(TextField, {
59
62
  fullWidth: true,
60
63
  size: "small",
61
- placeholder: "Search Icons...",
64
+ placeholder: translation("searchIcons"),
62
65
  value: val,
63
66
  onChange: handleChange
64
67
  })
@@ -70,7 +73,7 @@ const Icons = props => {
70
73
  padding: "4px"
71
74
  },
72
75
  children: SelectedIcon ? /*#__PURE__*/_jsx(Tooltip, {
73
- title: "Click to Remove",
76
+ title: translation("clickToRemove"),
74
77
  arrow: true,
75
78
  children: /*#__PURE__*/_jsx(IconButton, {
76
79
  onClick: onRemoveIcon,
@@ -14,6 +14,9 @@ const MenusArray = props => {
14
14
  onChange,
15
15
  customProps
16
16
  } = props;
17
+ const {
18
+ translation
19
+ } = customProps;
17
20
  const {
18
21
  key
19
22
  } = data;
@@ -79,7 +82,7 @@ const MenusArray = props => {
79
82
  fontSize: "14px",
80
83
  fontWeight: "500"
81
84
  },
82
- children: "Menu Variant"
85
+ children: translation("Menu Variant")
83
86
  })
84
87
  }), /*#__PURE__*/_jsxs(RadioGroup, {
85
88
  row: true,
@@ -98,7 +101,7 @@ const MenusArray = props => {
98
101
  sx: {
99
102
  fontSize: "14px"
100
103
  },
101
- children: "Stacked"
104
+ children: translation("Stacked")
102
105
  })
103
106
  }), /*#__PURE__*/_jsx(FormControlLabel, {
104
107
  value: "drawer",
@@ -110,7 +113,7 @@ const MenusArray = props => {
110
113
  sx: {
111
114
  fontSize: "14px"
112
115
  },
113
- children: "Drawer"
116
+ children: translation("Drawer")
114
117
  })
115
118
  })]
116
119
  })]
@@ -141,7 +144,7 @@ const MenusArray = props => {
141
144
  fullWidth: true,
142
145
  disabled: true
143
146
  }), /*#__PURE__*/_jsx(Tooltip, {
144
- title: "Link Settings",
147
+ title: translation("Link Settings"),
145
148
  arrow: true,
146
149
  children: /*#__PURE__*/_jsx(IconButton, {
147
150
  onClick: () => setOpenNav({
@@ -151,7 +154,7 @@ const MenusArray = props => {
151
154
  children: /*#__PURE__*/_jsx(Settings, {})
152
155
  })
153
156
  }), /*#__PURE__*/_jsx(Tooltip, {
154
- title: "Delete Menu",
157
+ title: translation("Delete Menu"),
155
158
  arrow: true,
156
159
  children: /*#__PURE__*/_jsx(IconButton, {
157
160
  onClick: onDelete(i),
@@ -167,7 +170,7 @@ const MenusArray = props => {
167
170
  sx: {
168
171
  fontWeight: 700
169
172
  },
170
- children: "+ Add"
173
+ children: translation("addTextIcon")
171
174
  })
172
175
  }), openNav ? /*#__PURE__*/_jsx(LinkSettings, {
173
176
  handleClose: () => setOpenNav(null),
@@ -6,8 +6,12 @@ const MetaDataMapping = props => {
6
6
  const {
7
7
  data,
8
8
  onChange,
9
- elementProps
9
+ elementProps,
10
+ customProps
10
11
  } = props;
12
+ const {
13
+ translation
14
+ } = customProps;
11
15
  const {
12
16
  compType
13
17
  } = data;
@@ -33,7 +37,9 @@ const MetaDataMapping = props => {
33
37
  element: elementProps,
34
38
  value: data?.value,
35
39
  data: updatedData,
36
- onChange: handleCardSelect
40
+ onChange: handleCardSelect,
41
+ customProps: customProps,
42
+ translation: translation
37
43
  }) : null
38
44
  });
39
45
  };
@@ -16,7 +16,8 @@ const SaveAsTemplate = props => {
16
16
  elementProps,
17
17
  handleClose,
18
18
  saveText = "Save As Template",
19
- closeText = ""
19
+ closeText = "",
20
+ translation
20
21
  } = props;
21
22
  const {
22
23
  onSaveTemplate
@@ -93,7 +94,7 @@ const SaveAsTemplate = props => {
93
94
  name: "title",
94
95
  value: template?.title,
95
96
  onChange: onChange,
96
- placeholder: "Template Title",
97
+ placeholder: translation("Template Title"),
97
98
  fullWidth: true,
98
99
  size: "small"
99
100
  })
@@ -114,7 +115,7 @@ const SaveAsTemplate = props => {
114
115
  sx: {
115
116
  fontSize: "14px"
116
117
  },
117
- children: "Element"
118
+ children: translation("Element")
118
119
  })
119
120
  }), /*#__PURE__*/_jsx(MenuItem, {
120
121
  value: "Section",
@@ -124,7 +125,7 @@ const SaveAsTemplate = props => {
124
125
  sx: {
125
126
  fontSize: "14px"
126
127
  },
127
- children: "Section"
128
+ children: translation("Section")
128
129
  })
129
130
  }), /*#__PURE__*/_jsx(MenuItem, {
130
131
  value: "Template",
@@ -134,7 +135,7 @@ const SaveAsTemplate = props => {
134
135
  sx: {
135
136
  fontSize: "14px"
136
137
  },
137
- children: "Template"
138
+ children: translation("Template")
138
139
  })
139
140
  })]
140
141
  })
@@ -144,7 +145,7 @@ const SaveAsTemplate = props => {
144
145
  children: /*#__PURE__*/_jsx(TextField, {
145
146
  fullWidth: true,
146
147
  name: "category",
147
- placeholder: "Category",
148
+ placeholder: translation("Category"),
148
149
  value: template?.category,
149
150
  onChange: onChange,
150
151
  size: "small"
@@ -166,7 +167,7 @@ const SaveAsTemplate = props => {
166
167
  sx: {
167
168
  ...classes.gradientFillBtn
168
169
  },
169
- children: ["Upload file", /*#__PURE__*/_jsx("input", {
170
+ children: [translation("Upload file"), /*#__PURE__*/_jsx("input", {
170
171
  type: "file",
171
172
  style: {
172
173
  opacity: 0,
@@ -184,10 +185,10 @@ const SaveAsTemplate = props => {
184
185
  }), " ", /*#__PURE__*/_jsx(Typography, {
185
186
  variant: "body1",
186
187
  color: "primary",
187
- children: "Remove"
188
+ children: translation("Remove")
188
189
  })]
189
190
  })]
190
- }), uploading ? "Uploading..." : "", /*#__PURE__*/_jsx(Grid, {
191
+ }), uploading ? translation("Uploading...") : "", /*#__PURE__*/_jsx(Grid, {
191
192
  item: true,
192
193
  xs: 12,
193
194
  style: {
@@ -216,7 +217,7 @@ const SaveAsTemplate = props => {
216
217
  }
217
218
  // variant="contained"
218
219
  ,
219
- children: saveText
220
+ children: translation(saveText)
220
221
  }), closeText ? /*#__PURE__*/_jsx(Button, {
221
222
  className: "closebtn",
222
223
  onClick: handleSave,
@@ -224,7 +225,7 @@ const SaveAsTemplate = props => {
224
225
  fontWeight: 700
225
226
  },
226
227
  variant: "contained",
227
- children: closeText
228
+ children: translation(closeText)
228
229
  }) : null]
229
230
  })]
230
231
  });
@@ -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
  }]