@opentiny/tiny-robot 0.1.0 → 0.2.0-alpha.1
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 +16 -0
- package/dist/bubble/index.type.d.ts +1 -1
- package/dist/container/index.d.ts +7 -0
- package/dist/container/index.type.d.ts +16 -0
- package/dist/container/index.vue.d.ts +26 -0
- 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 +7 -0
- package/dist/icon-button/index.vue.d.ts +6 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +56 -22
- 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 +190 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +53 -0
- package/dist/packages/components/src/action-group/ActionGroup.vue.js +7 -0
- package/dist/packages/components/src/action-group/ActionGroup.vue2.js +97 -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-list.vue.js +2 -2
- package/dist/packages/components/src/bubble/bubble-list.vue2.js +18 -19
- package/dist/packages/components/src/bubble/bubble.vue.js +2 -2
- package/dist/packages/components/src/bubble/bubble.vue2.js +46 -46
- package/dist/packages/components/src/container/index.js +9 -0
- package/dist/packages/components/src/container/index.vue.js +7 -0
- package/dist/packages/components/src/container/index.vue2.js +55 -0
- 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 +142 -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 +40 -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 +22 -22
- package/dist/packages/components/src/question/index.vue.js +7 -7
- package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +7 -0
- package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +121 -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 +364 -69
- package/dist/question/components/HotQuestions.vue.d.ts +2 -2
- package/dist/question/index.vue.d.ts +1 -1
- package/dist/sender/components/ActionButtons.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 +5 -5
- package/src/action-group/ActionGroup.vue +232 -0
- package/src/action-group/ActionGroupItem.vue +9 -0
- package/src/action-group/index.ts +25 -0
- package/src/action-group/index.type.ts +20 -0
- package/src/bubble/bubble-list.vue +1 -3
- package/src/bubble/bubble.vue +4 -14
- package/src/bubble/index.type.ts +1 -1
- package/src/container/index.ts +12 -0
- package/src/container/index.type.ts +17 -0
- package/src/container/index.vue +134 -0
- 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 +8 -0
- package/src/icon-button/index.vue +52 -0
- package/src/index.ts +37 -2
- 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 +274 -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/.vscode/extensions.json +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { IconHotQuestion as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as O, ref as k, computed as Q, watch as S, createElementBlock as i, createCommentVNode as h, openBlock as l, createElementVNode as s, withModifiers as _, normalizeStyle as M, createVNode as v, unref as r, Fragment as C, renderList as q, normalizeClass as N, renderSlot as u, toDisplayString as f, createTextVNode as V } from "vue";
|
|
2
|
+
import z from "../../../../../node_modules/.pnpm/@opentiny_vue-icon@3.22.0/node_modules/@opentiny/vue-icon/lib/close.js";
|
|
3
|
+
import I from "../../../../../node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/index.js";
|
|
4
|
+
import { IconHotQuestion as T, IconTypeAll as A } from "../../../../svgs/dist/tiny-robot-svgs.js";
|
|
5
|
+
const E = { class: "tr-question-header" }, H = { style: { display: "flex", "align-items": "center", gap: "12px", "font-size": "36px" } }, R = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "tr-question-categories"
|
|
8
8
|
}, W = ["onClick"], D = { class: "category-icon" }, F = { class: "tr-question-content" }, L = {
|
|
@@ -11,7 +11,7 @@ const H = { class: "tr-question-header" }, I = { style: { display: "flex", "alig
|
|
|
11
11
|
}, P = { key: 1 }, j = ["onClick"], G = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "tr-question-empty"
|
|
14
|
-
}, Z = /* @__PURE__ */
|
|
14
|
+
}, Z = /* @__PURE__ */ O({
|
|
15
15
|
__name: "HotQuestions",
|
|
16
16
|
props: {
|
|
17
17
|
visible: {
|
|
@@ -37,13 +37,13 @@ const H = { class: "tr-question-header" }, I = { style: { display: "flex", "alig
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["update:visible", "close", "select-category", "question-click"],
|
|
39
39
|
setup(n, { emit: b }) {
|
|
40
|
-
const B =
|
|
40
|
+
const B = z(), a = n, c = b, d = k(""), p = Q(() => {
|
|
41
41
|
if (!d.value && a.categories.length > 0)
|
|
42
42
|
return a.categories[0].questions || [];
|
|
43
43
|
const e = a.categories.find((t) => t.id === d.value);
|
|
44
44
|
return e ? e.questions : [];
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
S(
|
|
47
47
|
() => a.categories,
|
|
48
48
|
(e) => {
|
|
49
49
|
e.length > 0 && !d.value && (d.value = e[0].id);
|
|
@@ -51,34 +51,34 @@ const H = { class: "tr-question-header" }, I = { style: { display: "flex", "alig
|
|
|
51
51
|
{ immediate: !0 }
|
|
52
52
|
);
|
|
53
53
|
const y = () => {
|
|
54
|
-
|
|
54
|
+
c("update:visible", !1), c("close");
|
|
55
55
|
}, $ = (e) => {
|
|
56
|
-
d.value = e,
|
|
56
|
+
d.value = e, c(
|
|
57
57
|
"select-category",
|
|
58
58
|
a.categories.find((t) => t.id === e)
|
|
59
59
|
);
|
|
60
60
|
}, w = (e) => {
|
|
61
|
-
|
|
62
|
-
},
|
|
61
|
+
c("question-click", e);
|
|
62
|
+
}, x = (e) => {
|
|
63
63
|
a.closeOnClickOutside && !e.composedPath().includes(g.value) && y();
|
|
64
64
|
}, g = k(null);
|
|
65
65
|
return (e, t) => n.visible ? (l(), i("div", {
|
|
66
66
|
key: 0,
|
|
67
67
|
class: "tr-question-modal-backdrop",
|
|
68
|
-
onMousedown:
|
|
68
|
+
onMousedown: x
|
|
69
69
|
}, [
|
|
70
70
|
s("div", {
|
|
71
71
|
ref_key: "modalRef",
|
|
72
72
|
ref: g,
|
|
73
73
|
class: "tr-question-panel",
|
|
74
|
-
style:
|
|
75
|
-
onMousedown: t[0] || (t[0] =
|
|
74
|
+
style: M({ width: n.modalWidth }),
|
|
75
|
+
onMousedown: t[0] || (t[0] = _(() => {
|
|
76
76
|
}, ["stop"]))
|
|
77
77
|
}, [
|
|
78
|
-
s("div",
|
|
79
|
-
s("div",
|
|
78
|
+
s("div", E, [
|
|
79
|
+
s("div", H, [
|
|
80
80
|
s("div", null, [
|
|
81
|
-
v(
|
|
81
|
+
v(r(T))
|
|
82
82
|
]),
|
|
83
83
|
t[1] || (t[1] = s("div", { class: "tr-question-header-title" }, "热门问题", -1))
|
|
84
84
|
]),
|
|
@@ -86,8 +86,8 @@ const H = { class: "tr-question-header" }, I = { style: { display: "flex", "alig
|
|
|
86
86
|
class: "tr-question-close-btn",
|
|
87
87
|
onClick: y
|
|
88
88
|
}, [
|
|
89
|
-
v(
|
|
90
|
-
icon:
|
|
89
|
+
v(r(I), {
|
|
90
|
+
icon: r(B),
|
|
91
91
|
type: "text"
|
|
92
92
|
}, null, 8, ["icon"])
|
|
93
93
|
])
|
|
@@ -95,12 +95,12 @@ const H = { class: "tr-question-header" }, I = { style: { display: "flex", "alig
|
|
|
95
95
|
n.categories.length > 0 ? (l(), i("div", R, [
|
|
96
96
|
(l(!0), i(C, null, q(n.categories, (o) => (l(), i("div", {
|
|
97
97
|
key: o.id,
|
|
98
|
-
class:
|
|
98
|
+
class: N(["tr-question-categories-item", { active: d.value === o.id }]),
|
|
99
99
|
onClick: (m) => $(o.id)
|
|
100
100
|
}, [
|
|
101
101
|
u(e.$slots, "category-label", { category: o }, () => [
|
|
102
102
|
s("div", D, [
|
|
103
|
-
v(
|
|
103
|
+
v(r(A))
|
|
104
104
|
]),
|
|
105
105
|
s("span", null, f(o.label), 1)
|
|
106
106
|
])
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, computed as N, ref as w, watch as O, onMounted as T, createElementBlock as q, openBlock as i, normalizeClass as M, createElementVNode as l, createVNode as a, createCommentVNode as U, unref as n, withCtx as d, renderSlot as r, createTextVNode as W, toDisplayString as p, createBlock as B } from "vue";
|
|
2
2
|
import { useQuestions as z } from "./composables/useQuestions.js";
|
|
3
3
|
import F from "./components/CommonQuestions.vue.js";
|
|
4
4
|
import H from "./components/HotQuestions.vue.js";
|
|
5
5
|
import { IconHotQuestion as j, IconTypeAll as G, IconArrowUp as J, IconArrowDown as K } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const L = ["data-theme"], P = { class: "category-icon" }, te = /* @__PURE__ */
|
|
7
|
+
const L = ["data-theme"], P = { class: "category-icon" }, te = /* @__PURE__ */ D({
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
categories: { default: () => [] },
|
|
@@ -16,11 +16,11 @@ const L = ["data-theme"], P = { class: "category-icon" }, te = /* @__PURE__ */ N
|
|
|
16
16
|
loading: { type: Boolean, default: !1 }
|
|
17
17
|
},
|
|
18
18
|
emits: ["question-click", "select-category"],
|
|
19
|
-
setup(b, { expose:
|
|
19
|
+
setup(b, { expose: Q, emit: $ }) {
|
|
20
20
|
const u = b, g = () => {
|
|
21
21
|
s.value = !s.value;
|
|
22
|
-
}, f =
|
|
23
|
-
|
|
22
|
+
}, f = $, v = N(() => u.categories), s = w(u.initialExpanded), { modalVisible: m, currentTheme: x, setActiveCategory: h, openModal: c, closeModal: k, setTheme: S, refreshData: A } = z(v);
|
|
23
|
+
O(
|
|
24
24
|
() => u.theme,
|
|
25
25
|
(e) => {
|
|
26
26
|
S(e);
|
|
@@ -33,9 +33,9 @@ const L = ["data-theme"], P = { class: "category-icon" }, te = /* @__PURE__ */ N
|
|
|
33
33
|
}, C = w(!1), V = (e) => {
|
|
34
34
|
C.value = e;
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return T(() => {
|
|
37
37
|
document.documentElement.setAttribute("data-theme", x.value);
|
|
38
|
-
}),
|
|
38
|
+
}), Q({
|
|
39
39
|
openModal: c,
|
|
40
40
|
closeModal: k,
|
|
41
41
|
toggleFloating: g,
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { defineComponent as E, ref as p, computed as I, watch as T, createElementBlock as o, openBlock as a, createElementVNode as b, Fragment as F, renderList as K, toDisplayString as k, normalizeClass as B, withDirectives as R, withModifiers as M, vModelText as N, nextTick as U } from "vue";
|
|
2
|
+
const $ = { class: "template-editor" }, j = { key: 0 }, z = ["onClick"], L = ["onUpdate:modelValue", "onKeydown"], P = {
|
|
3
|
+
key: 1,
|
|
4
|
+
class: "template-placeholder"
|
|
5
|
+
}, q = /* @__PURE__ */ E({
|
|
6
|
+
__name: "TemplateEditor",
|
|
7
|
+
props: {
|
|
8
|
+
template: {},
|
|
9
|
+
value: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:value", "input", "content-status", "field-active"],
|
|
12
|
+
setup(_, { expose: y, emit: g }) {
|
|
13
|
+
const u = _, v = g, w = p(null), c = p({}), r = p(-1), i = I(() => {
|
|
14
|
+
if (u.value)
|
|
15
|
+
return x();
|
|
16
|
+
const e = [];
|
|
17
|
+
let l = 0, t = 0;
|
|
18
|
+
const s = /\[(.*?)\]/g;
|
|
19
|
+
let n;
|
|
20
|
+
for (; (n = s.exec(u.template)) !== null; )
|
|
21
|
+
n.index > l && e.push({
|
|
22
|
+
content: u.template.substring(l, n.index),
|
|
23
|
+
isField: !1
|
|
24
|
+
}), e.push({
|
|
25
|
+
content: "",
|
|
26
|
+
placeholder: n[1],
|
|
27
|
+
isField: !0,
|
|
28
|
+
fieldIndex: t++
|
|
29
|
+
}), l = n.index + n[0].length;
|
|
30
|
+
return l < u.template.length && e.push({
|
|
31
|
+
content: u.template.substring(l),
|
|
32
|
+
isField: !1
|
|
33
|
+
}), e;
|
|
34
|
+
}), x = () => i.value, V = () => i.value.map((e) => e.content).join(""), d = () => {
|
|
35
|
+
const e = V();
|
|
36
|
+
v("update:value", e), v("input", e);
|
|
37
|
+
}, f = (e) => {
|
|
38
|
+
r.value = e, U(() => {
|
|
39
|
+
var l;
|
|
40
|
+
c.value[e] && ((l = c.value[e]) == null || l.focus());
|
|
41
|
+
});
|
|
42
|
+
}, m = () => {
|
|
43
|
+
d(), r.value = -1;
|
|
44
|
+
}, C = (e, l) => {
|
|
45
|
+
if (e.key === "Tab") {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
const t = D(l, e.shiftKey);
|
|
48
|
+
t !== -1 && (d(), f(t));
|
|
49
|
+
} else e.key === "Enter" && (e.preventDefault(), m());
|
|
50
|
+
}, D = (e, l = !1) => {
|
|
51
|
+
if (l) {
|
|
52
|
+
for (let t = e - 1; t >= 0; t--)
|
|
53
|
+
if (i.value[t].isField)
|
|
54
|
+
return t;
|
|
55
|
+
for (let t = i.value.length - 1; t > e; t--)
|
|
56
|
+
if (i.value[t].isField)
|
|
57
|
+
return t;
|
|
58
|
+
} else {
|
|
59
|
+
for (let t = e + 1; t < i.value.length; t++)
|
|
60
|
+
if (i.value[t].isField)
|
|
61
|
+
return t;
|
|
62
|
+
for (let t = 0; t < e; t++)
|
|
63
|
+
if (i.value[t].isField)
|
|
64
|
+
return t;
|
|
65
|
+
}
|
|
66
|
+
return -1;
|
|
67
|
+
};
|
|
68
|
+
T(
|
|
69
|
+
() => u.value,
|
|
70
|
+
(e) => {
|
|
71
|
+
e === "" && h();
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
const h = () => {
|
|
75
|
+
i.value.forEach((e) => {
|
|
76
|
+
e.isField && (e.content = "");
|
|
77
|
+
}), d();
|
|
78
|
+
};
|
|
79
|
+
return y({
|
|
80
|
+
activateFirstField: () => {
|
|
81
|
+
for (let e = 0; e < i.value.length; e++)
|
|
82
|
+
if (i.value[e].isField) {
|
|
83
|
+
f(e);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
resetFields: h
|
|
88
|
+
}), (e, l) => (a(), o("div", $, [
|
|
89
|
+
b("div", {
|
|
90
|
+
class: "template-content",
|
|
91
|
+
ref_key: "editorRef",
|
|
92
|
+
ref: w
|
|
93
|
+
}, [
|
|
94
|
+
(a(!0), o(F, null, K(i.value, (t, s) => (a(), o(F, { key: s }, [
|
|
95
|
+
t.isField ? (a(), o("span", {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: B(["template-field", { "template-field-active": r.value === s }]),
|
|
98
|
+
onClick: (n) => f(s)
|
|
99
|
+
}, [
|
|
100
|
+
r.value === s ? R((a(), o("input", {
|
|
101
|
+
key: 0,
|
|
102
|
+
ref_for: !0,
|
|
103
|
+
ref: (n) => c.value[s] = n,
|
|
104
|
+
"onUpdate:modelValue": (n) => t.content = n,
|
|
105
|
+
class: "template-input",
|
|
106
|
+
onBlur: l[0] || (l[0] = (n) => m()),
|
|
107
|
+
onKeydown: (n) => C(n, s),
|
|
108
|
+
onClick: l[1] || (l[1] = M(() => {
|
|
109
|
+
}, ["stop"]))
|
|
110
|
+
}, null, 40, L)), [
|
|
111
|
+
[N, t.content]
|
|
112
|
+
]) : (a(), o("span", P, k(t.content || t.placeholder), 1))
|
|
113
|
+
], 10, z)) : (a(), o("span", j, k(t.content), 1))
|
|
114
|
+
], 64))), 128))
|
|
115
|
+
], 512)
|
|
116
|
+
]));
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
export {
|
|
120
|
+
q as default
|
|
121
|
+
};
|