+
diff --git a/src/components/Editor/MiniEditor/MiniEditor.tsx b/src/components/Editor/MiniEditor/MiniEditor.tsx
index ac63ab2f..1b86aa82 100644
--- a/src/components/Editor/MiniEditor/MiniEditor.tsx
+++ b/src/components/Editor/MiniEditor/MiniEditor.tsx
@@ -4,8 +4,10 @@ import clsx from 'clsx'
import { type JSX, Show, createEffect, createSignal, on } from 'solid-js'
import { createEditorTransaction, createTiptapEditor, useEditorHTML } from 'solid-tiptap'
import { base } from '~/lib/editorExtensions'
+import { EditorToolbar } from '../EditorToolbar/EditorToolbar'
-import { MiniToolbar } from '../EditorToolbar/MiniToolbar'
+import { Button } from '~/components/_shared/Button'
+import { useLocalize } from '~/context/localize'
import styles from '../SimplifiedEditor.module.scss'
interface MiniEditorProps {
@@ -18,6 +20,7 @@ interface MiniEditorProps {
}
export default function MiniEditor(props: MiniEditorProps): JSX.Element {
+ const { t } = useLocalize()
const [editorElement, setEditorElement] = createSignal
()
const [counter, setCounter] = createSignal(0)
@@ -36,7 +39,10 @@ export default function MiniEditor(props: MiniEditorProps): JSX.Element {
content: props.content || ''
}))
+ const isFocused = createEditorTransaction(editor, (instance) => instance?.isFocused)
+ const isEmpty = createEditorTransaction(editor, (instance) => instance?.isEmpty)
const html = useEditorHTML(editor)
+
createEffect(on(html, (c?: string) => c && props.onChange?.(c)))
createEffect(() => {
@@ -46,14 +52,27 @@ export default function MiniEditor(props: MiniEditorProps): JSX.Element {
content && props.onChange?.(content)
})
- const isFocused = createEditorTransaction(editor, (instance) => instance?.isFocused)
+ const handleSubmit = () => {
+ html() && props.onSubmit?.(html() || '')
+ editor()?.commands.clearContent(true)
+ }
return (
-
+
+
+
+
0}>
diff --git a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx
index 8352c69a..981523dc 100644
--- a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx
+++ b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx
@@ -1,13 +1,11 @@
import type { Editor } from '@tiptap/core'
-
import { clsx } from 'clsx'
import { Match, Show, Switch, createEffect, createSignal, lazy, onCleanup, onMount } from 'solid-js'
import { createEditorTransaction } from 'solid-tiptap'
-
import { Icon } from '~/components/_shared/Icon'
import { Popover } from '~/components/_shared/Popover'
import { useLocalize } from '~/context/localize'
-import { InsertLinkForm } from '../InsertLinkForm'
+import { InsertLinkForm } from '../EditorToolbar/InsertLinkForm'
import styles from './TextBubbleMenu.module.scss'