@lobehub/ui 1.115.0 → 1.115.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.
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const Loading: import("react").NamedExoticComponent<{
3
+ size?: number | undefined;
4
+ }>;
5
+ export default Loading;
@@ -0,0 +1,25 @@
1
+ import { Loader2 } from 'lucide-react';
2
+ import { memo } from 'react';
3
+ import { Center } from 'react-layout-kit';
4
+ import Icon from "../Icon";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ var Loading = /*#__PURE__*/memo(function (_ref) {
7
+ var _ref$size = _ref.size,
8
+ size = _ref$size === void 0 ? 32 : _ref$size;
9
+ return /*#__PURE__*/_jsx(Center, {
10
+ height: '100%',
11
+ justify: 'center',
12
+ style: {
13
+ position: 'absolute'
14
+ },
15
+ width: '100%',
16
+ children: /*#__PURE__*/_jsx(Icon, {
17
+ icon: Loader2,
18
+ size: {
19
+ fontSize: size
20
+ },
21
+ spin: true
22
+ })
23
+ });
24
+ });
25
+ export default Loading;
@@ -1,21 +1,47 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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
- import Spline from '@splinetool/react-spline';
5
- import { memo } from 'react';
5
+ import { useThemeMode } from 'antd-style';
6
+ import { Suspense, lazy, memo, useState } from 'react';
7
+ import Loading from "./Loading";
6
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ var Spline = /*#__PURE__*/lazy(function () {
12
+ return import('@splinetool/react-spline');
13
+ });
14
+ var LIGHT = 'https://gw.alipayobjects.com/os/kitchen/J9jiHITGrs/scene.splinecode';
15
+ var DARK = 'https://gw.alipayobjects.com/os/kitchen/CzQKKvSE8a/scene.splinecode';
7
16
  var LogoSpline = /*#__PURE__*/memo(function (_ref) {
8
17
  var className = _ref.className,
9
18
  style = _ref.style,
10
19
  width = _ref.width,
11
20
  height = _ref.height;
12
- return /*#__PURE__*/_jsx(Spline, {
21
+ var _useThemeMode = useThemeMode(),
22
+ isDarkMode = _useThemeMode.isDarkMode;
23
+ var _useState = useState(true),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ loading = _useState2[0],
26
+ setLoading = _useState2[1];
27
+ return /*#__PURE__*/_jsx("div", {
13
28
  className: className,
14
- scene: "https://gw.alipayobjects.com/os/kitchen/bU3%26Ge2wOa/scene.splinecode",
15
29
  style: _objectSpread({
16
30
  height: height,
31
+ position: 'relative',
17
32
  width: width
18
- }, style)
33
+ }, style),
34
+ children: /*#__PURE__*/_jsx(Suspense, {
35
+ fallback: /*#__PURE__*/_jsx(Loading, {}),
36
+ children: /*#__PURE__*/_jsxs(_Fragment, {
37
+ children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx(Spline, {
38
+ onLoad: function onLoad() {
39
+ return setLoading(false);
40
+ },
41
+ scene: isDarkMode ? DARK : LIGHT
42
+ })]
43
+ })
44
+ })
19
45
  });
20
46
  });
21
47
  export default LogoSpline;
@@ -1,20 +1,41 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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
- import Spline from '@splinetool/react-spline';
5
- import { memo } from 'react';
5
+ import { Suspense, lazy, memo, useState } from 'react';
6
+ import Loading from "./Loading";
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ var Spline = /*#__PURE__*/lazy(function () {
11
+ return import('@splinetool/react-spline');
12
+ });
7
13
  var LogoThree = /*#__PURE__*/memo(function (_ref) {
8
14
  var className = _ref.className,
9
15
  style = _ref.style,
10
16
  size = _ref.size;
11
- return /*#__PURE__*/_jsx(Spline, {
17
+ var _useState = useState(true),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ loading = _useState2[0],
20
+ setLoading = _useState2[1];
21
+ return /*#__PURE__*/_jsx("div", {
12
22
  className: className,
13
- scene: "https://gw.alipayobjects.com/os/kitchen/8LH7slSv3s/logo.splinecode",
14
23
  style: _objectSpread({
15
24
  height: size,
25
+ position: 'relative',
16
26
  width: size
17
- }, style)
27
+ }, style),
28
+ children: /*#__PURE__*/_jsx(Suspense, {
29
+ fallback: /*#__PURE__*/_jsx(Loading, {}),
30
+ children: /*#__PURE__*/_jsxs(_Fragment, {
31
+ children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx(Spline, {
32
+ onLoad: function onLoad() {
33
+ return setLoading(false);
34
+ },
35
+ scene: 'https://gw.alipayobjects.com/os/kitchen/8LH7slSv3s/logo.splinecode'
36
+ })]
37
+ })
38
+ })
18
39
  });
19
40
  });
20
41
  export default LogoThree;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.115.0",
3
+ "version": "1.115.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",