tuikit-atomicx-vue3 4.5.0 → 4.5.1
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/{PopoverTrigger-L8abAry7.js → PopoverPortal-DghpKKm8.js} +91 -136
- package/dist/PopoverTrigger-BajjNkGO.js +54 -0
- package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-SLoFuK7k.js} +6 -6
- package/dist/{Teleport-CSEuZbpM.js → Teleport-DFrneqLM.js} +4 -4
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +10 -9
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +16 -15
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +29 -27
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +27 -23
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +67 -65
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +32 -30
- package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
- package/dist/components/ConversationList/i18n/en-US.d.ts +10 -1
- package/dist/components/ConversationList/i18n/en-US.js +11 -2
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +10 -1
- package/dist/components/ConversationList/i18n/zh-CN.js +11 -2
- package/dist/components/LiveScenePanel/index.js +10 -9
- package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +13 -12
- package/dist/components/MessageInput/TextEditor/EditorCore.js +54 -89
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +229 -0
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue.d.ts +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.d.ts +1 -0
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +22 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.d.ts +3 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/extensions/index.d.ts +8 -0
- package/dist/components/MessageInput/TextEditor/extensions/index.js +12 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.d.ts +5 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +330 -0
- package/dist/components/MessageInput/TextEditor/index.js +62 -62
- package/dist/components/MessageInput/i18n/en-US.d.ts +3 -0
- package/dist/components/MessageInput/i18n/en-US.js +4 -1
- package/dist/components/MessageInput/i18n/index.d.ts +6 -0
- package/dist/components/MessageInput/i18n/zh-CN.d.ts +3 -0
- package/dist/components/MessageInput/i18n/zh-CN.js +4 -1
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +119 -89
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.js +142 -0
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.vue.d.ts +20 -0
- package/dist/components/MessageList/Message/Message.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +69 -58
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/index.js +8 -4
- package/dist/components/MessageList/MessageList.js +98 -90
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/index.d.ts +21 -3
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +6 -6
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.vue.d.ts +1 -1
- package/dist/index-BvFYOUyz.js +2936 -0
- package/dist/{index-Do-2CngU.js → index-C8Jw_xE4.js} +1621 -1731
- package/dist/{index-7vNB_Vx8.js → index-CiYL_XsE.js} +1 -1
- package/dist/index-CzCDLp99.js +2174 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +103 -103
- package/dist/states/MessageActionState/MessageActionState.js +83 -223
- package/dist/states/MessageInputState/MessageInputState.js +115 -83
- package/dist/states/MessageInputState/type.d.ts +36 -10
- package/dist/states/MessageInputState/utils.d.ts +1 -5
- package/dist/states/MessageListState/MessageListState.d.ts +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2112 -2087
- package/dist/subEntry/chat/chat.js +89 -0
- package/dist/subEntry/chat/index.d.ts +11 -0
- package/dist/subEntry/chat/index.js +81 -0
- package/dist/{chat → subEntry/chat}/server.js +4 -4
- package/dist/{useId-CtirfF0W.js → useId-D5WE76CM.js} +1 -1
- package/dist/{utils-DaB7eSu5.js → utils-CttDpxqz.js} +1 -1
- package/package.json +8 -6
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +8 -0
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
- package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
- package/src/components/ConversationList/i18n/en-US.ts +10 -1
- package/src/components/ConversationList/i18n/zh-CN.ts +10 -1
- package/src/components/LiveScenePanel/index.vue +1 -0
- package/src/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.vue +19 -22
- package/src/components/MessageInput/TextEditor/Editor.scss +25 -0
- package/src/components/MessageInput/TextEditor/EditorCore.ts +79 -99
- package/src/components/MessageInput/TextEditor/TextEditor.vue +64 -68
- package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -0
- package/src/components/MessageInput/TextEditor/extensions/emojiExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/enterKeyExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/index.ts +8 -0
- package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
- package/src/components/MessageInput/i18n/en-US.ts +3 -0
- package/src/components/MessageInput/i18n/zh-CN.ts +3 -0
- package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +49 -0
- package/src/components/MessageList/Message/ImageMessage/ImagePreview.vue +344 -0
- package/src/components/MessageList/Message/Message.vue +6 -0
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +8 -1
- package/src/components/MessageList/MessageList.vue +36 -14
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
- package/src/index.ts +1 -1
- package/src/{chat/index.ts → subEntry/chat/chat.ts} +25 -18
- package/src/subEntry/chat/index.ts +13 -0
- package/src/{chat → subEntry/chat}/server.ts +3 -3
- package/dist/chat/index.js +0 -59
- package/dist/index-ZILx4LYk.js +0 -4826
- package/dist/states/SearchState.d.ts +0 -314
- /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
|
@@ -1,131 +1,161 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as O, computed as f, ref as d, watch as B, onMounted as $, onUnmounted as D, createElementBlock as p, openBlock as w, Fragment as F, createElementVNode as g, createVNode as V, mergeProps as G, unref as C, createCommentVNode as H, normalizeClass as U, nextTick as X } from "vue";
|
|
2
2
|
import { c as E } from "../../../../index-DPczIrgX.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import j from "./ImagePreview.js";
|
|
4
|
+
import { _ as q } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const J = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "image-placeholder"
|
|
7
|
-
},
|
|
8
|
+
}, K = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "image-error"
|
|
10
|
-
},
|
|
11
|
+
}, Q = ["alt"], v = 320, L = 50, _ = 4 / 3, Y = /* @__PURE__ */ O({
|
|
12
|
+
inheritAttrs: !1,
|
|
11
13
|
__name: "ImageMessage",
|
|
12
14
|
props: {
|
|
13
15
|
message: {},
|
|
14
16
|
isLastMessage: { type: Boolean, default: !1 }
|
|
15
17
|
},
|
|
16
18
|
setup(W) {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
+
const x = W, e = f(() => x.message.getMessageContent()), y = (t) => {
|
|
20
|
+
if (t.startsWith("blob:"))
|
|
19
21
|
return "loading";
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
},
|
|
22
|
+
const a = new Image();
|
|
23
|
+
return a.src = t, a.complete && a.naturalWidth > 0 ? "loaded" : "loading";
|
|
24
|
+
}, l = d(y(e.value.url)), o = d(
|
|
23
25
|
e.value.width && e.value.height ? {
|
|
24
26
|
width: e.value.width,
|
|
25
27
|
height: e.value.height,
|
|
26
28
|
aspectRatio: e.value.width / e.value.height
|
|
27
29
|
} : null
|
|
28
|
-
),
|
|
29
|
-
let
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
), r = d(null), M = d(null);
|
|
31
|
+
let s = null;
|
|
32
|
+
const c = d(!1);
|
|
33
|
+
let h = null;
|
|
34
|
+
const I = f(() => e.value.url.startsWith("blob")), P = (t) => new Promise((a, u) => {
|
|
35
|
+
const i = new Image();
|
|
36
|
+
i.onload = () => {
|
|
37
|
+
a({ width: i.naturalWidth, height: i.naturalHeight });
|
|
38
|
+
}, i.onerror = u, i.src = t;
|
|
39
|
+
}), m = f(() => {
|
|
36
40
|
if (!o.value)
|
|
37
41
|
return {
|
|
38
|
-
height:
|
|
42
|
+
height: v,
|
|
39
43
|
// Use max height to avoid size changes after loading
|
|
40
|
-
width:
|
|
41
|
-
aspectRatio:
|
|
44
|
+
width: v * _,
|
|
45
|
+
aspectRatio: _
|
|
42
46
|
};
|
|
43
|
-
const { width:
|
|
44
|
-
let
|
|
45
|
-
return
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
47
|
+
const { width: t, height: a, aspectRatio: u } = o.value;
|
|
48
|
+
let i = t, n = a;
|
|
49
|
+
return n > v && (n = v, i = n * u), n < L && (n = L, i = n * u), {
|
|
50
|
+
width: i,
|
|
51
|
+
height: n,
|
|
48
52
|
aspectRatio: u
|
|
49
53
|
};
|
|
50
|
-
}),
|
|
51
|
-
if (await
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
+
}), b = async () => {
|
|
55
|
+
if (await X(), !!r.value) {
|
|
56
|
+
if (l.value === "loaded") {
|
|
57
|
+
r.value.src = e.value.url;
|
|
54
58
|
return;
|
|
55
59
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, { threshold: 0.1 }),
|
|
60
|
+
s = new IntersectionObserver((t) => {
|
|
61
|
+
t[0].isIntersecting && (r.value && (r.value.src = e.value.url), s && s.disconnect());
|
|
62
|
+
}, { threshold: 0.1 }), s.observe(r.value);
|
|
59
63
|
}
|
|
60
64
|
}, R = async () => {
|
|
61
|
-
if (
|
|
65
|
+
if (I.value && !o.value)
|
|
62
66
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
width:
|
|
66
|
-
height:
|
|
67
|
-
aspectRatio:
|
|
67
|
+
const t = await P(e.value.url);
|
|
68
|
+
t && (o.value = {
|
|
69
|
+
width: t.width,
|
|
70
|
+
height: t.height,
|
|
71
|
+
aspectRatio: t.width / t.height
|
|
68
72
|
});
|
|
69
73
|
} catch {
|
|
70
74
|
o.value = {
|
|
71
75
|
width: 400,
|
|
72
76
|
height: 300,
|
|
73
|
-
aspectRatio:
|
|
77
|
+
aspectRatio: _
|
|
74
78
|
};
|
|
75
79
|
}
|
|
76
|
-
},
|
|
77
|
-
const
|
|
78
|
-
(!o.value ||
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
81
|
-
aspectRatio:
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
|
|
80
|
+
}, S = (t) => {
|
|
81
|
+
const a = t.target;
|
|
82
|
+
(!o.value || I.value) && (o.value = {
|
|
83
|
+
width: a.naturalWidth,
|
|
84
|
+
height: a.naturalHeight,
|
|
85
|
+
aspectRatio: a.naturalWidth / a.naturalHeight
|
|
86
|
+
}), l.value = "loaded";
|
|
87
|
+
}, z = () => {
|
|
88
|
+
l.value = "error";
|
|
85
89
|
};
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
function N() {
|
|
91
|
+
l.value === "loaded" && e.value.url && (c.value = !0);
|
|
92
|
+
}
|
|
93
|
+
function T() {
|
|
94
|
+
c.value = !1;
|
|
95
|
+
}
|
|
96
|
+
function A() {
|
|
97
|
+
typeof document > "u" || (h = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
98
|
+
}
|
|
99
|
+
function k() {
|
|
100
|
+
typeof document > "u" || h !== null && (document.body.style.overflow = h, h = null);
|
|
101
|
+
}
|
|
102
|
+
return B(() => e.value.url, () => {
|
|
103
|
+
l.value = y(e.value.url), o.value = e.value.width && e.value.height ? {
|
|
88
104
|
width: e.value.width,
|
|
89
105
|
height: e.value.height,
|
|
90
106
|
aspectRatio: e.value.width / e.value.height
|
|
91
|
-
} : null,
|
|
92
|
-
}),
|
|
93
|
-
|
|
94
|
-
}),
|
|
95
|
-
|
|
96
|
-
}), (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
} : null, b(), R();
|
|
108
|
+
}), B(c, (t) => {
|
|
109
|
+
t ? A() : k();
|
|
110
|
+
}), $(() => {
|
|
111
|
+
b(), R();
|
|
112
|
+
}), D(() => {
|
|
113
|
+
s && s.disconnect(), k();
|
|
114
|
+
}), (t, a) => (w(), p(F, null, [
|
|
115
|
+
g("div", G({
|
|
116
|
+
ref_key: "containerRef",
|
|
117
|
+
ref: M
|
|
118
|
+
}, t.$attrs, {
|
|
119
|
+
class: C(E)("image-message", {
|
|
120
|
+
"image-message--loading": l.value === "loading",
|
|
121
|
+
"image-message--error": l.value === "error",
|
|
122
|
+
"image-message--loaded": l.value === "loaded"
|
|
123
|
+
}),
|
|
124
|
+
style: {
|
|
125
|
+
width: `${m.value.width}px`,
|
|
126
|
+
height: `${m.value.height}px`,
|
|
127
|
+
aspectRatio: `${m.value.aspectRatio}`
|
|
128
|
+
},
|
|
129
|
+
role: "button",
|
|
130
|
+
tabindex: "0",
|
|
131
|
+
onClick: N
|
|
132
|
+
}), [
|
|
133
|
+
l.value === "loading" ? (w(), p("div", J)) : H("", !0),
|
|
134
|
+
l.value === "error" ? (w(), p("div", K, [...a[0] || (a[0] = [
|
|
135
|
+
g("div", { class: "image-error__icon" }, null, -1),
|
|
136
|
+
g("span", { class: "image-error__text" }, "Load failed", -1)
|
|
137
|
+
])])) : H("", !0),
|
|
138
|
+
g("img", {
|
|
139
|
+
ref_key: "imageRef",
|
|
140
|
+
ref: r,
|
|
141
|
+
class: U(C(E)("image", {
|
|
142
|
+
"image--visible": l.value === "loaded"
|
|
143
|
+
})),
|
|
144
|
+
alt: e.value.showName || "image message",
|
|
145
|
+
loading: "lazy",
|
|
146
|
+
onLoad: S,
|
|
147
|
+
onError: z
|
|
148
|
+
}, null, 42, Q)
|
|
149
|
+
], 16),
|
|
150
|
+
V(j, {
|
|
151
|
+
open: c.value,
|
|
152
|
+
src: e.value.url,
|
|
153
|
+
alt: e.value.showName || "image message preview",
|
|
154
|
+
onClose: T
|
|
155
|
+
}, null, 8, ["open", "src", "alt"])
|
|
156
|
+
], 64));
|
|
127
157
|
}
|
|
128
|
-
}),
|
|
158
|
+
}), le = /* @__PURE__ */ q(Y, [["__scopeId", "data-v-9921e516"]]);
|
|
129
159
|
export {
|
|
130
|
-
|
|
160
|
+
le as default
|
|
131
161
|
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defineComponent as B, ref as l, watch as L, onMounted as $, onUnmounted as N, createBlock as z, openBlock as v, Teleport as U, createElementBlock as m, createCommentVNode as V, mergeProps as W, createElementVNode as a, normalizeClass as K, unref as j, withModifiers as f, normalizeStyle as q } from "vue";
|
|
2
|
+
import { c as F } from "../../../../index-DPczIrgX.js";
|
|
3
|
+
import { _ as G } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const H = { class: "image-preview__content" }, J = { class: "image-preview__inner" }, O = { class: "image-preview__viewport" }, Q = ["src", "alt"], R = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "image-preview__error"
|
|
7
|
+
}, Z = 0.5, ee = 3, te = /* @__PURE__ */ B({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "ImagePreview",
|
|
10
|
+
props: {
|
|
11
|
+
open: { type: Boolean },
|
|
12
|
+
src: {},
|
|
13
|
+
alt: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["close"],
|
|
16
|
+
setup(r, { emit: k }) {
|
|
17
|
+
const C = r, E = k, n = l(1), i = l({ x: 0, y: 0 }), d = l(!1), c = l({ x: 0, y: 0 }), s = l(!1);
|
|
18
|
+
let u = null, h = 1;
|
|
19
|
+
function _(e) {
|
|
20
|
+
return Math.min(ee, Math.max(Z, e));
|
|
21
|
+
}
|
|
22
|
+
function g() {
|
|
23
|
+
n.value = 1, i.value = { x: 0, y: 0 };
|
|
24
|
+
}
|
|
25
|
+
function p() {
|
|
26
|
+
E("close"), g();
|
|
27
|
+
}
|
|
28
|
+
function T() {
|
|
29
|
+
s.value = !0;
|
|
30
|
+
}
|
|
31
|
+
function D(e) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
const t = e.deltaY > 0 ? -0.2 : 0.2, o = _(n.value + t);
|
|
34
|
+
n.value = o;
|
|
35
|
+
}
|
|
36
|
+
function M() {
|
|
37
|
+
n.value = n.value === 1 ? 2 : 1, n.value === 1 && (i.value = { x: 0, y: 0 });
|
|
38
|
+
}
|
|
39
|
+
function b(e) {
|
|
40
|
+
var t;
|
|
41
|
+
d.value = !0, c.value = { x: e.clientX, y: e.clientY }, (t = e.target) == null || t.setPointerCapture(e.pointerId);
|
|
42
|
+
}
|
|
43
|
+
function S(e) {
|
|
44
|
+
if (!d.value)
|
|
45
|
+
return;
|
|
46
|
+
const t = e.clientX - c.value.x, o = e.clientY - c.value.y;
|
|
47
|
+
i.value = {
|
|
48
|
+
x: i.value.x + t,
|
|
49
|
+
y: i.value.y + o
|
|
50
|
+
}, c.value = { x: e.clientX, y: e.clientY };
|
|
51
|
+
}
|
|
52
|
+
function w(e) {
|
|
53
|
+
var t;
|
|
54
|
+
d.value = !1, (t = e.target) == null || t.releasePointerCapture(e.pointerId);
|
|
55
|
+
}
|
|
56
|
+
function y(e) {
|
|
57
|
+
if (e.length < 2)
|
|
58
|
+
return null;
|
|
59
|
+
const [t, o] = [e[0], e[1]], Y = t.clientX - o.clientX, A = t.clientY - o.clientY;
|
|
60
|
+
return Math.hypot(Y, A);
|
|
61
|
+
}
|
|
62
|
+
function I(e) {
|
|
63
|
+
e.touches.length === 2 && (u = y(e.touches), h = n.value);
|
|
64
|
+
}
|
|
65
|
+
function X(e) {
|
|
66
|
+
if (e.touches.length === 2 && u) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
const t = y(e.touches);
|
|
69
|
+
if (!t)
|
|
70
|
+
return;
|
|
71
|
+
const o = t / u;
|
|
72
|
+
n.value = _(h * o);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function x() {
|
|
76
|
+
u = null;
|
|
77
|
+
}
|
|
78
|
+
function P(e) {
|
|
79
|
+
e.key === "Escape" && p();
|
|
80
|
+
}
|
|
81
|
+
return L(() => C.open, (e) => {
|
|
82
|
+
e || (g(), s.value = !1);
|
|
83
|
+
}), $(() => {
|
|
84
|
+
window.addEventListener("keydown", P);
|
|
85
|
+
}), N(() => {
|
|
86
|
+
window.removeEventListener("keydown", P);
|
|
87
|
+
}), (e, t) => (v(), z(U, { to: "body" }, [
|
|
88
|
+
r.open ? (v(), m("div", W({
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "image-preview"
|
|
91
|
+
}, e.$attrs), [
|
|
92
|
+
a("div", {
|
|
93
|
+
class: "image-preview__mask",
|
|
94
|
+
onClick: p
|
|
95
|
+
}),
|
|
96
|
+
a("button", {
|
|
97
|
+
class: "image-preview__close",
|
|
98
|
+
type: "button",
|
|
99
|
+
"aria-label": "Close preview",
|
|
100
|
+
onClick: p
|
|
101
|
+
}),
|
|
102
|
+
a("div", H, [
|
|
103
|
+
a("div", J, [
|
|
104
|
+
a("div", O, [
|
|
105
|
+
a("div", {
|
|
106
|
+
class: K(j(F)("image-preview__img-wrap", { "image-preview__img-wrap--error": s.value }))
|
|
107
|
+
}, [
|
|
108
|
+
s.value ? (v(), m("div", R, [...t[0] || (t[0] = [
|
|
109
|
+
a("div", { class: "image-preview__error-icon" }, null, -1),
|
|
110
|
+
a("span", { class: "image-preview__error-text" }, "Preview failed", -1)
|
|
111
|
+
])])) : (v(), m("img", {
|
|
112
|
+
key: 0,
|
|
113
|
+
src: r.src,
|
|
114
|
+
alt: r.alt || "image preview",
|
|
115
|
+
style: q({
|
|
116
|
+
transform: `translate3d(${i.value.x}px, ${i.value.y}px, 0) scale(${n.value})`
|
|
117
|
+
}),
|
|
118
|
+
class: "image-preview__img",
|
|
119
|
+
draggable: "false",
|
|
120
|
+
onError: T,
|
|
121
|
+
onWheel: f(D, ["prevent"]),
|
|
122
|
+
onDblclick: f(M, ["prevent"]),
|
|
123
|
+
onPointerdown: b,
|
|
124
|
+
onPointermove: S,
|
|
125
|
+
onPointerup: w,
|
|
126
|
+
onPointercancel: w,
|
|
127
|
+
onTouchstartPassive: I,
|
|
128
|
+
onTouchmove: f(X, ["prevent"]),
|
|
129
|
+
onTouchend: x,
|
|
130
|
+
onTouchcancel: x
|
|
131
|
+
}, null, 44, Q))
|
|
132
|
+
], 2)
|
|
133
|
+
])
|
|
134
|
+
])
|
|
135
|
+
])
|
|
136
|
+
], 16)) : V("", !0)
|
|
137
|
+
]));
|
|
138
|
+
}
|
|
139
|
+
}), ie = /* @__PURE__ */ G(te, [["__scopeId", "data-v-31cf7b43"]]);
|
|
140
|
+
export {
|
|
141
|
+
ie as default
|
|
142
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface ImagePreviewProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ImagePreviewProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
close: () => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ImagePreviewProps>>> & Readonly<{
|
|
9
|
+
onClose?: (() => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -3,37 +3,45 @@ import { MessageModel } from '../../../types/engine';
|
|
|
3
3
|
|
|
4
4
|
interface MessageProps {
|
|
5
5
|
message: MessageModel;
|
|
6
|
+
nick?: string;
|
|
6
7
|
alignment?: 'left' | 'right' | 'two-sided';
|
|
7
8
|
messageActionList?: MessageAction[] | undefined;
|
|
8
9
|
isAggregated?: boolean;
|
|
9
10
|
isFirstInChunk?: boolean;
|
|
10
11
|
isLastInChunk?: boolean;
|
|
11
12
|
isHiddenMessageAvatar?: boolean;
|
|
13
|
+
isHiddenMessageNick?: boolean;
|
|
12
14
|
isHiddenMessageMeta?: boolean;
|
|
13
15
|
}
|
|
14
16
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MessageProps>, {
|
|
15
17
|
alignment: string;
|
|
18
|
+
nick: undefined;
|
|
16
19
|
messageActionList: undefined;
|
|
17
20
|
isAggregated: boolean;
|
|
18
21
|
isFirstInChunk: undefined;
|
|
19
22
|
isLastInChunk: undefined;
|
|
20
23
|
isHiddenMessageAvatar: boolean;
|
|
24
|
+
isHiddenMessageNick: boolean;
|
|
21
25
|
isHiddenMessageMeta: boolean;
|
|
22
26
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MessageProps>, {
|
|
23
27
|
alignment: string;
|
|
28
|
+
nick: undefined;
|
|
24
29
|
messageActionList: undefined;
|
|
25
30
|
isAggregated: boolean;
|
|
26
31
|
isFirstInChunk: undefined;
|
|
27
32
|
isLastInChunk: undefined;
|
|
28
33
|
isHiddenMessageAvatar: boolean;
|
|
34
|
+
isHiddenMessageNick: boolean;
|
|
29
35
|
isHiddenMessageMeta: boolean;
|
|
30
36
|
}>>> & Readonly<{}>, {
|
|
37
|
+
nick: string;
|
|
31
38
|
isLastInChunk: boolean;
|
|
32
39
|
messageActionList: MessageAction[];
|
|
33
40
|
alignment: "left" | "right" | "two-sided";
|
|
34
41
|
isAggregated: boolean;
|
|
35
42
|
isHiddenMessageAvatar: boolean;
|
|
36
43
|
isHiddenMessageMeta: boolean;
|
|
44
|
+
isHiddenMessageNick: boolean;
|
|
37
45
|
isFirstInChunk: boolean;
|
|
38
46
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
39
47
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as q, computed as D, provide as Se, inject as Pe, defineComponent as w, watch as te, h as ie, watchEffect as Be, markRaw as Oe, toRefs as $, createBlock as C, openBlock as h, unref as n, withCtx as g, createVNode as E, renderSlot as M, normalizeProps as x, guardReactiveProps as j, onMounted as ge, mergeDefaults as Ie, onUnmounted as Fe, mergeProps as A, nextTick as k, withModifiers as Ee, createElementBlock as N, Fragment as U, normalizeClass as Q, renderList as ke, normalizeStyle as Ae, createCommentVNode as ue, resolveDynamicComponent as de, createElementVNode as Te, toDisplayString as fe } from "vue";
|
|
2
2
|
import { useUIKit as Re } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
3
|
import { c as Z } from "../../../../../index-DPczIrgX.js";
|
|
4
|
-
import { i as De, l as xe, g as z, j as Ne, S as pe,
|
|
5
|
-
import {
|
|
6
|
-
import { g as Qe, i as Ze, a as ee, F as et, f as tt, L as ot, S as nt, I as rt } from "../../../../../utils-
|
|
4
|
+
import { i as De, l as xe, g as z, j as Ne, S as pe, a as _e, c as K, P as oe, m as $e, n as ce, b as Ke, u as T, F as Le, D as Ve, d as Ue, e as ze, T as je, f as Ge } from "../../../../../Teleport-DFrneqLM.js";
|
|
5
|
+
import { P as We, a as Xe, b as Ye, c as He, e as Je, d as G } from "../../../../../PopperContent-SLoFuK7k.js";
|
|
6
|
+
import { g as Qe, i as Ze, a as ee, F as et, f as tt, L as ot, S as nt, I as rt } from "../../../../../utils-CttDpxqz.js";
|
|
7
7
|
import { useMessageActions as at } from "../../../../../hooks/useMessageActions.js";
|
|
8
8
|
import { _ as st } from "../../../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const lt = ["INPUT", "TEXTAREA"];
|