tetrons 2.2.1 → 2.2.3

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 (42) hide show
  1. package/dist/app/layout.d.ts +1 -1
  2. package/dist/app/{layout.jsx → layout.js} +2 -5
  3. package/dist/app/page.d.ts +2 -2
  4. package/dist/app/page.js +6 -0
  5. package/dist/components/tetrons/EditorContent.d.ts +1 -2
  6. package/dist/components/tetrons/{EditorContent.jsx → EditorContent.js} +2 -24
  7. package/dist/components/tetrons/{ResizableImageComponent.jsx → ResizableImageComponent.js} +10 -12
  8. package/dist/components/tetrons/{ResizableVideoComponent.jsx → ResizableVideoComponent.js} +7 -8
  9. package/dist/components/tetrons/toolbar/ActionGroup.d.ts +1 -2
  10. package/dist/components/tetrons/toolbar/{ActionGroup.jsx → ActionGroup.js} +18 -39
  11. package/dist/components/tetrons/toolbar/ClipboardGroup.d.ts +1 -2
  12. package/dist/components/tetrons/toolbar/ClipboardGroup.js +31 -0
  13. package/dist/components/tetrons/toolbar/FileGroup.d.ts +1 -2
  14. package/dist/components/tetrons/toolbar/{FileGroup.jsx → FileGroup.js} +3 -6
  15. package/dist/components/tetrons/toolbar/FontStyleGroup.d.ts +1 -2
  16. package/dist/components/tetrons/toolbar/FontStyleGroup.js +63 -0
  17. package/dist/components/tetrons/toolbar/InsertGroup.d.ts +1 -2
  18. package/dist/components/tetrons/toolbar/InsertGroup.js +138 -0
  19. package/dist/components/tetrons/toolbar/ListAlignGroup.d.ts +1 -2
  20. package/dist/components/tetrons/toolbar/ListAlignGroup.js +7 -0
  21. package/dist/components/tetrons/toolbar/MiscGroup.d.ts +1 -2
  22. package/dist/components/tetrons/toolbar/MiscGroup.js +25 -0
  23. package/dist/components/tetrons/toolbar/TableContextMenu.d.ts +1 -2
  24. package/dist/components/tetrons/toolbar/{TableContextMenu.jsx → TableContextMenu.js} +3 -21
  25. package/dist/components/tetrons/toolbar/TetronsToolbar.d.ts +1 -2
  26. package/dist/components/tetrons/toolbar/{TetronsToolbar.jsx → TetronsToolbar.js} +2 -16
  27. package/dist/components/tetrons/toolbar/ToolbarButton.js +7 -0
  28. package/dist/index.d.mts +2 -2
  29. package/dist/index.js +1 -0
  30. package/dist/index.mjs +731 -638
  31. package/dist/styles/styles/tetrons.css +371 -0
  32. package/dist/styles/tetrons.css +371 -0
  33. package/package.json +7 -4
  34. package/dist/app/page.jsx +0 -8
  35. package/dist/components/tetrons/toolbar/ClipboardGroup.jsx +0 -36
  36. package/dist/components/tetrons/toolbar/FontStyleGroup.jsx +0 -104
  37. package/dist/components/tetrons/toolbar/InsertGroup.jsx +0 -162
  38. package/dist/components/tetrons/toolbar/ListAlignGroup.jsx +0 -16
  39. package/dist/components/tetrons/toolbar/MiscGroup.jsx +0 -31
  40. package/dist/components/tetrons/toolbar/ToolbarButton.jsx +0 -8
  41. /package/dist/components/UI/{Button.jsx → Button.js} +0 -0
  42. /package/dist/components/UI/{Dropdown.jsx → Dropdown.js} +0 -0
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/components/tetrons/EditorContent.tsx
2
- import React13 from "react";
2
+ import React10 from "react";
3
3
 
4
4
  // node_modules/orderedmap/dist/index.js
5
5
  function OrderedMap(content) {
@@ -14345,10 +14345,10 @@ var FontSize = Mark2.create({
14345
14345
  });
14346
14346
 
14347
14347
  // src/components/tetrons/toolbar/TetronsToolbar.tsx
14348
- import React9, { useEffect as useEffect3 } from "react";
14348
+ import React6, { useEffect as useEffect3 } from "react";
14349
14349
 
14350
14350
  // src/components/tetrons/toolbar/ActionGroup.tsx
14351
- import React2, { useEffect, useRef, useState } from "react";
14351
+ import { useEffect, useRef, useState } from "react";
14352
14352
  import {
14353
14353
  MdZoomIn,
14354
14354
  MdZoomOut,
@@ -14359,9 +14359,10 @@ import {
14359
14359
 
14360
14360
  // src/components/tetrons/toolbar/ToolbarButton.tsx
14361
14361
  import React from "react";
14362
+ import { jsx } from "react/jsx-runtime";
14362
14363
  var ToolbarButton = React.forwardRef(
14363
14364
  ({ icon: Icon, onClick, disabled = false, title, label, isActive = false }, ref) => {
14364
- return /* @__PURE__ */ React.createElement(
14365
+ return /* @__PURE__ */ jsx(
14365
14366
  "button",
14366
14367
  {
14367
14368
  type: "button",
@@ -14370,9 +14371,9 @@ var ToolbarButton = React.forwardRef(
14370
14371
  disabled,
14371
14372
  title: title ?? label,
14372
14373
  "aria-label": title ?? label,
14373
- className: `p-2 rounded hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed ${isActive ? "bg-gray-300" : ""}`
14374
- },
14375
- /* @__PURE__ */ React.createElement(Icon, { size: 20 })
14374
+ className: `toolbar-button ${isActive ? "active" : ""}`,
14375
+ children: /* @__PURE__ */ jsx(Icon, { size: 20 })
14376
+ }
14376
14377
  );
14377
14378
  }
14378
14379
  );
@@ -14380,6 +14381,7 @@ ToolbarButton.displayName = "ToolbarButton";
14380
14381
  var ToolbarButton_default = ToolbarButton;
14381
14382
 
14382
14383
  // src/components/tetrons/toolbar/ActionGroup.tsx
14384
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
14383
14385
  function ActionGroup({ editor }) {
14384
14386
  const [dropdownOpen, setDropdownOpen] = useState(false);
14385
14387
  const dropdownRef = useRef(null);
@@ -14403,9 +14405,10 @@ function ActionGroup({ editor }) {
14403
14405
  ".ProseMirror"
14404
14406
  );
14405
14407
  if (element) {
14406
- const currentZoom = parseFloat(element.style.zoom || "1");
14408
+ const style = element.style;
14409
+ const currentZoom = parseFloat(style.zoom || "1");
14407
14410
  const next = Math.min(currentZoom + 0.1, 2);
14408
- element.style.zoom = next.toString();
14411
+ style.zoom = next.toString();
14409
14412
  }
14410
14413
  };
14411
14414
  const zoomOut = () => {
@@ -14413,9 +14416,10 @@ function ActionGroup({ editor }) {
14413
14416
  ".ProseMirror"
14414
14417
  );
14415
14418
  if (element) {
14416
- const currentZoom = parseFloat(element.style.zoom || "1");
14419
+ const style = element.style;
14420
+ const currentZoom = parseFloat(style.zoom || "1");
14417
14421
  const next = Math.max(currentZoom - 0.1, 0.5);
14418
- element.style.zoom = next.toString();
14422
+ style.zoom = next.toString();
14419
14423
  }
14420
14424
  };
14421
14425
  const handlePrint = () => {
@@ -14504,64 +14508,64 @@ function ActionGroup({ editor }) {
14504
14508
  link.click();
14505
14509
  document.body.removeChild(link);
14506
14510
  };
14507
- return /* @__PURE__ */ React2.createElement(
14508
- "div",
14509
- {
14510
- className: "relative flex items-center gap-1",
14511
- role: "group",
14512
- "aria-label": "Editor actions"
14513
- },
14514
- /* @__PURE__ */ React2.createElement(ToolbarButton_default, { icon: MdZoomIn, onClick: zoomIn, title: "Zoom In" }),
14515
- /* @__PURE__ */ React2.createElement(ToolbarButton_default, { icon: MdZoomOut, onClick: zoomOut, title: "Zoom Out" }),
14516
- /* @__PURE__ */ React2.createElement(ToolbarButton_default, { icon: MdPrint, onClick: handlePrint, title: "Print" }),
14517
- /* @__PURE__ */ React2.createElement(ToolbarButton_default, { icon: MdSave, onClick: handleSave, title: "Save" }),
14518
- /* @__PURE__ */ React2.createElement("div", { className: "relative", ref: dropdownRef }, /* @__PURE__ */ React2.createElement(
14519
- "button",
14520
- {
14521
- type: "button",
14522
- onClick: () => setDropdownOpen((open) => !open),
14523
- "aria-haspopup": "menu",
14524
- "aria-expanded": dropdownOpen ? "true" : "false",
14525
- className: "flex items-center gap-1 px-2 py-1 rounded hover:bg-gray-100 focus:outline-none",
14526
- title: "Export"
14527
- },
14528
- /* @__PURE__ */ React2.createElement(MdDownload, null),
14529
- /* @__PURE__ */ React2.createElement("span", { className: "text-sm" })
14530
- ), dropdownOpen && /* @__PURE__ */ React2.createElement("div", { className: "absolute z-10 mt-2 w-40 bg-white border rounded shadow-md" }, /* @__PURE__ */ React2.createElement(
14531
- "button",
14532
- {
14533
- type: "button",
14534
- onClick: () => {
14535
- setDropdownOpen(false);
14536
- handleDownloadPDF();
14537
- },
14538
- className: "w-full text-left px-4 py-2 hover:bg-gray-100"
14539
- },
14540
- "Export as PDF"
14541
- ), /* @__PURE__ */ React2.createElement(
14542
- "button",
14543
- {
14544
- type: "button",
14545
- onClick: () => {
14546
- setDropdownOpen(false);
14547
- handleDownloadHTML();
14548
- },
14549
- className: "w-full text-left px-4 py-2 hover:bg-gray-100"
14550
- },
14551
- "Export as HTML"
14552
- ), /* @__PURE__ */ React2.createElement(
14553
- "button",
14554
- {
14555
- type: "button",
14556
- onClick: () => {
14557
- setDropdownOpen(false);
14558
- handleDownloadDOCX();
14559
- },
14560
- className: "w-full text-left px-4 py-2 hover:bg-gray-100"
14561
- },
14562
- "Export as DOCX"
14563
- )))
14564
- );
14511
+ return /* @__PURE__ */ jsxs("div", { className: "action-group", role: "group", "aria-label": "Editor actions", children: [
14512
+ /* @__PURE__ */ jsx2(ToolbarButton_default, { icon: MdZoomIn, onClick: zoomIn, title: "Zoom In" }),
14513
+ /* @__PURE__ */ jsx2(ToolbarButton_default, { icon: MdZoomOut, onClick: zoomOut, title: "Zoom Out" }),
14514
+ /* @__PURE__ */ jsx2(ToolbarButton_default, { icon: MdPrint, onClick: handlePrint, title: "Print" }),
14515
+ /* @__PURE__ */ jsx2(ToolbarButton_default, { icon: MdSave, onClick: handleSave, title: "Save" }),
14516
+ /* @__PURE__ */ jsxs("div", { className: "relative", ref: dropdownRef, children: [
14517
+ /* @__PURE__ */ jsxs(
14518
+ "button",
14519
+ {
14520
+ type: "button",
14521
+ onClick: () => setDropdownOpen((open) => !open),
14522
+ "aria-haspopup": "menu",
14523
+ "aria-expanded": dropdownOpen ? "true" : "false",
14524
+ className: "export-button",
14525
+ title: "Export",
14526
+ children: [
14527
+ /* @__PURE__ */ jsx2(MdDownload, {}),
14528
+ /* @__PURE__ */ jsx2("span", { className: "text-sm" })
14529
+ ]
14530
+ }
14531
+ ),
14532
+ dropdownOpen && /* @__PURE__ */ jsxs("div", { className: "export-dropdown", children: [
14533
+ /* @__PURE__ */ jsx2(
14534
+ "button",
14535
+ {
14536
+ type: "button",
14537
+ onClick: () => {
14538
+ setDropdownOpen(false);
14539
+ handleDownloadPDF();
14540
+ },
14541
+ children: "Export as PDF"
14542
+ }
14543
+ ),
14544
+ /* @__PURE__ */ jsx2(
14545
+ "button",
14546
+ {
14547
+ type: "button",
14548
+ onClick: () => {
14549
+ setDropdownOpen(false);
14550
+ handleDownloadHTML();
14551
+ },
14552
+ children: "Export as HTML"
14553
+ }
14554
+ ),
14555
+ /* @__PURE__ */ jsx2(
14556
+ "button",
14557
+ {
14558
+ type: "button",
14559
+ onClick: () => {
14560
+ setDropdownOpen(false);
14561
+ handleDownloadDOCX();
14562
+ },
14563
+ children: "Export as DOCX"
14564
+ }
14565
+ )
14566
+ ] })
14567
+ ] })
14568
+ ] });
14565
14569
  }
14566
14570
 
14567
14571
  // src/components/tetrons/toolbar/ClipboardGroup.tsx
@@ -14571,59 +14575,64 @@ import {
14571
14575
  MdContentCopy,
14572
14576
  MdFormatPaint
14573
14577
  } from "react-icons/md";
14574
- import React3 from "react";
14578
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
14575
14579
  function ClipboardGroup({ editor }) {
14576
- return /* @__PURE__ */ React3.createElement("div", { className: "flex gap-1 border-r pr-3" }, /* @__PURE__ */ React3.createElement(
14577
- ToolbarButton_default,
14578
- {
14579
- icon: MdContentPaste,
14580
- title: "Paste",
14581
- onClick: async () => {
14582
- try {
14583
- const text = await navigator.clipboard.readText();
14584
- editor.chain().focus().insertContent(text).run();
14585
- } catch (error) {
14586
- console.error("Failed to read clipboard contents:", error);
14580
+ return /* @__PURE__ */ jsxs2("div", { className: "clipboard-group", children: [
14581
+ /* @__PURE__ */ jsx3(
14582
+ ToolbarButton_default,
14583
+ {
14584
+ icon: MdContentPaste,
14585
+ title: "Paste",
14586
+ onClick: async () => {
14587
+ try {
14588
+ const text = await navigator.clipboard.readText();
14589
+ editor.chain().focus().insertContent(text).run();
14590
+ } catch (error) {
14591
+ console.error("Failed to read clipboard contents:", error);
14592
+ }
14587
14593
  }
14588
14594
  }
14589
- }
14590
- ), /* @__PURE__ */ React3.createElement(
14591
- ToolbarButton_default,
14592
- {
14593
- icon: MdContentCut,
14594
- title: "Cut",
14595
- onClick: () => {
14596
- const { from: from2, to } = editor.state.selection;
14597
- if (from2 === to) return;
14598
- const selectedText = editor.state.doc.textBetween(from2, to);
14599
- navigator.clipboard.writeText(selectedText).then(() => {
14600
- editor.chain().focus().deleteRange({ from: from2, to }).run();
14601
- });
14595
+ ),
14596
+ /* @__PURE__ */ jsx3(
14597
+ ToolbarButton_default,
14598
+ {
14599
+ icon: MdContentCut,
14600
+ title: "Cut",
14601
+ onClick: () => {
14602
+ const { from: from2, to } = editor.state.selection;
14603
+ if (from2 === to) return;
14604
+ const selectedText = editor.state.doc.textBetween(from2, to);
14605
+ navigator.clipboard.writeText(selectedText).then(() => {
14606
+ editor.chain().focus().deleteRange({ from: from2, to }).run();
14607
+ });
14608
+ }
14602
14609
  }
14603
- }
14604
- ), /* @__PURE__ */ React3.createElement(
14605
- ToolbarButton_default,
14606
- {
14607
- icon: MdContentCopy,
14608
- title: "Copy",
14609
- onClick: () => {
14610
- const { from: from2, to } = editor.state.selection;
14611
- if (from2 === to) return;
14612
- const selectedText = editor.state.doc.textBetween(from2, to);
14613
- navigator.clipboard.writeText(selectedText);
14610
+ ),
14611
+ /* @__PURE__ */ jsx3(
14612
+ ToolbarButton_default,
14613
+ {
14614
+ icon: MdContentCopy,
14615
+ title: "Copy",
14616
+ onClick: () => {
14617
+ const { from: from2, to } = editor.state.selection;
14618
+ if (from2 === to) return;
14619
+ const selectedText = editor.state.doc.textBetween(from2, to);
14620
+ navigator.clipboard.writeText(selectedText);
14621
+ }
14614
14622
  }
14615
- }
14616
- ), /* @__PURE__ */ React3.createElement(
14617
- ToolbarButton_default,
14618
- {
14619
- icon: MdFormatPaint,
14620
- title: "Format Painter",
14621
- onClick: () => {
14622
- const currentMarks = editor.getAttributes("textStyle");
14623
- localStorage.setItem("formatPainter", JSON.stringify(currentMarks));
14623
+ ),
14624
+ /* @__PURE__ */ jsx3(
14625
+ ToolbarButton_default,
14626
+ {
14627
+ icon: MdFormatPaint,
14628
+ title: "Format Painter",
14629
+ onClick: () => {
14630
+ const currentMarks = editor.getAttributes("textStyle");
14631
+ localStorage.setItem("formatPainter", JSON.stringify(currentMarks));
14632
+ }
14624
14633
  }
14625
- }
14626
- ));
14634
+ )
14635
+ ] });
14627
14636
  }
14628
14637
 
14629
14638
  // src/components/tetrons/toolbar/FontStyleGroup.tsx
@@ -14639,7 +14648,8 @@ import {
14639
14648
  } from "react-icons/md";
14640
14649
  import { ImTextColor } from "react-icons/im";
14641
14650
  import { BiSolidColorFill } from "react-icons/bi";
14642
- import React4, { useEffect as useEffect2, useState as useState2 } from "react";
14651
+ import { useEffect as useEffect2, useState as useState2 } from "react";
14652
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
14643
14653
  function FontStyleGroup({ editor }) {
14644
14654
  const [textColor, setTextColor] = useState2("#000000");
14645
14655
  const [highlightColor, setHighlightColor] = useState2("#ffff00");
@@ -14665,165 +14675,182 @@ function FontStyleGroup({ editor }) {
14665
14675
  editor.off("transaction", updateStates);
14666
14676
  };
14667
14677
  }, [editor]);
14668
- return /* @__PURE__ */ React4.createElement("div", { className: "flex gap-1 border-r pr-3 items-center" }, /* @__PURE__ */ React4.createElement(
14669
- "select",
14670
- {
14671
- title: "Font Family",
14672
- className: "text-sm border rounded px-1 py-0.5 mr-2",
14673
- value: fontFamily,
14674
- onChange: (e) => {
14675
- const value = e.target.value;
14676
- setFontFamily(value);
14677
- editor.chain().focus().setFontFamily(value).run();
14678
- }
14679
- },
14680
- /* @__PURE__ */ React4.createElement("option", { value: "Arial" }, "Arial"),
14681
- /* @__PURE__ */ React4.createElement("option", { value: "Georgia" }, "Georgia"),
14682
- /* @__PURE__ */ React4.createElement("option", { value: "Times New Roman" }, "Times New Roman"),
14683
- /* @__PURE__ */ React4.createElement("option", { value: "Courier New" }, "Courier New"),
14684
- /* @__PURE__ */ React4.createElement("option", { value: "Verdana" }, "Verdana")
14685
- ), /* @__PURE__ */ React4.createElement(
14686
- "select",
14687
- {
14688
- title: "Font Size",
14689
- className: "text-sm border rounded px-1 py-0.5 mr-2",
14690
- value: fontSize,
14691
- onChange: (e) => {
14692
- const value = e.target.value;
14693
- setFontSize(value);
14694
- editor.chain().focus().setFontSize(value).run();
14695
- }
14696
- },
14697
- /* @__PURE__ */ React4.createElement("option", { value: "12px" }, "12"),
14698
- /* @__PURE__ */ React4.createElement("option", { value: "14px" }, "14"),
14699
- /* @__PURE__ */ React4.createElement("option", { value: "16px" }, "16"),
14700
- /* @__PURE__ */ React4.createElement("option", { value: "18px" }, "18"),
14701
- /* @__PURE__ */ React4.createElement("option", { value: "24px" }, "24"),
14702
- /* @__PURE__ */ React4.createElement("option", { value: "36px" }, "36"),
14703
- /* @__PURE__ */ React4.createElement("option", { value: "48px" }, "48"),
14704
- /* @__PURE__ */ React4.createElement("option", { value: "64px" }, "64"),
14705
- /* @__PURE__ */ React4.createElement("option", { value: "72px" }, "72")
14706
- ), /* @__PURE__ */ React4.createElement(
14707
- ToolbarButton_default,
14708
- {
14709
- icon: MdFormatBold,
14710
- label: "Bold",
14711
- onClick: () => editor.chain().focus().toggleBold().run(),
14712
- isActive: editor.isActive("bold")
14713
- }
14714
- ), /* @__PURE__ */ React4.createElement(
14715
- ToolbarButton_default,
14716
- {
14717
- icon: MdFormatItalic,
14718
- label: "Italic",
14719
- onClick: () => editor.chain().focus().toggleItalic().run(),
14720
- isActive: editor.isActive("italic")
14721
- }
14722
- ), /* @__PURE__ */ React4.createElement(
14723
- ToolbarButton_default,
14724
- {
14725
- icon: MdFormatUnderlined,
14726
- label: "Underline",
14727
- onClick: () => editor.chain().focus().toggleUnderline().run(),
14728
- isActive: editor.isActive("underline")
14729
- }
14730
- ), /* @__PURE__ */ React4.createElement(
14731
- ToolbarButton_default,
14732
- {
14733
- icon: MdStrikethroughS,
14734
- label: "Strikethrough",
14735
- onClick: () => editor.chain().focus().toggleStrike().run(),
14736
- isActive: editor.isActive("strike")
14737
- }
14738
- ), /* @__PURE__ */ React4.createElement(
14739
- ToolbarButton_default,
14740
- {
14741
- icon: MdSubscript,
14742
- label: "Subscript",
14743
- onClick: () => editor.chain().focus().toggleSubscript().run(),
14744
- isActive: editor.isActive("subscript")
14745
- }
14746
- ), /* @__PURE__ */ React4.createElement(
14747
- ToolbarButton_default,
14748
- {
14749
- icon: MdSuperscript,
14750
- label: "Superscript",
14751
- onClick: () => editor.chain().focus().toggleSuperscript().run(),
14752
- isActive: editor.isActive("superscript")
14753
- }
14754
- ), /* @__PURE__ */ React4.createElement(
14755
- "label",
14756
- {
14757
- title: "Font Color",
14758
- "aria-label": "Font Color",
14759
- className: "relative w-8 h-8 flex items-center justify-center cursor-pointer color-label",
14760
- style: { "--indicator-color": textColor }
14761
- },
14762
- /* @__PURE__ */ React4.createElement(ImTextColor, { size: 20, className: "text-gray-700" }),
14763
- /* @__PURE__ */ React4.createElement("div", { className: "color-indicator" }),
14764
- /* @__PURE__ */ React4.createElement(
14765
- "input",
14678
+ return /* @__PURE__ */ jsxs3("div", { className: "font-style-group", children: [
14679
+ /* @__PURE__ */ jsxs3(
14680
+ "select",
14766
14681
  {
14767
- type: "color",
14768
- value: textColor,
14682
+ title: "Font Family",
14683
+ value: fontFamily,
14769
14684
  onChange: (e) => {
14770
- const color = e.target.value;
14771
- setTextColor(color);
14772
- editor.chain().focus().setColor(color).run();
14685
+ const value = e.target.value;
14686
+ setFontFamily(value);
14687
+ editor.chain().focus().setFontFamily(value).run();
14773
14688
  },
14774
- className: "absolute inset-0 opacity-0 cursor-pointer"
14689
+ children: [
14690
+ /* @__PURE__ */ jsx4("option", { value: "Arial", children: "Arial" }),
14691
+ /* @__PURE__ */ jsx4("option", { value: "Georgia", children: "Georgia" }),
14692
+ /* @__PURE__ */ jsx4("option", { value: "Times New Roman", children: "Times New Roman" }),
14693
+ /* @__PURE__ */ jsx4("option", { value: "Courier New", children: "Courier New" }),
14694
+ /* @__PURE__ */ jsx4("option", { value: "Verdana", children: "Verdana" })
14695
+ ]
14775
14696
  }
14776
- )
14777
- ), /* @__PURE__ */ React4.createElement(
14778
- "label",
14779
- {
14780
- title: "Highlight Color",
14781
- "aria-label": "Highlight Color",
14782
- className: "relative w-8 h-8 flex items-center justify-center cursor-pointer color-label",
14783
- style: { "--indicator-color": highlightColor }
14784
- },
14785
- /* @__PURE__ */ React4.createElement(BiSolidColorFill, { size: 20, className: "text-gray-700" }),
14786
- /* @__PURE__ */ React4.createElement("div", { className: "color-indicator" }),
14787
- /* @__PURE__ */ React4.createElement(
14788
- "input",
14697
+ ),
14698
+ /* @__PURE__ */ jsxs3(
14699
+ "select",
14789
14700
  {
14790
- type: "color",
14791
- value: highlightColor,
14701
+ title: "Font Size",
14702
+ value: fontSize,
14792
14703
  onChange: (e) => {
14793
- const color = e.target.value;
14794
- setHighlightColor(color);
14795
- editor.chain().focus().setHighlight({ color }).run();
14704
+ const value = e.target.value;
14705
+ setFontSize(value);
14706
+ editor.chain().focus().setFontSize(value).run();
14796
14707
  },
14797
- className: "absolute inset-0 opacity-0 cursor-pointer"
14708
+ children: [
14709
+ /* @__PURE__ */ jsx4("option", { value: "12px", children: "12" }),
14710
+ /* @__PURE__ */ jsx4("option", { value: "14px", children: "14" }),
14711
+ /* @__PURE__ */ jsx4("option", { value: "16px", children: "16" }),
14712
+ /* @__PURE__ */ jsx4("option", { value: "18px", children: "18" }),
14713
+ /* @__PURE__ */ jsx4("option", { value: "24px", children: "24" }),
14714
+ /* @__PURE__ */ jsx4("option", { value: "36px", children: "36" }),
14715
+ /* @__PURE__ */ jsx4("option", { value: "48px", children: "48" }),
14716
+ /* @__PURE__ */ jsx4("option", { value: "64px", children: "64" }),
14717
+ /* @__PURE__ */ jsx4("option", { value: "72px", children: "72" })
14718
+ ]
14798
14719
  }
14799
- )
14800
- ), /* @__PURE__ */ React4.createElement(
14801
- ToolbarButton_default,
14802
- {
14803
- icon: MdFormatClear,
14804
- label: "Clear Formatting",
14805
- onClick: () => editor.chain().focus().unsetAllMarks().run()
14806
- }
14807
- ), /* @__PURE__ */ React4.createElement(
14808
- ToolbarButton_default,
14809
- {
14810
- icon: MdFormatPaint2,
14811
- label: "Apply Painter Format",
14812
- onClick: () => {
14813
- const format = JSON.parse(
14814
- localStorage.getItem("formatPainter") || "{}"
14815
- );
14816
- if (format.color) editor.chain().focus().setColor(format.color).run();
14817
- if (format.backgroundColor) {
14818
- editor.chain().focus().setHighlight({ color: format.backgroundColor }).run();
14720
+ ),
14721
+ /* @__PURE__ */ jsx4(
14722
+ ToolbarButton_default,
14723
+ {
14724
+ icon: MdFormatBold,
14725
+ label: "Bold",
14726
+ onClick: () => editor.chain().focus().toggleBold().run(),
14727
+ isActive: editor.isActive("bold")
14728
+ }
14729
+ ),
14730
+ /* @__PURE__ */ jsx4(
14731
+ ToolbarButton_default,
14732
+ {
14733
+ icon: MdFormatItalic,
14734
+ label: "Italic",
14735
+ onClick: () => editor.chain().focus().toggleItalic().run(),
14736
+ isActive: editor.isActive("italic")
14737
+ }
14738
+ ),
14739
+ /* @__PURE__ */ jsx4(
14740
+ ToolbarButton_default,
14741
+ {
14742
+ icon: MdFormatUnderlined,
14743
+ label: "Underline",
14744
+ onClick: () => editor.chain().focus().toggleUnderline().run(),
14745
+ isActive: editor.isActive("underline")
14746
+ }
14747
+ ),
14748
+ /* @__PURE__ */ jsx4(
14749
+ ToolbarButton_default,
14750
+ {
14751
+ icon: MdStrikethroughS,
14752
+ label: "Strikethrough",
14753
+ onClick: () => editor.chain().focus().toggleStrike().run(),
14754
+ isActive: editor.isActive("strike")
14755
+ }
14756
+ ),
14757
+ /* @__PURE__ */ jsx4(
14758
+ ToolbarButton_default,
14759
+ {
14760
+ icon: MdSubscript,
14761
+ label: "Subscript",
14762
+ onClick: () => editor.chain().focus().toggleSubscript().run(),
14763
+ isActive: editor.isActive("subscript")
14764
+ }
14765
+ ),
14766
+ /* @__PURE__ */ jsx4(
14767
+ ToolbarButton_default,
14768
+ {
14769
+ icon: MdSuperscript,
14770
+ label: "Superscript",
14771
+ onClick: () => editor.chain().focus().toggleSuperscript().run(),
14772
+ isActive: editor.isActive("superscript")
14773
+ }
14774
+ ),
14775
+ /* @__PURE__ */ jsxs3(
14776
+ "label",
14777
+ {
14778
+ title: "Font Color",
14779
+ "aria-label": "Font Color",
14780
+ className: "color-label",
14781
+ style: { "--indicator-color": textColor },
14782
+ children: [
14783
+ /* @__PURE__ */ jsx4(ImTextColor, { size: 20 }),
14784
+ /* @__PURE__ */ jsx4("div", { className: "color-indicator" }),
14785
+ /* @__PURE__ */ jsx4(
14786
+ "input",
14787
+ {
14788
+ type: "color",
14789
+ value: textColor,
14790
+ onChange: (e) => {
14791
+ const color = e.target.value;
14792
+ setTextColor(color);
14793
+ editor.chain().focus().setColor(color).run();
14794
+ }
14795
+ }
14796
+ )
14797
+ ]
14798
+ }
14799
+ ),
14800
+ /* @__PURE__ */ jsxs3(
14801
+ "label",
14802
+ {
14803
+ title: "Highlight Color",
14804
+ "aria-label": "Highlight Color",
14805
+ className: "color-label",
14806
+ style: { "--indicator-color": highlightColor },
14807
+ children: [
14808
+ /* @__PURE__ */ jsx4(BiSolidColorFill, { size: 20 }),
14809
+ /* @__PURE__ */ jsx4("div", { className: "color-indicator" }),
14810
+ /* @__PURE__ */ jsx4(
14811
+ "input",
14812
+ {
14813
+ type: "color",
14814
+ value: highlightColor,
14815
+ onChange: (e) => {
14816
+ const color = e.target.value;
14817
+ setHighlightColor(color);
14818
+ editor.chain().focus().setHighlight({ color }).run();
14819
+ }
14820
+ }
14821
+ )
14822
+ ]
14823
+ }
14824
+ ),
14825
+ /* @__PURE__ */ jsx4(
14826
+ ToolbarButton_default,
14827
+ {
14828
+ icon: MdFormatClear,
14829
+ label: "Clear Formatting",
14830
+ onClick: () => editor.chain().focus().unsetAllMarks().run()
14831
+ }
14832
+ ),
14833
+ /* @__PURE__ */ jsx4(
14834
+ ToolbarButton_default,
14835
+ {
14836
+ icon: MdFormatPaint2,
14837
+ label: "Apply Painter Format",
14838
+ onClick: () => {
14839
+ const format = JSON.parse(
14840
+ localStorage.getItem("formatPainter") || "{}"
14841
+ );
14842
+ if (format.color) editor.chain().focus().setColor(format.color).run();
14843
+ if (format.backgroundColor) {
14844
+ editor.chain().focus().setHighlight({ color: format.backgroundColor }).run();
14845
+ }
14819
14846
  }
14820
14847
  }
14821
- }
14822
- ));
14848
+ )
14849
+ ] });
14823
14850
  }
14824
14851
 
14825
14852
  // src/components/tetrons/toolbar/InsertGroup.tsx
14826
- import React5, { useRef as useRef2, useState as useState3 } from "react";
14853
+ import { useRef as useRef2, useState as useState3 } from "react";
14827
14854
  import {
14828
14855
  MdTableChart,
14829
14856
  MdInsertPhoto,
@@ -14835,6 +14862,7 @@ import {
14835
14862
  MdOutlineOndemandVideo
14836
14863
  } from "react-icons/md";
14837
14864
  import Picker from "@emoji-mart/react";
14865
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
14838
14866
  function InsertGroup({ editor }) {
14839
14867
  const [showTableGrid, setShowTableGrid] = useState3(false);
14840
14868
  const [selectedRows, setSelectedRows] = useState3(1);
@@ -14910,144 +14938,165 @@ function InsertGroup({ editor }) {
14910
14938
  return url;
14911
14939
  }
14912
14940
  }
14913
- return /* @__PURE__ */ React5.createElement("div", { className: "flex gap-1 border-r pr-3 relative" }, /* @__PURE__ */ React5.createElement(
14914
- "input",
14915
- {
14916
- type: "file",
14917
- accept: "image/*",
14918
- ref: imageInputRef,
14919
- className: "hidden",
14920
- onChange: handleImageUpload,
14921
- "aria-label": "Upload Image",
14922
- title: "Upload Image"
14923
- }
14924
- ), /* @__PURE__ */ React5.createElement(
14925
- "input",
14926
- {
14927
- type: "file",
14928
- accept: "video/*",
14929
- ref: videoInputRef,
14930
- className: "hidden",
14931
- onChange: handleVideoUpload,
14932
- "aria-label": "Upload Video",
14933
- title: "Upload Video"
14934
- }
14935
- ), /* @__PURE__ */ React5.createElement(
14936
- ToolbarButton_default,
14937
- {
14938
- icon: MdTableChart,
14939
- label: "Insert Table",
14940
- onClick: () => setShowTableGrid(!showTableGrid)
14941
- }
14942
- ), showTableGrid && /* @__PURE__ */ React5.createElement(
14943
- "div",
14944
- {
14945
- className: "absolute top-10 left-0 bg-white border rounded shadow p-2 z-20",
14946
- onMouseLeave: () => setShowTableGrid(false)
14947
- },
14948
- /* @__PURE__ */ React5.createElement("div", { className: "grid grid-cols-10 gap-[1px]" }, [...Array(10)].map(
14949
- (_, row) => [...Array(10)].map((_2, col) => {
14950
- const isSelected = row < selectedRows && col < selectedCols;
14951
- return /* @__PURE__ */ React5.createElement(
14952
- "div",
14953
- {
14954
- key: `${row}-${col}`,
14955
- className: `w-5 h-5 border cursor-pointer ${isSelected ? "bg-blue-500" : "bg-gray-100"}`,
14956
- onMouseEnter: () => handleTableCellHover(row + 1, col + 1),
14957
- onClick: () => handleTableInsert(row + 1, col + 1)
14941
+ return /* @__PURE__ */ jsxs4("div", { className: "insert-group", children: [
14942
+ /* @__PURE__ */ jsx5(
14943
+ "input",
14944
+ {
14945
+ type: "file",
14946
+ accept: "image/*",
14947
+ ref: imageInputRef,
14948
+ className: "hidden-input",
14949
+ onChange: handleImageUpload,
14950
+ "aria-label": "Upload Image",
14951
+ title: "Upload Image"
14952
+ }
14953
+ ),
14954
+ /* @__PURE__ */ jsx5(
14955
+ "input",
14956
+ {
14957
+ type: "file",
14958
+ accept: "video/*",
14959
+ ref: videoInputRef,
14960
+ className: "hidden-input",
14961
+ onChange: handleVideoUpload,
14962
+ "aria-label": "Upload Video",
14963
+ title: "Upload Video"
14964
+ }
14965
+ ),
14966
+ /* @__PURE__ */ jsx5(
14967
+ ToolbarButton_default,
14968
+ {
14969
+ icon: MdTableChart,
14970
+ label: "Insert Table",
14971
+ onClick: () => setShowTableGrid(!showTableGrid)
14972
+ }
14973
+ ),
14974
+ showTableGrid && /* @__PURE__ */ jsxs4(
14975
+ "div",
14976
+ {
14977
+ className: "table-grid-popup",
14978
+ onMouseLeave: () => setShowTableGrid(false),
14979
+ children: [
14980
+ /* @__PURE__ */ jsx5("div", { className: "table-grid", children: [...Array(10)].map(
14981
+ (_, row) => [...Array(10)].map((_2, col) => {
14982
+ const isSelected = row < selectedRows && col < selectedCols;
14983
+ return /* @__PURE__ */ jsx5(
14984
+ "div",
14985
+ {
14986
+ className: `table-grid-cell ${isSelected ? "selected" : ""}`,
14987
+ onMouseEnter: () => handleTableCellHover(row + 1, col + 1),
14988
+ onClick: () => handleTableInsert(row + 1, col + 1)
14989
+ },
14990
+ `${row}-${col}`
14991
+ );
14992
+ })
14993
+ ) }),
14994
+ /* @__PURE__ */ jsxs4("div", { className: "table-grid-label", children: [
14995
+ selectedRows,
14996
+ " x ",
14997
+ selectedCols
14998
+ ] })
14999
+ ]
15000
+ }
15001
+ ),
15002
+ /* @__PURE__ */ jsx5(
15003
+ ToolbarButton_default,
15004
+ {
15005
+ icon: MdInsertPhoto,
15006
+ label: "Insert Image",
15007
+ onClick: () => imageInputRef.current?.click()
15008
+ }
15009
+ ),
15010
+ /* @__PURE__ */ jsx5(
15011
+ ToolbarButton_default,
15012
+ {
15013
+ icon: MdVideoLibrary,
15014
+ label: "Insert Video",
15015
+ onClick: () => videoInputRef.current?.click()
15016
+ }
15017
+ ),
15018
+ /* @__PURE__ */ jsx5(
15019
+ ToolbarButton_default,
15020
+ {
15021
+ icon: MdInsertLink,
15022
+ label: "Insert Link",
15023
+ onClick: () => {
15024
+ const url = prompt("Enter URL");
15025
+ if (url) {
15026
+ editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
14958
15027
  }
14959
- );
14960
- })
14961
- )),
14962
- /* @__PURE__ */ React5.createElement("div", { className: "text-sm mt-2 text-center text-gray-600" }, selectedRows, " x ", selectedCols)
14963
- ), /* @__PURE__ */ React5.createElement(
14964
- ToolbarButton_default,
14965
- {
14966
- icon: MdInsertPhoto,
14967
- label: "Insert Image",
14968
- onClick: () => imageInputRef.current?.click()
14969
- }
14970
- ), /* @__PURE__ */ React5.createElement(
14971
- ToolbarButton_default,
14972
- {
14973
- icon: MdVideoLibrary,
14974
- label: "Insert Video",
14975
- onClick: () => videoInputRef.current?.click()
14976
- }
14977
- ), /* @__PURE__ */ React5.createElement(
14978
- ToolbarButton_default,
14979
- {
14980
- icon: MdInsertLink,
14981
- label: "Insert Link",
14982
- onClick: () => {
14983
- const url = prompt("Enter URL");
14984
- if (url)
14985
- editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
15028
+ }
14986
15029
  }
14987
- }
14988
- ), /* @__PURE__ */ React5.createElement(
14989
- ToolbarButton_default,
14990
- {
14991
- icon: MdInsertComment,
14992
- label: "Insert Comment",
14993
- onClick: () => {
14994
- const comment = prompt("Enter your comment");
14995
- if (comment && editor.can().chain().focus().setComment(comment).run()) {
14996
- editor.chain().focus().setComment(comment).run();
14997
- } else {
14998
- console.warn("Cannot apply comment \u2014 maybe no selection?");
15030
+ ),
15031
+ /* @__PURE__ */ jsx5(
15032
+ ToolbarButton_default,
15033
+ {
15034
+ icon: MdInsertComment,
15035
+ label: "Insert Comment",
15036
+ onClick: () => {
15037
+ const comment = prompt("Enter your comment");
15038
+ if (comment && editor.can().chain().focus().setComment(comment).run()) {
15039
+ editor.chain().focus().setComment(comment).run();
15040
+ } else {
15041
+ console.warn("Cannot apply comment \u2014 maybe no selection?");
15042
+ }
14999
15043
  }
15000
15044
  }
15001
- }
15002
- ), /* @__PURE__ */ React5.createElement("div", { className: "relative" }, /* @__PURE__ */ React5.createElement(
15003
- ToolbarButton_default,
15004
- {
15005
- icon: MdInsertEmoticon,
15006
- label: "Emoji",
15007
- onClick: () => setShowPicker(!showPicker)
15008
- }
15009
- ), showPicker && /* @__PURE__ */ React5.createElement("div", { className: "absolute z-50 top-10 left-0" }, /* @__PURE__ */ React5.createElement(
15010
- Picker,
15011
- {
15012
- onEmojiSelect: addEmoji,
15013
- theme: "auto",
15014
- emoji: "point_up",
15015
- showPreview: false,
15016
- showSkinTones: true,
15017
- emojiTooltip: true
15018
- }
15019
- ))), /* @__PURE__ */ React5.createElement(
15020
- ToolbarButton_default,
15021
- {
15022
- icon: MdHorizontalRule,
15023
- label: "Horizontal Line",
15024
- onClick: () => editor.chain().focus().setHorizontalRule().run()
15025
- }
15026
- ), /* @__PURE__ */ React5.createElement(
15027
- ToolbarButton_default,
15028
- {
15029
- icon: MdOutlineOndemandVideo,
15030
- label: "Embed",
15031
- onClick: () => {
15032
- const url = prompt(
15033
- "Enter embed URL (YouTube, Vimeo, Google Maps, etc.)"
15034
- );
15035
- if (!url) return;
15036
- const embedUrl = normalizeEmbedUrl(url);
15037
- const width = prompt("Enter width in pixels", "560");
15038
- const height = prompt("Enter height in pixels", "315");
15039
- editor.chain().focus().setEmbed({
15040
- src: embedUrl,
15041
- width: width ? parseInt(width) : 560,
15042
- height: height ? parseInt(height) : 315
15043
- }).run();
15045
+ ),
15046
+ /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
15047
+ /* @__PURE__ */ jsx5(
15048
+ ToolbarButton_default,
15049
+ {
15050
+ icon: MdInsertEmoticon,
15051
+ label: "Emoji",
15052
+ onClick: () => setShowPicker(!showPicker)
15053
+ }
15054
+ ),
15055
+ showPicker && /* @__PURE__ */ jsx5("div", { className: "emoji-picker", children: /* @__PURE__ */ jsx5(
15056
+ Picker,
15057
+ {
15058
+ onEmojiSelect: addEmoji,
15059
+ theme: "auto",
15060
+ emoji: "point_up",
15061
+ showPreview: false,
15062
+ showSkinTones: true,
15063
+ emojiTooltip: true
15064
+ }
15065
+ ) })
15066
+ ] }),
15067
+ /* @__PURE__ */ jsx5(
15068
+ ToolbarButton_default,
15069
+ {
15070
+ icon: MdHorizontalRule,
15071
+ label: "Horizontal Line",
15072
+ onClick: () => editor.chain().focus().setHorizontalRule().run()
15044
15073
  }
15045
- }
15046
- ));
15074
+ ),
15075
+ /* @__PURE__ */ jsx5(
15076
+ ToolbarButton_default,
15077
+ {
15078
+ icon: MdOutlineOndemandVideo,
15079
+ label: "Embed",
15080
+ onClick: () => {
15081
+ const url = prompt(
15082
+ "Enter embed URL (YouTube, Vimeo, Google Maps, etc.)"
15083
+ );
15084
+ if (!url) return;
15085
+ const embedUrl = normalizeEmbedUrl(url);
15086
+ const width = prompt("Enter width in pixels", "560");
15087
+ const height = prompt("Enter height in pixels", "315");
15088
+ editor.chain().focus().setEmbed({
15089
+ src: embedUrl,
15090
+ width: width ? parseInt(width) : 560,
15091
+ height: height ? parseInt(height) : 315
15092
+ }).run();
15093
+ }
15094
+ }
15095
+ )
15096
+ ] });
15047
15097
  }
15048
15098
 
15049
15099
  // src/components/tetrons/toolbar/ListAlignGroup.tsx
15050
- import React6 from "react";
15051
15100
  import {
15052
15101
  MdFormatListBulleted,
15053
15102
  MdFormatListNumbered,
@@ -15058,76 +15107,85 @@ import {
15058
15107
  MdFormatAlignRight,
15059
15108
  MdFormatAlignJustify
15060
15109
  } from "react-icons/md";
15110
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
15061
15111
  function ListAlignGroup({ editor }) {
15062
- return /* @__PURE__ */ React6.createElement("div", { className: "flex gap-1 border-r pr-3" }, /* @__PURE__ */ React6.createElement(
15063
- ToolbarButton_default,
15064
- {
15065
- icon: MdFormatListBulleted,
15066
- title: "Bulleted List",
15067
- onClick: () => editor.chain().focus().toggleBulletList().run(),
15068
- disabled: !editor.can().toggleBulletList()
15069
- }
15070
- ), /* @__PURE__ */ React6.createElement(
15071
- ToolbarButton_default,
15072
- {
15073
- icon: MdFormatListNumbered,
15074
- title: "Numbered List",
15075
- onClick: () => editor.chain().focus().toggleOrderedList().run(),
15076
- disabled: !editor.can().toggleOrderedList()
15077
- }
15078
- ), /* @__PURE__ */ React6.createElement(
15079
- ToolbarButton_default,
15080
- {
15081
- icon: MdFormatIndentIncrease,
15082
- title: "Increase Indent",
15083
- onClick: () => editor.chain().focus().sinkListItem("listItem").run(),
15084
- disabled: !editor.can().sinkListItem("listItem")
15085
- }
15086
- ), /* @__PURE__ */ React6.createElement(
15087
- ToolbarButton_default,
15088
- {
15089
- icon: MdFormatIndentDecrease,
15090
- title: "Decrease Indent",
15091
- onClick: () => editor.chain().focus().liftListItem("listItem").run(),
15092
- disabled: !editor.can().liftListItem("listItem")
15093
- }
15094
- ), /* @__PURE__ */ React6.createElement(
15095
- ToolbarButton_default,
15096
- {
15097
- icon: MdFormatAlignLeft,
15098
- title: "Align Left",
15099
- onClick: () => editor.chain().focus().setTextAlign("left").run(),
15100
- disabled: !editor.can().setTextAlign("left")
15101
- }
15102
- ), /* @__PURE__ */ React6.createElement(
15103
- ToolbarButton_default,
15104
- {
15105
- icon: MdFormatAlignCenter,
15106
- title: "Align Center",
15107
- onClick: () => editor.chain().focus().setTextAlign("center").run(),
15108
- disabled: !editor.can().setTextAlign("center")
15109
- }
15110
- ), /* @__PURE__ */ React6.createElement(
15111
- ToolbarButton_default,
15112
- {
15113
- icon: MdFormatAlignRight,
15114
- title: "Align Right",
15115
- onClick: () => editor.chain().focus().setTextAlign("right").run(),
15116
- disabled: !editor.can().setTextAlign("right")
15117
- }
15118
- ), /* @__PURE__ */ React6.createElement(
15119
- ToolbarButton_default,
15120
- {
15121
- icon: MdFormatAlignJustify,
15122
- title: "Justify",
15123
- onClick: () => editor.chain().focus().setTextAlign("justify").run(),
15124
- disabled: !editor.can().setTextAlign("justify")
15125
- }
15126
- ));
15112
+ return /* @__PURE__ */ jsxs5("div", { className: "list-align-group", children: [
15113
+ /* @__PURE__ */ jsx6(
15114
+ ToolbarButton_default,
15115
+ {
15116
+ icon: MdFormatListBulleted,
15117
+ title: "Bulleted List",
15118
+ onClick: () => editor.chain().focus().toggleBulletList().run(),
15119
+ disabled: !editor.can().toggleBulletList()
15120
+ }
15121
+ ),
15122
+ /* @__PURE__ */ jsx6(
15123
+ ToolbarButton_default,
15124
+ {
15125
+ icon: MdFormatListNumbered,
15126
+ title: "Numbered List",
15127
+ onClick: () => editor.chain().focus().toggleOrderedList().run(),
15128
+ disabled: !editor.can().toggleOrderedList()
15129
+ }
15130
+ ),
15131
+ /* @__PURE__ */ jsx6(
15132
+ ToolbarButton_default,
15133
+ {
15134
+ icon: MdFormatIndentIncrease,
15135
+ title: "Increase Indent",
15136
+ onClick: () => editor.chain().focus().sinkListItem("listItem").run(),
15137
+ disabled: !editor.can().sinkListItem("listItem")
15138
+ }
15139
+ ),
15140
+ /* @__PURE__ */ jsx6(
15141
+ ToolbarButton_default,
15142
+ {
15143
+ icon: MdFormatIndentDecrease,
15144
+ title: "Decrease Indent",
15145
+ onClick: () => editor.chain().focus().liftListItem("listItem").run(),
15146
+ disabled: !editor.can().liftListItem("listItem")
15147
+ }
15148
+ ),
15149
+ /* @__PURE__ */ jsx6(
15150
+ ToolbarButton_default,
15151
+ {
15152
+ icon: MdFormatAlignLeft,
15153
+ title: "Align Left",
15154
+ onClick: () => editor.chain().focus().setTextAlign("left").run(),
15155
+ disabled: !editor.can().setTextAlign("left")
15156
+ }
15157
+ ),
15158
+ /* @__PURE__ */ jsx6(
15159
+ ToolbarButton_default,
15160
+ {
15161
+ icon: MdFormatAlignCenter,
15162
+ title: "Align Center",
15163
+ onClick: () => editor.chain().focus().setTextAlign("center").run(),
15164
+ disabled: !editor.can().setTextAlign("center")
15165
+ }
15166
+ ),
15167
+ /* @__PURE__ */ jsx6(
15168
+ ToolbarButton_default,
15169
+ {
15170
+ icon: MdFormatAlignRight,
15171
+ title: "Align Right",
15172
+ onClick: () => editor.chain().focus().setTextAlign("right").run(),
15173
+ disabled: !editor.can().setTextAlign("right")
15174
+ }
15175
+ ),
15176
+ /* @__PURE__ */ jsx6(
15177
+ ToolbarButton_default,
15178
+ {
15179
+ icon: MdFormatAlignJustify,
15180
+ title: "Justify",
15181
+ onClick: () => editor.chain().focus().setTextAlign("justify").run(),
15182
+ disabled: !editor.can().setTextAlign("justify")
15183
+ }
15184
+ )
15185
+ ] });
15127
15186
  }
15128
15187
 
15129
15188
  // src/components/tetrons/toolbar/MiscGroup.tsx
15130
- import React7 from "react";
15131
15189
  import {
15132
15190
  MdUndo,
15133
15191
  MdRedo,
@@ -15135,6 +15193,7 @@ import {
15135
15193
  MdVisibility,
15136
15194
  MdCode
15137
15195
  } from "react-icons/md";
15196
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
15138
15197
  function MiscGroup({ editor }) {
15139
15198
  const handlePreview = () => {
15140
15199
  const html = editor.getHTML();
@@ -15155,51 +15214,58 @@ function MiscGroup({ editor }) {
15155
15214
  previewWindow.document.close();
15156
15215
  }
15157
15216
  };
15158
- return /* @__PURE__ */ React7.createElement("div", { className: "flex gap-1 items-center border-r pr-3" }, /* @__PURE__ */ React7.createElement(
15159
- ToolbarButton_default,
15160
- {
15161
- icon: MdUndo,
15162
- label: "Undo",
15163
- onClick: () => editor.chain().focus().undo().run(),
15164
- disabled: !editor.can().undo()
15165
- }
15166
- ), /* @__PURE__ */ React7.createElement(
15167
- ToolbarButton_default,
15168
- {
15169
- icon: MdRedo,
15170
- label: "Redo",
15171
- onClick: () => editor.chain().focus().redo().run(),
15172
- disabled: !editor.can().redo()
15173
- }
15174
- ), /* @__PURE__ */ React7.createElement(
15175
- ToolbarButton_default,
15176
- {
15177
- icon: MdRefresh,
15178
- label: "Reset Formatting",
15179
- onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run()
15180
- }
15181
- ), /* @__PURE__ */ React7.createElement(
15182
- ToolbarButton_default,
15183
- {
15184
- icon: MdCode,
15185
- label: "Toggle Code Block",
15186
- onClick: () => editor.chain().focus().toggleCodeBlock().run(),
15187
- isActive: editor.isActive("codeBlock")
15188
- }
15189
- ), /* @__PURE__ */ React7.createElement(
15190
- ToolbarButton_default,
15191
- {
15192
- icon: MdVisibility,
15193
- label: "Preview",
15194
- onClick: handlePreview
15195
- }
15196
- ));
15217
+ return /* @__PURE__ */ jsxs6("div", { className: "misc-group", children: [
15218
+ /* @__PURE__ */ jsx7(
15219
+ ToolbarButton_default,
15220
+ {
15221
+ icon: MdUndo,
15222
+ label: "Undo",
15223
+ onClick: () => editor.chain().focus().undo().run(),
15224
+ disabled: !editor.can().undo()
15225
+ }
15226
+ ),
15227
+ /* @__PURE__ */ jsx7(
15228
+ ToolbarButton_default,
15229
+ {
15230
+ icon: MdRedo,
15231
+ label: "Redo",
15232
+ onClick: () => editor.chain().focus().redo().run(),
15233
+ disabled: !editor.can().redo()
15234
+ }
15235
+ ),
15236
+ /* @__PURE__ */ jsx7(
15237
+ ToolbarButton_default,
15238
+ {
15239
+ icon: MdRefresh,
15240
+ label: "Reset Formatting",
15241
+ onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run()
15242
+ }
15243
+ ),
15244
+ /* @__PURE__ */ jsx7(
15245
+ ToolbarButton_default,
15246
+ {
15247
+ icon: MdCode,
15248
+ label: "Toggle Code Block",
15249
+ onClick: () => editor.chain().focus().toggleCodeBlock().run(),
15250
+ isActive: editor.isActive("codeBlock")
15251
+ }
15252
+ ),
15253
+ /* @__PURE__ */ jsx7(
15254
+ ToolbarButton_default,
15255
+ {
15256
+ icon: MdVisibility,
15257
+ label: "Preview",
15258
+ onClick: handlePreview
15259
+ }
15260
+ )
15261
+ ] });
15197
15262
  }
15198
15263
 
15199
15264
  // src/components/tetrons/toolbar/FileGroup.tsx
15200
15265
  import { FaRegFolderOpen } from "react-icons/fa";
15201
15266
  import { VscNewFile } from "react-icons/vsc";
15202
- import React8, { useRef as useRef3 } from "react";
15267
+ import { useRef as useRef3 } from "react";
15268
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
15203
15269
  function FileGroup({ editor }) {
15204
15270
  const fileInputRef = useRef3(null);
15205
15271
  const handleNew = () => {
@@ -15228,14 +15294,8 @@ function FileGroup({ editor }) {
15228
15294
  e.target.value = "";
15229
15295
  }
15230
15296
  };
15231
- return /* @__PURE__ */ React8.createElement(
15232
- "div",
15233
- {
15234
- className: "flex items-center gap-1 border-r pr-3",
15235
- role: "group",
15236
- "aria-label": "File actions"
15237
- },
15238
- /* @__PURE__ */ React8.createElement(
15297
+ return /* @__PURE__ */ jsxs7("div", { className: "file-group", role: "group", "aria-label": "File actions", children: [
15298
+ /* @__PURE__ */ jsx8(
15239
15299
  "input",
15240
15300
  {
15241
15301
  type: "file",
@@ -15246,8 +15306,8 @@ function FileGroup({ editor }) {
15246
15306
  "aria-label": "Open JSON file"
15247
15307
  }
15248
15308
  ),
15249
- /* @__PURE__ */ React8.createElement(ToolbarButton_default, { icon: VscNewFile, onClick: handleNew, title: "New" }),
15250
- /* @__PURE__ */ React8.createElement(
15309
+ /* @__PURE__ */ jsx8(ToolbarButton_default, { icon: VscNewFile, onClick: handleNew, title: "New" }),
15310
+ /* @__PURE__ */ jsx8(
15251
15311
  ToolbarButton_default,
15252
15312
  {
15253
15313
  icon: FaRegFolderOpen,
@@ -15255,12 +15315,13 @@ function FileGroup({ editor }) {
15255
15315
  title: "Open File"
15256
15316
  }
15257
15317
  )
15258
- );
15318
+ ] });
15259
15319
  }
15260
15320
 
15261
15321
  // src/components/tetrons/toolbar/TetronsToolbar.tsx
15322
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
15262
15323
  function TetronsToolbar({ editor }) {
15263
- const [autoSave, setAutoSave] = React9.useState(false);
15324
+ const [autoSave, setAutoSave] = React6.useState(false);
15264
15325
  useEffect3(() => {
15265
15326
  if (!editor) return;
15266
15327
  const handleUpdate = () => {
@@ -15277,16 +15338,27 @@ function TetronsToolbar({ editor }) {
15277
15338
  editor.off("update", handleUpdate);
15278
15339
  };
15279
15340
  }, [autoSave, editor]);
15280
- return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-wrap items-center gap-4 p-3 border-b bg-white shadow-sm relative z-10" }, /* @__PURE__ */ React9.createElement("div", { className: "flex items-center gap-2 border-r pr-3" }, /* @__PURE__ */ React9.createElement(
15281
- "input",
15282
- {
15283
- type: "checkbox",
15284
- id: "autoSave",
15285
- checked: autoSave,
15286
- onChange: (e) => setAutoSave(e.target.checked),
15287
- className: "w-4 h-4"
15288
- }
15289
- ), /* @__PURE__ */ React9.createElement("label", { htmlFor: "autoSave", className: "text-sm select-none" }, "Auto Save")), /* @__PURE__ */ React9.createElement(FileGroup, { editor }), /* @__PURE__ */ React9.createElement(ClipboardGroup, { editor }), /* @__PURE__ */ React9.createElement(FontStyleGroup, { editor }), /* @__PURE__ */ React9.createElement(ListAlignGroup, { editor }), /* @__PURE__ */ React9.createElement(InsertGroup, { editor }), /* @__PURE__ */ React9.createElement(MiscGroup, { editor }), /* @__PURE__ */ React9.createElement(ActionGroup, { editor }));
15341
+ return /* @__PURE__ */ jsxs8("div", { className: "tetrons-toolbar", children: [
15342
+ /* @__PURE__ */ jsxs8("div", { className: "group", children: [
15343
+ /* @__PURE__ */ jsx9(
15344
+ "input",
15345
+ {
15346
+ type: "checkbox",
15347
+ id: "autoSave",
15348
+ checked: autoSave,
15349
+ onChange: (e) => setAutoSave(e.target.checked)
15350
+ }
15351
+ ),
15352
+ /* @__PURE__ */ jsx9("label", { htmlFor: "autoSave", children: "Auto Save" })
15353
+ ] }),
15354
+ /* @__PURE__ */ jsx9(FileGroup, { editor }),
15355
+ /* @__PURE__ */ jsx9(ClipboardGroup, { editor }),
15356
+ /* @__PURE__ */ jsx9(FontStyleGroup, { editor }),
15357
+ /* @__PURE__ */ jsx9(ListAlignGroup, { editor }),
15358
+ /* @__PURE__ */ jsx9(InsertGroup, { editor }),
15359
+ /* @__PURE__ */ jsx9(MiscGroup, { editor }),
15360
+ /* @__PURE__ */ jsx9(ActionGroup, { editor })
15361
+ ] });
15290
15362
  }
15291
15363
 
15292
15364
  // src/components/tetrons/ResizableImage.ts
@@ -15294,8 +15366,9 @@ import Image from "@tiptap/extension-image";
15294
15366
  import { ReactNodeViewRenderer } from "@tiptap/react";
15295
15367
 
15296
15368
  // src/components/tetrons/ResizableImageComponent.tsx
15297
- import React10, { useRef as useRef4, useEffect as useEffect4 } from "react";
15369
+ import { useRef as useRef4, useEffect as useEffect4 } from "react";
15298
15370
  import { NodeViewWrapper } from "@tiptap/react";
15371
+ import { jsx as jsx10 } from "react/jsx-runtime";
15299
15372
  var ResizableImageComponent = ({
15300
15373
  node,
15301
15374
  updateAttributes: updateAttributes2,
@@ -15315,7 +15388,7 @@ var ResizableImageComponent = ({
15315
15388
  observer.observe(img);
15316
15389
  return () => observer.disconnect();
15317
15390
  }, [updateAttributes2]);
15318
- return /* @__PURE__ */ React10.createElement(
15391
+ return /* @__PURE__ */ jsx10(
15319
15392
  NodeViewWrapper,
15320
15393
  {
15321
15394
  ref: wrapperRef,
@@ -15328,26 +15401,26 @@ var ResizableImageComponent = ({
15328
15401
  padding: 2,
15329
15402
  display: "inline-block",
15330
15403
  maxWidth: "100%"
15331
- }
15332
- },
15333
- /* @__PURE__ */ React10.createElement(
15334
- "img",
15335
- {
15336
- ref: imgRef,
15337
- src,
15338
- alt: alt ?? "",
15339
- title: title ?? "",
15340
- loading: "lazy",
15341
- style: {
15342
- width: width ? `${width}px` : "auto",
15343
- height: height ? `${height}px` : "auto",
15344
- display: "block",
15345
- userSelect: "none",
15346
- pointerEvents: "auto"
15347
- },
15348
- draggable: false
15349
- }
15350
- )
15404
+ },
15405
+ children: /* @__PURE__ */ jsx10(
15406
+ "img",
15407
+ {
15408
+ ref: imgRef,
15409
+ src,
15410
+ alt: alt ?? "",
15411
+ title: title ?? "",
15412
+ loading: "lazy",
15413
+ style: {
15414
+ width: width ? `${width}px` : "auto",
15415
+ height: height ? `${height}px` : "auto",
15416
+ display: "block",
15417
+ userSelect: "none",
15418
+ pointerEvents: "auto"
15419
+ },
15420
+ draggable: false
15421
+ }
15422
+ )
15423
+ }
15351
15424
  );
15352
15425
  };
15353
15426
  var ResizableImageComponent_default = ResizableImageComponent;
@@ -15388,8 +15461,9 @@ var ResizableImage = Image.extend({
15388
15461
  import { ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
15389
15462
 
15390
15463
  // src/components/tetrons/ResizableVideoComponent.tsx
15391
- import React11, { useRef as useRef5, useEffect as useEffect5 } from "react";
15464
+ import { useRef as useRef5, useEffect as useEffect5 } from "react";
15392
15465
  import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
15466
+ import { jsx as jsx11 } from "react/jsx-runtime";
15393
15467
  var ResizableVideoComponent = ({
15394
15468
  node,
15395
15469
  updateAttributes: updateAttributes2,
@@ -15409,7 +15483,7 @@ var ResizableVideoComponent = ({
15409
15483
  observer.observe(video);
15410
15484
  return () => observer.disconnect();
15411
15485
  }, [updateAttributes2]);
15412
- return /* @__PURE__ */ React11.createElement(
15486
+ return /* @__PURE__ */ jsx11(
15413
15487
  NodeViewWrapper2,
15414
15488
  {
15415
15489
  ref: wrapperRef,
@@ -15421,20 +15495,20 @@ var ResizableVideoComponent = ({
15421
15495
  border: "1px solid #ccc",
15422
15496
  padding: "2px",
15423
15497
  display: "inline-block"
15424
- }
15425
- },
15426
- /* @__PURE__ */ React11.createElement(
15427
- "video",
15428
- {
15429
- ref: videoRef,
15430
- src,
15431
- controls,
15432
- style: {
15433
- width: width ? `${width}px` : "auto",
15434
- height: height ? `${height}px` : "auto"
15498
+ },
15499
+ children: /* @__PURE__ */ jsx11(
15500
+ "video",
15501
+ {
15502
+ ref: videoRef,
15503
+ src,
15504
+ controls,
15505
+ style: {
15506
+ width: width ? `${width}px` : "auto",
15507
+ height: height ? `${height}px` : "auto"
15508
+ }
15435
15509
  }
15436
- }
15437
- )
15510
+ )
15511
+ }
15438
15512
  );
15439
15513
  };
15440
15514
  var ResizableVideoComponent_default = ResizableVideoComponent;
@@ -15487,7 +15561,8 @@ var ResizableVideo = Node2.create({
15487
15561
  });
15488
15562
 
15489
15563
  // src/components/tetrons/toolbar/TableContextMenu.tsx
15490
- import React12, { useEffect as useEffect6, useState as useState4 } from "react";
15564
+ import { useEffect as useEffect6, useState as useState4 } from "react";
15565
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
15491
15566
  function TableContextMenu({ editor }) {
15492
15567
  const [menuPosition, setMenuPosition] = useState4(null);
15493
15568
  useEffect6(() => {
@@ -15515,60 +15590,62 @@ function TableContextMenu({ editor }) {
15515
15590
  const deleteRow = () => editor.chain().focus().deleteRow().run();
15516
15591
  const deleteCol = () => editor.chain().focus().deleteColumn().run();
15517
15592
  if (!menuPosition) return null;
15518
- return /* @__PURE__ */ React12.createElement(
15593
+ return /* @__PURE__ */ jsxs9(
15519
15594
  "ul",
15520
15595
  {
15521
15596
  className: "absolute bg-white shadow border rounded text-sm z-50",
15522
- style: { top: menuPosition.y, left: menuPosition.x }
15523
- },
15524
- /* @__PURE__ */ React12.createElement(
15525
- "li",
15526
- {
15527
- className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15528
- onClick: insertRowAbove
15529
- },
15530
- "Insert Row Above"
15531
- ),
15532
- /* @__PURE__ */ React12.createElement(
15533
- "li",
15534
- {
15535
- className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15536
- onClick: insertRowBelow
15537
- },
15538
- "Insert Row Below"
15539
- ),
15540
- /* @__PURE__ */ React12.createElement(
15541
- "li",
15542
- {
15543
- className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15544
- onClick: insertColLeft
15545
- },
15546
- "Insert Column Left"
15547
- ),
15548
- /* @__PURE__ */ React12.createElement(
15549
- "li",
15550
- {
15551
- className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15552
- onClick: insertColRight
15553
- },
15554
- "Insert Column Right"
15555
- ),
15556
- /* @__PURE__ */ React12.createElement(
15557
- "li",
15558
- {
15559
- className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
15560
- onClick: deleteRow
15561
- },
15562
- "Delete Row"
15563
- ),
15564
- /* @__PURE__ */ React12.createElement(
15565
- "li",
15566
- {
15567
- className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
15568
- onClick: deleteCol
15569
- },
15570
- "Delete Column"
15571
- )
15597
+ style: { top: menuPosition.y, left: menuPosition.x },
15598
+ children: [
15599
+ /* @__PURE__ */ jsx12(
15600
+ "li",
15601
+ {
15602
+ className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15603
+ onClick: insertRowAbove,
15604
+ children: "Insert Row Above"
15605
+ }
15606
+ ),
15607
+ /* @__PURE__ */ jsx12(
15608
+ "li",
15609
+ {
15610
+ className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15611
+ onClick: insertRowBelow,
15612
+ children: "Insert Row Below"
15613
+ }
15614
+ ),
15615
+ /* @__PURE__ */ jsx12(
15616
+ "li",
15617
+ {
15618
+ className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15619
+ onClick: insertColLeft,
15620
+ children: "Insert Column Left"
15621
+ }
15622
+ ),
15623
+ /* @__PURE__ */ jsx12(
15624
+ "li",
15625
+ {
15626
+ className: "px-3 py-1 hover:bg-gray-100 cursor-pointer",
15627
+ onClick: insertColRight,
15628
+ children: "Insert Column Right"
15629
+ }
15630
+ ),
15631
+ /* @__PURE__ */ jsx12(
15632
+ "li",
15633
+ {
15634
+ className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
15635
+ onClick: deleteRow,
15636
+ children: "Delete Row"
15637
+ }
15638
+ ),
15639
+ /* @__PURE__ */ jsx12(
15640
+ "li",
15641
+ {
15642
+ className: "px-3 py-1 hover:bg-red-100 cursor-pointer",
15643
+ onClick: deleteCol,
15644
+ children: "Delete Column"
15645
+ }
15646
+ )
15647
+ ]
15648
+ }
15572
15649
  );
15573
15650
  }
15574
15651
 
@@ -17092,12 +17169,13 @@ function typescript(hljs) {
17092
17169
  }
17093
17170
 
17094
17171
  // src/components/tetrons/EditorContent.tsx
17172
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
17095
17173
  var lowlight = createLowlight();
17096
17174
  lowlight.register("js", javascript);
17097
17175
  lowlight.register("ts", typescript);
17098
17176
  function EditorContent() {
17099
- const [versions, setVersions] = React13.useState([]);
17100
- const [currentVersionIndex, setCurrentVersionIndex] = React13.useState(null);
17177
+ const [versions, setVersions] = React10.useState([]);
17178
+ const [currentVersionIndex, setCurrentVersionIndex] = React10.useState(null);
17101
17179
  const editor = useEditor({
17102
17180
  extensions: [
17103
17181
  Document,
@@ -17181,32 +17259,47 @@ function EditorContent() {
17181
17259
  setCurrentVersionIndex(index);
17182
17260
  }
17183
17261
  };
17184
- return /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col h-full" }, /* @__PURE__ */ React13.createElement("div", { className: "p-2 border-b border-gray-300 bg-gray-50 flex flex-wrap items-center gap-3" }, /* @__PURE__ */ React13.createElement(
17185
- "button",
17186
- {
17187
- onClick: saveVersion,
17188
- disabled: !editor,
17189
- className: "px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50"
17190
- },
17191
- "Save Version"
17192
- ), /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2 overflow-x-auto max-w-full" }, versions.length === 0 && /* @__PURE__ */ React13.createElement("span", { className: "text-gray-500 text-sm" }, "No saved versions"), versions.map((_, idx) => /* @__PURE__ */ React13.createElement(
17193
- "button",
17194
- {
17195
- key: idx,
17196
- onClick: () => restoreVersion(idx),
17197
- className: `px-2 py-1 rounded border ${idx === currentVersionIndex ? "border-blue-600 font-semibold text-blue-600" : "border-gray-300 text-gray-700 hover:border-gray-600"}`,
17198
- title: `Restore Version ${idx + 1}`
17199
- },
17200
- `V${idx + 1}`
17201
- )))), editor && /* @__PURE__ */ React13.createElement(TetronsToolbar, { editor }), /* @__PURE__ */ React13.createElement(
17202
- "div",
17203
- {
17204
- ref: wrapperRef,
17205
- className: "flex-grow p-4 md:p-6 bg-white border border-gray-300 rounded shadow-sm overflow-auto min-h-0 prose relative",
17206
- onClick: handleEditorClick
17207
- },
17208
- editor ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(TiptapEditorContent, { editor }), editor && /* @__PURE__ */ React13.createElement(TableContextMenu, { editor })) : /* @__PURE__ */ React13.createElement("div", { className: "text-gray-500" }, "Loading editor...")
17209
- ));
17262
+ return /* @__PURE__ */ jsxs10("div", { className: "editor-container", children: [
17263
+ /* @__PURE__ */ jsxs10("div", { className: "editor-toolbar", children: [
17264
+ /* @__PURE__ */ jsx13(
17265
+ "button",
17266
+ {
17267
+ type: "button",
17268
+ onClick: saveVersion,
17269
+ disabled: !editor,
17270
+ className: "editor-save-btn",
17271
+ children: "Save Version"
17272
+ }
17273
+ ),
17274
+ /* @__PURE__ */ jsxs10("div", { className: "editor-versions-wrapper", children: [
17275
+ versions.length === 0 && /* @__PURE__ */ jsx13("span", { className: "editor-no-versions", children: "No saved versions" }),
17276
+ versions.map((_, idx) => /* @__PURE__ */ jsx13(
17277
+ "button",
17278
+ {
17279
+ type: "button",
17280
+ onClick: () => restoreVersion(idx),
17281
+ className: `editor-version-btn ${idx === currentVersionIndex ? "active" : ""}`,
17282
+ title: `Restore Version ${idx + 1}`,
17283
+ children: `V${idx + 1}`
17284
+ },
17285
+ idx
17286
+ ))
17287
+ ] })
17288
+ ] }),
17289
+ editor && /* @__PURE__ */ jsx13(TetronsToolbar, { editor }),
17290
+ /* @__PURE__ */ jsx13(
17291
+ "div",
17292
+ {
17293
+ ref: wrapperRef,
17294
+ className: "editor-content-wrapper",
17295
+ onClick: handleEditorClick,
17296
+ children: editor ? /* @__PURE__ */ jsxs10(Fragment2, { children: [
17297
+ /* @__PURE__ */ jsx13(TiptapEditorContent, { editor }),
17298
+ editor && /* @__PURE__ */ jsx13(TableContextMenu, { editor })
17299
+ ] }) : /* @__PURE__ */ jsx13("div", { className: "editor-loading", children: "Loading editor..." })
17300
+ }
17301
+ )
17302
+ ] });
17210
17303
  }
17211
17304
 
17212
17305
  // src/index.ts