tetrons 2.1.9 → 2.2.1

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.
@@ -29,24 +29,24 @@ export default function TableContextMenu({ editor }) {
29
29
  const deleteCol = () => editor.chain().focus().deleteColumn().run();
30
30
  if (!menuPosition)
31
31
  return null;
32
- return (<ul className="absolute bg-white shadow border rounded text-sm z-50" style={{ top: menuPosition.y, left: menuPosition.x }}>
33
- <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertRowAbove}>
34
- Insert Row Above
35
- </li>
36
- <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertRowBelow}>
37
- Insert Row Below
38
- </li>
39
- <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertColLeft}>
40
- Insert Column Left
41
- </li>
42
- <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertColRight}>
43
- Insert Column Right
44
- </li>
45
- <li className="px-3 py-1 hover:bg-red-100 cursor-pointer" onClick={deleteRow}>
46
- Delete Row
47
- </li>
48
- <li className="px-3 py-1 hover:bg-red-100 cursor-pointer" onClick={deleteCol}>
49
- Delete Column
50
- </li>
32
+ return (<ul className="absolute bg-white shadow border rounded text-sm z-50" style={{ top: menuPosition.y, left: menuPosition.x }}>
33
+ <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertRowAbove}>
34
+ Insert Row Above
35
+ </li>
36
+ <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertRowBelow}>
37
+ Insert Row Below
38
+ </li>
39
+ <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertColLeft}>
40
+ Insert Column Left
41
+ </li>
42
+ <li className="px-3 py-1 hover:bg-gray-100 cursor-pointer" onClick={insertColRight}>
43
+ Insert Column Right
44
+ </li>
45
+ <li className="px-3 py-1 hover:bg-red-100 cursor-pointer" onClick={deleteRow}>
46
+ Delete Row
47
+ </li>
48
+ <li className="px-3 py-1 hover:bg-red-100 cursor-pointer" onClick={deleteCol}>
49
+ Delete Column
50
+ </li>
51
51
  </ul>);
52
52
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React, { useState, useEffect } from "react";
2
+ import React, { useEffect } from "react";
3
3
  import ActionGroup from "./ActionGroup";
4
4
  import ClipboardGroup from "./ClipboardGroup";
5
5
  import FontStyleGroup from "./FontStyleGroup";
@@ -8,7 +8,7 @@ import ListAlignGroup from "./ListAlignGroup";
8
8
  import MiscGroup from "./MiscGroup";
9
9
  import FileGroup from "./FileGroup";
10
10
  export default function TetronsToolbar({ editor }) {
11
- const [autoSave, setAutoSave] = useState(false);
11
+ const [autoSave, setAutoSave] = React.useState(false);
12
12
  useEffect(() => {
13
13
  if (!editor)
14
14
  return;
@@ -27,20 +27,20 @@ export default function TetronsToolbar({ editor }) {
27
27
  editor.off("update", handleUpdate);
28
28
  };
29
29
  }, [autoSave, editor]);
30
- return (<div className="flex flex-wrap items-center gap-4 p-3 border-b bg-white shadow-sm relative z-10">
31
- <div className="flex items-center gap-2 border-r pr-3">
32
- <input type="checkbox" id="autoSave" checked={autoSave} onChange={(e) => setAutoSave(e.target.checked)} className="w-4 h-4"/>
33
- <label htmlFor="autoSave" className="text-sm select-none">
34
- Auto Save
35
- </label>
36
- </div>
37
-
38
- <FileGroup editor={editor}/>
39
- <ClipboardGroup editor={editor}/>
40
- <FontStyleGroup editor={editor}/>
41
- <ListAlignGroup editor={editor}/>
42
- <InsertGroup editor={editor}/>
43
- <MiscGroup editor={editor}/>
44
- <ActionGroup editor={editor}/>
30
+ return (<div className="flex flex-wrap items-center gap-4 p-3 border-b bg-white shadow-sm relative z-10">
31
+ <div className="flex items-center gap-2 border-r pr-3">
32
+ <input type="checkbox" id="autoSave" checked={autoSave} onChange={(e) => setAutoSave(e.target.checked)} className="w-4 h-4"/>
33
+ <label htmlFor="autoSave" className="text-sm select-none">
34
+ Auto Save
35
+ </label>
36
+ </div>
37
+
38
+ <FileGroup editor={editor}/>
39
+ <ClipboardGroup editor={editor}/>
40
+ <FontStyleGroup editor={editor}/>
41
+ <ListAlignGroup editor={editor}/>
42
+ <InsertGroup editor={editor}/>
43
+ <MiscGroup editor={editor}/>
44
+ <ActionGroup editor={editor}/>
45
45
  </div>);
46
46
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  const ToolbarButton = React.forwardRef(({ icon: Icon, onClick, disabled = false, title, label, isActive = false }, ref) => {
3
- return (<button type="button" ref={ref} onClick={onClick} disabled={disabled} title={title !== null && title !== void 0 ? title : label} aria-label={title !== null && title !== void 0 ? title : label} className={`p-2 rounded hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed ${isActive ? "bg-gray-300" : ""}`}>
4
- <Icon size={20}/>
3
+ return (<button type="button" ref={ref} onClick={onClick} disabled={disabled} title={title !== null && title !== void 0 ? title : label} aria-label={title !== null && title !== void 0 ? title : label} className={`p-2 rounded hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed ${isActive ? "bg-gray-300" : ""}`}>
4
+ <Icon size={20}/>
5
5
  </button>);
6
6
  });
7
7
  ToolbarButton.displayName = "ToolbarButton";
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
-
3
- declare function EditorContent(): React.JSX.Element;
4
-
5
- export { EditorContent, EditorContent as default };
1
+ import React from 'react';
2
+
3
+ declare function EditorContent(): React.JSX.Element;
4
+
5
+ export { EditorContent, EditorContent as default };