No Description

index.js 140KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("react"), require("braft-utils"), require("draft-js"), require("braft-convert"), require("react-dom"), require("immutable"), require("braft-finder"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["react", "braft-utils", "draft-js", "braft-convert", "react-dom", "immutable", "braft-finder"], factory);
  6. else {
  7. var a = typeof exports === 'object' ? factory(require("react"), require("braft-utils"), require("draft-js"), require("braft-convert"), require("react-dom"), require("immutable"), require("braft-finder")) : factory(root["react"], root["braft-utils"], root["draft-js"], root["braft-convert"], root["react-dom"], root["immutable"], root["braft-finder"]);
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__9__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__14__, __WEBPACK_EXTERNAL_MODULE__17__, __WEBPACK_EXTERNAL_MODULE__18__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "/";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 19);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ([
  98. /* 0 */
  99. /***/ (function(module, exports) {
  100. module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
  101. /***/ }),
  102. /* 1 */
  103. /***/ (function(module, exports) {
  104. function _assertThisInitialized(self) {
  105. if (self === void 0) {
  106. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  107. }
  108. return self;
  109. }
  110. module.exports = _assertThisInitialized;
  111. /***/ }),
  112. /* 2 */
  113. /***/ (function(module, exports) {
  114. function _defineProperty(obj, key, value) {
  115. if (key in obj) {
  116. Object.defineProperty(obj, key, {
  117. value: value,
  118. enumerable: true,
  119. configurable: true,
  120. writable: true
  121. });
  122. } else {
  123. obj[key] = value;
  124. }
  125. return obj;
  126. }
  127. module.exports = _defineProperty;
  128. /***/ }),
  129. /* 3 */
  130. /***/ (function(module, exports) {
  131. module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
  132. /***/ }),
  133. /* 4 */
  134. /***/ (function(module, exports, __webpack_require__) {
  135. var setPrototypeOf = __webpack_require__(23);
  136. function _inherits(subClass, superClass) {
  137. if (typeof superClass !== "function" && superClass !== null) {
  138. throw new TypeError("Super expression must either be null or a function");
  139. }
  140. subClass.prototype = Object.create(superClass && superClass.prototype, {
  141. constructor: {
  142. value: subClass,
  143. writable: true,
  144. configurable: true
  145. }
  146. });
  147. if (superClass) setPrototypeOf(subClass, superClass);
  148. }
  149. module.exports = _inherits;
  150. /***/ }),
  151. /* 5 */
  152. /***/ (function(module, exports) {
  153. function _getPrototypeOf(o) {
  154. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  155. return o.__proto__ || Object.getPrototypeOf(o);
  156. };
  157. return _getPrototypeOf(o);
  158. }
  159. module.exports = _getPrototypeOf;
  160. /***/ }),
  161. /* 6 */
  162. /***/ (function(module, exports, __webpack_require__) {
  163. var _typeof = __webpack_require__(15);
  164. var assertThisInitialized = __webpack_require__(1);
  165. function _possibleConstructorReturn(self, call) {
  166. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  167. return call;
  168. }
  169. return assertThisInitialized(self);
  170. }
  171. module.exports = _possibleConstructorReturn;
  172. /***/ }),
  173. /* 7 */
  174. /***/ (function(module, exports) {
  175. function _defineProperties(target, props) {
  176. for (var i = 0; i < props.length; i++) {
  177. var descriptor = props[i];
  178. descriptor.enumerable = descriptor.enumerable || false;
  179. descriptor.configurable = true;
  180. if ("value" in descriptor) descriptor.writable = true;
  181. Object.defineProperty(target, descriptor.key, descriptor);
  182. }
  183. }
  184. function _createClass(Constructor, protoProps, staticProps) {
  185. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  186. if (staticProps) _defineProperties(Constructor, staticProps);
  187. return Constructor;
  188. }
  189. module.exports = _createClass;
  190. /***/ }),
  191. /* 8 */
  192. /***/ (function(module, exports) {
  193. function _classCallCheck(instance, Constructor) {
  194. if (!(instance instanceof Constructor)) {
  195. throw new TypeError("Cannot call a class as a function");
  196. }
  197. }
  198. module.exports = _classCallCheck;
  199. /***/ }),
  200. /* 9 */
  201. /***/ (function(module, exports) {
  202. module.exports = __WEBPACK_EXTERNAL_MODULE__9__;
  203. /***/ }),
  204. /* 10 */
  205. /***/ (function(module, exports, __webpack_require__) {
  206. var defineProperty = __webpack_require__(2);
  207. function _objectSpread(target) {
  208. for (var i = 1; i < arguments.length; i++) {
  209. var source = arguments[i] != null ? arguments[i] : {};
  210. var ownKeys = Object.keys(source);
  211. if (typeof Object.getOwnPropertySymbols === 'function') {
  212. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  213. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  214. }));
  215. }
  216. ownKeys.forEach(function (key) {
  217. defineProperty(target, key, source[key]);
  218. });
  219. }
  220. return target;
  221. }
  222. module.exports = _objectSpread;
  223. /***/ }),
  224. /* 11 */
  225. /***/ (function(module, exports) {
  226. function _extends() {
  227. module.exports = _extends = Object.assign || function (target) {
  228. for (var i = 1; i < arguments.length; i++) {
  229. var source = arguments[i];
  230. for (var key in source) {
  231. if (Object.prototype.hasOwnProperty.call(source, key)) {
  232. target[key] = source[key];
  233. }
  234. }
  235. }
  236. return target;
  237. };
  238. return _extends.apply(this, arguments);
  239. }
  240. module.exports = _extends;
  241. /***/ }),
  242. /* 12 */
  243. /***/ (function(module, exports, __webpack_require__) {
  244. var arrayWithoutHoles = __webpack_require__(26);
  245. var iterableToArray = __webpack_require__(25);
  246. var nonIterableSpread = __webpack_require__(24);
  247. function _toConsumableArray(arr) {
  248. return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
  249. }
  250. module.exports = _toConsumableArray;
  251. /***/ }),
  252. /* 13 */
  253. /***/ (function(module, exports) {
  254. module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
  255. /***/ }),
  256. /* 14 */
  257. /***/ (function(module, exports) {
  258. module.exports = __WEBPACK_EXTERNAL_MODULE__14__;
  259. /***/ }),
  260. /* 15 */
  261. /***/ (function(module, exports) {
  262. function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
  263. function _typeof(obj) {
  264. if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
  265. module.exports = _typeof = function _typeof(obj) {
  266. return _typeof2(obj);
  267. };
  268. } else {
  269. module.exports = _typeof = function _typeof(obj) {
  270. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
  271. };
  272. }
  273. return _typeof(obj);
  274. }
  275. module.exports = _typeof;
  276. /***/ }),
  277. /* 16 */
  278. /***/ (function(module, exports, __webpack_require__) {
  279. var arrayWithHoles = __webpack_require__(22);
  280. var iterableToArrayLimit = __webpack_require__(21);
  281. var nonIterableRest = __webpack_require__(20);
  282. function _slicedToArray(arr, i) {
  283. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
  284. }
  285. module.exports = _slicedToArray;
  286. /***/ }),
  287. /* 17 */
  288. /***/ (function(module, exports) {
  289. module.exports = __WEBPACK_EXTERNAL_MODULE__17__;
  290. /***/ }),
  291. /* 18 */
  292. /***/ (function(module, exports) {
  293. module.exports = __WEBPACK_EXTERNAL_MODULE__18__;
  294. /***/ }),
  295. /* 19 */
  296. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  297. "use strict";
  298. __webpack_require__.r(__webpack_exports__);
  299. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/typeof.js
  300. var helpers_typeof = __webpack_require__(15);
  301. var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
  302. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/objectSpread.js
  303. var objectSpread = __webpack_require__(10);
  304. var objectSpread_default = /*#__PURE__*/__webpack_require__.n(objectSpread);
  305. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/toConsumableArray.js
  306. var toConsumableArray = __webpack_require__(12);
  307. var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
  308. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/classCallCheck.js
  309. var classCallCheck = __webpack_require__(8);
  310. var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
  311. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/createClass.js
  312. var createClass = __webpack_require__(7);
  313. var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
  314. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
  315. var possibleConstructorReturn = __webpack_require__(6);
  316. var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
  317. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/getPrototypeOf.js
  318. var getPrototypeOf = __webpack_require__(5);
  319. var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
  320. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/inherits.js
  321. var inherits = __webpack_require__(4);
  322. var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
  323. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/assertThisInitialized.js
  324. var assertThisInitialized = __webpack_require__(1);
  325. var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);
  326. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/defineProperty.js
  327. var defineProperty = __webpack_require__(2);
  328. var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
  329. // EXTERNAL MODULE: ../node_modules/draft-js/dist/Draft.css
  330. var Draft = __webpack_require__(51);
  331. // EXTERNAL MODULE: ./assets/scss/_base.scss
  332. var _base = __webpack_require__(49);
  333. // EXTERNAL MODULE: external "react"
  334. var external_react_ = __webpack_require__(0);
  335. var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
  336. // CONCATENATED MODULE: ./languages/en.js
  337. /* harmony default export */ var en = ({
  338. base: {
  339. remove: 'Remove',
  340. cancel: 'Cancel',
  341. confirm: 'Confirm',
  342. inert: 'Insert',
  343. width: 'Width',
  344. height: 'Height'
  345. },
  346. controls: {
  347. clear: 'Clear',
  348. undo: 'Undo',
  349. redo: 'Redo',
  350. fontSize: 'Font Size',
  351. color: 'Color',
  352. textColor: 'Text',
  353. tempColors: 'Temp Colors',
  354. backgroundColor: 'Background',
  355. bold: 'Bold',
  356. lineHeight: 'Line Height',
  357. letterSpacing: 'Letter Spacing',
  358. textIndent: 'Indent at both ends',
  359. italic: 'Italic',
  360. underline: 'Underline',
  361. strikeThrough: 'Strike Through',
  362. fontFamily: 'Font Family',
  363. textAlign: 'Text Alignment',
  364. alignLeft: 'Left Alignment',
  365. alignCenter: 'Center Alignment',
  366. alignRight: 'Right Alignment',
  367. alignJustify: 'Justify Alignment',
  368. floatLeft: 'Left Float',
  369. floatRight: 'Right Float',
  370. superScript: 'Super Script',
  371. subScript: 'Sub Script',
  372. removeStyles: 'Remove Styles',
  373. headings: 'Headings',
  374. header: 'Header',
  375. normal: 'Normal',
  376. orderedList: 'Ordered List',
  377. unorderedList: 'Unordered List',
  378. blockQuote: 'Quote',
  379. code: 'Code',
  380. link: 'Link',
  381. unlink: 'Unlink',
  382. hr: 'Horizontal Line',
  383. media: 'Media',
  384. mediaLibirary: 'Media Libirary',
  385. emoji: 'Emoji'
  386. },
  387. linkEditor: {
  388. inputPlaceHolder: 'Input link URL',
  389. inputWithEnterPlaceHolder: 'Input link URL and press Enter',
  390. openInNewWindow: 'Open in new window',
  391. removeLink: 'Remove Link'
  392. },
  393. audioPlayer: {
  394. title: 'Play Audio'
  395. },
  396. videoPlayer: {
  397. title: 'Play Video',
  398. embedTitle: 'Embed Media'
  399. },
  400. media: {
  401. image: 'Image',
  402. video: 'Video',
  403. audio: 'Audio',
  404. embed: 'Embed'
  405. }
  406. });
  407. // CONCATENATED MODULE: ./languages/zh.js
  408. /* harmony default export */ var zh = ({
  409. base: {
  410. remove: '删除',
  411. cancel: '取消',
  412. confirm: '确定',
  413. inert: '插入',
  414. width: '宽度',
  415. height: '高度'
  416. },
  417. controls: {
  418. clear: '清除内容',
  419. undo: '撤销',
  420. redo: '重做',
  421. fontSize: '字号',
  422. lineHeight: '行高',
  423. letterSpacing: '字间距',
  424. textIndent: '两端缩进',
  425. border: '边框',
  426. color: '颜色',
  427. textColor: '文字颜色',
  428. backgroundColor: '背景颜色',
  429. tempColors: '临时颜色',
  430. bold: '加粗',
  431. italic: '斜体',
  432. underline: '下划线',
  433. strikeThrough: '删除线',
  434. fontFamily: '字体',
  435. textAlign: '文本对齐',
  436. alignLeft: '居左',
  437. alignCenter: '居中',
  438. alignRight: '居右',
  439. alignJustify: '两端',
  440. floatLeft: '左浮动',
  441. floatRight: '右浮动',
  442. superScript: '上标',
  443. subScript: '下标',
  444. removeStyles: '清除样式',
  445. headings: '标题',
  446. header: '标题',
  447. normal: '常规',
  448. orderedList: '有序列表',
  449. unorderedList: '无序列表',
  450. blockQuote: '引用',
  451. code: '代码',
  452. link: '链接',
  453. unlink: '清除链接',
  454. hr: '水平线',
  455. media: '媒体',
  456. mediaLibirary: '媒体库',
  457. emoji: '小表情'
  458. },
  459. linkEditor: {
  460. inputPlaceHolder: '输入链接地址',
  461. inputWithEnterPlaceHolder: '输入链接地址并回车',
  462. openInNewWindow: '在新窗口打开',
  463. removeLink: '移除链接'
  464. },
  465. audioPlayer: {
  466. title: '播放音频文件'
  467. },
  468. videoPlayer: {
  469. title: '播放视频文件',
  470. embedTitle: '嵌入式媒体'
  471. },
  472. media: {
  473. image: '图像',
  474. video: '视频',
  475. audio: '音频',
  476. embed: '嵌入式媒体'
  477. }
  478. });
  479. // CONCATENATED MODULE: ./languages/zh-hant.js
  480. /* harmony default export */ var zh_hant = ({
  481. base: {
  482. remove: '刪除',
  483. cancel: '取消',
  484. confirm: '確定',
  485. inert: '插入',
  486. width: '宽度',
  487. height: '高度'
  488. },
  489. controls: {
  490. clear: '清除内容',
  491. undo: '撤銷',
  492. redo: '重做',
  493. fontSize: '字號',
  494. color: '顏色',
  495. textColor: '文字顏色',
  496. backgroundColor: '背景顏色',
  497. tempColors: '臨時顏色',
  498. bold: '加粗',
  499. lineHeight: '行高',
  500. letterSpacing: '字間距',
  501. textIndent: '兩端縮進',
  502. border: '邊框',
  503. italic: '斜體',
  504. underline: '下劃線',
  505. strikeThrough: '刪除線',
  506. fontFamily: '字體',
  507. textAlign: '文本對齊',
  508. alignLeft: '居左',
  509. alignCenter: '居中',
  510. alignRight: '居右',
  511. alignJustify: '兩端對齊',
  512. floatLeft: '左浮動',
  513. floatRight: '右浮動',
  514. superScript: '上標',
  515. subScript: '下標',
  516. removeStyles: '清除样式',
  517. headings: '標題',
  518. header: '標題',
  519. normal: '常規',
  520. orderedList: '有序列表',
  521. unorderedList: '無序列表',
  522. blockQuote: '引用',
  523. code: '代碼',
  524. link: '鏈接',
  525. unlink: '清除鏈接',
  526. hr: '水平线',
  527. media: '媒體',
  528. mediaLibirary: '媒體库',
  529. emoji: '小表情'
  530. },
  531. linkEditor: {
  532. inputPlaceHolder: '輸入鏈接地址',
  533. inputWithEnterPlaceHolder: '輸入鏈接地址並回車',
  534. openInNewWindow: '在新窗口打開',
  535. removeLink: '移除鏈接'
  536. },
  537. audioPlayer: {
  538. title: '播放音頻文件'
  539. },
  540. videoPlayer: {
  541. title: '播放視頻文件',
  542. embedTitle: '嵌入式媒體'
  543. },
  544. media: {
  545. image: '圖像',
  546. video: '視頻',
  547. audio: '音頻',
  548. embed: '嵌入式媒體'
  549. }
  550. });
  551. // CONCATENATED MODULE: ./languages/index.js
  552. /* harmony default export */ var languages = ({
  553. 'en': en,
  554. 'zh': zh,
  555. 'zh-hant': zh_hant
  556. });
  557. // EXTERNAL MODULE: external "braft-finder"
  558. var external_braft_finder_ = __webpack_require__(18);
  559. var external_braft_finder_default = /*#__PURE__*/__webpack_require__.n(external_braft_finder_);
  560. // EXTERNAL MODULE: external "braft-utils"
  561. var external_braft_utils_ = __webpack_require__(3);
  562. // EXTERNAL MODULE: external "draft-js"
  563. var external_draft_js_ = __webpack_require__(9);
  564. // CONCATENATED MODULE: ./configs/keybindings.js
  565. // TODO
  566. // 允许自定义的快捷键设置
  567. /* harmony default export */ var keybindings = (function (customKeyBindingFn) {
  568. return function (event) {
  569. if (event.keyCode === 83 && (external_draft_js_["KeyBindingUtil"].hasCommandModifier(event) || external_draft_js_["KeyBindingUtil"].isCtrlKeyCommand(event))) {
  570. return 'braft-save';
  571. }
  572. if (customKeyBindingFn) {
  573. return customKeyBindingFn(event) || Object(external_draft_js_["getDefaultKeyBinding"])(event);
  574. }
  575. return Object(external_draft_js_["getDefaultKeyBinding"])(event);
  576. };
  577. });
  578. // CONCATENATED MODULE: ./configs/props.js
  579. /* harmony default export */ var configs_props = ({
  580. language: 'zh',
  581. controls: ['undo', 'redo', 'separator', 'font-size', 'line-height', 'letter-spacing', 'separator', 'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator', 'superscript', 'subscript', 'remove-styles', 'emoji', 'text-align', 'separator', 'headings', 'list-ul', 'list-ol', 'blockquote', 'code', 'separator', 'link', 'split', 'hr', 'separator', 'media', 'separator', 'clear'],
  582. excludeControls: [],
  583. extendControls: [],
  584. extendAtomics: [],
  585. componentBelowControlBar: null,
  586. media: {
  587. pasteImage: true,
  588. image: true,
  589. video: true,
  590. audio: true,
  591. uploadFn: null,
  592. validateFn: null,
  593. onBeforeDeselect: null,
  594. onDeselect: null,
  595. onBeforeSelect: null,
  596. onSelect: null,
  597. onBeforeRemove: null,
  598. onRemove: null,
  599. onCancel: null,
  600. onFileSelect: null,
  601. onBeforeInsert: null,
  602. onInsert: null,
  603. onChange: null,
  604. externals: {
  605. audio: true,
  606. video: true,
  607. image: true,
  608. embed: true
  609. }
  610. },
  611. imageControls: ['float-left', 'float-right', 'align-left', 'align-center', 'align-right', 'link', 'size', 'remove'],
  612. colors: ['#000000', '#333333', '#666666', '#999999', '#cccccc', '#ffffff', '#61a951', '#16a085', '#07a9fe', '#003ba5', '#8e44ad', '#f32784', '#c0392b', '#d35400', '#f39c12', '#fdda00', '#7f8c8d', '#2c3e50'],
  613. tabIndents: 2,
  614. textAligns: ['left', 'center', 'right', 'justify'],
  615. textBackgroundColor: true,
  616. letterSpacings: [0, 1, 2, 3, 4, 5, 6],
  617. textIndents: [0, 14, 21, 28],
  618. lineHeights: [1, 1.2, 1.5, 1.75, 2, 2.5, 3, 4],
  619. fontSizes: [12, 14, 16, 18, 20, 24, 28, 30, 32, 36, 40, 48, 56, 64, 72, 96, 120, 144],
  620. fontFamilies: [{
  621. name: 'Araial',
  622. family: 'Arial, Helvetica, sans-serif'
  623. }, {
  624. name: 'Georgia',
  625. family: 'Georgia, serif'
  626. }, {
  627. name: 'Impact',
  628. family: 'Impact, serif'
  629. }, {
  630. name: 'Monospace',
  631. family: '"Courier New", Courier, monospace'
  632. }, {
  633. name: 'Tahoma',
  634. family: 'tahoma, arial, "Hiragino Sans GB", 宋体, sans-serif'
  635. }],
  636. emojis: ['🤣', '🙌', '💚', '💛', '👏', '😉', '💯', '💕', '💞', '💘', '💙', '💝', '🖤', '💜', '❤️', '😍', '😻', '💓', '💗', '😋', '😇', '😂', '😹', '😘', '💖', '😁', '😀', '🤞', '😲', '😄', '😊', '👍', '😌', '😃', '😅', '✌️', '🤗', '💋', '😗', '😽', '😚', '🤠', '😙', '😺', '👄', '😸', '😏', '😼', '👌', '😎', '😆', '😛', '🙏', '🤝', '🙂', '🤑', '😝', '😐', '😑', '🤤', '😤', '🙃', '🤡', '😶', '😪', '😴', '😵', '😓', '👊', '😦', '😷', '🤐', '😜', '🤓', '👻', '😥', '🙄', '🤔', '🤒', '🙁', '😔', '😯', '☹️', '☠️', '😰', '😩', '😖', '😕', '😒', '😣', '😢', '😮', '😿', '🤧', '😫', '🤥', '😞', '😬', '👎', '💀', '😳', '😨', '🤕', '🤢', '😱', '😭', '😠', '😈', '😧', '💔', '😟', '🙀', '💩', '👿', '😡', '😾', '🖕'],
  637. stripPastedStyles: false,
  638. className: '',
  639. style: {},
  640. controlBarClassName: '',
  641. controlBarStyle: {},
  642. contentClassName: '',
  643. contentStyle: {},
  644. draftProps: {},
  645. hooks: {},
  646. onChange: null,
  647. onFocus: null,
  648. onBlur: null,
  649. onTab: null,
  650. onDelete: null,
  651. onSave: null
  652. });
  653. // EXTERNAL MODULE: external "immutable"
  654. var external_immutable_ = __webpack_require__(17);
  655. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/slicedToArray.js
  656. var slicedToArray = __webpack_require__(16);
  657. var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
  658. // EXTERNAL MODULE: ./renderers/atomics/Image/style.scss
  659. var Image_style = __webpack_require__(45);
  660. // EXTERNAL MODULE: ./components/common/Switch/style.scss
  661. var Switch_style = __webpack_require__(44);
  662. // CONCATENATED MODULE: ./components/common/Switch/index.jsx
  663. /* harmony default export */ var Switch = (function (props) {
  664. var active = props.active,
  665. _onClick = props.onClick,
  666. className = props.className;
  667. return external_react_default.a.createElement("div", {
  668. onClick: function onClick() {
  669. return _onClick();
  670. },
  671. className: 'bf-switch ' + className + (active ? ' active' : '')
  672. });
  673. });
  674. // CONCATENATED MODULE: ./configs/controls.js
  675. /* harmony default export */ var configs_controls = (function (lang) {
  676. return [{
  677. key: 'undo',
  678. title: lang.controls.undo,
  679. text: external_react_default.a.createElement("i", {
  680. className: "bfi-undo"
  681. }),
  682. type: 'editor-method',
  683. command: 'undo'
  684. }, {
  685. key: 'redo',
  686. title: lang.controls.redo,
  687. text: external_react_default.a.createElement("i", {
  688. className: "bfi-redo"
  689. }),
  690. type: 'editor-method',
  691. command: 'redo'
  692. }, {
  693. key: 'remove-styles',
  694. title: lang.controls.removeStyles,
  695. text: external_react_default.a.createElement("i", {
  696. className: "bfi-format_clear"
  697. }),
  698. type: 'editor-method',
  699. command: 'removeSelectionInlineStyles'
  700. }, {
  701. key: 'hr',
  702. title: lang.controls.hr,
  703. text: external_react_default.a.createElement("i", {
  704. className: "bfi-hr"
  705. }),
  706. type: 'editor-method',
  707. command: 'insertHorizontalLine'
  708. }, {
  709. key: 'bold',
  710. title: lang.controls.bold,
  711. text: external_react_default.a.createElement("i", {
  712. className: "bfi-bold"
  713. }),
  714. type: 'inline-style',
  715. command: 'bold'
  716. }, {
  717. key: 'italic',
  718. title: lang.controls.italic,
  719. text: external_react_default.a.createElement("i", {
  720. className: "bfi-italic"
  721. }),
  722. type: 'inline-style',
  723. command: 'italic'
  724. }, {
  725. key: 'underline',
  726. title: lang.controls.underline,
  727. text: external_react_default.a.createElement("i", {
  728. className: "bfi-underlined"
  729. }),
  730. type: 'inline-style',
  731. command: 'underline'
  732. }, {
  733. key: 'strike-through',
  734. title: lang.controls.strikeThrough,
  735. text: external_react_default.a.createElement("i", {
  736. className: "bfi-strikethrough"
  737. }),
  738. type: 'inline-style',
  739. command: 'strikethrough'
  740. }, {
  741. key: 'superscript',
  742. title: lang.controls.superScript,
  743. text: external_react_default.a.createElement("i", {
  744. className: "bfi-superscript"
  745. }),
  746. type: 'inline-style',
  747. command: 'superscript'
  748. }, {
  749. key: 'subscript',
  750. title: lang.controls.subScript,
  751. text: external_react_default.a.createElement("i", {
  752. className: "bfi-subscript"
  753. }),
  754. type: 'inline-style',
  755. command: 'subscript'
  756. }, {
  757. key: 'headings',
  758. title: lang.controls.headings,
  759. type: 'headings'
  760. }, {
  761. key: 'blockquote',
  762. title: lang.controls.blockQuote,
  763. text: external_react_default.a.createElement("i", {
  764. className: "bfi-quote"
  765. }),
  766. type: 'block-type',
  767. command: 'blockquote'
  768. }, {
  769. key: 'code',
  770. title: lang.controls.code,
  771. text: external_react_default.a.createElement("i", {
  772. className: "bfi-code"
  773. }),
  774. type: 'block-type',
  775. command: 'code-block'
  776. }, {
  777. key: 'list-ul',
  778. title: lang.controls.unorderedList,
  779. text: external_react_default.a.createElement("i", {
  780. className: "bfi-list"
  781. }),
  782. type: 'block-type',
  783. command: 'unordered-list-item'
  784. }, {
  785. key: 'list-ol',
  786. title: lang.controls.orderedList,
  787. text: external_react_default.a.createElement("i", {
  788. className: "bfi-list-numbered"
  789. }),
  790. type: 'block-type',
  791. command: 'ordered-list-item'
  792. }, {
  793. key: 'link',
  794. title: lang.controls.link,
  795. type: 'link'
  796. }, {
  797. key: 'text-color',
  798. title: lang.controls.color,
  799. type: 'text-color'
  800. }, {
  801. key: 'line-height',
  802. title: lang.controls.lineHeight,
  803. type: 'line-height'
  804. }, {
  805. key: 'letter-spacing',
  806. title: lang.controls.letterSpacing,
  807. type: 'letter-spacing'
  808. }, {
  809. key: 'text-indent',
  810. title: lang.controls.textIndent,
  811. type: 'text-indent'
  812. }, {
  813. key: 'font-size',
  814. title: lang.controls.fontSize,
  815. type: 'font-size'
  816. }, {
  817. key: 'font-family',
  818. title: lang.controls.fontFamily,
  819. type: 'font-family'
  820. }, {
  821. key: 'text-align',
  822. title: lang.controls.textAlign,
  823. type: 'text-align'
  824. }, {
  825. key: 'media',
  826. title: lang.controls.media,
  827. text: external_react_default.a.createElement("i", {
  828. className: "bfi-media"
  829. }),
  830. type: 'media'
  831. }, {
  832. key: 'emoji',
  833. title: lang.controls.emoji,
  834. text: external_react_default.a.createElement("i", {
  835. className: "bfi-emoji"
  836. }),
  837. type: 'emoji'
  838. }, {
  839. key: 'clear',
  840. title: lang.controls.clear,
  841. text: lang.controls.clear,
  842. type: 'editor-method',
  843. command: 'clearEditorContent'
  844. }, {
  845. key: 'modal',
  846. type: 'modal'
  847. }, {
  848. key: 'button',
  849. type: 'button'
  850. }, {
  851. key: 'dropdown',
  852. type: 'dropdown'
  853. }, {
  854. key: 'component',
  855. type: 'component'
  856. }];
  857. });
  858. var imageControlItems = {
  859. 'float-left': {
  860. text: external_react_default.a.createElement("span", {
  861. "data-float": "left"
  862. }, "\uE91E"),
  863. command: 'setImageFloat|left'
  864. },
  865. 'float-right': {
  866. text: external_react_default.a.createElement("span", {
  867. "data-float": "right"
  868. }, "\uE914"),
  869. command: 'setImageFloat|right'
  870. },
  871. 'align-left': {
  872. text: external_react_default.a.createElement("span", {
  873. "data-align": "left"
  874. }, "\uE027"),
  875. command: 'setImageAlignment|left'
  876. },
  877. 'align-center': {
  878. text: external_react_default.a.createElement("span", {
  879. "data-align": "center"
  880. }, "\uE028"),
  881. command: 'setImageAlignment|center'
  882. },
  883. 'align-right': {
  884. text: external_react_default.a.createElement("span", {
  885. "data-align": "right"
  886. }, "\uE029"),
  887. command: 'setImageAlignment|right'
  888. },
  889. 'size': {
  890. text: external_react_default.a.createElement("span", null, "\uE3C2"),
  891. command: 'toggleSizeEditor'
  892. },
  893. 'link': {
  894. text: external_react_default.a.createElement("span", null, "\uE91A"),
  895. command: 'toggleLinkEditor'
  896. },
  897. 'remove': {
  898. text: external_react_default.a.createElement("span", null, "\uE9AC"),
  899. command: 'removeImage'
  900. }
  901. };
  902. // CONCATENATED MODULE: ./renderers/atomics/Image/index.jsx
  903. var Image_Image =
  904. /*#__PURE__*/
  905. function (_React$Component) {
  906. inherits_default()(Image, _React$Component);
  907. function Image() {
  908. var _getPrototypeOf2;
  909. var _this;
  910. classCallCheck_default()(this, Image);
  911. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  912. args[_key] = arguments[_key];
  913. }
  914. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Image)).call.apply(_getPrototypeOf2, [this].concat(args)));
  915. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  916. toolbarVisible: false,
  917. toolbarOffset: 0,
  918. linkEditorVisible: false,
  919. sizeEditorVisible: false,
  920. tempLink: null,
  921. tempWidth: null,
  922. tempHeight: null
  923. });
  924. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDragStart", function () {
  925. window.__BRAFT_DRAGING__IMAGE__ = {
  926. block: _this.props.block,
  927. mediaData: objectSpread_default()({
  928. type: 'IMAGE'
  929. }, _this.props.mediaData)
  930. };
  931. _this.setState({
  932. toolbarVisible: false
  933. }, function () {
  934. _this.props.editor.setDraftProps({
  935. readOnly: false
  936. });
  937. });
  938. return true;
  939. });
  940. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDragEnd", function () {
  941. window.__BRAFT_DRAGING__IMAGE__ = null;
  942. return false;
  943. });
  944. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "executeCommand", function (command) {
  945. if (typeof command === 'string') {
  946. var _command$split = command.split('|'),
  947. _command$split2 = slicedToArray_default()(_command$split, 2),
  948. method = _command$split2[0],
  949. param = _command$split2[1];
  950. _this[method] && _this[method](param);
  951. } else if (typeof command === 'function') {
  952. command(_this.props.block, _this.props.editorState);
  953. }
  954. });
  955. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeImage", function () {
  956. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
  957. _this.props.editor.setDraftProps({
  958. readOnly: false
  959. });
  960. });
  961. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleLinkEditor", function () {
  962. _this.setState({
  963. linkEditorVisible: !_this.state.linkEditorVisible,
  964. sizeEditorVisible: false
  965. });
  966. });
  967. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleSizeEditor", function () {
  968. _this.setState({
  969. linkEditorVisible: false,
  970. sizeEditorVisible: !_this.state.sizeEditorVisible
  971. });
  972. });
  973. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleLinkInputKeyDown", function (e) {
  974. if (e.keyCode === 13) {
  975. _this.confirmImageLink();
  976. } else {
  977. return;
  978. }
  979. });
  980. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageLink", function (e) {
  981. _this.setState({
  982. tempLink: e.currentTarget.value
  983. });
  984. return;
  985. });
  986. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "confirmImageLink", function () {
  987. var link = _this.state.tempLink;
  988. if (link !== null) {
  989. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(_this.props.editorState, _this.props.entityKey, {
  990. link: link
  991. }));
  992. window.setImmediate(_this.props.editor.forceRender);
  993. }
  994. });
  995. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleSizeInputKeyDown", function (e) {
  996. if (e.keyCode === 13) {
  997. _this.confirmImageSize();
  998. } else {
  999. return;
  1000. }
  1001. });
  1002. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageWidth", function (_ref) {
  1003. var currentTarget = _ref.currentTarget;
  1004. var value = currentTarget.value;
  1005. value && !isNaN(value) && (value = value + 'px');
  1006. _this.setState({
  1007. tempWidth: value
  1008. });
  1009. return;
  1010. });
  1011. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageHeight", function (_ref2) {
  1012. var currentTarget = _ref2.currentTarget;
  1013. var value = currentTarget.value;
  1014. value && !isNaN(value) && (value = value + 'px');
  1015. _this.setState({
  1016. tempHeight: value
  1017. });
  1018. return;
  1019. });
  1020. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "confirmImageSize", function () {
  1021. var _this$state = _this.state,
  1022. width = _this$state.tempWidth,
  1023. height = _this$state.tempHeight;
  1024. var newImageSize = {};
  1025. width !== null && (newImageSize.width = width);
  1026. height !== null && (newImageSize.height = height);
  1027. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(_this.props.editorState, _this.props.entityKey, newImageSize));
  1028. window.setImmediate(_this.props.editor.forceRender);
  1029. });
  1030. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageFloat", function (float) {
  1031. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaPosition(_this.props.editorState, _this.props.block, {
  1032. float: float
  1033. }));
  1034. _this.props.editor.setDraftProps({
  1035. readOnly: false
  1036. });
  1037. });
  1038. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageAlignment", function (alignment) {
  1039. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaPosition(_this.props.editorState, _this.props.block, {
  1040. alignment: alignment
  1041. }));
  1042. _this.props.editor.setDraftProps({
  1043. readOnly: false
  1044. });
  1045. });
  1046. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function (event) {
  1047. event.preventDefault();
  1048. if (!_this.state.toolbarVisible) {
  1049. _this.setState({
  1050. toolbarVisible: true
  1051. }, function () {
  1052. _this.props.editor.setDraftProps({
  1053. readOnly: true
  1054. });
  1055. _this.setState({
  1056. toolbarOffset: _this.calcToolbarOffset()
  1057. });
  1058. });
  1059. }
  1060. });
  1061. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function (event) {
  1062. event.preventDefault();
  1063. _this.setState({
  1064. toolbarVisible: false
  1065. }, function () {
  1066. _this.props.editor.setDraftProps({
  1067. readOnly: false
  1068. });
  1069. });
  1070. });
  1071. return _this;
  1072. }
  1073. createClass_default()(Image, [{
  1074. key: "render",
  1075. value: function render() {
  1076. var _this2 = this;
  1077. var _this$props = this.props,
  1078. mediaData = _this$props.mediaData,
  1079. language = _this$props.language,
  1080. imageControls = _this$props.imageControls;
  1081. var _this$state2 = this.state,
  1082. toolbarVisible = _this$state2.toolbarVisible,
  1083. toolbarOffset = _this$state2.toolbarOffset,
  1084. linkEditorVisible = _this$state2.linkEditorVisible,
  1085. sizeEditorVisible = _this$state2.sizeEditorVisible;
  1086. var blockData = this.props.block.getData();
  1087. var float = blockData.get('float');
  1088. var alignment = blockData.get('alignment');
  1089. var src = mediaData.src,
  1090. url = mediaData.url,
  1091. link = mediaData.link,
  1092. link_target = mediaData.link_target,
  1093. width = mediaData.width,
  1094. height = mediaData.height;
  1095. var imageStyles = {};
  1096. var clearFix = false;
  1097. if (float) {
  1098. alignment = null;
  1099. } else if (alignment === 'left') {
  1100. imageStyles.float = 'left';
  1101. clearFix = true;
  1102. } else if (alignment === 'right') {
  1103. imageStyles.float = 'right';
  1104. clearFix = true;
  1105. } else if (alignment === 'center') {
  1106. imageStyles.textAlign = 'center';
  1107. } else {
  1108. imageStyles.float = 'left';
  1109. clearFix = true;
  1110. }
  1111. var renderedControlItems = imageControls.map(function (item, index) {
  1112. if (typeof item === 'string' && imageControlItems[item]) {
  1113. return external_react_default.a.createElement("a", {
  1114. className: item === 'link' && link ? 'active' : '',
  1115. key: index,
  1116. href: "javascript:void(0);",
  1117. onClick: function onClick() {
  1118. return _this2.executeCommand(imageControlItems[item].command);
  1119. }
  1120. }, imageControlItems[item].text);
  1121. } else if (item && item.onClick && (item.render || item.text)) {
  1122. return external_react_default.a.createElement("a", {
  1123. key: index,
  1124. href: "javascript:void(0);",
  1125. onClick: function onClick() {
  1126. return _this2.executeCommand(item.onClick);
  1127. }
  1128. }, item.render ? item.render(mediaData) : item.text);
  1129. } else {
  1130. return null;
  1131. }
  1132. });
  1133. return external_react_default.a.createElement("div", {
  1134. className: "bf-media"
  1135. }, external_react_default.a.createElement("div", {
  1136. style: imageStyles,
  1137. draggable: true,
  1138. onMouseEnter: this.showToolbar,
  1139. onMouseMove: this.showToolbar,
  1140. onMouseLeave: this.hideToolbar,
  1141. onDragStart: this.handleDragStart,
  1142. onDragEnd: this.handleDragEnd,
  1143. ref: function ref(instance) {
  1144. return _this2.mediaEmbederInstance = instance;
  1145. },
  1146. className: "bf-image"
  1147. }, toolbarVisible ? external_react_default.a.createElement("div", {
  1148. style: {
  1149. marginLeft: toolbarOffset
  1150. },
  1151. ref: function ref(instance) {
  1152. return _this2.toolbarElement = instance;
  1153. },
  1154. "data-float": float,
  1155. "data-align": alignment,
  1156. className: "bf-media-toolbar"
  1157. }, linkEditorVisible ? external_react_default.a.createElement("div", {
  1158. className: "bf-image-link-editor"
  1159. }, external_react_default.a.createElement("div", {
  1160. className: "editor-input-group"
  1161. }, external_react_default.a.createElement("input", {
  1162. type: "text",
  1163. placeholder: language.linkEditor.inputWithEnterPlaceHolder,
  1164. onKeyDown: this.handleLinkInputKeyDown,
  1165. onChange: this.setImageLink,
  1166. defaultValue: link
  1167. }), external_react_default.a.createElement("button", {
  1168. type: "button",
  1169. onClick: this.confirmImageLink
  1170. }, language.base.confirm)), external_react_default.a.createElement("div", {
  1171. className: "switch-group"
  1172. }, external_react_default.a.createElement(Switch, {
  1173. active: link_target === '_blank',
  1174. onClick: function onClick() {
  1175. return _this2.setImageLinkTarget(link_target);
  1176. }
  1177. }), external_react_default.a.createElement("label", null, language.linkEditor.openInNewWindow))) : null, sizeEditorVisible ? external_react_default.a.createElement("div", {
  1178. className: "bf-image-size-editor"
  1179. }, external_react_default.a.createElement("div", {
  1180. className: "editor-input-group"
  1181. }, external_react_default.a.createElement("input", {
  1182. type: "text",
  1183. placeholder: language.base.width,
  1184. onKeyDown: this.handleSizeInputKeyDown,
  1185. onChange: this.setImageWidth,
  1186. defaultValue: width
  1187. }), external_react_default.a.createElement("input", {
  1188. type: "text",
  1189. placeholder: language.base.height,
  1190. onKeyDown: this.handleSizeInputKeyDown,
  1191. onChange: this.setImageHeight,
  1192. defaultValue: height
  1193. }), external_react_default.a.createElement("button", {
  1194. type: "button",
  1195. onClick: this.confirmImageSize
  1196. }, language.base.confirm))) : null, renderedControlItems, external_react_default.a.createElement("i", {
  1197. style: {
  1198. marginLeft: toolbarOffset * -1
  1199. },
  1200. className: "bf-media-toolbar-arrow"
  1201. })) : null, external_react_default.a.createElement("img", {
  1202. ref: function ref(instance) {
  1203. return _this2.imageElement = instance;
  1204. },
  1205. src: src || url,
  1206. style: {
  1207. width: width,
  1208. height: height
  1209. },
  1210. width: width,
  1211. height: height
  1212. })), clearFix && external_react_default.a.createElement("div", {
  1213. className: "clearfix",
  1214. style: {
  1215. clear: 'both',
  1216. height: 0,
  1217. lineHeight: 0,
  1218. float: 'none'
  1219. }
  1220. }));
  1221. }
  1222. }, {
  1223. key: "calcToolbarOffset",
  1224. value: function calcToolbarOffset() {
  1225. if (!this.props.containerNode) {
  1226. return 0;
  1227. }
  1228. var viewRect = this.props.containerNode.getBoundingClientRect();
  1229. var toolbarRect = this.toolbarElement.getBoundingClientRect();
  1230. var imageRect = this.imageElement.getBoundingClientRect();
  1231. var right = viewRect.right - (imageRect.right - imageRect.width / 2 + toolbarRect.width / 2);
  1232. var left = imageRect.left + imageRect.width / 2 - toolbarRect.width / 2 - viewRect.left;
  1233. if (right < 10) {
  1234. return right - 10;
  1235. } else if (left < 10) {
  1236. return left * -1 + 10;
  1237. } else {
  1238. return 0;
  1239. }
  1240. }
  1241. }, {
  1242. key: "setImageLinkTarget",
  1243. value: function setImageLinkTarget(link_target) {
  1244. link_target = link_target === '_blank' ? '' : '_blank';
  1245. this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(this.props.editorState, this.props.entityKey, {
  1246. link_target: link_target
  1247. }));
  1248. window.setImmediate(this.props.editor.forceRender);
  1249. }
  1250. }]);
  1251. return Image;
  1252. }(external_react_default.a.Component);
  1253. // EXTERNAL MODULE: ./renderers/atomics/Video/style.scss
  1254. var Video_style = __webpack_require__(43);
  1255. // CONCATENATED MODULE: ./components/common/StaticContainer/index.jsx
  1256. var StaticContainer_default =
  1257. /*#__PURE__*/
  1258. function (_React$Component) {
  1259. inherits_default()(_default, _React$Component);
  1260. function _default() {
  1261. classCallCheck_default()(this, _default);
  1262. return possibleConstructorReturn_default()(this, getPrototypeOf_default()(_default).apply(this, arguments));
  1263. }
  1264. createClass_default()(_default, [{
  1265. key: "shouldComponentUpdate",
  1266. value: function shouldComponentUpdate() {
  1267. return false;
  1268. }
  1269. }, {
  1270. key: "render",
  1271. value: function render() {
  1272. return external_react_default.a.createElement("div", null, this.props.children);
  1273. }
  1274. }]);
  1275. return _default;
  1276. }(external_react_default.a.Component);
  1277. // CONCATENATED MODULE: ./renderers/atomics/Video/index.jsx
  1278. var Video_Video =
  1279. /*#__PURE__*/
  1280. function (_React$Component) {
  1281. inherits_default()(Video, _React$Component);
  1282. function Video() {
  1283. var _getPrototypeOf2;
  1284. var _this;
  1285. classCallCheck_default()(this, Video);
  1286. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1287. args[_key] = arguments[_key];
  1288. }
  1289. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Video)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1290. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  1291. toolbarVisible: false
  1292. });
  1293. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeVideo", function () {
  1294. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
  1295. });
  1296. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
  1297. _this.setState({
  1298. toolbarVisible: true
  1299. });
  1300. });
  1301. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
  1302. _this.setState({
  1303. toolbarVisible: false
  1304. });
  1305. });
  1306. return _this;
  1307. }
  1308. createClass_default()(Video, [{
  1309. key: "render",
  1310. value: function render() {
  1311. var toolbarVisible = this.state.toolbarVisible;
  1312. var mediaData = this.props.mediaData;
  1313. var src = mediaData.src,
  1314. url = mediaData.url,
  1315. meta = mediaData.meta;
  1316. return external_react_default.a.createElement("div", {
  1317. className: "bf-video",
  1318. onMouseOver: this.showToolbar,
  1319. onMouseLeave: this.hideToolbar
  1320. }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("video", {
  1321. controls: true,
  1322. src: src || url,
  1323. poster: meta.poster
  1324. })), toolbarVisible ? external_react_default.a.createElement("div", {
  1325. className: "bf-embed-toolbar"
  1326. }, external_react_default.a.createElement("a", {
  1327. onClick: this.removeVideo
  1328. }, "\uE9AC")) : null);
  1329. }
  1330. }]);
  1331. return Video;
  1332. }(external_react_default.a.Component);
  1333. // EXTERNAL MODULE: ./renderers/atomics/Audio/style.scss
  1334. var Audio_style = __webpack_require__(42);
  1335. // CONCATENATED MODULE: ./renderers/atomics/Audio/index.jsx
  1336. var Audio_Audio =
  1337. /*#__PURE__*/
  1338. function (_React$Component) {
  1339. inherits_default()(Audio, _React$Component);
  1340. function Audio() {
  1341. var _getPrototypeOf2;
  1342. var _this;
  1343. classCallCheck_default()(this, Audio);
  1344. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1345. args[_key] = arguments[_key];
  1346. }
  1347. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Audio)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1348. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  1349. toolbarVisible: false
  1350. });
  1351. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeAudio", function () {
  1352. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
  1353. });
  1354. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
  1355. _this.setState({
  1356. toolbarVisible: true
  1357. });
  1358. });
  1359. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
  1360. _this.setState({
  1361. toolbarVisible: false
  1362. });
  1363. });
  1364. return _this;
  1365. }
  1366. createClass_default()(Audio, [{
  1367. key: "render",
  1368. value: function render() {
  1369. var toolbarVisible = this.state.toolbarVisible;
  1370. var mediaData = this.props.mediaData;
  1371. var src = mediaData.src,
  1372. url = mediaData.url;
  1373. return external_react_default.a.createElement("div", {
  1374. className: "bf-audio",
  1375. onMouseOver: this.showToolbar,
  1376. onMouseLeave: this.hideToolbar
  1377. }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("audio", {
  1378. controls: true,
  1379. src: src || url
  1380. })), toolbarVisible ? external_react_default.a.createElement("div", {
  1381. className: "bf-media-toolbar"
  1382. }, external_react_default.a.createElement("a", {
  1383. onClick: this.removeAudio
  1384. }, "\uE9AC")) : null);
  1385. }
  1386. }]);
  1387. return Audio;
  1388. }(external_react_default.a.Component);
  1389. // EXTERNAL MODULE: ./renderers/atomics/Embed/style.scss
  1390. var Embed_style = __webpack_require__(41);
  1391. // CONCATENATED MODULE: ./renderers/atomics/Embed/index.jsx
  1392. var Embed_Embed =
  1393. /*#__PURE__*/
  1394. function (_React$Component) {
  1395. inherits_default()(Embed, _React$Component);
  1396. function Embed() {
  1397. var _getPrototypeOf2;
  1398. var _this;
  1399. classCallCheck_default()(this, Embed);
  1400. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1401. args[_key] = arguments[_key];
  1402. }
  1403. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Embed)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1404. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  1405. toolbarVisible: false
  1406. });
  1407. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeEmbed", function () {
  1408. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
  1409. });
  1410. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
  1411. _this.setState({
  1412. toolbarVisible: true
  1413. });
  1414. });
  1415. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
  1416. _this.setState({
  1417. toolbarVisible: false
  1418. });
  1419. });
  1420. return _this;
  1421. }
  1422. createClass_default()(Embed, [{
  1423. key: "render",
  1424. value: function render() {
  1425. var toolbarVisible = this.state.toolbarVisible;
  1426. var mediaData = this.props.mediaData;
  1427. var src = mediaData.src,
  1428. url = mediaData.url;
  1429. return external_react_default.a.createElement("div", {
  1430. className: "bf-embed",
  1431. onMouseOver: this.showToolbar,
  1432. onMouseLeave: this.hideToolbar
  1433. }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("div", {
  1434. className: "bf-embed-player",
  1435. dangerouslySetInnerHTML: {
  1436. __html: src || url
  1437. }
  1438. })), toolbarVisible ? external_react_default.a.createElement("div", {
  1439. className: "bf-media-toolbar"
  1440. }, external_react_default.a.createElement("a", {
  1441. onClick: this.removeEmbed
  1442. }, "\uE9AC")) : null);
  1443. }
  1444. }]);
  1445. return Embed;
  1446. }(external_react_default.a.Component);
  1447. // EXTERNAL MODULE: ./renderers/atomics/HorizontalLine/style.scss
  1448. var HorizontalLine_style = __webpack_require__(40);
  1449. // CONCATENATED MODULE: ./renderers/atomics/HorizontalLine/index.jsx
  1450. var HorizontalLine_HorizontalLine =
  1451. /*#__PURE__*/
  1452. function (_React$Component) {
  1453. inherits_default()(HorizontalLine, _React$Component);
  1454. function HorizontalLine() {
  1455. var _getPrototypeOf2;
  1456. var _this;
  1457. classCallCheck_default()(this, HorizontalLine);
  1458. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1459. args[_key] = arguments[_key];
  1460. }
  1461. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(HorizontalLine)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1462. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeHorizontalLine", function () {
  1463. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
  1464. });
  1465. return _this;
  1466. }
  1467. createClass_default()(HorizontalLine, [{
  1468. key: "render",
  1469. value: function render() {
  1470. return external_react_default.a.createElement("div", {
  1471. className: "bf-hr"
  1472. }, external_react_default.a.createElement("div", {
  1473. className: "bf-media-toolbar"
  1474. }, external_react_default.a.createElement("a", {
  1475. onClick: this.removeHorizontalLine
  1476. }, "\uE9AC")));
  1477. }
  1478. }]);
  1479. return HorizontalLine;
  1480. }(external_react_default.a.Component);
  1481. // CONCATENATED MODULE: ./renderers/styles/blockStyles.js
  1482. /* harmony default export */ var blockStyles = (function (customBlockStyleFn) {
  1483. return function (block) {
  1484. var blockAlignment = block.getData() && block.getData().get('textAlign');
  1485. var blockFloat = block.getData() && block.getData().get('float');
  1486. var result = '';
  1487. if (blockAlignment) {
  1488. result = "bfa-".concat(blockAlignment);
  1489. }
  1490. if (blockFloat) {
  1491. result += " bff-".concat(blockFloat);
  1492. }
  1493. if (customBlockStyleFn) {
  1494. result += customBlockStyleFn(block);
  1495. }
  1496. return result;
  1497. };
  1498. });
  1499. // CONCATENATED MODULE: ./renderers/styles/inlineStyles.js
  1500. /* harmony default export */ var inlineStyles = (function (props) {
  1501. var customStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1502. var colorStyles = {};
  1503. var bgColorStyles = {};
  1504. var fontSizeStyles = {};
  1505. var fontFamilyStyles = {};
  1506. var lineHeightStyles = {};
  1507. var letterSpacingtStyles = {};
  1508. var indentStyles = {};
  1509. props.colors.forEach(function (color) {
  1510. var color_id = color.replace('#', '').toUpperCase();
  1511. colorStyles['COLOR-' + color_id] = {
  1512. color: color
  1513. };
  1514. bgColorStyles['BGCOLOR-' + color_id] = {
  1515. backgroundColor: color
  1516. };
  1517. });
  1518. props.fontSizes.forEach(function (fontSize) {
  1519. fontSizeStyles['FONTSIZE-' + fontSize] = {
  1520. fontSize: fontSize
  1521. };
  1522. });
  1523. props.fontFamilies.forEach(function (fontFamily) {
  1524. fontFamilyStyles['FONTFAMILY-' + fontFamily.name.toUpperCase()] = {
  1525. fontFamily: fontFamily.family
  1526. };
  1527. });
  1528. props.lineHeights.forEach(function (lineHeight) {
  1529. lineHeightStyles['LINEHEIGHT-' + lineHeight] = {
  1530. lineHeight: lineHeight
  1531. };
  1532. });
  1533. props.letterSpacings.forEach(function (letterSpacing) {
  1534. letterSpacingtStyles['LETTERSPACING-' + letterSpacing] = {
  1535. letterSpacing: letterSpacing
  1536. };
  1537. });
  1538. props.textIndents.forEach(function (indent) {
  1539. indentStyles['INDENT-' + indent] = {
  1540. paddingLeft: indent,
  1541. paddingRight: indent
  1542. };
  1543. });
  1544. return objectSpread_default()({
  1545. 'SUPERSCRIPT': {
  1546. position: 'relative',
  1547. top: '-8px',
  1548. fontSize: '11px'
  1549. },
  1550. 'SUBSCRIPT': {
  1551. position: 'relative',
  1552. bottom: '-8px',
  1553. fontSize: '11px'
  1554. }
  1555. }, colorStyles, bgColorStyles, fontSizeStyles, fontFamilyStyles, lineHeightStyles, letterSpacingtStyles, indentStyles, customStyles);
  1556. });
  1557. // CONCATENATED MODULE: ./renderers/decorators/Link/index.jsx
  1558. function handleStrategy(contentBlock, callback, contentState) {
  1559. contentBlock.findEntityRanges(function (character) {
  1560. var entityKey = character.getEntity();
  1561. return entityKey !== null && contentState.getEntity(entityKey).getType() === 'LINK';
  1562. }, callback);
  1563. }
  1564. var Link_Link = function Link(props) {
  1565. var children = props.children,
  1566. entityKey = props.entityKey,
  1567. contentState = props.contentState;
  1568. var _contentState$getEnti = contentState.getEntity(entityKey).getData(),
  1569. href = _contentState$getEnti.href,
  1570. target = _contentState$getEnti.target;
  1571. return external_react_default.a.createElement("span", {
  1572. className: "bf-link-wrap"
  1573. }, external_react_default.a.createElement("a", {
  1574. onClick: function onClick(event) {
  1575. return viewLink(event, href);
  1576. },
  1577. className: "bf-link",
  1578. href: href,
  1579. target: target
  1580. }, children));
  1581. };
  1582. var viewLink = function viewLink(event, link) {
  1583. if (event.getModifierState('Shift')) {
  1584. var tempLink = document.createElement('a');
  1585. tempLink.href = link;
  1586. tempLink.target = '_blank';
  1587. tempLink.click();
  1588. }
  1589. };
  1590. /* harmony default export */ var decorators_Link = ({
  1591. strategy: handleStrategy,
  1592. component: Link_Link
  1593. });
  1594. // CONCATENATED MODULE: ./renderers/decorators/index.js
  1595. /* harmony default export */ var decorators = ([decorators_Link]);
  1596. // CONCATENATED MODULE: ./renderers/index.js
  1597. var renderers_getAtomicBlockComponent = function getAtomicBlockComponent(block, superProps) {
  1598. return function (props) {
  1599. var entityKey = props.block.getEntityAt(0);
  1600. if (!entityKey) {
  1601. return null;
  1602. }
  1603. var entity = props.contentState.getEntity(entityKey);
  1604. var mediaData = entity.getData();
  1605. var mediaType = entity.getType();
  1606. var mediaProps = objectSpread_default()({}, superProps, {
  1607. block: block,
  1608. mediaData: mediaData,
  1609. entityKey: entityKey
  1610. });
  1611. if (mediaType === 'IMAGE') {
  1612. return external_react_default.a.createElement(Image_Image, mediaProps);
  1613. } else if (mediaType === 'AUDIO') {
  1614. return external_react_default.a.createElement(Audio_Audio, mediaProps);
  1615. } else if (mediaType === 'VIDEO') {
  1616. return external_react_default.a.createElement(Video_Video, mediaProps);
  1617. } else if (mediaType === 'EMBED') {
  1618. return external_react_default.a.createElement(Embed_Embed, mediaProps);
  1619. } else if (mediaType === 'HR') {
  1620. return external_react_default.a.createElement(HorizontalLine_HorizontalLine, mediaProps);
  1621. }
  1622. if (superProps.extendAtomics) {
  1623. var atomics = superProps.extendAtomics;
  1624. for (var i = 0; i < atomics.length; i++) {
  1625. if (mediaType === atomics[i].type) {
  1626. var Component = atomics[i].component;
  1627. return external_react_default.a.createElement(Component, mediaProps);
  1628. }
  1629. }
  1630. }
  1631. return null;
  1632. };
  1633. };
  1634. var getBlockRendererFn = function getBlockRendererFn(props, customBlockRendererFn) {
  1635. return function (block) {
  1636. var blockRenderer = null;
  1637. if (block.getType() === 'atomic') {
  1638. blockRenderer = {
  1639. component: renderers_getAtomicBlockComponent(block, props),
  1640. editable: false
  1641. };
  1642. } else if (customBlockRendererFn) {
  1643. blockRenderer = customBlockRendererFn(block) || null;
  1644. }
  1645. return blockRenderer;
  1646. };
  1647. };
  1648. var customBlockRenderMap = Object(external_immutable_["Map"])({
  1649. 'atomic': {
  1650. element: ''
  1651. },
  1652. 'code-block': {
  1653. element: 'code',
  1654. wrapper: external_draft_js_["DefaultDraftBlockRenderMap"].get('code-block').wrapper
  1655. }
  1656. });
  1657. var getBlockStyleFn = blockStyles;
  1658. var getCustomStyleMap = inlineStyles;
  1659. var renderers_decorators = decorators;
  1660. // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/extends.js
  1661. var helpers_extends = __webpack_require__(11);
  1662. var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
  1663. // EXTERNAL MODULE: ./components/business/ControlBar/style.scss
  1664. var ControlBar_style = __webpack_require__(39);
  1665. // EXTERNAL MODULE: ./components/business/LinkEditor/style.scss
  1666. var LinkEditor_style = __webpack_require__(38);
  1667. // EXTERNAL MODULE: ./components/common/DropDown/style.scss
  1668. var DropDown_style = __webpack_require__(37);
  1669. // CONCATENATED MODULE: ./helpers/responsive.js
  1670. var resizeEventHandlers = [];
  1671. var responsiveHelperInited = false;
  1672. var debouce = false;
  1673. /* harmony default export */ var responsive = ({
  1674. resolve: function resolve(eventHandler) {
  1675. var id = external_braft_utils_["BaseUtils"].UniqueIndex();
  1676. resizeEventHandlers.push({
  1677. id: id,
  1678. eventHandler: eventHandler
  1679. });
  1680. return id;
  1681. },
  1682. unresolve: function unresolve(id) {
  1683. resizeEventHandlers = resizeEventHandlers.filter(function (item) {
  1684. return item.id !== id;
  1685. });
  1686. }
  1687. });
  1688. if (!responsiveHelperInited) {
  1689. window.addEventListener('resize', function (event) {
  1690. clearTimeout(debouce);
  1691. debouce = setTimeout(function () {
  1692. resizeEventHandlers.map(function (item) {
  1693. typeof item.eventHandler === 'function' && item.eventHandler(event);
  1694. });
  1695. debouce = false;
  1696. }, 100);
  1697. });
  1698. responsiveHelperInited = true;
  1699. }
  1700. // CONCATENATED MODULE: ./components/common/DropDown/index.jsx
  1701. var DropDown_DropDown =
  1702. /*#__PURE__*/
  1703. function (_React$Component) {
  1704. inherits_default()(DropDown, _React$Component);
  1705. function DropDown() {
  1706. var _getPrototypeOf2;
  1707. var _this;
  1708. classCallCheck_default()(this, DropDown);
  1709. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1710. args[_key] = arguments[_key];
  1711. }
  1712. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(DropDown)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1713. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "alive", false);
  1714. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "responsiveResolveId", null);
  1715. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownHandlerElement", null);
  1716. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownContentElement", null);
  1717. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "componentId", _this.props.componentId || 'BRAFT-DROPDOWN-' + external_braft_utils_["BaseUtils"].UniqueIndex());
  1718. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  1719. active: false,
  1720. offset: 0,
  1721. maxHeight: 100
  1722. });
  1723. return _this;
  1724. }
  1725. createClass_default()(DropDown, [{
  1726. key: "componentDidMount",
  1727. value: function componentDidMount() {
  1728. var _this2 = this;
  1729. this.alive = true;
  1730. document.body.addEventListener('click', function (event) {
  1731. _this2.registerClickEvent(event);
  1732. });
  1733. this.responsiveResolveId = responsive.resolve(function () {
  1734. _this2.fixDropDownPosition();
  1735. });
  1736. }
  1737. }, {
  1738. key: "componentWillReceiveProps",
  1739. value: function componentWillReceiveProps(next) {
  1740. if (!this.props.disabled && next.disabled) {
  1741. this.hide();
  1742. }
  1743. }
  1744. }, {
  1745. key: "componentDidUpdate",
  1746. value: function componentDidUpdate(prevState) {
  1747. if (!prevState.active && this.state.active) {
  1748. this.fixDropDownPosition();
  1749. }
  1750. }
  1751. }, {
  1752. key: "componentWillUnmount",
  1753. value: function componentWillUnmount() {
  1754. var _this3 = this;
  1755. document.body.removeEventListener('click', function (event) {
  1756. _this3.registerClickEvent(event);
  1757. });
  1758. this.alive = false;
  1759. responsive.unresolve(this.responsiveResolveId);
  1760. }
  1761. }, {
  1762. key: "render",
  1763. value: function render() {
  1764. var _this4 = this;
  1765. var _this$state = this.state,
  1766. active = _this$state.active,
  1767. offset = _this$state.offset,
  1768. maxHeight = _this$state.maxHeight;
  1769. var _this$props = this.props,
  1770. caption = _this$props.caption,
  1771. htmlCaption = _this$props.htmlCaption,
  1772. title = _this$props.title,
  1773. disabled = _this$props.disabled,
  1774. showArrow = _this$props.showArrow,
  1775. arrowActive = _this$props.arrowActive,
  1776. className = _this$props.className,
  1777. children = _this$props.children;
  1778. disabled && (active = false);
  1779. return external_react_default.a.createElement("div", {
  1780. id: this.componentId,
  1781. className: 'bf-dropdown ' + (active ? 'active ' : '') + (disabled ? 'disabled ' : '') + className
  1782. }, htmlCaption ? external_react_default.a.createElement("button", {
  1783. type: "button",
  1784. className: "dropdown-handler",
  1785. "data-title": title,
  1786. "data-braft-component-id": this.componentId,
  1787. dangerouslySetInnerHTML: htmlCaption ? {
  1788. __html: htmlCaption
  1789. } : null,
  1790. ref: function ref(instance) {
  1791. return _this4.dropDownHandlerElement = instance;
  1792. }
  1793. }) : external_react_default.a.createElement("button", {
  1794. type: "button",
  1795. className: "dropdown-handler",
  1796. "data-title": title,
  1797. "data-braft-component-id": this.componentId,
  1798. ref: function ref(instance) {
  1799. return _this4.dropDownHandlerElement = instance;
  1800. }
  1801. }, external_react_default.a.createElement("span", null, caption), showArrow !== false ? external_react_default.a.createElement("i", {
  1802. className: "bfi-drop-down"
  1803. }) : null), external_react_default.a.createElement("div", {
  1804. className: "dropdown-content",
  1805. style: {
  1806. marginLeft: offset
  1807. },
  1808. ref: function ref(instance) {
  1809. return _this4.dropDownContentElement = instance;
  1810. }
  1811. }, external_react_default.a.createElement("i", {
  1812. style: {
  1813. marginLeft: offset * -1
  1814. },
  1815. className: 'dropdown-arrow' + (arrowActive ? ' active' : '')
  1816. }), external_react_default.a.createElement("div", {
  1817. className: "dropdown-content-inner",
  1818. style: {
  1819. maxHeight: maxHeight
  1820. }
  1821. }, children)));
  1822. }
  1823. }, {
  1824. key: "fixDropDownPosition",
  1825. value: function fixDropDownPosition() {
  1826. var viewRect = this.props.containerNode.getBoundingClientRect();
  1827. var editorContentRect = this.props.containerNode.querySelector('.bf-content').getBoundingClientRect();
  1828. var handlerRect = this.dropDownHandlerElement.getBoundingClientRect();
  1829. var contentRect = this.dropDownContentElement.getBoundingClientRect();
  1830. var maxHeight = editorContentRect.height + (editorContentRect.top - (handlerRect.top + handlerRect.height)) - 30;
  1831. var offset = 0;
  1832. var right = handlerRect.right - handlerRect.width / 2 + contentRect.width / 2;
  1833. var left = handlerRect.left + handlerRect.width / 2 - contentRect.width / 2;
  1834. right = viewRect.right - right;
  1835. left = left - viewRect.left;
  1836. if (right < 10) {
  1837. offset = right - 10;
  1838. } else if (left < 10) {
  1839. offset = left * -1 + 10;
  1840. }
  1841. if (offset !== this.state.offset || maxHeight !== this.state.maxHeight) {
  1842. this.setState({
  1843. offset: offset,
  1844. maxHeight: maxHeight
  1845. });
  1846. }
  1847. }
  1848. }, {
  1849. key: "registerClickEvent",
  1850. value: function registerClickEvent(event) {
  1851. var autoHide = this.props.autoHide;
  1852. var active = false;
  1853. if (event.target.dataset.braftComponentId === this.componentId) {
  1854. active = event.target.dataset.keepActive ? true : !this.state.active;
  1855. } else if (autoHide === false) {
  1856. active = this.state.active;
  1857. }
  1858. this.alive && this.setState({
  1859. active: active
  1860. });
  1861. }
  1862. }, {
  1863. key: "show",
  1864. value: function show() {
  1865. this.setState({
  1866. active: true
  1867. });
  1868. }
  1869. }, {
  1870. key: "hide",
  1871. value: function hide() {
  1872. this.setState({
  1873. active: false
  1874. });
  1875. }
  1876. }]);
  1877. return DropDown;
  1878. }(external_react_default.a.Component);
  1879. // CONCATENATED MODULE: ./components/business/LinkEditor/index.jsx
  1880. var LinkEditor_LinkEditor =
  1881. /*#__PURE__*/
  1882. function (_React$Component) {
  1883. inherits_default()(LinkEditor, _React$Component);
  1884. function LinkEditor() {
  1885. var _getPrototypeOf2;
  1886. var _this;
  1887. classCallCheck_default()(this, LinkEditor);
  1888. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1889. args[_key] = arguments[_key];
  1890. }
  1891. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(LinkEditor)).call.apply(_getPrototypeOf2, [this].concat(args)));
  1892. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  1893. href: '',
  1894. target: ''
  1895. });
  1896. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownComponent", null);
  1897. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handeKeyDown", function (e) {
  1898. if (e.keyCode === 13) {
  1899. _this.handleConfirm();
  1900. e.preventDefault();
  1901. return false;
  1902. }
  1903. });
  1904. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "inputLink", function (e) {
  1905. _this.setState({
  1906. href: e.currentTarget.value
  1907. });
  1908. });
  1909. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setTarget", function () {
  1910. _this.setState({
  1911. target: _this.state.target === '_blank' ? '' : '_blank'
  1912. });
  1913. });
  1914. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleCancel", function () {
  1915. _this.dropDownComponent.hide();
  1916. });
  1917. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleUnlink", function () {
  1918. _this.dropDownComponent.hide();
  1919. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLink(_this.props.editorState, false));
  1920. });
  1921. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleConfirm", function () {
  1922. var _this$state = _this.state,
  1923. href = _this$state.href,
  1924. target = _this$state.target;
  1925. var hookReturns = _this.props.hooks('toggle-link', {
  1926. href: href,
  1927. target: target
  1928. })({
  1929. href: href,
  1930. target: target
  1931. });
  1932. _this.dropDownComponent.hide();
  1933. _this.props.editor.requestFocus();
  1934. if (hookReturns === false) {
  1935. return false;
  1936. }
  1937. if (hookReturns) {
  1938. typeof hookReturns.href === 'string' && (href = hookReturns.href);
  1939. typeof hookReturns.target === 'string' && (target = hookReturns.target);
  1940. }
  1941. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLink(_this.props.editorState, href, target));
  1942. });
  1943. return _this;
  1944. }
  1945. createClass_default()(LinkEditor, [{
  1946. key: "componentWillReceiveProps",
  1947. value: function componentWillReceiveProps(next) {
  1948. var _ContentUtils$getSele = external_braft_utils_["ContentUtils"].getSelectionEntityData(next.editorState, 'LINK'),
  1949. href = _ContentUtils$getSele.href,
  1950. target = _ContentUtils$getSele.target;
  1951. this.setState({
  1952. href: href || '',
  1953. target: target || ''
  1954. });
  1955. }
  1956. }, {
  1957. key: "render",
  1958. value: function render() {
  1959. var _this2 = this;
  1960. var _this$state2 = this.state,
  1961. href = _this$state2.href,
  1962. target = _this$state2.target;
  1963. var caption = external_react_default.a.createElement("i", {
  1964. className: "bfi-link"
  1965. });
  1966. var textSelected = !external_braft_utils_["ContentUtils"].isSelectionCollapsed(this.props.editorState) && external_braft_utils_["ContentUtils"].getSelectionBlockType(this.props.editorState) !== 'atomic';
  1967. return external_react_default.a.createElement("div", {
  1968. className: "control-item-group"
  1969. }, external_react_default.a.createElement(DropDown_DropDown, {
  1970. caption: caption,
  1971. title: this.props.language.controls.link,
  1972. autoHide: false,
  1973. containerNode: this.props.containerNode,
  1974. showArrow: false,
  1975. disabled: !textSelected,
  1976. ref: function ref(instance) {
  1977. return _this2.dropDownComponent = instance;
  1978. },
  1979. className: 'control-item dropdown link-editor-dropdown'
  1980. }, external_react_default.a.createElement("div", {
  1981. className: "bf-link-editor"
  1982. }, external_react_default.a.createElement("div", {
  1983. className: "input-group"
  1984. }, external_react_default.a.createElement("input", {
  1985. type: "text",
  1986. value: href,
  1987. spellCheck: false,
  1988. placeholder: this.props.language.linkEditor.inputPlaceHolder,
  1989. onKeyDown: this.handeKeyDown,
  1990. onChange: this.inputLink
  1991. })), external_react_default.a.createElement("div", {
  1992. className: "switch-group"
  1993. }, external_react_default.a.createElement(Switch, {
  1994. active: target === '_blank',
  1995. onClick: this.setTarget
  1996. }), external_react_default.a.createElement("label", null, this.props.language.linkEditor.openInNewWindow)), external_react_default.a.createElement("div", {
  1997. className: "buttons"
  1998. }, external_react_default.a.createElement("a", {
  1999. onClick: this.handleUnlink,
  2000. className: "primary pull-left",
  2001. href: "javascript:void(0);"
  2002. }, external_react_default.a.createElement("i", {
  2003. className: "bfi-close"
  2004. }), external_react_default.a.createElement("span", null, this.props.language.linkEditor.removeLink)), external_react_default.a.createElement("button", {
  2005. type: "button",
  2006. onClick: this.handleConfirm,
  2007. className: "primary pull-right"
  2008. }, this.props.language.base.confirm), external_react_default.a.createElement("button", {
  2009. type: "button",
  2010. onClick: this.handleCancel,
  2011. className: "default pull-right"
  2012. }, this.props.language.base.cancel)))), external_react_default.a.createElement("button", {
  2013. type: "button",
  2014. "data-title": this.props.language.controls.unlink,
  2015. className: "control-item button",
  2016. onClick: this.handleUnlink,
  2017. disabled: !textSelected || !href
  2018. }, external_react_default.a.createElement("i", {
  2019. className: "bfi-link-off"
  2020. })));
  2021. }
  2022. }]);
  2023. return LinkEditor;
  2024. }(external_react_default.a.Component);
  2025. // EXTERNAL MODULE: ./components/business/Headings/style.scss
  2026. var Headings_style = __webpack_require__(36);
  2027. // CONCATENATED MODULE: ./configs/maps.js
  2028. var maps_getHeadings = function getHeadings(lang) {
  2029. return [{
  2030. key: 'header-one',
  2031. title: lang.controls.header + ' 1',
  2032. text: external_react_default.a.createElement("h1", null, lang.controls.header, " 1"),
  2033. type: 'block-type',
  2034. command: 'header-one'
  2035. }, {
  2036. key: 'header-two',
  2037. title: lang.controls.header + ' 2',
  2038. text: external_react_default.a.createElement("h2", null, lang.controls.header, " 2"),
  2039. type: 'block-type',
  2040. command: 'header-two'
  2041. }, {
  2042. key: 'header-three',
  2043. title: lang.controls.header + ' 3',
  2044. text: external_react_default.a.createElement("h3", null, lang.controls.header, " 3"),
  2045. type: 'block-type',
  2046. command: 'header-three'
  2047. }, {
  2048. key: 'header-four',
  2049. title: lang.controls.header + ' 4',
  2050. text: external_react_default.a.createElement("h4", null, lang.controls.header, " 4"),
  2051. type: 'block-type',
  2052. command: 'header-four'
  2053. }, {
  2054. key: 'header-five',
  2055. title: lang.controls.header + ' 5',
  2056. text: external_react_default.a.createElement("h5", null, lang.controls.header, " 5"),
  2057. type: 'block-type',
  2058. command: 'header-five'
  2059. }, {
  2060. key: 'header-six',
  2061. title: lang.controls.header + ' 6',
  2062. text: external_react_default.a.createElement("h6", null, lang.controls.header, " 6"),
  2063. type: 'block-type',
  2064. command: 'header-six'
  2065. }, {
  2066. key: 'unstyled',
  2067. title: lang.controls.normal,
  2068. text: lang.controls.normal,
  2069. type: 'block-type',
  2070. command: 'unstyled'
  2071. }];
  2072. };
  2073. var blocks = {
  2074. 'header-one': 'h1',
  2075. 'header-two': 'h2',
  2076. 'header-three': 'h3',
  2077. 'header-four': 'h4',
  2078. 'header-fiv': 'h5',
  2079. 'header-six': 'h6',
  2080. 'unstyled': 'p',
  2081. 'blockquote': 'blockquote'
  2082. };
  2083. // CONCATENATED MODULE: ./components/business/Headings/index.jsx
  2084. /* harmony default export */ var Headings = (function (props) {
  2085. var headings = maps_getHeadings(props.language);
  2086. var currentHeadingIndex = headings.findIndex(function (item) {
  2087. return item.command === props.current;
  2088. });
  2089. var caption = headings[currentHeadingIndex] ? headings[currentHeadingIndex].title : props.language.controls.normal;
  2090. return external_react_default.a.createElement(DropDown_DropDown, {
  2091. caption: caption,
  2092. containerNode: props.containerNode,
  2093. title: props.language.controls.headings,
  2094. arrowActive: currentHeadingIndex === 0,
  2095. className: 'control-item dropdown headings-dropdown'
  2096. }, external_react_default.a.createElement("ul", {
  2097. className: "menu"
  2098. }, headings.map(function (item, index) {
  2099. var isActive = props.current === item.command;
  2100. return external_react_default.a.createElement("li", {
  2101. key: index,
  2102. className: 'menu-item' + (isActive ? ' active' : ''),
  2103. onClick: function onClick() {
  2104. return props.onChange(item.command, item.type);
  2105. }
  2106. }, item.text);
  2107. })));
  2108. });
  2109. // EXTERNAL MODULE: ./components/business/TextColor/style.scss
  2110. var TextColor_style = __webpack_require__(35);
  2111. // EXTERNAL MODULE: ./components/common/ColorPicker/style.scss
  2112. var ColorPicker_style = __webpack_require__(34);
  2113. // CONCATENATED MODULE: ./components/common/ColorPicker/index.jsx
  2114. /* harmony default export */ var ColorPicker = (function (props) {
  2115. var current = props.current,
  2116. colors = props.colors;
  2117. return external_react_default.a.createElement("div", {
  2118. className: "bf-colors-wrap"
  2119. }, external_react_default.a.createElement("ul", {
  2120. className: "bf-colors"
  2121. }, colors.map(function (item, index) {
  2122. var className = item === current ? 'color-item active' : 'color-item';
  2123. return external_react_default.a.createElement("li", {
  2124. key: index,
  2125. title: item,
  2126. className: className,
  2127. style: {
  2128. color: item
  2129. },
  2130. "data-color": item.replace('#', ''),
  2131. onClick: function onClick(e) {
  2132. return props.onChange(e.currentTarget.dataset.color);
  2133. }
  2134. });
  2135. })));
  2136. });
  2137. // CONCATENATED MODULE: ./components/business/TextColor/index.jsx
  2138. var TextColor_TextColor =
  2139. /*#__PURE__*/
  2140. function (_React$Component) {
  2141. inherits_default()(TextColor, _React$Component);
  2142. function TextColor() {
  2143. var _getPrototypeOf2;
  2144. var _this;
  2145. classCallCheck_default()(this, TextColor);
  2146. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2147. args[_key] = arguments[_key];
  2148. }
  2149. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(TextColor)).call.apply(_getPrototypeOf2, [this].concat(args)));
  2150. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  2151. colorType: 'color'
  2152. });
  2153. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownComponentId", 'BRAFT-DROPDOWN-' + external_braft_utils_["BaseUtils"].UniqueIndex());
  2154. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "switchColorType", function (_ref) {
  2155. var currentTarget = _ref.currentTarget;
  2156. _this.setState({
  2157. colorType: currentTarget.dataset.type
  2158. });
  2159. });
  2160. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleColor", function (color) {
  2161. var hookReturns = _this.props.hooks("toggle-text-".concat(_this.state.colorType), color)(color);
  2162. if (hookReturns === false) {
  2163. return false;
  2164. }
  2165. if (typeof hookReturns === 'string') {
  2166. color = hookReturns;
  2167. }
  2168. if (_this.state.colorType === 'color') {
  2169. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionColor(_this.props.editorState, color, _this.props.colors));
  2170. } else {
  2171. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBackgroundColor(_this.props.editorState, color, _this.props.colors));
  2172. }
  2173. _this.dropDownComponent.hide();
  2174. _this.props.editor.requestFocus();
  2175. });
  2176. return _this;
  2177. }
  2178. createClass_default()(TextColor, [{
  2179. key: "render",
  2180. value: function render() {
  2181. var _this2 = this;
  2182. var captionStyle = {};
  2183. var currentColor = null;
  2184. var colorType = this.state.colorType;
  2185. this.props.colors.forEach(function (color) {
  2186. var color_id = color.replace('#', '');
  2187. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(_this2.props.editorState, 'COLOR-' + color_id)) {
  2188. captionStyle.color = color;
  2189. colorType === 'color' && (currentColor = color);
  2190. }
  2191. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(_this2.props.editorState, 'BGCOLOR-' + color_id)) {
  2192. captionStyle.backgroundColor = color;
  2193. colorType === 'background-color' && (currentColor = color);
  2194. }
  2195. });
  2196. var caption = external_react_default.a.createElement("i", {
  2197. style: captionStyle,
  2198. className: "bfi-text-color"
  2199. }, external_react_default.a.createElement("span", {
  2200. className: "path1"
  2201. }), external_react_default.a.createElement("span", {
  2202. className: "path2"
  2203. }));
  2204. return external_react_default.a.createElement(DropDown_DropDown, {
  2205. caption: caption,
  2206. title: this.props.language.controls.color,
  2207. showArrow: false,
  2208. containerNode: this.props.containerNode,
  2209. componentId: this.dropDownComponentId,
  2210. ref: function ref(instance) {
  2211. return _this2.dropDownComponent = instance;
  2212. },
  2213. className: 'control-item dropdown text-color-dropdown'
  2214. }, external_react_default.a.createElement("div", {
  2215. className: "bf-text-color-picker-wrap"
  2216. }, external_react_default.a.createElement("div", {
  2217. className: "bf-color-switch-buttons",
  2218. style: this.props.enableBackgroundColor ? {} : {
  2219. display: 'none'
  2220. }
  2221. }, external_react_default.a.createElement("button", {
  2222. type: "button",
  2223. "data-type": "color",
  2224. "data-keep-active": true,
  2225. "data-braft-component-id": this.dropDownComponentId,
  2226. className: colorType === 'color' ? 'active' : '',
  2227. onClick: this.switchColorType
  2228. }, this.props.language.controls.textColor), external_react_default.a.createElement("button", {
  2229. type: "button",
  2230. "data-type": "background-color",
  2231. "data-keep-active": true,
  2232. "data-braft-component-id": this.dropDownComponentId,
  2233. className: colorType === 'background-color' ? 'active' : '',
  2234. onClick: this.switchColorType
  2235. }, this.props.language.controls.backgroundColor)), external_react_default.a.createElement(ColorPicker, {
  2236. width: 200,
  2237. language: this.props.language,
  2238. current: currentColor,
  2239. disableAlpha: true,
  2240. colors: this.props.colors,
  2241. onChange: this.toggleColor
  2242. })));
  2243. }
  2244. }]);
  2245. return TextColor;
  2246. }(external_react_default.a.Component);
  2247. // EXTERNAL MODULE: ./components/business/FontSize/style.scss
  2248. var FontSize_style = __webpack_require__(33);
  2249. // CONCATENATED MODULE: ./components/business/FontSize/index.jsx
  2250. var FontSize_toggleFontSize = function toggleFontSize(event, props) {
  2251. var fontSize = event.currentTarget.dataset.size;
  2252. var hookReturns = props.hooks('toggle-font-size', fontSize)(fontSize);
  2253. if (hookReturns === false) {
  2254. return false;
  2255. }
  2256. if (!isNaN(fontSize)) {
  2257. fontSize = hookReturns;
  2258. }
  2259. props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionFontSize(props.editorState, fontSize, props.fontSizes));
  2260. props.editor.requestFocus();
  2261. };
  2262. /* harmony default export */ var FontSize = (function (props) {
  2263. var caption = null;
  2264. var currentFontSize = null;
  2265. props.fontSizes.find(function (item) {
  2266. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'FONTSIZE-' + item)) {
  2267. caption = item + 'px';
  2268. currentFontSize = item;
  2269. return true;
  2270. }
  2271. return false;
  2272. });
  2273. return external_react_default.a.createElement(DropDown_DropDown, {
  2274. caption: caption || props.defaultCaption,
  2275. containerNode: props.containerNode,
  2276. title: props.language.controls.fontSize,
  2277. className: 'control-item dropdown bf-font-size-dropdown'
  2278. }, external_react_default.a.createElement("ul", {
  2279. className: "bf-font-sizes"
  2280. }, props.fontSizes.map(function (item, index) {
  2281. return external_react_default.a.createElement("li", {
  2282. key: index,
  2283. className: item === currentFontSize ? 'active' : null,
  2284. "data-size": item,
  2285. onClick: function onClick(event) {
  2286. return FontSize_toggleFontSize(event, props);
  2287. }
  2288. }, item + 'px');
  2289. })));
  2290. });
  2291. // EXTERNAL MODULE: ./components/business/LineHeight/style.scss
  2292. var LineHeight_style = __webpack_require__(32);
  2293. // CONCATENATED MODULE: ./components/business/LineHeight/index.jsx
  2294. var LineHeight_toggleLineHeight = function toggleLineHeight(event, props) {
  2295. var lineHeight = event.currentTarget.dataset.size;
  2296. var hookReturns = props.hooks('toggle-line-height', lineHeight)(lineHeight);
  2297. if (hookReturns === false) {
  2298. return false;
  2299. }
  2300. if (!isNaN(hookReturns)) {
  2301. lineHeight = hookReturns;
  2302. }
  2303. props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLineHeight(props.editorState, lineHeight, props.lineHeights));
  2304. props.editor.requestFocus();
  2305. };
  2306. /* harmony default export */ var LineHeight = (function (props) {
  2307. var caption = null;
  2308. var currentLineHeight = null;
  2309. props.lineHeights.find(function (item) {
  2310. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'LINEHEIGHT-' + item)) {
  2311. caption = item;
  2312. currentLineHeight = item;
  2313. return true;
  2314. }
  2315. return false;
  2316. });
  2317. return external_react_default.a.createElement(DropDown_DropDown, {
  2318. caption: caption || props.defaultCaption,
  2319. containerNode: props.containerNode,
  2320. title: props.language.controls.lineHeight,
  2321. className: 'control-item dropdown bf-line-height-dropdown'
  2322. }, external_react_default.a.createElement("ul", {
  2323. className: "bf-line-heights"
  2324. }, props.lineHeights.map(function (item, index) {
  2325. return external_react_default.a.createElement("li", {
  2326. key: index,
  2327. className: item === currentLineHeight ? 'active' : null,
  2328. "data-size": item,
  2329. onClick: function onClick(event) {
  2330. return LineHeight_toggleLineHeight(event, props);
  2331. }
  2332. }, item);
  2333. })));
  2334. });
  2335. // EXTERNAL MODULE: ./components/business/FontFamily/style.scss
  2336. var FontFamily_style = __webpack_require__(31);
  2337. // CONCATENATED MODULE: ./components/business/FontFamily/index.jsx
  2338. var FontFamily_toggleFontFamily = function toggleFontFamily(event, props) {
  2339. var fontFamilyName = event.currentTarget.dataset.name;
  2340. var hookReturns = props.hooks('toggle-font-family', fontFamilyName)(fontFamilyName, props.fontFamilies);
  2341. if (hookReturns === false) {
  2342. return false;
  2343. }
  2344. if (typeof hookReturns === 'string') {
  2345. fontFamilyName = hookReturns;
  2346. }
  2347. props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionFontFamily(props.editorState, fontFamilyName, props.fontFamilies));
  2348. props.editor.requestFocus();
  2349. };
  2350. /* harmony default export */ var FontFamily = (function (props) {
  2351. var caption = null;
  2352. var currentIndex = null;
  2353. props.fontFamilies.find(function (item, index) {
  2354. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'FONTFAMILY-' + item.name)) {
  2355. caption = item.name;
  2356. currentIndex = index;
  2357. return true;
  2358. }
  2359. return false;
  2360. });
  2361. return external_react_default.a.createElement(DropDown_DropDown, {
  2362. caption: caption || props.defaultCaption,
  2363. containerNode: props.containerNode,
  2364. title: props.language.controls.fontFamily,
  2365. arrowActive: currentIndex === 0,
  2366. className: 'control-item dropdown font-family-dropdown'
  2367. }, external_react_default.a.createElement("ul", {
  2368. className: "menu"
  2369. }, props.fontFamilies.map(function (item, index) {
  2370. return external_react_default.a.createElement("li", {
  2371. key: index,
  2372. className: 'menu-item ' + (index === currentIndex ? 'active' : ''),
  2373. "data-name": item.name,
  2374. onClick: function onClick(event) {
  2375. return FontFamily_toggleFontFamily(event, props);
  2376. }
  2377. }, external_react_default.a.createElement("span", {
  2378. style: {
  2379. fontFamily: item.family
  2380. }
  2381. }, item.name));
  2382. })));
  2383. });
  2384. // CONCATENATED MODULE: ./components/business/TextAlign/index.jsx
  2385. var TextAlign_TextAlign =
  2386. /*#__PURE__*/
  2387. function (_React$Component) {
  2388. inherits_default()(TextAlign, _React$Component);
  2389. function TextAlign() {
  2390. var _getPrototypeOf2;
  2391. var _this;
  2392. classCallCheck_default()(this, TextAlign);
  2393. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2394. args[_key] = arguments[_key];
  2395. }
  2396. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(TextAlign)).call.apply(_getPrototypeOf2, [this].concat(args)));
  2397. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
  2398. currentAlignment: undefined
  2399. });
  2400. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setAlignment", function (event) {
  2401. var alignment = event.currentTarget.dataset.alignment;
  2402. var hookReturns = _this.props.hooks('toggle-text-alignment', alignment)(alignment);
  2403. if (_this.props.textAligns.indexOf(hookReturns) > -1) {
  2404. alignment = hookReturns;
  2405. }
  2406. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionAlignment(_this.props.editorState, alignment));
  2407. _this.props.editor.requestFocus();
  2408. });
  2409. return _this;
  2410. }
  2411. createClass_default()(TextAlign, [{
  2412. key: "componentWillReceiveProps",
  2413. value: function componentWillReceiveProps(next) {
  2414. this.setState({
  2415. currentAlignment: external_braft_utils_["ContentUtils"].getSelectionBlockData(next.editorState, 'textAlign')
  2416. });
  2417. }
  2418. }, {
  2419. key: "render",
  2420. value: function render() {
  2421. var _this2 = this;
  2422. var textAlignmentTitles = [this.props.language.controls.alignLeft, this.props.language.controls.alignCenter, this.props.language.controls.alignRight, this.props.language.controls.alignJustify];
  2423. return external_react_default.a.createElement("div", {
  2424. className: "control-item-group"
  2425. }, this.props.textAligns.map(function (item, index) {
  2426. return external_react_default.a.createElement("button", {
  2427. type: "button",
  2428. key: index,
  2429. "data-title": textAlignmentTitles[index],
  2430. "data-alignment": item,
  2431. className: 'control-item button ' + (item === _this2.state.currentAlignment ? 'active' : null),
  2432. onClick: _this2.setAlignment
  2433. }, external_react_default.a.createElement("i", {
  2434. className: 'bfi-align-' + item
  2435. }));
  2436. }));
  2437. }
  2438. }]);
  2439. return TextAlign;
  2440. }(external_react_default.a.Component);
  2441. // EXTERNAL MODULE: ./components/business/EmojiPicker/style.scss
  2442. var EmojiPicker_style = __webpack_require__(30);
  2443. // CONCATENATED MODULE: ./components/business/EmojiPicker/index.jsx
  2444. var EmojiPicker_insertEmoji = function insertEmoji(event, props) {
  2445. var emoji = event.currentTarget.dataset.emoji;
  2446. var hookReturns = props.hooks('insert-emoji', emoji)(emoji);
  2447. if (hookReturns === false) {
  2448. return false;
  2449. }
  2450. if (typeof hookReturns === 'string') {
  2451. emoji = hookReturns;
  2452. }
  2453. props.editor.setValue(external_braft_utils_["ContentUtils"].insertText(props.editorState, emoji));
  2454. props.editor.requestFocus();
  2455. };
  2456. /* harmony default export */ var EmojiPicker = (function (props) {
  2457. return external_react_default.a.createElement(DropDown_DropDown, {
  2458. caption: props.defaultCaption,
  2459. showArrow: false,
  2460. containerNode: props.containerNode,
  2461. title: props.language.controls.emoji,
  2462. className: 'control-item dropdown bf-emoji-dropdown'
  2463. }, external_react_default.a.createElement("div", {
  2464. className: "bf-emojis-wrap"
  2465. }, external_react_default.a.createElement("ul", {
  2466. className: "bf-emojis"
  2467. }, props.emojis.map(function (item, index) {
  2468. return external_react_default.a.createElement("li", {
  2469. key: index,
  2470. "data-emoji": item,
  2471. onClick: function onClick(event) {
  2472. return EmojiPicker_insertEmoji(event, props);
  2473. }
  2474. }, item);
  2475. }))));
  2476. });
  2477. // EXTERNAL MODULE: ./components/business/LetterSpacing/style.scss
  2478. var LetterSpacing_style = __webpack_require__(29);
  2479. // CONCATENATED MODULE: ./components/business/LetterSpacing/index.jsx
  2480. var LetterSpacing_toggleLetterSpacing = function toggleLetterSpacing(event, props) {
  2481. var letterSpacing = event.currentTarget.dataset.size;
  2482. var hookReturns = props.hooks('toggle-letter-spacing', letterSpacing)(letterSpacing);
  2483. if (hookReturns === false) {
  2484. return false;
  2485. }
  2486. if (!isNaN(hookReturns)) {
  2487. letterSpacing = hookReturns;
  2488. }
  2489. props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLetterSpacing(props.editorState, letterSpacing, props.letterSpacings));
  2490. props.editor.requestFocus();
  2491. };
  2492. /* harmony default export */ var LetterSpacing = (function (props) {
  2493. var caption = null;
  2494. var currentLetterSpacing = null;
  2495. props.letterSpacings.find(function (item) {
  2496. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'LETTERSPACING-' + item)) {
  2497. caption = item;
  2498. currentLetterSpacing = item;
  2499. return true;
  2500. }
  2501. return false;
  2502. });
  2503. return external_react_default.a.createElement(DropDown_DropDown, {
  2504. caption: caption || props.defaultCaption,
  2505. containerNode: props.containerNode,
  2506. title: props.language.controls.letterSpacing,
  2507. className: 'control-item dropdown bf-letter-spacing-dropdown'
  2508. }, external_react_default.a.createElement("ul", {
  2509. className: "bf-letter-spacings"
  2510. }, props.letterSpacings.map(function (item, index) {
  2511. return external_react_default.a.createElement("li", {
  2512. key: index,
  2513. className: item === currentLetterSpacing ? 'active' : null,
  2514. "data-size": item,
  2515. onClick: function onClick(event) {
  2516. return LetterSpacing_toggleLetterSpacing(event, props);
  2517. }
  2518. }, item);
  2519. })));
  2520. });
  2521. // EXTERNAL MODULE: ./components/business/TextIndent/style.scss
  2522. var TextIndent_style = __webpack_require__(28);
  2523. // CONCATENATED MODULE: ./components/business/TextIndent/index.jsx
  2524. var TextIndent_toggleTextIndent = function toggleTextIndent(event, props) {
  2525. var textIndent = event.currentTarget.dataset.size;
  2526. var hookReturns = props.hooks('toggle-text-indent', textIndent)(textIndent);
  2527. if (hookReturns === false) {
  2528. return false;
  2529. }
  2530. if (!isNaN(hookReturns)) {
  2531. textIndent = hookReturns;
  2532. }
  2533. props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionIndent(props.editorState, textIndent, props.textIndents));
  2534. props.editor.requestFocus();
  2535. };
  2536. /* harmony default export */ var TextIndent = (function (props) {
  2537. var caption = null;
  2538. var currentIndent = null;
  2539. props.textIndents.find(function (item) {
  2540. if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'INDENT-' + item)) {
  2541. caption = item;
  2542. currentIndent = item;
  2543. return true;
  2544. }
  2545. return false;
  2546. });
  2547. return external_react_default.a.createElement(DropDown_DropDown, {
  2548. caption: caption || props.defaultCaption,
  2549. containerNode: props.containerNode,
  2550. title: props.language.controls.textIndent,
  2551. className: 'control-item dropdown bf-indent-dropdown'
  2552. }, external_react_default.a.createElement("ul", {
  2553. className: "bf-text-indents"
  2554. }, props.textIndents.map(function (item, index) {
  2555. return external_react_default.a.createElement("li", {
  2556. key: index,
  2557. className: item === currentIndent ? 'active' : null,
  2558. "data-size": item,
  2559. onClick: function onClick(event) {
  2560. return TextIndent_toggleTextIndent(event, props);
  2561. }
  2562. }, item);
  2563. })));
  2564. });
  2565. // EXTERNAL MODULE: ./components/common/Modal/style.scss
  2566. var Modal_style = __webpack_require__(27);
  2567. // EXTERNAL MODULE: external "react-dom"
  2568. var external_react_dom_ = __webpack_require__(14);
  2569. var external_react_dom_default = /*#__PURE__*/__webpack_require__.n(external_react_dom_);
  2570. // CONCATENATED MODULE: ./components/common/Modal/index.jsx
  2571. var Modal_Modal =
  2572. /*#__PURE__*/
  2573. function (_React$Component) {
  2574. inherits_default()(Modal, _React$Component);
  2575. function Modal(props) {
  2576. var _this;
  2577. classCallCheck_default()(this, Modal);
  2578. _this = possibleConstructorReturn_default()(this, getPrototypeOf_default()(Modal).call(this, props));
  2579. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleTransitionEnd", function () {
  2580. if (!_this.rootElement || !_this.rootElement.classList) {
  2581. return false;
  2582. }
  2583. if (!_this.rootElement.classList.contains('active')) {
  2584. external_react_dom_default.a.unmountComponentAtNode(_this.rootElement) && _this.rootElement.parentNode.removeChild(_this.rootElement);
  2585. }
  2586. });
  2587. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleCancel", function () {
  2588. _this.props.closeOnCancel && _this.close();
  2589. _this.props.onCancel && _this.props.onCancel();
  2590. });
  2591. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleConfirm", function () {
  2592. _this.props.closeOnConfirm && _this.close();
  2593. _this.props.onConfirm && _this.props.onConfirm();
  2594. });
  2595. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "close", function () {
  2596. _this.unrenderComponent();
  2597. _this.props.onClose && _this.props.onClose();
  2598. });
  2599. _this.active = false;
  2600. _this.componentId = 'BRAFT-MODAL-' + external_braft_utils_["BaseUtils"].UniqueIndex();
  2601. return _this;
  2602. }
  2603. createClass_default()(Modal, [{
  2604. key: "componentDidMount",
  2605. value: function componentDidMount() {
  2606. if (this.props.visible) {
  2607. this.active = true;
  2608. this.renderComponent(this.props);
  2609. }
  2610. }
  2611. }, {
  2612. key: "componentWillReceiveProps",
  2613. value: function componentWillReceiveProps(next) {
  2614. if (this.props.visible && !next.visible) {
  2615. this.unrenderComponent();
  2616. } else if (this.props.visible || next.visible) {
  2617. this.active = true;
  2618. this.renderComponent(next);
  2619. }
  2620. }
  2621. }, {
  2622. key: "render",
  2623. value: function render() {
  2624. return null;
  2625. }
  2626. }, {
  2627. key: "unrenderComponent",
  2628. value: function unrenderComponent() {
  2629. this.active = false;
  2630. this.activeId && window.clearImmediate(this.activeId);
  2631. if (this.rootElement && this.rootElement.classList) {
  2632. this.rootElement.classList.remove('active');
  2633. }
  2634. }
  2635. }, {
  2636. key: "renderComponent",
  2637. value: function renderComponent(props) {
  2638. var _this2 = this;
  2639. if (!this.active) {
  2640. return false;
  2641. }
  2642. var title = props.title,
  2643. className = props.className,
  2644. width = props.width,
  2645. height = props.height,
  2646. children = props.children,
  2647. confirmable = props.confirmable,
  2648. showFooter = props.showFooter,
  2649. showCancel = props.showCancel,
  2650. showConfirm = props.showConfirm,
  2651. showClose = props.showClose,
  2652. cancelText = props.cancelText,
  2653. confirmText = props.confirmText,
  2654. bottomText = props.bottomText,
  2655. language = props.language;
  2656. typeof showCancel === 'undefined' && (showCancel = true);
  2657. typeof showClose === 'undefined' && (showClose = true);
  2658. typeof showConfirm === 'undefined' && (showConfirm = true);
  2659. var childComponent = external_react_default.a.createElement("div", {
  2660. className: 'bf-modal ' + (className || '')
  2661. }, external_react_default.a.createElement("div", {
  2662. className: "bf-modal-mask"
  2663. }), external_react_default.a.createElement("div", {
  2664. onTransitionEnd: this.handleTransitionEnd,
  2665. style: {
  2666. width: width,
  2667. height: height
  2668. },
  2669. className: "bf-modal-content"
  2670. }, external_react_default.a.createElement("div", {
  2671. className: "bf-modal-header"
  2672. }, external_react_default.a.createElement("h3", {
  2673. className: "bf-modal-caption"
  2674. }, title), showClose && external_react_default.a.createElement("button", {
  2675. type: "button",
  2676. onClick: this.close,
  2677. className: "bf-modal-close-button"
  2678. }, external_react_default.a.createElement("i", {
  2679. className: "bf-icon-close"
  2680. }))), external_react_default.a.createElement("div", {
  2681. className: "bf-modal-body"
  2682. }, children), showFooter ? external_react_default.a.createElement("div", {
  2683. className: "bf-modal-footer"
  2684. }, external_react_default.a.createElement("div", {
  2685. className: "bf-modal-addon-text"
  2686. }, bottomText), external_react_default.a.createElement("div", {
  2687. className: "bf-modal-buttons"
  2688. }, showCancel && external_react_default.a.createElement("button", {
  2689. type: "button",
  2690. onClick: this.handleCancel,
  2691. className: "bf-modal-cancel"
  2692. }, cancelText || language.base.cancel), showConfirm && external_react_default.a.createElement("button", {
  2693. type: "button",
  2694. onClick: this.handleConfirm,
  2695. className: 'bf-modal-confirm ' + (!confirmable ? 'disabled' : '')
  2696. }, confirmText || language.base.confirm))) : null));
  2697. this.rootElement = document.querySelector('#' + this.componentId);
  2698. if (!this.rootElement) {
  2699. this.rootElement = document.createElement('div');
  2700. this.rootElement.id = this.componentId;
  2701. this.rootElement.className = 'bf-modal-root';
  2702. document.body.appendChild(this.rootElement);
  2703. }
  2704. external_react_dom_default.a.render(childComponent, this.rootElement);
  2705. this.activeId = window.setImmediate(function () {
  2706. _this2.rootElement.classList.add('active');
  2707. });
  2708. }
  2709. }]);
  2710. return Modal;
  2711. }(external_react_default.a.Component);
  2712. defineProperty_default()(Modal_Modal, "defaultProps", {
  2713. showFooter: true
  2714. });
  2715. var Modal_showModal = function showModal(props) {
  2716. var hostNode = document.createElement('div');
  2717. hostNode.style.display = 'none';
  2718. document.body.appendChild(hostNode);
  2719. var close = function close() {
  2720. external_react_dom_default.a.unmountComponentAtNode(hostNode) && hostNode.parentNode.removeChild(hostNode);
  2721. };
  2722. var onConfirm = function onConfirm() {
  2723. close();
  2724. props.onConfirm && props.onConfirm();
  2725. };
  2726. var onCancel = function onCancel() {
  2727. close();
  2728. props.onCancel && props.onCancel();
  2729. };
  2730. var onClose = function onClose() {
  2731. close();
  2732. props.onClose && props.onClose();
  2733. };
  2734. var extProps = {
  2735. onConfirm: onConfirm,
  2736. onCancel: onCancel,
  2737. onClose: onClose,
  2738. visible: true,
  2739. closeOnConfirm: true,
  2740. closeOnCancel: true
  2741. };
  2742. var modalInstance = external_react_dom_default.a.render(external_react_default.a.createElement(Modal_Modal, extends_default()({}, props, extProps)), hostNode);
  2743. modalInstance.destroy = close;
  2744. modalInstance.update = modalInstance.renderComponent;
  2745. return modalInstance;
  2746. };
  2747. // CONCATENATED MODULE: ./components/business/ControlBar/index.jsx
  2748. var commandHookMap = {
  2749. 'inline-style': 'toggle-inline-style',
  2750. 'block-type': 'change-block-type',
  2751. 'editor-method': 'exec-editor-command'
  2752. };
  2753. var ControlBar_ControlBar =
  2754. /*#__PURE__*/
  2755. function (_React$Component) {
  2756. inherits_default()(ControlBar, _React$Component);
  2757. function ControlBar() {
  2758. var _getPrototypeOf2;
  2759. var _this;
  2760. classCallCheck_default()(this, ControlBar);
  2761. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2762. args[_key] = arguments[_key];
  2763. }
  2764. _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(ControlBar)).call.apply(_getPrototypeOf2, [this].concat(args)));
  2765. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "mediaLibiraryModal", null);
  2766. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "extendedModals", {});
  2767. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "openBraftFinder", function () {
  2768. if (!_this.props.braftFinder || !_this.props.braftFinder.ReactComponent) {
  2769. return false;
  2770. }
  2771. if (_this.props.hooks('open-braft-finder')() === false) {
  2772. return false;
  2773. }
  2774. var mediaProps = _this.props.media;
  2775. var MediaLibrary = _this.props.braftFinder.ReactComponent;
  2776. _this.mediaLibiraryModal = Modal_showModal({
  2777. title: _this.props.language.controls.mediaLibirary,
  2778. language: _this.props.language,
  2779. width: 640,
  2780. showFooter: false,
  2781. children: external_react_default.a.createElement(MediaLibrary, {
  2782. onCancel: _this.closeBraftFinder,
  2783. onInsert: _this.insertMedias,
  2784. onChange: mediaProps.onChange,
  2785. externals: mediaProps.externals,
  2786. onBeforeSelect: _this.bindBraftFinderHook('select-medias'),
  2787. onBeforeDeselect: _this.bindBraftFinderHook('deselect-medias'),
  2788. onBeforeRemove: _this.bindBraftFinderHook('remove-medias'),
  2789. onBeforeInsert: _this.bindBraftFinderHook('insert-medias'),
  2790. onFileSelect: _this.bindBraftFinderHook('select-files')
  2791. })
  2792. });
  2793. });
  2794. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "bindBraftFinderHook", function (hookName) {
  2795. return function () {
  2796. return _this.props.hooks(hookName, arguments.length <= 0 ? undefined : arguments[0]).apply(void 0, arguments);
  2797. };
  2798. });
  2799. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "insertMedias", function (medias) {
  2800. _this.props.editor.setValue(external_braft_utils_["ContentUtils"].insertMedias(_this.props.editorState, medias));
  2801. _this.props.editor.requestFocus();
  2802. _this.props.media.onInsert && _this.props.media.onInsert(medias);
  2803. _this.closeBraftFinder();
  2804. });
  2805. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "closeBraftFinder", function () {
  2806. _this.props.media.onCancel && _this.props.media.onCancel();
  2807. _this.mediaLibiraryModal && _this.mediaLibiraryModal.close();
  2808. });
  2809. return _this;
  2810. }
  2811. createClass_default()(ControlBar, [{
  2812. key: "componentDidUpdate",
  2813. value: function componentDidUpdate() {
  2814. var _this2 = this;
  2815. var _this$props = this.props,
  2816. controls = _this$props.controls,
  2817. language = _this$props.language;
  2818. controls.forEach(function (item) {
  2819. if (item.type === 'modal') {
  2820. if (item.modal && item.modal.id && _this2.extendedModals[item.modal.id]) {
  2821. _this2.extendedModals[item.modal.id].update(objectSpread_default()({}, item.modal, {
  2822. language: language
  2823. }));
  2824. }
  2825. }
  2826. });
  2827. }
  2828. }, {
  2829. key: "getControlItemClassName",
  2830. value: function getControlItemClassName(data) {
  2831. var className = 'control-item button';
  2832. var type = data.type,
  2833. command = data.command;
  2834. if (type === 'inline-style' && external_braft_utils_["ContentUtils"].selectionHasInlineStyle(this.props.editorState, command)) {
  2835. className += ' active';
  2836. } else if (type === 'block-type' && external_braft_utils_["ContentUtils"].getSelectionBlockType(this.props.editorState) === command) {
  2837. className += ' active';
  2838. }
  2839. return className;
  2840. }
  2841. }, {
  2842. key: "applyControl",
  2843. value: function applyControl(command, type) {
  2844. var hookReturns = this.props.hooks(commandHookMap[type] || type, command)(command);
  2845. if (hookReturns === false) {
  2846. return false;
  2847. }
  2848. if (typeof hookReturns === 'string') {
  2849. command = hookReturns;
  2850. }
  2851. if (type === 'inline-style') {
  2852. this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionInlineStyle(this.props.editorState, command));
  2853. } else if (type === 'block-type') {
  2854. this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(this.props.editorState, command));
  2855. } else if (type === 'editor-method') {
  2856. this.props.editor[command] && this.props.editor[command]();
  2857. }
  2858. this.props.editor.requestFocus();
  2859. }
  2860. }, {
  2861. key: "render",
  2862. value: function render() {
  2863. var _this3 = this;
  2864. var _this$props2 = this.props,
  2865. editor = _this$props2.editor,
  2866. editorState = _this$props2.editorState,
  2867. controls = _this$props2.controls,
  2868. media = _this$props2.media,
  2869. extendControls = _this$props2.extendControls,
  2870. language = _this$props2.language,
  2871. hooks = _this$props2.hooks,
  2872. colors = _this$props2.colors,
  2873. fontSizes = _this$props2.fontSizes,
  2874. fontFamilies = _this$props2.fontFamilies,
  2875. emojis = _this$props2.emojis,
  2876. containerNode = _this$props2.containerNode,
  2877. lineHeights = _this$props2.lineHeights,
  2878. letterSpacings = _this$props2.letterSpacings,
  2879. textAligns = _this$props2.textAligns,
  2880. textBackgroundColor = _this$props2.textBackgroundColor,
  2881. textIndents = _this$props2.textIndents;
  2882. var currentBlockType = external_braft_utils_["ContentUtils"].getSelectionBlockType(editorState);
  2883. var editorControls = configs_controls(language);
  2884. var commonProps = {
  2885. editor: editor,
  2886. editorState: editorState,
  2887. language: language,
  2888. containerNode: containerNode,
  2889. hooks: hooks
  2890. };
  2891. var renderedControls = [];
  2892. return external_react_default.a.createElement("div", {
  2893. className: "bf-controlbar"
  2894. }, toConsumableArray_default()(controls).concat(toConsumableArray_default()(extendControls)).map(function (item, index) {
  2895. var itemKey = typeof item === 'string' ? item : item.key;
  2896. if (typeof itemKey !== 'string') {
  2897. return null;
  2898. }
  2899. if (renderedControls.indexOf(itemKey) > -1) {
  2900. return null;
  2901. }
  2902. if (itemKey.toLowerCase() === 'separator') {
  2903. return external_react_default.a.createElement("span", {
  2904. key: index,
  2905. className: "separator-line"
  2906. });
  2907. }
  2908. var controlItem = editorControls.find(function (subItem) {
  2909. return subItem.key.toLowerCase() === itemKey.toLowerCase();
  2910. });
  2911. if (typeof item !== 'string') {
  2912. controlItem = objectSpread_default()({}, controlItem, item);
  2913. }
  2914. if (!controlItem) {
  2915. return null;
  2916. }
  2917. renderedControls.push(itemKey);
  2918. if (controlItem.type === 'headings') {
  2919. return external_react_default.a.createElement(Headings, extends_default()({
  2920. key: index,
  2921. current: currentBlockType,
  2922. onChange: function onChange(command) {
  2923. return _this3.applyControl(command, 'block-type');
  2924. }
  2925. }, commonProps));
  2926. } else if (controlItem.type === 'text-color') {
  2927. return external_react_default.a.createElement(TextColor_TextColor, extends_default()({
  2928. key: index,
  2929. colors: colors,
  2930. enableBackgroundColor: textBackgroundColor
  2931. }, commonProps));
  2932. } else if (controlItem.type === 'font-size') {
  2933. return external_react_default.a.createElement(FontSize, extends_default()({
  2934. key: index,
  2935. fontSizes: fontSizes,
  2936. defaultCaption: controlItem.title
  2937. }, commonProps));
  2938. } else if (controlItem.type === 'line-height') {
  2939. return external_react_default.a.createElement(LineHeight, extends_default()({
  2940. key: index,
  2941. lineHeights: lineHeights,
  2942. defaultCaption: controlItem.title
  2943. }, commonProps));
  2944. } else if (controlItem.type === 'letter-spacing') {
  2945. return external_react_default.a.createElement(LetterSpacing, extends_default()({
  2946. key: index,
  2947. letterSpacings: letterSpacings,
  2948. defaultCaption: controlItem.title
  2949. }, commonProps));
  2950. } else if (controlItem.type === 'text-indent') {
  2951. return external_react_default.a.createElement(TextIndent, extends_default()({
  2952. key: index,
  2953. textIndents: textIndents,
  2954. defaultCaption: controlItem.title
  2955. }, commonProps));
  2956. } else if (controlItem.type === 'font-family') {
  2957. return external_react_default.a.createElement(FontFamily, extends_default()({
  2958. key: index,
  2959. fontFamilies: fontFamilies,
  2960. defaultCaption: controlItem.title
  2961. }, commonProps));
  2962. } else if (controlItem.type === 'emoji') {
  2963. return external_react_default.a.createElement(EmojiPicker, extends_default()({
  2964. key: index,
  2965. emojis: emojis,
  2966. defaultCaption: controlItem.text
  2967. }, commonProps));
  2968. } else if (controlItem.type === 'link') {
  2969. return external_react_default.a.createElement(LinkEditor_LinkEditor, extends_default()({
  2970. key: index
  2971. }, commonProps));
  2972. } else if (controlItem.type === 'text-align') {
  2973. return external_react_default.a.createElement(TextAlign_TextAlign, extends_default()({
  2974. key: index,
  2975. textAligns: textAligns
  2976. }, commonProps));
  2977. } else if (controlItem.type === 'media') {
  2978. if (!media.image && !media.video && !media.audio) {
  2979. return null;
  2980. }
  2981. return external_react_default.a.createElement("button", {
  2982. type: "button",
  2983. key: index,
  2984. "data-title": controlItem.title,
  2985. className: "control-item media button",
  2986. onClick: _this3.openBraftFinder
  2987. }, controlItem.text);
  2988. } else if (controlItem.type === 'dropdown') {
  2989. return external_react_default.a.createElement(DropDown_DropDown, {
  2990. key: index,
  2991. className: 'control-item extend-control-item dropdown ' + controlItem.className,
  2992. caption: controlItem.text,
  2993. htmlCaption: controlItem.html,
  2994. showArrow: controlItem.showArrow,
  2995. containerNode: controlItem.containerNode,
  2996. title: controlItem.title,
  2997. arrowActive: controlItem.arrowActive,
  2998. autoHide: controlItem.autoHide,
  2999. disabled: controlItem.disabled,
  3000. ref: controlItem.ref
  3001. }, controlItem.component);
  3002. } else if (controlItem.type === 'modal') {
  3003. return external_react_default.a.createElement("button", {
  3004. type: "button",
  3005. key: index,
  3006. "data-title": controlItem.title,
  3007. className: 'control-item extend-control-item button ' + controlItem.className,
  3008. dangerouslySetInnerHTML: controlItem.html ? {
  3009. __html: controlItem.html
  3010. } : null,
  3011. onClick: function onClick(event) {
  3012. if (controlItem.modal && controlItem.modal.id) {
  3013. if (_this3.extendedModals[controlItem.modal.id]) {
  3014. _this3.extendedModals[controlItem.modal.id].active = true;
  3015. _this3.extendedModals[controlItem.modal.id].update(objectSpread_default()({}, controlItem.modal, {
  3016. language: language
  3017. }));
  3018. } else {
  3019. _this3.extendedModals[controlItem.modal.id] = Modal_showModal(objectSpread_default()({}, controlItem.modal, {
  3020. language: language
  3021. }));
  3022. controlItem.modal.onCreate && controlItem.modal.onCreate(_this3.extendedModals[controlItem.modal.id]);
  3023. }
  3024. }
  3025. controlItem.onClick && controlItem.onClick(event);
  3026. }
  3027. }, !controlItem.html ? controlItem.text : null);
  3028. } else if (controlItem.type === 'component') {
  3029. return external_react_default.a.createElement("div", {
  3030. key: index,
  3031. className: 'control-item component-wrapper ' + controlItem.className
  3032. }, controlItem.component);
  3033. } else if (controlItem.type === 'button') {
  3034. return external_react_default.a.createElement("button", {
  3035. type: "button",
  3036. key: index,
  3037. "data-title": controlItem.title,
  3038. className: 'control-item button ' + controlItem.className,
  3039. dangerouslySetInnerHTML: controlItem.html ? {
  3040. __html: controlItem.html
  3041. } : null,
  3042. onClick: function onClick(event) {
  3043. return controlItem.onClick && controlItem.onClick(event);
  3044. }
  3045. }, !controlItem.html ? controlItem.text : null);
  3046. } else {
  3047. return external_react_default.a.createElement("button", {
  3048. type: "button",
  3049. key: index,
  3050. "data-title": controlItem.title,
  3051. className: _this3.getControlItemClassName({
  3052. type: controlItem.type,
  3053. command: controlItem.command
  3054. }),
  3055. onClick: function onClick() {
  3056. return _this3.applyControl(controlItem.command, controlItem.type);
  3057. }
  3058. }, controlItem.text);
  3059. }
  3060. }));
  3061. }
  3062. }]);
  3063. return ControlBar;
  3064. }(external_react_default.a.Component);
  3065. // CONCATENATED MODULE: ./editor/index.jsx
  3066. var buildHooks = function buildHooks(hooks) {
  3067. return function (hookName) {
  3068. var defaultReturns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3069. return hooks[hookName] || function () {
  3070. return defaultReturns;
  3071. };
  3072. };
  3073. };
  3074. var editorDecorators = new external_draft_js_["CompositeDecorator"](renderers_decorators);
  3075. var editor_BraftEditor =
  3076. /*#__PURE__*/
  3077. function (_React$Component) {
  3078. inherits_default()(BraftEditor, _React$Component);
  3079. function BraftEditor(props) {
  3080. var _this;
  3081. classCallCheck_default()(this, BraftEditor);
  3082. _this = possibleConstructorReturn_default()(this, getPrototypeOf_default()(BraftEditor).call(this, props));
  3083. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onChange", function (editorState) {
  3084. _this.setState({
  3085. editorState: editorState
  3086. }, function () {
  3087. _this.props.onChange && _this.props.onChange(editorState);
  3088. });
  3089. });
  3090. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getDraftInstance", function () {
  3091. return _this.draftInstance;
  3092. });
  3093. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getFinderInstance", function () {
  3094. return _this.braftFinder;
  3095. });
  3096. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getValue", function () {
  3097. return _this.state.editorState;
  3098. });
  3099. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setValue", function (editorState) {
  3100. return _this.onChange(editorState);
  3101. });
  3102. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "forceRender", function () {
  3103. return _this.setValue(external_braft_utils_["ContentUtils"].createEditorState(_this.state.editorState.getCurrentContent(), editorDecorators));
  3104. });
  3105. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onTab", function (event) {
  3106. if (external_braft_utils_["ContentUtils"].getSelectionBlockType(_this.state.editorState) === 'code-block') {
  3107. _this.setValue(external_braft_utils_["ContentUtils"].insertText(_this.state.editorState, ' '.repeat(_this.props.tabIndents)));
  3108. event.preventDefault();
  3109. return false;
  3110. }
  3111. _this.props.onTab && _this.props.onTab(event);
  3112. });
  3113. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onFocus", function () {
  3114. _this.isFocused = true;
  3115. _this.props.onFocus && _this.props.onFocus();
  3116. });
  3117. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onBlur", function () {
  3118. _this.isFocused = false;
  3119. _this.props.onBlur && _this.props.onBlur();
  3120. });
  3121. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "requestFocus", function () {
  3122. setTimeout(function () {
  3123. return _this.draftInstance.focus();
  3124. }, 0);
  3125. });
  3126. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleKeyCommand", function (command) {
  3127. if (command === 'braft-save') {
  3128. _this.props.onSave && _this.props.onSave();
  3129. return 'handled';
  3130. }
  3131. var nextEditorState = external_braft_utils_["ContentUtils"].handleKeyCommand(_this.state.editorState, command);
  3132. if (nextEditorState) {
  3133. _this.setValue(nextEditorState);
  3134. return 'handled';
  3135. }
  3136. return 'not-handled';
  3137. });
  3138. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleReturn", function (event) {
  3139. var currentBlock = external_braft_utils_["ContentUtils"].getSelectionBlock(_this.state.editorState);
  3140. var currentBlockType = currentBlock.getType();
  3141. if (currentBlockType === 'unordered-list-item' || currentBlockType === 'ordered-list-item') {
  3142. if (currentBlock.getLength() === 0) {
  3143. _this.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(_this.state.editorState, 'unstyled'));
  3144. return 'handled';
  3145. }
  3146. return 'not-handled';
  3147. } else if (currentBlockType === 'code-block') {
  3148. if (event.which === 13 && (event.getModifierState('Shift') || event.getModifierState('Alt') || event.getModifierState('Control'))) {
  3149. _this.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(_this.state.editorState, 'unstyled'));
  3150. return 'handled';
  3151. }
  3152. return 'not-handled';
  3153. } else {
  3154. var nextEditorState = external_braft_utils_["ContentUtils"].handleNewLine(_this.state.editorState, event);
  3155. if (nextEditorState) {
  3156. _this.setValue(nextEditorState);
  3157. return 'handled';
  3158. }
  3159. return 'not-handled';
  3160. }
  3161. });
  3162. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDrop", function (selectionState, dataTransfer) {
  3163. if (window && window.__BRAFT_DRAGING__IMAGE__) {
  3164. var editorState = external_braft_utils_["ContentUtils"].removeBlock(_this.state.editorState, window.__BRAFT_DRAGING__IMAGE__.block, selectionState);
  3165. editorState = external_braft_utils_["ContentUtils"].insertMedias(editorState, [window.__BRAFT_DRAGING__IMAGE__.mediaData]);
  3166. window.__BRAFT_DRAGING__IMAGE__ = null;
  3167. _this.setDraftProps({
  3168. readOnly: false
  3169. });
  3170. _this.setValue(editorState);
  3171. return 'handled';
  3172. } else if (!dataTransfer || !dataTransfer.getText()) {
  3173. return 'handled';
  3174. }
  3175. return 'not-handled';
  3176. });
  3177. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDroppedFiles", function (selectionState, files) {
  3178. return _this.resolveFiles(files);
  3179. });
  3180. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handlePastedFiles", function (files) {
  3181. return _this.resolveFiles(files);
  3182. });
  3183. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handlePastedText", function (text, htmlString) {
  3184. if (!htmlString || _this.props.stripPastedStyles) {
  3185. return false;
  3186. }
  3187. var tempColors = external_braft_utils_["ColorUtils"].detectColorsFromHTMLString(htmlString);
  3188. _this.setState({
  3189. tempColors: toConsumableArray_default()(_this.state.tempColors).concat(toConsumableArray_default()(tempColors)).filter(function (item) {
  3190. return _this.props.colors.indexOf(item) === -1;
  3191. }).filter(function (item, index, array) {
  3192. return array.indexOf(item) === index;
  3193. })
  3194. }, function () {
  3195. _this.setValue(external_braft_utils_["ContentUtils"].insertHTML(_this.state.editorState, htmlString));
  3196. });
  3197. return true;
  3198. });
  3199. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "resolveFiles", function (files) {
  3200. if (files[0] && files[0].type.indexOf('image') > -1 && _this.props.media && _this.props.media.pasteImage) {
  3201. _this.braftFinder.uploadImage(files[0], function (image) {
  3202. _this.setValue(external_braft_utils_["ContentUtils"].insertMedias(_this.state.editorState, [image]));
  3203. });
  3204. return 'handled';
  3205. }
  3206. return 'not-handled';
  3207. });
  3208. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "undo", function () {
  3209. _this.setValue(external_braft_utils_["ContentUtils"].undo(_this.state.editorState));
  3210. });
  3211. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "redo", function () {
  3212. _this.setValue(external_braft_utils_["ContentUtils"].redo(_this.state.editorState));
  3213. });
  3214. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeSelectionInlineStyles", function () {
  3215. _this.setValue(external_braft_utils_["ContentUtils"].removeSelectionInlineStyles(_this.state.editorState));
  3216. });
  3217. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "insertHorizontalLine", function () {
  3218. _this.setValue(external_braft_utils_["ContentUtils"].insertHorizontalLine(_this.state.editorState));
  3219. });
  3220. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "clearEditorContent", function () {
  3221. _this.setValue(external_braft_utils_["ContentUtils"].clear(_this.state.editorState));
  3222. });
  3223. defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setEditorContainerNode", function (containerNode) {
  3224. _this.setState({
  3225. containerNode: containerNode
  3226. }, _this.forceRender);
  3227. });
  3228. _this.isFocused = false;
  3229. _this.keyBindingFn = keybindings(props.customKeyBindingFn);
  3230. _this.blockStyleFn = getBlockStyleFn(props.blockStyleFn);
  3231. _this.blockRenderMap = external_draft_js_["DefaultDraftBlockRenderMap"].merge(customBlockRenderMap);
  3232. if (props.blockRenderMapFn) {
  3233. _this.blockRenderMap = props.blockRenderMapFn(_this.blockRenderMap);
  3234. }
  3235. _this.braftFinder = null;
  3236. var defaultEditorState = external_braft_utils_["ContentUtils"].isEditorState(props.defaultValue) ? props.defaultValue : external_braft_utils_["ContentUtils"].createEmptyEditorState(editorDecorators);
  3237. _this.state = {
  3238. containerNode: null,
  3239. tempColors: [],
  3240. editorState: defaultEditorState,
  3241. draftProps: {}
  3242. };
  3243. return _this;
  3244. }
  3245. createClass_default()(BraftEditor, [{
  3246. key: "componentWillMount",
  3247. value: function componentWillMount() {
  3248. var _this$props = this.props,
  3249. controls = _this$props.controls,
  3250. extendControls = _this$props.extendControls;
  3251. if (toConsumableArray_default()(controls).concat(toConsumableArray_default()(extendControls)).find(function (item) {
  3252. return item === 'media' || item.key === 'media';
  3253. })) {
  3254. this.braftFinder = new external_braft_finder_default.a({
  3255. language: this.props.language,
  3256. uploader: this.props.media.uploadFn,
  3257. validator: this.props.media.validateFn
  3258. });
  3259. this.forceUpdate();
  3260. }
  3261. }
  3262. }, {
  3263. key: "componentDidMount",
  3264. value: function componentDidMount() {
  3265. var editorState = this.props.value;
  3266. if (external_braft_utils_["ContentUtils"].isEditorState(editorState)) {
  3267. this.setState({
  3268. editorState: editorState
  3269. });
  3270. } else if (editorState) {// console.warn('')
  3271. }
  3272. }
  3273. }, {
  3274. key: "componentWillReceiveProps",
  3275. value: function componentWillReceiveProps(nextProps) {
  3276. var editorState = nextProps.value;
  3277. if (external_braft_utils_["ContentUtils"].isEditorState(editorState)) {
  3278. this.setState({
  3279. editorState: editorState
  3280. });
  3281. } else if (editorState) {// console.warn('')
  3282. }
  3283. }
  3284. }, {
  3285. key: "render",
  3286. value: function render() {
  3287. var _this2 = this;
  3288. var _this$props2 = this.props,
  3289. controls = _this$props2.controls,
  3290. excludeControls = _this$props2.excludeControls,
  3291. extendControls = _this$props2.extendControls,
  3292. disabled = _this$props2.disabled,
  3293. media = _this$props2.media,
  3294. language = _this$props2.language,
  3295. colors = _this$props2.colors,
  3296. hooks = _this$props2.hooks,
  3297. fontSizes = _this$props2.fontSizes,
  3298. fontFamilies = _this$props2.fontFamilies,
  3299. emojis = _this$props2.emojis,
  3300. placeholder = _this$props2.placeholder,
  3301. imageControls = _this$props2.imageControls,
  3302. lineHeights = _this$props2.lineHeights,
  3303. letterSpacings = _this$props2.letterSpacings,
  3304. textIndents = _this$props2.textIndents,
  3305. textAligns = _this$props2.textAligns,
  3306. textBackgroundColor = _this$props2.textBackgroundColor,
  3307. extendAtomics = _this$props2.extendAtomics,
  3308. className = _this$props2.className,
  3309. style = _this$props2.style,
  3310. controlBarClassName = _this$props2.controlBarClassName,
  3311. controlBarStyle = _this$props2.controlBarStyle,
  3312. contentClassName = _this$props2.contentClassName,
  3313. contentStyle = _this$props2.contentStyle,
  3314. stripPastedStyles = _this$props2.stripPastedStyles,
  3315. componentBelowControlBar = _this$props2.componentBelowControlBar;
  3316. hooks = buildHooks(hooks);
  3317. controls = controls.filter(function (item) {
  3318. return excludeControls.indexOf(item) === -1;
  3319. });
  3320. language = languages[language] || languages[configs_props.language];
  3321. var externalMedias = media && media.externals ? objectSpread_default()({}, configs_props.media.externals, media.externals) : configs_props.media.externals;
  3322. media = objectSpread_default()({}, configs_props.media, media, {
  3323. externalMedias: externalMedias
  3324. });
  3325. if (!media.uploadFn) {
  3326. media.video = false;
  3327. media.audio = false;
  3328. }
  3329. var controlBarProps = {
  3330. editor: this,
  3331. editorState: this.state.editorState,
  3332. braftFinder: this.braftFinder,
  3333. ref: function ref(instance) {
  3334. return _this2.controlBarInstance = instance;
  3335. },
  3336. containerNode: this.state.containerNode,
  3337. className: controlBarClassName,
  3338. style: controlBarStyle,
  3339. hooks: hooks,
  3340. colors: toConsumableArray_default()(colors).concat(toConsumableArray_default()(this.state.tempColors)),
  3341. media: media,
  3342. controls: controls,
  3343. language: language,
  3344. extendControls: extendControls,
  3345. fontSizes: fontSizes,
  3346. fontFamilies: fontFamilies,
  3347. emojis: emojis,
  3348. lineHeights: lineHeights,
  3349. letterSpacings: letterSpacings,
  3350. textIndents: textIndents,
  3351. textAligns: textAligns,
  3352. textBackgroundColor: textBackgroundColor
  3353. };
  3354. var blockRendererFn = getBlockRendererFn({
  3355. editor: this,
  3356. hooks: hooks,
  3357. editorState: this.state.editorState,
  3358. containerNode: this.state.containerNode,
  3359. imageControls: imageControls,
  3360. language: language,
  3361. extendAtomics: extendAtomics
  3362. }, this.props.blockRendererFn);
  3363. var customStyleMap = getCustomStyleMap({
  3364. colors: toConsumableArray_default()(colors).concat(toConsumableArray_default()(this.state.tempColors)),
  3365. fontSizes: fontSizes,
  3366. fontFamilies: fontFamilies,
  3367. lineHeights: lineHeights,
  3368. letterSpacings: letterSpacings,
  3369. textIndents: textIndents
  3370. }, this.props.customStyleMap);
  3371. var draftProps = objectSpread_default()({
  3372. ref: function ref(instance) {
  3373. _this2.draftInstance = instance;
  3374. },
  3375. editorState: this.state.editorState,
  3376. handleKeyCommand: this.handleKeyCommand,
  3377. handleReturn: this.handleReturn,
  3378. handleDrop: this.handleDrop,
  3379. handleDroppedFiles: this.handleDroppedFiles,
  3380. handlePastedText: this.handlePastedText,
  3381. handlePastedFiles: this.handlePastedFiles,
  3382. onChange: this.onChange,
  3383. onTab: this.onTab,
  3384. onFocus: this.onFocus,
  3385. onBlur: this.onBlur,
  3386. readOnly: disabled,
  3387. blockRenderMap: this.blockRenderMap,
  3388. blockStyleFn: this.blockStyleFn,
  3389. keyBindingFn: this.keyBindingFn,
  3390. customStyleMap: customStyleMap,
  3391. blockRendererFn: blockRendererFn,
  3392. placeholder: placeholder,
  3393. stripPastedStyles: stripPastedStyles
  3394. }, this.props.draftProps, this.state.draftProps);
  3395. return external_react_default.a.createElement("div", {
  3396. ref: this.setEditorContainerNode,
  3397. className: "bf-container ".concat(className, " ").concat(disabled ? 'disabled' : ''),
  3398. style: style
  3399. }, external_react_default.a.createElement(ControlBar_ControlBar, controlBarProps), componentBelowControlBar, external_react_default.a.createElement("div", {
  3400. className: "bf-content ".concat(contentClassName),
  3401. style: contentStyle
  3402. }, external_react_default.a.createElement(external_draft_js_["Editor"], draftProps)));
  3403. }
  3404. }, {
  3405. key: "setDraftProps",
  3406. value: function setDraftProps(draftProps) {
  3407. this.setState({
  3408. draftProps: objectSpread_default()({}, this.state.draftProps, draftProps)
  3409. });
  3410. }
  3411. }]);
  3412. return BraftEditor;
  3413. }(external_react_default.a.Component);
  3414. defineProperty_default()(editor_BraftEditor, "defaultProps", configs_props);
  3415. // EXTERNAL MODULE: external "braft-convert"
  3416. var external_braft_convert_ = __webpack_require__(13);
  3417. // CONCATENATED MODULE: ./index.jsx
  3418. /* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "EditorState", function() { return external_draft_js_["EditorState"]; });
  3419. /* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "editorDecorators", function() { return editorDecorators; });
  3420. // 为EditorState对象增加toHTML原型方法,用于将editorState转换成HTML字符串
  3421. external_draft_js_["EditorState"].prototype.toHTML = function () {
  3422. return Object(external_braft_convert_["convertEditorStateToHTML"])(this);
  3423. }; // 为EditorState对象增加toRAW原型方法,用于将editorState转换成RAW JSON对象或RAW JSON字符串
  3424. external_draft_js_["EditorState"].prototype.toRAW = function (noStringify) {
  3425. return noStringify ? Object(external_braft_convert_["convertEditorStateToRaw"])(this) : JSON.stringify(Object(external_braft_convert_["convertEditorStateToRaw"])(this));
  3426. }; // 为EditorState对象增加新的静态方法,用于从raw或者html内容创建ediorState
  3427. external_draft_js_["EditorState"].createFrom = function (content, options) {
  3428. if (typeof_default()(content) === 'object' && content && content.blocks && content.entityMap) {
  3429. return Object(external_braft_convert_["convertRawToEditorState"])(content, editorDecorators);
  3430. } else if (typeof content === 'string') {
  3431. try {
  3432. return external_draft_js_["EditorState"].createFrom(JSON.parse(content), options);
  3433. } catch (error) {
  3434. return Object(external_braft_convert_["convertHTMLToEditorState"])(content, editorDecorators, options);
  3435. }
  3436. } else {
  3437. return external_draft_js_["EditorState"].createEmpty(editorDecorators);
  3438. }
  3439. };
  3440. /* harmony default export */ var index_0 = __webpack_exports__["default"] = (editor_BraftEditor);
  3441. // 2.0.0开发计划
  3442. // [ ]完善各模块文档说明
  3443. // [√]添加更多钩子(插入链接、切换样式等)
  3444. // [√]优化内置的图片伪上传功能,用base64代替blob
  3445. // [√]支持自定义图片工具栏按钮
  3446. // [√]支持通过属性扩展customStyleMap, blockStyleFn, keyBindingFn, blockRendererFn, blockRenderMap等
  3447. // [√]允许完全设置控制栏的按钮(['media', { key: 'blod', text: 'xxx' })
  3448. // [√]允许在工具栏和内容区域直接插入自定义的组件[componentBelowControlBar]
  3449. // [√]支持定义DropDown组件的样式
  3450. // [√]media.validateFn支持异步函数
  3451. // [√]优化音视频在编辑器内的预览体验
  3452. // [√]标准化代码,引入ESLint
  3453. // ---------------------------
  3454. // 优化全选会选择上传中的项目的问题
  3455. // 支持param.success时设置媒体文件的更多属性(尺寸等)
  3456. // 2.1.0版本开发计划
  3457. // [ ]美化UI,包括图标和界面风格
  3458. // [ ]优化控件title提示
  3459. // 2.2.0版本开发计划
  3460. // [ ]允许自定义快捷键
  3461. // [ ]优化图片param.success,支持传入link等
  3462. // [ ]简化上传配置流程
  3463. // [ ]支持draftjs插件机制
  3464. // [ ]支持媒体库组件的更多个性化配置(placeholder等)
  3465. // [ ]支持非媒体类附件
  3466. // [ ]优化HTML格式无法存储媒体名称的问题
  3467. // [ ]完成font-size等样式的全量支持
  3468. // 2.3.0版本开发计划
  3469. // [ ]优化换行与空格
  3470. // [ ]支持自定义Atomic组件
  3471. // [ ]图片裁切等简单的编辑功能
  3472. // [ ]代码块交互强化
  3473. // [ ]初级表格功能
  3474. /***/ }),
  3475. /* 20 */
  3476. /***/ (function(module, exports) {
  3477. function _nonIterableRest() {
  3478. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  3479. }
  3480. module.exports = _nonIterableRest;
  3481. /***/ }),
  3482. /* 21 */
  3483. /***/ (function(module, exports) {
  3484. function _iterableToArrayLimit(arr, i) {
  3485. var _arr = [];
  3486. var _n = true;
  3487. var _d = false;
  3488. var _e = undefined;
  3489. try {
  3490. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  3491. _arr.push(_s.value);
  3492. if (i && _arr.length === i) break;
  3493. }
  3494. } catch (err) {
  3495. _d = true;
  3496. _e = err;
  3497. } finally {
  3498. try {
  3499. if (!_n && _i["return"] != null) _i["return"]();
  3500. } finally {
  3501. if (_d) throw _e;
  3502. }
  3503. }
  3504. return _arr;
  3505. }
  3506. module.exports = _iterableToArrayLimit;
  3507. /***/ }),
  3508. /* 22 */
  3509. /***/ (function(module, exports) {
  3510. function _arrayWithHoles(arr) {
  3511. if (Array.isArray(arr)) return arr;
  3512. }
  3513. module.exports = _arrayWithHoles;
  3514. /***/ }),
  3515. /* 23 */
  3516. /***/ (function(module, exports) {
  3517. function _setPrototypeOf(o, p) {
  3518. module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  3519. o.__proto__ = p;
  3520. return o;
  3521. };
  3522. return _setPrototypeOf(o, p);
  3523. }
  3524. module.exports = _setPrototypeOf;
  3525. /***/ }),
  3526. /* 24 */
  3527. /***/ (function(module, exports) {
  3528. function _nonIterableSpread() {
  3529. throw new TypeError("Invalid attempt to spread non-iterable instance");
  3530. }
  3531. module.exports = _nonIterableSpread;
  3532. /***/ }),
  3533. /* 25 */
  3534. /***/ (function(module, exports) {
  3535. function _iterableToArray(iter) {
  3536. if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  3537. }
  3538. module.exports = _iterableToArray;
  3539. /***/ }),
  3540. /* 26 */
  3541. /***/ (function(module, exports) {
  3542. function _arrayWithoutHoles(arr) {
  3543. if (Array.isArray(arr)) {
  3544. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
  3545. arr2[i] = arr[i];
  3546. }
  3547. return arr2;
  3548. }
  3549. }
  3550. module.exports = _arrayWithoutHoles;
  3551. /***/ }),
  3552. /* 27 */
  3553. /***/ (function(module, exports) {
  3554. // removed by extract-text-webpack-plugin
  3555. /***/ }),
  3556. /* 28 */
  3557. /***/ (function(module, exports) {
  3558. // removed by extract-text-webpack-plugin
  3559. /***/ }),
  3560. /* 29 */
  3561. /***/ (function(module, exports) {
  3562. // removed by extract-text-webpack-plugin
  3563. /***/ }),
  3564. /* 30 */
  3565. /***/ (function(module, exports) {
  3566. // removed by extract-text-webpack-plugin
  3567. /***/ }),
  3568. /* 31 */
  3569. /***/ (function(module, exports) {
  3570. // removed by extract-text-webpack-plugin
  3571. /***/ }),
  3572. /* 32 */
  3573. /***/ (function(module, exports) {
  3574. // removed by extract-text-webpack-plugin
  3575. /***/ }),
  3576. /* 33 */
  3577. /***/ (function(module, exports) {
  3578. // removed by extract-text-webpack-plugin
  3579. /***/ }),
  3580. /* 34 */
  3581. /***/ (function(module, exports) {
  3582. // removed by extract-text-webpack-plugin
  3583. /***/ }),
  3584. /* 35 */
  3585. /***/ (function(module, exports) {
  3586. // removed by extract-text-webpack-plugin
  3587. /***/ }),
  3588. /* 36 */
  3589. /***/ (function(module, exports) {
  3590. // removed by extract-text-webpack-plugin
  3591. /***/ }),
  3592. /* 37 */
  3593. /***/ (function(module, exports) {
  3594. // removed by extract-text-webpack-plugin
  3595. /***/ }),
  3596. /* 38 */
  3597. /***/ (function(module, exports) {
  3598. // removed by extract-text-webpack-plugin
  3599. /***/ }),
  3600. /* 39 */
  3601. /***/ (function(module, exports) {
  3602. // removed by extract-text-webpack-plugin
  3603. /***/ }),
  3604. /* 40 */
  3605. /***/ (function(module, exports) {
  3606. // removed by extract-text-webpack-plugin
  3607. /***/ }),
  3608. /* 41 */
  3609. /***/ (function(module, exports) {
  3610. // removed by extract-text-webpack-plugin
  3611. /***/ }),
  3612. /* 42 */
  3613. /***/ (function(module, exports) {
  3614. // removed by extract-text-webpack-plugin
  3615. /***/ }),
  3616. /* 43 */
  3617. /***/ (function(module, exports) {
  3618. // removed by extract-text-webpack-plugin
  3619. /***/ }),
  3620. /* 44 */
  3621. /***/ (function(module, exports) {
  3622. // removed by extract-text-webpack-plugin
  3623. /***/ }),
  3624. /* 45 */
  3625. /***/ (function(module, exports) {
  3626. // removed by extract-text-webpack-plugin
  3627. /***/ }),
  3628. /* 46 */,
  3629. /* 47 */,
  3630. /* 48 */,
  3631. /* 49 */
  3632. /***/ (function(module, exports) {
  3633. // removed by extract-text-webpack-plugin
  3634. /***/ }),
  3635. /* 50 */,
  3636. /* 51 */
  3637. /***/ (function(module, exports) {
  3638. // removed by extract-text-webpack-plugin
  3639. /***/ })
  3640. /******/ ]);
  3641. });
  3642. //# sourceMappingURL=index.js.map