From ccbe9626e70999d26c8244b0abc8378ac64a6a24 Mon Sep 17 00:00:00 2001 From: Burak Date: Mon, 25 Nov 2024 21:08:51 +0300 Subject: [PATCH] add striked text --- CHANGES.md | 6 ++ package.json | 2 +- packages/app-desktop/package.json | 2 +- .../editor/bubble-menu/formatting.tsx | 95 ++++++++++--------- packages/common/package.json | 2 +- 5 files changed, 61 insertions(+), 46 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dca6cd0..4b2b714 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +# 0.2.0-alpha.3 + +## 🌟 Features + +- Added striked text + # 0.2.0-alpha.2 ## 🌟 Features diff --git a/package.json b/package.json index 36d09a7..cf04dab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "darkwrite", - "version": "0.2.0-alpha.2", + "version": "0.2.0-alpha.3", "description": "", "scripts": { "test:all": "yarn workspaces foreach -A run test", diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json index dc61bae..c0c0e82 100644 --- a/packages/app-desktop/package.json +++ b/packages/app-desktop/package.json @@ -7,7 +7,7 @@ "description": "The eye candy note-taking app for all desktops.", "productName": "Darkwrite", "private": true, - "version": "0.2.0-alpha.2", + "version": "0.2.0-alpha.3", "type": "module", "license": "AGPL-3.0-or-later", "main": "dist-electron/main.js", diff --git a/packages/app-desktop/src/features/editor/bubble-menu/formatting.tsx b/packages/app-desktop/src/features/editor/bubble-menu/formatting.tsx index 0384c23..6b4782f 100644 --- a/packages/app-desktop/src/features/editor/bubble-menu/formatting.tsx +++ b/packages/app-desktop/src/features/editor/bubble-menu/formatting.tsx @@ -1,48 +1,57 @@ import { useEditor } from "novel"; -import { Bold, Code, Italic, Underline } from "lucide-react"; +import { Bold, Code, Italic, Strikethrough, Underline } from "lucide-react"; import { BubbleButton } from "./bubble-button"; export function FormattingButtons() { - const { editor } = useEditor(); - if (!editor) return null; - return ( -
- e.editor?.isActive("bold") ?? false} - name="bold" - icon={Bold} - editor={{ editor }} - command={(editor) => { - editor.chain().focus().toggleBold().run(); - }} - /> - e.editor?.isActive("italic") ?? false} - name="italic" - icon={Italic} - editor={{ editor }} - command={(editor) => { - editor.chain().focus().toggleItalic().run(); - }} - /> - e.editor?.isActive("underline") ?? false} - name="underline" - icon={Underline} - editor={{ editor }} - command={(editor) => { - editor.chain().focus().toggleUnderline().run(); - }} - /> - e.editor?.isActive("code") ?? false} - name="code" - icon={Code} - editor={{ editor }} - command={(editor) => { - editor.chain().focus().toggleCode().run(); - }} - /> -
- ); + const { editor } = useEditor(); + if (!editor) return null; + return ( +
+ e.editor?.isActive("bold") ?? false} + name="bold" + icon={Bold} + editor={{ editor }} + command={(editor) => { + editor.chain().focus().toggleBold().run(); + }} + /> + e.editor?.isActive("italic") ?? false} + name="italic" + icon={Italic} + editor={{ editor }} + command={(editor) => { + editor.chain().focus().toggleItalic().run(); + }} + /> + e.editor?.isActive("underline") ?? false} + name="underline" + icon={Underline} + editor={{ editor }} + command={(editor) => { + editor.chain().focus().toggleUnderline().run(); + }} + /> + e.editor?.isActive("strike") ?? false} + name="strike" + icon={Strikethrough} + editor={{ editor }} + command={(editor) => { + editor.chain().focus().toggleStrike().run(); + }} + /> + e.editor?.isActive("code") ?? false} + name="code" + icon={Code} + editor={{ editor }} + command={(editor) => { + editor.chain().focus().toggleCode().run(); + }} + /> +
+ ); } diff --git a/packages/common/package.json b/packages/common/package.json index fdc0ca2..86b15ff 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@darkwrite/common", - "version": "0.2.0-alpha.2", + "version": "0.2.0-alpha.3", "types": "./dist/index.d.ts", "main": "./dist/index.js", "scripts": {