@mobilon-dev/chotto 0.3.34 → 0.3.36

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.
Files changed (36) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +7 -0
  3. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +114 -0
  4. package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +23 -19
  5. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +2 -2
  6. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +62 -34
  7. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +262 -203
  8. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +56 -52
  9. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +20 -17
  10. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationDialogSync.js +27 -23
  11. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +7 -0
  12. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +18 -0
  13. package/dist/components/3_compounds/Feed/composables/useFeedComponents.js +13 -11
  14. package/dist/index.js +239 -235
  15. package/dist/themes/dark.css +1 -1
  16. package/dist/themes/default.css +1 -1
  17. package/dist/themes/glass.css +1 -1
  18. package/dist/themes/green.css +1 -1
  19. package/dist/themes/mobilon1.css +1 -1
  20. package/dist/types/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.d.ts +59 -0
  21. package/dist/types/components/1_atoms/ContactContextMenu/stories/ContactContextMenu.stories.d.ts +10 -0
  22. package/dist/types/components/1_atoms/ContactContextMenu/styles/types.d.ts +67 -0
  23. package/dist/types/components/1_atoms/ContextMenu/styles/types.d.ts +6 -0
  24. package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +22 -1
  25. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +6 -0
  26. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +6 -2
  27. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationDialogSync.d.ts +10 -2
  28. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +6 -0
  29. package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +13 -0
  30. package/dist/types/components/2_feed_elements/DelimiterMessage/stories/DelimiterMessage.stories.d.ts +6 -0
  31. package/dist/types/components/2_feed_elements/DelimiterMessage/styles/types.d.ts +27 -0
  32. package/dist/types/components/2_feed_elements/types/messages.d.ts +4 -0
  33. package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +1 -1
  34. package/dist/types/components/4_layouts/BaseLayout/styles/types.d.ts +6 -0
  35. package/dist/types/components/index.d.ts +2 -0
  36. package/package.json +1 -1
@@ -1,83 +1,87 @@
1
- function j({
2
- activeChannelType: u,
3
- channels: t,
4
- recentAttributeChannels: k,
5
- selectedChannel: c,
6
- selectedChannelType: f,
7
- isRecentAttributeHovered: C,
8
- hoveredAttribute: o,
9
- closeMenu: e,
10
- hasMultipleChannels: d,
11
- getSingleChannelForType: h,
12
- getAvailableChannels: R,
13
- emit: i
1
+ function K({
2
+ activeChannelType: a,
3
+ channels: c,
4
+ recentAttributeChannels: q,
5
+ selectedChannel: i,
6
+ selectedChannelType: e,
7
+ isRecentAttributeHovered: z,
8
+ hoveredAttribute: r,
9
+ closeMenu: v,
10
+ hasMultipleChannels: R,
11
+ getSingleChannelForType: x,
12
+ getAvailableChannels: B,
13
+ isChannelEmpty: t,
14
+ isNewDialog: s,
15
+ showDefaultChannelTooltipWithTimer: d,
16
+ clearDefaultChannelTooltip: o,
17
+ emit: f
14
18
  }) {
15
- const r = (n) => {
16
- n && (i("phone-call", {
19
+ const b = (n) => {
20
+ n && (f("phone-call", {
17
21
  attributeId: n.id,
18
22
  phoneNumber: n.data
19
- }), e());
20
- }, s = (n, l) => {
21
- i("select-attribute-channel", {
23
+ }), v());
24
+ }, k = (n, u) => {
25
+ f("select-attribute-channel", {
22
26
  attributeId: n.id,
23
- channelId: l
24
- }), f.value = u.value, c.value = t.value.find((a) => a.channelId === l) ?? {}, e();
25
- }, v = (n, l) => {
26
- l && i("select-attribute-channel", {
27
- attributeId: l.id,
27
+ channelId: u
28
+ }), e.value = a.value, i.value = c.value.find((l) => l.channelId === u) ?? {}, t(u) && s.value ? d() : o(), v();
29
+ }, I = (n, u) => {
30
+ u && f("select-attribute-channel", {
31
+ attributeId: u.id,
28
32
  channelId: n
29
- }), f.value = u.value, c.value = t.value.find((a) => a.channelId === n) ?? {}, e();
33
+ }), e.value = a.value, i.value = c.value.find((l) => l.channelId === n) ?? {}, t(n) && s.value ? d() : o(), v();
30
34
  };
31
35
  return {
32
- handlePhoneCall: r,
36
+ handlePhoneCall: b,
33
37
  handleRecentAttributeClick: (n) => {
34
- var I;
35
- const l = u.value;
36
- if (!l)
38
+ var P;
39
+ const u = a.value;
40
+ if (!u)
37
41
  return;
38
- if (l === "phone") {
39
- r(n);
42
+ if (u === "phone") {
43
+ b(n);
40
44
  return;
41
45
  }
42
- if (!d(l)) {
43
- const b = h(l);
44
- n && b && s(n, b.channelId);
46
+ if (!R(u)) {
47
+ const j = x(u);
48
+ n && j && k(n, j.channelId);
45
49
  return;
46
50
  }
47
- const a = (I = k.value[l]) == null ? void 0 : I.channelId;
48
- n && a && v(a, n);
51
+ const l = (P = q.value[u]) == null ? void 0 : P.channelId;
52
+ n && l && I(l, n);
49
53
  },
50
54
  handleAttributeClick: (n) => {
51
- const l = u.value;
52
- if (l) {
53
- if (l === "phone") {
54
- r(n);
55
+ const u = a.value;
56
+ if (u) {
57
+ if (u === "phone") {
58
+ b(n);
55
59
  return;
56
60
  }
57
- if (!d(l)) {
58
- const a = h(l);
59
- a && s(n, a.channelId);
61
+ if (!R(u)) {
62
+ const l = x(u);
63
+ l && k(n, l.channelId);
60
64
  }
61
65
  }
62
66
  },
63
- selectSingleChannel: s,
64
- selectChannelForRecentAttribute: v,
67
+ selectSingleChannel: k,
68
+ selectChannelForRecentAttribute: I,
65
69
  selectChannel: (n) => {
66
- if (C.value) {
67
- v(n, o.value ?? null);
70
+ if (z.value) {
71
+ I(n, r.value ?? null);
68
72
  return;
69
73
  }
70
- o.value && (i("select-attribute-channel", {
71
- attributeId: o.value.id,
74
+ r.value && (f("select-attribute-channel", {
75
+ attributeId: r.value.id,
72
76
  channelId: n
73
- }), f.value = u.value, c.value = t.value.find((l) => l.channelId === n) ?? {}), e();
77
+ }), e.value = a.value, i.value = c.value.find((u) => u.channelId === n) ?? {}, t(n) && s.value ? d() : o()), v();
74
78
  },
75
79
  availableChannels: () => {
76
- const n = u.value;
77
- return n ? R(n) : [];
80
+ const n = a.value;
81
+ return n ? B(n) : [];
78
82
  }
79
83
  };
80
84
  }
81
85
  export {
82
- j as useCommunicationActions
86
+ K as useCommunicationActions
83
87
  };
@@ -1,16 +1,16 @@
1
- import { computed as r, unref as l, ref as v, watch as y } from "vue";
2
- import { CHANNEL_TYPES as f } from "./useCommunicationChannels.js";
3
- function C({
4
- contactAttributes: m,
1
+ import { computed as r, unref as f, ref as y, watch as g } from "vue";
2
+ import { CHANNEL_TYPES as m } from "./useCommunicationChannels.js";
3
+ function w({
4
+ contactAttributes: d,
5
5
  recentAttributeChannels: b,
6
6
  activeChannelType: o,
7
- frozenAttribute: d
7
+ frozenAttribute: h
8
8
  }) {
9
- const u = r(() => l(m) ?? []), i = r(() => l(b) ?? {}), s = v(
10
- Object.fromEntries(f.map((t) => [t, []]))
9
+ const u = r(() => f(d) ?? []), i = r(() => f(b) ?? {}), s = y(
10
+ Object.fromEntries(m.map((t) => [t, []]))
11
11
  ), c = () => {
12
12
  const t = Object.fromEntries(
13
- f.map((e) => [e, []])
13
+ m.map((e) => [e, []])
14
14
  );
15
15
  u.value.forEach((e) => {
16
16
  if (!(!e || !e.type)) {
@@ -28,33 +28,36 @@ function C({
28
28
  }
29
29
  }), s.value = t;
30
30
  };
31
- y(u, c, { deep: !0, immediate: !0 });
31
+ g(u, c, { deep: !0, immediate: !0 });
32
32
  const a = (t) => {
33
33
  var n;
34
34
  const e = (n = i.value[t]) == null ? void 0 : n.attributeId;
35
- return e ? u.value.find((A) => A.id === e) ?? null : null;
36
- }, p = r(() => {
35
+ return e ? u.value.find((v) => {
36
+ var p;
37
+ return (p = v.id) == null ? void 0 : p.includes(e);
38
+ }) ?? null : null;
39
+ }, l = r(() => {
37
40
  const t = o.value;
38
41
  return t ? a(t) : null;
39
- }), h = r(() => {
42
+ }), A = r(() => {
40
43
  const t = o.value;
41
44
  if (!t || t === "phone")
42
45
  return !1;
43
- const e = p.value, n = i.value[t];
46
+ const e = l.value, n = i.value[t];
44
47
  return !!(e && (n != null && n.channelId));
45
48
  });
46
49
  return {
47
50
  organizedContactAttributes: s,
48
51
  organizeContactAttributes: c,
49
- recentAttribute: p,
52
+ recentAttribute: l,
50
53
  getRecentAttributeByType: a,
51
- showRecentAttribute: h,
54
+ showRecentAttribute: A,
52
55
  isAttributeFrozen: (t) => {
53
- const e = d.value;
56
+ const e = h.value;
54
57
  return !t || !(e != null && e.id) ? !1 : t.id === e.id;
55
58
  }
56
59
  };
57
60
  }
58
61
  export {
59
- C as useCommunicationAttributes
62
+ w as useCommunicationAttributes
60
63
  };
@@ -1,36 +1,40 @@
1
- import { watch as m, unref as f } from "vue";
2
- import { CHANNEL_TYPES as h } from "./useCommunicationChannels.js";
3
- function v({
4
- selectedChannelType: n,
5
- selectedChannel: l,
6
- channels: t,
7
- selectedDialog: c
1
+ import { watch as d, unref as p } from "vue";
2
+ import { CHANNEL_TYPES as v } from "./useCommunicationChannels.js";
3
+ function b({
4
+ selectedChannelType: e,
5
+ selectedChannel: u,
6
+ channels: c,
7
+ selectedDialog: i,
8
+ isChannelEmpty: m,
9
+ isNewDialog: o,
10
+ showDefaultChannelTooltipWithTimer: f,
11
+ clearDefaultChannelTooltip: l
8
12
  }) {
9
- const u = (e) => {
10
- if (!e || !e.channelId) {
11
- n.value = null, l.value = {};
13
+ const r = (n) => {
14
+ if (!n || !n.channelId) {
15
+ e.value = null, u.value = {}, l();
12
16
  return;
13
17
  }
14
- const r = e.channelId ? e.channelId.split(".")[0] : null, a = r ? d(r) : null;
15
- if (a) {
16
- n.value = a;
17
- const i = t.value.find((o) => o.channelId === e.channelId);
18
- l.value = i ?? {};
18
+ const a = n.channelId ? n.channelId.split(".")[0] : null, t = a ? I(a) : null;
19
+ if (t) {
20
+ e.value = t;
21
+ const h = c.value.find((s) => s.channelId === n.channelId);
22
+ u.value = h ?? {}, m(n.channelId) && o.value ? f() : l();
19
23
  }
20
24
  };
21
- return m(
22
- () => f(c),
23
- (e) => {
24
- u(e ?? null);
25
+ return d(
26
+ () => p(i),
27
+ (n) => {
28
+ r(n ?? null);
25
29
  },
26
30
  { immediate: !0, deep: !0 }
27
31
  ), {
28
- updateSelectedChannelFromDialog: u
32
+ updateSelectedChannelFromDialog: r
29
33
  };
30
34
  }
31
- function d(n) {
32
- return n.includes("waba") ? "whatsapp" : n.includes("telegrambot") ? "telegram" : h.includes(n) ? n : null;
35
+ function I(e) {
36
+ return e.includes("waba") ? "whatsapp" : e.includes("telegrambot") ? "telegram" : v.includes(e) ? e : null;
33
37
  }
34
38
  export {
35
- v as useCommunicationDialogSync
39
+ b as useCommunicationDialogSync
36
40
  };
@@ -0,0 +1,7 @@
1
+ import o from "./DelimiterMessage.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5ac955b7"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,18 @@
1
+ import { defineComponent as t, createElementBlock as s, openBlock as r, createElementVNode as o, toDisplayString as a } from "vue";
2
+ const i = { class: "delimiter-message__container" }, n = { class: "delimiter-message__text" }, l = /* @__PURE__ */ t({
3
+ __name: "DelimiterMessage",
4
+ props: {
5
+ message: {
6
+ type: Object,
7
+ required: !0
8
+ }
9
+ },
10
+ setup(e) {
11
+ return (c, m) => (r(), s("div", i, [
12
+ o("p", n, a(e.message.text), 1)
13
+ ]));
14
+ }
15
+ });
16
+ export {
17
+ l as default
18
+ };
@@ -1,29 +1,31 @@
1
1
  import s from "../../../2_feed_elements/AudioMessage/AudioMessage.vue.js";
2
2
  import m from "../../../2_feed_elements/CallMessage/CallMessage.vue.js";
3
3
  import o from "../../../2_feed_elements/FileMessage/FileMessage.vue.js";
4
- import t from "../../../2_feed_elements/ImageMessage/ImageMessage.vue.js";
5
- import r from "../../../2_feed_elements/TextMessage/TextMessage.vue.js";
4
+ import r from "../../../2_feed_elements/ImageMessage/ImageMessage.vue.js";
5
+ import t from "../../../2_feed_elements/TextMessage/TextMessage.vue.js";
6
6
  import a from "../../../2_feed_elements/VideoMessage/VideoMessage.vue.js";
7
- import g from "../../../2_feed_elements/DateMessage/DateMessage.vue.js";
8
- import i from "../../../2_feed_elements/SystemMessage/SystemMessage.vue.js";
7
+ import i from "../../../2_feed_elements/DateMessage/DateMessage.vue.js";
8
+ import g from "../../../2_feed_elements/SystemMessage/SystemMessage.vue.js";
9
9
  import p from "../../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
10
10
  import n from "../../../2_feed_elements/StickerMessage/StickerMessage.vue.js";
11
- function T() {
11
+ import f from "../../../2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js";
12
+ function v() {
12
13
  return {
13
14
  componentsMap: (e) => ({
14
- "message.text": r,
15
- "message.image": t,
15
+ "message.text": t,
16
+ "message.image": r,
16
17
  "message.file": o,
17
18
  "message.audio": s,
18
19
  "message.video": a,
19
20
  "message.call": m,
20
21
  "message.sticker": n,
21
- "message.system": i,
22
- "system.date": g,
23
- "message.typing": p
22
+ "message.system": g,
23
+ "system.date": i,
24
+ "message.typing": p,
25
+ "message.delimiter": f
24
26
  })[e]
25
27
  };
26
28
  }
27
29
  export {
28
- T as useFeedComponents
30
+ v as useFeedComponents
29
31
  };