5.0.1 • Published 7 months ago

@plugilo/easy-email-extensions v5.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Easy-email-extensions

usage

$ npm install --save easy-email-extensions

or

$ yarn add easy-email-extensions
import React from 'react';
import { BlockManager, BasicType, AdvancedType } from '@plugilo/easy-email-core';
import { EmailEditor, EmailEditorProvider } from '@plugilo/easy-email-editor';
import { ExtensionProps, StandardLayout } from '@plugilo/easy-email-extensions';

import 'easy-email-editor/lib/style.css';
import 'easy-email-extensions/lib/style.css';

const categories: ExtensionProps['categories'] = [
  {
    label: 'Content',
    active: true,
    blocks: [
      {
        type: AdvancedType.TEXT,
      },
      {
        type: AdvancedType.IMAGE,
        payload: { attributes: { padding: '0px 0px 0px 0px' } },
      },
      {
        type: AdvancedType.BUTTON,
      },
      {
        type: AdvancedType.SOCIAL,
      },
      {
        type: AdvancedType.DIVIDER,
      },
      {
        type: AdvancedType.SPACER,
      },
      {
        type: AdvancedType.HERO,
      },
      {
        type: AdvancedType.WRAPPER,
      },
    ],
  },
  {
    label: 'Layout',
    active: true,
    displayType: 'column',
    blocks: [
      {
        title: '2 columns',
        payload: [
          ['50%', '50%'],
          ['33%', '67%'],
          ['67%', '33%'],
          ['25%', '75%'],
          ['75%', '25%'],
        ],
      },
      {
        title: '3 columns',
        payload: [
          ['33.33%', '33.33%', '33.33%'],
          ['25%', '25%', '50%'],
          ['50%', '25%', '25%'],
        ],
      },
      {
        title: '4 columns',
        payload: [['25%', '25%', '25%', '25%']],
      },
    ],
  },
];

const initialValues = {
  subject: 'Welcome to Easy-email',
  subTitle: 'Nice to meet you!',
  content: BlockManager.getBlockByType(BasicType.PAGE)!.create({}),
};

export default function App() {

  return (
    <EmailEditorProvider
      data={initialValues}
      height={'calc(100vh - 72px)'}
      autoComplete
      dashed={false}
    >
      {({ values }) => {
        return (
          <StandardLayout
            categories={categories}
            showSourceCode={true}
          >
            <EmailEditor />
          </StandardLayout>
        );
      }}
    </EmailEditorProvider>
  );
}
5.0.1

7 months ago

5.0.0

7 months ago

4.15.27

2 years ago

4.15.26

2 years ago

4.15.23

2 years ago

4.15.25

2 years ago

4.15.24

2 years ago

4.15.22

2 years ago

4.15.21

2 years ago

4.15.20

2 years ago

4.15.18

2 years ago

4.15.12

2 years ago

4.15.11

2 years ago

4.15.13

2 years ago

4.15.16

2 years ago

4.15.15

2 years ago

4.15.17

2 years ago

4.15.9

2 years ago

4.15.10

2 years ago

4.15.8

2 years ago

4.15.7

2 years ago

4.15.6

2 years ago

4.15.5

2 years ago

4.15.4

2 years ago

4.15.3

2 years ago

4.15.2

2 years ago

4.15.1

2 years ago

4.15.0

2 years ago

4.12.2

2 years ago

4.12.1

2 years ago