X7ROOT File Manager
Current Path:
/home/okeydcqc/.trash/wp-content/plugins/extendify/src/Draft/hooks
home
/
okeydcqc
/
.trash
/
wp-content
/
plugins
/
extendify
/
src
/
Draft
/
hooks
/
ðŸ“
..
📄
useCompletion.js
(1.37 KB)
📄
useContentHighlight.js
(705 B)
📄
useRouter.js
(2.88 KB)
📄
useSelectedText.js
(683 B)
📄
useUnsplashImages.js
(650 B)
Editing: useContentHighlight.js
import { useDispatch, useSelect } from '@wordpress/data'; export const useContentHighlight = () => { const { getBlockInsertionPoint } = useSelect( (select) => select('core/block-editor'), [], ); const { toggleBlockHighlight, showInsertionPoint, hideInsertionPoint } = useDispatch('core/block-editor'); const toggleHighlight = (clientIds, { isHighlighted }) => { toggleBlockHighlight(clientIds[0], isHighlighted); }; const toggleInsertionPoint = ({ isVisible }) => { if (!isVisible) { hideInsertionPoint(); return; } const { rootClientId, index } = getBlockInsertionPoint(); showInsertionPoint(rootClientId, index); }; return { toggleHighlight, toggleInsertionPoint }; };
Upload File
Create Folder