@flozy/editor 3.3.5 → 3.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,6 +69,8 @@ const Leaf = ({
69
69
  const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
70
70
  const {
71
71
  id,
72
+ site_id,
73
+ page_title,
72
74
  content,
73
75
  onSave,
74
76
  editor: collaborativeEditor,
@@ -276,6 +278,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
276
278
  ...(otherProps || {}),
277
279
  readOnly: isReadOnly,
278
280
  page_id: id,
281
+ site_id: site_id,
282
+ page_title: page_title,
279
283
  onDrawerOpen: onDrawerOpen
280
284
  };
281
285
  const renderElement = useCallback(props => {
@@ -32,6 +32,7 @@ const Form = props => {
32
32
  buttonProps,
33
33
  textColor,
34
34
  formName,
35
+ uid,
35
36
  borderWidth,
36
37
  borderColor,
37
38
  borderStyle,
@@ -80,7 +81,7 @@ const Form = props => {
80
81
  if ((readOnly || test) && formEle && formEle?.current) {
81
82
  const formData = new FormData(formEle?.current);
82
83
  setLoading(true);
83
- let response = {};
84
+ const response = [];
84
85
  let user_email = "";
85
86
  let meta_data = [];
86
87
  const validations = [];
@@ -123,18 +124,23 @@ const Form = props => {
123
124
  rules: rule?.length > 0 && rule
124
125
  });
125
126
  }
126
- response = {
127
- ...response,
128
- [pair[0]]: pair[1]
129
- };
127
+ // response = {
128
+ // ...response,
129
+ // [pair[0]]: pair[1],
130
+ // };
131
+ const placeholder = fieldData?.name === pair[0] ? fieldData?.placeholder : "";
132
+ response?.push({
133
+ [pair[0]]: pair[1],
134
+ placeholder: placeholder,
135
+ form_name: formName
136
+ });
130
137
  }
131
138
  let params = {
132
139
  page_id: page_id,
133
140
  site_id: site_id,
134
141
  form_id: `${formName}`,
135
- response: {
136
- ...response
137
- },
142
+ uid: `${page_id}_${uid ? uid : formName}`,
143
+ response: response,
138
144
  form_data: {
139
145
  user_email: user_email,
140
146
  email: element?.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: "",
@@ -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
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"