@groovymedia/easy-email-editor 4.12.2-2
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/lib/assets/font/iconfont.d.ts +0 -0
- package/lib/components/EmailEditor/components/DesktopEmailPreview/index.d.ts +1 -0
- package/lib/components/EmailEditor/components/EditEmailPreview/components/MjmlDomRender.d.ts +1 -0
- package/lib/components/EmailEditor/components/EditEmailPreview/components/ShadowStyle.d.ts +1 -0
- package/lib/components/EmailEditor/components/EditEmailPreview/index.d.ts +1 -0
- package/lib/components/EmailEditor/components/MobileEmailPreview/index.d.ts +1 -0
- package/lib/components/EmailEditor/components/ToolsPanel/index.d.ts +1 -0
- package/lib/components/EmailEditor/index.d.ts +3 -0
- package/lib/components/IconFont/index.d.ts +9 -0
- package/lib/components/Provider/BlocksProvider/index.d.ts +21 -0
- package/lib/components/Provider/EmailEditorProvider/index.d.ts +11 -0
- package/lib/components/Provider/FocusBlockLayoutProvider/index.d.ts +7 -0
- package/lib/components/Provider/HoverIdxProvider/index.d.ts +29 -0
- package/lib/components/Provider/LanguageProvider/index.d.ts +5 -0
- package/lib/components/Provider/PreviewEmailProvider/index.d.ts +11 -0
- package/lib/components/Provider/PropsProvider/index.d.ts +55 -0
- package/lib/components/Provider/RecordProvider/index.d.ts +14 -0
- package/lib/components/Provider/ScrollProvider/index.d.ts +14 -0
- package/lib/components/RenderCount/index.d.ts +1 -0
- package/lib/components/UI/Button/index.d.ts +10 -0
- package/lib/components/UI/IframeComponent/index.d.ts +8 -0
- package/lib/components/UI/Stack/components/Item/index.d.ts +12 -0
- package/lib/components/UI/Stack/index.d.ts +23 -0
- package/lib/components/UI/Stack/utils/components.d.ts +16 -0
- package/lib/components/UI/Stack/utils/css.d.ts +4 -0
- package/lib/components/UI/SyncScrollIframeComponent/index.d.ts +10 -0
- package/lib/components/UI/SyncScrollShadowDom/index.d.ts +4 -0
- package/lib/components/UI/Tabs/index.d.ts +22 -0
- package/lib/components/UI/TextStyle/index.d.ts +7 -0
- package/lib/components/wrapper/BlockAvatarWrapper/index.d.ts +11 -0
- package/lib/components/wrapper/index.d.ts +2 -0
- package/lib/constants.d.ts +17 -0
- package/lib/hooks/useActiveTab.d.ts +4 -0
- package/lib/hooks/useBlock.d.ts +26 -0
- package/lib/hooks/useDataTransfer.d.ts +4 -0
- package/lib/hooks/useDomScrollHeight.d.ts +7 -0
- package/lib/hooks/useDragable.d.ts +4 -0
- package/lib/hooks/useDropBlock.d.ts +3 -0
- package/lib/hooks/useEditorContext.d.ts +8 -0
- package/lib/hooks/useEditorProps.d.ts +4 -0
- package/lib/hooks/useFocusBlockLayout.d.ts +3 -0
- package/lib/hooks/useFocusIdx.d.ts +4 -0
- package/lib/hooks/useHotKeys.d.ts +1 -0
- package/lib/hooks/useHoverIdx.d.ts +8 -0
- package/lib/hooks/useLazyState.d.ts +1 -0
- package/lib/hooks/usePreviewEmail.d.ts +6 -0
- package/lib/hooks/useRefState.d.ts +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.js +8315 -0
- package/lib/index.js.map +1 -0
- package/lib/locales.json +1 -0
- package/lib/style.css +1 -0
- package/lib/typings/index.d.ts +13 -0
- package/lib/typings/mjml-browser.d.ts +37 -0
- package/lib/utils/EventManager.d.ts +19 -0
- package/lib/utils/HtmlStringToPreviewReactNodes.d.ts +2 -0
- package/lib/utils/HtmlStringToReactNodes.d.ts +5 -0
- package/lib/utils/MergeTagBadge.d.ts +4 -0
- package/lib/utils/awaitForElement.d.ts +4 -0
- package/lib/utils/classnames.d.ts +1 -0
- package/lib/utils/contenteditable.d.ts +4 -0
- package/lib/utils/generateTranslate.d.ts +1 -0
- package/lib/utils/getBlockNodeByChildEle.d.ts +1 -0
- package/lib/utils/getBlockNodeByIdx.d.ts +1 -0
- package/lib/utils/getBlockNodes.d.ts +1 -0
- package/lib/utils/getContentEditableClassName.d.ts +1 -0
- package/lib/utils/getDirectionPosition.d.ts +15 -0
- package/lib/utils/getEditorRoot.d.ts +1 -0
- package/lib/utils/getImg.d.ts +5 -0
- package/lib/utils/getInsertPosition.d.ts +17 -0
- package/lib/utils/getPluginElement.d.ts +1 -0
- package/lib/utils/getShadowRoot.d.ts +1 -0
- package/lib/utils/index.d.ts +12 -0
- package/lib/utils/isButtonBlock.d.ts +1 -0
- package/lib/utils/isNavbarBlock.d.ts +1 -0
- package/lib/utils/isTextBlock.d.ts +1 -0
- package/lib/utils/logger.d.ts +2 -0
- package/lib/utils/scrollBlockEleIntoView.d.ts +3 -0
- package/package.json +84 -0
- package/readme.md +85 -0
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DesktopEmailPreview(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MjmlDomRender(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ShadowStyle(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditEmailPreview(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MobileEmailPreview(): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ToolsPanel(): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function IconFont(props: {
|
|
3
|
+
iconName: string;
|
|
4
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
5
|
+
onClickCapture?: React.MouseEventHandler<HTMLDivElement>;
|
|
6
|
+
size?: number;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
title?: string;
|
|
9
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum ActiveTabKeys {
|
|
3
|
+
EDIT = "EDIT",
|
|
4
|
+
MOBILE = "MOBILE",
|
|
5
|
+
PC = "PC"
|
|
6
|
+
}
|
|
7
|
+
export declare const BlocksContext: React.Context<{
|
|
8
|
+
initialized: boolean;
|
|
9
|
+
setInitialized: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
focusIdx: string;
|
|
11
|
+
setFocusIdx: React.Dispatch<React.SetStateAction<string>>;
|
|
12
|
+
dragEnabled: boolean;
|
|
13
|
+
setDragEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
|
+
collapsed: boolean;
|
|
15
|
+
setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
|
+
activeTab: ActiveTabKeys;
|
|
17
|
+
setActiveTab: React.Dispatch<React.SetStateAction<ActiveTabKeys>>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const BlocksProvider: React.FC<{
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEmailTemplate } from '../../../typings';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PropsProviderProps } from '../PropsProvider';
|
|
4
|
+
import { Config, FormApi, FormState } from 'final-form';
|
|
5
|
+
export interface EmailEditorProviderProps<T extends IEmailTemplate = any> extends Omit<PropsProviderProps, 'children'> {
|
|
6
|
+
data: T;
|
|
7
|
+
children: (props: FormState<T>, helper: FormApi<IEmailTemplate, Partial<IEmailTemplate>>) => React.ReactNode;
|
|
8
|
+
onSubmit?: Config<IEmailTemplate, Partial<IEmailTemplate>>['onSubmit'];
|
|
9
|
+
validationSchema?: Config<IEmailTemplate, Partial<IEmailTemplate>>['validate'];
|
|
10
|
+
}
|
|
11
|
+
export declare const EmailEditorProvider: <T extends unknown>(props: EmailEditorProviderProps<any> & T) => JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HoverIdxState {
|
|
3
|
+
hoverIdx: string;
|
|
4
|
+
}
|
|
5
|
+
export interface DragPosition {
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DataTransfer {
|
|
10
|
+
type: string;
|
|
11
|
+
payload?: any;
|
|
12
|
+
action: 'add' | 'move';
|
|
13
|
+
positionIndex?: number;
|
|
14
|
+
parentIdx?: string;
|
|
15
|
+
sourceIdx?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const HoverIdxContext: React.Context<{
|
|
18
|
+
hoverIdx: string;
|
|
19
|
+
isDragging: boolean;
|
|
20
|
+
setHoverIdx: React.Dispatch<React.SetStateAction<string>>;
|
|
21
|
+
setIsDragging: React.Dispatch<React.SetStateAction<boolean>>;
|
|
22
|
+
direction: string;
|
|
23
|
+
setDirection: React.Dispatch<React.SetStateAction<string>>;
|
|
24
|
+
dataTransfer: DataTransfer | null;
|
|
25
|
+
setDataTransfer: React.Dispatch<React.SetStateAction<DataTransfer | null>>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const HoverIdxProvider: React.FC<{
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const MOBILE_WIDTH = 320;
|
|
3
|
+
export declare const PreviewEmailContext: React.Context<{
|
|
4
|
+
html: string;
|
|
5
|
+
reactNode: React.ReactNode | null;
|
|
6
|
+
errMsg: React.ReactNode;
|
|
7
|
+
mobileWidth: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const PreviewEmailProvider: React.FC<{
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IBlockData } from 'easy-email-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface CollectedBlock {
|
|
4
|
+
label: string;
|
|
5
|
+
helpText: string;
|
|
6
|
+
thumbnail: string;
|
|
7
|
+
data: IBlockData;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BlockGroup {
|
|
11
|
+
title: string;
|
|
12
|
+
blocks: Array<CollectedBlock>;
|
|
13
|
+
}
|
|
14
|
+
export interface PropsProviderProps {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
height: string;
|
|
17
|
+
fontList?: {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}[];
|
|
21
|
+
onAddCollection?: (payload: CollectedBlock) => void;
|
|
22
|
+
onRemoveCollection?: (payload: {
|
|
23
|
+
id: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
onUploadImage?: (data: Blob) => Promise<string>;
|
|
26
|
+
interactiveStyle?: {
|
|
27
|
+
hoverColor?: string;
|
|
28
|
+
selectedColor?: string;
|
|
29
|
+
dragoverColor?: string;
|
|
30
|
+
tangentColor?: string;
|
|
31
|
+
};
|
|
32
|
+
autoComplete?: boolean;
|
|
33
|
+
dashed?: boolean;
|
|
34
|
+
socialIcons?: Array<{
|
|
35
|
+
content: string;
|
|
36
|
+
image: string;
|
|
37
|
+
}>;
|
|
38
|
+
mergeTagGenerate?: (m: string) => string;
|
|
39
|
+
onChangeMergeTag?: (ptah: string, val: any) => any;
|
|
40
|
+
renderMergeTagContent?: (props: {
|
|
41
|
+
onChange: (val: string) => void;
|
|
42
|
+
isSelect: boolean;
|
|
43
|
+
value: string;
|
|
44
|
+
}) => React.ReactNode;
|
|
45
|
+
enabledMergeTagsBadge?: boolean;
|
|
46
|
+
mergeTags?: Record<string, any>;
|
|
47
|
+
previewInjectData?: Record<string, any>;
|
|
48
|
+
onBeforePreview?: (html: string, mergeTags: PropsProviderProps['previewInjectData'] | PropsProviderProps['mergeTags']) => string | Promise<string>;
|
|
49
|
+
enabledLogic?: boolean;
|
|
50
|
+
locale?: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
export declare const EditorPropsContext: React.Context<PropsProviderProps & {
|
|
53
|
+
mergeTagGenerate: Required<PropsProviderProps['mergeTagGenerate']>;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const PropsProvider: React.FC<PropsProviderProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IEmailTemplate } from '../../../typings';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare type RecordStatus = 'add' | 'redo' | 'undo' | undefined;
|
|
4
|
+
export declare const RecordContext: React.Context<{
|
|
5
|
+
records: Array<IEmailTemplate>;
|
|
6
|
+
redo: () => void;
|
|
7
|
+
undo: () => void;
|
|
8
|
+
reset: () => void;
|
|
9
|
+
redoable: boolean;
|
|
10
|
+
undoable: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const RecordProvider: React.FC<{
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HoverIdxState {
|
|
3
|
+
hoverIdx: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const ScrollContext: React.Context<{
|
|
6
|
+
scrollHeight: React.MutableRefObject<number>;
|
|
7
|
+
viewElementRef: React.MutableRefObject<null | {
|
|
8
|
+
selector: string;
|
|
9
|
+
top: number;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ScrollProvider: React.FC<{
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RenderCount(): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
noBorder?: boolean;
|
|
8
|
+
onClick?: React.DOMAttributes<HTMLButtonElement>['onClick'];
|
|
9
|
+
}
|
|
10
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props extends React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
windowRef?: (e: Window) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const IframeComponent: ({ children, title, windowRef, ...props }: Props) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ItemProps {
|
|
3
|
+
/** Elements to display inside item */
|
|
4
|
+
children?: React.ReactNode | any;
|
|
5
|
+
/** Fill the remaining horizontal space in the stack with the item */
|
|
6
|
+
fill?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
key?: string | number;
|
|
11
|
+
}
|
|
12
|
+
export declare function Item({ children, fill }: ItemProps): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Item } from './components/Item';
|
|
3
|
+
declare type Spacing = 'extraTight' | 'tight' | 'loose' | 'extraLoose' | 'none';
|
|
4
|
+
declare type Alignment = 'leading' | 'trailing' | 'center' | 'fill' | 'baseline';
|
|
5
|
+
declare type Distribution = 'equalSpacing' | 'leading' | 'trailing' | 'center' | 'fill' | 'fillEvenly';
|
|
6
|
+
export interface StackProps {
|
|
7
|
+
/** Elements to display inside stack */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** Wrap stack elements to additional rows as needed on small screens (Defaults to true) */
|
|
10
|
+
wrap?: boolean;
|
|
11
|
+
/** Stack the elements vertically */
|
|
12
|
+
vertical?: boolean;
|
|
13
|
+
/** Adjust spacing between elements */
|
|
14
|
+
spacing?: Spacing;
|
|
15
|
+
/** Adjust vertical alignment of elements */
|
|
16
|
+
alignment?: Alignment;
|
|
17
|
+
/** Adjust horizontal alignment of elements */
|
|
18
|
+
distribution?: Distribution;
|
|
19
|
+
}
|
|
20
|
+
export declare const Stack: React.NamedExoticComponent<StackProps> & {
|
|
21
|
+
Item: typeof Item;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function wrapWithComponent<P extends any>(element: React.ReactNode | null | undefined, Component: React.FC<P>, props: P): React.ReactNode;
|
|
3
|
+
export declare function isElementOfType<P>(element: React.ReactNode | null | undefined, Component: React.ComponentType<P> | React.ComponentType<P>[]): boolean;
|
|
4
|
+
export declare function elementChildren<T extends React.ReactElement>(children: React.ReactNode, predicate?: (element: T) => boolean): T[];
|
|
5
|
+
interface ConditionalWrapperProps {
|
|
6
|
+
children: any;
|
|
7
|
+
condition: boolean;
|
|
8
|
+
wrapper: (children: any) => any;
|
|
9
|
+
}
|
|
10
|
+
export declare function ConditionalWrapper({ condition, wrapper, children, }: ConditionalWrapperProps): JSX.Element;
|
|
11
|
+
interface ConditionalRenderProps {
|
|
12
|
+
condition: boolean;
|
|
13
|
+
children: any;
|
|
14
|
+
}
|
|
15
|
+
export declare function ConditionalRender({ condition, children, }: ConditionalRenderProps): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
windowRef?: (e: Window) => void;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare const SyncScrollIframeComponent: ({ children, title, windowRef, isActive, style, }: Props) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface TabsProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
tabBarExtraContent?: React.ReactNode;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
onChange?: (id: string) => void;
|
|
9
|
+
onBeforeChange?: (current: string, next: string) => boolean;
|
|
10
|
+
defaultActiveTab?: string;
|
|
11
|
+
activeTab?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TabPaneProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
tab: React.ReactNode;
|
|
16
|
+
key: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const Tabs: React.FC<TabsProps>;
|
|
21
|
+
declare const TabPane: React.FC<TabPaneProps>;
|
|
22
|
+
export { Tabs, TabPane };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TextStyleProps {
|
|
3
|
+
children?: React.ReactNode | React.ReactElement;
|
|
4
|
+
variation?: 'strong' | 'subdued';
|
|
5
|
+
size?: 'largest' | 'extraLarge' | 'large' | 'medium' | 'small' | 'smallest';
|
|
6
|
+
}
|
|
7
|
+
export declare const TextStyle: React.FC<TextStyleProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BlockType } from 'easy-email-core';
|
|
3
|
+
export declare type BlockAvatarWrapperProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
type: BlockType | string;
|
|
6
|
+
payload?: any;
|
|
7
|
+
action?: 'add' | 'move';
|
|
8
|
+
hideIcon?: boolean;
|
|
9
|
+
idx?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const BlockAvatarWrapper: React.FC<BlockAvatarWrapperProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const FIXED_CONTAINER_ID = "FIXED_CONTAINER_ID";
|
|
2
|
+
export declare const EASY_EMAIL_EDITOR_ID = "easy-email-editor";
|
|
3
|
+
export declare const PLUGINS_CONTAINER_ID = "easy-email-plugins";
|
|
4
|
+
export declare const SYNC_SCROLL_ELEMENT_CLASS_NAME = "easy-email-sync-scroll";
|
|
5
|
+
export declare const RICH_TEXT_BAR_ID = "easy-email-rich-text-bar";
|
|
6
|
+
export declare const DATA_RENDER_COUNT = "data-render-count";
|
|
7
|
+
export declare const DATA_ATTRIBUTE_ID = "data-tree-node-id";
|
|
8
|
+
export declare const DATA_ATTRIBUTE_INDEX = "data-tree-node-index";
|
|
9
|
+
export declare const DATA_ATTRIBUTE_DROP_CONTAINER = "data-drop-container";
|
|
10
|
+
export declare const DATA_CONTENT_EDITABLE_TYPE = "data-content_editable-type";
|
|
11
|
+
export declare const DATA_CONTENT_EDITABLE_IDX = "data-content_editable-idx";
|
|
12
|
+
export declare const CONTENT_EDITABLE_CLASS_NAME = "easy-email-content_editable_text_only";
|
|
13
|
+
export declare const CONTENT_EDITABLE_RICH_TEXT_CLASS_NAME = "easy-email-content_editable_rich_text";
|
|
14
|
+
export declare enum ContentEditableType {
|
|
15
|
+
RichText = "rich_text",
|
|
16
|
+
Text = "text"
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBlockData } from 'easy-email-core';
|
|
2
|
+
import { IEmailTemplate } from '../typings';
|
|
3
|
+
export declare function useBlock(): {
|
|
4
|
+
values: IEmailTemplate;
|
|
5
|
+
change: <F extends string>(name: F, value?: any) => void;
|
|
6
|
+
focusBlock: IBlockData<any, any> | null;
|
|
7
|
+
setFocusBlock: import("lodash").DebouncedFunc<(val: any) => void>;
|
|
8
|
+
setFocusBlockValue: import("lodash").DebouncedFunc<(val: any) => void>;
|
|
9
|
+
setValueByIdx: import("lodash").DebouncedFunc<(<T extends IBlockData<any, any>>(idx: string, newVal: T) => void)>;
|
|
10
|
+
addBlock: (params: {
|
|
11
|
+
type: string;
|
|
12
|
+
parentIdx: string;
|
|
13
|
+
positionIndex?: number;
|
|
14
|
+
payload?: any;
|
|
15
|
+
canReplace?: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
moveBlock: (sourceIdx: string, destinationIdx: string) => null | undefined;
|
|
18
|
+
copyBlock: (idx: string) => void;
|
|
19
|
+
removeBlock: (idx: string) => void;
|
|
20
|
+
isExistBlock: (idx: string) => boolean;
|
|
21
|
+
redo: () => void;
|
|
22
|
+
undo: () => void;
|
|
23
|
+
reset: () => void;
|
|
24
|
+
redoable: boolean;
|
|
25
|
+
undoable: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function useDataTransfer(): {
|
|
2
|
+
dataTransfer: import("../components/Provider/HoverIdxProvider").DataTransfer | null;
|
|
3
|
+
setDataTransfer: import("lodash").DebouncedFunc<import("react").Dispatch<import("react").SetStateAction<import("../components/Provider/HoverIdxProvider").DataTransfer | null>>>;
|
|
4
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IEmailTemplate } from '../typings';
|
|
2
|
+
export declare function useEditorContext(): {
|
|
3
|
+
formState: import("final-form").FormState<IEmailTemplate, Partial<IEmailTemplate>>;
|
|
4
|
+
formHelpers: import("final-form").FormApi<Record<string, any>, Partial<Record<string, any>>>;
|
|
5
|
+
initialized: boolean;
|
|
6
|
+
setInitialized: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
7
|
+
pageData: import("../easy-email-core/lib").IPage;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useHotKeys(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useHoverIdx(): {
|
|
2
|
+
hoverIdx: string;
|
|
3
|
+
setHoverIdx: import("lodash").DebouncedFunc<import("react").Dispatch<import("react").SetStateAction<string>>>;
|
|
4
|
+
isDragging: boolean;
|
|
5
|
+
setIsDragging: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
6
|
+
direction: string;
|
|
7
|
+
setDirection: import("lodash").DebouncedFunc<import("react").Dispatch<import("react").SetStateAction<string>>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLazyState<T>(state: T, debounceTime: number): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRefState<T>(state: T): import("react").MutableRefObject<T>;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './components/Provider/EmailEditorProvider';
|
|
2
|
+
export { BlockAvatarWrapper } from './components/wrapper';
|
|
3
|
+
export { EmailEditor } from './components/EmailEditor';
|
|
4
|
+
export { EditEmailPreview } from './components/EmailEditor/components/EditEmailPreview';
|
|
5
|
+
export { MobileEmailPreview } from './components/EmailEditor/components/MobileEmailPreview';
|
|
6
|
+
export { DesktopEmailPreview } from './components/EmailEditor/components/DesktopEmailPreview';
|
|
7
|
+
export { ToolsPanel } from './components/EmailEditor/components/ToolsPanel';
|
|
8
|
+
export * from './utils/index';
|
|
9
|
+
export { useActiveTab } from './hooks/useActiveTab';
|
|
10
|
+
export { useEditorProps } from './hooks/useEditorProps';
|
|
11
|
+
export { useBlock } from './hooks/useBlock';
|
|
12
|
+
export { useEditorContext } from './hooks/useEditorContext';
|
|
13
|
+
export { useDomScrollHeight } from './hooks/useDomScrollHeight';
|
|
14
|
+
export { useRefState } from './hooks/useRefState';
|
|
15
|
+
export { useLazyState } from './hooks/useLazyState';
|
|
16
|
+
export { useFocusBlockLayout } from './hooks/useFocusBlockLayout';
|
|
17
|
+
export * from './hooks/useDataTransfer';
|
|
18
|
+
export * from './hooks/useFocusIdx';
|
|
19
|
+
export * from './hooks/useHoverIdx';
|
|
20
|
+
export { ActiveTabKeys } from './components/Provider/BlocksProvider';
|
|
21
|
+
export { IconFont } from './components/IconFont';
|
|
22
|
+
export { TextStyle } from './components/UI/TextStyle';
|
|
23
|
+
export { Stack } from './components/UI/Stack';
|
|
24
|
+
export { Tabs, TabPane } from './components/UI/Tabs';
|
|
25
|
+
export * from './typings';
|
|
26
|
+
export type { StackProps } from './components/UI/Stack';
|
|
27
|
+
export type { PropsProviderProps } from './components/Provider/PropsProvider';
|
|
28
|
+
export type { BlockAvatarWrapperProps } from './components/wrapper';
|
|
29
|
+
export type { BlockGroup, CollectedBlock } from './components/Provider/PropsProvider';
|
|
30
|
+
export * from './constants';
|