hanbiro-react16-sdk 1.0.27 → 1.0.28

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 (45) hide show
  1. package/dist/components/ChatAIDraft/ChatList/LoadingDots.js +4 -3
  2. package/dist/components/ChatAIDraft/ChatList/MessageItem.js +4 -4
  3. package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.d.ts +15 -0
  4. package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.js +101 -0
  5. package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.d.ts +13 -0
  6. package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.js +63 -0
  7. package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.d.ts +1 -8
  8. package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.js +1 -217
  9. package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.d.ts +10 -0
  10. package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.js +79 -0
  11. package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.d.ts +8 -0
  12. package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.js +52 -0
  13. package/dist/components/ChatAIDraft/ReplyPanel/Header/index.d.ts +12 -0
  14. package/dist/components/ChatAIDraft/ReplyPanel/Header/index.js +135 -0
  15. package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.d.ts +1 -0
  16. package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.js +62 -149
  17. package/dist/components/ChatAIDraft/ReplyPanel/index.d.ts +5 -1
  18. package/dist/components/ChatAIDraft/ReplyPanel/index.js +35 -196
  19. package/dist/components/Pagination/index.d.ts +20 -0
  20. package/dist/components/Pagination/index.js +131 -0
  21. package/dist/components/SummaryAIEmails/FilterTabs.d.ts +8 -0
  22. package/dist/components/SummaryAIEmails/FilterTabs.js +57 -0
  23. package/dist/components/SummaryAIEmails/LanguagePopover.d.ts +24 -0
  24. package/dist/components/SummaryAIEmails/LanguagePopover.js +110 -0
  25. package/dist/components/SummaryAIEmails/SummaryItem.d.ts +7 -0
  26. package/dist/components/SummaryAIEmails/SummaryItem.js +74 -0
  27. package/dist/components/SummaryAIEmails/TargetInfoBar.d.ts +9 -0
  28. package/dist/components/SummaryAIEmails/TargetInfoBar.js +81 -0
  29. package/dist/components/SummaryAIEmails/index.d.ts +34 -0
  30. package/dist/components/SummaryAIEmails/index.js +213 -0
  31. package/dist/components/SummaryAIEmails/types.d.ts +16 -0
  32. package/dist/components/SummaryAIEmails/utils.d.ts +11 -0
  33. package/dist/components/SummaryAIEmails/utils.js +46 -0
  34. package/dist/components/index.d.ts +2 -4
  35. package/dist/hanbiro-react16-sdk.style.css +7 -2
  36. package/dist/hanbiro-react16-sdk.umd.js +1958 -965
  37. package/dist/index.js +11 -13
  38. package/dist/node_modules/react-feather/dist/icons/arrow-down.js +73 -0
  39. package/dist/node_modules/react-feather/dist/icons/chevron-left.js +68 -0
  40. package/dist/node_modules/react-feather/dist/icons/chevron-right.js +68 -0
  41. package/dist/node_modules/react-feather/dist/icons/globe.js +77 -0
  42. package/dist/node_modules/react-feather/dist/icons/x.js +76 -0
  43. package/dist/utils/index.d.ts +1 -1
  44. package/dist/utils/url.js +0 -13
  45. package/package.json +1 -1
@@ -0,0 +1,74 @@
1
+ import * as React from "react";
2
+ import { formatDate } from "./utils.js";
3
+ import ArrowUp from "../../node_modules/react-feather/dist/icons/arrow-up.js";
4
+ import ArrowDown from "../../node_modules/react-feather/dist/icons/arrow-down.js";
5
+ const SummaryItem = ({ item }) => {
6
+ const isSent = (item == null ? void 0 : item.direction) === "sent" || (item == null ? void 0 : item.sig) === "out";
7
+ return /* @__PURE__ */ React.createElement(
8
+ "div",
9
+ {
10
+ style: {
11
+ background: "#fff",
12
+ border: "1px solid var(--border-light)",
13
+ borderRadius: 8,
14
+ padding: 12
15
+ }
16
+ },
17
+ /* @__PURE__ */ React.createElement(
18
+ "div",
19
+ {
20
+ style: {
21
+ display: "flex",
22
+ alignItems: "center",
23
+ gap: 8,
24
+ marginBottom: 4
25
+ }
26
+ },
27
+ /* @__PURE__ */ React.createElement("span", { style: { color: "var(--text-secondary)", fontSize: 12 } }, formatDate(item == null ? void 0 : item.date)),
28
+ /* @__PURE__ */ React.createElement(
29
+ "span",
30
+ {
31
+ style: {
32
+ display: "inline-flex",
33
+ alignItems: "center",
34
+ gap: 2,
35
+ padding: "2px 6px",
36
+ borderRadius: 4,
37
+ fontSize: 11,
38
+ fontWeight: 500,
39
+ background: isSent ? "rgba(33, 150, 243, 0.1)" : "rgba(76, 175, 80, 0.1)",
40
+ color: isSent ? "#1976d2" : "#2e7d32"
41
+ }
42
+ },
43
+ isSent ? /* @__PURE__ */ React.createElement(ArrowUp, { size: 11 }) : /* @__PURE__ */ React.createElement(ArrowDown, { size: 11 }),
44
+ isSent ? "Sent" : "Received"
45
+ )
46
+ ),
47
+ /* @__PURE__ */ React.createElement(
48
+ "div",
49
+ {
50
+ style: {
51
+ fontSize: 14,
52
+ fontWeight: 600,
53
+ color: "var(--text-primary)",
54
+ marginBottom: 4
55
+ }
56
+ },
57
+ (item == null ? void 0 : item.subject) || "-"
58
+ ),
59
+ /* @__PURE__ */ React.createElement(
60
+ "div",
61
+ {
62
+ style: {
63
+ fontSize: 13,
64
+ color: "var(--text-secondary)",
65
+ lineHeight: 1.5
66
+ }
67
+ },
68
+ (item == null ? void 0 : item.messages) || ""
69
+ )
70
+ );
71
+ };
72
+ export {
73
+ SummaryItem as default
74
+ };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ interface TargetInfoBarProps {
3
+ targetName?: string;
4
+ targetEmail: string;
5
+ currentLangLabel: string;
6
+ onOpenLang: (anchor: HTMLElement) => void;
7
+ }
8
+ declare const TargetInfoBar: React.FunctionComponent<TargetInfoBarProps>;
9
+ export default TargetInfoBar;
@@ -0,0 +1,81 @@
1
+ import * as React from "react";
2
+ import Globe from "../../node_modules/react-feather/dist/icons/globe.js";
3
+ import ChevronDown from "../../node_modules/react-feather/dist/icons/chevron-down.js";
4
+ const TargetInfoBar = ({
5
+ targetName,
6
+ targetEmail,
7
+ currentLangLabel,
8
+ onOpenLang
9
+ }) => /* @__PURE__ */ React.createElement(
10
+ "div",
11
+ {
12
+ style: {
13
+ display: "flex",
14
+ justifyContent: "space-between",
15
+ alignItems: "center",
16
+ marginBottom: 12,
17
+ gap: 8
18
+ }
19
+ },
20
+ /* @__PURE__ */ React.createElement(
21
+ "span",
22
+ {
23
+ style: {
24
+ fontSize: 13,
25
+ display: "flex",
26
+ flexWrap: "wrap",
27
+ alignItems: "center",
28
+ gap: 6,
29
+ minWidth: 0
30
+ }
31
+ },
32
+ targetName && /* @__PURE__ */ React.createElement(
33
+ "span",
34
+ {
35
+ style: {
36
+ fontSize: 14,
37
+ fontWeight: 600,
38
+ color: "var(--text-primary)"
39
+ }
40
+ },
41
+ targetName
42
+ ),
43
+ targetEmail && /* @__PURE__ */ React.createElement(
44
+ "span",
45
+ {
46
+ style: {
47
+ color: "var(--text-secondary)",
48
+ whiteSpace: "nowrap",
49
+ overflow: "hidden",
50
+ textOverflow: "ellipsis"
51
+ }
52
+ },
53
+ targetEmail
54
+ )
55
+ ),
56
+ /* @__PURE__ */ React.createElement(
57
+ "span",
58
+ {
59
+ style: {
60
+ display: "inline-flex",
61
+ alignItems: "center",
62
+ gap: 6,
63
+ flexShrink: 0
64
+ }
65
+ },
66
+ /* @__PURE__ */ React.createElement("span", { style: { fontSize: 13, color: "var(--text-primary)" } }, currentLangLabel),
67
+ /* @__PURE__ */ React.createElement(
68
+ "button",
69
+ {
70
+ type: "button",
71
+ onClick: (e) => onOpenLang(e.currentTarget),
72
+ className: "icon-button small"
73
+ },
74
+ /* @__PURE__ */ React.createElement(Globe, { size: 14 }),
75
+ /* @__PURE__ */ React.createElement(ChevronDown, { size: 12, style: { marginLeft: 2 } })
76
+ )
77
+ )
78
+ );
79
+ export {
80
+ TargetInfoBar as default
81
+ };
@@ -0,0 +1,34 @@
1
+ import { LabelValue } from '../../types';
2
+ import { MailType, MetaData, SummaryItemData } from './types';
3
+ import * as React from "react";
4
+ export interface SummaryAIEmailsProps {
5
+ targetEmail: string;
6
+ targetName?: string;
7
+ defaultLang?: string;
8
+ langList?: LabelValue[];
9
+ }
10
+ interface SummaryAIEmailsState {
11
+ lang: string;
12
+ mailtype: MailType;
13
+ page: number;
14
+ items: SummaryItemData[];
15
+ meta: MetaData;
16
+ isLoading: boolean;
17
+ langAnchor: HTMLElement | null;
18
+ }
19
+ declare class SummaryAIEmails extends React.Component<SummaryAIEmailsProps, SummaryAIEmailsState> {
20
+ private eventSource;
21
+ constructor(props: SummaryAIEmailsProps);
22
+ componentDidMount(): void;
23
+ componentDidUpdate(prevProps: SummaryAIEmailsProps, prevState: SummaryAIEmailsState): void;
24
+ componentWillUnmount(): void;
25
+ closeStream: () => void;
26
+ startStream: () => void;
27
+ handleChangeFilter: (val: MailType) => void;
28
+ handleChangeLang: (val: string) => void;
29
+ handleChangePage: (page: number) => void;
30
+ handleOpenLang: (anchor: HTMLElement) => void;
31
+ handleCloseLang: () => void;
32
+ render(): React.JSX.Element;
33
+ }
34
+ export default SummaryAIEmails;
@@ -0,0 +1,213 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import * as React from "react";
5
+ import { getBaseUrl } from "../../utils/url.js";
6
+ import LoadingContainer from "../LoadingContainer/index.js";
7
+ import TargetInfoBar from "./TargetInfoBar.js";
8
+ import FilterTabs from "./FilterTabs.js";
9
+ import SummaryItem from "./SummaryItem.js";
10
+ import Pagination from "../Pagination/index.js";
11
+ import LanguagePopover from "./LanguagePopover.js";
12
+ import { PAGE_SIZE, parseDataLine, findLangLabel } from "./utils.js";
13
+ const INITIAL_META = {
14
+ total: 0,
15
+ receive: 0,
16
+ sent: 0,
17
+ totalPages: 1,
18
+ filterCount: 0
19
+ };
20
+ class SummaryAIEmails extends React.Component {
21
+ constructor(props) {
22
+ super(props);
23
+ __publicField(this, "eventSource", null);
24
+ __publicField(this, "closeStream", () => {
25
+ if (this.eventSource) {
26
+ this.eventSource.close();
27
+ this.eventSource = null;
28
+ }
29
+ });
30
+ __publicField(this, "startStream", () => {
31
+ const { targetEmail } = this.props;
32
+ const { lang, mailtype, page } = this.state;
33
+ if (!targetEmail) return;
34
+ this.closeStream();
35
+ this.setState({ items: [], isLoading: true });
36
+ const url = `${getBaseUrl()}/email/ai/fromsumstreaming/${encodeURIComponent(
37
+ targetEmail
38
+ )}/${lang}/${PAGE_SIZE}/${page}?mailtype=${mailtype}`;
39
+ const es = new EventSource(url);
40
+ this.eventSource = es;
41
+ es.addEventListener("meta", (ev) => {
42
+ var _a, _b, _c;
43
+ try {
44
+ const parsed = JSON.parse(ev.data || "{}");
45
+ this.setState({
46
+ meta: {
47
+ total: ((_a = parsed == null ? void 0 : parsed.counts) == null ? void 0 : _a.total) || 0,
48
+ receive: ((_b = parsed == null ? void 0 : parsed.counts) == null ? void 0 : _b.receive) || 0,
49
+ sent: ((_c = parsed == null ? void 0 : parsed.counts) == null ? void 0 : _c.sent) || 0,
50
+ totalPages: (parsed == null ? void 0 : parsed.total_pages) || 1,
51
+ filterCount: (parsed == null ? void 0 : parsed.filter_count) || 0
52
+ }
53
+ });
54
+ } catch (e) {
55
+ }
56
+ });
57
+ es.onmessage = (ev) => {
58
+ if (!(ev == null ? void 0 : ev.data)) return;
59
+ if (ev.data === "[DONE]") {
60
+ this.closeStream();
61
+ this.setState({ isLoading: false });
62
+ return;
63
+ }
64
+ const parsed = parseDataLine(ev.data);
65
+ if (parsed) {
66
+ this.setState((prev) => ({
67
+ items: [...prev.items, parsed],
68
+ isLoading: false
69
+ }));
70
+ }
71
+ };
72
+ es.onerror = () => {
73
+ this.closeStream();
74
+ this.setState({ isLoading: false });
75
+ };
76
+ });
77
+ __publicField(this, "handleChangeFilter", (val) => {
78
+ if (val === this.state.mailtype) return;
79
+ this.setState({ mailtype: val, page: 1 });
80
+ });
81
+ __publicField(this, "handleChangeLang", (val) => {
82
+ this.setState({ langAnchor: null });
83
+ if (val === this.state.lang) return;
84
+ this.setState({ lang: val, page: 1 });
85
+ });
86
+ __publicField(this, "handleChangePage", (page) => {
87
+ this.setState({ page });
88
+ });
89
+ __publicField(this, "handleOpenLang", (anchor) => {
90
+ this.setState({ langAnchor: anchor });
91
+ });
92
+ __publicField(this, "handleCloseLang", () => {
93
+ this.setState({ langAnchor: null });
94
+ });
95
+ this.state = {
96
+ lang: props.defaultLang || "ko",
97
+ mailtype: "all",
98
+ page: 1,
99
+ items: [],
100
+ meta: INITIAL_META,
101
+ isLoading: false,
102
+ langAnchor: null
103
+ };
104
+ }
105
+ componentDidMount() {
106
+ this.startStream();
107
+ }
108
+ componentDidUpdate(prevProps, prevState) {
109
+ const targetChanged = prevProps.targetEmail !== this.props.targetEmail;
110
+ const filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
111
+ if (targetChanged || filterChanged) {
112
+ this.startStream();
113
+ }
114
+ }
115
+ componentWillUnmount() {
116
+ this.closeStream();
117
+ }
118
+ render() {
119
+ const { targetEmail, targetName, langList = [] } = this.props;
120
+ const { lang, mailtype, page, items, meta, isLoading, langAnchor } = this.state;
121
+ const currentLangLabel = findLangLabel(lang, langList);
122
+ const totalPages = Math.max(
123
+ 1,
124
+ meta.totalPages || Math.ceil((meta.filterCount || meta.total) / PAGE_SIZE)
125
+ );
126
+ const filterCount = meta.filterCount || meta.total || 0;
127
+ return /* @__PURE__ */ React.createElement(
128
+ "div",
129
+ {
130
+ style: {
131
+ display: "flex",
132
+ flexDirection: "column",
133
+ background: "var(--background-softGrey)",
134
+ padding: 16,
135
+ borderRadius: 8,
136
+ fontFamily: "inherit",
137
+ boxSizing: "border-box"
138
+ }
139
+ },
140
+ /* @__PURE__ */ React.createElement(
141
+ TargetInfoBar,
142
+ {
143
+ targetName,
144
+ targetEmail,
145
+ currentLangLabel,
146
+ onOpenLang: this.handleOpenLang
147
+ }
148
+ ),
149
+ /* @__PURE__ */ React.createElement(
150
+ FilterTabs,
151
+ {
152
+ mailtype,
153
+ onChangeFilter: this.handleChangeFilter
154
+ }
155
+ ),
156
+ /* @__PURE__ */ React.createElement(
157
+ "div",
158
+ {
159
+ style: {
160
+ display: "flex",
161
+ flexDirection: "column",
162
+ gap: 8,
163
+ minHeight: 120
164
+ }
165
+ },
166
+ isLoading && items.length === 0 && /* @__PURE__ */ React.createElement(
167
+ LoadingContainer,
168
+ {
169
+ style: { background: "#fff", borderRadius: 8, height: 160 },
170
+ size: "small"
171
+ }
172
+ ),
173
+ !isLoading && items.length === 0 && /* @__PURE__ */ React.createElement(
174
+ "div",
175
+ {
176
+ style: {
177
+ background: "#fff",
178
+ borderRadius: 8,
179
+ padding: 24,
180
+ textAlign: "center",
181
+ color: "var(--text-secondary)",
182
+ fontSize: 13
183
+ }
184
+ },
185
+ "No data"
186
+ ),
187
+ items.map((item, idx) => /* @__PURE__ */ React.createElement(SummaryItem, { key: idx, item }))
188
+ ),
189
+ filterCount > 0 && /* @__PURE__ */ React.createElement(
190
+ Pagination,
191
+ {
192
+ total: filterCount,
193
+ page,
194
+ totalPages,
195
+ onChangePage: this.handleChangePage
196
+ }
197
+ ),
198
+ /* @__PURE__ */ React.createElement(
199
+ LanguagePopover,
200
+ {
201
+ anchorEl: langAnchor,
202
+ langList,
203
+ currentLang: lang,
204
+ onSelect: this.handleChangeLang,
205
+ onClose: this.handleCloseLang
206
+ }
207
+ )
208
+ );
209
+ }
210
+ }
211
+ export {
212
+ SummaryAIEmails as default
213
+ };
@@ -0,0 +1,16 @@
1
+ export interface SummaryItemData {
2
+ date: string;
3
+ sig: string;
4
+ direction: "sent" | "receive";
5
+ direction_label: string;
6
+ subject: string;
7
+ messages: string;
8
+ }
9
+ export interface MetaData {
10
+ total: number;
11
+ receive: number;
12
+ sent: number;
13
+ totalPages: number;
14
+ filterCount: number;
15
+ }
16
+ export type MailType = "all" | "receive" | "sent";
@@ -0,0 +1,11 @@
1
+ import { LabelValue } from '../../types';
2
+ import { SummaryItemData, MailType } from './types';
3
+
4
+ export declare const PAGE_SIZE = 5;
5
+ export declare const FILTERS: {
6
+ value: MailType;
7
+ label: string;
8
+ }[];
9
+ export declare const formatDate: (raw: string) => string;
10
+ export declare const parseDataLine: (line: string) => SummaryItemData | null;
11
+ export declare const findLangLabel: (lang: string, langList: LabelValue[]) => string;
@@ -0,0 +1,46 @@
1
+ const PAGE_SIZE = 5;
2
+ const FILTERS = [
3
+ { value: "all", label: "All" },
4
+ { value: "receive", label: "Received" },
5
+ { value: "sent", label: "Sent" }
6
+ ];
7
+ const formatDate = (raw) => {
8
+ if (!raw) return "";
9
+ return String(raw).replace(/\//g, "-");
10
+ };
11
+ const parseDataLine = (line) => {
12
+ if (!line) return null;
13
+ const trimmed = line.trim();
14
+ if (trimmed.startsWith("{")) {
15
+ try {
16
+ const parsed = JSON.parse(trimmed);
17
+ return parsed;
18
+ } catch (e) {
19
+ }
20
+ }
21
+ const parts = trimmed.split("|").map((p) => p.trim());
22
+ if (parts.length < 2) return null;
23
+ const [date, sig, subject = "", ...rest] = parts;
24
+ const messages = rest.join(" | ");
25
+ const direction = sig === "out" ? "sent" : "receive";
26
+ return {
27
+ date,
28
+ sig,
29
+ direction,
30
+ direction_label: direction === "sent" ? "Sent" : "Received",
31
+ subject,
32
+ messages
33
+ };
34
+ };
35
+ const findLangLabel = (lang, langList) => {
36
+ const found = langList == null ? void 0 : langList.find((l) => l.value === lang);
37
+ if (found) return found.label;
38
+ return lang === "ko" ? "한국어" : lang;
39
+ };
40
+ export {
41
+ FILTERS,
42
+ PAGE_SIZE,
43
+ findLangLabel,
44
+ formatDate,
45
+ parseDataLine
46
+ };
@@ -1,7 +1,5 @@
1
1
  export { default as ChatAIDraft } from './ChatAIDraft';
2
2
  export { default as LoadingCircular } from './LoadingCircular';
3
3
  export { default as LoadingContainer } from './LoadingContainer';
4
- export { default as Tooltip } from './Tooltip';
5
- export type { TooltipProps, TooltipPlacement } from './Tooltip';
6
- export { default as CountryFlag } from './CountryFlag';
7
- export type { FlagCode } from './CountryFlag';
4
+ export { default as Pagination } from './Pagination';
5
+ export { default as SummaryAIEmails } from './SummaryAIEmails';
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.27
3
- * Build Date: 2026-05-21
2
+ * hanbiro-react16-sdk v1.0.28
3
+ * Build Date: 2026-05-22
4
4
  */
5
5
  @charset "UTF-8";
6
6
  button.icon-button {
@@ -240,6 +240,11 @@ button.text-button.primary[disabled], button.text-button[color=primary][disabled
240
240
  opacity: 1;
241
241
  }
242
242
  }
243
+ input.pagination-input::-webkit-inner-spin-button, input.pagination-input::-webkit-outer-spin-button {
244
+ -webkit-appearance: none;
245
+ margin: 0;
246
+ }
247
+
243
248
  p {
244
249
  font-size: 13px;
245
250
  }