ai-word-editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/ai-word-editor.css +1 -0
- package/dist/index.js +7297 -0
- package/dist/vite.svg +1 -0
- package/dist/wordDocxExport.js +360 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# umo-edior(作为组件包使用)
|
|
2
|
+
|
|
3
|
+
本仓库已改造为 **Vue3 组件包**:你可以把它当成另一个 Vue3 + Vite 项目的依赖来 `import` 使用。
|
|
4
|
+
|
|
5
|
+
## 1. 打包
|
|
6
|
+
|
|
7
|
+
在本仓库执行:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm run build:lib
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
产物输出到 `dist/`,类型声明输出到 `dist/types/`。
|
|
14
|
+
|
|
15
|
+
## 2. 在宿主项目安装(两种方式任选)
|
|
16
|
+
|
|
17
|
+
### 方式 A:本地 file 依赖(最快,适合本机联调)
|
|
18
|
+
|
|
19
|
+
宿主项目 `package.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"umo-edior": "file:../umo-edior"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
然后在宿主项目执行:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm i
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 方式 B:发布到私有 npm(适合多人/多环境复用)
|
|
36
|
+
|
|
37
|
+
- 把 `package.json` 的 `"private": true` 改为 `false`,并设置合适的 `name/version` 后发布到你的 npm 仓库。
|
|
38
|
+
- 宿主项目正常 `npm i umo-edior` 安装即可。
|
|
39
|
+
|
|
40
|
+
## 3. 宿主项目使用
|
|
41
|
+
|
|
42
|
+
在宿主项目 `main.ts`:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { createApp } from 'vue'
|
|
46
|
+
import App from './App.vue'
|
|
47
|
+
import { UmoEditorAppPlugin } from 'umo-edior'
|
|
48
|
+
import 'umo-edior/style.css'
|
|
49
|
+
|
|
50
|
+
createApp(App).use(UmoEditorAppPlugin, {}).mount('#app')
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
在任意页面/组件中:
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<template>
|
|
57
|
+
<UmoEditorApp cdn-url="/umo-editor-external" />
|
|
58
|
+
</template>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
你也可以按需直接导入组件:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { UmoEditorApp } from 'umo-edior'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 4. 重要:`cdnUrl` 静态资源
|
|
68
|
+
|
|
69
|
+
`@umoteam/editor` 需要加载 `@umoteam/editor-external` 的静态资源。**不要依赖** `'/node_modules/@umoteam/editor-external'` 这种路径(线上通常不可用)。
|
|
70
|
+
|
|
71
|
+
推荐做法:
|
|
72
|
+
|
|
73
|
+
- 在宿主项目把 `node_modules/@umoteam/editor-external` 复制/同步到宿主的 `public/umo-editor-external/`
|
|
74
|
+
- 然后组件传入:`cdn-url="/umo-editor-external"`
|
|
75
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.comment-panel[data-v-ed19e43c]{width:280px;min-width:280px;height:100%;border-left:1px solid #e5e7eb;background:#fafafa;display:flex;flex-direction:column;overflow:hidden}.comment-panel__header[data-v-ed19e43c]{padding:14px 16px 10px;border-bottom:1px solid #e5e7eb;background:#fff}.comment-panel__title[data-v-ed19e43c]{margin:0;font-size:14px;font-weight:600;color:#374151;display:flex;align-items:center;gap:6px}.comment-panel__badge[data-v-ed19e43c]{background:#f59e0b;color:#fff;border-radius:10px;font-size:11px;padding:1px 6px;font-weight:500}.comment-panel__empty[data-v-ed19e43c]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#9ca3af;gap:4px;padding:24px;text-align:center}.comment-panel__empty p[data-v-ed19e43c]{margin:0;font-size:13px}.comment-panel__empty-icon[data-v-ed19e43c]{font-size:32px;margin-bottom:8px;opacity:.5}.comment-panel__empty-hint[data-v-ed19e43c]{font-size:12px!important;color:#d1d5db}.comment-panel__list[data-v-ed19e43c]{list-style:none;margin:0;padding:8px;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:8px}.comment-item[data-v-ed19e43c]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;cursor:pointer;transition:border-color .15s,box-shadow .15s}.comment-item[data-v-ed19e43c]:hover{border-color:#fbbf24;box-shadow:0 1px 4px #fbbf2426}.comment-item--active[data-v-ed19e43c]{border-color:#f59e0b;box-shadow:0 0 0 2px #f59e0b33}.comment-item--resolved[data-v-ed19e43c]{opacity:.55}.comment-item--resolved .comment-item__note[data-v-ed19e43c]{text-decoration:line-through;color:#9ca3af}.comment-item__quote[data-v-ed19e43c]{font-size:12px;color:#6b7280;background:#fef9c3;border-left:3px solid #fbbf24;padding:4px 8px;border-radius:0 4px 4px 0;margin-bottom:6px;line-height:1.4}.comment-item__quote-icon[data-v-ed19e43c]{color:#fbbf24;margin-right:2px}.comment-item--c0 .comment-item__quote[data-v-ed19e43c]{background:#fef3c7cc;border-left-color:#f97316}.comment-item--c0 .comment-item__quote-icon[data-v-ed19e43c]{color:#f97316}.comment-item--c1 .comment-item__quote[data-v-ed19e43c]{background:#d1fae5d9;border-left-color:#22c55e}.comment-item--c1 .comment-item__quote-icon[data-v-ed19e43c]{color:#22c55e}.comment-item--c2 .comment-item__quote[data-v-ed19e43c]{background:#dbeafed9;border-left-color:#3b82f6}.comment-item--c2 .comment-item__quote-icon[data-v-ed19e43c]{color:#3b82f6}.comment-item--c3 .comment-item__quote[data-v-ed19e43c]{background:#ede9fee6;border-left-color:#a855f7}.comment-item--c3 .comment-item__quote-icon[data-v-ed19e43c]{color:#a855f7}.comment-item--c4 .comment-item__quote[data-v-ed19e43c]{background:#fce7f3e6;border-left-color:#ec4899}.comment-item--c4 .comment-item__quote-icon[data-v-ed19e43c]{color:#ec4899}.comment-item--c5 .comment-item__quote[data-v-ed19e43c]{background:#ccfbf1d9;border-left-color:#14b8a6}.comment-item--c5 .comment-item__quote-icon[data-v-ed19e43c]{color:#14b8a6}.comment-item--c6 .comment-item__quote[data-v-ed19e43c]{background:#fef9c3e6;border-left-color:#eab308}.comment-item--c6 .comment-item__quote-icon[data-v-ed19e43c]{color:#eab308}.comment-item--c7 .comment-item__quote[data-v-ed19e43c]{background:#ffe4e6e6;border-left-color:#f43f5e}.comment-item--c7 .comment-item__quote-icon[data-v-ed19e43c]{color:#f43f5e}.comment-item--c8 .comment-item__quote[data-v-ed19e43c]{background:#e0e7ffe6;border-left-color:#6366f1}.comment-item--c8 .comment-item__quote-icon[data-v-ed19e43c]{color:#6366f1}.comment-item--c9 .comment-item__quote[data-v-ed19e43c]{background:#ecfdc8e6;border-left-color:#84cc16}.comment-item--c9 .comment-item__quote-icon[data-v-ed19e43c]{color:#84cc16}.comment-item--c10 .comment-item__quote[data-v-ed19e43c]{background:#cffafee6;border-left-color:#06b6d4}.comment-item--c10 .comment-item__quote-icon[data-v-ed19e43c]{color:#06b6d4}.comment-item--c11 .comment-item__quote[data-v-ed19e43c]{background:#d1fae5d9;border-left-color:#10b981}.comment-item--c11 .comment-item__quote-icon[data-v-ed19e43c]{color:#10b981}.comment-item--c12 .comment-item__quote[data-v-ed19e43c]{background:#ede9fee6;border-left-color:#8b5cf6}.comment-item--c12 .comment-item__quote-icon[data-v-ed19e43c]{color:#8b5cf6}.comment-item--c13 .comment-item__quote[data-v-ed19e43c]{background:#faf0ffe6;border-left-color:#d946ef}.comment-item--c13 .comment-item__quote-icon[data-v-ed19e43c]{color:#d946ef}.comment-item--c14 .comment-item__quote[data-v-ed19e43c]{background:#e0f2fee6;border-left-color:#0ea5e9}.comment-item--c14 .comment-item__quote-icon[data-v-ed19e43c]{color:#0ea5e9}.comment-item--c15 .comment-item__quote[data-v-ed19e43c]{background:#ffedd5e6;border-left-color:#ea580c}.comment-item--c15 .comment-item__quote-icon[data-v-ed19e43c]{color:#ea580c}.comment-item--c16 .comment-item__quote[data-v-ed19e43c]{background:#fefce8e6;border-left-color:#ca8a04}.comment-item--c16 .comment-item__quote-icon[data-v-ed19e43c]{color:#ca8a04}.comment-item--c17 .comment-item__quote[data-v-ed19e43c]{background:#fee2e2e6;border-left-color:#dc2626}.comment-item--c17 .comment-item__quote-icon[data-v-ed19e43c]{color:#dc2626}.comment-item--c18 .comment-item__quote[data-v-ed19e43c]{background:#ccfbf1d9;border-left-color:#0d9488}.comment-item--c18 .comment-item__quote-icon[data-v-ed19e43c]{color:#0d9488}.comment-item--c19 .comment-item__quote[data-v-ed19e43c]{background:#f1f5f9e6;border-left-color:#64748b}.comment-item--c19 .comment-item__quote-icon[data-v-ed19e43c]{color:#64748b}.comment-item__note[data-v-ed19e43c]{font-size:13px;color:#374151;line-height:1.5;margin-bottom:6px;word-break:break-word}.comment-item__meta[data-v-ed19e43c]{display:flex;justify-content:space-between;font-size:11px;color:#9ca3af;margin-bottom:8px}.comment-item__author[data-v-ed19e43c]{font-weight:500}.comment-item__actions[data-v-ed19e43c]{display:flex;gap:6px;justify-content:flex-end}.comment-btn[data-v-ed19e43c]{border:none;border-radius:4px;padding:3px 8px;font-size:11px;cursor:pointer;transition:background .15s}.comment-btn--resolve[data-v-ed19e43c]{background:#ecfdf5;color:#059669}.comment-btn--resolve[data-v-ed19e43c]:hover{background:#d1fae5}.comment-btn--delete[data-v-ed19e43c]{background:#fef2f2;color:#dc2626}.comment-btn--delete[data-v-ed19e43c]:hover{background:#fee2e2}.dialog-backdrop[data-v-8cbc8293]{position:fixed;inset:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:9999}.dialog[data-v-8cbc8293]{background:#fff;border-radius:10px;box-shadow:0 20px 60px #00000026,0 4px 12px #00000014;width:460px;max-width:calc(100vw - 32px);overflow:hidden}.dialog__header[data-v-8cbc8293]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #e5e7eb}.dialog__title[data-v-8cbc8293]{margin:0;font-size:15px;font-weight:600;color:#111827}.dialog__close[data-v-8cbc8293]{border:none;background:none;font-size:14px;color:#9ca3af;cursor:pointer;padding:4px 6px;border-radius:4px;line-height:1}.dialog__close[data-v-8cbc8293]:hover{background:#f3f4f6;color:#374151}.dialog__quote[data-v-8cbc8293]{padding:12px 20px 0}.dialog__quote-label[data-v-8cbc8293]{font-size:11px;font-weight:500;color:#9ca3af;text-transform:uppercase;letter-spacing:.05em}.dialog__quote-text[data-v-8cbc8293]{margin:4px 0 0;padding:8px 12px;background:#fef9c3;border-left:3px solid #fbbf24;border-radius:0 4px 4px 0;font-size:13px;color:#374151;line-height:1.5}.dialog__body[data-v-8cbc8293]{padding:16px 20px 0}.dialog__label[data-v-8cbc8293]{display:block;font-size:12px;font-weight:500;color:#374151;margin-bottom:6px}.dialog__textarea[data-v-8cbc8293]{width:100%;border:1px solid #d1d5db;border-radius:6px;padding:10px 12px;font-size:14px;font-family:inherit;resize:vertical;box-sizing:border-box;transition:border-color .15s,box-shadow .15s;outline:none;color:#111827;line-height:1.5}.dialog__textarea[data-v-8cbc8293]:focus{border-color:#f59e0b;box-shadow:0 0 0 3px #f59e0b26}.dialog__hint[data-v-8cbc8293]{margin:6px 0 0;font-size:11px;color:#9ca3af}.dialog__footer[data-v-8cbc8293]{display:flex;justify-content:flex-end;gap:8px;padding:16px 20px}.dialog__btn[data-v-8cbc8293]{border:none;border-radius:6px;padding:8px 16px;font-size:13px;font-weight:500;cursor:pointer;transition:background .15s}.dialog__btn--cancel[data-v-8cbc8293]{background:#f3f4f6;color:#374151}.dialog__btn--cancel[data-v-8cbc8293]:hover{background:#e5e7eb}.dialog__btn--confirm[data-v-8cbc8293]{background:#f59e0b;color:#fff}.dialog__btn--confirm[data-v-8cbc8293]:hover:not(:disabled){background:#d97706}.dialog__btn--confirm[data-v-8cbc8293]:disabled{opacity:.45;cursor:not-allowed}.umo-editor-content table:has(colgroup[data-word-col-layout]) td,.umo-editor-content table:has(colgroup[data-word-col-layout]) th,.umo-editor-content table:has(colgroup[data-word-col-layout]){border:none!important;outline:none!important}.auth-page[data-v-203671c3]{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f3f4f6}.auth-card[data-v-203671c3]{background:#fff;border-radius:12px;padding:40px 36px;width:340px;box-shadow:0 4px 24px #0000001a}.auth-title[data-v-203671c3]{font-size:20px;font-weight:700;color:#111827;text-align:center;margin:0 0 24px}.auth-tabs[data-v-203671c3]{display:flex;gap:0;border:1px solid #e5e7eb;border-radius:8px;overflow:hidden;margin-bottom:20px}.auth-tab[data-v-203671c3]{flex:1;padding:8px;border:none;background:transparent;cursor:pointer;font-size:14px;color:#6b7280;transition:background .15s,color .15s}.auth-tab--active[data-v-203671c3]{background:#3b82f6;color:#fff}.auth-form[data-v-203671c3]{display:flex;flex-direction:column;gap:12px}.auth-input[data-v-203671c3]{padding:10px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;outline:none;transition:border-color .15s}.auth-input[data-v-203671c3]:focus{border-color:#3b82f6}.auth-submit[data-v-203671c3]{padding:10px;border:none;border-radius:8px;background:#3b82f6;color:#fff;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s}.auth-submit[data-v-203671c3]:hover:not(:disabled){background:#2563eb}.auth-submit[data-v-203671c3]:disabled{opacity:.6;cursor:not-allowed}.auth-error[data-v-203671c3]{color:#ef4444;font-size:13px;margin:0}.app-layout[data-v-203671c3]{display:flex;width:100%;height:100vh;overflow:hidden}.doc-sidebar[data-v-203671c3]{width:200px;flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid #e5e7eb;background:#f9fafb}.doc-sidebar__header[data-v-203671c3]{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px;border-bottom:1px solid #e5e7eb}.doc-sidebar__title[data-v-203671c3]{font-size:13px;font-weight:600;color:#374151}.doc-sidebar__new[data-v-203671c3]{border:none;background:none;font-size:18px;color:#3b82f6;cursor:pointer;line-height:1;padding:0 2px}.doc-sidebar__new[data-v-203671c3]:hover{color:#2563eb}.doc-sidebar__list[data-v-203671c3]{flex:1;overflow-y:auto;padding:6px 0}.doc-item[data-v-203671c3]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:pointer;font-size:13px;color:#374151;transition:background .1s;gap:6px}.doc-item[data-v-203671c3]:hover{background:#f0f0f0}.doc-item--active[data-v-203671c3]{background:#dbeafe;color:#1d4ed8}.doc-item__title[data-v-203671c3]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doc-item__del[data-v-203671c3]{border:none;background:none;color:#9ca3af;cursor:pointer;font-size:11px;opacity:0;padding:1px 3px;border-radius:3px}.doc-item:hover .doc-item__del[data-v-203671c3]{opacity:1}.doc-item__del[data-v-203671c3]:hover{color:#ef4444;background:#fee2e2}.doc-sidebar__empty[data-v-203671c3]{padding:16px 12px;font-size:12px;color:#9ca3af;text-align:center}.doc-sidebar__footer[data-v-203671c3]{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-top:1px solid #e5e7eb}.doc-sidebar__user[data-v-203671c3]{font-size:12px;color:#6b7280;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doc-sidebar__logout[data-v-203671c3]{border:none;background:none;font-size:12px;color:#ef4444;cursor:pointer;flex-shrink:0}.editor-wrapper[data-v-203671c3]{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.comment-toolbar[data-v-203671c3]{display:flex;align-items:center;gap:8px;padding:8px 16px;background:#fff;border-bottom:1px solid #e5e7eb;z-index:10;flex-shrink:0}.toolbar-docname[data-v-203671c3]{flex:1;min-width:0}.toolbar-docname__input[data-v-203671c3]{width:100%;border:1px solid transparent;border-radius:4px;padding:3px 6px;font-size:14px;font-weight:600;color:#111827;background:transparent;outline:none;transition:border-color .15s,background .15s}.toolbar-docname__input[data-v-203671c3]:hover,.toolbar-docname__input[data-v-203671c3]:focus{border-color:#d1d5db;background:#f9fafb}.toolbar-docname--empty[data-v-203671c3]{font-size:13px;color:#9ca3af}.toolbar-actions[data-v-203671c3]{display:flex;gap:8px;flex-shrink:0}.toolbar-btn[data-v-203671c3]{display:inline-flex;align-items:center;gap:5px;border:none;border-radius:6px;padding:6px 14px;font-size:13px;font-weight:500;cursor:pointer;transition:background .15s,opacity .15s}.toolbar-btn[data-v-203671c3]:disabled{opacity:.5;cursor:not-allowed}.toolbar-btn__icon[data-v-203671c3]{font-size:15px}.toolbar-btn--save[data-v-203671c3]{background:#d1fae5;color:#065f46}.toolbar-btn--save[data-v-203671c3]:hover:not(:disabled){background:#a7f3d0}.toolbar-btn--primary[data-v-203671c3]{background:#fef3c7;color:#92400e}.toolbar-btn--primary[data-v-203671c3]:hover:not(:disabled){background:#fde68a}.toolbar-btn--ai[data-v-203671c3]{background:#ede9fe;color:#5b21b6}.toolbar-btn--ai[data-v-203671c3]:hover:not(:disabled){background:#ddd6fe}.umo-editor-instance[data-v-203671c3]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.editor-placeholder[data-v-203671c3]{flex:1;display:flex;align-items:center;justify-content:center;color:#9ca3af;font-size:14px}.umo-custom-huge-btn[data-v-203671c3]{display:inline-flex;align-items:center;justify-content:center;flex-direction:column;width:auto;height:56px;padding:0 5px;margin:0;border:none;border-radius:var(--umo-radius, 3px);background:transparent;cursor:pointer;transition:background .2s;white-space:nowrap}.umo-custom-huge-btn[data-v-203671c3]:hover:not(:disabled){background:var(--umo-button-hover-background, rgba(0, 0, 0, .06))}.umo-custom-huge-btn[data-v-203671c3]:disabled{opacity:.5;cursor:not-allowed}.umo-custom-huge-btn__icon[data-v-203671c3]{display:flex;align-items:center;justify-content:center;color:var(--umo-text-color, #3d3d3d);margin-top:3px}.umo-custom-huge-btn__icon svg[data-v-203671c3]{width:24px;height:24px}.umo-custom-huge-btn__text[data-v-203671c3]{display:block;font-size:12px;color:var(--umo-text-color, #3d3d3d);margin-top:2px;line-height:1.2}.html-dialog-mask[data-v-203671c3]{position:fixed;inset:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:9999}.html-dialog[data-v-203671c3]{background:#1e1e2e;border-radius:10px;width:min(860px,92vw);max-height:80vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0006}.html-dialog__header[data-v-203671c3]{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid #313244;flex-shrink:0}.html-dialog__title[data-v-203671c3]{font-size:14px;font-weight:600;color:#cdd6f4}.html-dialog__close[data-v-203671c3]{background:none;border:none;color:#6c7086;font-size:16px;cursor:pointer;padding:2px 6px;border-radius:4px;line-height:1;transition:color .15s,background .15s}.html-dialog__close[data-v-203671c3]:hover{color:#cdd6f4;background:#313244}.html-dialog__toolbar[data-v-203671c3]{display:flex;justify-content:flex-end;padding:8px 16px;border-bottom:1px solid #313244;flex-shrink:0}.html-dialog__copy-btn[data-v-203671c3]{font-size:12px;padding:4px 14px;border-radius:5px;border:1px solid #45475a;background:#313244;color:#cdd6f4;cursor:pointer;transition:background .15s,border-color .15s}.html-dialog__copy-btn[data-v-203671c3]:hover{background:#45475a;border-color:#89b4fa;color:#89b4fa}.html-dialog__content[data-v-203671c3]{flex:1;overflow:auto;margin:0;padding:16px 20px;font-family:Fira Code,Consolas,Courier New,monospace;font-size:12.5px;line-height:1.7;color:#a6e3a1;white-space:pre-wrap;word-break:break-all}[data-v-203671c3] table:has(colgroup[data-word-col-layout]) td,[data-v-203671c3] table:has(colgroup[data-word-col-layout]) th,[data-v-203671c3] table:has(colgroup[data-word-col-layout]){border:none!important;outline:none!important}
|