@udecode/plate-floating
Advanced tools
Comparing version 34.0.6 to 34.1.1
@@ -5,5 +5,3 @@ import { ClientRectObject } from '@floating-ui/core'; | ||
import React from 'react'; | ||
import * as _udecode_plate_common from '@udecode/plate-common'; | ||
import { TReactEditor } from '@udecode/plate-common'; | ||
import * as _udecode_slate from '@udecode/slate'; | ||
import { Value } from '@udecode/plate-common/server'; | ||
@@ -55,3 +53,2 @@ import { Location, Range } from 'slate'; | ||
} & FloatingToolbarState) => { | ||
editor: _udecode_plate_common.PlateEditor<_udecode_slate.Value>; | ||
editorId: string; | ||
@@ -72,3 +69,3 @@ floating: UseVirtualFloatingReturn<ReferenceType>; | ||
}; | ||
declare const useFloatingToolbar: ({ editor, editorId, floating, focusedEditorId, hideToolbar, ignoreReadOnly, mousedown, open, selectionExpanded, selectionText, setMousedown, setOpen, setWaitForCollapsedSelection, waitForCollapsedSelection, }: ReturnType<typeof useFloatingToolbarState>) => { | ||
declare const useFloatingToolbar: ({ editorId, floating, focusedEditorId, hideToolbar, ignoreReadOnly, mousedown, open, selectionExpanded, selectionText, setMousedown, setOpen, setWaitForCollapsedSelection, waitForCollapsedSelection, }: ReturnType<typeof useFloatingToolbarState>) => { | ||
hidden: boolean; | ||
@@ -75,0 +72,0 @@ props: { |
@@ -142,3 +142,2 @@ "use strict"; | ||
const focused = (0, import_slate_react.useFocused)(); | ||
const editor = (0, import_plate_common.useEditorRef)(); | ||
const [open, setOpen] = import_react.default.useState(false); | ||
@@ -158,3 +157,2 @@ const [waitForCollapsedSelection, setWaitForCollapsedSelection] = import_react.default.useState(false); | ||
return { | ||
editor, | ||
editorId, | ||
@@ -177,3 +175,2 @@ floating, | ||
var useFloatingToolbar = ({ | ||
editor, | ||
editorId, | ||
@@ -209,12 +206,9 @@ floating, | ||
import_react.default.useEffect(() => { | ||
const container = (0, import_plate_common.toDOMNode)(editor, editor); | ||
const mouseup = () => setMousedown(false); | ||
const mousedown2 = () => setMousedown(true); | ||
if (!container) | ||
return; | ||
container.addEventListener("mouseup", mouseup); | ||
document.addEventListener("mouseup", mouseup); | ||
document.addEventListener("mousedown", mousedown2); | ||
return () => { | ||
container.removeEventListener("mouseup", mouseup); | ||
container.removeEventListener("mousedown", mousedown2); | ||
document.removeEventListener("mouseup", mouseup); | ||
document.removeEventListener("mousedown", mousedown2); | ||
}; | ||
@@ -221,0 +215,0 @@ }, []); |
{ | ||
"name": "@udecode/plate-floating", | ||
"version": "34.0.6", | ||
"version": "34.1.1", | ||
"description": "Floating UI for Plate", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72807
901