hanbiro-react16-sdk 1.0.29 → 1.0.31
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/components/ChatAIDraft/CreatePanel/index.d.ts +0 -1
- package/dist/components/ChatAIDraft/CreatePanel/index.js +2 -1
- package/dist/components/ChatAIDraft/ReplyPanel/index.d.ts +0 -1
- package/dist/components/ChatAIDraft/ReplyPanel/index.js +2 -1
- package/dist/components/ChatAIDraft/index.d.ts +0 -2
- package/dist/components/ChatAIDraft/index.js +1 -7
- package/dist/components/SummaryAIEmails/index.d.ts +0 -2
- package/dist/components/SummaryAIEmails/index.js +2 -9
- package/dist/hanbiro-react16-sdk.style.css +11 -2
- package/dist/hanbiro-react16-sdk.umd.js +18 -19
- package/dist/index.js +2 -2
- package/dist/utils/url.d.ts +1 -0
- package/dist/utils/url.js +16 -0
- package/package.json +1 -1
|
@@ -45,6 +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 { SDKConfig } from "../../../utils/url.js";
|
|
48
49
|
import v4 from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
49
50
|
class CreatePanel extends React.Component {
|
|
50
51
|
constructor(props) {
|
|
@@ -108,7 +109,7 @@ class CreatePanel extends React.Component {
|
|
|
108
109
|
__publicField(this, "setTone", (tone) => this.setState({ tone }));
|
|
109
110
|
__publicField(this, "setLength", (length) => this.setState({ length }));
|
|
110
111
|
this.rootRef = React.createRef();
|
|
111
|
-
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) === SDKConfig.lang)) || AI_LANG_FLAGS[0];
|
|
112
113
|
this.state = {
|
|
113
114
|
message: "",
|
|
114
115
|
messages: [],
|
|
@@ -49,6 +49,7 @@ 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";
|
|
52
53
|
import { t } from "../../../lang/index.js";
|
|
53
54
|
import v4 from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
54
55
|
import { LangKey } from "../../../lang/keyLang.js";
|
|
@@ -180,7 +181,7 @@ class ReplyPanel extends React.Component {
|
|
|
180
181
|
__publicField(this, "setTone", (tone) => this.setState({ tone }));
|
|
181
182
|
__publicField(this, "setLength", (length) => this.setState({ length }));
|
|
182
183
|
this.rootRef = React.createRef();
|
|
183
|
-
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) === SDKConfig.lang)) || AI_LANG_FLAGS[0];
|
|
184
185
|
this.state = {
|
|
185
186
|
view: "empty",
|
|
186
187
|
sourceMail: null,
|
|
@@ -29,14 +29,8 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
import * as React from "react";
|
|
30
30
|
import CreatePanel from "./CreatePanel/index.js";
|
|
31
31
|
import ReplyPanel from "./ReplyPanel/index.js";
|
|
32
|
-
import { SDKConfig } from "../../utils/url.js";
|
|
33
32
|
const ChatAIDraft = (props) => {
|
|
34
|
-
const _a = props, { type = "new", sourceMid
|
|
35
|
-
React.useEffect(() => {
|
|
36
|
-
if (userLang) {
|
|
37
|
-
SDKConfig.lang = userLang;
|
|
38
|
-
}
|
|
39
|
-
}, [userLang]);
|
|
33
|
+
const _a = props, { type = "new", sourceMid } = _a, rest = __objRest(_a, ["type", "sourceMid"]);
|
|
40
34
|
if ((type === "reply" || type === "forward") && sourceMid) {
|
|
41
35
|
return /* @__PURE__ */ React.createElement(ReplyPanel, __spreadValues({ type, sourceMid }, rest));
|
|
42
36
|
}
|
|
@@ -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 { SDKConfig, 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";
|
|
@@ -95,7 +95,7 @@ class SummaryAIEmails extends React.Component {
|
|
|
95
95
|
this.setState({ langAnchor: null });
|
|
96
96
|
});
|
|
97
97
|
this.state = {
|
|
98
|
-
lang:
|
|
98
|
+
lang: SDKConfig.lang || "ko",
|
|
99
99
|
mailtype: "all",
|
|
100
100
|
page: 1,
|
|
101
101
|
items: [],
|
|
@@ -103,18 +103,11 @@ class SummaryAIEmails extends React.Component {
|
|
|
103
103
|
isLoading: false,
|
|
104
104
|
langAnchor: null
|
|
105
105
|
};
|
|
106
|
-
if (props.userLang) {
|
|
107
|
-
SDKConfig.lang = props.userLang;
|
|
108
|
-
}
|
|
109
106
|
}
|
|
110
107
|
componentDidMount() {
|
|
111
108
|
this.startStream();
|
|
112
109
|
}
|
|
113
110
|
componentDidUpdate(prevProps, prevState) {
|
|
114
|
-
if (this.props.userLang !== prevProps.userLang && this.props.userLang) {
|
|
115
|
-
SDKConfig.lang = this.props.userLang;
|
|
116
|
-
this.forceUpdate();
|
|
117
|
-
}
|
|
118
111
|
const targetChanged = prevProps.targetEmail !== this.props.targetEmail;
|
|
119
112
|
const filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
|
|
120
113
|
if (targetChanged || filterChanged) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-05-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.31
|
|
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.31
|
|
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'); }
|
|
@@ -216,11 +216,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
216
216
|
signer: null,
|
|
217
217
|
lang: getCurrentLang()
|
|
218
218
|
};
|
|
219
|
+
var getAppVersion = function getAppVersion() {
|
|
220
|
+
var locationInfo = window.location;
|
|
221
|
+
if (window.location !== window.parent.location) {
|
|
222
|
+
try {
|
|
223
|
+
locationInfo = window.parent.location;
|
|
224
|
+
} catch (e) {
|
|
225
|
+
locationInfo = window.location;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return locationInfo.pathname.includes("/ngw/app") ? "v2" : "v3";
|
|
229
|
+
};
|
|
219
230
|
var initHanbiroReactSDK = function initHanbiroReactSDK(_ref2) {
|
|
220
231
|
var baseUrl = _ref2.baseUrl,
|
|
221
232
|
signer = _ref2.signer;
|
|
222
233
|
SDKConfig.baseUrl = baseUrl;
|
|
223
234
|
SDKConfig.signer = signer;
|
|
235
|
+
document.documentElement.setAttribute("data-hanbiro-sdk-version", getAppVersion());
|
|
224
236
|
};
|
|
225
237
|
var setLibLang = function setLibLang(lang) {
|
|
226
238
|
if (lang) SDKConfig.lang = lang;
|
|
@@ -8009,7 +8021,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8009
8021
|
});
|
|
8010
8022
|
_this12.rootRef = React__namespace.createRef();
|
|
8011
8023
|
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
8012
|
-
return (_item == null ? void 0 : _item.value) ===
|
|
8024
|
+
return (_item == null ? void 0 : _item.value) === SDKConfig.lang;
|
|
8013
8025
|
})) || AI_LANG_FLAGS[0];
|
|
8014
8026
|
_this12.state = {
|
|
8015
8027
|
message: "",
|
|
@@ -9457,7 +9469,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9457
9469
|
});
|
|
9458
9470
|
_this19.rootRef = React__namespace.createRef();
|
|
9459
9471
|
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
9460
|
-
return (_item == null ? void 0 : _item.value) ===
|
|
9472
|
+
return (_item == null ? void 0 : _item.value) === SDKConfig.lang;
|
|
9461
9473
|
})) || AI_LANG_FLAGS[0];
|
|
9462
9474
|
_this19.state = {
|
|
9463
9475
|
view: "empty",
|
|
@@ -9567,13 +9579,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9567
9579
|
_a2$type = _a2.type,
|
|
9568
9580
|
type = _a2$type === void 0 ? "new" : _a2$type,
|
|
9569
9581
|
sourceMid = _a2.sourceMid,
|
|
9570
|
-
|
|
9571
|
-
rest = __objRest(_a2, ["type", "sourceMid", "userLang"]);
|
|
9572
|
-
React__namespace.useEffect(function () {
|
|
9573
|
-
if (userLang) {
|
|
9574
|
-
SDKConfig.lang = userLang;
|
|
9575
|
-
}
|
|
9576
|
-
}, [userLang]);
|
|
9582
|
+
rest = __objRest(_a2, ["type", "sourceMid"]);
|
|
9577
9583
|
if ((type === "reply" || type === "forward") && sourceMid) {
|
|
9578
9584
|
return /* @__PURE__ */React__namespace.createElement(ReplyPanel, __spreadValues({
|
|
9579
9585
|
type: type,
|
|
@@ -10022,7 +10028,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10022
10028
|
});
|
|
10023
10029
|
});
|
|
10024
10030
|
_this22.state = {
|
|
10025
|
-
lang:
|
|
10031
|
+
lang: SDKConfig.lang || "ko",
|
|
10026
10032
|
mailtype: "all",
|
|
10027
10033
|
page: 1,
|
|
10028
10034
|
items: [],
|
|
@@ -10030,9 +10036,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10030
10036
|
isLoading: false,
|
|
10031
10037
|
langAnchor: null
|
|
10032
10038
|
};
|
|
10033
|
-
if (props.userLang) {
|
|
10034
|
-
SDKConfig.lang = props.userLang;
|
|
10035
|
-
}
|
|
10036
10039
|
return _this22;
|
|
10037
10040
|
}
|
|
10038
10041
|
_inherits(SummaryAIEmails, _React__namespace$Com1);
|
|
@@ -10044,10 +10047,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10044
10047
|
}, {
|
|
10045
10048
|
key: "componentDidUpdate",
|
|
10046
10049
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
10047
|
-
if (this.props.userLang !== prevProps.userLang && this.props.userLang) {
|
|
10048
|
-
SDKConfig.lang = this.props.userLang;
|
|
10049
|
-
this.forceUpdate();
|
|
10050
|
-
}
|
|
10051
10050
|
var targetChanged = prevProps.targetEmail !== this.props.targetEmail;
|
|
10052
10051
|
var filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
|
|
10053
10052
|
if (targetChanged || filterChanged) {
|
package/dist/index.js
CHANGED
package/dist/utils/url.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface SDKConfig {
|
|
|
4
4
|
lang?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const SDKConfig: SDKConfig;
|
|
7
|
+
export declare const getAppVersion: () => "v2" | "v3";
|
|
7
8
|
export declare const initHanbiroReactSDK: ({ baseUrl, signer }: SDKConfig) => void;
|
|
8
9
|
export declare const setLibLang: (lang: string) => void;
|
|
9
10
|
export declare const isDevelopment: boolean;
|
package/dist/utils/url.js
CHANGED
|
@@ -4,9 +4,24 @@ const SDKConfig = {
|
|
|
4
4
|
signer: null,
|
|
5
5
|
lang: getCurrentLang()
|
|
6
6
|
};
|
|
7
|
+
const getAppVersion = () => {
|
|
8
|
+
let locationInfo = window.location;
|
|
9
|
+
if (window.location !== window.parent.location) {
|
|
10
|
+
try {
|
|
11
|
+
locationInfo = window.parent.location;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
locationInfo = window.location;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return locationInfo.pathname.includes("/ngw/app") ? "v2" : "v3";
|
|
17
|
+
};
|
|
7
18
|
const initHanbiroReactSDK = ({ baseUrl, signer }) => {
|
|
8
19
|
SDKConfig.baseUrl = baseUrl;
|
|
9
20
|
SDKConfig.signer = signer;
|
|
21
|
+
document.documentElement.setAttribute(
|
|
22
|
+
"data-hanbiro-sdk-version",
|
|
23
|
+
getAppVersion()
|
|
24
|
+
);
|
|
10
25
|
};
|
|
11
26
|
const setLibLang = (lang) => {
|
|
12
27
|
if (lang) SDKConfig.lang = lang;
|
|
@@ -40,6 +55,7 @@ const getBaseUrl = () => {
|
|
|
40
55
|
};
|
|
41
56
|
export {
|
|
42
57
|
SDKConfig,
|
|
58
|
+
getAppVersion,
|
|
43
59
|
getBaseUrl,
|
|
44
60
|
initHanbiroReactSDK,
|
|
45
61
|
isDevelopment,
|