@topol.io/editor 1.0.0-alpha.3 → 1.0.0-alpha.5

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,38 +1,38 @@
1
- function s(e) {
2
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1
+ function g(o) {
2
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
3
3
  }
4
- var w = function(n, o, i) {
5
- var l = document.head || document.getElementsByTagName("head")[0], t = document.createElement("script");
6
- typeof o == "function" && (i = o, o = {}), o = o || {}, i = i || function() {
7
- }, t.type = o.type || "text/javascript", t.charset = o.charset || "utf8", t.async = "async" in o ? !!o.async : !0, t.src = n, o.attrs && c(t, o.attrs), o.text && (t.text = "" + o.text);
8
- var r = "onload" in t ? g : p;
9
- r(t, i), t.onload || g(t, i), l.appendChild(t);
4
+ var c = function(t, e, i) {
5
+ var l = document.head || document.getElementsByTagName("head")[0], n = document.createElement("script");
6
+ typeof e == "function" && (i = e, e = {}), e = e || {}, i = i || function() {
7
+ }, n.type = e.type || "text/javascript", n.charset = e.charset || "utf8", n.async = "async" in e ? !!e.async : !0, n.src = t, e.attrs && w(n, e.attrs), e.text && (n.text = "" + e.text);
8
+ var r = "onload" in n ? s : p;
9
+ r(n, i), n.onload || s(n, i), l.appendChild(n);
10
10
  };
11
- function c(e, n) {
12
- for (var o in n)
13
- e.setAttribute(o, n[o]);
11
+ function w(o, t) {
12
+ for (var e in t)
13
+ o.setAttribute(e, t[e]);
14
14
  }
15
- function g(e, n) {
16
- e.onload = function() {
17
- this.onerror = this.onload = null, n(null, e);
18
- }, e.onerror = function() {
19
- this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), e);
15
+ function s(o, t) {
16
+ o.onload = function() {
17
+ this.onerror = this.onload = null, t(null, o);
18
+ }, o.onerror = function() {
19
+ this.onerror = this.onload = null, t(new Error("Failed to load " + this.src), o);
20
20
  };
21
21
  }
22
- function p(e, n) {
23
- e.onreadystatechange = function() {
24
- this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, e));
22
+ function p(o, t) {
23
+ o.onreadystatechange = function() {
24
+ this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, t(null, o));
25
25
  };
26
26
  }
27
- const d = /* @__PURE__ */ s(w);
28
- var u = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
29
- const a = {
30
- production: u.VITE_TOPOL_URL,
31
- dev: u.VITE_TOPOL_DEV_URL,
32
- staging: u.VITE_TOPOL_STAGING_URL
33
- }, P = "https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";
34
- function T(e = "production") {
35
- switch (e) {
27
+ const u = /* @__PURE__ */ g(c);
28
+ var d = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
29
+ const T = "https://v3.email-assets.topol.io/loader/build.js", P = "https://v3.develop.email-assets.topol.io/loader/build.js", f = "https://v3.develop.email-assets.topol.io/loader/build.js", a = {
30
+ production: d.VITE_TOPOL_URL || T,
31
+ dev: d.VITE_TOPOL_DEV_URL || P,
32
+ staging: d.VITE_TOPOL_STAGING_URL || f
33
+ }, m = "https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";
34
+ function h(o) {
35
+ switch (o) {
36
36
  case "dev":
37
37
  return a.dev;
38
38
  case "staging":
@@ -40,50 +40,59 @@ function T(e = "production") {
40
40
  case "production":
41
41
  return a.production;
42
42
  default:
43
- return P.replace("{stage}", String(e));
43
+ return m.replace("{stage}", String(o));
44
44
  }
45
45
  }
46
- async function m(e) {
47
- return new Promise((n, o) => {
48
- d(a.production, (i) => {
46
+ function E(o = "production") {
47
+ const t = h(o);
48
+ if (!t) {
49
+ if (a.production)
50
+ return console.error(`[@topol.io/editor] No loader URL resolved for stage "${o}"; falling back to the production loader.`), a.production;
51
+ throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${o}". The editor cannot be loaded.`);
52
+ }
53
+ return t;
54
+ }
55
+ async function v(o) {
56
+ return new Promise((t, e) => {
57
+ u(a.production, (i) => {
49
58
  if (i !== null) {
50
- o(i);
59
+ e(i);
51
60
  return;
52
61
  }
53
- window.TopolPlugin.init(e), n(!0);
62
+ window.TopolPlugin.init(o), t(!0);
54
63
  });
55
64
  });
56
65
  }
57
- const f = {
66
+ const L = {
58
67
  /**
59
68
  * Initialize the Email Editor.
60
69
  * @param topolOptions - Configuration options for the editor
61
70
  * @param options - Plugin options including stage selection
62
71
  * @returns Promise that resolves to true when the editor is ready
63
72
  */
64
- init: (e, n) => new Promise((o, i) => {
65
- const l = T(n == null ? void 0 : n.stage);
66
- d(l, async (t) => {
67
- if (t !== null) {
73
+ init: (o, t) => new Promise((e, i) => {
74
+ const l = E(t == null ? void 0 : t.stage);
75
+ u(l, async (n) => {
76
+ if (n !== null) {
68
77
  if (l !== a.production)
69
78
  try {
70
- return await m(e), o(!0);
79
+ return await v(o), e(!0);
71
80
  } catch (r) {
72
81
  i(r);
73
82
  }
74
- i(t);
83
+ i(n);
75
84
  return;
76
85
  }
77
- window.TopolPlugin.init(e), o(!0);
86
+ window.TopolPlugin.init(o), e(!0);
78
87
  });
79
88
  }),
80
89
  /** Trigger the save callback with current editor content */
81
- save: (e) => {
82
- window.TopolPlugin.save(e);
90
+ save: (o) => {
91
+ window.TopolPlugin.save(o);
83
92
  },
84
93
  /** Load a template JSON into the editor */
85
- load: (e) => {
86
- window.TopolPlugin.load(e);
94
+ load: (o) => {
95
+ window.TopolPlugin.load(o);
87
96
  },
88
97
  /** Toggle the preview mode */
89
98
  togglePreview: () => {
@@ -94,8 +103,8 @@ const f = {
94
103
  window.TopolPlugin.togglePreviewSize();
95
104
  },
96
105
  /** Select a file from the custom file manager */
97
- chooseFile: (e) => {
98
- window.TopolPlugin.chooseFile(e);
106
+ chooseFile: (o) => {
107
+ window.TopolPlugin.chooseFile(o);
99
108
  },
100
109
  /** Undo the last action */
101
110
  undo: () => {
@@ -110,20 +119,20 @@ const f = {
110
119
  window.TopolPlugin.destroy();
111
120
  },
112
121
  /** Update the list of saved/reusable blocks */
113
- setSavedBlocks: (e) => {
114
- window.TopolPlugin.setSavedBlocks(e);
122
+ setSavedBlocks: (o) => {
123
+ window.TopolPlugin.setSavedBlocks(o);
115
124
  },
116
125
  /** Set custom HTML for the preview */
117
- setPreviewHTML: (e) => {
118
- window.TopolPlugin.setPreviewHTML(e);
126
+ setPreviewHTML: (o) => {
127
+ window.TopolPlugin.setPreviewHTML(o);
119
128
  },
120
129
  /** Display a notification in the editor */
121
- createNotification: (e) => {
122
- window.TopolPlugin.createNotification(e);
130
+ createNotification: (o) => {
131
+ window.TopolPlugin.createNotification(o);
123
132
  },
124
133
  /** Set the list of active collaboration members */
125
- setActiveMembers: (e) => {
126
- window.TopolPlugin.setActiveMembers(e);
134
+ setActiveMembers: (o) => {
135
+ window.TopolPlugin.setActiveMembers(o);
127
136
  },
128
137
  /** Switch to mobile view */
129
138
  changeEmailToMobile: () => {
@@ -138,12 +147,12 @@ const f = {
138
147
  window.TopolPlugin.toggleBlocksAndStructuresVisibility();
139
148
  },
140
149
  /** Update the content of a custom block */
141
- updateCustomBlockContent: (e) => {
142
- window.TopolPlugin.updateCustomBlockContent(e);
150
+ updateCustomBlockContent: (o) => {
151
+ window.TopolPlugin.updateCustomBlockContent(o);
143
152
  },
144
153
  /** Refresh comments/conversations */
145
- refreshComments: (e) => {
146
- window.TopolPlugin.refreshComments(e);
154
+ refreshComments: (o) => {
155
+ window.TopolPlugin.refreshComments(o);
147
156
  },
148
157
  /** Refresh synced rows */
149
158
  refreshSyncedRows: () => {
@@ -154,15 +163,15 @@ const f = {
154
163
  window.TopolPlugin.openPremadeTemplatesSelection();
155
164
  },
156
165
  /** Update the API authorization header */
157
- updateApiAuthorizationHeader: (e) => {
158
- window.TopolPlugin.updateApiAuthorizationHeader(e);
166
+ updateApiAuthorizationHeader: (o) => {
167
+ window.TopolPlugin.updateApiAuthorizationHeader(o);
159
168
  },
160
169
  /** Set the template name/title */
161
- setTemplateName: (e) => {
162
- window.TopolPlugin.setTemplateName(e);
170
+ setTemplateName: (o) => {
171
+ window.TopolPlugin.setTemplateName(o);
163
172
  },
164
- updateOptions: (e) => {
165
- window.TopolPlugin.updateOptions(e);
173
+ updateOptions: (o) => {
174
+ window.TopolPlugin.updateOptions(o);
166
175
  },
167
176
  /** Toggle the AI chat feature */
168
177
  toggleChatAI: () => {
@@ -177,20 +186,20 @@ const f = {
177
186
  window.TopolPlugin.toggleComments();
178
187
  },
179
188
  /** Create a new language variant */
180
- createLanguage: (e) => {
181
- window.TopolPlugin.createLanguage(e);
189
+ createLanguage: (o) => {
190
+ window.TopolPlugin.createLanguage(o);
182
191
  },
183
192
  /** Set the primary language */
184
- setPrimaryLanguage: (e) => {
185
- window.TopolPlugin.setPrimaryLanguage(e);
193
+ setPrimaryLanguage: (o) => {
194
+ window.TopolPlugin.setPrimaryLanguage(o);
186
195
  },
187
196
  /** Delete a language variant */
188
- deleteLanguage: (e) => {
189
- window.TopolPlugin.deleteLanguage(e);
197
+ deleteLanguage: (o) => {
198
+ window.TopolPlugin.deleteLanguage(o);
190
199
  },
191
200
  /** Select/switch to a language */
192
- selectLanguage: (e) => {
193
- window.TopolPlugin.selectLanguage(e);
201
+ selectLanguage: (o) => {
202
+ window.TopolPlugin.selectLanguage(o);
194
203
  },
195
204
  /** Get the list of mutations */
196
205
  getMutations: () => window.TopolPlugin.getMutations(),
@@ -199,14 +208,14 @@ const f = {
199
208
  window.TopolPlugin.toggleControlPanel();
200
209
  },
201
210
  /** Update the editor template with new JSON data */
202
- updateTemplate: (e, n) => {
203
- window.TopolPlugin.updateTemplate(e, n);
211
+ updateTemplate: (o, t) => {
212
+ window.TopolPlugin.updateTemplate(o, t);
204
213
  },
205
214
  /** Toggle dark mode for the editor */
206
215
  toggleDarkMode: () => {
207
216
  window.TopolPlugin.toggleDarkMode();
208
217
  }
209
- }, h = "https://v1.page-assets.topol.io/topol-lpe.js", E = {
218
+ }, _ = "https://v1.page-assets.topol.io/topol-lpe.js", A = {
210
219
  /**
211
220
  * Inits Landing Page Editor.
212
221
  *
@@ -214,20 +223,20 @@ const f = {
214
223
  * @param pluginOptions - Plugin options (reserved for future staging/dev URL support)
215
224
  * @returns Promise that resolves with the editor instance
216
225
  */
217
- init: (e, n) => new Promise((o, i) => {
218
- d(h, (l) => {
226
+ init: (o, t) => new Promise((e, i) => {
227
+ u(_, (l) => {
219
228
  if (l !== null) {
220
229
  i(l);
221
230
  return;
222
231
  }
223
- const t = window.LandingPageEditor(e);
224
- o(t);
232
+ const n = window.LandingPageEditor(o);
233
+ e(n);
225
234
  });
226
235
  })
227
- }, v = f;
236
+ }, y = L;
228
237
  export {
229
- f as EmailEditor,
230
- E as LandingPageEditor,
231
- v as TopolPlugin,
232
- v as default
238
+ L as EmailEditor,
239
+ A as LandingPageEditor,
240
+ y as TopolPlugin,
241
+ y as default
233
242
  };
@@ -1 +1 @@
1
- (function(l,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(l=typeof globalThis<"u"?globalThis:l||self,u(l["topol-plugin"]={}))})(this,function(l){"use strict";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T=function(n,o,i){var a=document.head||document.getElementsByTagName("head")[0],t=document.createElement("script");typeof o=="function"&&(i=o,o={}),o=o||{},i=i||function(){},t.type=o.type||"text/javascript",t.charset=o.charset||"utf8",t.async="async"in o?!!o.async:!0,t.src=n,o.attrs&&P(t,o.attrs),o.text&&(t.text=""+o.text);var s="onload"in t?w:f;s(t,i),t.onload||w(t,i),a.appendChild(t)};function P(e,n){for(var o in n)e.setAttribute(o,n[o])}function w(e,n){e.onload=function(){this.onerror=this.onload=null,n(null,e)},e.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+this.src),e)}}function f(e,n){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,e))}}const r=u(T);var g={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const d={production:g.VITE_TOPOL_URL,dev:g.VITE_TOPOL_DEV_URL,staging:g.VITE_TOPOL_STAGING_URL},m="https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";function h(e="production"){switch(e){case"dev":return d.dev;case"staging":return d.staging;case"production":return d.production;default:return m.replace("{stage}",String(e))}}async function E(e){return new Promise((n,o)=>{r(d.production,i=>{if(i!==null){o(i);return}window.TopolPlugin.init(e),n(!0)})})}const c={init:(e,n)=>new Promise((o,i)=>{const a=h(n==null?void 0:n.stage);r(a,async t=>{if(t!==null){if(a!==d.production)try{return await E(e),o(!0)}catch(s){i(s)}i(t);return}window.TopolPlugin.init(e),o(!0)})}),save:e=>{window.TopolPlugin.save(e)},load:e=>{window.TopolPlugin.load(e)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:e=>{window.TopolPlugin.chooseFile(e)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:e=>{window.TopolPlugin.setSavedBlocks(e)},setPreviewHTML:e=>{window.TopolPlugin.setPreviewHTML(e)},createNotification:e=>{window.TopolPlugin.createNotification(e)},setActiveMembers:e=>{window.TopolPlugin.setActiveMembers(e)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:e=>{window.TopolPlugin.updateCustomBlockContent(e)},refreshComments:e=>{window.TopolPlugin.refreshComments(e)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:e=>{window.TopolPlugin.updateApiAuthorizationHeader(e)},setTemplateName:e=>{window.TopolPlugin.setTemplateName(e)},updateOptions:e=>{window.TopolPlugin.updateOptions(e)},toggleChatAI:()=>{window.TopolPlugin.toggleChatAI()},toggleAutosaves:()=>{window.TopolPlugin.toggleAutosaves()},toggleComments:()=>{window.TopolPlugin.toggleComments()},createLanguage:e=>{window.TopolPlugin.createLanguage(e)},setPrimaryLanguage:e=>{window.TopolPlugin.setPrimaryLanguage(e)},deleteLanguage:e=>{window.TopolPlugin.deleteLanguage(e)},selectLanguage:e=>{window.TopolPlugin.selectLanguage(e)},getMutations:()=>window.TopolPlugin.getMutations(),toggleControlPanel:()=>{window.TopolPlugin.toggleControlPanel()},updateTemplate:(e,n)=>{window.TopolPlugin.updateTemplate(e,n)},toggleDarkMode:()=>{window.TopolPlugin.toggleDarkMode()}},v="https://v1.page-assets.topol.io/topol-lpe.js",y={init:(e,n)=>new Promise((o,i)=>{r(v,a=>{if(a!==null){i(a);return}const t=window.LandingPageEditor(e);o(t)})})},p=c;l.EmailEditor=c,l.LandingPageEditor=y,l.TopolPlugin=p,l.default=p,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(l,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(l=typeof globalThis<"u"?globalThis:l||self,d(l["topol-plugin"]={}))})(this,function(l){"use strict";function d(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var T=function(t,e,i){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("script");typeof e=="function"&&(i=e,e={}),e=e||{},i=i||function(){},n.type=e.type||"text/javascript",n.charset=e.charset||"utf8",n.async="async"in e?!!e.async:!0,n.src=t,e.attrs&&P(n,e.attrs),e.text&&(n.text=""+e.text);var g="onload"in n?c:f;g(n,i),n.onload||c(n,i),r.appendChild(n)};function P(o,t){for(var e in t)o.setAttribute(e,t[e])}function c(o,t){o.onload=function(){this.onerror=this.onload=null,t(null,o)},o.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),o)}}function f(o,t){o.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,o))}}const u=d(T);var s={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const a={production:s.VITE_TOPOL_URL||"https://v3.email-assets.topol.io/loader/build.js",dev:s.VITE_TOPOL_DEV_URL||"https://v3.develop.email-assets.topol.io/loader/build.js",staging:s.VITE_TOPOL_STAGING_URL||"https://v3.develop.email-assets.topol.io/loader/build.js"},m="https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";function E(o){switch(o){case"dev":return a.dev;case"staging":return a.staging;case"production":return a.production;default:return m.replace("{stage}",String(o))}}function h(o="production"){const t=E(o);if(!t){if(a.production)return console.error(`[@topol.io/editor] No loader URL resolved for stage "${o}"; falling back to the production loader.`),a.production;throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${o}". The editor cannot be loaded.`)}return t}async function L(o){return new Promise((t,e)=>{u(a.production,i=>{if(i!==null){e(i);return}window.TopolPlugin.init(o),t(!0)})})}const p={init:(o,t)=>new Promise((e,i)=>{const r=h(t==null?void 0:t.stage);u(r,async n=>{if(n!==null){if(r!==a.production)try{return await L(o),e(!0)}catch(g){i(g)}i(n);return}window.TopolPlugin.init(o),e(!0)})}),save:o=>{window.TopolPlugin.save(o)},load:o=>{window.TopolPlugin.load(o)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:o=>{window.TopolPlugin.chooseFile(o)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:o=>{window.TopolPlugin.setSavedBlocks(o)},setPreviewHTML:o=>{window.TopolPlugin.setPreviewHTML(o)},createNotification:o=>{window.TopolPlugin.createNotification(o)},setActiveMembers:o=>{window.TopolPlugin.setActiveMembers(o)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:o=>{window.TopolPlugin.updateCustomBlockContent(o)},refreshComments:o=>{window.TopolPlugin.refreshComments(o)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:o=>{window.TopolPlugin.updateApiAuthorizationHeader(o)},setTemplateName:o=>{window.TopolPlugin.setTemplateName(o)},updateOptions:o=>{window.TopolPlugin.updateOptions(o)},toggleChatAI:()=>{window.TopolPlugin.toggleChatAI()},toggleAutosaves:()=>{window.TopolPlugin.toggleAutosaves()},toggleComments:()=>{window.TopolPlugin.toggleComments()},createLanguage:o=>{window.TopolPlugin.createLanguage(o)},setPrimaryLanguage:o=>{window.TopolPlugin.setPrimaryLanguage(o)},deleteLanguage:o=>{window.TopolPlugin.deleteLanguage(o)},selectLanguage:o=>{window.TopolPlugin.selectLanguage(o)},getMutations:()=>window.TopolPlugin.getMutations(),toggleControlPanel:()=>{window.TopolPlugin.toggleControlPanel()},updateTemplate:(o,t)=>{window.TopolPlugin.updateTemplate(o,t)},toggleDarkMode:()=>{window.TopolPlugin.toggleDarkMode()}},_="https://v1.page-assets.topol.io/topol-lpe.js",v={init:(o,t)=>new Promise((e,i)=>{u(_,r=>{if(r!==null){i(r);return}const n=window.LandingPageEditor(o);e(n)})})},w=p;l.EmailEditor=p,l.LandingPageEditor=v,l.TopolPlugin=w,l.default=w,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -17,11 +17,12 @@ export interface ISaveData {
17
17
  }
18
18
  /**
19
19
  * Payload for onError callback.
20
- * Used when transforming (type, message) arguments into a single object.
20
+ * Used when transforming (type, message, responseBody) arguments into a single object.
21
21
  */
22
22
  export interface IErrorData {
23
23
  type: string;
24
24
  message: string;
25
+ responseBody?: unknown;
25
26
  }
26
27
  /**
27
28
  * Payload for onTestSend callback (Email Editor only).
@@ -114,8 +114,9 @@ export default interface IEmailCallbacks {
114
114
  * Called when an error occurs.
115
115
  * @param type - The error type
116
116
  * @param message - The error message
117
+ * @param responseBody - The response body (optional)
117
118
  */
118
- onError?(type: string, message: string): void;
119
+ onError?(type: string, message: string, responseBody?: unknown): void;
119
120
  /**
120
121
  * Called when a new language variant is created.
121
122
  * @param lang - The language code that was created
@@ -97,8 +97,9 @@ export interface ILandingPageCallbacks {
97
97
  * Called when an error occurs.
98
98
  * @param type - The error type
99
99
  * @param message - The error message
100
+ * @param responseBody - The response body (optional)
100
101
  */
101
- onError?(type: string, message: string): void;
102
+ onError?(type: string, message: string, responseBody?: unknown): void;
102
103
  }
103
104
  /**
104
105
  * Configuration options for the Landing Page Editor.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "author": "Topol.io",
13
13
  "homepage": "https://topol.io",
14
14
  "license": "Apache-2.0",
15
- "version": "1.0.0-alpha.3",
15
+ "version": "1.0.0-alpha.5",
16
16
  "files": [
17
17
  "dist"
18
18
  ],