hanbiro-react16-sdk 1.0.27 → 1.0.29
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 +58 -5
- package/dist/components/ChatAIDraft/ChatInput.js +3 -1
- package/dist/components/ChatAIDraft/ChatList/LoadingDots.js +4 -3
- package/dist/components/ChatAIDraft/ChatList/MessageItem.js +7 -5
- package/dist/components/ChatAIDraft/CreatePanel/EmptyState.js +15 -15
- package/dist/components/ChatAIDraft/CreatePanel/index.js +3 -3
- package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.d.ts +15 -0
- package/dist/components/ChatAIDraft/ReplyPanel/BaseModal.js +101 -0
- package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.d.ts +13 -0
- package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.js +65 -0
- package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.d.ts +1 -8
- package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.js +11 -227
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.d.ts +10 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SelectedChip.js +79 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.d.ts +8 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/SourceCard.js +52 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/index.d.ts +12 -0
- package/dist/components/ChatAIDraft/ReplyPanel/Header/index.js +139 -0
- package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.d.ts +1 -0
- package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.js +71 -155
- package/dist/components/ChatAIDraft/ReplyPanel/index.d.ts +5 -1
- package/dist/components/ChatAIDraft/ReplyPanel/index.js +42 -201
- package/dist/components/ChatAIDraft/SettingPopper/index.js +8 -6
- package/dist/components/ChatAIDraft/constants.d.ts +2 -2
- package/dist/components/ChatAIDraft/constants.js +16 -14
- package/dist/components/ChatAIDraft/index.d.ts +1 -0
- package/dist/components/ChatAIDraft/index.js +7 -1
- package/dist/components/Pagination/index.d.ts +20 -0
- package/dist/components/Pagination/index.js +133 -0
- package/dist/components/SummaryAIEmails/FilterTabs.d.ts +8 -0
- package/dist/components/SummaryAIEmails/FilterTabs.js +59 -0
- package/dist/components/SummaryAIEmails/LanguagePopover.d.ts +24 -0
- package/dist/components/SummaryAIEmails/LanguagePopover.js +110 -0
- package/dist/components/SummaryAIEmails/SummaryItem.d.ts +7 -0
- package/dist/components/SummaryAIEmails/SummaryItem.js +76 -0
- package/dist/components/SummaryAIEmails/TargetInfoBar.d.ts +9 -0
- package/dist/components/SummaryAIEmails/TargetInfoBar.js +81 -0
- package/dist/components/SummaryAIEmails/index.d.ts +35 -0
- package/dist/components/SummaryAIEmails/index.js +222 -0
- package/dist/components/SummaryAIEmails/types.d.ts +16 -0
- package/dist/components/SummaryAIEmails/utils.d.ts +12 -0
- package/dist/components/SummaryAIEmails/utils.js +47 -0
- package/dist/components/index.d.ts +2 -4
- package/dist/hanbiro-react16-sdk.style.css +7 -2
- package/dist/hanbiro-react16-sdk.umd.js +2169 -1033
- package/dist/index.js +13 -14
- package/dist/lang/en.d.ts +3 -0
- package/dist/lang/en.js +66 -0
- package/dist/lang/index.d.ts +4 -0
- package/dist/lang/index.js +18 -0
- package/dist/lang/keyLang.d.ts +62 -0
- package/dist/lang/keyLang.js +66 -0
- package/dist/lang/ko.d.ts +3 -0
- package/dist/lang/ko.js +66 -0
- package/dist/lang/vi.d.ts +3 -0
- package/dist/lang/vi.js +66 -0
- package/dist/node_modules/react-feather/dist/icons/arrow-down.js +73 -0
- package/dist/node_modules/react-feather/dist/icons/chevron-left.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/chevron-right.js +68 -0
- package/dist/node_modules/react-feather/dist/icons/globe.js +77 -0
- package/dist/node_modules/react-feather/dist/icons/x.js +76 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/lang.d.ts +1 -0
- package/dist/utils/lang.js +30 -0
- package/dist/utils/storage.d.ts +8 -0
- package/dist/utils/storage.js +19 -0
- package/dist/utils/url.d.ts +2 -0
- package/dist/utils/url.js +8 -15
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React__default, { forwardRef } from "react";
|
|
2
|
+
import PropTypes from "../../../prop-types/index.js";
|
|
3
|
+
function _extends() {
|
|
4
|
+
_extends = Object.assign || function(target) {
|
|
5
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
+
var source = arguments[i];
|
|
7
|
+
for (var key in source) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
+
target[key] = source[key];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
return _extends.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutProperties(source, excluded) {
|
|
18
|
+
if (source == null) return {};
|
|
19
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
20
|
+
var key, i;
|
|
21
|
+
if (Object.getOwnPropertySymbols) {
|
|
22
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
23
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
24
|
+
key = sourceSymbolKeys[i];
|
|
25
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
27
|
+
target[key] = source[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
}
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
33
|
+
if (source == null) return {};
|
|
34
|
+
var target = {};
|
|
35
|
+
var sourceKeys = Object.keys(source);
|
|
36
|
+
var key, i;
|
|
37
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
38
|
+
key = sourceKeys[i];
|
|
39
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
40
|
+
target[key] = source[key];
|
|
41
|
+
}
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
var Globe = forwardRef(function(_ref, ref) {
|
|
45
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties(_ref, ["color", "size"]);
|
|
46
|
+
return /* @__PURE__ */ React__default.createElement("svg", _extends({
|
|
47
|
+
ref,
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
width: size,
|
|
50
|
+
height: size,
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: color,
|
|
54
|
+
strokeWidth: "2",
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round"
|
|
57
|
+
}, rest), /* @__PURE__ */ React__default.createElement("circle", {
|
|
58
|
+
cx: "12",
|
|
59
|
+
cy: "12",
|
|
60
|
+
r: "10"
|
|
61
|
+
}), /* @__PURE__ */ React__default.createElement("line", {
|
|
62
|
+
x1: "2",
|
|
63
|
+
y1: "12",
|
|
64
|
+
x2: "22",
|
|
65
|
+
y2: "12"
|
|
66
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
67
|
+
d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
Globe.propTypes = {
|
|
71
|
+
color: PropTypes.string,
|
|
72
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
73
|
+
};
|
|
74
|
+
Globe.displayName = "Globe";
|
|
75
|
+
export {
|
|
76
|
+
Globe as default
|
|
77
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React__default, { forwardRef } from "react";
|
|
2
|
+
import PropTypes from "../../../prop-types/index.js";
|
|
3
|
+
function _extends() {
|
|
4
|
+
_extends = Object.assign || function(target) {
|
|
5
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
+
var source = arguments[i];
|
|
7
|
+
for (var key in source) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
+
target[key] = source[key];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
return _extends.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
function _objectWithoutProperties(source, excluded) {
|
|
18
|
+
if (source == null) return {};
|
|
19
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
20
|
+
var key, i;
|
|
21
|
+
if (Object.getOwnPropertySymbols) {
|
|
22
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
23
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
24
|
+
key = sourceSymbolKeys[i];
|
|
25
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
27
|
+
target[key] = source[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
}
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
33
|
+
if (source == null) return {};
|
|
34
|
+
var target = {};
|
|
35
|
+
var sourceKeys = Object.keys(source);
|
|
36
|
+
var key, i;
|
|
37
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
38
|
+
key = sourceKeys[i];
|
|
39
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
40
|
+
target[key] = source[key];
|
|
41
|
+
}
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
var X = forwardRef(function(_ref, ref) {
|
|
45
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties(_ref, ["color", "size"]);
|
|
46
|
+
return /* @__PURE__ */ React__default.createElement("svg", _extends({
|
|
47
|
+
ref,
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
width: size,
|
|
50
|
+
height: size,
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: color,
|
|
54
|
+
strokeWidth: "2",
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round"
|
|
57
|
+
}, rest), /* @__PURE__ */ React__default.createElement("line", {
|
|
58
|
+
x1: "18",
|
|
59
|
+
y1: "6",
|
|
60
|
+
x2: "6",
|
|
61
|
+
y2: "18"
|
|
62
|
+
}), /* @__PURE__ */ React__default.createElement("line", {
|
|
63
|
+
x1: "6",
|
|
64
|
+
y1: "6",
|
|
65
|
+
x2: "18",
|
|
66
|
+
y2: "18"
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
X.propTypes = {
|
|
70
|
+
color: PropTypes.string,
|
|
71
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
72
|
+
};
|
|
73
|
+
X.displayName = "X";
|
|
74
|
+
export {
|
|
75
|
+
X as default
|
|
76
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { initHanbiroReactSDK,
|
|
1
|
+
export { initHanbiroReactSDK, setLibLang } from './url';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCurrentLang: () => string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { localStorageService, LOCAL_STORAGE_KEY } from "./storage.js";
|
|
2
|
+
function getBrowserLang(shortCode = true) {
|
|
3
|
+
let language = navigator.language;
|
|
4
|
+
if (language.indexOf("-") !== -1 && shortCode) {
|
|
5
|
+
language = language.substring(0, 2);
|
|
6
|
+
}
|
|
7
|
+
if (language === "ja") {
|
|
8
|
+
language = "jp";
|
|
9
|
+
}
|
|
10
|
+
const supportLanguage = [
|
|
11
|
+
"ko",
|
|
12
|
+
"en",
|
|
13
|
+
"jp",
|
|
14
|
+
"ch",
|
|
15
|
+
"zh",
|
|
16
|
+
"id",
|
|
17
|
+
"vi",
|
|
18
|
+
"es"
|
|
19
|
+
];
|
|
20
|
+
if (!(supportLanguage.indexOf(language) > -1)) {
|
|
21
|
+
language = "en";
|
|
22
|
+
}
|
|
23
|
+
return language || "en";
|
|
24
|
+
}
|
|
25
|
+
const getCurrentLang = () => {
|
|
26
|
+
return localStorageService.get(LOCAL_STORAGE_KEY.LANG_CODE) || getBrowserLang(true);
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
getCurrentLang
|
|
30
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum LOCAL_STORAGE_KEY {
|
|
2
|
+
LANG_CODE = "lang.code"
|
|
3
|
+
}
|
|
4
|
+
export declare const localStorageService: {
|
|
5
|
+
get: (key: LOCAL_STORAGE_KEY) => string | null;
|
|
6
|
+
set: (key: LOCAL_STORAGE_KEY, value: string) => void;
|
|
7
|
+
remove: (key: LOCAL_STORAGE_KEY) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var LOCAL_STORAGE_KEY = /* @__PURE__ */ ((LOCAL_STORAGE_KEY2) => {
|
|
2
|
+
LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
|
|
3
|
+
return LOCAL_STORAGE_KEY2;
|
|
4
|
+
})(LOCAL_STORAGE_KEY || {});
|
|
5
|
+
const localStorageService = {
|
|
6
|
+
get: (key) => {
|
|
7
|
+
return localStorage.getItem(key);
|
|
8
|
+
},
|
|
9
|
+
set: (key, value) => {
|
|
10
|
+
localStorage.setItem(key, value);
|
|
11
|
+
},
|
|
12
|
+
remove: (key) => {
|
|
13
|
+
localStorage.removeItem(key);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
LOCAL_STORAGE_KEY,
|
|
18
|
+
localStorageService
|
|
19
|
+
};
|
package/dist/utils/url.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
interface SDKConfig {
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
signer: any | null;
|
|
4
|
+
lang?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const SDKConfig: SDKConfig;
|
|
6
7
|
export declare const initHanbiroReactSDK: ({ baseUrl, signer }: SDKConfig) => void;
|
|
8
|
+
export declare const setLibLang: (lang: string) => void;
|
|
7
9
|
export declare const isDevelopment: boolean;
|
|
8
10
|
export declare const getBaseUrl: () => string;
|
|
9
11
|
export declare const getGroupwareUrl: () => string;
|
package/dist/utils/url.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { getCurrentLang } from "./lang.js";
|
|
1
2
|
const SDKConfig = {
|
|
2
3
|
baseUrl: "V3",
|
|
3
|
-
signer: null
|
|
4
|
+
signer: null,
|
|
5
|
+
lang: getCurrentLang()
|
|
4
6
|
};
|
|
5
7
|
const initHanbiroReactSDK = ({ baseUrl, signer }) => {
|
|
6
8
|
SDKConfig.baseUrl = baseUrl;
|
|
7
9
|
SDKConfig.signer = signer;
|
|
8
10
|
};
|
|
11
|
+
const setLibLang = (lang) => {
|
|
12
|
+
if (lang) SDKConfig.lang = lang;
|
|
13
|
+
};
|
|
9
14
|
const checkDevelopment = () => {
|
|
10
15
|
const locationInfo = window.location;
|
|
11
16
|
const { hostname } = locationInfo;
|
|
@@ -33,22 +38,10 @@ const getBaseUrl = () => {
|
|
|
33
38
|
return "https://" + (dataArr == null ? void 0 : dataArr[0]);
|
|
34
39
|
}
|
|
35
40
|
};
|
|
36
|
-
const getGroupwareUrl = () => {
|
|
37
|
-
let locationInfo = window.location;
|
|
38
|
-
if (isDevelopment) {
|
|
39
|
-
return getBaseUrl() || "https://vndev.hanbiro.com/ngw";
|
|
40
|
-
} else {
|
|
41
|
-
if (window.location !== window.parent.location) {
|
|
42
|
-
locationInfo = window.parent.location;
|
|
43
|
-
}
|
|
44
|
-
const { hostname, protocol } = locationInfo;
|
|
45
|
-
return [protocol, "//", hostname, "/ngw"].join("");
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
41
|
export {
|
|
49
42
|
SDKConfig,
|
|
50
43
|
getBaseUrl,
|
|
51
|
-
getGroupwareUrl,
|
|
52
44
|
initHanbiroReactSDK,
|
|
53
|
-
isDevelopment
|
|
45
|
+
isDevelopment,
|
|
46
|
+
setLibLang
|
|
54
47
|
};
|