import { type ReactNode } from "react"; import type { Presentation, PresentationElement, PresentationPosition, Slide } from "@opengeni/artifact-tool/reference"; type PresentationObject = PresentationElement; export type PresentationCommit = { kind: "slide-insert"; slideId: string; index: number; revision?: string | number; } | { kind: "slide-delete"; slideId: string; index: number; revision?: string | number; } | { kind: "object-insert"; slideId: string; objectId: string; index: number; position: PresentationPosition; revision?: string | number; } | { kind: "object-delete"; slideId: string; objectId: string; revision?: string | number; } | { kind: "move" | "resize"; slideId: string; objectId: string; before: PresentationPosition; after: PresentationPosition; revision?: string | number; } | { kind: "text"; slideId: string; objectId: string; before: string; after: string; revision?: string | number; }; export type PresentationCommitHandler = ((commit: PresentationCommit) => void) | ((commit: PresentationCommit) => Promise); export type PresentationProjectionPosition = Readonly<{ left: number; top: number; width: number; height: number; }>; export type PresentationProjectionFill = string | Readonly<{ type?: "solid"; color: string; }>; export type PresentationProjectionLine = Readonly<{ style?: "solid" | "dash" | "dot" | "none"; fill?: PresentationProjectionFill; width?: number; }>; export type PresentationProjectionTextStyle = Readonly<{ fontFamily?: string; fontSize?: number; bold?: boolean; italic?: boolean; underline?: boolean; color?: string; alignment?: "left" | "center" | "right" | "justify"; verticalAlignment?: "top" | "middle" | "bottom"; }>; export type PresentationProjectionTextRun = Readonly<{ text: string; style: PresentationProjectionTextStyle; language?: string | null; }>; export type PresentationProjectionTextParagraph = Readonly<{ runs: readonly PresentationProjectionTextRun[]; alignment: "left" | "center" | "right" | "justify"; }>; export type PresentationProjectionRichText = Readonly<{ paragraphs: readonly PresentationProjectionTextParagraph[]; verticalAlignment: "top" | "middle" | "bottom"; }>; export type PresentationProjectionElementMetadata = Readonly<{ nodeSource?: Readonly<{ kind: "master" | "layout" | "slide"; id: string; }>; inherited?: boolean; parentId?: string | null; order?: number; /** Inherited master/layout nodes remain visible but cannot be edited in slide mode. */ readOnly?: boolean; }>; export type PresentationProjectionShape = Readonly<{ kind: "shape"; id: string; name: string; geometry: "textbox" | "rect" | "roundRect" | "ellipse" | "triangle" | "rightArrow" | "line"; position: PresentationProjectionPosition; fill?: PresentationProjectionFill; line?: PresentationProjectionLine; rotation?: number; borderRadius?: number | string; text: string; textStyle?: PresentationProjectionTextStyle; richText?: PresentationProjectionRichText; }> & PresentationProjectionElementMetadata; export type PresentationProjectionChartSeries = Readonly<{ name: string; categories?: readonly string[]; values: readonly number[]; xValues?: readonly number[]; bubbleSizes?: readonly number[]; fill?: PresentationProjectionFill; line?: PresentationProjectionLine; }>; export type PresentationProjectionChart = Readonly<{ kind: "chart"; id: string; name: string; type: "bar" | "line" | "area" | "pie" | "doughnut" | "scatter" | "bubble" | "radar"; position: PresentationProjectionPosition; title?: string; titleRichText?: PresentationProjectionRichText; hasLegend?: boolean; series: readonly PresentationProjectionChartSeries[]; xAxis?: Readonly<{ visible?: boolean; title?: string; min?: number; max?: number; }>; yAxis?: Readonly<{ visible?: boolean; title?: string; min?: number; max?: number; }>; dataLabels?: Readonly<{ showValue?: boolean; showSeriesName?: boolean; showCategoryName?: boolean; showPercent?: boolean; position?: "center" | "inEnd" | "outEnd"; }>; }> & PresentationProjectionElementMetadata; export type PresentationProjectionImage = Readonly<{ kind: "image"; id: string; name: string; position: PresentationProjectionPosition; /** Host-resolved data/blob/same-origin URL. Arbitrary remote URLs are ignored. */ source?: string; alt?: string; prompt?: string; fit?: "contain" | "cover"; crop?: Readonly<{ left: number; top: number; right: number; bottom: number; }>; geometry?: "rect" | "roundRect" | "ellipse"; borderRadius?: number | string; rotation?: number; flipHorizontal?: boolean; flipVertical?: boolean; digest?: string; contentType?: string; intrinsicWidth?: number; intrinsicHeight?: number; }> & PresentationProjectionElementMetadata; export type PresentationProjectionTableCell = Readonly<{ text: string; richText?: PresentationProjectionRichText; fill?: PresentationProjectionFill; textStyle?: PresentationProjectionTextStyle; rowSpan?: number; colSpan?: number; }>; export type PresentationProjectionTable = Readonly<{ kind: "table"; id: string; name: string; position: PresentationProjectionPosition; rows: readonly (readonly (PresentationProjectionTableCell | null)[])[]; columnWidths?: readonly number[]; rowHeights?: readonly number[]; fill?: PresentationProjectionFill; line?: PresentationProjectionLine; textStyle?: PresentationProjectionTextStyle; }> & PresentationProjectionElementMetadata; export type PresentationProjectionGroup = Readonly<{ kind: "group"; id: string; name: string; position: PresentationProjectionPosition; childOffset: Readonly<{ left: number; top: number; }>; childExtent: Readonly<{ width: number; height: number; }>; rotation?: number; flipHorizontal?: boolean; flipVertical?: boolean; children: readonly PresentationProjectionElement[]; }> & PresentationProjectionElementMetadata; export type PresentationProjectionConnector = Readonly<{ kind: "connector"; id: string; name: string; connectorKind: "straight" | "elbow" | "curved"; position: PresentationProjectionPosition; start: Readonly<{ nodeId: string | null; x: number; y: number; }>; end: Readonly<{ nodeId: string | null; x: number; y: number; }>; line?: PresentationProjectionLine; }> & PresentationProjectionElementMetadata; export type PresentationProjectionElement = PresentationProjectionShape | PresentationProjectionChart | PresentationProjectionImage | PresentationProjectionTable | PresentationProjectionGroup | PresentationProjectionConnector; export type PresentationSlideProjection = Readonly<{ id: string; title?: string; background?: PresentationProjectionFill; elements: readonly PresentationProjectionElement[]; layout?: Readonly<{ id: string; name: string; masterId: string | null; background: PresentationProjectionFill; }> | null; notes?: PresentationProjectionRichText | null; }>; /** Immutable render/edit projection; the host keeps the canonical deck off the React thread. */ export type PresentationEditorProjection = Readonly<{ revision: string | number; slideSize: Readonly<{ width: number; height: number; }>; slides: readonly PresentationSlideProjection[]; }>; export type PresentationProjectionEditorProps = Omit & { projection: PresentationEditorProjection; commit?: PresentationCommitHandler | undefined; onCommandError?: ((error: Error) => void) | undefined; onSlideChange?: ((slide: PresentationSlideProjection, index: number) => void) | undefined; onSelectionChange?: ((object: PresentationProjectionElement | null, slide: PresentationSlideProjection) => void) | undefined; }; export type PresentationProjectionArtifactSurfaceProps = PresentationProjectionEditorProps & { title?: string | undefined; showHeader?: boolean | undefined; subtitle?: ReactNode | undefined; actions?: ReactNode | undefined; busy?: boolean | undefined; }; export type PresentationEditorProps = { presentation: Presentation; /** Increment/change after a host applies an out-of-band model mutation. */ revision?: string | number | undefined; activeSlideId?: string | undefined; defaultActiveSlideId?: string | undefined; selectedObjectId?: string | null | undefined; defaultSelectedObjectId?: string | null | undefined; zoom?: number | undefined; defaultZoom?: number | undefined; readOnly?: boolean | undefined; /** Temporarily fence commands while keeping the current editor draft. */ authoringBlockedReason?: "pending_conflict" | "prior_writer" | undefined; className?: string | undefined; onSlideChange?: ((slide: Slide, index: number) => void) | undefined; onSelectionChange?: ((object: PresentationObject | null, slide: Slide) => void) | undefined; onCommit?: PresentationCommitHandler | undefined; onCommandError?: ((error: Error) => void) | undefined; onZoomChange?: ((zoom: number) => void) | undefined; }; export type PresentationArtifactSurfaceProps = PresentationEditorProps & { title?: string | undefined; showHeader?: boolean | undefined; subtitle?: ReactNode | undefined; actions?: ReactNode | undefined; busy?: boolean | undefined; }; /** Compatibility adapter for the public authoring model. */ export declare function PresentationEditor(props: PresentationEditorProps): import("react").JSX.Element; /** * Projection-first editor. It creates only a disposable render view; all * durable mutations leave through the async command port. */ export declare function PresentationProjectionEditor({ projection, commit, onCommandError, onSlideChange, onSelectionChange, readOnly, ...props }: PresentationProjectionEditorProps): import("react").JSX.Element; /** Artifact chrome plus the editor, for drop-in SDK embedding. */ export declare function PresentationArtifactSurface({ presentation, title: titleProp, showHeader, subtitle, actions, busy, className, ...editorProps }: PresentationArtifactSurfaceProps): import("react").JSX.Element; /** Artifact chrome over the projection-first editor. */ export declare function PresentationProjectionArtifactSurface({ projection, title: titleProp, showHeader, subtitle, actions, busy, className, ...editorProps }: PresentationProjectionArtifactSurfaceProps): import("react").JSX.Element; export {};