@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,76 +1,57 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('core-js/modules/esnext.async-iterator.map.js');
6
+ require('core-js/modules/esnext.iterator.map.js');
7
+
8
+ var _this = undefined;
9
+ 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»'];
10
+ /**
11
+ * Returns the fields names
12
+ *
13
+ * @param customFields
14
+ */
15
+
16
+ const getFields = function () {
17
+ let customFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fields;
18
+ return customFields.map((opt, index) => ({
19
+ id: "".concat(opt, "_").concat(index),
20
+ // icon: 'ADD',
21
+ label: "".concat(opt),
22
+ onClick: opt.indexOf('«') !== -1 ? () => _this.onOptionClick(_this.getFieldCode(opt)) : null,
23
+ type: opt === '' ? 'separator' : null
24
+ }));
11
25
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var customFields_exports = {};
29
- __export(customFields_exports, {
30
- default: () => customFields_default,
31
- fields: () => fields,
32
- getFieldCode: () => getFieldCode,
33
- getFieldName: () => getFieldName,
34
- getFields: () => getFields
35
- });
36
- var React = __toESM(require("react"));
37
- const fields = [
38
- "Lender Name \xAD \xAB315\xBB",
39
- "Lender Address \xAD \xAB319\xBB",
40
- "Lender City \xAD \xAB313\xBB",
41
- "Lender State \xAD \xAB321\xBB",
42
- "Lender Zip \xAD \xAB323\xBB",
43
- "Borrower First Name \xAD \xAB4000\xBB",
44
- "Borrower Last Name \xAD \xAB4002\xBB",
45
- "Total Loan Amount \xAD \xAB2\xBB",
46
- "Loan Term \xAD \xAB4\xBB",
47
- "Loan to Value \xAD \xAB976\xBB",
48
- "Monthly Payment \xAD \xAB912\xBB",
49
- "Interest Rate \xAD \xAB3\xBB",
50
- "Loan Originator Name \xAD \xAB1612\xBB",
51
- "Loan Originator Email \xAD \xAB3968\xBB",
52
- "Loan Originator Phone \xAD \xAB1823\xBB",
53
- "NMLS Loan Originator ID \xAD \xAB3238\xBB"
54
- ];
55
- const getFields = (customFields = fields) => customFields.map((opt, index) => ({
56
- id: `${opt}_${index}`,
57
- label: `${opt}`,
58
- onClick: opt.indexOf("\xAB") !== -1 ? () => (void 0).onOptionClick((void 0).getFieldCode(opt)) : null,
59
- type: opt === "" ? "separator" : null
60
- }));
61
- const getFieldName = (field) => {
62
- const codeIndex = field.indexOf("\xAB");
26
+ /**
27
+ * Returns a field's name
28
+ *
29
+ * @param field
30
+ */
31
+
32
+ const getFieldName = field => {
33
+ const codeIndex = field.indexOf('«');
63
34
  return field.substring(0, codeIndex);
64
35
  };
65
- const getFieldCode = (field) => {
66
- const codeIndex = field.indexOf("\xAB");
36
+ /**
37
+ * Returns a field's id. E.g: «456»
38
+ *
39
+ * @param field
40
+ */
41
+
42
+ const getFieldCode = field => {
43
+ const codeIndex = field.indexOf('«');
67
44
  return field.substring(codeIndex);
68
45
  };
69
- var customFields_default = {
46
+ var customFields = {
70
47
  fields,
71
48
  getFields,
72
49
  getFieldName,
73
50
  getFieldCode
74
51
  };
75
- module.exports = __toCommonJS(customFields_exports);
76
- //# sourceMappingURL=customFields.js.map
52
+
53
+ exports["default"] = customFields;
54
+ exports.fields = fields;
55
+ exports.getFieldCode = getFieldCode;
56
+ exports.getFieldName = getFieldName;
57
+ exports.getFields = getFields;
package/cjs/constants.js CHANGED
@@ -1,114 +1,40 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var constants_exports = {};
29
- __export(constants_exports, {
30
- colors: () => colors,
31
- defaultItems: () => defaultItems,
32
- fonts: () => fonts,
33
- sizes: () => sizes,
34
- sizesReal: () => sizesReal
35
- });
36
- var React = __toESM(require("react"));
37
- var import_colors = __toESM(require("./components/colors"));
38
- const colors = [
39
- "#000000",
40
- "#e60000",
41
- "#ff9900",
42
- "#ffff00",
43
- "#008A00",
44
- "#0066cc",
45
- "#9933ff",
46
- "#ffffff",
47
- "#facccc",
48
- "#ffebcc",
49
- "#ffffcc",
50
- "#cce8cc",
51
- "#cce0f5",
52
- "#ebd6ff",
53
- "#bbbbbb",
54
- "#f06666",
55
- "#ffc266",
56
- "#ffff66",
57
- "#66b966",
58
- "#66a3e0",
59
- "#c285ff",
60
- "#888888",
61
- "#a10000",
62
- "#b26b00",
63
- "#b2b200",
64
- "#006100",
65
- "#0047b2",
66
- "#6b24b2",
67
- "#444444",
68
- "#5c0000",
69
- "#663d00",
70
- "#666600",
71
- "#003700",
72
- "#002966",
73
- "#3d1466",
74
- ...(0, import_colors.getRainbowColors)(28)
75
- ];
76
- const fonts = [
77
- "Sans Serif",
78
- "Serif",
79
- "Monospace",
80
- "Arial",
81
- "Georgia",
82
- "Helvetica"
83
- ];
84
- const sizes = ["Small", "Normal", "Large", "Huge"];
85
- const sizesReal = [
86
- "X-Small",
87
- "Normal",
88
- "Large",
89
- "X-Large"
90
- ];
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('core-js/modules/web.dom-collections.iterator.js');
6
+ var colors$1 = require('./components/colors.js');
7
+
8
+ 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', ...colors$1.getRainbowColors(28)];
9
+ const fonts = ['Sans Serif', 'Serif', 'Monospace', 'Arial', 'Georgia', 'Helvetica'];
10
+ const sizes = ['Small', 'Normal', 'Large', 'Huge'];
11
+ const sizesReal = [// https://www.w3schools.com/cssref/pr_font_font-size.asp
12
+ 'X-Small', 'Normal', 'Large', 'X-Large'];
91
13
  const defaultItems = {
92
- HEADER: "header",
93
- FONT: "font",
94
- FONT_SIZE: "size",
95
- BOLD: "bold",
96
- ITALIC: "italic",
97
- UNDERLINE: "underline",
98
- STRIKE: "strike",
99
- SUB: "sub",
100
- SUPER: "super",
101
- ORDERED_LIST: "ordered list",
102
- BULLET_LIST: "bullet list",
103
- INDENT_MINUS_ONE: "indent -1",
104
- INDENT_PLUS_ONE: "indent +1",
105
- ALIGN: "align",
106
- FONT_COLOR: "font color",
107
- FONT_BACKGROUND_COLOR: "font background color",
108
- HYPERLINK: "hyperlink",
109
- IMAGE: "image",
110
- CLEAR_FORMAT: "clear format",
111
- SHOW_HTML: "show html"
14
+ HEADER: 'header',
15
+ FONT: 'font',
16
+ FONT_SIZE: 'size',
17
+ BOLD: 'bold',
18
+ ITALIC: 'italic',
19
+ UNDERLINE: 'underline',
20
+ STRIKE: 'strike',
21
+ SUB: 'sub',
22
+ SUPER: 'super',
23
+ ORDERED_LIST: 'ordered list',
24
+ BULLET_LIST: 'bullet list',
25
+ INDENT_MINUS_ONE: 'indent -1',
26
+ INDENT_PLUS_ONE: 'indent +1',
27
+ ALIGN: 'align',
28
+ FONT_COLOR: 'font color',
29
+ FONT_BACKGROUND_COLOR: 'font background color',
30
+ HYPERLINK: 'hyperlink',
31
+ IMAGE: 'image',
32
+ CLEAR_FORMAT: 'clear format',
33
+ SHOW_HTML: 'show html'
112
34
  };
113
- module.exports = __toCommonJS(constants_exports);
114
- //# sourceMappingURL=constants.js.map
35
+
36
+ exports.colors = colors;
37
+ exports.defaultItems = defaultItems;
38
+ exports.fonts = fonts;
39
+ exports.sizes = sizes;
40
+ exports.sizesReal = sizesReal;
package/cjs/index.js CHANGED
@@ -1,39 +1,21 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var src_exports = {};
29
- __export(src_exports, {
30
- WYSIWYWithSchema: () => import_DSWYSIWYGEditor.WYSIWYWithSchema,
31
- default: () => import_DSWYSIWYGEditor.default
32
- });
33
- var React = __toESM(require("react"));
34
- var import_DSWYSIWYGEditor = __toESM(require("./DSWYSIWYGEditor"));
35
- __reExport(src_exports, __toESM(require("./components/CustomToolbar")));
36
- __reExport(src_exports, __toESM(require("./components/CustomImageUploader")));
37
- __reExport(src_exports, __toESM(require("./constants")));
38
- module.exports = __toCommonJS(src_exports);
39
- //# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSWYSIWYGEditor = require('./DSWYSIWYGEditor.js');
6
+ var CustomToolbar = require('./components/CustomToolbar.js');
7
+ var CustomImageUploader = require('./components/CustomImageUploader.js');
8
+ var constants = require('./constants.js');
9
+
10
+
11
+
12
+ exports.WYSIWYWithSchema = DSWYSIWYGEditor.WYSIWYWithSchema;
13
+ exports["default"] = DSWYSIWYGEditor["default"];
14
+ exports.CustomDropdown = CustomToolbar.CustomDropdown;
15
+ exports.CustomToolbar = CustomToolbar.CustomToolbar;
16
+ exports.CustomImageUploader = CustomImageUploader.CustomImageUploader;
17
+ exports.colors = constants.colors;
18
+ exports.defaultItems = constants.defaultItems;
19
+ exports.fonts = constants.fonts;
20
+ exports.sizes = constants.sizes;
21
+ exports.sizesReal = constants.sizesReal;
@@ -1,48 +1,33 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var clipboardLinkWithTagMatcher_exports = {};
29
- __export(clipboardLinkWithTagMatcher_exports, {
30
- clipboardLinkWithTagMatcher: () => clipboardLinkWithTagMatcher
31
- });
32
- var React = __toESM(require("react"));
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('core-js/modules/web.dom-collections.iterator.js');
6
+ require('core-js/modules/esnext.async-iterator.find.js');
7
+ require('core-js/modules/esnext.iterator.constructor.js');
8
+ require('core-js/modules/esnext.iterator.find.js');
9
+ require('core-js/modules/es.string.replace.js');
10
+
33
11
  const hrefTagRegexp = /%7B%7B.+%7D%7D/gm;
34
12
  const clipboardLinkWithTagMatcher = (node, delta) => {
35
13
  if (node.origin === window.location.origin) {
36
14
  const nodeHref = node.href;
37
15
  const tagMatch = nodeHref.match(hrefTagRegexp);
16
+
38
17
  if (tagMatch) {
18
+ var _delta$ops;
19
+
39
20
  const [overWrittenHrefValue] = tagMatch;
40
- const insertLinkOperation = delta?.ops?.find((operation) => operation?.attributes?.link?.match?.(hrefTagRegexp));
41
- if (insertLinkOperation)
42
- insertLinkOperation.attributes.link = overWrittenHrefValue.replace(/%7B%7B/gm, "{{").replace(/%7D%7D/gm, "}}");
21
+ const insertLinkOperation = delta === null || delta === void 0 ? void 0 : (_delta$ops = delta.ops) === null || _delta$ops === void 0 ? void 0 : _delta$ops.find(operation => {
22
+ var _operation$attributes, _operation$attributes2, _operation$attributes3;
23
+
24
+ return operation === null || operation === void 0 ? void 0 : (_operation$attributes = operation.attributes) === null || _operation$attributes === void 0 ? void 0 : (_operation$attributes2 = _operation$attributes.link) === null || _operation$attributes2 === void 0 ? void 0 : (_operation$attributes3 = _operation$attributes2.match) === null || _operation$attributes3 === void 0 ? void 0 : _operation$attributes3.call(_operation$attributes2, hrefTagRegexp);
25
+ });
26
+ if (insertLinkOperation) insertLinkOperation.attributes.link = overWrittenHrefValue.replace(/%7B%7B/gm, '{{').replace(/%7D%7D/gm, '}}');
43
27
  }
44
28
  }
29
+
45
30
  return delta;
46
31
  };
47
- module.exports = __toCommonJS(clipboardLinkWithTagMatcher_exports);
48
- //# sourceMappingURL=clipboardLinkWithTagMatcher.js.map
32
+
33
+ exports.clipboardLinkWithTagMatcher = clipboardLinkWithTagMatcher;
@@ -1,51 +1,29 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var IndentStyle_exports = {};
29
- __export(IndentStyle_exports, {
30
- default: () => IndentStyle_default
31
- });
32
- var React = __toESM(require("react"));
33
- var import_react_quill = __toESM(require("react-quill"));
34
- const Parchment = import_react_quill.Quill.import("parchment");
1
+ 'use strict';
2
+
3
+ var ReactQuill = require('react-quill');
4
+
5
+ const Parchment = ReactQuill.Quill.import('parchment');
35
6
  const levels = [1, 2, 3, 4, 5];
36
7
  const multiplier = 2;
8
+
37
9
  class IndentAttributor extends Parchment.Attributor.Style {
38
10
  add(node, value) {
39
- return super.add(node, `${value * multiplier}em`);
11
+ return super.add(node, "".concat(value * multiplier, "em"));
40
12
  }
13
+
41
14
  value(node) {
42
- return parseFloat(super.value(node)) / multiplier || void 0;
15
+ return parseFloat(super.value(node)) / multiplier || undefined; // Don't return NaN
43
16
  }
17
+
44
18
  }
45
- const IndentStyle = new IndentAttributor("indent", "margin-left", {
19
+ /**
20
+ * Meant to override quill's indent format's style and add the indentation inline instead of applying a class
21
+ */
22
+
23
+
24
+ const IndentStyle = new IndentAttributor('indent', 'margin-left', {
46
25
  scope: Parchment.Scope.BLOCK,
47
- whitelist: levels.map((value) => `${value * multiplier}em`)
26
+ whitelist: levels.map(value => "".concat(value * multiplier, "em"))
48
27
  });
49
- var IndentStyle_default = IndentStyle;
50
- module.exports = __toCommonJS(IndentStyle_exports);
51
- //# sourceMappingURL=IndentStyle.js.map
28
+
29
+ module.exports = IndentStyle;
@@ -1,86 +1,68 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var LinkFormat_exports = {};
29
- __export(LinkFormat_exports, {
30
- default: () => LinkFormat_default
31
- });
32
- var React = __toESM(require("react"));
33
- var import_react_quill = __toESM(require("react-quill"));
34
- const sanitizeProtocol = (value) => {
35
- if (typeof value === "boolean")
36
- return value;
1
+ 'use strict';
2
+
3
+ require('core-js/modules/web.dom-collections.iterator.js');
4
+ var ReactQuill = require('react-quill');
5
+
6
+ const sanitizeProtocol = value => {
7
+ if (typeof value === 'boolean') return value;
37
8
  let newVal = value;
38
- if (!value.startsWith("http") && !value.startsWith("ftp") && !value.startsWith("mailto:") && !value.startsWith("{{")) {
39
- if (!value.startsWith("www")) {
40
- newVal = `https://www.${value}`;
41
- } else
42
- newVal = `https://${value}`;
9
+
10
+ if (!value.startsWith('http') && !value.startsWith('ftp') && !value.startsWith('mailto:') && !value.startsWith('{{')) {
11
+ if (!value.startsWith('www')) {
12
+ newVal = "https://www.".concat(value);
13
+ } else newVal = "https://".concat(value);
43
14
  }
15
+
44
16
  return newVal;
45
17
  };
18
+
46
19
  function getIsValidProtocol(url, protocols) {
47
- const anchor = document.createElement("a");
20
+ const anchor = document.createElement('a');
48
21
  anchor.href = url;
49
- const protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
22
+ const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));
50
23
  return protocols.indexOf(protocol) > -1;
51
24
  }
52
- const Link = import_react_quill.Quill.import("formats/link");
25
+
26
+ const Link = ReactQuill.Quill.import('formats/link');
27
+
53
28
  class LinkFormat extends Link {
54
29
  constructor() {
55
30
  super(...arguments);
56
- this.blotName = "link";
57
- this.tagName = "A";
58
- this.SANITIZED_URL = "about:blank";
59
- this.PROTOCOL_WHITELIST = ["http", "ftp", "https", "mailto", "tel"];
31
+ this.blotName = 'link';
32
+ this.tagName = 'A';
33
+ this.SANITIZED_URL = 'about:blank';
34
+ this.PROTOCOL_WHITELIST = ['http', 'ftp', 'https', 'mailto', 'tel'];
60
35
  }
36
+
61
37
  static create(value) {
62
38
  const newVal = sanitizeProtocol(value);
63
39
  const node = super.create(newVal);
64
- node.setAttribute("href", newVal);
40
+ node.setAttribute('href', newVal);
65
41
  return node;
66
42
  }
43
+
67
44
  static formats(domNode) {
68
- return domNode?.getAttribute?.("href");
45
+ var _domNode$getAttribute;
46
+
47
+ return domNode === null || domNode === void 0 ? void 0 : (_domNode$getAttribute = domNode.getAttribute) === null || _domNode$getAttribute === void 0 ? void 0 : _domNode$getAttribute.call(domNode, 'href');
69
48
  }
49
+
70
50
  static sanitize(url) {
71
51
  return getIsValidProtocol(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
72
52
  }
53
+
73
54
  format(name, value) {
74
- const newVal = sanitizeProtocol(value);
75
- if (name === "link" && value === false) {
76
- this.domNode.removeAttribute("href");
55
+ const newVal = sanitizeProtocol(value); // Remove link case
56
+
57
+ if (name === 'link' && value === false) {
58
+ this.domNode.removeAttribute('href');
77
59
  } else if (name !== this.statics.blotName || !newVal) {
78
60
  super.format(name, newVal);
79
61
  } else {
80
- this.domNode.setAttribute("href", this.constructor.sanitize(newVal));
62
+ this.domNode.setAttribute('href', this.constructor.sanitize(newVal));
81
63
  }
82
64
  }
65
+
83
66
  }
84
- var LinkFormat_default = LinkFormat;
85
- module.exports = __toCommonJS(LinkFormat_exports);
86
- //# sourceMappingURL=LinkFormat.js.map
67
+
68
+ module.exports = LinkFormat;