@tinymce/tinymce-jquery 2.2.0 → 2.2.1-feature.20260518023456511.sha4124e3c

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
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ### Changed
10
+
11
+ - Updated to support jQuery 4. #INT-3359
12
+
9
13
  ## 2.2.0 - 2025-10-16
10
14
 
11
15
  ### Fixed
package/README.md CHANGED
@@ -23,4 +23,7 @@ Have you found an issue with tinymce-jquery or do you have a feature request?
23
23
  Open up an [issue](https://github.com/tinymce/tinymce-jquery/issues) and let us
24
24
  know or submit a [pull request](https://github.com/tinymce/tinymce-jquery/pulls).
25
25
  *Note: For issues concerning TinyMCE please visit the
26
- [TinyMCE repository](https://github.com/tinymce/tinymce).*
26
+ [TinyMCE repository](https://github.com/tinymce/tinymce).*
27
+
28
+
29
+ ## Compatibility
@@ -526,7 +526,11 @@
526
526
  };
527
527
  var setupIntegration = function () {
528
528
  var jq = getJquery();
529
- jq.expr.pseudos.tinymce = function (e) {
529
+ jq.expr.pseudos.tinymce = jq.expr.createPseudo ? jq.expr.createPseudo(function (_text) {
530
+ return function (elem) {
531
+ return !!getTinymceInstance(elem);
532
+ };
533
+ }) : function (e) {
530
534
  return !!getTinymceInstance(e);
531
535
  };
532
536
  jq.fn.tinymce = tinymceFn;
@@ -1 +1 @@
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)};"function"==typeof SuppressedError&&SuppressedError;var 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"),c=(l="function",n=>typeof n===l);var l;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 E,_=y.NOT_LOADING,I=[],N=function(n,t){n.each(function(e,r){return D(r,function(e){return t(e,r,n)})})},b=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()})},A=function(n){!function(n){N(n,function(n){return n.remove()})}(n),b(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&&(b(e),e.each(function(e,r){return D(r,function(t){var i=c(n)?n.call(r,e,t.getContent()):n;void 0!==i&&t.setContent(null===i?"":"".concat(i))},function(r){if(c(n)){var i=t.call($(r),"value"),o=n.call(r,e,i);t.call($(r),"value",o)}else t.call($(r),"value",n)})}))},l=r[0];if(i(l)){if("value"!==l)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({},l);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&&c(e[0])){var u=e[0];i=function(t,e){return T(n,[u.call(t,0,e)])}}else{var l=e;i=(n=>{let t,e=!1;return(...r)=>(e||(e=!0,t=n.apply(null,r)),t)})(function(t,e){return T(n,l)})}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:(b(this),this.each(function(e,r){D(r,function(o){var u=c(n)?n.call(r,e,o.getContent()):n,l=i(u)?u:function(){d(u)&&A($(u));var n=document.createElement("div");return t.call($(n),null!=u?u:""),n.innerHTML}();o.setContent(l)},function(i){if(c(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 b(this),this.each(function(e,r){D(r,function(n){var i=c(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(c(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=c(t)?t.call(r,e,n.getContent()):null!=t?t:"",o=u(i)?i.join(""):"".concat(i);n.setContent(o)},function(i){if(c(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 A(void 0!==t?this.filter(t):this),n.call(this,t)}}(n.fn.remove),n.fn.empty=function(n){return function(){return b(this),N(this,function(n){n.setContent("")}),n.call(this)}}(n.fn.empty),n.fn.attr=C(n.fn.attr)},G=!1,S=function(t){var r,i=this;return this.length?t?(this.css("visibility","hidden"),new Promise(function(r){!function(n,t){if(m()||_!==y.NOT_LOADING)_===y.LOADING_STARTED?I.push(t):t(O(),!1);else{_=y.LOADING_STARTED;var e=document.createElement("script");e.type="text/javascript",e.onload=function(n){if(_!==y.LOADING_FINISHED&&"load"===n.type){_=y.LOADING_FINISHED;var e=O();t(e,!0);for(var r=0;r<I.length;r++)I[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:"8",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 c=0,l=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);l&&l(n),r(n)};i.each(function(e,r){if(r.id||(r.id=o.DOM.uniqueId()),o.get(r.id))c++;else{o.init(n(n({},t),{selector:void 0,target:r,init_instance_callback:function(n){i.css("visibility",""),c++;var e=t.init_instance_callback;"function"==typeof e&&e.call(n,n),c===i.length&&a()}})).catch(function(n){console.error("TinyMCE init failed",n)})}}),c===i.length&&a()})})):null!==(r=w(this[0]))&&void 0!==r?r:void 0:t?Promise.resolve([]):void 0};(E=e()).expr.pseudos.tinymce=function(n){return!!w(n)},E.fn.tinymce=S}();
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)};"function"==typeof SuppressedError&&SuppressedError;var 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"),c=(l="function",n=>typeof n===l);var l;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 E,_=y.NOT_LOADING,I=[],N=function(n,t){n.each(function(e,r){return D(r,function(e){return t(e,r,n)})})},b=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()})},A=function(n){!function(n){N(n,function(n){return n.remove()})}(n),b(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&&(b(e),e.each(function(e,r){return D(r,function(t){var i=c(n)?n.call(r,e,t.getContent()):n;void 0!==i&&t.setContent(null===i?"":"".concat(i))},function(r){if(c(n)){var i=t.call($(r),"value"),o=n.call(r,e,i);t.call($(r),"value",o)}else t.call($(r),"value",n)})}))},l=r[0];if(i(l)){if("value"!==l)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({},l);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&&c(e[0])){var u=e[0];i=function(t,e){return T(n,[u.call(t,0,e)])}}else{var l=e;i=(n=>{let t,e=!1;return(...r)=>(e||(e=!0,t=n.apply(null,r)),t)})(function(t,e){return T(n,l)})}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:(b(this),this.each(function(e,r){D(r,function(o){var u=c(n)?n.call(r,e,o.getContent()):n,l=i(u)?u:function(){d(u)&&A($(u));var n=document.createElement("div");return t.call($(n),null!=u?u:""),n.innerHTML}();o.setContent(l)},function(i){if(c(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 b(this),this.each(function(e,r){D(r,function(n){var i=c(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(c(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=c(t)?t.call(r,e,n.getContent()):null!=t?t:"",o=u(i)?i.join(""):"".concat(i);n.setContent(o)},function(i){if(c(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 A(void 0!==t?this.filter(t):this),n.call(this,t)}}(n.fn.remove),n.fn.empty=function(n){return function(){return b(this),N(this,function(n){n.setContent("")}),n.call(this)}}(n.fn.empty),n.fn.attr=C(n.fn.attr)},x=!1,G=function(t){var r,i=this;return this.length?t?(this.css("visibility","hidden"),new Promise(function(r){!function(n,t){if(m()||_!==y.NOT_LOADING)_===y.LOADING_STARTED?I.push(t):t(O(),!1);else{_=y.LOADING_STARTED;var e=document.createElement("script");e.type="text/javascript",e.onload=function(n){if(_!==y.LOADING_FINISHED&&"load"===n.type){_=y.LOADING_FINISHED;var e=O();t(e,!0);for(var r=0;r<I.length;r++)I[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:"8",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(),x||(x=!0,j(e()));var c=0,l=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);l&&l(n),r(n)};i.each(function(e,r){if(r.id||(r.id=o.DOM.uniqueId()),o.get(r.id))c++;else{o.init(n(n({},t),{selector:void 0,target:r,init_instance_callback:function(n){i.css("visibility",""),c++;var e=t.init_instance_callback;"function"==typeof e&&e.call(n,n),c===i.length&&a()}})).catch(function(n){console.error("TinyMCE init failed",n)})}}),c===i.length&&a()})})):null!==(r=w(this[0]))&&void 0!==r?r:void 0:t?Promise.resolve([]):void 0};(E=e()).expr.pseudos.tinymce=E.expr.createPseudo?E.expr.createPseudo(function(n){return function(n){return!!w(n)}}):function(n){return!!w(n)},E.fn.tinymce=G}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinymce/tinymce-jquery",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-feature.20260518023456511.sha4124e3c",
4
4
  "description": "Official TinyMCE integration for jQuery",
5
5
  "main": "dist/tinymce-jquery.js",
6
6
  "files": [
@@ -19,15 +19,14 @@
19
19
  "test-manual": "bedrock -d src/test/ts",
20
20
  "build": "yarn run clean && tsc -p ./tsconfig.json && rollup -c rollup.config.js",
21
21
  "lint": "eslint src",
22
- "storybook": "start-storybook -p 6006",
23
- "build-storybook": "build-storybook",
22
+ "storybook": "storybook dev -p 6006",
23
+ "build-storybook": "storybook build",
24
24
  "deploy-storybook": "yarn storybook-to-ghpages --source-branch=main"
25
25
  },
26
26
  "repository": "https://github.com/tinymce/tinymce-jquery",
27
27
  "author": "Tiny Technologies",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@babel/core": "^7.21.3",
31
30
  "@ephox/agar": "^7.4.1",
32
31
  "@ephox/bedrock-client": "^14.0.0",
33
32
  "@ephox/bedrock-server": "^14.0.0",
@@ -37,28 +36,22 @@
37
36
  "@ephox/sugar": "^9.2.1",
38
37
  "@ephox/swag": "^4.6.0",
39
38
  "@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",
39
+ "@storybook/addon-docs": "^10.0.0",
40
+ "@storybook/addon-links": "^10.0.0",
41
+ "@storybook/html": "^10.0.0",
42
+ "@storybook/html-vite": "^10.0.0",
47
43
  "@storybook/storybook-deployer": "^2.8.16",
48
- "@storybook/testing-library": "^0.0.13",
49
44
  "@tinymce/beehive-flow": "^0.19.0",
50
45
  "@tinymce/eslint-plugin": "^3.0.0",
51
- "@types/jquery": "^3.5.16",
52
- "@types/react": "^17.0.0",
53
- "babel-loader": "^8.3.0",
54
- "react": "^17.0.0",
55
- "react-dom": "^17.0.0",
46
+ "@types/jquery": "^4.0.0",
56
47
  "rimraf": "^4.4.1",
57
48
  "rollup": "^3.20.2",
49
+ "storybook": "^10.0.0",
58
50
  "tinymce": "^8.0.1",
59
51
  "tslib": "^2.5.0",
60
52
  "typescript": "^5.9.3",
61
- "webpack": "^5.9.0"
53
+ "vite": "^8.0.0",
54
+ "vite-tsconfig-paths": "^6.1.1"
62
55
  },
63
56
  "dependencies": {},
64
57
  "resolutions": {