@sanmokeji/smo-editor 0.0.2

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 ADDED
@@ -0,0 +1,48 @@
1
+ # smo-editor
2
+
3
+ This template should help get you started developing with Vue 3 in Vite.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ [VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8
+
9
+ ## Recommended Browser Setup
10
+
11
+ - Chromium-based browsers (Chrome, Edge, Brave, etc.):
12
+ - [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
13
+ - [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
14
+ - Firefox:
15
+ - [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
16
+ - [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
17
+
18
+ ## Type Support for `.vue` Imports in TS
19
+
20
+ TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
21
+
22
+ ## Customize configuration
23
+
24
+ See [Vite Configuration Reference](https://vite.dev/config/).
25
+
26
+ ## Project Setup
27
+
28
+ ```sh
29
+ pnpm install
30
+ ```
31
+
32
+ ### Compile and Hot-Reload for Development
33
+
34
+ ```sh
35
+ pnpm dev
36
+ ```
37
+
38
+ ### Type-Check, Compile and Minify for Production
39
+
40
+ ```sh
41
+ pnpm build
42
+ ```
43
+
44
+ ### Lint with [ESLint](https://eslint.org/)
45
+
46
+ ```sh
47
+ pnpm lint
48
+ ```
@@ -0,0 +1,27 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string;
3
+ editable?: boolean;
4
+ placeholder?: string;
5
+ onImageUpload?: (file: File) => Promise<string>;
6
+ };
7
+ export declare const SmoEditor: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
+ "update:modelValue": (value: string) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
11
+ }>, {
12
+ placeholder: string;
13
+ editable: boolean;
14
+ modelValue: string;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
16
+
17
+ export interface SmoEditorOptions {
18
+ /** 编辑器初始内容,可以是 HTML 或 JSON */
19
+ content?: string | object;
20
+ /** 是否只读 */
21
+ editable?: boolean;
22
+ /** 占位符文字 */
23
+ placeholder?: string;
24
+ /** 图片上传处理函数 */
25
+ onImageUpload?: (file: File) => Promise<string>;
26
+ }
27
+
@@ -0,0 +1,2 @@
1
+ .smo-editor-content img{max-width:100%;transition:width .2s cubic-bezier(.4,0,.2,1);display:block}.smo-editor-content img[data-align=left]{margin-right:auto}.smo-editor-content img[data-align=center]{margin:0 auto}.smo-editor-content img[data-align=right]{margin-left:auto}.smo-editor-content-wrapper[data-v-1570b1c8]{border:1px solid #e2e8f0;border-radius:6px;outline:none;min-height:150px;padding:16px}[data-v-1570b1c8] .ProseMirror-selectednode{border-radius:4px;outline:2px solid #38bdf8}[data-v-1570b1c8] .tiptap:focus,[data-v-1570b1c8] .ProseMirror{outline:none}[data-v-1570b1c8] .ProseMirror ul{margin:8px 0;padding-left:24px;list-style-type:disc}[data-v-1570b1c8] .ProseMirror ol{margin:8px 0;padding-left:24px;list-style-type:decimal}[data-v-1570b1c8] .ProseMirror li p{margin:4px 0}[data-v-1570b1c8] .ProseMirror blockquote{color:#475569;background-color:#f8fafc;border-left:4px solid #cbd5e1;border-radius:2px;margin:12px 0;padding:8px 16px}[data-v-1570b1c8] .ProseMirror blockquote p{margin:4px 0}[data-v-1570b1c8] .ProseMirror pre{color:#38bdf8;background-color:#0f172a;border-radius:6px;margin:16px 0;padding:12px 16px;font-family:Fira Code,Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;overflow-x:auto}[data-v-1570b1c8] .ProseMirror pre code{color:inherit;background:0 0;padding:0;font-size:13px}[data-v-1570b1c8] .ProseMirror hr{cursor:pointer;border:none;border-top:2px solid #e2e8f0;margin:24px 0}[data-v-1570b1c8] .ProseMirror hr.ProseMirror-selectednode{outline:2px solid #38bdf8}[data-v-1570b1c8] .ProseMirror code{color:#e11d48;background-color:#f1f5f9;border-radius:4px;padding:2px 6px;font-family:monospace;font-size:.85em;font-weight:500}[data-v-1570b1c8] .ProseMirror .smo-editor-link{color:#2563eb;text-underline-offset:3px;cursor:pointer;font-weight:500;text-decoration:underline}[data-v-1570b1c8] .ProseMirror .smo-editor-link:hover{color:#1d4ed8}[data-v-1570b1c8] .tiptap .is-editor-empty:first-child:before{color:#adb5bd;content:attr(data-placeholder);float:left;pointer-events:none;height:0}[data-v-1570b1c8] .tiptap :first-child{margin-top:0}[data-v-1570b1c8] .tiptap [data-resize-handle]{z-index:10;background:#00000080;border:1px solid #fffc;border-radius:2px;position:absolute}[data-v-1570b1c8] .tiptap [data-resize-handle]:hover{background:#000c}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top-left],[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top-right],[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom-left],[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom-right]{width:8px;height:8px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top-left]{cursor:nwse-resize;top:-4px;left:-4px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top-right]{cursor:nesw-resize;top:-4px;right:-4px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom-left]{cursor:nesw-resize;bottom:-4px;left:-4px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom-right]{cursor:nwse-resize;bottom:-4px;right:-4px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top],[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom]{height:6px;left:8px;right:8px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=top]{cursor:ns-resize;top:-3px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=bottom]{cursor:ns-resize;bottom:-3px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=left],[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=right]{width:6px;top:8px;bottom:8px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=left]{cursor:ew-resize;left:-3px}[data-v-1570b1c8] .tiptap [data-resize-handle][data-resize-handle=right]{cursor:ew-resize;right:-3px}[data-v-1570b1c8] .tiptap [data-resize-state=true] [data-resize-wrapper]{border-radius:.125rem;outline:1px solid #00000040}.smo-toolbar-group[data-v-0762240b]{align-items:center;gap:2px;padding:0 4px;display:inline-flex;position:relative}.smo-toolbar-group+.smo-toolbar-group[data-v-0762240b]:before{content:"";background-color:#e2e8f0;width:1px;position:absolute;top:6px;bottom:6px;left:-2px}.smo-toolbar-button[data-v-10d293e2]{color:#475569;cursor:pointer;background:0 0;border:none;border-radius:4px;outline:none;justify-content:center;align-items:center;padding:8px;transition:all .2s;display:inline-flex}.smo-toolbar-button[data-v-10d293e2]:hover:not(:disabled){color:#0f172a;background-color:#f1f5f9}.smo-toolbar-button.is-active[data-v-10d293e2]{color:#2563eb;background-color:#e2e8f0;font-weight:700}.smo-toolbar-button[data-v-10d293e2]:disabled{color:#cbd5e1;cursor:not-allowed}.smo-icon[data-v-8230f5dd]{vertical-align:middle;flex-shrink:0;display:inline-block}.smo-custom-select[data-v-0b16f052]{-webkit-user-select:none;user-select:none;display:inline-block;position:relative}.smo-select-trigger[data-v-0b16f052]{color:#475569;cursor:pointer;background-color:#0000;border-radius:4px;justify-content:space-between;align-items:center;min-width:50px;height:28px;padding:0 10px;font-size:13px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex}.smo-select-trigger[data-v-0b16f052]:hover,.smo-select-trigger.is-active[data-v-0b16f052]{color:#0f172a;background-color:#f1f5f9}.smo-select-value[data-v-0b16f052]{font-weight:500}.smo-select-arrow[data-v-0b16f052]{color:#94a3b8;margin-left:8px;font-size:8px;transition:transform .2s;transform:scale(.8)}.smo-select-arrow.is-rotated[data-v-0b16f052]{transform:scale(.8)rotate(180deg)}.smo-select-dropdown[data-v-0b16f052]{z-index:50;background-color:#fff;border:1px solid #e2e8f0;border-radius:6px;min-width:160px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.smo-select-option[data-v-0b16f052]{color:#334155;cursor:pointer;border-radius:4px;justify-content:space-between;align-items:center;margin-bottom:2px;padding:6px 10px;font-size:13px;transition:background-color .15s;display:flex}.smo-select-option[data-v-0b16f052]:last-child{margin-bottom:0}.smo-select-option[data-v-0b16f052]:hover{color:#0f172a;background-color:#f8fafc}.smo-select-option.is-selected[data-v-0b16f052]{color:#2563eb;background-color:#eff6ff;font-weight:500}.smo-option-check[data-v-0b16f052]{font-size:11px;font-weight:700}.smo-select-option.opt-h1[data-v-0b16f052]{font-size:18px;font-weight:700}.smo-select-option.opt-h2[data-v-0b16f052]{font-size:16px;font-weight:600}.smo-select-option.opt-h3[data-v-0b16f052]{font-size:14px;font-weight:600}.smo-select-option.opt-h4[data-v-0b16f052]{font-size:13px;font-weight:600}.smo-select-option.opt-h5[data-v-0b16f052]{font-size:12px;font-weight:600}.smo-select-option.opt-h6[data-v-0b16f052]{font-size:11px;font-weight:600}.smo-fade-enter-active[data-v-0b16f052],.smo-fade-leave-active[data-v-0b16f052]{transition:opacity .15s,transform .15s}.smo-fade-enter-from[data-v-0b16f052],.smo-fade-leave-to[data-v-0b16f052]{opacity:0;transform:translateY(-4px)}.smo-link-setter[data-v-77dc2707]{display:inline-block}.smo-link-popover-fixed[data-v-77dc2707]{z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:8px;flex-direction:column;gap:10px;width:280px;padding:12px;display:flex;position:fixed;transform:translate(-50%,-100%);box-shadow:0 10px 25px -5px #0f172a26}.smo-popover-field[data-v-77dc2707]{align-items:center;gap:8px;display:flex}.smo-field-label[data-v-77dc2707]{color:#64748b;min-width:36px;font-size:12px}.smo-link-input[data-v-77dc2707]{border:1px solid #cbd5e1;border-radius:4px;outline:none;flex:1;padding:5px 8px;font-size:12px}.smo-link-input[data-v-77dc2707]:focus{border-color:#2563eb}.smo-link-actions[data-v-77dc2707]{justify-content:flex-end;gap:6px;margin-top:4px;display:flex}.smo-popover-btn[data-v-77dc2707]{cursor:pointer;background:#fff;border:1px solid #cbd5e1;border-radius:4px;padding:4px 10px;font-size:12px}.smo-popover-btn.primary[data-v-77dc2707]{color:#fff;background:#2563eb;border-color:#2563eb}.smo-popover-btn.danger[data-v-77dc2707]{color:#fff;background:#ef4444;border-color:#ef4444}.bubble-menu[data-v-3b921f1f]{background-color:#fff;border:1px solid #3d25140d;border-radius:10px;min-width:300px;padding:15px;box-shadow:0 12px 33px #0000000f,0 3.618px 9.949px #0000000a}.bubble-menu .form-item[data-v-3b921f1f]:last-child{margin-bottom:0}.bubble-menu .form-item[data-v-3b921f1f]{color:#475569;align-items:center;margin-bottom:16px;font-size:.8rem;display:flex}.bubble-menu .form-item label[data-v-3b921f1f]{flex-shrink:0;width:4rem}.bubble-menu .form-item input[data-v-3b921f1f]{color:#334155;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:4px;outline:none;flex:1;padding:8px;font-size:12px;transition:border-color .2s}.smo-editor-container{flex-direction:column;width:100%;display:flex}:deep(.smo-editor-content-wrapper){border-top-left-radius:0!important;border-top-right-radius:0!important}
2
+ /*$vite$:1*/
@@ -0,0 +1,745 @@
1
+ import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, shallowRef as b, toDisplayString as x, unref as S, vModelText as C, watch as w, withCtx as T, withDirectives as E, withKeys as ee, withModifiers as D } from "vue";
2
+ import { Editor as O, EditorContent as k, mergeAttributes as A } from "@tiptap/vue-3";
3
+ import j from "@tiptap/starter-kit";
4
+ import { Placeholder as M } from "@tiptap/extension-placeholder";
5
+ import N from "@tiptap/extension-image";
6
+ import te from "@tiptap/extension-text-align";
7
+ import ne from "@tiptap/extension-file-handler";
8
+ import { BubbleMenu as re } from "@tiptap/vue-3/menus";
9
+ //#region src/core/editorConfig.ts
10
+ var ie = {
11
+ content: "<p>欢迎使用 SmoEditor !</p>",
12
+ editable: !0,
13
+ placeholder: "请输入内容..."
14
+ }, ae = N.extend({
15
+ addOptions() {
16
+ return {
17
+ ...this.parent(),
18
+ onImageUpload: null
19
+ };
20
+ },
21
+ addAttributes() {
22
+ return {
23
+ ...this.parent?.(),
24
+ uploading: { default: !1 },
25
+ progress: { default: 0 },
26
+ align: {
27
+ default: "center",
28
+ parseHTML: (e) => e.getAttribute("data-align") || "center",
29
+ renderHTML: (e) => e.align ? { "data-align": e.align } : {}
30
+ },
31
+ width: {
32
+ default: "auto",
33
+ parseHTML: (e) => e.getAttribute("data-width") || "auto",
34
+ renderHTML: (e) => e.width ? { "data-width": e.width } : {}
35
+ }
36
+ };
37
+ },
38
+ renderHTML({ HTMLAttributes: e, node: t }) {
39
+ return ["img", A(this.options.HTMLAttributes, e, { style: `width: ${t.attrs.width};` })];
40
+ }
41
+ }), P = (e, t) => e ? t === e.getAttributes("image").align : !1, F = (e, t) => e ? t === e.getAttributes("image").width : !1, I = (e, t) => {
42
+ e && e.commands.updateAttributes("image", { width: t });
43
+ }, L = (e, t) => {
44
+ e && e.commands.updateAttributes("image", t);
45
+ }, R = (e, t) => {
46
+ e && e.commands.updateAttributes("image", { align: t });
47
+ };
48
+ async function z(e, t, n) {
49
+ let r = e.extensionManager.extensions.find((e) => e.name === "image")?.options?.onImageUpload;
50
+ try {
51
+ let i = "";
52
+ if (r ? i = await r(t) : (console.log("SmoEditor: 未检测到 onImageUpload,启用 Base64 模式"), i = await V(t)), i) {
53
+ let t = e.chain().focus();
54
+ n === void 0 ? t.setImage({ src: i }).run() : t.insertContentAt(n, {
55
+ type: "image",
56
+ attrs: { src: i }
57
+ }).run();
58
+ }
59
+ } catch (e) {
60
+ console.error("上传失败", e);
61
+ }
62
+ }
63
+ async function B(e, t, n) {
64
+ let r = n;
65
+ for (let n of t) await z(e, n, r), r !== void 0 && (r += 1);
66
+ }
67
+ var V = (e) => new Promise((t, n) => {
68
+ let r = new FileReader();
69
+ r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (e) => n(e);
70
+ }), H = (e) => [
71
+ j.configure({
72
+ heading: { levels: [
73
+ 1,
74
+ 2,
75
+ 3,
76
+ 4,
77
+ 5,
78
+ 6
79
+ ] },
80
+ bulletList: {},
81
+ orderedList: {},
82
+ blockquote: {},
83
+ link: {
84
+ openOnClick: !1,
85
+ autolink: !0,
86
+ HTMLAttributes: {
87
+ rel: "noopener noreferrer",
88
+ target: "_blank",
89
+ class: "smo-editor-link"
90
+ }
91
+ }
92
+ }),
93
+ te.configure({ types: ["heading", "paragraph"] }),
94
+ M.configure({ placeholder: "请输入内容..." }),
95
+ ae.configure({
96
+ onImageUpload: e.onImageUpload,
97
+ allowBase64: !0,
98
+ HTMLAttributes: { class: "smo-editor-image" }
99
+ }),
100
+ ne.configure({
101
+ allowedMimeTypes: [
102
+ "image/png",
103
+ "image/jpeg",
104
+ "image/gif",
105
+ "image/webp"
106
+ ],
107
+ onDrop: async (e, t, n) => {
108
+ await B(e, t.filter((e) => e.type.startsWith("image/")), n);
109
+ },
110
+ onPaste: async (e, t) => {
111
+ await B(e, t.filter((e) => e.type.startsWith("image/")));
112
+ }
113
+ })
114
+ ], U = (e = {}) => {
115
+ let t = {
116
+ ...ie,
117
+ ...e
118
+ };
119
+ return new O({
120
+ content: t.content,
121
+ editable: t.editable,
122
+ extensions: H({ onImageUpload: e.onImageUpload }),
123
+ editorProps: { attributes: { class: "smo-editor-content" } }
124
+ });
125
+ }, W = { class: "smo-editor-content-wrapper" }, G = /* @__PURE__ */ u({
126
+ __name: "EditorContent",
127
+ props: { editor: {} },
128
+ setup(e) {
129
+ return (t, n) => (g(), o("div", W, [e.editor ? (g(), i(S(k), {
130
+ key: 0,
131
+ editor: e.editor
132
+ }, null, 8, ["editor"])) : a("", !0)]));
133
+ }
134
+ }), K = (e, t) => {
135
+ let n = e.__vccOpts || e;
136
+ for (let [e, r] of t) n[e] = r;
137
+ return n;
138
+ }, q = /* @__PURE__ */ K(G, [["__scopeId", "data-v-1570b1c8"]]), J = { class: "smo-toolbar-group" }, Y = /* @__PURE__ */ K(/* @__PURE__ */ u({
139
+ __name: "ToolbarGroup",
140
+ setup(e) {
141
+ return (e, t) => (g(), o("div", J, [y(e.$slots, "default", {}, void 0, !0)]));
142
+ }
143
+ }), [["__scopeId", "data-v-0762240b"]]), oe = ["disabled", "title"], X = /* @__PURE__ */ K(/* @__PURE__ */ u({
144
+ __name: "ToolbarButton",
145
+ props: {
146
+ active: {
147
+ type: Boolean,
148
+ default: !1
149
+ },
150
+ disabled: {
151
+ type: Boolean,
152
+ default: !1
153
+ },
154
+ title: { default: "" }
155
+ },
156
+ emits: ["click"],
157
+ setup(e, { emit: t }) {
158
+ let n = t, r = (e) => {
159
+ n("click", e);
160
+ };
161
+ return (t, n) => (g(), o("button", {
162
+ type: "button",
163
+ class: f(["smo-toolbar-button", { "is-active": e.active }]),
164
+ disabled: e.disabled,
165
+ title: e.title,
166
+ onClick: r
167
+ }, [y(t.$slots, "default", {}, void 0, !0)], 10, oe));
168
+ }
169
+ }), [["__scopeId", "data-v-10d293e2"]]), se = {
170
+ bold: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z\" fill=\"currentColor\"></path>",
171
+ italic: "<path d=\"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z\" fill=\"currentColor\"></path>",
172
+ heading1: "<path d=\"M4 5v14h2v-6h6v6h2V5h-2v5H6V5H4zm14 2.5V19h-2v-8.3l-1.8 1-.6-1.6 3.6-2h.8z\" />",
173
+ heading2: "<path d=\"M4 5v14h2v-6h6v6h2V5h-2v5H6V5H4zm13.3 9c.7-.7 1.4-1.4 2-2.1.8-.9 1.4-1.9 1.4-3 0-1.9-1.5-3.4-3.4-3.4-1.6 0-2.9 1.1-3.3 2.6l1.9.5c.2-.7.8-1.2 1.4-1.2.8 0 1.5.7 1.5 1.5 0 .6-.3 1.1-.8 1.6-.7.7-1.4 1.4-2.1 2.1L14 15.1V19h7v-2h-3.7l1-1z\" />",
174
+ heading3: "<path d=\"M4 5v14h2v-6h6v6h2V5h-2v5H6V5H4zm13.3 9c.7-.7 1.4-1.4 2-2.1.8-.9 1.4-1.9 1.4-3 0-1.9-1.5-3.4-3.4-3.4-1.6 0-2.9 1.1-3.3 2.6l1.9.5c.2-.7.8-1.2 1.4-1.2.8 0 1.5.7 1.5 1.5 0 .6-.3 1.1-.8 1.6-.7.7-1.4 1.4-2.1 2.1L14 15.1V19h7v-2h-3.7l1-1z\" />",
175
+ bulletList: "\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z\" fill=\"currentColor\"></path>\n ",
176
+ orderedList: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z\" fill=\"currentColor\"></path>",
177
+ blockquote: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 6C8 5.44772 8.44772 5 9 5H16C16.5523 5 17 5.44772 17 6C17 6.55228 16.5523 7 16 7H9C8.44772 7 8 6.55228 8 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 3C4.55228 3 5 3.44772 5 4L5 20C5 20.5523 4.55229 21 4 21C3.44772 21 3 20.5523 3 20L3 4C3 3.44772 3.44772 3 4 3Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 12C8 11.4477 8.44772 11 9 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H9C8.44772 13 8 12.5523 8 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 18C8 17.4477 8.44772 17 9 17H16C16.5523 17 17 17.4477 17 18C17 18.5523 16.5523 19 16 19H9C8.44772 19 8 18.5523 8 18Z\" fill=\"currentColor\"></path>",
178
+ codeBlock: "<path d=\"M8 5v14l11-7zM4 19h2V5H4v14z\" />",
179
+ codeBlockAlt: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.70711 2.29289C7.09763 2.68342 7.09763 3.31658 6.70711 3.70711L4.41421 6L6.70711 8.29289C7.09763 8.68342 7.09763 9.31658 6.70711 9.70711C6.31658 10.0976 5.68342 10.0976 5.29289 9.70711L2.29289 6.70711C1.90237 6.31658 1.90237 5.68342 2.29289 5.29289L5.29289 2.29289C5.68342 1.90237 6.31658 1.90237 6.70711 2.29289Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.2929 2.29289C10.6834 1.90237 11.3166 1.90237 11.7071 2.29289L14.7071 5.29289C15.0976 5.68342 15.0976 6.31658 14.7071 6.70711L11.7071 9.70711C11.3166 10.0976 10.6834 10.0976 10.2929 9.70711C9.90237 9.31658 9.90237 8.68342 10.2929 8.29289L12.5858 6L10.2929 3.70711C9.90237 3.31658 9.90237 2.68342 10.2929 2.29289Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17 4C17 3.44772 17.4477 3 18 3H19C20.6569 3 22 4.34315 22 6V18C22 19.6569 20.6569 21 19 21H5C3.34315 21 2 19.6569 2 18V12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12V18C4 18.5523 4.44772 19 5 19H19C19.5523 19 20 18.5523 20 18V6C20 5.44772 19.5523 5 19 5H18C17.4477 5 17 4.55228 17 4Z\" fill=\"currentColor\"></path>",
180
+ horizontalRule: "\n <rect x=\"8\" y=\"4\" width=\"8\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.7\" />\n\n <rect x=\"3\" y=\"11.25\" width=\"18\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" />\n\n <rect x=\"8\" y=\"18.5\" width=\"8\" height=\"1.5\" rx=\"0.75\" fill=\"currentColor\" opacity=\"0.7\" />\n ",
181
+ strike: "<path d=\"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z\" fill=\"currentColor\"></path><path d=\"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z\" fill=\"currentColor\"></path>",
182
+ code: "<path d=\"M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z\" fill=\"currentColor\"></path><path d=\"M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z\" fill=\"currentColor\"></path><path d=\"M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z\" fill=\"currentColor\"></path>",
183
+ undo: "<path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\" />",
184
+ redo: "<path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22l2.37.78c1.05-3.19 4.06-5.5 7.59-5.5 1.96 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\" />",
185
+ link: "<path d=\"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669ZM10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z\" />",
186
+ image: "\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20 2C20 1.44772 19.5523 1 19 1C18.4477 1 18 1.44772 18 2V4H16C15.4477 4 15 4.44772 15 5C15 5.55228 15.4477 6 16 6H18V8C18 8.55228 18.4477 9 19 9C19.5523 9 20 8.55228 20 8V6H22C22.5523 6 23 5.55228 23 5C23 4.44772 22.5523 4 22 4H20V2ZM5 4C4.73478 4 4.48043 4.10536 4.29289 4.29289C4.10536 4.48043 4 4.73478 4 5V19C4 19.2652 4.10536 19.5196 4.29289 19.7071C4.48043 19.8946 4.73478 20 5 20H5.58579L14.379 11.2068C14.9416 10.6444 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V12C20 11.4477 20.4477 11 21 11C21.5523 11 22 11.4477 22 12V14.998C22 14.9994 22 15.0007 22 15.002V19C22 19.7957 21.6839 20.5587 21.1213 21.1213C20.5587 21.6839 19.7957 22 19 22H6.00219C6.00073 22 5.99927 22 5.99781 22H5C4.20435 22 3.44129 21.6839 2.87868 21.1213C2.31607 20.5587 2 19.7957 2 19V5C2 4.20435 2.31607 3.44129 2.87868 2.87868C3.44129 2.31607 4.20435 2 5 2H12C12.5523 2 13 2.44772 13 3C13 3.55228 12.5523 4 12 4H5ZM8.41422 20H19C19.2652 20 19.5196 19.8946 19.7071 19.7071C19.8946 19.5196 20 19.2652 20 19V15.4142L17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211L8.41422 20ZM6.87868 6.87868C7.44129 6.31607 8.20435 6 9 6C9.79565 6 10.5587 6.31607 11.1213 6.87868C11.6839 7.44129 12 8.20435 12 9C12 9.79565 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 12 9 12C8.20435 12 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79565 6 9C6 8.20435 6.31607 7.44129 6.87868 6.87868ZM9 8C8.73478 8 8.48043 8.10536 8.29289 8.29289C8.10536 8.48043 8 8.73478 8 9C8 9.26522 8.10536 9.51957 8.29289 9.70711C8.48043 9.89464 8.73478 10 9 10C9.26522 10 9.51957 9.89464 9.70711 9.70711C9.89464 9.51957 10 9.26522 10 9C10 8.73478 9.89464 8.48043 9.70711 8.29289C9.51957 8.10536 9.26522 8 9 8Z\" fill=\"currentColor\"></path>\n ",
187
+ alignLeft: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z\" fill=\"currentColor\"></path>",
188
+ alignCenter: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z\" fill=\"currentColor\"></path>",
189
+ alignRight: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z\" fill=\"currentColor\"></path>",
190
+ alignJustify: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z\" fill=\"currentColor\"></path><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z\" fill=\"currentColor\"></path>"
191
+ }, ce = [
192
+ "width",
193
+ "height",
194
+ "fill",
195
+ "innerHTML"
196
+ ], Z = /* @__PURE__ */ K(/* @__PURE__ */ u({
197
+ __name: "SmoIcon",
198
+ props: {
199
+ name: {},
200
+ size: { default: 18 },
201
+ color: { default: "currentColor" }
202
+ },
203
+ setup(e) {
204
+ let t = e, n = r(() => se[t.name] || (console.warn(`[SmoIcon]: 图标 "${t.name}" 未在注册表中注册。`), ""));
205
+ return (t, r) => (g(), o("svg", {
206
+ xmlns: "http://www.w3.org/2000/svg",
207
+ viewBox: "0 0 24 24",
208
+ width: e.size,
209
+ height: e.size,
210
+ fill: e.color,
211
+ class: "smo-icon",
212
+ innerHTML: n.value
213
+ }, null, 8, ce));
214
+ }
215
+ }), [["__scopeId", "data-v-8230f5dd"]]), le = /* @__PURE__ */ u({
216
+ __name: "TextAlignButton",
217
+ props: { editor: {} },
218
+ setup(e) {
219
+ return (t, n) => (g(), i(Y, null, {
220
+ default: T(() => [
221
+ l(X, {
222
+ title: "左对齐",
223
+ active: e.editor.isActive({ textAlign: "left" }),
224
+ onClick: n[0] ||= (t) => e.editor.chain().focus().setTextAlign("left").run()
225
+ }, {
226
+ default: T(() => [l(Z, { name: "alignLeft" })]),
227
+ _: 1
228
+ }, 8, ["active"]),
229
+ l(X, {
230
+ title: "居中对齐",
231
+ active: e.editor.isActive({ textAlign: "center" }),
232
+ onClick: n[1] ||= (t) => e.editor.chain().focus().setTextAlign("center").run()
233
+ }, {
234
+ default: T(() => [l(Z, { name: "alignCenter" })]),
235
+ _: 1
236
+ }, 8, ["active"]),
237
+ l(X, {
238
+ title: "右对齐",
239
+ active: e.editor.isActive({ textAlign: "right" }),
240
+ onClick: n[2] ||= (t) => e.editor.chain().focus().setTextAlign("right").run()
241
+ }, {
242
+ default: T(() => [l(Z, { name: "alignRight" })]),
243
+ _: 1
244
+ }, 8, ["active"]),
245
+ l(X, {
246
+ title: "两端对齐",
247
+ active: e.editor.isActive({ textAlign: "justify" }),
248
+ onClick: n[3] ||= (t) => e.editor.chain().focus().setTextAlign("justify").run()
249
+ }, {
250
+ default: T(() => [l(Z, { name: "alignJustify" })]),
251
+ _: 1
252
+ }, 8, ["active"])
253
+ ]),
254
+ _: 1
255
+ }));
256
+ }
257
+ }), ue = ["title"], de = { class: "smo-select-value" }, fe = {
258
+ key: 0,
259
+ class: "smo-select-dropdown"
260
+ }, pe = ["onClick"], me = {
261
+ key: 0,
262
+ class: "smo-option-check"
263
+ }, he = /* @__PURE__ */ K(/* @__PURE__ */ u({
264
+ __name: "ToolbarSelect",
265
+ props: {
266
+ modelValue: {},
267
+ options: {},
268
+ title: {}
269
+ },
270
+ emits: ["change"],
271
+ setup(t, { emit: i }) {
272
+ let u = t, d = i, p = _(!1), y = _(null), b = r(() => {
273
+ let e = u.options.find((e) => e.value === u.modelValue);
274
+ return e ? e.label : "";
275
+ }), S = () => {
276
+ p.value = !p.value;
277
+ }, C = (e) => {
278
+ d("change", e), p.value = !1;
279
+ }, w = (e) => {
280
+ y.value && !y.value.contains(e.target) && (p.value = !1);
281
+ };
282
+ return h(() => {
283
+ document.addEventListener("click", w);
284
+ }), m(() => {
285
+ document.removeEventListener("click", w);
286
+ }), (r, i) => (g(), o("div", {
287
+ ref_key: "selectRef",
288
+ ref: y,
289
+ class: "smo-custom-select",
290
+ title: t.title
291
+ }, [s("div", {
292
+ class: f(["smo-select-trigger", { "is-active": p.value }]),
293
+ onClick: S
294
+ }, [s("span", de, x(b.value), 1), s("span", { class: f(["smo-select-arrow", { "is-rotated": p.value }]) }, "▼", 2)], 2), l(n, { name: "smo-fade" }, {
295
+ default: T(() => [p.value ? (g(), o("div", fe, [(g(!0), o(e, null, v(t.options, (e) => (g(), o("div", {
296
+ key: e.value,
297
+ class: f(["smo-select-option", {
298
+ "is-selected": e.value === t.modelValue,
299
+ "opt-h1": e.value === 1,
300
+ "opt-h2": e.value === 2,
301
+ "opt-h3": e.value === 3,
302
+ "opt-h4": e.value === 4
303
+ }]),
304
+ onClick: (t) => C(e.value)
305
+ }, [c(x(e.label) + " ", 1), e.value === t.modelValue ? (g(), o("span", me, "✓")) : a("", !0)], 10, pe))), 128))])) : a("", !0)]),
306
+ _: 1
307
+ })], 8, ue));
308
+ }
309
+ }), [["__scopeId", "data-v-0b16f052"]]), ge = (e) => e ? e.chain().focus().toggleBold().run() : !1, _e = (e) => e ? e.isActive("bold") : !1, ve = (e, t) => e ? e.chain().focus().toggleHeading({ level: t }).run() : !1, ye = (e) => {
310
+ if (!e) return 0;
311
+ for (let t = 1; t <= 6; t++) if (e.isActive("heading", { level: t })) return t;
312
+ return 0;
313
+ }, be = (e) => e ? e.chain().focus().toggleItalic().run() : !1, xe = (e) => e ? e.isActive("italic") : !1, Se = (e) => e ? e.chain().focus().toggleBulletList().run() : !1, Ce = (e) => e ? e.isActive("bulletList") : !1, we = (e) => e ? e.chain().focus().toggleOrderedList().run() : !1, Te = (e) => e ? e.isActive("orderedList") : !1, Ee = (e) => e ? e.chain().focus().toggleBlockquote().run() : !1, De = (e) => e ? e.isActive("blockquote") : !1, Oe = (e) => e ? e.chain().focus().toggleCodeBlock().run() : !1, ke = (e) => e ? e.isActive("codeBlock") : !1, Ae = (e) => e ? e.chain().focus().setHorizontalRule().run() : !1, je = (e) => e ? e.chain().focus().toggleStrike().run() : !1, Me = (e) => e ? e.isActive("strike") : !1, Ne = (e) => e ? e.chain().focus().toggleCode().run() : !1, Pe = (e) => e ? e.isActive("code") : !1, Fe = (e) => e ? e.chain().focus().undo().run() : !1, Ie = (e) => e ? e.can().undo() : !1, Le = (e) => e ? e.chain().focus().redo().run() : !1, Re = (e) => e ? e.can().redo() : !1, Q = (e) => e ? e.isActive("link") : !1, ze = (e) => e && e.getAttributes("link").href || "", Be = (e) => e ? e.chain().focus().extendMarkRange("link").unsetLink().run() : !1, Ve = { class: "smo-link-setter" }, He = { class: "smo-popover-field" }, Ue = { class: "smo-popover-field" }, We = { class: "smo-link-actions" }, $ = /* @__PURE__ */ K(/* @__PURE__ */ u({
314
+ __name: "LinkSetter",
315
+ props: { editor: {} },
316
+ setup(e) {
317
+ let n = e, r = _(!1), c = _(""), u = _(""), f = _({
318
+ top: "0px",
319
+ left: "0px"
320
+ }), h = {
321
+ from: 0,
322
+ to: 0
323
+ }, v = () => {
324
+ if (!n.editor || !r.value) return;
325
+ let { view: e } = n.editor, { from: t, to: i } = e.state.selection;
326
+ try {
327
+ let n = e.coordsAtPos(t), r = e.coordsAtPos(i), a = (n.left + r.left) / 2;
328
+ f.value = {
329
+ top: `${n.top - 10 + window.scrollY}px`,
330
+ left: `${a + window.scrollX}px`
331
+ };
332
+ } catch (e) {
333
+ console.log(e);
334
+ }
335
+ }, y = () => {
336
+ let { from: e, to: t } = n.editor.state.selection;
337
+ h = {
338
+ from: e,
339
+ to: t
340
+ }, c.value = Q(n.editor) ? ze(n.editor) : "", e === t ? u.value = Q(n.editor) ? "链接文本" : "" : u.value = n.editor.state.doc.textBetween(e, t, " ");
341
+ };
342
+ w(() => n.editor?.state.selection, () => {
343
+ n.editor && (Q(n.editor) ? (y(), r.value = !0, d(v)) : r.value && !Q(n.editor) && h.from === h.to && k());
344
+ }, { deep: !0 });
345
+ let b = async () => {
346
+ if (r.value) {
347
+ k();
348
+ return;
349
+ }
350
+ y(), u.value ||= "新链接", r.value = !0, await d(), v();
351
+ }, x = () => {
352
+ if (!n.editor) return;
353
+ let { from: e, to: t } = h, r = u.value || c.value;
354
+ n.editor.chain().focus().insertContentAt({
355
+ from: e,
356
+ to: t
357
+ }, {
358
+ type: "text",
359
+ text: r,
360
+ marks: [{
361
+ type: "link",
362
+ attrs: {
363
+ href: c.value,
364
+ target: "_blank"
365
+ }
366
+ }]
367
+ }).run();
368
+ let i = n.editor.state.selection.to;
369
+ n.editor.chain().setTextSelection(i).unsetMark("link").run(), k();
370
+ }, O = () => {
371
+ n.editor.chain().focus().setTextSelection(h).run(), Be(n.editor), k();
372
+ }, k = () => {
373
+ r.value = !1, c.value = "", u.value = "";
374
+ };
375
+ return typeof window < "u" && (window.addEventListener("scroll", v, !0), window.addEventListener("resize", v)), m(() => {
376
+ typeof window < "u" && (window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v));
377
+ }), (n, d) => (g(), o("div", Ve, [l(X, {
378
+ active: S(Q)(e.editor) || r.value,
379
+ title: "超链接",
380
+ onClick: b
381
+ }, {
382
+ default: T(() => [l(Z, {
383
+ name: "link",
384
+ size: "16"
385
+ })]),
386
+ _: 1
387
+ }, 8, ["active"]), (g(), i(t, { to: "body" }, [r.value ? (g(), o("div", {
388
+ key: 0,
389
+ class: "smo-link-popover-fixed",
390
+ style: p(f.value),
391
+ onMousedown: d[2] ||= D(() => {}, ["stop"])
392
+ }, [
393
+ s("div", He, [d[3] ||= s("span", { class: "smo-field-label" }, "文本:", -1), E(s("input", {
394
+ "onUpdate:modelValue": d[0] ||= (e) => u.value = e,
395
+ type: "text",
396
+ class: "smo-link-input",
397
+ placeholder: "显示的文字"
398
+ }, null, 512), [[C, u.value]])]),
399
+ s("div", Ue, [d[4] ||= s("span", { class: "smo-field-label" }, "链接:", -1), E(s("input", {
400
+ "onUpdate:modelValue": d[1] ||= (e) => c.value = e,
401
+ type: "text",
402
+ class: "smo-link-input",
403
+ placeholder: "https://...",
404
+ onKeyup: ee(x, ["enter"])
405
+ }, null, 544), [[C, c.value]])]),
406
+ s("div", We, [
407
+ s("button", {
408
+ class: "smo-popover-btn primary",
409
+ onClick: x
410
+ }, "确定"),
411
+ S(Q)(e.editor) ? (g(), o("button", {
412
+ key: 0,
413
+ class: "smo-popover-btn danger",
414
+ onClick: O
415
+ }, " 删除 ")) : a("", !0),
416
+ s("button", {
417
+ class: "smo-popover-btn",
418
+ onClick: k
419
+ }, "取消")
420
+ ])
421
+ ], 36)) : a("", !0)]))]));
422
+ }
423
+ }), [["__scopeId", "data-v-77dc2707"]]), Ge = { class: "smo-image-setter" }, Ke = { class: "bubble-menu" }, qe = { class: "form-item" }, Je = { class: "form-item" }, Ye = { class: "form-item" }, Xe = /* @__PURE__ */ K(/* @__PURE__ */ u({
424
+ __name: "ImageButton",
425
+ props: { editor: {} },
426
+ setup(t) {
427
+ let n = t, r = _(null);
428
+ h(() => {
429
+ n.editor?.on("selectionUpdate", u);
430
+ }), m(() => {
431
+ n.editor?.off("selectionUpdate", u);
432
+ });
433
+ let u = () => {
434
+ n.editor?.isActive("image") && (p.value = n.editor.getAttributes("image").alt || "");
435
+ }, d = (e) => {
436
+ let t = e.target;
437
+ if (t.files?.length) {
438
+ let e = Array.from(t.files);
439
+ B(n.editor, e), t.value = "";
440
+ }
441
+ }, f = () => n.editor.isActive("image"), p = _(""), v = _(null), y = () => {
442
+ v.value && clearTimeout(v.value), v.value = setTimeout(() => {
443
+ L(n.editor, { alt: p.value });
444
+ }, 500);
445
+ };
446
+ return (n, u) => (g(), o(e, null, [s("div", Ge, [s("input", {
447
+ ref_key: "fileInput",
448
+ ref: r,
449
+ type: "file",
450
+ accept: "image/*",
451
+ multiple: "",
452
+ hidden: "",
453
+ onChange: d
454
+ }, null, 544), l(X, {
455
+ title: "图片",
456
+ onClick: u[0] ||= (e) => r.value?.click()
457
+ }, {
458
+ default: T(() => [l(Z, {
459
+ name: "image",
460
+ size: "16"
461
+ })]),
462
+ _: 1
463
+ })]), t.editor ? (g(), i(S(re), {
464
+ key: 0,
465
+ class: "smo-image-bubble-menu",
466
+ editor: t.editor,
467
+ "should-show": f,
468
+ "tippy-options": {
469
+ duration: 100,
470
+ interactive: !0
471
+ }
472
+ }, {
473
+ default: T(() => [s("div", Ke, [
474
+ s("div", qe, [u[9] ||= s("label", null, "对齐方式", -1), l(Y, { class: "align-group" }, {
475
+ default: T(() => [
476
+ l(X, {
477
+ active: S(P)(t.editor, "left"),
478
+ title: "居左对齐",
479
+ onClick: u[1] ||= (e) => S(R)(t.editor, "left")
480
+ }, {
481
+ default: T(() => [l(Z, {
482
+ name: "alignLeft",
483
+ size: "16"
484
+ })]),
485
+ _: 1
486
+ }, 8, ["active"]),
487
+ l(X, {
488
+ active: S(P)(t.editor, "center"),
489
+ title: "居中对齐",
490
+ onClick: u[2] ||= (e) => S(R)(t.editor, "center")
491
+ }, {
492
+ default: T(() => [l(Z, {
493
+ name: "alignCenter",
494
+ size: "16"
495
+ })]),
496
+ _: 1
497
+ }, 8, ["active"]),
498
+ l(X, {
499
+ active: S(P)(t.editor, "right"),
500
+ title: "居右对齐",
501
+ onClick: u[3] ||= (e) => S(R)(t.editor, "right")
502
+ }, {
503
+ default: T(() => [l(Z, {
504
+ name: "alignRight",
505
+ size: "16"
506
+ })]),
507
+ _: 1
508
+ }, 8, ["active"])
509
+ ]),
510
+ _: 1
511
+ })]),
512
+ s("div", Je, [u[14] ||= s("label", null, "图片宽度", -1), l(Y, { class: "align-group" }, {
513
+ default: T(() => [
514
+ l(X, {
515
+ active: S(F)(t.editor, "100%"),
516
+ title: "宽度100%",
517
+ onClick: u[4] ||= (e) => S(I)(t.editor, "100%")
518
+ }, {
519
+ default: T(() => [...u[10] ||= [c("100%", -1)]]),
520
+ _: 1
521
+ }, 8, ["active"]),
522
+ l(X, {
523
+ active: S(F)(t.editor, "75%"),
524
+ title: "宽度75%",
525
+ onClick: u[5] ||= (e) => S(I)(t.editor, "75%")
526
+ }, {
527
+ default: T(() => [...u[11] ||= [c("75%", -1)]]),
528
+ _: 1
529
+ }, 8, ["active"]),
530
+ l(X, {
531
+ active: S(F)(t.editor, "50%"),
532
+ title: "宽度50%",
533
+ onClick: u[6] ||= (e) => S(I)(t.editor, "50%")
534
+ }, {
535
+ default: T(() => [...u[12] ||= [c("50%", -1)]]),
536
+ _: 1
537
+ }, 8, ["active"]),
538
+ l(X, {
539
+ active: S(F)(t.editor, "25%"),
540
+ title: "宽度25%",
541
+ onClick: u[7] ||= (e) => S(I)(t.editor, "25%")
542
+ }, {
543
+ default: T(() => [...u[13] ||= [c("25%", -1)]]),
544
+ _: 1
545
+ }, 8, ["active"])
546
+ ]),
547
+ _: 1
548
+ })]),
549
+ s("div", Ye, [u[15] ||= s("label", null, "图片描述", -1), E(s("input", {
550
+ "onUpdate:modelValue": u[8] ||= (e) => p.value = e,
551
+ onInput: y,
552
+ type: "text",
553
+ placeholder: "请输入图片alt描述"
554
+ }, null, 544), [[C, p.value]])])
555
+ ])]),
556
+ _: 1
557
+ }, 8, ["editor"])) : a("", !0)], 64));
558
+ }
559
+ }), [["__scopeId", "data-v-3b921f1f"]]), Ze = {
560
+ key: 0,
561
+ class: "smo-toolbar"
562
+ }, Qe = /* @__PURE__ */ u({
563
+ __name: "Toolbar",
564
+ props: { editor: {} },
565
+ setup(e) {
566
+ let t = e, n = [
567
+ {
568
+ label: "正文",
569
+ value: 0
570
+ },
571
+ {
572
+ label: "H1",
573
+ value: 1
574
+ },
575
+ {
576
+ label: "H2",
577
+ value: 2
578
+ },
579
+ {
580
+ label: "H3",
581
+ value: 3
582
+ },
583
+ {
584
+ label: "H4",
585
+ value: 4
586
+ },
587
+ {
588
+ label: "H5",
589
+ value: 5
590
+ },
591
+ {
592
+ label: "H6",
593
+ value: 6
594
+ }
595
+ ], i = r(() => ye(t.editor)), s = (e) => {
596
+ t.editor && (e === 0 ? t.editor.chain().focus().setParagraph().run() : ve(t.editor, e));
597
+ };
598
+ return (t, r) => e.editor ? (g(), o("div", Ze, [
599
+ l(Y, null, {
600
+ default: T(() => [l(X, {
601
+ disabled: !S(Ie)(e.editor),
602
+ title: "撤销",
603
+ onClick: r[0] ||= (t) => S(Fe)(e.editor)
604
+ }, {
605
+ default: T(() => [l(Z, { name: "undo" })]),
606
+ _: 1
607
+ }, 8, ["disabled"]), l(X, {
608
+ disabled: !S(Re)(e.editor),
609
+ title: "重做",
610
+ onClick: r[1] ||= (t) => S(Le)(e.editor)
611
+ }, {
612
+ default: T(() => [l(Z, { name: "redo" })]),
613
+ _: 1
614
+ }, 8, ["disabled"])]),
615
+ _: 1
616
+ }),
617
+ l(Y, null, {
618
+ default: T(() => [l(he, {
619
+ "model-value": i.value,
620
+ options: n,
621
+ title: "文本层级",
622
+ onChange: s
623
+ }, null, 8, ["model-value"])]),
624
+ _: 1
625
+ }),
626
+ l(le, { editor: e.editor }, null, 8, ["editor"]),
627
+ l(Y, null, {
628
+ default: T(() => [
629
+ l(X, {
630
+ active: S(_e)(e.editor),
631
+ title: "加粗",
632
+ onClick: r[2] ||= (t) => S(ge)(e.editor)
633
+ }, {
634
+ default: T(() => [l(Z, { name: "bold" })]),
635
+ _: 1
636
+ }, 8, ["active"]),
637
+ l(X, {
638
+ active: S(xe)(e.editor),
639
+ title: "斜体",
640
+ onClick: r[3] ||= (t) => S(be)(e.editor)
641
+ }, {
642
+ default: T(() => [l(Z, { name: "italic" })]),
643
+ _: 1
644
+ }, 8, ["active"]),
645
+ l(X, {
646
+ active: S(Me)(e.editor),
647
+ title: "删除线",
648
+ onClick: r[4] ||= (t) => S(je)(e.editor)
649
+ }, {
650
+ default: T(() => [l(Z, { name: "strike" })]),
651
+ _: 1
652
+ }, 8, ["active"]),
653
+ l(X, {
654
+ active: S(Pe)(e.editor),
655
+ title: "行内代码",
656
+ onClick: r[5] ||= (t) => S(Ne)(e.editor)
657
+ }, {
658
+ default: T(() => [l(Z, { name: "code" })]),
659
+ _: 1
660
+ }, 8, ["active"]),
661
+ l($, { editor: e.editor }, null, 8, ["editor"])
662
+ ]),
663
+ _: 1
664
+ }),
665
+ l(Y, null, {
666
+ default: T(() => [l(X, {
667
+ active: S(Ce)(e.editor),
668
+ title: "无序列表",
669
+ onClick: r[6] ||= (t) => S(Se)(e.editor)
670
+ }, {
671
+ default: T(() => [l(Z, { name: "bulletList" })]),
672
+ _: 1
673
+ }, 8, ["active"]), l(X, {
674
+ active: S(Te)(e.editor),
675
+ title: "有序列表",
676
+ onClick: r[7] ||= (t) => S(we)(e.editor)
677
+ }, {
678
+ default: T(() => [l(Z, { name: "orderedList" })]),
679
+ _: 1
680
+ }, 8, ["active"])]),
681
+ _: 1
682
+ }),
683
+ l(Y, null, {
684
+ default: T(() => [
685
+ l(X, {
686
+ active: S(De)(e.editor),
687
+ title: "引用区块",
688
+ onClick: r[8] ||= (t) => S(Ee)(e.editor)
689
+ }, {
690
+ default: T(() => [l(Z, { name: "blockquote" })]),
691
+ _: 1
692
+ }, 8, ["active"]),
693
+ l(X, {
694
+ active: S(ke)(e.editor),
695
+ title: "代码块",
696
+ onClick: r[9] ||= (t) => S(Oe)(e.editor)
697
+ }, {
698
+ default: T(() => [l(Z, { name: "codeBlockAlt" })]),
699
+ _: 1
700
+ }, 8, ["active"]),
701
+ l(X, {
702
+ title: "分割线",
703
+ onClick: r[10] ||= (t) => S(Ae)(e.editor)
704
+ }, {
705
+ default: T(() => [l(Z, { name: "horizontalRule" })]),
706
+ _: 1
707
+ }),
708
+ l(Xe, { editor: e.editor }, null, 8, ["editor"])
709
+ ]),
710
+ _: 1
711
+ })
712
+ ])) : a("", !0);
713
+ }
714
+ }), $e = { class: "smo-editor-container" }, et = /* @__PURE__ */ u({
715
+ __name: "SmoEditor",
716
+ props: {
717
+ modelValue: { default: "" },
718
+ editable: {
719
+ type: Boolean,
720
+ default: !0
721
+ },
722
+ placeholder: { default: "" },
723
+ onImageUpload: {}
724
+ },
725
+ emits: ["update:modelValue"],
726
+ setup(e, { emit: t }) {
727
+ let n = e, r = t, i = b(null);
728
+ return h(() => {
729
+ i.value = U({
730
+ content: n.modelValue,
731
+ editable: n.editable,
732
+ placeholder: n.placeholder,
733
+ onImageUpload: n.onImageUpload
734
+ }), i.value.on("update", () => {
735
+ i.value && r("update:modelValue", i.value.getHTML());
736
+ });
737
+ }), w(() => n.modelValue, (e) => {
738
+ i.value && i.value.getHTML() !== e && i.value.commands.setContent(e, { emitUpdate: !1 });
739
+ }), m(() => {
740
+ i.value &&= (i.value.destroy(), null);
741
+ }), (e, t) => (g(), o("div", $e, [l(Qe, { editor: i.value }, null, 8, ["editor"]), l(q, { editor: i.value }, null, 8, ["editor"])]));
742
+ }
743
+ });
744
+ //#endregion
745
+ export { et as SmoEditor };
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@sanmokeji/smo-editor",
3
+ "version": "0.0.2",
4
+ "main": "./dist/smo-editor.js",
5
+ "module": "./dist/smo-editor.js",
6
+ "types": "./dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/smo-editor.js",
12
+ "default": "./dist/smo-editor.js"
13
+ },
14
+ "./dist/smo-editor.css": "./dist/smo-editor.css"
15
+ },
16
+ "description": "基于 Tiptap + Vue 3 的富文本编辑器组件。",
17
+ "keywords": [
18
+ "vue3",
19
+ "tiptap",
20
+ "editor",
21
+ "rich-text",
22
+ "wysiwyg",
23
+ "富文本编辑器",
24
+ "markdown"
25
+ ],
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "sideEffects": [
30
+ "*.css"
31
+ ],
32
+ "license": "MIT",
33
+ "peerDependencies": {
34
+ "@tiptap/vue-3": "^3.0.0",
35
+ "vue": "^3.0.0"
36
+ },
37
+ "dependencies": {
38
+ "@tiptap/extension-file-handler": "^3.23.6",
39
+ "@tiptap/extension-image": "^3.23.6",
40
+ "@tiptap/extension-placeholder": "^3.23.6",
41
+ "@tiptap/extension-text-align": "^3.23.6",
42
+ "@tiptap/pm": "^3.23.6",
43
+ "@tiptap/starter-kit": "^3.23.6",
44
+ "@tiptap/vue-3": "^3.23.6",
45
+ "vue": "^3.5.32",
46
+ "vue-router": "^5.0.4"
47
+ },
48
+ "devDependencies": {
49
+ "@tsconfig/node24": "^24.0.4",
50
+ "@types/node": "^24.12.2",
51
+ "@vitejs/plugin-vue": "^6.0.6",
52
+ "@vue/eslint-config-typescript": "^14.7.0",
53
+ "@vue/tsconfig": "^0.9.1",
54
+ "eslint": "^10.2.1",
55
+ "eslint-config-prettier": "^10.1.8",
56
+ "eslint-plugin-oxlint": "~1.60.0",
57
+ "eslint-plugin-vue": "~10.8.0",
58
+ "jiti": "^2.6.1",
59
+ "npm-run-all2": "^8.0.4",
60
+ "oxlint": "~1.60.0",
61
+ "prettier": "3.8.3",
62
+ "sass-embedded": "^1.100.0",
63
+ "typescript": "~6.0.0",
64
+ "vite": "^8.0.8",
65
+ "vite-plugin-dts": "^4.5.4",
66
+ "vite-plugin-vue-devtools": "^8.1.1",
67
+ "vue-tsc": "^3.2.6"
68
+ },
69
+ "engines": {
70
+ "node": "^20.19.0 || >=22.12.0"
71
+ },
72
+ "scripts": {
73
+ "dev": "vite",
74
+ "build": "run-p type-check \"build-only {@}\" --",
75
+ "preview": "vite preview",
76
+ "build-only": "vite build && node scripts/build-dts.js",
77
+ "type-check": "vue-tsc --build",
78
+ "lint": "run-s lint:*",
79
+ "lint:oxlint": "oxlint . --fix",
80
+ "lint:eslint": "eslint . --fix --cache",
81
+ "format": "prettier --write --experimental-cli src/"
82
+ }
83
+ }