@thanhpv102/easy-email-core 4.19.0

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.
Files changed (85) hide show
  1. package/lib/blocks/advanced/blocks/index.d.ts +16 -0
  2. package/lib/blocks/advanced/generateAdvancedBlock.d.ts +60 -0
  3. package/lib/blocks/advanced/generateAdvancedContentBlock.d.ts +6 -0
  4. package/lib/blocks/advanced/generateAdvancedLayoutBlock.d.ts +7 -0
  5. package/lib/blocks/advanced/generateAdvancedTableBlock.d.ts +21 -0
  6. package/lib/blocks/advanced/index.d.ts +22 -0
  7. package/lib/blocks/index.d.ts +2 -0
  8. package/lib/blocks/standard/Accordion/index.d.ts +17 -0
  9. package/lib/blocks/standard/AccordionElement/index.d.ts +16 -0
  10. package/lib/blocks/standard/AccordionText/index.d.ts +12 -0
  11. package/lib/blocks/standard/AccordionTitle/index.d.ts +9 -0
  12. package/lib/blocks/standard/Button/index.d.ts +30 -0
  13. package/lib/blocks/standard/Carousel/index.d.ts +26 -0
  14. package/lib/blocks/standard/Column/index.d.ts +13 -0
  15. package/lib/blocks/standard/Divider/index.d.ts +11 -0
  16. package/lib/blocks/standard/Group/index.d.ts +8 -0
  17. package/lib/blocks/standard/Hero/index.d.ts +15 -0
  18. package/lib/blocks/standard/Image/index.d.ts +18 -0
  19. package/lib/blocks/standard/Navbar/index.d.ts +27 -0
  20. package/lib/blocks/standard/Page/index.d.ts +29 -0
  21. package/lib/blocks/standard/Raw/index.d.ts +5 -0
  22. package/lib/blocks/standard/Section/index.d.ts +19 -0
  23. package/lib/blocks/standard/Social/index.d.ts +47 -0
  24. package/lib/blocks/standard/Spacer/index.d.ts +7 -0
  25. package/lib/blocks/standard/Table/index.d.ts +5 -0
  26. package/lib/blocks/standard/Template/index.d.ts +5 -0
  27. package/lib/blocks/standard/Text/index.d.ts +20 -0
  28. package/lib/blocks/standard/Wrapper/index.d.ts +12 -0
  29. package/lib/blocks/standard/index.d.ts +45 -0
  30. package/lib/components/Accordion.d.ts +8 -0
  31. package/lib/components/AccordionElement.d.ts +8 -0
  32. package/lib/components/AccordionText.d.ts +8 -0
  33. package/lib/components/AccordionTitle.d.ts +8 -0
  34. package/lib/components/BasicBlock.d.ts +7 -0
  35. package/lib/components/BlockRenderer.d.ts +5 -0
  36. package/lib/components/Button.d.ts +8 -0
  37. package/lib/components/Carousel.d.ts +8 -0
  38. package/lib/components/Column.d.ts +8 -0
  39. package/lib/components/Divider.d.ts +8 -0
  40. package/lib/components/Group.d.ts +8 -0
  41. package/lib/components/Hero.d.ts +8 -0
  42. package/lib/components/Image.d.ts +8 -0
  43. package/lib/components/MjmlBlock.d.ts +10 -0
  44. package/lib/components/Navbar.d.ts +8 -0
  45. package/lib/components/Page.d.ts +8 -0
  46. package/lib/components/Raw.d.ts +8 -0
  47. package/lib/components/Section.d.ts +8 -0
  48. package/lib/components/Social.d.ts +8 -0
  49. package/lib/components/Spacer.d.ts +8 -0
  50. package/lib/components/Table.d.ts +8 -0
  51. package/lib/components/Template.d.ts +8 -0
  52. package/lib/components/Text.d.ts +8 -0
  53. package/lib/components/Wrapper.d.ts +8 -0
  54. package/lib/components/index.d.ts +23 -0
  55. package/lib/constants.d.ts +43 -0
  56. package/lib/index.cjs.js +113 -0
  57. package/lib/index.cjs.js.map +1 -0
  58. package/lib/index.d.ts +5 -0
  59. package/lib/index.es.js +3685 -0
  60. package/lib/index.es.js.map +1 -0
  61. package/lib/typings/index.d.ts +41 -0
  62. package/lib/utils/BlockManager.d.ts +16 -0
  63. package/lib/utils/I18nManager.d.ts +7 -0
  64. package/lib/utils/ImageManager.d.ts +13 -0
  65. package/lib/utils/JsonToMjml.d.ts +12 -0
  66. package/lib/utils/TemplateEngineManager.d.ts +18 -0
  67. package/lib/utils/ancestorOf.d.ts +1 -0
  68. package/lib/utils/block.d.ts +34 -0
  69. package/lib/utils/classnames.d.ts +1 -0
  70. package/lib/utils/createBlock.d.ts +2 -0
  71. package/lib/utils/createBlockDataByType.d.ts +2 -0
  72. package/lib/utils/createCustomBlock.d.ts +2 -0
  73. package/lib/utils/generaMjmlMetaData.d.ts +2 -0
  74. package/lib/utils/getAdapterAttributesString.d.ts +2 -0
  75. package/lib/utils/getImg.d.ts +15 -0
  76. package/lib/utils/getPlaceholder.d.ts +2 -0
  77. package/lib/utils/getPreviewClassName.d.ts +1 -0
  78. package/lib/utils/index.d.ts +16 -0
  79. package/lib/utils/isAdvancedBlock.d.ts +1 -0
  80. package/lib/utils/isProductionMode.d.ts +24 -0
  81. package/lib/utils/isValidBlockData.d.ts +2 -0
  82. package/lib/utils/mergeBlock.d.ts +2 -0
  83. package/lib/utils/parseReactBlockToBlockData.d.ts +2 -0
  84. package/package.json +85 -0
  85. package/readme.md +426 -0
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ICarousel } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type CarouselProps = RecursivePartial<ICarousel['data']> & RecursivePartial<ICarousel['attributes']> & {
6
+ children?: MjmlBlockProps<ICarousel>['children'];
7
+ };
8
+ export declare function Carousel(props: CarouselProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IColumn } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type ColumnProps = RecursivePartial<IColumn['data']> & RecursivePartial<IColumn['attributes']> & {
6
+ children?: MjmlBlockProps<IColumn>['children'];
7
+ };
8
+ export declare function Column(props: ColumnProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IDivider } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type DividerProps = RecursivePartial<IDivider['data']> & RecursivePartial<IDivider['attributes']> & {
6
+ children?: MjmlBlockProps<IDivider>['children'];
7
+ };
8
+ export declare function Divider(props: DividerProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IGroup } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type GroupProps = RecursivePartial<IGroup['data']> & RecursivePartial<IGroup['attributes']> & {
6
+ children?: MjmlBlockProps<IGroup>['children'];
7
+ };
8
+ export declare function Group(props: GroupProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IHero } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type HeroProps = RecursivePartial<IHero['data']> & RecursivePartial<IHero['attributes']> & {
6
+ children?: MjmlBlockProps<IHero>['children'];
7
+ };
8
+ export declare function Hero(props: HeroProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IImage } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type ImageProps = RecursivePartial<IImage['data']> & RecursivePartial<IImage['attributes']> & {
6
+ children?: MjmlBlockProps<IImage>['children'];
7
+ };
8
+ export declare function Image(props: ImageProps): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IBlockData, RecursivePartial } from '../typings';
3
+ export interface MjmlBlockProps<T extends IBlockData> {
4
+ idx?: string | null;
5
+ type: T['type'];
6
+ value?: RecursivePartial<T['data']['value']>;
7
+ attributes?: RecursivePartial<T['attributes']>;
8
+ children?: React.ReactNode;
9
+ }
10
+ export default function MjmlBlock<T extends IBlockData>({ idx, value, type, attributes, children, }: MjmlBlockProps<T>): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { INavbar } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type NavbarProps = RecursivePartial<INavbar['data']> & RecursivePartial<INavbar['attributes']> & {
6
+ children?: MjmlBlockProps<INavbar>['children'];
7
+ };
8
+ export declare function Navbar(props: NavbarProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IPage } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type PageProps = RecursivePartial<IPage['data']> & RecursivePartial<IPage['attributes']> & {
6
+ children?: MjmlBlockProps<IPage>['children'];
7
+ };
8
+ export declare function Page(props: PageProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IRaw } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type RawProps = RecursivePartial<IRaw['data']> & RecursivePartial<IRaw['attributes']> & {
6
+ children?: MjmlBlockProps<IRaw>['children'];
7
+ };
8
+ export declare function Raw(props: RawProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ISection } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type SectionProps = RecursivePartial<ISection['data']> & RecursivePartial<ISection['attributes']> & {
6
+ children?: MjmlBlockProps<ISection>['children'];
7
+ };
8
+ export declare function Section(props: SectionProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ISocial } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type SocialProps = RecursivePartial<ISocial['data']> & RecursivePartial<ISocial['attributes']> & {
6
+ children?: MjmlBlockProps<ISocial>['children'];
7
+ };
8
+ export declare function Social(props: SocialProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ISpacer } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type SpacerProps = RecursivePartial<ISpacer['data']> & RecursivePartial<ISpacer['attributes']> & {
6
+ children?: MjmlBlockProps<ISpacer>['children'];
7
+ };
8
+ export declare function Spacer(props: SpacerProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ITable } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type TableProps = RecursivePartial<ITable['data']> & RecursivePartial<ITable['attributes']> & {
6
+ children?: MjmlBlockProps<ITable>['children'];
7
+ };
8
+ export declare function Table(props: TableProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { ITemplate } from '../blocks';
4
+ export type TemplateProps = RecursivePartial<ITemplate['data']> & RecursivePartial<ITemplate['attributes']> & {
5
+ children: string | React.ReactNode;
6
+ idx?: string | null;
7
+ };
8
+ export declare function Template(props: TemplateProps): React.ReactNode;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IText } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type TextProps = RecursivePartial<IText['data']> & RecursivePartial<IText['attributes']> & {
6
+ children?: MjmlBlockProps<IText>['children'];
7
+ };
8
+ export declare function Text(props: TextProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecursivePartial } from '../typings';
2
+ import React from 'react';
3
+ import { IWrapper } from '../blocks';
4
+ import { MjmlBlockProps } from '../components/MjmlBlock';
5
+ export type WrapperProps = RecursivePartial<IWrapper['data']> & RecursivePartial<IWrapper['attributes']> & {
6
+ children?: MjmlBlockProps<IWrapper>['children'];
7
+ };
8
+ export declare function Wrapper(props: WrapperProps): React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ export { Page } from './Page';
2
+ export { Section } from './Section';
3
+ export { Column } from './Column';
4
+ export { Text } from './Text';
5
+ export { Image } from './Image';
6
+ export { Group } from './Group';
7
+ export { Button } from './Button';
8
+ export { Divider } from './Divider';
9
+ export { Wrapper } from './Wrapper';
10
+ export { Spacer } from './Spacer';
11
+ export { Raw } from './Raw';
12
+ export { Accordion } from './Accordion';
13
+ export { AccordionElement } from './AccordionElement';
14
+ export { AccordionTitle } from './AccordionTitle';
15
+ export { AccordionText } from './AccordionText';
16
+ export { Carousel } from './Carousel';
17
+ export { Hero } from './Hero';
18
+ export { Navbar } from './Navbar';
19
+ export { Social } from './Social';
20
+ export { Table } from './Table';
21
+ export { Template } from './Template';
22
+ export { BlockRenderer } from './BlockRenderer';
23
+ export { default as MjmlBlock } from './MjmlBlock';
@@ -0,0 +1,43 @@
1
+ export type BlockType = BasicType;
2
+ export declare enum BasicType {
3
+ PAGE = "page",
4
+ SECTION = "section",
5
+ COLUMN = "column",
6
+ GROUP = "group",
7
+ TEXT = "text",
8
+ IMAGE = "image",
9
+ DIVIDER = "divider",
10
+ SPACER = "spacer",
11
+ BUTTON = "button",
12
+ WRAPPER = "wrapper",
13
+ RAW = "raw",
14
+ ACCORDION = "accordion",
15
+ ACCORDION_ELEMENT = "accordion-element",
16
+ ACCORDION_TITLE = "accordion-title",
17
+ ACCORDION_TEXT = "accordion-text",
18
+ HERO = "hero",
19
+ CAROUSEL = "carousel",
20
+ NAVBAR = "navbar",
21
+ SOCIAL = "social",
22
+ TABLE = "table",
23
+ TEMPLATE = "template"
24
+ }
25
+ export declare enum AdvancedType {
26
+ TEXT = "advanced_text",
27
+ IMAGE = "advanced_image",
28
+ DIVIDER = "advanced_divider",
29
+ SPACER = "advanced_spacer",
30
+ BUTTON = "advanced_button",
31
+ NAVBAR = "advanced_navbar",
32
+ SOCIAL = "advanced_social",
33
+ ACCORDION = "advanced_accordion",
34
+ CAROUSEL = "advanced_carousel",
35
+ TABLE = "advanced_table",
36
+ WRAPPER = "advanced_wrapper",
37
+ SECTION = "advanced_section",
38
+ COLUMN = "advanced_column",
39
+ GROUP = "advanced_group",
40
+ HERO = "advanced_hero"
41
+ }
42
+ export declare const MERGE_TAG_CLASS_NAME = "easy-email-merge-tag-container";
43
+ export declare const EMAIL_BLOCK_CLASS_NAME = "email-block";