@tinymce/tinymce-vue 4.0.4 → 4.0.5-feature.20211117013517127.sha4692fc8

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/CHANGELOG.md CHANGED
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## Unreleased
8
+ ### Added
9
+ - Correct proptypes
8
10
  ### Fixed
9
11
  - Update dependencies
10
12
 
@@ -225,13 +225,6 @@ var Editor = (function (vue) {
225
225
  return global && global.tinymce ? global.tinymce : null;
226
226
  };
227
227
 
228
- /**
229
- * Copyright (c) 2018-present, Ephox, Inc.
230
- *
231
- * This source code is licensed under the Apache 2 license found in the
232
- * LICENSE file in the root directory of this source tree.
233
- *
234
- */
235
228
  var editorProps = {
236
229
  apiKey: String,
237
230
  cloudChannel: String,
@@ -1 +1 @@
1
- var Editor=function(m){"use strict";function f(n){return-1!==t.map(function(n){return n.toLowerCase()}).indexOf(n.toLowerCase())}function y(n,t,e,o,i,r){var a,u,l,c,s,d;o.setContent(r()),e.attrs["onUpdate:modelValue"]&&(u=e,l=o,i=i,t=(a=t).modelEvents||null,t=Array.isArray(t)?t.join(" "):t,m.watch(i,function(n,t){l&&"string"==typeof n&&n!==t&&n!==l.getContent({format:a.outputFormat})&&l.setContent(n)}),l.on(t||"change input undo redo",function(){u.emit("update:modelValue",l.getContent({format:a.outputFormat}))})),c=n,s=e.attrs,d=o,Object.keys(s).filter(f).forEach(function(n){var t=s[n];"function"==typeof t&&("onInit"===n?t(c,d):d.on(n.substring(2),function(n){return t(n,d)}))})}function o(n){var t=Date.now();return n+"_"+Math.floor(1e9*Math.random())+ ++e+String(t)}function g(n){return void 0===n||""===n?[]:Array.isArray(n)?n:n.split(" ")}function n(){return{listeners:[],scriptId:o("tiny-script"),scriptLoaded:!1}}function C(){var n="undefined"!=typeof window?window:global;return n&&n.tinymce?n.tinymce:null}var i,S=function(){return(S=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)},t=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],e=0,h=(i=n(),{load:function(n,t,e){i.scriptLoaded?e():(i.listeners.push(e),n.getElementById(i.scriptId)||function(n,t,e,o){var i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=n,i.src=e;var r=function(){i.removeEventListener("load",r),o()};i.addEventListener("load",r),t.head&&t.head.appendChild(i)}(i.scriptId,n,t,function(){i.listeners.forEach(function(n){return n()}),i.scriptLoaded=!0}))},reinitialize:function(){i=n()}}),r={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],modelValue:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(n){return"html"===n||"text"===n}}};return m.defineComponent({props:r,setup:function(i,r){function e(){var n,t,e=(n=f,d?function(){return null!=a&&a.value?a.value:""}:function(){return n?p:v}),o=S(S({},i.init),{readonly:i.disabled,selector:"#"+c,plugins:(o=i.init&&i.init.plugins,t=i.plugins,g(o).concat(g(t))),toolbar:i.toolbar||i.init&&i.init.toolbar,inline:s,setup:function(t){(l=t).on("init",function(n){return y(n,i,r,t,a,e)}),i.init&&"function"==typeof i.init.setup&&i.init.setup(t)}});null!==(t=u.value)&&"textarea"===t.tagName.toLowerCase()&&(u.value.style.visibility=""),C().init(o),f=!1}var n=m.toRefs(i),t=n.disabled,a=n.modelValue,u=m.ref(null),l=null,c=i.id||o("tiny-vue"),s=i.init&&i.init.inline||i.inline,d=!!r.attrs["onUpdate:modelValue"],f=!0,p=i.initialValue||"",v="";return m.watch(t,function(n){null!==l&&l.setMode(n?"readonly":"design")}),m.onMounted(function(){var n,t;null!==C()?e():u.value&&u.value.ownerDocument&&(t=i.cloudChannel||"5",n=i.apiKey||"no-api-key",t=null==i.tinymceScriptSrc?"https://cdn.tiny.cloud/1/"+n+"/tinymce/"+t+"/tinymce.min.js":i.tinymceScriptSrc,h.load(u.value.ownerDocument,t,e))}),m.onBeforeUnmount(function(){null!==C()&&C().remove(l)}),s||(m.onActivated(function(){f||e()}),m.onDeactivated(function(){var n;d||(v=l.getContent()),null!==(n=C())&&void 0!==n&&n.remove(l)})),function(){return s?(n=m.h,t=c,e=u,o=i.tagName,n(o||"div",{id:t,ref:e})):(0,m.h)("textarea",{id:c,visibility:"hidden",ref:u});var n,t,e,o}}})}(Vue);
1
+ var Editor=function(a){"use strict";function n(n){return-1!==e.map(function(n){return n.toLowerCase()}).indexOf(n.toLowerCase())}function t(){return{listeners:[],scriptId:S("tiny-script"),scriptLoaded:!1}}function m(){var n="undefined"!=typeof window?window:global;return n&&n.tinymce?n.tinymce:null}var o,y=function(){return(y=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)},e=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],g=function(e,o,i){Object.keys(o).filter(n).forEach(function(n){var t=o[n];"function"==typeof t&&("onInit"===n?t(e,i):i.on(n.substring(2),function(n){return t(n,i)}))})},C=function(e,n,o,t){var i=e.modelEvents||null,i=Array.isArray(i)?i.join(" "):i;a.watch(t,function(n,t){o&&"string"==typeof n&&n!==t&&n!==o.getContent({format:e.outputFormat})&&o.setContent(n)}),o.on(i||"change input undo redo",function(){n.emit("update:modelValue",o.getContent({format:e.outputFormat}))})},i=0,S=function(n){var t=Date.now();return n+"_"+Math.floor(1e9*Math.random())+ ++i+String(t)},h=function(n){return void 0===n||""===n?[]:Array.isArray(n)?n:n.split(" ")},b=(o=t(),{load:function(n,t,e){o.scriptLoaded?e():(o.listeners.push(e),n.getElementById(o.scriptId)||function(n,t,e,o){var i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=n,i.src=e;function r(){i.removeEventListener("load",r),o()}i.addEventListener("load",r),t.head&&t.head.appendChild(i)}(o.scriptId,n,t,function(){o.listeners.forEach(function(n){return n()}),o.scriptLoaded=!0}))},reinitialize:function(){o=t()}}),r={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],modelValue:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(n){return"html"===n||"text"===n}}};return a.defineComponent({props:r,setup:function(u,l){function e(){var n,t,a=(n=f,d?function(){return null!=c&&c.value?c.value:""}:function(){return n?p:v}),e=y(y({},u.init),{readonly:u.disabled,selector:"#"+r,plugins:(e=u.init&&u.init.plugins,t=u.plugins,h(e).concat(h(t))),toolbar:u.toolbar||u.init&&u.init.toolbar,inline:s,setup:function(r){(i=r).on("init",function(n){return t=n,e=u,o=l,i=c,(n=r).setContent(a()),o.attrs["onUpdate:modelValue"]&&C(e,o,n,i),void g(t,o.attrs,n);var t,e,o,i}),u.init&&"function"==typeof u.init.setup&&u.init.setup(r)}});null!==(t=o.value)&&"textarea"===t.tagName.toLowerCase()&&(o.value.style.visibility=""),m().init(e),f=!1}var n=a.toRefs(u),t=n.disabled,c=n.modelValue,o=a.ref(null),i=null,r=u.id||S("tiny-vue"),s=u.init&&u.init.inline||u.inline,d=!!l.attrs["onUpdate:modelValue"],f=!0,p=u.initialValue||"",v="";return a.watch(t,function(n){null!==i&&i.setMode(n?"readonly":"design")}),a.onMounted(function(){var n,t;null!==m()?e():o.value&&o.value.ownerDocument&&(t=u.cloudChannel||"5",n=u.apiKey||"no-api-key",t=null==u.tinymceScriptSrc?"https://cdn.tiny.cloud/1/"+n+"/tinymce/"+t+"/tinymce.min.js":u.tinymceScriptSrc,b.load(o.value.ownerDocument,t,e))}),a.onBeforeUnmount(function(){null!==m()&&m().remove(i)}),s||(a.onActivated(function(){f||e()}),a.onDeactivated(function(){var n;d||(v=i.getContent()),null!==(n=m())&&void 0!==n&&n.remove(i)})),function(){return s?(n=a.h,t=o,e=u.tagName,n(e||"div",{id:r,ref:t})):(0,a.h)("textarea",{id:r,visibility:"hidden",ref:o});var n,t,e}}})}(Vue);
@@ -7,10 +7,11 @@
7
7
  */
8
8
  import { Ref, SetupContext } from 'vue';
9
9
  import { IPropTypes } from './components/EditorPropTypes';
10
+ import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
10
11
  declare const isValidKey: (key: string) => boolean;
11
- declare const bindHandlers: (initEvent: Event, listeners: any, editor: any) => void;
12
- declare const bindModelHandlers: (props: IPropTypes, ctx: SetupContext, editor: any, modelValue: Ref<any>) => void;
13
- declare const initEditor: (initEvent: Event, props: IPropTypes, ctx: SetupContext, editor: any, modelValue: Ref<any>, content: () => string) => void;
12
+ declare const bindHandlers: (initEvent: EditorEvent<any>, listeners: any, editor: TinyMCEEditor) => void;
13
+ declare const bindModelHandlers: (props: IPropTypes, ctx: SetupContext, editor: TinyMCEEditor, modelValue: Ref<any>) => void;
14
+ declare const initEditor: (initEvent: EditorEvent<any>, props: IPropTypes, ctx: SetupContext, editor: TinyMCEEditor, modelValue: Ref<any>, content: () => string) => void;
14
15
  declare const uuid: (prefix: string) => string;
15
16
  declare const isTextarea: (element: Element | null) => element is HTMLTextAreaElement;
16
17
  declare const mergePlugins: (initPlugins: string | string[], inputPlugins?: string | string[] | undefined) => string[];
@@ -6,6 +6,21 @@
6
6
  *
7
7
  */
8
8
  export declare const Editor: import("vue").DefineComponent<import("./EditorPropTypes").CopyProps<import("./EditorPropTypes").IPropTypes>, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
9
+ apiKey?: unknown;
10
+ cloudChannel?: unknown;
11
+ id?: unknown;
12
+ init?: unknown;
13
+ initialValue?: unknown;
14
+ outputFormat?: unknown;
15
+ inline?: unknown;
16
+ modelEvents?: unknown;
17
+ plugins?: unknown;
18
+ tagName?: unknown;
19
+ toolbar?: unknown;
20
+ modelValue?: unknown;
21
+ disabled?: unknown;
22
+ tinymceScriptSrc?: unknown;
23
+ } & {
9
24
  apiKey: any;
10
25
  cloudChannel: any;
11
26
  id: any;
@@ -20,7 +35,7 @@ export declare const Editor: import("vue").DefineComponent<import("./EditorPropT
20
35
  modelValue: any;
21
36
  disabled: any;
22
37
  tinymceScriptSrc: any;
23
- } & {}>, {
38
+ } & {}> & {}, {
24
39
  apiKey: any;
25
40
  cloudChannel: any;
26
41
  id: any;
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
+ import { RawEditorSettings } from 'tinymce';
8
9
  export declare type CopyProps<T> = {
9
10
  [P in keyof T]: any;
10
11
  };
@@ -12,7 +13,7 @@ export interface IPropTypes {
12
13
  apiKey: string;
13
14
  cloudChannel: string;
14
15
  id: string;
15
- init: any;
16
+ init: RawEditorSettings;
16
17
  initialValue: string;
17
18
  outputFormat: 'html' | 'text';
18
19
  inline: boolean;
@@ -1,11 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2018-present, Ephox, Inc.
4
- *
5
- * This source code is licensed under the Apache 2 license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- *
8
- */
9
2
  Object.defineProperty(exports, "__esModule", { value: true });
10
3
  exports.editorProps = void 0;
11
4
  exports.editorProps = {
@@ -7,10 +7,11 @@
7
7
  */
8
8
  import { Ref, SetupContext } from 'vue';
9
9
  import { IPropTypes } from './components/EditorPropTypes';
10
+ import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
10
11
  declare const isValidKey: (key: string) => boolean;
11
- declare const bindHandlers: (initEvent: Event, listeners: any, editor: any) => void;
12
- declare const bindModelHandlers: (props: IPropTypes, ctx: SetupContext, editor: any, modelValue: Ref<any>) => void;
13
- declare const initEditor: (initEvent: Event, props: IPropTypes, ctx: SetupContext, editor: any, modelValue: Ref<any>, content: () => string) => void;
12
+ declare const bindHandlers: (initEvent: EditorEvent<any>, listeners: any, editor: TinyMCEEditor) => void;
13
+ declare const bindModelHandlers: (props: IPropTypes, ctx: SetupContext, editor: TinyMCEEditor, modelValue: Ref<any>) => void;
14
+ declare const initEditor: (initEvent: EditorEvent<any>, props: IPropTypes, ctx: SetupContext, editor: TinyMCEEditor, modelValue: Ref<any>, content: () => string) => void;
14
15
  declare const uuid: (prefix: string) => string;
15
16
  declare const isTextarea: (element: Element | null) => element is HTMLTextAreaElement;
16
17
  declare const mergePlugins: (initPlugins: string | string[], inputPlugins?: string | string[] | undefined) => string[];
@@ -6,6 +6,21 @@
6
6
  *
7
7
  */
8
8
  export declare const Editor: import("vue").DefineComponent<import("./EditorPropTypes").CopyProps<import("./EditorPropTypes").IPropTypes>, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
9
+ apiKey?: unknown;
10
+ cloudChannel?: unknown;
11
+ id?: unknown;
12
+ init?: unknown;
13
+ initialValue?: unknown;
14
+ outputFormat?: unknown;
15
+ inline?: unknown;
16
+ modelEvents?: unknown;
17
+ plugins?: unknown;
18
+ tagName?: unknown;
19
+ toolbar?: unknown;
20
+ modelValue?: unknown;
21
+ disabled?: unknown;
22
+ tinymceScriptSrc?: unknown;
23
+ } & {
9
24
  apiKey: any;
10
25
  cloudChannel: any;
11
26
  id: any;
@@ -20,7 +35,7 @@ export declare const Editor: import("vue").DefineComponent<import("./EditorPropT
20
35
  modelValue: any;
21
36
  disabled: any;
22
37
  tinymceScriptSrc: any;
23
- } & {}>, {
38
+ } & {}> & {}, {
24
39
  apiKey: any;
25
40
  cloudChannel: any;
26
41
  id: any;
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
+ import { RawEditorSettings } from 'tinymce';
8
9
  export declare type CopyProps<T> = {
9
10
  [P in keyof T]: any;
10
11
  };
@@ -12,7 +13,7 @@ export interface IPropTypes {
12
13
  apiKey: string;
13
14
  cloudChannel: string;
14
15
  id: string;
15
- init: any;
16
+ init: RawEditorSettings;
16
17
  initialValue: string;
17
18
  outputFormat: 'html' | 'text';
18
19
  inline: boolean;
@@ -1,10 +1,3 @@
1
- /**
2
- * Copyright (c) 2018-present, Ephox, Inc.
3
- *
4
- * This source code is licensed under the Apache 2 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
1
  export var editorProps = {
9
2
  apiKey: String,
10
3
  cloudChannel: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinymce/tinymce-vue",
3
- "version": "4.0.4",
3
+ "version": "4.0.5-feature.20211117013517127.sha4692fc8",
4
4
  "description": "Official TinyMCE Vue 3 Component",
5
5
  "private": false,
6
6
  "repository": {
@@ -47,34 +47,38 @@
47
47
  "@storybook/addon-notes": "^5.3.21",
48
48
  "@storybook/storybook-deployer": "^2.8.10",
49
49
  "@storybook/vue3": "^6.4.0-alpha.9",
50
- "@tinymce/beehive-flow": "^0.15.0",
50
+ "@tinymce/beehive-flow": "^0.17.0",
51
51
  "@tinymce/eslint-plugin": "^1.9.1",
52
52
  "@tinymce/miniature": "^3.2.0",
53
- "@types/node": "^13.13.4",
53
+ "@types/node": "^16.7.1",
54
+ "@vue/compiler-sfc": "^3.0.0",
54
55
  "babel-loader": "^8.0.5",
55
56
  "babel-preset-vue": "^2.0.2",
56
57
  "babel-register": "^6.26.0",
57
- "css-loader": "^3.5.3",
58
+ "css-loader": "^6.2.0",
58
59
  "file-loader": "^6.0.0",
59
- "react": "^16.8.6",
60
- "react-dom": "^16.8.6",
60
+ "react": "^16.14.0",
61
+ "react-dom": "^16.14.0",
62
+ "regenerator-runtime": "^0.13.9",
61
63
  "rimraf": "^3.0.2",
62
- "rollup": "^2.7.5",
64
+ "rollup": "^1.32.1",
63
65
  "rollup-plugin-node-resolve": "^5.2.0",
64
- "rollup-plugin-typescript2": "^0.27.0",
66
+ "rollup-plugin-typescript2": "^0.30.0",
65
67
  "rollup-plugin-uglify": "^6.0.0",
66
- "tinymce": "npm:tinymce@^5.0.0",
67
- "tinymce-4": "npm:tinymce@^4.9.7",
68
- "tinymce-5": "npm:tinymce@^5.0.0",
69
- "ts-loader": "^7.0.1",
70
- "ts-node": "^8.9.1",
71
- "typescript": "^3.2.2",
68
+ "tinymce-4": "npm:tinymce@^4",
69
+ "tinymce-5": "npm:tinymce@^5",
70
+ "ts-loader": "^9.2.5",
71
+ "ts-node": "^10.2.1",
72
72
  "tsconfig-paths-webpack-plugin": "^3.5.1",
73
- "vite": "^1.0.0-rc.4",
73
+ "typescript": "^4.3.5",
74
+ "vite": "^2.5.1",
75
+ "vue": "^3.0.0",
74
76
  "vue-loader": "^15.2.1",
75
77
  "vue-router": "^4.0.0-beta.13",
76
78
  "vue-template-compiler": "^2.6.14",
77
- "webpack": "^4.43.0"
79
+ "webpack": "^5.51.1"
78
80
  },
79
- "dependencies": {}
81
+ "dependencies": {
82
+ "tinymce": "^5.5.0"
83
+ }
80
84
  }