suneditor 3.3.0 → 3.3.2
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/README.md +18 -1
- package/dist/suneditor.min.css +2 -2
- package/dist/suneditor.min.js +1 -1
- package/package.json +3 -2
- package/src/assets/suneditor.css +5117 -5105
- package/src/core/config/eventManager.js +24 -1
- package/src/core/editor.js +6 -1
- package/src/core/event/effects/keydown.registry.js +14 -9
- package/src/core/event/effects/ruleHelpers.js +119 -1
- package/src/core/event/eventOrchestrator.js +15 -6
- package/src/core/event/rules/keydown.rule.backspace.js +10 -47
- package/src/core/event/rules/keydown.rule.delete.js +28 -66
- package/src/core/logic/dom/format.js +2 -2
- package/src/core/logic/dom/html.js +85 -5
- package/src/core/logic/dom/nodeTransform.js +5 -3
- package/src/core/logic/panel/blockHandle.js +61 -24
- package/src/core/logic/panel/blockResolver.js +41 -4
- package/src/core/logic/shell/pluginManager.js +15 -2
- package/src/core/logic/shell/ui.js +38 -28
- package/src/core/schema/options.js +20 -3
- package/src/core/section/constructor.js +12 -8
- package/src/events.js +1 -1
- package/src/helper/dom/domQuery.js +10 -4
- package/src/helper/googleDocs.js +40 -0
- package/src/helper/index.js +3 -0
- package/src/modules/contract/Figure.js +5 -2
- package/src/modules/ui/CommandMenu.js +47 -5
- package/src/modules/ui/SelectMenu.js +97 -36
- package/src/plugins/dropdown/table/index.js +25 -8
- package/src/plugins/dropdown/table/shared/table.constants.js +2 -0
- package/src/plugins/field/slashCommand.js +59 -12
- package/types/core/event/effects/ruleHelpers.d.ts +56 -0
- package/types/core/logic/panel/blockHandle.d.ts +3 -16
- package/types/core/logic/shell/ui.d.ts +14 -5
- package/types/core/schema/options.d.ts +31 -5
- package/types/events.d.ts +2 -2
- package/types/helper/dom/domQuery.d.ts +4 -2
- package/types/helper/googleDocs.d.ts +19 -0
- package/types/helper/index.d.ts +5 -0
- package/types/modules/ui/CommandMenu.d.ts +11 -0
- package/types/modules/ui/SelectMenu.d.ts +13 -7
- package/types/plugins/dropdown/table/index.d.ts +11 -0
- package/types/plugins/dropdown/table/shared/table.constants.d.ts +1 -0
- package/types/plugins/field/slashCommand.d.ts +43 -2
package/README.md
CHANGED
|
@@ -148,15 +148,32 @@ Vue – [suneditor-vue](https://github.com/JiHong88/suneditor-vue)
|
|
|
148
148
|
SunEditor supports a plugin-based architecture.\
|
|
149
149
|
You can enable only the plugins you need or even create your own custom ones.
|
|
150
150
|
|
|
151
|
+
Pass the plugins you want as an array of plugin classes:
|
|
152
|
+
|
|
151
153
|
```js
|
|
154
|
+
import suneditor from 'suneditor';
|
|
155
|
+
import { font, image, video } from 'suneditor/plugins';
|
|
156
|
+
|
|
152
157
|
suneditor.create('#editor', {
|
|
153
|
-
plugins: [
|
|
158
|
+
plugins: [font, image, video],
|
|
154
159
|
image: {
|
|
155
160
|
uploadUrl: 'https://upload.image',
|
|
156
161
|
},
|
|
157
162
|
});
|
|
158
163
|
```
|
|
159
164
|
|
|
165
|
+
An object keyed by plugin name works too, and `excludedPlugins` lets you drop
|
|
166
|
+
individual plugins when you enable the whole set:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
import plugins from 'suneditor/plugins';
|
|
170
|
+
|
|
171
|
+
suneditor.create('#editor', {
|
|
172
|
+
plugins, // every built-in plugin
|
|
173
|
+
excludedPlugins: ['image', 'video'],
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
160
177
|
📘 [Learn how to build your own plugin →](https://suneditor.com/plugin-guide)
|
|
161
178
|
|
|
162
179
|
🤖 Want to build plugins? Get real-time help from [SunEditor Devs AI](https://chatgpt.com/g/g-JViNPCrkD-suneditor-devs).\
|