draftjs-utils
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("draft-js"),require("immutable")):"function"==typeof define&&define.amd?define(["draft-js","immutable"],t):"object"==typeof exports?exports.draftjsUtils=t(require("draft-js"),require("immutable")):e.draftjsUtils=t(e["draft-js"],e.immutable)}(window,function(n,r){return c={},o.m=i=[function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";n.r(t);var C=n(0),i=n(1);function m(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getStartKey(),o=t.getEndKey(),i=n.getBlockMap();return i.toSeq().skipUntil(function(e,t){return t===r}).takeUntil(function(e,t){return t===o}).concat([[o,i.get(o)]])}function u(e){return m(e).toList()}function l(e){if(e)return u(e).get(0)}function c(e){var t=C.RichUtils.tryToRemoveBlockStyle(e);return t?C.EditorState.push(e,t,"change-block-type"):e}function r(e){var t=e.getCurrentContent(),n=e.getSelection(),r=C.Modifier.removeRange(t,n,"forward"),o=r.getSelectionAfter(),i=r.getBlockForKey(o.getStartKey());return r=C.Modifier.insertText(r,o,"\n",i.getInlineStyleAt(o.getStartOffset()),null),C.EditorState.push(e,r,"insert-fragment")}function f(e){var t=C.Modifier.splitBlock(e.getCurrentContent(),e.getSelection());return c(C.EditorState.push(e,t,"split-block"))}var o=Object(i.Map)({code:{element:"pre"}}),a=C.DefaultDraftBlockRenderMap.merge(o);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t,n){p[e]["".concat(e.toLowerCase(),"-").concat(n)]=g({},"".concat(t),n)}var p={color:{},bgcolor:{},fontSize:{},fontFamily:{},CODE:{fontFamily:"monospace",wordWrap:"break-word",background:"#f1f1f1",borderRadius:3,padding:"1px 3px"},SUPERSCRIPT:{fontSize:11,position:"relative",top:-8,display:"inline-flex"},SUBSCRIPT:{fontSize:11,position:"relative",bottom:-8,display:"inline-flex"}};function y(e,t,n){var r=e.getInlineStyleAt(n).toList().filter(function(e){return e.startsWith(t.toLowerCase())});if(r&&0<r.size)return r.get(0)}function v(e){if(e){var t=e.getType();return"unordered-list-item"===t||"ordered-list-item"===t}return!1}function b(e,t,n){var r,o=e.getSelection();r=o.getIsBackward()?o.getFocusKey():o.getAnchorKey();var i=e.getCurrentContent(),c=i.getBlockForKey(r),f=c.getType();if("unordered-list-item"!==f&&"ordered-list-item"!==f)return e;var l=i.getBlockBefore(r);if(!l)return e;if(l.getType()!==f)return e;var a=c.getDepth();if(1===t&&a===n)return e;var u,s,g,S,d,p,y,v=Math.min(l.getDepth()+1,n),b=(s=t,g=v,S=(u=e).getSelection(),d=u.getCurrentContent(),p=d.getBlockMap(),y=m(u).map(function(e){var t=e.getDepth()+s;return t=Math.max(0,Math.min(t,g)),e.set("depth",t)}),p=p.merge(y),d.merge({blockMap:p,selectionBefore:S,selectionAfter:S}));return C.EditorState.push(e,b,"adjust-depth")}t.default={getSelectedBlocksMap:m,getSelectedBlocksList:u,getSelectedBlock:l,getBlockBeforeSelectedBlock:function(e){if(e){var n=l(e),t=e.getCurrentContent().getBlockMap().toSeq().toList(),r=0;if(t.forEach(function(e,t){e.get("key")===n.get("key")&&(r=t-1)}),-1<r)return t.get(r)}},getAllBlocks:function(e){return e?e.getCurrentContent().getBlockMap().toList():new i.List},getSelectedBlocksType:function(e){var t=u(e);if(!t.some(function(e){return e.type!==t.get(0).type}))return t.get(0).type},removeSelectedBlocksStyle:c,getSelectionText:function(e){var t="",n=e.getSelection(),r=n.getAnchorOffset(),o=n.getFocusOffset(),i=u(e);if(0<i.size){if(n.getIsBackward()){var c=r;r=o,o=c}for(var f=0;f<i.size;f+=1){var l=0===f?r:0,a=f===i.size-1?o:i.get(f).getText().length;t+=i.get(f).getText().slice(l,a)}}return t},addLineBreakRemovingSelection:r,insertNewUnstyledBlock:f,clearEditorContent:function(e){var t=e.getCurrentContent().getBlockMap().toList(),n=e.getSelection().merge({anchorKey:t.first().get("key"),anchorOffset:0,focusKey:t.last().get("key"),focusOffset:t.last().getLength()}),r=C.Modifier.removeRange(e.getCurrentContent(),n,"forward");return C.EditorState.push(e,r,"remove-range")},setBlockData:function(e,t){var n=C.Modifier.setBlockData(e.getCurrentContent(),e.getSelection(),t);return C.EditorState.push(e,n,"change-block-data")},getSelectedBlocksMetadata:function(e){var r=new i.Map({}),t=u(e);if(t&&0<t.size)for(var n=function(e){var n=t.get(e).getData();if(!n||0===n.size)return r=r.clear(),"break";if(0===e)r=n;else if(r.forEach(function(e,t){n.get(t)&&n.get(t)===e||(r=r.delete(t))}),0===r.size)return r=r.clear(),"break"},o=0;o<t.size;o+=1){if("break"===n(o))break}return r},blockRenderMap:a,getEntityRange:function(e,t){var n,r=l(e);return r.findEntityRanges(function(e){return e.get("entity")===t},function(e,t){n={start:e,end:t,text:r.get("text").slice(e,t)}}),n},getCustomStyleMap:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach(function(e){g(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},p.color,{},p.bgcolor,{},p.fontSize,{},p.fontFamily,{CODE:p.CODE,SUPERSCRIPT:p.SUPERSCRIPT,SUBSCRIPT:p.SUBSCRIPT})},toggleCustomInlineStyle:function(e,t,n){var r=e.getSelection(),o=Object.keys(p[t]).reduce(function(e,t){return C.Modifier.removeInlineStyle(e,r,t)},e.getCurrentContent()),i=C.EditorState.push(e,o,"changeinline-style"),c=e.getCurrentInlineStyle();if(r.isCollapsed()&&(i=c.reduce(function(e,t){return C.RichUtils.toggleInlineStyle(e,t)},i)),"SUPERSCRIPT"===t||"SUBSCRIPT"==t)c.has(n)||(i=C.RichUtils.toggleInlineStyle(i,n));else{var f="bgcolor"===t?"backgroundColor":t;c.has("".concat(f,"-").concat(n))||(i=C.RichUtils.toggleInlineStyle(i,"".concat(t.toLowerCase(),"-").concat(n)),d(t,f,n))}return i},getSelectionEntity:function(e){var t,n=e.getSelection(),r=n.getStartOffset(),o=n.getEndOffset();r===o&&0===r?o=1:r===o&&--r;for(var i=l(e),c=r;c<o;c+=1){var f=i.getEntityAt(c);if(!f){t=void 0;break}if(c===r)t=f;else if(t!==f){t=void 0;break}}return t},extractInlineStyle:function(e){e&&e.getCurrentContent().getBlockMap().map(function(e){return e.get("characterList")}).toList().flatten().forEach(function(e){e&&0===e.indexOf("color-")?d("color","color",e.substr(6)):e&&0===e.indexOf("bgcolor-")?d("bgcolor","backgroundColor",e.substr(8)):e&&0===e.indexOf("fontsize-")?d("fontSize","fontSize",+e.substr(9)):e&&0===e.indexOf("fontfamily-")&&d("fontFamily","fontFamily",e.substr(11))})},removeAllInlineStyles:function(t){var e=t.getCurrentInlineStyle(),n=t.getCurrentContent();return e.forEach(function(e){n=C.Modifier.removeInlineStyle(n,t.getSelection(),e)}),C.EditorState.push(t,n,"change-inline-style")},getSelectionInlineStyle:function(e){var t=e.getSelection();if(t.isCollapsed()){var n={},r=e.getCurrentInlineStyle().toList().toJS();if(r)return["BOLD","ITALIC","UNDERLINE","STRIKETHROUGH","CODE","SUPERSCRIPT","SUBSCRIPT"].forEach(function(e){n[e]=0<=r.indexOf(e)}),n}var c=t.getStartOffset(),f=t.getEndOffset(),l=u(e);if(0<l.size){var o=function(){for(var n={BOLD:!0,ITALIC:!0,UNDERLINE:!0,STRIKETHROUGH:!0,CODE:!0,SUPERSCRIPT:!0,SUBSCRIPT:!0},r=0;r<l.size;r+=1){var e=0===r?c:0,t=r===l.size-1?f:l.get(r).getText().length;e===t&&0===e?(e=1,t=2):e===t&&--e;for(var o=function(e){var t=l.get(r).getInlineStyleAt(e);["BOLD","ITALIC","UNDERLINE","STRIKETHROUGH","CODE","SUPERSCRIPT","SUBSCRIPT"].forEach(function(e){n[e]=n[e]&&t.get(e)===e})},i=e;i<t;i+=1)o(i)}return{v:n}}();if("object"===S(o))return o.v}return{}},getSelectionCustomInlineStyle:function(r,a){if(r&&a&&0<a.length){var e=function(){var e=r.getSelection(),i={};if(e.isCollapsed())return a.forEach(function(e){i[e]=function(e,t){var n=e.getCurrentInlineStyle().toList().filter(function(e){return e.startsWith(t.toLowerCase())});if(n&&0<n.size)return n.get(0)}(r,e)}),{v:i};var c=e.getStartOffset(),f=e.getEndOffset(),l=u(r);if(0<l.size){for(var t=function(n){var e=0===n?c:0,t=n===l.size-1?f:l.get(n).getText().length;e===t&&0===e?(e=1,t=2):e===t&&--e;for(var r=function(t){t===e?a.forEach(function(e){i[e]=y(l.get(n),e,t)}):a.forEach(function(e){i[e]&&i[e]!==y(l.get(n),e,t)&&(i[e]=void 0)})},o=e;o<t;o+=1)r(o)},n=0;n<l.size;n+=1)t(n);return{v:i}}}();if("object"===S(e))return e.v}return{}},handleNewLine:function(e,t){var n;return 13===(n=t).which&&(n.getModifierState("Shift")||n.getModifierState("Alt")||n.getModifierState("Control"))?e.getSelection().isCollapsed()?C.RichUtils.insertSoftNewline(e):r(e):function(e){var t=e.getSelection();if(t.isCollapsed()){var n=e.getCurrentContent(),r=t.getStartKey(),o=n.getBlockForKey(r);if(!v(o)&&"unstyled"!==o.getType()&&o.getLength()===t.getStartOffset())return f(e);if(v(o)&&0===o.getLength()){var i=o.getDepth();if(0===i)return c(e);if(0<i)return b(e,-1,i)}}}(e)},isListBlock:v,changeDepth:b}}],o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2);function o(e){if(c[e])return c[e].exports;var t=c[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}var i,c}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("draft-js"),require("immutable")):"function"==typeof define&&define.amd?define(["draft-js","immutable"],e):"object"==typeof exports?exports.draftjsUtils=e(require("draft-js"),require("immutable")):t.draftjsUtils=e(t["draft-js"],t.immutable)}(window,function(n,r){return u={},o.m=i=[function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e,n){t.exports=n(3)},function(t,e,n){"use strict";n.r(e);var C=n(0),i=n(1);function m(t){var e=t.getSelection(),n=t.getCurrentContent(),r=e.getStartKey(),o=e.getEndKey(),i=n.getBlockMap();return i.toSeq().skipUntil(function(t,e){return e===r}).takeUntil(function(t,e){return e===o}).concat([[o,i.get(o)]])}function a(t){return m(t).toList()}function f(t){if(t)return a(t).get(0)}function r(t){if(t){var n=f(t),e=t.getCurrentContent().getBlockMap().toSeq().toList(),r=0;if(e.forEach(function(t,e){t.get("key")===n.get("key")&&(r=e-1)}),-1<r)return e.get(r)}}function o(t){return t?t.getCurrentContent().getBlockMap().toList():new i.List}function u(t){var e=a(t);if(!e.some(function(t){return t.type!==e.get(0).type}))return e.get(0).type}function c(t){var e=C.RichUtils.tryToRemoveBlockStyle(t);return e?C.EditorState.push(t,e,"change-block-type"):t}function l(t){var e="",n=t.getSelection(),r=n.getAnchorOffset(),o=n.getFocusOffset(),i=a(t);if(0<i.size){if(n.getIsBackward()){var u=r;r=o,o=u}for(var c=0;c<i.size;c+=1){var f=0===c?r:0,l=c===i.size-1?o:i.get(c).getText().length;e+=i.get(c).getText().slice(f,l)}}return e}function s(t){var e=t.getCurrentContent(),n=t.getSelection(),r=C.Modifier.removeRange(e,n,"forward"),o=r.getSelectionAfter(),i=r.getBlockForKey(o.getStartKey());return r=C.Modifier.insertText(r,o,"\n",i.getInlineStyleAt(o.getStartOffset()),null),C.EditorState.push(t,r,"insert-fragment")}function g(t){var e=C.Modifier.splitBlock(t.getCurrentContent(),t.getSelection());return c(C.EditorState.push(t,e,"split-block"))}function d(t){var e=t.getCurrentContent().getBlockMap().toList(),n=t.getSelection().merge({anchorKey:e.first().get("key"),anchorOffset:0,focusKey:e.last().get("key"),focusOffset:e.last().getLength()}),r=C.Modifier.removeRange(t.getCurrentContent(),n,"forward");return C.EditorState.push(t,r,"remove-range")}function S(t,e){var n=C.Modifier.setBlockData(t.getCurrentContent(),t.getSelection(),e);return C.EditorState.push(t,n,"change-block-data")}function p(t){var r=new i.Map({}),e=a(t);if(e&&0<e.size)for(var n=function(t){var n=e.get(t).getData();if(!n||0===n.size)return r=r.clear(),"break";if(0===t)r=n;else if(r.forEach(function(t,e){n.get(e)&&n.get(e)===t||(r=r.delete(e))}),0===r.size)return r=r.clear(),"break"},o=0;o<e.size;o+=1){if("break"===n(o))break}return r}var y=Object(i.Map)({code:{element:"pre"}}),v=C.DefaultDraftBlockRenderMap.merge(y);function b(t){if(t){var e=t.getType();return"unordered-list-item"===e||"ordered-list-item"===e}return!1}function h(t,e,n){var r,o=t.getSelection();r=o.getIsBackward()?o.getFocusKey():o.getAnchorKey();var i=t.getCurrentContent(),u=i.getBlockForKey(r),c=u.getType();if("unordered-list-item"!==c&&"ordered-list-item"!==c)return t;var f=i.getBlockBefore(r);if(!f)return t;if(f.getType()!==c)return t;var l=u.getDepth();if(1===e&&l===n)return t;var a,s,g,d,S,p,y,v=Math.min(f.getDepth()+1,n),b=(s=e,g=v,d=(a=t).getSelection(),S=a.getCurrentContent(),p=S.getBlockMap(),y=m(a).map(function(t){var e=t.getDepth()+s;return e=Math.max(0,Math.min(e,g)),t.set("depth",e)}),p=p.merge(y),S.merge({blockMap:p,selectionBefore:d,selectionAfter:d}));return C.EditorState.push(t,b,"adjust-depth")}function O(t,e){var n;return 13===(n=e).which&&(n.getModifierState("Shift")||n.getModifierState("Alt")||n.getModifierState("Control"))?t.getSelection().isCollapsed()?C.RichUtils.insertSoftNewline(t):s(t):function(t){var e=t.getSelection();if(e.isCollapsed()){var n=t.getCurrentContent(),r=e.getStartKey(),o=n.getBlockForKey(r);if(!b(o)&&"unstyled"!==o.getType()&&o.getLength()===e.getStartOffset())return g(t);if(b(o)&&0===o.getLength()){var i=o.getDepth();if(0===i)return c(t);if(0<i)return h(t,-1,i)}}}(t)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t){var e=t.getSelection();if(e.isCollapsed()){var n={},r=t.getCurrentInlineStyle().toList().toJS();if(r)return["BOLD","ITALIC","UNDERLINE","STRIKETHROUGH","CODE","SUPERSCRIPT","SUBSCRIPT"].forEach(function(t){n[t]=0<=r.indexOf(t)}),n}var u=e.getStartOffset(),c=e.getEndOffset(),f=a(t);if(0<f.size){var o=function(){for(var n={BOLD:!0,ITALIC:!0,UNDERLINE:!0,STRIKETHROUGH:!0,CODE:!0,SUPERSCRIPT:!0,SUBSCRIPT:!0},r=0;r<f.size;r+=1){var t=0===r?u:0,e=r===f.size-1?c:f.get(r).getText().length;t===e&&0===t?(t=1,e=2):t===e&&--t;for(var o=function(t){var e=f.get(r).getInlineStyleAt(t);["BOLD","ITALIC","UNDERLINE","STRIKETHROUGH","CODE","SUPERSCRIPT","SUBSCRIPT"].forEach(function(t){n[t]=n[t]&&e.get(t)===t})},i=t;i<e;i+=1)o(i)}return{v:n}}();if("object"===I(o))return o.v}return{}}function B(t){var e,n=t.getSelection(),r=n.getStartOffset(),o=n.getEndOffset();r===o&&0===r?o=1:r===o&&--r;for(var i=f(t),u=r;u<o;u+=1){var c=i.getEntityAt(u);if(!c){e=void 0;break}if(u===r)e=c;else if(e!==c){e=void 0;break}}return e}function T(t,e){var n,r=f(t);return r.findEntityRanges(function(t){return t.get("entity")===e},function(t,e){n={start:t,end:e,text:r.get("text").slice(t,e)}}),n}function P(t,e,n){x[t]["".concat(t.toLowerCase(),"-").concat(n)]=E({},"".concat(e),n)}function j(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){E(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},x.color,{},x.bgcolor,{},x.fontSize,{},x.fontFamily,{CODE:x.CODE,SUPERSCRIPT:x.SUPERSCRIPT,SUBSCRIPT:x.SUBSCRIPT})}var x={color:{},bgcolor:{},fontSize:{},fontFamily:{},CODE:{fontFamily:"monospace",wordWrap:"break-word",background:"#f1f1f1",borderRadius:3,padding:"1px 3px"},SUPERSCRIPT:{fontSize:11,position:"relative",top:-8,display:"inline-flex"},SUBSCRIPT:{fontSize:11,position:"relative",bottom:-8,display:"inline-flex"}};function M(t,e,n){var r=t.getSelection(),o=Object.keys(x[e]).reduce(function(t,e){return C.Modifier.removeInlineStyle(t,r,e)},t.getCurrentContent()),i=C.EditorState.push(t,o,"changeinline-style"),u=t.getCurrentInlineStyle();if(r.isCollapsed()&&(i=u.reduce(function(t,e){return C.RichUtils.toggleInlineStyle(t,e)},i)),"SUPERSCRIPT"===e||"SUBSCRIPT"==e)u.has(n)||(i=C.RichUtils.toggleInlineStyle(i,n));else{var c="bgcolor"===e?"backgroundColor":e;u.has("".concat(c,"-").concat(n))||(i=C.RichUtils.toggleInlineStyle(i,"".concat(e.toLowerCase(),"-").concat(n)),P(e,c,n))}return i}function L(t){t&&t.getCurrentContent().getBlockMap().map(function(t){return t.get("characterList")}).toList().flatten().forEach(function(t){t&&0===t.indexOf("color-")?P("color","color",t.substr(6)):t&&0===t.indexOf("bgcolor-")?P("bgcolor","backgroundColor",t.substr(8)):t&&0===t.indexOf("fontsize-")?P("fontSize","fontSize",+t.substr(9)):t&&0===t.indexOf("fontfamily-")&&P("fontFamily","fontFamily",t.substr(11))})}function U(t,e,n){var r=t.getInlineStyleAt(n).toList().filter(function(t){return t.startsWith(e.toLowerCase())});if(r&&0<r.size)return r.get(0)}function w(r,l){if(r&&l&&0<l.length){var t=function(){var t=r.getSelection(),i={};if(t.isCollapsed())return l.forEach(function(t){i[t]=function(t,e){var n=t.getCurrentInlineStyle().toList().filter(function(t){return t.startsWith(e.toLowerCase())});if(n&&0<n.size)return n.get(0)}(r,t)}),{v:i};var u=t.getStartOffset(),c=t.getEndOffset(),f=a(r);if(0<f.size){for(var e=function(n){var t=0===n?u:0,e=n===f.size-1?c:f.get(n).getText().length;t===e&&0===t?(t=1,e=2):t===e&&--t;for(var r=function(e){e===t?l.forEach(function(t){i[t]=U(f.get(n),t,e)}):l.forEach(function(t){i[t]&&i[t]!==U(f.get(n),t,e)&&(i[t]=void 0)})},o=t;o<e;o+=1)r(o)},n=0;n<f.size;n+=1)e(n);return{v:i}}}();if("object"===I(t))return t.v}return{}}function D(e){var t=e.getCurrentInlineStyle(),n=e.getCurrentContent();return t.forEach(function(t){n=C.Modifier.removeInlineStyle(n,e.getSelection(),t)}),C.EditorState.push(e,n,"change-inline-style")}n.d(e,"isListBlock",function(){return b}),n.d(e,"changeDepth",function(){return h}),n.d(e,"handleNewLine",function(){return O}),n.d(e,"getEntityRange",function(){return T}),n.d(e,"getCustomStyleMap",function(){return j}),n.d(e,"toggleCustomInlineStyle",function(){return M}),n.d(e,"getSelectionEntity",function(){return B}),n.d(e,"extractInlineStyle",function(){return L}),n.d(e,"removeAllInlineStyles",function(){return D}),n.d(e,"getSelectionInlineStyle",function(){return R}),n.d(e,"getSelectionCustomInlineStyle",function(){return w}),n.d(e,"getSelectedBlocksMap",function(){return m}),n.d(e,"getSelectedBlocksList",function(){return a}),n.d(e,"getSelectedBlock",function(){return f}),n.d(e,"getBlockBeforeSelectedBlock",function(){return r}),n.d(e,"getAllBlocks",function(){return o}),n.d(e,"getSelectedBlocksType",function(){return u}),n.d(e,"removeSelectedBlocksStyle",function(){return c}),n.d(e,"getSelectionText",function(){return l}),n.d(e,"addLineBreakRemovingSelection",function(){return s}),n.d(e,"insertNewUnstyledBlock",function(){return g}),n.d(e,"clearEditorContent",function(){return d}),n.d(e,"setBlockData",function(){return S}),n.d(e,"getSelectedBlocksMetadata",function(){return p}),n.d(e,"blockRenderMap",function(){return v})}],o.c=u,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=2);function o(t){if(u[t])return u[t].exports;var e=u[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var i,u}); |
{ | ||
"name": "draftjs-utils", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Collection of utility function for use with Draftjs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/draftjs-utils.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236388
287299