@flozy/editor 3.3.6 → 3.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -468,7 +468,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
468
468
  toolbarOptions: toolbarOptions,
469
469
  theme: theme
470
470
  }) : null, /*#__PURE__*/_jsx(PopoverAIInput, {
471
- otherProps: otherProps
471
+ otherProps: otherProps || {}
472
472
  }), footer && (fullScreen || readOnly) && /*#__PURE__*/_jsx(Typography, {
473
473
  sx: {
474
474
  color: "rgb(100, 116, 139)",
@@ -26,13 +26,13 @@ const Form = props => {
26
26
  readOnly,
27
27
  site_id,
28
28
  page_id,
29
- page_title,
30
- onFormSubmit
29
+ onFormSubmit = () => {}
31
30
  } = customProps;
32
31
  const {
33
32
  buttonProps,
34
33
  textColor,
35
34
  formName,
35
+ uid,
36
36
  borderWidth,
37
37
  borderColor,
38
38
  borderStyle,
@@ -78,6 +78,8 @@ const Form = props => {
78
78
  if (event) {
79
79
  event.preventDefault();
80
80
  }
81
+ let headerHtml = document?.getElementsByClassName('app-logo');
82
+ headerHtml = headerHtml[0]?.outerHTML;
81
83
  if ((readOnly || test) && formEle && formEle?.current) {
82
84
  const formData = new FormData(formEle?.current);
83
85
  setLoading(true);
@@ -96,7 +98,8 @@ const Form = props => {
96
98
  meta_data.push({
97
99
  [isMetaKey?.element_metadatakey]: pair[1],
98
100
  type: "board",
99
- metadatamapping: element?.metadatamapping
101
+ metadatamapping: element?.metadatamapping,
102
+ headerHtml: headerHtml
100
103
  });
101
104
  }
102
105
  const fieldData = getFieldProps("name", pair[0]);
@@ -124,22 +127,20 @@ const Form = props => {
124
127
  rules: rule?.length > 0 && rule
125
128
  });
126
129
  }
127
- // response = {
128
- // ...response,
129
- // [pair[0]]: pair[1],
130
- // };
131
130
  const placeholder = fieldData?.name === pair[0] ? fieldData?.placeholder : "";
132
131
  response?.push({
132
+ fieldKey: pair[0],
133
133
  [pair[0]]: pair[1],
134
134
  placeholder: placeholder,
135
- from_name: formName,
136
- page_title: page_title
135
+ form_name: formName,
136
+ headerHtml: headerHtml
137
137
  });
138
138
  }
139
139
  let params = {
140
140
  page_id: page_id,
141
141
  site_id: site_id,
142
142
  form_id: `${formName}`,
143
+ uid: `${page_id}_${uid ? uid : formName}`,
143
144
  response: response,
144
145
  form_data: {
145
146
  user_email: user_email,
@@ -115,7 +115,7 @@ const ELEMENTS_LIST = [{
115
115
  icon: /*#__PURE__*/_jsx(Icon, {
116
116
  icon: "embed"
117
117
  }),
118
- onInsert: editor => insertDefaultEmbed(editor, "video", "")
118
+ onInsert: editor => insertDefaultEmbed(editor, "embed", "")
119
119
  }, {
120
120
  name: "Calendly",
121
121
  desc: "",
@@ -133,7 +133,7 @@ const formStyle = [{
133
133
  tab: "Add to Boards",
134
134
  value: "metadatamapping",
135
135
  fields: [{
136
- label: "Add each response to contacts board",
136
+ label: "Add response to contacts board",
137
137
  key: "metadatamapping",
138
138
  type: "metadatamapping",
139
139
  compType: "card",
@@ -9,7 +9,7 @@ export const formSubmit = async (formData, props) => {
9
9
  body: JSON.stringify(formData)
10
10
  });
11
11
  const result = await response.json();
12
- return result?.data?.data;
12
+ return result?.data;
13
13
  } catch (err) {
14
14
  console.log(err);
15
15
  return err;
@@ -390,6 +390,10 @@ export const getBlock = props => {
390
390
  return /*#__PURE__*/_jsx(Video, {
391
391
  ...props
392
392
  });
393
+ case "embed":
394
+ return /*#__PURE__*/_jsx(Video, {
395
+ ...props
396
+ });
393
397
  case "calendly":
394
398
  return /*#__PURE__*/_jsx(Video, {
395
399
  ...props
@@ -6,6 +6,7 @@ export const insertForm = (editor, item) => {
6
6
  type: "form",
7
7
  grid: "container",
8
8
  formName: `form_${new Date().getTime()}`,
9
+ uid: `form_${new Date().getTime()}`,
9
10
  props: {
10
11
  onSubmit: null
11
12
  },
@@ -246,7 +246,7 @@ export const handleLinkType = (url, linkType, readOnly, openInNewTab, onClick =
246
246
  const [page, section] = url?.split("#") || [];
247
247
  const sec = section ? `#${section}` : "";
248
248
  const isHome = page === "home" || !page;
249
- props.href = isHome ? `${sec}` : `/${url}`;
249
+ props.href = isHome ? `${sec}` : `./${url}`;
250
250
  if (openInNewTab) {
251
251
  props.target = "_blank";
252
252
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.3.6",
3
+ "version": "3.3.8",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"
@@ -64,7 +64,7 @@
64
64
  "storybook": "storybook dev -p 6006",
65
65
  "build-storybook": "storybook build",
66
66
  "publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",
67
- "publish:local": "rm -rf /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist --copy-files"
67
+ "publish:local": "rm -rf /Users/agenciflow08/Documents/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agenciflow08/Documents/flozy/client/node_modules/@flozy/editor/dist --copy-files"
68
68
  },
69
69
  "eslintConfig": {
70
70
  "extends": [