@flozy/editor 5.4.6 → 5.4.7

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.
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { Box, Checkbox, Popper, useTheme } from "@mui/material";
3
- import CheckBoxTwoToneIcon from "@mui/icons-material/CheckBoxTwoTone";
4
3
  import DataTypes from "./DataTypes";
5
4
  import useColumnStyles from "./colStyles";
5
+ import Icon from "../../../common/Icon";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
8
  const ColumnView = props => {
@@ -70,7 +70,12 @@ const ColumnView = props => {
70
70
  mr: 0
71
71
  },
72
72
  checked: selected,
73
- checkedIcon: /*#__PURE__*/_jsx(CheckBoxTwoToneIcon, {})
73
+ icon: /*#__PURE__*/_jsx(Icon, {
74
+ icon: "uncheckedIcon"
75
+ }),
76
+ checkedIcon: /*#__PURE__*/_jsx(Icon, {
77
+ icon: "checkedIcon"
78
+ })
74
79
  })
75
80
  }, popperRefresh) : null]
76
81
  });
@@ -4,6 +4,7 @@ import Autocomplete from "@mui/material/Autocomplete";
4
4
  import { Avatar, Box, Chip, useTheme } from "@mui/material";
5
5
  import { useEditorContext } from "../../../../../hooks/useMouseMove";
6
6
  import useCompStyles from "./styles";
7
+ import { CloseIcon } from "../../../../../common/iconslist";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  const AvatarIcon = props => {
9
10
  const {
@@ -102,6 +103,14 @@ export default function Select(props) {
102
103
  renderTags: (value, getTagProps) => {
103
104
  return /*#__PURE__*/_jsx(Box, {
104
105
  className: "tv-ms-tag-wrpr",
106
+ sx: {
107
+ '& svg': {
108
+ marginRight: '5px',
109
+ '& path': {
110
+ stroke: "#000"
111
+ }
112
+ }
113
+ },
105
114
  children: value?.map((option, index) => {
106
115
  const {
107
116
  key,
@@ -114,13 +123,17 @@ export default function Select(props) {
114
123
  label: option?.label || option?.value,
115
124
  ...tagProps,
116
125
  sx: {
117
- background: option?.color || "#CCC",
118
- border: "none"
126
+ background: option?.color || "#F6F6F6",
127
+ border: "none",
128
+ '& .MuiChip-label': {
129
+ paddingLeft: '12px !important'
130
+ }
119
131
  },
120
132
  avatar: /*#__PURE__*/_jsx(AvatarIcon, {
121
133
  option: option,
122
134
  avatar: optionAvatar
123
- })
135
+ }),
136
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {})
124
137
  }, key) : null;
125
138
  })
126
139
  });
@@ -135,12 +148,16 @@ export default function Select(props) {
135
148
  children: /*#__PURE__*/_jsx(Chip, {
136
149
  label: option.label || option.value || "",
137
150
  sx: {
138
- background: option.color || "#CCC"
151
+ background: option.color || appTheme?.palette?.editor?.tv_border1,
152
+ '& .MuiChip-label': {
153
+ paddingLeft: '12px !important'
154
+ }
139
155
  },
140
156
  avatar: /*#__PURE__*/_jsx(AvatarIcon, {
141
157
  option: option,
142
158
  avatar: optionAvatar
143
- })
159
+ }),
160
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {})
144
161
  })
145
162
  }, key);
146
163
  },
@@ -23,6 +23,20 @@ const SimpleSelect = props => {
23
23
  IconComponent: KeyboardArrowDownRoundedIcon,
24
24
  fullWidth: true,
25
25
  size: "small",
26
+ sx: {
27
+ color: appTheme?.palette?.editor?.tv_text,
28
+ fontSize: '14px',
29
+ marginTop: '4px',
30
+ padding: '3px 0px',
31
+ '& .MuiOutlinedInput-notchedOutline': {
32
+ border: `1px solid ${appTheme?.palette?.editor?.inputFieldBorder}`,
33
+ boxShadow: '0px 4px 18px 0px #0000000D'
34
+ },
35
+ "&:hover .MuiOutlinedInput-notchedOutline": {
36
+ border: `1px solid ${appTheme?.palette?.editor?.inputFieldBorder}`,
37
+ boxShadow: '0px 4px 18px 0px #0000000D'
38
+ }
39
+ },
26
40
  MenuProps: {
27
41
  PaperProps: {
28
42
  sx: classes.simpleselect,
@@ -2,7 +2,8 @@ const useCompStyles = (theme, appTheme) => ({
2
2
  simpleselect: {
3
3
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
4
4
  background: appTheme?.palette?.editor?.tv_pop_bg,
5
- color: appTheme?.palette?.editor?.tv_text_primary,
5
+ color: appTheme?.palette?.editor?.tv_text,
6
+ fontSize: '14px',
6
7
  borderRadius: "8px",
7
8
  [theme?.breakpoints?.between("xs", "md")]: {},
8
9
  "& ul": {
@@ -5,7 +5,7 @@ const useFilterSortStyles = (theme, appTheme) => ({
5
5
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
6
6
  background: appTheme?.palette?.editor?.tv_pop_bg,
7
7
  color: appTheme?.palette?.editor?.tv_text_primary,
8
- borderRadius: "20px",
8
+ borderRadius: "20px !important",
9
9
  fontFamily: 'Inter !important',
10
10
  [theme?.breakpoints?.between("xs", "md")]: {
11
11
  borderRadius: "16px 16px 0px 0px",
@@ -63,6 +63,12 @@ const AllProperties = props => {
63
63
  onClick: onEditProperty(m),
64
64
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
65
65
  className: "needBg",
66
+ sx: {
67
+ '& svg': {
68
+ width: '14px !important',
69
+ height: '14px !important'
70
+ }
71
+ },
66
72
  children: /*#__PURE__*/_jsx(Icon, {
67
73
  icon: iconType
68
74
  })
@@ -3,7 +3,7 @@ const useOptionsStyles = (theme, appTheme) => ({
3
3
  "& .MuiPaper-root": {
4
4
  boxShadow: "0px 4px 10px 0px rgba(0, 0, 0, 0.16)",
5
5
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
6
- borderRadius: "20px",
6
+ borderRadius: "20px !important",
7
7
  background: appTheme?.palette?.editor?.tv_pop_bg,
8
8
  fontFamily: 'Inter !important',
9
9
  color: appTheme?.palette?.editor?.tv_text_primary,
@@ -1,7 +1,5 @@
1
1
  import React, { useState } from "react";
2
2
  import { Box, Button, useTheme } from "@mui/material";
3
- import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
4
- import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
5
3
  import { useDataView } from "../Providers/DataViewProvider";
6
4
  import PropertySettings from "./Options";
7
5
  import { PROPERTY_TYPES } from "./Options/Constants";
@@ -16,14 +14,28 @@ const SortIcon = props => {
16
14
  const {
17
15
  sortBy
18
16
  } = props;
19
- return sortBy ? sortBy === "asc" ? /*#__PURE__*/_jsx(KeyboardArrowUpIcon, {
17
+ return sortBy ? sortBy === "asc" ? /*#__PURE__*/_jsx(Box, {
20
18
  sx: {
21
- color: "rgba(37, 99, 235, 1)"
22
- }
23
- }) : /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {
19
+ '& svg': {
20
+ '& path': {
21
+ stroke: "rgba(37, 99, 235, 1) !important"
22
+ }
23
+ }
24
+ },
25
+ children: /*#__PURE__*/_jsx(Icon, {
26
+ icon: 'chervUp'
27
+ })
28
+ }) : /*#__PURE__*/_jsx(Box, {
24
29
  sx: {
25
- color: "rgba(37, 99, 235, 1)"
26
- }
30
+ '& svg': {
31
+ '& path': {
32
+ stroke: "rgba(37, 99, 235, 1) !important"
33
+ }
34
+ }
35
+ },
36
+ children: /*#__PURE__*/_jsx(Icon, {
37
+ icon: 'chervDown'
38
+ })
27
39
  }) : null;
28
40
  };
29
41
  const TableView = props => {
@@ -47,11 +47,19 @@ const useDataViewStyles = (theme, appTheme) => ({
47
47
  },
48
48
  "& .tv-ck-box": {
49
49
  "& svg": {
50
- color: appTheme?.palette?.editor?.tv_border
50
+ color: appTheme?.palette?.editor?.tv_border,
51
+ '& rect': {
52
+ fill: appTheme?.palette?.editor?.tv_chk_box_fill,
53
+ stroke: appTheme?.palette?.editor?.tv_chk_box_stroke
54
+ }
51
55
  },
52
56
  "&.Mui-checked": {
53
57
  "& svg": {
54
- color: "rgba(37, 99, 235, 1)"
58
+ color: "rgba(37, 99, 235, 1)",
59
+ '& rect': {
60
+ fill: appTheme?.palette?.editor?.activeColor,
61
+ stroke: 'none'
62
+ }
55
63
  }
56
64
  }
57
65
  }
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const ChervDown = () => {
3
+ return /*#__PURE__*/_jsx("svg", {
4
+ width: "14",
5
+ height: "14",
6
+ viewBox: "0 0 9 6",
7
+ fill: "none",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ children: /*#__PURE__*/_jsx("path", {
10
+ d: "M1 1.2002L4.5 4.49731L8 1.2002",
11
+ stroke: "#2563EB",
12
+ strokeWidth: "1.2",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round"
15
+ })
16
+ });
17
+ };
18
+ export default ChervDown;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const ChervUp = () => {
3
+ return /*#__PURE__*/_jsx("svg", {
4
+ width: "14",
5
+ height: "14",
6
+ viewBox: "0 0 9 6",
7
+ fill: "none",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ children: /*#__PURE__*/_jsx("path", {
10
+ d: "M8 4.80371L4.5 1.50659L1 4.80371",
11
+ stroke: "#94A3B8",
12
+ strokeWidth: "1.2",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round"
15
+ })
16
+ });
17
+ };
18
+ export default ChervUp;
@@ -40,6 +40,8 @@ import DuplicateIcon from "../assets/svg/DuplicateIcon";
40
40
  import EyeIcon from "../assets/svg/EyeIcon";
41
41
  import TrashIcon from "../assets/svg/TrashCanIcon";
42
42
  import DataTableIcon from "../assets/svg/DataTableIcon";
43
+ import ChervDown from "../assets/svg/ChervDown";
44
+ import ChervUp from "../assets/svg/ChervUp";
43
45
  import { jsx as _jsx } from "react/jsx-runtime";
44
46
  import { jsxs as _jsxs } from "react/jsx-runtime";
45
47
  const iconList = {
@@ -308,7 +310,9 @@ const iconList = {
308
310
  arrowDown: /*#__PURE__*/_jsx(ArrowDownIcon, {}),
309
311
  duplicateIcon: /*#__PURE__*/_jsx(DuplicateIcon, {}),
310
312
  trashIcon: /*#__PURE__*/_jsx(TrashIcon, {}),
311
- dataTable: /*#__PURE__*/_jsx(DataTableIcon, {})
313
+ dataTable: /*#__PURE__*/_jsx(DataTableIcon, {}),
314
+ chervUp: /*#__PURE__*/_jsx(ChervUp, {}),
315
+ chervDown: /*#__PURE__*/_jsx(ChervDown, {})
312
316
  };
313
317
  export const icons = {
314
318
  ...iconList
@@ -1581,10 +1581,10 @@ export const CheckListButtonActive = () => /*#__PURE__*/_jsxs("svg", {
1581
1581
  id: "Gradient1",
1582
1582
  children: [/*#__PURE__*/_jsx("stop", {
1583
1583
  offset: "0%",
1584
- stopColor: "#5351FC"
1584
+ stopColor: "#8361FD"
1585
1585
  }), /*#__PURE__*/_jsx("stop", {
1586
1586
  offset: "50%",
1587
- stopColor: "#19A9FC"
1587
+ stopColor: "#2F63ED"
1588
1588
  })]
1589
1589
  })
1590
1590
  }), /*#__PURE__*/_jsx("rect", {
@@ -160,10 +160,11 @@ const TEXT_TAGS = {
160
160
 
161
161
  const deserialize = el => {
162
162
  if (el.nodeType === 3) {
163
+ // if there is any line-breaks
163
164
  const match = /\r|\n/.exec(el.textContent);
164
165
  const text = el.textContent.replace(/\r|\n/g, "").trim();
165
166
  return match && !text ? null : {
166
- text: el.textContent,
167
+ text,
167
168
  ...getInlineTextStyles(el.parentNode)
168
169
  };
169
170
  } else if (el.nodeType !== 1) {
@@ -4,6 +4,43 @@ import { decodeAndParseBase64 } from "../utils/helper";
4
4
  const avoidDefaultInsert = ["table", "grid"];
5
5
  const NON_TEXT_TAGS = ["ol", "ul", "img", "table", "video", "a", "button", "GOOGLE-SHEETS-HTML-ORIGIN"];
6
6
  const ALLOWED_TEXT_NODES = ["paragraph", "title", "headingOne", "headingTwo", "headingThree"];
7
+ const parseCopiedHTML = html => {
8
+ const parsed = new DOMParser().parseFromString(html, "text/html");
9
+
10
+ // if ol, ul are inside li, remove and push ol,ul after that li to maintain format between our slate list and external source list's json
11
+ parsed.querySelectorAll("li > ul, li > ol").forEach(list => {
12
+ // Find the parent li
13
+ const parentLi = list.parentElement;
14
+
15
+ // Move the list after the parent li
16
+ parentLi.after(list);
17
+ });
18
+
19
+ // to handle google docs list
20
+ parsed.querySelectorAll("li p, li div").forEach(element => {
21
+ const parent = element.parentNode;
22
+ // Move all child nodes of <p> or <div> to its parent <li>
23
+ while (element.firstChild) {
24
+ parent.insertBefore(element.firstChild, element);
25
+ }
26
+ // Remove the <p> or <div> element
27
+ parent.removeChild(element);
28
+ });
29
+
30
+ // claude.ai, copy list inbetween, some li tags are not wrapped with ul or ol
31
+ parsed.querySelectorAll("li").forEach(li => {
32
+ // Check if the parent of <li> is not a <ul> or <ol>
33
+ if (!li.parentElement || li.parentElement.tagName !== "UL" && li.parentElement.tagName !== "OL") {
34
+ // Create a <ul> element
35
+ const ul = document.createElement("ul");
36
+ // Append the <li> to the <ul>
37
+ ul.appendChild(li.cloneNode(true)); // Clone the <li>
38
+ // Replace the original <li> in the DOM with the <ul>
39
+ li.replaceWith(ul);
40
+ }
41
+ });
42
+ return parsed;
43
+ };
7
44
  const loopChildren = (children = [], defaultInsert) => {
8
45
  if (!children?.length) {
9
46
  return defaultInsert;
@@ -193,18 +230,8 @@ const withHtml = editor => {
193
230
  insertData(data);
194
231
  }
195
232
  } else if (html) {
196
- const parsed = new DOMParser().parseFromString(html, "text/html");
197
-
198
- // if ol, ul are inside li, remove and push ol,ul after that li to maintain format between our slate list and external source list's json
199
- parsed.querySelectorAll("li > ul, li > ol").forEach(list => {
200
- // Find the parent li
201
- const parentLi = list.parentElement;
202
-
203
- // Move the list after the parent li
204
- parentLi.after(list);
205
- });
233
+ const parsed = parseCopiedHTML(html);
206
234
  const rootElement = parsed.body;
207
- console.log("rootElement", rootElement);
208
235
  const isNonText = rootElement ? rootElement?.querySelector(NON_TEXT_TAGS.toString()) : false;
209
236
  const isGoogleSheet = parsed.body.querySelector("google-sheets-html-origin");
210
237
  if (isGoogleSheet) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.4.6",
3
+ "version": "5.4.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"