@mobilon-dev/chotto 0.3.53 → 0.3.55
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/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +11 -10
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +7 -6
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +3 -2
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +96 -93
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +9 -8
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +9 -8
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +3 -2
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +14 -13
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +15 -14
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +3 -2
- package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +3 -2
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +3 -2
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +13 -12
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +69 -65
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +15 -14
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +154 -140
- package/dist/components/3_compounds/Feed/composables/useFeedLoadMore.js +40 -37
- package/dist/components/3_compounds/Feed/composables/useFeedMessageVisibility.js +17 -19
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +8 -7
- package/dist/components/3_compounds/Feed/composables/useStickyDate.js +31 -35
- package/dist/hooks/messages/useMessageLinks.js +41 -33
- 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/chats.d.ts +9 -0
- package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +12 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedMessageVisibility.d.ts +3 -1
- package/dist/types/hooks/messages/useMessageLinks.d.ts +3 -6
- package/package.json +1 -1
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const { feedRef: s, trackingObjects:
|
|
4
|
-
let
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { ref as w } from "vue";
|
|
2
|
+
function h(g) {
|
|
3
|
+
const { feedRef: s, trackingObjects: l, autoHideDelay: v = 500, onUpdate: e } = g, n = w(!1), r = w("");
|
|
4
|
+
let t = null;
|
|
5
|
+
const f = () => {
|
|
6
|
+
var d, m;
|
|
7
|
+
if (!s.value || !l.value) {
|
|
7
8
|
e == null || e();
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
for (const
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
11
|
+
const c = s.value.getBoundingClientRect().top;
|
|
12
|
+
let i = null;
|
|
13
|
+
for (const o of l.value) {
|
|
14
|
+
const a = o.getBoundingClientRect();
|
|
15
|
+
if (a.top <= c + 1 && a.bottom > c) {
|
|
16
|
+
i = o;
|
|
16
17
|
break;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
if (!
|
|
20
|
-
for (const
|
|
21
|
-
if (
|
|
22
|
-
|
|
20
|
+
if (!i) {
|
|
21
|
+
for (const o of l.value)
|
|
22
|
+
if (o.getBoundingClientRect().top >= c) {
|
|
23
|
+
i = o;
|
|
23
24
|
break;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
if (!
|
|
27
|
+
if (!i) {
|
|
27
28
|
e == null || e();
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const c = new Date(Number(t.timestamp) * 1e3);
|
|
37
|
-
r.value = c.toLocaleDateString(), e == null || e();
|
|
38
|
-
} catch {
|
|
39
|
-
e == null || e();
|
|
31
|
+
const u = ((d = i.dataset) == null ? void 0 : d.timestamp) ?? ((m = i.getAttribute) == null ? void 0 : m.call(i, "data-timestamp"));
|
|
32
|
+
if (u != null && u !== "") {
|
|
33
|
+
const o = new Date(Number(u) * 1e3);
|
|
34
|
+
r.value = o.toLocaleDateString();
|
|
40
35
|
}
|
|
36
|
+
e == null || e();
|
|
41
37
|
};
|
|
42
38
|
return {
|
|
43
|
-
showStickyDate:
|
|
39
|
+
showStickyDate: n,
|
|
44
40
|
stickyDateText: r,
|
|
45
|
-
updateStickyDate:
|
|
41
|
+
updateStickyDate: f,
|
|
46
42
|
show: () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
43
|
+
f(), n.value = !0, t && window.clearTimeout(t), t = window.setTimeout(() => {
|
|
44
|
+
n.value = !1;
|
|
45
|
+
}, v);
|
|
50
46
|
},
|
|
51
47
|
hide: () => {
|
|
52
|
-
|
|
48
|
+
t && (window.clearTimeout(t), t = null), n.value = !1;
|
|
53
49
|
},
|
|
54
50
|
cleanup: () => {
|
|
55
|
-
|
|
51
|
+
t && window.clearTimeout(t);
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
}
|
|
59
55
|
export {
|
|
60
|
-
|
|
56
|
+
h as useStickyDate
|
|
61
57
|
};
|
|
@@ -1,48 +1,56 @@
|
|
|
1
1
|
import { computed as h } from "vue";
|
|
2
2
|
import { tokenize as N } from "../../node_modules/linkifyjs/dist/linkify.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import T from "../../node_modules/linkify-string/dist/linkify-string.js";
|
|
4
|
+
import { parseMarkdown as E } from "../../functions/parseMarkdown.js";
|
|
5
|
+
function k(e) {
|
|
6
|
+
return e.includes("**") || e.includes("`") || e.includes("~~") || e.includes(`
|
|
7
|
+
|
|
8
|
+
`) || e.includes(">") && e.trimStart().startsWith(">") || /<\/(u|s|b|i)>|<(u|s|b|i)[\s>]/.test(e);
|
|
9
|
+
}
|
|
10
|
+
const _ = (e) => ({ linkedHtml: h(() => {
|
|
11
|
+
const t = e();
|
|
12
|
+
if (!t) return "";
|
|
13
|
+
if (!k(t))
|
|
14
|
+
return T(t);
|
|
15
|
+
const r = E(t), i = document.createElement("div");
|
|
16
|
+
i.innerHTML = r;
|
|
17
|
+
const p = (o) => {
|
|
18
|
+
var u;
|
|
19
|
+
const n = o.textContent || "", a = N(n);
|
|
20
|
+
if (a.length === 1 && !a[0].isLink)
|
|
13
21
|
return;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (
|
|
22
|
+
const l = document.createDocumentFragment();
|
|
23
|
+
a.forEach((s) => {
|
|
24
|
+
if (s.isLink) {
|
|
17
25
|
const c = document.createElement("a");
|
|
18
|
-
c.href =
|
|
26
|
+
c.href = s.toHref(), c.target = "_blank", c.textContent = s.toString(), l.appendChild(c);
|
|
19
27
|
} else
|
|
20
|
-
|
|
21
|
-
}), (
|
|
22
|
-
},
|
|
23
|
-
|
|
28
|
+
l.appendChild(document.createTextNode(s.toString()));
|
|
29
|
+
}), (u = o.parentNode) == null || u.replaceChild(l, o);
|
|
30
|
+
}, f = document.createTreeWalker(
|
|
31
|
+
i,
|
|
24
32
|
NodeFilter.SHOW_TEXT,
|
|
25
33
|
{
|
|
26
|
-
acceptNode: (
|
|
27
|
-
let
|
|
28
|
-
for (;
|
|
29
|
-
if (
|
|
34
|
+
acceptNode: (o) => {
|
|
35
|
+
let n = o.parentNode;
|
|
36
|
+
for (; n && n !== i; ) {
|
|
37
|
+
if (n.nodeName === "A")
|
|
30
38
|
return NodeFilter.FILTER_REJECT;
|
|
31
|
-
|
|
39
|
+
n = n.parentNode;
|
|
32
40
|
}
|
|
33
41
|
return NodeFilter.FILTER_ACCEPT;
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
|
-
),
|
|
37
|
-
let
|
|
38
|
-
for (;
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}), inNewWindow: (
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
44
|
+
), m = [];
|
|
45
|
+
let d;
|
|
46
|
+
for (; d = f.nextNode(); )
|
|
47
|
+
d.nodeType === Node.TEXT_NODE && m.push(d);
|
|
48
|
+
return m.reverse().forEach(p), i.innerHTML;
|
|
49
|
+
}), inNewWindow: (t) => {
|
|
50
|
+
t.preventDefault();
|
|
51
|
+
const r = t.target;
|
|
52
|
+
r && "href" in r && r.href && window.open(r.href, "_blank");
|
|
45
53
|
} });
|
|
46
54
|
export {
|
|
47
|
-
|
|
55
|
+
_ as useMessageLinks
|
|
48
56
|
};
|