@bigbinary/neeto-molecules 1.0.64 → 1.0.65

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.
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, useRef } from 'react';
1
+ import React, { forwardRef, useRef, useCallback } from 'react';
2
2
  import { Upload, LeftArrow } from '@bigbinary/neeto-icons';
3
3
  import { Typography, Button, DatePicker, Label } from '@bigbinary/neetoui';
4
4
  import { MultiEmailInput, Input, Switch, ActionBlock, Form as Form$1 } from '@bigbinary/neetoui/formik';
@@ -13,6 +13,7 @@ import { prop } from 'ramda';
13
13
  import * as yup from 'yup';
14
14
  import { string } from 'yup';
15
15
 
16
+ var MemoizedEditorContent = /*#__PURE__*/React.memo(EditorContent);
16
17
  var EmailPreview = function EmailPreview(_ref) {
17
18
  var to = _ref.to,
18
19
  from = _ref.from,
@@ -69,7 +70,7 @@ var EmailPreview = function EmailPreview(_ref) {
69
70
  })))), /*#__PURE__*/React.createElement("div", {
70
71
  className: "neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
71
72
  "data-cy": "email-body-preview-container"
72
- }, body ? /*#__PURE__*/React.createElement(EditorContent, {
73
+ }, body ? /*#__PURE__*/React.createElement(MemoizedEditorContent, {
73
74
  content: body
74
75
  }) : /*#__PURE__*/React.createElement("div", {
75
76
  className: "space-y-4"
@@ -674,6 +675,7 @@ var FilePicker = function FilePicker(_ref) {
674
675
  onChange: handleInputChange
675
676
  }));
676
677
  };
678
+ var FilePicker$1 = /*#__PURE__*/React.memo(FilePicker);
677
679
 
678
680
  function _extends() {
679
681
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -2769,7 +2771,7 @@ var Form = function Form(_ref) {
2769
2771
  var handleReset = function handleReset() {
2770
2772
  editorRef.current.editor.commands.setContent(initialValues.emailBody);
2771
2773
  };
2772
- var handleCSVFile = /*#__PURE__*/function () {
2774
+ var handleCSVFile = useCallback( /*#__PURE__*/function () {
2773
2775
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref2) {
2774
2776
  var _ref4, file, values;
2775
2777
  return regenerator.wrap(function _callee$(_context) {
@@ -2787,10 +2789,10 @@ var Form = function Form(_ref) {
2787
2789
  }
2788
2790
  }, _callee);
2789
2791
  }));
2790
- return function handleCSVFile(_x) {
2792
+ return function (_x) {
2791
2793
  return _ref3.apply(this, arguments);
2792
2794
  };
2793
- }();
2795
+ }(), []);
2794
2796
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2795
2797
  className: "space-y-4"
2796
2798
  }, /*#__PURE__*/React.createElement("div", {
@@ -2802,7 +2804,7 @@ var Form = function Form(_ref) {
2802
2804
  lineHeight: "normal",
2803
2805
  style: "h4",
2804
2806
  weight: "semibold"
2805
- }, t("neetoMolecules.shareViaEmail.sendTo")), /*#__PURE__*/React.createElement(FilePicker, {
2807
+ }, t("neetoMolecules.shareViaEmail.sendTo")), /*#__PURE__*/React.createElement(FilePicker$1, {
2806
2808
  types: ALLOWED_FILE_PICKER_TYPES,
2807
2809
  onChange: handleCSVFile
2808
2810
  })), /*#__PURE__*/React.createElement(MultiEmailInput, {