@mobilon-dev/chotto 0.3.32 → 0.3.34

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 (75) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js +2 -2
  3. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +28 -27
  4. package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +36 -22
  5. package/dist/components/1_icons/SettingsIcon.vue.js +6 -6
  6. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +164 -156
  7. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +4 -103
  8. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +135 -0
  9. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +33 -11
  10. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +4 -0
  11. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +4 -102
  12. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +135 -0
  13. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +21 -18
  14. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +4 -0
  15. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
  16. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +89 -55
  17. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +17 -14
  18. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +4 -0
  19. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +7 -0
  20. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +360 -0
  21. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +65 -0
  22. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +4 -0
  23. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
  24. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +164 -100
  25. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  26. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +184 -134
  27. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
  28. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +1 -1
  29. package/dist/components/3_compounds/ChatList/ChatList.vue.js +101 -91
  30. package/dist/components/3_compounds/SideBar/SideBar.vue.js +68 -67
  31. package/dist/hooks/messages/useChannelAccentColor.js +35 -19
  32. package/dist/index.js +191 -189
  33. package/dist/themes/dark.css +1 -1
  34. package/dist/themes/default.css +1 -1
  35. package/dist/themes/glass.css +1 -0
  36. package/dist/themes/green.css +1 -1
  37. package/dist/themes/mobilon1.css +1 -1
  38. package/dist/types/apps/data/images/stickers/animated/index.d.ts +9 -0
  39. package/dist/types/apps/data/images/stickers/index.d.ts +10 -0
  40. package/dist/types/apps/data/messages.d.ts +117 -86
  41. package/dist/types/components/1_atoms/ContextMenu/ContextMenu.vue.d.ts +5 -1
  42. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
  43. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
  44. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +4 -0
  45. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +31 -7
  46. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.d.ts +6 -1
  47. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/styles/types.d.ts +6 -0
  48. package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.d.ts +59 -11
  49. package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.d.ts +6 -1
  50. package/dist/types/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.d.ts +6 -1
  51. package/dist/types/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.d.ts +25 -0
  52. package/dist/types/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.d.ts +7 -0
  53. package/dist/types/components/2_chatinput_elements/StickerPicker/icons/index.d.ts +1 -0
  54. package/dist/types/components/2_chatinput_elements/StickerPicker/stories/StickerPicker.stories.d.ts +12 -0
  55. package/dist/types/components/2_chatinput_elements/StickerPicker/styles/types.d.ts +275 -0
  56. package/dist/types/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +2 -0
  57. package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +2 -0
  58. package/dist/types/components/2_elements/ChatInfo/styles/types.d.ts +2 -0
  59. package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +18 -0
  60. package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +24 -0
  61. package/dist/types/components/2_feed_elements/DateMessage/styles/types.d.ts +6 -0
  62. package/dist/types/components/2_feed_elements/DateMessageSticky/styles/types.d.ts +4 -0
  63. package/dist/types/components/2_feed_elements/FeedKeyboard/styles/types.d.ts +2 -0
  64. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +12 -0
  65. package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +126 -0
  66. package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +8 -0
  67. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +16 -0
  68. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
  69. package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +2 -0
  70. package/dist/types/components/3_compounds/ChatList/styles/types.d.ts +8 -0
  71. package/dist/types/components/3_compounds/SideBar/styles/types.d.ts +6 -16
  72. package/dist/types/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
  73. package/dist/types/components/4_layouts/ExtendedLayout/styles/types.d.ts +8 -0
  74. package/dist/types/components/index.d.ts +1 -0
  75. package/package.json +2 -1
@@ -0,0 +1,135 @@
1
+ import { defineComponent as A, ref as l, inject as D, computed as W, watchEffect as z, onMounted as R, onUnmounted as U, createElementBlock as j, openBlock as C, Fragment as $, createCommentVNode as q, createVNode as g, unref as b, normalizeClass as G, createElementVNode as B, Transition as J, withCtx as K, withDirectives as Q, vShow as X } from "vue";
2
+ import Y from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
3
+ /* empty css */
4
+ import { useMessageDraft as Z } from "../../../hooks/useMessageDraft.js";
5
+ import "../../../hooks/useSearchModel.js";
6
+ import "../../../hooks/useTheme.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ import "../../../node_modules/linkifyjs/dist/linkify.js";
10
+ import "../../../functions/parseMarkdown.js";
11
+ import ee from "./icons/SmilesIcon.vue.js";
12
+ const de = /* @__PURE__ */ A({
13
+ __name: "ButtonEmojiPicker",
14
+ props: {
15
+ state: {
16
+ type: String,
17
+ default: "active"
18
+ },
19
+ mode: {
20
+ type: String,
21
+ default: "click",
22
+ // или 'hover'
23
+ validator: (r) => ["click", "hover"].includes(r)
24
+ },
25
+ native: {
26
+ type: Boolean,
27
+ default: !0
28
+ }
29
+ },
30
+ setup(r) {
31
+ const t = r, v = l(null), f = l(null), o = l(!1), M = l("light"), i = D("chatAppId"), { setMessageText: P, getMessage: E } = Z(i), c = l("#5F5F5F"), u = l("#404040"), h = l(!1);
32
+ let a = null;
33
+ const p = () => {
34
+ if (!i) {
35
+ c.value = "#5F5F5F", u.value = "#404040";
36
+ return;
37
+ }
38
+ const e = document.getElementById(i);
39
+ if (!e) {
40
+ c.value = "#5F5F5F", u.value = "#404040";
41
+ return;
42
+ }
43
+ const n = window.getComputedStyle(e), d = n.getPropertyValue("--chotto-buttonemojipicker-button-span-color").trim(), H = n.getPropertyValue("--chotto-buttonemojipicker-button-span-hover-color").trim();
44
+ c.value = d || "#5F5F5F", u.value = H || "#404040";
45
+ }, w = W(() => h.value ? u.value : c.value);
46
+ z(() => {
47
+ p();
48
+ });
49
+ let s = !1, m = !1;
50
+ const I = () => {
51
+ var n;
52
+ const e = document.getElementById(i);
53
+ return (n = e == null ? void 0 : e.getAttribute("data-theme")) != null && n.includes("dark") ? "dark" : "light";
54
+ }, S = (e) => {
55
+ P(E().text + e.i), t.mode === "click" && (o.value = !1);
56
+ }, y = () => {
57
+ t.state === "active" && (M.value = I(), o.value = !0);
58
+ }, k = () => {
59
+ o.value = !1;
60
+ }, _ = () => {
61
+ t.mode === "click" && (o.value = !o.value, o.value && y());
62
+ }, T = () => {
63
+ t.mode === "hover" && (s = !0, y());
64
+ }, V = () => {
65
+ t.mode === "hover" && (s = !1, setTimeout(() => {
66
+ !m && !s && k();
67
+ }, 150));
68
+ }, x = () => {
69
+ h.value = !0, T();
70
+ }, L = () => {
71
+ h.value = !1, V();
72
+ }, N = () => {
73
+ t.mode === "hover" && (m = !0);
74
+ }, O = () => {
75
+ t.mode === "hover" && (m = !1, setTimeout(() => {
76
+ !s && !m && k();
77
+ }, 150));
78
+ }, F = (e) => {
79
+ t.mode === "click" && o.value && f.value && v.value && e.target instanceof Node && !f.value.contains(e.target) && !v.value.contains(e.target) && k();
80
+ };
81
+ return R(() => {
82
+ if (document.addEventListener("click", F), p(), i) {
83
+ const e = document.getElementById(i);
84
+ e && (a = new MutationObserver((n) => {
85
+ n.forEach((d) => {
86
+ d.type === "attributes" && d.attributeName === "data-theme" && p();
87
+ });
88
+ }), a.observe(e, {
89
+ attributes: !0,
90
+ attributeFilter: ["data-theme"]
91
+ }));
92
+ }
93
+ }), U(() => {
94
+ document.removeEventListener("click", F), a && (a.disconnect(), a = null);
95
+ }), (e, n) => (C(), j($, null, [
96
+ b(E)().isRecording ? q("", !0) : (C(), j("button", {
97
+ key: 0,
98
+ ref_key: "emojiButton",
99
+ ref: f,
100
+ class: G(["button", { "button-disabled": r.state === "disabled" }]),
101
+ onClick: _,
102
+ onMouseenter: x,
103
+ onMouseleave: L
104
+ }, [
105
+ B("span", null, [
106
+ g(b(ee), { fill: w.value }, null, 8, ["fill"])
107
+ ])
108
+ ], 34)),
109
+ g(J, null, {
110
+ default: K(() => [
111
+ Q(B("div", {
112
+ ref_key: "emoji",
113
+ ref: v,
114
+ class: "emoji",
115
+ onMouseenter: N,
116
+ onMouseleave: O
117
+ }, [
118
+ g(b(Y), {
119
+ native: r.native,
120
+ theme: M.value,
121
+ "picker-type": "",
122
+ onSelect: S
123
+ }, null, 8, ["native", "theme"])
124
+ ], 544), [
125
+ [X, o.value]
126
+ ])
127
+ ]),
128
+ _: 1
129
+ })
130
+ ], 64));
131
+ }
132
+ });
133
+ export {
134
+ de as default
135
+ };
@@ -1,18 +1,40 @@
1
- import { createElementBlock as t, openBlock as e, createStaticVNode as i } from "vue";
2
- import l from "../../../../_virtual/_plugin-vue_export-helper.js";
3
- const r = {}, o = {
1
+ import { defineComponent as e, createElementBlock as i, openBlock as n, createElementVNode as C } from "vue";
2
+ const o = {
4
3
  width: "27",
5
4
  height: "26",
6
5
  viewBox: "0 0 27 26",
7
6
  fill: "none",
8
7
  xmlns: "http://www.w3.org/2000/svg"
9
- };
10
- function c(n, C) {
11
- return e(), t("svg", o, [...C[0] || (C[0] = [
12
- i('<g clip-path="url(#clip0_1718_559)"><path d="M13.9883 24.375C10.9714 24.375 8.07817 23.1766 5.94494 21.0433C3.81172 18.9101 2.61328 16.0168 2.61328 13C2.61328 9.98316 3.81172 7.08989 5.94494 4.95666C8.07817 2.82343 10.9714 1.625 13.9883 1.625C17.0051 1.625 19.8984 2.82343 22.0316 4.95666C24.1648 7.08989 25.3633 9.98316 25.3633 13C25.3633 16.0168 24.1648 18.9101 22.0316 21.0433C19.8984 23.1766 17.0051 24.375 13.9883 24.375ZM13.9883 26C17.4361 26 20.7427 24.6304 23.1807 22.1924C25.6186 19.7544 26.9883 16.4478 26.9883 13C26.9883 9.55219 25.6186 6.24558 23.1807 3.80761C20.7427 1.36964 17.4361 0 13.9883 0C10.5405 0 7.23387 1.36964 4.79589 3.80761C2.35792 6.24558 0.988281 9.55219 0.988281 13C0.988281 16.4478 2.35792 19.7544 4.79589 22.1924C7.23387 24.6304 10.5405 26 13.9883 26Z" fill="#5F5F5F"></path><path d="M7.95115 15.5464C8.13776 15.4386 8.35953 15.4094 8.56767 15.4652C8.77581 15.521 8.95328 15.6571 9.06102 15.8438C9.56008 16.7088 10.2782 17.4271 11.1432 17.9263C12.0081 18.4256 12.9893 18.6881 13.988 18.6875C14.9867 18.6881 15.9679 18.4256 16.8329 17.9263C17.6978 17.4271 18.416 16.7088 18.915 15.8438C18.968 15.7506 19.0388 15.6688 19.1235 15.6032C19.2082 15.5375 19.3051 15.4893 19.4085 15.4612C19.5119 15.4331 19.6198 15.4258 19.7261 15.4396C19.8323 15.4534 19.9348 15.4881 20.0276 15.5417C20.1204 15.5953 20.2017 15.6667 20.2668 15.7518C20.3319 15.8369 20.3795 15.9341 20.4069 16.0377C20.4342 16.1412 20.4409 16.2492 20.4264 16.3554C20.4118 16.4616 20.3765 16.5638 20.3223 16.6562C19.6806 17.7683 18.7573 18.6918 17.6453 19.3336C16.5334 19.9755 15.2719 20.3131 13.988 20.3125C12.7041 20.3131 11.4427 19.9755 10.3307 19.3336C9.21873 18.6918 8.29545 17.7683 7.65377 16.6562C7.54604 16.4696 7.51684 16.2479 7.57261 16.0397C7.62837 15.8316 7.76454 15.6541 7.95115 15.5464ZM12.363 10.5625C12.363 11.908 11.635 13 10.738 13C9.84102 13 9.11302 11.908 9.11302 10.5625C9.11302 9.217 9.84102 8.125 10.738 8.125C11.635 8.125 12.363 9.217 12.363 10.5625ZM18.863 10.5625C18.863 11.908 18.135 13 17.238 13C16.341 13 15.613 11.908 15.613 10.5625C15.613 9.217 16.341 8.125 17.238 8.125C18.135 8.125 18.863 9.217 18.863 10.5625Z" fill="#5F5F5F"></path></g><defs><clipPath id="clip0_1718_559"><rect width="26" height="26" fill="white" transform="translate(0.988281)"></rect></clipPath></defs>', 2)
13
- ])]);
14
- }
15
- const a = /* @__PURE__ */ l(r, [["render", c]]);
8
+ }, s = { "clip-path": "url(#clip0_1718_559)" }, f = ["fill"], c = ["fill"], d = /* @__PURE__ */ e({
9
+ __name: "SmilesIcon",
10
+ props: {
11
+ fill: { default: "#5F5F5F" }
12
+ },
13
+ setup(l) {
14
+ return (h, t) => (n(), i("svg", o, [
15
+ C("g", s, [
16
+ C("path", {
17
+ d: "M13.9883 24.375C10.9714 24.375 8.07817 23.1766 5.94494 21.0433C3.81172 18.9101 2.61328 16.0168 2.61328 13C2.61328 9.98316 3.81172 7.08989 5.94494 4.95666C8.07817 2.82343 10.9714 1.625 13.9883 1.625C17.0051 1.625 19.8984 2.82343 22.0316 4.95666C24.1648 7.08989 25.3633 9.98316 25.3633 13C25.3633 16.0168 24.1648 18.9101 22.0316 21.0433C19.8984 23.1766 17.0051 24.375 13.9883 24.375ZM13.9883 26C17.4361 26 20.7427 24.6304 23.1807 22.1924C25.6186 19.7544 26.9883 16.4478 26.9883 13C26.9883 9.55219 25.6186 6.24558 23.1807 3.80761C20.7427 1.36964 17.4361 0 13.9883 0C10.5405 0 7.23387 1.36964 4.79589 3.80761C2.35792 6.24558 0.988281 9.55219 0.988281 13C0.988281 16.4478 2.35792 19.7544 4.79589 22.1924C7.23387 24.6304 10.5405 26 13.9883 26Z",
18
+ fill: l.fill
19
+ }, null, 8, f),
20
+ C("path", {
21
+ d: "M7.95115 15.5464C8.13776 15.4386 8.35953 15.4094 8.56767 15.4652C8.77581 15.521 8.95328 15.6571 9.06102 15.8438C9.56008 16.7088 10.2782 17.4271 11.1432 17.9263C12.0081 18.4256 12.9893 18.6881 13.988 18.6875C14.9867 18.6881 15.9679 18.4256 16.8329 17.9263C17.6978 17.4271 18.416 16.7088 18.915 15.8438C18.968 15.7506 19.0388 15.6688 19.1235 15.6032C19.2082 15.5375 19.3051 15.4893 19.4085 15.4612C19.5119 15.4331 19.6198 15.4258 19.7261 15.4396C19.8323 15.4534 19.9348 15.4881 20.0276 15.5417C20.1204 15.5953 20.2017 15.6667 20.2668 15.7518C20.3319 15.8369 20.3795 15.9341 20.4069 16.0377C20.4342 16.1412 20.4409 16.2492 20.4264 16.3554C20.4118 16.4616 20.3765 16.5638 20.3223 16.6562C19.6806 17.7683 18.7573 18.6918 17.6453 19.3336C16.5334 19.9755 15.2719 20.3131 13.988 20.3125C12.7041 20.3131 11.4427 19.9755 10.3307 19.3336C9.21873 18.6918 8.29545 17.7683 7.65377 16.6562C7.54604 16.4696 7.51684 16.2479 7.57261 16.0397C7.62837 15.8316 7.76454 15.6541 7.95115 15.5464ZM12.363 10.5625C12.363 11.908 11.635 13 10.738 13C9.84102 13 9.11302 11.908 9.11302 10.5625C9.11302 9.217 9.84102 8.125 10.738 8.125C11.635 8.125 12.363 9.217 12.363 10.5625ZM18.863 10.5625C18.863 11.908 18.135 13 17.238 13C16.341 13 15.613 11.908 15.613 10.5625C15.613 9.217 16.341 8.125 17.238 8.125C18.135 8.125 18.863 9.217 18.863 10.5625Z",
22
+ fill: l.fill
23
+ }, null, 8, c)
24
+ ]),
25
+ t[0] || (t[0] = C("defs", null, [
26
+ C("clipPath", { id: "clip0_1718_559" }, [
27
+ C("rect", {
28
+ width: "26",
29
+ height: "26",
30
+ fill: "white",
31
+ transform: "translate(0.988281)"
32
+ })
33
+ ])
34
+ ], -1))
35
+ ]));
36
+ }
37
+ });
16
38
  export {
17
- a as default
39
+ d as default
18
40
  };
@@ -0,0 +1,4 @@
1
+ import f from "./SmilesIcon.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,105 +1,7 @@
1
- import { inject as h, ref as r, onMounted as g, createElementBlock as s, openBlock as i, Fragment as k, createVNode as a, withCtx as u, createCommentVNode as w, unref as p, normalizeClass as B, createElementVNode as d, Transition as T, withDirectives as b, vShow as M } from "vue";
2
- import S from "../TemplateSelector/TemplateSelector.vue.js";
3
- import C from "../../1_atoms/Tooltip/Tooltip.vue.js";
4
- import { useMessageDraft as _ } from "../../../hooks/useMessageDraft.js";
5
- import "../../../hooks/useSearchModel.js";
6
- import "../../../hooks/useTheme.js";
7
- /* empty css */
8
- import x from "../../../_virtual/_plugin-vue_export-helper.js";
9
- /* empty css */
10
- import "../../../node_modules/linkifyjs/dist/linkify.js";
11
- import "../../../functions/parseMarkdown.js";
12
- import q from "./icons/ChatTemplatesIcon.vue.js";
1
+ import t from "./ButtonTemplateSelector.vue2.js";
13
2
  /* empty css */
14
- const A = { class: "" }, I = {
15
- __name: "ButtonTemplateSelector",
16
- props: {
17
- templates: {
18
- type: Array,
19
- required: !1,
20
- default: () => []
21
- },
22
- groupTemplates: {
23
- type: Array,
24
- required: !1,
25
- default: () => []
26
- },
27
- mode: {
28
- type: String,
29
- required: !1,
30
- default: "click"
31
- },
32
- state: {
33
- type: String,
34
- default: "active"
35
- },
36
- elevatedWindow: {
37
- type: Boolean,
38
- required: !1
39
- },
40
- chatBackground: {
41
- type: String,
42
- default: void 0
43
- }
44
- },
45
- setup(o) {
46
- const t = o, c = h("chatAppId"), { getMessage: m } = _(c), f = r(null), e = r(null), v = () => {
47
- t.mode == "click" && t.state == "active" && (e.value.style.display == "none" ? e.value.style.display = "inherit" : e.value.style.display == "inherit" && (e.value.style.display = "none"));
48
- }, l = () => {
49
- t.mode == "hover" && t.state == "active" && (e.value.style.display = "inherit");
50
- }, n = () => {
51
- t.mode == "hover" && t.state == "active" && (e.value.style.display = "none");
52
- }, y = () => {
53
- e.value.style.display = "none";
54
- };
55
- return g(() => {
56
- e.value.style.display = "none";
57
- }), (N, V) => (i(), s(k, null, [
58
- a(C, {
59
- text: "Шаблоны сообщений",
60
- position: "left"
61
- }, {
62
- default: u(() => [
63
- p(m)().isRecording ? w("", !0) : (i(), s("button", {
64
- key: 0,
65
- ref_key: "templateButton",
66
- ref: f,
67
- class: B(["button-template", { "button-template-disabled": o.state == "disabled" }]),
68
- onClick: v,
69
- onMouseover: l,
70
- onMouseout: n
71
- }, [
72
- d("span", A, [
73
- a(p(q))
74
- ])
75
- ], 34))
76
- ]),
77
- _: 1
78
- }),
79
- a(T, null, {
80
- default: u(() => [
81
- b(d("div", {
82
- ref_key: "template",
83
- ref: e,
84
- onMouseover: l,
85
- onMouseout: n
86
- }, [
87
- a(S, {
88
- templates: o.templates,
89
- "group-templates": o.groupTemplates,
90
- "elevated-window": o.elevatedWindow,
91
- "chat-background": o.chatBackground,
92
- onCloseTemplateWindow: y
93
- }, null, 8, ["templates", "group-templates", "elevated-window", "chat-background"])
94
- ], 544), [
95
- [M, t.state === "active"]
96
- ])
97
- ]),
98
- _: 1
99
- })
100
- ], 64));
101
- }
102
- }, P = /* @__PURE__ */ x(I, [["__scopeId", "data-v-a3a0f5bd"]]);
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-478d6fd5"]]);
103
5
  export {
104
- P as default
6
+ p as default
105
7
  };
@@ -0,0 +1,135 @@
1
+ import { defineComponent as T, inject as E, ref as s, computed as I, watchEffect as V, onMounted as q, onUnmounted as x, createElementBlock as y, openBlock as g, Fragment as A, createVNode as d, withCtx as h, createCommentVNode as N, unref as b, normalizeClass as W, createElementVNode as F, Transition as $, withDirectives as D, vShow as H } from "vue";
2
+ import O from "../TemplateSelector/TemplateSelector.vue.js";
3
+ import P from "../../1_atoms/Tooltip/Tooltip.vue.js";
4
+ import { useMessageDraft as j } from "../../../hooks/useMessageDraft.js";
5
+ import "../../../hooks/useSearchModel.js";
6
+ import "../../../hooks/useTheme.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ import "../../../node_modules/linkifyjs/dist/linkify.js";
10
+ import "../../../functions/parseMarkdown.js";
11
+ import z from "./icons/ChatTemplatesIcon.vue.js";
12
+ const R = { class: "" }, te = /* @__PURE__ */ T({
13
+ __name: "ButtonTemplateSelector",
14
+ props: {
15
+ templates: {
16
+ type: Array,
17
+ required: !1,
18
+ default: () => []
19
+ },
20
+ groupTemplates: {
21
+ type: Array,
22
+ required: !1,
23
+ default: () => []
24
+ },
25
+ mode: {
26
+ type: String,
27
+ required: !1,
28
+ default: "click"
29
+ },
30
+ state: {
31
+ type: String,
32
+ default: "active"
33
+ },
34
+ elevatedWindow: {
35
+ type: Boolean,
36
+ required: !1
37
+ },
38
+ chatBackground: {
39
+ type: String,
40
+ default: void 0
41
+ }
42
+ },
43
+ setup(l) {
44
+ const o = l, r = E("chatAppId"), { getMessage: w } = j(r || ""), k = s(null), e = s(null), i = s("#5F5F5F"), c = s("#404040"), m = s(!1);
45
+ let u = null;
46
+ const p = () => {
47
+ if (!r) {
48
+ i.value = "#5F5F5F", c.value = "#404040";
49
+ return;
50
+ }
51
+ const a = document.getElementById(r);
52
+ if (!a) {
53
+ i.value = "#5F5F5F", c.value = "#404040";
54
+ return;
55
+ }
56
+ const t = window.getComputedStyle(a), n = t.getPropertyValue("--chotto-buttontemplateselector-button-span-color").trim(), S = t.getPropertyValue("--chotto-buttontemplateselector-button-span-hover-color").trim();
57
+ i.value = n || "#5F5F5F", c.value = S || "#404040";
58
+ }, C = I(() => m.value ? c.value : i.value);
59
+ V(() => {
60
+ p();
61
+ });
62
+ const B = () => {
63
+ o.mode == "click" && o.state == "active" && e.value && (e.value.style.display == "none" ? e.value.style.display = "inherit" : e.value.style.display == "inherit" && (e.value.style.display = "none"));
64
+ }, v = () => {
65
+ o.mode == "hover" && o.state == "active" && e.value && (e.value.style.display = "inherit");
66
+ }, f = () => {
67
+ o.mode == "hover" && o.state == "active" && e.value && (e.value.style.display = "none");
68
+ }, M = () => {
69
+ e.value && (e.value.style.display = "none");
70
+ };
71
+ return q(() => {
72
+ if (e.value && (e.value.style.display = "none"), p(), r) {
73
+ const a = document.getElementById(r);
74
+ a && (u = new MutationObserver((t) => {
75
+ t.forEach((n) => {
76
+ n.type === "attributes" && n.attributeName === "data-theme" && p();
77
+ });
78
+ }), u.observe(a, {
79
+ attributes: !0,
80
+ attributeFilter: ["data-theme"]
81
+ }));
82
+ }
83
+ }), x(() => {
84
+ u && (u.disconnect(), u = null);
85
+ }), (a, t) => (g(), y(A, null, [
86
+ d(P, {
87
+ text: "Шаблоны сообщений",
88
+ position: "left"
89
+ }, {
90
+ default: h(() => [
91
+ b(w)().isRecording ? N("", !0) : (g(), y("button", {
92
+ key: 0,
93
+ ref_key: "templateButton",
94
+ ref: k,
95
+ class: W(["button-template", { "button-template-disabled": l.state == "disabled" }]),
96
+ onClick: B,
97
+ onMouseover: v,
98
+ onMouseout: f,
99
+ onMouseenter: t[0] || (t[0] = (n) => m.value = !0),
100
+ onMouseleave: t[1] || (t[1] = (n) => m.value = !1)
101
+ }, [
102
+ F("span", R, [
103
+ d(b(z), { fill: C.value }, null, 8, ["fill"])
104
+ ])
105
+ ], 34))
106
+ ]),
107
+ _: 1
108
+ }),
109
+ d($, null, {
110
+ default: h(() => [
111
+ D(F("div", {
112
+ ref_key: "template",
113
+ ref: e,
114
+ onMouseover: v,
115
+ onMouseout: f
116
+ }, [
117
+ d(O, {
118
+ templates: l.templates,
119
+ "group-templates": l.groupTemplates,
120
+ "elevated-window": l.elevatedWindow,
121
+ "chat-background": l.chatBackground,
122
+ onCloseTemplateWindow: M
123
+ }, null, 8, ["templates", "group-templates", "elevated-window", "chat-background"])
124
+ ], 544), [
125
+ [H, o.state === "active"]
126
+ ])
127
+ ]),
128
+ _: 1
129
+ })
130
+ ], 64));
131
+ }
132
+ });
133
+ export {
134
+ te as default
135
+ };
@@ -1,25 +1,28 @@
1
- import { createElementBlock as e, openBlock as o, createElementVNode as t } from "vue";
2
- import n from "../../../../_virtual/_plugin-vue_export-helper.js";
3
- const l = {}, r = {
1
+ import { defineComponent as l, createElementBlock as t, openBlock as n, createElementVNode as e } from "vue";
2
+ const o = {
4
3
  width: "26",
5
4
  height: "26",
6
5
  viewBox: "0 0 26 26",
7
6
  fill: "none",
8
7
  xmlns: "http://www.w3.org/2000/svg"
9
- };
10
- function s(c, C) {
11
- return o(), e("svg", r, [...C[0] || (C[0] = [
12
- t("path", {
13
- d: "M22.75 1.625C23.181 1.625 23.5943 1.7962 23.899 2.10095C24.2038 2.4057 24.375 2.81902 24.375 3.25V16.25C24.375 16.681 24.2038 17.0943 23.899 17.399C23.5943 17.7038 23.181 17.875 22.75 17.875H18.6875C18.183 17.875 17.6853 17.9925 17.2341 18.2181C16.7828 18.4438 16.3902 18.7714 16.0875 19.175L13 23.2911L9.9125 19.175C9.60977 18.7714 9.21722 18.4438 8.76594 18.2181C8.31466 17.9925 7.81705 17.875 7.3125 17.875H3.25C2.81902 17.875 2.4057 17.7038 2.10095 17.399C1.7962 17.0943 1.625 16.681 1.625 16.25V3.25C1.625 2.81902 1.7962 2.4057 2.10095 2.10095C2.4057 1.7962 2.81902 1.625 3.25 1.625H22.75ZM3.25 0C2.38805 0 1.5614 0.34241 0.951903 0.951903C0.34241 1.5614 0 2.38805 0 3.25L0 16.25C0 17.112 0.34241 17.9386 0.951903 18.5481C1.5614 19.1576 2.38805 19.5 3.25 19.5H7.3125C7.56477 19.5 7.81358 19.5587 8.03922 19.6716C8.26486 19.7844 8.46114 19.9482 8.6125 20.15L11.7 24.2661C11.8514 24.4679 12.0476 24.6318 12.2733 24.7446C12.4989 24.8574 12.7477 24.9161 13 24.9161C13.2523 24.9161 13.5011 24.8574 13.7267 24.7446C13.9524 24.6318 14.1486 24.4679 14.3 24.2661L17.3875 20.15C17.5389 19.9482 17.7351 19.7844 17.9608 19.6716C18.1864 19.5587 18.4352 19.5 18.6875 19.5H22.75C23.612 19.5 24.4386 19.1576 25.0481 18.5481C25.6576 17.9386 26 17.112 26 16.25V3.25C26 2.38805 25.6576 1.5614 25.0481 0.951903C24.4386 0.34241 23.612 0 22.75 0L3.25 0Z",
14
- fill: "#5F5F5F"
15
- }, null, -1),
16
- t("path", {
17
- d: "M4.875 5.6875C4.875 5.47201 4.9606 5.26535 5.11298 5.11298C5.26535 4.9606 5.47201 4.875 5.6875 4.875H20.3125C20.528 4.875 20.7347 4.9606 20.887 5.11298C21.0394 5.26535 21.125 5.47201 21.125 5.6875C21.125 5.90299 21.0394 6.10965 20.887 6.26202C20.7347 6.4144 20.528 6.5 20.3125 6.5H5.6875C5.47201 6.5 5.26535 6.4144 5.11298 6.26202C4.9606 6.10965 4.875 5.90299 4.875 5.6875ZM4.875 9.75C4.875 9.53451 4.9606 9.32785 5.11298 9.17548C5.26535 9.0231 5.47201 8.9375 5.6875 8.9375H20.3125C20.528 8.9375 20.7347 9.0231 20.887 9.17548C21.0394 9.32785 21.125 9.53451 21.125 9.75C21.125 9.96549 21.0394 10.1722 20.887 10.3245C20.7347 10.4769 20.528 10.5625 20.3125 10.5625H5.6875C5.47201 10.5625 5.26535 10.4769 5.11298 10.3245C4.9606 10.1722 4.875 9.96549 4.875 9.75ZM4.875 13.8125C4.875 13.597 4.9606 13.3903 5.11298 13.238C5.26535 13.0856 5.47201 13 5.6875 13H13.8125C14.028 13 14.2347 13.0856 14.387 13.238C14.5394 13.3903 14.625 13.597 14.625 13.8125C14.625 14.028 14.5394 14.2347 14.387 14.387C14.2347 14.5394 14.028 14.625 13.8125 14.625H5.6875C5.47201 14.625 5.26535 14.5394 5.11298 14.387C4.9606 14.2347 4.875 14.028 4.875 13.8125Z",
18
- fill: "#5F5F5F"
19
- }, null, -1)
20
- ])]);
21
- }
22
- const f = /* @__PURE__ */ n(l, [["render", s]]);
8
+ }, i = ["fill"], s = ["fill"], h = /* @__PURE__ */ l({
9
+ __name: "ChatTemplatesIcon",
10
+ props: {
11
+ fill: { default: "#5F5F5F" }
12
+ },
13
+ setup(C) {
14
+ return (c, f) => (n(), t("svg", o, [
15
+ e("path", {
16
+ d: "M22.75 1.625C23.181 1.625 23.5943 1.7962 23.899 2.10095C24.2038 2.4057 24.375 2.81902 24.375 3.25V16.25C24.375 16.681 24.2038 17.0943 23.899 17.399C23.5943 17.7038 23.181 17.875 22.75 17.875H18.6875C18.183 17.875 17.6853 17.9925 17.2341 18.2181C16.7828 18.4438 16.3902 18.7714 16.0875 19.175L13 23.2911L9.9125 19.175C9.60977 18.7714 9.21722 18.4438 8.76594 18.2181C8.31466 17.9925 7.81705 17.875 7.3125 17.875H3.25C2.81902 17.875 2.4057 17.7038 2.10095 17.399C1.7962 17.0943 1.625 16.681 1.625 16.25V3.25C1.625 2.81902 1.7962 2.4057 2.10095 2.10095C2.4057 1.7962 2.81902 1.625 3.25 1.625H22.75ZM3.25 0C2.38805 0 1.5614 0.34241 0.951903 0.951903C0.34241 1.5614 0 2.38805 0 3.25L0 16.25C0 17.112 0.34241 17.9386 0.951903 18.5481C1.5614 19.1576 2.38805 19.5 3.25 19.5H7.3125C7.56477 19.5 7.81358 19.5587 8.03922 19.6716C8.26486 19.7844 8.46114 19.9482 8.6125 20.15L11.7 24.2661C11.8514 24.4679 12.0476 24.6318 12.2733 24.7446C12.4989 24.8574 12.7477 24.9161 13 24.9161C13.2523 24.9161 13.5011 24.8574 13.7267 24.7446C13.9524 24.6318 14.1486 24.4679 14.3 24.2661L17.3875 20.15C17.5389 19.9482 17.7351 19.7844 17.9608 19.6716C18.1864 19.5587 18.4352 19.5 18.6875 19.5H22.75C23.612 19.5 24.4386 19.1576 25.0481 18.5481C25.6576 17.9386 26 17.112 26 16.25V3.25C26 2.38805 25.6576 1.5614 25.0481 0.951903C24.4386 0.34241 23.612 0 22.75 0L3.25 0Z",
17
+ fill: C.fill
18
+ }, null, 8, i),
19
+ e("path", {
20
+ d: "M4.875 5.6875C4.875 5.47201 4.9606 5.26535 5.11298 5.11298C5.26535 4.9606 5.47201 4.875 5.6875 4.875H20.3125C20.528 4.875 20.7347 4.9606 20.887 5.11298C21.0394 5.26535 21.125 5.47201 21.125 5.6875C21.125 5.90299 21.0394 6.10965 20.887 6.26202C20.7347 6.4144 20.528 6.5 20.3125 6.5H5.6875C5.47201 6.5 5.26535 6.4144 5.11298 6.26202C4.9606 6.10965 4.875 5.90299 4.875 5.6875ZM4.875 9.75C4.875 9.53451 4.9606 9.32785 5.11298 9.17548C5.26535 9.0231 5.47201 8.9375 5.6875 8.9375H20.3125C20.528 8.9375 20.7347 9.0231 20.887 9.17548C21.0394 9.32785 21.125 9.53451 21.125 9.75C21.125 9.96549 21.0394 10.1722 20.887 10.3245C20.7347 10.4769 20.528 10.5625 20.3125 10.5625H5.6875C5.47201 10.5625 5.26535 10.4769 5.11298 10.3245C4.9606 10.1722 4.875 9.96549 4.875 9.75ZM4.875 13.8125C4.875 13.597 4.9606 13.3903 5.11298 13.238C5.26535 13.0856 5.47201 13 5.6875 13H13.8125C14.028 13 14.2347 13.0856 14.387 13.238C14.5394 13.3903 14.625 13.597 14.625 13.8125C14.625 14.028 14.5394 14.2347 14.387 14.387C14.2347 14.5394 14.028 14.625 13.8125 14.625H5.6875C5.47201 14.625 5.26535 14.5394 5.11298 14.387C4.9606 14.2347 4.875 14.028 4.875 13.8125Z",
21
+ fill: C.fill
22
+ }, null, 8, s)
23
+ ]));
24
+ }
25
+ });
23
26
  export {
24
- f as default
27
+ h as default
25
28
  };
@@ -0,0 +1,4 @@
1
+ import f from "./ChatTemplatesIcon.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./FileUploader.vue2.js";
2
2
  /* empty css */
3
3
  import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-2ac2a0b2"]]);
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-85a6ae46"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };