Skip to content

Commit

Permalink
export advanced table types (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
hulinNeil authored Aug 22, 2024
1 parent 6308501 commit e8c374f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function generateAdvancedTableBlock(option: {
});
}

export interface ITableData {
export interface IAdvancedTableData {
content: string;
colSpan?: number;
rowSpan?: number;
Expand All @@ -92,6 +92,6 @@ export type AdvancedTableBlock = IBlockData<
},
{
content?: string;
tableSource: ITableData[][];
tableSource: IAdvancedTableData[][];
}
>;
2 changes: 2 additions & 0 deletions packages/easy-email-core/src/blocks/advanced/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
AdvancedHero,
AdvancedTable,
} from './blocks';
import { IAdvancedTableData, AdvancedTableBlock } from './generateAdvancedTableBlock';

export const advancedBlocks = {
[AdvancedType.TEXT]: AdvancedText,
Expand All @@ -46,3 +47,4 @@ export const advancedBlocks = {

export { Operator, OperatorSymbol };
export type { AdvancedBlock, ICondition, IConditionGroup, IConditionGroupItem };
export type { IAdvancedTableData, AdvancedTableBlock };
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { getShadowRoot } from '@/utils';
import { cloneDeep } from 'lodash';
import React, { useEffect, useRef } from 'react';
import { createPortal } from 'react-dom';
import TableColumnTool from './tableTool';
import { useBlock, useFocusIdx } from '@';
import { getShadowRoot, useBlock, useFocusIdx } from 'easy-email-editor';

export function TableOperation() {
const shadowRoot = getShadowRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getTdBoundaryIndex,
getBoundaryRectAndElement,
} from './util';
import { AdvancedTableBlock } from '@core/blocks/advanced/generateAdvancedTableBlock';
import { AdvancedTableBlock } from 'easy-email-core';

interface IBorderTool {
top: Element;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ITableData } from '@core/blocks/advanced/generateAdvancedTableBlock';
import { IAdvancedTableData } from 'easy-email-core';

export interface IOperationData extends ITableData {
export interface IOperationData extends IAdvancedTableData {
top: number;
bottom: number;
left: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DATA_CONTENT_EDITABLE_IDX } from 'easy-email-editor';
import { IBoundaryRect, IBoundingPosition, IOperationData } from './type';
import { AdvancedTableBlock } from '@core/blocks/advanced/generateAdvancedTableBlock';
import { AdvancedTableBlock } from 'easy-email-core';

const getEditorElementClientRect = (target: any) => {
let left = target.offsetLeft;
Expand Down

0 comments on commit e8c374f

Please sign in to comment.