@pascal-app/viewer 0.1.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.
@@ -0,0 +1,81 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Wall display mode for the viewer
5
+ */
6
+ export type WallMode = 'full' | 'cutaway' | 'hidden';
7
+
8
+ /**
9
+ * Props for the SceneViewer component
10
+ */
11
+ export interface SceneViewerProps {
12
+ /** URL to load the scene JSON from */
13
+ sceneUrl?: string;
14
+ /** Initial zoom level for orthographic camera (default: 80) */
15
+ defaultZoom?: number;
16
+ /** When true, posts selection changes to parent window for iframe embedding */
17
+ isEmbedded?: boolean;
18
+ /** Initial wall mode for viewer */
19
+ defaultWallMode?: WallMode;
20
+ /** CSS class name for the container */
21
+ className?: string;
22
+ /** Custom loading component */
23
+ loadingComponent?: React.ReactNode;
24
+ /** Custom error component */
25
+ errorComponent?: (error: string) => React.ReactNode;
26
+ /** Callback when scene is loaded */
27
+ onSceneLoaded?: () => void;
28
+ /** Callback when an error occurs */
29
+ onError?: (error: string) => void;
30
+ /** Callback when selection changes */
31
+ onSelectionChange?: (selection: {
32
+ selectedNodeIds: string[];
33
+ selectedFloorId: string | null;
34
+ selectedZoneId: string | null;
35
+ }) => void;
36
+ }
37
+
38
+ /**
39
+ * SceneViewer - A standalone React component for viewing Pascal scenes.
40
+ *
41
+ * This component handles scene loading from URLs and provides a complete
42
+ * 3D viewer with loading/error states.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * import { SceneViewer } from '@pascal/viewer'
47
+ *
48
+ * function App() {
49
+ * return (
50
+ * <SceneViewer
51
+ * sceneUrl="https://example.com/scene.json"
52
+ * defaultZoom={80}
53
+ * onSelectionChange={(selection) => console.log(selection)}
54
+ * />
55
+ * )
56
+ * }
57
+ * ```
58
+ */
59
+ export declare function SceneViewer(props: SceneViewerProps): React.JSX.Element;
60
+
61
+ /**
62
+ * Props for the Viewer component
63
+ */
64
+ export interface ViewerProps {
65
+ /** CSS class name for the canvas container */
66
+ className?: string;
67
+ /** Initial zoom level for orthographic camera (default: 80) */
68
+ defaultZoom?: number;
69
+ /** When true, posts selection changes to parent window for iframe embedding */
70
+ isEmbedded?: boolean;
71
+ /** Initial wall mode for viewer */
72
+ defaultWallMode?: WallMode;
73
+ }
74
+
75
+ /**
76
+ * Viewer - Low-level viewer component for advanced use cases.
77
+ *
78
+ * Use this when you need full control over the scene store initialization.
79
+ * For most use cases, prefer SceneViewer which handles scene loading automatically.
80
+ */
81
+ export declare function Viewer(props: ViewerProps): React.JSX.Element;