hanbiro-react16-sdk 1.0.30 → 1.0.32
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 +22 -35
- package/dist/components/ChatAIDraft/CreatePanel/index.js +2 -2
- package/dist/components/ChatAIDraft/ReplyPanel/index.js +2 -2
- package/dist/components/ChatAIDraft/helper.js +3 -31
- package/dist/components/SummaryAIEmails/index.js +3 -2
- package/dist/components/SummaryAIEmails/utils.js +1 -0
- package/dist/components/index.d.ts +0 -2
- package/dist/hanbiro-react16-sdk.style.css +11 -2
- package/dist/hanbiro-react16-sdk.umd.js +228 -251
- package/dist/index.js +10 -13
- package/dist/lang/index.js +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/lang.d.ts +1 -1
- package/dist/utils/lang.js +2 -1
- package/dist/utils/url.d.ts +2 -9
- package/dist/utils/url.js +20 -22
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -40,28 +40,34 @@ import "hanbiro-react16-sdk/style.css";
|
|
|
40
40
|
|
|
41
41
|
## Exported Utils
|
|
42
42
|
|
|
43
|
-
| Function
|
|
44
|
-
|
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
43
|
+
| Function | Description | Import path |
|
|
44
|
+
| ----------------- | ---------------------------------------------------- | --------------------------- |
|
|
45
|
+
| `setLibLang` | Set the active language for SDK components | `hanbiro-react16-sdk/utils` |
|
|
46
|
+
| `getBaseUrl` | Get the base URL (derived from the current location) | `hanbiro-react16-sdk/utils` |
|
|
47
|
+
| `getGroupwareUrl` | Get the groupware URL | `hanbiro-react16-sdk/utils` |
|
|
48
|
+
| `getAppVersion` | Get the detected app version (`"v2"` \| `"v3"`) | `hanbiro-react16-sdk/utils` |
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Versioned Theming (Automatic)
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
The SDK serves both the v3 app (URL contains `/v3`) and the v2 app (URL contains `/ngw/app`).
|
|
55
|
+
On import, the SDK detects the current version from the URL and sets a
|
|
56
|
+
`data-hanbiro-sdk-version` attribute (`"v2"` | `"v3"`) on the `<html>` element:
|
|
55
57
|
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
baseUrl: "https://vndev.hanbiro.com",
|
|
61
|
-
signer: null, // Pass your signer instance here if available
|
|
62
|
-
});
|
|
58
|
+
```html
|
|
59
|
+
<html data-hanbiro-sdk-version="v2">
|
|
60
|
+
...
|
|
61
|
+
</html>
|
|
63
62
|
```
|
|
64
63
|
|
|
64
|
+
The stylesheet then overrides the primary color palette for v2 via the
|
|
65
|
+
`:root[data-hanbiro-sdk-version="v2"]` selector. **No initialization call is required** —
|
|
66
|
+
just import the SDK and its stylesheet.
|
|
67
|
+
|
|
68
|
+
> The base URL is derived automatically from the current location (`getBaseUrl`),
|
|
69
|
+
> so there is no manual setup step.
|
|
70
|
+
|
|
65
71
|
---
|
|
66
72
|
|
|
67
73
|
## Language Configuration (`setLibLang`)
|
|
@@ -75,13 +81,9 @@ Use `setLibLang` to configure the active language imperatively.
|
|
|
75
81
|
### ES Module (npm)
|
|
76
82
|
|
|
77
83
|
```ts
|
|
78
|
-
import {
|
|
84
|
+
import { setLibLang } from "hanbiro-react16-sdk/utils";
|
|
79
85
|
|
|
80
86
|
// Call ONCE at app startup, before rendering any SDK component
|
|
81
|
-
initHanbiroReactSDK({
|
|
82
|
-
baseUrl: "https://vndev.hanbiro.com",
|
|
83
|
-
signer: null,
|
|
84
|
-
});
|
|
85
87
|
setLibLang("ko");
|
|
86
88
|
```
|
|
87
89
|
|
|
@@ -107,10 +109,6 @@ function App() {
|
|
|
107
109
|
### UMD (script tag)
|
|
108
110
|
|
|
109
111
|
```js
|
|
110
|
-
HanbiroReact16SDK.initHanbiroReactSDK({
|
|
111
|
-
baseUrl: "https://vndev.hanbiro.com",
|
|
112
|
-
signer: null,
|
|
113
|
-
});
|
|
114
112
|
HanbiroReact16SDK.setLibLang("ko");
|
|
115
113
|
```
|
|
116
114
|
|
|
@@ -158,12 +156,6 @@ Load the SDK via `<script>` and `<link>` tags directly in your HTML. React and R
|
|
|
158
156
|
The SDK is exposed as a global variable `HanbiroReact16SDK`.
|
|
159
157
|
|
|
160
158
|
```js
|
|
161
|
-
// Initialize
|
|
162
|
-
HanbiroReact16SDK.initHanbiroReactSDK({
|
|
163
|
-
baseUrl: "https://vndev.hanbiro.com",
|
|
164
|
-
signer: null,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
159
|
// Mount a component into a DOM element
|
|
168
160
|
ReactDOM.render(
|
|
169
161
|
React.createElement(HanbiroReact16SDK.ChatAIDraft, {
|
|
@@ -185,11 +177,6 @@ angular.module("myApp").directive("chatAiDraft", function () {
|
|
|
185
177
|
link: function (scope, element) {
|
|
186
178
|
var container = element[0];
|
|
187
179
|
|
|
188
|
-
HanbiroReact16SDK.initHanbiroReactSDK({
|
|
189
|
-
baseUrl: "https://vndev.hanbiro.com",
|
|
190
|
-
signer: null,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
180
|
ReactDOM.render(
|
|
194
181
|
React.createElement(HanbiroReact16SDK.ChatAIDraft, {
|
|
195
182
|
baseUrl: HanbiroReact16SDK.getBaseUrl(),
|
|
@@ -45,7 +45,7 @@ import ChatInput from "../ChatInput.js";
|
|
|
45
45
|
import EmptyState from "./EmptyState.js";
|
|
46
46
|
import { getLengthOptions, getToneOptions } from "../constants.js";
|
|
47
47
|
import { AI_LANG_FLAGS } from "../../../constants/index.js";
|
|
48
|
-
import {
|
|
48
|
+
import { CURRENT_LANG } from "../../../utils/lang.js";
|
|
49
49
|
import v4 from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
50
50
|
class CreatePanel extends React.Component {
|
|
51
51
|
constructor(props) {
|
|
@@ -109,7 +109,7 @@ class CreatePanel extends React.Component {
|
|
|
109
109
|
__publicField(this, "setTone", (tone) => this.setState({ tone }));
|
|
110
110
|
__publicField(this, "setLength", (length) => this.setState({ length }));
|
|
111
111
|
this.rootRef = React.createRef();
|
|
112
|
-
const lang = ((_a = AI_LANG_FLAGS) == null ? void 0 : _a.find((_item) => (_item == null ? void 0 : _item.value) ===
|
|
112
|
+
const lang = ((_a = AI_LANG_FLAGS) == null ? void 0 : _a.find((_item) => (_item == null ? void 0 : _item.value) === CURRENT_LANG)) || AI_LANG_FLAGS[0];
|
|
113
113
|
this.state = {
|
|
114
114
|
message: "",
|
|
115
115
|
messages: [],
|
|
@@ -49,8 +49,8 @@ import ContextPreviewModal from "./ContextPreviewModal.js";
|
|
|
49
49
|
import { fetchMailView, fetchMailAiContext } from "./helper.js";
|
|
50
50
|
import { getLengthOptions, getToneOptions } from "../constants.js";
|
|
51
51
|
import { AI_LANG_FLAGS } from "../../../constants/index.js";
|
|
52
|
-
import { SDKConfig } from "../../../utils/url.js";
|
|
53
52
|
import { t } from "../../../lang/index.js";
|
|
53
|
+
import { CURRENT_LANG } from "../../../utils/lang.js";
|
|
54
54
|
import v4 from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
55
55
|
import { LangKey } from "../../../lang/keyLang.js";
|
|
56
56
|
class ReplyPanel extends React.Component {
|
|
@@ -181,7 +181,7 @@ class ReplyPanel extends React.Component {
|
|
|
181
181
|
__publicField(this, "setTone", (tone) => this.setState({ tone }));
|
|
182
182
|
__publicField(this, "setLength", (length) => this.setState({ length }));
|
|
183
183
|
this.rootRef = React.createRef();
|
|
184
|
-
const lang = ((_a = AI_LANG_FLAGS) == null ? void 0 : _a.find((_item) => (_item == null ? void 0 : _item.value) ===
|
|
184
|
+
const lang = ((_a = AI_LANG_FLAGS) == null ? void 0 : _a.find((_item) => (_item == null ? void 0 : _item.value) === CURRENT_LANG)) || AI_LANG_FLAGS[0];
|
|
185
185
|
this.state = {
|
|
186
186
|
view: "empty",
|
|
187
187
|
sourceMail: null,
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
1
|
var __async = (__this, __arguments, generator) => {
|
|
18
2
|
return new Promise((resolve, reject) => {
|
|
19
3
|
var fulfilled = (value) => {
|
|
@@ -34,32 +18,20 @@ var __async = (__this, __arguments, generator) => {
|
|
|
34
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
19
|
});
|
|
36
20
|
};
|
|
37
|
-
import { getBaseUrl
|
|
21
|
+
import { getBaseUrl } from "../../utils/url.js";
|
|
38
22
|
function callAI(_0, _1) {
|
|
39
23
|
return __async(this, arguments, function* (params, { setContent, setIsLoading, setConversationId }) {
|
|
40
|
-
var _a;
|
|
41
24
|
let currentContent = "";
|
|
42
25
|
const baseUrl = getBaseUrl();
|
|
43
26
|
try {
|
|
44
27
|
setIsLoading(true);
|
|
45
|
-
const config = {
|
|
46
|
-
method: "POST",
|
|
47
|
-
baseURL: baseUrl,
|
|
48
|
-
url: "/nmail/chatdraft",
|
|
49
|
-
params
|
|
50
|
-
};
|
|
51
|
-
let sigHeaders = {};
|
|
52
|
-
const signer = (_a = SDKConfig) == null ? void 0 : _a.signer;
|
|
53
|
-
if (signer && typeof signer.generateHeaders === "function") {
|
|
54
|
-
sigHeaders = yield signer.generateHeaders(config);
|
|
55
|
-
}
|
|
56
28
|
const response = yield fetch(`${baseUrl}/nmail/chatdraft`, {
|
|
57
29
|
method: "POST",
|
|
58
30
|
body: JSON.stringify(params),
|
|
59
|
-
headers:
|
|
31
|
+
headers: {
|
|
60
32
|
"Content-Type": "application/json",
|
|
61
33
|
"Access-Control-Allow-Origin": "*"
|
|
62
|
-
}
|
|
34
|
+
}
|
|
63
35
|
});
|
|
64
36
|
setIsLoading(false);
|
|
65
37
|
if (!response.body) {
|
|
@@ -2,7 +2,7 @@ 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 {
|
|
5
|
+
import { getBaseUrl } from "../../utils/url.js";
|
|
6
6
|
import { t } from "../../lang/index.js";
|
|
7
7
|
import LoadingContainer from "../LoadingContainer/index.js";
|
|
8
8
|
import TargetInfoBar from "./TargetInfoBar.js";
|
|
@@ -11,6 +11,7 @@ import SummaryItem from "./SummaryItem.js";
|
|
|
11
11
|
import Pagination from "../Pagination/index.js";
|
|
12
12
|
import LanguagePopover from "./LanguagePopover.js";
|
|
13
13
|
import { PAGE_SIZE, parseDataLine, findLangLabel } from "./utils.js";
|
|
14
|
+
import { CURRENT_LANG } from "../../utils/lang.js";
|
|
14
15
|
import { LangKey } from "../../lang/keyLang.js";
|
|
15
16
|
const INITIAL_META = {
|
|
16
17
|
total: 0,
|
|
@@ -95,7 +96,7 @@ class SummaryAIEmails extends React.Component {
|
|
|
95
96
|
this.setState({ langAnchor: null });
|
|
96
97
|
});
|
|
97
98
|
this.state = {
|
|
98
|
-
lang:
|
|
99
|
+
lang: CURRENT_LANG || "ko",
|
|
99
100
|
mailtype: "all",
|
|
100
101
|
page: 1,
|
|
101
102
|
items: [],
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { default as ChatAIDraft } from './ChatAIDraft';
|
|
2
|
-
export { default as LoadingCircular } from './LoadingCircular';
|
|
3
2
|
export { default as LoadingContainer } from './LoadingContainer';
|
|
4
|
-
export { default as Pagination } from './Pagination';
|
|
5
3
|
export { default as SummaryAIEmails } from './SummaryAIEmails';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-05-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.32
|
|
3
|
+
* Build Date: 2026-05-27
|
|
4
4
|
*/
|
|
5
5
|
@charset "UTF-8";
|
|
6
6
|
button.icon-button {
|
|
@@ -270,6 +270,15 @@ p {
|
|
|
270
270
|
--border-dark: #a1a1a1;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
:root[data-hanbiro-sdk-version=v2] {
|
|
274
|
+
--primary-lighter: #e4f6fa;
|
|
275
|
+
--primary-light: #5fbadf;
|
|
276
|
+
--primary-main: #4ca1cc;
|
|
277
|
+
--primary-dark: #3e7da5;
|
|
278
|
+
--primary-darker: #325d82;
|
|
279
|
+
--primary-contrasttext: #fff;
|
|
280
|
+
}
|
|
281
|
+
|
|
273
282
|
select {
|
|
274
283
|
padding: 7px 8px;
|
|
275
284
|
border-radius: 4px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-05-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.32
|
|
3
|
+
* Build Date: 2026-05-27
|
|
4
4
|
*/
|
|
5
5
|
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
6
6
|
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
@@ -145,6 +145,42 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
145
145
|
}
|
|
146
146
|
var React__namespace = /* @__PURE__ */_interopNamespaceDefault(React);
|
|
147
147
|
var ReactDOM__namespace = /* @__PURE__ */_interopNamespaceDefault(ReactDOM);
|
|
148
|
+
var getAppVersion = function getAppVersion() {
|
|
149
|
+
var locationInfo = window.location;
|
|
150
|
+
if (window.location !== window.parent.location) {
|
|
151
|
+
try {
|
|
152
|
+
locationInfo = window.parent.location;
|
|
153
|
+
} catch (e) {
|
|
154
|
+
locationInfo = window.location;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return locationInfo.pathname.includes("/ngw/app") ? "v2" : "v3";
|
|
158
|
+
};
|
|
159
|
+
var applyVersionAttribute = function applyVersionAttribute() {
|
|
160
|
+
if (typeof document === "undefined") return;
|
|
161
|
+
document.documentElement.setAttribute("data-hanbiro-sdk-version", getAppVersion());
|
|
162
|
+
};
|
|
163
|
+
var checkDevelopment = function checkDevelopment() {
|
|
164
|
+
var locationInfo = window.location;
|
|
165
|
+
var hostname = locationInfo.hostname;
|
|
166
|
+
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
167
|
+
return true;
|
|
168
|
+
} else {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var isDevelopment = checkDevelopment();
|
|
173
|
+
var getBaseUrl = function getBaseUrl() {
|
|
174
|
+
var locationInfo = window.location;
|
|
175
|
+
var host = locationInfo.host;
|
|
176
|
+
if (isDevelopment) {
|
|
177
|
+
return "https://vndev.hanbiro.com";
|
|
178
|
+
} else {
|
|
179
|
+
var data = localStorage.getItem("host") || host;
|
|
180
|
+
var dataArr = data == null ? void 0 : data.split("/");
|
|
181
|
+
return "https://" + (dataArr == null ? void 0 : dataArr[0]);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
148
184
|
var getRandomValues;
|
|
149
185
|
var rnds8 = new Uint8Array(16);
|
|
150
186
|
function rng() {
|
|
@@ -178,87 +214,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
178
214
|
rnds[8] = rnds[8] & 63 | 128;
|
|
179
215
|
return unsafeStringify(rnds);
|
|
180
216
|
}
|
|
181
|
-
var LOCAL_STORAGE_KEY = /* @__PURE__ */function (LOCAL_STORAGE_KEY2) {
|
|
182
|
-
LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
|
|
183
|
-
return LOCAL_STORAGE_KEY2;
|
|
184
|
-
}(LOCAL_STORAGE_KEY || {});
|
|
185
|
-
var localStorageService = {
|
|
186
|
-
get: function get(key) {
|
|
187
|
-
return localStorage.getItem(key);
|
|
188
|
-
},
|
|
189
|
-
set: function set(key, value) {
|
|
190
|
-
localStorage.setItem(key, value);
|
|
191
|
-
},
|
|
192
|
-
remove: function remove(key) {
|
|
193
|
-
localStorage.removeItem(key);
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
function getBrowserLang() {
|
|
197
|
-
var shortCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
198
|
-
var language = navigator.language;
|
|
199
|
-
if (language.indexOf("-") !== -1 && shortCode) {
|
|
200
|
-
language = language.substring(0, 2);
|
|
201
|
-
}
|
|
202
|
-
if (language === "ja") {
|
|
203
|
-
language = "jp";
|
|
204
|
-
}
|
|
205
|
-
var supportLanguage = ["ko", "en", "jp", "ch", "zh", "id", "vi", "es"];
|
|
206
|
-
if (!(supportLanguage.indexOf(language) > -1)) {
|
|
207
|
-
language = "en";
|
|
208
|
-
}
|
|
209
|
-
return language || "en";
|
|
210
|
-
}
|
|
211
|
-
var getCurrentLang = function getCurrentLang() {
|
|
212
|
-
return localStorageService.get(LOCAL_STORAGE_KEY.LANG_CODE) || getBrowserLang(true);
|
|
213
|
-
};
|
|
214
|
-
var SDKConfig = {
|
|
215
|
-
baseUrl: "V3",
|
|
216
|
-
signer: null,
|
|
217
|
-
lang: getCurrentLang()
|
|
218
|
-
};
|
|
219
|
-
var initHanbiroReactSDK = function initHanbiroReactSDK(_ref2) {
|
|
220
|
-
var baseUrl = _ref2.baseUrl,
|
|
221
|
-
signer = _ref2.signer;
|
|
222
|
-
SDKConfig.baseUrl = baseUrl;
|
|
223
|
-
SDKConfig.signer = signer;
|
|
224
|
-
};
|
|
225
|
-
var setLibLang = function setLibLang(lang) {
|
|
226
|
-
if (lang) SDKConfig.lang = lang;
|
|
227
|
-
};
|
|
228
|
-
var checkDevelopment = function checkDevelopment() {
|
|
229
|
-
var locationInfo = window.location;
|
|
230
|
-
var hostname = locationInfo.hostname;
|
|
231
|
-
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
232
|
-
return true;
|
|
233
|
-
} else {
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
var isDevelopment = checkDevelopment();
|
|
238
|
-
var getBaseUrl = function getBaseUrl() {
|
|
239
|
-
var _a2;
|
|
240
|
-
var locationInfo = window.location;
|
|
241
|
-
var host = locationInfo.host;
|
|
242
|
-
if (isDevelopment) {
|
|
243
|
-
var baseUrlArr = (_a2 = SDKConfig.baseUrl) == null ? void 0 : _a2.split("/");
|
|
244
|
-
if (baseUrlArr) {
|
|
245
|
-
return "https://" + (baseUrlArr == null ? void 0 : baseUrlArr[2]);
|
|
246
|
-
} else {
|
|
247
|
-
return "https://vndev.hanbiro.com";
|
|
248
|
-
}
|
|
249
|
-
} else {
|
|
250
|
-
var data = localStorage.getItem("host") || host;
|
|
251
|
-
var dataArr = data == null ? void 0 : data.split("/");
|
|
252
|
-
return "https://" + (dataArr == null ? void 0 : dataArr[0]);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
217
|
function callAI(_0, _1) {
|
|
256
|
-
return __async(this, arguments, function (params,
|
|
257
|
-
var setContent =
|
|
258
|
-
setIsLoading =
|
|
259
|
-
setConversationId =
|
|
218
|
+
return __async(this, arguments, function (params, _ref2) {
|
|
219
|
+
var setContent = _ref2.setContent,
|
|
220
|
+
setIsLoading = _ref2.setIsLoading,
|
|
221
|
+
setConversationId = _ref2.setConversationId;
|
|
260
222
|
return /*#__PURE__*/_regenerator().m(function _callee() {
|
|
261
|
-
var currentContent, baseUrl,
|
|
223
|
+
var currentContent, baseUrl, response, reader, fullContentDecode, readIndex, _yield$reader$read, done, value, originStr, jsonFormat, contentDecode, contentRegex, conversationIdRegex, matchArray, conversationIdmatch, _regMatchItem, nVal, decoded, _t;
|
|
262
224
|
return _regenerator().w(function (_context) {
|
|
263
225
|
while (1) switch (_context.p = _context.n) {
|
|
264
226
|
case 0:
|
|
@@ -266,61 +228,44 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
266
228
|
baseUrl = getBaseUrl();
|
|
267
229
|
_context.p = 1;
|
|
268
230
|
setIsLoading(true);
|
|
269
|
-
config = {
|
|
270
|
-
method: "POST",
|
|
271
|
-
baseURL: baseUrl,
|
|
272
|
-
url: "/nmail/chatdraft",
|
|
273
|
-
params: params
|
|
274
|
-
};
|
|
275
|
-
sigHeaders = {};
|
|
276
|
-
signer = SDKConfig == null ? void 0 : SDKConfig.signer;
|
|
277
|
-
if (!(signer && typeof signer.generateHeaders === "function")) {
|
|
278
|
-
_context.n = 3;
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
231
|
_context.n = 2;
|
|
282
|
-
return signer.generateHeaders(config);
|
|
283
|
-
case 2:
|
|
284
|
-
sigHeaders = _context.v;
|
|
285
|
-
case 3:
|
|
286
|
-
_context.n = 4;
|
|
287
232
|
return fetch("".concat(baseUrl, "/nmail/chatdraft"), {
|
|
288
233
|
method: "POST",
|
|
289
234
|
body: JSON.stringify(params),
|
|
290
|
-
headers:
|
|
235
|
+
headers: {
|
|
291
236
|
"Content-Type": "application/json",
|
|
292
237
|
"Access-Control-Allow-Origin": "*"
|
|
293
|
-
}
|
|
238
|
+
}
|
|
294
239
|
});
|
|
295
|
-
case
|
|
240
|
+
case 2:
|
|
296
241
|
response = _context.v;
|
|
297
242
|
setIsLoading(false);
|
|
298
243
|
if (response.body) {
|
|
299
|
-
_context.n =
|
|
244
|
+
_context.n = 3;
|
|
300
245
|
break;
|
|
301
246
|
}
|
|
302
247
|
throw new Error("Response body is not available for streaming.");
|
|
303
|
-
case
|
|
248
|
+
case 3:
|
|
304
249
|
reader = response.body.getReader();
|
|
305
250
|
fullContentDecode = "";
|
|
306
251
|
readIndex = 0;
|
|
307
|
-
case
|
|
252
|
+
case 4:
|
|
308
253
|
if (!true) {
|
|
309
|
-
_context.n =
|
|
254
|
+
_context.n = 7;
|
|
310
255
|
break;
|
|
311
256
|
}
|
|
312
|
-
_context.n =
|
|
257
|
+
_context.n = 5;
|
|
313
258
|
return reader.read();
|
|
314
|
-
case
|
|
259
|
+
case 5:
|
|
315
260
|
_yield$reader$read = _context.v;
|
|
316
261
|
done = _yield$reader$read.done;
|
|
317
262
|
value = _yield$reader$read.value;
|
|
318
263
|
if (!done) {
|
|
319
|
-
_context.n =
|
|
264
|
+
_context.n = 6;
|
|
320
265
|
break;
|
|
321
266
|
}
|
|
322
|
-
return _context.a(3,
|
|
323
|
-
case
|
|
267
|
+
return _context.a(3, 7);
|
|
268
|
+
case 6:
|
|
324
269
|
originStr = "";
|
|
325
270
|
jsonFormat = "";
|
|
326
271
|
try {
|
|
@@ -353,23 +298,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
353
298
|
} catch (e) {
|
|
354
299
|
console.error("TextDecoder error: ", e, originStr);
|
|
355
300
|
}
|
|
356
|
-
_context.n =
|
|
301
|
+
_context.n = 4;
|
|
357
302
|
break;
|
|
358
|
-
case
|
|
303
|
+
case 7:
|
|
359
304
|
return _context.a(2, currentContent);
|
|
360
|
-
case
|
|
361
|
-
_context.p =
|
|
305
|
+
case 8:
|
|
306
|
+
_context.p = 8;
|
|
362
307
|
_t = _context.v;
|
|
363
308
|
console.error("Summary error:", _t);
|
|
364
309
|
setContent("");
|
|
365
|
-
case
|
|
366
|
-
_context.p =
|
|
310
|
+
case 9:
|
|
311
|
+
_context.p = 9;
|
|
367
312
|
setIsLoading(false);
|
|
368
|
-
return _context.f(
|
|
369
|
-
case
|
|
313
|
+
return _context.f(9);
|
|
314
|
+
case 10:
|
|
370
315
|
return _context.a(2, "");
|
|
371
316
|
}
|
|
372
|
-
}, _callee, null, [[1,
|
|
317
|
+
}, _callee, null, [[1, 8, 9, 10]]);
|
|
373
318
|
})();
|
|
374
319
|
});
|
|
375
320
|
}
|
|
@@ -4124,10 +4069,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4124
4069
|
}
|
|
4125
4070
|
}, {
|
|
4126
4071
|
key: "code",
|
|
4127
|
-
value: function code(
|
|
4128
|
-
var text =
|
|
4129
|
-
lang =
|
|
4130
|
-
escaped =
|
|
4072
|
+
value: function code(_ref3) {
|
|
4073
|
+
var text = _ref3.text,
|
|
4074
|
+
lang = _ref3.lang,
|
|
4075
|
+
escaped = _ref3.escaped;
|
|
4131
4076
|
var _a2;
|
|
4132
4077
|
var langString = (_a2 = (lang || "").match(other.notSpaceStart)) == null ? void 0 : _a2[0];
|
|
4133
4078
|
var code = text.replace(other.endingNewline, "") + "\n";
|
|
@@ -4138,22 +4083,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4138
4083
|
}
|
|
4139
4084
|
}, {
|
|
4140
4085
|
key: "blockquote",
|
|
4141
|
-
value: function blockquote(
|
|
4142
|
-
var tokens =
|
|
4086
|
+
value: function blockquote(_ref4) {
|
|
4087
|
+
var tokens = _ref4.tokens;
|
|
4143
4088
|
var body = this.parser.parse(tokens);
|
|
4144
4089
|
return "<blockquote>\n".concat(body, "</blockquote>\n");
|
|
4145
4090
|
}
|
|
4146
4091
|
}, {
|
|
4147
4092
|
key: "html",
|
|
4148
|
-
value: function html(
|
|
4149
|
-
var text =
|
|
4093
|
+
value: function html(_ref5) {
|
|
4094
|
+
var text = _ref5.text;
|
|
4150
4095
|
return text;
|
|
4151
4096
|
}
|
|
4152
4097
|
}, {
|
|
4153
4098
|
key: "heading",
|
|
4154
|
-
value: function heading(
|
|
4155
|
-
var tokens =
|
|
4156
|
-
depth =
|
|
4099
|
+
value: function heading(_ref6) {
|
|
4100
|
+
var tokens = _ref6.tokens,
|
|
4101
|
+
depth = _ref6.depth;
|
|
4157
4102
|
return "<h".concat(depth, ">").concat(this.parser.parseInline(tokens), "</h").concat(depth, ">\n");
|
|
4158
4103
|
}
|
|
4159
4104
|
}, {
|
|
@@ -4208,14 +4153,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4208
4153
|
}
|
|
4209
4154
|
}, {
|
|
4210
4155
|
key: "checkbox",
|
|
4211
|
-
value: function checkbox(
|
|
4212
|
-
var checked =
|
|
4156
|
+
value: function checkbox(_ref7) {
|
|
4157
|
+
var checked = _ref7.checked;
|
|
4213
4158
|
return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
4214
4159
|
}
|
|
4215
4160
|
}, {
|
|
4216
4161
|
key: "paragraph",
|
|
4217
|
-
value: function paragraph(
|
|
4218
|
-
var tokens =
|
|
4162
|
+
value: function paragraph(_ref8) {
|
|
4163
|
+
var tokens = _ref8.tokens;
|
|
4219
4164
|
return "<p>".concat(this.parser.parseInline(tokens), "</p>\n");
|
|
4220
4165
|
}
|
|
4221
4166
|
}, {
|
|
@@ -4245,8 +4190,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4245
4190
|
}
|
|
4246
4191
|
}, {
|
|
4247
4192
|
key: "tablerow",
|
|
4248
|
-
value: function tablerow(
|
|
4249
|
-
var text =
|
|
4193
|
+
value: function tablerow(_ref9) {
|
|
4194
|
+
var text = _ref9.text;
|
|
4250
4195
|
return "<tr>\n".concat(text, "</tr>\n");
|
|
4251
4196
|
}
|
|
4252
4197
|
}, {
|
|
@@ -4262,20 +4207,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4262
4207
|
*/
|
|
4263
4208
|
}, {
|
|
4264
4209
|
key: "strong",
|
|
4265
|
-
value: function strong(
|
|
4266
|
-
var tokens =
|
|
4210
|
+
value: function strong(_ref0) {
|
|
4211
|
+
var tokens = _ref0.tokens;
|
|
4267
4212
|
return "<strong>".concat(this.parser.parseInline(tokens), "</strong>");
|
|
4268
4213
|
}
|
|
4269
4214
|
}, {
|
|
4270
4215
|
key: "em",
|
|
4271
|
-
value: function em(
|
|
4272
|
-
var tokens =
|
|
4216
|
+
value: function em(_ref1) {
|
|
4217
|
+
var tokens = _ref1.tokens;
|
|
4273
4218
|
return "<em>".concat(this.parser.parseInline(tokens), "</em>");
|
|
4274
4219
|
}
|
|
4275
4220
|
}, {
|
|
4276
4221
|
key: "codespan",
|
|
4277
|
-
value: function codespan(
|
|
4278
|
-
var text =
|
|
4222
|
+
value: function codespan(_ref10) {
|
|
4223
|
+
var text = _ref10.text;
|
|
4279
4224
|
return "<code>".concat(escape2(text, true), "</code>");
|
|
4280
4225
|
}
|
|
4281
4226
|
}, {
|
|
@@ -4285,16 +4230,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4285
4230
|
}
|
|
4286
4231
|
}, {
|
|
4287
4232
|
key: "del",
|
|
4288
|
-
value: function del(
|
|
4289
|
-
var tokens =
|
|
4233
|
+
value: function del(_ref11) {
|
|
4234
|
+
var tokens = _ref11.tokens;
|
|
4290
4235
|
return "<del>".concat(this.parser.parseInline(tokens), "</del>");
|
|
4291
4236
|
}
|
|
4292
4237
|
}, {
|
|
4293
4238
|
key: "link",
|
|
4294
|
-
value: function link(
|
|
4295
|
-
var href =
|
|
4296
|
-
title =
|
|
4297
|
-
tokens =
|
|
4239
|
+
value: function link(_ref12) {
|
|
4240
|
+
var href = _ref12.href,
|
|
4241
|
+
title = _ref12.title,
|
|
4242
|
+
tokens = _ref12.tokens;
|
|
4298
4243
|
var text = this.parser.parseInline(tokens);
|
|
4299
4244
|
var cleanHref = cleanUrl(href);
|
|
4300
4245
|
if (cleanHref === null) {
|
|
@@ -4310,11 +4255,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4310
4255
|
}
|
|
4311
4256
|
}, {
|
|
4312
4257
|
key: "image",
|
|
4313
|
-
value: function image(
|
|
4314
|
-
var href =
|
|
4315
|
-
title =
|
|
4316
|
-
text =
|
|
4317
|
-
tokens =
|
|
4258
|
+
value: function image(_ref13) {
|
|
4259
|
+
var href = _ref13.href,
|
|
4260
|
+
title = _ref13.title,
|
|
4261
|
+
text = _ref13.text,
|
|
4262
|
+
tokens = _ref13.tokens;
|
|
4318
4263
|
if (tokens) {
|
|
4319
4264
|
text = this.parser.parseInline(tokens, this.parser.textRenderer);
|
|
4320
4265
|
}
|
|
@@ -4345,50 +4290,50 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4345
4290
|
key: "strong",
|
|
4346
4291
|
value:
|
|
4347
4292
|
// no need for block level renderers
|
|
4348
|
-
function strong(
|
|
4349
|
-
var text =
|
|
4293
|
+
function strong(_ref14) {
|
|
4294
|
+
var text = _ref14.text;
|
|
4350
4295
|
return text;
|
|
4351
4296
|
}
|
|
4352
4297
|
}, {
|
|
4353
4298
|
key: "em",
|
|
4354
|
-
value: function em(
|
|
4355
|
-
var text =
|
|
4299
|
+
value: function em(_ref15) {
|
|
4300
|
+
var text = _ref15.text;
|
|
4356
4301
|
return text;
|
|
4357
4302
|
}
|
|
4358
4303
|
}, {
|
|
4359
4304
|
key: "codespan",
|
|
4360
|
-
value: function codespan(
|
|
4361
|
-
var text =
|
|
4305
|
+
value: function codespan(_ref16) {
|
|
4306
|
+
var text = _ref16.text;
|
|
4362
4307
|
return text;
|
|
4363
4308
|
}
|
|
4364
4309
|
}, {
|
|
4365
4310
|
key: "del",
|
|
4366
|
-
value: function del(
|
|
4367
|
-
var text =
|
|
4311
|
+
value: function del(_ref17) {
|
|
4312
|
+
var text = _ref17.text;
|
|
4368
4313
|
return text;
|
|
4369
4314
|
}
|
|
4370
4315
|
}, {
|
|
4371
4316
|
key: "html",
|
|
4372
|
-
value: function html(
|
|
4373
|
-
var text =
|
|
4317
|
+
value: function html(_ref18) {
|
|
4318
|
+
var text = _ref18.text;
|
|
4374
4319
|
return text;
|
|
4375
4320
|
}
|
|
4376
4321
|
}, {
|
|
4377
4322
|
key: "text",
|
|
4378
|
-
value: function text(
|
|
4379
|
-
var _text =
|
|
4323
|
+
value: function text(_ref19) {
|
|
4324
|
+
var _text = _ref19.text;
|
|
4380
4325
|
return _text;
|
|
4381
4326
|
}
|
|
4382
4327
|
}, {
|
|
4383
4328
|
key: "link",
|
|
4384
|
-
value: function link(
|
|
4385
|
-
var text =
|
|
4329
|
+
value: function link(_ref20) {
|
|
4330
|
+
var text = _ref20.text;
|
|
4386
4331
|
return "" + text;
|
|
4387
4332
|
}
|
|
4388
4333
|
}, {
|
|
4389
4334
|
key: "image",
|
|
4390
|
-
value: function image(
|
|
4391
|
-
var text =
|
|
4335
|
+
value: function image(_ref21) {
|
|
4336
|
+
var text = _ref21.text;
|
|
4392
4337
|
return "" + text;
|
|
4393
4338
|
}
|
|
4394
4339
|
}, {
|
|
@@ -5089,9 +5034,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
5089
5034
|
marked.parseInline;
|
|
5090
5035
|
_Parser.parse;
|
|
5091
5036
|
_Lexer.lex;
|
|
5092
|
-
var TypingText = function TypingText(
|
|
5093
|
-
var data =
|
|
5094
|
-
style =
|
|
5037
|
+
var TypingText = function TypingText(_ref22) {
|
|
5038
|
+
var data = _ref22.data,
|
|
5039
|
+
style = _ref22.style;
|
|
5095
5040
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
5096
5041
|
style: __spreadValues({
|
|
5097
5042
|
maxWidth: "80%"
|
|
@@ -5127,9 +5072,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
5127
5072
|
}
|
|
5128
5073
|
}, "AI");
|
|
5129
5074
|
};
|
|
5130
|
-
var LoadingDots = function LoadingDots(
|
|
5131
|
-
var
|
|
5132
|
-
label =
|
|
5075
|
+
var LoadingDots = function LoadingDots(_ref23) {
|
|
5076
|
+
var _ref23$label = _ref23.label,
|
|
5077
|
+
label = _ref23$label === void 0 ? "Thinking" : _ref23$label;
|
|
5133
5078
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
5134
5079
|
style: {
|
|
5135
5080
|
display: "inline-flex",
|
|
@@ -5236,21 +5181,55 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
5236
5181
|
var en = (_en = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.SUMMARY_WARNING, "This is a summary compiled by AI · May contain some inaccuracies"), LangKey.NO_DATA, "No data"), LangKey.SENT, "Sent"), LangKey.RECEIVED, "Received"), LangKey.ALL, "All"), LangKey.CREATE_EMPTY_TITLE, "Let's draft a new email together from scratch."), LangKey.CREATE_EMPTY_SUBTITLE, "Tell me what kind of email you'd like to write."), LangKey.CREATE_EMPTY_GUIDE, "Give me the recipient, purpose, and key points\nand AI will generate a polished draft."), LangKey.CREATE_FEATURE_1_TITLE, "Request via message"), LangKey.CREATE_FEATURE_1_DESC, 'e.g., "Draft an email to Director Hong proposing a Q3 collaboration meeting (May 20, 3 PM)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.CREATE_FEATURE_2_TITLE, "AI generates a draft"), LangKey.CREATE_FEATURE_2_DESC, "Refine the draft freely with follow-ups like 'more polite' or 'add a deadline'."), LangKey.CREATE_FEATURE_3_TITLE, "Apply to body"), LangKey.CREATE_FEATURE_3_DESC, "Insert the response you like into the email body and send."), LangKey.CREATE_PROMPT_HINT, "💡 Try these prompts to get a draft right away"), LangKey.CREATE_SUGGESTION_1, "Propose a Q3 meeting to Director Hong (May 20, 3 PM)"), LangKey.CREATE_SUGGESTION_2, "Notify client of payment schedule (Due May 30)"), LangKey.CREATE_SUGGESTION_3, "Welcome message to new employee (Joining May 22)"), LangKey.REPLY_EMPTY_TITLE, "We'll draft a reply based on the received email.\nAdd send history if you want to match the tone."), LangKey.REPLY_EMPTY_GUIDE, "The source is auto-included. Adjust tone and length through conversation."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.REPLY_FEATURE_1_TITLE, "Auto-include source"), LangKey.REPLY_FEATURE_1_DESC, "The email you are replying to is automatically added as context."), LangKey.REPLY_FEATURE_2_TITLE, "Add send history (optional)"), LangKey.REPLY_FEATURE_2_DESC, "Use '+ Add' to pick past emails and reference their tone."), LangKey.REPLY_FEATURE_3_TITLE, "Refine with conversation"), LangKey.REPLY_FEATURE_3_DESC, "Get an AI draft, then adjust freely with chips or messages."), LangKey.CHAT_INPUT_PLACEHOLDER, "Describe your email..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "Type a message..."), LangKey.APPLY_CONTENT, "Apply content"), LangKey.SETTING_LANGUAGE, "Language"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.SETTING_TONE, "Tone"), LangKey.SETTING_LENGTH, "Length"), LangKey.TONE_FORMAL, "Formal"), LangKey.TONE_POLITE, "Polite"), LangKey.TONE_NEUTRAL, "Neutral"), LangKey.TONE_FRIENDLY, "Friendly"), LangKey.TONE_FIRM, "Firm"), LangKey.TONE_APOLOGY, "Apology"), LangKey.LENGTH_SHORT, "Short"), LangKey.LENGTH_MEDIUM, "Medium"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.LENGTH_LONG, "Long"), LangKey.LENGTH_ONE_LINER, "1-liner"), LangKey.PAGINATION_TOTAL, "Total"), LangKey.PAGINATION_PAGE, "Page"), LangKey.PAGINATION_PAGE_OF, "Page"), LangKey.REPLY_LOADING_CONTEXT, "Loading context..."), LangKey.SOURCE_CONTEXT, "Source context"), LangKey.AUTO, "Auto"), LangKey.SELECTED_CONTEXT, "Selected context"), LangKey.ADD, "Add"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.BACK, "Back"), LangKey.ADD_CONTEXT_TITLE, "Add context from receive history"), LangKey.ADD_CONTEXT_DESC, "Select related emails to provide AI context."), LangKey.SELECTED_UP_TO, "selected · up to"), LangKey.CLEAR_ALL, "Clear all"), LangKey.SORT_LATEST, "Sort: latest"), LangKey.NO_EMAILS_FOUND, "No emails found."), LangKey.CANCEL, "Cancel"), LangKey.ADD_AS_CONTEXT, "as context →"), LangKey.NO_SUBJECT, "(no subject)"));
|
|
5237
5182
|
var vi = (_vi = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.SUMMARY_WARNING, "Đây là bản tóm tắt do AI tổng hợp · Có thể chứa một số điểm không chính xác"), LangKey.NO_DATA, "Không có dữ liệu"), LangKey.SENT, "Đã gửi"), LangKey.RECEIVED, "Đã nhận"), LangKey.ALL, "Tất cả"), LangKey.CREATE_EMPTY_TITLE, "Hãy cùng nhau soạn thảo một email mới từ đầu."), LangKey.CREATE_EMPTY_SUBTITLE, "Hãy cho tôi biết bạn muốn viết loại email nào."), LangKey.CREATE_EMPTY_GUIDE, "Cho tôi người nhận, mục đích và những điểm chính\nvà AI sẽ tạo ra một bản nháp hoàn chỉnh."), LangKey.CREATE_FEATURE_1_TITLE, "Yêu cầu qua tin nhắn"), LangKey.CREATE_FEATURE_1_DESC, 'VD: "Soạn email gửi Giám đốc Hong đề xuất cuộc họp hợp tác quý 3 (20/5, 3 giờ chiều)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.CREATE_FEATURE_2_TITLE, "AI tạo bản nháp"), LangKey.CREATE_FEATURE_2_DESC, "Tinh chỉnh bản nháp thoải mái với các yêu cầu tiếp theo như 'lịch sự hơn' hoặc 'thêm thời hạn'."), LangKey.CREATE_FEATURE_3_TITLE, "Áp dụng vào nội dung"), LangKey.CREATE_FEATURE_3_DESC, "Chèn phản hồi bạn thích vào nội dung email và gửi."), LangKey.CREATE_PROMPT_HINT, "💡 Thử các câu lệnh này để nhận bản nháp ngay lập tức"), LangKey.CREATE_SUGGESTION_1, "Đề xuất cuộc họp quý 3 với Giám đốc Hong (20/5, 3 giờ chiều)"), LangKey.CREATE_SUGGESTION_2, "Thông báo lịch thanh toán cho khách hàng (Hạn chót 30/5)"), LangKey.CREATE_SUGGESTION_3, "Tin nhắn chào mừng nhân viên mới (Gia nhập 22/5)"), LangKey.REPLY_EMPTY_TITLE, "Chúng tôi sẽ soạn thảo thư trả lời dựa trên email đã nhận.\nThêm lịch sử gửi nếu bạn muốn khớp với giọng điệu."), LangKey.REPLY_EMPTY_GUIDE, "Nguồn được tự động bao gồm. Điều chỉnh giọng điệu và độ dài thông qua cuộc trò chuyện."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.REPLY_FEATURE_1_TITLE, "Tự động bao gồm nguồn"), LangKey.REPLY_FEATURE_1_DESC, "Email bạn đang trả lời tự động được thêm làm ngữ cảnh."), LangKey.REPLY_FEATURE_2_TITLE, "Thêm lịch sử gửi (tùy chọn)"), LangKey.REPLY_FEATURE_2_DESC, "Sử dụng '+ Thêm' để chọn các email trước đây và tham khảo giọng điệu của chúng."), LangKey.REPLY_FEATURE_3_TITLE, "Tinh chỉnh thông qua trò chuyện"), LangKey.REPLY_FEATURE_3_DESC, "Nhận bản nháp AI, sau đó điều chỉnh thoải mái bằng thẻ hoặc tin nhắn."), LangKey.CHAT_INPUT_PLACEHOLDER, "Mô tả email của bạn..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "Nhập tin nhắn..."), LangKey.APPLY_CONTENT, "Áp dụng nội dung"), LangKey.SETTING_LANGUAGE, "Ngôn ngữ"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.SETTING_TONE, "Giọng điệu"), LangKey.SETTING_LENGTH, "Độ dài"), LangKey.TONE_FORMAL, "Trang trọng"), LangKey.TONE_POLITE, "Lịch sự"), LangKey.TONE_NEUTRAL, "Trung lập"), LangKey.TONE_FRIENDLY, "Thân thiện"), LangKey.TONE_FIRM, "Cứng rắn"), LangKey.TONE_APOLOGY, "Xin lỗi"), LangKey.LENGTH_SHORT, "Ngắn"), LangKey.LENGTH_MEDIUM, "Trung bình"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.LENGTH_LONG, "Dài"), LangKey.LENGTH_ONE_LINER, "1 dòng"), LangKey.PAGINATION_TOTAL, "Tổng"), LangKey.PAGINATION_PAGE, "Trang"), LangKey.PAGINATION_PAGE_OF, "Trang"), LangKey.REPLY_LOADING_CONTEXT, "Đang tải ngữ cảnh..."), LangKey.SOURCE_CONTEXT, "Ngữ cảnh nguồn"), LangKey.AUTO, "Tự động"), LangKey.SELECTED_CONTEXT, "Ngữ cảnh đã chọn"), LangKey.ADD, "Thêm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.BACK, "Trở lại"), LangKey.ADD_CONTEXT_TITLE, "Thêm ngữ cảnh từ lịch sử nhận"), LangKey.ADD_CONTEXT_DESC, "Chọn các email liên quan để cung cấp ngữ cảnh cho AI."), LangKey.SELECTED_UP_TO, "đã chọn · tối đa"), LangKey.CLEAR_ALL, "Xóa tất cả"), LangKey.SORT_LATEST, "Sắp xếp: mới nhất"), LangKey.NO_EMAILS_FOUND, "Không tìm thấy email nào."), LangKey.CANCEL, "Hủy bỏ"), LangKey.ADD_AS_CONTEXT, "làm ngữ cảnh →"), LangKey.NO_SUBJECT, "(không có chủ đề)"));
|
|
5238
5183
|
var ko = (_ko = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.SUMMARY_WARNING, "이것은 AI가 작성한 요약입니다 · 일부 부정확한 내용이 포함될 수 있습니다"), LangKey.NO_DATA, "데이터 없음"), LangKey.SENT, "보낸 편지"), LangKey.RECEIVED, "받은 편지"), LangKey.ALL, "전체"), LangKey.CREATE_EMPTY_TITLE, "처음부터 새로운 이메일 초안을 함께 작성해 봅시다."), LangKey.CREATE_EMPTY_SUBTITLE, "어떤 종류의 이메일을 작성하고 싶으신가요?"), LangKey.CREATE_EMPTY_GUIDE, "수신자, 목적 및 주요 내용을 알려주시면\nAI가 완성도 높은 초안을 생성해 드립니다."), LangKey.CREATE_FEATURE_1_TITLE, "메시지로 요청"), LangKey.CREATE_FEATURE_1_DESC, '예: "홍길동 이사님께 3분기 협력 회의 제안 이메일 작성 (5월 20일 오후 3시)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.CREATE_FEATURE_2_TITLE, "AI 초안 생성"), LangKey.CREATE_FEATURE_2_DESC, "'더 정중하게' 또는 '마감일 추가'와 같은 후속 요청으로 초안을 자유롭게 수정하세요."), LangKey.CREATE_FEATURE_3_TITLE, "본문에 적용"), LangKey.CREATE_FEATURE_3_DESC, "마음에 드는 답변을 이메일 본문에 삽입하고 전송하세요."), LangKey.CREATE_PROMPT_HINT, "💡 바로 초안을 받으려면 다음 프롬프트를 시도해 보세요"), LangKey.CREATE_SUGGESTION_1, "홍길동 이사님께 3분기 회의 제안 (5월 20일 오후 3시)"), LangKey.CREATE_SUGGESTION_2, "고객에게 결제 일정 안내 (마감일 5월 30일)"), LangKey.CREATE_SUGGESTION_3, "신입 사원 환영 메시지 (5월 22일 입사)"), LangKey.REPLY_EMPTY_TITLE, "받은 이메일을 바탕으로 답장 초안을 작성합니다.\n어조를 맞추고 싶다면 보낸 내역을 추가하세요."), LangKey.REPLY_EMPTY_GUIDE, "원본 메일은 자동으로 포함됩니다. 대화를 통해 어조와 길이를 조정하세요."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.REPLY_FEATURE_1_TITLE, "원본 자동 포함"), LangKey.REPLY_FEATURE_1_DESC, "답장하려는 이메일이 자동으로 컨텍스트로 추가됩니다."), LangKey.REPLY_FEATURE_2_TITLE, "발송 내역 추가 (선택사항)"), LangKey.REPLY_FEATURE_2_DESC, "'+ 추가'를 사용하여 과거 이메일을 선택하고 어조를 참조하세요."), LangKey.REPLY_FEATURE_3_TITLE, "대화로 수정"), LangKey.REPLY_FEATURE_3_DESC, "AI 초안을 받은 후 칩이나 메시지를 사용하여 자유롭게 조정하세요."), LangKey.CHAT_INPUT_PLACEHOLDER, "이메일을 설명해주세요..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "메시지 입력..."), LangKey.APPLY_CONTENT, "내용 적용"), LangKey.SETTING_LANGUAGE, "언어"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.SETTING_TONE, "어조"), LangKey.SETTING_LENGTH, "길이"), LangKey.TONE_FORMAL, "격식"), LangKey.TONE_POLITE, "정중"), LangKey.TONE_NEUTRAL, "중립"), LangKey.TONE_FRIENDLY, "친근"), LangKey.TONE_FIRM, "단호"), LangKey.TONE_APOLOGY, "사과"), LangKey.LENGTH_SHORT, "짧게"), LangKey.LENGTH_MEDIUM, "보통"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.LENGTH_LONG, "길게"), LangKey.LENGTH_ONE_LINER, "한 줄"), LangKey.PAGINATION_TOTAL, "전체"), LangKey.PAGINATION_PAGE, "페이지"), LangKey.PAGINATION_PAGE_OF, "페이지"), LangKey.REPLY_LOADING_CONTEXT, "컨텍스트 로딩 중..."), LangKey.SOURCE_CONTEXT, "원본 컨텍스트"), LangKey.AUTO, "자동"), LangKey.SELECTED_CONTEXT, "선택한 컨텍스트"), LangKey.ADD, "추가"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.BACK, "뒤로"), LangKey.ADD_CONTEXT_TITLE, "수신 내역에서 컨텍스트 추가"), LangKey.ADD_CONTEXT_DESC, "관련 이메일을 선택하여 AI에 컨텍스트를 제공하세요."), LangKey.SELECTED_UP_TO, "개 선택됨 · 최대"), LangKey.CLEAR_ALL, "모두 지우기"), LangKey.SORT_LATEST, "정렬: 최신순"), LangKey.NO_EMAILS_FOUND, "이메일을 찾을 수 없습니다."), LangKey.CANCEL, "취소"), LangKey.ADD_AS_CONTEXT, "컨텍스트로 추가 →"), LangKey.NO_SUBJECT, "(제목 없음)"));
|
|
5184
|
+
var LOCAL_STORAGE_KEY = /* @__PURE__ */function (LOCAL_STORAGE_KEY2) {
|
|
5185
|
+
LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
|
|
5186
|
+
return LOCAL_STORAGE_KEY2;
|
|
5187
|
+
}(LOCAL_STORAGE_KEY || {});
|
|
5188
|
+
var localStorageService = {
|
|
5189
|
+
get: function get(key) {
|
|
5190
|
+
return localStorage.getItem(key);
|
|
5191
|
+
},
|
|
5192
|
+
set: function set(key, value) {
|
|
5193
|
+
localStorage.setItem(key, value);
|
|
5194
|
+
},
|
|
5195
|
+
remove: function remove(key) {
|
|
5196
|
+
localStorage.removeItem(key);
|
|
5197
|
+
}
|
|
5198
|
+
};
|
|
5199
|
+
function getBrowserLang() {
|
|
5200
|
+
var shortCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
5201
|
+
var language = navigator.language;
|
|
5202
|
+
if (language.indexOf("-") !== -1 && shortCode) {
|
|
5203
|
+
language = language.substring(0, 2);
|
|
5204
|
+
}
|
|
5205
|
+
if (language === "ja") {
|
|
5206
|
+
language = "jp";
|
|
5207
|
+
}
|
|
5208
|
+
var supportLanguage = ["ko", "en", "jp", "ch", "zh", "id", "vi", "es"];
|
|
5209
|
+
if (!(supportLanguage.indexOf(language) > -1)) {
|
|
5210
|
+
language = "en";
|
|
5211
|
+
}
|
|
5212
|
+
return language || "en";
|
|
5213
|
+
}
|
|
5214
|
+
var getCurrentLang = function getCurrentLang() {
|
|
5215
|
+
return localStorageService.get(LOCAL_STORAGE_KEY.LANG_CODE) || getBrowserLang(true);
|
|
5216
|
+
};
|
|
5217
|
+
var CURRENT_LANG = getCurrentLang();
|
|
5239
5218
|
var dicts = {
|
|
5240
5219
|
en: en,
|
|
5241
5220
|
vi: vi,
|
|
5242
5221
|
ko: ko
|
|
5243
5222
|
};
|
|
5244
5223
|
var t = function t(key) {
|
|
5245
|
-
var lang =
|
|
5224
|
+
var lang = CURRENT_LANG || "en";
|
|
5246
5225
|
var prefix = lang.split("-")[0];
|
|
5247
5226
|
var dict = dicts[lang] || dicts[prefix] || dicts.en;
|
|
5248
5227
|
return dict[key] || en[key] || key;
|
|
5249
5228
|
};
|
|
5250
|
-
var MessageItem = function MessageItem(
|
|
5251
|
-
var item =
|
|
5252
|
-
onApply =
|
|
5253
|
-
getEditorContent =
|
|
5229
|
+
var MessageItem = function MessageItem(_ref24) {
|
|
5230
|
+
var item = _ref24.item,
|
|
5231
|
+
onApply = _ref24.onApply,
|
|
5232
|
+
getEditorContent = _ref24.getEditorContent;
|
|
5254
5233
|
var handleApply = function handleApply() {
|
|
5255
5234
|
return __async(_this9, null, /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
5256
5235
|
var editorValue, html2;
|
|
@@ -5340,10 +5319,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
5340
5319
|
size: 16
|
|
5341
5320
|
}))))))));
|
|
5342
5321
|
};
|
|
5343
|
-
var ChatList = function ChatList(
|
|
5344
|
-
var items =
|
|
5345
|
-
onApply =
|
|
5346
|
-
getEditorContent =
|
|
5322
|
+
var ChatList = function ChatList(_ref25) {
|
|
5323
|
+
var items = _ref25.items,
|
|
5324
|
+
onApply = _ref25.onApply,
|
|
5325
|
+
getEditorContent = _ref25.getEditorContent;
|
|
5347
5326
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
5348
5327
|
style: {
|
|
5349
5328
|
flex: 1,
|
|
@@ -7219,13 +7198,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7219
7198
|
}
|
|
7220
7199
|
}]);
|
|
7221
7200
|
}(React__namespace.Component);
|
|
7222
|
-
var ChipGroup = function ChipGroup(
|
|
7223
|
-
var options =
|
|
7224
|
-
selected =
|
|
7225
|
-
onSelect =
|
|
7226
|
-
iconMap =
|
|
7227
|
-
|
|
7228
|
-
columns =
|
|
7201
|
+
var ChipGroup = function ChipGroup(_ref26) {
|
|
7202
|
+
var options = _ref26.options,
|
|
7203
|
+
selected = _ref26.selected,
|
|
7204
|
+
onSelect = _ref26.onSelect,
|
|
7205
|
+
iconMap = _ref26.iconMap,
|
|
7206
|
+
_ref26$columns = _ref26.columns,
|
|
7207
|
+
columns = _ref26$columns === void 0 ? 3 : _ref26$columns;
|
|
7229
7208
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
7230
7209
|
style: {
|
|
7231
7210
|
display: "grid",
|
|
@@ -7656,13 +7635,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7656
7635
|
}
|
|
7657
7636
|
}]);
|
|
7658
7637
|
}(React__namespace.Component);
|
|
7659
|
-
var CustomAiIcon = function CustomAiIcon(
|
|
7660
|
-
var
|
|
7661
|
-
isGradient =
|
|
7662
|
-
|
|
7663
|
-
stroke =
|
|
7664
|
-
|
|
7665
|
-
size =
|
|
7638
|
+
var CustomAiIcon = function CustomAiIcon(_ref27) {
|
|
7639
|
+
var _ref27$isGradient = _ref27.isGradient,
|
|
7640
|
+
isGradient = _ref27$isGradient === void 0 ? false : _ref27$isGradient,
|
|
7641
|
+
_ref27$stroke = _ref27.stroke,
|
|
7642
|
+
stroke = _ref27$stroke === void 0 ? 1.5 : _ref27$stroke,
|
|
7643
|
+
_ref27$size = _ref27.size,
|
|
7644
|
+
size = _ref27$size === void 0 ? 40 : _ref27$size;
|
|
7666
7645
|
var gradientId = "ai-gradient-" + Math.random().toString(36).substr(2, 9);
|
|
7667
7646
|
return /* @__PURE__ */React__namespace.createElement("svg", {
|
|
7668
7647
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7739,8 +7718,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7739
7718
|
desc: t(LangKey.CREATE_FEATURE_3_DESC)
|
|
7740
7719
|
}];
|
|
7741
7720
|
var SUGGESTIONS = [t(LangKey.CREATE_SUGGESTION_1), t(LangKey.CREATE_SUGGESTION_2), t(LangKey.CREATE_SUGGESTION_3)];
|
|
7742
|
-
var EmptyState$1 = function EmptyState$1(
|
|
7743
|
-
var onSelectPrompt =
|
|
7721
|
+
var EmptyState$1 = function EmptyState$1(_ref28) {
|
|
7722
|
+
var onSelectPrompt = _ref28.onSelectPrompt;
|
|
7744
7723
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
7745
7724
|
style: {
|
|
7746
7725
|
flex: 1,
|
|
@@ -8009,7 +7988,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8009
7988
|
});
|
|
8010
7989
|
_this12.rootRef = React__namespace.createRef();
|
|
8011
7990
|
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
8012
|
-
return (_item == null ? void 0 : _item.value) ===
|
|
7991
|
+
return (_item == null ? void 0 : _item.value) === CURRENT_LANG;
|
|
8013
7992
|
})) || AI_LANG_FLAGS[0];
|
|
8014
7993
|
_this12.state = {
|
|
8015
7994
|
message: "",
|
|
@@ -8200,9 +8179,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8200
8179
|
}, f.desc)));
|
|
8201
8180
|
})));
|
|
8202
8181
|
};
|
|
8203
|
-
var SourceCard = function SourceCard(
|
|
8204
|
-
var mail =
|
|
8205
|
-
onClick =
|
|
8182
|
+
var SourceCard = function SourceCard(_ref29) {
|
|
8183
|
+
var mail = _ref29.mail,
|
|
8184
|
+
onClick = _ref29.onClick;
|
|
8206
8185
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
8207
8186
|
onClick: onClick,
|
|
8208
8187
|
style: {
|
|
@@ -8240,11 +8219,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8240
8219
|
}
|
|
8241
8220
|
}, mail.from_name, mail.from_addr ? " <".concat(mail.from_addr, ">") : "", mail.date ? " \xB7 ".concat(mail.date) : "")));
|
|
8242
8221
|
};
|
|
8243
|
-
var SelectedChip = function SelectedChip(
|
|
8244
|
-
var index =
|
|
8245
|
-
mail =
|
|
8246
|
-
_onClick =
|
|
8247
|
-
onRemove =
|
|
8222
|
+
var SelectedChip = function SelectedChip(_ref30) {
|
|
8223
|
+
var index = _ref30.index,
|
|
8224
|
+
mail = _ref30.mail,
|
|
8225
|
+
_onClick = _ref30.onClick,
|
|
8226
|
+
onRemove = _ref30.onRemove;
|
|
8248
8227
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
8249
8228
|
onClick: function onClick() {
|
|
8250
8229
|
return _onClick(mail);
|
|
@@ -8300,13 +8279,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8300
8279
|
}
|
|
8301
8280
|
}, "×"));
|
|
8302
8281
|
};
|
|
8303
|
-
var ContextHeader = function ContextHeader(
|
|
8304
|
-
var sourceMail =
|
|
8305
|
-
selectedMails =
|
|
8306
|
-
onAddClick =
|
|
8307
|
-
onSourceClick =
|
|
8308
|
-
onChipClick =
|
|
8309
|
-
onRemoveChip =
|
|
8282
|
+
var ContextHeader = function ContextHeader(_ref31) {
|
|
8283
|
+
var sourceMail = _ref31.sourceMail,
|
|
8284
|
+
selectedMails = _ref31.selectedMails,
|
|
8285
|
+
onAddClick = _ref31.onAddClick,
|
|
8286
|
+
onSourceClick = _ref31.onSourceClick,
|
|
8287
|
+
onChipClick = _ref31.onChipClick,
|
|
8288
|
+
onRemoveChip = _ref31.onRemoveChip;
|
|
8310
8289
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
8311
8290
|
style: {
|
|
8312
8291
|
display: "flex",
|
|
@@ -8407,13 +8386,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8407
8386
|
});
|
|
8408
8387
|
}))));
|
|
8409
8388
|
};
|
|
8410
|
-
var LoadingCircular = function LoadingCircular(
|
|
8411
|
-
var
|
|
8412
|
-
size =
|
|
8413
|
-
|
|
8414
|
-
color =
|
|
8415
|
-
|
|
8416
|
-
thickness =
|
|
8389
|
+
var LoadingCircular = function LoadingCircular(_ref32) {
|
|
8390
|
+
var _ref32$size = _ref32.size,
|
|
8391
|
+
size = _ref32$size === void 0 ? 40 : _ref32$size,
|
|
8392
|
+
_ref32$color = _ref32.color,
|
|
8393
|
+
color = _ref32$color === void 0 ? "var(--primary-main)" : _ref32$color,
|
|
8394
|
+
_ref32$thickness = _ref32.thickness,
|
|
8395
|
+
thickness = _ref32$thickness === void 0 ? 3.6 : _ref32$thickness;
|
|
8417
8396
|
var radius = 20;
|
|
8418
8397
|
var circumference = 2 * Math.PI * radius;
|
|
8419
8398
|
return /* @__PURE__ */React.createElement("div", {
|
|
@@ -8445,13 +8424,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8445
8424
|
small: 28,
|
|
8446
8425
|
medium: 40
|
|
8447
8426
|
};
|
|
8448
|
-
var LoadingContainer = function LoadingContainer(
|
|
8449
|
-
var style =
|
|
8450
|
-
|
|
8451
|
-
fullHeight =
|
|
8452
|
-
|
|
8453
|
-
size =
|
|
8454
|
-
label =
|
|
8427
|
+
var LoadingContainer = function LoadingContainer(_ref33) {
|
|
8428
|
+
var style = _ref33.style,
|
|
8429
|
+
_ref33$fullHeight = _ref33.fullHeight,
|
|
8430
|
+
fullHeight = _ref33$fullHeight === void 0 ? false : _ref33$fullHeight,
|
|
8431
|
+
_ref33$size = _ref33.size,
|
|
8432
|
+
size = _ref33$size === void 0 ? "medium" : _ref33$size,
|
|
8433
|
+
label = _ref33.label;
|
|
8455
8434
|
return /* @__PURE__ */React.createElement("div", {
|
|
8456
8435
|
style: __spreadValues({
|
|
8457
8436
|
display: "flex",
|
|
@@ -9188,8 +9167,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9188
9167
|
return md;
|
|
9189
9168
|
}
|
|
9190
9169
|
};
|
|
9191
|
-
var MailHeader = function MailHeader(
|
|
9192
|
-
var mail =
|
|
9170
|
+
var MailHeader = function MailHeader(_ref34) {
|
|
9171
|
+
var mail = _ref34.mail;
|
|
9193
9172
|
return /* @__PURE__ */React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */React__namespace.createElement("div", {
|
|
9194
9173
|
style: {
|
|
9195
9174
|
fontSize: 14,
|
|
@@ -9210,9 +9189,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9210
9189
|
}
|
|
9211
9190
|
}, mail.from_name, mail.from_addr ? " <".concat(mail.from_addr, ">") : "", mail.date ? " \xB7 ".concat(mail.date) : ""));
|
|
9212
9191
|
};
|
|
9213
|
-
var ContextPreviewModal = function ContextPreviewModal(
|
|
9214
|
-
var preview =
|
|
9215
|
-
onClose =
|
|
9192
|
+
var ContextPreviewModal = function ContextPreviewModal(_ref35) {
|
|
9193
|
+
var preview = _ref35.preview,
|
|
9194
|
+
onClose = _ref35.onClose;
|
|
9216
9195
|
var html2 = preview ? preview.mode === "html" ? preview.mail.contents || "" : renderMarkdown(preview.mail.ai_contents || "") : "";
|
|
9217
9196
|
return /* @__PURE__ */React__namespace.createElement(BaseModal, {
|
|
9218
9197
|
isOpen: !!preview,
|
|
@@ -9457,7 +9436,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9457
9436
|
});
|
|
9458
9437
|
_this19.rootRef = React__namespace.createRef();
|
|
9459
9438
|
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
9460
|
-
return (_item == null ? void 0 : _item.value) ===
|
|
9439
|
+
return (_item == null ? void 0 : _item.value) === CURRENT_LANG;
|
|
9461
9440
|
})) || AI_LANG_FLAGS[0];
|
|
9462
9441
|
_this19.state = {
|
|
9463
9442
|
view: "empty",
|
|
@@ -9576,11 +9555,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9576
9555
|
}
|
|
9577
9556
|
return /* @__PURE__ */React__namespace.createElement(CreatePanel, __spreadValues({}, rest));
|
|
9578
9557
|
};
|
|
9579
|
-
var TargetInfoBar = function TargetInfoBar(
|
|
9580
|
-
var targetName =
|
|
9581
|
-
targetEmail =
|
|
9582
|
-
currentLangLabel =
|
|
9583
|
-
onOpenLang =
|
|
9558
|
+
var TargetInfoBar = function TargetInfoBar(_ref36) {
|
|
9559
|
+
var targetName = _ref36.targetName,
|
|
9560
|
+
targetEmail = _ref36.targetEmail,
|
|
9561
|
+
currentLangLabel = _ref36.currentLangLabel,
|
|
9562
|
+
onOpenLang = _ref36.onOpenLang;
|
|
9584
9563
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
9585
9564
|
style: {
|
|
9586
9565
|
display: "flex",
|
|
@@ -9690,9 +9669,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9690
9669
|
if (found) return found.label;
|
|
9691
9670
|
return lang === "ko" ? "한국어" : lang;
|
|
9692
9671
|
};
|
|
9693
|
-
var FilterTabs = function FilterTabs(
|
|
9694
|
-
var mailtype =
|
|
9695
|
-
onChangeFilter =
|
|
9672
|
+
var FilterTabs = function FilterTabs(_ref37) {
|
|
9673
|
+
var mailtype = _ref37.mailtype,
|
|
9674
|
+
onChangeFilter = _ref37.onChangeFilter;
|
|
9696
9675
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
9697
9676
|
style: {
|
|
9698
9677
|
display: "flex",
|
|
@@ -9737,8 +9716,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9737
9716
|
}, t(f.label));
|
|
9738
9717
|
})));
|
|
9739
9718
|
};
|
|
9740
|
-
var SummaryItem = function SummaryItem(
|
|
9741
|
-
var item =
|
|
9719
|
+
var SummaryItem = function SummaryItem(_ref38) {
|
|
9720
|
+
var item = _ref38.item;
|
|
9742
9721
|
var isSent = (item == null ? void 0 : item.direction) === "sent" || (item == null ? void 0 : item.sig) === "out";
|
|
9743
9722
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
9744
9723
|
style: {
|
|
@@ -10016,7 +9995,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10016
9995
|
});
|
|
10017
9996
|
});
|
|
10018
9997
|
_this22.state = {
|
|
10019
|
-
lang:
|
|
9998
|
+
lang: CURRENT_LANG || "ko",
|
|
10020
9999
|
mailtype: "all",
|
|
10021
10000
|
page: 1,
|
|
10022
10001
|
items: [],
|
|
@@ -10126,14 +10105,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10126
10105
|
}
|
|
10127
10106
|
}]);
|
|
10128
10107
|
}(React__namespace.Component);
|
|
10108
|
+
applyVersionAttribute();
|
|
10129
10109
|
exports2.AI_LANG_FLAGS = AI_LANG_FLAGS;
|
|
10130
10110
|
exports2.ChatAIDraft = ChatAIDraft;
|
|
10131
|
-
exports2.LoadingCircular = LoadingCircular;
|
|
10132
10111
|
exports2.LoadingContainer = LoadingContainer;
|
|
10133
|
-
exports2.Pagination = Pagination;
|
|
10134
10112
|
exports2.SummaryAIEmails = SummaryAIEmails;
|
|
10135
|
-
exports2.
|
|
10136
|
-
exports2.setLibLang = setLibLang;
|
|
10113
|
+
exports2.getAppVersion = getAppVersion;
|
|
10137
10114
|
Object.defineProperty(exports2, Symbol.toStringTag, {
|
|
10138
10115
|
value: "Module"
|
|
10139
10116
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-05-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.32
|
|
3
|
+
* Build Date: 2026-05-27
|
|
4
4
|
*/
|
|
5
5
|
/* empty css */
|
|
6
|
+
import { applyVersionAttribute } from "./utils/url.js";
|
|
7
|
+
import { getAppVersion } from "./utils/url.js";
|
|
6
8
|
import { AI_LANG_FLAGS } from "./constants/index.js";
|
|
7
9
|
import { default as default2 } from "./components/ChatAIDraft/index.js";
|
|
8
|
-
import { default as default3 } from "./components/
|
|
9
|
-
import { default as default4 } from "./components/
|
|
10
|
-
|
|
11
|
-
import { default as default6 } from "./components/SummaryAIEmails/index.js";
|
|
12
|
-
import { initHanbiroReactSDK, setLibLang } from "./utils/url.js";
|
|
10
|
+
import { default as default3 } from "./components/LoadingContainer/index.js";
|
|
11
|
+
import { default as default4 } from "./components/SummaryAIEmails/index.js";
|
|
12
|
+
applyVersionAttribute();
|
|
13
13
|
export {
|
|
14
14
|
AI_LANG_FLAGS,
|
|
15
15
|
default2 as ChatAIDraft,
|
|
16
|
-
default3 as
|
|
17
|
-
default4 as
|
|
18
|
-
|
|
19
|
-
default6 as SummaryAIEmails,
|
|
20
|
-
initHanbiroReactSDK,
|
|
21
|
-
setLibLang
|
|
16
|
+
default3 as LoadingContainer,
|
|
17
|
+
default4 as SummaryAIEmails,
|
|
18
|
+
getAppVersion
|
|
22
19
|
};
|
package/dist/lang/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { SDKConfig } from "../utils/url.js";
|
|
2
1
|
import { en } from "./en.js";
|
|
3
2
|
import { vi } from "./vi.js";
|
|
4
3
|
import { ko } from "./ko.js";
|
|
4
|
+
import { CURRENT_LANG } from "../utils/lang.js";
|
|
5
5
|
const dicts = {
|
|
6
6
|
en,
|
|
7
7
|
vi,
|
|
8
8
|
ko
|
|
9
9
|
};
|
|
10
10
|
const t = (key) => {
|
|
11
|
-
const lang =
|
|
11
|
+
const lang = CURRENT_LANG || "en";
|
|
12
12
|
const prefix = lang.split("-")[0];
|
|
13
13
|
const dict = dicts[lang] || dicts[prefix] || dicts.en;
|
|
14
14
|
return dict[key] || en[key] || key;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { getAppVersion } from './url';
|
package/dist/utils/lang.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const CURRENT_LANG: string;
|
package/dist/utils/lang.js
CHANGED
|
@@ -25,6 +25,7 @@ function getBrowserLang(shortCode = true) {
|
|
|
25
25
|
const getCurrentLang = () => {
|
|
26
26
|
return localStorageService.get(LOCAL_STORAGE_KEY.LANG_CODE) || getBrowserLang(true);
|
|
27
27
|
};
|
|
28
|
+
const CURRENT_LANG = getCurrentLang();
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
CURRENT_LANG
|
|
30
31
|
};
|
package/dist/utils/url.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
signer: any | null;
|
|
4
|
-
lang?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const SDKConfig: SDKConfig;
|
|
7
|
-
export declare const initHanbiroReactSDK: ({ baseUrl, signer }: SDKConfig) => void;
|
|
8
|
-
export declare const setLibLang: (lang: string) => void;
|
|
1
|
+
export declare const getAppVersion: () => "v2" | "v3";
|
|
2
|
+
export declare const applyVersionAttribute: () => void;
|
|
9
3
|
export declare const isDevelopment: boolean;
|
|
10
4
|
export declare const getBaseUrl: () => string;
|
|
11
5
|
export declare const getGroupwareUrl: () => string;
|
|
12
|
-
export {};
|
package/dist/utils/url.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const getAppVersion = () => {
|
|
2
|
+
let locationInfo = window.location;
|
|
3
|
+
if (window.location !== window.parent.location) {
|
|
4
|
+
try {
|
|
5
|
+
locationInfo = window.parent.location;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
locationInfo = window.location;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return locationInfo.pathname.includes("/ngw/app") ? "v2" : "v3";
|
|
10
11
|
};
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
12
|
+
const applyVersionAttribute = () => {
|
|
13
|
+
if (typeof document === "undefined") return;
|
|
14
|
+
document.documentElement.setAttribute(
|
|
15
|
+
"data-hanbiro-sdk-version",
|
|
16
|
+
getAppVersion()
|
|
17
|
+
);
|
|
13
18
|
};
|
|
14
19
|
const checkDevelopment = () => {
|
|
15
20
|
const locationInfo = window.location;
|
|
@@ -22,16 +27,10 @@ const checkDevelopment = () => {
|
|
|
22
27
|
};
|
|
23
28
|
const isDevelopment = checkDevelopment();
|
|
24
29
|
const getBaseUrl = () => {
|
|
25
|
-
var _a;
|
|
26
30
|
let locationInfo = window.location;
|
|
27
31
|
const { host } = locationInfo;
|
|
28
32
|
if (isDevelopment) {
|
|
29
|
-
|
|
30
|
-
if (baseUrlArr) {
|
|
31
|
-
return "https://" + (baseUrlArr == null ? void 0 : baseUrlArr[2]);
|
|
32
|
-
} else {
|
|
33
|
-
return "https://vndev.hanbiro.com";
|
|
34
|
-
}
|
|
33
|
+
return "https://vndev.hanbiro.com";
|
|
35
34
|
} else {
|
|
36
35
|
const data = localStorage.getItem("host") || host;
|
|
37
36
|
const dataArr = data == null ? void 0 : data.split("/");
|
|
@@ -39,9 +38,8 @@ const getBaseUrl = () => {
|
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
export {
|
|
42
|
-
|
|
41
|
+
applyVersionAttribute,
|
|
42
|
+
getAppVersion,
|
|
43
43
|
getBaseUrl,
|
|
44
|
-
|
|
45
|
-
isDevelopment,
|
|
46
|
-
setLibLang
|
|
44
|
+
isDevelopment
|
|
47
45
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanbiro-react16-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "React 16.2.0 compatible UI components for Hanbiro",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/hanbiro-react16-sdk.umd.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"sideEffects": [
|
|
9
|
-
"**/*.css"
|
|
9
|
+
"**/*.css",
|
|
10
|
+
"./dist/index.js"
|
|
10
11
|
],
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|