@linxai/3d-web 0.1.0 → 0.1.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,87 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { CharacterViewProps, SceneConfig, OrbitControlsConfig } from '@linxai/3d-shared';
3
+ export { AnimationConfig, AnimationStateConfig, AnimationStatesConfig, Character, CharacterViewProps, GridHelperConfig, LightConfig, ModelLoadConfig, OrbitControlsConfig, OverlayConfig, SceneConfig } from '@linxai/3d-shared';
4
+ import { ReactNode, CSSProperties } from 'react';
5
+ import { SceneBuilder } from '@linxai/3d-shared/internal';
6
+ export { useGLTF as useModelLoader } from '@react-three/drei';
7
+
8
+ /**
9
+ * 3D 角色查看器
10
+ */
11
+ declare function CharacterView(props: CharacterViewProps): react_jsx_runtime.JSX.Element;
12
+
13
+ interface Scene3DProps {
14
+ /** 子组件 */
15
+ children: ReactNode;
16
+ /** 场景配置 */
17
+ config?: SceneConfig;
18
+ /** OrbitControls 配置 */
19
+ controlsConfig?: OrbitControlsConfig;
20
+ /** Canvas 样式 */
21
+ style?: CSSProperties;
22
+ /** Canvas className */
23
+ className?: string;
24
+ /** 是否显示进度条 */
25
+ showProgress?: boolean;
26
+ }
27
+ declare function Scene3D(props: Scene3DProps): react_jsx_runtime.JSX.Element;
28
+
29
+ interface CharacterOverlayProps {
30
+ /** 是否显示浮层 */
31
+ visible?: boolean;
32
+ /** 当前字幕文本 */
33
+ subtitle?: string;
34
+ /** 是否显示字幕 */
35
+ showSubtitle?: boolean;
36
+ /** 是否显示说话按钮 */
37
+ showSpeakButton?: boolean;
38
+ /** 是否正在连接/加载 */
39
+ isLoading?: boolean;
40
+ /** 是否已连接 */
41
+ isConnected?: boolean;
42
+ /** 开始说话回调 */
43
+ onStartSpeak?: () => void;
44
+ /** 停止说话回调 */
45
+ onStopSpeak?: () => void;
46
+ /** 按钮点击回调(用于外部控制连接状态) */
47
+ onButtonClick?: () => void;
48
+ /** 字幕样式 */
49
+ subtitleStyle?: React.CSSProperties;
50
+ /** 容器样式 */
51
+ style?: React.CSSProperties;
52
+ }
53
+ /**
54
+ * 角色浮层组件
55
+ * 包含说话控制按钮和字幕显示
56
+ *
57
+ * 纯 UI 组件,基于 props 驱动,不包含业务逻辑
58
+ */
59
+ declare function CharacterOverlay({ visible, subtitle, showSubtitle, showSpeakButton, isLoading, isConnected, onStartSpeak, onStopSpeak, onButtonClick, subtitleStyle, style, }: CharacterOverlayProps): react_jsx_runtime.JSX.Element | null;
60
+
61
+ interface SubtitleProps {
62
+ /** 字幕文本 */
63
+ text?: string;
64
+ /** 是否可见 */
65
+ visible?: boolean;
66
+ /** 容器样式 */
67
+ style?: React.CSSProperties;
68
+ /** 字幕框样式 */
69
+ boxStyle?: React.CSSProperties;
70
+ /** 文本样式 */
71
+ textStyle?: React.CSSProperties;
72
+ /** 底部偏移(默认 80px) */
73
+ bottomOffset?: number;
74
+ }
75
+ /**
76
+ * 字幕组件
77
+ * 带淡入淡出动画的字幕显示
78
+ */
79
+ declare function Subtitle({ text, visible, style, boxStyle, textStyle, bottomOffset, }: SubtitleProps): react_jsx_runtime.JSX.Element | null;
80
+
81
+ /**
82
+ * Web 端场景构建器
83
+ * 装配 Web 平台特定的 Canvas 和 OrbitControls
84
+ */
85
+ declare const WebSceneBuilder: SceneBuilder;
86
+
87
+ export { CharacterOverlay, type CharacterOverlayProps, CharacterView, Scene3D, Subtitle, type SubtitleProps, WebSceneBuilder };
@@ -0,0 +1,87 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { CharacterViewProps, SceneConfig, OrbitControlsConfig } from '@linxai/3d-shared';
3
+ export { AnimationConfig, AnimationStateConfig, AnimationStatesConfig, Character, CharacterViewProps, GridHelperConfig, LightConfig, ModelLoadConfig, OrbitControlsConfig, OverlayConfig, SceneConfig } from '@linxai/3d-shared';
4
+ import { ReactNode, CSSProperties } from 'react';
5
+ import { SceneBuilder } from '@linxai/3d-shared/internal';
6
+ export { useGLTF as useModelLoader } from '@react-three/drei';
7
+
8
+ /**
9
+ * 3D 角色查看器
10
+ */
11
+ declare function CharacterView(props: CharacterViewProps): react_jsx_runtime.JSX.Element;
12
+
13
+ interface Scene3DProps {
14
+ /** 子组件 */
15
+ children: ReactNode;
16
+ /** 场景配置 */
17
+ config?: SceneConfig;
18
+ /** OrbitControls 配置 */
19
+ controlsConfig?: OrbitControlsConfig;
20
+ /** Canvas 样式 */
21
+ style?: CSSProperties;
22
+ /** Canvas className */
23
+ className?: string;
24
+ /** 是否显示进度条 */
25
+ showProgress?: boolean;
26
+ }
27
+ declare function Scene3D(props: Scene3DProps): react_jsx_runtime.JSX.Element;
28
+
29
+ interface CharacterOverlayProps {
30
+ /** 是否显示浮层 */
31
+ visible?: boolean;
32
+ /** 当前字幕文本 */
33
+ subtitle?: string;
34
+ /** 是否显示字幕 */
35
+ showSubtitle?: boolean;
36
+ /** 是否显示说话按钮 */
37
+ showSpeakButton?: boolean;
38
+ /** 是否正在连接/加载 */
39
+ isLoading?: boolean;
40
+ /** 是否已连接 */
41
+ isConnected?: boolean;
42
+ /** 开始说话回调 */
43
+ onStartSpeak?: () => void;
44
+ /** 停止说话回调 */
45
+ onStopSpeak?: () => void;
46
+ /** 按钮点击回调(用于外部控制连接状态) */
47
+ onButtonClick?: () => void;
48
+ /** 字幕样式 */
49
+ subtitleStyle?: React.CSSProperties;
50
+ /** 容器样式 */
51
+ style?: React.CSSProperties;
52
+ }
53
+ /**
54
+ * 角色浮层组件
55
+ * 包含说话控制按钮和字幕显示
56
+ *
57
+ * 纯 UI 组件,基于 props 驱动,不包含业务逻辑
58
+ */
59
+ declare function CharacterOverlay({ visible, subtitle, showSubtitle, showSpeakButton, isLoading, isConnected, onStartSpeak, onStopSpeak, onButtonClick, subtitleStyle, style, }: CharacterOverlayProps): react_jsx_runtime.JSX.Element | null;
60
+
61
+ interface SubtitleProps {
62
+ /** 字幕文本 */
63
+ text?: string;
64
+ /** 是否可见 */
65
+ visible?: boolean;
66
+ /** 容器样式 */
67
+ style?: React.CSSProperties;
68
+ /** 字幕框样式 */
69
+ boxStyle?: React.CSSProperties;
70
+ /** 文本样式 */
71
+ textStyle?: React.CSSProperties;
72
+ /** 底部偏移(默认 80px) */
73
+ bottomOffset?: number;
74
+ }
75
+ /**
76
+ * 字幕组件
77
+ * 带淡入淡出动画的字幕显示
78
+ */
79
+ declare function Subtitle({ text, visible, style, boxStyle, textStyle, bottomOffset, }: SubtitleProps): react_jsx_runtime.JSX.Element | null;
80
+
81
+ /**
82
+ * Web 端场景构建器
83
+ * 装配 Web 平台特定的 Canvas 和 OrbitControls
84
+ */
85
+ declare const WebSceneBuilder: SceneBuilder;
86
+
87
+ export { CharacterOverlay, type CharacterOverlayProps, CharacterView, Scene3D, Subtitle, type SubtitleProps, WebSceneBuilder };