mirror of
https://github.com/zadam/trilium.git
synced 2024-11-18 21:55:26 +08:00
164 lines
242 KiB
JavaScript
164 lines
242 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditorInspector=t():e.CKEditorInspector=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=34)}([function(e,t,n){"use strict";e.exports=n(7)},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];null!=a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e,t){return t?t.querySelector(e):document.querySelector(e)},s=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=l.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),c=null,u=0,p=[],d=n(16);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=i[r.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(y(r.parts[a],t))}else{var l=[];for(a=0;a<r.parts.length;a++)l.push(y(r.parts[a],t));i[r.id]={id:r.id,refs:1,parts:l}}}}function h(e,t){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function m(e,t){var n=s(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=p[p.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),p.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=s(e.insertAt.before,n);n.insertBefore(t,o)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=p.indexOf(e);t>=0&&p.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y
|
||
|
/*
|
||
|
object-assign
|
||
|
(c) Sindre Sorhus
|
||
|
@license MIT
|
||
|
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,s=a(e),c=1;c<arguments.length;c++){for(var u in n=Object(arguments[c]))o.call(n,u)&&(s[u]=n[u]);if(r){l=r(n);for(var p=0;p<l.length;p++)i.call(n,l[p])&&(s[l[p]]=n[l[p]])}}return s}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=a(n(0)),c=n(11),u=l(n(12)),p={width:"auto",height:"auto"},d=u.default((function(e,t,n){return Math.max(Math.min(e,n),t)})),f=u.default((function(e,t){return Math.round(e/t)*t})),h=u.default((function(e,t){return new RegExp(e,"i").test(t)})),m=u.default((function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n}),0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e})),g=u.default((function(e,t){return e.substr(e.length-t.length,t.length)===t})),v=u.default((function(e){return"auto"===(e=e.toString())?e:g(e,"px")?e:g(e,"%")?e:g(e,"vh")?e:g(e,"vw")?e:g(e,"vmax")?e:g(e,"vmin")?e:e+"px"})),b=u.default((function(e,t,n,r,o){if(t&&"string"==typeof t&&g(t,"%")){var i=Number(t.replace("%",""))/100;t=e.width*i}if(n&&"string"==typeof n&&g(n,"%")){i=Number(n.replace("%",""))/100;n=e.height*i}if(r&&"string"==typeof r&&g(r,"%")){i=Number(r.replace("%",""))/100;r=e.width*i}if(o&&"string"==typeof o&&g(o,"%")){i=Number(o.replace("%",""))/100;o=e.height*i}return{maxWidth:void 0===t?void 0:Number(t),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===o?void 0:Number(o)}})),y=["style","className","grid","snap","bounds","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],k=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.extendsProps={},n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableTop=0,n.targetLeft=0,n.targetTop=0,n.state={isResizing:!1,resizeCursor:"auto",width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0}},n.updateExtendsProps(t),n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),"undefined"!=typeof window&&(window.addEventListener("mouseup",n.onMouseUp),window.addEventListener("mousemove",n.onMouseMove),window.addEventListener
|
||
|
/** @license React v16.10.2
|
||
|
* react.production.min.js
|
||
|
*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/var r=n(5),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,s=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,u=o?Symbol.for("react.provider"):60109,p=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,f=o?Symbol.for("react.suspense"):60113,h=o?Symbol.for("react.suspense_list"):60120,m=o?Symbol.for("react.memo"):60115,g=o?Symbol.for("react.lazy"):60116;o&&Symbol.for("react.fundamental"),o&&Symbol.for("react.responder"),o&&Symbol.for("react.scope");var v="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t=e.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return e.message="Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k={};function w(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||y}function x(){}function E(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||y}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw b(Error(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=w.prototype;var _=E.prototype=new x;_.constructor=E,r(_,w.prototype),_.isPureReactComponent=!0;var S={current:null},C={suspense:null},T={current:null},N=Object.prototype.hasOwnProperty,z={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var r,o={},a=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(a=""+t.key),t)N.call(t,r)&&!z.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:i,type:e,key:a,ref:l,props:o,_owner:T.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var O=/\/+/g,M=[];function D(e,t,n,r){if(M.length){var o=M.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function I(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>M.length&&M.push(e)}function L(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case a:s=!0}}if(s)return r(o,t,""===n?"."+A(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var u=n+A(l=t[c],c);s+=e(l,u,r,o)}else if(null===t||"object"!=typeof t?u=null:u="function"==typeof(u=v&&t[v]||t["@@iterator"])?u:null,"function"==typeof u)for(t=u.call(t),c=0;!(l=t.next()).done;)s+=e(l=l.value,u=n+A(l,c++),r,o);else if("object"===l)throw r=""+t,b(Error(31),"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return s}(e,"",t,n)}function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function j(e,t){e.func.call(e.context,t,e.count++)}function U(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?F(e,r,n,(function(e){return e})):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n)),r.push(e))}function F(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(O,"$&/")+"/"),L(e,U,t=D(t,i,r,o)),I(t)}function W(){var e=S.current;if(null===e)throw b(Error(321));return e}var H={Children:{map:funct
|
||
|
/** @license React v16.10.2
|
||
|
* react-dom.production.min.js
|
||
|
*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/var r=n(0),o=n(5),i=n(9);function a(e){for(var t=e.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return e.message="Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}if(!r)throw a(Error(227));var l=null,s={};function c(){if(l)for(var e in s){var t=s[e],n=l.indexOf(e);if(!(-1<n))throw a(Error(96),e);if(!p[n]){if(!t.extractEvents)throw a(Error(97),e);for(var r in p[n]=t,n=t.eventTypes){var o=void 0,i=n[r],c=t,f=r;if(d.hasOwnProperty(f))throw a(Error(99),f);d[f]=i;var h=i.phasedRegistrationNames;if(h){for(o in h)h.hasOwnProperty(o)&&u(h[o],c,f);o=!0}else i.registrationName?(u(i.registrationName,c,f),o=!0):o=!1;if(!o)throw a(Error(98),r,e)}}}}function u(e,t,n){if(f[e])throw a(Error(100),e);f[e]=t,h[e]=t.eventTypes[n].dependencies}var p=[],d={},f={},h={};function m(e,t,n,r,o,i,a,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var g=!1,v=null,b=!1,y=null,k={onError:function(e){g=!0,v=e}};function w(e,t,n,r,o,i,a,l,s){g=!1,v=null,m.apply(k,arguments)}var x=null,E=null,_=null;function S(e,t,n){var r=e.type||"unknown-event";e.currentTarget=_(n),function(e,t,n,r,o,i,l,s,c){if(w.apply(this,arguments),g){if(!g)throw a(Error(198));var u=v;g=!1,v=null,b||(b=!0,y=u)}}(r,t,void 0,e),e.currentTarget=null}function C(e,t){if(null==t)throw a(Error(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function T(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var N=null;function z(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)S(e,t[r],n[r]);else t&&S(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function P(e){if(null!==e&&(N=C(N,e)),e=N,N=null,e){if(T(e,z),N)throw a(Error(95));if(b)throw e=y,b=!1,y=null,e}}var R={injectEventPluginOrder:function(e){if(l)throw a(Error(101));l=Array.prototype.slice.call(e),c()},injectEventPluginsByName:function(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!s.hasOwnProperty(t)||s[t]!==r){if(s[t])throw a(Error(102),t);s[t]=r,n=!0}}n&&c()}};function O(e,t){var n=e.stateNode;if(!n)return null;var r=x(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw a(Error(231),t,typeof n);return n}var M=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;M.hasOwnProperty("ReactCurrentDispatcher")||(M.ReactCurrentDispatcher={current:null}),M.hasOwnProperty("ReactCurrentBatchConfig")||(M.ReactCurrentBatchConfig={suspense:null});var D=/^(.*)[\\\/]/,I="function"==typeof Symbol&&Symbol.for,L=I?Symbol.for("react.element"):60103,A=I?Symbol.for("react.portal"):60106,j=I?Symbol.for("react.fragment"):60107,U=I?Symbol.for("react.strict_mode"):60108,F=I?Symbol.for("react.profiler"):60114,W=I?Symbol.for("react.provider"):60109,H=I?Symbol.for("react.context"):60110,B=I?Symbol.for("react.concurrent_mode"):60111,V=I?Symbol.for("react.forward_ref"):60112,$=I?Symbol.for("react.suspense"):60113,Y=I?Symbol.for("react.suspense_list"):60120,Q=I?Symbol.for("react.memo"):60115,X=I?Symbol.for("react.lazy"):60116;I&&Symbol.for("react.fundamental"),I&&Symbol.for("react.responder"),I&&Symbol.for("react.scope");var G="function"==typeof Symbol&&Symbol.iterator;function K(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=G&&e[G]||e["@@iterator"])?e:null}function q(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case j:return"Fra
|
||
|
/** @license React v0.16.2
|
||
|
* scheduler.production.min.js
|
||
|
*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/var r,o,i,a,l;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,c=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},p=Date.now();t.unstable_now=function(){return Date.now()-p},r=function(e){null!==s?setTimeout(r,0,e):(s=e,setTimeout(u,0))},o=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,f=window.Date,h=window.setTimeout,m=window.clearTimeout,g=window.requestAnimationFrame,v=window.cancelAnimationFrame;if("undefined"!=typeof console&&("function"!=typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),"object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var b=f.now();t.unstable_now=function(){return f.now()-b}}var y=!1,k=null,w=-1,x=5,E=0;a=function(){return t.unstable_now()>=E},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):x=0<e?Math.floor(1e3/e):33.33};var _=new MessageChannel,S=_.port2;_.port1.onmessage=function(){if(null!==k){var e=t.unstable_now();E=e+x;try{k(!0,e)?S.postMessage(null):(y=!1,k=null)}catch(e){throw S.postMessage(null),e}}else y=!1},r=function(e){k=e,y||(y=!0,S.postMessage(null))},o=function(e,n){w=h((function(){e(t.unstable_now())}),n)},i=function(){m(w),w=-1}}function C(e,t){var n=e.length;e.push(t);e:for(;;){var r=Math.floor((n-1)/2),o=e[r];if(!(void 0!==o&&0<z(o,t)))break e;e[r]=t,e[n]=o,n=r}}function T(e){return void 0===(e=e[0])?null:e}function N(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],l=i+1,s=e[l];if(void 0!==a&&0>z(a,n))void 0!==s&&0>z(s,a)?(e[r]=s,e[l]=n,r=l):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==s&&0>z(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function z(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],R=[],O=1,M=null,D=3,I=!1,L=!1,A=!1;function j(e){for(var t=T(R);null!==t;){if(null===t.callback)N(R);else{if(!(t.startTime<=e))break;N(R),t.sortIndex=t.expirationTime,C(P,t)}t=T(R)}}function U(e){if(A=!1,j(e),!L)if(null!==T(P))L=!0,r(F);else{var t=T(R);null!==t&&o(U,t.startTime-e)}}function F(e,n){L=!1,A&&(A=!1,i()),I=!0;var r=D;try{for(j(n),M=T(P);null!==M&&(!(M.expirationTime>n)||e&&!a());){var l=M.callback;if(null!==l){M.callback=null,D=M.priorityLevel;var s=l(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?M.callback=s:M===T(P)&&N(P),j(n)}else N(P);M=T(P)}if(null!==M)var c=!0;else{var u=T(R);null!==u&&o(U,u.startTime-n),c=!1}return c}finally{M=null,D=r,I=!1}}function W(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var s=a.delay;s="number"==typeof s&&0<s?l+s:l,a="number"==typeof a.timeout?a.timeout:W(e)}else a=W(e),s=l;return e={id:O++,callback:n,priorityLevel:e,startTime:s,expirationTime:a=s+a,sortIndex:-1},s>l?(e.sortIndex=s,C(R,e),null===T(P)&&e===T(R)&&(A?i():A=!0,o(U,s-l))):(e.sortIndex=a,C(P,e),L||I||(L=!0,r(F))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCall
|
||
|
/*!
|
||
|
Copyright (c) 2016 Jed Watson.
|
||
|
Licensed under the MIT License (MIT), see
|
||
|
http://jedwatson.github.io/classnames
|
||
|
*/
|
||
|
!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o))e.push(n.apply(null,o));else if("object"===i)for(var a in o)t.call(o,a)&&o[a]&&e.push(a)}}return e.join(" ")}e.exports?e.exports=n:window.classNames=n}()}));function _(e,t){for(var n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function S(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)}function C(e){return"number"==typeof e&&!isNaN(e)}function T(e){return parseInt(e,10)}function N(e,t,n){if(e[t])return new Error("Invalid prop "+t+" passed to "+n+" - do not set this, set it on the child.")}var z=["Moz","Webkit","O","ms"];function P(e,t){return t?""+t+function(e){for(var t="",n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e):e}var R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var n=0;n<z.length;n++)if(P(e,z[n])in t)return z[n];return""}(),O=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},M=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),D=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},A=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},j=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},U="";function F(e,t){return U||(U=_(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return S(e[t])}))),!!S(e[U])&&e[U](t)}function W(e,t,n){var r=e;do{if(F(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function H(e,t,n){e&&(e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener?e.addEventListener(t,n,!0):e["on"+t]=n)}function B(e,t,n){e&&(e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener?e.removeEventListener(t,n,!0):e["on"+t]=null)}function V(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=T(n.borderTopWidth),t+=T(n.borderBottomWidth)}function $(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=T(n.borderLeftWidth),t+=T(n.borderRightWidth)}function Y(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=T(n.paddingTop),t-=T(n.paddingBottom)}function Q(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=T(n.paddingLeft),t-=T(n.paddingRight)}function X(e,t,n){var r="translate("+e.x+n+","+e.y+n+")";return t&&(r="translate("+("string"==typeof t.x?t.x:t.x+n)+", "+("string"==typeof t.y?t.y:t.y+n)+")"+r),r}function G(e){if(e){var t,n,r=e.getElementById("react-draggable-style-el");r||((r=e.createElement("style")).type="text/css",r.id="react-draggable-
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/
|
||
|
class f{static set(e,t){window.localStorage.setItem("ck5-inspector-"+e,t)}static get(e){return window.localStorage.getItem("ck5-inspector-"+e)}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/function h(e,t=!0){if(void 0===e)return"undefined";if("function"==typeof e)return"function() {…}";const n=JSON.stringify(e);return t?n:n.replace(/(^"|"$)/g,"")}function m(e){return e.map(([e,t])=>("symbol"==typeof e&&(e=e.toString()),[e,h(t)]))}function g(e,t){return e.length>t?e.substr(0,t)+`… [${e.length-t} characters left]`:e}n(14);function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const b=500;class y extends r.Component{render(){let e;return e=this.props.items?this.props.items.map((e,t)=>T(e,t,{onClick:this.props.onClick,showCompactText:this.props.showCompactText,activeNode:this.props.activeNode})):"Nothing to show.",o.a.createElement("div",{className:["ck-inspector-tree",this.props.textDirection?"ck-inspector-tree_text-direction_"+this.props.textDirection:"",this.props.showCompactText?"ck-inspector-tree_compact-text":""].join(" ")},e)}}class k extends r.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick(e,this.props.item.node)}getChildren(){return this.props.item.children.map((e,t)=>T(e,t,this.treeProps))}get isActive(){return this.props.item.node===this.props.activeNode}get treeProps(){return{onClick:this.props.onClick,showCompactText:this.props.showCompactText,activeNode:this.props.activeNode}}}class w extends k{render(){const e=this.props.item,t=e.presentation,n=t&&t.isEmpty,r=t&&t.cssClass,i=["ck-inspector-code","ck-inspector-tree-node",this.isActive?"ck-inspector-tree-node_active":"",n?"ck-inspector-tree-node_empty":"",r];return o.a.createElement("div",{className:i.join(" "),onClick:this.handleClick},o.a.createElement("span",{className:"ck-inspector-tree-node__name"},e.name,this.getAttributes()),o.a.createElement("div",{className:"ck-inspector-tree-node__content"},this.getChildren()),n?"":o.a.createElement("span",{className:"ck-inspector-tree-node__name"},"/",e.name))}getAttributes(){const e=[],t=this.props.item;for(const[n,r]of t.attributes)e.push(o.a.createElement(E,{key:n,name:n,value:r}));return e}}class x extends k{render(){const e=["ck-inspector-tree-text",this.isActive?"ck-inspector-tree-node_active":""].join(" ");return o.a.createElement("span",{className:e,onClick:this.handleClick},o.a.createElement("span",{className:"ck-inspector-tree-node__content"},this.props.showCompactText?"":this.getAttributes(),this.props.showCompactText?"":'"',this.getChildren(),this.props.showCompactText?"":'"'))}getAttributes(){const e=[],t=this.props.item,n=t.presentation,r=n&&n.dontRenderAttributeValue;for(const[n,i]of t.attributes)e.push(o.a.createElement(E,{key:n,name:n,value:i,dontRenderValue:r}));return o.a.createElement("span",{className:"ck-inspector-tree-text__attributes"},e)}}class E extends r.Component{render(){let e;const t=g(this.props.value,b);return this.props.dontRenderValue||(e=o.a.createElement("span",{className:"ck-inspector-tree-node__attribute__value"},t)),o.a.createElement("span",{className:"ck-inspector-tree-node__attribute"},o.a.createElement("span",{className:"ck-inspector-tree-node__attribute__name",title:t},this.props.name),e)}}class _ extends r.Component{render(){return o.a.createElement("span",{className:"ck-inspector-tree__selection"},this.props.isEnd?"]":"[")}}class S extends r.Component{render(){return o.a.createElement("span",null,this.props.text)}}class C extends r.Component{render(){return o.a.createElement("span",{className:"ck-inspector-tree-comment",dangerouslySetInnerHTML:{__html:this.props.item.text}})}}function T(e,t,n){return"string"==typeof e?o.a.createElement(S,{key:t,text:e}):"element"===e.type?o.a.createElement(w,v({key:t,item:e},n)):"text"===e.type?o.a.createElement(x,v({key:t,item:e},n)):"comment"===e.type?o.a.createElement(C,{key:t,item:e}):o.a.createElement(_,{key:t,isEnd:e.isEnd})}n(17);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class N extends r.Component{render(){const e=Array.isArray(this.props.children)?this.props.children:[this.props.children];return o.a.createElement("div",{className:"ck-inspector-navbox"},e.length>1?o.a.createElement("div",{className:"ck-inspector-navbox__navigation"},e[0]):"",o.a.createElement("div",{className:"ck-inspector-navbox__content"},e[e.length-1]))}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class z extends r.Component{render(){return[o.a.createElement("label",{htmlFor:this.props.id,key:"label"},this.props.label,":"),o.a.createElement("select",{id:this.props.id,value:this.props.value,onChange:this.props.onChange,key:"select"},this.props.options.map(e=>o.a.createElement("option",{value:e,key:e},e)))]}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class P extends r.Component{render(){return[o.a.createElement("label",{htmlFor:this.props.id,key:"label"},this.props.label,":"),o.a.createElement("input",{type:"checkbox",id:this.props.id,key:"input",checked:this.props.isChecked,onChange:this.props.onChange})]}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/function R(e){return class extends e{constructor(...e){super(...e),this._onEditorEventCallback=()=>{this.forceUpdate()}}componentDidMount(){this.startListeningToEditor()}componentDidUpdate(e){e&&e.editor&&e.editor!==this.props.editor&&this.stopListeningToEditor(e),this.props.editor&&(e&&e.editor&&e.editor===this.props.editor||this.startListeningToEditor())}componentWillUnmount(){this.stopListeningToEditor(this.props)}startListeningToEditor(){const{target:e,event:t}=this.editorEventObserverConfig(this.props);e.on(t,this._onEditorEventCallback),this.forceUpdate()}stopListeningToEditor(e){const{target:t,event:n}=this.editorEventObserverConfig(e);t.off(n,this._onEditorEventCallback)}}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/function O(e){return e&&e.is("element")}function M(e){return e&&e.is("rootElement")}function D(e){return e.getPath?e.getPath():e.path}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const I="model-compact-text";class L extends r.Component{constructor(e){super(e),this.state={showCompactText:"true"===f.get(I)},this.handleCompactTextChange=this.handleCompactTextChange.bind(this)}editorEventObserverConfig(e){return{target:e.editor.model.document,event:"change"}}handleCompactTextChange(e){this.setState({showCompactText:e.target.checked},()=>{f.set(I,this.state.showCompactText)})}render(){const e=this.getEditorModelTree();return o.a.createElement(N,null,[o.a.createElement("div",{className:"ck-inspector-tree__config",key:"root-cfg"},o.a.createElement(z,{id:"view-root-select",label:"Root",value:this.props.currentRootName,options:this.props.editorRoots.map(e=>e.rootName),onChange:e=>this.props.onRootChange(e.target.value)})),o.a.createElement("div",{className:"ck-inspector-tree__config",key:"text-cfg"},o.a.createElement(P,{label:"Compact text",id:"model-compact-text",isChecked:this.state.showCompactText,onChange:this.handleCompactTextChange}))],o.a.createElement(y,{items:e,textDirection:this.props.editor.locale.contentLanguageDirection,onClick:this.props.onClick,showCompactText:this.state.showCompactText,activeNode:this.props.currentEditorNode}))}getEditorModelTree(){if(!this.props.currentRootName)return null;const e=this.props.editor,t=e.model.document.getRoot(this.props.currentRootName),n=e.model.document.selection.getFirstRange();return[A(t,n.start,n.end)]}}function A(e,t,n){return O(e)?function(e,t,n){const r={};if(Object.assign(r,{type:"element",name:e.name,children:[],node:e}),e.childCount){let o=!1,i=!1;for(const a of e.getChildren()){const e=A(a,t,n);o||t.textNode||t.nodeAfter!==a||(r.children.push({type:"selection",isEnd:!1}),o=!0),i||n.textNode||n.nodeAfter!==a||(r.children.push({type:"selection",isEnd:!0}),i=!0),r.children.push(e),o||t.textNode||t.nodeBefore!==a||(r.children.push({type:"selection",isEnd:!1}),o=!0),i||n.textNode||n.nodeBefore!==a||(r.children.push({type:"selection",isEnd:!0}),i=!0)}}else t.textNode||t.parent!==e||t.nodeBefore||t.nodeAfter||r.children.push({type:"selection",isEnd:!1}),n.textNode||n.parent!==e||n.nodeBefore||n.nodeAfter||r.children.push({type:"selection",isEnd:!0});return r.attributes=j(e),r}(e,t,n):function(e,t,n){const r={};let o;Object.assign(r,{type:"text",children:[e.data],node:e,presentation:{dontRenderAttributeValue:!0}}),t.textNode===e&&(o=t.offset-e.startOffset,r.children=[e.data.slice(0,o),{type:"selection"},e.data.slice(o,e.data.length)]);if(n.textNode===e){let i=n.offset-e.startOffset;t.textNode===n.textNode&&(i-=o);const a=r.children.pop();r.children.push(a.slice(0,i),{type:"selection",isEnd:!0},a.slice(i,a.length))}return r.children=r.children.filter(e=>e),r.attributes=j(e),r}(e,t,n)}function j(e){const t=[...e.getAttributes()].map(([e,t])=>[e,h(t,!1)]);return new Map(t)}var U=R(L);n(4);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/
|
||
|
class F extends r.Component{render(){return o.a.createElement("div",{className:["ck-inspector-pane",this.props.splitVertically?"ck-inspector-pane_vsplit":"",this.props.isEmpty?"ck-inspector-pane_empty":""].join(" ")},this.props.children)}}n(20);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class W extends r.Component{constructor(e){super(e),this.handleTabClick=this.handleTabClick.bind(this)}handleTabClick(e){this.setState({activeTab:e},()=>{this.props.onClick(e)})}render(){return o.a.createElement("div",{className:"ck-inspector-horizontal-nav"},this.props.definitions.map(e=>o.a.createElement(H,{key:e,label:e,isActive:this.props.activeTab===e,onClick:()=>this.handleTabClick(e)})))}}class H extends r.Component{render(){return o.a.createElement("button",{className:["ck-inspector-horizontal-nav__item",this.props.isActive?" ck-inspector-horizontal-nav__item_active":""].join(" "),key:this.props.label,onClick:this.props.onClick,type:"button"},this.props.label)}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class B extends r.Component{constructor(e){super(e),this.handleTabClick=this.handleTabClick.bind(this)}handleTabClick(e){this.props.onTabChange(e)}render(){const e=Array.isArray(this.props.children)?this.props.children:[this.props.children];return o.a.createElement(N,null,[this.props.contentBefore,o.a.createElement(W,{key:"navigation",definitions:e.map(e=>e.props.label),activeTab:this.props.activeTab,onClick:this.handleTabClick}),this.props.contentAfter],e.filter(e=>e.props.label===this.props.activeTab))}}n(22);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const V="side-pane-width",$=200,Y="500px",Q={position:"relative"};class X extends r.Component{constructor(e){super(e),this.state={width:f.get(V)||Y},this.handleSidePaneResize=this.handleSidePaneResize.bind(this)}get maxSidePaneWidth(){return Math.min(window.innerWidth-400,.8*window.innerWidth)}handleSidePaneResize(e,t,n){this.setState({width:n.style.width},()=>{f.set(V,n.style.width)})}render(){return o.a.createElement("div",{className:"ck-inspector-side-pane"},o.a.createElement(d,{enableResizing:{left:!0},disableDragging:!0,minWidth:$,maxWidth:this.maxSidePaneWidth,style:Q,position:{x:"100%",y:"100%"},size:{width:this.state.width,height:"100%"},onResizeStop:this.handleSidePaneResize},this.props.children))}}n(24);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class G extends r.Component{render(){return o.a.createElement("button",{className:`ck-inspector-button ck-inspector-button_${this.props.type}`,type:"button",onClick:this.props.onClick,title:this.props.text},this.props.text)}}n(26);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const K=2e3;class q extends r.Component{render(){const e=Math.random().toString(36).substring(7);return o.a.createElement("dl",{className:"ck-inspector-property-list ck-inspector-code"},this.props.items.map(([t,n,r])=>{const i=r&&r.length;n=g(String(n),K);const a=[o.a.createElement(Z,{key:`${this.props.name}-name`,name:t,listUid:e,canCollapse:i}),o.a.createElement("dd",{key:`${t}-value`},o.a.createElement("input",{id:`${e}-${t}-input`,type:"text",value:n,readOnly:!0}))];return i&&a.push(o.a.createElement(q,{key:`${t}-subProperties`,items:r})),a}))}}class Z extends r.Component{constructor(e){super(e),this.state={isCollapsed:!0},this.handleCollapsedChange=this.handleCollapsedChange.bind(this)}handleCollapsedChange(){this.setState({isCollapsed:!this.state.isCollapsed})}render(){const e=["ck-inspector-property-list__title"];return this.props.canCollapse&&(e.push("ck-inspector-property-list__title_collapsible"),e.push("ck-inspector-property-list__title_"+(this.state.isCollapsed?"collapsed":"expanded"))),o.a.createElement("dt",{className:e.join(" ").trim()},!!this.props.canCollapse&&o.a.createElement("button",{type:"button",onClick:this.handleCollapsedChange},"Toggle"),o.a.createElement("label",{htmlFor:`${this.props.listUid}-${this.props.name}-input`},this.props.name),":")}}n(28);function J(){return(J=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class ee extends r.Component{render(){const e=[];for(const t of this.props.lists)t.items.length&&e.push(o.a.createElement("hr",{key:`${t.name}-separator`}),o.a.createElement("h3",{key:`${t.name}-header`},o.a.createElement("a",{href:t.url,target:"_blank",rel:"noopener noreferrer"},t.name),t.buttons&&t.buttons.map((e,t)=>o.a.createElement(G,J({key:"button"+t},e)))),o.a.createElement(q,{key:`${t.name}-list`,items:t.items}));return o.a.createElement("div",{className:"ck-inspector__object-inspector"},o.a.createElement("h2",{className:"ck-inspector-code"},this.props.header),e)}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class te{static group(...e){console.group(...e)}static groupEnd(...e){console.groupEnd(...e)}static log(...e){console.log(...e)}static warn(...e){console.warn(...e)}}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class ne extends r.Component{editorEventObserverConfig(e){return{target:e.editor.model.document,event:"change"}}render(){const e=this.getInspectedEditorNodeInfo();return e?o.a.createElement(ee,{header:[o.a.createElement("span",{key:"link"},o.a.createElement("a",{href:e.url,target:"_blank",rel:"noopener noreferrer"},o.a.createElement("b",null,e.type),":"),"Text"===e.type?o.a.createElement("em",null,e.name):e.name),o.a.createElement(G,{key:"log",type:"log",text:"Log in console",onClick:()=>te.log(e.editorNode)})],lists:[{name:"Attributes",url:e.url,items:e.attributes},{name:"Properties",url:e.url,items:e.properties}]}):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Select a node in the tree to inspect"))}getInspectedEditorNodeInfo(){const e=this.props.inspectedNode,t=this.props.currentRootName;if(!e)return null;if(!M(e)&&!e.parent)return;if(e.root.rootName!==t)return;const n={editorNode:e,properties:[],attributes:[]};O(e)?(M(e)?(n.type="RootElement",n.name=e.rootName,n.url="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_rootelement-RootElement.html"):(n.type="Element",n.name=e.name,n.url="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_element-Element.html"),n.properties.push(["childCount",e.childCount],["startOffset",e.startOffset],["endOffset",e.endOffset],["maxOffset",e.maxOffset])):(n.name=e.data,n.type="Text",n.url="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_text-Text.html",n.properties.push(["startOffset",e.startOffset],["endOffset",e.endOffset],["offsetSize",e.offsetSize])),n.properties.push(["path",D(e)]),n.attributes.push(...e.getAttributes()),n.properties=m(n.properties),n.attributes=m(n.attributes);for(const e of n.attributes){const t=e[0],n=Object.entries(this.props.editor.model.schema.getAttributeProperties(t));e.push(m(n))}return n}}var re=R(ne);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const oe="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_selection-Selection.html";class ie extends r.Component{editorEventObserverConfig(e){return{target:e.editor.model.document,event:"change"}}render(){const e=this.getEditorSelectionInfo();return o.a.createElement(ee,{header:[o.a.createElement("span",{key:"link"},o.a.createElement("a",{href:oe,target:"_blank",rel:"noopener noreferrer"},o.a.createElement("b",null,"Selection"))),o.a.createElement(G,{key:"log",type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.model.document.selection)})],lists:[{name:"Attributes",url:`${oe}#function-getAttributes`,items:e.attributes},{name:"Properties",url:`${oe}`,items:e.properties},{name:"Anchor",url:`${oe}#member-anchor`,buttons:[{type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.model.document.selection.anchor)}],items:e.anchor},{name:"Focus",url:`${oe}#member-focus`,buttons:[{type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.model.document.selection.focus)}],items:e.focus}]})}getEditorSelectionInfo(){const e=this.props.editor.model.document.selection,t=e.anchor,n=e.focus,r={properties:[["isCollapsed",e.isCollapsed],["isBackward",e.isBackward],["isGravityOverridden",e.isGravityOverridden],["rangeCount",e.rangeCount]],attributes:[...e.getAttributes()],anchor:ae(t),focus:ae(n)};for(const e in r)r[e]=m(r[e]);return r}}function ae(e){return[["path",D(e)],["stickiness",e.stickiness],["index",e.index],["isAtEnd",e.isAtEnd],["isAtStart",e.isAtStart],["offset",e.offset],["textNode",e.textNode&&e.textNode.data]]}var le=R(ie);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const se="active-model-tab-name";class ce extends r.Component{constructor(e){super(e),this.state={editor:null,editorRoots:null,currentRootName:null,currentEditorNode:null,activeTab:f.get(se)||"Inspect"},this.handleRootChange=this.handleRootChange.bind(this),this.handlePaneChange=this.handlePaneChange.bind(this),this.handleTreeClick=this.handleTreeClick.bind(this)}handleTreeClick(e,t){e.persist(),e.stopPropagation(),this.setState({currentEditorNode:t},()=>{2==e.detail&&this.setState({activeTab:"Inspect"},()=>{f.set(se,"Inspect")})})}handleRootChange(e){this.setState({currentRootName:e})}handlePaneChange(e){this.setState({activeTab:e},()=>{f.set(se,e)})}render(){return this.props.editor?o.a.createElement(F,{splitVertically:"true"},o.a.createElement(U,{editor:this.props.editor,editorRoots:this.state.editorRoots,currentEditorNode:this.state.currentEditorNode,currentRootName:this.state.currentRootName,onClick:this.handleTreeClick,onRootChange:this.handleRootChange}),o.a.createElement(X,null,o.a.createElement(B,{onTabChange:this.handlePaneChange,activeTab:this.state.activeTab},o.a.createElement(re,{label:"Inspect",editor:this.state.editor,currentRootName:this.state.currentRootName,inspectedNode:this.state.currentEditorNode}),o.a.createElement(le,{label:"Selection",editor:this.state.editor})))):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Nothing to show. Attach another editor instance to start inspecting."))}static getDerivedStateFromProps(e,t){if(e.editor!==t.editor){const t=function(e){if(!e)return null;const t=[...e.model.document.roots];return t.filter(({rootName:e})=>"$graveyard"!==e).concat(t.filter(({rootName:e})=>"$graveyard"===e))}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/(e.editor);return{editor:e.editor,editorRoots:t,currentRootName:t?t[0].rootName:null,currentEditorNode:null}}return null}}function ue(e){return e&&e.name}function pe(e){return e&&ue(e)&&e.is("attributeElement")}function de(e){return e&&ue(e)&&e.is("emptyElement")}function fe(e){return e&&ue(e)&&e.is("uiElement")}function he(e){return e&&e.is("rootElement")}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/
|
||
|
const me="view-element-types";class ge extends r.Component{constructor(e){super(e),this.state={showTypes:"true"===f.get(me)},this.handleShowTypesChange=this.handleShowTypesChange.bind(this)}editorEventObserverConfig(e){return{target:e.editor.editing.view,event:"render"}}handleShowTypesChange(e){this.setState({showTypes:e.target.checked},()=>{f.set(me,this.state.showTypes)})}render(){const e=this.getEditorViewTree();return o.a.createElement(N,null,[o.a.createElement("div",{className:"ck-inspector-tree__config",key:"root-cfg"},o.a.createElement(z,{id:"view-root-select",label:"Root",value:this.props.currentRootName,options:this.props.editorRoots.map(e=>e.rootName),onChange:e=>this.props.onRootChange(e.target.value)})),o.a.createElement("div",{className:"ck-inspector-tree__config",key:"types-cfg"},o.a.createElement(P,{label:"Show element types",id:"view-show-types",isChecked:this.state.showTypes,onChange:this.handleShowTypesChange}))],o.a.createElement(y,{items:e,textDirection:this.props.editor.locale.contentLanguageDirection,onClick:this.props.onClick,showCompactText:"true",activeNode:this.props.currentEditorNode}))}getEditorViewTree(){if(!this.props.currentRootName)return;const e=this.props.editor.editing.view.document,t=e.getRoot(this.props.currentRootName),n=e.selection.getFirstRange();return[ve(t,n.start,n.end,this.state.showTypes)]}}function ve(e,t,n,r){return ue(e)?function(e,t,n,r){const o={};Object.assign(o,{type:"element",children:[],node:e}),r?pe(e)?o.name="attribute:"+e.name:he(e)?o.name="root:"+e.name:de(e)?o.name="empty:"+e.name:fe(e)?o.name="ui:"+e.name:o.name="container:"+e.name:o.name=e.name;de(e)&&(o.presentation={isEmpty:!0});fe(e)&&o.children.push({type:"comment",text:["<!--","The View UI element content has been skipped. ",'<a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_uielement-UIElement.html" target="_blank">',"Find out why","</a>."," -->"].join("")});if(e.childCount){let i=!1,a=!1;for(const l of e.getChildren()){const e=ve(l,t,n,r);i||t.nodeAfter!==l||(o.children.push({type:"selection",isEnd:!1}),i=!0),a||n.nodeAfter!==l||(o.children.push({type:"selection",isEnd:!0}),a=!0),o.children.push(e),i||t.nodeBefore!==l||(o.children.push({type:"selection",isEnd:!1}),i=!0),a||n.nodeBefore!==l||(o.children.push({type:"selection",isEnd:!0}),a=!0)}}else t.parent!==e||t.nodeBefore||t.nodeAfter||o.children.push({type:"selection",isEnd:!1}),n.parent!==e||n.nodeBefore||n.nodeAfter||o.children.push({type:"selection",isEnd:!0});return o.attributes=function(e){const t=[...e.getAttributes()].map(([e,t])=>[e,h(t,!1)]);return new Map(t)}(e),o}(e,t,n,r):function(e,t,n){const r={};let o;Object.assign(r,{type:"text",children:[e.data],node:e}),t.parent===e&&(o=t.offset,r.children=[e.data.slice(0,o),{type:"selection"},e.data.slice(o,e.data.length)]);if(n.parent===e){let e=n.offset;t.parent===n.parent&&(e-=o);const i=r.children.pop();r.children.push(i.slice(0,e),{type:"selection",isEnd:!0},i.slice(e,i.length))}return r.children=r.children.filter(e=>e),r}(e,t,n)}var be=R(ge);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const ye="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view";class ke extends r.Component{editorEventObserverConfig(e){return{target:e.editor.editing.view,event:"render"}}render(){const e=this.getInspectedEditorNodeInfo();return e?o.a.createElement(ee,{header:[o.a.createElement("span",{key:"link"},o.a.createElement("a",{href:e.url,target:"_blank",rel:"noopener noreferrer"},o.a.createElement("b",null,e.type),":"),"Text"===e.type?o.a.createElement("em",null,e.name):e.name),o.a.createElement(G,{key:"log",type:"log",text:"Log in console",onClick:()=>te.log(e.editorNode)})],lists:[{name:"Attributes",url:e.url,items:e.attributes},{name:"Properties",url:e.url,items:e.properties},{name:"Custom Properties",url:`${ye}_element-Element.html#function-getCustomProperty`,items:e.customProperties}]}):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Select a node in the tree to inspect"))}getInspectedEditorNodeInfo(){const e=this.props.inspectedNode,t=this.props.currentRootName;if(!e)return null;if(!he(e)&&!e.parent)return;if(e.root.rootName!==t)return;const n={editorNode:e,properties:[],attributes:[],customProperties:[]};return ue(e)?(he(e)?(n.type="RootEditableElement",n.name=e.rootName,n.url=`${ye}_rooteditableelement-RootEditableElement.html`):(n.name=e.name,pe(e)?(n.type="AttributeElement",n.url=`${ye}_attributeelement-AttributeElement.html`):de(e)?(n.type="EmptyElement",n.url=`${ye}_emptyelement-EmptyElement.html`):fe(e)?(n.type="UIElement",n.url=`${ye}_uielement-UIElement.html`):!function(e){return e&&ue(e)&&e.is("editableElement")}(e)?(n.type="ContainerElement",n.url=`${ye}_containerelement-ContainerElement.html`):(n.type="EditableElement",n.url=`${ye}_editableelement-EditableElement.html`)),n.attributes.push(...e.getAttributes()),n.properties.push(["index",e.index],["isEmpty",e.isEmpty],["childCount",e.childCount]),n.customProperties.push(...e.getCustomProperties())):(n.name=e.data,n.type="Text",n.url=`${ye}_text-Text.html`,n.properties.push(["index",e.index])),n.properties=m(n.properties),n.customProperties=m(n.customProperties),n.attributes=m(n.attributes),n}}var we=R(ke);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const xe="https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_selection-Selection.html";class Ee extends r.Component{editorEventObserverConfig(e){return{target:e.editor.editing.view,event:"render"}}render(){const e=this.getEditorSelectionInfo();return o.a.createElement(ee,{header:[o.a.createElement("span",{key:"link"},o.a.createElement("a",{href:xe,target:"_blank",rel:"noopener noreferrer"},o.a.createElement("b",null,"Selection"))),o.a.createElement(G,{key:"log",type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.editing.view.document.selection)})],lists:[{name:"Properties",url:`${xe}`,items:e.properties},{name:"Anchor",url:`${xe}#member-anchor`,buttons:[{type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.editing.view.document.selection.anchor)}],items:e.anchor},{name:"Focus",url:`${xe}#member-focus`,buttons:[{type:"log",text:"Log in console",onClick:()=>te.log(this.props.editor.editing.view.document.selection.focus)}],items:e.focus}]})}getEditorSelectionInfo(){const e=this.props.editor.editing.view.document.selection,t={properties:[["isCollapsed",e.isCollapsed],["isBackward",e.isBackward],["isFake",e.isFake],["rangeCount",e.rangeCount]],anchor:_e(e.anchor),focus:_e(e.focus)};for(const e in t)t[e]=m(t[e]);return t}}function _e(e){return[["offset",e.offset],["isAtEnd",e.isAtEnd],["isAtStart",e.isAtStart],["parent",(t=e.parent,ue(t)?pe(t)?"attribute:"+t.name:he(t)?"root:"+t.name:"container:"+t.name:t.data)]];var t}var Se=R(Ee);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const Ce="active-view-tab-name";class Te extends r.Component{constructor(e){super(e),this.state={editor:null,currentEditorNode:null,editorRoots:null,currentRootName:null,activeTab:f.get(Ce)||"Inspect"},this.handleTreeClick=this.handleTreeClick.bind(this),this.handlePaneChange=this.handlePaneChange.bind(this),this.handleRootChange=this.handleRootChange.bind(this)}handleTreeClick(e,t){e.persist(),e.stopPropagation(),this.setState({currentEditorNode:t},()=>{2==e.detail&&this.setState({activeTab:"Inspect"},()=>{f.set(Ce,"Inspect")})})}handleRootChange(e){this.setState({currentRootName:e})}handlePaneChange(e){this.setState({activeTab:e},()=>{f.set(Ce,e)})}render(){return this.props.editor?o.a.createElement(F,{splitVertically:"true"},o.a.createElement(be,{currentEditorNode:this.state.currentEditorNode,currentRootName:this.state.currentRootName,editor:this.props.editor,editorRoots:this.state.editorRoots,onClick:this.handleTreeClick,onRootChange:this.handleRootChange}),o.a.createElement(X,null,o.a.createElement(B,{onTabChange:this.handlePaneChange,activeTab:this.state.activeTab},o.a.createElement(we,{label:"Inspect",editor:this.state.editor,currentRootName:this.state.currentRootName,inspectedNode:this.state.currentEditorNode}),o.a.createElement(Se,{label:"Selection",editor:this.state.editor})))):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Nothing to show. Attach another editor instance to start inspecting."))}static getDerivedStateFromProps(e,t){const n=function(e){if(!e)return null;return[...e.editing.view.document.roots]}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/(e.editor);return e.editor!==t.editor?{editor:e.editor,editorRoots:n,currentRootName:n?n[0].rootName:null,currentEditorNode:null}:null}}class Ne extends r.Component{editorEventObserverConfig(e){return{target:e.editor.model.document,event:"change"}}render(){return o.a.createElement(N,null,o.a.createElement(y,{items:this.getCommandStates(),onClick:this.props.onClick,activeNode:this.props.currentCommandName}))}getCommandStates(){const e=this.props.editor,t=[];for(const[n,r]of e.commands){const e=[];void 0!==r.value&&e.push(["value",h(r.value,!1)]),t.push({name:n,type:"element",children:[],node:n,attributes:e,presentation:{isEmpty:!0,cssClass:["ck-inspector-tree-node_tagless",r.isEnabled?"":"ck-inspector-tree-node_disabled"].join(" ")}})}return t.sort((e,t)=>e.name>t.name?1:-1)}}var ze=R(Ne);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class Pe extends r.Component{editorEventObserverConfig(e){return{target:e.editor.model.document,event:"change"}}render(){const e=this.getEditorCommandInfo();return e?o.a.createElement(ee,{header:[o.a.createElement("span",{key:"link"},o.a.createElement("a",{href:e.url,target:"_blank",rel:"noopener noreferrer"},o.a.createElement("b",null,e.type)),":",e.name),o.a.createElement(G,{key:"exec",type:"exec",text:"Execute command",onClick:()=>this.props.editor.execute(e.name)}),o.a.createElement(G,{key:"log",type:"log",text:"Log in console",onClick:()=>te.log(e.command)})],lists:[{name:"Properties",url:e.url,items:e.properties}]}):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Select a command to inspect"))}getEditorCommandInfo(){const e=this.props.editor,t=this.props.inspectedCommandName;if(!t)return null;const n=e.commands.get(t);return{name:t,type:"Command",url:"https://ckeditor.com/docs/ckeditor5/latest/api/module_core_command-Command.html",properties:m([["isEnabled",n.isEnabled],["value",n.value]]),command:n}}}var Re=R(Pe);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/class Oe extends r.Component{constructor(e){super(e),this.state={editor:null,currentCommandName:null},this.handleTreeClick=this.handleTreeClick.bind(this)}handleTreeClick(e,t){e.persist(),e.stopPropagation(),this.setState({currentCommandName:t})}render(){return this.props.editor?o.a.createElement(F,{splitVertically:"true"},o.a.createElement(ze,{editor:this.props.editor,currentCommandName:this.state.currentCommandName,onClick:this.handleTreeClick}),o.a.createElement(X,null,o.a.createElement(B,{activeTab:"Inspect"},o.a.createElement(Re,{label:"Inspect",editor:this.props.editor,inspectedCommandName:this.state.currentCommandName})))):o.a.createElement(F,{isEmpty:"true"},o.a.createElement("p",null,"Nothing to show. Attach another editor instance to start inspecting."))}static getDerivedStateFromProps(e,t){return e.editor!==t.editor?{editor:e.editor,currentCommandName:null}:null}}n(30);
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/const Me="active-tab-name",De="is-collapsed",Ie="height",Le="100",Ae="400px",je=30,Ue={position:"fixed",bottom:"0",left:"0",right:"0",top:"auto"};class Fe extends r.Component{constructor(e){super(e);const t=f.get(Ie)||Ae,n=!0===this.props.isCollapsed||"true"===f.get(De);this.state={isCollapsed:n,height:t,editors:null,currentEditorName:null,activeTab:f.get(Me)||"Model"},Ve(t),this.handlePaneChange=this.handlePaneChange.bind(this),this.handleEditorChange=this.handleEditorChange.bind(this),this.handleToggleCollapseClick=this.handleToggleCollapseClick.bind(this),this.handleInspectorResize=this.handleInspectorResize.bind(this)}handlePaneChange(e){this.setState({activeTab:e},()=>{f.set(Me,e)})}handleEditorChange(e){this.setState({currentEditorName:e})}handleToggleCollapseClick(){this.setState({isCollapsed:!this.state.isCollapsed},()=>{f.set(De,this.state.isCollapsed)})}handleInspectorResize(e,t,n){this.setState({height:n.style.height},()=>{const e=n.style.height;f.set(Ie,e),Ve(e)})}render(){this.state.isCollapsed?(document.body.classList.remove("ck-inspector-body-expanded"),document.body.classList.add("ck-inspector-body-collapsed")):(document.body.classList.remove("ck-inspector-body-collapsed"),document.body.classList.add("ck-inspector-body-expanded"));const e=this.state.editors.get(this.state.currentEditorName);return o.a.createElement(d,{bounds:"window",enableResizing:{top:!this.state.isCollapsed},disableDragging:!0,minHeight:Le,maxHeight:"100%",style:Ue,className:["ck-inspector",this.state.isCollapsed?"ck-inspector_collapsed":""].join(" "),position:{x:0,y:"100%"},size:{width:"100%",height:this.state.isCollapsed?je:this.state.height},onResizeStop:this.handleInspectorResize},o.a.createElement(B,{onTabChange:this.handlePaneChange,contentBefore:o.a.createElement(We,{key:"docs"}),activeTab:this.state.activeTab,contentAfter:[o.a.createElement(Be,{key:"selector",currentEditorName:this.state.currentEditorName,editors:this.state.editors,onChange:e=>this.handleEditorChange(e.target.value)}),o.a.createElement(He,{key:"inspector-toggle",onClick:this.handleToggleCollapseClick,isUp:this.state.isCollapsed})]},o.a.createElement(ce,{label:"Model",editor:e}),o.a.createElement(Te,{label:"View",editor:e}),o.a.createElement(Oe,{label:"Commands",editor:e})))}componentWillUnmount(){document.body.classList.remove("ck-inspector-body-expanded"),document.body.classList.remove("ck-inspector-body-collapsed")}static getDerivedStateFromProps(e,t){return e.editors.has(t.currentEditorName)?null:{editors:e.editors,currentEditorName:e.editors.size?[...e.editors][0][0]:""}}}class We extends r.Component{render(){return o.a.createElement("a",{className:"ck-inspector-navbox__navigation__logo",title:"Go to the documentation",href:"https://ckeditor.com/docs/ckeditor5/latest/",target:"_blank",rel:"noopener noreferrer"},"CKEditor documentation")}}class He extends r.Component{render(){return o.a.createElement("button",{type:"button",onClick:this.props.onClick,title:"Toggle inspector",className:["ck-inspector-navbox__navigation__toggle",this.props.isUp?" ck-inspector-navbox__navigation__toggle_up":""].join(" ")},"Toggle inspector")}}class Be extends r.Component{render(){return o.a.createElement("div",{className:"ck-inspector-editor-selector",key:"editor-selector"},this.props.currentEditorName?o.a.createElement(z,{id:"inspector-editor-selector",label:"Editor instance",value:this.props.currentEditorName,options:[...this.props.editors].map(([e])=>e),onChange:this.props.onChange}):"")}}function Ve(e){document.body.style.setProperty("--ck-inspector-height",e)}
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/let $e=0;function Ye(e){const t={editors:{},options:{}};if("string"==typeof e[0])te.warn(`[CKEditorInspector] The CKEditorInspector.attach( '${e[0]}', editor ) syntax has been deprecated `+"and will be removed in the near future. To pass a name of an editor instance, use "+`CKEditorInspector.attach( { '${e[0]}': editor } ) instead. `+"Learn more in https://github.com/ckeditor/ckeditor5-inspector/blob/master/README.md."),t.editors[e[0]]=e[1];else{if((n=e[0]).model&&n.editing)t.editors[`editor-${++$e}`]=e[0];else for(const n in e[0])t.editors[n]=e[0][n];t.options=e[1]||t.options}var n;return t}n(32);n.d(t,"default",(function(){return Qe})),
|
||
|
/**
|
||
|
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
|
||
|
* For licensing, see LICENSE.md.
|
||
|
*/
|
||
|
window.CKEDITOR_INSPECTOR_VERSION="1.5.0";class Qe{constructor(){te.warn("[CKEditorInspector] Whoops! Looks like you tried to create an instance of the CKEditorInspector class. To attach the inspector, use the static CKEditorInspector.attach( editor ) method instead. For the latest API, please refer to https://github.com/ckeditor/ckeditor5-inspector/blob/master/README.md. ")}static attach(...e){const{editors:t,options:n}=Ye(e);for(const e in t){const r=t[e];te.group("%cAttached the inspector to a CKEditor 5 instance. To learn more, visit https://ckeditor.com/docs/ckeditor5.","font-weight: bold;"),te.log(`Editor instance "${e}"`,r),te.groupEnd(),Qe._editors.set(e,r),r.on("destroy",()=>{Qe.detach(e)}),Qe._mount(n),Qe._updateEditorsState()}return Object.keys(t)}static attachToAll(e){const t=document.querySelectorAll(".ck.ck-content.ck-editor__editable"),n=[];for(const r of t){const t=r.ckeditorInstance;t&&!Qe._isAttachedTo(t)&&n.push(...Qe.attach(t,e))}return n}static detach(e){Qe._editors.delete(e),Qe._updateEditorsState()}static destroy(){Qe._wrapper&&(a.a.unmountComponentAtNode(Qe._wrapper),Qe._editors.clear(),Qe._wrapper.remove(),Qe._wrapper=null)}static _updateEditorsState(){Qe._isMounted&&Qe._inspectorRef.current.setState({editors:Qe._editors})}static _mount(e){if(Qe._wrapper)return;const t=Qe._wrapper=document.createElement("div");t.className="ck-inspector-wrapper",document.body.appendChild(t),a.a.render(o.a.createElement(Fe,{ref:Qe._inspectorRef,editors:Qe._editors,isCollapsed:e.isCollapsed}),t)}static get _isMounted(){return!!Qe._inspectorRef.current}static _isAttachedTo(e){return[...Qe._editors.values()].includes(e)}}Qe._editors=new Map,Qe._inspectorRef=o.a.createRef(),Qe._wrapper=null}]).default}));
|