@lobehub/ui 1.70.0 → 1.72.0
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/Features/Item.d.ts +2 -1
- package/es/Features/Item.js +9 -10
- package/es/GridBackground/GridShowcase.js +1 -0
- package/es/LogoThree/Loading.d.ts +5 -0
- package/es/LogoThree/Loading.js +21 -0
- package/es/LogoThree/Logo.d.ts +6 -0
- package/es/LogoThree/Logo.js +66 -0
- package/es/LogoThree/index.d.ts +8 -0
- package/es/LogoThree/index.js +36 -0
- package/es/TokenTag/index.d.ts +0 -1
- package/es/TokenTag/index.js +3 -6
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +6 -1
package/es/Features/Item.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { IconProps } from "../Icon";
|
|
2
3
|
import type { DivProps } from "../types";
|
|
3
4
|
export interface FeatureItem {
|
|
4
5
|
/**
|
|
@@ -16,7 +17,7 @@ export interface FeatureItem {
|
|
|
16
17
|
/**
|
|
17
18
|
* @description The name of the icon to display on the feature item.
|
|
18
19
|
*/
|
|
19
|
-
icon?:
|
|
20
|
+
icon?: IconProps['icon'];
|
|
20
21
|
/**
|
|
21
22
|
* @description The URL of the image to display on the feature item.
|
|
22
23
|
*/
|
package/es/Features/Item.js
CHANGED
|
@@ -3,10 +3,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["style", "className", "row", "column", "description", "image", "title", "link", "icon", "imageStyle", "openExternal"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import { Icon } from "./..";
|
|
7
|
-
import * as LucideIcon from 'lucide-react';
|
|
8
6
|
import { memo } from 'react';
|
|
9
7
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
8
|
+
import Icon from "../Icon";
|
|
10
9
|
import { useStyles } from "./Item.style";
|
|
11
10
|
|
|
12
11
|
// @ts-ignore
|
|
@@ -15,13 +14,16 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
14
|
var Image = /*#__PURE__*/memo(function (_ref) {
|
|
16
15
|
var image = _ref.image,
|
|
17
16
|
className = _ref.className,
|
|
18
|
-
title = _ref.title
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
style = _ref.style;
|
|
19
19
|
return image.startsWith('http') ? /*#__PURE__*/_jsx("img", {
|
|
20
20
|
alt: title,
|
|
21
21
|
className: className,
|
|
22
|
-
src: image
|
|
22
|
+
src: image,
|
|
23
|
+
style: style
|
|
23
24
|
}) : /*#__PURE__*/_jsx(Center, {
|
|
24
25
|
className: className,
|
|
26
|
+
style: style,
|
|
25
27
|
children: image
|
|
26
28
|
});
|
|
27
29
|
});
|
|
@@ -45,9 +47,6 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
|
|
|
45
47
|
}),
|
|
46
48
|
styles = _useStyles.styles,
|
|
47
49
|
cx = _useStyles.cx;
|
|
48
|
-
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
var FeatureIcon = icon && LucideIcon[icon];
|
|
51
50
|
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
52
51
|
className: cx(styles.container, className),
|
|
53
52
|
style: _objectSpread({
|
|
@@ -57,12 +56,12 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
|
|
|
57
56
|
}, props), {}, {
|
|
58
57
|
children: /*#__PURE__*/_jsxs("div", {
|
|
59
58
|
className: styles.cell,
|
|
60
|
-
children: [image ||
|
|
59
|
+
children: [image || icon && /*#__PURE__*/_jsxs(Center, {
|
|
61
60
|
className: styles.imgContainer,
|
|
62
61
|
style: imageStyle,
|
|
63
|
-
children: [
|
|
62
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
64
63
|
className: styles.img,
|
|
65
|
-
icon:
|
|
64
|
+
icon: icon
|
|
66
65
|
}), image && /*#__PURE__*/_jsx(Image, {
|
|
67
66
|
className: styles.img,
|
|
68
67
|
image: image,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Html } from '@react-three/drei';
|
|
2
|
+
import { Loader2 } from 'lucide-react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Center } from 'react-layout-kit';
|
|
5
|
+
import Icon from "../Icon";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
var Loading = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
+
var size = _ref.size;
|
|
9
|
+
return /*#__PURE__*/_jsx(Html, {
|
|
10
|
+
children: /*#__PURE__*/_jsx(Center, {
|
|
11
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
12
|
+
icon: Loader2,
|
|
13
|
+
size: {
|
|
14
|
+
fontSize: size
|
|
15
|
+
},
|
|
16
|
+
spin: true
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export default Loading;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
import { a, config, useSpring } from '@react-spring/three';
|
|
7
|
+
import { useGLTF } from '@react-three/drei';
|
|
8
|
+
import { useFrame } from '@react-three/fiber';
|
|
9
|
+
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var NUM = 10;
|
|
12
|
+
var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var props = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
14
|
+
var ref = useRef(null);
|
|
15
|
+
var _useGLTF = useGLTF('https://gw.alipayobjects.com/os/kitchen/ygwdCZyaMZ/lobehub.gltf'),
|
|
16
|
+
scene = _useGLTF.scene;
|
|
17
|
+
// Hover state
|
|
18
|
+
var _useState = useState(false),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
hovered = _useState2[0],
|
|
21
|
+
setHover = _useState2[1];
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
return void (document.body.style.cursor = hovered ? 'pointer' : 'auto');
|
|
24
|
+
}, [hovered]);
|
|
25
|
+
// Events
|
|
26
|
+
var _useState3 = useState(0),
|
|
27
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
28
|
+
toggle = _useState4[0],
|
|
29
|
+
set = _useState4[1];
|
|
30
|
+
var _useSpring = useSpring({
|
|
31
|
+
config: config.wobbly,
|
|
32
|
+
x: toggle
|
|
33
|
+
}, [toggle]),
|
|
34
|
+
_useSpring2 = _slicedToArray(_useSpring, 1),
|
|
35
|
+
x = _useSpring2[0].x;
|
|
36
|
+
var onPointerOver = useCallback(function () {
|
|
37
|
+
return setHover(true);
|
|
38
|
+
}, []);
|
|
39
|
+
var onPointerOut = useCallback(function () {
|
|
40
|
+
return setHover(false);
|
|
41
|
+
}, []);
|
|
42
|
+
var onClick = useCallback(function () {
|
|
43
|
+
return set(function (toggle) {
|
|
44
|
+
return Number(!toggle);
|
|
45
|
+
});
|
|
46
|
+
}, [set]);
|
|
47
|
+
var rotation = x.to([0, 1], [0, Math.PI * 2]);
|
|
48
|
+
useFrame(function (state) {
|
|
49
|
+
var t = state.clock.getElapsedTime();
|
|
50
|
+
ref.current.rotation.set(Math.cos(t / 4) / NUM, Math.sin(t / 3) / NUM / 2, 0.15 + Math.sin(t / 2) / NUM);
|
|
51
|
+
ref.current.position.y = -0.2 + (0.8 + Math.cos(t / 2)) / 7;
|
|
52
|
+
});
|
|
53
|
+
return /*#__PURE__*/_jsx("group", {
|
|
54
|
+
ref: ref,
|
|
55
|
+
children: /*#__PURE__*/_jsx(a.group, {
|
|
56
|
+
onClick: onClick,
|
|
57
|
+
onPointerOut: onPointerOut,
|
|
58
|
+
onPointerOver: onPointerOver,
|
|
59
|
+
"rotation-y": rotation,
|
|
60
|
+
children: /*#__PURE__*/_jsx("primitive", _objectSpread({
|
|
61
|
+
object: scene
|
|
62
|
+
}, props))
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export default Logo;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import { Canvas } from '@react-three/fiber';
|
|
5
|
+
import { Suspense, memo } from 'react';
|
|
6
|
+
import Loading from "./Loading";
|
|
7
|
+
import Logo from "./Logo";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
var LogoThree = /*#__PURE__*/memo(function (_ref) {
|
|
10
|
+
var _ref$size = _ref.size,
|
|
11
|
+
size = _ref$size === void 0 ? 320 : _ref$size,
|
|
12
|
+
style = _ref.style,
|
|
13
|
+
className = _ref.className;
|
|
14
|
+
return /*#__PURE__*/_jsx(Canvas, {
|
|
15
|
+
camera: {
|
|
16
|
+
fov: 16,
|
|
17
|
+
position: [10, 1, 0]
|
|
18
|
+
},
|
|
19
|
+
className: className,
|
|
20
|
+
style: size ? _objectSpread({
|
|
21
|
+
height: size,
|
|
22
|
+
maxHeight: size,
|
|
23
|
+
maxWidth: size,
|
|
24
|
+
width: size
|
|
25
|
+
}, style) : style,
|
|
26
|
+
children: /*#__PURE__*/_jsx(Suspense, {
|
|
27
|
+
fallback: /*#__PURE__*/_jsx(Loading, {
|
|
28
|
+
size: size / 2 > 48 ? 48 : size / 2
|
|
29
|
+
}),
|
|
30
|
+
children: /*#__PURE__*/_jsx(Logo, {
|
|
31
|
+
rotation: [0, 1.5, 0]
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export default LogoThree;
|
package/es/TokenTag/index.d.ts
CHANGED
package/es/TokenTag/index.js
CHANGED
|
@@ -3,8 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["className", "displayMode", "maxValue", "value", "text"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import {
|
|
7
|
-
import { forwardRef, useRef } from 'react';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
8
7
|
import FluentEmoji from "../FluentEmoji";
|
|
9
8
|
import { ICON_SIZE, useStyles } from "./style";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,8 +16,6 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
17
16
|
value = _ref.value,
|
|
18
17
|
text = _ref.text,
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
var reference = useRef(ref);
|
|
21
|
-
var isHovering = useHover(reference);
|
|
22
19
|
var valueLeft = maxValue - value;
|
|
23
20
|
var percent = valueLeft / maxValue;
|
|
24
21
|
var type;
|
|
@@ -38,12 +35,12 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
35
|
cx = _useStyles.cx;
|
|
39
36
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
40
37
|
className: cx(styles.container, className),
|
|
41
|
-
ref:
|
|
38
|
+
ref: ref
|
|
42
39
|
}, props), {}, {
|
|
43
40
|
children: [/*#__PURE__*/_jsx(FluentEmoji, {
|
|
44
41
|
emoji: emoji,
|
|
45
42
|
size: ICON_SIZE
|
|
46
|
-
}), valueLeft > 0 ? [displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? valueLeft : value
|
|
43
|
+
}), valueLeft > 0 ? [displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? valueLeft : value].join(' ') : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload']
|
|
47
44
|
}));
|
|
48
45
|
});
|
|
49
46
|
export default TokenTag;
|
package/es/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export { Input, type InputProps, TextArea, type TextAreaProps } from './Input';
|
|
|
41
41
|
export { default as Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, } from './Layout';
|
|
42
42
|
export { default as List } from './List';
|
|
43
43
|
export { default as Logo, type LogoProps } from './Logo';
|
|
44
|
+
export { default as LogoThree, type LogoThreeProps } from './LogoThree';
|
|
44
45
|
export { default as Markdown, type MarkdownProps } from './Markdown';
|
|
45
46
|
export { default as MessageInput, type MessageInputProps } from './MessageInput';
|
|
46
47
|
export { default as MessageModal, type MessageModalProps } from './MessageModal';
|
package/es/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export { Input, TextArea } from "./Input";
|
|
|
40
40
|
export { default as Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc } from "./Layout";
|
|
41
41
|
export { default as List } from "./List";
|
|
42
42
|
export { default as Logo } from "./Logo";
|
|
43
|
+
export { default as LogoThree } from "./LogoThree";
|
|
43
44
|
export { default as Markdown } from "./Markdown";
|
|
44
45
|
export { default as MessageInput } from "./MessageInput";
|
|
45
46
|
export { default as MessageModal } from "./MessageModal";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.72.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -75,7 +75,10 @@
|
|
|
75
75
|
"@floating-ui/react": "^0",
|
|
76
76
|
"@giscus/react": "^2",
|
|
77
77
|
"@lobehub/emojilib": "latest",
|
|
78
|
+
"@react-spring/three": "^9",
|
|
78
79
|
"@react-spring/web": "^9",
|
|
80
|
+
"@react-three/drei": "^9",
|
|
81
|
+
"@react-three/fiber": "^8",
|
|
79
82
|
"ahooks": "^3",
|
|
80
83
|
"antd": "^5",
|
|
81
84
|
"chroma-js": "^2",
|
|
@@ -99,6 +102,7 @@
|
|
|
99
102
|
"remark-gfm": "^3",
|
|
100
103
|
"shiki-es": "^0",
|
|
101
104
|
"styled-components": "^6",
|
|
105
|
+
"three": "^0.150",
|
|
102
106
|
"ts-md5": "^1",
|
|
103
107
|
"use-merge-value": "^1",
|
|
104
108
|
"zustand": "^4",
|
|
@@ -113,6 +117,7 @@
|
|
|
113
117
|
"@types/pangu": "^4",
|
|
114
118
|
"@types/react": "^18",
|
|
115
119
|
"@types/react-dom": "^18",
|
|
120
|
+
"@types/three": "^0.149",
|
|
116
121
|
"@vitest/coverage-v8": "latest",
|
|
117
122
|
"antd-style": "^3",
|
|
118
123
|
"babel-plugin-antd-style": "latest",
|