easy-email-extensions 4.15.0 → 4.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function TableOperation(): JSX.Element;
@@ -0,0 +1,38 @@
1
+ declare const MENU_CONFIG: {
2
+ insertColumnRight: {
3
+ text: string;
4
+ icon: string;
5
+ handler(): void;
6
+ };
7
+ insertColumnLeft: {
8
+ text: string;
9
+ icon: string;
10
+ handler(): void;
11
+ };
12
+ insertRowUp: {
13
+ text: string;
14
+ icon: string;
15
+ handler(): void;
16
+ };
17
+ insertRowDown: {
18
+ text: string;
19
+ icon: string;
20
+ handler(): void;
21
+ };
22
+ mergeCells: {
23
+ text: string;
24
+ icon: string;
25
+ handler(): void;
26
+ };
27
+ deleteColumn: {
28
+ text: string;
29
+ icon: string;
30
+ handler(): void;
31
+ };
32
+ deleteRow: {
33
+ text: string;
34
+ icon: string;
35
+ handler(): void;
36
+ };
37
+ };
38
+ export default MENU_CONFIG;
@@ -0,0 +1,60 @@
1
+ import { IBoundingPosition, IOperationData } from './type';
2
+ export default class TableOperationMenu {
3
+ menuItems: {
4
+ insertColumnRight: {
5
+ text: string;
6
+ icon: string;
7
+ handler(): void;
8
+ };
9
+ insertColumnLeft: {
10
+ text: string;
11
+ icon: string;
12
+ handler(): void;
13
+ };
14
+ insertRowUp: {
15
+ text: string;
16
+ icon: string;
17
+ handler(): void;
18
+ };
19
+ insertRowDown: {
20
+ text: string;
21
+ icon: string;
22
+ handler(): void;
23
+ };
24
+ mergeCells: {
25
+ text: string;
26
+ icon: string;
27
+ handler(): void;
28
+ };
29
+ deleteColumn: {
30
+ text: string;
31
+ icon: string;
32
+ handler(): void;
33
+ };
34
+ deleteRow: {
35
+ text: string;
36
+ icon: string;
37
+ handler(): void;
38
+ };
39
+ };
40
+ domNode: Element | undefined;
41
+ styleDom?: HTMLStyleElement;
42
+ visible: boolean;
43
+ changeTableData?: (e: IOperationData[][]) => void;
44
+ tableData: IOperationData[][];
45
+ tableIndexBoundary: IBoundingPosition;
46
+ maxTdCount: number;
47
+ constructor();
48
+ mount(): void;
49
+ destroy(): void;
50
+ hide(): void;
51
+ addRow(insertIndex: number, colCount: number): void;
52
+ setTableData(tableData: IOperationData[][]): void;
53
+ setTableIndexBoundary(tableIndexBoundary: IBoundingPosition): void;
54
+ showMenu({ x, y }: {
55
+ x: number;
56
+ y: number;
57
+ }): void;
58
+ menuInitial(): void;
59
+ menuItemCreator({ text, icon, handler }: any): HTMLDivElement;
60
+ }
@@ -0,0 +1,45 @@
1
+ import TableOperationMenu from './tableOperationMenu';
2
+ import { AdvancedTableBlock } from 'easy-email-core';
3
+ interface IBorderTool {
4
+ top: Element;
5
+ bottom: Element;
6
+ left: Element;
7
+ right: Element;
8
+ }
9
+ declare class TableColumnTool {
10
+ borderTool: IBorderTool;
11
+ dragging: boolean;
12
+ showBorderTool: boolean;
13
+ startRect: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ startTdTop: number;
18
+ startTdLeft: number;
19
+ endTdTop: number;
20
+ endTdLeft: number;
21
+ width: number;
22
+ height: number;
23
+ selectedLeftTopCell: Element | undefined;
24
+ selectedBottomRightCell: Element | undefined;
25
+ startDom: Element | undefined;
26
+ endDom: Element | undefined;
27
+ hoveringTable: ParentNode | null;
28
+ root: Element | undefined;
29
+ tableMenu?: TableOperationMenu;
30
+ changeTableData?: (e: AdvancedTableBlock['data']['value']['tableSource']) => void;
31
+ tableData: AdvancedTableBlock['data']['value']['tableSource'];
32
+ constructor(borderTool: IBorderTool, root: Element);
33
+ initTool(): void;
34
+ destroy(): void;
35
+ hideBorder: (e: any) => void;
36
+ hideBorderByKeyDown: () => void;
37
+ hideTableMenu: (e?: any) => void;
38
+ visibleBorder: (show?: boolean) => void;
39
+ renderBorder: () => void;
40
+ handleContextmenu: (event: any) => void;
41
+ handleMousedown(event: any): void;
42
+ handleDrag: (e: any) => void;
43
+ handleMouseup: (e: any) => void;
44
+ }
45
+ export default TableColumnTool;
@@ -0,0 +1,21 @@
1
+ import { ITableData } from 'easy-email-core';
2
+ export interface IOperationData extends ITableData {
3
+ top: number;
4
+ bottom: number;
5
+ left: number;
6
+ right: number;
7
+ }
8
+ export interface IBoundaryRect {
9
+ left: number;
10
+ top: number;
11
+ right: number;
12
+ bottom: number;
13
+ width: number;
14
+ height: number;
15
+ }
16
+ export interface IBoundingPosition {
17
+ left: number;
18
+ top: number;
19
+ right: number;
20
+ bottom: number;
21
+ }
@@ -0,0 +1,23 @@
1
+ import { IBoundaryRect, IBoundingPosition, IOperationData } from './type';
2
+ import { AdvancedTableBlock } from 'easy-email-core';
3
+ export declare const getBoundaryRectAndElement: (el1: Element, el2: Element) => {
4
+ leftTopCell: Element;
5
+ bottomRightCell: Element;
6
+ boundary: IBoundaryRect;
7
+ } | null;
8
+ export declare function setStyle(domNode: any, rules: any): void;
9
+ export declare const getCurrentTable: (target: Element) => ParentNode | null;
10
+ export declare const getElementsBoundary: (el1: Element, el2: Element) => IBoundingPosition;
11
+ export declare const checkEventInBoundingRect: (rect: IBoundingPosition, { x, y }: {
12
+ x: number;
13
+ y: number;
14
+ }) => boolean;
15
+ export declare const getCellAttr: (el: Element, attrName: string) => number;
16
+ export declare const getTdBoundaryIndex: (leftTopCell: Element, bottomRightCell: Element) => {
17
+ left: number;
18
+ top: number;
19
+ right: number;
20
+ bottom: number;
21
+ };
22
+ export declare const getCorrectTableIndexBoundary: (tableIndexBoundary: IBoundingPosition, tableData: IOperationData[][]) => IBoundingPosition;
23
+ export declare const getMaxTdCount: (tableData: AdvancedTableBlock['data']['value']['tableSource']) => number;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function AdvancedTable(): JSX.Element;
@@ -18,6 +18,7 @@ import { Hero } from './Hero';
18
18
  import { Navbar } from './Navbar';
19
19
  import { Social } from './Social';
20
20
  import { Table } from './Table';
21
+ import { AdvancedTable } from './AdvancedTable';
21
22
  export declare const blocks: {
22
23
  page: typeof Page;
23
24
  section: typeof Section;
@@ -48,6 +49,7 @@ export declare const blocks: {
48
49
  advanced_carousel: typeof Carousel;
49
50
  advanced_navbar: typeof Navbar;
50
51
  advanced_social: typeof Social;
52
+ advanced_table: typeof AdvancedTable;
51
53
  advanced_hero: typeof Hero;
52
54
  advanced_wrapper: typeof Wrapper;
53
55
  advanced_section: typeof Section;