@godxjp/block-editor 32.7.2 → 32.9.0
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/index.js +81 -73
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -782,80 +782,88 @@ function BlockHandle({
|
|
|
782
782
|
action();
|
|
783
783
|
pinned.current = null;
|
|
784
784
|
};
|
|
785
|
-
return /* @__PURE__ */ jsxs(
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
children: /* @__PURE__ */ jsx2(GripVertical, {})
|
|
816
|
-
}
|
|
817
|
-
) }),
|
|
818
|
-
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", "aria-label": label("blockActions"), children: [
|
|
819
|
-
/* @__PURE__ */ jsx2(DropdownMenuLabel, { children: label("blockActions") }),
|
|
820
|
-
/* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
821
|
-
/* @__PURE__ */ jsx2(DropdownMenuSubTrigger, { children: label("turnInto") }),
|
|
822
|
-
/* @__PURE__ */ jsx2(DropdownMenuSubContent, { children: turnInto.map((command) => /* @__PURE__ */ jsxs(
|
|
823
|
-
DropdownMenuItem,
|
|
785
|
+
return /* @__PURE__ */ jsxs(
|
|
786
|
+
"div",
|
|
787
|
+
{
|
|
788
|
+
className: "ui-block-editor-handle",
|
|
789
|
+
"data-first-block": block.start === 0 ? "" : void 0,
|
|
790
|
+
style: { insetBlockStart: block.top },
|
|
791
|
+
children: [
|
|
792
|
+
/* @__PURE__ */ jsx2(
|
|
793
|
+
Button,
|
|
794
|
+
{
|
|
795
|
+
size: "icon-xs",
|
|
796
|
+
variant: "ghost",
|
|
797
|
+
"aria-label": label("addBlock"),
|
|
798
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
799
|
+
onClick: () => onAddBelow(block.start),
|
|
800
|
+
children: /* @__PURE__ */ jsx2(Plus, {})
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
/* @__PURE__ */ jsxs(
|
|
804
|
+
DropdownMenu,
|
|
805
|
+
{
|
|
806
|
+
open: menuOpen,
|
|
807
|
+
onOpenChange: (open) => {
|
|
808
|
+
setMenuOpen(open);
|
|
809
|
+
if (open) pinned.current = block.start;
|
|
810
|
+
else pinned.current = null;
|
|
811
|
+
},
|
|
812
|
+
children: [
|
|
813
|
+
/* @__PURE__ */ jsx2(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
814
|
+
Button,
|
|
824
815
|
{
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
816
|
+
size: "icon-xs",
|
|
817
|
+
variant: "ghost",
|
|
818
|
+
"aria-label": label("dragHandle"),
|
|
819
|
+
draggable: true,
|
|
820
|
+
onDragStart: (event) => startBlockDrag(editor, block.start, event.nativeEvent),
|
|
821
|
+
children: /* @__PURE__ */ jsx2(GripVertical, {})
|
|
822
|
+
}
|
|
823
|
+
) }),
|
|
824
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", "aria-label": label("blockActions"), children: [
|
|
825
|
+
/* @__PURE__ */ jsx2(DropdownMenuLabel, { children: label("blockActions") }),
|
|
826
|
+
/* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
827
|
+
/* @__PURE__ */ jsx2(DropdownMenuSubTrigger, { children: label("turnInto") }),
|
|
828
|
+
/* @__PURE__ */ jsx2(DropdownMenuSubContent, { children: turnInto.map((command) => /* @__PURE__ */ jsxs(
|
|
829
|
+
DropdownMenuItem,
|
|
830
|
+
{
|
|
831
|
+
onSelect: run(() => {
|
|
832
|
+
focusBlock(editor, start);
|
|
833
|
+
command.run(editor);
|
|
834
|
+
}),
|
|
835
|
+
children: [
|
|
836
|
+
/* @__PURE__ */ jsx2("span", { className: "ui-block-editor-menu-icon", "aria-hidden": "true", children: command.icon }),
|
|
837
|
+
command.label
|
|
838
|
+
]
|
|
839
|
+
},
|
|
840
|
+
command.key
|
|
841
|
+
)) })
|
|
842
|
+
] }),
|
|
843
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => duplicateBlock(editor, start)), children: [
|
|
844
|
+
/* @__PURE__ */ jsx2(Copy, { "aria-hidden": "true" }),
|
|
845
|
+
label("duplicate")
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => void moveBlock(editor, start, -1)), children: [
|
|
848
|
+
/* @__PURE__ */ jsx2(ArrowUp, { "aria-hidden": "true" }),
|
|
849
|
+
label("moveUp")
|
|
850
|
+
] }),
|
|
851
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => void moveBlock(editor, start, 1)), children: [
|
|
852
|
+
/* @__PURE__ */ jsx2(ArrowDown, { "aria-hidden": "true" }),
|
|
853
|
+
label("moveDown")
|
|
854
|
+
] }),
|
|
855
|
+
/* @__PURE__ */ jsx2(DropdownMenuSeparator, {}),
|
|
856
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { variant: "destructive", onSelect: run(() => deleteBlock(editor, start)), children: [
|
|
857
|
+
/* @__PURE__ */ jsx2(Trash2, { "aria-hidden": "true" }),
|
|
858
|
+
label("delete")
|
|
859
|
+
] })
|
|
860
|
+
] })
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
);
|
|
859
867
|
}
|
|
860
868
|
|
|
861
869
|
// src/messages.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/block-editor",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.9.0",
|
|
4
4
|
"description": "Block editor for GoDX apps (Notion / note.com style) on Tiptap: slash menu, block handles, floating format toolbar; reads and writes Markdown through @godxjp/markdown/codec, IME-safe, ja / en / vi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"lucide-react": "^1.37.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@godxjp/markdown": "~32.
|
|
49
|
-
"@godxjp/ui": "~32.
|
|
48
|
+
"@godxjp/markdown": "~32.9.0",
|
|
49
|
+
"@godxjp/ui": "~32.9.0",
|
|
50
50
|
"react": ">=19.0.0",
|
|
51
51
|
"react-dom": ">=19.0.0"
|
|
52
52
|
},
|