1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("react"), require("braft-utils"), require("draft-js"), require("braft-convert"), require("react-dom"), require("braft-finder"), require("immutable"));
- else if(typeof define === 'function' && define.amd)
- define(["react", "braft-utils", "draft-js", "braft-convert", "react-dom", "braft-finder", "immutable"], factory);
- else {
- 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"]);
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
- })(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__) {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "/";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 26);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
-
- /***/ }),
- /* 1 */
- /***/ (function(module, exports) {
-
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
-
- return self;
- }
-
- module.exports = _assertThisInitialized;
-
- /***/ }),
- /* 2 */
- /***/ (function(module, exports) {
-
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- }
-
- module.exports = _defineProperty;
-
- /***/ }),
- /* 3 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
-
- /***/ }),
- /* 4 */
- /***/ (function(module, exports) {
-
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
-
- module.exports = _classCallCheck;
-
- /***/ }),
- /* 5 */
- /***/ (function(module, exports) {
-
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
-
- module.exports = _createClass;
-
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
-
- var _typeof = __webpack_require__(15);
-
- var assertThisInitialized = __webpack_require__(1);
-
- function _possibleConstructorReturn(self, call) {
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
- return call;
- }
-
- return assertThisInitialized(self);
- }
-
- module.exports = _possibleConstructorReturn;
-
- /***/ }),
- /* 7 */
- /***/ (function(module, exports) {
-
- function _getPrototypeOf(o) {
- module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
- return o.__proto__ || Object.getPrototypeOf(o);
- };
- return _getPrototypeOf(o);
- }
-
- module.exports = _getPrototypeOf;
-
- /***/ }),
- /* 8 */
- /***/ (function(module, exports, __webpack_require__) {
-
- var setPrototypeOf = __webpack_require__(22);
-
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function");
- }
-
- subClass.prototype = Object.create(superClass && superClass.prototype, {
- constructor: {
- value: subClass,
- writable: true,
- configurable: true
- }
- });
- if (superClass) setPrototypeOf(subClass, superClass);
- }
-
- module.exports = _inherits;
-
- /***/ }),
- /* 9 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__9__;
-
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
-
- var defineProperty = __webpack_require__(2);
-
- function _objectSpread(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- var ownKeys = Object.keys(source);
-
- if (typeof Object.getOwnPropertySymbols === 'function') {
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
- }));
- }
-
- ownKeys.forEach(function (key) {
- defineProperty(target, key, source[key]);
- });
- }
-
- return target;
- }
-
- module.exports = _objectSpread;
-
- /***/ }),
- /* 11 */
- /***/ (function(module, exports) {
-
- function _extends() {
- module.exports = _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- module.exports = _extends;
-
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
-
- var arrayWithoutHoles = __webpack_require__(19);
-
- var iterableToArray = __webpack_require__(20);
-
- var nonIterableSpread = __webpack_require__(21);
-
- function _toConsumableArray(arr) {
- return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
- }
-
- module.exports = _toConsumableArray;
-
- /***/ }),
- /* 13 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
-
- /***/ }),
- /* 14 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__14__;
-
- /***/ }),
- /* 15 */
- /***/ (function(module, exports) {
-
- 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); }
-
- function _typeof(obj) {
- if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
- module.exports = _typeof = function _typeof(obj) {
- return _typeof2(obj);
- };
- } else {
- module.exports = _typeof = function _typeof(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
- };
- }
-
- return _typeof(obj);
- }
-
- module.exports = _typeof;
-
- /***/ }),
- /* 16 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__16__;
-
- /***/ }),
- /* 17 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__17__;
-
- /***/ }),
- /* 18 */
- /***/ (function(module, exports, __webpack_require__) {
-
- var arrayWithHoles = __webpack_require__(23);
-
- var iterableToArrayLimit = __webpack_require__(24);
-
- var nonIterableRest = __webpack_require__(25);
-
- function _slicedToArray(arr, i) {
- return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
- }
-
- module.exports = _slicedToArray;
-
- /***/ }),
- /* 19 */
- /***/ (function(module, exports) {
-
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
- arr2[i] = arr[i];
- }
-
- return arr2;
- }
- }
-
- module.exports = _arrayWithoutHoles;
-
- /***/ }),
- /* 20 */
- /***/ (function(module, exports) {
-
- function _iterableToArray(iter) {
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
- }
-
- module.exports = _iterableToArray;
-
- /***/ }),
- /* 21 */
- /***/ (function(module, exports) {
-
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance");
- }
-
- module.exports = _nonIterableSpread;
-
- /***/ }),
- /* 22 */
- /***/ (function(module, exports) {
-
- function _setPrototypeOf(o, p) {
- module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- };
-
- return _setPrototypeOf(o, p);
- }
-
- module.exports = _setPrototypeOf;
-
- /***/ }),
- /* 23 */
- /***/ (function(module, exports) {
-
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
-
- module.exports = _arrayWithHoles;
-
- /***/ }),
- /* 24 */
- /***/ (function(module, exports) {
-
- function _iterableToArrayLimit(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
-
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
-
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
-
- return _arr;
- }
-
- module.exports = _iterableToArrayLimit;
-
- /***/ }),
- /* 25 */
- /***/ (function(module, exports) {
-
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
-
- module.exports = _nonIterableRest;
-
- /***/ }),
- /* 26 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/typeof.js
- var helpers_typeof = __webpack_require__(15);
- var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/objectSpread.js
- var objectSpread = __webpack_require__(10);
- var objectSpread_default = /*#__PURE__*/__webpack_require__.n(objectSpread);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/toConsumableArray.js
- var toConsumableArray = __webpack_require__(12);
- var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/classCallCheck.js
- var classCallCheck = __webpack_require__(4);
- var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/createClass.js
- var createClass = __webpack_require__(5);
- var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
- var possibleConstructorReturn = __webpack_require__(6);
- var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/getPrototypeOf.js
- var getPrototypeOf = __webpack_require__(7);
- var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/inherits.js
- var inherits = __webpack_require__(8);
- var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/assertThisInitialized.js
- var assertThisInitialized = __webpack_require__(1);
- var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/defineProperty.js
- var defineProperty = __webpack_require__(2);
- var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
-
- // EXTERNAL MODULE: ../node_modules/draft-js/dist/Draft.css
- var Draft = __webpack_require__(27);
-
- // EXTERNAL MODULE: ./assets/scss/_base.scss
- var _base = __webpack_require__(29);
-
- // EXTERNAL MODULE: external "react"
- var external_react_ = __webpack_require__(0);
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
-
- // CONCATENATED MODULE: ./languages/en.js
- /* harmony default export */ var en = ({
- base: {
- remove: 'Remove',
- cancel: 'Cancel',
- confirm: 'Confirm',
- inert: 'Insert',
- width: 'Width',
- height: 'Height'
- },
- controls: {
- clear: 'Clear',
- undo: 'Undo',
- redo: 'Redo',
- fontSize: 'Font Size',
- color: 'Color',
- textColor: 'Text',
- tempColors: 'Temp Colors',
- backgroundColor: 'Background',
- bold: 'Bold',
- lineHeight: 'Line Height',
- letterSpacing: 'Letter Spacing',
- textIndent: 'Indent at both ends',
- italic: 'Italic',
- underline: 'Underline',
- strikeThrough: 'Strike Through',
- fontFamily: 'Font Family',
- textAlign: 'Text Alignment',
- alignLeft: 'Left Alignment',
- alignCenter: 'Center Alignment',
- alignRight: 'Right Alignment',
- alignJustify: 'Justify Alignment',
- floatLeft: 'Left Float',
- floatRight: 'Right Float',
- superScript: 'Super Script',
- subScript: 'Sub Script',
- removeStyles: 'Remove Styles',
- headings: 'Headings',
- header: 'Header',
- normal: 'Normal',
- orderedList: 'Ordered List',
- unorderedList: 'Unordered List',
- blockQuote: 'Quote',
- code: 'Code',
- link: 'Link',
- unlink: 'Unlink',
- hr: 'Horizontal Line',
- media: 'Media',
- mediaLibirary: 'Media Libirary',
- emoji: 'Emoji'
- },
- linkEditor: {
- inputPlaceHolder: 'Input link URL',
- inputWithEnterPlaceHolder: 'Input link URL and press Enter',
- openInNewWindow: 'Open in new window',
- removeLink: 'Remove Link'
- },
- audioPlayer: {
- title: 'Play Audio'
- },
- videoPlayer: {
- title: 'Play Video',
- embedTitle: 'Embed Media'
- },
- media: {
- image: 'Image',
- video: 'Video',
- audio: 'Audio',
- embed: 'Embed'
- }
- });
- // CONCATENATED MODULE: ./languages/zh.js
- /* harmony default export */ var zh = ({
- base: {
- remove: '删除',
- cancel: '取消',
- confirm: '确定',
- inert: '插入',
- width: '宽度',
- height: '高度'
- },
- controls: {
- clear: '清除内容',
- undo: '撤销',
- redo: '重做',
- fontSize: '字号',
- lineHeight: '行高',
- letterSpacing: '字间距',
- textIndent: '两端缩进',
- border: '边框',
- color: '颜色',
- textColor: '文字颜色',
- backgroundColor: '背景颜色',
- tempColors: '临时颜色',
- bold: '加粗',
- italic: '斜体',
- underline: '下划线',
- strikeThrough: '删除线',
- fontFamily: '字体',
- textAlign: '文本对齐',
- alignLeft: '居左',
- alignCenter: '居中',
- alignRight: '居右',
- alignJustify: '两端',
- floatLeft: '左浮动',
- floatRight: '右浮动',
- superScript: '上标',
- subScript: '下标',
- removeStyles: '清除样式',
- headings: '标题',
- header: '标题',
- normal: '常规',
- orderedList: '有序列表',
- unorderedList: '无序列表',
- blockQuote: '引用',
- code: '代码',
- link: '链接',
- unlink: '清除链接',
- hr: '水平线',
- media: '媒体',
- mediaLibirary: '媒体库',
- emoji: '小表情'
- },
- linkEditor: {
- inputPlaceHolder: '输入链接地址',
- inputWithEnterPlaceHolder: '输入链接地址并回车',
- openInNewWindow: '在新窗口打开',
- removeLink: '移除链接'
- },
- audioPlayer: {
- title: '播放音频文件'
- },
- videoPlayer: {
- title: '播放视频文件',
- embedTitle: '嵌入式媒体'
- },
- media: {
- image: '图像',
- video: '视频',
- audio: '音频',
- embed: '嵌入式媒体'
- }
- });
- // CONCATENATED MODULE: ./languages/zh-hant.js
- /* harmony default export */ var zh_hant = ({
- base: {
- remove: '刪除',
- cancel: '取消',
- confirm: '確定',
- inert: '插入',
- width: '宽度',
- height: '高度'
- },
- controls: {
- clear: '清除内容',
- undo: '撤銷',
- redo: '重做',
- fontSize: '字號',
- color: '顏色',
- textColor: '文字顏色',
- backgroundColor: '背景顏色',
- tempColors: '臨時顏色',
- bold: '加粗',
- lineHeight: '行高',
- letterSpacing: '字間距',
- textIndent: '兩端縮進',
- border: '邊框',
- italic: '斜體',
- underline: '下劃線',
- strikeThrough: '刪除線',
- fontFamily: '字體',
- textAlign: '文本對齊',
- alignLeft: '居左',
- alignCenter: '居中',
- alignRight: '居右',
- alignJustify: '兩端對齊',
- floatLeft: '左浮動',
- floatRight: '右浮動',
- superScript: '上標',
- subScript: '下標',
- removeStyles: '清除样式',
- headings: '標題',
- header: '標題',
- normal: '常規',
- orderedList: '有序列表',
- unorderedList: '無序列表',
- blockQuote: '引用',
- code: '代碼',
- link: '鏈接',
- unlink: '清除鏈接',
- hr: '水平线',
- media: '媒體',
- mediaLibirary: '媒體库',
- emoji: '小表情'
- },
- linkEditor: {
- inputPlaceHolder: '輸入鏈接地址',
- inputWithEnterPlaceHolder: '輸入鏈接地址並回車',
- openInNewWindow: '在新窗口打開',
- removeLink: '移除鏈接'
- },
- audioPlayer: {
- title: '播放音頻文件'
- },
- videoPlayer: {
- title: '播放視頻文件',
- embedTitle: '嵌入式媒體'
- },
- media: {
- image: '圖像',
- video: '視頻',
- audio: '音頻',
- embed: '嵌入式媒體'
- }
- });
- // CONCATENATED MODULE: ./languages/index.js
-
-
-
- /* harmony default export */ var languages = ({
- 'en': en,
- 'zh': zh,
- 'zh-hant': zh_hant
- });
- // EXTERNAL MODULE: external "braft-finder"
- var external_braft_finder_ = __webpack_require__(16);
- var external_braft_finder_default = /*#__PURE__*/__webpack_require__.n(external_braft_finder_);
-
- // EXTERNAL MODULE: external "braft-utils"
- var external_braft_utils_ = __webpack_require__(3);
-
- // EXTERNAL MODULE: external "draft-js"
- var external_draft_js_ = __webpack_require__(9);
-
- // CONCATENATED MODULE: ./configs/keybindings.js
- // TODO
- // 允许自定义的快捷键设置
-
- /* harmony default export */ var keybindings = (function (customKeyBindingFn) {
- return function (event) {
- if (event.keyCode === 83 && (external_draft_js_["KeyBindingUtil"].hasCommandModifier(event) || external_draft_js_["KeyBindingUtil"].isCtrlKeyCommand(event))) {
- return 'braft-save';
- }
-
- if (customKeyBindingFn) {
- return customKeyBindingFn(event) || Object(external_draft_js_["getDefaultKeyBinding"])(event);
- }
-
- return Object(external_draft_js_["getDefaultKeyBinding"])(event);
- };
- });
- // CONCATENATED MODULE: ./configs/props.js
- /* harmony default export */ var configs_props = ({
- language: 'zh',
- 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'],
- excludeControls: [],
- extendControls: [],
- extendAtomics: [],
- componentBelowControlBar: null,
- media: {
- pasteImage: true,
- image: true,
- video: true,
- audio: true,
- uploadFn: null,
- validateFn: null,
- onBeforeDeselect: null,
- onDeselect: null,
- onBeforeSelect: null,
- onSelect: null,
- onBeforeRemove: null,
- onRemove: null,
- onCancel: null,
- onFileSelect: null,
- onBeforeInsert: null,
- onInsert: null,
- onChange: null,
- externals: {
- audio: true,
- video: true,
- image: true,
- embed: true
- }
- },
- imageControls: ['float-left', 'float-right', 'align-left', 'align-center', 'align-right', 'link', 'size', 'remove'],
- colors: ['#000000', '#333333', '#666666', '#999999', '#cccccc', '#ffffff', '#61a951', '#16a085', '#07a9fe', '#003ba5', '#8e44ad', '#f32784', '#c0392b', '#d35400', '#f39c12', '#fdda00', '#7f8c8d', '#2c3e50'],
- tabIndents: 2,
- textAligns: ['left', 'center', 'right', 'justify'],
- textBackgroundColor: true,
- letterSpacings: [0, 1, 2, 3, 4, 5, 6],
- textIndents: [0, 14, 21, 28],
- lineHeights: [1, 1.2, 1.5, 1.75, 2, 2.5, 3, 4],
- fontSizes: [12, 14, 16, 18, 20, 24, 28, 30, 32, 36, 40, 48, 56, 64, 72, 96, 120, 144],
- fontFamilies: [{
- name: 'Araial',
- family: 'Arial, Helvetica, sans-serif'
- }, {
- name: 'Georgia',
- family: 'Georgia, serif'
- }, {
- name: 'Impact',
- family: 'Impact, serif'
- }, {
- name: 'Monospace',
- family: '"Courier New", Courier, monospace'
- }, {
- name: 'Tahoma',
- family: 'tahoma, arial, "Hiragino Sans GB", 宋体, sans-serif'
- }],
- emojis: ['🤣', '🙌', '💚', '💛', '👏', '😉', '💯', '💕', '💞', '💘', '💙', '💝', '🖤', '💜', '❤️', '😍', '😻', '💓', '💗', '😋', '😇', '😂', '😹', '😘', '💖', '😁', '😀', '🤞', '😲', '😄', '😊', '👍', '😌', '😃', '😅', '✌️', '🤗', '💋', '😗', '😽', '😚', '🤠', '😙', '😺', '👄', '😸', '😏', '😼', '👌', '😎', '😆', '😛', '🙏', '🤝', '🙂', '🤑', '😝', '😐', '😑', '🤤', '😤', '🙃', '🤡', '😶', '😪', '😴', '😵', '😓', '👊', '😦', '😷', '🤐', '😜', '🤓', '👻', '😥', '🙄', '🤔', '🤒', '🙁', '😔', '😯', '☹️', '☠️', '😰', '😩', '😖', '😕', '😒', '😣', '😢', '😮', '😿', '🤧', '😫', '🤥', '😞', '😬', '👎', '💀', '😳', '😨', '🤕', '🤢', '😱', '😭', '😠', '😈', '😧', '💔', '😟', '🙀', '💩', '👿', '😡', '😾', '🖕'],
- stripPastedStyles: false,
- className: '',
- style: {},
- controlBarClassName: '',
- controlBarStyle: {},
- contentClassName: '',
- contentStyle: {},
- draftProps: {},
- hooks: {},
- onChange: null,
- onFocus: null,
- onBlur: null,
- onTab: null,
- onDelete: null,
- onSave: null
- });
- // EXTERNAL MODULE: external "immutable"
- var external_immutable_ = __webpack_require__(17);
-
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/slicedToArray.js
- var slicedToArray = __webpack_require__(18);
- var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
-
- // EXTERNAL MODULE: ./renderers/atomics/Image/style.scss
- var Image_style = __webpack_require__(33);
-
- // EXTERNAL MODULE: ./components/common/Switch/style.scss
- var Switch_style = __webpack_require__(34);
-
- // CONCATENATED MODULE: ./components/common/Switch/index.jsx
-
-
- /* harmony default export */ var Switch = (function (props) {
- var active = props.active,
- _onClick = props.onClick,
- className = props.className;
- return external_react_default.a.createElement("div", {
- onClick: function onClick() {
- return _onClick();
- },
- className: 'bf-switch ' + className + (active ? ' active' : '')
- });
- });
- // CONCATENATED MODULE: ./configs/controls.js
-
- /* harmony default export */ var configs_controls = (function (lang) {
- return [{
- key: 'undo',
- title: lang.controls.undo,
- text: external_react_default.a.createElement("i", {
- className: "bfi-undo"
- }),
- type: 'editor-method',
- command: 'undo'
- }, {
- key: 'redo',
- title: lang.controls.redo,
- text: external_react_default.a.createElement("i", {
- className: "bfi-redo"
- }),
- type: 'editor-method',
- command: 'redo'
- }, {
- key: 'remove-styles',
- title: lang.controls.removeStyles,
- text: external_react_default.a.createElement("i", {
- className: "bfi-format_clear"
- }),
- type: 'editor-method',
- command: 'removeSelectionInlineStyles'
- }, {
- key: 'hr',
- title: lang.controls.hr,
- text: external_react_default.a.createElement("i", {
- className: "bfi-hr"
- }),
- type: 'editor-method',
- command: 'insertHorizontalLine'
- }, {
- key: 'bold',
- title: lang.controls.bold,
- text: external_react_default.a.createElement("i", {
- className: "bfi-bold"
- }),
- type: 'inline-style',
- command: 'bold'
- }, {
- key: 'italic',
- title: lang.controls.italic,
- text: external_react_default.a.createElement("i", {
- className: "bfi-italic"
- }),
- type: 'inline-style',
- command: 'italic'
- }, {
- key: 'underline',
- title: lang.controls.underline,
- text: external_react_default.a.createElement("i", {
- className: "bfi-underlined"
- }),
- type: 'inline-style',
- command: 'underline'
- }, {
- key: 'strike-through',
- title: lang.controls.strikeThrough,
- text: external_react_default.a.createElement("i", {
- className: "bfi-strikethrough"
- }),
- type: 'inline-style',
- command: 'strikethrough'
- }, {
- key: 'superscript',
- title: lang.controls.superScript,
- text: external_react_default.a.createElement("i", {
- className: "bfi-superscript"
- }),
- type: 'inline-style',
- command: 'superscript'
- }, {
- key: 'subscript',
- title: lang.controls.subScript,
- text: external_react_default.a.createElement("i", {
- className: "bfi-subscript"
- }),
- type: 'inline-style',
- command: 'subscript'
- }, {
- key: 'headings',
- title: lang.controls.headings,
- type: 'headings'
- }, {
- key: 'blockquote',
- title: lang.controls.blockQuote,
- text: external_react_default.a.createElement("i", {
- className: "bfi-quote"
- }),
- type: 'block-type',
- command: 'blockquote'
- }, {
- key: 'code',
- title: lang.controls.code,
- text: external_react_default.a.createElement("i", {
- className: "bfi-code"
- }),
- type: 'block-type',
- command: 'code-block'
- }, {
- key: 'list-ul',
- title: lang.controls.unorderedList,
- text: external_react_default.a.createElement("i", {
- className: "bfi-list"
- }),
- type: 'block-type',
- command: 'unordered-list-item'
- }, {
- key: 'list-ol',
- title: lang.controls.orderedList,
- text: external_react_default.a.createElement("i", {
- className: "bfi-list-numbered"
- }),
- type: 'block-type',
- command: 'ordered-list-item'
- }, {
- key: 'link',
- title: lang.controls.link,
- type: 'link'
- }, {
- key: 'text-color',
- title: lang.controls.color,
- type: 'text-color'
- }, {
- key: 'line-height',
- title: lang.controls.lineHeight,
- type: 'line-height'
- }, {
- key: 'letter-spacing',
- title: lang.controls.letterSpacing,
- type: 'letter-spacing'
- }, {
- key: 'text-indent',
- title: lang.controls.textIndent,
- type: 'text-indent'
- }, {
- key: 'font-size',
- title: lang.controls.fontSize,
- type: 'font-size'
- }, {
- key: 'font-family',
- title: lang.controls.fontFamily,
- type: 'font-family'
- }, {
- key: 'text-align',
- title: lang.controls.textAlign,
- type: 'text-align'
- }, {
- key: 'media',
- title: lang.controls.media,
- text: external_react_default.a.createElement("i", {
- className: "bfi-media"
- }),
- type: 'media'
- }, {
- key: 'emoji',
- title: lang.controls.emoji,
- text: external_react_default.a.createElement("i", {
- className: "bfi-emoji"
- }),
- type: 'emoji'
- }, {
- key: 'clear',
- title: lang.controls.clear,
- text: lang.controls.clear,
- type: 'editor-method',
- command: 'clearEditorContent'
- }, {
- key: 'modal',
- type: 'modal'
- }, {
- key: 'button',
- type: 'button'
- }, {
- key: 'dropdown',
- type: 'dropdown'
- }, {
- key: 'component',
- type: 'component'
- }];
- });
- var imageControlItems = {
- 'float-left': {
- text: external_react_default.a.createElement("span", {
- "data-float": "left"
- }, "\uE91E"),
- command: 'setImageFloat|left'
- },
- 'float-right': {
- text: external_react_default.a.createElement("span", {
- "data-float": "right"
- }, "\uE914"),
- command: 'setImageFloat|right'
- },
- 'align-left': {
- text: external_react_default.a.createElement("span", {
- "data-align": "left"
- }, "\uE027"),
- command: 'setImageAlignment|left'
- },
- 'align-center': {
- text: external_react_default.a.createElement("span", {
- "data-align": "center"
- }, "\uE028"),
- command: 'setImageAlignment|center'
- },
- 'align-right': {
- text: external_react_default.a.createElement("span", {
- "data-align": "right"
- }, "\uE029"),
- command: 'setImageAlignment|right'
- },
- 'size': {
- text: external_react_default.a.createElement("span", null, "\uE3C2"),
- command: 'toggleSizeEditor'
- },
- 'link': {
- text: external_react_default.a.createElement("span", null, "\uE91A"),
- command: 'toggleLinkEditor'
- },
- 'remove': {
- text: external_react_default.a.createElement("span", null, "\uE9AC"),
- command: 'removeImage'
- }
- };
- // CONCATENATED MODULE: ./renderers/atomics/Image/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var Image_Image =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(Image, _React$Component);
-
- function Image() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, Image);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Image)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- toolbarVisible: false,
- toolbarOffset: 0,
- linkEditorVisible: false,
- sizeEditorVisible: false,
- tempLink: null,
- tempWidth: null,
- tempHeight: null
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDragStart", function () {
- window.__BRAFT_DRAGING__IMAGE__ = {
- block: _this.props.block,
- mediaData: objectSpread_default()({
- type: 'IMAGE'
- }, _this.props.mediaData)
- };
-
- _this.setState({
- toolbarVisible: false
- }, function () {
- _this.props.editor.setDraftProps({
- readOnly: false
- });
- });
-
- return true;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDragEnd", function () {
- window.__BRAFT_DRAGING__IMAGE__ = null;
- return false;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "executeCommand", function (command) {
- if (typeof command === 'string') {
- var _command$split = command.split('|'),
- _command$split2 = slicedToArray_default()(_command$split, 2),
- method = _command$split2[0],
- param = _command$split2[1];
-
- _this[method] && _this[method](param);
- } else if (typeof command === 'function') {
- command(_this.props.block, _this.props.editorState);
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeImage", function () {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
-
- _this.props.editor.setDraftProps({
- readOnly: false
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleLinkEditor", function () {
- _this.setState({
- linkEditorVisible: !_this.state.linkEditorVisible,
- sizeEditorVisible: false
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleSizeEditor", function () {
- _this.setState({
- linkEditorVisible: false,
- sizeEditorVisible: !_this.state.sizeEditorVisible
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleLinkInputKeyDown", function (e) {
- if (e.keyCode === 13) {
- _this.confirmImageLink();
- } else {
- return;
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageLink", function (e) {
- _this.setState({
- tempLink: e.currentTarget.value
- });
-
- return;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "confirmImageLink", function () {
- var link = _this.state.tempLink;
-
- if (link !== null) {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(_this.props.editorState, _this.props.entityKey, {
- link: link
- }));
-
- window.setImmediate(_this.props.editor.forceRender);
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleSizeInputKeyDown", function (e) {
- if (e.keyCode === 13) {
- _this.confirmImageSize();
- } else {
- return;
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageWidth", function (_ref) {
- var currentTarget = _ref.currentTarget;
- var value = currentTarget.value;
- value && !isNaN(value) && (value = value + 'px');
-
- _this.setState({
- tempWidth: value
- });
-
- return;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageHeight", function (_ref2) {
- var currentTarget = _ref2.currentTarget;
- var value = currentTarget.value;
- value && !isNaN(value) && (value = value + 'px');
-
- _this.setState({
- tempHeight: value
- });
-
- return;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "confirmImageSize", function () {
- var _this$state = _this.state,
- width = _this$state.tempWidth,
- height = _this$state.tempHeight;
- var newImageSize = {};
- width !== null && (newImageSize.width = width);
- height !== null && (newImageSize.height = height);
-
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(_this.props.editorState, _this.props.entityKey, newImageSize));
-
- window.setImmediate(_this.props.editor.forceRender);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageFloat", function (float) {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaPosition(_this.props.editorState, _this.props.block, {
- float: float
- }));
-
- _this.props.editor.setDraftProps({
- readOnly: false
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setImageAlignment", function (alignment) {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaPosition(_this.props.editorState, _this.props.block, {
- alignment: alignment
- }));
-
- _this.props.editor.setDraftProps({
- readOnly: false
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function (event) {
- event.preventDefault();
-
- if (!_this.state.toolbarVisible) {
- _this.setState({
- toolbarVisible: true
- }, function () {
- _this.props.editor.setDraftProps({
- readOnly: true
- });
-
- _this.setState({
- toolbarOffset: _this.calcToolbarOffset()
- });
- });
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function (event) {
- event.preventDefault();
-
- _this.setState({
- toolbarVisible: false
- }, function () {
- _this.props.editor.setDraftProps({
- readOnly: false
- });
- });
- });
-
- return _this;
- }
-
- createClass_default()(Image, [{
- key: "render",
- value: function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- mediaData = _this$props.mediaData,
- language = _this$props.language,
- imageControls = _this$props.imageControls;
- var _this$state2 = this.state,
- toolbarVisible = _this$state2.toolbarVisible,
- toolbarOffset = _this$state2.toolbarOffset,
- linkEditorVisible = _this$state2.linkEditorVisible,
- sizeEditorVisible = _this$state2.sizeEditorVisible;
- var blockData = this.props.block.getData();
- var float = blockData.get('float');
- var alignment = blockData.get('alignment');
- var src = mediaData.src,
- url = mediaData.url,
- link = mediaData.link,
- link_target = mediaData.link_target,
- width = mediaData.width,
- height = mediaData.height;
- var imageStyles = {};
- var clearFix = false;
-
- if (float) {
- alignment = null;
- } else if (alignment === 'left') {
- imageStyles.float = 'left';
- clearFix = true;
- } else if (alignment === 'right') {
- imageStyles.float = 'right';
- clearFix = true;
- } else if (alignment === 'center') {
- imageStyles.textAlign = 'center';
- } else {
- imageStyles.float = 'left';
- clearFix = true;
- }
-
- var renderedControlItems = imageControls.map(function (item, index) {
- if (typeof item === 'string' && imageControlItems[item]) {
- return external_react_default.a.createElement("a", {
- className: item === 'link' && link ? 'active' : '',
- key: index,
- href: "javascript:void(0);",
- onClick: function onClick() {
- return _this2.executeCommand(imageControlItems[item].command);
- }
- }, imageControlItems[item].text);
- } else if (item && item.onClick && (item.render || item.text)) {
- return external_react_default.a.createElement("a", {
- key: index,
- href: "javascript:void(0);",
- onClick: function onClick() {
- return _this2.executeCommand(item.onClick);
- }
- }, item.render ? item.render(mediaData) : item.text);
- } else {
- return null;
- }
- });
- return external_react_default.a.createElement("div", {
- className: "bf-media"
- }, external_react_default.a.createElement("div", {
- style: imageStyles,
- draggable: true,
- onMouseEnter: this.showToolbar,
- onMouseMove: this.showToolbar,
- onMouseLeave: this.hideToolbar,
- onDragStart: this.handleDragStart,
- onDragEnd: this.handleDragEnd,
- ref: function ref(instance) {
- return _this2.mediaEmbederInstance = instance;
- },
- className: "bf-image"
- }, toolbarVisible ? external_react_default.a.createElement("div", {
- style: {
- marginLeft: toolbarOffset
- },
- ref: function ref(instance) {
- return _this2.toolbarElement = instance;
- },
- "data-float": float,
- "data-align": alignment,
- className: "bf-media-toolbar"
- }, linkEditorVisible ? external_react_default.a.createElement("div", {
- className: "bf-image-link-editor"
- }, external_react_default.a.createElement("div", {
- className: "editor-input-group"
- }, external_react_default.a.createElement("input", {
- type: "text",
- placeholder: language.linkEditor.inputWithEnterPlaceHolder,
- onKeyDown: this.handleLinkInputKeyDown,
- onChange: this.setImageLink,
- defaultValue: link
- }), external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.confirmImageLink
- }, language.base.confirm)), external_react_default.a.createElement("div", {
- className: "switch-group"
- }, external_react_default.a.createElement(Switch, {
- active: link_target === '_blank',
- onClick: function onClick() {
- return _this2.setImageLinkTarget(link_target);
- }
- }), external_react_default.a.createElement("label", null, language.linkEditor.openInNewWindow))) : null, sizeEditorVisible ? external_react_default.a.createElement("div", {
- className: "bf-image-size-editor"
- }, external_react_default.a.createElement("div", {
- className: "editor-input-group"
- }, external_react_default.a.createElement("input", {
- type: "text",
- placeholder: language.base.width,
- onKeyDown: this.handleSizeInputKeyDown,
- onChange: this.setImageWidth,
- defaultValue: width
- }), external_react_default.a.createElement("input", {
- type: "text",
- placeholder: language.base.height,
- onKeyDown: this.handleSizeInputKeyDown,
- onChange: this.setImageHeight,
- defaultValue: height
- }), external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.confirmImageSize
- }, language.base.confirm))) : null, renderedControlItems, external_react_default.a.createElement("i", {
- style: {
- marginLeft: toolbarOffset * -1
- },
- className: "bf-media-toolbar-arrow"
- })) : null, external_react_default.a.createElement("img", {
- ref: function ref(instance) {
- return _this2.imageElement = instance;
- },
- src: src || url,
- style: {
- width: width,
- height: height
- },
- width: width,
- height: height
- })), clearFix && external_react_default.a.createElement("div", {
- className: "clearfix",
- style: {
- clear: 'both',
- height: 0,
- lineHeight: 0,
- float: 'none'
- }
- }));
- }
- }, {
- key: "calcToolbarOffset",
- value: function calcToolbarOffset() {
- if (!this.props.containerNode) {
- return 0;
- }
-
- var viewRect = this.props.containerNode.getBoundingClientRect();
- var toolbarRect = this.toolbarElement.getBoundingClientRect();
- var imageRect = this.imageElement.getBoundingClientRect();
- var right = viewRect.right - (imageRect.right - imageRect.width / 2 + toolbarRect.width / 2);
- var left = imageRect.left + imageRect.width / 2 - toolbarRect.width / 2 - viewRect.left;
-
- if (right < 10) {
- return right - 10;
- } else if (left < 10) {
- return left * -1 + 10;
- } else {
- return 0;
- }
- }
- }, {
- key: "setImageLinkTarget",
- value: function setImageLinkTarget(link_target) {
- link_target = link_target === '_blank' ? '' : '_blank';
- this.props.editor.setValue(external_braft_utils_["ContentUtils"].setMediaData(this.props.editorState, this.props.entityKey, {
- link_target: link_target
- }));
- window.setImmediate(this.props.editor.forceRender);
- }
- }]);
-
- return Image;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./renderers/atomics/Video/style.scss
- var Video_style = __webpack_require__(35);
-
- // CONCATENATED MODULE: ./components/common/StaticContainer/index.jsx
-
-
-
-
-
-
-
- var StaticContainer_default =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(_default, _React$Component);
-
- function _default() {
- classCallCheck_default()(this, _default);
-
- return possibleConstructorReturn_default()(this, getPrototypeOf_default()(_default).apply(this, arguments));
- }
-
- createClass_default()(_default, [{
- key: "shouldComponentUpdate",
- value: function shouldComponentUpdate() {
- return false;
- }
- }, {
- key: "render",
- value: function render() {
- return external_react_default.a.createElement("div", null, this.props.children);
- }
- }]);
-
- return _default;
- }(external_react_default.a.Component);
-
-
- // CONCATENATED MODULE: ./renderers/atomics/Video/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
- var Video_Video =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(Video, _React$Component);
-
- function Video() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, Video);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Video)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- toolbarVisible: false
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeVideo", function () {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
- _this.setState({
- toolbarVisible: true
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
- _this.setState({
- toolbarVisible: false
- });
- });
-
- return _this;
- }
-
- createClass_default()(Video, [{
- key: "render",
- value: function render() {
- var toolbarVisible = this.state.toolbarVisible;
- var mediaData = this.props.mediaData;
- var src = mediaData.src,
- url = mediaData.url,
- meta = mediaData.meta;
- return external_react_default.a.createElement("div", {
- className: "bf-video",
- onMouseOver: this.showToolbar,
- onMouseLeave: this.hideToolbar
- }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("video", {
- controls: true,
- src: src || url,
- poster: meta.poster
- })), toolbarVisible ? external_react_default.a.createElement("div", {
- className: "bf-embed-toolbar"
- }, external_react_default.a.createElement("a", {
- onClick: this.removeVideo
- }, "\uE9AC")) : null);
- }
- }]);
-
- return Video;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./renderers/atomics/Audio/style.scss
- var Audio_style = __webpack_require__(36);
-
- // CONCATENATED MODULE: ./renderers/atomics/Audio/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
- var Audio_Audio =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(Audio, _React$Component);
-
- function Audio() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, Audio);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Audio)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- toolbarVisible: false
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeAudio", function () {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
- _this.setState({
- toolbarVisible: true
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
- _this.setState({
- toolbarVisible: false
- });
- });
-
- return _this;
- }
-
- createClass_default()(Audio, [{
- key: "render",
- value: function render() {
- var toolbarVisible = this.state.toolbarVisible;
- var mediaData = this.props.mediaData;
- var src = mediaData.src,
- url = mediaData.url;
- return external_react_default.a.createElement("div", {
- className: "bf-audio",
- onMouseOver: this.showToolbar,
- onMouseLeave: this.hideToolbar
- }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("audio", {
- controls: true,
- src: src || url
- })), toolbarVisible ? external_react_default.a.createElement("div", {
- className: "bf-media-toolbar"
- }, external_react_default.a.createElement("a", {
- onClick: this.removeAudio
- }, "\uE9AC")) : null);
- }
- }]);
-
- return Audio;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./renderers/atomics/Embed/style.scss
- var Embed_style = __webpack_require__(37);
-
- // CONCATENATED MODULE: ./renderers/atomics/Embed/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
- var Embed_Embed =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(Embed, _React$Component);
-
- function Embed() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, Embed);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(Embed)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- toolbarVisible: false
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeEmbed", function () {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "showToolbar", function () {
- _this.setState({
- toolbarVisible: true
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "hideToolbar", function () {
- _this.setState({
- toolbarVisible: false
- });
- });
-
- return _this;
- }
-
- createClass_default()(Embed, [{
- key: "render",
- value: function render() {
- var toolbarVisible = this.state.toolbarVisible;
- var mediaData = this.props.mediaData;
- var src = mediaData.src,
- url = mediaData.url;
- return external_react_default.a.createElement("div", {
- className: "bf-embed",
- onMouseOver: this.showToolbar,
- onMouseLeave: this.hideToolbar
- }, external_react_default.a.createElement(StaticContainer_default, null, external_react_default.a.createElement("div", {
- className: "bf-embed-player",
- dangerouslySetInnerHTML: {
- __html: src || url
- }
- })), toolbarVisible ? external_react_default.a.createElement("div", {
- className: "bf-media-toolbar"
- }, external_react_default.a.createElement("a", {
- onClick: this.removeEmbed
- }, "\uE9AC")) : null);
- }
- }]);
-
- return Embed;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./renderers/atomics/HorizontalLine/style.scss
- var HorizontalLine_style = __webpack_require__(38);
-
- // CONCATENATED MODULE: ./renderers/atomics/HorizontalLine/index.jsx
-
-
-
-
-
-
-
-
-
-
-
- var HorizontalLine_HorizontalLine =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(HorizontalLine, _React$Component);
-
- function HorizontalLine() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, HorizontalLine);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(HorizontalLine)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeHorizontalLine", function () {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].removeBlock(_this.props.editorState, _this.props.block));
- });
-
- return _this;
- }
-
- createClass_default()(HorizontalLine, [{
- key: "render",
- value: function render() {
- return external_react_default.a.createElement("div", {
- className: "bf-hr"
- }, external_react_default.a.createElement("div", {
- className: "bf-media-toolbar"
- }, external_react_default.a.createElement("a", {
- onClick: this.removeHorizontalLine
- }, "\uE9AC")));
- }
- }]);
-
- return HorizontalLine;
- }(external_react_default.a.Component);
-
-
- // CONCATENATED MODULE: ./renderers/styles/blockStyles.js
- /* harmony default export */ var blockStyles = (function (customBlockStyleFn) {
- return function (block) {
- var blockAlignment = block.getData() && block.getData().get('textAlign');
- var blockFloat = block.getData() && block.getData().get('float');
- var result = '';
-
- if (blockAlignment) {
- result = "bfa-".concat(blockAlignment);
- }
-
- if (blockFloat) {
- result += " bff-".concat(blockFloat);
- }
-
- if (customBlockStyleFn) {
- result += customBlockStyleFn(block);
- }
-
- return result;
- };
- });
- // CONCATENATED MODULE: ./renderers/styles/inlineStyles.js
-
- /* harmony default export */ var inlineStyles = (function (props) {
- var customStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var colorStyles = {};
- var bgColorStyles = {};
- var fontSizeStyles = {};
- var fontFamilyStyles = {};
- var lineHeightStyles = {};
- var letterSpacingtStyles = {};
- var indentStyles = {};
- props.colors.forEach(function (color) {
- var color_id = color.replace('#', '').toUpperCase();
- colorStyles['COLOR-' + color_id] = {
- color: color
- };
- bgColorStyles['BGCOLOR-' + color_id] = {
- backgroundColor: color
- };
- });
- props.fontSizes.forEach(function (fontSize) {
- fontSizeStyles['FONTSIZE-' + fontSize] = {
- fontSize: fontSize
- };
- });
- props.fontFamilies.forEach(function (fontFamily) {
- fontFamilyStyles['FONTFAMILY-' + fontFamily.name.toUpperCase()] = {
- fontFamily: fontFamily.family
- };
- });
- props.lineHeights.forEach(function (lineHeight) {
- lineHeightStyles['LINEHEIGHT-' + lineHeight] = {
- lineHeight: lineHeight
- };
- });
- props.letterSpacings.forEach(function (letterSpacing) {
- letterSpacingtStyles['LETTERSPACING-' + letterSpacing] = {
- letterSpacing: letterSpacing
- };
- });
- props.textIndents.forEach(function (indent) {
- indentStyles['INDENT-' + indent] = {
- paddingLeft: indent,
- paddingRight: indent
- };
- });
- return objectSpread_default()({
- 'SUPERSCRIPT': {
- position: 'relative',
- top: '-8px',
- fontSize: '11px'
- },
- 'SUBSCRIPT': {
- position: 'relative',
- bottom: '-8px',
- fontSize: '11px'
- }
- }, colorStyles, bgColorStyles, fontSizeStyles, fontFamilyStyles, lineHeightStyles, letterSpacingtStyles, indentStyles, customStyles);
- });
- // CONCATENATED MODULE: ./renderers/decorators/Link/index.jsx
-
-
- function handleStrategy(contentBlock, callback, contentState) {
- contentBlock.findEntityRanges(function (character) {
- var entityKey = character.getEntity();
- return entityKey !== null && contentState.getEntity(entityKey).getType() === 'LINK';
- }, callback);
- }
-
- var Link_Link = function Link(props) {
- var children = props.children,
- entityKey = props.entityKey,
- contentState = props.contentState;
-
- var _contentState$getEnti = contentState.getEntity(entityKey).getData(),
- href = _contentState$getEnti.href,
- target = _contentState$getEnti.target;
-
- return external_react_default.a.createElement("span", {
- className: "bf-link-wrap"
- }, external_react_default.a.createElement("a", {
- onClick: function onClick(event) {
- return viewLink(event, href);
- },
- className: "bf-link",
- href: href,
- target: target
- }, children));
- };
-
- var viewLink = function viewLink(event, link) {
- if (event.getModifierState('Shift')) {
- var tempLink = document.createElement('a');
- tempLink.href = link;
- tempLink.target = '_blank';
- tempLink.click();
- }
- };
-
- /* harmony default export */ var decorators_Link = ({
- strategy: handleStrategy,
- component: Link_Link
- });
- // CONCATENATED MODULE: ./renderers/decorators/index.js
-
- /* harmony default export */ var decorators = ([decorators_Link]);
- // CONCATENATED MODULE: ./renderers/index.js
-
-
-
-
-
-
-
-
-
-
-
-
-
- var renderers_getAtomicBlockComponent = function getAtomicBlockComponent(block, superProps) {
- return function (props) {
- var entityKey = props.block.getEntityAt(0);
-
- if (!entityKey) {
- return null;
- }
-
- var entity = props.contentState.getEntity(entityKey);
- var mediaData = entity.getData();
- var mediaType = entity.getType();
-
- var mediaProps = objectSpread_default()({}, superProps, {
- block: block,
- mediaData: mediaData,
- entityKey: entityKey
- });
-
- if (mediaType === 'IMAGE') {
- return external_react_default.a.createElement(Image_Image, mediaProps);
- } else if (mediaType === 'AUDIO') {
- return external_react_default.a.createElement(Audio_Audio, mediaProps);
- } else if (mediaType === 'VIDEO') {
- return external_react_default.a.createElement(Video_Video, mediaProps);
- } else if (mediaType === 'EMBED') {
- return external_react_default.a.createElement(Embed_Embed, mediaProps);
- } else if (mediaType === 'HR') {
- return external_react_default.a.createElement(HorizontalLine_HorizontalLine, mediaProps);
- }
-
- if (superProps.extendAtomics) {
- var atomics = superProps.extendAtomics;
-
- for (var i = 0; i < atomics.length; i++) {
- if (mediaType === atomics[i].type) {
- var Component = atomics[i].component;
- return external_react_default.a.createElement(Component, mediaProps);
- }
- }
- }
-
- return null;
- };
- };
-
- var getBlockRendererFn = function getBlockRendererFn(props, customBlockRendererFn) {
- return function (block) {
- var blockRenderer = null;
-
- if (block.getType() === 'atomic') {
- blockRenderer = {
- component: renderers_getAtomicBlockComponent(block, props),
- editable: false
- };
- } else if (customBlockRendererFn) {
- blockRenderer = customBlockRendererFn(block) || null;
- }
-
- return blockRenderer;
- };
- };
- var customBlockRenderMap = Object(external_immutable_["Map"])({
- 'atomic': {
- element: ''
- },
- 'code-block': {
- element: 'code',
- wrapper: external_draft_js_["DefaultDraftBlockRenderMap"].get('code-block').wrapper
- }
- });
- var getBlockStyleFn = blockStyles;
- var getCustomStyleMap = inlineStyles;
- var renderers_decorators = decorators;
- // EXTERNAL MODULE: ../node_modules/@babel/runtime/helpers/extends.js
- var helpers_extends = __webpack_require__(11);
- var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
-
- // EXTERNAL MODULE: ./components/business/ControlBar/style.scss
- var ControlBar_style = __webpack_require__(39);
-
- // EXTERNAL MODULE: ./components/business/LinkEditor/style.scss
- var LinkEditor_style = __webpack_require__(40);
-
- // EXTERNAL MODULE: ./components/common/DropDown/style.scss
- var DropDown_style = __webpack_require__(41);
-
- // CONCATENATED MODULE: ./helpers/responsive.js
-
- var resizeEventHandlers = [];
- var responsiveHelperInited = false;
- var debouce = false;
- /* harmony default export */ var responsive = ({
- resolve: function resolve(eventHandler) {
- var id = external_braft_utils_["BaseUtils"].UniqueIndex();
- resizeEventHandlers.push({
- id: id,
- eventHandler: eventHandler
- });
- return id;
- },
- unresolve: function unresolve(id) {
- resizeEventHandlers = resizeEventHandlers.filter(function (item) {
- return item.id !== id;
- });
- }
- });
-
- if (!responsiveHelperInited) {
- window.addEventListener('resize', function (event) {
- clearTimeout(debouce);
- debouce = setTimeout(function () {
- resizeEventHandlers.map(function (item) {
- typeof item.eventHandler === 'function' && item.eventHandler(event);
- });
- debouce = false;
- }, 100);
- });
- responsiveHelperInited = true;
- }
- // CONCATENATED MODULE: ./components/common/DropDown/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
- var DropDown_DropDown =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(DropDown, _React$Component);
-
- function DropDown() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, DropDown);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(DropDown)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "alive", false);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "responsiveResolveId", null);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownHandlerElement", null);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownContentElement", null);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "componentId", _this.props.componentId || 'BRAFT-DROPDOWN-' + external_braft_utils_["BaseUtils"].UniqueIndex());
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- active: false,
- offset: 0,
- maxHeight: 100
- });
-
- return _this;
- }
-
- createClass_default()(DropDown, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var _this2 = this;
-
- this.alive = true;
- document.body.addEventListener('click', function (event) {
- _this2.registerClickEvent(event);
- });
- this.responsiveResolveId = responsive.resolve(function () {
- _this2.fixDropDownPosition();
- });
- }
- }, {
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(next) {
- if (!this.props.disabled && next.disabled) {
- this.hide();
- }
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate(prevState) {
- if (!prevState.active && this.state.active) {
- this.fixDropDownPosition();
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- var _this3 = this;
-
- document.body.removeEventListener('click', function (event) {
- _this3.registerClickEvent(event);
- });
- this.alive = false;
- responsive.unresolve(this.responsiveResolveId);
- }
- }, {
- key: "render",
- value: function render() {
- var _this4 = this;
-
- var _this$state = this.state,
- active = _this$state.active,
- offset = _this$state.offset,
- maxHeight = _this$state.maxHeight;
- var _this$props = this.props,
- caption = _this$props.caption,
- htmlCaption = _this$props.htmlCaption,
- title = _this$props.title,
- disabled = _this$props.disabled,
- showArrow = _this$props.showArrow,
- arrowActive = _this$props.arrowActive,
- className = _this$props.className,
- children = _this$props.children;
- disabled && (active = false);
- return external_react_default.a.createElement("div", {
- id: this.componentId,
- className: 'bf-dropdown ' + (active ? 'active ' : '') + (disabled ? 'disabled ' : '') + className
- }, htmlCaption ? external_react_default.a.createElement("button", {
- type: "button",
- className: "dropdown-handler",
- "data-title": title,
- "data-braft-component-id": this.componentId,
- dangerouslySetInnerHTML: htmlCaption ? {
- __html: htmlCaption
- } : null,
- ref: function ref(instance) {
- return _this4.dropDownHandlerElement = instance;
- }
- }) : external_react_default.a.createElement("button", {
- type: "button",
- className: "dropdown-handler",
- "data-title": title,
- "data-braft-component-id": this.componentId,
- ref: function ref(instance) {
- return _this4.dropDownHandlerElement = instance;
- }
- }, external_react_default.a.createElement("span", null, caption), showArrow !== false ? external_react_default.a.createElement("i", {
- className: "bfi-drop-down"
- }) : null), external_react_default.a.createElement("div", {
- className: "dropdown-content",
- style: {
- marginLeft: offset
- },
- ref: function ref(instance) {
- return _this4.dropDownContentElement = instance;
- }
- }, external_react_default.a.createElement("i", {
- style: {
- marginLeft: offset * -1
- },
- className: 'dropdown-arrow' + (arrowActive ? ' active' : '')
- }), external_react_default.a.createElement("div", {
- className: "dropdown-content-inner",
- style: {
- maxHeight: maxHeight
- }
- }, children)));
- }
- }, {
- key: "fixDropDownPosition",
- value: function fixDropDownPosition() {
- var viewRect = this.props.containerNode.getBoundingClientRect();
- var editorContentRect = this.props.containerNode.querySelector('.bf-content').getBoundingClientRect();
- var handlerRect = this.dropDownHandlerElement.getBoundingClientRect();
- var contentRect = this.dropDownContentElement.getBoundingClientRect();
- var maxHeight = editorContentRect.height + (editorContentRect.top - (handlerRect.top + handlerRect.height)) - 30;
- var offset = 0;
- var right = handlerRect.right - handlerRect.width / 2 + contentRect.width / 2;
- var left = handlerRect.left + handlerRect.width / 2 - contentRect.width / 2;
- right = viewRect.right - right;
- left = left - viewRect.left;
-
- if (right < 10) {
- offset = right - 10;
- } else if (left < 10) {
- offset = left * -1 + 10;
- }
-
- if (offset !== this.state.offset || maxHeight !== this.state.maxHeight) {
- this.setState({
- offset: offset,
- maxHeight: maxHeight
- });
- }
- }
- }, {
- key: "registerClickEvent",
- value: function registerClickEvent(event) {
- var autoHide = this.props.autoHide;
- var active = false;
-
- if (event.target.dataset.braftComponentId === this.componentId) {
- active = event.target.dataset.keepActive ? true : !this.state.active;
- } else if (autoHide === false) {
- active = this.state.active;
- }
-
- this.alive && this.setState({
- active: active
- });
- }
- }, {
- key: "show",
- value: function show() {
- this.setState({
- active: true
- });
- }
- }, {
- key: "hide",
- value: function hide() {
- this.setState({
- active: false
- });
- }
- }]);
-
- return DropDown;
- }(external_react_default.a.Component);
-
-
- // CONCATENATED MODULE: ./components/business/LinkEditor/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
- var LinkEditor_LinkEditor =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(LinkEditor, _React$Component);
-
- function LinkEditor() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, LinkEditor);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(LinkEditor)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- href: '',
- target: ''
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownComponent", null);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handeKeyDown", function (e) {
- if (e.keyCode === 13) {
- _this.handleConfirm();
-
- e.preventDefault();
- return false;
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "inputLink", function (e) {
- _this.setState({
- href: e.currentTarget.value
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setTarget", function () {
- _this.setState({
- target: _this.state.target === '_blank' ? '' : '_blank'
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleCancel", function () {
- _this.dropDownComponent.hide();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleUnlink", function () {
- _this.dropDownComponent.hide();
-
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLink(_this.props.editorState, false));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleConfirm", function () {
- var _this$state = _this.state,
- href = _this$state.href,
- target = _this$state.target;
-
- var hookReturns = _this.props.hooks('toggle-link', {
- href: href,
- target: target
- })({
- href: href,
- target: target
- });
-
- _this.dropDownComponent.hide();
-
- _this.props.editor.requestFocus();
-
- if (hookReturns === false) {
- return false;
- }
-
- if (hookReturns) {
- typeof hookReturns.href === 'string' && (href = hookReturns.href);
- typeof hookReturns.target === 'string' && (target = hookReturns.target);
- }
-
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLink(_this.props.editorState, href, target));
- });
-
- return _this;
- }
-
- createClass_default()(LinkEditor, [{
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(next) {
- var _ContentUtils$getSele = external_braft_utils_["ContentUtils"].getSelectionEntityData(next.editorState, 'LINK'),
- href = _ContentUtils$getSele.href,
- target = _ContentUtils$getSele.target;
-
- this.setState({
- href: href || '',
- target: target || ''
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this2 = this;
-
- var _this$state2 = this.state,
- href = _this$state2.href,
- target = _this$state2.target;
- var caption = external_react_default.a.createElement("i", {
- className: "bfi-link"
- });
- var textSelected = !external_braft_utils_["ContentUtils"].isSelectionCollapsed(this.props.editorState) && external_braft_utils_["ContentUtils"].getSelectionBlockType(this.props.editorState) !== 'atomic';
- return external_react_default.a.createElement("div", {
- className: "control-item-group"
- }, external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption,
- title: this.props.language.controls.link,
- autoHide: false,
- containerNode: this.props.containerNode,
- showArrow: false,
- disabled: !textSelected,
- ref: function ref(instance) {
- return _this2.dropDownComponent = instance;
- },
- className: 'control-item dropdown link-editor-dropdown'
- }, external_react_default.a.createElement("div", {
- className: "bf-link-editor"
- }, external_react_default.a.createElement("div", {
- className: "input-group"
- }, external_react_default.a.createElement("input", {
- type: "text",
- value: href,
- spellCheck: false,
- placeholder: this.props.language.linkEditor.inputPlaceHolder,
- onKeyDown: this.handeKeyDown,
- onChange: this.inputLink
- })), external_react_default.a.createElement("div", {
- className: "switch-group"
- }, external_react_default.a.createElement(Switch, {
- active: target === '_blank',
- onClick: this.setTarget
- }), external_react_default.a.createElement("label", null, this.props.language.linkEditor.openInNewWindow)), external_react_default.a.createElement("div", {
- className: "buttons"
- }, external_react_default.a.createElement("a", {
- onClick: this.handleUnlink,
- className: "primary pull-left",
- href: "javascript:void(0);"
- }, external_react_default.a.createElement("i", {
- className: "bfi-close"
- }), external_react_default.a.createElement("span", null, this.props.language.linkEditor.removeLink)), external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.handleConfirm,
- className: "primary pull-right"
- }, this.props.language.base.confirm), external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.handleCancel,
- className: "default pull-right"
- }, this.props.language.base.cancel)))), external_react_default.a.createElement("button", {
- type: "button",
- "data-title": this.props.language.controls.unlink,
- className: "control-item button",
- onClick: this.handleUnlink,
- disabled: !textSelected || !href
- }, external_react_default.a.createElement("i", {
- className: "bfi-link-off"
- })));
- }
- }]);
-
- return LinkEditor;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./components/business/Headings/style.scss
- var Headings_style = __webpack_require__(42);
-
- // CONCATENATED MODULE: ./configs/maps.js
-
- var maps_getHeadings = function getHeadings(lang) {
- return [{
- key: 'header-one',
- title: lang.controls.header + ' 1',
- text: external_react_default.a.createElement("h1", null, lang.controls.header, " 1"),
- type: 'block-type',
- command: 'header-one'
- }, {
- key: 'header-two',
- title: lang.controls.header + ' 2',
- text: external_react_default.a.createElement("h2", null, lang.controls.header, " 2"),
- type: 'block-type',
- command: 'header-two'
- }, {
- key: 'header-three',
- title: lang.controls.header + ' 3',
- text: external_react_default.a.createElement("h3", null, lang.controls.header, " 3"),
- type: 'block-type',
- command: 'header-three'
- }, {
- key: 'header-four',
- title: lang.controls.header + ' 4',
- text: external_react_default.a.createElement("h4", null, lang.controls.header, " 4"),
- type: 'block-type',
- command: 'header-four'
- }, {
- key: 'header-five',
- title: lang.controls.header + ' 5',
- text: external_react_default.a.createElement("h5", null, lang.controls.header, " 5"),
- type: 'block-type',
- command: 'header-five'
- }, {
- key: 'header-six',
- title: lang.controls.header + ' 6',
- text: external_react_default.a.createElement("h6", null, lang.controls.header, " 6"),
- type: 'block-type',
- command: 'header-six'
- }, {
- key: 'unstyled',
- title: lang.controls.normal,
- text: lang.controls.normal,
- type: 'block-type',
- command: 'unstyled'
- }];
- };
- var blocks = {
- 'header-one': 'h1',
- 'header-two': 'h2',
- 'header-three': 'h3',
- 'header-four': 'h4',
- 'header-fiv': 'h5',
- 'header-six': 'h6',
- 'unstyled': 'p',
- 'blockquote': 'blockquote'
- };
- // CONCATENATED MODULE: ./components/business/Headings/index.jsx
-
-
-
-
- /* harmony default export */ var Headings = (function (props) {
- var headings = maps_getHeadings(props.language);
- var currentHeadingIndex = headings.findIndex(function (item) {
- return item.command === props.current;
- });
- var caption = headings[currentHeadingIndex] ? headings[currentHeadingIndex].title : props.language.controls.normal;
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption,
- containerNode: props.containerNode,
- title: props.language.controls.headings,
- arrowActive: currentHeadingIndex === 0,
- className: 'control-item dropdown headings-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "menu"
- }, headings.map(function (item, index) {
- var isActive = props.current === item.command;
- return external_react_default.a.createElement("li", {
- key: index,
- className: 'menu-item' + (isActive ? ' active' : ''),
- onClick: function onClick() {
- return props.onChange(item.command, item.type);
- }
- }, item.text);
- })));
- });
- // EXTERNAL MODULE: ./components/business/TextColor/style.scss
- var TextColor_style = __webpack_require__(43);
-
- // EXTERNAL MODULE: ./components/common/ColorPicker/style.scss
- var ColorPicker_style = __webpack_require__(44);
-
- // CONCATENATED MODULE: ./components/common/ColorPicker/index.jsx
-
-
- /* harmony default export */ var ColorPicker = (function (props) {
- var current = props.current,
- colors = props.colors;
- return external_react_default.a.createElement("div", {
- className: "bf-colors-wrap"
- }, external_react_default.a.createElement("ul", {
- className: "bf-colors"
- }, colors.map(function (item, index) {
- var className = item === current ? 'color-item active' : 'color-item';
- return external_react_default.a.createElement("li", {
- key: index,
- title: item,
- className: className,
- style: {
- color: item
- },
- "data-color": item.replace('#', ''),
- onClick: function onClick(e) {
- return props.onChange(e.currentTarget.dataset.color);
- }
- });
- })));
- });
- // CONCATENATED MODULE: ./components/business/TextColor/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
- var TextColor_TextColor =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(TextColor, _React$Component);
-
- function TextColor() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, TextColor);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(TextColor)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- colorType: 'color'
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "dropDownComponentId", 'BRAFT-DROPDOWN-' + external_braft_utils_["BaseUtils"].UniqueIndex());
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "switchColorType", function (_ref) {
- var currentTarget = _ref.currentTarget;
-
- _this.setState({
- colorType: currentTarget.dataset.type
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "toggleColor", function (color) {
- var hookReturns = _this.props.hooks("toggle-text-".concat(_this.state.colorType), color)(color);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (typeof hookReturns === 'string') {
- color = hookReturns;
- }
-
- if (_this.state.colorType === 'color') {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionColor(_this.props.editorState, color, _this.props.colors));
- } else {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBackgroundColor(_this.props.editorState, color, _this.props.colors));
- }
-
- _this.dropDownComponent.hide();
-
- _this.props.editor.requestFocus();
- });
-
- return _this;
- }
-
- createClass_default()(TextColor, [{
- key: "render",
- value: function render() {
- var _this2 = this;
-
- var captionStyle = {};
- var currentColor = null;
- var colorType = this.state.colorType;
- this.props.colors.forEach(function (color) {
- var color_id = color.replace('#', '');
-
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(_this2.props.editorState, 'COLOR-' + color_id)) {
- captionStyle.color = color;
- colorType === 'color' && (currentColor = color);
- }
-
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(_this2.props.editorState, 'BGCOLOR-' + color_id)) {
- captionStyle.backgroundColor = color;
- colorType === 'background-color' && (currentColor = color);
- }
- });
- var caption = external_react_default.a.createElement("i", {
- style: captionStyle,
- className: "bfi-text-color"
- }, external_react_default.a.createElement("span", {
- className: "path1"
- }), external_react_default.a.createElement("span", {
- className: "path2"
- }));
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption,
- title: this.props.language.controls.color,
- showArrow: false,
- containerNode: this.props.containerNode,
- componentId: this.dropDownComponentId,
- ref: function ref(instance) {
- return _this2.dropDownComponent = instance;
- },
- className: 'control-item dropdown text-color-dropdown'
- }, external_react_default.a.createElement("div", {
- className: "bf-text-color-picker-wrap"
- }, external_react_default.a.createElement("div", {
- className: "bf-color-switch-buttons",
- style: this.props.enableBackgroundColor ? {} : {
- display: 'none'
- }
- }, external_react_default.a.createElement("button", {
- type: "button",
- "data-type": "color",
- "data-keep-active": true,
- "data-braft-component-id": this.dropDownComponentId,
- className: colorType === 'color' ? 'active' : '',
- onClick: this.switchColorType
- }, this.props.language.controls.textColor), external_react_default.a.createElement("button", {
- type: "button",
- "data-type": "background-color",
- "data-keep-active": true,
- "data-braft-component-id": this.dropDownComponentId,
- className: colorType === 'background-color' ? 'active' : '',
- onClick: this.switchColorType
- }, this.props.language.controls.backgroundColor)), external_react_default.a.createElement(ColorPicker, {
- width: 200,
- language: this.props.language,
- current: currentColor,
- disableAlpha: true,
- colors: this.props.colors,
- onChange: this.toggleColor
- })));
- }
- }]);
-
- return TextColor;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./components/business/FontSize/style.scss
- var FontSize_style = __webpack_require__(45);
-
- // CONCATENATED MODULE: ./components/business/FontSize/index.jsx
-
-
-
-
-
- var FontSize_toggleFontSize = function toggleFontSize(event, props) {
- var fontSize = event.currentTarget.dataset.size;
- var hookReturns = props.hooks('toggle-font-size', fontSize)(fontSize);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (!isNaN(fontSize)) {
- fontSize = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionFontSize(props.editorState, fontSize, props.fontSizes));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var FontSize = (function (props) {
- var caption = null;
- var currentFontSize = null;
- props.fontSizes.find(function (item) {
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'FONTSIZE-' + item)) {
- caption = item + 'px';
- currentFontSize = item;
- return true;
- }
-
- return false;
- });
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption || props.defaultCaption,
- containerNode: props.containerNode,
- title: props.language.controls.fontSize,
- className: 'control-item dropdown bf-font-size-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "bf-font-sizes"
- }, props.fontSizes.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- className: item === currentFontSize ? 'active' : null,
- "data-size": item,
- onClick: function onClick(event) {
- return FontSize_toggleFontSize(event, props);
- }
- }, item + 'px');
- })));
- });
- // EXTERNAL MODULE: ./components/business/LineHeight/style.scss
- var LineHeight_style = __webpack_require__(46);
-
- // CONCATENATED MODULE: ./components/business/LineHeight/index.jsx
-
-
-
-
-
- var LineHeight_toggleLineHeight = function toggleLineHeight(event, props) {
- var lineHeight = event.currentTarget.dataset.size;
- var hookReturns = props.hooks('toggle-line-height', lineHeight)(lineHeight);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (!isNaN(hookReturns)) {
- lineHeight = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLineHeight(props.editorState, lineHeight, props.lineHeights));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var LineHeight = (function (props) {
- var caption = null;
- var currentLineHeight = null;
- props.lineHeights.find(function (item) {
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'LINEHEIGHT-' + item)) {
- caption = item;
- currentLineHeight = item;
- return true;
- }
-
- return false;
- });
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption || props.defaultCaption,
- containerNode: props.containerNode,
- title: props.language.controls.lineHeight,
- className: 'control-item dropdown bf-line-height-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "bf-line-heights"
- }, props.lineHeights.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- className: item === currentLineHeight ? 'active' : null,
- "data-size": item,
- onClick: function onClick(event) {
- return LineHeight_toggleLineHeight(event, props);
- }
- }, item);
- })));
- });
- // EXTERNAL MODULE: ./components/business/FontFamily/style.scss
- var FontFamily_style = __webpack_require__(47);
-
- // CONCATENATED MODULE: ./components/business/FontFamily/index.jsx
-
-
-
-
-
- var FontFamily_toggleFontFamily = function toggleFontFamily(event, props) {
- var fontFamilyName = event.currentTarget.dataset.name;
- var hookReturns = props.hooks('toggle-font-family', fontFamilyName)(fontFamilyName, props.fontFamilies);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (typeof hookReturns === 'string') {
- fontFamilyName = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionFontFamily(props.editorState, fontFamilyName, props.fontFamilies));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var FontFamily = (function (props) {
- var caption = null;
- var currentIndex = null;
- props.fontFamilies.find(function (item, index) {
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'FONTFAMILY-' + item.name)) {
- caption = item.name;
- currentIndex = index;
- return true;
- }
-
- return false;
- });
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption || props.defaultCaption,
- containerNode: props.containerNode,
- title: props.language.controls.fontFamily,
- arrowActive: currentIndex === 0,
- className: 'control-item dropdown font-family-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "menu"
- }, props.fontFamilies.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- className: 'menu-item ' + (index === currentIndex ? 'active' : ''),
- "data-name": item.name,
- onClick: function onClick(event) {
- return FontFamily_toggleFontFamily(event, props);
- }
- }, external_react_default.a.createElement("span", {
- style: {
- fontFamily: item.family
- }
- }, item.name));
- })));
- });
- // CONCATENATED MODULE: ./components/business/TextAlign/index.jsx
-
-
-
-
-
-
-
-
-
-
- var TextAlign_TextAlign =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(TextAlign, _React$Component);
-
- function TextAlign() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, TextAlign);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(TextAlign)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "state", {
- currentAlignment: undefined
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setAlignment", function (event) {
- var alignment = event.currentTarget.dataset.alignment;
-
- var hookReturns = _this.props.hooks('toggle-text-alignment', alignment)(alignment);
-
- if (_this.props.textAligns.indexOf(hookReturns) > -1) {
- alignment = hookReturns;
- }
-
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionAlignment(_this.props.editorState, alignment));
-
- _this.props.editor.requestFocus();
- });
-
- return _this;
- }
-
- createClass_default()(TextAlign, [{
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(next) {
- this.setState({
- currentAlignment: external_braft_utils_["ContentUtils"].getSelectionBlockData(next.editorState, 'textAlign')
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this2 = this;
-
- var textAlignmentTitles = [this.props.language.controls.alignLeft, this.props.language.controls.alignCenter, this.props.language.controls.alignRight, this.props.language.controls.alignJustify];
- return external_react_default.a.createElement("div", {
- className: "control-item-group"
- }, this.props.textAligns.map(function (item, index) {
- return external_react_default.a.createElement("button", {
- type: "button",
- key: index,
- "data-title": textAlignmentTitles[index],
- "data-alignment": item,
- className: 'control-item button ' + (item === _this2.state.currentAlignment ? 'active' : null),
- onClick: _this2.setAlignment
- }, external_react_default.a.createElement("i", {
- className: 'bfi-align-' + item
- }));
- }));
- }
- }]);
-
- return TextAlign;
- }(external_react_default.a.Component);
-
-
- // EXTERNAL MODULE: ./components/business/EmojiPicker/style.scss
- var EmojiPicker_style = __webpack_require__(48);
-
- // CONCATENATED MODULE: ./components/business/EmojiPicker/index.jsx
-
-
-
-
-
- var EmojiPicker_insertEmoji = function insertEmoji(event, props) {
- var emoji = event.currentTarget.dataset.emoji;
- var hookReturns = props.hooks('insert-emoji', emoji)(emoji);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (typeof hookReturns === 'string') {
- emoji = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].insertText(props.editorState, emoji));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var EmojiPicker = (function (props) {
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: props.defaultCaption,
- showArrow: false,
- containerNode: props.containerNode,
- title: props.language.controls.emoji,
- className: 'control-item dropdown bf-emoji-dropdown'
- }, external_react_default.a.createElement("div", {
- className: "bf-emojis-wrap"
- }, external_react_default.a.createElement("ul", {
- className: "bf-emojis"
- }, props.emojis.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- "data-emoji": item,
- onClick: function onClick(event) {
- return EmojiPicker_insertEmoji(event, props);
- }
- }, item);
- }))));
- });
- // EXTERNAL MODULE: ./components/business/LetterSpacing/style.scss
- var LetterSpacing_style = __webpack_require__(49);
-
- // CONCATENATED MODULE: ./components/business/LetterSpacing/index.jsx
-
-
-
-
-
- var LetterSpacing_toggleLetterSpacing = function toggleLetterSpacing(event, props) {
- var letterSpacing = event.currentTarget.dataset.size;
- var hookReturns = props.hooks('toggle-letter-spacing', letterSpacing)(letterSpacing);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (!isNaN(hookReturns)) {
- letterSpacing = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionLetterSpacing(props.editorState, letterSpacing, props.letterSpacings));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var LetterSpacing = (function (props) {
- var caption = null;
- var currentLetterSpacing = null;
- props.letterSpacings.find(function (item) {
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'LETTERSPACING-' + item)) {
- caption = item;
- currentLetterSpacing = item;
- return true;
- }
-
- return false;
- });
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption || props.defaultCaption,
- containerNode: props.containerNode,
- title: props.language.controls.letterSpacing,
- className: 'control-item dropdown bf-letter-spacing-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "bf-letter-spacings"
- }, props.letterSpacings.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- className: item === currentLetterSpacing ? 'active' : null,
- "data-size": item,
- onClick: function onClick(event) {
- return LetterSpacing_toggleLetterSpacing(event, props);
- }
- }, item);
- })));
- });
- // EXTERNAL MODULE: ./components/business/TextIndent/style.scss
- var TextIndent_style = __webpack_require__(50);
-
- // CONCATENATED MODULE: ./components/business/TextIndent/index.jsx
-
-
-
-
-
- var TextIndent_toggleTextIndent = function toggleTextIndent(event, props) {
- var textIndent = event.currentTarget.dataset.size;
- var hookReturns = props.hooks('toggle-text-indent', textIndent)(textIndent);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (!isNaN(hookReturns)) {
- textIndent = hookReturns;
- }
-
- props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionIndent(props.editorState, textIndent, props.textIndents));
- props.editor.requestFocus();
- };
-
- /* harmony default export */ var TextIndent = (function (props) {
- var caption = null;
- var currentIndent = null;
- props.textIndents.find(function (item) {
- if (external_braft_utils_["ContentUtils"].selectionHasInlineStyle(props.editorState, 'INDENT-' + item)) {
- caption = item;
- currentIndent = item;
- return true;
- }
-
- return false;
- });
- return external_react_default.a.createElement(DropDown_DropDown, {
- caption: caption || props.defaultCaption,
- containerNode: props.containerNode,
- title: props.language.controls.textIndent,
- className: 'control-item dropdown bf-indent-dropdown'
- }, external_react_default.a.createElement("ul", {
- className: "bf-text-indents"
- }, props.textIndents.map(function (item, index) {
- return external_react_default.a.createElement("li", {
- key: index,
- className: item === currentIndent ? 'active' : null,
- "data-size": item,
- onClick: function onClick(event) {
- return TextIndent_toggleTextIndent(event, props);
- }
- }, item);
- })));
- });
- // EXTERNAL MODULE: ./components/common/Modal/style.scss
- var Modal_style = __webpack_require__(51);
-
- // EXTERNAL MODULE: external "react-dom"
- var external_react_dom_ = __webpack_require__(14);
- var external_react_dom_default = /*#__PURE__*/__webpack_require__.n(external_react_dom_);
-
- // CONCATENATED MODULE: ./components/common/Modal/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
- var Modal_Modal =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(Modal, _React$Component);
-
- function Modal(props) {
- var _this;
-
- classCallCheck_default()(this, Modal);
-
- _this = possibleConstructorReturn_default()(this, getPrototypeOf_default()(Modal).call(this, props));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleTransitionEnd", function () {
- if (!_this.rootElement || !_this.rootElement.classList) {
- return false;
- }
-
- if (!_this.rootElement.classList.contains('active')) {
- external_react_dom_default.a.unmountComponentAtNode(_this.rootElement) && _this.rootElement.parentNode.removeChild(_this.rootElement);
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleCancel", function () {
- _this.props.closeOnCancel && _this.close();
- _this.props.onCancel && _this.props.onCancel();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleConfirm", function () {
- _this.props.closeOnConfirm && _this.close();
- _this.props.onConfirm && _this.props.onConfirm();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "close", function () {
- _this.unrenderComponent();
-
- _this.props.onClose && _this.props.onClose();
- });
-
- _this.active = false;
- _this.componentId = 'BRAFT-MODAL-' + external_braft_utils_["BaseUtils"].UniqueIndex();
- return _this;
- }
-
- createClass_default()(Modal, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- if (this.props.visible) {
- this.active = true;
- this.renderComponent(this.props);
- }
- }
- }, {
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(next) {
- if (this.props.visible && !next.visible) {
- this.unrenderComponent();
- } else if (this.props.visible || next.visible) {
- this.active = true;
- this.renderComponent(next);
- }
- }
- }, {
- key: "render",
- value: function render() {
- return null;
- }
- }, {
- key: "unrenderComponent",
- value: function unrenderComponent() {
- this.active = false;
- this.activeId && window.clearImmediate(this.activeId);
-
- if (this.rootElement && this.rootElement.classList) {
- this.rootElement.classList.remove('active');
- }
- }
- }, {
- key: "renderComponent",
- value: function renderComponent(props) {
- var _this2 = this;
-
- if (!this.active) {
- return false;
- }
-
- var title = props.title,
- className = props.className,
- width = props.width,
- height = props.height,
- children = props.children,
- confirmable = props.confirmable,
- showFooter = props.showFooter,
- showCancel = props.showCancel,
- showConfirm = props.showConfirm,
- showClose = props.showClose,
- cancelText = props.cancelText,
- confirmText = props.confirmText,
- bottomText = props.bottomText,
- language = props.language;
- typeof showCancel === 'undefined' && (showCancel = true);
- typeof showClose === 'undefined' && (showClose = true);
- typeof showConfirm === 'undefined' && (showConfirm = true);
- var childComponent = external_react_default.a.createElement("div", {
- className: 'bf-modal ' + (className || '')
- }, external_react_default.a.createElement("div", {
- className: "bf-modal-mask"
- }), external_react_default.a.createElement("div", {
- onTransitionEnd: this.handleTransitionEnd,
- style: {
- width: width,
- height: height
- },
- className: "bf-modal-content"
- }, external_react_default.a.createElement("div", {
- className: "bf-modal-header"
- }, external_react_default.a.createElement("h3", {
- className: "bf-modal-caption"
- }, title), showClose && external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.close,
- className: "bf-modal-close-button"
- }, external_react_default.a.createElement("i", {
- className: "bf-icon-close"
- }))), external_react_default.a.createElement("div", {
- className: "bf-modal-body"
- }, children), showFooter ? external_react_default.a.createElement("div", {
- className: "bf-modal-footer"
- }, external_react_default.a.createElement("div", {
- className: "bf-modal-addon-text"
- }, bottomText), external_react_default.a.createElement("div", {
- className: "bf-modal-buttons"
- }, showCancel && external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.handleCancel,
- className: "bf-modal-cancel"
- }, cancelText || language.base.cancel), showConfirm && external_react_default.a.createElement("button", {
- type: "button",
- onClick: this.handleConfirm,
- className: 'bf-modal-confirm ' + (!confirmable ? 'disabled' : '')
- }, confirmText || language.base.confirm))) : null));
- this.rootElement = document.querySelector('#' + this.componentId);
-
- if (!this.rootElement) {
- this.rootElement = document.createElement('div');
- this.rootElement.id = this.componentId;
- this.rootElement.className = 'bf-modal-root';
- document.body.appendChild(this.rootElement);
- }
-
- external_react_dom_default.a.render(childComponent, this.rootElement);
- this.activeId = window.setImmediate(function () {
- _this2.rootElement.classList.add('active');
- });
- }
- }]);
-
- return Modal;
- }(external_react_default.a.Component);
-
- defineProperty_default()(Modal_Modal, "defaultProps", {
- showFooter: true
- });
-
-
- var Modal_showModal = function showModal(props) {
- var hostNode = document.createElement('div');
- hostNode.style.display = 'none';
- document.body.appendChild(hostNode);
-
- var close = function close() {
- external_react_dom_default.a.unmountComponentAtNode(hostNode) && hostNode.parentNode.removeChild(hostNode);
- };
-
- var onConfirm = function onConfirm() {
- close();
- props.onConfirm && props.onConfirm();
- };
-
- var onCancel = function onCancel() {
- close();
- props.onCancel && props.onCancel();
- };
-
- var onClose = function onClose() {
- close();
- props.onClose && props.onClose();
- };
-
- var extProps = {
- onConfirm: onConfirm,
- onCancel: onCancel,
- onClose: onClose,
- visible: true,
- closeOnConfirm: true,
- closeOnCancel: true
- };
- var modalInstance = external_react_dom_default.a.render(external_react_default.a.createElement(Modal_Modal, extends_default()({}, props, extProps)), hostNode);
- modalInstance.destroy = close;
- modalInstance.update = modalInstance.renderComponent;
- return modalInstance;
- };
- // CONCATENATED MODULE: ./components/business/ControlBar/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var commandHookMap = {
- 'inline-style': 'toggle-inline-style',
- 'block-type': 'change-block-type',
- 'editor-method': 'exec-editor-command'
- };
-
- var ControlBar_ControlBar =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(ControlBar, _React$Component);
-
- function ControlBar() {
- var _getPrototypeOf2;
-
- var _this;
-
- classCallCheck_default()(this, ControlBar);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = possibleConstructorReturn_default()(this, (_getPrototypeOf2 = getPrototypeOf_default()(ControlBar)).call.apply(_getPrototypeOf2, [this].concat(args)));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "mediaLibiraryModal", null);
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "extendedModals", {});
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "openBraftFinder", function () {
- if (!_this.props.braftFinder || !_this.props.braftFinder.ReactComponent) {
- return false;
- }
-
- if (_this.props.hooks('open-braft-finder')() === false) {
- return false;
- }
-
- var mediaProps = _this.props.media;
- var MediaLibrary = _this.props.braftFinder.ReactComponent;
- _this.mediaLibiraryModal = Modal_showModal({
- title: _this.props.language.controls.mediaLibirary,
- language: _this.props.language,
- width: 640,
- showFooter: false,
- children: external_react_default.a.createElement(MediaLibrary, {
- onCancel: _this.closeBraftFinder,
- onInsert: _this.insertMedias,
- onChange: mediaProps.onChange,
- externals: mediaProps.externals,
- onBeforeSelect: _this.bindBraftFinderHook('select-medias'),
- onBeforeDeselect: _this.bindBraftFinderHook('deselect-medias'),
- onBeforeRemove: _this.bindBraftFinderHook('remove-medias'),
- onBeforeInsert: _this.bindBraftFinderHook('insert-medias'),
- onFileSelect: _this.bindBraftFinderHook('select-files')
- })
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "bindBraftFinderHook", function (hookName) {
- return function () {
- return _this.props.hooks(hookName, arguments.length <= 0 ? undefined : arguments[0]).apply(void 0, arguments);
- };
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "insertMedias", function (medias) {
- _this.props.editor.setValue(external_braft_utils_["ContentUtils"].insertMedias(_this.props.editorState, medias));
-
- _this.props.editor.requestFocus();
-
- _this.props.media.onInsert && _this.props.media.onInsert(medias);
-
- _this.closeBraftFinder();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "closeBraftFinder", function () {
- _this.props.media.onCancel && _this.props.media.onCancel();
- _this.mediaLibiraryModal && _this.mediaLibiraryModal.close();
- });
-
- return _this;
- }
-
- createClass_default()(ControlBar, [{
- key: "componentDidUpdate",
- value: function componentDidUpdate() {
- var _this2 = this;
-
- var _this$props = this.props,
- controls = _this$props.controls,
- language = _this$props.language;
- controls.forEach(function (item) {
- if (item.type === 'modal') {
- if (item.modal && item.modal.id && _this2.extendedModals[item.modal.id]) {
- _this2.extendedModals[item.modal.id].update(objectSpread_default()({}, item.modal, {
- language: language
- }));
- }
- }
- });
- }
- }, {
- key: "getControlItemClassName",
- value: function getControlItemClassName(data) {
- var className = 'control-item button';
- var type = data.type,
- command = data.command;
-
- if (type === 'inline-style' && external_braft_utils_["ContentUtils"].selectionHasInlineStyle(this.props.editorState, command)) {
- className += ' active';
- } else if (type === 'block-type' && external_braft_utils_["ContentUtils"].getSelectionBlockType(this.props.editorState) === command) {
- className += ' active';
- }
-
- return className;
- }
- }, {
- key: "applyControl",
- value: function applyControl(command, type) {
- var hookReturns = this.props.hooks(commandHookMap[type] || type, command)(command);
-
- if (hookReturns === false) {
- return false;
- }
-
- if (typeof hookReturns === 'string') {
- command = hookReturns;
- }
-
- if (type === 'inline-style') {
- this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionInlineStyle(this.props.editorState, command));
- } else if (type === 'block-type') {
- this.props.editor.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(this.props.editorState, command));
- } else if (type === 'editor-method') {
- this.props.editor[command] && this.props.editor[command]();
- }
-
- this.props.editor.requestFocus();
- }
- }, {
- key: "render",
- value: function render() {
- var _this3 = this;
-
- var _this$props2 = this.props,
- editor = _this$props2.editor,
- editorState = _this$props2.editorState,
- controls = _this$props2.controls,
- media = _this$props2.media,
- extendControls = _this$props2.extendControls,
- language = _this$props2.language,
- hooks = _this$props2.hooks,
- colors = _this$props2.colors,
- fontSizes = _this$props2.fontSizes,
- fontFamilies = _this$props2.fontFamilies,
- emojis = _this$props2.emojis,
- containerNode = _this$props2.containerNode,
- lineHeights = _this$props2.lineHeights,
- letterSpacings = _this$props2.letterSpacings,
- textAligns = _this$props2.textAligns,
- textBackgroundColor = _this$props2.textBackgroundColor,
- textIndents = _this$props2.textIndents;
- var currentBlockType = external_braft_utils_["ContentUtils"].getSelectionBlockType(editorState);
- var editorControls = configs_controls(language);
- var commonProps = {
- editor: editor,
- editorState: editorState,
- language: language,
- containerNode: containerNode,
- hooks: hooks
- };
- var renderedControls = [];
- return external_react_default.a.createElement("div", {
- className: "bf-controlbar"
- }, toConsumableArray_default()(controls).concat(toConsumableArray_default()(extendControls)).map(function (item, index) {
- var itemKey = typeof item === 'string' ? item : item.key;
-
- if (typeof itemKey !== 'string') {
- return null;
- }
-
- if (renderedControls.indexOf(itemKey) > -1) {
- return null;
- }
-
- if (itemKey.toLowerCase() === 'separator') {
- return external_react_default.a.createElement("span", {
- key: index,
- className: "separator-line"
- });
- }
-
- var controlItem = editorControls.find(function (subItem) {
- return subItem.key.toLowerCase() === itemKey.toLowerCase();
- });
-
- if (typeof item !== 'string') {
- controlItem = objectSpread_default()({}, controlItem, item);
- }
-
- if (!controlItem) {
- return null;
- }
-
- renderedControls.push(itemKey);
-
- if (controlItem.type === 'headings') {
- return external_react_default.a.createElement(Headings, extends_default()({
- key: index,
- current: currentBlockType,
- onChange: function onChange(command) {
- return _this3.applyControl(command, 'block-type');
- }
- }, commonProps));
- } else if (controlItem.type === 'text-color') {
- return external_react_default.a.createElement(TextColor_TextColor, extends_default()({
- key: index,
- colors: colors,
- enableBackgroundColor: textBackgroundColor
- }, commonProps));
- } else if (controlItem.type === 'font-size') {
- return external_react_default.a.createElement(FontSize, extends_default()({
- key: index,
- fontSizes: fontSizes,
- defaultCaption: controlItem.title
- }, commonProps));
- } else if (controlItem.type === 'line-height') {
- return external_react_default.a.createElement(LineHeight, extends_default()({
- key: index,
- lineHeights: lineHeights,
- defaultCaption: controlItem.title
- }, commonProps));
- } else if (controlItem.type === 'letter-spacing') {
- return external_react_default.a.createElement(LetterSpacing, extends_default()({
- key: index,
- letterSpacings: letterSpacings,
- defaultCaption: controlItem.title
- }, commonProps));
- } else if (controlItem.type === 'text-indent') {
- return external_react_default.a.createElement(TextIndent, extends_default()({
- key: index,
- textIndents: textIndents,
- defaultCaption: controlItem.title
- }, commonProps));
- } else if (controlItem.type === 'font-family') {
- return external_react_default.a.createElement(FontFamily, extends_default()({
- key: index,
- fontFamilies: fontFamilies,
- defaultCaption: controlItem.title
- }, commonProps));
- } else if (controlItem.type === 'emoji') {
- return external_react_default.a.createElement(EmojiPicker, extends_default()({
- key: index,
- emojis: emojis,
- defaultCaption: controlItem.text
- }, commonProps));
- } else if (controlItem.type === 'link') {
- return external_react_default.a.createElement(LinkEditor_LinkEditor, extends_default()({
- key: index
- }, commonProps));
- } else if (controlItem.type === 'text-align') {
- return external_react_default.a.createElement(TextAlign_TextAlign, extends_default()({
- key: index,
- textAligns: textAligns
- }, commonProps));
- } else if (controlItem.type === 'media') {
- if (!media.image && !media.video && !media.audio) {
- return null;
- }
-
- return external_react_default.a.createElement("button", {
- type: "button",
- key: index,
- "data-title": controlItem.title,
- className: "control-item media button",
- onClick: _this3.openBraftFinder
- }, controlItem.text);
- } else if (controlItem.type === 'dropdown') {
- return external_react_default.a.createElement(DropDown_DropDown, {
- key: index,
- className: 'control-item extend-control-item dropdown ' + controlItem.className,
- caption: controlItem.text,
- htmlCaption: controlItem.html,
- showArrow: controlItem.showArrow,
- containerNode: controlItem.containerNode,
- title: controlItem.title,
- arrowActive: controlItem.arrowActive,
- autoHide: controlItem.autoHide,
- disabled: controlItem.disabled,
- ref: controlItem.ref
- }, controlItem.component);
- } else if (controlItem.type === 'modal') {
- return external_react_default.a.createElement("button", {
- type: "button",
- key: index,
- "data-title": controlItem.title,
- className: 'control-item extend-control-item button ' + controlItem.className,
- dangerouslySetInnerHTML: controlItem.html ? {
- __html: controlItem.html
- } : null,
- onClick: function onClick(event) {
- if (controlItem.modal && controlItem.modal.id) {
- if (_this3.extendedModals[controlItem.modal.id]) {
- _this3.extendedModals[controlItem.modal.id].active = true;
-
- _this3.extendedModals[controlItem.modal.id].update(objectSpread_default()({}, controlItem.modal, {
- language: language
- }));
- } else {
- _this3.extendedModals[controlItem.modal.id] = Modal_showModal(objectSpread_default()({}, controlItem.modal, {
- language: language
- }));
- controlItem.modal.onCreate && controlItem.modal.onCreate(_this3.extendedModals[controlItem.modal.id]);
- }
- }
-
- controlItem.onClick && controlItem.onClick(event);
- }
- }, !controlItem.html ? controlItem.text : null);
- } else if (controlItem.type === 'component') {
- return external_react_default.a.createElement("div", {
- key: index,
- className: 'control-item component-wrapper ' + controlItem.className
- }, controlItem.component);
- } else if (controlItem.type === 'button') {
- return external_react_default.a.createElement("button", {
- type: "button",
- key: index,
- "data-title": controlItem.title,
- className: 'control-item button ' + controlItem.className,
- dangerouslySetInnerHTML: controlItem.html ? {
- __html: controlItem.html
- } : null,
- onClick: function onClick(event) {
- return controlItem.onClick && controlItem.onClick(event);
- }
- }, !controlItem.html ? controlItem.text : null);
- } else {
- return external_react_default.a.createElement("button", {
- type: "button",
- key: index,
- "data-title": controlItem.title,
- className: _this3.getControlItemClassName({
- type: controlItem.type,
- command: controlItem.command
- }),
- onClick: function onClick() {
- return _this3.applyControl(controlItem.command, controlItem.type);
- }
- }, controlItem.text);
- }
- }));
- }
- }]);
-
- return ControlBar;
- }(external_react_default.a.Component);
-
-
- // CONCATENATED MODULE: ./editor/index.jsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var buildHooks = function buildHooks(hooks) {
- return function (hookName) {
- var defaultReturns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- return hooks[hookName] || function () {
- return defaultReturns;
- };
- };
- };
-
- var editorDecorators = new external_draft_js_["CompositeDecorator"](renderers_decorators);
-
- var editor_BraftEditor =
- /*#__PURE__*/
- function (_React$Component) {
- inherits_default()(BraftEditor, _React$Component);
-
- function BraftEditor(props) {
- var _this;
-
- classCallCheck_default()(this, BraftEditor);
-
- _this = possibleConstructorReturn_default()(this, getPrototypeOf_default()(BraftEditor).call(this, props));
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onChange", function (editorState) {
- _this.setState({
- editorState: editorState
- }, function () {
- _this.props.onChange && _this.props.onChange(editorState);
- });
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getDraftInstance", function () {
- return _this.draftInstance;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getFinderInstance", function () {
- return _this.braftFinder;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "getValue", function () {
- return _this.state.editorState;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setValue", function (editorState) {
- return _this.onChange(editorState);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "forceRender", function () {
- return _this.setValue(external_braft_utils_["ContentUtils"].createEditorState(_this.state.editorState.getCurrentContent(), editorDecorators));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onTab", function (event) {
- if (external_braft_utils_["ContentUtils"].getSelectionBlockType(_this.state.editorState) === 'code-block') {
- _this.setValue(external_braft_utils_["ContentUtils"].insertText(_this.state.editorState, ' '.repeat(_this.props.tabIndents)));
-
- event.preventDefault();
- return false;
- }
-
- _this.props.onTab && _this.props.onTab(event);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onFocus", function () {
- _this.isFocused = true;
- _this.props.onFocus && _this.props.onFocus();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "onBlur", function () {
- _this.isFocused = false;
- _this.props.onBlur && _this.props.onBlur();
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "requestFocus", function () {
- setTimeout(function () {
- return _this.draftInstance.focus();
- }, 0);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleKeyCommand", function (command) {
- if (command === 'braft-save') {
- _this.props.onSave && _this.props.onSave();
- return 'handled';
- }
-
- var nextEditorState = external_braft_utils_["ContentUtils"].handleKeyCommand(_this.state.editorState, command);
-
- if (nextEditorState) {
- _this.setValue(nextEditorState);
-
- return 'handled';
- }
-
- return 'not-handled';
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleReturn", function (event) {
- var currentBlock = external_braft_utils_["ContentUtils"].getSelectionBlock(_this.state.editorState);
- var currentBlockType = currentBlock.getType();
-
- if (currentBlockType === 'unordered-list-item' || currentBlockType === 'ordered-list-item') {
- if (currentBlock.getLength() === 0) {
- _this.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(_this.state.editorState, 'unstyled'));
-
- return 'handled';
- }
-
- return 'not-handled';
- } else if (currentBlockType === 'code-block') {
- if (event.which === 13 && (event.getModifierState('Shift') || event.getModifierState('Alt') || event.getModifierState('Control'))) {
- _this.setValue(external_braft_utils_["ContentUtils"].toggleSelectionBlockType(_this.state.editorState, 'unstyled'));
-
- return 'handled';
- }
-
- return 'not-handled';
- } else {
- var nextEditorState = external_braft_utils_["ContentUtils"].handleNewLine(_this.state.editorState, event);
-
- if (nextEditorState) {
- _this.setValue(nextEditorState);
-
- return 'handled';
- }
-
- return 'not-handled';
- }
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDrop", function (selectionState, dataTransfer) {
- if (window && window.__BRAFT_DRAGING__IMAGE__) {
- var editorState = external_braft_utils_["ContentUtils"].removeBlock(_this.state.editorState, window.__BRAFT_DRAGING__IMAGE__.block, selectionState);
- editorState = external_braft_utils_["ContentUtils"].insertMedias(editorState, [window.__BRAFT_DRAGING__IMAGE__.mediaData]);
- window.__BRAFT_DRAGING__IMAGE__ = null;
-
- _this.setDraftProps({
- readOnly: false
- });
-
- _this.setValue(editorState);
-
- return 'handled';
- } else if (!dataTransfer || !dataTransfer.getText()) {
- return 'handled';
- }
-
- return 'not-handled';
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handleDroppedFiles", function (selectionState, files) {
- return _this.resolveFiles(files);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handlePastedFiles", function (files) {
- return _this.resolveFiles(files);
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "handlePastedText", function (text, htmlString) {
- if (!htmlString || _this.props.stripPastedStyles) {
- return false;
- }
-
- var tempColors = external_braft_utils_["ColorUtils"].detectColorsFromHTMLString(htmlString);
-
- _this.setState({
- tempColors: toConsumableArray_default()(_this.state.tempColors).concat(toConsumableArray_default()(tempColors)).filter(function (item) {
- return _this.props.colors.indexOf(item) === -1;
- }).filter(function (item, index, array) {
- return array.indexOf(item) === index;
- })
- }, function () {
- _this.setValue(external_braft_utils_["ContentUtils"].insertHTML(_this.state.editorState, htmlString));
- });
-
- return true;
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "resolveFiles", function (files) {
- if (files[0] && files[0].type.indexOf('image') > -1 && _this.props.media && _this.props.media.pasteImage) {
- _this.braftFinder.uploadImage(files[0], function (image) {
- _this.setValue(external_braft_utils_["ContentUtils"].insertMedias(_this.state.editorState, [image]));
- });
-
- return 'handled';
- }
-
- return 'not-handled';
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "undo", function () {
- _this.setValue(external_braft_utils_["ContentUtils"].undo(_this.state.editorState));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "redo", function () {
- _this.setValue(external_braft_utils_["ContentUtils"].redo(_this.state.editorState));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "removeSelectionInlineStyles", function () {
- _this.setValue(external_braft_utils_["ContentUtils"].removeSelectionInlineStyles(_this.state.editorState));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "insertHorizontalLine", function () {
- _this.setValue(external_braft_utils_["ContentUtils"].insertHorizontalLine(_this.state.editorState));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "clearEditorContent", function () {
- _this.setValue(external_braft_utils_["ContentUtils"].clear(_this.state.editorState));
- });
-
- defineProperty_default()(assertThisInitialized_default()(assertThisInitialized_default()(_this)), "setEditorContainerNode", function (containerNode) {
- _this.setState({
- containerNode: containerNode
- }, _this.forceRender);
- });
-
- _this.isFocused = false;
- _this.keyBindingFn = keybindings(props.customKeyBindingFn);
- _this.blockStyleFn = getBlockStyleFn(props.blockStyleFn);
- _this.blockRenderMap = external_draft_js_["DefaultDraftBlockRenderMap"].merge(customBlockRenderMap);
-
- if (props.blockRenderMapFn) {
- _this.blockRenderMap = props.blockRenderMapFn(_this.blockRenderMap);
- }
-
- _this.braftFinder = null;
- var defaultEditorState = external_braft_utils_["ContentUtils"].isEditorState(props.defaultValue) ? props.defaultValue : external_braft_utils_["ContentUtils"].createEmptyEditorState(editorDecorators);
- _this.state = {
- containerNode: null,
- tempColors: [],
- editorState: defaultEditorState,
- draftProps: {}
- };
- return _this;
- }
-
- createClass_default()(BraftEditor, [{
- key: "componentWillMount",
- value: function componentWillMount() {
- var _this$props = this.props,
- controls = _this$props.controls,
- extendControls = _this$props.extendControls;
-
- if (toConsumableArray_default()(controls).concat(toConsumableArray_default()(extendControls)).find(function (item) {
- return item === 'media' || item.key === 'media';
- })) {
- this.braftFinder = new external_braft_finder_default.a({
- language: this.props.language,
- uploader: this.props.media.uploadFn,
- validator: this.props.media.validateFn
- });
- this.forceUpdate();
- }
- }
- }, {
- key: "componentDidMount",
- value: function componentDidMount() {
- var editorState = this.props.value;
-
- if (external_braft_utils_["ContentUtils"].isEditorState(editorState)) {
- this.setState({
- editorState: editorState
- });
- } else if (editorState) {// console.warn('')
- }
- }
- }, {
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(nextProps) {
- var editorState = nextProps.value;
-
- if (external_braft_utils_["ContentUtils"].isEditorState(editorState)) {
- this.setState({
- editorState: editorState
- });
- } else if (editorState) {// console.warn('')
- }
- }
- }, {
- key: "render",
- value: function render() {
- var _this2 = this;
-
- var _this$props2 = this.props,
- controls = _this$props2.controls,
- excludeControls = _this$props2.excludeControls,
- extendControls = _this$props2.extendControls,
- disabled = _this$props2.disabled,
- media = _this$props2.media,
- language = _this$props2.language,
- colors = _this$props2.colors,
- hooks = _this$props2.hooks,
- fontSizes = _this$props2.fontSizes,
- fontFamilies = _this$props2.fontFamilies,
- emojis = _this$props2.emojis,
- placeholder = _this$props2.placeholder,
- imageControls = _this$props2.imageControls,
- lineHeights = _this$props2.lineHeights,
- letterSpacings = _this$props2.letterSpacings,
- textIndents = _this$props2.textIndents,
- textAligns = _this$props2.textAligns,
- textBackgroundColor = _this$props2.textBackgroundColor,
- extendAtomics = _this$props2.extendAtomics,
- className = _this$props2.className,
- style = _this$props2.style,
- controlBarClassName = _this$props2.controlBarClassName,
- controlBarStyle = _this$props2.controlBarStyle,
- contentClassName = _this$props2.contentClassName,
- contentStyle = _this$props2.contentStyle,
- stripPastedStyles = _this$props2.stripPastedStyles,
- componentBelowControlBar = _this$props2.componentBelowControlBar;
- hooks = buildHooks(hooks);
- controls = controls.filter(function (item) {
- return excludeControls.indexOf(item) === -1;
- });
- language = languages[language] || languages[configs_props.language];
- var externalMedias = media && media.externals ? objectSpread_default()({}, configs_props.media.externals, media.externals) : configs_props.media.externals;
- media = objectSpread_default()({}, configs_props.media, media, {
- externalMedias: externalMedias
- });
-
- if (!media.uploadFn) {
- media.video = false;
- media.audio = false;
- }
-
- var controlBarProps = {
- editor: this,
- editorState: this.state.editorState,
- braftFinder: this.braftFinder,
- ref: function ref(instance) {
- return _this2.controlBarInstance = instance;
- },
- containerNode: this.state.containerNode,
- className: controlBarClassName,
- style: controlBarStyle,
- hooks: hooks,
- colors: toConsumableArray_default()(colors).concat(toConsumableArray_default()(this.state.tempColors)),
- media: media,
- controls: controls,
- language: language,
- extendControls: extendControls,
- fontSizes: fontSizes,
- fontFamilies: fontFamilies,
- emojis: emojis,
- lineHeights: lineHeights,
- letterSpacings: letterSpacings,
- textIndents: textIndents,
- textAligns: textAligns,
- textBackgroundColor: textBackgroundColor
- };
- var blockRendererFn = getBlockRendererFn({
- editor: this,
- hooks: hooks,
- editorState: this.state.editorState,
- containerNode: this.state.containerNode,
- imageControls: imageControls,
- language: language,
- extendAtomics: extendAtomics
- }, this.props.blockRendererFn);
- var customStyleMap = getCustomStyleMap({
- colors: toConsumableArray_default()(colors).concat(toConsumableArray_default()(this.state.tempColors)),
- fontSizes: fontSizes,
- fontFamilies: fontFamilies,
- lineHeights: lineHeights,
- letterSpacings: letterSpacings,
- textIndents: textIndents
- }, this.props.customStyleMap);
-
- var draftProps = objectSpread_default()({
- ref: function ref(instance) {
- _this2.draftInstance = instance;
- },
- editorState: this.state.editorState,
- handleKeyCommand: this.handleKeyCommand,
- handleReturn: this.handleReturn,
- handleDrop: this.handleDrop,
- handleDroppedFiles: this.handleDroppedFiles,
- handlePastedText: this.handlePastedText,
- handlePastedFiles: this.handlePastedFiles,
- onChange: this.onChange,
- onTab: this.onTab,
- onFocus: this.onFocus,
- onBlur: this.onBlur,
- readOnly: disabled,
- blockRenderMap: this.blockRenderMap,
- blockStyleFn: this.blockStyleFn,
- keyBindingFn: this.keyBindingFn,
- customStyleMap: customStyleMap,
- blockRendererFn: blockRendererFn,
- placeholder: placeholder,
- stripPastedStyles: stripPastedStyles
- }, this.props.draftProps, this.state.draftProps);
-
- return external_react_default.a.createElement("div", {
- ref: this.setEditorContainerNode,
- className: "bf-container ".concat(className, " ").concat(disabled ? 'disabled' : ''),
- style: style
- }, external_react_default.a.createElement(ControlBar_ControlBar, controlBarProps), componentBelowControlBar, external_react_default.a.createElement("div", {
- className: "bf-content ".concat(contentClassName),
- style: contentStyle
- }, external_react_default.a.createElement(external_draft_js_["Editor"], draftProps)));
- }
- }, {
- key: "setDraftProps",
- value: function setDraftProps(draftProps) {
- this.setState({
- draftProps: objectSpread_default()({}, this.state.draftProps, draftProps)
- });
- }
- }]);
-
- return BraftEditor;
- }(external_react_default.a.Component);
-
- defineProperty_default()(editor_BraftEditor, "defaultProps", configs_props);
-
-
- // EXTERNAL MODULE: external "braft-convert"
- var external_braft_convert_ = __webpack_require__(13);
-
- // CONCATENATED MODULE: ./index.jsx
- /* concated harmony reexport EditorState */__webpack_require__.d(__webpack_exports__, "EditorState", function() { return external_draft_js_["EditorState"]; });
- /* concated harmony reexport editorDecorators */__webpack_require__.d(__webpack_exports__, "editorDecorators", function() { return editorDecorators; });
-
-
-
- // 为EditorState对象增加toHTML原型方法,用于将editorState转换成HTML字符串
-
- external_draft_js_["EditorState"].prototype.toHTML = function () {
- return Object(external_braft_convert_["convertEditorStateToHTML"])(this);
- }; // 为EditorState对象增加toRAW原型方法,用于将editorState转换成RAW JSON对象或RAW JSON字符串
-
-
- external_draft_js_["EditorState"].prototype.toRAW = function (noStringify) {
- return noStringify ? Object(external_braft_convert_["convertEditorStateToRaw"])(this) : JSON.stringify(Object(external_braft_convert_["convertEditorStateToRaw"])(this));
- }; // 为EditorState对象增加新的静态方法,用于从raw或者html内容创建ediorState
-
-
- external_draft_js_["EditorState"].createFrom = function (content, options) {
- if (typeof_default()(content) === 'object' && content && content.blocks && content.entityMap) {
- return Object(external_braft_convert_["convertRawToEditorState"])(content, editorDecorators);
- } else if (typeof content === 'string') {
- try {
- return external_draft_js_["EditorState"].createFrom(JSON.parse(content), options);
- } catch (error) {
- return Object(external_braft_convert_["convertHTMLToEditorState"])(content, editorDecorators, options);
- }
- } else {
- return external_draft_js_["EditorState"].createEmpty(editorDecorators);
- }
- };
-
- /* harmony default export */ var index_0 = __webpack_exports__["default"] = (editor_BraftEditor);
- // 2.0.0开发计划
- // [ ]完善各模块文档说明
- // [√]添加更多钩子(插入链接、切换样式等)
- // [√]优化内置的图片伪上传功能,用base64代替blob
- // [√]支持自定义图片工具栏按钮
- // [√]支持通过属性扩展customStyleMap, blockStyleFn, keyBindingFn, blockRendererFn, blockRenderMap等
- // [√]允许完全设置控制栏的按钮(['media', { key: 'blod', text: 'xxx' })
- // [√]允许在工具栏和内容区域直接插入自定义的组件[componentBelowControlBar]
- // [√]支持定义DropDown组件的样式
- // [√]media.validateFn支持异步函数
- // [√]优化音视频在编辑器内的预览体验
- // [√]标准化代码,引入ESLint
- // ---------------------------
- // 优化全选会选择上传中的项目的问题
- // 支持param.success时设置媒体文件的更多属性(尺寸等)
- // 2.1.0版本开发计划
- // [ ]美化UI,包括图标和界面风格
- // [ ]优化控件title提示
- // 2.2.0版本开发计划
- // [ ]允许自定义快捷键
- // [ ]优化图片param.success,支持传入link等
- // [ ]简化上传配置流程
- // [ ]支持draftjs插件机制
- // [ ]支持媒体库组件的更多个性化配置(placeholder等)
- // [ ]支持非媒体类附件
- // [ ]优化HTML格式无法存储媒体名称的问题
- // [ ]完成font-size等样式的全量支持
- // 2.3.0版本开发计划
- // [ ]优化换行与空格
- // [ ]支持自定义Atomic组件
- // [ ]图片裁切等简单的编辑功能
- // [ ]代码块交互强化
- // [ ]初级表格功能
-
- /***/ }),
- /* 27 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 28 */,
- /* 29 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 30 */,
- /* 31 */,
- /* 32 */,
- /* 33 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 34 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 35 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 36 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 37 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 38 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 39 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 40 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 41 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 42 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 43 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 44 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 45 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 46 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 47 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 48 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 49 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 50 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
- /* 51 */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ })
- /******/ ]);
- });
- //# sourceMappingURL=index.js.map
|