@groovymedia/easy-email-editor 4.12.4 → 4.12.6

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.
@@ -1,4 +1,4 @@
1
- import { IPage } from 'easy-email-core';
1
+ import { IPage } from '@groovymedia/easy-email-core';
2
2
  export interface IEmailTemplate {
3
3
  content: IPage;
4
4
  subject: string;
@@ -1,4 +1,4 @@
1
- import { IPage } from 'easy-email-core';
1
+ import { IPage } from '@groovymedia/easy-email-core';
2
2
  import { DirectionPosition } from './getDirectionPosition';
3
3
  interface Params {
4
4
  context: {
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.4",
5
+ "version": "4.12.6",
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.12.2",
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 "react";
21
- import { BlockManager } from "easy-email-core";
22
- import { EmailEditor, EmailEditorProvider } from "easy-email-editor";
23
- import "easy-email-editor/lib/style.css";
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: "Welcome to Easy-email",
27
- subTitle: "Nice to meet you!",
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 data={initialValues} height={"calc(100vh - 72px)"}>
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 ```(name: F, value?: any) => void```
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 ```(values: IBlockData)=>void```
54
- - setFocusBlockValue // assign focusBlock data values ```(values: IBlockData)=>void```
55
- - setValueByIdx // assign form values by focusIdx ```(focusIdx:string, values: IBlockData)=>void```
56
- - addBlock ```(params: {
57
- type: string;
58
- parentIdx: string;
59
- positionIndex?: number;
60
- payload?: any;
61
- canReplace?: boolean;
62
- }) => void```
63
- - moveBlock // ```(sourceIdx: string, destinationIdx: string) => null | undefined```
64
- - copyBlock // ```(idx: string) => void```
65
- - removeBlock // ```(idx: string) => void```
66
- - isExistBlock // ```(idx:string)=>boolean```
67
- - redo // ```() => void```
68
- - undo // ```() => void```
69
- - reset // ```() => void```
70
- - redoable // ```boolean```
71
- - undoable // ```boolean```
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