fix email editor issues cuz of separate build

This commit is contained in:
KMKoushik
2024-08-24 15:39:41 +10:00
parent 1824a88a16
commit 676f5c8c64
10 changed files with 226 additions and 60 deletions

View File

@@ -18,7 +18,7 @@ import { Button } from "@unsend/ui/src/button";
import { AllowedAlignments, ButtonOptions } from "../types";
import { Separator } from "@unsend/ui/src/separator";
import { BorderWidth } from "../components/ui/icons/BorderWidth";
import { ColorPicker, ColorPickerPopup } from "../components/ui/ColorPicker";
import { ColorPickerPopup } from "../components/ui/ColorPicker";
import { LinkEditorPanel } from "../components/panels/LinkEditorPanel";
import { useState } from "react";
import {
@@ -96,7 +96,21 @@ export function ButtonComponent(props: NodeViewProps) {
</span>
</div>
{props.selected ? (
<form className="absolute inset-x-[-4px] inset-y-0 flex items-center justify-center">
<form
className="absolute inset-x-[-4px] inset-y-0 flex items-center justify-center"
onSubmit={(e) => {
e.preventDefault();
const endPos = props.getPos() + props.node.nodeSize;
editor.commands.focus("start");
editor
.chain()
.insertContentAt(endPos, { type: "paragraph" })
.focus(endPos)
.run();
}}
>
<input
type="text"
value={text}