{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js","webpack:///./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js","webpack:///./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js"],"names":["ResizeState","options","Object","classCallCheck","this","set","_options","_referenceCoordinates","domResizeHandle","domHandleHost","domResizeHost","clientRect","Rect","activeHandlePosition","getHandlePosition","getAbsoluteBoundaryPoint","getOppositePosition","originalWidth","width","originalHeight","height","aspectRatio","widthStyle","style","match","originalWidthPercents","parseFloat","calculateHostPercentageWidth","newSize","proposedWidth","proposedHeight","proposedWidthPercents","widthPercents","proposedHandleHostWidth","handleHostWidth","proposedHandleHostHeight","handleHostHeight","resizeHostRect","domResizeHostParent","parentElement","parentWidth","ownerDocument","defaultView","getComputedStyle","element","resizerPosition","elementRect","positionParts","split","ret","x","right","left","y","bottom","top","scrollX","scrollY","getResizerHandleClass","concat","domHandle","resizerPositions","_i","_resizerPositions","length","position","classList","contains","parts","replacements","mix","ObservableMixin","SizeView","_this","_super","call","bind","bindTemplate","setTemplate","tag","attributes","class","to","value","display","if","visible","children","text","resizeState","unit","unbind","_isVisible","View","Resizer","_viewResizerWrapper","decorate","on","event","state","_cleanup","stop","priority","isEnabled","redraw","_this2","that","widgetElement","viewElement","editingView","editor","editing","view","change","writer","viewResizerWrapper","createUIElement","domDocument","domElement","toDomElement","_appendHandles","_appendSizeUI","evt","propName","newValue","insert","createPositionAt","addClass","_sizeView","_bindToState","_initialViewWidth","getStyle","begin","_getHandleHost","_getResizeHost","domEventData","_this3","_proposeNewSize","newWidth","setStyle","domHandleHostRect","Math","round","domResizeHostRect","update","_this4","onCommit","cancel","handleHostRect","domWrapper","_domResizerWrapper","existsInDom","newDimensions","widgetWrapper","handleHost","resizerWrapper","currentDimensions","isSameNode","undefined","offsetWidth","offsetHeight","offsetLeft","offsetTop","compareArrays","_this5","_dismiss","currentCoordinates","extractCoordinates","isCentered","enlargement","endsWith","proposedSize","abs","dominant","max","targetSize","min","getResizeHost","getHandleHost","domConverter","mapViewToDom","currentPosition","appendChild","Template","getResizerClass","render","pageX","pageY"],"mappings":"oPAkBqBA,kCAIpB,SAAAA,EAAaC,GAAUC,OAAAC,EAAA,KAAAD,CAAAE,KAAAJ,GA8BtBI,KAAKC,IAAK,uBAAwB,MASlCD,KAAKC,IAAK,wBAAyB,MASnCD,KAAKC,IAAK,gBAAiB,MAS3BD,KAAKC,IAAK,iBAAkB,MAE5BD,KAAKC,IAAK,0BAA2B,MACrCD,KAAKC,IAAK,2BAA4B,MAatCD,KAAKE,SAAWL,EAUhBG,KAAKG,sBAAwB,iDAS9B,SAAOC,EAAiBC,EAAeC,GACtC,IAAMC,EAAa,IAAIC,OAAMH,GAE7BL,KAAKS,qBAAuBC,EAAmBN,GAE/CJ,KAAKG,sBAAwBQ,EAA0BN,EAAeO,EAAqBZ,KAAKS,uBAEhGT,KAAKa,cAAgBN,EAAWO,MAChCd,KAAKe,eAAiBR,EAAWS,OAEjChB,KAAKiB,YAAcV,EAAWO,MAAQP,EAAWS,OAEjD,IAAME,EAAaZ,EAAca,MAAML,MAElCI,GAAcA,EAAWE,MAAO,kBACpCpB,KAAKqB,sBAAwBC,WAAYJ,GAEzClB,KAAKqB,sBAAwBE,EAA8BjB,EAAeC,yBAI5E,SAAQiB,GACPxB,KAAKyB,cAAgBD,EAAQV,MAC7Bd,KAAK0B,eAAiBF,EAAQR,OAC9BhB,KAAK2B,sBAAwBH,EAAQI,cAErC5B,KAAK6B,wBAA0BL,EAAQM,gBACvC9B,KAAK+B,yBAA2BP,EAAQQ,2BAY1C,SAAST,EAA8BjB,EAAe2B,GACrD,IAAMC,EAAsB5B,EAAc6B,cAEpCC,EAAcd,WAAYY,EAAoBG,cAAcC,YAAYC,iBAAkBL,GAAsBpB,OAEtH,OAAOmB,EAAenB,MAAQsB,EAAc,IAW7C,SAASzB,EAA0B6B,EAASC,GAC3C,IAAMC,EAAc,IAAIlC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AAKE,SAAS4K,cAAezB,mCAYrC,WACC,OAAOrJ,KAAKE,SAASwG,OAAOC,QAAQC,KAAKmE,aAAaC,aAAchL,KAAK2F,mDAS1E,SAAgBuB,GAGf,IAFA,IAAMzD,GAAqB,WAAY,YAAa,eAAgB,eAEpEC,EAAA,EAAAC,EAA+BF,EAA/BC,EAAAC,EAAAC,OAAAF,IAAkD,CAA5C,IAAMuH,EAAetH,EAAAD,GAC1BwD,EAAWgE,YAAe,IAAIC,QAC7BxG,IAAK,MACLC,YACCC,MAAK,8BAAAtB,OAAiC6H,EAAiBH,OAErDI,wCAUN,SAAenE,GACdlH,KAAK4H,UAAY,IAAIxD,EAGrBpE,KAAK4H,UAAUyD,SAEfnE,EAAWgE,YAAalL,KAAK4H,UAAUpF,yCAtKxC,SAAuB0E,GACtB,OAAOA,EAAWpD,UAAUC,SAAU;;;;GA8LxC,SAASqH,EAAiB3I,GACzB,oCAAAc,OAAsCd,GAGvC,SAAS0H,EAAoBrE,GAC5B,OACChD,EAAGgD,EAAMwF,MACTrI,EAAG6C,EAAMyF,OAIX,SAASpC,EAAa3G,GACrB,OAAOA,GAAWA,EAAQH,eAAiBG,EAAQH,cAAc0B,SAAUvB,GAjB5E0B,eAAKwB,EAASvB","file":"js/chunk-2d0a3aa7.9a208a9a.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module widget/widgetresize/resizerstate\n */\n\nimport Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Stores the internal state of a single resizable object.\n *\n */\nexport default class ResizeState {\n\t/**\n\t * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.\n\t */\n\tconstructor( options ) {\n\t\t/**\n\t\t * The original width (pixels) of the resized object when the resize process was started.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #originalWidth\n\t\t */\n\n\t\t/**\n\t\t * The original height (pixels) of the resized object when the resize process was started.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #originalHeight\n\t\t */\n\n\t\t/**\n\t\t * The original width (percents) of the resized object when the resize process was started.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #originalWidthPercents\n\t\t */\n\n\t\t/**\n\t\t * The position of the handle that initiated the resizing. E.g. `\"top-left\"`, `\"bottom-right\"` etc. or `null`\n\t\t * if unknown.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {String|null} #activeHandlePosition\n\t\t */\n\t\tthis.set( 'activeHandlePosition', null );\n\n\t\t/**\n\t\t * The width (percents) proposed, but not committed yet, in the current resize process.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Number|null} #proposedWidthPercents\n\t\t */\n\t\tthis.set( 'proposedWidthPercents', null );\n\n\t\t/**\n\t\t * The width (pixels) proposed, but not committed yet, in the current resize process.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Number|null} #proposedWidthPixels\n\t\t */\n\t\tthis.set( 'proposedWidth', null );\n\n\t\t/**\n\t\t * The height (pixels) proposed, but not committed yet, in the current resize process.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Number|null} #proposedHeightPixels\n\t\t */\n\t\tthis.set( 'proposedHeight', null );\n\n\t\tthis.set( 'proposedHandleHostWidth', null );\n\t\tthis.set( 'proposedHandleHostHeight', null );\n\n\t\t/**\n\t\t * A width to height ratio of the resized image.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Number} #aspectRatio\n\t\t */\n\n\t\t/**\n\t\t * @private\n\t\t * @type {module:widget/widgetresize~ResizerOptions}\n\t\t */\n\t\tthis._options = options;\n\n\t\t/**\n\t\t * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor\n\t\t * traveled, so how much the image should be enlarged.\n\t\t * This information is only known after the DOM was rendered, so it will be updated later.\n\t\t *\n\t\t * @private\n\t\t * @type {Object}\n\t\t */\n\t\tthis._referenceCoordinates = null;\n\t}\n\n\t/**\n\t *\n\t * @param {HTMLElement} domResizeHandle The handle used to calculate the reference point.\n\t * @param {HTMLElement} domHandleHost\n\t * @param {HTMLElement} domResizeHost\n\t */\n\tbegin( domResizeHandle, domHandleHost, domResizeHost ) {\n\t\tconst clientRect = new Rect( domHandleHost );\n\n\t\tthis.activeHandlePosition = getHandlePosition( domResizeHandle );\n\n\t\tthis._referenceCoordinates = getAbsoluteBoundaryPoint( domHandleHost, getOppositePosition( this.activeHandlePosition ) );\n\n\t\tthis.originalWidth = clientRect.width;\n\t\tthis.originalHeight = clientRect.height;\n\n\t\tthis.aspectRatio = clientRect.width / clientRect.height;\n\n\t\tconst widthStyle = domResizeHost.style.width;\n\n\t\tif ( widthStyle && widthStyle.match( /^\\d+(\\.\\d*)?%$/ ) ) {\n\t\t\tthis.originalWidthPercents = parseFloat( widthStyle );\n\t\t} else {\n\t\t\tthis.originalWidthPercents = calculateHostPercentageWidth( domResizeHost, clientRect );\n\t\t}\n\t}\n\n\tupdate( newSize ) {\n\t\tthis.proposedWidth = newSize.width;\n\t\tthis.proposedHeight = newSize.height;\n\t\tthis.proposedWidthPercents = newSize.widthPercents;\n\n\t\tthis.proposedHandleHostWidth = newSize.handleHostWidth;\n\t\tthis.proposedHandleHostHeight = newSize.handleHostHeight;\n\t}\n}\n\nmix( ResizeState, ObservableMixin );\n\n// Calculates a relative width of a `domResizeHost` compared to it's parent in percents.\n//\n// @private\n// @param {HTMLElement} domResizeHost\n// @param {module:utils/dom/rect~Rect} resizeHostRect\n// @returns {Number}\nfunction calculateHostPercentageWidth( domResizeHost, resizeHostRect ) {\n\tconst domResizeHostParent = domResizeHost.parentElement;\n\t// Need to use computed style as it properly excludes parent's paddings from the returned value.\n\tconst parentWidth = parseFloat( domResizeHostParent.ownerDocument.defaultView.getComputedStyle( domResizeHostParent ).width );\n\n\treturn resizeHostRect.width / parentWidth * 100;\n}\n\n// Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.\n//\n// @private\n// @param {HTMLElement} element\n// @param {String} resizerPosition The position of the resize handle, e.g. `\"top-left\"`, `\"bottom-right\"`.\n// @returns {Object} return\n// @returns {Number} return.x\n// @returns {Number} return.y\nfunction getAbsoluteBoundaryPoint( element, resizerPosition ) {\n\tconst elementRect = new Rect( element );\n\tconst positionParts = resizerPosition.split( '-' );\n\tconst ret = {\n\t\tx: positionParts[ 1 ] == 'right' ? elementRect.right : elementRect.left,\n\t\ty: positionParts[ 0 ] == 'bottom' ? elementRect.bottom : elementRect.top\n\t};\n\n\tret.x += element.ownerDocument.defaultView.scrollX;\n\tret.y += element.ownerDocument.defaultView.scrollY;\n\n\treturn ret;\n}\n\n// @private\n// @param {String} resizerPosition The expected resizer position, like `\"top-left\"`, `\"bottom-right\"`.\n// @returns {String} A prefixed HTML class name for the resizer element.\nfunction getResizerHandleClass( resizerPosition ) {\n\treturn `ck-widget__resizer__handle-${ resizerPosition }`;\n}\n\n// Determines the position of a given resize handle.\n//\n// @private\n// @param {HTMLElement} domHandle Handle used to calculate the reference point.\n// @returns {String|undefined} Returns a string like `\"top-left\"` or `undefined` if not matched.\nfunction getHandlePosition( domHandle ) {\n\tconst resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];\n\n\tfor ( const position of resizerPositions ) {\n\t\tif ( domHandle.classList.contains( getResizerHandleClass( position ) ) ) {\n\t\t\treturn position;\n\t\t}\n\t}\n}\n\n// @private\n// @param {String} position Like `\"top-left\"`.\n// @returns {String} Inverted `position`, e.g. it returns `\"bottom-right\"` if `\"top-left\"` was given as `position`.\nfunction getOppositePosition( position ) {\n\tconst parts = position.split( '-' );\n\tconst replacements = {\n\t\ttop: 'bottom',\n\t\tbottom: 'top',\n\t\tleft: 'right',\n\t\tright: 'left'\n\t};\n\n\treturn `${ replacements[ parts[ 0 ] ] }-${ replacements[ parts[ 1 ] ] }`;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module widget/widgetresize/sizeview\n */\n\nimport View from '@ckeditor/ckeditor5-ui/src/view';\n\n/**\n * A view displaying the proposed new element size during the resizing.\n *\n * @protected\n * @extends {module:ui/view~View}\n */\nexport default class SizeView extends View {\n\tconstructor() {\n\t\tsuper();\n\n\t\t/**\n\t\t * The visibility of the view defined based on the existence of the host proposed dimensions.\n\t\t *\n\t\t * @private\n\t\t * @observable\n\t\t * @readonly\n\t\t * @member {Boolean} #_isVisible\n\t\t */\n\n\t\t/**\n\t\t * The text that will be displayed in the `SizeView` child.\n\t\t * It can be formatted as the pixel values (e.g. 10x20) or the percentage value (e.g. 10%).\n\t\t *\n\t\t * @private\n\t\t * @observable\n\t\t * @readonly\n\t\t * @member {Boolean} #_label\n\t\t */\n\n\t\t/**\n\t\t * The position of the view defined based on the host size and active handle position.\n\t\t *\n\t\t * @private\n\t\t * @observable\n\t\t * @readonly\n\t\t * @member {String} #_viewPosition\n\t\t */\n\n\t\tconst bind = this.bindTemplate;\n\n\t\tthis.setTemplate( {\n\t\t\ttag: 'div',\n\t\t\tattributes: {\n\t\t\t\tclass: [\n\t\t\t\t\t'ck',\n\t\t\t\t\t'ck-size-view',\n\t\t\t\t\tbind.to( '_viewPosition', value => value ? `ck-orientation-${ value }` : '' )\n\t\t\t\t],\n\t\t\t\tstyle: {\n\t\t\t\t\tdisplay: bind.if( '_isVisible', 'none', visible => !visible )\n\t\t\t\t}\n\t\t\t},\n\t\t\tchildren: [ {\n\t\t\t\ttext: bind.to( '_label' )\n\t\t\t} ]\n\t\t} );\n\t}\n\n\t/**\n\t * A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.\n\t *\n\t * @protected\n\t * @param {module:widget/widgetresize~ResizerOptions} options\n\t * An object defining the resizer options, used for setting the proper size label.\n\t * @param {module:widget/widgetresize/resizerstate~ResizeState} resizeState\n\t * The `ResizeState` class instance, used for keeping the `SizeView` state up to date.\n\t */\n\t_bindToState( options, resizeState ) {\n\t\tthis.bind( '_isVisible' ).to( resizeState, 'proposedWidth', resizeState, 'proposedHeight', ( width, height ) =>\n\t\t\twidth !== null && height !== null );\n\n\t\tthis.bind( '_label' ).to(\n\t\t\tresizeState, 'proposedHandleHostWidth',\n\t\t\tresizeState, 'proposedHandleHostHeight',\n\t\t\tresizeState, 'proposedWidthPercents',\n\t\t\t( width, height, widthPercents ) => {\n\t\t\t\tif ( options.unit === 'px' ) {\n\t\t\t\t\treturn `${ width }×${ height }`;\n\t\t\t\t} else {\n\t\t\t\t\treturn `${ widthPercents }%`;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.bind( '_viewPosition' ).to(\n\t\t\tresizeState, 'activeHandlePosition',\n\t\t\tresizeState, 'proposedHandleHostWidth',\n\t\t\tresizeState, 'proposedHandleHostHeight',\n\t\t\t// If the widget is too small to contain the size label, display the label above.\n\t\t\t( position, width, height ) => width < 50 || height < 50 ? 'above-center' : position\n\t\t);\n\t}\n\n\t/**\n\t * A method used for cleaning up. It removes the bindings and hides the view.\n\t *\n\t * @protected\n\t */\n\t_dismiss() {\n\t\tthis.unbind();\n\t\tthis._isVisible = false;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module widget/widgetresize/resizer\n */\n\nimport Template from '@ckeditor/ckeditor5-ui/src/template';\nimport Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\nimport ResizeState from './resizerstate';\nimport SizeView from './sizeview';\n\n/**\n * Represents a resizer for a single resizable object.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class Resizer {\n\t/**\n\t * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.\n\t */\n\tconstructor( options ) {\n\t\t/**\n\t\t * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.\n\t\t *\n\t\t * Note that a new state is created for each resize transaction.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:widget/widgetresize/resizerstate~ResizerState} #state\n\t\t */\n\n\t\t/**\n\t\t * A view displaying the proposed new element size during the resizing.\n\t\t *\n\t\t * @protected\n\t\t * @readonly\n\t\t * @member {module:widget/widgetresize/sizeview~SizeView} #_sizeView\n\t\t */\n\n\t\t/**\n\t\t * Options passed to the {@link #constructor}.\n\t\t *\n\t\t * @private\n\t\t * @type {module:widget/widgetresize~ResizerOptions}\n\t\t */\n\t\tthis._options = options;\n\n\t\t/**\n\t\t * A wrapper that is controlled by the resizer. This is usually a widget element.\n\t\t *\n\t\t * @private\n\t\t * @type {module:engine/view/element~Element|null}\n\t\t */\n\t\tthis._viewResizerWrapper = null;\n\n\t\t/**\n\t\t * The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.\n\t\t *\n\t\t * @private\n\t\t * @member {Number|String|undefined} #_initialViewWidth\n\t\t */\n\n\t\t/**\n\t\t * @observable\n\t\t */\n\t\tthis.set( 'isEnabled', true );\n\n\t\tthis.decorate( 'begin' );\n\t\tthis.decorate( 'cancel' );\n\t\tthis.decorate( 'commit' );\n\t\tthis.decorate( 'updateSize' );\n\n\t\tthis.on( 'commit', event => {\n\t\t\t// State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is\n\t\t\t// cleaned up (#5195).\n\t\t\tif ( !this.state.proposedWidth && !this.state.proposedWidthPercents ) {\n\t\t\t\tthis._cleanup();\n\t\t\t\tevent.stop();\n\t\t\t}\n\t\t}, { priority: 'high' } );\n\n\t\tthis.on( 'change:isEnabled', () => {\n\t\t\t// We should redraw the resize handles when the plugin is enabled again.\n\t\t\t// Otherwise they won't show up.\n\t\t\tif ( this.isEnabled ) {\n\t\t\t\tthis.redraw();\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Attaches the resizer to the DOM.\n\t */\n\tattach() {\n\t\tconst that = this;\n\t\tconst widgetElement = this._options.viewElement;\n\t\tconst editingView = this._options.editor.editing.view;\n\n\t\teditingView.change( writer => {\n\t\t\tconst viewResizerWrapper = writer.createUIElement( 'div', {\n\t\t\t\tclass: 'ck ck-reset_all ck-widget__resizer'\n\t\t\t}, function( domDocument ) {\n\t\t\t\tconst domElement = this.toDomElement( domDocument );\n\n\t\t\t\tthat._appendHandles( domElement );\n\t\t\t\tthat._appendSizeUI( domElement );\n\n\t\t\t\tthat.on( 'change:isEnabled', ( evt, propName, newValue ) => {\n\t\t\t\t\tdomElement.style.display = newValue ? '' : 'none';\n\t\t\t\t} );\n\n\t\t\t\tdomElement.style.display = that.isEnabled ? '' : 'none';\n\n\t\t\t\treturn domElement;\n\t\t\t} );\n\n\t\t\t// Append the resizer wrapper to the widget's wrapper.\n\t\t\twriter.insert( writer.createPositionAt( widgetElement, 'end' ), viewResizerWrapper );\n\t\t\twriter.addClass( 'ck-widget_with-resizer', widgetElement );\n\n\t\t\tthis._viewResizerWrapper = viewResizerWrapper;\n\t\t} );\n\t}\n\n\t/**\n\t * Starts the resizing process.\n\t *\n\t * Creates a new {@link #state} for the current process.\n\t *\n\t * @fires begin\n\t * @param {HTMLElement} domResizeHandle Clicked handle.\n\t */\n\tbegin( domResizeHandle ) {\n\t\tthis.state = new ResizeState( this._options );\n\n\t\tthis._sizeView._bindToState( this._options, this.state );\n\n\t\tthis._initialViewWidth = this._options.viewElement.getStyle( 'width' );\n\n\t\tthis.state.begin( domResizeHandle, this._getHandleHost(), this._getResizeHost() );\n\t}\n\n\t/**\n\t * Updates the proposed size based on `domEventData`.\n\t *\n\t * @fires updateSize\n\t * @param {Event} domEventData\n\t */\n\tupdateSize( domEventData ) {\n\t\tconst newSize = this._proposeNewSize( domEventData );\n\t\tconst editingView = this._options.editor.editing.view;\n\n\t\teditingView.change( writer => {\n\t\t\tconst unit = this._options.unit || '%';\n\t\t\tconst newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;\n\n\t\t\twriter.setStyle( 'width', newWidth, this._options.viewElement );\n\t\t} );\n\n\t\t// Get an actual image width, and:\n\t\t// * reflect this size to the resize wrapper\n\t\t// * apply this **real** size to the state\n\t\tconst domHandleHost = this._getHandleHost();\n\t\tconst domHandleHostRect = new Rect( domHandleHost );\n\n\t\tnewSize.handleHostWidth = Math.round( domHandleHostRect.width );\n\t\tnewSize.handleHostHeight = Math.round( domHandleHostRect.height );\n\n\t\t// Handle max-width limitation.\n\t\tconst domResizeHostRect = new Rect( domHandleHost );\n\n\t\tnewSize.width = Math.round( domResizeHostRect.width );\n\t\tnewSize.height = Math.round( domResizeHostRect.height );\n\n\t\tthis.redraw( domHandleHostRect );\n\n\t\tthis.state.update( newSize );\n\t}\n\n\t/**\n\t * Applies the geometry proposed with the resizer.\n\t *\n\t * @fires commit\n\t */\n\tcommit() {\n\t\tconst unit = this._options.unit || '%';\n\t\tconst newValue = ( unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth ) + unit;\n\n\t\t// Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.\n\t\tthis._options.editor.editing.view.change( () => {\n\t\t\tthis._cleanup();\n\t\t\tthis._options.onCommit( newValue );\n\t\t} );\n\t}\n\n\t/**\n\t * Cancels and rejects the proposed resize dimensions, hiding the UI.\n\t *\n\t * @fires cancel\n\t */\n\tcancel() {\n\t\tthis._cleanup();\n\t}\n\n\t/**\n\t * Destroys the resizer.\n\t */\n\tdestroy() {\n\t\tthis.cancel();\n\t}\n\n\t/**\n\t * Redraws the resizer.\n\t *\n\t * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.\n\t */\n\tredraw( handleHostRect ) {\n\t\tconst domWrapper = this._domResizerWrapper;\n\n\t\t// Refresh only if resizer exists in the DOM.\n\t\tif ( !existsInDom( domWrapper ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst widgetWrapper = domWrapper.parentElement;\n\t\tconst handleHost = this._getHandleHost();\n\t\tconst resizerWrapper = this._viewResizerWrapper;\n\t\tconst currentDimensions = [\n\t\t\tresizerWrapper.getStyle( 'width' ),\n\t\t\tresizerWrapper.getStyle( 'height' ),\n\t\t\tresizerWrapper.getStyle( 'left' ),\n\t\t\tresizerWrapper.getStyle( 'top' )\n\t\t];\n\t\tlet newDimensions;\n\n\t\tif ( widgetWrapper.isSameNode( handleHost ) ) {\n\t\t\tconst clientRect = handleHostRect || new Rect( handleHost );\n\n\t\t\tnewDimensions = [\n\t\t\t\tclientRect.width + 'px',\n\t\t\t\tclientRect.height + 'px',\n\t\t\t\tundefined,\n\t\t\t\tundefined\n\t\t\t];\n\t\t}\n\t\t// In case a resizing host is not a widget wrapper, we need to compensate\n\t\t// for any additional offsets the resize host might have. E.g. wrapper padding\n\t\t// or simply another editable. By doing that the border and resizers are shown\n\t\t// only around the resize host.\n\t\telse {\n\t\t\tnewDimensions = [\n\t\t\t\thandleHost.offsetWidth + 'px',\n\t\t\t\thandleHost.offsetHeight + 'px',\n\t\t\t\thandleHost.offsetLeft + 'px',\n\t\t\t\thandleHost.offsetTop + 'px'\n\t\t\t];\n\t\t}\n\n\t\t// Make changes to the view only if the resizer should actually get new dimensions.\n\t\t// Otherwise, if View#change() was always called, this would cause EditorUI#update\n\t\t// loops because the WidgetResize plugin listens to EditorUI#update and updates\n\t\t// the resizer.\n\t\t// https://github.com/ckeditor/ckeditor5/issues/7633\n\t\tif ( compareArrays( currentDimensions, newDimensions ) !== 'same' ) {\n\t\t\tthis._options.editor.editing.view.change( writer => {\n\t\t\t\twriter.setStyle( {\n\t\t\t\t\twidth: newDimensions[ 0 ],\n\t\t\t\t\theight: newDimensions[ 1 ],\n\t\t\t\t\tleft: newDimensions[ 2 ],\n\t\t\t\t\ttop: newDimensions[ 3 ]\n\t\t\t\t}, resizerWrapper );\n\t\t\t} );\n\t\t}\n\t}\n\n\tcontainsHandle( domElement ) {\n\t\treturn this._domResizerWrapper.contains( domElement );\n\t}\n\n\tstatic isResizeHandle( domElement ) {\n\t\treturn domElement.classList.contains( 'ck-widget__resizer__handle' );\n\t}\n\n\t/**\n\t * Cleans up the context state.\n\t *\n\t * @protected\n\t */\n\t_cleanup() {\n\t\tthis._sizeView._dismiss();\n\n\t\tconst editingView = this._options.editor.editing.view;\n\n\t\teditingView.change( writer => {\n\t\t\twriter.setStyle( 'width', this._initialViewWidth, this._options.viewElement );\n\t\t} );\n\t}\n\n\t/**\n\t * Calculates the proposed size as the resize handles are dragged.\n\t *\n\t * @private\n\t * @param {Event} domEventData Event data that caused the size update request. It should be used to calculate the proposed size.\n\t * @returns {Object} return\n\t * @returns {Number} return.width Proposed width.\n\t * @returns {Number} return.height Proposed height.\n\t */\n\t_proposeNewSize( domEventData ) {\n\t\tconst state = this.state;\n\t\tconst currentCoordinates = extractCoordinates( domEventData );\n\t\tconst isCentered = this._options.isCentered ? this._options.isCentered( this ) : true;\n\n\t\t// Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number\n\t\t// meaning that it has been shrunk.\n\t\t//\n\t\t// +----------------+--+\n\t\t// | | |\n\t\t// | img | |\n\t\t// | /handle host | |\n\t\t// +----------------+ | ^\n\t\t// | | | - enlarge y\n\t\t// +-------------------+ v\n\t\t// \t\t\t\t\t<-->\n\t\t// \t\t\t\t\t enlarge x\n\t\tconst enlargement = {\n\t\t\tx: state._referenceCoordinates.x - ( currentCoordinates.x + state.originalWidth ),\n\t\t\ty: ( currentCoordinates.y - state.originalHeight ) - state._referenceCoordinates.y\n\t\t};\n\n\t\tif ( isCentered && state.activeHandlePosition.endsWith( '-right' ) ) {\n\t\t\tenlargement.x = currentCoordinates.x - ( state._referenceCoordinates.x + state.originalWidth );\n\t\t}\n\n\t\t// Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from\n\t\t// one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.\n\t\tif ( isCentered ) {\n\t\t\tenlargement.x *= 2;\n\t\t}\n\n\t\t// const resizeHost = this._getResizeHost();\n\n\t\t// The size proposed by the user. It does not consider the aspect ratio.\n\t\tconst proposedSize = {\n\t\t\twidth: Math.abs( state.originalWidth + enlargement.x ),\n\t\t\theight: Math.abs( state.originalHeight + enlargement.y )\n\t\t};\n\n\t\t// Dominant determination must take the ratio into account.\n\t\tproposedSize.dominant = proposedSize.width / state.aspectRatio > proposedSize.height ? 'width' : 'height';\n\t\tproposedSize.max = proposedSize[ proposedSize.dominant ];\n\n\t\t// Proposed size, respecting the aspect ratio.\n\t\tconst targetSize = {\n\t\t\twidth: proposedSize.width,\n\t\t\theight: proposedSize.height\n\t\t};\n\n\t\tif ( proposedSize.dominant == 'width' ) {\n\t\t\ttargetSize.height = targetSize.width / state.aspectRatio;\n\t\t} else {\n\t\t\ttargetSize.width = targetSize.height * state.aspectRatio;\n\t\t}\n\n\t\treturn {\n\t\t\twidth: Math.round( targetSize.width ),\n\t\t\theight: Math.round( targetSize.height ),\n\t\t\twidthPercents: Math.min( Math.round( state.originalWidthPercents / state.originalWidth * targetSize.width * 100 ) / 100, 100 )\n\t\t};\n\t}\n\n\t/**\n\t * Obtains the resize host.\n\t *\n\t * Resize host is an object that receives dimensions which are the result of resizing.\n\t *\n\t * @protected\n\t * @returns {HTMLElement}\n\t */\n\t_getResizeHost() {\n\t\tconst widgetWrapper = this._domResizerWrapper.parentElement;\n\n\t\treturn this._options.getResizeHost( widgetWrapper );\n\t}\n\n\t/**\n\t * Obtains the handle host.\n\t *\n\t * Handle host is an object that the handles are aligned to.\n\t *\n\t * Handle host will not always be an entire widget itself. Take an image as an example. The image widget\n\t * contains an image and a caption. Only the image should be surrounded with handles.\n\t *\n\t * @protected\n\t * @returns {HTMLElement}\n\t */\n\t_getHandleHost() {\n\t\tconst widgetWrapper = this._domResizerWrapper.parentElement;\n\n\t\treturn this._options.getHandleHost( widgetWrapper );\n\t}\n\n\t/**\n\t * DOM container of the entire resize UI.\n\t *\n\t * Note that this property will have a value only after the element bound with the resizer is rendered\n\t * (otherwise `null`).\n\t *\n\t * @private\n\t * @member {HTMLElement|null}\n\t */\n\tget _domResizerWrapper() {\n\t\treturn this._options.editor.editing.view.domConverter.mapViewToDom( this._viewResizerWrapper );\n\t}\n\n\t/**\n\t * Renders the resize handles in the DOM.\n\t *\n\t * @private\n\t * @param {HTMLElement} domElement The resizer wrapper.\n\t */\n\t_appendHandles( domElement ) {\n\t\tconst resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];\n\n\t\tfor ( const currentPosition of resizerPositions ) {\n\t\t\tdomElement.appendChild( ( new Template( {\n\t\t\t\ttag: 'div',\n\t\t\t\tattributes: {\n\t\t\t\t\tclass: `ck-widget__resizer__handle ${ getResizerClass( currentPosition ) }`\n\t\t\t\t}\n\t\t\t} ).render() ) );\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the {@link #_sizeView} property and adds it to the passed `domElement`.\n\t *\n\t * @private\n\t * @param {HTMLElement} domElement\n\t */\n\t_appendSizeUI( domElement ) {\n\t\tthis._sizeView = new SizeView();\n\n\t\t// Make sure icon#element is rendered before passing to appendChild().\n\t\tthis._sizeView.render();\n\n\t\tdomElement.appendChild( this._sizeView.element );\n\t}\n\n\t/**\n\t * @event begin\n\t */\n\n\t/**\n\t * @event updateSize\n\t */\n\n\t/**\n\t * @event commit\n\t */\n\n\t/**\n\t * @event cancel\n\t */\n}\n\nmix( Resizer, ObservableMixin );\n\n// @private\n// @param {String} resizerPosition Expected resizer position like `\"top-left\"`, `\"bottom-right\"`.\n// @returns {String} A prefixed HTML class name for the resizer element\nfunction getResizerClass( resizerPosition ) {\n\treturn `ck-widget__resizer__handle-${ resizerPosition }`;\n}\n\nfunction extractCoordinates( event ) {\n\treturn {\n\t\tx: event.pageX,\n\t\ty: event.pageY\n\t};\n}\n\nfunction existsInDom( element ) {\n\treturn element && element.ownerDocument && element.ownerDocument.contains( element );\n}\n"],"sourceRoot":""}