@jotforminc/dnd-builder 2.9.6 → 2.9.8
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/CHANGELOG.md +14 -0
- package/lib/cjs/components/TextEditor/QuillEditor.js +5 -3
- package/lib/cjs/components/TextEditor/QuillEditor.js.map +1 -1
- package/lib/cjs/styles/_jfPrint.scss +4 -0
- package/lib/esm/components/TextEditor/QuillEditor.js +5 -3
- package/lib/esm/components/TextEditor/QuillEditor.js.map +1 -1
- package/lib/esm/styles/_jfPrint.scss +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.9.8](https://github.com/jotform/dnd-builder/compare/v2.9.7...v2.9.8) (2025-10-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **quilleditor:** content should be set if source is equal user ([8ac4058](https://github.com/jotform/dnd-builder/commit/8ac405844e0ba4c4c0678149ada5ab7d13ac02ff))
|
|
11
|
+
|
|
12
|
+
### [2.9.7](https://github.com/jotform/dnd-builder/compare/v2.9.6...v2.9.7) (2025-06-25)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **dnd-builder:** print style updates ([d04e92b](https://github.com/jotform/dnd-builder/commit/d04e92b6ee3eaac3fd3a8708e779b9ed01898732))
|
|
18
|
+
|
|
5
19
|
### [2.9.6](https://github.com/jotform/dnd-builder/compare/v2.9.5...v2.9.6) (2024-12-18)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -75,9 +75,11 @@ var QuillEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
_defineProperty(_assertThisInitialized(_this), "handleSetContent", function (value) {
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "handleSetContent", function (value, delta, source) {
|
|
79
|
+
if (source === 'user') {
|
|
80
|
+
var setContent = _this.props.setContent;
|
|
81
|
+
setContent(domPurify__default['default'].sanitize(value));
|
|
82
|
+
}
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
_this.quill = /*#__PURE__*/React__default['default'].createRef();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillEditor.js","sources":["../../../../src/components/TextEditor/QuillEditor.js"],"sourcesContent":["import React from 'react';\nimport ReactQuill from 'react-quill';\nimport domPurify from 'dompurify';\nimport PropTypes from 'prop-types';\nimport { formats, modules } from './textEditorConstants';\nimport { fontSizes } from '../../constants/fonts';\nimport 'react-quill/dist/quill.snow.css';\n\nconst Size = ReactQuill.Quill.import('attributors/style/size');\nSize.whitelist = fontSizes.map(s => `${s}px`);\nReactQuill.Quill.register(Size, true);\n\nclass QuillEditor extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.quill = React.createRef();\n }\n\n componentDidMount() {\n if (this.quill.current !== null) {\n const { content } = this.props;\n const editor = this.quill.current.getEditor();\n editor.setSelection(0, content.length);\n }\n }\n\n componentWillUnmount() {\n this.saveAndQuit();\n }\n\n saveAndQuit = () => {\n const { content, handleSave, setIsTextEditorOpen } = this.props;\n setIsTextEditorOpen(false);\n handleSave(content);\n }\n\n handleKeyDown = e => {\n e.stopPropagation();\n if (e.keyCode === 27) {\n this.saveAndQuit();\n }\n }\n\n handleSetContent = value => {\n const { setContent } = this.props;\n
|
|
1
|
+
{"version":3,"file":"QuillEditor.js","sources":["../../../../src/components/TextEditor/QuillEditor.js"],"sourcesContent":["import React from 'react';\nimport ReactQuill from 'react-quill';\nimport domPurify from 'dompurify';\nimport PropTypes from 'prop-types';\nimport { formats, modules } from './textEditorConstants';\nimport { fontSizes } from '../../constants/fonts';\nimport 'react-quill/dist/quill.snow.css';\n\nconst Size = ReactQuill.Quill.import('attributors/style/size');\nSize.whitelist = fontSizes.map(s => `${s}px`);\nReactQuill.Quill.register(Size, true);\n\nclass QuillEditor extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.quill = React.createRef();\n }\n\n componentDidMount() {\n if (this.quill.current !== null) {\n const { content } = this.props;\n const editor = this.quill.current.getEditor();\n editor.setSelection(0, content.length);\n }\n }\n\n componentWillUnmount() {\n this.saveAndQuit();\n }\n\n saveAndQuit = () => {\n const { content, handleSave, setIsTextEditorOpen } = this.props;\n setIsTextEditorOpen(false);\n handleSave(content);\n }\n\n handleKeyDown = e => {\n e.stopPropagation();\n if (e.keyCode === 27) {\n this.saveAndQuit();\n }\n }\n\n handleSetContent = (value, delta, source) => {\n if (source === 'user') {\n const { setContent } = this.props;\n setContent(domPurify.sanitize(value));\n }\n }\n\n render() {\n const { content, placeholder } = this.props;\n\n return (\n <div\n className=\"f-all\"\n onKeyDown={this.handleKeyDown}\n >\n <ReactQuill\n ref={this.quill}\n formats={QuillEditor.formats}\n modules={QuillEditor.modules}\n onChange={this.handleSetContent}\n placeholder={placeholder}\n preserveWhitespace\n value={content}\n />\n </div>\n );\n }\n}\n\nQuillEditor.modules = modules;\nQuillEditor.formats = formats;\n\nQuillEditor.propTypes = {\n content: PropTypes.string,\n handleSave: PropTypes.func,\n placeholder: PropTypes.string.isRequired,\n setContent: PropTypes.func,\n setIsTextEditorOpen: PropTypes.func,\n};\n\nQuillEditor.defaultProps = {\n content: '',\n handleSave: () => {},\n setContent: () => {},\n setIsTextEditorOpen: () => {},\n};\n\nexport default QuillEditor;\n"],"names":["Size","ReactQuill","Quill","import","whitelist","fontSizes","map","s","register","QuillEditor","props","content","handleSave","setIsTextEditorOpen","e","stopPropagation","keyCode","saveAndQuit","value","delta","source","setContent","domPurify","sanitize","quill","React","createRef","current","editor","getEditor","setSelection","length","placeholder","_jsx","handleKeyDown","formats","modules","handleSetContent","PureComponent","propTypes","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AAO,EAAE,EADgB;AAEzBC,EAAAA,UAAU,EAAE,sBAAM,EAFO;AAGzBS,EAAAA,UAAU,EAAE,sBAAM,EAHO;AAIzBR,EAAAA,mBAAmB,EAAE,+BAAM;AAJF,CAA3B;;;;"}
|
|
@@ -66,9 +66,11 @@ var QuillEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
_defineProperty(_assertThisInitialized(_this), "handleSetContent", function (value) {
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "handleSetContent", function (value, delta, source) {
|
|
70
|
+
if (source === 'user') {
|
|
71
|
+
var setContent = _this.props.setContent;
|
|
72
|
+
setContent(domPurify.sanitize(value));
|
|
73
|
+
}
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
_this.quill = /*#__PURE__*/React.createRef();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillEditor.js","sources":["../../../../src/components/TextEditor/QuillEditor.js"],"sourcesContent":["import React from 'react';\nimport ReactQuill from 'react-quill';\nimport domPurify from 'dompurify';\nimport PropTypes from 'prop-types';\nimport { formats, modules } from './textEditorConstants';\nimport { fontSizes } from '../../constants/fonts';\nimport 'react-quill/dist/quill.snow.css';\n\nconst Size = ReactQuill.Quill.import('attributors/style/size');\nSize.whitelist = fontSizes.map(s => `${s}px`);\nReactQuill.Quill.register(Size, true);\n\nclass QuillEditor extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.quill = React.createRef();\n }\n\n componentDidMount() {\n if (this.quill.current !== null) {\n const { content } = this.props;\n const editor = this.quill.current.getEditor();\n editor.setSelection(0, content.length);\n }\n }\n\n componentWillUnmount() {\n this.saveAndQuit();\n }\n\n saveAndQuit = () => {\n const { content, handleSave, setIsTextEditorOpen } = this.props;\n setIsTextEditorOpen(false);\n handleSave(content);\n }\n\n handleKeyDown = e => {\n e.stopPropagation();\n if (e.keyCode === 27) {\n this.saveAndQuit();\n }\n }\n\n handleSetContent = value => {\n const { setContent } = this.props;\n
|
|
1
|
+
{"version":3,"file":"QuillEditor.js","sources":["../../../../src/components/TextEditor/QuillEditor.js"],"sourcesContent":["import React from 'react';\nimport ReactQuill from 'react-quill';\nimport domPurify from 'dompurify';\nimport PropTypes from 'prop-types';\nimport { formats, modules } from './textEditorConstants';\nimport { fontSizes } from '../../constants/fonts';\nimport 'react-quill/dist/quill.snow.css';\n\nconst Size = ReactQuill.Quill.import('attributors/style/size');\nSize.whitelist = fontSizes.map(s => `${s}px`);\nReactQuill.Quill.register(Size, true);\n\nclass QuillEditor extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.quill = React.createRef();\n }\n\n componentDidMount() {\n if (this.quill.current !== null) {\n const { content } = this.props;\n const editor = this.quill.current.getEditor();\n editor.setSelection(0, content.length);\n }\n }\n\n componentWillUnmount() {\n this.saveAndQuit();\n }\n\n saveAndQuit = () => {\n const { content, handleSave, setIsTextEditorOpen } = this.props;\n setIsTextEditorOpen(false);\n handleSave(content);\n }\n\n handleKeyDown = e => {\n e.stopPropagation();\n if (e.keyCode === 27) {\n this.saveAndQuit();\n }\n }\n\n handleSetContent = (value, delta, source) => {\n if (source === 'user') {\n const { setContent } = this.props;\n setContent(domPurify.sanitize(value));\n }\n }\n\n render() {\n const { content, placeholder } = this.props;\n\n return (\n <div\n className=\"f-all\"\n onKeyDown={this.handleKeyDown}\n >\n <ReactQuill\n ref={this.quill}\n formats={QuillEditor.formats}\n modules={QuillEditor.modules}\n onChange={this.handleSetContent}\n placeholder={placeholder}\n preserveWhitespace\n value={content}\n />\n </div>\n );\n }\n}\n\nQuillEditor.modules = modules;\nQuillEditor.formats = formats;\n\nQuillEditor.propTypes = {\n content: PropTypes.string,\n handleSave: PropTypes.func,\n placeholder: PropTypes.string.isRequired,\n setContent: PropTypes.func,\n setIsTextEditorOpen: PropTypes.func,\n};\n\nQuillEditor.defaultProps = {\n content: '',\n handleSave: () => {},\n setContent: () => {},\n setIsTextEditorOpen: () => {},\n};\n\nexport default QuillEditor;\n"],"names":["Size","ReactQuill","Quill","import","whitelist","fontSizes","map","s","register","QuillEditor","props","content","handleSave","setIsTextEditorOpen","e","stopPropagation","keyCode","saveAndQuit","value","delta","source","setContent","domPurify","sanitize","quill","React","createRef","current","editor","getEditor","setSelection","length","placeholder","_jsx","handleKeyDown","formats","modules","handleSetContent","PureComponent","propTypes","PropTypes","string","func","isRequired","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,IAAI,GAAGC,UAAU,CAACC,KAAX,CAAiBC,MAAjB,CAAwB,wBAAxB,CAAb;AACAH,IAAI,CAACI,SAAL,GAAiBC,SAAS,CAACC,GAAV,CAAc,UAAAC,CAAC;AAAA,mBAAOA,CAAP;AAAA,CAAf,CAAjB;AACAN,UAAU,CAACC,KAAX,CAAiBM,QAAjB,CAA0BR,IAA1B,EAAgC,IAAhC;;IAEMS;;;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,8BAAMA,KAAN;;AADiB,kEAkBL,YAAM;AAClB,wBAAqD,MAAKA,KAA1D;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,UAAjB,eAAiBA,UAAjB;AAAA,UAA6BC,mBAA7B,eAA6BA,mBAA7B;AACAA,MAAAA,mBAAmB,CAAC,KAAD,CAAnB;AACAD,MAAAA,UAAU,CAACD,OAAD,CAAV;AACD,KAtBkB;;AAAA,oEAwBH,UAAAG,CAAC,EAAI;AACnBA,MAAAA,CAAC,CAACC,eAAF;;AACA,UAAID,CAAC,CAACE,OAAF,KAAc,EAAlB,EAAsB;AACpB,cAAKC,WAAL;AACD;AACF,KA7BkB;;AAAA,uEA+BA,UAACC,KAAD,EAAQC,KAAR,EAAeC,MAAf,EAA0B;AAC3C,UAAIA,MAAM,KAAK,MAAf,EAAuB;AACrB,YAAQC,UAAR,GAAuB,MAAKX,KAA5B,CAAQW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