@matechat/core 1.11.1 → 1.12.0-alpha

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.
Files changed (42) hide show
  1. package/Attachment/Attachment.vue.d.ts +8 -8
  2. package/Attachment/attachment-types.d.ts +3 -35
  3. package/Attachment/index.css +1 -1
  4. package/Attachment/index.js +43 -45
  5. package/Bubble/index.css +1 -1
  6. package/Bubble/index.js +276 -146
  7. package/Bubble/useBubbleFoundation.d.ts +9 -0
  8. package/FileList/index.js +1 -1
  9. package/Header/index.css +1 -1
  10. package/Header/index.js +11 -11
  11. package/Input/components/EditableBlock.vue.d.ts +2 -2
  12. package/Input/index.css +1 -1
  13. package/Input/index.js +82 -57
  14. package/Introduction/index.css +1 -1
  15. package/Introduction/index.js +129 -39
  16. package/Layout/index.js +6 -6
  17. package/List/index.js +5 -5
  18. package/MarkdownCard/MDCardParser.d.ts +0 -10
  19. package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
  20. package/MarkdownCard/index.css +1 -1
  21. package/MarkdownCard/index.js +542 -361
  22. package/MarkdownCard/mdCard.types.d.ts +2 -29
  23. package/MarkdownCard/mdCard.vue.d.ts +2 -2
  24. package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
  25. package/Mention/Mention.vue.d.ts +12 -3
  26. package/Mention/index.css +1 -1
  27. package/Mention/index.js +364 -110
  28. package/Mention/mention-types.d.ts +6 -4
  29. package/Mention/use-mention.d.ts +7 -0
  30. package/Prompt/index.js +1 -1
  31. package/Toolbar/index.css +1 -1
  32. package/Toolbar/index.d.ts +2 -1
  33. package/Toolbar/index.js +189 -198
  34. package/Toolbar/toolbar.types.d.ts +2 -26
  35. package/index.d.ts +2 -2
  36. package/mate-chat.js +2 -1
  37. package/package.json +1 -1
  38. package/Attachment/uploader.d.ts +0 -11
  39. package/MarkdownCard/MDCardService.d.ts +0 -14
  40. package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
  41. package/MarkdownCard/MermaidService.d.ts +0 -22
  42. package/Mention/const.d.ts +0 -4
package/Header/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./index.css";
2
- import { defineComponent as d, createElementBlock as n, openBlock as r, createElementVNode as a, normalizeClass as m, createCommentVNode as g, toDisplayString as p, renderSlot as _ } from "vue";
2
+ import { defineComponent as d, openBlock as n, createElementBlock as r, createElementVNode as s, normalizeClass as m, createCommentVNode as g, toDisplayString as p, renderSlot as _ } from "vue";
3
3
  const k = {
4
4
  logoImg: {
5
5
  type: String,
@@ -18,24 +18,24 @@ const k = {
18
18
  props: k,
19
19
  emits: ["logoClicked"],
20
20
  setup(e, { emit: l }) {
21
- const t = l, c = e, s = () => {
21
+ const t = l, c = e, a = () => {
22
22
  c.logoClickable && t("logoClicked");
23
23
  };
24
- return (o, I) => (r(), n("div", f, [
25
- a(
24
+ return (o, I) => (n(), r("div", f, [
25
+ s(
26
26
  "div",
27
27
  {
28
28
  class: m(["mc-header-logo-container", { clickable: o.logoClickable }]),
29
- onClick: s
29
+ onClick: a
30
30
  },
31
31
  [
32
- o.logoImg ? (r(), n("img", {
32
+ o.logoImg ? (n(), r("img", {
33
33
  key: 0,
34
34
  class: "mc-header-logo",
35
35
  src: o.logoImg,
36
36
  alt: o.logoImg
37
37
  }, null, 8, h)) : g("v-if", !0),
38
- a(
38
+ s(
39
39
  "div",
40
40
  u,
41
41
  p(o.title),
@@ -46,17 +46,17 @@ const k = {
46
46
  2
47
47
  /* CLASS */
48
48
  ),
49
- a("div", C, [
49
+ s("div", C, [
50
50
  _(o.$slots, "operationArea", {}, void 0, !0)
51
51
  ])
52
52
  ]));
53
53
  }
54
54
  }), y = (e, l) => {
55
55
  const t = e.__vccOpts || e;
56
- for (const [c, s] of l)
57
- t[c] = s;
56
+ for (const [c, a] of l)
57
+ t[c] = a;
58
58
  return t;
59
- }, i = /* @__PURE__ */ y(v, [["__scopeId", "data-v-05829e90"]]);
59
+ }, i = /* @__PURE__ */ y(v, [["__scopeId", "data-v-a864dc89"]]);
60
60
  i.install = (e) => {
61
61
  e.component("McHeader", i);
62
62
  };
@@ -1,5 +1,5 @@
1
- import { PropType } from "vue";
2
- import { FormatContentItem, SubmitShortKey } from "../input-types";
1
+ import { type PropType } from 'vue';
2
+ import { type FormatContentItem, SubmitShortKey } from '../input-types';
3
3
  declare var __VLS_6: {
4
4
  themeTag: {
5
5
  type: "themeTag";
package/Input/index.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.mc-textarea{width:100%;height:64px;padding:4px 0;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);background-color:var(--devui-form-control-bg, #ffffff);vertical-align:middle;outline:none;box-sizing:border-box;resize:none;border:none}.mc-textarea.mc-textarea-simple{height:32px}.mc-textarea.mc-textarea-disabled{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-textarea::placeholder{color:var(--devui-placeholder, #babbc0)}.input-custom-item[data-v-967e21e0]{display:inline-block;border:none;padding:0 8px;outline:none;width:auto;max-width:100%;border-radius:8px;background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);font-weight:400;line-height:22px;letter-spacing:0px;text-align:left;margin:0 2px}.input-custom-placeholder[data-v-967e21e0]:after{color:var(--devui-placeholder, #babbc0);content:attr(placeholder);cursor:text}.inline-text[data-v-967e21e0]{display:inline;padding:2px 8px}.editable-container[data-v-86573c82]{outline:unset;min-height:64px;line-height:24px;padding-top:4px;word-break:break-all;white-space:pre-wrap;font-size:14px;caret-color:var(--devui-text, #252b3a);background:var(--devui-form-control-bg, #ffffff);color:var(--devui-text, #252b3a)}.editable-container.mc-input-simple[data-v-86573c82]{min-height:32px}.editable-container.mc-input-disabled[data-v-86573c82]{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.editable-container[data-v-86573c82]>*{text-indent:0}.editable-container[placeholder][data-v-86573c82]:empty:before{content:attr(placeholder);color:var(--devui-placeholder, #babbc0);position:absolute;pointer-events:none;left:8px}.editable-container .ai-input-prefix-wrapper[data-v-86573c82]{border-radius:8px;background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-primary, #5e7ce0);height:24px;padding:0 8px;font-size:14px;font-weight:600;line-height:24px;z-index:10;position:sticky;display:inline-block;cursor:pointer}.en-editable-container[data-v-86573c82]{text-indent:140px}.editable-container[data-v-86573c82]:focus{border-color:#409eff}.mc-button[data-v-dbbf3b38]{position:relative;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:32px;line-height:1.5;color:var(--devui-light-text, #ffffff);font-size:var(--devui-font-size, 14px);padding:0 12px;border-radius:20px;background-color:var(--devui-primary, #5e7ce0);overflow:hidden;border:none;cursor:pointer;transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-button.mc-button-loading svg[data-v-dbbf3b38]{animation:rotating-dbbf3b38 1s linear infinite}.mc-button.mousedown[data-v-dbbf3b38]:not(:disabled){transform:scale(.95)}.mc-button.mc-button-simple[data-v-dbbf3b38]{width:32px;padding:6px;flex-shrink:0;border-radius:100%}.mc-button.mc-button-simple svg[data-v-dbbf3b38]{margin-right:0}.mc-button[data-v-dbbf3b38]:hover{background-color:var(--devui-primary-hover, #7693f5)}.mc-button[data-v-dbbf3b38]:active{background-color:var(--devui-primary-active, #344899)}.mc-button[data-v-dbbf3b38]:disabled{color:var(--devui-light-text, #ffffff);background-color:var(--devui-primary-disabled, #beccfa);cursor:not-allowed}.mc-button .mc-button-content[data-v-dbbf3b38]{display:inline-flex;align-items:center;font-size:var(--devui-font-size, 14px)}.mc-button .mc-button-water-wave[data-v-dbbf3b38]{position:absolute;background-color:var(--devui-base-bg, #ffffff);border-radius:50%;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);animation:waterWave-dbbf3b38 var(--devui-animation-duration-slow, .3s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.mc-button svg[data-v-dbbf3b38]{margin-right:4px}.mc-button svg[data-v-dbbf3b38] path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-dbbf3b38{0%{transform:rotate(0)}to{transform:rotate(180deg)}}@keyframes waterWave-dbbf3b38{0%{opacity:.2;width:30px;height:30px}to{opacity:0;width:200px;height:200px}}body[ui-theme=infinity-theme]{--mc-text: #aeaeae;--mc-box-shadow: rgba(25, 25, 25, .06)}body[ui-theme=galaxy-theme]{--mc-text: #4e5057;--mc-box-shadow: rgba(206, 209, 219, .06)}.mc-input{display:flex;flex-direction:column;width:100%;padding:12px 0;border:1px solid var(--devui-form-control-line, #d7d8da);border-radius:16px;box-sizing:border-box;background-color:var(--devui-base-bg, #ffffff)}.mc-input.mc-input-simple{border-radius:24px}.mc-input.mc-input-simple .mc-input-content{padding:0 20px}.mc-input.mc-input-borderless{border:none;box-shadow:0 1px 8px 0 var(--mc-box-shadow, rgba(25, 25, 25, .06))}.mc-input.mc-input-disabled{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-input .mc-input-content{display:flex;align-items:flex-end;padding:0 16px}.mc-input .mc-input-content .editable-block-container{width:100%}.mc-input .mc-input-foot{display:flex;justify-content:space-between;align-items:center;height:32px;padding:0 16px}.mc-input .mc-input-foot .mc-input-foot-left{flex:1;height:100%;display:flex;align-items:center}.mc-input .mc-input-foot .mc-input-foot-left .mc-input-foot-count{color:var(--mc-text, #aeaeae);font-size:var(--devui-font-size-sm, 12px)}
1
+ @charset "UTF-8";.mc-textarea{width:100%;height:64px;padding:4px 0;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);background-color:var(--devui-form-control-bg, #ffffff);vertical-align:middle;outline:none;box-sizing:border-box;resize:none;border:none}.mc-textarea.mc-textarea-simple{height:32px}.mc-textarea.mc-textarea-disabled{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-textarea::placeholder{color:var(--devui-placeholder, #babbc0)}.input-custom-item[data-v-de0a1464]{display:inline-block;border:none;padding:0 8px;outline:none;width:auto;max-width:100%;border-radius:8px;background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);font-weight:400;line-height:22px;letter-spacing:0px;text-align:left;margin:0 2px}.input-custom-placeholder[data-v-de0a1464]:after{color:var(--devui-placeholder, #babbc0);content:attr(placeholder);cursor:text}.inline-text[data-v-de0a1464]{display:inline;padding:2px 8px}.editable-container[data-v-92145e12]{outline:unset;min-height:64px;line-height:24px;padding-top:4px;word-break:break-all;white-space:pre-wrap;font-size:14px;caret-color:var(--devui-text, #252b3a);background:var(--devui-form-control-bg, #ffffff);color:var(--devui-text, #252b3a)}.editable-container.mc-input-simple[data-v-92145e12]{min-height:32px}.editable-container.mc-input-disabled[data-v-92145e12]{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.editable-container[data-v-92145e12]>*{text-indent:0}.editable-container[placeholder][data-v-92145e12]:empty:before{content:attr(placeholder);color:var(--devui-placeholder, #babbc0);position:absolute;pointer-events:none;left:8px}.editable-container .ai-input-prefix-wrapper[data-v-92145e12]{border-radius:8px;background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-primary, #5e7ce0);height:24px;padding:0 8px;font-size:14px;font-weight:600;line-height:24px;z-index:10;position:sticky;display:inline-block;cursor:pointer}.en-editable-container[data-v-92145e12]{text-indent:140px}.editable-container[data-v-92145e12]:focus{border-color:#409eff}.mc-button[data-v-dbbf3b38]{position:relative;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:32px;line-height:1.5;color:var(--devui-light-text, #ffffff);font-size:var(--devui-font-size, 14px);padding:0 12px;border-radius:20px;background-color:var(--devui-primary, #5e7ce0);overflow:hidden;border:none;cursor:pointer;transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-button.mc-button-loading svg[data-v-dbbf3b38]{animation:rotating-dbbf3b38 1s linear infinite}.mc-button.mousedown[data-v-dbbf3b38]:not(:disabled){transform:scale(.95)}.mc-button.mc-button-simple[data-v-dbbf3b38]{width:32px;padding:6px;flex-shrink:0;border-radius:100%}.mc-button.mc-button-simple svg[data-v-dbbf3b38]{margin-right:0}.mc-button[data-v-dbbf3b38]:hover{background-color:var(--devui-primary-hover, #7693f5)}.mc-button[data-v-dbbf3b38]:active{background-color:var(--devui-primary-active, #344899)}.mc-button[data-v-dbbf3b38]:disabled{color:var(--devui-light-text, #ffffff);background-color:var(--devui-primary-disabled, #beccfa);cursor:not-allowed}.mc-button .mc-button-content[data-v-dbbf3b38]{display:inline-flex;align-items:center;font-size:var(--devui-font-size, 14px)}.mc-button .mc-button-water-wave[data-v-dbbf3b38]{position:absolute;background-color:var(--devui-base-bg, #ffffff);border-radius:50%;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);animation:waterWave-dbbf3b38 var(--devui-animation-duration-slow, .3s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.mc-button svg[data-v-dbbf3b38]{margin-right:4px}.mc-button svg[data-v-dbbf3b38] path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-dbbf3b38{0%{transform:rotate(0)}to{transform:rotate(180deg)}}@keyframes waterWave-dbbf3b38{0%{opacity:.2;width:30px;height:30px}to{opacity:0;width:200px;height:200px}}body[ui-theme=infinity-theme]{--mc-text: #aeaeae;--mc-box-shadow: rgba(25, 25, 25, .06)}body[ui-theme=galaxy-theme]{--mc-text: #4e5057;--mc-box-shadow: rgba(206, 209, 219, .06)}.mc-input{display:flex;flex-direction:column;width:100%;padding:12px 0;border:1px solid var(--devui-form-control-line, #d7d8da);border-radius:16px;box-sizing:border-box;background-color:var(--devui-base-bg, #ffffff)}.mc-input.mc-input-simple{border-radius:24px}.mc-input.mc-input-simple .mc-input-content{padding:0 20px}.mc-input.mc-input-borderless{border:none;box-shadow:0 1px 8px 0 var(--mc-box-shadow, rgba(25, 25, 25, .06))}.mc-input.mc-input-disabled{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-input .mc-input-content{display:flex;align-items:flex-end;padding:0 16px}.mc-input .mc-input-content .editable-block-container{width:100%}.mc-input .mc-input-foot{display:flex;justify-content:space-between;align-items:center;height:32px;padding:0 16px}.mc-input .mc-input-foot .mc-input-foot-left{flex:1;height:100%;display:flex;align-items:center}.mc-input .mc-input-foot .mc-input-foot-left .mc-input-foot-count{color:var(--mc-text, #aeaeae);font-size:var(--devui-font-size-sm, 12px)}
package/Input/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./index.css";
2
- import { ref as w, defineComponent as X, inject as oe, computed as ae, watch as Y, onMounted as te, withDirectives as be, createElementBlock as x, openBlock as m, normalizeClass as q, normalizeStyle as ce, unref as g, isRef as ye, vModelText as xe, nextTick as pe, createElementVNode as $, withModifiers as le, toDisplayString as Z, resolveComponent as Ce, createCommentVNode as _, createBlock as O, withCtx as de, renderSlot as A, Fragment as ee, renderList as Te, createTextVNode as Le, reactive as Se, provide as _e, createVNode as ie } from "vue";
2
+ import { ref as w, defineComponent as X, inject as oe, computed as ae, watch as Y, onMounted as te, withDirectives as be, openBlock as m, createElementBlock as x, normalizeClass as q, unref as g, normalizeStyle as ce, isRef as ye, vModelText as xe, nextTick as de, createElementVNode as $, withModifiers as le, toDisplayString as Z, resolveComponent as Ce, createCommentVNode as _, createBlock as O, withCtx as pe, renderSlot as A, Fragment as ee, renderList as Te, createTextVNode as Le, reactive as Se, provide as _e, createVNode as ie } from "vue";
3
3
  import { useMcI18n as fe } from "@matechat/core/Locale";
4
4
  var V = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(V || {}), me = /* @__PURE__ */ ((n) => (n.Bordered = "bordered", n.BorderLess = "borderless", n))(me || {}), ne = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(ne || {}), K = /* @__PURE__ */ ((n) => (n.Enter = "enter", n.ShiftEnter = "shiftEnter", n))(K || {});
5
5
  const we = {
@@ -113,12 +113,12 @@ function Ne(n, a = 1, s) {
113
113
  u.value = " ";
114
114
  const C = u.scrollHeight - l;
115
115
  if (a !== void 0) {
116
- let p = C * a;
117
- r === "border-box" && (p = p + l + i), f = Math.max(p, f), h.minHeight = `${p}px`;
116
+ let d = C * a;
117
+ r === "border-box" && (d = d + l + i), f = Math.max(d, f), h.minHeight = `${d}px`;
118
118
  }
119
119
  if (s !== void 0) {
120
- let p = C * s;
121
- r === "border-box" && (p = p + l + i), f > p ? (f = p, h.overflowY = "auto") : h.overflowY = "hidden";
120
+ let d = C * s;
121
+ r === "border-box" && (d = d + l + i), f > d ? (f = d, h.overflowY = "auto") : h.overflowY = "hidden";
122
122
  }
123
123
  }
124
124
  return h.height = `${f}px`, u.remove(), h;
@@ -147,9 +147,14 @@ function Me(n) {
147
147
  const De = ["placeholder", "disabled", "maxlength"], Re = /* @__PURE__ */ X({
148
148
  __name: "textarea",
149
149
  setup(n) {
150
- const { t: a } = fe(), s = w(null), { inputValue: t, rootProps: l, rootEmits: i, clearInputAfterSubmit: r } = oe(Q), u = ae(() => {
150
+ const { t: a } = fe(), s = w(null), { inputValue: t, rootProps: l, rootEmits: i, clearInputAfterSubmit: r } = oe(
151
+ Q
152
+ ), u = ae(() => {
151
153
  let v = "", E = "";
152
- return l.submitShortKey === K.Enter && (v = "Enter", E = "Shift + Enter"), l.submitShortKey === K.ShiftEnter && (v = "Shift + Enter", E = "Enter"), l.placeholder ?? (v ? a("Input.pleaseEnterPlaceholder", { enterKey: v, shiftEnterKey: E }) : a("Input.pleaseEnter"));
154
+ return l.submitShortKey === K.Enter && (v = "Enter", E = "Shift + Enter"), l.submitShortKey === K.ShiftEnter && (v = "Shift + Enter", E = "Enter"), l.placeholder ?? (v ? a("Input.pleaseEnterPlaceholder", {
155
+ enterKey: v,
156
+ shiftEnterKey: E
157
+ }) : a("Input.pleaseEnter"));
153
158
  }), { textareaStyle: f, updateTextareaStyle: h } = Me({
154
159
  textareaRef: s,
155
160
  autosize: l.autosize
@@ -163,17 +168,17 @@ const De = ["placeholder", "disabled", "maxlength"], Re = /* @__PURE__ */ X({
163
168
  h();
164
169
  });
165
170
  let C = !1;
166
- const p = () => {
167
- pe(() => {
171
+ const d = () => {
172
+ de(() => {
168
173
  i("change", t.value);
169
174
  });
170
175
  }, T = () => {
171
- C || p();
176
+ C || d();
172
177
  }, b = () => {
173
178
  C = !0;
174
179
  }, B = () => {
175
180
  setTimeout(() => {
176
- C = !1, p();
181
+ C = !1, d();
177
182
  }, 10);
178
183
  }, z = (v) => {
179
184
  if (l.submitShortKey === null)
@@ -247,21 +252,24 @@ const Ae = (n) => {
247
252
  emits: ["change"],
248
253
  setup(n, { emit: a }) {
249
254
  const s = a, t = n, l = w(!1), i = w(t.content), r = w(null);
250
- Y(() => t.content, (p) => {
251
- i.value = p;
252
- });
255
+ Y(
256
+ () => t.content,
257
+ (d) => {
258
+ i.value = d;
259
+ }
260
+ );
253
261
  const u = () => {
254
262
  l.value = !t.disabled;
255
263
  }, f = () => {
256
264
  l.value = !1;
257
- }, h = (p) => {
265
+ }, h = (d) => {
258
266
  var b;
259
267
  const T = ((b = r.value) == null ? void 0 : b.textContent) || "";
260
268
  i.value = T, s("change", T);
261
- }, C = (p) => {
262
- Ae(p), h();
269
+ }, C = (d) => {
270
+ Ae(d), h();
263
271
  };
264
- return (p, T) => {
272
+ return (d, T) => {
265
273
  var b, B;
266
274
  return m(), x("span", Pe, [
267
275
  $("span", {
@@ -284,7 +292,7 @@ const Ae = (n) => {
284
292
  for (const [t, l] of a)
285
293
  s[t] = l;
286
294
  return s;
287
- }, Ve = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-967e21e0"]]), Ze = ["contenteditable", "placeholder"], Oe = { contenteditable: "false" }, He = {
295
+ }, Ve = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-de0a1464"]]), Ze = ["contenteditable", "placeholder"], Oe = { contenteditable: "false" }, He = {
288
296
  id: "ai-input-prefix",
289
297
  class: "ai-input-prefix"
290
298
  }, Ue = /* @__PURE__ */ X({
@@ -315,7 +323,13 @@ const Ae = (n) => {
315
323
  default: !1
316
324
  }
317
325
  },
318
- emits: ["send", "input", "blur", "focus", "onBlockKeyArrowUp"],
326
+ emits: [
327
+ "send",
328
+ "input",
329
+ "blur",
330
+ "focus",
331
+ "onBlockKeyArrowUp"
332
+ ],
319
333
  setup(n, { expose: a, emit: s }) {
320
334
  const { rootProps: t } = oe(Q), l = s, i = n, r = w({
321
335
  themeTagText: "",
@@ -323,17 +337,20 @@ const Ae = (n) => {
323
337
  popoverContent: "",
324
338
  type: "themeTag"
325
339
  }), u = w(null), f = w([...i.templateParts]);
326
- Y(() => i.templateParts, (e) => {
327
- f.value = [...e];
328
- });
340
+ Y(
341
+ () => i.templateParts,
342
+ (e) => {
343
+ f.value = [...e];
344
+ }
345
+ );
329
346
  const h = () => {
330
347
  const e = u.value;
331
348
  e && (e.innerHTML = "", k());
332
349
  }, C = () => {
333
- var d;
334
- const e = (d = u.value) == null ? void 0 : d.textContent;
350
+ var p;
351
+ const e = (p = u.value) == null ? void 0 : p.textContent;
335
352
  e.length > i.maxLength || (l("send", e), h());
336
- }, p = () => {
353
+ }, d = () => {
337
354
  var e;
338
355
  (e = u.value) == null || e.focus(), Ke(u.value);
339
356
  }, T = (e) => {
@@ -347,10 +364,12 @@ const Ae = (n) => {
347
364
  }, k = () => {
348
365
  B.value || E();
349
366
  }, v = () => {
350
- var d, c;
351
- let e = (d = u.value) == null ? void 0 : d.textContent;
367
+ var p, c;
368
+ let e = (p = u.value) == null ? void 0 : p.textContent;
352
369
  if (r.value.themeTagText) {
353
- const y = (c = u.value) == null ? void 0 : c.querySelector(".ai-input-prefix-wrapper");
370
+ const y = (c = u.value) == null ? void 0 : c.querySelector(
371
+ ".ai-input-prefix-wrapper"
372
+ );
354
373
  if (y) {
355
374
  const D = y.textContent || "";
356
375
  e = e.replace(D, " ");
@@ -363,8 +382,8 @@ const Ae = (n) => {
363
382
  l("input", e);
364
383
  }, 50);
365
384
  }, H = (e) => {
366
- const d = i.submitShortKey === K.Enter ? !e.shiftKey : i.submitShortKey === K.ShiftEnter ? e.shiftKey : !1;
367
- if (e.key === "Enter" && d && (e.preventDefault(), C()), ["ArrowLeft", "ArrowRight", "Backspace", "Delete"].includes(e.key)) {
385
+ const p = i.submitShortKey === K.Enter ? !e.shiftKey : i.submitShortKey === K.ShiftEnter ? e.shiftKey : !1;
386
+ if (e.key === "Enter" && p && (e.preventDefault(), C()), ["ArrowLeft", "ArrowRight", "Backspace", "Delete"].includes(e.key)) {
368
387
  const c = window.getSelection();
369
388
  if (!(c != null && c.rangeCount) || !c.isCollapsed)
370
389
  return;
@@ -375,11 +394,17 @@ const Ae = (n) => {
375
394
  return;
376
395
  if (e.preventDefault(), N.contentEditable = "true", e.key === "ArrowLeft" || e.key === "ArrowRight") {
377
396
  const R = document.createRange();
378
- R.setStart(N, S === "previous" ? N.childNodes.length : 0), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
397
+ R.setStart(
398
+ N,
399
+ S === "previous" ? N.childNodes.length : 0
400
+ ), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
379
401
  } else if (e.key === "Backspace" || e.key === "Delete")
380
402
  if (N.textContent.trim()) {
381
403
  const R = document.createRange();
382
- R.setStart(N, S === "previous" ? N.childNodes.length : 0), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
404
+ R.setStart(
405
+ N,
406
+ S === "previous" ? N.childNodes.length : 0
407
+ ), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
383
408
  } else
384
409
  P.remove();
385
410
  }
@@ -391,10 +416,10 @@ const Ae = (n) => {
391
416
  const e = window.getSelection();
392
417
  if (!(e != null && e.rangeCount))
393
418
  return !0;
394
- const d = e.getRangeAt(0);
395
- if (d.startOffset !== 0)
419
+ const p = e.getRangeAt(0);
420
+ if (p.startOffset !== 0)
396
421
  return !1;
397
- let c = d.startContainer;
422
+ let c = p.startContainer;
398
423
  for (; c && !((y = c.classList) != null && y.contains("editable-container")); ) {
399
424
  if (c.previousSibling)
400
425
  return !1;
@@ -402,17 +427,17 @@ const Ae = (n) => {
402
427
  }
403
428
  return !0;
404
429
  }
405
- function L(e, d, c) {
430
+ function L(e, p, c) {
406
431
  var P;
407
432
  if (!e)
408
433
  return null;
409
434
  let y = e;
410
435
  const D = (P = e.classList) == null ? void 0 : P.contains("editable-container");
411
436
  if (D) {
412
- const N = e.childNodes, R = Math.min(d, N.length - 1);
437
+ const N = e.childNodes, R = Math.min(p, N.length - 1);
413
438
  y = N[R];
414
439
  }
415
- if (!D && c === "previous" && d !== 0 || !D && c === "next" && d !== e.textContent.length)
440
+ if (!D && c === "previous" && p !== 0 || !D && c === "next" && p !== e.textContent.length)
416
441
  return null;
417
442
  let J = null, S = y;
418
443
  for (; S; )
@@ -425,13 +450,13 @@ const Ae = (n) => {
425
450
  const I = (e) => {
426
451
  var c;
427
452
  e.preventDefault();
428
- const d = (c = (e.originalEvent || e).clipboardData) == null ? void 0 : c.getData("text/plain");
429
- he(d), k();
430
- }, M = (e, d, c) => {
453
+ const p = (c = (e.originalEvent || e).clipboardData) == null ? void 0 : c.getData("text/plain");
454
+ he(p), k();
455
+ }, M = (e, p, c) => {
431
456
  i.disabled || (f.value.push({
432
457
  key: e,
433
458
  type: "input",
434
- placeholder: d,
459
+ placeholder: p,
435
460
  content: c
436
461
  }), G(), k());
437
462
  }, U = (e) => {
@@ -441,11 +466,11 @@ const Ae = (n) => {
441
466
  type: "text",
442
467
  content: e
443
468
  }), G(), k());
444
- }, ve = (e, d, c) => {
469
+ }, ve = (e, p, c) => {
445
470
  i.disabled || (r.value = {
446
471
  themeTagText: e,
447
472
  clearInput: c || !1,
448
- popoverContent: d,
473
+ popoverContent: p,
449
474
  type: "themeTag"
450
475
  });
451
476
  }, se = () => {
@@ -456,8 +481,8 @@ const Ae = (n) => {
456
481
  type: "themeTag"
457
482
  }, E());
458
483
  }, G = () => {
459
- pe(() => {
460
- p();
484
+ de(() => {
485
+ d();
461
486
  });
462
487
  };
463
488
  return te(() => {
@@ -465,13 +490,13 @@ const Ae = (n) => {
465
490
  }), a({
466
491
  clearInput: h,
467
492
  getInput: v,
468
- focusInput: p,
493
+ focusInput: d,
469
494
  setMixTags: U,
470
495
  setText: ge,
471
496
  setInputTag: M,
472
497
  openTipTag: ve,
473
498
  closeTipTag: se
474
- }), (e, d) => {
499
+ }), (e, p) => {
475
500
  const c = Ce("d-popover");
476
501
  return m(), x("div", {
477
502
  ref_key: "editableDivRef",
@@ -494,7 +519,7 @@ const Ae = (n) => {
494
519
  trigger: "hover",
495
520
  content: r.value.popoverContent
496
521
  }, {
497
- default: de(() => [
522
+ default: pe(() => [
498
523
  $("span", Oe, [
499
524
  r.value.themeTagText ? (m(), x("span", {
500
525
  key: 0,
@@ -512,7 +537,7 @@ const Ae = (n) => {
512
537
  )
513
538
  ], !0)
514
539
  ])) : _("v-if", !0),
515
- d[0] || (d[0] = $(
540
+ p[0] || (p[0] = $(
516
541
  "span",
517
542
  {
518
543
  contenteditable: "false",
@@ -563,7 +588,7 @@ const Ae = (n) => {
563
588
  ], 42, Ze);
564
589
  };
565
590
  }
566
- }), je = /* @__PURE__ */ W(Ue, [["__scopeId", "data-v-86573c82"]]), Ye = {}, Xe = {
591
+ }), je = /* @__PURE__ */ W(Ue, [["__scopeId", "data-v-92145e12"]]), Ye = {}, Xe = {
567
592
  width: "16px",
568
593
  height: "16px",
569
594
  viewBox: "0 0 16 16",
@@ -630,13 +655,13 @@ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { cl
630
655
  f.left = T.offsetX + "px", f.top = T.offsetY + "px", u.value = !0, setTimeout(() => {
631
656
  u.value = !1;
632
657
  }, 300);
633
- }, p = (T) => {
658
+ }, d = (T) => {
634
659
  C(T), t.loading ? l("cancel") : (l("submit", s.value), i(), l("change", s.value));
635
660
  };
636
661
  return (T, b) => (m(), x("button", {
637
662
  disabled: g(t).disabled || !g(t).loading && !g(s),
638
663
  class: q(h.value),
639
- onClick: p,
664
+ onClick: d,
640
665
  onMousedown: b[0] || (b[0] = () => r.value = !0),
641
666
  onMouseup: b[1] || (b[1] = () => r.value = !1)
642
667
  }, [
@@ -687,7 +712,7 @@ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { cl
687
712
  r.value ? (o = i.value) == null || o.clearInput() : u.value = "";
688
713
  }, C = () => {
689
714
  t.autoClear && h();
690
- }, p = () => {
715
+ }, d = () => {
691
716
  var o;
692
717
  return r.value ? (o = i.value) == null ? void 0 : o.getInput() : u.value;
693
718
  }, T = (o, L, I) => {
@@ -739,7 +764,7 @@ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { cl
739
764
  B(M);
740
765
  },
741
766
  { deep: !0 }
742
- ), a({ clearInput: h, getInput: p, setInputTag: T, setText: b, setMixTags: B, openTipTag: z, closeTipTag: F }), _e(Q, { inputValue: u, rootProps: t, rootEmits: l, clearInputAfterSubmit: C }), (o, L) => (m(), x(
767
+ ), a({ clearInput: h, getInput: d, setInputTag: T, setText: b, setMixTags: B, openTipTag: z, closeTipTag: F }), _e(Q, { inputValue: u, rootProps: t, rootEmits: l, clearInputAfterSubmit: C }), (o, L) => (m(), x(
743
768
  "div",
744
769
  {
745
770
  class: q(f.value)
@@ -765,7 +790,7 @@ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { cl
765
790
  onBlur: E,
766
791
  onFocus: H
767
792
  }, {
768
- themeTag: de(({ themeTag: I }) => [
793
+ themeTag: pe(({ themeTag: I }) => [
769
794
  A(o.$slots, "themeTag", { themeTag: I })
770
795
  ]),
771
796
  _: 3
@@ -1 +1 @@
1
- .mc-introduction[data-v-31ff847b]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-31ff847b]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-31ff847b]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-31ff847b]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-31ff847b]{font-size:var(--devui-font-size, 12px)}.mc-introduction .mc-introduction-description>div[data-v-31ff847b]{line-height:1.5}.mc-introduction.filled[data-v-31ff847b]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-31ff847b]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-31ff847b]{text-align:center}.mc-introduction.left[data-v-31ff847b]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-31ff847b]{text-align:left}.mc-introduction.right[data-v-31ff847b]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-31ff847b]{text-align:right}
1
+ .mc-introduction[data-v-fd242abc]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-fd242abc]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-fd242abc]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-fd242abc]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-fd242abc]{font-size:var(--devui-font-size, 12px)}.mc-introduction .mc-introduction-description>div[data-v-fd242abc]{line-height:1.5}.mc-introduction.filled[data-v-fd242abc]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-fd242abc]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-fd242abc]{text-align:center}.mc-introduction.left[data-v-fd242abc]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-fd242abc]{text-align:left}.mc-introduction.right[data-v-fd242abc]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-fd242abc]{text-align:right}
@@ -1,6 +1,92 @@
1
1
  import "./index.css";
2
- import { defineComponent as c, createElementBlock as e, openBlock as o, normalizeClass as g, createElementVNode as a, createCommentVNode as s, renderSlot as p, normalizeStyle as m, toDisplayString as d, Fragment as f, renderList as y } from "vue";
3
- const h = {
2
+ var m = Object.defineProperty;
3
+ var y = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
4
+ var l = (r, t, e) => y(r, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as S, openBlock as a, createElementBlock as i, normalizeClass as C, unref as u, createElementVNode as p, normalizeStyle as P, createCommentVNode as c, toDisplayString as d, Fragment as b, renderList as v, renderSlot as k } from "vue";
6
+ const n = () => {
7
+ };
8
+ class g {
9
+ constructor(t) {
10
+ l(this, "_adapter");
11
+ this._adapter = { ...g.defaultAdapter, ...t };
12
+ }
13
+ static get cssClasses() {
14
+ return {};
15
+ }
16
+ static get strings() {
17
+ return {};
18
+ }
19
+ static get numbers() {
20
+ return {};
21
+ }
22
+ static get defaultAdapter() {
23
+ return {
24
+ getProp: n,
25
+ getProps: n,
26
+ getState: n,
27
+ getStates: n,
28
+ setState: n,
29
+ getContext: n,
30
+ getContexts: n,
31
+ getCache: n,
32
+ setCache: n,
33
+ getCaches: n,
34
+ stopPropagation: n
35
+ };
36
+ }
37
+ getProp(t) {
38
+ return this._adapter.getProp(t);
39
+ }
40
+ getProps() {
41
+ return this._adapter.getProps();
42
+ }
43
+ getState(t) {
44
+ return this._adapter.getState(t);
45
+ }
46
+ getStates() {
47
+ return this._adapter.getStates();
48
+ }
49
+ setState(t, e) {
50
+ return this._adapter.setState({ ...t }, e);
51
+ }
52
+ /* istanbul ignore next */
53
+ getCaches() {
54
+ return this._adapter.getCaches();
55
+ }
56
+ getCache(t) {
57
+ return this._adapter.getCache(t);
58
+ }
59
+ setCache(t, e) {
60
+ return t && this._adapter.setCache(t, e);
61
+ }
62
+ nextTick(t) {
63
+ return this._adapter.nextTick(t);
64
+ }
65
+ _isInProps(t) {
66
+ const e = this.getProps();
67
+ return t in e;
68
+ }
69
+ init(t) {
70
+ }
71
+ destroy() {
72
+ }
73
+ }
74
+ class I extends g {
75
+ constructor(t) {
76
+ super({ ...t });
77
+ }
78
+ getIntroductionClasses() {
79
+ const t = this._adapter.getProp("align"), e = this._adapter.getProp(
80
+ "background"
81
+ );
82
+ return [t, e].filter(Boolean).join(" ");
83
+ }
84
+ getLogoStyle() {
85
+ const t = this._adapter.getProp("logoWidth"), e = this._adapter.getProp("logoHeight"), s = {};
86
+ return t && (s.width = typeof t == "number" ? `${t}px` : t), e && (s.height = typeof e == "number" ? `${e}px` : e), s;
87
+ }
88
+ }
89
+ const T = {
4
90
  logoImg: {
5
91
  type: String,
6
92
  default: ""
@@ -33,74 +119,78 @@ const h = {
33
119
  type: String,
34
120
  default: "center"
35
121
  }
36
- }, v = { class: "mc-introduction-logo-container" }, b = ["src", "alt"], S = { class: "mc-introduction-title" }, k = {
122
+ }, N = { class: "mc-introduction-logo-container" }, A = ["src", "alt"], B = { class: "mc-introduction-title" }, H = {
37
123
  key: 0,
38
124
  class: "mc-introduction-sub-title"
39
- }, I = {
125
+ }, L = {
40
126
  key: 1,
41
127
  class: "mc-introduction-description"
42
- }, _ = /* @__PURE__ */ c({
128
+ }, V = /* @__PURE__ */ S({
43
129
  __name: "Introduction",
44
- props: h,
45
- setup(i) {
46
- return (t, n) => (o(), e(
130
+ props: T,
131
+ setup(r) {
132
+ const t = r, e = {
133
+ getProp: (o) => t[o],
134
+ getProps: () => t
135
+ }, s = new I(e);
136
+ return (o, $) => (a(), i(
47
137
  "div",
48
138
  {
49
- class: g(["mc-introduction", [t.align, t.background]])
139
+ class: C(["mc-introduction", u(s).getIntroductionClasses()])
50
140
  },
51
141
  [
52
- a("div", v, [
53
- t.logoImg ? (o(), e("img", {
142
+ p("div", N, [
143
+ o.logoImg ? (a(), i("img", {
54
144
  key: 0,
55
- src: t.logoImg,
56
- alt: t.title,
57
- style: m({ width: typeof t.logoWidth == "number" ? `${t.logoWidth}px` : t.logoWidth, height: typeof t.logoHeight == "number" ? `${t.logoHeight}px` : t.logoHeight })
58
- }, null, 12, b)) : s("v-if", !0),
59
- a(
145
+ src: o.logoImg,
146
+ alt: o.title,
147
+ style: P(u(s).getLogoStyle())
148
+ }, null, 12, A)) : c("v-if", !0),
149
+ p(
60
150
  "div",
61
- S,
62
- d(t.title),
151
+ B,
152
+ d(o.title),
63
153
  1
64
154
  /* TEXT */
65
155
  )
66
156
  ]),
67
- t.subTitle ? (o(), e(
157
+ o.subTitle ? (a(), i(
68
158
  "div",
69
- k,
70
- d(t.subTitle),
159
+ H,
160
+ d(o.subTitle),
71
161
  1
72
162
  /* TEXT */
73
- )) : s("v-if", !0),
74
- t.description.length ? (o(), e("div", I, [
75
- (o(!0), e(
76
- f,
163
+ )) : c("v-if", !0),
164
+ o.description.length ? (a(), i("div", L, [
165
+ (a(!0), i(
166
+ b,
77
167
  null,
78
- y(t.description, (r, l) => (o(), e(
168
+ v(o.description, (f, _) => (a(), i(
79
169
  "div",
80
- { key: l },
81
- d(r),
170
+ { key: _ },
171
+ d(f),
82
172
  1
83
173
  /* TEXT */
84
174
  ))),
85
175
  128
86
176
  /* KEYED_FRAGMENT */
87
177
  ))
88
- ])) : s("v-if", !0),
89
- p(t.$slots, "default", {}, void 0, !0)
178
+ ])) : c("v-if", !0),
179
+ k(o.$slots, "default", {}, void 0, !0)
90
180
  ],
91
181
  2
92
182
  /* CLASS */
93
183
  ));
94
184
  }
95
- }), H = (i, t) => {
96
- const n = i.__vccOpts || i;
97
- for (const [r, l] of t)
98
- n[r] = l;
99
- return n;
100
- }, u = /* @__PURE__ */ H(_, [["__scopeId", "data-v-31ff847b"]]);
101
- u.install = (i) => {
102
- i.component("McIntroduction", u);
185
+ }), W = (r, t) => {
186
+ const e = r.__vccOpts || r;
187
+ for (const [s, o] of t)
188
+ e[s] = o;
189
+ return e;
190
+ }, h = /* @__PURE__ */ W(V, [["__scopeId", "data-v-fd242abc"]]);
191
+ h.install = (r) => {
192
+ r.component("McIntroduction", h);
103
193
  };
104
194
  export {
105
- u as McIntroduction
195
+ h as McIntroduction
106
196
  };