import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-JdJYB16L.js'; export { a7 as Adaptor, a5 as ArrayField, B as ArrayState, ak as AsFieldProps, N as BaseData, $ as BaseField, Z as ComponentDataMap, X as ComponentDataOptionalId, _ as Content, ab as CustomField, aa as CustomFieldRender, ah as DefaultComponentProps, K as DefaultComponents, ae as DefaultRootFieldProps, ag as DefaultRootProps, af as DefaultRootRenderProps, o as Direction, p as DragAxis, a9 as ExternalField, a8 as ExternalFieldWithAdaptor, L as ExtractConfigParams, am as ExtractField, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, Y as MappedItem, a1 as NumberField, a6 as ObjectField, x as OverrideKey, G as PuckComponent, ad as PuckContext, a4 as RadioField, J as RootConfig, T as RootData, Q as RootDataWithoutProps, a3 as SelectField, S as Slot, E as SlotComponent, ac as SlotField, a0 as TextField, a2 as TextareaField, q as Viewport, al as WithChildren, ai as WithId, aj as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-JdJYB16L.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react'; type HistorySlice = { index: number; hasPast: () => boolean; hasFuture: () => boolean; histories: History[]; record: (data: D) => void; back: VoidFunction; forward: VoidFunction; currentHistory: () => History; nextHistory: () => History | null; prevHistory: () => History | null; setHistories: (histories: History[]) => void; setHistoryIndex: (index: number) => void; initialAppState: D; }; type NodeMethods = { sync: () => void; hideOverlay: () => void; showOverlay: () => void; }; type PuckNodeInstance = { id: string; methods: NodeMethods; element: HTMLElement | null; }; type NodesSlice = { nodes: Record; registerNode: (id: string, node: Partial) => void; unregisterNode: (id: string, node?: Partial) => void; }; type PermissionsArgs = UserGenerics> = { item?: G["UserComponentData"] | null; type?: keyof G["UserProps"]; root?: boolean; }; type GetPermissions = (params?: PermissionsArgs) => Permissions; type ResolvePermissions = (params?: PermissionsArgs, force?: boolean) => void; type RefreshPermissions = (params?: PermissionsArgs, force?: boolean) => void; type Cache = Record; lastData: ComponentData | null; }>; type PermissionsSlice = { cache: Cache; globalPermissions: Permissions; resolvedPermissions: Record | undefined>; getPermissions: GetPermissions; resolvePermissions: ResolvePermissions; refreshPermissions: RefreshPermissions; }; type ComponentOrRootData = Omit, "type">; type FieldsSlice = { fields: Fields | Partial; loading: boolean; lastResolvedData: Partial; id: string | undefined; }; type Status = "LOADING" | "MOUNTED" | "READY"; type ZoomConfig = { autoZoom: number; rootHeight: number; zoom: number; }; type ComponentState = Record; type AppStore = UserGenerics> = { state: G["UserAppState"]; dispatch: (action: PuckAction) => void; config: UserConfig; componentState: ComponentState; setComponentState: (componentState: ComponentState) => void; setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void; unsetComponentLoading: (id: string) => void; pendingLoadTimeouts: Record; resolveComponentData: (componentData: T, trigger: ResolveDataTrigger) => Promise<{ node: T; didChange: boolean; }>; resolveAndCommitData: () => void; plugins: Plugin[]; overrides: Partial; viewports: Viewports; zoomConfig: ZoomConfig; setZoomConfig: (zoomConfig: ZoomConfig) => void; status: Status; setStatus: (status: Status) => void; iframe: IframeConfig; selectedItem?: G["UserData"]["content"][0] | null; setUi: (ui: Partial, recordHistory?: boolean) => void; getComponentConfig: (type?: string) => ComponentConfig | null | undefined; onAction?: (action: PuckAction, newState: AppState, state: AppState) => void; metadata: Metadata; fields: FieldsSlice; history: HistorySlice; nodes: NodesSlice; permissions: PermissionsSlice; fieldTransforms: FieldTransforms; }; declare const ActionBar: { ({ label, children, }: { label?: string; children?: ReactNode; }): react_jsx_runtime.JSX.Element; Action: ({ children, label, onClick, }: { children: ReactNode; label?: string; onClick: (e: SyntheticEvent) => void; }) => react_jsx_runtime.JSX.Element; Label: ({ label }: { label: string; }) => react_jsx_runtime.JSX.Element; Group: ({ children }: { children: ReactNode; }) => react_jsx_runtime.JSX.Element; }; declare const Action: ({ children, label, onClick, }: { children: ReactNode; label?: string; onClick: (e: SyntheticEvent) => void; }) => react_jsx_runtime.JSX.Element; declare const Group: ({ children }: { children: ReactNode; }) => react_jsx_runtime.JSX.Element; declare const Label: ({ label }: { label: string; }) => react_jsx_runtime.JSX.Element; declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: { children?: ReactNode; icon?: ReactNode; label: string; el?: "label" | "div"; readOnly?: boolean; className?: string; }) => react_jsx_runtime.JSX.Element; type FieldNoLabel = Omit, "label">; declare function AutoField = FieldNoLabel>(props: FieldProps): react_jsx_runtime.JSX.Element | null; declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: { children: ReactNode; href?: string; onClick?: (e: any) => void | Promise; variant?: "primary" | "secondary"; type?: "button" | "submit" | "reset"; disabled?: boolean; tabIndex?: number; newTab?: boolean; fullWidth?: boolean; icon?: ReactNode; size?: "medium" | "large"; loading?: boolean; }) => react_jsx_runtime.JSX.Element; declare const Drawer: { ({ children, droppableId, direction, }: { children: ReactNode; droppableId?: string; direction?: "vertical" | "horizontal"; }): react_jsx_runtime.JSX.Element; Item: ({ name, children, id, label, index, isDragDisabled, }: { name: string; children?: (props: { children: ReactNode; name: string; }) => ReactElement; id?: string; label?: string; index?: number; isDragDisabled?: boolean; }) => react_jsx_runtime.JSX.Element; }; declare const DropZone: react.ForwardRefExoticComponent>; declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: { children: ReactNode; href?: string; onClick?: (e: SyntheticEvent) => void | Promise; variant?: "primary" | "secondary"; type?: "button" | "submit" | "reset"; disabled?: boolean; tabIndex?: number; newTab?: boolean; fullWidth?: boolean; title: string; }) => react_jsx_runtime.JSX.Element; type PuckProps = UserGenerics> = { children?: ReactNode; config: UserConfig; data: Partial; ui?: Partial; onChange?: (data: G["UserData"]) => void; onPublish?: (data: G["UserData"]) => void; onAction?: OnAction; permissions?: Partial; plugins?: Plugin[]; overrides?: Partial>; fieldTransforms?: FieldTransforms; renderHeader?: (props: { children: ReactNode; dispatch: (action: PuckAction) => void; state: G["UserAppState"]; }) => ReactElement; renderHeaderActions?: (props: { state: G["UserAppState"]; dispatch: (action: PuckAction) => void; }) => ReactElement; headerTitle?: string; headerPath?: string; viewports?: Viewports; iframe?: IframeConfig; dnd?: { disableAutoScroll?: boolean; }; initialHistory?: InitialHistory; metadata?: Metadata; }; declare function Puck = UserGenerics>(props: PuckProps): react_jsx_runtime.JSX.Element; declare namespace Puck { var Components: () => react_jsx_runtime.JSX.Element; var Fields: react.MemoExoticComponent<({ wrapFields }: { wrapFields?: boolean; }) => react_jsx_runtime.JSX.Element>; var Outline: () => react_jsx_runtime.JSX.Element; var Preview: ({ id }: { id?: string; }) => react_jsx_runtime.JSX.Element; } declare const renderContext: react__default.Context<{ config: Config; data: Data; metadata: Metadata; }>; declare function Render = UserGenerics>({ config, data, metadata, }: { config: UserConfig; data: Partial; metadata?: Metadata; }): react_jsx_runtime.JSX.Element; declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: { disableDrag?: boolean; disableDragOnFocus?: boolean; }) => (() => void) | undefined; /** * Helper function to set a value based on a dot-notated path */ declare function setDeep>(node: T, path: string, newVal: any): T; type UsePuckData = UserGenerics> = { appState: G["UserPublicAppState"]; config: UserConfig; dispatch: AppStore["dispatch"]; getPermissions: GetPermissions; refreshPermissions: RefreshPermissions; selectedItem: G["UserComponentData"] | null; getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined; getItemById: (id: string) => G["UserComponentData"] | undefined; getSelectorForId: (id: string) => Required | undefined; history: { back: HistorySlice["back"]; forward: HistorySlice["forward"]; setHistories: HistorySlice["setHistories"]; setHistoryIndex: HistorySlice["setHistoryIndex"]; histories: HistorySlice["histories"]; index: HistorySlice["index"]; hasPast: boolean; hasFuture: boolean; }; }; type PuckApi = UsePuckData; type UsePuckStore = PuckApi; /** * createUsePuck * * Create a typed usePuck hook, which is necessary because the user may provide a generic type but not * a selector type, and TS does not currently support partial inference. * Related: https://github.com/microsoft/TypeScript/issues/26242 * * @returns a typed usePuck function */ declare function createUsePuck(): >(selector: (state: UsePuckStore) => T) => T; declare function usePuck(): UsePuckStore; /** * Get the latest state without relying on a render * * @returns PuckApi */ declare function useGetPuck(): () => UsePuckStore; export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };