Skip to content

Commit

Permalink
Fix primefaces#5960: Quill 2.0.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 20, 2024
1 parent 4d4a214 commit 763d692
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 73 deletions.
3 changes: 1 addition & 2 deletions components/doc/editor/accessibilitydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export function AccessibilityDoc() {
return (
<DocSectionText id="accessibility" label="Accessibility">
<p>
Quill performs generally well in terms of accessibility. The elements in the toolbar can be tabbed and have the necessary ARIA roles/attributes for screen readers. One known limitation is the lack of arrow key support for{' '}
<a href="https://github.com/quilljs/quill/issues/1031">dropdowns</a> in the toolbar that may be overcome with a custom toolbar.
Quill performs generally well in terms of accessibility. The elements in the toolbar can be tabbed and have the necessary ARIA roles/attributes for screen readers.
</p>
</DocSectionText>
);
Expand Down
2 changes: 1 addition & 1 deletion components/doc/editor/basicdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function BasicDemo() {
<div className="card">
<Editor value={text} onTextChange={(e) => setText(e.htmlValue)} style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/readonlydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ReadOnlyDemo() {
<div className="card">
<Editor value="Always bet on Prime!" readOnly style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/templatedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function TemplateDemo() {
<div className="card">
<Editor value={text} onTextChange={(e) => setText(e.htmlValue)} headerTemplate={header} style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function UnstyledDemo() {
</p>
<DocSectionCode code={code} hideToggleCode import hideStackBlitz />
<p>A playground sample with the pre-built Tailwind theme.</p>
<DocSectionCode code={code2} embedded dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code2} embedded dependencies={{ quill: '2.0.0' }} />
</DocSectionText>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions components/lib/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const Editor = React.memo(
quill.current = quillInstance;

if (props.value) {
quill.current.setContents(quill.current.clipboard.convert(props.value));
quill.current.clipboard.dangerouslyPasteHTML(props.value);
}

setQuillCreated(true);
Expand Down Expand Up @@ -151,7 +151,7 @@ export const Editor = React.memo(

useUpdateEffect(() => {
if (quill.current && !quill.current.hasFocus()) {
props.value ? quill.current.setContents(quill.current.clipboard.convert(props.value)) : quill.current.setText('');
props.value ? quill.current.clipboard.dangerouslyPasteHTML(props.value) : quill.current.setText('');
}
}, [props.value]);

Expand Down
128 changes: 64 additions & 64 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"path": "^0.12.7",
"primeflex": "^3.3.1",
"primeicons": "^7.0.0",
"quill": "1.3.7",
"quill": "2.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-transition-group": "^4.4.5",
Expand Down

0 comments on commit 763d692

Please sign in to comment.