@elliemae/ds-wysiwygeditor 3.14.14 → 3.14.15
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/dist/cjs/DSWYSIWYGEditor.js +0 -1
- package/dist/cjs/DSWYSIWYGEditor.js.map +2 -2
- package/dist/cjs/components/CustomToolbar.js +22 -1
- package/dist/cjs/components/CustomToolbar.js.map +2 -2
- package/dist/cjs/components/DSWYSIWYGEditorImpl.js +30 -72
- package/dist/cjs/components/DSWYSIWYGEditorImpl.js.map +3 -3
- package/dist/cjs/config/quillSingletonConfigurations.js +80 -0
- package/dist/cjs/config/quillSingletonConfigurations.js.map +7 -0
- package/dist/esm/DSWYSIWYGEditor.js +0 -1
- package/dist/esm/DSWYSIWYGEditor.js.map +2 -2
- package/dist/esm/components/CustomToolbar.js +22 -1
- package/dist/esm/components/CustomToolbar.js.map +2 -2
- package/dist/esm/components/DSWYSIWYGEditorImpl.js +30 -72
- package/dist/esm/components/DSWYSIWYGEditorImpl.js.map +2 -2
- package/dist/esm/config/quillSingletonConfigurations.js +54 -0
- package/dist/esm/config/quillSingletonConfigurations.js.map +7 -0
- package/dist/types/components/DSWYSIWYGEditorImpl.d.ts +2 -1
- package/dist/types/config/quillSingletonConfigurations.d.ts +2 -0
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSWYSIWYGEditor.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSWYSIWYGEditorImpl from './components/DSWYSIWYGEditorImpl';\n\nconst DSWYSIWYGEditor = ({\n value = '',\n onChange = () => null,\n getQuillRef = () => null,\n quillModules = {},\n customToolbar,\n toolbarHandlers,\n showRawHTML = false,\n height,\n hideItems,\n ...rest\n}) => {\n const emptyAction = () => {};\n const [showHTML, setShowHTML] = useState(showRawHTML);\n\n useEffect(() => setShowHTML(showRawHTML), [showRawHTML]);\n\n return (\n <DSWYSIWYGEditorImpl\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsBnB;AAtBJ,mBAA2C;AAC3C,0BAAoC;AACpC,iCAAgC;AAEhC,MAAM,kBAAkB,CAAC;AAAA,EACvB,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,cAAc,MAAM;AAAA,EACpB,eAAe,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,KACG;AACL,MAAM;AACJ,QAAM,cAAc,MAAM;AAAA,EAAC;AAC3B,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,WAAW;AAEpD,8BAAU,MAAM,YAAY,WAAW,GAAG,CAAC,WAAW,CAAC;AAEvD,SACE;AAAA,IAAC,2BAAAA;AAAA,IAAA;AAAA,MACC,
|
|
4
|
+
"sourcesContent": ["import React, { useState, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSWYSIWYGEditorImpl from './components/DSWYSIWYGEditorImpl';\n\nconst DSWYSIWYGEditor = ({\n value = '',\n onChange = () => null,\n getQuillRef = () => null,\n quillModules = {},\n customToolbar,\n toolbarHandlers,\n showRawHTML = false,\n height,\n hideItems,\n ...rest\n}) => {\n const emptyAction = () => {};\n const [showHTML, setShowHTML] = useState(showRawHTML);\n\n useEffect(() => setShowHTML(showRawHTML), [showRawHTML]);\n\n return (\n <DSWYSIWYGEditorImpl\n handleCustomFieldClick={emptyAction}\n handleImageClick={emptyAction}\n quillOverrides={[]}\n value={value}\n onChange={onChange}\n getQuillRef={getQuillRef}\n quillModules={quillModules}\n customToolbar={customToolbar}\n toolbarHandlers={toolbarHandlers}\n showRawHTML={showHTML}\n onShowHTML={() => setShowHTML(!showHTML)}\n height={height}\n hideItems={hideItems}\n {...rest}\n />\n );\n};\n\nconst wysiwygEditorProps = {\n value: PropTypes.string.description('editors value').isRequired,\n onChange: PropTypes.func.description(\n `(content, delta, source, editor) : Called back with the new contents of the editor after change. \n It will be passed the HTML contents of the editor, a delta object expressing the change, the source of the change, and finally a read-only proxy to editor accessors such as getHTML(). \n \u26A0\uFE0F Do not use this delta object as value, as it will cause a loop. \n Use editor.getContents() instead. See Using Deltas for details. \n Read more: https://github.com/zenoamaro/react-quill#props`,\n ).isRequired,\n getQuillRef: PropTypes.func.description('function to use quill.js ref'),\n quillModules: PropTypes.object.description('object to override quill modules'),\n customToolbar: PropTypes.element.description('custom toolbar'),\n toolbarHandlers: PropTypes.object.description('object with toolbar handlers'),\n showRawHTML: PropTypes.bool.description('whether to display html view or not').defaultValue(false),\n height: PropTypes.string.description('heigth of the editors text area'),\n readOnly: PropTypes.string.description(\n \"If true, the editor won't allow changing its contents. Wraps the Quill disable API.\",\n ),\n hideItems: PropTypes.object.description('object of defaultItems to be removed from toolbar').defaultValue({}),\n zIndex: PropTypes.number.description(\n 'zIndex to be used (required when used in a modal for correct tooltips displaying)',\n ),\n};\n\nDSWYSIWYGEditor.propTypes = wysiwygEditorProps;\nDSWYSIWYGEditor.displayName = 'DSWYSIWYGEditor';\nconst WYSIWYWithSchema = describe(DSWYSIWYGEditor);\nWYSIWYWithSchema.propTypes = wysiwygEditorProps;\n\nexport { WYSIWYWithSchema, DSWYSIWYGEditor };\nexport default DSWYSIWYGEditor;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsBnB;AAtBJ,mBAA2C;AAC3C,0BAAoC;AACpC,iCAAgC;AAEhC,MAAM,kBAAkB,CAAC;AAAA,EACvB,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,cAAc,MAAM;AAAA,E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AAM,uBAAmB,8BAAS,eAAe;AACjD,iBAAiB,YAAY;AAG7B,IAAO,0BAAQ;",
|
|
6
6
|
"names": ["DSWYSIWYGEditorImpl"]
|
|
7
7
|
}
|
|
@@ -180,7 +180,28 @@ const CustomToolbar = ({
|
|
|
180
180
|
!INDENT_PLUS_ONE && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TippedButton.TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-indent", tip: "Indent +1", value: "+1" })
|
|
181
181
|
] }),
|
|
182
182
|
!ALIGN && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ql-formats", children: [
|
|
183
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ql-formats", children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TippedButton.TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-align", tip: "Left", value: "" }),
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
186
|
+
import_TippedButton.TippedButton,
|
|
187
|
+
{
|
|
188
|
+
zIndex: userProps?.zIndex || 1,
|
|
189
|
+
className: "ql-align",
|
|
190
|
+
tip: "Center",
|
|
191
|
+
value: "center"
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TippedButton.TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-align", tip: "Right", value: "right" }),
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
196
|
+
import_TippedButton.TippedButton,
|
|
197
|
+
{
|
|
198
|
+
zIndex: userProps?.zIndex || 1,
|
|
199
|
+
className: "ql-align",
|
|
200
|
+
tip: "Justify",
|
|
201
|
+
value: "justify"
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
] }),
|
|
184
205
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Divider, {})
|
|
185
206
|
] }),
|
|
186
207
|
(!FONT_COLOR || !FONT_BACKGROUND_COLOR) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ql-formats", children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/CustomToolbar.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/control-has-associated-label */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react/button-has-type */\nimport React, { useState } from 'react';\nimport DSButton from '@elliemae/ds-button';\nimport { ArrowheadDown } from '@elliemae/ds-icons';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { colors, fonts, sizes, sizesReal } from '../constants';\nimport { TippedButton } from './TippedButton';\nimport { TippedSelect } from './TippedSelect';\n\n// Functions -----------------------------------------\nconst optionsToValues = (options) => options.map((opt) => opt.toLowerCase().replace(' ', '-'));\n\n// Stateless Components -----------------------------------------\n\nconst CustomFields = () => <span>\u1438\u1433</span>; // eslint-disable-line react/jsx-one-expression-per-line\nconst Color = ({ color }) => <option value={color} />;\nconst Colors = ({ className, tip, zIndex }) => (\n <TippedSelect className={className} tip={tip} zIndex={zIndex}>\n {colors.map((color) => (\n <Color key={color} color={color} />\n ))}\n </TippedSelect>\n);\n\nexport const CustomDropdown = ({\n options,\n label,\n onSelectMenuItem = () => null,\n onClickOutsideMenu = () => null,\n onClose = () => null,\n closeMenuOnItemSelection,\n isOpen,\n minWidth,\n maxWidth,\n zIndex = 10,\n}) => (\n <DSDropdownMenu\n onClickOutsideMenu={onClickOutsideMenu}\n options={options}\n onSelectMenuItem={onSelectMenuItem}\n onClose={onClose}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n isOpen={isOpen}\n minWidth={minWidth}\n maxWidth={maxWidth}\n zIndex={zIndex}\n preventOverflow=\"scrollParent\"\n triggerComponent={<DSButton labelText={label} buttonType=\"text\" icon={<ArrowheadDown />} />}\n />\n);\n\nconst Divider = () => (\n <div\n style={{\n height: '21px',\n width: '1px',\n margin: '0 10px',\n padding: '0',\n borderLeft: '1px solid #bbb',\n display: 'inline-block',\n }}\n ></div>\n);\n\nexport const CustomToolbar = ({\n customFields,\n customItems = [],\n hideItems = {},\n onShowHTML = () => {},\n id = 'toolbar',\n userProps,\n}) => {\n const {\n HEADER,\n FONT,\n FONT_SIZE,\n BOLD,\n ITALIC,\n UNDERLINE,\n STRIKE,\n SUB,\n SUPER,\n ORDERED_LIST,\n BULLET_LIST,\n INDENT_MINUS_ONE,\n INDENT_PLUS_ONE,\n ALIGN,\n FONT_COLOR,\n FONT_BACKGROUND_COLOR,\n HYPERLINK,\n IMAGE,\n CLEAR_FORMAT,\n SHOW_HTML,\n } = hideItems;\n const [showHTML, setShowHTML] = useState(false);\n\n const handleShowHTML = (e) => {\n e.preventDefault();\n setShowHTML(!showHTML);\n onShowHTML();\n };\n\n return (\n <div id={id} className=\"ds-ql-custom-toolbar\">\n {(!HEADER || !FONT || !FONT_SIZE) && (\n <span className=\"ql-formats\">\n {!HEADER && (\n <>\n <TippedSelect\n className=\"ql-header\"\n tip=\"Header\"\n values={['', '1', '2', '3', '4', '5', '6']}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT && (\n <>\n <TippedSelect\n className=\"ql-font\"\n defaultValue=\"sans-serif\"\n options={fonts}\n tip=\"Font\"\n values={optionsToValues(fonts)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT_SIZE && (\n <>\n <TippedSelect\n className=\"ql-size\"\n options={sizes}\n tip=\"Font Size\"\n values={optionsToValues(sizesReal)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n </span>\n )}\n {(!BOLD || !ITALIC || !UNDERLINE || !STRIKE) && (\n <span className=\"ql-formats\">\n {!BOLD && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-bold\" tip=\"Bold\" />}\n {!ITALIC && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-italic\" tip=\"Italic\" />}\n {!UNDERLINE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-underline\" tip=\"Underline\" />}\n {!STRIKE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-strike\" tip=\"Strike\" />}\n </span>\n )}\n {(!SUB || !SUPER) && (\n <span className=\"ql-formats\">\n {!SUB && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Sub\" value=\"sub\" />}\n {!SUPER && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Super\" value=\"super\" />}\n <Divider />\n </span>\n )}\n {(!ORDERED_LIST || !BULLET_LIST) && (\n <span className=\"ql-formats\">\n {!ORDERED_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Ordered List\" value=\"ordered\" />\n )}\n {!BULLET_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Bullet List\" value=\"bullet\" />\n )}\n </span>\n )}\n {(!INDENT_MINUS_ONE || !INDENT_PLUS_ONE) && (\n <span className=\"ql-formats\">\n {!INDENT_MINUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent -1\" value=\"-1\" />\n )}\n {!INDENT_PLUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent +1\" value=\"+1\" />\n )}\n </span>\n )}\n {!ALIGN && (\n <span className=\"ql-formats\">\n <TippedSelect zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Align\"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBI;AA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CAAC,oCAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,aAAY,KAAI,aAAY,OAAM,MAAK;AAAA,OAEnG;AAAA,IAED,CAAC,SACA,6CAAC,UAAK,WAAU,cACd;AAAA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/control-has-associated-label */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react/button-has-type */\nimport React, { useState } from 'react';\nimport DSButton from '@elliemae/ds-button';\nimport { ArrowheadDown } from '@elliemae/ds-icons';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { colors, fonts, sizes, sizesReal } from '../constants';\nimport { TippedButton } from './TippedButton';\nimport { TippedSelect } from './TippedSelect';\n\n// Functions -----------------------------------------\nconst optionsToValues = (options) => options.map((opt) => opt.toLowerCase().replace(' ', '-'));\n\n// Stateless Components -----------------------------------------\n\nconst CustomFields = () => <span>\u1438\u1433</span>; // eslint-disable-line react/jsx-one-expression-per-line\nconst Color = ({ color }) => <option value={color} />;\nconst Colors = ({ className, tip, zIndex }) => (\n <TippedSelect className={className} tip={tip} zIndex={zIndex}>\n {colors.map((color) => (\n <Color key={color} color={color} />\n ))}\n </TippedSelect>\n);\n\nexport const CustomDropdown = ({\n options,\n label,\n onSelectMenuItem = () => null,\n onClickOutsideMenu = () => null,\n onClose = () => null,\n closeMenuOnItemSelection,\n isOpen,\n minWidth,\n maxWidth,\n zIndex = 10,\n}) => (\n <DSDropdownMenu\n onClickOutsideMenu={onClickOutsideMenu}\n options={options}\n onSelectMenuItem={onSelectMenuItem}\n onClose={onClose}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n isOpen={isOpen}\n minWidth={minWidth}\n maxWidth={maxWidth}\n zIndex={zIndex}\n preventOverflow=\"scrollParent\"\n triggerComponent={<DSButton labelText={label} buttonType=\"text\" icon={<ArrowheadDown />} />}\n />\n);\n\nconst Divider = () => (\n <div\n style={{\n height: '21px',\n width: '1px',\n margin: '0 10px',\n padding: '0',\n borderLeft: '1px solid #bbb',\n display: 'inline-block',\n }}\n ></div>\n);\n\nexport const CustomToolbar = ({\n customFields,\n customItems = [],\n hideItems = {},\n onShowHTML = () => {},\n id = 'toolbar',\n userProps,\n}) => {\n const {\n HEADER,\n FONT,\n FONT_SIZE,\n BOLD,\n ITALIC,\n UNDERLINE,\n STRIKE,\n SUB,\n SUPER,\n ORDERED_LIST,\n BULLET_LIST,\n INDENT_MINUS_ONE,\n INDENT_PLUS_ONE,\n ALIGN,\n FONT_COLOR,\n FONT_BACKGROUND_COLOR,\n HYPERLINK,\n IMAGE,\n CLEAR_FORMAT,\n SHOW_HTML,\n } = hideItems;\n const [showHTML, setShowHTML] = useState(false);\n\n const handleShowHTML = (e) => {\n e.preventDefault();\n setShowHTML(!showHTML);\n onShowHTML();\n };\n\n return (\n <div id={id} className=\"ds-ql-custom-toolbar\">\n {(!HEADER || !FONT || !FONT_SIZE) && (\n <span className=\"ql-formats\">\n {!HEADER && (\n <>\n <TippedSelect\n className=\"ql-header\"\n tip=\"Header\"\n values={['', '1', '2', '3', '4', '5', '6']}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT && (\n <>\n <TippedSelect\n className=\"ql-font\"\n defaultValue=\"sans-serif\"\n options={fonts}\n tip=\"Font\"\n values={optionsToValues(fonts)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT_SIZE && (\n <>\n <TippedSelect\n className=\"ql-size\"\n options={sizes}\n tip=\"Font Size\"\n values={optionsToValues(sizesReal)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n </span>\n )}\n {(!BOLD || !ITALIC || !UNDERLINE || !STRIKE) && (\n <span className=\"ql-formats\">\n {!BOLD && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-bold\" tip=\"Bold\" />}\n {!ITALIC && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-italic\" tip=\"Italic\" />}\n {!UNDERLINE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-underline\" tip=\"Underline\" />}\n {!STRIKE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-strike\" tip=\"Strike\" />}\n </span>\n )}\n {(!SUB || !SUPER) && (\n <span className=\"ql-formats\">\n {!SUB && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Sub\" value=\"sub\" />}\n {!SUPER && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Super\" value=\"super\" />}\n <Divider />\n </span>\n )}\n {(!ORDERED_LIST || !BULLET_LIST) && (\n <span className=\"ql-formats\">\n {!ORDERED_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Ordered List\" value=\"ordered\" />\n )}\n {!BULLET_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Bullet List\" value=\"bullet\" />\n )}\n </span>\n )}\n {(!INDENT_MINUS_ONE || !INDENT_PLUS_ONE) && (\n <span className=\"ql-formats\">\n {!INDENT_MINUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent -1\" value=\"-1\" />\n )}\n {!INDENT_PLUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent +1\" value=\"+1\" />\n )}\n </span>\n )}\n {!ALIGN && (\n <span className=\"ql-formats\">\n {/* <TippedSelect zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Align\"/> */}\n {/* \n quill js has a bug where using ql-align with the html tag \"select\" leave us with a can not read property innerhtml of undefined\n we can't update quill js because it's a peer dependency of react-quill\n this is a workaround to keep provide the ql-align module but not use the html tag \"select\"\n */}\n <span className=\"ql-formats\">\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Left\" value=\"\"></TippedButton>\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n className=\"ql-align\"\n tip=\"Center\"\n value=\"center\"\n ></TippedButton>\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Right\" value=\"right\"></TippedButton>\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n className=\"ql-align\"\n tip=\"Justify\"\n value=\"justify\"\n ></TippedButton>\n </span>\n <Divider />\n </span>\n )}\n {(!FONT_COLOR || !FONT_BACKGROUND_COLOR) && (\n <span className=\"ql-formats\">\n {!FONT_COLOR && <Colors zIndex={userProps?.zIndex || 1} className=\"ql-color\" tip=\"Font Color\" />}\n {!FONT_BACKGROUND_COLOR && (\n <Colors zIndex={userProps?.zIndex || 1} className=\"ql-background\" tip=\"Font Background Color\" />\n )}\n <Divider />\n </span>\n )}\n {(!HYPERLINK || !IMAGE) && (\n <span className=\"ql-formats\">\n {!HYPERLINK && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-link\" tip=\"Hyperlink: Select Text First\" />\n )}\n {!IMAGE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-image\" tip=\"Insert Image\" />}\n <Divider />\n </span>\n )}\n {!CLEAR_FORMAT && (\n <span className=\"ql-formats\">\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-clean\" tip=\"Clear Format (Select Text)\" />\n </span>\n )}\n {!SHOW_HTML && (\n <span className=\"ql-formats\">\n <Divider />\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n style={{\n width: 'fit-content',\n color: '#1e79c2',\n fontWeight: '500',\n }}\n onClick={handleShowHTML}\n tip={showHTML ? 'SHOW TEXT' : 'SHOW HTML'}\n className=\"ql-customFields-html\"\n >\n {showHTML ? 'SHOW TEXT' : 'SHOW HTML'}\n </TippedButton>\n </span>\n )}\n {customFields && (\n <span className=\"ql-formats\">\n <Divider />\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-customFields\" tip=\"Insert Custom Field\">\n <CustomFields />\n </TippedButton>\n </span>\n )}\n {customItems && (\n <span style={{ display: 'inline-flex' }}>\n {customItems.map((Item) => (\n <>\n <Divider />\n <Item />\n </>\n ))}\n </span>\n )}\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBI;AAb3B,mBAAgC;AAChC,uBAAqB;AACrB,sBAA8B;AAC9B,6BAA2B;AAC3B,uBAAgD;AAChD,0BAA6B;AAC7B,0BAA6B;AAG7B,MAAM,kBAAkB,CAAC,YAAY,QAAQ,IAAI,CAAC,QAAQ,IAAI,YAAY,EAAE,QAAQ,KAAK,GAAG,CAAC;AAI7F,MAAM,eAAe,MAAM,4CAAC,UAAK,0BAAE;AACnC,MAAM,QAAQ,CAAC,EAAE,MAAM,MAAM,4CAAC,YAAO,OAAO,OAAO;AACnD,MAAM,SAAS,CAAC,EAAE,WAAW,KAAK,OAAO,MACvC,4CAAC,oCAAa,WAAsB,KAAU,QAC3C,kCAAO,IAAI,CAAC,UACX,4CAAC,SAAkB,SAAP,KAAqB,CAClC,GACH;AAGK,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,mBAAmB,MAAM;AAAA,EACzB,qBAAqB,MAAM;AAAA,EAC3B,UAAU,MAAM;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,MACE;AAAA,EAAC,uBAAAA;AAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAgB;AAAA,IAChB,kBAAkB,4CAAC,iBAAAC,SAAA,EAAS,WAAW,OAAO,YAAW,QAAO,MAAM,4CAAC,iCAAc,GAAI;AAAA;AAC3F;AAGF,MAAM,UAAU,MACd;AAAA,EAAC;AAAA;AAAA,IACC,OAAO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,aACA,4CAAC,oCAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,WAAU,KAAI,gCAA+B;AAAA,MAEtG,CAAC,SAAS,4CAAC,oCAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,YAAW,KAAI,gBAAe;AAAA,MACjG,4CAAC,WAAQ;AAAA,OACX;AAAA,IAED,CAAC,gBACA,4CAAC,UAAK,WAAU,cACd,sDAAC,oCAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,YAAW,KAAI,8BAA6B,GACtG;AAAA,IAED,CAAC,aACA,6CAAC,UAAK,WAAU,cACd;AAAA,kDAAC,WAAQ;AAAA,MACT;AAAA,QAAC;AAAA;AAAA,UACC,QAAQ,WAAW,UAAU;AAAA,UAC7B,OAAO;AAAA,YACL,OAAO;AAAA,YACP,OAAO;AAAA,YACP,YAAY;AAAA,UACd;AAAA,UACA,SAAS;AAAA,UACT,KAAK,WAAW,cAAc;AAAA,UAC9B,WAAU;AAAA,UAET,qBAAW,cAAc;AAAA;AAAA,MAC5B;AAAA,OACF;AAAA,IAED,gBACC,6CAAC,UAAK,WAAU,cACd;AAAA,kDAAC,WAAQ;AAAA,MACT,4CAAC,oCAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,mBAAkB,KAAI,uBAC5E,sDAAC,gBAAa,GAChB;AAAA,OACF;AAAA,IAED,eACC,4CAAC,UAAK,OAAO,EAAE,SAAS,cAAc,GACnC,sBAAY,IAAI,CAAC,SAChB,4EACE;AAAA,kDAAC,WAAQ;AAAA,MACT,4CAAC,QAAK;AAAA,OACR,CACD,GACH;AAAA,KAEJ;AAEJ;",
|
|
6
6
|
"names": ["DSDropdownMenu", "DSButton"]
|
|
7
7
|
}
|
|
@@ -31,59 +31,16 @@ var React = __toESM(require("react"));
|
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
32
|
var import_react = __toESM(require("react"));
|
|
33
33
|
var import_react_quill = __toESM(require("react-quill"));
|
|
34
|
-
var import_quill_blot_formatter = __toESM(require("quill-blot-formatter"));
|
|
35
34
|
var import_uid = require("uid");
|
|
36
35
|
var import_ImageLibraryModal = __toESM(require("./ImageLibraryModal"));
|
|
37
36
|
var import_InsertFieldModal = __toESM(require("./InsertFieldModal"));
|
|
38
37
|
var import_CustomToolbar = require("./CustomToolbar");
|
|
39
|
-
var import_IndentStyle = __toESM(require("../quillOverrides/IndentStyle"));
|
|
40
|
-
var import_LinkFormat = __toESM(require("../quillOverrides/LinkFormat"));
|
|
41
|
-
var import_Image = __toESM(require("../quillOverrides/Image"));
|
|
42
38
|
var import_utils = require("../utils");
|
|
43
39
|
var import_clipboardLinkWithTagMatcher = require("../quillMatchers/clipboardLinkWithTagMatcher");
|
|
44
|
-
|
|
45
|
-
const AlignStyle = import_react_quill.Quill.import("attributors/style/align");
|
|
46
|
-
const FontStyle = import_react_quill.Quill.import("attributors/style/font");
|
|
47
|
-
FontStyle.whitelist = [
|
|
48
|
-
"serif",
|
|
49
|
-
"monospace",
|
|
50
|
-
"arial",
|
|
51
|
-
"comic-sans",
|
|
52
|
-
"courier-new",
|
|
53
|
-
"georgia",
|
|
54
|
-
"helvetica",
|
|
55
|
-
"lucida"
|
|
56
|
-
];
|
|
57
|
-
const SizeStyle = import_react_quill.Quill.import("attributors/style/size");
|
|
58
|
-
SizeStyle.whitelist = [
|
|
59
|
-
"x-small",
|
|
60
|
-
"large",
|
|
61
|
-
"x-large"
|
|
62
|
-
];
|
|
63
|
-
const Block = import_react_quill.Quill.import("blots/block");
|
|
64
|
-
Block.tagName = "p";
|
|
65
|
-
import_react_quill.Quill.register(Block);
|
|
66
|
-
import_react_quill.Quill.register(AlignStyle, true);
|
|
67
|
-
import_react_quill.Quill.register(import_IndentStyle.default, true);
|
|
68
|
-
import_react_quill.Quill.register(FontStyle, true);
|
|
69
|
-
import_react_quill.Quill.register(SizeStyle, true);
|
|
70
|
-
import_react_quill.Quill.register(import_Image.default, true);
|
|
40
|
+
var import_quillSingletonConfigurations = __toESM(require("../config/quillSingletonConfigurations"));
|
|
71
41
|
class DSWYSIWYGEditorImpl extends import_react.default.PureComponent {
|
|
72
42
|
constructor(props) {
|
|
73
43
|
super(props);
|
|
74
|
-
this.quillModules = {
|
|
75
|
-
toolbar: {
|
|
76
|
-
container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : "#toolbar",
|
|
77
|
-
handlers: {
|
|
78
|
-
...this.props.toolbarHandlers
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
clipboard: {
|
|
82
|
-
matchVisual: false
|
|
83
|
-
},
|
|
84
|
-
blotFormatter: {},
|
|
85
|
-
...this.props.quillModules
|
|
86
|
-
};
|
|
87
44
|
this.getEditor = () => this.quill?.getEditor();
|
|
88
45
|
this.onChangeQuill = (html, delta, source, editor) => {
|
|
89
46
|
const { showRawHTML, onChange } = this.props;
|
|
@@ -115,20 +72,39 @@ class DSWYSIWYGEditorImpl extends import_react.default.PureComponent {
|
|
|
115
72
|
this.setState({ isImageModalOpen: false });
|
|
116
73
|
};
|
|
117
74
|
this.quillRef = (ref) => {
|
|
75
|
+
const editor = ref?.getEditor();
|
|
76
|
+
if (this.getEditor() !== editor) {
|
|
77
|
+
editor?.clipboard.addMatcher("a", import_clipboardLinkWithTagMatcher.clipboardLinkWithTagMatcher);
|
|
78
|
+
}
|
|
79
|
+
this.props.getQuillRef(ref);
|
|
118
80
|
this.quill = ref;
|
|
119
81
|
};
|
|
120
|
-
|
|
82
|
+
this.quill = void 0;
|
|
83
|
+
const instanceUid = (0, import_uid.uid)(12);
|
|
84
|
+
const uniqueClassName = `ds-wysiwyg-editor-${instanceUid}`;
|
|
85
|
+
const quillModules = {
|
|
86
|
+
toolbar: {
|
|
87
|
+
container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : `#toolbar-${uniqueClassName}`,
|
|
88
|
+
handlers: {
|
|
89
|
+
...this.props.toolbarHandlers
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
clipboard: {
|
|
93
|
+
matchVisual: false
|
|
94
|
+
},
|
|
95
|
+
...this.props.quillModules
|
|
96
|
+
};
|
|
121
97
|
if (props.quillOverrides.length) {
|
|
122
|
-
props.quillOverrides.map((override) =>
|
|
98
|
+
props.quillOverrides.map((override) => import_quillSingletonConfigurations.default.register(override, true));
|
|
123
99
|
}
|
|
124
|
-
const instanceUid = (0, import_uid.uid)(12);
|
|
125
100
|
this.state = {
|
|
126
101
|
isImageModalOpen: false,
|
|
127
102
|
isFieldModalOpen: false,
|
|
128
103
|
uid: instanceUid,
|
|
129
|
-
uniqueClassName
|
|
104
|
+
uniqueClassName,
|
|
105
|
+
quillModules
|
|
130
106
|
};
|
|
131
|
-
const { toolbar } =
|
|
107
|
+
const { toolbar } = quillModules;
|
|
132
108
|
if (props.imagesData) {
|
|
133
109
|
toolbar.handlers.image = (value) => {
|
|
134
110
|
const { imagesData, handleImageClick } = this.props;
|
|
@@ -151,12 +127,6 @@ class DSWYSIWYGEditorImpl extends import_react.default.PureComponent {
|
|
|
151
127
|
}
|
|
152
128
|
}
|
|
153
129
|
componentDidMount() {
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
const quillDomRef = this.quill;
|
|
156
|
-
this.props.getQuillRef(quillDomRef);
|
|
157
|
-
const editor = quillDomRef?.getEditor();
|
|
158
|
-
editor?.clipboard.addMatcher("a", import_clipboardLinkWithTagMatcher.clipboardLinkWithTagMatcher);
|
|
159
|
-
});
|
|
160
130
|
}
|
|
161
131
|
render() {
|
|
162
132
|
const { isFieldModalOpen, isImageModalOpen } = this.state;
|
|
@@ -170,29 +140,17 @@ class DSWYSIWYGEditorImpl extends import_react.default.PureComponent {
|
|
|
170
140
|
showRawHTML,
|
|
171
141
|
onShowHTML,
|
|
172
142
|
hideItems,
|
|
173
|
-
bounds,
|
|
174
143
|
onChange,
|
|
175
144
|
handleImageClick,
|
|
176
145
|
handleCustomFieldClick,
|
|
177
146
|
...editorProps
|
|
178
147
|
} = this.props;
|
|
179
|
-
let finalBoundElement = document.body;
|
|
180
|
-
if (typeof bounds !== "undefined" && bounds?.classList && bounds?.classList instanceof DOMTokenList) {
|
|
181
|
-
finalBoundElement = bounds;
|
|
182
|
-
}
|
|
183
|
-
const elementsWithClass = document.querySelectorAll(`.${this.state.uniqueClassName}`);
|
|
184
|
-
elementsWithClass.forEach((element) => {
|
|
185
|
-
element.classList.remove(this.state.uniqueClassName);
|
|
186
|
-
});
|
|
187
|
-
if (!finalBoundElement.classList.contains(this.state.uniqueClassName)) {
|
|
188
|
-
finalBoundElement.classList.add(this.state.uniqueClassName);
|
|
189
|
-
}
|
|
190
|
-
const boundsWorkaround = `.${this.state.uniqueClassName}`;
|
|
191
148
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
192
149
|
"div",
|
|
193
150
|
{
|
|
194
151
|
...containerProps,
|
|
195
152
|
className: `quill-wysiwyg-editor ${showRawHTML ? "show-raw" : ""}`,
|
|
153
|
+
"data-uid": this.state.uid,
|
|
196
154
|
children: [
|
|
197
155
|
customToolbar || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
198
156
|
import_CustomToolbar.CustomToolbar,
|
|
@@ -200,23 +158,23 @@ class DSWYSIWYGEditorImpl extends import_react.default.PureComponent {
|
|
|
200
158
|
customFields,
|
|
201
159
|
onShowHTML,
|
|
202
160
|
hideItems,
|
|
203
|
-
userProps: this.props
|
|
161
|
+
userProps: this.props,
|
|
162
|
+
id: `toolbar-${this.state.uniqueClassName}`
|
|
204
163
|
}
|
|
205
164
|
),
|
|
206
165
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
207
166
|
import_react_quill.default,
|
|
208
167
|
{
|
|
209
168
|
ref: this.quillRef,
|
|
210
|
-
modules: this.quillModules,
|
|
169
|
+
modules: this.state.quillModules,
|
|
211
170
|
onChange: this.onChangeQuill,
|
|
212
171
|
value,
|
|
213
172
|
style: {
|
|
214
173
|
height,
|
|
215
174
|
borderBottom: "1px solid #ccc"
|
|
216
175
|
},
|
|
217
|
-
bounds: boundsWorkaround,
|
|
218
176
|
...editorProps,
|
|
219
|
-
id:
|
|
177
|
+
id: `wysiwyg-text-container-${this.state.uid}`
|
|
220
178
|
}
|
|
221
179
|
),
|
|
222
180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DSWYSIWYGEditorImpl.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport ReactQuill
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport ReactQuill from 'react-quill';\nimport { uid } from 'uid';\n\nimport ImageLibraryModal from './ImageLibraryModal';\nimport InsertFieldModal from './InsertFieldModal';\nimport { CustomToolbar } from './CustomToolbar';\nimport { formatHTML } from '../utils';\nimport { clipboardLinkWithTagMatcher } from '../quillMatchers/clipboardLinkWithTagMatcher';\nimport Quill from '../config/quillSingletonConfigurations';\n\nexport default class DSWYSIWYGEditorImpl extends React.PureComponent {\n quill: undefined | typeof ReactQuill;\n\n constructor(props) {\n super(props);\n this.quill = undefined; // this will hold the quill instance reference\n const instanceUid = uid(12);\n const uniqueClassName = `ds-wysiwyg-editor-${instanceUid}`;\n const quillModules = {\n toolbar: {\n container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : `#toolbar-${uniqueClassName}`,\n handlers: {\n ...this.props.toolbarHandlers,\n },\n },\n clipboard: {\n // toggle to add extra line breaks when pasting HTML:\n matchVisual: false,\n },\n ...this.props.quillModules,\n };\n if (props.quillOverrides.length) {\n props.quillOverrides.map((override) => Quill.register(override, true));\n }\n this.state = {\n isImageModalOpen: false,\n isFieldModalOpen: false,\n uid: instanceUid,\n uniqueClassName,\n quillModules,\n };\n const { toolbar } = quillModules;\n if (props.imagesData) {\n toolbar.handlers.image = (value) => {\n const { imagesData, handleImageClick } = this.props;\n if (!imagesData.length) {\n return;\n }\n this.setState({ isImageModalOpen: !!value });\n handleImageClick(value);\n };\n }\n if (props.customFields) {\n toolbar.handlers.customFields = (value) => {\n const { customFields, handleCustomFieldClick } = this.props;\n if (!customFields.length) {\n return;\n }\n this.setState({ isFieldModalOpen: !!value });\n handleCustomFieldClick(value);\n };\n }\n }\n\n componentDidMount() {}\n\n getEditor = () => this.quill?.getEditor();\n\n // eslint-disable-next-line max-params\n onChangeQuill = (html, delta, source, editor) => {\n // console.log('quill detected a change');\n const { showRawHTML, onChange } = this.props;\n if (!showRawHTML) onChange(html, delta, source, editor);\n };\n\n onChangeTextArea = (e) => {\n const { showRawHTML, onChange } = this.props;\n if (showRawHTML) onChange(e.target.value);\n };\n\n onInserFieldConfirm = (fieldCode) => {\n const editor = this.getEditor();\n const range = editor.getSelection(true);\n editor.insertText(range.index, fieldCode);\n };\n\n onImageConfirm = (image) => {\n if (!image) {\n return;\n }\n const editor = this.getEditor();\n const range = editor.getSelection(true);\n editor.insertEmbed(range.index, 'image', image.url);\n };\n\n onFieldModalClose = () => {\n this.setState({ isFieldModalOpen: false });\n };\n\n onImageModalClose = () => {\n this.setState({ isImageModalOpen: false });\n };\n\n quillRef = (ref) => {\n const editor = ref?.getEditor();\n if (this.getEditor() !== editor) {\n // the underlying quill instance has changed\n // this may happens because it's the first render or for other reasons\n // but any instance configuration must happen again in this case\n\n // we add a clipboard matcher\n // https://github.com/quilljs/quill/issues/2677\n editor?.clipboard.addMatcher('a', clipboardLinkWithTagMatcher);\n }\n this.props.getQuillRef(ref);\n this.quill = ref;\n };\n\n render() {\n const { isFieldModalOpen, isImageModalOpen } = this.state;\n const {\n containerProps = {},\n customFields,\n imagesData,\n customToolbar,\n height,\n value,\n showRawHTML,\n onShowHTML,\n hideItems,\n // bounds,\n // a bunch of props we don't want to pass to the editor\n onChange,\n handleImageClick,\n handleCustomFieldClick,\n ...editorProps\n } = this.props;\n\n return (\n <div\n // data-testid=\"wysiwyg-text-container\"\n {...containerProps}\n className={`quill-wysiwyg-editor ${showRawHTML ? 'show-raw' : ''}`}\n data-uid={this.state.uid}\n >\n {customToolbar || (\n <CustomToolbar\n customFields={customFields}\n onShowHTML={onShowHTML}\n hideItems={hideItems}\n userProps={this.props}\n id={`toolbar-${this.state.uniqueClassName}`}\n />\n )}\n <ReactQuill\n ref={this.quillRef}\n modules={this.state.quillModules}\n onChange={this.onChangeQuill}\n value={value}\n style={{\n height,\n borderBottom: '1px solid #ccc',\n }}\n {...editorProps}\n id={`wysiwyg-text-container-${this.state.uid}`}\n />\n <textarea\n className=\"raw-editor ql-container ql-snow ql-editor\"\n style={{\n width: '100%',\n resize: 'none',\n height,\n minHeight: '200px',\n }}\n onChange={this.onChangeTextArea}\n value={formatHTML(value)}\n />\n {imagesData && imagesData.length && (\n <ImageLibraryModal\n imagesData={imagesData}\n isOpen={isImageModalOpen}\n onClose={this.onImageModalClose}\n onConfirm={this.onImageConfirm}\n />\n )}\n {customFields && customFields.length && (\n <InsertFieldModal\n customFields={customFields}\n isOpen={isFieldModalOpen}\n onClose={this.onFieldModalClose}\n onConfirm={this.onInserFieldConfirm}\n />\n )}\n </div>\n );\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoJjB;AA5IN,mBAAkB;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A,UAClB;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["React", "Quill", "ReactQuill", "ImageLibraryModal", "InsertFieldModal"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var quillSingletonConfigurations_exports = {};
|
|
26
|
+
__export(quillSingletonConfigurations_exports, {
|
|
27
|
+
default: () => quillSingletonConfigurations_default
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(quillSingletonConfigurations_exports);
|
|
30
|
+
var React = __toESM(require("react"));
|
|
31
|
+
var import_react_quill = require("react-quill");
|
|
32
|
+
var import_quill_blot_formatter = __toESM(require("quill-blot-formatter"));
|
|
33
|
+
var import_IndentStyle = __toESM(require("../quillOverrides/IndentStyle"));
|
|
34
|
+
var import_Image = __toESM(require("../quillOverrides/Image"));
|
|
35
|
+
var import_LinkFormat = __toESM(require("../quillOverrides/LinkFormat"));
|
|
36
|
+
if (!import_react_quill.Quill._dsDidRegisterBlotFormatter) {
|
|
37
|
+
import_react_quill.Quill.register("modules/blotFormatter", import_quill_blot_formatter.default);
|
|
38
|
+
import_react_quill.Quill._dsDidRegisterBlotFormatter = true;
|
|
39
|
+
}
|
|
40
|
+
if (!import_react_quill.Quill._dsDidConfigureTextWhitelist) {
|
|
41
|
+
const AlignStyle = import_react_quill.Quill.import("attributors/style/align");
|
|
42
|
+
const FontStyle = import_react_quill.Quill.import("attributors/style/font");
|
|
43
|
+
FontStyle.whitelist = [
|
|
44
|
+
"serif",
|
|
45
|
+
"monospace",
|
|
46
|
+
"arial",
|
|
47
|
+
"comic-sans",
|
|
48
|
+
"courier-new",
|
|
49
|
+
"georgia",
|
|
50
|
+
"helvetica",
|
|
51
|
+
"lucida"
|
|
52
|
+
];
|
|
53
|
+
const SizeStyle = import_react_quill.Quill.import("attributors/style/size");
|
|
54
|
+
SizeStyle.whitelist = [
|
|
55
|
+
"x-small",
|
|
56
|
+
"large",
|
|
57
|
+
"x-large"
|
|
58
|
+
];
|
|
59
|
+
import_react_quill.Quill.register(AlignStyle, true);
|
|
60
|
+
import_react_quill.Quill.register(import_IndentStyle.default, true);
|
|
61
|
+
import_react_quill.Quill.register(FontStyle, true);
|
|
62
|
+
import_react_quill.Quill.register(SizeStyle, true);
|
|
63
|
+
import_react_quill.Quill._dsDidConfigureTextWhitelist = true;
|
|
64
|
+
}
|
|
65
|
+
if (!import_react_quill.Quill._dsDidConfigureBlock) {
|
|
66
|
+
const Block = import_react_quill.Quill.import("blots/block");
|
|
67
|
+
Block.tagName = "p";
|
|
68
|
+
import_react_quill.Quill.register(Block);
|
|
69
|
+
import_react_quill.Quill._dsDidConfigureBlock = true;
|
|
70
|
+
}
|
|
71
|
+
if (!import_react_quill.Quill._dsDidConfigureImage) {
|
|
72
|
+
import_react_quill.Quill.register(import_Image.default, true);
|
|
73
|
+
import_react_quill.Quill._dsDidConfigureImage = true;
|
|
74
|
+
}
|
|
75
|
+
if (!import_react_quill.Quill._dsDidConfigureLink) {
|
|
76
|
+
import_react_quill.Quill.register(import_LinkFormat.default, true);
|
|
77
|
+
import_react_quill.Quill._dsDidConfigureLink = true;
|
|
78
|
+
}
|
|
79
|
+
var quillSingletonConfigurations_default = import_react_quill.Quill;
|
|
80
|
+
//# sourceMappingURL=quillSingletonConfigurations.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/quillSingletonConfigurations.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { Quill } from 'react-quill';\nimport BlotFormatter from 'quill-blot-formatter';\nimport IndentStyle from '../quillOverrides/IndentStyle';\nimport Image from '../quillOverrides/Image';\nimport LinkFormat from '../quillOverrides/LinkFormat';\n\n// hystorically we have always been modifying the Quill object directly\n// in node this means we have modified the global Quill object which is a singleton\n// it's not a good practice and we should not do it but to ensure our changes are transparent\n// we keep up the bad practice untill a new version of our editor is released\n// we will atleast reduce the amount of times we modify the Quill object by only doing it once\n// this is \"new\" bad practice but it's better than modifying the global Quill object constantly\n// we achieve this by adding a flag to the Quill object to indicate that we have already modified it\nif (!Quill._dsDidRegisterBlotFormatter) {\n Quill.register('modules/blotFormatter', BlotFormatter);\n Quill._dsDidRegisterBlotFormatter = true;\n}\nif (!Quill._dsDidConfigureTextWhitelist) {\n // Fix block styled formats ----------------\n const AlignStyle = Quill.import('attributors/style/align');\n const FontStyle = Quill.import('attributors/style/font');\n FontStyle.whitelist = [\n // allow ONLY these fonts and the default\n 'serif',\n 'monospace',\n 'arial',\n 'comic-sans',\n 'courier-new',\n 'georgia',\n 'helvetica',\n 'lucida',\n ];\n const SizeStyle = Quill.import('attributors/style/size');\n SizeStyle.whitelist = [\n // allow ONLY these sizes and the default\n 'x-small',\n 'large',\n 'x-large',\n ];\n Quill.register(AlignStyle, true);\n Quill.register(IndentStyle, true);\n Quill.register(FontStyle, true);\n Quill.register(SizeStyle, true);\n Quill._dsDidConfigureTextWhitelist = true;\n}\nif (!Quill._dsDidConfigureBlock) {\n // Fix Doc Viewer p tags extra margin issue ---------\n const Block = Quill.import('blots/block');\n Block.tagName = 'p';\n Quill.register(Block);\n Quill._dsDidConfigureBlock = true;\n // -----------------------------------------\n}\nif (!Quill._dsDidConfigureImage) {\n Quill.register(Image, true);\n Quill._dsDidConfigureImage = true;\n}\n\nif (!Quill._dsDidConfigureLink) {\n Quill.register(LinkFormat, true);\n Quill._dsDidConfigureLink = true;\n}\n\nexport default Quill;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsB;AACtB,kCAA0B;AAC1B,yBAAwB;AACxB,mBAAkB;AAClB,wBAAuB;AASvB,IAAI,CAAC,yBAAM,6BAA6B;AACtC,2BAAM,SAAS,yBAAyB,4BAAAA,OAAa;AACrD,2BAAM,8BAA8B;AACtC;AACA,IAAI,CAAC,yBAAM,8BAA8B;AAEvC,QAAM,aAAa,yBAAM,OAAO,yBAAyB;AACzD,QAAM,YAAY,yBAAM,OAAO,wBAAwB;AACvD,YAAU,YAAY;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,YAAY,yBAAM,OAAO,wBAAwB;AACvD,YAAU,YAAY;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,2BAAM,SAAS,YAAY,IAAI;AAC/B,2BAAM,SAAS,mBAAAC,SAAa,IAAI;AAChC,2BAAM,SAAS,WAAW,IAAI;AAC9B,2BAAM,SAAS,WAAW,IAAI;AAC9B,2BAAM,+BAA+B;AACvC;AACA,IAAI,CAAC,yBAAM,sBAAsB;AAE/B,QAAM,QAAQ,yBAAM,OAAO,aAAa;AACxC,QAAM,UAAU;AAChB,2BAAM,SAAS,KAAK;AACpB,2BAAM,uBAAuB;AAE/B;AACA,IAAI,CAAC,yBAAM,sBAAsB;AAC/B,2BAAM,SAAS,aAAAC,SAAO,IAAI;AAC1B,2BAAM,uBAAuB;AAC/B;AAEA,IAAI,CAAC,yBAAM,qBAAqB;AAC9B,2BAAM,SAAS,kBAAAC,SAAY,IAAI;AAC/B,2BAAM,sBAAsB;AAC9B;AAEA,IAAO,uCAAQ;",
|
|
6
|
+
"names": ["BlotFormatter", "IndentStyle", "Image", "LinkFormat"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSWYSIWYGEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSWYSIWYGEditorImpl from './components/DSWYSIWYGEditorImpl';\n\nconst DSWYSIWYGEditor = ({\n value = '',\n onChange = () => null,\n getQuillRef = () => null,\n quillModules = {},\n customToolbar,\n toolbarHandlers,\n showRawHTML = false,\n height,\n hideItems,\n ...rest\n}) => {\n const emptyAction = () => {};\n const [showHTML, setShowHTML] = useState(showRawHTML);\n\n useEffect(() => setShowHTML(showRawHTML), [showRawHTML]);\n\n return (\n <DSWYSIWYGEditorImpl\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACsBnB;AAtBJ,SAAgB,UAAU,iBAAiB;AAC3C,SAAS,UAAU,iBAAiB;AACpC,OAAO,yBAAyB;AAEhC,MAAM,kBAAkB,CAAC;AAAA,EACvB,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,cAAc,MAAM;AAAA,EACpB,eAAe,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,KACG;AACL,MAAM;AACJ,QAAM,cAAc,MAAM;AAAA,EAAC;AAC3B,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,WAAW;AAEpD,YAAU,MAAM,YAAY,WAAW,GAAG,CAAC,WAAW,CAAC;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useEffect } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSWYSIWYGEditorImpl from './components/DSWYSIWYGEditorImpl';\n\nconst DSWYSIWYGEditor = ({\n value = '',\n onChange = () => null,\n getQuillRef = () => null,\n quillModules = {},\n customToolbar,\n toolbarHandlers,\n showRawHTML = false,\n height,\n hideItems,\n ...rest\n}) => {\n const emptyAction = () => {};\n const [showHTML, setShowHTML] = useState(showRawHTML);\n\n useEffect(() => setShowHTML(showRawHTML), [showRawHTML]);\n\n return (\n <DSWYSIWYGEditorImpl\n handleCustomFieldClick={emptyAction}\n handleImageClick={emptyAction}\n quillOverrides={[]}\n value={value}\n onChange={onChange}\n getQuillRef={getQuillRef}\n quillModules={quillModules}\n customToolbar={customToolbar}\n toolbarHandlers={toolbarHandlers}\n showRawHTML={showHTML}\n onShowHTML={() => setShowHTML(!showHTML)}\n height={height}\n hideItems={hideItems}\n {...rest}\n />\n );\n};\n\nconst wysiwygEditorProps = {\n value: PropTypes.string.description('editors value').isRequired,\n onChange: PropTypes.func.description(\n `(content, delta, source, editor) : Called back with the new contents of the editor after change. \n It will be passed the HTML contents of the editor, a delta object expressing the change, the source of the change, and finally a read-only proxy to editor accessors such as getHTML(). \n \u26A0\uFE0F Do not use this delta object as value, as it will cause a loop. \n Use editor.getContents() instead. See Using Deltas for details. \n Read more: https://github.com/zenoamaro/react-quill#props`,\n ).isRequired,\n getQuillRef: PropTypes.func.description('function to use quill.js ref'),\n quillModules: PropTypes.object.description('object to override quill modules'),\n customToolbar: PropTypes.element.description('custom toolbar'),\n toolbarHandlers: PropTypes.object.description('object with toolbar handlers'),\n showRawHTML: PropTypes.bool.description('whether to display html view or not').defaultValue(false),\n height: PropTypes.string.description('heigth of the editors text area'),\n readOnly: PropTypes.string.description(\n \"If true, the editor won't allow changing its contents. Wraps the Quill disable API.\",\n ),\n hideItems: PropTypes.object.description('object of defaultItems to be removed from toolbar').defaultValue({}),\n zIndex: PropTypes.number.description(\n 'zIndex to be used (required when used in a modal for correct tooltips displaying)',\n ),\n};\n\nDSWYSIWYGEditor.propTypes = wysiwygEditorProps;\nDSWYSIWYGEditor.displayName = 'DSWYSIWYGEditor';\nconst WYSIWYWithSchema = describe(DSWYSIWYGEditor);\nWYSIWYWithSchema.propTypes = wysiwygEditorProps;\n\nexport { WYSIWYWithSchema, DSWYSIWYGEditor };\nexport default DSWYSIWYGEditor;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsBnB;AAtBJ,SAAgB,UAAU,iBAAiB;AAC3C,SAAS,UAAU,iBAAiB;AACpC,OAAO,yBAAyB;AAEhC,MAAM,kBAAkB,CAAC;AAAA,EACvB,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,cAAc,MAAM;AAAA,EACpB,eAAe,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,KACG;AACL,MAAM;AACJ,QAAM,cAAc,MAAM;AAAA,EAAC;AAC3B,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,WAAW;AAEpD,YAAU,MAAM,YAAY,WAAW,GAAG,CAAC,WAAW,CAAC;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAwB;AAAA,MACxB,kBAAkB;AAAA,MAClB,gBAAgB,CAAC;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa;AAAA,MACb,YAAY,MAAM,YAAY,CAAC,QAAQ;AAAA,MACvC;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,qBAAqB;AAAA,EACzB,OAAO,UAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACrD,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EAAE;AAAA,EACF,aAAa,UAAU,KAAK,YAAY,8BAA8B;AAAA,EACtE,cAAc,UAAU,OAAO,YAAY,kCAAkC;AAAA,EAC7E,eAAe,UAAU,QAAQ,YAAY,gBAAgB;AAAA,EAC7D,iBAAiB,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAC5E,aAAa,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EACjG,QAAQ,UAAU,OAAO,YAAY,iCAAiC;AAAA,EACtE,UAAU,UAAU,OAAO;AAAA,IACzB;AAAA,EACF;AAAA,EACA,WAAW,UAAU,OAAO,YAAY,mDAAmD,EAAE,aAAa,CAAC,CAAC;AAAA,EAC5G,QAAQ,UAAU,OAAO;AAAA,IACvB;AAAA,EACF;AACF;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,cAAc;AAC9B,MAAM,mBAAmB,SAAS,eAAe;AACjD,iBAAiB,YAAY;AAG7B,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -150,7 +150,28 @@ const CustomToolbar = ({
|
|
|
150
150
|
!INDENT_PLUS_ONE && /* @__PURE__ */ jsx(TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-indent", tip: "Indent +1", value: "+1" })
|
|
151
151
|
] }),
|
|
152
152
|
!ALIGN && /* @__PURE__ */ jsxs("span", { className: "ql-formats", children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ jsxs("span", { className: "ql-formats", children: [
|
|
154
|
+
/* @__PURE__ */ jsx(TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-align", tip: "Left", value: "" }),
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
TippedButton,
|
|
157
|
+
{
|
|
158
|
+
zIndex: userProps?.zIndex || 1,
|
|
159
|
+
className: "ql-align",
|
|
160
|
+
tip: "Center",
|
|
161
|
+
value: "center"
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx(TippedButton, { zIndex: userProps?.zIndex || 1, className: "ql-align", tip: "Right", value: "right" }),
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
TippedButton,
|
|
167
|
+
{
|
|
168
|
+
zIndex: userProps?.zIndex || 1,
|
|
169
|
+
className: "ql-align",
|
|
170
|
+
tip: "Justify",
|
|
171
|
+
value: "justify"
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] }),
|
|
154
175
|
/* @__PURE__ */ jsx(Divider, {})
|
|
155
176
|
] }),
|
|
156
177
|
(!FONT_COLOR || !FONT_BACKGROUND_COLOR) && /* @__PURE__ */ jsxs("span", { className: "ql-formats", children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/CustomToolbar.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/control-has-associated-label */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react/button-has-type */\nimport React, { useState } from 'react';\nimport DSButton from '@elliemae/ds-button';\nimport { ArrowheadDown } from '@elliemae/ds-icons';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { colors, fonts, sizes, sizesReal } from '../constants';\nimport { TippedButton } from './TippedButton';\nimport { TippedSelect } from './TippedSelect';\n\n// Functions -----------------------------------------\nconst optionsToValues = (options) => options.map((opt) => opt.toLowerCase().replace(' ', '-'));\n\n// Stateless Components -----------------------------------------\n\nconst CustomFields = () => <span>\u1438\u1433</span>; // eslint-disable-line react/jsx-one-expression-per-line\nconst Color = ({ color }) => <option value={color} />;\nconst Colors = ({ className, tip, zIndex }) => (\n <TippedSelect className={className} tip={tip} zIndex={zIndex}>\n {colors.map((color) => (\n <Color key={color} color={color} />\n ))}\n </TippedSelect>\n);\n\nexport const CustomDropdown = ({\n options,\n label,\n onSelectMenuItem = () => null,\n onClickOutsideMenu = () => null,\n onClose = () => null,\n closeMenuOnItemSelection,\n isOpen,\n minWidth,\n maxWidth,\n zIndex = 10,\n}) => (\n <DSDropdownMenu\n onClickOutsideMenu={onClickOutsideMenu}\n options={options}\n onSelectMenuItem={onSelectMenuItem}\n onClose={onClose}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n isOpen={isOpen}\n minWidth={minWidth}\n maxWidth={maxWidth}\n zIndex={zIndex}\n preventOverflow=\"scrollParent\"\n triggerComponent={<DSButton labelText={label} buttonType=\"text\" icon={<ArrowheadDown />} />}\n />\n);\n\nconst Divider = () => (\n <div\n style={{\n height: '21px',\n width: '1px',\n margin: '0 10px',\n padding: '0',\n borderLeft: '1px solid #bbb',\n display: 'inline-block',\n }}\n ></div>\n);\n\nexport const CustomToolbar = ({\n customFields,\n customItems = [],\n hideItems = {},\n onShowHTML = () => {},\n id = 'toolbar',\n userProps,\n}) => {\n const {\n HEADER,\n FONT,\n FONT_SIZE,\n BOLD,\n ITALIC,\n UNDERLINE,\n STRIKE,\n SUB,\n SUPER,\n ORDERED_LIST,\n BULLET_LIST,\n INDENT_MINUS_ONE,\n INDENT_PLUS_ONE,\n ALIGN,\n FONT_COLOR,\n FONT_BACKGROUND_COLOR,\n HYPERLINK,\n IMAGE,\n CLEAR_FORMAT,\n SHOW_HTML,\n } = hideItems;\n const [showHTML, setShowHTML] = useState(false);\n\n const handleShowHTML = (e) => {\n e.preventDefault();\n setShowHTML(!showHTML);\n onShowHTML();\n };\n\n return (\n <div id={id} className=\"ds-ql-custom-toolbar\">\n {(!HEADER || !FONT || !FONT_SIZE) && (\n <span className=\"ql-formats\">\n {!HEADER && (\n <>\n <TippedSelect\n className=\"ql-header\"\n tip=\"Header\"\n values={['', '1', '2', '3', '4', '5', '6']}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT && (\n <>\n <TippedSelect\n className=\"ql-font\"\n defaultValue=\"sans-serif\"\n options={fonts}\n tip=\"Font\"\n values={optionsToValues(fonts)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT_SIZE && (\n <>\n <TippedSelect\n className=\"ql-size\"\n options={sizes}\n tip=\"Font Size\"\n values={optionsToValues(sizesReal)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n </span>\n )}\n {(!BOLD || !ITALIC || !UNDERLINE || !STRIKE) && (\n <span className=\"ql-formats\">\n {!BOLD && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-bold\" tip=\"Bold\" />}\n {!ITALIC && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-italic\" tip=\"Italic\" />}\n {!UNDERLINE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-underline\" tip=\"Underline\" />}\n {!STRIKE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-strike\" tip=\"Strike\" />}\n </span>\n )}\n {(!SUB || !SUPER) && (\n <span className=\"ql-formats\">\n {!SUB && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Sub\" value=\"sub\" />}\n {!SUPER && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Super\" value=\"super\" />}\n <Divider />\n </span>\n )}\n {(!ORDERED_LIST || !BULLET_LIST) && (\n <span className=\"ql-formats\">\n {!ORDERED_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Ordered List\" value=\"ordered\" />\n )}\n {!BULLET_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Bullet List\" value=\"bullet\" />\n )}\n </span>\n )}\n {(!INDENT_MINUS_ONE || !INDENT_PLUS_ONE) && (\n <span className=\"ql-formats\">\n {!INDENT_MINUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent -1\" value=\"-1\" />\n )}\n {!INDENT_PLUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent +1\" value=\"+1\" />\n )}\n </span>\n )}\n {!ALIGN && (\n <span className=\"ql-formats\">\n <TippedSelect zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Align\"
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACmBI,SA6Ff,UA7Fe,KA6Ff,YA7Fe;AAb3B,SAAgB,gBAAgB;AAChC,OAAO,cAAc;AACrB,SAAS,qBAAqB;AAC9B,OAAO,oBAAoB;AAC3B,SAAS,QAAQ,OAAO,OAAO,iBAAiB;AAChD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAG7B,MAAM,kBAAkB,CAAC,YAAY,QAAQ,IAAI,CAAC,QAAQ,IAAI,YAAY,EAAE,QAAQ,KAAK,GAAG,CAAC;AAI7F,MAAM,eAAe,MAAM,oBAAC,UAAK,0BAAE;AACnC,MAAM,QAAQ,CAAC,EAAE,MAAM,MAAM,oBAAC,YAAO,OAAO,OAAO;AACnD,MAAM,SAAS,CAAC,EAAE,WAAW,KAAK,OAAO,MACvC,oBAAC,gBAAa,WAAsB,KAAU,QAC3C,iBAAO,IAAI,CAAC,UACX,oBAAC,SAAkB,SAAP,KAAqB,CAClC,GACH;AAGK,MAAM,iBAAiB,CAAC;AAAA,E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ACb;AAAA,OAAC,OAAO,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,aAAY,KAAI,OAAM,OAAM,OAAM;AAAA,MAClG,CAAC,SAAS,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,aAAY,KAAI,SAAQ,OAAM,SAAQ;AAAA,MACzG,oBAAC,WAAQ;AAAA,OACX;AAAA,KAEA,CAAC,gBAAgB,CAAC,gBAClB,qBAAC,UAAK,WAAU,cACb;AAAA,OAAC,gBACA,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,WAAU,KAAI,gBAAe,OAAM,WAAU;AAAA,MAEtG,CAAC,eACA,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,WAAU,KAAI,eAAc,OAAM,UAAS;AAAA,OAEvG;AAAA,KAEA,CAAC,oBAAoB,CAAC,oBACtB,qBAAC,UAAK,WAAU,cACb;AAAA,OAAC,oBACA,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,aAAY,KAAI,aAAY,OAAM,MAAK;AAAA,MAEhG,CAAC,mBACA,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,aAAY,KAAI,aAAY,OAAM,MAAK;AAAA,OAEnG;AAAA,IAED,CAAC,SACA,qBAAC,UAAK,WAAU,cACd;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable complexity */\n/* eslint-disable jsx-a11y/control-has-associated-label */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react/button-has-type */\nimport React, { useState } from 'react';\nimport DSButton from '@elliemae/ds-button';\nimport { ArrowheadDown } from '@elliemae/ds-icons';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { colors, fonts, sizes, sizesReal } from '../constants';\nimport { TippedButton } from './TippedButton';\nimport { TippedSelect } from './TippedSelect';\n\n// Functions -----------------------------------------\nconst optionsToValues = (options) => options.map((opt) => opt.toLowerCase().replace(' ', '-'));\n\n// Stateless Components -----------------------------------------\n\nconst CustomFields = () => <span>\u1438\u1433</span>; // eslint-disable-line react/jsx-one-expression-per-line\nconst Color = ({ color }) => <option value={color} />;\nconst Colors = ({ className, tip, zIndex }) => (\n <TippedSelect className={className} tip={tip} zIndex={zIndex}>\n {colors.map((color) => (\n <Color key={color} color={color} />\n ))}\n </TippedSelect>\n);\n\nexport const CustomDropdown = ({\n options,\n label,\n onSelectMenuItem = () => null,\n onClickOutsideMenu = () => null,\n onClose = () => null,\n closeMenuOnItemSelection,\n isOpen,\n minWidth,\n maxWidth,\n zIndex = 10,\n}) => (\n <DSDropdownMenu\n onClickOutsideMenu={onClickOutsideMenu}\n options={options}\n onSelectMenuItem={onSelectMenuItem}\n onClose={onClose}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n isOpen={isOpen}\n minWidth={minWidth}\n maxWidth={maxWidth}\n zIndex={zIndex}\n preventOverflow=\"scrollParent\"\n triggerComponent={<DSButton labelText={label} buttonType=\"text\" icon={<ArrowheadDown />} />}\n />\n);\n\nconst Divider = () => (\n <div\n style={{\n height: '21px',\n width: '1px',\n margin: '0 10px',\n padding: '0',\n borderLeft: '1px solid #bbb',\n display: 'inline-block',\n }}\n ></div>\n);\n\nexport const CustomToolbar = ({\n customFields,\n customItems = [],\n hideItems = {},\n onShowHTML = () => {},\n id = 'toolbar',\n userProps,\n}) => {\n const {\n HEADER,\n FONT,\n FONT_SIZE,\n BOLD,\n ITALIC,\n UNDERLINE,\n STRIKE,\n SUB,\n SUPER,\n ORDERED_LIST,\n BULLET_LIST,\n INDENT_MINUS_ONE,\n INDENT_PLUS_ONE,\n ALIGN,\n FONT_COLOR,\n FONT_BACKGROUND_COLOR,\n HYPERLINK,\n IMAGE,\n CLEAR_FORMAT,\n SHOW_HTML,\n } = hideItems;\n const [showHTML, setShowHTML] = useState(false);\n\n const handleShowHTML = (e) => {\n e.preventDefault();\n setShowHTML(!showHTML);\n onShowHTML();\n };\n\n return (\n <div id={id} className=\"ds-ql-custom-toolbar\">\n {(!HEADER || !FONT || !FONT_SIZE) && (\n <span className=\"ql-formats\">\n {!HEADER && (\n <>\n <TippedSelect\n className=\"ql-header\"\n tip=\"Header\"\n values={['', '1', '2', '3', '4', '5', '6']}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT && (\n <>\n <TippedSelect\n className=\"ql-font\"\n defaultValue=\"sans-serif\"\n options={fonts}\n tip=\"Font\"\n values={optionsToValues(fonts)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n {!FONT_SIZE && (\n <>\n <TippedSelect\n className=\"ql-size\"\n options={sizes}\n tip=\"Font Size\"\n values={optionsToValues(sizesReal)}\n zIndex={userProps?.zIndex || 1}\n />\n <Divider />\n </>\n )}\n </span>\n )}\n {(!BOLD || !ITALIC || !UNDERLINE || !STRIKE) && (\n <span className=\"ql-formats\">\n {!BOLD && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-bold\" tip=\"Bold\" />}\n {!ITALIC && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-italic\" tip=\"Italic\" />}\n {!UNDERLINE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-underline\" tip=\"Underline\" />}\n {!STRIKE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-strike\" tip=\"Strike\" />}\n </span>\n )}\n {(!SUB || !SUPER) && (\n <span className=\"ql-formats\">\n {!SUB && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Sub\" value=\"sub\" />}\n {!SUPER && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-script\" tip=\"Super\" value=\"super\" />}\n <Divider />\n </span>\n )}\n {(!ORDERED_LIST || !BULLET_LIST) && (\n <span className=\"ql-formats\">\n {!ORDERED_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Ordered List\" value=\"ordered\" />\n )}\n {!BULLET_LIST && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-list\" tip=\"Bullet List\" value=\"bullet\" />\n )}\n </span>\n )}\n {(!INDENT_MINUS_ONE || !INDENT_PLUS_ONE) && (\n <span className=\"ql-formats\">\n {!INDENT_MINUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent -1\" value=\"-1\" />\n )}\n {!INDENT_PLUS_ONE && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-indent\" tip=\"Indent +1\" value=\"+1\" />\n )}\n </span>\n )}\n {!ALIGN && (\n <span className=\"ql-formats\">\n {/* <TippedSelect zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Align\"/> */}\n {/* \n quill js has a bug where using ql-align with the html tag \"select\" leave us with a can not read property innerhtml of undefined\n we can't update quill js because it's a peer dependency of react-quill\n this is a workaround to keep provide the ql-align module but not use the html tag \"select\"\n */}\n <span className=\"ql-formats\">\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Left\" value=\"\"></TippedButton>\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n className=\"ql-align\"\n tip=\"Center\"\n value=\"center\"\n ></TippedButton>\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-align\" tip=\"Right\" value=\"right\"></TippedButton>\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n className=\"ql-align\"\n tip=\"Justify\"\n value=\"justify\"\n ></TippedButton>\n </span>\n <Divider />\n </span>\n )}\n {(!FONT_COLOR || !FONT_BACKGROUND_COLOR) && (\n <span className=\"ql-formats\">\n {!FONT_COLOR && <Colors zIndex={userProps?.zIndex || 1} className=\"ql-color\" tip=\"Font Color\" />}\n {!FONT_BACKGROUND_COLOR && (\n <Colors zIndex={userProps?.zIndex || 1} className=\"ql-background\" tip=\"Font Background Color\" />\n )}\n <Divider />\n </span>\n )}\n {(!HYPERLINK || !IMAGE) && (\n <span className=\"ql-formats\">\n {!HYPERLINK && (\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-link\" tip=\"Hyperlink: Select Text First\" />\n )}\n {!IMAGE && <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-image\" tip=\"Insert Image\" />}\n <Divider />\n </span>\n )}\n {!CLEAR_FORMAT && (\n <span className=\"ql-formats\">\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-clean\" tip=\"Clear Format (Select Text)\" />\n </span>\n )}\n {!SHOW_HTML && (\n <span className=\"ql-formats\">\n <Divider />\n <TippedButton\n zIndex={userProps?.zIndex || 1}\n style={{\n width: 'fit-content',\n color: '#1e79c2',\n fontWeight: '500',\n }}\n onClick={handleShowHTML}\n tip={showHTML ? 'SHOW TEXT' : 'SHOW HTML'}\n className=\"ql-customFields-html\"\n >\n {showHTML ? 'SHOW TEXT' : 'SHOW HTML'}\n </TippedButton>\n </span>\n )}\n {customFields && (\n <span className=\"ql-formats\">\n <Divider />\n <TippedButton zIndex={userProps?.zIndex || 1} className=\"ql-customFields\" tip=\"Insert Custom Field\">\n <CustomFields />\n </TippedButton>\n </span>\n )}\n {customItems && (\n <span style={{ display: 'inline-flex' }}>\n {customItems.map((Item) => (\n <>\n <Divider />\n <Item />\n </>\n ))}\n </span>\n )}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmBI,SA6Ff,UA7Fe,KA6Ff,YA7Fe;AAb3B,SAAgB,gBAAgB;AAChC,OAAO,cAAc;AACrB,SAAS,qBAAqB;AAC9B,OAAO,oBAAoB;AAC3B,SAAS,QAAQ,OAAO,OAAO,iBAAiB;AAChD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAG7B,MAAM,kBAAkB,CAAC,YAAY,QAAQ,IAAI,CAAC,QAAQ,IAAI,YAAY,EAAE,QAAQ,KAAK,GAAG,CAAC;AAI7F,MAAM,eAAe,MAAM,oBAAC,UAAK,0BAAE;AACnC,MAA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AS;AAAA,UACT,KAAK,WAAW,cAAc;AAAA,UAC9B,WAAU;AAAA,UAET,qBAAW,cAAc;AAAA;AAAA,MAC5B;AAAA,OACF;AAAA,IAED,gBACC,qBAAC,UAAK,WAAU,cACd;AAAA,0BAAC,WAAQ;AAAA,MACT,oBAAC,gBAAa,QAAQ,WAAW,UAAU,GAAG,WAAU,mBAAkB,KAAI,uBAC5E,8BAAC,gBAAa,GAChB;AAAA,OACF;AAAA,IAED,eACC,oBAAC,UAAK,OAAO,EAAE,SAAS,cAAc,GACnC,sBAAY,IAAI,CAAC,SAChB,iCACE;AAAA,0BAAC,WAAQ;AAAA,MACT,oBAAC,QAAK;AAAA,OACR,CACD,GACH;AAAA,KAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,60 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
|
-
import ReactQuill
|
|
5
|
-
import BlotFormatter from "quill-blot-formatter";
|
|
4
|
+
import ReactQuill from "react-quill";
|
|
6
5
|
import { uid } from "uid";
|
|
7
6
|
import ImageLibraryModal from "./ImageLibraryModal";
|
|
8
7
|
import InsertFieldModal from "./InsertFieldModal";
|
|
9
8
|
import { CustomToolbar } from "./CustomToolbar";
|
|
10
|
-
import IndentStyle from "../quillOverrides/IndentStyle";
|
|
11
|
-
import LinkFormat from "../quillOverrides/LinkFormat";
|
|
12
|
-
import Image from "../quillOverrides/Image";
|
|
13
9
|
import { formatHTML } from "../utils";
|
|
14
10
|
import { clipboardLinkWithTagMatcher } from "../quillMatchers/clipboardLinkWithTagMatcher";
|
|
15
|
-
Quill
|
|
16
|
-
const AlignStyle = Quill.import("attributors/style/align");
|
|
17
|
-
const FontStyle = Quill.import("attributors/style/font");
|
|
18
|
-
FontStyle.whitelist = [
|
|
19
|
-
"serif",
|
|
20
|
-
"monospace",
|
|
21
|
-
"arial",
|
|
22
|
-
"comic-sans",
|
|
23
|
-
"courier-new",
|
|
24
|
-
"georgia",
|
|
25
|
-
"helvetica",
|
|
26
|
-
"lucida"
|
|
27
|
-
];
|
|
28
|
-
const SizeStyle = Quill.import("attributors/style/size");
|
|
29
|
-
SizeStyle.whitelist = [
|
|
30
|
-
"x-small",
|
|
31
|
-
"large",
|
|
32
|
-
"x-large"
|
|
33
|
-
];
|
|
34
|
-
const Block = Quill.import("blots/block");
|
|
35
|
-
Block.tagName = "p";
|
|
36
|
-
Quill.register(Block);
|
|
37
|
-
Quill.register(AlignStyle, true);
|
|
38
|
-
Quill.register(IndentStyle, true);
|
|
39
|
-
Quill.register(FontStyle, true);
|
|
40
|
-
Quill.register(SizeStyle, true);
|
|
41
|
-
Quill.register(Image, true);
|
|
11
|
+
import Quill from "../config/quillSingletonConfigurations";
|
|
42
12
|
class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
43
13
|
constructor(props) {
|
|
44
14
|
super(props);
|
|
45
|
-
this.quillModules = {
|
|
46
|
-
toolbar: {
|
|
47
|
-
container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : "#toolbar",
|
|
48
|
-
handlers: {
|
|
49
|
-
...this.props.toolbarHandlers
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
clipboard: {
|
|
53
|
-
matchVisual: false
|
|
54
|
-
},
|
|
55
|
-
blotFormatter: {},
|
|
56
|
-
...this.props.quillModules
|
|
57
|
-
};
|
|
58
15
|
this.getEditor = () => this.quill?.getEditor();
|
|
59
16
|
this.onChangeQuill = (html, delta, source, editor) => {
|
|
60
17
|
const { showRawHTML, onChange } = this.props;
|
|
@@ -86,20 +43,39 @@ class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
|
86
43
|
this.setState({ isImageModalOpen: false });
|
|
87
44
|
};
|
|
88
45
|
this.quillRef = (ref) => {
|
|
46
|
+
const editor = ref?.getEditor();
|
|
47
|
+
if (this.getEditor() !== editor) {
|
|
48
|
+
editor?.clipboard.addMatcher("a", clipboardLinkWithTagMatcher);
|
|
49
|
+
}
|
|
50
|
+
this.props.getQuillRef(ref);
|
|
89
51
|
this.quill = ref;
|
|
90
52
|
};
|
|
91
|
-
|
|
53
|
+
this.quill = void 0;
|
|
54
|
+
const instanceUid = uid(12);
|
|
55
|
+
const uniqueClassName = `ds-wysiwyg-editor-${instanceUid}`;
|
|
56
|
+
const quillModules = {
|
|
57
|
+
toolbar: {
|
|
58
|
+
container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : `#toolbar-${uniqueClassName}`,
|
|
59
|
+
handlers: {
|
|
60
|
+
...this.props.toolbarHandlers
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
clipboard: {
|
|
64
|
+
matchVisual: false
|
|
65
|
+
},
|
|
66
|
+
...this.props.quillModules
|
|
67
|
+
};
|
|
92
68
|
if (props.quillOverrides.length) {
|
|
93
69
|
props.quillOverrides.map((override) => Quill.register(override, true));
|
|
94
70
|
}
|
|
95
|
-
const instanceUid = uid(12);
|
|
96
71
|
this.state = {
|
|
97
72
|
isImageModalOpen: false,
|
|
98
73
|
isFieldModalOpen: false,
|
|
99
74
|
uid: instanceUid,
|
|
100
|
-
uniqueClassName
|
|
75
|
+
uniqueClassName,
|
|
76
|
+
quillModules
|
|
101
77
|
};
|
|
102
|
-
const { toolbar } =
|
|
78
|
+
const { toolbar } = quillModules;
|
|
103
79
|
if (props.imagesData) {
|
|
104
80
|
toolbar.handlers.image = (value) => {
|
|
105
81
|
const { imagesData, handleImageClick } = this.props;
|
|
@@ -122,12 +98,6 @@ class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
|
122
98
|
}
|
|
123
99
|
}
|
|
124
100
|
componentDidMount() {
|
|
125
|
-
setTimeout(() => {
|
|
126
|
-
const quillDomRef = this.quill;
|
|
127
|
-
this.props.getQuillRef(quillDomRef);
|
|
128
|
-
const editor = quillDomRef?.getEditor();
|
|
129
|
-
editor?.clipboard.addMatcher("a", clipboardLinkWithTagMatcher);
|
|
130
|
-
});
|
|
131
101
|
}
|
|
132
102
|
render() {
|
|
133
103
|
const { isFieldModalOpen, isImageModalOpen } = this.state;
|
|
@@ -141,29 +111,17 @@ class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
|
141
111
|
showRawHTML,
|
|
142
112
|
onShowHTML,
|
|
143
113
|
hideItems,
|
|
144
|
-
bounds,
|
|
145
114
|
onChange,
|
|
146
115
|
handleImageClick,
|
|
147
116
|
handleCustomFieldClick,
|
|
148
117
|
...editorProps
|
|
149
118
|
} = this.props;
|
|
150
|
-
let finalBoundElement = document.body;
|
|
151
|
-
if (typeof bounds !== "undefined" && bounds?.classList && bounds?.classList instanceof DOMTokenList) {
|
|
152
|
-
finalBoundElement = bounds;
|
|
153
|
-
}
|
|
154
|
-
const elementsWithClass = document.querySelectorAll(`.${this.state.uniqueClassName}`);
|
|
155
|
-
elementsWithClass.forEach((element) => {
|
|
156
|
-
element.classList.remove(this.state.uniqueClassName);
|
|
157
|
-
});
|
|
158
|
-
if (!finalBoundElement.classList.contains(this.state.uniqueClassName)) {
|
|
159
|
-
finalBoundElement.classList.add(this.state.uniqueClassName);
|
|
160
|
-
}
|
|
161
|
-
const boundsWorkaround = `.${this.state.uniqueClassName}`;
|
|
162
119
|
return /* @__PURE__ */ jsxs(
|
|
163
120
|
"div",
|
|
164
121
|
{
|
|
165
122
|
...containerProps,
|
|
166
123
|
className: `quill-wysiwyg-editor ${showRawHTML ? "show-raw" : ""}`,
|
|
124
|
+
"data-uid": this.state.uid,
|
|
167
125
|
children: [
|
|
168
126
|
customToolbar || /* @__PURE__ */ jsx(
|
|
169
127
|
CustomToolbar,
|
|
@@ -171,23 +129,23 @@ class DSWYSIWYGEditorImpl extends React2.PureComponent {
|
|
|
171
129
|
customFields,
|
|
172
130
|
onShowHTML,
|
|
173
131
|
hideItems,
|
|
174
|
-
userProps: this.props
|
|
132
|
+
userProps: this.props,
|
|
133
|
+
id: `toolbar-${this.state.uniqueClassName}`
|
|
175
134
|
}
|
|
176
135
|
),
|
|
177
136
|
/* @__PURE__ */ jsx(
|
|
178
137
|
ReactQuill,
|
|
179
138
|
{
|
|
180
139
|
ref: this.quillRef,
|
|
181
|
-
modules: this.quillModules,
|
|
140
|
+
modules: this.state.quillModules,
|
|
182
141
|
onChange: this.onChangeQuill,
|
|
183
142
|
value,
|
|
184
143
|
style: {
|
|
185
144
|
height,
|
|
186
145
|
borderBottom: "1px solid #ccc"
|
|
187
146
|
},
|
|
188
|
-
bounds: boundsWorkaround,
|
|
189
147
|
...editorProps,
|
|
190
|
-
id:
|
|
148
|
+
id: `wysiwyg-text-container-${this.state.uid}`
|
|
191
149
|
}
|
|
192
150
|
),
|
|
193
151
|
/* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/DSWYSIWYGEditorImpl.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport ReactQuill
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport ReactQuill from 'react-quill';\nimport { uid } from 'uid';\n\nimport ImageLibraryModal from './ImageLibraryModal';\nimport InsertFieldModal from './InsertFieldModal';\nimport { CustomToolbar } from './CustomToolbar';\nimport { formatHTML } from '../utils';\nimport { clipboardLinkWithTagMatcher } from '../quillMatchers/clipboardLinkWithTagMatcher';\nimport Quill from '../config/quillSingletonConfigurations';\n\nexport default class DSWYSIWYGEditorImpl extends React.PureComponent {\n quill: undefined | typeof ReactQuill;\n\n constructor(props) {\n super(props);\n this.quill = undefined; // this will hold the quill instance reference\n const instanceUid = uid(12);\n const uniqueClassName = `ds-wysiwyg-editor-${instanceUid}`;\n const quillModules = {\n toolbar: {\n container: this.props.toolbarContainer ? `#${this.props.toolbarContainer}` : `#toolbar-${uniqueClassName}`,\n handlers: {\n ...this.props.toolbarHandlers,\n },\n },\n clipboard: {\n // toggle to add extra line breaks when pasting HTML:\n matchVisual: false,\n },\n ...this.props.quillModules,\n };\n if (props.quillOverrides.length) {\n props.quillOverrides.map((override) => Quill.register(override, true));\n }\n this.state = {\n isImageModalOpen: false,\n isFieldModalOpen: false,\n uid: instanceUid,\n uniqueClassName,\n quillModules,\n };\n const { toolbar } = quillModules;\n if (props.imagesData) {\n toolbar.handlers.image = (value) => {\n const { imagesData, handleImageClick } = this.props;\n if (!imagesData.length) {\n return;\n }\n this.setState({ isImageModalOpen: !!value });\n handleImageClick(value);\n };\n }\n if (props.customFields) {\n toolbar.handlers.customFields = (value) => {\n const { customFields, handleCustomFieldClick } = this.props;\n if (!customFields.length) {\n return;\n }\n this.setState({ isFieldModalOpen: !!value });\n handleCustomFieldClick(value);\n };\n }\n }\n\n componentDidMount() {}\n\n getEditor = () => this.quill?.getEditor();\n\n // eslint-disable-next-line max-params\n onChangeQuill = (html, delta, source, editor) => {\n // console.log('quill detected a change');\n const { showRawHTML, onChange } = this.props;\n if (!showRawHTML) onChange(html, delta, source, editor);\n };\n\n onChangeTextArea = (e) => {\n const { showRawHTML, onChange } = this.props;\n if (showRawHTML) onChange(e.target.value);\n };\n\n onInserFieldConfirm = (fieldCode) => {\n const editor = this.getEditor();\n const range = editor.getSelection(true);\n editor.insertText(range.index, fieldCode);\n };\n\n onImageConfirm = (image) => {\n if (!image) {\n return;\n }\n const editor = this.getEditor();\n const range = editor.getSelection(true);\n editor.insertEmbed(range.index, 'image', image.url);\n };\n\n onFieldModalClose = () => {\n this.setState({ isFieldModalOpen: false });\n };\n\n onImageModalClose = () => {\n this.setState({ isImageModalOpen: false });\n };\n\n quillRef = (ref) => {\n const editor = ref?.getEditor();\n if (this.getEditor() !== editor) {\n // the underlying quill instance has changed\n // this may happens because it's the first render or for other reasons\n // but any instance configuration must happen again in this case\n\n // we add a clipboard matcher\n // https://github.com/quilljs/quill/issues/2677\n editor?.clipboard.addMatcher('a', clipboardLinkWithTagMatcher);\n }\n this.props.getQuillRef(ref);\n this.quill = ref;\n };\n\n render() {\n const { isFieldModalOpen, isImageModalOpen } = this.state;\n const {\n containerProps = {},\n customFields,\n imagesData,\n customToolbar,\n height,\n value,\n showRawHTML,\n onShowHTML,\n hideItems,\n // bounds,\n // a bunch of props we don't want to pass to the editor\n onChange,\n handleImageClick,\n handleCustomFieldClick,\n ...editorProps\n } = this.props;\n\n return (\n <div\n // data-testid=\"wysiwyg-text-container\"\n {...containerProps}\n className={`quill-wysiwyg-editor ${showRawHTML ? 'show-raw' : ''}`}\n data-uid={this.state.uid}\n >\n {customToolbar || (\n <CustomToolbar\n customFields={customFields}\n onShowHTML={onShowHTML}\n hideItems={hideItems}\n userProps={this.props}\n id={`toolbar-${this.state.uniqueClassName}`}\n />\n )}\n <ReactQuill\n ref={this.quillRef}\n modules={this.state.quillModules}\n onChange={this.onChangeQuill}\n value={value}\n style={{\n height,\n borderBottom: '1px solid #ccc',\n }}\n {...editorProps}\n id={`wysiwyg-text-container-${this.state.uid}`}\n />\n <textarea\n className=\"raw-editor ql-container ql-snow ql-editor\"\n style={{\n width: '100%',\n resize: 'none',\n height,\n minHeight: '200px',\n }}\n onChange={this.onChangeTextArea}\n value={formatHTML(value)}\n />\n {imagesData && imagesData.length && (\n <ImageLibraryModal\n imagesData={imagesData}\n isOpen={isImageModalOpen}\n onClose={this.onImageModalClose}\n onConfirm={this.onImageConfirm}\n />\n )}\n {customFields && customFields.length && (\n <InsertFieldModal\n customFields={customFields}\n isOpen={isFieldModalOpen}\n onClose={this.onFieldModalClose}\n onConfirm={this.onInserFieldConfirm}\n />\n )}\n </div>\n );\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoJjB,SAOI,KAPJ;AA5IN,OAAOA,YAAW;AAClB,OAAO,gBAAgB;AACvB,SAAS,WAAW;AAEpB,OAAO,uBAAuB;AAC9B,OAAO,sBAAsB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,OAAO,WAAW;AAElB,MAAO,4BAA0CA,OAAM,cAAc;AAAA,EAGnE,YAAY,OAAO;AACjB,UAAM,KAAK;AAoDb,qBAAY,MAAM,KAAK,OAAO,UAAU;AAGxC,yBAAgB,CAAC,MAAM,OAAO,QAAQ,WAAW;AAE/C,YAAM,EAAE,aAAa,SAAS,IAAI,KAAK;AACvC,UAAI,CAAC;AAAa,iBAAS,MAAM,OAAO,QAAQ,MAAM;AAAA,IACxD;AAEA,4BAAmB,CAAC,MAAM;AACxB,YAAM,EAAE,aAAa,SAAS,IAAI,KAAK;AACvC,UAAI;AAAa,iBAAS,EAAE,OAAO,KAAK;AAAA,IAC1C;AAEA,+BAAsB,CAAC,cAAc;AACnC,YAAM,SAAS,KAAK,UAAU;AAC9B,YAAM,QAAQ,OAAO,aAAa,IAAI;AACtC,aAAO,WAAW,MAAM,OAAO,SAAS;AAAA,IAC1C;AAEA,0BAAiB,CAAC,UAAU;AAC1B,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,YAAM,SAAS,KAAK,UAAU;AAC9B,YAAM,QAAQ,OAAO,aAAa,IAAI;AACtC,aAAO,YAAY,MAAM,OAAO,SAAS,MAAM,GAAG;AAAA,IACpD;AAEA,6BAAoB,MAAM;AACxB,WAAK,SAAS,EAAE,kBAAkB,MAAM,CAAC;AAAA,IAC3C;AAEA,6BAAoB,MAAM;AACxB,WAAK,SAAS,E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ACR,SAAS,KAAK;AAAA,cACd,WAAW,KAAK;AAAA;AAAA,UAClB;AAAA,UAED,gBAAgB,aAAa,UAC5B;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,QAAQ;AAAA,cACR,SAAS,KAAK;AAAA,cACd,WAAW,KAAK;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Quill } from "react-quill";
|
|
3
|
+
import BlotFormatter from "quill-blot-formatter";
|
|
4
|
+
import IndentStyle from "../quillOverrides/IndentStyle";
|
|
5
|
+
import Image from "../quillOverrides/Image";
|
|
6
|
+
import LinkFormat from "../quillOverrides/LinkFormat";
|
|
7
|
+
if (!Quill._dsDidRegisterBlotFormatter) {
|
|
8
|
+
Quill.register("modules/blotFormatter", BlotFormatter);
|
|
9
|
+
Quill._dsDidRegisterBlotFormatter = true;
|
|
10
|
+
}
|
|
11
|
+
if (!Quill._dsDidConfigureTextWhitelist) {
|
|
12
|
+
const AlignStyle = Quill.import("attributors/style/align");
|
|
13
|
+
const FontStyle = Quill.import("attributors/style/font");
|
|
14
|
+
FontStyle.whitelist = [
|
|
15
|
+
"serif",
|
|
16
|
+
"monospace",
|
|
17
|
+
"arial",
|
|
18
|
+
"comic-sans",
|
|
19
|
+
"courier-new",
|
|
20
|
+
"georgia",
|
|
21
|
+
"helvetica",
|
|
22
|
+
"lucida"
|
|
23
|
+
];
|
|
24
|
+
const SizeStyle = Quill.import("attributors/style/size");
|
|
25
|
+
SizeStyle.whitelist = [
|
|
26
|
+
"x-small",
|
|
27
|
+
"large",
|
|
28
|
+
"x-large"
|
|
29
|
+
];
|
|
30
|
+
Quill.register(AlignStyle, true);
|
|
31
|
+
Quill.register(IndentStyle, true);
|
|
32
|
+
Quill.register(FontStyle, true);
|
|
33
|
+
Quill.register(SizeStyle, true);
|
|
34
|
+
Quill._dsDidConfigureTextWhitelist = true;
|
|
35
|
+
}
|
|
36
|
+
if (!Quill._dsDidConfigureBlock) {
|
|
37
|
+
const Block = Quill.import("blots/block");
|
|
38
|
+
Block.tagName = "p";
|
|
39
|
+
Quill.register(Block);
|
|
40
|
+
Quill._dsDidConfigureBlock = true;
|
|
41
|
+
}
|
|
42
|
+
if (!Quill._dsDidConfigureImage) {
|
|
43
|
+
Quill.register(Image, true);
|
|
44
|
+
Quill._dsDidConfigureImage = true;
|
|
45
|
+
}
|
|
46
|
+
if (!Quill._dsDidConfigureLink) {
|
|
47
|
+
Quill.register(LinkFormat, true);
|
|
48
|
+
Quill._dsDidConfigureLink = true;
|
|
49
|
+
}
|
|
50
|
+
var quillSingletonConfigurations_default = Quill;
|
|
51
|
+
export {
|
|
52
|
+
quillSingletonConfigurations_default as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=quillSingletonConfigurations.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/quillSingletonConfigurations.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Quill } from 'react-quill';\nimport BlotFormatter from 'quill-blot-formatter';\nimport IndentStyle from '../quillOverrides/IndentStyle';\nimport Image from '../quillOverrides/Image';\nimport LinkFormat from '../quillOverrides/LinkFormat';\n\n// hystorically we have always been modifying the Quill object directly\n// in node this means we have modified the global Quill object which is a singleton\n// it's not a good practice and we should not do it but to ensure our changes are transparent\n// we keep up the bad practice untill a new version of our editor is released\n// we will atleast reduce the amount of times we modify the Quill object by only doing it once\n// this is \"new\" bad practice but it's better than modifying the global Quill object constantly\n// we achieve this by adding a flag to the Quill object to indicate that we have already modified it\nif (!Quill._dsDidRegisterBlotFormatter) {\n Quill.register('modules/blotFormatter', BlotFormatter);\n Quill._dsDidRegisterBlotFormatter = true;\n}\nif (!Quill._dsDidConfigureTextWhitelist) {\n // Fix block styled formats ----------------\n const AlignStyle = Quill.import('attributors/style/align');\n const FontStyle = Quill.import('attributors/style/font');\n FontStyle.whitelist = [\n // allow ONLY these fonts and the default\n 'serif',\n 'monospace',\n 'arial',\n 'comic-sans',\n 'courier-new',\n 'georgia',\n 'helvetica',\n 'lucida',\n ];\n const SizeStyle = Quill.import('attributors/style/size');\n SizeStyle.whitelist = [\n // allow ONLY these sizes and the default\n 'x-small',\n 'large',\n 'x-large',\n ];\n Quill.register(AlignStyle, true);\n Quill.register(IndentStyle, true);\n Quill.register(FontStyle, true);\n Quill.register(SizeStyle, true);\n Quill._dsDidConfigureTextWhitelist = true;\n}\nif (!Quill._dsDidConfigureBlock) {\n // Fix Doc Viewer p tags extra margin issue ---------\n const Block = Quill.import('blots/block');\n Block.tagName = 'p';\n Quill.register(Block);\n Quill._dsDidConfigureBlock = true;\n // -----------------------------------------\n}\nif (!Quill._dsDidConfigureImage) {\n Quill.register(Image, true);\n Quill._dsDidConfigureImage = true;\n}\n\nif (!Quill._dsDidConfigureLink) {\n Quill.register(LinkFormat, true);\n Quill._dsDidConfigureLink = true;\n}\n\nexport default Quill;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa;AACtB,OAAO,mBAAmB;AAC1B,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,OAAO,gBAAgB;AASvB,IAAI,CAAC,MAAM,6BAA6B;AACtC,QAAM,SAAS,yBAAyB,aAAa;AACrD,QAAM,8BAA8B;AACtC;AACA,IAAI,CAAC,MAAM,8BAA8B;AAEvC,QAAM,aAAa,MAAM,OAAO,yBAAyB;AACzD,QAAM,YAAY,MAAM,OAAO,wBAAwB;AACvD,YAAU,YAAY;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,YAAY,MAAM,OAAO,wBAAwB;AACvD,YAAU,YAAY;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,SAAS,YAAY,IAAI;AAC/B,QAAM,SAAS,aAAa,IAAI;AAChC,QAAM,SAAS,WAAW,IAAI;AAC9B,QAAM,SAAS,WAAW,IAAI;AAC9B,QAAM,+BAA+B;AACvC;AACA,IAAI,CAAC,MAAM,sBAAsB;AAE/B,QAAM,QAAQ,MAAM,OAAO,aAAa;AACxC,QAAM,UAAU;AAChB,QAAM,SAAS,KAAK;AACpB,QAAM,uBAAuB;AAE/B;AACA,IAAI,CAAC,MAAM,sBAAsB;AAC/B,QAAM,SAAS,OAAO,IAAI;AAC1B,QAAM,uBAAuB;AAC/B;AAEA,IAAI,CAAC,MAAM,qBAAqB;AAC9B,QAAM,SAAS,YAAY,IAAI;AAC/B,QAAM,sBAAsB;AAC9B;AAEA,IAAO,uCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import ReactQuill from 'react-quill';
|
|
2
3
|
export default class DSWYSIWYGEditorImpl extends React.PureComponent {
|
|
3
|
-
|
|
4
|
+
quill: undefined | typeof ReactQuill;
|
|
4
5
|
constructor(props: any);
|
|
5
6
|
componentDidMount(): void;
|
|
6
7
|
getEditor: () => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-wysiwygeditor",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - WYSIWYG Editor",
|
|
6
6
|
"files": [
|
|
@@ -102,16 +102,16 @@
|
|
|
102
102
|
"prop-types": "~15.8.1",
|
|
103
103
|
"quill-blot-formatter": "~1.0.5",
|
|
104
104
|
"quill-delta": "5.0.0",
|
|
105
|
-
"react-quill": "2.0.0-beta.
|
|
106
|
-
"@elliemae/ds-dropdownmenu": "3.14.
|
|
107
|
-
"@elliemae/ds-
|
|
108
|
-
"@elliemae/ds-
|
|
109
|
-
"@elliemae/ds-
|
|
110
|
-
"@elliemae/ds-
|
|
111
|
-
"@elliemae/ds-
|
|
112
|
-
"@elliemae/ds-
|
|
113
|
-
"@elliemae/ds-
|
|
114
|
-
"@elliemae/ds-
|
|
105
|
+
"react-quill": "2.0.0-beta.4",
|
|
106
|
+
"@elliemae/ds-dropdownmenu": "3.14.15",
|
|
107
|
+
"@elliemae/ds-modal": "3.14.15",
|
|
108
|
+
"@elliemae/ds-shared": "3.14.15",
|
|
109
|
+
"@elliemae/ds-button": "3.14.15",
|
|
110
|
+
"@elliemae/ds-tooltip": "3.14.15",
|
|
111
|
+
"@elliemae/ds-uploader": "3.14.15",
|
|
112
|
+
"@elliemae/ds-utilities": "3.14.15",
|
|
113
|
+
"@elliemae/ds-icons": "3.14.15",
|
|
114
|
+
"@elliemae/ds-imagelibrarymodal": "3.14.15"
|
|
115
115
|
},
|
|
116
116
|
"publishConfig": {
|
|
117
117
|
"access": "public",
|