@particle-academy/fancy-slides 0.1.7 → 0.3.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout, g as SlideBackground } from './types-Bc-psiRF.cjs';
4
- export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, j as SlideTransition, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-Bc-psiRF.cjs';
3
+ import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, j as SlideTransition, g as SlideBackground, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout } from './types-B2ecrEAz.cjs';
4
+ export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-B2ecrEAz.cjs';
5
5
 
6
6
  interface SlideProps {
7
7
  /** The slide to render. */
@@ -279,7 +279,7 @@ interface EditorToolbarProps {
279
279
  declare function EditorToolbar({ title, onTitleChange, themeName, onApplyTheme, onInsertText, onInsertImage, onInsertShape, onInsertChart, onInsertCode, onInsertTable, onPresent, disabled, }: EditorToolbarProps): react_jsx_runtime.JSX.Element;
280
280
 
281
281
  interface ElementInspectorProps {
282
- /** Element being inspected. `null` shows the empty state. */
282
+ /** Element being inspected. `null` falls back to slide settings (or the empty state). */
283
283
  element: SlideElement | null;
284
284
  /** Patch a property on the element. */
285
285
  onPatch: (patch: Partial<SlideElement>) => void;
@@ -287,6 +287,12 @@ interface ElementInspectorProps {
287
287
  onDelete?: () => void;
288
288
  /** Lock toggle. */
289
289
  onLockToggle?: (locked: boolean) => void;
290
+ /** Selected slide — shown when no element is selected so the user can edit slide-level settings. */
291
+ slide?: Slide$1 | null;
292
+ /** Set the slide's entrance transition. */
293
+ onSetTransition?: (transition?: SlideTransition) => void;
294
+ /** Set the slide's background. */
295
+ onSetBackground?: (background?: SlideBackground) => void;
290
296
  }
291
297
  /**
292
298
  * Right-hand inspector. Tabs split position + style + advanced properties.
@@ -294,7 +300,7 @@ interface ElementInspectorProps {
294
300
  * react-fancy `Card`, `Tabs`, `Input`, `Select`, `Slider`, `ColorPicker`,
295
301
  * `Action`.
296
302
  */
297
- declare function ElementInspector({ element, onPatch, onDelete, onLockToggle }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
303
+ declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
298
304
 
299
305
  interface SpeakerNotesProps {
300
306
  notes?: string;
@@ -343,6 +349,14 @@ declare function TextElementRenderer({ element, theme, slideWidthPx, editing, se
343
349
  interface ImageElementRendererProps {
344
350
  element: ImageElement;
345
351
  }
352
+ /**
353
+ * Renders an image element. When `element.crop` is set (a window in
354
+ * image-relative 0..1 coords `{x,y,w,h}`), the image is shown cropped to that
355
+ * window: an `overflow:hidden` box clips an inner `<img>` that's been scaled up
356
+ * by `1/w` × `1/h` and offset so the crop window exactly fills the box. Without
357
+ * a crop it's the plain `object-fit` image. The same renderer feeds both the
358
+ * editor canvas and the viewer, so a crop is visible everywhere.
359
+ */
346
360
  declare function ImageElementRenderer({ element }: ImageElementRendererProps): react_jsx_runtime.JSX.Element;
347
361
 
348
362
  interface ShapeElementRendererProps {
@@ -413,6 +427,7 @@ interface DeckStateApi {
413
427
  setLayout: (id: string, layout: SlideLayout) => void;
414
428
  setNotes: (id: string, notes: string) => void;
415
429
  setBackground: (id: string, bg?: SlideBackground) => void;
430
+ setTransition: (id: string, transition?: SlideTransition) => void;
416
431
  /** Element-level helpers. */
417
432
  addElement: (slideId: string, element: Omit<SlideElement, "id"> & {
418
433
  id?: string;
@@ -481,4 +496,4 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
481
496
  type Option = Record<string, unknown>;
482
497
  declare function chartStarterOption(kind: ChartKind): Option;
483
498
 
484
- export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };
499
+ export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout, g as SlideBackground } from './types-Bc-psiRF.js';
4
- export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, j as SlideTransition, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-Bc-psiRF.js';
3
+ import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, j as SlideTransition, g as SlideBackground, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout } from './types-B2ecrEAz.js';
4
+ export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-B2ecrEAz.js';
5
5
 
6
6
  interface SlideProps {
7
7
  /** The slide to render. */
@@ -279,7 +279,7 @@ interface EditorToolbarProps {
279
279
  declare function EditorToolbar({ title, onTitleChange, themeName, onApplyTheme, onInsertText, onInsertImage, onInsertShape, onInsertChart, onInsertCode, onInsertTable, onPresent, disabled, }: EditorToolbarProps): react_jsx_runtime.JSX.Element;
280
280
 
281
281
  interface ElementInspectorProps {
282
- /** Element being inspected. `null` shows the empty state. */
282
+ /** Element being inspected. `null` falls back to slide settings (or the empty state). */
283
283
  element: SlideElement | null;
284
284
  /** Patch a property on the element. */
285
285
  onPatch: (patch: Partial<SlideElement>) => void;
@@ -287,6 +287,12 @@ interface ElementInspectorProps {
287
287
  onDelete?: () => void;
288
288
  /** Lock toggle. */
289
289
  onLockToggle?: (locked: boolean) => void;
290
+ /** Selected slide — shown when no element is selected so the user can edit slide-level settings. */
291
+ slide?: Slide$1 | null;
292
+ /** Set the slide's entrance transition. */
293
+ onSetTransition?: (transition?: SlideTransition) => void;
294
+ /** Set the slide's background. */
295
+ onSetBackground?: (background?: SlideBackground) => void;
290
296
  }
291
297
  /**
292
298
  * Right-hand inspector. Tabs split position + style + advanced properties.
@@ -294,7 +300,7 @@ interface ElementInspectorProps {
294
300
  * react-fancy `Card`, `Tabs`, `Input`, `Select`, `Slider`, `ColorPicker`,
295
301
  * `Action`.
296
302
  */
297
- declare function ElementInspector({ element, onPatch, onDelete, onLockToggle }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
303
+ declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
298
304
 
299
305
  interface SpeakerNotesProps {
300
306
  notes?: string;
@@ -343,6 +349,14 @@ declare function TextElementRenderer({ element, theme, slideWidthPx, editing, se
343
349
  interface ImageElementRendererProps {
344
350
  element: ImageElement;
345
351
  }
352
+ /**
353
+ * Renders an image element. When `element.crop` is set (a window in
354
+ * image-relative 0..1 coords `{x,y,w,h}`), the image is shown cropped to that
355
+ * window: an `overflow:hidden` box clips an inner `<img>` that's been scaled up
356
+ * by `1/w` × `1/h` and offset so the crop window exactly fills the box. Without
357
+ * a crop it's the plain `object-fit` image. The same renderer feeds both the
358
+ * editor canvas and the viewer, so a crop is visible everywhere.
359
+ */
346
360
  declare function ImageElementRenderer({ element }: ImageElementRendererProps): react_jsx_runtime.JSX.Element;
347
361
 
348
362
  interface ShapeElementRendererProps {
@@ -413,6 +427,7 @@ interface DeckStateApi {
413
427
  setLayout: (id: string, layout: SlideLayout) => void;
414
428
  setNotes: (id: string, notes: string) => void;
415
429
  setBackground: (id: string, bg?: SlideBackground) => void;
430
+ setTransition: (id: string, transition?: SlideTransition) => void;
416
431
  /** Element-level helpers. */
417
432
  addElement: (slideId: string, element: Omit<SlideElement, "id"> & {
418
433
  id?: string;
@@ -481,4 +496,4 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
481
496
  type Option = Record<string, unknown>;
482
497
  declare function chartStarterOption(kind: ChartKind): Option;
483
498
 
484
- export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };
499
+ export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };