csdk-test 1.0.27 → 1.0.29
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/LICENSE.txt +1 -0
- package/README.md +326 -0
- package/package.json +45 -38
- package/dist/curator-sdk.css +0 -166
- package/dist/index.js +0 -2
- package/dist/index.js.LICENSE.txt +0 -169
- package/unity-build/LiveFurnishBuild.data +0 -0
- package/unity-build/LiveFurnishBuild.framework.js +0 -7
- package/unity-build/LiveFurnishBuild.loader.js +0 -1
- package/unity-build/LiveFurnishBuild.wasm +0 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
package/README.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
# Imagine Curator SDK (csdk-test)
|
|
2
|
+
|
|
3
|
+
Version: 1.0.29
|
|
4
|
+
|
|
5
|
+
A comprehensive SDK for integrating Imagine Curator into your React application with full Unity 3D support.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🔐 **JWT Authentication** - Secure token-based authentication
|
|
10
|
+
- 🎨 **Multiple Curator Types** - Support for room, project, render, automation, and builder types
|
|
11
|
+
- 🎮 **Unity 3D Integration** - Built-in Unity WebGL support
|
|
12
|
+
- ⚛️ **React Components** - Ready-to-use React components
|
|
13
|
+
- 🎯 **Type Safety** - PropTypes validation for all components
|
|
14
|
+
- 📦 **Complete Package** - Includes all necessary Unity build files
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install csdk-test
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add csdk-test
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import { ImagineSDKWrapper, ImagineSDK } from 'csdk-test';
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
const handleAuthSuccess = (userDetails) => {
|
|
36
|
+
console.log('User authenticated:', userDetails);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleAuthError = (error) => {
|
|
40
|
+
console.error('Authentication failed:', error);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleCuratorLoad = ({ id, type }) => {
|
|
44
|
+
console.log(`Curator loaded: ${type} with id ${id}`);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ImagineSDKWrapper
|
|
49
|
+
token="your-jwt-token"
|
|
50
|
+
refreshToken="your-refresh-token"
|
|
51
|
+
onAuthSuccess={handleAuthSuccess}
|
|
52
|
+
onAuthError={handleAuthError}>
|
|
53
|
+
<ImagineSDK id="room-123" type="room" onLoad={handleCuratorLoad} />
|
|
54
|
+
</ImagineSDKWrapper>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default App;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Components
|
|
62
|
+
|
|
63
|
+
### ImagineSDKWrapper
|
|
64
|
+
|
|
65
|
+
Main wrapper component that handles authentication and provides necessary context providers.
|
|
66
|
+
|
|
67
|
+
#### Props
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Required | Description |
|
|
70
|
+
| --------------- | --------- | -------- | -------------------------------------- |
|
|
71
|
+
| `token` | string | Yes | JWT token for authentication |
|
|
72
|
+
| `refreshToken` | string | No | Refresh token for token renewal |
|
|
73
|
+
| `children` | ReactNode | Yes | Child components |
|
|
74
|
+
| `onAuthError` | function | No | Callback for authentication errors |
|
|
75
|
+
| `onAuthSuccess` | function | No | Callback for successful authentication |
|
|
76
|
+
|
|
77
|
+
#### Example
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<ImagineSDKWrapper
|
|
81
|
+
token="eyJhbGciOiJIUzI1NiIs..."
|
|
82
|
+
refreshToken="refresh_token_here"
|
|
83
|
+
onAuthSuccess={(user) => console.log('Authenticated:', user)}
|
|
84
|
+
onAuthError={(error) => console.error('Auth failed:', error)}>
|
|
85
|
+
{/* Your components */}
|
|
86
|
+
</ImagineSDKWrapper>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### ImagineSDK
|
|
90
|
+
|
|
91
|
+
Main component for loading and displaying the curator.
|
|
92
|
+
|
|
93
|
+
#### Props
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Required | Description |
|
|
96
|
+
| ---------------------------- | ------------- | -------- | ---------------------------------------------------------- |
|
|
97
|
+
| `id` | string/number | Yes\* | ID of the curator entity |
|
|
98
|
+
| `type` | string | Yes | Type: 'room', 'project', 'render', 'automation', 'builder' |
|
|
99
|
+
| `cameraName` | string | No | Camera name for render type |
|
|
100
|
+
| `zipUuid` | string | No | UUID for project zip files |
|
|
101
|
+
| `isOnboarding` | boolean | No | Flag for onboarding flow |
|
|
102
|
+
| `originalTemplateId` | string/number | No | Original template ID |
|
|
103
|
+
| `combinedWithConfiguratorId` | string/number | No | Combined configurator ID |
|
|
104
|
+
| `lightingRoomId` | string/number | No | Lighting room ID |
|
|
105
|
+
| `lightingBaseRoomId` | string/number | No | Base lighting room ID |
|
|
106
|
+
| `lightroomContentType` | string | No | Content type for lightroom |
|
|
107
|
+
| `openImages` | boolean | No | Flag to open images panel |
|
|
108
|
+
| `onLoad` | function | No | Callback when curator loads |
|
|
109
|
+
| `onError` | function | No | Callback when error occurs |
|
|
110
|
+
|
|
111
|
+
\*Either `id`, `zipUuid`, or `combinedWithConfiguratorId` is required
|
|
112
|
+
|
|
113
|
+
## Usage Examples
|
|
114
|
+
|
|
115
|
+
### Loading a Room
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
<ImagineSDK id="room-456" type="room" onLoad={({ id, type }) => console.log(`Room ${id} loaded`)} />
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Loading a Project
|
|
122
|
+
|
|
123
|
+
```jsx
|
|
124
|
+
<ImagineSDK
|
|
125
|
+
id="project-789"
|
|
126
|
+
type="project"
|
|
127
|
+
zipUuid="uuid-string"
|
|
128
|
+
onLoad={({ id, type }) => console.log(`Project ${id} loaded`)}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Loading a Render
|
|
133
|
+
|
|
134
|
+
```jsx
|
|
135
|
+
<ImagineSDK
|
|
136
|
+
id="render-123"
|
|
137
|
+
type="render"
|
|
138
|
+
cameraName="Camera1"
|
|
139
|
+
originalTemplateId="template-456"
|
|
140
|
+
onLoad={({ id, type }) => console.log(`Render ${id} loaded`)}
|
|
141
|
+
/>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Loading Automation
|
|
145
|
+
|
|
146
|
+
```jsx
|
|
147
|
+
<ImagineSDK
|
|
148
|
+
id="automation-789"
|
|
149
|
+
type="automation"
|
|
150
|
+
onLoad={({ id, type }) => console.log(`Automation ${id} loaded`)}
|
|
151
|
+
/>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Loading Builder
|
|
155
|
+
|
|
156
|
+
```jsx
|
|
157
|
+
<ImagineSDK type="builder" onLoad={({ type }) => console.log('Builder loaded')} />
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Complete Example
|
|
161
|
+
|
|
162
|
+
```jsx
|
|
163
|
+
import React, { useState } from 'react';
|
|
164
|
+
import { ImagineSDKWrapper, ImagineSDK } from 'csdk-test';
|
|
165
|
+
|
|
166
|
+
function MyApp() {
|
|
167
|
+
const [curatorType, setCuratorType] = useState('room');
|
|
168
|
+
const [curatorId, setCuratorId] = useState('room-123');
|
|
169
|
+
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
|
170
|
+
|
|
171
|
+
const token = 'your-jwt-token';
|
|
172
|
+
const refreshToken = 'your-refresh-token';
|
|
173
|
+
|
|
174
|
+
const handleAuthSuccess = (userDetails) => {
|
|
175
|
+
console.log('User authenticated successfully');
|
|
176
|
+
setIsAuthenticated(true);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const handleAuthError = (error) => {
|
|
180
|
+
console.error('Authentication failed:', error);
|
|
181
|
+
setIsAuthenticated(false);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const handleCuratorLoad = ({ id, type }) => {
|
|
185
|
+
console.log(`Curator loaded successfully: ${type} (${id})`);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const handleCuratorError = (error) => {
|
|
189
|
+
console.error('Curator error:', error);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<ImagineSDKWrapper
|
|
194
|
+
token={token}
|
|
195
|
+
refreshToken={refreshToken}
|
|
196
|
+
onAuthSuccess={handleAuthSuccess}
|
|
197
|
+
onAuthError={handleAuthError}>
|
|
198
|
+
<div style={{ width: '100%', height: '100vh' }}>
|
|
199
|
+
{isAuthenticated && (
|
|
200
|
+
<ImagineSDK
|
|
201
|
+
id={curatorId}
|
|
202
|
+
type={curatorType}
|
|
203
|
+
onLoad={handleCuratorLoad}
|
|
204
|
+
onError={handleCuratorError}
|
|
205
|
+
/>
|
|
206
|
+
)}
|
|
207
|
+
</div>
|
|
208
|
+
</ImagineSDKWrapper>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export default MyApp;
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Unity Build Files
|
|
216
|
+
|
|
217
|
+
The SDK includes all necessary Unity build files:
|
|
218
|
+
|
|
219
|
+
- `/Build` - Unity WebGL build files
|
|
220
|
+
- `/draco` - Draco compression library
|
|
221
|
+
- `/envmap` - Environment maps for 3D rendering
|
|
222
|
+
|
|
223
|
+
These files are automatically included when you install the SDK.
|
|
224
|
+
|
|
225
|
+
## API Reference
|
|
226
|
+
|
|
227
|
+
### Exported Utilities
|
|
228
|
+
|
|
229
|
+
```jsx
|
|
230
|
+
import {
|
|
231
|
+
errorToast,
|
|
232
|
+
successToast,
|
|
233
|
+
warningToast,
|
|
234
|
+
infoToast,
|
|
235
|
+
SDK_VERSION,
|
|
236
|
+
SDK_NAME,
|
|
237
|
+
} from 'csdk-test';
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Toast Notifications
|
|
241
|
+
|
|
242
|
+
```jsx
|
|
243
|
+
import { errorToast, successToast } from 'csdk-test';
|
|
244
|
+
|
|
245
|
+
// Show success message
|
|
246
|
+
successToast('Operation completed successfully');
|
|
247
|
+
|
|
248
|
+
// Show error message
|
|
249
|
+
errorToast('An error occurred');
|
|
250
|
+
|
|
251
|
+
// Show warning message
|
|
252
|
+
warningToast('Warning: Check your input');
|
|
253
|
+
|
|
254
|
+
// Show info message
|
|
255
|
+
infoToast('Information message');
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## TypeScript Support
|
|
259
|
+
|
|
260
|
+
TypeScript definitions are included in the package. Import types:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
import { ImagineSDKWrapper, ImagineSDK } from 'csdk-test';
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Browser Compatibility
|
|
267
|
+
|
|
268
|
+
- Chrome (latest)
|
|
269
|
+
- Firefox (latest)
|
|
270
|
+
- Safari (latest)
|
|
271
|
+
- Edge (latest)
|
|
272
|
+
|
|
273
|
+
## Requirements
|
|
274
|
+
|
|
275
|
+
- React ^18.2.0
|
|
276
|
+
- React DOM ^18.2.0
|
|
277
|
+
- React Redux ^7.2.6
|
|
278
|
+
- React Router DOM ^6.2.1
|
|
279
|
+
|
|
280
|
+
## Troubleshooting
|
|
281
|
+
|
|
282
|
+
### Authentication Issues
|
|
283
|
+
|
|
284
|
+
If you're experiencing authentication issues:
|
|
285
|
+
|
|
286
|
+
1. Verify your JWT token is valid
|
|
287
|
+
2. Check token expiration
|
|
288
|
+
3. Ensure the token has proper permissions
|
|
289
|
+
|
|
290
|
+
### Unity Loading Issues
|
|
291
|
+
|
|
292
|
+
If Unity doesn't load:
|
|
293
|
+
|
|
294
|
+
1. Check browser console for errors
|
|
295
|
+
2. Ensure Unity build files are accessible
|
|
296
|
+
3. Verify browser WebGL support
|
|
297
|
+
|
|
298
|
+
### Import Errors
|
|
299
|
+
|
|
300
|
+
If you get import errors:
|
|
301
|
+
|
|
302
|
+
1. Ensure all peer dependencies are installed
|
|
303
|
+
2. Clear node_modules and reinstall
|
|
304
|
+
3. Check for version conflicts
|
|
305
|
+
|
|
306
|
+
## Support
|
|
307
|
+
|
|
308
|
+
For issues and questions:
|
|
309
|
+
|
|
310
|
+
- GitHub Issues: [Link to issues]
|
|
311
|
+
- Email: support@imagine.com
|
|
312
|
+
- Documentation: [Link to docs]
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
MIT
|
|
317
|
+
|
|
318
|
+
## Changelog
|
|
319
|
+
|
|
320
|
+
### Version 1.0.29
|
|
321
|
+
|
|
322
|
+
- Initial release
|
|
323
|
+
- JWT authentication support
|
|
324
|
+
- Multiple curator types (room, project, render, automation, builder)
|
|
325
|
+
- Unity 3D integration
|
|
326
|
+
- Complete Unity build files included
|
package/package.json
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"name": "csdk-test",
|
|
3
|
+
"version": "1.0.29",
|
|
4
|
+
"description": "Imagine Curator SDK - A comprehensive SDK for integrating Imagine Curator with Unity 3D support",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"public/Build",
|
|
11
|
+
"public/draco",
|
|
12
|
+
"public/envmap",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE.txt"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/your-org/imagine-curator-sdk.git"
|
|
11
19
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
20
|
+
"keywords": [
|
|
21
|
+
"curator",
|
|
22
|
+
"unity",
|
|
23
|
+
"3d",
|
|
24
|
+
"sdk",
|
|
25
|
+
"react",
|
|
26
|
+
"imagine"
|
|
27
|
+
],
|
|
28
|
+
"author": "Imagine Team",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "^18.2.0",
|
|
32
|
+
"react-dom": "^18.2.0",
|
|
33
|
+
"react-redux": "^7.2.6",
|
|
34
|
+
"react-router-dom": "^6.2.1"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@reduxjs/toolkit": "^1.7.2",
|
|
38
|
+
"axios": "^0.25.0",
|
|
39
|
+
"jwt-decode": "^3.1.2",
|
|
40
|
+
"lodash": "^4.17.21",
|
|
41
|
+
"react-unity-webgl": "^8.7.4",
|
|
42
|
+
"react-toastify": "^8.1.1"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
}
|
|
47
|
+
}
|