@elliemae/ds-wysiwygeditor 2.2.0-alpha.2 → 2.2.0-beta.0
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/cjs/DSWYSIWYGEditor.js +72 -83
- package/cjs/components/CustomImageUploader.js +94 -92
- package/cjs/components/CustomToolbar.js +193 -172
- package/cjs/components/DSWYSIWYGEditorImpl.js +185 -147
- package/cjs/components/ImageLibraryModal.js +55 -75
- package/cjs/components/InsertFieldModal.js +142 -109
- package/cjs/components/TippedButton.js +54 -56
- package/cjs/components/TippedSelect.js +39 -50
- package/cjs/components/colors.js +21 -41
- package/cjs/components/customFields.js +47 -66
- package/cjs/constants.js +38 -112
- package/cjs/index.js +21 -39
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js +22 -37
- package/cjs/quillOverrides/IndentStyle.js +19 -41
- package/cjs/quillOverrides/LinkFormat.js +39 -57
- package/cjs/quillOverrides/PlainClipboard.js +21 -41
- package/cjs/utils.js +18 -41
- package/esm/DSWYSIWYGEditor.js +58 -50
- package/esm/components/CustomImageUploader.js +81 -60
- package/esm/components/CustomToolbar.js +184 -145
- package/esm/components/DSWYSIWYGEditorImpl.js +169 -113
- package/esm/components/ImageLibraryModal.js +47 -46
- package/esm/components/InsertFieldModal.js +124 -72
- package/esm/components/TippedButton.js +44 -27
- package/esm/components/TippedSelect.js +31 -21
- package/esm/components/colors.js +17 -12
- package/esm/components/customFields.js +40 -38
- package/esm/constants.js +30 -83
- package/esm/index.js +4 -10
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js +18 -8
- package/esm/quillOverrides/IndentStyle.js +17 -12
- package/esm/quillOverrides/LinkFormat.js +37 -28
- package/esm/quillOverrides/PlainClipboard.js +19 -12
- package/esm/utils.js +14 -12
- package/package.json +9 -9
- package/types/DSWYSIWYGEditor.d.ts +1 -12
- package/cjs/DSWYSIWYGEditor.js.map +0 -7
- package/cjs/components/CustomImageUploader.js.map +0 -7
- package/cjs/components/CustomToolbar.js.map +0 -7
- package/cjs/components/DSWYSIWYGEditorImpl.js.map +0 -7
- package/cjs/components/ImageLibraryModal.js.map +0 -7
- package/cjs/components/InsertFieldModal.js.map +0 -7
- package/cjs/components/TippedButton.js.map +0 -7
- package/cjs/components/TippedSelect.js.map +0 -7
- package/cjs/components/colors.js.map +0 -7
- package/cjs/components/customFields.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
- package/cjs/quillOverrides/IndentStyle.js.map +0 -7
- package/cjs/quillOverrides/LinkFormat.js.map +0 -7
- package/cjs/quillOverrides/PlainClipboard.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/DSWYSIWYGEditor.js.map +0 -7
- package/esm/components/CustomImageUploader.js.map +0 -7
- package/esm/components/CustomToolbar.js.map +0 -7
- package/esm/components/DSWYSIWYGEditorImpl.js.map +0 -7
- package/esm/components/ImageLibraryModal.js.map +0 -7
- package/esm/components/InsertFieldModal.js.map +0 -7
- package/esm/components/TippedButton.js.map +0 -7
- package/esm/components/TippedSelect.js.map +0 -7
- package/esm/components/colors.js.map +0 -7
- package/esm/components/customFields.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
- package/esm/quillOverrides/IndentStyle.js.map +0 -7
- package/esm/quillOverrides/LinkFormat.js.map +0 -7
- package/esm/quillOverrides/PlainClipboard.js.map +0 -7
- package/esm/utils.js.map +0 -7
|
@@ -1,132 +1,188 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import ReactQuill, { Quill } from 'react-quill';
|
|
13
|
+
import BlotFormatter from 'quill-blot-formatter';
|
|
14
|
+
import ImageLibraryModal from './ImageLibraryModal.js';
|
|
15
|
+
import InsertFieldModal from './InsertFieldModal.js';
|
|
16
|
+
import { CustomToolbar } from './CustomToolbar.js';
|
|
17
|
+
import IndentStyle from '../quillOverrides/IndentStyle.js';
|
|
18
|
+
import LinkFormat from '../quillOverrides/LinkFormat.js';
|
|
19
|
+
import { formatHTML } from '../utils.js';
|
|
20
|
+
import { clipboardLinkWithTagMatcher } from '../quillMatchers/clipboardLinkWithTagMatcher.js';
|
|
21
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
22
|
+
|
|
23
|
+
const _excluded = ["containerProps", "customFields", "imagesData", "customToolbar", "handleImageClick", "handleCustomFieldClick", "height", "value", "showRawHTML", "onShowHTML", "onChange", "hideItems"];
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
Quill.register('modules/blotFormatter', BlotFormatter); // Fix block styled formats ----------------
|
|
29
|
+
|
|
30
|
+
const AlignStyle = Quill.import('attributors/style/align');
|
|
31
|
+
const FontStyle = Quill.import('attributors/style/font');
|
|
32
|
+
FontStyle.whitelist = [// allow ONLY these fonts and the default
|
|
33
|
+
'serif', 'monospace', 'arial', 'comic-sans', 'courier-new', 'georgia', 'helvetica', 'lucida'];
|
|
34
|
+
const SizeStyle = Quill.import('attributors/style/size');
|
|
35
|
+
SizeStyle.whitelist = [// allow ONLY these sizes and the default
|
|
36
|
+
'x-small', 'large', 'x-large']; // Fix Doc Viewer p tags extra margin issue ---------
|
|
37
|
+
|
|
38
|
+
const Block = Quill.import('blots/block');
|
|
39
|
+
Block.tagName = 'p';
|
|
33
40
|
Quill.register(Block);
|
|
34
41
|
Quill.register(AlignStyle, true);
|
|
35
42
|
Quill.register(IndentStyle, true);
|
|
36
43
|
Quill.register(FontStyle, true);
|
|
37
|
-
Quill.register(SizeStyle, true);
|
|
38
|
-
|
|
44
|
+
Quill.register(SizeStyle, true); // -----------------------------------------
|
|
45
|
+
|
|
46
|
+
class DSWYSIWYGEditorImpl extends React.PureComponent {
|
|
39
47
|
constructor(props) {
|
|
40
48
|
super(props);
|
|
41
|
-
this.quillModules = {
|
|
49
|
+
this.quillModules = _objectSpread({
|
|
42
50
|
toolbar: {
|
|
43
|
-
container: this.props.toolbarContainer ?
|
|
44
|
-
handlers: {
|
|
45
|
-
...this.props.toolbarHandlers
|
|
46
|
-
}
|
|
51
|
+
container: this.props.toolbarContainer ? "#".concat(this.props.toolbarContainer) : '#toolbar',
|
|
52
|
+
handlers: _objectSpread({}, this.props.toolbarHandlers)
|
|
47
53
|
},
|
|
48
54
|
clipboard: {
|
|
55
|
+
// toggle to add extra line breaks when pasting HTML:
|
|
49
56
|
matchVisual: false
|
|
50
57
|
},
|
|
51
|
-
blotFormatter: {
|
|
52
|
-
|
|
53
|
-
};
|
|
58
|
+
blotFormatter: {// options... https://github.com/Fandom-OSS/quill-blot-formatter
|
|
59
|
+
}
|
|
60
|
+
}, this.props.quillModules);
|
|
61
|
+
|
|
54
62
|
this.onChangeQuill = (html, delta, source, editor) => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
onChange
|
|
63
|
+
const {
|
|
64
|
+
showRawHTML,
|
|
65
|
+
onChange
|
|
66
|
+
} = this.props;
|
|
67
|
+
if (!showRawHTML) onChange(html, delta, source, editor);
|
|
58
68
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
|
|
70
|
+
this.onChangeTextArea = e => {
|
|
71
|
+
const {
|
|
72
|
+
showRawHTML,
|
|
73
|
+
onChange
|
|
74
|
+
} = this.props;
|
|
75
|
+
if (showRawHTML) onChange(e.target.value);
|
|
63
76
|
};
|
|
64
|
-
|
|
77
|
+
|
|
78
|
+
this.onInserFieldConfirm = fieldCode => {
|
|
65
79
|
const editor = this.getEditor();
|
|
66
80
|
const range = editor.getSelection(true);
|
|
67
81
|
editor.insertText(range.index, fieldCode);
|
|
68
82
|
};
|
|
69
|
-
|
|
83
|
+
|
|
84
|
+
this.onImageConfirm = image => {
|
|
70
85
|
if (!image) {
|
|
71
86
|
return;
|
|
72
87
|
}
|
|
88
|
+
|
|
73
89
|
const editor = this.getEditor();
|
|
74
90
|
const range = editor.getSelection(true);
|
|
75
|
-
editor.insertEmbed(range.index,
|
|
91
|
+
editor.insertEmbed(range.index, 'image', image.url);
|
|
76
92
|
};
|
|
93
|
+
|
|
77
94
|
this.onFieldModalClose = () => {
|
|
78
|
-
this.setState({
|
|
95
|
+
this.setState({
|
|
96
|
+
isFieldModalOpen: false
|
|
97
|
+
});
|
|
79
98
|
};
|
|
99
|
+
|
|
80
100
|
this.onImageModalClose = () => {
|
|
81
|
-
this.setState({
|
|
101
|
+
this.setState({
|
|
102
|
+
isImageModalOpen: false
|
|
103
|
+
});
|
|
82
104
|
};
|
|
83
|
-
|
|
105
|
+
|
|
106
|
+
this.quillRef = ref => {
|
|
84
107
|
this.quill = ref;
|
|
85
108
|
};
|
|
109
|
+
|
|
86
110
|
Quill.register(LinkFormat, true);
|
|
111
|
+
|
|
87
112
|
if (props.quillOverrides.length) {
|
|
88
|
-
props.quillOverrides.map(
|
|
113
|
+
props.quillOverrides.map(override => Quill.register(override, true));
|
|
89
114
|
}
|
|
115
|
+
|
|
90
116
|
this.state = {
|
|
91
117
|
isImageModalOpen: false,
|
|
92
118
|
isFieldModalOpen: false
|
|
93
119
|
};
|
|
94
|
-
const {
|
|
120
|
+
const {
|
|
121
|
+
toolbar
|
|
122
|
+
} = this.quillModules;
|
|
123
|
+
|
|
95
124
|
if (props.imagesData) {
|
|
96
|
-
toolbar.handlers.image =
|
|
97
|
-
const {
|
|
125
|
+
toolbar.handlers.image = value => {
|
|
126
|
+
const {
|
|
127
|
+
imagesData,
|
|
128
|
+
handleImageClick
|
|
129
|
+
} = this.props;
|
|
130
|
+
|
|
98
131
|
if (!imagesData.length) {
|
|
99
132
|
return;
|
|
100
133
|
}
|
|
101
|
-
|
|
134
|
+
|
|
135
|
+
this.setState({
|
|
136
|
+
isImageModalOpen: !!value
|
|
137
|
+
});
|
|
102
138
|
handleImageClick(value);
|
|
103
139
|
};
|
|
104
140
|
}
|
|
141
|
+
|
|
105
142
|
if (props.customFields) {
|
|
106
|
-
toolbar.handlers.customFields =
|
|
107
|
-
const {
|
|
143
|
+
toolbar.handlers.customFields = value => {
|
|
144
|
+
const {
|
|
145
|
+
customFields,
|
|
146
|
+
handleCustomFieldClick
|
|
147
|
+
} = this.props;
|
|
148
|
+
|
|
108
149
|
if (!customFields.length) {
|
|
109
150
|
return;
|
|
110
151
|
}
|
|
111
|
-
|
|
152
|
+
|
|
153
|
+
this.setState({
|
|
154
|
+
isFieldModalOpen: !!value
|
|
155
|
+
});
|
|
112
156
|
handleCustomFieldClick(value);
|
|
113
157
|
};
|
|
114
158
|
}
|
|
115
159
|
}
|
|
160
|
+
|
|
116
161
|
componentDidMount() {
|
|
162
|
+
// this.quill doesn't exist untill the full call-stack execute
|
|
163
|
+
// we need to "setTimeout" so this componentDidMount work as expected
|
|
117
164
|
setTimeout(() => {
|
|
118
165
|
const quillDomRef = this.quill;
|
|
119
166
|
const editor = quillDomRef.getEditor();
|
|
120
|
-
this.props.getQuillRef(quillDomRef);
|
|
121
|
-
|
|
167
|
+
this.props.getQuillRef(quillDomRef); // https://github.com/quilljs/quill/issues/2677
|
|
168
|
+
|
|
169
|
+
editor.clipboard.addMatcher('a', clipboardLinkWithTagMatcher);
|
|
122
170
|
});
|
|
123
|
-
}
|
|
171
|
+
} // eslint-disable-next-line max-params
|
|
172
|
+
|
|
173
|
+
|
|
124
174
|
getEditor() {
|
|
125
175
|
return this.quill.getEditor();
|
|
126
176
|
}
|
|
177
|
+
|
|
127
178
|
render() {
|
|
128
|
-
const { isFieldModalOpen, isImageModalOpen } = this.state;
|
|
129
179
|
const {
|
|
180
|
+
isFieldModalOpen,
|
|
181
|
+
isImageModalOpen
|
|
182
|
+
} = this.state;
|
|
183
|
+
|
|
184
|
+
const _this$props = this.props,
|
|
185
|
+
{
|
|
130
186
|
containerProps = {},
|
|
131
187
|
customFields,
|
|
132
188
|
imagesData,
|
|
@@ -138,52 +194,52 @@ class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
|
138
194
|
showRawHTML,
|
|
139
195
|
onShowHTML,
|
|
140
196
|
onChange,
|
|
141
|
-
hideItems
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
197
|
+
hideItems
|
|
198
|
+
} = _this$props,
|
|
199
|
+
editorProps = _objectWithoutProperties(_this$props, _excluded);
|
|
200
|
+
|
|
201
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
202
|
+
className: "quill-wysiwyg-editor ".concat(showRawHTML ? 'show-raw' : ''),
|
|
203
|
+
children: [customToolbar || /*#__PURE__*/_jsx(CustomToolbar, {
|
|
204
|
+
customFields: customFields,
|
|
205
|
+
onShowHTML: onShowHTML,
|
|
206
|
+
hideItems: hideItems,
|
|
207
|
+
userProps: this.props
|
|
208
|
+
}), /*#__PURE__*/jsx(ReactQuill, _objectSpread(_objectSpread({
|
|
209
|
+
ref: this.quillRef,
|
|
210
|
+
modules: this.quillModules,
|
|
211
|
+
onChange: this.onChangeQuill,
|
|
212
|
+
value: value,
|
|
213
|
+
style: {
|
|
214
|
+
height,
|
|
215
|
+
borderBottom: '1px solid #ccc'
|
|
216
|
+
}
|
|
217
|
+
}, editorProps), {}, {
|
|
218
|
+
id: "wysiwyg-text-container"
|
|
219
|
+
})), /*#__PURE__*/_jsx("textarea", {
|
|
220
|
+
className: "raw-editor ql-container ql-snow ql-editor",
|
|
221
|
+
style: {
|
|
222
|
+
width: '100%',
|
|
223
|
+
resize: 'none',
|
|
224
|
+
height,
|
|
225
|
+
minHeight: '200px'
|
|
226
|
+
},
|
|
227
|
+
onChange: this.onChangeTextArea,
|
|
228
|
+
value: formatHTML(value)
|
|
229
|
+
}), imagesData && imagesData.length && /*#__PURE__*/_jsx(ImageLibraryModal, {
|
|
230
|
+
imagesData: imagesData,
|
|
231
|
+
isOpen: isImageModalOpen,
|
|
232
|
+
onClose: this.onImageModalClose,
|
|
233
|
+
onConfirm: this.onImageConfirm
|
|
234
|
+
}), customFields && customFields.length && /*#__PURE__*/_jsx(InsertFieldModal, {
|
|
235
|
+
customFields: customFields,
|
|
236
|
+
isOpen: isFieldModalOpen,
|
|
237
|
+
onClose: this.onFieldModalClose,
|
|
238
|
+
onConfirm: this.onInserFieldConfirm
|
|
239
|
+
})]
|
|
183
240
|
}));
|
|
184
241
|
}
|
|
242
|
+
|
|
185
243
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
};
|
|
189
|
-
//# sourceMappingURL=DSWYSIWYGEditorImpl.js.map
|
|
244
|
+
|
|
245
|
+
export { DSWYSIWYGEditorImpl as default };
|
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import DSImageLibraryModal from '@elliemae/ds-imagelibrarymodal';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
class ImageLibraryModal extends React.PureComponent {
|
|
6
15
|
constructor(props) {
|
|
7
16
|
super(props);
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
|
|
18
|
+
this.onSelect = selectedImage => {
|
|
19
|
+
this.setState({
|
|
20
|
+
selectedImage
|
|
21
|
+
});
|
|
10
22
|
};
|
|
23
|
+
|
|
11
24
|
this.onConfirm = () => {
|
|
12
|
-
const {
|
|
13
|
-
|
|
25
|
+
const {
|
|
26
|
+
selectedImage
|
|
27
|
+
} = this.state;
|
|
28
|
+
const {
|
|
29
|
+
onConfirm,
|
|
30
|
+
onClose
|
|
31
|
+
} = this.props;
|
|
14
32
|
onConfirm(selectedImage);
|
|
15
33
|
onClose();
|
|
16
34
|
};
|
|
35
|
+
|
|
17
36
|
this.state = {
|
|
18
|
-
selectedImage:
|
|
37
|
+
selectedImage: undefined
|
|
19
38
|
};
|
|
20
39
|
}
|
|
40
|
+
|
|
21
41
|
render() {
|
|
22
|
-
return
|
|
23
|
-
...this.props,
|
|
42
|
+
return /*#__PURE__*/jsx(DSImageLibraryModal, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
24
43
|
onConfirm: this.onConfirm,
|
|
25
44
|
onSelect: this.onSelect
|
|
26
|
-
});
|
|
45
|
+
}));
|
|
27
46
|
}
|
|
47
|
+
|
|
28
48
|
}
|
|
29
|
-
ImageLibraryModal.propTypes = {
|
|
30
|
-
onConfirm: PropTypes.func.isRequired,
|
|
31
|
-
onClose: PropTypes.func.isRequired,
|
|
32
|
-
onReject: PropTypes.func,
|
|
33
|
-
imagesData: PropTypes.arrayOf(PropTypes.shape({
|
|
34
|
-
id: PropTypes.string,
|
|
35
|
-
url: PropTypes.string.isRequired,
|
|
36
|
-
name: PropTypes.string.isRequired,
|
|
37
|
-
description: PropTypes.string,
|
|
38
|
-
createdBy: PropTypes.string.isRequired,
|
|
39
|
-
createdDate: PropTypes.string.isRequired
|
|
40
|
-
})),
|
|
41
|
-
isOpen: PropTypes.bool.isRequired
|
|
42
|
-
};
|
|
43
49
|
ImageLibraryModal.defaultProps = {
|
|
44
|
-
onReject:
|
|
45
|
-
imagesData: [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
createdDate: "0000-01-01 00:00 AM UTC"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
ImageLibraryModal as default
|
|
50
|
+
onReject: undefined,
|
|
51
|
+
imagesData: [{
|
|
52
|
+
url: 'https://www.freeiconspng.com/minicovers/no-image-icon-6.png',
|
|
53
|
+
name: 'no image',
|
|
54
|
+
createdBy: 'user:John Doe',
|
|
55
|
+
createdDate: '0000-01-01 00:00 AM UTC'
|
|
56
|
+
}, {
|
|
57
|
+
url: 'https://asset-service-bucket-int.s3.us-west-2.amazonaws.com/bd527d8c-472f-4dff-b8c5-1c90d5bae01e',
|
|
58
|
+
name: 'no image 2',
|
|
59
|
+
createdBy: 'user:Jane Doe',
|
|
60
|
+
createdDate: '0000-01-01 00:00 AM UTC'
|
|
61
|
+
}]
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
export { ImageLibraryModal as default };
|