@topol.io/editor-vue 0.0.0-beta.5 → 0.0.0-beta.9

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.
@@ -17,12 +17,13 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, onMounted, openBlock, createElementBlock } from "vue";
20
+ import { defineComponent, onMounted, onBeforeUnmount, openBlock, createElementBlock } from "vue";
21
21
  import TopolPlugin from "@topol.io/editor";
22
22
  export { default as TopolPlugin } from "@topol.io/editor";
23
23
  const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  props: {
25
- options: null
25
+ options: null,
26
+ dev: { type: Boolean, default: false }
26
27
  },
27
28
  emits: ["onSave", "onSaveAndClose", "onTestSend", "onOpenFileManager", "onLoaded", "onBlockSave", "onBlockRemove", "onBlockEdit", "onInit", "onUndoChange", "onRedoChange", "onPreview", "onAlert"],
28
29
  setup(__props, { emit }) {
@@ -74,7 +75,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
75
  };
75
76
  onMounted(async () => {
76
77
  const mergedTopolOptinos = mergeOptions();
77
- await TopolPlugin.init(mergedTopolOptinos);
78
+ await TopolPlugin.init(mergedTopolOptinos, { dev: props.dev });
79
+ });
80
+ onBeforeUnmount(() => {
81
+ TopolPlugin.destroy();
78
82
  });
79
83
  return (_ctx, _cache) => {
80
84
  return openBlock(), createElementBlock("div", {
@@ -1 +1 @@
1
- var T=Object.defineProperty,B=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var p=(e,o,d)=>o in e?T(e,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[o]=d,r=(e,o)=>{for(var d in o||(o={}))C.call(o,d)&&p(e,d,o[d]);if(s)for(var d of s(o))y.call(o,d)&&p(e,d,o[d]);return e},f=(e,o)=>B(e,_(o));(function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue"),require("@topol.io/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@topol.io/editor"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["topol-editor-vue"]={},e.Vue,e.TopolPlugin))})(this,function(e,o,d){"use strict";function v(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var c=v(d);const g=o.defineComponent({props:{options:null},emits:["onSave","onSaveAndClose","onTestSend","onOpenFileManager","onLoaded","onBlockSave","onBlockRemove","onBlockEdit","onInit","onUndoChange","onRedoChange","onPreview","onAlert"],setup(l,{emit:t}){const h=l,u="topol-editor-id",S=()=>{const a={onSave(n,i){t("onSave",{json:n,html:i})},onSaveAndClose(n,i){t("onSaveAndClose",{json:n,html:i})},onTestSend(n,i,k){t("onTestSend",{email:n,json:i,html:k})},onOpenFileManager(){t("onOpenFileManager")},onLoaded(){t("onLoaded")},onBlockSave(n){t("onBlockSave",n)},onBlockRemove(n){t("onBlockRemove",n)},onBlockEdit(n){t("onBlockEdit",n)},onInit(){t("onInit")},onUndoChange(n){t("onUndoChange",n)},onRedoChange(n){t("onRedoChange",n)},onPreview(n){t("onPreview",n)},onAlert(n){t("onAlert",n)}};return f(r({id:"#"+u},h.options),{callbacks:r({},a)})};return o.onMounted(async()=>{const a=S();await c.default.init(a)}),(a,n)=>(o.openBlock(),o.createElementBlock("div",{id:u,style:{position:"absolute",width:"100%",height:"100vh"}}))}});Object.defineProperty(e,"TopolPlugin",{enumerable:!0,get:function(){return c.default}}),e.TopolEditor=g,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
1
+ var B=Object.defineProperty,T=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(e,o,d)=>o in e?B(e,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[o]=d,u=(e,o)=>{for(var d in o||(o={}))_.call(o,d)&&f(e,d,o[d]);if(p)for(var d of p(o))C.call(o,d)&&f(e,d,o[d]);return e},v=(e,o)=>T(e,y(o));(function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue"),require("@topol.io/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@topol.io/editor"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["topol-editor-vue"]={},e.Vue,e.TopolPlugin))})(this,function(e,o,d){"use strict";function g(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var r=g(d);const h=o.defineComponent({props:{options:null,dev:{type:Boolean,default:!1}},emits:["onSave","onSaveAndClose","onTestSend","onOpenFileManager","onLoaded","onBlockSave","onBlockRemove","onBlockEdit","onInit","onUndoChange","onRedoChange","onPreview","onAlert"],setup(l,{emit:t}){const c=l,s="topol-editor-id",S=()=>{const a={onSave(n,i){t("onSave",{json:n,html:i})},onSaveAndClose(n,i){t("onSaveAndClose",{json:n,html:i})},onTestSend(n,i,k){t("onTestSend",{email:n,json:i,html:k})},onOpenFileManager(){t("onOpenFileManager")},onLoaded(){t("onLoaded")},onBlockSave(n){t("onBlockSave",n)},onBlockRemove(n){t("onBlockRemove",n)},onBlockEdit(n){t("onBlockEdit",n)},onInit(){t("onInit")},onUndoChange(n){t("onUndoChange",n)},onRedoChange(n){t("onRedoChange",n)},onPreview(n){t("onPreview",n)},onAlert(n){t("onAlert",n)}};return v(u({id:"#"+s},c.options),{callbacks:u({},a)})};return o.onMounted(async()=>{const a=S();await r.default.init(a,{dev:c.dev})}),o.onBeforeUnmount(()=>{r.default.destroy()}),(a,n)=>(o.openBlock(),o.createElementBlock("div",{id:s,style:{position:"absolute",width:"100%",height:"100vh"}}))}});Object.defineProperty(e,"TopolPlugin",{enumerable:!0,get:function(){return r.default}}),e.TopolEditor=h,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
@@ -1,6 +1,6 @@
1
1
  import type IVueTopolOptions from '../types/IVueTopolOptions';
2
- import type INotification from '../types/Notification/INotification';
3
- import type ISavedBlock from '../types/SavedBlock/ISavedBlock';
2
+ import type { INotification } from '@topol.io/editor';
3
+ import type { ISavedBlock } from '@topol.io/editor';
4
4
  export { default as TopolEditor } from './TopolEditor.vue';
5
5
  export { default as TopolPlugin } from '@topol.io/editor';
6
6
  export { IVueTopolOptions as ITopolOptions };
@@ -1,10 +1,4 @@
1
- import { IAPI } from "./API/API";
2
- import ISavedBlock from "./SavedBlock/ISavedBlock";
3
- import IMergeTagGroup from "./MergeTag/IMergeTagGroup";
4
- import IContentBlockOptions from "./ContentBlock/IContentBlockOptions";
5
- import ITheme from "./Theme/ITheme";
6
- import IAuthHeaderConfig from "./AuthHeaderConfig/IAuthHeaderConfig";
7
- import IFont from "./Font/IFont";
1
+ import { ISavedBlock, IMergeTagGroup, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI } from "@topol.io/editor";
8
2
  export default interface IVueOptions {
9
3
  authorize: {
10
4
  apiKey: string;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "author": "Topol.io",
15
15
  "homepage": "https://topol.io",
16
16
  "license": "Apache-2.0",
17
- "version": "0.0.0-beta.5",
17
+ "version": "0.0.0-beta.9",
18
18
  "files": [
19
19
  "dist"
20
20
  ],
@@ -31,21 +31,21 @@
31
31
  "dev": "vite",
32
32
  "build": "vite build && yarn run build:types",
33
33
  "preview": "vite preview",
34
- "build:types": "vue-tsc"
34
+ "build:types": "vue-tsc -p tsconfig.prod.json"
35
35
  },
36
36
  "dependencies": {
37
- "@topol.io/editor": "^0.0.0-alfa.7"
37
+ "@topol.io/editor": "^0.0.0-alfa.13"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "vue": "^3.2.25"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^17.0.14",
43
+ "@types/node": "^17.0.15",
44
44
  "@vitejs/plugin-vue": "^2.0.0",
45
45
  "typescript": "^4.4.4",
46
46
  "vite": "^2.7.2",
47
- "vue": "^3.2.25",
48
- "vue-tsc": "^0.31.1"
47
+ "vue": "^3.2.30",
48
+ "vue-tsc": "^0.31.2"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
@@ -1,78 +0,0 @@
1
- import IVueOptions from "../types/IVueTopolOptions";
2
- import ISavedBlock from "../types/SavedBlock/ISavedBlock";
3
- import INotification from "../types/Notification/INotification";
4
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
5
- options: IVueOptions;
6
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
- onSave: (payload_0: {
8
- json: unknown;
9
- html: unknown;
10
- }) => void;
11
- } & {
12
- onSaveAndClose: (payload_0: {
13
- json: unknown;
14
- html: unknown;
15
- }) => void;
16
- } & {
17
- onTestSend: (payload_0: {
18
- email: string;
19
- json: unknown;
20
- html: unknown;
21
- }) => void;
22
- } & {
23
- onOpenFileManager: () => void;
24
- } & {
25
- onLoaded: () => void;
26
- } & {
27
- onBlockSave: (block: ISavedBlock) => void;
28
- } & {
29
- onBlockRemove: (blockId: number) => void;
30
- } & {
31
- onBlockEdit: (blockId: number) => void;
32
- } & {
33
- onInit: () => void;
34
- } & {
35
- onUndoChange: (count: number) => void;
36
- } & {
37
- onRedoChange: (count: number) => void;
38
- } & {
39
- onPreview: (html: unknown) => void;
40
- } & {
41
- onAlert: (notification: INotification) => void;
42
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
43
- options: IVueOptions;
44
- }>>> & {
45
- onOnSave?: ((args_0: {
46
- json: unknown;
47
- html: unknown;
48
- }) => any) | undefined;
49
- onOnSaveAndClose?: ((args_0: {
50
- json: unknown;
51
- html: unknown;
52
- }) => any) | undefined;
53
- onOnTestSend?: ((args_0: {
54
- email: string;
55
- json: unknown;
56
- html: unknown;
57
- }) => any) | undefined;
58
- onOnOpenFileManager?: (() => any) | undefined;
59
- onOnLoaded?: (() => any) | undefined;
60
- onOnBlockSave?: ((block: ISavedBlock) => any) | undefined;
61
- onOnBlockRemove?: ((blockId: number) => any) | undefined;
62
- onOnBlockEdit?: ((blockId: number) => any) | undefined;
63
- onOnInit?: (() => any) | undefined;
64
- onOnUndoChange?: ((count: number) => any) | undefined;
65
- onOnRedoChange?: ((count: number) => any) | undefined;
66
- onOnPreview?: ((html: unknown) => any) | undefined;
67
- onOnAlert?: ((notification: INotification) => any) | undefined;
68
- }, {}>;
69
- export default _default;
70
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
71
- declare type __VLS_TypePropsToRuntimeProps<T> = {
72
- [K in keyof T]-?: {} extends Pick<T, K> ? {
73
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
74
- } : {
75
- type: import('vue').PropType<T[K]>;
76
- required: true;
77
- };
78
- };
@@ -1,21 +0,0 @@
1
- export interface IAPI {
2
- GET_AUTOSAVE: string;
3
- AUTOSAVES: string;
4
- LOAD: string;
5
- SAVE: string | null;
6
- AUTOSAVE: string;
7
- PREVIEW: string;
8
- FEEDS: string;
9
- PRODUCTS: string;
10
- IMAGE_UPLOAD: string;
11
- FOLDERS: string;
12
- IMAGE_EDITOR_UPLOAD: string | null;
13
- TEST_EMAIL: string;
14
- }
15
- export interface ILockedAPI {
16
- GIPHY_API_KEY: string;
17
- GIPHY_SEARCH: string;
18
- AUTHORIZE: string;
19
- GCS_SIGNED_URL: string;
20
- SAVE_SERVER: string;
21
- }
@@ -1,3 +0,0 @@
1
- export default interface AuthHeaderConfig {
2
- [key: string]: string;
3
- }
@@ -1,5 +0,0 @@
1
- export default interface IContentBlockOptions {
2
- disabled?: boolean;
3
- disabledText?: string;
4
- hidden?: boolean;
5
- }
@@ -1,5 +0,0 @@
1
- export default interface IFont {
2
- label: string;
3
- style: string;
4
- url?: string;
5
- }
@@ -1,5 +0,0 @@
1
- export default interface IMergeTag {
2
- value: string;
3
- text: string;
4
- label: string;
5
- }
@@ -1,5 +0,0 @@
1
- import IMergeTag from "./IMergeTag";
2
- export default interface IMergeTagGroup {
3
- name: string;
4
- items: Array<IMergeTag | IMergeTagGroup>;
5
- }
@@ -1,7 +0,0 @@
1
- export default interface INotification {
2
- title: string;
3
- text: string;
4
- expectSideEffect?: boolean;
5
- persistent?: boolean;
6
- type: "info" | "error" | "success";
7
- }
@@ -1,5 +0,0 @@
1
- export default interface ISavedBlock {
2
- id: number;
3
- name: string;
4
- definition: Array<Object>;
5
- }
@@ -1,33 +0,0 @@
1
- export default interface ITheme {
2
- preset: "light" | "dark";
3
- borderRadius?: {
4
- small?: string;
5
- large?: string;
6
- };
7
- colors: {
8
- "900"?: string;
9
- "800"?: string;
10
- "700"?: string;
11
- "600"?: string;
12
- "500"?: string;
13
- "450"?: string;
14
- "400"?: string;
15
- "350"?: string;
16
- "300"?: string;
17
- "200"?: string;
18
- "150"?: string;
19
- "100"?: string;
20
- white?: string;
21
- primary?: string;
22
- "primary-light"?: string;
23
- "primary-dark"?: string;
24
- secondary?: string;
25
- "secondary-light"?: string;
26
- error?: string;
27
- "error-light"?: string;
28
- success?: string;
29
- "success-light"?: string;
30
- active?: string;
31
- "active-light"?: string;
32
- };
33
- }