2026-04-02 00:31:28 +08:00
|
|
|
<script setup lang="ts">
|
2026-05-01 20:39:09 +08:00
|
|
|
import { LeftOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
|
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
import ArticleEditorCanvas from '@/components/ArticleEditorCanvas.vue'
|
|
|
|
|
import PublishArticleModal from '@/components/PublishArticleModal.vue'
|
|
|
|
|
import { articlesApi } from '@/lib/api'
|
|
|
|
|
import { formatError } from '@/lib/errors'
|
|
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const queryClient = useQueryClient()
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
|
|
const articleId = computed(() => Number(route.params.id))
|
|
|
|
|
const title = ref('')
|
|
|
|
|
const markdown = ref('')
|
|
|
|
|
const initialTitle = ref('')
|
|
|
|
|
const initialMarkdown = ref('')
|
|
|
|
|
const leaveModalOpen = ref(false)
|
|
|
|
|
const publishModalOpen = ref(false)
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const detailQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: computed(() => ['articles', 'detail', articleId.value]),
|
2026-04-02 00:31:28 +08:00
|
|
|
enabled: computed(() => Number.isInteger(articleId.value) && articleId.value > 0),
|
|
|
|
|
queryFn: () => articlesApi.detail(articleId.value),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => detailQuery.data.value,
|
|
|
|
|
(detail) => {
|
|
|
|
|
if (!detail) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
const nextTitle = detail.title ?? ''
|
|
|
|
|
const nextMarkdown = stripLeadingTitleHeading(nextTitle, detail.markdown_content ?? '')
|
2026-04-02 00:31:28 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
title.value = nextTitle
|
|
|
|
|
markdown.value = nextMarkdown
|
|
|
|
|
initialTitle.value = nextTitle
|
|
|
|
|
initialMarkdown.value = nextMarkdown
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
{ immediate: true },
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-02 00:31:28 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
const detail = computed(() => detailQuery.data.value)
|
|
|
|
|
const editorLocked = computed(() => detail.value?.generate_status !== 'completed')
|
|
|
|
|
const referencedImageAssetIds = computed(() => extractReferencedImageAssetIds(markdown.value))
|
2026-04-02 00:31:28 +08:00
|
|
|
const hasChanges = computed(
|
|
|
|
|
() =>
|
2026-05-01 20:39:09 +08:00
|
|
|
title.value.trim() !== initialTitle.value.trim() || markdown.value !== initialMarkdown.value,
|
|
|
|
|
)
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const saveMutation = useMutation({
|
|
|
|
|
mutationFn: () =>
|
|
|
|
|
articlesApi.update(articleId.value, {
|
|
|
|
|
title: title.value.trim(),
|
|
|
|
|
markdown_content: markdown.value,
|
2026-04-16 20:40:41 +08:00
|
|
|
referenced_image_asset_ids: referencedImageAssetIds.value,
|
2026-04-02 00:31:28 +08:00
|
|
|
}),
|
|
|
|
|
onSuccess: async (data) => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('article.editor.messages.saved'))
|
|
|
|
|
title.value = data.title ?? ''
|
|
|
|
|
markdown.value = data.markdown_content ?? ''
|
|
|
|
|
initialTitle.value = title.value
|
|
|
|
|
initialMarkdown.value = markdown.value
|
2026-04-02 00:31:28 +08:00
|
|
|
await Promise.all([
|
2026-05-01 20:39:09 +08:00
|
|
|
queryClient.invalidateQueries({ queryKey: ['articles'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['workspace'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['templates'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['articles', 'detail', articleId.value] }),
|
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
|
queryKey: ['articles', 'detail', articleId.value, 'publish-modal'],
|
|
|
|
|
}),
|
|
|
|
|
])
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.error(formatError(error))
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const saveDisabled = computed(
|
2026-05-01 20:39:09 +08:00
|
|
|
() =>
|
|
|
|
|
editorLocked.value ||
|
|
|
|
|
saveMutation.isPending.value ||
|
|
|
|
|
title.value.trim() === '' ||
|
|
|
|
|
!hasChanges.value,
|
|
|
|
|
)
|
2026-04-02 00:31:28 +08:00
|
|
|
const leaveSaveDisabled = computed(
|
2026-05-01 20:39:09 +08:00
|
|
|
() => editorLocked.value || saveMutation.isPending.value || title.value.trim() === '',
|
|
|
|
|
)
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
async function saveArticle(): Promise<boolean> {
|
|
|
|
|
if (leaveSaveDisabled.value || !hasChanges.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return false
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
2026-05-01 20:39:09 +08:00
|
|
|
await saveMutation.mutateAsync()
|
|
|
|
|
return true
|
2026-04-02 00:31:28 +08:00
|
|
|
} catch {
|
2026-05-01 20:39:09 +08:00
|
|
|
return false
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleSave(): Promise<void> {
|
|
|
|
|
if (saveDisabled.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
await saveArticle()
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:45:27 +08:00
|
|
|
function handleSaveShortcut(event: KeyboardEvent): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
if (!(event.ctrlKey || event.metaKey) || event.key.toLowerCase() !== 's') {
|
|
|
|
|
return
|
2026-04-25 22:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
event.preventDefault()
|
|
|
|
|
event.stopPropagation()
|
2026-04-25 22:45:27 +08:00
|
|
|
if (event.repeat || saveDisabled.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-25 22:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
void handleSave()
|
2026-04-25 22:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
async function handlePublish(): Promise<void> {
|
|
|
|
|
if (editorLocked.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hasChanges.value && !saveMutation.isPending.value) {
|
|
|
|
|
try {
|
2026-05-01 20:39:09 +08:00
|
|
|
await saveMutation.mutateAsync()
|
2026-04-02 00:31:28 +08:00
|
|
|
} catch {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
publishModalOpen.value = true
|
2026-04-03 00:39:15 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-05 22:10:05 +08:00
|
|
|
async function uploadEditorImage(file: File): Promise<string> {
|
2026-05-01 20:39:09 +08:00
|
|
|
const result = await articlesApi.uploadImage(articleId.value, file)
|
|
|
|
|
return result.url
|
2026-04-05 22:10:05 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-03 00:39:15 +08:00
|
|
|
async function handlePublished(): Promise<void> {
|
|
|
|
|
await Promise.all([
|
|
|
|
|
detailQuery.refetch(),
|
2026-05-01 20:39:09 +08:00
|
|
|
queryClient.invalidateQueries({ queryKey: ['articles'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['workspace'] }),
|
|
|
|
|
])
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-06 22:18:55 +08:00
|
|
|
const isFreeCreateEmpty = computed(
|
|
|
|
|
() =>
|
2026-05-01 20:39:09 +08:00
|
|
|
detail.value?.source_type === 'free_create' &&
|
|
|
|
|
title.value.trim() === '' &&
|
|
|
|
|
markdown.value.trim() === '',
|
|
|
|
|
)
|
2026-04-06 22:18:55 +08:00
|
|
|
|
|
|
|
|
const isFreeCreateInitiallyEmpty = computed(
|
|
|
|
|
() =>
|
2026-05-01 20:39:09 +08:00
|
|
|
detail.value?.source_type === 'free_create' &&
|
|
|
|
|
initialTitle.value.trim() === '' &&
|
|
|
|
|
initialMarkdown.value.trim() === '',
|
|
|
|
|
)
|
2026-04-06 22:18:55 +08:00
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
function handleBack(): void {
|
|
|
|
|
if (saveMutation.isPending.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-06 22:18:55 +08:00
|
|
|
if (isFreeCreateEmpty.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
void cleanupEmptyFreeCreate()
|
|
|
|
|
return
|
2026-04-06 22:18:55 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
if (hasChanges.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
leaveModalOpen.value = true
|
|
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
navigateBack()
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-06 22:18:55 +08:00
|
|
|
async function cleanupEmptyFreeCreate(): Promise<void> {
|
|
|
|
|
try {
|
2026-05-01 20:39:09 +08:00
|
|
|
await articlesApi.remove(articleId.value)
|
2026-04-06 22:18:55 +08:00
|
|
|
await Promise.all([
|
2026-05-01 20:39:09 +08:00
|
|
|
queryClient.invalidateQueries({ queryKey: ['articles'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['workspace'] }),
|
|
|
|
|
])
|
2026-04-06 22:18:55 +08:00
|
|
|
} catch {
|
|
|
|
|
// ignore cleanup errors
|
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
navigateBack()
|
2026-04-06 22:18:55 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
function navigateBack(): void {
|
|
|
|
|
if (window.history.length > 1) {
|
2026-05-01 20:39:09 +08:00
|
|
|
void router.back()
|
|
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
void router.push('/articles/templates')
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleStay(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
leaveModalOpen.value = false
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleDiscardLeave(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
leaveModalOpen.value = false
|
2026-04-06 22:18:55 +08:00
|
|
|
if (isFreeCreateInitiallyEmpty.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
void cleanupEmptyFreeCreate()
|
|
|
|
|
return
|
2026-04-06 22:18:55 +08:00
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
navigateBack()
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleSaveAndLeave(): Promise<void> {
|
2026-05-01 20:39:09 +08:00
|
|
|
const saved = await saveArticle()
|
2026-04-02 00:31:28 +08:00
|
|
|
if (!saved) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
leaveModalOpen.value = false
|
|
|
|
|
navigateBack()
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function stripLeadingTitleHeading(titleValue: string, markdownValue: string): string {
|
2026-05-01 20:39:09 +08:00
|
|
|
const normalizedTitle = titleValue.trim()
|
2026-04-02 00:31:28 +08:00
|
|
|
if (!normalizedTitle) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return markdownValue
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
const normalizedMarkdown = markdownValue.replace(/^\uFEFF/, '')
|
|
|
|
|
const match = normalizedMarkdown.match(/^#\s+(.+?)\s*(\r?\n|$)/)
|
2026-04-02 00:31:28 +08:00
|
|
|
if (!match) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return markdownValue
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (match[1].trim() !== normalizedTitle) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return markdownValue
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
return normalizedMarkdown.slice(match[0].length).replace(/^\s*\r?\n/, '')
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-16 20:40:41 +08:00
|
|
|
function extractReferencedImageAssetIds(markdownValue: string): number[] {
|
2026-05-01 20:39:09 +08:00
|
|
|
const ids = new Set<number>()
|
|
|
|
|
const matcher = /data-asset-id=(?:"|')(\d+)(?:"|')/g
|
2026-04-16 20:40:41 +08:00
|
|
|
|
|
|
|
|
for (const match of markdownValue.matchAll(matcher)) {
|
2026-05-01 20:39:09 +08:00
|
|
|
const id = Number.parseInt(match[1] ?? '', 10)
|
2026-04-16 20:40:41 +08:00
|
|
|
if (Number.isInteger(id) && id > 0) {
|
2026-05-01 20:39:09 +08:00
|
|
|
ids.add(id)
|
2026-04-16 20:40:41 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
return [...ids]
|
2026-04-16 20:40:41 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:45:27 +08:00
|
|
|
onMounted(() => {
|
2026-05-01 20:39:09 +08:00
|
|
|
window.addEventListener('keydown', handleSaveShortcut)
|
|
|
|
|
})
|
2026-04-25 22:45:27 +08:00
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
2026-05-01 20:39:09 +08:00
|
|
|
window.removeEventListener('keydown', handleSaveShortcut)
|
|
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="article-editor-view">
|
|
|
|
|
<header class="article-editor-view__topbar">
|
|
|
|
|
<button class="article-editor-view__back" type="button" @click="handleBack">
|
|
|
|
|
<LeftOutlined />
|
2026-05-01 20:39:09 +08:00
|
|
|
<span>{{ t('common.back') }}</span>
|
2026-04-02 00:31:28 +08:00
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<div class="article-editor-view__actions">
|
2026-04-25 22:45:27 +08:00
|
|
|
<a-button
|
|
|
|
|
:disabled="saveDisabled"
|
|
|
|
|
:loading="saveMutation.isPending.value"
|
|
|
|
|
title="Ctrl/Cmd + S"
|
|
|
|
|
aria-keyshortcuts="Control+S Meta+S"
|
|
|
|
|
@click="handleSave"
|
|
|
|
|
>
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('common.save') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" :disabled="editorLocked" @click="handlePublish">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('article.editor.publish') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<div v-if="detailQuery.isPending.value" class="article-editor-view__loading">
|
|
|
|
|
<a-skeleton active :paragraph="{ rows: 14 }" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="detail">
|
|
|
|
|
<a-alert
|
|
|
|
|
v-if="editorLocked"
|
|
|
|
|
class="article-editor-view__alert"
|
|
|
|
|
type="info"
|
|
|
|
|
show-icon
|
|
|
|
|
:message="t('article.editor.messages.locked')"
|
|
|
|
|
/>
|
|
|
|
|
<div class="article-editor-view__layout">
|
|
|
|
|
<section class="article-editor-view__main">
|
2026-04-18 00:47:57 +08:00
|
|
|
<ArticleEditorCanvas
|
|
|
|
|
:key="String(articleId)"
|
|
|
|
|
v-model:title="title"
|
|
|
|
|
v-model="markdown"
|
2026-05-01 20:39:09 +08:00
|
|
|
:article-id="articleId"
|
2026-04-18 00:47:57 +08:00
|
|
|
:disabled="editorLocked"
|
|
|
|
|
:upload-image="uploadEditorImage"
|
|
|
|
|
/>
|
2026-04-02 00:31:28 +08:00
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<a-empty v-else :description="t('common.noData')" />
|
|
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
:open="leaveModalOpen"
|
|
|
|
|
:title="t('article.editor.leaveConfirm.title')"
|
|
|
|
|
:closable="false"
|
|
|
|
|
:mask-closable="false"
|
|
|
|
|
@cancel="handleStay"
|
|
|
|
|
>
|
|
|
|
|
<p class="article-editor-view__leave-copy">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('article.editor.leaveConfirm.description') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button @click="handleStay">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('common.cancel') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleDiscardLeave">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('article.editor.leaveConfirm.discard') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
:loading="saveMutation.isPending.value"
|
|
|
|
|
:disabled="leaveSaveDisabled"
|
|
|
|
|
@click="handleSaveAndLeave"
|
|
|
|
|
>
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('article.editor.leaveConfirm.saveAndLeave') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
2026-04-03 00:39:15 +08:00
|
|
|
|
|
|
|
|
<PublishArticleModal
|
|
|
|
|
v-model:open="publishModalOpen"
|
|
|
|
|
:article-id="detail?.id ?? null"
|
|
|
|
|
@published="handlePublished"
|
|
|
|
|
/>
|
2026-04-02 00:31:28 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.article-editor-view {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__topbar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__back {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
padding: 0;
|
|
|
|
|
border: 0;
|
|
|
|
|
background: transparent;
|
|
|
|
|
color: #111827;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__back :deep(.anticon) {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 36px;
|
|
|
|
|
height: 36px;
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
background: rgba(255, 255, 255, 0.82);
|
|
|
|
|
border: 1px solid rgba(144, 157, 181, 0.24);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__main {
|
|
|
|
|
height: calc(100vh - 180px);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background: rgba(255, 255, 255, 0.88);
|
|
|
|
|
border: 1px solid rgba(216, 225, 237, 0.9);
|
|
|
|
|
border-radius: 28px;
|
|
|
|
|
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
|
|
|
|
|
backdrop-filter: blur(14px);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 23:16:45 +08:00
|
|
|
.article-editor-view__loading {
|
2026-04-02 00:31:28 +08:00
|
|
|
padding: 24px;
|
|
|
|
|
background: rgba(255, 255, 255, 0.88);
|
|
|
|
|
border: 1px solid rgba(216, 225, 237, 0.9);
|
|
|
|
|
border-radius: 28px;
|
|
|
|
|
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
|
|
|
|
|
backdrop-filter: blur(14px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__alert {
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__leave-copy {
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: #475467;
|
|
|
|
|
line-height: 1.75;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__layout {
|
2026-04-25 23:16:45 +08:00
|
|
|
min-width: 0;
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__main {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.article-editor-view__topbar {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__actions {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-editor-view__actions :deep(.ant-btn) {
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|