easy-email-extensions 2.5.2-beta.0

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 -0
  2. package/lib/AttributePanel/components/UI/Help/HtmlEditor.d.ts +5 -0
  3. package/lib/AttributePanel/components/UI/Help/index.d.ts +5 -0
  4. package/lib/AttributePanel/components/attributes/Align.d.ts +1 -0
  5. package/lib/AttributePanel/components/attributes/AttributesPanelWrapper.d.ts +6 -0
  6. package/lib/AttributePanel/components/attributes/Background.d.ts +1 -0
  7. package/lib/AttributePanel/components/attributes/BackgroundColor.d.ts +3 -0
  8. package/lib/AttributePanel/components/attributes/Border.d.ts +1 -0
  9. package/lib/AttributePanel/components/attributes/BorderColor.d.ts +1 -0
  10. package/lib/AttributePanel/components/attributes/BorderStyle.d.ts +5 -0
  11. package/lib/AttributePanel/components/attributes/BorderWidth.d.ts +1 -0
  12. package/lib/AttributePanel/components/attributes/Color.d.ts +4 -0
  13. package/lib/AttributePanel/components/attributes/ContainerBackgroundColor.d.ts +3 -0
  14. package/lib/AttributePanel/components/attributes/Decoration.d.ts +1 -0
  15. package/lib/AttributePanel/components/attributes/Direction.d.ts +1 -0
  16. package/lib/AttributePanel/components/attributes/FontFamliy.d.ts +1 -0
  17. package/lib/AttributePanel/components/attributes/FontSize.d.ts +1 -0
  18. package/lib/AttributePanel/components/attributes/FontStyle.d.ts +3 -0
  19. package/lib/AttributePanel/components/attributes/FontWeight.d.ts +1 -0
  20. package/lib/AttributePanel/components/attributes/Height.d.ts +3 -0
  21. package/lib/AttributePanel/components/attributes/LetterSpacing.d.ts +1 -0
  22. package/lib/AttributePanel/components/attributes/LineHeight.d.ts +1 -0
  23. package/lib/AttributePanel/components/attributes/Link.d.ts +1 -0
  24. package/lib/AttributePanel/components/attributes/Margin.d.ts +1 -0
  25. package/lib/AttributePanel/components/attributes/MergeTags.d.ts +6 -0
  26. package/lib/AttributePanel/components/attributes/NavbarLinkPadding.d.ts +3 -0
  27. package/lib/AttributePanel/components/attributes/Padding.d.ts +5 -0
  28. package/lib/AttributePanel/components/attributes/TextAlign.d.ts +1 -0
  29. package/lib/AttributePanel/components/attributes/TextDecoration.d.ts +1 -0
  30. package/lib/AttributePanel/components/attributes/TextTransform.d.ts +1 -0
  31. package/lib/AttributePanel/components/attributes/VerticalAlign.d.ts +3 -0
  32. package/lib/AttributePanel/components/attributes/Width.d.ts +3 -0
  33. package/lib/AttributePanel/components/blocks/Accordion/index.d.ts +1 -0
  34. package/lib/AttributePanel/components/blocks/AccordionElement/index.d.ts +1 -0
  35. package/lib/AttributePanel/components/blocks/AccordionText/index.d.ts +1 -0
  36. package/lib/AttributePanel/components/blocks/AccordionTitle/index.d.ts +1 -0
  37. package/lib/AttributePanel/components/blocks/Button/index.d.ts +1 -0
  38. package/lib/AttributePanel/components/blocks/Carousel/index.d.ts +1 -0
  39. package/lib/AttributePanel/components/blocks/Column/index.d.ts +1 -0
  40. package/lib/AttributePanel/components/blocks/Divider/index.d.ts +1 -0
  41. package/lib/AttributePanel/components/blocks/Group/index.d.ts +1 -0
  42. package/lib/AttributePanel/components/blocks/Hero/index.d.ts +1 -0
  43. package/lib/AttributePanel/components/blocks/Image/index.d.ts +1 -0
  44. package/lib/AttributePanel/components/blocks/Navbar/index.d.ts +1 -0
  45. package/lib/AttributePanel/components/blocks/Page/index.d.ts +1 -0
  46. package/lib/AttributePanel/components/blocks/Raw/index.d.ts +1 -0
  47. package/lib/AttributePanel/components/blocks/Section/index.d.ts +1 -0
  48. package/lib/AttributePanel/components/blocks/Social/index.d.ts +1 -0
  49. package/lib/AttributePanel/components/blocks/Spacer/index.d.ts +1 -0
  50. package/lib/AttributePanel/components/blocks/Table/index.d.ts +1 -0
  51. package/lib/AttributePanel/components/blocks/Text/index.d.ts +1 -0
  52. package/lib/AttributePanel/components/blocks/Wrapper/index.d.ts +1 -0
  53. package/lib/AttributePanel/components/blocks/index.d.ts +42 -0
  54. package/lib/AttributePanel/components/provider/PresetColorsProvider/index.d.ts +6 -0
  55. package/lib/AttributePanel/components/provider/SelectionRangeProvider/index.d.ts +6 -0
  56. package/lib/AttributePanel/hooks/useSelectionRange.d.ts +6 -0
  57. package/lib/AttributePanel/index.d.ts +3 -0
  58. package/lib/AttributePanel/utils/BlockAttributeConfigurationManager.d.ts +10 -0
  59. package/lib/AttributePanel/utils/InputNumberAdapter.d.ts +2 -0
  60. package/lib/AttributePanel/utils/PromiseEach.d.ts +1 -0
  61. package/lib/AttributePanel/utils/Uploader.d.ts +35 -0
  62. package/lib/AttributePanel/utils/awaitForElement.d.ts +4 -0
  63. package/lib/AttributePanel/utils/classnames.d.ts +1 -0
  64. package/lib/AttributePanel/utils/getEditNode.d.ts +2 -0
  65. package/lib/AttributePanel/utils/getImg.d.ts +8 -0
  66. package/lib/AttributePanel/utils/onDrag.d.ts +10 -0
  67. package/lib/AttributePanel/utils/previewLoadImage.d.ts +1 -0
  68. package/lib/BlockLayer/components/BlockTree/components/BlockTreeItem/index.d.ts +23 -0
  69. package/lib/BlockLayer/components/BlockTree/components/TreeCollapse.d.ts +6 -0
  70. package/lib/BlockLayer/components/BlockTree/index.d.ts +29 -0
  71. package/lib/BlockLayer/components/ContextMenu/index.d.ts +14 -0
  72. package/lib/BlockLayer/components/EyeIcon/index.d.ts +7 -0
  73. package/lib/BlockLayer/index.d.ts +7 -0
  74. package/lib/InteractivePrompt/components/FocusTooltip.d.ts +1 -0
  75. package/lib/InteractivePrompt/components/HoverTooltip.d.ts +1 -0
  76. package/lib/InteractivePrompt/components/Toolbar.d.ts +4 -0
  77. package/lib/InteractivePrompt/constants.d.ts +15 -0
  78. package/lib/InteractivePrompt/index.d.ts +1 -0
  79. package/lib/InteractivePrompt/utils/awaitForElement.d.ts +4 -0
  80. package/lib/ShortcutToolbar/ShortcutToolbar.d.ts +1 -0
  81. package/lib/ShortcutToolbar/components/BlockMaskWrapper/index.d.ts +6 -0
  82. package/lib/ShortcutToolbar/components/BlocksPanel/index.d.ts +6 -0
  83. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/AccordionBlockItem/index.d.ts +1 -0
  84. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ButtonBlockItem/index.d.ts +1 -0
  85. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/CarouselBlockItem/index.d.ts +1 -0
  86. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ColumnBlockItem/index.d.ts +1 -0
  87. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/DividerBlockItem/index.d.ts +1 -0
  88. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/GroupBlockItem/index.d.ts +1 -0
  89. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/HeroBlockItem/index.d.ts +1 -0
  90. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/ImageBlockItem/index.d.ts +1 -0
  91. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/NavbarBlockItem/index.d.ts +1 -0
  92. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/RawBlockItem/index.d.ts +1 -0
  93. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SectionBlockItem/index.d.ts +1 -0
  94. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SocialBlockItem/index.d.ts +1 -0
  95. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/SpacerBlockItem/index.d.ts +1 -0
  96. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/TextBlockItem/index.d.ts +1 -0
  97. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/WrapperBlockItem/index.d.ts +1 -0
  98. package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/index.d.ts +18 -0
  99. package/lib/ShortcutToolbar/components/Picture/index.d.ts +7 -0
  100. package/lib/ShortcutToolbar/index.d.ts +4 -0
  101. package/lib/ShortcutToolbar/utils/BlockMarketManager.d.ts +32 -0
  102. package/lib/ShortcutToolbar/utils/getImg.d.ts +68 -0
  103. package/lib/SimpleFrame/SimpleFrame.d.ts +2 -0
  104. package/lib/SimpleFrame/index.d.ts +1 -0
  105. package/lib/SourceCodePanel/index.d.ts +1 -0
  106. package/lib/components/AddToCollection/index.d.ts +5 -0
  107. package/lib/components/Form/AddFont.d.ts +1 -0
  108. package/lib/components/Form/AutoComplete.d.ts +11 -0
  109. package/lib/components/Form/ChexkBoxGroup.d.ts +15 -0
  110. package/lib/components/Form/CodemirrorEditor/index.d.ts +8 -0
  111. package/lib/components/Form/ColorPicker.d.ts +10 -0
  112. package/lib/components/Form/EditTab.d.ts +10 -0
  113. package/lib/components/Form/ImageUploader/index.d.ts +8 -0
  114. package/lib/components/Form/InlineTextField/index.d.ts +8 -0
  115. package/lib/components/Form/Input.d.ts +7 -0
  116. package/lib/components/Form/RadioGroup.d.ts +13 -0
  117. package/lib/components/Form/RichTextField/components/FontFamily/index.d.ts +3 -0
  118. package/lib/components/Form/RichTextField/components/FontSizeList/index.d.ts +3 -0
  119. package/lib/components/Form/RichTextField/components/Heading/index.d.ts +3 -0
  120. package/lib/components/Form/RichTextField/components/Link/index.d.ts +12 -0
  121. package/lib/components/Form/RichTextField/components/TextToolbar/MergeTags.d.ts +6 -0
  122. package/lib/components/Form/RichTextField/components/TextToolbar/index.d.ts +5 -0
  123. package/lib/components/Form/RichTextField/components/ToolItem/index.d.ts +7 -0
  124. package/lib/components/Form/RichTextField/index.d.ts +3 -0
  125. package/lib/components/Form/Select.d.ts +11 -0
  126. package/lib/components/Form/TreeSelect.d.ts +16 -0
  127. package/lib/components/Form/UploadField.d.ts +8 -0
  128. package/lib/components/Form/enhancer.d.ts +20 -0
  129. package/lib/components/Form/index.d.ts +36 -0
  130. package/lib/components/ShadowDom/index.d.ts +2 -0
  131. package/lib/hooks/useAddToCollection.d.ts +6 -0
  132. package/lib/index.d.ts +7 -0
  133. package/lib/index.js +7 -0
  134. package/lib/index.js.map +1 -0
  135. package/lib/index2.js +52688 -0
  136. package/lib/index2.js.map +1 -0
  137. package/lib/index3.js +11645 -0
  138. package/lib/index3.js.map +1 -0
  139. package/lib/style.css +1 -0
  140. package/lib/utils/awaitForElement.d.ts +4 -0
  141. package/lib/utils/classnames.d.ts +1 -0
  142. package/package.json +78 -0
  143. package/readme.md +130 -0
@@ -0,0 +1,4 @@
1
+ export declare function awaitForElement<T extends HTMLElement>(idx: string): {
2
+ cancel: () => void;
3
+ promise: Promise<T>;
4
+ };
@@ -0,0 +1 @@
1
+ export declare function classnames(...rest: any[]): string;
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "easy-email-extensions",
3
+ "license": "MIT",
4
+ "description": "Email editor",
5
+ "version": "2.5.2-beta.0",
6
+ "author": "m-Ryan",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git@github.com:m-Ryan/easy-email.git"
10
+ },
11
+ "keywords": [
12
+ "email editor core"
13
+ ],
14
+ "files": [
15
+ "lib"
16
+ ],
17
+ "main": "lib/index.js",
18
+ "types": "lib/index.d.ts",
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "typings": "tsc --declaration --emitDeclarationOnly --project tsconfig.lib.json",
22
+ "build": "rimraf lib && npm run typings && vite build --config vite.config.ts"
23
+ },
24
+ "husky": {
25
+ "hooks": {
26
+ "pre-commit": "yarn test && yarn lint-staged"
27
+ }
28
+ },
29
+ "lint-staged": {
30
+ "src/*.{js,jsx,ts,tsx}, example/*.{js,jsx,ts,tsx}": [
31
+ "yarn lint"
32
+ ]
33
+ },
34
+ "devDependencies": {
35
+ "@types/lodash": "^4.14.177",
36
+ "@types/node": "^16.11.7",
37
+ "@types/react": "17.0.2",
38
+ "@types/react-dom": "^17.0.11",
39
+ "@vitejs/plugin-react-refresh": "^1.3.6",
40
+ "cross-env": "^7.0.3",
41
+ "lerna": "^4.0.0",
42
+ "less": "^4.1.2",
43
+ "rollup-plugin-visualizer": "^5.5.2",
44
+ "sass": "^1.43.4",
45
+ "tsc-alias": "^1.4.1",
46
+ "typescript": "^4.4.4",
47
+ "vite": "^2.6.14",
48
+ "vite-plugin-html": "^2.1.1",
49
+ "vite-plugin-style-import": "^1.3.0"
50
+ },
51
+ "dependencies": {
52
+ "antd": "^4.16.13",
53
+ "codemirror": "^5.63.3",
54
+ "final-form": "^4.20.4",
55
+ "final-form-arrays": "^3.0.2",
56
+ "final-form-set-field-touched": "^1.0.1",
57
+ "is-hotkey": "^0.2.0",
58
+ "lodash": "^4.17.21",
59
+ "lodash-es": "^4.17.21",
60
+ "mjml-browser": "^4.10.4",
61
+ "react": "^17.0.2",
62
+ "react-codemirror2": "^7.2.1",
63
+ "react-color": "^2.19.3",
64
+ "react-dom": "^17.0.2",
65
+ "react-final-form": "^6.5.7",
66
+ "react-final-form-arrays": "^3.1.3",
67
+ "react-sortablejs": "^6.0.0",
68
+ "react-use": "^17.3.1",
69
+ "sortablejs": "^1.14.0"
70
+ },
71
+ "peerDependencies": {
72
+ "antd": "^4.16.13",
73
+ "react": "^17.0.2",
74
+ "react-dom": "^17.0.2",
75
+ "react-final-form": "^6.5.7"
76
+ },
77
+ "gitHead": "ef46bf4efb676bb617dd589216c01a59f4ef0f50"
78
+ }
package/readme.md ADDED
@@ -0,0 +1,130 @@
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 { BlocksMap, EmailEditor, EmailEditorProvider } from "easy-email-editor";
22
+ import "easy-email-editor/lib/style.css";
23
+ import "antd/dist/antd.css";
24
+
25
+ const initialValues = {
26
+ subject: "Welcome to Easy-email",
27
+ subTitle: "Nice to meet you!",
28
+ content: BlocksMap.getBlock("Page").create({}),
29
+ };
30
+
31
+ export function App() {
32
+ return (
33
+ <EmailEditorProvider data={initialValues} height={"calc(100vh - 72px)"}>
34
+ {({ values }) => {
35
+ return (
36
+ <SimpleFrame>
37
+ <EmailEditor />
38
+ </SimpleFrame>
39
+ );
40
+ }}
41
+ </EmailEditorProvider>
42
+ );
43
+ }
44
+ ```
45
+
46
+ ## Extensions
47
+
48
+ - `AttributePanel`
49
+
50
+ - Basic block configuration panel
51
+
52
+ - <img src="https://assets.maocanhua.cn/3e74a61d-ab22-4cf3-afc9-d511b82e08cd-image.png" alt="AttributePanel">
53
+
54
+ - You can add or overwrite
55
+
56
+ ```tsx
57
+ import { BlockAttributeConfigurationManager } from "easy-email-extensions";
58
+
59
+ BlockAttributeConfigurationManager.add({
60
+ [BasicType.TEXT]: () => <div>will be overwrite `Text`</div>,
61
+ });
62
+ ```
63
+
64
+ - `InteractivePrompt`
65
+
66
+ - block hover and focus style
67
+
68
+ - <img src="https://assets.maocanhua.cn/298d72d6-a509-4cd2-85c7-dfb915971620-image.png" alt="InteractivePrompt">
69
+
70
+ - No configuration items
71
+
72
+ - `BlockLayer`
73
+
74
+ - <img src="https://assets.maocanhua.cn/de1f5211-350e-43c9-9c99-d97a2f196e04-image.png" alt="ShortcutToolbar">
75
+ - No configuration items
76
+
77
+ - `ShortcutToolbar`
78
+
79
+ - <img src="https://assets.maocanhua.cn/f0e2ccc6-0627-472b-ad78-bc92bdb46ad1-image.png">
80
+ - You can add or overwrite popover's preset blocks
81
+
82
+ ```tsx
83
+ import { BasicType } from "easy-email-core";
84
+ import {
85
+ BlockMarketManager,
86
+ BlockMaskWrapper,
87
+ } from "easy-email-extensions";
88
+
89
+ BlockMarketManager.addCategories([
90
+ {
91
+ title: "Custom",
92
+ name: "custom",
93
+ blocks: [
94
+ {
95
+ type: BasicType.TEXT,
96
+ title: "Text",
97
+ description: "This block allows you to display text in your email.",
98
+ component: () => {
99
+ return (
100
+ <BlockMaskWrapper
101
+ type={BasicType.TEXT}
102
+ payload={{
103
+ attributes: {
104
+ "font-size": "20px",
105
+ align: "center",
106
+ padding: "0px 0px 0px 0px",
107
+ color: "#4A90E2",
108
+ },
109
+ data: {
110
+ value: {
111
+ content: "20px",
112
+ },
113
+ },
114
+ }}
115
+ >
116
+ <div style={{ fontSize: 20, width: "100%", paddingLeft: 20 }}>
117
+ 20px
118
+ </div>
119
+ </BlockMaskWrapper>
120
+ );
121
+ },
122
+ },
123
+ ],
124
+ },
125
+ ]);
126
+ ```
127
+
128
+ - `SimpleFrame`
129
+
130
+ - All in one extension, provide basic and complete layout example. Refer to the above extension for configuration items.