@opentiny/tiny-robot 0.3.0-rc.5 → 0.3.0

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,4 +1,4 @@
1
- import { defineComponent as J, useSlots as K, computed as a, createElementBlock as m, openBlock as r, normalizeClass as w, renderSlot as H, createBlock as S, resolveDynamicComponent as b, createCommentVNode as A, toDisplayString as ne, mergeModels as N, useModel as le, ref as d, watch as R, nextTick as $, createElementVNode as D, Fragment as z, renderList as G, isVNode as U, createVNode as j, Transition as se, withCtx as re, unref as ae } from "vue";
1
+ import { defineComponent as J, useSlots as K, computed as i, createElementBlock as m, openBlock as a, normalizeClass as w, renderSlot as H, createBlock as S, resolveDynamicComponent as b, createCommentVNode as A, toDisplayString as ne, mergeModels as N, useModel as le, ref as d, watch as R, nextTick as $, createElementVNode as D, Fragment as z, renderList as G, isVNode as U, createVNode as j, Transition as se, withCtx as re, unref as ae } from "vue";
2
2
  import { IconArrowUp as ie } from "@opentiny/tiny-robot-svgs";
3
3
  import { d as ce, b as q, f as ue, o as fe, g as de } from "../index3.js";
4
4
  import { u as me } from "../useSlotRefs.js";
@@ -8,27 +8,27 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
8
8
  props: {
9
9
  item: {}
10
10
  },
11
- setup(i) {
12
- const v = i, _ = K(), p = a(() => {
13
- var o;
14
- return !!(_.icon || (o = v.item) != null && o.icon);
15
- }), I = a(() => {
16
- var o;
17
- return !!(_.default || (o = v.item) != null && o.text);
18
- }), x = a(() => p.value && !I.value);
19
- return (o, u) => (r(), m("button", {
11
+ setup(s) {
12
+ const v = s, _ = K(), p = i(() => {
13
+ var n;
14
+ return !!(_.icon || (n = v.item) != null && n.icon);
15
+ }), I = i(() => {
16
+ var n;
17
+ return !!(_.default || (n = v.item) != null && n.text);
18
+ }), x = i(() => p.value && !I.value);
19
+ return (n, u) => (a(), m("button", {
20
20
  class: w(["tr-suggestion-pills__item", { "only-icon": x.value }])
21
21
  }, [
22
- H(o.$slots, "icon", {}, () => {
22
+ H(n.$slots, "icon", {}, () => {
23
23
  var c;
24
24
  return [
25
- (r(), S(b((c = o.item) == null ? void 0 : c.icon), { class: "tr-suggestion-pills__item_icon" }))
25
+ (a(), S(b((c = s.item) == null ? void 0 : c.icon), { class: "tr-suggestion-pills__item_icon" }))
26
26
  ];
27
27
  }, !0),
28
- H(o.$slots, "default", {}, () => {
28
+ H(n.$slots, "default", {}, () => {
29
29
  var c;
30
30
  return [
31
- (c = o.item) != null && c.text ? (r(), m("span", pe, ne(o.item.text), 1)) : A("", !0)
31
+ (c = s.item) != null && c.text ? (a(), m("span", pe, ne(s.item.text), 1)) : A("", !0)
32
32
  ];
33
33
  }, !0)
34
34
  ], 2));
@@ -45,11 +45,11 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
45
45
  showAllModifiers: {}
46
46
  }),
47
47
  emits: /* @__PURE__ */ N(["click-outside"], ["update:showAll"]),
48
- setup(i, { expose: v, emit: _ }) {
49
- const p = i, I = K(), x = _, { vnodes: o } = me(I.default, !0), u = le(i, "showAll"), c = d(null), f = d(null), M = d(null), { width: W } = ce(f), C = d(0), B = a(() => p.overflowMode === "expand" && W.value < C.value), g = d(-1), X = a(() => B.value && u.value ? o.value.slice(0, g.value) : o.value), T = a(() => B.value && u.value ? o.value.slice(g.value).map((e, t) => ({
48
+ setup(s, { expose: v, emit: _ }) {
49
+ const p = s, I = K(), x = _, { vnodes: n } = me(I.default, !0), u = le(s, "showAll"), c = d(null), f = d(null), M = d(null), { width: W } = ce(f), C = d(0), B = i(() => p.overflowMode === "expand" && W.value < C.value), g = d(-1), X = i(() => B.value && u.value ? n.value.slice(0, g.value) : n.value), T = i(() => B.value && u.value ? n.value.slice(g.value).map((e, t) => ({
50
50
  vnode: e,
51
51
  index: t + g.value
52
- })) : []), E = d([]), P = d([]), V = a(() => E.value.map((e) => q(e)).filter((e) => e instanceof Element)), Y = a(() => P.value.map((e) => q(e)).filter((e) => e instanceof Element)), L = () => {
52
+ })) : []), E = d([]), P = d([]), V = i(() => E.value.map((e) => q(e)).filter((e) => e instanceof Element)), Y = i(() => P.value.map((e) => q(e)).filter((e) => e instanceof Element)), L = () => {
53
53
  const e = f.value, t = M.value;
54
54
  return Array.from((e == null ? void 0 : e.children) || []).concat(Array.from((t == null ? void 0 : t.children) || []));
55
55
  }, O = () => {
@@ -57,28 +57,28 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
57
57
  const e = f.value;
58
58
  if (!e)
59
59
  return;
60
- const t = L(), n = parseFloat(getComputedStyle(e).rowGap) || 0;
60
+ const t = L(), o = parseFloat(getComputedStyle(e).rowGap) || 0;
61
61
  g.value = -1;
62
62
  let l = 0;
63
- for (let s = 0; s < t.length; s++)
64
- if (l += t[s].offsetWidth, s > 0 && (l += n), l > e.clientWidth) {
65
- g.value = s;
63
+ for (let r = 0; r < t.length; r++)
64
+ if (l += t[r].offsetWidth, r > 0 && (l += o), l > e.clientWidth) {
65
+ g.value = r;
66
66
  break;
67
67
  }
68
68
  });
69
69
  };
70
70
  R(
71
- o,
71
+ n,
72
72
  () => {
73
73
  $(() => {
74
74
  if (!f.value)
75
75
  return;
76
76
  const e = L(), t = parseFloat(getComputedStyle(f.value).rowGap) || 0;
77
- C.value = e.reduce((n, l, s) => n + l.offsetWidth + (s > 0 ? t : 0), 0);
77
+ C.value = e.reduce((o, l, r) => o + l.offsetWidth + (r > 0 ? t : 0), 0);
78
78
  });
79
79
  },
80
80
  { immediate: !0 }
81
- ), R(o, O), ue(W, O, { debounce: 100 });
81
+ ), R(n, O), ue(W, O, { debounce: 100 });
82
82
  const Z = () => {
83
83
  u.value = !u.value;
84
84
  };
@@ -89,9 +89,9 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
89
89
  const t = f.value;
90
90
  if (!t)
91
91
  return;
92
- const n = e.offsetLeft, l = n + e.offsetWidth, s = t.scrollLeft, F = t.clientWidth, te = n < s, oe = l > s + F;
92
+ const o = e.offsetLeft, l = o + e.offsetWidth, r = t.scrollLeft, F = t.clientWidth, te = o < r, oe = l > r + F;
93
93
  te ? t.scrollTo({
94
- left: n,
94
+ left: o,
95
95
  behavior: "smooth"
96
96
  }) : oe && t.scrollTo({
97
97
  left: l - F,
@@ -110,8 +110,8 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
110
110
  immediate: !0
111
111
  }
112
112
  ), v({
113
- children: a(() => V.value.concat(Y.value))
114
- }), (e, t) => (r(), m("div", {
113
+ children: i(() => V.value.concat(Y.value))
114
+ }), (e, t) => (a(), m("div", {
115
115
  class: "tr-suggestion-pills__wrapper",
116
116
  ref_key: "containerWrapperRef",
117
117
  ref: c
@@ -121,8 +121,8 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
121
121
  ref_key: "containerRef",
122
122
  ref: f
123
123
  }, [
124
- (r(!0), m(z, null, G(X.value, (n, l) => (r(), S(b(n), {
125
- key: U(n) ? n.key : l,
124
+ (a(!0), m(z, null, G(X.value, (o, l) => (a(), S(b(o), {
125
+ key: U(o) ? o.key : l,
126
126
  ref_for: !0,
127
127
  ref_key: "staticMaybeItemRefs",
128
128
  ref: E
@@ -131,14 +131,14 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
131
131
  D("div", he, [
132
132
  j(se, { name: "tr-suggestion-pills__more" }, {
133
133
  default: re(() => [
134
- T.value.length ? (r(), m("div", {
134
+ T.value.length ? (a(), m("div", {
135
135
  key: 0,
136
136
  class: "tr-suggestion-pills__more",
137
137
  ref_key: "floatingItemsRef",
138
138
  ref: M
139
139
  }, [
140
- (r(!0), m(z, null, G(T.value, ({ vnode: n, index: l }) => (r(), S(b(n), {
141
- key: U(n) ? n.key : l,
140
+ (a(!0), m(z, null, G(T.value, ({ vnode: o, index: l }) => (a(), S(b(o), {
141
+ key: U(o) ? o.key : l,
142
142
  ref_for: !0,
143
143
  ref_key: "floatingMaybeItemRefs",
144
144
  ref: P
@@ -148,7 +148,7 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
148
148
  _: 1
149
149
  })
150
150
  ]),
151
- B.value ? (r(), m("button", {
151
+ B.value ? (a(), m("button", {
152
152
  key: 0,
153
153
  class: w(["tr-suggestion-pills__expand", { "show-on-hover": p.showAllButtonOn === "hover" }]),
154
154
  onClick: Z
@@ -161,13 +161,13 @@ const pe = { key: 0 }, ge = /* @__PURE__ */ J({
161
161
  }
162
162
  }), k = /* @__PURE__ */ Q(ve, [["__scopeId", "data-v-ebbd7a00"]]);
163
163
  k.name = "TrSuggestionPills";
164
- const _e = function(i) {
165
- i.component(k.name, k);
164
+ const _e = function(s) {
165
+ s.component(k.name, k);
166
166
  };
167
167
  k.install = _e;
168
168
  h.name = "TrSuggestionPillButton";
169
- const ye = function(i) {
170
- i.component(h.name, h);
169
+ const ye = function(s) {
170
+ s.component(h.name, h);
171
171
  };
172
172
  h.install = ye;
173
173
  const Re = h;
@@ -1,4 +1,4 @@
1
- import { defineComponent as z, createElementBlock as g, createCommentVNode as U, openBlock as n, createBlock as k, createElementVNode as v, resolveDynamicComponent as ue, createVNode as M, unref as h, toDisplayString as O, renderSlot as m, mergeModels as V, useModel as A, ref as i, computed as p, watch as W, Transition as ce, withCtx as S, normalizeStyle as J, normalizeClass as D, Fragment as pe, renderList as de, createTextVNode as fe } from "vue";
1
+ import { defineComponent as z, createElementBlock as g, createCommentVNode as U, openBlock as n, createBlock as k, createElementVNode as v, resolveDynamicComponent as ue, createVNode as M, unref as h, toDisplayString as x, renderSlot as m, mergeModels as V, useModel as A, ref as i, computed as p, watch as W, Transition as ce, withCtx as S, normalizeStyle as J, normalizeClass as D, Fragment as pe, renderList as de, createTextVNode as fe } from "vue";
2
2
  import { IconSparkles as ve, IconClose as me } from "@opentiny/tiny-robot-svgs";
3
3
  import { a as ge, h as _e, u as he, w as ye, d as we, o as ke } from "../index3.js";
4
4
  import { u as Te, c as $e, B as Ce } from "../index4.js";
@@ -17,12 +17,12 @@ const Be = {
17
17
  show: { type: Boolean }
18
18
  },
19
19
  setup(l) {
20
- return (t, y) => t.show ? (n(), g("div", Be)) : U("", !0);
20
+ return (t, y) => l.show ? (n(), g("div", Be)) : U("", !0);
21
21
  }
22
- }), be = /* @__PURE__ */ T(Re, [["__scopeId", "data-v-50205eaf"]]), Ge = { class: "tr-question__header" }, Oe = {
22
+ }), be = /* @__PURE__ */ T(Re, [["__scopeId", "data-v-50205eaf"]]), Ge = { class: "tr-question__header" }, xe = {
23
23
  key: 1,
24
24
  class: "tr-question__header-icon"
25
- }, xe = { class: "tr-question__header-title" }, ze = /* @__PURE__ */ z({
25
+ }, Oe = { class: "tr-question__header-title" }, ze = /* @__PURE__ */ z({
26
26
  __name: "Header",
27
27
  props: {
28
28
  icon: {},
@@ -31,10 +31,10 @@ const Be = {
31
31
  setup(l) {
32
32
  const t = l;
33
33
  return (y, o) => (n(), g("div", Ge, [
34
- t.icon ? (n(), k(ue(t.icon), { key: 0 })) : (n(), g("span", Oe, [
34
+ t.icon ? (n(), k(ue(t.icon), { key: 0 })) : (n(), g("span", xe, [
35
35
  M(h(ve), { style: { color: "#1476ff" } })
36
36
  ])),
37
- v("h3", xe, O(t.title), 1)
37
+ v("h3", Oe, x(t.title), 1)
38
38
  ]));
39
39
  }
40
40
  }), Ee = /* @__PURE__ */ T(ze, [["__scopeId", "data-v-76bef623"]]), Le = {}, Ne = { class: "tr-question__loading-wrapper" };
@@ -109,7 +109,7 @@ const Fe = /* @__PURE__ */ T(We, [["render", Ue], ["__scopeId", "data-v-a33638dd
109
109
  onMouseleave: w
110
110
  }, [
111
111
  c[0] || (c[0] = v("div", { class: "tr-tooltip-arrow" }, null, -1)),
112
- v("span", He, O(t.content), 1)
112
+ v("span", He, x(t.content), 1)
113
113
  ], 38)) : U("", !0)
114
114
  ]),
115
115
  _: 1
@@ -291,7 +291,7 @@ const Fe = /* @__PURE__ */ T(We, [["render", Ue], ["__scopeId", "data-v-a33638dd
291
291
  onMouseleave: (q) => N.value[I] && ie(q)
292
292
  }, [m(e.$slots, "item", {
293
293
  item: a
294
- }, () => [v("span", null, O(I + 1) + ". ", 1), fe(O(a.text), 1)], !0)], 40, Ae))), 128))], 2)], !0), M(je, {
294
+ }, () => [v("span", null, x(I + 1) + ". ", 1), fe(x(a.text), 1)], !0)], 40, Ae))), 128))], 2)], !0), M(je, {
295
295
  ref_key: "tooltipRef",
296
296
  ref: H,
297
297
  show: b.value,
@@ -312,12 +312,12 @@ const Fe = /* @__PURE__ */ T(We, [["render", Ue], ["__scopeId", "data-v-a33638dd
312
312
  _: 3
313
313
  }, 8, ["show", "class", "style", "append-to", "offset", "transition-props", "trigger-events"]));
314
314
  }
315
- }), x = /* @__PURE__ */ T(Je, [["__scopeId", "data-v-8cc35579"]]);
316
- x.name = "TrSuggestionPopover";
315
+ }), O = /* @__PURE__ */ T(Je, [["__scopeId", "data-v-8cc35579"]]);
316
+ O.name = "TrSuggestionPopover";
317
317
  const Ke = function(l) {
318
- l.component(x.name, x);
318
+ l.component(O.name, O);
319
319
  };
320
- x.install = Ke;
320
+ O.install = Ke;
321
321
  export {
322
- x as default
322
+ O as default
323
323
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-robot",
3
- "version": "0.3.0-rc.5",
3
+ "version": "0.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,7 +20,7 @@
20
20
  "vue": "^3.3.11"
21
21
  },
22
22
  "dependencies": {
23
- "@opentiny/tiny-robot-svgs": "0.3.0-rc.5",
23
+ "@opentiny/tiny-robot-svgs": "0.3.0",
24
24
  "@opentiny/vue": "^3.20.0",
25
25
  "@vueuse/core": "^13.1.0",
26
26
  "dompurify": "^3.2.6",
@@ -40,5 +40,5 @@
40
40
  "vue": "^3.3.11",
41
41
  "vue-tsc": "^2.2.8"
42
42
  },
43
- "gitHead": "7eda1720baf0381e4b15ffd7e295fc4a3a1b9ac4"
43
+ "gitHead": "b7754957bc6cb982c504577cb72cbe35703e23a5"
44
44
  }