@bigbinary/neeto-molecules 1.1.19 → 1.1.21
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.
- package/README.md +1 -0
- package/dist/AutoSaveInput.js +1 -1
- package/dist/AutoSaveInput.js.map +1 -1
- package/dist/Builder.js +1 -1
- package/dist/Builder.js.map +1 -1
- package/dist/CalendarView.js +1 -1
- package/dist/CalendarView.js.map +1 -1
- package/dist/Columns.js +1 -1
- package/dist/Columns.js.map +1 -1
- package/dist/CustomDomain.js +1 -1
- package/dist/CustomDomain.js.map +1 -1
- package/dist/CustomDomainDashboard.js +3 -3
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/DateFormat.js +1 -1
- package/dist/DateFormat.js.map +1 -1
- package/dist/DocumentEditor.js +274 -0
- package/dist/DocumentEditor.js.map +1 -0
- package/dist/DynamicVariables.js +1 -1
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailForm.js +3 -2
- package/dist/EmailForm.js.map +1 -1
- package/dist/EmailPreview.js +1 -1
- package/dist/EmailPreview.js.map +1 -1
- package/dist/Header.js +1 -1
- package/dist/Header.js.map +1 -1
- package/dist/IconPicker.js +1 -1
- package/dist/IconPicker.js.map +1 -1
- package/dist/IntegrationCard.js +1 -1
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IntegrationDisconnectAlert.js +1 -1
- package/dist/IntegrationDisconnectAlert.js.map +1 -1
- package/dist/IntegrationWalkthroughModal.js +1 -1
- package/dist/IntegrationWalkthroughModal.js.map +1 -1
- package/dist/IpRestriction.js +1 -1
- package/dist/IpRestriction.js.map +1 -1
- package/dist/MenuBar.js +1 -1
- package/dist/MenuBar.js.map +1 -1
- package/dist/Metadata.js +1 -1
- package/dist/Metadata.js.map +1 -1
- package/dist/NavigationHeader.js +1 -1
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/NeetoWidget.js +24 -410
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/PhoneNumber.js +2 -2
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/Rename.js +1 -1
- package/dist/Rename.js.map +1 -1
- package/dist/Schedule.js +7 -7
- package/dist/Schedule.js.map +1 -1
- package/dist/Security.js +1 -1
- package/dist/Security.js.map +1 -1
- package/dist/Settings.js +1 -1
- package/dist/Settings.js.map +1 -1
- package/dist/ShareViaEmail.js +1 -1
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/ShareViaLink.js +1 -1
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/Sidebar.js.map +1 -1
- package/dist/SubHeader.js +1 -1
- package/dist/SubHeader.js.map +1 -1
- package/dist/ThemeSidebar.js +6 -6
- package/dist/ThemeSidebar.js.map +1 -1
- package/dist/TimeFormat.js +1 -1
- package/dist/TimeFormat.js.map +1 -1
- package/dist/ToggleFeatureCard.js +1 -1
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/package.json +5 -3
- package/src/translations/en.json +3 -0
- package/types/DocumentEditor.d.ts +58 -0
package/dist/DateFormat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { capitalize } from '@bigbinary/neeto-
|
|
2
|
+
import { capitalize } from '@bigbinary/neeto-cist';
|
|
3
3
|
import { useTimer } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
4
|
import { timeFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
5
5
|
import { Typography, Tooltip } from '@bigbinary/neetoui';
|
package/dist/DateFormat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFormat.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../src/components/DateFormat.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import React from \"react\";\n\nimport { capitalize } from \"
|
|
1
|
+
{"version":3,"file":"DateFormat.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../src/components/DateFormat.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import React from \"react\";\n\nimport { capitalize } from \"neetocist\";\nimport { useTimer } from \"neetocommons/react-utils\";\nimport { timeFormat } from \"neetocommons/utils\";\nimport { Tooltip, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { fromPairs, keys } from \"ramda\";\n\nconst DateFormat = fromPairs(\n keys(timeFormat).map(key => [\n capitalize(key),\n ({ date, timerInterval = 60, tooltipProps = {}, typographyProps = {} }) => {\n useTimer(timerInterval);\n const dateDisplay = (\n <Typography component=\"span\" style=\"body2\" {...typographyProps}>\n {timeFormat[key](date)}\n </Typography>\n );\n\n return key === \"extended\" ? (\n dateDisplay\n ) : (\n <Tooltip\n content={timeFormat.extended(date)}\n position=\"top\"\n {...tooltipProps}\n >\n {dateDisplay}\n </Tooltip>\n );\n },\n ])\n);\n\nDateFormat.propTypes = {\n /**\n * The date object to be formatted.\n */\n date: PropTypes.instanceOf(Date),\n /**\n * This prop will be used to re-render the component in every `timerInterval` seconds to show updated relative time.\n */\n timerInterval: PropTypes.number,\n /**\n * This prop will be forwarded to the neetoui Tooltip component. Default position is \"top\".\n */\n tooltipProps: PropTypes.object,\n /**\n * This prop will be forwarded to the neetoui Typography component.\n */\n typographyProps: PropTypes.object,\n};\n\nexport default DateFormat;\n"],"names":["DateFormat","fromPairs","keys","timeFormat","map","key","capitalize","_ref","date","_ref$timerInterval","timerInterval","_ref$tooltipProps","tooltipProps","_ref$typographyProps","typographyProps","useTimer","dateDisplay","React","createElement","Typography","_extends","component","style","Tooltip","content","extended","position"],"mappings":";;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;ACJA,IAAMA,UAAU,GAAGC,SAAS,CAC1BC,IAAI,CAACC,UAAU,CAAC,CAACC,GAAG,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAI,CAC1BC,UAAU,CAACD,GAAG,CAAC,EACf,UAAAE,IAAA,EAA2E;AAAA,IAAA,IAAxEC,IAAI,GAAAD,IAAA,CAAJC,IAAI;MAAAC,kBAAA,GAAAF,IAAA,CAAEG,aAAa;AAAbA,MAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,kBAAA;MAAAE,iBAAA,GAAAJ,IAAA,CAAEK,YAAY;AAAZA,MAAAA,YAAY,GAAAD,iBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,iBAAA;MAAAE,oBAAA,GAAAN,IAAA,CAAEO,eAAe;AAAfA,MAAAA,eAAe,GAAAD,oBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,oBAAA,CAAA;IAClEE,QAAQ,CAACL,aAAa,CAAC,CAAA;IACvB,IAAMM,WAAW,gBACfC,KAAA,CAAAC,aAAA,CAACC,UAAU,EAAAC,QAAA,CAAA;AAACC,MAAAA,SAAS,EAAC,MAAM;AAACC,MAAAA,KAAK,EAAC,OAAA;KAAYR,EAAAA,eAAe,GAC3DX,UAAU,CAACE,GAAG,CAAC,CAACG,IAAI,CAAC,CAEzB,CAAA;AAED,IAAA,OAAOH,GAAG,KAAK,UAAU,GACvBW,WAAW,gBAEXC,KAAA,CAAAC,aAAA,CAACK,OAAO,EAAAH,QAAA,CAAA;AACNI,MAAAA,OAAO,EAAErB,UAAU,CAACsB,QAAQ,CAACjB,IAAI,CAAE;AACnCkB,MAAAA,QAAQ,EAAC,KAAA;KACLd,EAAAA,YAAY,CAEfI,EAAAA,WAAW,CAEf,CAAA;AACH,GAAC,CACF,CAAA;AAAA,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { noop } from '@bigbinary/neeto-commons-frontend/pure';
|
|
3
|
+
import { FormikEditor } from '@bigbinary/neeto-editor';
|
|
4
|
+
import { Typography } from '@bigbinary/neetoui';
|
|
5
|
+
import { Textarea } from '@bigbinary/neetoui/formik';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useFormikContext } from 'formik';
|
|
8
|
+
import { useHotKeys } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
9
|
+
|
|
10
|
+
function _extends() {
|
|
11
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
12
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
+
var source = arguments[i];
|
|
14
|
+
for (var key in source) {
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16
|
+
target[key] = source[key];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
return _extends.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _typeof(obj) {
|
|
26
|
+
"@babel/helpers - typeof";
|
|
27
|
+
|
|
28
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
29
|
+
return typeof obj;
|
|
30
|
+
} : function (obj) {
|
|
31
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
32
|
+
}, _typeof(obj);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _toPrimitive(input, hint) {
|
|
36
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
37
|
+
var prim = input[Symbol.toPrimitive];
|
|
38
|
+
if (prim !== undefined) {
|
|
39
|
+
var res = prim.call(input, hint || "default");
|
|
40
|
+
if (_typeof(res) !== "object") return res;
|
|
41
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
42
|
+
}
|
|
43
|
+
return (hint === "string" ? String : Number)(input);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _toPropertyKey(arg) {
|
|
47
|
+
var key = _toPrimitive(arg, "string");
|
|
48
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _defineProperty(obj, key, value) {
|
|
52
|
+
key = _toPropertyKey(key);
|
|
53
|
+
if (key in obj) {
|
|
54
|
+
Object.defineProperty(obj, key, {
|
|
55
|
+
value: value,
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
obj[key] = value;
|
|
62
|
+
}
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _arrayWithHoles(arr) {
|
|
67
|
+
if (Array.isArray(arr)) return arr;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _iterableToArrayLimit(arr, i) {
|
|
71
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
72
|
+
if (null != _i) {
|
|
73
|
+
var _s,
|
|
74
|
+
_e,
|
|
75
|
+
_x,
|
|
76
|
+
_r,
|
|
77
|
+
_arr = [],
|
|
78
|
+
_n = !0,
|
|
79
|
+
_d = !1;
|
|
80
|
+
try {
|
|
81
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
82
|
+
if (Object(_i) !== _i) return;
|
|
83
|
+
_n = !1;
|
|
84
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
_d = !0, _e = err;
|
|
87
|
+
} finally {
|
|
88
|
+
try {
|
|
89
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
90
|
+
} finally {
|
|
91
|
+
if (_d) throw _e;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return _arr;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function _arrayLikeToArray(arr, len) {
|
|
99
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
100
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
101
|
+
return arr2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
105
|
+
if (!o) return;
|
|
106
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
107
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
108
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
109
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
110
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function _nonIterableRest() {
|
|
114
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function _slicedToArray(arr, i) {
|
|
118
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var EDITOR_ADDONS = ["highlight", "emoji", "video-upload", "code-block", "block-quote", "image-upload", "image-upload-unsplash", "divider", "video-embed", "undo", "redo", "attachments", "table"];
|
|
122
|
+
var DEFAULT_EDITOR_PROPS = {
|
|
123
|
+
isCharacterCountActive: true,
|
|
124
|
+
isMenuIndependent: true,
|
|
125
|
+
addons: []
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
129
|
+
|
|
130
|
+
var css = ".neeto-molecules-new-document__wrapper{flex-grow:1;height:100%;overflow-y:auto;width:100%}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__title{margin:24px 0 0;width:100%}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;resize:none}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-new-document__wrapper .neeto-molecules-new-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-new-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-new-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-new-document__wrapper .neeto-editor-fixed-menu{background-color:rgb(var(--neeto-ui-gray-100));border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}.neeto-molecules-new-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:768px;padding:4px 8px}.neeto-molecules-new-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-new-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-new-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-new-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-new-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor p{font-size:1rem;line-height:1.5}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}.neeto-molecules__menubar .neeto-molecules-menubar__subtitle,.neeto-molecules__menubar .neeto-molecules-menubar__title{margin-left:8px}";
|
|
131
|
+
n(css,{});
|
|
132
|
+
|
|
133
|
+
var useEditor = function useEditor(_ref) {
|
|
134
|
+
var onContentChange = _ref.onContentChange,
|
|
135
|
+
editorContentFieldName = _ref.editorContentFieldName,
|
|
136
|
+
setAttachments = _ref.setAttachments,
|
|
137
|
+
onAttachmentChange = _ref.onAttachmentChange,
|
|
138
|
+
onTitleChange = _ref.onTitleChange,
|
|
139
|
+
titleFieldName = _ref.titleFieldName,
|
|
140
|
+
editorRef = _ref.editorRef;
|
|
141
|
+
var _useFormikContext = useFormikContext(),
|
|
142
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
143
|
+
errors = _useFormikContext.errors;
|
|
144
|
+
var handleContentChange = function handleContentChange(content) {
|
|
145
|
+
setFieldValue(editorContentFieldName, content);
|
|
146
|
+
onContentChange(content);
|
|
147
|
+
};
|
|
148
|
+
var handleAttachmentChange = function handleAttachmentChange(attachments) {
|
|
149
|
+
setAttachments(attachments);
|
|
150
|
+
setFieldValue("attachments", attachments);
|
|
151
|
+
onAttachmentChange(attachments);
|
|
152
|
+
};
|
|
153
|
+
var handleTitleChange = function handleTitleChange(event) {
|
|
154
|
+
var title = event.target.value;
|
|
155
|
+
setFieldValue(titleFieldName, title);
|
|
156
|
+
onTitleChange(title);
|
|
157
|
+
};
|
|
158
|
+
var titleHotkeyRef = useHotKeys("return", function () {
|
|
159
|
+
var _editorRef$current, _editorRef$current$ed, _editorRef$current$ed2;
|
|
160
|
+
return (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : (_editorRef$current$ed = _editorRef$current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : (_editorRef$current$ed2 = _editorRef$current$ed.commands) === null || _editorRef$current$ed2 === void 0 ? void 0 : _editorRef$current$ed2.focus();
|
|
161
|
+
}, {
|
|
162
|
+
mode: "scoped"
|
|
163
|
+
});
|
|
164
|
+
return {
|
|
165
|
+
handleContentChange: handleContentChange,
|
|
166
|
+
handleAttachmentChange: handleAttachmentChange,
|
|
167
|
+
handleTitleChange: handleTitleChange,
|
|
168
|
+
titleHotkeyRef: titleHotkeyRef,
|
|
169
|
+
errors: errors
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
174
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
175
|
+
var getUniqueAttachments = function getUniqueAttachments(attachments) {
|
|
176
|
+
var uniqueAttachments = attachments === null || attachments === void 0 ? void 0 : attachments.reduce(function (uniqueAttachments, attachment) {
|
|
177
|
+
return _objectSpread$1(_objectSpread$1({}, uniqueAttachments), {}, _defineProperty({}, attachment.signedId, attachment));
|
|
178
|
+
}, {});
|
|
179
|
+
return Object.values(uniqueAttachments || {});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
183
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
184
|
+
var Editor = function Editor(_ref) {
|
|
185
|
+
var initialAttachments = _ref.attachments,
|
|
186
|
+
onContentChange = _ref.onContentChange,
|
|
187
|
+
onAttachmentChange = _ref.onAttachmentChange,
|
|
188
|
+
onTitleChange = _ref.onTitleChange,
|
|
189
|
+
_ref$getTitleRef = _ref.getTitleRef,
|
|
190
|
+
getTitleRef = _ref$getTitleRef === void 0 ? noop : _ref$getTitleRef,
|
|
191
|
+
_ref$getEditorRef = _ref.getEditorRef,
|
|
192
|
+
getEditorRef = _ref$getEditorRef === void 0 ? noop : _ref$getEditorRef,
|
|
193
|
+
_ref$editorContentFie = _ref.editorContentFieldName,
|
|
194
|
+
editorContentFieldName = _ref$editorContentFie === void 0 ? "htmlContent" : _ref$editorContentFie,
|
|
195
|
+
_ref$titleFieldName = _ref.titleFieldName,
|
|
196
|
+
titleFieldName = _ref$titleFieldName === void 0 ? "title" : _ref$titleFieldName,
|
|
197
|
+
_ref$editorProps = _ref.editorProps,
|
|
198
|
+
editorProps = _ref$editorProps === void 0 ? DEFAULT_EDITOR_PROPS : _ref$editorProps,
|
|
199
|
+
_ref$titleProps = _ref.titleProps,
|
|
200
|
+
titleProps = _ref$titleProps === void 0 ? {} : _ref$titleProps;
|
|
201
|
+
var _useTranslation = useTranslation(),
|
|
202
|
+
t = _useTranslation.t;
|
|
203
|
+
var titleRef = useRef();
|
|
204
|
+
var editorRef = useRef();
|
|
205
|
+
var _useState = useState(function () {
|
|
206
|
+
return getUniqueAttachments(initialAttachments);
|
|
207
|
+
}),
|
|
208
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
209
|
+
attachments = _useState2[0],
|
|
210
|
+
setAttachments = _useState2[1];
|
|
211
|
+
var _useEditor = useEditor({
|
|
212
|
+
onContentChange: onContentChange,
|
|
213
|
+
editorContentFieldName: editorContentFieldName,
|
|
214
|
+
setAttachments: setAttachments,
|
|
215
|
+
onAttachmentChange: onAttachmentChange,
|
|
216
|
+
onTitleChange: onTitleChange,
|
|
217
|
+
titleFieldName: titleFieldName,
|
|
218
|
+
editorRef: editorRef
|
|
219
|
+
}),
|
|
220
|
+
handleContentChange = _useEditor.handleContentChange,
|
|
221
|
+
handleAttachmentChange = _useEditor.handleAttachmentChange,
|
|
222
|
+
handleTitleChange = _useEditor.handleTitleChange,
|
|
223
|
+
titleHotkeyRef = _useEditor.titleHotkeyRef,
|
|
224
|
+
errors = _useEditor.errors;
|
|
225
|
+
var setTitleRef = function setTitleRef(node) {
|
|
226
|
+
titleHotkeyRef.current = node;
|
|
227
|
+
getTitleRef(node);
|
|
228
|
+
titleRef.current = node;
|
|
229
|
+
};
|
|
230
|
+
var setEditorRef = function setEditorRef(node) {
|
|
231
|
+
getEditorRef(node);
|
|
232
|
+
editorRef.current = node;
|
|
233
|
+
};
|
|
234
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
className: "neeto-molecules-new-document__wrapper flex",
|
|
236
|
+
"data-testid": "document-editor-container"
|
|
237
|
+
}, /*#__PURE__*/React.createElement(FormikEditor, _extends({
|
|
238
|
+
attachmentsClassName: "editor-content-attachments",
|
|
239
|
+
className: "h-full w-full",
|
|
240
|
+
contentClassName: "editor-content__wrapper neeto-molecules-new-document__container",
|
|
241
|
+
"data-cy": "article-content-text-area",
|
|
242
|
+
error: undefined,
|
|
243
|
+
menuClassName: "w-full sticky top-0 z-20",
|
|
244
|
+
name: editorContentFieldName,
|
|
245
|
+
ref: setEditorRef
|
|
246
|
+
}, _objectSpread({
|
|
247
|
+
attachments: attachments
|
|
248
|
+
}, editorProps), {
|
|
249
|
+
addons: EDITOR_ADDONS.concat(editorProps.addons),
|
|
250
|
+
onChange: handleContentChange,
|
|
251
|
+
onChangeAttachments: handleAttachmentChange
|
|
252
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "neeto-molecules-new-document__container px-4"
|
|
254
|
+
}, /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
255
|
+
nakedTextarea: true,
|
|
256
|
+
className: "neeto-molecules-new-document__title",
|
|
257
|
+
"data-cy": "article-title-text-field",
|
|
258
|
+
name: titleFieldName,
|
|
259
|
+
ref: setTitleRef,
|
|
260
|
+
rows: 1,
|
|
261
|
+
placeholder: titleProps.placeholder || t("neetoMolecules.documentEditor.title"),
|
|
262
|
+
onChange: handleTitleChange,
|
|
263
|
+
onKeyDown: function onKeyDown(e) {
|
|
264
|
+
return e.key === "Enter" && !e.shiftKey && e.preventDefault();
|
|
265
|
+
}
|
|
266
|
+
}, titleProps)), errors[editorContentFieldName] && /*#__PURE__*/React.createElement(Typography, {
|
|
267
|
+
className: "neeto-ui-input__error neeto-molecules-editor-content__error",
|
|
268
|
+
"data-cy": "articles-content-input-error",
|
|
269
|
+
style: "body3"
|
|
270
|
+
}, errors[editorContentFieldName]))));
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export { Editor as default };
|
|
274
|
+
//# sourceMappingURL=DocumentEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentEditor.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../src/components/DocumentEditor/constants.js","../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../src/components/DocumentEditor/hooks/useEditor.js","../src/components/DocumentEditor/utils.js","../src/components/DocumentEditor/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export const EDITOR_ADDONS = [\n \"highlight\",\n \"emoji\",\n \"video-upload\",\n \"code-block\",\n \"block-quote\",\n \"image-upload\",\n \"image-upload-unsplash\",\n \"divider\",\n \"video-embed\",\n \"undo\",\n \"redo\",\n \"attachments\",\n \"table\",\n];\n\nexport const DEFAULT_EDITOR_PROPS = {\n isCharacterCountActive: true,\n isMenuIndependent: true,\n addons: [],\n};\n","var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { useFormikContext } from \"formik\";\nimport { useHotKeys } from \"neetocommons/react-utils\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange(attachments);\n };\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange(title);\n };\n\n const titleHotkeyRef = useHotKeys(\n \"return\",\n () => editorRef.current?.editor?.commands?.focus(),\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import React, { useRef, useState } from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DEFAULT_EDITOR_PROPS, EDITOR_ADDONS } from \"./constants\";\nimport \"./editor.scss\";\nimport useEditor from \"./hooks/useEditor\";\nimport { getUniqueAttachments } from \"./utils\";\n\nconst Editor = ({\n attachments: initialAttachments,\n onContentChange,\n onAttachmentChange,\n onTitleChange,\n getTitleRef = noop,\n getEditorRef = noop,\n editorContentFieldName = \"htmlContent\",\n titleFieldName = \"title\",\n editorProps = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = node => {\n getEditorRef(node);\n editorRef.current = node;\n };\n\n return (\n <div\n className=\"neeto-molecules-new-document__wrapper flex\"\n data-testid=\"document-editor-container\"\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments\"\n className=\"h-full w-full\"\n contentClassName=\"editor-content__wrapper neeto-molecules-new-document__container\"\n data-cy=\"article-content-text-area\"\n error={undefined}\n menuClassName=\"w-full sticky top-0 z-20\"\n name={editorContentFieldName}\n ref={setEditorRef}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons)}\n onChange={handleContentChange}\n onChangeAttachments={handleAttachmentChange}\n >\n <div className=\"neeto-molecules-new-document__container px-4\">\n <Textarea\n nakedTextarea\n className=\"neeto-molecules-new-document__title\"\n data-cy=\"article-title-text-field\"\n name={titleFieldName}\n ref={setTitleRef}\n rows={1}\n placeholder={\n titleProps.placeholder || t(\"neetoMolecules.documentEditor.title\")\n }\n onChange={handleTitleChange}\n onKeyDown={e =>\n e.key === \"Enter\" && !e.shiftKey && e.preventDefault()\n }\n {...titleProps}\n />\n {errors[editorContentFieldName] && (\n <Typography\n className=\"neeto-ui-input__error neeto-molecules-editor-content__error\"\n data-cy=\"articles-content-input-error\"\n style=\"body3\"\n >\n {errors[editorContentFieldName]}\n </Typography>\n )}\n </div>\n </FormikEditor>\n </div>\n );\n};\n\nEditor.propTypes = {\n /**\n * List of initial attachments.\n */\n attachments: PropTypes.arrayOf(\n PropTypes.shape({\n contentType: PropTypes.string,\n filename: PropTypes.string,\n signedId: PropTypes.string,\n url: PropTypes.string,\n })\n ),\n /**\n * Callback that will be triggered when the editor content changes.\n * This function is not throttled.\n */\n onContentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the attachments changes.\n */\n onAttachmentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the article title changes.\n */\n onTitleChange: PropTypes.func,\n /**\n * This function will be called with the title node reference.\n */\n getTitleRef: PropTypes.func,\n /**\n * This function will be called with editor reference.\n */\n getEditorRef: PropTypes.func,\n /**\n * Formik field name of the editor. The default value is `htmlContent`.\n */\n editorContentFieldName: PropTypes.string,\n /**\n * Formik field name of the title. The default value is `title`.\n */\n titleFieldName: PropTypes.string,\n /**\n * These props will be passed down to the editor component.\n */\n editorProps: PropTypes.object,\n /**\n * These props will be passed down to the title text area component.\n */\n titleProps: PropTypes.object,\n};\n\nexport default Editor;\n"],"names":["toPrimitive","toPropertyKey","arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","titleHotkeyRef","useHotKeys","_editorRef$current","_editorRef$current$ed","_editorRef$current$ed2","current","editor","commands","focus","mode","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","titleRef","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","React","createElement","className","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","menuClassName","name","ref","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"mappings":";;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;ACbe,SAAS,OAAO,CAAC,GAAG,EAAE;AACrC,EAAE,yBAAyB,CAAC;AAC5B;AACA,EAAE,OAAO,OAAO,GAAG,UAAU,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE;AACtG,IAAI,OAAO,OAAO,GAAG,CAAC;AACtB,GAAG,GAAG,UAAU,GAAG,EAAE;AACrB,IAAI,OAAO,GAAG,IAAI,UAAU,IAAI,OAAO,MAAM,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,CAAC,SAAS,GAAG,QAAQ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/C,IAAA,SAAA,EAAQ,0BAA0B;AAClCQ,IAAAA,IAAI,EAAEtE,cAAe;AACrBuE,IAAAA,GAAG,EAAEd,WAAY;AACjBoB,IAAAA,IAAI,EAAE,CAAE;IACRC,WAAW,EACThC,UAAU,CAACgC,WAAW,IAAI7B,CAAC,CAAC,qCAAqC,CAClE;AACDwB,IAAAA,QAAQ,EAAE/D,iBAAkB;IAC5BqE,SAAS,EAAE,SAAAA,SAAAA,CAAAC,CAAC,EAAA;AAAA,MAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,KAAA;AACvD,GAAA,EACGrC,UAAU,CAAA,CACd,EACDzC,MAAM,CAACT,sBAAsB,CAAC,iBAC7BgE,KAAA,CAAAC,aAAA,CAACuB,UAAU,EAAA;AACTtB,IAAAA,SAAS,EAAC,6DAA6D;AACvE,IAAA,SAAA,EAAQ,8BAA8B;AACtCuB,IAAAA,KAAK,EAAC,OAAA;AAAO,GAAA,EAEZhF,MAAM,CAACT,sBAAsB,CAAC,CAElC,CACG,CACO,CACX,CAAA;AAEV;;;;"}
|
package/dist/DynamicVariables.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
|
-
import { findBy, noop } from '@bigbinary/neeto-
|
|
2
|
+
import { findBy, noop } from '@bigbinary/neeto-cist';
|
|
3
3
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
4
4
|
import { Braces } from '@bigbinary/neeto-icons';
|
|
5
5
|
import { Dropdown, Typography } from '@bigbinary/neetoui';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicVariables.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../src/components/DynamicVariables/utils.js","../src/components/DynamicVariables/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { findBy } from \"neetocommons/pure\";\nimport { prop, assoc, isEmpty, uniqBy } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(assoc(\"category\", category));\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import React, { Fragment } from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { joinHyphenCase } from \"neetocommons/utils\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy=\"dynamic-variables-list\"\n >\n {variables.map(item => (\n <button\n key={item.label}\n data-cy={joinHyphenCase(\n \"dynamic-variables-list-item\",\n item.label\n )}\n onClick={() => onVariableClick(item)}\n >\n {item.label}\n </button>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n </Menu>\n </Dropdown>\n );\n};\n\nDynamicVariables.propTypes = {\n /**\n * A function that is triggered when a dynamic variable button is clicked. It receives an object containing information about the clicked variable.\n */\n onVariableClick: PropTypes.func,\n /**\n * An array of objects, each representing a category or standalone variable, with the ability to define a label, key, and default value for each variable.\n */\n variables: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, key: PropTypes.string })\n ),\n};\n\nexport default DynamicVariables;\n"],"names":["toPrimitive","toPropertyKey","objectWithoutPropertiesLoose","parseVariables","variableArr","arguments","length","undefined","uncategorized","groupedVariables","categorySet","Set","forEach","variable","category","label","variables","parsedVariables","map","assoc","has","add","push","existingGroup","findBy","uniqBy","prop","concat","isEmpty","Menu","Dropdown","DynamicVariables","_ref","_ref$onVariableClick","onVariableClick","noop","_ref$variables","buttonProps","dropdownProps","_objectWithoutProperties","_excluded","React","createElement","_extends","buttonStyle","icon","Braces","strategy","_objectSpread","className","_ref2","Fragment","key","Typography","style","item","joinHyphenCase","onClick"],"mappings":";;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;ACbe,SAAS,OAAO,CA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C,CAAA;AAAA,SAAA;OAEnCA,EAAAA,IAAI,CAACxC,KAAK,CACJ,CAAA;KACV,CAAC,CACE,CACG,CAAA;GACZ,CAAC,CACE,CACD,CACE,CAAA;AAEf;;;;"}
|
|
1
|
+
{"version":3,"file":"DynamicVariables.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../src/components/DynamicVariables/utils.js","../src/components/DynamicVariables/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { findBy } from \"neetocist\";\nimport { prop, assoc, isEmpty, uniqBy } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(assoc(\"category\", category));\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import React, { Fragment } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy=\"dynamic-variables-list\"\n >\n {variables.map(item => (\n <button\n key={item.label}\n data-cy={joinHyphenCase(\n \"dynamic-variables-list-item\",\n item.label\n )}\n onClick={() => onVariableClick(item)}\n >\n {item.label}\n </button>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n </Menu>\n </Dropdown>\n );\n};\n\nDynamicVariables.propTypes = {\n /**\n * A function that is triggered when a dynamic variable button is clicked. It receives an object containing information about the clicked variable.\n */\n onVariableClick: PropTypes.func,\n /**\n * An array of objects, each representing a category or standalone variable, with the ability to define a label, key, and default value for each variable.\n */\n variables: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, key: PropTypes.string })\n ),\n};\n\nexport default DynamicVariables;\n"],"names":["toPrimitive","toPropertyKey","objectWithoutPropertiesLoose","parseVariables","variableArr","arguments","length","undefined","uncategorized","groupedVariables","categorySet","Set","forEach","variable","category","label","variables","parsedVariables","map","assoc","has","add","push","existingGroup","findBy","uniqBy","prop","concat","isEmpty","Menu","Dropdown","DynamicVariables","_ref","_ref$onVariableClick","onVariableClick","noop","_ref$variables","buttonProps","dropdownProps","_objectWithoutProperties","_excluded","React","createElement","_extends","buttonStyle","icon","Braces","strategy","_objectSpread","className","_ref2","Fragment","key","Typography","style","item","joinHyphenCase","onClick"],"mappings":";;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC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EAE/BjC,SAAS,CAACE,GAAG,CAAC,UAAAqC,IAAI,EAAA;MAAA,oBACjBd,KAAA,CAAAC,aAAA,CAAA,QAAA,EAAA;QACEU,GAAG,EAAEG,IAAI,CAACxC,KAAM;AAChB,QAAA,SAAA,EAASyC,cAAc,CACrB,6BAA6B,EAC7BD,IAAI,CAACxC,KAAK,CACV;QACF0C,OAAO,EAAE,SAAAA,OAAA,GAAA;UAAA,OAAMvB,eAAe,CAACqB,IAAI,CAAC,CAAA;AAAA,SAAA;OAEnCA,EAAAA,IAAI,CAACxC,KAAK,CACJ,CAAA;KACV,CAAC,CACE,CACG,CAAA;GACZ,CAAC,CACE,CACD,CACE,CAAA;AAEf;;;;"}
|
package/dist/EmailForm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useState, useContext } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { useFormikContext, Field } from 'formik';
|
|
4
|
-
import { isNotEmpty
|
|
4
|
+
import { isNotEmpty as isNotEmpty$1 } from '@bigbinary/neeto-commons-frontend/pure';
|
|
5
5
|
import { isEditorEmpty, FormikEditor, EditorContent } from '@bigbinary/neeto-editor';
|
|
6
6
|
import { Toastr, Button, Input as Input$1, Typography } from '@bigbinary/neetoui';
|
|
7
7
|
import { Select, Input, MultiEmailInput, Radio, ActionBlock, Form } from '@bigbinary/neetoui/formik';
|
|
@@ -10,6 +10,7 @@ import { t } from 'i18next';
|
|
|
10
10
|
import { prop } from 'ramda';
|
|
11
11
|
import * as yup from 'yup';
|
|
12
12
|
import { string } from 'yup';
|
|
13
|
+
import { isNotEmpty, noop, isPresent } from '@bigbinary/neeto-cist';
|
|
13
14
|
import { Info, Upload } from '@bigbinary/neeto-icons';
|
|
14
15
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
15
16
|
import Papa from 'papaparse';
|
|
@@ -885,7 +886,7 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
885
886
|
var _useFormikContext = useFormikContext(),
|
|
886
887
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
887
888
|
dirty = _useFormikContext.dirty;
|
|
888
|
-
var showSendToRadioField = showSendToField && showSendToAsRadio && isNotEmpty(sendToOptions);
|
|
889
|
+
var showSendToRadioField = showSendToField && showSendToAsRadio && isNotEmpty$1(sendToOptions);
|
|
889
890
|
return /*#__PURE__*/React.createElement("div", {
|
|
890
891
|
"data-testid": "email-form",
|
|
891
892
|
className: classnames("flex flex-1 flex-col items-start gap-2", _defineProperty({}, className, className))
|