|
|
@@ -12,6 +12,8 @@ import { useCodeMirrorViewContext } from '../../codemirror-editor'
|
|
|
import Modal, { useBulkActionsModal } from '../entries/bulk-actions-entry/modal'
|
|
|
import getMeta from '../../../../../utils/meta'
|
|
|
import useScopeValue from '../../../../../shared/hooks/use-scope-value'
|
|
|
+import useScopeEventListener from '@/shared/hooks/use-scope-event-listener'
|
|
|
+import { useCallback } from 'react'
|
|
|
|
|
|
function EditorWidgets() {
|
|
|
const { t } = useTranslation()
|
|
|
@@ -54,6 +56,13 @@ function EditorWidgets() {
|
|
|
}, 0)
|
|
|
}
|
|
|
|
|
|
+ useScopeEventListener(
|
|
|
+ 'comment:start_adding',
|
|
|
+ useCallback(() => {
|
|
|
+ setIsAddingComment(true)
|
|
|
+ }, [setIsAddingComment])
|
|
|
+ )
|
|
|
+
|
|
|
return ReactDOM.createPortal(
|
|
|
<>
|
|
|
<div className="rp-in-editor-widgets react-rp-in-editor-widgets">
|