hanbiro-react16-sdk 1.0.29 → 1.0.30

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.
@@ -2,7 +2,6 @@ import { LabelValue } from '../../../types';
2
2
  import { AIMessage } from '../types';
3
3
  import * as React from "react";
4
4
  export interface CreatePanelProps {
5
- defaultLang?: string;
6
5
  getEditorContent?: () => string;
7
6
  onApply: (params: {
8
7
  html: string;
@@ -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) === (props == null ? void 0 : props.defaultLang))) || AI_LANG_FLAGS[0];
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: [],
@@ -5,7 +5,6 @@ import * as React from "react";
5
5
  export interface ReplyPanelProps {
6
6
  type: ChatType;
7
7
  sourceMid: string;
8
- defaultLang?: string;
9
8
  getEditorContent?: () => string;
10
9
  onApply: (params: {
11
10
  html: string;
@@ -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) === (props == null ? void 0 : props.defaultLang))) || AI_LANG_FLAGS[0];
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,
@@ -3,8 +3,6 @@ import * as React from "react";
3
3
  export interface ChatAIDraftProps {
4
4
  type?: ChatType;
5
5
  sourceMid?: string;
6
- defaultLang?: string;
7
- userLang?: string;
8
6
  getEditorContent?: () => string;
9
7
  onApply: (params: {
10
8
  html: string;
@@ -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, userLang } = _a, rest = __objRest(_a, ["type", "sourceMid", "userLang"]);
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
  }
@@ -4,9 +4,7 @@ import * as React from "react";
4
4
  export interface SummaryAIEmailsProps {
5
5
  targetEmail: string;
6
6
  targetName?: string;
7
- defaultLang?: string;
8
7
  langList?: LabelValue[];
9
- userLang?: string;
10
8
  }
11
9
  interface SummaryAIEmailsState {
12
10
  lang: string;
@@ -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 { getBaseUrl, SDKConfig } from "../../utils/url.js";
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: props.defaultLang || "ko",
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,5 +1,5 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.29
2
+ * hanbiro-react16-sdk v1.0.30
3
3
  * Build Date: 2026-05-22
4
4
  */
5
5
  @charset "UTF-8";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.29
2
+ * hanbiro-react16-sdk v1.0.30
3
3
  * Build Date: 2026-05-22
4
4
  */
5
5
  function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
@@ -8009,7 +8009,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8009
8009
  });
8010
8010
  _this12.rootRef = React__namespace.createRef();
8011
8011
  var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
8012
- return (_item == null ? void 0 : _item.value) === (props == null ? void 0 : props.defaultLang);
8012
+ return (_item == null ? void 0 : _item.value) === SDKConfig.lang;
8013
8013
  })) || AI_LANG_FLAGS[0];
8014
8014
  _this12.state = {
8015
8015
  message: "",
@@ -9457,7 +9457,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9457
9457
  });
9458
9458
  _this19.rootRef = React__namespace.createRef();
9459
9459
  var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
9460
- return (_item == null ? void 0 : _item.value) === (props == null ? void 0 : props.defaultLang);
9460
+ return (_item == null ? void 0 : _item.value) === SDKConfig.lang;
9461
9461
  })) || AI_LANG_FLAGS[0];
9462
9462
  _this19.state = {
9463
9463
  view: "empty",
@@ -9567,13 +9567,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9567
9567
  _a2$type = _a2.type,
9568
9568
  type = _a2$type === void 0 ? "new" : _a2$type,
9569
9569
  sourceMid = _a2.sourceMid,
9570
- userLang = _a2.userLang,
9571
- rest = __objRest(_a2, ["type", "sourceMid", "userLang"]);
9572
- React__namespace.useEffect(function () {
9573
- if (userLang) {
9574
- SDKConfig.lang = userLang;
9575
- }
9576
- }, [userLang]);
9570
+ rest = __objRest(_a2, ["type", "sourceMid"]);
9577
9571
  if ((type === "reply" || type === "forward") && sourceMid) {
9578
9572
  return /* @__PURE__ */React__namespace.createElement(ReplyPanel, __spreadValues({
9579
9573
  type: type,
@@ -10022,7 +10016,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10022
10016
  });
10023
10017
  });
10024
10018
  _this22.state = {
10025
- lang: props.defaultLang || "ko",
10019
+ lang: SDKConfig.lang || "ko",
10026
10020
  mailtype: "all",
10027
10021
  page: 1,
10028
10022
  items: [],
@@ -10030,9 +10024,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10030
10024
  isLoading: false,
10031
10025
  langAnchor: null
10032
10026
  };
10033
- if (props.userLang) {
10034
- SDKConfig.lang = props.userLang;
10035
- }
10036
10027
  return _this22;
10037
10028
  }
10038
10029
  _inherits(SummaryAIEmails, _React__namespace$Com1);
@@ -10044,10 +10035,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10044
10035
  }, {
10045
10036
  key: "componentDidUpdate",
10046
10037
  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
10038
  var targetChanged = prevProps.targetEmail !== this.props.targetEmail;
10052
10039
  var filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
10053
10040
  if (targetChanged || filterChanged) {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.29
2
+ * hanbiro-react16-sdk v1.0.30
3
3
  * Build Date: 2026-05-22
4
4
  */
5
5
  /* empty css */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hanbiro-react16-sdk",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
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",