@mobilon-dev/chotto 0.3.61 → 0.3.62

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 "./Feed.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a6f40e16"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ecfc31fa"]]);
5
5
  export {
6
- f as default
6
+ a as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as fe, ref as k, computed as i, inject as w, unref as o, watch as ge, nextTick as j, onMounted as ye, createElementBlock as c, openBlock as l, Fragment as K, createBlock as f, createCommentVNode as u, normalizeStyle as x, renderSlot as L, withDirectives as pe, createVNode as g, createElementVNode as h, vShow as be, Transition as v, withCtx as S, renderList as ke, resolveDynamicComponent as he, toDisplayString as ve, Teleport as Se } from "vue";
1
+ import { defineComponent as me, ref as k, computed as l, inject as w, unref as o, watch as fe, nextTick as j, onMounted as ge, createElementBlock as c, openBlock as i, createVNode as g, createBlock as f, createCommentVNode as u, normalizeStyle as K, renderSlot as x, withDirectives as ye, createElementVNode as h, vShow as pe, Transition as v, withCtx as S, Fragment as be, renderList as ke, resolveDynamicComponent as he, toDisplayString as ve, Teleport as Se } from "vue";
2
2
  import Re from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
3
3
  import Be from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
4
4
  import Ie from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
@@ -17,10 +17,10 @@ import { useFeedScrollTo as Oe } from "./composables/useFeedScrollTo.js";
17
17
  import { useStickyDate as Ve } from "./composables/useStickyDate.js";
18
18
  import { throttle as $e } from "./functions/throttle.js";
19
19
  import qe from "./assets/chat-background.svg.js";
20
- const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-timestamp", "onDblclick"], We = {
20
+ const ze = { class: "message-feed-wrapper" }, Ee = ["id"], Pe = { class: "message-feed__loading" }, We = ["id", "data-timestamp", "onDblclick"], Ne = { style: { margin: "auto" } }, Ge = {
21
21
  key: 0,
22
22
  class: "message-feed__unread-amount"
23
- }, Ne = { style: { margin: "auto" } }, ct = /* @__PURE__ */ fe({
23
+ }, ut = /* @__PURE__ */ me({
24
24
  __name: "Feed",
25
25
  props: {
26
26
  objects: {
@@ -98,24 +98,24 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
98
98
  "smsInvite",
99
99
  "delimiterRead"
100
100
  ],
101
- setup(e, { emit: O }) {
101
+ setup(e, { emit: L }) {
102
102
  const a = e, b = k(), r = k(), R = k(), {
103
- isShowButton: V,
104
- isKeyboardPlace: $,
105
- checkButtonVisibility: q
103
+ isShowButton: O,
104
+ isKeyboardPlace: V,
105
+ checkButtonVisibility: $
106
106
  } = Fe({
107
107
  feedRef: r,
108
108
  keyboardRef: R
109
- }), { componentsMap: z } = Ce(), E = i(() => a.reactionsEnabled), { groupedObjects: P } = De({
110
- objects: i(() => a.objects)
111
- }), y = w("chatAppId"), B = w("selectedChat", void 0), I = i(() => {
109
+ }), { componentsMap: q } = Ce(), z = l(() => a.reactionsEnabled), { groupedObjects: E } = De({
110
+ objects: l(() => a.objects)
111
+ }), y = w("chatAppId"), B = w("selectedChat", void 0), I = l(() => {
112
112
  if (B)
113
113
  return o(B);
114
114
  });
115
- function W(s) {
115
+ function P(s) {
116
116
  return s.timestamp;
117
117
  }
118
- function N(s) {
118
+ function W(s) {
119
119
  var m;
120
120
  const n = s;
121
121
  if (!n.dialogId || !((m = I.value) != null && m.dialogs))
@@ -123,65 +123,65 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
123
123
  const t = I.value.dialogs.find((p) => p.dialogId === n.dialogId);
124
124
  return t == null ? void 0 : t.channelId;
125
125
  }
126
- const d = O, {
127
- checkScrollPosition: G,
126
+ const d = L, {
127
+ checkScrollPosition: N,
128
128
  startScrollWatch: T,
129
129
  stopScrollWatch: A,
130
- resetAllowFlags: U
130
+ resetAllowFlags: G
131
131
  } = je({
132
132
  feedRef: r,
133
133
  emit: d,
134
- isLoadingMoreRef: i(() => a.isLoadingMore)
134
+ isLoadingMoreRef: l(() => a.isLoadingMore)
135
135
  }), {
136
136
  getMessage: M,
137
- messageAction: H,
138
- handleClickReplied: J,
139
- feedObjectDoubleClick: Q,
140
- handleResetReply: X
137
+ messageAction: U,
138
+ handleClickReplied: H,
139
+ feedObjectDoubleClick: J,
140
+ handleResetReply: Q
141
141
  } = xe({
142
142
  enableDoubleClickReply: a.enableDoubleClickReply,
143
143
  emit: d
144
144
  });
145
- function Y(s) {
145
+ function X(s) {
146
146
  d("smsInvite", s);
147
147
  }
148
- function Z(s) {
148
+ function Y(s) {
149
149
  d("delimiterRead", s);
150
150
  }
151
151
  const {
152
- showKeyboard: _,
153
- keyboardAction: ee,
154
- feedKeyboardAction: te
152
+ showKeyboard: Z,
153
+ keyboardAction: _,
154
+ feedKeyboardAction: ee
155
155
  } = we({
156
- isKeyboardPlace: $,
157
- objects: i(() => a.objects),
156
+ isKeyboardPlace: V,
157
+ objects: l(() => a.objects),
158
158
  emit: d
159
159
  }), {
160
- showStickyDate: oe,
161
- stickyDateText: se,
162
- show: ne
160
+ showStickyDate: te,
161
+ stickyDateText: oe,
162
+ show: se
163
163
  } = Ve({
164
164
  feedRef: r,
165
165
  trackingObjects: b
166
166
  }), {
167
- isInitialized: ae,
168
- performScrollToBottom: le,
167
+ isInitialized: ne,
168
+ performScrollToBottom: ae,
169
169
  ensureScrollToBottom: F,
170
170
  initializeScroll: ie,
171
- smoothScrollToBottom: re
171
+ smoothScrollToBottom: le
172
172
  } = Le({
173
173
  feedRef: r,
174
- objectsRef: i(() => a.objects),
175
- scrollToBottomRef: i(() => a.scrollToBottom)
176
- }), C = i(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(qe)}`);
174
+ objectsRef: l(() => a.objects),
175
+ scrollToBottomRef: l(() => a.scrollToBottom)
176
+ }), C = l(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(qe)}`);
177
177
  function D(s = !0) {
178
- q(), G(s), ne();
178
+ $(), N(s), se();
179
179
  }
180
- const de = $e(() => D(), 250);
181
- function ce() {
182
- d("forceScrollToBottom"), re();
180
+ const re = $e(() => D(), 250);
181
+ function de() {
182
+ d("forceScrollToBottom"), le();
183
183
  }
184
- function ue(s) {
184
+ function ce(s) {
185
185
  const n = a.objects;
186
186
  if (s.startsWith("mid-")) {
187
187
  const t = parseInt(s.slice(4), 10);
@@ -189,30 +189,30 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
189
189
  }
190
190
  return n.find((t) => t.messageId === s);
191
191
  }
192
- const { restartObserving: me } = Ke({
192
+ const { restartObserving: ue } = Ke({
193
193
  trackingObjects: b,
194
194
  chatAppId: y,
195
- getMessageById: ue,
195
+ getMessageById: ce,
196
196
  onMessageVisible: (s) => d("messageVisible", s)
197
197
  });
198
- return ge(
198
+ return fe(
199
199
  () => a.objects,
200
200
  () => {
201
201
  j(() => {
202
202
  requestAnimationFrame(() => {
203
- U(), D(!1), b.value = document.querySelectorAll(".tracking-message"), me();
203
+ G(), D(!1), b.value = document.querySelectorAll(".tracking-message"), ue();
204
204
  });
205
205
  });
206
206
  },
207
207
  { immediate: !0 }
208
208
  ), Oe({
209
- targetIdRef: i(() => a.scrollTo),
209
+ targetIdRef: l(() => a.scrollTo),
210
210
  feedContainerId: `feed-container-${y}`
211
- }), ye(() => {
211
+ }), ge(() => {
212
212
  j(() => {
213
- a.objects.length > 0 && !ae.value && ie();
213
+ a.objects.length > 0 && !ne.value && ie();
214
214
  const s = new ResizeObserver(() => {
215
- a.scrollToBottom && (le(), setTimeout(() => {
215
+ a.scrollToBottom && (ae(), setTimeout(() => {
216
216
  F();
217
217
  }, 200), setTimeout(() => {
218
218
  F();
@@ -220,63 +220,63 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
220
220
  });
221
221
  r.value && s.observe(r.value);
222
222
  });
223
- }), (s, n) => (l(), c(K, null, [
224
- e.objects.length > 0 || e.typing ? (l(), c("div", {
223
+ }), (s, n) => (i(), c("div", ze, [
224
+ e.objects.length > 0 || e.typing ? (i(), c("div", {
225
225
  key: 0,
226
226
  id: "feed-container-" + o(y),
227
227
  ref_key: "refFeed",
228
228
  ref: r,
229
229
  class: "message-feed",
230
- style: x({ backgroundImage: `url(${C.value})` }),
231
- onScroll: n[0] || (n[0] = (t) => o(de)()),
230
+ style: K({ backgroundImage: `url(${C.value})` }),
231
+ onScroll: n[0] || (n[0] = (t) => o(re)()),
232
232
  onMousedown: n[1] || (n[1] = //@ts-ignore
233
233
  (...t) => o(T) && o(T)(...t)),
234
234
  onMouseup: n[2] || (n[2] = //@ts-ignore
235
235
  (...t) => o(A) && o(A)(...t))
236
236
  }, [
237
- L(s.$slots, "prepend", {}, void 0, !0),
238
- pe(h("div", Ee, [
237
+ x(s.$slots, "prepend", {}, void 0, !0),
238
+ ye(h("div", Pe, [
239
239
  g(Me, {
240
240
  "is-loading": e.isLoadingMore,
241
241
  size: "small",
242
242
  position: "top"
243
243
  }, null, 8, ["is-loading"])
244
244
  ], 512), [
245
- [be, e.isLoadingMore]
245
+ [pe, e.isLoadingMore]
246
246
  ]),
247
247
  g(v, null, {
248
248
  default: S(() => [
249
- o(oe) && !e.isLoadingMore ? (l(), f(Re, {
249
+ o(te) && !e.isLoadingMore ? (i(), f(Re, {
250
250
  key: 0,
251
251
  class: "message-feed__sticky-date",
252
- text: o(se)
252
+ text: o(oe)
253
253
  }, null, 8, ["text"])) : u("", !0)
254
254
  ]),
255
255
  _: 1
256
256
  }),
257
- (l(!0), c(K, null, ke(o(P), (t, m) => (l(), c("div", {
257
+ (i(!0), c(be, null, ke(o(E), (t, m) => (i(), c("div", {
258
258
  id: "msg-" + (t.messageId ?? "mid-" + m),
259
259
  key: t.messageId ?? "mid-" + m,
260
- "data-timestamp": W(t),
260
+ "data-timestamp": P(t),
261
261
  class: "tracking-message",
262
- onDblclick: (p) => o(Q)(p, t)
262
+ onDblclick: (p) => o(J)(p, t)
263
263
  }, [
264
- (l(), f(he(o(z)(t.type)), {
264
+ (i(), f(he(o(q)(t.type)), {
265
265
  key: t.messageId ?? "mid-" + m,
266
266
  class: "message-feed__message",
267
267
  message: t,
268
268
  "apply-style": e.applyStyle,
269
269
  "is-first-in-series": t.isFirstInSeries,
270
- "reactions-enabled": E.value,
270
+ "reactions-enabled": z.value,
271
271
  "subtext-tooltip-data": e.subtextTooltipData,
272
- channel: N(t),
273
- onAction: o(H),
274
- onReply: o(J),
275
- onSmsInvite: (p) => Y(t),
276
- onRead: Z
272
+ channel: W(t),
273
+ onAction: o(U),
274
+ onReply: o(H),
275
+ onSmsInvite: (p) => X(t),
276
+ onRead: Y
277
277
  }, null, 40, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
278
- ], 40, Pe))), 128)),
279
- e.typing ? (l(), f(Ae, {
278
+ ], 40, We))), 128)),
279
+ e.typing ? (i(), f(Ae, {
280
280
  key: 0,
281
281
  message: {
282
282
  subText: e.typing.title,
@@ -285,61 +285,61 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
285
285
  }, null, 8, ["message"])) : u("", !0),
286
286
  g(v, null, {
287
287
  default: S(() => [
288
- o(_) ? (l(), f(Ie, {
288
+ o(Z) ? (i(), f(Ie, {
289
289
  key: 0,
290
290
  ref_key: "keyboardRef",
291
291
  ref: R,
292
292
  class: "message-feed__keyboard",
293
293
  keyboard: e.objects[e.objects.length - 1].keyboard,
294
294
  align: e.keyboardAlign,
295
- onAction: o(ee)
295
+ onAction: o(_)
296
296
  }, null, 8, ["keyboard", "align", "onAction"])) : u("", !0)
297
297
  ]),
298
298
  _: 1
299
299
  }),
300
- g(v, null, {
301
- default: S(() => [
302
- o(V) ? (l(), c("button", {
303
- key: 0,
304
- class: "message-feed__button-down",
305
- onClick: ce
306
- }, [
307
- e.buttonParams ? (l(), c("div", We, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
308
- n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
309
- ])) : u("", !0)
310
- ]),
311
- _: 1
312
- }),
313
- e.feedKeyboards && e.feedKeyboards.length > 0 ? (l(), f(Te, {
300
+ e.feedKeyboards && e.feedKeyboards.length > 0 ? (i(), f(Te, {
314
301
  key: 1,
315
302
  buttons: e.feedKeyboards,
316
303
  align: e.feedKeyboardAlign,
317
- onAction: o(te)
304
+ onAction: o(ee)
318
305
  }, null, 8, ["buttons", "align", "onAction"])) : u("", !0)
319
- ], 44, ze)) : (l(), c("div", {
306
+ ], 44, Ee)) : (i(), c("div", {
320
307
  key: 1,
321
308
  ref_key: "refFeed",
322
309
  ref: r,
323
310
  class: "message-feed",
324
- style: x({ backgroundImage: `url(${C.value})` })
311
+ style: K({ backgroundImage: `url(${C.value})` })
325
312
  }, [
326
313
  h("div", Ne, [
327
- L(s.$slots, "empty-feed", {}, void 0, !0)
314
+ x(s.$slots, "empty-feed", {}, void 0, !0)
328
315
  ])
329
316
  ], 4)),
330
- o(M)().reply ? (l(), f(Se, {
317
+ g(v, null, {
318
+ default: S(() => [
319
+ o(O) ? (i(), c("button", {
320
+ key: 0,
321
+ class: "message-feed__button-down",
322
+ onClick: de
323
+ }, [
324
+ e.buttonParams ? (i(), c("div", Ge, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
325
+ n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
326
+ ])) : u("", !0)
327
+ ]),
328
+ _: 1
329
+ }),
330
+ o(M)().reply ? (i(), f(Se, {
331
331
  key: 2,
332
332
  to: "#chat-input-reply-line-" + o(y)
333
333
  }, [
334
334
  g(Be, {
335
335
  class: "chat-input-reply",
336
336
  message: o(M)().reply,
337
- onReset: o(X)
337
+ onReset: o(Q)
338
338
  }, null, 8, ["message", "onReset"])
339
339
  ], 8, ["to"])) : u("", !0)
340
- ], 64));
340
+ ]));
341
341
  }
342
342
  });
343
343
  export {
344
- ct as default
344
+ ut as default
345
345
  };
@@ -1,9 +1,9 @@
1
1
  import { IFeedObject, IFeedTyping, IFeedUnreadButton, IFeedKeyboard } from '@/types';
2
- declare var __VLS_1: {}, __VLS_51: {};
2
+ declare var __VLS_1: {}, __VLS_47: {};
3
3
  type __VLS_Slots = {} & {
4
4
  prepend?: (props: typeof __VLS_1) => any;
5
5
  } & {
6
- 'empty-feed'?: (props: typeof __VLS_51) => any;
6
+ 'empty-feed'?: (props: typeof __VLS_47) => any;
7
7
  };
8
8
  declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
9
  objects: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",