@kernel4632/kima 0.8.3 → 0.8.4
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/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_233308e5_lang.css +1 -0
- package/dist/components/content/{rich-text-editor.ce.vue_vue_type_style_index_0_scoped_19796b0b_lang.css → rich-text-editor.ce.vue_vue_type_style_index_0_scoped_82e3193e_lang.css} +1 -1
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +1 -0
- package/dist/components/input/{file-upload.ce.vue_vue_type_style_index_0_scoped_17268263_lang.css → file-upload.ce.vue_vue_type_style_index_0_scoped_1568bdab_lang.css} +1 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +1 -0
- package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_37292ba0_lang.css +1 -0
- package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_f50127b6_lang.css +1 -0
- package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_f5be4658_lang.css +1 -0
- package/dist/kima-elements.js +46764 -46407
- package/dist/kima.js +21 -21
- package/dist/style.css +8 -8
- package/dist/styles/app-shell.css +3 -2
- package/dist/styles/carousel.css +4 -2
- package/dist/styles/code-editor.css +4 -2
- package/dist/styles/dynamic-input.css +4 -1
- package/dist/styles/file-upload.css +4 -2
- package/dist/styles/log-viewer.css +4 -2
- package/dist/styles/rich-text-editor.css +4 -1
- package/dist/styles/sidebar.css +4 -2
- package/dist/styles/upload-manager.css +4 -1
- package/dist/vue/components/content/code-editor.ce.js +98 -93
- package/dist/vue/components/content/rich-text-editor.ce.js +148 -121
- package/dist/vue/components/core/code-block.ce.js +6 -6
- package/dist/vue/components/form-completion/dynamic-input.ce.js +97 -91
- package/dist/vue/components/input/file-upload.ce.js +74 -68
- package/dist/vue/components/navigation/carousel.ce.js +71 -59
- package/dist/vue/components/shell/app-shell.ce.js +49 -38
- package/dist/vue/components/shell/sidebar.ce.js +63 -52
- package/dist/vue/components/utility/log-viewer.ce.js +81 -64
- package/package.json +1 -1
- package/dist/components/content/code-editor.ce.vue_vue_type_style_index_0_scoped_a61ccf64_lang.css +0 -1
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_97d6f5bf_lang.css +0 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_c082836f_lang.css +0 -1
- package/dist/components/shell/app-shell.ce.vue_vue_type_style_index_0_scoped_abea9686_lang.css +0 -1
- package/dist/components/shell/sidebar.ce.vue_vue_type_style_index_0_scoped_0fd95ccf_lang.css +0 -1
- package/dist/components/utility/log-viewer.ce.vue_vue_type_style_index_0_scoped_2bf26869_lang.css +0 -1
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "../core/button.ce.js";
|
|
3
3
|
import { presenceTransition as n } from "../../utils/motion.js";
|
|
4
|
-
import
|
|
4
|
+
import r from "../core/icon-button.ce.js";
|
|
5
|
+
import i from "../core/tooltip.ce.js";
|
|
6
|
+
import { contentSelection as a, safeContentUrl as o, sanitizeContent as s, useContentState as c } from "../../utils/content.js";
|
|
5
7
|
/* empty css */
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import { Fragment as ee, Transition as l, computed as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, mergeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as g, ref as _, renderList as ie, shallowRef as ae, toDisplayString as v, unref as y, vModelText as oe, watch as b, withCtx as x, withDirectives as se, withKeys as S, withModifiers as C } from "vue";
|
|
9
|
+
import { Heading02Icon as w, LeftToRightListBulletIcon as ce, LeftToRightListNumberIcon as le, Link01Icon as ue, RedoIcon as de, TextBoldIcon as fe, TextItalicIcon as pe, UndoIcon as T } from "@hugeicons/core-free-icons";
|
|
10
|
+
import { Editor as me } from "@tiptap/core";
|
|
11
|
+
import he from "@tiptap/starter-kit";
|
|
12
|
+
import ge from "@tiptap/extension-placeholder";
|
|
10
13
|
// src/components/content/rich-text-editor.ce.vue
|
|
11
|
-
var
|
|
14
|
+
var _e = ["aria-disabled"], ve = {
|
|
12
15
|
class: "kima-rich-text-editor__toolbar",
|
|
13
16
|
role: "toolbar",
|
|
14
17
|
"aria-label": "文本格式"
|
|
15
|
-
},
|
|
18
|
+
}, ye = {
|
|
16
19
|
key: 0,
|
|
17
20
|
class: "kima-rich-text-editor__link"
|
|
18
|
-
},
|
|
21
|
+
}, be = ["disabled", "onKeydown"], xe = {
|
|
19
22
|
key: 0,
|
|
20
23
|
role: "alert"
|
|
21
|
-
},
|
|
24
|
+
}, Se = ["innerHTML"], E = {
|
|
22
25
|
class: "kima-rich-text-editor__selection",
|
|
23
26
|
"aria-live": "off"
|
|
24
|
-
},
|
|
27
|
+
}, D = [
|
|
25
28
|
"name",
|
|
26
29
|
"form",
|
|
27
30
|
"value",
|
|
28
31
|
"disabled"
|
|
29
|
-
],
|
|
32
|
+
], O = /*#__PURE__*/ e({
|
|
30
33
|
__name: "rich-text-editor.ce",
|
|
31
34
|
props: {
|
|
32
35
|
modelValue: {
|
|
@@ -52,25 +55,51 @@ var O = ["aria-disabled"], k = {
|
|
|
52
55
|
"change",
|
|
53
56
|
"selection-change"
|
|
54
57
|
],
|
|
55
|
-
setup(e, { expose:
|
|
56
|
-
let
|
|
58
|
+
setup(e, { expose: O, emit: k }) {
|
|
59
|
+
let A = [
|
|
60
|
+
{
|
|
61
|
+
type: "bold",
|
|
62
|
+
label: "粗体",
|
|
63
|
+
icon: fe
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "italic",
|
|
67
|
+
label: "斜体",
|
|
68
|
+
icon: pe
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "heading",
|
|
72
|
+
label: "标题",
|
|
73
|
+
icon: w
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "bulletList",
|
|
77
|
+
label: "无序列表",
|
|
78
|
+
icon: ce
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "orderedList",
|
|
82
|
+
label: "有序列表",
|
|
83
|
+
icon: le
|
|
84
|
+
}
|
|
85
|
+
], j = e, M = k, N = _(null), P = _(null), F = _(null), I = ae(null), L = _(0), R = _(!1), z = _(""), B = _(""), V = null, H = null, U = !1, { local: W, update: Ce } = c(j, M, N, s, () => X()), G = u(() => !j.disabled && !j.readonly), K = u(() => (L.value, I.value ? a(I.value) : {
|
|
57
86
|
from: 0,
|
|
58
87
|
to: 0,
|
|
59
88
|
empty: !0,
|
|
60
89
|
text: ""
|
|
61
|
-
})),
|
|
90
|
+
})), we = u(() => (L.value, I.value ? I.value.isEmpty : !W.value.replace(/<[^>]*>/g, "").trim())), q = (e) => (L.value, I.value?.isActive(e) ?? !1), Te = u(() => (L.value, G.value && !!I.value?.can().undo())), Ee = u(() => (L.value, G.value && !!I.value?.can().redo()));
|
|
62
91
|
function J() {
|
|
63
|
-
F.value?.setCustomValidity(j.required &&
|
|
92
|
+
F.value?.setCustomValidity(j.required && we.value ? "请填写内容" : "");
|
|
64
93
|
}
|
|
65
94
|
function Y() {
|
|
66
|
-
L.value++, I.value && M("selection-change",
|
|
95
|
+
L.value++, I.value && M("selection-change", a(I.value)), J();
|
|
67
96
|
}
|
|
68
97
|
function X() {
|
|
69
|
-
P.value && (I.value?.destroy(), I.value = new
|
|
98
|
+
P.value && (I.value?.destroy(), I.value = new me({
|
|
70
99
|
element: P.value,
|
|
71
|
-
content:
|
|
100
|
+
content: s(W.value),
|
|
72
101
|
editable: G.value,
|
|
73
|
-
extensions: [
|
|
102
|
+
extensions: [he.configure({
|
|
74
103
|
heading: { levels: [
|
|
75
104
|
1,
|
|
76
105
|
2,
|
|
@@ -80,13 +109,13 @@ var O = ["aria-disabled"], k = {
|
|
|
80
109
|
openOnClick: !1,
|
|
81
110
|
autolink: !1,
|
|
82
111
|
linkOnPaste: !1,
|
|
83
|
-
isAllowedUri: (e) =>
|
|
112
|
+
isAllowedUri: (e) => o(e),
|
|
84
113
|
HTMLAttributes: {
|
|
85
114
|
target: null,
|
|
86
115
|
rel: "noopener noreferrer nofollow"
|
|
87
116
|
}
|
|
88
117
|
}
|
|
89
|
-
}),
|
|
118
|
+
}), ge.configure({ placeholder: () => j.placeholder })],
|
|
90
119
|
editorProps: {
|
|
91
120
|
attributes: {
|
|
92
121
|
role: "textbox",
|
|
@@ -96,7 +125,7 @@ var O = ["aria-disabled"], k = {
|
|
|
96
125
|
"aria-disabled": String(j.disabled),
|
|
97
126
|
tabindex: j.disabled ? "-1" : "0"
|
|
98
127
|
},
|
|
99
|
-
transformPastedHTML:
|
|
128
|
+
transformPastedHTML: s,
|
|
100
129
|
handleDOMEvents: {
|
|
101
130
|
focus: () => (U = !0, !1),
|
|
102
131
|
blur: () => (setTimeout(() => {
|
|
@@ -111,32 +140,32 @@ var O = ["aria-disabled"], k = {
|
|
|
111
140
|
}
|
|
112
141
|
},
|
|
113
142
|
onUpdate: ({ editor: e }) => {
|
|
114
|
-
|
|
143
|
+
Ce(s(e.getHTML())), Y();
|
|
115
144
|
},
|
|
116
145
|
onSelectionUpdate: Y,
|
|
117
146
|
onTransaction: () => {
|
|
118
147
|
L.value++;
|
|
119
148
|
}
|
|
120
|
-
}), W.value =
|
|
149
|
+
}), W.value = s(I.value.getHTML()), Y());
|
|
121
150
|
}
|
|
122
151
|
function Z(e) {
|
|
123
152
|
let t = I.value;
|
|
124
153
|
if (!t) return;
|
|
125
|
-
let n =
|
|
126
|
-
if (n ===
|
|
154
|
+
let n = s(e);
|
|
155
|
+
if (n === s(t.getHTML())) return;
|
|
127
156
|
if (t.view.composing) {
|
|
128
157
|
H = n;
|
|
129
158
|
return;
|
|
130
159
|
}
|
|
131
|
-
let { from: r, to: i } = t.state.selection,
|
|
160
|
+
let { from: r, to: i } = t.state.selection, a = U || t.isFocused;
|
|
132
161
|
t.commands.setContent(n, { emitUpdate: !1 });
|
|
133
|
-
let
|
|
134
|
-
from: Math.min(r,
|
|
135
|
-
to: Math.min(i,
|
|
162
|
+
let o = t.state.doc.content.size, c = {
|
|
163
|
+
from: Math.min(r, o),
|
|
164
|
+
to: Math.min(i, o)
|
|
136
165
|
};
|
|
137
|
-
t.commands.setTextSelection(c),
|
|
166
|
+
t.commands.setTextSelection(c), a && t.commands.focus(void 0, { scrollIntoView: !1 }), W.value = s(t.getHTML()), Y();
|
|
138
167
|
}
|
|
139
|
-
|
|
168
|
+
b(W, Z), b([
|
|
140
169
|
() => j.disabled,
|
|
141
170
|
() => j.readonly,
|
|
142
171
|
() => j.label
|
|
@@ -152,7 +181,7 @@ var O = ["aria-disabled"], k = {
|
|
|
152
181
|
tabindex: j.disabled ? "-1" : "0"
|
|
153
182
|
}
|
|
154
183
|
} }), J();
|
|
155
|
-
}),
|
|
184
|
+
}), b(() => j.required, J);
|
|
156
185
|
function Q(e) {
|
|
157
186
|
if (!G.value || !I.value) return;
|
|
158
187
|
let t = I.value.chain().focus();
|
|
@@ -166,7 +195,7 @@ var O = ["aria-disabled"], k = {
|
|
|
166
195
|
redo: () => t.redo()
|
|
167
196
|
})[e]?.().run(), Y();
|
|
168
197
|
}
|
|
169
|
-
function
|
|
198
|
+
function De() {
|
|
170
199
|
V = {
|
|
171
200
|
from: K.value.from,
|
|
172
201
|
to: K.value.to
|
|
@@ -175,145 +204,143 @@ var O = ["aria-disabled"], k = {
|
|
|
175
204
|
function $() {
|
|
176
205
|
if (!I.value || !G.value) return;
|
|
177
206
|
let e = z.value.trim();
|
|
178
|
-
if (e && !
|
|
207
|
+
if (e && !o(e)) {
|
|
179
208
|
B.value = "仅允许 http、https、mailto、tel、站内路径和锚点";
|
|
180
209
|
return;
|
|
181
210
|
}
|
|
182
211
|
let t = I.value.chain().focus().setTextSelection(V || K.value).extendMarkRange("link");
|
|
183
212
|
(e ? t.setLink({ href: e }) : t.unsetLink()).run(), R.value = !1, Y();
|
|
184
213
|
}
|
|
185
|
-
return
|
|
214
|
+
return re(X), ne(() => I.value?.destroy()), O({
|
|
186
215
|
focus: () => I.value?.commands.focus(),
|
|
187
|
-
getHTML: () =>
|
|
216
|
+
getHTML: () => s(I.value?.getHTML() || W.value),
|
|
188
217
|
getJSON: () => I.value?.getJSON(),
|
|
189
218
|
getSelection: () => K.value
|
|
190
|
-
}), (
|
|
219
|
+
}), (a, o) => (g(), f("div", {
|
|
191
220
|
ref_key: "root",
|
|
192
221
|
ref: N,
|
|
193
222
|
class: "kima-rich-text-editor",
|
|
194
223
|
"aria-disabled": e.disabled
|
|
195
224
|
}, [
|
|
196
|
-
|
|
197
|
-
(g(),
|
|
198
|
-
{
|
|
199
|
-
type: "bold",
|
|
200
|
-
label: "粗体"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
type: "italic",
|
|
204
|
-
label: "斜体"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
type: "heading",
|
|
208
|
-
label: "标题"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
type: "bulletList",
|
|
212
|
-
label: "无序列表"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
type: "orderedList",
|
|
216
|
-
label: "有序列表"
|
|
217
|
-
}
|
|
218
|
-
], (e) => m(t, {
|
|
225
|
+
p("div", ve, [
|
|
226
|
+
(g(), f(ee, null, ie(A, (e) => h(i, {
|
|
219
227
|
key: e.type,
|
|
220
|
-
|
|
221
|
-
"aria-pressed": me(e.type),
|
|
222
|
-
disabled: !G.value,
|
|
223
|
-
onMousedown: i[0] ||= w(() => {}, ["prevent"]),
|
|
224
|
-
onClick: (t) => Q(e.type)
|
|
228
|
+
text: e.label
|
|
225
229
|
}, {
|
|
226
|
-
default:
|
|
230
|
+
default: x(() => [h(r, {
|
|
231
|
+
icon: e.icon,
|
|
232
|
+
label: e.label,
|
|
233
|
+
variant: q(e.type) ? "tonal" : "standard",
|
|
234
|
+
"aria-pressed": q(e.type),
|
|
235
|
+
disabled: !G.value,
|
|
236
|
+
onMousedown: o[0] ||= C(() => {}, ["prevent"]),
|
|
237
|
+
onClick: (t) => Q(e.type)
|
|
238
|
+
}, null, 8, [
|
|
239
|
+
"icon",
|
|
240
|
+
"label",
|
|
241
|
+
"variant",
|
|
242
|
+
"aria-pressed",
|
|
243
|
+
"disabled",
|
|
244
|
+
"onClick"
|
|
245
|
+
])]),
|
|
227
246
|
_: 2
|
|
228
|
-
}, 1032, [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
247
|
+
}, 1032, ["text"])), 64)),
|
|
248
|
+
h(i, { text: "链接" }, {
|
|
249
|
+
default: x(() => [h(r, {
|
|
250
|
+
icon: y(ue),
|
|
251
|
+
label: "链接",
|
|
252
|
+
variant: q("link") ? "tonal" : "standard",
|
|
253
|
+
disabled: !G.value,
|
|
254
|
+
"aria-expanded": R.value,
|
|
255
|
+
onMousedown: o[1] ||= C(() => {}, ["prevent"]),
|
|
256
|
+
onClick: De
|
|
257
|
+
}, null, 8, [
|
|
258
|
+
"icon",
|
|
259
|
+
"variant",
|
|
260
|
+
"disabled",
|
|
261
|
+
"aria-expanded"
|
|
262
|
+
])]),
|
|
241
263
|
_: 1
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
264
|
+
}),
|
|
265
|
+
h(i, { text: "撤销" }, {
|
|
266
|
+
default: x(() => [h(r, {
|
|
267
|
+
icon: y(T),
|
|
268
|
+
label: "撤销",
|
|
269
|
+
disabled: !Te.value,
|
|
270
|
+
onMousedown: o[2] ||= C(() => {}, ["prevent"]),
|
|
271
|
+
onClick: o[3] ||= (e) => Q("undo")
|
|
272
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
250
273
|
_: 1
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
onMousedown: i[4] ||= w(() => {}, ["prevent"]),
|
|
256
|
-
onClick: i[5] ||= (e) => Q("redo")
|
|
274
|
+
}),
|
|
275
|
+
h(i, {
|
|
276
|
+
text: "重做",
|
|
277
|
+
position: "left"
|
|
257
278
|
}, {
|
|
258
|
-
default:
|
|
279
|
+
default: x(() => [h(r, {
|
|
280
|
+
icon: y(de),
|
|
281
|
+
label: "重做",
|
|
282
|
+
disabled: !Ee.value,
|
|
283
|
+
onMousedown: o[4] ||= C(() => {}, ["prevent"]),
|
|
284
|
+
onClick: o[5] ||= (e) => Q("redo")
|
|
285
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
259
286
|
_: 1
|
|
260
|
-
}
|
|
287
|
+
})
|
|
261
288
|
]),
|
|
262
|
-
|
|
263
|
-
default:
|
|
264
|
-
|
|
265
|
-
"onUpdate:modelValue":
|
|
289
|
+
h(l, te({ name: "kima-popup" }, y(n)), {
|
|
290
|
+
default: x(() => [R.value ? (g(), f("div", ye, [
|
|
291
|
+
se(p("input", {
|
|
292
|
+
"onUpdate:modelValue": o[6] ||= (e) => z.value = e,
|
|
266
293
|
"aria-label": "链接地址",
|
|
267
294
|
disabled: !G.value,
|
|
268
295
|
placeholder: "https://example.com",
|
|
269
|
-
onKeydown: [C(
|
|
296
|
+
onKeydown: [S(C($, ["prevent"]), ["enter"]), o[7] ||= S(C((e) => {
|
|
270
297
|
R.value = !1, I.value?.commands.focus();
|
|
271
298
|
}, ["prevent"]), ["esc"])]
|
|
272
|
-
}, null, 40,
|
|
273
|
-
|
|
299
|
+
}, null, 40, be), [[oe, z.value]]),
|
|
300
|
+
h(t, {
|
|
274
301
|
disabled: !G.value,
|
|
275
302
|
onClick: $
|
|
276
303
|
}, {
|
|
277
|
-
default:
|
|
304
|
+
default: x(() => [...o[10] ||= [m("应用链接", -1)]]),
|
|
278
305
|
_: 1
|
|
279
306
|
}, 8, ["disabled"]),
|
|
280
|
-
|
|
307
|
+
h(t, {
|
|
281
308
|
variant: "text",
|
|
282
|
-
onClick:
|
|
309
|
+
onClick: o[8] ||= (e) => {
|
|
283
310
|
R.value = !1, I.value?.commands.focus();
|
|
284
311
|
}
|
|
285
312
|
}, {
|
|
286
|
-
default:
|
|
313
|
+
default: x(() => [...o[11] ||= [m("取消", -1)]]),
|
|
287
314
|
_: 1
|
|
288
315
|
}),
|
|
289
|
-
B.value ? (g(),
|
|
290
|
-
])) :
|
|
316
|
+
B.value ? (g(), f("span", xe, v(B.value), 1)) : d("", !0)
|
|
317
|
+
])) : d("", !0)]),
|
|
291
318
|
_: 1
|
|
292
319
|
}, 16),
|
|
293
|
-
I.value ?
|
|
320
|
+
I.value ? d("", !0) : (g(), f("div", {
|
|
294
321
|
key: 0,
|
|
295
322
|
class: "kima-rich-text-editor__document",
|
|
296
|
-
innerHTML:
|
|
297
|
-
}, null, 8,
|
|
298
|
-
|
|
323
|
+
innerHTML: y(s)(y(W))
|
|
324
|
+
}, null, 8, Se)),
|
|
325
|
+
p("div", {
|
|
299
326
|
ref_key: "mount",
|
|
300
327
|
ref: P,
|
|
301
328
|
class: "kima-rich-text-editor__document"
|
|
302
329
|
}, null, 512),
|
|
303
|
-
|
|
304
|
-
|
|
330
|
+
p("output", E, "选区 " + v(K.value.from) + "–" + v(K.value.to) + v(K.value.text ? ` · ${K.value.text}` : ""), 1),
|
|
331
|
+
p("textarea", {
|
|
305
332
|
ref_key: "proxy",
|
|
306
333
|
ref: F,
|
|
307
334
|
class: "kima-rich-text-editor__proxy",
|
|
308
335
|
name: e.name,
|
|
309
336
|
form: e.form,
|
|
310
|
-
value:
|
|
337
|
+
value: y(W),
|
|
311
338
|
disabled: e.disabled,
|
|
312
339
|
tabindex: "-1",
|
|
313
340
|
"aria-hidden": "true",
|
|
314
|
-
onInvalid:
|
|
315
|
-
}, null, 40,
|
|
316
|
-
], 8,
|
|
341
|
+
onInvalid: o[9] ||= C((e) => I.value?.commands.focus(), ["prevent"])
|
|
342
|
+
}, null, 40, D)
|
|
343
|
+
], 8, _e));
|
|
317
344
|
}
|
|
318
|
-
}, [["__scopeId", "data-v-
|
|
319
|
-
export {
|
|
345
|
+
}, [["__scopeId", "data-v-82e3193e"]]);
|
|
346
|
+
export { O as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./icon.ce.js";
|
|
3
3
|
import n from "./icon-button.ce.js";
|
|
4
|
-
import
|
|
5
|
-
import i from "
|
|
4
|
+
import r from "./tooltip.ce.js";
|
|
5
|
+
import { highlightCodeLines as i } from "../../utils/code-highlight.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { Fragment as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, getCurrentInstance as p, mergeProps as m, normalizeClass as h, normalizeStyle as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, useAttrs as S, watch as C, withCtx as w } from "vue";
|
|
8
8
|
import { Copy01Icon as T, TextWrapIcon as E, Tick01Icon as D } from "@hugeicons/core-free-icons";
|
|
@@ -47,7 +47,7 @@ var O = { class: "kima-code-block__toolbar" }, k = { class: "kima-code-block__me
|
|
|
47
47
|
}), C(() => L.code, () => {
|
|
48
48
|
W.value = "";
|
|
49
49
|
});
|
|
50
|
-
let G = s(() =>
|
|
50
|
+
let G = s(() => i(L.code, L.language));
|
|
51
51
|
async function K() {
|
|
52
52
|
if (U.value) return;
|
|
53
53
|
let e = L.code;
|
|
@@ -60,8 +60,8 @@ var O = { class: "kima-code-block__toolbar" }, k = { class: "kima-code-block__me
|
|
|
60
60
|
U.value = !1;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
return (
|
|
64
|
-
d("figcaption", O, [d("div", k, [e.filename ? (_(), u("span", A, b(e.filename), 1)) : l("", !0), d("span", j, b(e.language), 1)]), d("div", M, [f(
|
|
63
|
+
return (i, s) => (_(), u("figure", m(V.value, { class: ["kima-code-block", { "kima-code-block--wrap": H.value }] }), [
|
|
64
|
+
d("figcaption", O, [d("div", k, [e.filename ? (_(), u("span", A, b(e.filename), 1)) : l("", !0), d("span", j, b(e.language), 1)]), d("div", M, [f(r, {
|
|
65
65
|
text: H.value ? "关闭自动换行" : "开启自动换行",
|
|
66
66
|
position: "left"
|
|
67
67
|
}, {
|
|
@@ -79,7 +79,7 @@ var O = { class: "kima-code-block__toolbar" }, k = { class: "kima-code-block__me
|
|
|
79
79
|
"aria-pressed"
|
|
80
80
|
])]),
|
|
81
81
|
_: 1
|
|
82
|
-
}, 8, ["text"]), e.copyable ? (_(), c(
|
|
82
|
+
}, 8, ["text"]), e.copyable ? (_(), c(r, {
|
|
83
83
|
key: 0,
|
|
84
84
|
text: W.value === "已复制" ? "已复制" : "复制代码",
|
|
85
85
|
position: "left"
|