diff --git a/.claude/launch.json b/.claude/launch.json
new file mode 100644
index 0000000..52e73cb
--- /dev/null
+++ b/.claude/launch.json
@@ -0,0 +1,11 @@
+{
+ "version": "0.0.1",
+ "configurations": [
+ {
+ "name": "dev",
+ "runtimeExecutable": "pnpm",
+ "runtimeArgs": ["dev"],
+ "port": 5173
+ }
+ ]
+}
diff --git a/.env.example b/.env.example
index f4a18bd..f16d947 100644
--- a/.env.example
+++ b/.env.example
@@ -1,7 +1,12 @@
# Tiptap AI Configuration
# Copy this file to .env and fill in your values
+#
+# SECURITY NOTE: VITE_* variables are inlined into the client bundle at build
+# time — any key you put here ships to every browser. Only use keys you own
+# with a spending limit, or point VITE_AI_BASE_URL at your own backend proxy
+# that holds the real key server-side.
-# AI Provider: openai | aliyun | ollama | deepseek | anthropic | custom
+# AI Provider: openai | deepseek | anthropic | aliyun | ollama | custom
VITE_AI_PROVIDER=openai
# API Key (required for most providers)
@@ -13,16 +18,18 @@ VITE_AI_API_KEY=your-api-key-here
# Base URL (optional, uses default for each provider)
# OpenAI: https://api.openai.com/v1
+# DeepSeek: https://api.deepseek.com
+# Anthropic: https://api.anthropic.com/v1
# Aliyun: https://dashscope.aliyuncs.com/compatible-mode/v1
-# Ollama: http://localhost:11434/api
-# DeepSeek: https://api.deepseek.com/v1
+# Ollama: http://localhost:11434/v1
# VITE_AI_BASE_URL=
# Model (optional, uses default for each provider)
-# OpenAI: gpt-4o, gpt-3.5-turbo
-# Aliyun: qwen-turbo, qwen-plus, qwen-max
-# Ollama: llama3, mistral, codellama
+# OpenAI: gpt-4o, gpt-4o-mini
# DeepSeek: deepseek-chat, deepseek-coder
+# Anthropic: claude-3-5-sonnet-20241022
+# Aliyun: qwen-turbo, qwen-plus, qwen-max
+# Ollama: llama3.2, mistral, codellama
# VITE_AI_MODEL=
# Temperature (optional, default: 0.7)
diff --git a/.gitignore b/.gitignore
index 0101a26..365daab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,9 +5,14 @@ node_modules/
# Build output
dist/
+dist-demo/
dist-ssr/
*.local
+# Generated type declarations (stale vue-tsc output; published types come from vite-plugin-dts)
+src/**/*.d.ts
+src/**/*.d.ts.map
+
# Environment variables
.env
.env.local
diff --git a/README.md b/README.md
index b9ef0d6..30aa7f1 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,16 @@ Built on [Tiptap 3](https://tiptap.dev/) + [Vue 3](https://vuejs.org/) + [TypeSc
Tiptap UI Kit is a **fully open-source**, production-ready rich text editor UI kit that brings together the best of modern web technologies. It is the most feature-complete Tiptap + Vue 3 editor template available.
+### ⚡ v0.2: 94% smaller bundle
+
+The v0.2 release cut the shipped library from **2.4 MB JS + 1.5 MB CSS** down to **249 KB JS (63 KB gzip) + 96 KB CSS (15 KB gzip)** — roughly **78 KB total gzipped, a 94% reduction**. How:
+
+- **Lazy loading** — KaTeX (math), mammoth / docx / file-saver (Word import/export) are only downloaded when the feature is first used
+- **Tiered extension loading** — the default `version="basic"` loads only lightweight extensions; heavy ones (tables, math, AI) load with `version="premium"`
+- **Externalized peers** — Ant Design Vue and the collaboration stack (Yjs) are peer dependencies instead of being bundled
+
+See [Migrating to 0.2](#-migrating-to-02) if you are upgrading.
+
### Compared to alternatives
| Feature | Tiptap UI Kit | Raw Tiptap | Other Vue Editors |
@@ -47,9 +57,10 @@ Tiptap UI Kit is a **fully open-source**, production-ready rich text editor UI k
### Key highlights
- 🎨 **5 Beautiful Theme Presets** — Notion-like, Word-like (A4 pagination), GitHub, Typora, and Default
+- ⚡ **Tiny Footprint** — ~78 KB gzipped total, heavy features lazy-loaded on demand
- 🤖 **AI-Powered Features** — Continue writing, polish text, translate, summarize, custom AI commands (OpenAI-compatible)
- 🌓 **Perfect Dark Mode** — Seamless light/dark theme switching across all themes
-- 🛠️ **Modular Architecture** — Use only what you need, tree-shakeable
+- 🛠️ **Modular Architecture** — Tiered versions and per-feature flags, load only what you need
- 🌍 **i18n Ready** — Chinese (Simplified/Traditional) and English support
- 💯 **100% Free & Open Source** — MIT licensed, free for commercial use
@@ -72,14 +83,14 @@ Perfect for building modern document editors, content management systems, note-t
- **Word Mode** - Professional A4 paper layout with automatic pagination
-- **Modular Architecture** - Enable only the features you need, keep bundle size small
+- **Modular Architecture** - Tiered editor versions (`minimal` / `basic` / `premium`) plus per-feature flags keep the bundle small
- **Internationalization** - Built-in support for:
- 简体中文 (Simplified Chinese)
- 繁體中文 (Traditional Chinese)
- English
-- **Accessible** - WCAG compliant with full keyboard navigation
+- **Keyboard Navigation** - Productivity-focused shortcuts for power users
### ✏️ Rich Text Editing
@@ -94,12 +105,13 @@ Perfect for building modern document editors, content management systems, note-t
- **Code Blocks** - Syntax highlighting powered by Lowlight
- **Typography** - Font family, size, line height control
- **Special Formats** - Subscript, superscript, format painter
-- **Math Formulas** - KaTeX-powered inline and block math equations
+- **Math Formulas** - KaTeX-powered inline and block math equations (KaTeX is lazy-loaded on first use)
### 🤖 AI-Powered Features
-**Note:** AI features work with any OpenAI-compatible API. Configure your own API key in the AI Settings.
+**Note:** AI features work with any OpenAI-compatible API. Users configure their own API key via the built-in AI Settings modal, or the host app supplies `VITE_AI_*` environment variables. See [AI Configuration](#ai-configuration).
+- **⚡ AI Assistant (agent)** - Describe any edit in plain words — "add a 3x3 table at the end", "rewrite the second paragraph" — and the AI edits the document for you via tool calls
- **✨ Continue Writing** - AI completes your sentences and paragraphs intelligently
- **📝 Polish Text** - Improve grammar, clarity, and style automatically
- **🌐 Translation** - Translate to 14+ languages with one click
@@ -107,22 +119,22 @@ Perfect for building modern document editors, content management systems, note-t
- **🤖 Custom AI Commands** - Define your own AI transformations
**Supported AI Providers:**
-- OpenAI (GPT-4, GPT-3.5)
-- 阿里云通义千问 (Aliyun Qianwen)
-- DeepSeek
+- OpenAI (GPT-4o, GPT-4o-mini)
+- DeepSeek (DeepSeek-V3, DeepSeek-R1)
+- Anthropic (Claude, via OpenAI-compatible endpoint)
+- 阿里云通义千问 (Aliyun Qwen)
- Ollama (local deployment)
-- Any OpenAI-compatible API
+- Custom — any OpenAI-compatible API
### 🚀 Advanced Features
-- **Real-time Collaboration** - Multi-user editing powered by Yjs
+- **Real-time Collaboration** - Multi-user editing powered by Yjs (optional peer dependencies)
- **Drag & Drop** - Intuitive content reordering with visual feedback
-- **Search & Replace** - Find and replace text across the document
-- **Keyboard Shortcuts** - Productivity-focused shortcuts for power users
+- **Slash Commands** - Type `/` to insert blocks, Notion-style
+- **Word Import/Export** - Import `.docx` via mammoth, export via docx (both lazy-loaded on click)
- **Responsive Design** - Optimized for mobile, tablet, and desktop
- **Preview Mode** - Read-only rendering for content review
- **Zoom Control** - Scale from 50% to 200%
-- **Version History** - Track and restore previous versions
- **Format Painter** - Copy formatting across content
- **Paste Support** - Smart paste from Word, Excel, and web pages
@@ -130,8 +142,6 @@ Perfect for building modern document editors, content management systems, note-t
## 📦 Installation
-### From npm
-
```bash
# Using npm
npm install tiptap-ui-kit
@@ -145,10 +155,22 @@ yarn add tiptap-ui-kit
### Peer Dependencies
-Tiptap UI Kit requires the following peer dependencies:
+Tiptap UI Kit requires the following peer dependencies (npm 7+ and pnpm install them automatically; otherwise install them yourself):
```bash
-pnpm add @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/vue-3 vue
+pnpm add vue @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/vue-3 ant-design-vue @ant-design/icons-vue
+```
+
+**Optional peers — only needed for real-time collaboration:**
+
+```bash
+pnpm add yjs y-websocket @tiptap/extension-collaboration @tiptap/extension-collaboration-cursor
+```
+
+**Optional CSS — only needed for math formulas:**
+
+```ts
+import 'katex/dist/katex.min.css'
```
---
@@ -161,8 +183,9 @@ pnpm add @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/vue-3 vue
@@ -171,44 +194,112 @@ import { ref } from 'vue'
import { TiptapProEditor } from 'tiptap-ui-kit'
import 'tiptap-ui-kit/style.css'
+// v-model with a string -> the editor emits HTML strings
const content = ref('
Hello Tiptap UI Kit!
')
-const theme = ref('notion') // default | word | notion | github | typora
-const locale = ref('en-US') // en-US | zh-CN | zh-TW
```
-### With AI Features
+Notes:
+
+- `import 'tiptap-ui-kit/style.css'` is required — it contains the editor styles **and all 5 theme presets**.
+- `:features="{ headerNav: true, footerNav: true }"` enables the toolbar and the footer (zoom / word count). They are **off by default**.
+- If you omit `locale`, the editor auto-detects the browser language (`zh` → `zh-CN`/`zh-TW`, otherwise `en-US`).
+
+### v-model: HTML or JSON
+
+The type of the value you bind decides the output format:
+
+```vue
+
+
+
+
+
+
+
+```
+
+Alternatively, use `initialContent` (HTML string or ProseMirror JSON) with the `@update` event if you don't need two-way binding:
+
+```vue
+
+
+
+
+
+```
+
+### Editor Versions
+
+The `version` prop controls which Tiptap extensions are loaded — smaller versions download less code:
+
+| `version` | What's included |
+|-----------|-----------------|
+| `minimal` | Basic text formatting, lists, undo/redo |
+| `basic` (default) | `minimal` + colors, alignment, images, links, task lists — **no** tables, math, format painter, or AI |
+| `advanced` / `premium` | Everything: tables, math formulas (KaTeX), code blocks, fonts, format painter, AI features |
+
+```vue
+
+
+
+
+
+```
+
+### Feature Flags
+
+Fine-tune UI modules with the `features` prop (all off by default):
```vue
```
-**🔒 Security Note:** Never hardcode API keys in production. Use environment variables or let users configure their own keys via the AI Settings modal.
-
-### Advanced Configuration
+### Full Props, Events & Methods
```vue
@@ -218,13 +309,15 @@ import { TiptapProEditor } from 'tiptap-ui-kit'
import 'tiptap-ui-kit/style.css'
const content = ref('')
-const theme = ref('word')
-const locale = ref('zh-CN')
-const isDark = ref(false)
+const editorRef = ref(null)
-const handleUpdate = (newContent) => {
- console.log('Content updated:', newContent)
-}
+const onUpdate = (json) => { /* ProseMirror JSON, debounced 200ms */ }
+
+// Exposed methods via template ref:
+// editorRef.value.getEditor() - the raw Tiptap Editor instance
+// editorRef.value.getJSON() - ProseMirror JSON
+// editorRef.value.getHTML() - HTML string
+// editorRef.value.getText() - plain text
```
@@ -232,49 +325,172 @@ const handleUpdate = (newContent) => {
## 📚 Documentation
+### Props
+
+| Prop | Type | Default | Description |
+|------|------|---------|-------------|
+| `modelValue` | `string \| object` | — | `v-model` binding. String → HTML in/out; object → ProseMirror JSON in/out |
+| `initialContent` | `string \| object` | `''` | Initial content (HTML or ProseMirror JSON). Ignored if `modelValue` is set |
+| `version` | `'minimal' \| 'basic' \| 'advanced' \| 'premium'` | `'basic'` | Extension tier — see [Editor Versions](#editor-versions) |
+| `features` | `FeatureConfig` | — | Per-feature UI flags — see [Feature Flags](#feature-flags) |
+| `locale` | `'en-US' \| 'zh-CN' \| 'zh-TW'` | auto-detected | UI language; falls back to browser language detection |
+| `readonly` | `boolean` | `false` | Read-only mode |
+| `previewMode` | `boolean` | `false` | Preview rendering: no toolbar/footer, not editable |
+| `documentId` | `string` | — | Document ID, used as the collaboration room name |
+| `zoomBarPlacement` | `'bottom' \| 'belowToolbar'` | `'bottom'` | Zoom bar position |
+| `tableMenuShowMode` | `1 \| 2` | `2` | Table toolbar trigger: 1 = on focus, 2 = on cell selection |
+
+### Events
+
+| Event | Payload | Description |
+|-------|---------|-------------|
+| `update` | ProseMirror JSON | Content changed — **debounced 200ms** |
+| `update:modelValue` | `string \| object` | v-model sync (HTML or JSON, matching what you bound) — not debounced |
+| `collaboratorsChange` | `number` | Number of online collaborators changed |
+| `collaboratorsListChange` | `Array<{ id, name, color }>` | Online collaborator list changed |
+
+### Exposed Methods
+
+Available on the component via template ref: `getEditor()`, `getJSON()`, `getHTML()`, `getText()`.
+
### Themes
-Tiptap UI Kit comes with 5 professionally designed themes:
+All 5 theme presets ship inside `tiptap-ui-kit/style.css` — no extra CSS imports. Switch themes with the `setTheme` function (it applies a `theme-*` class and `data-theme` attribute on ``):
+
+```ts
+import { setTheme, toggleThemeMode, getTheme } from 'tiptap-ui-kit'
+
+// setTheme(preset, mode) — mode defaults to 'light'
+setTheme('notion', 'dark') // Notion theme, dark mode
+setTheme('word') // Word theme, light mode
+setTheme('github', 'auto') // follow system preference
+
+toggleThemeMode() // toggle light <-> dark
+getTheme() // { preset: 'github', mode: 'auto' }
+```
| Theme | Description | Best For |
|-------|-------------|----------|
-| **default** | Clean and minimal design | General purpose editing |
-| **word** | Microsoft Word-like with A4 pages | Formal documents, reports |
-| **notion** | Modern, distraction-free | Note-taking, knowledge base |
-| **github** | Developer-friendly markdown | Technical documentation |
-| **typora** | Elegant reading/writing | Long-form content, blogs |
+| `default` | Clean and minimal design | General purpose editing |
+| `word` | Microsoft Word-like with A4 pages | Formal documents, reports |
+| `notion` | Modern, distraction-free | Note-taking, knowledge base |
+| `github` | Developer-friendly markdown | Technical documentation |
+| `typora` | Elegant reading/writing | Long-form content, blogs |
-```vue
-
-```
+Dark mode is driven by `data-theme="dark"` on the document element. You can also register your own theme variables with `registerTheme('custom', { '--your-css-var': 'value' })` and apply them via `setTheme('custom')`.
### Localization
-Supported languages: `en-US`, `zh-CN`, `zh-TW`
+Supported languages: `en-US`, `zh-CN`, `zh-TW`.
```vue
-
+
+```
+
+If `locale` is not provided, the browser language is detected automatically: `zh-TW`/`zh-HK`/`zh-MO` → Traditional Chinese, other `zh` → Simplified Chinese, everything else → English.
+
+### Math Formulas
+
+Math rendering uses KaTeX, which is **lazy-loaded** the first time a formula is rendered — it costs nothing if you don't use it. You must import the KaTeX stylesheet yourself:
+
+```ts
+import 'katex/dist/katex.min.css'
+```
+
+### AI Assistant — edit documents with plain words
+
+Once AI is configured (see [AI Configuration](#ai-configuration) below), a floating **⚡ AI** button appears at the bottom-right of the editor. Open it and describe what you want:
+
+> 「在文档末尾加一个 3x3 的表格」 · "Rewrite the second paragraph to be more concise" · 「把所有出现的产品名加粗」
+
+The AI reads the document and edits it directly through a set of structured tools (insert/replace/delete blocks, edit/format text). Every step is shown in the chat, edits apply live, and **Cmd/Ctrl+Z undoes them** like any other edit. Works with all supported providers via OpenAI-style function calling.
+
+Disable the panel with `:features="{ aiChat: false }"`.
+
+**Build your own integration** — the tool layer and agent loop are exported, so you can drive the same document tools from your own UI, backend, or agent framework:
+
+```ts
+import { documentTools, toOpenAiTools, runDocumentAgent } from 'tiptap-ui-kit'
+
+// One-shot: run the built-in agent loop against the current editor
+await runDocumentAgent({
+ editor,
+ instruction: 'Add a summary section at the end',
+ callbacks: { onToolResult: (name) => console.log('step:', name) },
+})
+
+// Or take the raw tools (name/description/JSON-schema/execute) and wire them
+// into any tool-calling loop — e.g. an Anthropic Messages API client or the
+// Claude Agent SDK on your backend, proxying tool calls to the browser editor.
+const tools = toOpenAiTools(documentTools)
```
### AI Configuration
-Configure AI features via props or the built-in settings modal:
+There is **no AI prop on the component**. AI is configured in one of two ways:
-```typescript
-interface AiConfig {
- provider: 'openai' | 'aliyun' | 'deepseek' | 'ollama'
- apiKey: string
- baseUrl?: string // Optional custom endpoint
- model?: string // Optional model name
-}
+**1. Built-in AI Settings modal (end-user configuration)**
+
+Users open AI Settings from the editor toolbar, pick a provider, and paste their own API key. The configuration is persisted in the browser's `localStorage`.
+
+**2. Environment variables (host-app configuration)**
+
+Set `VITE_AI_*` variables in your app's `.env` (see [.env.example](.env.example)):
+
+```bash
+# openai | deepseek | anthropic | aliyun | ollama | custom
+VITE_AI_PROVIDER=openai
+VITE_AI_API_KEY=sk-...
+VITE_AI_BASE_URL=https://api.openai.com/v1 # optional
+VITE_AI_MODEL=gpt-4o-mini # optional
```
+> **🔒 Security warning:** API keys entered in the AI Settings modal are stored in browser `localStorage` with **reversible obfuscation, not encryption**. Any script running on the page — an XSS payload, a malicious browser extension — can read them. Only use keys you own with a spending limit configured, and never embed organization-wide keys this way. For production apps, the recommended setup is a backend proxy that holds the real key server-side (point the editor at it with provider `custom` / `VITE_AI_BASE_URL`).
+
+### Real-time Collaboration
+
+Collaboration is opt-in and requires the optional peer dependencies plus a [y-websocket](https://github.com/yjs/y-websocket) server:
+
+```bash
+pnpm add yjs y-websocket @tiptap/extension-collaboration @tiptap/extension-collaboration-cursor
+```
+
+```bash
+# .env
+VITE_COLLABORATION_WS_URL=wss://your-server.com/ws
+```
+
+```vue
+ console.log(n, 'online')"
+/>
+```
+
+`documentId` is used as the collaboration room name. If `collaboration` is enabled without `VITE_COLLABORATION_WS_URL`, a console warning is printed and collaboration stays off.
+
### API Reference
-Full API documentation is available in the [API.md](API.md) file.
+The [Props](#props), [Events](#events) and [Exposed Methods](#exposed-methods) tables above are the full public API of `TiptapProEditor`. Everything importable from `'tiptap-ui-kit'` is typed — check your editor's autocomplete for theme utilities (`setTheme`, `toggleThemeMode`, `registerTheme`, …) and locale utilities (`createI18n`, `detectDefaultLocale`, …).
---
+## 🔄 Migrating to 0.2
+
+v0.2 focuses on bundle size. Upgrading from 0.1 requires a few adjustments:
+
+1. **New peer dependencies** — `ant-design-vue` and `@ant-design/icons-vue` are no longer bundled. npm 7+ / pnpm install peers automatically; with older tooling, install them manually.
+2. **Collaboration peers are optional** — `yjs`, `y-websocket`, `@tiptap/extension-collaboration`, `@tiptap/extension-collaboration-cursor` are only needed if you enable collaboration.
+3. **KaTeX CSS** — math styles are no longer bundled. If you use math formulas, add `import 'katex/dist/katex.min.css'` to your app. KaTeX itself lazy-loads on first formula render.
+4. **`version` semantics changed** — `version="basic"` (the default) now loads only lightweight extensions (no tables, math, format painter, or AI). If you relied on the old everything-included behavior, pass `version="premium"`. A new `minimal` tier is available for the smallest builds.
+5. **`@update` is debounced by 200ms** — it emits ProseMirror JSON at most once per 200ms pause. For synchronous updates use `v-model` / `@update:modelValue`.
+6. **`v-model` is now supported** — bind a string for HTML or an object for ProseMirror JSON.
+7. **Theme CSS is bundled** — all 5 theme presets are inside `tiptap-ui-kit/style.css`; remove any per-theme CSS imports.
+
+---
## 💡 Use Cases
@@ -343,12 +559,14 @@ pnpm test
```
src/
├── ai/ # AI features (continue writing, polish, etc.)
-├── core/ # Core editor components
+├── api/ # AI & WebSocket API clients
+├── core/ # Core editor component (TiptapProEditor)
├── extensions/ # Tiptap extensions
├── features/ # Toolbar features (basic & advanced)
├── locales/ # Internationalization
-├── themes/ # Theme presets
-├── tools/ # Optional tools (collaboration, etc.)
+├── styles/ # Base styles
+├── themes/ # Theme presets & theme manager
+├── tools/ # UI modules (toolbar, collaboration, menus, etc.)
└── ui/ # Reusable UI components
```
diff --git a/demo/App.vue b/demo/App.vue
index 3f0fb99..6f009fc 100644
--- a/demo/App.vue
+++ b/demo/App.vue
@@ -116,6 +116,7 @@ import LandingPage from './LandingPage.vue'
import EditorAutoDemo from './EditorAutoDemo.vue'
import InlinePluginDemo from './InlinePluginDemo.vue'
import { createI18n, type LocaleCode } from '../src/locales'
+import { detectDefaultLocale } from '../src/locales/manager'
import { PRESET_CONFIGS } from '../src/core/editorConfig'
import type { FeatureFlags, ThemePreset } from '../src/core/editorConfig'
import { setTheme, setDeviceView, setOrientation, type DeviceView, THEME_PRESETS } from '../src/themes'
@@ -128,16 +129,23 @@ import '../src/themes/presets/github.css'
import '../src/themes/presets/typora.css'
import '../src/styles/device-responsive.css'
-// Landing page state
-const showLanding = ref(true)
+// Landing page state(用 hash 记住状态,刷新不回落地页)
+const showLanding = ref(!location.hash.startsWith('#demo'))
// Demo mode: 'full' = full editor, 'inline' = inline + plugins
-const demoMode = ref<'full' | 'inline'>('full')
+const demoMode = ref<'full' | 'inline'>(location.hash === '#demo-inline' ? 'inline' : 'full')
const handleStartDemo = () => {
showLanding.value = false
+ history.replaceState(null, '', '#demo')
}
+watch(demoMode, (mode) => {
+ if (!showLanding.value) {
+ history.replaceState(null, '', mode === 'inline' ? '#demo-inline' : '#demo')
+ }
+})
+
// Theme mode (light/dark)
const theme = ref<'light' | 'dark'>('light')
const toggleTheme = () => {
@@ -175,8 +183,8 @@ const antdTheme = computed(() => ({
algorithm: theme.value === 'dark' ? antTheme.darkAlgorithm : antTheme.defaultAlgorithm,
}))
-// Locale
-const locale = ref('en-US')
+// Locale(初始值跟随浏览器语言自动检测,与 i18n manager 保持一致)
+const locale = ref(detectDefaultLocale())
watch(locale, (newLocale) => {
createI18n({ locale: newLocale })
})
diff --git a/demo/EditorPreview.vue b/demo/EditorPreview.vue
index 2c40768..7d4faed 100644
--- a/demo/EditorPreview.vue
+++ b/demo/EditorPreview.vue
@@ -198,7 +198,7 @@ const demoScript: DemoStep[] = [
// Code block
{ action: 'format', format: 'code' },
{ action: 'addLine', line: { html: '', class: 'line-code', tag: 'pre' } },
- { action: 'type', text: 'import { TiptapEditor } from \'tiptap-ui-kit\' ', lineIndex: 7, duration: 25 },
+ { action: 'type', text: 'import { TiptapProEditor } from \'tiptap-ui-kit\' ', lineIndex: 7, duration: 25 },
{ action: 'format', format: '' },
{ action: 'pause', duration: 300 },
@@ -337,21 +337,24 @@ onBeforeUnmount(() => {
.editor-preview__glow {
position: absolute;
inset: -20px;
- background: conic-gradient(
- from 0deg,
- #667eea33, #764ba233, #f093fb33, #f5576c33,
- #43e97b33, #38f9d733, #4facfe33, #667eea33
- );
+ /* 预模糊的多层径向渐变代替 conic-gradient + filter: blur():
+ blur 滤镜叠加旋转动画会逐帧重栅格化、严重拖垮合成器;
+ 渐变自带柔边,动画只走 transform,全程留在合成线程 */
+ background:
+ radial-gradient(45% 45% at 25% 25%, rgba(102, 126, 234, 0.4), transparent 70%),
+ radial-gradient(50% 50% at 75% 20%, rgba(240, 147, 251, 0.35), transparent 70%),
+ radial-gradient(45% 50% at 80% 75%, rgba(67, 233, 123, 0.3), transparent 70%),
+ radial-gradient(50% 45% at 25% 80%, rgba(79, 172, 254, 0.38), transparent 70%),
+ radial-gradient(60% 60% at 50% 50%, rgba(118, 75, 162, 0.25), transparent 75%);
border-radius: 24px;
- filter: blur(40px);
opacity: 0.6;
animation: glow-rotate 8s linear infinite;
+ will-change: transform;
z-index: 0;
}
.editor-preview[data-theme="dark"] .editor-preview__glow {
- opacity: 0.4;
- filter: blur(50px);
+ opacity: 0.45;
}
@keyframes glow-rotate {
@@ -705,8 +708,8 @@ onBeforeUnmount(() => {
border-radius: 12px;
font-size: 13px;
font-weight: 600;
- backdrop-filter: blur(12px);
- -webkit-backdrop-filter: blur(12px);
+ /* 不用 backdrop-filter(配合无限浮动动画时逐帧重采样背景,代价极高),
+ 改用高不透明度实底色,见 .label--* 与暗色覆盖 */
opacity: 0;
transform: translateY(10px) scale(0.9);
transition: none;
@@ -747,7 +750,7 @@ onBeforeUnmount(() => {
.label--themes {
top: 15%;
right: -75px;
- background: rgba(255, 255, 255, 0.85);
+ background: rgba(255, 255, 255, 0.94);
color: #333;
box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.1);
}
@@ -759,7 +762,7 @@ onBeforeUnmount(() => {
.label--ai {
bottom: 35%;
left: -70px;
- background: rgba(255, 255, 255, 0.85);
+ background: rgba(255, 255, 255, 0.94);
color: #333;
box-shadow: 0 4px 20px rgba(240, 147, 251, 0.15), 0 0 0 1px rgba(240, 147, 251, 0.1);
}
@@ -771,7 +774,7 @@ onBeforeUnmount(() => {
.label--collab {
top: 55%;
right: -85px;
- background: rgba(255, 255, 255, 0.85);
+ background: rgba(255, 255, 255, 0.94);
color: #333;
box-shadow: 0 4px 20px rgba(67, 233, 123, 0.15), 0 0 0 1px rgba(67, 233, 123, 0.1);
}
@@ -783,7 +786,7 @@ onBeforeUnmount(() => {
.label--word {
bottom: 10%;
left: -65px;
- background: rgba(255, 255, 255, 0.85);
+ background: rgba(255, 255, 255, 0.94);
color: #333;
box-shadow: 0 4px 20px rgba(79, 172, 254, 0.15), 0 0 0 1px rgba(79, 172, 254, 0.1);
}
@@ -793,7 +796,7 @@ onBeforeUnmount(() => {
}
.editor-preview[data-theme="dark"] .floating-label {
- background: rgba(26, 27, 38, 0.85);
+ background: rgba(26, 27, 38, 0.94);
color: #c0caf5;
}
@@ -892,7 +895,6 @@ onBeforeUnmount(() => {
}
.editor-preview__glow {
inset: -15px;
- filter: blur(30px);
}
}
@@ -932,7 +934,6 @@ onBeforeUnmount(() => {
.editor-preview__glow {
inset: -10px;
- filter: blur(25px);
}
.mobile-label {
diff --git a/demo/main.ts b/demo/main.ts
index 67d394e..f7a3e1c 100644
--- a/demo/main.ts
+++ b/demo/main.ts
@@ -1,6 +1,8 @@
import { createApp } from 'vue'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
+// KaTeX 样式:库不再内置,使用数学公式时需自行引入
+import 'katex/dist/katex.min.css'
import App from './App.vue'
const app = createApp(App)
diff --git a/package.json b/package.json
index 2f5b01a..55ee5a1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "tiptap-ui-kit",
- "version": "0.1.1",
+ "version": "0.2.0",
"description": "Beautiful Tiptap 3 + Vue 3 rich-text editor theme with AI support",
"type": "module",
"packageManager": "pnpm@9.15.9",
@@ -27,7 +27,6 @@
"dev": "vite",
"build": "vite build",
"build:demo": "vite build --config vite.config.demo.ts",
- "build:types": "vue-tsc --emitDeclarationOnly",
"preview": "vite preview",
"typecheck": "vue-tsc --noEmit",
"test": "vitest",
@@ -37,28 +36,42 @@
"prepare": "npm run build",
"prepublishOnly": "pnpm build",
"pack:check": "pnpm build && npm pack --dry-run",
- "release": "pnpm build && pnpm publish --access public",
- "moltbook": "node scripts/moltbook-bot.cjs",
- "moltbook:post": "node scripts/moltbook-bot.cjs post",
- "moltbook:status": "node scripts/moltbook-bot.cjs status",
- "moltbook:auto": "node scripts/moltbook-bot.cjs auto",
- "moltbook:smart": "node scripts/moltbook-smart-bot.cjs run",
- "moltbook:smart:auto": "node scripts/moltbook-smart-bot.cjs auto",
- "moltbook:feedback": "node scripts/moltbook-smart-bot.cjs feedback",
- "moltbook:monitor": "node scripts/moltbook-monitor.cjs",
- "moltbook:watch": "node scripts/moltbook-monitor.cjs watch"
+ "release": "pnpm build && pnpm publish --access public"
},
"peerDependencies": {
+ "@ant-design/icons-vue": "^7.0.1",
"@tiptap/core": "^3.0.0",
+ "@tiptap/extension-collaboration": "^3.0.0",
+ "@tiptap/extension-collaboration-cursor": "^2.26.2",
"@tiptap/pm": "^3.0.0",
"@tiptap/starter-kit": "^3.0.0",
"@tiptap/vue-3": "^3.0.0",
- "vue": "^3.4.0"
+ "ant-design-vue": "^4.0.0",
+ "vue": "^3.4.0",
+ "y-websocket": "^3.0.0",
+ "yjs": "^13.6.0"
+ },
+ "peerDependenciesMeta": {
+ "@tiptap/extension-collaboration": {
+ "optional": true
+ },
+ "@tiptap/extension-collaboration-cursor": {
+ "optional": true
+ },
+ "y-websocket": {
+ "optional": true
+ },
+ "yjs": {
+ "optional": true
+ }
},
"devDependencies": {
+ "@ant-design/icons-vue": "^7.0.1",
"@tiptap/core": "^3.7.2",
"@tiptap/extension-bubble-menu": "^3.7.2",
"@tiptap/extension-code-block-lowlight": "^3.7.1",
+ "@tiptap/extension-collaboration": "^3.13.0",
+ "@tiptap/extension-collaboration-cursor": "^2.26.2",
"@tiptap/extension-typography": "^3.7.2",
"@tiptap/extensions": "^3.11.1",
"@tiptap/pm": "^3.7.2",
@@ -70,10 +83,9 @@
"@vitejs/plugin-vue": "^5.2.1",
"@vitest/ui": "^4.0.18",
"@vue/test-utils": "^2.4.6",
+ "ant-design-vue": "^4.2.6",
"happy-dom": "^20.4.0",
"lowlight": "^3.3.0",
- "lucide-vue-next": "^0.507.0",
- "rollup-plugin-obfuscator": "^1.1.0",
"sass-embedded": "^1.96.0",
"terser": "^5.44.1",
"typescript": "^5.7.2",
@@ -82,7 +94,9 @@
"vitest": "^4.0.18",
"vue": "^3.5.13",
"vue-tsc": "^2.1.10",
- "vue-types": "^3.0.2"
+ "vue-types": "^3.0.2",
+ "y-websocket": "^3.0.0",
+ "yjs": "^13.6.27"
},
"keywords": [
"tiptap",
@@ -137,10 +151,7 @@
"pnpm": ">=8.0.0"
},
"dependencies": {
- "@ant-design/icons-vue": "^7.0.1",
"@tiptap/extension-character-count": "^3.0.0",
- "@tiptap/extension-collaboration": "^3.13.0",
- "@tiptap/extension-collaboration-cursor": "^2.26.2",
"@tiptap/extension-color": "^3.0.0",
"@tiptap/extension-font-family": "^3.7.2",
"@tiptap/extension-highlight": "^3.0.0",
@@ -158,12 +169,9 @@
"@tiptap/extension-text-align": "^3.0.0",
"@tiptap/extension-text-style": "^3.0.0",
"@tiptap/extension-underline": "^3.0.0",
- "ant-design-vue": "^4.2.6",
"docx": "^9.5.1",
"file-saver": "^2.0.5",
"katex": "^0.16.28",
- "mammoth": "^1.11.0",
- "y-websocket": "^3.0.0",
- "yjs": "^13.6.27"
+ "mammoth": "^1.11.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 71e488d..82b9f67 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -8,18 +8,9 @@ importers:
.:
dependencies:
- '@ant-design/icons-vue':
- specifier: ^7.0.1
- version: 7.0.1(vue@3.5.25(typescript@5.9.3))
'@tiptap/extension-character-count':
specifier: ^3.0.0
version: 3.13.0(@tiptap/extensions@3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0))
- '@tiptap/extension-collaboration':
- specifier: ^3.13.0
- version: 3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(@tiptap/y-tiptap@3.0.1(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))(yjs@13.6.27)
- '@tiptap/extension-collaboration-cursor':
- specifier: ^2.26.2
- version: 2.26.2(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))
'@tiptap/extension-color':
specifier: ^3.0.0
version: 3.13.0(@tiptap/extension-text-style@3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0)))
@@ -71,9 +62,6 @@ importers:
'@tiptap/extension-underline':
specifier: ^3.0.0
version: 3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))
- ant-design-vue:
- specifier: ^4.2.6
- version: 4.2.6(vue@3.5.25(typescript@5.9.3))
docx:
specifier: ^9.5.1
version: 9.5.1
@@ -86,13 +74,10 @@ importers:
mammoth:
specifier: ^1.11.0
version: 1.11.0
- y-websocket:
- specifier: ^3.0.0
- version: 3.0.0(yjs@13.6.27)
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
+ '@ant-design/icons-vue':
+ specifier: ^7.0.1
+ version: 7.0.1(vue@3.5.25(typescript@5.9.3))
'@tiptap/core':
specifier: ^3.7.2
version: 3.13.0(@tiptap/pm@3.13.0)
@@ -102,6 +87,12 @@ importers:
'@tiptap/extension-code-block-lowlight':
specifier: ^3.7.1
version: 3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/extension-code-block@3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(highlight.js@11.11.1)(lowlight@3.3.0)
+ '@tiptap/extension-collaboration':
+ specifier: ^3.13.0
+ version: 3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(@tiptap/y-tiptap@3.0.1(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))(yjs@13.6.27)
+ '@tiptap/extension-collaboration-cursor':
+ specifier: ^2.26.2
+ version: 2.26.2(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))
'@tiptap/extension-typography':
specifier: ^3.7.2
version: 3.13.0(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))
@@ -135,18 +126,15 @@ importers:
'@vue/test-utils':
specifier: ^2.4.6
version: 2.4.6
+ ant-design-vue:
+ specifier: ^4.2.6
+ version: 4.2.6(vue@3.5.25(typescript@5.9.3))
happy-dom:
specifier: ^20.4.0
version: 20.4.0
lowlight:
specifier: ^3.3.0
version: 3.3.0
- lucide-vue-next:
- specifier: ^0.507.0
- version: 0.507.0(vue@3.5.25(typescript@5.9.3))
- rollup-plugin-obfuscator:
- specifier: ^1.1.0
- version: 1.1.0(javascript-obfuscator@5.1.0)(rollup@4.53.3)
sass-embedded:
specifier: ^1.96.0
version: 1.96.0
@@ -174,6 +162,12 @@ importers:
vue-types:
specifier: ^3.0.2
version: 3.0.2(vue@3.5.25(typescript@5.9.3))
+ y-websocket:
+ specifier: ^3.0.0
+ version: 3.0.0(yjs@13.6.27)
+ yjs:
+ specifier: ^13.6.27
+ version: 13.6.27
packages:
@@ -387,17 +381,6 @@ packages:
'@floating-ui/utils@0.2.10':
resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==}
- '@inversifyjs/common@1.3.3':
- resolution: {integrity: sha512-ZH0wrgaJwIo3s9gMCDM2wZoxqrJ6gB97jWXncROfYdqZJv8f3EkqT57faZqN5OTeHWgtziQ6F6g3L8rCvGceCw==}
-
- '@inversifyjs/core@1.3.4':
- resolution: {integrity: sha512-gCCmA4BdbHEFwvVZ2elWgHuXZWk6AOu/1frxsS+2fWhjEk2c/IhtypLo5ytSUie1BCiT6i9qnEo4bruBomQsAA==}
-
- '@inversifyjs/reflect-metadata-utils@0.2.3':
- resolution: {integrity: sha512-d3D0o9TeSlvaGM2I24wcNw/Aj3rc4OYvHXOKDC09YEph5fMMiKd6fq1VTQd9tOkDNWvVbw+cnt45Wy9P/t5Lvw==}
- peerDependencies:
- reflect-metadata: 0.2.2
-
'@isaacs/balanced-match@4.0.1':
resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==}
engines: {node: 20 || >=22}
@@ -410,14 +393,6 @@ packages:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
- '@javascript-obfuscator/escodegen@2.3.1':
- resolution: {integrity: sha512-Z0HEAVwwafOume+6LFXirAVZeuEMKWuPzpFbQhCEU9++BMz0IwEa9bmedJ+rMn/IlXRBID9j3gQ0XYAa6jM10g==}
- engines: {node: '>=6.0'}
-
- '@javascript-obfuscator/estraverse@5.4.0':
- resolution: {integrity: sha512-CZFX7UZVN9VopGbjTx4UXaXsi9ewoM1buL0kY7j1ftYdSs7p2spv9opxFjHlQ/QGTgh4UqufYqJJ0WKLml7b6w==}
- engines: {node: '>=4.0'}
-
'@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
@@ -995,9 +970,6 @@ packages:
'@types/mdurl@2.0.0':
resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==}
- '@types/minimatch@3.0.5':
- resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
-
'@types/node@24.10.12':
resolution: {integrity: sha512-68e+T28EbdmLSTkPgs3+UacC6rzmqrcWFPQs1C8mwJhI/r5Uxr0yEuQotczNRROd1gq30NGxee+fo0rSIxpyAw==}
@@ -1007,9 +979,6 @@ packages:
'@types/unist@3.0.3':
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
- '@types/validator@13.15.10':
- resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==}
-
'@types/whatwg-mimetype@3.0.2':
resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==}
@@ -1162,9 +1131,6 @@ packages:
ajv@8.13.0:
resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==}
- ajv@8.17.1:
- resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}
-
alien-signals@0.4.14:
resolution: {integrity: sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==}
@@ -1199,24 +1165,9 @@ packages:
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
- array-differ@3.0.0:
- resolution: {integrity: sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==}
- engines: {node: '>=8'}
-
array-tree-filter@2.1.0:
resolution: {integrity: sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==}
- array-union@2.1.0:
- resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
- engines: {node: '>=8'}
-
- arrify@2.0.1:
- resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==}
- engines: {node: '>=8'}
-
- assert@2.1.0:
- resolution: {integrity: sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==}
-
assertion-error@2.0.1:
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
engines: {node: '>=12'}
@@ -1224,13 +1175,6 @@ packages:
async-validator@4.2.5:
resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==}
- atomically@2.1.0:
- resolution: {integrity: sha512-+gDffFXRW6sl/HCwbta7zK4uNqbPjv4YJEAdz7Vu+FLQHe77eZ4bvbJGi4hE0QPeJlMYMA3piXEr1UL3dAwx7Q==}
-
- available-typed-arrays@1.0.7:
- resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
- engines: {node: '>= 0.4'}
-
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
@@ -1240,9 +1184,6 @@ packages:
bluebird@3.4.7:
resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==}
- brace-expansion@1.1.12:
- resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}
-
brace-expansion@2.0.2:
resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}
@@ -1256,43 +1197,14 @@ packages:
buffer-from@1.1.2:
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
- call-bind-apply-helpers@1.0.2:
- resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
- engines: {node: '>= 0.4'}
-
- call-bind@1.0.8:
- resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==}
- engines: {node: '>= 0.4'}
-
- call-bound@1.0.4:
- resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
- engines: {node: '>= 0.4'}
-
chai@6.2.2:
resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==}
engines: {node: '>=18'}
- chalk@4.1.2:
- resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
- engines: {node: '>=10'}
-
- chance@1.1.13:
- resolution: {integrity: sha512-V6lQCljcLznE7tUYUM9EOAnnKXbctE6j/rdQkYOHIWbfGQbrzTsAXNW9CdU5XCo4ArXQCj/rb6HgxPlmGJcaUg==}
-
- char-regex@1.0.2:
- resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==}
- engines: {node: '>=10'}
-
- charenc@0.0.2:
- resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==}
-
chokidar@4.0.3:
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
- class-validator@0.14.3:
- resolution: {integrity: sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==}
-
color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
@@ -1307,10 +1219,6 @@ packages:
resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==}
engines: {node: '>=14'}
- commander@12.1.0:
- resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==}
- engines: {node: '>=18'}
-
commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
@@ -1324,13 +1232,6 @@ packages:
compute-scroll-into-view@1.0.20:
resolution: {integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==}
- concat-map@0.0.1:
- resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
-
- conf@15.0.2:
- resolution: {integrity: sha512-JBSrutapCafTrddF9dH3lc7+T2tBycGF4uPkI4Js+g4vLLEhG6RZcFi3aJd5zntdf5tQxAejJt8dihkoQ/eSJw==}
- engines: {node: '>=20'}
-
confbox@0.1.8:
resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
@@ -1353,9 +1254,6 @@ packages:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
- crypt@0.0.2:
- resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==}
-
csstype@3.2.3:
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
@@ -1365,10 +1263,6 @@ packages:
de-indent@1.0.2:
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
- debounce-fn@6.0.0:
- resolution: {integrity: sha512-rBMW+F2TXryBwB54Q0d8drNEI+TfoS9JpNTAoVpukbWEhjXQq4rySFYLaqXMFXwdv61Zb2OHtj5bviSoimqxRQ==}
- engines: {node: '>=18'}
-
debug@4.4.3:
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
@@ -1378,17 +1272,6 @@ packages:
supports-color:
optional: true
- deep-is@0.1.4:
- resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
-
- define-data-property@1.1.4:
- resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
- engines: {node: '>= 0.4'}
-
- define-properties@1.2.1:
- resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
- engines: {node: '>= 0.4'}
-
dequal@2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
@@ -1418,17 +1301,9 @@ packages:
dom-scroll-into-view@2.0.1:
resolution: {integrity: sha512-bvVTQe1lfaUr1oFzZX80ce9KLDlZ3iU+XGNE/bz9HnGdklTieqsbmsLHe+rT2XWqopvL0PckkYqN7ksmm5pe3w==}
- dot-prop@10.1.0:
- resolution: {integrity: sha512-MVUtAugQMOff5RnBy2d9N31iG0lNwg1qAoAOn7pOK5wf94WIaE3My2p3uwTQuvS2AcqchkcR3bHByjaM0mmi7Q==}
- engines: {node: '>=20'}
-
duck@0.1.12:
resolution: {integrity: sha512-wkctla1O6VfP89gQ+J/yDesM0S7B7XLXjKGzXxMDVFg7uEn706niAtyYovKbyq1oT9YwDcly721/iUWoc8MVRg==}
- dunder-proto@1.0.1:
- resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
- engines: {node: '>= 0.4'}
-
eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
@@ -1447,25 +1322,9 @@ packages:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
- env-paths@3.0.0:
- resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
- es-define-property@1.0.1:
- resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
- engines: {node: '>= 0.4'}
-
- es-errors@1.3.0:
- resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
- engines: {node: '>= 0.4'}
-
es-module-lexer@1.7.0:
resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}
- es-object-atoms@1.1.1:
- resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
- engines: {node: '>= 0.4'}
-
esbuild@0.25.12:
resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==}
engines: {node: '>=18'}
@@ -1475,37 +1334,12 @@ packages:
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
engines: {node: '>=10'}
- eslint-scope@8.4.0:
- resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
- eslint-visitor-keys@4.2.1:
- resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
- esprima@4.0.1:
- resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
- engines: {node: '>=4'}
- hasBin: true
-
- esrecurse@4.3.0:
- resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
- engines: {node: '>=4.0'}
-
- estraverse@5.3.0:
- resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
- engines: {node: '>=4.0'}
-
estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
- esutils@2.0.3:
- resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
- engines: {node: '>=0.10.0'}
-
expect-type@1.3.0:
resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==}
engines: {node: '>=12.0.0'}
@@ -1516,12 +1350,6 @@ packages:
fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
- fast-levenshtein@2.0.6:
- resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
-
- fast-uri@3.1.0:
- resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==}
-
fdir@6.5.0:
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
engines: {node: '>=12.0.0'}
@@ -1544,10 +1372,6 @@ packages:
flatted@3.3.3:
resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==}
- for-each@0.3.5:
- resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
- engines: {node: '>= 0.4'}
-
foreground-child@3.3.1:
resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
engines: {node: '>=14'}
@@ -1564,27 +1388,11 @@ packages:
function-bind@1.1.2:
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
- generator-function@2.0.1:
- resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==}
- engines: {node: '>= 0.4'}
-
- get-intrinsic@1.3.0:
- resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
- engines: {node: '>= 0.4'}
-
- get-proto@1.0.1:
- resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
- engines: {node: '>= 0.4'}
-
glob@10.5.0:
resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==}
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
hasBin: true
- gopd@1.2.0:
- resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
- engines: {node: '>= 0.4'}
-
graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
@@ -1596,17 +1404,6 @@ packages:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'}
- has-property-descriptors@1.0.2:
- resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
-
- has-symbols@1.1.0:
- resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
- engines: {node: '>= 0.4'}
-
- has-tostringtag@1.0.2:
- resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
- engines: {node: '>= 0.4'}
-
hash.js@1.1.7:
resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==}
@@ -1638,20 +1435,6 @@ packages:
ini@1.3.8:
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
- inversify@6.1.4:
- resolution: {integrity: sha512-PbxrZH/gTa1fpPEEGAjJQzK8tKMIp5gRg6EFNJlCtzUcycuNdmhv3uk5P8Itm/RIjgHJO16oQRLo9IHzQN51bA==}
-
- is-arguments@1.2.0:
- resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==}
- engines: {node: '>= 0.4'}
-
- is-buffer@1.1.6:
- resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==}
-
- is-callable@1.2.7:
- resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
- engines: {node: '>= 0.4'}
-
is-core-module@2.16.1:
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
engines: {node: '>= 0.4'}
@@ -1664,18 +1447,10 @@ packages:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
- is-generator-function@1.1.2:
- resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==}
- engines: {node: '>= 0.4'}
-
is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
- is-nan@1.3.2:
- resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==}
- engines: {node: '>= 0.4'}
-
is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
@@ -1684,14 +1459,6 @@ packages:
resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==}
engines: {node: '>=0.10.0'}
- is-regex@1.2.1:
- resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==}
- engines: {node: '>= 0.4'}
-
- is-typed-array@1.1.15:
- resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==}
- engines: {node: '>= 0.4'}
-
isarray@1.0.0:
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
@@ -1704,11 +1471,6 @@ packages:
jackspeak@3.4.3:
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
- javascript-obfuscator@5.1.0:
- resolution: {integrity: sha512-yw0zSxH20YVxJ7Jg23ii9eojcsGkfZmP6AEvaddv026+3H3QPOd/qPo168+80gvzN6pyMQDCbLwxjrP76jkPAg==}
- engines: {node: '>=18.0.0'}
- hasBin: true
-
jju@1.4.0:
resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==}
@@ -1721,19 +1483,12 @@ packages:
resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==}
engines: {node: '>=14'}
- js-string-escape@1.0.1:
- resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==}
- engines: {node: '>= 0.8'}
-
js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
json-schema-traverse@1.0.0:
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
- json-schema-typed@8.0.2:
- resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==}
-
jsonfile@6.2.0:
resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==}
@@ -1747,18 +1502,11 @@ packages:
kolorist@1.8.0:
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
- levn@0.3.0:
- resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==}
- engines: {node: '>= 0.8.0'}
-
lib0@0.2.114:
resolution: {integrity: sha512-gcxmNFzA4hv8UYi8j43uPlQ7CGcyMJ2KQb5kZASw6SnAKAf10hK12i2fjrS3Cl/ugZa5Ui6WwIu1/6MIXiHttQ==}
engines: {node: '>=16'}
hasBin: true
- libphonenumber-js@1.12.31:
- resolution: {integrity: sha512-Z3IhgVgrqO1S5xPYM3K5XwbkDasU67/Vys4heW+lfSBALcUZjeIIzI8zCLifY+OCzSq+fpDdywMDa7z+4srJPQ==}
-
lie@3.3.0:
resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==}
@@ -1795,12 +1543,6 @@ packages:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
- lucide-vue-next@0.507.0:
- resolution: {integrity: sha512-n0AZRmez4xq5vu5ZOfnrhC5wKBpu5tpwDHA6Ue2+sKyJv3USAPxqIerXLbdYbkHRW1tVZ3U9GE1MACsu6X/Z7Q==}
- deprecated: Package deprecated. Please use @lucide/vue instead.
- peerDependencies:
- vue: '>=3.0.1'
-
magic-string@0.30.21:
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
@@ -1813,13 +1555,6 @@ packages:
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
hasBin: true
- math-intrinsics@1.1.0:
- resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
- engines: {node: '>= 0.4'}
-
- md5@2.3.0:
- resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==}
-
mdurl@2.0.0:
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
@@ -1827,10 +1562,6 @@ packages:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
- mimic-function@5.0.1:
- resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}
- engines: {node: '>=18'}
-
minimalistic-assert@1.0.1:
resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==}
@@ -1838,9 +1569,6 @@ packages:
resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==}
engines: {node: 20 || >=22}
- minimatch@3.1.2:
- resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
-
minimatch@9.0.1:
resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -1853,11 +1581,6 @@ packages:
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
engines: {node: '>=16 || 14 >=14.17'}
- mkdirp@3.0.1:
- resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==}
- engines: {node: '>=10'}
- hasBin: true
-
mlly@1.8.0:
resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==}
@@ -1871,10 +1594,6 @@ packages:
muggle-string@0.4.1:
resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==}
- multimatch@5.0.0:
- resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==}
- engines: {node: '>=10'}
-
nanoid@3.3.11:
resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -1896,28 +1615,12 @@ packages:
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
hasBin: true
- object-is@1.1.6:
- resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==}
- engines: {node: '>= 0.4'}
-
- object-keys@1.1.1:
- resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
- engines: {node: '>= 0.4'}
-
- object.assign@4.1.7:
- resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
- engines: {node: '>= 0.4'}
-
obug@2.1.1:
resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==}
option@0.2.4:
resolution: {integrity: sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A==}
- optionator@0.8.3:
- resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
- engines: {node: '>= 0.8.0'}
-
orderedmap@2.1.1:
resolution: {integrity: sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==}
@@ -1965,25 +1668,13 @@ packages:
pkg-types@2.3.0:
resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==}
- possible-typed-array-names@1.1.0:
- resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
- engines: {node: '>= 0.4'}
-
postcss@8.5.6:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
- prelude-ls@1.1.2:
- resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
- engines: {node: '>= 0.8.0'}
-
process-nextick-args@2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
- process@0.11.10:
- resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}
- engines: {node: '>= 0.6.0'}
-
prosemirror-changeset@2.3.1:
resolution: {integrity: sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ==}
@@ -2063,9 +1754,6 @@ packages:
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
- reflect-metadata@0.2.2:
- resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
-
require-from-string@2.0.2:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
@@ -2078,12 +1766,6 @@ packages:
engines: {node: '>= 0.4'}
hasBin: true
- rollup-plugin-obfuscator@1.1.0:
- resolution: {integrity: sha512-cMfQIKyGePlfHGGO+rSDhSATMBx7WWxXW/X66c53HylUE/owanTbG6nhttUQOkbdCiQH8tClskNEH/IPRoqZwA==}
- peerDependencies:
- javascript-obfuscator: '*'
- rollup: ^2.56.3||^3.0.0||^4.0.0
-
rollup@4.53.3:
resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -2098,10 +1780,6 @@ packages:
safe-buffer@5.1.2:
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
- safe-regex-test@1.1.0:
- resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
- engines: {node: '>= 0.4'}
-
sass-embedded-all-unknown@1.96.0:
resolution: {integrity: sha512-UfUHoWZtxmsDjDfK+fKCy0aJe6zThu7oaIQx0c/vnHgvprcddEPIay01qTXhiUa3cFcsMmvlBvPTVw0gjKVtVQ==}
cpu: ['!arm', '!arm64', '!riscv64', '!x64']
@@ -2233,10 +1911,6 @@ packages:
engines: {node: '>=10'}
hasBin: true
- set-function-length@1.2.2:
- resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
- engines: {node: '>= 0.4'}
-
setimmediate@1.0.5:
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
@@ -2286,9 +1960,6 @@ packages:
resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==}
engines: {node: '>=0.6.19'}
- string-template@1.0.0:
- resolution: {integrity: sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==}
-
string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
@@ -2300,9 +1971,6 @@ packages:
string_decoder@1.1.1:
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
- stringz@2.1.0:
- resolution: {integrity: sha512-KlywLT+MZ+v0IRepfMxRtnSvDCMc3nR1qqCs3m/qIbSOWkNZYT8XHQA31rS3TnKp0c5xjZu3M4GY/2aRKSi/6A==}
-
strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
@@ -2315,19 +1983,9 @@ packages:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
- stubborn-fs@2.0.0:
- resolution: {integrity: sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==}
-
- stubborn-utils@1.0.2:
- resolution: {integrity: sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==}
-
stylis@4.3.6:
resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==}
- supports-color@7.2.0:
- resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
- engines: {node: '>=8'}
-
supports-color@8.1.1:
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
engines: {node: '>=10'}
@@ -2344,10 +2002,6 @@ packages:
resolution: {integrity: sha512-GTt8rSKje5FilG+wEdfCkOcLL7LWqpMlr2c3LRuKt/YXxcJ52aGSbGBAdI4L3aaqfrBt6y711El53ItyH1NWzg==}
engines: {node: '>=16.0.0'}
- tagged-tag@1.0.0:
- resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==}
- engines: {node: '>=20'}
-
terser@5.44.1:
resolution: {integrity: sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==}
engines: {node: '>=10'}
@@ -2383,14 +2037,6 @@ packages:
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
- type-check@0.3.2:
- resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
- engines: {node: '>= 0.8.0'}
-
- type-fest@5.3.1:
- resolution: {integrity: sha512-VCn+LMHbd4t6sF3wfU/+HKT63C9OoyrSIf4b+vtWHpt2U7/4InZG467YDNMFMR70DdHjAdpPWmw2lzRdg0Xqqg==}
- engines: {node: '>=20'}
-
typescript@5.8.2:
resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==}
engines: {node: '>=14.17'}
@@ -2407,10 +2053,6 @@ packages:
ufo@1.6.1:
resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==}
- uint8array-extras@1.5.0:
- resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==}
- engines: {node: '>=18'}
-
underscore@1.13.7:
resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==}
@@ -2427,13 +2069,6 @@ packages:
util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
- util@0.12.5:
- resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==}
-
- validator@13.15.23:
- resolution: {integrity: sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==}
- engines: {node: '>= 0.10'}
-
varint@6.0.0:
resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==}
@@ -2556,13 +2191,6 @@ packages:
resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==}
engines: {node: '>=12'}
- when-exit@2.1.5:
- resolution: {integrity: sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==}
-
- which-typed-array@1.1.19:
- resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==}
- engines: {node: '>= 0.4'}
-
which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
@@ -2573,10 +2201,6 @@ packages:
engines: {node: '>=8'}
hasBin: true
- word-wrap@1.2.5:
- resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
- engines: {node: '>=0.10.0'}
-
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@@ -2763,19 +2387,6 @@ snapshots:
'@floating-ui/utils@0.2.10': {}
- '@inversifyjs/common@1.3.3': {}
-
- '@inversifyjs/core@1.3.4(reflect-metadata@0.2.2)':
- dependencies:
- '@inversifyjs/common': 1.3.3
- '@inversifyjs/reflect-metadata-utils': 0.2.3(reflect-metadata@0.2.2)
- transitivePeerDependencies:
- - reflect-metadata
-
- '@inversifyjs/reflect-metadata-utils@0.2.3(reflect-metadata@0.2.2)':
- dependencies:
- reflect-metadata: 0.2.2
-
'@isaacs/balanced-match@4.0.1': {}
'@isaacs/brace-expansion@5.0.0':
@@ -2791,17 +2402,6 @@ snapshots:
wrap-ansi: 8.1.0
wrap-ansi-cjs: wrap-ansi@7.0.0
- '@javascript-obfuscator/escodegen@2.3.1':
- dependencies:
- '@javascript-obfuscator/estraverse': 5.4.0
- esprima: 4.0.1
- esutils: 2.0.3
- optionator: 0.8.3
- optionalDependencies:
- source-map: 0.6.1
-
- '@javascript-obfuscator/estraverse@5.4.0': {}
-
'@jridgewell/gen-mapping@0.3.13':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
@@ -3344,8 +2944,6 @@ snapshots:
'@types/mdurl@2.0.0': {}
- '@types/minimatch@3.0.5': {}
-
'@types/node@24.10.12':
dependencies:
undici-types: 7.16.0
@@ -3356,8 +2954,6 @@ snapshots:
'@types/unist@3.0.3': {}
- '@types/validator@13.15.10': {}
-
'@types/whatwg-mimetype@3.0.2': {}
'@types/ws@8.18.1':
@@ -3547,10 +3143,6 @@ snapshots:
optionalDependencies:
ajv: 8.13.0
- ajv-formats@3.0.1(ajv@8.17.1):
- optionalDependencies:
- ajv: 8.17.1
-
ajv@8.12.0:
dependencies:
fast-deep-equal: 3.1.3
@@ -3565,13 +3157,6 @@ snapshots:
require-from-string: 2.0.2
uri-js: 4.4.1
- ajv@8.17.1:
- dependencies:
- fast-deep-equal: 3.1.3
- fast-uri: 3.1.0
- json-schema-traverse: 1.0.0
- require-from-string: 2.0.2
-
alien-signals@0.4.14: {}
alien-signals@1.0.13: {}
@@ -3618,46 +3203,18 @@ snapshots:
argparse@2.0.1: {}
- array-differ@3.0.0: {}
-
array-tree-filter@2.1.0: {}
- array-union@2.1.0: {}
-
- arrify@2.0.1: {}
-
- assert@2.1.0:
- dependencies:
- call-bind: 1.0.8
- is-nan: 1.3.2
- object-is: 1.1.6
- object.assign: 4.1.7
- util: 0.12.5
-
assertion-error@2.0.1: {}
async-validator@4.2.5: {}
- atomically@2.1.0:
- dependencies:
- stubborn-fs: 2.0.0
- when-exit: 2.1.5
-
- available-typed-arrays@1.0.7:
- dependencies:
- possible-typed-array-names: 1.1.0
-
balanced-match@1.0.2: {}
base64-js@1.5.1: {}
bluebird@3.4.7: {}
- brace-expansion@1.1.12:
- dependencies:
- balanced-match: 1.0.2
- concat-map: 0.0.1
-
brace-expansion@2.0.2:
dependencies:
balanced-match: 1.0.2
@@ -3671,47 +3228,13 @@ snapshots:
buffer-from@1.1.2: {}
- call-bind-apply-helpers@1.0.2:
- dependencies:
- es-errors: 1.3.0
- function-bind: 1.1.2
-
- call-bind@1.0.8:
- dependencies:
- call-bind-apply-helpers: 1.0.2
- es-define-property: 1.0.1
- get-intrinsic: 1.3.0
- set-function-length: 1.2.2
-
- call-bound@1.0.4:
- dependencies:
- call-bind-apply-helpers: 1.0.2
- get-intrinsic: 1.3.0
-
chai@6.2.2: {}
- chalk@4.1.2:
- dependencies:
- ansi-styles: 4.3.0
- supports-color: 7.2.0
-
- chance@1.1.13: {}
-
- char-regex@1.0.2: {}
-
- charenc@0.0.2: {}
-
chokidar@4.0.3:
dependencies:
readdirp: 4.1.2
optional: true
- class-validator@0.14.3:
- dependencies:
- '@types/validator': 13.15.10
- libphonenumber-js: 1.12.31
- validator: 13.15.23
-
color-convert@2.0.1:
dependencies:
color-name: 1.1.4
@@ -3722,8 +3245,6 @@ snapshots:
commander@10.0.1: {}
- commander@12.1.0: {}
-
commander@2.20.3: {}
commander@8.3.0: {}
@@ -3732,20 +3253,6 @@ snapshots:
compute-scroll-into-view@1.0.20: {}
- concat-map@0.0.1: {}
-
- conf@15.0.2:
- dependencies:
- ajv: 8.17.1
- ajv-formats: 3.0.1(ajv@8.17.1)
- atomically: 2.1.0
- debounce-fn: 6.0.0
- dot-prop: 10.1.0
- env-paths: 3.0.0
- json-schema-typed: 8.0.2
- semver: 7.7.3
- uint8array-extras: 1.5.0
-
confbox@0.1.8: {}
confbox@0.2.2: {}
@@ -3767,36 +3274,16 @@ snapshots:
shebang-command: 2.0.0
which: 2.0.2
- crypt@0.0.2: {}
-
csstype@3.2.3: {}
dayjs@1.11.19: {}
de-indent@1.0.2: {}
- debounce-fn@6.0.0:
- dependencies:
- mimic-function: 5.0.1
-
debug@4.4.3:
dependencies:
ms: 2.1.3
- deep-is@0.1.4: {}
-
- define-data-property@1.1.4:
- dependencies:
- es-define-property: 1.0.1
- es-errors: 1.3.0
- gopd: 1.2.0
-
- define-properties@1.2.1:
- dependencies:
- define-data-property: 1.1.4
- has-property-descriptors: 1.0.2
- object-keys: 1.1.1
-
dequal@2.0.3: {}
detect-libc@1.0.3:
@@ -3823,20 +3310,10 @@ snapshots:
dom-scroll-into-view@2.0.1: {}
- dot-prop@10.1.0:
- dependencies:
- type-fest: 5.3.1
-
duck@0.1.12:
dependencies:
underscore: 1.13.7
- dunder-proto@1.0.1:
- dependencies:
- call-bind-apply-helpers: 1.0.2
- es-errors: 1.3.0
- gopd: 1.2.0
-
eastasianwidth@0.2.0: {}
editorconfig@1.0.4:
@@ -3852,18 +3329,8 @@ snapshots:
entities@4.5.0: {}
- env-paths@3.0.0: {}
-
- es-define-property@1.0.1: {}
-
- es-errors@1.3.0: {}
-
es-module-lexer@1.7.0: {}
- es-object-atoms@1.1.1:
- dependencies:
- es-errors: 1.3.0
-
esbuild@0.25.12:
optionalDependencies:
'@esbuild/aix-ppc64': 0.25.12
@@ -3895,39 +3362,18 @@ snapshots:
escape-string-regexp@4.0.0: {}
- eslint-scope@8.4.0:
- dependencies:
- esrecurse: 4.3.0
- estraverse: 5.3.0
-
- eslint-visitor-keys@4.2.1: {}
-
- esprima@4.0.1: {}
-
- esrecurse@4.3.0:
- dependencies:
- estraverse: 5.3.0
-
- estraverse@5.3.0: {}
-
estree-walker@2.0.2: {}
estree-walker@3.0.3:
dependencies:
'@types/estree': 1.0.8
- esutils@2.0.3: {}
-
expect-type@1.3.0: {}
exsolve@1.0.8: {}
fast-deep-equal@3.1.3: {}
- fast-levenshtein@2.0.6: {}
-
- fast-uri@3.1.0: {}
-
fdir@6.5.0(picomatch@4.0.3):
optionalDependencies:
picomatch: 4.0.3
@@ -3943,10 +3389,6 @@ snapshots:
flatted@3.3.3: {}
- for-each@0.3.5:
- dependencies:
- is-callable: 1.2.7
-
foreground-child@3.3.1:
dependencies:
cross-spawn: 7.0.6
@@ -3963,26 +3405,6 @@ snapshots:
function-bind@1.1.2: {}
- generator-function@2.0.1: {}
-
- get-intrinsic@1.3.0:
- dependencies:
- call-bind-apply-helpers: 1.0.2
- es-define-property: 1.0.1
- es-errors: 1.3.0
- es-object-atoms: 1.1.1
- function-bind: 1.1.2
- get-proto: 1.0.1
- gopd: 1.2.0
- has-symbols: 1.1.0
- hasown: 2.0.2
- math-intrinsics: 1.1.0
-
- get-proto@1.0.1:
- dependencies:
- dunder-proto: 1.0.1
- es-object-atoms: 1.1.1
-
glob@10.5.0:
dependencies:
foreground-child: 3.3.1
@@ -3992,8 +3414,6 @@ snapshots:
package-json-from-dist: 1.0.1
path-scurry: 1.11.1
- gopd@1.2.0: {}
-
graceful-fs@4.2.11: {}
happy-dom@20.4.0:
@@ -4010,16 +3430,6 @@ snapshots:
has-flag@4.0.0: {}
- has-property-descriptors@1.0.2:
- dependencies:
- es-define-property: 1.0.1
-
- has-symbols@1.1.0: {}
-
- has-tostringtag@1.0.2:
- dependencies:
- has-symbols: 1.1.0
-
hash.js@1.1.7:
dependencies:
inherits: 2.0.4
@@ -4043,22 +3453,6 @@ snapshots:
ini@1.3.8: {}
- inversify@6.1.4(reflect-metadata@0.2.2):
- dependencies:
- '@inversifyjs/common': 1.3.3
- '@inversifyjs/core': 1.3.4(reflect-metadata@0.2.2)
- transitivePeerDependencies:
- - reflect-metadata
-
- is-arguments@1.2.0:
- dependencies:
- call-bound: 1.0.4
- has-tostringtag: 1.0.2
-
- is-buffer@1.1.6: {}
-
- is-callable@1.2.7: {}
-
is-core-module@2.16.1:
dependencies:
hasown: 2.0.2
@@ -4068,40 +3462,16 @@ snapshots:
is-fullwidth-code-point@3.0.0: {}
- is-generator-function@1.1.2:
- dependencies:
- call-bound: 1.0.4
- generator-function: 2.0.1
- get-proto: 1.0.1
- has-tostringtag: 1.0.2
- safe-regex-test: 1.1.0
-
is-glob@4.0.3:
dependencies:
is-extglob: 2.1.1
optional: true
- is-nan@1.3.2:
- dependencies:
- call-bind: 1.0.8
- define-properties: 1.2.1
-
is-number@7.0.0:
optional: true
is-plain-object@3.0.1: {}
- is-regex@1.2.1:
- dependencies:
- call-bound: 1.0.4
- gopd: 1.2.0
- has-tostringtag: 1.0.2
- hasown: 2.0.2
-
- is-typed-array@1.1.15:
- dependencies:
- which-typed-array: 1.1.19
-
isarray@1.0.0: {}
isexe@2.0.0: {}
@@ -4114,32 +3484,6 @@ snapshots:
optionalDependencies:
'@pkgjs/parseargs': 0.11.0
- javascript-obfuscator@5.1.0:
- dependencies:
- '@javascript-obfuscator/escodegen': 2.3.1
- '@javascript-obfuscator/estraverse': 5.4.0
- acorn: 8.15.0
- assert: 2.1.0
- chalk: 4.1.2
- chance: 1.1.13
- class-validator: 0.14.3
- commander: 12.1.0
- conf: 15.0.2
- eslint-scope: 8.4.0
- eslint-visitor-keys: 4.2.1
- fast-deep-equal: 3.1.3
- inversify: 6.1.4(reflect-metadata@0.2.2)
- js-string-escape: 1.0.1
- md5: 2.3.0
- mkdirp: 3.0.1
- multimatch: 5.0.0
- process: 0.11.10
- reflect-metadata: 0.2.2
- source-map-support: 0.5.21
- string-template: 1.0.0
- stringz: 2.1.0
- tslib: 2.8.1
-
jju@1.4.0: {}
js-beautify@1.15.4:
@@ -4152,14 +3496,10 @@ snapshots:
js-cookie@3.0.5: {}
- js-string-escape@1.0.1: {}
-
js-tokens@4.0.0: {}
json-schema-traverse@1.0.0: {}
- json-schema-typed@8.0.2: {}
-
jsonfile@6.2.0:
dependencies:
universalify: 2.0.1
@@ -4179,17 +3519,10 @@ snapshots:
kolorist@1.8.0: {}
- levn@0.3.0:
- dependencies:
- prelude-ls: 1.1.2
- type-check: 0.3.2
-
lib0@0.2.114:
dependencies:
isomorphic.js: 0.2.5
- libphonenumber-js@1.12.31: {}
-
lie@3.3.0:
dependencies:
immediate: 3.0.6
@@ -4232,10 +3565,6 @@ snapshots:
dependencies:
yallist: 4.0.0
- lucide-vue-next@0.507.0(vue@3.5.25(typescript@5.9.3)):
- dependencies:
- vue: 3.5.25(typescript@5.9.3)
-
magic-string@0.30.21:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
@@ -4262,14 +3591,6 @@ snapshots:
punycode.js: 2.3.1
uc.micro: 2.1.0
- math-intrinsics@1.1.0: {}
-
- md5@2.3.0:
- dependencies:
- charenc: 0.0.2
- crypt: 0.0.2
- is-buffer: 1.1.6
-
mdurl@2.0.0: {}
micromatch@4.0.8:
@@ -4278,18 +3599,12 @@ snapshots:
picomatch: 2.3.1
optional: true
- mimic-function@5.0.1: {}
-
minimalistic-assert@1.0.1: {}
minimatch@10.0.3:
dependencies:
'@isaacs/brace-expansion': 5.0.0
- minimatch@3.1.2:
- dependencies:
- brace-expansion: 1.1.12
-
minimatch@9.0.1:
dependencies:
brace-expansion: 2.0.2
@@ -4300,8 +3615,6 @@ snapshots:
minipass@7.1.2: {}
- mkdirp@3.0.1: {}
-
mlly@1.8.0:
dependencies:
acorn: 8.15.0
@@ -4315,14 +3628,6 @@ snapshots:
muggle-string@0.4.1: {}
- multimatch@5.0.0:
- dependencies:
- '@types/minimatch': 3.0.5
- array-differ: 3.0.0
- array-union: 2.1.0
- arrify: 2.0.1
- minimatch: 3.1.2
-
nanoid@3.3.11: {}
nanoid@5.1.6: {}
@@ -4336,35 +3641,10 @@ snapshots:
dependencies:
abbrev: 2.0.0
- object-is@1.1.6:
- dependencies:
- call-bind: 1.0.8
- define-properties: 1.2.1
-
- object-keys@1.1.1: {}
-
- object.assign@4.1.7:
- dependencies:
- call-bind: 1.0.8
- call-bound: 1.0.4
- define-properties: 1.2.1
- es-object-atoms: 1.1.1
- has-symbols: 1.1.0
- object-keys: 1.1.1
-
obug@2.1.1: {}
option@0.2.4: {}
- optionator@0.8.3:
- dependencies:
- deep-is: 0.1.4
- fast-levenshtein: 2.0.6
- levn: 0.3.0
- prelude-ls: 1.1.2
- type-check: 0.3.2
- word-wrap: 1.2.5
-
orderedmap@2.1.1: {}
package-json-from-dist@1.0.1: {}
@@ -4405,20 +3685,14 @@ snapshots:
exsolve: 1.0.8
pathe: 2.0.3
- possible-typed-array-names@1.1.0: {}
-
postcss@8.5.6:
dependencies:
nanoid: 3.3.11
picocolors: 1.1.1
source-map-js: 1.2.1
- prelude-ls@1.1.2: {}
-
process-nextick-args@2.0.1: {}
- process@0.11.10: {}
-
prosemirror-changeset@2.3.1:
dependencies:
prosemirror-transform: 1.10.5
@@ -4543,8 +3817,6 @@ snapshots:
readdirp@4.1.2:
optional: true
- reflect-metadata@0.2.2: {}
-
require-from-string@2.0.2: {}
resize-observer-polyfill@1.5.1: {}
@@ -4555,12 +3827,6 @@ snapshots:
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
- rollup-plugin-obfuscator@1.1.0(javascript-obfuscator@5.1.0)(rollup@4.53.3):
- dependencies:
- '@rollup/pluginutils': 5.3.0(rollup@4.53.3)
- javascript-obfuscator: 5.1.0
- rollup: 4.53.3
-
rollup@4.53.3:
dependencies:
'@types/estree': 1.0.8
@@ -4597,12 +3863,6 @@ snapshots:
safe-buffer@5.1.2: {}
- safe-regex-test@1.1.0:
- dependencies:
- call-bound: 1.0.4
- es-errors: 1.3.0
- is-regex: 1.2.1
-
sass-embedded-all-unknown@1.96.0:
dependencies:
sass: 1.96.0
@@ -4712,15 +3972,6 @@ snapshots:
semver@7.7.3: {}
- set-function-length@1.2.2:
- dependencies:
- define-data-property: 1.1.4
- es-errors: 1.3.0
- function-bind: 1.1.2
- get-intrinsic: 1.3.0
- gopd: 1.2.0
- has-property-descriptors: 1.0.2
-
setimmediate@1.0.5: {}
shallow-equal@1.2.1: {}
@@ -4758,8 +4009,6 @@ snapshots:
string-argv@0.3.2: {}
- string-template@1.0.0: {}
-
string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0
@@ -4776,10 +4025,6 @@ snapshots:
dependencies:
safe-buffer: 5.1.2
- stringz@2.1.0:
- dependencies:
- char-regex: 1.0.2
-
strip-ansi@6.0.1:
dependencies:
ansi-regex: 5.0.1
@@ -4790,18 +4035,8 @@ snapshots:
strip-json-comments@3.1.1: {}
- stubborn-fs@2.0.0:
- dependencies:
- stubborn-utils: 1.0.2
-
- stubborn-utils@1.0.2: {}
-
stylis@4.3.6: {}
- supports-color@7.2.0:
- dependencies:
- has-flag: 4.0.0
-
supports-color@8.1.1:
dependencies:
has-flag: 4.0.0
@@ -4814,8 +4049,6 @@ snapshots:
sync-message-port@1.1.3: {}
- tagged-tag@1.0.0: {}
-
terser@5.44.1:
dependencies:
'@jridgewell/source-map': 0.3.11
@@ -4845,14 +4078,6 @@ snapshots:
tslib@2.8.1: {}
- type-check@0.3.2:
- dependencies:
- prelude-ls: 1.1.2
-
- type-fest@5.3.1:
- dependencies:
- tagged-tag: 1.0.0
-
typescript@5.8.2: {}
typescript@5.9.3: {}
@@ -4861,8 +4086,6 @@ snapshots:
ufo@1.6.1: {}
- uint8array-extras@1.5.0: {}
-
underscore@1.13.7: {}
undici-types@7.16.0: {}
@@ -4875,16 +4098,6 @@ snapshots:
util-deprecate@1.0.2: {}
- util@0.12.5:
- dependencies:
- inherits: 2.0.4
- is-arguments: 1.2.0
- is-generator-function: 1.1.2
- is-typed-array: 1.1.15
- which-typed-array: 1.1.19
-
- validator@13.15.23: {}
-
varint@6.0.0: {}
vite-plugin-dts@4.5.4(@types/node@25.0.2)(rollup@4.53.3)(typescript@5.9.3)(vite@6.4.1(@types/node@25.0.2)(sass-embedded@1.96.0)(sass@1.96.0)(terser@5.44.1)):
@@ -4993,18 +4206,6 @@ snapshots:
whatwg-mimetype@3.0.0: {}
- when-exit@2.1.5: {}
-
- which-typed-array@1.1.19:
- dependencies:
- available-typed-arrays: 1.0.7
- call-bind: 1.0.8
- call-bound: 1.0.4
- for-each: 0.3.5
- get-proto: 1.0.1
- gopd: 1.2.0
- has-tostringtag: 1.0.2
-
which@2.0.2:
dependencies:
isexe: 2.0.0
@@ -5014,8 +4215,6 @@ snapshots:
siginfo: 2.0.0
stackback: 0.0.2
- word-wrap@1.2.5: {}
-
wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
diff --git a/sponsor.html b/public/sponsor.html
similarity index 100%
rename from sponsor.html
rename to public/sponsor.html
diff --git a/src/__tests__/example.spec.ts b/src/__tests__/example.spec.ts
deleted file mode 100644
index b135668..0000000
--- a/src/__tests__/example.spec.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { describe, it, expect } from 'vitest'
-
-describe('Example Test Suite', () => {
- it('should pass basic assertion', () => {
- expect(true).toBe(true)
- })
-
- it('should perform basic math', () => {
- expect(1 + 1).toBe(2)
- })
-})
diff --git a/src/adapters/icons.d.ts b/src/adapters/icons.d.ts
deleted file mode 100644
index 1fa5430..0000000
--- a/src/adapters/icons.d.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Icons Adapter
- * Allows users to provide their own icon components
- */
-import type { Component } from 'vue';
-export type IconName = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'heading1' | 'heading2' | 'heading3' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'listBullet' | 'listOrdered' | 'listCheck' | 'link' | 'image' | 'table' | 'code' | 'codeBlock' | 'undo' | 'redo' | 'formatClear' | 'formatPainter' | 'subscript' | 'superscript' | 'quote' | 'horizontalRule' | 'plus' | 'minus' | 'close' | 'check' | 'chevronDown' | 'chevronUp' | 'chevronLeft' | 'chevronRight' | 'drag' | 'copy' | 'cut' | 'delete' | 'duplicate' | 'ai' | 'sparkles' | 'wand' | 'sun' | 'moon';
-export type IconAdapter = Partial>;
-/**
- * Default icons using Unicode/Emoji
- * Users can replace with Lucide, Ant Design Icons, etc.
- */
-export declare const defaultIconAdapter: IconAdapter;
-export declare function setIconAdapter(adapter: IconAdapter): void;
-export declare function getIconAdapter(): IconAdapter;
-export declare function getIcon(name: IconName): Component | string;
-//# sourceMappingURL=icons.d.ts.map
\ No newline at end of file
diff --git a/src/adapters/icons.d.ts.map b/src/adapters/icons.d.ts.map
deleted file mode 100644
index b20cf5d..0000000
--- a/src/adapters/icons.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,MAAM,QAAQ,GAChB,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,GACjD,UAAU,GAAG,UAAU,GAAG,UAAU,GACpC,WAAW,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,GAC3D,YAAY,GAAG,aAAa,GAAG,WAAW,GAC1C,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GACjD,MAAM,GAAG,MAAM,GACf,aAAa,GAAG,eAAe,GAC/B,WAAW,GAAG,aAAa,GAC3B,OAAO,GAAG,gBAAgB,GAC1B,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GACpC,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAC5D,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,GAChD,IAAI,GAAG,UAAU,GAAG,MAAM,GAC1B,KAAK,GAAG,MAAM,CAAA;AAElB,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAwBhC,CAAA;AAKD,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAEzD;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAE1D"}
\ No newline at end of file
diff --git a/src/adapters/index.d.ts b/src/adapters/index.d.ts
deleted file mode 100644
index 69be10c..0000000
--- a/src/adapters/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Adapters Entry
- * Provides compatibility layer for @vben/* packages
- */
-export { useUserStore, setUserInfo } from './user';
-export type { UserInfo } from './user';
-export { usePreferences, initTheme } from './preferences';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/adapters/index.d.ts.map b/src/adapters/index.d.ts.map
deleted file mode 100644
index 9229f2a..0000000
--- a/src/adapters/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAGtC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/src/adapters/notification.d.ts b/src/adapters/notification.d.ts
deleted file mode 100644
index 92409f5..0000000
--- a/src/adapters/notification.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Notification Adapter
- * Allows users to plug in their own notification system (e.g., ant-design-vue, element-plus)
- */
-export interface NotificationOptions {
- message: string;
- description?: string;
- duration?: number;
-}
-export interface NotificationAdapter {
- success(options: NotificationOptions): void;
- error(options: NotificationOptions): void;
- warning(options: NotificationOptions): void;
- info(options: NotificationOptions): void;
-}
-/**
- * Default notification adapter using console
- */
-export declare const defaultNotificationAdapter: NotificationAdapter;
-/**
- * Create an Ant Design Vue notification adapter
- * @example
- * import { notification } from 'ant-design-vue'
- * const adapter = createAntdNotificationAdapter(notification)
- */
-export declare function createAntdNotificationAdapter(notification: any): NotificationAdapter;
-export declare function setNotificationAdapter(adapter: NotificationAdapter): void;
-export declare function getNotificationAdapter(): NotificationAdapter;
-/** Shorthand for showing notifications */
-export declare const notify: {
- success: (opts: NotificationOptions) => void;
- error: (opts: NotificationOptions) => void;
- warning: (opts: NotificationOptions) => void;
- info: (opts: NotificationOptions) => void;
-};
-//# sourceMappingURL=notification.d.ts.map
\ No newline at end of file
diff --git a/src/adapters/notification.d.ts.map b/src/adapters/notification.d.ts.map
deleted file mode 100644
index bd616d3..0000000
--- a/src/adapters/notification.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["notification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC3C,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACzC,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC3C,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACzC;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,mBAKxC,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,GAAG,GAAG,mBAAmB,CAOpF;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAEzE;AAED,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AAED,0CAA0C;AAC1C,eAAO,MAAM,MAAM;oBACD,mBAAmB;kBACrB,mBAAmB;oBACjB,mBAAmB;iBACtB,mBAAmB;CACjC,CAAA"}
\ No newline at end of file
diff --git a/src/adapters/preferences.d.ts b/src/adapters/preferences.d.ts
deleted file mode 100644
index 9dc4186..0000000
--- a/src/adapters/preferences.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Preferences Adapter
- * Replaces @vben/preferences
- */
-type Theme = 'light' | 'dark';
-/**
- * Use preferences (compatible with @vben/preferences)
- */
-export declare function usePreferences(): {
- theme: Readonly>;
- isDark: Readonly>;
- setTheme: (t: Theme) => void;
- toggleTheme: () => void;
-};
-/**
- * Initialize theme from system preferences
- */
-export declare function initTheme(): void;
-export {};
-//# sourceMappingURL=preferences.d.ts.map
\ No newline at end of file
diff --git a/src/adapters/preferences.d.ts.map b/src/adapters/preferences.d.ts.map
deleted file mode 100644
index b9412a5..0000000
--- a/src/adapters/preferences.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["preferences.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,CAAA;AAI7B;;GAEG;AACH,wBAAgB,cAAc;;;kBAIP,KAAK;;EAkB3B;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAKhC"}
\ No newline at end of file
diff --git a/src/adapters/user.d.ts b/src/adapters/user.d.ts
deleted file mode 100644
index 5aee760..0000000
--- a/src/adapters/user.d.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * User Adapter
- * Replaces @vben/stores useUserStore
- */
-export interface UserInfo {
- userId: string | number;
- realName: string;
- userName: string;
- avatar?: string;
-}
-/**
- * Set user info (call this on app init)
- */
-export declare function setUserInfo(info: UserInfo): void;
-/**
- * Get user store (compatible with @vben/stores)
- */
-export declare function useUserStore(): {
- userInfo: {
- readonly userId: string | number;
- readonly realName: string;
- readonly userName: string;
- readonly avatar?: string | undefined;
- } | null;
- setUserInfo: typeof setUserInfo;
- getUserInfo: () => {
- userId: string | number;
- realName: string;
- userName: string;
- avatar?: string | undefined;
- } | null;
-};
-//# sourceMappingURL=user.d.ts.map
\ No newline at end of file
diff --git a/src/adapters/user.d.ts.map b/src/adapters/user.d.ts.map
deleted file mode 100644
index fbb6182..0000000
--- a/src/adapters/user.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAUD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY;;yBAxBlB,MAAM,GAAG,MAAM;2BACb,MAAM;2BACN,MAAM;0BACP,MAAM;;;;gBAHP,MAAM,GAAG,MAAM;kBACb,MAAM;kBACN,MAAM;iBACP,MAAM;;EA2BhB"}
\ No newline at end of file
diff --git a/src/ai/AiMenuButton.vue.d.ts b/src/ai/AiMenuButton.vue.d.ts
deleted file mode 100644
index 4f4dd79..0000000
--- a/src/ai/AiMenuButton.vue.d.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import type { Component } from 'vue';
-import type { Editor } from '@tiptap/core';
-interface Props {
- editor: Editor;
- icon?: Component;
- label?: string;
- title?: string;
- active?: boolean;
- placement?: 'top' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {
- active: boolean;
- placement: "top" | "bottom" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=AiMenuButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/AiMenuButton.vue.d.ts.map b/src/ai/AiMenuButton.vue.d.ts.map
deleted file mode 100644
index 8acb255..0000000
--- a/src/ai/AiMenuButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"AiMenuButton.vue.d.ts","sourceRoot":"","sources":["AiMenuButton.vue"],"names":[],"mappings":"AAsrBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAU3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;CACtF;;YAFU,OAAO;eACJ,KAAK,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU;;AA+wBtF,wBAOG"}
\ No newline at end of file
diff --git a/src/ai/adapters/aliyun.d.ts b/src/ai/adapters/aliyun.d.ts
deleted file mode 100644
index adef57e..0000000
--- a/src/ai/adapters/aliyun.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Aliyun (Alibaba Cloud) Adapter
- * For Qwen/Tongyi Qianwen models via DashScope API
- */
-import type { AiAdapter, AiConfig, AiMessage, AiResponse, AiStreamCallbacks } from '../types';
-export declare class AliyunAdapter implements AiAdapter {
- provider: "aliyun";
- private config;
- constructor(config: AiConfig);
- chat(messages: AiMessage[], options?: Partial): Promise;
- chatStream(messages: AiMessage[], callbacks: AiStreamCallbacks, options?: Partial): Promise;
-}
-export declare function createAliyunAdapter(config: AiConfig): AiAdapter;
-//# sourceMappingURL=aliyun.d.ts.map
\ No newline at end of file
diff --git a/src/ai/adapters/aliyun.d.ts.map b/src/ai/adapters/aliyun.d.ts.map
deleted file mode 100644
index 5ba388d..0000000
--- a/src/ai/adapters/aliyun.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"aliyun.d.ts","sourceRoot":"","sources":["aliyun.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE7F,qBAAa,aAAc,YAAW,SAAS;IAC7C,QAAQ,EAAG,QAAQ,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAU;gBAEZ,MAAM,EAAE,QAAQ;IAItB,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C7E,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAqElH;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAE/D"}
\ No newline at end of file
diff --git a/src/ai/adapters/index.d.ts b/src/ai/adapters/index.d.ts
deleted file mode 100644
index 581ff9a..0000000
--- a/src/ai/adapters/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * AI Adapters Entry
- */
-export { OpenAiAdapter, createOpenAiAdapter } from './openai';
-export { AliyunAdapter, createAliyunAdapter } from './aliyun';
-export { OllamaAdapter, createOllamaAdapter } from './ollama';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/adapters/index.d.ts.map b/src/ai/adapters/index.d.ts.map
deleted file mode 100644
index 5e81c26..0000000
--- a/src/ai/adapters/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA"}
\ No newline at end of file
diff --git a/src/ai/adapters/ollama.d.ts b/src/ai/adapters/ollama.d.ts
deleted file mode 100644
index 16d3491..0000000
--- a/src/ai/adapters/ollama.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Ollama Adapter
- * For local Ollama models
- */
-import type { AiAdapter, AiConfig, AiMessage, AiResponse, AiStreamCallbacks } from '../types';
-export declare class OllamaAdapter implements AiAdapter {
- provider: "ollama";
- private config;
- constructor(config: AiConfig);
- chat(messages: AiMessage[], options?: Partial): Promise;
- chatStream(messages: AiMessage[], callbacks: AiStreamCallbacks, options?: Partial): Promise;
-}
-export declare function createOllamaAdapter(config: AiConfig): AiAdapter;
-//# sourceMappingURL=ollama.d.ts.map
\ No newline at end of file
diff --git a/src/ai/adapters/ollama.d.ts.map b/src/ai/adapters/ollama.d.ts.map
deleted file mode 100644
index 525a214..0000000
--- a/src/ai/adapters/ollama.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["ollama.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE7F,qBAAa,aAAc,YAAW,SAAS;IAC7C,QAAQ,EAAG,QAAQ,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAU;gBAEZ,MAAM,EAAE,QAAQ;IAItB,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAqC7E,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CA6DlH;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAE/D"}
\ No newline at end of file
diff --git a/src/ai/adapters/openai.d.ts b/src/ai/adapters/openai.d.ts
deleted file mode 100644
index 565b958..0000000
--- a/src/ai/adapters/openai.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * OpenAI Adapter
- * Compatible with OpenAI API standard (also works with DeepSeek, etc.)
- */
-import type { AiAdapter, AiConfig, AiMessage, AiResponse, AiStreamCallbacks } from '../types';
-export declare class OpenAiAdapter implements AiAdapter {
- provider: "openai";
- private config;
- constructor(config: AiConfig);
- chat(messages: AiMessage[], options?: Partial): Promise;
- chatStream(messages: AiMessage[], callbacks: AiStreamCallbacks, options?: Partial): Promise;
-}
-export declare function createOpenAiAdapter(config: AiConfig): AiAdapter;
-//# sourceMappingURL=openai.d.ts.map
\ No newline at end of file
diff --git a/src/ai/adapters/openai.d.ts.map b/src/ai/adapters/openai.d.ts.map
deleted file mode 100644
index a224fa4..0000000
--- a/src/ai/adapters/openai.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["openai.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE7F,qBAAa,aAAc,YAAW,SAAS;IAC7C,QAAQ,EAAG,QAAQ,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAU;gBAEZ,MAAM,EAAE,QAAQ;IAItB,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAqC7E,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CA+DlH;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAE/D"}
\ No newline at end of file
diff --git a/src/ai/agent/AiChatPanel.vue b/src/ai/agent/AiChatPanel.vue
new file mode 100644
index 0000000..d4181d4
--- /dev/null
+++ b/src/ai/agent/AiChatPanel.vue
@@ -0,0 +1,489 @@
+
+
+
+
+
+ AI
+
+
+
+
+
+
+
+
+
+ {{ t('aiChat.welcome') }}
+
+
+
+
+ {{ msg.text }}
+
+
+ {{ msg.text }}
+
+
+
+ {{ msg.text }}
+
+
+ {{ msg.text }}
+
+ {{ t('aiChat.configure') }}
+
+
+
+
+
+
+ {{ t('aiChat.running') }}
+
+
+
+
+
+
+ {{ t('aiChat.stop') }}
+
+
+ {{ t('aiChat.send') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ai/agent/__tests__/documentTools.spec.ts b/src/ai/agent/__tests__/documentTools.spec.ts
new file mode 100644
index 0000000..f6b54be
--- /dev/null
+++ b/src/ai/agent/__tests__/documentTools.spec.ts
@@ -0,0 +1,254 @@
+/**
+ * documentTools 单元测试(无头 Editor)
+ */
+import { describe, it, expect, beforeEach, afterEach } from 'vitest'
+import { Editor } from '@tiptap/core'
+import StarterKit from '@tiptap/starter-kit'
+import Underline from '@tiptap/extension-underline'
+import Highlight from '@tiptap/extension-highlight'
+import { TextStyle } from '@tiptap/extension-text-style'
+import { Color } from '@tiptap/extension-color'
+import { Table } from '@tiptap/extension-table'
+import { TableRow } from '@tiptap/extension-table-row'
+import { TableHeader } from '@tiptap/extension-table-header'
+import { TableCell } from '@tiptap/extension-table-cell'
+import { documentTools, getDocumentTool, getDocumentOutline, toOpenAiTools } from '../documentTools'
+
+let editor: Editor
+
+function run(name: string, args: Record = {}): string {
+ const tool = getDocumentTool(name)
+ if (!tool) throw new Error(`tool not found: ${name}`)
+ return tool.execute(editor, args)
+}
+
+beforeEach(() => {
+ editor = new Editor({
+ extensions: [
+ StarterKit,
+ Underline,
+ Highlight.configure({ multicolor: true }),
+ TextStyle,
+ Color,
+ Table,
+ TableRow,
+ TableHeader,
+ TableCell,
+ ],
+ content: '标题一 这是第一段 正文。
第二段正文。
',
+ })
+})
+
+afterEach(() => {
+ editor.destroy()
+})
+
+describe('read_document / outline', () => {
+ it('lists blocks with indexes and types', () => {
+ const result = run('read_document')
+ expect(result).toContain('3 block(s)')
+ expect(result).toContain('[0] h1: 标题一')
+ expect(result).toContain('[1] p: 这是第一段正文。')
+ expect(result).toContain('[2] p: 第二段正文。')
+ })
+
+ it('outline truncates long blocks', () => {
+ editor.commands.setContent(`${'长'.repeat(300)}
`)
+ const outline = getDocumentOutline(editor, 100)
+ expect(outline).toContain('…')
+ expect(outline.length).toBeLessThan(200)
+ })
+})
+
+describe('get_selection', () => {
+ it('reports no selection', () => {
+ expect(run('get_selection')).toContain('No text is selected')
+ })
+
+ it('returns selected text', () => {
+ editor.commands.setTextSelection({ from: 1, to: 4 })
+ expect(run('get_selection')).toContain('标题一')
+ })
+})
+
+describe('insert_blocks', () => {
+ it('inserts at document end', () => {
+ run('insert_blocks', { html: '新段落
', position: 'documentEnd' })
+ expect(editor.getHTML()).toContain('新段落')
+ expect(run('read_document')).toContain('[3] p: 新段落')
+ })
+
+ it('inserts before a block', () => {
+ run('insert_blocks', { html: '插入的标题 ', position: 'beforeBlock', blockIndex: 1 })
+ expect(run('read_document')).toContain('[1] h2: 插入的标题')
+ })
+
+ it('inserts after a block', () => {
+ run('insert_blocks', { html: '插在标题后
', position: 'afterBlock', blockIndex: 0 })
+ expect(run('read_document')).toContain('[1] p: 插在标题后')
+ })
+
+ it('inserts a table', () => {
+ run('insert_blocks', {
+ html: '',
+ position: 'documentEnd',
+ })
+ expect(run('read_document')).toMatch(/table 2x2/)
+ })
+
+ it('rejects empty html', () => {
+ expect(() => run('insert_blocks', { html: ' ', position: 'documentEnd' })).toThrow()
+ })
+})
+
+describe('replace_blocks', () => {
+ it('replaces a single block', () => {
+ run('replace_blocks', { fromBlock: 2, html: '替换后的标题 ' })
+ const outline = run('read_document')
+ expect(outline).toContain('[2] h2: 替换后的标题')
+ expect(outline).not.toContain('第二段正文')
+ })
+
+ it('replaces a range of blocks', () => {
+ run('replace_blocks', { fromBlock: 1, toBlock: 2, html: '合并成一段
' })
+ const outline = run('read_document')
+ expect(outline).toContain('2 block(s)')
+ expect(outline).toContain('[1] p: 合并成一段')
+ })
+
+ it('rejects out-of-range indexes with helpful error', () => {
+ expect(() => run('replace_blocks', { fromBlock: 99, html: 'x
' })).toThrow(/0-2/)
+ })
+})
+
+describe('delete_blocks', () => {
+ it('deletes one block', () => {
+ run('delete_blocks', { fromBlock: 0 })
+ const outline = run('read_document')
+ expect(outline).toContain('2 block(s)')
+ expect(outline).not.toContain('标题一')
+ })
+
+ it('deletes a range (trailing empty paragraph is kept by the editor)', () => {
+ run('delete_blocks', { fromBlock: 1, toBlock: 2 })
+ const outline = run('read_document')
+ // StarterKit 的 TrailingNode 会在文档尾部保留一个空段落,属编辑器交互设计
+ expect(outline).toContain('标题一')
+ expect(outline).not.toContain('第二段')
+ expect(outline).not.toContain('第一段')
+ })
+})
+
+describe('edit_text', () => {
+ it('replaces first occurrence and keeps formatting around', () => {
+ run('edit_text', { find: '第一段', replace: '首段' })
+ const html = editor.getHTML()
+ expect(html).toContain('首段')
+ expect(html).not.toContain('第一段')
+ // 加粗标记仍存在
+ expect(html).toContain('')
+ })
+
+ it('matches text spanning mark boundaries', () => {
+ // "这是第一段" 跨越 普通文本("这是") 和 strong("第一段")
+ run('edit_text', { find: '这是第一段', replace: '本段' })
+ expect(editor.state.doc.textContent).toContain('本段正文')
+ })
+
+ it('replaces the nth occurrence', () => {
+ editor.commands.setContent('苹果一
苹果二
')
+ run('edit_text', { find: '苹果', replace: '香蕉', occurrence: 2 })
+ const text = editor.state.doc.textContent
+ expect(text).toContain('苹果一')
+ expect(text).toContain('香蕉二')
+ })
+
+ it('replaceAll replaces every occurrence', () => {
+ editor.commands.setContent('猫和猫与猫
')
+ const result = run('edit_text', { find: '猫', replace: '狗', replaceAll: true })
+ expect(result).toContain('3 occurrence(s)')
+ expect(editor.state.doc.textContent).toBe('狗和狗与狗')
+ })
+
+ it('replaceAll where replacement contains the find replaces each original match exactly once', () => {
+ // 'a' → 'aa':不能指数膨胀,每个原始匹配只替换一次
+ editor.commands.setContent('a和a与a
')
+ const result = run('edit_text', { find: 'a', replace: 'aa', replaceAll: true })
+ expect(result).toContain('3 occurrence(s)')
+ expect(editor.state.doc.textContent).toBe('aa和aa与aa')
+ })
+
+ it('does not match text spanning table cells', () => {
+ editor.commands.setContent('')
+ // '格100' 跨两个单元格,不应视为匹配
+ expect(() => run('edit_text', { find: '格100', replace: 'x' })).toThrow(/not found/i)
+ // 单元格内部的文本仍可正常匹配
+ run('edit_text', { find: '100', replace: '200' })
+ expect(editor.state.doc.textContent).toContain('200')
+ })
+
+ it('throws when multiple matches and no occurrence is given', () => {
+ editor.commands.setContent('苹果一
苹果二
')
+ expect(() => run('edit_text', { find: '苹果', replace: '香蕉' })).toThrow(/occurrence \(1-2\)/i)
+ // 文档未被修改
+ expect(editor.state.doc.textContent).toContain('苹果一')
+ expect(editor.state.doc.textContent).toContain('苹果二')
+ })
+
+ it('throws helpful error when text not found', () => {
+ expect(() => run('edit_text', { find: '不存在的文字', replace: 'x' })).toThrow(/not found/i)
+ })
+})
+
+describe('format_text', () => {
+ it('applies bold and italic', () => {
+ run('format_text', { find: '第二段', formats: ['bold', 'italic'] })
+ expect(editor.getHTML()).toMatch(/<(strong|em)>.*<(strong|em)>?/)
+ const html = editor.getHTML()
+ expect(html).toContain('strong')
+ expect(html).toContain('em')
+ })
+
+ it('removes bold', () => {
+ run('format_text', { find: '第一段', formats: ['bold'], action: 'remove' })
+ expect(editor.getHTML()).not.toContain('')
+ })
+
+ it('applies text color', () => {
+ run('format_text', { find: '标题一', formats: ['textColor'], color: '#ff0000' })
+ expect(editor.getHTML()).toContain('#ff0000')
+ })
+
+ it('applies highlight with color', () => {
+ run('format_text', { find: '第二段', formats: ['highlight'], color: '#ffff00' })
+ expect(editor.getHTML()).toContain('mark')
+ })
+
+ it('throws when multiple matches and no occurrence is given', () => {
+ editor.commands.setContent('重点
重点
')
+ expect(() => run('format_text', { find: '重点', formats: ['bold'] })).toThrow(/occurrence \(1-2\)/i)
+ })
+
+ it('removes textColor by clearing only the color attribute (no throw, color gone)', () => {
+ run('format_text', { find: '标题一', formats: ['textColor'], color: '#ff0000' })
+ expect(editor.getHTML()).toContain('#ff0000')
+ // remove 走 setMark('textStyle', { color: null }),不 unsetMark 整个 textStyle,
+ // 以免连带清掉 fontSize/fontFamily 等其它 textStyle 属性(本测试环境无 fontSize 扩展,
+ // 仅验证不抛错且颜色被移除)
+ run('format_text', { find: '标题一', formats: ['textColor'], action: 'remove' })
+ expect(editor.getHTML()).not.toContain('#ff0000')
+ })
+})
+
+describe('OpenAI tools export', () => {
+ it('produces valid function definitions', () => {
+ const tools = toOpenAiTools()
+ expect(tools).toHaveLength(documentTools.length)
+ for (const t of tools) {
+ expect(t.type).toBe('function')
+ expect(t.function.name).toBeTruthy()
+ expect(t.function.description).toBeTruthy()
+ expect(t.function.parameters).toHaveProperty('type', 'object')
+ }
+ })
+})
diff --git a/src/ai/agent/agentLoop.ts b/src/ai/agent/agentLoop.ts
new file mode 100644
index 0000000..2acf747
--- /dev/null
+++ b/src/ai/agent/agentLoop.ts
@@ -0,0 +1,260 @@
+/**
+ * Document Agent Loop - 文档编辑 AI Agent 循环
+ * @description 基于 OpenAI function-calling 格式的 tool-use 循环:
+ * 模型收到用户的自然语言指令 → 调用 documentTools 修改文档 → 直到给出最终答复。
+ * 所有已支持的 provider(OpenAI/Anthropic/DeepSeek/阿里云/Ollama/自定义)都走
+ * OpenAI 兼容的 /chat/completions(Anthropic 官方提供 OpenAI 兼容层)。
+ */
+
+import type { Editor } from '@tiptap/core'
+import { getAiConfig, getBaseUrl } from '@/api/ai'
+import { getProviderInfo, type AiProvider } from '@/ai/config/types'
+import { documentTools, toOpenAiTools, type DocumentTool } from './documentTools'
+
+// ============================================================================
+// 类型
+// ============================================================================
+
+/** 对话消息(OpenAI chat 格式的子集) */
+export interface AgentChatMessage {
+ role: 'system' | 'user' | 'assistant' | 'tool'
+ content: string | null
+ tool_calls?: Array<{
+ id: string
+ type: 'function'
+ function: { name: string; arguments: string }
+ }>
+ tool_call_id?: string
+}
+
+/** agent 过程事件回调(驱动 UI 展示步骤) */
+export interface AgentCallbacks {
+ /** 模型请求执行某个工具(执行前触发) */
+ onToolCall?: (name: string, args: Record) => void
+ /** 工具执行完成(成功或失败) */
+ onToolResult?: (name: string, result: string, isError: boolean) => void
+ /** 模型输出了最终文本答复 */
+ onAssistantMessage?: (text: string) => void
+}
+
+export interface RunDocumentAgentOptions {
+ editor: Editor
+ /** 用户的自然语言指令 */
+ instruction: string
+ /** 既往对话(仅 user/assistant 文本轮次,用于多轮上下文) */
+ history?: Array<{ role: 'user' | 'assistant'; content: string }>
+ /** 中断信号(停止按钮) */
+ signal?: AbortSignal
+ /** 最大工具调用轮数,默认 12 */
+ maxTurns?: number
+ /** 界面语言,用于提示模型用同语言答复 */
+ locale?: string
+ /** 自定义工具集(默认 documentTools 全集) */
+ tools?: DocumentTool[]
+ callbacks?: AgentCallbacks
+}
+
+export interface DocumentAgentResult {
+ /** 模型的最终文字答复 */
+ finalText: string
+ /** 执行过的工具调用数 */
+ toolCallCount: number
+}
+
+/** AI 未配置(无 API Key)时抛出,UI 捕获后引导用户去配置 */
+export class AgentNotConfiguredError extends Error {
+ constructor() {
+ super('AI is not configured: missing API key.')
+ this.name = 'AgentNotConfiguredError'
+ }
+}
+
+// ============================================================================
+// 系统提示词
+// ============================================================================
+
+function buildSystemPrompt(locale?: string): string {
+ return [
+ 'You are a document editing assistant embedded in a rich-text editor.',
+ 'The user gives natural-language instructions; you edit the document by calling tools.',
+ '',
+ 'Workflow:',
+ '1. Call read_document first to see the document structure and block indexes.',
+ '2. Make edits with the editing tools. Block indexes change after every edit — rely on the "Document now" outline returned by each tool, or call read_document again.',
+ '3. When done, reply with a brief summary of what you changed (no raw HTML in the reply).',
+ '',
+ 'Rules:',
+ '- Keep HTML simple: p, h1-h6, ul/ol/li, table/tr/th/td, blockquote, pre/code, strong, em, u, s, a, hr.',
+ '- Prefer edit_text/format_text for small inline changes; replace_blocks for structural rewrites.',
+ '- Never fabricate document content you have not read.',
+ '- If the instruction is ambiguous, make a reasonable choice and mention it in your summary.',
+ `- Reply to the user in ${locale === 'zh-CN' ? 'Simplified Chinese' : locale === 'zh-TW' ? 'Traditional Chinese' : 'the same language as their instruction'}.`,
+ ].join('\n')
+}
+
+// ============================================================================
+// 主循环
+// ============================================================================
+
+const DEFAULT_MAX_TURNS = 12
+
+/** 工具结果里文档概要的起始标记(与 documentTools 的 okWithOutline 对齐) */
+const OUTLINE_MARKER = '\nDocument now:\n'
+
+/** 把历史 tool 消息中已过期的文档概要截断,避免每轮重复携带旧概要导致上下文膨胀 */
+function supersedeOldOutlines(messages: AgentChatMessage[]): void {
+ for (const m of messages) {
+ if (m.role !== 'tool' || typeof m.content !== 'string') continue
+ const idx = m.content.indexOf(OUTLINE_MARKER)
+ if (idx === -1) continue
+ m.content = `${m.content.slice(0, idx)}\n(outline superseded by a later edit)`
+ }
+}
+
+/**
+ * 运行文档编辑 agent
+ * @description 阻塞直到模型给出最终答复、达到轮数上限或被 signal 中断。
+ * 编辑通过 editor 事务实时生效(用户可随时 Cmd+Z 撤销)。
+ */
+export async function runDocumentAgent(options: RunDocumentAgentOptions): Promise {
+ const {
+ editor,
+ instruction,
+ history = [],
+ signal,
+ maxTurns = DEFAULT_MAX_TURNS,
+ locale,
+ tools = documentTools,
+ callbacks = {},
+ } = options
+
+ const config = getAiConfig()
+ // 仅当 provider 必需 API Key 而用户未配置时才算「未配置」(如 Ollama 本地无需 key)
+ const providerInfo = getProviderInfo(config.provider as AiProvider)
+ if ((providerInfo?.requiresApiKey ?? true) && !config.apiKey) {
+ throw new AgentNotConfiguredError()
+ }
+
+ const baseUrl = getBaseUrl(config.provider, config.baseUrl)
+ const timeout = config.timeout || 60000
+ const openAiTools = toOpenAiTools(tools)
+
+ // apiKey 为空(如 Ollama)时省略 Authorization header
+ const headers: Record = { 'Content-Type': 'application/json' }
+ if (config.apiKey) headers.Authorization = `Bearer ${config.apiKey}`
+
+ const messages: AgentChatMessage[] = [
+ { role: 'system', content: buildSystemPrompt(locale) },
+ ...history.map((m) => ({ role: m.role, content: m.content }) as AgentChatMessage),
+ { role: 'user', content: instruction },
+ ]
+
+ let toolCallCount = 0
+
+ for (let turn = 0; turn < maxTurns; turn++) {
+ if (editor.isDestroyed) throw new Error('Editor was destroyed while the agent was running.')
+
+ // 超时兜底:手动组合外部 signal 与超时信号(AbortSignal.any 的兼容写法)
+ const timeoutController = new AbortController()
+ const timer = setTimeout(() => timeoutController.abort(), timeout)
+ const onExternalAbort = () => timeoutController.abort()
+ if (signal?.aborted) timeoutController.abort()
+ else signal?.addEventListener('abort', onExternalAbort)
+
+ let data: { choices?: Array<{ message?: Record }> }
+ try {
+ const response = await fetch(`${baseUrl}/chat/completions`, {
+ method: 'POST',
+ headers,
+ body: JSON.stringify({
+ model: config.model,
+ messages,
+ tools: openAiTools,
+ tool_choice: 'auto',
+ }),
+ signal: timeoutController.signal,
+ })
+
+ if (!response.ok) {
+ const body = await response.text().catch(() => '')
+ throw new Error(`AI API error ${response.status}: ${body.slice(0, 300) || response.statusText}`)
+ }
+
+ data = await response.json()
+ } catch (error) {
+ // 用户主动停止:让 AbortError 冒泡;否则 abort 只可能来自超时
+ if ((error as Error | null)?.name === 'AbortError' && !signal?.aborted) {
+ throw new Error('AI request timeout')
+ }
+ throw error
+ } finally {
+ clearTimeout(timer)
+ signal?.removeEventListener('abort', onExternalAbort)
+ }
+
+ const message = data.choices?.[0]?.message as
+ | { content?: unknown; tool_calls?: AgentChatMessage['tool_calls'] }
+ | undefined
+ if (!message) throw new Error('AI API returned no message.')
+
+ const toolCalls = message.tool_calls
+
+ if (!toolCalls || toolCalls.length === 0) {
+ // 最终答复
+ const finalText = typeof message.content === 'string' ? message.content : ''
+ if (finalText) callbacks.onAssistantMessage?.(finalText)
+ return { finalText, toolCallCount }
+ }
+
+ // 记录 assistant 的工具调用消息
+ messages.push({
+ role: 'assistant',
+ content: typeof message.content === 'string' ? message.content : null,
+ tool_calls: toolCalls,
+ })
+
+ // 逐个执行工具
+ for (const call of toolCalls) {
+ if (signal?.aborted) throw new DOMException('Aborted', 'AbortError')
+ if (editor.isDestroyed) throw new Error('Editor was destroyed while the agent was running.')
+
+ const name = call.function?.name || ''
+ let args: Record = {}
+ try {
+ args = call.function?.arguments ? JSON.parse(call.function.arguments) : {}
+ } catch {
+ // 参数解析失败也要回传给模型让它重试
+ }
+
+ callbacks.onToolCall?.(name, args)
+ toolCallCount++
+
+ let result: string
+ let isError = false
+ const tool = tools.find((t) => t.name === name)
+ if (!tool) {
+ result = `Error: unknown tool "${name}". Available: ${tools.map((t) => t.name).join(', ')}`
+ isError = true
+ } else {
+ try {
+ result = tool.execute(editor, args)
+ } catch (error) {
+ result = `Error: ${error instanceof Error ? error.message : String(error)}`
+ isError = true
+ }
+ }
+
+ callbacks.onToolResult?.(name, result, isError)
+ // 控制历史膨胀:旧工具结果里的文档概要已过期,截断为占位说明,
+ // 每轮请求只携带最新一份概要
+ supersedeOldOutlines(messages)
+ messages.push({ role: 'tool', tool_call_id: call.id, content: result })
+ }
+ }
+
+ // 达到轮数上限:让模型知道并收尾会更好,但为控制成本直接返回
+ return {
+ finalText: '',
+ toolCallCount,
+ }
+}
diff --git a/src/ai/agent/documentTools.ts b/src/ai/agent/documentTools.ts
new file mode 100644
index 0000000..2a4f577
--- /dev/null
+++ b/src/ai/agent/documentTools.ts
@@ -0,0 +1,467 @@
+/**
+ * Document Tools - AI 文档编辑工具集
+ * @description 把编辑器的基本操作封装成结构化「工具」(OpenAI function-calling 格式),
+ * 供 AI agent 通过 tool-use 循环调用,实现「用文字描述来编写和修改文档」。
+ *
+ * 寻址设计:
+ * - 块级操作用「块索引」(文档顶层节点的序号,read_document 返回)
+ * - 行内操作用「文本查找」(find + occurrence),不暴露脆弱的 ProseMirror 位置
+ * - 每次修改后返回最新文档概要,模型无需再调 read_document 对齐索引
+ */
+
+import type { Editor } from '@tiptap/core'
+
+// ============================================================================
+// 类型
+// ============================================================================
+
+/** 工具定义(parameters 为 JSON Schema,与 OpenAI function calling 对齐) */
+export interface DocumentTool {
+ name: string
+ description: string
+ parameters: Record
+ /** 执行工具,返回给模型看的结果文本;抛错时错误信息也会回传给模型 */
+ execute: (editor: Editor, args: Record) => string
+}
+
+interface BlockInfo {
+ index: number
+ /** 节点起点前的位置(block 边界) */
+ from: number
+ /** 节点终点后的位置 */
+ to: number
+ node: import('@tiptap/pm/model').Node
+}
+
+// ============================================================================
+// 内部工具函数
+// ============================================================================
+
+/** 收集文档顶层块 */
+function getBlocks(editor: Editor): BlockInfo[] {
+ const blocks: BlockInfo[] = []
+ editor.state.doc.forEach((node, offset, index) => {
+ blocks.push({ index, from: offset, to: offset + node.nodeSize, node })
+ })
+ return blocks
+}
+
+/** 单个块的简短描述(类型 + 截断文本) */
+function describeBlock(node: import('@tiptap/pm/model').Node, maxLen: number): string {
+ let type = node.type.name
+ if (type === 'heading') type = `h${node.attrs.level}`
+ else if (type === 'paragraph') type = 'p'
+ else if (type === 'bulletList') type = 'ul'
+ else if (type === 'orderedList') type = 'ol'
+ else if (type === 'codeBlock') type = `code(${node.attrs.language || 'text'})`
+ else if (type === 'table') {
+ const rows = node.childCount
+ const cols = rows > 0 ? node.firstChild!.childCount : 0
+ return `table ${rows}x${cols}: ${truncate(node.textContent, maxLen)}`
+ }
+
+ const text = node.textContent.trim()
+ return text ? `${type}: ${truncate(text, maxLen)}` : `${type}: (empty)`
+}
+
+function truncate(text: string, maxLen: number): string {
+ const t = text.replace(/\s+/g, ' ').trim()
+ return t.length > maxLen ? `${t.slice(0, maxLen)}…` : t
+}
+
+/** 文档概要:[i] type: text(模型用它获得块索引) */
+export function getDocumentOutline(editor: Editor, maxLenPerBlock = 150, maxBlocks = 300): string {
+ const blocks = getBlocks(editor)
+ if (blocks.length === 0) return '(document is empty)'
+ const lines = blocks
+ .slice(0, maxBlocks)
+ .map((b) => `[${b.index}] ${describeBlock(b.node, maxLenPerBlock)}`)
+ if (blocks.length > maxBlocks) {
+ lines.push(`… (${blocks.length - maxBlocks} more blocks omitted)`)
+ }
+ return lines.join('\n')
+}
+
+/** 修改成功后返回给模型的统一结果(附最新概要,避免索引漂移) */
+function okWithOutline(editor: Editor, message: string): string {
+ return `${message}\nDocument now:\n${getDocumentOutline(editor, 80)}`
+}
+
+/** 校验并解析块索引范围 */
+function resolveBlockRange(
+ editor: Editor,
+ fromBlock: number,
+ toBlock?: number
+): { from: number; to: number; count: number } {
+ const blocks = getBlocks(editor)
+ const last = typeof toBlock === 'number' ? toBlock : fromBlock
+ if (
+ !Number.isInteger(fromBlock) ||
+ !Number.isInteger(last) ||
+ fromBlock < 0 ||
+ last >= blocks.length ||
+ fromBlock > last
+ ) {
+ throw new Error(
+ `Invalid block range [${fromBlock}, ${last}]. Document has ${blocks.length} blocks (0-${blocks.length - 1}). Call read_document to get fresh indexes.`
+ )
+ }
+ return { from: blocks[fromBlock].from, to: blocks[last].to, count: last - fromBlock + 1 }
+}
+
+interface TextMatch {
+ from: number
+ to: number
+ /** 匹配所在顶层块索引(用于多匹配歧义提示) */
+ blockIndex: number
+}
+
+/**
+ * 扫描全文,返回 find 文本的所有匹配区间(绝对位置)。
+ * 支持跨行内节点边界(如一半加粗一半普通)的匹配;
+ * 在块级结构边界(嵌套段落/表格单元格)和硬换行处插入不可匹配的哨兵字符,
+ * 避免「相邻单元格文本拼起来恰好等于 find」这类跨结构假匹配。
+ */
+function findAllTextRanges(editor: Editor, find: string): TextMatch[] {
+ if (!find) throw new Error('`find` must be a non-empty string.')
+ const doc = editor.state.doc
+
+ // 逐块拼接文本并记录每个字符的绝对位置,避免跨块误匹配
+ const matches: TextMatch[] = []
+ doc.forEach((block, blockOffset, blockIndex) => {
+ let text = ''
+ const positions: number[] = []
+ block.descendants((node, pos) => {
+ if (node.isText && node.text) {
+ for (let i = 0; i < node.text.length; i++) {
+ text += node.text[i]
+ // +1 跳过块的开始 token
+ positions.push(blockOffset + 1 + pos + i)
+ }
+ } else if (node.isBlock || node.type.name === 'hardBreak') {
+ // 结构边界:用户的 find 不会包含 \u0000,跨边界的假匹配自然失配
+ if (text) {
+ text += '\u0000'
+ positions.push(-1)
+ }
+ }
+ return true
+ })
+ let idx = text.indexOf(find)
+ while (idx !== -1) {
+ matches.push({
+ from: positions[idx],
+ to: positions[idx + find.length - 1] + 1,
+ blockIndex,
+ })
+ idx = text.indexOf(find, idx + 1)
+ }
+ })
+ return matches
+}
+
+/**
+ * 解析出唯一目标匹配。
+ * occurrence 未显式传入且存在多个匹配时抛错要求消歧,避免默默改错位置。
+ */
+function resolveSingleMatch(
+ editor: Editor,
+ find: string,
+ occurrence: number | undefined
+): { from: number; to: number } {
+ const matches = findAllTextRanges(editor, find)
+ if (matches.length === 0) {
+ throw new Error(`Text not found: "${truncate(find, 60)}". Check exact wording with read_document.`)
+ }
+ if (occurrence === undefined) {
+ if (matches.length > 1) {
+ const blocks = [...new Set(matches.map((m) => m.blockIndex))].join(', ')
+ throw new Error(
+ `Found ${matches.length} matches for "${truncate(find, 60)}" (in block(s) ${blocks}). Pass occurrence (1-${matches.length}) to disambiguate.`
+ )
+ }
+ return matches[0]
+ }
+ if (!Number.isInteger(occurrence) || occurrence < 1 || occurrence > matches.length) {
+ throw new Error(`Occurrence ${occurrence} out of range: only ${matches.length} match(es) found.`)
+ }
+ return matches[occurrence - 1]
+}
+
+// ============================================================================
+// 工具定义
+// ============================================================================
+
+const readDocument: DocumentTool = {
+ name: 'read_document',
+ description:
+ 'Read the current document as an outline of top-level blocks with their indexes. Always call this first to understand the document and get fresh block indexes.',
+ parameters: { type: 'object', properties: {}, additionalProperties: false },
+ execute: (editor) => {
+ const blocks = getBlocks(editor)
+ return `Document has ${blocks.length} block(s):\n${getDocumentOutline(editor)}`
+ },
+}
+
+const getSelection: DocumentTool = {
+ name: 'get_selection',
+ description:
+ "Get the user's currently selected text, if any. Useful when the user refers to “the selected text” / “选中的文字”.",
+ parameters: { type: 'object', properties: {}, additionalProperties: false },
+ execute: (editor) => {
+ const { from, to, empty } = editor.state.selection
+ if (empty) return 'No text is selected.'
+ const text = editor.state.doc.textBetween(from, to, '\n')
+ return `Selected text (${text.length} chars): "${truncate(text, 2000)}"`
+ },
+}
+
+const insertBlocks: DocumentTool = {
+ name: 'insert_blocks',
+ description:
+ 'Insert new content into the document as HTML. Supported tags: p, h1-h6, ul/ol/li, table/tr/th/td, blockquote, pre/code, strong, em, u, s, a, img, hr. Keep HTML simple and valid.',
+ parameters: {
+ type: 'object',
+ properties: {
+ html: { type: 'string', description: 'HTML content to insert' },
+ position: {
+ type: 'string',
+ enum: ['documentStart', 'documentEnd', 'beforeBlock', 'afterBlock'],
+ description: 'Where to insert',
+ },
+ blockIndex: {
+ type: 'number',
+ description: 'Required when position is beforeBlock/afterBlock: the anchor block index',
+ },
+ },
+ required: ['html', 'position'],
+ additionalProperties: false,
+ },
+ execute: (editor, args) => {
+ const html = String(args.html || '')
+ if (!html.trim()) throw new Error('`html` must not be empty.')
+ const position = String(args.position)
+ let pos: number
+ if (position === 'documentStart') {
+ pos = 0
+ } else if (position === 'documentEnd') {
+ pos = editor.state.doc.content.size
+ } else if (position === 'beforeBlock' || position === 'afterBlock') {
+ const blockIndex = Number(args.blockIndex)
+ const range = resolveBlockRange(editor, blockIndex)
+ pos = position === 'beforeBlock' ? range.from : range.to
+ } else {
+ throw new Error(`Unknown position: ${position}`)
+ }
+ const ok = editor.chain().insertContentAt(pos, html).run()
+ if (!ok) throw new Error('Insert failed: the HTML may be invalid for this position.')
+ return okWithOutline(editor, 'Inserted.')
+ },
+}
+
+const replaceBlocks: DocumentTool = {
+ name: 'replace_blocks',
+ description:
+ 'Replace a range of top-level blocks (inclusive) with new HTML content. Use read_document indexes.',
+ parameters: {
+ type: 'object',
+ properties: {
+ fromBlock: { type: 'number', description: 'First block index to replace' },
+ toBlock: { type: 'number', description: 'Last block index (defaults to fromBlock)' },
+ html: { type: 'string', description: 'Replacement HTML content' },
+ },
+ required: ['fromBlock', 'html'],
+ additionalProperties: false,
+ },
+ execute: (editor, args) => {
+ const html = String(args.html || '')
+ if (!html.trim()) throw new Error('`html` must not be empty. To remove blocks use delete_blocks.')
+ const { from, to, count } = resolveBlockRange(
+ editor,
+ Number(args.fromBlock),
+ args.toBlock === undefined ? undefined : Number(args.toBlock)
+ )
+ const ok = editor.chain().insertContentAt({ from, to }, html).run()
+ if (!ok) throw new Error('Replace failed: the HTML may be invalid.')
+ return okWithOutline(editor, `Replaced ${count} block(s).`)
+ },
+}
+
+const deleteBlocks: DocumentTool = {
+ name: 'delete_blocks',
+ description: 'Delete a range of top-level blocks (inclusive). Use read_document indexes.',
+ parameters: {
+ type: 'object',
+ properties: {
+ fromBlock: { type: 'number', description: 'First block index to delete' },
+ toBlock: { type: 'number', description: 'Last block index (defaults to fromBlock)' },
+ },
+ required: ['fromBlock'],
+ additionalProperties: false,
+ },
+ execute: (editor, args) => {
+ const { from, to, count } = resolveBlockRange(
+ editor,
+ Number(args.fromBlock),
+ args.toBlock === undefined ? undefined : Number(args.toBlock)
+ )
+ const ok = editor.chain().deleteRange({ from, to }).run()
+ if (!ok) throw new Error('Delete failed.')
+ return okWithOutline(editor, `Deleted ${count} block(s).`)
+ },
+}
+
+const editText: DocumentTool = {
+ name: 'edit_text',
+ description:
+ 'Replace an exact text snippet with new plain text (keeps surrounding formatting). For structural changes use replace_blocks instead.',
+ parameters: {
+ type: 'object',
+ properties: {
+ find: { type: 'string', description: 'Exact text to find (case-sensitive)' },
+ replace: { type: 'string', description: 'Replacement plain text (may be empty to delete)' },
+ occurrence: {
+ type: 'number',
+ description:
+ 'Which match to replace, 1-based. Required when there are multiple matches (unless replaceAll).',
+ },
+ replaceAll: { type: 'boolean', description: 'Replace every match. Default false.' },
+ },
+ required: ['find', 'replace'],
+ additionalProperties: false,
+ },
+ execute: (editor, args) => {
+ const find = String(args.find ?? '')
+ const replace = String(args.replace ?? '')
+
+ if (args.replaceAll) {
+ // 一次性收集全部区间,单条事务里从后往前替换:
+ // 前面的位置不受影响、每个原始匹配恰好替换一次、一次 Cmd+Z 可全部撤销
+ const matches = findAllTextRanges(editor, find)
+ if (matches.length === 0) throw new Error(`Text not found: "${truncate(find, 60)}"`)
+ editor
+ .chain()
+ .command(({ tr }) => {
+ for (let i = matches.length - 1; i >= 0; i--) {
+ tr.insertText(replace, matches[i].from, matches[i].to)
+ }
+ return true
+ })
+ .run()
+ return okWithOutline(editor, `Replaced ${matches.length} occurrence(s).`)
+ }
+
+ const occurrence = args.occurrence === undefined ? undefined : Number(args.occurrence)
+ const { from, to } = resolveSingleMatch(editor, find, occurrence)
+ editor
+ .chain()
+ .command(({ tr }) => {
+ tr.insertText(replace, from, to)
+ return true
+ })
+ .run()
+ return okWithOutline(editor, 'Text replaced.')
+ },
+}
+
+/** 行内格式 → mark 名与属性 */
+const FORMAT_MARKS: Record) => Record }> = {
+ bold: { mark: 'bold' },
+ italic: { mark: 'italic' },
+ underline: { mark: 'underline' },
+ strike: { mark: 'strike' },
+ code: { mark: 'code' },
+ highlight: {
+ mark: 'highlight',
+ attrs: (args) => (args.color ? { color: String(args.color) } : {}),
+ },
+ textColor: {
+ mark: 'textStyle',
+ attrs: (args) => ({ color: String(args.color || '#000000') }),
+ },
+}
+
+const formatText: DocumentTool = {
+ name: 'format_text',
+ description:
+ 'Add or remove inline formatting on an exact text snippet. Formats: bold, italic, underline, strike, code, highlight, textColor. For highlight/textColor pass `color` (hex).',
+ parameters: {
+ type: 'object',
+ properties: {
+ find: { type: 'string', description: 'Exact text to format (case-sensitive)' },
+ occurrence: {
+ type: 'number',
+ description: 'Which match, 1-based. Required when there are multiple matches.',
+ },
+ formats: {
+ type: 'array',
+ items: {
+ type: 'string',
+ enum: ['bold', 'italic', 'underline', 'strike', 'code', 'highlight', 'textColor'],
+ },
+ description: 'Formats to apply or remove',
+ },
+ action: { type: 'string', enum: ['add', 'remove'], description: 'Default add' },
+ color: { type: 'string', description: 'Hex color for highlight/textColor' },
+ },
+ required: ['find', 'formats'],
+ additionalProperties: false,
+ },
+ execute: (editor, args) => {
+ const find = String(args.find ?? '')
+ const occurrence = args.occurrence === undefined ? undefined : Number(args.occurrence)
+ const formats = Array.isArray(args.formats) ? args.formats.map(String) : []
+ if (formats.length === 0) throw new Error('`formats` must not be empty.')
+ const action = args.action === 'remove' ? 'remove' : 'add'
+
+ const { from, to } = resolveSingleMatch(editor, find, occurrence)
+ let chain = editor.chain().setTextSelection({ from, to })
+ for (const format of formats) {
+ const def = FORMAT_MARKS[format]
+ if (!def) throw new Error(`Unknown format: ${format}`)
+ if (action === 'add') {
+ chain = chain.setMark(def.mark, def.attrs ? def.attrs(args) : undefined)
+ } else if (format === 'textColor') {
+ // 不能 unsetMark('textStyle'):会连带清掉 fontSize/fontFamily 等其它 textStyle 属性
+ chain = chain.setMark('textStyle', { color: null })
+ } else {
+ chain = chain.unsetMark(def.mark)
+ }
+ }
+ const ok = chain.setTextSelection(to).run()
+ if (!ok) {
+ throw new Error(
+ `Formatting failed. The "${formats.join(', ')}" mark(s) may not be enabled in this editor.`
+ )
+ }
+ return okWithOutline(editor, `Formatting ${action === 'add' ? 'applied' : 'removed'}.`)
+ },
+}
+
+// ============================================================================
+// 导出
+// ============================================================================
+
+/** 所有文档编辑工具(顺序即推荐调用优先级) */
+export const documentTools: DocumentTool[] = [
+ readDocument,
+ getSelection,
+ insertBlocks,
+ replaceBlocks,
+ deleteBlocks,
+ editText,
+ formatText,
+]
+
+/** 按名称查找工具 */
+export function getDocumentTool(name: string): DocumentTool | undefined {
+ return documentTools.find((t) => t.name === name)
+}
+
+/** 转成 OpenAI function-calling 的 tools 数组 */
+export function toOpenAiTools(tools: DocumentTool[] = documentTools) {
+ return tools.map((t) => ({
+ type: 'function' as const,
+ function: { name: t.name, description: t.description, parameters: t.parameters },
+ }))
+}
diff --git a/src/ai/agent/index.ts b/src/ai/agent/index.ts
new file mode 100644
index 0000000..eb82735
--- /dev/null
+++ b/src/ai/agent/index.ts
@@ -0,0 +1,23 @@
+/**
+ * AI Document Agent - 文字指令编辑文档
+ * @description 把编辑器基本操作封装为结构化工具集,AI 通过 tool-use 循环
+ * 按用户的自然语言指令编写和修改文档。
+ */
+
+export {
+ documentTools,
+ getDocumentTool,
+ getDocumentOutline,
+ toOpenAiTools,
+} from './documentTools'
+export type { DocumentTool } from './documentTools'
+
+export { runDocumentAgent, AgentNotConfiguredError } from './agentLoop'
+export type {
+ AgentCallbacks,
+ AgentChatMessage,
+ DocumentAgentResult,
+ RunDocumentAgentOptions,
+} from './agentLoop'
+
+export { default as AiChatPanel } from './AiChatPanel.vue'
diff --git a/src/ai/components/AiSettingsModal.vue b/src/ai/components/AiSettingsModal.vue
index 42feea3..1c3d222 100644
--- a/src/ai/components/AiSettingsModal.vue
+++ b/src/ai/components/AiSettingsModal.vue
@@ -33,6 +33,7 @@
class="ai-settings__input"
/>
{{ t('aiSettings.apiKeyHint') }}
+ {{ t('aiSettings.securityNote') }}
@@ -301,6 +302,10 @@ function handleClose() {
color: var(--primary-color, #1890ff);
}
+.ai-settings__hint--warning {
+ color: var(--warning-color, #d48806);
+}
+
.ai-settings__error {
margin: 0;
font-size: 12px;
diff --git a/src/ai/components/AiToolbarMenu.vue.d.ts b/src/ai/components/AiToolbarMenu.vue.d.ts
deleted file mode 100644
index ec1c35f..0000000
--- a/src/ai/components/AiToolbarMenu.vue.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-import type { AiAdapter } from '@/ai';
-interface Props {
- editor: Editor | null;
- adapter: AiAdapter;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=AiToolbarMenu.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/components/AiToolbarMenu.vue.d.ts.map b/src/ai/components/AiToolbarMenu.vue.d.ts.map
deleted file mode 100644
index 9b9e729..0000000
--- a/src/ai/components/AiToolbarMenu.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"AiToolbarMenu.vue.d.ts","sourceRoot":"","sources":["AiToolbarMenu.vue"],"names":[],"mappings":"AA6VA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAErC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,SAAS,CAAA;CACnB;;AAgSD,wBAMG"}
\ No newline at end of file
diff --git a/src/ai/components/index.d.ts b/src/ai/components/index.d.ts
deleted file mode 100644
index 9764be1..0000000
--- a/src/ai/components/index.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * AI Components Entry
- */
-export { default as AiToolbarMenu } from './AiToolbarMenu.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/components/index.d.ts.map b/src/ai/components/index.d.ts.map
deleted file mode 100644
index fec5870..0000000
--- a/src/ai/components/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
\ No newline at end of file
diff --git a/src/ai/config.d.ts b/src/ai/config.d.ts
deleted file mode 100644
index 4b46ee1..0000000
--- a/src/ai/config.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * AI Config Loader
- * Load AI configuration from environment variables
- */
-import type { AiConfig } from './types';
-/**
- * Load AI configuration from environment variables
- */
-export declare function loadAiConfig(): AiConfig;
-/**
- * Create AI config manually
- */
-export declare function createAiConfig(config: Partial): AiConfig;
-//# sourceMappingURL=config.d.ts.map
\ No newline at end of file
diff --git a/src/ai/config.d.ts.map b/src/ai/config.d.ts.map
deleted file mode 100644
index 650428c..0000000
--- a/src/ai/config.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,SAAS,CAAA;AAiDnD;;GAEG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAYvC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAYlE"}
\ No newline at end of file
diff --git a/src/ai/config/__tests__/store.spec.ts b/src/ai/config/__tests__/store.spec.ts
new file mode 100644
index 0000000..8332a6d
--- /dev/null
+++ b/src/ai/config/__tests__/store.spec.ts
@@ -0,0 +1,93 @@
+/**
+ * AI 配置存储单元测试
+ */
+import { describe, it, expect, beforeEach } from 'vitest'
+import { createAiConfigStore } from '../store'
+import type { AiUserConfig } from '../types'
+
+function makeConfig(overrides: Partial = {}): AiUserConfig {
+ return {
+ provider: 'openai',
+ apiKey: 'sk-test-1234567890',
+ endpoint: '',
+ model: 'gpt-4o-mini',
+ timeout: 30000,
+ enabled: true,
+ updatedAt: 0,
+ ...overrides,
+ }
+}
+
+describe('AI config store', () => {
+ beforeEach(() => {
+ localStorage.clear()
+ })
+
+ it('returns null before anything is saved', () => {
+ const store = createAiConfigStore()
+ expect(store.getConfig()).toBeNull()
+ expect(store.getApiKey()).toBeNull()
+ expect(store.isConfigured()).toBe(false)
+ })
+
+ it('round-trips config including the API key', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig())
+ const loaded = store.getConfig()
+ expect(loaded).not.toBeNull()
+ expect(loaded!.provider).toBe('openai')
+ expect(loaded!.model).toBe('gpt-4o-mini')
+ expect(loaded!.apiKey).toBe('sk-test-1234567890')
+ })
+
+ it('round-trips API keys containing unicode/special characters', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig({ apiKey: 'key-带中文-!@#$%^&*()' }))
+ expect(store.getApiKey()).toBe('key-带中文-!@#$%^&*()')
+ })
+
+ it('does not store the API key in plain text', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig())
+ const raw = Object.keys(localStorage)
+ .map((k) => localStorage.getItem(k))
+ .join('|')
+ expect(raw).not.toContain('sk-test-1234567890')
+ })
+
+ it('clearConfig removes both config and API key', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig())
+ store.clearConfig()
+ expect(store.getConfig()).toBeNull()
+ expect(store.getApiKey()).toBeNull()
+ })
+
+ describe('isConfigured()', () => {
+ it('is true for a complete enabled config', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig())
+ expect(store.isConfigured()).toBe(true)
+ })
+
+ it('is false when disabled', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig({ enabled: false }))
+ expect(store.isConfigured()).toBe(false)
+ })
+
+ it('is false when the provider requires an API key and none is set', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig({ apiKey: '' }))
+ expect(store.isConfigured()).toBe(false)
+ })
+
+ it('requires an endpoint for the custom provider', () => {
+ const store = createAiConfigStore()
+ store.saveConfig(makeConfig({ provider: 'custom', endpoint: '' }))
+ expect(store.isConfigured()).toBe(false)
+ store.saveConfig(makeConfig({ provider: 'custom', endpoint: 'https://my-llm.example.com/v1' }))
+ expect(store.isConfigured()).toBe(true)
+ })
+ })
+})
diff --git a/src/ai/config/types.ts b/src/ai/config/types.ts
index 77b3fdc..3088146 100644
--- a/src/ai/config/types.ts
+++ b/src/ai/config/types.ts
@@ -132,7 +132,7 @@ export const AI_PROVIDERS: AiProviderInfo[] = [
id: 'ollama',
name: 'Ollama (本地)',
description: '本地运行的开源模型',
- defaultEndpoint: 'http://localhost:11434/api',
+ defaultEndpoint: 'http://localhost:11434/v1',
defaultModel: 'llama3.2',
requiresApiKey: false,
docsUrl: 'https://ollama.com/docs',
diff --git a/src/ai/continue-writing/ContinueWritingButton.vue.d.ts b/src/ai/continue-writing/ContinueWritingButton.vue.d.ts
deleted file mode 100644
index 9c4873f..0000000
--- a/src/ai/continue-writing/ContinueWritingButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-type __VLS_Props = {
- title: string;
- onClick: () => void;
-};
-declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=ContinueWritingButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/continue-writing/ContinueWritingButton.vue.d.ts.map b/src/ai/continue-writing/ContinueWritingButton.vue.d.ts.map
deleted file mode 100644
index 8057efe..0000000
--- a/src/ai/continue-writing/ContinueWritingButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ContinueWritingButton.vue.d.ts","sourceRoot":"","sources":["ContinueWritingButton.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAC;;AAqEF,wBAMG"}
\ No newline at end of file
diff --git a/src/ai/continue-writing/ContinueWritingExtension.d.ts b/src/ai/continue-writing/ContinueWritingExtension.d.ts
deleted file mode 100644
index baad468..0000000
--- a/src/ai/continue-writing/ContinueWritingExtension.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Extension } from '@tiptap/core';
-export interface ContinueWritingOptions {
-}
-declare module '@tiptap/core' {
- interface Commands {
- continueWriting: {
- /**
- * Trigger AI continue writing
- */
- continueWriting: () => ReturnType;
- };
- }
-}
-/**
- * Continue Writing Extension for Tiptap v3
- * @description AI-powered text continuation based on selection
- */
-export declare const ContinueWritingExtension: Extension;
-//# sourceMappingURL=ContinueWritingExtension.d.ts.map
\ No newline at end of file
diff --git a/src/ai/continue-writing/ContinueWritingExtension.d.ts.map b/src/ai/continue-writing/ContinueWritingExtension.d.ts.map
deleted file mode 100644
index b88f618..0000000
--- a/src/ai/continue-writing/ContinueWritingExtension.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ContinueWritingExtension.d.ts","sourceRoot":"","sources":["ContinueWritingExtension.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzC,MAAM,WAAW,sBAAsB;CAAG;AAE1C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,eAAe,EAAE;YACf;;eAEG;YACH,eAAe,EAAE,MAAM,UAAU,CAAC;SACnC,CAAC;KACH;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,wCAwDjC,CAAC"}
\ No newline at end of file
diff --git a/src/ai/continue-writing/index.d.ts b/src/ai/continue-writing/index.d.ts
deleted file mode 100644
index 956cb38..0000000
--- a/src/ai/continue-writing/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Continue Writing Feature
- * @description AI-powered text continuation based on selection
- */
-export { ContinueWritingExtension } from './ContinueWritingExtension';
-export type { ContinueWritingOptions } from './ContinueWritingExtension';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/continue-writing/index.d.ts.map b/src/ai/continue-writing/index.d.ts.map
deleted file mode 100644
index 5c06a0f..0000000
--- a/src/ai/continue-writing/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/custom-ai/CustomAiExtension.d.ts b/src/ai/custom-ai/CustomAiExtension.d.ts
deleted file mode 100644
index b07c4d6..0000000
--- a/src/ai/custom-ai/CustomAiExtension.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Extension } from '@tiptap/core';
-export interface CustomAiOptions {
-}
-declare module '@tiptap/core' {
- interface Commands {
- customAi: {
- /**
- * Trigger custom AI command
- */
- customAi: () => ReturnType;
- };
- }
-}
-/**
- * Custom AI Extension for Tiptap v3
- * @description AI-powered custom text processing with user-defined prompts
- */
-export declare const CustomAiExtension: Extension;
-//# sourceMappingURL=CustomAiExtension.d.ts.map
\ No newline at end of file
diff --git a/src/ai/custom-ai/CustomAiExtension.d.ts.map b/src/ai/custom-ai/CustomAiExtension.d.ts.map
deleted file mode 100644
index 7b43208..0000000
--- a/src/ai/custom-ai/CustomAiExtension.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"CustomAiExtension.d.ts","sourceRoot":"","sources":["CustomAiExtension.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBzC,MAAM,WAAW,eAAe;CAAG;AAEnC,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,QAAQ,EAAE;YACR;;eAEG;YACH,QAAQ,EAAE,MAAM,UAAU,CAAC;SAC5B,CAAC;KACH;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iCAuC5B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/custom-ai/index.d.ts b/src/ai/custom-ai/index.d.ts
deleted file mode 100644
index 6953efd..0000000
--- a/src/ai/custom-ai/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Custom AI Feature
- * @description AI-powered custom text processing with user-defined prompts
- */
-export { CustomAiExtension } from './CustomAiExtension';
-export type { CustomAiOptions } from './CustomAiExtension';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/custom-ai/index.d.ts.map b/src/ai/custom-ai/index.d.ts.map
deleted file mode 100644
index fe80aad..0000000
--- a/src/ai/custom-ai/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/factory.d.ts b/src/ai/factory.d.ts
deleted file mode 100644
index d52b3df..0000000
--- a/src/ai/factory.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * AI Adapter Factory
- * Automatically creates the correct adapter based on config
- */
-import type { AiAdapter, AiConfig, AiProvider } from './types';
-/**
- * Create AI adapter from environment variables
- * Reads VITE_AI_PROVIDER, VITE_AI_API_KEY, etc.
- */
-export declare function createAiAdapterFromEnv(): AiAdapter;
-/**
- * Create AI adapter from config
- */
-export declare function createAiAdapter(configInput: Partial): AiAdapter;
-/**
- * Create specific provider adapter
- */
-export declare function createProviderAdapter(provider: AiProvider, apiKey: string, options?: Partial>): AiAdapter;
-//# sourceMappingURL=factory.d.ts.map
\ No newline at end of file
diff --git a/src/ai/factory.d.ts.map b/src/ai/factory.d.ts.map
deleted file mode 100644
index 9c60fe5..0000000
--- a/src/ai/factory.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAgB9D;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,CAGlD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CASzE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC,GACvD,SAAS,CAMX"}
\ No newline at end of file
diff --git a/src/ai/index.d.ts b/src/ai/index.d.ts
deleted file mode 100644
index eda38c8..0000000
--- a/src/ai/index.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * AI Features for TiptapPro Tenant
- * @description Collection of AI-powered text processing features
- */
-export { CustomAiExtension } from './custom-ai';
-export type { CustomAiOptions } from './custom-ai';
-export { ContinueWritingExtension } from './continue-writing';
-export type { ContinueWritingOptions } from './continue-writing';
-export { PolishExtension } from './polish';
-export type { PolishOptions } from './polish';
-export { SummarizeExtension } from './summarize';
-export type { SummarizeOptions } from './summarize';
-export { TranslationExtension } from './translation';
-export type { TranslationOptions } from './translation';
-export { AiHighlightMark } from './shared';
-export type { AiSuggestionData } from './shared';
-export { aiSuggestionManager } from './shared';
-export type { AiSuggestionState } from './shared';
-export { default as CustomAiPopover } from './shared/CustomAiPopover.vue';
-export { default as AiSuggestionPopover } from './shared/AiSuggestionPopover.vue';
-export { default as AiMenuButton } from './AiMenuButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/index.d.ts.map b/src/ai/index.d.ts.map
deleted file mode 100644
index 3147d52..0000000
--- a/src/ai/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/index.ts b/src/ai/index.ts
index d6b1ed8..7304b92 100644
--- a/src/ai/index.ts
+++ b/src/ai/index.ts
@@ -48,6 +48,24 @@ export type { UseAiOptions, UseAiReturn } from './useAi';
// Export types
export type { AiAdapter, AiMessage, AiStreamCallbacks } from './types';
+// Export AI document agent(文字指令编辑文档:工具集 + agent 循环 + 聊天面板)
+export {
+ documentTools,
+ getDocumentTool,
+ getDocumentOutline,
+ toOpenAiTools,
+ runDocumentAgent,
+ AgentNotConfiguredError,
+ AiChatPanel,
+} from './agent';
+export type {
+ DocumentTool,
+ AgentCallbacks,
+ AgentChatMessage,
+ DocumentAgentResult,
+ RunDocumentAgentOptions,
+} from './agent';
+
// Export AI config
export { useAiConfig, getAiRequestConfig } from './config/useAiConfig';
export { AI_PROVIDERS, DEFAULT_CONFIG, getProviderInfo } from './config/types';
diff --git a/src/ai/polish/PolishButton.vue.d.ts b/src/ai/polish/PolishButton.vue.d.ts
deleted file mode 100644
index 1b8e9f1..0000000
--- a/src/ai/polish/PolishButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-type __VLS_Props = {
- title: string;
- onClick: () => void;
-};
-declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=PolishButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/polish/PolishButton.vue.d.ts.map b/src/ai/polish/PolishButton.vue.d.ts.map
deleted file mode 100644
index fda658a..0000000
--- a/src/ai/polish/PolishButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"PolishButton.vue.d.ts","sourceRoot":"","sources":["PolishButton.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAC;;AAqEF,wBAMG"}
\ No newline at end of file
diff --git a/src/ai/polish/PolishExtension.d.ts b/src/ai/polish/PolishExtension.d.ts
deleted file mode 100644
index bcdd478..0000000
--- a/src/ai/polish/PolishExtension.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Extension } from '@tiptap/core';
-export interface PolishOptions {
-}
-declare module '@tiptap/core' {
- interface Commands {
- polish: {
- /**
- * Trigger AI polish (refine) text
- */
- polish: () => ReturnType;
- };
- }
-}
-/**
- * Polish Extension for Tiptap v3
- * @description AI-powered text polishing/refinement based on selection
- */
-export declare const PolishExtension: Extension;
-//# sourceMappingURL=PolishExtension.d.ts.map
\ No newline at end of file
diff --git a/src/ai/polish/PolishExtension.d.ts.map b/src/ai/polish/PolishExtension.d.ts.map
deleted file mode 100644
index 7b6ad3e..0000000
--- a/src/ai/polish/PolishExtension.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"PolishExtension.d.ts","sourceRoot":"","sources":["PolishExtension.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzC,MAAM,WAAW,aAAa;CAAG;AAEjC,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,MAAM,EAAE;YACN;;eAEG;YACH,MAAM,EAAE,MAAM,UAAU,CAAC;SAC1B,CAAC;KACH;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,+BAiD1B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/polish/index.d.ts b/src/ai/polish/index.d.ts
deleted file mode 100644
index c7c8f1c..0000000
--- a/src/ai/polish/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Polish Feature
- * @description AI-powered text polishing/refinement based on selection
- */
-export { PolishExtension } from './PolishExtension';
-export type { PolishOptions } from './PolishExtension';
-export { default as PolishButton } from './PolishButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/polish/index.d.ts.map b/src/ai/polish/index.d.ts.map
deleted file mode 100644
index 4ee1b8f..0000000
--- a/src/ai/polish/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/prompts.d.ts b/src/ai/prompts.d.ts
deleted file mode 100644
index 2e2f410..0000000
--- a/src/ai/prompts.d.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * AI Prompts
- * System prompts for various AI features
- */
-export declare const AI_PROMPTS: {
- readonly continueWriting: {
- readonly system: "你是一位专业的写作助手。你的任务是根据用户提供的内容进行续写。\n要求:\n- 保持原文的风格和语气\n- 自然流畅地衔接上文\n- 提供有价值的内容扩展\n- 使用与原文相同的语言(中文或英文)\n不要重复用户的内容,直接输出续写的部分。";
- readonly en: "You are a professional writing assistant. Your task is to continue writing based on the provided content.\nRequirements:\n- Maintain the original style and tone\n- Seamlessly connect with the previous text\n- Provide valuable content expansion\n- Use the same language as the original text\nDo not repeat the user's content, directly output the continuation.";
- };
- readonly polish: {
- readonly system: "你是一位专业的文字润色专家。你的任务是优化用户提供的文本。\n要求:\n- 提高文本的流畅性和可读性\n- 修正语法和标点错误\n- 优化词汇选择\n- 保持原文的核心意思不变\n- 使用与原文相同的语言\n直接输出润色后的文本,不要添加解释。";
- readonly en: "You are a professional text polishing expert. Your task is to optimize the provided text.\nRequirements:\n- Improve fluency and readability\n- Correct grammar and punctuation errors\n- Optimize word choices\n- Keep the core meaning unchanged\n- Use the same language as the original\nOutput the polished text directly without explanations.";
- };
- readonly summarize: {
- readonly system: "你是一位专业的内容总结专家。你的任务是提取用户提供内容的关键要点。\n要求:\n- 准确把握核心内容\n- 用简洁的语言概括要点\n- 保持逻辑清晰\n- 使用与原文相同的语言\n- 以条目形式呈现(如果内容较多)\n直接输出总结内容。";
- readonly en: "You are a professional content summarization expert. Your task is to extract key points from the provided content.\nRequirements:\n- Accurately capture the core content\n- Summarize points in concise language\n- Maintain logical clarity\n- Use the same language as the original\n- Present in bullet points if content is substantial\nOutput the summary directly.";
- };
- readonly translate: {
- readonly system: "你是一位专业的翻译专家。你的任务是将文本翻译成指定语言。\n要求:\n- 准确传达原文含义\n- 使译文自然流畅\n- 保持原文风格\n- 处理好文化差异\n直接输出翻译结果,不要添加解释。";
- readonly targetLanguages: {
- readonly 'zh-CN': "简体中文";
- readonly 'zh-TW': "繁體中文";
- readonly en: "English";
- readonly ja: "日本語";
- readonly ko: "한국어";
- readonly fr: "Français";
- readonly de: "Deutsch";
- readonly es: "Español";
- };
- };
- readonly customAi: {
- readonly system: "你是一个智能助手。请根据用户的具体指令处理提供的文本内容。\n直接输出处理结果,不要添加额外解释。";
- readonly en: "You are an intelligent assistant. Process the provided text according to the user's specific instructions.\nOutput the result directly without additional explanations.";
- };
-};
-export type AiFeature = keyof typeof AI_PROMPTS;
-//# sourceMappingURL=prompts.d.ts.map
\ No newline at end of file
diff --git a/src/ai/prompts.d.ts.map b/src/ai/prompts.d.ts.map
deleted file mode 100644
index fa412ef..0000000
--- a/src/ai/prompts.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFb,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAA"}
\ No newline at end of file
diff --git a/src/ai/shared/AiHighlightMark.d.ts b/src/ai/shared/AiHighlightMark.d.ts
deleted file mode 100644
index 3bce809..0000000
--- a/src/ai/shared/AiHighlightMark.d.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import type { Editor } from '@tiptap/core';
-import { Mark } from '@tiptap/core';
-export interface AiHighlightOptions {
- HTMLAttributes: Record;
-}
-export interface AiSuggestionData {
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
-}
-declare module '@tiptap/core' {
- interface Commands {
- aiHighlight: {
- /**
- * Set AI highlight mark with suggestion data
- */
- setAiHighlight: (data?: AiSuggestionData) => ReturnType;
- /**
- * Unset AI highlight mark
- */
- unsetAiHighlight: () => ReturnType;
- };
- }
-}
-/**
- * AI Highlight Mark Extension
- * @description Highlights text that is being processed by AI
- */
-export declare const AiHighlightMark: Mark;
-/**
- * Helper function to add AI highlight to a specific range
- */
-export declare function addAiHighlight(editor: Editor, from: number, to: number, data?: AiSuggestionData): void;
-/**
- * Helper function to update AI highlight data
- */
-export declare function updateAiHighlight(editor: Editor, from: number, to: number, data: Partial): void;
-/**
- * Helper function to remove all AI highlights
- */
-export declare function removeAiHighlight(editor: Editor): void;
-/**
- * Helper function to get AI suggestion data from a mark at position
- */
-export declare function getAiSuggestionData(editor: Editor, pos: number): AiSuggestionData | null;
-//# sourceMappingURL=AiHighlightMark.d.ts.map
\ No newline at end of file
diff --git a/src/ai/shared/AiHighlightMark.d.ts.map b/src/ai/shared/AiHighlightMark.d.ts.map
deleted file mode 100644
index fe70d3b..0000000
--- a/src/ai/shared/AiHighlightMark.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"AiHighlightMark.d.ts","sourceRoot":"","sources":["AiHighlightMark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,WAAW,EAAE;YACX;;eAEG;YACH,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,KAAK,UAAU,CAAC;YACxD;;eAEG;YACH,gBAAgB,EAAE,MAAM,UAAU,CAAC;SACpC,CAAC;KACH;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,+BAwF1B,CAAC;AAEH;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,gBAAgB,GACtB,IAAI,CAmBN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAC9B,IAAI,CAmCN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAatD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,gBAAgB,GAAG,IAAI,CAoBzB"}
\ No newline at end of file
diff --git a/src/ai/shared/AiSuggestionPopover.vue.d.ts b/src/ai/shared/AiSuggestionPopover.vue.d.ts
deleted file mode 100644
index 9cdfd69..0000000
--- a/src/ai/shared/AiSuggestionPopover.vue.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-export interface AiSuggestionPopoverProps {
- visible: boolean;
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
- position?: {
- top: number;
- left: number;
- };
- editorElement?: HTMLElement;
-}
-declare const _default: import("vue").DefineComponent any;
- reject: () => any;
- cancel: () => any;
- "update:visible": (value: boolean) => any;
-}, string, import("vue").PublicProps, Readonly & Readonly<{
- onAccept?: (() => any) | undefined;
- onReject?: (() => any) | undefined;
- onCancel?: (() => any) | undefined;
- "onUpdate:visible"?: ((value: boolean) => any) | undefined;
-}>, {
- visible: boolean;
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=AiSuggestionPopover.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/shared/AiSuggestionPopover.vue.d.ts.map b/src/ai/shared/AiSuggestionPopover.vue.d.ts.map
deleted file mode 100644
index 97bfb75..0000000
--- a/src/ai/shared/AiSuggestionPopover.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"AiSuggestionPopover.vue.d.ts","sourceRoot":"","sources":["AiSuggestionPopover.vue"],"names":[],"mappings":"AAiPA,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B;;;;;;;;;;;;aANU,OAAO;kBACF,MAAM;mBACL,MAAM;iBACR,OAAO;;AAsTtB,wBAQG"}
\ No newline at end of file
diff --git a/src/ai/shared/CustomAiPopover.vue.d.ts b/src/ai/shared/CustomAiPopover.vue.d.ts
deleted file mode 100644
index cab756c..0000000
--- a/src/ai/shared/CustomAiPopover.vue.d.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-export interface CustomAiPopoverProps {
- visible: boolean;
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
- isExecuting: boolean;
- position?: {
- top: number;
- left: number;
- };
- editorElement?: HTMLElement;
-}
-declare const _default: import("vue").DefineComponent any;
- reject: () => any;
- cancel: () => any;
- "update:visible": (value: boolean) => any;
- execute: (prompt: string) => any;
- cancelGeneration: () => any;
-}, string, import("vue").PublicProps, Readonly & Readonly<{
- onAccept?: (() => any) | undefined;
- onReject?: (() => any) | undefined;
- onCancel?: (() => any) | undefined;
- "onUpdate:visible"?: ((value: boolean) => any) | undefined;
- onExecute?: ((prompt: string) => any) | undefined;
- onCancelGeneration?: (() => any) | undefined;
-}>, {
- visible: boolean;
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
- isExecuting: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=CustomAiPopover.vue.d.ts.map
\ No newline at end of file
diff --git a/src/ai/shared/CustomAiPopover.vue.d.ts.map b/src/ai/shared/CustomAiPopover.vue.d.ts.map
deleted file mode 100644
index d042719..0000000
--- a/src/ai/shared/CustomAiPopover.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"CustomAiPopover.vue.d.ts","sourceRoot":"","sources":["CustomAiPopover.vue"],"names":[],"mappings":"AAqUA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B;;;;;;;;;;;;;;;;aAPU,OAAO;kBACF,MAAM;mBACL,MAAM;iBACR,OAAO;iBACP,OAAO;;AAgdtB,wBAQG"}
\ No newline at end of file
diff --git a/src/ai/shared/aiSuggestionManager.d.ts b/src/ai/shared/aiSuggestionManager.d.ts
deleted file mode 100644
index 2af8aac..0000000
--- a/src/ai/shared/aiSuggestionManager.d.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import type { Editor } from '@tiptap/core';
-export interface AiSuggestionState {
- visible: boolean;
- originalText: string;
- suggestedText: string;
- isStreaming: boolean;
- originalSelection: {
- from: number;
- to: number;
- };
-}
-declare class AiSuggestionManager {
- private editor;
- private popoverApp;
- private container;
- private state;
- private visibleRef;
- private originalTextRef;
- private suggestedTextRef;
- private isStreamingRef;
- private isTemporarilyHidden;
- /**
- * Initialize the suggestion manager
- */
- init(editor: Editor): void;
- /**
- * Setup click handler for highlighted text
- */
- private setupClickHandler;
- /**
- * Restore existing highlights from the document
- */
- private restoreExistingHighlights;
- /**
- * Restore a suggestion from saved data
- */
- private restoreSuggestion;
- /**
- * Show AI suggestion popover
- */
- show(originalText: string, originalSelection: {
- from: number;
- to: number;
- }, editor?: Editor): void;
- /**
- * Show the popover (for clicking on highlighted text)
- */
- private showPopover;
- /**
- * Update suggested text (for streaming)
- */
- updateSuggestion(text: string): void;
- /**
- * Stop streaming
- */
- stopStreaming(): void;
- /**
- * Accept the suggestion
- */
- accept(): void;
- /**
- * Build paragraph nodes from text with newlines
- */
- private buildParagraphNodes;
- /**
- * Reject the suggestion
- */
- reject(): void;
- /**
- * Cancel (temporarily hide) the suggestion
- */
- cancel(): void;
- /**
- * Hide the popover and cleanup
- */
- hide(): void;
- /**
- * Check if suggestion is visible
- */
- isVisible(): boolean;
- /**
- * Get current state
- */
- getState(): AiSuggestionState;
- /**
- * Mount the popover component
- */
- private mountPopover;
- /**
- * Unmount the popover component
- */
- private unmountPopover;
- /**
- * Calculate popover position based on selection
- */
- private calculatePopoverPosition;
- /**
- * Cleanup
- */
- destroy(): void;
-}
-export declare const aiSuggestionManager: AiSuggestionManager;
-export {};
-//# sourceMappingURL=aiSuggestionManager.d.ts.map
\ No newline at end of file
diff --git a/src/ai/shared/aiSuggestionManager.d.ts.map b/src/ai/shared/aiSuggestionManager.d.ts.map
deleted file mode 100644
index 8161270..0000000
--- a/src/ai/shared/aiSuggestionManager.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"aiSuggestionManager.d.ts","sourceRoot":"","sources":["aiSuggestionManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAc3C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,KAAK,CAMX;IAGF,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,gBAAgB,CAAW;IACnC,OAAO,CAAC,cAAc,CAAc;IAGpC,OAAO,CAAC,mBAAmB,CAAS;IAEpC;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgCzB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAQjC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuCzB;;OAEG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAC/C,MAAM,CAAC,EAAE,MAAM,GACd,IAAI;IA4CP;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAkBpC;;OAEG;IACH,aAAa,IAAI,IAAI;IAkBrB;;OAEG;IACH,MAAM,IAAI,IAAI;IAoCd;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;OAEG;IACH,MAAM,IAAI,IAAI;IAId;;OAEG;IACH,MAAM,IAAI,IAAI;IAKd;;OAEG;IACH,IAAI,IAAI,IAAI;IAwBZ;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,QAAQ,IAAI,iBAAiB;IAI7B;;OAEG;IACH,OAAO,CAAC,YAAY;IAoDpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAsBhC;;OAEG;IACH,OAAO,IAAI,IAAI;CAIhB;AAGD,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/shared/index.d.ts b/src/ai/shared/index.d.ts
deleted file mode 100644
index 0c7bdcf..0000000
--- a/src/ai/shared/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * AI Shared Components and Utilities
- * @description Shared components, utilities, and styles for AI features
- */
-export * from './AiHighlightMark';
-export * from './aiSuggestionManager';
-export { default as CustomAiPopover } from './CustomAiPopover.vue';
-export { default as AiSuggestionPopover } from './AiSuggestionPopover.vue';
-import './ai-highlight.css';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/shared/index.d.ts.map b/src/ai/shared/index.d.ts.map
deleted file mode 100644
index 45c2927..0000000
--- a/src/ai/shared/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAG3E,OAAO,oBAAoB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/summarize/SummarizeExtension.d.ts b/src/ai/summarize/SummarizeExtension.d.ts
deleted file mode 100644
index ec2a199..0000000
--- a/src/ai/summarize/SummarizeExtension.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Extension } from '@tiptap/core';
-export interface SummarizeOptions {
-}
-declare module '@tiptap/core' {
- interface Commands {
- summarize: {
- summarize: () => ReturnType;
- };
- }
-}
-export declare const SummarizeExtension: Extension;
-//# sourceMappingURL=SummarizeExtension.d.ts.map
\ No newline at end of file
diff --git a/src/ai/summarize/SummarizeExtension.d.ts.map b/src/ai/summarize/SummarizeExtension.d.ts.map
deleted file mode 100644
index 58a6c14..0000000
--- a/src/ai/summarize/SummarizeExtension.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"SummarizeExtension.d.ts","sourceRoot":"","sources":["SummarizeExtension.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC,MAAM,WAAW,gBAAgB;CAAG;AAEpC,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,SAAS,EAAE;YACT,SAAS,EAAE,MAAM,UAAU,CAAC;SAC7B,CAAC;KACH;CACF;AAED,eAAO,MAAM,kBAAkB,kCA6B7B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/summarize/index.d.ts b/src/ai/summarize/index.d.ts
deleted file mode 100644
index f6958d2..0000000
--- a/src/ai/summarize/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Summarize Feature
- * @description AI-powered content summarization
- */
-export { SummarizeExtension } from './SummarizeExtension';
-export type { SummarizeOptions } from './SummarizeExtension';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/summarize/index.d.ts.map b/src/ai/summarize/index.d.ts.map
deleted file mode 100644
index e8e0996..0000000
--- a/src/ai/summarize/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/translation/TranslationExtension.d.ts b/src/ai/translation/TranslationExtension.d.ts
deleted file mode 100644
index 22f901c..0000000
--- a/src/ai/translation/TranslationExtension.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Extension } from '@tiptap/core';
-export interface TranslationOptions {
- defaultTargetLang?: string;
-}
-declare module '@tiptap/core' {
- interface Commands {
- translation: {
- translate: (targetLang?: string) => ReturnType;
- };
- }
-}
-export declare const TranslationExtension: Extension;
-//# sourceMappingURL=TranslationExtension.d.ts.map
\ No newline at end of file
diff --git a/src/ai/translation/TranslationExtension.d.ts.map b/src/ai/translation/TranslationExtension.d.ts.map
deleted file mode 100644
index 0ecd934..0000000
--- a/src/ai/translation/TranslationExtension.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TranslationExtension.d.ts","sourceRoot":"","sources":["TranslationExtension.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,WAAW,EAAE;YACX,SAAS,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;SAChD,CAAC;KACH;CACF;AAED,eAAO,MAAM,oBAAoB,oCAyC/B,CAAC"}
\ No newline at end of file
diff --git a/src/ai/translation/index.d.ts b/src/ai/translation/index.d.ts
deleted file mode 100644
index f784137..0000000
--- a/src/ai/translation/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Translation Feature
- * @description AI-powered text translation with language selection
- */
-export { TranslationExtension } from './TranslationExtension';
-export type { TranslationOptions } from './TranslationExtension';
-export { LANGUAGE_CODES } from './languageCodes';
-export type { LanguageCode } from './languageCodes';
-export { currentTranslateLang, setTranslateLang, clearTranslateLang, STORAGE_KEY, } from './translateStore';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/ai/translation/index.d.ts.map b/src/ai/translation/index.d.ts.map
deleted file mode 100644
index c778622..0000000
--- a/src/ai/translation/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC"}
\ No newline at end of file
diff --git a/src/ai/translation/languageCodes.d.ts b/src/ai/translation/languageCodes.d.ts
deleted file mode 100644
index 48508c2..0000000
--- a/src/ai/translation/languageCodes.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * 翻译语言代码配置
- * @description 定义支持的语言代码及其映射关系
- */
-export interface LanguageCode {
- code: string;
- key: string;
-}
-/**
- * 支持的语言代码列表
- * 用于翻译功能的语言选择
- */
-export declare const LANGUAGE_CODES: LanguageCode[];
-//# sourceMappingURL=languageCodes.d.ts.map
\ No newline at end of file
diff --git a/src/ai/translation/languageCodes.d.ts.map b/src/ai/translation/languageCodes.d.ts.map
deleted file mode 100644
index 923ffda..0000000
--- a/src/ai/translation/languageCodes.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"languageCodes.d.ts","sourceRoot":"","sources":["languageCodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EAexC,CAAC"}
\ No newline at end of file
diff --git a/src/ai/translation/translateStore.d.ts b/src/ai/translation/translateStore.d.ts
deleted file mode 100644
index 8f17357..0000000
--- a/src/ai/translation/translateStore.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-declare const STORAGE_KEY = "tiptap_translate_target_lang";
-export declare const currentTranslateLang: import("vue").Ref;
-/**
- * 设置语言并持久化到 localStorage
- * @param label 语言标签(如 "英文"、"中文" 等)
- */
-export declare function setTranslateLang(label: string): void;
-/**
- * 清除已保存的语言选择
- */
-export declare function clearTranslateLang(): void;
-export { STORAGE_KEY };
-//# sourceMappingURL=translateStore.d.ts.map
\ No newline at end of file
diff --git a/src/ai/translation/translateStore.d.ts.map b/src/ai/translation/translateStore.d.ts.map
deleted file mode 100644
index ec8d6f1..0000000
--- a/src/ai/translation/translateStore.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"translateStore.d.ts","sourceRoot":"","sources":["translateStore.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,WAAW,iCAAiC,CAAC;AAInD,eAAO,MAAM,oBAAoB,mCAA2B,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,QAS7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,SASjC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAC"}
\ No newline at end of file
diff --git a/src/ai/types.d.ts b/src/ai/types.d.ts
deleted file mode 100644
index 2928a9b..0000000
--- a/src/ai/types.d.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * AI Types
- * Common types for AI adapters
- */
-/** Supported AI providers */
-export type AiProvider = 'openai' | 'aliyun' | 'ollama' | 'deepseek' | 'anthropic' | 'custom';
-/** AI configuration from env */
-export interface AiConfig {
- provider: AiProvider;
- apiKey?: string;
- apiSecret?: string;
- baseUrl?: string;
- model?: string;
- temperature?: number;
- maxTokens?: number;
-}
-/** Message format */
-export interface AiMessage {
- role: 'system' | 'user' | 'assistant';
- content: string;
-}
-/** Streaming callbacks */
-export interface AiStreamCallbacks {
- onStart?: () => void;
- onToken?: (token: string) => void;
- onComplete?: (fullText: string) => void;
- onError?: (error: Error) => void;
-}
-/** Non-streaming response */
-export interface AiResponse {
- content: string;
- finishReason?: string;
- usage?: {
- promptTokens: number;
- completionTokens: number;
- totalTokens: number;
- };
-}
-/** AI adapter interface */
-export interface AiAdapter {
- /** Provider name */
- provider: AiProvider;
- /** Chat completion (non-streaming) */
- chat(messages: AiMessage[], options?: Partial): Promise;
- /** Chat completion (streaming) */
- chatStream(messages: AiMessage[], callbacks: AiStreamCallbacks, options?: Partial): Promise;
-}
-/** AI feature options for editor extensions */
-export interface AiFeatureOptions {
- adapter: AiAdapter;
- systemPrompt?: string;
- onStart?: () => void;
- onComplete?: (text: string) => void;
- onError?: (error: Error) => void;
-}
-//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/src/ai/types.d.ts.map b/src/ai/types.d.ts.map
deleted file mode 100644
index f66636f..0000000
--- a/src/ai/types.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6BAA6B;AAC7B,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAA;AAE7F,gCAAgC;AAChC,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,UAAU,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qBAAqB;AACrB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IACrC,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,0BAA0B;AAC1B,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AAED,6BAA6B;AAC7B,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;CACF;AAED,2BAA2B;AAC3B,MAAM,WAAW,SAAS;IACxB,oBAAoB;IACpB,QAAQ,EAAE,UAAU,CAAA;IAEpB,sCAAsC;IACtC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE7E,kCAAkC;IAClC,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5G;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,SAAS,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC"}
\ No newline at end of file
diff --git a/src/ai/useAi.d.ts b/src/ai/useAi.d.ts
deleted file mode 100644
index c878ebe..0000000
--- a/src/ai/useAi.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * useAi Composable
- * Vue composable for AI features in editor
- */
-import { ref, readonly } from 'vue';
-import type { AiAdapter, AiStreamCallbacks } from './types';
-export interface UseAiOptions {
- adapter: AiAdapter;
- onError?: (error: Error) => void;
-}
-export interface UseAiReturn {
- isLoading: Readonly>>>>;
- result: Readonly>>>>;
- error: Readonly>>>>;
- continueWriting: (text: string) => Promise;
- polish: (text: string) => Promise;
- summarize: (text: string) => Promise;
- translate: (text: string, targetLang: string) => Promise;
- customAi: (text: string, instruction: string) => Promise;
- continueWritingStream: (text: string, callbacks: AiStreamCallbacks) => Promise;
- polishStream: (text: string, callbacks: AiStreamCallbacks) => Promise;
- summarizeStream: (text: string, callbacks: AiStreamCallbacks) => Promise;
- translateStream: (text: string, targetLang: string, callbacks: AiStreamCallbacks) => Promise;
- customAiStream: (text: string, instruction: string, callbacks: AiStreamCallbacks) => Promise;
- abort: () => void;
-}
-export declare function useAi(options: UseAiOptions): UseAiReturn;
-//# sourceMappingURL=useAi.d.ts.map
\ No newline at end of file
diff --git a/src/ai/useAi.d.ts.map b/src/ai/useAi.d.ts.map
deleted file mode 100644
index 2748f25..0000000
--- a/src/ai/useAi.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"useAi.d.ts","sourceRoot":"","sources":["useAi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,SAAS,EAAa,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGtE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACjF,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7E,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAElF,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAClD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5C,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAChE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAEhE,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpF,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3E,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9E,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAClG,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAElG,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAuGxD"}
\ No newline at end of file
diff --git a/src/api/ai.ts b/src/api/ai.ts
index a945486..9670b0b 100644
--- a/src/api/ai.ts
+++ b/src/api/ai.ts
@@ -22,8 +22,9 @@ export interface AiApiResponse {
/**
* Load API configuration
* Priority: User config > Environment variables > Defaults
+ * @description 也供 ai/agent 的 tool-use 循环复用
*/
-function getAiConfig() {
+export function getAiConfig() {
// First check user config (localStorage)
const userConfig = getAiRequestConfig()
if (userConfig) {
@@ -48,13 +49,15 @@ function getAiConfig() {
}
// Get base URL for provider
-function getBaseUrl(provider: string, customUrl: string): string {
+export function getBaseUrl(provider: string, customUrl: string): string {
if (customUrl) return customUrl
const urls: Record = {
openai: 'https://api.openai.com/v1',
+ anthropic: 'https://api.anthropic.com/v1',
aliyun: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
deepseek: 'https://api.deepseek.com/v1',
- ollama: 'http://localhost:11434/api',
+ // Ollama 的 OpenAI 兼容端点(/api 是其私有协议,不兼容 /chat/completions)
+ ollama: 'http://localhost:11434/v1',
}
return urls[provider] || urls.openai
}
diff --git a/src/configs/editorConstants.d.ts b/src/configs/editorConstants.d.ts
deleted file mode 100644
index c866e6f..0000000
--- a/src/configs/editorConstants.d.ts
+++ /dev/null
@@ -1,227 +0,0 @@
-/**
- * Editor Constants
- * @description 编辑器常量配置(颜色、字体、字号等)
- */
-/**
- * 文本颜色选项
- */
-export declare const TEXT_COLORS: readonly ["#000000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#9900ff"];
-/**
- * 背景颜色选项
- */
-export declare const BACKGROUND_COLORS: readonly ["#ffffff", "#f5f5f5", "#e8f5e9", "#e3f2fd", "#fff3e0", "#fce4ec", "#f3e5f5", "#e0f2f1"];
-/**
- * 表格单元格背景颜色选项
- */
-export declare const TABLE_CELL_COLORS: readonly ["#ffffff", "#f5f5f5", "#e8f5e9", "#e3f2fd", "#fff3e0", "#fce4ec", "#f3e5f5", "#e0f2f1"];
-/**
- * 字体系列选项
- */
-export declare const FONT_FAMILIES: readonly [{
- readonly label: "PMingLiU";
- readonly value: "PMingLiU";
-}, {
- readonly label: "Microsoft YaHei";
- readonly value: "Microsoft YaHei";
-}, {
- readonly label: "SimSun";
- readonly value: "SimSun";
-}, {
- readonly label: "SimHei";
- readonly value: "SimHei";
-}, {
- readonly label: "Arial";
- readonly value: "Arial";
-}, {
- readonly label: "Times New Roman";
- readonly value: "Times New Roman";
-}, {
- readonly label: "Courier New";
- readonly value: "Courier New";
-}, {
- readonly label: "Monospace";
- readonly value: "monospace";
-}];
-/**
- * 字号选项(中文印刷标准)
- */
-export declare const FONT_SIZES: readonly [{
- readonly label: "12";
- readonly value: "12px";
-}, {
- readonly label: "14";
- readonly value: "14px";
-}, {
- readonly label: "16";
- readonly value: "16px";
-}, {
- readonly label: "18";
- readonly value: "18px";
-}, {
- readonly label: "20";
- readonly value: "20px";
-}, {
- readonly label: "24";
- readonly value: "24px";
-}, {
- readonly label: "28";
- readonly value: "28px";
-}, {
- readonly label: "32";
- readonly value: "32px";
-}];
-/**
- * 行间距选项
- */
-export declare const LINE_HEIGHTS: readonly [{
- readonly label: "1.0";
- readonly value: "1";
-}, {
- readonly label: "1.5";
- readonly value: "1.5";
-}, {
- readonly label: "2.0";
- readonly value: "2";
-}, {
- readonly label: "2.5";
- readonly value: "2.5";
-}, {
- readonly label: "3.0";
- readonly value: "3";
-}];
-/**
- * 段落样式选项
- */
-export declare const HEADING_OPTIONS: readonly [{
- readonly label: "正文";
- readonly value: "paragraph";
-}, {
- readonly label: "H1";
- readonly value: "h1";
-}, {
- readonly label: "H2";
- readonly value: "h2";
-}, {
- readonly label: "H3";
- readonly value: "h3";
-}, {
- readonly label: "H4";
- readonly value: "h4";
-}, {
- readonly label: "H5";
- readonly value: "h5";
-}, {
- readonly label: "H6";
- readonly value: "h6";
-}];
-/**
- * 代码块语言选项
- */
-export declare const CODE_LANGUAGES: readonly ["javascript", "typescript", "python", "java", "html", "css", "json", "bash", "sql", "php", "go", "rust", "c", "cpp", "csharp", "swift", "kotlin", "ruby", "markdown", "xml"];
-/**
- * 对齐方式选项
- */
-export declare const TEXT_ALIGN_OPTIONS: readonly [{
- readonly label: "左对齐";
- readonly value: "left";
-}, {
- readonly label: "居中";
- readonly value: "center";
-}, {
- readonly label: "右对齐";
- readonly value: "right";
-}, {
- readonly label: "两端对齐";
- readonly value: "justify";
-}];
-/**
- * 表格边框样式选项
- */
-export declare const TABLE_BORDER_STYLES: readonly [{
- readonly label: "默认边框";
- readonly value: "default";
-}, {
- readonly label: "无边框";
- readonly value: "none";
-}, {
- readonly label: "外边框";
- readonly value: "outer";
-}];
-/**
- * 默认配置值
- */
-export declare const DEFAULT_VALUES: {
- /** 默认字体 */
- readonly fontFamily: "PMingLiU";
- /** 默认字号 */
- readonly fontSize: "16px";
- /** 默认行间距 */
- readonly lineHeight: "1.5";
- /** 默认文本颜色 */
- readonly textColor: "#000000";
- /** 默认背景颜色 */
- readonly backgroundColor: "#ffffff";
- /** 默认对齐方式 */
- readonly textAlign: "left";
- /** 默认代码语言 */
- readonly codeLanguage: "javascript";
-};
-/**
- * 编辑器限制
- */
-export declare const EDITOR_LIMITS: {
- /** 最小缩放比例 */
- readonly minZoom: 50;
- /** 最大缩放比例 */
- readonly maxZoom: 200;
- /** 缩放步长 */
- readonly zoomStep: 10;
- /** 最大文档长度(字符数) */
- readonly maxDocumentLength: 1000000;
- /** 最大标题级别 */
- readonly maxHeadingLevel: 6;
-};
-/**
- * 快捷键配置
- */
-export declare const KEYBOARD_SHORTCUTS: {
- readonly bold: "Mod-b";
- readonly italic: "Mod-i";
- readonly underline: "Mod-u";
- readonly strike: "Mod-Shift-s";
- readonly code: "Mod-e";
- readonly codeBlock: "Mod-Shift-e";
- readonly link: "Mod-k";
- readonly undo: "Mod-z";
- readonly redo: readonly ["Mod-Shift-z", "Mod-y"];
- readonly paragraph: "Mod-Alt-0";
- readonly heading1: "Mod-Alt-1";
- readonly heading2: "Mod-Alt-2";
- readonly heading3: "Mod-Alt-3";
- readonly bulletList: "Mod-Shift-8";
- readonly orderedList: "Mod-Shift-7";
- readonly taskList: "Mod-Shift-9";
-};
-/**
- * UI 配置
- */
-export declare const UI_CONFIG: {
- /** 工具栏按钮尺寸 */
- readonly toolbarButtonSize: 28;
- /** 工具栏高度 */
- readonly toolbarHeight: 56;
- /** 工具栏间距 */
- readonly toolbarGap: 6;
- /** 颜色面板列数 */
- readonly colorPanelColumns: 8;
- /** 颜色面板色块大小 */
- readonly colorItemSize: 24;
- /** 浮动菜单偏移 */
- readonly bubbleMenuOffset: 8;
-};
-/**
- * @note 所有类型定义已统一迁移到 shared/configs/toolbar.ts
- * 如需使用类型,请从 shared/configs/toolbar 导入
- * 此文件仅保留常量配置,类型定义已移除
- */
-//# sourceMappingURL=editorConstants.d.ts.map
\ No newline at end of file
diff --git a/src/configs/editorConstants.d.ts.map b/src/configs/editorConstants.d.ts.map
deleted file mode 100644
index 1283d1c..0000000
--- a/src/configs/editorConstants.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"editorConstants.d.ts","sourceRoot":"","sources":["editorConstants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,mGASd,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,iBAAiB,mGASpB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,iBAAiB,mGAAoB,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAShB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EASb,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAMf,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAQlB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,cAAc,wLAqBjB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAKrB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;EAItB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB,WAAW;;IAEX,WAAW;;IAEX,YAAY;;IAEZ,aAAa;;IAEb,aAAa;;IAEb,aAAa;;IAEb,aAAa;;CAEL,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,aAAa;;IAEb,aAAa;;IAEb,WAAW;;IAEX,kBAAkB;;IAElB,aAAa;;CAEL,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAiBrB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,SAAS;IACpB,cAAc;;IAEd,YAAY;;IAEZ,YAAY;;IAEZ,aAAa;;IAEb,eAAe;;IAEf,aAAa;;CAEL,CAAA;AAEV;;;;GAIG"}
\ No newline at end of file
diff --git a/src/configs/editorConstants.ts b/src/configs/editorConstants.ts
index 0d468a7..c935f4b 100644
--- a/src/configs/editorConstants.ts
+++ b/src/configs/editorConstants.ts
@@ -40,14 +40,17 @@ export const TABLE_CELL_COLORS = BACKGROUND_COLORS
* 字体系列选项
*/
export const FONT_FAMILIES = [
- { label: 'PMingLiU', value: 'PMingLiU' },
- { label: 'Microsoft YaHei', value: 'Microsoft YaHei' },
- { label: 'SimSun', value: 'SimSun' },
- { label: 'SimHei', value: 'SimHei' },
+ /** 空值表示不指定字体(跟随主题默认),显示文案由组件用 i18n 渲染 */
+ { label: 'Default', value: '' },
{ label: 'Arial', value: 'Arial' },
+ { label: 'Georgia', value: 'Georgia' },
{ label: 'Times New Roman', value: 'Times New Roman' },
{ label: 'Courier New', value: 'Courier New' },
{ label: 'Monospace', value: 'monospace' },
+ { label: '微软雅黑', value: 'Microsoft YaHei' },
+ { label: '宋体', value: 'SimSun' },
+ { label: '黑体', value: 'SimHei' },
+ { label: '新細明體', value: 'PMingLiU' },
] as const
/**
@@ -137,8 +140,8 @@ export const TABLE_BORDER_STYLES = [
* 默认配置值
*/
export const DEFAULT_VALUES = {
- /** 默认字体 */
- fontFamily: 'PMingLiU',
+ /** 默认字体(空值 = 跟随主题默认,不写入 style) */
+ fontFamily: '',
/** 默认字号 */
fontSize: '16px',
/** 默认行间距 */
diff --git a/src/configs/index.d.ts b/src/configs/index.d.ts
deleted file mode 100644
index 84c18f3..0000000
--- a/src/configs/index.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Configs Entry
- */
-export * from './editorConstants';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/configs/index.d.ts.map b/src/configs/index.d.ts.map
deleted file mode 100644
index bd6ae03..0000000
--- a/src/configs/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAA"}
\ No newline at end of file
diff --git a/src/configs/toolbar.d.ts b/src/configs/toolbar.d.ts
deleted file mode 100644
index 8955290..0000000
--- a/src/configs/toolbar.d.ts
+++ /dev/null
@@ -1,366 +0,0 @@
-/**
- * Toolbar Types
- * @description 工具栏相关的类型定义
- */
-import type { Component } from 'vue';
-import type { Editor } from '@tiptap/core';
-/**
- * 文本格式类型名称
- */
-export type TextFormatType = 'bold' | 'italic' | 'underline' | 'strike' | 'code';
-/**
- * 文本格式配置接口
- */
-export interface TextFormatConfig {
- /** 格式类型名称 */
- name: TextFormatType;
- /** 图标组件 */
- icon: Component;
- /** 格式标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 工具栏按钮配置接口
- */
-export interface ToolbarButtonConfig {
- /** 按钮名称/标识 */
- name: string;
- /** 按钮图标组件 */
- icon?: Component;
- /** 按钮标题(hover 提示) */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
- /** 是否禁用 */
- disabled?: boolean;
-}
-/**
- * 标题级别类型
- */
-export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
-/**
- * 标题值类型(包含正文)
- */
-export type HeadingValue = 'paragraph' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
-/**
- * 标题配置接口
- */
-export interface HeadingConfig {
- /** 标题级别 (1-6) */
- level: HeadingLevel;
- /** 标题标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 颜色工具配置接口
- */
-export interface ColorToolConfig {
- /** 颜色类型(文本或背景) */
- type: 'text' | 'bg' | 'highlight';
- /** 工具标题 */
- title: string;
- /** 图标组件 */
- icon: Component;
- /** 选择颜色时执行的操作 */
- action: (color: string) => void;
-}
-/**
- * 表格操作配置接口
- */
-export interface TableOperationConfig {
- /** 操作名称 */
- name: string;
- /** 图标组件 */
- icon: Component;
- /** 操作标题 */
- title: string;
- /** 对应的编辑器命令名称 */
- command: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 列表类型名称
- */
-export type ListType = 'bulletList' | 'orderedList' | 'taskList';
-/**
- * 列表工具配置接口
- */
-export interface ListToolConfig {
- /** 列表类型名称 */
- name: ListType;
- /** 图标组件 */
- icon: Component;
- /** 工具标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 对齐方式类型
- */
-export type AlignValue = 'left' | 'center' | 'right' | 'justify';
-/**
- * 对齐工具配置接口
- */
-export interface AlignToolConfig {
- /** 对齐方式 */
- value: AlignValue;
- /** 图标组件 */
- icon: Component;
- /** 工具标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 插入工具配置接口
- */
-export interface InsertToolConfig {
- /** 插入内容类型 */
- name: 'link' | 'image' | 'table' | 'codeBlock';
- /** 图标组件 */
- icon: Component;
- /** 工具标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * AI 工具配置接口
- */
-export interface AiToolConfig {
- /** AI 功能名称 */
- name: 'continueWriting' | 'polish' | 'summarize' | 'translate' | 'customAi';
- /** 图标组件 */
- icon: Component;
- /** 工具标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void;
-}
-/**
- * 下拉菜单项接口
- */
-export interface MenuItemConfig {
- /** 菜单项 key */
- key: string;
- /** 菜单项标签 */
- label: string;
- /** 图标组件(可选) */
- icon?: Component;
- /** 点击时执行的操作 */
- action: () => void;
- /** 是否禁用 */
- disabled?: boolean;
- /** 是否为危险操作(红色) */
- danger?: boolean;
- /** 是否激活(用于显示激活状态) */
- active?: boolean;
- /** 子菜单项(可选) */
- children?: MenuItemConfig[];
-}
-/**
- * 菜单分组接口
- */
-export interface MenuGroupConfig {
- /** 分组标题 */
- title: string;
- /** 分组内的菜单项 */
- items: MenuItemConfig[];
-}
-/**
- * 工具栏配置工厂函数类型
- */
-export type ToolbarConfigFactory = (editor: Editor) => T[];
-/**
- * 编辑操作配置接口
- */
-export interface EditActionConfig {
- /** 图标组件 */
- icon: Component;
- /** 操作标题 */
- title: string;
- /** 点击时执行的操作 */
- action: () => void | Promise;
- /** 是否为危险操作 */
- danger?: boolean;
-}
-/**
- * 选择器选项接口
- */
-export interface SelectOption {
- /** 显示标签 */
- label: string;
- /** 选项值 */
- value: T;
-}
-/**
- * 工具栏分组配置接口
- */
-export interface ToolbarGroupConfig {
- /** 分组名称 */
- name: string;
- /** 分组内的按钮配置 */
- buttons: ToolbarButtonConfig[];
- /** 是否显示分隔线 */
- showDivider?: boolean;
-}
-/**
- * 完整工具栏配置接口
- */
-export interface FullToolbarConfig {
- /** 文本格式工具 */
- textFormats: ToolbarButtonConfig[];
- /** 标题工具 */
- headings: HeadingConfig[];
- /** 颜色工具 */
- colorTools: ColorToolConfig[];
- /** 列表工具 */
- listTools: ListToolConfig[];
- /** 对齐工具 */
- alignTools: AlignToolConfig[];
- /** 插入工具 */
- insertTools: InsertToolConfig[];
- /** 表格工具 */
- tableTools?: {
- rowTools: TableOperationConfig[];
- colTools: TableOperationConfig[];
- cellTools: TableOperationConfig[];
- };
- /** AI 工具 */
- aiTools: AiToolConfig[];
-}
-/**
- * 浮动菜单配置接口
- */
-export interface BubbleMenuConfig {
- /** 是否显示菜单 */
- shouldShow: (props: {
- editor: Editor;
- from: number;
- to: number;
- state: any;
- }) => boolean;
- /** 菜单位置 */
- placement?: 'top' | 'bottom' | 'left' | 'right';
- /** Tippy.js 配置选项 */
- tippyOptions?: Record;
-}
-/**
- * 命令参数类型映射
- */
-export interface CommandParams {
- toggleBold: [];
- toggleItalic: [];
- toggleUnderline: [];
- toggleStrike: [];
- toggleSubscript: [];
- toggleSuperscript: [];
- toggleCode: [];
- setColor: [color: string];
- setHighlight: [options: {
- color: string;
- }];
- setFontFamily: [fontFamily: string];
- setFontSize: [fontSize: string];
- setTextAlign: [align: AlignValue];
- toggleHeading: [options: {
- level: number;
- }];
- setHeading: [options: {
- level: number;
- }];
- setParagraph: [];
- toggleBulletList: [];
- toggleOrderedList: [];
- toggleTaskList: [];
- insertTable: [options: {
- rows: number;
- cols: number;
- withHeaderRow?: boolean;
- }];
- addRowBefore: [];
- addRowAfter: [];
- deleteRow: [];
- addColumnBefore: [];
- addColumnAfter: [];
- deleteColumn: [];
- mergeCells: [];
- splitCell: [];
- toggleHeaderRow: [];
- toggleHeaderColumn: [];
- deleteTable: [];
- setLink: [options: {
- href: string;
- }];
- unsetLink: [];
- setCodeBlock: [options: {
- language: string;
- }];
- insertContent: [content: string | Record];
- setCellAttribute: [name: string, value: any];
-}
-/**
- * 编辑器状态类型
- */
-export interface EditorStateInfo {
- /** 是否可撤销 */
- canUndo: boolean;
- /** 是否可重做 */
- canRedo: boolean;
- /** 当前激活的标记 */
- activeMarks: string[];
- /** 当前激活的节点 */
- activeNodes: string[];
- /** 当前段落样式 */
- paragraphStyle: string;
- /** 当前文本对齐方式 */
- textAlign: string;
- /** 是否在表格中 */
- isInTable: boolean;
- /** 是否有选区 */
- hasSelection: boolean;
- /** 选区是否为空 */
- isEmptySelection: boolean;
-}
-/**
- * 文本颜色类型
- * @note 实际类型从 TEXT_COLORS 常量推导,见 editorConstants.ts
- */
-export type TextColor = string;
-/**
- * 背景颜色类型
- * @note 实际类型从 BACKGROUND_COLORS 常量推导,见 editorConstants.ts
- */
-export type BackgroundColor = string;
-/**
- * 字体系列类型
- * @note 实际类型从 FONT_FAMILIES 常量推导,见 editorConstants.ts
- */
-export type FontFamily = string;
-/**
- * 字号类型
- * @note 实际类型从 FONT_SIZES 常量推导,见 editorConstants.ts
- */
-export type FontSize = string;
-/**
- * 行间距类型
- * @note 实际类型从 LINE_HEIGHTS 常量推导,见 editorConstants.ts
- */
-export type LineHeight = string;
-/**
- * 代码语言类型
- * @note 实际类型从 CODE_LANGUAGES 常量推导,见 shared/configs/editorConstants.ts
- */
-export type CodeLanguage = string;
-/**
- * 表格边框样式类型
- * @note 实际类型从 TABLE_BORDER_STYLES 常量推导,见 editorConstants.ts
- */
-export type TableBorderStyle = string;
-//# sourceMappingURL=toolbar.d.ts.map
\ No newline at end of file
diff --git a/src/configs/toolbar.d.ts.map b/src/configs/toolbar.d.ts.map
deleted file mode 100644
index 5136722..0000000
--- a/src/configs/toolbar.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEhF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa;IACb,IAAI,EAAE,cAAc,CAAA;IACpB,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAEhF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CAAA;IACjC,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,iBAAiB;IACjB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,UAAU,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa;IACb,IAAI,EAAE,QAAQ,CAAA;IACd,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW;IACX,KAAK,EAAE,UAAU,CAAA;IACjB,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa;IACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAA;IAC9C,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc;IACd,IAAI,EAAE,iBAAiB,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAA;IAC3E,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc;IACd,GAAG,EAAE,MAAM,CAAA;IACX,YAAY;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qBAAqB;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe;IACf,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,cAAc;IACd,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,EAAE,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW;IACX,IAAI,EAAE,SAAS,CAAA;IACf,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,cAAc;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM;IACtC,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU;IACV,KAAK,EAAE,CAAC,CAAA;CACT;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe;IACf,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,cAAc;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,aAAa;IACb,WAAW,EAAE,mBAAmB,EAAE,CAAA;IAClC,WAAW;IACX,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,WAAW;IACX,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,WAAW;IACX,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,WAAW;IACX,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,WAAW;IACX,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,WAAW;IACX,UAAU,CAAC,EAAE;QACX,QAAQ,EAAE,oBAAoB,EAAE,CAAA;QAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAA;QAChC,SAAS,EAAE,oBAAoB,EAAE,CAAA;KAClC,CAAA;IACD,YAAY;IACZ,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa;IACb,UAAU,EAAE,CAAC,KAAK,EAAE;QAClB,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,GAAG,CAAA;KACX,KAAK,OAAO,CAAA;IACb,WAAW;IACX,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC/C,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,EAAE,CAAA;IACd,YAAY,EAAE,EAAE,CAAA;IAChB,eAAe,EAAE,EAAE,CAAA;IACnB,YAAY,EAAE,EAAE,CAAA;IAChB,eAAe,EAAE,EAAE,CAAA;IACnB,iBAAiB,EAAE,EAAE,CAAA;IACrB,UAAU,EAAE,EAAE,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACzB,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1C,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACnC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACjC,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC3C,UAAU,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACxC,YAAY,EAAE,EAAE,CAAA;IAChB,gBAAgB,EAAE,EAAE,CAAA;IACpB,iBAAiB,EAAE,EAAE,CAAA;IACrB,cAAc,EAAE,EAAE,CAAA;IAClB,WAAW,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IAC/E,YAAY,EAAE,EAAE,CAAA;IAChB,WAAW,EAAE,EAAE,CAAA;IACf,SAAS,EAAE,EAAE,CAAA;IACb,eAAe,EAAE,EAAE,CAAA;IACnB,cAAc,EAAE,EAAE,CAAA;IAClB,YAAY,EAAE,EAAE,CAAA;IAChB,UAAU,EAAE,EAAE,CAAA;IACd,SAAS,EAAE,EAAE,CAAA;IACb,eAAe,EAAE,EAAE,CAAA;IACnB,kBAAkB,EAAE,EAAE,CAAA;IACtB,WAAW,EAAE,EAAE,CAAA;IACf,OAAO,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpC,SAAS,EAAE,EAAE,CAAA;IACb,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC7C,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IACtD,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc;IACd,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,cAAc;IACd,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,aAAa;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa;IACb,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY;IACZ,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa;IACb,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAOD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE7B;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA"}
\ No newline at end of file
diff --git a/src/configs/toolbarConfigs.d.ts b/src/configs/toolbarConfigs.d.ts
deleted file mode 100644
index a54526f..0000000
--- a/src/configs/toolbarConfigs.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { Editor } from '@tiptap/core';
-import type { ToolbarButtonConfig, HeadingConfig, ListToolConfig, MenuItemConfig } from './toolbar';
-/**
- * 创建文本格式工具配置
- */
-export declare function createTextFormatTools(editor: Editor): ToolbarButtonConfig[];
-/**
- * 创建标题工具配置
- */
-export declare function createHeadingTools(editor: Editor): HeadingConfig[];
-/**
- * 创建列表工具配置
- */
-export declare function createListTools(editor: Editor): ListToolConfig[];
-/**
- * 创建 AI 工具菜单项配置
- * @param editor 编辑器实例
- * @param t 翻译函数,用于国际化
- */
-export declare function createAiToolMenuItems(editor: Editor, t?: (key: string, params?: Record) => string): MenuItemConfig[];
-//# sourceMappingURL=toolbarConfigs.d.ts.map
\ No newline at end of file
diff --git a/src/configs/toolbarConfigs.d.ts.map b/src/configs/toolbarConfigs.d.ts.map
deleted file mode 100644
index 00b5a72..0000000
--- a/src/configs/toolbarConfigs.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"toolbarConfigs.d.ts","sourceRoot":"","sources":["toolbarConfigs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAuB1C,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,WAAW,CAAA;AAElB;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAmC3E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,CASlE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAuBhE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAqB,GAAG,cAAc,EAAE,CAwF/I"}
\ No newline at end of file
diff --git a/src/core/EditorToolbar.vue b/src/core/EditorToolbar.vue
deleted file mode 100644
index f9cf071..0000000
--- a/src/core/EditorToolbar.vue
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/core/EditorToolbar.vue.d.ts b/src/core/EditorToolbar.vue.d.ts
deleted file mode 100644
index d7f4b15..0000000
--- a/src/core/EditorToolbar.vue.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-import type { ToolbarConfig } from './toolbarConfig';
-import type { AiAdapter } from '@/ai';
-interface Props {
- editor: Editor | null;
- config: ToolbarConfig;
- aiAdapter?: AiAdapter;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=EditorToolbar.vue.d.ts.map
\ No newline at end of file
diff --git a/src/core/EditorToolbar.vue.d.ts.map b/src/core/EditorToolbar.vue.d.ts.map
deleted file mode 100644
index eb89d6c..0000000
--- a/src/core/EditorToolbar.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"EditorToolbar.vue.d.ts","sourceRoot":"","sources":["EditorToolbar.vue"],"names":[],"mappings":"AAAA,OA+GO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAcrC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;;AA4ND,wBAMG"}
\ No newline at end of file
diff --git a/src/core/TiptapEditor.vue b/src/core/TiptapEditor.vue
deleted file mode 100644
index 1f757f0..0000000
--- a/src/core/TiptapEditor.vue
+++ /dev/null
@@ -1,253 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/core/TiptapEditor.vue.d.ts b/src/core/TiptapEditor.vue.d.ts
deleted file mode 100644
index 89337e9..0000000
--- a/src/core/TiptapEditor.vue.d.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Editor } from '@tiptap/vue-3';
-import { type ToolbarConfig } from './toolbarConfig';
-import type { AiAdapter } from '@/ai';
-import '@/styles/index.css';
-export interface TiptapEditorProps {
- /** Initial HTML content */
- initialContent?: string;
- /** Read-only mode */
- readonly?: boolean;
- /** Preview mode (no toolbar, no footer) */
- previewMode?: boolean;
- /** Placeholder text */
- placeholder?: string;
- /** Language locale */
- locale?: string;
- /** Word processing mode (A4 paper style) */
- wordMode?: boolean;
- /** Theme: 'light' | 'dark' */
- theme?: 'light' | 'dark';
- /** Toolbar configuration */
- toolbar?: ToolbarConfig;
- /** AI adapter (required for AI features) */
- aiAdapter?: AiAdapter;
-}
-declare const _default: import("vue").DefineComponent Editor | null;
- getJSON: () => import("@tiptap/core").DocumentType | undefined, import("@tiptap/core").NodeType | undefined, any, (import("@tiptap/core").NodeType | import("@tiptap/core").TextType>)[]>[]> | null;
- getHTML: () => string;
- getText: () => string;
-}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
- update: (content: any) => any;
- ready: (editor: Editor) => any;
-}, string, import("vue").PublicProps, Readonly & Readonly<{
- onUpdate?: ((content: any) => any) | undefined;
- onReady?: ((editor: Editor) => any) | undefined;
-}>, {
- placeholder: string;
- locale: string;
- readonly: boolean;
- initialContent: string;
- previewMode: boolean;
- theme: "light" | "dark";
- wordMode: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=TiptapEditor.vue.d.ts.map
\ No newline at end of file
diff --git a/src/core/TiptapEditor.vue.d.ts.map b/src/core/TiptapEditor.vue.d.ts.map
deleted file mode 100644
index f639541..0000000
--- a/src/core/TiptapEditor.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TiptapEditor.vue.d.ts","sourceRoot":"","sources":["TiptapEditor.vue"],"names":[],"mappings":"AAgQA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAA;AAYrD,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAIrC,OAAO,oBAAoB,CAAA;AAE3B,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;;;;;;;;;;;;;iBAXe,MAAM;YAEX,MAAM;cANJ,OAAO;oBAFD,MAAM;iBAIT,OAAO;WAQb,OAAO,GAAG,MAAM;cAFb,OAAO;;AAqOpB,wBASG"}
\ No newline at end of file
diff --git a/src/core/TiptapProEditor.vue b/src/core/TiptapProEditor.vue
index 1ee190b..788477b 100644
--- a/src/core/TiptapProEditor.vue
+++ b/src/core/TiptapProEditor.vue
@@ -73,7 +73,7 @@
-
{{ editorError || '正在初始化编辑器...' }}
+
{{ editorError || t('editor.initializing') }}
@@ -86,6 +86,9 @@
:editor="editorInstance"
:showCharCount="true"
/>
+
+
+
@@ -94,18 +97,21 @@
* TiptapProEditor - 基础版富文本编辑器
* @description 支持基础版功能的 Tiptap 编辑器
*/
-import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'
+import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'
+import { debounce } from '@/utils/debounce'
import { Editor, EditorContent } from '@tiptap/vue-3'
+import type { Editor as CoreEditor } from '@tiptap/core'
import type { TiptapProEditorProps } from './editorTypes'
import { A4_WIDTH_PX, A4_HEIGHT_PX, PAGE_PADDING_TOP_PX, PAGE_PADDING_BOTTOM_PX, PAGE_CONTENT_HEIGHT_PX } from '@/extensions/pageConstants'
// @vben/locales removed - using built-in i18n
-import { createI18n, useI18n as useTiptapI18n, type LocaleCode } from '@/locales'
+import { createI18n, detectDefaultLocale, t, useI18n as useTiptapI18n, type LocaleCode } from '@/locales'
// 公共工具栏
import { ToolbarNav, BASIC_TOOLBAR_CONFIG, ADVANCED_TOOLBAR_CONFIG, type ToolbarToolsConfig } from '@/tools/header-nav'
// 功能模块组件
import { LinkBubbleMenu } from '@/tools/link-bubble'
+import { AiChatPanel } from '@/ai/agent'
import { TableToolbar } from '@/tools/table-toolbar'
import { FooterNav } from '@/tools/footer-nav'
import { ImageToolbar } from '@/tools/image-toolbar'
@@ -140,12 +146,20 @@ import '@/styles/image-resize.css'
import '@/styles/collaboration.css'
import '@/styles/slash-command.css'
+// 主题预设(类名作用域隔离:.theme-word / .theme-notion / ...,随包发布,使用者无需单独引入)
+import '@/themes/presets/word.css'
+import '@/themes/presets/notion.css'
+import '@/themes/presets/github.css'
+import '@/themes/presets/typora.css'
+
const props = withDefaults(defineProps(), {
zoomBarPlacement: 'bottom',
readonly: false,
previewMode: false,
- initialContent: '开始编辑你的文档...
',
- version: 'basic',
+ initialContent: '',
+ // 默认全功能:与 0.1.x 行为一致(旧文档含表格/公式可正常打开,AI 入口有对应扩展支撑);
+ // 追求更小运行时的使用者显式传 'basic' / 'minimal'
+ version: 'premium',
})
// ===== 预览模式 =====
@@ -153,6 +167,7 @@ const isPreviewMode = computed(() => props.previewMode)
const emit = defineEmits<{
update: [content: any]
+ 'update:modelValue': [value: string | object]
collaboratorsChange: [count: number]
collaboratorsListChange: [users: Array<{ id: string | number; name: string; color: string }>]
}>()
@@ -181,11 +196,11 @@ const getUserInfo = (): { id: string | number; name: string } => {
const userInfo = userStore.userInfo
if (userInfo) {
const id = userInfo.userId || (userInfo as any).id || (userInfo as any).user_id || 'anonymous'
- const name = userInfo.realName || userInfo.userName || (userInfo as any).name || (userInfo as any).real_name || (userInfo as any).username || '匿名用户'
+ const name = userInfo.realName || userInfo.userName || (userInfo as any).name || (userInfo as any).real_name || (userInfo as any).username || t('editor.anonymousUser')
return { id, name }
}
} catch {}
- return { id: 'anonymous', name: '匿名用户' }
+ return { id: 'anonymous', name: t('editor.anonymousUser') }
}
// ===== 协作编辑(使用 Composable) =====
@@ -314,9 +329,21 @@ const toolbarConfig = computed(() => {
}
})
+// AI 文档助手:仅在加载了 AI 扩展的档位(advanced/premium)可用;
+// versionConfig.features.ai 与 features.aiChat 均可显式关闭;预览/只读下隐藏
+const aiChatEnabled = computed(
+ () =>
+ (props.version === 'advanced' || props.version === 'premium') &&
+ props.versionConfig?.features?.ai !== false &&
+ props.features?.aiChat !== false &&
+ !isPreviewMode.value &&
+ !props.readonly
+)
+
// ===== 国际化 =====
// Use locale from props instead of @vben/locales
-const currentLocale = computed(() => props.locale || 'zh-CN')
+// 不传 locale 时按浏览器语言自动检测(zh → zh-CN/zh-TW,其它 → en-US)
+const currentLocale = computed(() => props.locale || detectDefaultLocale())
const mapLocaleToTiptapLocale = (locale: string): LocaleCode => {
const localeMap: Record = {
@@ -365,6 +392,23 @@ const calculatePages = () => {
})
}
+// 分页计算:防抖 + requestAnimationFrame 合帧,避免输入时频繁强制重排
+// (编辑器初始化后的首次分页计算仍直接调用 calculatePages,保证首屏不跳动)
+let pagesRafId: number | null = null
+const schedulePageCalculation = debounce(() => {
+ if (pagesRafId !== null) cancelAnimationFrame(pagesRafId)
+ pagesRafId = requestAnimationFrame(() => {
+ pagesRafId = null
+ calculatePages()
+ })
+}, 200)
+
+// update 事件防抖派发(getJSON 全文序列化开销较大)
+const emitUpdateDebounced = debounce((editorInst: CoreEditor) => {
+ if (editorInst.isDestroyed) return
+ emit('update', editorInst.getJSON())
+}, 200)
+
// ===== 编辑器内容管理 =====
const getEditorContent = () => {
try {
@@ -380,10 +424,53 @@ const getInitialContent = (): any => {
const currentContent = getEditorContent()
if (currentContent) return currentContent
}
- // 使用 collaboration 模块的 normalizeContent
- return normalizeContent(props.initialContent, { silent: true })
+ // 使用 collaboration 模块的 normalizeContent(modelValue 优先于 initialContent)
+ return normalizeContent(props.modelValue ?? props.initialContent, { silent: true })
}
+// ===== v-model 支持 =====
+// 以「是否绑定了 update:modelValue 监听器」判定 v-model 是否启用:
+// 用 ref()(初值 undefined)绑定 v-model 是常见写法,不能用 modelValue !== undefined 判定
+const hasModelValueListener = !!getCurrentInstance()?.vnode.props?.['onUpdate:modelValue']
+
+// 记录最近一次 emit 出去的值:v-model 回环写回时 O(1) 短路,避免每次按键的二次全文序列化
+let lastEmittedModelValue: string | object | undefined
+
+/**
+ * 同步 v-model(不防抖,v-model 语义要求同步)
+ * @description modelValue 当前为 object 时输出 JSON,否则输出 HTML 字符串
+ */
+const emitModelValue = (editorInst: CoreEditor) => {
+ if (!hasModelValueListener) return
+ const isObjectMode = typeof props.modelValue === 'object' && props.modelValue !== null
+ const value = isObjectMode ? editorInst.getJSON() : editorInst.getHTML()
+ lastEmittedModelValue = value
+ emit('update:modelValue', value)
+}
+
+// 外部 modelValue 变化时同步到编辑器(先与当前内容比较,避免 v-model 循环更新)
+watch(
+ () => props.modelValue,
+ (newValue) => {
+ if (newValue === undefined || !editor.value) return
+ // 我们刚 emit 出去的值被父组件写回来了(v-model 回环),直接短路
+ if (newValue === lastEmittedModelValue) return
+ // 协作模式下内容由 Yjs 共享文档管理,外部整体 setContent 会覆盖所有协作者的内容
+ if (isCollaborationAvailable.value) {
+ console.warn('[TiptapProEditor] Ignoring external modelValue write while collaboration is active.')
+ return
+ }
+ const isObjectMode = typeof newValue === 'object' && newValue !== null
+ const isSame = isObjectMode
+ ? JSON.stringify(editor.value.getJSON()) === JSON.stringify(newValue)
+ : editor.value.getHTML() === newValue
+ if (!isSame) {
+ editor.value.commands.setContent(newValue as any, { emitUpdate: false })
+ schedulePageCalculation()
+ }
+ }
+)
+
// ===== 协作功能初始化(使用 useCollaboration) =====
const initCollaborationFeature = async (initialContent: any, extensions: any[]) => {
if (!isCollaborationAvailable.value) {
@@ -416,6 +503,9 @@ const initCollaborationFeature = async (initialContent: any, extensions: any[])
} catch {}
}
+// 注:工具栏状态的「事务 → 响应式」桥接由各子组件的 useReactiveEditor(src/utils/editorState.ts)
+// 自行订阅完成,本组件无需(也不应)在父级做 triggerRef 广播。
+
// ===== 编辑器初始化 =====
const initEditor = async () => {
if (isInitializing.value) return
@@ -460,8 +550,9 @@ const initEditor = async () => {
// 初始化协作功能
await initCollaborationFeature(initialContentToUse, extensions)
- // 销毁旧编辑器
+ // 销毁旧编辑器(先 flush 待派发的 update,避免丢失最后 200ms 内的输入)
if (editor.value) {
+ emitUpdateDebounced.flush()
editor.value.destroy()
editor.value = null
}
@@ -480,8 +571,10 @@ const initEditor = async () => {
attributes: { class: 'word-editor-content' },
},
onUpdate: ({ editor }) => {
- calculatePages()
- emit('update', editor.getJSON())
+ schedulePageCalculation()
+ // v-model 同步不防抖,update 事件防抖派发
+ emitModelValue(editor)
+ emitUpdateDebounced(editor)
},
})
@@ -501,9 +594,11 @@ const initEditor = async () => {
}
calculatePages()
+ // 观察内容元素尺寸:字体/图片/异步 NodeView 加载完成引起的内容高度变化都会触发页数重算
+ observeContentResize()
} catch (error) {
console.error('[TiptapProEditor] Editor initialization failed:', error)
- editorError.value = '编辑器初始化失败'
+ editorError.value = t('editor.initFailed')
} finally {
isInitializing.value = false
}
@@ -513,17 +608,50 @@ const initEditor = async () => {
const destroyEditor = async () => {
collaboration.disable()
if (editor.value) {
+ // 先 flush 待派发的 update,避免丢失最后 200ms 内的输入(自动保存场景)
+ emitUpdateDebounced.flush()
editor.value.destroy()
editor.value = null
}
}
// ===== 生命周期 =====
+// 观察「内容元素 + 外层容器」的尺寸变化重算页数:
+// 内容元素(.ProseMirror)覆盖字体/图片加载、异步 NodeView 造成的内容高度变化;
+// 外层容器覆盖窗口缩放、编辑器从隐藏容器变为可见等布局场景
+let containerResizeObserver: ResizeObserver | null = null
+
+const observeContentResize = () => {
+ if (typeof ResizeObserver === 'undefined') return
+ if (!containerResizeObserver) {
+ containerResizeObserver = new ResizeObserver(() => {
+ schedulePageCalculation()
+ })
+ } else {
+ containerResizeObserver.disconnect()
+ }
+ if (containerRef.value) containerResizeObserver.observe(containerRef.value)
+ const contentDom = editor.value?.view?.dom
+ if (contentDom) containerResizeObserver.observe(contentDom)
+}
+
onMounted(async () => {
await initEditor()
+ // 字体加载完成后内容高度会变化,就绪后再校正一次页数
+ if (typeof document !== 'undefined' && document.fonts?.ready) {
+ document.fonts.ready.then(() => schedulePageCalculation()).catch(() => {})
+ }
})
onBeforeUnmount(async () => {
+ containerResizeObserver?.disconnect()
+ containerResizeObserver = null
+ // 分页计算直接丢弃;update 事件在 destroyEditor 内 flush(不丢最后 200ms 的输入)
+ schedulePageCalculation.cancel()
+ if (pagesRafId !== null) {
+ cancelAnimationFrame(pagesRafId)
+ pagesRafId = null
+ }
await destroyEditor()
})
diff --git a/src/core/TiptapProEditor.vue.d.ts b/src/core/TiptapProEditor.vue.d.ts
deleted file mode 100644
index 096f3f6..0000000
--- a/src/core/TiptapProEditor.vue.d.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { Editor } from '@tiptap/vue-3';
-import type { TiptapProEditorProps } from './editorTypes';
-import '@/styles/base.css';
-import '@/styles/word-mode.css';
-import '@/styles/toolbar.css';
-import '@/styles/image-toolbar.css';
-import '@/styles/floating-menu-toolbar.css';
-import '@/styles/drag-handle-with-menu.css';
-import '@/styles/image-resize.css';
-import '@/styles/collaboration.css';
-declare const _default: import("vue").DefineComponent Editor | null;
- getJSON: () => import("@tiptap/core").DocumentType | undefined, import("@tiptap/core").NodeType | undefined, any, (import("@tiptap/core").NodeType | import("@tiptap/core").TextType>)[]>[]> | null;
- getHTML: () => string;
- getText: () => string;
-}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
- update: (content: any) => any;
- collaboratorsChange: (count: number) => any;
- collaboratorsListChange: (users: {
- id: string | number;
- name: string;
- color: string;
- }[]) => any;
-}, string, import("vue").PublicProps, Readonly & Readonly<{
- onUpdate?: ((content: any) => any) | undefined;
- onCollaboratorsChange?: ((count: number) => any) | undefined;
- onCollaboratorsListChange?: ((users: {
- id: string | number;
- name: string;
- color: string;
- }[]) => any) | undefined;
-}>, {
- readonly: boolean;
- version: import("./editorTypes").EditorVersion;
- initialContent: string | object;
- zoomBarPlacement: "bottom" | "belowToolbar";
- previewMode: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=TiptapProEditor.vue.d.ts.map
\ No newline at end of file
diff --git a/src/core/TiptapProEditor.vue.d.ts.map b/src/core/TiptapProEditor.vue.d.ts.map
deleted file mode 100644
index 028641f..0000000
--- a/src/core/TiptapProEditor.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TiptapProEditor.vue.d.ts","sourceRoot":"","sources":["TiptapProEditor.vue"],"names":[],"mappings":"AAshBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AA+BzD,OAAO,mBAAmB,CAAA;AAC1B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,4BAA4B,CAAA;AACnC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,2BAA2B,CAAA;AAClC,OAAO,4BAA4B,CAAA;;;;;;;;;;YAiBY,MAAM,GAAG,MAAM;cAAQ,MAAM;eAAS,MAAM;;;;;;YAA5C,MAAM,GAAG,MAAM;cAAQ,MAAM;eAAS,MAAM;;;;;;;;;AA2nB3F,wBASG"}
\ No newline at end of file
diff --git a/src/core/editorConfig.d.ts b/src/core/editorConfig.d.ts
deleted file mode 100644
index 8ec76a8..0000000
--- a/src/core/editorConfig.d.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * Editor Configuration Types
- * Pluggable feature system
- */
-/** Theme mode */
-export type ThemeMode = 'light' | 'dark' | 'auto';
-/** Theme preset */
-export type ThemePreset = 'default' | 'notion' | 'typora' | 'word' | 'github' | 'custom';
-/** Feature flags */
-export interface FeatureFlags {
- heading?: boolean;
- textFormat?: boolean;
- list?: boolean;
- align?: boolean;
- color?: boolean;
- image?: boolean;
- font?: boolean;
- link?: boolean;
- table?: boolean;
- codeBlock?: boolean;
- undoRedo?: boolean;
- formatPainter?: boolean;
- zoom?: boolean;
- subscriptSuperscript?: boolean;
- clearFormat?: boolean;
- headerNav?: boolean;
- footerNav?: boolean;
- dragHandleMenu?: boolean;
- floatingMenu?: boolean;
- linkBubbleMenu?: boolean;
- tableToolbar?: boolean;
- imageToolbar?: boolean;
- ai?: boolean;
-}
-/** AI configuration */
-export interface AiConfig {
- provider: 'openai' | 'aliyun' | 'ollama' | 'deepseek';
- apiKey: string;
- model?: string;
- baseUrl?: string;
-}
-/** Editor configuration */
-export interface EditorConfig {
- /** Theme mode (light/dark/auto) */
- theme?: ThemeMode;
- /** Theme preset */
- themePreset?: ThemePreset;
- /** Custom theme CSS variables */
- customTheme?: Record;
- /** Feature flags */
- features?: FeatureFlags;
- /** AI configuration */
- aiConfig?: AiConfig;
- /** Locale */
- locale?: 'zh-CN' | 'zh-TW' | 'en-US';
- /** Readonly mode */
- readonly?: boolean;
- /** Preview mode (no toolbar) */
- previewMode?: boolean;
- /** Initial content */
- initialContent?: string;
- /** Placeholder */
- placeholder?: string;
- /** License key */
- licenseKey?: string;
-}
-/** Preset configurations */
-export declare const PRESET_CONFIGS: {
- /** 最小配置 */
- readonly minimal: {
- features: {
- textFormat: true;
- list: true;
- undoRedo: true;
- };
- };
- /** 基础配置 */
- readonly basic: {
- features: {
- heading: true;
- textFormat: true;
- list: true;
- align: true;
- link: true;
- undoRedo: true;
- headerNav: true;
- };
- };
- /** 高级配置 */
- readonly advanced: {
- features: {
- heading: true;
- textFormat: true;
- list: true;
- align: true;
- color: true;
- image: true;
- font: true;
- link: true;
- table: true;
- codeBlock: true;
- undoRedo: true;
- formatPainter: true;
- zoom: true;
- headerNav: true;
- footerNav: true;
- dragHandleMenu: true;
- linkBubbleMenu: true;
- tableToolbar: true;
- imageToolbar: true;
- };
- };
- /** 完整配置(含 AI) */
- readonly full: {
- features: {
- heading: true;
- textFormat: true;
- list: true;
- align: true;
- color: true;
- image: true;
- font: true;
- link: true;
- table: true;
- codeBlock: true;
- undoRedo: true;
- formatPainter: true;
- zoom: true;
- subscriptSuperscript: true;
- clearFormat: true;
- headerNav: true;
- footerNav: true;
- dragHandleMenu: true;
- floatingMenu: true;
- linkBubbleMenu: true;
- tableToolbar: true;
- imageToolbar: true;
- ai: true;
- };
- };
-};
-export type PresetName = keyof typeof PRESET_CONFIGS;
-/** 合并配置 */
-export declare function mergeConfig(preset: PresetName | Partial, overrides?: Partial): EditorConfig;
-//# sourceMappingURL=editorConfig.d.ts.map
\ No newline at end of file
diff --git a/src/core/editorConfig.d.ts.map b/src/core/editorConfig.d.ts.map
deleted file mode 100644
index 249155e..0000000
--- a/src/core/editorConfig.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"editorConfig.d.ts","sourceRoot":"","sources":["editorConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iBAAiB;AACjB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjD,mBAAmB;AACnB,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAExF,oBAAoB;AACpB,MAAM,WAAW,YAAY;IAE3B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IAGf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;IAGrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IAGtB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED,uBAAuB;AACvB,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,mBAAmB;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,aAAa;IACb,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;IACpC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,4BAA4B;AAC5B,eAAO,MAAM,cAAc;IACzB,WAAW;;;;;;;;IASX,WAAW;;;;;;;;;;;;IAaX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;IAyBX,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BT,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,cAAc,CAAA;AAEpD,WAAW;AACX,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,EAC1C,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,YAAY,CAad"}
\ No newline at end of file
diff --git a/src/core/editorConfig.ts b/src/core/editorConfig.ts
index 225d158..8a5d792 100644
--- a/src/core/editorConfig.ts
+++ b/src/core/editorConfig.ts
@@ -38,6 +38,7 @@ export interface FeatureFlags {
linkBubbleMenu?: boolean
tableToolbar?: boolean
imageToolbar?: boolean
+ slashCommand?: boolean
// AI
ai?: boolean
@@ -123,6 +124,7 @@ export const PRESET_CONFIGS = {
linkBubbleMenu: true,
tableToolbar: true,
imageToolbar: true,
+ slashCommand: true,
},
} satisfies Partial,
@@ -151,6 +153,7 @@ export const PRESET_CONFIGS = {
linkBubbleMenu: true,
tableToolbar: true,
imageToolbar: true,
+ slashCommand: true,
ai: true,
},
} satisfies Partial,
@@ -165,7 +168,10 @@ export const PRESET_CONFIGS = {
// 浮动工具栏(选中文字时显示)
floatingMenu: true,
linkBubbleMenu: true,
-
+
+ // 斜杠命令菜单(输入 / 唤起)
+ slashCommand: true,
+
// 拖拽排序(六个点菜单)
dragHandleMenu: true,
diff --git a/src/core/editorTypes.d.ts b/src/core/editorTypes.d.ts
deleted file mode 100644
index 0ec30e6..0000000
--- a/src/core/editorTypes.d.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * TiptapPro Tenant Editor Types
- * @description 编辑器类型定义(支持版本配置)
- */
-import type { Editor } from '@tiptap/vue-3';
-/**
- * 版本类型
- */
-export type EditorVersion = 'basic' | 'advanced' | 'premium';
-/**
- * 编辑器功能配置
- */
-export interface FeatureConfig {
- /** 是否启用拖拽功能 */
- dragHandle?: boolean;
- /** 是否启用六个点(拖拽手柄菜单)功能 */
- dragHandleMenu?: boolean;
- /** 是否启用表格功能 */
- table?: boolean;
- /** 是否启用表格工具栏(默认关闭,需显式开启) */
- tableToolbar?: boolean;
- /** 是否启用@提及功能 */
- mention?: boolean;
- /** 是否启用悬浮框功能 */
- floatingMenu?: boolean;
- /** 是否启用图片工具栏功能 */
- image?: boolean;
- /** 是否启用链接悬浮框功能 */
- linkBubbleMenu?: boolean;
- /** 是否启用协作编辑功能 */
- collaboration?: boolean;
- /** 是否启用头部导航 */
- headerNav?: boolean;
- /** 是否启用底部导航 */
- footerNav?: boolean;
-}
-/**
- * 版本配置接口
- */
-export interface VersionConfig {
- /** 版本类型(基础版/进阶版/高级版) */
- version?: EditorVersion;
- /** 功能开关配置 */
- features?: {
- /** 基础版功能 */
- basic?: boolean;
- /** 进阶版功能 */
- advanced?: boolean;
- /** AI功能 */
- ai?: boolean;
- /** 协作编辑 */
- collaboration?: boolean;
- /** 头部导航 */
- headerNav?: boolean;
- /** 底部导航 */
- footerNav?: boolean;
- /** 预览模式 */
- previewMode?: boolean;
- };
-}
-/**
- * 编辑器 Props
- */
-export interface TiptapProEditorProps {
- /** 版本配置 */
- version?: EditorVersion;
- /** 版本配置对象(与 version 二选一) */
- versionConfig?: VersionConfig;
- /** 缩放条位置:底部固定或工具栏下方 */
- zoomBarPlacement?: 'bottom' | 'belowToolbar';
- /** 是否为只读模式 */
- readonly?: boolean;
- /** 是否为预览模式(无头部/底部导航,不可编辑,不可点击) */
- previewMode?: boolean;
- /** 文档ID(用于加载和保存以及协同房间) */
- documentId?: string;
- /** 初始内容 - 可以是 HTML 字符串或 JSON 对象(ProseMirror 格式) */
- initialContent?: string | object;
- /** 表格悬浮框显示模式:1=聚焦显示;2=单元格选中显示 */
- tableMenuShowMode?: 1 | 2;
- /** 功能配置(兼容旧版) */
- features?: FeatureConfig;
-}
-/**
- * 协作用户信息
- */
-export interface CollaboratorInfo {
- id: string | number;
- name: string;
- color: string;
-}
-/**
- * 编辑器实例引用
- */
-export interface EditorInstance {
- editor: Editor | null;
- getEditor: () => Editor | null;
- getJSON: () => any;
- getHTML: () => string;
- getText: () => string;
-}
-/**
- * 编辑器暴露的方法
- */
-export interface TiptapProEditorExpose {
- getEditor: () => Editor | null;
- getJSON: () => any;
- getHTML: () => string;
- getText: () => string;
-}
-//# sourceMappingURL=editorTypes.d.ts.map
\ No newline at end of file
diff --git a/src/core/editorTypes.d.ts.map b/src/core/editorTypes.d.ts.map
deleted file mode 100644
index 22ded53..0000000
--- a/src/core/editorTypes.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"editorTypes.d.ts","sourceRoot":"","sources":["editorTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,eAAe;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wBAAwB;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4BAA4B;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,kBAAkB;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,eAAe;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,aAAa;IACb,QAAQ,CAAC,EAAE;QACT,YAAY;QACZ,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,YAAY;QACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,WAAW;QACX,EAAE,CAAC,EAAE,OAAO,CAAA;QACZ,WAAW;QACX,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB,WAAW;QACX,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,WAAW;QACX,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,WAAW;QACX,WAAW,CAAC,EAAE,OAAO,CAAA;KACtB,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW;IACX,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,4BAA4B;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,uBAAuB;IACvB,gBAAgB,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAA;IAC5C,cAAc;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACzB,iBAAiB;IACjB,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,MAAM,GAAG,CAAA;IAClB,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,MAAM,GAAG,CAAA;IAClB,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,MAAM,CAAA;CACtB"}
\ No newline at end of file
diff --git a/src/core/editorTypes.ts b/src/core/editorTypes.ts
index 8babc1e..23d8304 100644
--- a/src/core/editorTypes.ts
+++ b/src/core/editorTypes.ts
@@ -8,7 +8,7 @@ import type { Editor } from '@tiptap/vue-3'
/**
* 版本类型
*/
-export type EditorVersion = 'basic' | 'advanced' | 'premium'
+export type EditorVersion = 'minimal' | 'basic' | 'advanced' | 'premium'
/**
* 编辑器功能配置
@@ -26,6 +26,8 @@ export interface FeatureConfig {
mention?: boolean
/** 是否启用斜杠命令菜单(输入 / 弹出块类型选择) */
slashCommand?: boolean
+ /** 是否启用 AI 文档助手聊天面板(文字指令编辑文档),跟随 AI 功能开启,可显式关闭 */
+ aiChat?: boolean
/** 是否启用悬浮框功能 */
floatingMenu?: boolean
/** 是否启用图片工具栏功能 */
@@ -81,6 +83,8 @@ export interface TiptapProEditorProps {
previewMode?: boolean
/** 文档ID(用于加载和保存以及协同房间) */
documentId?: string
+ /** v-model 绑定内容 - HTML 字符串或 JSON 对象(传字符串时同步 HTML,传对象时同步 JSON);优先于 initialContent 作为初始内容 */
+ modelValue?: string | object
/** 初始内容 - 可以是 HTML 字符串或 JSON 对象(ProseMirror 格式) */
initialContent?: string | object
/** 表格悬浮框显示模式:1=聚焦显示;2=单元格选中显示 */
diff --git a/src/core/toolbarConfig.d.ts b/src/core/toolbarConfig.d.ts
deleted file mode 100644
index 2a4558c..0000000
--- a/src/core/toolbarConfig.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Toolbar Configuration Types
- * Pluggable toolbar system
- */
-/** Available toolbar features */
-export type ToolbarFeature = 'undoRedo' | 'heading' | 'textFormat' | 'list' | 'align' | 'block' | 'fontSize' | 'fontFamily' | 'lineHeight' | 'textColor' | 'backgroundColor' | 'link' | 'codeBlock' | 'subSup' | 'formatClear' | 'ai';
-/** Toolbar configuration */
-export interface ToolbarConfig {
- /** Features to show in toolbar */
- features: ToolbarFeature[];
- /** Show dividers between groups */
- dividers?: boolean;
-}
-/** Default toolbar config */
-export declare const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig;
-/** Full toolbar config (all features) */
-export declare const FULL_TOOLBAR_CONFIG: ToolbarConfig;
-/** Minimal toolbar config */
-export declare const MINIMAL_TOOLBAR_CONFIG: ToolbarConfig;
-//# sourceMappingURL=toolbarConfig.d.ts.map
\ No newline at end of file
diff --git a/src/core/toolbarConfig.d.ts.map b/src/core/toolbarConfig.d.ts.map
deleted file mode 100644
index bfa93bb..0000000
--- a/src/core/toolbarConfig.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"toolbarConfig.d.ts","sourceRoot":"","sources":["toolbarConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iCAAiC;AACjC,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,SAAS,GACT,YAAY,GACZ,MAAM,GACN,OAAO,GACP,OAAO,GACP,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,MAAM,GACN,WAAW,GACX,QAAQ,GACR,aAAa,GACb,IAAI,CAAA;AAER,4BAA4B;AAC5B,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,6BAA6B;AAC7B,eAAO,MAAM,sBAAsB,EAAE,aAYpC,CAAA;AAED,yCAAyC;AACzC,eAAO,MAAM,mBAAmB,EAAE,aAmBjC,CAAA;AAED,6BAA6B;AAC7B,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAA"}
\ No newline at end of file
diff --git a/src/core/toolbarConfig.ts b/src/core/toolbarConfig.ts
deleted file mode 100644
index d65e25e..0000000
--- a/src/core/toolbarConfig.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Toolbar Configuration Types
- * Pluggable toolbar system
- */
-
-/** Available toolbar features */
-export type ToolbarFeature =
- | 'undoRedo'
- | 'heading'
- | 'textFormat'
- | 'list'
- | 'align'
- | 'block'
- | 'fontSize'
- | 'fontFamily'
- | 'lineHeight'
- | 'textColor'
- | 'backgroundColor'
- | 'link'
- | 'codeBlock'
- | 'math'
- | 'subSup'
- | 'formatClear'
- | 'word'
- | 'template'
- | 'gallery'
- | 'ai'
-
-/** Toolbar configuration */
-export interface ToolbarConfig {
- /** Features to show in toolbar */
- features: ToolbarFeature[]
- /** Show dividers between groups */
- dividers?: boolean
-}
-
-/** Default toolbar config */
-export const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig = {
- features: [
- 'undoRedo',
- 'heading',
- 'textFormat',
- 'list',
- 'align',
- 'block',
- 'link',
- 'formatClear',
- ],
- dividers: true,
-}
-
-/** Full toolbar config (all features) */
-export const FULL_TOOLBAR_CONFIG: ToolbarConfig = {
- features: [
- 'undoRedo',
- 'heading',
- 'fontSize',
- 'fontFamily',
- 'textFormat',
- 'textColor',
- 'backgroundColor',
- 'list',
- 'align',
- 'block',
- 'link',
- 'codeBlock',
- 'math',
- 'subSup',
- 'formatClear',
- 'word',
- 'template',
- 'gallery',
- 'ai',
- ],
- dividers: true,
-}
-
-/** Minimal toolbar config */
-export const MINIMAL_TOOLBAR_CONFIG: ToolbarConfig = {
- features: ['undoRedo', 'textFormat', 'list'],
- dividers: false,
-}
diff --git a/src/core/types.d.ts b/src/core/types.d.ts
deleted file mode 100644
index 5d47b6b..0000000
--- a/src/core/types.d.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Editor Types
- */
-import type { Editor } from '@tiptap/vue-3';
-/** Editor version/tier */
-export type EditorVersion = 'basic' | 'advanced' | 'premium';
-/** Feature configuration */
-export interface FeatureConfig {
- heading?: boolean;
- textFormat?: boolean;
- list?: boolean;
- align?: boolean;
- color?: boolean;
- image?: boolean;
- font?: boolean;
- link?: boolean;
- table?: boolean;
- codeBlock?: boolean;
- formatPainter?: boolean;
- undoRedo?: boolean;
- headerNav?: boolean;
- footerNav?: boolean;
- floatingMenu?: boolean;
- dragHandleMenu?: boolean;
- tableToolbar?: boolean;
- imageToolbar?: boolean;
- linkBubbleMenu?: boolean;
-}
-/** Tiptap Editor Props */
-export interface TiptapEditorProps {
- /** Initial HTML or JSON content */
- initialContent?: string | Record;
- /** Read-only mode */
- readonly?: boolean;
- /** Preview mode (hides toolbars) */
- previewMode?: boolean;
- /** Editor version tier */
- version?: EditorVersion;
- /** Feature toggles */
- features?: FeatureConfig;
- /** Placeholder text */
- placeholder?: string;
- /** Locale */
- locale?: 'zh-CN' | 'zh-TW' | 'en-US';
-}
-/** Editor exposed methods */
-export interface TiptapEditorExpose {
- getEditor: () => Editor | null;
- getJSON: () => Record | null;
- getHTML: () => string;
- getText: () => string;
-}
-//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/src/core/types.d.ts.map b/src/core/types.d.ts.map
deleted file mode 100644
index f2b863a..0000000
--- a/src/core/types.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,0BAA0B;AAC1B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAE5D,4BAA4B;AAC5B,MAAM,WAAW,aAAa;IAE5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IAGf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAGlB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,0BAA0B;AAC1B,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE7C,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,oCAAoC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAA;IAEvB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,aAAa,CAAA;IAExB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,aAAa;IACb,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;CACrC;AAED,6BAA6B;AAC7B,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,MAAM,CAAA;CACtB"}
\ No newline at end of file
diff --git a/src/core/types.ts b/src/core/types.ts
deleted file mode 100644
index ea44ec0..0000000
--- a/src/core/types.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Editor Types
- */
-
-import type { Editor } from '@tiptap/vue-3'
-
-/** Editor version/tier */
-export type EditorVersion = 'basic' | 'advanced' | 'premium'
-
-/** Feature configuration */
-export interface FeatureConfig {
- // Basic features
- heading?: boolean
- textFormat?: boolean
- list?: boolean
- align?: boolean
- color?: boolean
- image?: boolean
-
- // Advanced features
- font?: boolean
- link?: boolean
- table?: boolean
- codeBlock?: boolean
- formatPainter?: boolean
- undoRedo?: boolean
-
- // Tools
- headerNav?: boolean
- footerNav?: boolean
- floatingMenu?: boolean
- dragHandleMenu?: boolean
- tableToolbar?: boolean
- imageToolbar?: boolean
- linkBubbleMenu?: boolean
-}
-
-/** Tiptap Editor Props */
-export interface TiptapEditorProps {
- /** Initial HTML or JSON content */
- initialContent?: string | Record
-
- /** Read-only mode */
- readonly?: boolean
-
- /** Preview mode (hides toolbars) */
- previewMode?: boolean
-
- /** Editor version tier */
- version?: EditorVersion
-
- /** Feature toggles */
- features?: FeatureConfig
-
- /** Placeholder text */
- placeholder?: string
-
- /** Locale */
- locale?: 'zh-CN' | 'zh-TW' | 'en-US'
-}
-
-/** Editor exposed methods */
-export interface TiptapEditorExpose {
- getEditor: () => Editor | null
- getJSON: () => Record | null
- getHTML: () => string
- getText: () => string
-}
diff --git a/src/extensions/coreExtensions.d.ts b/src/extensions/coreExtensions.d.ts
deleted file mode 100644
index 2b3d741..0000000
--- a/src/extensions/coreExtensions.d.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Core Extensions - 核心扩展配置
- * @description 根据版本动态加载编辑器扩展
- */
-/**
- * 编辑器版本类型
- */
-export type EditorVersion = 'basic' | 'advanced' | 'premium' | 'all' | 1 | 2 | 3 | 4;
-/**
- * 扩展配置选项
- */
-export interface ExtensionsOptions {
- /** 是否启用图片增强功能(拖拽大小调整),默认 true */
- enableImageResize?: boolean;
- /** 是否禁用历史记录扩展(协作模式下需要禁用),默认 false */
- disableHistory?: boolean;
-}
-/**
- * 根据版本获取扩展配置
- * @param _version 编辑器版本(目前所有版本使用相同扩展,后续可根据版本区分)
- * @param optionsOrEnableImageResize 配置选项或是否启用图片增强功能(兼容旧 API)
- * @returns 扩展配置数组
- */
-export declare function getExtensionsByVersion(_version?: EditorVersion, optionsOrEnableImageResize?: boolean | ExtensionsOptions): any[];
-/**
- * 获取基础版扩展配置
- * @description 为了保持向后兼容,此函数内部调用 getExtensionsByVersion('basic')
- * @deprecated 建议直接使用 getExtensionsByVersion('basic') 或 getExtensionsByVersion(2)
- */
-export declare function getBasicExtensions(): any[];
-//# sourceMappingURL=coreExtensions.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/coreExtensions.d.ts.map b/src/extensions/coreExtensions.d.ts.map
deleted file mode 100644
index 73d3e7c..0000000
--- a/src/extensions/coreExtensions.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"coreExtensions.d.ts","sourceRoot":"","sources":["coreExtensions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEpF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qCAAqC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,GAAE,aAAuB,EACjC,0BAA0B,GAAE,OAAO,GAAG,iBAAwB,GAC7D,GAAG,EAAE,CAkIP;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,UAEjC"}
\ No newline at end of file
diff --git a/src/extensions/coreExtensions.ts b/src/extensions/coreExtensions.ts
index 7dfed64..be6b04b 100644
--- a/src/extensions/coreExtensions.ts
+++ b/src/extensions/coreExtensions.ts
@@ -32,6 +32,7 @@ import { ListShortcuts } from './listShortcuts'
import { LineHeight } from './lineHeight'
import { FormatPainter } from '@/features/advanced/format-painter'
import { MathExtension } from '@/extensions/math'
+import { t } from '@/locales'
import {
CustomAiExtension,
ContinueWritingExtension,
@@ -43,8 +44,44 @@ import {
/**
* 编辑器版本类型
+ * - 'minimal' / 1:最小集(基础文本格式 + 列表 + 撤销重做)
+ * - 'basic' / 2:基础集(颜色、对齐、图片、链接等,不含表格 / 数学公式 / 格式刷 / AI)
+ * - 'advanced' / 'premium' / 'all' / 'full' / 3 / 4:完整集(与历史行为一致,全量加载)
*/
-export type EditorVersion = 'basic' | 'advanced' | 'premium' | 'all' | 1 | 2 | 3 | 4
+export type EditorVersion =
+ | 'minimal'
+ | 'basic'
+ | 'advanced'
+ | 'premium'
+ | 'all'
+ | 'full'
+ | 1
+ | 2
+ | 3
+ | 4
+
+/** 内部功能等级:1=minimal 2=basic 3=full(advanced/premium/all 均为全量,保持向后兼容) */
+type ExtensionTier = 1 | 2 | 3
+
+function resolveTier(version: EditorVersion): ExtensionTier {
+ switch (version) {
+ case 'minimal':
+ case 1:
+ return 1
+ case 'basic':
+ case 2:
+ return 2
+ // advanced/premium/all/full 保持与历史行为一致:全量加载
+ case 'advanced':
+ case 'premium':
+ case 'all':
+ case 'full':
+ case 3:
+ case 4:
+ default:
+ return 3
+ }
+}
/**
* 扩展配置选项
@@ -58,12 +95,13 @@ export interface ExtensionsOptions {
/**
* 根据版本获取扩展配置
- * @param _version 编辑器版本(目前所有版本使用相同扩展,后续可根据版本区分)
+ * @param version 编辑器版本。不传时默认全量加载(与历史行为一致);
+ * 'minimal' / 'basic' 只加载对应子集(表格、数学公式、格式刷、AI 等重扩展被剔除)
* @param optionsOrEnableImageResize 配置选项或是否启用图片增强功能(兼容旧 API)
* @returns 扩展配置数组
*/
export function getExtensionsByVersion(
- _version: EditorVersion = 'basic',
+ version: EditorVersion = 'all',
optionsOrEnableImageResize: boolean | ExtensionsOptions = true
): AnyExtension[] {
// 兼容旧 API:如果传入 boolean,转换为配置对象
@@ -73,10 +111,10 @@ export function getExtensionsByVersion(
const { enableImageResize = true, disableHistory = false } = options
- // TODO: 根据 version 参数区分不同版本的扩展配置
+ const tier = resolveTier(version)
const extensions: AnyExtension[] = []
- // 基础扩展(所有版本都包含)
+ // ===== 最小集(所有版本都包含):基础文本格式、列表、撤销重做 =====
// 协作模式下禁用 history,因为 @tiptap/extension-collaboration 自带历史管理
const starterKitConfig: Record = {
// 禁用一些高级功能,在基础版中通过其他扩展提供
@@ -87,21 +125,42 @@ export function getExtensionsByVersion(
link: false,
underline: false,
}
-
+
// 协作模式下禁用 history
if (disableHistory) {
starterKitConfig.history = false
}
-
+
extensions.push(StarterKit.configure(starterKitConfig))
- // 占位符扩展
+ // 占位符扩展(函数形式:语言切换后能取到新文案)
extensions.push(
Placeholder.configure({
- placeholder: '开始编辑你的文档...',
+ placeholder: () => t('placeholder.default'),
})
)
+ // 下划线扩展
+ extensions.push(Underline)
+
+ // 任务列表扩展
+ extensions.push(TaskList)
+ extensions.push(
+ TaskItem.configure({
+ nested: true,
+ })
+ )
+
+ // 列表快捷键、字数统计(轻量,所有版本都包含)
+ extensions.push(ListShortcuts)
+ extensions.push(CharacterCount)
+
+ if (tier < 2) {
+ return extensions
+ }
+
+ // ===== 基础集(basic 及以上):颜色、对齐、图片、链接、字体等 =====
+
// 文本对齐扩展
extensions.push(
TextAlign.configure({
@@ -109,9 +168,6 @@ export function getExtensionsByVersion(
})
)
- // 下划线扩展
- extensions.push(Underline)
-
// 颜色和文本样式扩展
extensions.push(Color)
extensions.push(TextStyle)
@@ -139,31 +195,6 @@ export function getExtensionsByVersion(
})
)
- // 列表扩展
- extensions.push(TaskList)
- extensions.push(
- TaskItem.configure({
- nested: true,
- })
- )
-
- // 代码块扩展(StarterKit 已包含)
- // extensions.push(
- // CodeBlock.configure({
- // languageClassPrefix: 'language-',
- // })
- // )
-
- // 表格扩展
- extensions.push(
- Table.configure({
- resizable: true,
- })
- )
- extensions.push(TableRow)
- extensions.push(TableCell)
- extensions.push(TableHeader)
-
// 字体扩展
extensions.push(FontFamily)
extensions.push(FontSize)
@@ -175,9 +206,6 @@ export function getExtensionsByVersion(
// 行间距扩展
extensions.push(LineHeight)
- // 字数统计扩展
- extensions.push(CharacterCount)
-
// 视频扩展
extensions.push(
Video.configure({
@@ -189,7 +217,22 @@ export function getExtensionsByVersion(
// 粘贴扩展
extensions.push(PasteImage)
extensions.push(PasteWord)
- extensions.push(ListShortcuts)
+
+ if (tier < 3) {
+ return extensions
+ }
+
+ // ===== 完整集(advanced / premium / all):表格、格式刷、数学公式、AI =====
+
+ // 表格扩展
+ extensions.push(
+ Table.configure({
+ resizable: true,
+ })
+ )
+ extensions.push(TableRow)
+ extensions.push(TableCell)
+ extensions.push(TableHeader)
// 格式刷扩展
extensions.push(FormatPainter)
@@ -210,7 +253,9 @@ export function getExtensionsByVersion(
/**
* 获取基础版扩展配置
- * @description 为了保持向后兼容,此函数内部调用 getExtensionsByVersion('basic')
+ * @description 此函数内部调用 getExtensionsByVersion('basic')。
+ * 注意:basic 版本现在只加载基础子集(不含表格 / 数学公式 / 格式刷 / AI),
+ * 如需全量扩展请使用 getExtensionsByVersion('all')
* @deprecated 建议直接使用 getExtensionsByVersion('basic') 或 getExtensionsByVersion(2)
*/
export function getBasicExtensions() {
diff --git a/src/extensions/fontSize.d.ts b/src/extensions/fontSize.d.ts
deleted file mode 100644
index f2bda84..0000000
--- a/src/extensions/fontSize.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * FontSize Extension - 字号扩展
- * @description 自定义字号扩展
- */
-import { Extension } from '@tiptap/core';
-/**
- * FontSize 扩展
- */
-export declare const FontSize: Extension;
-//# sourceMappingURL=fontSize.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/fontSize.d.ts.map b/src/extensions/fontSize.d.ts.map
deleted file mode 100644
index 4bfc544..0000000
--- a/src/extensions/fontSize.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"fontSize.d.ts","sourceRoot":"","sources":["fontSize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,QAAQ,qBA6CnB,CAAA"}
\ No newline at end of file
diff --git a/src/extensions/formatPainter.d.ts b/src/extensions/formatPainter.d.ts
deleted file mode 100644
index f517da2..0000000
--- a/src/extensions/formatPainter.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Format Painter Extension
- * TODO: Copy from source and decouple
- */
-import { Extension } from '@tiptap/core';
-export declare const FormatPainter: Extension;
-//# sourceMappingURL=formatPainter.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/formatPainter.d.ts.map b/src/extensions/formatPainter.d.ts.map
deleted file mode 100644
index 5d874a8..0000000
--- a/src/extensions/formatPainter.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"formatPainter.d.ts","sourceRoot":"","sources":["formatPainter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,aAAa,qBAGxB,CAAA"}
\ No newline at end of file
diff --git a/src/extensions/index.d.ts b/src/extensions/index.d.ts
deleted file mode 100644
index 174220c..0000000
--- a/src/extensions/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Extensions - 扩展统一导出
- * @description 编辑器扩展的统一导出入口
- */
-export { getExtensionsByVersion, getBasicExtensions } from './coreExtensions';
-export type { EditorVersion } from './coreExtensions';
-export * from './pageConstants';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/index.d.ts.map b/src/extensions/index.d.ts.map
deleted file mode 100644
index 51a6cf2..0000000
--- a/src/extensions/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,cAAc,iBAAiB,CAAA"}
\ No newline at end of file
diff --git a/src/extensions/lineHeight.d.ts b/src/extensions/lineHeight.d.ts
deleted file mode 100644
index 70dfd90..0000000
--- a/src/extensions/lineHeight.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * LineHeight Extension - 行间距扩展
- * @description 自定义行间距扩展
- */
-import { Extension } from '@tiptap/core';
-export interface LineHeightOptions {
- types: string[];
- defaultLineHeight: string;
-}
-export declare const LineHeight: Extension;
-//# sourceMappingURL=lineHeight.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/lineHeight.d.ts.map b/src/extensions/lineHeight.d.ts.map
deleted file mode 100644
index c9504e7..0000000
--- a/src/extensions/lineHeight.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"lineHeight.d.ts","sourceRoot":"","sources":["lineHeight.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,UAAU,mCA8CrB,CAAA"}
\ No newline at end of file
diff --git a/src/extensions/listShortcuts.d.ts b/src/extensions/listShortcuts.d.ts
deleted file mode 100644
index 4a938c5..0000000
--- a/src/extensions/listShortcuts.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * ListShortcuts Extension - 列表快捷键扩展
- * @description 提供列表相关的快捷键支持
- */
-import { Extension } from '@tiptap/core';
-export declare const ListShortcuts: Extension;
-//# sourceMappingURL=listShortcuts.d.ts.map
\ No newline at end of file
diff --git a/src/extensions/listShortcuts.d.ts.map b/src/extensions/listShortcuts.d.ts.map
deleted file mode 100644
index e437029..0000000
--- a/src/extensions/listShortcuts.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"listShortcuts.d.ts","sourceRoot":"","sources":["listShortcuts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,aAAa,qBA4BxB,CAAA"}
\ No newline at end of file
diff --git a/src/extensions/math/MathNodeView.vue b/src/extensions/math/MathNodeView.vue
index 1b88b3a..35f4f10 100644
--- a/src/extensions/math/MathNodeView.vue
+++ b/src/extensions/math/MathNodeView.vue
@@ -41,12 +41,28 @@
diff --git a/src/features/advanced/font/FontFamilySelect.vue.d.ts b/src/features/advanced/font/FontFamilySelect.vue.d.ts
deleted file mode 100644
index 8add111..0000000
--- a/src/features/advanced/font/FontFamilySelect.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=FontFamilySelect.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/font/FontFamilySelect.vue.d.ts.map b/src/features/advanced/font/FontFamilySelect.vue.d.ts.map
deleted file mode 100644
index ad861c2..0000000
--- a/src/features/advanced/font/FontFamilySelect.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"FontFamilySelect.vue.d.ts","sourceRoot":"","sources":["FontFamilySelect.vue"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAM3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AAiID,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/font/FontSizeSelect.vue b/src/features/advanced/font/FontSizeSelect.vue
index 236918c..33a0c03 100644
--- a/src/features/advanced/font/FontSizeSelect.vue
+++ b/src/features/advanced/font/FontSizeSelect.vue
@@ -17,9 +17,10 @@
* FontSizeSelect - 字号选择器组件
* @description 可复用的字号选择器组件,支持选择字号大小
*/
-import { computed, ref, watch } from 'vue'
+import { ref, watch } from 'vue'
import type { Editor } from '@tiptap/vue-3'
import { createCommandRunner, executeBatchCommands } from '@/utils/editorCommands'
+import { useReactiveEditor } from '@/utils/editorState'
import { t } from '@/locales'
import { FONT_SIZES, DEFAULT_VALUES } from '@/configs/editorConstants'
@@ -29,7 +30,8 @@ interface Props {
}
const props = defineProps()
-const editor = computed(() => props.editor ?? null)
+// 事务响应式 editor:当前字号跟随光标/内容变化重新求值
+const editor = useReactiveEditor(() => props.editor)
// ===== 工具函数 =====
const runCommand = createCommandRunner(editor)
diff --git a/src/features/advanced/font/FontSizeSelect.vue.d.ts b/src/features/advanced/font/FontSizeSelect.vue.d.ts
deleted file mode 100644
index 1eefc5e..0000000
--- a/src/features/advanced/font/FontSizeSelect.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=FontSizeSelect.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/font/FontSizeSelect.vue.d.ts.map b/src/features/advanced/font/FontSizeSelect.vue.d.ts.map
deleted file mode 100644
index 91f5fd6..0000000
--- a/src/features/advanced/font/FontSizeSelect.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"FontSizeSelect.vue.d.ts","sourceRoot":"","sources":["FontSizeSelect.vue"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAM3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AAiID,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/font/README.md b/src/features/advanced/font/README.md
index 593defb..d126cda 100644
--- a/src/features/advanced/font/README.md
+++ b/src/features/advanced/font/README.md
@@ -71,14 +71,14 @@ import {
DEFAULT_VALUES,
} from '#/components/tiptapPro-tenant/advanced/font'
-// 获取所有字体选项
-console.log(FONT_FAMILIES) // [{ label: 'PMingLiU', value: 'PMingLiU' }, ...]
+// 获取所有字体选项(首项为空值 = 不指定字体,跟随主题默认)
+console.log(FONT_FAMILIES) // [{ label: 'Default', value: '' }, { label: 'Arial', value: 'Arial' }, ...]
// 获取所有字号选项
console.log(FONT_SIZES) // [{ label: '12', value: '12px' }, ...]
-// 获取默认值
-console.log(DEFAULT_VALUES) // { fontFamily: 'PMingLiU', fontSize: '16px', lineHeight: '1.5', ... }
+// 获取默认值(fontFamily 为空字符串 = 跟随主题默认,不写入 style)
+console.log(DEFAULT_VALUES) // { fontFamily: '', fontSize: '16px', lineHeight: '1.5', ... }
```
> **注意**:常量定义已统一迁移到 `shared/configs/editorConstants.ts`,此处为重新导出。
diff --git a/src/features/advanced/font/index.d.ts b/src/features/advanced/font/index.d.ts
deleted file mode 100644
index 7fbabdf..0000000
--- a/src/features/advanced/font/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Font - 字体功能模块
- * @description 提供字体、字号、行高等字体相关功能
- */
-export { default as FontFamilySelect } from './FontFamilySelect.vue';
-export { default as FontSizeSelect } from './FontSizeSelect.vue';
-export { FontSize } from '@/extensions/fontSize';
-export { LineHeight } from '@/extensions/lineHeight';
-export { FONT_FAMILIES, FONT_SIZES, LINE_HEIGHTS, DEFAULT_VALUES, } from '@/configs/editorConstants';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/font/index.d.ts.map b/src/features/advanced/font/index.d.ts.map
deleted file mode 100644
index 96cf541..0000000
--- a/src/features/advanced/font/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGhE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGpD,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,GACf,MAAM,2BAA2B,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts b/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts
deleted file mode 100644
index 63fd344..0000000
--- a/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=ClearFormatButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts.map b/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts.map
deleted file mode 100644
index 1122a56..0000000
--- a/src/features/advanced/format-clear/ClearFormatButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ClearFormatButton.vue.d.ts","sourceRoot":"","sources":["ClearFormatButton.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAO3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AA8ED,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/format-clear/index.d.ts b/src/features/advanced/format-clear/index.d.ts
deleted file mode 100644
index 9a9ff7c..0000000
--- a/src/features/advanced/format-clear/index.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Format Clear - 格式清除功能模块
- * @description 提供清除格式功能
- */
-export { default as ClearFormatButton } from './ClearFormatButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/format-clear/index.d.ts.map b/src/features/advanced/format-clear/index.d.ts.map
deleted file mode 100644
index ebd1430..0000000
--- a/src/features/advanced/format-clear/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts b/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts
deleted file mode 100644
index 1f56749..0000000
--- a/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
- /** 外部传入的禁用状态(优先级高于内部协作检测) */
- disabled?: boolean;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {
- disabled: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=FormatPainterButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts.map b/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts.map
deleted file mode 100644
index 0420240..0000000
--- a/src/features/advanced/format-painter/FormatPainterButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"FormatPainterButton.vue.d.ts","sourceRoot":"","sources":["FormatPainterButton.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAQ3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;;cADY,OAAO;;AA6PpB,wBAOG"}
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/formatPainter.d.ts b/src/features/advanced/format-painter/formatPainter.d.ts
deleted file mode 100644
index cc4e622..0000000
--- a/src/features/advanced/format-painter/formatPainter.d.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * FormatPainter Extension - 格式刷
- * @description 采样当前选区样式并应用到目标选区
- */
-import { Extension } from '@tiptap/core';
-import type { Editor } from '@tiptap/core';
-declare module '@tiptap/core' {
- interface Commands {
- formatPainter: {
- /**
- * 开启格式刷并采样当前选区样式
- * @param mode - 模式:1 为单次模式(默认),2 为连续模式
- */
- startFormatPainting: (mode?: 1 | 2) => ReturnType;
- /** 开启格式刷连续应用模式 */
- startContinuousFormatPainting: () => ReturnType;
- /** 将采样到的样式应用到当前选区 */
- applyFormat: () => ReturnType;
- /** 取消格式刷状态并清除缓存 */
- cancelFormatPainting: () => ReturnType;
- /** 切换连续应用模式 */
- toggleContinuousMode: () => ReturnType;
- };
- }
-}
-export interface FormatPainterStorage {
- /** 格式刷是否激活 */
- isActive: boolean;
- /** 是否为连续应用模式 */
- isContinuous: boolean;
- /** 采样的格式 */
- formats: {
- bold?: boolean;
- italic?: boolean;
- underline?: boolean;
- strike?: boolean;
- subscript?: boolean;
- superscript?: boolean;
- color?: string | null;
- highlight?: string | null;
- fontFamily?: string | null;
- fontSize?: string | null;
- textAlign?: 'left' | 'center' | 'right' | 'justify' | null;
- lineHeight?: string | null;
- };
-}
-export type FormatPainterFormats = FormatPainterStorage['formats'];
-/**
- * 采样当前选区的格式样式
- * @param editor - Tiptap 编辑器实例
- * @returns 格式对象,如果采样失败则返回 null
- * @description 从编辑器中提取当前选区的所有格式信息,包括文本样式、颜色、对齐等
- */
-export declare function sampleFormats(editor: Editor): FormatPainterFormats | null;
-export declare const FormatPainter: Extension<{}, FormatPainterStorage>;
-//# sourceMappingURL=formatPainter.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/formatPainter.d.ts.map b/src/features/advanced/format-painter/formatPainter.d.ts.map
deleted file mode 100644
index 24b9916..0000000
--- a/src/features/advanced/format-painter/formatPainter.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"formatPainter.d.ts","sourceRoot":"","sources":["formatPainter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAI1C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,aAAa,EAAE;YACb;;;eAGG;YACH,mBAAmB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,UAAU,CAAA;YACjD,kBAAkB;YAClB,6BAA6B,EAAE,MAAM,UAAU,CAAA;YAC/C,qBAAqB;YACrB,WAAW,EAAE,MAAM,UAAU,CAAA;YAC7B,mBAAmB;YACnB,oBAAoB,EAAE,MAAM,UAAU,CAAA;YACtC,eAAe;YACf,oBAAoB,EAAE,MAAM,UAAU,CAAA;SACvC,CAAA;KACF;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY;IACZ,OAAO,EAAE;QACP,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAA;QAC1D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAC3B,CAAA;CACF;AAKD,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAA;AAElE;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAyCzE;AAiFD,eAAO,MAAM,aAAa,qCAmSxB,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/index.d.ts b/src/features/advanced/format-painter/index.d.ts
deleted file mode 100644
index d2e58fe..0000000
--- a/src/features/advanced/format-painter/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Format Painter - 格式刷功能模块
- * @description 提供格式采样和应用功能,支持单次和连续应用模式
- */
-export { FormatPainter, sampleFormats } from './formatPainter';
-export type { FormatPainterStorage, FormatPainterFormats } from './formatPainter';
-export { default as FormatPainterButton } from './FormatPainterButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/format-painter/index.d.ts.map b/src/features/advanced/format-painter/index.d.ts.map
deleted file mode 100644
index 5fdc002..0000000
--- a/src/features/advanced/format-painter/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC9D,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAGjF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/gallery/GalleryButton.vue b/src/features/advanced/gallery/GalleryButton.vue
index 5e18749..31753b0 100644
--- a/src/features/advanced/gallery/GalleryButton.vue
+++ b/src/features/advanced/gallery/GalleryButton.vue
@@ -184,7 +184,7 @@ function insertSelected() {
color: #d9d9d9;
}
-:where(.dark, .dark *) .gallery-empty__icon {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .gallery-empty__icon {
color: #434343;
}
@@ -194,7 +194,7 @@ function insertSelected() {
color: #595959;
}
-:where(.dark, .dark *) .gallery-empty__text {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .gallery-empty__text {
color: #a0a0a0;
}
@@ -230,7 +230,7 @@ function insertSelected() {
background: #f5f5f5;
}
-:where(.dark, .dark *) .gallery-item {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .gallery-item {
background: #2a2a2a;
}
@@ -259,7 +259,7 @@ function insertSelected() {
line-height: 1;
}
-:where(.dark, .dark *) .gallery-item__check {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .gallery-item__check {
color: #4fc3f7;
background: #1a1a1a;
}
@@ -274,7 +274,7 @@ function insertSelected() {
border-top: 1px solid #f0f0f0;
}
-:where(.dark, .dark *) .gallery-footer {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .gallery-footer {
border-top-color: #434343;
}
diff --git a/src/features/advanced/link/LinkButton.vue b/src/features/advanced/link/LinkButton.vue
index 2e8fc56..a59b439 100644
--- a/src/features/advanced/link/LinkButton.vue
+++ b/src/features/advanced/link/LinkButton.vue
@@ -28,11 +28,11 @@
* LinkButton - 链接按钮
* @description 可复用的链接按钮组件,包含链接插入/编辑功能
*/
-import { computed, ref } from 'vue'
+import { ref } from 'vue'
import type { Editor } from '@tiptap/vue-3'
import { ToolbarButton, ToolbarGroup } from '@/ui'
import { createCommandRunner } from '@/utils/editorCommands'
-import { createStateCheckers } from '@/utils/editorState'
+import { createStateCheckers, useReactiveEditor } from '@/utils/editorState'
import { t } from '@/locales'
import { LinkOutlined } from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
@@ -43,7 +43,7 @@ interface Props {
}
const props = defineProps()
-const editor = computed(() => props.editor ?? null)
+const editor = useReactiveEditor(() => props.editor)
// ===== 响应式状态 =====
const linkModalOpen = ref(false)
diff --git a/src/features/advanced/link/LinkButton.vue.d.ts b/src/features/advanced/link/LinkButton.vue.d.ts
deleted file mode 100644
index dafdd5e..0000000
--- a/src/features/advanced/link/LinkButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=LinkButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/link/LinkButton.vue.d.ts.map b/src/features/advanced/link/LinkButton.vue.d.ts.map
deleted file mode 100644
index cf7aefe..0000000
--- a/src/features/advanced/link/LinkButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"LinkButton.vue.d.ts","sourceRoot":"","sources":["LinkButton.vue"],"names":[],"mappings":"AAmJA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAS3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AA4MD,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/link/index.d.ts b/src/features/advanced/link/index.d.ts
deleted file mode 100644
index 829d336..0000000
--- a/src/features/advanced/link/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Link - 链接功能模块
- * @description 提供链接工具栏按钮功能
- * @description 链接悬浮框功能已移至 tools/link-bubble,可通过 features.linkBubbleMenu 配置是否启用
- */
-export { default as LinkButton } from './LinkButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/link/index.d.ts.map b/src/features/advanced/link/index.d.ts.map
deleted file mode 100644
index beb0e16..0000000
--- a/src/features/advanced/link/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue b/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue
index e4ce488..7432774 100644
--- a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue
+++ b/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue
@@ -19,7 +19,7 @@
import { computed } from 'vue'
import type { Editor } from '@tiptap/vue-3'
import { ToolbarButton, ToolbarGroup } from '@/ui'
-import { createStateCheckers } from '@/utils/editorState'
+import { createStateCheckers, useReactiveEditor } from '@/utils/editorState'
import { t } from '@/locales'
import { SortAscendingOutlined, SortDescendingOutlined } from '@ant-design/icons-vue'
@@ -29,7 +29,7 @@ interface Props {
}
const props = defineProps()
-const editor = computed(() => props.editor ?? null)
+const editor = useReactiveEditor(() => props.editor)
// ===== 工具函数 =====
const { isActive } = createStateCheckers(editor)
diff --git a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts b/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts
deleted file mode 100644
index 6a4eda8..0000000
--- a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=SubscriptSuperscriptButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts.map b/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts.map
deleted file mode 100644
index 548304b..0000000
--- a/src/features/advanced/subscript-superscript/SubscriptSuperscriptButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"SubscriptSuperscriptButton.vue.d.ts","sourceRoot":"","sources":["SubscriptSuperscriptButton.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAO3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AAmGD,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/subscript-superscript/index.d.ts b/src/features/advanced/subscript-superscript/index.d.ts
deleted file mode 100644
index ffe2b9d..0000000
--- a/src/features/advanced/subscript-superscript/index.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Subscript Superscript - 上标下标功能模块
- * @description 提供上标和下标工具栏按钮功能
- */
-export { default as SubscriptSuperscriptButton } from './SubscriptSuperscriptButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/subscript-superscript/index.d.ts.map b/src/features/advanced/subscript-superscript/index.d.ts.map
deleted file mode 100644
index a6475e5..0000000
--- a/src/features/advanced/subscript-superscript/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kCAAkC,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/table/TableButton.vue b/src/features/advanced/table/TableButton.vue
index 8f07d80..af02e87 100644
--- a/src/features/advanced/table/TableButton.vue
+++ b/src/features/advanced/table/TableButton.vue
@@ -91,12 +91,12 @@
* TableButton - 表格按钮组件
* @description 提供表格插入面板,支持自定义行列与表头,以及删除表格功能
*/
-import { computed, ref } from 'vue'
+import { ref } from 'vue'
import { Popover } from 'ant-design-vue'
import type { Editor } from '@tiptap/vue-3'
import { ToolbarGroup, ToolbarButton } from '@/ui'
import { createCommandRunner } from '@/utils/editorCommands'
-import { createStateCheckers } from '@/utils/editorState'
+import { createStateCheckers, useReactiveEditor } from '@/utils/editorState'
import { t } from '@/locales'
import {
TableOutlined,
@@ -116,7 +116,7 @@ interface Props {
}
const props = defineProps()
-const editor = computed(() => props.editor ?? null)
+const editor = useReactiveEditor(() => props.editor)
// ===== 工具函数 =====
const runCommand = createCommandRunner(editor)
@@ -265,7 +265,7 @@ function deleteTable() {
border-radius: 6px;
}
-:where(.dark, .dark *) .grid {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .grid {
background: #262626;
border-color: #434343;
}
@@ -286,7 +286,7 @@ function deleteTable() {
transition: all 0.15s;
}
-:where(.dark, .dark *) .grid-cell {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .grid-cell {
border-color: #434343;
background: #1f1f1f;
}
@@ -295,7 +295,7 @@ function deleteTable() {
border-color: #40a9ff;
}
-:where(.dark, .dark *) .grid-cell:hover {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .grid-cell:hover {
border-color: #4fc3f7;
}
@@ -304,7 +304,7 @@ function deleteTable() {
border-color: #91caff;
}
-:where(.dark, .dark *) .grid-cell.active {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .grid-cell.active {
background: #1a4d6e;
border-color: #4fc3f7;
}
@@ -328,7 +328,7 @@ function deleteTable() {
border-radius: 6px;
margin-bottom: 8px;
- :where(.dark, .dark *) & {
+ :where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) & {
background: #262626;
border-color: #434343;
}
@@ -352,7 +352,7 @@ function deleteTable() {
padding: 0 4px;
border-right: 1px solid #e8e8e8;
- :where(.dark, .dark *) & {
+ :where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) & {
border-right-color: #434343;
}
}
@@ -375,7 +375,7 @@ function deleteTable() {
border-radius: 4px;
transition: all 0.2s;
- :where(.dark, .dark *) & {
+ :where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) & {
color: #f0f0f0;
}
}
@@ -383,7 +383,7 @@ function deleteTable() {
.table-menu-btn:hover:not(:disabled) {
background: #f5f5f5;
- :where(.dark, .dark *) & {
+ :where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) & {
background: #303030;
}
}
diff --git a/src/features/advanced/table/TableButton.vue.d.ts b/src/features/advanced/table/TableButton.vue.d.ts
deleted file mode 100644
index 7006373..0000000
--- a/src/features/advanced/table/TableButton.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=TableButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/table/TableButton.vue.d.ts.map b/src/features/advanced/table/TableButton.vue.d.ts.map
deleted file mode 100644
index 73ff7c3..0000000
--- a/src/features/advanced/table/TableButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TableButton.vue.d.ts","sourceRoot":"","sources":["TableButton.vue"],"names":[],"mappings":"AAoZA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAkB3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AAwZD,wBAMG"}
\ No newline at end of file
diff --git a/src/features/advanced/table/TableCell.vue.d.ts b/src/features/advanced/table/TableCell.vue.d.ts
deleted file mode 100644
index ad899fe..0000000
--- a/src/features/advanced/table/TableCell.vue.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
-export default _default;
-//# sourceMappingURL=TableCell.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/table/TableCell.vue.d.ts.map b/src/features/advanced/table/TableCell.vue.d.ts.map
deleted file mode 100644
index eba6282..0000000
--- a/src/features/advanced/table/TableCell.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TableCell.vue.d.ts","sourceRoot":"","sources":["TableCell.vue"],"names":[],"mappings":";AA0CA,wBAKG"}
\ No newline at end of file
diff --git a/src/features/advanced/table/TableCellWithBackground.d.ts b/src/features/advanced/table/TableCellWithBackground.d.ts
deleted file mode 100644
index 6b0ce7c..0000000
--- a/src/features/advanced/table/TableCellWithBackground.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * 自定义 TableCell 扩展,支持 backgroundColor 属性
- * 用于表格悬浮框中的背景色设置功能
- */
-export declare const TableCellWithBackground: import("@tiptap/core").Node;
-//# sourceMappingURL=TableCellWithBackground.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/table/TableCellWithBackground.d.ts.map b/src/features/advanced/table/TableCellWithBackground.d.ts.map
deleted file mode 100644
index d8cd28e..0000000
--- a/src/features/advanced/table/TableCellWithBackground.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"TableCellWithBackground.d.ts","sourceRoot":"","sources":["TableCellWithBackground.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,sFAmClC,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/table/index.d.ts b/src/features/advanced/table/index.d.ts
deleted file mode 100644
index 60c0a32..0000000
--- a/src/features/advanced/table/index.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Table Feature Module
- * @description 表格功能模块统一导出
- * @deprecated TableToolbar 已迁移到 tools/table-toolbar,请使用新路径导入
- */
-export { default as TableButton } from './TableButton.vue';
-export { TableToolbar } from '@/tools/table-toolbar';
-export { TableCellWithBackground } from './TableCellWithBackground';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/table/index.d.ts.map b/src/features/advanced/table/index.d.ts.map
deleted file mode 100644
index 0194799..0000000
--- a/src/features/advanced/table/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/template/TemplateButton.vue b/src/features/advanced/template/TemplateButton.vue
index f69f2e7..3c7fb93 100644
--- a/src/features/advanced/template/TemplateButton.vue
+++ b/src/features/advanced/template/TemplateButton.vue
@@ -105,11 +105,11 @@ function insertTemplate(tpl: TemplateItem) {
background: #f0f5ff;
}
-:where(.dark, .dark *) .template-card {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .template-card {
border-color: #434343;
}
-:where(.dark, .dark *) .template-card:hover {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .template-card:hover {
border-color: #4fc3f7;
background: #1a3a4d;
}
@@ -127,7 +127,7 @@ function insertTemplate(tpl: TemplateItem) {
border-radius: 8px;
}
-:where(.dark, .dark *) .template-card__icon {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .template-card__icon {
color: #4fc3f7;
background: #1a4d6e;
}
@@ -144,7 +144,7 @@ function insertTemplate(tpl: TemplateItem) {
margin-bottom: 4px;
}
-:where(.dark, .dark *) .template-card__name {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .template-card__name {
color: #e0e0e0;
}
@@ -154,7 +154,7 @@ function insertTemplate(tpl: TemplateItem) {
line-height: 1.4;
}
-:where(.dark, .dark *) .template-card__desc {
+:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) .template-card__desc {
color: #8c8c8c;
}
diff --git a/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts b/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts
deleted file mode 100644
index 58a6aad..0000000
--- a/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
- /** 是否禁用按钮(协作模式下需要禁用) */
- disabled?: boolean;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {
- disabled: boolean;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=UndoRedoButton.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts.map b/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts.map
deleted file mode 100644
index 2c1006a..0000000
--- a/src/features/advanced/undo-redo/UndoRedoButton.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"UndoRedoButton.vue.d.ts","sourceRoot":"","sources":["UndoRedoButton.vue"],"names":[],"mappings":"AAmLA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAO3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;;cADY,OAAO;;AAuOpB,wBAOG"}
\ No newline at end of file
diff --git a/src/features/advanced/undo-redo/index.d.ts b/src/features/advanced/undo-redo/index.d.ts
deleted file mode 100644
index 2e67d34..0000000
--- a/src/features/advanced/undo-redo/index.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Undo Redo - 撤销/重做功能模块
- * @description 提供撤销和重做工具栏按钮功能
- */
-export { default as UndoRedoButton } from './UndoRedoButton.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/undo-redo/index.d.ts.map b/src/features/advanced/undo-redo/index.d.ts.map
deleted file mode 100644
index f3eabd4..0000000
--- a/src/features/advanced/undo-redo/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
\ No newline at end of file
diff --git a/src/features/advanced/word/wordExport.ts b/src/features/advanced/word/wordExport.ts
index 9e44385..7cda6cc 100644
--- a/src/features/advanced/word/wordExport.ts
+++ b/src/features/advanced/word/wordExport.ts
@@ -1,40 +1,15 @@
/**
* Word 导出工具
* @description 将编辑器 HTML 内容导出为 .docx 文件
+ * @note docx 与 file-saver 为按需动态加载,仅在实际执行导出时下载
*/
-import {
- Document,
- Paragraph,
- TextRun,
- HeadingLevel,
- AlignmentType,
- Table,
- TableRow,
- TableCell,
- WidthType,
- Packer,
- ExternalHyperlink,
- type ITableCellOptions,
+import type {
+ Paragraph as ParagraphType,
+ Table as TableType,
+ TextRun as TextRunType,
+ ExternalHyperlink as ExternalHyperlinkType,
+ ITableCellOptions,
} from 'docx'
-import { saveAs } from 'file-saver'
-
-/** 标题级别映射 */
-const HEADING_MAP: Record = {
- H1: HeadingLevel.HEADING_1,
- H2: HeadingLevel.HEADING_2,
- H3: HeadingLevel.HEADING_3,
- H4: HeadingLevel.HEADING_4,
- H5: HeadingLevel.HEADING_5,
- H6: HeadingLevel.HEADING_6,
-}
-
-/** 对齐方式映射 */
-const ALIGN_MAP: Record = {
- left: AlignmentType.LEFT,
- center: AlignmentType.CENTER,
- right: AlignmentType.RIGHT,
- justify: AlignmentType.JUSTIFIED,
-}
/** 内联文本样式上下文 */
interface InlineStyle {
@@ -59,315 +34,355 @@ const defaultInlineStyle: InlineStyle = {
subscript: false,
}
-/**
- * 从 HTML 元素中解析对齐方式
- */
-function getAlignment(el: Element): (typeof AlignmentType)[keyof typeof AlignmentType] | undefined {
- const style = (el as HTMLElement).style?.textAlign
- if (style && ALIGN_MAP[style]) return ALIGN_MAP[style]
- return undefined
-}
-
-/**
- * 将内联节点转换为 TextRun 数组
- */
-function parseInlineNodes(node: Node, style: InlineStyle): (TextRun | ExternalHyperlink)[] {
- const runs: (TextRun | ExternalHyperlink)[] = []
-
- if (node.nodeType === Node.TEXT_NODE) {
- const text = node.textContent || ''
- if (!text) return runs
-
- const run = new TextRun({
- text,
- bold: style.bold || undefined,
- italics: style.italic || undefined,
- underline: style.underline ? {} : undefined,
- strike: style.strike || undefined,
- font: style.code ? { name: 'Courier New' } : undefined,
- superScript: style.superscript || undefined,
- subScript: style.subscript || undefined,
- })
-
- if (style.link) {
- runs.push(
- new ExternalHyperlink({
- children: [
- new TextRun({
- text,
- bold: style.bold || undefined,
- italics: style.italic || undefined,
- underline: {},
- style: 'Hyperlink',
- }),
- ],
- link: style.link,
- }),
- )
- } else {
- runs.push(run)
- }
-
- return runs
- }
-
- if (node.nodeType !== Node.ELEMENT_NODE) return runs
-
- const el = node as Element
- const tag = el.tagName.toUpperCase()
-
- // 根据标签更新样式
- const newStyle = { ...style }
- if (tag === 'STRONG' || tag === 'B') newStyle.bold = true
- if (tag === 'EM' || tag === 'I') newStyle.italic = true
- if (tag === 'U') newStyle.underline = true
- if (tag === 'S' || tag === 'DEL' || tag === 'STRIKE') newStyle.strike = true
- if (tag === 'CODE') newStyle.code = true
- if (tag === 'SUP') newStyle.superscript = true
- if (tag === 'SUB') newStyle.subscript = true
- if (tag === 'A') newStyle.link = el.getAttribute('href')
-
- // BR 标签处理为换行
- if (tag === 'BR') {
- runs.push(new TextRun({ break: 1 }))
- return runs
- }
-
- for (const child of Array.from(el.childNodes)) {
- runs.push(...parseInlineNodes(child, newStyle))
- }
-
- return runs
-}
-
-/**
- * 将 元素转为段落
- */
-function parseListItem(
- li: Element,
- ordered: boolean,
- level: number,
-): Paragraph[] {
- const paragraphs: Paragraph[] = []
- const runs = parseInlineNodes(li, { ...defaultInlineStyle })
- // 过滤出 TextRun(排除嵌套列表生成的段落)
- const textRuns = runs.filter((r): r is TextRun => r instanceof TextRun || r instanceof ExternalHyperlink)
-
- if (textRuns.length > 0) {
- paragraphs.push(
- new Paragraph({
- children: textRuns,
- numbering: ordered
- ? { reference: 'ordered-list', level }
- : { reference: 'bullet-list', level },
- }),
- )
- }
-
- // 处理嵌套列表
- for (const child of Array.from(li.children)) {
- const childTag = child.tagName.toUpperCase()
- if (childTag === 'UL') {
- paragraphs.push(...parseList(child, false, level + 1))
- } else if (childTag === 'OL') {
- paragraphs.push(...parseList(child, true, level + 1))
- }
- }
-
- return paragraphs
-}
-
-/**
- * 将 / 元素转为段落数组
- */
-function parseList(list: Element, ordered: boolean, level = 0): Paragraph[] {
- const paragraphs: Paragraph[] = []
- for (const li of Array.from(list.children)) {
- if (li.tagName.toUpperCase() === 'LI') {
- paragraphs.push(...parseListItem(li, ordered, level))
- }
- }
- return paragraphs
-}
-
-/**
- * 将表格 HTML 转换为 docx Table
- */
-function parseTable(tableEl: Element): Table {
- const rows: TableRow[] = []
-
- const trElements = tableEl.querySelectorAll('tr')
- for (const tr of Array.from(trElements)) {
- const cells: TableCell[] = []
- const tdElements = tr.querySelectorAll('td, th')
- for (const td of Array.from(tdElements)) {
- const cellOpts: ITableCellOptions = {
- children: [
- new Paragraph({
- children: parseInlineNodes(td, { ...defaultInlineStyle }) as TextRun[],
- }),
- ],
- width: { size: 100, type: WidthType.AUTO },
- }
- cells.push(new TableCell(cellOpts))
- }
- if (cells.length > 0) {
- rows.push(new TableRow({ children: cells }))
- }
- }
-
- return new Table({
- rows,
- width: { size: 100, type: WidthType.PERCENTAGE },
- })
-}
-
-/**
- * 将代码块转为段落
- */
-function parseCodeBlock(pre: Element): Paragraph[] {
- const code = pre.querySelector('code') || pre
- const text = code.textContent || ''
- const lines = text.split('\n')
-
- return lines.map(
- (line) =>
- new Paragraph({
- children: [
- new TextRun({
- text: line || ' ',
- font: { name: 'Courier New' },
- size: 20,
- }),
- ],
- spacing: { before: 0, after: 0 },
- }),
- )
-}
-
-/**
- * 解析块级 HTML 节点为 docx 元素
- */
-function parseBlockNodes(container: Element): (Paragraph | Table)[] {
- const elements: (Paragraph | Table)[] = []
-
- for (const node of Array.from(container.childNodes)) {
- if (node.nodeType === Node.TEXT_NODE) {
- const text = node.textContent?.trim()
- if (text) {
- elements.push(new Paragraph({ children: [new TextRun({ text })] }))
- }
- continue
- }
-
- if (node.nodeType !== Node.ELEMENT_NODE) continue
-
- const el = node as Element
- const tag = el.tagName.toUpperCase()
-
- // 标题
- if (HEADING_MAP[tag]) {
- const runs = parseInlineNodes(el, { ...defaultInlineStyle })
- elements.push(
- new Paragraph({
- heading: HEADING_MAP[tag],
- children: runs as TextRun[],
- alignment: getAlignment(el),
- }),
- )
- continue
- }
-
- // 段落
- if (tag === 'P') {
- const runs = parseInlineNodes(el, { ...defaultInlineStyle })
- if (runs.length > 0) {
- elements.push(
- new Paragraph({
- children: runs as TextRun[],
- alignment: getAlignment(el),
- }),
- )
- } else {
- elements.push(new Paragraph({}))
- }
- continue
- }
-
- // 列表
- if (tag === 'UL') {
- elements.push(...parseList(el, false))
- continue
- }
- if (tag === 'OL') {
- elements.push(...parseList(el, true))
- continue
- }
-
- // 代码块
- if (tag === 'PRE') {
- elements.push(...parseCodeBlock(el))
- continue
- }
-
- // 表格
- if (tag === 'TABLE') {
- elements.push(parseTable(el))
- continue
- }
-
- // 引用块
- if (tag === 'BLOCKQUOTE') {
- const innerElements = parseBlockNodes(el)
- for (const inner of innerElements) {
- if (inner instanceof Paragraph) {
- elements.push(
- new Paragraph({
- ...((inner as any).options || {}),
- indent: { left: 720 },
- border: {
- left: { style: 'single' as any, size: 6, color: '999999' },
- },
- }),
- )
- } else {
- elements.push(inner)
- }
- }
- continue
- }
-
- // 分隔线
- if (tag === 'HR') {
- elements.push(
- new Paragraph({
- children: [new TextRun({ text: '─'.repeat(50) })],
- alignment: AlignmentType.CENTER,
- }),
- )
- continue
- }
-
- // DIV 或其他容器 → 递归
- if (el.children.length > 0) {
- elements.push(...parseBlockNodes(el))
- } else {
- const text = el.textContent?.trim()
- if (text) {
- elements.push(new Paragraph({ children: [new TextRun({ text })] }))
- }
- }
- }
-
- return elements
-}
-
/**
* 将编辑器 HTML 导出为 .docx 文件并下载
* @param html - 编辑器 HTML 内容
* @param filename - 文件名(不含扩展名)
*/
export async function exportToWord(html: string, filename = 'document'): Promise {
+ // 动态加载 docx 与 file-saver(file-saver 为 CJS 包,做 default/命名空间兼容处理)
+ const [docx, fileSaverModule] = await Promise.all([
+ import('docx'),
+ import('file-saver') as Promise,
+ ])
+ const saveAs: (blob: Blob, name: string) => void =
+ fileSaverModule.saveAs ?? fileSaverModule.default?.saveAs ?? fileSaverModule.default
+
+ const {
+ Document,
+ Paragraph,
+ TextRun,
+ HeadingLevel,
+ AlignmentType,
+ Table,
+ TableRow,
+ TableCell,
+ WidthType,
+ Packer,
+ ExternalHyperlink,
+ } = docx
+
+ /** 标题级别映射 */
+ const HEADING_MAP: Record = {
+ H1: HeadingLevel.HEADING_1,
+ H2: HeadingLevel.HEADING_2,
+ H3: HeadingLevel.HEADING_3,
+ H4: HeadingLevel.HEADING_4,
+ H5: HeadingLevel.HEADING_5,
+ H6: HeadingLevel.HEADING_6,
+ }
+
+ /** 对齐方式映射 */
+ const ALIGN_MAP: Record = {
+ left: AlignmentType.LEFT,
+ center: AlignmentType.CENTER,
+ right: AlignmentType.RIGHT,
+ justify: AlignmentType.JUSTIFIED,
+ }
+
+ /**
+ * 从 HTML 元素中解析对齐方式
+ */
+ function getAlignment(el: Element): (typeof AlignmentType)[keyof typeof AlignmentType] | undefined {
+ const style = (el as HTMLElement).style?.textAlign
+ if (style && ALIGN_MAP[style]) return ALIGN_MAP[style]
+ return undefined
+ }
+
+ /**
+ * 将内联节点转换为 TextRun 数组
+ */
+ function parseInlineNodes(node: Node, style: InlineStyle): (TextRunType | ExternalHyperlinkType)[] {
+ const runs: (TextRunType | ExternalHyperlinkType)[] = []
+
+ if (node.nodeType === Node.TEXT_NODE) {
+ const text = node.textContent || ''
+ if (!text) return runs
+
+ const run = new TextRun({
+ text,
+ bold: style.bold || undefined,
+ italics: style.italic || undefined,
+ underline: style.underline ? {} : undefined,
+ strike: style.strike || undefined,
+ font: style.code ? { name: 'Courier New' } : undefined,
+ superScript: style.superscript || undefined,
+ subScript: style.subscript || undefined,
+ })
+
+ if (style.link) {
+ runs.push(
+ new ExternalHyperlink({
+ children: [
+ new TextRun({
+ text,
+ bold: style.bold || undefined,
+ italics: style.italic || undefined,
+ underline: {},
+ style: 'Hyperlink',
+ }),
+ ],
+ link: style.link,
+ }),
+ )
+ } else {
+ runs.push(run)
+ }
+
+ return runs
+ }
+
+ if (node.nodeType !== Node.ELEMENT_NODE) return runs
+
+ const el = node as Element
+ const tag = el.tagName.toUpperCase()
+
+ // 根据标签更新样式
+ const newStyle = { ...style }
+ if (tag === 'STRONG' || tag === 'B') newStyle.bold = true
+ if (tag === 'EM' || tag === 'I') newStyle.italic = true
+ if (tag === 'U') newStyle.underline = true
+ if (tag === 'S' || tag === 'DEL' || tag === 'STRIKE') newStyle.strike = true
+ if (tag === 'CODE') newStyle.code = true
+ if (tag === 'SUP') newStyle.superscript = true
+ if (tag === 'SUB') newStyle.subscript = true
+ if (tag === 'A') newStyle.link = el.getAttribute('href')
+
+ // BR 标签处理为换行
+ if (tag === 'BR') {
+ runs.push(new TextRun({ break: 1 }))
+ return runs
+ }
+
+ for (const child of Array.from(el.childNodes)) {
+ runs.push(...parseInlineNodes(child, newStyle))
+ }
+
+ return runs
+ }
+
+ /**
+ * 将 元素转为段落
+ */
+ function parseListItem(
+ li: Element,
+ ordered: boolean,
+ level: number,
+ ): ParagraphType[] {
+ const paragraphs: ParagraphType[] = []
+ const runs = parseInlineNodes(li, { ...defaultInlineStyle })
+ // 过滤出 TextRun(排除嵌套列表生成的段落)
+ const textRuns = runs.filter((r): r is TextRunType => r instanceof TextRun || r instanceof ExternalHyperlink)
+
+ if (textRuns.length > 0) {
+ paragraphs.push(
+ new Paragraph({
+ children: textRuns,
+ numbering: ordered
+ ? { reference: 'ordered-list', level }
+ : { reference: 'bullet-list', level },
+ }),
+ )
+ }
+
+ // 处理嵌套列表
+ for (const child of Array.from(li.children)) {
+ const childTag = child.tagName.toUpperCase()
+ if (childTag === 'UL') {
+ paragraphs.push(...parseList(child, false, level + 1))
+ } else if (childTag === 'OL') {
+ paragraphs.push(...parseList(child, true, level + 1))
+ }
+ }
+
+ return paragraphs
+ }
+
+ /**
+ * 将 / 元素转为段落数组
+ */
+ function parseList(list: Element, ordered: boolean, level = 0): ParagraphType[] {
+ const paragraphs: ParagraphType[] = []
+ for (const li of Array.from(list.children)) {
+ if (li.tagName.toUpperCase() === 'LI') {
+ paragraphs.push(...parseListItem(li, ordered, level))
+ }
+ }
+ return paragraphs
+ }
+
+ /**
+ * 将表格 HTML 转换为 docx Table
+ */
+ function parseTable(tableEl: Element): TableType {
+ const rows: InstanceType[] = []
+
+ const trElements = tableEl.querySelectorAll('tr')
+ for (const tr of Array.from(trElements)) {
+ const cells: InstanceType[] = []
+ const tdElements = tr.querySelectorAll('td, th')
+ for (const td of Array.from(tdElements)) {
+ const cellOpts: ITableCellOptions = {
+ children: [
+ new Paragraph({
+ children: parseInlineNodes(td, { ...defaultInlineStyle }) as TextRunType[],
+ }),
+ ],
+ width: { size: 100, type: WidthType.AUTO },
+ }
+ cells.push(new TableCell(cellOpts))
+ }
+ if (cells.length > 0) {
+ rows.push(new TableRow({ children: cells }))
+ }
+ }
+
+ return new Table({
+ rows,
+ width: { size: 100, type: WidthType.PERCENTAGE },
+ })
+ }
+
+ /**
+ * 将代码块转为段落
+ */
+ function parseCodeBlock(pre: Element): ParagraphType[] {
+ const code = pre.querySelector('code') || pre
+ const text = code.textContent || ''
+ const lines = text.split('\n')
+
+ return lines.map(
+ (line) =>
+ new Paragraph({
+ children: [
+ new TextRun({
+ text: line || ' ',
+ font: { name: 'Courier New' },
+ size: 20,
+ }),
+ ],
+ spacing: { before: 0, after: 0 },
+ }),
+ )
+ }
+
+ /**
+ * 解析块级 HTML 节点为 docx 元素
+ */
+ function parseBlockNodes(container: Element): (ParagraphType | TableType)[] {
+ const elements: (ParagraphType | TableType)[] = []
+
+ for (const node of Array.from(container.childNodes)) {
+ if (node.nodeType === Node.TEXT_NODE) {
+ const text = node.textContent?.trim()
+ if (text) {
+ elements.push(new Paragraph({ children: [new TextRun({ text })] }))
+ }
+ continue
+ }
+
+ if (node.nodeType !== Node.ELEMENT_NODE) continue
+
+ const el = node as Element
+ const tag = el.tagName.toUpperCase()
+
+ // 标题
+ if (HEADING_MAP[tag]) {
+ const runs = parseInlineNodes(el, { ...defaultInlineStyle })
+ elements.push(
+ new Paragraph({
+ heading: HEADING_MAP[tag],
+ children: runs as TextRunType[],
+ alignment: getAlignment(el),
+ }),
+ )
+ continue
+ }
+
+ // 段落
+ if (tag === 'P') {
+ const runs = parseInlineNodes(el, { ...defaultInlineStyle })
+ if (runs.length > 0) {
+ elements.push(
+ new Paragraph({
+ children: runs as TextRunType[],
+ alignment: getAlignment(el),
+ }),
+ )
+ } else {
+ elements.push(new Paragraph({}))
+ }
+ continue
+ }
+
+ // 列表
+ if (tag === 'UL') {
+ elements.push(...parseList(el, false))
+ continue
+ }
+ if (tag === 'OL') {
+ elements.push(...parseList(el, true))
+ continue
+ }
+
+ // 代码块
+ if (tag === 'PRE') {
+ elements.push(...parseCodeBlock(el))
+ continue
+ }
+
+ // 表格
+ if (tag === 'TABLE') {
+ elements.push(parseTable(el))
+ continue
+ }
+
+ // 引用块
+ if (tag === 'BLOCKQUOTE') {
+ const innerElements = parseBlockNodes(el)
+ for (const inner of innerElements) {
+ if (inner instanceof Paragraph) {
+ elements.push(
+ new Paragraph({
+ ...((inner as any).options || {}),
+ indent: { left: 720 },
+ border: {
+ left: { style: 'single' as any, size: 6, color: '999999' },
+ },
+ }),
+ )
+ } else {
+ elements.push(inner)
+ }
+ }
+ continue
+ }
+
+ // 分隔线
+ if (tag === 'HR') {
+ elements.push(
+ new Paragraph({
+ children: [new TextRun({ text: '─'.repeat(50) })],
+ alignment: AlignmentType.CENTER,
+ }),
+ )
+ continue
+ }
+
+ // DIV 或其他容器 → 递归
+ if (el.children.length > 0) {
+ elements.push(...parseBlockNodes(el))
+ } else {
+ const text = el.textContent?.trim()
+ if (text) {
+ elements.push(new Paragraph({ children: [new TextRun({ text })] }))
+ }
+ }
+ }
+
+ return elements
+ }
+
// 解析 HTML
const parser = new DOMParser()
const doc = parser.parseFromString(html, 'text/html')
@@ -386,9 +401,9 @@ export async function exportToWord(html: string, filename = 'document'): Promise
{
reference: 'bullet-list',
levels: [
- { level: 0, format: 'bullet', text: '\u2022', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 720, hanging: 360 } } } },
- { level: 1, format: 'bullet', text: '\u25CB', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 1440, hanging: 360 } } } },
- { level: 2, format: 'bullet', text: '\u25AA', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 2160, hanging: 360 } } } },
+ { level: 0, format: 'bullet', text: '•', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 720, hanging: 360 } } } },
+ { level: 1, format: 'bullet', text: '○', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 1440, hanging: 360 } } } },
+ { level: 2, format: 'bullet', text: '▪', alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 2160, hanging: 360 } } } },
],
},
{
diff --git a/src/features/advanced/word/wordImport.ts b/src/features/advanced/word/wordImport.ts
index fbda0ed..2397ce1 100644
--- a/src/features/advanced/word/wordImport.ts
+++ b/src/features/advanced/word/wordImport.ts
@@ -1,8 +1,8 @@
/**
* Word 导入工具
* @description 使用 mammoth 将 .docx 文件转换为 HTML 并插入编辑器
+ * @note mammoth 为按需动态加载,仅在实际执行导入时下载
*/
-import mammoth from 'mammoth'
import type { Editor } from '@tiptap/core'
export interface WordImportResult {
@@ -16,6 +16,10 @@ export interface WordImportResult {
* @returns 转换结果(HTML + 消息)
*/
export async function convertWordToHtml(file: File): Promise {
+ // 动态加载 mammoth(CJS 包,做 default/命名空间兼容处理)
+ const mammothModule: any = await import('mammoth')
+ const mammoth = mammothModule.default ?? mammothModule
+
const arrayBuffer = await file.arrayBuffer()
const result = await mammoth.convertToHtml(
{ arrayBuffer },
@@ -32,8 +36,8 @@ export async function convertWordToHtml(file: File): Promise {
)
return {
- html: result.value,
- messages: result.messages.map((m) => m.message),
+ html: result.value as string,
+ messages: (result.messages as Array<{ message: string }>).map((m) => m.message),
}
}
diff --git a/src/features/advanced/zoom/ZoomBar.vue b/src/features/advanced/zoom/ZoomBar.vue
index 16e6604..43564cc 100644
--- a/src/features/advanced/zoom/ZoomBar.vue
+++ b/src/features/advanced/zoom/ZoomBar.vue
@@ -16,10 +16,11 @@
* ZoomBar - 缩放控制栏组件
* @description 提供文档缩放、页数统计和字数统计功能
*/
-import { computed, ref, watch } from 'vue'
+import { computed, onBeforeUnmount, ref, watch } from 'vue'
import { Button as AButton } from 'ant-design-vue'
import type { Editor } from '@tiptap/vue-3'
import { t } from '@/locales'
+import { debounce } from '@/utils/debounce'
import '@/styles/zoom-toolbar.css'
const props = withDefaults(
@@ -121,32 +122,34 @@ const updateCounts = () => {
}
}
-// 监听编辑器内容变化
+// 防抖:避免每次按键都全文重算字数
+const debouncedUpdateCounts = debounce(updateCounts, 200)
+
+// 监听编辑器内容变化(只监听 update:光标移动无需重算字数)
watch(
() => props.editor,
- (editor) => {
+ (editor, oldEditor) => {
+ if (oldEditor) {
+ // 编辑器切换/销毁时清理旧监听
+ oldEditor.off('update', debouncedUpdateCounts)
+ }
if (editor) {
- // 初始化时更新一次
+ // 初始化时立即更新一次
+ updateCounts()
+ // 监听编辑器更新事件(防抖)
+ editor.on('update', debouncedUpdateCounts)
+ } else {
+ // 编辑器销毁时归零
updateCounts()
-
- // 监听编辑器更新事件
- editor.on('update', updateCounts)
- editor.on('selectionUpdate', updateCounts)
}
},
{ immediate: true }
)
-// 监听编辑器销毁
-watch(
- () => props.editor,
- (editor, oldEditor) => {
- if (oldEditor && !editor) {
- // 编辑器被销毁时清理监听
- oldEditor.off('update', updateCounts)
- oldEditor.off('selectionUpdate', updateCounts)
- }
- }
-)
+// 组件卸载时统一清理
+onBeforeUnmount(() => {
+ debouncedUpdateCounts.cancel()
+ props.editor?.off('update', debouncedUpdateCounts)
+})
diff --git a/src/features/advanced/zoom/ZoomBar.vue.d.ts b/src/features/advanced/zoom/ZoomBar.vue.d.ts
deleted file mode 100644
index 053ca86..0000000
--- a/src/features/advanced/zoom/ZoomBar.vue.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-import '@/styles/zoom-toolbar.css';
-type __VLS_Props = {
- zoomLevel: number;
- totalPages: number;
- editor?: Editor | null;
- showCharCount?: boolean;
- min?: number;
- max?: number;
- step?: number;
- placement?: 'bottom' | 'belowToolbar';
-};
-declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
- reset: (value: number) => any;
- change: (value: number) => any;
- "update:zoomLevel": (value: number) => any;
-}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
- onReset?: ((value: number) => any) | undefined;
- onChange?: ((value: number) => any) | undefined;
- "onUpdate:zoomLevel"?: ((value: number) => any) | undefined;
-}>, {
- placement: "bottom" | "belowToolbar";
- showCharCount: boolean;
- min: number;
- max: number;
- step: number;
-}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=ZoomBar.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/zoom/ZoomBar.vue.d.ts.map b/src/features/advanced/zoom/ZoomBar.vue.d.ts.map
deleted file mode 100644
index c970254..0000000
--- a/src/features/advanced/zoom/ZoomBar.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ZoomBar.vue.d.ts","sourceRoot":"","sources":["ZoomBar.vue"],"names":[],"mappings":"AAgKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,2BAA2B,CAAA;AAElC,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAA;CACtC,CAAC;;;;;;;;;;eADY,QAAQ,GAAG,cAAc;mBAJrB,OAAO;SACjB,MAAM;SACN,MAAM;UACL,MAAM;;AAsPjB,wBAQG"}
\ No newline at end of file
diff --git a/src/features/advanced/zoom/index.d.ts b/src/features/advanced/zoom/index.d.ts
deleted file mode 100644
index a572fe1..0000000
--- a/src/features/advanced/zoom/index.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Zoom - 缩放功能模块
- * @description 提供文档缩放、页数统计和字数统计功能
- */
-export { default as ZoomBar } from './ZoomBar.vue';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/advanced/zoom/index.d.ts.map b/src/features/advanced/zoom/index.d.ts.map
deleted file mode 100644
index 5d0dca8..0000000
--- a/src/features/advanced/zoom/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/src/features/basic/align/AlignDropdown.vue b/src/features/basic/align/AlignDropdown.vue
index 8e1209e..f67fbe8 100644
--- a/src/features/basic/align/AlignDropdown.vue
+++ b/src/features/basic/align/AlignDropdown.vue
@@ -18,7 +18,7 @@ import { computed } from 'vue'
import type { Editor } from '@tiptap/vue-3'
import { ToolbarGroup, ToolbarDropdownButton } from '@/ui'
import { createCommandRunner } from '@/utils/editorCommands'
-import { createStateCheckers } from '@/utils/editorState'
+import { createStateCheckers, useReactiveEditor } from '@/utils/editorState'
import type { AlignValue, MenuItemConfig } from '@/configs/toolbar'
import { t } from '@/locales'
import {
@@ -34,7 +34,8 @@ interface Props {
}
const props = defineProps()
-const editor = computed(() => props.editor ?? null)
+// 事务响应式 editor:isActiveAlign 等状态跟随光标/内容变化重新求值
+const editor = useReactiveEditor(() => props.editor)
// ===== 工具函数 =====
const runCommand = createCommandRunner(editor)
diff --git a/src/features/basic/align/AlignDropdown.vue.d.ts b/src/features/basic/align/AlignDropdown.vue.d.ts
deleted file mode 100644
index 06190dd..0000000
--- a/src/features/basic/align/AlignDropdown.vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Editor } from '@tiptap/vue-3';
-interface Props {
- editor: Editor | null | undefined;
-}
-declare const _default: import("vue").DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
-export default _default;
-//# sourceMappingURL=AlignDropdown.vue.d.ts.map
\ No newline at end of file
diff --git a/src/features/basic/align/AlignDropdown.vue.d.ts.map b/src/features/basic/align/AlignDropdown.vue.d.ts.map
deleted file mode 100644
index 05cca51..0000000
--- a/src/features/basic/align/AlignDropdown.vue.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"AlignDropdown.vue.d.ts","sourceRoot":"","sources":["AlignDropdown.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAc3C,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;;AA4FD,wBAMG"}
\ No newline at end of file
diff --git a/src/features/basic/align/index.d.ts b/src/features/basic/align/index.d.ts
deleted file mode 100644
index a0205d2..0000000
--- a/src/features/basic/align/index.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Align Components - 对齐组件统一导出
- */
-export { default as AlignDropdown } from './AlignDropdown.vue';
-export type { AlignValue } from '@/configs/toolbar';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/src/features/basic/align/index.d.ts.map b/src/features/basic/align/index.d.ts.map
deleted file mode 100644
index 5429c11..0000000
--- a/src/features/basic/align/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAK9D,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
\ No newline at end of file
diff --git a/src/features/basic/color/ColorPicker.vue b/src/features/basic/color/ColorPicker.vue
index 85add95..f52ffa2 100644
--- a/src/features/basic/color/ColorPicker.vue
+++ b/src/features/basic/color/ColorPicker.vue
@@ -427,7 +427,7 @@ watch(normalizedColor, (newColor) => {