hanbiro-react16-sdk 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +4 -1
- package/dist/hanbiro-react16-sdk.style.css +2 -2
- package/dist/hanbiro-react16-sdk.umd.js +96 -86
- package/dist/index.js +4 -3
- package/dist/utils/api.js +12 -4
- package/dist/utils/storage.d.ts +2 -1
- package/dist/utils/storage.js +1 -0
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { localStorageService, LOCAL_STORAGE_KEY } from "../utils/storage.js";
|
|
1
2
|
const AI_LANG_FLAGS = [
|
|
2
3
|
{
|
|
3
4
|
label: "English",
|
|
@@ -80,6 +81,8 @@ const AI_LANG_FLAGS = [
|
|
|
80
81
|
flagCode: "ru"
|
|
81
82
|
}
|
|
82
83
|
];
|
|
84
|
+
const IS_DEBUG = localStorageService.get(LOCAL_STORAGE_KEY.DEBUG) === "true";
|
|
83
85
|
export {
|
|
84
|
-
AI_LANG_FLAGS
|
|
86
|
+
AI_LANG_FLAGS,
|
|
87
|
+
IS_DEBUG
|
|
85
88
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.36
|
|
3
|
+
* Build Date: 2026-07-17
|
|
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'); }
|
|
@@ -217,6 +217,88 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
217
217
|
rnds[8] = rnds[8] & 63 | 128;
|
|
218
218
|
return unsafeStringify(rnds);
|
|
219
219
|
}
|
|
220
|
+
var LOCAL_STORAGE_KEY = /* @__PURE__ */function (LOCAL_STORAGE_KEY2) {
|
|
221
|
+
LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
|
|
222
|
+
LOCAL_STORAGE_KEY2["DEBUG"] = "debug";
|
|
223
|
+
return LOCAL_STORAGE_KEY2;
|
|
224
|
+
}(LOCAL_STORAGE_KEY || {});
|
|
225
|
+
var localStorageService = {
|
|
226
|
+
get: function get(key) {
|
|
227
|
+
return localStorage.getItem(key);
|
|
228
|
+
},
|
|
229
|
+
set: function set(key, value) {
|
|
230
|
+
localStorage.setItem(key, value);
|
|
231
|
+
},
|
|
232
|
+
remove: function remove(key) {
|
|
233
|
+
localStorage.removeItem(key);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var AI_LANG_FLAGS = [{
|
|
237
|
+
label: "English",
|
|
238
|
+
value: "en",
|
|
239
|
+
flagCode: "us"
|
|
240
|
+
}, {
|
|
241
|
+
label: "Korean",
|
|
242
|
+
value: "ko",
|
|
243
|
+
flagCode: "kr"
|
|
244
|
+
}, {
|
|
245
|
+
label: "Vietnamese",
|
|
246
|
+
value: "vi",
|
|
247
|
+
flagCode: "vn"
|
|
248
|
+
}, {
|
|
249
|
+
label: "Indonesian",
|
|
250
|
+
value: "id",
|
|
251
|
+
flagCode: "id"
|
|
252
|
+
}, {
|
|
253
|
+
label: "Chinese-Traditional",
|
|
254
|
+
value: "zh-cht",
|
|
255
|
+
flagCode: "cn"
|
|
256
|
+
}, {
|
|
257
|
+
label: "Chinese-Simplified",
|
|
258
|
+
value: "zh-chs",
|
|
259
|
+
flagCode: "cn"
|
|
260
|
+
}, {
|
|
261
|
+
label: "Japanese",
|
|
262
|
+
value: "ja",
|
|
263
|
+
flagCode: "jp"
|
|
264
|
+
}, {
|
|
265
|
+
label: "Thai",
|
|
266
|
+
value: "th",
|
|
267
|
+
flagCode: "th"
|
|
268
|
+
}, {
|
|
269
|
+
label: "Spanish",
|
|
270
|
+
value: "es",
|
|
271
|
+
flagCode: "es"
|
|
272
|
+
}, {
|
|
273
|
+
label: "French",
|
|
274
|
+
value: "fr",
|
|
275
|
+
flagCode: "fr"
|
|
276
|
+
}, {
|
|
277
|
+
label: "German",
|
|
278
|
+
value: "de",
|
|
279
|
+
flagCode: "de"
|
|
280
|
+
}, {
|
|
281
|
+
label: "Italian",
|
|
282
|
+
value: "it",
|
|
283
|
+
flagCode: "it"
|
|
284
|
+
}, {
|
|
285
|
+
label: "Dutch",
|
|
286
|
+
value: "nl",
|
|
287
|
+
flagCode: "nl"
|
|
288
|
+
}, {
|
|
289
|
+
label: "Portuguese",
|
|
290
|
+
value: "pt",
|
|
291
|
+
flagCode: "pt"
|
|
292
|
+
}, {
|
|
293
|
+
label: "Arabic",
|
|
294
|
+
value: "ar",
|
|
295
|
+
flagCode: "sa"
|
|
296
|
+
}, {
|
|
297
|
+
label: "Russian",
|
|
298
|
+
value: "ru",
|
|
299
|
+
flagCode: "ru"
|
|
300
|
+
}];
|
|
301
|
+
var IS_DEBUG = localStorageService.get(LOCAL_STORAGE_KEY.DEBUG) === "true";
|
|
220
302
|
var we = Object.defineProperty;
|
|
221
303
|
var X$1 = Object.getOwnPropertySymbols;
|
|
222
304
|
var me = Object.prototype.hasOwnProperty,
|
|
@@ -2149,9 +2231,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2149
2231
|
}, window.hanSessionStatus = L);
|
|
2150
2232
|
var getSigner = function getSigner() {
|
|
2151
2233
|
var _a2;
|
|
2152
|
-
var
|
|
2153
|
-
|
|
2154
|
-
|
|
2234
|
+
var parentHanSigCommon = (_a2 = window == null ? void 0 : window.parent) == null ? void 0 : _a2.HanSigCommon;
|
|
2235
|
+
var windowHanSigCommon = window == null ? void 0 : window.HanSigCommon;
|
|
2236
|
+
if (parentHanSigCommon) {
|
|
2237
|
+
if (IS_DEBUG) console.log("🚀 ~ use parent HanSigCommon!");
|
|
2238
|
+
return parentHanSigCommon;
|
|
2239
|
+
} else if (windowHanSigCommon) {
|
|
2240
|
+
if (IS_DEBUG) console.log("🚀 ~ use window HanSigCommon!");
|
|
2241
|
+
return windowHanSigCommon;
|
|
2155
2242
|
} else {
|
|
2156
2243
|
return new W({
|
|
2157
2244
|
baseUrl: getBaseUrl()
|
|
@@ -2165,14 +2252,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2165
2252
|
while (1) switch (_context22.n) {
|
|
2166
2253
|
case 0:
|
|
2167
2254
|
sigConfig = {
|
|
2168
|
-
method: "
|
|
2255
|
+
method: "GET",
|
|
2169
2256
|
baseURL: getBaseUrl(),
|
|
2170
2257
|
url: url
|
|
2171
2258
|
};
|
|
2259
|
+
if (IS_DEBUG) console.log("🚀 ~ sigConfig:", sigConfig);
|
|
2172
2260
|
_context22.n = 1;
|
|
2173
2261
|
return (_a2 = getSigner()) == null ? void 0 : _a2.generateHeaders(sigConfig);
|
|
2174
2262
|
case 1:
|
|
2175
2263
|
sigHeaders = _context22.v;
|
|
2264
|
+
if (IS_DEBUG) console.log("🚀 ~ sigHeaders:", sigHeaders);
|
|
2176
2265
|
_context22.n = 2;
|
|
2177
2266
|
return fetch(getBaseUrl() + url, {
|
|
2178
2267
|
headers: __spreadValues(__spreadValues({
|
|
@@ -7182,21 +7271,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7182
7271
|
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)"));
|
|
7183
7272
|
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ủ đề)"));
|
|
7184
7273
|
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, "(제목 없음)"));
|
|
7185
|
-
var LOCAL_STORAGE_KEY = /* @__PURE__ */function (LOCAL_STORAGE_KEY2) {
|
|
7186
|
-
LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
|
|
7187
|
-
return LOCAL_STORAGE_KEY2;
|
|
7188
|
-
}(LOCAL_STORAGE_KEY || {});
|
|
7189
|
-
var localStorageService = {
|
|
7190
|
-
get: function get(key) {
|
|
7191
|
-
return localStorage.getItem(key);
|
|
7192
|
-
},
|
|
7193
|
-
set: function set(key, value) {
|
|
7194
|
-
localStorage.setItem(key, value);
|
|
7195
|
-
},
|
|
7196
|
-
remove: function remove(key) {
|
|
7197
|
-
localStorage.removeItem(key);
|
|
7198
|
-
}
|
|
7199
|
-
};
|
|
7200
7274
|
function getBrowserLang() {
|
|
7201
7275
|
var shortCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
7202
7276
|
var language = navigator.language;
|
|
@@ -7345,71 +7419,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7345
7419
|
});
|
|
7346
7420
|
}));
|
|
7347
7421
|
};
|
|
7348
|
-
var AI_LANG_FLAGS = [{
|
|
7349
|
-
label: "English",
|
|
7350
|
-
value: "en",
|
|
7351
|
-
flagCode: "us"
|
|
7352
|
-
}, {
|
|
7353
|
-
label: "Korean",
|
|
7354
|
-
value: "ko",
|
|
7355
|
-
flagCode: "kr"
|
|
7356
|
-
}, {
|
|
7357
|
-
label: "Vietnamese",
|
|
7358
|
-
value: "vi",
|
|
7359
|
-
flagCode: "vn"
|
|
7360
|
-
}, {
|
|
7361
|
-
label: "Indonesian",
|
|
7362
|
-
value: "id",
|
|
7363
|
-
flagCode: "id"
|
|
7364
|
-
}, {
|
|
7365
|
-
label: "Chinese-Traditional",
|
|
7366
|
-
value: "zh-cht",
|
|
7367
|
-
flagCode: "cn"
|
|
7368
|
-
}, {
|
|
7369
|
-
label: "Chinese-Simplified",
|
|
7370
|
-
value: "zh-chs",
|
|
7371
|
-
flagCode: "cn"
|
|
7372
|
-
}, {
|
|
7373
|
-
label: "Japanese",
|
|
7374
|
-
value: "ja",
|
|
7375
|
-
flagCode: "jp"
|
|
7376
|
-
}, {
|
|
7377
|
-
label: "Thai",
|
|
7378
|
-
value: "th",
|
|
7379
|
-
flagCode: "th"
|
|
7380
|
-
}, {
|
|
7381
|
-
label: "Spanish",
|
|
7382
|
-
value: "es",
|
|
7383
|
-
flagCode: "es"
|
|
7384
|
-
}, {
|
|
7385
|
-
label: "French",
|
|
7386
|
-
value: "fr",
|
|
7387
|
-
flagCode: "fr"
|
|
7388
|
-
}, {
|
|
7389
|
-
label: "German",
|
|
7390
|
-
value: "de",
|
|
7391
|
-
flagCode: "de"
|
|
7392
|
-
}, {
|
|
7393
|
-
label: "Italian",
|
|
7394
|
-
value: "it",
|
|
7395
|
-
flagCode: "it"
|
|
7396
|
-
}, {
|
|
7397
|
-
label: "Dutch",
|
|
7398
|
-
value: "nl",
|
|
7399
|
-
flagCode: "nl"
|
|
7400
|
-
}, {
|
|
7401
|
-
label: "Portuguese",
|
|
7402
|
-
value: "pt",
|
|
7403
|
-
flagCode: "pt"
|
|
7404
|
-
}, {
|
|
7405
|
-
label: "Arabic",
|
|
7406
|
-
value: "ar",
|
|
7407
|
-
flagCode: "sa"
|
|
7408
|
-
}, {
|
|
7409
|
-
label: "Russian",
|
|
7410
|
-
value: "ru",
|
|
7411
|
-
flagCode: "ru"
|
|
7412
|
-
}];
|
|
7413
7422
|
var CNFlag = function CNFlag(props) {
|
|
7414
7423
|
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7415
7424
|
viewBox: "0 0 30 20"
|
|
@@ -12071,6 +12080,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
12071
12080
|
applyVersionAttribute();
|
|
12072
12081
|
exports2.AI_LANG_FLAGS = AI_LANG_FLAGS;
|
|
12073
12082
|
exports2.ChatAIDraft = ChatAIDraft;
|
|
12083
|
+
exports2.IS_DEBUG = IS_DEBUG;
|
|
12074
12084
|
exports2.LoadingContainer = LoadingContainer;
|
|
12075
12085
|
exports2.SummaryAIEmails = SummaryAIEmails;
|
|
12076
12086
|
exports2.getAppVersion = getAppVersion;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.36
|
|
3
|
+
* Build Date: 2026-07-17
|
|
4
4
|
*/
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { applyVersionAttribute } from "./utils/url.js";
|
|
7
7
|
import { getAppVersion } from "./utils/url.js";
|
|
8
|
-
import { AI_LANG_FLAGS } from "./constants/index.js";
|
|
8
|
+
import { AI_LANG_FLAGS, IS_DEBUG } from "./constants/index.js";
|
|
9
9
|
import { default as default2 } from "./components/ChatAIDraft/index.js";
|
|
10
10
|
import { default as default3 } from "./components/LoadingContainer/index.js";
|
|
11
11
|
import { default as default4 } from "./components/SummaryAIEmails/index.js";
|
|
@@ -13,6 +13,7 @@ applyVersionAttribute();
|
|
|
13
13
|
export {
|
|
14
14
|
AI_LANG_FLAGS,
|
|
15
15
|
default2 as ChatAIDraft,
|
|
16
|
+
IS_DEBUG,
|
|
16
17
|
default3 as LoadingContainer,
|
|
17
18
|
default4 as SummaryAIEmails,
|
|
18
19
|
getAppVersion
|
package/dist/utils/api.js
CHANGED
|
@@ -34,21 +34,29 @@ var __async = (__this, __arguments, generator) => {
|
|
|
34
34
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
import { IS_DEBUG } from "../constants/index.js";
|
|
37
38
|
import { getBaseUrl } from "./url.js";
|
|
38
39
|
import { ClientSigner as W } from "../node_modules/@hanbiro/signer-core/dist/index.js";
|
|
39
40
|
const getSigner = () => {
|
|
40
41
|
var _a;
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const parentHanSigCommon = (_a = window == null ? void 0 : window.parent) == null ? void 0 : _a.HanSigCommon;
|
|
43
|
+
const windowHanSigCommon = window == null ? void 0 : window.HanSigCommon;
|
|
44
|
+
if (parentHanSigCommon) {
|
|
45
|
+
if (IS_DEBUG) console.log("🚀 ~ use parent HanSigCommon!");
|
|
46
|
+
return parentHanSigCommon;
|
|
47
|
+
} else if (windowHanSigCommon) {
|
|
48
|
+
if (IS_DEBUG) console.log("🚀 ~ use window HanSigCommon!");
|
|
49
|
+
return windowHanSigCommon;
|
|
44
50
|
} else {
|
|
45
51
|
return new W({ baseUrl: getBaseUrl() });
|
|
46
52
|
}
|
|
47
53
|
};
|
|
48
54
|
const apiGet = (url, opts) => __async(void 0, null, function* () {
|
|
49
55
|
var _a;
|
|
50
|
-
const sigConfig = { method: "
|
|
56
|
+
const sigConfig = { method: "GET", baseURL: getBaseUrl(), url };
|
|
57
|
+
if (IS_DEBUG) console.log("🚀 ~ sigConfig:", sigConfig);
|
|
51
58
|
const sigHeaders = yield (_a = getSigner()) == null ? void 0 : _a.generateHeaders(sigConfig);
|
|
59
|
+
if (IS_DEBUG) console.log("🚀 ~ sigHeaders:", sigHeaders);
|
|
52
60
|
const response = yield fetch(getBaseUrl() + url, {
|
|
53
61
|
headers: __spreadValues(__spreadValues({
|
|
54
62
|
Accept: "application/json, text/plain, */*",
|
package/dist/utils/storage.d.ts
CHANGED
package/dist/utils/storage.js
CHANGED