{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-typing/src/index.js","webpack:///./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js","webpack:///./node_modules/@ckeditor/ckeditor5-typing/src/input.js"],"names":["_typing__WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","d","__webpack_exports__","_input__WEBPACK_IMPORTED_MODULE_1__","_delete__WEBPACK_IMPORTED_MODULE_2__","_textwatcher__WEBPACK_IMPORTED_MODULE_3__","_twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__","_utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__","_utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__","_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__","InputCommand","editor","undoStepSize","_this","Object","classCallCheck","this","_super","call","_buffer","ChangeBuffer","model","_batches","WeakSet","get","getPrototypeOf","prototype","destroy","_this2","options","arguments","length","undefined","doc","document","text","textInsertions","selection","range","createSelection","resultRange","enqueueChange","batch","writer","lock","add","deleteContent","insertContent","createText","getAttributes","setSelection","is","unlock","input","Command","Input","inputCommand","config","commands","injectUnsafeKeystrokesHandling","injectTypingMutationsHandling","has","Plugin"],"mappings":"kHAAA,IAAAA,EAAAC,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAH,EAAA,WAAAI,EAAAH,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAC,EAAA,WAAAC,EAAAJ,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAE,EAAA,WAAAC,EAAAL,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAG,EAAA,WAAAC,EAAAN,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAI,EAAA,OAAAN,EAAA,YAAAO,EAAAP,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAK,EAAA,WAAAC,EAAAR,EAAA,QAAAA,EAAAC,EAAAC,EAAA,sBAAAM,EAAA,WAAAC,EAAAT,EAAA,QAAAA,EAA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G,eAAgChD,GAChCiD,eAA+BjD,0BAoBhC,SAAS+B,GACR,IAAMc,EAAexC,KAAKL,OAAO+C,SAASlC,IAAK,SAE/C,OAAOgC,EAAalC,SAASuC,IAAKnB,6BAvCnC,WACC,MAAO,eAL0BoB","file":"js/chunk-8be3bf8a.af771d62.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 typing\n */\n\nexport { default as Typing } from './typing';\nexport { default as Input } from './input';\nexport { default as Delete } from './delete';\n\nexport { default as TextWatcher } from './textwatcher';\nexport { default as TwoStepCaretMovement } from './twostepcaretmovement';\nexport { default as TextTransformation } from './texttransformation';\n\nexport { default as inlineHighlight } from './utils/inlinehighlight';\nexport { default as findAttributeRange } from './utils/findattributerange';\nexport { default as getLastTextLine } from './utils/getlasttextline';\n\nexport * from './utils/injectunsafekeystrokeshandling';\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 typing/inputcommand\n */\n\nimport Command from '@ckeditor/ckeditor5-core/src/command';\n\nimport ChangeBuffer from './utils/changebuffer';\n\n/**\n * The input command. Used by the {@link module:typing/input~Input input feature} to handle typing.\n *\n * @extends module:core/command~Command\n */\nexport default class InputCommand extends Command {\n\t/**\n\t * Creates an instance of the command.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor\n\t * @param {Number} undoStepSize The maximum number of atomic changes\n\t * which can be contained in one batch in the command buffer.\n\t */\n\tconstructor( editor, undoStepSize ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * Typing's change buffer used to group subsequent changes into batches.\n\t\t *\n\t\t * @readonly\n\t\t * @private\n\t\t * @member {module:typing/utils/changebuffer~ChangeBuffer} #_buffer\n\t\t */\n\t\tthis._buffer = new ChangeBuffer( editor.model, undoStepSize );\n\n\t\t/**\n\t\t * Stores batches created by the input command. The batches are used to differentiate input batches from other batches using\n\t\t * {@link module:typing/input~Input#isInput} method.\n\t\t *\n\t\t * @type {WeakSet}\n\t\t * @protected\n\t\t */\n\t\tthis._batches = new WeakSet();\n\t}\n\n\t/**\n\t * The current change buffer.\n\t *\n\t * @type {module:typing/utils/changebuffer~ChangeBuffer}\n\t */\n\tget buffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\n\t\tthis._buffer.destroy();\n\t}\n\n\t/**\n\t * Executes the input command. It replaces the content within the given range with the given text.\n\t * Replacing is a two step process, first the content within the range is removed and then the new text is inserted\n\t * at the beginning of the range (which after the removal is a collapsed range).\n\t *\n\t * @fires execute\n\t * @param {Object} [options] The command options.\n\t * @param {String} [options.text=''] The text to be inserted.\n\t * @param {module:engine/model/range~Range} [options.range] The range in which the text is inserted. Defaults\n\t * to the first range in the current selection.\n\t * @param {module:engine/model/range~Range} [options.resultRange] The range where the selection\n\t * should be placed after the insertion. If not specified, the selection will be placed right after\n\t * the inserted text.\n\t */\n\texecute( options = {} ) {\n\t\tconst model = this.editor.model;\n\t\tconst doc = model.document;\n\t\tconst text = options.text || '';\n\t\tconst textInsertions = text.length;\n\t\tconst selection = options.range ? model.createSelection( options.range ) : doc.selection;\n\t\tconst resultRange = options.resultRange;\n\n\t\tmodel.enqueueChange( this._buffer.batch, writer => {\n\t\t\tthis._buffer.lock();\n\n\t\t\t// Store the batch as an 'input' batch for the Input.isInput( batch ) check.\n\t\t\tthis._batches.add( this._buffer.batch );\n\n\t\t\tmodel.deleteContent( selection );\n\n\t\t\tif ( text ) {\n\t\t\t\tmodel.insertContent( writer.createText( text, doc.selection.getAttributes() ), selection );\n\t\t\t}\n\n\t\t\tif ( resultRange ) {\n\t\t\t\twriter.setSelection( resultRange );\n\t\t\t} else if ( !selection.is( 'documentSelection' ) ) {\n\t\t\t\twriter.setSelection( selection );\n\t\t\t}\n\n\t\t\tthis._buffer.unlock();\n\n\t\t\tthis._buffer.input( textInsertions );\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 typing/input\n */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport InputCommand from './inputcommand';\n\nimport injectUnsafeKeystrokesHandling from './utils/injectunsafekeystrokeshandling';\nimport injectTypingMutationsHandling from './utils/injecttypingmutationshandling';\n\n/**\n * Handles text input coming from the keyboard or other input methods.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Input extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Input';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\t// TODO The above default configuration value should be defined using editor.config.define() once it's fixed.\n\t\tconst inputCommand = new InputCommand( editor, editor.config.get( 'typing.undoStep' ) || 20 );\n\n\t\teditor.commands.add( 'input', inputCommand );\n\n\t\tinjectUnsafeKeystrokesHandling( editor );\n\t\tinjectTypingMutationsHandling( editor );\n\t}\n\n\t/**\n\t * Checks batch if it is a result of user input - e.g. typing.\n\t *\n\t *\t\tconst input = editor.plugins.get( 'Input' );\n\t *\n\t *\t\teditor.model.document.on( 'change:data', ( evt, batch ) => {\n\t *\t\t\tif ( input.isInput( batch ) ) {\n\t *\t\t\t\tconsole.log( 'The user typed something...' );\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}\n\t * command as typing changes coming from user input are inserted to the document using that command.\n\t *\n\t * @param {module:engine/model/batch~Batch} batch A batch to check.\n\t * @returns {Boolean}\n\t */\n\tisInput( batch ) {\n\t\tconst inputCommand = this.editor.commands.get( 'input' );\n\n\t\treturn inputCommand._batches.has( batch );\n\t}\n}\n"],"sourceRoot":""}