{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js"],"names":["ParagraphCommand","model","this","editor","document","block","first","selection","getSelectedBlocks","value","is","isEnabled","checkCanBecomeParagraph","schema","options","change","writer","blocks","rename","Command","checkChild","parent","isObject","InsertParagraphCommand","position","paragraph","createElement","allowedParent","findAllowedParent","split","insertContent","setSelection","Paragraph","commands","add","register","inheritAllFrom","conversion","elementToElement","view","for","viewElement","paragraphLikeElements","has","name","isEmpty","converterPriority","Plugin","Set"],"mappings":"8QAiBqBA,E,iMAanB,IAAMC,EAAQC,KAAKC,OAAOF,MACpBG,EAAWH,EAAMG,SACjBC,EAAQC,eAAOF,EAASG,UAAUC,qBAExCN,KAAKO,QAAUJ,GAASA,EAAMK,GAAI,UAAW,aAC7CR,KAAKS,YAAcN,GAASO,EAAyBP,EAAOJ,EAAMY,U,gCAa3C,IAAfC,EAAe,uDAAL,GACZb,EAAQC,KAAKC,OAAOF,MACpBG,EAAWH,EAAMG,SAEvBH,EAAMc,QAAQ,SAAAC,GACb,IAAMC,GAAWH,EAAQP,WAAaH,EAASG,WAAYC,oBADpC,uBAGvB,YAAqBS,EAArB,+CAA8B,KAAlBZ,EAAkB,SACvBA,EAAMK,GAAI,UAAW,cAAiBE,EAAyBP,EAAOJ,EAAMY,SACjFG,EAAOE,OAAQb,EAAO,cALD,0F,GAnCoBc,QAqD9C,SAASP,EAAyBP,EAAOQ,GACxC,OAAOA,EAAOO,WAAYf,EAAMgB,OAAQ,eAAkBR,EAAOS,SAAUjB,G;;;;OC3CvDkB,E,+LASXT,GACR,IAAMb,EAAQC,KAAKC,OAAOF,MACtBuB,EAAWV,EAAQU,SAEvBvB,EAAMc,QAAQ,SAAAC,GACb,IAAMS,EAAYT,EAAOU,cAAe,aAExC,IAAMzB,EAAMY,OAAOO,WAAYI,EAASH,OAAQI,GAAc,CAC7D,IAAME,EAAgB1B,EAAMY,OAAOe,kBAAmBJ,EAAUC,GAIhE,IAAME,EACL,OAGDH,EAAWR,EAAOa,MAAOL,EAAUG,GAAgBH,SAGpDvB,EAAM6B,cAAeL,EAAWD,GAEhCR,EAAOe,aAAcN,EAAW,a,GA9BiBN,Q;;;;;ICA/Ba,E,8LAYnB,IAAM7B,EAASD,KAAKC,OACdF,EAAQE,EAAOF,MAErBE,EAAO8B,SAASC,IAAK,YAAa,IAAIlC,EAAkBG,IACxDA,EAAO8B,SAASC,IAAK,kBAAmB,IAAIX,EAAwBpB,IAGpEF,EAAMY,OAAOsB,SAAU,YAAa,CAAEC,eAAgB,WAEtDjC,EAAOkC,WAAWC,iBAAkB,CAAErC,MAAO,YAAasC,KAAM,MAGhEpC,EAAOkC,WAAWG,IAAK,UAAWF,iBAAkB,CACnDrC,MAAO,SAAEwC,EAAF,GAA+B,IAAdzB,EAAc,EAAdA,OACvB,OAAMgB,EAAUU,sBAAsBC,IAAKF,EAAYG,MAKlDH,EAAYI,QACT,KAGD7B,EAAOU,cAAe,aARrB,MAUTa,KAAM,KACNO,kBAAmB,W,kCAjCpB,MAAO,gB,GAL8BC,QA0EvCf,EAAUU,sBAAwB,IAAIM,IAAK,CAC1C,aACA,KACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA","file":"js/chunk-vendors~7ca93533.e42f3a21.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 paragraph/paragraphcommand\n */\n\nimport Command from '@ckeditor/ckeditor5-core/src/command';\nimport first from '@ckeditor/ckeditor5-utils/src/first';\n\n/**\n * The paragraph command.\n *\n * @extends module:core/command~Command\n */\nexport default class ParagraphCommand extends Command {\n\t/**\n\t * The value of the command. Indicates whether the selection start is placed in a paragraph.\n\t *\n\t * @readonly\n\t * @observable\n\t * @member {Boolean} #value\n\t */\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst model = this.editor.model;\n\t\tconst document = model.document;\n\t\tconst block = first( document.selection.getSelectedBlocks() );\n\n\t\tthis.value = !!block && block.is( 'element', 'paragraph' );\n\t\tthis.isEnabled = !!block && checkCanBecomeParagraph( block, model.schema );\n\t}\n\n\t/**\n\t * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection\n\t * will be turned to paragraphs.\n\t *\n\t * @fires execute\n\t * @param {Object} [options] Options for the executed command.\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} [options.selection]\n\t * The selection that the command should be applied to.\n\t * By default, if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.\n\t */\n\texecute( options = {} ) {\n\t\tconst model = this.editor.model;\n\t\tconst document = model.document;\n\n\t\tmodel.change( writer => {\n\t\t\tconst blocks = ( options.selection || document.selection ).getSelectedBlocks();\n\n\t\t\tfor ( const block of blocks ) {\n\t\t\t\tif ( !block.is( 'element', 'paragraph' ) && checkCanBecomeParagraph( block, model.schema ) ) {\n\t\t\t\t\twriter.rename( block, 'paragraph' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}\n\n// Checks whether the given block can be replaced by a paragraph.\n//\n// @private\n// @param {module:engine/model/element~Element} block A block to be tested.\n// @param {module:engine/model/schema~Schema} schema The schema of the document.\n// @returns {Boolean}\nfunction checkCanBecomeParagraph( block, schema ) {\n\treturn schema.checkChild( block.parent, 'paragraph' ) && !schema.isObject( block );\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 paragraph/insertparagraphcommand\n */\n\nimport Command from '@ckeditor/ckeditor5-core/src/command';\n\n/**\n * The insert paragraph command. It inserts a new paragraph at a specific\n * {@link module:engine/model/position~Position document position}.\n *\n *\t\t// Insert a new paragraph before an element in the document.\n *\t\teditor.execute( 'insertParagraph', {\n *\t\t\tposition: editor.model.createPositionBefore( element )\n *\t\t} );\n *\n * If a paragraph is disallowed in the context of the specific position, the command\n * will attempt to split position ancestors to find a place where it is possible\n * to insert a paragraph.\n *\n * **Note**: This command moves the selection to the inserted paragraph.\n *\n * @extends module:core/command~Command\n */\nexport default class InsertParagraphCommand extends Command {\n\t/**\n\t * Executes the command.\n\t *\n\t * @param {Object} options Options for the executed command.\n\t * @param {module:engine/model/position~Position} options.position The model position at which\n\t * the new paragraph will be inserted.\n\t * @fires execute\n\t */\n\texecute( options ) {\n\t\tconst model = this.editor.model;\n\t\tlet position = options.position;\n\n\t\tmodel.change( writer => {\n\t\t\tconst paragraph = writer.createElement( 'paragraph' );\n\n\t\t\tif ( !model.schema.checkChild( position.parent, paragraph ) ) {\n\t\t\t\tconst allowedParent = model.schema.findAllowedParent( position, paragraph );\n\n\t\t\t\t// It could be there's no ancestor limit that would allow paragraph.\n\t\t\t\t// In theory, \"paragraph\" could be disallowed even in the \"$root\".\n\t\t\t\tif ( !allowedParent ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tposition = writer.split( position, allowedParent ).position;\n\t\t\t}\n\n\t\t\tmodel.insertContent( paragraph, position );\n\n\t\t\twriter.setSelection( paragraph, 'in' );\n\t\t} );\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 paragraph/paragraph\n */\n\nimport ParagraphCommand from './paragraphcommand';\nimport InsertParagraphCommand from './insertparagraphcommand';\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\n\n/**\n * The paragraph feature for the editor.\n *\n * It introduces the `` element in the model which renders as a `

` element in the DOM and data.\n *\n * It also brings two editors commands:\n *\n * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all\n * blocks in the model selection into paragraphs.\n * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command\n * that inserts a new paragraph at a specified location in the model.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Paragraph extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Paragraph';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\n\t\teditor.commands.add( 'paragraph', new ParagraphCommand( editor ) );\n\t\teditor.commands.add( 'insertParagraph', new InsertParagraphCommand( editor ) );\n\n\t\t// Schema.\n\t\tmodel.schema.register( 'paragraph', { inheritAllFrom: '$block' } );\n\n\t\teditor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );\n\n\t\t// Conversion for paragraph-like elements which has not been converted by any plugin.\n\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t\t\tmodel: ( viewElement, { writer } ) => {\n\t\t\t\tif ( !Paragraph.paragraphLikeElements.has( viewElement.name ) ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Do not auto-paragraph empty elements.\n\t\t\t\tif ( viewElement.isEmpty ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn writer.createElement( 'paragraph' );\n\t\t\t},\n\t\t\tview: /.+/,\n\t\t\tconverterPriority: 'low'\n\t\t} );\n\t}\n}\n\n/**\n * A list of element names which should be treated by the autoparagraphing algorithms as\n * paragraph-like. This means that e.g. the following content:\n *\n *\t\t

Foo

\n *\t\t\n *\t\t\t\n *\t\t\t\t\n *\t\t\t\t\n *\t\t\t\n *\t\t
X\n *\t\t\t\t\t
    \n *\t\t\t\t\t\t
  • Y
  • \n *\t\t\t\t\t\t
  • Z
  • \n *\t\t\t\t\t
\n *\t\t\t\t
\n *\n * contains five paragraph-like elements: `

`, two ``s and two `
  • `s.\n * Hence, if none of the features is going to convert those elements the above content will be automatically handled\n * by the paragraph feature and converted to:\n *\n *\t\t

    Foo

    \n *\t\t

    X

    \n *\t\t

    Y

    \n *\t\t

    Z

    \n *\n * Note: The `` containing two `
  • ` elements was ignored as the innermost paragraph-like elements\n * have a priority upon conversion.\n *\n * @member {Set.} module:paragraph/paragraph~Paragraph.paragraphLikeElements\n */\nParagraph.paragraphLikeElements = new Set( [\n\t'blockquote',\n\t'dd',\n\t'div',\n\t'dt',\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'li',\n\t'p',\n\t'td',\n\t'th'\n] );\n"],"sourceRoot":""}