@matechat/core 1.2.0 → 1.3.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/Prompt/index.js CHANGED
@@ -1,12 +1,59 @@
1
1
  import "./index.css";
2
- import { defineComponent as y, createElementBlock as s, openBlock as r, createElementVNode as P, createCommentVNode as c, normalizeClass as h, createBlock as g, unref as C, normalizeProps as b, mergeProps as I, toDisplayString as v, createVNode as u, withCtx as V } from "vue";
3
- import { ListVariant as B, ListDirection as L, McList as M } from "@matechat/core/List";
4
- import { Icon as N } from "vue-devui/icon";
5
- import "vue-devui/icon/style.css";
6
- const S = {
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: L.Vertical
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: B.Filled
64
+ default: N.Filled
18
65
  }
19
- }, $ = {
66
+ }, A = {
20
67
  prompt: {
21
68
  type: Object
22
69
  }
23
- }, z = { class: "mc-prompt-item" }, D = {
70
+ }, E = { class: "mc-prompt-item" }, F = {
24
71
  key: 0,
25
72
  class: "mc-prompt-item-content"
26
- }, E = {
73
+ }, U = {
27
74
  key: 0,
28
75
  class: "mc-prompt-item-label"
29
- }, O = {
76
+ }, q = {
30
77
  key: 1,
31
78
  class: "mc-prompt-item-description"
32
- }, j = /* @__PURE__ */ y({
79
+ }, G = /* @__PURE__ */ a({
33
80
  __name: "PromptItem",
34
- props: $,
35
- setup(o) {
36
- return (t, p) => {
37
- var e, i, m, n, a, l, d, _, f;
38
- return r(), s("div", z, [
39
- P(
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: h(["mc-prompt-item-icon", { "no-description": !((e = t.prompt) != null && e.desc) }])
89
+ class: P(["mc-prompt-item-icon", { "no-description": !((o = t.prompt) != null && o.desc) }])
43
90
  },
44
91
  [
45
- (i = t.prompt) != null && i.iconConfig ? (r(), g(
46
- C(N),
47
- b(I({ key: 0 }, (m = t.prompt) == null ? void 0 : m.iconConfig)),
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
- )) : c("v-if", !0)
98
+ )) : l("v-if", !0)
52
99
  ],
53
100
  2
54
101
  /* CLASS */
55
102
  ),
56
- (n = t.prompt) != null && n.label || (a = t.prompt) != null && a.desc ? (r(), s("div", D, [
57
- (l = t.prompt) != null && l.label ? (r(), s(
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
- E,
60
- v((d = t.prompt) == null ? void 0 : d.label),
106
+ U,
107
+ h((u = t.prompt) == null ? void 0 : u.label),
61
108
  1
62
109
  /* TEXT */
63
- )) : c("v-if", !0),
64
- (_ = t.prompt) != null && _.desc ? (r(), s(
110
+ )) : l("v-if", !0),
111
+ (f = t.prompt) != null && f.desc ? (n(), s(
65
112
  "div",
66
- O,
67
- v((f = t.prompt) == null ? void 0 : f.desc),
113
+ q,
114
+ h((_ = t.prompt) == null ? void 0 : _.desc),
68
115
  1
69
116
  /* TEXT */
70
- )) : c("v-if", !0)
71
- ])) : c("v-if", !0)
117
+ )) : l("v-if", !0)
118
+ ])) : l("v-if", !0)
72
119
  ]);
73
120
  };
74
121
  }
75
- }), w = (o, t) => {
76
- const p = o.__vccOpts || o;
77
- for (const [e, i] of t)
78
- p[e] = i;
79
- return p;
80
- }, A = /* @__PURE__ */ w(j, [["__scopeId", "data-v-5f016595"]]), F = { class: "mc-prompt" }, k = /* @__PURE__ */ y({
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: S,
129
+ props: w,
83
130
  emits: ["itemClick"],
84
- setup(o, { emit: t }) {
85
- const p = t, e = o;
86
- return (i, m) => (r(), s("div", F, [
87
- u(C(M), {
88
- data: e.list,
89
- direction: e.direction,
90
- variant: e.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: n }) => [
94
- u(A, {
95
- prompt: n,
96
- onClick: (a) => p("itemClick", n)
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
- k.install = (o) => {
106
- o.component("McPrompt", k);
152
+ g.install = (r) => {
153
+ r.component("McPrompt", g);
107
154
  };
108
155
  export {
109
- k as McPrompt
156
+ g as McPrompt
110
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matechat/core",
3
- "version": "1.2.0",
3
+ "version": "1.3.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"
@@ -32,4 +31,4 @@
32
31
  "peerDependencies": {
33
32
  "vue": "^3.5.13"
34
33
  }
35
- }
34
+ }