@topol.io/editor 0.0.0-alfa.3 → 0.0.0-alfa.4

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.
@@ -117,4 +117,4 @@ const createTopolPlugin = (options) => {
117
117
  destroy
118
118
  };
119
119
  };
120
- export { createTopolPlugin as default };
120
+ export { createTopolPlugin, createTopolPlugin as default };
@@ -1 +1 @@
1
- (function(d,a){typeof exports=="object"&&typeof module!="undefined"?module.exports=a():typeof define=="function"&&define.amd?define(a):(d=typeof globalThis!="undefined"?globalThis:d||self,d["topol-plugin"]=a())})(this,function(){"use strict";var d=function(i,o,l){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("script");typeof o=="function"&&(l=o,o={}),o=o||{},l=l||function(){},n.type=o.type||"text/javascript",n.charset=o.charset||"utf8",n.async="async"in o?!!o.async:!0,n.src=i,o.attrs&&a(n,o.attrs),o.text&&(n.text=""+o.text);var s="onload"in n?c:g;s(n,l),n.onload||c(n,l),r.appendChild(n)};function a(e,i){for(var o in i)e.setAttribute(o,i[o])}function c(e,i){e.onload=function(){this.onerror=this.onload=null,i(null,e)},e.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+this.src),e)}}function g(e,i){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,i(null,e))}}const w="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js";return e=>({init:()=>new Promise((t,f)=>{d(w,u=>{u!==null&&f(u),window.TopolPlugin.init(e),t(!0)})}),save:()=>{window.TopolPlugin.save()},load:t=>{window.TopolPlugin.load(t)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:t=>{window.TopolPlugin.chooseFile(t)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},setSavedBlocks:t=>{window.TopolPlugin.setSavedBlocks(t)},createNotification:t=>{window.TopolPlugin.createNotification(t)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},destroy:()=>{window.TopolPlugin.destroy()}})});
1
+ (function(l,a){typeof exports=="object"&&typeof module!="undefined"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(l=typeof globalThis!="undefined"?globalThis:l||self,a(l["topol-plugin"]={}))})(this,function(l){"use strict";var a=function(t,o,d){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("script");typeof o=="function"&&(d=o,o={}),o=o||{},d=d||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&&w(n,o.attrs),o.text&&(n.text=""+o.text);var s="onload"in n?c:f;s(n,d),n.onload||c(n,d),r.appendChild(n)};function w(e,t){for(var o in t)e.setAttribute(o,t[o])}function c(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 f(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}const h="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",u=e=>({init:()=>new Promise((i,T)=>{a(h,g=>{g!==null&&T(g),window.TopolPlugin.init(e),i(!0)})}),save:()=>{window.TopolPlugin.save()},load:i=>{window.TopolPlugin.load(i)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:i=>{window.TopolPlugin.chooseFile(i)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},setSavedBlocks:i=>{window.TopolPlugin.setSavedBlocks(i)},createNotification:i=>{window.TopolPlugin.createNotification(i)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},destroy:()=>{window.TopolPlugin.destroy()}});l.createTopolPlugin=u,l.default=u,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
@@ -7,7 +7,7 @@ declare global {
7
7
  TopolPlugin: ITopolPlugin;
8
8
  }
9
9
  }
10
- declare const createTopolPlugin: (options: ITopolOptions) => {
10
+ export declare const createTopolPlugin: (options: ITopolOptions) => {
11
11
  init: () => Promise<boolean | string>;
12
12
  save: () => void;
13
13
  load: (json: unknown) => void;
@@ -24,3 +24,4 @@ declare const createTopolPlugin: (options: ITopolOptions) => {
24
24
  destroy: () => void;
25
25
  };
26
26
  export default createTopolPlugin;
27
+ export type { ITopolOptions };
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@topol.io/editor",
3
- "version": "0.0.0-alfa.3",
3
+ "version": "0.0.0-alfa.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
7
7
  "module": "./dist/topol-plugin.es.js",
8
- "types": "./dist/src/main.d.ts",
8
+ "types": "./dist/types/src/main.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": "./dist/topol-plugin.es.js",
12
12
  "require": "./dist/topol-plugin.umd.js",
13
- "types": "./dist/src/main.d.ts"
13
+ "types": "./dist/types/src/main.d.ts"
14
14
  }
15
15
  },
16
16
  "scripts": {
17
17
  "dev": "vite",
18
- "build": "vite build",
18
+ "build": "vite build && tsc",
19
19
  "lint": "eslint --config '.eslintrc.js' ./**/*.ts --fix",
20
20
  "format": "prettier --write .",
21
21
  "build:types": "tsc"