@matechat/core 1.2.0-alpha.0 → 1.3.0-alpha.0
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/Bubble/index.css +1 -1
- package/Bubble/index.js +364 -58
- package/Input/index.css +1 -1
- package/Input/index.js +118 -103
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +155 -138
- package/Prompt/index.css +1 -1
- package/Prompt/index.js +101 -54
- package/package.json +1 -2
package/Prompt/index.js
CHANGED
|
@@ -1,12 +1,59 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ListVariant as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { defineComponent as a, computed as v, resolveDynamicComponent as b, createElementBlock as s, openBlock as n, createBlock as C, unref as z, normalizeStyle as y, normalizeClass as P, createElementVNode as S, createCommentVNode as l, normalizeProps as I, mergeProps as $, toDisplayString as h, createVNode as k, withCtx as V } from "vue";
|
|
3
|
+
import { ListVariant as N, ListDirection as B, McList as D } from "@matechat/core/List";
|
|
4
|
+
const L = {
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
size: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: "inherit"
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "inherit"
|
|
16
|
+
},
|
|
17
|
+
component: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: null
|
|
20
|
+
}
|
|
21
|
+
}, M = { class: "mc-prompt-icon" }, O = ["src", "alt"], j = /* @__PURE__ */ a({
|
|
22
|
+
__name: "Icon",
|
|
23
|
+
props: L,
|
|
24
|
+
setup(r) {
|
|
25
|
+
const t = r, i = v(() => typeof t.size == "number" ? `${t.size}px` : t.size), o = v(() => /^icon-/.test(t.name) ? t.name : ""), p = t.component && b(t.component);
|
|
26
|
+
function c(e) {
|
|
27
|
+
return /^((http|https):)?\/\//.test(e);
|
|
28
|
+
}
|
|
29
|
+
return (e, m) => (n(), s("div", M, [
|
|
30
|
+
e.component ? (n(), C(z(p), {
|
|
31
|
+
key: 0,
|
|
32
|
+
name: e.name,
|
|
33
|
+
color: e.color,
|
|
34
|
+
size: i.value
|
|
35
|
+
}, null, 8, ["name", "color", "size"])) : c(t.name) ? (n(), s("img", {
|
|
36
|
+
key: 1,
|
|
37
|
+
src: e.name,
|
|
38
|
+
alt: t.name.split("/")[t.name.split("/").length - 1],
|
|
39
|
+
style: y({ width: i.value || "", verticalAlign: "middle" })
|
|
40
|
+
}, null, 12, O)) : (n(), s(
|
|
41
|
+
"i",
|
|
42
|
+
{
|
|
43
|
+
key: 2,
|
|
44
|
+
class: P(o.value),
|
|
45
|
+
style: y({ fontSize: i.value, color: e.color })
|
|
46
|
+
},
|
|
47
|
+
null,
|
|
48
|
+
6
|
|
49
|
+
/* CLASS, STYLE */
|
|
50
|
+
))
|
|
51
|
+
]));
|
|
52
|
+
}
|
|
53
|
+
}), w = {
|
|
7
54
|
direction: {
|
|
8
55
|
type: String,
|
|
9
|
-
default:
|
|
56
|
+
default: B.Vertical
|
|
10
57
|
},
|
|
11
58
|
list: {
|
|
12
59
|
type: Array,
|
|
@@ -14,86 +61,86 @@ const S = {
|
|
|
14
61
|
},
|
|
15
62
|
variant: {
|
|
16
63
|
type: String,
|
|
17
|
-
default:
|
|
64
|
+
default: N.Filled
|
|
18
65
|
}
|
|
19
|
-
},
|
|
66
|
+
}, A = {
|
|
20
67
|
prompt: {
|
|
21
68
|
type: Object
|
|
22
69
|
}
|
|
23
|
-
},
|
|
70
|
+
}, E = { class: "mc-prompt-item" }, F = {
|
|
24
71
|
key: 0,
|
|
25
72
|
class: "mc-prompt-item-content"
|
|
26
|
-
},
|
|
73
|
+
}, U = {
|
|
27
74
|
key: 0,
|
|
28
75
|
class: "mc-prompt-item-label"
|
|
29
|
-
},
|
|
76
|
+
}, q = {
|
|
30
77
|
key: 1,
|
|
31
78
|
class: "mc-prompt-item-description"
|
|
32
|
-
},
|
|
79
|
+
}, G = /* @__PURE__ */ a({
|
|
33
80
|
__name: "PromptItem",
|
|
34
|
-
props:
|
|
35
|
-
setup(
|
|
36
|
-
return (t,
|
|
37
|
-
var
|
|
38
|
-
return
|
|
39
|
-
|
|
81
|
+
props: A,
|
|
82
|
+
setup(r) {
|
|
83
|
+
return (t, i) => {
|
|
84
|
+
var o, p, c, e, m, d, u, f, _;
|
|
85
|
+
return n(), s("div", E, [
|
|
86
|
+
S(
|
|
40
87
|
"div",
|
|
41
88
|
{
|
|
42
|
-
class:
|
|
89
|
+
class: P(["mc-prompt-item-icon", { "no-description": !((o = t.prompt) != null && o.desc) }])
|
|
43
90
|
},
|
|
44
91
|
[
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
92
|
+
(p = t.prompt) != null && p.iconConfig ? (n(), C(
|
|
93
|
+
j,
|
|
94
|
+
I($({ key: 0 }, (c = t.prompt) == null ? void 0 : c.iconConfig)),
|
|
48
95
|
null,
|
|
49
96
|
16
|
|
50
97
|
/* FULL_PROPS */
|
|
51
|
-
)) :
|
|
98
|
+
)) : l("v-if", !0)
|
|
52
99
|
],
|
|
53
100
|
2
|
|
54
101
|
/* CLASS */
|
|
55
102
|
),
|
|
56
|
-
(
|
|
57
|
-
(
|
|
103
|
+
(e = t.prompt) != null && e.label || (m = t.prompt) != null && m.desc ? (n(), s("div", F, [
|
|
104
|
+
(d = t.prompt) != null && d.label ? (n(), s(
|
|
58
105
|
"div",
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
U,
|
|
107
|
+
h((u = t.prompt) == null ? void 0 : u.label),
|
|
61
108
|
1
|
|
62
109
|
/* TEXT */
|
|
63
|
-
)) :
|
|
64
|
-
(
|
|
110
|
+
)) : l("v-if", !0),
|
|
111
|
+
(f = t.prompt) != null && f.desc ? (n(), s(
|
|
65
112
|
"div",
|
|
66
|
-
|
|
67
|
-
|
|
113
|
+
q,
|
|
114
|
+
h((_ = t.prompt) == null ? void 0 : _.desc),
|
|
68
115
|
1
|
|
69
116
|
/* TEXT */
|
|
70
|
-
)) :
|
|
71
|
-
])) :
|
|
117
|
+
)) : l("v-if", !0)
|
|
118
|
+
])) : l("v-if", !0)
|
|
72
119
|
]);
|
|
73
120
|
};
|
|
74
121
|
}
|
|
75
|
-
}),
|
|
76
|
-
const
|
|
77
|
-
for (const [
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
},
|
|
122
|
+
}), H = (r, t) => {
|
|
123
|
+
const i = r.__vccOpts || r;
|
|
124
|
+
for (const [o, p] of t)
|
|
125
|
+
i[o] = p;
|
|
126
|
+
return i;
|
|
127
|
+
}, J = /* @__PURE__ */ H(G, [["__scopeId", "data-v-d5f7f6f9"]]), K = { class: "mc-prompt" }, g = /* @__PURE__ */ a({
|
|
81
128
|
__name: "Prompt",
|
|
82
|
-
props:
|
|
129
|
+
props: w,
|
|
83
130
|
emits: ["itemClick"],
|
|
84
|
-
setup(
|
|
85
|
-
const
|
|
86
|
-
return (
|
|
87
|
-
|
|
88
|
-
data:
|
|
89
|
-
direction:
|
|
90
|
-
variant:
|
|
131
|
+
setup(r, { emit: t }) {
|
|
132
|
+
const i = t, o = r;
|
|
133
|
+
return (p, c) => (n(), s("div", K, [
|
|
134
|
+
k(z(D), {
|
|
135
|
+
data: o.list,
|
|
136
|
+
direction: o.direction,
|
|
137
|
+
variant: o.variant,
|
|
91
138
|
selectable: !1
|
|
92
139
|
}, {
|
|
93
|
-
item: V(({ item:
|
|
94
|
-
|
|
95
|
-
prompt:
|
|
96
|
-
onClick: (
|
|
140
|
+
item: V(({ item: e }) => [
|
|
141
|
+
k(J, {
|
|
142
|
+
prompt: e,
|
|
143
|
+
onClick: (m) => i("itemClick", e)
|
|
97
144
|
}, null, 8, ["prompt", "onClick"])
|
|
98
145
|
]),
|
|
99
146
|
_: 1
|
|
@@ -102,9 +149,9 @@ const S = {
|
|
|
102
149
|
]));
|
|
103
150
|
}
|
|
104
151
|
});
|
|
105
|
-
|
|
106
|
-
|
|
152
|
+
g.install = (r) => {
|
|
153
|
+
r.component("McPrompt", g);
|
|
107
154
|
};
|
|
108
155
|
export {
|
|
109
|
-
|
|
156
|
+
g as McPrompt
|
|
110
157
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matechat/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "前端智能化场景解决方案UI库,轻松构建你的AI应用。",
|
|
6
6
|
"keywords": [
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@vue/shared": "^3.5.13",
|
|
25
25
|
"devui-theme": "^0.0.7",
|
|
26
26
|
"lodash-es": "^4.17.21",
|
|
27
|
-
"vue-devui": "^1.6.29",
|
|
28
27
|
"highlight.js": "^11.11.0",
|
|
29
28
|
"markdown-it": "12.2.0",
|
|
30
29
|
"xss": "^1.0.15"
|