@flozy/editor 4.8.0 → 4.8.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.
@@ -314,7 +314,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
314
314
  site_id: site_id,
315
315
  page_title: page_title,
316
316
  isIframe: isIframe,
317
- onDrawerOpen: onDrawerOpen
317
+ onDrawerOpen: onDrawerOpen,
318
+ ICON_API: "https://assets.agenciflow.com"
318
319
  };
319
320
  const renderElement = useCallback(props => {
320
321
  return /*#__PURE__*/_jsx(Element, {
@@ -129,7 +129,6 @@ function AppHeader(props) {
129
129
  }
130
130
  };
131
131
  const drawer = /*#__PURE__*/_jsxs(Box, {
132
- onClick: handleDrawerToggle,
133
132
  sx: {
134
133
  textAlign: "center"
135
134
  },
@@ -139,6 +138,7 @@ function AppHeader(props) {
139
138
  my: 2,
140
139
  color: textColor
141
140
  },
141
+ onClick: closeDrawer,
142
142
  children: appLogo && appLogo !== "none" ? /*#__PURE__*/_jsx("img", {
143
143
  alt: `${appTitle} Logo`,
144
144
  style: {
@@ -150,16 +150,20 @@ function AppHeader(props) {
150
150
  }), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(List, {
151
151
  children: menus.map((item, i) => {
152
152
  const buttonProps = handleLinkType(item.url, item.linkType, true, item.target === "_blank");
153
+ const onButtonClick = e => {
154
+ closeDrawer();
155
+ setTimeout(() => {
156
+ buttonProps?.onClick(e);
157
+ }, 200);
158
+ };
153
159
  const onTouchEnd = e => {
154
160
  if (buttonProps?.onTouchEnd) {
155
- buttonProps?.onTouchEnd(e);
156
- closeDrawer();
161
+ onButtonClick(e);
157
162
  }
158
163
  };
159
164
  const onClick = e => {
160
165
  if (buttonProps?.onClick) {
161
- buttonProps?.onClick(e);
162
- closeDrawer();
166
+ onButtonClick(e);
163
167
  }
164
168
  };
165
169
  const props = {
@@ -171,6 +175,9 @@ function AppHeader(props) {
171
175
  disablePadding: true,
172
176
  children: /*#__PURE__*/_jsx(ListItemButton, {
173
177
  ...props,
178
+ component: "button",
179
+ href: "" // to avoid <a> tag
180
+ ,
174
181
  sx: {
175
182
  textAlign: "center"
176
183
  },
@@ -6,14 +6,16 @@ const EmojiPicker = props => {
6
6
  const {
7
7
  onEmojiSelect,
8
8
  onClose,
9
- theme = 'light'
9
+ theme = 'light',
10
+ ...rest
10
11
  } = props;
11
12
  return /*#__PURE__*/_jsx(_Fragment, {
12
13
  children: /*#__PURE__*/_jsx(Picker, {
13
14
  data: data,
14
15
  onEmojiSelect: onEmojiSelect,
15
16
  onClickOutside: onClose,
16
- theme: theme
17
+ theme: theme,
18
+ ...rest
17
19
  })
18
20
  });
19
21
  };
@@ -45,10 +45,9 @@ const useFreeGridStyles = ({
45
45
  }
46
46
  },
47
47
  "&.type_text": {
48
- minHeight: "fit-content !important"
48
+ // minHeight: "fit-content !important",
49
49
  // wordBreak: "break-all",
50
50
  },
51
-
52
51
  "&.enable-1, &.enable-2": {
53
52
  "&.type_text": {
54
53
  // for dark theme
@@ -81,7 +81,6 @@ const Link = props => {
81
81
  const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
82
82
  const navType = getLinkType(linkType, urlPath);
83
83
  const hideOpenLink = navType === "page" || !navType;
84
- console.log("linkType", linkType, navType, hideOpenLink);
85
84
  return selected && focused ? /*#__PURE__*/_jsxs("div", {
86
85
  className: "element-toolbar hr",
87
86
  contentEditable: false,
@@ -117,7 +116,6 @@ const Link = props => {
117
116
  }) : null;
118
117
  };
119
118
  const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
120
- console.log("buttonProps===>", buttonProps);
121
119
  return /*#__PURE__*/_jsxs("div", {
122
120
  className: "link",
123
121
  children: [/*#__PURE__*/_jsx(Box, {
@@ -84,7 +84,8 @@ const FontLoader = props => {
84
84
  });
85
85
  let families = Array.from(fontSet);
86
86
  families = correctFontArray(families.join(", "));
87
- families = families.map(font => font.replace(/\"/g, ""));
87
+ families = families?.map(font => font?.replace(/\"/g, ""));
88
+ families = families?.map(font => font?.replace(", sans-serif", "")); //This is temporary fix for patch
88
89
  loadFontsInBatches(families);
89
90
  }
90
91
  }, []);
@@ -171,14 +171,10 @@ const RnD = props => {
171
171
  anchorEl: rndRef?.current
172
172
  });
173
173
  }
174
- focusSelection(editor, {
175
- path
176
- });
174
+ // focusSelection(editor, { path });temporary fix for scroll issue
177
175
  break;
178
176
  case 2:
179
- focusSelection(editor, {
180
- path
181
- });
177
+ // focusSelection(editor, { path });temporary fix for scroll issue
182
178
  setSelectedElement({
183
179
  path: str_path,
184
180
  enable: EDIT_MODES.includes(childType) ? 2 : 1,
@@ -118,14 +118,14 @@ const SaveAsTemplate = props => {
118
118
  children: "Section"
119
119
  })
120
120
  }), /*#__PURE__*/_jsx(MenuItem, {
121
- value: "Templates",
121
+ value: "Template",
122
122
  children: /*#__PURE__*/_jsx(Typography, {
123
123
  variant: "body1",
124
124
  color: "primary",
125
125
  sx: {
126
126
  fontSize: "14px"
127
127
  },
128
- children: "Templates"
128
+ children: "Template"
129
129
  })
130
130
  })]
131
131
  })
@@ -64,7 +64,7 @@ export const getBorderColor = (color, borderWidth = 3) => {
64
64
  export const absoluteLink = url => {
65
65
  try {
66
66
  if (url?.indexOf("://") === -1) {
67
- return `//${url}`;
67
+ return `/${url}`;
68
68
  }
69
69
  return url;
70
70
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.8.0",
3
+ "version": "4.8.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"