easy-email-extensions 3.0.9 → 3.0.13

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 (143) hide show
  1. package/lib/AttributePanel/AttributePanel.d.ts +3 -3
  2. package/lib/AttributePanel/components/UI/Help/index.d.ts +7 -7
  3. package/lib/AttributePanel/components/UI/HtmlEditor.d.ts +5 -5
  4. package/lib/AttributePanel/components/attributes/Align.d.ts +1 -1
  5. package/lib/AttributePanel/components/attributes/AttributesPanelWrapper/index.d.ts +6 -6
  6. package/lib/AttributePanel/components/attributes/Background.d.ts +1 -1
  7. package/lib/AttributePanel/components/attributes/BackgroundColor.d.ts +3 -3
  8. package/lib/AttributePanel/components/attributes/Border.d.ts +1 -1
  9. package/lib/AttributePanel/components/attributes/BorderColor.d.ts +1 -1
  10. package/lib/AttributePanel/components/attributes/BorderStyle.d.ts +5 -5
  11. package/lib/AttributePanel/components/attributes/BorderWidth.d.ts +1 -1
  12. package/lib/AttributePanel/components/attributes/Color.d.ts +4 -4
  13. package/lib/AttributePanel/components/attributes/ContainerBackgroundColor.d.ts +3 -3
  14. package/lib/AttributePanel/components/attributes/Decoration.d.ts +1 -1
  15. package/lib/AttributePanel/components/attributes/Direction.d.ts +1 -1
  16. package/lib/AttributePanel/components/attributes/FontFamily.d.ts +1 -1
  17. package/lib/AttributePanel/components/attributes/FontSize.d.ts +1 -1
  18. package/lib/AttributePanel/components/attributes/FontStyle.d.ts +3 -3
  19. package/lib/AttributePanel/components/attributes/FontWeight.d.ts +1 -1
  20. package/lib/AttributePanel/components/attributes/Height.d.ts +3 -3
  21. package/lib/AttributePanel/components/attributes/LetterSpacing.d.ts +1 -1
  22. package/lib/AttributePanel/components/attributes/LineHeight.d.ts +1 -1
  23. package/lib/AttributePanel/components/attributes/Link.d.ts +1 -1
  24. package/lib/AttributePanel/components/attributes/Margin.d.ts +1 -1
  25. package/lib/AttributePanel/components/attributes/MergeTags.d.ts +6 -6
  26. package/lib/AttributePanel/components/attributes/NavbarLinkPadding.d.ts +3 -3
  27. package/lib/AttributePanel/components/attributes/Padding.d.ts +5 -5
  28. package/lib/AttributePanel/components/attributes/TextAlign.d.ts +1 -1
  29. package/lib/AttributePanel/components/attributes/TextDecoration.d.ts +1 -1
  30. package/lib/AttributePanel/components/attributes/TextTransform.d.ts +1 -1
  31. package/lib/AttributePanel/components/attributes/VerticalAlign.d.ts +3 -3
  32. package/lib/AttributePanel/components/attributes/Width.d.ts +3 -3
  33. package/lib/AttributePanel/components/attributes/index.d.ts +29 -29
  34. package/lib/AttributePanel/components/blocks/Accordion/index.d.ts +1 -1
  35. package/lib/AttributePanel/components/blocks/AccordionElement/index.d.ts +1 -1
  36. package/lib/AttributePanel/components/blocks/AccordionText/index.d.ts +1 -1
  37. package/lib/AttributePanel/components/blocks/AccordionTitle/index.d.ts +1 -1
  38. package/lib/AttributePanel/components/blocks/Button/index.d.ts +1 -1
  39. package/lib/AttributePanel/components/blocks/Carousel/index.d.ts +1 -1
  40. package/lib/AttributePanel/components/blocks/Column/index.d.ts +1 -1
  41. package/lib/AttributePanel/components/blocks/Divider/index.d.ts +1 -1
  42. package/lib/AttributePanel/components/blocks/Group/index.d.ts +1 -1
  43. package/lib/AttributePanel/components/blocks/Hero/index.d.ts +1 -1
  44. package/lib/AttributePanel/components/blocks/Image/index.d.ts +1 -1
  45. package/lib/AttributePanel/components/blocks/Navbar/index.d.ts +1 -1
  46. package/lib/AttributePanel/components/blocks/Page/index.d.ts +1 -1
  47. package/lib/AttributePanel/components/blocks/Raw/index.d.ts +1 -1
  48. package/lib/AttributePanel/components/blocks/Section/index.d.ts +1 -1
  49. package/lib/AttributePanel/components/blocks/Social/index.d.ts +1 -1
  50. package/lib/AttributePanel/components/blocks/Spacer/index.d.ts +1 -1
  51. package/lib/AttributePanel/components/blocks/Table/index.d.ts +1 -1
  52. package/lib/AttributePanel/components/blocks/Text/index.d.ts +1 -1
  53. package/lib/AttributePanel/components/blocks/Wrapper/index.d.ts +1 -1
  54. package/lib/AttributePanel/components/blocks/index.d.ts +42 -42
  55. package/lib/AttributePanel/components/provider/PresetColorsProvider/index.d.ts +6 -6
  56. package/lib/AttributePanel/components/provider/SelectionRangeProvider/index.d.ts +6 -6
  57. package/lib/AttributePanel/hooks/useSelectionRange.d.ts +6 -6
  58. package/lib/AttributePanel/index.d.ts +3 -3
  59. package/lib/AttributePanel/utils/BlockAttributeConfigurationManager.d.ts +10 -10
  60. package/lib/AttributePanel/utils/InputNumberAdapter.d.ts +2 -2
  61. package/lib/AttributePanel/utils/PromiseEach.d.ts +1 -1
  62. package/lib/AttributePanel/utils/Uploader.d.ts +35 -35
  63. package/lib/AttributePanel/utils/awaitForElement.d.ts +4 -4
  64. package/lib/AttributePanel/utils/classnames.d.ts +1 -1
  65. package/lib/AttributePanel/utils/getImg.d.ts +8 -8
  66. package/lib/AttributePanel/utils/onDrag.d.ts +10 -10
  67. package/lib/AttributePanel/utils/previewLoadImage.d.ts +1 -1
  68. package/lib/BlockLayer/components/BlockTree/components/BlockTreeItem/index.d.ts +23 -23
  69. package/lib/BlockLayer/components/BlockTree/components/TreeCollapse.d.ts +6 -6
  70. package/lib/BlockLayer/components/BlockTree/index.d.ts +29 -29
  71. package/lib/BlockLayer/components/ContextMenu/index.d.ts +14 -14
  72. package/lib/BlockLayer/components/EyeIcon/index.d.ts +7 -7
  73. package/lib/BlockLayer/index.d.ts +7 -7
  74. package/lib/InteractivePrompt/components/FocusTooltip.d.ts +1 -1
  75. package/lib/InteractivePrompt/components/HoverTooltip.d.ts +1 -1
  76. package/lib/InteractivePrompt/components/Toolbar.d.ts +5 -5
  77. package/lib/InteractivePrompt/index.d.ts +1 -1
  78. package/lib/InteractivePrompt/utils/awaitForElement.d.ts +4 -4
  79. package/lib/ShortcutToolbar/ShortcutToolbar.d.ts +1 -1
  80. package/lib/ShortcutToolbar/components/BlockMaskWrapper/index.d.ts +6 -6
  81. package/lib/ShortcutToolbar/components/BlocksPanel/index.d.ts +2 -2
  82. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/AccordionBlockItem/index.d.ts +1 -1
  83. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ButtonBlockItem/index.d.ts +1 -1
  84. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/CarouselBlockItem/index.d.ts +1 -1
  85. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ColumnBlockItem/index.d.ts +1 -1
  86. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/DividerBlockItem/index.d.ts +1 -1
  87. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/GroupBlockItem/index.d.ts +1 -1
  88. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/HeroBlockItem/index.d.ts +1 -1
  89. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ImageBlockItem/index.d.ts +1 -1
  90. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/NavbarBlockItem/index.d.ts +1 -1
  91. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/RawBlockItem/index.d.ts +1 -1
  92. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SectionBlockItem/index.d.ts +1 -1
  93. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SocialBlockItem/index.d.ts +1 -1
  94. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SpacerBlockItem/index.d.ts +1 -1
  95. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/TextBlockItem/index.d.ts +1 -1
  96. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/WrapperBlockItem/index.d.ts +1 -1
  97. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/index.d.ts +18 -18
  98. package/lib/ShortcutToolbar/components/Picture/index.d.ts +7 -7
  99. package/lib/ShortcutToolbar/index.d.ts +4 -4
  100. package/lib/ShortcutToolbar/utils/BlockMarketManager.d.ts +32 -32
  101. package/lib/ShortcutToolbar/utils/getImg.d.ts +68 -68
  102. package/lib/SimpleLayout/SimpleLayout.d.ts +2 -2
  103. package/lib/SimpleLayout/index.d.ts +1 -1
  104. package/lib/SourceCodePanel/index.d.ts +1 -1
  105. package/lib/components/AddToCollection/index.d.ts +5 -5
  106. package/lib/components/Form/AddFont.d.ts +1 -1
  107. package/lib/components/Form/AutoComplete.d.ts +11 -11
  108. package/lib/components/Form/CheckBoxGroup.d.ts +14 -14
  109. package/lib/components/Form/CodemirrorEditor/index.d.ts +8 -8
  110. package/lib/components/Form/ColorPicker.d.ts +10 -10
  111. package/lib/components/Form/EditTab.d.ts +10 -10
  112. package/lib/components/Form/ImageUploader/index.d.ts +8 -8
  113. package/lib/components/Form/InlineTextField/index.d.ts +7 -7
  114. package/lib/components/Form/Input.d.ts +7 -7
  115. package/lib/components/Form/RadioGroup.d.ts +13 -13
  116. package/lib/components/Form/RichTextField/index.d.ts +2 -3
  117. package/lib/components/Form/RichTextToolBar/RichTextToolBar.d.ts +1 -0
  118. package/lib/components/Form/{RichTextField → RichTextToolBar}/components/FontFamily/index.d.ts +3 -3
  119. package/lib/components/Form/{RichTextField → RichTextToolBar}/components/FontSizeList/index.d.ts +3 -3
  120. package/lib/components/Form/{RichTextField → RichTextToolBar}/components/Heading/index.d.ts +3 -3
  121. package/lib/components/Form/{RichTextField → RichTextToolBar}/components/Link/index.d.ts +12 -12
  122. package/lib/components/Form/{RichTextField/components/TextToolbar → RichTextToolBar/components/MergeTags}/MergeTags.d.ts +6 -6
  123. package/lib/components/Form/RichTextToolBar/components/MergeTags/index.d.ts +1 -0
  124. package/lib/components/Form/{RichTextField → RichTextToolBar}/components/ToolItem/index.d.ts +7 -7
  125. package/lib/components/Form/RichTextToolBar/components/Tools/Tools.d.ts +5 -0
  126. package/lib/components/Form/RichTextToolBar/components/Tools/index.d.ts +1 -0
  127. package/lib/components/Form/RichTextToolBar/index.d.ts +1 -0
  128. package/lib/components/Form/Select.d.ts +11 -11
  129. package/lib/components/Form/UploadField.d.ts +8 -8
  130. package/lib/components/Form/enhancer.d.ts +20 -20
  131. package/lib/components/Form/index.d.ts +29 -29
  132. package/lib/components/RenderCount/index.d.ts +1 -1
  133. package/lib/components/ShadowDom/index.d.ts +2 -2
  134. package/lib/hooks/useAddToCollection.d.ts +6 -6
  135. package/lib/index.d.ts +8 -8
  136. package/lib/index2.js +218 -247
  137. package/lib/index2.js.map +1 -1
  138. package/lib/index3.js.map +1 -1
  139. package/lib/utils/awaitForElement.d.ts +4 -4
  140. package/lib/utils/classnames.d.ts +1 -1
  141. package/package.json +13 -3
  142. package/readme.md +138 -138
  143. package/lib/components/Form/RichTextField/components/TextToolbar/index.d.ts +0 -5
@@ -1,4 +1,4 @@
1
- export declare function awaitForElement<T extends HTMLElement>(idx: string): {
2
- cancel: () => void;
3
- promise: Promise<T>;
4
- };
1
+ export declare function awaitForElement<T extends HTMLElement>(idx: string): {
2
+ cancel: () => void;
3
+ promise: Promise<T>;
4
+ };
@@ -1 +1 @@
1
- export declare function classnames(...rest: any[]): string;
1
+ export declare function classnames(...rest: any[]): string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "easy-email-extensions",
3
3
  "license": "MIT",
4
4
  "description": "Email editor",
5
- "version": "3.0.9",
5
+ "version": "3.0.13",
6
6
  "author": "m-Ryan",
7
7
  "repository": {
8
8
  "type": "git",
@@ -19,7 +19,8 @@
19
19
  "scripts": {
20
20
  "dev": "vite",
21
21
  "typings": "tsc --declaration --emitDeclarationOnly --project tsconfig.lib.json",
22
- "build": "rimraf lib && npm run typings && vite build --config vite.config.ts"
22
+ "build": "rimraf lib && npm run typings && vite build --config vite.config.ts",
23
+ "format": "eslint --fix --ext .tsx,.ts src/"
23
24
  },
24
25
  "husky": {
25
26
  "hooks": {
@@ -36,8 +37,17 @@
36
37
  "@types/node": "^16.11.7",
37
38
  "@types/react": "17.0.2",
38
39
  "@types/react-dom": "^17.0.11",
40
+ "@typescript-eslint/eslint-plugin": "^4.28.3",
41
+ "@typescript-eslint/parser": "^4.28.3",
39
42
  "@vitejs/plugin-react-refresh": "^1.3.6",
40
43
  "cross-env": "^7.0.3",
44
+ "eslint": "^7.31.0",
45
+ "eslint-config-prettier": "^8.3.0",
46
+ "eslint-loader": "^4.0.2",
47
+ "eslint-plugin-import": "^2.23.4",
48
+ "eslint-plugin-prettier": "^3.4.0",
49
+ "eslint-plugin-react": "^7.24.0",
50
+ "eslint-plugin-react-hooks": "^4.2.0",
41
51
  "lerna": "^4.0.0",
42
52
  "less": "^4.1.2",
43
53
  "react": "^17.0.2",
@@ -75,5 +85,5 @@
75
85
  "react-sortablejs": "^6.0.0",
76
86
  "sortablejs": "^1.14.0"
77
87
  },
78
- "gitHead": "973126de5ffbc552d0bb9b0b4e54316b6253c8b9"
88
+ "gitHead": "f3659bc947a83a8092bd35bc9a0b576d8d607d34"
79
89
  }
package/readme.md CHANGED
@@ -1,138 +1,138 @@
1
- # Easy-email-extensions
2
-
3
- ## Introduction
4
-
5
- Provide default UI components, when they don’t meet your needs, you can refer to it and write your own
6
-
7
- ## usage
8
-
9
- ```sh
10
- $ npm install --save easy-email-extensions
11
- ```
12
-
13
- or
14
-
15
- ```sh
16
- $ yarn add easy-email-extensions
17
- ```
18
-
19
- ```js
20
- import React from 'react';
21
- import { BlockManager, BasicType } from 'easy-email-core';
22
- import { EmailEditor, EmailEditorProvider } from 'easy-email-editor';
23
- import { SimpleLayout } from 'easy-email-extensions';
24
-
25
- import 'easy-email-editor/lib/style.css';
26
- import 'easy-email-extensions/lib/style.css';
27
-
28
- const initialValues = {
29
- subject: 'Welcome to Easy-email',
30
- subTitle: 'Nice to meet you!',
31
- content: BlockManager.getBlockByType(BasicType.PAGE)!.create({}),
32
- };
33
-
34
- export function App() {
35
- return (
36
- <EmailEditorProvider
37
- data={initialValues}
38
- height={'calc(100vh - 72px)'}
39
- autoComplete
40
- dashed={false}
41
- >
42
- {({ values }) => {
43
- return (
44
- <SimpleLayout>
45
- <EmailEditor />
46
- </SimpleLayout>
47
- );
48
- }}
49
- </EmailEditorProvider>
50
- );
51
- }
52
- ```
53
-
54
- ## Extensions
55
-
56
- - `AttributePanel`
57
-
58
- - Basic block configuration panel
59
-
60
- - <img src="https://assets.maocanhua.cn/3e74a61d-ab22-4cf3-afc9-d511b82e08cd-image.png" alt="AttributePanel">
61
-
62
- - You can add or overwrite
63
-
64
- ```tsx
65
- import { BlockAttributeConfigurationManager } from "easy-email-extensions";
66
-
67
- BlockAttributeConfigurationManager.add({
68
- [BasicType.TEXT]: () => <div>will be overwrite `Text`</div>,
69
- });
70
- ```
71
-
72
- - `InteractivePrompt`
73
-
74
- - block hover and focus style
75
-
76
- - <img src="https://assets.maocanhua.cn/298d72d6-a509-4cd2-85c7-dfb915971620-image.png" alt="InteractivePrompt">
77
-
78
- - No configuration items
79
-
80
- - `BlockLayer`
81
-
82
- - <img src="https://assets.maocanhua.cn/de1f5211-350e-43c9-9c99-d97a2f196e04-image.png" alt="ShortcutToolbar">
83
- - No configuration items
84
-
85
- - `ShortcutToolbar`
86
-
87
- - <img src="https://assets.maocanhua.cn/f0e2ccc6-0627-472b-ad78-bc92bdb46ad1-image.png">
88
- - You can add or overwrite popover's preset blocks
89
-
90
- ```tsx
91
- import { BasicType } from "easy-email-core";
92
- import {
93
- BlockMarketManager,
94
- BlockMaskWrapper,
95
- } from "easy-email-extensions";
96
-
97
- BlockMarketManager.addCategories([
98
- {
99
- title: "Custom",
100
- name: "custom",
101
- blocks: [
102
- {
103
- type: BasicType.TEXT,
104
- title: "Text",
105
- description: "This block allows you to display text in your email.",
106
- component: () => {
107
- return (
108
- <BlockMaskWrapper
109
- type={BasicType.TEXT}
110
- payload={{
111
- attributes: {
112
- "font-size": "20px",
113
- align: "center",
114
- padding: "0px 0px 0px 0px",
115
- color: "#4A90E2",
116
- },
117
- data: {
118
- value: {
119
- content: "20px",
120
- },
121
- },
122
- }}
123
- >
124
- <div style={{ fontSize: 20, width: "100%", paddingLeft: 20 }}>
125
- 20px
126
- </div>
127
- </BlockMaskWrapper>
128
- );
129
- },
130
- },
131
- ],
132
- },
133
- ]);
134
- ```
135
-
136
- - `SimpleLayout`
137
-
138
- - All in one extension, provide basic and complete layout example. Refer to the above extension for configuration items.
1
+ # Easy-email-extensions
2
+
3
+ ## Introduction
4
+
5
+ Provide default UI components, when they don’t meet your needs, you can refer to it and write your own
6
+
7
+ ## usage
8
+
9
+ ```sh
10
+ $ npm install --save easy-email-extensions
11
+ ```
12
+
13
+ or
14
+
15
+ ```sh
16
+ $ yarn add easy-email-extensions
17
+ ```
18
+
19
+ ```js
20
+ import React from 'react';
21
+ import { BlockManager, BasicType } from 'easy-email-core';
22
+ import { EmailEditor, EmailEditorProvider } from 'easy-email-editor';
23
+ import { SimpleLayout } from 'easy-email-extensions';
24
+
25
+ import 'easy-email-editor/lib/style.css';
26
+ import 'easy-email-extensions/lib/style.css';
27
+
28
+ const initialValues = {
29
+ subject: 'Welcome to Easy-email',
30
+ subTitle: 'Nice to meet you!',
31
+ content: BlockManager.getBlockByType(BasicType.PAGE)!.create({}),
32
+ };
33
+
34
+ export function App() {
35
+ return (
36
+ <EmailEditorProvider
37
+ data={initialValues}
38
+ height={'calc(100vh - 72px)'}
39
+ autoComplete
40
+ dashed={false}
41
+ >
42
+ {({ values }) => {
43
+ return (
44
+ <SimpleLayout>
45
+ <EmailEditor />
46
+ </SimpleLayout>
47
+ );
48
+ }}
49
+ </EmailEditorProvider>
50
+ );
51
+ }
52
+ ```
53
+
54
+ ## Extensions
55
+
56
+ - `AttributePanel`
57
+
58
+ - Basic block configuration panel
59
+
60
+ - <img src="https://assets.maocanhua.cn/3e74a61d-ab22-4cf3-afc9-d511b82e08cd-image.png" alt="AttributePanel">
61
+
62
+ - You can add or overwrite
63
+
64
+ ```tsx
65
+ import { BlockAttributeConfigurationManager } from "easy-email-extensions";
66
+
67
+ BlockAttributeConfigurationManager.add({
68
+ [BasicType.TEXT]: () => <div>will be overwrite `Text`</div>,
69
+ });
70
+ ```
71
+
72
+ - `InteractivePrompt`
73
+
74
+ - block hover and focus style
75
+
76
+ - <img src="https://assets.maocanhua.cn/298d72d6-a509-4cd2-85c7-dfb915971620-image.png" alt="InteractivePrompt">
77
+
78
+ - No configuration items
79
+
80
+ - `BlockLayer`
81
+
82
+ - <img src="https://assets.maocanhua.cn/de1f5211-350e-43c9-9c99-d97a2f196e04-image.png" alt="ShortcutToolbar">
83
+ - No configuration items
84
+
85
+ - `ShortcutToolbar`
86
+
87
+ - <img src="https://assets.maocanhua.cn/f0e2ccc6-0627-472b-ad78-bc92bdb46ad1-image.png">
88
+ - You can add or overwrite popover's preset blocks
89
+
90
+ ```tsx
91
+ import { BasicType } from "easy-email-core";
92
+ import {
93
+ BlockMarketManager,
94
+ BlockMaskWrapper,
95
+ } from "easy-email-extensions";
96
+
97
+ BlockMarketManager.addCategories([
98
+ {
99
+ title: "Custom",
100
+ name: "custom",
101
+ blocks: [
102
+ {
103
+ type: BasicType.TEXT,
104
+ title: "Text",
105
+ description: "This block allows you to display text in your email.",
106
+ component: () => {
107
+ return (
108
+ <BlockMaskWrapper
109
+ type={BasicType.TEXT}
110
+ payload={{
111
+ attributes: {
112
+ "font-size": "20px",
113
+ align: "center",
114
+ padding: "0px 0px 0px 0px",
115
+ color: "#4A90E2",
116
+ },
117
+ data: {
118
+ value: {
119
+ content: "20px",
120
+ },
121
+ },
122
+ }}
123
+ >
124
+ <div style={{ fontSize: 20, width: "100%", paddingLeft: 20 }}>
125
+ 20px
126
+ </div>
127
+ </BlockMaskWrapper>
128
+ );
129
+ },
130
+ },
131
+ ],
132
+ },
133
+ ]);
134
+ ```
135
+
136
+ - `SimpleLayout`
137
+
138
+ - All in one extension, provide basic and complete layout example. Refer to the above extension for configuration items.
@@ -1,5 +0,0 @@
1
- export interface TextToolbarProps {
2
- onChange: (content: string) => any;
3
- container: HTMLElement | null;
4
- }
5
- export declare function TextToolbar(props: TextToolbarProps): JSX.Element;