@tinymce/tinymce-jquery 2.0.1-rc.20221223041719263.shabd1f54a → 2.1.0

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,19 +5,26 @@ 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
+
9
+ ## 2.1.0 - 2023-03-27
10
+
8
11
  ### Fixed
9
12
  - Updated CI library to latest
13
+ - Updated dependencies
10
14
 
11
15
  ## 2.0.0 - 2022-04-08
16
+
12
17
  ### Changed
13
18
  - Set default cloudChannel to 6
14
19
  - Updated dependencies
15
20
 
16
21
  ## 1.0.1 - 2022-03-15
22
+
17
23
  ### Fixed
18
24
  - Set release version in changelog.
19
25
 
20
26
  ## 1.0.0 - 2022-03-15
27
+
21
28
  ### Added
22
29
  - Initial release of the TinyMCE jQuery integration as a separate node module.
23
30
 
@@ -25,11 +32,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
32
  - The `$(e).tinymce({...})` now returns a `Promise` of all initialized editors instead of the `this` object.
26
33
  - The `$(e).tinymce()` now returns `undefined` when no editor is present instead of `null`.
27
34
 
28
- ### Removed
29
- - Removed the patch on `replaceAll` as it was inconsistent with other functions. Due to this change calling `replaceAll` will not automatically destroy any moved or overwritten TinyMCE instances though they will likely be left in a non-functional state.
30
- - Removed the patch on `replaceWith` as it was inconsistent with other functions. Due to this change calling `replaceWith` will not automatically destroy any moved or overwritten TinyMCE instances though they will likely be left in a non-functional state.
31
-
32
35
  ### Fixed
33
36
  - Removing an element with `$(e).remove()` destroys all contained editors.
34
37
  - Removing child elements with `$(e).empty()` destroys all contained editors.
35
- - Overwriting an element with `$(e).text(value)` or `$(e).html(value)` destroys all contained editors
38
+ - Overwriting an element with `$(e).text(value)` or `$(e).html(value)` destroys all contained editors
39
+
40
+ ### Removed
41
+ - Removed the patch on `replaceAll` as it was inconsistent with other functions. Due to this change calling `replaceAll` will not automatically destroy any moved or overwritten TinyMCE instances though they will likely be left in a non-functional state.
42
+ - Removed the patch on `replaceWith` as it was inconsistent with other functions. Due to this change calling `replaceWith` will not automatically destroy any moved or overwritten TinyMCE instances though they will likely be left in a non-functional state.
@@ -439,7 +439,10 @@
439
439
  var getEditors = function (tinymce, self) {
440
440
  var out = [];
441
441
  self.each(function (i, ele) {
442
- out.push(tinymce.get(ele.id));
442
+ var ed = tinymce.get(ele.id);
443
+ if (ed != null) {
444
+ out.push(ed);
445
+ }
443
446
  });
444
447
  return out;
445
448
  };
@@ -1 +1 @@
1
- !function(){"use strict";var u=function(){return(u=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)},t="undefined"!=typeof window?window:Function("return this;")(),e=function(){var n;return null!=(n=t&&t.jQuery)?n:null},a=function(){var n=e();if(null!=n)return n;throw new Error("Expected global jQuery")};const r=(n,t,e)=>{return!!e(n,t.prototype)||(null==(e=n.constructor)?void 0:e.name)===t.name};var i,n=t=>n=>(n=>{var t=typeof n;return null===n?"null":"object"==t&&Array.isArray(n)?"array":"object"==t&&r(n,String,(n,t)=>t.isPrototypeOf(n))?"string":t})(n)===t;const f=n("string"),o=n("object"),c=n("array"),s=(i="function",n=>typeof n===i),v=Object.keys,h=Object.hasOwnProperty,l="undefined"!=typeof window?window:Function("return this;")(),p=(n,e)=>{n=n.split(".");{var r=n;let t=null!=(n=e)?n:l;for(let n=0;n<r.length&&void 0!==t&&null!==t;++n)t=t[r[n]];return t}},d=(n,t)=>{e=n,t=t;var e=p(e,t);if(null==e)throw new Error(n+" not available on this browser");return e},y=Object.getPrototypeOf,g=n=>{var t=p("ownerDocument.defaultView",n);return o(n)&&(t=t,d("HTMLElement",t).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(y(n).constructor.name))};function m(){var n;return null!=(n=t.tinymce)?n:null}function O(n,t,e){var r=j(n);return r?t(r):e?e(n):void 0}function w(e,r){e.each(function(n,t){return O(t,function(n){return r(n,t,e)})})}function D(n){var o,l;l=function(n){return n.remove()},(o=n).each(function(n,t){for(var e=0,r=L().get();e<r.length;e++){var i=r[e];if($.contains(t,i.getContentAreaContainer())&&!1===l(i,t,o))return!1}})}function _(n){w(n,function(n){return n.remove()}),D(n)}function I(c){return function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];function r(i){void 0!==i&&(D(t),t.each(function(e,r){return O(r,function(n){var t=s(i)?i.call(r,e,n.getContent()):i;void 0!==t&&n.setContent(null===t?"":"".concat(t))},function(n){var t;s(i)?(t=c.call($(n),"value"),t=i.call(n,e,t),c.call($(n),"value",t)):c.call($(n),"value",i)})}))}var i,o=n[0];if(f(o)){if("value"!==o)return c.apply(this,n);var l=n[1];return void 0!==l?(r(l),this):1<=this.length?O(this[0],function(n){return n.getContent()},function(n){return c.call(t,"value")}):void 0}return l=u({},o),o=l,i="value",h.call(o,i)&&(r(l.value),delete l.value),0<v(l).length?c.call(this,l):this}}function N(n,t){var e=document.createElement("div");return n.apply($(e),t),e.innerHTML}function b(l,c){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e,i,r,o="prepend"===c;return i=1===t.length&&s(t[0])?(e=t[0],function(n,t){return N(l,[e.call(n,0,t)])}):(r=t,(t=>{let e=!1,r;return(...n)=>(e||(e=!0,r=t.apply(null,n)),r)})(function(n,t){return N(l,r)})),this.each(function(n,r){return O(r,function(n){var t=n.getContent(),e=i(r,t);n.setContent(o?e+t:t+e)},function(n){l.apply($(n),t)})}),this}}function A(l){return function(o){return 0!==arguments.length?(D(this),this.each(function(r,i){O(i,function(n){var t,e=s(o)?o.call(i,r,n.getContent()):o,e=f(e)?e:(g(e)&&_($(e)),t=document.createElement("div"),l.call($(t),null!=e?e:""),t.innerHTML);n.setContent(e)},function(n){var t;s(o)?(t=l.call($(i)),t=o.call(i,r,t),l.call($(i),t)):l.call($(n),null!=o?o:"")})}),this):1<=this.length?O(this[0],function(n){return n.getContent()},function(n){return l.call($(n))}):void 0}}function E(l){var n,c=this;return this.length?l?(this.css("visibility","hidden"),new Promise(function(o){H(k(l),function(e,n){n&&l.script_loaded&&l.script_loaded(),S||(S=!0,P(a()));function r(){var n=F(e,c);t&&t(n),o(n)}var i=0,t=M(e,l.oninit);c.each(function(n,t){t.id||(t.id=e.DOM.uniqueId()),e.get(t.id)?i++:e.init(u(u({},l),{selector:void 0,target:t,init_instance_callback:function(n){c.css("visibility",""),i++;var t=l.init_instance_callback;"function"==typeof t&&t.call(n,n),i===c.length&&r()}}))}),i===c.length&&r()})})):null!=(n=j(this[0]))?n:void 0:l?Promise.resolve([]):void 0}var C,T=function(){return!!m()},L=function(){var n=m();if(null!=n)return n;throw new Error("Expected global tinymce")},j=function(n){var t=null;return t=n&&n.id&&T()?L().get(n.id):t},G=((n=C=C||{})[n.NOT_LOADING=0]="NOT_LOADING",n[n.LOADING_STARTED=1]="LOADING_STARTED",n[n.LOADING_FINISHED=2]="LOADING_FINISHED",C.NOT_LOADING),x=[],H=function(n,r){var t;T()||G!==C.NOT_LOADING?G===C.LOADING_STARTED?x.push(r):r(L(),!1):(G=C.LOADING_STARTED,(t=document.createElement("script")).type="text/javascript",t.onload=function(n){if(G!==C.LOADING_FINISHED&&"load"===n.type){G=C.LOADING_FINISHED;var t=L();r(t,!0);for(var e=0;e<x.length;e++)x[e](t,!1)}},t.src=n,document.body.appendChild(t))},P=function(n){var l,o,t,e;n.fn.html=A(n.fn.html),n.fn.text=(l=n.fn.text,function(o){var e;return 0===arguments.length?(e="",this.each(function(n,t){e+=O(t,function(n){return n.getContent({format:"text"})},function(n){return l.call($(n))})}),e):(D(this),this.each(function(r,i){O(i,function(n){var t=s(o)?o.call(i,r,n.getContent({format:"text"})):o,e=document.createElement("div");e.innerText="".concat(t),n.setContent(e.innerHTML)},function(n){var t;s(o)?(t=l.call($(i)),t=o.call(i,r,t),l.call($(i),t)):l.call($(n),null!=o?o:"")})}),this)}),n.fn.val=(o=n.fn.val,function(i){return 0===arguments.length?1<=this.length?O(this[0],function(n){return n.getContent()},function(n){return o.call($(n))}):void 0:(this.each(function(e,r){O(r,function(n){var t=s(i)?i.call(r,e,n.getContent()):null!=i?i:"",t=c(t)?t.join(""):"".concat(t);n.setContent(t)},function(n){var t;s(i)?(t=o.call($(r)),t=i.call(r,e,null!=t?t:""),o.call($(r),t)):o.call($(n),null!=i?i:"")})}),this)}),n.fn.append=b(n.fn.append,"append"),n.fn.prepend=b(n.fn.prepend,"prepend"),n.fn.remove=(t=n.fn.remove,function(n){return _(void 0!==n?this.filter(n):this),t.call(this,n)}),n.fn.empty=(e=n.fn.empty,function(){return D(this),w(this,function(n){n.setContent("")}),e.call(this)}),n.fn.attr=I(n.fn.attr)},k=function(n){var t;return"string"==typeof n.script_url?n.script_url:(t="string"==typeof n.channel?n.channel:"6",n="string"==typeof n.api_key?n.api_key:"no-api-key","https://cdn.tiny.cloud/1/".concat(n,"/tinymce/").concat(t,"/tinymce.min.js"))},F=function(e,n){var r=[];return n.each(function(n,t){r.push(e.get(t.id))}),r},M=function(n,t){if("string"==typeof t){var e,r=n.resolve(t);if("function"==typeof r)return e=-1===t.indexOf(".")?n:n.resolve(t.replace(/\.\w+$/,"")),r.bind(e)}else if("function"==typeof t)return t.bind(n);return null},S=!1;(n=a()).expr.pseudos.tinymce=function(n){return!!j(n)},n.fn.tinymce=E}();
1
+ !function(){"use strict";var n=function(){return n=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n},n.apply(this,arguments)},t="undefined"!=typeof window?window:Function("return this;")(),e=function(){var n,e=null!==(n=t&&t.jQuery)&&void 0!==n?n:null;if(null!=e)return e;throw new Error("Expected global jQuery")};const r=n=>t=>(n=>{const t=typeof n;return null===n?"null":"object"===t&&Array.isArray(n)?"array":"object"===t&&(e=i=n,r=(o=String).prototype,r.isPrototypeOf(e)||(null===(u=i.constructor)||void 0===u?void 0:u.name)===o.name)?"string":t;var e,r;var i,o,u})(t)===n,i=r("string"),o=r("object"),u=r("array"),l=(c="function",n=>typeof n===c);var c;const a=Object.keys,f=Object.hasOwnProperty,s="undefined"!=typeof window?window:Function("return this;")(),v=(n,t)=>((n,t)=>{let e=null!=t?t:s;for(let t=0;t<n.length&&null!=e;++t)e=e[n[t]];return e})(n.split("."),t),h=(n,t)=>{const e=((n,t)=>v(n,t))(n,t);if(null==e)throw new Error(n+" not available on this browser");return e},p=Object.getPrototypeOf,d=n=>{const t=v("ownerDocument.defaultView",n);return o(n)&&((n=>h("HTMLElement",n))(t).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(p(n).constructor.name))};var y,g=function(){var n;return null!==(n=t.tinymce)&&void 0!==n?n:null},m=function(){return!!g()},O=function(){var n=g();if(null!=n)return n;throw new Error("Expected global tinymce")},w=function(n){var t=null;return n&&n.id&&m()&&(t=O().get(n.id)),t},D=function(n,t,e){var r=w(n);return r?t(r):e?e(n):void 0};!function(n){n[n.NOT_LOADING=0]="NOT_LOADING",n[n.LOADING_STARTED=1]="LOADING_STARTED",n[n.LOADING_FINISHED=2]="LOADING_FINISHED"}(y||(y={}));var _,I=y.NOT_LOADING,N=[],b=function(n,t){n.each((function(e,r){return D(r,(function(e){return t(e,r,n)}))}))},A=function(n){return function(n,t){n.each((function(e,r){for(var i=0,o=O().get();i<o.length;i++){var u=o[i];if($.contains(r,u.getContentAreaContainer())&&!1===t(u,r,n))return!1}}))}(n,(function(n){return n.remove()}))},E=function(n){!function(n){b(n,(function(n){return n.remove()}))}(n),A(n)},C=function(t){return function(){for(var e=this,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var u=function(n){void 0!==n&&(A(e),e.each((function(e,r){return D(r,(function(t){var i=l(n)?n.call(r,e,t.getContent()):n;void 0!==i&&t.setContent(null===i?"":"".concat(i))}),(function(r){if(l(n)){var i=t.call($(r),"value"),o=n.call(r,e,i);t.call($(r),"value",o)}else t.call($(r),"value",n)}))})))},c=r[0];if(i(c)){if("value"!==c)return t.apply(this,r);var s=r[1];return void 0!==s?(u(s),this):this.length>=1?D(this[0],(function(n){return n.getContent()}),(function(n){return t.call(e,"value")})):void 0}var v,h,p=n({},c);return v=p,h="value",f.call(v,h)&&(u(p.value),delete p.value),a(p).length>0?t.call(this,p):this}},T=function(n,t){var e=document.createElement("div");return n.apply($(e),t),e.innerHTML},L=function(n,t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i,o="prepend"===t;if(1===e.length&&l(e[0])){var u=e[0];i=function(t,e){return T(n,[u.call(t,0,e)])}}else{var c=e;i=(n=>{let t,e=!1;return(...r)=>(e||(e=!0,t=n.apply(null,r)),t)})((function(t,e){return T(n,c)}))}return this.each((function(t,r){return D(r,(function(n){var t=n.getContent(),e=i(r,t);n.setContent(o?e+t:t+e)}),(function(t){n.apply($(t),e)}))})),this}},j=function(n){var t;n.fn.html=(t=n.fn.html,function(n){return 0===arguments.length?this.length>=1?D(this[0],(function(n){return n.getContent()}),(function(n){return t.call($(n))})):void 0:(A(this),this.each((function(e,r){D(r,(function(o){var u=l(n)?n.call(r,e,o.getContent()):n,c=i(u)?u:function(){d(u)&&E($(u));var n=document.createElement("div");return t.call($(n),null!=u?u:""),n.innerHTML}();o.setContent(c)}),(function(i){if(l(n)){var o=t.call($(r)),u=n.call(r,e,o);t.call($(r),u)}else t.call($(i),null!=n?n:"")}))})),this)}),n.fn.text=function(n){return function(t){if(0===arguments.length){var e="";return this.each((function(t,r){e+=D(r,(function(n){return n.getContent({format:"text"})}),(function(t){return n.call($(t))}))})),e}return A(this),this.each((function(e,r){D(r,(function(n){var i=l(t)?t.call(r,e,n.getContent({format:"text"})):t,o=document.createElement("div");o.innerText="".concat(i),n.setContent(o.innerHTML)}),(function(i){if(l(t)){var o=n.call($(r)),u=t.call(r,e,o);n.call($(r),u)}else n.call($(i),null!=t?t:"")}))})),this}}(n.fn.text),n.fn.val=function(n){return function(t){return 0===arguments.length?this.length>=1?D(this[0],(function(n){return n.getContent()}),(function(t){return n.call($(t))})):void 0:(this.each((function(e,r){D(r,(function(n){var i=l(t)?t.call(r,e,n.getContent()):null!=t?t:"",o=u(i)?i.join(""):"".concat(i);n.setContent(o)}),(function(i){if(l(t)){var o=n.call($(r)),u=t.call(r,e,null!=o?o:"");n.call($(r),u)}else n.call($(i),null!=t?t:"")}))})),this)}}(n.fn.val),n.fn.append=L(n.fn.append,"append"),n.fn.prepend=L(n.fn.prepend,"prepend"),n.fn.remove=function(n){return function(t){return E(void 0!==t?this.filter(t):this),n.call(this,t)}}(n.fn.remove),n.fn.empty=function(n){return function(){return A(this),b(this,(function(n){n.setContent("")})),n.call(this)}}(n.fn.empty),n.fn.attr=C(n.fn.attr)},G=!1,x=function(t){var r,i=this;return this.length?t?(this.css("visibility","hidden"),new Promise((function(r){!function(n,t){if(m()||I!==y.NOT_LOADING)I===y.LOADING_STARTED?N.push(t):t(O(),!1);else{I=y.LOADING_STARTED;var e=document.createElement("script");e.type="text/javascript",e.onload=function(n){if(I!==y.LOADING_FINISHED&&"load"===n.type){I=y.LOADING_FINISHED;var e=O();t(e,!0);for(var r=0;r<N.length;r++)N[r](e,!1)}},e.src=n,document.body.appendChild(e)}}(function(n){if("string"==typeof n.script_url)return n.script_url;var t="string"==typeof n.channel?n.channel:"6",e="string"==typeof n.api_key?n.api_key:"no-api-key";return"https://cdn.tiny.cloud/1/".concat(e,"/tinymce/").concat(t,"/tinymce.min.js")}(t),(function(o,u){u&&t.script_loaded&&t.script_loaded(),G||(G=!0,j(e()));var l=0,c=function(n,t){if("string"==typeof t){var e=n.resolve(t);if("function"==typeof e){var r=-1===t.indexOf(".")?n:n.resolve(t.replace(/\.\w+$/,""));return e.bind(r)}}else if("function"==typeof t)return t.bind(n);return null}(o,t.oninit),a=function(){var n=function(n,t){var e=[];return t.each((function(t,r){var i=n.get(r.id);null!=i&&e.push(i)})),e}(o,i);c&&c(n),r(n)};i.each((function(e,r){if(r.id||(r.id=o.DOM.uniqueId()),o.get(r.id))l++;else{o.init(n(n({},t),{selector:void 0,target:r,init_instance_callback:function(n){i.css("visibility",""),l++;var e=t.init_instance_callback;"function"==typeof e&&e.call(n,n),l===i.length&&a()}}))}})),l===i.length&&a()}))}))):null!==(r=w(this[0]))&&void 0!==r?r:void 0:t?Promise.resolve([]):void 0};(_=e()).expr.pseudos.tinymce=function(n){return!!w(n)},_.fn.tinymce=x}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinymce/tinymce-jquery",
3
- "version": "2.0.1-rc.20221223041719263.shabd1f54a",
3
+ "version": "2.1.0",
4
4
  "description": "Official TinyMCE integration for jQuery",
5
5
  "main": "dist/tinymce-jquery.js",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "registry": "https://registry.npmjs.org/"
15
15
  },
16
16
  "scripts": {
17
- "clean": "rimraf lib list",
17
+ "clean": "rimraf lib dist scratch",
18
18
  "test": "bedrock-auto -b chrome-headless -d src/test/ts",
19
19
  "test-manual": "bedrock -d src/test/ts",
20
20
  "build": "yarn run clean && tsc -p ./tsconfig.json && rollup -c rollup.config.js",
@@ -27,35 +27,38 @@
27
27
  "author": "Tiny Technologies",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@babel/core": "^7.17.9",
31
- "@ephox/agar": "^7.0.1",
30
+ "@babel/core": "^7.21.3",
31
+ "@ephox/agar": "^7.4.1",
32
32
  "@ephox/bedrock-client": "^13.0.0",
33
- "@ephox/bedrock-server": "^13.1.0",
34
- "@ephox/katamari": "^9.0.1",
35
- "@ephox/mcagar": "^8.0.1",
36
- "@ephox/sand": "^6.0.1",
37
- "@ephox/sugar": "^9.0.1",
38
- "@ephox/swag": "^4.5.0",
39
- "@storybook/addon-actions": "^6.4.20",
40
- "@storybook/addon-essentials": "^6.4.20",
41
- "@storybook/addon-links": "^6.4.20",
42
- "@storybook/html": "^6.4.20",
43
- "@storybook/storybook-deployer": "^2.8.11",
33
+ "@ephox/bedrock-server": "^13.3.0",
34
+ "@ephox/katamari": "^9.1.5",
35
+ "@ephox/mcagar": "^8.3.2",
36
+ "@ephox/sand": "^6.0.9",
37
+ "@ephox/sugar": "^9.2.1",
38
+ "@ephox/swag": "^4.6.0",
39
+ "@rollup/plugin-terser": "^0.4.0",
40
+ "@storybook/addon-actions": "^6.5.16",
41
+ "@storybook/addon-essentials": "^6.5.16",
42
+ "@storybook/addon-interactions": "^6.5.16",
43
+ "@storybook/addon-links": "^6.5.16",
44
+ "@storybook/builder-webpack5": "^6.5.16",
45
+ "@storybook/html": "^6.5.16",
46
+ "@storybook/manager-webpack5": "^6.5.16",
47
+ "@storybook/storybook-deployer": "^2.8.16",
48
+ "@storybook/testing-library": "^0.0.13",
44
49
  "@tinymce/beehive-flow": "^0.19.0",
45
- "@tinymce/eslint-plugin": "^2.0.1",
46
- "@types/express": "^4.17.13",
47
- "@types/jquery": "^3.5.13",
48
- "babel-loader": "^8.2.4",
50
+ "@tinymce/eslint-plugin": "^2.2.1",
51
+ "@types/jquery": "^3.5.16",
52
+ "@types/react": "^17.0.0",
53
+ "babel-loader": "^8.3.0",
49
54
  "react": "^17.0.0",
50
55
  "react-dom": "^17.0.0",
51
- "rimraf": "^3.0.2",
52
- "rollup": "^2.70.1",
53
- "rollup-plugin-uglify": "^6.0.4",
54
- "tinymce": "^6.0.1",
55
- "ts-loader": "^9.2.8",
56
- "tslib": "^2.3.1",
57
- "typescript": "^4.6.3",
58
- "webpack": "^5.72.0"
56
+ "rimraf": "^4.4.1",
57
+ "rollup": "^3.20.2",
58
+ "tinymce": "^6.4.0",
59
+ "tslib": "^2.5.0",
60
+ "typescript": "~4.8.3",
61
+ "webpack": "^5.9.0"
59
62
  },
60
63
  "dependencies": {}
61
64
  }