@topol.io/editor 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,63 @@
1
- function r(e) {
1
+ function c(e) {
2
2
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3
3
  }
4
- var u = function(t, o, i) {
5
- var l = document.head || document.getElementsByTagName("head")[0], n = document.createElement("script");
4
+ var s = function(n, o, i) {
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
- }, n.type = o.type || "text/javascript", n.charset = o.charset || "utf8", n.async = "async" in o ? !!o.async : !0, n.src = t, o.attrs && s(n, o.attrs), o.text && (n.text = "" + o.text);
8
- var d = "onload" in n ? a : c;
9
- d(n, i), n.onload || a(n, i), l.appendChild(n);
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);
10
10
  };
11
- function s(e, t) {
12
- for (var o in t)
13
- e.setAttribute(o, t[o]);
11
+ function w(e, n) {
12
+ for (var o in n)
13
+ e.setAttribute(o, n[o]);
14
14
  }
15
- function a(e, t) {
15
+ function d(e, n) {
16
16
  e.onload = function() {
17
- this.onerror = this.onload = null, t(null, e);
17
+ this.onerror = this.onload = null, n(null, e);
18
18
  }, e.onerror = function() {
19
- this.onerror = this.onload = null, t(new Error("Failed to load " + this.src), e);
19
+ this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), e);
20
20
  };
21
21
  }
22
- function c(e, t) {
22
+ function g(e, n) {
23
23
  e.onreadystatechange = function() {
24
- this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, t(null, e));
24
+ this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, e));
25
25
  };
26
26
  }
27
- const w = /* @__PURE__ */ r(u), g = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", p = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js", T = "https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";
28
- function P(e = "production") {
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";
28
+ function T(e = "production") {
29
29
  switch (e) {
30
30
  case "dev":
31
31
  return p;
32
32
  case "staging":
33
- return T;
33
+ return f;
34
+ case "production":
35
+ return a;
34
36
  default:
35
- return g;
37
+ return `https://d10h8ga60f7b91.cloudfront.net/preview-app-${e}/loader/build.js`;
36
38
  }
37
39
  }
38
- const f = {
39
- init: (e, t) => new Promise((o, i) => {
40
- const l = P(t == null ? void 0 : t.stage);
41
- w(l, (n) => {
42
- n !== null && i(n), window.TopolPlugin.init(e), o(!0);
40
+ async function P(e) {
41
+ return new Promise((n, o) => {
42
+ u(a, (i) => {
43
+ i !== null && o(i), window.TopolPlugin.init(e), n(!0);
44
+ });
45
+ });
46
+ }
47
+ const h = {
48
+ init: (e, n) => new Promise((o, i) => {
49
+ const l = T(n == null ? void 0 : n.stage);
50
+ u(l, async (t) => {
51
+ if (t !== null) {
52
+ if (l !== a)
53
+ try {
54
+ return await P(e), o(!0);
55
+ } catch (r) {
56
+ i(r);
57
+ }
58
+ i(t);
59
+ }
60
+ window.TopolPlugin.init(e), o(!0);
43
61
  });
44
62
  }),
45
63
  save: () => {
@@ -107,5 +125,5 @@ const f = {
107
125
  }
108
126
  };
109
127
  export {
110
- f as default
128
+ h as default
111
129
  };
@@ -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(t,o,i){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("script");typeof o=="function"&&(i=o,o={}),o=o||{},i=i||function(){},n.type=o.type||"text/javascript",n.charset=o.charset||"utf8",n.async="async"in o?!!o.async:!0,n.src=t,o.attrs&&u(n,o.attrs),o.text&&(n.text=""+o.text);var T="onload"in n?a:s;T(n,i),n.onload||a(n,i),r.appendChild(n)};function u(e,t){for(var o in t)e.setAttribute(o,t[o])}function a(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function s(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}const c=l(d),g="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",w="https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",p="https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";function f(e="production"){switch(e){case"dev":return w;case"staging":return p;default:return g}}return{init:(e,t)=>new Promise((o,i)=>{const r=f(t==null?void 0:t.stage);c(r,n=>{n!==null&&i(n),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,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 +1 @@
1
- export type Stage = "dev" | "staging" | "production";
1
+ export type Stage = "dev" | "staging" | "production" | number;
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.0",
15
+ "version": "0.2.1",
16
16
  "files": [
17
17
  "dist"
18
18
  ],