@lobehub/ui 6.0.4 → 6.0.6

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.
Files changed (37) hide show
  1. package/es/Accordion/style.d.mts +2 -2
  2. package/es/AutoComplete/style.d.mts +1 -1
  3. package/es/Video/context.mjs.map +1 -1
  4. package/es/Video/parts/Frame.mjs +10 -2
  5. package/es/Video/parts/Frame.mjs.map +1 -1
  6. package/es/Video/parts/Root.mjs +4 -2
  7. package/es/Video/parts/Root.mjs.map +1 -1
  8. package/es/Video/sizing.mjs +7 -0
  9. package/es/Video/sizing.mjs.map +1 -0
  10. package/es/awesome/index.d.mts +1 -4
  11. package/es/awesome/index.mjs +1 -2
  12. package/es/brand/index.d.mts +1 -3
  13. package/es/brand/index.mjs +1 -3
  14. package/es/{brand → spline}/LogoThree/Loading.mjs +1 -1
  15. package/es/spline/LogoThree/Loading.mjs.map +1 -0
  16. package/es/{brand → spline}/LogoThree/LogoSpline.d.mts +3 -3
  17. package/es/{brand → spline}/LogoThree/LogoSpline.mjs +2 -2
  18. package/es/{brand → spline}/LogoThree/LogoSpline.mjs.map +1 -1
  19. package/es/{brand → spline}/LogoThree/index.d.mts +3 -3
  20. package/es/{brand → spline}/LogoThree/index.mjs +2 -2
  21. package/es/{brand → spline}/LogoThree/index.mjs.map +1 -1
  22. package/es/{awesome → spline}/Spline/ParentSize.mjs +1 -1
  23. package/es/spline/Spline/ParentSize.mjs.map +1 -0
  24. package/es/spline/Spline/Spine.d.mts +7 -0
  25. package/es/{awesome → spline}/Spline/Spine.mjs +10 -5
  26. package/es/spline/Spline/Spine.mjs.map +1 -0
  27. package/es/{awesome → spline}/Spline/type.d.mts +1 -1
  28. package/es/spline/index.d.mts +6 -0
  29. package/es/spline/index.d.ts +1 -0
  30. package/es/spline/index.js +1 -0
  31. package/es/spline/index.mjs +4 -0
  32. package/package.json +11 -2
  33. package/es/awesome/Spline/ParentSize.mjs.map +0 -1
  34. package/es/awesome/Spline/Spine.d.mts +0 -7
  35. package/es/awesome/Spline/Spine.mjs.map +0 -1
  36. package/es/brand/LogoThree/Loading.mjs.map +0 -1
  37. /package/es/{awesome → spline}/Spline/index.d.mts +0 -0
@@ -2,13 +2,13 @@ import "@stylexjs/stylex";
2
2
  //#region src/Accordion/style.d.ts
3
3
  export declare const accordionStyles: {
4
4
  panel: string;
5
+ header: string;
5
6
  action: string;
6
7
  content: string;
7
8
  trigger: string;
8
- header: string;
9
- item: string;
10
9
  root: string;
11
10
  indicator: string;
11
+ item: string;
12
12
  itemOutlined: string;
13
13
  rootOutlined: string;
14
14
  actionAlwaysVisible: string;
@@ -42,7 +42,7 @@ declare const styleArrays: {
42
42
  }> | Readonly<{
43
43
  readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
44
44
  readonly cursor: stylex.StyleXClassNameFor<"cursor", "default">;
45
- readonly display: stylex.StyleXClassNameFor<"display", "flex" | "none">;
45
+ readonly display: stylex.StyleXClassNameFor<"display", "none" | "flex">;
46
46
  }>)[];
47
47
  item: Readonly<{
48
48
  readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
@@ -1 +1 @@
1
- {"version":3,"file":"context.mjs","names":[],"sources":["../../src/Video/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\nimport type { VideoStore } from './store';\nimport type { VideoMarker, VideoMediaProps, VideoSection } from './type';\n\nexport interface VideoConfig {\n fps: number;\n markers: VideoMarker[];\n onMarkerClick?: (marker: VideoMarker) => void;\n onRetry?: () => Promise<unknown> | void;\n playbackRates?: number[];\n sections: VideoSection[];\n}\n\nexport interface VideoContextValue {\n config: VideoConfig;\n media: VideoMediaProps;\n store: VideoStore;\n}\n\nexport const VideoContext = createContext<VideoContextValue | null>(null);\n\nexport const useVideoContext = () => {\n const value = use(VideoContext);\n if (!value) throw new Error('Video parts must be rendered inside <Video.Root>.');\n return value;\n};\n\nexport interface FrameContextValue {\n hold: (held: boolean) => void;\n overlay: boolean;\n setOverlay: (overlay: boolean) => void;\n visible: boolean;\n}\n\nexport const FrameContext = createContext<FrameContextValue | null>(null);\n"],"mappings":";;;AAsBA,MAAa,eAAe,cAAwC,IAAI;AAExE,MAAa,wBAAwB;CACnC,MAAM,QAAQ,IAAI,YAAY;CAC9B,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,mDAAmD;CAC/E,OAAO;AACT;AASA,MAAa,eAAe,cAAwC,IAAI"}
1
+ {"version":3,"file":"context.mjs","names":[],"sources":["../../src/Video/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\nimport type { VideoStore } from './store';\nimport type { VideoMarker, VideoMediaProps, VideoSection } from './type';\n\nexport interface VideoConfig {\n fps: number;\n markers: VideoMarker[];\n maxHeight?: number;\n onMarkerClick?: (marker: VideoMarker) => void;\n onRetry?: () => Promise<unknown> | void;\n playbackRates?: number[];\n sections: VideoSection[];\n}\n\nexport interface VideoContextValue {\n config: VideoConfig;\n media: VideoMediaProps;\n store: VideoStore;\n}\n\nexport const VideoContext = createContext<VideoContextValue | null>(null);\n\nexport const useVideoContext = () => {\n const value = use(VideoContext);\n if (!value) throw new Error('Video parts must be rendered inside <Video.Root>.');\n return value;\n};\n\nexport interface FrameContextValue {\n hold: (held: boolean) => void;\n overlay: boolean;\n setOverlay: (overlay: boolean) => void;\n visible: boolean;\n}\n\nexport const FrameContext = createContext<FrameContextValue | null>(null);\n"],"mappings":";;;AAuBA,MAAa,eAAe,cAAwC,IAAI;AAExE,MAAa,wBAAwB;CACnC,MAAM,QAAQ,IAAI,YAAY;CAC9B,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,mDAAmD;CAC/E,OAAO;AACT;AASA,MAAa,eAAe,cAAwC,IAAI"}
@@ -3,6 +3,8 @@ import { styleProps } from "../../styles/stylex/props.mjs";
3
3
  import { FrameContext, useVideoContext } from "../context.mjs";
4
4
  import { styles } from "../style.mjs";
5
5
  import { useVideo } from "../useVideo.mjs";
6
+ import { useFullscreen } from "../useFullscreen.mjs";
7
+ import { aspectOf, frameWidthOf } from "../sizing.mjs";
6
8
  import { useControlsIdle } from "../useControlsIdle.mjs";
7
9
  import { useEffect, useMemo, useRef, useState } from "react";
8
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -15,7 +17,8 @@ const isFocusVisible = (element) => {
15
17
  }
16
18
  };
17
19
  const Frame = ({ children, className, style }) => {
18
- const { media, store } = useVideoContext();
20
+ const { config, media, store } = useVideoContext();
21
+ const fullscreen = useFullscreen(store);
19
22
  const videoRef = useRef(null);
20
23
  const pointerTypeRef = useRef("mouse");
21
24
  const size = useVideo((state) => state.size);
@@ -38,11 +41,16 @@ const Frame = ({ children, className, style }) => {
38
41
  overlay
39
42
  ]);
40
43
  const aspectRatio = size?.height ? `${size.width} / ${size.height}` : "16 / 9";
44
+ const sizing = !(config.maxHeight !== void 0 && !fullscreen && frameWidthOf(config.maxHeight, aspectOf(size)) < 480) ? { aspectRatio } : overlay ? { aspectRatio: `480 / ${config.maxHeight}` } : {
45
+ aspectRatio,
46
+ marginInline: "auto",
47
+ maxWidth: `${frameWidthOf(config.maxHeight, aspectOf(size))}px`
48
+ };
41
49
  return /* @__PURE__ */ jsx(FrameContext, {
42
50
  value: frame,
43
51
  children: /* @__PURE__ */ jsxs("div", {
44
52
  ...styleProps(styles.frame, className, {
45
- aspectRatio,
53
+ ...sizing,
46
54
  ...style
47
55
  }),
48
56
  onBlur: (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Frame.mjs","names":[],"sources":["../../../src/Video/parts/Frame.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { FrameContext, type FrameContextValue, useVideoContext } from '../context';\nimport { styles } from '../style';\nimport type { VideoFrameProps } from '../type';\nimport { useControlsIdle } from '../useControlsIdle';\nimport { useVideo } from '../useVideo';\n\nconst isFocusVisible = (element: Element) => {\n try {\n return element.matches(':focus-visible');\n } catch {\n return true;\n }\n};\n\nconst Frame = ({ children, className, style }: VideoFrameProps) => {\n const { media, store } = useVideoContext();\n const videoRef = useRef<HTMLVideoElement>(null);\n const pointerTypeRef = useRef('mouse');\n const size = useVideo((state) => state.size);\n const idleForced = useVideo((state) => state.paused || state.status !== 'ready');\n const idle = useControlsIdle(idleForced);\n const [overlay, setOverlay] = useState(false);\n\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n return store.attach(video);\n }, [store, media.src]);\n\n const frame = useMemo<FrameContextValue>(\n () => ({ hold: idle.hold, overlay, setOverlay, visible: idle.visible }),\n [idle.hold, idle.visible, overlay],\n );\n\n const aspectRatio = size?.height ? `${size.width} / ${size.height}` : '16 / 9';\n\n return (\n <FrameContext value={frame}>\n <div\n {...styleProps(styles.frame, className, { aspectRatio, ...style })}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null))\n idle.setFocused(false);\n }}\n onFocus={(event) => {\n idle.setFocused(isFocusVisible(event.target));\n }}\n onPointerDownCapture={(event) => {\n pointerTypeRef.current = event.pointerType || 'mouse';\n }}\n onPointerLeave={(event) => {\n if (event.pointerType !== 'touch') idle.sleep();\n }}\n onPointerMove={(event) => {\n if (event.pointerType !== 'touch') idle.wake();\n }}\n >\n <video\n playsInline\n autoPlay={media.autoPlay}\n loop={media.loop}\n poster={media.poster}\n preload={media.preload}\n ref={videoRef}\n src={media.src}\n onEnded={media.onEnded}\n onError={media.onError}\n onPause={media.onPause}\n onPlay={media.onPlay}\n onTimeUpdate={media.onTimeUpdate}\n {...styleProps(styles.video)}\n />\n <div\n data-video-surface=\"\"\n {...styleProps(styles.surface)}\n onDoubleClick={() => store.toggleFullscreen()}\n onClick={() => {\n if (pointerTypeRef.current === 'touch' && !idle.visible) {\n idle.wake();\n return;\n }\n if (pointerTypeRef.current === 'touch') idle.wake();\n store.toggle();\n }}\n />\n {children}\n </div>\n </FrameContext>\n );\n};\n\nFrame.displayName = 'VideoFrame';\n\nexport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xB,IAAI,MAAM,gBAAgB,SAAS,KAAK,KAAK;GAC/C;GAjBF,UAAA;IAmBE,oBAAC,SAAD;KACE,aAAA;KACA,UAAU,MAAM;KAChB,MAAM,MAAM;KACZ,QAAQ,MAAM;KACd,SAAS,MAAM;KACf,KAAK;KACL,KAAK,MAAM;KACX,SAAS,MAAM;KACf,SAAS,MAAM;KACf,SAAS,MAAM;KACf,QAAQ,MAAM;KACd,cAAc,MAAM;KACpB,GAAI,WAAW,OAAO,KAAK;IAC5B,CAAA;IACD,oBAAC,OAAD;KACE,sBAAmB;KACnB,GAAI,WAAW,OAAO,OAAO;KAC7B,qBAAqB,MAAM,iBAAiB;KAC5C,eAAe;MACb,IAAI,eAAe,YAAY,WAAW,CAAC,KAAK,SAAS;OACvD,KAAK,KAAK;OACV;MACF;MACA,IAAI,eAAe,YAAY,SAAS,KAAK,KAAK;MAClD,MAAM,OAAO;KACf;IACD,CAAA;IACA;GACE;;CACO,CAAA;AAElB;AAEA,MAAM,cAAc"}
1
+ {"version":3,"file":"Frame.mjs","names":[],"sources":["../../../src/Video/parts/Frame.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { FrameContext, type FrameContextValue, useVideoContext } from '../context';\nimport { aspectOf, frameWidthOf, MIN_PLAYER_WIDTH } from '../sizing';\nimport { styles } from '../style';\nimport type { VideoFrameProps } from '../type';\nimport { useControlsIdle } from '../useControlsIdle';\nimport { useFullscreen } from '../useFullscreen';\nimport { useVideo } from '../useVideo';\n\nconst isFocusVisible = (element: Element) => {\n try {\n return element.matches(':focus-visible');\n } catch {\n return true;\n }\n};\n\nconst Frame = ({ children, className, style }: VideoFrameProps) => {\n const { config, media, store } = useVideoContext();\n const fullscreen = useFullscreen(store);\n const videoRef = useRef<HTMLVideoElement>(null);\n const pointerTypeRef = useRef('mouse');\n const size = useVideo((state) => state.size);\n const idleForced = useVideo((state) => state.paused || state.status !== 'ready');\n const idle = useControlsIdle(idleForced);\n const [overlay, setOverlay] = useState(false);\n\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n return store.attach(video);\n }, [store, media.src]);\n\n const frame = useMemo<FrameContextValue>(\n () => ({ hold: idle.hold, overlay, setOverlay, visible: idle.visible }),\n [idle.hold, idle.visible, overlay],\n );\n\n const aspectRatio = size?.height ? `${size.width} / ${size.height}` : '16 / 9';\n const narrow =\n config.maxHeight !== undefined &&\n !fullscreen &&\n frameWidthOf(config.maxHeight, aspectOf(size)) < MIN_PLAYER_WIDTH;\n // Overlay controls live inside the frame, so it widens and letterboxes the\n // video; controls below leave the frame at the video's own width, keeping\n // children positioned in video coordinates aligned.\n const sizing = !narrow\n ? { aspectRatio }\n : overlay\n ? { aspectRatio: `${MIN_PLAYER_WIDTH} / ${config.maxHeight}` }\n : {\n aspectRatio,\n marginInline: 'auto',\n maxWidth: `${frameWidthOf(config.maxHeight!, aspectOf(size))}px`,\n };\n\n return (\n <FrameContext value={frame}>\n <div\n {...styleProps(styles.frame, className, { ...sizing, ...style })}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null))\n idle.setFocused(false);\n }}\n onFocus={(event) => {\n idle.setFocused(isFocusVisible(event.target));\n }}\n onPointerDownCapture={(event) => {\n pointerTypeRef.current = event.pointerType || 'mouse';\n }}\n onPointerLeave={(event) => {\n if (event.pointerType !== 'touch') idle.sleep();\n }}\n onPointerMove={(event) => {\n if (event.pointerType !== 'touch') idle.wake();\n }}\n >\n <video\n playsInline\n autoPlay={media.autoPlay}\n loop={media.loop}\n poster={media.poster}\n preload={media.preload}\n ref={videoRef}\n src={media.src}\n onEnded={media.onEnded}\n onError={media.onError}\n onPause={media.onPause}\n onPlay={media.onPlay}\n onTimeUpdate={media.onTimeUpdate}\n {...styleProps(styles.video)}\n />\n <div\n data-video-surface=\"\"\n {...styleProps(styles.surface)}\n onDoubleClick={() => store.toggleFullscreen()}\n onClick={() => {\n if (pointerTypeRef.current === 'touch' && !idle.visible) {\n idle.wake();\n return;\n }\n if (pointerTypeRef.current === 'touch') idle.wake();\n store.toggle();\n }}\n />\n {children}\n </div>\n </FrameContext>\n );\n};\n\nFrame.displayName = 'VideoFrame';\n\nexport default Frame;\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,kBAAkB,YAAqB;CAC3C,IAAI;EACF,OAAO,QAAQ,QAAQ,gBAAgB;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,MAAM,SAAS,EAAE,UAAU,WAAW,YAA6B;CACjE,MAAM,EAAE,QAAQ,OAAO,UAAU,gBAAgB;CACjD,MAAM,aAAa,cAAc,KAAK;CACtC,MAAM,WAAW,OAAyB,IAAI;CAC9C,MAAM,iBAAiB,OAAO,OAAO;CACrC,MAAM,OAAO,UAAU,UAAU,MAAM,IAAI;CAC3C,MAAM,aAAa,UAAU,UAAU,MAAM,UAAU,MAAM,WAAW,OAAO;CAC/E,MAAM,OAAO,gBAAgB,UAAU;CACvC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,gBAAgB;EACd,MAAM,QAAQ,SAAS;EACvB,IAAI,CAAC,OAAO;EACZ,OAAO,MAAM,OAAO,KAAK;CAC3B,GAAG,CAAC,OAAO,MAAM,GAAG,CAAC;CAErB,MAAM,QAAQ,eACL;EAAE,MAAM,KAAK;EAAM;EAAS;EAAY,SAAS,KAAK;CAAQ,IACrE;EAAC,KAAK;EAAM,KAAK;EAAS;CAAO,CACnC;CAEA,MAAM,cAAc,MAAM,SAAS,GAAG,KAAK,MAAM,KAAK,KAAK,WAAW;CAQtE,MAAM,SAAS,EANb,OAAO,cAAc,KAAA,KACrB,CAAC,cACD,aAAa,OAAO,WAAW,SAAS,IAAI,CAAC,IAAA,OAK3C,EAAE,YAAY,IACd,UACE,EAAE,aAAa,SAAyB,OAAO,YAAY,IAC3D;EACE;EACA,cAAc;EACd,UAAU,GAAG,aAAa,OAAO,WAAY,SAAS,IAAI,CAAC,EAAE;CAC/D;CAEN,OACE,oBAAC,cAAD;EAAc,OAAO;EACnB,UAAA,qBAAC,OAAD;GACE,GAAI,WAAW,OAAO,OAAO,WAAW;IAAE,GAAG;IAAQ,GAAG;GAAM,CAAC;GAC/D,SAAS,UAAU;IACjB,IAAI,CAAC,MAAM,cAAc,SAAS,MAAM,aAA4B,GAClE,KAAK,WAAW,KAAK;GACzB;GACA,UAAU,UAAU;IAClB,KAAK,WAAW,eAAe,MAAM,MAAM,CAAC;GAC9C;GACA,uBAAuB,UAAU;IAC/B,eAAe,UAAU,MAAM,eAAe;GAChD;GACA,iBAAiB,UAAU;IACzB,IAAI,MAAM,gBAAgB,SAAS,KAAK,MAAM;GAChD;GACA,gBAAgB,UAAU;IACxB,IAAI,MAAM,gBAAgB,SAAS,KAAK,KAAK;GAC/C;GAjBF,UAAA;IAmBE,oBAAC,SAAD;KACE,aAAA;KACA,UAAU,MAAM;KAChB,MAAM,MAAM;KACZ,QAAQ,MAAM;KACd,SAAS,MAAM;KACf,KAAK;KACL,KAAK,MAAM;KACX,SAAS,MAAM;KACf,SAAS,MAAM;KACf,SAAS,MAAM;KACf,QAAQ,MAAM;KACd,cAAc,MAAM;KACpB,GAAI,WAAW,OAAO,KAAK;IAC5B,CAAA;IACD,oBAAC,OAAD;KACE,sBAAmB;KACnB,GAAI,WAAW,OAAO,OAAO;KAC7B,qBAAqB,MAAM,iBAAiB;KAC5C,eAAe;MACb,IAAI,eAAe,YAAY,WAAW,CAAC,KAAK,SAAS;OACvD,KAAK,KAAK;OACV;MACF;MACA,IAAI,eAAe,YAAY,SAAS,KAAK,KAAK;MAClD,MAAM,OAAO;KACf;IACD,CAAA;IACA;GACE;;CACO,CAAA;AAElB;AAEA,MAAM,cAAc"}
@@ -6,6 +6,7 @@ import { sortSections } from "../time.mjs";
6
6
  import { createVideoStore } from "../store.mjs";
7
7
  import { useVideoState } from "../useVideo.mjs";
8
8
  import { handleVideoKey } from "../useKeyboard.mjs";
9
+ import { aspectOf, playerWidthOf } from "../sizing.mjs";
9
10
  import { useImperativeHandle, useLayoutEffect, useMemo, useState } from "react";
10
11
  import { jsx } from "react/jsx-runtime";
11
12
  //#region src/Video/parts/Root.tsx
@@ -38,18 +39,18 @@ const Root = ({ ref, player, src, poster, autoPlay, loop, preload = "metadata",
38
39
  if (!captions) store.setCaptions(false);
39
40
  }, [store]);
40
41
  const size = useVideoState(store, (state) => state.size);
41
- const aspect = size?.height ? size.width / size.height : 16 / 9;
42
42
  const sizing = maxHeight === void 0 ? {
43
43
  height,
44
44
  width
45
45
  } : {
46
- maxWidth: `${Math.round(maxHeight * aspect)}px`,
46
+ maxWidth: `${playerWidthOf(maxHeight, aspectOf(size))}px`,
47
47
  width: "100%"
48
48
  };
49
49
  const value = useMemo(() => ({
50
50
  config: {
51
51
  fps,
52
52
  markers,
53
+ maxHeight,
53
54
  onMarkerClick,
54
55
  onRetry,
55
56
  playbackRates,
@@ -73,6 +74,7 @@ const Root = ({ ref, player, src, poster, autoPlay, loop, preload = "metadata",
73
74
  fps,
74
75
  loop,
75
76
  markers,
77
+ maxHeight,
76
78
  onEnded,
77
79
  onError,
78
80
  onMarkerClick,
@@ -1 +1 @@
1
- {"version":3,"file":"Root.mjs","names":[],"sources":["../../../src/Video/parts/Root.tsx"],"sourcesContent":["'use client';\n\nimport { useImperativeHandle, useLayoutEffect, useMemo, useState } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { VideoContext, type VideoContextValue } from '../context';\nimport { createVideoStore, type VideoStore } from '../store';\nimport { styles } from '../style';\nimport { sortSections } from '../time';\nimport type { VideoMarker, VideoRootProps, VideoSection } from '../type';\nimport { handleVideoKey } from '../useKeyboard';\nimport { useVideoState } from '../useVideo';\n\nconst NO_MARKERS: VideoMarker[] = [];\nconst NO_SECTIONS: VideoSection[] = [];\n\nconst Root = ({\n ref,\n player,\n src,\n poster,\n autoPlay,\n loop,\n preload = 'metadata',\n onPlay,\n onPause,\n onEnded,\n onError,\n onTimeUpdate,\n sections = NO_SECTIONS,\n markers = NO_MARKERS,\n fps = 30,\n playbackRates,\n defaultPlaybackRate,\n muted,\n onMutedChange,\n onRateChange,\n onMarkerClick,\n onRetry,\n captions = true,\n width,\n height,\n maxHeight,\n className,\n style,\n children,\n}: VideoRootProps) => {\n const [ownStore] = useState(createVideoStore);\n const store = (player as VideoStore | undefined) ?? ownStore;\n\n // Assigned during render so the store already has them when a child Frame\n // attaches its <video> in an effect, which runs before this component's own.\n store.setOptions({ defaultPlaybackRate, muted, onMutedChange, onRateChange });\n\n useImperativeHandle(ref, () => store, [store]);\n\n const sorted = useMemo(() => sortSections(sections), [sections]);\n\n useLayoutEffect(() => {\n store.setData({ fps, markers, sections: sorted });\n }, [store, fps, markers, sorted]);\n\n useLayoutEffect(() => {\n if (!captions) store.setCaptions(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store]);\n\n const size = useVideoState(store, (state) => state.size);\n const aspect = size?.height ? size.width / size.height : 16 / 9;\n const sizing =\n maxHeight === undefined\n ? { height, width }\n : { maxWidth: `${Math.round(maxHeight * aspect)}px`, width: '100%' };\n\n const value = useMemo<VideoContextValue>(\n () => ({\n config: { fps, markers, onMarkerClick, onRetry, playbackRates, sections: sorted },\n media: {\n autoPlay,\n loop,\n onEnded,\n onError,\n onPause,\n onPlay,\n onTimeUpdate,\n poster,\n preload,\n src,\n },\n store,\n }),\n [\n autoPlay,\n fps,\n loop,\n markers,\n onEnded,\n onError,\n onMarkerClick,\n onPause,\n onPlay,\n onRetry,\n onTimeUpdate,\n playbackRates,\n poster,\n preload,\n sorted,\n src,\n store,\n ],\n );\n\n return (\n <VideoContext value={value}>\n <div\n ref={store.attachRoot}\n tabIndex={0}\n onKeyDown={(event) => {\n if (handleVideoKey(event, store, playbackRates)) event.preventDefault();\n }}\n {...styleProps(styles.root, className, { ...sizing, ...style })}\n >\n {children}\n </div>\n </VideoContext>\n );\n};\n\nRoot.displayName = 'VideoRoot';\n\nexport default Root;\n"],"mappings":";;;;;;;;;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,OAAD;GACE,KAAK,MAAM;GACX,UAAU;GACV,YAAY,UAAU;IACpB,IAAI,eAAe,OAAO,OAAO,aAAa,GAAG,MAAM,eAAe;GACxE;GACA,GAAI,WAAW,OAAO,MAAM,WAAW;IAAE,GAAG;IAAQ,GAAG;GAAM,CAAC;GAE7D;EACE,CAAA;CACO,CAAA;AAElB;AAEA,KAAK,cAAc"}
1
+ {"version":3,"file":"Root.mjs","names":[],"sources":["../../../src/Video/parts/Root.tsx"],"sourcesContent":["'use client';\n\nimport { useImperativeHandle, useLayoutEffect, useMemo, useState } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { VideoContext, type VideoContextValue } from '../context';\nimport { aspectOf, playerWidthOf } from '../sizing';\nimport { createVideoStore, type VideoStore } from '../store';\nimport { styles } from '../style';\nimport { sortSections } from '../time';\nimport type { VideoMarker, VideoRootProps, VideoSection } from '../type';\nimport { handleVideoKey } from '../useKeyboard';\nimport { useVideoState } from '../useVideo';\n\nconst NO_MARKERS: VideoMarker[] = [];\nconst NO_SECTIONS: VideoSection[] = [];\n\nconst Root = ({\n ref,\n player,\n src,\n poster,\n autoPlay,\n loop,\n preload = 'metadata',\n onPlay,\n onPause,\n onEnded,\n onError,\n onTimeUpdate,\n sections = NO_SECTIONS,\n markers = NO_MARKERS,\n fps = 30,\n playbackRates,\n defaultPlaybackRate,\n muted,\n onMutedChange,\n onRateChange,\n onMarkerClick,\n onRetry,\n captions = true,\n width,\n height,\n maxHeight,\n className,\n style,\n children,\n}: VideoRootProps) => {\n const [ownStore] = useState(createVideoStore);\n const store = (player as VideoStore | undefined) ?? ownStore;\n\n // Assigned during render so the store already has them when a child Frame\n // attaches its <video> in an effect, which runs before this component's own.\n store.setOptions({ defaultPlaybackRate, muted, onMutedChange, onRateChange });\n\n useImperativeHandle(ref, () => store, [store]);\n\n const sorted = useMemo(() => sortSections(sections), [sections]);\n\n useLayoutEffect(() => {\n store.setData({ fps, markers, sections: sorted });\n }, [store, fps, markers, sorted]);\n\n useLayoutEffect(() => {\n if (!captions) store.setCaptions(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store]);\n\n const size = useVideoState(store, (state) => state.size);\n const sizing =\n maxHeight === undefined\n ? { height, width }\n : { maxWidth: `${playerWidthOf(maxHeight, aspectOf(size))}px`, width: '100%' };\n\n const value = useMemo<VideoContextValue>(\n () => ({\n config: { fps, markers, maxHeight, onMarkerClick, onRetry, playbackRates, sections: sorted },\n media: {\n autoPlay,\n loop,\n onEnded,\n onError,\n onPause,\n onPlay,\n onTimeUpdate,\n poster,\n preload,\n src,\n },\n store,\n }),\n [\n autoPlay,\n fps,\n loop,\n markers,\n maxHeight,\n onEnded,\n onError,\n onMarkerClick,\n onPause,\n onPlay,\n onRetry,\n onTimeUpdate,\n playbackRates,\n poster,\n preload,\n sorted,\n src,\n store,\n ],\n );\n\n return (\n <VideoContext value={value}>\n <div\n ref={store.attachRoot}\n tabIndex={0}\n onKeyDown={(event) => {\n if (handleVideoKey(event, store, playbackRates)) event.preventDefault();\n }}\n {...styleProps(styles.root, className, { ...sizing, ...style })}\n >\n {children}\n </div>\n </VideoContext>\n );\n};\n\nRoot.displayName = 'VideoRoot';\n\nexport default Root;\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,aAA4B,CAAC;AACnC,MAAM,cAA8B,CAAC;AAErC,MAAM,QAAQ,EACZ,KACA,QACA,KACA,QACA,UACA,MACA,UAAU,YACV,QACA,SACA,SACA,SACA,cACA,WAAW,aACX,UAAU,YACV,MAAM,IACN,eACA,qBACA,OACA,eACA,cACA,eACA,SACA,WAAW,MACX,OACA,QACA,WACA,WACA,OACA,eACoB;CACpB,MAAM,CAAC,YAAY,SAAS,gBAAgB;CAC5C,MAAM,QAAS,UAAqC;CAIpD,MAAM,WAAW;EAAE;EAAqB;EAAO;EAAe;CAAa,CAAC;CAE5E,oBAAoB,WAAW,OAAO,CAAC,KAAK,CAAC;CAE7C,MAAM,SAAS,cAAc,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;CAE/D,sBAAsB;EACpB,MAAM,QAAQ;GAAE;GAAK;GAAS,UAAU;EAAO,CAAC;CAClD,GAAG;EAAC;EAAO;EAAK;EAAS;CAAM,CAAC;CAEhC,sBAAsB;EACpB,IAAI,CAAC,UAAU,MAAM,YAAY,KAAK;CAExC,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,OAAO,cAAc,QAAQ,UAAU,MAAM,IAAI;CACvD,MAAM,SACJ,cAAc,KAAA,IACV;EAAE;EAAQ;CAAM,IAChB;EAAE,UAAU,GAAG,cAAc,WAAW,SAAS,IAAI,CAAC,EAAE;EAAK,OAAO;CAAO;CAEjF,MAAM,QAAQ,eACL;EACL,QAAQ;GAAE;GAAK;GAAS;GAAW;GAAe;GAAS;GAAe,UAAU;EAAO;EAC3F,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,cAAD;EAAqB;EACnB,UAAA,oBAAC,OAAD;GACE,KAAK,MAAM;GACX,UAAU;GACV,YAAY,UAAU;IACpB,IAAI,eAAe,OAAO,OAAO,aAAa,GAAG,MAAM,eAAe;GACxE;GACA,GAAI,WAAW,OAAO,MAAM,WAAW;IAAE,GAAG;IAAQ,GAAG;GAAM,CAAC;GAE7D;EACE,CAAA;CACO,CAAA;AAElB;AAEA,KAAK,cAAc"}
@@ -0,0 +1,7 @@
1
+ const aspectOf = (size) => size?.height ? size.width / size.height : 16 / 9;
2
+ const frameWidthOf = (maxHeight, aspect) => Math.round(maxHeight * aspect);
3
+ const playerWidthOf = (maxHeight, aspect) => Math.max(480, frameWidthOf(maxHeight, aspect));
4
+ //#endregion
5
+ export { aspectOf, frameWidthOf, playerWidthOf };
6
+
7
+ //# sourceMappingURL=sizing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizing.mjs","names":[],"sources":["../../src/Video/sizing.ts"],"sourcesContent":["import type { VideoState } from './type';\n\n// Room for the widest control row (frame stepping, captions, speed, fullscreen),\n// so a portrait recording capped by maxHeight never pushes controls out of view.\nexport const MIN_PLAYER_WIDTH = 480;\n\nexport const aspectOf = (size: VideoState['size']) =>\n size?.height ? size.width / size.height : 16 / 9;\n\nexport const frameWidthOf = (maxHeight: number, aspect: number) => Math.round(maxHeight * aspect);\n\nexport const playerWidthOf = (maxHeight: number, aspect: number) =>\n Math.max(MIN_PLAYER_WIDTH, frameWidthOf(maxHeight, aspect));\n"],"mappings":"AAMA,MAAa,YAAY,SACvB,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK;AAEjD,MAAa,gBAAgB,WAAmB,WAAmB,KAAK,MAAM,YAAY,MAAM;AAEhG,MAAa,iBAAiB,WAAmB,WAC/C,KAAK,IAAA,KAAsB,aAAa,WAAW,MAAM,CAAC"}
@@ -58,13 +58,10 @@ import "./LandingSection/index.mjs";
58
58
  import { LogoMarqueeItem, LogoMarqueeProps } from "./LogoMarquee/type.mjs";
59
59
  import LogoMarquee from "./LogoMarquee/LogoMarquee.mjs";
60
60
  import "./LogoMarquee/index.mjs";
61
- import { SplineProps } from "./Spline/type.mjs";
62
- import Spline from "./Spline/Spine.mjs";
63
- import "./Spline/index.mjs";
64
61
  import { SpotlightProps } from "./Spotlight/type.mjs";
65
62
  import Spotlight from "./Spotlight/Spotlight.mjs";
66
63
  import "./Spotlight/index.mjs";
67
64
  import { CursorStyle, SegmentMode, TypewriterEffectProps } from "./TypewriterEffect/type.mjs";
68
65
  import TypewriterEffect from "./TypewriterEffect/TypewriterEffect.mjs";
69
66
  import "./TypewriterEffect/index.mjs";
70
- export { AgentSkillCard, type AgentSkillCardAgent, type AgentSkillCardMode, type AgentSkillCardPanel, type AgentSkillCardProps, AuroraBackground, type AuroraBackgroundProps, BentoCard, type BentoCardProps, BentoGrid, type BentoGridProps, BottomGradientButton, type BottomGradientButtonProps, CodeShowcase, type CodeShowcaseItem, type CodeShowcaseProps, type CursorStyle, DEFAULT_SKILL_AGENTS, FeatureGrid, type FeatureGridItem, type FeatureGridProps, type FeatureItemType, Features, type FeaturesProps, FluidGradient, type FluidGradientProps, Giscus, type GiscusProps, GradientButton, type GradientButtonProps, Grainient, type GrainientProps, GridBackground, type GridBackgroundProps, GridShowcase, type GridShowcaseProps, Hero, type HeroAction, type HeroProps, InstallBanner, type InstallBannerProps, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, type LandingAction, LandingHero, type LandingHeroAction, type LandingHeroProps, type LandingLinkProps, type LandingLinkRender, type LandingNavigate, type LandingPalette, LandingSection, type LandingSectionProps, LogoMarquee, type LogoMarqueeItem, type LogoMarqueeProps, type SegmentMode, Spline, type SplineProps, Spotlight, SpotlightCard, type SpotlightCardProps, type SpotlightProps, TypewriterEffect, type TypewriterEffectProps, accentGradient as landingAccentGradient };
67
+ export { AgentSkillCard, type AgentSkillCardAgent, type AgentSkillCardMode, type AgentSkillCardPanel, type AgentSkillCardProps, AuroraBackground, type AuroraBackgroundProps, BentoCard, type BentoCardProps, BentoGrid, type BentoGridProps, BottomGradientButton, type BottomGradientButtonProps, CodeShowcase, type CodeShowcaseItem, type CodeShowcaseProps, type CursorStyle, DEFAULT_SKILL_AGENTS, FeatureGrid, type FeatureGridItem, type FeatureGridProps, type FeatureItemType, Features, type FeaturesProps, FluidGradient, type FluidGradientProps, Giscus, type GiscusProps, GradientButton, type GradientButtonProps, Grainient, type GrainientProps, GridBackground, type GridBackgroundProps, GridShowcase, type GridShowcaseProps, Hero, type HeroAction, type HeroProps, InstallBanner, type InstallBannerProps, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, type LandingAction, LandingHero, type LandingHeroAction, type LandingHeroProps, type LandingLinkProps, type LandingLinkRender, type LandingNavigate, type LandingPalette, LandingSection, type LandingSectionProps, LogoMarquee, type LogoMarqueeItem, type LogoMarqueeProps, type SegmentMode, Spotlight, SpotlightCard, type SpotlightCardProps, type SpotlightProps, TypewriterEffect, type TypewriterEffectProps, accentGradient as landingAccentGradient };
@@ -21,6 +21,5 @@ import InstallBanner from "./InstallBanner/InstallBanner.mjs";
21
21
  import LandingHero from "./LandingHero/LandingHero.mjs";
22
22
  import LandingSection from "./LandingSection/LandingSection.mjs";
23
23
  import LogoMarquee from "./LogoMarquee/LogoMarquee.mjs";
24
- import Spline from "./Spline/Spine.mjs";
25
24
  import TypewriterEffect from "./TypewriterEffect/TypewriterEffect.mjs";
26
- export { AgentSkillCard, AuroraBackground, BentoCard, BentoGrid, BottomGradientButton, CodeShowcase, DEFAULT_SKILL_AGENTS, FeatureGrid, Features, FluidGradient, Giscus, GradientButton, Grainient, GridBackground, GridShowcase, Hero, InstallBanner, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, LandingHero, LandingSection, LogoMarquee, Spline, Spotlight, SpotlightCard, TypewriterEffect, accentGradient as landingAccentGradient };
25
+ export { AgentSkillCard, AuroraBackground, BentoCard, BentoGrid, BottomGradientButton, CodeShowcase, DEFAULT_SKILL_AGENTS, FeatureGrid, Features, FluidGradient, Giscus, GradientButton, Grainient, GridBackground, GridShowcase, Hero, InstallBanner, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, LandingHero, LandingSection, LogoMarquee, Spotlight, SpotlightCard, TypewriterEffect, accentGradient as landingAccentGradient };
@@ -6,6 +6,4 @@ import LobeHubText from "./LobeHubText/index.mjs";
6
6
  import Logo3d from "./Logo3d/index.mjs";
7
7
  import _default from "./LogoFlat/index.mjs";
8
8
  import icons_default from "./LogoMono/index.mjs";
9
- import LogoThree, { LogoThreeProps } from "./LogoThree/index.mjs";
10
- import LogoSpline, { LogoSplineProps } from "./LogoThree/LogoSpline.mjs";
11
- export { BrandLoading, type BrandLoadingProps, LobeChat, type LobeChatProps, LobeChatText, LobeHub, type LobeHubProps, LobeHubText, Logo3d, _default as LogoFlat, icons_default as LogoMono, LogoSpline, type LogoSplineProps, LogoThree, type LogoThreeProps };
9
+ export { BrandLoading, type BrandLoadingProps, LobeChat, type LobeChatProps, LobeChatText, LobeHub, type LobeHubProps, LobeHubText, Logo3d, _default as LogoFlat, icons_default as LogoMono };
@@ -6,6 +6,4 @@ import icons_default from "./LogoMono/index.mjs";
6
6
  import LobeChat from "./LobeChat/index.mjs";
7
7
  import LobeHubText from "./LobeHubText/index.mjs";
8
8
  import LobeHub from "./LobeHub/index.mjs";
9
- import LogoThree from "./LogoThree/index.mjs";
10
- import LogoSpline from "./LogoThree/LogoSpline.mjs";
11
- export { BrandLoading, LobeChat, LobeChatText, LobeHub, LobeHubText, Logo3d, LogoFlat_default as LogoFlat, icons_default as LogoMono, LogoSpline, LogoThree };
9
+ export { BrandLoading, LobeChat, LobeChatText, LobeHub, LobeHubText, Logo3d, LogoFlat_default as LogoFlat, icons_default as LogoMono };
@@ -2,7 +2,7 @@ import Icon from "../../Icon/Icon.mjs";
2
2
  import Center from "../../Flex/Center.mjs";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Loader2 } from "lucide-react";
5
- //#region src/brand/LogoThree/Loading.tsx
5
+ //#region src/spline/LogoThree/Loading.tsx
6
6
  const Loading = ({ size = 32 }) => {
7
7
  return /* @__PURE__ */ jsx(Center, {
8
8
  height: "100%",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loading.mjs","names":[],"sources":["../../../src/spline/LogoThree/Loading.tsx"],"sourcesContent":["import { Loader2 } from 'lucide-react';\nimport { type FC } from 'react';\n\nimport { Center } from '@/Flex';\nimport Icon from '@/Icon';\n\nconst Loading: FC<{ size?: number }> = ({ size = 32 }) => {\n return (\n <Center height={'100%'} justify={'center'} style={{ position: 'absolute' }} width={'100%'}>\n <Icon spin icon={Loader2} size={size} />\n </Center>\n );\n};\n\nexport default Loading;\n"],"mappings":";;;;;AAMA,MAAM,WAAkC,EAAE,OAAO,SAAS;CACxD,OACE,oBAAC,QAAD;EAAQ,QAAQ;EAAQ,SAAS;EAAU,OAAO,EAAE,UAAU,WAAW;EAAG,OAAO;EACjF,UAAA,oBAAC,MAAD;GAAM,MAAA;GAAK,MAAM;GAAe;EAAO,CAAA;CACjC,CAAA;AAEZ"}
@@ -1,7 +1,7 @@
1
- import { SplineProps } from "../../awesome/Spline/type.mjs";
2
- import "../../awesome/Spline/index.mjs";
1
+ import { SplineProps } from "../Spline/type.mjs";
2
+ import "../Spline/index.mjs";
3
3
  import { CSSProperties } from "react";
4
- //#region src/brand/LogoThree/LogoSpline.d.ts
4
+ //#region src/spline/LogoThree/LogoSpline.d.ts
5
5
  export interface LogoSplineProps extends Partial<SplineProps> {
6
6
  className?: string;
7
7
  height?: number | string;
@@ -1,9 +1,9 @@
1
1
  import { useThemeMode } from "../../styles/theme/scope.mjs";
2
- import Spline from "../../awesome/Spline/Spine.mjs";
2
+ import Spline from "../Spline/Spine.mjs";
3
3
  import Loading from "./Loading.mjs";
4
4
  import { memo, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/brand/LogoThree/LogoSpline.tsx
6
+ //#region src/spline/LogoThree/LogoSpline.tsx
7
7
  const LIGHT = "https://hub-apac-1.lobeobjects.space/light.splinecode";
8
8
  const DARK = "https://hub-apac-1.lobeobjects.space/dark.splinecode";
9
9
  const LogoSpline = memo(({ className, style, width, height, onLoad, ...rest }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"LogoSpline.mjs","names":[],"sources":["../../../src/brand/LogoThree/LogoSpline.tsx"],"sourcesContent":["import { type CSSProperties, memo, useState } from 'react';\n\nimport Spline, { type SplineProps } from '@/awesome/Spline';\nimport { useThemeMode } from '@/styles/theme/scope';\n\nimport Loading from './Loading';\n\nconst LIGHT = 'https://hub-apac-1.lobeobjects.space/light.splinecode';\nconst DARK = 'https://hub-apac-1.lobeobjects.space/dark.splinecode';\n\nexport interface LogoSplineProps extends Partial<SplineProps> {\n className?: string;\n height?: number | string;\n style?: CSSProperties;\n width?: number | string;\n}\n\nconst LogoSpline = memo<LogoSplineProps>(({ className, style, width, height, onLoad, ...rest }) => {\n const { isDarkMode } = useThemeMode();\n const [loading, setLoading] = useState(true);\n return (\n <div className={className} style={{ height, position: 'relative', width, ...style }}>\n {loading && <Loading />}\n <Spline\n scene={isDarkMode ? DARK : LIGHT}\n onLoad={(splineApp) => {\n setLoading(false);\n onLoad?.(splineApp);\n }}\n {...rest}\n />\n </div>\n );\n});\n\nexport default LogoSpline;\n"],"mappings":";;;;;;AAOA,MAAM,QAAQ;AACd,MAAM,OAAO;AASb,MAAM,aAAa,MAAuB,EAAE,WAAW,OAAO,OAAO,QAAQ,QAAQ,GAAG,WAAW;CACjG,MAAM,EAAE,eAAe,aAAa;CACpC,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAC3C,OACE,qBAAC,OAAD;EAAgB;EAAW,OAAO;GAAE;GAAQ,UAAU;GAAY;GAAO,GAAG;EAAM;EAAlF,UAAA,CACG,WAAW,oBAAC,SAAD,CAAU,CAAA,GACtB,oBAAC,QAAD;GACE,OAAO,aAAa,OAAO;GAC3B,SAAS,cAAc;IACrB,WAAW,KAAK;IAChB,SAAS,SAAS;GACpB;GACA,GAAI;EACL,CAAA,CACE;;AAET,CAAC"}
1
+ {"version":3,"file":"LogoSpline.mjs","names":[],"sources":["../../../src/spline/LogoThree/LogoSpline.tsx"],"sourcesContent":["import { type CSSProperties, memo, useState } from 'react';\n\nimport Spline, { type SplineProps } from '@/spline/Spline';\nimport { useThemeMode } from '@/styles/theme/scope';\n\nimport Loading from './Loading';\n\nconst LIGHT = 'https://hub-apac-1.lobeobjects.space/light.splinecode';\nconst DARK = 'https://hub-apac-1.lobeobjects.space/dark.splinecode';\n\nexport interface LogoSplineProps extends Partial<SplineProps> {\n className?: string;\n height?: number | string;\n style?: CSSProperties;\n width?: number | string;\n}\n\nconst LogoSpline = memo<LogoSplineProps>(({ className, style, width, height, onLoad, ...rest }) => {\n const { isDarkMode } = useThemeMode();\n const [loading, setLoading] = useState(true);\n return (\n <div className={className} style={{ height, position: 'relative', width, ...style }}>\n {loading && <Loading />}\n <Spline\n scene={isDarkMode ? DARK : LIGHT}\n onLoad={(splineApp) => {\n setLoading(false);\n onLoad?.(splineApp);\n }}\n {...rest}\n />\n </div>\n );\n});\n\nexport default LogoSpline;\n"],"mappings":";;;;;;AAOA,MAAM,QAAQ;AACd,MAAM,OAAO;AASb,MAAM,aAAa,MAAuB,EAAE,WAAW,OAAO,OAAO,QAAQ,QAAQ,GAAG,WAAW;CACjG,MAAM,EAAE,eAAe,aAAa;CACpC,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAC3C,OACE,qBAAC,OAAD;EAAgB;EAAW,OAAO;GAAE;GAAQ,UAAU;GAAY;GAAO,GAAG;EAAM;EAAlF,UAAA,CACG,WAAW,oBAAC,SAAD,CAAU,CAAA,GACtB,oBAAC,QAAD;GACE,OAAO,aAAa,OAAO;GAC3B,SAAS,cAAc;IACrB,WAAW,KAAK;IAChB,SAAS,SAAS;GACpB;GACA,GAAI;EACL,CAAA,CACE;;AAET,CAAC"}
@@ -1,7 +1,7 @@
1
- import { SplineProps } from "../../awesome/Spline/type.mjs";
2
- import "../../awesome/Spline/index.mjs";
1
+ import { SplineProps } from "../Spline/type.mjs";
2
+ import "../Spline/index.mjs";
3
3
  import { CSSProperties } from "react";
4
- //#region src/brand/LogoThree/index.d.ts
4
+ //#region src/spline/LogoThree/index.d.ts
5
5
  export interface LogoThreeProps extends Partial<SplineProps> {
6
6
  className?: string;
7
7
  size?: number;
@@ -2,10 +2,10 @@
2
2
  import { useCdnFn } from "../../ConfigProvider/index.mjs";
3
3
  import FlexBasic_default from "../../Flex/FlexBasic.mjs";
4
4
  import Img from "../../Img/index.mjs";
5
- import Spline from "../../awesome/Spline/Spine.mjs";
5
+ import Spline from "../Spline/Spine.mjs";
6
6
  import { memo, useState } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/brand/LogoThree/index.tsx
8
+ //#region src/spline/LogoThree/index.tsx
9
9
  const LOGO_3D = {
10
10
  path: "assets/logo-3d.webp",
11
11
  pkg: "@lobehub/assets-logo",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Flexbox"],"sources":["../../../src/brand/LogoThree/index.tsx"],"sourcesContent":["'use client';\n\nimport { type CSSProperties, memo, useState } from 'react';\n\nimport Spline, { type SplineProps } from '@/awesome/Spline';\nimport { useCdnFn } from '@/ConfigProvider';\nimport { Flexbox } from '@/Flex';\nimport Img from '@/Img';\n\nconst LOGO_3D = {\n path: 'assets/logo-3d.webp',\n pkg: '@lobehub/assets-logo',\n version: '1.2.0',\n};\n\nexport interface LogoThreeProps extends Partial<SplineProps> {\n className?: string;\n size?: number;\n style?: CSSProperties;\n}\n\nconst LogoThree = memo<LogoThreeProps>(({ className, style, size = 128, onLoad, ...rest }) => {\n const genCdnUrl = useCdnFn();\n const [loading, setLoading] = useState(true);\n return (\n <Flexbox\n align={'center'}\n className={className}\n flex={'none'}\n justify={'center'}\n style={{ height: size, overflow: 'hidden', position: 'relative', width: size, ...style }}\n >\n {loading && (\n <Img\n alt={'logo'}\n height={size * 0.75}\n src={genCdnUrl(LOGO_3D)}\n style={{ position: 'absolute' }}\n width={size * 0.75}\n />\n )}\n <Spline\n scene={'https://hub-apac-1.lobeobjects.space/logo.splinecode'}\n style={{\n flex: 'none',\n height: size,\n width: size,\n }}\n onLoad={(splineApp) => {\n setLoading(false);\n onLoad?.(splineApp);\n }}\n {...rest}\n />\n </Flexbox>\n );\n});\n\nLogoThree.displayName = 'LobeHubLogoThree';\n\nexport default LogoThree;\n"],"mappings":";;;;;;;;AASA,MAAM,UAAU;CACd,MAAM;CACN,KAAK;CACL,SAAS;AACX;AAQA,MAAM,YAAY,MAAsB,EAAE,WAAW,OAAO,OAAO,KAAK,QAAQ,GAAG,WAAW;CAC5F,MAAM,YAAY,SAAS;CAC3B,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAC3C,OACE,qBAACA,mBAAD;EACE,OAAO;EACI;EACX,MAAM;EACN,SAAS;EACT,OAAO;GAAE,QAAQ;GAAM,UAAU;GAAU,UAAU;GAAY,OAAO;GAAM,GAAG;EAAM;EALzF,UAAA,CAOG,WACC,oBAAC,KAAD;GACE,KAAK;GACL,QAAQ,OAAO;GACf,KAAK,UAAU,OAAO;GACtB,OAAO,EAAE,UAAU,WAAW;GAC9B,OAAO,OAAO;EACf,CAAA,GAEH,oBAAC,QAAD;GACE,OAAO;GACP,OAAO;IACL,MAAM;IACN,QAAQ;IACR,OAAO;GACT;GACA,SAAS,cAAc;IACrB,WAAW,KAAK;IAChB,SAAS,SAAS;GACpB;GACA,GAAI;EACL,CAAA,CACM;;AAEb,CAAC;AAED,UAAU,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":["Flexbox"],"sources":["../../../src/spline/LogoThree/index.tsx"],"sourcesContent":["'use client';\n\nimport { type CSSProperties, memo, useState } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport { Flexbox } from '@/Flex';\nimport Img from '@/Img';\nimport Spline, { type SplineProps } from '@/spline/Spline';\n\nconst LOGO_3D = {\n path: 'assets/logo-3d.webp',\n pkg: '@lobehub/assets-logo',\n version: '1.2.0',\n};\n\nexport interface LogoThreeProps extends Partial<SplineProps> {\n className?: string;\n size?: number;\n style?: CSSProperties;\n}\n\nconst LogoThree = memo<LogoThreeProps>(({ className, style, size = 128, onLoad, ...rest }) => {\n const genCdnUrl = useCdnFn();\n const [loading, setLoading] = useState(true);\n return (\n <Flexbox\n align={'center'}\n className={className}\n flex={'none'}\n justify={'center'}\n style={{ height: size, overflow: 'hidden', position: 'relative', width: size, ...style }}\n >\n {loading && (\n <Img\n alt={'logo'}\n height={size * 0.75}\n src={genCdnUrl(LOGO_3D)}\n style={{ position: 'absolute' }}\n width={size * 0.75}\n />\n )}\n <Spline\n scene={'https://hub-apac-1.lobeobjects.space/logo.splinecode'}\n style={{\n flex: 'none',\n height: size,\n width: size,\n }}\n onLoad={(splineApp) => {\n setLoading(false);\n onLoad?.(splineApp);\n }}\n {...rest}\n />\n </Flexbox>\n );\n});\n\nLogoThree.displayName = 'LobeHubLogoThree';\n\nexport default LogoThree;\n"],"mappings":";;;;;;;;AASA,MAAM,UAAU;CACd,MAAM;CACN,KAAK;CACL,SAAS;AACX;AAQA,MAAM,YAAY,MAAsB,EAAE,WAAW,OAAO,OAAO,KAAK,QAAQ,GAAG,WAAW;CAC5F,MAAM,YAAY,SAAS;CAC3B,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAC3C,OACE,qBAACA,mBAAD;EACE,OAAO;EACI;EACX,MAAM;EACN,SAAS;EACT,OAAO;GAAE,QAAQ;GAAM,UAAU;GAAU,UAAU;GAAY,OAAO;GAAM,GAAG;EAAM;EALzF,UAAA,CAOG,WACC,oBAAC,KAAD;GACE,KAAK;GACL,QAAQ,OAAO;GACf,KAAK,UAAU,OAAO;GACtB,OAAO,EAAE,UAAU,WAAW;GAC9B,OAAO,OAAO;EACf,CAAA,GAEH,oBAAC,QAAD;GACE,OAAO;GACP,OAAO;IACL,MAAM;IACN,QAAQ;IACR,OAAO;GACT;GACA,SAAS,cAAc;IACrB,WAAW,KAAK;IAChB,SAAS,SAAS;GACpB;GACA,GAAI;EACL,CAAA,CACM;;AAEb,CAAC;AAED,UAAU,cAAc"}
@@ -2,7 +2,7 @@ import { mergeRefs } from "../../utils/mergeRefs.mjs";
2
2
  import { memo, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { debounce } from "es-toolkit/compat";
5
- //#region src/awesome/Spline/ParentSize.tsx
5
+ //#region src/spline/Spline/ParentSize.tsx
6
6
  const defaultIgnoreDimensions = [];
7
7
  const defaultParentSizeStyles = {
8
8
  height: "100%",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParentSize.mjs","names":[],"sources":["../../../src/spline/Spline/ParentSize.tsx"],"sourcesContent":["import { debounce } from 'es-toolkit/compat';\nimport {\n type CSSProperties,\n memo,\n type ReactNode,\n type Ref,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { mergeRefs } from '@/utils/mergeRefs';\n\ninterface ResizeObserverCallback {\n (entries: ResizeObserverEntry[], observer: ResizeObserver): void;\n}\n\ninterface ResizeObserverPolyfill {\n new (callback: ResizeObserverCallback): ResizeObserver;\n}\n\n// @TODO remove when upgraded to TS 4 which has its own declaration\ninterface PrivateWindow {\n ResizeObserver: ResizeObserverPolyfill;\n}\n\nexport interface ParentSizeProps {\n /** Child render function `({ width, height, top, left, ref, resize }) => ReactNode`. */\n children: (\n args: {\n ref: HTMLDivElement | null;\n resize: (state: ParentSizeState) => void;\n } & ParentSizeState,\n ) => ReactNode;\n /** Optional `className` to add to the parent `div` wrapper used for size measurement. */\n className?: string;\n /** Child render updates upon resize are delayed until `debounceTime` milliseconds _after_ the last resize event is observed. */\n debounceTime?: number;\n /** Optional flag to toggle leading debounce calls. When set to true this will ensure that the component always renders immediately. (defaults to true) */\n enableDebounceLeadingCall?: boolean;\n /** Optional dimensions provided won't trigger a state change when changed. */\n ignoreDimensions?: keyof ParentSizeState | (keyof ParentSizeState)[];\n /** Optional `style` object to apply to the parent `div` wrapper used for size measurement. */\n parentSizeStyles?: CSSProperties;\n ref?: Ref<HTMLDivElement>;\n /** Optionally inject a ResizeObserver polyfill, else this *must* be globally available. */\n resizeObserverPolyfill?: ResizeObserverPolyfill;\n}\n\ntype ParentSizeState = {\n height: number;\n left: number;\n top: number;\n width: number;\n};\n\nexport type ParentSizeProvidedProps = ParentSizeState;\n\nconst defaultIgnoreDimensions: ParentSizeProps['ignoreDimensions'] = [];\nconst defaultParentSizeStyles = { height: '100%', width: '100%' };\n\nconst ParentSize = memo<ParentSizeProps>(\n ({\n ref,\n className,\n children,\n debounceTime = 300,\n ignoreDimensions = defaultIgnoreDimensions,\n parentSizeStyles,\n enableDebounceLeadingCall = true,\n resizeObserverPolyfill,\n ...restProps\n }) => {\n const target = useRef<HTMLDivElement | null>(null);\n const animationFrameID = useRef(0);\n\n const [state, setState] = useState<ParentSizeState>({\n height: 0,\n left: 0,\n top: 0,\n width: 0,\n });\n\n const resize = useMemo(() => {\n const normalized = Array.isArray(ignoreDimensions) ? ignoreDimensions : [ignoreDimensions];\n\n return debounce(\n (incoming: ParentSizeState) => {\n setState((existing) => {\n const stateKeys = Object.keys(existing) as (keyof ParentSizeState)[];\n const keysWithChanges = stateKeys.filter((key) => existing[key] !== incoming[key]);\n const shouldBail = keysWithChanges.every((key) => normalized.includes(key));\n\n return shouldBail ? existing : incoming;\n });\n },\n debounceTime,\n { leading: enableDebounceLeadingCall },\n );\n }, [debounceTime, enableDebounceLeadingCall, ignoreDimensions]);\n\n useEffect(() => {\n const LocalResizeObserver =\n resizeObserverPolyfill || (window as unknown as PrivateWindow).ResizeObserver;\n\n const observer = new LocalResizeObserver((entries) => {\n for (const entry of entries) {\n const { left, top, width, height } = entry?.contentRect ?? {};\n animationFrameID.current = window.requestAnimationFrame(() => {\n resize({ height, left, top, width });\n });\n }\n });\n if (target.current) observer.observe(target.current);\n\n return () => {\n window.cancelAnimationFrame(animationFrameID.current);\n observer.disconnect();\n resize.cancel();\n };\n }, [resize, resizeObserverPolyfill]);\n\n return (\n <div\n className={className}\n ref={mergeRefs<HTMLDivElement>([ref, target])}\n style={{ ...defaultParentSizeStyles, ...parentSizeStyles }}\n {...restProps}\n >\n {children({\n ...state,\n ref: target.current,\n resize,\n })}\n </div>\n );\n },\n);\n\nexport default ParentSize;\n"],"mappings":";;;;;AA2DA,MAAM,0BAA+D,CAAC;AACtE,MAAM,0BAA0B;CAAE,QAAQ;CAAQ,OAAO;AAAO;AAEhE,MAAM,aAAa,MAChB,EACC,KACA,WACA,UACA,eAAe,KACf,mBAAmB,yBACnB,kBACA,4BAA4B,MAC5B,wBACA,GAAG,gBACC;CACJ,MAAM,SAA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";
2
+ import { SPEObject, SplineEvent as SplineEvent$1, SplineEventName } from "@splinetool/runtime";
3
+ //#region src/spline/Spline/Spine.d.ts
4
+ declare const Spline: import("react").NamedExoticComponent<SplineProps>;
5
+ //#endregion
6
+ export { type SPEObject, type SplineEvent$1 as SplineEvent, type SplineEventName, Spline as default };
7
+ //# sourceMappingURL=Spine.d.mts.map
@@ -2,8 +2,7 @@
2
2
  import ParentSize from "./ParentSize.mjs";
3
3
  import { memo, useEffect, useRef, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import { Application } from "@splinetool/runtime";
6
- //#region src/awesome/Spline/Spine.tsx
5
+ //#region src/spline/Spline/Spine.tsx
7
6
  const Spline = memo(({ ref, scene, style, onMouseDown, onMouseUp, onMouseHover, onKeyDown, onKeyUp, onStart, onLookAt, onFollow, onWheel, onLoad, renderOnDemand = true, ...props }) => {
8
7
  const canvasRef = useRef(null);
9
8
  const [isLoading, setIsLoading] = useState(true);
@@ -15,6 +14,9 @@ const Spline = memo(({ ref, scene, style, onMouseDown, onMouseUp, onMouseHover,
15
14
  };
16
15
  useEffect(() => {
17
16
  setIsLoading(true);
17
+ const canvas = canvasRef.current;
18
+ if (!canvas) return;
19
+ let disposed = false;
18
20
  let speApp;
19
21
  const events = [
20
22
  {
@@ -54,11 +56,14 @@ const Spline = memo(({ ref, scene, style, onMouseDown, onMouseUp, onMouseHover,
54
56
  name: "scroll"
55
57
  }
56
58
  ];
57
- if (canvasRef.current) {
58
- speApp = new Application(canvasRef.current, { renderOnDemand });
59
+ import("@splinetool/runtime").then((runtime) => {
60
+ if (disposed) return;
61
+ speApp = new runtime.Application(canvas, { renderOnDemand });
59
62
  init(speApp, events);
60
- }
63
+ });
61
64
  return () => {
65
+ disposed = true;
66
+ if (!speApp) return;
62
67
  for (const event of events) if (event.cb) speApp.removeEventListener(event.name, event.cb);
63
68
  speApp.dispose();
64
69
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spine.mjs","names":[],"sources":["../../../src/spline/Spline/Spine.tsx"],"sourcesContent":["'use client';\n\nimport type { Application, SplineEvent, SplineEventName } from '@splinetool/runtime';\nimport { memo, useEffect, useRef, useState } from 'react';\n\nimport ParentSize from './ParentSize';\nimport { type SplineProps } from './type';\n\nconst Spline = memo<SplineProps>(\n ({\n ref,\n scene,\n style,\n onMouseDown,\n onMouseUp,\n onMouseHover,\n onKeyDown,\n onKeyUp,\n onStart,\n onLookAt,\n onFollow,\n onWheel,\n onLoad,\n renderOnDemand = true,\n ...props\n }) => {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const init = async (\n speApp: Application,\n events: {\n cb?: (e: SplineEvent) => void;\n name: SplineEventName;\n }[],\n ) => {\n await speApp.load(scene);\n\n for (const event of events) {\n if (event.cb) {\n speApp.addEventListener(event.name, event.cb);\n }\n }\n\n setIsLoading(false);\n onLoad?.(speApp);\n };\n\n // Initialize runtime when component is mounted\n useEffect(() => {\n setIsLoading(true);\n\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n let disposed = false;\n let speApp: Application | undefined;\n const events: {\n cb?: (e: SplineEvent) => void;\n name: SplineEventName;\n }[] = [\n {\n cb: onMouseDown,\n name: 'mouseDown',\n },\n {\n cb: onMouseUp,\n name: 'mouseUp',\n },\n {\n cb: onMouseHover,\n name: 'mouseHover',\n },\n {\n cb: onKeyDown,\n name: 'keyDown',\n },\n {\n cb: onKeyUp,\n name: 'keyUp',\n },\n {\n cb: onStart,\n name: 'start',\n },\n {\n cb: onLookAt,\n name: 'lookAt',\n },\n {\n cb: onFollow,\n name: 'follow',\n },\n {\n cb: onWheel,\n name: 'scroll',\n },\n ];\n\n void import('@splinetool/runtime').then((runtime) => {\n if (disposed) return;\n speApp = new runtime.Application(canvas, { renderOnDemand });\n void init(speApp, events);\n });\n\n return () => {\n disposed = true;\n if (!speApp) return;\n for (const event of events) {\n if (event.cb) {\n speApp.removeEventListener(event.name, event.cb);\n }\n }\n speApp.dispose();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scene]);\n\n return (\n <ParentSize debounceTime={50} parentSizeStyles={style} ref={ref} {...props}>\n {() => {\n return (\n <canvas\n ref={canvasRef}\n style={{\n display: isLoading ? 'none' : 'block',\n }}\n />\n );\n }}\n </ParentSize>\n );\n },\n);\n\nSpline.displayName = 'Spline';\n\nexport default Spline;\n\nexport type { SPEObject, SplineEvent, SplineEventName } from '@splinetool/runtime';\n"],"mappings":";;;;;AAQA,MAAM,SAAS,MACZ,EACC,KACA,OACA,OACA,aACA,WACA,cACA,WACA,SACA,SACA,UACA,UACA,SACA,QACA,iBAAiB,MACjB,GAAG,YACC;CACJ,MAAM,YAAY,OAA0B,IAAI;CAChD,MAAM,CAAC,WAAW,gBAAgB,SAAS,IAAI;CAE/C,MAAM,OAAO,OACX,QACA,WAIG;EACH,MAAM,OAAO,KAAK,KAAK;EAEvB,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,IACR,OAAO,iBAAiB,MAAM,MAAM,MAAM,EAAE;EAIhD,aAAa,KAAK;EAClB,SAAS,MAAM;CACjB;CAGA,gBAAgB;EACd,aAAa,IAAI;EAEjB,MAAM,SAAS,UAAU;EACzB,IAAI,CAAC,QAAQ;EAEb,IAAI,WAAW;EACf,IAAI;EACJ,MAAM,SAGA;GACJ;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;EACF;EAEA,OAAY,sBAAsB,CAAC,MAAM,YAAY;GACnD,IAAI,UAAU;GACd,SAAS,IAAI,QAAQ,YAAY,QAAQ,EAAE,eAAe,CAAC;GAC3D,KAAU,QAAQ,MAAM;EAC1B,CAAC;EAED,aAAa;GACX,WAAW;GACX,IAAI,CAAC,QAAQ;GACb,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,IACR,OAAO,oBAAoB,MAAM,MAAM,MAAM,EAAE;GAGnD,OAAO,QAAQ;EACjB;CAEF,GAAG,CAAC,KAAK,CAAC;CAEV,OACE,oBAAC,YAAD;EAAY,cAAc;EAAI,kBAAkB;EAAY;EAAK,GAAI;EAC5D,gBAAA;GACL,OACE,oBAAC,UAAD;IACE,KAAK;IACL,OAAO,EACL,SAAS,YAAY,SAAS,QAChC;GACD,CAAA;EAEL;CACU,CAAA;AAEhB,CACF;AAEA,OAAO,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, Ref } from "react";
2
2
  import { Application, SplineEvent } from "@splinetool/runtime";
3
- //#region src/awesome/Spline/type.d.ts
3
+ //#region src/spline/Spline/type.d.ts
4
4
  export interface SplineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onLoad' | 'onMouseDown' | 'onMouseUp' | 'onMouseHover' | 'onKeyDown' | 'onKeyUp' | 'onWheel'> {
5
5
  onFollow?: (e: SplineEvent) => void;
6
6
  onKeyDown?: (e: SplineEvent) => void;
@@ -0,0 +1,6 @@
1
+ import { SplineProps } from "./Spline/type.mjs";
2
+ import Spline, { SPEObject, SplineEvent, SplineEventName } from "./Spline/Spine.mjs";
3
+ import "./Spline/index.mjs";
4
+ import LogoThree, { LogoThreeProps } from "./LogoThree/index.mjs";
5
+ import LogoSpline, { LogoSplineProps } from "./LogoThree/LogoSpline.mjs";
6
+ export { LogoSpline, type LogoSplineProps, LogoThree, type LogoThreeProps, type SPEObject, Spline, type SplineEvent, type SplineEventName, type SplineProps };
@@ -0,0 +1 @@
1
+ export * from './index.d.mts';
@@ -0,0 +1 @@
1
+ export * from './index.mjs';
@@ -0,0 +1,4 @@
1
+ import Spline from "./Spline/Spine.mjs";
2
+ import LogoThree from "./LogoThree/index.mjs";
3
+ import LogoSpline from "./LogoThree/LogoSpline.mjs";
4
+ export { LogoSpline, LogoThree, Spline };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "6.0.4",
3
+ "version": "6.0.6",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -49,6 +49,10 @@
49
49
  "types": "./es/brand/index.d.mts",
50
50
  "import": "./es/brand/index.mjs"
51
51
  },
52
+ "./spline": {
53
+ "types": "./es/spline/index.d.mts",
54
+ "import": "./es/spline/index.mjs"
55
+ },
52
56
  "./chat": {
53
57
  "types": "./es/chat/index.d.mts",
54
58
  "import": "./es/chat/index.mjs"
@@ -149,7 +153,6 @@
149
153
  "@shikijs/core": "^4.5.0",
150
154
  "@shikijs/stream": "^4.5.0",
151
155
  "@shikijs/transformers": "^4.5.0",
152
- "@splinetool/runtime": "1.12.98",
153
156
  "@stylexjs/stylex": "0.19.1",
154
157
  "@tanstack/form-core": "^1.33.5",
155
158
  "@tanstack/react-table": "^9.2.8",
@@ -188,10 +191,16 @@
188
191
  "peerDependencies": {
189
192
  "@lobehub/fluent-emoji": "^5.0.0-beta.1",
190
193
  "@lobehub/icons": "^6.0.0-beta.1",
194
+ "@splinetool/runtime": "^1.12.0",
191
195
  "motion": "^13.0.0 || ^14.0.0",
192
196
  "react": "^19.0.0",
193
197
  "react-dom": "^19.0.0"
194
198
  },
199
+ "peerDependenciesMeta": {
200
+ "@splinetool/runtime": {
201
+ "optional": true
202
+ }
203
+ },
195
204
  "packageManager": "pnpm@12.3.4+sha512.961aa41fb077da3a04a441d9f8e15ebc0c96da8ef710b2eb67bf9ee7cb0610eabd48f1fd85f51cffe73846785fa0f87c56a3a872a1d893f8446741b5cce45457",
196
205
  "engines": {
197
206
  "node": ">=22.22.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParentSize.mjs","names":[],"sources":["../../../src/awesome/Spline/ParentSize.tsx"],"sourcesContent":["import { debounce } from 'es-toolkit/compat';\nimport {\n type CSSProperties,\n memo,\n type ReactNode,\n type Ref,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { mergeRefs } from '@/utils/mergeRefs';\n\ninterface ResizeObserverCallback {\n (entries: ResizeObserverEntry[], observer: ResizeObserver): void;\n}\n\ninterface ResizeObserverPolyfill {\n new (callback: ResizeObserverCallback): ResizeObserver;\n}\n\n// @TODO remove when upgraded to TS 4 which has its own declaration\ninterface PrivateWindow {\n ResizeObserver: ResizeObserverPolyfill;\n}\n\nexport interface ParentSizeProps {\n /** Child render function `({ width, height, top, left, ref, resize }) => ReactNode`. */\n children: (\n args: {\n ref: HTMLDivElement | null;\n resize: (state: ParentSizeState) => void;\n } & ParentSizeState,\n ) => ReactNode;\n /** Optional `className` to add to the parent `div` wrapper used for size measurement. */\n className?: string;\n /** Child render updates upon resize are delayed until `debounceTime` milliseconds _after_ the last resize event is observed. */\n debounceTime?: number;\n /** Optional flag to toggle leading debounce calls. When set to true this will ensure that the component always renders immediately. (defaults to true) */\n enableDebounceLeadingCall?: boolean;\n /** Optional dimensions provided won't trigger a state change when changed. */\n ignoreDimensions?: keyof ParentSizeState | (keyof ParentSizeState)[];\n /** Optional `style` object to apply to the parent `div` wrapper used for size measurement. */\n parentSizeStyles?: CSSProperties;\n ref?: Ref<HTMLDivElement>;\n /** Optionally inject a ResizeObserver polyfill, else this *must* be globally available. */\n resizeObserverPolyfill?: ResizeObserverPolyfill;\n}\n\ntype ParentSizeState = {\n height: number;\n left: number;\n top: number;\n width: number;\n};\n\nexport type ParentSizeProvidedProps = ParentSizeState;\n\nconst defaultIgnoreDimensions: ParentSizeProps['ignoreDimensions'] = [];\nconst defaultParentSizeStyles = { height: '100%', width: '100%' };\n\nconst ParentSize = memo<ParentSizeProps>(\n ({\n ref,\n className,\n children,\n debounceTime = 300,\n ignoreDimensions = defaultIgnoreDimensions,\n parentSizeStyles,\n enableDebounceLeadingCall = true,\n resizeObserverPolyfill,\n ...restProps\n }) => {\n const target = useRef<HTMLDivElement | null>(null);\n const animationFrameID = useRef(0);\n\n const [state, setState] = useState<ParentSizeState>({\n height: 0,\n left: 0,\n top: 0,\n width: 0,\n });\n\n const resize = useMemo(() => {\n const normalized = Array.isArray(ignoreDimensions) ? ignoreDimensions : [ignoreDimensions];\n\n return debounce(\n (incoming: ParentSizeState) => {\n setState((existing) => {\n const stateKeys = Object.keys(existing) as (keyof ParentSizeState)[];\n const keysWithChanges = stateKeys.filter((key) => existing[key] !== incoming[key]);\n const shouldBail = keysWithChanges.every((key) => normalized.includes(key));\n\n return shouldBail ? existing : incoming;\n });\n },\n debounceTime,\n { leading: enableDebounceLeadingCall },\n );\n }, [debounceTime, enableDebounceLeadingCall, ignoreDimensions]);\n\n useEffect(() => {\n const LocalResizeObserver =\n resizeObserverPolyfill || (window as unknown as PrivateWindow).ResizeObserver;\n\n const observer = new LocalResizeObserver((entries) => {\n for (const entry of entries) {\n const { left, top, width, height } = entry?.contentRect ?? {};\n animationFrameID.current = window.requestAnimationFrame(() => {\n resize({ height, left, top, width });\n });\n }\n });\n if (target.current) observer.observe(target.current);\n\n return () => {\n window.cancelAnimationFrame(animationFrameID.current);\n observer.disconnect();\n resize.cancel();\n };\n }, [resize, resizeObserverPolyfill]);\n\n return (\n <div\n className={className}\n ref={mergeRefs<HTMLDivElement>([ref, target])}\n style={{ ...defaultParentSizeStyles, ...parentSizeStyles }}\n {...restProps}\n >\n {children({\n ...state,\n ref: target.current,\n resize,\n })}\n </div>\n );\n },\n);\n\nexport default ParentSize;\n"],"mappings":";;;;;AA2DA,MAAM,0BAA+D,CAAC;AACtE,MAAM,0BAA0B;CAAE,QAAQ;CAAQ,OAAO;AAAO;AAEhE,MAAM,aAAa,MAChB,EACC,KACA,WACA,UACA,eAAe,KACf,mBAAmB,yBACnB,kBACA,4BAA4B,MAC5B,wBACA,GAAG,gBACC;CACJ,MAAM,SAAS,OAA8B,IAAI;CACjD,MAAM,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src/awesome/Spline/Spine.d.ts
4
- declare const Spline: import("react").NamedExoticComponent<SplineProps>;
5
- //#endregion
6
- export { Spline as default };
7
- //# sourceMappingURL=Spine.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Spine.mjs","names":[],"sources":["../../../src/awesome/Spline/Spine.tsx"],"sourcesContent":["'use client';\n\nimport { type SplineEvent, type SplineEventName } from '@splinetool/runtime';\nimport { Application } from '@splinetool/runtime';\nimport { memo, useEffect, useRef, useState } from 'react';\n\nimport ParentSize from './ParentSize';\nimport { type SplineProps } from './type';\n\nconst Spline = memo<SplineProps>(\n ({\n ref,\n scene,\n style,\n onMouseDown,\n onMouseUp,\n onMouseHover,\n onKeyDown,\n onKeyUp,\n onStart,\n onLookAt,\n onFollow,\n onWheel,\n onLoad,\n renderOnDemand = true,\n ...props\n }) => {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const init = async (\n speApp: Application,\n events: {\n cb?: (e: SplineEvent) => void;\n name: SplineEventName;\n }[],\n ) => {\n await speApp.load(scene);\n\n for (const event of events) {\n if (event.cb) {\n speApp.addEventListener(event.name, event.cb);\n }\n }\n\n setIsLoading(false);\n onLoad?.(speApp);\n };\n\n // Initialize runtime when component is mounted\n useEffect(() => {\n setIsLoading(true);\n\n let speApp: Application;\n const events: {\n cb?: (e: SplineEvent) => void;\n name: SplineEventName;\n }[] = [\n {\n cb: onMouseDown,\n name: 'mouseDown',\n },\n {\n cb: onMouseUp,\n name: 'mouseUp',\n },\n {\n cb: onMouseHover,\n name: 'mouseHover',\n },\n {\n cb: onKeyDown,\n name: 'keyDown',\n },\n {\n cb: onKeyUp,\n name: 'keyUp',\n },\n {\n cb: onStart,\n name: 'start',\n },\n {\n cb: onLookAt,\n name: 'lookAt',\n },\n {\n cb: onFollow,\n name: 'follow',\n },\n {\n cb: onWheel,\n name: 'scroll',\n },\n ];\n\n if (canvasRef.current) {\n speApp = new Application(canvasRef.current, { renderOnDemand });\n init(speApp, events);\n }\n\n return () => {\n for (const event of events) {\n if (event.cb) {\n speApp.removeEventListener(event.name, event.cb);\n }\n }\n speApp.dispose();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scene]);\n\n return (\n <ParentSize debounceTime={50} parentSizeStyles={style} ref={ref} {...props}>\n {() => {\n return (\n <canvas\n ref={canvasRef}\n style={{\n display: isLoading ? 'none' : 'block',\n }}\n />\n );\n }}\n </ParentSize>\n );\n },\n);\n\nSpline.displayName = 'Spline';\n\nexport default Spline;\n\nexport { type SPEObject, type SplineEvent, type SplineEventName } from '@splinetool/runtime';\n"],"mappings":";;;;;;AASA,MAAM,SAAS,MACZ,EACC,KACA,OACA,OACA,aACA,WACA,cACA,WACA,SACA,SACA,UACA,UACA,SACA,QACA,iBAAiB,MACjB,GAAG,YACC;CACJ,MAAM,YAAY,OAA0B,IAAI;CAChD,MAAM,CAAC,WAAW,gBAAgB,SAAS,IAAI;CAE/C,MAAM,OAAO,OACX,QACA,WAIG;EACH,MAAM,OAAO,KAAK,KAAK;EAEvB,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,IACR,OAAO,iBAAiB,MAAM,MAAM,MAAM,EAAE;EAIhD,aAAa,KAAK;EAClB,SAAS,MAAM;CACjB;CAGA,gBAAgB;EACd,aAAa,IAAI;EAEjB,IAAI;EACJ,MAAM,SAGA;GACJ;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;GACA;IACE,IAAI;IACJ,MAAM;GACR;EACF;EAEA,IAAI,UAAU,SAAS;GACrB,SAAS,IAAI,YAAY,UAAU,SAAS,EAAE,eAAe,CAAC;GAC9D,KAAK,QAAQ,MAAM;EACrB;EAEA,aAAa;GACX,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,IACR,OAAO,oBAAoB,MAAM,MAAM,MAAM,EAAE;GAGnD,OAAO,QAAQ;EACjB;CAEF,GAAG,CAAC,KAAK,CAAC;CAEV,OACE,oBAAC,YAAD;EAAY,cAAc;EAAI,kBAAkB;EAAY;EAAK,GAAI;EAC5D,gBAAA;GACL,OACE,oBAAC,UAAD;IACE,KAAK;IACL,OAAO,EACL,SAAS,YAAY,SAAS,QAChC;GACD,CAAA;EAEL;CACU,CAAA;AAEhB,CACF;AAEA,OAAO,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loading.mjs","names":[],"sources":["../../../src/brand/LogoThree/Loading.tsx"],"sourcesContent":["import { Loader2 } from 'lucide-react';\nimport { type FC } from 'react';\n\nimport { Center } from '@/Flex';\nimport Icon from '@/Icon';\n\nconst Loading: FC<{ size?: number }> = ({ size = 32 }) => {\n return (\n <Center height={'100%'} justify={'center'} style={{ position: 'absolute' }} width={'100%'}>\n <Icon spin icon={Loader2} size={size} />\n </Center>\n );\n};\n\nexport default Loading;\n"],"mappings":";;;;;AAMA,MAAM,WAAkC,EAAE,OAAO,SAAS;CACxD,OACE,oBAAC,QAAD;EAAQ,QAAQ;EAAQ,SAAS;EAAU,OAAO,EAAE,UAAU,WAAW;EAAG,OAAO;EACjF,UAAA,oBAAC,MAAD;GAAM,MAAA;GAAK,MAAM;GAAe;EAAO,CAAA;CACjC,CAAA;AAEZ"}
File without changes