@mobilon-dev/chotto 0.3.42 → 0.3.43
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/chotto.css +1 -1
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +99 -89
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +7 -0
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +64 -0
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +74 -64
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +134 -128
- package/dist/locale/en.js +2 -1
- package/dist/locale/ru.js +2 -1
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/apps/data/messages.d.ts +135 -7
- package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.d.ts +11 -0
- package/dist/types/components/2_feed_elements/MessageSmsInvite/styles/types.d.ts +49 -0
- package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/types/messages.d.ts +12 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +4 -2
- package/dist/types/hooks/validators/messages/types.d.ts +1 -0
- package/dist/types/locale/en.d.ts +1 -0
- package/dist/types/locale/ru.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useFeedButton as
|
|
8
|
-
import { useFeedComponents as
|
|
9
|
-
import { useFeedGrouping as
|
|
10
|
-
import { useFeedKeyboard as
|
|
11
|
-
import { useFeedLoadMore as
|
|
12
|
-
import { useFeedMessageVisibility as
|
|
13
|
-
import { useFeedReply as
|
|
14
|
-
import { useFeedScroll as
|
|
15
|
-
import { useFeedScrollTo as
|
|
16
|
-
import { useStickyDate as
|
|
17
|
-
import { throttle as
|
|
18
|
-
import
|
|
1
|
+
import { defineComponent as ne, ref as b, computed as i, inject as ae, watch as re, nextTick as C, onMounted as ie, createElementBlock as d, openBlock as s, Fragment as D, createBlock as m, createCommentVNode as c, unref as t, normalizeStyle as I, createVNode as y, Transition as p, withCtx as k, renderList as de, resolveDynamicComponent as ce, createElementVNode as w, toDisplayString as ue, renderSlot as me, Teleport as fe } from "vue";
|
|
2
|
+
import ye from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
|
+
import ge from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
|
+
import be from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
5
|
+
import pe from "../../2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js";
|
|
6
|
+
import ke from "../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
|
|
7
|
+
import { useFeedButton as ve } from "./composables/useFeedButton.js";
|
|
8
|
+
import { useFeedComponents as Se } from "./composables/useFeedComponents.js";
|
|
9
|
+
import { useFeedGrouping as he } from "./composables/useFeedGrouping.js";
|
|
10
|
+
import { useFeedKeyboard as Re } from "./composables/useFeedKeyboard.js";
|
|
11
|
+
import { useFeedLoadMore as Be } from "./composables/useFeedLoadMore.js";
|
|
12
|
+
import { useFeedMessageVisibility as Te } from "./composables/useFeedMessageVisibility.js";
|
|
13
|
+
import { useFeedReply as Ae } from "./composables/useFeedReply.js";
|
|
14
|
+
import { useFeedScroll as Fe } from "./composables/useFeedScroll.js";
|
|
15
|
+
import { useFeedScrollTo as Me } from "./composables/useFeedScrollTo.js";
|
|
16
|
+
import { useStickyDate as Ce } from "./composables/useStickyDate.js";
|
|
17
|
+
import { throttle as De } from "./functions/throttle.js";
|
|
18
|
+
import Ie from "./assets/chat-background.svg.js";
|
|
19
19
|
const we = ["id"], je = ["id", "onDblclick"], Ke = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "message-feed__unread-amount"
|
|
22
|
-
}, xe = { style: { margin: "auto" } },
|
|
22
|
+
}, xe = { style: { margin: "auto" } }, _e = /* @__PURE__ */ ne({
|
|
23
23
|
__name: "Feed",
|
|
24
24
|
props: {
|
|
25
25
|
objects: {
|
|
@@ -93,141 +93,147 @@ const we = ["id"], je = ["id", "onDblclick"], Ke = {
|
|
|
93
93
|
"clickRepliedMessage",
|
|
94
94
|
"forceScrollToBottom",
|
|
95
95
|
"keyboardAction",
|
|
96
|
-
"feedAction"
|
|
96
|
+
"feedAction",
|
|
97
|
+
"smsInvite"
|
|
97
98
|
],
|
|
98
99
|
setup(e, { emit: j }) {
|
|
99
|
-
const
|
|
100
|
+
const l = e, g = b(), n = b(), v = b(), {
|
|
100
101
|
isShowButton: K,
|
|
101
102
|
isKeyboardPlace: x,
|
|
102
|
-
checkButtonVisibility:
|
|
103
|
-
} =
|
|
104
|
-
feedRef:
|
|
105
|
-
keyboardRef:
|
|
106
|
-
}), { componentsMap: O } =
|
|
107
|
-
objects:
|
|
108
|
-
}),
|
|
109
|
-
checkScrollPosition:
|
|
103
|
+
checkButtonVisibility: $
|
|
104
|
+
} = ve({
|
|
105
|
+
feedRef: n,
|
|
106
|
+
keyboardRef: v
|
|
107
|
+
}), { componentsMap: O } = Se(), V = i(() => l.reactionsEnabled), { groupedObjects: q } = he({
|
|
108
|
+
objects: i(() => l.objects)
|
|
109
|
+
}), f = ae("chatAppId"), u = j, {
|
|
110
|
+
checkScrollPosition: z,
|
|
110
111
|
startScrollWatch: S,
|
|
111
|
-
stopScrollWatch:
|
|
112
|
-
resetAllowFlags:
|
|
113
|
-
} =
|
|
114
|
-
feedRef:
|
|
115
|
-
emit:
|
|
116
|
-
isLoadingMoreRef:
|
|
112
|
+
stopScrollWatch: h,
|
|
113
|
+
resetAllowFlags: E
|
|
114
|
+
} = Be({
|
|
115
|
+
feedRef: n,
|
|
116
|
+
emit: u,
|
|
117
|
+
isLoadingMoreRef: i(() => l.isLoadingMore)
|
|
117
118
|
}), {
|
|
118
119
|
getMessage: R,
|
|
119
|
-
messageAction:
|
|
120
|
-
handleClickReplied:
|
|
121
|
-
feedObjectDoubleClick:
|
|
122
|
-
handleResetReply:
|
|
123
|
-
} =
|
|
124
|
-
enableDoubleClickReply:
|
|
125
|
-
emit:
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
120
|
+
messageAction: L,
|
|
121
|
+
handleClickReplied: P,
|
|
122
|
+
feedObjectDoubleClick: N,
|
|
123
|
+
handleResetReply: W
|
|
124
|
+
} = Ae({
|
|
125
|
+
enableDoubleClickReply: l.enableDoubleClickReply,
|
|
126
|
+
emit: u
|
|
127
|
+
});
|
|
128
|
+
function G(a) {
|
|
129
|
+
u("smsInvite", a);
|
|
130
|
+
}
|
|
131
|
+
const {
|
|
132
|
+
showKeyboard: J,
|
|
133
|
+
keyboardAction: U,
|
|
134
|
+
feedKeyboardAction: H
|
|
135
|
+
} = Re({
|
|
131
136
|
isKeyboardPlace: x,
|
|
132
|
-
objects:
|
|
133
|
-
emit:
|
|
137
|
+
objects: i(() => l.objects),
|
|
138
|
+
emit: u
|
|
134
139
|
}), {
|
|
135
|
-
showStickyDate:
|
|
136
|
-
stickyDateText:
|
|
137
|
-
show:
|
|
138
|
-
} =
|
|
139
|
-
feedRef:
|
|
140
|
+
showStickyDate: Q,
|
|
141
|
+
stickyDateText: X,
|
|
142
|
+
show: Y
|
|
143
|
+
} = Ce({
|
|
144
|
+
feedRef: n,
|
|
140
145
|
trackingObjects: g
|
|
141
146
|
}), {
|
|
142
|
-
isInitialized:
|
|
143
|
-
performScrollToBottom:
|
|
147
|
+
isInitialized: Z,
|
|
148
|
+
performScrollToBottom: _,
|
|
144
149
|
ensureScrollToBottom: B,
|
|
145
|
-
initializeScroll:
|
|
146
|
-
smoothScrollToBottom:
|
|
147
|
-
} =
|
|
148
|
-
feedRef:
|
|
149
|
-
objectsRef:
|
|
150
|
-
scrollToBottomRef:
|
|
151
|
-
}), T =
|
|
152
|
-
function A(
|
|
153
|
-
|
|
150
|
+
initializeScroll: ee,
|
|
151
|
+
smoothScrollToBottom: te
|
|
152
|
+
} = Fe({
|
|
153
|
+
feedRef: n,
|
|
154
|
+
objectsRef: i(() => l.objects),
|
|
155
|
+
scrollToBottomRef: i(() => l.scrollToBottom)
|
|
156
|
+
}), T = i(() => l.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(Ie)}`);
|
|
157
|
+
function A(a = !0) {
|
|
158
|
+
$(), z(a), Y();
|
|
154
159
|
}
|
|
155
|
-
const
|
|
156
|
-
function
|
|
157
|
-
|
|
160
|
+
const oe = De(() => A(), 250);
|
|
161
|
+
function se() {
|
|
162
|
+
u("forceScrollToBottom"), te();
|
|
158
163
|
}
|
|
159
|
-
const { restartObserving:
|
|
160
|
-
feedRef:
|
|
164
|
+
const { restartObserving: le } = Te({
|
|
165
|
+
feedRef: n,
|
|
161
166
|
trackingObjects: g,
|
|
162
|
-
chatAppId:
|
|
163
|
-
onMessageVisible: (
|
|
167
|
+
chatAppId: f,
|
|
168
|
+
onMessageVisible: (a) => u("messageVisible", a)
|
|
164
169
|
});
|
|
165
|
-
return
|
|
166
|
-
() =>
|
|
170
|
+
return re(
|
|
171
|
+
() => l.objects,
|
|
167
172
|
() => {
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
C(() => {
|
|
174
|
+
E(), A(!1), g.value = document.querySelectorAll(".tracking-message"), le();
|
|
170
175
|
});
|
|
171
176
|
},
|
|
172
177
|
{ immediate: !0 }
|
|
173
|
-
),
|
|
174
|
-
targetIdRef:
|
|
175
|
-
feedContainerId: `feed-container-${
|
|
176
|
-
}),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
178
|
+
), Me({
|
|
179
|
+
targetIdRef: i(() => l.scrollTo),
|
|
180
|
+
feedContainerId: `feed-container-${f}`
|
|
181
|
+
}), ie(() => {
|
|
182
|
+
C(() => {
|
|
183
|
+
l.objects.length > 0 && !Z.value && ee();
|
|
184
|
+
const a = new ResizeObserver(() => {
|
|
185
|
+
l.scrollToBottom && (_(), setTimeout(() => {
|
|
181
186
|
B();
|
|
182
187
|
}, 200), setTimeout(() => {
|
|
183
188
|
B();
|
|
184
189
|
}, 800));
|
|
185
190
|
});
|
|
186
|
-
|
|
191
|
+
n.value && a.observe(n.value);
|
|
187
192
|
});
|
|
188
|
-
}), (
|
|
189
|
-
e.objects.length > 0 || e.typing ? (
|
|
193
|
+
}), (a, r) => (s(), d(D, null, [
|
|
194
|
+
e.objects.length > 0 || e.typing ? (s(), d("div", {
|
|
190
195
|
key: 0,
|
|
191
|
-
id: "feed-container-" + t(
|
|
196
|
+
id: "feed-container-" + t(f),
|
|
192
197
|
ref_key: "refFeed",
|
|
193
|
-
ref:
|
|
198
|
+
ref: n,
|
|
194
199
|
class: "message-feed",
|
|
195
|
-
style:
|
|
196
|
-
onScroll:
|
|
197
|
-
onMousedown:
|
|
198
|
-
(...
|
|
199
|
-
onMouseup:
|
|
200
|
-
(...
|
|
200
|
+
style: I({ backgroundImage: `url(${T.value})` }),
|
|
201
|
+
onScroll: r[0] || (r[0] = (o) => t(oe)()),
|
|
202
|
+
onMousedown: r[1] || (r[1] = //@ts-ignore
|
|
203
|
+
(...o) => t(S) && t(S)(...o)),
|
|
204
|
+
onMouseup: r[2] || (r[2] = //@ts-ignore
|
|
205
|
+
(...o) => t(h) && t(h)(...o))
|
|
201
206
|
}, [
|
|
202
207
|
y(p, null, {
|
|
203
208
|
default: k(() => [
|
|
204
|
-
t(
|
|
209
|
+
t(Q) ? (s(), m(ye, {
|
|
205
210
|
key: 0,
|
|
206
211
|
class: "message-feed__sticky-date",
|
|
207
|
-
text: t(
|
|
212
|
+
text: t(X)
|
|
208
213
|
}, null, 8, ["text"])) : c("", !0)
|
|
209
214
|
]),
|
|
210
215
|
_: 1
|
|
211
216
|
}),
|
|
212
|
-
(
|
|
213
|
-
id: JSON.stringify(
|
|
214
|
-
key: `${
|
|
217
|
+
(s(!0), d(D, null, de(t(q), (o, F) => (s(), d("div", {
|
|
218
|
+
id: JSON.stringify(o),
|
|
219
|
+
key: `${o.messageId ?? "mid"}-${F}`,
|
|
215
220
|
class: "tracking-message",
|
|
216
|
-
onDblclick: (
|
|
221
|
+
onDblclick: (M) => t(N)(M, o)
|
|
217
222
|
}, [
|
|
218
|
-
(
|
|
219
|
-
key: `${
|
|
223
|
+
(s(), m(ce(t(O)(o.type)), {
|
|
224
|
+
key: `${o.messageId ?? "mid"}-${F}`,
|
|
220
225
|
class: "message-feed__message",
|
|
221
|
-
message:
|
|
226
|
+
message: o,
|
|
222
227
|
"apply-style": e.applyStyle,
|
|
223
|
-
"is-first-in-series":
|
|
224
|
-
"reactions-enabled":
|
|
228
|
+
"is-first-in-series": o.isFirstInSeries,
|
|
229
|
+
"reactions-enabled": V.value,
|
|
225
230
|
"subtext-tooltip-data": e.subtextTooltipData,
|
|
226
|
-
onAction: t(
|
|
227
|
-
onReply: t(
|
|
228
|
-
|
|
231
|
+
onAction: t(L),
|
|
232
|
+
onReply: t(P),
|
|
233
|
+
onSmsInvite: (M) => G(o)
|
|
234
|
+
}, null, 40, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "onAction", "onReply", "onSmsInvite"]))
|
|
229
235
|
], 40, je))), 128)),
|
|
230
|
-
e.typing ? (
|
|
236
|
+
e.typing ? (s(), m(ke, {
|
|
231
237
|
key: 0,
|
|
232
238
|
message: {
|
|
233
239
|
subText: e.typing.title,
|
|
@@ -236,61 +242,61 @@ const we = ["id"], je = ["id", "onDblclick"], Ke = {
|
|
|
236
242
|
}, null, 8, ["message"])) : c("", !0),
|
|
237
243
|
y(p, null, {
|
|
238
244
|
default: k(() => [
|
|
239
|
-
t(
|
|
245
|
+
t(J) ? (s(), m(be, {
|
|
240
246
|
key: 0,
|
|
241
247
|
ref_key: "keyboardRef",
|
|
242
|
-
ref:
|
|
248
|
+
ref: v,
|
|
243
249
|
class: "message-feed__keyboard",
|
|
244
250
|
keyboard: e.objects[e.objects.length - 1].keyboard,
|
|
245
251
|
align: e.keyboardAlign,
|
|
246
|
-
onAction: t(
|
|
252
|
+
onAction: t(U)
|
|
247
253
|
}, null, 8, ["keyboard", "align", "onAction"])) : c("", !0)
|
|
248
254
|
]),
|
|
249
255
|
_: 1
|
|
250
256
|
}),
|
|
251
257
|
y(p, null, {
|
|
252
258
|
default: k(() => [
|
|
253
|
-
t(K) ? (
|
|
259
|
+
t(K) ? (s(), d("button", {
|
|
254
260
|
key: 0,
|
|
255
261
|
class: "message-feed__button-down",
|
|
256
|
-
onClick:
|
|
262
|
+
onClick: se
|
|
257
263
|
}, [
|
|
258
|
-
e.buttonParams ? (
|
|
259
|
-
|
|
264
|
+
e.buttonParams ? (s(), d("div", Ke, ue(e.buttonParams.unreadAmount), 1)) : c("", !0),
|
|
265
|
+
r[3] || (r[3] = w("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
260
266
|
])) : c("", !0)
|
|
261
267
|
]),
|
|
262
268
|
_: 1
|
|
263
269
|
}),
|
|
264
|
-
e.feedKeyboards && e.feedKeyboards.length > 0 ? (
|
|
270
|
+
e.feedKeyboards && e.feedKeyboards.length > 0 ? (s(), m(pe, {
|
|
265
271
|
key: 1,
|
|
266
272
|
buttons: e.feedKeyboards,
|
|
267
273
|
align: e.feedKeyboardAlign,
|
|
268
|
-
onAction: t(
|
|
274
|
+
onAction: t(H)
|
|
269
275
|
}, null, 8, ["buttons", "align", "onAction"])) : c("", !0)
|
|
270
|
-
], 44, we)) : (
|
|
276
|
+
], 44, we)) : (s(), d("div", {
|
|
271
277
|
key: 1,
|
|
272
278
|
ref_key: "refFeed",
|
|
273
|
-
ref:
|
|
279
|
+
ref: n,
|
|
274
280
|
class: "message-feed",
|
|
275
|
-
style:
|
|
281
|
+
style: I({ backgroundImage: `url(${T.value})` })
|
|
276
282
|
}, [
|
|
277
283
|
w("div", xe, [
|
|
278
|
-
|
|
284
|
+
me(a.$slots, "empty-feed", {}, void 0, !0)
|
|
279
285
|
])
|
|
280
286
|
], 4)),
|
|
281
|
-
t(R)().reply ? (
|
|
287
|
+
t(R)().reply ? (s(), m(fe, {
|
|
282
288
|
key: 2,
|
|
283
|
-
to: "#chat-input-reply-line-" + t(
|
|
289
|
+
to: "#chat-input-reply-line-" + t(f)
|
|
284
290
|
}, [
|
|
285
|
-
y(
|
|
291
|
+
y(ge, {
|
|
286
292
|
class: "chat-input-reply",
|
|
287
293
|
message: t(R)().reply,
|
|
288
|
-
onReset: t(
|
|
294
|
+
onReset: t(W)
|
|
289
295
|
}, null, 8, ["message", "onReset"])
|
|
290
296
|
], 8, ["to"])) : c("", !0)
|
|
291
297
|
], 64));
|
|
292
298
|
}
|
|
293
299
|
});
|
|
294
300
|
export {
|
|
295
|
-
|
|
301
|
+
_e as default
|
|
296
302
|
};
|
package/dist/locale/en.js
CHANGED
|
@@ -19,7 +19,8 @@ const e = {
|
|
|
19
19
|
"component.TextFormatToolbar.Underline": "Underline",
|
|
20
20
|
"component.TextFormatToolbar.Strikethrough": "Strikethrough",
|
|
21
21
|
"component.TextFormatToolbar.Code": "Inline code",
|
|
22
|
-
"component.TextFormatToolbar.Quote": "Quote"
|
|
22
|
+
"component.TextFormatToolbar.Quote": "Quote",
|
|
23
|
+
"component.TextMessage.sendSmsInvite": "Send SMS invitation"
|
|
23
24
|
};
|
|
24
25
|
export {
|
|
25
26
|
e as en
|
package/dist/locale/ru.js
CHANGED
|
@@ -19,7 +19,8 @@ const e = {
|
|
|
19
19
|
"component.TextFormatToolbar.Underline": "Подчёркнутый",
|
|
20
20
|
"component.TextFormatToolbar.Strikethrough": "Зачёркнутый",
|
|
21
21
|
"component.TextFormatToolbar.Code": "Встроенный код",
|
|
22
|
-
"component.TextFormatToolbar.Quote": "Цитата"
|
|
22
|
+
"component.TextFormatToolbar.Quote": "Цитата",
|
|
23
|
+
"component.TextMessage.sendSmsInvite": "Отправить SMS приглашение"
|
|
23
24
|
};
|
|
24
25
|
export {
|
|
25
26
|
e as ru
|