@dotss/tictoccroc 0.8.1 → 0.9.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/index.mjs +23 -21
- package/dist/shared/components/ChatKit/ImageMessage/ImageMessage.d.ts +30 -0
- package/dist/shared/components/ChatKit/ImageMessage/ImageMessage.mjs +145 -0
- package/dist/shared/components/ChatKit/ImageMessage/ImageMessage.utils.d.ts +12 -0
- package/dist/shared/components/ChatKit/ImageMessage/ImageMessage.utils.mjs +21 -0
- package/dist/shared/components/ChatKit/ImageMessage/ImageMessage.utils.test.d.ts +1 -0
- package/dist/shared/components/ChatKit/ImageMessage/index.d.ts +4 -0
- package/dist/shared/components/ChatKit/ImageMessage/index.mjs +6 -0
- package/dist/shared/components/ChatKit/InputBar/InputBar.d.ts +3 -2
- package/dist/shared/components/ChatKit/InputBar/InputBar.mjs +30 -30
- package/dist/shared/components/ChatKit/Message/Message.mjs +60 -102
- package/dist/shared/components/ChatKit/Message/Message.utils.mjs +15 -3
- package/dist/shared/components/ChatKit/Message/Message.utils.test.d.ts +1 -0
- package/dist/shared/components/ChatKit/MessageFailedActions/MessageFailedActions.d.ts +10 -0
- package/dist/shared/components/ChatKit/MessageFailedActions/MessageFailedActions.mjs +65 -0
- package/dist/shared/components/ChatKit/MessageFailedActions/index.d.ts +3 -0
- package/dist/shared/components/ChatKit/MessageFailedActions/index.mjs +5 -0
- package/dist/shared/components/ChatKit/index.d.ts +2 -0
- package/dist/shared/components/ChatKit/index.mjs +12 -10
- package/dist/shared/components/Image/Image.mjs +113 -111
- package/dist/shared/components/Image/Image.utils.d.ts +7 -0
- package/dist/shared/components/Image/Image.utils.mjs +21 -0
- package/dist/shared/components/Image/Image.utils.test.d.ts +1 -0
- package/dist/shared/components/index.d.ts +1 -1
- package/dist/shared/components/index.mjs +12 -10
- package/package.json +2 -2
|
@@ -1,63 +1,55 @@
|
|
|
1
1
|
import e from "../../../hooks/useInView/index.mjs";
|
|
2
2
|
import t from "../../Image/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import n from "../MessageFailedActions/index.mjs";
|
|
4
|
+
import { useEffect as r, useImperativeHandle as i, useRef as a } from "react";
|
|
5
|
+
import { Button as o, CircularProgressIndicator as s, Flexbox as c, Icon as l, Typography as u } from "@dotss/ui";
|
|
6
|
+
import d from "@dotss/ui/core/useTheme";
|
|
7
|
+
import f from "dayjs";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
import { useCheckHoverPossible as h } from "@dotss/ui/hooks";
|
|
10
10
|
//#region shared/components/ChatKit/Message/Message.tsx
|
|
11
|
-
function
|
|
12
|
-
let { palette: { brand:
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
e === "resend" ? (k?.(), K.current = setTimeout(() => {
|
|
16
|
-
j?.();
|
|
17
|
-
}, 200)) : e === "delete" && (k?.(), K.current = setTimeout(() => {
|
|
18
|
-
M?.();
|
|
19
|
-
}, 200));
|
|
20
|
-
}, Z = (e) => {
|
|
11
|
+
function g({ id: g, content: _ = "", mine: v = !1, avatarUrl: y = "", unreadUserCount: b = 0, regDatetime: x, status: S, onView: C, openMenu: w, onClickAvatar: T, onCloseMenu: E, onClickMenu: D, onResend: O, onDelete: k, onViewAll: A, showAvatar: j, showTime: M, ref: N, inlineCSS: P, ...F }) {
|
|
12
|
+
let { palette: { brand: I, grey: L } } = d(), { isHoverPossible: R } = h(), z = a(null);
|
|
13
|
+
i(N, () => z.current);
|
|
14
|
+
let B = e(z), V = S === "FAILED", H = _.length > 300, U = (e) => {
|
|
21
15
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
22
16
|
};
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
}, []), /* @__PURE__ */ g(s, {
|
|
30
|
-
ref: W,
|
|
17
|
+
return r(() => {
|
|
18
|
+
B && C?.();
|
|
19
|
+
}, [B, C]), r(() => {
|
|
20
|
+
V && z?.current?.scrollIntoView();
|
|
21
|
+
}, [V]), /* @__PURE__ */ m(c, {
|
|
22
|
+
ref: z,
|
|
31
23
|
alignItems: "flex-end",
|
|
32
|
-
flexDirection:
|
|
24
|
+
flexDirection: v ? "row-reverse" : "row",
|
|
33
25
|
pl: 4,
|
|
34
26
|
pr: 4,
|
|
35
27
|
gap: 1,
|
|
36
|
-
"aria-busy":
|
|
37
|
-
...
|
|
28
|
+
"aria-busy": S === "PENDING",
|
|
29
|
+
...F,
|
|
38
30
|
inlineCSS: {
|
|
39
|
-
cursor:
|
|
31
|
+
cursor: S === "PENDING" ? "wait" : "default",
|
|
40
32
|
overflowAnchor: "none",
|
|
41
|
-
...
|
|
33
|
+
...P
|
|
42
34
|
},
|
|
43
35
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ m(c, {
|
|
45
37
|
alignItems: "flex-start",
|
|
46
38
|
gap: 2.5,
|
|
47
|
-
children: [!
|
|
48
|
-
role: typeof
|
|
49
|
-
tabIndex: typeof
|
|
50
|
-
onClick:
|
|
51
|
-
onKeyDown:
|
|
52
|
-
"aria-label": typeof
|
|
39
|
+
children: [!v && j && y && /* @__PURE__ */ p(c, {
|
|
40
|
+
role: typeof T == "function" ? "button" : void 0,
|
|
41
|
+
tabIndex: typeof T == "function" ? 0 : -1,
|
|
42
|
+
onClick: T,
|
|
43
|
+
onKeyDown: U,
|
|
44
|
+
"aria-label": typeof T == "function" ? "선생님 프로필 보기" : void 0,
|
|
53
45
|
inlineCSS: {
|
|
54
46
|
position: "relative",
|
|
55
47
|
overflow: "hidden",
|
|
56
48
|
minWidth: 32,
|
|
57
|
-
cursor: typeof
|
|
49
|
+
cursor: typeof T == "function" ? "pointer" : void 0
|
|
58
50
|
},
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
src:
|
|
51
|
+
children: /* @__PURE__ */ p(t, {
|
|
52
|
+
src: y,
|
|
61
53
|
width: 32,
|
|
62
54
|
height: 32,
|
|
63
55
|
borderRadius: "50%",
|
|
@@ -66,19 +58,19 @@ function y({ id: y, content: b = "", mine: x = !1, avatarUrl: S = "", unreadUser
|
|
|
66
58
|
enableFallback: !0,
|
|
67
59
|
style: { objectFit: "cover" }
|
|
68
60
|
})
|
|
69
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ m(c, {
|
|
70
62
|
pt: 2,
|
|
71
63
|
pb: 2,
|
|
72
64
|
pl: 3,
|
|
73
65
|
pr: 3,
|
|
74
|
-
ml: !
|
|
66
|
+
ml: !v && !j && y ? 10.5 : void 0,
|
|
75
67
|
flexDirection: "column",
|
|
76
68
|
gap: 2.5,
|
|
77
69
|
inlineCSS: {
|
|
78
70
|
borderRadius: 12,
|
|
79
|
-
backgroundColor:
|
|
71
|
+
backgroundColor: v ? I.primary.pageControl : L[10]
|
|
80
72
|
},
|
|
81
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ p(u, {
|
|
82
74
|
tag: "p",
|
|
83
75
|
variant: "b3R",
|
|
84
76
|
inlineCSS: {
|
|
@@ -87,76 +79,42 @@ function y({ id: y, content: b = "", mine: x = !1, avatarUrl: S = "", unreadUser
|
|
|
87
79
|
userSelect: "text",
|
|
88
80
|
"& *": { userSelect: "text" }
|
|
89
81
|
},
|
|
90
|
-
children:
|
|
91
|
-
}),
|
|
82
|
+
children: H ? _.slice(0, 300) + "..." : _
|
|
83
|
+
}), H && /* @__PURE__ */ p(o, {
|
|
92
84
|
variant: "text",
|
|
93
85
|
size: "xSmall",
|
|
94
|
-
endAdornment: /* @__PURE__ */
|
|
95
|
-
onClick:
|
|
86
|
+
endAdornment: /* @__PURE__ */ p(l, { name: "ChevronRightLine" }),
|
|
87
|
+
onClick: A,
|
|
96
88
|
inlineCSS: {
|
|
97
89
|
marginLeft: "auto",
|
|
98
|
-
"&:active:not([aria-disabled=\"true\"])": { backgroundColor:
|
|
99
|
-
...
|
|
90
|
+
"&:active:not([aria-disabled=\"true\"])": { backgroundColor: I.primary.main },
|
|
91
|
+
...R && { "&:hover:not([aria-disabled=\"true\"])": { backgroundColor: I.primary.main } }
|
|
100
92
|
},
|
|
101
93
|
children: "전체보기"
|
|
102
94
|
})]
|
|
103
95
|
})]
|
|
104
96
|
}),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
borderRadius: 200,
|
|
115
|
-
backgroundColor: D ? B[10] : "transparent",
|
|
116
|
-
cursor: "pointer",
|
|
117
|
-
...U && { "&:hover": { backgroundColor: `${B[10]} !important` } },
|
|
118
|
-
"&:active": { backgroundColor: `${B[10]} !important` }
|
|
119
|
-
},
|
|
120
|
-
children: [/* @__PURE__ */ h(c, {
|
|
121
|
-
name: "ResetLine",
|
|
122
|
-
size: "xSmall",
|
|
123
|
-
color: "grey.70",
|
|
124
|
-
inlineCSS: { color: `${B[70]} !important` }
|
|
125
|
-
}), /* @__PURE__ */ h(c, {
|
|
126
|
-
name: "CloseLine",
|
|
127
|
-
size: "xSmall",
|
|
128
|
-
color: "etc.red",
|
|
129
|
-
inlineCSS: { color: `${V.red} !important` }
|
|
130
|
-
})]
|
|
131
|
-
}), /* @__PURE__ */ g(l, {
|
|
132
|
-
id: `message-${y}-menu`,
|
|
133
|
-
anchorRef: G,
|
|
134
|
-
open: D,
|
|
135
|
-
onClose: k,
|
|
136
|
-
onChange: X,
|
|
137
|
-
width: 160,
|
|
138
|
-
placement: "bottom-left",
|
|
139
|
-
children: [/* @__PURE__ */ h(u, {
|
|
140
|
-
value: "resend",
|
|
141
|
-
children: "재전송"
|
|
142
|
-
}), /* @__PURE__ */ h(u, {
|
|
143
|
-
value: "delete",
|
|
144
|
-
children: "삭제"
|
|
145
|
-
})]
|
|
146
|
-
})] }),
|
|
147
|
-
!J && /* @__PURE__ */ g(s, {
|
|
97
|
+
V && /* @__PURE__ */ p(n, {
|
|
98
|
+
id: g,
|
|
99
|
+
openMenu: w,
|
|
100
|
+
onClickMenu: D,
|
|
101
|
+
onCloseMenu: E,
|
|
102
|
+
onResend: O,
|
|
103
|
+
onDelete: k
|
|
104
|
+
}),
|
|
105
|
+
!V && /* @__PURE__ */ m(c, {
|
|
148
106
|
flexDirection: "column",
|
|
149
|
-
alignItems:
|
|
107
|
+
alignItems: v ? "flex-end" : "flex-start",
|
|
150
108
|
inlineCSS: { whiteSpace: "nowrap" },
|
|
151
109
|
children: [
|
|
152
|
-
|
|
110
|
+
v && b > 0 && S === "SUCCEEDED" && /* @__PURE__ */ p(u, {
|
|
153
111
|
tag: "span",
|
|
154
112
|
variant: "c5B",
|
|
155
113
|
"aria-hidden": !0,
|
|
156
|
-
inlineCSS: { color:
|
|
157
|
-
children:
|
|
114
|
+
inlineCSS: { color: I.primary.text },
|
|
115
|
+
children: b
|
|
158
116
|
}),
|
|
159
|
-
|
|
117
|
+
v && b > 0 && S === "PENDING" && /* @__PURE__ */ p(s, {
|
|
160
118
|
size: "small",
|
|
161
119
|
loop: !0,
|
|
162
120
|
inlineCSS: {
|
|
@@ -164,12 +122,12 @@ function y({ id: y, content: b = "", mine: x = !1, avatarUrl: S = "", unreadUser
|
|
|
164
122
|
height: 12
|
|
165
123
|
}
|
|
166
124
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ p(u, {
|
|
168
126
|
tag: "span",
|
|
169
127
|
variant: "c5R",
|
|
170
128
|
color: "etc.dimmed01",
|
|
171
|
-
inlineCSS: { display:
|
|
172
|
-
children:
|
|
129
|
+
inlineCSS: { display: M ? void 0 : "none" },
|
|
130
|
+
children: f(x).format("A h:mm")
|
|
173
131
|
})
|
|
174
132
|
]
|
|
175
133
|
})
|
|
@@ -177,4 +135,4 @@ function y({ id: y, content: b = "", mine: x = !1, avatarUrl: S = "", unreadUser
|
|
|
177
135
|
});
|
|
178
136
|
}
|
|
179
137
|
//#endregion
|
|
180
|
-
export {
|
|
138
|
+
export { g as default };
|
|
@@ -15,8 +15,20 @@ function t(e) {
|
|
|
15
15
|
}))];
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var n = {
|
|
19
|
+
SUCCEEDED: "전송됨",
|
|
20
|
+
FAILED: "전송 실패",
|
|
21
|
+
PENDING: "전송 중"
|
|
22
|
+
};
|
|
23
|
+
function r({ mine: t, status: r, unreadUserCount: i, content: a, regDatetime: o }) {
|
|
24
|
+
let s = n[r];
|
|
25
|
+
return [
|
|
26
|
+
t ? "나" : "상대방",
|
|
27
|
+
a,
|
|
28
|
+
i && i > 0 ? "읽지 않음" : "읽음",
|
|
29
|
+
s,
|
|
30
|
+
e(o).format("YYYY년 MM월 DD일 A h:mm")
|
|
31
|
+
].join(", ");
|
|
20
32
|
}
|
|
21
33
|
//#endregion
|
|
22
|
-
export {
|
|
34
|
+
export { r as getMessageLabel, t as markMessageGroupBoundaries };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MessageFailedActionsProps {
|
|
2
|
+
id: string | number;
|
|
3
|
+
openMenu?: boolean;
|
|
4
|
+
onClickMenu?: () => void;
|
|
5
|
+
onCloseMenu?: () => void;
|
|
6
|
+
onResend?: () => void;
|
|
7
|
+
onDelete?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare function MessageFailedActions({ id, openMenu, onClickMenu, onCloseMenu, onResend, onDelete }: MessageFailedActionsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default MessageFailedActions;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t } from "react";
|
|
2
|
+
import { Icon as n, Menu as r, MenuBlock as i } from "@dotss/ui";
|
|
3
|
+
import a from "@dotss/ui/core/useTheme";
|
|
4
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { useCheckHoverPossible as l } from "@dotss/ui/hooks";
|
|
6
|
+
import { MenuButton as u } from "@dotss/ui/Menu";
|
|
7
|
+
//#region shared/components/ChatKit/MessageFailedActions/MessageFailedActions.tsx
|
|
8
|
+
var d = 200;
|
|
9
|
+
function f({ id: f, openMenu: p, onClickMenu: m, onCloseMenu: h, onResend: g, onDelete: _ }) {
|
|
10
|
+
let { palette: { grey: v, etc: y }, spacing: b } = a(), { isHoverPossible: x } = l(), S = t(null), C = t(null), w = (e) => {
|
|
11
|
+
if (e !== "resend" && e !== "delete") return;
|
|
12
|
+
let t = e === "resend" ? g : _;
|
|
13
|
+
C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
14
|
+
t?.();
|
|
15
|
+
}, d);
|
|
16
|
+
};
|
|
17
|
+
return e(() => () => {
|
|
18
|
+
C.current && clearTimeout(C.current);
|
|
19
|
+
}, []), /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c(u, {
|
|
20
|
+
ref: S,
|
|
21
|
+
isMenuOpen: !!p,
|
|
22
|
+
menuId: `message-${f}-menu`,
|
|
23
|
+
onClick: () => m?.(),
|
|
24
|
+
size: "xSmall",
|
|
25
|
+
"aria-label": "전송 실패 메뉴 열기",
|
|
26
|
+
inlineCSS: {
|
|
27
|
+
padding: b.content(.5),
|
|
28
|
+
gap: b.content(.5),
|
|
29
|
+
borderRadius: 200,
|
|
30
|
+
backgroundColor: p ? v[10] : "transparent",
|
|
31
|
+
cursor: "pointer",
|
|
32
|
+
...x && { "&:hover": { backgroundColor: `${v[10]} !important` } },
|
|
33
|
+
"&:active": { backgroundColor: `${v[10]} !important` }
|
|
34
|
+
},
|
|
35
|
+
children: [/* @__PURE__ */ s(n, {
|
|
36
|
+
name: "ResetLine",
|
|
37
|
+
size: "xSmall",
|
|
38
|
+
color: "grey.70",
|
|
39
|
+
inlineCSS: { color: `${v[70]} !important` }
|
|
40
|
+
}), /* @__PURE__ */ s(n, {
|
|
41
|
+
name: "CloseLine",
|
|
42
|
+
size: "xSmall",
|
|
43
|
+
color: "etc.red",
|
|
44
|
+
inlineCSS: { color: `${y.red} !important` }
|
|
45
|
+
})]
|
|
46
|
+
}), /* @__PURE__ */ c(r, {
|
|
47
|
+
id: `message-${f}-menu`,
|
|
48
|
+
anchorRef: S,
|
|
49
|
+
open: p,
|
|
50
|
+
onClose: h,
|
|
51
|
+
onChange: w,
|
|
52
|
+
transitionDuration: d,
|
|
53
|
+
width: 160,
|
|
54
|
+
placement: "bottom-left",
|
|
55
|
+
children: [/* @__PURE__ */ s(i, {
|
|
56
|
+
value: "resend",
|
|
57
|
+
children: "재전송"
|
|
58
|
+
}), /* @__PURE__ */ s(i, {
|
|
59
|
+
value: "delete",
|
|
60
|
+
children: "삭제"
|
|
61
|
+
})]
|
|
62
|
+
})] });
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { f as default };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { default as Message } from './Message';
|
|
2
|
+
export { default as ImageMessage } from './ImageMessage';
|
|
2
3
|
export { default as SystemMessage } from './SystemMessage';
|
|
3
4
|
export { default as BotMessage } from './BotMessage';
|
|
4
5
|
export { default as InputBar } from './InputBar';
|
|
5
6
|
export { default as Seperator } from './Seperator';
|
|
6
7
|
export { default as UnreadMessagePill } from './UnreadMessagePill';
|
|
7
8
|
export * from './Message';
|
|
9
|
+
export * from './ImageMessage';
|
|
8
10
|
export * from './SystemMessage';
|
|
9
11
|
export * from './BotMessage';
|
|
10
12
|
export * from './InputBar';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import e from "./Message/Message.fallback.mjs";
|
|
2
2
|
import { getMessageLabel as t, markMessageGroupBoundaries as n } from "./Message/Message.utils.mjs";
|
|
3
3
|
import r from "./Message/index.mjs";
|
|
4
|
-
import i from "./
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import l from "./
|
|
9
|
-
import u from "./
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
4
|
+
import { getImageMessageLabel as i, getPhotoAssetMessage as a } from "./ImageMessage/ImageMessage.utils.mjs";
|
|
5
|
+
import o from "./ImageMessage/index.mjs";
|
|
6
|
+
import s from "./SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs";
|
|
7
|
+
import { getSystemMessageLabel as c } from "./SystemMessage/SystemMessage.utils.mjs";
|
|
8
|
+
import l from "./SystemMessage/index.mjs";
|
|
9
|
+
import { getBotMessageLabel as u, getCtaButtonText as d } from "./BotMessage/BotMessage.utils.mjs";
|
|
10
|
+
import f from "./BotMessage/index.mjs";
|
|
11
|
+
import p from "./InputBar/InputBar.fallback.mjs";
|
|
12
|
+
import m from "./InputBar/index.mjs";
|
|
13
|
+
import h from "./Seperator/index.mjs";
|
|
14
|
+
import g from "./UnreadMessagePill/index.mjs";
|
|
15
|
+
export { f as BotMessage, s as DirectTradeRiskInfoBottomSheet, o as ImageMessage, m as InputBar, p as InputBarFallback, r as Message, e as MessageFallback, h as Seperator, l as SystemMessage, g as UnreadMessagePill, u as getBotMessageLabel, d as getCtaButtonText, i as getImageMessageLabel, t as getMessageLabel, a as getPhotoAssetMessage, c as getSystemMessageLabel, n as markMessageGroupBoundaries };
|