@topol.io/editor-vue 1.0.0-alpha.11 → 1.0.0-alpha.12
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EmailEditor as
|
|
2
|
-
import { EmailEditor as
|
|
3
|
-
import { defineComponent as L, getCurrentInstance as
|
|
1
|
+
import { EmailEditor as R, LandingPageEditor as y } from "@topol.io/editor";
|
|
2
|
+
import { EmailEditor as N, LandingPageEditor as x } from "@topol.io/editor";
|
|
3
|
+
import { defineComponent as L, getCurrentInstance as w, ref as U, onMounted as P, onBeforeUnmount as T, createElementBlock as A, openBlock as D, shallowRef as B } from "vue";
|
|
4
4
|
const _ = /* @__PURE__ */ L({
|
|
5
5
|
__name: "EmailEditor",
|
|
6
6
|
props: {
|
|
@@ -9,198 +9,183 @@ const _ = /* @__PURE__ */ L({
|
|
|
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", "onUnsavedChangesChange", "
|
|
12
|
+
emits: ["ready", "onSave", "onSaveAndClose", "onTestSend", "onBannerClick", "onOpenFileManager", "onLoaded", "onSavedSectionSave", "onSavedSectionRemove", "onSavedSectionEdit", "onImageDelete", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onUnsavedChangesChange", "onHiddenElementsVisibilityChange", "onOpenCustomBlockDialog", "onTemplateRename", "onTemplateUpdated", "onTestingEmailsChange", "onEditorError", "onLanguageCreated", "onLanguageDeleted", "onLanguageSelected", "onPrimaryLanguageChanged", "onGetMutations", "onCloudSave", "onCloudTemplateChange"],
|
|
13
13
|
setup(S, { expose: k, emit: p }) {
|
|
14
|
-
const a = S, r = p,
|
|
14
|
+
const a = S, r = p, E = w(), m = U();
|
|
15
15
|
let u, v = !1;
|
|
16
16
|
k({ getEditor: () => u ?? null });
|
|
17
|
-
const
|
|
17
|
+
const l = (i) => {
|
|
18
18
|
var n, t, e;
|
|
19
|
-
const d = `on${
|
|
20
|
-
return !!((n = a.callbacks) != null && n[
|
|
21
|
-
}, b = (
|
|
19
|
+
const d = `on${i[0].toUpperCase()}${i.slice(1)}`;
|
|
20
|
+
return !!((n = a.callbacks) != null && n[i]) || !!((t = E.vnode.props) != null && t[d]) || !!((e = E.vnode.props) != null && e[`${d}Once`]);
|
|
21
|
+
}, b = (i) => {
|
|
22
22
|
var n, t;
|
|
23
23
|
if (v) return;
|
|
24
|
-
const d = { source: "integration", message:
|
|
25
|
-
|
|
24
|
+
const d = { source: "integration", message: i instanceof Error ? i.message : String(i), detail: i };
|
|
25
|
+
l("onEditorError") || console.error("[@topol.io/editor-vue] EmailEditor failed:", i), (t = (n = a.callbacks) == null ? void 0 : n.onEditorError) == null || t.call(n, d), r("onEditorError", d);
|
|
26
26
|
};
|
|
27
|
-
return
|
|
27
|
+
return P(async () => {
|
|
28
28
|
var d;
|
|
29
|
-
const
|
|
30
|
-
onSave:
|
|
29
|
+
const i = {
|
|
30
|
+
onSave: l("onSave") ? (n) => {
|
|
31
31
|
var e, o;
|
|
32
32
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSave) == null ? void 0 : o.call(e, n);
|
|
33
33
|
return r("onSave", n), t;
|
|
34
34
|
} : void 0,
|
|
35
|
-
onSaveAndClose:
|
|
35
|
+
onSaveAndClose: l("onSaveAndClose") ? (n) => {
|
|
36
36
|
var e, o;
|
|
37
37
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSaveAndClose) == null ? void 0 : o.call(e, n);
|
|
38
38
|
return r("onSaveAndClose", n), t;
|
|
39
39
|
} : void 0,
|
|
40
|
-
onTestSend:
|
|
40
|
+
onTestSend: l("onTestSend") ? (n) => {
|
|
41
41
|
var e, o;
|
|
42
42
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTestSend) == null ? void 0 : o.call(e, n);
|
|
43
43
|
return r("onTestSend", n), t;
|
|
44
44
|
} : void 0,
|
|
45
|
-
onBannerClick:
|
|
45
|
+
onBannerClick: l("onBannerClick") ? (n) => {
|
|
46
46
|
var e, o;
|
|
47
47
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onBannerClick) == null ? void 0 : o.call(e, n);
|
|
48
48
|
return r("onBannerClick", n), t;
|
|
49
49
|
} : void 0,
|
|
50
|
-
onOpenFileManager:
|
|
50
|
+
onOpenFileManager: l("onOpenFileManager") ? () => {
|
|
51
51
|
var t, e;
|
|
52
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
|
-
onLoaded:
|
|
55
|
+
onLoaded: l("onLoaded") ? () => {
|
|
56
56
|
var t, e;
|
|
57
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
|
-
onSavedSectionSave:
|
|
60
|
+
onSavedSectionSave: l("onSavedSectionSave") ? (n) => {
|
|
61
61
|
var e, o;
|
|
62
62
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionSave) == null ? void 0 : o.call(e, n);
|
|
63
63
|
return r("onSavedSectionSave", n), t;
|
|
64
64
|
} : void 0,
|
|
65
|
-
onSavedSectionRemove:
|
|
65
|
+
onSavedSectionRemove: l("onSavedSectionRemove") ? (n) => {
|
|
66
66
|
var e, o;
|
|
67
67
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionRemove) == null ? void 0 : o.call(e, n);
|
|
68
68
|
return r("onSavedSectionRemove", n), t;
|
|
69
69
|
} : void 0,
|
|
70
|
-
onSavedSectionEdit:
|
|
70
|
+
onSavedSectionEdit: l("onSavedSectionEdit") ? (n) => {
|
|
71
71
|
var e, o;
|
|
72
72
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onSavedSectionEdit) == null ? void 0 : o.call(e, n);
|
|
73
73
|
return r("onSavedSectionEdit", n), t;
|
|
74
74
|
} : void 0,
|
|
75
|
-
onImageDelete:
|
|
75
|
+
onImageDelete: l("onImageDelete") ? (n) => {
|
|
76
76
|
var e, o;
|
|
77
77
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onImageDelete) == null ? void 0 : o.call(e, n);
|
|
78
78
|
return r("onImageDelete", n), t;
|
|
79
79
|
} : void 0,
|
|
80
|
-
onInit:
|
|
80
|
+
onInit: l("onInit") ? () => {
|
|
81
81
|
var t, e;
|
|
82
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
|
-
onUndoChange:
|
|
85
|
+
onUndoChange: l("onUndoChange") ? (n) => {
|
|
86
86
|
var e, o;
|
|
87
87
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onUndoChange) == null ? void 0 : o.call(e, n);
|
|
88
88
|
return r("onUndoChange", n), t;
|
|
89
89
|
} : void 0,
|
|
90
|
-
onRedoChange:
|
|
90
|
+
onRedoChange: l("onRedoChange") ? (n) => {
|
|
91
91
|
var e, o;
|
|
92
92
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onRedoChange) == null ? void 0 : o.call(e, n);
|
|
93
93
|
return r("onRedoChange", n), t;
|
|
94
94
|
} : void 0,
|
|
95
|
-
onPreview:
|
|
95
|
+
onPreview: l("onPreview") ? (n) => {
|
|
96
96
|
var e, o;
|
|
97
97
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onPreview) == null ? void 0 : o.call(e, n);
|
|
98
98
|
return r("onPreview", n), t;
|
|
99
99
|
} : void 0,
|
|
100
|
-
onPreviewClose:
|
|
100
|
+
onPreviewClose: l("onPreviewClose") ? () => {
|
|
101
101
|
var t, e;
|
|
102
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
|
-
onAlert:
|
|
105
|
+
onAlert: l("onAlert") ? (n) => {
|
|
106
106
|
var e, o;
|
|
107
107
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onAlert) == null ? void 0 : o.call(e, n);
|
|
108
108
|
return r("onAlert", n), t;
|
|
109
109
|
} : void 0,
|
|
110
|
-
onEditorClose:
|
|
110
|
+
onEditorClose: l("onEditorClose") ? () => {
|
|
111
111
|
var t, e;
|
|
112
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:
|
|
115
|
+
onUnsavedChangesChange: l("onUnsavedChangesChange") ? (n) => {
|
|
116
116
|
var e, o;
|
|
117
117
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onUnsavedChangesChange) == null ? void 0 : o.call(e, n);
|
|
118
118
|
return r("onUnsavedChangesChange", n), t;
|
|
119
119
|
} : void 0,
|
|
120
|
-
|
|
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) => {
|
|
120
|
+
onHiddenElementsVisibilityChange: l("onHiddenElementsVisibilityChange") ? (n) => {
|
|
126
121
|
var e, o;
|
|
127
122
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onHiddenElementsVisibilityChange) == null ? void 0 : o.call(e, n);
|
|
128
123
|
return r("onHiddenElementsVisibilityChange", n), t;
|
|
129
124
|
} : void 0,
|
|
130
|
-
|
|
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;
|
|
134
|
-
} : void 0,
|
|
135
|
-
onOpenCustomBlockDialog: i("onOpenCustomBlockDialog") ? (n) => {
|
|
125
|
+
onOpenCustomBlockDialog: l("onOpenCustomBlockDialog") ? (n) => {
|
|
136
126
|
var e, o;
|
|
137
127
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onOpenCustomBlockDialog) == null ? void 0 : o.call(e, n);
|
|
138
128
|
return r("onOpenCustomBlockDialog", n), t;
|
|
139
129
|
} : void 0,
|
|
140
|
-
onTemplateRename:
|
|
130
|
+
onTemplateRename: l("onTemplateRename") ? (n) => {
|
|
141
131
|
var e, o;
|
|
142
132
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTemplateRename) == null ? void 0 : o.call(e, n);
|
|
143
133
|
return r("onTemplateRename", n), t;
|
|
144
134
|
} : void 0,
|
|
145
|
-
onTemplateUpdated:
|
|
135
|
+
onTemplateUpdated: l("onTemplateUpdated") ? () => {
|
|
146
136
|
var t, e;
|
|
147
137
|
const n = (e = (t = a.callbacks) == null ? void 0 : t.onTemplateUpdated) == null ? void 0 : e.call(t);
|
|
148
138
|
return r("onTemplateUpdated"), n;
|
|
149
139
|
} : void 0,
|
|
150
|
-
onTestingEmailsChange:
|
|
140
|
+
onTestingEmailsChange: l("onTestingEmailsChange") ? (n) => {
|
|
151
141
|
var e, o;
|
|
152
142
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onTestingEmailsChange) == null ? void 0 : o.call(e, n);
|
|
153
143
|
return r("onTestingEmailsChange", n), t;
|
|
154
144
|
} : void 0,
|
|
155
|
-
|
|
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;
|
|
159
|
-
} : void 0,
|
|
160
|
-
onEditorError: i("onEditorError") ? (n) => {
|
|
145
|
+
onEditorError: l("onEditorError") ? (n) => {
|
|
161
146
|
var e, o;
|
|
162
147
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onEditorError) == null ? void 0 : o.call(e, n);
|
|
163
148
|
return r("onEditorError", n), t;
|
|
164
149
|
} : void 0,
|
|
165
|
-
onLanguageCreated:
|
|
150
|
+
onLanguageCreated: l("onLanguageCreated") ? (n) => {
|
|
166
151
|
var e, o;
|
|
167
152
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageCreated) == null ? void 0 : o.call(e, n);
|
|
168
153
|
return r("onLanguageCreated", n), t;
|
|
169
154
|
} : void 0,
|
|
170
|
-
onLanguageDeleted:
|
|
155
|
+
onLanguageDeleted: l("onLanguageDeleted") ? (n) => {
|
|
171
156
|
var e, o;
|
|
172
157
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageDeleted) == null ? void 0 : o.call(e, n);
|
|
173
158
|
return r("onLanguageDeleted", n), t;
|
|
174
159
|
} : void 0,
|
|
175
|
-
onLanguageSelected:
|
|
160
|
+
onLanguageSelected: l("onLanguageSelected") ? (n) => {
|
|
176
161
|
var e, o;
|
|
177
162
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onLanguageSelected) == null ? void 0 : o.call(e, n);
|
|
178
163
|
return r("onLanguageSelected", n), t;
|
|
179
164
|
} : void 0,
|
|
180
|
-
onPrimaryLanguageChanged:
|
|
165
|
+
onPrimaryLanguageChanged: l("onPrimaryLanguageChanged") ? (n) => {
|
|
181
166
|
var e, o;
|
|
182
167
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onPrimaryLanguageChanged) == null ? void 0 : o.call(e, n);
|
|
183
168
|
return r("onPrimaryLanguageChanged", n), t;
|
|
184
169
|
} : void 0,
|
|
185
|
-
onGetMutations:
|
|
170
|
+
onGetMutations: l("onGetMutations") ? (n) => {
|
|
186
171
|
var e, o;
|
|
187
172
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onGetMutations) == null ? void 0 : o.call(e, n);
|
|
188
173
|
return r("onGetMutations", n), t;
|
|
189
174
|
} : void 0,
|
|
190
175
|
getNonce: (d = a.callbacks) != null && d.getNonce ? () => a.callbacks.getNonce() : void 0,
|
|
191
|
-
onCloudSave:
|
|
176
|
+
onCloudSave: l("onCloudSave") ? (n) => {
|
|
192
177
|
var e, o;
|
|
193
178
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onCloudSave) == null ? void 0 : o.call(e, n);
|
|
194
179
|
return r("onCloudSave", n), t;
|
|
195
180
|
} : void 0,
|
|
196
|
-
onCloudTemplateChange:
|
|
181
|
+
onCloudTemplateChange: l("onCloudTemplateChange") ? (n) => {
|
|
197
182
|
var e, o;
|
|
198
183
|
const t = (o = (e = a.callbacks) == null ? void 0 : e.onCloudTemplateChange) == null ? void 0 : o.call(e, n);
|
|
199
184
|
return r("onCloudTemplateChange", n), t;
|
|
200
185
|
} : void 0
|
|
201
186
|
};
|
|
202
187
|
try {
|
|
203
|
-
const n = await
|
|
188
|
+
const n = await R.init({ config: a.options, ...i }, { stage: a.stage, loaderUrl: a.loaderUrl });
|
|
204
189
|
if (v) {
|
|
205
190
|
await n.destroy();
|
|
206
191
|
return;
|
|
@@ -215,11 +200,11 @@ const _ = /* @__PURE__ */ L({
|
|
|
215
200
|
} catch (n) {
|
|
216
201
|
b(n);
|
|
217
202
|
}
|
|
218
|
-
}),
|
|
203
|
+
}), T(() => {
|
|
219
204
|
v = !0;
|
|
220
|
-
const
|
|
221
|
-
u = void 0,
|
|
222
|
-
}), (
|
|
205
|
+
const i = u;
|
|
206
|
+
u = void 0, i == null || i.destroy().catch((d) => console.warn("[@topol.io/editor-vue] EmailEditor cleanup failed:", d));
|
|
207
|
+
}), (i, d) => (D(), A("div", {
|
|
223
208
|
ref_key: "container",
|
|
224
209
|
ref: m,
|
|
225
210
|
style: { width: "100%", height: "100vh" }
|
|
@@ -233,9 +218,9 @@ const _ = /* @__PURE__ */ L({
|
|
|
233
218
|
stage: { default: "production" },
|
|
234
219
|
loaderUrl: {}
|
|
235
220
|
},
|
|
236
|
-
emits: ["ready", "onSave", "onSaveAndClose", "onOpenFileManager", "onImageDelete", "onLoaded", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onUnsavedChangesChange", "
|
|
221
|
+
emits: ["ready", "onSave", "onSaveAndClose", "onOpenFileManager", "onImageDelete", "onLoaded", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onPreviewClose", "onAlert", "onEditorClose", "onUnsavedChangesChange", "onOpenCustomBlockDialog", "onTemplateRename", "onEditorError"],
|
|
237
222
|
setup(S, { expose: k, emit: p }) {
|
|
238
|
-
const a = S, r = p,
|
|
223
|
+
const a = S, r = p, E = [
|
|
239
224
|
"onSave",
|
|
240
225
|
"onSaveAndClose",
|
|
241
226
|
"onOpenFileManager",
|
|
@@ -249,11 +234,10 @@ const _ = /* @__PURE__ */ L({
|
|
|
249
234
|
"onAlert",
|
|
250
235
|
"onEditorClose",
|
|
251
236
|
"onUnsavedChangesChange",
|
|
252
|
-
"onEdittedWithoutSaveChanged",
|
|
253
237
|
"onOpenCustomBlockDialog",
|
|
254
238
|
"onTemplateRename",
|
|
255
239
|
"onEditorError"
|
|
256
|
-
], m =
|
|
240
|
+
], m = U(), u = B(null), v = w(), l = (o) => {
|
|
257
241
|
var g;
|
|
258
242
|
if (typeof ((g = a.callbacks) == null ? void 0 : g[o]) == "function") return !0;
|
|
259
243
|
const c = v == null ? void 0 : v.vnode.props;
|
|
@@ -263,15 +247,15 @@ const _ = /* @__PURE__ */ L({
|
|
|
263
247
|
}, b = () => {
|
|
264
248
|
var c;
|
|
265
249
|
const o = {};
|
|
266
|
-
for (const s of
|
|
267
|
-
|
|
268
|
-
var
|
|
269
|
-
const C = (f = (
|
|
250
|
+
for (const s of E)
|
|
251
|
+
l(s) && (o[s] = (g) => {
|
|
252
|
+
var h, f;
|
|
253
|
+
const C = (f = (h = a.callbacks) == null ? void 0 : h[s]) == null ? void 0 : f.call(h, g);
|
|
270
254
|
return g === void 0 ? r(s) : r(s, g), C;
|
|
271
255
|
});
|
|
272
256
|
return typeof ((c = a.callbacks) == null ? void 0 : c.getNonce) == "function" && (o.getNonce = () => a.callbacks.getNonce()), o;
|
|
273
257
|
};
|
|
274
|
-
let
|
|
258
|
+
let i = !1;
|
|
275
259
|
async function d(o) {
|
|
276
260
|
var c;
|
|
277
261
|
if (o)
|
|
@@ -281,11 +265,11 @@ const _ = /* @__PURE__ */ L({
|
|
|
281
265
|
console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:", s);
|
|
282
266
|
}
|
|
283
267
|
}
|
|
284
|
-
return
|
|
268
|
+
return P(async () => {
|
|
285
269
|
var o, c;
|
|
286
270
|
try {
|
|
287
|
-
const s = await
|
|
288
|
-
if (
|
|
271
|
+
const s = await y.init({ config: a.options, ...b() }, { stage: a.stage, loaderUrl: a.loaderUrl });
|
|
272
|
+
if (i) {
|
|
289
273
|
await d(s);
|
|
290
274
|
return;
|
|
291
275
|
}
|
|
@@ -295,14 +279,14 @@ const _ = /* @__PURE__ */ L({
|
|
|
295
279
|
} catch (g) {
|
|
296
280
|
throw u.value === s && (u.value = null), await d(s), g;
|
|
297
281
|
}
|
|
298
|
-
|
|
282
|
+
i || r("ready", s);
|
|
299
283
|
} catch (s) {
|
|
300
|
-
if (
|
|
284
|
+
if (i) return;
|
|
301
285
|
const C = { source: "integration", message: s instanceof Error ? s.message : "Failed to initialize editor", detail: s };
|
|
302
286
|
(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);
|
|
303
287
|
}
|
|
304
|
-
}),
|
|
305
|
-
|
|
288
|
+
}), T(() => {
|
|
289
|
+
i = !0;
|
|
306
290
|
const o = u.value;
|
|
307
291
|
u.value = null, d(o);
|
|
308
292
|
}), k({
|
|
@@ -315,7 +299,7 @@ const _ = /* @__PURE__ */ L({
|
|
|
315
299
|
await ((o = u.value) == null ? void 0 : o.save());
|
|
316
300
|
},
|
|
317
301
|
getEditor: () => u.value ?? null
|
|
318
|
-
}), (o, c) => (
|
|
302
|
+
}), (o, c) => (D(), A("div", {
|
|
319
303
|
ref_key: "container",
|
|
320
304
|
ref: m,
|
|
321
305
|
style: { width: "100%", height: "100vh" }
|
|
@@ -323,8 +307,8 @@ const _ = /* @__PURE__ */ L({
|
|
|
323
307
|
}
|
|
324
308
|
});
|
|
325
309
|
export {
|
|
326
|
-
|
|
327
|
-
|
|
310
|
+
N as CoreEmailEditor,
|
|
311
|
+
x as CoreLandingPageEditor,
|
|
328
312
|
_ as EmailEditor,
|
|
329
313
|
M as LandingPageEditor
|
|
330
314
|
};
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(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,d){"use strict";const T=d.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","onHiddenElementsVisibilityChange","onOpenCustomBlockDialog","onTemplateRename","onTemplateUpdated","onTestingEmailsChange","onEditorError","onLanguageCreated","onLanguageDeleted","onLanguageSelected","onPrimaryLanguageChanged","onGetMutations","onCloudSave","onCloudTemplateChange"],setup(k,{expose:b,emit:L}){const a=k,r=L,p=d.getCurrentInstance(),S=d.ref();let g,E=!1;b({getEditor:()=>g??null});const i=s=>{var n,t,e;const u=`on${s[0].toUpperCase()}${s.slice(1)}`;return!!((n=a.callbacks)!=null&&n[s])||!!((t=p.vnode.props)!=null&&t[u])||!!((e=p.vnode.props)!=null&&e[`${u}Once`])},w=s=>{var n,t;if(E)return;const u={source:"integration",message:s instanceof Error?s.message:String(s),detail:s};i("onEditorError")||console.error("[@topol.io/editor-vue] EmailEditor failed:",s),(t=(n=a.callbacks)==null?void 0:n.onEditorError)==null||t.call(n,u),r("onEditorError",u)};return d.onMounted(async()=>{var u;const s={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,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,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,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,...s},{stage:a.stage,loaderUrl:a.loaderUrl});if(E){await n.destroy();return}g=n;try{await n.render(S.value)}catch(t){throw await n.destroy(),g=void 0,t}E||r("ready",n)}catch(n){w(n)}}),d.onBeforeUnmount(()=>{E=!0;const s=g;g=void 0,s==null||s.destroy().catch(u=>console.warn("[@topol.io/editor-vue] EmailEditor cleanup failed:",u))}),(s,u)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"container",ref:S,style:{width:"100%",height:"100vh"}},null,512))}}),U=d.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","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],setup(k,{expose:b,emit:L}){const a=k,r=L,p=["onSave","onSaveAndClose","onOpenFileManager","onImageDelete","onLoaded","onInit","onUndoChange","onRedoChange","onPreview","onPreviewClose","onAlert","onEditorClose","onUnsavedChangesChange","onOpenCustomBlockDialog","onTemplateRename","onEditorError"],S=d.ref(),g=d.shallowRef(null),E=d.getCurrentInstance(),i=o=>{var C;if(typeof((C=a.callbacks)==null?void 0:C[o])=="function")return!0;const c=E==null?void 0:E.vnode.props;if(!c)return!1;const l="on"+o.charAt(0).toUpperCase()+o.slice(1);return[l,l+"Once"].some(h=>typeof c[h]=="function"||Array.isArray(c[h]))},w=()=>{var c;const o={};for(const l of p)i(l)&&(o[l]=C=>{var f,P;const h=(P=(f=a.callbacks)==null?void 0:f[l])==null?void 0:P.call(f,C);return C===void 0?r(l):r(l,C),h});return typeof((c=a.callbacks)==null?void 0:c.getNonce)=="function"&&(o.getNonce=()=>a.callbacks.getNonce()),o};let s=!1;async function u(o){var c;if(o)try{await((c=o.destroy)==null?void 0:c.call(o))}catch(l){console.warn("[@topol.io/editor-vue] LandingPageEditor destroy failed:",l)}}return d.onMounted(async()=>{var o,c;try{const l=await m.LandingPageEditor.init({config:a.options,...w()},{stage:a.stage,loaderUrl:a.loaderUrl});if(s){await u(l);return}g.value=l;try{await l.render(S.value)}catch(C){throw g.value===l&&(g.value=null),await u(l),C}s||r("ready",l)}catch(l){if(s)return;const h={source:"integration",message:l instanceof Error?l.message:"Failed to initialize editor",detail:l};(c=(o=a.callbacks)==null?void 0:o.onEditorError)==null||c.call(o,h),r("onEditorError",h),console.error("[@topol.io/editor-vue] LandingPageEditor initialization failed:",l)}}),d.onBeforeUnmount(()=>{s=!0;const o=g.value;g.value=null,u(o)}),b({load:async o=>{var c;await((c=g.value)==null?void 0:c.load(o))},save:async()=>{var o;await((o=g.value)==null?void 0:o.save())},getEditor:()=>g.value??null}),(o,c)=>(d.openBlock(),d.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=T,v.LandingPageEditor=U,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -48,15 +48,9 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
48
48
|
onUnsavedChangesChange: (payload: {
|
|
49
49
|
hasUnsavedChanges: boolean;
|
|
50
50
|
}) => any;
|
|
51
|
-
onEdittedWithoutSaveChanged: (payload: {
|
|
52
|
-
value: boolean;
|
|
53
|
-
}) => any;
|
|
54
51
|
onHiddenElementsVisibilityChange: (payload: {
|
|
55
52
|
visible: boolean;
|
|
56
53
|
}) => any;
|
|
57
|
-
onBlocksAndStructuresVisibilityChange: (payload: {
|
|
58
|
-
value: boolean;
|
|
59
|
-
}) => any;
|
|
60
54
|
onOpenCustomBlockDialog: (payload: {
|
|
61
55
|
block: unknown;
|
|
62
56
|
}) => any;
|
|
@@ -67,9 +61,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
67
61
|
onTestingEmailsChange: (payload: {
|
|
68
62
|
emails: string[];
|
|
69
63
|
}) => any;
|
|
70
|
-
updateTestingEmailAddresses: (payload: {
|
|
71
|
-
emails: string[];
|
|
72
|
-
}) => any;
|
|
73
64
|
onEditorError: (payload: IEmailErrorPayload) => any;
|
|
74
65
|
onLanguageCreated: (payload: import("@topol.io/editor").ILanguageChangePayload) => any;
|
|
75
66
|
onLanguageDeleted: (payload: import("@topol.io/editor").ILanguageChangePayload) => any;
|
|
@@ -123,15 +114,9 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
123
114
|
onOnUnsavedChangesChange?: ((payload: {
|
|
124
115
|
hasUnsavedChanges: boolean;
|
|
125
116
|
}) => any) | undefined;
|
|
126
|
-
onOnEdittedWithoutSaveChanged?: ((payload: {
|
|
127
|
-
value: boolean;
|
|
128
|
-
}) => any) | undefined;
|
|
129
117
|
onOnHiddenElementsVisibilityChange?: ((payload: {
|
|
130
118
|
visible: boolean;
|
|
131
119
|
}) => any) | undefined;
|
|
132
|
-
onOnBlocksAndStructuresVisibilityChange?: ((payload: {
|
|
133
|
-
value: boolean;
|
|
134
|
-
}) => any) | undefined;
|
|
135
120
|
onOnOpenCustomBlockDialog?: ((payload: {
|
|
136
121
|
block: unknown;
|
|
137
122
|
}) => any) | undefined;
|
|
@@ -142,9 +127,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
|
142
127
|
onOnTestingEmailsChange?: ((payload: {
|
|
143
128
|
emails: string[];
|
|
144
129
|
}) => any) | undefined;
|
|
145
|
-
onUpdateTestingEmailAddresses?: ((payload: {
|
|
146
|
-
emails: string[];
|
|
147
|
-
}) => any) | undefined;
|
|
148
130
|
onOnEditorError?: ((payload: IEmailErrorPayload) => any) | undefined;
|
|
149
131
|
onOnLanguageCreated?: ((payload: import("@topol.io/editor").ILanguageChangePayload) => any) | undefined;
|
|
150
132
|
onOnLanguageDeleted?: ((payload: import("@topol.io/editor").ILanguageChangePayload) => any) | undefined;
|
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.12",
|
|
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.12"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"vue": "^3.2.25"
|