@topol.io/editor-svelte 1.0.0-alpha.9 → 2.0.0-alpha.1
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 +46 -103
- package/dist/EmailEditor.svelte +221 -0
- package/dist/EmailEditor.svelte.d.ts +124 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/svelte-internal.d.ts +7 -0
- package/package.json +14 -5
- package/dist/TopolEditor.svelte +0 -102
- package/dist/TopolEditor.svelte.d.ts +0 -59
package/README.md
CHANGED
|
@@ -1,109 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
<svg width="391" height="100" viewBox="0 0 391 100" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M198.658 24.5069C194.15 21.9659 188.894 20.6954 182.903 20.6954C176.911 20.6954 171.655 21.9659 167.103 24.5069C162.561 27.0478 159.024 30.5918 156.525 35.161C154.003 39.7192 152.765 45.024 152.765 51.0755C152.765 57.1269 154.014 62.376 156.558 66.9341C159.08 71.5034 162.617 75.0474 167.136 77.5883C171.678 80.1293 176.922 81.3998 182.914 81.3998C188.906 81.3998 194.116 80.1293 198.635 77.5883C203.177 75.0474 206.703 71.5034 209.224 66.9341C211.746 62.376 213.018 57.0824 213.018 51.0755C213.018 45.0685 211.746 39.7192 209.224 35.161C206.703 30.5918 203.177 27.0478 198.658 24.5069ZM198.011 60.604C196.593 63.3233 194.585 65.4296 192.008 66.9119C189.43 68.4052 186.395 69.1519 182.914 69.1519C179.432 69.1519 176.386 68.4052 173.798 66.9119C171.209 65.4296 169.2 63.3233 167.772 60.604C166.344 57.8848 165.641 54.7086 165.641 51.0755C165.641 47.4423 166.344 44.2216 167.772 41.5134C169.2 38.8165 171.198 36.699 173.775 35.2056C176.353 33.7011 179.399 32.9433 182.914 32.9433C186.428 32.9433 189.43 33.7011 192.008 35.2056C194.585 36.699 196.593 38.8165 198.011 41.5134C199.439 44.2216 200.153 47.3978 200.153 51.0755C200.153 54.7532 199.439 57.8959 198.011 60.604ZM332.387 24.5069C327.879 21.9659 322.635 20.6954 316.643 20.6954C310.651 20.6954 305.384 21.9659 300.843 24.5069C296.291 27.0478 292.753 30.5918 290.254 35.161C287.744 39.7192 286.494 45.024 286.494 51.0755C286.494 57.1269 287.755 62.376 290.288 66.9341C292.809 71.5034 296.335 75.0474 300.876 77.5883C305.407 80.1293 310.651 81.3998 316.654 81.3998C322.657 81.3998 327.834 80.1293 332.376 77.5883C336.906 75.0474 340.432 71.5034 342.953 66.9341C345.475 62.376 346.747 57.0824 346.747 51.0755C346.747 45.0685 345.475 39.7192 342.953 35.161C340.432 30.5918 336.906 27.0478 332.387 24.5069ZM331.751 60.604C330.323 63.3233 328.325 65.4296 325.748 66.9119C323.159 68.4052 320.124 69.1519 316.654 69.1519C313.184 69.1519 310.126 68.4052 307.527 66.9119C304.938 65.4296 302.93 63.3233 301.501 60.604C300.084 57.8848 299.37 54.7086 299.37 51.0755C299.37 47.4423 300.084 44.2216 301.501 41.5134C302.93 38.8165 304.927 36.699 307.504 35.2056C310.082 33.7011 313.139 32.9433 316.654 32.9433C320.169 32.9433 323.159 33.7011 325.748 35.2056C328.325 36.699 330.323 38.8165 331.751 41.5134C333.168 44.2216 333.882 47.3978 333.882 51.0755C333.882 54.7532 333.168 57.8959 331.751 60.604ZM267.971 24.44C263.798 21.9436 258.889 20.6954 253.276 20.6954C248.043 20.6954 243.591 21.8656 239.942 24.1837C236.963 26.0782 234.575 28.7195 232.768 32.0517V21.8767H219.3V100H232.768V69.464C234.575 72.7962 236.952 75.4263 239.942 77.3208C243.591 79.6612 248.043 80.8091 253.276 80.8091C258.889 80.8091 263.798 79.5609 267.971 77.0311C272.156 74.5236 275.414 71.0019 277.757 66.4772C280.1 61.9637 281.283 56.7034 281.283 50.7188C281.283 44.7342 280.1 39.474 277.757 34.9604C275.414 30.4358 272.145 26.9252 267.971 24.44ZM266.186 60.1137C264.736 62.7995 262.694 64.8724 260.072 66.3435C257.449 67.8257 254.359 68.5612 250.81 68.5612C247.262 68.5612 244.171 67.8257 241.549 66.3435C238.916 64.8724 236.874 62.7995 235.435 60.1137C233.984 57.439 233.248 54.3185 233.248 50.7411C233.248 47.1637 233.973 43.9987 235.435 41.3351C236.874 38.6827 238.916 36.6098 241.549 35.1499C244.171 33.6788 247.262 32.9544 250.81 32.9544C254.359 32.9544 257.483 33.69 260.094 35.1499C262.705 36.6098 264.724 38.6827 266.186 41.3574C267.626 44.0321 268.362 47.1526 268.362 50.7411C268.362 54.3297 267.637 57.4501 266.186 60.1137ZM391 66.7781V80.2407H366.408V66.7781H391ZM366.397 0V66.7781H352.918V0H366.397ZM127.38 21.7096H149.607V35.1722H127.38V66.7893H113.79V0H127.38V21.7096ZM127.38 66.7781H147.152V80.2407H127.38V66.7781ZM80.3379 66.8004V80.263H60.2534V66.8004H80.3379ZM0 66.8004H20.0845V80.263H0V66.8004ZM0.0223161 50.1727V30.1126H20.0845V50.1727H0.0223161ZM60.2534 50.1727V30.1126H20.0845V13.4849H60.2534V30.1126H80.3044V50.1727H60.2534ZM20.0845 50.1727H60.2534V66.8004H20.0845V50.1727ZM0 13.4738V0.0222891H20.0845V13.4849L0 13.4738ZM80.3379 13.4738H60.2534V0.0222891H80.3379V13.4738Z" fill="black"/></svg>
|
|
3
|
-
</a>
|
|
1
|
+
# @topol.io/editor-svelte — v2 alpha
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Easy and quick! Drag and drop HTML editor and builder for beautiful responsive email templates.
|
|
8
|
-
|
|
9
|
-
# Documentation
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
Install Editor from NPM using:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npm install @topol.io/editor-svelte
|
|
17
|
-
|
|
18
|
-
//or
|
|
19
|
-
|
|
20
|
-
yarn add @topol.io/editor-svelte
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Use in Component
|
|
24
|
-
|
|
25
|
-
In your Svelte component import and add the simplest options.
|
|
26
|
-
|
|
27
|
-
For more options see the docs for [TopolOptions configuration](https://docs.topol.io/reference/topol-options.html)
|
|
28
|
-
|
|
29
|
-
```js
|
|
30
|
-
import { TopolEditor } from '@topol.io/editor-svelte';
|
|
31
|
-
|
|
32
|
-
const customOptions = {
|
|
33
|
-
authorize: {
|
|
34
|
-
apiKey: 'YOUR_API_TOKEN',
|
|
35
|
-
userId: 'some-user-id',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
```html
|
|
41
|
-
<TopolEditor options="{customOptions}"></TopolEditor>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Call Topol Plugin actions
|
|
45
|
-
|
|
46
|
-
To call actions to the editor import:
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
import { TopolPlugin } from '@topol.io/editor-svelte';
|
|
50
|
-
|
|
51
|
-
const save = () => {
|
|
52
|
-
TopolPlugin.save();
|
|
53
|
-
};
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
For more TopolPlugion functions refer to the [TopolPlugin actions](https://www.npmjs.com/package/@topol.io/editor#call-topol-plugin-actions)
|
|
57
|
-
|
|
58
|
-
<br>
|
|
59
|
-
|
|
60
|
-
## Editor Events
|
|
61
|
-
|
|
62
|
-
The callbacks from editor are received as component events.
|
|
63
|
-
|
|
64
|
-
```html
|
|
65
|
-
<TopolEditor
|
|
66
|
-
options="{customOptions}"
|
|
67
|
-
on:onSave="{onSave}"
|
|
68
|
-
></TopolEditor>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### List of all editor events
|
|
72
|
-
|
|
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) |
|
|
94
|
-
|
|
95
|
-
<br>
|
|
96
|
-
|
|
97
|
-
## TypeScript
|
|
98
|
-
|
|
99
|
-
Topol Editor provides full TypeScript integration and exports all necessary types.
|
|
3
|
+
Svelte 4 wrapper for Email Editor v4. Local version: `2.0.0-alpha.0` (unpublished).
|
|
100
4
|
|
|
101
5
|
```svelte
|
|
102
6
|
<script lang="ts">
|
|
103
|
-
import {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
7
|
+
import { EmailEditor, type ISvelteOptions, type IEmailCallbacks } from "@topol.io/editor-svelte";
|
|
8
|
+
const options: ISvelteOptions = {
|
|
9
|
+
authorize: { apiKey: "pk_your-key", userId: "user-123" },
|
|
10
|
+
cloud: { enabled: true },
|
|
11
|
+
};
|
|
12
|
+
const callbacks: IEmailCallbacks = {
|
|
13
|
+
async getNonce() {
|
|
14
|
+
const response = await fetch("/api/topol/nonce", { method: "POST" });
|
|
15
|
+
if (!response.ok) throw new Error("Cloud authorization failed");
|
|
16
|
+
return (await response.json()).nonce;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
108
19
|
</script>
|
|
20
|
+
|
|
21
|
+
<EmailEditor
|
|
22
|
+
{options}
|
|
23
|
+
{callbacks}
|
|
24
|
+
on:onCloudSave={(event) => console.log(event.detail.templateId)}
|
|
25
|
+
on:onEditorError={(event) => console.error(event.detail.message)}
|
|
26
|
+
/>
|
|
109
27
|
```
|
|
28
|
+
|
|
29
|
+
Use the **`callbacks` prop for `getNonce` and async persistence**. Svelte event
|
|
30
|
+
handlers cannot return promises to the editor. Notification events carry the exact
|
|
31
|
+
v4 payload in `event.detail`; for example, `event.detail.code` for language events.
|
|
32
|
+
If both a callback and a listener are present, the callback runs first and its
|
|
33
|
+
result returns to the editor.
|
|
34
|
+
|
|
35
|
+
Use `bind:this={component}` and `component.getEditor()` for async instance methods,
|
|
36
|
+
or listen to `on:ready` for the instance in `event.detail`. `CoreEmailEditor` exposes
|
|
37
|
+
the core v4 factory. The old `ITopolOptions` wrapper-config alias is now
|
|
38
|
+
`ISvelteOptions`; `ITopolOptions` refers to the core `{ config, ...callbacks }` type.
|
|
39
|
+
|
|
40
|
+
`options` contains the v4 configuration (`IEmailConfig`). Cloud requires a `pk_`
|
|
41
|
+
public key and a `getNonce` callback that fetches a fresh `nc_` token from your
|
|
42
|
+
application's authenticated backend. Never put an `sk_` secret in browser code.
|
|
43
|
+
See the core package README for Cloud feature options and all v4 renames.
|
|
44
|
+
|
|
45
|
+
Configuration and the presence of callback handlers are captured on mount. Remount
|
|
46
|
+
with a new key to change them; existing callback functions read their latest values.
|
|
47
|
+
`ready` means the iframe has rendered; `onInit` reports editor authentication.
|
|
48
|
+
Set the container's height. Each component owns its own instance and destroys it
|
|
49
|
+
on unmount, including when initialization is still pending.
|
|
50
|
+
|
|
51
|
+
Use `loaderUrl` for an explicit v4 local/preview loader. A numeric `stage` selects
|
|
52
|
+
a PR preview. `TopolEditor` is a deprecated naming alias using the new v4 contract.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
<script
|
|
2
|
+
context="module"
|
|
3
|
+
|
|
4
|
+
></script>
|
|
5
|
+
|
|
6
|
+
<script>import { createEventDispatcher, onMount, onDestroy, tick } from "svelte";
|
|
7
|
+
import { get_current_component } from "svelte/internal";
|
|
8
|
+
import { EmailEditor as CoreEmailEditor } from "@topol.io/editor";
|
|
9
|
+
export let options;
|
|
10
|
+
export let callbacks = {};
|
|
11
|
+
export let stage = "production";
|
|
12
|
+
export let loaderUrl = void 0;
|
|
13
|
+
let container;
|
|
14
|
+
let editor;
|
|
15
|
+
let disposed = false;
|
|
16
|
+
const component = get_current_component();
|
|
17
|
+
const dispatch = createEventDispatcher();
|
|
18
|
+
export const getEditor = () => editor ?? null;
|
|
19
|
+
const hasHandler = (name) => !!callbacks[name] || !!component.$$.callbacks[name]?.length;
|
|
20
|
+
const reportError = (error) => {
|
|
21
|
+
if (disposed)
|
|
22
|
+
return;
|
|
23
|
+
const payload = { source: "integration", message: error instanceof Error ? error.message : String(error), detail: error };
|
|
24
|
+
if (!hasHandler("onEditorError"))
|
|
25
|
+
console.error("[@topol.io/editor-svelte] EmailEditor failed:", error);
|
|
26
|
+
callbacks.onEditorError?.(payload);
|
|
27
|
+
dispatch("onEditorError", payload);
|
|
28
|
+
};
|
|
29
|
+
onMount(() => {
|
|
30
|
+
const initialize = async () => {
|
|
31
|
+
await tick();
|
|
32
|
+
if (disposed)
|
|
33
|
+
return;
|
|
34
|
+
const hostCallbacks = {
|
|
35
|
+
onSave: hasHandler("onSave") ? (payload) => {
|
|
36
|
+
const result = callbacks.onSave?.(payload);
|
|
37
|
+
dispatch("onSave", payload);
|
|
38
|
+
return result;
|
|
39
|
+
} : void 0,
|
|
40
|
+
onSaveAndClose: hasHandler("onSaveAndClose") ? (payload) => {
|
|
41
|
+
const result = callbacks.onSaveAndClose?.(payload);
|
|
42
|
+
dispatch("onSaveAndClose", payload);
|
|
43
|
+
return result;
|
|
44
|
+
} : void 0,
|
|
45
|
+
onTestSend: hasHandler("onTestSend") ? (payload) => {
|
|
46
|
+
const result = callbacks.onTestSend?.(payload);
|
|
47
|
+
dispatch("onTestSend", payload);
|
|
48
|
+
return result;
|
|
49
|
+
} : void 0,
|
|
50
|
+
onBannerClick: hasHandler("onBannerClick") ? (payload) => {
|
|
51
|
+
const result = callbacks.onBannerClick?.(payload);
|
|
52
|
+
dispatch("onBannerClick", payload);
|
|
53
|
+
return result;
|
|
54
|
+
} : void 0,
|
|
55
|
+
onOpenFileManager: hasHandler("onOpenFileManager") ? () => {
|
|
56
|
+
const result = callbacks.onOpenFileManager?.();
|
|
57
|
+
dispatch("onOpenFileManager");
|
|
58
|
+
return result;
|
|
59
|
+
} : void 0,
|
|
60
|
+
onLoaded: hasHandler("onLoaded") ? () => {
|
|
61
|
+
const result = callbacks.onLoaded?.();
|
|
62
|
+
dispatch("onLoaded");
|
|
63
|
+
return result;
|
|
64
|
+
} : void 0,
|
|
65
|
+
onSavedSectionSave: hasHandler("onSavedSectionSave") ? (payload) => {
|
|
66
|
+
const result = callbacks.onSavedSectionSave?.(payload);
|
|
67
|
+
dispatch("onSavedSectionSave", payload);
|
|
68
|
+
return result;
|
|
69
|
+
} : void 0,
|
|
70
|
+
onSavedSectionRemove: hasHandler("onSavedSectionRemove") ? (payload) => {
|
|
71
|
+
const result = callbacks.onSavedSectionRemove?.(payload);
|
|
72
|
+
dispatch("onSavedSectionRemove", payload);
|
|
73
|
+
return result;
|
|
74
|
+
} : void 0,
|
|
75
|
+
onSavedSectionEdit: hasHandler("onSavedSectionEdit") ? (payload) => {
|
|
76
|
+
const result = callbacks.onSavedSectionEdit?.(payload);
|
|
77
|
+
dispatch("onSavedSectionEdit", payload);
|
|
78
|
+
return result;
|
|
79
|
+
} : void 0,
|
|
80
|
+
onImageDelete: hasHandler("onImageDelete") ? (payload) => {
|
|
81
|
+
const result = callbacks.onImageDelete?.(payload);
|
|
82
|
+
dispatch("onImageDelete", payload);
|
|
83
|
+
return result;
|
|
84
|
+
} : void 0,
|
|
85
|
+
onInit: hasHandler("onInit") ? () => {
|
|
86
|
+
const result = callbacks.onInit?.();
|
|
87
|
+
dispatch("onInit");
|
|
88
|
+
return result;
|
|
89
|
+
} : void 0,
|
|
90
|
+
onUndoChange: hasHandler("onUndoChange") ? (payload) => {
|
|
91
|
+
const result = callbacks.onUndoChange?.(payload);
|
|
92
|
+
dispatch("onUndoChange", payload);
|
|
93
|
+
return result;
|
|
94
|
+
} : void 0,
|
|
95
|
+
onRedoChange: hasHandler("onRedoChange") ? (payload) => {
|
|
96
|
+
const result = callbacks.onRedoChange?.(payload);
|
|
97
|
+
dispatch("onRedoChange", payload);
|
|
98
|
+
return result;
|
|
99
|
+
} : void 0,
|
|
100
|
+
onPreview: hasHandler("onPreview") ? (payload) => {
|
|
101
|
+
const result = callbacks.onPreview?.(payload);
|
|
102
|
+
dispatch("onPreview", payload);
|
|
103
|
+
return result;
|
|
104
|
+
} : void 0,
|
|
105
|
+
onPreviewClose: hasHandler("onPreviewClose") ? () => {
|
|
106
|
+
const result = callbacks.onPreviewClose?.();
|
|
107
|
+
dispatch("onPreviewClose");
|
|
108
|
+
return result;
|
|
109
|
+
} : void 0,
|
|
110
|
+
onAlert: hasHandler("onAlert") ? (payload) => {
|
|
111
|
+
const result = callbacks.onAlert?.(payload);
|
|
112
|
+
dispatch("onAlert", payload);
|
|
113
|
+
return result;
|
|
114
|
+
} : void 0,
|
|
115
|
+
onEditorClose: hasHandler("onEditorClose") ? () => {
|
|
116
|
+
const result = callbacks.onEditorClose?.();
|
|
117
|
+
dispatch("onEditorClose");
|
|
118
|
+
return result;
|
|
119
|
+
} : void 0,
|
|
120
|
+
onEdittedWithoutSaveChanged: hasHandler("onEdittedWithoutSaveChanged") ? (payload) => {
|
|
121
|
+
const result = callbacks.onEdittedWithoutSaveChanged?.(payload);
|
|
122
|
+
dispatch("onEdittedWithoutSaveChanged", payload);
|
|
123
|
+
return result;
|
|
124
|
+
} : void 0,
|
|
125
|
+
onBlocksAndStructuresVisibilityChange: hasHandler("onBlocksAndStructuresVisibilityChange") ? (payload) => {
|
|
126
|
+
const result = callbacks.onBlocksAndStructuresVisibilityChange?.(payload);
|
|
127
|
+
dispatch("onBlocksAndStructuresVisibilityChange", payload);
|
|
128
|
+
return result;
|
|
129
|
+
} : void 0,
|
|
130
|
+
onOpenCustomBlockDialog: hasHandler("onOpenCustomBlockDialog") ? (payload) => {
|
|
131
|
+
const result = callbacks.onOpenCustomBlockDialog?.(payload);
|
|
132
|
+
dispatch("onOpenCustomBlockDialog", payload);
|
|
133
|
+
return result;
|
|
134
|
+
} : void 0,
|
|
135
|
+
onTemplateRename: hasHandler("onTemplateRename") ? (payload) => {
|
|
136
|
+
const result = callbacks.onTemplateRename?.(payload);
|
|
137
|
+
dispatch("onTemplateRename", payload);
|
|
138
|
+
return result;
|
|
139
|
+
} : void 0,
|
|
140
|
+
onTemplateUpdated: hasHandler("onTemplateUpdated") ? () => {
|
|
141
|
+
const result = callbacks.onTemplateUpdated?.();
|
|
142
|
+
dispatch("onTemplateUpdated");
|
|
143
|
+
return result;
|
|
144
|
+
} : void 0,
|
|
145
|
+
updateTestingEmailAddresses: hasHandler("updateTestingEmailAddresses") ? (payload) => {
|
|
146
|
+
const result = callbacks.updateTestingEmailAddresses?.(payload);
|
|
147
|
+
dispatch("updateTestingEmailAddresses", payload);
|
|
148
|
+
return result;
|
|
149
|
+
} : void 0,
|
|
150
|
+
onEditorError: hasHandler("onEditorError") ? (payload) => {
|
|
151
|
+
const result = callbacks.onEditorError?.(payload);
|
|
152
|
+
dispatch("onEditorError", payload);
|
|
153
|
+
return result;
|
|
154
|
+
} : void 0,
|
|
155
|
+
onLanguageCreated: hasHandler("onLanguageCreated") ? (payload) => {
|
|
156
|
+
const result = callbacks.onLanguageCreated?.(payload);
|
|
157
|
+
dispatch("onLanguageCreated", payload);
|
|
158
|
+
return result;
|
|
159
|
+
} : void 0,
|
|
160
|
+
onLanguageDeleted: hasHandler("onLanguageDeleted") ? (payload) => {
|
|
161
|
+
const result = callbacks.onLanguageDeleted?.(payload);
|
|
162
|
+
dispatch("onLanguageDeleted", payload);
|
|
163
|
+
return result;
|
|
164
|
+
} : void 0,
|
|
165
|
+
onLanguageSelected: hasHandler("onLanguageSelected") ? (payload) => {
|
|
166
|
+
const result = callbacks.onLanguageSelected?.(payload);
|
|
167
|
+
dispatch("onLanguageSelected", payload);
|
|
168
|
+
return result;
|
|
169
|
+
} : void 0,
|
|
170
|
+
onPrimaryLanguageChanged: hasHandler("onPrimaryLanguageChanged") ? (payload) => {
|
|
171
|
+
const result = callbacks.onPrimaryLanguageChanged?.(payload);
|
|
172
|
+
dispatch("onPrimaryLanguageChanged", payload);
|
|
173
|
+
return result;
|
|
174
|
+
} : void 0,
|
|
175
|
+
onGetMutations: hasHandler("onGetMutations") ? (payload) => {
|
|
176
|
+
const result = callbacks.onGetMutations?.(payload);
|
|
177
|
+
dispatch("onGetMutations", payload);
|
|
178
|
+
return result;
|
|
179
|
+
} : void 0,
|
|
180
|
+
getNonce: callbacks.getNonce ? () => callbacks.getNonce() : void 0,
|
|
181
|
+
onCloudSave: hasHandler("onCloudSave") ? (payload) => {
|
|
182
|
+
const result = callbacks.onCloudSave?.(payload);
|
|
183
|
+
dispatch("onCloudSave", payload);
|
|
184
|
+
return result;
|
|
185
|
+
} : void 0,
|
|
186
|
+
onCloudTemplateChange: hasHandler("onCloudTemplateChange") ? (payload) => {
|
|
187
|
+
const result = callbacks.onCloudTemplateChange?.(payload);
|
|
188
|
+
dispatch("onCloudTemplateChange", payload);
|
|
189
|
+
return result;
|
|
190
|
+
} : void 0
|
|
191
|
+
};
|
|
192
|
+
const created = await CoreEmailEditor.init({ config: options, ...hostCallbacks }, { stage, loaderUrl });
|
|
193
|
+
if (disposed) {
|
|
194
|
+
await created.destroy();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
editor = created;
|
|
198
|
+
try {
|
|
199
|
+
await created.render(container);
|
|
200
|
+
} catch (error) {
|
|
201
|
+
await created.destroy();
|
|
202
|
+
editor = void 0;
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
if (!disposed)
|
|
206
|
+
dispatch("ready", created);
|
|
207
|
+
};
|
|
208
|
+
void initialize().catch(reportError);
|
|
209
|
+
});
|
|
210
|
+
onDestroy(() => {
|
|
211
|
+
disposed = true;
|
|
212
|
+
const owned = editor;
|
|
213
|
+
editor = void 0;
|
|
214
|
+
void owned?.destroy().catch((error) => console.warn("[@topol.io/editor-svelte] EmailEditor cleanup failed:", error));
|
|
215
|
+
});
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<div
|
|
219
|
+
bind:this={container}
|
|
220
|
+
style="width: 100%; height: 100vh"
|
|
221
|
+
></div>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { IEmailConfig, IEmailCallbacks } from "@topol.io/editor";
|
|
3
|
+
export type ISvelteOptions = IEmailConfig;
|
|
4
|
+
export type ISvelteEmailEvents = {
|
|
5
|
+
onSave: Parameters<NonNullable<IEmailCallbacks["onSave"]>>[0];
|
|
6
|
+
onSaveAndClose: Parameters<NonNullable<IEmailCallbacks["onSaveAndClose"]>>[0];
|
|
7
|
+
onTestSend: Parameters<NonNullable<IEmailCallbacks["onTestSend"]>>[0];
|
|
8
|
+
onBannerClick: Parameters<NonNullable<IEmailCallbacks["onBannerClick"]>>[0];
|
|
9
|
+
onOpenFileManager: void;
|
|
10
|
+
onLoaded: void;
|
|
11
|
+
onSavedSectionSave: Parameters<NonNullable<IEmailCallbacks["onSavedSectionSave"]>>[0];
|
|
12
|
+
onSavedSectionRemove: Parameters<NonNullable<IEmailCallbacks["onSavedSectionRemove"]>>[0];
|
|
13
|
+
onSavedSectionEdit: Parameters<NonNullable<IEmailCallbacks["onSavedSectionEdit"]>>[0];
|
|
14
|
+
onImageDelete: Parameters<NonNullable<IEmailCallbacks["onImageDelete"]>>[0];
|
|
15
|
+
onInit: void;
|
|
16
|
+
onUndoChange: Parameters<NonNullable<IEmailCallbacks["onUndoChange"]>>[0];
|
|
17
|
+
onRedoChange: Parameters<NonNullable<IEmailCallbacks["onRedoChange"]>>[0];
|
|
18
|
+
onPreview: Parameters<NonNullable<IEmailCallbacks["onPreview"]>>[0];
|
|
19
|
+
onPreviewClose: void;
|
|
20
|
+
onAlert: Parameters<NonNullable<IEmailCallbacks["onAlert"]>>[0];
|
|
21
|
+
onEditorClose: void;
|
|
22
|
+
onEdittedWithoutSaveChanged: Parameters<NonNullable<IEmailCallbacks["onEdittedWithoutSaveChanged"]>>[0];
|
|
23
|
+
onBlocksAndStructuresVisibilityChange: Parameters<NonNullable<IEmailCallbacks["onBlocksAndStructuresVisibilityChange"]>>[0];
|
|
24
|
+
onOpenCustomBlockDialog: Parameters<NonNullable<IEmailCallbacks["onOpenCustomBlockDialog"]>>[0];
|
|
25
|
+
onTemplateRename: Parameters<NonNullable<IEmailCallbacks["onTemplateRename"]>>[0];
|
|
26
|
+
onTemplateUpdated: void;
|
|
27
|
+
updateTestingEmailAddresses: Parameters<NonNullable<IEmailCallbacks["updateTestingEmailAddresses"]>>[0];
|
|
28
|
+
onEditorError: Parameters<NonNullable<IEmailCallbacks["onEditorError"]>>[0];
|
|
29
|
+
onLanguageCreated: Parameters<NonNullable<IEmailCallbacks["onLanguageCreated"]>>[0];
|
|
30
|
+
onLanguageDeleted: Parameters<NonNullable<IEmailCallbacks["onLanguageDeleted"]>>[0];
|
|
31
|
+
onLanguageSelected: Parameters<NonNullable<IEmailCallbacks["onLanguageSelected"]>>[0];
|
|
32
|
+
onPrimaryLanguageChanged: Parameters<NonNullable<IEmailCallbacks["onPrimaryLanguageChanged"]>>[0];
|
|
33
|
+
onGetMutations: Parameters<NonNullable<IEmailCallbacks["onGetMutations"]>>[0];
|
|
34
|
+
onCloudSave: Parameters<NonNullable<IEmailCallbacks["onCloudSave"]>>[0];
|
|
35
|
+
onCloudTemplateChange: Parameters<NonNullable<IEmailCallbacks["onCloudTemplateChange"]>>[0];
|
|
36
|
+
ready: IEmailEditorInstance;
|
|
37
|
+
};
|
|
38
|
+
import type { IEmailEditorInstance, IStage, IErrorData } from "@topol.io/editor";
|
|
39
|
+
declare const __propDef: {
|
|
40
|
+
props: {
|
|
41
|
+
options: ISvelteOptions;
|
|
42
|
+
callbacks?: IEmailCallbacks | undefined;
|
|
43
|
+
stage?: IStage | undefined;
|
|
44
|
+
loaderUrl?: string | undefined;
|
|
45
|
+
getEditor?: (() => IEmailEditorInstance | null) | undefined;
|
|
46
|
+
};
|
|
47
|
+
events: {
|
|
48
|
+
onSave: CustomEvent<import("@topol.io/editor").ISaveData>;
|
|
49
|
+
onSaveAndClose: CustomEvent<import("@topol.io/editor").ISaveData>;
|
|
50
|
+
onTestSend: CustomEvent<import("@topol.io/editor").ISendTestData>;
|
|
51
|
+
onBannerClick: CustomEvent<{
|
|
52
|
+
json: unknown;
|
|
53
|
+
html: unknown;
|
|
54
|
+
}>;
|
|
55
|
+
onOpenFileManager: CustomEvent<void>;
|
|
56
|
+
onLoaded: CustomEvent<void>;
|
|
57
|
+
onSavedSectionSave: CustomEvent<{
|
|
58
|
+
section: import("@topol.io/editor").ISavedBlock;
|
|
59
|
+
}>;
|
|
60
|
+
onSavedSectionRemove: CustomEvent<{
|
|
61
|
+
id: string | number;
|
|
62
|
+
}>;
|
|
63
|
+
onSavedSectionEdit: CustomEvent<{
|
|
64
|
+
id: string | number;
|
|
65
|
+
}>;
|
|
66
|
+
onImageDelete: CustomEvent<{
|
|
67
|
+
items: import("@topol.io/editor").IEmailDeletedItem[];
|
|
68
|
+
}>;
|
|
69
|
+
onInit: CustomEvent<void>;
|
|
70
|
+
onUndoChange: CustomEvent<{
|
|
71
|
+
count: number;
|
|
72
|
+
}>;
|
|
73
|
+
onRedoChange: CustomEvent<{
|
|
74
|
+
count: number;
|
|
75
|
+
}>;
|
|
76
|
+
onPreview: CustomEvent<{
|
|
77
|
+
html: unknown;
|
|
78
|
+
}>;
|
|
79
|
+
onPreviewClose: CustomEvent<void>;
|
|
80
|
+
onAlert: CustomEvent<{
|
|
81
|
+
notification: import("@topol.io/editor").INotification;
|
|
82
|
+
}>;
|
|
83
|
+
onEditorClose: CustomEvent<void>;
|
|
84
|
+
onEdittedWithoutSaveChanged: CustomEvent<{
|
|
85
|
+
value: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
onBlocksAndStructuresVisibilityChange: CustomEvent<{
|
|
88
|
+
value: boolean;
|
|
89
|
+
}>;
|
|
90
|
+
onOpenCustomBlockDialog: CustomEvent<{
|
|
91
|
+
block: unknown;
|
|
92
|
+
}>;
|
|
93
|
+
onTemplateRename: CustomEvent<{
|
|
94
|
+
name: string;
|
|
95
|
+
}>;
|
|
96
|
+
onTemplateUpdated: CustomEvent<void>;
|
|
97
|
+
updateTestingEmailAddresses: CustomEvent<{
|
|
98
|
+
emails: string[];
|
|
99
|
+
}>;
|
|
100
|
+
onEditorError: CustomEvent<IErrorData>;
|
|
101
|
+
onLanguageCreated: CustomEvent<import("@topol.io/editor").ILanguageChangePayload>;
|
|
102
|
+
onLanguageDeleted: CustomEvent<import("@topol.io/editor").ILanguageChangePayload>;
|
|
103
|
+
onLanguageSelected: CustomEvent<{
|
|
104
|
+
code: string;
|
|
105
|
+
}>;
|
|
106
|
+
onPrimaryLanguageChanged: CustomEvent<import("@topol.io/editor").ILanguageChangePayload>;
|
|
107
|
+
onGetMutations: CustomEvent<{
|
|
108
|
+
mutations: import("@topol.io/editor").ILanguageMutation[];
|
|
109
|
+
}>;
|
|
110
|
+
onCloudSave: CustomEvent<import("@topol.io/editor").ICloudSavePayload>;
|
|
111
|
+
onCloudTemplateChange: CustomEvent<import("@topol.io/editor").ICloudTemplateChangePayload>;
|
|
112
|
+
ready: CustomEvent<IEmailEditorInstance>;
|
|
113
|
+
} & {
|
|
114
|
+
[evt: string]: CustomEvent<any>;
|
|
115
|
+
};
|
|
116
|
+
slots: {};
|
|
117
|
+
};
|
|
118
|
+
export type EmailEditorProps = typeof __propDef.props;
|
|
119
|
+
export type EmailEditorEvents = typeof __propDef.events;
|
|
120
|
+
export type EmailEditorSlots = typeof __propDef.slots;
|
|
121
|
+
export default class EmailEditor extends SvelteComponent<EmailEditorProps, EmailEditorEvents, EmailEditorSlots> {
|
|
122
|
+
get getEditor(): () => IEmailEditorInstance | null;
|
|
123
|
+
}
|
|
124
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as TopolPlugin } from
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export type
|
|
1
|
+
export { default as TopolPlugin, EmailEditor as CoreEmailEditor } from "@topol.io/editor";
|
|
2
|
+
export { default as EmailEditor, default as TopolEditor } from "./EmailEditor.svelte";
|
|
3
|
+
export type { ISvelteOptions, ISvelteEmailEvents } from "./EmailEditor.svelte";
|
|
4
|
+
export type * from "@topol.io/editor";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as TopolPlugin } from
|
|
2
|
-
export { default as TopolEditor } from
|
|
1
|
+
export { default as TopolPlugin, EmailEditor as CoreEmailEditor } from "@topol.io/editor";
|
|
2
|
+
export { default as EmailEditor, default as TopolEditor } from "./EmailEditor.svelte";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Svelte 4 exposes no public listener-presence API. Only inspect callback presence;
|
|
2
|
+
// installing an absent onSaveAndClose handler changes the editor's close behavior.
|
|
3
|
+
declare module "svelte/internal" {
|
|
4
|
+
export function get_current_component(): {
|
|
5
|
+
$$: { callbacks: Record<string, unknown[] | undefined> };
|
|
6
|
+
};
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
|
-
"version": "
|
|
20
|
+
"version": "2.0.0-alpha.1",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
|
-
"svelte": "./dist/index.js"
|
|
25
|
+
"svelte": "./dist/index.js",
|
|
26
|
+
"default": "./dist/index.js"
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
"types": "./dist/index.d.ts",
|
|
@@ -38,16 +39,24 @@
|
|
|
38
39
|
"svelte-check": "^3.6.2",
|
|
39
40
|
"tslib": "^2.6.2",
|
|
40
41
|
"typescript": "^5.2.2",
|
|
41
|
-
"vite": "^5.0.8"
|
|
42
|
+
"vite": "^5.0.8",
|
|
43
|
+
"vitest": "^4.0.16",
|
|
44
|
+
"happy-dom": "^20.0.11"
|
|
42
45
|
},
|
|
43
46
|
"dependencies": {
|
|
44
|
-
"@topol.io/editor": "
|
|
47
|
+
"@topol.io/editor": "2.0.0-alpha.1"
|
|
45
48
|
},
|
|
46
49
|
"publishConfig": {
|
|
47
50
|
"access": "public"
|
|
48
51
|
},
|
|
49
52
|
"scripts": {
|
|
50
53
|
"dev": "vite",
|
|
51
|
-
"build": "svelte-package"
|
|
54
|
+
"build": "svelte-package",
|
|
55
|
+
"test": "vitest run",
|
|
56
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
57
|
+
"lint": "oxlint --deny-warnings .",
|
|
58
|
+
"lint:fix": "oxlint --fix --deny-warnings .",
|
|
59
|
+
"format": "oxfmt --write .",
|
|
60
|
+
"format:check": "oxfmt --check ."
|
|
52
61
|
}
|
|
53
62
|
}
|
package/dist/TopolEditor.svelte
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<script context="module"></script>
|
|
2
|
-
|
|
3
|
-
<script>import { createEventDispatcher, onMount, onDestroy } from "svelte";
|
|
4
|
-
import TopolPlugin from "@topol.io/editor";
|
|
5
|
-
const EDITOR_HTML_ID = "topol-editor-id";
|
|
6
|
-
export let options;
|
|
7
|
-
export let stage = "production";
|
|
8
|
-
const dispatch = createEventDispatcher();
|
|
9
|
-
const mergeOptions = () => {
|
|
10
|
-
const callbacks = {
|
|
11
|
-
onSave(json, html, mutations, syncedSections) {
|
|
12
|
-
dispatch("onSave", { json, html, mutations, syncedSections });
|
|
13
|
-
},
|
|
14
|
-
onSaveAndClose(json, html, mutations, syncedSections) {
|
|
15
|
-
dispatch("onSaveAndClose", { json, html, mutations, syncedSections });
|
|
16
|
-
},
|
|
17
|
-
onTestSend(email, json, html) {
|
|
18
|
-
dispatch("onTestSend", { email, json, html });
|
|
19
|
-
},
|
|
20
|
-
onOpenFileManager() {
|
|
21
|
-
dispatch("onOpenFileManager");
|
|
22
|
-
},
|
|
23
|
-
onLoaded() {
|
|
24
|
-
dispatch("onLoaded");
|
|
25
|
-
},
|
|
26
|
-
onBlockSave(block) {
|
|
27
|
-
dispatch("onBlockSave", block);
|
|
28
|
-
},
|
|
29
|
-
onBlockRemove(blockId) {
|
|
30
|
-
dispatch("onBlockRemove", blockId);
|
|
31
|
-
},
|
|
32
|
-
onBlockEdit(blockId) {
|
|
33
|
-
dispatch("onBlockEdit", blockId);
|
|
34
|
-
},
|
|
35
|
-
onInit() {
|
|
36
|
-
dispatch("onInit");
|
|
37
|
-
},
|
|
38
|
-
onUndoChange(count) {
|
|
39
|
-
dispatch("onUndoChange", count);
|
|
40
|
-
},
|
|
41
|
-
onRedoChange(count) {
|
|
42
|
-
dispatch("onRedoChange", count);
|
|
43
|
-
},
|
|
44
|
-
onPreview(html) {
|
|
45
|
-
dispatch("onPreview", html);
|
|
46
|
-
},
|
|
47
|
-
onAlert(notification) {
|
|
48
|
-
dispatch("onAlert", notification);
|
|
49
|
-
},
|
|
50
|
-
onClose() {
|
|
51
|
-
dispatch("onClose");
|
|
52
|
-
},
|
|
53
|
-
// only in free version
|
|
54
|
-
onBannerClick(json, html) {
|
|
55
|
-
dispatch("onBannerClick", { json, html });
|
|
56
|
-
},
|
|
57
|
-
onEdittedWithoutSaveChanged(hasUnsavedChanges) {
|
|
58
|
-
dispatch("onEdittedWithoutSaveChanged", hasUnsavedChanges);
|
|
59
|
-
},
|
|
60
|
-
onOpenCustomBlockDialog(blockContent) {
|
|
61
|
-
dispatch("onOpenCustomBlockDialog", blockContent);
|
|
62
|
-
},
|
|
63
|
-
onTemplateRename(title) {
|
|
64
|
-
dispatch("onTemplateRename", title);
|
|
65
|
-
},
|
|
66
|
-
updateTestingEmailAddresses(emails) {
|
|
67
|
-
dispatch("updateTestingEmailAddresses", emails);
|
|
68
|
-
},
|
|
69
|
-
onError(type, message, responseBody) {
|
|
70
|
-
dispatch("onError", { type, message, responseBody });
|
|
71
|
-
},
|
|
72
|
-
onLanguageCreated(lang, mutations) {
|
|
73
|
-
dispatch("onLanguageCreated", { lang, mutations });
|
|
74
|
-
},
|
|
75
|
-
onLanguageDeleted(lang, mutations) {
|
|
76
|
-
dispatch("onLanguageDeleted", { lang, mutations });
|
|
77
|
-
},
|
|
78
|
-
onLanguageSelected(lang) {
|
|
79
|
-
dispatch("onLanguageSelected", lang);
|
|
80
|
-
},
|
|
81
|
-
onPrimaryLanguageChanged(lang, mutations) {
|
|
82
|
-
dispatch("onPrimaryLanguageChanged", { lang, mutations });
|
|
83
|
-
},
|
|
84
|
-
onGetMutations(mutations) {
|
|
85
|
-
dispatch("onGetMutations", mutations);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return { id: "#" + EDITOR_HTML_ID, ...options, callbacks: { ...callbacks } };
|
|
89
|
-
};
|
|
90
|
-
onMount(async () => {
|
|
91
|
-
const mergedTopolOptinos = mergeOptions();
|
|
92
|
-
await TopolPlugin.init(mergedTopolOptinos, { stage });
|
|
93
|
-
});
|
|
94
|
-
onDestroy(() => {
|
|
95
|
-
TopolPlugin.destroy();
|
|
96
|
-
});
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<div
|
|
100
|
-
id="{EDITOR_HTML_ID}"
|
|
101
|
-
style="position: absolute; width: 100%; height: 100vh"
|
|
102
|
-
></div>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
export type ISvelteOptions = Omit<ITopolOptions, 'id' | 'callbacks'>;
|
|
3
|
-
export type ISaveData = {
|
|
4
|
-
json: unknown;
|
|
5
|
-
html: unknown;
|
|
6
|
-
mutations: {
|
|
7
|
-
key: string;
|
|
8
|
-
primary: boolean;
|
|
9
|
-
}[];
|
|
10
|
-
syncedSections: number[];
|
|
11
|
-
};
|
|
12
|
-
export type ISendTestData = {
|
|
13
|
-
email: string;
|
|
14
|
-
json: unknown;
|
|
15
|
-
html: unknown;
|
|
16
|
-
};
|
|
17
|
-
import type { ITopolOptions, IStage } from '@topol.io/editor';
|
|
18
|
-
declare const __propDef: {
|
|
19
|
-
props: {
|
|
20
|
-
options: ISvelteOptions;
|
|
21
|
-
stage?: IStage | undefined;
|
|
22
|
-
};
|
|
23
|
-
events: {
|
|
24
|
-
onSave: CustomEvent<any>;
|
|
25
|
-
onSaveAndClose: CustomEvent<any>;
|
|
26
|
-
onTestSend: CustomEvent<any>;
|
|
27
|
-
onOpenFileManager: CustomEvent<any>;
|
|
28
|
-
onLoaded: CustomEvent<any>;
|
|
29
|
-
onBlockSave: CustomEvent<any>;
|
|
30
|
-
onBlockRemove: CustomEvent<any>;
|
|
31
|
-
onBlockEdit: CustomEvent<any>;
|
|
32
|
-
onInit: CustomEvent<any>;
|
|
33
|
-
onUndoChange: CustomEvent<any>;
|
|
34
|
-
onRedoChange: CustomEvent<any>;
|
|
35
|
-
onPreview: CustomEvent<any>;
|
|
36
|
-
onAlert: CustomEvent<any>;
|
|
37
|
-
onClose: CustomEvent<any>;
|
|
38
|
-
onBannerClick: CustomEvent<any>;
|
|
39
|
-
onEdittedWithoutSaveChanged: CustomEvent<any>;
|
|
40
|
-
onOpenCustomBlockDialog: CustomEvent<any>;
|
|
41
|
-
onTemplateRename: CustomEvent<any>;
|
|
42
|
-
updateTestingEmailAddresses: CustomEvent<any>;
|
|
43
|
-
onError: CustomEvent<any>;
|
|
44
|
-
onLanguageCreated: CustomEvent<any>;
|
|
45
|
-
onLanguageDeleted: CustomEvent<any>;
|
|
46
|
-
onLanguageSelected: CustomEvent<any>;
|
|
47
|
-
onPrimaryLanguageChanged: CustomEvent<any>;
|
|
48
|
-
onGetMutations: CustomEvent<any>;
|
|
49
|
-
} & {
|
|
50
|
-
[evt: string]: CustomEvent<any>;
|
|
51
|
-
};
|
|
52
|
-
slots: {};
|
|
53
|
-
};
|
|
54
|
-
export type TopolEditorProps = typeof __propDef.props;
|
|
55
|
-
export type TopolEditorEvents = typeof __propDef.events;
|
|
56
|
-
export type TopolEditorSlots = typeof __propDef.slots;
|
|
57
|
-
export default class TopolEditor extends SvelteComponent<TopolEditorProps, TopolEditorEvents, TopolEditorSlots> {
|
|
58
|
-
}
|
|
59
|
-
export {};
|