Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"es-toolkit": "^1.45.1",
"html-to-image": "^1.11.13",
"jszip": "^3.10.1",
"katex": "^0.16.22",
"juice": "^11.1.1",
"lucide-vue-next": "^1.0.0",
"marked": "^18.0.1",
Expand Down
14 changes: 14 additions & 0 deletions apps/web/src/components/editor/EditorContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { useExportStore } from '@/stores/export'
import { usePostStore } from '@/stores/post'
import { useUIStore } from '@/stores/ui'
import { copyPlain } from '@/utils/clipboard'
import { normalizeFormulaInput } from '@/utils/formula'

const editorStore = useEditorStore()
const postStore = usePostStore()
Expand Down Expand Up @@ -77,6 +78,15 @@ function clearContent() {
editorStore.clearContent()
}

function openFormulaEditor() {
const selection = normalizeFormulaInput(editorStore.getSelection())
uiStore.openFormulaEditor({
value: selection.latex,
displayMode: selection.displayMode,
sourceRaw: selection.sourceRaw,
})
}

// 复制到剪贴板
async function copyToClipboard() {
const selectedText = editorStore.getSelection()
Expand Down Expand Up @@ -134,6 +144,10 @@ function downloadAsCardImage() {
<Image class="mr-2 h-4 w-4" />
图片
</ContextMenuItem>
<ContextMenuItem @click="openFormulaEditor()">
<span class="mr-2 inline-flex h-4 w-4 items-center justify-center text-xs font-semibold">ƒ</span>
公式
</ContextMenuItem>
<ContextMenuItem @click="toggleShowInsertFormDialog()">
<Table class="mr-2 h-4 w-4" />
表格
Expand Down
Loading
Loading