@udecode/plate-utils
Advanced tools
Comparing version 24.3.6 to 24.4.0
@@ -107,3 +107,4 @@ import * as React$1 from 'react'; | ||
pressed: boolean; | ||
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void; | ||
onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => void; | ||
onClick: () => void; | ||
}; | ||
@@ -144,2 +145,3 @@ }; | ||
props: { | ||
onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => void; | ||
onClick: () => void; | ||
@@ -146,0 +148,0 @@ }; |
@@ -256,3 +256,2 @@ "use strict"; | ||
var import_plate_core = require("@udecode/plate-core"); | ||
var import_slate_react = require("@udecode/slate-react"); | ||
var import_slate_utils = require("@udecode/slate-utils"); | ||
@@ -276,7 +275,7 @@ var useMarkToolbarButtonState = ({ | ||
pressed: state.pressed, | ||
onClick: (e) => { | ||
onMouseDown: (e) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}, | ||
onClick: () => { | ||
(0, import_slate_utils.toggleMark)(editor, { key: state.nodeType, clear: state.clear }); | ||
(0, import_slate_react.focusEditor)(editor); | ||
} | ||
@@ -400,4 +399,4 @@ } | ||
var import_slate = require("@udecode/slate"); | ||
var import_slate_react2 = require("@udecode/slate-react"); | ||
var import_slate_react3 = require("slate-react"); | ||
var import_slate_react = require("@udecode/slate-react"); | ||
var import_slate_react2 = require("slate-react"); | ||
var usePlaceholderState = ({ | ||
@@ -408,7 +407,7 @@ hideOnBlur = true, | ||
}) => { | ||
const focused = (0, import_slate_react3.useFocused)(); | ||
const selected = (0, import_slate_react3.useSelected)(); | ||
const focused = (0, import_slate_react2.useFocused)(); | ||
const selected = (0, import_slate_react2.useSelected)(); | ||
const editor = (0, import_plate_core2.useEditorState)(); | ||
const isEmptyBlock = (0, import_slate.isElementEmpty)(editor, element); | ||
const enabled = isEmptyBlock && (!query || (0, import_slate.queryNode)([element, (0, import_slate_react2.findNodePath)(editor, element)], query)) && (!hideOnBlur || (0, import_slate.isCollapsed)(editor.selection) && hideOnBlur && focused && selected); | ||
const enabled = isEmptyBlock && (!query || (0, import_slate.queryNode)([element, (0, import_slate_react.findNodePath)(editor, element)], query)) && (!hideOnBlur || (0, import_slate.isCollapsed)(editor.selection) && hideOnBlur && focused && selected); | ||
return { | ||
@@ -422,3 +421,3 @@ enabled | ||
var import_slate2 = require("@udecode/slate"); | ||
var import_slate_react4 = require("@udecode/slate-react"); | ||
var import_slate_react3 = require("@udecode/slate-react"); | ||
var useRemoveNodeButton = ({ element }) => { | ||
@@ -428,6 +427,8 @@ const editor = (0, import_plate_core3.useEditorRef)(); | ||
props: { | ||
onMouseDown: (e) => { | ||
e.preventDefault(); | ||
}, | ||
onClick: () => { | ||
const path = (0, import_slate_react4.findNodePath)(editor, element); | ||
const path = (0, import_slate_react3.findNodePath)(editor, element); | ||
(0, import_slate2.removeNodes)(editor, { at: path }); | ||
(0, import_slate_react4.focusEditor)(editor, editor.selection); | ||
} | ||
@@ -600,6 +601,6 @@ } | ||
var import_slate3 = require("@udecode/slate"); | ||
var import_slate_react5 = require("@udecode/slate-react"); | ||
var import_slate_react4 = require("@udecode/slate-react"); | ||
var selectEditor = (editor, { at, edge, focus }) => { | ||
if (focus) { | ||
(0, import_slate_react5.focusEditor)(editor); | ||
(0, import_slate_react4.focusEditor)(editor); | ||
} | ||
@@ -606,0 +607,0 @@ let location = at; |
{ | ||
"name": "@udecode/plate-utils", | ||
"version": "24.3.6", | ||
"version": "24.4.0", | ||
"description": "Plate utils", | ||
@@ -43,5 +43,5 @@ "license": "MIT", | ||
"@radix-ui/react-slot": "^1.0.2", | ||
"@udecode/plate-core": "24.3.6", | ||
"@udecode/plate-core": "24.4.0", | ||
"@udecode/slate": "24.3.6", | ||
"@udecode/slate-react": "24.3.6", | ||
"@udecode/slate-react": "24.4.0", | ||
"@udecode/slate-utils": "24.3.6", | ||
@@ -58,3 +58,3 @@ "@udecode/utils": "24.3.0", | ||
"slate-hyperscript": ">=0.66.0", | ||
"slate-react": ">=0.95.0" | ||
"slate-react": ">=0.99.0" | ||
}, | ||
@@ -61,0 +61,0 @@ "keywords": [ |
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
1440
137990
+ Added@udecode/plate-core@24.4.0(transitive)
+ Added@udecode/slate-react@24.4.0(transitive)
- Removed@udecode/plate-core@24.3.6(transitive)
- Removed@udecode/slate-react@24.3.6(transitive)
Updated@udecode/plate-core@24.4.0
Updated@udecode/slate-react@24.4.0