PageSourceSearch

https://www.strasbourg.eu/o/frontend-editor-ckeditor-web/__liferay…@ckeditor$ckeditor5-typing$dist$index.js.js

js strasbourg.eu collected 2026-09-24 08:38:11 UTC 30,972 bytes, 10 lines download raw bytes

1import{Accessibility as Ve,Command as q,CommandCollection as We,Context as Ne,ContextPlugin as qe,EditingKeystrokeHandler as ze,Editor as Ue,ElementApiMixin as je,MultiCommand as Ge,PendingActions as $e,Plugin as v,_DEFAULT_ACCESSIBILITY_GROUP_ID as He,_getEditorUsageData as Ke,attachToForm as Qe,secureSourceElement as Ye}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{CKEditorError as Ze,Collection as et,Config as tt,DOCUMENTATION_URL as ot,DomEmitterMixin as rt,ElementReplacer as it,EmitterMixin as nt,EventInfo as Z,FocusTracker as st,KeystrokeHandler as at,Locale as lt,ObservableMixin as ee,Rect as ct,ResizeObserver as ft,_clearTranslations as dt,_getEmitterId as mt,_getEmitterListenedTo as ut,_getUserAgent as pt,_isAndroid as ht,_isBlink as gt,_isGecko as xt,_isMac as bt,_isMediaForcedColors as _t,_isMotionReduced as yt,_isRegExpUnicodePropertySupported as Et,_isSafari as vt,_isWindows as wt,_isiOS as Ct,_setEmitterId as St,_translate as Tt,_unifyTranslations as At,abortableDebounce as Rt,add as kt,areConnectedThroughProperties as Ot,collectStylesheets as It,compareArrays as Mt,count as te,crc32 as Dt,createElement as Pt,delay as Bt,diff as Lt,diffToChanges as Ft,env as _,exponentialDelay as Vt,fastDiff as Wt,findClosestScrollableAncestor as Nt,first as qt,formatHtml as zt,getAncestors as Ut,getBorderWidths as jt,getCode as Gt,getCommonAncestor as $t,getDataFromElement as Ht,getEnvKeystrokeText as Kt,getLanguageDirection as Qt,getLocalizedArrowKeyCodeDirection as Yt,getOptimalPosition as Xt,getPositionedAncestor as Jt,getRangeFromMouseEvent as Zt,getVisualViewportOffset as eo,global as to,indexOf as oo,insertAt as ro,insertToPriorityArray as io,isArrowKeyCode as no,isCombiningMark as so,isComment as ao,isForwardArrowKeyCode as lo,isHighSurrogateHalf as co,isInsideCombinedSymbol as oe,isInsideEmojiSequence as re,isInsideSurrogatePair as ie,isIterable as fo,isLowSurrogateHalf as mo,isNode as uo,isRange as po,isText as ho,isValidAttributeName as go,isViewWithFocusTracker as xo,isVisible as bo,isWindow as _o,keyCodes as y,logError as yo,logWarning as Eo,mapsEqual as vo,nth as wo,objectToMap as Co,parseBase64EncodedObject as So,parseKeystroke as To,priorities as Ao,releaseDate as Ro,remove as ko,retry as Oo,scrollAncestorsToShowTarget as Io,scrollViewportToShowTarget as Mo,setDataInElement as Do,spliceArray as Po,spy as Bo,toArray as Lo,toMap as Fo,toUnit as Vo,uid as Wo,version as No,wait as qo}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";import{AttributeOperation as jo,Batch as Go,BubblingEmitterMixin as $o,BubblingEventInfo as M,ClickObserver as Ho,CompositionObserver as Ko,Conversion as Qo,ConversionHelpers as Yo,DataController as Xo,Differ as Jo,DomEventObserver as Zo,DowncastHelpers as er,EditingController as tr,EditingView as or,FakeSelectionObserver as rr,FocusObserver as ne,History as ir,HtmlDataProcessor as nr,InputObserver as sr,InsertOperation as ar,KeyObserver as lr,MarkerCollection as cr,MarkerOperation as fr,Matcher as dr,MergeOperation as mr,Model as ur,ModelDocument as pr,ModelDocumentFragment as hr,ModelDocumentSelection as gr,ModelElement as xr,ModelLivePosition as br,ModelLiveRange as se,ModelNode as _r,ModelNodeList as yr,ModelPosition as Er,ModelRange as vr,ModelRootElement as wr,ModelSchemaContext as Cr,ModelSelection as Sr,ModelText as Tr,ModelTextProxy as Ar,ModelTreeWalker as Rr,ModelTypeCheckable as kr,ModelWriter as Or,MouseObserver as ae,MoveOperation as Ir,MutationObserver as Mr,NoOperation as Dr,Observer as z,OperationFactory as Pr,RenameOperation as Br,RootAttributeOperation as Lr,RootOperation as Fr,SelectionObserver as Vr,SplitOperation as Wr,StylesMap as Nr,StylesProcessor as qr,TabObserver as zr,TouchObserver as le,UpcastHelpers as Ur,UpcastWriter as jr,ViewAttributeElement as Gr,ViewContainerElement as $r,ViewDataTransfer as Hr,ViewDocument as Kr,ViewDocumentDomEventData as w,ViewDocumentFragment as Qr,ViewDocumentSelection as Yr,ViewDomConverter as Xr,ViewDowncastWriter as Jr,ViewEditableElement as Zr,ViewElement as ei,ViewEmptyElement as ti,ViewNode as oi,ViewPosition as ri,ViewRange as ii,ViewRawElement as ni,ViewRenderer as si,ViewRootEditableElement as ai,ViewSelection as li,ViewText as ci,ViewTextProxy as fi,ViewTokenList as di,ViewTreeWalker as mi,ViewTypeCheckable as ui,ViewUIElement as pi,ViewUpcastWriter as hi,XmlDataProcessor as gi,_DataProcessorBasicHtmlWriter as xi,_DetachOperation as bi,_MapperCache as _i,_OperationReplayer as yi,_VIEW_BR_FILLER as Ei,_VIEW_INLINE_FILLER as vi,_VIEW_INLINE_FILLER_LENGTH as wi,_VIEW_MARKED_NBSP_FILLER as Ci,_VIEW_NBSP_FILLER as Si,_ViewElementConversionConsumables as Ti,_autoParagraphEmptyModelRoots as Ai,_convertMapToStringifiedObject as Ri,_convertMapToTags as ki,_deleteModelContent as Oi,_downcastCleanSelection as Ii,_downcastConvertCollapsedSelection as Mi,_downcastConvertRangeSelection as Di,_downcastCreateViewElementFromDowncastHighlightDescriptor as Pi,_downcastInsertAttributesAndChildren as Bi,_downcastInsertElement as Li,_downcastInsertStructure as Fi,_downcastInsertText as Vi,_downcastInsertUIElement as Wi,_downcastRemove as Ni,_downcastWrap as qi,_dumpTrees as zi,_getDataWithoutViewFiller as Ui,_getModelData as ji,_getModelNodeAfterPosition as Gi,_getModelNodeBeforePosition as $i,_getModelTextNodeAtPosition as Hi,_getSelectedModelContent as Ki,_getViewData as Qi,_initDocumentDumping as Yi,_injectModelSelectionPostFixer as Xi,_injectViewQuirksHandling as Ji,_injectViewUIElementHandling as Zi,_insertIntoModelNodeList as en,_insertModelContent as tn,_insertModelObject as on,_isInlineViewFiller as rn,_isParagraphableModelNode as nn,_isViewPatternMatched as sn,_logDocument as an,_mergeIntersectingModelRanges as ln,_modifyModelSelection as cn,_moveInModelNodeList as fn,_normalizeConversionConsumables as dn,_normalizeInModelNodeList as mn,_operationTransform as un,_parseModel as pn,_parseView as hn,_removeFromModelNodeList as gn,_setAttributeInModelNodeList as xn,_setModelData as bn,_setVie
1wData as _n,_startsWithViewFiller as yn,_stringifyModel as En,_stringifyView as vn,_tryFixingModelRange as U,_upcastConvertSelectionChange as wn,_upcastConvertText as Cn,_upcastConvertToModelFragment as Sn,_wrapInModelParagraph as Tn,addBackgroundStylesRules as An,addBorderStylesRules as Rn,addMarginStylesRules as kn,addPaddingStylesRules as On,autoParagraphEmptyRoots as In,disableViewPlaceholder as Mn,enableViewPlaceholder as Dn,getBoxSidesStyleShorthandValue as Pn,getBoxSidesStyleValueReducer as Bn,getBoxSidesStyleValues as Ln,getPositionStyleShorthandNormalizer as Fn,getShorthandStylesValues as Vn,getViewFillerOffset as Wn,hideViewPlaceholder as Nn,isAttachmentStyleValue as qn,isColorStyleValue as zn,isLengthStyleValue as Un,isLineStyleValue as jn,isParagraphable as Gn,isPercentageStyleValue as $n,isPositionStyleValue as Hn,isRepeatStyleValue as Kn,isURLStyleValue as Qn,needsViewPlaceholder as Yn,showViewPlaceholder as Xn,transformOperationSets as Jn,wrapInParagraph as Zn}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";function ce(i,e,{signal:t,edges:o}={}){let n,r=null,a=o!=null&&o.includes("leading"),s=o==null||o.includes("trailing"),l=()=>{r!==null&&(i.apply(n,r),n=void 0,r=null)},c=()=>{s&&l(),p()},f=null,d=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,c()},e)},m=()=>{f!==null&&(clearTimeout(f),f=null)},p=()=>{m(),n=void 0,r=null},u=()=>{m(),l()},h=function(...x){if(t?.aborted)return;n=this,r=x;let I=f==null;d(),a&&I&&l()};return h.schedule=d,h.cancel=p,h.flush=u,t?.addEventListener("abort",p,{once:!0}),h}function j(i,e=0,t={}){typeof t!="object"&&(t={});let{leading:o=!1,trailing:n=!0,maxWait:r}=t,a=Array(2);o&&(a[0]="leading"),n&&(a[1]="trailing");let s,l=null,c=ce(function(...m){s=i.apply(this,m),l=null},e,{edges:a}),f=function(...m){return r!=null&&(l===null&&(l=Date.now()),Date.now()-l>=r)?(s=i.apply(this,m),l=Date.now(),c.cancel(),c.schedule(),s):(c.apply(this,m),s)},d=()=>(c.flush(),s);return f.cancel=c.cancel,f.flush=d,f}function G(i){if(i==null)return"";if(typeof i=="string")return i;if(Array.isArray(i))return i.map(G).join(",");let e=String(i);return e==="0"&&Object.is(Number(i),-0)?"-0":e}function fe(i){return i.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function $(i){return fe(G(i))}var k=class{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(o,n)=>{n.isLocal&&n.isUndoable&&n!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){(!this.isLocked||e)&&(this._batch=null,this._size=0)}},P=class extends q{_buffer;constructor(e,t){super(e),this._buffer=new k(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){let t=this.editor.model,o=t.document,n=e.text||"",r=n.length,a=o.selection;if(e.selection?a=e.selection:e.range&&(a=t.createSelection(e.range)),!t.canEditAt(a))return;let s=e.resultRange;t.enqueueChange(this._buffer.batch,l=>{this._buffer.lock();let c=Array.from(o.selection.getAttributes());t.deleteContent(a),n&&t.insertContent(l.createText(n,c),a),s?l.setSelection(s):a.is("documentSelection")||l.setSelection(a),this._buffer.unlock(),this._buffer.input(r)})}},ge=["insertText","insertReplacementText"],ve=[...ge,"insertCompositionText"],H=class extends z{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(ne);let t=_.isAndroid?ve:ge,o=e.document;o.on("beforeinput",(n,r)=>{if(!this.isEnabled)return;let{data:a,targetRanges:s,inputType:l,domEvent:c,isComposing:f}=r;if(!t.includes(l))return;this.focusObserver.flush();let d=new Z(o,"insertText");o.fire(d,new w(e,c,{text:a,selection:e.createSelection(s),isComposing:f})),d.stop.called&&n.stop()}),_.isAndroid||o.on("compositionend",(n,{data:r,domEvent:a})=>{this.isEnabled&&r&&o.fire("insertText",new w(e,a,{text:r,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}},B=class extends v{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,o=e.editing.view,n=e.editing.mapper,r=t.document.selection;this._typingQueue=new K(e),o.addObserver(H);let a=new P(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",a),e.commands.add("input",a),this.listenTo(o.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(o.document,"insertText",(s,l)=>{let{text:c,selection:f}=l;if(o.document.selection.isFake&&f&&o.document.selection.isSimilar(f)&&l.preventDefault(),f&&Array.from(f.getRanges()).some(u=>!u.isCollapsed)&&l.preventDefault(),!a.isEnabled){l.preventDefault();return}let d;f?d=Array.from(f.getRanges()).map(u=>n.toModelRange(u)).map(u=>U(u,t.schema)||u):d=Array.from(r.getRanges());let m=c;if(_.isAndroid){let u=Array.from(d[0].getItems()).reduce((h,x)=>h+(x.is("$textProxy")?x.data:""),"");if(u&&(u.length<=m.length?m.startsWith(u)&&(m=m.substring(u.length),d[0].start=d[0].start.getShiftedBy(u.length)):u.startsWith(m)&&(d[0].start=d[0].start.getShiftedBy(m.length),m="")),m.length==0&&d[0].isCollapsed)return}let p={text:m,selection:t.createSelection(d)};this._typingQueue.push(p,!!l.isComposing),l.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),_.isAndroid?this.listenTo(o.document,"keydown",(s,l)=>{r.isCollapsed||l.keyCode!=229||!o.document.isComposing||de(t,a)}):this.listenTo(o.document,"compositionstart",()=>{r.isCollapsed||de(t,a)},{priority:"high"}),this.listenTo(o.document,"mutations",(s,{mutations:l})=>
1{if(this._typingQueue.hasAffectedElements())for(let{node:c}of l){let f=Ce(c,n),d=n.toModelElement(f);if(this._typingQueue.isElementAffected(d)){this._typingQueue.flush("mutations");return}}}),this.listenTo(o.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(o.document,"compositionend",()=>{this._typingQueue.flush("after composition end");let s=[];if(this._typingQueue.hasAffectedElements())for(let l of this._typingQueue.flushAffectedElements()){let c=n.toViewElement(l);c&&s.push({type:"children",node:c})}(s.length||!_.isAndroid)&&o.document.fire("mutations",{mutations:s})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}},K=class{editor;flushDebounced=j(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){let o={text:e.text};if(e.selection){o.selectionRanges=[];for(let n of e.selection.getRanges())o.selectionRanges.push(se.fromRange(n)),this._affectedElements.add(n.start.parent)}this._queue.push(o),this._isComposing||=t,this.flushDebounced()}shift(){let e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){let o=e.selectionRanges.map(n=>we(n)).filter(n=>!!n);o.length&&(t.selection=this.editor.model.createSelection(o))}return t}flush(e){let t=this.editor,o=t.model,n=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;let a=t.commands.get("insertText").buffer;o.enqueueChange(a.batch,()=>{for(a.lock();this._queue.length;){let s=this.shift();t.execute("insertText",s)}a.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),n.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){let e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}};function de(i,e){if(!e.isEnabled)return;let t=e.buffer;t.lock(),i.enqueueChange(t.batch,()=>{i.deleteContent(i.document.selection)}),t.unlock()}function we(i){let e=i.toRange();return i.detach(),e.root.rootName=="$graveyard"?null:e}function Ce(i,e){let t=i.is("$text")?i.parent:i;for(;!e.toModelElement(t);)t=t.parent;return t}var O=class extends q{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new k(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){let t=this.editor.model,o=t.document;t.enqueueChange(this._buffer.batch,n=>{this._buffer.lock();let r=n.createSelection(e.selection||o.selection);if(!t.canEditAt(r))return;let a=e.sequence||1,s=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(a)){this._replaceEntireContentWithParagraph(n);return}if(this._shouldReplaceFirstBlockWithParagraph(r,a)){this.editor.execute("paragraph",{selection:r});return}if(r.isCollapsed)return;let l=0;
1r.getFirstRange().getMinimalFlatRanges().forEach(c=>{l+=te(c.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(l),n.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;let t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(r))||!t.schema.checkChild(r,"paragraph"))return!1;let s=r.getChild(0);return!(s&&s.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){let t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n),a=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(a,r),e.setSelection(a,0)}_shouldReplaceFirstBlockWithParagraph(e,t){let o=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;let n=e.getFirstPosition(),r=o.schema.getLimitElement(n),a=r.getChild(0);return!(n.parent!=a||!e.containsEntireContent(a)||!o.schema.checkChild(r,"paragraph")||a.name=="paragraph")}},Se="character",me="word",Te="codePoint",E="selection",S="backward",R="forward",xe={deleteContent:{unit:E,direction:S},deleteContentBackward:{unit:Te,direction:S},deleteWordBackward:{unit:me,direction:S},deleteHardLineBackward:{unit:E,direction:S},deleteSoftLineBackward:{unit:E,direction:S},deleteContentForward:{unit:Se,direction:R},deleteWordForward:{unit:me,direction:R},deleteHardLineForward:{unit:E,direction:R},deleteSoftLineForward:{unit:E,direction:R}},L=class extends z{constructor(e){super(e);let t=e.document,o=0;t.on("keydown",()=>{o++}),t.on("keyup",()=>{o=0}),t.on("beforeinput",(n,r)=>{if(!this.isEnabled)return;let{targetRanges:a,domEvent:s,inputType:l}=r,c=xe[l];if(!c)return;let f={direction:c.direction,unit:c.unit,sequence:o};f.unit==E&&(f.selectionToRemove=e.createSelection(a[0])),l==="deleteContentBackward"&&(_.isAndroid&&(f.sequence=1),Re(a)&&(f.unit=E,f.selectionToRemove=e.createSelection(a)));let d=new M(t,"delete",a[0]);t.fire(d,new w(e,s,f)),d.stop.called&&n.stop()}),_.isBlink&&Ae(this)}observe(){}stopObserving(){}};function Ae(i){let e=i.view,t=e.document,o=null,n=!1;t.on("keydown",(s,{keyCode:l})=>{o=l,n=!1}),t.on("keyup",(s,{keyCode:l,domEvent:c})=>{let f=t.selection,d=i.isEnabled&&l==o&&r(l)&&!f.isCollapsed&&!n;if(o=null,d){let m=f.getFirstRange(),p=new M(t,"delete",m),u={unit:E,direction:a(l),selectionToRemove:f};t.fire(p,new w(e,c,u))}}),t.on("beforeinput",(s,{inputType:l})=>{let c=xe[l];r(o)&&c&&c.direction==a(o)&&(n=!0)},{priority:"high"}),t.on("beforeinput",(s,{inputType:l,data:c})=>{o==y.delete&&l=="insertText"&&c=="\x7F"&&s.stop()},{priority:"high"});function r(s){return s==y.backspace||s==y.delete}function a(s){return s==y.backspace?S:R}}function Re(i){if(i.length!=1||i[0].isCollapsed)return!1;let e=i[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0}),t=0;for(let{nextPosition:o,item:n}of e){if(o.parent.is("$text")){let r=o.parent.data,a=o.offset;if(ie(r,a)||oe(r,a)||re(r,a))continue;t++}else(n.is("containerElement")||n.is("emptyElement"))&&t++;if(t>1)return!0}return!1}var F=class extends v{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,o=t.document,n=e.model.document;t.addObserver(L),this._undoOnBackspace=!1;let r=new O(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new O(e,"backward")),this.listenTo(o,"delete",(a,s)=>{o.isComposing||s.preventDefault();let{direction:l,sequence:c,selectionToRemove:f,unit:d}=s,m=l==="forward"?"deleteForward":"delete",p={sequence:c};if(d=="selection"){let u=Array.from(f.getRanges()).map(h=>e.editing.mapper.toModelRange(h)).map(h=>U(h,e.model.schema)||h);p.selection=e.model.createSelection(u)}else p.unit=d;e.execute(m,p),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(o,"keydown",(a,s)=>{if(o.isComposing||s.keyCode!=y.backspace||!n.selection.isCollapsed)return;let l=e.model.schema.getLimitElement(n.selection),c=e.model.createPositionAt(l,0);if(c.isTouching(n.selection.getFirstPosition())){s.preventDefault();let f=e.model.schema.getNearestSelectionRange(c,"forward");if(!f)return;let d=t.createSelection(e.editing.mapper.toViewRange(f)),m=d.getFirstRange(),p=new M(document,"delete",m),u={unit:"selection",direction:"backward",selectionToRemove:d};o.fire(p,new w(t,s.domEvent,u))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(o,"delete",(a,s)=>
1{this._undoOnBackspace&&s.direction=="backward"&&s.sequence==1&&s.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),s.preventDefault(),a.stop())},{context:"$capture"}),this.listenTo(n,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}},Q=class extends v{static get requires(){return[B,F]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}};function be(i,e){let t=i.start;return{text:Array.from(i.getWalker({ignoreElementEnd:!1})).reduce((n,{item:r})=>r.is("$text")||r.is("$textProxy")?n+r.data:(t=e.createPositionAfter(r),""),""),range:e.createRange(t,i.end)}}var V=class extends ee(){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){let t=this.model.document;this.listenTo(t.selection,"change:range",(o,{directChange:n})=>{if(n){if(!t.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(t,"change:data",(o,n)=>{n.isUndo||!n.isLocal||this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){let o=this.model,r=o.document.selection,a=o.createRange(o.createPositionAt(r.focus.parent,0),r.focus),{text:s,range:l}=be(a,o),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){let f=Object.assign(t,{text:s,range:l});typeof c=="object"&&Object.assign(f,c),this.fire(`matched:${e}`,f)}}},Y=class extends v{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){let e=this.editor,t=e.model,o=e.editing.view,n=e.locale,r=t.document.selection;this.listenTo(o.document,"arrowKey",(a,s)=>{if(!r.isCollapsed||s.shiftKey||s.altKey||s.ctrlKey)return;let l=s.keyCode==y.arrowright,c=s.keyCode==y.arrowleft;if(!l&&!c)return;let f=n.contentLanguageDirection,d=!1;f==="ltr"&&l||f==="rtl"&&c?d=this._handleForwardMovement(s):d=this._handleBackwardMovement(s),d===!0&&a.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(a,s)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!s.directChange&&g(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){let t=this.attributes,o=this.editor.model,n=o.document.selection,r=n.getFirstPosition();return this._isGravityOverridden||r.isAtStart&&b(n,t)?!1:g(r,t)?(e&&A(e),b(n,t)&&g(r,t,!0)?T(o,t):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){let t=this.attributes,o=this.editor.model,n=o.document.selection,r=n.getFirstPosition();return this._isGravityOverridden?(e&&A(e),this._restoreGravity(),g(r,t,!0)?T(o,t):D(o,t,r),!0):r.isAtStart?b(n,t)?(e&&A(e),D(o,t,r),!0):!1:!b(n,t)&&g(r,t,!0)?(e&&A(e),D(o,t,r),!0):ue(r,t)?r.isAtEnd&&!b(n,t)&&g(r,t)?(e&&A(e),D(o,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){let e=this.editor,t=e.model,o=t.document.selection,n=e.editing.view.document;e.editing.view.addObserver(ae),e.editing.view.addObserver(le);let r=!1,a=!1;this.listenTo(n,"touchstart",()=>{a=!1,r=!0}),this.listenTo(n,"mousedown",()=>{a=!0}),this.listenTo(n,"selectionChange",()=>{let s=this.attributes;if(!a&&!r||(a=!1,r=!1,!o.isCollapsed)||!b(o,s))return;let l=o.getFirstPosition();g(l,s)&&(l.isAtStart||g(l,s,!0)?T(t,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){let t=this.editor.model,o=t.document.selection,n=this.attributes;this.listenTo(t,"insertContent",()=>{let r=o.getFirstPosition();b(o,n)&&g(r,n)&&T(t,n)},{priority:"low"})}_handleDeleteContentAfterNode(){let e=this.editor,t=e.model,o=t.document.selection,n=e.editing.view,r=!1,a=!1;this.listenTo(n.document,"delete",(s,l)=>{r=l.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!r)return;let s=o.getFirstPosition();a=b(o,this.attributes)&&!ue(s,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r&&(r=!1,!a&&e.model.enqueueChange(()=>{let s=o.getFirstPosition();b(o,this.attributes)&&g(s,this.attributes)&&(s.isAtStart||g(s,this.attributes,!0)?T(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}};function b(i,e){for(let t of e)if(i.hasAttribute(t))return!0;return!1}function D(i,e,t){let o=t.nodeBefore;i.change(n=>{if(o){let r=[],a=i.schema.isObject(o)&&i.schema.isInline(o);for(let[s,l]of o.getAttributes())i.schema.checkAttribute("$text",s)&&(!a||i.schema.getAttributeProperties(s).copyFromObject!==!1)&&r.push([s,l]);n.setSelectionAttribute(r)}else n.removeSelectionAttribute(e)})}function T(i,e){i.change(t=>{t.removeSelectionAttribute(e)})}function A(i){i.preventDefault()}function ue(i,e){let t=i.getShiftedBy(-1);return g(t,e)}function g(i,e,t=!1){let{nodeBefore:o,nodeAfter:n}=i;for(let r of e){let a=o?o.getAttribute(r):void 0,s=n?n.getAttribute(r):void 0;if(!(t&&(a===void 0||s===void 0))&&s!==a)return!0}return!1}var pe={copyright:{from:"(c)",to:"\xA9"},registeredTrademark:{from:"(r)",to:"\xAE"},trademark:{from:"(tm)",to:"\u2122"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"\xBD",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"\u2153",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"\u2154",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"\xBC",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"\xBE",null]},lessThanOrEqual:{from:"<=",to:"\u2264"},greaterThanOrEqual:{from:">=",to:"\u2265"},notEqual:{from:"!=",to:"\u2260"},arrowLeft:{from:"<-",to:"\u2190"},arrowRight:{from:"->",to:"\u2192"},horizontalEllipsis:{from:"...",to:"\u2026"},enDash:{from:/(^| )(--)( )$/,to:[null,"\u2013",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"\u2014",null]},quotesPrimary:{from:C('"'),to:[null,"\u201C",null,"\u201D"]},quotesSecondary:{from:C("'"),to:[null,"\u2018",null,"\u2019"]},quotesPrimaryEnGb:{from:C("'"),to:[null,"\u2018",null,"\u2019"]},quotesSecondaryEnGb:{from:C('"'),to:[null,"\u201C",null,"\u201D"]},quotesPrimaryPl:{from:C('"'),to:[null,"\u201E",null,"\u201D"]},quotesSecondaryPl:{from:C("'"),to:[null,"\u201A",null,"\u2019"]}},he={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},ke=["symbols","mathematical","typography","quotes"],X=class extends v{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("typing",{transformations:{include:ke}})}init(){let t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){let e=this.editor,t=e.model,o=e.plugins.get("Delete"),n=De(e.config.get("typing.transformations")),r=s=>{for(let l of n)if(l.from.test(s))return{normalizedTransformation:l}},a=new V(e.model,r);a.on("matched:data",(s,l)=>{if(!l.batch.isTyping)return;let{from:c,to:f}=l.normalizedTransformation,d=c.exec(l.text),m=f(d.slice(1)),p=l.range,u=d.index;t.enqueueChange(h=>{for(let x=1;x<d.length;x++){let I=d[x],W=m[x-1];if(W==null){u+=I.length;continue}let N=p.start.getShiftedBy(u),ye=t.createRange(N,N.getShiftedBy(I.length)),Ee=Me(N);t.insertContent(h.createText(W,Ee),ye),u+=W.length}t.enqueueChange(()=>{o.requestUndoOnBackspace()})})}),a.bind("isEnabled").to(this)}};function Oe(i){return typeof i=="string"?new RegExp(`(${$(i)})$`):i}function Ie(i){return typeof i=="string"?()=>[i]:i instanceof Array?()=>i:i}function Me(i){return(i.textNode?i.textNode:i.nodeAfter).getAttributes()}function C(i){return new RegExp(`(^|\\s)(${i})([^${i}]*)(${i})$`)}function De(i){let e=i.extra||[],t=i.remove||[],o=r=>!t.includes(r),n=i.include.concat(e).filter(o);return Pe(n).filter(o).map(r=>typeof r=="string"&&pe[r]?pe[r]:r).filter(r=>typeof r=="object").map(r=>({from:Oe(r.from),to:Ie(r.to)}))}function Pe(i){let e=new Set;for(let t of i)if(typeof t=="string"&&he[t])for(let o of he[t])e.add(o);else e.add(t);return Array.from(e)}function _e(i,e,t,o){return o.createRange(J(i,e,t,!0,o),J(i,e,t,!1,o))}function J(i,e,t,o,n){let r=i.textNode||(o?i.nodeBefore:i.nodeAfter),a=null;for(;r&&r.getAttribute(e)==t;)a=r,r=o?r.previousSibling:r.nextSibling;return a?n.createPositionAt(a,o?"before":"after"):i}function Be(i,e,t,o){let n=i.editing.view,r=new Set;n.document.registerPostFixer(a=>{let s=i.model.document.selection,l=!1;if(s.hasAttribute(e)){let c=_e(s.getFirstPosition(),e,s.getAttribute(e),i.model),f=i.editing.mapper.toViewRange(c);for(let d of f.getItems())d.is("element",t)&&!d.hasClass(o)&&(a.addClass(o,d),r.add(d),l=!0)}return l}),i.conversion.for("editingDowncast").add(a=>{a.on("insert",s,{priority:"highest"}),a.on("remove",s,{priority:"highest"}),a.on("attribute",s,{priority:"highest"}),a.on("selection",s,{priority:"highest"});function s(){n.change(l=>{for(let c of r.values())l.removeClass(o,c),r.delete(c)})}})}
1export{F as Delete,O as DeleteCommand,B as Input,P as InsertTextCommand,X as TextTransformation,V as TextWatcher,Y as TwoStepCaretMovement,Q as Typing,k as TypingChangeBuffer,L as _DeleteObserver,_e as findAttributeRange,J as findAttributeRangeBound,be as getLastTextLine,Be as inlineHighlight};
2/*! Bundled license information:
3
4@ckeditor/ckeditor5-typing/dist/index.js:
5  (**
6   * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
7   * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8   *)
9*/
10//# sourceMappingURL=@ckeditor$ckeditor5-typing$dist$index.js.(PBLCZ6SH).js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.