hanbiro-react16-sdk 1.0.23 → 1.0.25
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/EmptyState.js +7 -5
- package/dist/components/ChatAIDraft/SettingPopper/ChipGroup.d.ts +11 -0
- package/dist/components/ChatAIDraft/SettingPopper/ChipGroup.js +62 -0
- package/dist/components/ChatAIDraft/SettingPopper/LanguageSelect.d.ts +21 -0
- package/dist/components/ChatAIDraft/SettingPopper/LanguageSelect.js +137 -0
- package/dist/components/ChatAIDraft/SettingPopper/icons.d.ts +3 -0
- package/dist/components/ChatAIDraft/SettingPopper/icons.js +30 -0
- package/dist/components/ChatAIDraft/{SettingPopper.d.ts → SettingPopper/index.d.ts} +1 -2
- package/dist/components/ChatAIDraft/SettingPopper/index.js +185 -0
- package/dist/components/ChatAIDraft/index.d.ts +3 -0
- package/dist/components/ChatAIDraft/index.js +26 -10
- package/dist/hanbiro-react16-sdk.style.css +1 -1
- package/dist/hanbiro-react16-sdk.umd.js +180 -142
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/ChatAIDraft/SettingPopper.js +0 -381
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
2
|
+
* hanbiro-react16-sdk v1.0.25
|
|
3
3
|
* Build Date: 2026-05-21
|
|
4
4
|
*/
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -4607,7 +4607,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4607
4607
|
display: "flex",
|
|
4608
4608
|
flexDirection: "column",
|
|
4609
4609
|
paddingRight: 8,
|
|
4610
|
-
marginRight: -8
|
|
4610
|
+
marginRight: -8,
|
|
4611
|
+
paddingBottom: 16
|
|
4611
4612
|
}
|
|
4612
4613
|
}, /* @__PURE__ */React__namespace.createElement("div", {
|
|
4613
4614
|
style: {
|
|
@@ -4630,18 +4631,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4630
4631
|
}, "Tell me what kind of email you'd like to write.")), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4631
4632
|
style: {
|
|
4632
4633
|
alignSelf: "center",
|
|
4633
|
-
width:
|
|
4634
|
-
height:
|
|
4634
|
+
width: 100,
|
|
4635
|
+
height: 100,
|
|
4635
4636
|
borderRadius: "50%",
|
|
4636
4637
|
background: "var(--primary-lighter)",
|
|
4637
4638
|
display: "flex",
|
|
4638
4639
|
alignItems: "center",
|
|
4639
4640
|
justifyContent: "center",
|
|
4640
4641
|
margin: "20px 0",
|
|
4641
|
-
color: "var(--primary-main)"
|
|
4642
|
+
color: "var(--primary-main)",
|
|
4643
|
+
flexShrink: 0
|
|
4642
4644
|
}
|
|
4643
4645
|
}, /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
|
|
4644
|
-
size:
|
|
4646
|
+
size: 52,
|
|
4645
4647
|
stroke: 1.5
|
|
4646
4648
|
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
4647
4649
|
style: {
|
|
@@ -4789,6 +4791,38 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4789
4791
|
}, _callee3);
|
|
4790
4792
|
}));
|
|
4791
4793
|
};
|
|
4794
|
+
var TONE_OPTIONS = [{
|
|
4795
|
+
label: "Formal",
|
|
4796
|
+
value: "formal"
|
|
4797
|
+
}, {
|
|
4798
|
+
label: "Polite",
|
|
4799
|
+
value: "polite"
|
|
4800
|
+
}, {
|
|
4801
|
+
label: "Neutral",
|
|
4802
|
+
value: "neutral"
|
|
4803
|
+
}, {
|
|
4804
|
+
label: "Friendly",
|
|
4805
|
+
value: "friendly"
|
|
4806
|
+
}, {
|
|
4807
|
+
label: "Firm",
|
|
4808
|
+
value: "firm"
|
|
4809
|
+
}, {
|
|
4810
|
+
label: "Apology",
|
|
4811
|
+
value: "apologetic"
|
|
4812
|
+
}];
|
|
4813
|
+
var LENGTH_OPTIONS = [{
|
|
4814
|
+
label: "Short",
|
|
4815
|
+
value: "short"
|
|
4816
|
+
}, {
|
|
4817
|
+
label: "Medium",
|
|
4818
|
+
value: "medium"
|
|
4819
|
+
}, {
|
|
4820
|
+
label: "Long",
|
|
4821
|
+
value: "long"
|
|
4822
|
+
}, {
|
|
4823
|
+
label: "1-liner",
|
|
4824
|
+
value: "one_liner"
|
|
4825
|
+
}];
|
|
4792
4826
|
var AI_LANG_FLAGS = [{
|
|
4793
4827
|
label: "English",
|
|
4794
4828
|
value: "en",
|
|
@@ -6419,38 +6453,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6419
6453
|
style: style
|
|
6420
6454
|
}, rest));
|
|
6421
6455
|
};
|
|
6422
|
-
var TONE_OPTIONS = [{
|
|
6423
|
-
label: "Formal",
|
|
6424
|
-
value: "formal"
|
|
6425
|
-
}, {
|
|
6426
|
-
label: "Polite",
|
|
6427
|
-
value: "polite"
|
|
6428
|
-
}, {
|
|
6429
|
-
label: "Neutral",
|
|
6430
|
-
value: "neutral"
|
|
6431
|
-
}, {
|
|
6432
|
-
label: "Friendly",
|
|
6433
|
-
value: "friendly"
|
|
6434
|
-
}, {
|
|
6435
|
-
label: "Firm",
|
|
6436
|
-
value: "firm"
|
|
6437
|
-
}, {
|
|
6438
|
-
label: "Apology",
|
|
6439
|
-
value: "apologetic"
|
|
6440
|
-
}];
|
|
6441
|
-
var LENGTH_OPTIONS = [{
|
|
6442
|
-
label: "Short",
|
|
6443
|
-
value: "short"
|
|
6444
|
-
}, {
|
|
6445
|
-
label: "Medium",
|
|
6446
|
-
value: "medium"
|
|
6447
|
-
}, {
|
|
6448
|
-
label: "Long",
|
|
6449
|
-
value: "long"
|
|
6450
|
-
}, {
|
|
6451
|
-
label: "1-liner",
|
|
6452
|
-
value: "one_liner"
|
|
6453
|
-
}];
|
|
6454
6456
|
var getFlagCode = function getFlagCode(value) {
|
|
6455
6457
|
var _a2;
|
|
6456
6458
|
return (_a2 = AI_LANG_FLAGS.find(function (l) {
|
|
@@ -6601,6 +6603,57 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6601
6603
|
}
|
|
6602
6604
|
}]);
|
|
6603
6605
|
}(React__namespace.Component);
|
|
6606
|
+
var ChipGroup = function ChipGroup(_ref28) {
|
|
6607
|
+
var options = _ref28.options,
|
|
6608
|
+
selected = _ref28.selected,
|
|
6609
|
+
onSelect = _ref28.onSelect,
|
|
6610
|
+
iconMap = _ref28.iconMap,
|
|
6611
|
+
_ref28$columns = _ref28.columns,
|
|
6612
|
+
columns = _ref28$columns === void 0 ? 3 : _ref28$columns;
|
|
6613
|
+
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
6614
|
+
style: {
|
|
6615
|
+
display: "grid",
|
|
6616
|
+
gridTemplateColumns: "repeat(".concat(columns, ", minmax(0, 1fr))"),
|
|
6617
|
+
gap: 6
|
|
6618
|
+
}
|
|
6619
|
+
}, options.map(function (opt) {
|
|
6620
|
+
var isActive = (selected == null ? void 0 : selected.value) === opt.value;
|
|
6621
|
+
return /* @__PURE__ */React__namespace.createElement("button", {
|
|
6622
|
+
key: opt.value,
|
|
6623
|
+
type: "button",
|
|
6624
|
+
onClick: function onClick() {
|
|
6625
|
+
return onSelect(opt);
|
|
6626
|
+
},
|
|
6627
|
+
style: {
|
|
6628
|
+
display: "flex",
|
|
6629
|
+
alignItems: "center",
|
|
6630
|
+
justifyContent: "center",
|
|
6631
|
+
gap: 6,
|
|
6632
|
+
padding: "8px 10px",
|
|
6633
|
+
borderRadius: 4,
|
|
6634
|
+
border: isActive ? "1px solid var(--primary-main)" : "1px solid var(--border-main)",
|
|
6635
|
+
background: isActive ? "var(--primary-lighter)" : "#fff",
|
|
6636
|
+
color: isActive ? "var(--primary-main)" : "var(--text-primary)",
|
|
6637
|
+
fontWeight: isActive ? 600 : 400,
|
|
6638
|
+
fontSize: 13,
|
|
6639
|
+
cursor: "pointer",
|
|
6640
|
+
fontFamily: "inherit",
|
|
6641
|
+
transition: "background 0.15s, border-color 0.15s",
|
|
6642
|
+
minWidth: 0
|
|
6643
|
+
}
|
|
6644
|
+
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6645
|
+
style: {
|
|
6646
|
+
display: "inline-flex",
|
|
6647
|
+
alignItems: "center",
|
|
6648
|
+
flexShrink: 0
|
|
6649
|
+
}
|
|
6650
|
+
}, iconMap[opt.value]), /* @__PURE__ */React__namespace.createElement("span", {
|
|
6651
|
+
style: {
|
|
6652
|
+
whiteSpace: "nowrap"
|
|
6653
|
+
}
|
|
6654
|
+
}, opt.label));
|
|
6655
|
+
}));
|
|
6656
|
+
};
|
|
6604
6657
|
var ICON_SIZE = 14;
|
|
6605
6658
|
var TONE_ICONS = {
|
|
6606
6659
|
formal: /* @__PURE__ */React__namespace.createElement(Award, {
|
|
@@ -6655,7 +6708,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6655
6708
|
_yield$apiGet = _context4.v;
|
|
6656
6709
|
data = _yield$apiGet.data;
|
|
6657
6710
|
if (data == null ? void 0 : data.list) {
|
|
6658
|
-
langs = (_a2 = Object.keys(data == null ? void 0 : data.list)) == null ? void 0 : _a2.map(function (_key
|
|
6711
|
+
langs = (_a2 = Object.keys(data == null ? void 0 : data.list)) == null ? void 0 : _a2.map(function (_key) {
|
|
6659
6712
|
var _a3;
|
|
6660
6713
|
var _item = (_a3 = data == null ? void 0 : data.list) == null ? void 0 : _a3[_key];
|
|
6661
6714
|
return {
|
|
@@ -6688,52 +6741,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6688
6741
|
};
|
|
6689
6742
|
});
|
|
6690
6743
|
});
|
|
6691
|
-
__publicField(_this10, "renderChipGroup", function (options, selected, onSelect, iconMap) {
|
|
6692
|
-
var columns = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 3;
|
|
6693
|
-
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
6694
|
-
style: {
|
|
6695
|
-
display: "grid",
|
|
6696
|
-
gridTemplateColumns: "repeat(".concat(columns, ", minmax(0, 1fr))"),
|
|
6697
|
-
gap: 6
|
|
6698
|
-
}
|
|
6699
|
-
}, options.map(function (opt) {
|
|
6700
|
-
var isActive = (selected == null ? void 0 : selected.value) === opt.value;
|
|
6701
|
-
return /* @__PURE__ */React__namespace.createElement("button", {
|
|
6702
|
-
key: opt.value,
|
|
6703
|
-
type: "button",
|
|
6704
|
-
onClick: function onClick() {
|
|
6705
|
-
return onSelect(opt);
|
|
6706
|
-
},
|
|
6707
|
-
style: {
|
|
6708
|
-
display: "flex",
|
|
6709
|
-
alignItems: "center",
|
|
6710
|
-
justifyContent: "center",
|
|
6711
|
-
gap: 6,
|
|
6712
|
-
padding: "8px 10px",
|
|
6713
|
-
borderRadius: 4,
|
|
6714
|
-
border: isActive ? "1px solid var(--primary-main)" : "1px solid var(--border-main)",
|
|
6715
|
-
background: isActive ? "var(--primary-lighter)" : "#fff",
|
|
6716
|
-
color: isActive ? "var(--primary-main)" : "var(--text-primary)",
|
|
6717
|
-
fontWeight: isActive ? 600 : 400,
|
|
6718
|
-
fontSize: 13,
|
|
6719
|
-
cursor: "pointer",
|
|
6720
|
-
fontFamily: "inherit",
|
|
6721
|
-
transition: "background 0.15s, border-color 0.15s",
|
|
6722
|
-
minWidth: 0
|
|
6723
|
-
}
|
|
6724
|
-
}, /* @__PURE__ */React__namespace.createElement("span", {
|
|
6725
|
-
style: {
|
|
6726
|
-
display: "inline-flex",
|
|
6727
|
-
alignItems: "center",
|
|
6728
|
-
flexShrink: 0
|
|
6729
|
-
}
|
|
6730
|
-
}, iconMap[opt.value]), /* @__PURE__ */React__namespace.createElement("span", {
|
|
6731
|
-
style: {
|
|
6732
|
-
whiteSpace: "nowrap"
|
|
6733
|
-
}
|
|
6734
|
-
}, opt.label));
|
|
6735
|
-
}));
|
|
6736
|
-
});
|
|
6737
6744
|
_this10.state = {
|
|
6738
6745
|
open: false,
|
|
6739
6746
|
languageOptions: []
|
|
@@ -6757,12 +6764,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6757
6764
|
}, {
|
|
6758
6765
|
key: "render",
|
|
6759
6766
|
value: function render() {
|
|
6760
|
-
var _this11 = this;
|
|
6761
6767
|
var _this$props4 = this.props,
|
|
6762
6768
|
lang = _this$props4.lang,
|
|
6763
6769
|
tone = _this$props4.tone,
|
|
6764
6770
|
length = _this$props4.length,
|
|
6765
|
-
parentRef = _this$props4.parentRef
|
|
6771
|
+
parentRef = _this$props4.parentRef,
|
|
6772
|
+
setLang = _this$props4.setLang,
|
|
6773
|
+
setTone = _this$props4.setTone,
|
|
6774
|
+
setLength = _this$props4.setLength;
|
|
6766
6775
|
var _this$state2 = this.state,
|
|
6767
6776
|
open = _this$state2.open,
|
|
6768
6777
|
languageOptions = _this$state2.languageOptions;
|
|
@@ -6828,7 +6837,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6828
6837
|
value: lang,
|
|
6829
6838
|
options: languageOptions,
|
|
6830
6839
|
onChange: function onChange(opt) {
|
|
6831
|
-
return
|
|
6840
|
+
return setLang(opt);
|
|
6832
6841
|
}
|
|
6833
6842
|
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6834
6843
|
style: {
|
|
@@ -6841,9 +6850,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6841
6850
|
fontSize: 12,
|
|
6842
6851
|
fontWeight: 600
|
|
6843
6852
|
}
|
|
6844
|
-
}, "Tone"),
|
|
6845
|
-
|
|
6846
|
-
|
|
6853
|
+
}, "Tone"), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
|
|
6854
|
+
options: TONE_OPTIONS,
|
|
6855
|
+
selected: tone,
|
|
6856
|
+
onSelect: function onSelect(opt) {
|
|
6857
|
+
return setTone(opt);
|
|
6858
|
+
},
|
|
6859
|
+
iconMap: TONE_ICONS
|
|
6860
|
+
})), /* @__PURE__ */React__namespace.createElement("div", {
|
|
6847
6861
|
style: {
|
|
6848
6862
|
display: "flex",
|
|
6849
6863
|
flexDirection: "column",
|
|
@@ -6854,26 +6868,39 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6854
6868
|
fontSize: 12,
|
|
6855
6869
|
fontWeight: 600
|
|
6856
6870
|
}
|
|
6857
|
-
}, "Length"),
|
|
6858
|
-
|
|
6859
|
-
|
|
6871
|
+
}, "Length"), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
|
|
6872
|
+
options: LENGTH_OPTIONS,
|
|
6873
|
+
selected: length,
|
|
6874
|
+
onSelect: function onSelect(opt) {
|
|
6875
|
+
return setLength(opt);
|
|
6876
|
+
},
|
|
6877
|
+
iconMap: LENGTH_ICONS,
|
|
6878
|
+
columns: 4
|
|
6879
|
+
})))), document.body));
|
|
6860
6880
|
}
|
|
6861
6881
|
}]);
|
|
6862
6882
|
}(React__namespace.Component);
|
|
6863
6883
|
var ChatAIDraft = /*#__PURE__*/function (_React__namespace$Com4) {
|
|
6864
6884
|
function ChatAIDraft(props) {
|
|
6865
|
-
var
|
|
6885
|
+
var _this11;
|
|
6866
6886
|
_classCallCheck(this, ChatAIDraft);
|
|
6867
|
-
|
|
6868
|
-
__publicField(
|
|
6869
|
-
__publicField(
|
|
6870
|
-
|
|
6887
|
+
_this11 = _callSuper(this, ChatAIDraft, [props]);
|
|
6888
|
+
__publicField(_this11, "rootRef");
|
|
6889
|
+
__publicField(_this11, "textareaRef");
|
|
6890
|
+
__publicField(_this11, "adjustTextareaHeight", function () {
|
|
6891
|
+
var el = _this11.textareaRef.current;
|
|
6892
|
+
if (!el) return;
|
|
6893
|
+
el.style.height = "auto";
|
|
6894
|
+
el.style.height = "".concat(Math.min(el.scrollHeight, 160), "px");
|
|
6895
|
+
});
|
|
6896
|
+
__publicField(_this11, "handleMessageChange", function (e) {
|
|
6897
|
+
_this11.setState({
|
|
6871
6898
|
message: e.target.value
|
|
6872
|
-
});
|
|
6899
|
+
}, _this11.adjustTextareaHeight);
|
|
6873
6900
|
});
|
|
6874
|
-
__publicField(
|
|
6875
|
-
return __async(
|
|
6876
|
-
var
|
|
6901
|
+
__publicField(_this11, "handleSubmit", function () {
|
|
6902
|
+
return __async(_this11, null, /*#__PURE__*/_regenerator().m(function _callee5() {
|
|
6903
|
+
var _this12 = this;
|
|
6877
6904
|
var _this$state3, message, messages, lang, tone, length, conversationId, newId, newMessage, currentItems, params, setContent, setIsLoading, setConversationId;
|
|
6878
6905
|
return _regenerator().w(function (_context5) {
|
|
6879
6906
|
while (1) switch (_context5.n) {
|
|
@@ -6915,7 +6942,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6915
6942
|
params.conversation_id = conversationId;
|
|
6916
6943
|
}
|
|
6917
6944
|
setContent = function setContent(nContent) {
|
|
6918
|
-
|
|
6945
|
+
_this12.setState(function (prevState) {
|
|
6919
6946
|
var updatedMessages = prevState.messages.map(function (m) {
|
|
6920
6947
|
return m.id === newId ? __spreadProps(__spreadValues({}, m), {
|
|
6921
6948
|
subject: "Some thing not used",
|
|
@@ -6930,7 +6957,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6930
6957
|
});
|
|
6931
6958
|
};
|
|
6932
6959
|
setIsLoading = function setIsLoading(loading) {
|
|
6933
|
-
|
|
6960
|
+
_this12.setState(function (prevState) {
|
|
6934
6961
|
var updatedMessages = prevState.messages.map(function (m) {
|
|
6935
6962
|
return m.id === newId ? __spreadProps(__spreadValues({}, m), {
|
|
6936
6963
|
isLoading: loading
|
|
@@ -6942,7 +6969,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6942
6969
|
});
|
|
6943
6970
|
};
|
|
6944
6971
|
setConversationId = function setConversationId(id) {
|
|
6945
|
-
|
|
6972
|
+
_this12.setState({
|
|
6946
6973
|
conversationId: id
|
|
6947
6974
|
});
|
|
6948
6975
|
};
|
|
@@ -6962,49 +6989,57 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
6962
6989
|
}, _callee5, this);
|
|
6963
6990
|
}));
|
|
6964
6991
|
});
|
|
6965
|
-
__publicField(
|
|
6966
|
-
if (!event.shiftKey && event.key === "Enter" && !
|
|
6992
|
+
__publicField(_this11, "handleKeyDown", function (event) {
|
|
6993
|
+
if (!event.shiftKey && event.key === "Enter" && !_this11.state.isSending) {
|
|
6967
6994
|
event.preventDefault();
|
|
6968
|
-
|
|
6995
|
+
_this11.handleSubmit();
|
|
6969
6996
|
}
|
|
6970
6997
|
});
|
|
6971
|
-
__publicField(
|
|
6972
|
-
|
|
6998
|
+
__publicField(_this11, "setLang", function (lang) {
|
|
6999
|
+
_this11.setState({
|
|
6973
7000
|
lang: lang
|
|
6974
7001
|
});
|
|
6975
7002
|
});
|
|
6976
|
-
__publicField(
|
|
6977
|
-
|
|
7003
|
+
__publicField(_this11, "setTone", function (tone) {
|
|
7004
|
+
_this11.setState({
|
|
6978
7005
|
tone: tone
|
|
6979
7006
|
});
|
|
6980
7007
|
});
|
|
6981
|
-
__publicField(
|
|
6982
|
-
|
|
7008
|
+
__publicField(_this11, "setLength", function (length) {
|
|
7009
|
+
_this11.setState({
|
|
6983
7010
|
length: length
|
|
6984
7011
|
});
|
|
6985
7012
|
});
|
|
6986
|
-
|
|
7013
|
+
_this11.rootRef = React__namespace.createRef();
|
|
7014
|
+
_this11.textareaRef = React__namespace.createRef();
|
|
6987
7015
|
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
6988
7016
|
return (_item == null ? void 0 : _item.value) === (props == null ? void 0 : props.defaultLang);
|
|
6989
7017
|
})) || AI_LANG_FLAGS[0];
|
|
6990
|
-
|
|
7018
|
+
_this11.state = {
|
|
6991
7019
|
message: "",
|
|
6992
7020
|
messages: [],
|
|
6993
7021
|
isSending: false,
|
|
6994
7022
|
lang: lang,
|
|
6995
7023
|
tone: TONE_OPTIONS[2],
|
|
6996
7024
|
// Neutral
|
|
6997
|
-
length: LENGTH_OPTIONS[
|
|
6998
|
-
//
|
|
7025
|
+
length: LENGTH_OPTIONS[2],
|
|
7026
|
+
// Long
|
|
6999
7027
|
conversationId: ""
|
|
7000
7028
|
};
|
|
7001
|
-
return
|
|
7029
|
+
return _this11;
|
|
7002
7030
|
}
|
|
7003
7031
|
_inherits(ChatAIDraft, _React__namespace$Com4);
|
|
7004
7032
|
return _createClass(ChatAIDraft, [{
|
|
7033
|
+
key: "componentDidUpdate",
|
|
7034
|
+
value: function componentDidUpdate(_, prevState) {
|
|
7035
|
+
if (prevState.message !== this.state.message) {
|
|
7036
|
+
this.adjustTextareaHeight();
|
|
7037
|
+
}
|
|
7038
|
+
}
|
|
7039
|
+
}, {
|
|
7005
7040
|
key: "render",
|
|
7006
7041
|
value: function render() {
|
|
7007
|
-
var
|
|
7042
|
+
var _this13 = this;
|
|
7008
7043
|
var _a2;
|
|
7009
7044
|
var _this$props5 = this.props,
|
|
7010
7045
|
onApply = _this$props5.onApply,
|
|
@@ -7036,7 +7071,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7036
7071
|
getEditorContent: getEditorContent
|
|
7037
7072
|
}) : /* @__PURE__ */React__namespace.createElement(EmptyState, {
|
|
7038
7073
|
onSelectPrompt: function onSelectPrompt(text) {
|
|
7039
|
-
return
|
|
7074
|
+
return _this13.setState({
|
|
7040
7075
|
message: text
|
|
7041
7076
|
});
|
|
7042
7077
|
}
|
|
@@ -7047,15 +7082,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7047
7082
|
overflow: "hidden",
|
|
7048
7083
|
background: "var(--background-softGrey)",
|
|
7049
7084
|
display: "flex",
|
|
7050
|
-
flexDirection: "column"
|
|
7085
|
+
flexDirection: "column",
|
|
7086
|
+
border: "1px solid var(--border-light)"
|
|
7051
7087
|
}
|
|
7052
7088
|
}, /* @__PURE__ */React__namespace.createElement("textarea", {
|
|
7089
|
+
ref: this.textareaRef,
|
|
7053
7090
|
value: message,
|
|
7054
7091
|
onChange: this.handleMessageChange,
|
|
7055
|
-
placeholder: "Describe your email",
|
|
7092
|
+
placeholder: "Describe your email...",
|
|
7056
7093
|
name: "ai-content",
|
|
7057
7094
|
onKeyDown: this.handleKeyDown,
|
|
7058
7095
|
disabled: isSending,
|
|
7096
|
+
rows: 1,
|
|
7059
7097
|
style: {
|
|
7060
7098
|
flex: 1,
|
|
7061
7099
|
minWidth: 0,
|
|
@@ -7064,9 +7102,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7064
7102
|
border: "none",
|
|
7065
7103
|
resize: "none",
|
|
7066
7104
|
outline: "none",
|
|
7067
|
-
minHeight: 60,
|
|
7068
7105
|
fontFamily: "inherit",
|
|
7069
|
-
background: "transparent"
|
|
7106
|
+
background: "transparent",
|
|
7107
|
+
overflowY: "auto"
|
|
7070
7108
|
}
|
|
7071
7109
|
}), /* @__PURE__ */React__namespace.createElement("div", {
|
|
7072
7110
|
style: {
|
|
@@ -7119,8 +7157,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7119
7157
|
onClick: this.handleSubmit,
|
|
7120
7158
|
style: {
|
|
7121
7159
|
marginLeft: "auto",
|
|
7122
|
-
width:
|
|
7123
|
-
height:
|
|
7160
|
+
width: 28,
|
|
7161
|
+
height: 28,
|
|
7124
7162
|
borderRadius: "50%",
|
|
7125
7163
|
border: "none",
|
|
7126
7164
|
display: "flex",
|
|
@@ -7137,13 +7175,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7137
7175
|
}
|
|
7138
7176
|
}]);
|
|
7139
7177
|
}(React__namespace.Component);
|
|
7140
|
-
var LoadingCircular = function LoadingCircular(
|
|
7141
|
-
var
|
|
7142
|
-
size =
|
|
7143
|
-
|
|
7144
|
-
color =
|
|
7145
|
-
|
|
7146
|
-
thickness =
|
|
7178
|
+
var LoadingCircular = function LoadingCircular(_ref29) {
|
|
7179
|
+
var _ref29$size = _ref29.size,
|
|
7180
|
+
size = _ref29$size === void 0 ? 40 : _ref29$size,
|
|
7181
|
+
_ref29$color = _ref29.color,
|
|
7182
|
+
color = _ref29$color === void 0 ? "var(--primary-main)" : _ref29$color,
|
|
7183
|
+
_ref29$thickness = _ref29.thickness,
|
|
7184
|
+
thickness = _ref29$thickness === void 0 ? 3.6 : _ref29$thickness;
|
|
7147
7185
|
var radius = 20;
|
|
7148
7186
|
var circumference = 2 * Math.PI * radius;
|
|
7149
7187
|
return /* @__PURE__ */React.createElement("div", {
|
|
@@ -7175,13 +7213,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
7175
7213
|
small: 28,
|
|
7176
7214
|
medium: 40
|
|
7177
7215
|
};
|
|
7178
|
-
var LoadingContainer = function LoadingContainer(
|
|
7179
|
-
var style =
|
|
7180
|
-
|
|
7181
|
-
fullHeight =
|
|
7182
|
-
|
|
7183
|
-
size =
|
|
7184
|
-
label =
|
|
7216
|
+
var LoadingContainer = function LoadingContainer(_ref30) {
|
|
7217
|
+
var style = _ref30.style,
|
|
7218
|
+
_ref30$fullHeight = _ref30.fullHeight,
|
|
7219
|
+
fullHeight = _ref30$fullHeight === void 0 ? false : _ref30$fullHeight,
|
|
7220
|
+
_ref30$size = _ref30.size,
|
|
7221
|
+
size = _ref30$size === void 0 ? "medium" : _ref30$size,
|
|
7222
|
+
label = _ref30.label;
|
|
7185
7223
|
return /* @__PURE__ */React.createElement("div", {
|
|
7186
7224
|
style: __spreadValues({
|
|
7187
7225
|
display: "flex",
|
package/dist/index.js
CHANGED