{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js"],"names":["InsertColumnCommand","editor","_this","options","arguments","length","undefined","Object","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_1__","this","_super","call","order","selection","model","document","isAnyCellSelected","getSelectionAffectedTableCells","isEnabled","tableUtils","plugins","get","insertBefore","affectedTableCells","columnIndexes","getColumnIndexes","column","first","last","table","findAncestor","insertColumns","columns","at","Command","InsertTableCommand","schema","isAllowedInParent","config","insertionRange","findOptimalInsertionRange","defaultRows","defaultHeadings","rows","defaultColumns","headingRows","headingColumns","change","writer","createTable","insertContent","setSelection","createPositionAt","getNodeByPath","positionParent","getFirstPosition","parent","validParent","root","checkChild","InsertRowCommand","insertAbove","rowIndexes","getRowIndexes","row","insertRows","copyStructureFromAbove"],"mappings":";;;;OA4BqBA,6CASpB,SAAAA,EAAaC,GAAuB,IAAAC,EAAfC,EAAeC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,aAAAG,OAAAC,EAAA,KAAAD,CAAAE,KAAAT,GACnCE,EAAAQ,EAAAC,KAAAF,KAAOR,GAQPC,EAAKU,MAAQT,EAAQS,OAAS,QATKV,gDAepC,WACC,IAAMW,EAAYJ,KAAKR,OAAOa,MAAMC,SAASF,UACvCG,IAAsBC,eAAgCJ,GAAYR,OAExEI,KAAKS,UAAYF,yBAWlB,WACC,IAAMf,EAASQ,KAAKR,OACdY,EAAYZ,EAAOa,MAAMC,SAASF,UAClCM,EAAalB,EAAOmB,QAAQC,IAAK,cACjCC,EAA8B,SAAfb,KAAKG,MAEpBW,EAAqBN,eAAgCJ,GACrDW,EAAgBC,eAAkBF,GAElCG,EAASJ,EAAeE,EAAcG,MAAQH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AAAE,KAAAmD,GACnC1D,EAAAQ,EAAAC,KAAAF,KAAOR,GAQPC,EAAKU,MAAQT,EAAQS,OAAS,QATKV,gDAepC,WACC,IAAMW,EAAYJ,KAAKR,OAAOa,MAAMC,SAASF,UACvCG,IAAsBC,eAAgCJ,GAAYR,OAExEI,KAAKS,UAAYF,yBAUlB,WACC,IAAMf,EAASQ,KAAKR,OACdY,EAAYZ,EAAOa,MAAMC,SAASF,UAClCM,EAAalB,EAAOmB,QAAQC,IAAK,cACjCwC,EAA6B,UAAfpD,KAAKG,MAEnBW,EAAqBN,eAAgCJ,GACrDiD,EAAaC,eAAexC,GAE5ByC,EAAMH,EAAcC,EAAWnC,MAAQmC,EAAWlC,KAClDC,EAAQN,EAAoB,GAAIO,aAAc,SAEpDX,EAAW8C,WAAYpC,GAASI,GAAI4B,EAAcG,EAAMA,EAAM,EAAGE,wBAAyBL,WAlD9C3B","file":"js/chunk-7962589a.9a620aef.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 table/commands/insertcolumncommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection';\n\n/**\n * The insert column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and\n * `'insertTableColumnRight'` editor commands.\n *\n * To insert a column to the left of the selected cell, execute the following command:\n *\n *\t\teditor.execute( 'insertTableColumnLeft' );\n *\n * To insert a column to the right of the selected cell, execute the following command:\n *\n *\t\teditor.execute( 'insertTableColumnRight' );\n *\n * @extends module:core/command~Command\n */\nexport default class InsertColumnCommand extends Command {\n\t/**\n\t * Creates a new `InsertColumnCommand` instance.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.\n\t * @param {Object} options\n\t * @param {String} [options.order=\"right\"] The order of insertion relative to the column in which the caret is located.\n\t * Possible values: `\"left\"` and `\"right\"`.\n\t */\n\tconstructor( editor, options = {} ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * The order of insertion relative to the column in which the caret is located.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order\n\t\t */\n\t\tthis.order = options.order || 'right';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst selection = this.editor.model.document.selection;\n\t\tconst isAnyCellSelected = !!getSelectionAffectedTableCells( selection ).length;\n\n\t\tthis.isEnabled = isAnyCellSelected;\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column\n\t * in which the selection is set.\n\t *\n\t * @fires execute\n\t */\n\texecute() {\n\t\tconst editor = this.editor;\n\t\tconst selection = editor.model.document.selection;\n\t\tconst tableUtils = editor.plugins.get( 'TableUtils' );\n\t\tconst insertBefore = this.order === 'left';\n\n\t\tconst affectedTableCells = getSelectionAffectedTableCells( selection );\n\t\tconst columnIndexes = getColumnIndexes( affectedTableCells );\n\n\t\tconst column = insertBefore ? columnIndexes.first : columnIndexes.last;\n\t\tconst table = affectedTableCells[ 0 ].findAncestor( 'table' );\n\n\t\ttableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );\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 table/commands/inserttablecommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget';\n\n/**\n * The insert table command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.\n *\n * To insert a table at the current selection, execute the command and specify the dimensions:\n *\n *\t\teditor.execute( 'insertTable', { rows: 20, columns: 5 } );\n *\n * @extends module:core/command~Command\n */\nexport default class InsertTableCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst model = this.editor.model;\n\t\tconst selection = model.document.selection;\n\t\tconst schema = model.schema;\n\n\t\tthis.isEnabled = isAllowedInParent( selection, schema );\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * Inserts a table with the given number of rows and columns into the editor.\n\t *\n\t * @param {Object} options\n\t * @param {Number} [options.rows=2] The number of rows to create in the inserted table.\n\t * @param {Number} [options.columns=2] The number of columns to create in the inserted table.\n\t * @param {Number} [options.headingRows] The number of heading rows.\n\t * If not provided it will default to {@link module:table/table~TableConfig#defaultHeadings `config.table.defaultHeadings.rows`}\n\t * table config.\n\t * @param {Number} [options.headingColumns] The number of heading columns.\n\t * If not provided it will default to {@link module:table/table~TableConfig#defaultHeadings `config.table.defaultHeadings.columns`}\n\t * table config.\n\t * @fires execute\n\t */\n\texecute( options = {} ) {\n\t\tconst model = this.editor.model;\n\t\tconst selection = model.document.selection;\n\t\tconst tableUtils = this.editor.plugins.get( 'TableUtils' );\n\t\tconst config = this.editor.config.get( 'table' );\n\n\t\tconst insertionRange = findOptimalInsertionRange( selection, model );\n\n\t\tconst defaultRows = config.defaultHeadings.rows;\n\t\tconst defaultColumns = config.defaultHeadings.columns;\n\n\t\tif ( options.headingRows === undefined && defaultRows ) {\n\t\t\toptions.headingRows = defaultRows;\n\t\t}\n\n\t\tif ( options.headingColumns === undefined && defaultColumns ) {\n\t\t\toptions.headingColumns = defaultColumns;\n\t\t}\n\n\t\tmodel.change( writer => {\n\t\t\tconst table = tableUtils.createTable( writer, options );\n\n\t\t\tmodel.insertContent( table, insertionRange );\n\n\t\t\twriter.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );\n\t\t} );\n\t}\n}\n\n// Checks if the table is allowed in the parent.\n//\n// @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n// @param {module:engine/model/schema~Schema} schema\n// @returns {Boolean}\nfunction isAllowedInParent( selection, schema ) {\n\tconst positionParent = selection.getFirstPosition().parent;\n\tconst validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;\n\n\treturn schema.checkChild( validParent, 'table' );\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 table/commands/insertrowcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';\n\n/**\n * The insert row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and\n * `'insertTableRowAbove'` editor commands.\n *\n * To insert a row below the selected cell, execute the following command:\n *\n *\t\teditor.execute( 'insertTableRowBelow' );\n *\n * To insert a row above the selected cell, execute the following command:\n *\n *\t\teditor.execute( 'insertTableRowAbove' );\n *\n * @extends module:core/command~Command\n */\nexport default class InsertRowCommand extends Command {\n\t/**\n\t * Creates a new `InsertRowCommand` instance.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.\n\t * @param {Object} options\n\t * @param {String} [options.order=\"below\"] The order of insertion relative to the row in which the caret is located.\n\t * Possible values: `\"above\"` and `\"below\"`.\n\t */\n\tconstructor( editor, options = {} ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * The order of insertion relative to the row in which the caret is located.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order\n\t\t */\n\t\tthis.order = options.order || 'below';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst selection = this.editor.model.document.selection;\n\t\tconst isAnyCellSelected = !!getSelectionAffectedTableCells( selection ).length;\n\n\t\tthis.isEnabled = isAnyCellSelected;\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.\n\t *\n\t * @fires execute\n\t */\n\texecute() {\n\t\tconst editor = this.editor;\n\t\tconst selection = editor.model.document.selection;\n\t\tconst tableUtils = editor.plugins.get( 'TableUtils' );\n\t\tconst insertAbove = this.order === 'above';\n\n\t\tconst affectedTableCells = getSelectionAffectedTableCells( selection );\n\t\tconst rowIndexes = getRowIndexes( affectedTableCells );\n\n\t\tconst row = insertAbove ? rowIndexes.first : rowIndexes.last;\n\t\tconst table = affectedTableCells[ 0 ].findAncestor( 'table' );\n\n\t\ttableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );\n\t}\n}\n"],"sourceRoot":""}