@flozy/editor 4.3.1 → 4.3.2

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.
@@ -14,9 +14,10 @@ const Mentions = ({
14
14
  verticalAlign: "baseline",
15
15
  display: "inline-block",
16
16
  borderRadius: "4px",
17
- backgroundColor: "#eee",
17
+ backgroundColor: "#2563EB",
18
18
  fontSize: "0.9em",
19
- boxShadow: selected && focused ? "0 0 0 2px #B4D5FF" : "none"
19
+ boxShadow: selected && focused ? "0 0 0 2px #B4D5FF" : "none",
20
+ color: "#FFF"
20
21
  };
21
22
  // See if our empty text child has any styling marks applied and apply those
22
23
  if (element.children[0].bold) {
@@ -11,6 +11,7 @@ import LinkSettingsStyles from "./style";
11
11
  import { getNavOptions } from "./navOptions";
12
12
  import { ScrollTopBottom, SelectPage, TextInput, Trigger } from "./NavComponents";
13
13
  import SwipeableDrawer from "../SwipeableDrawer";
14
+ import { useEditorContext } from "../../hooks/useMouseMove";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
17
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -30,18 +31,20 @@ function getNav(navType, navOptions) {
30
31
  };
31
32
  }
32
33
  export default function LinkSettings(props) {
34
+ const {
35
+ theme
36
+ } = useEditorContext();
33
37
  const {
34
38
  handleClose,
35
39
  onSave,
36
40
  customProps,
37
41
  navType
38
42
  } = props;
39
- const themeType = localStorage.getItem("themeType");
40
43
  const {
41
44
  isMobile
42
45
  } = customProps;
43
46
  const navOptions = getNavOptions(customProps.hideTools);
44
- const classes = LinkSettingsStyles(themeType);
47
+ const classes = LinkSettingsStyles(theme);
45
48
  const [nav, setNav] = useState(getNav(navType, navOptions));
46
49
  const [navValue, setNavValue] = useState(props?.navValue || "");
47
50
  const [openInNewTab, setOpenInNewTab] = useState(props.openInNewTab || false);
@@ -1,8 +1,5 @@
1
- const ButtonNavSettingsStyles = themeType => ({
1
+ const ButtonNavSettingsStyles = theme => ({
2
2
  dialogContainer: {
3
- "& .MuiPaper-root": {
4
- background: themeType === "dark" ? "#141720 !important" : "#ffffff !important"
5
- },
6
3
  "& .MuiDialogContent-root": {
7
4
  padding: "0px 20px"
8
5
  },
@@ -19,6 +16,23 @@ const ButtonNavSettingsStyles = themeType => ({
19
16
  },
20
17
  "& .MuiGrid-item": {
21
18
  padding: "14px"
19
+ },
20
+ "& .MuiPaper-root": {
21
+ backgroundColor: theme?.palette?.editor?.background,
22
+ "& .MuiTypography-root": {
23
+ color: theme?.palette?.editor?.textColor
24
+ },
25
+ "& .MuiInputBase-root": {
26
+ border: `1px solid ${theme?.palette?.editor?.textColor}`,
27
+ color: theme?.palette?.editor?.textColor
28
+ },
29
+ "& .MuiSvgIcon-root": {
30
+ color: theme?.palette?.editor?.textColor
31
+ },
32
+ "& .MuiFormLabel-root": {
33
+ color: theme?.palette?.editor?.textColor,
34
+ backgroundColor: theme?.palette?.editor?.background
35
+ }
22
36
  }
23
37
  },
24
38
  saveBtn: {
@@ -49,7 +63,7 @@ const ButtonNavSettingsStyles = themeType => ({
49
63
  position: "absolute",
50
64
  right: 8,
51
65
  top: 8,
52
- color: theme => theme.palette.grey[500]
66
+ color: theme?.palette?.grey[500]
53
67
  },
54
68
  gridDivider: {
55
69
  borderRight: "1px solid rgba(0, 0, 0, 0.12)"
@@ -60,7 +74,7 @@ const ButtonNavSettingsStyles = themeType => ({
60
74
  gap: "8px",
61
75
  paddingTop: "14px",
62
76
  marginTop: "14px",
63
- borderTop: theme => `1px solid ${theme.palette.grey[300]}`
77
+ borderTop: `1px solid ${theme?.palette?.grey[300]}`
64
78
  }
65
79
  });
66
80
  export default ButtonNavSettingsStyles;
@@ -11,7 +11,8 @@ const Link = props => {
11
11
  customProps,
12
12
  editor,
13
13
  path,
14
- childType
14
+ childType,
15
+ theme
15
16
  } = props;
16
17
  const pPath = path?.split("|")?.map(m => parseInt(m));
17
18
  const element_path = [...pPath, 0];
@@ -137,7 +138,7 @@ const Link = props => {
137
138
  console.log(err);
138
139
  }
139
140
  };
140
- return blockProps?.navType !== undefined ? /*#__PURE__*/_jsx(LinkSettings, {
141
+ return /*#__PURE__*/_jsx(LinkSettings, {
141
142
  handleClose: onClose,
142
143
  onSave: d => {
143
144
  const upData = getTransformedData(d);
@@ -147,7 +148,8 @@ const Link = props => {
147
148
  onClose();
148
149
  },
149
150
  ...(blockProps || {}),
150
- customProps: customProps
151
- }) : null;
151
+ customProps: customProps,
152
+ theme: theme
153
+ });
152
154
  };
153
155
  export default Link;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"