@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.
package/dist/topol-plugin.es.js
CHANGED
|
@@ -1,45 +1,63 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c(e) {
|
|
2
2
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3
3
|
}
|
|
4
|
-
var
|
|
5
|
-
var l = document.head || document.getElementsByTagName("head")[0],
|
|
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
|
-
},
|
|
8
|
-
var
|
|
9
|
-
|
|
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
|
|
12
|
-
for (var o in
|
|
13
|
-
e.setAttribute(o,
|
|
11
|
+
function w(e, n) {
|
|
12
|
+
for (var o in n)
|
|
13
|
+
e.setAttribute(o, n[o]);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function d(e, n) {
|
|
16
16
|
e.onload = function() {
|
|
17
|
-
this.onerror = this.onload = null,
|
|
17
|
+
this.onerror = this.onload = null, n(null, e);
|
|
18
18
|
}, e.onerror = function() {
|
|
19
|
-
this.onerror = this.onload = null,
|
|
19
|
+
this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), e);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function g(e, n) {
|
|
23
23
|
e.onreadystatechange = function() {
|
|
24
|
-
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null,
|
|
24
|
+
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, e));
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
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
|
|
33
|
+
return f;
|
|
34
|
+
case "production":
|
|
35
|
+
return a;
|
|
34
36
|
default:
|
|
35
|
-
return
|
|
37
|
+
return `https://d10h8ga60f7b91.cloudfront.net/preview-app-${e}/loader/build.js`;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
128
|
+
h as default
|
|
111
129
|
};
|
package/dist/topol-plugin.umd.js
CHANGED
|
@@ -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(
|
|
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;
|