@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.
Files changed (2) hide show
  1. package/dist/index.js +81 -73
  2. 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("div", { className: "ui-block-editor-handle", style: { insetBlockStart: block.top }, children: [
786
- /* @__PURE__ */ jsx2(
787
- Button,
788
- {
789
- size: "icon-xs",
790
- variant: "ghost",
791
- "aria-label": label("addBlock"),
792
- onMouseDown: (event) => event.preventDefault(),
793
- onClick: () => onAddBelow(block.start),
794
- children: /* @__PURE__ */ jsx2(Plus, {})
795
- }
796
- ),
797
- /* @__PURE__ */ jsxs(
798
- DropdownMenu,
799
- {
800
- open: menuOpen,
801
- onOpenChange: (open) => {
802
- setMenuOpen(open);
803
- if (open) pinned.current = block.start;
804
- else pinned.current = null;
805
- },
806
- children: [
807
- /* @__PURE__ */ jsx2(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
808
- Button,
809
- {
810
- size: "icon-xs",
811
- variant: "ghost",
812
- "aria-label": label("dragHandle"),
813
- draggable: true,
814
- onDragStart: (event) => startBlockDrag(editor, block.start, event.nativeEvent),
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
- onSelect: run(() => {
826
- focusBlock(editor, start);
827
- command.run(editor);
828
- }),
829
- children: [
830
- /* @__PURE__ */ jsx2("span", { className: "ui-block-editor-menu-icon", "aria-hidden": "true", children: command.icon }),
831
- command.label
832
- ]
833
- },
834
- command.key
835
- )) })
836
- ] }),
837
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => duplicateBlock(editor, start)), children: [
838
- /* @__PURE__ */ jsx2(Copy, { "aria-hidden": "true" }),
839
- label("duplicate")
840
- ] }),
841
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => void moveBlock(editor, start, -1)), children: [
842
- /* @__PURE__ */ jsx2(ArrowUp, { "aria-hidden": "true" }),
843
- label("moveUp")
844
- ] }),
845
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: run(() => void moveBlock(editor, start, 1)), children: [
846
- /* @__PURE__ */ jsx2(ArrowDown, { "aria-hidden": "true" }),
847
- label("moveDown")
848
- ] }),
849
- /* @__PURE__ */ jsx2(DropdownMenuSeparator, {}),
850
- /* @__PURE__ */ jsxs(DropdownMenuItem, { variant: "destructive", onSelect: run(() => deleteBlock(editor, start)), children: [
851
- /* @__PURE__ */ jsx2(Trash2, { "aria-hidden": "true" }),
852
- label("delete")
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.7.2",
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.7.2",
49
- "@godxjp/ui": "~32.7.2",
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
  },