@elliemae/ds-wysiwygeditor 2.2.0 → 2.3.0-alpha.3
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 +83 -72
- package/cjs/DSWYSIWYGEditor.js.map +7 -0
- package/cjs/components/CustomImageUploader.js +92 -94
- package/cjs/components/CustomImageUploader.js.map +7 -0
- package/cjs/components/CustomToolbar.js +172 -193
- package/cjs/components/CustomToolbar.js.map +7 -0
- package/cjs/components/DSWYSIWYGEditorImpl.js +147 -185
- package/cjs/components/DSWYSIWYGEditorImpl.js.map +7 -0
- package/cjs/components/ImageLibraryModal.js +75 -55
- package/cjs/components/ImageLibraryModal.js.map +7 -0
- package/cjs/components/InsertFieldModal.js +109 -142
- package/cjs/components/InsertFieldModal.js.map +7 -0
- package/cjs/components/TippedButton.js +56 -54
- package/cjs/components/TippedButton.js.map +7 -0
- package/cjs/components/TippedSelect.js +50 -39
- package/cjs/components/TippedSelect.js.map +7 -0
- package/cjs/components/colors.js +41 -21
- package/cjs/components/colors.js.map +7 -0
- package/cjs/components/customFields.js +66 -47
- package/cjs/components/customFields.js.map +7 -0
- package/cjs/constants.js +112 -38
- package/cjs/constants.js.map +7 -0
- package/cjs/index.js +39 -21
- package/cjs/index.js.map +7 -0
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js +37 -22
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js.map +7 -0
- package/cjs/quillOverrides/IndentStyle.js +41 -19
- package/cjs/quillOverrides/IndentStyle.js.map +7 -0
- package/cjs/quillOverrides/LinkFormat.js +57 -39
- package/cjs/quillOverrides/LinkFormat.js.map +7 -0
- package/cjs/quillOverrides/PlainClipboard.js +41 -21
- package/cjs/quillOverrides/PlainClipboard.js.map +7 -0
- package/cjs/utils.js +41 -18
- package/cjs/utils.js.map +7 -0
- package/esm/DSWYSIWYGEditor.js +50 -58
- package/esm/DSWYSIWYGEditor.js.map +7 -0
- package/esm/components/CustomImageUploader.js +60 -81
- package/esm/components/CustomImageUploader.js.map +7 -0
- package/esm/components/CustomToolbar.js +145 -184
- package/esm/components/CustomToolbar.js.map +7 -0
- package/esm/components/DSWYSIWYGEditorImpl.js +113 -169
- package/esm/components/DSWYSIWYGEditorImpl.js.map +7 -0
- package/esm/components/ImageLibraryModal.js +46 -47
- package/esm/components/ImageLibraryModal.js.map +7 -0
- package/esm/components/InsertFieldModal.js +72 -124
- package/esm/components/InsertFieldModal.js.map +7 -0
- package/esm/components/TippedButton.js +27 -44
- package/esm/components/TippedButton.js.map +7 -0
- package/esm/components/TippedSelect.js +21 -31
- package/esm/components/TippedSelect.js.map +7 -0
- package/esm/components/colors.js +12 -17
- package/esm/components/colors.js.map +7 -0
- package/esm/components/customFields.js +38 -40
- package/esm/components/customFields.js.map +7 -0
- package/esm/constants.js +83 -30
- package/esm/constants.js.map +7 -0
- package/esm/index.js +10 -4
- package/esm/index.js.map +7 -0
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js +8 -18
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js.map +7 -0
- package/esm/quillOverrides/IndentStyle.js +12 -17
- package/esm/quillOverrides/IndentStyle.js.map +7 -0
- package/esm/quillOverrides/LinkFormat.js +28 -37
- package/esm/quillOverrides/LinkFormat.js.map +7 -0
- package/esm/quillOverrides/PlainClipboard.js +12 -19
- package/esm/quillOverrides/PlainClipboard.js.map +7 -0
- package/esm/utils.js +12 -14
- package/esm/utils.js.map +7 -0
- package/package.json +9 -9
package/cjs/components/colors.js
CHANGED
|
@@ -1,30 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 colors_exports = {};
|
|
29
|
+
__export(colors_exports, {
|
|
30
|
+
getRainbowColors: () => getRainbowColors
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
8
33
|
function sinToHex(i, size, phase) {
|
|
9
34
|
const sin = Math.sin(Math.PI / size * 2 * i + phase);
|
|
10
35
|
const int = Math.floor(sin * 127) + 128;
|
|
11
36
|
const hex = int.toString(16);
|
|
12
|
-
return hex.length === 1 ?
|
|
37
|
+
return hex.length === 1 ? `0${hex}` : hex;
|
|
13
38
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 28;
|
|
17
|
-
const colors = new Array(size).fill(undefined);
|
|
39
|
+
function getRainbowColors(size = 28) {
|
|
40
|
+
const colors = new Array(size).fill(void 0);
|
|
18
41
|
return colors.map((color, idx) => {
|
|
19
|
-
const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3);
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const green = sinToHex(idx, size, 2 * Math.PI * 2 / 3); // 240 deg
|
|
24
|
-
|
|
25
|
-
color = "#".concat(red).concat(green).concat(blue);
|
|
42
|
+
const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3);
|
|
43
|
+
const blue = sinToHex(idx, size, 1 * Math.PI * 2 / 3);
|
|
44
|
+
const green = sinToHex(idx, size, 2 * Math.PI * 2 / 3);
|
|
45
|
+
color = `#${red}${green}${blue}`;
|
|
26
46
|
return color;
|
|
27
47
|
});
|
|
28
48
|
}
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
module.exports = __toCommonJS(colors_exports);
|
|
50
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/colors.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["function sinToHex(i, size, phase) {\n const sin = Math.sin((Math.PI / size) * 2 * i + phase);\n const int = Math.floor(sin * 127) + 128;\n const hex = int.toString(16);\n\n return hex.length === 1 ? `0${hex}` : hex;\n}\nexport function getRainbowColors(size = 28) {\n const colors = new Array(size).fill(undefined);\n return colors.map((color, idx) => {\n const red = sinToHex(idx, size, (0 * Math.PI * 2) / 3); // 0 deg\n const blue = sinToHex(idx, size, (1 * Math.PI * 2) / 3); // 120 deg\n const green = sinToHex(idx, size, (2 * Math.PI * 2) / 3); // 240 deg\n\n color = `#${red}${green}${blue}`;\n return color;\n });\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kBAAkB,GAAG,MAAM,OAAO;AAChC,QAAM,MAAM,KAAK,IAAK,KAAK,KAAK,OAAQ,IAAI,IAAI;AAChD,QAAM,MAAM,KAAK,MAAM,MAAM,OAAO;AACpC,QAAM,MAAM,IAAI,SAAS;AAEzB,SAAO,IAAI,WAAW,IAAI,IAAI,QAAQ;AAAA;AAEjC,0BAA0B,OAAO,IAAI;AAC1C,QAAM,SAAS,IAAI,MAAM,MAAM,KAAK;AACpC,SAAO,OAAO,IAAI,CAAC,OAAO,QAAQ;AAChC,UAAM,MAAM,SAAS,KAAK,MAAO,IAAI,KAAK,KAAK,IAAK;AACpD,UAAM,OAAO,SAAS,KAAK,MAAO,IAAI,KAAK,KAAK,IAAK;AACrD,UAAM,QAAQ,SAAS,KAAK,MAAO,IAAI,KAAK,KAAK,IAAK;AAEtD,YAAQ,IAAI,MAAM,QAAQ;AAC1B,WAAO;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,57 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
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
|
-
}));
|
|
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 });
|
|
25
11
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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");
|
|
34
63
|
return field.substring(0, codeIndex);
|
|
35
64
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
* @param field
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
const getFieldCode = field => {
|
|
43
|
-
const codeIndex = field.indexOf('«');
|
|
65
|
+
const getFieldCode = (field) => {
|
|
66
|
+
const codeIndex = field.indexOf("\xAB");
|
|
44
67
|
return field.substring(codeIndex);
|
|
45
68
|
};
|
|
46
|
-
var
|
|
69
|
+
var customFields_default = {
|
|
47
70
|
fields,
|
|
48
71
|
getFields,
|
|
49
72
|
getFieldName,
|
|
50
73
|
getFieldCode
|
|
51
74
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
exports.fields = fields;
|
|
55
|
-
exports.getFieldCode = getFieldCode;
|
|
56
|
-
exports.getFieldName = getFieldName;
|
|
57
|
-
exports.getFields = getFields;
|
|
75
|
+
module.exports = __toCommonJS(customFields_exports);
|
|
76
|
+
//# sourceMappingURL=customFields.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/customFields.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const fields = [\n 'Lender Name \u00AD \u00AB315\u00BB',\n 'Lender Address \u00AD \u00AB319\u00BB',\n 'Lender City \u00AD \u00AB313\u00BB',\n 'Lender State \u00AD \u00AB321\u00BB',\n 'Lender Zip \u00AD \u00AB323\u00BB',\n 'Borrower First Name \u00AD \u00AB4000\u00BB',\n 'Borrower Last Name \u00AD \u00AB4002\u00BB',\n 'Total Loan Amount \u00AD \u00AB2\u00BB',\n 'Loan Term \u00AD \u00AB4\u00BB',\n 'Loan to Value \u00AD \u00AB976\u00BB',\n 'Monthly Payment \u00AD \u00AB912\u00BB',\n 'Interest Rate \u00AD \u00AB3\u00BB',\n 'Loan Originator Name \u00AD \u00AB1612\u00BB',\n 'Loan Originator Email \u00AD \u00AB3968\u00BB',\n 'Loan Originator Phone \u00AD \u00AB1823\u00BB',\n 'NMLS Loan Originator ID \u00AD \u00AB3238\u00BB',\n];\n/**\n * Returns the fields names\n *\n * @param customFields\n */\nexport const getFields = (customFields = fields) =>\n customFields.map((opt, index) => ({\n id: `${opt}_${index}`,\n // icon: 'ADD',\n label: `${opt}`,\n onClick: opt.indexOf('\u00AB') !== -1 ? () => this.onOptionClick(this.getFieldCode(opt)) : null,\n type: opt === '' ? 'separator' : null,\n }));\n/**\n * Returns a field's name\n *\n * @param field\n */\nexport const getFieldName = (field) => {\n const codeIndex = field.indexOf('\u00AB');\n return field.substring(0, codeIndex);\n};\n/**\n * Returns a field's id. E.g: \u00AB456\u00BB\n *\n * @param field\n */\nexport const getFieldCode = (field) => {\n const codeIndex = field.indexOf('\u00AB');\n return field.substring(codeIndex);\n};\n\nexport default {\n fields,\n getFields,\n getFieldName,\n getFieldCode,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,SAAS;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAOK,MAAM,YAAY,CAAC,eAAe,WACvC,aAAa,IAAI,CAAC,KAAK,UAAW;AAAA,EAChC,IAAI,GAAG,OAAO;AAAA,EAEd,OAAO,GAAG;AAAA,EACV,SAAS,IAAI,QAAQ,YAAS,KAAK,MAAM,SAAK,cAAc,SAAK,aAAa,QAAQ;AAAA,EACtF,MAAM,QAAQ,KAAK,cAAc;AAAA;AAO9B,MAAM,eAAe,CAAC,UAAU;AACrC,QAAM,YAAY,MAAM,QAAQ;AAChC,SAAO,MAAM,UAAU,GAAG;AAAA;AAOrB,MAAM,eAAe,CAAC,UAAU;AACrC,QAAM,YAAY,MAAM,QAAQ;AAChC,SAAO,MAAM,UAAU;AAAA;AAGzB,IAAO,uBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/constants.js
CHANGED
|
@@ -1,40 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 = 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
|
+
];
|
|
13
91
|
const defaultItems = {
|
|
14
|
-
HEADER:
|
|
15
|
-
FONT:
|
|
16
|
-
FONT_SIZE:
|
|
17
|
-
BOLD:
|
|
18
|
-
ITALIC:
|
|
19
|
-
UNDERLINE:
|
|
20
|
-
STRIKE:
|
|
21
|
-
SUB:
|
|
22
|
-
SUPER:
|
|
23
|
-
ORDERED_LIST:
|
|
24
|
-
BULLET_LIST:
|
|
25
|
-
INDENT_MINUS_ONE:
|
|
26
|
-
INDENT_PLUS_ONE:
|
|
27
|
-
ALIGN:
|
|
28
|
-
FONT_COLOR:
|
|
29
|
-
FONT_BACKGROUND_COLOR:
|
|
30
|
-
HYPERLINK:
|
|
31
|
-
IMAGE:
|
|
32
|
-
CLEAR_FORMAT:
|
|
33
|
-
SHOW_HTML:
|
|
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"
|
|
34
112
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.defaultItems = defaultItems;
|
|
38
|
-
exports.fonts = fonts;
|
|
39
|
-
exports.sizes = sizes;
|
|
40
|
-
exports.sizesReal = sizesReal;
|
|
113
|
+
module.exports = __toCommonJS(constants_exports);
|
|
114
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable prettier/prettier */\nimport { getRainbowColors } from './components/colors';\n\nexport const colors = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008A00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n ...getRainbowColors(28),\n];\nexport const fonts = [\n 'Sans Serif',\n 'Serif',\n 'Monospace',\n 'Arial',\n 'Georgia',\n 'Helvetica',\n];\nexport const sizes = ['Small', 'Normal', 'Large', 'Huge'];\nexport const sizesReal = [\n // https://www.w3schools.com/cssref/pr_font_font-size.asp\n 'X-Small',\n 'Normal',\n 'Large',\n 'X-Large',\n];\n\nexport const defaultItems = {\n HEADER: 'header',\n FONT: 'font',\n FONT_SIZE: 'size',\n BOLD: 'bold',\n ITALIC: 'italic',\n UNDERLINE: 'underline',\n STRIKE: 'strike',\n SUB: 'sub',\n SUPER: 'super',\n ORDERED_LIST: 'ordered list',\n BULLET_LIST: 'bullet list',\n INDENT_MINUS_ONE: 'indent -1',\n INDENT_PLUS_ONE: 'indent +1',\n ALIGN: 'align',\n FONT_COLOR: 'font color',\n FONT_BACKGROUND_COLOR: 'font background color',\n HYPERLINK: 'hyperlink',\n IMAGE: 'image',\n CLEAR_FORMAT: 'clear format',\n SHOW_HTML: 'show html',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAAiC;AAE1B,MAAM,SAAS;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG,oCAAiB;AAAA;AAEf,MAAM,QAAQ;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAEK,MAAM,QAAQ,CAAC,SAAS,UAAU,SAAS;AAC3C,MAAM,YAAY;AAAA,EAEvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAGK,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,cAAc;AAAA,EACd,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,uBAAuB;AAAA,EACvB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,cAAc;AAAA,EACd,WAAW;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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, require("./components/CustomToolbar"));
|
|
36
|
+
__reExport(src_exports, require("./components/CustomImageUploader"));
|
|
37
|
+
__reExport(src_exports, require("./constants"));
|
|
38
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { default, WYSIWYWithSchema } from './DSWYSIWYGEditor';\nexport * from './components/CustomToolbar';\nexport * from './components/CustomImageUploader';\nexport * from './constants';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,6BAA0C;AAC1C,wBAAc;AACd,wBAAc;AACd,wBAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,33 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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"));
|
|
11
33
|
const hrefTagRegexp = /%7B%7B.+%7D%7D/gm;
|
|
12
34
|
const clipboardLinkWithTagMatcher = (node, delta) => {
|
|
13
35
|
if (node.origin === window.location.origin) {
|
|
14
36
|
const nodeHref = node.href;
|
|
15
37
|
const tagMatch = nodeHref.match(hrefTagRegexp);
|
|
16
|
-
|
|
17
38
|
if (tagMatch) {
|
|
18
|
-
var _delta$ops;
|
|
19
|
-
|
|
20
39
|
const [overWrittenHrefValue] = tagMatch;
|
|
21
|
-
const insertLinkOperation = delta
|
|
22
|
-
|
|
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, '}}');
|
|
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, "}}");
|
|
27
43
|
}
|
|
28
44
|
}
|
|
29
|
-
|
|
30
45
|
return delta;
|
|
31
46
|
};
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
module.exports = __toCommonJS(clipboardLinkWithTagMatcher_exports);
|
|
48
|
+
//# sourceMappingURL=clipboardLinkWithTagMatcher.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/quillMatchers/clipboardLinkWithTagMatcher.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import Delta from 'quill-delta';\n\nconst hrefTagRegexp = /%7B%7B.+%7D%7D/gm;\nexport const clipboardLinkWithTagMatcher = (node: HTMLAnchorElement, delta: Delta): Delta => {\n if (node.origin === window.location.origin) {\n const nodeHref = node.href;\n const tagMatch = nodeHref.match(hrefTagRegexp);\n if (tagMatch) {\n const [overWrittenHrefValue] = tagMatch;\n const insertLinkOperation = delta?.ops?.find((operation) => operation?.attributes?.link?.match?.(hrefTagRegexp));\n if (insertLinkOperation)\n insertLinkOperation.attributes.link = overWrittenHrefValue.replace(/%7B%7B/gm, '{{').replace(/%7D%7D/gm, '}}');\n }\n }\n return delta;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,MAAM,gBAAgB;AACf,MAAM,8BAA8B,CAAC,MAAyB,UAAwB;AAC3F,MAAI,KAAK,WAAW,OAAO,SAAS,QAAQ;AAC1C,UAAM,WAAW,KAAK;AACtB,UAAM,WAAW,SAAS,MAAM;AAChC,QAAI,UAAU;AACZ,YAAM,CAAC,wBAAwB;AAC/B,YAAM,sBAAsB,OAAO,KAAK,KAAK,CAAC,cAAc,WAAW,YAAY,MAAM,QAAQ;AACjG,UAAI;AACF,4BAAoB,WAAW,OAAO,qBAAqB,QAAQ,YAAY,MAAM,QAAQ,YAAY;AAAA;AAAA;AAG/G,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
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 = require("react-quill");
|
|
34
|
+
const Parchment = import_react_quill.Quill.import("parchment");
|
|
6
35
|
const levels = [1, 2, 3, 4, 5];
|
|
7
36
|
const multiplier = 2;
|
|
8
|
-
|
|
9
37
|
class IndentAttributor extends Parchment.Attributor.Style {
|
|
10
38
|
add(node, value) {
|
|
11
|
-
return super.add(node,
|
|
39
|
+
return super.add(node, `${value * multiplier}em`);
|
|
12
40
|
}
|
|
13
|
-
|
|
14
41
|
value(node) {
|
|
15
|
-
return parseFloat(super.value(node)) / multiplier ||
|
|
42
|
+
return parseFloat(super.value(node)) / multiplier || void 0;
|
|
16
43
|
}
|
|
17
|
-
|
|
18
44
|
}
|
|
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', {
|
|
45
|
+
const IndentStyle = new IndentAttributor("indent", "margin-left", {
|
|
25
46
|
scope: Parchment.Scope.BLOCK,
|
|
26
|
-
whitelist: levels.map(value =>
|
|
47
|
+
whitelist: levels.map((value) => `${value * multiplier}em`)
|
|
27
48
|
});
|
|
28
|
-
|
|
29
|
-
module.exports =
|
|
49
|
+
var IndentStyle_default = IndentStyle;
|
|
50
|
+
module.exports = __toCommonJS(IndentStyle_exports);
|
|
51
|
+
//# sourceMappingURL=IndentStyle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/quillOverrides/IndentStyle.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { Quill } from 'react-quill';\n\nconst Parchment = Quill.import('parchment');\nconst levels = [1, 2, 3, 4, 5];\nconst multiplier = 2;\n\nclass IndentAttributor extends Parchment.Attributor.Style {\n add(node, value) {\n return super.add(node, `${value * multiplier}em`);\n }\n\n value(node) {\n return parseFloat(super.value(node)) / multiplier || undefined; // Don't return NaN\n }\n}\n\n/**\n * Meant to override quill's indent format's style and add the indentation inline instead of applying a class\n */\nconst IndentStyle = new IndentAttributor('indent', 'margin-left', {\n scope: Parchment.Scope.BLOCK,\n whitelist: levels.map(value => `${value * multiplier}em`),\n});\n\nexport default IndentStyle;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsB;AAEtB,MAAM,YAAY,yBAAM,OAAO;AAC/B,MAAM,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG;AAC5B,MAAM,aAAa;AAEnB,+BAA+B,UAAU,WAAW,MAAM;AAAA,EACxD,IAAI,MAAM,OAAO;AACf,WAAO,MAAM,IAAI,MAAM,GAAG,QAAQ;AAAA;AAAA,EAGpC,MAAM,MAAM;AACV,WAAO,WAAW,MAAM,MAAM,SAAS,cAAc;AAAA;AAAA;AAOzD,MAAM,cAAc,IAAI,iBAAiB,UAAU,eAAe;AAAA,EAChE,OAAO,UAAU,MAAM;AAAA,EACvB,WAAW,OAAO,IAAI,WAAS,GAAG,QAAQ;AAAA;AAG5C,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|