@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.
Files changed (70) hide show
  1. package/cjs/DSWYSIWYGEditor.js +72 -83
  2. package/cjs/components/CustomImageUploader.js +94 -92
  3. package/cjs/components/CustomToolbar.js +193 -172
  4. package/cjs/components/DSWYSIWYGEditorImpl.js +185 -147
  5. package/cjs/components/ImageLibraryModal.js +55 -75
  6. package/cjs/components/InsertFieldModal.js +142 -109
  7. package/cjs/components/TippedButton.js +54 -56
  8. package/cjs/components/TippedSelect.js +39 -50
  9. package/cjs/components/colors.js +21 -41
  10. package/cjs/components/customFields.js +47 -66
  11. package/cjs/constants.js +38 -112
  12. package/cjs/index.js +21 -39
  13. package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js +22 -37
  14. package/cjs/quillOverrides/IndentStyle.js +19 -41
  15. package/cjs/quillOverrides/LinkFormat.js +39 -57
  16. package/cjs/quillOverrides/PlainClipboard.js +21 -41
  17. package/cjs/utils.js +18 -41
  18. package/esm/DSWYSIWYGEditor.js +58 -50
  19. package/esm/components/CustomImageUploader.js +81 -60
  20. package/esm/components/CustomToolbar.js +184 -145
  21. package/esm/components/DSWYSIWYGEditorImpl.js +169 -113
  22. package/esm/components/ImageLibraryModal.js +47 -46
  23. package/esm/components/InsertFieldModal.js +124 -72
  24. package/esm/components/TippedButton.js +44 -27
  25. package/esm/components/TippedSelect.js +31 -21
  26. package/esm/components/colors.js +17 -12
  27. package/esm/components/customFields.js +40 -38
  28. package/esm/constants.js +30 -83
  29. package/esm/index.js +4 -10
  30. package/esm/quillMatchers/clipboardLinkWithTagMatcher.js +18 -8
  31. package/esm/quillOverrides/IndentStyle.js +17 -12
  32. package/esm/quillOverrides/LinkFormat.js +37 -28
  33. package/esm/quillOverrides/PlainClipboard.js +19 -12
  34. package/esm/utils.js +14 -12
  35. package/package.json +9 -9
  36. package/types/DSWYSIWYGEditor.d.ts +1 -12
  37. package/cjs/DSWYSIWYGEditor.js.map +0 -7
  38. package/cjs/components/CustomImageUploader.js.map +0 -7
  39. package/cjs/components/CustomToolbar.js.map +0 -7
  40. package/cjs/components/DSWYSIWYGEditorImpl.js.map +0 -7
  41. package/cjs/components/ImageLibraryModal.js.map +0 -7
  42. package/cjs/components/InsertFieldModal.js.map +0 -7
  43. package/cjs/components/TippedButton.js.map +0 -7
  44. package/cjs/components/TippedSelect.js.map +0 -7
  45. package/cjs/components/colors.js.map +0 -7
  46. package/cjs/components/customFields.js.map +0 -7
  47. package/cjs/constants.js.map +0 -7
  48. package/cjs/index.js.map +0 -7
  49. package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
  50. package/cjs/quillOverrides/IndentStyle.js.map +0 -7
  51. package/cjs/quillOverrides/LinkFormat.js.map +0 -7
  52. package/cjs/quillOverrides/PlainClipboard.js.map +0 -7
  53. package/cjs/utils.js.map +0 -7
  54. package/esm/DSWYSIWYGEditor.js.map +0 -7
  55. package/esm/components/CustomImageUploader.js.map +0 -7
  56. package/esm/components/CustomToolbar.js.map +0 -7
  57. package/esm/components/DSWYSIWYGEditorImpl.js.map +0 -7
  58. package/esm/components/ImageLibraryModal.js.map +0 -7
  59. package/esm/components/InsertFieldModal.js.map +0 -7
  60. package/esm/components/TippedButton.js.map +0 -7
  61. package/esm/components/TippedSelect.js.map +0 -7
  62. package/esm/components/colors.js.map +0 -7
  63. package/esm/components/customFields.js.map +0 -7
  64. package/esm/constants.js.map +0 -7
  65. package/esm/index.js.map +0 -7
  66. package/esm/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
  67. package/esm/quillOverrides/IndentStyle.js.map +0 -7
  68. package/esm/quillOverrides/LinkFormat.js.map +0 -7
  69. package/esm/quillOverrides/PlainClipboard.js.map +0 -7
  70. package/esm/utils.js.map +0 -7
@@ -1,156 +1,208 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import PropTypes from "prop-types";
4
- import DSModal, { MODAL_TYPE } from "@elliemae/ds-modal";
5
- import { sizeOptions } from "@elliemae/ds-shared/constants";
6
- import { includes } from "lodash";
7
- import { fields, getFieldName, getFieldCode } from "./customFields";
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
2
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
4
+ import 'core-js/modules/esnext.async-iterator.map.js';
5
+ import 'core-js/modules/esnext.iterator.map.js';
6
+ import 'core-js/modules/esnext.async-iterator.filter.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.filter.js';
9
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
10
+ import 'core-js/modules/esnext.iterator.for-each.js';
11
+ import React from 'react';
12
+ import DSModal, { MODAL_TYPE } from '@elliemae/ds-modal';
13
+ import { sizeOptions } from '@elliemae/ds-shared/constants';
14
+ import { includes } from 'lodash';
15
+ import { getFieldCode, getFieldName, fields } from './customFields.js';
16
+ import { jsx } from 'react/jsx-runtime';
17
+
18
+ const _excluded = ["customFields", "onSelect"];
19
+
20
+ 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; }
21
+
22
+ 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; }
8
23
  const modalTypes = Object.values(MODAL_TYPE);
9
- const elementClassName = "insertfieldmodal-element";
10
- class InsertFieldModal extends React2.PureComponent {
24
+ const elementClassName = 'insertfieldmodal-element';
25
+ class InsertFieldModal extends React.PureComponent {
11
26
  constructor(props) {
12
27
  super(props);
28
+
13
29
  this.onConfirm = () => {
14
- const { onConfirm, onClose } = this.props;
15
- const { selectedFieldCode } = this.state;
30
+ const {
31
+ onConfirm,
32
+ onClose
33
+ } = this.props;
34
+ const {
35
+ selectedFieldCode
36
+ } = this.state;
16
37
  onConfirm(selectedFieldCode);
17
38
  onClose();
18
39
  };
40
+
19
41
  this.onReject = () => {
20
- const { onReject, onClose } = this.props;
42
+ const {
43
+ onReject,
44
+ onClose
45
+ } = this.props;
46
+
21
47
  if (onReject) {
22
48
  onReject();
23
49
  } else {
24
50
  onClose();
25
51
  }
26
52
  };
27
- this.drawDiv = (className, content, content2) => /* @__PURE__ */ React2.createElement("div", {
28
- className
29
- }, /* @__PURE__ */ React2.createElement("span", null, content), /* @__PURE__ */ React2.createElement("span", null, content2));
30
- this.drawLabel = (className, label, value) => /* @__PURE__ */ React2.createElement("div", {
31
- className
32
- }, /* @__PURE__ */ React2.createElement("span", {
53
+
54
+ this.drawDiv = (className, content, content2) => /*#__PURE__*/_jsx("div", {
55
+ className: className
56
+ }, void 0, /*#__PURE__*/_jsx("span", {}, void 0, content), /*#__PURE__*/_jsx("span", {}, void 0, content2));
57
+
58
+ this.drawLabel = (className, label, value) => /*#__PURE__*/_jsx("div", {
59
+ className: className
60
+ }, void 0, /*#__PURE__*/_jsx("span", {
33
61
  className: "label"
34
- }, label), /* @__PURE__ */ React2.createElement("span", {
62
+ }, void 0, label), /*#__PURE__*/_jsx("span", {
35
63
  className: "value"
36
- }, value));
64
+ }, void 0, value));
65
+
37
66
  this.handleElementClick = (e, selectedFieldCode) => {
38
- if (e.key && e.key !== " ") {
67
+ if (e.key && e.key !== ' ') {
39
68
  return;
40
69
  }
41
- const { selectedFieldCode: fCode } = this.state;
42
- const { disableDoubleClick } = this.props;
70
+
71
+ const {
72
+ selectedFieldCode: fCode
73
+ } = this.state;
74
+ const {
75
+ disableDoubleClick
76
+ } = this.props;
77
+
43
78
  if (selectedFieldCode === fCode && !disableDoubleClick) {
44
79
  this.onConfirm();
45
80
  return;
46
81
  }
82
+
47
83
  this.setState({
48
84
  selectedFieldCode
49
85
  });
50
- const { onSelect } = this.props;
86
+ const {
87
+ onSelect
88
+ } = this.props;
89
+
51
90
  if (onSelect) {
52
91
  onSelect(selectedFieldCode);
53
92
  }
54
93
  };
94
+
55
95
  this.preventSpacebarScroll = () => {
56
- document.onkeypress = function(e) {
96
+ document.onkeypress = function (e) {
57
97
  if (!includes(e.target.className, elementClassName)) {
58
98
  return true;
59
99
  }
100
+
60
101
  e = e || window.event;
61
102
  const charCode = e.keyCode || e.which;
103
+
62
104
  if (charCode === 32) {
63
105
  e.preventDefault();
64
106
  return false;
65
107
  }
108
+
66
109
  return true;
67
110
  };
68
111
  };
112
+
69
113
  this.renderElements = () => {
70
- const { customFields } = this.props;
114
+ const {
115
+ customFields
116
+ } = this.props;
117
+
71
118
  if (!customFields) {
72
- return "Empty";
119
+ return 'Empty';
73
120
  }
74
- const { selectedFieldCode } = this.state;
121
+
122
+ const {
123
+ selectedFieldCode
124
+ } = this.state;
75
125
  return customFields.map((customField, idx) => {
76
126
  const extras = {};
77
127
  const fieldCode = getFieldCode(customField);
128
+
78
129
  if (this.focusFirst && idx === 0) {
79
- extras.ref = (element) => element && element.focus();
80
- this.focusFirst = void 0;
130
+ extras.ref = element => element && element.focus();
131
+
132
+ this.focusFirst = undefined;
81
133
  } else if (fieldCode === selectedFieldCode) {
82
- extras.ref = (element) => element && element.focus();
134
+ extras.ref = element => element && element.focus();
83
135
  }
84
- return /* @__PURE__ */ React2.createElement("div", {
85
- key: fieldCode,
136
+
137
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
86
138
  className: elementClassName,
87
- onClick: (e) => this.handleElementClick(e, fieldCode),
88
- onKeyUp: (e) => this.handleElementClick(e, fieldCode),
139
+ onClick: e => this.handleElementClick(e, fieldCode),
140
+ onKeyUp: e => this.handleElementClick(e, fieldCode),
89
141
  role: "button",
90
- tabIndex: 0,
91
- ...extras
92
- }, this.drawLabel("content", getFieldName(customField), fieldCode));
142
+ tabIndex: 0
143
+ }, extras), {}, {
144
+ children: this.drawLabel('content', getFieldName(customField), fieldCode)
145
+ }), fieldCode);
93
146
  });
94
147
  };
148
+
95
149
  this.state = {
96
150
  selectedFieldCode: getFieldCode(fields[0])
97
151
  };
98
152
  this.preventSpacebarScroll();
99
153
  }
154
+
100
155
  componentDidMount() {
101
- const { customFields } = this.props;
156
+ const {
157
+ customFields
158
+ } = this.props;
159
+
102
160
  if (customFields) {
103
161
  this.handleElementClick({}, customFields[0]);
104
162
  this.focusFirst = true;
105
163
  }
106
164
  }
165
+
107
166
  getDerivedStateFromProps(nextProps) {
108
- const { customFields } = this.props;
167
+ const {
168
+ customFields
169
+ } = this.props;
170
+
109
171
  if (!customFields && nextProps.customFields) {
110
- this.setState({ selectedFieldCode: customFields[0] });
172
+ this.setState({
173
+ selectedFieldCode: customFields[0]
174
+ });
111
175
  }
112
176
  }
177
+
113
178
  render() {
114
- const { customFields, onSelect, ...modalProps } = this.props;
115
- return /* @__PURE__ */ React2.createElement(DSModal, {
116
- ...modalProps,
179
+ const _this$props = this.props,
180
+ modalProps = _objectWithoutProperties(_this$props, _excluded);
181
+
182
+ return /*#__PURE__*/jsx(DSModal, _objectSpread(_objectSpread({}, modalProps), {}, {
117
183
  className: "insert-field-modal",
118
184
  onConfirm: this.onConfirm,
119
- onReject: this.onReject
120
- }, /* @__PURE__ */ React2.createElement("div", {
121
- className: "wrapper"
122
- }, /* @__PURE__ */ React2.createElement("div", {
123
- className: "col-1"
124
- }, this.drawDiv("title", "Field Name", "\xAB Field ID \xBB"), this.renderElements())));
185
+ onReject: this.onReject,
186
+ children: /*#__PURE__*/_jsx("div", {
187
+ className: "wrapper"
188
+ }, void 0, /*#__PURE__*/_jsx("div", {
189
+ className: "col-1"
190
+ }, void 0, this.drawDiv('title', 'Field Name', '« Field ID »'), this.renderElements()))
191
+ }));
125
192
  }
193
+
126
194
  }
127
- InsertFieldModal.propTypes = {
128
- onConfirm: PropTypes.func.isRequired,
129
- onClose: PropTypes.func.isRequired,
130
- confirmLabel: PropTypes.string,
131
- customFields: PropTypes.arrayOf(PropTypes.string),
132
- disableDoubleClick: PropTypes.bool,
133
- isOpen: PropTypes.bool,
134
- modalTitle: PropTypes.string,
135
- modalType: PropTypes.string,
136
- rejectLabel: PropTypes.string,
137
- shouldCloseOnOverlayClick: PropTypes.bool,
138
- size: PropTypes.string,
139
- onSelect: PropTypes.func
140
- };
141
195
  InsertFieldModal.defaultProps = {
142
- confirmLabel: "Add",
196
+ confirmLabel: 'Add',
143
197
  customFields: fields,
144
198
  disableDoubleClick: false,
145
199
  isOpen: true,
146
- modalTitle: "Add Field",
200
+ modalTitle: 'Add Field',
147
201
  modalType: modalTypes[1],
148
- rejectLabel: "Cancel",
202
+ rejectLabel: 'Cancel',
149
203
  shouldCloseOnOverlayClick: true,
150
204
  size: sizeOptions[1],
151
- onSelect: void 0
152
- };
153
- export {
154
- InsertFieldModal as default
205
+ onSelect: undefined
155
206
  };
156
- //# sourceMappingURL=InsertFieldModal.js.map
207
+
208
+ export { InsertFieldModal as default };
@@ -1,28 +1,45 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { DSTooltipV3 } from "@elliemae/ds-tooltip";
4
- const TippedButton = ({
5
- className,
6
- tip,
7
- children,
8
- onClick = () => null,
9
- zIndex = 1,
10
- ...rest
11
- }) => /* @__PURE__ */ React2.createElement("div", {
12
- className: "tooltip"
13
- }, /* @__PURE__ */ React2.createElement(DSTooltipV3, {
14
- text: tip,
15
- zIndex
16
- }, /* @__PURE__ */ React2.createElement("button", {
17
- type: "button",
18
- className,
19
- onClick: (e) => {
20
- e.preventDefault();
21
- onClick(e);
22
- },
23
- ...rest
24
- }, children)));
25
- export {
26
- TippedButton
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
9
+ import 'react';
10
+ import { DSTooltipV3 } from '@elliemae/ds-tooltip';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ const _excluded = ["className", "tip", "children", "onClick", "zIndex"];
14
+
15
+ 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; }
16
+
17
+ 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; }
18
+ const TippedButton = _ref => {
19
+ let {
20
+ className,
21
+ tip,
22
+ children,
23
+ onClick = () => null,
24
+ zIndex = 1
25
+ } = _ref,
26
+ rest = _objectWithoutProperties(_ref, _excluded);
27
+
28
+ return /*#__PURE__*/_jsx("div", {
29
+ className: "tooltip"
30
+ }, void 0, /*#__PURE__*/_jsx(DSTooltipV3, {
31
+ text: tip,
32
+ zIndex: zIndex
33
+ }, void 0, /*#__PURE__*/jsx("button", _objectSpread(_objectSpread({
34
+ type: "button",
35
+ className: className,
36
+ onClick: e => {
37
+ e.preventDefault();
38
+ onClick(e);
39
+ }
40
+ }, rest), {}, {
41
+ children: children
42
+ }))));
27
43
  };
28
- //# sourceMappingURL=TippedButton.js.map
44
+
45
+ export { TippedButton };
@@ -1,27 +1,37 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { DSTooltipV3 } from "@elliemae/ds-tooltip";
4
- const TippedSelect = (props) => {
5
- const { tip, onChange = () => null, className, options, defaultValue = "", values, zIndex, children } = props;
6
- const fallBackChildren = values && values.map((value, index) => /* @__PURE__ */ React2.createElement("option", {
7
- key: value,
8
- value: value === "normal" ? "" : value
9
- }, options ? options[index] : null));
10
- return /* @__PURE__ */ React2.createElement("div", {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import 'react';
6
+ import { DSTooltipV3 } from '@elliemae/ds-tooltip';
7
+
8
+ const TippedSelect = props => {
9
+ const {
10
+ tip,
11
+ onChange = () => null,
12
+ className,
13
+ options,
14
+ defaultValue = '',
15
+ values,
16
+ zIndex,
17
+ children
18
+ } = props;
19
+ const fallBackChildren = values && values.map((value, index) => /*#__PURE__*/_jsx("option", {
20
+ value: value === 'normal' ? '' : value
21
+ }, value, options ? options[index] : null));
22
+ return /*#__PURE__*/_jsx("div", {
11
23
  className: "tooltip"
12
- }, /* @__PURE__ */ React2.createElement(DSTooltipV3, {
24
+ }, void 0, /*#__PURE__*/_jsx(DSTooltipV3, {
13
25
  text: tip,
14
- zIndex
15
- }, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("select", {
16
- className,
17
- defaultValue,
18
- onChange: (e) => {
26
+ zIndex: zIndex
27
+ }, void 0, /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/_jsx("select", {
28
+ className: className,
29
+ defaultValue: defaultValue,
30
+ onChange: e => {
19
31
  e.persist();
20
32
  onChange(e);
21
33
  }
22
- }, children || fallBackChildren))));
23
- };
24
- export {
25
- TippedSelect
34
+ }, void 0, children || fallBackChildren))));
26
35
  };
27
- //# sourceMappingURL=TippedSelect.js.map
36
+
37
+ export { TippedSelect };
@@ -1,21 +1,26 @@
1
- import * as React from "react";
1
+ import 'core-js/modules/esnext.async-iterator.map.js';
2
+ import 'core-js/modules/esnext.iterator.map.js';
3
+
2
4
  function sinToHex(i, size, phase) {
3
5
  const sin = Math.sin(Math.PI / size * 2 * i + phase);
4
6
  const int = Math.floor(sin * 127) + 128;
5
7
  const hex = int.toString(16);
6
- return hex.length === 1 ? `0${hex}` : hex;
8
+ return hex.length === 1 ? "0".concat(hex) : hex;
7
9
  }
8
- function getRainbowColors(size = 28) {
9
- const colors = new Array(size).fill(void 0);
10
+
11
+ function getRainbowColors() {
12
+ let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 28;
13
+ const colors = new Array(size).fill(undefined);
10
14
  return colors.map((color, idx) => {
11
- const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3);
12
- const blue = sinToHex(idx, size, 1 * Math.PI * 2 / 3);
13
- const green = sinToHex(idx, size, 2 * Math.PI * 2 / 3);
14
- color = `#${red}${green}${blue}`;
15
+ const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3); // 0 deg
16
+
17
+ const blue = sinToHex(idx, size, 1 * Math.PI * 2 / 3); // 120 deg
18
+
19
+ const green = sinToHex(idx, size, 2 * Math.PI * 2 / 3); // 240 deg
20
+
21
+ color = "#".concat(red).concat(green).concat(blue);
15
22
  return color;
16
23
  });
17
24
  }
18
- export {
19
- getRainbowColors
20
- };
21
- //# sourceMappingURL=colors.js.map
25
+
26
+ export { getRainbowColors };
@@ -1,47 +1,49 @@
1
- import * as React from "react";
2
- const fields = [
3
- "Lender Name \xAD \xAB315\xBB",
4
- "Lender Address \xAD \xAB319\xBB",
5
- "Lender City \xAD \xAB313\xBB",
6
- "Lender State \xAD \xAB321\xBB",
7
- "Lender Zip \xAD \xAB323\xBB",
8
- "Borrower First Name \xAD \xAB4000\xBB",
9
- "Borrower Last Name \xAD \xAB4002\xBB",
10
- "Total Loan Amount \xAD \xAB2\xBB",
11
- "Loan Term \xAD \xAB4\xBB",
12
- "Loan to Value \xAD \xAB976\xBB",
13
- "Monthly Payment \xAD \xAB912\xBB",
14
- "Interest Rate \xAD \xAB3\xBB",
15
- "Loan Originator Name \xAD \xAB1612\xBB",
16
- "Loan Originator Email \xAD \xAB3968\xBB",
17
- "Loan Originator Phone \xAD \xAB1823\xBB",
18
- "NMLS Loan Originator ID \xAD \xAB3238\xBB"
19
- ];
20
- const getFields = (customFields = fields) => customFields.map((opt, index) => ({
21
- id: `${opt}_${index}`,
22
- label: `${opt}`,
23
- onClick: opt.indexOf("\xAB") !== -1 ? () => (void 0).onOptionClick((void 0).getFieldCode(opt)) : null,
24
- type: opt === "" ? "separator" : null
25
- }));
26
- const getFieldName = (field) => {
27
- const codeIndex = field.indexOf("\xAB");
1
+ import 'core-js/modules/esnext.async-iterator.map.js';
2
+ import 'core-js/modules/esnext.iterator.map.js';
3
+
4
+ var _this = undefined;
5
+ const fields = ['Lender Name ­ «315»', 'Lender Address ­ «319»', 'Lender City ­ «313»', 'Lender State ­ «321»', 'Lender Zip ­ «323»', 'Borrower First Name ­ «4000»', 'Borrower Last Name ­ «4002»', 'Total Loan Amount ­ «2»', 'Loan Term ­ «4»', 'Loan to Value ­ «976»', 'Monthly Payment ­ «912»', 'Interest Rate ­ «3»', 'Loan Originator Name ­ «1612»', 'Loan Originator Email ­ «3968»', 'Loan Originator Phone ­ «1823»', 'NMLS Loan Originator ID ­ «3238»'];
6
+ /**
7
+ * Returns the fields names
8
+ *
9
+ * @param customFields
10
+ */
11
+
12
+ const getFields = function () {
13
+ let customFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fields;
14
+ return customFields.map((opt, index) => ({
15
+ id: "".concat(opt, "_").concat(index),
16
+ // icon: 'ADD',
17
+ label: "".concat(opt),
18
+ onClick: opt.indexOf('«') !== -1 ? () => _this.onOptionClick(_this.getFieldCode(opt)) : null,
19
+ type: opt === '' ? 'separator' : null
20
+ }));
21
+ };
22
+ /**
23
+ * Returns a field's name
24
+ *
25
+ * @param field
26
+ */
27
+
28
+ const getFieldName = field => {
29
+ const codeIndex = field.indexOf('«');
28
30
  return field.substring(0, codeIndex);
29
31
  };
30
- const getFieldCode = (field) => {
31
- const codeIndex = field.indexOf("\xAB");
32
+ /**
33
+ * Returns a field's id. E.g: «456»
34
+ *
35
+ * @param field
36
+ */
37
+
38
+ const getFieldCode = field => {
39
+ const codeIndex = field.indexOf('«');
32
40
  return field.substring(codeIndex);
33
41
  };
34
- var customFields_default = {
42
+ var customFields = {
35
43
  fields,
36
44
  getFields,
37
45
  getFieldName,
38
46
  getFieldCode
39
47
  };
40
- export {
41
- customFields_default as default,
42
- fields,
43
- getFieldCode,
44
- getFieldName,
45
- getFields
46
- };
47
- //# sourceMappingURL=customFields.js.map
48
+
49
+ export { customFields as default, fields, getFieldCode, getFieldName, getFields };
package/esm/constants.js CHANGED
@@ -1,85 +1,32 @@
1
- import * as React from "react";
2
- import { getRainbowColors } from "./components/colors";
3
- const colors = [
4
- "#000000",
5
- "#e60000",
6
- "#ff9900",
7
- "#ffff00",
8
- "#008A00",
9
- "#0066cc",
10
- "#9933ff",
11
- "#ffffff",
12
- "#facccc",
13
- "#ffebcc",
14
- "#ffffcc",
15
- "#cce8cc",
16
- "#cce0f5",
17
- "#ebd6ff",
18
- "#bbbbbb",
19
- "#f06666",
20
- "#ffc266",
21
- "#ffff66",
22
- "#66b966",
23
- "#66a3e0",
24
- "#c285ff",
25
- "#888888",
26
- "#a10000",
27
- "#b26b00",
28
- "#b2b200",
29
- "#006100",
30
- "#0047b2",
31
- "#6b24b2",
32
- "#444444",
33
- "#5c0000",
34
- "#663d00",
35
- "#666600",
36
- "#003700",
37
- "#002966",
38
- "#3d1466",
39
- ...getRainbowColors(28)
40
- ];
41
- const fonts = [
42
- "Sans Serif",
43
- "Serif",
44
- "Monospace",
45
- "Arial",
46
- "Georgia",
47
- "Helvetica"
48
- ];
49
- const sizes = ["Small", "Normal", "Large", "Huge"];
50
- const sizesReal = [
51
- "X-Small",
52
- "Normal",
53
- "Large",
54
- "X-Large"
55
- ];
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+ import { getRainbowColors } from './components/colors.js';
3
+
4
+ const colors = ['#000000', '#e60000', '#ff9900', '#ffff00', '#008A00', '#0066cc', '#9933ff', '#ffffff', '#facccc', '#ffebcc', '#ffffcc', '#cce8cc', '#cce0f5', '#ebd6ff', '#bbbbbb', '#f06666', '#ffc266', '#ffff66', '#66b966', '#66a3e0', '#c285ff', '#888888', '#a10000', '#b26b00', '#b2b200', '#006100', '#0047b2', '#6b24b2', '#444444', '#5c0000', '#663d00', '#666600', '#003700', '#002966', '#3d1466', ...getRainbowColors(28)];
5
+ const fonts = ['Sans Serif', 'Serif', 'Monospace', 'Arial', 'Georgia', 'Helvetica'];
6
+ const sizes = ['Small', 'Normal', 'Large', 'Huge'];
7
+ const sizesReal = [// https://www.w3schools.com/cssref/pr_font_font-size.asp
8
+ 'X-Small', 'Normal', 'Large', 'X-Large'];
56
9
  const defaultItems = {
57
- HEADER: "header",
58
- FONT: "font",
59
- FONT_SIZE: "size",
60
- BOLD: "bold",
61
- ITALIC: "italic",
62
- UNDERLINE: "underline",
63
- STRIKE: "strike",
64
- SUB: "sub",
65
- SUPER: "super",
66
- ORDERED_LIST: "ordered list",
67
- BULLET_LIST: "bullet list",
68
- INDENT_MINUS_ONE: "indent -1",
69
- INDENT_PLUS_ONE: "indent +1",
70
- ALIGN: "align",
71
- FONT_COLOR: "font color",
72
- FONT_BACKGROUND_COLOR: "font background color",
73
- HYPERLINK: "hyperlink",
74
- IMAGE: "image",
75
- CLEAR_FORMAT: "clear format",
76
- SHOW_HTML: "show html"
10
+ HEADER: 'header',
11
+ FONT: 'font',
12
+ FONT_SIZE: 'size',
13
+ BOLD: 'bold',
14
+ ITALIC: 'italic',
15
+ UNDERLINE: 'underline',
16
+ STRIKE: 'strike',
17
+ SUB: 'sub',
18
+ SUPER: 'super',
19
+ ORDERED_LIST: 'ordered list',
20
+ BULLET_LIST: 'bullet list',
21
+ INDENT_MINUS_ONE: 'indent -1',
22
+ INDENT_PLUS_ONE: 'indent +1',
23
+ ALIGN: 'align',
24
+ FONT_COLOR: 'font color',
25
+ FONT_BACKGROUND_COLOR: 'font background color',
26
+ HYPERLINK: 'hyperlink',
27
+ IMAGE: 'image',
28
+ CLEAR_FORMAT: 'clear format',
29
+ SHOW_HTML: 'show html'
77
30
  };
78
- export {
79
- colors,
80
- defaultItems,
81
- fonts,
82
- sizes,
83
- sizesReal
84
- };
85
- //# sourceMappingURL=constants.js.map
31
+
32
+ export { colors, defaultItems, fonts, sizes, sizesReal };