neuphlo-editor 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.cjs +6 -5
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +6 -5
- package/dist/react/index.js.map +1 -1
- package/package.json +11 -9
- package/LICENSE +0 -21
package/dist/react/index.cjs
CHANGED
|
@@ -1492,13 +1492,14 @@ function TextMenu({
|
|
|
1492
1492
|
editor,
|
|
1493
1493
|
shouldShow: ({ editor: e, state, from, to, view }) => {
|
|
1494
1494
|
if (e.isActive("imageBlock")) return false;
|
|
1495
|
+
if (e.isActive("videoBlock")) return false;
|
|
1495
1496
|
const { selection } = state;
|
|
1496
1497
|
if (selection.constructor.name === "NodeSelection") return false;
|
|
1497
1498
|
if (from === to) return false;
|
|
1498
1499
|
if (e.isActive("link")) return false;
|
|
1499
1500
|
let hasImage = false;
|
|
1500
1501
|
state.doc.nodesBetween(from, to, (node) => {
|
|
1501
|
-
if (node.type.name === "imageBlock") {
|
|
1502
|
+
if (node.type.name === "imageBlock" || node.type.name === "videoBlock") {
|
|
1502
1503
|
hasImage = true;
|
|
1503
1504
|
return false;
|
|
1504
1505
|
}
|
|
@@ -2693,12 +2694,12 @@ var VideoBlockMenu = ({ editor }) => {
|
|
|
2693
2694
|
}, [editor]);
|
|
2694
2695
|
const shouldShow = (0, import_react26.useCallback)(() => {
|
|
2695
2696
|
if (!editor) return false;
|
|
2696
|
-
const isActive = editor.isActive("videoBlock");
|
|
2697
|
-
if (!isActive) return false;
|
|
2698
2697
|
const { state } = editor;
|
|
2699
2698
|
const { selection } = state;
|
|
2700
|
-
|
|
2701
|
-
|
|
2699
|
+
if (selection.constructor.name !== "NodeSelection") return false;
|
|
2700
|
+
const node = selection.node;
|
|
2701
|
+
if (!node || node.type.name !== "videoBlock") return false;
|
|
2702
|
+
return true;
|
|
2702
2703
|
}, [editor]);
|
|
2703
2704
|
const onAlignLeft = (0, import_react26.useCallback)(() => {
|
|
2704
2705
|
editor.chain().focus(void 0, { scrollIntoView: false }).setVideoBlockAlign("left").run();
|