yc-component 0.1.6 → 0.1.7

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.
@@ -1 +1 @@
1
- .ai-use-dialog[data-v-9aa82e83] .el-overlay{z-index:4000}.ai-use-dialog[data-v-9aa82e83] .el-dialog{z-index:4001}.ai-use-dialog[data-v-9aa82e83] .el-dialog__body{padding-top:8px}.ai-use-dialog__footer[data-v-9aa82e83]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.ai-use-dialog__footer-actions[data-v-9aa82e83]{display:flex;align-items:center;gap:8px;margin-left:auto}
1
+ .ai-use-dialog[data-v-a5b943e9] .el-overlay{z-index:4000}.ai-use-dialog[data-v-a5b943e9] .el-dialog{z-index:4001}.ai-use-dialog[data-v-a5b943e9] .el-dialog__body{padding-top:8px}.ai-use-dialog__footer[data-v-a5b943e9]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.ai-use-dialog__footer-actions[data-v-a5b943e9]{display:flex;align-items:center;gap:8px;margin-left:auto}
@@ -1 +1 @@
1
- {"version":3,"file":"AiUseDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiUseDialog.vue"],"names":[],"mappings":";AAgEA;AA8TA,OAAO,KAAK,EAAsC,gBAAgB,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;AAufpF,wBASG"}
1
+ {"version":3,"file":"AiUseDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiUseDialog.vue"],"names":[],"mappings":";AAgEA;AA+TA,OAAO,KAAK,EAAsC,gBAAgB,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;AAwfpF,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AiUseDialog.vue2.js";
2
2
  /* empty css */
3
- import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ a(o, [["__scopeId", "data-v-9aa82e83"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a5b943e9"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -3,8 +3,8 @@ import { ElMessage as M } from "element-plus";
3
3
  import { aiDialogState as p, hideAiDialog as Z, AI_DIALOG_OPEN_EVENT as D } from "../dialog-state.js";
4
4
  import { listPrompts as ee } from "../api/prompt.js";
5
5
  import { getAiTaskConfig as te } from "../config.js";
6
- import { useScopedAiTaskStore as oe } from "../useScopedStore.js";
7
- const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__footer-actions" }, me = /* @__PURE__ */ K({
6
+ import { useScopedAiTaskStore as le } from "../useScopedStore.js";
7
+ const oe = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__footer-actions" }, me = /* @__PURE__ */ K({
8
8
  __name: "AiUseDialog",
9
9
  props: {
10
10
  title: { default: "AI 生成" },
@@ -27,9 +27,9 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
27
27
  },
28
28
  emits: ["update:modelValue", "submitted"],
29
29
  setup(u, { emit: N }) {
30
- const o = u, A = N, P = oe(), r = O(() => o.modelValue !== void 0), n = v(!1);
30
+ const l = u, A = N, P = le(), r = O(() => l.modelValue !== void 0), n = v(!1);
31
31
  g(
32
- () => o.modelValue,
32
+ () => l.modelValue,
33
33
  (e) => {
34
34
  r.value && (n.value = !!e);
35
35
  },
@@ -58,15 +58,15 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
58
58
  globalThis.removeEventListener(D, B);
59
59
  });
60
60
  const U = O(
61
- () => (r.value ? void 0 : p.options.title) ?? o.title ?? "AI 生成"
62
- ), l = v({
63
- freeText: o.freeText,
64
- promptId: o.promptId,
65
- autoMatch: o.autoMatch
66
- }), f = v(o.prompts ? [...o.prompts] : []), y = v(!1), T = v(!1), C = v();
61
+ () => (r.value ? void 0 : p.options.title) ?? l.title ?? "AI 生成"
62
+ ), o = v({
63
+ freeText: l.freeText,
64
+ promptId: l.promptId,
65
+ autoMatch: l.autoMatch
66
+ }), f = v(l.prompts ? [...l.prompts] : []), y = v(!1), T = v(!1), C = v();
67
67
  function V(e) {
68
68
  var t, s;
69
- l.value.freeText = e.freeText ?? o.freeText ?? "", l.value.promptId = e.promptId ?? o.promptId, l.value.autoMatch = e.autoMatch ?? o.autoMatch ?? !1, C.value = e.onFinish, (t = e.prompts) != null && t.length ? f.value = [...e.prompts] : (s = o.prompts) != null && s.length && (f.value = [...o.prompts]);
69
+ o.value.freeText = e.freeText ?? l.freeText ?? "", o.value.promptId = e.promptId ?? l.promptId, o.value.autoMatch = e.autoMatch ?? l.autoMatch ?? !1, C.value = e.onFinish, (t = e.prompts) != null && t.length ? f.value = [...e.prompts] : (s = l.prompts) != null && s.length && (f.value = [...l.prompts]);
70
70
  }
71
71
  async function F() {
72
72
  if (!(f.value.length > 0)) {
@@ -82,44 +82,44 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
82
82
  }
83
83
  }
84
84
  function q() {
85
- r.value ? V({}) : V(p.options), o.showPromptSelect && F();
85
+ r.value ? V({}) : V(p.options), l.showPromptSelect && F();
86
86
  }
87
87
  g(
88
- () => o.prompts,
88
+ () => l.prompts,
89
89
  (e) => {
90
90
  e != null && e.length && (f.value = [...e]);
91
91
  },
92
92
  { deep: !0 }
93
93
  ), g(
94
- () => [o.freeText, o.promptId, o.autoMatch],
94
+ () => [l.freeText, l.promptId, l.autoMatch],
95
95
  ([e, t, s]) => {
96
- n.value || (l.value.freeText = e ?? "", l.value.promptId = t, l.value.autoMatch = s ?? !1);
96
+ n.value || (o.value.freeText = e ?? "", o.value.promptId = t, o.value.autoMatch = s ?? !1);
97
97
  }
98
98
  );
99
99
  function G() {
100
- l.value.autoMatch && (l.value.promptId = void 0);
100
+ o.value.autoMatch && (o.value.promptId = void 0);
101
101
  }
102
102
  function J() {
103
103
  T.value = !1;
104
104
  }
105
105
  function $() {
106
- P.showPanel();
106
+ P.showPanel(), n.value = !1;
107
107
  }
108
108
  async function j() {
109
109
  var x, w;
110
- if (!l.value.freeText.trim()) {
110
+ if (!o.value.freeText.trim()) {
111
111
  M.warning("请填写需求描述");
112
112
  return;
113
113
  }
114
- const e = l.value.autoMatch, t = e ? void 0 : l.value.promptId;
114
+ const e = o.value.autoMatch, t = e ? void 0 : o.value.promptId;
115
115
  if (!e && t == null) {
116
- const I = o.showPromptSelect || o.showAutoMatch ? "请选择提示词或开启自动匹配" : "请通过 promptId 传入提示词,或设置 autoMatch 为 true";
116
+ const I = l.showPromptSelect || l.showAutoMatch ? "请选择提示词或开启自动匹配" : "请通过 promptId 传入提示词,或设置 autoMatch 为 true";
117
117
  M.warning(I);
118
118
  return;
119
119
  }
120
120
  T.value = !0;
121
121
  const s = r.value ? C.value : p.options.onFinish, c = P.enqueue({
122
- freeText: l.value.freeText.trim(),
122
+ freeText: o.value.freeText.trim(),
123
123
  promptId: t,
124
124
  autoMatch: e && t == null ? !0 : void 0,
125
125
  showPanel: !0,
@@ -140,7 +140,7 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
140
140
  onOpen: q
141
141
  }, {
142
142
  footer: i(() => [
143
- S("div", le, [
143
+ S("div", oe, [
144
144
  u.showTaskListButton ? (h(), b(k, {
145
145
  key: 0,
146
146
  link: "",
@@ -183,8 +183,8 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
183
183
  }, {
184
184
  default: i(() => [
185
185
  m(s, {
186
- modelValue: l.value.autoMatch,
187
- "onUpdate:modelValue": t[0] || (t[0] = (a) => l.value.autoMatch = a),
186
+ modelValue: o.value.autoMatch,
187
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => o.value.autoMatch = a),
188
188
  "active-text": "按需求自动选",
189
189
  "inactive-text": "手动指定",
190
190
  onChange: G
@@ -195,15 +195,15 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
195
195
  u.showPromptSelect ? (h(), b(c, {
196
196
  key: 1,
197
197
  label: u.promptLabel,
198
- required: !l.value.autoMatch
198
+ required: !o.value.autoMatch
199
199
  }, {
200
200
  default: i(() => [
201
201
  m(w, {
202
- modelValue: l.value.promptId,
203
- "onUpdate:modelValue": t[1] || (t[1] = (a) => l.value.promptId = a),
202
+ modelValue: o.value.promptId,
203
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o.value.promptId = a),
204
204
  filterable: "",
205
205
  clearable: "",
206
- placeholder: l.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
206
+ placeholder: o.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
207
207
  style: { width: "100%" },
208
208
  loading: y.value
209
209
  }, {
@@ -225,8 +225,8 @@ const le = { class: "ai-use-dialog__footer" }, ae = { class: "ai-use-dialog__foo
225
225
  }, {
226
226
  default: i(() => [
227
227
  m(I, {
228
- modelValue: l.value.freeText,
229
- "onUpdate:modelValue": t[2] || (t[2] = (a) => l.value.freeText = a),
228
+ modelValue: o.value.freeText,
229
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o.value.freeText = a),
230
230
  type: "textarea",
231
231
  rows: 4,
232
232
  placeholder: u.freeTextPlaceholder
@@ -1,3 +1,3 @@
1
1
  .ai-task-panel[data-v-00f57154]{position:fixed;right:24px;bottom:24px;width:420px;max-height:min(520px,100vh - 48px);display:flex;flex-direction:column;background:var(--el-bg-color);border-radius:12px;box-shadow:0 8px 32px #0000001f;border:1px solid var(--el-border-color-lighter);z-index:3000;overflow:hidden}.ai-task-panel__header[data-v-00f57154]{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 16px 12px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-panel__header-left[data-v-00f57154]{display:flex;gap:12px;align-items:center;min-width:0}.ai-task-panel__icon[data-v-00f57154]{width:44px;height:44px;border-radius:50%;background:var(--el-color-primary-light-9);color:var(--el-color-primary);display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}.ai-task-panel__subtitle[data-v-00f57154]{font-size:12px;color:var(--el-text-color-secondary)}.ai-task-panel__title[data-v-00f57154]{font-size:18px;font-weight:700;color:var(--el-text-color-primary);line-height:1.3}.ai-task-panel__header-actions[data-v-00f57154]{display:flex;align-items:center;gap:4px;flex-shrink:0}.ai-task-panel__body[data-v-00f57154]{flex:1;overflow:auto;padding:8px 0}.ai-task-list[data-v-00f57154]{display:flex;flex-direction:column}.ai-task-row[data-v-00f57154]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-row[data-v-00f57154]:last-child{border-bottom:none}.ai-task-row__icon[data-v-00f57154]{width:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.ai-task-row__icon .ok[data-v-00f57154]{color:var(--el-color-success);font-size:28px}.ai-task-row__icon .err[data-v-00f57154]{color:var(--el-color-danger);font-size:28px}.ai-task-row__icon .muted[data-v-00f57154]{color:var(--el-text-color-secondary);font-size:24px}.ai-task-row__main[data-v-00f57154]{flex:1;min-width:0}.ai-task-row__title[data-v-00f57154]{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-task-row__meta[data-v-00f57154]{font-size:12px;color:var(--el-text-color-secondary);margin-top:2px}.ai-task-row__summary[data-v-00f57154]{font-size:12px;color:var(--el-text-color-regular);margin-top:4px;line-height:1.4}.ai-task-row__ops[data-v-00f57154]{flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:2px}.ai-task-panel__footer[data-v-00f57154]{padding:8px 16px;border-top:1px solid var(--el-border-color-extra-light);text-align:center}.ai-task-panel-mini[data-v-00f57154]{position:fixed;right:24px;bottom:24px;z-index:3000;display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--el-bg-color);border-radius:24px;box-shadow:0 4px 16px #0000001f;border:1px solid var(--el-border-color-lighter);cursor:pointer;font-size:13px;color:var(--el-text-color-primary)}.ai-task-panel-mini[data-v-00f57154]:hover{border-color:var(--el-color-primary-light-5)}.spinning[data-v-00f57154]{animation:ai-spin-00f57154 1.2s linear infinite}@keyframes ai-spin-00f57154{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ai-panel-slide-enter-active[data-v-00f57154],.ai-panel-slide-leave-active[data-v-00f57154]{transition:all .25s ease}.ai-panel-slide-enter-from[data-v-00f57154],.ai-panel-slide-leave-to[data-v-00f57154]{opacity:0;transform:translateY(16px)}.m-l-8[data-v-00f57154]{margin-left:8px}
2
2
 
3
- .ai-use-dialog[data-v-9aa82e83] .el-overlay{z-index:4000}.ai-use-dialog[data-v-9aa82e83] .el-dialog{z-index:4001}.ai-use-dialog[data-v-9aa82e83] .el-dialog__body{padding-top:8px}.ai-use-dialog__footer[data-v-9aa82e83]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.ai-use-dialog__footer-actions[data-v-9aa82e83]{display:flex;align-items:center;gap:8px;margin-left:auto}
3
+ .ai-use-dialog[data-v-a5b943e9] .el-overlay{z-index:4000}.ai-use-dialog[data-v-a5b943e9] .el-dialog{z-index:4001}.ai-use-dialog[data-v-a5b943e9] .el-dialog__body{padding-top:8px}.ai-use-dialog__footer[data-v-a5b943e9]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.ai-use-dialog__footer-actions[data-v-a5b943e9]{display:flex;align-items:center;gap:8px;margin-left:auto}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-component",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "天幕低代码 Vue3 组件库(AI 任务、PageWindow)",
5
5
  "type": "module",
6
6
  "sideEffects": [