@flozy/editor 11.2.3 → 11.2.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 (145) hide show
  1. package/dist/Editor/ChatEditor.js +7 -7
  2. package/dist/Editor/CommonEditor.js +86 -24
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +37 -4
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  8. package/dist/Editor/Elements/Attachments/Attachments.js +239 -11
  9. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +11 -4
  10. package/dist/Editor/Elements/Button/EditorButton.js +32 -44
  11. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  13. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  14. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  15. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
  18. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  19. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  20. package/dist/Editor/Elements/Embed/Embed.js +37 -43
  21. package/dist/Editor/Elements/Embed/Image.js +307 -26
  22. package/dist/Editor/Elements/Embed/Video.js +355 -35
  23. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +9 -6
  24. package/dist/Editor/Elements/EmbedScript/styles.js +17 -1
  25. package/dist/Editor/Elements/Form/FormField.js +1 -1
  26. package/dist/Editor/Elements/Form/Workflow/Styles.js +25 -22
  27. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  28. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +37 -76
  29. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
  30. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
  31. package/dist/Editor/Elements/FreeGrid/helper.js +194 -0
  32. package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
  33. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  34. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  35. package/dist/Editor/Elements/Table/Table.js +2 -1
  36. package/dist/Editor/Elements/Table/TableCell.js +10 -3
  37. package/dist/Editor/Elements/Title/title.js +4 -5
  38. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  39. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  40. package/dist/Editor/Styles/EditorStyles.js +19 -5
  41. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  42. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  43. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  44. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  45. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  46. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +3 -1
  47. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
  48. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  49. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +15 -5
  50. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  51. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +65 -7
  52. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +66 -12
  53. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  54. package/dist/Editor/Toolbar/PopupTool/index.js +6 -4
  55. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  56. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  57. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  58. package/dist/Editor/common/ColorPickerButton.js +38 -19
  59. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  60. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  61. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  62. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  63. package/dist/Editor/common/CustomSelect.js +43 -0
  64. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  65. package/dist/Editor/common/FontLoader/FontLoader.js +1 -0
  66. package/dist/Editor/common/Icon.js +28 -0
  67. package/dist/Editor/common/ImageSelector/ImageSelector.js +66 -13
  68. package/dist/Editor/common/ImageSelector/Options/ChooseAssets.js +1 -1
  69. package/dist/Editor/common/ImageSelector/Options/RecentUploads.js +483 -0
  70. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  71. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  72. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  73. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  74. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  75. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  76. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  77. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
  78. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  80. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +2 -0
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  82. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  83. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  84. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  85. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
  86. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  87. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
  88. package/dist/Editor/common/RnD/VirtualElement/helper.js +248 -68
  89. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  90. package/dist/Editor/common/RnD/index.js +61 -14
  91. package/dist/Editor/common/Shorthands/elements.js +55 -3
  92. package/dist/Editor/common/StyleBuilder/buttonStyle.js +5 -15
  93. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  94. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +13 -3
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +16 -4
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  103. package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
  104. package/dist/Editor/common/StyleBuilder/index.js +10 -19
  105. package/dist/Editor/common/Uploader.js +118 -17
  106. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  107. package/dist/Editor/common/iconslist.js +21 -0
  108. package/dist/Editor/commonStyle.js +111 -53
  109. package/dist/Editor/helper/index.js +4 -1
  110. package/dist/Editor/helper/theme.js +203 -2
  111. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  112. package/dist/Editor/hooks/useMouseMove.js +12 -3
  113. package/dist/Editor/hooks/useTable.js +62 -1
  114. package/dist/Editor/hooks/useThemeValues.js +63 -0
  115. package/dist/Editor/plugins/withEmbeds.js +1 -1
  116. package/dist/Editor/plugins/withHTML.js +56 -3
  117. package/dist/Editor/plugins/withTable.js +1 -1
  118. package/dist/Editor/service/fileTracking.js +22 -0
  119. package/dist/Editor/service/fileupload.js +77 -0
  120. package/dist/Editor/theme/ThemeList.js +50 -173
  121. package/dist/Editor/theme/index.js +149 -0
  122. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  123. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  124. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  125. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  126. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  127. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  128. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  129. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  130. package/dist/Editor/themeSettings/icons.js +60 -0
  131. package/dist/Editor/themeSettings/index.js +380 -0
  132. package/dist/Editor/themeSettings/style.js +299 -0
  133. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  134. package/dist/Editor/themeSettingsAI/index.js +355 -0
  135. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  136. package/dist/Editor/themeSettingsAI/style.js +332 -0
  137. package/dist/Editor/utils/SlateUtilityFunctions.js +165 -40
  138. package/dist/Editor/utils/accordion.js +1 -1
  139. package/dist/Editor/utils/attachments.js +138 -2
  140. package/dist/Editor/utils/button.js +1 -17
  141. package/dist/Editor/utils/font.js +40 -37
  142. package/dist/Editor/utils/formfield.js +2 -2
  143. package/dist/Editor/utils/helper.js +101 -3
  144. package/dist/Editor/utils/insertAppHeader.js +8 -4
  145. package/package.json +1 -1
@@ -4,6 +4,7 @@ import ImageSelector from "../../ImageSelector/ImageSelector";
4
4
  import UploadStyles from "../../ImageSelector/UploadStyles";
5
5
  import Icon from "../../Icon";
6
6
  import { useEditorContext } from "../../../hooks/useMouseMove";
7
+ import { GetPageBgImage } from "../../../utils/helper";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const BackgroundImage = props => {
@@ -11,8 +12,11 @@ const BackgroundImage = props => {
11
12
  value,
12
13
  data,
13
14
  customProps,
14
- onChange
15
+ onChange,
16
+ elementProps,
17
+ title
15
18
  } = props;
19
+ const previewImg = GetPageBgImage(value);
16
20
  const {
17
21
  translation
18
22
  } = customProps;
@@ -25,6 +29,7 @@ const BackgroundImage = props => {
25
29
  theme
26
30
  } = useEditorContext();
27
31
  const classes = UploadStyles(theme);
32
+ const disableProgress = title === "Page Settings" || elementProps?.type === "freegridBox" || elementProps?.type === "freegrid";
28
33
  const onRemoveBG = () => {
29
34
  setBase64(null);
30
35
  onChange({
@@ -44,6 +49,9 @@ const BackgroundImage = props => {
44
49
  });
45
50
  handleClose();
46
51
  };
52
+ const getTitle = () => {
53
+ return elementProps?.type === "image" ? "Image" : elementProps?.type === "video" ? "Video" : null;
54
+ };
47
55
  return /*#__PURE__*/_jsxs(Grid, {
48
56
  item: true,
49
57
  xs: 12,
@@ -63,7 +71,7 @@ const BackgroundImage = props => {
63
71
  item: true,
64
72
  xs: 12,
65
73
  style: {
66
- backgroundImage: base64 ? `url(${base64})` : "none"
74
+ backgroundImage: base64 ? `url(${previewImg})` : "none"
67
75
  // height: "200px",
68
76
  },
69
77
 
@@ -100,7 +108,9 @@ const BackgroundImage = props => {
100
108
  open: open,
101
109
  onClose: handleClose,
102
110
  customProps: customProps,
103
- onSelectImage: onSelectImage
111
+ onSelectImage: onSelectImage,
112
+ title: getTitle(),
113
+ disableProgress: disableProgress
104
114
  })]
105
115
  });
106
116
  };
@@ -3,13 +3,13 @@ import { Checkbox, FormControlLabel, Grid, Slider, Typography, Box, IconButton }
3
3
  import { squreStyle } from "./radiusStyle";
4
4
  import { getBreakPointsValue } from "../../../helper/theme";
5
5
  import useWindowResize from "../../../hooks/useWindowResize";
6
+ import { useEditorTheme } from "../../../hooks/useEditorTheme";
6
7
  import { CheckedBoxCheckIcon } from "../../iconListV2";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const BANNER_SPACING_KEYS = ["top", "left", "right", "bottom"];
10
11
  const BannerSpacing = props => {
11
12
  const {
12
- value: val,
13
13
  data,
14
14
  onChange,
15
15
  elementProps,
@@ -23,7 +23,17 @@ const BannerSpacing = props => {
23
23
  key
24
24
  } = data;
25
25
  const lockKeyVal = `lock${key}`;
26
- let lockSpacing = elementProps[lockKeyVal];
26
+ const {
27
+ selectedTheme
28
+ } = useEditorTheme();
29
+ const {
30
+ bannerSpacing,
31
+ lockbannerSpacing
32
+ } = selectedTheme?.elementProps[elementProps?.type] || {};
33
+ const isUserValue = Object.keys(props?.value || {})?.length;
34
+ const isUserLockedSpacing = typeof elementProps[lockKeyVal] === "boolean";
35
+ const val = isUserValue ? props?.value : bannerSpacing;
36
+ let lockSpacing = isUserLockedSpacing ? elementProps[lockKeyVal] : lockbannerSpacing;
27
37
  if (lockSpacing === undefined) {
28
38
  lockSpacing = true;
29
39
  }
@@ -3,13 +3,13 @@ import { Grid, Typography, Slider, FormControlLabel, Checkbox, Box, IconButton }
3
3
  import { radiusStyle } from "./radiusStyle";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
5
  import { getBreakPointsValue, getCustomizationValue } from "../../../helper/theme";
6
+ import { useEditorTheme } from "../../../hooks/useEditorTheme";
6
7
  import { CheckedBoxCheckIcon } from "../../iconListV2";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const BORDER_RADIUS_KEYS = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
10
11
  const BorderRadius = props => {
11
12
  const {
12
- value: val,
13
13
  data,
14
14
  onChange,
15
15
  elementProps,
@@ -19,16 +19,24 @@ const BorderRadius = props => {
19
19
  const {
20
20
  translation
21
21
  } = customProps;
22
- let {
23
- lockRadius
24
- } = elementProps;
25
- if (lockRadius === undefined) {
26
- lockRadius = true;
27
- }
28
22
  const {
29
23
  key
30
24
  } = data;
31
25
  const [size] = useWindowResize();
26
+ const {
27
+ selectedTheme
28
+ } = useEditorTheme();
29
+ const {
30
+ borderRadius,
31
+ lockRadius: themeLockRadius
32
+ } = selectedTheme?.elementProps[elementProps?.type] || {};
33
+ const isUserValue = Object.keys(props?.value || {})?.length;
34
+ const isUserLockedRadius = typeof elementProps?.lockRadius === "boolean";
35
+ const val = isUserValue ? props?.value : borderRadius;
36
+ let lockRadius = isUserLockedRadius ? elementProps?.lockRadius : themeLockRadius;
37
+ if (lockRadius === undefined) {
38
+ lockRadius = true;
39
+ }
32
40
  const value = getBreakPointsValue(val, size?.device);
33
41
  const handleChange = e => {
34
42
  let changeAll = {};
@@ -1,14 +1,23 @@
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";
6
+
7
+ // const MAP_STYLE_PROPS = {
8
+ // bgColor: "background-color",
9
+ // textColor: "color",
10
+ // };
4
11
  import { jsx as _jsx } from "react/jsx-runtime";
5
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
13
  const Color = props => {
7
14
  const {
8
- value,
15
+ value: val,
9
16
  data,
10
17
  onChange,
11
18
  classes,
19
+ elementProps,
20
+ handleClose,
12
21
  customProps
13
22
  } = props;
14
23
  const {
@@ -20,7 +29,22 @@ const Color = props => {
20
29
  translation
21
30
  } = customProps;
22
31
  const [recentColors, setRecentColors] = useState({});
23
- const getLable = label === 'Text' ? translation("selectTextColor") : label === 'Background' ? translation("selectBgColor") : translation(label);
32
+ const {
33
+ buttonStyle
34
+ } = useButtonStyle(val, key, elementProps);
35
+ const newValue = buttonStyle?.color;
36
+ const {
37
+ value,
38
+ inputValue
39
+ } = useMemo(() => {
40
+ const isVariable = newValue && newValue.startsWith("var");
41
+ const inputValue = isVariable ? getVariableValue(newValue) : newValue;
42
+ return {
43
+ value: newValue,
44
+ inputValue: inputValue
45
+ };
46
+ }, [buttonStyle?.color]);
47
+ const getLable = label === "Text" ? translation("selectTextColor") : label === "Background" ? translation("selectBgColor") : translation(label);
24
48
  useEffect(() => {
25
49
  const storedColors = JSON.parse(localStorage.getItem("recentColors"));
26
50
  if (storedColors) {
@@ -58,11 +82,11 @@ const Color = props => {
58
82
  fontSize: "14px",
59
83
  fontWeight: 500,
60
84
  marginBottom: "5px",
61
- display: 'flex',
62
- alignItems: 'center',
63
- '& svg': {
64
- width: '20px',
65
- height: '20px'
85
+ display: "flex",
86
+ alignItems: "center",
87
+ "& svg": {
88
+ width: "20px",
89
+ height: "20px"
66
90
  }
67
91
  },
68
92
  children: [translation(label), data?.infoIcon ? /*#__PURE__*/_jsx(Tooltip, {
@@ -70,14 +94,14 @@ const Color = props => {
70
94
  title: translation("noteText"),
71
95
  children: /*#__PURE__*/_jsx("span", {
72
96
  style: {
73
- display: 'inline-block'
97
+ display: "inline-block"
74
98
  },
75
99
  children: data?.infoIcon
76
100
  })
77
101
  }) : null]
78
102
  }), /*#__PURE__*/_jsx(TextField, {
79
103
  fullWidth: true,
80
- value: value,
104
+ value: inputValue,
81
105
  placeholder: getLable || `${label} ${translation("color code")}`,
82
106
  InputLabelProps: {
83
107
  shrink: true
@@ -90,6 +114,8 @@ const Color = props => {
90
114
  value: value,
91
115
  onSave: onSave,
92
116
  recentColors: recentColors[key],
117
+ handleClose: handleClose,
118
+ disableEditTheme: customProps?.disableEditTheme,
93
119
  hideGradient: hideGradient
94
120
  })
95
121
  })
@@ -1,14 +1,17 @@
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
13
  onChange,
14
+ elementProps,
12
15
  customProps
13
16
  } = props;
14
17
  const {
@@ -18,6 +21,10 @@ const FontSize = props => {
18
21
  key,
19
22
  width
20
23
  } = data;
24
+ const editor = useSlateStatic();
25
+ const value = useMemo(() => {
26
+ return val || getElementStyle(editor, elementProps, "font-size");
27
+ }, [editor, val]);
21
28
  const handleChange = e => {
22
29
  let inc = parseInt(e.target.value) || 16;
23
30
  inc = inc > 200 ? 200 : inc;
@@ -28,7 +35,9 @@ const FontSize = props => {
28
35
  const getSizeVal = () => {
29
36
  try {
30
37
  const size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
31
- return parseInt(size || 16);
38
+ const defaultSize = 16;
39
+ const val = parseInt(size || defaultSize);
40
+ return isNaN(val) ? defaultSize : val;
32
41
  } catch (err) {
33
42
  return "";
34
43
  }
@@ -77,7 +86,7 @@ const FontSize = props => {
77
86
  size: "small",
78
87
  inputProps: {
79
88
  style: {
80
- // textAlign: "center",
89
+ // textAlign: "center",
81
90
  padding: "11px"
82
91
  }
83
92
  },
@@ -129,6 +129,7 @@ const MenusArray = props => {
129
129
  className: "menu-item-app-header",
130
130
  children: [/*#__PURE__*/_jsx(TextField, {
131
131
  name: "text",
132
+ placeholder: m?.placeholder || "text",
132
133
  type: "text",
133
134
  value: m.text,
134
135
  onChange: handleChange(i),
@@ -140,6 +141,7 @@ const MenusArray = props => {
140
141
  }), /*#__PURE__*/_jsx(TextField, {
141
142
  name: "url",
142
143
  type: "text",
144
+ placeholder: m?.placeholder || "url",
143
145
  value: m.url,
144
146
  onChange: handleChange(i),
145
147
  size: "small",
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
  import { Grid, TextField, Typography } from "@mui/material";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -20,6 +20,17 @@ const Text = props => {
20
20
  } = data;
21
21
  const [value, setValue] = useState(pro_value);
22
22
  const [error, setError] = useState(false);
23
+ useEffect(() => {
24
+ if (["sectionBackgroundImage", "pageBgImage"].includes(key)) {
25
+ let bgUrl = "";
26
+ if (typeof props?.value === "string" && props?.value !== "none") {
27
+ bgUrl = props.value;
28
+ } else if (props?.value?.embedURL) {
29
+ bgUrl = props.value.embedURL;
30
+ }
31
+ setValue(bgUrl);
32
+ }
33
+ }, [props?.value]);
23
34
  const handleChange = e => {
24
35
  const newValue = e.target.value;
25
36
  setValue(newValue);
@@ -35,6 +46,7 @@ const Text = props => {
35
46
  return /*#__PURE__*/_jsxs(Grid, {
36
47
  item: true,
37
48
  xs: width || 12,
49
+ className: "text-field-wrapper",
38
50
  children: [/*#__PURE__*/_jsx(Typography, {
39
51
  variant: "body1",
40
52
  color: "primary",
@@ -54,10 +66,10 @@ const Text = props => {
54
66
  fullWidth: true,
55
67
  required: required,
56
68
  error: error,
57
- helperText: error ? translation("This field is required") : '',
69
+ helperText: error ? translation("This field is required") : "",
58
70
  sx: {
59
- '& .MuiFormHelperText-root': {
60
- color: '#d32f2f !important'
71
+ "& .MuiFormHelperText-root": {
72
+ color: "#d32f2f !important"
61
73
  }
62
74
  }
63
75
  })]
@@ -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";
@@ -31,14 +31,22 @@ const TextOptions = props => {
31
31
  renderOption,
32
32
  width,
33
33
  webFont = false,
34
- hideMetaDataOptions = false
34
+ hideMetaDataOptions = false,
35
+ themeEnabled
35
36
  } = data;
36
37
  const {
37
38
  fontFamilies
38
39
  } = useEditorContext();
39
- const editor = useSlate();
40
40
  const [size] = useWindowResize();
41
- 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]);
42
50
  const metaDataMappingOptions = metaMappings?.boards || [];
43
51
  const updatedOption = !hideMetaDataOptions && elementProps?.metadatamapping ? [...options, ...metaDataMappingOptions] : webFont ? fontFamilies?.options : options;
44
52
  const handleChange = (e, d) => {
@@ -117,7 +125,7 @@ const TextOptions = props => {
117
125
  editor: editor,
118
126
  format: key,
119
127
  options: fontFamilies.options,
120
- width: '100%',
128
+ width: "100%",
121
129
  onChange: onChange,
122
130
  val: value,
123
131
  webFont: true
@@ -124,19 +124,25 @@ export const formStyle = [{
124
124
  key: "alignment",
125
125
  type: "alignment"
126
126
  }]
127
- }, {
128
- tab: "Background",
129
- value: "backgroundImage",
130
- fields: [{
131
- label: "URL",
132
- key: "backgroundImage",
133
- type: "text"
134
- }, {
135
- label: "Background Image",
136
- key: "backgroundImage",
137
- type: "backgroundImage"
138
- }]
139
- }, {
127
+ },
128
+ // Commented out because the background functionality for forms has not been implemented yet
129
+ // {
130
+ // tab: "Background",
131
+ // value: "backgroundImage",
132
+ // fields: [
133
+ // {
134
+ // label: "URL",
135
+ // key: "backgroundImage",
136
+ // type: "text",
137
+ // },
138
+ // {
139
+ // label: "Background Image",
140
+ // key: "backgroundImage",
141
+ // type: "backgroundImage",
142
+ // },
143
+ // ],
144
+ // },
145
+ {
140
146
  tab: "Add to Boards",
141
147
  value: "metadatamapping",
142
148
  fields: [{
@@ -17,7 +17,8 @@ export const StyleContent = props => {
17
17
  element: propsElement,
18
18
  customProps,
19
19
  handleClose,
20
- customElement
20
+ customElement,
21
+ title
21
22
  } = props;
22
23
  const element = customElement ? customElement : propsElement;
23
24
  const {
@@ -35,19 +36,11 @@ export const StyleContent = props => {
35
36
  fields: []
36
37
  };
37
38
  const filteredFields = (hideTools || [])?.length > 0 ? fields.filter(f => (hideTools || []).indexOf(f.key) === -1) : fields;
38
-
39
- // Apply conditional field visibility
40
- const conditionallyFilteredFields = filteredFields.filter(field => {
41
- if (field.condition && typeof field.condition === 'function') {
42
- return field.condition(element);
43
- }
44
- return true;
45
- });
46
39
  return /*#__PURE__*/_jsx(Grid, {
47
40
  container: true,
48
41
  spacing: 2,
49
42
  className: "sidebar-wrpr-eds",
50
- children: [...conditionallyFilteredFields].map((m, i) => {
43
+ children: [...filteredFields].map((m, i) => {
51
44
  const FieldComponent = FieldMap[m.type];
52
45
  return FieldComponent ? /*#__PURE__*/_jsx(FieldComponent, {
53
46
  data: m,
@@ -57,7 +50,8 @@ export const StyleContent = props => {
57
50
  customProps: customProps,
58
51
  handleClose: handleClose,
59
52
  classes: classes,
60
- translation: translation
53
+ translation: translation,
54
+ title: title
61
55
  }, `ei_stt_tab_${value}_${m.key}_${i}`) : null;
62
56
  })
63
57
  }, value);
@@ -218,19 +212,15 @@ const StyleBuilder = props => {
218
212
  sx: {
219
213
  padding: "5px"
220
214
  },
221
- children: m?.fields.filter(f => (hideTools || []).indexOf(f.value) === -1).filter(field => {
222
- if (field.condition && typeof field.condition === 'function') {
223
- return field.condition(elementProps);
224
- }
225
- return true;
226
- }).map((field, index) => {
215
+ children: m?.fields.filter(f => (hideTools || []).indexOf(f.value) === -1).map((field, index) => {
227
216
  return /*#__PURE__*/_jsx(StyleContent, {
228
217
  renderTabs: [field],
229
218
  value: field.value,
230
219
  element: elementProps,
231
220
  onChange: onElementPropsChange,
232
221
  customProps: customProps,
233
- handleClose: handleClose
222
+ handleClose: handleClose,
223
+ title: title
234
224
  }, `tab_${field.value}_${index}`);
235
225
  })
236
226
  })]
@@ -243,7 +233,8 @@ const StyleBuilder = props => {
243
233
  element: elementProps,
244
234
  onChange: onElementPropsChange,
245
235
  customProps: customProps,
246
- handleClose: handleClose
236
+ handleClose: handleClose,
237
+ title: title
247
238
  }, `tab_${m.value}_$${i}`);
248
239
  }
249
240
  })