@udecode/plate-toolbar
Advanced tools
Comparing version 5.0.0 to 5.0.1
# @udecode/plate-toolbar | ||
## 5.0.1 | ||
### Patch Changes | ||
- [#1103](https://github.com/udecode/plate/pull/1103) [`53d13cbc`](https://github.com/udecode/plate/commit/53d13cbcfc7af26040cb86182a7ea0ba9ae5abec) Thanks [@zbeyens](https://github.com/zbeyens)! - fix infinite loop happening when selecting text with the balloon toolbar | ||
- Updated dependencies [[`53d13cbc`](https://github.com/udecode/plate/commit/53d13cbcfc7af26040cb86182a7ea0ba9ae5abec), [`53d13cbc`](https://github.com/udecode/plate/commit/53d13cbcfc7af26040cb86182a7ea0ba9ae5abec)]: | ||
- @udecode/plate-popper@5.0.1 | ||
## 5.0.0 | ||
@@ -4,0 +13,0 @@ |
@@ -84,2 +84,4 @@ import { createStyles, PortalBody } from '@udecode/plate-styled-components'; | ||
const useBalloonToolbarPopper = options => { | ||
var _selectionText$length; | ||
const editor = useStoreEditorState(useEventEditorId('focus')); | ||
@@ -106,7 +108,9 @@ const [isHidden, setIsHidden] = useState(true); | ||
}); | ||
const selectionTextLength = (_selectionText$length = selectionText === null || selectionText === void 0 ? void 0 : selectionText.length) !== null && _selectionText$length !== void 0 ? _selectionText$length : 0; | ||
const { | ||
update | ||
} = popperResult; | ||
useEffect(() => { | ||
var _popperResult$update; | ||
selectionExpanded && ((_popperResult$update = popperResult.update) === null || _popperResult$update === void 0 ? void 0 : _popperResult$update.call(popperResult)); | ||
}, [selectionText === null || selectionText === void 0 ? void 0 : selectionText.length, selectionExpanded, popperResult, selectionText]); | ||
selectionTextLength > 0 && (update === null || update === void 0 ? void 0 : update()); | ||
}, [selectionTextLength, update]); | ||
return popperResult; | ||
@@ -113,0 +117,0 @@ }; |
@@ -113,2 +113,4 @@ 'use strict'; | ||
const useBalloonToolbarPopper = options => { | ||
var _selectionText$length; | ||
const editor = plateCore.useStoreEditorState(plateCore.useEventEditorId('focus')); | ||
@@ -135,7 +137,9 @@ const [isHidden, setIsHidden] = React.useState(true); | ||
}); | ||
const selectionTextLength = (_selectionText$length = selectionText === null || selectionText === void 0 ? void 0 : selectionText.length) !== null && _selectionText$length !== void 0 ? _selectionText$length : 0; | ||
const { | ||
update | ||
} = popperResult; | ||
React.useEffect(() => { | ||
var _popperResult$update; | ||
selectionExpanded && ((_popperResult$update = popperResult.update) === null || _popperResult$update === void 0 ? void 0 : _popperResult$update.call(popperResult)); | ||
}, [selectionText === null || selectionText === void 0 ? void 0 : selectionText.length, selectionExpanded, popperResult, selectionText]); | ||
selectionTextLength > 0 && (update === null || update === void 0 ? void 0 : update()); | ||
}, [selectionTextLength, update]); | ||
return popperResult; | ||
@@ -142,0 +146,0 @@ }; |
{ | ||
"name": "@udecode/plate-toolbar", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Toolbar UI for Plate", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"react-popper": "^2.2.4", | ||
"@udecode/plate-popper": "5.0.0", | ||
"@udecode/plate-popper": "5.0.1", | ||
"@udecode/plate-styled-components": "4.4.0", | ||
@@ -42,0 +42,0 @@ "react-use": "^17.1.1" |
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
102642
914
+ Added@udecode/plate-popper@5.0.1(transitive)
- Removed@udecode/plate-popper@5.0.0(transitive)
Updated@udecode/plate-popper@5.0.1