@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 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
- var setContent = _this.props.setContent;
80
- setContent(domPurify__default['default'].sanitize(value));
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 setContent(domPurify.sanitize(value));\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","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,8BAAU,CAACC,KAAX,CAAiBC,MAAjB,CAAwB,wBAAxB,CAAb;AACAH,IAAI,CAACI,SAAL,GAAiBC,eAAS,CAACC,GAAV,CAAc,UAAAC,CAAC;AAAA,mBAAOA,CAAP;AAAA,CAAf,CAAjB;AACAN,8BAAU,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,UAAAC,KAAK,EAAI;AAC1B,UAAQC,UAAR,GAAuB,MAAKT,KAA5B,CAAQS,UAAR;AACAA,MAAAA,UAAU,CAACC,6BAAS,CAACC,QAAV,CAAmBH,KAAnB,CAAD,CAAV;AACD,KAlCkB;;AAGjB,UAAKI,KAAL,gBAAaC,yBAAK,CAACC,SAAN,EAAb;AAHiB;AAIlB;;;;WAED,6BAAoB;AAClB,UAAI,KAAKF,KAAL,CAAWG,OAAX,KAAuB,IAA3B,EAAiC;AAC/B,YAAQd,OAAR,GAAoB,KAAKD,KAAzB,CAAQC,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,sBAAM,EAFO;AAGzBO,EAAAA,UAAU,EAAE,sBAAM,EAHO;AAIzBN,EAAAA,mBAAmB,EAAE,+BAAM;AAJF,CAA3B;;;;"}
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,8BAAU,CAACC,KAAX,CAAiBC,MAAjB,CAAwB,wBAAxB,CAAb;AACAH,IAAI,CAACI,SAAL,GAAiBC,eAAS,CAACC,GAAV,CAAc,UAAAC,CAAC;AAAA,mBAAOA,CAAP;AAAA,CAAf,CAAjB;AACAN,8BAAU,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,M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AAA,OAAO,EAAE6B,6BAAS,CAACC,MADG;AAEtB7B,EAAAA,UAAU,EAAE4B,6BAAS,CAACE,IAFA;AAGtBV,EAAAA,WAAW,EAAEQ,6BAAS,CAACC,MAAV,CAAiBE,UAHR;AAItBtB,EAAAA,UAAU,EAAEmB,6BAAS,CAACE,IAJA;AAKtB7B,EAAAA,mBAAmB,EAAE2B,6BAAS,CAACE;AALT,CAAxB;AAQAjC,WAAW,CAACmC,YAAZ,GAA2B;AACzBjC,EAAAA,OAAO,EAAE,EADgB;AAEzBC,EAAAA,UAAU,EAAE,sBAAM,EAFO;AAGzBS,EAAAA,UAAU,EAAE,sBAAM,EAHO;AAIzBR,EAAAA,mBAAmB,EAAE,+BAAM;AAJF,CAA3B;;;;"}
@@ -21,6 +21,10 @@
21
21
  height: 100vh !important;
22
22
  }
23
23
  .jfReport.printMode .jfReport-viewport {
24
+ * {
25
+ overflow: hidden !important;
26
+ }
27
+
24
28
  display: block;
25
29
  }
26
30
  .jfReport.printMode .jfReport-col {
@@ -66,9 +66,11 @@ var QuillEditor = /*#__PURE__*/function (_React$PureComponent) {
66
66
  }
67
67
  });
68
68
 
69
- _defineProperty(_assertThisInitialized(_this), "handleSetContent", function (value) {
70
- var setContent = _this.props.setContent;
71
- setContent(domPurify.sanitize(value));
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 setContent(domPurify.sanitize(value));\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","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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ditor.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,UAAR;AACAA,QAAAA,UAAU,CAACC,SAAS,CAACC,QAAV,CAAmBL,KAAnB,CAAD,CAAV;AACD;AACF,K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AAAA,UAAU,EAAEmB,SAAS,CAACE,IAJA;AAKtB7B,EAAAA,mBAAmB,EAAE2B,SAAS,CAACE;AALT,CAAxB;AAQAjC,WAAW,CAACmC,YAAZ,GAA2B;AACzBjC,EAAAA,OAAO,EAAE,EADgB;AAEzBC,EAAAA,UAAU,EAAE,sBAAM,EAFO;AAGzBS,EAAAA,UAAU,EAAE,sBAAM,EAHO;AAIzBR,EAAAA,mBAAmB,EAAE,+BAAM;AAJF,CAA3B;;;;"}
@@ -21,6 +21,10 @@
21
21
  height: 100vh !important;
22
22
  }
23
23
  .jfReport.printMode .jfReport-viewport {
24
+ * {
25
+ overflow: hidden !important;
26
+ }
27
+
24
28
  display: block;
25
29
  }
26
30
  .jfReport.printMode .jfReport-col {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jotforminc/dnd-builder",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "files": [
5
5
  "lib"
6
6
  ],