@gpichot/spectacle-deck 1.13.0 → 1.14.0
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/components/FilePane.d.ts +1 -1
- package/components/map.d.ts +1 -19
- package/components/styled.d.ts +6 -7
- package/engine/CommandPalette.d.ts +10 -0
- package/engine/Deck.d.ts +30 -0
- package/engine/DeckContext.d.ts +36 -0
- package/engine/ExportMode.d.ts +7 -0
- package/engine/Morph.d.ts +51 -0
- package/engine/OverviewMode.d.ts +6 -0
- package/engine/SectionTitle.d.ts +18 -0
- package/engine/Stepper.d.ts +28 -0
- package/engine/Template.d.ts +11 -0
- package/engine/dom-helpers.d.ts +8 -0
- package/engine/global.css.d.ts +11 -0
- package/engine/index.d.ts +19 -0
- package/engine/transitions.d.ts +35 -0
- package/engine/useKeyboard.d.ts +7 -0
- package/engine/useNavigation.d.ts +25 -0
- package/index.cjs +3313 -2249
- package/index.css +411 -0
- package/index.d.ts +4 -54
- package/index.mjs +3320 -2265
- package/layouts/SectionLayout.d.ts +4 -1
- package/layouts/index.d.ts +3 -1
- package/layouts/styled.d.ts +1 -1
- package/package.json +5 -7
- package/RemoteControllerShortcut.d.ts +0 -6
- package/SkipStepsShortcut.d.ts +0 -5
- package/components/Timeline.styled.d.ts +0 -4
- package/template.d.ts +0 -4
- package/transitions.d.ts +0 -14
package/components/FilePane.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare function FilePane({ name, children, priority, minWidth, ...divProps }: R
|
|
|
3
3
|
name: string;
|
|
4
4
|
priority?: number;
|
|
5
5
|
minWidth?: string;
|
|
6
|
-
}): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode
|
|
6
|
+
}): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>>;
|
|
7
7
|
declare namespace FilePane {
|
|
8
8
|
var mdxType: string;
|
|
9
9
|
}
|
package/components/map.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { Image } from "./styled";
|
|
4
|
-
declare const componentsMap: {
|
|
5
|
-
readonly inlineCode: (props: React.ComponentPropsWithoutRef<"code">) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
readonly table: (props: React.ComponentPropsWithoutRef<"table">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
readonly tr: (props: React.ComponentPropsWithoutRef<"tr">) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
readonly td: (props: React.ComponentPropsWithoutRef<"td">) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
readonly h1: (props: React.ComponentProps<"h1">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
readonly h2: (props: React.ComponentProps<"h2">) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
readonly h3: (props: React.ComponentPropsWithoutRef<"h3">) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
readonly img: (props: React.ComponentProps<typeof Image>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
readonly pre: typeof CodeStepper;
|
|
14
|
-
readonly li: (props: React.ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
readonly Side: (props: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
readonly p: (props: React.ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
readonly blockquote: (props: React.ComponentProps<"blockquote">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
readonly a: ({ children, ...props }: React.ComponentProps<"a">) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
readonly directive: (props: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
};
|
|
2
|
+
declare const componentsMap: Record<string, React.ComponentType<any>>;
|
|
21
3
|
export default componentsMap;
|
package/components/styled.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import { Image as SpectacleImage } from "spectacle";
|
|
3
2
|
export declare const Link: (props: {
|
|
4
3
|
href: string;
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const Image: (props: React.ComponentProps<
|
|
8
|
-
export declare const CustomHeading:
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
6
|
+
export declare const Image: (props: React.ComponentProps<"img">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const CustomHeading: (props: React.ComponentProps<"h1">) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const HeadingTwo: (props: React.ComponentProps<"h2">) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const HeadingThree: (props: React.ComponentProps<"h3">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const CustomQuote: (props: React.ComponentProps<"blockquote">) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const InlineCode: (props: React.ComponentProps<"code">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Command {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
shortcut?: string;
|
|
5
|
+
action: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function CommandPalette({ commands, onClose, }: {
|
|
8
|
+
commands: Command[];
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/engine/Deck.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type LayoutComponent } from "../context";
|
|
3
|
+
export type SlideType = {
|
|
4
|
+
metadata: Record<string, unknown> & {
|
|
5
|
+
layout?: string;
|
|
6
|
+
transition?: string;
|
|
7
|
+
};
|
|
8
|
+
slideComponent: React.ElementType<unknown>;
|
|
9
|
+
};
|
|
10
|
+
export type DeckType = {
|
|
11
|
+
metadata: Record<string, unknown>;
|
|
12
|
+
slides: SlideType[];
|
|
13
|
+
};
|
|
14
|
+
interface ThemeOptions {
|
|
15
|
+
themeTokens: {
|
|
16
|
+
colors: Record<string, string>;
|
|
17
|
+
fonts?: {
|
|
18
|
+
header?: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function Deck({ deck, theme, layouts, transition, }: {
|
|
24
|
+
deck: DeckType;
|
|
25
|
+
theme: ThemeOptions;
|
|
26
|
+
layouts?: Record<string, LayoutComponent>;
|
|
27
|
+
/** Default slide transition name: "fade", "slide", "drop", "morph", "none" */
|
|
28
|
+
transition?: string;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DeckState {
|
|
3
|
+
/** Current slide index (0-based) */
|
|
4
|
+
slideIndex: number;
|
|
5
|
+
/** Current step index within the slide (0-based, 0 = no steps revealed) */
|
|
6
|
+
stepIndex: number;
|
|
7
|
+
/** Total number of slides */
|
|
8
|
+
slideCount: number;
|
|
9
|
+
/** Total steps for the current slide (registered by Stepper components) */
|
|
10
|
+
stepCount: number;
|
|
11
|
+
/** Navigate to the next step or slide */
|
|
12
|
+
stepForward: () => void;
|
|
13
|
+
/** Navigate to the previous step or slide */
|
|
14
|
+
stepBackward: () => void;
|
|
15
|
+
/** Jump to a specific slide (optionally a specific step) */
|
|
16
|
+
skipTo: (target: {
|
|
17
|
+
slideIndex: number;
|
|
18
|
+
stepIndex?: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
/** Direction of the last navigation ("forward" | "backward") */
|
|
21
|
+
direction: "forward" | "backward";
|
|
22
|
+
/** Theme colors and fonts */
|
|
23
|
+
theme: {
|
|
24
|
+
colors: Record<string, string>;
|
|
25
|
+
fonts?: {
|
|
26
|
+
header?: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** Register steps for a Stepper component within the current slide */
|
|
31
|
+
registerStepper: (id: string, count: number) => void;
|
|
32
|
+
/** Unregister a Stepper (on unmount) */
|
|
33
|
+
unregisterStepper: (id: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const DeckContext: React.Context<DeckState>;
|
|
36
|
+
export declare function useDeck(): DeckState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SlideType } from "./Deck";
|
|
2
|
+
export type ExportModeVariant = "export" | "print";
|
|
3
|
+
export declare function ExportMode({ slides, variant, onClose, }: {
|
|
4
|
+
slides: SlideType[];
|
|
5
|
+
variant: ExportModeVariant;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface MorphProps {
|
|
3
|
+
/**
|
|
4
|
+
* A unique name for this morphable element. Elements with the same `name`
|
|
5
|
+
* on different slides will morph (animate position, size, shape) during
|
|
6
|
+
* view transitions.
|
|
7
|
+
*
|
|
8
|
+
* Uses React's <ViewTransition> component which coordinates with the
|
|
9
|
+
* browser's View Transitions API automatically via startTransition.
|
|
10
|
+
* Names must be unique within a single slide.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/** HTML tag to render. Defaults to "div". */
|
|
14
|
+
as?: keyof React.JSX.IntrinsicElements;
|
|
15
|
+
/** Additional inline styles */
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
/** Additional CSS class */
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Morph — marks an element for cross-slide morphing via React ViewTransition.
|
|
23
|
+
*
|
|
24
|
+
* Usage in MDX:
|
|
25
|
+
* ```mdx
|
|
26
|
+
* <Morph name="title">
|
|
27
|
+
* # My Title
|
|
28
|
+
* </Morph>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* On the next slide, use the same name:
|
|
32
|
+
* ```mdx
|
|
33
|
+
* <Morph name="title" style={{ fontSize: "0.5em" }}>
|
|
34
|
+
* # My Title
|
|
35
|
+
* </Morph>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* The browser will automatically animate the element's position, size,
|
|
39
|
+
* and visual properties between the two slides.
|
|
40
|
+
*/
|
|
41
|
+
export declare function Morph({ name, as: Tag, style, className, children, }: MorphProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* MorphImage — a convenience wrapper for images that should morph between slides.
|
|
44
|
+
*/
|
|
45
|
+
export declare function MorphImage({ name, src, alt, style, className, }: {
|
|
46
|
+
name: string;
|
|
47
|
+
src: string;
|
|
48
|
+
alt?: string;
|
|
49
|
+
style?: React.CSSProperties;
|
|
50
|
+
className?: string;
|
|
51
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Displays the current section title as a sticky header at the top of the slide.
|
|
3
|
+
*
|
|
4
|
+
* The section title is derived from the `section` frontmatter field.
|
|
5
|
+
* Once set on a slide, it persists on subsequent slides until changed or
|
|
6
|
+
* explicitly cleared (by setting `section: ""` or `section: false`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function SectionTitle({ title }: {
|
|
9
|
+
title: string;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Compute the current section title for a given slide index.
|
|
13
|
+
* Walks backward through slides to find the most recent `section` frontmatter.
|
|
14
|
+
* A falsy value (empty string, false) explicitly clears the section.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getCurrentSection(slides: {
|
|
17
|
+
metadata: Record<string, unknown>;
|
|
18
|
+
}[], slideIndex: number): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface StepperProps<T = unknown> {
|
|
3
|
+
/** Array of values to step through */
|
|
4
|
+
values: T[];
|
|
5
|
+
/** Render function: (currentValue, stepIndex, isActive) => ReactNode */
|
|
6
|
+
children: (value: T | null, step: number, isActive: boolean) => React.ReactNode;
|
|
7
|
+
/** If true, render even when no step is active (step = -1) */
|
|
8
|
+
alwaysVisible?: boolean;
|
|
9
|
+
/** Priority for ordering multiple steppers (not yet used, reserved) */
|
|
10
|
+
priority?: number;
|
|
11
|
+
/** Style applied when the stepper is active (compat with Spectacle API) */
|
|
12
|
+
activeStyle?: React.CSSProperties;
|
|
13
|
+
/** Style applied when the stepper is inactive (compat with Spectacle API) */
|
|
14
|
+
inactiveStyle?: React.CSSProperties;
|
|
15
|
+
/** Additional props spread onto the wrapper (e.g. from Timeline) */
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Stepper component — replaces Spectacle's Stepper.
|
|
20
|
+
*
|
|
21
|
+
* Registers its step count with the deck and renders children
|
|
22
|
+
* based on the current step index. Steps are 0-indexed in the deck,
|
|
23
|
+
* but the stepper maps them to values.
|
|
24
|
+
*
|
|
25
|
+
* Step 0 in the deck = "no step active" (renders with alwaysVisible).
|
|
26
|
+
* Step 1..N = values[0]..values[N-1].
|
|
27
|
+
*/
|
|
28
|
+
export declare function Stepper<T>({ values, children, alwaysVisible, priority: _priority, activeStyle, inactiveStyle, ...rest }: StepperProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slide template overlay: progress bar + fullscreen button + controls.
|
|
3
|
+
* Pure HTML/CSS — no Spectacle dependency.
|
|
4
|
+
*/
|
|
5
|
+
export declare function Template({ slideNumber, numberOfSlides, onToggleExport, onTogglePrint, onToggleCommandPalette, }: {
|
|
6
|
+
slideNumber: number;
|
|
7
|
+
numberOfSlides: number;
|
|
8
|
+
onToggleExport?: () => void;
|
|
9
|
+
onTogglePrint?: () => void;
|
|
10
|
+
onToggleCommandPalette?: () => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injects global CSS (theme variables, base styles) into the document.
|
|
3
|
+
* Replaces styled-components' createGlobalStyle.
|
|
4
|
+
*/
|
|
5
|
+
export declare function injectGlobalStyles(options: {
|
|
6
|
+
cssVariables: string;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
fontSize: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
color: string;
|
|
11
|
+
}): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type { Command } from "./CommandPalette";
|
|
2
|
+
export { CommandPalette } from "./CommandPalette";
|
|
3
|
+
export type { DeckType, SlideType } from "./Deck";
|
|
4
|
+
export { Deck } from "./Deck";
|
|
5
|
+
export type { DeckState } from "./DeckContext";
|
|
6
|
+
export { DeckContext, useDeck } from "./DeckContext";
|
|
7
|
+
export type { ExportModeVariant } from "./ExportMode";
|
|
8
|
+
export { ExportMode } from "./ExportMode";
|
|
9
|
+
export type { MorphProps } from "./Morph";
|
|
10
|
+
export { Morph, MorphImage } from "./Morph";
|
|
11
|
+
export { OverviewMode } from "./OverviewMode";
|
|
12
|
+
export { getCurrentSection, SectionTitle } from "./SectionTitle";
|
|
13
|
+
export type { StepperProps } from "./Stepper";
|
|
14
|
+
export { Stepper } from "./Stepper";
|
|
15
|
+
export { Template } from "./Template";
|
|
16
|
+
export type { SlideTransition } from "./transitions";
|
|
17
|
+
export { dropTransition, fadeTransition, morphTransition, noneTransition, resolveTransition, slideTransition, } from "./transitions";
|
|
18
|
+
export { useKeyboard } from "./useKeyboard";
|
|
19
|
+
export { useNavigation } from "./useNavigation";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS-based slide transition definitions for the View Transitions API.
|
|
3
|
+
*
|
|
4
|
+
* Each transition defines keyframes for `::view-transition-old(slide)`
|
|
5
|
+
* and `::view-transition-new(slide)` pseudo-elements.
|
|
6
|
+
*
|
|
7
|
+
* The View Transitions API captures the old DOM as an image, updates
|
|
8
|
+
* the DOM, then animates from old to new using these keyframes.
|
|
9
|
+
*/
|
|
10
|
+
export interface SlideTransition {
|
|
11
|
+
/** A unique name for this transition */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Duration in ms */
|
|
14
|
+
duration?: number;
|
|
15
|
+
/** CSS easing function */
|
|
16
|
+
easing?: string;
|
|
17
|
+
/** CSS for the old slide (exiting) — a CSS keyframes body */
|
|
18
|
+
oldKeyframes: Keyframe[];
|
|
19
|
+
/** CSS for the new slide (entering) — a CSS keyframes body */
|
|
20
|
+
newKeyframes: Keyframe[];
|
|
21
|
+
}
|
|
22
|
+
export declare const fadeTransition: SlideTransition;
|
|
23
|
+
export declare const slideTransition: SlideTransition;
|
|
24
|
+
export declare const dropTransition: SlideTransition;
|
|
25
|
+
export declare const noneTransition: SlideTransition;
|
|
26
|
+
export declare const morphTransition: SlideTransition;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a transition name string to a SlideTransition object.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveTransition(name: string | undefined): SlideTransition | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Inject a <style> element with view transition keyframes into the document.
|
|
33
|
+
* Called once when the Deck mounts.
|
|
34
|
+
*/
|
|
35
|
+
export declare function injectTransitionStyles(transition: SlideTransition, direction: "forward" | "backward"): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type KeyBindings = Record<string, () => void>;
|
|
2
|
+
/**
|
|
3
|
+
* Simple keyboard shortcut hook. Replaces Spectacle's useMousetrap.
|
|
4
|
+
* Supports key names like "ArrowRight", "Shift+ArrowRight", "PageUp", etc.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useKeyboard(bindings: KeyBindings): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface NavigationOptions {
|
|
2
|
+
slideCount: number;
|
|
3
|
+
onSlideChange?: (index: number, direction: "forward" | "backward") => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Core navigation state machine for the deck.
|
|
7
|
+
* Manages slide index, step index, and step registration.
|
|
8
|
+
* Uses React.startTransition so that <ViewTransition> components
|
|
9
|
+
* automatically animate during slide and step changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useNavigation({ slideCount, onSlideChange, }: NavigationOptions): {
|
|
12
|
+
slideIndex: number;
|
|
13
|
+
stepIndex: number;
|
|
14
|
+
stepCount: number;
|
|
15
|
+
direction: "forward" | "backward";
|
|
16
|
+
stepForward: () => void;
|
|
17
|
+
stepBackward: () => void;
|
|
18
|
+
skipTo: (target: {
|
|
19
|
+
slideIndex: number;
|
|
20
|
+
stepIndex?: number;
|
|
21
|
+
}) => void;
|
|
22
|
+
registerStepper: (id: string, count: number) => void;
|
|
23
|
+
unregisterStepper: (id: string) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|