0.15.6 • Published 5 months ago

realmail-editor v0.15.6

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

realmail-editor

Introduction

Email render and preview container.

usage

$ npm install --save realmail-editor

or

$ yarn add realmail-editor
import React from "react";
import { BlockManager } from "realmail-core";
import { EmailEditor, EmailEditorProvider } from "realmail-editor";
import "realmail-editor/lib/style.css";

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

export function App() {
  return (
    <EmailEditorProvider data={initialValues} height={"calc(100vh - 72px)"}>
      {({ values }) => {
        return <EmailEditor />;
      }}
    </EmailEditorProvider>
  );
}

customize

If you customize the UI yourself,maybe you need to know

  • hooks

    • useActiveTab // current tab is edit or preview
    • useBlock // includes addBlock、moveBlock、removeBlock、undo, redo, etc.
    • useHoverIdx // hover block related, dragging status related, dragging direction related
    • useEditorProps // get props from EmailEditorProvider
    • useEditorContext // get form state and initialized status
    • useFocusIdx // focus block related
  • utils (These are some very simple methods, it is best to look at the implementation)

    • getBlockNodeByIdx
    • getBlockNodes
    • getShadowRoot
    • scrollBlockEleIntoView
  • components

    • BlockAvatarWrapper // allow drag and drop to editor
0.15.6

5 months ago

0.15.4

6 months ago

0.15.0

1 year ago

0.13.3

1 year ago

0.15.2

1 year ago

0.14.0

1 year ago

0.14.3

1 year ago

0.11.21

2 years ago

0.11.26

2 years ago

0.13.0

1 year ago

0.11.34

1 year ago

0.11.35

1 year ago

0.12.0

1 year ago

0.6.21

2 years ago

0.8.8

2 years ago

0.6.20

2 years ago

0.8.5

2 years ago

0.6.7

2 years ago

0.8.4

2 years ago

0.6.6

2 years ago

0.8.7

2 years ago

0.6.9

2 years ago

0.6.24

2 years ago

0.10.18

2 years ago

0.11.0

2 years ago

0.11.1

2 years ago

0.10.15

2 years ago

0.11.2

2 years ago

0.11.5

2 years ago

0.10.11

2 years ago

0.6.11

2 years ago

0.6.17

2 years ago

0.6.19

2 years ago

0.9.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.5.8

2 years ago

0.10.9

2 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.7

2 years ago

0.10.8

2 years ago

0.10.0

2 years ago

0.8.0

2 years ago

0.6.2

2 years ago

0.8.2

2 years ago

0.11.11

2 years ago

0.11.12

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.4.20

2 years ago

0.4.8

2 years ago

0.4.28

2 years ago

0.4.24

2 years ago

0.4.25

2 years ago

0.4.22

2 years ago

0.4.31

2 years ago

0.4.32

2 years ago

0.4.30

2 years ago

0.4.35

2 years ago

0.4.36

2 years ago

0.4.33

2 years ago

0.4.34

2 years ago

0.3.0

2 years ago

0.4.5

2 years ago

0.3.5

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.0

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.5.1

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.12

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago