@groovymedia/easy-email-editor 4.12.4 → 4.12.5
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.
- package/lib/components/Provider/PropsProvider/index.d.ts +1 -1
- package/lib/components/wrapper/BlockAvatarWrapper/index.d.ts +1 -1
- package/lib/hooks/useBlock.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/typings/index.d.ts +1 -1
- package/lib/utils/getInsertPosition.d.ts +1 -1
- package/package.json +2 -2
- package/readme.md +31 -28
package/lib/typings/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@groovymedia/easy-email-editor",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Email editor",
|
|
5
|
-
"version": "4.12.
|
|
5
|
+
"version": "4.12.5",
|
|
6
6
|
"author": "m-Ryan",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"vite": "^2.6.14"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@groovymedia/easy-email-core": "^4.
|
|
71
|
+
"@groovymedia/easy-email-core": "^4.3.6",
|
|
72
72
|
"mjml-browser": "^4.10.4",
|
|
73
73
|
"react": "^18.2.0",
|
|
74
74
|
"react-dom": "^18.2.0",
|
package/readme.md
CHANGED
|
@@ -17,20 +17,23 @@ $ yarn add easy-email-editor
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
import React from
|
|
21
|
-
import { BlockManager } from
|
|
22
|
-
import { EmailEditor, EmailEditorProvider } from
|
|
23
|
-
import
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import { BlockManager } from '@groovymedia/easy-email-core';
|
|
22
|
+
import { EmailEditor, EmailEditorProvider } from '@groovymedia/easy-email-editor';
|
|
23
|
+
import 'easy-email-editor/lib/style.css';
|
|
24
24
|
|
|
25
25
|
const initialValues = {
|
|
26
|
-
subject:
|
|
27
|
-
subTitle:
|
|
26
|
+
subject: 'Welcome to Easy-email',
|
|
27
|
+
subTitle: 'Nice to meet you!',
|
|
28
28
|
content: BlockManager.getBlockByType(BasicType.PAGE).create({}),
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export function App() {
|
|
32
32
|
return (
|
|
33
|
-
<EmailEditorProvider
|
|
33
|
+
<EmailEditorProvider
|
|
34
|
+
data={initialValues}
|
|
35
|
+
height={'calc(100vh - 72px)'}
|
|
36
|
+
>
|
|
34
37
|
{({ values }) => {
|
|
35
38
|
return <EmailEditor />;
|
|
36
39
|
}}
|
|
@@ -47,28 +50,28 @@ If you customize the UI yourself,maybe you need to know
|
|
|
47
50
|
|
|
48
51
|
- useActiveTab // current tab is edit or preview
|
|
49
52
|
- useBlock // includes addBlock、moveBlock、removeBlock、undo, redo, etc.
|
|
50
|
-
- values // current block form values
|
|
51
|
-
- change // formHelpers, assign form values
|
|
53
|
+
- values // current block form values
|
|
54
|
+
- change // formHelpers, assign form values `(name: F, value?: any) => void`
|
|
52
55
|
- focusBlock // IBlockData
|
|
53
|
-
- setFocusBlock // set focusBlock values
|
|
54
|
-
- setFocusBlockValue // assign focusBlock data values
|
|
55
|
-
- setValueByIdx // assign form values by focusIdx
|
|
56
|
-
- addBlock
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- moveBlock //
|
|
64
|
-
- copyBlock //
|
|
65
|
-
- removeBlock //
|
|
66
|
-
- isExistBlock //
|
|
67
|
-
- redo //
|
|
68
|
-
- undo //
|
|
69
|
-
- reset //
|
|
70
|
-
- redoable //
|
|
71
|
-
- undoable //
|
|
56
|
+
- setFocusBlock // set focusBlock values `(values: IBlockData)=>void`
|
|
57
|
+
- setFocusBlockValue // assign focusBlock data values `(values: IBlockData)=>void`
|
|
58
|
+
- setValueByIdx // assign form values by focusIdx `(focusIdx:string, values: IBlockData)=>void`
|
|
59
|
+
- addBlock `(params: {
|
|
60
|
+
type: string;
|
|
61
|
+
parentIdx: string;
|
|
62
|
+
positionIndex?: number;
|
|
63
|
+
payload?: any;
|
|
64
|
+
canReplace?: boolean;
|
|
65
|
+
}) => void`
|
|
66
|
+
- moveBlock // `(sourceIdx: string, destinationIdx: string) => null | undefined`
|
|
67
|
+
- copyBlock // `(idx: string) => void`
|
|
68
|
+
- removeBlock // `(idx: string) => void`
|
|
69
|
+
- isExistBlock // `(idx:string)=>boolean`
|
|
70
|
+
- redo // `() => void`
|
|
71
|
+
- undo // `() => void`
|
|
72
|
+
- reset // `() => void`
|
|
73
|
+
- redoable // `boolean`
|
|
74
|
+
- undoable // `boolean`
|
|
72
75
|
- useHoverIdx // hover block related, dragging status related, dragging direction related
|
|
73
76
|
- useEditorProps // get props from EmailEditorProvider
|
|
74
77
|
- useEditorContext // get form state and initialized status
|