@topol.io/editor-vue 1.0.0-alpha.10 → 1.0.0-alpha.11
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 +11 -4
- package/dist/topol-editor-vue.es.js +204 -174
- package/dist/topol-editor-vue.umd.cjs +1 -1
- package/dist/types/EmailEditor.vue.d.ts +33 -15
- package/dist/types/LandingPageEditor.vue.d.ts +12 -3
- package/dist/types/entry.d.ts +5 -10
- package/dist/types/types.d.ts +6 -14
- package/package.json +2 -2
- package/dist/types/TopolEditor.vue.d.ts +0 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Vue 3 wrapper for Email Editor v4, from the 1.x alpha line onward.
|
|
|
6
6
|
<script setup lang="ts">
|
|
7
7
|
import { EmailEditor, type IEmailCallbacks, type IVueEmailOptions } from "@topol.io/editor-vue";
|
|
8
8
|
const options: IVueEmailOptions = {
|
|
9
|
-
authorize: { apiKey: "pk_your-key",
|
|
9
|
+
authorize: { apiKey: "pk_your-key", entityId: "user-123" },
|
|
10
10
|
cloud: { enabled: true },
|
|
11
11
|
};
|
|
12
12
|
const callbacks: IEmailCallbacks = {
|
|
@@ -38,14 +38,21 @@ event listener are provided, the callback runs first and its result is returned.
|
|
|
38
38
|
without it or `callbacks.onSaveAndClose`, the runtime's default save-and-close works.
|
|
39
39
|
`getNonce` is a function callback only, never an event.
|
|
40
40
|
|
|
41
|
-
`
|
|
41
|
+
The exposed `load()` and `save()` of `LandingPageEditor` return Promises: `save()`
|
|
42
|
+
settles once the save has finished and rejects with `err.code === "SAVE_IN_PROGRESS"`
|
|
43
|
+
while another save runs. The exposed `getEditor()` returns the instance for its other
|
|
44
|
+
methods. `LandingPageEditor` takes the same `callbacks` prop (`ILandingPageCallbacks`):
|
|
45
|
+
pass `getNonce` there to turn nonce authentication on, and async `onSave` /
|
|
46
|
+
`onSaveAndClose` / `onEditorClose` handlers the editor should wait for.
|
|
47
|
+
It also has `@ready`, `loader-url` and a container without a fixed `id`, so several
|
|
48
|
+
editors can share a page; `class` and `style` fall through to the container.
|
|
42
49
|
`CoreEmailEditor` exposes the core v4 factory.
|
|
43
50
|
|
|
44
51
|
`options` contains the v4 configuration (`IEmailConfig`). A `getNonce` callback that
|
|
45
52
|
fetches a fresh `nc_` token from your application's authenticated backend enables
|
|
46
53
|
nonce authentication on its own; Cloud additionally requires it. Never put an `sk_`
|
|
47
54
|
secret in browser code. See the core package README for nonce authentication, Cloud
|
|
48
|
-
feature options, the Countdown block (`
|
|
55
|
+
feature options, the Countdown block (`countdown`; see the
|
|
49
56
|
[option reference](https://docs.topol.io/email-editor/reference/topol-options#countdown))
|
|
50
57
|
and all v4 renames.
|
|
51
58
|
|
|
@@ -56,7 +63,7 @@ Set the container's height. Each component owns its own instance and destroys it
|
|
|
56
63
|
on unmount, including when initialization is still pending.
|
|
57
64
|
|
|
58
65
|
Use `loaderUrl` for an explicit v4 local/preview loader. A numeric `stage` selects
|
|
59
|
-
a PR preview. `TopolEditor`
|
|
66
|
+
a PR preview. The `TopolEditor` alias is removed; import `EmailEditor`.
|
|
60
67
|
|
|
61
68
|
## Running the example against deployed Cloud
|
|
62
69
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmailEditor as
|
|
2
|
-
import { EmailEditor as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
const
|
|
1
|
+
import { EmailEditor as D, LandingPageEditor as R } from "@topol.io/editor";
|
|
2
|
+
import { EmailEditor as H, LandingPageEditor as N } from "@topol.io/editor";
|
|
3
|
+
import { defineComponent as L, getCurrentInstance as T, ref as w, onMounted as A, onBeforeUnmount as U, createElementBlock as P, openBlock as B, shallowRef as y } from "vue";
|
|
4
|
+
const _ = /* @__PURE__ */ L({
|
|
5
5
|
__name: "EmailEditor",
|
|
6
6
|
props: {
|
|
7
7
|
options: {},
|
|
@@ -9,216 +9,233 @@ const B = /* @__PURE__ */ p({
|
|
|
9
9
|
stage: { default: "production" },
|
|
10
10
|
loaderUrl: {}
|
|
11
11
|
},
|
|
12
|
-
emits: ["ready", "onSave", "onSaveAndClose", "onTestSend", "onBannerClick", "onOpenFileManager", "onLoaded", "onSavedSectionSave", "onSavedSectionRemove", "onSavedSectionEdit", "onImageDelete", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onEdittedWithoutSaveChanged", "onBlocksAndStructuresVisibilityChange", "onOpenCustomBlockDialog", "onTemplateRename", "onTemplateUpdated", "updateTestingEmailAddresses", "onEditorError", "onLanguageCreated", "onLanguageDeleted", "onLanguageSelected", "onPrimaryLanguageChanged", "onGetMutations", "onCloudSave", "onCloudTemplateChange"],
|
|
13
|
-
setup(
|
|
14
|
-
const a =
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
const i = (
|
|
18
|
-
var n,
|
|
19
|
-
const
|
|
20
|
-
return !!((n = a.callbacks) != null && n[
|
|
21
|
-
},
|
|
22
|
-
var n,
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
i("onEditorError") || console.error("[@topol.io/editor-vue] EmailEditor failed:",
|
|
12
|
+
emits: ["ready", "onSave", "onSaveAndClose", "onTestSend", "onBannerClick", "onOpenFileManager", "onLoaded", "onSavedSectionSave", "onSavedSectionRemove", "onSavedSectionEdit", "onImageDelete", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onUnsavedChangesChange", "onEdittedWithoutSaveChanged", "onHiddenElementsVisibilityChange", "onBlocksAndStructuresVisibilityChange", "onOpenCustomBlockDialog", "onTemplateRename", "onTemplateUpdated", "onTestingEmailsChange", "updateTestingEmailAddresses", "onEditorError", "onLanguageCreated", "onLanguageDeleted", "onLanguageSelected", "onPrimaryLanguageChanged", "onGetMutations", "onCloudSave", "onCloudTemplateChange"],
|
|
13
|
+
setup(S, { expose: k, emit: p }) {
|
|
14
|
+
const a = S, r = p, h = T(), m = w();
|
|
15
|
+
let u, v = !1;
|
|
16
|
+
k({ getEditor: () => u ?? null });
|
|
17
|
+
const i = (l) => {
|
|
18
|
+
var n, t, e;
|
|
19
|
+
const d = `on${l[0].toUpperCase()}${l.slice(1)}`;
|
|
20
|
+
return !!((n = a.callbacks) != null && n[l]) || !!((t = h.vnode.props) != null && t[d]) || !!((e = h.vnode.props) != null && e[`${d}Once`]);
|
|
21
|
+
}, b = (l) => {
|
|
22
|
+
var n, t;
|
|
23
|
+
if (v) return;
|
|
24
|
+
const d = { source: "integration", message: l instanceof Error ? l.message : String(l), detail: l };
|
|
25
|
+
i("onEditorError") || console.error("[@topol.io/editor-vue] EmailEditor failed:", l), (t = (n = a.callbacks) == null ? void 0 : n.onEditorError) == null || t.call(n, d), r("onEditorError", d);
|
|
26
26
|
};
|
|
27
|
-
return
|
|
28
|
-
var
|
|
29
|
-
const
|
|
27
|
+
return A(async () => {
|
|
28
|
+
var d;
|
|
29
|
+
const l = {
|
|
30
30
|
onSave: i("onSave") ? (n) => {
|
|
31
|
-
var e,
|
|
32
|
-
const
|
|
33
|
-
return r("onSave", n),
|
|
31
|
+
var e, o;
|
|
32
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSave) == null ? void 0 : o.call(e, n);
|
|
33
|
+
return r("onSave", n), t;
|
|
34
34
|
} : void 0,
|
|
35
35
|
onSaveAndClose: i("onSaveAndClose") ? (n) => {
|
|
36
|
-
var e,
|
|
37
|
-
const
|
|
38
|
-
return r("onSaveAndClose", n),
|
|
36
|
+
var e, o;
|
|
37
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSaveAndClose) == null ? void 0 : o.call(e, n);
|
|
38
|
+
return r("onSaveAndClose", n), t;
|
|
39
39
|
} : void 0,
|
|
40
40
|
onTestSend: i("onTestSend") ? (n) => {
|
|
41
|
-
var e,
|
|
42
|
-
const
|
|
43
|
-
return r("onTestSend", n),
|
|
41
|
+
var e, o;
|
|
42
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTestSend) == null ? void 0 : o.call(e, n);
|
|
43
|
+
return r("onTestSend", n), t;
|
|
44
44
|
} : void 0,
|
|
45
45
|
onBannerClick: i("onBannerClick") ? (n) => {
|
|
46
|
-
var e,
|
|
47
|
-
const
|
|
48
|
-
return r("onBannerClick", n),
|
|
46
|
+
var e, o;
|
|
47
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onBannerClick) == null ? void 0 : o.call(e, n);
|
|
48
|
+
return r("onBannerClick", n), t;
|
|
49
49
|
} : void 0,
|
|
50
50
|
onOpenFileManager: i("onOpenFileManager") ? () => {
|
|
51
|
-
var
|
|
52
|
-
const n = (e = (
|
|
51
|
+
var t, e;
|
|
52
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onOpenFileManager) == null ? void 0 : e.call(t);
|
|
53
53
|
return r("onOpenFileManager"), n;
|
|
54
54
|
} : void 0,
|
|
55
55
|
onLoaded: i("onLoaded") ? () => {
|
|
56
|
-
var
|
|
57
|
-
const n = (e = (
|
|
56
|
+
var t, e;
|
|
57
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onLoaded) == null ? void 0 : e.call(t);
|
|
58
58
|
return r("onLoaded"), n;
|
|
59
59
|
} : void 0,
|
|
60
60
|
onSavedSectionSave: i("onSavedSectionSave") ? (n) => {
|
|
61
|
-
var e,
|
|
62
|
-
const
|
|
63
|
-
return r("onSavedSectionSave", n),
|
|
61
|
+
var e, o;
|
|
62
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionSave) == null ? void 0 : o.call(e, n);
|
|
63
|
+
return r("onSavedSectionSave", n), t;
|
|
64
64
|
} : void 0,
|
|
65
65
|
onSavedSectionRemove: i("onSavedSectionRemove") ? (n) => {
|
|
66
|
-
var e,
|
|
67
|
-
const
|
|
68
|
-
return r("onSavedSectionRemove", n),
|
|
66
|
+
var e, o;
|
|
67
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionRemove) == null ? void 0 : o.call(e, n);
|
|
68
|
+
return r("onSavedSectionRemove", n), t;
|
|
69
69
|
} : void 0,
|
|
70
70
|
onSavedSectionEdit: i("onSavedSectionEdit") ? (n) => {
|
|
71
|
-
var e,
|
|
72
|
-
const
|
|
73
|
-
return r("onSavedSectionEdit", n),
|
|
71
|
+
var e, o;
|
|
72
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionEdit) == null ? void 0 : o.call(e, n);
|
|
73
|
+
return r("onSavedSectionEdit", n), t;
|
|
74
74
|
} : void 0,
|
|
75
75
|
onImageDelete: i("onImageDelete") ? (n) => {
|
|
76
|
-
var e,
|
|
77
|
-
const
|
|
78
|
-
return r("onImageDelete", n),
|
|
76
|
+
var e, o;
|
|
77
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onImageDelete) == null ? void 0 : o.call(e, n);
|
|
78
|
+
return r("onImageDelete", n), t;
|
|
79
79
|
} : void 0,
|
|
80
80
|
onInit: i("onInit") ? () => {
|
|
81
|
-
var
|
|
82
|
-
const n = (e = (
|
|
81
|
+
var t, e;
|
|
82
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onInit) == null ? void 0 : e.call(t);
|
|
83
83
|
return r("onInit"), n;
|
|
84
84
|
} : void 0,
|
|
85
85
|
onUndoChange: i("onUndoChange") ? (n) => {
|
|
86
|
-
var e,
|
|
87
|
-
const
|
|
88
|
-
return r("onUndoChange", n),
|
|
86
|
+
var e, o;
|
|
87
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onUndoChange) == null ? void 0 : o.call(e, n);
|
|
88
|
+
return r("onUndoChange", n), t;
|
|
89
89
|
} : void 0,
|
|
90
90
|
onRedoChange: i("onRedoChange") ? (n) => {
|
|
91
|
-
var e,
|
|
92
|
-
const
|
|
93
|
-
return r("onRedoChange", n),
|
|
91
|
+
var e, o;
|
|
92
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onRedoChange) == null ? void 0 : o.call(e, n);
|
|
93
|
+
return r("onRedoChange", n), t;
|
|
94
94
|
} : void 0,
|
|
95
95
|
onPreview: i("onPreview") ? (n) => {
|
|
96
|
-
var e,
|
|
97
|
-
const
|
|
98
|
-
return r("onPreview", n),
|
|
96
|
+
var e, o;
|
|
97
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onPreview) == null ? void 0 : o.call(e, n);
|
|
98
|
+
return r("onPreview", n), t;
|
|
99
99
|
} : void 0,
|
|
100
100
|
onPreviewClose: i("onPreviewClose") ? () => {
|
|
101
|
-
var
|
|
102
|
-
const n = (e = (
|
|
101
|
+
var t, e;
|
|
102
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onPreviewClose) == null ? void 0 : e.call(t);
|
|
103
103
|
return r("onPreviewClose"), n;
|
|
104
104
|
} : void 0,
|
|
105
105
|
onAlert: i("onAlert") ? (n) => {
|
|
106
|
-
var e,
|
|
107
|
-
const
|
|
108
|
-
return r("onAlert", n),
|
|
106
|
+
var e, o;
|
|
107
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onAlert) == null ? void 0 : o.call(e, n);
|
|
108
|
+
return r("onAlert", n), t;
|
|
109
109
|
} : void 0,
|
|
110
110
|
onEditorClose: i("onEditorClose") ? () => {
|
|
111
|
-
var
|
|
112
|
-
const n = (e = (
|
|
111
|
+
var t, e;
|
|
112
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onEditorClose) == null ? void 0 : e.call(t);
|
|
113
113
|
return r("onEditorClose"), n;
|
|
114
114
|
} : void 0,
|
|
115
|
+
onUnsavedChangesChange: i("onUnsavedChangesChange") ? (n) => {
|
|
116
|
+
var e, o;
|
|
117
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onUnsavedChangesChange) == null ? void 0 : o.call(e, n);
|
|
118
|
+
return r("onUnsavedChangesChange", n), t;
|
|
119
|
+
} : void 0,
|
|
115
120
|
onEdittedWithoutSaveChanged: i("onEdittedWithoutSaveChanged") ? (n) => {
|
|
116
|
-
var e,
|
|
117
|
-
const
|
|
118
|
-
return r("onEdittedWithoutSaveChanged", n),
|
|
121
|
+
var e, o;
|
|
122
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onEdittedWithoutSaveChanged) == null ? void 0 : o.call(e, n);
|
|
123
|
+
return r("onEdittedWithoutSaveChanged", n), t;
|
|
124
|
+
} : void 0,
|
|
125
|
+
onHiddenElementsVisibilityChange: i("onHiddenElementsVisibilityChange") ? (n) => {
|
|
126
|
+
var e, o;
|
|
127
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onHiddenElementsVisibilityChange) == null ? void 0 : o.call(e, n);
|
|
128
|
+
return r("onHiddenElementsVisibilityChange", n), t;
|
|
119
129
|
} : void 0,
|
|
120
130
|
onBlocksAndStructuresVisibilityChange: i("onBlocksAndStructuresVisibilityChange") ? (n) => {
|
|
121
|
-
var e,
|
|
122
|
-
const
|
|
123
|
-
return r("onBlocksAndStructuresVisibilityChange", n),
|
|
131
|
+
var e, o;
|
|
132
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onBlocksAndStructuresVisibilityChange) == null ? void 0 : o.call(e, n);
|
|
133
|
+
return r("onBlocksAndStructuresVisibilityChange", n), t;
|
|
124
134
|
} : void 0,
|
|
125
135
|
onOpenCustomBlockDialog: i("onOpenCustomBlockDialog") ? (n) => {
|
|
126
|
-
var e,
|
|
127
|
-
const
|
|
128
|
-
return r("onOpenCustomBlockDialog", n),
|
|
136
|
+
var e, o;
|
|
137
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onOpenCustomBlockDialog) == null ? void 0 : o.call(e, n);
|
|
138
|
+
return r("onOpenCustomBlockDialog", n), t;
|
|
129
139
|
} : void 0,
|
|
130
140
|
onTemplateRename: i("onTemplateRename") ? (n) => {
|
|
131
|
-
var e,
|
|
132
|
-
const
|
|
133
|
-
return r("onTemplateRename", n),
|
|
141
|
+
var e, o;
|
|
142
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTemplateRename) == null ? void 0 : o.call(e, n);
|
|
143
|
+
return r("onTemplateRename", n), t;
|
|
134
144
|
} : void 0,
|
|
135
145
|
onTemplateUpdated: i("onTemplateUpdated") ? () => {
|
|
136
|
-
var
|
|
137
|
-
const n = (e = (
|
|
146
|
+
var t, e;
|
|
147
|
+
const n = (e = (t = a.callbacks) == null ? void 0 : t.onTemplateUpdated) == null ? void 0 : e.call(t);
|
|
138
148
|
return r("onTemplateUpdated"), n;
|
|
139
149
|
} : void 0,
|
|
150
|
+
onTestingEmailsChange: i("onTestingEmailsChange") ? (n) => {
|
|
151
|
+
var e, o;
|
|
152
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTestingEmailsChange) == null ? void 0 : o.call(e, n);
|
|
153
|
+
return r("onTestingEmailsChange", n), t;
|
|
154
|
+
} : void 0,
|
|
140
155
|
updateTestingEmailAddresses: i("updateTestingEmailAddresses") ? (n) => {
|
|
141
|
-
var e,
|
|
142
|
-
const
|
|
143
|
-
return r("updateTestingEmailAddresses", n),
|
|
156
|
+
var e, o;
|
|
157
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.updateTestingEmailAddresses) == null ? void 0 : o.call(e, n);
|
|
158
|
+
return r("updateTestingEmailAddresses", n), t;
|
|
144
159
|
} : void 0,
|
|
145
160
|
onEditorError: i("onEditorError") ? (n) => {
|
|
146
|
-
var e,
|
|
147
|
-
const
|
|
148
|
-
return r("onEditorError", n),
|
|
161
|
+
var e, o;
|
|
162
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onEditorError) == null ? void 0 : o.call(e, n);
|
|
163
|
+
return r("onEditorError", n), t;
|
|
149
164
|
} : void 0,
|
|
150
165
|
onLanguageCreated: i("onLanguageCreated") ? (n) => {
|
|
151
|
-
var e,
|
|
152
|
-
const
|
|
153
|
-
return r("onLanguageCreated", n),
|
|
166
|
+
var e, o;
|
|
167
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageCreated) == null ? void 0 : o.call(e, n);
|
|
168
|
+
return r("onLanguageCreated", n), t;
|
|
154
169
|
} : void 0,
|
|
155
170
|
onLanguageDeleted: i("onLanguageDeleted") ? (n) => {
|
|
156
|
-
var e,
|
|
157
|
-
const
|
|
158
|
-
return r("onLanguageDeleted", n),
|
|
171
|
+
var e, o;
|
|
172
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageDeleted) == null ? void 0 : o.call(e, n);
|
|
173
|
+
return r("onLanguageDeleted", n), t;
|
|
159
174
|
} : void 0,
|
|
160
175
|
onLanguageSelected: i("onLanguageSelected") ? (n) => {
|
|
161
|
-
var e,
|
|
162
|
-
const
|
|
163
|
-
return r("onLanguageSelected", n),
|
|
176
|
+
var e, o;
|
|
177
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageSelected) == null ? void 0 : o.call(e, n);
|
|
178
|
+
return r("onLanguageSelected", n), t;
|
|
164
179
|
} : void 0,
|
|
165
180
|
onPrimaryLanguageChanged: i("onPrimaryLanguageChanged") ? (n) => {
|
|
166
|
-
var e,
|
|
167
|
-
const
|
|
168
|
-
return r("onPrimaryLanguageChanged", n),
|
|
181
|
+
var e, o;
|
|
182
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onPrimaryLanguageChanged) == null ? void 0 : o.call(e, n);
|
|
183
|
+
return r("onPrimaryLanguageChanged", n), t;
|
|
169
184
|
} : void 0,
|
|
170
185
|
onGetMutations: i("onGetMutations") ? (n) => {
|
|
171
|
-
var e,
|
|
172
|
-
const
|
|
173
|
-
return r("onGetMutations", n),
|
|
186
|
+
var e, o;
|
|
187
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onGetMutations) == null ? void 0 : o.call(e, n);
|
|
188
|
+
return r("onGetMutations", n), t;
|
|
174
189
|
} : void 0,
|
|
175
|
-
getNonce: (
|
|
190
|
+
getNonce: (d = a.callbacks) != null && d.getNonce ? () => a.callbacks.getNonce() : void 0,
|
|
176
191
|
onCloudSave: i("onCloudSave") ? (n) => {
|
|
177
|
-
var e,
|
|
178
|
-
const
|
|
179
|
-
return r("onCloudSave", n),
|
|
192
|
+
var e, o;
|
|
193
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onCloudSave) == null ? void 0 : o.call(e, n);
|
|
194
|
+
return r("onCloudSave", n), t;
|
|
180
195
|
} : void 0,
|
|
181
196
|
onCloudTemplateChange: i("onCloudTemplateChange") ? (n) => {
|
|
182
|
-
var e,
|
|
183
|
-
const
|
|
184
|
-
return r("onCloudTemplateChange", n),
|
|
197
|
+
var e, o;
|
|
198
|
+
const t = (o = (e = a.callbacks) == null ? void 0 : e.onCloudTemplateChange) == null ? void 0 : o.call(e, n);
|
|
199
|
+
return r("onCloudTemplateChange", n), t;
|
|
185
200
|
} : void 0
|
|
186
201
|
};
|
|
187
202
|
try {
|
|
188
|
-
const n = await
|
|
189
|
-
if (
|
|
203
|
+
const n = await D.init({ config: a.options, ...l }, { stage: a.stage, loaderUrl: a.loaderUrl });
|
|
204
|
+
if (v) {
|
|
190
205
|
await n.destroy();
|
|
191
206
|
return;
|
|
192
207
|
}
|
|
193
|
-
|
|
208
|
+
u = n;
|
|
194
209
|
try {
|
|
195
|
-
await n.render(
|
|
196
|
-
} catch (
|
|
197
|
-
throw await n.destroy(),
|
|
210
|
+
await n.render(m.value);
|
|
211
|
+
} catch (t) {
|
|
212
|
+
throw await n.destroy(), u = void 0, t;
|
|
198
213
|
}
|
|
199
|
-
|
|
214
|
+
v || r("ready", n);
|
|
200
215
|
} catch (n) {
|
|
201
|
-
|
|
216
|
+
b(n);
|
|
202
217
|
}
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
}), (
|
|
218
|
+
}), U(() => {
|
|
219
|
+
v = !0;
|
|
220
|
+
const l = u;
|
|
221
|
+
u = void 0, l == null || l.destroy().catch((d) => console.warn("[@topol.io/editor-vue] EmailEditor cleanup failed:", d));
|
|
222
|
+
}), (l, d) => (B(), P("div", {
|
|
208
223
|
ref_key: "container",
|
|
209
|
-
ref:
|
|
224
|
+
ref: m,
|
|
210
225
|
style: { width: "100%", height: "100vh" }
|
|
211
226
|
}, null, 512));
|
|
212
227
|
}
|
|
213
|
-
}),
|
|
228
|
+
}), M = /* @__PURE__ */ L({
|
|
214
229
|
__name: "LandingPageEditor",
|
|
215
230
|
props: {
|
|
216
231
|
options: {},
|
|
217
|
-
|
|
232
|
+
callbacks: {},
|
|
233
|
+
stage: { default: "production" },
|
|
234
|
+
loaderUrl: {}
|
|
218
235
|
},
|
|
219
|
-
emits: ["onSave", "onSaveAndClose", "onOpenFileManager", "onImageDelete", "onLoaded", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onEdittedWithoutSaveChanged", "onOpenCustomBlockDialog", "onTemplateRename", "onEditorError"],
|
|
220
|
-
setup(
|
|
221
|
-
const a =
|
|
236
|
+
emits: ["ready", "onSave", "onSaveAndClose", "onOpenFileManager", "onImageDelete", "onLoaded", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onUnsavedChangesChange", "onEdittedWithoutSaveChanged", "onOpenCustomBlockDialog", "onTemplateRename", "onEditorError"],
|
|
237
|
+
setup(S, { expose: k, emit: p }) {
|
|
238
|
+
const a = S, r = p, h = [
|
|
222
239
|
"onSave",
|
|
223
240
|
"onSaveAndClose",
|
|
224
241
|
"onOpenFileManager",
|
|
@@ -231,70 +248,83 @@ const B = /* @__PURE__ */ p({
|
|
|
231
248
|
"onPreviewClose",
|
|
232
249
|
"onAlert",
|
|
233
250
|
"onEditorClose",
|
|
251
|
+
"onUnsavedChangesChange",
|
|
234
252
|
"onEdittedWithoutSaveChanged",
|
|
235
253
|
"onOpenCustomBlockDialog",
|
|
236
254
|
"onTemplateRename",
|
|
237
255
|
"onEditorError"
|
|
238
|
-
],
|
|
239
|
-
|
|
240
|
-
if (
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
256
|
+
], m = w(), u = y(null), v = T(), i = (o) => {
|
|
257
|
+
var g;
|
|
258
|
+
if (typeof ((g = a.callbacks) == null ? void 0 : g[o]) == "function") return !0;
|
|
259
|
+
const c = v == null ? void 0 : v.vnode.props;
|
|
260
|
+
if (!c) return !1;
|
|
261
|
+
const s = "on" + o.charAt(0).toUpperCase() + o.slice(1);
|
|
262
|
+
return [s, s + "Once"].some((C) => typeof c[C] == "function" || Array.isArray(c[C]));
|
|
263
|
+
}, b = () => {
|
|
264
|
+
var c;
|
|
244
265
|
const o = {};
|
|
245
|
-
for (const
|
|
246
|
-
|
|
247
|
-
|
|
266
|
+
for (const s of h)
|
|
267
|
+
i(s) && (o[s] = (g) => {
|
|
268
|
+
var E, f;
|
|
269
|
+
const C = (f = (E = a.callbacks) == null ? void 0 : E[s]) == null ? void 0 : f.call(E, g);
|
|
270
|
+
return g === void 0 ? r(s) : r(s, g), C;
|
|
248
271
|
});
|
|
249
|
-
return o;
|
|
272
|
+
return typeof ((c = a.callbacks) == null ? void 0 : c.getNonce) == "function" && (o.getNonce = () => a.callbacks.getNonce()), o;
|
|
250
273
|
};
|
|
251
|
-
let
|
|
252
|
-
async function
|
|
253
|
-
var
|
|
274
|
+
let l = !1;
|
|
275
|
+
async function d(o) {
|
|
276
|
+
var c;
|
|
254
277
|
if (o)
|
|
255
278
|
try {
|
|
256
|
-
await ((
|
|
257
|
-
} catch (
|
|
258
|
-
console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:",
|
|
279
|
+
await ((c = o.destroy) == null ? void 0 : c.call(o));
|
|
280
|
+
} catch (s) {
|
|
281
|
+
console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:", s);
|
|
259
282
|
}
|
|
260
283
|
}
|
|
261
|
-
return
|
|
284
|
+
return A(async () => {
|
|
285
|
+
var o, c;
|
|
262
286
|
try {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
await s
|
|
287
|
+
const s = await R.init({ config: a.options, ...b() }, { stage: a.stage, loaderUrl: a.loaderUrl });
|
|
288
|
+
if (l) {
|
|
289
|
+
await d(s);
|
|
266
290
|
return;
|
|
267
291
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
292
|
+
u.value = s;
|
|
293
|
+
try {
|
|
294
|
+
await s.render(m.value);
|
|
295
|
+
} catch (g) {
|
|
296
|
+
throw u.value === s && (u.value = null), await d(s), g;
|
|
297
|
+
}
|
|
298
|
+
l || r("ready", s);
|
|
299
|
+
} catch (s) {
|
|
300
|
+
if (l) return;
|
|
301
|
+
const C = { source: "integration", message: s instanceof Error ? s.message : "Failed to initialize editor", detail: s };
|
|
302
|
+
(c = (o = a.callbacks) == null ? void 0 : o.onEditorError) == null || c.call(o, C), r("onEditorError", C), console.error("[@topol.io/editor-vue] LandingPageEditor initialization failed:", s);
|
|
273
303
|
}
|
|
274
|
-
}),
|
|
275
|
-
|
|
276
|
-
const o =
|
|
277
|
-
|
|
278
|
-
}),
|
|
279
|
-
load: (o) => {
|
|
280
|
-
var
|
|
281
|
-
(
|
|
304
|
+
}), U(() => {
|
|
305
|
+
l = !0;
|
|
306
|
+
const o = u.value;
|
|
307
|
+
u.value = null, d(o);
|
|
308
|
+
}), k({
|
|
309
|
+
load: async (o) => {
|
|
310
|
+
var c;
|
|
311
|
+
await ((c = u.value) == null ? void 0 : c.load(o));
|
|
282
312
|
},
|
|
283
|
-
save: () => {
|
|
313
|
+
save: async () => {
|
|
284
314
|
var o;
|
|
285
|
-
(o =
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
315
|
+
await ((o = u.value) == null ? void 0 : o.save());
|
|
316
|
+
},
|
|
317
|
+
getEditor: () => u.value ?? null
|
|
318
|
+
}), (o, c) => (B(), P("div", {
|
|
319
|
+
ref_key: "container",
|
|
320
|
+
ref: m,
|
|
321
|
+
style: { width: "100%", height: "100vh" }
|
|
322
|
+
}, null, 512));
|
|
291
323
|
}
|
|
292
324
|
});
|
|
293
325
|
export {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
B as TopolEditor,
|
|
299
|
-
M as TopolPlugin
|
|
326
|
+
H as CoreEmailEditor,
|
|
327
|
+
N as CoreLandingPageEditor,
|
|
328
|
+
_ as EmailEditor,
|
|
329
|
+
M as LandingPageEditor
|
|
300
330
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@topol.io/editor"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@topol.io/editor","vue"],u):(d=typeof globalThis<"u"?globalThis:d||self,u(d["topol-editor-vue"]={},d.TopolPlugin,d.Vue))})(this,function(d,u,s){"use strict";const k=s.defineComponent({__name:"EmailEditor",props:{options:{},callbacks:{},stage:{default:"production"},loaderUrl:{}},emits:["ready","onSave","onSaveAndClose","onTestSend","onBannerClick","onOpenFileManager","onLoaded","onSavedSectionSave","onSavedSectionRemove","onSavedSectionEdit","onImageDelete","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onEdittedWithoutSaveChanged","onBlocksAndStructuresVisibilityChange","onOpenCustomBlockDialog","onTemplateRename","onTemplateUpdated","updateTestingEmailAddresses","onEditorError","onLanguageCreated","onLanguageDeleted","onLanguageSelected","onPrimaryLanguageChanged","onGetMutations","onCloudSave","onCloudTemplateChange"],setup(E,{expose:p,emit:h}){const a=E,r=h,S=s.getCurrentInstance(),v=s.ref();let g,C=!1;p({getEditor:()=>g??null});const i=l=>{var o,n,e;const c=`on${l[0].toUpperCase()}${l.slice(1)}`;return!!((o=a.callbacks)!=null&&o[l])||!!((n=S.vnode.props)!=null&&n[c])||!!((e=S.vnode.props)!=null&&e[`${c}Once`])},m=l=>{var o,n;if(C)return;const c={source:"integration",message:l instanceof Error?l.message:String(l),detail:l};i("onEditorError")||console.error("[@topol.io/editor-vue] EmailEditor failed:",l),(n=(o=a.callbacks)==null?void 0:o.onEditorError)==null||n.call(o,c),r("onEditorError",c)};return s.onMounted(async()=>{var c;const l={onSave:i("onSave")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onSave)==null?void 0:t.call(e,o);return r("onSave",o),n}:void 0,onSaveAndClose:i("onSaveAndClose")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onSaveAndClose)==null?void 0:t.call(e,o);return r("onSaveAndClose",o),n}:void 0,onTestSend:i("onTestSend")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onTestSend)==null?void 0:t.call(e,o);return r("onTestSend",o),n}:void 0,onBannerClick:i("onBannerClick")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onBannerClick)==null?void 0:t.call(e,o);return r("onBannerClick",o),n}:void 0,onOpenFileManager:i("onOpenFileManager")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onOpenFileManager)==null?void 0:e.call(n);return r("onOpenFileManager"),o}:void 0,onLoaded:i("onLoaded")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onLoaded)==null?void 0:e.call(n);return r("onLoaded"),o}:void 0,onSavedSectionSave:i("onSavedSectionSave")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onSavedSectionSave)==null?void 0:t.call(e,o);return r("onSavedSectionSave",o),n}:void 0,onSavedSectionRemove:i("onSavedSectionRemove")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onSavedSectionRemove)==null?void 0:t.call(e,o);return r("onSavedSectionRemove",o),n}:void 0,onSavedSectionEdit:i("onSavedSectionEdit")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onSavedSectionEdit)==null?void 0:t.call(e,o);return r("onSavedSectionEdit",o),n}:void 0,onImageDelete:i("onImageDelete")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onImageDelete)==null?void 0:t.call(e,o);return r("onImageDelete",o),n}:void 0,onInit:i("onInit")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onInit)==null?void 0:e.call(n);return r("onInit"),o}:void 0,onUndoChange:i("onUndoChange")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onUndoChange)==null?void 0:t.call(e,o);return r("onUndoChange",o),n}:void 0,onRedoChange:i("onRedoChange")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onRedoChange)==null?void 0:t.call(e,o);return r("onRedoChange",o),n}:void 0,onPreview:i("onPreview")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onPreview)==null?void 0:t.call(e,o);return r("onPreview",o),n}:void 0,onPreviewClose:i("onPreviewClose")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onPreviewClose)==null?void 0:e.call(n);return r("onPreviewClose"),o}:void 0,onAlert:i("onAlert")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onAlert)==null?void 0:t.call(e,o);return r("onAlert",o),n}:void 0,onEditorClose:i("onEditorClose")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onEditorClose)==null?void 0:e.call(n);return r("onEditorClose"),o}:void 0,onEdittedWithoutSaveChanged:i("onEdittedWithoutSaveChanged")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onEdittedWithoutSaveChanged)==null?void 0:t.call(e,o);return r("onEdittedWithoutSaveChanged",o),n}:void 0,onBlocksAndStructuresVisibilityChange:i("onBlocksAndStructuresVisibilityChange")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onBlocksAndStructuresVisibilityChange)==null?void 0:t.call(e,o);return r("onBlocksAndStructuresVisibilityChange",o),n}:void 0,onOpenCustomBlockDialog:i("onOpenCustomBlockDialog")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onOpenCustomBlockDialog)==null?void 0:t.call(e,o);return r("onOpenCustomBlockDialog",o),n}:void 0,onTemplateRename:i("onTemplateRename")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onTemplateRename)==null?void 0:t.call(e,o);return r("onTemplateRename",o),n}:void 0,onTemplateUpdated:i("onTemplateUpdated")?()=>{var n,e;const o=(e=(n=a.callbacks)==null?void 0:n.onTemplateUpdated)==null?void 0:e.call(n);return r("onTemplateUpdated"),o}:void 0,updateTestingEmailAddresses:i("updateTestingEmailAddresses")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.updateTestingEmailAddresses)==null?void 0:t.call(e,o);return r("updateTestingEmailAddresses",o),n}:void 0,onEditorError:i("onEditorError")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onEditorError)==null?void 0:t.call(e,o);return r("onEditorError",o),n}:void 0,onLanguageCreated:i("onLanguageCreated")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onLanguageCreated)==null?void 0:t.call(e,o);return r("onLanguageCreated",o),n}:void 0,onLanguageDeleted:i("onLanguageDeleted")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onLanguageDeleted)==null?void 0:t.call(e,o);return r("onLanguageDeleted",o),n}:void 0,onLanguageSelected:i("onLanguageSelected")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onLanguageSelected)==null?void 0:t.call(e,o);return r("onLanguageSelected",o),n}:void 0,onPrimaryLanguageChanged:i("onPrimaryLanguageChanged")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onPrimaryLanguageChanged)==null?void 0:t.call(e,o);return r("onPrimaryLanguageChanged",o),n}:void 0,onGetMutations:i("onGetMutations")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onGetMutations)==null?void 0:t.call(e,o);return r("onGetMutations",o),n}:void 0,getNonce:(c=a.callbacks)!=null&&c.getNonce?()=>a.callbacks.getNonce():void 0,onCloudSave:i("onCloudSave")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onCloudSave)==null?void 0:t.call(e,o);return r("onCloudSave",o),n}:void 0,onCloudTemplateChange:i("onCloudTemplateChange")?o=>{var e,t;const n=(t=(e=a.callbacks)==null?void 0:e.onCloudTemplateChange)==null?void 0:t.call(e,o);return r("onCloudTemplateChange",o),n}:void 0};try{const o=await u.EmailEditor.init({config:a.options,...l},{stage:a.stage,loaderUrl:a.loaderUrl});if(C){await o.destroy();return}g=o;try{await o.render(v.value)}catch(n){throw await o.destroy(),g=void 0,n}C||r("ready",o)}catch(o){m(o)}}),s.onBeforeUnmount(()=>{C=!0;const l=g;g=void 0,l==null||l.destroy().catch(c=>console.warn("[@topol.io/editor-vue] EmailEditor cleanup failed:",c))}),(l,c)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"container",ref:v,style:{width:"100%",height:"100vh"}},null,512))}}),f="topol-landing-page-editor-id",b=s.defineComponent({__name:"LandingPageEditor",props:{options:{},stage:{default:"production"}},emits:["onSave","onSaveAndClose","onOpenFileManager","onImageDelete","onLoaded","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onEdittedWithoutSaveChanged","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],setup(E,{expose:p,emit:h}){const a=E,r=h,S=["onSave","onSaveAndClose","onOpenFileManager","onImageDelete","onLoaded","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onEdittedWithoutSaveChanged","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],v=s.ref(null),g=s.getCurrentInstance(),C=n=>{const e=g==null?void 0:g.vnode.props;if(!e)return!1;const t="on"+n.charAt(0).toUpperCase()+n.slice(1);return typeof e[t]=="function"||Array.isArray(e[t])},i=()=>{const n={};for(const e of S)C(e)&&(n[e]=t=>{t===void 0?r(e):r(e,t)});return n};let m=!1;async function l(n){var e;if(n)try{await((e=n.destroy)==null?void 0:e.call(n))}catch(t){console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:",t)}}return s.onMounted(async()=>{try{const n=await u.LandingPageEditor.init({config:a.options,...i()},{stage:a.stage});if(m){await l(n);return}v.value=n,await n.render("#"+f)}catch(n){if(m)return;const e=n instanceof Error?n.message:"Failed to initialize editor";r("onEditorError",{source:"init",message:e,detail:n}),console.error("[@topol.io/editor-vue] LandingPageEditor initialization failed:",n)}}),s.onBeforeUnmount(()=>{m=!0;const n=v.value;v.value=null,l(n)}),p({load:n=>{var e;(e=v.value)==null||e.load(n)},save:()=>{var n;(n=v.value)==null||n.save()}}),(n,e)=>(s.openBlock(),s.createElementBlock("div",{id:f,style:{position:"absolute",width:"100%",height:"100vh"}}))}});Object.defineProperty(d,"CoreEmailEditor",{enumerable:!0,get:()=>u.EmailEditor}),Object.defineProperty(d,"CoreLandingPageEditor",{enumerable:!0,get:()=>u.LandingPageEditor}),d.TopolPlugin=u,d.EmailEditor=k,d.LandingPageEditor=b,d.TopolEditor=k,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(v,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@topol.io/editor"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@topol.io/editor","vue"],m):(v=typeof globalThis<"u"?globalThis:v||self,m(v["topol-editor-vue"]={},v.TopolPlugin,v.Vue))})(this,function(v,m,c){"use strict";const P=c.defineComponent({__name:"EmailEditor",props:{options:{},callbacks:{},stage:{default:"production"},loaderUrl:{}},emits:["ready","onSave","onSaveAndClose","onTestSend","onBannerClick","onOpenFileManager","onLoaded","onSavedSectionSave","onSavedSectionRemove","onSavedSectionEdit","onImageDelete","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onUnsavedChangesChange","onEdittedWithoutSaveChanged","onHiddenElementsVisibilityChange","onBlocksAndStructuresVisibilityChange","onOpenCustomBlockDialog","onTemplateRename","onTemplateUpdated","onTestingEmailsChange","updateTestingEmailAddresses","onEditorError","onLanguageCreated","onLanguageDeleted","onLanguageSelected","onPrimaryLanguageChanged","onGetMutations","onCloudSave","onCloudTemplateChange"],setup(f,{expose:b,emit:L}){const a=f,r=L,k=c.getCurrentInstance(),S=c.ref();let g,h=!1;b({getEditor:()=>g??null});const i=l=>{var n,t,e;const u=`on${l[0].toUpperCase()}${l.slice(1)}`;return!!((n=a.callbacks)!=null&&n[l])||!!((t=k.vnode.props)!=null&&t[u])||!!((e=k.vnode.props)!=null&&e[`${u}Once`])},T=l=>{var n,t;if(h)return;const u={source:"integration",message:l instanceof Error?l.message:String(l),detail:l};i("onEditorError")||console.error("[@topol.io/editor-vue] EmailEditor failed:",l),(t=(n=a.callbacks)==null?void 0:n.onEditorError)==null||t.call(n,u),r("onEditorError",u)};return c.onMounted(async()=>{var u;const l={onSave:i("onSave")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onSave)==null?void 0:o.call(e,n);return r("onSave",n),t}:void 0,onSaveAndClose:i("onSaveAndClose")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onSaveAndClose)==null?void 0:o.call(e,n);return r("onSaveAndClose",n),t}:void 0,onTestSend:i("onTestSend")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onTestSend)==null?void 0:o.call(e,n);return r("onTestSend",n),t}:void 0,onBannerClick:i("onBannerClick")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onBannerClick)==null?void 0:o.call(e,n);return r("onBannerClick",n),t}:void 0,onOpenFileManager:i("onOpenFileManager")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onOpenFileManager)==null?void 0:e.call(t);return r("onOpenFileManager"),n}:void 0,onLoaded:i("onLoaded")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onLoaded)==null?void 0:e.call(t);return r("onLoaded"),n}:void 0,onSavedSectionSave:i("onSavedSectionSave")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onSavedSectionSave)==null?void 0:o.call(e,n);return r("onSavedSectionSave",n),t}:void 0,onSavedSectionRemove:i("onSavedSectionRemove")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onSavedSectionRemove)==null?void 0:o.call(e,n);return r("onSavedSectionRemove",n),t}:void 0,onSavedSectionEdit:i("onSavedSectionEdit")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onSavedSectionEdit)==null?void 0:o.call(e,n);return r("onSavedSectionEdit",n),t}:void 0,onImageDelete:i("onImageDelete")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onImageDelete)==null?void 0:o.call(e,n);return r("onImageDelete",n),t}:void 0,onInit:i("onInit")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onInit)==null?void 0:e.call(t);return r("onInit"),n}:void 0,onUndoChange:i("onUndoChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onUndoChange)==null?void 0:o.call(e,n);return r("onUndoChange",n),t}:void 0,onRedoChange:i("onRedoChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onRedoChange)==null?void 0:o.call(e,n);return r("onRedoChange",n),t}:void 0,onPreview:i("onPreview")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onPreview)==null?void 0:o.call(e,n);return r("onPreview",n),t}:void 0,onPreviewClose:i("onPreviewClose")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onPreviewClose)==null?void 0:e.call(t);return r("onPreviewClose"),n}:void 0,onAlert:i("onAlert")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onAlert)==null?void 0:o.call(e,n);return r("onAlert",n),t}:void 0,onEditorClose:i("onEditorClose")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onEditorClose)==null?void 0:e.call(t);return r("onEditorClose"),n}:void 0,onUnsavedChangesChange:i("onUnsavedChangesChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onUnsavedChangesChange)==null?void 0:o.call(e,n);return r("onUnsavedChangesChange",n),t}:void 0,onEdittedWithoutSaveChanged:i("onEdittedWithoutSaveChanged")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onEdittedWithoutSaveChanged)==null?void 0:o.call(e,n);return r("onEdittedWithoutSaveChanged",n),t}:void 0,onHiddenElementsVisibilityChange:i("onHiddenElementsVisibilityChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onHiddenElementsVisibilityChange)==null?void 0:o.call(e,n);return r("onHiddenElementsVisibilityChange",n),t}:void 0,onBlocksAndStructuresVisibilityChange:i("onBlocksAndStructuresVisibilityChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onBlocksAndStructuresVisibilityChange)==null?void 0:o.call(e,n);return r("onBlocksAndStructuresVisibilityChange",n),t}:void 0,onOpenCustomBlockDialog:i("onOpenCustomBlockDialog")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onOpenCustomBlockDialog)==null?void 0:o.call(e,n);return r("onOpenCustomBlockDialog",n),t}:void 0,onTemplateRename:i("onTemplateRename")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onTemplateRename)==null?void 0:o.call(e,n);return r("onTemplateRename",n),t}:void 0,onTemplateUpdated:i("onTemplateUpdated")?()=>{var t,e;const n=(e=(t=a.callbacks)==null?void 0:t.onTemplateUpdated)==null?void 0:e.call(t);return r("onTemplateUpdated"),n}:void 0,onTestingEmailsChange:i("onTestingEmailsChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onTestingEmailsChange)==null?void 0:o.call(e,n);return r("onTestingEmailsChange",n),t}:void 0,updateTestingEmailAddresses:i("updateTestingEmailAddresses")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.updateTestingEmailAddresses)==null?void 0:o.call(e,n);return r("updateTestingEmailAddresses",n),t}:void 0,onEditorError:i("onEditorError")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onEditorError)==null?void 0:o.call(e,n);return r("onEditorError",n),t}:void 0,onLanguageCreated:i("onLanguageCreated")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onLanguageCreated)==null?void 0:o.call(e,n);return r("onLanguageCreated",n),t}:void 0,onLanguageDeleted:i("onLanguageDeleted")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onLanguageDeleted)==null?void 0:o.call(e,n);return r("onLanguageDeleted",n),t}:void 0,onLanguageSelected:i("onLanguageSelected")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onLanguageSelected)==null?void 0:o.call(e,n);return r("onLanguageSelected",n),t}:void 0,onPrimaryLanguageChanged:i("onPrimaryLanguageChanged")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onPrimaryLanguageChanged)==null?void 0:o.call(e,n);return r("onPrimaryLanguageChanged",n),t}:void 0,onGetMutations:i("onGetMutations")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onGetMutations)==null?void 0:o.call(e,n);return r("onGetMutations",n),t}:void 0,getNonce:(u=a.callbacks)!=null&&u.getNonce?()=>a.callbacks.getNonce():void 0,onCloudSave:i("onCloudSave")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onCloudSave)==null?void 0:o.call(e,n);return r("onCloudSave",n),t}:void 0,onCloudTemplateChange:i("onCloudTemplateChange")?n=>{var e,o;const t=(o=(e=a.callbacks)==null?void 0:e.onCloudTemplateChange)==null?void 0:o.call(e,n);return r("onCloudTemplateChange",n),t}:void 0};try{const n=await m.EmailEditor.init({config:a.options,...l},{stage:a.stage,loaderUrl:a.loaderUrl});if(h){await n.destroy();return}g=n;try{await n.render(S.value)}catch(t){throw await n.destroy(),g=void 0,t}h||r("ready",n)}catch(n){T(n)}}),c.onBeforeUnmount(()=>{h=!0;const l=g;g=void 0,l==null||l.destroy().catch(u=>console.warn("[@topol.io/editor-vue] EmailEditor cleanup failed:",u))}),(l,u)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"container",ref:S,style:{width:"100%",height:"100vh"}},null,512))}}),A=c.defineComponent({__name:"LandingPageEditor",props:{options:{},callbacks:{},stage:{default:"production"},loaderUrl:{}},emits:["ready","onSave","onSaveAndClose","onOpenFileManager","onImageDelete","onLoaded","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onUnsavedChangesChange","onEdittedWithoutSaveChanged","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],setup(f,{expose:b,emit:L}){const a=f,r=L,k=["onSave","onSaveAndClose","onOpenFileManager","onImageDelete","onLoaded","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onUnsavedChangesChange","onEdittedWithoutSaveChanged","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],S=c.ref(),g=c.shallowRef(null),h=c.getCurrentInstance(),i=o=>{var C;if(typeof((C=a.callbacks)==null?void 0:C[o])=="function")return!0;const d=h==null?void 0:h.vnode.props;if(!d)return!1;const s="on"+o.charAt(0).toUpperCase()+o.slice(1);return[s,s+"Once"].some(E=>typeof d[E]=="function"||Array.isArray(d[E]))},T=()=>{var d;const o={};for(const s of k)i(s)&&(o[s]=C=>{var p,w;const E=(w=(p=a.callbacks)==null?void 0:p[s])==null?void 0:w.call(p,C);return C===void 0?r(s):r(s,C),E});return typeof((d=a.callbacks)==null?void 0:d.getNonce)=="function"&&(o.getNonce=()=>a.callbacks.getNonce()),o};let l=!1;async function u(o){var d;if(o)try{await((d=o.destroy)==null?void 0:d.call(o))}catch(s){console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:",s)}}return c.onMounted(async()=>{var o,d;try{const s=await m.LandingPageEditor.init({config:a.options,...T()},{stage:a.stage,loaderUrl:a.loaderUrl});if(l){await u(s);return}g.value=s;try{await s.render(S.value)}catch(C){throw g.value===s&&(g.value=null),await u(s),C}l||r("ready",s)}catch(s){if(l)return;const E={source:"integration",message:s instanceof Error?s.message:"Failed to initialize editor",detail:s};(d=(o=a.callbacks)==null?void 0:o.onEditorError)==null||d.call(o,E),r("onEditorError",E),console.error("[@topol.io/editor-vue] LandingPageEditor initialization failed:",s)}}),c.onBeforeUnmount(()=>{l=!0;const o=g.value;g.value=null,u(o)}),b({load:async o=>{var d;await((d=g.value)==null?void 0:d.load(o))},save:async()=>{var o;await((o=g.value)==null?void 0:o.save())},getEditor:()=>g.value??null}),(o,d)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"container",ref:S,style:{width:"100%",height:"100vh"}},null,512))}});Object.defineProperty(v,"CoreEmailEditor",{enumerable:!0,get:()=>m.EmailEditor}),Object.defineProperty(v,"CoreLandingPageEditor",{enumerable:!0,get:()=>m.LandingPageEditor}),v.EmailEditor=P,v.LandingPageEditor=A,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IEmailCallbacks, IEmailEditorInstance, IStage,
|
|
1
|
+
import type { IEmailCallbacks, IEmailEditorInstance, IStage, IEmailErrorPayload } from "@topol.io/editor";
|
|
2
2
|
import type { IVueEmailOptions } from "./types";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
options: IVueEmailOptions;
|
|
@@ -9,9 +9,9 @@ type __VLS_Props = {
|
|
|
9
9
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
10
|
getEditor: () => IEmailEditorInstance | null;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
onSave: (payload: import("@topol.io/editor").
|
|
13
|
-
onSaveAndClose: (payload: import("@topol.io/editor").
|
|
14
|
-
onTestSend: (payload: import("@topol.io/editor").
|
|
12
|
+
onSave: (payload: import("@topol.io/editor").IEmailSavePayload) => any;
|
|
13
|
+
onSaveAndClose: (payload: import("@topol.io/editor").IEmailSavePayload) => any;
|
|
14
|
+
onTestSend: (payload: import("@topol.io/editor").IEmailTestSendPayload) => any;
|
|
15
15
|
onBannerClick: (payload: {
|
|
16
16
|
json: unknown;
|
|
17
17
|
html: unknown;
|
|
@@ -19,13 +19,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
19
19
|
onOpenFileManager: () => any;
|
|
20
20
|
onLoaded: () => any;
|
|
21
21
|
onSavedSectionSave: (payload: {
|
|
22
|
-
section: import("@topol.io/editor").
|
|
22
|
+
section: import("@topol.io/editor").ISavedSectionDraft;
|
|
23
23
|
}) => any;
|
|
24
24
|
onSavedSectionRemove: (payload: {
|
|
25
|
-
id: number
|
|
25
|
+
id: number;
|
|
26
26
|
}) => any;
|
|
27
27
|
onSavedSectionEdit: (payload: {
|
|
28
|
-
id: number
|
|
28
|
+
id: number;
|
|
29
29
|
}) => any;
|
|
30
30
|
onImageDelete: (payload: {
|
|
31
31
|
items: import("@topol.io/editor").IEmailDeletedItem[];
|
|
@@ -45,9 +45,15 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
45
45
|
notification: import("@topol.io/editor").INotification;
|
|
46
46
|
}) => any;
|
|
47
47
|
onEditorClose: () => any;
|
|
48
|
+
onUnsavedChangesChange: (payload: {
|
|
49
|
+
hasUnsavedChanges: boolean;
|
|
50
|
+
}) => any;
|
|
48
51
|
onEdittedWithoutSaveChanged: (payload: {
|
|
49
52
|
value: boolean;
|
|
50
53
|
}) => any;
|
|
54
|
+
onHiddenElementsVisibilityChange: (payload: {
|
|
55
|
+
visible: boolean;
|
|
56
|
+
}) => any;
|
|
51
57
|
onBlocksAndStructuresVisibilityChange: (payload: {
|
|
52
58
|
value: boolean;
|
|
53
59
|
}) => any;
|
|
@@ -58,10 +64,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
58
64
|
name: string;
|
|
59
65
|
}) => any;
|
|
60
66
|
onTemplateUpdated: () => any;
|
|
67
|
+
onTestingEmailsChange: (payload: {
|
|
68
|
+
emails: string[];
|
|
69
|
+
}) => any;
|
|
61
70
|
updateTestingEmailAddresses: (payload: {
|
|
62
71
|
emails: string[];
|
|
63
72
|
}) => any;
|
|
64
|
-
onEditorError: (payload:
|
|
73
|
+
onEditorError: (payload: IEmailErrorPayload) => any;
|
|
65
74
|
onLanguageCreated: (payload: import("@topol.io/editor").ILanguageChangePayload) => any;
|
|
66
75
|
onLanguageDeleted: (payload: import("@topol.io/editor").ILanguageChangePayload) => any;
|
|
67
76
|
onLanguageSelected: (payload: {
|
|
@@ -75,9 +84,9 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
75
84
|
onCloudTemplateChange: (payload: import("@topol.io/editor").ICloudTemplateChangePayload) => any;
|
|
76
85
|
ready: (editor: IEmailEditorInstance) => any;
|
|
77
86
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
78
|
-
onOnSave?: ((payload: import("@topol.io/editor").
|
|
79
|
-
onOnSaveAndClose?: ((payload: import("@topol.io/editor").
|
|
80
|
-
onOnTestSend?: ((payload: import("@topol.io/editor").
|
|
87
|
+
onOnSave?: ((payload: import("@topol.io/editor").IEmailSavePayload) => any) | undefined;
|
|
88
|
+
onOnSaveAndClose?: ((payload: import("@topol.io/editor").IEmailSavePayload) => any) | undefined;
|
|
89
|
+
onOnTestSend?: ((payload: import("@topol.io/editor").IEmailTestSendPayload) => any) | undefined;
|
|
81
90
|
onOnBannerClick?: ((payload: {
|
|
82
91
|
json: unknown;
|
|
83
92
|
html: unknown;
|
|
@@ -85,13 +94,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
85
94
|
onOnOpenFileManager?: (() => any) | undefined;
|
|
86
95
|
onOnLoaded?: (() => any) | undefined;
|
|
87
96
|
onOnSavedSectionSave?: ((payload: {
|
|
88
|
-
section: import("@topol.io/editor").
|
|
97
|
+
section: import("@topol.io/editor").ISavedSectionDraft;
|
|
89
98
|
}) => any) | undefined;
|
|
90
99
|
onOnSavedSectionRemove?: ((payload: {
|
|
91
|
-
id: number
|
|
100
|
+
id: number;
|
|
92
101
|
}) => any) | undefined;
|
|
93
102
|
onOnSavedSectionEdit?: ((payload: {
|
|
94
|
-
id: number
|
|
103
|
+
id: number;
|
|
95
104
|
}) => any) | undefined;
|
|
96
105
|
onOnImageDelete?: ((payload: {
|
|
97
106
|
items: import("@topol.io/editor").IEmailDeletedItem[];
|
|
@@ -111,9 +120,15 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
111
120
|
notification: import("@topol.io/editor").INotification;
|
|
112
121
|
}) => any) | undefined;
|
|
113
122
|
onOnEditorClose?: (() => any) | undefined;
|
|
123
|
+
onOnUnsavedChangesChange?: ((payload: {
|
|
124
|
+
hasUnsavedChanges: boolean;
|
|
125
|
+
}) => any) | undefined;
|
|
114
126
|
onOnEdittedWithoutSaveChanged?: ((payload: {
|
|
115
127
|
value: boolean;
|
|
116
128
|
}) => any) | undefined;
|
|
129
|
+
onOnHiddenElementsVisibilityChange?: ((payload: {
|
|
130
|
+
visible: boolean;
|
|
131
|
+
}) => any) | undefined;
|
|
117
132
|
onOnBlocksAndStructuresVisibilityChange?: ((payload: {
|
|
118
133
|
value: boolean;
|
|
119
134
|
}) => any) | undefined;
|
|
@@ -124,10 +139,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
124
139
|
name: string;
|
|
125
140
|
}) => any) | undefined;
|
|
126
141
|
onOnTemplateUpdated?: (() => any) | undefined;
|
|
142
|
+
onOnTestingEmailsChange?: ((payload: {
|
|
143
|
+
emails: string[];
|
|
144
|
+
}) => any) | undefined;
|
|
127
145
|
onUpdateTestingEmailAddresses?: ((payload: {
|
|
128
146
|
emails: string[];
|
|
129
147
|
}) => any) | undefined;
|
|
130
|
-
onOnEditorError?: ((payload:
|
|
148
|
+
onOnEditorError?: ((payload: IEmailErrorPayload) => any) | undefined;
|
|
131
149
|
onOnLanguageCreated?: ((payload: import("@topol.io/editor").ILanguageChangePayload) => any) | undefined;
|
|
132
150
|
onOnLanguageDeleted?: ((payload: import("@topol.io/editor").ILanguageChangePayload) => any) | undefined;
|
|
133
151
|
onOnLanguageSelected?: ((payload: {
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { type IStage } from "@topol.io/editor";
|
|
1
|
+
import { type ILandingPageCallbacks, type ILandingPageEditorInstance, type IStage } from "@topol.io/editor";
|
|
2
2
|
import type { IVueLandingPageOptions } from "./types";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
options: IVueLandingPageOptions;
|
|
5
|
+
/**
|
|
6
|
+
* Callbacks as functions, for the ones whose result the editor uses: `getNonce` (the only
|
|
7
|
+
* way to pass it), and an async `onSave` / `onSaveAndClose` / `onEditorClose` the editor
|
|
8
|
+
* should wait for. A callback given here and its event (`@on-save`) both fire.
|
|
9
|
+
*/
|
|
10
|
+
callbacks?: ILandingPageCallbacks;
|
|
5
11
|
stage?: IStage;
|
|
12
|
+
/** Explicit loader URL, e.g. a deployed preview or a local build. One loader URL per page. */
|
|
13
|
+
loaderUrl?: string;
|
|
6
14
|
};
|
|
7
15
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
8
|
-
load: (template: unknown) => void
|
|
9
|
-
save: () => void
|
|
16
|
+
load: (template: unknown) => Promise<void>;
|
|
17
|
+
save: () => Promise<void>;
|
|
18
|
+
getEditor: () => ILandingPageEditorInstance | null;
|
|
10
19
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
20
|
[x: string]: any;
|
|
12
21
|
} & {
|
package/dist/types/entry.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* import { EmailEditor, type IVueEmailOptions } from '@topol.io/editor-vue';
|
|
8
8
|
*
|
|
9
9
|
* const options: IVueEmailOptions = {
|
|
10
|
-
* authorize: { apiKey: 'your-key',
|
|
10
|
+
* authorize: { apiKey: 'your-key', entityId: 'user-123' },
|
|
11
11
|
* };
|
|
12
12
|
* </script>
|
|
13
13
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* import { LandingPageEditor, type IVueLandingPageOptions } from '@topol.io/editor-vue';
|
|
23
23
|
*
|
|
24
24
|
* const options: IVueLandingPageOptions = {
|
|
25
|
-
* authorize: { apiKey: 'your-key',
|
|
25
|
+
* authorize: { apiKey: 'your-key', entityId: 'user-123' },
|
|
26
26
|
* };
|
|
27
27
|
* </script>
|
|
28
28
|
*
|
|
@@ -31,13 +31,8 @@
|
|
|
31
31
|
* </template>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export {
|
|
34
|
+
export { EmailEditor as CoreEmailEditor, LandingPageEditor as CoreLandingPageEditor } from "@topol.io/editor";
|
|
35
35
|
export { default as EmailEditor } from "./EmailEditor.vue";
|
|
36
36
|
export { default as LandingPageEditor } from "./LandingPageEditor.vue";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
export { default as TopolEditor } from "./TopolEditor.vue";
|
|
41
|
-
export type { ITopolOptions, ILandingPageOptions, ILandingPageEditorInstance, IEmailCallbacks, ILandingPageCallbacks, ISaveData, IErrorData, ISendTestData, INotification, ISavedBlock, IStage, TopolSection, } from "@topol.io/editor";
|
|
42
|
-
export type { IVueEmailOptions, IVueLandingPageOptions, IVueOptions } from "./types";
|
|
43
|
-
export type { IEmailConfig, IEmailEditorInstance, IEmailEditorPluginOptions, ICloudOptions, ICloudFeatures, INonceAuthCallbacks, ICountdownOptions, ICountdownDefaultColors, ICountdownDateMergeTag, ICloudCallbacks, ICloudSavePayload, ICloudTemplateChangePayload, ISavedSection, IPremadeSection, IPremadeSections, IPremadeSectionsOptions, ILanguageMutation, ILanguageChangePayload, IEmailDeletedItem, IUpdateTemplateOptions, } from "@topol.io/editor";
|
|
37
|
+
export type { IVueEmailOptions, IVueLandingPageOptions } from "./types";
|
|
38
|
+
export type { IEmailOptions, IEmailConfig, IEmailCallbacks, IEmailEditorInstance, IEmailEditorPluginOptions, IEmailSavePayload, IEmailErrorPayload, IEmailTestSendPayload, IEmailDeletedItem, IUpdateTemplateOptions, ILanguageMutation, ILanguageChangePayload, ILandingPageOptions, ILandingPageConfig, ILandingPageCallbacks, ILandingPageEditorInstance, ILandingPageEditorPluginOptions, ILandingPageSavePayload, ILandingPageErrorPayload, ILandingPageDeletedItem, IStage, EditorErrorSource, INonceAuthCallbacks, IAuthorize, EmailEditorShortcut, LandingPageEditorShortcut, INotification, ICloudOptions, ICloudFeatures, ICloudCallbacks, ICloudSavePayload, ICloudTemplateChangePayload, ICountdownOptions, ICountdownDefaultColors, ICountdownDateMergeTag, ISavedSection, ISavedSectionDraft, IPremadeSection, IPremadeSections, IPremadeSectionsOptions, } from "@topol.io/editor";
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
+
import type { IEmailConfig, ILandingPageConfig } from "@topol.io/editor";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export type { ITopolOptions, ILandingPageOptions, ILandingPageEditorInstance, IEmailCallbacks, ILandingPageCallbacks, ISaveData, IErrorData, ISendTestData, INotification, ISavedBlock, IStage, TopolSection, } from "@topol.io/editor";
|
|
5
|
-
import type { IEmailConfig, ILandingPageOptions } from "@topol.io/editor";
|
|
6
|
-
/**
|
|
7
|
-
* Vue-specific options for EmailEditor component.
|
|
8
|
-
* Contains the v4 config; callbacks are provided separately.
|
|
3
|
+
* The `options` prop of the EmailEditor component: the editor config.
|
|
4
|
+
* Callbacks are passed through the `callbacks` prop or as events.
|
|
9
5
|
*/
|
|
10
6
|
export type IVueEmailOptions = IEmailConfig;
|
|
11
7
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
export type IVueLandingPageOptions = ILandingPageOptions["config"];
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Use IVueEmailOptions instead.
|
|
8
|
+
* The `options` prop of the LandingPageEditor component: the editor config.
|
|
9
|
+
* Callbacks are passed through the `callbacks` prop or as events.
|
|
18
10
|
*/
|
|
19
|
-
export type
|
|
11
|
+
export type IVueLandingPageOptions = ILandingPageConfig;
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Topol.io",
|
|
15
15
|
"homepage": "https://topol.io",
|
|
16
16
|
"license": "Apache-2.0",
|
|
17
|
-
"version": "1.0.0-alpha.
|
|
17
|
+
"version": "1.0.0-alpha.11",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@topol.io/editor": "1.0.0-alpha.
|
|
32
|
+
"@topol.io/editor": "1.0.0-alpha.11"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"vue": "^3.2.25"
|