promptslide 0.2.3 → 0.2.5

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/dist/index.d.ts CHANGED
@@ -346,6 +346,44 @@ interface SlideFooterProps {
346
346
  }
347
347
  declare function SlideFooter({ slideNumber, totalSlides, variant }: SlideFooterProps): react_jsx_runtime.JSX.Element | null;
348
348
 
349
+ interface SlideRendererProps {
350
+ slides: SlideConfig[];
351
+ currentSlide: number;
352
+ animationStep: number;
353
+ totalSteps: number;
354
+ direction: NavigationDirection;
355
+ showAllAnimations: boolean;
356
+ transition?: SlideTransitionType;
357
+ directionalTransition?: boolean;
358
+ onTransitionComplete: () => void;
359
+ }
360
+ /**
361
+ * Renders a single slide with animated transitions.
362
+ * Extracted from SlideDeck so it can be reused in SlideEmbed and other contexts.
363
+ */
364
+ declare function SlideRenderer({ slides, currentSlide, animationStep, totalSteps, direction, showAllAnimations, transition, directionalTransition, onTransitionComplete }: SlideRendererProps): react_jsx_runtime.JSX.Element;
365
+
366
+ interface SlideEmbedProps {
367
+ slides: SlideConfig[];
368
+ transition?: SlideTransitionType;
369
+ directionalTransition?: boolean;
370
+ }
371
+ /**
372
+ * Headless slide viewer controlled via window.postMessage.
373
+ * Designed for embedding in an iframe (e.g. the registry editor preview).
374
+ *
375
+ * Inbound messages (parent → embed):
376
+ * { type: "navigate", data: { slide: number } }
377
+ * { type: "advance" }
378
+ * { type: "goBack" }
379
+ *
380
+ * Outbound messages (embed → parent):
381
+ * { type: "slideReady" }
382
+ * { type: "slideState", data: { currentSlide, totalSlides, animationStep, totalSteps, titles } }
383
+ * { type: "hmrUpdate" }
384
+ */
385
+ declare function SlideEmbed({ slides, transition, directionalTransition }: SlideEmbedProps): react_jsx_runtime.JSX.Element;
386
+
349
387
  interface SlideDeckProps {
350
388
  slides: SlideConfig[];
351
389
  transition?: SlideTransitionType;
@@ -374,4 +412,4 @@ declare class SlideErrorBoundary extends React$1.Component<SlideErrorBoundaryPro
374
412
 
375
413
  declare function cn(...inputs: ClassValue[]): string;
376
414
 
377
- export { Animated, AnimatedGroup, AnimationProvider, type AnimationType, DEFAULT_SLIDE_TRANSITION, EASE_DEFAULT, EASE_IN, EASE_MORPH, EASE_OUT, ELEMENT_SLIDE_DISTANCE, MORPH_DURATION, MORPH_TRANSITION, Morph, MorphGroup, MorphItem, MorphText, type NavigationDirection, SLIDE_DIMENSIONS, SLIDE_DISTANCE, SLIDE_TRANSITION, SLIDE_TRANSITION_DURATION, SLIDE_VARIANTS, SPRING_BOUNCY, SPRING_SMOOTH, SPRING_SNAPPY, STAGGER_DELAY, STEP_ANIMATION_DURATION, STEP_TRANSITION, type SlideComponent, type SlideConfig, SlideDeck, SlideErrorBoundary, SlideFooter, type SlideProps, SlideThemeProvider, type SlideTransitionConfig, type SlideTransitionType, type ThemeConfig, type UseSlideNavigationOptions, type UseSlideNavigationReturn, cn, createDirectionalVariants, directionalSlideX, directionalSlideY, getSlideTransition, getSlideVariants, useAnimationContext, useSlideNavigation, useTheme };
415
+ export { Animated, AnimatedGroup, AnimationProvider, type AnimationType, DEFAULT_SLIDE_TRANSITION, EASE_DEFAULT, EASE_IN, EASE_MORPH, EASE_OUT, ELEMENT_SLIDE_DISTANCE, MORPH_DURATION, MORPH_TRANSITION, Morph, MorphGroup, MorphItem, MorphText, type NavigationDirection, SLIDE_DIMENSIONS, SLIDE_DISTANCE, SLIDE_TRANSITION, SLIDE_TRANSITION_DURATION, SLIDE_VARIANTS, SPRING_BOUNCY, SPRING_SMOOTH, SPRING_SNAPPY, STAGGER_DELAY, STEP_ANIMATION_DURATION, STEP_TRANSITION, type SlideComponent, type SlideConfig, SlideDeck, SlideEmbed, SlideErrorBoundary, SlideFooter, type SlideProps, SlideRenderer, type SlideRendererProps, SlideThemeProvider, type SlideTransitionConfig, type SlideTransitionType, type ThemeConfig, type UseSlideNavigationOptions, type UseSlideNavigationReturn, cn, createDirectionalVariants, directionalSlideX, directionalSlideY, getSlideTransition, getSlideVariants, useAnimationContext, useSlideNavigation, useTheme };
package/dist/index.js CHANGED
@@ -495,10 +495,8 @@ function SlideFooter({ slideNumber, totalSlides, variant = "default" }) {
495
495
  ] });
496
496
  }
497
497
 
498
- // src/core/slide-deck.tsx
499
- import { AnimatePresence, LayoutGroup, motion as motion3 } from "framer-motion";
500
- import { ChevronLeft, ChevronRight, Download, Grid3X3, List, Maximize, Monitor } from "lucide-react";
501
- import { useCallback as useCallback2, useEffect as useEffect2, useRef, useState as useState2 } from "react";
498
+ // src/core/slide-renderer.tsx
499
+ import { AnimatePresence, motion as motion3 } from "framer-motion";
502
500
 
503
501
  // src/core/slide-error-boundary.tsx
504
502
  import React from "react";
@@ -538,6 +536,169 @@ var SlideErrorBoundary = class extends React.Component {
538
536
  }
539
537
  };
540
538
 
539
+ // src/core/slide-renderer.tsx
540
+ import { jsx as jsx7 } from "react/jsx-runtime";
541
+ function SlideRenderer({
542
+ slides,
543
+ currentSlide,
544
+ animationStep,
545
+ totalSteps,
546
+ direction,
547
+ showAllAnimations,
548
+ transition,
549
+ directionalTransition,
550
+ onTransitionComplete
551
+ }) {
552
+ const currentSlideTransition = slides[currentSlide]?.transition;
553
+ const transitionType = currentSlideTransition ?? transition ?? DEFAULT_SLIDE_TRANSITION;
554
+ const isDirectional = directionalTransition ?? false;
555
+ const slideVariants = getSlideVariants(
556
+ { type: transitionType, directional: isDirectional },
557
+ direction
558
+ );
559
+ const CurrentSlideComponent = slides[currentSlide].component;
560
+ return /* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx7(
561
+ motion3.div,
562
+ {
563
+ variants: slideVariants,
564
+ initial: "enter",
565
+ animate: "center",
566
+ exit: "exit",
567
+ transition: SLIDE_TRANSITION,
568
+ onAnimationComplete: (definition) => {
569
+ if (definition === "center") {
570
+ onTransitionComplete();
571
+ }
572
+ },
573
+ className: "absolute inset-0 h-full w-full",
574
+ children: /* @__PURE__ */ jsx7(
575
+ AnimationProvider,
576
+ {
577
+ currentStep: animationStep,
578
+ totalSteps,
579
+ showAllAnimations,
580
+ children: /* @__PURE__ */ jsx7(
581
+ SlideErrorBoundary,
582
+ {
583
+ slideIndex: currentSlide,
584
+ slideTitle: slides[currentSlide]?.title,
585
+ children: /* @__PURE__ */ jsx7(
586
+ CurrentSlideComponent,
587
+ {
588
+ slideNumber: currentSlide + 1,
589
+ totalSlides: slides.length
590
+ }
591
+ )
592
+ }
593
+ )
594
+ }
595
+ )
596
+ },
597
+ currentSlide
598
+ ) });
599
+ }
600
+
601
+ // src/core/slide-embed.tsx
602
+ import { useCallback as useCallback2, useEffect as useEffect2, useState as useState2 } from "react";
603
+ import { jsx as jsx8 } from "react/jsx-runtime";
604
+ function SlideEmbed({ slides, transition, directionalTransition }) {
605
+ const [scale, setScale] = useState2(1);
606
+ const {
607
+ currentSlide,
608
+ animationStep,
609
+ totalSteps,
610
+ direction,
611
+ showAllAnimations,
612
+ advance,
613
+ goBack,
614
+ goToSlide,
615
+ onTransitionComplete
616
+ } = useSlideNavigation({ slides });
617
+ useEffect2(() => {
618
+ const state = {
619
+ currentSlide,
620
+ totalSlides: slides.length,
621
+ animationStep,
622
+ totalSteps,
623
+ titles: slides.map((s) => s.title || "")
624
+ };
625
+ window.parent.postMessage({ type: "slideState", data: state }, "*");
626
+ }, [currentSlide, animationStep, totalSteps, slides]);
627
+ useEffect2(() => {
628
+ window.parent.postMessage({ type: "slideReady" }, "*");
629
+ }, []);
630
+ useEffect2(() => {
631
+ const hot = import.meta.hot;
632
+ if (hot) {
633
+ hot.on("vite:afterUpdate", () => {
634
+ window.parent.postMessage({ type: "hmrUpdate" }, "*");
635
+ });
636
+ }
637
+ }, []);
638
+ const handleMessage = useCallback2(
639
+ (event) => {
640
+ const { type, data } = event.data || {};
641
+ switch (type) {
642
+ case "navigate":
643
+ if (typeof data?.slide === "number") goToSlide(data.slide);
644
+ break;
645
+ case "advance":
646
+ advance();
647
+ break;
648
+ case "goBack":
649
+ goBack();
650
+ break;
651
+ }
652
+ },
653
+ [advance, goBack, goToSlide]
654
+ );
655
+ useEffect2(() => {
656
+ window.addEventListener("message", handleMessage);
657
+ return () => window.removeEventListener("message", handleMessage);
658
+ }, [handleMessage]);
659
+ useEffect2(() => {
660
+ const calculateScale = () => {
661
+ const scaleX = window.innerWidth / SLIDE_DIMENSIONS.width;
662
+ const scaleY = window.innerHeight / SLIDE_DIMENSIONS.height;
663
+ setScale(Math.min(scaleX, scaleY));
664
+ };
665
+ calculateScale();
666
+ window.addEventListener("resize", calculateScale);
667
+ return () => window.removeEventListener("resize", calculateScale);
668
+ }, []);
669
+ return /* @__PURE__ */ jsx8("div", { className: "flex h-screen w-screen items-center justify-center overflow-hidden bg-black", children: /* @__PURE__ */ jsx8(
670
+ "div",
671
+ {
672
+ className: "relative overflow-hidden bg-black",
673
+ style: {
674
+ width: SLIDE_DIMENSIONS.width,
675
+ height: SLIDE_DIMENSIONS.height,
676
+ transform: `scale(${scale})`,
677
+ transformOrigin: "center center"
678
+ },
679
+ children: /* @__PURE__ */ jsx8(
680
+ SlideRenderer,
681
+ {
682
+ slides,
683
+ currentSlide,
684
+ animationStep,
685
+ totalSteps,
686
+ direction,
687
+ showAllAnimations,
688
+ transition,
689
+ directionalTransition,
690
+ onTransitionComplete
691
+ }
692
+ )
693
+ }
694
+ ) });
695
+ }
696
+
697
+ // src/core/slide-deck.tsx
698
+ import { LayoutGroup } from "framer-motion";
699
+ import { ChevronLeft, ChevronRight, Download, Grid3X3, List, Maximize, Monitor } from "lucide-react";
700
+ import { useCallback as useCallback3, useEffect as useEffect3, useRef, useState as useState3 } from "react";
701
+
541
702
  // src/core/utils.ts
542
703
  import { clsx } from "clsx";
543
704
  import { twMerge } from "tailwind-merge";
@@ -546,16 +707,16 @@ function cn(...inputs) {
546
707
  }
547
708
 
548
709
  // src/core/slide-deck.tsx
549
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
710
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
550
711
  function SlideExportView({ slides, slideIndex }) {
551
- const [ready, setReady] = useState2(false);
712
+ const [ready, setReady] = useState3(false);
552
713
  const clampedIndex = Math.max(0, Math.min(slideIndex, slides.length - 1));
553
714
  const slideConfig = slides[clampedIndex];
554
715
  const SlideComponent = slideConfig.component;
555
- useEffect2(() => {
716
+ useEffect3(() => {
556
717
  setReady(true);
557
718
  }, []);
558
- return /* @__PURE__ */ jsx7(
719
+ return /* @__PURE__ */ jsx9(
559
720
  "div",
560
721
  {
561
722
  "data-export-ready": ready ? "true" : void 0,
@@ -566,31 +727,31 @@ function SlideExportView({ slides, slideIndex }) {
566
727
  position: "relative",
567
728
  background: "black"
568
729
  },
569
- children: /* @__PURE__ */ jsx7(
730
+ children: /* @__PURE__ */ jsx9(
570
731
  AnimationProvider,
571
732
  {
572
733
  currentStep: slideConfig.steps,
573
734
  totalSteps: slideConfig.steps,
574
735
  showAllAnimations: true,
575
- children: /* @__PURE__ */ jsx7(SlideErrorBoundary, { slideIndex: clampedIndex, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx7(SlideComponent, { slideNumber: clampedIndex + 1, totalSlides: slides.length }) })
736
+ children: /* @__PURE__ */ jsx9(SlideErrorBoundary, { slideIndex: clampedIndex, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx9(SlideComponent, { slideNumber: clampedIndex + 1, totalSlides: slides.length }) })
576
737
  }
577
738
  )
578
739
  }
579
740
  );
580
741
  }
581
742
  function SlideDeck({ slides, transition, directionalTransition }) {
582
- const [exportParams] = useState2(() => {
743
+ const [exportParams] = useState3(() => {
583
744
  if (typeof window === "undefined") return null;
584
745
  const params = new URLSearchParams(window.location.search);
585
746
  if (params.get("export") !== "true") return null;
586
747
  return { slideIndex: parseInt(params.get("slide") || "0", 10) };
587
748
  });
588
749
  if (exportParams) {
589
- return /* @__PURE__ */ jsx7(SlideExportView, { slides, slideIndex: exportParams.slideIndex });
750
+ return /* @__PURE__ */ jsx9(SlideExportView, { slides, slideIndex: exportParams.slideIndex });
590
751
  }
591
- const [viewMode, setViewMode] = useState2("slide");
592
- const [isPresentationMode, setIsPresentationMode] = useState2(false);
593
- const [scale, setScale] = useState2(1);
752
+ const [viewMode, setViewMode] = useState3("slide");
753
+ const [isPresentationMode, setIsPresentationMode] = useState3(false);
754
+ const [scale, setScale] = useState3(1);
594
755
  const containerRef = useRef(null);
595
756
  const {
596
757
  currentSlide,
@@ -605,21 +766,21 @@ function SlideDeck({ slides, transition, directionalTransition }) {
605
766
  } = useSlideNavigation({
606
767
  slides
607
768
  });
608
- const togglePresentationMode = useCallback2(async () => {
769
+ const togglePresentationMode = useCallback3(async () => {
609
770
  if (!document.fullscreenElement) {
610
771
  await document.documentElement.requestFullscreen();
611
772
  } else {
612
773
  await document.exitFullscreen();
613
774
  }
614
775
  }, []);
615
- useEffect2(() => {
776
+ useEffect3(() => {
616
777
  const handleFullscreenChange = () => {
617
778
  setIsPresentationMode(!!document.fullscreenElement);
618
779
  };
619
780
  document.addEventListener("fullscreenchange", handleFullscreenChange);
620
781
  return () => document.removeEventListener("fullscreenchange", handleFullscreenChange);
621
782
  }, []);
622
- useEffect2(() => {
783
+ useEffect3(() => {
623
784
  const calculateScale = () => {
624
785
  if (!isPresentationMode) {
625
786
  setScale(1);
@@ -647,7 +808,7 @@ function SlideDeck({ slides, transition, directionalTransition }) {
647
808
  window.print();
648
809
  }, 100);
649
810
  };
650
- useEffect2(() => {
811
+ useEffect3(() => {
651
812
  const handleKeyDown = (e) => {
652
813
  if (e.key === "f" || e.key === "F") {
653
814
  togglePresentationMode();
@@ -669,16 +830,8 @@ function SlideDeck({ slides, transition, directionalTransition }) {
669
830
  window.addEventListener("keydown", handleKeyDown);
670
831
  return () => window.removeEventListener("keydown", handleKeyDown);
671
832
  }, [advance, goBack, viewMode, togglePresentationMode]);
672
- const currentSlideTransition = slides[currentSlide]?.transition;
673
- const transitionType = currentSlideTransition ?? transition ?? DEFAULT_SLIDE_TRANSITION;
674
- const isDirectional = directionalTransition ?? false;
675
- const slideVariants = getSlideVariants(
676
- { type: transitionType, directional: isDirectional },
677
- direction
678
- );
679
- const CurrentSlideComponent = slides[currentSlide].component;
680
833
  return /* @__PURE__ */ jsxs3("div", { className: "min-h-screen w-full bg-neutral-950 text-foreground", children: [
681
- /* @__PURE__ */ jsx7("style", { children: `
834
+ /* @__PURE__ */ jsx9("style", { children: `
682
835
  @media print {
683
836
  @page {
684
837
  size: 1920px 1080px;
@@ -707,7 +860,7 @@ function SlideDeck({ slides, transition, directionalTransition }) {
707
860
  isPresentationMode && "hidden"
708
861
  ),
709
862
  children: [
710
- /* @__PURE__ */ jsx7(
863
+ /* @__PURE__ */ jsx9(
711
864
  "button",
712
865
  {
713
866
  onClick: () => setViewMode("slide"),
@@ -716,10 +869,10 @@ function SlideDeck({ slides, transition, directionalTransition }) {
716
869
  viewMode === "slide" && "bg-neutral-800 text-white"
717
870
  ),
718
871
  title: "Presentation View",
719
- children: /* @__PURE__ */ jsx7(Monitor, { className: "h-4 w-4" })
872
+ children: /* @__PURE__ */ jsx9(Monitor, { className: "h-4 w-4" })
720
873
  }
721
874
  ),
722
- /* @__PURE__ */ jsx7(
875
+ /* @__PURE__ */ jsx9(
723
876
  "button",
724
877
  {
725
878
  onClick: () => setViewMode("list"),
@@ -728,10 +881,10 @@ function SlideDeck({ slides, transition, directionalTransition }) {
728
881
  viewMode === "list" && "bg-neutral-800 text-white"
729
882
  ),
730
883
  title: "List View",
731
- children: /* @__PURE__ */ jsx7(List, { className: "h-4 w-4" })
884
+ children: /* @__PURE__ */ jsx9(List, { className: "h-4 w-4" })
732
885
  }
733
886
  ),
734
- /* @__PURE__ */ jsx7(
887
+ /* @__PURE__ */ jsx9(
735
888
  "button",
736
889
  {
737
890
  onClick: () => setViewMode("grid"),
@@ -740,26 +893,26 @@ function SlideDeck({ slides, transition, directionalTransition }) {
740
893
  viewMode === "grid" && "bg-neutral-800 text-white"
741
894
  ),
742
895
  title: "Grid View",
743
- children: /* @__PURE__ */ jsx7(Grid3X3, { className: "h-4 w-4" })
896
+ children: /* @__PURE__ */ jsx9(Grid3X3, { className: "h-4 w-4" })
744
897
  }
745
898
  ),
746
- /* @__PURE__ */ jsx7("div", { className: "mx-1 w-px bg-neutral-800" }),
747
- /* @__PURE__ */ jsx7(
899
+ /* @__PURE__ */ jsx9("div", { className: "mx-1 w-px bg-neutral-800" }),
900
+ /* @__PURE__ */ jsx9(
748
901
  "button",
749
902
  {
750
903
  onClick: handleExportPdf,
751
904
  className: "rounded-md p-2 text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-white",
752
905
  title: "Download PDF",
753
- children: /* @__PURE__ */ jsx7(Download, { className: "h-4 w-4" })
906
+ children: /* @__PURE__ */ jsx9(Download, { className: "h-4 w-4" })
754
907
  }
755
908
  ),
756
- /* @__PURE__ */ jsx7(
909
+ /* @__PURE__ */ jsx9(
757
910
  "button",
758
911
  {
759
912
  onClick: togglePresentationMode,
760
913
  className: "rounded-md p-2 text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-white",
761
914
  title: "Present (F)",
762
- children: /* @__PURE__ */ jsx7(Maximize, { className: "h-4 w-4" })
915
+ children: /* @__PURE__ */ jsx9(Maximize, { className: "h-4 w-4" })
763
916
  }
764
917
  )
765
918
  ]
@@ -780,7 +933,7 @@ function SlideDeck({ slides, transition, directionalTransition }) {
780
933
  if (e.key === "Enter" || e.key === " ") advance();
781
934
  } : void 0,
782
935
  children: [
783
- /* @__PURE__ */ jsx7(LayoutGroup, { id: "slide-deck", children: isPresentationMode ? /* @__PURE__ */ jsx7(
936
+ /* @__PURE__ */ jsx9(LayoutGroup, { id: "slide-deck", children: isPresentationMode ? /* @__PURE__ */ jsx9(
784
937
  "div",
785
938
  {
786
939
  className: "pointer-events-none relative overflow-hidden bg-black",
@@ -790,92 +943,42 @@ function SlideDeck({ slides, transition, directionalTransition }) {
790
943
  transform: `scale(${scale})`,
791
944
  transformOrigin: "center center"
792
945
  },
793
- children: /* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx7(
794
- motion3.div,
795
- {
796
- variants: slideVariants,
797
- initial: "enter",
798
- animate: "center",
799
- exit: "exit",
800
- transition: SLIDE_TRANSITION,
801
- onAnimationComplete: (definition) => {
802
- if (definition === "center") {
803
- onTransitionComplete();
804
- }
805
- },
806
- className: "absolute inset-0 h-full w-full",
807
- children: /* @__PURE__ */ jsx7(
808
- AnimationProvider,
809
- {
810
- currentStep: animationStep,
811
- totalSteps,
812
- showAllAnimations,
813
- children: /* @__PURE__ */ jsx7(
814
- SlideErrorBoundary,
815
- {
816
- slideIndex: currentSlide,
817
- slideTitle: slides[currentSlide]?.title,
818
- children: /* @__PURE__ */ jsx7(
819
- CurrentSlideComponent,
820
- {
821
- slideNumber: currentSlide + 1,
822
- totalSlides: slides.length
823
- }
824
- )
825
- }
826
- )
827
- }
828
- )
829
- },
830
- currentSlide
831
- ) })
832
- }
833
- ) : /* @__PURE__ */ jsx7("div", { className: "relative aspect-video w-full max-w-7xl overflow-hidden rounded-xl border border-neutral-800 bg-black shadow-2xl", children: /* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx7(
834
- motion3.div,
835
- {
836
- variants: slideVariants,
837
- initial: "enter",
838
- animate: "center",
839
- exit: "exit",
840
- transition: SLIDE_TRANSITION,
841
- onAnimationComplete: (definition) => {
842
- if (definition === "center") {
843
- onTransitionComplete();
844
- }
845
- },
846
- className: "absolute inset-0 h-full w-full",
847
- children: /* @__PURE__ */ jsx7(
848
- AnimationProvider,
946
+ children: /* @__PURE__ */ jsx9(
947
+ SlideRenderer,
849
948
  {
850
- currentStep: animationStep,
949
+ slides,
950
+ currentSlide,
951
+ animationStep,
851
952
  totalSteps,
953
+ direction,
852
954
  showAllAnimations,
853
- children: /* @__PURE__ */ jsx7(
854
- SlideErrorBoundary,
855
- {
856
- slideIndex: currentSlide,
857
- slideTitle: slides[currentSlide]?.title,
858
- children: /* @__PURE__ */ jsx7(
859
- CurrentSlideComponent,
860
- {
861
- slideNumber: currentSlide + 1,
862
- totalSlides: slides.length
863
- }
864
- )
865
- }
866
- )
955
+ transition,
956
+ directionalTransition,
957
+ onTransitionComplete
867
958
  }
868
959
  )
869
- },
870
- currentSlide
871
- ) }) }) }),
960
+ }
961
+ ) : /* @__PURE__ */ jsx9("div", { className: "relative aspect-video w-full max-w-7xl overflow-hidden rounded-xl border border-neutral-800 bg-black shadow-2xl", children: /* @__PURE__ */ jsx9(
962
+ SlideRenderer,
963
+ {
964
+ slides,
965
+ currentSlide,
966
+ animationStep,
967
+ totalSteps,
968
+ direction,
969
+ showAllAnimations,
970
+ transition,
971
+ directionalTransition,
972
+ onTransitionComplete
973
+ }
974
+ ) }) }),
872
975
  !isPresentationMode && /* @__PURE__ */ jsxs3("div", { className: "mt-6 flex items-center gap-4", children: [
873
- /* @__PURE__ */ jsx7(
976
+ /* @__PURE__ */ jsx9(
874
977
  "button",
875
978
  {
876
979
  onClick: goBack,
877
980
  className: "rounded-full border border-neutral-800 bg-black/50 p-2 text-neutral-400 backdrop-blur-sm transition-colors hover:bg-neutral-900 hover:text-white",
878
- children: /* @__PURE__ */ jsx7(ChevronLeft, { className: "h-5 w-5" })
981
+ children: /* @__PURE__ */ jsx9(ChevronLeft, { className: "h-5 w-5" })
879
982
  }
880
983
  ),
881
984
  /* @__PURE__ */ jsxs3("div", { className: "flex min-w-[4rem] flex-col items-center", children: [
@@ -884,26 +987,26 @@ function SlideDeck({ slides, transition, directionalTransition }) {
884
987
  " / ",
885
988
  slides.length
886
989
  ] }),
887
- slides[currentSlide]?.title && /* @__PURE__ */ jsx7("span", { className: "mt-0.5 text-xs text-neutral-600", children: slides[currentSlide].title })
990
+ slides[currentSlide]?.title && /* @__PURE__ */ jsx9("span", { className: "mt-0.5 text-xs text-neutral-600", children: slides[currentSlide].title })
888
991
  ] }),
889
- /* @__PURE__ */ jsx7(
992
+ /* @__PURE__ */ jsx9(
890
993
  "button",
891
994
  {
892
995
  onClick: advance,
893
996
  className: "rounded-full border border-neutral-800 bg-black/50 p-2 text-neutral-400 backdrop-blur-sm transition-colors hover:bg-neutral-900 hover:text-white",
894
- children: /* @__PURE__ */ jsx7(ChevronRight, { className: "h-5 w-5" })
997
+ children: /* @__PURE__ */ jsx9(ChevronRight, { className: "h-5 w-5" })
895
998
  }
896
999
  )
897
1000
  ] })
898
1001
  ]
899
1002
  }
900
1003
  ),
901
- viewMode === "grid" && /* @__PURE__ */ jsx7("div", { className: "mx-auto max-w-7xl p-8 pt-16 print:hidden", children: /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4", children: slides.map((slideConfig, index) => {
1004
+ viewMode === "grid" && /* @__PURE__ */ jsx9("div", { className: "mx-auto max-w-7xl p-8 pt-16 print:hidden", children: /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4", children: slides.map((slideConfig, index) => {
902
1005
  const SlideComponent = slideConfig.component;
903
1006
  const prevSection = index > 0 ? slides[index - 1]?.section : void 0;
904
1007
  const showSectionHeader = slideConfig.section && slideConfig.section !== prevSection;
905
1008
  return /* @__PURE__ */ jsxs3("div", { className: showSectionHeader ? "col-span-full" : void 0, children: [
906
- showSectionHeader && /* @__PURE__ */ jsx7("h3", { className: "mt-4 mb-3 text-xs font-bold tracking-[0.2em] text-neutral-500 uppercase first:mt-0", children: slideConfig.section }),
1009
+ showSectionHeader && /* @__PURE__ */ jsx9("h3", { className: "mt-4 mb-3 text-xs font-bold tracking-[0.2em] text-neutral-500 uppercase first:mt-0", children: slideConfig.section }),
907
1010
  /* @__PURE__ */ jsxs3(
908
1011
  "button",
909
1012
  {
@@ -913,22 +1016,30 @@ function SlideDeck({ slides, transition, directionalTransition }) {
913
1016
  },
914
1017
  className: "group relative aspect-video w-full overflow-hidden rounded-lg border border-neutral-800 bg-black shadow-sm transition-all hover:border-primary hover:shadow-lg hover:shadow-primary/10",
915
1018
  children: [
916
- /* @__PURE__ */ jsx7(
1019
+ /* @__PURE__ */ jsx9(
917
1020
  "div",
918
1021
  {
919
1022
  className: "h-full w-full origin-top-left scale-[0.25]",
920
1023
  style: { width: "400%", height: "400%" },
921
- children: /* @__PURE__ */ jsx7(SlideErrorBoundary, { slideIndex: index, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx7(SlideComponent, { slideNumber: index + 1, totalSlides: slides.length }) })
1024
+ children: /* @__PURE__ */ jsx9(
1025
+ AnimationProvider,
1026
+ {
1027
+ currentStep: slideConfig.steps,
1028
+ totalSteps: slideConfig.steps,
1029
+ showAllAnimations: true,
1030
+ children: /* @__PURE__ */ jsx9(SlideErrorBoundary, { slideIndex: index, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx9(SlideComponent, { slideNumber: index + 1, totalSlides: slides.length }) })
1031
+ }
1032
+ )
922
1033
  }
923
1034
  ),
924
- /* @__PURE__ */ jsx7("div", { className: "absolute inset-0 bg-black/0 transition-colors group-hover:bg-black/20" }),
925
- /* @__PURE__ */ jsx7("div", { className: "absolute bottom-2 left-2 rounded bg-black/70 px-2 py-1 text-xs font-medium text-white", children: slideConfig.title ? `${index + 1}. ${slideConfig.title}` : index + 1 })
1035
+ /* @__PURE__ */ jsx9("div", { className: "absolute inset-0 bg-black/0 transition-colors group-hover:bg-black/20" }),
1036
+ /* @__PURE__ */ jsx9("div", { className: "absolute bottom-2 left-2 rounded bg-black/70 px-2 py-1 text-xs font-medium text-white", children: slideConfig.title ? `${index + 1}. ${slideConfig.title}` : index + 1 })
926
1037
  ]
927
1038
  }
928
1039
  )
929
1040
  ] }, index);
930
1041
  }) }) }),
931
- /* @__PURE__ */ jsx7(
1042
+ /* @__PURE__ */ jsx9(
932
1043
  "div",
933
1044
  {
934
1045
  className: cn(
@@ -936,19 +1047,19 @@ function SlideDeck({ slides, transition, directionalTransition }) {
936
1047
  "print:m-0 print:block print:max-w-none print:p-0",
937
1048
  viewMode === "list" ? "block" : "hidden print:block"
938
1049
  ),
939
- children: /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-8 print:block", children: slides.map((slideConfig, index) => {
1050
+ children: /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-1 gap-8 print:block", children: slides.map((slideConfig, index) => {
940
1051
  const SlideComponent = slideConfig.component;
941
- return /* @__PURE__ */ jsx7(
1052
+ return /* @__PURE__ */ jsx9(
942
1053
  "div",
943
1054
  {
944
1055
  className: "aspect-video w-full overflow-hidden rounded-xl border border-neutral-800 bg-black shadow-sm print:relative print:m-0 print:h-[1080px] print:w-[1920px] print:break-after-page print:overflow-hidden print:rounded-none print:border-0 print:shadow-none",
945
- children: /* @__PURE__ */ jsx7("div", { className: "h-full w-full print:h-[720px] print:w-[1280px] print:origin-top-left print:scale-[1.5]", children: /* @__PURE__ */ jsx7(
1056
+ children: /* @__PURE__ */ jsx9("div", { className: "h-full w-full print:h-[720px] print:w-[1280px] print:origin-top-left print:scale-[1.5]", children: /* @__PURE__ */ jsx9(
946
1057
  AnimationProvider,
947
1058
  {
948
1059
  currentStep: slideConfig.steps,
949
1060
  totalSteps: slideConfig.steps,
950
1061
  showAllAnimations: true,
951
- children: /* @__PURE__ */ jsx7(SlideErrorBoundary, { slideIndex: index, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx7(SlideComponent, { slideNumber: index + 1, totalSlides: slides.length }) })
1062
+ children: /* @__PURE__ */ jsx9(SlideErrorBoundary, { slideIndex: index, slideTitle: slideConfig.title, children: /* @__PURE__ */ jsx9(SlideComponent, { slideNumber: index + 1, totalSlides: slides.length }) })
952
1063
  }
953
1064
  ) })
954
1065
  },
@@ -987,8 +1098,10 @@ export {
987
1098
  STEP_ANIMATION_DURATION,
988
1099
  STEP_TRANSITION,
989
1100
  SlideDeck,
1101
+ SlideEmbed,
990
1102
  SlideErrorBoundary,
991
1103
  SlideFooter,
1104
+ SlideRenderer,
992
1105
  SlideThemeProvider,
993
1106
  cn,
994
1107
  createDirectionalVariants,