fix email editor issues cuz of separate build
This commit is contained in:
10
packages/email-editor/.eslintrc.cjs
Normal file
10
packages/email-editor/.eslintrc.cjs
Normal file
@@ -0,0 +1,10 @@
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ["@unsend/eslint-config/react-internal.js"],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
project: "./tsconfig.lint.json",
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
};
|
@@ -2,21 +2,21 @@
|
||||
"name": "@unsend/email-editor",
|
||||
"version": "0.0.1",
|
||||
"description": "Email editor used by unsend",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"files": [
|
||||
"dist/**"
|
||||
"src"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "tsup --watch",
|
||||
"clean": "rm -rf dist",
|
||||
"build": "tsup"
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"lint:fix": "eslint . --fix"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^9.6.0",
|
||||
"@types/react": "^18.3.3",
|
||||
"@unsend/eslint-config": "workspace:*",
|
||||
"@unsend/tailwind-config": "workspace:*",
|
||||
@@ -50,6 +50,7 @@
|
||||
"@tiptap/react": "^2.4.0",
|
||||
"@tiptap/starter-kit": "^2.4.0",
|
||||
"@tiptap/suggestion": "^2.4.0",
|
||||
"eslint": "^9.9.1",
|
||||
"jsx-email": "^1.12.1",
|
||||
"lucide-react": "^0.359.0",
|
||||
"react-colorful": "^5.6.1",
|
||||
|
@@ -2,8 +2,6 @@ import { ReactNodeViewRenderer } from "@tiptap/react";
|
||||
import TipTapImage from "@tiptap/extension-image";
|
||||
import { ResizableImageTemplate } from "../nodes/image-resize";
|
||||
|
||||
const BORDER_COLOR = "#0096fd";
|
||||
|
||||
export const ResizableImageExtension = TipTapImage.extend({
|
||||
addAttributes() {
|
||||
return {
|
||||
|
@@ -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}
|
||||
|
@@ -1,6 +1,3 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.unsend-editor .unsend-prose p:where([class~="text-sm"]) {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
8
packages/email-editor/tsconfig.lint.json
Normal file
8
packages/email-editor/tsconfig.lint.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@unsend/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src", "turbo", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
Reference in New Issue
Block a user