starry-slides 0.1.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/LICENSE +10 -0
- package/README.md +131 -0
- package/dist/assets/index---ub3Dty.css +1 -0
- package/dist/assets/index-7Xs_Dyp0.js +354 -0
- package/dist/assets/index-8ul7coaw.js +451 -0
- package/dist/assets/index-B4_bJa9t.js +412 -0
- package/dist/assets/index-B9p6L9Wx.js +324 -0
- package/dist/assets/index-BF-Vi1Nh.js +413 -0
- package/dist/assets/index-BKvVbgXz.css +1 -0
- package/dist/assets/index-BNZJ_Wz-.js +417 -0
- package/dist/assets/index-BO2gtiKn.js +413 -0
- package/dist/assets/index-BYpD8kgo.js +456 -0
- package/dist/assets/index-BaZRfz_9.css +1 -0
- package/dist/assets/index-BlsWm4PI.js +412 -0
- package/dist/assets/index-BnUIBFtw.js +393 -0
- package/dist/assets/index-BvhCbfCi.js +412 -0
- package/dist/assets/index-BxEkxfy1.js +412 -0
- package/dist/assets/index-BzrA7O0L.js +422 -0
- package/dist/assets/index-C0xGkdRg.js +413 -0
- package/dist/assets/index-C1Rjncf1.js +456 -0
- package/dist/assets/index-CCgb2gqc.js +413 -0
- package/dist/assets/index-CDFJQRFx.js +413 -0
- package/dist/assets/index-CEOai0RW.js +456 -0
- package/dist/assets/index-CG2uWTey.css +1 -0
- package/dist/assets/index-CLe3_iTu.js +412 -0
- package/dist/assets/index-CS_optob.js +324 -0
- package/dist/assets/index-CXgwXOZH.css +1 -0
- package/dist/assets/index-CcBvAcE2.js +408 -0
- package/dist/assets/index-CllmR_MT.js +408 -0
- package/dist/assets/index-CnMy6wxq.js +412 -0
- package/dist/assets/index-CoWNjYgb.js +422 -0
- package/dist/assets/index-CtfA3BPy.css +1 -0
- package/dist/assets/index-D-JiuJIv.js +324 -0
- package/dist/assets/index-D2uEYXyQ.css +1 -0
- package/dist/assets/index-D70beOHW.js +456 -0
- package/dist/assets/index-D8xuxnF1.js +456 -0
- package/dist/assets/index-DKAtkRd8.css +1 -0
- package/dist/assets/index-DU3l9_k0.css +1 -0
- package/dist/assets/index-DaLY98jk.js +456 -0
- package/dist/assets/index-DkNHJHQl.js +412 -0
- package/dist/assets/index-DmFnifK8.js +456 -0
- package/dist/assets/index-DndZR7Ds.css +1 -0
- package/dist/assets/index-DuRa7Y6g.js +324 -0
- package/dist/assets/index-EnDjTeHF.js +451 -0
- package/dist/assets/index-J3nQgjqJ.js +451 -0
- package/dist/assets/index-wD_iWTBn.js +413 -0
- package/dist/chunk-AK5J4CXH.js +1671 -0
- package/dist/chunk-ARFDESSF.js +1583 -0
- package/dist/chunk-DHWTBXGS.js +985 -0
- package/dist/chunk-FCRRFL7N.js +1571 -0
- package/dist/chunk-J7W4Y7WJ.js +1620 -0
- package/dist/chunk-OCJULB7Z.js +1140 -0
- package/dist/chunk-WCJWV5SO.js +36 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1119 -0
- package/dist/cli/index.test.d.ts +1 -0
- package/dist/core/deck-slide-operations.d.ts +5 -0
- package/dist/core/generated-deck.d.ts +8 -0
- package/dist/core/generated-deck.test.d.ts +1 -0
- package/dist/core/group-operations.d.ts +24 -0
- package/dist/core/history.d.ts +20 -0
- package/dist/core/history.test.d.ts +1 -0
- package/dist/core/html-export.d.ts +20 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/layout.d.ts +36 -0
- package/dist/core/layout.test.d.ts +1 -0
- package/dist/core/pdf-export.d.ts +20 -0
- package/dist/core/presentation.d.ts +7 -0
- package/dist/core/slide-contract.d.ts +41 -0
- package/dist/core/slide-document.d.ts +5 -0
- package/dist/core/slide-document.test.d.ts +1 -0
- package/dist/core/slide-html-document.d.ts +3 -0
- package/dist/core/slide-operation-reducer.d.ts +4 -0
- package/dist/core/slide-operation-reducer.test.d.ts +1 -0
- package/dist/core/slide-operation-types.d.ts +123 -0
- package/dist/core/slide-operations-helpers.d.ts +14 -0
- package/dist/core/slide-operations.d.ts +5 -0
- package/dist/core/slide-operations.test.d.ts +1 -0
- package/dist/core/verify-deck.d.ts +48 -0
- package/dist/core/verify-deck.test.d.ts +1 -0
- package/dist/editor/app/App.d.ts +2 -0
- package/dist/editor/app/main.d.ts +1 -0
- package/dist/editor/app/use-slides-data.d.ts +14 -0
- package/dist/editor/components/block-manipulation-overlay.d.ts +32 -0
- package/dist/editor/components/color-picker.d.ts +10 -0
- package/dist/editor/components/context-menu.d.ts +26 -0
- package/dist/editor/components/editor-header.d.ts +18 -0
- package/dist/editor/components/floating-toolbar-feature.d.ts +8 -0
- package/dist/editor/components/floating-toolbar-parts.d.ts +46 -0
- package/dist/editor/components/floating-toolbar.d.ts +27 -0
- package/dist/editor/components/presenter-view.d.ts +13 -0
- package/dist/editor/components/slide-sidebar.d.ts +18 -0
- package/dist/editor/components/stage-canvas.d.ts +77 -0
- package/dist/editor/components/ui/accordion.d.ts +7 -0
- package/dist/editor/components/ui/button.d.ts +10 -0
- package/dist/editor/components/ui/context-menu.d.ts +25 -0
- package/dist/editor/components/ui/dialog.d.ts +10 -0
- package/dist/editor/components/ui/input.d.ts +3 -0
- package/dist/editor/components/ui/popover.d.ts +10 -0
- package/dist/editor/components/ui/scroll-area.d.ts +5 -0
- package/dist/editor/components/ui/select.d.ts +15 -0
- package/dist/editor/components/ui/separator.d.ts +4 -0
- package/dist/editor/components/ui/tabs.d.ts +11 -0
- package/dist/editor/components/ui/textarea.d.ts +3 -0
- package/dist/editor/components/ui/toggle-group.d.ts +9 -0
- package/dist/editor/components/ui/toggle.d.ts +9 -0
- package/dist/editor/components/ui/tooltip.d.ts +7 -0
- package/dist/editor/editor-operations.d.ts +15 -0
- package/dist/editor/hooks/block-manipulation-geometry.d.ts +16 -0
- package/dist/editor/hooks/block-manipulation-operations.d.ts +10 -0
- package/dist/editor/hooks/block-manipulation-overlay.d.ts +11 -0
- package/dist/editor/hooks/block-manipulation-types.d.ts +73 -0
- package/dist/editor/hooks/editor-keyboard-geometry.d.ts +22 -0
- package/dist/editor/hooks/editor-keyboard-operations.d.ts +10 -0
- package/dist/editor/hooks/editor-keyboard-types.d.ts +35 -0
- package/dist/editor/hooks/iframe-editing-session.d.ts +10 -0
- package/dist/editor/hooks/iframe-text-editing-dom.d.ts +6 -0
- package/dist/editor/hooks/iframe-text-editing-types.d.ts +38 -0
- package/dist/editor/hooks/object-clipboard-commands.d.ts +28 -0
- package/dist/editor/hooks/use-block-manipulation.d.ts +3 -0
- package/dist/editor/hooks/use-editor-keyboard-shortcuts.d.ts +3 -0
- package/dist/editor/hooks/use-iframe-text-editing.d.ts +3 -0
- package/dist/editor/hooks/use-slide-history.d.ts +17 -0
- package/dist/editor/hooks/use-slide-inspector.d.ts +24 -0
- package/dist/editor/hooks/use-slide-thumbnails.d.ts +2 -0
- package/dist/editor/hooks/use-stage-viewport.d.ts +13 -0
- package/dist/editor/index.d.ts +13 -0
- package/dist/editor/index.js +8260 -0
- package/dist/editor/lib/block-snap-constants.d.ts +8 -0
- package/dist/editor/lib/block-snap-guides.d.ts +6 -0
- package/dist/editor/lib/block-snap-targets.d.ts +13 -0
- package/dist/editor/lib/block-snap-types.d.ts +30 -0
- package/dist/editor/lib/block-snapping.d.ts +17 -0
- package/dist/editor/lib/collect-css-properties.d.ts +5 -0
- package/dist/editor/lib/element-tool-commit.d.ts +18 -0
- package/dist/editor/lib/element-tool-model.d.ts +16 -0
- package/dist/editor/lib/element-tool-types.d.ts +35 -0
- package/dist/editor/lib/element-tool-values.d.ts +23 -0
- package/dist/editor/lib/motion.d.ts +8 -0
- package/dist/editor/lib/selection-overlay.d.ts +4 -0
- package/dist/editor/lib/style-controls.d.ts +17 -0
- package/dist/editor/lib/thumbnail-renderer.d.ts +2 -0
- package/dist/editor/lib/utils.d.ts +3 -0
- package/dist/index.html +13 -0
- package/dist/node/deck-runtime-middleware.d.ts +8 -0
- package/dist/node/deck-source.d.ts +1 -0
- package/dist/node/html-export.d.ts +16 -0
- package/dist/node/open-browser.d.ts +1 -0
- package/dist/node/pdf-export.d.ts +20 -0
- package/dist/node/ports.d.ts +1 -0
- package/dist/node/view-renderer.d.ts +31 -0
- package/dist/runtime/deck-source.d.ts +1 -0
- package/dist/runtime/html-export.d.ts +16 -0
- package/dist/runtime/open-browser.d.ts +1 -0
- package/dist/runtime/pdf-export.d.ts +20 -0
- package/dist/runtime/ports.d.ts +1 -0
- package/dist/runtime/view-renderer.d.ts +31 -0
- package/dist/runtime/view-renderer.test.d.ts +1 -0
- package/dist/test/deck-fixtures.d.ts +14 -0
- package/package.json +94 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PresenterViewProps {
|
|
2
|
+
slides: {
|
|
3
|
+
hidden?: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
htmlSource: string;
|
|
8
|
+
}[];
|
|
9
|
+
startSlideId?: string;
|
|
10
|
+
onExit: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function PresenterView({ slides, startSlideId, onExit }: PresenterViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export { PresenterView };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SlideModel } from "../../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
|
+
}
|
|
17
|
+
declare function SlideSidebar({ slides, activeSlideId, slideCount, thumbnails, onSelectSlide, onAdd, onAddSlideAbove, onAddSlideBelow, onDuplicate, onDelete, onToggleHidden, onRename, onReorder, }: SlideSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { SlideSidebar };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent, RefObject } from "react";
|
|
2
|
+
import type { EditableType, StageRect } from "../../core";
|
|
3
|
+
import type { CssPropertyRow } from "../lib/collect-css-properties";
|
|
4
|
+
import { type SelectionCommandAvailability } from "./floating-toolbar";
|
|
5
|
+
type ResizeHandleCorner = "top-left" | "top-right" | "bottom-right" | "bottom-left";
|
|
6
|
+
interface StageCanvasProps {
|
|
7
|
+
slideWidth: number;
|
|
8
|
+
slideHeight: number;
|
|
9
|
+
offsetX: number;
|
|
10
|
+
offsetY: number;
|
|
11
|
+
scale: number;
|
|
12
|
+
preselectionOverlay: StageRect | null;
|
|
13
|
+
selectionOverlay: StageRect | null;
|
|
14
|
+
toolbarKey: string | null;
|
|
15
|
+
inspectedStyles: CssPropertyRow[];
|
|
16
|
+
selectedElementType: EditableType | "multi";
|
|
17
|
+
selectionCommandAvailability: SelectionCommandAvailability;
|
|
18
|
+
groupScopeOverlayPassive: boolean;
|
|
19
|
+
isEditingText: boolean;
|
|
20
|
+
manipulationOverlay: {
|
|
21
|
+
selectionBounds: StageRect;
|
|
22
|
+
snapGuides: Array<{
|
|
23
|
+
orientation: "vertical" | "horizontal";
|
|
24
|
+
start: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
variant: "alignment" | "spacing";
|
|
33
|
+
}>;
|
|
34
|
+
resizeHandles: Array<{
|
|
35
|
+
corner: ResizeHandleCorner;
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}>;
|
|
39
|
+
rotationHandle: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
} | null;
|
|
44
|
+
attributeValues: {
|
|
45
|
+
locked: string;
|
|
46
|
+
altText: string;
|
|
47
|
+
ariaLabel: string;
|
|
48
|
+
linkUrl: string;
|
|
49
|
+
};
|
|
50
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
51
|
+
stageViewportRef: RefObject<HTMLDivElement | null>;
|
|
52
|
+
selectionOverlayRef: RefObject<HTMLDivElement | null>;
|
|
53
|
+
selectionContextMenuTriggerRef: RefObject<HTMLSpanElement | null>;
|
|
54
|
+
isManipulating: boolean;
|
|
55
|
+
isToolbarSuppressed: boolean;
|
|
56
|
+
onSelectionOverlayMouseDown: (event: ReactMouseEvent<HTMLDivElement>) => void;
|
|
57
|
+
onSelectionOverlayMouseUp: (event: ReactMouseEvent<HTMLDivElement>) => void;
|
|
58
|
+
onSelectionOverlayMouseMove: (event: ReactMouseEvent<HTMLDivElement>) => void;
|
|
59
|
+
onSelectionOverlayContextMenu: (event: ReactMouseEvent<HTMLDivElement>) => void;
|
|
60
|
+
onStageMouseLeave: () => void;
|
|
61
|
+
onResizeHandleMouseDown: (corner: ResizeHandleCorner, event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
62
|
+
onRotateHandleMouseDown: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
63
|
+
onSelectionOverlayDoubleClick: (event: ReactMouseEvent<HTMLDivElement>) => void;
|
|
64
|
+
onBackgroundClick: () => void;
|
|
65
|
+
onStageWheel: (event: WheelEvent) => void;
|
|
66
|
+
onStyleChange: (propertyName: string, nextValue: string) => void;
|
|
67
|
+
onAttributeChange: (attributeName: string, nextValue: string) => void;
|
|
68
|
+
onAlignToSlide: (action: string) => void;
|
|
69
|
+
onDistribute: (action: string) => void;
|
|
70
|
+
onGroup: () => void;
|
|
71
|
+
onLayerOrder: (action: string) => void;
|
|
72
|
+
onUngroup: () => void;
|
|
73
|
+
onDuplicate: () => void;
|
|
74
|
+
onDelete: () => void;
|
|
75
|
+
}
|
|
76
|
+
declare function StageCanvas({ slideWidth, slideHeight, offsetX, offsetY, scale, preselectionOverlay, selectionOverlay, toolbarKey, inspectedStyles, selectedElementType, selectionCommandAvailability, groupScopeOverlayPassive, isEditingText, manipulationOverlay, attributeValues, iframeRef, stageViewportRef, selectionOverlayRef, selectionContextMenuTriggerRef, isManipulating, isToolbarSuppressed, onSelectionOverlayMouseDown, onSelectionOverlayMouseUp, onSelectionOverlayMouseMove, onSelectionOverlayContextMenu, onStageMouseLeave, onResizeHandleMouseDown, onRotateHandleMouseDown, onSelectionOverlayDoubleClick, onBackgroundClick, onStageWheel, onStyleChange, onAttributeChange, onAlignToSlide, onDistribute, onGroup, onLayerOrder, onUngroup, onDuplicate, onDelete, }: StageCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
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,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * 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 function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
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,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 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const tabsListVariants: (props?: ({
|
|
6
|
+
variant?: "line" | "default" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { toggleVariants } from "./toggle";
|
|
5
|
+
declare function ToggleGroup({ className, variant, size, spacing, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
6
|
+
spacing?: number;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AttributeUpdateOperation, type SlideModel, type StyleUpdateOperation } from "../core";
|
|
2
|
+
export declare function getInlineStyleValue(slide: SlideModel, elementId: string, propertyName: string): string;
|
|
3
|
+
export declare function getHtmlAttributeValue(slide: SlideModel, elementId: string, attributeName: string): string;
|
|
4
|
+
export declare function createStyleUpdateOperation({ elementId, nextValue, propertyName, slide, }: {
|
|
5
|
+
elementId: string;
|
|
6
|
+
nextValue: string;
|
|
7
|
+
propertyName: string;
|
|
8
|
+
slide: SlideModel;
|
|
9
|
+
}): StyleUpdateOperation | null;
|
|
10
|
+
export declare function createAttributeUpdateOperation({ attributeName, elementId, nextValue, slide, }: {
|
|
11
|
+
attributeName: string;
|
|
12
|
+
elementId: string;
|
|
13
|
+
nextValue: string;
|
|
14
|
+
slide: SlideModel;
|
|
15
|
+
}): AttributeUpdateOperation | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditableElement, StageRect } from "../../core";
|
|
2
|
+
import type { ResizeHandleCorner } from "../lib/block-snap-types";
|
|
3
|
+
export declare function px(value: number): string;
|
|
4
|
+
export declare function clampSize(value: number): number;
|
|
5
|
+
export declare function clampStageSize(value: number, scale: number): number;
|
|
6
|
+
export declare function isLayoutEditable(element: EditableElement | undefined): boolean;
|
|
7
|
+
export declare function isManipulable(element: EditableElement | undefined): boolean;
|
|
8
|
+
export declare function unionStageRects(rects: StageRect[]): StageRect;
|
|
9
|
+
export declare function getRotationDeltaDegrees(pointerX: number, pointerY: number, centerX: number, centerY: number): number;
|
|
10
|
+
export declare function createResizedStageRect({ resizeCorner, scale, stageDeltaX, stageDeltaY, startStageRect, }: {
|
|
11
|
+
resizeCorner: ResizeHandleCorner | null;
|
|
12
|
+
scale: number;
|
|
13
|
+
stageDeltaX: number;
|
|
14
|
+
stageDeltaY: number;
|
|
15
|
+
startStageRect: StageRect;
|
|
16
|
+
}): StageRect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AtomicSlideOperation, type ElementLayoutStyleSnapshot, type ElementLayoutUpdateOperation } from "../../core";
|
|
2
|
+
import type { ManipulationSession } from "./block-manipulation-types";
|
|
3
|
+
export declare function applyLayoutSnapshot(node: HTMLElement, snapshot: ElementLayoutStyleSnapshot): void;
|
|
4
|
+
export declare function createLayoutUpdateOperations(session: ManipulationSession): ElementLayoutUpdateOperation[];
|
|
5
|
+
export declare function toLayoutCommitOperation(session: ManipulationSession, operations: ElementLayoutUpdateOperation[]): ElementLayoutUpdateOperation | {
|
|
6
|
+
type: "operation.batch";
|
|
7
|
+
slideId: string;
|
|
8
|
+
operations: AtomicSlideOperation[];
|
|
9
|
+
timestamp: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditableElement, StageRect } from "../../core";
|
|
2
|
+
import type { SnapGuide } from "../lib/block-snap-types";
|
|
3
|
+
import type { BlockManipulationOverlay } from "./block-manipulation-types";
|
|
4
|
+
export declare function createBlockManipulationOverlay({ isEditingText, isManipulating, selectedElement, selectedElementId, snapGuides, stageRect, }: {
|
|
5
|
+
isEditingText: boolean;
|
|
6
|
+
isManipulating: boolean;
|
|
7
|
+
selectedElement: EditableElement | undefined;
|
|
8
|
+
selectedElementId: string | null;
|
|
9
|
+
snapGuides: SnapGuide[];
|
|
10
|
+
stageRect: StageRect | null;
|
|
11
|
+
}): BlockManipulationOverlay | null;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { EditableElement, ElementLayoutStyleSnapshot, ElementLayoutUpdateOperation, SlideBatchOperation, SlideModel, StageGeometry, StageRect } from "../../core";
|
|
3
|
+
import type { ResizeHandleCorner, SnapGuide, SnapTarget } from "../lib/block-snap-types";
|
|
4
|
+
export type ManipulationMode = "move" | "resize" | "rotate";
|
|
5
|
+
export interface BlockManipulationOverlay {
|
|
6
|
+
selectionBounds: StageRect;
|
|
7
|
+
snapGuides: SnapGuide[];
|
|
8
|
+
resizeHandles: Array<{
|
|
9
|
+
corner: ResizeHandleCorner;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}>;
|
|
13
|
+
rotationHandle: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ManipulationSession {
|
|
19
|
+
slideId: string;
|
|
20
|
+
elementId: string;
|
|
21
|
+
elementIds: string[];
|
|
22
|
+
mode: ManipulationMode;
|
|
23
|
+
resizeCorner: ResizeHandleCorner | null;
|
|
24
|
+
startPointer: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
startStageRect: StageRect;
|
|
29
|
+
centerPoint: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
previousStyle: ElementLayoutStyleSnapshot;
|
|
34
|
+
previousStyles: Record<string, ElementLayoutStyleSnapshot>;
|
|
35
|
+
startElementStageRects: Record<string, StageRect>;
|
|
36
|
+
resizeParentElementIds: Record<string, string | null>;
|
|
37
|
+
startParentStageRects: Record<string, StageRect>;
|
|
38
|
+
targetNodes: Record<string, HTMLElement>;
|
|
39
|
+
snapTargets: {
|
|
40
|
+
vertical: SnapTarget[];
|
|
41
|
+
horizontal: SnapTarget[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface UseBlockManipulationOptions {
|
|
45
|
+
activeSlide: SlideModel | undefined;
|
|
46
|
+
selectedElement: EditableElement | undefined;
|
|
47
|
+
selectedElementId: string | null;
|
|
48
|
+
selectedElementIds: string[];
|
|
49
|
+
selectedStageRect: StageRect | null;
|
|
50
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
51
|
+
stageGeometry: StageGeometry;
|
|
52
|
+
isEditingText: boolean;
|
|
53
|
+
onCommitOperation: (operation: ElementLayoutUpdateOperation | SlideBatchOperation) => void;
|
|
54
|
+
}
|
|
55
|
+
export interface UseBlockManipulationResult {
|
|
56
|
+
manipulationOverlay: BlockManipulationOverlay | null;
|
|
57
|
+
isManipulating: boolean;
|
|
58
|
+
suppressBackgroundClear: boolean;
|
|
59
|
+
beginMove: (event: PointerStartLike, targetElementId?: string) => void;
|
|
60
|
+
beginResize: (corner: ResizeHandleCorner, event: PointerStartLike) => void;
|
|
61
|
+
beginRotate: (event: PointerStartLike) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface PointerStartLike {
|
|
64
|
+
clientX: number;
|
|
65
|
+
clientY: number;
|
|
66
|
+
sourceWindow?: Window | null;
|
|
67
|
+
toStagePoint?: (clientX: number, clientY: number) => {
|
|
68
|
+
x: number;
|
|
69
|
+
y: number;
|
|
70
|
+
};
|
|
71
|
+
preventDefault: () => void;
|
|
72
|
+
stopPropagation: () => void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { SlideModel } from "../../core";
|
|
3
|
+
import type { SlideRect } from "./editor-keyboard-types";
|
|
4
|
+
export declare function roundCssNumber(value: number): number;
|
|
5
|
+
export declare function placeCopiedElement(elementHtml: string, rect: SlideRect): string;
|
|
6
|
+
export declare function elementRectToSlideRect(elementRect: DOMRect, rootRect: DOMRect): SlideRect;
|
|
7
|
+
export declare function getSlideBounds(iframeRef: RefObject<HTMLIFrameElement | null>, activeSlide: SlideModel, fallback: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}): {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function offsetSlideRect(rect: SlideRect, offsetX: number, offsetY: number): SlideRect;
|
|
15
|
+
export declare function getUnionRect(rects: SlideRect[]): SlideRect | null;
|
|
16
|
+
export declare function getClampedPasteDelta(sourceRect: SlideRect, preferredOffset: number, slide: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}): {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AtomicSlideOperation, EditableElement, SlideOperation } from "../../core";
|
|
2
|
+
export declare const ARROW_DELTAS: Record<string, {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function isEditableElementTarget(target: EventTarget | null): boolean;
|
|
7
|
+
export declare function isLayoutEditable(element: EditableElement | undefined): boolean;
|
|
8
|
+
export declare function getShortcutStep(event: KeyboardEvent): number;
|
|
9
|
+
export declare function createIdMapForCopiedElement(html: string, sourceElementId: string, nextElementId: string): Record<string, string>;
|
|
10
|
+
export declare function commitOperations(slideId: string, operations: AtomicSlideOperation[], onCommitOperation: (operation: SlideOperation) => void): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { ElementInsertOperation, ElementLayoutUpdateOperation, ElementRemoveOperation, SlideModel, SlideOperation } from "../../core";
|
|
3
|
+
export interface ClipboardPayload {
|
|
4
|
+
elements: Array<{
|
|
5
|
+
sourceElementId: string;
|
|
6
|
+
html: string;
|
|
7
|
+
rect: SlideRect;
|
|
8
|
+
parentElementId: string | null;
|
|
9
|
+
previousSiblingElementId: string | null;
|
|
10
|
+
nextSiblingElementId: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
unionRect: SlideRect;
|
|
13
|
+
}
|
|
14
|
+
export interface SlideRect {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
export interface UseEditorKeyboardShortcutsOptions {
|
|
21
|
+
activeSlide: SlideModel | undefined;
|
|
22
|
+
selectedElementIds: string[];
|
|
23
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
24
|
+
slideWidth: number;
|
|
25
|
+
slideHeight: number;
|
|
26
|
+
isEditingText: boolean;
|
|
27
|
+
canUndo: boolean;
|
|
28
|
+
canRedo: boolean;
|
|
29
|
+
onEscapeSelection: () => boolean;
|
|
30
|
+
onNavigateSlide: (direction: "previous" | "next") => boolean;
|
|
31
|
+
onCommitOperation: (operation: ElementInsertOperation | ElementLayoutUpdateOperation | ElementRemoveOperation | SlideOperation) => void;
|
|
32
|
+
onSelectElementIds: (elementIds: string[]) => void;
|
|
33
|
+
onUndo: () => void;
|
|
34
|
+
onRedo: () => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function nextSingleSelection(value: string | null): string[];
|
|
2
|
+
export declare function ensureSelectionContainsTarget(currentIds: string[], targetId: string): string[];
|
|
3
|
+
export declare function clearSelectionForEscape({ selectedElementIds, activeGroupScopeId, }: {
|
|
4
|
+
selectedElementIds: string[];
|
|
5
|
+
activeGroupScopeId: string | null;
|
|
6
|
+
}): {
|
|
7
|
+
handled: boolean;
|
|
8
|
+
nextSelection: string[];
|
|
9
|
+
exitGroupScope: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function getEditableSelectionTarget(target: Element): HTMLElement | null;
|
|
2
|
+
export declare function getDeepestEditableElementFromPoint(doc: Document, x: number, y: number, activeGroupScopeId: string | null): HTMLElement | null;
|
|
3
|
+
export declare function applyGroupScopeFocus(doc: Document, activeGroupScopeId: string | null): void;
|
|
4
|
+
export declare function getEditableSelectionTargetInScope(target: Element, activeGroupScopeId: string | null): HTMLElement | null;
|
|
5
|
+
export declare function ensureEditingTextStyle(doc: Document): void;
|
|
6
|
+
export declare function selectEditableNodeEnd(editableNode: HTMLElement): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Dispatch, RefObject, SetStateAction } from "react";
|
|
2
|
+
import type { SlideModel, TextUpdateOperation } from "../../core";
|
|
3
|
+
export interface TextEditingState {
|
|
4
|
+
slideId: string;
|
|
5
|
+
elementId: string;
|
|
6
|
+
initialText: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UseIframeTextEditingOptions {
|
|
9
|
+
activeSlide: SlideModel | undefined;
|
|
10
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
11
|
+
onCommitOperation: (operation: TextUpdateOperation) => void;
|
|
12
|
+
onOpenSelectionContextMenu?: (clientX: number, clientY: number) => void;
|
|
13
|
+
onStageWheel?: (event: WheelEvent) => void;
|
|
14
|
+
onBeginPointerMove?: (elementId: string, clientX: number, clientY: number, pointerOptions?: {
|
|
15
|
+
sourceWindow?: Window | null;
|
|
16
|
+
toStagePoint?: (clientX: number, clientY: number) => {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
}) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface UseIframeTextEditingResult {
|
|
23
|
+
selectedElementId: string | null;
|
|
24
|
+
selectedElementIds: string[];
|
|
25
|
+
preselectedElementId: string | null;
|
|
26
|
+
activeGroupScopeId: string | null;
|
|
27
|
+
isEditingText: boolean;
|
|
28
|
+
setSelectedElementId: Dispatch<SetStateAction<string | null>>;
|
|
29
|
+
setSelectedElementIds: Dispatch<SetStateAction<string[]>>;
|
|
30
|
+
beginTextEditing: (elementId: string) => void;
|
|
31
|
+
beginGroupEditingScope: (elementId: string) => void;
|
|
32
|
+
exitGroupEditingScope: () => void;
|
|
33
|
+
clearSelection: () => boolean;
|
|
34
|
+
clearPreselection: () => void;
|
|
35
|
+
updatePointerPreselection: (clientX: number, clientY: number) => string | null;
|
|
36
|
+
retargetPointerSelection: (clientX: number, clientY: number, additive: boolean) => string | null;
|
|
37
|
+
openPointerSelectionContextMenu: (clientX: number, clientY: number) => boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { type ElementInsertOperation, type ElementRemoveOperation, type SlideModel } from "../../core";
|
|
3
|
+
import { commitOperations } from "./editor-keyboard-operations";
|
|
4
|
+
import type { ClipboardPayload } from "./editor-keyboard-types";
|
|
5
|
+
export declare function copyObjectSelection({ slide, selectedElementIds, iframeRef, }: {
|
|
6
|
+
slide: SlideModel | undefined;
|
|
7
|
+
selectedElementIds: string[];
|
|
8
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
9
|
+
}): ClipboardPayload | null;
|
|
10
|
+
export declare function createRemoveObjectSelectionOperations({ slide, selectedElementIds, }: {
|
|
11
|
+
slide: SlideModel | undefined;
|
|
12
|
+
selectedElementIds: string[];
|
|
13
|
+
}): ElementRemoveOperation[];
|
|
14
|
+
export declare function createPasteObjectSelection({ slide, payload, iframeRef, slideSize, }: {
|
|
15
|
+
slide: SlideModel | undefined;
|
|
16
|
+
payload: ClipboardPayload | null;
|
|
17
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
18
|
+
slideSize: {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
22
|
+
}): {
|
|
23
|
+
operations: ElementInsertOperation[];
|
|
24
|
+
selectedElementIds: string[];
|
|
25
|
+
nextClipboard: ClipboardPayload;
|
|
26
|
+
nextHtmlSource: string;
|
|
27
|
+
} | null;
|
|
28
|
+
export declare function commitObjectOperations(slideId: string, operations: ElementInsertOperation[] | ElementRemoveOperation[], onCommitOperation: Parameters<typeof commitOperations>[2]): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { UseBlockManipulationOptions, UseBlockManipulationResult } from "./block-manipulation-types";
|
|
2
|
+
declare function useBlockManipulation({ activeSlide, selectedElement, selectedElementId, selectedElementIds, selectedStageRect, iframeRef, stageGeometry, isEditingText, onCommitOperation, }: UseBlockManipulationOptions): UseBlockManipulationResult;
|
|
3
|
+
export { useBlockManipulation };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { UseEditorKeyboardShortcutsOptions } from "./editor-keyboard-types";
|
|
2
|
+
declare function useEditorKeyboardShortcuts({ activeSlide, selectedElementIds, iframeRef, slideWidth, slideHeight, isEditingText, canUndo, canRedo, onEscapeSelection, onNavigateSlide, onCommitOperation, onSelectElementIds, onUndo, onRedo, }: UseEditorKeyboardShortcutsOptions): void;
|
|
3
|
+
export { useEditorKeyboardShortcuts };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { UseIframeTextEditingOptions, UseIframeTextEditingResult } from "./iframe-text-editing-types";
|
|
2
|
+
declare function useIframeTextEditing({ activeSlide, iframeRef, onCommitOperation, onOpenSelectionContextMenu, onStageWheel, onBeginPointerMove, }: UseIframeTextEditingOptions): UseIframeTextEditingResult;
|
|
3
|
+
export { useIframeTextEditing };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SlideModel, type SlideOperation } from "../../core";
|
|
2
|
+
interface SlideHistoryResult {
|
|
3
|
+
slides: SlideModel[];
|
|
4
|
+
activeSlide: SlideModel | undefined;
|
|
5
|
+
activeSlideId: string;
|
|
6
|
+
undoDepth: number;
|
|
7
|
+
redoDepth: number;
|
|
8
|
+
setActiveSlideId: (slideId: string) => void;
|
|
9
|
+
commitOperation: (operation: SlideOperation) => SlideModel[];
|
|
10
|
+
runUndo: () => void;
|
|
11
|
+
runRedo: () => void;
|
|
12
|
+
}
|
|
13
|
+
interface UseSlideHistoryOptions {
|
|
14
|
+
onSlidesChange?: (slides: SlideModel[]) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function useSlideHistory(loadedSlides: SlideModel[], options?: UseSlideHistoryOptions): SlideHistoryResult;
|
|
17
|
+
export { useSlideHistory };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { type EditableElement, type SlideModel, type StageRect } from "../../core";
|
|
3
|
+
import { type CssPropertyRow } from "../lib/collect-css-properties";
|
|
4
|
+
interface UseSlideInspectorOptions {
|
|
5
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
6
|
+
activeSlide: SlideModel | undefined;
|
|
7
|
+
selectedElement: EditableElement | undefined;
|
|
8
|
+
selectedElementIds: string[];
|
|
9
|
+
preselectedElementId: string | null;
|
|
10
|
+
scale: number;
|
|
11
|
+
offsetX: number;
|
|
12
|
+
offsetY: number;
|
|
13
|
+
slideWidth: number;
|
|
14
|
+
slideHeight: number;
|
|
15
|
+
}
|
|
16
|
+
interface SlideInspectorResult {
|
|
17
|
+
selectedStageRect: StageRect | null;
|
|
18
|
+
preselectionOverlay: StageRect | null;
|
|
19
|
+
selectionOverlay: StageRect | null;
|
|
20
|
+
selectionLabel: string;
|
|
21
|
+
inspectedStyles: CssPropertyRow[];
|
|
22
|
+
}
|
|
23
|
+
declare function useSlideInspector({ iframeRef, activeSlide, selectedElement, selectedElementIds, preselectedElementId, scale, offsetX, offsetY, slideWidth, slideHeight, }: UseSlideInspectorOptions): SlideInspectorResult;
|
|
24
|
+
export { useSlideInspector };
|