suneditor 3.0.0-beta.2 → 3.0.0-beta.21
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/CONTRIBUTING.md +4 -2
- package/README.md +10 -33
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +13 -9
- package/src/assets/design/color.css +11 -1
- package/src/assets/design/size.css +2 -0
- package/src/assets/icons/defaultIcons.js +16 -1
- package/src/assets/suneditor-contents.css +9 -8
- package/src/assets/suneditor.css +43 -35
- package/src/core/base/eventHandlers/handler_toolbar.js +3 -3
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +6 -4
- package/src/core/base/eventHandlers/handler_ww_key_input.js +5 -5
- package/src/core/base/eventManager.js +155 -89
- package/src/core/base/history.js +4 -4
- package/src/core/class/char.js +12 -11
- package/src/core/class/component.js +36 -19
- package/src/core/class/format.js +20 -9
- package/src/core/class/html.js +92 -55
- package/src/core/class/menu.js +12 -1
- package/src/core/class/offset.js +160 -195
- package/src/core/class/selection.js +133 -41
- package/src/core/class/toolbar.js +73 -51
- package/src/core/class/ui.js +11 -9
- package/src/core/class/viewer.js +39 -40
- package/src/core/config/context.js +122 -0
- package/src/core/config/frameContext.js +204 -0
- package/src/core/config/options.js +608 -0
- package/src/core/editor.js +239 -121
- package/src/core/section/actives.js +51 -26
- package/src/core/section/constructor.js +55 -367
- package/src/core/section/documentType.js +47 -26
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_core.js +17 -7
- package/src/editorInjector/index.js +6 -2
- package/src/events.js +12 -0
- package/src/helper/converter.js +39 -11
- package/src/helper/dom/domCheck.js +2 -2
- package/src/helper/dom/domQuery.js +22 -14
- package/src/helper/dom/domUtils.js +89 -8
- package/src/helper/env.js +11 -2
- package/src/modules/Browser.js +3 -1
- package/src/modules/ColorPicker.js +14 -12
- package/src/modules/Controller.js +46 -26
- package/src/modules/Figure.js +145 -84
- package/src/modules/FileManager.js +2 -2
- package/src/modules/HueSlider.js +35 -23
- package/src/modules/ModalAnchorEditor.js +2 -2
- package/src/modules/SelectMenu.js +1 -1
- package/src/plugins/command/blockquote.js +1 -0
- package/src/plugins/command/exportPDF.js +1 -1
- package/src/plugins/command/list_bulleted.js +1 -0
- package/src/plugins/command/list_numbered.js +1 -0
- package/src/plugins/dropdown/align.js +2 -0
- package/src/plugins/dropdown/backgroundColor.js +9 -5
- package/src/plugins/dropdown/font.js +7 -3
- package/src/plugins/dropdown/fontColor.js +9 -5
- package/src/plugins/dropdown/formatBlock.js +5 -13
- package/src/plugins/dropdown/lineHeight.js +2 -1
- package/src/plugins/dropdown/list.js +1 -0
- package/src/plugins/dropdown/table.js +142 -32
- package/src/plugins/input/fontSize.js +7 -3
- package/src/plugins/input/pageNavigator.js +3 -2
- package/src/plugins/modal/audio.js +1 -1
- package/src/plugins/modal/drawing.js +17 -11
- package/src/plugins/modal/embed.js +22 -25
- package/src/plugins/modal/image.js +35 -48
- package/src/plugins/modal/link.js +11 -3
- package/src/plugins/modal/math.js +6 -5
- package/src/plugins/modal/video.js +25 -21
- package/src/plugins/popup/anchor.js +2 -0
- package/src/suneditor.js +22 -15
- package/src/themes/dark.css +11 -1
- package/src/typedef.js +5 -3
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/base/eventManager.d.ts +29 -4
- package/types/core/class/char.d.ts +3 -2
- package/types/core/class/component.d.ts +1 -2
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +9 -1
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/class/offset.d.ts +24 -26
- package/types/core/class/selection.d.ts +2 -0
- package/types/core/class/toolbar.d.ts +24 -11
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/class/viewer.d.ts +1 -1
- package/types/core/config/context.d.ts +157 -0
- package/types/core/config/frameContext.d.ts +367 -0
- package/types/core/config/options.d.ts +1128 -0
- package/types/core/editor.d.ts +78 -35
- package/types/core/section/constructor.d.ts +7 -640
- package/types/core/section/context.d.ts +22 -0
- package/types/core/section/documentType.d.ts +14 -4
- package/types/core/section/options.d.ts +1022 -0
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_core.d.ts +17 -7
- package/types/editorInjector/index.d.ts +6 -2
- package/types/events.d.ts +2 -0
- package/types/helper/converter.d.ts +31 -9
- package/types/helper/dom/domQuery.d.ts +6 -6
- package/types/helper/dom/domUtils.d.ts +24 -2
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +6 -1
- package/types/index.d.ts +5 -0
- package/types/modules/ColorPicker.d.ts +5 -1
- package/types/modules/Controller.d.ts +8 -4
- package/types/modules/Figure.d.ts +31 -9
- package/types/modules/HueSlider.d.ts +4 -1
- package/types/modules/SelectMenu.d.ts +1 -1
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/list_bulleted.d.ts +1 -0
- package/types/plugins/command/list_numbered.d.ts +1 -0
- package/types/plugins/dropdown/align.d.ts +1 -0
- package/types/plugins/dropdown/backgroundColor.d.ts +1 -0
- package/types/plugins/dropdown/font.d.ts +1 -0
- package/types/plugins/dropdown/fontColor.d.ts +1 -0
- package/types/plugins/dropdown/formatBlock.d.ts +3 -2
- package/types/plugins/dropdown/lineHeight.d.ts +1 -0
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/table.d.ts +6 -0
- package/types/plugins/input/fontSize.d.ts +1 -0
- package/types/plugins/modal/drawing.d.ts +4 -0
- package/types/plugins/modal/embed.d.ts +4 -3
- package/types/plugins/modal/link.d.ts +32 -15
- package/types/plugins/modal/video.d.ts +1 -0
- package/types/suneditor.d.ts +13 -9
- package/types/typedef.d.ts +11 -3
- package/src/core/section/context.js +0 -102
package/CONTRIBUTING.md
CHANGED
|
@@ -27,6 +27,8 @@ Node.js **v14 or higher** is required to build and test.
|
|
|
27
27
|
|
|
28
28
|
## ✅ Before Submitting a PR
|
|
29
29
|
|
|
30
|
+
> [commit-guide](./guide/commit-types.md)
|
|
31
|
+
|
|
30
32
|
- Check that no one is working on the same thing in [open issues](https://github.com/jihong88/suneditor/issues).
|
|
31
33
|
- For new features or major changes, please open an issue first to gather feedback.
|
|
32
34
|
- Use a **feature branch** (not `master`) for your pull request.
|
|
@@ -139,6 +141,8 @@ A quick overview of the `src/` directory:
|
|
|
139
141
|
|
|
140
142
|
## 🚀 Useful Commands
|
|
141
143
|
|
|
144
|
+
> [scripts-guide](./guide/scripts-guide.md)
|
|
145
|
+
|
|
142
146
|
```bash
|
|
143
147
|
# Start local dev server
|
|
144
148
|
npm run dev
|
|
@@ -172,8 +176,6 @@ npm run i18n-build
|
|
|
172
176
|
npm run test
|
|
173
177
|
```
|
|
174
178
|
|
|
175
|
-
> [scripts/README](https://github.com/JiHong88/suneditor/blob/develop/scripts/README.md)
|
|
176
|
-
|
|
177
179
|
---
|
|
178
180
|
|
|
179
181
|
Thanks for contributing 💛
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://suneditor.com" target="_blank">
|
|
3
|
-
<img src="https://suneditor-files.s3.ap-northeast-2.amazonaws.com/docs/se3_logo_title_flat.svg" alt="SunEditor" width="280" />
|
|
3
|
+
<img src="https://suneditor-files.s3.ap-northeast-2.amazonaws.com/docs/se3_logo_title_flat.svg?v=1" alt="SunEditor" width="280" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -46,16 +46,19 @@ It's easy to integrate, highly customizable, and built for modern web applicatio
|
|
|
46
46
|
| Browser | Since | Version ≥ |
|
|
47
47
|
| ----------------------------------------------------------------------------------------------------------------------------------- | -------- | --------- |
|
|
48
48
|
|  | Feb 2020 | 80 |
|
|
49
|
-
|  |
|
|
50
|
-
|  |
|
|
49
|
+
|  | Jul 2021 | 90 |
|
|
50
|
+
|  | Apr 2021 | 14.1 |
|
|
51
51
|
|  | Jan 2020 | 80 |
|
|
52
52
|
|  | Feb 2020 | 67 |
|
|
53
|
-
|  |
|
|
53
|
+
|  | Apr 2021 | 14.5 |
|
|
54
54
|
|  | Feb 2020 | 80 |
|
|
55
|
-
|  | Apr 2020 |
|
|
55
|
+
|  | Apr 2020 | 13.0 |
|
|
56
56
|
|
|
57
57
|
❌ Not Supported : IE, Legacy Edge
|
|
58
58
|
|
|
59
|
+
> SunEditor is designed for modern browsers released since 2020.\
|
|
60
|
+
> This includes support for ES2020+ features like optional chaining (?.), nullish coalescing (??), and private class fields (#field).
|
|
61
|
+
|
|
59
62
|
---
|
|
60
63
|
|
|
61
64
|
## 📦 Legacy Version (v2-legacy)
|
|
@@ -87,20 +90,7 @@ import suneditor from 'suneditor';
|
|
|
87
90
|
|
|
88
91
|
// HTML: <div id="editor"></div> or <textarea id="editor"></textarea>
|
|
89
92
|
suneditor.create(document.querySelector('#editor'), {
|
|
90
|
-
|
|
91
|
-
['undo', 'redo'],
|
|
92
|
-
'|',
|
|
93
|
-
['bold', 'underline', 'italic', 'strike', '|', 'subscript', 'superscript'],
|
|
94
|
-
'|',
|
|
95
|
-
['removeFormat'],
|
|
96
|
-
'|',
|
|
97
|
-
['outdent', 'indent'],
|
|
98
|
-
'|',
|
|
99
|
-
['fullScreen', 'showBlocks', 'codeView'],
|
|
100
|
-
'|',
|
|
101
|
-
['preview', 'print', 'copy']
|
|
102
|
-
],
|
|
103
|
-
height: 'auto'
|
|
93
|
+
// options
|
|
104
94
|
});
|
|
105
95
|
```
|
|
106
96
|
|
|
@@ -117,20 +107,7 @@ suneditor.create(document.querySelector('#editor'), {
|
|
|
117
107
|
|
|
118
108
|
<script>
|
|
119
109
|
SUNEDITOR.create(document.querySelector('#editor'), {
|
|
120
|
-
|
|
121
|
-
['undo', 'redo'],
|
|
122
|
-
'|',
|
|
123
|
-
['bold', 'underline', 'italic', 'strike', '|', 'subscript', 'superscript'],
|
|
124
|
-
'|',
|
|
125
|
-
['removeFormat'],
|
|
126
|
-
'|',
|
|
127
|
-
['outdent', 'indent'],
|
|
128
|
-
'|',
|
|
129
|
-
['fullScreen', 'showBlocks', 'codeView'],
|
|
130
|
-
'|',
|
|
131
|
-
['preview', 'print', 'copy']
|
|
132
|
-
],
|
|
133
|
-
height: 'auto'
|
|
110
|
+
// options
|
|
134
111
|
});
|
|
135
112
|
</script>
|
|
136
113
|
```
|