@starrykit/slides-editor 0.1.26

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.
Files changed (80) hide show
  1. package/dist/components/block-manipulation-overlay.d.ts +36 -0
  2. package/dist/components/color-picker.d.ts +10 -0
  3. package/dist/components/context-menu.d.ts +26 -0
  4. package/dist/components/editor-header.d.ts +19 -0
  5. package/dist/components/editor-workspace.d.ts +88 -0
  6. package/dist/components/floating-toolbar-attribute-dialog.d.ts +9 -0
  7. package/dist/components/floating-toolbar-feature.d.ts +8 -0
  8. package/dist/components/floating-toolbar-fields.d.ts +37 -0
  9. package/dist/components/floating-toolbar-parts.d.ts +47 -0
  10. package/dist/components/floating-toolbar-popovers.d.ts +44 -0
  11. package/dist/components/floating-toolbar-sections.d.ts +19 -0
  12. package/dist/components/floating-toolbar-types.d.ts +41 -0
  13. package/dist/components/floating-toolbar.d.ts +4 -0
  14. package/dist/components/image-crop-overlay.d.ts +9 -0
  15. package/dist/components/presenter-view.d.ts +14 -0
  16. package/dist/components/slide-sidebar.d.ts +20 -0
  17. package/dist/components/stage-canvas.d.ts +88 -0
  18. package/dist/components/ui/accordion.d.ts +7 -0
  19. package/dist/components/ui/button.d.ts +13 -0
  20. package/dist/components/ui/context-menu.d.ts +25 -0
  21. package/dist/components/ui/dialog.d.ts +10 -0
  22. package/dist/components/ui/input.d.ts +3 -0
  23. package/dist/components/ui/popover.d.ts +10 -0
  24. package/dist/components/ui/scroll-area.d.ts +5 -0
  25. package/dist/components/ui/select.d.ts +15 -0
  26. package/dist/components/ui/separator.d.ts +4 -0
  27. package/dist/components/ui/tabs.d.ts +11 -0
  28. package/dist/components/ui/textarea.d.ts +3 -0
  29. package/dist/components/ui/toggle-group.d.ts +9 -0
  30. package/dist/components/ui/toggle.d.ts +9 -0
  31. package/dist/components/ui/tooltip.d.ts +7 -0
  32. package/dist/editor-operations.d.ts +17 -0
  33. package/dist/hooks/block-manipulation-geometry.d.ts +27 -0
  34. package/dist/hooks/block-manipulation-operations.d.ts +10 -0
  35. package/dist/hooks/block-manipulation-overlay.d.ts +12 -0
  36. package/dist/hooks/block-manipulation-types.d.ts +81 -0
  37. package/dist/hooks/editor-keyboard-geometry.d.ts +22 -0
  38. package/dist/hooks/editor-keyboard-operations.d.ts +11 -0
  39. package/dist/hooks/editor-keyboard-types.d.ts +38 -0
  40. package/dist/hooks/iframe-active-text-session.d.ts +12 -0
  41. package/dist/hooks/iframe-editing-session.d.ts +10 -0
  42. package/dist/hooks/iframe-text-document-events.d.ts +26 -0
  43. package/dist/hooks/iframe-text-editing-dom.d.ts +12 -0
  44. package/dist/hooks/iframe-text-editing-types.d.ts +38 -0
  45. package/dist/hooks/object-clipboard-commands.d.ts +28 -0
  46. package/dist/hooks/use-block-manipulation.d.ts +3 -0
  47. package/dist/hooks/use-editor-element-actions.d.ts +42 -0
  48. package/dist/hooks/use-editor-keyboard-shortcuts.d.ts +3 -0
  49. package/dist/hooks/use-editor-slide-actions.d.ts +21 -0
  50. package/dist/hooks/use-iframe-text-editing.d.ts +3 -0
  51. package/dist/hooks/use-image-crop.d.ts +40 -0
  52. package/dist/hooks/use-marquee-selection.d.ts +17 -0
  53. package/dist/hooks/use-selection-overlay-actions.d.ts +41 -0
  54. package/dist/hooks/use-slide-history.d.ts +17 -0
  55. package/dist/hooks/use-slide-inspector.d.ts +24 -0
  56. package/dist/hooks/use-slide-thumbnails.d.ts +2 -0
  57. package/dist/hooks/use-stage-viewport.d.ts +13 -0
  58. package/dist/index.d.ts +14 -0
  59. package/dist/index.js +11508 -0
  60. package/dist/lib/block-snap-constants.d.ts +8 -0
  61. package/dist/lib/block-snap-guides.d.ts +6 -0
  62. package/dist/lib/block-snap-targets.d.ts +13 -0
  63. package/dist/lib/block-snap-types.d.ts +32 -0
  64. package/dist/lib/block-snapping.d.ts +17 -0
  65. package/dist/lib/collect-css-properties.d.ts +5 -0
  66. package/dist/lib/editor-selection-operations.d.ts +58 -0
  67. package/dist/lib/editor-selection-structure.d.ts +7 -0
  68. package/dist/lib/element-tool-commit.d.ts +17 -0
  69. package/dist/lib/element-tool-model.d.ts +17 -0
  70. package/dist/lib/element-tool-types.d.ts +35 -0
  71. package/dist/lib/element-tool-values.d.ts +22 -0
  72. package/dist/lib/image-crop.d.ts +24 -0
  73. package/dist/lib/motion.d.ts +8 -0
  74. package/dist/lib/selection-overlay.d.ts +4 -0
  75. package/dist/lib/style-controls.d.ts +17 -0
  76. package/dist/lib/thumbnail-renderer.d.ts +2 -0
  77. package/dist/lib/utils.d.ts +3 -0
  78. package/dist/logo-starry-slides-6GYA6NPA.png +0 -0
  79. package/package.json +38 -0
  80. package/src/styles/index.css +88 -0
@@ -0,0 +1,36 @@
1
+ import type { MouseEvent as ReactMouseEvent } from "react";
2
+ import type { ResizeHandleCorner, ResizeHandlePosition } from "../lib/block-snap-types";
3
+ interface Point {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ interface Rect {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ interface SnapGuide {
14
+ orientation: "vertical" | "horizontal";
15
+ start: Point;
16
+ end: Point;
17
+ variant: "alignment" | "spacing";
18
+ }
19
+ interface BlockManipulationOverlayProps {
20
+ selectionBounds: Rect;
21
+ snapGuides: SnapGuide[];
22
+ resizeHandles: Array<{
23
+ position: ResizeHandlePosition;
24
+ x: number;
25
+ y: number;
26
+ }>;
27
+ rotationZones: Array<{
28
+ corner: ResizeHandleCorner;
29
+ x: number;
30
+ y: number;
31
+ }>;
32
+ onResizeHandleMouseDown: (position: ResizeHandlePosition, event: ReactMouseEvent<HTMLButtonElement>) => void;
33
+ onCornerRotationZoneMouseDown: (event: ReactMouseEvent<HTMLButtonElement>) => void;
34
+ }
35
+ declare function BlockManipulationOverlay({ selectionBounds: _selectionBounds, snapGuides, resizeHandles, rotationZones, onResizeHandleMouseDown, onCornerRotationZoneMouseDown, }: BlockManipulationOverlayProps): import("react/jsx-runtime").JSX.Element;
36
+ export { BlockManipulationOverlay };
@@ -0,0 +1,10 @@
1
+ interface ColorPickerProps {
2
+ ariaLabelPrefix?: string;
3
+ value: string;
4
+ includeGradients?: boolean;
5
+ includeOpacity?: boolean;
6
+ onChange: (value: string) => void;
7
+ onCommit?: () => void;
8
+ }
9
+ declare function ColorPicker({ ariaLabelPrefix, value, includeGradients, includeOpacity, onChange, onCommit, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
10
+ export { ColorPicker };
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from "react";
2
+ import type { SelectionCommandAvailability } from "./floating-toolbar";
3
+ interface SelectionContextMenuProps {
4
+ children: ReactNode;
5
+ selectionCommandAvailability: SelectionCommandAvailability;
6
+ onAlignToSlide: (action: string) => void;
7
+ onDelete: () => void;
8
+ onDistribute: (action: string) => void;
9
+ onDuplicate: () => void;
10
+ onGroup: () => void;
11
+ onLayerOrder: (action: string) => void;
12
+ onUngroup: () => void;
13
+ }
14
+ interface SelectionContextMenuContentProps {
15
+ selectionCommandAvailability: SelectionCommandAvailability;
16
+ onAlignToSlide: (action: string) => void;
17
+ onDelete: () => void;
18
+ onDistribute: (action: string) => void;
19
+ onDuplicate: () => void;
20
+ onGroup: () => void;
21
+ onLayerOrder: (action: string) => void;
22
+ onUngroup: () => void;
23
+ }
24
+ declare function SelectionContextMenu({ children, selectionCommandAvailability, onAlignToSlide, onDelete, onDistribute, onDuplicate, onGroup, onLayerOrder, onUngroup, }: SelectionContextMenuProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function SelectionContextMenuContent({ selectionCommandAvailability, onAlignToSlide, onDelete, onDistribute, onDuplicate, onGroup, onLayerOrder, onUngroup, }: SelectionContextMenuContentProps): import("react/jsx-runtime").JSX.Element;
26
+ export { SelectionContextMenu, SelectionContextMenuContent };
@@ -0,0 +1,19 @@
1
+ import type { PdfExportSelection } from "@starrykit/slides-core";
2
+ export interface PdfExportSlideOption {
3
+ id: string;
4
+ title: string;
5
+ file?: string;
6
+ }
7
+ interface EditorHeaderProps {
8
+ title: string;
9
+ onTitleChange?: (t: string) => void;
10
+ onPresent?: () => void;
11
+ onExportPdf?: (selection: PdfExportSelection) => void;
12
+ onExportHtml?: () => void;
13
+ onExportSourceFiles?: () => void;
14
+ pdfSlides?: PdfExportSlideOption[];
15
+ pdfThumbnails?: Record<string, string>;
16
+ isSaving: boolean;
17
+ }
18
+ export declare function EditorHeader({ title, onTitleChange, onPresent, onExportPdf, onExportHtml, onExportSourceFiles, pdfSlides, pdfThumbnails, isSaving, }: EditorHeaderProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,88 @@
1
+ import type { EditableType, PdfExportSelection, SlideModel, StageRect } from "@starrykit/slides-core";
2
+ import type { MouseEvent as ReactMouseEvent, RefObject } from "react";
3
+ import type { BlockManipulationOverlay as BlockManipulationOverlayModel } from "../hooks/block-manipulation-types";
4
+ import type { ImageCropOverlay as ImageCropOverlayModel } from "../hooks/use-image-crop";
5
+ import type { ResizeHandleCorner, ResizeHandlePosition } from "../lib/block-snap-types";
6
+ import type { CssPropertyRow } from "../lib/collect-css-properties";
7
+ import type { SelectionCommandAvailability } from "./floating-toolbar";
8
+ interface EditorWorkspaceProps {
9
+ slides: SlideModel[];
10
+ activeSlide: SlideModel;
11
+ deckTitle: string;
12
+ isSaving: boolean;
13
+ isPresenting: boolean;
14
+ thumbnails: Record<string, string>;
15
+ slideWidth: number;
16
+ slideHeight: number;
17
+ offsetX: number;
18
+ offsetY: number;
19
+ scale: number;
20
+ preselectionOverlay: StageRect | null;
21
+ marqueeOverlay: StageRect | null;
22
+ selectionOverlay: StageRect | null;
23
+ toolbarKey: string | null;
24
+ inspectedStyles: CssPropertyRow[];
25
+ selectedElementType: EditableType | "multi";
26
+ selectionCommandAvailability: SelectionCommandAvailability;
27
+ isSelectedElementLocked: boolean;
28
+ groupScopeOverlayPassive: boolean;
29
+ isEditingText: boolean;
30
+ isCropMode: boolean;
31
+ cropOverlay: ImageCropOverlayModel | null;
32
+ manipulationOverlay: BlockManipulationOverlayModel | null;
33
+ attributeValues: {
34
+ locked: string;
35
+ ariaLabel: string;
36
+ linkUrl: string;
37
+ };
38
+ iframeRef: RefObject<HTMLIFrameElement | null>;
39
+ stageViewportRef: RefObject<HTMLDivElement | null>;
40
+ selectionOverlayRef: RefObject<HTMLDivElement | null>;
41
+ selectionContextMenuTriggerRef: RefObject<HTMLSpanElement | null>;
42
+ isManipulating: boolean;
43
+ isToolbarSuppressed: boolean;
44
+ onDeckTitleChange?: (title: string) => void;
45
+ onExportPdf?: (selection: PdfExportSelection) => void;
46
+ onExportHtml?: () => void;
47
+ onExportSourceFiles?: () => void;
48
+ onPresent: () => void;
49
+ onExitPresenting: () => void;
50
+ onSelectSlide: (slideId: string) => void;
51
+ onSidebarSlideFocusChange: (isFocused: boolean) => void;
52
+ onAddSlide: () => void;
53
+ onAddSlideAbove: (slideId: string) => void;
54
+ onAddSlideBelow: (slideId: string) => void;
55
+ onDuplicateSlide: (slideId: string) => void;
56
+ onDeleteSlide: (slideId: string) => void;
57
+ onToggleSlideHidden: (slideId: string) => void;
58
+ onRenameSlide: (slideId: string, nextTitle: string) => void;
59
+ onReorderSlide: (slideId: string, targetIndex: number) => void;
60
+ onSidebarFocusChange?: (focused: boolean) => void;
61
+ onSelectionOverlayMouseDown: (event: ReactMouseEvent<HTMLDivElement>) => void;
62
+ onSelectionOverlayMouseUp: (event: ReactMouseEvent<HTMLDivElement>) => void;
63
+ onSelectionOverlayMouseMove: (event: ReactMouseEvent<HTMLDivElement>) => void;
64
+ onSelectionOverlayContextMenu: (event: ReactMouseEvent<HTMLDivElement>) => void;
65
+ onStageMouseLeave: () => void;
66
+ onResizeHandleMouseDown: (position: ResizeHandlePosition, event: ReactMouseEvent<HTMLButtonElement>) => void;
67
+ onCornerRotationZoneMouseDown: (event: ReactMouseEvent<HTMLButtonElement>) => void;
68
+ onCropHandleMouseDown: (corner: ResizeHandleCorner, event: ReactMouseEvent<HTMLButtonElement>) => void;
69
+ onSelectionOverlayDoubleClick: (event: ReactMouseEvent<HTMLDivElement>) => void;
70
+ onBackgroundClick: () => void;
71
+ onStyleChange: (propertyName: string, nextValue: string) => void;
72
+ onStyleChanges: (changes: Array<{
73
+ propertyName: string;
74
+ nextValue: string;
75
+ }>) => void;
76
+ onStylePreview: (propertyName: string, nextValue: string | null) => void;
77
+ onAttributeChange: (attributeName: string, nextValue: string) => void;
78
+ onAlignToSlide: (action: string) => void;
79
+ onCropImage: () => void;
80
+ onDistribute: (action: string) => void;
81
+ onGroup: () => void;
82
+ onLayerOrder: (action: string) => void;
83
+ onUngroup: () => void;
84
+ onDuplicateElement: () => void;
85
+ onDeleteElement: () => void;
86
+ }
87
+ declare function EditorWorkspace({ slides, activeSlide, deckTitle, isSaving, isPresenting, thumbnails, slideWidth, slideHeight, offsetX, offsetY, scale, preselectionOverlay, marqueeOverlay, selectionOverlay, toolbarKey, inspectedStyles, selectedElementType, selectionCommandAvailability, isSelectedElementLocked, groupScopeOverlayPassive, isEditingText, isCropMode, cropOverlay, manipulationOverlay, attributeValues, iframeRef, stageViewportRef, selectionOverlayRef, selectionContextMenuTriggerRef, isManipulating, isToolbarSuppressed, onDeckTitleChange, onExportPdf, onExportHtml, onExportSourceFiles, onPresent, onExitPresenting, onSelectSlide, onSidebarSlideFocusChange, onAddSlide, onAddSlideAbove, onAddSlideBelow, onDuplicateSlide, onDeleteSlide, onToggleSlideHidden, onRenameSlide, onReorderSlide, onSidebarFocusChange, onSelectionOverlayMouseDown, onSelectionOverlayMouseUp, onSelectionOverlayMouseMove, onSelectionOverlayContextMenu, onStageMouseLeave, onResizeHandleMouseDown, onCornerRotationZoneMouseDown, onCropHandleMouseDown, onSelectionOverlayDoubleClick, onBackgroundClick, onStyleChange, onStyleChanges, onStylePreview, onAttributeChange, onAlignToSlide, onCropImage, onDistribute, onGroup, onLayerOrder, onUngroup, onDuplicateElement, onDeleteElement, }: EditorWorkspaceProps): import("react/jsx-runtime").JSX.Element;
88
+ export { EditorWorkspace };
@@ -0,0 +1,9 @@
1
+ import type { ElementToolFeature } from "../lib/element-tool-model";
2
+ import type { AttributeValues, EditableAttributeId } from "./floating-toolbar-types";
3
+ declare function AttributeDialog({ attributeValues, dialogId, onCommitFeature, onOpenChange, }: {
4
+ attributeValues: AttributeValues;
5
+ dialogId: EditableAttributeId | null;
6
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
7
+ onOpenChange: (open: boolean) => void;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export { AttributeDialog };
@@ -0,0 +1,8 @@
1
+ import type { ElementToolFeature } from "../lib/element-tool-model";
2
+ export declare function renderFloatingToolbarFeature({ currentValue, feature, onClosePanel, onCommitFeature, operationAvailability, }: {
3
+ currentValue: string;
4
+ feature: ElementToolFeature;
5
+ onClosePanel: () => void;
6
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
7
+ operationAvailability?: Partial<Record<ElementToolFeature["id"], boolean>>;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import type { ElementToolFeature } from "../lib/element-tool-model";
2
+ declare function FontFamilyCombobox({ currentValue, onCommit, onOpen, onPreview, }: {
3
+ currentValue: string;
4
+ onCommit: (nextValue: string) => void;
5
+ onOpen: () => void;
6
+ onPreview: (nextValue: string | null) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ declare function NumericCommitControl({ feature, label, onCommitFeature, onPreview, unit, }: {
9
+ feature: ElementToolFeature;
10
+ label: string;
11
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
12
+ onPreview?: (nextValue: string | null) => void;
13
+ unit?: string;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DebouncedStyleNumberControl({ currentValue, feature, formatValue, getDraftValue, label, max, min, onCommitFeature, onPreviewStyle, unit, }: {
16
+ currentValue: string;
17
+ feature: ElementToolFeature;
18
+ formatValue: (numericValue: number) => string;
19
+ getDraftValue: (currentValue: string) => string;
20
+ label: string;
21
+ max?: number;
22
+ min?: number;
23
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
24
+ onPreviewStyle: (propertyName: string, nextValue: string | null) => void;
25
+ unit: string;
26
+ }): import("react/jsx-runtime").JSX.Element;
27
+ declare function TextCommitControl({ feature, label, onCommitFeature, }: {
28
+ feature: ElementToolFeature;
29
+ label: string;
30
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
31
+ }): import("react/jsx-runtime").JSX.Element;
32
+ declare function FontSizeControl({ currentValue, feature, onCommitFeature, }: {
33
+ currentValue: string;
34
+ feature: ElementToolFeature;
35
+ onCommitFeature: (feature: ElementToolFeature, nextValue: string) => void;
36
+ }): import("react/jsx-runtime").JSX.Element;
37
+ export { DebouncedStyleNumberControl, FontFamilyCombobox, FontSizeControl, NumericCommitControl, TextCommitControl, };
@@ -0,0 +1,47 @@
1
+ import type { LucideIcon } from "lucide-react";
2
+ import type { MouseEvent as ReactMouseEvent, ReactNode } from "react";
3
+ import type { ElementToolSubgroup } from "../lib/element-tool-model";
4
+ export declare function ToolbarTrigger({ children, active, className, label, onClick, }: {
5
+ children: ReactNode;
6
+ active?: boolean;
7
+ className?: string;
8
+ label: string;
9
+ onClick: (event: ReactMouseEvent<HTMLButtonElement>) => void;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export declare function IconButton({ children, active, className, label, onClick, }: {
12
+ children: ReactNode;
13
+ active?: boolean;
14
+ className?: string;
15
+ label: string;
16
+ onClick?: () => void;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ export declare function ToolbarPanel({ children, left, width, }: {
19
+ children: ReactNode;
20
+ left: number;
21
+ width?: "default" | "medium" | "wide";
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ export declare function getPanelWidth(subgroup: ElementToolSubgroup): "default" | "medium" | "wide";
24
+ export declare function shouldUpdateOffset(current: number, next: number): boolean;
25
+ export declare function Divider(): import("react/jsx-runtime").JSX.Element;
26
+ export declare function PanelTitle({ children }: {
27
+ children: ReactNode;
28
+ }): import("react/jsx-runtime").JSX.Element;
29
+ export declare function FieldLabel({ children, htmlFor }: {
30
+ children: ReactNode;
31
+ htmlFor?: string;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export declare function ToolbarIcon({ icon: Icon, strokeWidth, }: {
34
+ icon: LucideIcon;
35
+ strokeWidth?: number;
36
+ }): import("react/jsx-runtime").JSX.Element;
37
+ export declare function ToolbarValueButton({ children, label, onClick, }: {
38
+ children: ReactNode;
39
+ label: string;
40
+ onClick: (event: ReactMouseEvent<HTMLButtonElement>) => void;
41
+ }): import("react/jsx-runtime").JSX.Element;
42
+ export declare function ToolbarOption({ children, disabled, onClick, title, }: {
43
+ children: ReactNode;
44
+ disabled?: boolean;
45
+ onClick: () => void;
46
+ title?: string;
47
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { type Dispatch, type ReactNode, type SetStateAction } from "react";
2
+ import type { ElementToolFeature, ElementToolOption } from "../lib/element-tool-model";
3
+ import type { SelectionCommandAvailability } from "./floating-toolbar-types";
4
+ export interface PopoverSectionProps {
5
+ activePopoverId: string | null;
6
+ commitFeature: (feature: ElementToolFeature, nextValue: string) => void;
7
+ getCurrentValue: (feature: ElementToolFeature) => string;
8
+ getFeature: (featureId: ElementToolFeature["id"]) => ElementToolFeature;
9
+ onStylePreview: (propertyName: string, nextValue: string | null) => void;
10
+ setActivePopoverId: Dispatch<SetStateAction<string | null>>;
11
+ }
12
+ export interface OptionsSectionProps extends PopoverSectionProps {
13
+ selectionCommandAvailability: SelectionCommandAvailability;
14
+ }
15
+ declare function ColorPopover({ activePopoverId, commitFeature, feature, getCurrentValue, icon, includeGradients, label, popoverId, setActivePopoverId, }: PopoverSectionProps & {
16
+ feature: ElementToolFeature;
17
+ icon: ReactNode;
18
+ includeGradients: boolean;
19
+ label: string;
20
+ popoverId: string;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ declare function OptionsPopover({ activePopoverId, commitFeature, custom, feature, getCurrentValue, icon, label, options, popoverId, selectionCommandAvailability, setActivePopoverId, onStylePreview, }: OptionsSectionProps & {
23
+ custom?: ReactNode;
24
+ feature: ElementToolFeature;
25
+ icon: ReactNode;
26
+ label: string;
27
+ options: ElementToolOption[];
28
+ popoverId: string;
29
+ }): import("react/jsx-runtime").JSX.Element;
30
+ declare function LineHeightPopover({ activePopoverId, commitFeature, feature, getCurrentValue, icon, label, popoverId, setActivePopoverId, onStylePreview, }: PopoverSectionProps & {
31
+ feature: ElementToolFeature;
32
+ icon: ReactNode;
33
+ label: string;
34
+ popoverId: string;
35
+ }): import("react/jsx-runtime").JSX.Element;
36
+ declare function AttributeMenuButton({ icon, label, onClick, }: {
37
+ icon: ReactNode;
38
+ label: string;
39
+ onClick: () => void;
40
+ }): import("react/jsx-runtime").JSX.Element;
41
+ declare function ToolbarSection({ children }: {
42
+ children: ReactNode;
43
+ }): import("react/jsx-runtime").JSX.Element;
44
+ export { AttributeMenuButton, ColorPopover, LineHeightPopover, OptionsPopover, ToolbarSection };
@@ -0,0 +1,19 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ import { type ElementToolFeature } from "../lib/element-tool-model";
3
+ import type { EditableAttributeId, SelectionCommandAvailability } from "./floating-toolbar-types";
4
+ interface FloatingToolbarSectionsProps {
5
+ activePopoverId: string | null;
6
+ isSelectedElementLocked: boolean;
7
+ selectionCommandAvailability: SelectionCommandAvailability;
8
+ selectedElementType: "text" | "image" | "block" | "group" | "multi";
9
+ showGroupTool: boolean;
10
+ showMultiTools: boolean;
11
+ commitFeature: (feature: ElementToolFeature, nextValue: string) => void;
12
+ getCurrentValue: (feature: ElementToolFeature) => string;
13
+ getFeature: (featureId: ElementToolFeature["id"]) => ElementToolFeature;
14
+ onStylePreview: (propertyName: string, nextValue: string | null) => void;
15
+ setActiveAttributeDialog: Dispatch<SetStateAction<EditableAttributeId | null>>;
16
+ setActivePopoverId: Dispatch<SetStateAction<string | null>>;
17
+ }
18
+ declare function FloatingToolbarSections({ activePopoverId, isSelectedElementLocked, selectionCommandAvailability, selectedElementType, showGroupTool, showMultiTools, commitFeature, getCurrentValue, getFeature, onStylePreview, setActiveAttributeDialog, setActivePopoverId, }: FloatingToolbarSectionsProps): import("react/jsx-runtime").JSX.Element;
19
+ export { FloatingToolbarSections };
@@ -0,0 +1,41 @@
1
+ import type { EditableType } from "@starrykit/slides-core";
2
+ import type { CssPropertyRow } from "../lib/collect-css-properties";
3
+ import type { ElementToolFeature } from "../lib/element-tool-model";
4
+ export interface FloatingToolbarProps {
5
+ inspectedStyles: CssPropertyRow[];
6
+ selectedElementType: EditableType | "multi";
7
+ selectionCommandAvailability: SelectionCommandAvailability;
8
+ isSelectedElementLocked: boolean;
9
+ attributeValues: AttributeValues;
10
+ onStyleChange: (propertyName: string, nextValue: string) => void;
11
+ onStyleChanges: (changes: Array<{
12
+ propertyName: string;
13
+ nextValue: string;
14
+ }>) => void;
15
+ onStylePreview: (propertyName: string, nextValue: string | null) => void;
16
+ onAttributeChange: (attributeName: string, nextValue: string) => void;
17
+ onAlignToSlide: (action: string) => void;
18
+ onCropImage: () => void;
19
+ onDistribute: (action: string) => void;
20
+ onGroup: () => void;
21
+ onLayerOrder: (action: string) => void;
22
+ onUngroup: () => void;
23
+ }
24
+ export interface AttributeValues {
25
+ locked: string;
26
+ ariaLabel: string;
27
+ linkUrl: string;
28
+ }
29
+ export interface SelectionCommandAvailability {
30
+ group: boolean;
31
+ ungroup: boolean;
32
+ }
33
+ export type EditableAttributeId = "other-link" | "other-aria-label";
34
+ export declare const OTHER_FEATURES: Record<EditableAttributeId, ElementToolFeature>;
35
+ export declare const toolbarIconClassName = "size-3.5";
36
+ export declare const toolbarIconMutedClassName = "size-3.5 text-foreground/55";
37
+ export declare const toolbarIconDropShadowClassName = "size-3.5 drop-shadow";
38
+ export declare const ICON_STROKE_WIDTH = 2.5;
39
+ export declare const menuItemClassName = "flex min-h-7 w-full items-center justify-between gap-2 rounded-md px-2 py-1 text-left text-[12px] text-foreground/70 outline-none transition-colors hover:bg-foreground/[0.05] hover:text-foreground focus-visible:bg-foreground/[0.06] focus-visible:text-foreground focus-visible:ring-[2px] focus-visible:ring-ring/25 disabled:pointer-events-none disabled:opacity-40";
40
+ export declare const toolbarIconButtonClassName = "size-7.5 rounded-xl text-foreground/60 transition-colors hover:bg-foreground/[0.05] hover:text-foreground active:scale-[0.98]";
41
+ export declare const toolbarIconButtonActiveClassName = "bg-foreground/[0.07] text-foreground shadow-[inset_0_1px_2px_rgba(0,0,0,0.08)] hover:bg-foreground/[0.08]";
@@ -0,0 +1,4 @@
1
+ import type { FloatingToolbarProps } from "./floating-toolbar-types";
2
+ export type { SelectionCommandAvailability } from "./floating-toolbar-types";
3
+ declare function FloatingToolbar({ inspectedStyles, selectedElementType, selectionCommandAvailability, isSelectedElementLocked, attributeValues, onStyleChange, onStyleChanges, onStylePreview, onAttributeChange, onAlignToSlide, onCropImage, onDistribute, onGroup, onLayerOrder, onUngroup, }: FloatingToolbarProps): import("react/jsx-runtime").JSX.Element;
4
+ export { FloatingToolbar };
@@ -0,0 +1,9 @@
1
+ import type { MouseEvent as ReactMouseEvent } from "react";
2
+ import type { ImageCropOverlay as ImageCropOverlayModel } from "../hooks/use-image-crop";
3
+ import type { ResizeHandleCorner } from "../lib/block-snap-types";
4
+ interface ImageCropOverlayProps {
5
+ overlay: ImageCropOverlayModel;
6
+ onCropHandleMouseDown: (corner: ResizeHandleCorner, event: ReactMouseEvent<HTMLButtonElement>) => void;
7
+ }
8
+ declare function ImageCropOverlay({ overlay, onCropHandleMouseDown }: ImageCropOverlayProps): import("react/jsx-runtime").JSX.Element;
9
+ export { ImageCropOverlay };
@@ -0,0 +1,14 @@
1
+ export interface PresenterViewProps {
2
+ slides: {
3
+ hidden?: boolean;
4
+ id: string;
5
+ width: number;
6
+ height: number;
7
+ htmlSource: string;
8
+ sourceFile?: string;
9
+ }[];
10
+ startSlideId?: string;
11
+ onExit: () => void;
12
+ }
13
+ declare function PresenterView({ slides, startSlideId, onExit }: PresenterViewProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export { PresenterView };
@@ -0,0 +1,20 @@
1
+ import type { SlideModel } from "@starrykit/slides-core";
2
+ interface SlideSidebarProps {
3
+ slides: SlideModel[];
4
+ activeSlideId: string;
5
+ slideCount: number;
6
+ thumbnails: Record<string, string>;
7
+ onSelectSlide: (slideId: string) => void;
8
+ onAdd?: () => void;
9
+ onAddSlideAbove?: (slideId: string) => void;
10
+ onAddSlideBelow?: (slideId: string) => void;
11
+ onDuplicate?: (slideId: string) => void;
12
+ onDelete?: (slideId: string) => void;
13
+ onToggleHidden?: (slideId: string) => void;
14
+ onRename?: (slideId: string, nextTitle: string) => void;
15
+ onReorder?: (slideId: string, targetIndex: number) => void;
16
+ onSlideFocusChange?: (isFocused: boolean) => void;
17
+ onSidebarFocusChange?: (focused: boolean) => void;
18
+ }
19
+ declare function SlideSidebar({ slides, activeSlideId, slideCount, thumbnails, onSelectSlide, onAdd, onAddSlideAbove, onAddSlideBelow, onDuplicate, onDelete, onToggleHidden, onRename, onReorder, onSlideFocusChange, onSidebarFocusChange, }: SlideSidebarProps): import("react/jsx-runtime").JSX.Element;
20
+ export { SlideSidebar };
@@ -0,0 +1,88 @@
1
+ import type { EditableType, StageRect } from "@starrykit/slides-core";
2
+ import type { MouseEvent as ReactMouseEvent, RefObject } from "react";
3
+ import type { ImageCropOverlay as ImageCropOverlayModel } from "../hooks/use-image-crop";
4
+ import type { ResizeHandleCorner, ResizeHandlePosition } from "../lib/block-snap-types";
5
+ import type { CssPropertyRow } from "../lib/collect-css-properties";
6
+ import { type SelectionCommandAvailability } from "./floating-toolbar";
7
+ interface StageCanvasProps {
8
+ slideWidth: number;
9
+ slideHeight: number;
10
+ offsetX: number;
11
+ offsetY: number;
12
+ scale: number;
13
+ preselectionOverlay: StageRect | null;
14
+ marqueeOverlay: StageRect | null;
15
+ selectionOverlay: StageRect | null;
16
+ toolbarKey: string | null;
17
+ inspectedStyles: CssPropertyRow[];
18
+ selectedElementType: EditableType | "multi";
19
+ selectionCommandAvailability: SelectionCommandAvailability;
20
+ isSelectedElementLocked: boolean;
21
+ groupScopeOverlayPassive: boolean;
22
+ isEditingText: boolean;
23
+ isCropMode: boolean;
24
+ cropOverlay: ImageCropOverlayModel | null;
25
+ manipulationOverlay: {
26
+ selectionBounds: StageRect;
27
+ snapGuides: Array<{
28
+ orientation: "vertical" | "horizontal";
29
+ start: {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ end: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ variant: "alignment" | "spacing";
38
+ }>;
39
+ resizeHandles: Array<{
40
+ position: ResizeHandlePosition;
41
+ x: number;
42
+ y: number;
43
+ }>;
44
+ rotationZones: Array<{
45
+ corner: ResizeHandleCorner;
46
+ x: number;
47
+ y: number;
48
+ }>;
49
+ } | null;
50
+ attributeValues: {
51
+ locked: string;
52
+ ariaLabel: string;
53
+ linkUrl: string;
54
+ };
55
+ iframeRef: RefObject<HTMLIFrameElement | null>;
56
+ stageViewportRef: RefObject<HTMLDivElement | null>;
57
+ selectionOverlayRef: RefObject<HTMLDivElement | null>;
58
+ selectionContextMenuTriggerRef: RefObject<HTMLSpanElement | null>;
59
+ isManipulating: boolean;
60
+ isToolbarSuppressed: boolean;
61
+ onSelectionOverlayMouseDown: (event: ReactMouseEvent<HTMLDivElement>) => void;
62
+ onSelectionOverlayMouseUp: (event: ReactMouseEvent<HTMLDivElement>) => void;
63
+ onSelectionOverlayMouseMove: (event: ReactMouseEvent<HTMLDivElement>) => void;
64
+ onSelectionOverlayContextMenu: (event: ReactMouseEvent<HTMLDivElement>) => void;
65
+ onStageMouseLeave: () => void;
66
+ onResizeHandleMouseDown: (position: ResizeHandlePosition, event: ReactMouseEvent<HTMLButtonElement>) => void;
67
+ onCornerRotationZoneMouseDown: (event: ReactMouseEvent<HTMLButtonElement>) => void;
68
+ onCropHandleMouseDown: (corner: ResizeHandleCorner, event: ReactMouseEvent<HTMLButtonElement>) => void;
69
+ onSelectionOverlayDoubleClick: (event: ReactMouseEvent<HTMLDivElement>) => void;
70
+ onBackgroundClick: () => void;
71
+ onStyleChange: (propertyName: string, nextValue: string) => void;
72
+ onStyleChanges: (changes: Array<{
73
+ propertyName: string;
74
+ nextValue: string;
75
+ }>) => void;
76
+ onStylePreview: (propertyName: string, nextValue: string | null) => void;
77
+ onAttributeChange: (attributeName: string, nextValue: string) => void;
78
+ onAlignToSlide: (action: string) => void;
79
+ onCropImage: () => void;
80
+ onDistribute: (action: string) => void;
81
+ onGroup: () => void;
82
+ onLayerOrder: (action: string) => void;
83
+ onUngroup: () => void;
84
+ onDuplicate: () => void;
85
+ onDelete: () => void;
86
+ }
87
+ declare function StageCanvas({ slideWidth, slideHeight, offsetX, offsetY, scale, preselectionOverlay, marqueeOverlay, selectionOverlay, toolbarKey, inspectedStyles, selectedElementType, selectionCommandAvailability, isSelectedElementLocked, groupScopeOverlayPassive, isEditingText, isCropMode, cropOverlay, manipulationOverlay, attributeValues, iframeRef, stageViewportRef, selectionOverlayRef, selectionContextMenuTriggerRef, isManipulating, isToolbarSuppressed, onSelectionOverlayMouseDown, onSelectionOverlayMouseUp, onSelectionOverlayMouseMove, onSelectionOverlayContextMenu, onStageMouseLeave, onResizeHandleMouseDown, onCornerRotationZoneMouseDown, onCropHandleMouseDown, onSelectionOverlayDoubleClick, onBackgroundClick, onStyleChange, onStyleChanges, onStylePreview, onAttributeChange, onAlignToSlide, onCropImage, onDistribute, onGroup, onLayerOrder, onUngroup, onDuplicate, onDelete, }: StageCanvasProps): import("react/jsx-runtime").JSX.Element;
88
+ export { StageCanvas };
@@ -0,0 +1,7 @@
1
+ import { Accordion as AccordionPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -0,0 +1,13 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
8
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
9
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
11
+ asChild?: boolean;
12
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
+ export { Button, buttonVariants };
@@ -0,0 +1,25 @@
1
+ import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
6
+ declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
7
+ declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
8
+ declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
9
+ declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
10
+ inset?: boolean;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
13
+ declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
14
+ declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
15
+ inset?: boolean;
16
+ variant?: "default" | "destructive";
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
19
+ declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
20
+ declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
21
+ inset?: boolean;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
24
+ declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
25
+ export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, };
@@ -0,0 +1,10 @@
1
+ import { Dialog as DialogPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogContent({ children, className, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
9
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
+ export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
@@ -0,0 +1,3 @@
1
+ import type * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,10 @@
1
+ import { Popover as PopoverPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
7
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): import("react/jsx-runtime").JSX.Element;
9
+ declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
10
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription, };
@@ -0,0 +1,5 @@
1
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
2
+ import type * as React from "react";
3
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
5
+ export { ScrollArea, ScrollBar };