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