///
import Plain from 'slate-plain-serializer';
import * as React_2 from 'react';
import { v4 as uuid } from 'uuid';
import { Value } from 'slate';
export declare const Admin: React_2.FC;
export declare const AdminContext: React_2.Context;
export declare const AppSettings: React_2.FC;
export declare const cleanPage: (page: types.Page, pageTypeSchema: types.IPageType[], blockTypeSchema: types.IBlockType[]) => types.Page;
export declare const Editor: React_2.FC;
export declare const fetchPage: (slug: string, apiKey: string) => Promise;
export declare const fetchPages: (apiKey: string, { type, tag }?: {
type?: string | undefined;
tag?: string | undefined;
}) => Promise;
export declare const getPagePlainText: (blocks: types.IContentBlock[]) => string[];
export declare const getPlainText: (value: Value) => string;
export declare const Header: React_2.FC;
declare const Image_2: React_2.FC;
export { Image_2 as Image }
declare interface IProps {
appId: string;
apiKey: string;
blockTypeSchema?: types.IBlockType[];
pageTypeSchema?: types.IPageType[];
logo?: string;
contentClassName?: string;
renderLocalLink: types.RenderLocalLink;
navigate: (path: string) => void;
loginPath: string;
editorPath: string;
playgroundPath: string;
appSettingsPath: string;
}
declare interface IProps_2 {
isLogin?: boolean;
}
declare interface IProps_3 {
logo?: string;
renderMenu?: () => React_2.ReactElement;
}
declare interface IProps_4 {
page: types.Page | null | undefined;
}
declare interface IProps_5 {
renderBlock: React_2.FC;
value: Value;
placeholder: string;
propName: string;
onChange(field: string, value: Value): void;
}
declare interface IProps_6 {
renderBlock: React_2.FC;
allowedFeatures?: types.RichTextFeatures[];
value: Value;
placeholder: string;
renderBold?: React_2.FC;
renderItalic?: React_2.FC;
renderHighlight?: React_2.FC;
renderCode?: React_2.FC;
renderLink?: React_2.FC;
renderUL?: React_2.FC;
renderOL?: React_2.FC;
renderLI?: React_2.FC;
propName: string;
onChange(field: string, value: Value): void;
}
declare interface IProps_7 {
source: types.IImageSource;
alt: string;
maxWidth?: number;
noLazyLoad?: boolean;
propName: string;
onChange: (field: string, source: types.IImageSource) => void;
containerClassName?: string;
imageClassName?: string;
}
declare interface IProps_8 {
href: string;
target?: string;
}
export declare const Link: React_2.FC;
export declare const Login: React_2.FC;
export declare const PageViewer: React_2.FC;
export { Plain }
export declare const Playground: () => JSX.Element;
export declare const ReactBricks: React_2.FC;
export declare const ReactBricksContext: React_2.Context;
export declare const RichText: React_2.FC;
declare const Text_2: React_2.FC;
export { Text_2 as Text }
export declare namespace types {
export enum BlockSuperType {
Single = "SINGLE",
Repeater = "REPEATER"
}
export enum SideEditPropType {
Text = "TEXT",
Number = "NUMBER",
Date = "DATE",
Range = "RANGE",
Boolean = "BOOLEAN",
Select = "SELECT",
Image = "IMAGE"
}
export enum RichTextFeatures {
Bold = "BOLD",
Italic = "ITALIC",
Code = "CODE",
Highlight = "HIGHLIGHT",
Link = "LINK",
UnorderedList = "UL",
OrderedList = "OL"
}
export enum SortDirection {
Up = "UP",
Down = "DOWN"
}
export enum OptionsDisplay {
Select = "SELECT",
Radio = "RADIO",
Color = "COLOR"
}
export enum PageStatus {
Draft = "DRAFT",
Published = "PUBLISHED"
}
export enum PlaygroundSelectedItemType {
Block = "BLOCK",
Page = "PAGE"
}
export type User = {
email: string;
firstName: string;
lastName: string;
isAdmin: boolean;
token: string;
appName: string;
deployHookUrl?: string;
deployHookMethod: string;
} | null;
export type Page = {
id: string;
type: string;
name: string;
slug: string;
meta: IMeta;
content: IContentBlock[];
invalidBlocksTypes?: string[];
status: PageStatus;
isLocked: boolean;
tags: string[];
};
export type PageFromList = Omit;
export type RenderLocalLink = ({ href, target, className, activeClassName, isAdmin, children, }: {
href: string;
target?: string;
className?: string;
activeClassName?: string;
isAdmin?: boolean;
children: React.ReactNode;
}) => React.ReactElement;
export type TextValue = Value;
export type Props = {
[key: string]: any;
};
export interface IBlockType {
name: string;
label: string;
superType: BlockSuperType;
render: (props: Props) => React.ReactElement;
getDefaultProps: () => object;
hideFromAddMenu?: boolean;
sideEditProps?: ISideEditProp[];
textEditProps?: string[];
itemsType?: string;
addItemText?: string;
removeItemText?: string;
}
export interface IContentBlock {
id: string;
type: string;
props: Props;
}
export interface IOption {
value: any;
label: string;
}
export interface ISideEditProp {
name: string;
label: string;
type: SideEditPropType;
validate?: (value: any, props?: Props) => boolean;
show?: (props: Props) => boolean;
imageOptions?: {
maxWidth: number;
};
rangeOptions?: {
min: number;
max: number;
step: number;
};
selectOptions?: {
options?: IOption[];
getOptions?: () => IOption[] | Promise;
display: OptionsDisplay;
};
}
export interface IFocused {
blockId: string;
itemId: string;
}
export interface IImageSource {
src: string;
placeholderSrc?: string;
srcSet?: string;
}
export interface IPageType {
name: string;
pluralName: string;
allowedBlockTypes?: string[];
excludedBlockTypes?: string[];
defaultLocked?: boolean;
defaultStatus?: PageStatus;
defaultLanguage?: string;
getDefaultContent?: () => IContentBlock[];
}
export interface ICleanBlocks {
blocks: IContentBlock[];
invalidBlocksTypes: string[];
}
export interface ILoginCredentials {
email: string;
password: string;
appId: string;
}
export interface IReactBricksContext {
appId: string;
apiKey: string;
blockTypeSchema: IBlockType[];
pageTypeSchema: IPageType[];
logo: string;
contentClassName: string;
renderLocalLink: RenderLocalLink;
navigate: (path: string) => void;
loginPath: string;
editorPath: string;
playgroundPath: string;
appSettingsPath: string;
}
export interface IAdminContext {
isAdmin: boolean;
user: User | null;
setUser: (user: User) => void;
currentPage: string;
setCurrentPage: (page: string) => void;
previewMode: boolean;
setPreviewMode: (previewMode: boolean) => void;
sidebarCollapsed: boolean;
setSidebarCollapsed: (sidebarCollapsed: boolean) => void;
getStyles: () => NodeListOf | [];
getStylesheets: () => NodeListOf | [];
}
export interface INewPage {
id?: string;
type: string;
name: string;
slug?: string;
meta?: IMeta;
content?: IContentBlock[];
status?: PageStatus;
isLocked?: boolean;
}
export interface IPlaygroundSelectedItem {
type: PlaygroundSelectedItemType;
name: string;
label: string;
}
export interface IPlaygroundContext {
selectedItem: IPlaygroundSelectedItem | null;
setSelectedItem: (selectedItem: any) => void;
}
export interface IMeta {
title?: string;
description?: string;
language?: string;
}
}
export declare const useAuth: () => {
loginUser: (email: string, password: string) => Promise;
logoutUser: () => void;
};
export declare const usePage: (pageId: string) => any;
export declare const usePagePublic: (slug: string) => any;
export declare const usePages: ({ type, tag }?: {
type?: string | undefined;
tag?: string | undefined;
}) => any;
export declare const usePagesPublic: ({ type, tag, }?: {
type?: string | undefined;
tag?: string | undefined;
}) => any;
export { uuid }
export { }