hanbiro-react16-sdk 1.0.27 → 1.0.29
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/README.md +58 -5
- package/dist/components/ChatAIDraft/ChatInput.js +3 -1
- package/dist/components/ChatAIDraft/ChatList/LoadingDots.js +4 -3
- package/dist/components/ChatAIDraft/ChatList/MessageItem.js +7 -5
- package/dist/components/ChatAIDraft/CreatePanel/EmptyState.js +15 -15
- package/dist/components/ChatAIDraft/CreatePanel/index.js +3 -3
- package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.d.ts +15 -0
- package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.js +101 -0
- package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.d.ts +13 -0
- package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.js +65 -0
- package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.d.ts +1 -8
- package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.js +11 -227
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.d.ts +10 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.js +79 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.d.ts +8 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.js +52 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/index.d.ts +12 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/index.js +139 -0
- package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.d.ts +1 -0
- package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.js +71 -155
- package/dist/components/ChatAIDraft/ReplyPanel/index.d.ts +5 -1
- package/dist/components/ChatAIDraft/ReplyPanel/index.js +42 -201
- package/dist/components/ChatAIDraft/SettingPopper/index.js +8 -6
- package/dist/components/ChatAIDraft/constants.d.ts +2 -2
- package/dist/components/ChatAIDraft/constants.js +16 -14
- package/dist/components/ChatAIDraft/index.d.ts +1 -0
- package/dist/components/ChatAIDraft/index.js +7 -1
- package/dist/components/Pagination/index.d.ts +20 -0
- package/dist/components/Pagination/index.js +133 -0
- package/dist/components/SummaryAIEmails/FilterTabs.d.ts +8 -0
- package/dist/components/SummaryAIEmails/FilterTabs.js +59 -0
- package/dist/components/SummaryAIEmails/LanguagePopover.d.ts +24 -0
- package/dist/components/SummaryAIEmails/LanguagePopover.js +110 -0
- package/dist/components/SummaryAIEmails/SummaryItem.d.ts +7 -0
- package/dist/components/SummaryAIEmails/SummaryItem.js +76 -0
- package/dist/components/SummaryAIEmails/TargetInfoBar.d.ts +9 -0
- package/dist/components/SummaryAIEmails/TargetInfoBar.js +81 -0
- package/dist/components/SummaryAIEmails/index.d.ts +35 -0
- package/dist/components/SummaryAIEmails/index.js +222 -0
- package/dist/components/SummaryAIEmails/types.d.ts +16 -0
- package/dist/components/SummaryAIEmails/utils.d.ts +12 -0
- package/dist/components/SummaryAIEmails/utils.js +47 -0
- package/dist/components/index.d.ts +2 -4
- package/dist/hanbiro-react16-sdk.style.css +7 -2
- package/dist/hanbiro-react16-sdk.umd.js +2169 -1033
- package/dist/index.js +13 -14
- package/dist/lang/en.d.ts +3 -0
- package/dist/lang/en.js +66 -0
- package/dist/lang/index.d.ts +4 -0
- package/dist/lang/index.js +18 -0
- package/dist/lang/keyLang.d.ts +62 -0
- package/dist/lang/keyLang.js +66 -0
- package/dist/lang/ko.d.ts +3 -0
- package/dist/lang/ko.js +66 -0
- package/dist/lang/vi.d.ts +3 -0
- package/dist/lang/vi.js +66 -0
- package/dist/node_modules/react-feather/dist/icons/arrow-down.js +73 -0
- package/dist/node_modules/react-feather/dist/icons/chevron-left.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/chevron-right.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/globe.js +77 -0
- package/dist/node_modules/react-feather/dist/icons/x.js +76 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/lang.d.ts +1 -0
- package/dist/utils/lang.js +30 -0
- package/dist/utils/storage.d.ts +8 -0
- package/dist/utils/storage.js +19 -0
- package/dist/utils/url.d.ts +2 -0
- package/dist/utils/url.js +8 -15
- package/package.json +1 -1
|
@@ -1,142 +1,27 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import CustomAiIcon from "../CustomAIIcon.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { t } from "../../../lang/index.js";
|
|
4
|
+
import { LangKey } from "../../../lang/keyLang.js";
|
|
5
5
|
import Mail from "../../../node_modules/react-feather/dist/icons/mail.js";
|
|
6
6
|
import MessageCircle from "../../../node_modules/react-feather/dist/icons/message-circle.js";
|
|
7
7
|
const FEATURES = [
|
|
8
8
|
{
|
|
9
9
|
icon: /* @__PURE__ */ React.createElement(Mail, { size: 16 }),
|
|
10
|
-
title:
|
|
11
|
-
desc:
|
|
10
|
+
title: t(LangKey.REPLY_FEATURE_1_TITLE),
|
|
11
|
+
desc: t(LangKey.REPLY_FEATURE_1_DESC)
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
icon: /* @__PURE__ */ React.createElement(CustomAiIcon, { size: 16, stroke: 2 }),
|
|
15
|
-
title:
|
|
16
|
-
desc:
|
|
15
|
+
title: t(LangKey.REPLY_FEATURE_2_TITLE),
|
|
16
|
+
desc: t(LangKey.REPLY_FEATURE_2_DESC)
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
icon: /* @__PURE__ */ React.createElement(MessageCircle, { size: 16 }),
|
|
20
|
-
title:
|
|
21
|
-
desc:
|
|
20
|
+
title: t(LangKey.REPLY_FEATURE_3_TITLE),
|
|
21
|
+
desc: t(LangKey.REPLY_FEATURE_3_DESC)
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
|
-
const
|
|
25
|
-
mail
|
|
26
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
style: {
|
|
30
|
-
border: "1px solid var(--border-light)",
|
|
31
|
-
borderRadius: 8,
|
|
32
|
-
padding: 10,
|
|
33
|
-
display: "flex",
|
|
34
|
-
gap: 8,
|
|
35
|
-
alignItems: "flex-start",
|
|
36
|
-
background: "#fff"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
/* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
style: {
|
|
43
|
-
fontSize: 13,
|
|
44
|
-
fontWeight: 600,
|
|
45
|
-
color: "var(--text-primary)",
|
|
46
|
-
whiteSpace: "nowrap",
|
|
47
|
-
overflow: "hidden",
|
|
48
|
-
textOverflow: "ellipsis"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
mail.subject || "(no subject)"
|
|
52
|
-
), /* @__PURE__ */ React.createElement(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
style: {
|
|
56
|
-
fontSize: 12,
|
|
57
|
-
color: "var(--text-secondary)",
|
|
58
|
-
marginTop: 2,
|
|
59
|
-
whiteSpace: "nowrap",
|
|
60
|
-
overflow: "hidden",
|
|
61
|
-
textOverflow: "ellipsis"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
mail.from_name,
|
|
65
|
-
mail.from_addr ? ` <${mail.from_addr}>` : "",
|
|
66
|
-
mail.date ? ` · ${mail.date}` : ""
|
|
67
|
-
))
|
|
68
|
-
);
|
|
69
|
-
const SelectedChip = ({ index, mail, onRemove }) => /* @__PURE__ */ React.createElement(
|
|
70
|
-
"div",
|
|
71
|
-
{
|
|
72
|
-
style: {
|
|
73
|
-
display: "inline-flex",
|
|
74
|
-
alignItems: "center",
|
|
75
|
-
gap: 6,
|
|
76
|
-
padding: "6px 8px",
|
|
77
|
-
borderRadius: 8,
|
|
78
|
-
border: "1px solid var(--border-light)",
|
|
79
|
-
background: "var(--primary-lighter)",
|
|
80
|
-
fontSize: 12,
|
|
81
|
-
maxWidth: 160
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
/* @__PURE__ */ React.createElement(
|
|
85
|
-
"span",
|
|
86
|
-
{
|
|
87
|
-
style: {
|
|
88
|
-
width: 16,
|
|
89
|
-
height: 16,
|
|
90
|
-
borderRadius: "50%",
|
|
91
|
-
background: "var(--primary-main)",
|
|
92
|
-
color: "var(--primary-contrasttext)",
|
|
93
|
-
fontSize: 10,
|
|
94
|
-
fontWeight: 700,
|
|
95
|
-
display: "inline-flex",
|
|
96
|
-
alignItems: "center",
|
|
97
|
-
justifyContent: "center",
|
|
98
|
-
flexShrink: 0
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
index + 1
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ React.createElement(
|
|
104
|
-
"span",
|
|
105
|
-
{
|
|
106
|
-
style: {
|
|
107
|
-
whiteSpace: "nowrap",
|
|
108
|
-
overflow: "hidden",
|
|
109
|
-
textOverflow: "ellipsis",
|
|
110
|
-
color: "var(--text-primary)"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
mail.subject || "(no subject)"
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ React.createElement(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
type: "button",
|
|
119
|
-
onClick: () => onRemove(mail.mid),
|
|
120
|
-
style: {
|
|
121
|
-
border: "none",
|
|
122
|
-
background: "transparent",
|
|
123
|
-
color: "var(--text-secondary)",
|
|
124
|
-
cursor: "pointer",
|
|
125
|
-
padding: 0,
|
|
126
|
-
display: "inline-flex",
|
|
127
|
-
alignItems: "center",
|
|
128
|
-
flexShrink: 0
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"×"
|
|
132
|
-
)
|
|
133
|
-
);
|
|
134
|
-
const EmptyState = ({
|
|
135
|
-
sourceMail,
|
|
136
|
-
selectedMails,
|
|
137
|
-
onAddClick,
|
|
138
|
-
onRemoveSelected
|
|
139
|
-
}) => {
|
|
24
|
+
const EmptyState = () => {
|
|
140
25
|
return /* @__PURE__ */ React.createElement(
|
|
141
26
|
"div",
|
|
142
27
|
{
|
|
@@ -152,105 +37,6 @@ const EmptyState = ({
|
|
|
152
37
|
gap: 12
|
|
153
38
|
}
|
|
154
39
|
},
|
|
155
|
-
sourceMail && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React.createElement(
|
|
156
|
-
"div",
|
|
157
|
-
{
|
|
158
|
-
style: {
|
|
159
|
-
display: "flex",
|
|
160
|
-
alignItems: "center",
|
|
161
|
-
gap: 6,
|
|
162
|
-
fontSize: 12,
|
|
163
|
-
color: "var(--text-primary)",
|
|
164
|
-
fontWeight: 600
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
/* @__PURE__ */ React.createElement("span", null, "Source context"),
|
|
168
|
-
/* @__PURE__ */ React.createElement(
|
|
169
|
-
"span",
|
|
170
|
-
{
|
|
171
|
-
style: {
|
|
172
|
-
background: "var(--primary-main)",
|
|
173
|
-
color: "var(--primary-contrasttext)",
|
|
174
|
-
fontSize: 10,
|
|
175
|
-
padding: "1px 6px",
|
|
176
|
-
borderRadius: 999,
|
|
177
|
-
fontWeight: 600
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
"1"
|
|
181
|
-
),
|
|
182
|
-
/* @__PURE__ */ React.createElement(
|
|
183
|
-
"span",
|
|
184
|
-
{
|
|
185
|
-
style: {
|
|
186
|
-
display: "inline-flex",
|
|
187
|
-
alignItems: "center",
|
|
188
|
-
gap: 2,
|
|
189
|
-
fontSize: 11,
|
|
190
|
-
color: "var(--text-secondary)",
|
|
191
|
-
fontWeight: 500
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
/* @__PURE__ */ React.createElement(Lock, { size: 11 }),
|
|
195
|
-
" Auto"
|
|
196
|
-
)
|
|
197
|
-
), /* @__PURE__ */ React.createElement(SourceCard, { mail: sourceMail })),
|
|
198
|
-
/* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React.createElement(
|
|
199
|
-
"div",
|
|
200
|
-
{
|
|
201
|
-
style: {
|
|
202
|
-
display: "flex",
|
|
203
|
-
alignItems: "center",
|
|
204
|
-
justifyContent: "space-between"
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
/* @__PURE__ */ React.createElement(
|
|
208
|
-
"div",
|
|
209
|
-
{
|
|
210
|
-
style: {
|
|
211
|
-
display: "flex",
|
|
212
|
-
alignItems: "center",
|
|
213
|
-
gap: 6,
|
|
214
|
-
fontSize: 12,
|
|
215
|
-
color: "var(--text-primary)",
|
|
216
|
-
fontWeight: 600
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
/* @__PURE__ */ React.createElement("span", null, "Selected context"),
|
|
220
|
-
/* @__PURE__ */ React.createElement(
|
|
221
|
-
"span",
|
|
222
|
-
{
|
|
223
|
-
style: {
|
|
224
|
-
background: "var(--background-softGrey)",
|
|
225
|
-
color: "var(--text-primary)",
|
|
226
|
-
fontSize: 10,
|
|
227
|
-
padding: "1px 6px",
|
|
228
|
-
borderRadius: 999,
|
|
229
|
-
fontWeight: 600
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
selectedMails.length
|
|
233
|
-
)
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ React.createElement(
|
|
236
|
-
"button",
|
|
237
|
-
{
|
|
238
|
-
type: "button",
|
|
239
|
-
onClick: onAddClick,
|
|
240
|
-
className: "text-button primary"
|
|
241
|
-
},
|
|
242
|
-
/* @__PURE__ */ React.createElement(Plus, { size: 12 }),
|
|
243
|
-
" Add"
|
|
244
|
-
)
|
|
245
|
-
), selectedMails.length > 0 && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 } }, selectedMails.map((m, i) => /* @__PURE__ */ React.createElement(
|
|
246
|
-
SelectedChip,
|
|
247
|
-
{
|
|
248
|
-
key: m.mid,
|
|
249
|
-
index: i,
|
|
250
|
-
mail: m,
|
|
251
|
-
onRemove: onRemoveSelected
|
|
252
|
-
}
|
|
253
|
-
)))),
|
|
254
40
|
/* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", marginTop: 8 } }, /* @__PURE__ */ React.createElement(
|
|
255
41
|
"div",
|
|
256
42
|
{
|
|
@@ -260,9 +46,7 @@ const EmptyState = ({
|
|
|
260
46
|
lineHeight: 1.6
|
|
261
47
|
}
|
|
262
48
|
},
|
|
263
|
-
"
|
|
264
|
-
/* @__PURE__ */ React.createElement("br", null),
|
|
265
|
-
"Add send history if you want to match the tone."
|
|
49
|
+
t(LangKey.REPLY_EMPTY_TITLE).split("\n").map((line, idx) => /* @__PURE__ */ React.createElement(React.Fragment, { key: idx }, line, /* @__PURE__ */ React.createElement("br", null)))
|
|
266
50
|
)),
|
|
267
51
|
/* @__PURE__ */ React.createElement(
|
|
268
52
|
"div",
|
|
@@ -292,7 +76,7 @@ const EmptyState = ({
|
|
|
292
76
|
lineHeight: 1.6
|
|
293
77
|
}
|
|
294
78
|
},
|
|
295
|
-
|
|
79
|
+
t(LangKey.REPLY_EMPTY_GUIDE)
|
|
296
80
|
)),
|
|
297
81
|
/* @__PURE__ */ React.createElement(
|
|
298
82
|
"div",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ContextMail } from '../../types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface SelectedChipProps {
|
|
4
|
+
index: number;
|
|
5
|
+
mail: ContextMail;
|
|
6
|
+
onClick: (mail: ContextMail) => void;
|
|
7
|
+
onRemove: (mid: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const SelectedChip: React.FunctionComponent<SelectedChipProps>;
|
|
10
|
+
export default SelectedChip;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SelectedChip = ({
|
|
3
|
+
index,
|
|
4
|
+
mail,
|
|
5
|
+
onClick,
|
|
6
|
+
onRemove
|
|
7
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
onClick: () => onClick(mail),
|
|
11
|
+
style: {
|
|
12
|
+
display: "inline-flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
gap: 6,
|
|
15
|
+
padding: "6px 8px",
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
border: "1px solid var(--border-light)",
|
|
18
|
+
background: "var(--primary-lighter)",
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
maxWidth: 160,
|
|
21
|
+
cursor: "pointer"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
/* @__PURE__ */ React.createElement(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
style: {
|
|
28
|
+
width: 16,
|
|
29
|
+
height: 16,
|
|
30
|
+
borderRadius: "50%",
|
|
31
|
+
background: "var(--primary-main)",
|
|
32
|
+
color: "var(--primary-contrasttext)",
|
|
33
|
+
fontSize: 10,
|
|
34
|
+
fontWeight: 700,
|
|
35
|
+
display: "inline-flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
flexShrink: 0
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
index + 1
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ React.createElement(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
overflow: "hidden",
|
|
49
|
+
textOverflow: "ellipsis",
|
|
50
|
+
color: "var(--text-primary)"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mail.subject || "(no subject)"
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ React.createElement(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
onClick: (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
onRemove(mail.mid);
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
border: "none",
|
|
65
|
+
background: "transparent",
|
|
66
|
+
color: "var(--text-secondary)",
|
|
67
|
+
cursor: "pointer",
|
|
68
|
+
padding: 0,
|
|
69
|
+
display: "inline-flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
flexShrink: 0
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"×"
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
export {
|
|
78
|
+
SelectedChip as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SourceCard = ({
|
|
3
|
+
mail,
|
|
4
|
+
onClick
|
|
5
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
onClick,
|
|
9
|
+
style: {
|
|
10
|
+
border: "1px solid var(--border-light)",
|
|
11
|
+
borderRadius: 8,
|
|
12
|
+
padding: 10,
|
|
13
|
+
display: "flex",
|
|
14
|
+
gap: 8,
|
|
15
|
+
alignItems: "flex-start",
|
|
16
|
+
background: "#fff",
|
|
17
|
+
cursor: onClick ? "pointer" : "default"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
/* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
style: {
|
|
24
|
+
fontSize: 13,
|
|
25
|
+
fontWeight: 600,
|
|
26
|
+
color: "var(--text-primary)",
|
|
27
|
+
whiteSpace: "nowrap",
|
|
28
|
+
overflow: "hidden",
|
|
29
|
+
textOverflow: "ellipsis"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
mail.subject || "(no subject)"
|
|
33
|
+
), /* @__PURE__ */ React.createElement(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
style: {
|
|
37
|
+
fontSize: 12,
|
|
38
|
+
color: "var(--text-secondary)",
|
|
39
|
+
marginTop: 2,
|
|
40
|
+
whiteSpace: "nowrap",
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
textOverflow: "ellipsis"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
mail.from_name,
|
|
46
|
+
mail.from_addr ? ` <${mail.from_addr}>` : "",
|
|
47
|
+
mail.date ? ` · ${mail.date}` : ""
|
|
48
|
+
))
|
|
49
|
+
);
|
|
50
|
+
export {
|
|
51
|
+
SourceCard as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContextMail } from '../../types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface ContextHeaderProps {
|
|
4
|
+
sourceMail: ContextMail | null;
|
|
5
|
+
selectedMails: ContextMail[];
|
|
6
|
+
onAddClick: () => void;
|
|
7
|
+
onSourceClick: (mail: ContextMail) => void;
|
|
8
|
+
onChipClick: (mail: ContextMail) => void;
|
|
9
|
+
onRemoveChip: (mid: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ContextHeader: React.FunctionComponent<ContextHeaderProps>;
|
|
12
|
+
export default ContextHeader;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import SourceCard from "./SourceCard.js";
|
|
3
|
+
import SelectedChip from "./SelectedChip.js";
|
|
4
|
+
import { t } from "../../../../lang/index.js";
|
|
5
|
+
import { LangKey } from "../../../../lang/keyLang.js";
|
|
6
|
+
import Lock from "../../../../node_modules/react-feather/dist/icons/lock.js";
|
|
7
|
+
import Plus from "../../../../node_modules/react-feather/dist/icons/plus.js";
|
|
8
|
+
const ContextHeader = ({
|
|
9
|
+
sourceMail,
|
|
10
|
+
selectedMails,
|
|
11
|
+
onAddClick,
|
|
12
|
+
onSourceClick,
|
|
13
|
+
onChipClick,
|
|
14
|
+
onRemoveChip
|
|
15
|
+
}) => {
|
|
16
|
+
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
gap: 12,
|
|
23
|
+
paddingBottom: 12,
|
|
24
|
+
marginBottom: 12
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
sourceMail && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React.createElement(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
style: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
gap: 6,
|
|
34
|
+
fontSize: 12,
|
|
35
|
+
color: "var(--text-primary)",
|
|
36
|
+
fontWeight: 600
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
/* @__PURE__ */ React.createElement("span", null, t(LangKey.SOURCE_CONTEXT)),
|
|
40
|
+
/* @__PURE__ */ React.createElement(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
background: "var(--primary-main)",
|
|
45
|
+
color: "var(--primary-contrasttext)",
|
|
46
|
+
fontSize: 10,
|
|
47
|
+
padding: "1px 6px",
|
|
48
|
+
borderRadius: 999,
|
|
49
|
+
fontWeight: 600
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"1"
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ React.createElement(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
style: {
|
|
58
|
+
display: "inline-flex",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
gap: 2,
|
|
61
|
+
fontSize: 11,
|
|
62
|
+
color: "var(--text-secondary)",
|
|
63
|
+
fontWeight: 500
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
/* @__PURE__ */ React.createElement(Lock, { size: 11 }),
|
|
67
|
+
" ",
|
|
68
|
+
t(LangKey.AUTO)
|
|
69
|
+
)
|
|
70
|
+
), /* @__PURE__ */ React.createElement(
|
|
71
|
+
SourceCard,
|
|
72
|
+
{
|
|
73
|
+
mail: sourceMail,
|
|
74
|
+
onClick: () => onSourceClick(sourceMail)
|
|
75
|
+
}
|
|
76
|
+
)),
|
|
77
|
+
/* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React.createElement(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
style: {
|
|
81
|
+
display: "flex",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
justifyContent: "space-between"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
/* @__PURE__ */ React.createElement(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
style: {
|
|
90
|
+
display: "flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: 6,
|
|
93
|
+
fontSize: 12,
|
|
94
|
+
color: "var(--text-primary)",
|
|
95
|
+
fontWeight: 600
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
/* @__PURE__ */ React.createElement("span", null, t(LangKey.SELECTED_CONTEXT)),
|
|
99
|
+
/* @__PURE__ */ React.createElement(
|
|
100
|
+
"span",
|
|
101
|
+
{
|
|
102
|
+
style: {
|
|
103
|
+
background: "var(--background-softGrey)",
|
|
104
|
+
color: "var(--text-primary)",
|
|
105
|
+
fontSize: 10,
|
|
106
|
+
padding: "1px 6px",
|
|
107
|
+
borderRadius: 999,
|
|
108
|
+
fontWeight: 600
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
selectedMails.length
|
|
112
|
+
)
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ React.createElement(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: onAddClick,
|
|
119
|
+
className: "text-button primary"
|
|
120
|
+
},
|
|
121
|
+
/* @__PURE__ */ React.createElement(Plus, { size: 12 }),
|
|
122
|
+
" ",
|
|
123
|
+
t(LangKey.ADD)
|
|
124
|
+
)
|
|
125
|
+
), selectedMails.length > 0 && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 } }, selectedMails.map((m, i) => /* @__PURE__ */ React.createElement(
|
|
126
|
+
SelectedChip,
|
|
127
|
+
{
|
|
128
|
+
key: m.mid,
|
|
129
|
+
index: i,
|
|
130
|
+
mail: m,
|
|
131
|
+
onClick: onChipClick,
|
|
132
|
+
onRemove: onRemoveChip
|
|
133
|
+
}
|
|
134
|
+
))))
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
ContextHeader as default
|
|
139
|
+
};
|