@flozy/editor 9.8.4 → 9.8.6

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.
@@ -171,7 +171,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
171
171
  const chars = type ? Shorthands[type]({
172
172
  ...mentions,
173
173
  CHARACTERS,
174
- hideTools: hideTools
174
+ hideTools: hideTools,
175
+ translation: translation || translationMock
175
176
  }) : [];
176
177
  const Leaf = ({
177
178
  attributes,
@@ -612,6 +612,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
612
612
  className: "theme-buttons",
613
613
  children: [/*#__PURE__*/_jsx(IconButton, {
614
614
  onClick: () => setOpenTheme(true),
615
+ className: "themePaintIcon",
615
616
  children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
616
617
  }), /*#__PURE__*/_jsx(IconButton, {
617
618
  onClick: () => setOpenAITheme(true),
@@ -1361,6 +1361,10 @@ code.markcode {
1361
1361
  z-index: 1000;
1362
1362
  }
1363
1363
 
1364
+ .themePaintIcon:hover .iconBorder {
1365
+ fill: #2563EB;
1366
+ }
1367
+
1364
1368
  .hyperLink {
1365
1369
  word-break: break-all;
1366
- }
1370
+ }
@@ -215,7 +215,8 @@ const ColorButtons = props => {
215
215
  onClick: onColorPickerClick,
216
216
  style: {
217
217
  alignSelf: "start",
218
- margin: "6px"
218
+ margin: "6px",
219
+ padding: "0px"
219
220
  },
220
221
  children: /*#__PURE__*/_jsx("img", {
221
222
  src: ColorPicker,
@@ -550,7 +550,6 @@ const FreeGrid = props => {
550
550
  editor,
551
551
  path,
552
552
  classes,
553
- customProps,
554
553
  translation
555
554
  }
556
555
  }
@@ -98,6 +98,9 @@ const usePopupStyle = theme => ({
98
98
  }
99
99
  }
100
100
  },
101
+ "& .MuiDivider-root": {
102
+ border: `0.5px solid ${theme?.palette?.editor?.deviderBgColor}`
103
+ },
101
104
  "@media only screen and (max-width: 599px)": {
102
105
  // margin: "10px !important",
103
106
  background: "unset",
@@ -310,14 +313,14 @@ const usePopupStyle = theme => ({
310
313
  position: "sticky",
311
314
  bottom: "0px",
312
315
  right: "0px",
313
- boxShadow: "0px -3px 12px 0px #00000017",
316
+ boxShadow: `0px -3px 16px 0px ${theme?.palette?.editor?.cardShadow}`,
314
317
  padding: "10px",
315
318
  borderRadius: "8px 8px 19px 19px",
316
319
  display: "flex",
317
320
  justifyContent: "end",
318
321
  alignItems: "center",
319
322
  gap: "8px",
320
- background: theme?.palette?.editor?.background
323
+ background: theme?.palette?.editor?.miniToolBarBackground
321
324
  }
322
325
  },
323
326
  textFormatLabel: {
@@ -888,7 +891,7 @@ const usePopupStyle = theme => ({
888
891
  margin: "30px",
889
892
  "& .MuiPaper-root": {
890
893
  overflow: "auto",
891
- backgroundColor: theme?.palette?.editor?.background,
894
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
892
895
  borderRadius: "14px !important",
893
896
  border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
894
897
  minWidth: "fit-content",
@@ -1195,9 +1198,6 @@ const usePopupStyle = theme => ({
1195
1198
  color: theme?.palette?.editor?.tv_text,
1196
1199
  fontSize: "13px"
1197
1200
  }
1198
- },
1199
- dividerGrid: {
1200
- margin: "5px 0px 10px 0px"
1201
1201
  }
1202
1202
  });
1203
1203
  export default usePopupStyle;
@@ -1,6 +1,6 @@
1
1
  import { Box, Button, Divider, Grid, IconButton, Popover, TextField, Tooltip, Typography } from "@mui/material";
2
2
  import { useEditorContext } from "../../hooks/useMouseMove";
3
- import FormatClearIcon from "@mui/icons-material/FormatClear";
3
+ // import FormatClearIcon from "@mui/icons-material/FormatClear";
4
4
  import usePopupStyles from "../PopupTool/PopupToolStyle";
5
5
  import { TextMinusIcon, TextPlusIcon } from "../../common/iconslist";
6
6
  import { BREAKPOINTS_DEVICES, getBreakPointsValue, getVariableValue } from "../../helper/theme";
@@ -11,12 +11,14 @@ import { useMemo, useState } from "react";
11
11
  import CommonButton from "../../common/Button";
12
12
  import CustomSelect from "../../common/CustomSelect";
13
13
  import ColorButtons from "../../Elements/Color Picker/ColorButtons";
14
- import FormatColorResetIcon from "@mui/icons-material/FormatColorReset";
14
+ // import FormatColorResetIcon from "@mui/icons-material/FormatColorReset";
15
15
  import ColorPickerStyles from "../../Elements/Color Picker/Styles";
16
16
  import colorWheel from "../../Elements/Color Picker/colorWheel.png";
17
17
  import CustomColorPicker from "../../common/CustomColorPicker";
18
18
  import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
19
19
  import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList";
20
+ import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
21
+ import { fontFamilyMap } from "../../utils/font";
20
22
  import { jsx as _jsx } from "react/jsx-runtime";
21
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
24
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -133,12 +135,13 @@ function ThemeTextFormat(props) {
133
135
  }), /*#__PURE__*/_jsx(Grid, {
134
136
  item: true,
135
137
  children: /*#__PURE__*/_jsx(Button, {
136
- sx: classes.defaultBtn,
137
- startIcon: /*#__PURE__*/_jsx(FormatClearIcon, {}),
138
+ sx: classes.defaultBtn1,
139
+ startIcon: /*#__PURE__*/_jsx(TextDefaultStyleIcon, {}),
138
140
  onClick: () => updateSettings({
139
- fontFamily: defaultFonts[0]
141
+ fontFamily: Object.values(fontFamilyMap)[0]
140
142
  }),
141
- children: "Default"
143
+ className: "npr-0",
144
+ children: "Default Text"
142
145
  })
143
146
  })]
144
147
  }), /*#__PURE__*/_jsx(Grid, {
@@ -226,12 +229,12 @@ function ThemeTextFormat(props) {
226
229
  }), /*#__PURE__*/_jsx(Grid, {
227
230
  item: true,
228
231
  children: /*#__PURE__*/_jsx(Button, {
229
- sx: classes.defaultBtn,
230
- startIcon: /*#__PURE__*/_jsx(FormatColorResetIcon, {}),
232
+ sx: classes.defaultBtn1,
233
+ startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {}),
231
234
  onClick: () => updateSettings({
232
235
  color: "#ddd"
233
236
  }),
234
- children: "Default"
237
+ children: "Default Color"
235
238
  })
236
239
  })]
237
240
  }), /*#__PURE__*/_jsx(Grid, {
@@ -286,14 +289,14 @@ function ThemeTextFormat(props) {
286
289
  className: "saveThemeBtnsWrapper",
287
290
  children: [/*#__PURE__*/_jsx(Button, {
288
291
  onClick: onClose,
289
- className: "secondaryBtn",
292
+ className: "closeBtn",
290
293
  style: {
291
294
  background: "none"
292
295
  },
293
296
  children: "Cancel"
294
297
  }), /*#__PURE__*/_jsx(Button, {
295
298
  onClick: onSaveTextSettings,
296
- className: "primaryBtn",
299
+ className: "confirmBtn",
297
300
  children: "Save"
298
301
  })]
299
302
  })]
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ function BackIcon() {
3
+ return /*#__PURE__*/_jsx("svg", {
4
+ width: "8",
5
+ height: "12",
6
+ viewBox: "0 0 6 10",
7
+ fill: "none",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ children: /*#__PURE__*/_jsx("path", {
10
+ d: "M4.75 1.5L1.25 5L4.75 8.5",
11
+ stroke: "#94A3B8",
12
+ strokeWidth: "1.5",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round"
15
+ })
16
+ });
17
+ }
18
+ export default BackIcon;
@@ -10,7 +10,8 @@ export const ThemePaintIcon = () => /*#__PURE__*/_jsxs("svg", {
10
10
  d: "M10.4325 30.1183C12.139 31.1876 14.0973 31.7882 16.1099 31.8595C16.8893 31.8902 17.6699 31.8481 18.4415 31.7337L17.8907 33.3571C17.2776 33.414 16.6614 33.4296 16.0462 33.4036C13.7653 33.3205 11.5466 32.6376 9.61376 31.4238C7.53754 30.0913 5.95828 28.1117 5.12029 25.7914C4.23027 23.3448 4.06149 20.6941 4.634 18.1544C5.32901 15.0434 7.1361 12.2933 9.71575 10.4207C12.3096 8.51989 15.5017 7.61749 18.7068 7.87886C19.755 7.92879 20.7757 8.23069 21.6825 8.75897C22.0763 8.9939 22.4171 9.30786 22.6835 9.68107C22.9499 10.0543 23.1362 10.4786 23.2304 10.9274C23.2405 10.9823 23.245 11.0381 23.2441 11.0939C23.2158 12.8879 21.9918 13.4622 20.8255 14.0113C20.1397 14.3232 19.5069 14.6321 19.5387 15.2172C19.5497 15.4668 19.7385 15.7377 20.0664 16.0015C20.5942 16.3982 21.197 16.6835 21.8383 16.8402C22.4605 17.0128 23.1214 17.1542 23.7449 17.3003C24.1251 17.3841 24.4862 17.462 24.8522 17.553L23.7035 18.879L23.4025 18.8123C22.7815 18.6728 22.1281 18.5267 21.4188 18.3306C20.5732 18.1157 19.7797 17.7322 19.0859 17.2032C18.4162 16.6584 18.0267 15.9997 17.9896 15.2953C17.9042 13.6668 19.0075 13.1488 20.1607 12.6046C20.8766 12.2684 21.6273 11.9155 21.6909 11.1512C21.5627 10.6932 21.2613 10.3032 20.8504 10.0638C20.1561 9.66831 19.3778 9.4434 18.5796 9.40758C15.747 9.18118 12.9274 9.98108 10.6357 11.6612C8.36068 13.3186 6.76827 15.7488 6.15706 18.4964C5.64599 20.7451 5.79061 23.0931 6.57376 25.2621C7.29184 27.2606 8.64787 28.9672 10.4325 30.1183Z",
11
11
  fill: "#64748B",
12
12
  stroke: "#64748B",
13
- strokeWidth: "0.5"
13
+ strokeWidth: "0.5",
14
+ className: "iconBorder"
14
15
  }), /*#__PURE__*/_jsx("path", {
15
16
  fillRule: "evenodd",
16
17
  clipRule: "evenodd",
@@ -30,7 +31,8 @@ export const ThemePaintIcon = () => /*#__PURE__*/_jsxs("svg", {
30
31
  fillRule: "evenodd",
31
32
  clipRule: "evenodd",
32
33
  d: "M32.7335 9.18621C31.3102 11.8459 26.9461 11.8944 26.9128 15.3245C26.9126 15.8075 27.0124 16.2852 27.2061 16.7277C27.3998 17.1701 27.6831 17.5676 28.0381 17.895C28.4548 18.2729 28.9983 18.4802 29.5607 18.476C31.813 18.4825 33.0805 16.295 33.3333 14.2829C33.5585 12.4266 33.106 10.4893 32.7335 9.18621ZM28.6753 24.4217C27.0476 24.0905 25.5122 23.4072 24.1766 22.4198L19.9589 34.8736C19.8518 35.1342 19.7782 35.4074 19.74 35.6866C19.7196 35.902 19.7541 36.119 19.8402 36.3175C19.9263 36.516 20.0612 36.6895 20.2324 36.8218C20.4035 36.9542 20.6053 37.0411 20.8191 37.0745C21.0329 37.1079 21.2516 37.0867 21.455 37.0129C21.7724 36.8627 22.0272 36.6059 22.1748 36.2872L28.6785 24.4205L28.6753 24.4217ZM29.2912 19.8582C28.6241 19.8255 27.5539 19.4973 26.9954 18.8102L24.5583 21.6431C25.9722 22.7123 27.476 23.4776 29.1409 23.7349C29.0576 21.977 29.0679 21.7996 29.277 19.8654L29.2912 19.8582Z",
33
- fill: "#64748B"
34
+ fill: "#64748B",
35
+ className: "iconBorder"
34
36
  }), /*#__PURE__*/_jsx("path", {
35
37
  fillRule: "evenodd",
36
38
  clipRule: "evenodd",
@@ -53,14 +53,11 @@ const ColorPickerToolComponent = ({
53
53
  className: "colorPickerActionBtns",
54
54
  children: [/*#__PURE__*/_jsx(Button, {
55
55
  onClick: handleClose,
56
- className: "secondaryBtn",
57
- style: {
58
- background: "none"
59
- },
56
+ className: "cancelBtn",
60
57
  children: "Cancel"
61
58
  }), /*#__PURE__*/_jsx(Button, {
62
59
  onClick: handleSave,
63
- className: "primaryBtn",
60
+ className: "confirmBtn",
64
61
  children: "Save"
65
62
  })]
66
63
  })]
@@ -41,7 +41,7 @@ function CustomColorPicker(props) {
41
41
  const theme = useTheme();
42
42
  const colorVars = theme?.vars?.colors || {};
43
43
  const onChange = useCallback(color => {
44
- onChangeColor(getSelectedColor(color, theme));
44
+ onChangeColor(getSelectedColor(color, theme, hideThemeColors));
45
45
  }, [onChangeColor, theme]);
46
46
  const colorTabs = useMemo(() => {
47
47
  const otherColors = {
@@ -67,7 +67,7 @@ function CustomColorPicker(props) {
67
67
  tabs.push(otherColors);
68
68
  return tabs;
69
69
  }, [recentColors, defaultColors, onChange, colorVars]);
70
- const selectValue = getSelectedColor(color, theme);
70
+ const selectValue = getSelectedColor(color, theme, hideThemeColors);
71
71
  return /*#__PURE__*/_jsxs(Paper, {
72
72
  component: "div",
73
73
  sx: classes.customColorPickerContainer,
@@ -3,12 +3,13 @@ import { Grid, TextField, InputAdornment, Typography, Tooltip } from "@mui/mater
3
3
  import ColorPickerButton from "../../ColorPickerButton";
4
4
  import { getVariableValue } from "../../../helper/theme";
5
5
  import { useButtonStyle } from "../../../hooks/useThemeValues";
6
+
7
+ // const MAP_STYLE_PROPS = {
8
+ // bgColor: "background-color",
9
+ // textColor: "color",
10
+ // };
6
11
  import { jsx as _jsx } from "react/jsx-runtime";
7
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const MAP_STYLE_PROPS = {
9
- bgColor: "background-color",
10
- textColor: "color"
11
- };
12
13
  const Color = props => {
13
14
  const {
14
15
  value: val,
@@ -9,12 +9,12 @@ const MetaDataMapping = props => {
9
9
  elementProps,
10
10
  customProps
11
11
  } = props;
12
- const {
13
- translation
14
- } = customProps;
15
12
  const {
16
13
  compType
17
14
  } = data;
15
+ const {
16
+ translation
17
+ } = customProps;
18
18
  const previousCardRef = useRef(null);
19
19
  const [selectedCard, setSelectedCard] = useState(null);
20
20
  const updatedData = {
@@ -1655,21 +1655,20 @@ export const CsvIcon = () => /*#__PURE__*/_jsxs("svg", {
1655
1655
  })]
1656
1656
  });
1657
1657
  export const CloseIcon = props => /*#__PURE__*/_jsxs("svg", {
1658
- width: "20",
1659
- height: "20",
1660
- viewBox: "0 0 20 20",
1658
+ width: "10",
1659
+ height: "10",
1660
+ viewBox: "0 0 10 10",
1661
1661
  fill: "none",
1662
1662
  xmlns: "http://www.w3.org/2000/svg",
1663
- ...(props || {}),
1664
1663
  children: [/*#__PURE__*/_jsx("path", {
1665
- d: "M14.1245 5.875L5.87493 14.1246",
1666
- stroke: "#64748B",
1664
+ d: "M9.12476 0.875L0.875176 9.12458",
1665
+ stroke: "#8F9CAE",
1667
1666
  strokeWidth: "1.5",
1668
1667
  strokeLinecap: "round",
1669
1668
  strokeLinejoin: "round"
1670
1669
  }), /*#__PURE__*/_jsx("path", {
1671
- d: "M5.875 5.875L14.1246 14.1246",
1672
- stroke: "#64748B",
1670
+ d: "M0.875183 0.875L9.12476 9.12458",
1671
+ stroke: "#8F9CAE",
1673
1672
  strokeWidth: "1.5",
1674
1673
  strokeLinecap: "round",
1675
1674
  strokeLinejoin: "round"
@@ -212,16 +212,16 @@ const useCommonStyle = theme => ({
212
212
  backgroundColor: theme?.palette?.editor?.miniToolBarBackground
213
213
  },
214
214
  "& .popup_tabs": {
215
- backgroundColor: theme?.palette?.editor?.background,
215
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
216
216
  "@media only screen and (max-width: 899px)": {
217
217
  width: "100% !important"
218
218
  }
219
219
  },
220
220
  "& .popup_tabs-header": {
221
- backgroundColor: theme?.palette?.editor?.background,
221
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
222
222
  "& .popup_tabs-header-label-active": {
223
223
  color: theme?.palette?.editor?.activeColor,
224
- backgroundColor: theme?.palette?.editor?.background
224
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground
225
225
  }
226
226
  },
227
227
  "& .colorpicker": {
@@ -252,14 +252,38 @@ const useCommonStyle = theme => ({
252
252
  }
253
253
  },
254
254
  "& .colorPickerActionBtns": {
255
- backgroundColor: theme?.palette?.editor?.background,
255
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
256
256
  display: "flex",
257
257
  justifyContent: "end",
258
258
  padding: "10px",
259
259
  position: "sticky",
260
260
  bottom: 0,
261
261
  right: 0,
262
- boxShadow: "0px -3px 12px 0px #00000017"
262
+ boxShadow: `0px -3px 12px 0px ${theme?.palette?.editor?.cardShadow}`,
263
+ gap: "8px",
264
+ "& button": {
265
+ fontWeight: 600,
266
+ fontSize: "14px",
267
+ opacity: 1,
268
+ borderRadius: "8px",
269
+ textTransform: "math-auto",
270
+ padding: "4px 20px",
271
+ height: "fit-content",
272
+ minWidth: "90px",
273
+ "@media only screen and (max-width: 899px)": {
274
+ width: "50%"
275
+ },
276
+ "&.confirmBtn": {
277
+ backgroundColor: "#2563EB",
278
+ color: "#ffffff",
279
+ border: `1px solid #2563EB`
280
+ },
281
+ "&.cancelBtn": {
282
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground,
283
+ color: theme?.palette?.editor?.customDialogueCloseBtnColor,
284
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`
285
+ }
286
+ }
263
287
  }
264
288
  },
265
289
  colorPickerBtnBorder: {
@@ -11,16 +11,15 @@ const withLinks = editor => {
11
11
  // remove empty inline
12
12
  editor.normalizeNode = entry => {
13
13
  const [node, path] = entry;
14
-
15
- // if (!editor.children.length) {
16
- // Transforms.insertNodes(editor, {
17
- // type: "paragraph",
18
- // children: [{ text: "" }],
19
- // });
20
-
21
- // return;
22
- // }
23
-
14
+ if (!editor.children.length && !editor.isChatEditor) {
15
+ Transforms.insertNodes(editor, {
16
+ type: "paragraph",
17
+ children: [{
18
+ text: ""
19
+ }]
20
+ });
21
+ return;
22
+ }
24
23
  if (Element.isElement(node) && node.type === "paragraph") {
25
24
  const children = Array.from(Node.children(editor, path));
26
25
  for (const [child, childPath] of children) {
@@ -1,6 +1,5 @@
1
1
  import React, { useRef, useState } from "react";
2
2
  import { Accordion, AccordionDetails, AccordionSummary, Button, Fade, Grid, IconButton, Popper, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
3
 
5
4
  // Style
6
5
  import Style from "./style";
@@ -9,6 +8,7 @@ import StyleBuilder from "../../common/StyleBuilder";
9
8
  import { fontOptions } from "../../utils/font";
10
9
  import { useEditorTheme } from "../../hooks/useEditorTheme";
11
10
  import { getBreakPointsValue, getElementProperty, getTRBLBreakPoints } from "../../helper/theme";
11
+ import { KeyboardArrowDownRounded } from "@mui/icons-material";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const buttonStyle = [{
@@ -210,7 +210,7 @@ const Buttons = props => {
210
210
  onChange: () => onSettingsChange(type),
211
211
  expanded: openSettings === type,
212
212
  children: [/*#__PURE__*/_jsx(AccordionSummary, {
213
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
213
+ expandIcon: /*#__PURE__*/_jsx(KeyboardArrowDownRounded, {}),
214
214
  "aria-controls": "panel1-content",
215
215
  id: "panel1-header",
216
216
  children: "Buttons"
@@ -1,12 +1,11 @@
1
1
  import React from "react";
2
2
  import { Accordion, AccordionDetails, AccordionSummary, Divider, FormControlLabel, Grid, IconButton, Radio, RadioGroup, ToggleButton, ToggleButtonGroup, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
3
 
5
4
  // Style
6
5
  import Style from "./style";
7
6
 
8
7
  // icons
9
- import { ChevronLeft } from "@mui/icons-material";
8
+ import { ChevronLeft, KeyboardArrowDownRounded } from "@mui/icons-material";
10
9
  import { EditIcon } from "../icons";
11
10
  import ColorPickerButton from "../../common/ColorPickerButton";
12
11
  import { getContrastColor } from "../../utils/helper";
@@ -86,7 +85,7 @@ const ColorTheme = props => {
86
85
  onChange: () => onSettingsChange(type),
87
86
  expanded: openSettings === type,
88
87
  children: [/*#__PURE__*/_jsx(AccordionSummary, {
89
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
88
+ expandIcon: /*#__PURE__*/_jsx(KeyboardArrowDownRounded, {}),
90
89
  "aria-controls": "panel1-content",
91
90
  id: "panel1-header",
92
91
  children: "Color Theme"
@@ -184,7 +183,7 @@ const ColorTheme = props => {
184
183
  children: /*#__PURE__*/_jsx(EditIcon, {})
185
184
  }), /*#__PURE__*/_jsx(Typography, {
186
185
  variant: "body2",
187
- className: "fs-12 valyeText",
186
+ className: "fs-10 valyeText",
188
187
  style: {
189
188
  color: textColor
190
189
  },
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import { Accordion, AccordionDetails, AccordionSummary, Checkbox, Divider, Fade, FormControlLabel, Grid, IconButton, Paper, Popper, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
3
 
5
4
  // Style
6
5
  import Style from "./style";
@@ -15,6 +14,7 @@ import PreviewElement from "./PreviewElement";
15
14
  import FontFamilyAutocomplete from "../../Toolbar/FormatTools/FontFamilyAutocomplete";
16
15
  import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList";
17
16
  import { CheckedBoxCheckIcon } from "../../common/iconListV2";
17
+ import { KeyboardArrowDownRounded } from "@mui/icons-material";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const Fonts = props => {
@@ -126,7 +126,7 @@ const Fonts = props => {
126
126
  onChange: () => onSettingsChange(type),
127
127
  expanded: openSettings === type,
128
128
  children: [/*#__PURE__*/_jsx(AccordionSummary, {
129
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
129
+ expandIcon: /*#__PURE__*/_jsx(KeyboardArrowDownRounded, {}),
130
130
  "aria-controls": "panel1-content",
131
131
  id: "panel1-header",
132
132
  children: "Fonts"
@@ -42,7 +42,8 @@ const Style = ({
42
42
  whiteSpace: "nowrap",
43
43
  overflow: "hidden",
44
44
  textOverflow: "ellipsis",
45
- color: `${appTheme?.palette?.editor?.textColor} !important`
45
+ color: `${appTheme?.palette?.editor?.textColor} !important`,
46
+ margin: "0px"
46
47
  },
47
48
  ".MuiAutocomplete-input": {
48
49
  color: appTheme?.palette?.editor?.textColor
@@ -6,7 +6,6 @@ import Style from "./style";
6
6
 
7
7
  // icons
8
8
  import { CloseIcon } from "../common/iconslist";
9
- import { ChevronLeft } from "@mui/icons-material";
10
9
  import { TickIcon } from "./icons";
11
10
  import ColorTheme from "./colorTheme";
12
11
  import Buttons from "./buttons";
@@ -14,6 +13,7 @@ import Fonts from "./fonts";
14
13
  import { useEditorTheme } from "../hooks/useEditorTheme";
15
14
  import ActiveTheme from "./ActiveTheme";
16
15
  import SaveTheme from "../themeSettingsAI/saveTheme";
16
+ import BackIcon from "../assets/svg/BackIcon";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -57,7 +57,8 @@ const ThemeSettings = props => {
57
57
  const {
58
58
  id,
59
59
  name,
60
- mood_name
60
+ mood_name,
61
+ template_tag
61
62
  } = userSelectedTheme || {};
62
63
  const onClose = () => setOpen(false);
63
64
  const getThemesList = async themeTabType => {
@@ -66,7 +67,8 @@ const ThemeSettings = props => {
66
67
  try {
67
68
  const themeType = themeTabType === 0 ? "default" : "";
68
69
  const result = await services("getThemes", {
69
- type: themeType
70
+ type: themeType,
71
+ template_tag
70
72
  });
71
73
  setThemes(result?.data || []);
72
74
  } catch (err) {
@@ -102,6 +104,7 @@ const ThemeSettings = props => {
102
104
  const result = await services("saveTheme", {
103
105
  type,
104
106
  id,
107
+ template_tag,
105
108
  ...formData,
106
109
  theme: userSelectedTheme?.theme
107
110
  });
@@ -147,19 +150,22 @@ const ThemeSettings = props => {
147
150
  className: "themeCard",
148
151
  gap: 2,
149
152
  children: [/*#__PURE__*/_jsxs(Grid, {
153
+ style: {
154
+ width: "90px"
155
+ },
150
156
  children: [/*#__PURE__*/_jsx(Typography, {
151
157
  variant: "body1",
152
158
  className: "title",
153
159
  style: {
154
160
  whiteSpace: "nowrap",
155
- maxWidth: "100px",
156
161
  textOverflow: "ellipsis",
157
- overflow: "hidden"
162
+ overflow: "hidden",
163
+ fontWeight: "500"
158
164
  },
159
165
  children: name
160
166
  }), /*#__PURE__*/_jsx(Typography, {
161
167
  variant: "body2",
162
- className: "fs-12 textSecondary",
168
+ className: "fs-12 textSecondary moodName",
163
169
  children: mood_name
164
170
  })]
165
171
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -206,10 +212,9 @@ const ThemeSettings = props => {
206
212
  container: true,
207
213
  justifyContent: "space-between",
208
214
  wrap: "nowrap",
209
- className: "header",
210
- sx: {
211
- px: 2
212
- },
215
+ className: "header"
216
+ // sx={{ px: 2 }}
217
+ ,
213
218
  children: [/*#__PURE__*/_jsxs(Grid, {
214
219
  children: [/*#__PURE__*/_jsx(Typography, {
215
220
  variant: "body1",
@@ -218,6 +223,9 @@ const ThemeSettings = props => {
218
223
  }), /*#__PURE__*/_jsxs(Typography, {
219
224
  variant: "body1",
220
225
  className: "fs-12 textSecondary",
226
+ sx: {
227
+ mt: 0.5
228
+ },
221
229
  children: ["Change the entire style of your website with a single click.", " "]
222
230
  })]
223
231
  }), /*#__PURE__*/_jsx(IconButton, {
@@ -237,7 +245,7 @@ const ThemeSettings = props => {
237
245
  children: [/*#__PURE__*/_jsx(IconButton, {
238
246
  onClick: () => setThemeMoodboard(false),
239
247
  className: "backBtn",
240
- children: /*#__PURE__*/_jsx(ChevronLeft, {})
248
+ children: /*#__PURE__*/_jsx(BackIcon, {})
241
249
  }), "Theme Moodboard"]
242
250
  }), /*#__PURE__*/_jsx(Box, {
243
251
  sx: {
@@ -286,7 +294,7 @@ const ThemeSettings = props => {
286
294
  children: [/*#__PURE__*/_jsx(Grid, {
287
295
  sx: {
288
296
  px: 1,
289
- mt: 2
297
+ mt: 1
290
298
  },
291
299
  children: /*#__PURE__*/_jsx(ColorTheme, {
292
300
  colors: getColors(colors),
@@ -300,7 +308,7 @@ const ThemeSettings = props => {
300
308
  }), /*#__PURE__*/_jsx(Grid, {
301
309
  sx: {
302
310
  px: 1,
303
- mt: 2
311
+ mt: 1
304
312
  },
305
313
  children: /*#__PURE__*/_jsx(Fonts, {
306
314
  appTheme: appTheme,
@@ -312,7 +320,7 @@ const ThemeSettings = props => {
312
320
  }), /*#__PURE__*/_jsx(Grid, {
313
321
  sx: {
314
322
  px: 1,
315
- mt: 2
323
+ mt: 1
316
324
  },
317
325
  children: /*#__PURE__*/_jsx(Buttons, {
318
326
  appTheme: appTheme,
@@ -334,7 +342,8 @@ const ThemeSettings = props => {
334
342
  name,
335
343
  mood_name
336
344
  },
337
- addNewTheme: true
345
+ addNewTheme: true,
346
+ appTheme: appTheme
338
347
  }) : null, /*#__PURE__*/_jsx(SaveTheme, {
339
348
  saveBtnLabel: isUpdateTheme ? "Update theme" : "Save to my theme",
340
349
  loading: savingTheme,
@@ -342,7 +351,8 @@ const ThemeSettings = props => {
342
351
  defaultFormData: {
343
352
  name,
344
353
  mood_name
345
- }
354
+ },
355
+ appTheme: appTheme
346
356
  })]
347
357
  }) : null]
348
358
  })
@@ -2,14 +2,25 @@ const Style = ({
2
2
  appTheme
3
3
  }) => {
4
4
  const {
5
- background,
6
5
  textColor,
7
6
  tv_text,
8
7
  uploadFileBg,
9
8
  closeButtonBgColor,
10
9
  closeButtonSvgStroke,
11
- tv_hover_bg,
12
- deviderBgColor
10
+ deviderBgColor,
11
+ activeColor,
12
+ cardOutsetBg,
13
+ cardBorder,
14
+ cardBg,
15
+ selectedCardOutsetBg,
16
+ cardBorder2,
17
+ cardShadow,
18
+ sidebarBorder,
19
+ cardBg2,
20
+ miniToolBarBackground,
21
+ closeButtonBackground,
22
+ customDialogueCloseBtnColor,
23
+ customDialogueCloseBtnBorder
13
24
  } = appTheme?.palette?.editor || {};
14
25
  return {
15
26
  ".fs-12": {
@@ -18,6 +29,9 @@ const Style = ({
18
29
  ".fs-14": {
19
30
  fontSize: "14px"
20
31
  },
32
+ ".fs-10": {
33
+ fontSize: "10px"
34
+ },
21
35
  ".fw-500": {
22
36
  fontWeight: "500"
23
37
  },
@@ -31,10 +45,15 @@ const Style = ({
31
45
  textTransform: "none"
32
46
  },
33
47
  "& .MuiDrawer-paper": {
34
- background: background,
48
+ background: cardBg,
35
49
  color: textColor,
50
+ border: `1px solid ${sidebarBorder}`,
36
51
  display: "flex",
37
- flexDirection: "column"
52
+ flexDirection: "column",
53
+ fontFamily: '"Inter", sans-serif'
54
+ },
55
+ "& .MuiTypography-root": {
56
+ fontFamily: '"Inter", sans-serif'
38
57
  },
39
58
  "& .textSecondary": {
40
59
  color: tv_text
@@ -47,20 +66,27 @@ const Style = ({
47
66
  flexGrow: 1,
48
67
  ".header": {
49
68
  borderBottom: `1px solid ${deviderBgColor}`,
50
- paddingBottom: "16px",
51
- marginBottom: "16px"
69
+ width: "calc(100% - 32px)",
70
+ margin: "auto",
71
+ marginBottom: "16px",
72
+ paddingBottom: "16px"
52
73
  }
53
74
  },
54
75
  ".title": {
55
- fontWeight: "700",
76
+ fontWeight: "600",
56
77
  fontSize: "14px"
57
78
  },
79
+ ".moodName": {
80
+ whiteSpace: "nowrap",
81
+ overflow: "hidden",
82
+ textOverflow: "ellipsis"
83
+ },
58
84
  ".closeBtn, .backBtn": {
59
- width: "26px",
60
- height: "26px",
85
+ width: "20px",
86
+ height: "20px",
61
87
  BorderRadius: "4px",
62
88
  flexShrik: "0",
63
- padding: "4px",
89
+ padding: "1px",
64
90
  borderRadius: "4px",
65
91
  background: closeButtonBgColor,
66
92
  color: `${closeButtonSvgStroke} !important`,
@@ -69,7 +95,7 @@ const Style = ({
69
95
  }
70
96
  },
71
97
  ".activeTheme": {
72
- background: uploadFileBg,
98
+ background: cardOutsetBg,
73
99
  padding: "14px 10px",
74
100
  borderRadius: "4px"
75
101
  },
@@ -77,7 +103,8 @@ const Style = ({
77
103
  borderRadius: "7px",
78
104
  padding: "16px",
79
105
  boxShadow: "1px 2px 5px 0px #00000014",
80
- background: background
106
+ background: cardBg,
107
+ border: `1px solid ${cardBorder}`
81
108
  },
82
109
  "& .activeThemeTitle": {
83
110
  paddingBottom: "6px"
@@ -101,12 +128,14 @@ const Style = ({
101
128
  padding: "16px",
102
129
  border: `1px solid ${uploadFileBg}`,
103
130
  boxShadow: "1px 2px 5px 0px #00000014",
104
- background: background,
105
- flexWrap: "nowrap"
131
+ background: cardBg2,
132
+ flexWrap: "nowrap",
133
+ display: "flex",
134
+ justifyContent: "space-between",
135
+ alignItems: "center"
106
136
  },
107
137
  ".themeCardWrapper": {
108
- padding: "10px",
109
- borderRadius: "4px",
138
+ padding: "6px 10px",
110
139
  cursor: "pointer",
111
140
  "&.active": {
112
141
  background: "#ECF2FF"
@@ -131,13 +160,15 @@ const Style = ({
131
160
  },
132
161
  ".sectionDetail": {
133
162
  borderRadius: "4px",
134
- background: background
163
+ background: cardBg
135
164
  },
136
165
  ".sectionTitle": {
137
166
  borderBottom: `1px solid ${deviderBgColor}`,
138
167
  fontWeight: "600",
139
168
  fontSize: "14px",
140
- padding: "10px",
169
+ padding: "10px 0px",
170
+ width: "calc(100% - 20px)",
171
+ margin: "auto",
141
172
  gap: "8px"
142
173
  },
143
174
  // ".activeThemeInnner": {
@@ -147,26 +178,33 @@ const Style = ({
147
178
  // background: "#fff",
148
179
  // },
149
180
  ".activeWrapper": {
150
- background: tv_hover_bg,
181
+ background: selectedCardOutsetBg,
151
182
  padding: "14px 10px",
152
183
  position: "relative",
153
184
  ".tickIcon": {
154
185
  position: "absolute",
155
186
  right: "5px",
156
- top: "8px"
187
+ top: "8px",
188
+ rect: {
189
+ stroke: cardBorder2
190
+ }
157
191
  }
158
192
  },
193
+ ".MuiDivider-root": {
194
+ border: `0.5px solid ${deviderBgColor}`
195
+ },
159
196
  ".settingAccordion": {
160
- background: background,
197
+ background: cardBg2,
161
198
  color: textColor,
162
- border: `1px solid ${deviderBgColor}`,
163
- boxShadow: "none",
199
+ boxShadow: `1px 2px 8px 0px ${cardShadow}`,
200
+ border: `1px solid ${uploadFileBg}`,
164
201
  borderRadius: "8px !important",
165
202
  marginTop: "10px",
166
203
  marginBottom: "10px",
167
204
  padding: "0px 12px",
168
205
  "&.Mui-expanded": {
169
206
  border: `1px solid #2563EB`,
207
+ boxShadow: "1px 2px 14px 0px #2563EB47",
170
208
  "& .MuiAccordionSummary-expandIconWrapper": {
171
209
  color: "#2563EB !important"
172
210
  }
@@ -180,8 +218,9 @@ const Style = ({
180
218
  ".MuiAccordionSummary-root ": {
181
219
  // minHeight: "20px",
182
220
  padding: "0px",
221
+ minHeight: "42px !important",
183
222
  "&.Mui-expanded": {
184
- minHeight: "48px !important",
223
+ // minHeight: "48px !important",
185
224
  borderBottom: `1px solid ${deviderBgColor}`
186
225
  }
187
226
  },
@@ -203,17 +242,50 @@ const Style = ({
203
242
  position: "sticky",
204
243
  bottom: "0px",
205
244
  right: "0px",
206
- boxShadow: "0px -3px 12px 0px #00000017",
245
+ boxShadow: `0px -3px 12px 0px ${cardShadow}`,
207
246
  padding: "10px",
208
247
  borderRadius: "8px",
209
248
  display: "flex",
210
249
  justifyContent: "end",
211
250
  alignItems: "center",
212
- gap: "8px",
213
- background: background
251
+ gap: "6px",
252
+ background: cardBg,
253
+ "& .outlineBtn": {
254
+ background: miniToolBarBackground
255
+ },
256
+ "& button": {
257
+ fontWeight: 600,
258
+ fontSize: "14px",
259
+ opacity: 1,
260
+ borderRadius: "8px",
261
+ textTransform: "math-auto",
262
+ padding: "4px 20px",
263
+ height: "fit-content",
264
+ minWidth: "90px",
265
+ "@media only screen and (max-width: 899px)": {
266
+ width: "50%"
267
+ },
268
+ "&.confirmBtn": {
269
+ backgroundColor: "#2563EB",
270
+ color: "#ffffff",
271
+ border: `1px solid #2563EB`
272
+ },
273
+ "&.cancelBtn": {
274
+ backgroundColor: closeButtonBackground,
275
+ color: customDialogueCloseBtnColor,
276
+ border: `1px solid ${customDialogueCloseBtnBorder}`
277
+ }
278
+ }
214
279
  },
215
280
  ".tabWrapper": {
216
- borderBottom: `1px solid ${deviderBgColor}`
281
+ borderBottom: `1px solid ${deviderBgColor}`,
282
+ marginBottom: "6px",
283
+ "& .Mui-selected": {
284
+ color: activeColor
285
+ },
286
+ "& .MuiTabs-indicator": {
287
+ backgroundColor: activeColor
288
+ }
217
289
  }
218
290
  };
219
291
  };
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Box, Button, CircularProgress, Dialog, Divider, Grid, IconButton, TextField, Typography, styled } from "@mui/material";
3
3
 
4
4
  // Style
@@ -65,7 +65,7 @@ const SaveTheme = props => {
65
65
  children: saveBtnLabel
66
66
  }), /*#__PURE__*/_jsx(Dialog, {
67
67
  fullWidth: true,
68
- maxWidth: "sm",
68
+ maxWidth: "xs",
69
69
  open: saveTheme,
70
70
  onClose: onClose,
71
71
  className: className,
@@ -155,16 +155,13 @@ const SaveTheme = props => {
155
155
  sx: {
156
156
  mt: 3
157
157
  },
158
+ className: "saveThemeActionBtns",
158
159
  children: [/*#__PURE__*/_jsx(Button, {
159
- variant: "outlined",
160
- className: "seondaryOutlineBtn",
161
- color: "secondary",
160
+ className: "cancelBtn",
162
161
  onClick: onClose,
163
162
  children: "Cancel"
164
163
  }), /*#__PURE__*/_jsx(Button, {
165
- variant: "contained",
166
- color: "primary",
167
- className: "blueBtn",
164
+ className: "confirmBtn",
168
165
  sx: {
169
166
  ml: 1
170
167
  },
@@ -1,4 +1,6 @@
1
- const style = () => ({
1
+ const style = ({
2
+ appTheme: theme
3
+ }) => ({
2
4
  ".fs-12": {
3
5
  fontSize: "12px"
4
6
  },
@@ -139,7 +141,7 @@ const style = () => ({
139
141
  },
140
142
  ".outlineBtn": {
141
143
  color: "#2563EB",
142
- borderRadius: "8px",
144
+ borderRadius: "10px",
143
145
  boxShadow: "0px 4px 10px 0px #00000026",
144
146
  border: "1px solid #2563EB",
145
147
  background: "#EBF1F9",
@@ -253,7 +255,70 @@ const style = () => ({
253
255
  borderRadius: "126px"
254
256
  },
255
257
  ".MuiDialog-paper": {
256
- borderRadius: "10px"
258
+ borderRadius: "10px",
259
+ background: theme?.palette?.editor?.miniToolBarBackground
260
+ },
261
+ "& .MuiInputBase-root": {
262
+ borderRadius: "8px",
263
+ background: theme?.palette?.editor?.inputFieldBgColor,
264
+ border: `none`,
265
+ height: "40px",
266
+ boxShadow: "0px 4px 16px 0px #0000000D",
267
+ fontFamily: "Inter, sans-serif",
268
+ "&:hover .MuiOutlinedInput-notchedOutline": {
269
+ border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
270
+ },
271
+ "& input::placeholder": {
272
+ color: "#94A3B8 !important",
273
+ opacity: "unset",
274
+ fontFamily: "Inter, sans-serif"
275
+ },
276
+ "& .colorPickerButton": {
277
+ border: `2px solid ${theme?.palette?.editor?.buttonBorder2} !important`
278
+ }
279
+ },
280
+ "& .MuiInputBase-root:has(.colorPickerButton)": {
281
+ "& .MuiInputBase-input": {
282
+ padding: "8.5px 14px 8.5px 0px",
283
+ fontFamily: "Inter, sans-serif"
284
+ }
285
+ },
286
+ "& .MuiInputBase-input": {
287
+ color: theme?.palette?.editor?.deletePopUpButtonTextColor,
288
+ textTransform: "math-auto",
289
+ fontFamily: "Inter, sans-serif"
290
+ },
291
+ "& .MuiOutlinedInput-notchedOutline": {
292
+ border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
293
+ },
294
+ "& fieldset": {
295
+ border: `1px solid transparent`,
296
+ borderRadius: "8px"
297
+ },
298
+ "& .saveThemeActionBtns": {
299
+ "& button": {
300
+ fontWeight: 600,
301
+ fontSize: "14px",
302
+ opacity: 1,
303
+ borderRadius: "8px",
304
+ textTransform: "math-auto",
305
+ padding: "4px 20px",
306
+ height: "fit-content",
307
+ minWidth: "90px",
308
+ "@media only screen and (max-width: 899px)": {
309
+ width: "50%"
310
+ },
311
+ "&.confirmBtn": {
312
+ backgroundColor: "#2563EB",
313
+ color: "#ffffff",
314
+ border: `1px solid #2563EB`
315
+ },
316
+ "&.cancelBtn": {
317
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground,
318
+ color: theme?.palette?.editor?.customDialogueCloseBtnColor,
319
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`
320
+ }
321
+ }
257
322
  }
258
323
  });
259
324
  export default style;
@@ -1,6 +1,5 @@
1
1
  import { Path, Transforms } from "slate";
2
2
  import insertNewLine from "./insertNewLine";
3
- import { windowVar } from "./helper";
4
3
  import { getCurrentElementText } from "../plugins/withHTML";
5
4
  export const insertButton = editor => {
6
5
  const button = {
@@ -11,22 +10,7 @@ export const insertButton = editor => {
11
10
  buttonLink: {
12
11
  linkType: "webAddress"
13
12
  },
14
- iconPosition: "start",
15
- bgColor: "#2563EB",
16
- textColor: "#FFF",
17
- borderRadius: {
18
- topLeft: 30,
19
- topRight: 30,
20
- bottomLeft: 30,
21
- bottomRight: 30
22
- },
23
- bannerSpacing: {
24
- left: 16,
25
- top: 8,
26
- right: 16,
27
- bottom: 8
28
- },
29
- ...(windowVar.lastButtonProps || {})
13
+ iconPosition: "start"
30
14
  };
31
15
  const hasText = getCurrentElementText(editor);
32
16
  const insertPath = hasText ? Path.next(Path.parent(editor?.selection.focus.path)) : editor?.selection.focus.path;
@@ -1,5 +1,4 @@
1
1
  import { Transforms } from "slate";
2
- import insertNewLine from "./insertNewLine";
3
2
  import scrollToNewSection from "../helper/RnD/scrollToNewSection";
4
3
  const Default_text_Node = {
5
4
  type: "paragraph",
@@ -904,8 +904,8 @@ function convertColorToRgb(color) {
904
904
  return color;
905
905
  }
906
906
  }
907
- export const getSelectedColor = (selectedColor, theme) => {
908
- const colorVars = theme?.vars?.colors;
907
+ export const getSelectedColor = (selectedColor, theme, hideThemeColors) => {
908
+ const colorVars = hideThemeColors ? null : theme?.vars?.colors;
909
909
  let selectedValue = selectedColor;
910
910
  if (colorVars) {
911
911
  const convertedColor = convertColorToRgb(selectedColor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "9.8.4",
3
+ "version": "9.8.6",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"