@elliemae/ds-wysiwygeditor 2.0.0-next.1 → 2.0.0-next.11
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 +9 -6
- package/cjs/components/CustomImageUploader.js +15 -12
- package/cjs/components/CustomToolbar.js +122 -151
- package/cjs/components/DSWYSIWYGEditorImpl.js +21 -4
- package/cjs/components/ImageLibraryModal.js +5 -0
- package/cjs/components/InsertFieldModal.js +8 -1
- package/cjs/components/TippedButton.js +55 -0
- package/cjs/components/TippedSelect.js +45 -0
- package/cjs/components/colors.js +7 -3
- package/cjs/components/customFields.js +14 -7
- package/cjs/constants.js +1 -0
- package/cjs/index.js +0 -2
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js +33 -0
- package/cjs/quillOverrides/IndentStyle.js +2 -2
- package/cjs/quillOverrides/LinkFormat.js +5 -4
- package/cjs/quillOverrides/PlainClipboard.js +3 -1
- package/cjs/utils.js +5 -1
- package/esm/DSWYSIWYGEditor.js +9 -6
- package/esm/components/CustomImageUploader.js +13 -9
- package/esm/components/CustomToolbar.js +119 -142
- package/esm/components/DSWYSIWYGEditorImpl.js +21 -4
- package/esm/components/ImageLibraryModal.js +5 -0
- package/esm/components/InsertFieldModal.js +8 -1
- package/esm/components/TippedButton.js +45 -0
- package/esm/components/TippedSelect.js +37 -0
- package/esm/components/colors.js +7 -3
- package/esm/components/customFields.js +14 -7
- package/esm/constants.js +1 -0
- package/esm/index.js +1 -1
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js +29 -0
- package/esm/quillOverrides/IndentStyle.js +2 -2
- package/esm/quillOverrides/LinkFormat.js +5 -4
- package/esm/quillOverrides/PlainClipboard.js +3 -1
- package/esm/utils.js +5 -1
- package/package.json +23 -8
- package/types/DSWYSIWYGEditor.d.ts +2 -0
- package/types/components/CustomImageUploader.d.ts +3 -1
- package/types/components/CustomToolbar.d.ts +3 -17
- package/types/components/TippedButton.d.ts +12 -0
- package/types/components/TippedSelect.d.ts +13 -0
- package/types/quillMatchers/clipboardLinkWithTagMatcher.d.ts +1 -0
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSWYSIWYGEditor.js
CHANGED
|
@@ -4,6 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
13
|
var React = require('react');
|
|
8
14
|
var reactDesc = require('react-desc');
|
|
9
15
|
var DSWYSIWYGEditorImpl = require('./components/DSWYSIWYGEditorImpl.js');
|
|
@@ -58,11 +64,7 @@ const DSWYSIWYGEditor = _ref => {
|
|
|
58
64
|
|
|
59
65
|
const wysiwygEditorProps = {
|
|
60
66
|
value: reactDesc.PropTypes.string.description('editors value').isRequired,
|
|
61
|
-
onChange: reactDesc.PropTypes.func.description(
|
|
62
|
-
It will be passed the HTML contents of the editor, a delta object expressing the change, the source of the change, and finally a read-only proxy to editor accessors such as getHTML().
|
|
63
|
-
⚠️ Do not use this delta object as value, as it will cause a loop.
|
|
64
|
-
Use editor.getContents() instead. See Using Deltas for details.
|
|
65
|
-
Read more: https://github.com/zenoamaro/react-quill#props`).isRequired,
|
|
67
|
+
onChange: reactDesc.PropTypes.func.description("(content, delta, source, editor) : Called back with the new contents of the editor after change. \n It will be passed the HTML contents of the editor, a delta object expressing the change, the source of the change, and finally a read-only proxy to editor accessors such as getHTML(). \n \u26A0\uFE0F Do not use this delta object as value, as it will cause a loop. \n Use editor.getContents() instead. See Using Deltas for details. \n Read more: https://github.com/zenoamaro/react-quill#props").isRequired,
|
|
66
68
|
getQuillRef: reactDesc.PropTypes.func.description('function to use quill.js ref'),
|
|
67
69
|
quillModules: reactDesc.PropTypes.object.description('object to override quill modules'),
|
|
68
70
|
customToolbar: reactDesc.PropTypes.element.description('custom toolbar'),
|
|
@@ -70,7 +72,8 @@ const wysiwygEditorProps = {
|
|
|
70
72
|
showRawHTML: reactDesc.PropTypes.bool.description('whether to display html view or not').defaultValue(false),
|
|
71
73
|
height: reactDesc.PropTypes.string.description('heigth of the editors text area'),
|
|
72
74
|
readOnly: reactDesc.PropTypes.string.description("If true, the editor won't allow changing its contents. Wraps the Quill disable API."),
|
|
73
|
-
hideItems: reactDesc.PropTypes.object.description('object of defaultItems to be removed from toolbar').defaultValue({})
|
|
75
|
+
hideItems: reactDesc.PropTypes.object.description('object of defaultItems to be removed from toolbar').defaultValue({}),
|
|
76
|
+
zIndex: reactDesc.PropTypes.number.description('zIndex to be used (required when used in a modal for correct tooltips displaying)')
|
|
74
77
|
};
|
|
75
78
|
const WYSIWYWithSchema = reactDesc.describe(DSWYSIWYGEditor);
|
|
76
79
|
WYSIWYWithSchema.propTypes = wysiwygEditorProps;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
7
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
8
9
|
var DSUploader = require('@elliemae/ds-uploader');
|
|
9
10
|
var DSModal = require('@elliemae/ds-modal');
|
|
10
|
-
var
|
|
11
|
+
var TippedButton = require('./TippedButton.js');
|
|
11
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
13
|
|
|
13
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
15
|
|
|
15
16
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
-
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
|
|
17
17
|
var DSUploader__default = /*#__PURE__*/_interopDefaultLegacy(DSUploader);
|
|
18
18
|
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
19
19
|
|
|
@@ -21,12 +21,14 @@ const ALLOWED_TYPES_TEXT = 'JPG, JPEG, PNG, GIF, BMP, TIFF';
|
|
|
21
21
|
const ALLOWED_TYPES = /image\/(jpeg|jpg|png|gif|bmp|tiff)/;
|
|
22
22
|
const DEFAULT_MAX_SIZE = 1024 * 1024; // 1 MB
|
|
23
23
|
|
|
24
|
-
const CustomImageUploader =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const CustomImageUploader = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
quillRef,
|
|
27
|
+
editorFieldName,
|
|
28
|
+
allowedImageTypes = ALLOWED_TYPES_TEXT,
|
|
29
|
+
uploadAsset = () => null,
|
|
30
|
+
zIndex = 1
|
|
31
|
+
} = _ref;
|
|
30
32
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
31
33
|
const [error, setError] = React.useState(null);
|
|
32
34
|
const [inProgress, setInProgress] = React.useState(false);
|
|
@@ -34,7 +36,7 @@ const CustomImageUploader = ({
|
|
|
34
36
|
index: 0,
|
|
35
37
|
length: 0
|
|
36
38
|
});
|
|
37
|
-
const elementId =
|
|
39
|
+
const elementId = "uploadImage".concat(editorFieldName); // eslint-disable-next-line consistent-return
|
|
38
40
|
|
|
39
41
|
const handleFileChange = async files => {
|
|
40
42
|
if (!inProgress) {
|
|
@@ -79,13 +81,14 @@ const CustomImageUploader = ({
|
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
82
|
-
children: [/*#__PURE__*/_jsx__default["default"](
|
|
84
|
+
children: [/*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
85
|
+
zIndex: zIndex,
|
|
83
86
|
tip: "Insert Image",
|
|
84
87
|
onClick: () => {
|
|
85
88
|
setLastSelection(quillRef === null || quillRef === void 0 ? void 0 : quillRef.getEditor().getSelection());
|
|
86
89
|
setIsOpen(true);
|
|
87
90
|
}
|
|
88
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
91
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsIcons.Image, {
|
|
89
92
|
color: ['neutral', 500],
|
|
90
93
|
size: "s"
|
|
91
94
|
})), /*#__PURE__*/_jsx__default["default"](DSModal__default["default"], {
|
|
@@ -2,37 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
8
|
require('core-js/modules/es.string.replace.js');
|
|
9
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
10
|
var React = require('react');
|
|
10
|
-
var DSButton = require('@elliemae/ds-
|
|
11
|
-
var
|
|
11
|
+
var DSButton = require('@elliemae/ds-button');
|
|
12
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
12
13
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
13
|
-
var DSTooltip = require('@elliemae/ds-basic/Tooltip');
|
|
14
14
|
var constants = require('../constants.js');
|
|
15
|
+
var TippedButton = require('./TippedButton.js');
|
|
16
|
+
var TippedSelect = require('./TippedSelect.js');
|
|
15
17
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
18
|
|
|
17
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
20
|
|
|
19
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
21
21
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
22
22
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
23
|
-
var ArrowheadDown__default = /*#__PURE__*/_interopDefaultLegacy(ArrowheadDown);
|
|
24
23
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
25
|
-
var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _span, _ArrowheadDown, _Divider, _Divider2, _Divider3, _TippedButton, _TippedButton2, _TippedButton3, _TippedButton4, _TippedButton5, _TippedButton6, _Divider4, _TippedButton7, _TippedButton8, _TippedButton9, _TippedButton10, _span2, _Colors, _Colors2, _Divider5, _TippedButton11, _TippedButton12, _Divider6, _span3, _Divider7, _span4, _Divider8;
|
|
30
|
-
|
|
31
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
32
|
-
|
|
33
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
34
|
-
|
|
35
|
-
const persist = e => e.persist();
|
|
25
|
+
var _span, _ArrowheadDown, _Divider, _Divider2, _Divider3, _Divider4, _Divider5, _Divider6, _Divider7, _Divider8, _Divider9, _CustomFields, _Divider10;
|
|
36
26
|
|
|
37
27
|
const optionsToValues = options => options.map(opt => opt.toLowerCase().replace(' ', '-')); // Stateless Components -----------------------------------------
|
|
38
28
|
|
|
@@ -40,101 +30,61 @@ const optionsToValues = options => options.map(opt => opt.toLowerCase().replace(
|
|
|
40
30
|
const CustomFields = () => _span || (_span = /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, "\u1438\u1433")); // eslint-disable-line react/jsx-one-expression-per-line
|
|
41
31
|
|
|
42
32
|
|
|
43
|
-
const Color =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
tip
|
|
52
|
-
}) => /*#__PURE__*/_jsx__default["default"](TippedSelect, {
|
|
53
|
-
className: className,
|
|
54
|
-
tip: tip
|
|
55
|
-
}, void 0, constants.colors.map(color => /*#__PURE__*/_jsx__default["default"](Color, {
|
|
56
|
-
color: color
|
|
57
|
-
}, color)));
|
|
33
|
+
const Color = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
color
|
|
36
|
+
} = _ref;
|
|
37
|
+
return /*#__PURE__*/_jsx__default["default"]("option", {
|
|
38
|
+
value: color
|
|
39
|
+
});
|
|
40
|
+
};
|
|
58
41
|
|
|
59
|
-
const
|
|
42
|
+
const Colors = _ref2 => {
|
|
60
43
|
let {
|
|
61
44
|
className,
|
|
62
45
|
tip,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
46
|
+
zIndex
|
|
47
|
+
} = _ref2;
|
|
48
|
+
return /*#__PURE__*/_jsx__default["default"](TippedSelect.TippedSelect, {
|
|
49
|
+
className: className,
|
|
50
|
+
tip: tip,
|
|
51
|
+
zIndex: zIndex
|
|
52
|
+
}, void 0, constants.colors.map(color => /*#__PURE__*/_jsx__default["default"](Color, {
|
|
53
|
+
color: color
|
|
54
|
+
}, color)));
|
|
55
|
+
};
|
|
67
56
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
const CustomDropdown = _ref3 => {
|
|
58
|
+
let {
|
|
59
|
+
options,
|
|
60
|
+
label,
|
|
61
|
+
onSelectMenuItem = () => null,
|
|
62
|
+
onClickOutsideMenu = () => null,
|
|
63
|
+
onClose = () => null,
|
|
64
|
+
closeMenuOnItemSelection,
|
|
65
|
+
isOpen,
|
|
66
|
+
minWidth,
|
|
67
|
+
maxWidth,
|
|
68
|
+
zIndex = 10
|
|
69
|
+
} = _ref3;
|
|
70
|
+
return /*#__PURE__*/_jsx__default["default"](DSDropdownMenu__default["default"], {
|
|
71
|
+
onClickOutsideMenu: onClickOutsideMenu,
|
|
72
|
+
options: options,
|
|
73
|
+
onSelectMenuItem: onSelectMenuItem,
|
|
74
|
+
onClose: onClose,
|
|
75
|
+
closeMenuOnItemSelection: closeMenuOnItemSelection,
|
|
76
|
+
isOpen: isOpen,
|
|
77
|
+
minWidth: minWidth,
|
|
78
|
+
maxWidth: maxWidth,
|
|
79
|
+
zIndex: zIndex,
|
|
80
|
+
preventOverflow: "scrollParent",
|
|
81
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
82
|
+
labelText: label,
|
|
83
|
+
buttonType: "text",
|
|
84
|
+
icon: _ArrowheadDown || (_ArrowheadDown = /*#__PURE__*/_jsx__default["default"](dsIcons.ArrowheadDown, {}))
|
|
85
|
+
})
|
|
86
|
+
});
|
|
84
87
|
};
|
|
85
|
-
const TippedSelect = ({
|
|
86
|
-
className,
|
|
87
|
-
options,
|
|
88
|
-
tip,
|
|
89
|
-
defaultValue = '',
|
|
90
|
-
onChange = () => null,
|
|
91
|
-
values,
|
|
92
|
-
children = values && values.map((value, index) => /*#__PURE__*/_jsx__default["default"]("option", {
|
|
93
|
-
value: value === 'normal' ? '' : value
|
|
94
|
-
}, value, options ? options[index] : null))
|
|
95
|
-
}) => /*#__PURE__*/_jsx__default["default"]("div", {
|
|
96
|
-
className: "tooltip"
|
|
97
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](DSTooltip__default["default"], {
|
|
98
|
-
interactionType: "hover",
|
|
99
|
-
title: tip,
|
|
100
|
-
delayClose: 20,
|
|
101
|
-
triggerComponent: /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/_jsx__default["default"]("select", {
|
|
102
|
-
className: className,
|
|
103
|
-
defaultValue: defaultValue,
|
|
104
|
-
onChange: e => {
|
|
105
|
-
persist(e);
|
|
106
|
-
onChange(e);
|
|
107
|
-
}
|
|
108
|
-
}, void 0, children))
|
|
109
|
-
}));
|
|
110
|
-
const CustomDropdown = ({
|
|
111
|
-
options,
|
|
112
|
-
label,
|
|
113
|
-
onSelectMenuItem = () => null,
|
|
114
|
-
onClickOutsideMenu = () => null,
|
|
115
|
-
onClose = () => null,
|
|
116
|
-
closeMenuOnItemSelection,
|
|
117
|
-
isOpen,
|
|
118
|
-
minWidth,
|
|
119
|
-
maxWidth,
|
|
120
|
-
zIndex = 10
|
|
121
|
-
}) => /*#__PURE__*/_jsx__default["default"](DSDropdownMenu__default["default"], {
|
|
122
|
-
onClickOutsideMenu: onClickOutsideMenu,
|
|
123
|
-
options: options,
|
|
124
|
-
onSelectMenuItem: onSelectMenuItem,
|
|
125
|
-
onClose: onClose,
|
|
126
|
-
closeMenuOnItemSelection: closeMenuOnItemSelection,
|
|
127
|
-
isOpen: isOpen,
|
|
128
|
-
minWidth: minWidth,
|
|
129
|
-
maxWidth: maxWidth,
|
|
130
|
-
zIndex: zIndex,
|
|
131
|
-
preventOverflow: "scrollParent",
|
|
132
|
-
triggerComponent: /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
133
|
-
labelText: label,
|
|
134
|
-
buttonType: "text",
|
|
135
|
-
icon: _ArrowheadDown || (_ArrowheadDown = /*#__PURE__*/_jsx__default["default"](ArrowheadDown__default["default"], {}))
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
88
|
|
|
139
89
|
const Divider = () => /*#__PURE__*/_jsx__default["default"]("div", {
|
|
140
90
|
style: {
|
|
@@ -147,13 +97,15 @@ const Divider = () => /*#__PURE__*/_jsx__default["default"]("div", {
|
|
|
147
97
|
}
|
|
148
98
|
});
|
|
149
99
|
|
|
150
|
-
const CustomToolbar =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
100
|
+
const CustomToolbar = _ref4 => {
|
|
101
|
+
let {
|
|
102
|
+
customFields,
|
|
103
|
+
customItems = [],
|
|
104
|
+
hideItems = {},
|
|
105
|
+
onShowHTML = () => {},
|
|
106
|
+
id = 'toolbar',
|
|
107
|
+
userProps
|
|
108
|
+
} = _ref4;
|
|
157
109
|
const {
|
|
158
110
|
HEADER,
|
|
159
111
|
FONT,
|
|
@@ -190,99 +142,119 @@ const CustomToolbar = ({
|
|
|
190
142
|
}, void 0, (!HEADER || !FONT || !FONT_SIZE) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
191
143
|
className: "ql-formats"
|
|
192
144
|
}, void 0, !HEADER && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
193
|
-
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect, {
|
|
145
|
+
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect.TippedSelect, {
|
|
194
146
|
className: "ql-header",
|
|
195
147
|
tip: "Header",
|
|
196
|
-
values: ['', '1', '2', '3', '4', '5', '6']
|
|
148
|
+
values: ['', '1', '2', '3', '4', '5', '6'],
|
|
149
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1
|
|
197
150
|
}), _Divider || (_Divider = /*#__PURE__*/_jsx__default["default"](Divider, {}))]
|
|
198
151
|
}), !FONT && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
199
|
-
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect, {
|
|
152
|
+
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect.TippedSelect, {
|
|
200
153
|
className: "ql-font",
|
|
201
154
|
defaultValue: "sans-serif",
|
|
202
155
|
options: constants.fonts,
|
|
203
156
|
tip: "Font",
|
|
204
|
-
values: optionsToValues(constants.fonts)
|
|
157
|
+
values: optionsToValues(constants.fonts),
|
|
158
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1
|
|
205
159
|
}), _Divider2 || (_Divider2 = /*#__PURE__*/_jsx__default["default"](Divider, {}))]
|
|
206
160
|
}), !FONT_SIZE && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
207
|
-
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect, {
|
|
161
|
+
children: [/*#__PURE__*/_jsx__default["default"](TippedSelect.TippedSelect, {
|
|
208
162
|
className: "ql-size",
|
|
209
163
|
options: constants.sizes,
|
|
210
164
|
tip: "Font Size",
|
|
211
|
-
values: optionsToValues(constants.sizesReal)
|
|
165
|
+
values: optionsToValues(constants.sizesReal),
|
|
166
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1
|
|
212
167
|
}), _Divider3 || (_Divider3 = /*#__PURE__*/_jsx__default["default"](Divider, {}))]
|
|
213
168
|
})), (!BOLD || !ITALIC || !UNDERLINE || !STRIKE) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
214
169
|
className: "ql-formats"
|
|
215
|
-
}, void 0, !BOLD &&
|
|
170
|
+
}, void 0, !BOLD && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
171
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
216
172
|
className: "ql-bold",
|
|
217
173
|
tip: "Bold"
|
|
218
|
-
})
|
|
174
|
+
}), !ITALIC && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
175
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
219
176
|
className: "ql-italic",
|
|
220
177
|
tip: "Italic"
|
|
221
|
-
})
|
|
178
|
+
}), !UNDERLINE && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
179
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
222
180
|
className: "ql-underline",
|
|
223
181
|
tip: "Underline"
|
|
224
|
-
})
|
|
182
|
+
}), !STRIKE && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
183
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
225
184
|
className: "ql-strike",
|
|
226
185
|
tip: "Strike"
|
|
227
|
-
}))
|
|
186
|
+
})), (!SUB || !SUPER) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
228
187
|
className: "ql-formats"
|
|
229
|
-
}, void 0, !SUB &&
|
|
188
|
+
}, void 0, !SUB && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
189
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
230
190
|
className: "ql-script",
|
|
231
191
|
tip: "Sub",
|
|
232
192
|
value: "sub"
|
|
233
|
-
})
|
|
193
|
+
}), !SUPER && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
194
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
234
195
|
className: "ql-script",
|
|
235
196
|
tip: "Super",
|
|
236
197
|
value: "super"
|
|
237
|
-
})
|
|
198
|
+
}), _Divider4 || (_Divider4 = /*#__PURE__*/_jsx__default["default"](Divider, {}))), (!ORDERED_LIST || !BULLET_LIST) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
238
199
|
className: "ql-formats"
|
|
239
|
-
}, void 0, !ORDERED_LIST &&
|
|
200
|
+
}, void 0, !ORDERED_LIST && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
201
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
240
202
|
className: "ql-list",
|
|
241
203
|
tip: "Ordered List",
|
|
242
204
|
value: "ordered"
|
|
243
|
-
})
|
|
205
|
+
}), !BULLET_LIST && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
206
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
244
207
|
className: "ql-list",
|
|
245
208
|
tip: "Bullet List",
|
|
246
209
|
value: "bullet"
|
|
247
|
-
}))
|
|
210
|
+
})), (!INDENT_MINUS_ONE || !INDENT_PLUS_ONE) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
248
211
|
className: "ql-formats"
|
|
249
|
-
}, void 0, !INDENT_MINUS_ONE &&
|
|
212
|
+
}, void 0, !INDENT_MINUS_ONE && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
213
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
250
214
|
className: "ql-indent",
|
|
251
215
|
tip: "Indent -1",
|
|
252
216
|
value: "-1"
|
|
253
|
-
})
|
|
217
|
+
}), !INDENT_PLUS_ONE && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
218
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
254
219
|
className: "ql-indent",
|
|
255
220
|
tip: "Indent +1",
|
|
256
221
|
value: "+1"
|
|
257
|
-
}))
|
|
222
|
+
})), !ALIGN && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
258
223
|
className: "ql-formats"
|
|
259
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](TippedSelect, {
|
|
224
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](TippedSelect.TippedSelect, {
|
|
225
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
260
226
|
className: "ql-align",
|
|
261
227
|
tip: "Align"
|
|
262
|
-
}), /*#__PURE__*/_jsx__default["default"](Divider, {})))
|
|
228
|
+
}), _Divider5 || (_Divider5 = /*#__PURE__*/_jsx__default["default"](Divider, {}))), (!FONT_COLOR || !FONT_BACKGROUND_COLOR) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
263
229
|
className: "ql-formats"
|
|
264
|
-
}, void 0, !FONT_COLOR &&
|
|
230
|
+
}, void 0, !FONT_COLOR && /*#__PURE__*/_jsx__default["default"](Colors, {
|
|
231
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
265
232
|
className: "ql-color",
|
|
266
233
|
tip: "Font Color"
|
|
267
|
-
})
|
|
234
|
+
}), !FONT_BACKGROUND_COLOR && /*#__PURE__*/_jsx__default["default"](Colors, {
|
|
235
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
268
236
|
className: "ql-background",
|
|
269
237
|
tip: "Font Background Color"
|
|
270
|
-
})
|
|
238
|
+
}), _Divider6 || (_Divider6 = /*#__PURE__*/_jsx__default["default"](Divider, {}))), (!HYPERLINK || !IMAGE) && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
271
239
|
className: "ql-formats"
|
|
272
|
-
}, void 0, !HYPERLINK &&
|
|
240
|
+
}, void 0, !HYPERLINK && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
241
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
273
242
|
className: "ql-link",
|
|
274
243
|
tip: "Hyperlink: Select Text First"
|
|
275
|
-
})
|
|
244
|
+
}), !IMAGE && /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
245
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
276
246
|
className: "ql-image",
|
|
277
247
|
tip: "Insert Image"
|
|
278
|
-
})
|
|
248
|
+
}), _Divider7 || (_Divider7 = /*#__PURE__*/_jsx__default["default"](Divider, {}))), !CLEAR_FORMAT && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
279
249
|
className: "ql-formats"
|
|
280
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](TippedButton, {
|
|
250
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
251
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
281
252
|
className: "ql-clean",
|
|
282
253
|
tip: "Clear Format (Select Text)"
|
|
283
|
-
}))
|
|
254
|
+
})), !SHOW_HTML && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
284
255
|
className: "ql-formats"
|
|
285
|
-
}, void 0,
|
|
256
|
+
}, void 0, _Divider8 || (_Divider8 = /*#__PURE__*/_jsx__default["default"](Divider, {})), /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
257
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
286
258
|
style: {
|
|
287
259
|
width: 'fit-content',
|
|
288
260
|
color: '#1e79c2',
|
|
@@ -291,21 +263,20 @@ const CustomToolbar = ({
|
|
|
291
263
|
onClick: handleShowHTML,
|
|
292
264
|
tip: showHTML ? 'SHOW TEXT' : 'SHOW HTML',
|
|
293
265
|
className: "ql-customFields-html"
|
|
294
|
-
}, void 0, showHTML ? 'SHOW TEXT' : 'SHOW HTML')), customFields &&
|
|
266
|
+
}, void 0, showHTML ? 'SHOW TEXT' : 'SHOW HTML')), customFields && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
295
267
|
className: "ql-formats"
|
|
296
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](Divider, {}), /*#__PURE__*/_jsx__default["default"](TippedButton, {
|
|
268
|
+
}, void 0, _Divider9 || (_Divider9 = /*#__PURE__*/_jsx__default["default"](Divider, {})), /*#__PURE__*/_jsx__default["default"](TippedButton.TippedButton, {
|
|
269
|
+
zIndex: (userProps === null || userProps === void 0 ? void 0 : userProps.zIndex) || 1,
|
|
297
270
|
className: "ql-customFields",
|
|
298
271
|
tip: "Insert Custom Field"
|
|
299
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](CustomFields, {}))))
|
|
272
|
+
}, void 0, _CustomFields || (_CustomFields = /*#__PURE__*/_jsx__default["default"](CustomFields, {})))), customItems && /*#__PURE__*/_jsx__default["default"]("span", {
|
|
300
273
|
style: {
|
|
301
274
|
display: 'inline-flex'
|
|
302
275
|
}
|
|
303
276
|
}, void 0, customItems.map(Item => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
304
|
-
children: [
|
|
277
|
+
children: [_Divider10 || (_Divider10 = /*#__PURE__*/_jsx__default["default"](Divider, {})), /*#__PURE__*/_jsx__default["default"](Item, {})]
|
|
305
278
|
}))));
|
|
306
279
|
};
|
|
307
280
|
|
|
308
281
|
exports.CustomDropdown = CustomDropdown;
|
|
309
282
|
exports.CustomToolbar = CustomToolbar;
|
|
310
|
-
exports.TippedButton = TippedButton;
|
|
311
|
-
exports.TippedSelect = TippedSelect;
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
13
|
var React = require('react');
|
|
7
14
|
var ReactQuill = require('react-quill');
|
|
8
15
|
var BlotFormatter = require('quill-blot-formatter');
|
|
@@ -12,6 +19,7 @@ var CustomToolbar = require('./CustomToolbar.js');
|
|
|
12
19
|
var IndentStyle = require('../quillOverrides/IndentStyle.js');
|
|
13
20
|
var LinkFormat = require('../quillOverrides/LinkFormat.js');
|
|
14
21
|
var utils = require('../utils.js');
|
|
22
|
+
var clipboardLinkWithTagMatcher = require('../quillMatchers/clipboardLinkWithTagMatcher.js');
|
|
15
23
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
24
|
|
|
17
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52,7 +60,7 @@ class DSWYSIWYGEditorImpl extends React__default["default"].PureComponent {
|
|
|
52
60
|
|
|
53
61
|
_defineProperty__default["default"](this, "quillModules", _objectSpread({
|
|
54
62
|
toolbar: {
|
|
55
|
-
container: this.props.toolbarContainer ?
|
|
63
|
+
container: this.props.toolbarContainer ? "#".concat(this.props.toolbarContainer) : '#toolbar',
|
|
56
64
|
handlers: _objectSpread({}, this.props.toolbarHandlers)
|
|
57
65
|
},
|
|
58
66
|
clipboard: {
|
|
@@ -163,7 +171,15 @@ class DSWYSIWYGEditorImpl extends React__default["default"].PureComponent {
|
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
componentDidMount() {
|
|
166
|
-
this.
|
|
174
|
+
// this.quill doesn't exist untill the full call-stack execute
|
|
175
|
+
// we need to "setTimeout" so this componentDidMount work as expected
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
const quillDomRef = this.quill;
|
|
178
|
+
const editor = quillDomRef.getEditor();
|
|
179
|
+
this.props.getQuillRef(quillDomRef); // https://github.com/quilljs/quill/issues/2677
|
|
180
|
+
|
|
181
|
+
editor.clipboard.addMatcher('a', clipboardLinkWithTagMatcher.clipboardLinkWithTagMatcher);
|
|
182
|
+
});
|
|
167
183
|
} // eslint-disable-next-line max-params
|
|
168
184
|
|
|
169
185
|
|
|
@@ -195,11 +211,12 @@ class DSWYSIWYGEditorImpl extends React__default["default"].PureComponent {
|
|
|
195
211
|
editorProps = _objectWithoutProperties__default["default"](_this$props, _excluded);
|
|
196
212
|
|
|
197
213
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
198
|
-
className:
|
|
214
|
+
className: "quill-wysiwyg-editor ".concat(showRawHTML ? 'show-raw' : ''),
|
|
199
215
|
children: [customToolbar || /*#__PURE__*/_jsx__default["default"](CustomToolbar.CustomToolbar, {
|
|
200
216
|
customFields: customFields,
|
|
201
217
|
onShowHTML: onShowHTML,
|
|
202
|
-
hideItems: hideItems
|
|
218
|
+
hideItems: hideItems,
|
|
219
|
+
userProps: this.props
|
|
203
220
|
}), /*#__PURE__*/jsxRuntime.jsx(ReactQuill__default["default"], _objectSpread(_objectSpread({
|
|
204
221
|
ref: this.quillRef,
|
|
205
222
|
modules: this.quillModules,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
3
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
9
|
var React = require('react');
|
|
5
10
|
var DSImageLibraryModal = require('@elliemae/ds-imagelibrarymodal');
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
4
4
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
13
|
var React = require('react');
|
|
7
14
|
var DSModal = require('@elliemae/ds-modal');
|
|
8
|
-
var lodash = require('lodash');
|
|
9
15
|
var constants = require('@elliemae/ds-shared/constants');
|
|
16
|
+
var lodash = require('lodash');
|
|
10
17
|
var customFields = require('./customFields.js');
|
|
11
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
19
|
|