@flozy/editor 5.2.0 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -115,7 +115,7 @@ const Styles = theme => ({
115
115
  overflow: "auto",
116
116
  // width: "240px",
117
117
  minWidth: "200px",
118
- border: `1px solid${theme?.palette?.editor?.popUpBorderColor}`,
118
+ border: `1px solid ${theme?.palette?.editor?.popUpBorderColor}`,
119
119
  padding: "6px"
120
120
  },
121
121
  optionWrapper: {
@@ -11,6 +11,7 @@ import { handleLinkType, windowVar } from "../../utils/helper";
11
11
  import LinkSettings from "../../common/LinkSettings";
12
12
  import Icon from "../../common/Icon";
13
13
  import { useEditorContext } from "../../hooks/useMouseMove";
14
+ import useCommonStyle from "../../commonStyle";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  import { Fragment as _Fragment } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -36,6 +37,7 @@ const EditorButton = props => {
36
37
  const [edit, setEdit] = useState(false);
37
38
  const [openNav, setOpenNav] = useState(false);
38
39
  const [openMoreOptions, setOpenMoreOptions] = useState(false);
40
+ const classes = useCommonStyle(appTheme);
39
41
  const {
40
42
  label,
41
43
  bgColor,
@@ -136,6 +138,7 @@ const EditorButton = props => {
136
138
  arrow: true,
137
139
  children: /*#__PURE__*/_jsx(IconButton, {
138
140
  onClick: onMenuClick("edit"),
141
+ sx: classes.buttonMoreOption,
139
142
  children: /*#__PURE__*/_jsx(Icon, {
140
143
  icon: "pagesSettings"
141
144
  })
@@ -145,6 +148,7 @@ const EditorButton = props => {
145
148
  arrow: true,
146
149
  children: /*#__PURE__*/_jsx(IconButton, {
147
150
  onClick: onMenuClick("nav"),
151
+ sx: classes.buttonMoreOption,
148
152
  children: /*#__PURE__*/_jsx(Icon, {
149
153
  icon: "link"
150
154
  })
@@ -157,7 +161,8 @@ const EditorButton = props => {
157
161
  sx: {
158
162
  display: "inline-flex",
159
163
  color: "rgba(0, 0, 0, 0.54)",
160
- marginBottom: "0px !important"
164
+ marginBottom: "0px !important",
165
+ ...classes.buttonMoreOption
161
166
  },
162
167
  ...btnProps,
163
168
  children: /*#__PURE__*/_jsx(Icon, {
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Node, Transforms } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
- import { Tooltip, IconButton } from "@mui/material";
4
+ import { Tooltip, IconButton, Box } from "@mui/material";
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -53,7 +53,7 @@ const CarouselItem = props => {
53
53
  return /*#__PURE__*/_jsx("div", {
54
54
  ...attributes,
55
55
  className: "carousel-item",
56
- children: /*#__PURE__*/_jsxs("div", {
56
+ children: /*#__PURE__*/_jsxs(Box, {
57
57
  className: "carousel-item-inner",
58
58
  style: {
59
59
  minHeight: "50px",
@@ -61,6 +61,14 @@ const CarouselItem = props => {
61
61
  justifyContent: "center",
62
62
  alignItems: "center"
63
63
  },
64
+ sx: {
65
+ "& .ico-grp-ss": {
66
+ position: "absolute",
67
+ top: "0px",
68
+ right: "0px",
69
+ display: "flex"
70
+ }
71
+ },
64
72
  children: [children, /*#__PURE__*/_jsx(Toolbar, {})]
65
73
  })
66
74
  });
@@ -83,6 +83,7 @@ const DataView = props => {
83
83
  ...attributes,
84
84
  className: "fe-dataview",
85
85
  sx: classes.root,
86
+ contentEditable: false,
86
87
  children: /*#__PURE__*/_jsxs(DataViewProvider, {
87
88
  initialData: {
88
89
  properties,
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { Box, Checkbox, Popper } from "@mui/material";
3
+ import CheckBoxTwoToneIcon from "@mui/icons-material/CheckBoxTwoTone";
3
4
  import DataTypes from "./DataTypes";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -58,7 +59,8 @@ const ColumnView = props => {
58
59
  sx: {
59
60
  mr: 0
60
61
  },
61
- checked: selected
62
+ checked: selected,
63
+ checkedIcon: /*#__PURE__*/_jsx(CheckBoxTwoToneIcon, {})
62
64
  })
63
65
  }) : null]
64
66
  });
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
2
  import { useDataView } from "../../Providers/DataViewProvider";
3
3
  import Checkbox from "@mui/material/Checkbox";
4
- import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
5
- import CheckCircleIcon from "@mui/icons-material/CheckCircle";
4
+ import Icon from "../../../../common/Icon";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  const CheckType = props => {
8
7
  const {
@@ -21,8 +20,12 @@ const CheckType = props => {
21
20
  };
22
21
  return /*#__PURE__*/_jsx(Checkbox, {
23
22
  checked: value,
24
- icon: /*#__PURE__*/_jsx(CheckCircleOutlineIcon, {}),
25
- checkedIcon: /*#__PURE__*/_jsx(CheckCircleIcon, {}),
23
+ icon: /*#__PURE__*/_jsx(Icon, {
24
+ icon: "checkListButton"
25
+ }),
26
+ checkedIcon: /*#__PURE__*/_jsx(Icon, {
27
+ icon: "checkListButtonActive"
28
+ }),
26
29
  onChange: handleChange,
27
30
  disabled: readOnly
28
31
  }, rowIndex);
@@ -52,7 +52,7 @@ const FilterSort = props => {
52
52
  children: [/*#__PURE__*/_jsx("span", {
53
53
  children: "Sort By"
54
54
  }), /*#__PURE__*/_jsx(IconButton, {
55
- className: "tv-act-ico bg",
55
+ className: "tv-act-ico bg br1",
56
56
  size: "small",
57
57
  onClick: onClose,
58
58
  children: /*#__PURE__*/_jsx(CloseIcon, {})
@@ -50,7 +50,7 @@ const useFilterSortStyles = (theme, appTheme) => ({
50
50
  marginRight: "12px",
51
51
  background: appTheme?.palette?.editor?.tv_ico_bg
52
52
  },
53
- color: appTheme?.palette?.editor?.tv_text_primary,
53
+ color: `${appTheme?.palette?.editor?.tv_text} !important`,
54
54
  "& svg": {
55
55
  width: "16px"
56
56
  }
@@ -60,9 +60,9 @@ const useFilterSortStyles = (theme, appTheme) => ({
60
60
  },
61
61
  "&:hover": {
62
62
  background: appTheme?.palette?.editor?.tv_hover_bg,
63
- color: appTheme?.palette?.editor?.tv_hover_text,
63
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
64
64
  "& .MuiListItemIcon-root": {
65
- color: appTheme?.palette?.editor?.tv_hover_text
65
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`
66
66
  }
67
67
  }
68
68
  }
@@ -70,7 +70,7 @@ const useFilterSortStyles = (theme, appTheme) => ({
70
70
  "& .tv-cf": {
71
71
  "& .MuiInputBase-root": {
72
72
  color: appTheme?.palette?.editor?.tv_text_primary,
73
- background: appTheme?.palette?.editor?.tv_ico_bg,
73
+ background: appTheme?.palette?.editor?.tv_input_bg,
74
74
  borderRadius: "8px",
75
75
  "& svg": {
76
76
  color: appTheme?.palette?.editor?.tv_text_primary
@@ -111,7 +111,7 @@ const FilterView = props => {
111
111
  paddingBottom: "0px"
112
112
  },
113
113
  size: "small",
114
- placeholder: "Search in Table",
114
+ placeholder: "Search here",
115
115
  inputProps: {
116
116
  "aria-label": "search google maps"
117
117
  },
@@ -142,7 +142,7 @@ const EditOption = props => {
142
142
  })
143
143
  })]
144
144
  }), /*#__PURE__*/_jsx(List, {
145
- className: "fe-dv-opt-list st sb",
145
+ className: "fe-dv-opt-list st",
146
146
  children: /*#__PURE__*/_jsxs(ListItemButton, {
147
147
  onClick: onDeleteOption,
148
148
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
@@ -29,7 +29,7 @@ const useOptionsStyles = (theme, appTheme) => ({
29
29
  "& .MuiInputBase-root": {
30
30
  color: appTheme?.palette?.editor?.tv_text_primary,
31
31
  fontSize: "14px",
32
- background: appTheme?.palette?.editor?.tv_ico_bg,
32
+ background: appTheme?.palette?.editor?.tv_input_bg,
33
33
  borderRadius: "8px"
34
34
  },
35
35
  "& .MuiOutlinedInput-notchedOutline": {
@@ -54,7 +54,7 @@ const useOptionsStyles = (theme, appTheme) => ({
54
54
  marginRight: "12px",
55
55
  background: appTheme?.palette?.editor?.tv_ico_bg
56
56
  },
57
- color: appTheme?.palette?.editor?.tv_text_primary,
57
+ color: `${appTheme?.palette?.editor?.tv_text} !important`,
58
58
  "& svg": {
59
59
  width: "16px"
60
60
  }
@@ -64,9 +64,9 @@ const useOptionsStyles = (theme, appTheme) => ({
64
64
  },
65
65
  "&:hover": {
66
66
  background: appTheme?.palette?.editor?.tv_hover_bg,
67
- color: appTheme?.palette?.editor?.tv_hover_text,
67
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
68
68
  "& .MuiListItemIcon-root": {
69
- color: appTheme?.palette?.editor?.tv_hover_text
69
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`
70
70
  }
71
71
  }
72
72
  }
@@ -138,7 +138,7 @@ const useOptionsStyles = (theme, appTheme) => ({
138
138
  justifyContent: "space-between",
139
139
  fontSize: "14px",
140
140
  alignItems: "center",
141
- borderBottom: "1px solid rgba(220, 228, 236, 1)",
141
+ borderBottom: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
142
142
  marginBottom: "8px",
143
143
  "& span": {
144
144
  display: "flex",
@@ -49,9 +49,11 @@ const multiSortRows = (rows, criteria, columnConfig) => {
49
49
  break;
50
50
  case "select":
51
51
  case "multi-select":
52
- comparison = valueA?.map(m => m?.value).join(", ").localeCompare(valueB?.map(m => m?.value).join(", "), undefined, {
53
- sensitivity: "base"
54
- });
52
+ if (Array.isArray(valueA) && Array.isArray(valueB)) {
53
+ comparison = Array.isArray(valueA) ? valueA?.map(m => m?.value).join(", ").localeCompare(valueB?.map(m => m?.value).join(", "), undefined, {
54
+ sensitivity: "base"
55
+ }) : 0;
56
+ }
55
57
  break;
56
58
  case "date":
57
59
  comparison = sortByDate(valueA, valueB);
@@ -69,8 +69,9 @@ const useDataViewStyles = (theme, appTheme) => ({
69
69
  alignItems: "center",
70
70
  "& .MuiButtonBase-root": {
71
71
  padding: "6px",
72
- width: "24px",
73
- height: "24px",
72
+ marginLeft: "4px",
73
+ width: "29px",
74
+ height: "29px",
74
75
  "&.active": {
75
76
  color: "rgba(37, 99, 235, 1)"
76
77
  }
@@ -82,7 +83,8 @@ const useDataViewStyles = (theme, appTheme) => ({
82
83
  transition: "width 1s",
83
84
  "&.open": {
84
85
  width: "fit-content",
85
- border: "1px solid rgba(236, 236, 236, 1)",
86
+ border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
87
+ boxShadow: "0px 4px 18px 0px #0000000D",
86
88
  borderRadius: "8px"
87
89
  },
88
90
  "& input": {
@@ -129,12 +131,16 @@ const useDataViewStyles = (theme, appTheme) => ({
129
131
  fontSize: "14px",
130
132
  "& svg": {
131
133
  width: "16px",
132
- height: "16px"
134
+ height: "16px",
135
+ color: `${appTheme?.palette?.editor?.tv_text}`
133
136
  },
134
137
  "&:hover": {
135
138
  background: appTheme?.palette?.editor?.tv_hover_bg,
136
139
  borderRadius: "8px",
137
- color: appTheme?.palette?.editor?.tv_hover_text
140
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
141
+ "& svg": {
142
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`
143
+ }
138
144
  }
139
145
  }
140
146
  }
@@ -45,7 +45,7 @@ const GridItemToolbar = props => {
45
45
  onAddColumn,
46
46
  columnRef
47
47
  } = props;
48
- return selected && !showTool ? /*#__PURE__*/_jsxs(Popper, {
48
+ return selected && !showTool ? /*#__PURE__*/_jsx(Popper, {
49
49
  anchorEl: columnRef?.current,
50
50
  open: true,
51
51
  placement: "top-end",
@@ -53,23 +53,26 @@ const GridItemToolbar = props => {
53
53
  className: "gi-tool-pp",
54
54
  disablePortal: true,
55
55
  contentEditable: false,
56
- children: [/*#__PURE__*/_jsx(Tooltip, {
57
- title: "Column Settings",
58
- arrow: true,
59
- children: /*#__PURE__*/_jsx(IconButton, {
60
- size: "small",
61
- onClick: onSettings,
62
- children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
63
- })
64
- }), /*#__PURE__*/_jsx(Tooltip, {
65
- title: "Add Column",
66
- arrow: true,
67
- children: /*#__PURE__*/_jsx(IconButton, {
68
- size: "small",
69
- onClick: onAddColumn,
70
- children: /*#__PURE__*/_jsx(AddIcon, {})
71
- })
72
- })]
56
+ children: /*#__PURE__*/_jsxs(Box, {
57
+ className: "ico-grp-ss",
58
+ children: [/*#__PURE__*/_jsx(Tooltip, {
59
+ title: "Column Settings",
60
+ arrow: true,
61
+ children: /*#__PURE__*/_jsx(IconButton, {
62
+ size: "small",
63
+ onClick: onSettings,
64
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
65
+ })
66
+ }), /*#__PURE__*/_jsx(Tooltip, {
67
+ title: "Add Column",
68
+ arrow: true,
69
+ children: /*#__PURE__*/_jsx(IconButton, {
70
+ size: "small",
71
+ onClick: onAddColumn,
72
+ children: /*#__PURE__*/_jsx(AddIcon, {})
73
+ })
74
+ })]
75
+ })
73
76
  }) : null;
74
77
  };
75
78
  const GridItem = props => {
@@ -12,7 +12,12 @@ const SimpleTextStyle = ({
12
12
  opacity: 0
13
13
  }
14
14
  },
15
- "&.dataView, &.signature": {
15
+ "&.grid": {
16
+ "& .placeholder-simple-text": {
17
+ opacity: 0
18
+ }
19
+ },
20
+ "&.dataView": {
16
21
  "& .placeholder-simple-text": {
17
22
  opacity: 0
18
23
  }
@@ -4,7 +4,9 @@ const TableStyles = theme => {
4
4
  closeButtonSvgStroke,
5
5
  activeColor,
6
6
  signaturePopUpTabButtonSelectedBg,
7
- signaturePopUpTabButtonSelectedSvg
7
+ signaturePopUpTabButtonSelectedSvg,
8
+ aiInputBackground,
9
+ buttonBorder1
8
10
  } = theme?.palette?.editor || {};
9
11
  return {
10
12
  tableToolBar: {
@@ -13,8 +15,8 @@ const TableStyles = theme => {
13
15
  left: 0,
14
16
  transition: "all 0.3s",
15
17
  "& button": {
16
- backgroundColor: background,
17
- border: "1px solid rgba(37, 99, 235, 0.32)",
18
+ backgroundColor: aiInputBackground,
19
+ border: `1px solid ${buttonBorder1}`,
18
20
  boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
19
21
  borderRadius: "50%",
20
22
  padding: "4px",
@@ -32,6 +34,7 @@ const TableStyles = theme => {
32
34
  "&.selected": {
33
35
  outline: `1.5px solid ${activeColor || "#2563EB"}`,
34
36
  background: signaturePopUpTabButtonSelectedBg,
37
+ border: "none",
35
38
  "& svg": {
36
39
  "& path": {
37
40
  stroke: signaturePopUpTabButtonSelectedSvg
@@ -57,7 +57,8 @@ const TableCell = props => {
57
57
  entireTextColor,
58
58
  entireFontFamily,
59
59
  entireFontWeight,
60
- entireTextSize
60
+ entireTextSize,
61
+ size: elementSize
61
62
  } = element;
62
63
  const [parentDOM, setParentDOM] = useState(null);
63
64
  const editor = useSlateStatic();
@@ -275,7 +276,7 @@ const TableCell = props => {
275
276
  const isCellDragging = active?.id && active?.id === cellId;
276
277
  const isRowDragging = isCellDragging && currentDraggingType === "row";
277
278
  const isColDragging = isCellDragging && currentDraggingType === "col";
278
- const width = isHeader ? size?.width || tableSize?.cellWidth : "0px";
279
+ const width = isHeader ? size?.width || tableSize?.cellWidth || elementSize?.width : "0px";
279
280
  const sizeProps = {
280
281
  minWidth: width,
281
282
  maxWidth: width
@@ -77,6 +77,7 @@ const TopBanner = props => {
77
77
  theme
78
78
  } = useEditorContext();
79
79
  const classes = TopBannerStyles(theme);
80
+ const renderHeaderAboveBanner = customProps?.metadata?.renderHeader ? customProps.metadata.renderHeader() : null;
80
81
  return /*#__PURE__*/_jsxs(Box, {
81
82
  component: "div",
82
83
  ...attributes,
@@ -87,7 +88,7 @@ const TopBanner = props => {
87
88
  },
88
89
  contentEditable: false,
89
90
  sx: classes.root,
90
- children: [/*#__PURE__*/_jsx("img", {
91
+ children: [renderHeaderAboveBanner, /*#__PURE__*/_jsx("img", {
91
92
  src: url,
92
93
  alt: "Top Banner",
93
94
  className: "top-banner-wrpr-ele",
@@ -62,13 +62,12 @@ const PopupTool = props => {
62
62
 
63
63
  if (userStoppedSelection && anchorEl && !open) {
64
64
  // for table cell selection
65
- // const isCellsSelected = table.isCellSelected(editor.selection);
66
- // if (!isCellsSelected) {
67
- // }
68
65
  const isCarouselEdit = isCarouselSelected(editor);
66
+ // const isCellsSelected = table.isCellSelected(editor.selection) || isCarouselEdit;
69
67
  if (isCarouselEdit) {
70
68
  Transforms.deselect(editor);
71
- } else {
69
+ }
70
+ if (!isCarouselEdit) {
72
71
  setOpen(true);
73
72
  setPopupType("textFormat");
74
73
  setIsTextSelected(true);
@@ -249,6 +249,15 @@ const useCommonStyle = theme => ({
249
249
  border: `1px solid transparent !important`
250
250
  }
251
251
  }
252
+ },
253
+ buttonMoreOption: {
254
+ background: `${theme?.palette?.editor?.aiInputBackground} !important`,
255
+ border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
256
+ '& svg': {
257
+ '& path': {
258
+ stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
259
+ }
260
+ }
252
261
  }
253
262
  });
254
263
  export default useCommonStyle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"