promptslide 0.3.15 → 0.3.17
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/CHANGELOG.md +14 -0
- package/README.md +16 -12
- package/dist/index.d.ts +17 -7
- package/dist/index.js +987 -211
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/commands/add.mjs +9 -2
- package/src/commands/clone.mjs +62 -22
- package/src/commands/create.mjs +8 -1
- package/src/commands/publish.mjs +34 -8
- package/src/commands/pull.mjs +66 -29
- package/src/commands/studio.mjs +3 -0
- package/src/commands/to-image.mjs +18 -5
- package/src/commands/to-pdf.mjs +27 -0
- package/src/core/animated.tsx +3 -3
- package/src/core/annotations/adapters/http.ts +8 -0
- package/src/core/annotations/annotation-overlay.tsx +77 -32
- package/src/core/annotations/annotation-panel.tsx +184 -51
- package/src/core/annotations/types.ts +5 -0
- package/src/core/annotations/use-annotations.ts +57 -7
- package/src/core/slide-deck.tsx +657 -115
- package/src/core/transitions.ts +5 -3
- package/src/core/types.ts +2 -0
- package/src/core/use-slide-navigation.ts +93 -3
- package/src/index.mjs +6 -0
- package/src/utils/deck-config.mjs +30 -11
- package/src/utils/deck-sync.mjs +78 -0
- package/src/utils/export.mjs +151 -52
- package/src/utils/registry.mjs +23 -0
- package/src/utils/studio-discovery.mjs +37 -0
- package/src/vite/plugin.mjs +146 -16
- package/templates/default/AGENTS.md +3 -2
- package/templates/default/src/deck-config.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.17](https://github.com/prompticeu/promptslide/compare/promptslide-v0.3.16...promptslide-v0.3.17) (2026-09-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* improve slide navigation, previews, and comments ([#105](https://github.com/prompticeu/promptslide/issues/105)) ([193a6f4](https://github.com/prompticeu/promptslide/commit/193a6f40e16d7fd3b6f6761e76378ede37693309))
|
|
9
|
+
|
|
10
|
+
## [0.3.16](https://github.com/prompticeu/promptslide/compare/promptslide-v0.3.15...promptslide-v0.3.16) (2026-08-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **cli:** guard deck sync against stale slides ([#103](https://github.com/prompticeu/promptslide/issues/103)) ([f8dddc9](https://github.com/prompticeu/promptslide/commit/f8dddc9fe4177c37dbae729d1efc8971aa46ed92))
|
|
16
|
+
|
|
3
17
|
## [0.3.15](https://github.com/prompticeu/promptslide/compare/promptslide-v0.3.14...promptslide-v0.3.15) (2026-04-09)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -21,18 +21,22 @@ Then open your coding agent and say:
|
|
|
21
21
|
|
|
22
22
|
All commands are run via `npx promptslide <command>`.
|
|
23
23
|
|
|
24
|
-
| Command
|
|
25
|
-
|
|
|
26
|
-
| `create`
|
|
27
|
-
| `studio`
|
|
28
|
-
| `build`
|
|
29
|
-
| `preview`
|
|
30
|
-
| `add`
|
|
31
|
-
| `remove`
|
|
32
|
-
| `list`
|
|
33
|
-
| `publish`
|
|
34
|
-
| `search`
|
|
35
|
-
| `pull`
|
|
24
|
+
| Command | Description |
|
|
25
|
+
| ---------- | ---------------------------------------- |
|
|
26
|
+
| `create` | Scaffold a new slide deck project |
|
|
27
|
+
| `studio` | Start the dev server with hot reload |
|
|
28
|
+
| `build` | Build the deck for production |
|
|
29
|
+
| `preview` | Preview the production build |
|
|
30
|
+
| `add` | Add a slide to the current deck |
|
|
31
|
+
| `remove` | Remove a slide from the current deck |
|
|
32
|
+
| `list` | List all slides in the current deck |
|
|
33
|
+
| `publish` | Publish the deck to PromptSlide registry |
|
|
34
|
+
| `search` | Search published decks |
|
|
35
|
+
| `pull` | Pull a published deck |
|
|
36
|
+
| `to-image` | Export a slide as a PNG image |
|
|
37
|
+
| `to-pdf` | Export all slides as a PDF |
|
|
38
|
+
|
|
39
|
+
Use optional, unique slide IDs in `src/deck-config.ts` for stable URL links and annotations. Existing numbered slide links and decks without IDs continue to work.
|
|
36
40
|
|
|
37
41
|
## How It Works
|
|
38
42
|
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,8 @@ type SlideComponent = React.ComponentType<SlideProps>;
|
|
|
113
113
|
* eliminating the need for runtime step discovery.
|
|
114
114
|
*/
|
|
115
115
|
interface SlideConfig {
|
|
116
|
+
/** Stable identifier for links and annotations. Keep unchanged when reordering slides. */
|
|
117
|
+
id?: string;
|
|
116
118
|
/** The slide component to render */
|
|
117
119
|
component: SlideComponent;
|
|
118
120
|
/** Number of animation steps (0 = no animations). This is the max step number used in <Animated step={N}> */
|
|
@@ -222,7 +224,7 @@ declare function useAnimationContext(): AnimationContextValue;
|
|
|
222
224
|
|
|
223
225
|
type AnimationType = "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "scale";
|
|
224
226
|
interface AnimatedProps {
|
|
225
|
-
/** Which step reveals this content (
|
|
227
|
+
/** Which step reveals this content (0 = visible from slide entry) */
|
|
226
228
|
step: number;
|
|
227
229
|
/** Animation type */
|
|
228
230
|
animation?: AnimationType;
|
|
@@ -397,6 +399,8 @@ interface Annotation {
|
|
|
397
399
|
id: string;
|
|
398
400
|
/** Slide index (0-based, matching deck-config order) */
|
|
399
401
|
slideIndex: number;
|
|
402
|
+
/** Stable slide identity, when available. Takes precedence over slideIndex. */
|
|
403
|
+
slideId?: string;
|
|
400
404
|
/** Slide title from SlideConfig (informational, for agent readability) */
|
|
401
405
|
slideTitle: string;
|
|
402
406
|
/** Target element identification */
|
|
@@ -419,6 +423,9 @@ interface AnnotationStorageAdapter {
|
|
|
419
423
|
load(): Promise<Annotation[]>;
|
|
420
424
|
add(annotation: Annotation): Promise<void>;
|
|
421
425
|
remove(id: string): Promise<void>;
|
|
426
|
+
update?(id: string, patch: Pick<Annotation, "body" | "status">): Promise<void>;
|
|
427
|
+
/** Persist a migration of legacy index-based annotations. */
|
|
428
|
+
replaceAll?(annotations: Annotation[]): Promise<void>;
|
|
422
429
|
/** Optional: subscribe to external state updates (e.g. postMessage from parent) */
|
|
423
430
|
subscribe?(onUpdate: (annotations: Annotation[]) => void): () => void;
|
|
424
431
|
}
|
|
@@ -429,17 +436,19 @@ interface AnnotationOverlayProps {
|
|
|
429
436
|
/** Ref to the slide container element (the div wrapping SlideRenderer) */
|
|
430
437
|
slideContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
431
438
|
selectedId: string | null;
|
|
439
|
+
hoveredId: string | null;
|
|
432
440
|
onSelectId: (id: string | null) => void;
|
|
433
441
|
onShowPanel: () => void;
|
|
434
442
|
slideAnnotations: Annotation[];
|
|
435
|
-
addAnnotation: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string) => void;
|
|
443
|
+
addAnnotation: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string, slideId?: string) => void;
|
|
436
444
|
}
|
|
437
|
-
declare function AnnotationOverlay({ slides, currentSlide, slideContainerRef, selectedId, onSelectId, onShowPanel, slideAnnotations, addAnnotation }: AnnotationOverlayProps): react_jsx_runtime.JSX.Element;
|
|
445
|
+
declare function AnnotationOverlay({ slides, currentSlide, slideContainerRef, selectedId, hoveredId, onSelectId, onShowPanel, slideAnnotations, addAnnotation }: AnnotationOverlayProps): react_jsx_runtime.JSX.Element;
|
|
438
446
|
|
|
439
|
-
declare function useAnnotations(adapter?: AnnotationStorageAdapter): {
|
|
447
|
+
declare function useAnnotations(slidesOrAdapter?: SlideConfig[] | AnnotationStorageAdapter, adapter?: AnnotationStorageAdapter): {
|
|
440
448
|
annotations: Annotation[];
|
|
441
|
-
addAnnotation: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string) => void;
|
|
449
|
+
addAnnotation: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string, slideId?: string) => void;
|
|
442
450
|
deleteAnnotation: (id: string) => void;
|
|
451
|
+
updateAnnotation: (id: string, patch: Partial<Pick<Annotation, "body" | "status">>) => void;
|
|
443
452
|
getSlideAnnotations: (slideIndex: number) => Annotation[];
|
|
444
453
|
openCount: number;
|
|
445
454
|
updateAnnotations: (updated: Annotation[]) => void;
|
|
@@ -455,11 +464,12 @@ interface SlideDeckProps {
|
|
|
455
464
|
/** Annotation data to display. When provided (even empty array), annotation UI is enabled. When undefined, annotation UI is hidden. */
|
|
456
465
|
annotations?: Annotation[];
|
|
457
466
|
/** Called when the user creates an annotation */
|
|
458
|
-
onAnnotationAdd?: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string) => void;
|
|
467
|
+
onAnnotationAdd?: (slideIndex: number, slideTitle: string, target: AnnotationTarget, body: string, slideId?: string) => void;
|
|
459
468
|
/** Called when the user deletes an annotation */
|
|
460
469
|
onAnnotationDelete?: (id: string) => void;
|
|
470
|
+
onAnnotationUpdate?: (id: string, patch: Partial<Pick<Annotation, "body" | "status">>) => void;
|
|
461
471
|
}
|
|
462
|
-
declare function SlideDeck({ slides, transition, directionalTransition, annotations, onAnnotationAdd, onAnnotationDelete }: SlideDeckProps): react_jsx_runtime.JSX.Element;
|
|
472
|
+
declare function SlideDeck({ slides, transition, directionalTransition, annotations, onAnnotationAdd, onAnnotationDelete, onAnnotationUpdate }: SlideDeckProps): react_jsx_runtime.JSX.Element;
|
|
463
473
|
|
|
464
474
|
interface SlideErrorBoundaryProps {
|
|
465
475
|
slideIndex: number;
|