PluginProbe
Extendify / 1.9.0
Extendify v1.9.0
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Draft / components / Completion.js

Completion.js in Extendify 1.9.0, at src/Draft/components/Completion.js

21 lines 677 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { serialize, pasteHandler } from '@wordpress/blocks'
2 import { useRef } from '@wordpress/element'
3
4 export const Completion = ({ completion }) => {
5 const blocks = pasteHandler({ plainText: completion })
6 const ref = useRef()
7
8 return (
9 <div
10 ref={ref}
11 style={{ fontSize: 'clamp(1em 1em 1em)' }}
12 className="completion relative px-5 pt-4 break-words max-h-60 overflow-y-auto">
13 {Array.isArray(blocks) ? (
14 <div dangerouslySetInnerHTML={{ __html: serialize(blocks) }} />
15 ) : (
16 <div dangerouslySetInnerHTML={{ __html: blocks }} />
17 )}
18 </div>
19 )
20 }
21