@lobehub/icons 1.28.0 → 1.29.1
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/es/Ai21/components/Combine.d.ts +3 -1
- package/es/Ai21/components/Combine.js +6 -2
- package/es/AiMass/style.d.ts +1 -1
- package/es/AiMass/style.js +1 -1
- package/es/Azure/components/Avatar.js +1 -2
- package/es/Azure/components/Color.js +5 -5
- package/es/Azure/components/Mono.js +5 -5
- package/es/Baichuan/components/Avatar.js +2 -2
- package/es/Baichuan/index.d.ts +1 -0
- package/es/Baichuan/index.js +2 -1
- package/es/Google/components/Color.js +12 -16
- package/es/Google/components/Mono.js +7 -1
- package/es/Groq/components/Combine.d.ts +3 -1
- package/es/Groq/components/Combine.js +7 -2
- package/es/Groq/style.d.ts +1 -1
- package/es/Groq/style.js +1 -1
- package/es/IconAvatar/index.js +2 -4
- package/es/ModelIcon/DefaultAvatar.d.ts +4 -0
- package/es/ModelIcon/DefaultAvatar.js +42 -0
- package/es/ModelIcon/DefaultIcon.d.ts +9 -0
- package/es/ModelIcon/DefaultIcon.js +30 -0
- package/es/ModelIcon/const.d.ts +19 -0
- package/es/ModelIcon/const.js +157 -0
- package/es/ModelIcon/index.d.ts +10 -0
- package/es/ModelIcon/index.js +136 -0
- package/es/ModelTag/index.d.ts +8 -0
- package/es/ModelTag/index.js +28 -0
- package/es/Moonshot/components/Combine.d.ts +3 -1
- package/es/Moonshot/components/Combine.js +14 -3
- package/es/OpenRouter/components/Combine.d.ts +3 -1
- package/es/OpenRouter/components/Combine.js +11 -3
- package/es/ProviderCombine/const.d.ts +12 -0
- package/es/ProviderCombine/const.js +222 -0
- package/es/ProviderCombine/index.d.ts +11 -0
- package/es/ProviderCombine/index.js +52 -0
- package/es/ProviderIcon/DefaultAvatar.d.ts +4 -0
- package/es/ProviderIcon/DefaultAvatar.js +42 -0
- package/es/ProviderIcon/DefaultIcon.d.ts +9 -0
- package/es/ProviderIcon/DefaultIcon.js +30 -0
- package/es/ProviderIcon/const.d.ts +46 -0
- package/es/ProviderIcon/const.js +124 -0
- package/es/ProviderIcon/index.d.ts +11 -0
- package/es/ProviderIcon/index.js +136 -0
- package/es/Tongyi/components/Avatar.js +2 -2
- package/es/Tongyi/components/Combine.js +10 -3
- package/es/ZeroOne/components/Combine.d.ts +3 -1
- package/es/ZeroOne/components/Combine.js +8 -3
- package/es/ZeroOne/style.d.ts +1 -1
- package/es/ZeroOne/style.js +1 -1
- package/es/index.d.ts +6 -0
- package/es/index.js +6 -0
- package/package.json +16 -16
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["model", "size", "type"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
+
import { forwardRef, useMemo } from 'react';
|
|
14
|
+
import DefaultAvatar from "./DefaultAvatar";
|
|
15
|
+
import DefaultIcon from "./DefaultIcon";
|
|
16
|
+
import { modelMappings } from "./const";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
var ModelIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
19
|
+
var originModel = _ref.model,
|
|
20
|
+
_ref$size = _ref.size,
|
|
21
|
+
size = _ref$size === void 0 ? 12 : _ref$size,
|
|
22
|
+
_ref$type = _ref.type,
|
|
23
|
+
type = _ref$type === void 0 ? 'avatar' : _ref$type,
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var Render = useMemo(function () {
|
|
26
|
+
if (!originModel) return;
|
|
27
|
+
var model = originModel.toLowerCase();
|
|
28
|
+
var _iterator = _createForOfIteratorHelper(modelMappings),
|
|
29
|
+
_step;
|
|
30
|
+
try {
|
|
31
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
32
|
+
var item = _step.value;
|
|
33
|
+
if (item.keywords.some(function (keyword) {
|
|
34
|
+
return new RegExp(keyword, 'i').test(model);
|
|
35
|
+
})) {
|
|
36
|
+
return item;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
_iterator.e(err);
|
|
41
|
+
} finally {
|
|
42
|
+
_iterator.f();
|
|
43
|
+
}
|
|
44
|
+
}, [originModel]);
|
|
45
|
+
switch (type) {
|
|
46
|
+
case 'avatar':
|
|
47
|
+
{
|
|
48
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultAvatar, _objectSpread({
|
|
49
|
+
ref: ref,
|
|
50
|
+
size: size
|
|
51
|
+
}, rest));
|
|
52
|
+
return /*#__PURE__*/_jsx(Render.Icon.Avatar, _objectSpread(_objectSpread({
|
|
53
|
+
ref: ref,
|
|
54
|
+
size: size
|
|
55
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
56
|
+
}
|
|
57
|
+
case 'mono':
|
|
58
|
+
{
|
|
59
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
60
|
+
ref: ref,
|
|
61
|
+
size: size
|
|
62
|
+
}, rest));
|
|
63
|
+
return /*#__PURE__*/_jsx(Render.Icon, _objectSpread(_objectSpread({
|
|
64
|
+
ref: ref,
|
|
65
|
+
size: size
|
|
66
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
67
|
+
}
|
|
68
|
+
case 'color':
|
|
69
|
+
{
|
|
70
|
+
var _Render$Icon;
|
|
71
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
72
|
+
ref: ref,
|
|
73
|
+
size: size
|
|
74
|
+
}, rest));
|
|
75
|
+
return (_Render$Icon = Render.Icon) !== null && _Render$Icon !== void 0 && _Render$Icon.Color ? /*#__PURE__*/_jsx(Render.Icon.Color, _objectSpread(_objectSpread({
|
|
76
|
+
ref: ref,
|
|
77
|
+
size: size
|
|
78
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : /*#__PURE__*/_jsx(Render.Icon, _objectSpread(_objectSpread({
|
|
79
|
+
ref: ref,
|
|
80
|
+
size: size
|
|
81
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
82
|
+
}
|
|
83
|
+
case 'combine':
|
|
84
|
+
{
|
|
85
|
+
var _Render$Icon2, _Render$Icon3, _Render$Icon4;
|
|
86
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
87
|
+
ref: ref,
|
|
88
|
+
size: size
|
|
89
|
+
}, rest));
|
|
90
|
+
return (_Render$Icon2 = Render.Icon) !== null && _Render$Icon2 !== void 0 && _Render$Icon2.Combine ? /*#__PURE__*/_jsx(Render.Icon.Combine, _objectSpread(_objectSpread({
|
|
91
|
+
ref: ref,
|
|
92
|
+
size: size
|
|
93
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : (_Render$Icon3 = Render.Icon) !== null && _Render$Icon3 !== void 0 && _Render$Icon3.Brand ? /*#__PURE__*/_jsx(Render.Icon.Brand, _objectSpread(_objectSpread({
|
|
94
|
+
ref: ref,
|
|
95
|
+
size: size
|
|
96
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : (_Render$Icon4 = Render.Icon) !== null && _Render$Icon4 !== void 0 && _Render$Icon4.Text ? /*#__PURE__*/_jsx(Render.Icon.Text, _objectSpread(_objectSpread({
|
|
97
|
+
ref: ref,
|
|
98
|
+
size: size
|
|
99
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : /*#__PURE__*/_jsx(Render.Icon, _objectSpread(_objectSpread({
|
|
100
|
+
ref: ref,
|
|
101
|
+
size: size
|
|
102
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
103
|
+
}
|
|
104
|
+
case 'combine-color':
|
|
105
|
+
{
|
|
106
|
+
var _Render$Icon5, _Render$Icon6, _Render$Icon7;
|
|
107
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
108
|
+
ref: ref,
|
|
109
|
+
size: size
|
|
110
|
+
}, rest));
|
|
111
|
+
return (_Render$Icon5 = Render.Icon) !== null && _Render$Icon5 !== void 0 && _Render$Icon5.Combine ? /*#__PURE__*/_jsx(Render.Icon.Combine, _objectSpread(_objectSpread({
|
|
112
|
+
ref: ref,
|
|
113
|
+
size: size,
|
|
114
|
+
type: 'color'
|
|
115
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : (_Render$Icon6 = Render.Icon) !== null && _Render$Icon6 !== void 0 && _Render$Icon6.BrandColor ? /*#__PURE__*/_jsx(Render.Icon.BrandColor, _objectSpread(_objectSpread({
|
|
116
|
+
ref: ref,
|
|
117
|
+
size: size,
|
|
118
|
+
type: 'color'
|
|
119
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : (_Render$Icon7 = Render.Icon) !== null && _Render$Icon7 !== void 0 && _Render$Icon7.Text ? /*#__PURE__*/_jsx(Render.Icon.Text, _objectSpread(_objectSpread({
|
|
120
|
+
ref: ref,
|
|
121
|
+
size: size
|
|
122
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest)) : /*#__PURE__*/_jsx(Render.Icon, _objectSpread(_objectSpread({
|
|
123
|
+
ref: ref,
|
|
124
|
+
size: size
|
|
125
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
126
|
+
}
|
|
127
|
+
default:
|
|
128
|
+
{
|
|
129
|
+
return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
130
|
+
ref: ref,
|
|
131
|
+
size: size
|
|
132
|
+
}, rest));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
export default ModelIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProps } from '@lobehub/ui';
|
|
3
|
+
export interface ModelTagProps extends Omit<TagProps, 'icon' | 'children'> {
|
|
4
|
+
model: string;
|
|
5
|
+
type?: 'color' | 'mono';
|
|
6
|
+
}
|
|
7
|
+
declare const ModelTag: import("react").NamedExoticComponent<ModelTagProps>;
|
|
8
|
+
export default ModelTag;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["type", "model"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { Tag } from '@lobehub/ui';
|
|
11
|
+
import { memo } from 'react';
|
|
12
|
+
import ModelIcon from "../ModelIcon";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var ModelTag = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var _ref$type = _ref.type,
|
|
16
|
+
type = _ref$type === void 0 ? 'mono' : _ref$type,
|
|
17
|
+
model = _ref.model,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
return /*#__PURE__*/_jsx(Tag, _objectSpread(_objectSpread({
|
|
20
|
+
icon: /*#__PURE__*/_jsx(ModelIcon, {
|
|
21
|
+
model: model,
|
|
22
|
+
type: type
|
|
23
|
+
})
|
|
24
|
+
}, rest), {}, {
|
|
25
|
+
children: model
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
export default ModelTag;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IconCombineProps } from "../../IconCombine";
|
|
3
|
-
export
|
|
3
|
+
export interface CombineProps extends Omit<IconCombineProps, 'Icon' | 'Text'> {
|
|
4
|
+
type?: 'mono' | 'color';
|
|
5
|
+
}
|
|
4
6
|
declare const Combine: import("react").NamedExoticComponent<CombineProps>;
|
|
5
7
|
export default Combine;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["type", "iconProps"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { useThemeMode } from 'antd-style';
|
|
8
11
|
import { memo } from 'react';
|
|
9
12
|
import IconCombine from "../../IconCombine";
|
|
10
|
-
import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from "../style";
|
|
13
|
+
import { COLOR_PRIMARY, SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from "../style";
|
|
11
14
|
import Mono from "./Mono";
|
|
12
15
|
import Text from "./Text";
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
17
|
var Combine = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
-
var
|
|
18
|
+
var _ref$type = _ref.type,
|
|
19
|
+
type = _ref$type === void 0 ? 'mono' : _ref$type,
|
|
20
|
+
iconProps = _ref.iconProps,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
var _useThemeMode = useThemeMode(),
|
|
23
|
+
isDarkMode = _useThemeMode.isDarkMode;
|
|
16
24
|
return /*#__PURE__*/_jsx(IconCombine, _objectSpread({
|
|
17
25
|
Icon: Mono,
|
|
18
26
|
Text: Text,
|
|
19
27
|
"aria-label": TITLE,
|
|
28
|
+
iconProps: _objectSpread({
|
|
29
|
+
color: type === 'color' && !isDarkMode ? COLOR_PRIMARY : undefined
|
|
30
|
+
}, iconProps),
|
|
20
31
|
spaceMultiple: SPACE_MULTIPLE,
|
|
21
32
|
textMultiple: TEXT_MULTIPLE
|
|
22
33
|
}, rest));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IconCombineProps } from "../../IconCombine";
|
|
3
|
-
export
|
|
3
|
+
export interface CombineProps extends Omit<IconCombineProps, 'Icon' | 'Text'> {
|
|
4
|
+
type?: 'mono' | 'color';
|
|
5
|
+
}
|
|
4
6
|
declare const Combine: import("react").NamedExoticComponent<CombineProps>;
|
|
5
7
|
export default Combine;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["type", "iconProps"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
10
|
import { memo } from 'react';
|
|
9
11
|
import IconCombine from "../../IconCombine";
|
|
10
|
-
import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from "../style";
|
|
12
|
+
import { COLOR_PRIMARY, SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from "../style";
|
|
11
13
|
import Mono from "./Mono";
|
|
12
14
|
import Text from "./Text";
|
|
13
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
16
|
var Combine = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
-
var
|
|
17
|
+
var _ref$type = _ref.type,
|
|
18
|
+
type = _ref$type === void 0 ? 'mono' : _ref$type,
|
|
19
|
+
iconProps = _ref.iconProps,
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
21
|
return /*#__PURE__*/_jsx(IconCombine, _objectSpread({
|
|
17
22
|
Icon: Mono,
|
|
18
23
|
Text: Text,
|
|
19
24
|
"aria-label": TITLE,
|
|
25
|
+
iconProps: _objectSpread({
|
|
26
|
+
color: type === 'color' ? COLOR_PRIMARY : undefined
|
|
27
|
+
}, iconProps),
|
|
20
28
|
spaceMultiple: SPACE_MULTIPLE,
|
|
21
29
|
textMultiple: TEXT_MULTIPLE
|
|
22
30
|
}, rest));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DivProps } from '@lobehub/ui';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface ProviderMapping {
|
|
4
|
+
Icon: FC<DivProps & {
|
|
5
|
+
size: number;
|
|
6
|
+
type: 'color' | 'mono';
|
|
7
|
+
}>;
|
|
8
|
+
keywords: string[];
|
|
9
|
+
multiple?: number;
|
|
10
|
+
props?: any;
|
|
11
|
+
}
|
|
12
|
+
export declare const providerMappings: ProviderMapping[];
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["left", "right", "size"],
|
|
3
|
+
_excluded2 = ["size", "type"],
|
|
4
|
+
_excluded3 = ["size", "type"],
|
|
5
|
+
_excluded4 = ["size", "type"],
|
|
6
|
+
_excluded5 = ["size", "type"];
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
+
import { Divider } from 'antd';
|
|
15
|
+
import { memo } from 'react';
|
|
16
|
+
import { Flexbox } from 'react-layout-kit';
|
|
17
|
+
import Ai360 from "../Ai360";
|
|
18
|
+
import AiMass from "../AiMass";
|
|
19
|
+
import Anthropic from "../Anthropic";
|
|
20
|
+
import Aws from "../Aws";
|
|
21
|
+
import Azure from "../Azure";
|
|
22
|
+
import Baichuan from "../Baichuan";
|
|
23
|
+
import Claude from "../Claude";
|
|
24
|
+
import DeepSeek from "../DeepSeek";
|
|
25
|
+
import Gemini from "../Gemini";
|
|
26
|
+
import Google from "../Google";
|
|
27
|
+
import Groq from "../Groq";
|
|
28
|
+
import LobeHub from "../LobeHub";
|
|
29
|
+
import Minimax from "../Minimax";
|
|
30
|
+
import Mistral from "../Mistral";
|
|
31
|
+
import Moonshot from "../Moonshot";
|
|
32
|
+
import Novita from "../Novita";
|
|
33
|
+
import Ollama from "../Ollama";
|
|
34
|
+
import OpenAI from "../OpenAI";
|
|
35
|
+
import OpenRouter from "../OpenRouter";
|
|
36
|
+
import Perplexity from "../Perplexity";
|
|
37
|
+
import { ModelProvider } from "../ProviderIcon/const";
|
|
38
|
+
import SiliconCloud from "../SiliconCloud";
|
|
39
|
+
import Stepfun from "../Stepfun";
|
|
40
|
+
import Together from "../Together";
|
|
41
|
+
import Tongyi from "../Tongyi";
|
|
42
|
+
import ZeroOne from "../ZeroOne";
|
|
43
|
+
import Zhipu from "../Zhipu";
|
|
44
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
45
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
46
|
+
var Combine = /*#__PURE__*/memo(function (_ref) {
|
|
47
|
+
var left = _ref.left,
|
|
48
|
+
right = _ref.right,
|
|
49
|
+
_ref$size = _ref.size,
|
|
50
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
51
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
53
|
+
align: 'center',
|
|
54
|
+
flex: 'none',
|
|
55
|
+
gap: size / 3,
|
|
56
|
+
horizontal: true
|
|
57
|
+
}, rest), {}, {
|
|
58
|
+
children: [left, /*#__PURE__*/_jsx(Divider, {
|
|
59
|
+
style: {
|
|
60
|
+
marginBlock: 0,
|
|
61
|
+
marginInline: size / 6
|
|
62
|
+
},
|
|
63
|
+
type: 'vertical'
|
|
64
|
+
}), right]
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
export var providerMappings = [{
|
|
68
|
+
Icon: LobeHub.Combine,
|
|
69
|
+
keywords: [ModelProvider.LobeHub]
|
|
70
|
+
}, {
|
|
71
|
+
Icon: Zhipu.Combine,
|
|
72
|
+
keywords: [ModelProvider.ZhiPu],
|
|
73
|
+
multiple: 1.25
|
|
74
|
+
}, {
|
|
75
|
+
Icon: function Icon(_ref2) {
|
|
76
|
+
var _ref2$size = _ref2.size,
|
|
77
|
+
size = _ref2$size === void 0 ? 24 : _ref2$size,
|
|
78
|
+
_ref2$type = _ref2.type,
|
|
79
|
+
type = _ref2$type === void 0 ? 'color' : _ref2$type,
|
|
80
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
81
|
+
return /*#__PURE__*/_jsx(Combine, _objectSpread({
|
|
82
|
+
left: type === 'color' ? /*#__PURE__*/_jsx(Aws.Color, {
|
|
83
|
+
size: size * 1.3
|
|
84
|
+
}) : /*#__PURE__*/_jsx(Aws, {
|
|
85
|
+
size: size * 1.3
|
|
86
|
+
}),
|
|
87
|
+
right: /*#__PURE__*/_jsx(OpenAI.Combine, {
|
|
88
|
+
size: size
|
|
89
|
+
}),
|
|
90
|
+
size: size
|
|
91
|
+
}, props));
|
|
92
|
+
},
|
|
93
|
+
keywords: [ModelProvider.Bedrock]
|
|
94
|
+
}, {
|
|
95
|
+
Icon: DeepSeek.Combine,
|
|
96
|
+
keywords: [ModelProvider.DeepSeek],
|
|
97
|
+
multiple: 1.16
|
|
98
|
+
}, {
|
|
99
|
+
Icon: function Icon(_ref3) {
|
|
100
|
+
var _ref3$size = _ref3.size,
|
|
101
|
+
size = _ref3$size === void 0 ? 24 : _ref3$size,
|
|
102
|
+
_ref3$type = _ref3.type,
|
|
103
|
+
type = _ref3$type === void 0 ? 'color' : _ref3$type,
|
|
104
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
105
|
+
return /*#__PURE__*/_jsx(Combine, _objectSpread({
|
|
106
|
+
left: type === 'color' ? /*#__PURE__*/_jsx(Google.BrandColor, {
|
|
107
|
+
size: size * 0.95
|
|
108
|
+
}) : /*#__PURE__*/_jsx(Google.Brand, {
|
|
109
|
+
size: size * 0.95
|
|
110
|
+
}),
|
|
111
|
+
right: /*#__PURE__*/_jsx(Gemini.Combine, {
|
|
112
|
+
size: size,
|
|
113
|
+
type: type
|
|
114
|
+
}),
|
|
115
|
+
size: size
|
|
116
|
+
}, props));
|
|
117
|
+
},
|
|
118
|
+
keywords: [ModelProvider.Google],
|
|
119
|
+
multiple: 0.92
|
|
120
|
+
}, {
|
|
121
|
+
Icon: function Icon(_ref4) {
|
|
122
|
+
var _ref4$size = _ref4.size,
|
|
123
|
+
size = _ref4$size === void 0 ? 24 : _ref4$size,
|
|
124
|
+
_ref4$type = _ref4.type,
|
|
125
|
+
type = _ref4$type === void 0 ? 'color' : _ref4$type,
|
|
126
|
+
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
127
|
+
return /*#__PURE__*/_jsx(Combine, _objectSpread({
|
|
128
|
+
left: /*#__PURE__*/_jsx(Azure.Combine, {
|
|
129
|
+
size: size * 0.92,
|
|
130
|
+
type: type
|
|
131
|
+
}),
|
|
132
|
+
right: /*#__PURE__*/_jsx(OpenAI.Combine, {
|
|
133
|
+
size: size
|
|
134
|
+
}),
|
|
135
|
+
size: size
|
|
136
|
+
}, props));
|
|
137
|
+
},
|
|
138
|
+
keywords: [ModelProvider.Azure]
|
|
139
|
+
}, {
|
|
140
|
+
Icon: Moonshot.Combine,
|
|
141
|
+
keywords: [ModelProvider.Moonshot],
|
|
142
|
+
multiple: 0.9
|
|
143
|
+
}, {
|
|
144
|
+
Icon: OpenAI.Combine,
|
|
145
|
+
keywords: [ModelProvider.OpenAI]
|
|
146
|
+
}, {
|
|
147
|
+
Icon: Ollama.Combine,
|
|
148
|
+
keywords: [ModelProvider.Ollama],
|
|
149
|
+
multiple: 1.16
|
|
150
|
+
}, {
|
|
151
|
+
Icon: Perplexity.Combine,
|
|
152
|
+
keywords: [ModelProvider.Perplexity]
|
|
153
|
+
}, {
|
|
154
|
+
Icon: Minimax.Combine,
|
|
155
|
+
keywords: [ModelProvider.Minimax],
|
|
156
|
+
multiple: 1.3
|
|
157
|
+
}, {
|
|
158
|
+
Icon: Mistral.Combine,
|
|
159
|
+
keywords: [ModelProvider.Mistral],
|
|
160
|
+
multiple: 1.08
|
|
161
|
+
}, {
|
|
162
|
+
Icon: function Icon(_ref5) {
|
|
163
|
+
var _ref5$size = _ref5.size,
|
|
164
|
+
size = _ref5$size === void 0 ? 24 : _ref5$size,
|
|
165
|
+
_ref5$type = _ref5.type,
|
|
166
|
+
type = _ref5$type === void 0 ? 'color' : _ref5$type,
|
|
167
|
+
props = _objectWithoutProperties(_ref5, _excluded5);
|
|
168
|
+
return /*#__PURE__*/_jsx(Combine, _objectSpread({
|
|
169
|
+
left: /*#__PURE__*/_jsx(Anthropic.Text, {
|
|
170
|
+
size: size * 0.75
|
|
171
|
+
}),
|
|
172
|
+
right: /*#__PURE__*/_jsx(Claude.Combine, {
|
|
173
|
+
size: size,
|
|
174
|
+
type: type
|
|
175
|
+
}),
|
|
176
|
+
size: size
|
|
177
|
+
}, props));
|
|
178
|
+
},
|
|
179
|
+
keywords: [ModelProvider.Anthropic],
|
|
180
|
+
multiple: 0.83
|
|
181
|
+
}, {
|
|
182
|
+
Icon: Groq.Combine,
|
|
183
|
+
keywords: [ModelProvider.Groq]
|
|
184
|
+
}, {
|
|
185
|
+
Icon: OpenRouter.Combine,
|
|
186
|
+
keywords: [ModelProvider.OpenRouter],
|
|
187
|
+
multiple: 0.8
|
|
188
|
+
}, {
|
|
189
|
+
Icon: ZeroOne.Combine,
|
|
190
|
+
keywords: [ModelProvider.ZeroOne],
|
|
191
|
+
multiple: 0.9
|
|
192
|
+
}, {
|
|
193
|
+
Icon: Together.Combine,
|
|
194
|
+
keywords: [ModelProvider.TogetherAI]
|
|
195
|
+
}, {
|
|
196
|
+
Icon: Tongyi.Combine,
|
|
197
|
+
keywords: [ModelProvider.Qwen]
|
|
198
|
+
}, {
|
|
199
|
+
Icon: Stepfun.Combine,
|
|
200
|
+
keywords: [ModelProvider.Stepfun],
|
|
201
|
+
multiple: 0.83
|
|
202
|
+
}, {
|
|
203
|
+
Icon: Baichuan.Combine,
|
|
204
|
+
keywords: [ModelProvider.Baichuan],
|
|
205
|
+
multiple: 0.83
|
|
206
|
+
}, {
|
|
207
|
+
Icon: AiMass.Combine,
|
|
208
|
+
keywords: [ModelProvider.Taichu],
|
|
209
|
+
multiple: 1.16
|
|
210
|
+
}, {
|
|
211
|
+
Icon: Ai360.Combine,
|
|
212
|
+
keywords: [ModelProvider.Ai360],
|
|
213
|
+
multiple: 0.83
|
|
214
|
+
}, {
|
|
215
|
+
Icon: Novita.Combine,
|
|
216
|
+
keywords: [ModelProvider.Novita],
|
|
217
|
+
multiple: 0.95
|
|
218
|
+
}, {
|
|
219
|
+
Icon: SiliconCloud.Combine,
|
|
220
|
+
keywords: [ModelProvider.SiliconCloud],
|
|
221
|
+
multiple: 0.75
|
|
222
|
+
}];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ModelProviderKey } from "../ProviderIcon/const";
|
|
3
|
+
export interface ProviderCombineProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
provider?: ModelProviderKey | string;
|
|
6
|
+
size?: number;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
type?: 'mono' | 'color';
|
|
9
|
+
}
|
|
10
|
+
declare const ProviderCombine: import("react").NamedExoticComponent<ProviderCombineProps>;
|
|
11
|
+
export default ProviderCombine;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["provider", "size", "type"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
+
import { memo, useMemo } from 'react';
|
|
14
|
+
import DefaultIcon from "../ProviderIcon/DefaultIcon";
|
|
15
|
+
import { providerMappings } from "./const";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
var ProviderCombine = /*#__PURE__*/memo(function (_ref) {
|
|
18
|
+
var originProvider = _ref.provider,
|
|
19
|
+
_ref$size = _ref.size,
|
|
20
|
+
size = _ref$size === void 0 ? 12 : _ref$size,
|
|
21
|
+
_ref$type = _ref.type,
|
|
22
|
+
type = _ref$type === void 0 ? 'color' : _ref$type,
|
|
23
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var Render = useMemo(function () {
|
|
25
|
+
if (!originProvider) return;
|
|
26
|
+
var provider = originProvider.toLowerCase();
|
|
27
|
+
var _iterator = _createForOfIteratorHelper(providerMappings),
|
|
28
|
+
_step;
|
|
29
|
+
try {
|
|
30
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
31
|
+
var item = _step.value;
|
|
32
|
+
if (item.keywords.some(function (keyword) {
|
|
33
|
+
return new RegExp(keyword, 'i').test(provider);
|
|
34
|
+
})) {
|
|
35
|
+
return item;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} catch (err) {
|
|
39
|
+
_iterator.e(err);
|
|
40
|
+
} finally {
|
|
41
|
+
_iterator.f();
|
|
42
|
+
}
|
|
43
|
+
}, [originProvider]);
|
|
44
|
+
if (!(Render !== null && Render !== void 0 && Render.Icon)) return /*#__PURE__*/_jsx(DefaultIcon, _objectSpread({
|
|
45
|
+
size: size
|
|
46
|
+
}, rest));
|
|
47
|
+
return /*#__PURE__*/_jsx(Render.Icon, _objectSpread(_objectSpread({
|
|
48
|
+
size: size * ((Render === null || Render === void 0 ? void 0 : Render.multiple) || 1),
|
|
49
|
+
type: type
|
|
50
|
+
}, (Render === null || Render === void 0 ? void 0 : Render.props) || {}), rest));
|
|
51
|
+
});
|
|
52
|
+
export default ProviderCombine;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { useTheme } from 'antd-style';
|
|
8
|
+
import { forwardRef } from 'react';
|
|
9
|
+
import { Center } from 'react-layout-kit';
|
|
10
|
+
import DefaultIcon from "./DefaultIcon";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
var DefaultAvatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
|
+
var _ref$shape = _ref.shape,
|
|
14
|
+
shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
|
|
15
|
+
color = _ref.color,
|
|
16
|
+
background = _ref.background,
|
|
17
|
+
size = _ref.size,
|
|
18
|
+
style = _ref.style,
|
|
19
|
+
_ref$iconMultiple = _ref.iconMultiple,
|
|
20
|
+
iconMultiple = _ref$iconMultiple === void 0 ? 0.6 : _ref$iconMultiple,
|
|
21
|
+
iconStyle = _ref.iconStyle,
|
|
22
|
+
iconClassName = _ref.iconClassName;
|
|
23
|
+
var theme = useTheme();
|
|
24
|
+
return /*#__PURE__*/_jsx(Center, {
|
|
25
|
+
flex: 'none',
|
|
26
|
+
ref: ref,
|
|
27
|
+
style: _objectSpread({
|
|
28
|
+
background: background || theme.colorFillSecondary,
|
|
29
|
+
borderRadius: shape === 'circle' ? '50%' : Math.floor(size * 0.1),
|
|
30
|
+
color: color,
|
|
31
|
+
height: size,
|
|
32
|
+
width: size
|
|
33
|
+
}, style),
|
|
34
|
+
children: /*#__PURE__*/_jsx(DefaultIcon, {
|
|
35
|
+
className: iconClassName,
|
|
36
|
+
color: color,
|
|
37
|
+
size: size * iconMultiple,
|
|
38
|
+
style: iconStyle
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
export default DefaultAvatar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
interface DefaultIconProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
declare const DefaultIcon: import("react").ForwardRefExoticComponent<DefaultIconProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export default DefaultIcon;
|