@reslide-dev/core 0.0.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,340 @@
1
+ import * as react from "react";
2
+ import { CSSProperties, ComponentType, ReactNode } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/SlideTransition.d.ts
6
+ type TransitionType = "none" | "fade" | "slide-left" | "slide-right" | "slide-up" | "slide-down";
7
+ //#endregion
8
+ //#region src/Deck.d.ts
9
+ interface DeckProps {
10
+ children: ReactNode;
11
+ /** Slide transition type */
12
+ transition?: TransitionType;
13
+ }
14
+ declare function Deck({
15
+ children,
16
+ transition
17
+ }: DeckProps): react_jsx_runtime0.JSX.Element;
18
+ //#endregion
19
+ //#region src/Slide.d.ts
20
+ interface SlideProps {
21
+ children: ReactNode;
22
+ /** Layout variant for the slide */
23
+ layout?: string;
24
+ /** Image URL for image-right / image-left layouts */
25
+ image?: string;
26
+ /** Additional CSS class name */
27
+ className?: string;
28
+ /** Additional inline styles */
29
+ style?: CSSProperties;
30
+ }
31
+ declare function Slide({
32
+ children,
33
+ layout,
34
+ image,
35
+ className,
36
+ style
37
+ }: SlideProps): react_jsx_runtime0.JSX.Element;
38
+ //#endregion
39
+ //#region src/Click.d.ts
40
+ interface ClickProps {
41
+ children: ReactNode;
42
+ /** The click step at which this content becomes visible (1-based) */
43
+ at?: number;
44
+ }
45
+ declare function Click({
46
+ children,
47
+ at
48
+ }: ClickProps): react_jsx_runtime0.JSX.Element;
49
+ /**
50
+ * Register click steps for the current slide.
51
+ * Automatically reads the slide index from SlideIndexContext.
52
+ * If slideIndex prop is provided, it takes precedence (for backwards compatibility).
53
+ */
54
+ declare function ClickSteps({
55
+ count,
56
+ slideIndex
57
+ }: {
58
+ count: number;
59
+ slideIndex?: number;
60
+ }): null;
61
+ //#endregion
62
+ //#region src/Mark.d.ts
63
+ interface MarkProps {
64
+ children: ReactNode;
65
+ /** Mark style type */
66
+ type?: "highlight" | "underline" | "circle";
67
+ /** Color name (maps to CSS variable or direct color) */
68
+ color?: string;
69
+ }
70
+ declare function Mark({
71
+ children,
72
+ type,
73
+ color
74
+ }: MarkProps): react_jsx_runtime0.JSX.Element;
75
+ //#endregion
76
+ //#region src/Notes.d.ts
77
+ interface NotesProps {
78
+ children: ReactNode;
79
+ }
80
+ /**
81
+ * Speaker notes. Hidden during normal presentation,
82
+ * visible in overview mode.
83
+ */
84
+ declare function Notes({
85
+ children
86
+ }: NotesProps): react_jsx_runtime0.JSX.Element | null;
87
+ //#endregion
88
+ //#region src/Slot.d.ts
89
+ interface SlotProps {
90
+ children: ReactNode;
91
+ }
92
+ /**
93
+ * Marks content as belonging to the right column in a two-cols layout.
94
+ * Used by remarkSlides to separate `::right` content.
95
+ */
96
+ declare function SlotRight({
97
+ children
98
+ }: SlotProps): react_jsx_runtime0.JSX.Element;
99
+ declare namespace SlotRight {
100
+ var displayName: string;
101
+ }
102
+ declare namespace SlotRight {
103
+ var __reslideSlot: "right";
104
+ }
105
+ //#endregion
106
+ //#region src/PrintView.d.ts
107
+ /**
108
+ * Renders all slides vertically for print/PDF export.
109
+ * Use with @media print CSS to generate PDFs via browser print.
110
+ */
111
+ declare function PrintView({
112
+ children
113
+ }: {
114
+ children: ReactNode;
115
+ }): react_jsx_runtime0.JSX.Element;
116
+ //#endregion
117
+ //#region src/PresenterView.d.ts
118
+ interface PresenterViewProps {
119
+ children: ReactNode;
120
+ /** Render function for notes content per slide */
121
+ notes?: ReactNode[];
122
+ }
123
+ /**
124
+ * Presenter view that syncs with the main presentation window.
125
+ * Shows: current slide, next slide preview, notes, and timer.
126
+ */
127
+ declare function PresenterView({
128
+ children,
129
+ notes
130
+ }: PresenterViewProps): react_jsx_runtime0.JSX.Element;
131
+ //#endregion
132
+ //#region src/use-presenter.d.ts
133
+ /**
134
+ * Opens the presenter window at the /presenter route.
135
+ */
136
+ declare function openPresenterWindow(): void;
137
+ /**
138
+ * Check if the current window is the presenter view.
139
+ */
140
+ declare function isPresenterView(): boolean;
141
+ //#endregion
142
+ //#region src/DrawingLayer.d.ts
143
+ interface DrawingLayerProps {
144
+ /** Whether drawing mode is active */
145
+ active: boolean;
146
+ /** Pen color */
147
+ color?: string;
148
+ /** Pen width */
149
+ width?: number;
150
+ }
151
+ /**
152
+ * Canvas-based freehand drawing overlay for presentations.
153
+ * Toggle with `d` key (handled in Deck).
154
+ */
155
+ declare function DrawingLayer({
156
+ active,
157
+ color,
158
+ width
159
+ }: DrawingLayerProps): react_jsx_runtime0.JSX.Element;
160
+ //#endregion
161
+ //#region src/CodeEditor.d.ts
162
+ interface CodeEditorProps {
163
+ /** Initial code content */
164
+ value: string;
165
+ /** Programming language for syntax highlighting */
166
+ language?: string;
167
+ /** Whether the editor is read-only */
168
+ readOnly?: boolean;
169
+ /** Editor height */
170
+ height?: string | number;
171
+ /** Called when code changes */
172
+ onChange?: (value: string) => void;
173
+ /** Additional styles */
174
+ style?: CSSProperties;
175
+ }
176
+ /**
177
+ * Live code editor component for presentations.
178
+ * Uses Monaco Editor (loaded from CDN) for syntax highlighting and editing.
179
+ *
180
+ * Falls back to a styled <textarea> if Monaco fails to load.
181
+ */
182
+ declare function CodeEditor({
183
+ value,
184
+ language,
185
+ readOnly,
186
+ height,
187
+ onChange,
188
+ style
189
+ }: CodeEditorProps): react_jsx_runtime0.JSX.Element;
190
+ //#endregion
191
+ //#region src/GlobalLayer.d.ts
192
+ interface GlobalLayerProps {
193
+ children: ReactNode;
194
+ /** z-index position: 'above' renders on top of slides, 'below' renders behind */
195
+ position?: "above" | "below";
196
+ /** Additional styles */
197
+ style?: CSSProperties;
198
+ }
199
+ /**
200
+ * Global overlay layer that persists across all slides.
201
+ * Use for headers, footers, logos, watermarks, or progress bars.
202
+ *
203
+ * Place inside <Deck> to render on every slide.
204
+ *
205
+ * @example
206
+ * ```tsx
207
+ * <Deck>
208
+ * <GlobalLayer position="above" style={{ bottom: 0 }}>
209
+ * <footer>My Company</footer>
210
+ * </GlobalLayer>
211
+ * <Slide>...</Slide>
212
+ * </Deck>
213
+ * ```
214
+ */
215
+ declare function GlobalLayer({
216
+ children,
217
+ position,
218
+ style
219
+ }: GlobalLayerProps): react_jsx_runtime0.JSX.Element;
220
+ declare namespace GlobalLayer {
221
+ var displayName: string;
222
+ }
223
+ declare namespace GlobalLayer {
224
+ var __reslideGlobalLayer: true;
225
+ }
226
+ //#endregion
227
+ //#region src/Draggable.d.ts
228
+ interface DraggableProps {
229
+ children: ReactNode;
230
+ /** Initial x position (px or %) */
231
+ x?: number | string;
232
+ /** Initial y position (px or %) */
233
+ y?: number | string;
234
+ /** Additional styles */
235
+ style?: CSSProperties;
236
+ }
237
+ /**
238
+ * A draggable element within a slide.
239
+ * Click and drag to reposition during presentation.
240
+ */
241
+ declare function Draggable({
242
+ children,
243
+ x,
244
+ y,
245
+ style
246
+ }: DraggableProps): react_jsx_runtime0.JSX.Element;
247
+ //#endregion
248
+ //#region src/ClickNavigation.d.ts
249
+ interface ClickNavigationProps {
250
+ onPrev: () => void;
251
+ onNext: () => void;
252
+ disabled?: boolean;
253
+ }
254
+ /**
255
+ * Invisible click zones on the left/right edges of the slide.
256
+ * Clicking the left ~15% goes to the previous slide,
257
+ * clicking the right ~15% goes to the next slide.
258
+ * Shows a subtle arrow indicator on hover.
259
+ */
260
+ declare function ClickNavigation({
261
+ onPrev,
262
+ onNext,
263
+ disabled
264
+ }: ClickNavigationProps): react_jsx_runtime0.JSX.Element | null;
265
+ //#endregion
266
+ //#region src/ReslideEmbed.d.ts
267
+ interface ReslideEmbedProps {
268
+ /** Compiled MDX code from compileMdxSlides() */
269
+ code: string;
270
+ /** Slide transition type */
271
+ transition?: TransitionType;
272
+ /** Additional MDX components to provide */
273
+ components?: Record<string, ComponentType>;
274
+ /** Wrapper around the Deck (for styling) */
275
+ className?: string;
276
+ /** Inline styles for the container */
277
+ style?: React.CSSProperties;
278
+ }
279
+ /**
280
+ * Renders compiled MDX slides as a full reslide presentation.
281
+ *
282
+ * Usage:
283
+ * ```tsx
284
+ * // Server component
285
+ * import { compileMdxSlides } from '@reslide/mdx'
286
+ * const { code } = await compileMdxSlides(mdxSource)
287
+ *
288
+ * // Client component
289
+ * import { ReslideEmbed } from '@reslide/core'
290
+ * <ReslideEmbed code={code} transition="fade" />
291
+ * ```
292
+ */
293
+ declare function ReslideEmbed({
294
+ code,
295
+ transition,
296
+ components: userComponents,
297
+ className,
298
+ style
299
+ }: ReslideEmbedProps): react_jsx_runtime0.JSX.Element;
300
+ //#endregion
301
+ //#region src/types.d.ts
302
+ interface DeckState {
303
+ /** Current slide index (0-based) */
304
+ currentSlide: number;
305
+ /** Total number of slides */
306
+ totalSlides: number;
307
+ /** Current click step within the slide (0 = initial state) */
308
+ clickStep: number;
309
+ /** Total click steps in the current slide */
310
+ totalClickSteps: number;
311
+ /** Whether overview mode is active */
312
+ isOverview: boolean;
313
+ /** Whether fullscreen is active */
314
+ isFullscreen: boolean;
315
+ }
316
+ interface DeckActions {
317
+ /** Go to next slide or click step */
318
+ next: () => void;
319
+ /** Go to previous slide or click step */
320
+ prev: () => void;
321
+ /** Go to a specific slide */
322
+ goTo: (slideIndex: number) => void;
323
+ /** Toggle overview mode */
324
+ toggleOverview: () => void;
325
+ /** Toggle fullscreen */
326
+ toggleFullscreen: () => void;
327
+ /** Register click steps for a slide */
328
+ registerClickSteps: (slideIndex: number, count: number) => void;
329
+ }
330
+ type DeckContextValue = DeckState & DeckActions;
331
+ //#endregion
332
+ //#region src/context.d.ts
333
+ declare const DeckContext: react.Context<DeckContextValue | null>;
334
+ declare function useDeck(): DeckContextValue;
335
+ //#endregion
336
+ //#region src/slide-context.d.ts
337
+ declare const SlideIndexContext: react.Context<number | null>;
338
+ declare function useSlideIndex(): number;
339
+ //#endregion
340
+ export { Click, ClickNavigation, type ClickProps, ClickSteps, CodeEditor, type CodeEditorProps, Deck, type DeckActions, DeckContext, type DeckContextValue, type DeckProps, type DeckState, Draggable, type DraggableProps, DrawingLayer, type DrawingLayerProps, GlobalLayer, type GlobalLayerProps, Mark, type MarkProps, Notes, type NotesProps, PresenterView, type PresenterViewProps, PrintView, ReslideEmbed, type ReslideEmbedProps, Slide, SlideIndexContext, type SlideProps, SlotRight, type TransitionType, isPresenterView, openPresenterWindow, useDeck, useSlideIndex };