hanbiro-react16-sdk 1.0.17 → 1.0.19
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 +2 -19
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/components/ChatAIDraft/CustomAIIcon.js +63 -0
- package/dist/components/ChatAIDraft/List.js +151 -0
- package/dist/components/ChatAIDraft/SettingPopper.js +225 -0
- package/dist/components/ChatAIDraft/TypingText.js +39 -0
- package/dist/components/ChatAIDraft/helper.js +121 -0
- package/dist/components/ChatAIDraft/index.js +281 -0
- package/dist/components/CountryFlag/flags/CNFlag.js +27 -0
- package/dist/components/CountryFlag/flags/DEFlag.js +21 -0
- package/dist/components/CountryFlag/flags/ESFlag.js +457 -0
- package/dist/components/CountryFlag/flags/FRFlag.js +21 -0
- package/dist/components/CountryFlag/flags/IDFlag.js +21 -0
- package/dist/components/CountryFlag/flags/ITFlag.js +21 -0
- package/dist/components/CountryFlag/flags/JPFlag.js +21 -0
- package/dist/components/CountryFlag/flags/KRFlag.js +39 -0
- package/dist/components/CountryFlag/flags/NLFlag.js +21 -0
- package/dist/components/CountryFlag/flags/PTFlag.js +139 -0
- package/dist/components/CountryFlag/flags/RUFlag.js +21 -0
- package/dist/components/CountryFlag/flags/SAFlag.js +24 -0
- package/dist/components/CountryFlag/flags/THFlag.js +21 -0
- package/dist/components/CountryFlag/flags/TWFlag.js +28 -0
- package/dist/components/CountryFlag/flags/USFlag.js +34 -0
- package/dist/components/CountryFlag/flags/VNFlag.js +29 -0
- package/dist/components/CountryFlag/index.js +73 -0
- package/dist/components/LoadingCircular/index.js +37 -0
- package/dist/components/LoadingContainer/index.js +53 -0
- package/dist/components/TinyMceEditor/index.js +181 -0
- package/dist/components/TinyMceEditor/scrollStyle.js +40 -0
- package/dist/components/TinyMceEditor/useEditor.js +120 -0
- package/dist/components/Tooltip/index.js +172 -0
- package/dist/constants/index.js +85 -0
- package/dist/hanbiro-react16-sdk.style.css +1 -1
- package/dist/hanbiro-react16-sdk.umd.js +2 -9679
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -0
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/ScriptLoader2.js +148 -0
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/TinyMCE.js +7 -0
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/Utils.js +103 -0
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/Editor.js +353 -0
- package/dist/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/EditorPropTypes.js +102 -0
- package/dist/node_modules/axios/index.js +38 -0
- package/dist/node_modules/axios/lib/adapters/adapters.js +71 -0
- package/dist/node_modules/axios/lib/adapters/fetch.js +272 -0
- package/dist/node_modules/axios/lib/adapters/xhr.js +153 -0
- package/dist/node_modules/axios/lib/axios.js +50 -0
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +99 -0
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +20 -0
- package/dist/node_modules/axios/lib/cancel/isCancel.js +6 -0
- package/dist/node_modules/axios/lib/core/Axios.js +220 -0
- package/dist/node_modules/axios/lib/core/AxiosError.js +76 -0
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +238 -0
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +66 -0
- package/dist/node_modules/axios/lib/core/buildFullPath.js +12 -0
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +48 -0
- package/dist/node_modules/axios/lib/core/mergeConfig.js +100 -0
- package/dist/node_modules/axios/lib/core/settle.js +20 -0
- package/dist/node_modules/axios/lib/core/transformData.js +17 -0
- package/dist/node_modules/axios/lib/defaults/index.js +120 -0
- package/dist/node_modules/axios/lib/defaults/transitional.js +9 -0
- package/dist/node_modules/axios/lib/env/data.js +4 -0
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +34 -0
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +77 -0
- package/dist/node_modules/axios/lib/helpers/bind.js +8 -0
- package/dist/node_modules/axios/lib/helpers/buildURL.js +32 -0
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +6 -0
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +41 -0
- package/dist/node_modules/axios/lib/helpers/cookies.js +49 -0
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +54 -0
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +9 -0
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +7 -0
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/dist/node_modules/axios/lib/helpers/null.js +4 -0
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +47 -0
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +52 -0
- package/dist/node_modules/axios/lib/helpers/speedometer.js +36 -0
- package/dist/node_modules/axios/lib/helpers/spread.js +8 -0
- package/dist/node_modules/axios/lib/helpers/throttle.js +35 -0
- package/dist/node_modules/axios/lib/helpers/toFormData.js +120 -0
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +33 -0
- package/dist/node_modules/axios/lib/helpers/trackStream.js +169 -0
- package/dist/node_modules/axios/lib/helpers/validator.js +70 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/dist/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/dist/node_modules/axios/lib/platform/common/utils.js +15 -0
- package/dist/node_modules/axios/lib/platform/index.js +22 -0
- package/dist/node_modules/axios/lib/utils.js +429 -0
- package/dist/node_modules/marked/lib/marked.esm.js +2169 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +51 -0
- package/dist/node_modules/prop-types/index.js +12 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +5 -0
- package/dist/node_modules/react-feather/dist/icons/copy.js +75 -0
- package/dist/node_modules/react-feather/dist/icons/send.js +73 -0
- package/dist/node_modules/react-feather/dist/icons/settings.js +72 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +14 -0
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -0
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +16 -0
- package/dist/utils/axiosAPI.js +89 -0
- package/dist/utils/url.js +54 -0
- package/package.json +2 -1
- package/dist/hanbiro-react16-sdk.es.js +0 -7910
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { R as ReactPropTypesSecret_1 } from "./lib/ReactPropTypesSecret.js";
|
|
2
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
3
|
+
function emptyFunction() {
|
|
4
|
+
}
|
|
5
|
+
function emptyFunctionWithReset() {
|
|
6
|
+
}
|
|
7
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
8
|
+
var factoryWithThrowingShims = function() {
|
|
9
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
10
|
+
if (secret === ReactPropTypesSecret) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
var err = new Error(
|
|
14
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
15
|
+
);
|
|
16
|
+
err.name = "Invariant Violation";
|
|
17
|
+
throw err;
|
|
18
|
+
}
|
|
19
|
+
shim.isRequired = shim;
|
|
20
|
+
function getShim() {
|
|
21
|
+
return shim;
|
|
22
|
+
}
|
|
23
|
+
var ReactPropTypes = {
|
|
24
|
+
array: shim,
|
|
25
|
+
bigint: shim,
|
|
26
|
+
bool: shim,
|
|
27
|
+
func: shim,
|
|
28
|
+
number: shim,
|
|
29
|
+
object: shim,
|
|
30
|
+
string: shim,
|
|
31
|
+
symbol: shim,
|
|
32
|
+
any: shim,
|
|
33
|
+
arrayOf: getShim,
|
|
34
|
+
element: shim,
|
|
35
|
+
elementType: shim,
|
|
36
|
+
instanceOf: getShim,
|
|
37
|
+
node: shim,
|
|
38
|
+
objectOf: getShim,
|
|
39
|
+
oneOf: getShim,
|
|
40
|
+
oneOfType: getShim,
|
|
41
|
+
shape: getShim,
|
|
42
|
+
exact: getShim,
|
|
43
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
44
|
+
resetWarningCache: emptyFunction
|
|
45
|
+
};
|
|
46
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
47
|
+
return ReactPropTypes;
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
factoryWithThrowingShims as f
|
|
51
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as propTypes } from "../../_virtual/index.js";
|
|
3
|
+
import { f as factoryWithThrowingShims } from "./factoryWithThrowingShims.js";
|
|
4
|
+
{
|
|
5
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
6
|
+
}
|
|
7
|
+
var propTypesExports = propTypes.exports;
|
|
8
|
+
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
9
|
+
export {
|
|
10
|
+
PropTypes as default,
|
|
11
|
+
propTypesExports as p
|
|
12
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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 Copy = 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("rect", {
|
|
58
|
+
x: "9",
|
|
59
|
+
y: "9",
|
|
60
|
+
width: "13",
|
|
61
|
+
height: "13",
|
|
62
|
+
rx: "2",
|
|
63
|
+
ry: "2"
|
|
64
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
65
|
+
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
Copy.propTypes = {
|
|
69
|
+
color: PropTypes.string,
|
|
70
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
71
|
+
};
|
|
72
|
+
Copy.displayName = "Copy";
|
|
73
|
+
export {
|
|
74
|
+
Copy as default
|
|
75
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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 Send = 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: "22",
|
|
59
|
+
y1: "2",
|
|
60
|
+
x2: "11",
|
|
61
|
+
y2: "13"
|
|
62
|
+
}), /* @__PURE__ */ React__default.createElement("polygon", {
|
|
63
|
+
points: "22 2 15 22 11 13 2 9 22 2"
|
|
64
|
+
}));
|
|
65
|
+
});
|
|
66
|
+
Send.propTypes = {
|
|
67
|
+
color: PropTypes.string,
|
|
68
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
69
|
+
};
|
|
70
|
+
Send.displayName = "Send";
|
|
71
|
+
export {
|
|
72
|
+
Send as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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 Settings = 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: "3"
|
|
61
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
62
|
+
d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
Settings.propTypes = {
|
|
66
|
+
color: PropTypes.string,
|
|
67
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
68
|
+
};
|
|
69
|
+
Settings.displayName = "Settings";
|
|
70
|
+
export {
|
|
71
|
+
Settings as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let getRandomValues;
|
|
2
|
+
const rnds8 = new Uint8Array(16);
|
|
3
|
+
function rng() {
|
|
4
|
+
if (!getRandomValues) {
|
|
5
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
6
|
+
if (!getRandomValues) {
|
|
7
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return getRandomValues(rnds8);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
rng as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const byteToHex = [];
|
|
2
|
+
for (let i = 0; i < 256; ++i) {
|
|
3
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
4
|
+
}
|
|
5
|
+
function unsafeStringify(arr, offset = 0) {
|
|
6
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
unsafeStringify
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import native from "./native.js";
|
|
2
|
+
import rng from "./rng.js";
|
|
3
|
+
import { unsafeStringify } from "./stringify.js";
|
|
4
|
+
function v4(options, buf, offset) {
|
|
5
|
+
if (native.randomUUID && true && !options) {
|
|
6
|
+
return native.randomUUID();
|
|
7
|
+
}
|
|
8
|
+
options = options || {};
|
|
9
|
+
const rnds = options.random || (options.rng || rng)();
|
|
10
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
11
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
12
|
+
return unsafeStringify(rnds);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
v4 as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import "../node_modules/axios/index.js";
|
|
22
|
+
import { getBaseUrl } from "./url.js";
|
|
23
|
+
import axios from "../node_modules/axios/lib/axios.js";
|
|
24
|
+
const axiosApi = axios.create({
|
|
25
|
+
baseURL: getBaseUrl(),
|
|
26
|
+
withCredentials: true,
|
|
27
|
+
headers: {
|
|
28
|
+
Accept: "application/json, text/plain, */*",
|
|
29
|
+
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
30
|
+
"Access-Control-Allow-Origin": "*"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
axiosApi.interceptors.request.use((config) => __async(void 0, null, function* () {
|
|
34
|
+
try {
|
|
35
|
+
config.baseURL = getBaseUrl();
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error("Axios request error:", e);
|
|
38
|
+
}
|
|
39
|
+
return config;
|
|
40
|
+
}));
|
|
41
|
+
axiosApi.interceptors.response.use(
|
|
42
|
+
(response) => {
|
|
43
|
+
const responseData = response == null ? void 0 : response.data;
|
|
44
|
+
const dataError = responseData == null ? void 0 : responseData.error;
|
|
45
|
+
if (dataError && (dataError == null ? void 0 : dataError.code) && dataError.code == 808) {
|
|
46
|
+
console.error("Password expired!");
|
|
47
|
+
}
|
|
48
|
+
return response == null ? void 0 : response.data;
|
|
49
|
+
},
|
|
50
|
+
(error) => {
|
|
51
|
+
const serverResponse = error == null ? void 0 : error.response;
|
|
52
|
+
const errorStatus = serverResponse == null ? void 0 : serverResponse.status;
|
|
53
|
+
const responseData = serverResponse == null ? void 0 : serverResponse.data;
|
|
54
|
+
if (errorStatus === 401) {
|
|
55
|
+
console.error("Authentication failed!");
|
|
56
|
+
}
|
|
57
|
+
switch (errorStatus) {
|
|
58
|
+
case 404:
|
|
59
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
60
|
+
const message = (responseData == null ? void 0 : responseData.msg) || "Not Found";
|
|
61
|
+
console.error("Axios 404: ", message);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case 401:
|
|
65
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
66
|
+
const message = (responseData == null ? void 0 : responseData.detail) || (responseData == null ? void 0 : responseData.msg);
|
|
67
|
+
console.error("Axios 401: ", message);
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case 505:
|
|
71
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
72
|
+
const message = (responseData == null ? void 0 : responseData.error) || "";
|
|
73
|
+
console.error("Axios 505: ", message);
|
|
74
|
+
}
|
|
75
|
+
return responseData;
|
|
76
|
+
case 0:
|
|
77
|
+
console.error("Axios sever error!");
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
if (typeof errorStatus === "undefined") {
|
|
81
|
+
console.error("Unexpected Error");
|
|
82
|
+
}
|
|
83
|
+
console.log(error);
|
|
84
|
+
return Promise.reject(error);
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
export {
|
|
88
|
+
axiosApi
|
|
89
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const SDKConfig = {
|
|
2
|
+
baseUrl: "V3",
|
|
3
|
+
signer: null
|
|
4
|
+
};
|
|
5
|
+
const initHanbiroReactSDK = ({ baseUrl, signer }) => {
|
|
6
|
+
SDKConfig.baseUrl = baseUrl;
|
|
7
|
+
SDKConfig.signer = signer;
|
|
8
|
+
};
|
|
9
|
+
const checkDevelopment = () => {
|
|
10
|
+
const locationInfo = window.location;
|
|
11
|
+
const { hostname } = locationInfo;
|
|
12
|
+
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
13
|
+
return true;
|
|
14
|
+
} else {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const isDevelopment = checkDevelopment();
|
|
19
|
+
const getBaseUrl = () => {
|
|
20
|
+
var _a;
|
|
21
|
+
let locationInfo = window.location;
|
|
22
|
+
const { host } = locationInfo;
|
|
23
|
+
if (isDevelopment) {
|
|
24
|
+
const baseUrlArr = (_a = SDKConfig.baseUrl) == null ? void 0 : _a.split("/");
|
|
25
|
+
if (baseUrlArr) {
|
|
26
|
+
return "https://" + (baseUrlArr == null ? void 0 : baseUrlArr[2]);
|
|
27
|
+
} else {
|
|
28
|
+
return "https://vndev.hanbiro.com";
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
const data = localStorage.getItem("host") || host;
|
|
32
|
+
const dataArr = data == null ? void 0 : data.split("/");
|
|
33
|
+
return "https://" + (dataArr == null ? void 0 : dataArr[0]);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
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
|
+
export {
|
|
49
|
+
SDKConfig,
|
|
50
|
+
getBaseUrl,
|
|
51
|
+
getGroupwareUrl,
|
|
52
|
+
initHanbiroReactSDK,
|
|
53
|
+
isDevelopment
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanbiro-react16-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
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",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@babel/core": "^7.29.0",
|
|
60
60
|
"@babel/preset-env": "^7.29.2",
|
|
61
61
|
"@rollup/plugin-babel": "^7.0.0",
|
|
62
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
62
63
|
"@types/node": "^20.0.0",
|
|
63
64
|
"@types/react": "^16.14.0",
|
|
64
65
|
"@types/react-dom": "^16.9.14",
|