@topol.io/editor 0.0.0 → 0.0.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 +31 -22
- package/dist/topol-plugin.umd.js +1 -1
- package/dist/types/src/main.d.ts +3 -0
- package/package.json +6 -5
package/dist/topol-plugin.es.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
function r(o) {
|
|
2
2
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
3
3
|
}
|
|
4
|
-
var u = function(
|
|
5
|
-
var i = document.head || document.getElementsByTagName("head")[0],
|
|
4
|
+
var u = function(n, e, l) {
|
|
5
|
+
var i = document.head || document.getElementsByTagName("head")[0], t = document.createElement("script");
|
|
6
6
|
typeof e == "function" && (l = e, e = {}), e = e || {}, l = l || function() {
|
|
7
|
-
},
|
|
8
|
-
var d = "onload" in
|
|
9
|
-
d(
|
|
7
|
+
}, t.type = e.type || "text/javascript", t.charset = e.charset || "utf8", t.async = "async" in e ? !!e.async : !0, t.src = n, e.attrs && c(t, e.attrs), e.text && (t.text = "" + e.text);
|
|
8
|
+
var d = "onload" in t ? a : s;
|
|
9
|
+
d(t, l), t.onload || a(t, l), i.appendChild(t);
|
|
10
10
|
};
|
|
11
|
-
function c(o,
|
|
12
|
-
for (var e in
|
|
13
|
-
o.setAttribute(e,
|
|
11
|
+
function c(o, n) {
|
|
12
|
+
for (var e in n)
|
|
13
|
+
o.setAttribute(e, n[e]);
|
|
14
14
|
}
|
|
15
|
-
function a(o,
|
|
15
|
+
function a(o, n) {
|
|
16
16
|
o.onload = function() {
|
|
17
|
-
this.onerror = this.onload = null,
|
|
17
|
+
this.onerror = this.onload = null, n(null, o);
|
|
18
18
|
}, o.onerror = function() {
|
|
19
|
-
this.onerror = this.onload = null,
|
|
19
|
+
this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), o);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function s(o,
|
|
22
|
+
function s(o, n) {
|
|
23
23
|
o.onreadystatechange = function() {
|
|
24
|
-
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null,
|
|
24
|
+
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, o));
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const g = /* @__PURE__ */ r(u), w = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", f = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",
|
|
28
|
-
function
|
|
27
|
+
const g = /* @__PURE__ */ r(u), w = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", f = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js", T = "https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";
|
|
28
|
+
function P(o = "production") {
|
|
29
29
|
switch (o) {
|
|
30
30
|
case "dev":
|
|
31
31
|
return f;
|
|
32
32
|
case "staging":
|
|
33
|
-
return
|
|
33
|
+
return T;
|
|
34
34
|
default:
|
|
35
35
|
return w;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
init: (o,
|
|
40
|
-
const i =
|
|
41
|
-
g(i, (
|
|
42
|
-
|
|
38
|
+
const p = {
|
|
39
|
+
init: (o, n) => new Promise((e, l) => {
|
|
40
|
+
const i = P(n == null ? void 0 : n.stage);
|
|
41
|
+
g(i, (t) => {
|
|
42
|
+
t !== null && l(t), window.TopolPlugin.init(o), e(!0);
|
|
43
43
|
});
|
|
44
44
|
}),
|
|
45
45
|
save: () => {
|
|
@@ -80,8 +80,17 @@ const P = {
|
|
|
80
80
|
},
|
|
81
81
|
destroy: () => {
|
|
82
82
|
window.TopolPlugin.destroy();
|
|
83
|
+
},
|
|
84
|
+
setPreviewHTML: (o) => {
|
|
85
|
+
window.TopolPlugin.setPreviewHTML(o);
|
|
86
|
+
},
|
|
87
|
+
setActiveMembers: (o) => {
|
|
88
|
+
window.TopolPlugin.setActiveMembers(o);
|
|
89
|
+
},
|
|
90
|
+
updateCustomBlockContent: (o) => {
|
|
91
|
+
window.TopolPlugin.updateCustomBlockContent(o);
|
|
83
92
|
}
|
|
84
93
|
};
|
|
85
94
|
export {
|
|
86
|
-
|
|
95
|
+
p as default
|
|
87
96
|
};
|
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(
|
|
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 u=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&&a(n,o.attrs),o.text&&(n.text=""+o.text);var T="onload"in n?r:c;T(n,i),n.onload||r(n,i),u.appendChild(n)};function a(e,t){for(var o in t)e.setAttribute(o,t[o])}function r(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 c(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}const s=l(d),g="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",w="https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",f="https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";function p(e="production"){switch(e){case"dev":return w;case"staging":return f;default:return g}}return{init:(e,t)=>new Promise((o,i)=>{const u=p(t==null?void 0:t.stage);s(u,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()},setSavedBlocks:e=>{window.TopolPlugin.setSavedBlocks(e)},createNotification:e=>{window.TopolPlugin.createNotification(e)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},destroy:()=>{window.TopolPlugin.destroy()},setPreviewHTML:e=>{window.TopolPlugin.setPreviewHTML(e)},setActiveMembers:e=>{window.TopolPlugin.setActiveMembers(e)},updateCustomBlockContent:e=>{window.TopolPlugin.updateCustomBlockContent(e)}}});
|
package/dist/types/src/main.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ declare const TopolPlugin: {
|
|
|
34
34
|
changeEmailToDesktop: () => void;
|
|
35
35
|
toggleBlocksAndStructuresVisibility: () => void;
|
|
36
36
|
destroy: () => void;
|
|
37
|
+
setPreviewHTML: (html: unknown) => void;
|
|
38
|
+
setActiveMembers: (activeMemers: string[]) => void;
|
|
39
|
+
updateCustomBlockContent: (content: string) => void;
|
|
37
40
|
};
|
|
38
41
|
export default TopolPlugin;
|
|
39
42
|
export type { ITopolOptions, INotification, ISavedBlock, IMergeTagGroup, IMergeTag, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData, Stage as IStage };
|
package/package.json
CHANGED
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
"author": "Topol.io",
|
|
13
13
|
"homepage": "https://topol.io",
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
|
-
"version": "0.0.
|
|
15
|
+
"version": "0.0.1",
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
|
+
"type": "module",
|
|
19
20
|
"module": "./dist/topol-plugin.es.js",
|
|
20
21
|
"types": "./dist/types/src/main.d.ts",
|
|
21
22
|
"exports": {
|
|
@@ -31,9 +32,9 @@
|
|
|
31
32
|
"@typescript-eslint/parser": "^6.7.2",
|
|
32
33
|
"eslint": "^8.50.0",
|
|
33
34
|
"eslint-config-prettier": "^9.0.0",
|
|
34
|
-
"prettier": "3.
|
|
35
|
+
"prettier": "3.1.1",
|
|
35
36
|
"typescript": "^5.2.2",
|
|
36
|
-
"vite": "^
|
|
37
|
+
"vite": "^5.0.11"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"load-script": "^2.0.0"
|
|
@@ -42,8 +43,8 @@
|
|
|
42
43
|
"access": "public"
|
|
43
44
|
},
|
|
44
45
|
"scripts": {
|
|
45
|
-
"dev": "vite build --watch",
|
|
46
|
-
"build": "vite build &&
|
|
46
|
+
"dev": "vite build --watch && pnpm run build:types",
|
|
47
|
+
"build": "vite build && pnpm run build:types",
|
|
47
48
|
"lint": "eslint --config '.eslintrc.js' ./**/*.ts --fix",
|
|
48
49
|
"format": "prettier --write .",
|
|
49
50
|
"build:types": "tsc -p tsconfig.prod.json"
|