@flozy/editor 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -158,6 +158,7 @@ const FormWorkflow = props => {
158
158
  }), /*#__PURE__*/_jsx(TextField, {
159
159
  multiline: true,
160
160
  margin: "none",
161
+ id: "email_subject",
161
162
  value: subject,
162
163
  onChange: onSubjectChange,
163
164
  fullWidth: true,
@@ -64,7 +64,7 @@ const Workflow = props => {
64
64
  };
65
65
  const saveFormWorkflow = () => {
66
66
  let workflowData = [...workflowList];
67
- let subjectHtml = document?.getElementsByTagName('textarea')[0]?.innerHTML;
67
+ let subjectText = document?.getElementById('email_subject')?.value;
68
68
  let bodyHtml = document?.getElementsByClassName('editorWorkflow')[0]?.innerHTML;
69
69
  let data = {
70
70
  schedule_type: schedule,
@@ -72,7 +72,7 @@ const Workflow = props => {
72
72
  schedule_on: schedule === "after" ? scheduleOn : 0,
73
73
  subject_data: subject,
74
74
  body_data: bodyData,
75
- subject_html: subjectHtml,
75
+ subject_text: subjectText,
76
76
  body_html: bodyHtml
77
77
  };
78
78
  if (flowEdited.isEdited) {
@@ -47,7 +47,8 @@ const withHtml = editor => {
47
47
  const slateHTML = data?.getData("application/x-slate-fragment");
48
48
  const html = data?.getData("text/html");
49
49
  const currentEl = getCurrentElement(editor);
50
- if (slateHTML) {
50
+ const eltype = currentEl?.type;
51
+ if (slateHTML && !formatFragment[eltype]) {
51
52
  const [tableNode] = Editor.nodes(editor, {
52
53
  match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
53
54
  });
@@ -62,7 +63,6 @@ const withHtml = editor => {
62
63
  } else if (html) {
63
64
  const parsed = new DOMParser().parseFromString(html, "text/html");
64
65
  const fragment = deserialize(parsed.body);
65
- const eltype = currentEl?.type;
66
66
  const formattedFragment = formatFragment[eltype] ? formatFragment[eltype](fragment) : fragment;
67
67
  Transforms.insertFragment(editor, formattedFragment);
68
68
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"