Module 954055

1,684 characters · in e76b0f3552014092.js
Dependencies
Source Raw
function(t,e,r){"use strict";var n=r(387739),i=r(283369),o=r(728309),a=r(561627),s=r(410475),u=r(116740),c=r(505932),l=r(976427),f=r(797686),p=r(728601),h=r(59061),d=r(436346),g=r(451865),y=u.OrderedSet,v={replaceText:function(t,e,r,i,o){var a=d(h(t,e),e),s=n.create({style:i||y(),entity:o||null});return l(a,a.getSelectionAfter(),r,s)},insertText:function(t,e,r,n,i){return e.isCollapsed()||f(!1),v.replaceText(t,e,r,n,i)},moveText:function(t,e,r){var n=s(t,e),i=v.removeRange(t,e,"backward");return v.replaceWithFragment(i,r,n)},replaceWithFragment:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",i=d(h(t,e),e);return c(i,i.getSelectionAfter(),r,n)},removeRange:function(t,e,r){e.getIsBackward()&&(e=e.merge({anchorKey:e.getFocusKey(),anchorOffset:e.getFocusOffset(),focusKey:e.getAnchorKey(),focusOffset:e.getAnchorOffset(),isBackward:!1})),n=e.getAnchorKey(),i=e.getFocusKey(),o=t.getBlockForKey(n);var n,i,o,s=t.getBlockForKey(i),u=e.getStartOffset(),c=e.getEndOffset(),l=o.getEntityAt(u),f=s.getEntityAt(c-1);if(n===i&&l&&l===f){var p=a(t.getEntityMap(),o,s,e,r);return d(t,p)}return d(h(t,e),e)},splitBlock:function(t,e){var r=d(h(t,e),e);return g(r,r.getSelectionAfter())},applyInlineStyle:function(t,e,r){return i.add(t,e,r)},removeInlineStyle:function(t,e,r){return i.remove(t,e,r)},setBlockType:function(t,e,r){return p(t,e,function(t){return t.merge({type:r,depth:0})})},setBlockData:function(t,e,r){return p(t,e,function(t){return t.merge({data:r})})},mergeBlockData:function(t,e,r){return p(t,e,function(t){return t.merge({data:t.getData().merge(r)})})},applyEntity:function(t,e,r){return o(h(t,e),e,r)}};t.exports=v}