hanbiro-react16-sdk 1.0.28 → 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.
Files changed (43) hide show
  1. package/README.md +58 -5
  2. package/dist/components/ChatAIDraft/ChatInput.js +3 -1
  3. package/dist/components/ChatAIDraft/ChatList/MessageItem.js +3 -1
  4. package/dist/components/ChatAIDraft/CreatePanel/EmptyState.js +15 -15
  5. package/dist/components/ChatAIDraft/CreatePanel/index.js +3 -3
  6. package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.js +3 -1
  7. package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.js +10 -10
  8. package/dist/components/ChatAIDraft/ReplyPanel/Header/index.js +8 -4
  9. package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.js +12 -9
  10. package/dist/components/ChatAIDraft/ReplyPanel/index.js +7 -5
  11. package/dist/components/ChatAIDraft/SettingPopper/index.js +8 -6
  12. package/dist/components/ChatAIDraft/constants.d.ts +2 -2
  13. package/dist/components/ChatAIDraft/constants.js +16 -14
  14. package/dist/components/ChatAIDraft/index.d.ts +1 -0
  15. package/dist/components/ChatAIDraft/index.js +7 -1
  16. package/dist/components/Pagination/index.js +4 -2
  17. package/dist/components/SummaryAIEmails/FilterTabs.js +4 -2
  18. package/dist/components/SummaryAIEmails/SummaryItem.js +3 -1
  19. package/dist/components/SummaryAIEmails/index.d.ts +1 -0
  20. package/dist/components/SummaryAIEmails/index.js +11 -2
  21. package/dist/components/SummaryAIEmails/utils.d.ts +2 -1
  22. package/dist/components/SummaryAIEmails/utils.js +5 -4
  23. package/dist/hanbiro-react16-sdk.style.css +1 -1
  24. package/dist/hanbiro-react16-sdk.umd.js +241 -98
  25. package/dist/index.js +4 -3
  26. package/dist/lang/en.d.ts +3 -0
  27. package/dist/lang/en.js +66 -0
  28. package/dist/lang/index.d.ts +4 -0
  29. package/dist/lang/index.js +18 -0
  30. package/dist/lang/keyLang.d.ts +62 -0
  31. package/dist/lang/keyLang.js +66 -0
  32. package/dist/lang/ko.d.ts +3 -0
  33. package/dist/lang/ko.js +66 -0
  34. package/dist/lang/vi.d.ts +3 -0
  35. package/dist/lang/vi.js +66 -0
  36. package/dist/utils/index.d.ts +1 -1
  37. package/dist/utils/lang.d.ts +1 -0
  38. package/dist/utils/lang.js +30 -0
  39. package/dist/utils/storage.d.ts +8 -0
  40. package/dist/utils/storage.js +19 -0
  41. package/dist/utils/url.d.ts +2 -0
  42. package/dist/utils/url.js +8 -2
  43. package/package.json +1 -1
@@ -6,6 +6,7 @@ export interface SummaryAIEmailsProps {
6
6
  targetName?: string;
7
7
  defaultLang?: string;
8
8
  langList?: LabelValue[];
9
+ userLang?: string;
9
10
  }
10
11
  interface SummaryAIEmailsState {
11
12
  lang: string;
@@ -2,7 +2,8 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import * as React from "react";
5
- import { getBaseUrl } from "../../utils/url.js";
5
+ import { getBaseUrl, SDKConfig } from "../../utils/url.js";
6
+ import { t } from "../../lang/index.js";
6
7
  import LoadingContainer from "../LoadingContainer/index.js";
7
8
  import TargetInfoBar from "./TargetInfoBar.js";
8
9
  import FilterTabs from "./FilterTabs.js";
@@ -10,6 +11,7 @@ import SummaryItem from "./SummaryItem.js";
10
11
  import Pagination from "../Pagination/index.js";
11
12
  import LanguagePopover from "./LanguagePopover.js";
12
13
  import { PAGE_SIZE, parseDataLine, findLangLabel } from "./utils.js";
14
+ import { LangKey } from "../../lang/keyLang.js";
13
15
  const INITIAL_META = {
14
16
  total: 0,
15
17
  receive: 0,
@@ -101,11 +103,18 @@ class SummaryAIEmails extends React.Component {
101
103
  isLoading: false,
102
104
  langAnchor: null
103
105
  };
106
+ if (props.userLang) {
107
+ SDKConfig.lang = props.userLang;
108
+ }
104
109
  }
105
110
  componentDidMount() {
106
111
  this.startStream();
107
112
  }
108
113
  componentDidUpdate(prevProps, prevState) {
114
+ if (this.props.userLang !== prevProps.userLang && this.props.userLang) {
115
+ SDKConfig.lang = this.props.userLang;
116
+ this.forceUpdate();
117
+ }
109
118
  const targetChanged = prevProps.targetEmail !== this.props.targetEmail;
110
119
  const filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
111
120
  if (targetChanged || filterChanged) {
@@ -182,7 +191,7 @@ class SummaryAIEmails extends React.Component {
182
191
  fontSize: 13
183
192
  }
184
193
  },
185
- "No data"
194
+ t(LangKey.NO_DATA)
186
195
  ),
187
196
  items.map((item, idx) => /* @__PURE__ */ React.createElement(SummaryItem, { key: idx, item }))
188
197
  ),
@@ -1,10 +1,11 @@
1
1
  import { LabelValue } from '../../types';
2
2
  import { SummaryItemData, MailType } from './types';
3
+ import { LangKey } from '../../lang';
3
4
 
4
5
  export declare const PAGE_SIZE = 5;
5
6
  export declare const FILTERS: {
6
7
  value: MailType;
7
- label: string;
8
+ label: LangKey;
8
9
  }[];
9
10
  export declare const formatDate: (raw: string) => string;
10
11
  export declare const parseDataLine: (line: string) => SummaryItemData | null;
@@ -1,8 +1,9 @@
1
+ import { LangKey } from "../../lang/keyLang.js";
1
2
  const PAGE_SIZE = 5;
2
3
  const FILTERS = [
3
- { value: "all", label: "All" },
4
- { value: "receive", label: "Received" },
5
- { value: "sent", label: "Sent" }
4
+ { value: "all", label: LangKey.ALL },
5
+ { value: "receive", label: LangKey.RECEIVED },
6
+ { value: "sent", label: LangKey.SENT }
6
7
  ];
7
8
  const formatDate = (raw) => {
8
9
  if (!raw) return "";
@@ -27,7 +28,7 @@ const parseDataLine = (line) => {
27
28
  date,
28
29
  sig,
29
30
  direction,
30
- direction_label: direction === "sent" ? "Sent" : "Received",
31
+ direction_label: direction === "sent" ? LangKey.SENT : LangKey.RECEIVED,
31
32
  subject,
32
33
  messages
33
34
  };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.28
2
+ * hanbiro-react16-sdk v1.0.29
3
3
  * Build Date: 2026-05-22
4
4
  */
5
5
  @charset "UTF-8";