@opentiny/tiny-robot 0.4.2-alpha.1 → 0.4.2-alpha.3

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/index2.js CHANGED
@@ -1,19 +1,27 @@
1
- import { inject as A, defineComponent as h, computed as d, openBlock as i, createBlock as b, unref as o, withCtx as x, createElementVNode as f, normalizeClass as v, renderSlot as B, resolveDynamicComponent as D, normalizeStyle as E, createElementBlock as p, createVNode as m, toDisplayString as w, createCommentVNode as k, Transition as I } from "vue";
2
- import { _ as S } from "./_plugin-vue_export-helper.js";
3
- import { IconSend as P, IconStop as N, IconClear as F } from "@opentiny/tiny-robot-svgs";
4
- import { TinyTooltip as T } from "@opentiny/vue";
5
- const R = Symbol("sender-context");
1
+ import { inject as O, isVNode as R, h as V, defineComponent as y, computed as d, openBlock as a, createBlock as f, unref as s, withCtx as x, createElementVNode as v, normalizeClass as b, renderSlot as T, resolveDynamicComponent as $, normalizeStyle as B, createElementBlock as p, createVNode as m, toDisplayString as w, createCommentVNode as S, Transition as A } from "vue";
2
+ import { _ as k } from "./_plugin-vue_export-helper.js";
3
+ import { IconSend as E, IconStop as F, IconClear as W } from "@opentiny/tiny-robot-svgs";
4
+ import { TinyTooltip as P } from "@opentiny/vue";
5
+ const j = Symbol("sender-context");
6
6
  function g() {
7
- const a = A(R);
8
- if (!a)
7
+ const t = O(j);
8
+ if (!t)
9
9
  throw new Error("useSenderContext must be used within Sender component");
10
- return a;
10
+ return t;
11
11
  }
12
- function $(a) {
13
- if (a)
14
- return typeof a == "string" ? () => a : a;
12
+ const I = "tr-sender-tooltip-inner";
13
+ function D(t) {
14
+ return t ? typeof t == "string" ? t.split(/\s+/).includes(I) : Array.isArray(t) ? t.some(D) : typeof t == "object" ? !!t[I] : !1 : !1;
15
15
  }
16
- const L = ["disabled"], V = ["disabled"], W = /* @__PURE__ */ h({
16
+ function N(t) {
17
+ var e;
18
+ return R(t) && D((e = t.props) == null ? void 0 : e.class) ? t : V("div", { class: I }, t);
19
+ }
20
+ function L(t) {
21
+ if (t)
22
+ return typeof t == "string" ? () => N(t) : () => N(t());
23
+ }
24
+ const K = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
17
25
  __name: "index",
18
26
  props: {
19
27
  icon: {},
@@ -23,177 +31,177 @@ const L = ["disabled"], V = ["disabled"], W = /* @__PURE__ */ h({
23
31
  tooltipPlacement: { default: "top" },
24
32
  size: {}
25
33
  },
26
- setup(a) {
27
- const t = a, s = d(() => $(t.tooltip)), l = d(() => t.size ? { fontSize: typeof t.size == "number" ? `${t.size}px` : t.size } : {});
28
- return (r, c) => t.tooltip ? (i(), b(o(T), {
34
+ setup(t) {
35
+ const e = t, i = d(() => L(e.tooltip)), r = d(() => e.size ? { fontSize: typeof e.size == "number" ? `${e.size}px` : e.size } : {});
36
+ return (c, l) => e.tooltip ? (a(), f(s(P), {
29
37
  key: 0,
30
- "render-content": s.value,
31
- placement: t.tooltipPlacement,
38
+ "render-content": i.value,
39
+ placement: e.tooltipPlacement,
32
40
  effect: "light",
33
41
  "visible-arrow": !1,
34
42
  "popper-class": "tr-action-button-tooltip-popper"
35
43
  }, {
36
44
  default: x(() => [
37
- f("button", {
38
- class: v(["tr-action-button", { active: t.active }]),
39
- disabled: t.disabled,
40
- onFocusCapture: c[0] || (c[0] = (u) => u.stopPropagation())
45
+ v("button", {
46
+ class: b(["tr-action-button", { active: e.active }]),
47
+ disabled: e.disabled,
48
+ onFocusCapture: l[0] || (l[0] = (u) => u.stopPropagation())
41
49
  }, [
42
- B(r.$slots, "icon", {}, () => [
43
- (i(), b(D(t.icon), {
44
- style: E(l.value)
50
+ T(c.$slots, "icon", {}, () => [
51
+ (a(), f($(e.icon), {
52
+ style: B(r.value)
45
53
  }, null, 8, ["style"]))
46
54
  ], !0)
47
- ], 42, L)
55
+ ], 42, K)
48
56
  ]),
49
57
  _: 3
50
- }, 8, ["render-content", "placement"])) : (i(), p("button", {
58
+ }, 8, ["render-content", "placement"])) : (a(), p("button", {
51
59
  key: 1,
52
- class: v(["tr-action-button", { active: t.active }]),
53
- disabled: t.disabled
60
+ class: b(["tr-action-button", { active: e.active }]),
61
+ disabled: e.disabled
54
62
  }, [
55
- B(r.$slots, "icon", {}, () => [
56
- (i(), b(D(t.icon), {
57
- style: E(l.value)
63
+ T(c.$slots, "icon", {}, () => [
64
+ (a(), f($(e.icon), {
65
+ style: B(r.value)
58
66
  }, null, 8, ["style"]))
59
67
  ], !0)
60
- ], 10, V));
68
+ ], 10, X));
61
69
  }
62
- }), O = /* @__PURE__ */ S(W, [["__scopeId", "data-v-01ebbab5"]]), j = {
70
+ }), q = /* @__PURE__ */ k(Y, [["__scopeId", "data-v-d6737627"]]), G = {
63
71
  key: 0,
64
72
  class: "tr-sender-submit-button__cancel-text"
65
- }, K = /* @__PURE__ */ h({
73
+ }, H = /* @__PURE__ */ y({
66
74
  __name: "index",
67
- setup(a) {
68
- const { canSubmit: t, loading: s, defaultActions: l, submit: r, cancel: c, stopText: u } = g(), _ = d(() => {
69
- var e, n;
70
- return (n = (e = l.value) == null ? void 0 : e.submit) != null && n.disabled ? !0 : !t.value && !s.value;
71
- }), y = d(() => {
72
- var e, n;
73
- return $((n = (e = l.value) == null ? void 0 : e.submit) == null ? void 0 : n.tooltip);
75
+ setup(t) {
76
+ const { canSubmit: e, loading: i, defaultActions: r, submit: c, cancel: l, stopText: u } = g(), _ = d(() => {
77
+ var n, o;
78
+ return (o = (n = r.value) == null ? void 0 : n.submit) != null && o.disabled ? !0 : !e.value && !i.value;
79
+ }), h = d(() => {
80
+ var n, o;
81
+ return L((o = (n = r.value) == null ? void 0 : n.submit) == null ? void 0 : o.tooltip);
74
82
  }), z = d(() => {
75
- var e, n;
76
- return ((n = (e = l.value) == null ? void 0 : e.submit) == null ? void 0 : n.tooltipPlacement) ?? "top";
83
+ var n, o;
84
+ return ((o = (n = r.value) == null ? void 0 : n.submit) == null ? void 0 : o.tooltipPlacement) ?? "top";
77
85
  }), C = () => {
78
- _.value || (s.value ? c() : r());
86
+ _.value || (i.value ? l() : c());
79
87
  };
80
- return (e, n) => y.value && !o(s) ? (i(), b(o(T), {
88
+ return (n, o) => h.value && !s(i) ? (a(), f(s(P), {
81
89
  key: 0,
82
- "render-content": y.value,
90
+ "render-content": h.value,
83
91
  placement: z.value,
84
92
  effect: "light",
85
93
  "visible-arrow": !1,
86
94
  "popper-class": "tr-submit-button-tooltip-popper"
87
95
  }, {
88
96
  default: x(() => [
89
- f("div", {
90
- class: v([
97
+ v("div", {
98
+ class: b([
91
99
  "tr-sender-submit-button",
92
100
  {
93
101
  "is-disabled": _.value,
94
- "is-loading": o(s)
102
+ "is-loading": s(i)
95
103
  }
96
104
  ]),
97
105
  onClick: C
98
106
  }, [
99
- m(o(P), { class: "tr-sender-submit-button__icon" })
107
+ m(s(E), { class: "tr-sender-submit-button__icon" })
100
108
  ], 2)
101
109
  ]),
102
110
  _: 1
103
- }, 8, ["render-content", "placement"])) : (i(), p("div", {
111
+ }, 8, ["render-content", "placement"])) : (a(), p("div", {
104
112
  key: 1,
105
- class: v([
113
+ class: b([
106
114
  "tr-sender-submit-button",
107
115
  {
108
116
  "is-disabled": _.value,
109
- "is-loading": o(s)
117
+ "is-loading": s(i)
110
118
  }
111
119
  ]),
112
120
  onClick: C
113
121
  }, [
114
- o(s) ? (i(), p("div", {
122
+ s(i) ? (a(), p("div", {
115
123
  key: 1,
116
- class: v(["tr-sender-submit-button__cancel", { "icon-only": !o(u) }])
124
+ class: b(["tr-sender-submit-button__cancel", { "icon-only": !s(u) }])
117
125
  }, [
118
- m(o(N), { class: "tr-sender-submit-button__cancel-icon" }),
119
- o(u) ? (i(), p("span", j, w(o(u)), 1)) : k("", !0)
120
- ], 2)) : (i(), b(o(P), {
126
+ m(s(F), { class: "tr-sender-submit-button__cancel-icon" }),
127
+ s(u) ? (a(), p("span", G, w(s(u)), 1)) : S("", !0)
128
+ ], 2)) : (a(), f(s(E), {
121
129
  key: 0,
122
130
  class: "tr-sender-submit-button__icon"
123
131
  }))
124
132
  ], 2));
125
133
  }
126
- }), X = /* @__PURE__ */ S(K, [["__scopeId", "data-v-4b48493a"]]), Y = /* @__PURE__ */ h({
134
+ }), J = /* @__PURE__ */ k(H, [["__scopeId", "data-v-a58e69fe"]]), M = /* @__PURE__ */ y({
127
135
  __name: "index",
128
- setup(a) {
129
- const { hasContent: t, clearable: s, clear: l, loading: r, defaultActions: c } = g(), u = d(() => {
130
- var e, n;
131
- return ((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.disabled) !== void 0 ? c.value.clear.disabled : !1;
136
+ setup(t) {
137
+ const { hasContent: e, clearable: i, clear: r, loading: c, defaultActions: l } = g(), u = d(() => {
138
+ var n, o;
139
+ return ((o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.disabled) !== void 0 ? l.value.clear.disabled : !1;
132
140
  }), _ = d(() => {
133
- var e, n;
134
- return $((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.tooltip);
135
- }), y = d(() => {
136
- var e, n;
137
- return ((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.tooltipPlacement) ?? "top";
138
- }), z = d(() => s.value && t.value && !r.value && !u.value), C = () => {
139
- u.value || l();
141
+ var n, o;
142
+ return (o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.tooltip;
143
+ }), h = d(() => {
144
+ var n, o;
145
+ return ((o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.tooltipPlacement) ?? "top";
146
+ }), z = d(() => i.value && e.value && !c.value && !u.value), C = () => {
147
+ u.value || r();
140
148
  };
141
- return (e, n) => z.value ? (i(), b(O, {
149
+ return (n, o) => z.value ? (a(), f(q, {
142
150
  key: 0,
143
- icon: o(F),
151
+ icon: s(W),
144
152
  disabled: u.value,
145
153
  tooltip: _.value,
146
- "tooltip-placement": y.value,
154
+ "tooltip-placement": h.value,
147
155
  onClick: C
148
- }, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) : k("", !0);
156
+ }, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) : S("", !0);
149
157
  }
150
- }), q = {
158
+ }), Q = {
151
159
  key: 0,
152
160
  class: "tr-sender-word-counter"
153
- }, G = /* @__PURE__ */ h({
161
+ }, U = /* @__PURE__ */ y({
154
162
  __name: "index",
155
- setup(a) {
156
- const { characterCount: t, maxLength: s, isOverLimit: l, showWordLimit: r } = g(), c = d(() => r.value && s.value !== void 0);
157
- return (u, _) => c.value ? (i(), p("span", q, [
158
- f("span", {
159
- class: v({ "is-over-limit": o(l) })
160
- }, w(o(t)), 3),
161
- f("span", null, "/" + w(o(s)), 1)
162
- ])) : k("", !0);
163
+ setup(t) {
164
+ const { characterCount: e, maxLength: i, isOverLimit: r, showWordLimit: c } = g(), l = d(() => c.value && i.value !== void 0);
165
+ return (u, _) => l.value ? (a(), p("span", Q, [
166
+ v("span", {
167
+ class: b({ "is-over-limit": s(r) })
168
+ }, w(s(e)), 3),
169
+ v("span", null, "/" + w(s(i)), 1)
170
+ ])) : S("", !0);
163
171
  }
164
- }), nt = /* @__PURE__ */ S(G, [["__scopeId", "data-v-206396cd"]]), H = { class: "tr-default-action-buttons" }, J = {
172
+ }), rt = /* @__PURE__ */ k(U, [["__scopeId", "data-v-206396cd"]]), Z = { class: "tr-default-action-buttons" }, tt = {
165
173
  key: 0,
166
174
  class: "tr-action-buttons-group"
167
- }, M = { class: "tr-submit-wrapper" }, Q = /* @__PURE__ */ h({
175
+ }, et = { class: "tr-submit-wrapper" }, nt = /* @__PURE__ */ y({
168
176
  __name: "index",
169
- setup(a) {
170
- const { hasContent: t, loading: s } = g();
171
- return (l, r) => (i(), p("div", H, [
172
- m(I, { name: "tr-slide-right" }, {
177
+ setup(t) {
178
+ const { hasContent: e, loading: i } = g();
179
+ return (r, c) => (a(), p("div", Z, [
180
+ m(A, { name: "tr-slide-right" }, {
173
181
  default: x(() => [
174
- o(t) || o(s) ? (i(), p("div", J, [
175
- m(I, { name: "tr-slide-right" }, {
182
+ s(e) || s(i) ? (a(), p("div", tt, [
183
+ m(A, { name: "tr-slide-right" }, {
176
184
  default: x(() => [
177
- m(Y)
185
+ m(M)
178
186
  ]),
179
187
  _: 1
180
188
  }),
181
- f("div", M, [
182
- m(X)
189
+ v("div", et, [
190
+ m(J)
183
191
  ])
184
- ])) : k("", !0)
192
+ ])) : S("", !0)
185
193
  ]),
186
194
  _: 1
187
195
  })
188
196
  ]));
189
197
  }
190
- }), ot = /* @__PURE__ */ S(Q, [["__scopeId", "data-v-209924d7"]]);
198
+ }), lt = /* @__PURE__ */ k(nt, [["__scopeId", "data-v-209924d7"]]);
191
199
  export {
192
- O as A,
193
- ot as D,
194
- X as S,
195
- nt as W,
196
- Y as _,
197
- R as a,
200
+ q as A,
201
+ lt as D,
202
+ J as S,
203
+ rt as W,
204
+ M as _,
205
+ j as a,
198
206
  g as u
199
207
  };
package/dist/index6.js CHANGED
@@ -842,7 +842,6 @@ const jt = /* @__PURE__ */ S({
842
842
  return l;
843
843
  }, m = y(() => o.messages.length === 0 ? [] : typeof o.groupStrategy == "function" ? o.groupStrategy(o.messages, o.dividerRole) : o.groupStrategy === "consecutive" ? u(o.messages) : b(o.messages, o.dividerRole));
844
844
  return e({
845
- rootEl: s,
846
845
  scrollToBottom: a
847
846
  }), (p, f) => (g(), C("div", {
848
847
  class: "tr-bubble-list",
@@ -885,7 +884,7 @@ const jt = /* @__PURE__ */ S({
885
884
  }), 128))
886
885
  ], 512));
887
886
  }
888
- }), V = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-86cfb59a"]]), X = /* @__PURE__ */ S({
887
+ }), V = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-e217fbb7"]]), X = /* @__PURE__ */ S({
889
888
  __name: "BubbleProvider",
890
889
  props: {
891
890
  boxRendererMatches: {},