@opentiny/tiny-robot 0.2.0-alpha.0 → 0.2.0-alpha.2
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/action-group/ActionGroup.vue.d.ts +26 -0
- package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
- package/dist/action-group/index.d.ts +12 -0
- package/dist/action-group/index.type.d.ts +17 -0
- package/dist/bubble/index.d.ts +2 -2
- package/dist/bubble/index.type.d.ts +16 -18
- package/dist/feedback/components/SourceList.vue.d.ts +11 -0
- package/dist/feedback/components/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +7 -0
- package/dist/feedback/index.type.d.ts +25 -0
- package/dist/feedback/index.vue.d.ts +13 -0
- package/dist/history/components/index.d.ts +2 -0
- package/dist/history/components/item-tag.vue.d.ts +5 -0
- package/dist/history/components/search-empty.vue.d.ts +7 -0
- package/dist/history/composables/index.d.ts +1 -0
- package/dist/history/composables/useEditItemTitle.d.ts +12 -0
- package/dist/history/index.d.ts +6 -0
- package/dist/history/index.type.d.ts +43 -0
- package/dist/history/index.vue.d.ts +2 -0
- package/dist/icon-button/index.d.ts +7 -0
- package/dist/icon-button/index.type.d.ts +6 -0
- package/dist/icon-button/index.vue.d.ts +6 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +57 -27
- package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +1335 -884
- package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +660 -144
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +85 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-locale@3.22.0/node_modules/@opentiny/vue-locale/lib/index.js +1783 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/index.js +77 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/index.js +176 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/pc.js +248 -0
- package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +310 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +110 -0
- package/dist/packages/components/src/action-group/ActionGroup.vue.js +7 -0
- package/dist/packages/components/src/action-group/ActionGroup.vue2.js +121 -0
- package/dist/packages/components/src/action-group/ActionGroupItem.vue.js +14 -0
- package/dist/packages/components/src/action-group/ActionGroupItem.vue2.js +4 -0
- package/dist/packages/components/src/action-group/index.js +17 -0
- package/dist/packages/components/src/bubble/Bubble.vue.js +7 -0
- package/dist/packages/components/src/bubble/Bubble.vue2.js +76 -0
- package/dist/packages/components/src/bubble/BubbleList.vue.js +7 -0
- package/dist/packages/components/src/bubble/BubbleList.vue2.js +50 -0
- package/dist/packages/components/src/bubble/index.js +2 -2
- package/dist/packages/components/src/container/index.vue.js +2 -2
- package/dist/packages/components/src/container/index.vue2.js +36 -36
- package/dist/packages/components/src/feedback/components/SourceList.vue.js +7 -0
- package/dist/packages/components/src/feedback/components/SourceList.vue2.js +52 -0
- package/dist/packages/components/src/feedback/index.js +9 -0
- package/dist/packages/components/src/feedback/index.vue.js +7 -0
- package/dist/packages/components/src/feedback/index.vue2.js +143 -0
- package/dist/packages/components/src/history/components/item-tag.vue.js +7 -0
- package/dist/packages/components/src/history/components/item-tag.vue2.js +21 -0
- package/dist/packages/components/src/history/components/search-empty.vue.js +7 -0
- package/dist/packages/components/src/history/components/search-empty.vue2.js +20 -0
- package/dist/packages/components/src/history/composables/useEditItemTitle.js +43 -0
- package/dist/packages/components/src/history/index.js +11 -0
- package/dist/packages/components/src/history/index.vue.js +7 -0
- package/dist/packages/components/src/history/index.vue2.js +130 -0
- package/dist/packages/components/src/icon-button/index.js +9 -0
- package/dist/packages/components/src/icon-button/index.vue.js +7 -0
- package/dist/packages/components/src/icon-button/index.vue2.js +22 -0
- package/dist/packages/components/src/prompts/prompt.vue.js +2 -2
- package/dist/packages/components/src/prompts/prompt.vue2.js +17 -15
- package/dist/packages/components/src/question/components/HotQuestions.vue.js +23 -23
- package/dist/packages/components/src/question/index.vue.js +18 -18
- package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +7 -0
- package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +175 -0
- package/dist/packages/components/src/sender/index.vue.js +149 -128
- package/dist/packages/components/src/suggestion/components/CategoryNav.vue.js +38 -0
- package/dist/packages/components/src/suggestion/components/CategoryNav.vue2.js +4 -0
- package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue.js +107 -0
- package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue2.js +4 -0
- package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue.js +123 -0
- package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue2.js +4 -0
- package/dist/packages/components/src/suggestion/composables/useKeyboardNavigation.js +45 -0
- package/dist/packages/components/src/suggestion/composables/useTriggerDetection.js +17 -0
- package/dist/packages/components/src/suggestion/index.js +9 -0
- package/dist/packages/components/src/suggestion/index.vue.js +179 -0
- package/dist/packages/components/src/suggestion/index.vue2.js +4 -0
- package/dist/packages/components/src/suggestion/utils/dom.js +18 -0
- package/dist/packages/svgs/dist/tiny-robot-svgs.js +306 -90
- package/dist/question/components/HotQuestions.vue.d.ts +2 -2
- package/dist/sender/components/TemplateEditor.vue.d.ts +18 -0
- package/dist/sender/index.type.d.ts +47 -0
- package/dist/sender/index.vue.d.ts +70 -5
- package/dist/style.css +1 -1
- package/dist/suggestion/components/CategoryNav.vue.d.ts +45 -0
- package/dist/suggestion/components/SuggestionCapsule.vue.d.ts +32 -0
- package/dist/suggestion/components/SuggestionPanel.vue.d.ts +84 -0
- package/dist/suggestion/composables/useKeyboardNavigation.d.ts +18 -0
- package/dist/suggestion/composables/useSuggestionFilter.d.ts +10 -0
- package/dist/suggestion/composables/useTriggerDetection.d.ts +11 -0
- package/dist/suggestion/index.d.ts +7 -0
- package/dist/suggestion/index.type.d.ts +94 -0
- package/dist/suggestion/index.vue.d.ts +343 -0
- package/dist/suggestion/utils/dom.d.ts +20 -0
- package/package.json +4 -3
- package/src/action-group/ActionGroup.vue +247 -0
- package/src/action-group/ActionGroupItem.vue +9 -0
- package/src/action-group/index.ts +25 -0
- package/src/action-group/index.type.ts +21 -0
- package/src/bubble/Bubble.vue +153 -0
- package/src/bubble/BubbleList.vue +55 -0
- package/src/bubble/index.ts +2 -2
- package/src/bubble/index.type.ts +7 -21
- package/src/container/index.vue +10 -36
- package/src/feedback/components/SourceList.vue +112 -0
- package/src/feedback/components/index.ts +1 -0
- package/src/feedback/index.ts +12 -0
- package/src/feedback/index.type.ts +27 -0
- package/src/feedback/index.vue +166 -0
- package/src/history/components/index.ts +2 -0
- package/src/history/components/item-tag.vue +49 -0
- package/src/history/components/search-empty.vue +38 -0
- package/src/history/composables/index.ts +1 -0
- package/src/history/composables/useEditItemTitle.ts +75 -0
- package/src/history/index.ts +12 -0
- package/src/history/index.type.ts +50 -0
- package/src/history/index.vue +292 -0
- package/src/icon-button/index.ts +12 -0
- package/src/icon-button/index.type.ts +7 -0
- package/src/icon-button/index.vue +58 -0
- package/src/index.ts +33 -1
- package/src/prompts/prompt.vue +7 -21
- package/src/question/components/HotQuestions.vue +1 -1
- package/src/question/index.less +9 -10
- package/src/sender/components/TemplateEditor.vue +465 -0
- package/src/sender/index.less +17 -7
- package/src/sender/index.type.ts +51 -0
- package/src/sender/index.vue +56 -8
- package/src/sender/vars.less +3 -3
- package/src/suggestion/components/CategoryNav.vue +38 -0
- package/src/suggestion/components/SuggestionCapsule.vue +183 -0
- package/src/suggestion/components/SuggestionPanel.vue +147 -0
- package/src/suggestion/composables/useKeyboardNavigation.ts +101 -0
- package/src/suggestion/composables/useSuggestionFilter.ts +34 -0
- package/src/suggestion/composables/useTriggerDetection.ts +46 -0
- package/src/suggestion/index.less +497 -0
- package/src/suggestion/index.ts +12 -0
- package/src/suggestion/index.type.ts +101 -0
- package/src/suggestion/index.vue +338 -0
- package/src/suggestion/utils/dom.ts +66 -0
- package/src/suggestion/vars.less +141 -0
- package/dist/bubble/components/actions/copy.vue.d.ts +0 -10
- package/dist/bubble/components/actions/index.d.ts +0 -2
- package/dist/bubble/components/actions/refresh.vue.d.ts +0 -2
- package/dist/bubble/useScroll.d.ts +0 -4
- package/dist/packages/components/src/bubble/bubble-list.vue.js +0 -7
- package/dist/packages/components/src/bubble/bubble-list.vue2.js +0 -37
- package/dist/packages/components/src/bubble/bubble.vue.js +0 -7
- package/dist/packages/components/src/bubble/bubble.vue2.js +0 -118
- package/dist/packages/components/src/bubble/components/actions/copy.vue.js +0 -7
- package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +0 -35
- package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +0 -7
- package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +0 -16
- package/dist/packages/components/src/bubble/useScroll.js +0 -13
- package/src/bubble/bubble-list.vue +0 -42
- package/src/bubble/bubble.vue +0 -247
- package/src/bubble/components/actions/copy.vue +0 -54
- package/src/bubble/components/actions/index.ts +0 -2
- package/src/bubble/components/actions/refresh.vue +0 -31
- package/src/bubble/useScroll.ts +0 -14
- /package/dist/bubble/{bubble-list.vue.d.ts → BubbleList.vue.d.ts} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as h, useTemplateRef as v, computed as B, watch as S, createElementBlock as f, openBlock as s, Fragment as k, renderList as i, createBlock as m, mergeProps as p, createSlots as y, withCtx as x, resolveDynamicComponent as I } from "vue";
|
|
2
|
+
import { useScroll as w } from "../../../../node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import L from "./Bubble.vue.js";
|
|
4
|
+
const P = {
|
|
5
|
+
class: "tr-bubble-list",
|
|
6
|
+
ref: "scrollContainer"
|
|
7
|
+
}, F = /* @__PURE__ */ h({
|
|
8
|
+
__name: "BubbleList",
|
|
9
|
+
props: {
|
|
10
|
+
items: {},
|
|
11
|
+
roles: {},
|
|
12
|
+
autoScroll: { type: Boolean }
|
|
13
|
+
},
|
|
14
|
+
setup(_) {
|
|
15
|
+
const o = _, n = v("scrollContainer"), { y: b } = w(n, {
|
|
16
|
+
behavior: "smooth",
|
|
17
|
+
throttle: 100
|
|
18
|
+
}), d = B(() => o.items.at(-1));
|
|
19
|
+
S([() => o.items.length, () => {
|
|
20
|
+
var e;
|
|
21
|
+
return (e = d.value) == null ? void 0 : e.content;
|
|
22
|
+
}], () => {
|
|
23
|
+
!o.autoScroll || !n.value || (b.value = n.value.scrollHeight);
|
|
24
|
+
});
|
|
25
|
+
const C = (e) => {
|
|
26
|
+
var l;
|
|
27
|
+
const c = e.role ? ((l = o.roles) == null ? void 0 : l[e.role]) || {} : {}, { slots: t, ...u } = c, { slots: g, ...r } = e;
|
|
28
|
+
return { ...u, ...r };
|
|
29
|
+
}, a = (e) => {
|
|
30
|
+
var t;
|
|
31
|
+
return { ...(e.role ? ((t = o.roles) == null ? void 0 : t[e.role]) || {} : {}).slots, ...e.slots };
|
|
32
|
+
};
|
|
33
|
+
return (e, c) => (s(), f("div", P, [
|
|
34
|
+
(s(!0), f(k, null, i(o.items, (t, u) => (s(), m(L, p({
|
|
35
|
+
key: t.id || u,
|
|
36
|
+
ref_for: !0
|
|
37
|
+
}, C(t)), y({ _: 2 }, [
|
|
38
|
+
i(a(t), (g, r) => ({
|
|
39
|
+
name: r,
|
|
40
|
+
fn: x((l) => [
|
|
41
|
+
(s(), m(I(a(t)[r]), p({ ref_for: !0 }, l), null, 16))
|
|
42
|
+
])
|
|
43
|
+
}))
|
|
44
|
+
]), 1040))), 128))
|
|
45
|
+
], 512));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
F as default
|
|
50
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-81c9f59e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent as f, useCssVars as v, useModel as
|
|
2
|
-
import { IconCancelFullScreen as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as f, useCssVars as v, useModel as a, computed as m, createElementBlock as _, openBlock as w, createElementVNode as n, renderSlot as t, createVNode as c, unref as r } from "vue";
|
|
2
|
+
import { IconCancelFullScreen as g, IconFullScreen as h, IconClose as $ } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
import "../icon-button/index.js";
|
|
4
|
+
import u from "../icon-button/index.vue.js";
|
|
5
|
+
const C = { class: "tr-container" }, b = { class: "tr-container__header" }, B = { class: "tr-container__header-operations" }, I = { class: "tr-container__footer" }, N = /* @__PURE__ */ f({
|
|
4
6
|
__name: "index",
|
|
5
7
|
props: {
|
|
6
8
|
show: { type: Boolean, required: !0 },
|
|
@@ -9,47 +11,45 @@ const $ = { class: "tr-container" }, g = { class: "tr-container__header" }, C =
|
|
|
9
11
|
fullscreenModifiers: {}
|
|
10
12
|
},
|
|
11
13
|
emits: ["update:show", "update:fullscreen"],
|
|
12
|
-
setup(
|
|
14
|
+
setup(l) {
|
|
13
15
|
v((o) => ({
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
b67b7ee6: s.value ? "0" : "unset",
|
|
17
|
+
"72873ea0": s.value ? "unset" : "var(--tr-container-width)",
|
|
18
|
+
"224ae4c1": i.value ? "100" : "-1",
|
|
19
|
+
cb10cae2: i.value ? "1" : "0"
|
|
18
20
|
}));
|
|
19
|
-
const
|
|
20
|
-
return (o,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const i = a(l, "show"), s = a(l, "fullscreen"), d = m(() => s.value ? g : h);
|
|
22
|
+
return (o, e) => (w(), _("div", C, [
|
|
23
|
+
e[3] || (e[3] = n("div", { class: "tr-container__dragging-bar-wrapper" }, [
|
|
24
|
+
n("div", { class: "tr-container__dragging-bar" })
|
|
23
25
|
], -1)),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
])
|
|
26
|
+
n("div", b, [
|
|
27
|
+
t(o.$slots, "title", {}, () => [
|
|
28
|
+
e[2] || (e[2] = n("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
|
|
29
|
+
]),
|
|
30
|
+
n("div", B, [
|
|
31
|
+
t(o.$slots, "operations"),
|
|
32
|
+
c(r(u), {
|
|
33
|
+
size: "28",
|
|
34
|
+
"svg-size": "20",
|
|
35
|
+
icon: d.value,
|
|
36
|
+
onClick: e[0] || (e[0] = (p) => o.$emit("update:fullscreen", !s.value))
|
|
37
|
+
}, null, 8, ["icon"]),
|
|
38
|
+
c(r(u), {
|
|
39
|
+
size: "28",
|
|
40
|
+
"svg-size": "20",
|
|
41
|
+
icon: r($),
|
|
42
|
+
onClick: e[1] || (e[1] = (p) => o.$emit("update:show", !1))
|
|
43
|
+
}, null, 8, ["icon"])
|
|
42
44
|
])
|
|
43
45
|
]),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
e("div", k, [
|
|
48
|
-
n(o.$slots, "footer", {}, void 0, !0)
|
|
46
|
+
t(o.$slots, "default"),
|
|
47
|
+
n("div", I, [
|
|
48
|
+
t(o.$slots, "footer")
|
|
49
49
|
])
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
N as default
|
|
55
55
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineComponent as I, ref as i, computed as L, onMounted as g, watch as h, createElementBlock as n, openBlock as r, createCommentVNode as c, Fragment as v, renderList as A, toDisplayString as d, createVNode as C, unref as T, nextTick as b } from "vue";
|
|
2
|
+
import { IconArrowUp as w } from "../../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
const x = { class: "tr-feedback__source-list" }, E = ["href"], M = /* @__PURE__ */ I({
|
|
4
|
+
__name: "SourceList",
|
|
5
|
+
props: {
|
|
6
|
+
sources: {},
|
|
7
|
+
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
8
|
+
},
|
|
9
|
+
setup(k) {
|
|
10
|
+
const a = k, u = i(!1), p = i([]), l = i(null), f = () => {
|
|
11
|
+
b(() => {
|
|
12
|
+
const s = p.value.map((t) => (t == null ? void 0 : t.offsetTop) || 0), e = Array.from(new Set(s));
|
|
13
|
+
if (e.length > a.linesLimit) {
|
|
14
|
+
const t = e[a.linesLimit - 1], o = s.lastIndexOf(t);
|
|
15
|
+
l.value = o;
|
|
16
|
+
} else
|
|
17
|
+
l.value = null;
|
|
18
|
+
});
|
|
19
|
+
}, _ = L(() => a.sources.length - (l.value || 0));
|
|
20
|
+
g(f), h(() => a.sources, f);
|
|
21
|
+
const y = (s, e) => {
|
|
22
|
+
s && (p.value[e] = s);
|
|
23
|
+
};
|
|
24
|
+
return (s, e) => (r(), n("div", x, [
|
|
25
|
+
(r(!0), n(v, null, A(a.sources, (t, o) => (r(), n(v, { key: o }, [
|
|
26
|
+
!l.value || u.value || o < l.value ? (r(), n("a", {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "pill",
|
|
29
|
+
href: t.link,
|
|
30
|
+
target: "_blank",
|
|
31
|
+
ref_for: !0,
|
|
32
|
+
ref: (m) => y(m, o)
|
|
33
|
+
}, d(t.label), 9, E)) : c("", !0),
|
|
34
|
+
l.value && !u.value && o === l.value ? (r(), n("span", {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "pill",
|
|
37
|
+
onClick: e[0] || (e[0] = (m) => u.value = !0)
|
|
38
|
+
}, d(_.value) + "+ ", 1)) : c("", !0)
|
|
39
|
+
], 64))), 128)),
|
|
40
|
+
u.value ? (r(), n("span", {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "pill collapse-pill",
|
|
43
|
+
onClick: e[1] || (e[1] = (t) => u.value = !1)
|
|
44
|
+
}, [
|
|
45
|
+
C(T(w))
|
|
46
|
+
])) : c("", !0)
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
M as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { defineComponent as R, ref as T, createElementBlock as p, openBlock as o, createElementVNode as a, createCommentVNode as _, createBlock as l, unref as t, withCtx as c, Fragment as C, renderList as x, createVNode as f, createTextVNode as X, toDisplayString as k, resolveDynamicComponent as h } from "vue";
|
|
2
|
+
import { IconArrowDown as b, IconArrowUp as N, IconDislike as z, IconLike as O, IconRefresh as U, IconCopy as Z } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
import w from "../../../../node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/index.js";
|
|
4
|
+
import { ActionGroupItem as S } from "../action-group/index.js";
|
|
5
|
+
import "../icon-button/index.js";
|
|
6
|
+
import j from "./components/SourceList.vue.js";
|
|
7
|
+
import B from "../action-group/ActionGroup.vue.js";
|
|
8
|
+
import q from "../icon-button/index.vue.js";
|
|
9
|
+
const H = { class: "tr-feedback" }, J = { class: "tr-feedback__operations" }, K = { class: "tr-feedback__operations-left" }, P = { key: 1 }, Q = { class: "tr-feedback__operations-right" }, W = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "tr-feedback__footer"
|
|
12
|
+
}, Y = { key: 0 }, ae = /* @__PURE__ */ R({
|
|
13
|
+
__name: "index",
|
|
14
|
+
props: {
|
|
15
|
+
operations: {},
|
|
16
|
+
operationsLimit: { default: Number.MAX_SAFE_INTEGER },
|
|
17
|
+
actions: {},
|
|
18
|
+
actionsLimit: { default: Number.MAX_SAFE_INTEGER },
|
|
19
|
+
sources: {},
|
|
20
|
+
sourcesLinesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
21
|
+
},
|
|
22
|
+
emits: ["operation", "action"],
|
|
23
|
+
setup(D, { emit: G }) {
|
|
24
|
+
const e = D, V = {
|
|
25
|
+
copy: Z,
|
|
26
|
+
refresh: U,
|
|
27
|
+
like: O,
|
|
28
|
+
dislike: z
|
|
29
|
+
}, y = G, F = (m) => {
|
|
30
|
+
var r, n, i;
|
|
31
|
+
(i = (n = (r = e.operations) == null ? void 0 : r.find((d) => d.name === m)) == null ? void 0 : n.onClick) == null || i.call(n), y("operation", m);
|
|
32
|
+
}, M = (m) => {
|
|
33
|
+
var r, n, i;
|
|
34
|
+
(i = (n = (r = e.actions) == null ? void 0 : r.find((d) => d.name === m)) == null ? void 0 : n.onClick) == null || i.call(n), y("action", m);
|
|
35
|
+
}, u = T(!1), v = () => {
|
|
36
|
+
u.value = !u.value;
|
|
37
|
+
};
|
|
38
|
+
return (m, r) => {
|
|
39
|
+
var n, i, d, g, I, L, E, A;
|
|
40
|
+
return o(), p("div", H, [
|
|
41
|
+
a("div", J, [
|
|
42
|
+
a("div", K, [
|
|
43
|
+
(n = e.operations) != null && n.length ? (o(), l(t(B), {
|
|
44
|
+
key: 0,
|
|
45
|
+
"max-num": e.operationsLimit,
|
|
46
|
+
"drop-down-show-label-only": !0,
|
|
47
|
+
onItemClick: F,
|
|
48
|
+
class: "tr-feedback__operations-left-action-group"
|
|
49
|
+
}, {
|
|
50
|
+
moreBtn: c(() => [
|
|
51
|
+
f(t(w), {
|
|
52
|
+
round: "",
|
|
53
|
+
size: "mini",
|
|
54
|
+
"reset-time": 0,
|
|
55
|
+
class: "tr-feedback__operations-more-btn"
|
|
56
|
+
}, {
|
|
57
|
+
default: c(() => [
|
|
58
|
+
r[0] || (r[0] = a("span", null, "更多", -1)),
|
|
59
|
+
f(t(b))
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
})
|
|
63
|
+
]),
|
|
64
|
+
default: c(() => [
|
|
65
|
+
(o(!0), p(C, null, x(e.operations, (s) => (o(), l(t(S), {
|
|
66
|
+
key: s.name,
|
|
67
|
+
name: s.name,
|
|
68
|
+
label: s.label
|
|
69
|
+
}, {
|
|
70
|
+
default: c(() => [
|
|
71
|
+
f(t(w), {
|
|
72
|
+
round: "",
|
|
73
|
+
"reset-time": 0,
|
|
74
|
+
size: "mini"
|
|
75
|
+
}, {
|
|
76
|
+
default: c(() => [
|
|
77
|
+
X(k(s.label), 1)
|
|
78
|
+
]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, 1024)
|
|
81
|
+
]),
|
|
82
|
+
_: 2
|
|
83
|
+
}, 1032, ["name", "label"]))), 128))
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}, 8, ["max-num"])) : (i = e.sources) != null && i.length ? (o(), p("div", P, [
|
|
87
|
+
a("span", {
|
|
88
|
+
class: "tr-feedback__source",
|
|
89
|
+
onClick: v
|
|
90
|
+
}, [
|
|
91
|
+
a("span", null, k((d = e.sources) == null ? void 0 : d.length) + "条来源", 1),
|
|
92
|
+
(o(), l(h(u.value ? t(N) : t(b))))
|
|
93
|
+
])
|
|
94
|
+
])) : _("", !0)
|
|
95
|
+
]),
|
|
96
|
+
a("div", Q, [
|
|
97
|
+
f(t(B), {
|
|
98
|
+
"max-num": e.actionsLimit,
|
|
99
|
+
"show-tooltip": !0,
|
|
100
|
+
onItemClick: M
|
|
101
|
+
}, {
|
|
102
|
+
default: c(() => [
|
|
103
|
+
(o(!0), p(C, null, x(e.actions, (s) => (o(), l(t(S), {
|
|
104
|
+
key: s.name,
|
|
105
|
+
name: s.name,
|
|
106
|
+
label: s.label
|
|
107
|
+
}, {
|
|
108
|
+
default: c(() => [
|
|
109
|
+
typeof s.icon == "string" ? (o(), l(t(q), {
|
|
110
|
+
key: 0,
|
|
111
|
+
icon: V[s.icon]
|
|
112
|
+
}, null, 8, ["icon"])) : (o(), l(h(s.icon), { key: 1 }))
|
|
113
|
+
]),
|
|
114
|
+
_: 2
|
|
115
|
+
}, 1032, ["name", "label"]))), 128))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 8, ["max-num"])
|
|
119
|
+
])
|
|
120
|
+
]),
|
|
121
|
+
(g = e.operations) != null && g.length && ((I = e.sources) != null && I.length) || u.value && e.sources ? (o(), p("div", W, [
|
|
122
|
+
(L = e.operations) != null && L.length && ((E = e.sources) != null && E.length) ? (o(), p("div", Y, [
|
|
123
|
+
a("span", {
|
|
124
|
+
class: "tr-feedback__source",
|
|
125
|
+
onClick: v
|
|
126
|
+
}, [
|
|
127
|
+
a("span", null, k((A = e.sources) == null ? void 0 : A.length) + "条来源", 1),
|
|
128
|
+
(o(), l(h(u.value ? t(N) : t(b))))
|
|
129
|
+
])
|
|
130
|
+
])) : _("", !0),
|
|
131
|
+
u.value && e.sources ? (o(), l(t(j), {
|
|
132
|
+
key: 1,
|
|
133
|
+
sources: e.sources,
|
|
134
|
+
"lines-limit": e.sourcesLinesLimit
|
|
135
|
+
}, null, 8, ["sources", "lines-limit"])) : _("", !0)
|
|
136
|
+
])) : _("", !0)
|
|
137
|
+
]);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
export {
|
|
142
|
+
ae as default
|
|
143
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as l, createElementBlock as a, openBlock as n, normalizeStyle as o, normalizeClass as s, createElementVNode as r, toDisplayString as p } from "vue";
|
|
2
|
+
const y = /* @__PURE__ */ l({
|
|
3
|
+
__name: "item-tag",
|
|
4
|
+
props: {
|
|
5
|
+
text: {},
|
|
6
|
+
type: { default: "default" },
|
|
7
|
+
style: {}
|
|
8
|
+
},
|
|
9
|
+
setup(t) {
|
|
10
|
+
const e = t;
|
|
11
|
+
return (c, i) => (n(), a("div", {
|
|
12
|
+
class: s(["tr-history__item-tag", e.type]),
|
|
13
|
+
style: o(e.style)
|
|
14
|
+
}, [
|
|
15
|
+
r("span", null, p(e.text), 1)
|
|
16
|
+
], 6));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
y as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent as s, createElementBlock as r, openBlock as c, createElementVNode as t, createVNode as n, unref as a, toDisplayString as p } from "vue";
|
|
2
|
+
import { IconEmptySearch as _ } from "../../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
const i = { class: "tr-history__empty" }, m = { class: "tr-history__empty-icon" }, l = { class: "tr-history__empty-text" }, u = /* @__PURE__ */ s({
|
|
4
|
+
__name: "search-empty",
|
|
5
|
+
props: {
|
|
6
|
+
text: { default: "暂无内容" }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
const o = e;
|
|
10
|
+
return (d, h) => (c(), r("div", i, [
|
|
11
|
+
t("span", m, [
|
|
12
|
+
n(a(_))
|
|
13
|
+
]),
|
|
14
|
+
t("span", l, p(o.text), 1)
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
u as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { onClickOutside as v } from "../../../../../node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js";
|
|
2
|
+
import { ref as n, watchEffect as s, nextTick as h } from "vue";
|
|
3
|
+
const w = (o) => {
|
|
4
|
+
const i = n(), u = (t) => {
|
|
5
|
+
i.value = {
|
|
6
|
+
id: t.id,
|
|
7
|
+
title: t.title,
|
|
8
|
+
rawData: t
|
|
9
|
+
};
|
|
10
|
+
}, a = n(null), r = (t) => {
|
|
11
|
+
t && h(() => {
|
|
12
|
+
a.value = t, a.value.focus();
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
let e;
|
|
16
|
+
const l = () => {
|
|
17
|
+
if (i.value) {
|
|
18
|
+
if (i.value.title !== i.value.rawData.title) {
|
|
19
|
+
const { title: t, rawData: f } = i.value;
|
|
20
|
+
o("item-title-change", t, f);
|
|
21
|
+
}
|
|
22
|
+
i.value = void 0;
|
|
23
|
+
}
|
|
24
|
+
e == null || e(), e = void 0;
|
|
25
|
+
}, c = () => {
|
|
26
|
+
i.value = void 0, e == null || e(), e = void 0;
|
|
27
|
+
}, d = (t) => {
|
|
28
|
+
t.key === "Enter" ? l() : t.key === "Escape" && c();
|
|
29
|
+
};
|
|
30
|
+
return s(() => {
|
|
31
|
+
a.value && (e == null || e(), e = v(a, () => {
|
|
32
|
+
l();
|
|
33
|
+
}));
|
|
34
|
+
}), {
|
|
35
|
+
editingItem: i,
|
|
36
|
+
handleEdit: u,
|
|
37
|
+
handleEditorInputRef: r,
|
|
38
|
+
handleKeyDown: d
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
w as useEditItemTitle
|
|
43
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { defineComponent as N, mergeModels as w, useCssVars as K, computed as u, useModel as F, createElementBlock as l, openBlock as i, createElementVNode as n, createCommentVNode as M, Fragment as p, renderList as k, normalizeClass as Q, toDisplayString as b, createVNode as v, unref as e, createBlock as $, withDirectives as U, mergeProps as W, withModifiers as A, vModelText as j } from "vue";
|
|
2
|
+
import { IconSearch as G, IconEditPen as R, IconDelete as H, IconClose as J } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
import C from "../../../../node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/index.js";
|
|
4
|
+
import O from "../../../../node_modules/.pnpm/@opentiny_vue-input@3.21.0/node_modules/@opentiny/vue-input/lib/index.js";
|
|
5
|
+
import X from "./components/item-tag.vue.js";
|
|
6
|
+
import Y from "./components/search-empty.vue.js";
|
|
7
|
+
import { useEditItemTitle as Z } from "./composables/useEditItemTitle.js";
|
|
8
|
+
const q = { class: "tr-history" }, ee = { class: "tr-history__tabs" }, te = ["onClick"], re = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "tr-history__search"
|
|
11
|
+
}, ie = { class: "tr-history__content" }, se = { class: "tr-history__date" }, oe = ["onClick"], le = { class: "tr-history__item-title" }, ae = { class: "tr-history__item-actions" }, ne = { class: "tr-history__close" }, ve = /* @__PURE__ */ N({
|
|
12
|
+
__name: "index",
|
|
13
|
+
props: /* @__PURE__ */ w({
|
|
14
|
+
tabTitle: {},
|
|
15
|
+
data: {},
|
|
16
|
+
activeTab: {},
|
|
17
|
+
searchBar: { type: Boolean },
|
|
18
|
+
searchQuery: {},
|
|
19
|
+
searchPlaceholder: {},
|
|
20
|
+
searchFn: { type: Function, default: (c, { title: y }) => c ? y.toLowerCase().includes(c.toLowerCase()) : !0 },
|
|
21
|
+
selected: {},
|
|
22
|
+
tabs: {}
|
|
23
|
+
}, {
|
|
24
|
+
activeTab: {},
|
|
25
|
+
activeTabModifiers: {},
|
|
26
|
+
searchQuery: {},
|
|
27
|
+
searchQueryModifiers: {}
|
|
28
|
+
}),
|
|
29
|
+
emits: /* @__PURE__ */ w(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
30
|
+
setup(c, { emit: y }) {
|
|
31
|
+
K((a) => ({
|
|
32
|
+
"8b6c417a": x.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
33
|
+
"744b1e9a": x.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
34
|
+
}));
|
|
35
|
+
const s = c, g = F(c, "activeTab"), h = F(c, "searchQuery"), m = y, f = u(() => Array.isArray(s.tabs) ? s.tabs : [{ title: s.tabTitle, id: "0" }]), T = u(() => g.value || f.value[0].id), x = u(() => f.value.length > 1), I = u(() => Array.isArray(s.data) ? s.data || [] : s.data[T.value] || []), B = u(() => s.searchBar ? I.value.map((t) => ({
|
|
36
|
+
...t,
|
|
37
|
+
items: t.items.filter((r) => s.searchFn(h.value || "", r))
|
|
38
|
+
})).filter((t) => t.items.length > 0) : I.value), D = (a) => {
|
|
39
|
+
var t;
|
|
40
|
+
a.id !== ((t = _.value) == null ? void 0 : t.id) && m("item-click", a);
|
|
41
|
+
}, z = () => {
|
|
42
|
+
m("close");
|
|
43
|
+
}, P = (a) => {
|
|
44
|
+
m("item-delete", a);
|
|
45
|
+
}, { editingItem: _, handleEdit: S, handleEditorInputRef: L, handleKeyDown: V } = Z(m);
|
|
46
|
+
return (a, t) => (i(), l("div", q, [
|
|
47
|
+
n("div", ee, [
|
|
48
|
+
(i(!0), l(p, null, k(f.value, (r) => (i(), l("div", {
|
|
49
|
+
key: r.id,
|
|
50
|
+
class: Q(["tr-history__tab", { active: T.value === r.id }]),
|
|
51
|
+
onClick: (o) => g.value = r.id
|
|
52
|
+
}, b(r.title), 11, te))), 128))
|
|
53
|
+
]),
|
|
54
|
+
s.searchBar ? (i(), l("div", re, [
|
|
55
|
+
v(e(O), {
|
|
56
|
+
modelValue: h.value,
|
|
57
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => h.value = r),
|
|
58
|
+
placeholder: s.searchPlaceholder || "搜索对话名称",
|
|
59
|
+
"prefix-icon": e(G),
|
|
60
|
+
clearable: ""
|
|
61
|
+
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
62
|
+
])) : M("", !0),
|
|
63
|
+
n("div", ie, [
|
|
64
|
+
B.value.length > 0 ? (i(!0), l(p, { key: 0 }, k(B.value, (r) => (i(), l("div", {
|
|
65
|
+
key: r.date,
|
|
66
|
+
class: "tr-history__group"
|
|
67
|
+
}, [
|
|
68
|
+
n("div", se, [
|
|
69
|
+
n("span", null, b(r.date), 1)
|
|
70
|
+
]),
|
|
71
|
+
(i(!0), l(p, null, k(r.items, (o) => {
|
|
72
|
+
var E;
|
|
73
|
+
return i(), l("div", {
|
|
74
|
+
key: `${o.id}-${o.title}`,
|
|
75
|
+
class: Q(["tr-history__item", { selected: s.selected === o.id }]),
|
|
76
|
+
onClick: (d) => D(o)
|
|
77
|
+
}, [
|
|
78
|
+
((E = e(_)) == null ? void 0 : E.id) !== o.id ? (i(), l(p, { key: 0 }, [
|
|
79
|
+
n("span", le, b(o.title), 1),
|
|
80
|
+
o.tag ? (i(), $(e(X), W({
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "tr-history__item-tag",
|
|
83
|
+
ref_for: !0
|
|
84
|
+
}, o.tag), null, 16)) : M("", !0),
|
|
85
|
+
n("div", ae, [
|
|
86
|
+
v(e(C), {
|
|
87
|
+
icon: e(R),
|
|
88
|
+
type: "text",
|
|
89
|
+
size: "mini",
|
|
90
|
+
onClick: A((d) => e(S)(o), ["stop"])
|
|
91
|
+
}, null, 8, ["icon", "onClick"]),
|
|
92
|
+
v(e(C), {
|
|
93
|
+
icon: e(H),
|
|
94
|
+
type: "text",
|
|
95
|
+
size: "mini",
|
|
96
|
+
onClick: A((d) => P(o), ["stop"])
|
|
97
|
+
}, null, 8, ["icon", "onClick"])
|
|
98
|
+
])
|
|
99
|
+
], 64)) : U((i(), l("input", {
|
|
100
|
+
key: 1,
|
|
101
|
+
"onUpdate:modelValue": t[1] || (t[1] = (d) => e(_).title = d),
|
|
102
|
+
class: "tr-history__item-edit",
|
|
103
|
+
ref_for: !0,
|
|
104
|
+
ref: e(L),
|
|
105
|
+
onKeydown: t[2] || (t[2] = //@ts-ignore
|
|
106
|
+
(...d) => e(V) && e(V)(...d))
|
|
107
|
+
}, null, 544)), [
|
|
108
|
+
[j, e(_).title]
|
|
109
|
+
])
|
|
110
|
+
], 10, oe);
|
|
111
|
+
}), 128))
|
|
112
|
+
]))), 128)) : (i(), $(e(Y), {
|
|
113
|
+
key: 1,
|
|
114
|
+
text: h.value ? "暂无搜索结果" : "暂无内容"
|
|
115
|
+
}, null, 8, ["text"]))
|
|
116
|
+
]),
|
|
117
|
+
n("div", ne, [
|
|
118
|
+
v(e(C), {
|
|
119
|
+
icon: e(J),
|
|
120
|
+
type: "text",
|
|
121
|
+
size: "mini",
|
|
122
|
+
onClick: z
|
|
123
|
+
}, null, 8, ["icon"])
|
|
124
|
+
])
|
|
125
|
+
]));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export {
|
|
129
|
+
ve as default
|
|
130
|
+
};
|