@retor/react-native 0.2.0 → 0.3.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.
- package/README.md +3 -3
- package/dist/index.d.mts +20 -41
- package/dist/index.d.ts +20 -41
- package/dist/index.js +245 -84
- package/dist/index.mjs +236 -71
- package/package.json +14 -3
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ Embed Retor 3D experiences in a React Native / Expo app — with composable bott
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Expo
|
|
9
|
-
npx expo install react-native-webview react-native-gesture-handler react-native-reanimated
|
|
10
|
-
npm install @gorhom/bottom-sheet @retor/react-native
|
|
9
|
+
npx expo install react-native-webview react-native-gesture-handler react-native-reanimated react-native-svg
|
|
10
|
+
npm install @gorhom/bottom-sheet lucide-react-native @retor/react-native
|
|
11
11
|
|
|
12
12
|
# bare React Native
|
|
13
|
-
npm install react-native-webview react-native-gesture-handler react-native-reanimated @gorhom/bottom-sheet @retor/react-native
|
|
13
|
+
npm install react-native-webview react-native-gesture-handler react-native-reanimated react-native-svg @gorhom/bottom-sheet lucide-react-native @retor/react-native
|
|
14
14
|
cd ios && pod install
|
|
15
15
|
```
|
|
16
16
|
|
package/dist/index.d.mts
CHANGED
|
@@ -185,72 +185,42 @@ interface HudProps {
|
|
|
185
185
|
declare function Hud({ children }: HudProps): React.JSX.Element;
|
|
186
186
|
|
|
187
187
|
interface ProjectSheetProps {
|
|
188
|
-
/**
|
|
189
|
-
* Snap points for the sheet. Defaults to ["20%", "60%"].
|
|
190
|
-
*/
|
|
188
|
+
/** Snap points. Defaults to ["35%", "85%"]. */
|
|
191
189
|
snapPoints?: (string | number)[];
|
|
192
|
-
/**
|
|
193
|
-
* Override the default header (project name + description).
|
|
194
|
-
* Receives the project metadata.
|
|
195
|
-
*/
|
|
190
|
+
/** Override the default header (project name + description + arrow button). */
|
|
196
191
|
renderHeader?: (project: {
|
|
197
192
|
name?: string;
|
|
198
193
|
description?: string;
|
|
199
194
|
}) => React.ReactNode;
|
|
200
|
-
/**
|
|
201
|
-
* Children to render below the header. Typically a `<LinesCarousel>`.
|
|
202
|
-
* If omitted, a default LinesCarousel is rendered.
|
|
203
|
-
*/
|
|
195
|
+
/** Children to render inside. Defaults to a built-in `<LinesCarousel>`. */
|
|
204
196
|
children?: React.ReactNode;
|
|
205
197
|
}
|
|
206
198
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* ```tsx
|
|
210
|
-
* <ProjectSheet>
|
|
211
|
-
* <LinesCarousel>
|
|
212
|
-
* {(line) => <MyLineCard line={line} />}
|
|
213
|
-
* </LinesCarousel>
|
|
214
|
-
* </ProjectSheet>
|
|
215
|
-
* ```
|
|
199
|
+
* Browse-mode bottom sheet — auto-presents whenever no line is open.
|
|
216
200
|
*/
|
|
217
201
|
declare function ProjectSheet({ snapPoints, renderHeader, children }: ProjectSheetProps): React.JSX.Element;
|
|
218
202
|
interface LinesCarouselProps {
|
|
219
203
|
children: (line: RetorLine, index: number) => React.ReactNode;
|
|
220
|
-
/** Optional gap between items. Defaults to 12. */
|
|
221
204
|
gap?: number;
|
|
222
|
-
/** Optional horizontal padding. Defaults to 16. */
|
|
223
205
|
paddingHorizontal?: number;
|
|
224
206
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Renders a horizontally scrolling list of lines using a render prop.
|
|
227
|
-
* Place inside `<ProjectSheet>`.
|
|
228
|
-
*
|
|
229
|
-
* Pressing an item is up to your render — use `useViewer().openLine(line._id)`.
|
|
230
|
-
*/
|
|
231
207
|
declare function LinesCarousel({ children, gap, paddingHorizontal }: LinesCarouselProps): React.JSX.Element | null;
|
|
232
208
|
|
|
233
209
|
interface LineDetailSheetProps {
|
|
234
|
-
/** Snap points. Defaults to ["
|
|
210
|
+
/** Snap points. Defaults to ["35%", "85%"]. */
|
|
235
211
|
snapPoints?: (string | number)[];
|
|
236
|
-
/** Override the header.
|
|
212
|
+
/** Override the header. */
|
|
237
213
|
renderHeader?: (line: RetorLine) => React.ReactNode;
|
|
238
|
-
/** Custom content (typically a `<LineTagList>`).
|
|
214
|
+
/** Custom content (typically a `<LineTagList>`). */
|
|
239
215
|
children?: React.ReactNode;
|
|
240
216
|
}
|
|
241
|
-
/**
|
|
242
|
-
* Sheet that auto-presents when the user enters a line. Shows the line's
|
|
243
|
-
* tags and a Done button. Pass `<LineTagList>` as a child to customise items.
|
|
244
|
-
*/
|
|
245
217
|
declare function LineDetailSheet({ snapPoints, renderHeader, children }: LineDetailSheetProps): React.JSX.Element;
|
|
246
218
|
interface LineTagListProps {
|
|
247
219
|
children: (tag: RetorTag, isActive: boolean) => React.ReactNode;
|
|
220
|
+
/** Optional header rendered above the list (used internally for the default header). */
|
|
221
|
+
listHeader?: React.ReactNode;
|
|
248
222
|
}
|
|
249
|
-
|
|
250
|
-
* Renders the tags of the active line as a vertical list. Re-renders the
|
|
251
|
-
* active item when the camera scrolls to it. Empty when no line is open.
|
|
252
|
-
*/
|
|
253
|
-
declare function LineTagList({ children }: LineTagListProps): React.JSX.Element | null;
|
|
223
|
+
declare function LineTagList({ children, listHeader }: LineTagListProps): React.JSX.Element | null;
|
|
254
224
|
|
|
255
225
|
interface AddNoteSheetProps {
|
|
256
226
|
/** Snap points. Defaults to ["50%"]. */
|
|
@@ -289,4 +259,13 @@ interface CoverPhotoProps {
|
|
|
289
259
|
*/
|
|
290
260
|
declare function CoverPhoto({ projectId, baseUrl, style }: CoverPhotoProps): React.JSX.Element;
|
|
291
261
|
|
|
292
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Default background component for the SDK's bottom sheets.
|
|
264
|
+
* Renders an iOS-style blur with a dark tint overlay so the 3D scene
|
|
265
|
+
* remains visible behind the sheet.
|
|
266
|
+
*/
|
|
267
|
+
declare function BlurBackground({ style }: {
|
|
268
|
+
style?: StyleProp<ViewStyle>;
|
|
269
|
+
}): React.JSX.Element;
|
|
270
|
+
|
|
271
|
+
export { type AddNoteFormApi, AddNoteSheet, type AddNoteSheetProps, BlurBackground, CoverPhoto, type CoverPhotoProps, Hud, type HudProps, type InitPayload, LineDetailSheet, type LineDetailSheetProps, type LineProgressPayload, LineTagList, type LineTagListProps, LinesCarousel, type LinesCarouselProps, type NoteSubmitPayload, Notes, type NotesProps, ProjectSheet, type ProjectSheetProps, type RetorBridgeContextValue, type RetorLine, type RetorProject, type RetorTag, Viewer, type ViewerHandle, type ViewerProps, useActiveLine, useAddNote, useAutoplay, useLineProgress, useLines, useProject, useRetorBridge, useViewer };
|
package/dist/index.d.ts
CHANGED
|
@@ -185,72 +185,42 @@ interface HudProps {
|
|
|
185
185
|
declare function Hud({ children }: HudProps): React.JSX.Element;
|
|
186
186
|
|
|
187
187
|
interface ProjectSheetProps {
|
|
188
|
-
/**
|
|
189
|
-
* Snap points for the sheet. Defaults to ["20%", "60%"].
|
|
190
|
-
*/
|
|
188
|
+
/** Snap points. Defaults to ["35%", "85%"]. */
|
|
191
189
|
snapPoints?: (string | number)[];
|
|
192
|
-
/**
|
|
193
|
-
* Override the default header (project name + description).
|
|
194
|
-
* Receives the project metadata.
|
|
195
|
-
*/
|
|
190
|
+
/** Override the default header (project name + description + arrow button). */
|
|
196
191
|
renderHeader?: (project: {
|
|
197
192
|
name?: string;
|
|
198
193
|
description?: string;
|
|
199
194
|
}) => React.ReactNode;
|
|
200
|
-
/**
|
|
201
|
-
* Children to render below the header. Typically a `<LinesCarousel>`.
|
|
202
|
-
* If omitted, a default LinesCarousel is rendered.
|
|
203
|
-
*/
|
|
195
|
+
/** Children to render inside. Defaults to a built-in `<LinesCarousel>`. */
|
|
204
196
|
children?: React.ReactNode;
|
|
205
197
|
}
|
|
206
198
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* ```tsx
|
|
210
|
-
* <ProjectSheet>
|
|
211
|
-
* <LinesCarousel>
|
|
212
|
-
* {(line) => <MyLineCard line={line} />}
|
|
213
|
-
* </LinesCarousel>
|
|
214
|
-
* </ProjectSheet>
|
|
215
|
-
* ```
|
|
199
|
+
* Browse-mode bottom sheet — auto-presents whenever no line is open.
|
|
216
200
|
*/
|
|
217
201
|
declare function ProjectSheet({ snapPoints, renderHeader, children }: ProjectSheetProps): React.JSX.Element;
|
|
218
202
|
interface LinesCarouselProps {
|
|
219
203
|
children: (line: RetorLine, index: number) => React.ReactNode;
|
|
220
|
-
/** Optional gap between items. Defaults to 12. */
|
|
221
204
|
gap?: number;
|
|
222
|
-
/** Optional horizontal padding. Defaults to 16. */
|
|
223
205
|
paddingHorizontal?: number;
|
|
224
206
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Renders a horizontally scrolling list of lines using a render prop.
|
|
227
|
-
* Place inside `<ProjectSheet>`.
|
|
228
|
-
*
|
|
229
|
-
* Pressing an item is up to your render — use `useViewer().openLine(line._id)`.
|
|
230
|
-
*/
|
|
231
207
|
declare function LinesCarousel({ children, gap, paddingHorizontal }: LinesCarouselProps): React.JSX.Element | null;
|
|
232
208
|
|
|
233
209
|
interface LineDetailSheetProps {
|
|
234
|
-
/** Snap points. Defaults to ["
|
|
210
|
+
/** Snap points. Defaults to ["35%", "85%"]. */
|
|
235
211
|
snapPoints?: (string | number)[];
|
|
236
|
-
/** Override the header.
|
|
212
|
+
/** Override the header. */
|
|
237
213
|
renderHeader?: (line: RetorLine) => React.ReactNode;
|
|
238
|
-
/** Custom content (typically a `<LineTagList>`).
|
|
214
|
+
/** Custom content (typically a `<LineTagList>`). */
|
|
239
215
|
children?: React.ReactNode;
|
|
240
216
|
}
|
|
241
|
-
/**
|
|
242
|
-
* Sheet that auto-presents when the user enters a line. Shows the line's
|
|
243
|
-
* tags and a Done button. Pass `<LineTagList>` as a child to customise items.
|
|
244
|
-
*/
|
|
245
217
|
declare function LineDetailSheet({ snapPoints, renderHeader, children }: LineDetailSheetProps): React.JSX.Element;
|
|
246
218
|
interface LineTagListProps {
|
|
247
219
|
children: (tag: RetorTag, isActive: boolean) => React.ReactNode;
|
|
220
|
+
/** Optional header rendered above the list (used internally for the default header). */
|
|
221
|
+
listHeader?: React.ReactNode;
|
|
248
222
|
}
|
|
249
|
-
|
|
250
|
-
* Renders the tags of the active line as a vertical list. Re-renders the
|
|
251
|
-
* active item when the camera scrolls to it. Empty when no line is open.
|
|
252
|
-
*/
|
|
253
|
-
declare function LineTagList({ children }: LineTagListProps): React.JSX.Element | null;
|
|
223
|
+
declare function LineTagList({ children, listHeader }: LineTagListProps): React.JSX.Element | null;
|
|
254
224
|
|
|
255
225
|
interface AddNoteSheetProps {
|
|
256
226
|
/** Snap points. Defaults to ["50%"]. */
|
|
@@ -289,4 +259,13 @@ interface CoverPhotoProps {
|
|
|
289
259
|
*/
|
|
290
260
|
declare function CoverPhoto({ projectId, baseUrl, style }: CoverPhotoProps): React.JSX.Element;
|
|
291
261
|
|
|
292
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Default background component for the SDK's bottom sheets.
|
|
264
|
+
* Renders an iOS-style blur with a dark tint overlay so the 3D scene
|
|
265
|
+
* remains visible behind the sheet.
|
|
266
|
+
*/
|
|
267
|
+
declare function BlurBackground({ style }: {
|
|
268
|
+
style?: StyleProp<ViewStyle>;
|
|
269
|
+
}): React.JSX.Element;
|
|
270
|
+
|
|
271
|
+
export { type AddNoteFormApi, AddNoteSheet, type AddNoteSheetProps, BlurBackground, CoverPhoto, type CoverPhotoProps, Hud, type HudProps, type InitPayload, LineDetailSheet, type LineDetailSheetProps, type LineProgressPayload, LineTagList, type LineTagListProps, LinesCarousel, type LinesCarouselProps, type NoteSubmitPayload, Notes, type NotesProps, ProjectSheet, type ProjectSheetProps, type RetorBridgeContextValue, type RetorLine, type RetorProject, type RetorTag, Viewer, type ViewerHandle, type ViewerProps, useActiveLine, useAddNote, useAutoplay, useLineProgress, useLines, useProject, useRetorBridge, useViewer };
|