@mobilon-dev/chotto 0.3.65 → 0.3.67

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,7 +1,7 @@
1
1
  import o from "./Tooltip.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a2bb5769"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-14a39a1d"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as k, inject as N, ref as n, computed as A, onUnmounted as D, createElementBlock as T, openBlock as s, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as g, toDisplayString as F, nextTick as v } from "vue";
1
+ import { defineComponent as A, inject as D, ref as n, computed as T, onUnmounted as R, createElementBlock as d, openBlock as s, Fragment as V, createElementVNode as W, createBlock as z, renderSlot as E, Teleport as I, createVNode as L, Transition as M, withCtx as $, createCommentVNode as j, normalizeStyle as q, normalizeClass as F, unref as g, toDisplayString as P, nextTick as v } from "vue";
2
2
  import "../../../hooks/useMessageDraft.js";
3
3
  import "../../../hooks/useSearchModel.js";
4
- import { useTheme as P } from "../../../hooks/useTheme.js";
4
+ import { useTheme as U } from "../../../hooks/useTheme.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import "../../../node_modules/linkifyjs/dist/linkify.js";
8
8
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
9
9
  import "../../../functions/parseMarkdown.js";
10
- const U = ["data-theme"], Z = /* @__PURE__ */ k({
10
+ const G = ["data-theme"], tt = /* @__PURE__ */ A({
11
11
  __name: "Tooltip",
12
12
  props: {
13
13
  text: {
@@ -33,79 +33,86 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
33
33
  delay: {
34
34
  type: Number,
35
35
  default: 600
36
+ },
37
+ maxWidth: {
38
+ type: String,
39
+ default: ""
36
40
  }
37
41
  },
38
- setup(w, { expose: d }) {
39
- const x = N("chatAppId"), { getTheme: y } = P(x), a = n(), p = n(), c = n(!1), u = n(null), r = n(null), o = w, _ = A(() => ({
42
+ setup(w, { expose: x }) {
43
+ const S = D("chatAppId"), { getTheme: y } = U(S), p = n(), a = n(), c = n(!1), u = n(null), r = n(null), e = w, _ = T(() => ({
40
44
  tooltip__text: !0,
41
- [`tooltip--${o.position}`]: !0
42
- })), B = () => {
43
- o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), r.value = setTimeout(() => {
45
+ [`tooltip--${e.position}`]: !0
46
+ })), B = T(() => ({
47
+ maxWidth: e.maxWidth || void 0
48
+ })), C = () => {
49
+ e.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), r.value = setTimeout(() => {
44
50
  c.value = !0, v(() => {
45
- if (a.value && p.value) {
46
- const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
47
- left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
48
- right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
49
- bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
50
- "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
51
- top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
52
- "top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
53
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
51
+ if (p.value && a.value) {
52
+ const f = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), l = o.left < 0 ? o.left : 0, i = o.top < 0 ? o.top : 0, h = {
53
+ left: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - o.width - l - e.offset },
54
+ right: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + e.offset },
55
+ bottom: { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) - l },
56
+ "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
57
+ top: { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) - l },
58
+ "top-center": { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
59
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - l }
54
60
  };
55
- f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
61
+ f.style.top = h[e.position].top + "px", f.style.left = h[e.position].left + "px";
56
62
  }
57
63
  }), r.value = null;
58
- }, o.delay));
59
- }, C = () => {
60
- o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), c.value = !1, v(() => {
61
- const f = g(p);
64
+ }, e.delay));
65
+ }, k = () => {
66
+ e.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), c.value = !1, v(() => {
67
+ const f = g(a);
62
68
  f && (f.style.top = "0", f.style.left = "0");
63
69
  }));
64
- }, S = () => {
70
+ }, N = () => {
65
71
  m(), c.value = !0, v(() => {
66
- if (a.value && p.value) {
67
- const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
68
- left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
69
- right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
70
- bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
71
- "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
72
- top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
73
- "top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
74
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
72
+ if (p.value && a.value) {
73
+ const f = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), l = o.left < 0 ? o.left : 0, i = o.top < 0 ? o.top : 0, h = {
74
+ left: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - o.width - l - e.offset },
75
+ right: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + e.offset },
76
+ bottom: { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) - l },
77
+ "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
78
+ top: { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) - l },
79
+ "top-center": { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
80
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - l }
75
81
  };
76
- f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
82
+ f.style.top = h[e.position].top + "px", f.style.left = h[e.position].left + "px";
77
83
  }
78
- }), o.autoShowDuration > 0 && (u.value = setTimeout(() => {
84
+ }), e.autoShowDuration > 0 && (u.value = setTimeout(() => {
79
85
  c.value = !1;
80
- }, o.autoShowDuration));
86
+ }, e.autoShowDuration));
81
87
  }, m = () => {
82
88
  u.value && (clearTimeout(u.value), u.value = null);
83
89
  };
84
- return D(() => {
90
+ return R(() => {
85
91
  r.value && clearTimeout(r.value), m();
86
- }), d({
87
- startAutoShow: S,
92
+ }), x({
93
+ startAutoShow: N,
88
94
  clearAutoTimer: m
89
- }), (f, t) => (s(), T(R, null, [
90
- V("div", {
95
+ }), (f, t) => (s(), d(V, null, [
96
+ W("div", {
91
97
  ref_key: "container",
92
- ref: a,
98
+ ref: p,
93
99
  class: "tooltip-wrapper",
94
- onMouseover: B,
95
- onMouseout: C
100
+ onMouseover: C,
101
+ onMouseout: k
96
102
  }, [
97
- I(f.$slots, "default", {}, void 0, !0)
103
+ E(f.$slots, "default", {}, void 0, !0)
98
104
  ], 544),
99
- (s(), E(L, { to: "body" }, [
100
- M($, null, {
101
- default: j(() => [
102
- c.value ? (s(), T("span", {
105
+ (s(), z(I, { to: "body" }, [
106
+ L(M, null, {
107
+ default: $(() => [
108
+ c.value ? (s(), d("span", {
103
109
  key: 0,
104
110
  ref_key: "tooltip",
105
- ref: p,
111
+ ref: a,
106
112
  "data-theme": g(y)().theme ? g(y)().theme : "light",
107
- class: z(_.value)
108
- }, F(w.text), 11, U)) : q("", !0)
113
+ class: F(_.value),
114
+ style: q(B.value)
115
+ }, P(w.text), 15, G)) : j("", !0)
109
116
  ]),
110
117
  _: 1
111
118
  })
@@ -114,5 +121,5 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
114
121
  }
115
122
  });
116
123
  export {
117
- Z as default
124
+ tt as default
118
125
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AudioMessage.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31d3ba41"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1a1c6565"]]);
5
5
  export {
6
6
  e as default
7
7
  };