@flozy/editor 9.3.1 → 9.3.3

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 (27) hide show
  1. package/dist/Editor/ChatEditor.js +6 -6
  2. package/dist/Editor/CommonEditor.js +5 -2
  3. package/dist/Editor/Editor.css +6 -0
  4. package/dist/Editor/Elements/Color Picker/ColorButtons.js +3 -2
  5. package/dist/Editor/Elements/Color Picker/ColorPicker.js +0 -1
  6. package/dist/Editor/Elements/Color Picker/Styles.js +2 -2
  7. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -3
  8. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +1 -1
  9. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +3 -0
  10. package/dist/Editor/common/ColorPickerButton.js +10 -1
  11. package/dist/Editor/common/CustomColorPicker/index.js +25 -6
  12. package/dist/Editor/common/CustomColorPicker/style.js +1 -1
  13. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
  14. package/dist/Editor/helper/theme.js +4 -4
  15. package/dist/Editor/themeSettings/ActiveTheme.js +4 -4
  16. package/dist/Editor/themeSettings/buttons/index.js +4 -2
  17. package/dist/Editor/themeSettings/buttons/style.js +4 -2
  18. package/dist/Editor/themeSettings/colorTheme/index.js +6 -1
  19. package/dist/Editor/themeSettings/colorTheme/style.js +5 -1
  20. package/dist/Editor/themeSettings/fonts/index.js +4 -2
  21. package/dist/Editor/themeSettings/fonts/style.js +17 -2
  22. package/dist/Editor/themeSettings/index.js +28 -20
  23. package/dist/Editor/themeSettings/style.js +186 -145
  24. package/dist/Editor/themeSettingsAI/index.js +1 -2
  25. package/dist/Editor/themeSettingsAI/saveTheme.js +21 -3
  26. package/dist/Editor/utils/SlateUtilityFunctions.js +10 -3
  27. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo, useRef, useState, useImperativeHandle, forwardRef } from "react";
2
- import { Editable, Slate, ReactEditor } from 'slate-react';
3
- import { createEditor, Transforms, Editor } from 'slate';
2
+ import { Editable, Slate, ReactEditor } from "slate-react";
3
+ import { createEditor, Transforms, Editor } from "slate";
4
4
  import withCommon from "./hooks/withCommon";
5
5
  import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
6
6
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
@@ -34,14 +34,14 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
34
34
  debounceTimeOut = 10,
35
35
  translation,
36
36
  isMarkDown = false,
37
- markDownContent = ''
37
+ markDownContent = ""
38
38
  } = props;
39
39
  const classes = usePopupStyle(theme);
40
40
  const convertedContent = draftToSlate({
41
41
  data: content && content?.length > 0 ? content : [{
42
- type: 'paragraph',
42
+ type: "paragraph",
43
43
  children: [{
44
- text: ''
44
+ text: ""
45
45
  }]
46
46
  }]
47
47
  });
@@ -239,7 +239,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
239
239
  editor
240
240
  });
241
241
  } else if (event.key === "Enter" && !isMobile) {
242
- const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
242
+ const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === "paragraph" && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === "";
243
243
  if (isEmpty) {
244
244
  event.preventDefault();
245
245
  return;
@@ -723,11 +723,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
723
723
  open: openTheme,
724
724
  setOpen: setOpenTheme,
725
725
  editor: editor,
726
- services: otherProps?.services
726
+ services: otherProps?.services,
727
+ appTheme: theme,
728
+ customProps: customProps
727
729
  }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
728
730
  openAITheme: openAITheme,
729
731
  setOpenAITheme: setOpenAITheme,
730
- onSaveTheme: otherProps?.onSaveTheme
732
+ onSaveTheme: otherProps?.onSaveTheme,
733
+ theme: theme
731
734
  })]
732
735
  })
733
736
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -1017,6 +1017,8 @@ blockquote {
1017
1017
  height: 16px;
1018
1018
  border: 2px solid #fff;
1019
1019
  box-shadow: 0px 1px 6px #aaa;
1020
+ top: 50%;
1021
+ transform: translate(-50%, -50%);
1020
1022
  }
1021
1023
  .spacingSlider {
1022
1024
  height: 9px !important;
@@ -1358,3 +1360,7 @@ code.markcode {
1358
1360
  right: 20px;
1359
1361
  z-index: 1000;
1360
1362
  }
1363
+
1364
+ .hyperLink {
1365
+ word-break: break-all;
1366
+ }
@@ -36,8 +36,8 @@ const SingleColorButton = ({
36
36
  width: "100%",
37
37
  display: "flex",
38
38
  alignItems: "center",
39
- padding: padding || "8px 0px",
40
- justifyContent: "center"
39
+ padding: padding || "8px 0px"
40
+ // justifyContent: "center",
41
41
  },
42
42
  children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
43
43
  onClick: handleSelect(m),
@@ -184,6 +184,7 @@ const ColorButtons = props => {
184
184
  Transforms.deselect(editor, {
185
185
  at: editor.selection
186
186
  });
187
+ handleClose();
187
188
  setOpenTheme("editThemeColor");
188
189
  },
189
190
  children: "Edit"
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from "react";
2
2
  import { ReactEditor } from "slate-react";
3
- // import ColorPickerTool from "react-gcolor-picker";
4
3
  import { IconButton, Tooltip, Box, Popover } from "@mui/material";
5
4
  import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
6
5
  import ColorButtons from "./ColorButtons";
@@ -20,7 +20,7 @@ const ColorPickerStyles = theme => ({
20
20
  background: `${theme?.palette?.editor?.miniToolBarBackground}`,
21
21
  border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
22
22
  borderRadius: "7px !important",
23
- padding: "0px 5px",
23
+ padding: "0px 10px",
24
24
  "@media only screen and (max-width: 600px)": {
25
25
  marginTop: "-40px"
26
26
  }
@@ -59,7 +59,7 @@ const ColorPickerStyles = theme => ({
59
59
  width: "24px",
60
60
  height: "24px",
61
61
  margin: "0px 4px",
62
- border: "unset"
62
+ border: "1.5px solid #DCE4EC"
63
63
  }
64
64
  },
65
65
  colorPickerIcon: {
@@ -11,7 +11,7 @@ export const getValue = (editor, format) => {
11
11
  switch (format) {
12
12
  case "fontFamily":
13
13
  {
14
- const style = getSelectedElementStyle("font-family", editor);
14
+ const style = getSelectedElementStyle("font-family", editor, format);
15
15
  return style || defaultFonts[0];
16
16
  }
17
17
  case "fontWeight":
@@ -19,7 +19,7 @@ export const getValue = (editor, format) => {
19
19
  const {
20
20
  options
21
21
  } = fontWeight || {};
22
- const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
22
+ const fontWeightStyle = getSelectedElementStyle("font-weight", editor, format);
23
23
  const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
24
24
  return selected?.value;
25
25
  }
@@ -34,7 +34,7 @@ const Dropdown = ({
34
34
  options,
35
35
  width
36
36
  }) => {
37
- const value = getValue(editor, format);
37
+ const value = activeMark(editor, format, true) || getValue(editor, format);
38
38
  const changeMarkData = (event, format) => {
39
39
  event.preventDefault();
40
40
  const value = event.target.value;
@@ -164,7 +164,7 @@ const TextFormat = props => {
164
164
  children: /*#__PURE__*/_jsx(SelectTypography, {
165
165
  editor: editor,
166
166
  classes: classes,
167
- closeMainPopup: () => {},
167
+ closeMainPopup: closeMainPopup,
168
168
  type: "fullWidth",
169
169
  customProps: customProps
170
170
  })
@@ -291,6 +291,9 @@ function ThemeTextFormat(props) {
291
291
  children: [/*#__PURE__*/_jsx(Button, {
292
292
  onClick: onClose,
293
293
  className: "secondaryBtn",
294
+ style: {
295
+ background: "none"
296
+ },
294
297
  children: "Cancel"
295
298
  }), /*#__PURE__*/_jsx(Button, {
296
299
  onClick: onSaveTextSettings,
@@ -35,7 +35,13 @@ const ColorPickerToolComponent = ({
35
35
  return /*#__PURE__*/_jsxs(Grid, {
36
36
  item: true,
37
37
  xs: 12,
38
+ style: {
39
+ position: "relative"
40
+ },
38
41
  children: [/*#__PURE__*/_jsx("div", {
42
+ style: {
43
+ marginBottom: "50px"
44
+ },
39
45
  children: /*#__PURE__*/_jsx(CustomColorPicker, {
40
46
  gradient: hideGradient ? false : true,
41
47
  color: color,
@@ -50,7 +56,10 @@ const ColorPickerToolComponent = ({
50
56
  style: {
51
57
  display: "flex",
52
58
  justifyContent: "end",
53
- margin: "8px"
59
+ margin: "8px",
60
+ position: "absolute",
61
+ bottom: 0,
62
+ right: 0
54
63
  },
55
64
  children: [/*#__PURE__*/_jsx(Button, {
56
65
  onClick: handleClose,
@@ -2,10 +2,24 @@ import { Box, Button, Paper, Typography, useTheme } from "@mui/material";
2
2
  import ColorPickerTool from "react-gcolor-picker";
3
3
  import customColorPickerStyles from "./style";
4
4
  import { colors } from "../../Elements/Color Picker/defaultColors";
5
- import { useMemo } from "react";
5
+ import { useMemo, useState } from "react";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ const getColors = (colors, colorTab, key) => {
10
+ const newColors = [...new Set(colors)];
11
+ const solidColors = [];
12
+ const gradientColors = [];
13
+ newColors.forEach(color => {
14
+ if (color && color.includes("gradient")) {
15
+ gradientColors.push(color);
16
+ } else {
17
+ solidColors.push(color);
18
+ }
19
+ });
20
+ const showGradientColors = colorTab === "gradient" && key !== "themeColors";
21
+ return showGradientColors ? gradientColors : solidColors;
22
+ };
9
23
  function CustomColorPicker(props) {
10
24
  const {
11
25
  gradient,
@@ -17,6 +31,7 @@ function CustomColorPicker(props) {
17
31
  hideThemeColors,
18
32
  disableEditTheme
19
33
  } = props;
34
+ const [colorTab, setColorTab] = useState("solid");
20
35
  const {
21
36
  setOpenTheme
22
37
  } = useEditorContext();
@@ -27,7 +42,8 @@ function CustomColorPicker(props) {
27
42
  const otherColors = {
28
43
  title: "Recent colours",
29
44
  colors: [...(recentColors || []), ...defaultColors],
30
- onChange: onChange
45
+ onChange: onChange,
46
+ key: "recentColors"
31
47
  };
32
48
  const themeColors = Object.values(colorVars);
33
49
  const tabs = [];
@@ -39,7 +55,8 @@ function CustomColorPicker(props) {
39
55
  closeDrawer();
40
56
  },
41
57
  colors: Object.values(colorVars),
42
- onChange: onChange
58
+ onChange: onChange,
59
+ key: "themeColors"
43
60
  });
44
61
  }
45
62
  tabs.push(otherColors);
@@ -53,13 +70,15 @@ function CustomColorPicker(props) {
53
70
  value: color?.startsWith("var") ? "" : color,
54
71
  onChange: onChange,
55
72
  defaultColors: [],
56
- popupWidth: "300"
73
+ popupWidth: "300",
74
+ onChangeTabs: tab => setColorTab(tab)
57
75
  }), colorTabs.map((tab, i) => {
58
76
  const {
59
77
  title,
60
78
  onEdit,
61
79
  colors = [],
62
- onChange
80
+ onChange,
81
+ key
63
82
  } = tab;
64
83
  return /*#__PURE__*/_jsxs(Box, {
65
84
  component: "div",
@@ -79,7 +98,7 @@ function CustomColorPicker(props) {
79
98
  }), /*#__PURE__*/_jsx(Box, {
80
99
  component: "div",
81
100
  className: "colorPickerBtnContainer",
82
- children: [...new Set(colors)].map((colorVar, i) => {
101
+ children: getColors(colors, colorTab, key).map((colorVar, i) => {
83
102
  const isSelected = colorVar === color;
84
103
  return /*#__PURE__*/_jsx(Box, {
85
104
  className: isSelected ? "colorPicketBtnActive" : "",
@@ -29,7 +29,7 @@ const styles = () => ({
29
29
  ".colorPickerBtnContainer": {
30
30
  display: "flex",
31
31
  flexWrap: "wrap",
32
- gap: "8px"
32
+ gap: "6px"
33
33
  },
34
34
  ".colorPicketBtn": {
35
35
  width: "26px",
@@ -9,6 +9,7 @@ const TextSettings = props => {
9
9
  editor,
10
10
  path,
11
11
  theme,
12
+ onClose,
12
13
  customProps
13
14
  } = props;
14
15
  const item_path = path.split("|").map(m => parseInt(m));
@@ -27,7 +28,8 @@ const TextSettings = props => {
27
28
  return /*#__PURE__*/_jsx(TextFormat, {
28
29
  classes: classes,
29
30
  editor: editor,
30
- customProps: customProps
31
+ customProps: customProps,
32
+ closeMainPopup: onClose
31
33
  });
32
34
  };
33
35
  export default TextSettings;
@@ -199,11 +199,11 @@ export const isTextCustomized = editor => {
199
199
  if (!themeElements.includes(type)) {
200
200
  return false;
201
201
  }
202
- if (children?.length > 1) {
202
+ if (!children?.length) {
203
203
  return true;
204
204
  }
205
205
  const customized = textThemeFields.some(field => {
206
- const element = children[0] || {};
206
+ const element = children.find(child => child.text.trim() !== "") || {};
207
207
  const value = element[field];
208
208
  if (field === "fontSize") {
209
209
  return Object.keys(value || {}).length;
@@ -279,12 +279,12 @@ export const saveToTheme = editor => {
279
279
  const {
280
280
  children
281
281
  } = currentElement;
282
- if (children?.length > 1) {
282
+ if (!children?.length) {
283
283
  return true;
284
284
  }
285
285
  let theme = {};
286
286
  textThemeFields.forEach(field => {
287
- const element = children[0] || {};
287
+ const element = children.find(child => child.text.trim() !== "") || {};
288
288
  const value = element[field];
289
289
  let style = {};
290
290
  let isValueExist = false;
@@ -23,7 +23,7 @@ function ActiveTheme(props) {
23
23
  className: "activeThemeInnner",
24
24
  children: [/*#__PURE__*/_jsx(Typography, {
25
25
  variant: "body1",
26
- className: "title",
26
+ className: "title activeThemeTitle",
27
27
  children: id ? "Active Theme" : "No theme activated"
28
28
  }), /*#__PURE__*/_jsxs(Grid, {
29
29
  className: "flexAlign",
@@ -33,16 +33,16 @@ function ActiveTheme(props) {
33
33
  children: name
34
34
  }), /*#__PURE__*/_jsxs(Typography, {
35
35
  variant: "body2",
36
- color: "textSecondary",
37
- className: "fs-12",
36
+ className: "fs-12 textSecondary",
38
37
  style: {
39
- marginLeft: "4px"
38
+ marginLeft: id ? "4px" : "0px"
40
39
  },
41
40
  children: [id ? ` - ` : null, id ? mood_name : "Select 'Explore More' to activate a theme and customize your design."]
42
41
  })]
43
42
  }), /*#__PURE__*/_jsxs(Grid, {
44
43
  container: true,
45
44
  justifyContent: "space-between",
45
+ alignItems: "end",
46
46
  sx: {
47
47
  mt: 1
48
48
  },
@@ -185,7 +185,8 @@ function convertThemeToElementProps(button = {}, buttonEl) {
185
185
 
186
186
  const Buttons = props => {
187
187
  const {
188
- className
188
+ className,
189
+ customProps
189
190
  } = props;
190
191
  const [anchorEl, setAnchorEl] = useState();
191
192
  const {
@@ -272,7 +273,8 @@ const Buttons = props => {
272
273
  },
273
274
  renderTabs: buttonStyle,
274
275
  customProps: {
275
- disableEditTheme: true
276
+ disableEditTheme: true,
277
+ translation: customProps?.translation || (() => {})
276
278
  }
277
279
  })
278
280
  })
@@ -1,10 +1,12 @@
1
- const Style = () => ({
1
+ const Style = ({
2
+ appTheme
3
+ }) => ({
2
4
  ".buttonTypeItem": {
3
5
  padding: "8px 10px",
4
6
  width: "calc(100% + 20px)",
5
7
  margin: "0 -10px",
6
8
  "&:hover": {
7
- background: "#ECF2FF",
9
+ background: appTheme?.palette?.editor?.tv_hover_bg,
8
10
  ".editIcon": {
9
11
  opacity: "1",
10
12
  visibility: "visible"
@@ -10,6 +10,7 @@ import { ChevronLeft } from "@mui/icons-material";
10
10
  import { EditIcon } from "../icons";
11
11
  import ColorPickerButton from "../../common/ColorPickerButton";
12
12
  import { getContrastColor } from "../../utils/helper";
13
+ import useCommonStyle from "../../commonStyle";
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const ColorTheme = props => {
@@ -17,8 +18,10 @@ const ColorTheme = props => {
17
18
  className,
18
19
  colors,
19
20
  onColorChange,
20
- openDefault
21
+ openDefault,
22
+ appTheme
21
23
  } = props;
24
+ const classes = useCommonStyle(appTheme);
22
25
  const {
23
26
  primaryColors,
24
27
  otherColors = []
@@ -109,6 +112,7 @@ const ColorTheme = props => {
109
112
  },
110
113
  hideThemeColors: true,
111
114
  hideGradient: true,
115
+ classes: classes,
112
116
  children: /*#__PURE__*/_jsxs(Grid, {
113
117
  className: "pmBox",
114
118
  style: {
@@ -156,6 +160,7 @@ const ColorTheme = props => {
156
160
  },
157
161
  hideThemeColors: true,
158
162
  hideGradient: true,
163
+ classes: classes,
159
164
  children: /*#__PURE__*/_jsxs(Grid, {
160
165
  className: "sdBox",
161
166
  style: {
@@ -34,7 +34,11 @@ const Style = () => ({
34
34
  ".valyeText": {
35
35
  position: "absolute",
36
36
  right: "5px",
37
- bottom: "5px"
37
+ bottom: "5px",
38
+ whiteSpace: "nowrap",
39
+ overflow: "hidden",
40
+ textOverflow: "ellipsis",
41
+ maxWidth: "calc(100% - 10px)"
38
42
  },
39
43
  ".editBtn": {
40
44
  position: "absolute",
@@ -18,7 +18,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const Fonts = props => {
20
20
  const {
21
- className
21
+ className,
22
+ customProps
22
23
  } = props;
23
24
  const [anchorEl, setAnchorEl] = React.useState();
24
25
  const [selectedField, setSelectedField] = React.useState("");
@@ -205,7 +206,8 @@ const Fonts = props => {
205
206
  children: [/*#__PURE__*/_jsx(PopperHeader, {
206
207
  title: "Text Settings",
207
208
  classes: classes,
208
- onClose: onClose
209
+ onClose: onClose,
210
+ customProps: customProps
209
211
  }), /*#__PURE__*/_jsx(ThemeTextFormat, {
210
212
  settings: settings,
211
213
  updateSettings: updateSettings,
@@ -1,4 +1,6 @@
1
- const Style = () => ({
1
+ const Style = ({
2
+ appTheme
3
+ }) => ({
2
4
  ".settingAccordion": {
3
5
  ".MuiOutlinedInput-root": {
4
6
  borderRadius: "8px",
@@ -10,7 +12,7 @@ const Style = () => ({
10
12
  width: "calc(100% + 20px)",
11
13
  margin: "0 -10px",
12
14
  "&:hover": {
13
- background: "#ECF2FF",
15
+ background: appTheme?.palette?.editor?.tv_hover_bg,
14
16
  ".editIcon": {
15
17
  opacity: "1",
16
18
  visibility: "visible"
@@ -39,6 +41,19 @@ const Style = () => ({
39
41
  whiteSpace: "nowrap",
40
42
  overflow: "hidden",
41
43
  textOverflow: "ellipsis"
44
+ },
45
+ ".MuiAutocomplete-input": {
46
+ color: appTheme?.palette?.editor?.textColor
47
+ },
48
+ ".MuiCheckbox-root": {
49
+ "& svg": {
50
+ fill: appTheme?.palette?.editor?.textColor
51
+ }
52
+ },
53
+ ".MuiCheckbox-root.Mui-checked": {
54
+ "& svg": {
55
+ fill: "#1976d2"
56
+ }
42
57
  }
43
58
  });
44
59
  export default Style;
@@ -31,7 +31,9 @@ const ThemeSettings = props => {
31
31
  className,
32
32
  open,
33
33
  setOpen,
34
- services
34
+ services,
35
+ appTheme,
36
+ customProps
35
37
  } = props;
36
38
 
37
39
  // State
@@ -51,7 +53,8 @@ const ThemeSettings = props => {
51
53
  const {
52
54
  id,
53
55
  name,
54
- mood_name
56
+ mood_name,
57
+ template_tags
55
58
  } = userSelectedTheme || {};
56
59
  const onClose = () => setOpen(false);
57
60
  const getThemesList = async themeTabType => {
@@ -153,8 +156,7 @@ const ThemeSettings = props => {
153
156
  children: name
154
157
  }), /*#__PURE__*/_jsx(Typography, {
155
158
  variant: "body2",
156
- color: "textSecondary",
157
- className: "fs-12",
159
+ className: "fs-12 textSecondary",
158
160
  children: mood_name
159
161
  })]
160
162
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -211,8 +213,7 @@ const ThemeSettings = props => {
211
213
  children: "Theme/Brand Setting"
212
214
  }), /*#__PURE__*/_jsxs(Typography, {
213
215
  variant: "body1",
214
- color: "textSecondary",
215
- className: "fs-12",
216
+ className: "fs-12 textSecondary",
216
217
  children: ["Change the entire style of your website with a single click.", " "]
217
218
  })]
218
219
  }), /*#__PURE__*/_jsx(IconButton, {
@@ -231,17 +232,13 @@ const ThemeSettings = props => {
231
232
  className: "sectionTitle flexAlign",
232
233
  children: [/*#__PURE__*/_jsx(IconButton, {
233
234
  onClick: () => setThemeMoodboard(false),
235
+ className: "backBtn",
234
236
  children: /*#__PURE__*/_jsx(ChevronLeft, {})
235
237
  }), "Theme Moodboard"]
236
- }), /*#__PURE__*/_jsxs(Grid, {
237
- className: "activeWrapper",
238
- children: [/*#__PURE__*/_jsx(TickIcon, {}), /*#__PURE__*/_jsx(ActiveTheme, {
239
- explore: false
240
- })]
241
238
  }), /*#__PURE__*/_jsxs(Tabs, {
242
239
  value: themeTabType,
243
240
  onChange: handleTabChange,
244
- variant: "scrollable",
241
+ variant: "fullWidth",
245
242
  scrollButtons: false,
246
243
  "aria-label": "scrollable prevent tabs example",
247
244
  children: [/*#__PURE__*/_jsx(Tab, {
@@ -274,26 +271,36 @@ const ThemeSettings = props => {
274
271
  }, i);
275
272
  })]
276
273
  })
277
- }), id ? /*#__PURE__*/_jsxs(_Fragment, {
274
+ }), id && !themeMoodboard ? /*#__PURE__*/_jsxs(_Fragment, {
278
275
  children: [/*#__PURE__*/_jsx(Grid, {
279
276
  sx: {
280
- px: 1
277
+ px: 1,
278
+ mt: 2
281
279
  },
282
280
  children: /*#__PURE__*/_jsx(ColorTheme, {
283
281
  colors: getColors(colors),
284
282
  onColorChange: onColorChange,
285
- openDefault: open === "editThemeColor"
283
+ openDefault: open === "editThemeColor",
284
+ appTheme: appTheme
286
285
  })
287
286
  }), /*#__PURE__*/_jsx(Grid, {
288
287
  sx: {
289
- px: 1
288
+ px: 1,
289
+ mt: 2
290
290
  },
291
- children: /*#__PURE__*/_jsx(Fonts, {})
291
+ children: /*#__PURE__*/_jsx(Fonts, {
292
+ appTheme: appTheme,
293
+ customProps: customProps
294
+ })
292
295
  }), /*#__PURE__*/_jsx(Grid, {
293
296
  sx: {
294
- px: 1
297
+ px: 1,
298
+ mt: 2
295
299
  },
296
- children: /*#__PURE__*/_jsx(Buttons, {})
300
+ children: /*#__PURE__*/_jsx(Buttons, {
301
+ appTheme: appTheme,
302
+ customProps: customProps
303
+ })
297
304
  }), /*#__PURE__*/_jsx("div", {
298
305
  style: {
299
306
  width: "100%",
@@ -308,7 +315,8 @@ const ThemeSettings = props => {
308
315
  onSave: onSaveTheme,
309
316
  defaultFormData: {
310
317
  name,
311
- mood_name
318
+ mood_name,
319
+ template_tags
312
320
  }
313
321
  })
314
322
  })]
@@ -1,152 +1,193 @@
1
- const Style = () => ({
2
- ".fs-12": {
3
- fontSize: "12px"
4
- },
5
- ".fs-14": {
6
- fontSize: "14px"
7
- },
8
- ".fw-500": {
9
- fontWeight: "500"
10
- },
11
- ".fw-600": {
12
- fontWeight: "600"
13
- },
14
- ".pointer": {
15
- cursor: "pointer"
16
- },
17
- ".transformNone": {
18
- textTransform: "none"
19
- },
20
- ".settingsContainer": {
21
- width: "340px",
22
- padding: "16px 5px",
23
- background: "#fff",
24
- ".header": {
25
- borderBottom: `1px solid #DCE4EC`,
26
- paddingBottom: "16px",
27
- marginBottom: "16px"
28
- }
29
- },
30
- ".title": {
31
- fontWeight: "700",
32
- fontSize: "14px"
33
- },
34
- ".closeBtn": {
35
- width: "26px",
36
- height: "26px",
37
- BorderRadius: "4px",
38
- flexShrik: "0",
39
- padding: "4px",
40
- background: " #F8FAFC",
41
- borderRadius: "4px"
42
- },
43
- ".activeTheme": {
44
- background: "#F4F4F6",
45
- padding: "14px 10px",
46
- borderRadius: "4px"
47
- },
48
- ".activeThemeInnner": {
49
- borderRadius: "7px",
50
- padding: "16px",
51
- boxShadow: "1px 2px 5px 0px #00000014",
52
- background: "#fff"
53
- },
54
- ".flexAlign": {
55
- display: "flex",
56
- alignItems: "center"
57
- },
58
- ".activeColorBox, .xsColorBox": {
59
- width: "24px",
60
- height: "24px",
61
- borderRadius: "5px",
62
- border: `1px solid #929292`
63
- },
64
- ".themeCard": {
65
- borderRadius: "7px",
66
- padding: "16px",
67
- border: "1px solid #F3F3F3",
68
- boxShadow: "1px 2px 5px 0px #00000014",
69
- background: "white",
70
- flexWrap: "nowrap"
71
- },
72
- ".themeCardWrapper": {
73
- padding: "10px",
74
- borderRadius: "4px",
75
- cursor: "pointer",
76
- "&.active": {
77
- background: "#ECF2FF"
78
- }
79
- },
80
- ".primaryCard, .secondaryCard": {
81
- width: "44px",
82
- height: "44px",
83
- borderRadius: "5px",
84
- border: `1px solid #929292`
85
- },
86
- ".otherColors": {
87
- display: "flex",
88
- flexWrap: "wrap",
89
- width: "48px",
90
- ".smallCard": {
91
- width: "20px",
92
- height: "20px",
1
+ const Style = ({
2
+ appTheme
3
+ }) => {
4
+ const {
5
+ background,
6
+ textColor,
7
+ tv_text,
8
+ uploadFileBg,
9
+ closeButtonBgColor,
10
+ closeButtonSvgStroke,
11
+ tv_hover_bg,
12
+ deviderBgColor
13
+ } = appTheme?.palette?.editor || {};
14
+ return {
15
+ ".fs-12": {
16
+ fontSize: "12px"
17
+ },
18
+ ".fs-14": {
19
+ fontSize: "14px"
20
+ },
21
+ ".fw-500": {
22
+ fontWeight: "500"
23
+ },
24
+ ".fw-600": {
25
+ fontWeight: "600"
26
+ },
27
+ ".pointer": {
28
+ cursor: "pointer"
29
+ },
30
+ ".transformNone": {
31
+ textTransform: "none"
32
+ },
33
+ "& .MuiDrawer-paper": {
34
+ background: background,
35
+ color: textColor
36
+ },
37
+ "& .textSecondary": {
38
+ color: tv_text
39
+ },
40
+ ".settingsContainer": {
41
+ width: "340px",
42
+ padding: "16px 5px",
43
+ ".header": {
44
+ borderBottom: `1px solid ${deviderBgColor}`,
45
+ paddingBottom: "16px",
46
+ marginBottom: "16px"
47
+ }
48
+ },
49
+ ".title": {
50
+ fontWeight: "700",
51
+ fontSize: "14px"
52
+ },
53
+ ".closeBtn": {
54
+ width: "26px",
55
+ height: "26px",
56
+ BorderRadius: "4px",
57
+ flexShrik: "0",
58
+ padding: "4px",
59
+ borderRadius: "4px",
60
+ background: closeButtonBgColor,
61
+ color: `${closeButtonSvgStroke} !important`,
62
+ "& svg": {
63
+ color: `${closeButtonSvgStroke} !important`
64
+ }
65
+ },
66
+ ".backBtn": {
67
+ color: `${closeButtonSvgStroke} !important`,
68
+ "& svg": {
69
+ color: `${closeButtonSvgStroke} !important`
70
+ }
71
+ },
72
+ ".activeTheme": {
73
+ background: uploadFileBg,
74
+ padding: "14px 10px",
75
+ borderRadius: "4px"
76
+ },
77
+ ".activeThemeInnner": {
78
+ borderRadius: "7px",
79
+ padding: "16px",
80
+ boxShadow: "1px 2px 5px 0px #00000014",
81
+ background: background
82
+ },
83
+ "& .activeThemeTitle": {
84
+ paddingBottom: "6px"
85
+ },
86
+ ".flexAlign": {
87
+ display: "flex",
88
+ alignItems: "center"
89
+ },
90
+ ".activeColorBox, .xsColorBox": {
91
+ width: "24px",
92
+ height: "24px",
93
93
  borderRadius: "5px",
94
94
  border: `1px solid #929292`
95
- }
96
- },
97
- ".sectionDetail": {
98
- borderRadius: "4px",
99
- background: "#fff"
100
- },
101
- ".sectionTitle": {
102
- borderBottom: `1px solid #DCE4EC`,
103
- fontWeight: "600",
104
- fontSize: "14px"
105
- },
106
- // ".activeThemeInnner": {
107
- // borderRadius: "7px",
108
- // padding: "16px",
109
- // boxShadow: "1px 2px 5px 0px #00000014",
110
- // background: "#fff",
111
- // },
112
- ".activeWrapper": {
113
- background: "#ECF2FF",
114
- padding: "14px 10px",
115
- position: "relative",
116
- ".tickIcon": {
117
- position: "absolute",
118
- right: "5px",
119
- top: "8px"
120
- }
121
- },
122
- ".settingAccordion": {
123
- background: "#fff",
124
- border: "1px solid #F3F3F3",
125
- boxShadow: "1px 2px 5px 0px #00000014",
126
- borderRadius: "7px",
127
- marginTop: "10px",
128
- marginBottom: "10px",
129
- padding: "0px 12px",
130
- "&:before": {
131
- background: "transparent"
132
- },
133
- ".MuiAccordionSummary-root ": {
134
- minHeight: "45px",
135
- padding: "0px",
136
- "&.Mui-expanded": {
137
- borderBottom: `1px solid #DCE4EC`
95
+ },
96
+ ".themeCard": {
97
+ borderRadius: "7px",
98
+ padding: "16px",
99
+ border: `1px solid ${uploadFileBg}`,
100
+ boxShadow: "1px 2px 5px 0px #00000014",
101
+ background: background,
102
+ flexWrap: "nowrap"
103
+ },
104
+ ".themeCardWrapper": {
105
+ padding: "10px",
106
+ borderRadius: "4px",
107
+ cursor: "pointer",
108
+ "&.active": {
109
+ background: "#ECF2FF"
138
110
  }
139
111
  },
140
- ".MuiAccordionSummary-content ": {
141
- padding: "12px 0px !important",
142
- margin: "0px !important",
143
- minHeight: "45px",
144
- fontSize: "14px",
145
- fontWeight: "600"
112
+ ".primaryCard, .secondaryCard": {
113
+ width: "44px",
114
+ height: "44px",
115
+ borderRadius: "5px",
116
+ border: `1px solid #929292`
117
+ },
118
+ ".otherColors": {
119
+ display: "flex",
120
+ flexWrap: "wrap",
121
+ width: "48px",
122
+ ".smallCard": {
123
+ width: "20px",
124
+ height: "20px",
125
+ borderRadius: "5px",
126
+ border: `1px solid #929292`
127
+ }
128
+ },
129
+ ".sectionDetail": {
130
+ borderRadius: "4px",
131
+ background: background
132
+ },
133
+ ".sectionTitle": {
134
+ borderBottom: `1px solid ${deviderBgColor}`,
135
+ fontWeight: "600",
136
+ fontSize: "14px"
137
+ },
138
+ // ".activeThemeInnner": {
139
+ // borderRadius: "7px",
140
+ // padding: "16px",
141
+ // boxShadow: "1px 2px 5px 0px #00000014",
142
+ // background: "#fff",
143
+ // },
144
+ ".activeWrapper": {
145
+ background: tv_hover_bg,
146
+ padding: "14px 10px",
147
+ position: "relative",
148
+ ".tickIcon": {
149
+ position: "absolute",
150
+ right: "5px",
151
+ top: "8px"
152
+ }
153
+ },
154
+ ".settingAccordion": {
155
+ background: background,
156
+ color: textColor,
157
+ border: `1px solid ${deviderBgColor}`,
158
+ boxShadow: "1px 2px 5px 0px #00000014",
159
+ borderRadius: "7px",
160
+ marginTop: "10px",
161
+ marginBottom: "10px",
162
+ padding: "0px 12px",
163
+ "&:before": {
164
+ background: "transparent"
165
+ },
166
+ ".MuiAccordionSummary-expandIconWrapper": {
167
+ color: textColor
168
+ },
169
+ ".MuiAccordionSummary-root ": {
170
+ // minHeight: "20px",
171
+ padding: "0px",
172
+ "&.Mui-expanded": {
173
+ minHeight: "48px",
174
+ borderBottom: `1px solid ${deviderBgColor}`
175
+ }
176
+ },
177
+ ".MuiAccordionSummary-content ": {
178
+ // padding: "12px 0px !important",
179
+ margin: "0px !important",
180
+ // minHeight: "45px",
181
+ fontSize: "14px",
182
+ fontWeight: "600"
183
+ },
184
+ ".MuiAccordionDetails-root ": {
185
+ padding: "12px 0px"
186
+ }
146
187
  },
147
- ".MuiAccordionDetails-root ": {
148
- padding: "12px 0px"
188
+ ".MuiTab-root": {
189
+ color: textColor
149
190
  }
150
- }
151
- });
191
+ };
192
+ };
152
193
  export default Style;
@@ -235,8 +235,7 @@ const ThemeSettingsAI = props => {
235
235
  children: "Upload a logo or image"
236
236
  }), /*#__PURE__*/_jsx(Typography, {
237
237
  variant: "body2",
238
- className: "fs-12",
239
- color: "textSecondary",
238
+ className: "fs-12 textSecondary",
240
239
  children: "Click here to upload PDF, PPT, and image files."
241
240
  })]
242
241
  })]
@@ -25,7 +25,8 @@ const SaveTheme = props => {
25
25
  const [form, setForm] = useState(defaultFormData);
26
26
  const {
27
27
  name,
28
- mood_name
28
+ mood_name,
29
+ template_tags
29
30
  } = form;
30
31
  const updateForm = update => {
31
32
  setForm(prev => ({
@@ -51,7 +52,6 @@ const SaveTheme = props => {
51
52
  }
52
53
  return err;
53
54
  };
54
- console.log("className", className);
55
55
  return /*#__PURE__*/_jsxs(Box, {
56
56
  className: className,
57
57
  children: [/*#__PURE__*/_jsx(Button, {
@@ -81,10 +81,11 @@ const SaveTheme = props => {
81
81
  children: [/*#__PURE__*/_jsxs(Grid, {
82
82
  container: true,
83
83
  justifyContent: "space-between",
84
+ alignItems: "center",
84
85
  children: [/*#__PURE__*/_jsx(Typography, {
85
86
  variant: "h4",
86
87
  sx: {
87
- fontSize: "20px"
88
+ fontSize: "18px"
88
89
  },
89
90
  className: "fw-600",
90
91
  children: "Save Your theme"
@@ -135,6 +136,23 @@ const SaveTheme = props => {
135
136
  value: mood_name
136
137
  }), /*#__PURE__*/_jsx(Error, {
137
138
  error: error?.mood_name
139
+ }), /*#__PURE__*/_jsx(Typography, {
140
+ variant: "body1",
141
+ className: "fw-500",
142
+ sx: {
143
+ pt: 2,
144
+ pb: 1
145
+ },
146
+ children: "Template Tags"
147
+ }), /*#__PURE__*/_jsx(TextField, {
148
+ variant: "outlined",
149
+ size: "small",
150
+ placeholder: "template_tags",
151
+ fullWidth: true,
152
+ onChange: e => updateForm({
153
+ template_tags: e.target.value
154
+ }),
155
+ value: template_tags
138
156
  }), /*#__PURE__*/_jsxs(Grid, {
139
157
  container: true,
140
158
  justifyContent: "flex-end",
@@ -170,7 +170,7 @@ export const isMarkBtnActive = (editor, format) => {
170
170
  return isMarkActive(editor, format);
171
171
  }
172
172
  };
173
- export const getSelectedElementStyle = (styleProperty, editor) => {
173
+ export const getSelectedElementStyle = (styleProperty, editor, format) => {
174
174
  try {
175
175
  if (!editor.selection) {
176
176
  return "";
@@ -178,6 +178,12 @@ export const getSelectedElementStyle = (styleProperty, editor) => {
178
178
  if (Range.isCollapsed(editor.selection)) {
179
179
  return "";
180
180
  }
181
+ if (format) {
182
+ const value = activeMark(editor, format, true);
183
+ if (value) {
184
+ return value;
185
+ }
186
+ }
181
187
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
182
188
  const selectedDomNode = domRange.commonAncestorContainer;
183
189
 
@@ -215,7 +221,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
215
221
  });
216
222
  }
217
223
  };
218
- export const activeMark = (editor, format) => {
224
+ export const activeMark = (editor, format, noDefaultValue) => {
219
225
  const defaultMarkData = {
220
226
  color: "#000000",
221
227
  bgColor: "#FFFFFF",
@@ -225,7 +231,7 @@ export const activeMark = (editor, format) => {
225
231
  };
226
232
  try {
227
233
  const marks = Editor.marks(editor);
228
- let defaultValue = defaultMarkData[format];
234
+ let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
229
235
  const {
230
236
  selection
231
237
  } = editor || {};
@@ -371,6 +377,7 @@ export const getMarked = (leaf, children, theme) => {
371
377
  rel: "noreferrer",
372
378
  target: "_blank",
373
379
  href: leaf.text,
380
+ className: "hyperLink",
374
381
  children: children
375
382
  });
376
383
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "9.3.1",
3
+ "version": "9.3.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"