@topol.io/editor 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,45 @@
1
- function c(e) {
1
+ function s(e) {
2
2
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3
3
  }
4
- var s = function(n, o, i) {
4
+ var g = function(n, o, i) {
5
5
  var l = document.head || document.getElementsByTagName("head")[0], t = document.createElement("script");
6
6
  typeof o == "function" && (i = o, o = {}), o = o || {}, i = i || function() {
7
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 && w(t, o.attrs), o.text && (t.text = "" + o.text);
8
- var r = "onload" in t ? d : g;
9
- r(t, i), t.onload || d(t, i), l.appendChild(t);
8
+ var a = "onload" in t ? u : c;
9
+ a(t, i), t.onload || u(t, i), l.appendChild(t);
10
10
  };
11
11
  function w(e, n) {
12
12
  for (var o in n)
13
13
  e.setAttribute(o, n[o]);
14
14
  }
15
- function d(e, n) {
15
+ function u(e, n) {
16
16
  e.onload = function() {
17
17
  this.onerror = this.onload = null, n(null, e);
18
18
  }, e.onerror = function() {
19
19
  this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), e);
20
20
  };
21
21
  }
22
- function g(e, n) {
22
+ function c(e, n) {
23
23
  e.onreadystatechange = function() {
24
24
  this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, e));
25
25
  };
26
26
  }
27
- const u = /* @__PURE__ */ c(s), a = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", p = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js", f = "https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";
27
+ const d = /* @__PURE__ */ s(g), r = "https://v3.email-assets.topol.io/loader/build.js", p = "https://v3.develop.email-assets.topol.io/loader/build.js", P = "https://v3.develop.email-assets.topol.io/loader/build.js";
28
28
  function T(e = "production") {
29
29
  switch (e) {
30
30
  case "dev":
31
31
  return p;
32
32
  case "staging":
33
- return f;
33
+ return P;
34
34
  case "production":
35
- return a;
35
+ return r;
36
36
  default:
37
37
  return `https://d10h8ga60f7b91.cloudfront.net/preview-app-${e}/loader/build.js`;
38
38
  }
39
39
  }
40
- async function P(e) {
40
+ async function m(e) {
41
41
  return new Promise((n, o) => {
42
- u(a, (i) => {
42
+ d(r, (i) => {
43
43
  i !== null && o(i), window.TopolPlugin.init(e), n(!0);
44
44
  });
45
45
  });
@@ -47,13 +47,13 @@ async function P(e) {
47
47
  const h = {
48
48
  init: (e, n) => new Promise((o, i) => {
49
49
  const l = T(n == null ? void 0 : n.stage);
50
- u(l, async (t) => {
50
+ d(l, async (t) => {
51
51
  if (t !== null) {
52
- if (l !== a)
52
+ if (l !== r)
53
53
  try {
54
- return await P(e), o(!0);
55
- } catch (r) {
56
- i(r);
54
+ return await m(e), o(!0);
55
+ } catch (a) {
56
+ i(a);
57
57
  }
58
58
  i(t);
59
59
  }
@@ -122,6 +122,27 @@ const h = {
122
122
  },
123
123
  setTemplateName: (e) => {
124
124
  window.TopolPlugin.setTemplateName(e);
125
+ },
126
+ toggleChatAI: () => {
127
+ window.TopolPlugin.toggleChatAI();
128
+ },
129
+ toggleAutosaves: () => {
130
+ window.TopolPlugin.toggleAutosaves();
131
+ },
132
+ toggleComments: () => {
133
+ window.TopolPlugin.toggleComments();
134
+ },
135
+ createLanguage: (e) => {
136
+ window.TopolPlugin.createLanguage(e);
137
+ },
138
+ setPrimaryLanguage: (e) => {
139
+ window.TopolPlugin.setPrimaryLanguage(e);
140
+ },
141
+ deleteLanguage: (e) => {
142
+ window.TopolPlugin.deleteLanguage(e);
143
+ },
144
+ selectLanguage: (e) => {
145
+ window.TopolPlugin.selectLanguage(e);
125
146
  }
126
147
  };
127
148
  export {
@@ -1 +1 @@
1
- (function(l,d){typeof exports=="object"&&typeof module<"u"?module.exports=d():typeof define=="function"&&define.amd?define(d):(l=typeof globalThis<"u"?globalThis:l||self,l["topol-plugin"]=d())})(this,function(){"use strict";function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d=function(n,o,i){var r=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&&w(t,o.attrs),o.text&&(t.text=""+o.text);var a="onload"in t?s:g;a(t,i),t.onload||s(t,i),r.appendChild(t)};function w(e,n){for(var o in n)e.setAttribute(o,n[o])}function s(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 g(e,n){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,e))}}const c=l(d),u="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",p="https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",f="https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";function T(e="production"){switch(e){case"dev":return p;case"staging":return f;case"production":return u;default:return`https://d10h8ga60f7b91.cloudfront.net/preview-app-${e}/loader/build.js`}}async function h(e){return new Promise((n,o)=>{c(u,i=>{i!==null&&o(i),window.TopolPlugin.init(e),n(!0)})})}return{init:(e,n)=>new Promise((o,i)=>{const r=T(n==null?void 0:n.stage);c(r,async t=>{if(t!==null){if(r!==u)try{return await h(e),o(!0)}catch(a){i(a)}i(t)}window.TopolPlugin.init(e),o(!0)})}),save:()=>{window.TopolPlugin.save()},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)}}});
1
+ (function(l,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(l=typeof globalThis<"u"?globalThis:l||self,l["topol-plugin"]=a())})(this,function(){"use strict";function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a=function(n,o,i){var u=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&&w(t,o.attrs),o.text&&(t.text=""+o.text);var r="onload"in t?s:c;r(t,i),t.onload||s(t,i),u.appendChild(t)};function w(e,n){for(var o in n)e.setAttribute(o,n[o])}function s(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 c(e,n){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,e))}}const g=l(a),d="https://v3.email-assets.topol.io/loader/build.js",p="https://v3.develop.email-assets.topol.io/loader/build.js",T="https://v3.develop.email-assets.topol.io/loader/build.js";function P(e="production"){switch(e){case"dev":return p;case"staging":return T;case"production":return d;default:return`https://d10h8ga60f7b91.cloudfront.net/preview-app-${e}/loader/build.js`}}async function f(e){return new Promise((n,o)=>{g(d,i=>{i!==null&&o(i),window.TopolPlugin.init(e),n(!0)})})}return{init:(e,n)=>new Promise((o,i)=>{const u=P(n==null?void 0:n.stage);g(u,async t=>{if(t!==null){if(u!==d)try{return await f(e),o(!0)}catch(r){i(r)}i(t)}window.TopolPlugin.init(e),o(!0)})}),save:()=>{window.TopolPlugin.save()},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)},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)}}});
@@ -42,6 +42,13 @@ declare const TopolPlugin: {
42
42
  openPremadeTemplatesSelection: () => void;
43
43
  updateApiAuthorizationHeader: (newHeader: string | Record<string, string>) => void;
44
44
  setTemplateName: (name: string) => void;
45
+ toggleChatAI: () => void;
46
+ toggleAutosaves: () => void;
47
+ toggleComments: () => void;
48
+ createLanguage: (lang: string) => void;
49
+ setPrimaryLanguage: (lang: string) => void;
50
+ deleteLanguage: (lang: string) => void;
51
+ selectLanguage: (lang: string) => void;
45
52
  };
46
53
  export default TopolPlugin;
47
54
  export type { ITopolOptions, INotification, ISavedBlock, IMergeTagGroup, IMergeTag, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData, Stage as IStage };
@@ -27,4 +27,11 @@ export default interface ITopolPlugin {
27
27
  updateApiAuthorizationHeader: (newHeader: string | Record<string, string>) => void;
28
28
  setTemplateName: (name: string) => void;
29
29
  setMergeTags: (mergeTags: Array<IMergeTagGroup | IMergeTag>) => void;
30
+ toggleChatAI: () => void;
31
+ toggleAutosaves: () => void;
32
+ toggleComments: () => void;
33
+ createLanguage: (lang: string) => void;
34
+ setPrimaryLanguage: (lang: string) => void;
35
+ deleteLanguage: (lang: string) => void;
36
+ selectLanguage: (lang: string) => void;
30
37
  }
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": "0.2.1",
15
+ "version": "0.3.0",
16
16
  "files": [
17
17
  "dist"
18
18
  ],