@topol.io/editor-svelte 0.0.4 → 0.2.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.
- package/README.md +23 -33
- package/dist/TopolEditor.svelte +4 -1
- package/dist/TopolEditor.svelte.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ yarn add @topol.io/editor-svelte
|
|
|
24
24
|
|
|
25
25
|
In your Svelte component import and add the simplest options.
|
|
26
26
|
|
|
27
|
-
For more options see the docs for [TopolOptions configuration](https://topol.io/
|
|
27
|
+
For more options see the docs for [TopolOptions configuration](https://docs.topol.io/reference/topol-options.html)
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
30
|
import { TopolEditor } from '@topol.io/editor-svelte';
|
|
@@ -53,22 +53,7 @@ const save = () => {
|
|
|
53
53
|
};
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
| Action | Description |
|
|
59
|
-
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
-
| `TopolPlugin.save()` | Saves the content of the editor [more info](https://topol.io/docs#plugin-configuration) |
|
|
61
|
-
| `TopolPlugin.load(template)` | Loads the provided template [more info](https://topol.io/docs#save-and-load-options) |
|
|
62
|
-
| `TopolPlugin.togglePreview()` | Toggles editor preview [more info](https://topol.io/docs#preview-mode-on-desktop-and-mobile) |
|
|
63
|
-
| `TopolPlugin.togglePreviewSize()` | Toggles editor preview size |
|
|
64
|
-
| `TopolPlugin.undo()` | Undo change in editor [more info](https://topol.io/docs#redo-and-undo) |
|
|
65
|
-
| `TopolPlugin.redo()` | Redo change in editor [more info](https://topol.io/docs#redo-and-undo) |
|
|
66
|
-
| `TopolPlugin.setSavedBlocks(savedblock: ISavedBlock[])` | Sets the saved blocks [more info](https://topol.io/docs#saved-blocks) |
|
|
67
|
-
| `TopolPlugin.createNotification(notification: INotification)` | Creates editor's notification [more info](https://topol.io/docs#show-custom-notification-in-editor) |
|
|
68
|
-
| `TopolPlugin.changeEmailToMobile()` | Change email to mobile view [more info](https://topol.io/docs#mobile-first-email-template) |
|
|
69
|
-
| `TopolPlugin.changeEmailToDesktop()` | Change email to desktop view [more info](https://topol.io/docs#mobile-first-email-template) |
|
|
70
|
-
| `TopolPlugin.toggleBlocksAndStructuresVisibility()` | Toggle hidden structures visibility for blocks and structures [more info](https://topol.io/docs#mobile-first-email-template) |
|
|
71
|
-
| `TopolPlugin.destroy()` | Destroys the editor initialization [more info](https://topol.io/docs#working-with-js-frameworks) |
|
|
56
|
+
For more TopolPlugion functions refer to the [TopolPlugin actions](https://www.npmjs.com/package/@topol.io/editor#call-topol-plugin-actions)
|
|
72
57
|
|
|
73
58
|
<br>
|
|
74
59
|
|
|
@@ -85,22 +70,27 @@ The callbacks from editor are received as component events.
|
|
|
85
70
|
|
|
86
71
|
### List of all editor events
|
|
87
72
|
|
|
88
|
-
| Event
|
|
89
|
-
|
|
|
90
|
-
| `@onSave`
|
|
91
|
-
| `@onSaveAndClose`
|
|
92
|
-
| `@onTestSend`
|
|
93
|
-
| `@onOpenFileManager`
|
|
94
|
-
| `@onLoaded`
|
|
95
|
-
| `@onInit`
|
|
96
|
-
| `@onBlockSave`
|
|
97
|
-
| `@onBlockRemove`
|
|
98
|
-
| `@onBlockEdit`
|
|
99
|
-
| `@onUndoChange`
|
|
100
|
-
| `@
|
|
101
|
-
| `@onPreview`
|
|
102
|
-
| `@onAlert`
|
|
103
|
-
| `@onClose`
|
|
73
|
+
| Event | Description |
|
|
74
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `@onSave` | Returns object which contains html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-save) |
|
|
76
|
+
| `@onSaveAndClose` | Returns object which contains html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-save-and-close) |
|
|
77
|
+
| `@onTestSend` | Returns object which contains email, html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-test-email-send) |
|
|
78
|
+
| `@onOpenFileManager` | When user clicks file manager open [more info](https://docs.topol.io/guide/custom-filemanager.html#onopenfilemanager) |
|
|
79
|
+
| `@onLoaded` | After editor template is loaded using `TopolPlugin.load()` [more info](https://docs.topol.io/guide/callbacks.html#on-loaded) |
|
|
80
|
+
| `@onInit` | When editor inits [more info](https://docs.topol.io/guide/callbacks.html#on-init) |
|
|
81
|
+
| `@onBlockSave` | When user saves block in editor, returns object of type ISavedBlock [more info](https://docs.topol.io/guide/callbacks.html#on-block-save) |
|
|
82
|
+
| `@onBlockRemove` | When user removes saved block, returns id of saved block to be removed [more info](https://docs.topol.io/guide/callbacks.html#on-block-remove) |
|
|
83
|
+
| `@onBlockEdit` | When user edits saved block, returns id of saved block to be updated [more info](https://docs.topol.io/guide/callbacks.html#on-block-edit) |
|
|
84
|
+
| `@onUndoChange` | When user clicks undo button, retunrs number of steps user undone [more info](https://docs.topol.io/guide/callbacks.html#on-undo-change) |
|
|
85
|
+
| `@onRedoChange` | When user clicks redo button, retunrs number of steps user redone [more info](https://docs.topol.io/guide/callbacks.html#on-redo-change) |
|
|
86
|
+
| `@onPreview` | When user switches to preview [more info](https://docs.topol.io/guide/callbacks.html#on-preview) |
|
|
87
|
+
| `@onAlert` | When alert appears in editor [more info](https://docs.topol.io/guide/callbacks.html#on-alert) |
|
|
88
|
+
| `@onClose` | When close is click inside WindowBar [more info](https://docs.topol.io/guide/top-bar.html#window-bar) |
|
|
89
|
+
| `@onEdittedWithoutSaveChanged` | When user is about to leave an editor with unsaved changes [more info](https://docs.topol.io/guide/disable-before-leaving-modal.html#before-exit-modal-when-user-has-unsaved-changes) |
|
|
90
|
+
| `@onOpenCustomBlockDialog` | When user clicks on the open dialog in custom block [more info](https://docs.topol.io/guide/custom-block.html#inserting-custom-html-in-custom-dialog-component) |
|
|
91
|
+
| `@onTemplateRename` | When user clicks on the pencil icon next to the template name [more info](https://docs.topol.io/guide/rename-template.html#rename-template) |
|
|
92
|
+
| `@updateTestingEmailAddresses` | When user edits the email list in preview [more info](https://docs.topol.io/guide/sending-a-test-email.html#managing-saving-emails-yourself) |
|
|
93
|
+
| `@onError` | When an error that cannot be handled happened in the editor [more info](https://docs.topol.io/guide/callbacks.html#onerror) |
|
|
104
94
|
|
|
105
95
|
<br>
|
|
106
96
|
|
package/dist/TopolEditor.svelte
CHANGED
|
@@ -50,7 +50,7 @@ const mergeOptions = () => {
|
|
|
50
50
|
onClose() {
|
|
51
51
|
dispatch("onClose");
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
// only in free version
|
|
54
54
|
onBannerClick(json, html) {
|
|
55
55
|
dispatch("onBannerClick", { json, html });
|
|
56
56
|
},
|
|
@@ -65,6 +65,9 @@ const mergeOptions = () => {
|
|
|
65
65
|
},
|
|
66
66
|
updateTestingEmailAddresses(emails) {
|
|
67
67
|
dispatch("updateTestingEmailAddresses", emails);
|
|
68
|
+
},
|
|
69
|
+
onError(type, message) {
|
|
70
|
+
dispatch("onError", { type, message });
|
|
68
71
|
}
|
|
69
72
|
};
|
|
70
73
|
return { id: "#" + EDITOR_HTML_ID, ...options, callbacks: { ...callbacks } };
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.0
|
|
20
|
+
"version": "0.2.0",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vite": "^5.0.8"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@topol.io/editor": "0.0
|
|
44
|
+
"@topol.io/editor": "0.2.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|