| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191 |
- import {
- __commonJS,
- __toESM,
- defineComponent,
- h,
- nextTick,
- onBeforeUnmount,
- onMounted,
- ref,
- watch
- } from "./chunk-GFV24RRW.js";
- // node_modules/@vueup/vue-quill/node_modules/quill/dist/quill.js
- var require_quill = __commonJS({
- "node_modules/@vueup/vue-quill/node_modules/quill/dist/quill.js"(exports, module) {
- (function webpackUniversalModuleDefinition(root, factory) {
- if (typeof exports === "object" && typeof module === "object")
- module.exports = factory();
- else if (typeof define === "function" && define.amd)
- define([], factory);
- else if (typeof exports === "object")
- exports["Quill"] = factory();
- else
- root["Quill"] = factory();
- })(typeof self !== "undefined" ? self : exports, function() {
- return (
- /******/
- (function(modules) {
- var installedModules = {};
- function __webpack_require__(moduleId) {
- if (installedModules[moduleId]) {
- return installedModules[moduleId].exports;
- }
- var module2 = installedModules[moduleId] = {
- /******/
- i: moduleId,
- /******/
- l: false,
- /******/
- exports: {}
- /******/
- };
- modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
- module2.l = true;
- return module2.exports;
- }
- __webpack_require__.m = modules;
- __webpack_require__.c = installedModules;
- __webpack_require__.d = function(exports2, name, getter) {
- if (!__webpack_require__.o(exports2, name)) {
- Object.defineProperty(exports2, name, {
- /******/
- configurable: false,
- /******/
- enumerable: true,
- /******/
- get: getter
- /******/
- });
- }
- };
- __webpack_require__.n = function(module2) {
- var getter = module2 && module2.__esModule ? (
- /******/
- function getDefault() {
- return module2["default"];
- }
- ) : (
- /******/
- function getModuleExports() {
- return module2;
- }
- );
- __webpack_require__.d(getter, "a", getter);
- return getter;
- };
- __webpack_require__.o = function(object, property) {
- return Object.prototype.hasOwnProperty.call(object, property);
- };
- __webpack_require__.p = "";
- return __webpack_require__(__webpack_require__.s = 109);
- })([
- /* 0 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var format_1 = __webpack_require__(18);
- var leaf_1 = __webpack_require__(19);
- var scroll_1 = __webpack_require__(45);
- var inline_1 = __webpack_require__(46);
- var block_1 = __webpack_require__(47);
- var embed_1 = __webpack_require__(48);
- var text_1 = __webpack_require__(49);
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(32);
- var style_1 = __webpack_require__(33);
- var store_1 = __webpack_require__(31);
- var Registry = __webpack_require__(1);
- var Parchment = {
- Scope: Registry.Scope,
- create: Registry.create,
- find: Registry.find,
- query: Registry.query,
- register: Registry.register,
- Container: container_1.default,
- Format: format_1.default,
- Leaf: leaf_1.default,
- Embed: embed_1.default,
- Scroll: scroll_1.default,
- Block: block_1.default,
- Inline: inline_1.default,
- Text: text_1.default,
- Attributor: {
- Attribute: attributor_1.default,
- Class: class_1.default,
- Style: style_1.default,
- Store: store_1.default
- }
- };
- exports2.default = Parchment;
- }),
- /* 1 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var ParchmentError = (
- /** @class */
- (function(_super) {
- __extends(ParchmentError2, _super);
- function ParchmentError2(message) {
- var _this = this;
- message = "[Parchment] " + message;
- _this = _super.call(this, message) || this;
- _this.message = message;
- _this.name = _this.constructor.name;
- return _this;
- }
- return ParchmentError2;
- })(Error)
- );
- exports2.ParchmentError = ParchmentError;
- var attributes = {};
- var classes = {};
- var tags = {};
- var types = {};
- exports2.DATA_KEY = "__blot";
- var Scope;
- (function(Scope2) {
- Scope2[Scope2["TYPE"] = 3] = "TYPE";
- Scope2[Scope2["LEVEL"] = 12] = "LEVEL";
- Scope2[Scope2["ATTRIBUTE"] = 13] = "ATTRIBUTE";
- Scope2[Scope2["BLOT"] = 14] = "BLOT";
- Scope2[Scope2["INLINE"] = 7] = "INLINE";
- Scope2[Scope2["BLOCK"] = 11] = "BLOCK";
- Scope2[Scope2["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
- Scope2[Scope2["INLINE_BLOT"] = 6] = "INLINE_BLOT";
- Scope2[Scope2["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
- Scope2[Scope2["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
- Scope2[Scope2["ANY"] = 15] = "ANY";
- })(Scope = exports2.Scope || (exports2.Scope = {}));
- function create(input, value) {
- var match = query(input);
- if (match == null) {
- throw new ParchmentError("Unable to create " + input + " blot");
- }
- var BlotClass = match;
- var node = (
- // @ts-ignore
- input instanceof Node || input["nodeType"] === Node.TEXT_NODE ? input : BlotClass.create(value)
- );
- return new BlotClass(node, value);
- }
- exports2.create = create;
- function find(node, bubble) {
- if (bubble === void 0) {
- bubble = false;
- }
- if (node == null)
- return null;
- if (node[exports2.DATA_KEY] != null)
- return node[exports2.DATA_KEY].blot;
- if (bubble)
- return find(node.parentNode, bubble);
- return null;
- }
- exports2.find = find;
- function query(query2, scope) {
- if (scope === void 0) {
- scope = Scope.ANY;
- }
- var match;
- if (typeof query2 === "string") {
- match = types[query2] || attributes[query2];
- } else if (query2 instanceof Text || query2["nodeType"] === Node.TEXT_NODE) {
- match = types["text"];
- } else if (typeof query2 === "number") {
- if (query2 & Scope.LEVEL & Scope.BLOCK) {
- match = types["block"];
- } else if (query2 & Scope.LEVEL & Scope.INLINE) {
- match = types["inline"];
- }
- } else if (query2 instanceof HTMLElement) {
- var names = (query2.getAttribute("class") || "").split(/\s+/);
- for (var i in names) {
- match = classes[names[i]];
- if (match)
- break;
- }
- match = match || tags[query2.tagName];
- }
- if (match == null)
- return null;
- if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
- return match;
- return null;
- }
- exports2.query = query;
- function register() {
- var Definitions = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- Definitions[_i] = arguments[_i];
- }
- if (Definitions.length > 1) {
- return Definitions.map(function(d) {
- return register(d);
- });
- }
- var Definition = Definitions[0];
- if (typeof Definition.blotName !== "string" && typeof Definition.attrName !== "string") {
- throw new ParchmentError("Invalid definition");
- } else if (Definition.blotName === "abstract") {
- throw new ParchmentError("Cannot register abstract class");
- }
- types[Definition.blotName || Definition.attrName] = Definition;
- if (typeof Definition.keyName === "string") {
- attributes[Definition.keyName] = Definition;
- } else {
- if (Definition.className != null) {
- classes[Definition.className] = Definition;
- }
- if (Definition.tagName != null) {
- if (Array.isArray(Definition.tagName)) {
- Definition.tagName = Definition.tagName.map(function(tagName) {
- return tagName.toUpperCase();
- });
- } else {
- Definition.tagName = Definition.tagName.toUpperCase();
- }
- var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
- tagNames.forEach(function(tag) {
- if (tags[tag] == null || Definition.className == null) {
- tags[tag] = Definition;
- }
- });
- }
- }
- return Definition;
- }
- exports2.register = register;
- }),
- /* 2 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- var diff = __webpack_require__(51);
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
- var op = __webpack_require__(20);
- var NULL_CHARACTER = String.fromCharCode(0);
- var Delta2 = function(ops) {
- if (Array.isArray(ops)) {
- this.ops = ops;
- } else if (ops != null && Array.isArray(ops.ops)) {
- this.ops = ops.ops;
- } else {
- this.ops = [];
- }
- };
- Delta2.prototype.insert = function(text, attributes) {
- var newOp = {};
- if (text.length === 0) return this;
- newOp.insert = text;
- if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
- Delta2.prototype["delete"] = function(length) {
- if (length <= 0) return this;
- return this.push({ "delete": length });
- };
- Delta2.prototype.retain = function(length, attributes) {
- if (length <= 0) return this;
- var newOp = { retain: length };
- if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
- Delta2.prototype.push = function(newOp) {
- var index = this.ops.length;
- var lastOp = this.ops[index - 1];
- newOp = extend(true, {}, newOp);
- if (typeof lastOp === "object") {
- if (typeof newOp["delete"] === "number" && typeof lastOp["delete"] === "number") {
- this.ops[index - 1] = { "delete": lastOp["delete"] + newOp["delete"] };
- return this;
- }
- if (typeof lastOp["delete"] === "number" && newOp.insert != null) {
- index -= 1;
- lastOp = this.ops[index - 1];
- if (typeof lastOp !== "object") {
- this.ops.unshift(newOp);
- return this;
- }
- }
- if (equal(newOp.attributes, lastOp.attributes)) {
- if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
- this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
- if (typeof newOp.attributes === "object") this.ops[index - 1].attributes = newOp.attributes;
- return this;
- } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
- this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
- if (typeof newOp.attributes === "object") this.ops[index - 1].attributes = newOp.attributes;
- return this;
- }
- }
- }
- if (index === this.ops.length) {
- this.ops.push(newOp);
- } else {
- this.ops.splice(index, 0, newOp);
- }
- return this;
- };
- Delta2.prototype.chop = function() {
- var lastOp = this.ops[this.ops.length - 1];
- if (lastOp && lastOp.retain && !lastOp.attributes) {
- this.ops.pop();
- }
- return this;
- };
- Delta2.prototype.filter = function(predicate) {
- return this.ops.filter(predicate);
- };
- Delta2.prototype.forEach = function(predicate) {
- this.ops.forEach(predicate);
- };
- Delta2.prototype.map = function(predicate) {
- return this.ops.map(predicate);
- };
- Delta2.prototype.partition = function(predicate) {
- var passed = [], failed = [];
- this.forEach(function(op2) {
- var target = predicate(op2) ? passed : failed;
- target.push(op2);
- });
- return [passed, failed];
- };
- Delta2.prototype.reduce = function(predicate, initial) {
- return this.ops.reduce(predicate, initial);
- };
- Delta2.prototype.changeLength = function() {
- return this.reduce(function(length, elem) {
- if (elem.insert) {
- return length + op.length(elem);
- } else if (elem.delete) {
- return length - elem.delete;
- }
- return length;
- }, 0);
- };
- Delta2.prototype.length = function() {
- return this.reduce(function(length, elem) {
- return length + op.length(elem);
- }, 0);
- };
- Delta2.prototype.slice = function(start, end) {
- start = start || 0;
- if (typeof end !== "number") end = Infinity;
- var ops = [];
- var iter = op.iterator(this.ops);
- var index = 0;
- while (index < end && iter.hasNext()) {
- var nextOp;
- if (index < start) {
- nextOp = iter.next(start - index);
- } else {
- nextOp = iter.next(end - index);
- ops.push(nextOp);
- }
- index += op.length(nextOp);
- }
- return new Delta2(ops);
- };
- Delta2.prototype.compose = function(other) {
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var ops = [];
- var firstOther = otherIter.peek();
- if (firstOther != null && typeof firstOther.retain === "number" && firstOther.attributes == null) {
- var firstLeft = firstOther.retain;
- while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) {
- firstLeft -= thisIter.peekLength();
- ops.push(thisIter.next());
- }
- if (firstOther.retain - firstLeft > 0) {
- otherIter.next(firstOther.retain - firstLeft);
- }
- }
- var delta = new Delta2(ops);
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (otherIter.peekType() === "insert") {
- delta.push(otherIter.next());
- } else if (thisIter.peekType() === "delete") {
- delta.push(thisIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (typeof otherOp.retain === "number") {
- var newOp = {};
- if (typeof thisOp.retain === "number") {
- newOp.retain = length;
- } else {
- newOp.insert = thisOp.insert;
- }
- var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
- if (attributes) newOp.attributes = attributes;
- delta.push(newOp);
- if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
- var rest = new Delta2(thisIter.rest());
- return delta.concat(rest).chop();
- }
- } else if (typeof otherOp["delete"] === "number" && typeof thisOp.retain === "number") {
- delta.push(otherOp);
- }
- }
- }
- return delta.chop();
- };
- Delta2.prototype.concat = function(other) {
- var delta = new Delta2(this.ops.slice());
- if (other.ops.length > 0) {
- delta.push(other.ops[0]);
- delta.ops = delta.ops.concat(other.ops.slice(1));
- }
- return delta;
- };
- Delta2.prototype.diff = function(other, index) {
- if (this.ops === other.ops) {
- return new Delta2();
- }
- var strings = [this, other].map(function(delta2) {
- return delta2.map(function(op2) {
- if (op2.insert != null) {
- return typeof op2.insert === "string" ? op2.insert : NULL_CHARACTER;
- }
- var prep = delta2 === other ? "on" : "with";
- throw new Error("diff() called " + prep + " non-document");
- }).join("");
- });
- var delta = new Delta2();
- var diffResult = diff(strings[0], strings[1], index);
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- diffResult.forEach(function(component) {
- var length = component[1].length;
- while (length > 0) {
- var opLength = 0;
- switch (component[0]) {
- case diff.INSERT:
- opLength = Math.min(otherIter.peekLength(), length);
- delta.push(otherIter.next(opLength));
- break;
- case diff.DELETE:
- opLength = Math.min(length, thisIter.peekLength());
- thisIter.next(opLength);
- delta["delete"](opLength);
- break;
- case diff.EQUAL:
- opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
- var thisOp = thisIter.next(opLength);
- var otherOp = otherIter.next(opLength);
- if (equal(thisOp.insert, otherOp.insert)) {
- delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
- } else {
- delta.push(otherOp)["delete"](opLength);
- }
- break;
- }
- length -= opLength;
- }
- });
- return delta.chop();
- };
- Delta2.prototype.eachLine = function(predicate, newline) {
- newline = newline || "\n";
- var iter = op.iterator(this.ops);
- var line = new Delta2();
- var i = 0;
- while (iter.hasNext()) {
- if (iter.peekType() !== "insert") return;
- var thisOp = iter.peek();
- var start = op.length(thisOp) - iter.peekLength();
- var index = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1;
- if (index < 0) {
- line.push(iter.next());
- } else if (index > 0) {
- line.push(iter.next(index));
- } else {
- if (predicate(line, iter.next(1).attributes || {}, i) === false) {
- return;
- }
- i += 1;
- line = new Delta2();
- }
- }
- if (line.length() > 0) {
- predicate(line, {}, i);
- }
- };
- Delta2.prototype.transform = function(other, priority) {
- priority = !!priority;
- if (typeof other === "number") {
- return this.transformPosition(other, priority);
- }
- var thisIter = op.iterator(this.ops);
- var otherIter = op.iterator(other.ops);
- var delta = new Delta2();
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
- delta.retain(op.length(thisIter.next()));
- } else if (otherIter.peekType() === "insert") {
- delta.push(otherIter.next());
- } else {
- var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length);
- var otherOp = otherIter.next(length);
- if (thisOp["delete"]) {
- continue;
- } else if (otherOp["delete"]) {
- delta.push(otherOp);
- } else {
- delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
- }
- }
- }
- return delta.chop();
- };
- Delta2.prototype.transformPosition = function(index, priority) {
- priority = !!priority;
- var thisIter = op.iterator(this.ops);
- var offset = 0;
- while (thisIter.hasNext() && offset <= index) {
- var length = thisIter.peekLength();
- var nextType = thisIter.peekType();
- thisIter.next();
- if (nextType === "delete") {
- index -= Math.min(length, index - offset);
- continue;
- } else if (nextType === "insert" && (offset < index || !priority)) {
- index += length;
- }
- offset += length;
- }
- return index;
- };
- module2.exports = Delta2;
- }),
- /* 3 */
- /***/
- (function(module2, exports2) {
- "use strict";
- var hasOwn = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var defineProperty = Object.defineProperty;
- var gOPD = Object.getOwnPropertyDescriptor;
- var isArray = function isArray2(arr) {
- if (typeof Array.isArray === "function") {
- return Array.isArray(arr);
- }
- return toStr.call(arr) === "[object Array]";
- };
- var isPlainObject = function isPlainObject2(obj) {
- if (!obj || toStr.call(obj) !== "[object Object]") {
- return false;
- }
- var hasOwnConstructor = hasOwn.call(obj, "constructor");
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
- return false;
- }
- var key;
- for (key in obj) {
- }
- return typeof key === "undefined" || hasOwn.call(obj, key);
- };
- var setProperty = function setProperty2(target, options) {
- if (defineProperty && options.name === "__proto__") {
- defineProperty(target, options.name, {
- enumerable: true,
- configurable: true,
- value: options.newValue,
- writable: true
- });
- } else {
- target[options.name] = options.newValue;
- }
- };
- var getProperty = function getProperty2(obj, name) {
- if (name === "__proto__") {
- if (!hasOwn.call(obj, name)) {
- return void 0;
- } else if (gOPD) {
- return gOPD(obj, name).value;
- }
- }
- return obj[name];
- };
- module2.exports = function extend() {
- var options, name, src, copy, copyIsArray, clone;
- var target = arguments[0];
- var i = 1;
- var length = arguments.length;
- var deep = false;
- if (typeof target === "boolean") {
- deep = target;
- target = arguments[1] || {};
- i = 2;
- }
- if (target == null || typeof target !== "object" && typeof target !== "function") {
- target = {};
- }
- for (; i < length; ++i) {
- options = arguments[i];
- if (options != null) {
- for (name in options) {
- src = getProperty(target, name);
- copy = getProperty(options, name);
- if (target !== copy) {
- if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
- if (copyIsArray) {
- copyIsArray = false;
- clone = src && isArray(src) ? src : [];
- } else {
- clone = src && isPlainObject(src) ? src : {};
- }
- setProperty(target, { name, newValue: extend(deep, clone, copy) });
- } else if (typeof copy !== "undefined") {
- setProperty(target, { name, newValue: copy });
- }
- }
- }
- }
- }
- return target;
- };
- }),
- /* 4 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.BlockEmbed = exports2.bubbleFormats = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _break = __webpack_require__(16);
- var _break2 = _interopRequireDefault(_break);
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var NEWLINE_LENGTH = 1;
- var BlockEmbed = (function(_Parchment$Embed) {
- _inherits(BlockEmbed2, _Parchment$Embed);
- function BlockEmbed2() {
- _classCallCheck(this, BlockEmbed2);
- return _possibleConstructorReturn(this, (BlockEmbed2.__proto__ || Object.getPrototypeOf(BlockEmbed2)).apply(this, arguments));
- }
- _createClass(BlockEmbed2, [{
- key: "attach",
- value: function attach() {
- _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "attach", this).call(this);
- this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
- }
- }, {
- key: "delta",
- value: function delta() {
- return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
- }
- }, {
- key: "format",
- value: function format(name, value) {
- var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
- if (attribute != null) {
- this.attributes.attribute(attribute, value);
- }
- }
- }, {
- key: "formatAt",
- value: function formatAt(index, length, name, value) {
- this.format(name, value);
- }
- }, {
- key: "insertAt",
- value: function insertAt(index, value, def) {
- if (typeof value === "string" && value.endsWith("\n")) {
- var block = _parchment2.default.create(Block.blotName);
- this.parent.insertBefore(block, index === 0 ? this : this.next);
- block.insertAt(0, value.slice(0, -1));
- } else {
- _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "insertAt", this).call(this, index, value, def);
- }
- }
- }]);
- return BlockEmbed2;
- })(_parchment2.default.Embed);
- BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
- var Block = (function(_Parchment$Block) {
- _inherits(Block2, _Parchment$Block);
- function Block2(domNode) {
- _classCallCheck(this, Block2);
- var _this2 = _possibleConstructorReturn(this, (Block2.__proto__ || Object.getPrototypeOf(Block2)).call(this, domNode));
- _this2.cache = {};
- return _this2;
- }
- _createClass(Block2, [{
- key: "delta",
- value: function delta() {
- if (this.cache.delta == null) {
- this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function(delta2, leaf) {
- if (leaf.length() === 0) {
- return delta2;
- } else {
- return delta2.insert(leaf.value(), bubbleFormats(leaf));
- }
- }, new _quillDelta2.default()).insert("\n", bubbleFormats(this));
- }
- return this.cache.delta;
- }
- }, {
- key: "deleteAt",
- value: function deleteAt(index, length) {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "deleteAt", this).call(this, index, length);
- this.cache = {};
- }
- }, {
- key: "formatAt",
- value: function formatAt(index, length, name, value) {
- if (length <= 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- if (index + length === this.length()) {
- this.format(name, value);
- }
- } else {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "formatAt", this).call(this, index, Math.min(length, this.length() - index - 1), name, value);
- }
- this.cache = {};
- }
- }, {
- key: "insertAt",
- value: function insertAt(index, value, def) {
- if (def != null) return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, index, value, def);
- if (value.length === 0) return;
- var lines = value.split("\n");
- var text = lines.shift();
- if (text.length > 0) {
- if (index < this.length() - 1 || this.children.tail == null) {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, Math.min(index, this.length() - 1), text);
- } else {
- this.children.tail.insertAt(this.children.tail.length(), text);
- }
- this.cache = {};
- }
- var block = this;
- lines.reduce(function(index2, line) {
- block = block.split(index2, true);
- block.insertAt(0, line);
- return line.length;
- }, index + text.length);
- }
- }, {
- key: "insertBefore",
- value: function insertBefore(blot, ref2) {
- var head = this.children.head;
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertBefore", this).call(this, blot, ref2);
- if (head instanceof _break2.default) {
- head.remove();
- }
- this.cache = {};
- }
- }, {
- key: "length",
- value: function length() {
- if (this.cache.length == null) {
- this.cache.length = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "length", this).call(this) + NEWLINE_LENGTH;
- }
- return this.cache.length;
- }
- }, {
- key: "moveChildren",
- value: function moveChildren(target, ref2) {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "moveChildren", this).call(this, target, ref2);
- this.cache = {};
- }
- }, {
- key: "optimize",
- value: function optimize(context) {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "optimize", this).call(this, context);
- this.cache = {};
- }
- }, {
- key: "path",
- value: function path(index) {
- return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "path", this).call(this, index, true);
- }
- }, {
- key: "removeChild",
- value: function removeChild(child) {
- _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "removeChild", this).call(this, child);
- this.cache = {};
- }
- }, {
- key: "split",
- value: function split(index) {
- var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {
- var clone = this.clone();
- if (index === 0) {
- this.parent.insertBefore(clone, this);
- return this;
- } else {
- this.parent.insertBefore(clone, this.next);
- return clone;
- }
- } else {
- var next = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "split", this).call(this, index, force);
- this.cache = {};
- return next;
- }
- }
- }]);
- return Block2;
- })(_parchment2.default.Block);
- Block.blotName = "block";
- Block.tagName = "P";
- Block.defaultChild = "break";
- Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
- function bubbleFormats(blot) {
- var formats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- if (blot == null) return formats;
- if (typeof blot.formats === "function") {
- formats = (0, _extend2.default)(formats, blot.formats());
- }
- if (blot.parent == null || blot.parent.blotName == "scroll" || blot.parent.statics.scope !== blot.statics.scope) {
- return formats;
- }
- return bubbleFormats(blot.parent, formats);
- }
- exports2.bubbleFormats = bubbleFormats;
- exports2.BlockEmbed = BlockEmbed;
- exports2.default = Block;
- }),
- /* 5 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.overload = exports2.expandConfig = void 0;
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- __webpack_require__(50);
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _editor = __webpack_require__(14);
- var _editor2 = _interopRequireDefault(_editor);
- var _emitter3 = __webpack_require__(8);
- var _emitter4 = _interopRequireDefault(_emitter3);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _selection = __webpack_require__(15);
- var _selection2 = _interopRequireDefault(_selection);
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- var _theme = __webpack_require__(34);
- var _theme2 = _interopRequireDefault(_theme);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var debug = (0, _logger2.default)("quill");
- var Quill2 = (function() {
- _createClass(Quill3, null, [{
- key: "debug",
- value: function debug2(limit) {
- if (limit === true) {
- limit = "log";
- }
- _logger2.default.level(limit);
- }
- }, {
- key: "find",
- value: function find(node) {
- return node.__quill || _parchment2.default.find(node);
- }
- }, {
- key: "import",
- value: function _import(name) {
- if (this.imports[name] == null) {
- debug.error("Cannot import " + name + ". Are you sure it was registered?");
- }
- return this.imports[name];
- }
- }, {
- key: "register",
- value: function register(path, target) {
- var _this = this;
- var overwrite = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
- if (typeof path !== "string") {
- var name = path.attrName || path.blotName;
- if (typeof name === "string") {
- this.register("formats/" + name, path, target);
- } else {
- Object.keys(path).forEach(function(key) {
- _this.register(key, path[key], target);
- });
- }
- } else {
- if (this.imports[path] != null && !overwrite) {
- debug.warn("Overwriting " + path + " with", target);
- }
- this.imports[path] = target;
- if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
- _parchment2.default.register(target);
- } else if (path.startsWith("modules") && typeof target.register === "function") {
- target.register();
- }
- }
- }
- }]);
- function Quill3(container) {
- var _this2 = this;
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- _classCallCheck(this, Quill3);
- this.options = expandConfig(container, options);
- this.container = this.options.container;
- if (this.container == null) {
- return debug.error("Invalid Quill container", container);
- }
- if (this.options.debug) {
- Quill3.debug(this.options.debug);
- }
- var html = this.container.innerHTML.trim();
- this.container.classList.add("ql-container");
- this.container.innerHTML = "";
- this.container.__quill = this;
- this.root = this.addContainer("ql-editor");
- this.root.classList.add("ql-blank");
- this.root.setAttribute("data-gramm", false);
- this.scrollingContainer = this.options.scrollingContainer || this.root;
- this.emitter = new _emitter4.default();
- this.scroll = _parchment2.default.create(this.root, {
- emitter: this.emitter,
- whitelist: this.options.formats
- });
- this.editor = new _editor2.default(this.scroll);
- this.selection = new _selection2.default(this.scroll, this.emitter);
- this.theme = new this.options.theme(this, this.options);
- this.keyboard = this.theme.addModule("keyboard");
- this.clipboard = this.theme.addModule("clipboard");
- this.history = this.theme.addModule("history");
- this.theme.init();
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type) {
- if (type === _emitter4.default.events.TEXT_CHANGE) {
- _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function(source, mutations) {
- var range = _this2.selection.lastRange;
- var index = range && range.length === 0 ? range.index : void 0;
- modify.call(_this2, function() {
- return _this2.editor.update(null, mutations, index);
- }, source);
- });
- var contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">` + html + "<p><br></p></div>");
- this.setContents(contents);
- this.history.clear();
- if (this.options.placeholder) {
- this.root.setAttribute("data-placeholder", this.options.placeholder);
- }
- if (this.options.readOnly) {
- this.disable();
- }
- }
- _createClass(Quill3, [{
- key: "addContainer",
- value: function addContainer(container) {
- var refNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
- if (typeof container === "string") {
- var className = container;
- container = document.createElement("div");
- container.classList.add(className);
- }
- this.container.insertBefore(container, refNode);
- return container;
- }
- }, {
- key: "blur",
- value: function blur() {
- this.selection.setRange(null);
- }
- }, {
- key: "deleteText",
- value: function deleteText(index, length, source) {
- var _this3 = this;
- var _overload = overload(index, length, source);
- var _overload2 = _slicedToArray(_overload, 4);
- index = _overload2[0];
- length = _overload2[1];
- source = _overload2[3];
- return modify.call(this, function() {
- return _this3.editor.deleteText(index, length);
- }, source, index, -1 * length);
- }
- }, {
- key: "disable",
- value: function disable() {
- this.enable(false);
- }
- }, {
- key: "enable",
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
- this.scroll.enable(enabled);
- this.container.classList.toggle("ql-disabled", !enabled);
- }
- }, {
- key: "focus",
- value: function focus() {
- var scrollTop = this.scrollingContainer.scrollTop;
- this.selection.focus();
- this.scrollingContainer.scrollTop = scrollTop;
- this.scrollIntoView();
- }
- }, {
- key: "format",
- value: function format(name, value) {
- var _this4 = this;
- var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
- return modify.call(this, function() {
- var range = _this4.getSelection(true);
- var change = new _quillDelta2.default();
- if (range == null) {
- return change;
- } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {
- change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));
- } else if (range.length === 0) {
- _this4.selection.format(name, value);
- return change;
- } else {
- change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));
- }
- _this4.setSelection(range, _emitter4.default.sources.SILENT);
- return change;
- }, source);
- }
- }, {
- key: "formatLine",
- value: function formatLine(index, length, name, value, source) {
- var _this5 = this;
- var formats = void 0;
- var _overload3 = overload(index, length, name, value, source);
- var _overload4 = _slicedToArray(_overload3, 4);
- index = _overload4[0];
- length = _overload4[1];
- formats = _overload4[2];
- source = _overload4[3];
- return modify.call(this, function() {
- return _this5.editor.formatLine(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "formatText",
- value: function formatText(index, length, name, value, source) {
- var _this6 = this;
- var formats = void 0;
- var _overload5 = overload(index, length, name, value, source);
- var _overload6 = _slicedToArray(_overload5, 4);
- index = _overload6[0];
- length = _overload6[1];
- formats = _overload6[2];
- source = _overload6[3];
- return modify.call(this, function() {
- return _this6.editor.formatText(index, length, formats);
- }, source, index, 0);
- }
- }, {
- key: "getBounds",
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var bounds = void 0;
- if (typeof index === "number") {
- bounds = this.selection.getBounds(index, length);
- } else {
- bounds = this.selection.getBounds(index.index, index.length);
- }
- var containerBounds = this.container.getBoundingClientRect();
- return {
- bottom: bounds.bottom - containerBounds.top,
- height: bounds.height,
- left: bounds.left - containerBounds.left,
- right: bounds.right - containerBounds.left,
- top: bounds.top - containerBounds.top,
- width: bounds.width
- };
- }
- }, {
- key: "getContents",
- value: function getContents() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index;
- var _overload7 = overload(index, length);
- var _overload8 = _slicedToArray(_overload7, 2);
- index = _overload8[0];
- length = _overload8[1];
- return this.editor.getContents(index, length);
- }
- }, {
- key: "getFormat",
- value: function getFormat() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.getSelection(true);
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- if (typeof index === "number") {
- return this.editor.getFormat(index, length);
- } else {
- return this.editor.getFormat(index.index, index.length);
- }
- }
- }, {
- key: "getIndex",
- value: function getIndex(blot) {
- return blot.offset(this.scroll);
- }
- }, {
- key: "getLength",
- value: function getLength() {
- return this.scroll.length();
- }
- }, {
- key: "getLeaf",
- value: function getLeaf(index) {
- return this.scroll.leaf(index);
- }
- }, {
- key: "getLine",
- value: function getLine(index) {
- return this.scroll.line(index);
- }
- }, {
- key: "getLines",
- value: function getLines() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
- if (typeof index !== "number") {
- return this.scroll.lines(index.index, index.length);
- } else {
- return this.scroll.lines(index, length);
- }
- }
- }, {
- key: "getModule",
- value: function getModule(name) {
- return this.theme.modules[name];
- }
- }, {
- key: "getSelection",
- value: function getSelection() {
- var focus = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
- if (focus) this.focus();
- this.update();
- return this.selection.getRange()[0];
- }
- }, {
- key: "getText",
- value: function getText() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index;
- var _overload9 = overload(index, length);
- var _overload10 = _slicedToArray(_overload9, 2);
- index = _overload10[0];
- length = _overload10[1];
- return this.editor.getText(index, length);
- }
- }, {
- key: "hasFocus",
- value: function hasFocus() {
- return this.selection.hasFocus();
- }
- }, {
- key: "insertEmbed",
- value: function insertEmbed(index, embed, value) {
- var _this7 = this;
- var source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Quill3.sources.API;
- return modify.call(this, function() {
- return _this7.editor.insertEmbed(index, embed, value);
- }, source, index);
- }
- }, {
- key: "insertText",
- value: function insertText(index, text, name, value, source) {
- var _this8 = this;
- var formats = void 0;
- var _overload11 = overload(index, 0, name, value, source);
- var _overload12 = _slicedToArray(_overload11, 4);
- index = _overload12[0];
- formats = _overload12[2];
- source = _overload12[3];
- return modify.call(this, function() {
- return _this8.editor.insertText(index, text, formats);
- }, source, index, text.length);
- }
- }, {
- key: "isEnabled",
- value: function isEnabled() {
- return !this.container.classList.contains("ql-disabled");
- }
- }, {
- key: "off",
- value: function off() {
- return this.emitter.off.apply(this.emitter, arguments);
- }
- }, {
- key: "on",
- value: function on() {
- return this.emitter.on.apply(this.emitter, arguments);
- }
- }, {
- key: "once",
- value: function once() {
- return this.emitter.once.apply(this.emitter, arguments);
- }
- }, {
- key: "pasteHTML",
- value: function pasteHTML(index, html, source) {
- this.clipboard.dangerouslyPasteHTML(index, html, source);
- }
- }, {
- key: "removeFormat",
- value: function removeFormat(index, length, source) {
- var _this9 = this;
- var _overload13 = overload(index, length, source);
- var _overload14 = _slicedToArray(_overload13, 4);
- index = _overload14[0];
- length = _overload14[1];
- source = _overload14[3];
- return modify.call(this, function() {
- return _this9.editor.removeFormat(index, length);
- }, source, index);
- }
- }, {
- key: "scrollIntoView",
- value: function scrollIntoView() {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }, {
- key: "setContents",
- value: function setContents(delta) {
- var _this10 = this;
- var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
- return modify.call(this, function() {
- delta = new _quillDelta2.default(delta);
- var length = _this10.getLength();
- var deleted = _this10.editor.deleteText(0, length);
- var applied = _this10.editor.applyDelta(delta);
- var lastOp = applied.ops[applied.ops.length - 1];
- if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
- _this10.editor.deleteText(_this10.getLength() - 1, 1);
- applied.delete(1);
- }
- var ret = deleted.compose(applied);
- return ret;
- }, source);
- }
- }, {
- key: "setSelection",
- value: function setSelection(index, length, source) {
- if (index == null) {
- this.selection.setRange(null, length || Quill3.sources.API);
- } else {
- var _overload15 = overload(index, length, source);
- var _overload16 = _slicedToArray(_overload15, 4);
- index = _overload16[0];
- length = _overload16[1];
- source = _overload16[3];
- this.selection.setRange(new _selection.Range(index, length), source);
- if (source !== _emitter4.default.sources.SILENT) {
- this.selection.scrollIntoView(this.scrollingContainer);
- }
- }
- }
- }, {
- key: "setText",
- value: function setText(text) {
- var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
- var delta = new _quillDelta2.default().insert(text);
- return this.setContents(delta, source);
- }
- }, {
- key: "update",
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
- var change = this.scroll.update(source);
- this.selection.update(source);
- return change;
- }
- }, {
- key: "updateContents",
- value: function updateContents(delta) {
- var _this11 = this;
- var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
- return modify.call(this, function() {
- delta = new _quillDelta2.default(delta);
- return _this11.editor.applyDelta(delta, source);
- }, source, true);
- }
- }]);
- return Quill3;
- })();
- Quill2.DEFAULTS = {
- bounds: null,
- formats: null,
- modules: {},
- placeholder: "",
- readOnly: false,
- scrollingContainer: null,
- strict: true,
- theme: "default"
- };
- Quill2.events = _emitter4.default.events;
- Quill2.sources = _emitter4.default.sources;
- Quill2.version = false ? "dev" : "1.3.7";
- Quill2.imports = {
- "delta": _quillDelta2.default,
- "parchment": _parchment2.default,
- "core/module": _module2.default,
- "core/theme": _theme2.default
- };
- function expandConfig(container, userConfig) {
- userConfig = (0, _extend2.default)(true, {
- container,
- modules: {
- clipboard: true,
- keyboard: true,
- history: true
- }
- }, userConfig);
- if (!userConfig.theme || userConfig.theme === Quill2.DEFAULTS.theme) {
- userConfig.theme = _theme2.default;
- } else {
- userConfig.theme = Quill2.import("themes/" + userConfig.theme);
- if (userConfig.theme == null) {
- throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
- }
- }
- var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
- [themeConfig, userConfig].forEach(function(config) {
- config.modules = config.modules || {};
- Object.keys(config.modules).forEach(function(module3) {
- if (config.modules[module3] === true) {
- config.modules[module3] = {};
- }
- });
- });
- var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
- var moduleConfig = moduleNames.reduce(function(config, name) {
- var moduleClass = Quill2.import("modules/" + name);
- if (moduleClass == null) {
- debug.error("Cannot load " + name + " module. Are you sure you registered it?");
- } else {
- config[name] = moduleClass.DEFAULTS || {};
- }
- return config;
- }, {});
- if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
- userConfig.modules.toolbar = {
- container: userConfig.modules.toolbar
- };
- }
- userConfig = (0, _extend2.default)(true, {}, Quill2.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
- ["bounds", "container", "scrollingContainer"].forEach(function(key) {
- if (typeof userConfig[key] === "string") {
- userConfig[key] = document.querySelector(userConfig[key]);
- }
- });
- userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {
- if (userConfig.modules[name]) {
- config[name] = userConfig.modules[name];
- }
- return config;
- }, {});
- return userConfig;
- }
- function modify(modifier, source, index, shift) {
- if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
- return new _quillDelta2.default();
- }
- var range = index == null ? null : this.getSelection();
- var oldDelta = this.editor.delta;
- var change = modifier();
- if (range != null) {
- if (index === true) index = range.index;
- if (shift == null) {
- range = shiftRange(range, change, source);
- } else if (shift !== 0) {
- range = shiftRange(range, index, shift, source);
- }
- this.setSelection(range, _emitter4.default.sources.SILENT);
- }
- if (change.length() > 0) {
- var _emitter;
- var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- return change;
- }
- function overload(index, length, name, value, source) {
- var formats = {};
- if (typeof index.index === "number" && typeof index.length === "number") {
- if (typeof length !== "number") {
- source = value, value = name, name = length, length = index.length, index = index.index;
- } else {
- length = index.length, index = index.index;
- }
- } else if (typeof length !== "number") {
- source = value, value = name, name = length, length = 0;
- }
- if ((typeof name === "undefined" ? "undefined" : _typeof(name)) === "object") {
- formats = name;
- source = value;
- } else if (typeof name === "string") {
- if (value != null) {
- formats[name] = value;
- } else {
- source = name;
- }
- }
- source = source || _emitter4.default.sources.API;
- return [index, length, formats, source];
- }
- function shiftRange(range, index, length, source) {
- if (range == null) return null;
- var start = void 0, end = void 0;
- if (index instanceof _quillDelta2.default) {
- var _map = [range.index, range.index + range.length].map(function(pos) {
- return index.transformPosition(pos, source !== _emitter4.default.sources.USER);
- });
- var _map2 = _slicedToArray(_map, 2);
- start = _map2[0];
- end = _map2[1];
- } else {
- var _map3 = [range.index, range.index + range.length].map(function(pos) {
- if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;
- if (length >= 0) {
- return pos + length;
- } else {
- return Math.max(index, pos + length);
- }
- });
- var _map4 = _slicedToArray(_map3, 2);
- start = _map4[0];
- end = _map4[1];
- }
- return new _selection.Range(start, end - start);
- }
- exports2.expandConfig = expandConfig;
- exports2.overload = overload;
- exports2.default = Quill2;
- }),
- /* 6 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Inline = (function(_Parchment$Inline) {
- _inherits(Inline2, _Parchment$Inline);
- function Inline2() {
- _classCallCheck(this, Inline2);
- return _possibleConstructorReturn(this, (Inline2.__proto__ || Object.getPrototypeOf(Inline2)).apply(this, arguments));
- }
- _createClass(Inline2, [{
- key: "formatAt",
- value: function formatAt(index, length, name, value) {
- if (Inline2.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {
- var blot = this.isolate(index, length);
- if (value) {
- blot.wrap(name, value);
- }
- } else {
- _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "formatAt", this).call(this, index, length, name, value);
- }
- }
- }, {
- key: "optimize",
- value: function optimize(context) {
- _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "optimize", this).call(this, context);
- if (this.parent instanceof Inline2 && Inline2.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
- var parent = this.parent.isolate(this.offset(), this.length());
- this.moveChildren(parent);
- parent.wrap(this);
- }
- }
- }], [{
- key: "compare",
- value: function compare(self2, other) {
- var selfIndex = Inline2.order.indexOf(self2);
- var otherIndex = Inline2.order.indexOf(other);
- if (selfIndex >= 0 || otherIndex >= 0) {
- return selfIndex - otherIndex;
- } else if (self2 === other) {
- return 0;
- } else if (self2 < other) {
- return -1;
- } else {
- return 1;
- }
- }
- }]);
- return Inline2;
- })(_parchment2.default.Inline);
- Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
- Inline.order = [
- "cursor",
- "inline",
- // Must be lower
- "underline",
- "strike",
- "italic",
- "bold",
- "script",
- "link",
- "code"
- // Must be higher
- ];
- exports2.default = Inline;
- }),
- /* 7 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var TextBlot = (function(_Parchment$Text) {
- _inherits(TextBlot2, _Parchment$Text);
- function TextBlot2() {
- _classCallCheck(this, TextBlot2);
- return _possibleConstructorReturn(this, (TextBlot2.__proto__ || Object.getPrototypeOf(TextBlot2)).apply(this, arguments));
- }
- return TextBlot2;
- })(_parchment2.default.Text);
- exports2.default = TextBlot;
- }),
- /* 8 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _eventemitter = __webpack_require__(54);
- var _eventemitter2 = _interopRequireDefault(_eventemitter);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var debug = (0, _logger2.default)("quill:events");
- var EVENTS = ["selectionchange", "mousedown", "mouseup", "click"];
- EVENTS.forEach(function(eventName) {
- document.addEventListener(eventName, function() {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- [].slice.call(document.querySelectorAll(".ql-container")).forEach(function(node) {
- if (node.__quill && node.__quill.emitter) {
- var _node$__quill$emitter;
- (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
- }
- });
- });
- });
- var Emitter = (function(_EventEmitter) {
- _inherits(Emitter2, _EventEmitter);
- function Emitter2() {
- _classCallCheck(this, Emitter2);
- var _this = _possibleConstructorReturn(this, (Emitter2.__proto__ || Object.getPrototypeOf(Emitter2)).call(this));
- _this.listeners = {};
- _this.on("error", debug.error);
- return _this;
- }
- _createClass(Emitter2, [{
- key: "emit",
- value: function emit() {
- debug.log.apply(debug, arguments);
- _get(Emitter2.prototype.__proto__ || Object.getPrototypeOf(Emitter2.prototype), "emit", this).apply(this, arguments);
- }
- }, {
- key: "handleDOM",
- value: function handleDOM(event) {
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- (this.listeners[event.type] || []).forEach(function(_ref) {
- var node = _ref.node, handler = _ref.handler;
- if (event.target === node || node.contains(event.target)) {
- handler.apply(void 0, [event].concat(args));
- }
- });
- }
- }, {
- key: "listenDOM",
- value: function listenDOM(eventName, node, handler) {
- if (!this.listeners[eventName]) {
- this.listeners[eventName] = [];
- }
- this.listeners[eventName].push({ node, handler });
- }
- }]);
- return Emitter2;
- })(_eventemitter2.default);
- Emitter.events = {
- EDITOR_CHANGE: "editor-change",
- SCROLL_BEFORE_UPDATE: "scroll-before-update",
- SCROLL_OPTIMIZE: "scroll-optimize",
- SCROLL_UPDATE: "scroll-update",
- SELECTION_CHANGE: "selection-change",
- TEXT_CHANGE: "text-change"
- };
- Emitter.sources = {
- API: "api",
- SILENT: "silent",
- USER: "user"
- };
- exports2.default = Emitter;
- }),
- /* 9 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var Module = function Module2(quill) {
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- _classCallCheck(this, Module2);
- this.quill = quill;
- this.options = options;
- };
- Module.DEFAULTS = {};
- exports2.default = Module;
- }),
- /* 10 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var levels = ["error", "warn", "log", "info"];
- var level = "warn";
- function debug(method) {
- if (levels.indexOf(method) <= levels.indexOf(level)) {
- var _console;
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- (_console = console)[method].apply(_console, args);
- }
- }
- function namespace(ns) {
- return levels.reduce(function(logger, method) {
- logger[method] = debug.bind(console, method, ns);
- return logger;
- }, {});
- }
- debug.level = namespace.level = function(newLevel) {
- level = newLevel;
- };
- exports2.default = namespace;
- }),
- /* 11 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- var pSlice = Array.prototype.slice;
- var objectKeys = __webpack_require__(52);
- var isArguments = __webpack_require__(53);
- var deepEqual = module2.exports = function(actual, expected, opts) {
- if (!opts) opts = {};
- if (actual === expected) {
- return true;
- } else if (actual instanceof Date && expected instanceof Date) {
- return actual.getTime() === expected.getTime();
- } else if (!actual || !expected || typeof actual != "object" && typeof expected != "object") {
- return opts.strict ? actual === expected : actual == expected;
- } else {
- return objEquiv(actual, expected, opts);
- }
- };
- function isUndefinedOrNull(value) {
- return value === null || value === void 0;
- }
- function isBuffer(x) {
- if (!x || typeof x !== "object" || typeof x.length !== "number") return false;
- if (typeof x.copy !== "function" || typeof x.slice !== "function") {
- return false;
- }
- if (x.length > 0 && typeof x[0] !== "number") return false;
- return true;
- }
- function objEquiv(a, b, opts) {
- var i, key;
- if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
- return false;
- if (a.prototype !== b.prototype) return false;
- if (isArguments(a)) {
- if (!isArguments(b)) {
- return false;
- }
- a = pSlice.call(a);
- b = pSlice.call(b);
- return deepEqual(a, b, opts);
- }
- if (isBuffer(a)) {
- if (!isBuffer(b)) {
- return false;
- }
- if (a.length !== b.length) return false;
- for (i = 0; i < a.length; i++) {
- if (a[i] !== b[i]) return false;
- }
- return true;
- }
- try {
- var ka = objectKeys(a), kb = objectKeys(b);
- } catch (e) {
- return false;
- }
- if (ka.length != kb.length)
- return false;
- ka.sort();
- kb.sort();
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] != kb[i])
- return false;
- }
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!deepEqual(a[key], b[key], opts)) return false;
- }
- return typeof a === typeof b;
- }
- }),
- /* 12 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", { value: true });
- var Registry = __webpack_require__(1);
- var Attributor = (
- /** @class */
- (function() {
- function Attributor2(attrName, keyName, options) {
- if (options === void 0) {
- options = {};
- }
- this.attrName = attrName;
- this.keyName = keyName;
- var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
- if (options.scope != null) {
- this.scope = options.scope & Registry.Scope.LEVEL | attributeBit;
- } else {
- this.scope = Registry.Scope.ATTRIBUTE;
- }
- if (options.whitelist != null)
- this.whitelist = options.whitelist;
- }
- Attributor2.keys = function(node) {
- return [].map.call(node.attributes, function(item) {
- return item.name;
- });
- };
- Attributor2.prototype.add = function(node, value) {
- if (!this.canAdd(node, value))
- return false;
- node.setAttribute(this.keyName, value);
- return true;
- };
- Attributor2.prototype.canAdd = function(node, value) {
- var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
- if (match == null)
- return false;
- if (this.whitelist == null)
- return true;
- if (typeof value === "string") {
- return this.whitelist.indexOf(value.replace(/["']/g, "")) > -1;
- } else {
- return this.whitelist.indexOf(value) > -1;
- }
- };
- Attributor2.prototype.remove = function(node) {
- node.removeAttribute(this.keyName);
- };
- Attributor2.prototype.value = function(node) {
- var value = node.getAttribute(this.keyName);
- if (this.canAdd(node, value) && value) {
- return value;
- }
- return "";
- };
- return Attributor2;
- })()
- );
- exports2.default = Attributor;
- }),
- /* 13 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.Code = void 0;
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Code = (function(_Inline) {
- _inherits(Code2, _Inline);
- function Code2() {
- _classCallCheck(this, Code2);
- return _possibleConstructorReturn(this, (Code2.__proto__ || Object.getPrototypeOf(Code2)).apply(this, arguments));
- }
- return Code2;
- })(_inline2.default);
- Code.blotName = "code";
- Code.tagName = "CODE";
- var CodeBlock = (function(_Block) {
- _inherits(CodeBlock2, _Block);
- function CodeBlock2() {
- _classCallCheck(this, CodeBlock2);
- return _possibleConstructorReturn(this, (CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2)).apply(this, arguments));
- }
- _createClass(CodeBlock2, [{
- key: "delta",
- value: function delta() {
- var _this3 = this;
- var text = this.domNode.textContent;
- if (text.endsWith("\n")) {
- text = text.slice(0, -1);
- }
- return text.split("\n").reduce(function(delta2, frag) {
- return delta2.insert(frag).insert("\n", _this3.formats());
- }, new _quillDelta2.default());
- }
- }, {
- key: "format",
- value: function format(name, value) {
- if (name === this.statics.blotName && value) return;
- var _descendant = this.descendant(_text2.default, this.length() - 1), _descendant2 = _slicedToArray(_descendant, 1), text = _descendant2[0];
- if (text != null) {
- text.deleteAt(text.length() - 1, 1);
- }
- _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "format", this).call(this, name, value);
- }
- }, {
- key: "formatAt",
- value: function formatAt(index, length, name, value) {
- if (length === 0) return;
- if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {
- return;
- }
- var nextNewline = this.newlineIndex(index);
- if (nextNewline < 0 || nextNewline >= index + length) return;
- var prevNewline = this.newlineIndex(index, true) + 1;
- var isolateLength = nextNewline - prevNewline + 1;
- var blot = this.isolate(prevNewline, isolateLength);
- var next = blot.next;
- blot.format(name, value);
- if (next instanceof CodeBlock2) {
- next.formatAt(0, index - prevNewline + length - isolateLength, name, value);
- }
- }
- }, {
- key: "insertAt",
- value: function insertAt(index, value, def) {
- if (def != null) return;
- var _descendant3 = this.descendant(_text2.default, index), _descendant4 = _slicedToArray(_descendant3, 2), text = _descendant4[0], offset = _descendant4[1];
- text.insertAt(offset, value);
- }
- }, {
- key: "length",
- value: function length() {
- var length2 = this.domNode.textContent.length;
- if (!this.domNode.textContent.endsWith("\n")) {
- return length2 + 1;
- }
- return length2;
- }
- }, {
- key: "newlineIndex",
- value: function newlineIndex(searchIndex) {
- var reverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (!reverse) {
- var offset = this.domNode.textContent.slice(searchIndex).indexOf("\n");
- return offset > -1 ? searchIndex + offset : -1;
- } else {
- return this.domNode.textContent.slice(0, searchIndex).lastIndexOf("\n");
- }
- }
- }, {
- key: "optimize",
- value: function optimize(context) {
- if (!this.domNode.textContent.endsWith("\n")) {
- this.appendChild(_parchment2.default.create("text", "\n"));
- }
- _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "optimize", this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {
- next.optimize(context);
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: "replace",
- value: function replace(target) {
- _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "replace", this).call(this, target);
- [].slice.call(this.domNode.querySelectorAll("*")).forEach(function(node) {
- var blot = _parchment2.default.find(node);
- if (blot == null) {
- node.parentNode.removeChild(node);
- } else if (blot instanceof _parchment2.default.Embed) {
- blot.remove();
- } else {
- blot.unwrap();
- }
- });
- }
- }], [{
- key: "create",
- value: function create(value) {
- var domNode = _get(CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2), "create", this).call(this, value);
- domNode.setAttribute("spellcheck", false);
- return domNode;
- }
- }, {
- key: "formats",
- value: function formats() {
- return true;
- }
- }]);
- return CodeBlock2;
- })(_block2.default);
- CodeBlock.blotName = "code-block";
- CodeBlock.tagName = "PRE";
- CodeBlock.TAB = " ";
- exports2.Code = Code;
- exports2.default = CodeBlock;
- }),
- /* 14 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _op = __webpack_require__(20);
- var _op2 = _interopRequireDefault(_op);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _code = __webpack_require__(13);
- var _code2 = _interopRequireDefault(_code);
- var _cursor = __webpack_require__(24);
- var _cursor2 = _interopRequireDefault(_cursor);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- var _break = __webpack_require__(16);
- var _break2 = _interopRequireDefault(_break);
- var _clone = __webpack_require__(21);
- var _clone2 = _interopRequireDefault(_clone);
- var _deepEqual = __webpack_require__(11);
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var ASCII = /^[ -~]*$/;
- var Editor = (function() {
- function Editor2(scroll) {
- _classCallCheck(this, Editor2);
- this.scroll = scroll;
- this.delta = this.getDelta();
- }
- _createClass(Editor2, [{
- key: "applyDelta",
- value: function applyDelta(delta) {
- var _this = this;
- var consumeNextNewline = false;
- this.scroll.update();
- var scrollLength = this.scroll.length();
- this.scroll.batchStart();
- delta = normalizeDelta(delta);
- delta.reduce(function(index, op) {
- var length = op.retain || op.delete || op.insert.length || 1;
- var attributes = op.attributes || {};
- if (op.insert != null) {
- if (typeof op.insert === "string") {
- var text = op.insert;
- if (text.endsWith("\n") && consumeNextNewline) {
- consumeNextNewline = false;
- text = text.slice(0, -1);
- }
- if (index >= scrollLength && !text.endsWith("\n")) {
- consumeNextNewline = true;
- }
- _this.scroll.insertAt(index, text);
- var _scroll$line = _this.scroll.line(index), _scroll$line2 = _slicedToArray(_scroll$line, 2), line = _scroll$line2[0], offset = _scroll$line2[1];
- var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
- if (line instanceof _block2.default) {
- var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), _line$descendant2 = _slicedToArray(_line$descendant, 1), leaf = _line$descendant2[0];
- formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
- }
- attributes = _op2.default.attributes.diff(formats, attributes) || {};
- } else if (_typeof(op.insert) === "object") {
- var key = Object.keys(op.insert)[0];
- if (key == null) return index;
- _this.scroll.insertAt(index, key, op.insert[key]);
- }
- scrollLength += length;
- }
- Object.keys(attributes).forEach(function(name) {
- _this.scroll.formatAt(index, length, name, attributes[name]);
- });
- return index + length;
- }, 0);
- delta.reduce(function(index, op) {
- if (typeof op.delete === "number") {
- _this.scroll.deleteAt(index, op.delete);
- return index;
- }
- return index + (op.retain || op.insert.length || 1);
- }, 0);
- this.scroll.batchEnd();
- return this.update(delta);
- }
- }, {
- key: "deleteText",
- value: function deleteText(index, length) {
- this.scroll.deleteAt(index, length);
- return this.update(new _quillDelta2.default().retain(index).delete(length));
- }
- }, {
- key: "formatLine",
- value: function formatLine(index, length) {
- var _this2 = this;
- var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- this.scroll.update();
- Object.keys(formats).forEach(function(format) {
- if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;
- var lines = _this2.scroll.lines(index, Math.max(length, 1));
- var lengthRemaining = length;
- lines.forEach(function(line) {
- var lineLength = line.length();
- if (!(line instanceof _code2.default)) {
- line.format(format, formats[format]);
- } else {
- var codeIndex = index - line.offset(_this2.scroll);
- var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
- line.formatAt(codeIndex, codeLength, format, formats[format]);
- }
- lengthRemaining -= lineLength;
- });
- });
- this.scroll.optimize();
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: "formatText",
- value: function formatText(index, length) {
- var _this3 = this;
- var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- Object.keys(formats).forEach(function(format) {
- _this3.scroll.formatAt(index, length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));
- }
- }, {
- key: "getContents",
- value: function getContents(index, length) {
- return this.delta.slice(index, index + length);
- }
- }, {
- key: "getDelta",
- value: function getDelta() {
- return this.scroll.lines().reduce(function(delta, line) {
- return delta.concat(line.delta());
- }, new _quillDelta2.default());
- }
- }, {
- key: "getFormat",
- value: function getFormat(index) {
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var lines = [], leaves = [];
- if (length === 0) {
- this.scroll.path(index).forEach(function(path) {
- var _path = _slicedToArray(path, 1), blot = _path[0];
- if (blot instanceof _block2.default) {
- lines.push(blot);
- } else if (blot instanceof _parchment2.default.Leaf) {
- leaves.push(blot);
- }
- });
- } else {
- lines = this.scroll.lines(index, length);
- leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);
- }
- var formatsArr = [lines, leaves].map(function(blots) {
- if (blots.length === 0) return {};
- var formats = (0, _block.bubbleFormats)(blots.shift());
- while (Object.keys(formats).length > 0) {
- var blot = blots.shift();
- if (blot == null) return formats;
- formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
- }
- return formats;
- });
- return _extend2.default.apply(_extend2.default, formatsArr);
- }
- }, {
- key: "getText",
- value: function getText(index, length) {
- return this.getContents(index, length).filter(function(op) {
- return typeof op.insert === "string";
- }).map(function(op) {
- return op.insert;
- }).join("");
- }
- }, {
- key: "insertEmbed",
- value: function insertEmbed(index, embed, value) {
- this.scroll.insertAt(index, embed, value);
- return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));
- }
- }, {
- key: "insertText",
- value: function insertText(index, text) {
- var _this4 = this;
- var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- text = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
- this.scroll.insertAt(index, text);
- Object.keys(formats).forEach(function(format) {
- _this4.scroll.formatAt(index, text.length, format, formats[format]);
- });
- return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));
- }
- }, {
- key: "isBlank",
- value: function isBlank() {
- if (this.scroll.children.length == 0) return true;
- if (this.scroll.children.length > 1) return false;
- var block = this.scroll.children.head;
- if (block.statics.blotName !== _block2.default.blotName) return false;
- if (block.children.length > 1) return false;
- return block.children.head instanceof _break2.default;
- }
- }, {
- key: "removeFormat",
- value: function removeFormat(index, length) {
- var text = this.getText(index, length);
- var _scroll$line3 = this.scroll.line(index + length), _scroll$line4 = _slicedToArray(_scroll$line3, 2), line = _scroll$line4[0], offset = _scroll$line4[1];
- var suffixLength = 0, suffix = new _quillDelta2.default();
- if (line != null) {
- if (!(line instanceof _code2.default)) {
- suffixLength = line.length() - offset;
- } else {
- suffixLength = line.newlineIndex(offset) - offset + 1;
- }
- suffix = line.delta().slice(offset, offset + suffixLength - 1).insert("\n");
- }
- var contents = this.getContents(index, length + suffixLength);
- var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));
- var delta = new _quillDelta2.default().retain(index).concat(diff);
- return this.applyDelta(delta);
- }
- }, {
- key: "update",
- value: function update(change) {
- var mutations = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
- var cursorIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
- var oldDelta = this.delta;
- if (mutations.length === 1 && mutations[0].type === "characterData" && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
- var textBlot = _parchment2.default.find(mutations[0].target);
- var formats = (0, _block.bubbleFormats)(textBlot);
- var index = textBlot.offset(this.scroll);
- var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, "");
- var oldText = new _quillDelta2.default().insert(oldValue);
- var newText = new _quillDelta2.default().insert(textBlot.value());
- var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));
- change = diffDelta.reduce(function(delta, op) {
- if (op.insert) {
- return delta.insert(op.insert, formats);
- } else {
- return delta.push(op);
- }
- }, new _quillDelta2.default());
- this.delta = oldDelta.compose(change);
- } else {
- this.delta = this.getDelta();
- if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
- change = oldDelta.diff(this.delta, cursorIndex);
- }
- }
- return change;
- }
- }]);
- return Editor2;
- })();
- function combineFormats(formats, combined) {
- return Object.keys(combined).reduce(function(merged, name) {
- if (formats[name] == null) return merged;
- if (combined[name] === formats[name]) {
- merged[name] = combined[name];
- } else if (Array.isArray(combined[name])) {
- if (combined[name].indexOf(formats[name]) < 0) {
- merged[name] = combined[name].concat([formats[name]]);
- }
- } else {
- merged[name] = [combined[name], formats[name]];
- }
- return merged;
- }, {});
- }
- function normalizeDelta(delta) {
- return delta.reduce(function(delta2, op) {
- if (op.insert === 1) {
- var attributes = (0, _clone2.default)(op.attributes);
- delete attributes["image"];
- return delta2.insert({ image: op.attributes.image }, attributes);
- }
- if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
- op = (0, _clone2.default)(op);
- if (op.attributes.list) {
- op.attributes.list = "ordered";
- } else {
- op.attributes.list = "bullet";
- delete op.attributes.bullet;
- }
- }
- if (typeof op.insert === "string") {
- var text = op.insert.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
- return delta2.insert(text, op.attributes);
- }
- return delta2.push(op);
- }, new _quillDelta2.default());
- }
- exports2.default = Editor;
- }),
- /* 15 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.Range = void 0;
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _clone = __webpack_require__(21);
- var _clone2 = _interopRequireDefault(_clone);
- var _deepEqual = __webpack_require__(11);
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
- var _emitter3 = __webpack_require__(8);
- var _emitter4 = _interopRequireDefault(_emitter3);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _toConsumableArray(arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
- arr2[i] = arr[i];
- }
- return arr2;
- } else {
- return Array.from(arr);
- }
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var debug = (0, _logger2.default)("quill:selection");
- var Range = function Range2(index) {
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- _classCallCheck(this, Range2);
- this.index = index;
- this.length = length;
- };
- var Selection = (function() {
- function Selection2(scroll, emitter) {
- var _this = this;
- _classCallCheck(this, Selection2);
- this.emitter = emitter;
- this.scroll = scroll;
- this.composing = false;
- this.mouseDown = false;
- this.root = this.scroll.domNode;
- this.cursor = _parchment2.default.create("cursor", this);
- this.lastRange = this.savedRange = new Range(0, 0);
- this.handleComposition();
- this.handleDragging();
- this.emitter.listenDOM("selectionchange", document, function() {
- if (!_this.mouseDown) {
- setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
- }
- });
- this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type, delta) {
- if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
- _this.update(_emitter4.default.sources.SILENT);
- }
- });
- this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function() {
- if (!_this.hasFocus()) return;
- var native = _this.getNativeRange();
- if (native == null) return;
- if (native.start.node === _this.cursor.textNode) return;
- _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function() {
- try {
- _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
- } catch (ignored) {
- }
- });
- });
- this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function(mutations, context) {
- if (context.range) {
- var _context$range = context.range, startNode = _context$range.startNode, startOffset = _context$range.startOffset, endNode = _context$range.endNode, endOffset = _context$range.endOffset;
- _this.setNativeRange(startNode, startOffset, endNode, endOffset);
- }
- });
- this.update(_emitter4.default.sources.SILENT);
- }
- _createClass(Selection2, [{
- key: "handleComposition",
- value: function handleComposition() {
- var _this2 = this;
- this.root.addEventListener("compositionstart", function() {
- _this2.composing = true;
- });
- this.root.addEventListener("compositionend", function() {
- _this2.composing = false;
- if (_this2.cursor.parent) {
- var range = _this2.cursor.restore();
- if (!range) return;
- setTimeout(function() {
- _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
- }, 1);
- }
- });
- }
- }, {
- key: "handleDragging",
- value: function handleDragging() {
- var _this3 = this;
- this.emitter.listenDOM("mousedown", document.body, function() {
- _this3.mouseDown = true;
- });
- this.emitter.listenDOM("mouseup", document.body, function() {
- _this3.mouseDown = false;
- _this3.update(_emitter4.default.sources.USER);
- });
- }
- }, {
- key: "focus",
- value: function focus() {
- if (this.hasFocus()) return;
- this.root.focus();
- this.setRange(this.savedRange);
- }
- }, {
- key: "format",
- value: function format(_format, value) {
- if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;
- this.scroll.update();
- var nativeRange = this.getNativeRange();
- if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;
- if (nativeRange.start.node !== this.cursor.textNode) {
- var blot = _parchment2.default.find(nativeRange.start.node, false);
- if (blot == null) return;
- if (blot instanceof _parchment2.default.Leaf) {
- var after = blot.split(nativeRange.start.offset);
- blot.parent.insertBefore(this.cursor, after);
- } else {
- blot.insertBefore(this.cursor, nativeRange.start.node);
- }
- this.cursor.attach();
- }
- this.cursor.format(_format, value);
- this.scroll.optimize();
- this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
- this.update();
- }
- }, {
- key: "getBounds",
- value: function getBounds(index) {
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var scrollLength = this.scroll.length();
- index = Math.min(index, scrollLength - 1);
- length = Math.min(index + length, scrollLength - 1) - index;
- var node = void 0, _scroll$leaf = this.scroll.leaf(index), _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), leaf = _scroll$leaf2[0], offset = _scroll$leaf2[1];
- if (leaf == null) return null;
- var _leaf$position = leaf.position(offset, true);
- var _leaf$position2 = _slicedToArray(_leaf$position, 2);
- node = _leaf$position2[0];
- offset = _leaf$position2[1];
- var range = document.createRange();
- if (length > 0) {
- range.setStart(node, offset);
- var _scroll$leaf3 = this.scroll.leaf(index + length);
- var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
- leaf = _scroll$leaf4[0];
- offset = _scroll$leaf4[1];
- if (leaf == null) return null;
- var _leaf$position3 = leaf.position(offset, true);
- var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
- node = _leaf$position4[0];
- offset = _leaf$position4[1];
- range.setEnd(node, offset);
- return range.getBoundingClientRect();
- } else {
- var side = "left";
- var rect = void 0;
- if (node instanceof Text) {
- if (offset < node.data.length) {
- range.setStart(node, offset);
- range.setEnd(node, offset + 1);
- } else {
- range.setStart(node, offset - 1);
- range.setEnd(node, offset);
- side = "right";
- }
- rect = range.getBoundingClientRect();
- } else {
- rect = leaf.domNode.getBoundingClientRect();
- if (offset > 0) side = "right";
- }
- return {
- bottom: rect.top + rect.height,
- height: rect.height,
- left: rect[side],
- right: rect[side],
- top: rect.top,
- width: 0
- };
- }
- }
- }, {
- key: "getNativeRange",
- value: function getNativeRange() {
- var selection = document.getSelection();
- if (selection == null || selection.rangeCount <= 0) return null;
- var nativeRange = selection.getRangeAt(0);
- if (nativeRange == null) return null;
- var range = this.normalizeNative(nativeRange);
- debug.info("getNativeRange", range);
- return range;
- }
- }, {
- key: "getRange",
- value: function getRange() {
- var normalized = this.getNativeRange();
- if (normalized == null) return [null, null];
- var range = this.normalizedToRange(normalized);
- return [range, normalized];
- }
- }, {
- key: "hasFocus",
- value: function hasFocus() {
- return document.activeElement === this.root;
- }
- }, {
- key: "normalizedToRange",
- value: function normalizedToRange(range) {
- var _this4 = this;
- var positions = [[range.start.node, range.start.offset]];
- if (!range.native.collapsed) {
- positions.push([range.end.node, range.end.offset]);
- }
- var indexes = positions.map(function(position) {
- var _position = _slicedToArray(position, 2), node = _position[0], offset = _position[1];
- var blot = _parchment2.default.find(node, true);
- var index = blot.offset(_this4.scroll);
- if (offset === 0) {
- return index;
- } else if (blot instanceof _parchment2.default.Container) {
- return index + blot.length();
- } else {
- return index + blot.index(node, offset);
- }
- });
- var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
- var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
- return new Range(start, end - start);
- }
- }, {
- key: "normalizeNative",
- value: function normalizeNative(nativeRange) {
- if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {
- return null;
- }
- var range = {
- start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
- end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
- native: nativeRange
- };
- [range.start, range.end].forEach(function(position) {
- var node = position.node, offset = position.offset;
- while (!(node instanceof Text) && node.childNodes.length > 0) {
- if (node.childNodes.length > offset) {
- node = node.childNodes[offset];
- offset = 0;
- } else if (node.childNodes.length === offset) {
- node = node.lastChild;
- offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;
- } else {
- break;
- }
- }
- position.node = node, position.offset = offset;
- });
- return range;
- }
- }, {
- key: "rangeToNative",
- value: function rangeToNative(range) {
- var _this5 = this;
- var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
- var args = [];
- var scrollLength = this.scroll.length();
- indexes.forEach(function(index, i) {
- index = Math.min(scrollLength - 1, index);
- var node = void 0, _scroll$leaf5 = _this5.scroll.leaf(index), _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), leaf = _scroll$leaf6[0], offset = _scroll$leaf6[1];
- var _leaf$position5 = leaf.position(offset, i !== 0);
- var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
- node = _leaf$position6[0];
- offset = _leaf$position6[1];
- args.push(node, offset);
- });
- if (args.length < 2) {
- args = args.concat(args);
- }
- return args;
- }
- }, {
- key: "scrollIntoView",
- value: function scrollIntoView(scrollingContainer) {
- var range = this.lastRange;
- if (range == null) return;
- var bounds = this.getBounds(range.index, range.length);
- if (bounds == null) return;
- var limit = this.scroll.length() - 1;
- var _scroll$line = this.scroll.line(Math.min(range.index, limit)), _scroll$line2 = _slicedToArray(_scroll$line, 1), first = _scroll$line2[0];
- var last = first;
- if (range.length > 0) {
- var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
- var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
- last = _scroll$line4[0];
- }
- if (first == null || last == null) return;
- var scrollBounds = scrollingContainer.getBoundingClientRect();
- if (bounds.top < scrollBounds.top) {
- scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
- } else if (bounds.bottom > scrollBounds.bottom) {
- scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
- }
- }
- }, {
- key: "setNativeRange",
- value: function setNativeRange(startNode, startOffset) {
- var endNode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : startNode;
- var endOffset = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : startOffset;
- var force = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
- debug.info("setNativeRange", startNode, startOffset, endNode, endOffset);
- if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
- return;
- }
- var selection = document.getSelection();
- if (selection == null) return;
- if (startNode != null) {
- if (!this.hasFocus()) this.root.focus();
- var native = (this.getNativeRange() || {}).native;
- if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
- if (startNode.tagName == "BR") {
- startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
- startNode = startNode.parentNode;
- }
- if (endNode.tagName == "BR") {
- endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
- endNode = endNode.parentNode;
- }
- var range = document.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- } else {
- selection.removeAllRanges();
- this.root.blur();
- document.body.focus();
- }
- }
- }, {
- key: "setRange",
- value: function setRange(range) {
- var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
- if (typeof force === "string") {
- source = force;
- force = false;
- }
- debug.info("setRange", range);
- if (range != null) {
- var args = this.rangeToNative(range);
- this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
- } else {
- this.setNativeRange(null);
- }
- this.update(source);
- }
- }, {
- key: "update",
- value: function update() {
- var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
- var oldRange = this.lastRange;
- var _getRange = this.getRange(), _getRange2 = _slicedToArray(_getRange, 2), lastRange = _getRange2[0], nativeRange = _getRange2[1];
- this.lastRange = lastRange;
- if (this.lastRange != null) {
- this.savedRange = this.lastRange;
- }
- if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
- var _emitter;
- if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
- this.cursor.restore();
- }
- var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
- (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
- if (source !== _emitter4.default.sources.SILENT) {
- var _emitter2;
- (_emitter2 = this.emitter).emit.apply(_emitter2, args);
- }
- }
- }
- }]);
- return Selection2;
- })();
- function contains(parent, descendant) {
- try {
- descendant.parentNode;
- } catch (e) {
- return false;
- }
- if (descendant instanceof Text) {
- descendant = descendant.parentNode;
- }
- return parent.contains(descendant);
- }
- exports2.Range = Range;
- exports2.default = Selection;
- }),
- /* 16 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Break = (function(_Parchment$Embed) {
- _inherits(Break2, _Parchment$Embed);
- function Break2() {
- _classCallCheck(this, Break2);
- return _possibleConstructorReturn(this, (Break2.__proto__ || Object.getPrototypeOf(Break2)).apply(this, arguments));
- }
- _createClass(Break2, [{
- key: "insertInto",
- value: function insertInto(parent, ref2) {
- if (parent.children.length === 0) {
- _get(Break2.prototype.__proto__ || Object.getPrototypeOf(Break2.prototype), "insertInto", this).call(this, parent, ref2);
- } else {
- this.remove();
- }
- }
- }, {
- key: "length",
- value: function length() {
- return 0;
- }
- }, {
- key: "value",
- value: function value() {
- return "";
- }
- }], [{
- key: "value",
- value: function value() {
- return void 0;
- }
- }]);
- return Break2;
- })(_parchment2.default.Embed);
- Break.blotName = "break";
- Break.tagName = "BR";
- exports2.default = Break;
- }),
- /* 17 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var linked_list_1 = __webpack_require__(44);
- var shadow_1 = __webpack_require__(30);
- var Registry = __webpack_require__(1);
- var ContainerBlot = (
- /** @class */
- (function(_super) {
- __extends(ContainerBlot2, _super);
- function ContainerBlot2(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.build();
- return _this;
- }
- ContainerBlot2.prototype.appendChild = function(other) {
- this.insertBefore(other);
- };
- ContainerBlot2.prototype.attach = function() {
- _super.prototype.attach.call(this);
- this.children.forEach(function(child) {
- child.attach();
- });
- };
- ContainerBlot2.prototype.build = function() {
- var _this = this;
- this.children = new linked_list_1.default();
- [].slice.call(this.domNode.childNodes).reverse().forEach(function(node) {
- try {
- var child = makeBlot(node);
- _this.insertBefore(child, _this.children.head || void 0);
- } catch (err) {
- if (err instanceof Registry.ParchmentError)
- return;
- else
- throw err;
- }
- });
- };
- ContainerBlot2.prototype.deleteAt = function(index, length) {
- if (index === 0 && length === this.length()) {
- return this.remove();
- }
- this.children.forEachAt(index, length, function(child, offset, length2) {
- child.deleteAt(offset, length2);
- });
- };
- ContainerBlot2.prototype.descendant = function(criteria, index) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
- return [child, offset];
- } else if (child instanceof ContainerBlot2) {
- return child.descendant(criteria, offset);
- } else {
- return [null, -1];
- }
- };
- ContainerBlot2.prototype.descendants = function(criteria, index, length) {
- if (index === void 0) {
- index = 0;
- }
- if (length === void 0) {
- length = Number.MAX_VALUE;
- }
- var descendants = [];
- var lengthLeft = length;
- this.children.forEachAt(index, length, function(child, index2, length2) {
- if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
- descendants.push(child);
- }
- if (child instanceof ContainerBlot2) {
- descendants = descendants.concat(child.descendants(criteria, index2, lengthLeft));
- }
- lengthLeft -= length2;
- });
- return descendants;
- };
- ContainerBlot2.prototype.detach = function() {
- this.children.forEach(function(child) {
- child.detach();
- });
- _super.prototype.detach.call(this);
- };
- ContainerBlot2.prototype.formatAt = function(index, length, name, value) {
- this.children.forEachAt(index, length, function(child, offset, length2) {
- child.formatAt(offset, length2, name, value);
- });
- };
- ContainerBlot2.prototype.insertAt = function(index, value, def) {
- var _a = this.children.find(index), child = _a[0], offset = _a[1];
- if (child) {
- child.insertAt(offset, value, def);
- } else {
- var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
- this.appendChild(blot);
- }
- };
- ContainerBlot2.prototype.insertBefore = function(childBlot, refBlot) {
- if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function(child) {
- return childBlot instanceof child;
- })) {
- throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
- }
- childBlot.insertInto(this, refBlot);
- };
- ContainerBlot2.prototype.length = function() {
- return this.children.reduce(function(memo, child) {
- return memo + child.length();
- }, 0);
- };
- ContainerBlot2.prototype.moveChildren = function(targetParent, refNode) {
- this.children.forEach(function(child) {
- targetParent.insertBefore(child, refNode);
- });
- };
- ContainerBlot2.prototype.optimize = function(context) {
- _super.prototype.optimize.call(this, context);
- if (this.children.length === 0) {
- if (this.statics.defaultChild != null) {
- var child = Registry.create(this.statics.defaultChild);
- this.appendChild(child);
- child.optimize(context);
- } else {
- this.remove();
- }
- }
- };
- ContainerBlot2.prototype.path = function(index, inclusive) {
- if (inclusive === void 0) {
- inclusive = false;
- }
- var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];
- var position = [[this, index]];
- if (child instanceof ContainerBlot2) {
- return position.concat(child.path(offset, inclusive));
- } else if (child != null) {
- position.push([child, offset]);
- }
- return position;
- };
- ContainerBlot2.prototype.removeChild = function(child) {
- this.children.remove(child);
- };
- ContainerBlot2.prototype.replace = function(target) {
- if (target instanceof ContainerBlot2) {
- target.moveChildren(this);
- }
- _super.prototype.replace.call(this, target);
- };
- ContainerBlot2.prototype.split = function(index, force) {
- if (force === void 0) {
- force = false;
- }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = this.clone();
- this.parent.insertBefore(after, this.next);
- this.children.forEachAt(index, this.length(), function(child, offset, length) {
- child = child.split(offset, force);
- after.appendChild(child);
- });
- return after;
- };
- ContainerBlot2.prototype.unwrap = function() {
- this.moveChildren(this.parent, this.next);
- this.remove();
- };
- ContainerBlot2.prototype.update = function(mutations, context) {
- var _this = this;
- var addedNodes = [];
- var removedNodes = [];
- mutations.forEach(function(mutation) {
- if (mutation.target === _this.domNode && mutation.type === "childList") {
- addedNodes.push.apply(addedNodes, mutation.addedNodes);
- removedNodes.push.apply(removedNodes, mutation.removedNodes);
- }
- });
- removedNodes.forEach(function(node) {
- if (node.parentNode != null && // @ts-ignore
- node.tagName !== "IFRAME" && document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return;
- }
- var blot = Registry.find(node);
- if (blot == null)
- return;
- if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
- blot.detach();
- }
- });
- addedNodes.filter(function(node) {
- return node.parentNode == _this.domNode;
- }).sort(function(a, b) {
- if (a === b)
- return 0;
- if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {
- return 1;
- }
- return -1;
- }).forEach(function(node) {
- var refBlot = null;
- if (node.nextSibling != null) {
- refBlot = Registry.find(node.nextSibling);
- }
- var blot = makeBlot(node);
- if (blot.next != refBlot || blot.next == null) {
- if (blot.parent != null) {
- blot.parent.removeChild(_this);
- }
- _this.insertBefore(blot, refBlot || void 0);
- }
- });
- };
- return ContainerBlot2;
- })(shadow_1.default)
- );
- function makeBlot(node) {
- var blot = Registry.find(node);
- if (blot == null) {
- try {
- blot = Registry.create(node);
- } catch (e) {
- blot = Registry.create(Registry.Scope.INLINE);
- [].slice.call(node.childNodes).forEach(function(child) {
- blot.domNode.appendChild(child);
- });
- if (node.parentNode) {
- node.parentNode.replaceChild(blot.domNode, node);
- }
- blot.attach();
- }
- }
- return blot;
- }
- exports2.default = ContainerBlot;
- }),
- /* 18 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var store_1 = __webpack_require__(31);
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(1);
- var FormatBlot = (
- /** @class */
- (function(_super) {
- __extends(FormatBlot2, _super);
- function FormatBlot2(domNode) {
- var _this = _super.call(this, domNode) || this;
- _this.attributes = new store_1.default(_this.domNode);
- return _this;
- }
- FormatBlot2.formats = function(domNode) {
- if (typeof this.tagName === "string") {
- return true;
- } else if (Array.isArray(this.tagName)) {
- return domNode.tagName.toLowerCase();
- }
- return void 0;
- };
- FormatBlot2.prototype.format = function(name, value) {
- var format = Registry.query(name);
- if (format instanceof attributor_1.default) {
- this.attributes.attribute(format, value);
- } else if (value) {
- if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {
- this.replaceWith(name, value);
- }
- }
- };
- FormatBlot2.prototype.formats = function() {
- var formats = this.attributes.values();
- var format = this.statics.formats(this.domNode);
- if (format != null) {
- formats[this.statics.blotName] = format;
- }
- return formats;
- };
- FormatBlot2.prototype.replaceWith = function(name, value) {
- var replacement = _super.prototype.replaceWith.call(this, name, value);
- this.attributes.copy(replacement);
- return replacement;
- };
- FormatBlot2.prototype.update = function(mutations, context) {
- var _this = this;
- _super.prototype.update.call(this, mutations, context);
- if (mutations.some(function(mutation) {
- return mutation.target === _this.domNode && mutation.type === "attributes";
- })) {
- this.attributes.build();
- }
- };
- FormatBlot2.prototype.wrap = function(name, value) {
- var wrapper = _super.prototype.wrap.call(this, name, value);
- if (wrapper instanceof FormatBlot2 && wrapper.statics.scope === this.statics.scope) {
- this.attributes.move(wrapper);
- }
- return wrapper;
- };
- return FormatBlot2;
- })(container_1.default)
- );
- exports2.default = FormatBlot;
- }),
- /* 19 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var shadow_1 = __webpack_require__(30);
- var Registry = __webpack_require__(1);
- var LeafBlot = (
- /** @class */
- (function(_super) {
- __extends(LeafBlot2, _super);
- function LeafBlot2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- LeafBlot2.value = function(domNode) {
- return true;
- };
- LeafBlot2.prototype.index = function(node, offset) {
- if (this.domNode === node || this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
- return Math.min(offset, 1);
- }
- return -1;
- };
- LeafBlot2.prototype.position = function(index, inclusive) {
- var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
- if (index > 0)
- offset += 1;
- return [this.parent.domNode, offset];
- };
- LeafBlot2.prototype.value = function() {
- var _a;
- return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;
- };
- LeafBlot2.scope = Registry.Scope.INLINE_BLOT;
- return LeafBlot2;
- })(shadow_1.default)
- );
- exports2.default = LeafBlot;
- }),
- /* 20 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- var equal = __webpack_require__(11);
- var extend = __webpack_require__(3);
- var lib = {
- attributes: {
- compose: function(a, b, keepNull) {
- if (typeof a !== "object") a = {};
- if (typeof b !== "object") b = {};
- var attributes = extend(true, {}, b);
- if (!keepNull) {
- attributes = Object.keys(attributes).reduce(function(copy, key2) {
- if (attributes[key2] != null) {
- copy[key2] = attributes[key2];
- }
- return copy;
- }, {});
- }
- for (var key in a) {
- if (a[key] !== void 0 && b[key] === void 0) {
- attributes[key] = a[key];
- }
- }
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- },
- diff: function(a, b) {
- if (typeof a !== "object") a = {};
- if (typeof b !== "object") b = {};
- var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function(attributes2, key) {
- if (!equal(a[key], b[key])) {
- attributes2[key] = b[key] === void 0 ? null : b[key];
- }
- return attributes2;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- },
- transform: function(a, b, priority) {
- if (typeof a !== "object") return b;
- if (typeof b !== "object") return void 0;
- if (!priority) return b;
- var attributes = Object.keys(b).reduce(function(attributes2, key) {
- if (a[key] === void 0) attributes2[key] = b[key];
- return attributes2;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- }
- },
- iterator: function(ops) {
- return new Iterator(ops);
- },
- length: function(op) {
- if (typeof op["delete"] === "number") {
- return op["delete"];
- } else if (typeof op.retain === "number") {
- return op.retain;
- } else {
- return typeof op.insert === "string" ? op.insert.length : 1;
- }
- }
- };
- function Iterator(ops) {
- this.ops = ops;
- this.index = 0;
- this.offset = 0;
- }
- ;
- Iterator.prototype.hasNext = function() {
- return this.peekLength() < Infinity;
- };
- Iterator.prototype.next = function(length) {
- if (!length) length = Infinity;
- var nextOp = this.ops[this.index];
- if (nextOp) {
- var offset = this.offset;
- var opLength = lib.length(nextOp);
- if (length >= opLength - offset) {
- length = opLength - offset;
- this.index += 1;
- this.offset = 0;
- } else {
- this.offset += length;
- }
- if (typeof nextOp["delete"] === "number") {
- return { "delete": length };
- } else {
- var retOp = {};
- if (nextOp.attributes) {
- retOp.attributes = nextOp.attributes;
- }
- if (typeof nextOp.retain === "number") {
- retOp.retain = length;
- } else if (typeof nextOp.insert === "string") {
- retOp.insert = nextOp.insert.substr(offset, length);
- } else {
- retOp.insert = nextOp.insert;
- }
- return retOp;
- }
- } else {
- return { retain: Infinity };
- }
- };
- Iterator.prototype.peek = function() {
- return this.ops[this.index];
- };
- Iterator.prototype.peekLength = function() {
- if (this.ops[this.index]) {
- return lib.length(this.ops[this.index]) - this.offset;
- } else {
- return Infinity;
- }
- };
- Iterator.prototype.peekType = function() {
- if (this.ops[this.index]) {
- if (typeof this.ops[this.index]["delete"] === "number") {
- return "delete";
- } else if (typeof this.ops[this.index].retain === "number") {
- return "retain";
- } else {
- return "insert";
- }
- }
- return "retain";
- };
- Iterator.prototype.rest = function() {
- if (!this.hasNext()) {
- return [];
- } else if (this.offset === 0) {
- return this.ops.slice(this.index);
- } else {
- var offset = this.offset;
- var index = this.index;
- var next = this.next();
- var rest = this.ops.slice(this.index);
- this.offset = offset;
- this.index = index;
- return [next].concat(rest);
- }
- };
- module2.exports = lib;
- }),
- /* 21 */
- /***/
- (function(module2, exports2) {
- var clone = (function() {
- "use strict";
- function _instanceof(obj, type) {
- return type != null && obj instanceof type;
- }
- var nativeMap;
- try {
- nativeMap = Map;
- } catch (_) {
- nativeMap = function() {
- };
- }
- var nativeSet;
- try {
- nativeSet = Set;
- } catch (_) {
- nativeSet = function() {
- };
- }
- var nativePromise;
- try {
- nativePromise = Promise;
- } catch (_) {
- nativePromise = function() {
- };
- }
- function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
- if (typeof circular === "object") {
- depth = circular.depth;
- prototype = circular.prototype;
- includeNonEnumerable = circular.includeNonEnumerable;
- circular = circular.circular;
- }
- var allParents = [];
- var allChildren = [];
- var useBuffer = typeof Buffer != "undefined";
- if (typeof circular == "undefined")
- circular = true;
- if (typeof depth == "undefined")
- depth = Infinity;
- function _clone(parent2, depth2) {
- if (parent2 === null)
- return null;
- if (depth2 === 0)
- return parent2;
- var child;
- var proto;
- if (typeof parent2 != "object") {
- return parent2;
- }
- if (_instanceof(parent2, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent2, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent2, nativePromise)) {
- child = new nativePromise(function(resolve, reject) {
- parent2.then(function(value) {
- resolve(_clone(value, depth2 - 1));
- }, function(err) {
- reject(_clone(err, depth2 - 1));
- });
- });
- } else if (clone2.__isArray(parent2)) {
- child = [];
- } else if (clone2.__isRegExp(parent2)) {
- child = new RegExp(parent2.source, __getRegExpFlags(parent2));
- if (parent2.lastIndex) child.lastIndex = parent2.lastIndex;
- } else if (clone2.__isDate(parent2)) {
- child = new Date(parent2.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent2)) {
- if (Buffer.allocUnsafe) {
- child = Buffer.allocUnsafe(parent2.length);
- } else {
- child = new Buffer(parent2.length);
- }
- parent2.copy(child);
- return child;
- } else if (_instanceof(parent2, Error)) {
- child = Object.create(parent2);
- } else {
- if (typeof prototype == "undefined") {
- proto = Object.getPrototypeOf(parent2);
- child = Object.create(proto);
- } else {
- child = Object.create(prototype);
- proto = prototype;
- }
- }
- if (circular) {
- var index = allParents.indexOf(parent2);
- if (index != -1) {
- return allChildren[index];
- }
- allParents.push(parent2);
- allChildren.push(child);
- }
- if (_instanceof(parent2, nativeMap)) {
- parent2.forEach(function(value, key) {
- var keyChild = _clone(key, depth2 - 1);
- var valueChild = _clone(value, depth2 - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent2, nativeSet)) {
- parent2.forEach(function(value) {
- var entryChild = _clone(value, depth2 - 1);
- child.add(entryChild);
- });
- }
- for (var i in parent2) {
- var attrs;
- if (proto) {
- attrs = Object.getOwnPropertyDescriptor(proto, i);
- }
- if (attrs && attrs.set == null) {
- continue;
- }
- child[i] = _clone(parent2[i], depth2 - 1);
- }
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent2);
- for (var i = 0; i < symbols.length; i++) {
- var symbol = symbols[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent2[symbol], depth2 - 1);
- if (!descriptor.enumerable) {
- Object.defineProperty(child, symbol, {
- enumerable: false
- });
- }
- }
- }
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent2);
- for (var i = 0; i < allPropertyNames.length; i++) {
- var propertyName = allPropertyNames[i];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
- Object.defineProperty(child, propertyName, {
- enumerable: false
- });
- }
- }
- return child;
- }
- return _clone(parent, depth);
- }
- clone2.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
- var c = function() {
- };
- c.prototype = parent;
- return new c();
- };
- function __objToStr(o) {
- return Object.prototype.toString.call(o);
- }
- clone2.__objToStr = __objToStr;
- function __isDate(o) {
- return typeof o === "object" && __objToStr(o) === "[object Date]";
- }
- clone2.__isDate = __isDate;
- function __isArray(o) {
- return typeof o === "object" && __objToStr(o) === "[object Array]";
- }
- clone2.__isArray = __isArray;
- function __isRegExp(o) {
- return typeof o === "object" && __objToStr(o) === "[object RegExp]";
- }
- clone2.__isRegExp = __isRegExp;
- function __getRegExpFlags(re) {
- var flags = "";
- if (re.global) flags += "g";
- if (re.ignoreCase) flags += "i";
- if (re.multiline) flags += "m";
- return flags;
- }
- clone2.__getRegExpFlags = __getRegExpFlags;
- return clone2;
- })();
- if (typeof module2 === "object" && module2.exports) {
- module2.exports = clone;
- }
- }),
- /* 22 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _emitter = __webpack_require__(8);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- var _break = __webpack_require__(16);
- var _break2 = _interopRequireDefault(_break);
- var _code = __webpack_require__(13);
- var _code2 = _interopRequireDefault(_code);
- var _container = __webpack_require__(25);
- var _container2 = _interopRequireDefault(_container);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- function isLine(blot) {
- return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
- }
- var Scroll = (function(_Parchment$Scroll) {
- _inherits(Scroll2, _Parchment$Scroll);
- function Scroll2(domNode, config) {
- _classCallCheck(this, Scroll2);
- var _this = _possibleConstructorReturn(this, (Scroll2.__proto__ || Object.getPrototypeOf(Scroll2)).call(this, domNode));
- _this.emitter = config.emitter;
- if (Array.isArray(config.whitelist)) {
- _this.whitelist = config.whitelist.reduce(function(whitelist, format) {
- whitelist[format] = true;
- return whitelist;
- }, {});
- }
- _this.domNode.addEventListener("DOMNodeInserted", function() {
- });
- _this.optimize();
- _this.enable();
- return _this;
- }
- _createClass(Scroll2, [{
- key: "batchStart",
- value: function batchStart() {
- this.batch = true;
- }
- }, {
- key: "batchEnd",
- value: function batchEnd() {
- this.batch = false;
- this.optimize();
- }
- }, {
- key: "deleteAt",
- value: function deleteAt(index, length) {
- var _line = this.line(index), _line2 = _slicedToArray(_line, 2), first = _line2[0], offset = _line2[1];
- var _line3 = this.line(index + length), _line4 = _slicedToArray(_line3, 1), last = _line4[0];
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "deleteAt", this).call(this, index, length);
- if (last != null && first !== last && offset > 0) {
- if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
- this.optimize();
- return;
- }
- if (first instanceof _code2.default) {
- var newlineIndex = first.newlineIndex(first.length(), true);
- if (newlineIndex > -1) {
- first = first.split(newlineIndex + 1);
- if (first === last) {
- this.optimize();
- return;
- }
- }
- } else if (last instanceof _code2.default) {
- var _newlineIndex = last.newlineIndex(0);
- if (_newlineIndex > -1) {
- last.split(_newlineIndex + 1);
- }
- }
- var ref2 = last.children.head instanceof _break2.default ? null : last.children.head;
- first.moveChildren(last, ref2);
- first.remove();
- }
- this.optimize();
- }
- }, {
- key: "enable",
- value: function enable() {
- var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
- this.domNode.setAttribute("contenteditable", enabled);
- }
- }, {
- key: "formatAt",
- value: function formatAt(index, length, format, value) {
- if (this.whitelist != null && !this.whitelist[format]) return;
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "formatAt", this).call(this, index, length, format, value);
- this.optimize();
- }
- }, {
- key: "insertAt",
- value: function insertAt(index, value, def) {
- if (def != null && this.whitelist != null && !this.whitelist[value]) return;
- if (index >= this.length()) {
- if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {
- var blot = _parchment2.default.create(this.statics.defaultChild);
- this.appendChild(blot);
- if (def == null && value.endsWith("\n")) {
- value = value.slice(0, -1);
- }
- blot.insertAt(0, value, def);
- } else {
- var embed = _parchment2.default.create(value, def);
- this.appendChild(embed);
- }
- } else {
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertAt", this).call(this, index, value, def);
- }
- this.optimize();
- }
- }, {
- key: "insertBefore",
- value: function insertBefore(blot, ref2) {
- if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
- var wrapper = _parchment2.default.create(this.statics.defaultChild);
- wrapper.appendChild(blot);
- blot = wrapper;
- }
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertBefore", this).call(this, blot, ref2);
- }
- }, {
- key: "leaf",
- value: function leaf(index) {
- return this.path(index).pop() || [null, -1];
- }
- }, {
- key: "line",
- value: function line(index) {
- if (index === this.length()) {
- return this.line(index - 1);
- }
- return this.descendant(isLine, index);
- }
- }, {
- key: "lines",
- value: function lines() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
- var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
- var getLines = function getLines2(blot, index2, length2) {
- var lines2 = [], lengthLeft = length2;
- blot.children.forEachAt(index2, length2, function(child, index3, length3) {
- if (isLine(child)) {
- lines2.push(child);
- } else if (child instanceof _parchment2.default.Container) {
- lines2 = lines2.concat(getLines2(child, index3, lengthLeft));
- }
- lengthLeft -= length3;
- });
- return lines2;
- };
- return getLines(this, index, length);
- }
- }, {
- key: "optimize",
- value: function optimize() {
- var mutations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
- var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- if (this.batch === true) return;
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "optimize", this).call(this, mutations, context);
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
- }
- }
- }, {
- key: "path",
- value: function path(index) {
- return _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "path", this).call(this, index).slice(1);
- }
- }, {
- key: "update",
- value: function update(mutations) {
- if (this.batch === true) return;
- var source = _emitter2.default.sources.USER;
- if (typeof mutations === "string") {
- source = mutations;
- }
- if (!Array.isArray(mutations)) {
- mutations = this.observer.takeRecords();
- }
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
- }
- _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "update", this).call(this, mutations.concat([]));
- if (mutations.length > 0) {
- this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
- }
- }
- }]);
- return Scroll2;
- })(_parchment2.default.Scroll);
- Scroll.blotName = "scroll";
- Scroll.className = "ql-editor";
- Scroll.tagName = "DIV";
- Scroll.defaultChild = "block";
- Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
- exports2.default = Scroll;
- }),
- /* 23 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.SHORTKEY = exports2.default = void 0;
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _clone = __webpack_require__(21);
- var _clone2 = _interopRequireDefault(_clone);
- var _deepEqual = __webpack_require__(11);
- var _deepEqual2 = _interopRequireDefault(_deepEqual);
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _op = __webpack_require__(20);
- var _op2 = _interopRequireDefault(_op);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var debug = (0, _logger2.default)("quill:keyboard");
- var SHORTKEY = /Mac/i.test(navigator.platform) ? "metaKey" : "ctrlKey";
- var Keyboard = (function(_Module) {
- _inherits(Keyboard2, _Module);
- _createClass(Keyboard2, null, [{
- key: "match",
- value: function match(evt, binding) {
- binding = normalize(binding);
- if (["altKey", "ctrlKey", "metaKey", "shiftKey"].some(function(key) {
- return !!binding[key] !== evt[key] && binding[key] !== null;
- })) {
- return false;
- }
- return binding.key === (evt.which || evt.keyCode);
- }
- }]);
- function Keyboard2(quill, options) {
- _classCallCheck(this, Keyboard2);
- var _this = _possibleConstructorReturn(this, (Keyboard2.__proto__ || Object.getPrototypeOf(Keyboard2)).call(this, quill, options));
- _this.bindings = {};
- Object.keys(_this.options.bindings).forEach(function(name) {
- if (name === "list autofill" && quill.scroll.whitelist != null && !quill.scroll.whitelist["list"]) {
- return;
- }
- if (_this.options.bindings[name]) {
- _this.addBinding(_this.options.bindings[name]);
- }
- });
- _this.addBinding({ key: Keyboard2.keys.ENTER, shiftKey: null }, handleEnter);
- _this.addBinding({ key: Keyboard2.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {
- });
- if (/Firefox/i.test(navigator.userAgent)) {
- _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
- _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true }, handleDelete);
- } else {
- _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
- _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
- }
- _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: false }, handleDeleteRange);
- _this.addBinding({ key: Keyboard2.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
- _this.listen();
- return _this;
- }
- _createClass(Keyboard2, [{
- key: "addBinding",
- value: function addBinding(key) {
- var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- var handler = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var binding = normalize(key);
- if (binding == null || binding.key == null) {
- return debug.warn("Attempted to add invalid keyboard binding", binding);
- }
- if (typeof context === "function") {
- context = { handler: context };
- }
- if (typeof handler === "function") {
- handler = { handler };
- }
- binding = (0, _extend2.default)(binding, context, handler);
- this.bindings[binding.key] = this.bindings[binding.key] || [];
- this.bindings[binding.key].push(binding);
- }
- }, {
- key: "listen",
- value: function listen() {
- var _this2 = this;
- this.quill.root.addEventListener("keydown", function(evt) {
- if (evt.defaultPrevented) return;
- var which = evt.which || evt.keyCode;
- var bindings = (_this2.bindings[which] || []).filter(function(binding) {
- return Keyboard2.match(evt, binding);
- });
- if (bindings.length === 0) return;
- var range = _this2.quill.getSelection();
- if (range == null || !_this2.quill.hasFocus()) return;
- var _quill$getLine = _this2.quill.getLine(range.index), _quill$getLine2 = _slicedToArray(_quill$getLine, 2), line = _quill$getLine2[0], offset = _quill$getLine2[1];
- var _quill$getLeaf = _this2.quill.getLeaf(range.index), _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), leafStart = _quill$getLeaf2[0], offsetStart = _quill$getLeaf2[1];
- var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), _ref2 = _slicedToArray(_ref, 2), leafEnd = _ref2[0], offsetEnd = _ref2[1];
- var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : "";
- var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : "";
- var curContext = {
- collapsed: range.length === 0,
- empty: range.length === 0 && line.length() <= 1,
- format: _this2.quill.getFormat(range),
- offset,
- prefix: prefixText,
- suffix: suffixText
- };
- var prevented = bindings.some(function(binding) {
- if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;
- if (binding.empty != null && binding.empty !== curContext.empty) return false;
- if (binding.offset != null && binding.offset !== curContext.offset) return false;
- if (Array.isArray(binding.format)) {
- if (binding.format.every(function(name) {
- return curContext.format[name] == null;
- })) {
- return false;
- }
- } else if (_typeof(binding.format) === "object") {
- if (!Object.keys(binding.format).every(function(name) {
- if (binding.format[name] === true) return curContext.format[name] != null;
- if (binding.format[name] === false) return curContext.format[name] == null;
- return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);
- })) {
- return false;
- }
- }
- if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;
- if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;
- return binding.handler.call(_this2, range, curContext) !== true;
- });
- if (prevented) {
- evt.preventDefault();
- }
- });
- }
- }]);
- return Keyboard2;
- })(_module2.default);
- Keyboard.keys = {
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- ESCAPE: 27,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DELETE: 46
- };
- Keyboard.DEFAULTS = {
- bindings: {
- "bold": makeFormatHandler("bold"),
- "italic": makeFormatHandler("italic"),
- "underline": makeFormatHandler("underline"),
- "indent": {
- // highlight tab or tab at beginning of list, indent or blockquote
- key: Keyboard.keys.TAB,
- format: ["blockquote", "indent", "list"],
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format("indent", "+1", _quill2.default.sources.USER);
- }
- },
- "outdent": {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- format: ["blockquote", "indent", "list"],
- // highlight tab or tab at beginning of list, indent or blockquote
- handler: function handler(range, context) {
- if (context.collapsed && context.offset !== 0) return true;
- this.quill.format("indent", "-1", _quill2.default.sources.USER);
- }
- },
- "outdent backspace": {
- key: Keyboard.keys.BACKSPACE,
- collapsed: true,
- shiftKey: null,
- metaKey: null,
- ctrlKey: null,
- altKey: null,
- format: ["indent", "list"],
- offset: 0,
- handler: function handler(range, context) {
- if (context.format.indent != null) {
- this.quill.format("indent", "-1", _quill2.default.sources.USER);
- } else if (context.format.list != null) {
- this.quill.format("list", false, _quill2.default.sources.USER);
- }
- }
- },
- "indent code-block": makeCodeBlockHandler(true),
- "outdent code-block": makeCodeBlockHandler(false),
- "remove tab": {
- key: Keyboard.keys.TAB,
- shiftKey: true,
- collapsed: true,
- prefix: /\t$/,
- handler: function handler(range) {
- this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
- }
- },
- "tab": {
- key: Keyboard.keys.TAB,
- handler: function handler(range) {
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert(" ");
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- }
- },
- "list empty enter": {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ["list"],
- empty: true,
- handler: function handler(range, context) {
- this.quill.format("list", false, _quill2.default.sources.USER);
- if (context.format.indent) {
- this.quill.format("indent", false, _quill2.default.sources.USER);
- }
- }
- },
- "checklist enter": {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: { list: "checked" },
- handler: function handler(range) {
- var _quill$getLine3 = this.quill.getLine(range.index), _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), line = _quill$getLine4[0], offset = _quill$getLine4[1];
- var formats = (0, _extend2.default)({}, line.formats(), { list: "checked" });
- var delta = new _quillDelta2.default().retain(range.index).insert("\n", formats).retain(line.length() - offset - 1).retain(1, { list: "unchecked" });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- "header enter": {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ["header"],
- suffix: /^$/,
- handler: function handler(range, context) {
- var _quill$getLine5 = this.quill.getLine(range.index), _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), line = _quill$getLine6[0], offset = _quill$getLine6[1];
- var delta = new _quillDelta2.default().retain(range.index).insert("\n", context.format).retain(line.length() - offset - 1).retain(1, { header: null });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.scrollIntoView();
- }
- },
- "list autofill": {
- key: " ",
- collapsed: true,
- format: { list: false },
- prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
- handler: function handler(range, context) {
- var length = context.prefix.length;
- var _quill$getLine7 = this.quill.getLine(range.index), _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), line = _quill$getLine8[0], offset = _quill$getLine8[1];
- if (offset > length) return true;
- var value = void 0;
- switch (context.prefix.trim()) {
- case "[]":
- case "[ ]":
- value = "unchecked";
- break;
- case "[x]":
- value = "checked";
- break;
- case "-":
- case "*":
- value = "bullet";
- break;
- default:
- value = "ordered";
- }
- this.quill.insertText(range.index, " ", _quill2.default.sources.USER);
- this.quill.history.cutoff();
- var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- this.quill.history.cutoff();
- this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);
- }
- },
- "code exit": {
- key: Keyboard.keys.ENTER,
- collapsed: true,
- format: ["code-block"],
- prefix: /\n\n$/,
- suffix: /^\s+$/,
- handler: function handler(range) {
- var _quill$getLine9 = this.quill.getLine(range.index), _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), line = _quill$getLine10[0], offset = _quill$getLine10[1];
- var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { "code-block": null }).delete(1);
- this.quill.updateContents(delta, _quill2.default.sources.USER);
- }
- },
- "embed left": makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
- "embed left shift": makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
- "embed right": makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
- "embed right shift": makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
- }
- };
- function makeEmbedArrowHandler(key, shiftKey) {
- var _ref3;
- var where = key === Keyboard.keys.LEFT ? "prefix" : "suffix";
- return _ref3 = {
- key,
- shiftKey,
- altKey: null
- }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, "handler", function handler(range) {
- var index = range.index;
- if (key === Keyboard.keys.RIGHT) {
- index += range.length + 1;
- }
- var _quill$getLeaf3 = this.quill.getLeaf(index), _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), leaf = _quill$getLeaf4[0];
- if (!(leaf instanceof _parchment2.default.Embed)) return true;
- if (key === Keyboard.keys.LEFT) {
- if (shiftKey) {
- this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
- }
- } else {
- if (shiftKey) {
- this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
- } else {
- this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
- }
- }
- return false;
- }), _ref3;
- }
- function handleBackspace(range, context) {
- if (range.index === 0 || this.quill.getLength() <= 1) return;
- var _quill$getLine11 = this.quill.getLine(range.index), _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), line = _quill$getLine12[0];
- var formats = {};
- if (context.offset === 0) {
- var _quill$getLine13 = this.quill.getLine(range.index - 1), _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), prev = _quill$getLine14[0];
- if (prev != null && prev.length() > 1) {
- var curFormats = line.formats();
- var prevFormats = this.quill.getFormat(range.index - 1, 1);
- formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
- }
- }
- var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
- this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);
- }
- this.quill.focus();
- }
- function handleDelete(range, context) {
- var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
- if (range.index >= this.quill.getLength() - length) return;
- var formats = {}, nextLength = 0;
- var _quill$getLine15 = this.quill.getLine(range.index), _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), line = _quill$getLine16[0];
- if (context.offset >= line.length() - 1) {
- var _quill$getLine17 = this.quill.getLine(range.index + 1), _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), next = _quill$getLine18[0];
- if (next) {
- var curFormats = line.formats();
- var nextFormats = this.quill.getFormat(range.index, 1);
- formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
- nextLength = next.length();
- }
- }
- this.quill.deleteText(range.index, length, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);
- }
- }
- function handleDeleteRange(range) {
- var lines = this.quill.getLines(range);
- var formats = {};
- if (lines.length > 1) {
- var firstFormats = lines[0].formats();
- var lastFormats = lines[lines.length - 1].formats();
- formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
- }
- this.quill.deleteText(range, _quill2.default.sources.USER);
- if (Object.keys(formats).length > 0) {
- this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
- }
- this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
- this.quill.focus();
- }
- function handleEnter(range, context) {
- var _this3 = this;
- if (range.length > 0) {
- this.quill.scroll.deleteAt(range.index, range.length);
- }
- var lineFormats = Object.keys(context.format).reduce(function(lineFormats2, format) {
- if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
- lineFormats2[format] = context.format[format];
- }
- return lineFormats2;
- }, {});
- this.quill.insertText(range.index, "\n", lineFormats, _quill2.default.sources.USER);
- this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
- this.quill.focus();
- Object.keys(context.format).forEach(function(name) {
- if (lineFormats[name] != null) return;
- if (Array.isArray(context.format[name])) return;
- if (name === "link") return;
- _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);
- });
- }
- function makeCodeBlockHandler(indent) {
- return {
- key: Keyboard.keys.TAB,
- shiftKey: !indent,
- format: { "code-block": true },
- handler: function handler(range) {
- var CodeBlock = _parchment2.default.query("code-block");
- var index = range.index, length = range.length;
- var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), block = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
- if (block == null) return;
- var scrollIndex = this.quill.getIndex(block);
- var start = block.newlineIndex(offset, true) + 1;
- var end = block.newlineIndex(scrollIndex + offset + length);
- var lines = block.domNode.textContent.slice(start, end).split("\n");
- offset = 0;
- lines.forEach(function(line, i) {
- if (indent) {
- block.insertAt(start + offset, CodeBlock.TAB);
- offset += CodeBlock.TAB.length;
- if (i === 0) {
- index += CodeBlock.TAB.length;
- } else {
- length += CodeBlock.TAB.length;
- }
- } else if (line.startsWith(CodeBlock.TAB)) {
- block.deleteAt(start + offset, CodeBlock.TAB.length);
- offset -= CodeBlock.TAB.length;
- if (i === 0) {
- index -= CodeBlock.TAB.length;
- } else {
- length -= CodeBlock.TAB.length;
- }
- }
- offset += line.length + 1;
- });
- this.quill.update(_quill2.default.sources.USER);
- this.quill.setSelection(index, length, _quill2.default.sources.SILENT);
- }
- };
- }
- function makeFormatHandler(format) {
- return {
- key: format[0].toUpperCase(),
- shortKey: true,
- handler: function handler(range, context) {
- this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
- }
- };
- }
- function normalize(binding) {
- if (typeof binding === "string" || typeof binding === "number") {
- return normalize({ key: binding });
- }
- if ((typeof binding === "undefined" ? "undefined" : _typeof(binding)) === "object") {
- binding = (0, _clone2.default)(binding, false);
- }
- if (typeof binding.key === "string") {
- if (Keyboard.keys[binding.key.toUpperCase()] != null) {
- binding.key = Keyboard.keys[binding.key.toUpperCase()];
- } else if (binding.key.length === 1) {
- binding.key = binding.key.toUpperCase().charCodeAt(0);
- } else {
- return null;
- }
- }
- if (binding.shortKey) {
- binding[SHORTKEY] = binding.shortKey;
- delete binding.shortKey;
- }
- return binding;
- }
- exports2.default = Keyboard;
- exports2.SHORTKEY = SHORTKEY;
- }),
- /* 24 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Cursor = (function(_Parchment$Embed) {
- _inherits(Cursor2, _Parchment$Embed);
- _createClass(Cursor2, null, [{
- key: "value",
- value: function value() {
- return void 0;
- }
- }]);
- function Cursor2(domNode, selection) {
- _classCallCheck(this, Cursor2);
- var _this = _possibleConstructorReturn(this, (Cursor2.__proto__ || Object.getPrototypeOf(Cursor2)).call(this, domNode));
- _this.selection = selection;
- _this.textNode = document.createTextNode(Cursor2.CONTENTS);
- _this.domNode.appendChild(_this.textNode);
- _this._length = 0;
- return _this;
- }
- _createClass(Cursor2, [{
- key: "detach",
- value: function detach() {
- if (this.parent != null) this.parent.removeChild(this);
- }
- }, {
- key: "format",
- value: function format(name, value) {
- if (this._length !== 0) {
- return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "format", this).call(this, name, value);
- }
- var target = this, index = 0;
- while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
- index += target.offset(target.parent);
- target = target.parent;
- }
- if (target != null) {
- this._length = Cursor2.CONTENTS.length;
- target.optimize();
- target.formatAt(index, Cursor2.CONTENTS.length, name, value);
- this._length = 0;
- }
- }
- }, {
- key: "index",
- value: function index(node, offset) {
- if (node === this.textNode) return 0;
- return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "index", this).call(this, node, offset);
- }
- }, {
- key: "length",
- value: function length() {
- return this._length;
- }
- }, {
- key: "position",
- value: function position() {
- return [this.textNode, this.textNode.data.length];
- }
- }, {
- key: "remove",
- value: function remove() {
- _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "remove", this).call(this);
- this.parent = null;
- }
- }, {
- key: "restore",
- value: function restore() {
- if (this.selection.composing || this.parent == null) return;
- var textNode = this.textNode;
- var range = this.selection.getNativeRange();
- var restoreText = void 0, start = void 0, end = void 0;
- if (range != null && range.start.node === textNode && range.end.node === textNode) {
- var _ref = [textNode, range.start.offset, range.end.offset];
- restoreText = _ref[0];
- start = _ref[1];
- end = _ref[2];
- }
- while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
- this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
- }
- if (this.textNode.data !== Cursor2.CONTENTS) {
- var text = this.textNode.data.split(Cursor2.CONTENTS).join("");
- if (this.next instanceof _text2.default) {
- restoreText = this.next.domNode;
- this.next.insertAt(0, text);
- this.textNode.data = Cursor2.CONTENTS;
- } else {
- this.textNode.data = text;
- this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
- this.textNode = document.createTextNode(Cursor2.CONTENTS);
- this.domNode.appendChild(this.textNode);
- }
- }
- this.remove();
- if (start != null) {
- var _map = [start, end].map(function(offset) {
- return Math.max(0, Math.min(restoreText.data.length, offset - 1));
- });
- var _map2 = _slicedToArray(_map, 2);
- start = _map2[0];
- end = _map2[1];
- return {
- startNode: restoreText,
- startOffset: start,
- endNode: restoreText,
- endOffset: end
- };
- }
- }
- }, {
- key: "update",
- value: function update(mutations, context) {
- var _this2 = this;
- if (mutations.some(function(mutation) {
- return mutation.type === "characterData" && mutation.target === _this2.textNode;
- })) {
- var range = this.restore();
- if (range) context.range = range;
- }
- }
- }, {
- key: "value",
- value: function value() {
- return "";
- }
- }]);
- return Cursor2;
- })(_parchment2.default.Embed);
- Cursor.blotName = "cursor";
- Cursor.className = "ql-cursor";
- Cursor.tagName = "span";
- Cursor.CONTENTS = "\uFEFF";
- exports2.default = Cursor;
- }),
- /* 25 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Container = (function(_Parchment$Container) {
- _inherits(Container2, _Parchment$Container);
- function Container2() {
- _classCallCheck(this, Container2);
- return _possibleConstructorReturn(this, (Container2.__proto__ || Object.getPrototypeOf(Container2)).apply(this, arguments));
- }
- return Container2;
- })(_parchment2.default.Container);
- Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container];
- exports2.default = Container;
- }),
- /* 26 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.ColorStyle = exports2.ColorClass = exports2.ColorAttributor = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ColorAttributor = (function(_Parchment$Attributor) {
- _inherits(ColorAttributor2, _Parchment$Attributor);
- function ColorAttributor2() {
- _classCallCheck(this, ColorAttributor2);
- return _possibleConstructorReturn(this, (ColorAttributor2.__proto__ || Object.getPrototypeOf(ColorAttributor2)).apply(this, arguments));
- }
- _createClass(ColorAttributor2, [{
- key: "value",
- value: function value(domNode) {
- var value2 = _get(ColorAttributor2.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor2.prototype), "value", this).call(this, domNode);
- if (!value2.startsWith("rgb(")) return value2;
- value2 = value2.replace(/^[^\d]+/, "").replace(/[^\d]+$/, "");
- return "#" + value2.split(",").map(function(component) {
- return ("00" + parseInt(component).toString(16)).slice(-2);
- }).join("");
- }
- }]);
- return ColorAttributor2;
- })(_parchment2.default.Attributor.Style);
- var ColorClass = new _parchment2.default.Attributor.Class("color", "ql-color", {
- scope: _parchment2.default.Scope.INLINE
- });
- var ColorStyle = new ColorAttributor("color", "color", {
- scope: _parchment2.default.Scope.INLINE
- });
- exports2.ColorAttributor = ColorAttributor;
- exports2.ColorClass = ColorClass;
- exports2.ColorStyle = ColorStyle;
- }),
- /* 27 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.sanitize = exports2.default = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Link = (function(_Inline) {
- _inherits(Link2, _Inline);
- function Link2() {
- _classCallCheck(this, Link2);
- return _possibleConstructorReturn(this, (Link2.__proto__ || Object.getPrototypeOf(Link2)).apply(this, arguments));
- }
- _createClass(Link2, [{
- key: "format",
- value: function format(name, value) {
- if (name !== this.statics.blotName || !value) return _get(Link2.prototype.__proto__ || Object.getPrototypeOf(Link2.prototype), "format", this).call(this, name, value);
- value = this.constructor.sanitize(value);
- this.domNode.setAttribute("href", value);
- }
- }], [{
- key: "create",
- value: function create(value) {
- var node = _get(Link2.__proto__ || Object.getPrototypeOf(Link2), "create", this).call(this, value);
- value = this.sanitize(value);
- node.setAttribute("href", value);
- node.setAttribute("rel", "noopener noreferrer");
- node.setAttribute("target", "_blank");
- return node;
- }
- }, {
- key: "formats",
- value: function formats(domNode) {
- return domNode.getAttribute("href");
- }
- }, {
- key: "sanitize",
- value: function sanitize(url) {
- return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
- }
- }]);
- return Link2;
- })(_inline2.default);
- Link.blotName = "link";
- Link.tagName = "A";
- Link.SANITIZED_URL = "about:blank";
- Link.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel"];
- function _sanitize(url, protocols) {
- var anchor = document.createElement("a");
- anchor.href = url;
- var protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
- return protocols.indexOf(protocol) > -1;
- }
- exports2.default = Link;
- exports2.sanitize = _sanitize;
- }),
- /* 28 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _keyboard = __webpack_require__(23);
- var _keyboard2 = _interopRequireDefault(_keyboard);
- var _dropdown = __webpack_require__(107);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var optionsCounter = 0;
- function toggleAriaAttribute(element, attribute) {
- element.setAttribute(attribute, !(element.getAttribute(attribute) === "true"));
- }
- var Picker = (function() {
- function Picker2(select) {
- var _this = this;
- _classCallCheck(this, Picker2);
- this.select = select;
- this.container = document.createElement("span");
- this.buildPicker();
- this.select.style.display = "none";
- this.select.parentNode.insertBefore(this.container, this.select);
- this.label.addEventListener("mousedown", function() {
- _this.togglePicker();
- });
- this.label.addEventListener("keydown", function(event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to open the picker
- case _keyboard2.default.keys.ENTER:
- _this.togglePicker();
- break;
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this.escape();
- event.preventDefault();
- break;
- default:
- }
- });
- this.select.addEventListener("change", this.update.bind(this));
- }
- _createClass(Picker2, [{
- key: "togglePicker",
- value: function togglePicker() {
- this.container.classList.toggle("ql-expanded");
- toggleAriaAttribute(this.label, "aria-expanded");
- toggleAriaAttribute(this.options, "aria-hidden");
- }
- }, {
- key: "buildItem",
- value: function buildItem(option) {
- var _this2 = this;
- var item = document.createElement("span");
- item.tabIndex = "0";
- item.setAttribute("role", "button");
- item.classList.add("ql-picker-item");
- if (option.hasAttribute("value")) {
- item.setAttribute("data-value", option.getAttribute("value"));
- }
- if (option.textContent) {
- item.setAttribute("data-label", option.textContent);
- }
- item.addEventListener("click", function() {
- _this2.selectItem(item, true);
- });
- item.addEventListener("keydown", function(event) {
- switch (event.keyCode) {
- // Allows the "Enter" key to select an item
- case _keyboard2.default.keys.ENTER:
- _this2.selectItem(item, true);
- event.preventDefault();
- break;
- // Allows the "Escape" key to close the picker
- case _keyboard2.default.keys.ESCAPE:
- _this2.escape();
- event.preventDefault();
- break;
- default:
- }
- });
- return item;
- }
- }, {
- key: "buildLabel",
- value: function buildLabel() {
- var label = document.createElement("span");
- label.classList.add("ql-picker-label");
- label.innerHTML = _dropdown2.default;
- label.tabIndex = "0";
- label.setAttribute("role", "button");
- label.setAttribute("aria-expanded", "false");
- this.container.appendChild(label);
- return label;
- }
- }, {
- key: "buildOptions",
- value: function buildOptions() {
- var _this3 = this;
- var options = document.createElement("span");
- options.classList.add("ql-picker-options");
- options.setAttribute("aria-hidden", "true");
- options.tabIndex = "-1";
- options.id = "ql-picker-options-" + optionsCounter;
- optionsCounter += 1;
- this.label.setAttribute("aria-controls", options.id);
- this.options = options;
- [].slice.call(this.select.options).forEach(function(option) {
- var item = _this3.buildItem(option);
- options.appendChild(item);
- if (option.selected === true) {
- _this3.selectItem(item);
- }
- });
- this.container.appendChild(options);
- }
- }, {
- key: "buildPicker",
- value: function buildPicker() {
- var _this4 = this;
- [].slice.call(this.select.attributes).forEach(function(item) {
- _this4.container.setAttribute(item.name, item.value);
- });
- this.container.classList.add("ql-picker");
- this.label = this.buildLabel();
- this.buildOptions();
- }
- }, {
- key: "escape",
- value: function escape() {
- var _this5 = this;
- this.close();
- setTimeout(function() {
- return _this5.label.focus();
- }, 1);
- }
- }, {
- key: "close",
- value: function close() {
- this.container.classList.remove("ql-expanded");
- this.label.setAttribute("aria-expanded", "false");
- this.options.setAttribute("aria-hidden", "true");
- }
- }, {
- key: "selectItem",
- value: function selectItem(item) {
- var trigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var selected = this.container.querySelector(".ql-selected");
- if (item === selected) return;
- if (selected != null) {
- selected.classList.remove("ql-selected");
- }
- if (item == null) return;
- item.classList.add("ql-selected");
- this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
- if (item.hasAttribute("data-value")) {
- this.label.setAttribute("data-value", item.getAttribute("data-value"));
- } else {
- this.label.removeAttribute("data-value");
- }
- if (item.hasAttribute("data-label")) {
- this.label.setAttribute("data-label", item.getAttribute("data-label"));
- } else {
- this.label.removeAttribute("data-label");
- }
- if (trigger) {
- if (typeof Event === "function") {
- this.select.dispatchEvent(new Event("change"));
- } else if ((typeof Event === "undefined" ? "undefined" : _typeof(Event)) === "object") {
- var event = document.createEvent("Event");
- event.initEvent("change", true, true);
- this.select.dispatchEvent(event);
- }
- this.close();
- }
- }
- }, {
- key: "update",
- value: function update() {
- var option = void 0;
- if (this.select.selectedIndex > -1) {
- var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
- option = this.select.options[this.select.selectedIndex];
- this.selectItem(item);
- } else {
- this.selectItem(null);
- }
- var isActive = option != null && option !== this.select.querySelector("option[selected]");
- this.label.classList.toggle("ql-active", isActive);
- }
- }]);
- return Picker2;
- })();
- exports2.default = Picker;
- }),
- /* 29 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- var _break = __webpack_require__(16);
- var _break2 = _interopRequireDefault(_break);
- var _container = __webpack_require__(25);
- var _container2 = _interopRequireDefault(_container);
- var _cursor = __webpack_require__(24);
- var _cursor2 = _interopRequireDefault(_cursor);
- var _embed = __webpack_require__(35);
- var _embed2 = _interopRequireDefault(_embed);
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- var _scroll = __webpack_require__(22);
- var _scroll2 = _interopRequireDefault(_scroll);
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- var _clipboard = __webpack_require__(55);
- var _clipboard2 = _interopRequireDefault(_clipboard);
- var _history = __webpack_require__(42);
- var _history2 = _interopRequireDefault(_history);
- var _keyboard = __webpack_require__(23);
- var _keyboard2 = _interopRequireDefault(_keyboard);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- _quill2.default.register({
- "blots/block": _block2.default,
- "blots/block/embed": _block.BlockEmbed,
- "blots/break": _break2.default,
- "blots/container": _container2.default,
- "blots/cursor": _cursor2.default,
- "blots/embed": _embed2.default,
- "blots/inline": _inline2.default,
- "blots/scroll": _scroll2.default,
- "blots/text": _text2.default,
- "modules/clipboard": _clipboard2.default,
- "modules/history": _history2.default,
- "modules/keyboard": _keyboard2.default
- });
- _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
- exports2.default = _quill2.default;
- }),
- /* 30 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", { value: true });
- var Registry = __webpack_require__(1);
- var ShadowBlot = (
- /** @class */
- (function() {
- function ShadowBlot2(domNode) {
- this.domNode = domNode;
- this.domNode[Registry.DATA_KEY] = { blot: this };
- }
- Object.defineProperty(ShadowBlot2.prototype, "statics", {
- // Hack for accessing inherited static methods
- get: function() {
- return this.constructor;
- },
- enumerable: true,
- configurable: true
- });
- ShadowBlot2.create = function(value) {
- if (this.tagName == null) {
- throw new Registry.ParchmentError("Blot definition missing tagName");
- }
- var node;
- if (Array.isArray(this.tagName)) {
- if (typeof value === "string") {
- value = value.toUpperCase();
- if (parseInt(value).toString() === value) {
- value = parseInt(value);
- }
- }
- if (typeof value === "number") {
- node = document.createElement(this.tagName[value - 1]);
- } else if (this.tagName.indexOf(value) > -1) {
- node = document.createElement(value);
- } else {
- node = document.createElement(this.tagName[0]);
- }
- } else {
- node = document.createElement(this.tagName);
- }
- if (this.className) {
- node.classList.add(this.className);
- }
- return node;
- };
- ShadowBlot2.prototype.attach = function() {
- if (this.parent != null) {
- this.scroll = this.parent.scroll;
- }
- };
- ShadowBlot2.prototype.clone = function() {
- var domNode = this.domNode.cloneNode(false);
- return Registry.create(domNode);
- };
- ShadowBlot2.prototype.detach = function() {
- if (this.parent != null)
- this.parent.removeChild(this);
- delete this.domNode[Registry.DATA_KEY];
- };
- ShadowBlot2.prototype.deleteAt = function(index, length) {
- var blot = this.isolate(index, length);
- blot.remove();
- };
- ShadowBlot2.prototype.formatAt = function(index, length, name, value) {
- var blot = this.isolate(index, length);
- if (Registry.query(name, Registry.Scope.BLOT) != null && value) {
- blot.wrap(name, value);
- } else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {
- var parent = Registry.create(this.statics.scope);
- blot.wrap(parent);
- parent.format(name, value);
- }
- };
- ShadowBlot2.prototype.insertAt = function(index, value, def) {
- var blot = def == null ? Registry.create("text", value) : Registry.create(value, def);
- var ref2 = this.split(index);
- this.parent.insertBefore(blot, ref2);
- };
- ShadowBlot2.prototype.insertInto = function(parentBlot, refBlot) {
- if (refBlot === void 0) {
- refBlot = null;
- }
- if (this.parent != null) {
- this.parent.children.remove(this);
- }
- var refDomNode = null;
- parentBlot.children.insertBefore(this, refBlot);
- if (refBlot != null) {
- refDomNode = refBlot.domNode;
- }
- if (this.domNode.parentNode != parentBlot.domNode || this.domNode.nextSibling != refDomNode) {
- parentBlot.domNode.insertBefore(this.domNode, refDomNode);
- }
- this.parent = parentBlot;
- this.attach();
- };
- ShadowBlot2.prototype.isolate = function(index, length) {
- var target = this.split(index);
- target.split(length);
- return target;
- };
- ShadowBlot2.prototype.length = function() {
- return 1;
- };
- ShadowBlot2.prototype.offset = function(root) {
- if (root === void 0) {
- root = this.parent;
- }
- if (this.parent == null || this == root)
- return 0;
- return this.parent.children.offset(this) + this.parent.offset(root);
- };
- ShadowBlot2.prototype.optimize = function(context) {
- if (this.domNode[Registry.DATA_KEY] != null) {
- delete this.domNode[Registry.DATA_KEY].mutations;
- }
- };
- ShadowBlot2.prototype.remove = function() {
- if (this.domNode.parentNode != null) {
- this.domNode.parentNode.removeChild(this.domNode);
- }
- this.detach();
- };
- ShadowBlot2.prototype.replace = function(target) {
- if (target.parent == null)
- return;
- target.parent.insertBefore(this, target.next);
- target.remove();
- };
- ShadowBlot2.prototype.replaceWith = function(name, value) {
- var replacement = typeof name === "string" ? Registry.create(name, value) : name;
- replacement.replace(this);
- return replacement;
- };
- ShadowBlot2.prototype.split = function(index, force) {
- return index === 0 ? this : this.next;
- };
- ShadowBlot2.prototype.update = function(mutations, context) {
- };
- ShadowBlot2.prototype.wrap = function(name, value) {
- var wrapper = typeof name === "string" ? Registry.create(name, value) : name;
- if (this.parent != null) {
- this.parent.insertBefore(wrapper, this.next);
- }
- wrapper.appendChild(this);
- return wrapper;
- };
- ShadowBlot2.blotName = "abstract";
- return ShadowBlot2;
- })()
- );
- exports2.default = ShadowBlot;
- }),
- /* 31 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- var class_1 = __webpack_require__(32);
- var style_1 = __webpack_require__(33);
- var Registry = __webpack_require__(1);
- var AttributorStore = (
- /** @class */
- (function() {
- function AttributorStore2(domNode) {
- this.attributes = {};
- this.domNode = domNode;
- this.build();
- }
- AttributorStore2.prototype.attribute = function(attribute, value) {
- if (value) {
- if (attribute.add(this.domNode, value)) {
- if (attribute.value(this.domNode) != null) {
- this.attributes[attribute.attrName] = attribute;
- } else {
- delete this.attributes[attribute.attrName];
- }
- }
- } else {
- attribute.remove(this.domNode);
- delete this.attributes[attribute.attrName];
- }
- };
- AttributorStore2.prototype.build = function() {
- var _this = this;
- this.attributes = {};
- var attributes = attributor_1.default.keys(this.domNode);
- var classes = class_1.default.keys(this.domNode);
- var styles = style_1.default.keys(this.domNode);
- attributes.concat(classes).concat(styles).forEach(function(name) {
- var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);
- if (attr instanceof attributor_1.default) {
- _this.attributes[attr.attrName] = attr;
- }
- });
- };
- AttributorStore2.prototype.copy = function(target) {
- var _this = this;
- Object.keys(this.attributes).forEach(function(key) {
- var value = _this.attributes[key].value(_this.domNode);
- target.format(key, value);
- });
- };
- AttributorStore2.prototype.move = function(target) {
- var _this = this;
- this.copy(target);
- Object.keys(this.attributes).forEach(function(key) {
- _this.attributes[key].remove(_this.domNode);
- });
- this.attributes = {};
- };
- AttributorStore2.prototype.values = function() {
- var _this = this;
- return Object.keys(this.attributes).reduce(function(attributes, name) {
- attributes[name] = _this.attributes[name].value(_this.domNode);
- return attributes;
- }, {});
- };
- return AttributorStore2;
- })()
- );
- exports2.default = AttributorStore;
- }),
- /* 32 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function match(node, prefix) {
- var className = node.getAttribute("class") || "";
- return className.split(/\s+/).filter(function(name) {
- return name.indexOf(prefix + "-") === 0;
- });
- }
- var ClassAttributor = (
- /** @class */
- (function(_super) {
- __extends(ClassAttributor2, _super);
- function ClassAttributor2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ClassAttributor2.keys = function(node) {
- return (node.getAttribute("class") || "").split(/\s+/).map(function(name) {
- return name.split("-").slice(0, -1).join("-");
- });
- };
- ClassAttributor2.prototype.add = function(node, value) {
- if (!this.canAdd(node, value))
- return false;
- this.remove(node);
- node.classList.add(this.keyName + "-" + value);
- return true;
- };
- ClassAttributor2.prototype.remove = function(node) {
- var matches = match(node, this.keyName);
- matches.forEach(function(name) {
- node.classList.remove(name);
- });
- if (node.classList.length === 0) {
- node.removeAttribute("class");
- }
- };
- ClassAttributor2.prototype.value = function(node) {
- var result = match(node, this.keyName)[0] || "";
- var value = result.slice(this.keyName.length + 1);
- return this.canAdd(node, value) ? value : "";
- };
- return ClassAttributor2;
- })(attributor_1.default)
- );
- exports2.default = ClassAttributor;
- }),
- /* 33 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var attributor_1 = __webpack_require__(12);
- function camelize(name) {
- var parts = name.split("-");
- var rest = parts.slice(1).map(function(part) {
- return part[0].toUpperCase() + part.slice(1);
- }).join("");
- return parts[0] + rest;
- }
- var StyleAttributor = (
- /** @class */
- (function(_super) {
- __extends(StyleAttributor2, _super);
- function StyleAttributor2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- StyleAttributor2.keys = function(node) {
- return (node.getAttribute("style") || "").split(";").map(function(value) {
- var arr = value.split(":");
- return arr[0].trim();
- });
- };
- StyleAttributor2.prototype.add = function(node, value) {
- if (!this.canAdd(node, value))
- return false;
- node.style[camelize(this.keyName)] = value;
- return true;
- };
- StyleAttributor2.prototype.remove = function(node) {
- node.style[camelize(this.keyName)] = "";
- if (!node.getAttribute("style")) {
- node.removeAttribute("style");
- }
- };
- StyleAttributor2.prototype.value = function(node) {
- var value = node.style[camelize(this.keyName)];
- return this.canAdd(node, value) ? value : "";
- };
- return StyleAttributor2;
- })(attributor_1.default)
- );
- exports2.default = StyleAttributor;
- }),
- /* 34 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var Theme = (function() {
- function Theme2(quill, options) {
- _classCallCheck(this, Theme2);
- this.quill = quill;
- this.options = options;
- this.modules = {};
- }
- _createClass(Theme2, [{
- key: "init",
- value: function init() {
- var _this = this;
- Object.keys(this.options.modules).forEach(function(name) {
- if (_this.modules[name] == null) {
- _this.addModule(name);
- }
- });
- }
- }, {
- key: "addModule",
- value: function addModule(name) {
- var moduleClass = this.quill.constructor.import("modules/" + name);
- this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});
- return this.modules[name];
- }
- }]);
- return Theme2;
- })();
- Theme.DEFAULTS = {
- modules: {}
- };
- Theme.themes = {
- "default": Theme
- };
- exports2.default = Theme;
- }),
- /* 35 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _text = __webpack_require__(7);
- var _text2 = _interopRequireDefault(_text);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var GUARD_TEXT = "\uFEFF";
- var Embed = (function(_Parchment$Embed) {
- _inherits(Embed2, _Parchment$Embed);
- function Embed2(node) {
- _classCallCheck(this, Embed2);
- var _this = _possibleConstructorReturn(this, (Embed2.__proto__ || Object.getPrototypeOf(Embed2)).call(this, node));
- _this.contentNode = document.createElement("span");
- _this.contentNode.setAttribute("contenteditable", false);
- [].slice.call(_this.domNode.childNodes).forEach(function(childNode) {
- _this.contentNode.appendChild(childNode);
- });
- _this.leftGuard = document.createTextNode(GUARD_TEXT);
- _this.rightGuard = document.createTextNode(GUARD_TEXT);
- _this.domNode.appendChild(_this.leftGuard);
- _this.domNode.appendChild(_this.contentNode);
- _this.domNode.appendChild(_this.rightGuard);
- return _this;
- }
- _createClass(Embed2, [{
- key: "index",
- value: function index(node, offset) {
- if (node === this.leftGuard) return 0;
- if (node === this.rightGuard) return 1;
- return _get(Embed2.prototype.__proto__ || Object.getPrototypeOf(Embed2.prototype), "index", this).call(this, node, offset);
- }
- }, {
- key: "restore",
- value: function restore(node) {
- var range = void 0, textNode = void 0;
- var text = node.data.split(GUARD_TEXT).join("");
- if (node === this.leftGuard) {
- if (this.prev instanceof _text2.default) {
- var prevLength = this.prev.length();
- this.prev.insertAt(prevLength, text);
- range = {
- startNode: this.prev.domNode,
- startOffset: prevLength + text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- } else if (node === this.rightGuard) {
- if (this.next instanceof _text2.default) {
- this.next.insertAt(0, text);
- range = {
- startNode: this.next.domNode,
- startOffset: text.length
- };
- } else {
- textNode = document.createTextNode(text);
- this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
- range = {
- startNode: textNode,
- startOffset: text.length
- };
- }
- }
- node.data = GUARD_TEXT;
- return range;
- }
- }, {
- key: "update",
- value: function update(mutations, context) {
- var _this2 = this;
- mutations.forEach(function(mutation) {
- if (mutation.type === "characterData" && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
- var range = _this2.restore(mutation.target);
- if (range) context.range = range;
- }
- });
- }
- }]);
- return Embed2;
- })(_parchment2.default.Embed);
- exports2.default = Embed;
- }),
- /* 36 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.AlignStyle = exports2.AlignClass = exports2.AlignAttribute = void 0;
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ["right", "center", "justify"]
- };
- var AlignAttribute = new _parchment2.default.Attributor.Attribute("align", "align", config);
- var AlignClass = new _parchment2.default.Attributor.Class("align", "ql-align", config);
- var AlignStyle = new _parchment2.default.Attributor.Style("align", "text-align", config);
- exports2.AlignAttribute = AlignAttribute;
- exports2.AlignClass = AlignClass;
- exports2.AlignStyle = AlignStyle;
- }),
- /* 37 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.BackgroundStyle = exports2.BackgroundClass = void 0;
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _color = __webpack_require__(26);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
- scope: _parchment2.default.Scope.INLINE
- });
- var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
- scope: _parchment2.default.Scope.INLINE
- });
- exports2.BackgroundClass = BackgroundClass;
- exports2.BackgroundStyle = BackgroundStyle;
- }),
- /* 38 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.DirectionStyle = exports2.DirectionClass = exports2.DirectionAttribute = void 0;
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- var config = {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: ["rtl"]
- };
- var DirectionAttribute = new _parchment2.default.Attributor.Attribute("direction", "dir", config);
- var DirectionClass = new _parchment2.default.Attributor.Class("direction", "ql-direction", config);
- var DirectionStyle = new _parchment2.default.Attributor.Style("direction", "direction", config);
- exports2.DirectionAttribute = DirectionAttribute;
- exports2.DirectionClass = DirectionClass;
- exports2.DirectionStyle = DirectionStyle;
- }),
- /* 39 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.FontClass = exports2.FontStyle = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var config = {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ["serif", "monospace"]
- };
- var FontClass = new _parchment2.default.Attributor.Class("font", "ql-font", config);
- var FontStyleAttributor = (function(_Parchment$Attributor) {
- _inherits(FontStyleAttributor2, _Parchment$Attributor);
- function FontStyleAttributor2() {
- _classCallCheck(this, FontStyleAttributor2);
- return _possibleConstructorReturn(this, (FontStyleAttributor2.__proto__ || Object.getPrototypeOf(FontStyleAttributor2)).apply(this, arguments));
- }
- _createClass(FontStyleAttributor2, [{
- key: "value",
- value: function value(node) {
- return _get(FontStyleAttributor2.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor2.prototype), "value", this).call(this, node).replace(/["']/g, "");
- }
- }]);
- return FontStyleAttributor2;
- })(_parchment2.default.Attributor.Style);
- var FontStyle = new FontStyleAttributor("font", "font-family", config);
- exports2.FontStyle = FontStyle;
- exports2.FontClass = FontClass;
- }),
- /* 40 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.SizeStyle = exports2.SizeClass = void 0;
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- var SizeClass = new _parchment2.default.Attributor.Class("size", "ql-size", {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ["small", "large", "huge"]
- });
- var SizeStyle = new _parchment2.default.Attributor.Style("size", "font-size", {
- scope: _parchment2.default.Scope.INLINE,
- whitelist: ["10px", "18px", "32px"]
- });
- exports2.SizeClass = SizeClass;
- exports2.SizeStyle = SizeStyle;
- }),
- /* 41 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- module2.exports = {
- "align": {
- "": __webpack_require__(76),
- "center": __webpack_require__(77),
- "right": __webpack_require__(78),
- "justify": __webpack_require__(79)
- },
- "background": __webpack_require__(80),
- "blockquote": __webpack_require__(81),
- "bold": __webpack_require__(82),
- "clean": __webpack_require__(83),
- "code": __webpack_require__(58),
- "code-block": __webpack_require__(58),
- "color": __webpack_require__(84),
- "direction": {
- "": __webpack_require__(85),
- "rtl": __webpack_require__(86)
- },
- "float": {
- "center": __webpack_require__(87),
- "full": __webpack_require__(88),
- "left": __webpack_require__(89),
- "right": __webpack_require__(90)
- },
- "formula": __webpack_require__(91),
- "header": {
- "1": __webpack_require__(92),
- "2": __webpack_require__(93)
- },
- "italic": __webpack_require__(94),
- "image": __webpack_require__(95),
- "indent": {
- "+1": __webpack_require__(96),
- "-1": __webpack_require__(97)
- },
- "link": __webpack_require__(98),
- "list": {
- "ordered": __webpack_require__(99),
- "bullet": __webpack_require__(100),
- "check": __webpack_require__(101)
- },
- "script": {
- "sub": __webpack_require__(102),
- "super": __webpack_require__(103)
- },
- "strike": __webpack_require__(104),
- "underline": __webpack_require__(105),
- "video": __webpack_require__(106)
- };
- }),
- /* 42 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.getLastChangeIndex = exports2.default = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var History = (function(_Module) {
- _inherits(History2, _Module);
- function History2(quill, options) {
- _classCallCheck(this, History2);
- var _this = _possibleConstructorReturn(this, (History2.__proto__ || Object.getPrototypeOf(History2)).call(this, quill, options));
- _this.lastRecorded = 0;
- _this.ignoreChange = false;
- _this.clear();
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(eventName, delta, oldDelta, source) {
- if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;
- if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
- _this.record(delta, oldDelta);
- } else {
- _this.transform(delta);
- }
- });
- _this.quill.keyboard.addBinding({ key: "Z", shortKey: true }, _this.undo.bind(_this));
- _this.quill.keyboard.addBinding({ key: "Z", shortKey: true, shiftKey: true }, _this.redo.bind(_this));
- if (/Win/i.test(navigator.platform)) {
- _this.quill.keyboard.addBinding({ key: "Y", shortKey: true }, _this.redo.bind(_this));
- }
- return _this;
- }
- _createClass(History2, [{
- key: "change",
- value: function change(source, dest) {
- if (this.stack[source].length === 0) return;
- var delta = this.stack[source].pop();
- this.stack[dest].push(delta);
- this.lastRecorded = 0;
- this.ignoreChange = true;
- this.quill.updateContents(delta[source], _quill2.default.sources.USER);
- this.ignoreChange = false;
- var index = getLastChangeIndex(delta[source]);
- this.quill.setSelection(index);
- }
- }, {
- key: "clear",
- value: function clear() {
- this.stack = { undo: [], redo: [] };
- }
- }, {
- key: "cutoff",
- value: function cutoff() {
- this.lastRecorded = 0;
- }
- }, {
- key: "record",
- value: function record(changeDelta, oldDelta) {
- if (changeDelta.ops.length === 0) return;
- this.stack.redo = [];
- var undoDelta = this.quill.getContents().diff(oldDelta);
- var timestamp = Date.now();
- if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
- var delta = this.stack.undo.pop();
- undoDelta = undoDelta.compose(delta.undo);
- changeDelta = delta.redo.compose(changeDelta);
- } else {
- this.lastRecorded = timestamp;
- }
- this.stack.undo.push({
- redo: changeDelta,
- undo: undoDelta
- });
- if (this.stack.undo.length > this.options.maxStack) {
- this.stack.undo.shift();
- }
- }
- }, {
- key: "redo",
- value: function redo() {
- this.change("redo", "undo");
- }
- }, {
- key: "transform",
- value: function transform(delta) {
- this.stack.undo.forEach(function(change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- this.stack.redo.forEach(function(change) {
- change.undo = delta.transform(change.undo, true);
- change.redo = delta.transform(change.redo, true);
- });
- }
- }, {
- key: "undo",
- value: function undo() {
- this.change("undo", "redo");
- }
- }]);
- return History2;
- })(_module2.default);
- History.DEFAULTS = {
- delay: 1e3,
- maxStack: 100,
- userOnly: false
- };
- function endsWithNewlineChange(delta) {
- var lastOp = delta.ops[delta.ops.length - 1];
- if (lastOp == null) return false;
- if (lastOp.insert != null) {
- return typeof lastOp.insert === "string" && lastOp.insert.endsWith("\n");
- }
- if (lastOp.attributes != null) {
- return Object.keys(lastOp.attributes).some(function(attr) {
- return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;
- });
- }
- return false;
- }
- function getLastChangeIndex(delta) {
- var deleteLength = delta.reduce(function(length, op) {
- length += op.delete || 0;
- return length;
- }, 0);
- var changeIndex = delta.length() - deleteLength;
- if (endsWithNewlineChange(delta)) {
- changeIndex -= 1;
- }
- return changeIndex;
- }
- exports2.default = History;
- exports2.getLastChangeIndex = getLastChangeIndex;
- }),
- /* 43 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.BaseTooltip = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _emitter = __webpack_require__(8);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _keyboard = __webpack_require__(23);
- var _keyboard2 = _interopRequireDefault(_keyboard);
- var _theme = __webpack_require__(34);
- var _theme2 = _interopRequireDefault(_theme);
- var _colorPicker = __webpack_require__(59);
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
- var _iconPicker = __webpack_require__(60);
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
- var _picker = __webpack_require__(28);
- var _picker2 = _interopRequireDefault(_picker);
- var _tooltip = __webpack_require__(61);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ALIGNS = [false, "center", "right", "justify"];
- var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
- var FONTS = [false, "serif", "monospace"];
- var HEADERS = ["1", "2", "3", false];
- var SIZES = ["small", false, "large", "huge"];
- var BaseTheme = (function(_Theme) {
- _inherits(BaseTheme2, _Theme);
- function BaseTheme2(quill, options) {
- _classCallCheck(this, BaseTheme2);
- var _this = _possibleConstructorReturn(this, (BaseTheme2.__proto__ || Object.getPrototypeOf(BaseTheme2)).call(this, quill, options));
- var listener = function listener2(e) {
- if (!document.body.contains(quill.root)) {
- return document.body.removeEventListener("click", listener2);
- }
- if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
- _this.tooltip.hide();
- }
- if (_this.pickers != null) {
- _this.pickers.forEach(function(picker) {
- if (!picker.container.contains(e.target)) {
- picker.close();
- }
- });
- }
- };
- quill.emitter.listenDOM("click", document.body, listener);
- return _this;
- }
- _createClass(BaseTheme2, [{
- key: "addModule",
- value: function addModule(name) {
- var module3 = _get(BaseTheme2.prototype.__proto__ || Object.getPrototypeOf(BaseTheme2.prototype), "addModule", this).call(this, name);
- if (name === "toolbar") {
- this.extendToolbar(module3);
- }
- return module3;
- }
- }, {
- key: "buildButtons",
- value: function buildButtons(buttons, icons) {
- buttons.forEach(function(button) {
- var className = button.getAttribute("class") || "";
- className.split(/\s+/).forEach(function(name) {
- if (!name.startsWith("ql-")) return;
- name = name.slice("ql-".length);
- if (icons[name] == null) return;
- if (name === "direction") {
- button.innerHTML = icons[name][""] + icons[name]["rtl"];
- } else if (typeof icons[name] === "string") {
- button.innerHTML = icons[name];
- } else {
- var value = button.value || "";
- if (value != null && icons[name][value]) {
- button.innerHTML = icons[name][value];
- }
- }
- });
- });
- }
- }, {
- key: "buildPickers",
- value: function buildPickers(selects, icons) {
- var _this2 = this;
- this.pickers = selects.map(function(select) {
- if (select.classList.contains("ql-align")) {
- if (select.querySelector("option") == null) {
- fillSelect(select, ALIGNS);
- }
- return new _iconPicker2.default(select, icons.align);
- } else if (select.classList.contains("ql-background") || select.classList.contains("ql-color")) {
- var format = select.classList.contains("ql-background") ? "background" : "color";
- if (select.querySelector("option") == null) {
- fillSelect(select, COLORS, format === "background" ? "#ffffff" : "#000000");
- }
- return new _colorPicker2.default(select, icons[format]);
- } else {
- if (select.querySelector("option") == null) {
- if (select.classList.contains("ql-font")) {
- fillSelect(select, FONTS);
- } else if (select.classList.contains("ql-header")) {
- fillSelect(select, HEADERS);
- } else if (select.classList.contains("ql-size")) {
- fillSelect(select, SIZES);
- }
- }
- return new _picker2.default(select);
- }
- });
- var update = function update2() {
- _this2.pickers.forEach(function(picker) {
- picker.update();
- });
- };
- this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
- }
- }]);
- return BaseTheme2;
- })(_theme2.default);
- BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- formula: function formula() {
- this.quill.theme.tooltip.edit("formula");
- },
- image: function image() {
- var _this3 = this;
- var fileInput = this.container.querySelector("input.ql-image[type=file]");
- if (fileInput == null) {
- fileInput = document.createElement("input");
- fileInput.setAttribute("type", "file");
- fileInput.setAttribute("accept", "image/png, image/gif, image/jpeg, image/bmp, image/x-icon");
- fileInput.classList.add("ql-image");
- fileInput.addEventListener("change", function() {
- if (fileInput.files != null && fileInput.files[0] != null) {
- var reader = new FileReader();
- reader.onload = function(e) {
- var range = _this3.quill.getSelection(true);
- _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
- _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
- fileInput.value = "";
- };
- reader.readAsDataURL(fileInput.files[0]);
- }
- });
- this.container.appendChild(fileInput);
- }
- fileInput.click();
- },
- video: function video() {
- this.quill.theme.tooltip.edit("video");
- }
- }
- }
- }
- });
- var BaseTooltip = (function(_Tooltip) {
- _inherits(BaseTooltip2, _Tooltip);
- function BaseTooltip2(quill, boundsContainer) {
- _classCallCheck(this, BaseTooltip2);
- var _this4 = _possibleConstructorReturn(this, (BaseTooltip2.__proto__ || Object.getPrototypeOf(BaseTooltip2)).call(this, quill, boundsContainer));
- _this4.textbox = _this4.root.querySelector('input[type="text"]');
- _this4.listen();
- return _this4;
- }
- _createClass(BaseTooltip2, [{
- key: "listen",
- value: function listen() {
- var _this5 = this;
- this.textbox.addEventListener("keydown", function(event) {
- if (_keyboard2.default.match(event, "enter")) {
- _this5.save();
- event.preventDefault();
- } else if (_keyboard2.default.match(event, "escape")) {
- _this5.cancel();
- event.preventDefault();
- }
- });
- }
- }, {
- key: "cancel",
- value: function cancel() {
- this.hide();
- }
- }, {
- key: "edit",
- value: function edit() {
- var mode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "link";
- var preview = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
- this.root.classList.remove("ql-hidden");
- this.root.classList.add("ql-editing");
- if (preview != null) {
- this.textbox.value = preview;
- } else if (mode !== this.root.getAttribute("data-mode")) {
- this.textbox.value = "";
- }
- this.position(this.quill.getBounds(this.quill.selection.savedRange));
- this.textbox.select();
- this.textbox.setAttribute("placeholder", this.textbox.getAttribute("data-" + mode) || "");
- this.root.setAttribute("data-mode", mode);
- }
- }, {
- key: "restoreFocus",
- value: function restoreFocus() {
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.quill.focus();
- this.quill.scrollingContainer.scrollTop = scrollTop;
- }
- }, {
- key: "save",
- value: function save() {
- var value = this.textbox.value;
- switch (this.root.getAttribute("data-mode")) {
- case "link": {
- var scrollTop = this.quill.root.scrollTop;
- if (this.linkRange) {
- this.quill.formatText(this.linkRange, "link", value, _emitter2.default.sources.USER);
- delete this.linkRange;
- } else {
- this.restoreFocus();
- this.quill.format("link", value, _emitter2.default.sources.USER);
- }
- this.quill.root.scrollTop = scrollTop;
- break;
- }
- case "video": {
- value = extractVideoUrl(value);
- }
- // eslint-disable-next-line no-fallthrough
- case "formula": {
- if (!value) break;
- var range = this.quill.getSelection(true);
- if (range != null) {
- var index = range.index + range.length;
- this.quill.insertEmbed(index, this.root.getAttribute("data-mode"), value, _emitter2.default.sources.USER);
- if (this.root.getAttribute("data-mode") === "formula") {
- this.quill.insertText(index + 1, " ", _emitter2.default.sources.USER);
- }
- this.quill.setSelection(index + 2, _emitter2.default.sources.USER);
- }
- break;
- }
- default:
- }
- this.textbox.value = "";
- this.hide();
- }
- }]);
- return BaseTooltip2;
- })(_tooltip2.default);
- function extractVideoUrl(url) {
- var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
- if (match) {
- return (match[1] || "https") + "://www.youtube.com/embed/" + match[2] + "?showinfo=0";
- }
- if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
- return (match[1] || "https") + "://player.vimeo.com/video/" + match[2] + "/";
- }
- return url;
- }
- function fillSelect(select, values) {
- var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
- values.forEach(function(value) {
- var option = document.createElement("option");
- if (value === defaultValue) {
- option.setAttribute("selected", "selected");
- } else {
- option.setAttribute("value", value);
- }
- select.appendChild(option);
- });
- }
- exports2.BaseTooltip = BaseTooltip;
- exports2.default = BaseTheme;
- }),
- /* 44 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", { value: true });
- var LinkedList = (
- /** @class */
- (function() {
- function LinkedList2() {
- this.head = this.tail = null;
- this.length = 0;
- }
- LinkedList2.prototype.append = function() {
- var nodes = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- nodes[_i] = arguments[_i];
- }
- this.insertBefore(nodes[0], null);
- if (nodes.length > 1) {
- this.append.apply(this, nodes.slice(1));
- }
- };
- LinkedList2.prototype.contains = function(node) {
- var cur, next = this.iterator();
- while (cur = next()) {
- if (cur === node)
- return true;
- }
- return false;
- };
- LinkedList2.prototype.insertBefore = function(node, refNode) {
- if (!node)
- return;
- node.next = refNode;
- if (refNode != null) {
- node.prev = refNode.prev;
- if (refNode.prev != null) {
- refNode.prev.next = node;
- }
- refNode.prev = node;
- if (refNode === this.head) {
- this.head = node;
- }
- } else if (this.tail != null) {
- this.tail.next = node;
- node.prev = this.tail;
- this.tail = node;
- } else {
- node.prev = null;
- this.head = this.tail = node;
- }
- this.length += 1;
- };
- LinkedList2.prototype.offset = function(target) {
- var index = 0, cur = this.head;
- while (cur != null) {
- if (cur === target)
- return index;
- index += cur.length();
- cur = cur.next;
- }
- return -1;
- };
- LinkedList2.prototype.remove = function(node) {
- if (!this.contains(node))
- return;
- if (node.prev != null)
- node.prev.next = node.next;
- if (node.next != null)
- node.next.prev = node.prev;
- if (node === this.head)
- this.head = node.next;
- if (node === this.tail)
- this.tail = node.prev;
- this.length -= 1;
- };
- LinkedList2.prototype.iterator = function(curNode) {
- if (curNode === void 0) {
- curNode = this.head;
- }
- return function() {
- var ret = curNode;
- if (curNode != null)
- curNode = curNode.next;
- return ret;
- };
- };
- LinkedList2.prototype.find = function(index, inclusive) {
- if (inclusive === void 0) {
- inclusive = false;
- }
- var cur, next = this.iterator();
- while (cur = next()) {
- var length = cur.length();
- if (index < length || inclusive && index === length && (cur.next == null || cur.next.length() !== 0)) {
- return [cur, index];
- }
- index -= length;
- }
- return [null, 0];
- };
- LinkedList2.prototype.forEach = function(callback) {
- var cur, next = this.iterator();
- while (cur = next()) {
- callback(cur);
- }
- };
- LinkedList2.prototype.forEachAt = function(index, length, callback) {
- if (length <= 0)
- return;
- var _a = this.find(index), startNode = _a[0], offset = _a[1];
- var cur, curIndex = index - offset, next = this.iterator(startNode);
- while ((cur = next()) && curIndex < index + length) {
- var curLength = cur.length();
- if (index > curIndex) {
- callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));
- } else {
- callback(cur, 0, Math.min(curLength, index + length - curIndex));
- }
- curIndex += curLength;
- }
- };
- LinkedList2.prototype.map = function(callback) {
- return this.reduce(function(memo, cur) {
- memo.push(callback(cur));
- return memo;
- }, []);
- };
- LinkedList2.prototype.reduce = function(callback, memo) {
- var cur, next = this.iterator();
- while (cur = next()) {
- memo = callback(memo, cur);
- }
- return memo;
- };
- return LinkedList2;
- })()
- );
- exports2.default = LinkedList;
- }),
- /* 45 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var container_1 = __webpack_require__(17);
- var Registry = __webpack_require__(1);
- var OBSERVER_CONFIG = {
- attributes: true,
- characterData: true,
- characterDataOldValue: true,
- childList: true,
- subtree: true
- };
- var MAX_OPTIMIZE_ITERATIONS = 100;
- var ScrollBlot = (
- /** @class */
- (function(_super) {
- __extends(ScrollBlot2, _super);
- function ScrollBlot2(node) {
- var _this = _super.call(this, node) || this;
- _this.scroll = _this;
- _this.observer = new MutationObserver(function(mutations) {
- _this.update(mutations);
- });
- _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
- _this.attach();
- return _this;
- }
- ScrollBlot2.prototype.detach = function() {
- _super.prototype.detach.call(this);
- this.observer.disconnect();
- };
- ScrollBlot2.prototype.deleteAt = function(index, length) {
- this.update();
- if (index === 0 && length === this.length()) {
- this.children.forEach(function(child) {
- child.remove();
- });
- } else {
- _super.prototype.deleteAt.call(this, index, length);
- }
- };
- ScrollBlot2.prototype.formatAt = function(index, length, name, value) {
- this.update();
- _super.prototype.formatAt.call(this, index, length, name, value);
- };
- ScrollBlot2.prototype.insertAt = function(index, value, def) {
- this.update();
- _super.prototype.insertAt.call(this, index, value, def);
- };
- ScrollBlot2.prototype.optimize = function(mutations, context) {
- var _this = this;
- if (mutations === void 0) {
- mutations = [];
- }
- if (context === void 0) {
- context = {};
- }
- _super.prototype.optimize.call(this, context);
- var records = [].slice.call(this.observer.takeRecords());
- while (records.length > 0)
- mutations.push(records.pop());
- var mark = function(blot, markParent) {
- if (markParent === void 0) {
- markParent = true;
- }
- if (blot == null || blot === _this)
- return;
- if (blot.domNode.parentNode == null)
- return;
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- blot.domNode[Registry.DATA_KEY].mutations = [];
- }
- if (markParent)
- mark(blot.parent);
- };
- var optimize = function(blot) {
- if (
- // @ts-ignore
- blot.domNode[Registry.DATA_KEY] == null || // @ts-ignore
- blot.domNode[Registry.DATA_KEY].mutations == null
- ) {
- return;
- }
- if (blot instanceof container_1.default) {
- blot.children.forEach(optimize);
- }
- blot.optimize(context);
- };
- var remaining = mutations;
- for (var i = 0; remaining.length > 0; i += 1) {
- if (i >= MAX_OPTIMIZE_ITERATIONS) {
- throw new Error("[Parchment] Maximum optimize iterations reached");
- }
- remaining.forEach(function(mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return;
- if (blot.domNode === mutation.target) {
- if (mutation.type === "childList") {
- mark(Registry.find(mutation.previousSibling, false));
- [].forEach.call(mutation.addedNodes, function(node) {
- var child = Registry.find(node, false);
- mark(child, false);
- if (child instanceof container_1.default) {
- child.children.forEach(function(grandChild) {
- mark(grandChild, false);
- });
- }
- });
- } else if (mutation.type === "attributes") {
- mark(blot.prev);
- }
- }
- mark(blot);
- });
- this.children.forEach(optimize);
- remaining = [].slice.call(this.observer.takeRecords());
- records = remaining.slice();
- while (records.length > 0)
- mutations.push(records.pop());
- }
- };
- ScrollBlot2.prototype.update = function(mutations, context) {
- var _this = this;
- if (context === void 0) {
- context = {};
- }
- mutations = mutations || this.observer.takeRecords();
- mutations.map(function(mutation) {
- var blot = Registry.find(mutation.target, true);
- if (blot == null)
- return null;
- if (blot.domNode[Registry.DATA_KEY].mutations == null) {
- blot.domNode[Registry.DATA_KEY].mutations = [mutation];
- return blot;
- } else {
- blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
- return null;
- }
- }).forEach(function(blot) {
- if (blot == null || blot === _this || //@ts-ignore
- blot.domNode[Registry.DATA_KEY] == null)
- return;
- blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
- });
- if (this.domNode[Registry.DATA_KEY].mutations != null) {
- _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
- }
- this.optimize(mutations, context);
- };
- ScrollBlot2.blotName = "scroll";
- ScrollBlot2.defaultChild = "block";
- ScrollBlot2.scope = Registry.Scope.BLOCK_BLOT;
- ScrollBlot2.tagName = "DIV";
- return ScrollBlot2;
- })(container_1.default)
- );
- exports2.default = ScrollBlot;
- }),
- /* 46 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(1);
- function isEqual(obj1, obj2) {
- if (Object.keys(obj1).length !== Object.keys(obj2).length)
- return false;
- for (var prop in obj1) {
- if (obj1[prop] !== obj2[prop])
- return false;
- }
- return true;
- }
- var InlineBlot = (
- /** @class */
- (function(_super) {
- __extends(InlineBlot2, _super);
- function InlineBlot2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- InlineBlot2.formats = function(domNode) {
- if (domNode.tagName === InlineBlot2.tagName)
- return void 0;
- return _super.formats.call(this, domNode);
- };
- InlineBlot2.prototype.format = function(name, value) {
- var _this = this;
- if (name === this.statics.blotName && !value) {
- this.children.forEach(function(child) {
- if (!(child instanceof format_1.default)) {
- child = child.wrap(InlineBlot2.blotName, true);
- }
- _this.attributes.copy(child);
- });
- this.unwrap();
- } else {
- _super.prototype.format.call(this, name, value);
- }
- };
- InlineBlot2.prototype.formatAt = function(index, length, name, value) {
- if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {
- var blot = this.isolate(index, length);
- blot.format(name, value);
- } else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- InlineBlot2.prototype.optimize = function(context) {
- _super.prototype.optimize.call(this, context);
- var formats = this.formats();
- if (Object.keys(formats).length === 0) {
- return this.unwrap();
- }
- var next = this.next;
- if (next instanceof InlineBlot2 && next.prev === this && isEqual(formats, next.formats())) {
- next.moveChildren(this);
- next.remove();
- }
- };
- InlineBlot2.blotName = "inline";
- InlineBlot2.scope = Registry.Scope.INLINE_BLOT;
- InlineBlot2.tagName = "SPAN";
- return InlineBlot2;
- })(format_1.default)
- );
- exports2.default = InlineBlot;
- }),
- /* 47 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var format_1 = __webpack_require__(18);
- var Registry = __webpack_require__(1);
- var BlockBlot = (
- /** @class */
- (function(_super) {
- __extends(BlockBlot2, _super);
- function BlockBlot2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- BlockBlot2.formats = function(domNode) {
- var tagName = Registry.query(BlockBlot2.blotName).tagName;
- if (domNode.tagName === tagName)
- return void 0;
- return _super.formats.call(this, domNode);
- };
- BlockBlot2.prototype.format = function(name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) == null) {
- return;
- } else if (name === this.statics.blotName && !value) {
- this.replaceWith(BlockBlot2.blotName);
- } else {
- _super.prototype.format.call(this, name, value);
- }
- };
- BlockBlot2.prototype.formatAt = function(index, length, name, value) {
- if (Registry.query(name, Registry.Scope.BLOCK) != null) {
- this.format(name, value);
- } else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- BlockBlot2.prototype.insertAt = function(index, value, def) {
- if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {
- _super.prototype.insertAt.call(this, index, value, def);
- } else {
- var after = this.split(index);
- var blot = Registry.create(value, def);
- after.parent.insertBefore(blot, after);
- }
- };
- BlockBlot2.prototype.update = function(mutations, context) {
- if (navigator.userAgent.match(/Trident/)) {
- this.build();
- } else {
- _super.prototype.update.call(this, mutations, context);
- }
- };
- BlockBlot2.blotName = "block";
- BlockBlot2.scope = Registry.Scope.BLOCK_BLOT;
- BlockBlot2.tagName = "P";
- return BlockBlot2;
- })(format_1.default)
- );
- exports2.default = BlockBlot;
- }),
- /* 48 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var EmbedBlot = (
- /** @class */
- (function(_super) {
- __extends(EmbedBlot2, _super);
- function EmbedBlot2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- EmbedBlot2.formats = function(domNode) {
- return void 0;
- };
- EmbedBlot2.prototype.format = function(name, value) {
- _super.prototype.formatAt.call(this, 0, this.length(), name, value);
- };
- EmbedBlot2.prototype.formatAt = function(index, length, name, value) {
- if (index === 0 && length === this.length()) {
- this.format(name, value);
- } else {
- _super.prototype.formatAt.call(this, index, length, name, value);
- }
- };
- EmbedBlot2.prototype.formats = function() {
- return this.statics.formats(this.domNode);
- };
- return EmbedBlot2;
- })(leaf_1.default)
- );
- exports2.default = EmbedBlot;
- }),
- /* 49 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var __extends = this && this.__extends || (function() {
- var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
- d.__proto__ = b;
- } || function(d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return function(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports2, "__esModule", { value: true });
- var leaf_1 = __webpack_require__(19);
- var Registry = __webpack_require__(1);
- var TextBlot = (
- /** @class */
- (function(_super) {
- __extends(TextBlot2, _super);
- function TextBlot2(node) {
- var _this = _super.call(this, node) || this;
- _this.text = _this.statics.value(_this.domNode);
- return _this;
- }
- TextBlot2.create = function(value) {
- return document.createTextNode(value);
- };
- TextBlot2.value = function(domNode) {
- var text = domNode.data;
- if (text["normalize"])
- text = text["normalize"]();
- return text;
- };
- TextBlot2.prototype.deleteAt = function(index, length) {
- this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);
- };
- TextBlot2.prototype.index = function(node, offset) {
- if (this.domNode === node) {
- return offset;
- }
- return -1;
- };
- TextBlot2.prototype.insertAt = function(index, value, def) {
- if (def == null) {
- this.text = this.text.slice(0, index) + value + this.text.slice(index);
- this.domNode.data = this.text;
- } else {
- _super.prototype.insertAt.call(this, index, value, def);
- }
- };
- TextBlot2.prototype.length = function() {
- return this.text.length;
- };
- TextBlot2.prototype.optimize = function(context) {
- _super.prototype.optimize.call(this, context);
- this.text = this.statics.value(this.domNode);
- if (this.text.length === 0) {
- this.remove();
- } else if (this.next instanceof TextBlot2 && this.next.prev === this) {
- this.insertAt(this.length(), this.next.value());
- this.next.remove();
- }
- };
- TextBlot2.prototype.position = function(index, inclusive) {
- if (inclusive === void 0) {
- inclusive = false;
- }
- return [this.domNode, index];
- };
- TextBlot2.prototype.split = function(index, force) {
- if (force === void 0) {
- force = false;
- }
- if (!force) {
- if (index === 0)
- return this;
- if (index === this.length())
- return this.next;
- }
- var after = Registry.create(this.domNode.splitText(index));
- this.parent.insertBefore(after, this.next);
- this.text = this.statics.value(this.domNode);
- return after;
- };
- TextBlot2.prototype.update = function(mutations, context) {
- var _this = this;
- if (mutations.some(function(mutation) {
- return mutation.type === "characterData" && mutation.target === _this.domNode;
- })) {
- this.text = this.statics.value(this.domNode);
- }
- };
- TextBlot2.prototype.value = function() {
- return this.text;
- };
- TextBlot2.blotName = "text";
- TextBlot2.scope = Registry.Scope.INLINE_BLOT;
- return TextBlot2;
- })(leaf_1.default)
- );
- exports2.default = TextBlot;
- }),
- /* 50 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- var elem = document.createElement("div");
- elem.classList.toggle("test-class", false);
- if (elem.classList.contains("test-class")) {
- var _toggle = DOMTokenList.prototype.toggle;
- DOMTokenList.prototype.toggle = function(token, force) {
- if (arguments.length > 1 && !this.contains(token) === !force) {
- return force;
- } else {
- return _toggle.call(this, token);
- }
- };
- }
- if (!String.prototype.startsWith) {
- String.prototype.startsWith = function(searchString, position) {
- position = position || 0;
- return this.substr(position, searchString.length) === searchString;
- };
- }
- if (!String.prototype.endsWith) {
- String.prototype.endsWith = function(searchString, position) {
- var subjectString = this.toString();
- if (typeof position !== "number" || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
- position = subjectString.length;
- }
- position -= searchString.length;
- var lastIndex = subjectString.indexOf(searchString, position);
- return lastIndex !== -1 && lastIndex === position;
- };
- }
- if (!Array.prototype.find) {
- Object.defineProperty(Array.prototype, "find", {
- value: function value(predicate) {
- if (this === null) {
- throw new TypeError("Array.prototype.find called on null or undefined");
- }
- if (typeof predicate !== "function") {
- throw new TypeError("predicate must be a function");
- }
- var list = Object(this);
- var length = list.length >>> 0;
- var thisArg = arguments[1];
- var value2;
- for (var i = 0; i < length; i++) {
- value2 = list[i];
- if (predicate.call(thisArg, value2, i, list)) {
- return value2;
- }
- }
- return void 0;
- }
- });
- }
- document.addEventListener("DOMContentLoaded", function() {
- document.execCommand("enableObjectResizing", false, false);
- document.execCommand("autoUrlDetect", false, false);
- });
- }),
- /* 51 */
- /***/
- (function(module2, exports2) {
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
- function diff_main(text1, text2, cursor_pos) {
- if (text1 == text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
- if (cursor_pos < 0 || text1.length < cursor_pos) {
- cursor_pos = null;
- }
- var commonlength = diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength);
- commonlength = diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength);
- var diffs = diff_compute_(text1, text2);
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- diff_cleanupMerge(diffs);
- if (cursor_pos != null) {
- diffs = fix_cursor(diffs, cursor_pos);
- }
- diffs = fix_emoji(diffs);
- return diffs;
- }
- ;
- function diff_compute_(text1, text2) {
- var diffs;
- if (!text1) {
- return [[DIFF_INSERT, text2]];
- }
- if (!text2) {
- return [[DIFF_DELETE, text1]];
- }
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i != -1) {
- diffs = [
- [DIFF_INSERT, longtext.substring(0, i)],
- [DIFF_EQUAL, shorttext],
- [DIFF_INSERT, longtext.substring(i + shorttext.length)]
- ];
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
- if (shorttext.length == 1) {
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- var hm = diff_halfMatch_(text1, text2);
- if (hm) {
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4];
- var diffs_a = diff_main(text1_a, text2_a);
- var diffs_b = diff_main(text1_b, text2_b);
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
- return diff_bisect_(text1, text2);
- }
- ;
- function diff_bisect_(text1, text2) {
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length);
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length;
- var front = delta % 2 != 0;
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1;
- if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- k1end += 2;
- } else if (y1 > text2_length) {
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var k2_offset = v_offset + k2;
- var x2;
- if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
- x2 = v2[k2_offset + 1];
- } else {
- x2 = v2[k2_offset - 1] + 1;
- }
- var y2 = x2 - k2;
- while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) {
- x2++;
- y2++;
- }
- v2[k2_offset] = x2;
- if (x2 > text1_length) {
- k2end += 2;
- } else if (y2 > text2_length) {
- k2start += 2;
- } else if (!front) {
- var k1_offset = v_offset + delta - k2;
- if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
- var x1 = v1[k1_offset];
- var y1 = v_offset + x1 - k1_offset;
- x2 = text1_length - x2;
- if (x1 >= x2) {
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- }
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- ;
- function diff_bisectSplit_(text1, text2, x, y) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y);
- var diffs = diff_main(text1a, text2a);
- var diffsb = diff_main(text1b, text2b);
- return diffs.concat(diffsb);
- }
- ;
- function diff_commonPrefix(text1, text2) {
- if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
- return 0;
- }
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- }
- ;
- function diff_commonSuffix(text1, text2) {
- if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
- return 0;
- }
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- }
- ;
- function diff_halfMatch_(text1, text2) {
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null;
- }
- function diff_halfMatchI_(longtext2, shorttext2, i) {
- var seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
- var j = -1;
- var best_common = "";
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext2.indexOf(seed, j + 1)) != -1) {
- var prefixLength = diff_commonPrefix(
- longtext2.substring(i),
- shorttext2.substring(j)
- );
- var suffixLength = diff_commonSuffix(
- longtext2.substring(0, i),
- shorttext2.substring(0, j)
- );
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
- best_longtext_a = longtext2.substring(0, i - suffixLength);
- best_longtext_b = longtext2.substring(i + prefixLength);
- best_shorttext_a = shorttext2.substring(0, j - suffixLength);
- best_shorttext_b = shorttext2.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext2.length) {
- return [
- best_longtext_a,
- best_longtext_b,
- best_shorttext_a,
- best_shorttext_b,
- best_common
- ];
- } else {
- return null;
- }
- }
- var hm1 = diff_halfMatchI_(
- longtext,
- shorttext,
- Math.ceil(longtext.length / 4)
- );
- var hm2 = diff_halfMatchI_(
- longtext,
- shorttext,
- Math.ceil(longtext.length / 2)
- );
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- }
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- }
- ;
- function diff_cleanupMerge(diffs) {
- diffs.push([DIFF_EQUAL, ""]);
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = "";
- var text_insert = "";
- var commonlength;
- while (pointer < diffs.length) {
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- if (count_delete + count_insert > 1) {
- if (count_delete !== 0 && count_insert !== 0) {
- commonlength = diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
- diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [
- DIFF_EQUAL,
- text_insert.substring(0, commonlength)
- ]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- }
- commonlength = diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length - commonlength);
- text_delete = text_delete.substring(0, text_delete.length - commonlength);
- }
- }
- if (count_delete === 0) {
- diffs.splice(
- pointer - count_insert,
- count_delete + count_insert,
- [DIFF_INSERT, text_insert]
- );
- } else if (count_insert === 0) {
- diffs.splice(
- pointer - count_delete,
- count_delete + count_insert,
- [DIFF_DELETE, text_delete]
- );
- } else {
- diffs.splice(
- pointer - count_delete - count_insert,
- count_delete + count_insert,
- [DIFF_DELETE, text_delete],
- [DIFF_INSERT, text_insert]
- );
- }
- pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
- } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = "";
- text_insert = "";
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === "") {
- diffs.pop();
- }
- var changes = false;
- pointer = 1;
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
- if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
- diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- }
- if (changes) {
- diff_cleanupMerge(diffs);
- }
- }
- ;
- var diff = diff_main;
- diff.INSERT = DIFF_INSERT;
- diff.DELETE = DIFF_DELETE;
- diff.EQUAL = DIFF_EQUAL;
- module2.exports = diff;
- function cursor_normalize_diff(diffs, cursor_pos) {
- if (cursor_pos === 0) {
- return [DIFF_EQUAL, diffs];
- }
- for (var current_pos = 0, i = 0; i < diffs.length; i++) {
- var d = diffs[i];
- if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {
- var next_pos = current_pos + d[1].length;
- if (cursor_pos === next_pos) {
- return [i + 1, diffs];
- } else if (cursor_pos < next_pos) {
- diffs = diffs.slice();
- var split_pos = cursor_pos - current_pos;
- var d_left = [d[0], d[1].slice(0, split_pos)];
- var d_right = [d[0], d[1].slice(split_pos)];
- diffs.splice(i, 1, d_left, d_right);
- return [i + 1, diffs];
- } else {
- current_pos = next_pos;
- }
- }
- }
- throw new Error("cursor_pos is out of bounds!");
- }
- function fix_cursor(diffs, cursor_pos) {
- var norm = cursor_normalize_diff(diffs, cursor_pos);
- var ndiffs = norm[1];
- var cursor_pointer = norm[0];
- var d = ndiffs[cursor_pointer];
- var d_next = ndiffs[cursor_pointer + 1];
- if (d == null) {
- return diffs;
- } else if (d[0] !== DIFF_EQUAL) {
- return diffs;
- } else {
- if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {
- ndiffs.splice(cursor_pointer, 2, d_next, d);
- return merge_tuples(ndiffs, cursor_pointer, 2);
- } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {
- ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);
- var suffix = d_next[1].slice(d[1].length);
- if (suffix.length > 0) {
- ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
- }
- return merge_tuples(ndiffs, cursor_pointer, 3);
- } else {
- return diffs;
- }
- }
- }
- function fix_emoji(diffs) {
- var compact = false;
- var starts_with_pair_end = function(str) {
- return str.charCodeAt(0) >= 56320 && str.charCodeAt(0) <= 57343;
- };
- var ends_with_pair_start = function(str) {
- return str.charCodeAt(str.length - 1) >= 55296 && str.charCodeAt(str.length - 1) <= 56319;
- };
- for (var i = 2; i < diffs.length; i += 1) {
- if (diffs[i - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i - 2][1]) && diffs[i - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i - 1][1]) && diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {
- compact = true;
- diffs[i - 1][1] = diffs[i - 2][1].slice(-1) + diffs[i - 1][1];
- diffs[i][1] = diffs[i - 2][1].slice(-1) + diffs[i][1];
- diffs[i - 2][1] = diffs[i - 2][1].slice(0, -1);
- }
- }
- if (!compact) {
- return diffs;
- }
- var fixed_diffs = [];
- for (var i = 0; i < diffs.length; i += 1) {
- if (diffs[i][1].length > 0) {
- fixed_diffs.push(diffs[i]);
- }
- }
- return fixed_diffs;
- }
- function merge_tuples(diffs, start, length) {
- for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {
- if (i + 1 < diffs.length) {
- var left_d = diffs[i];
- var right_d = diffs[i + 1];
- if (left_d[0] === right_d[1]) {
- diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);
- }
- }
- }
- return diffs;
- }
- }),
- /* 52 */
- /***/
- (function(module2, exports2) {
- exports2 = module2.exports = typeof Object.keys === "function" ? Object.keys : shim;
- exports2.shim = shim;
- function shim(obj) {
- var keys = [];
- for (var key in obj) keys.push(key);
- return keys;
- }
- }),
- /* 53 */
- /***/
- (function(module2, exports2) {
- var supportsArgumentsClass = (function() {
- return Object.prototype.toString.call(arguments);
- })() == "[object Arguments]";
- exports2 = module2.exports = supportsArgumentsClass ? supported : unsupported;
- exports2.supported = supported;
- function supported(object) {
- return Object.prototype.toString.call(object) == "[object Arguments]";
- }
- ;
- exports2.unsupported = unsupported;
- function unsupported(object) {
- return object && typeof object == "object" && typeof object.length == "number" && Object.prototype.hasOwnProperty.call(object, "callee") && !Object.prototype.propertyIsEnumerable.call(object, "callee") || false;
- }
- ;
- }),
- /* 54 */
- /***/
- (function(module2, exports2) {
- "use strict";
- var has = Object.prototype.hasOwnProperty, prefix = "~";
- function Events() {
- }
- if (Object.create) {
- Events.prototype = /* @__PURE__ */ Object.create(null);
- if (!new Events().__proto__) prefix = false;
- }
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = [], events, name;
- if (this._eventsCount === 0) return names;
- for (name in events = this._events) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
- return names;
- };
- EventEmitter.prototype.listeners = function listeners(event, exists) {
- var evt = prefix ? prefix + event : event, available = this._events[evt];
- if (exists) return !!available;
- if (!available) return [];
- if (available.fn) return [available.fn];
- for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
- ee[i] = available[i].fn;
- }
- return ee;
- };
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return false;
- var listeners = this._events[evt], len = arguments.length, args, i;
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
- switch (len) {
- case 1:
- return listeners.fn.call(listeners.context), true;
- case 2:
- return listeners.fn.call(listeners.context, a1), true;
- case 3:
- return listeners.fn.call(listeners.context, a1, a2), true;
- case 4:
- return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5:
- return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6:
- return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
- for (i = 1, args = new Array(len - 1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length, j;
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
- switch (len) {
- case 1:
- listeners[i].fn.call(listeners[i].context);
- break;
- case 2:
- listeners[i].fn.call(listeners[i].context, a1);
- break;
- case 3:
- listeners[i].fn.call(listeners[i].context, a1, a2);
- break;
- case 4:
- listeners[i].fn.call(listeners[i].context, a1, a2, a3);
- break;
- default:
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
- return true;
- };
- EventEmitter.prototype.on = function on(event, fn, context) {
- var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event;
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
- return this;
- };
- EventEmitter.prototype.once = function once(event, fn, context) {
- var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event;
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
- return this;
- };
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return this;
- if (!fn) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- return this;
- }
- var listeners = this._events[evt];
- if (listeners.fn) {
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
- events.push(listeners[i]);
- }
- }
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- return this;
- };
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
- return this;
- };
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
- EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
- return this;
- };
- EventEmitter.prefixed = prefix;
- EventEmitter.EventEmitter = EventEmitter;
- if ("undefined" !== typeof module2) {
- module2.exports = EventEmitter;
- }
- }),
- /* 55 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.matchText = exports2.matchSpacing = exports2.matchNewline = exports2.matchBlot = exports2.matchAttributor = exports2.default = void 0;
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _extend2 = __webpack_require__(3);
- var _extend3 = _interopRequireDefault(_extend2);
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- var _align = __webpack_require__(36);
- var _background = __webpack_require__(37);
- var _code = __webpack_require__(13);
- var _code2 = _interopRequireDefault(_code);
- var _color = __webpack_require__(26);
- var _direction = __webpack_require__(38);
- var _font = __webpack_require__(39);
- var _size = __webpack_require__(40);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var debug = (0, _logger2.default)("quill:clipboard");
- var DOM_KEY = "__ql-matcher";
- var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
- var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function(memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
- var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function(memo, attr) {
- memo[attr.keyName] = attr;
- return memo;
- }, {});
- var Clipboard = (function(_Module) {
- _inherits(Clipboard2, _Module);
- function Clipboard2(quill, options) {
- _classCallCheck(this, Clipboard2);
- var _this = _possibleConstructorReturn(this, (Clipboard2.__proto__ || Object.getPrototypeOf(Clipboard2)).call(this, quill, options));
- _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
- _this.container = _this.quill.addContainer("ql-clipboard");
- _this.container.setAttribute("contenteditable", true);
- _this.container.setAttribute("tabindex", -1);
- _this.matchers = [];
- CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function(_ref) {
- var _ref2 = _slicedToArray(_ref, 2), selector = _ref2[0], matcher = _ref2[1];
- if (!options.matchVisual && matcher === matchSpacing) return;
- _this.addMatcher(selector, matcher);
- });
- return _this;
- }
- _createClass(Clipboard2, [{
- key: "addMatcher",
- value: function addMatcher(selector, matcher) {
- this.matchers.push([selector, matcher]);
- }
- }, {
- key: "convert",
- value: function convert(html) {
- if (typeof html === "string") {
- this.container.innerHTML = html.replace(/\>\r?\n +\</g, "><");
- return this.convert();
- }
- var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
- if (formats[_code2.default.blotName]) {
- var text = this.container.innerText;
- this.container.innerHTML = "";
- return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));
- }
- var _prepareMatching = this.prepareMatching(), _prepareMatching2 = _slicedToArray(_prepareMatching, 2), elementMatchers = _prepareMatching2[0], textMatchers = _prepareMatching2[1];
- var delta = traverse(this.container, elementMatchers, textMatchers);
- if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
- delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
- }
- debug.log("convert", this.container.innerHTML, delta);
- this.container.innerHTML = "";
- return delta;
- }
- }, {
- key: "dangerouslyPasteHTML",
- value: function dangerouslyPasteHTML(index, html) {
- var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _quill2.default.sources.API;
- if (typeof index === "string") {
- this.quill.setContents(this.convert(index), html);
- this.quill.setSelection(0, _quill2.default.sources.SILENT);
- } else {
- var paste = this.convert(html);
- this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);
- this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);
- }
- }
- }, {
- key: "onPaste",
- value: function onPaste(e) {
- var _this2 = this;
- if (e.defaultPrevented || !this.quill.isEnabled()) return;
- var range = this.quill.getSelection();
- var delta = new _quillDelta2.default().retain(range.index);
- var scrollTop = this.quill.scrollingContainer.scrollTop;
- this.container.focus();
- this.quill.selection.update(_quill2.default.sources.SILENT);
- setTimeout(function() {
- delta = delta.concat(_this2.convert()).delete(range.length);
- _this2.quill.updateContents(delta, _quill2.default.sources.USER);
- _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
- _this2.quill.scrollingContainer.scrollTop = scrollTop;
- _this2.quill.focus();
- }, 1);
- }
- }, {
- key: "prepareMatching",
- value: function prepareMatching() {
- var _this3 = this;
- var elementMatchers = [], textMatchers = [];
- this.matchers.forEach(function(pair) {
- var _pair = _slicedToArray(pair, 2), selector = _pair[0], matcher = _pair[1];
- switch (selector) {
- case Node.TEXT_NODE:
- textMatchers.push(matcher);
- break;
- case Node.ELEMENT_NODE:
- elementMatchers.push(matcher);
- break;
- default:
- [].forEach.call(_this3.container.querySelectorAll(selector), function(node) {
- node[DOM_KEY] = node[DOM_KEY] || [];
- node[DOM_KEY].push(matcher);
- });
- break;
- }
- });
- return [elementMatchers, textMatchers];
- }
- }]);
- return Clipboard2;
- })(_module2.default);
- Clipboard.DEFAULTS = {
- matchers: [],
- matchVisual: true
- };
- function applyFormat(delta, format, value) {
- if ((typeof format === "undefined" ? "undefined" : _typeof(format)) === "object") {
- return Object.keys(format).reduce(function(delta2, key) {
- return applyFormat(delta2, key, format[key]);
- }, delta);
- } else {
- return delta.reduce(function(delta2, op) {
- if (op.attributes && op.attributes[format]) {
- return delta2.push(op);
- } else {
- return delta2.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));
- }
- }, new _quillDelta2.default());
- }
- }
- function computeStyle(node) {
- if (node.nodeType !== Node.ELEMENT_NODE) return {};
- var DOM_KEY2 = "__ql-computed-style";
- return node[DOM_KEY2] || (node[DOM_KEY2] = window.getComputedStyle(node));
- }
- function deltaEndsWith(delta, text) {
- var endText = "";
- for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {
- var op = delta.ops[i];
- if (typeof op.insert !== "string") break;
- endText = op.insert + endText;
- }
- return endText.slice(-1 * text.length) === text;
- }
- function isLine(node) {
- if (node.childNodes.length === 0) return false;
- var style = computeStyle(node);
- return ["block", "list-item"].indexOf(style.display) > -1;
- }
- function traverse(node, elementMatchers, textMatchers) {
- if (node.nodeType === node.TEXT_NODE) {
- return textMatchers.reduce(function(delta, matcher) {
- return matcher(node, delta);
- }, new _quillDelta2.default());
- } else if (node.nodeType === node.ELEMENT_NODE) {
- return [].reduce.call(node.childNodes || [], function(delta, childNode) {
- var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
- if (childNode.nodeType === node.ELEMENT_NODE) {
- childrenDelta = elementMatchers.reduce(function(childrenDelta2, matcher) {
- return matcher(childNode, childrenDelta2);
- }, childrenDelta);
- childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta2, matcher) {
- return matcher(childNode, childrenDelta2);
- }, childrenDelta);
- }
- return delta.concat(childrenDelta);
- }, new _quillDelta2.default());
- } else {
- return new _quillDelta2.default();
- }
- }
- function matchAlias(format, node, delta) {
- return applyFormat(delta, format, true);
- }
- function matchAttributor(node, delta) {
- var attributes = _parchment2.default.Attributor.Attribute.keys(node);
- var classes = _parchment2.default.Attributor.Class.keys(node);
- var styles = _parchment2.default.Attributor.Style.keys(node);
- var formats = {};
- attributes.concat(classes).concat(styles).forEach(function(name) {
- var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);
- if (attr != null) {
- formats[attr.attrName] = attr.value(node);
- if (formats[attr.attrName]) return;
- }
- attr = ATTRIBUTE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- formats[attr.attrName] = attr.value(node) || void 0;
- }
- attr = STYLE_ATTRIBUTORS[name];
- if (attr != null && (attr.attrName === name || attr.keyName === name)) {
- attr = STYLE_ATTRIBUTORS[name];
- formats[attr.attrName] = attr.value(node) || void 0;
- }
- });
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- return delta;
- }
- function matchBlot(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null) return delta;
- if (match.prototype instanceof _parchment2.default.Embed) {
- var embed = {};
- var value = match.value(node);
- if (value != null) {
- embed[match.blotName] = value;
- delta = new _quillDelta2.default().insert(embed, match.formats(node));
- }
- } else if (typeof match.formats === "function") {
- delta = applyFormat(delta, match.blotName, match.formats(node));
- }
- return delta;
- }
- function matchBreak(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- delta.insert("\n");
- }
- return delta;
- }
- function matchIgnore() {
- return new _quillDelta2.default();
- }
- function matchIndent(node, delta) {
- var match = _parchment2.default.query(node);
- if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
- return delta;
- }
- var indent = -1, parent = node.parentNode;
- while (!parent.classList.contains("ql-clipboard")) {
- if ((_parchment2.default.query(parent) || {}).blotName === "list") {
- indent += 1;
- }
- parent = parent.parentNode;
- }
- if (indent <= 0) return delta;
- return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent }));
- }
- function matchNewline(node, delta) {
- if (!deltaEndsWith(delta, "\n")) {
- if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {
- delta.insert("\n");
- }
- }
- return delta;
- }
- function matchSpacing(node, delta) {
- if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
- var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);
- if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {
- delta.insert("\n");
- }
- }
- return delta;
- }
- function matchStyles(node, delta) {
- var formats = {};
- var style = node.style || {};
- if (style.fontStyle && computeStyle(node).fontStyle === "italic") {
- formats.italic = true;
- }
- if (style.fontWeight && (computeStyle(node).fontWeight.startsWith("bold") || parseInt(computeStyle(node).fontWeight) >= 700)) {
- formats.bold = true;
- }
- if (Object.keys(formats).length > 0) {
- delta = applyFormat(delta, formats);
- }
- if (parseFloat(style.textIndent || 0) > 0) {
- delta = new _quillDelta2.default().insert(" ").concat(delta);
- }
- return delta;
- }
- function matchText(node, delta) {
- var text = node.data;
- if (node.parentNode.tagName === "O:P") {
- return delta.insert(text.trim());
- }
- if (text.trim().length === 0 && node.parentNode.classList.contains("ql-clipboard")) {
- return delta;
- }
- if (!computeStyle(node.parentNode).whiteSpace.startsWith("pre")) {
- var replacer = function replacer2(collapse, match) {
- match = match.replace(/[^\u00a0]/g, "");
- return match.length < 1 && collapse ? " " : match;
- };
- text = text.replace(/\r\n/g, " ").replace(/\n/g, " ");
- text = text.replace(/\s\s+/g, replacer.bind(replacer, true));
- if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {
- text = text.replace(/^\s+/, replacer.bind(replacer, false));
- }
- if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {
- text = text.replace(/\s+$/, replacer.bind(replacer, false));
- }
- }
- return delta.insert(text);
- }
- exports2.default = Clipboard;
- exports2.matchAttributor = matchAttributor;
- exports2.matchBlot = matchBlot;
- exports2.matchNewline = matchNewline;
- exports2.matchSpacing = matchSpacing;
- exports2.matchText = matchText;
- }),
- /* 56 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Bold = (function(_Inline) {
- _inherits(Bold2, _Inline);
- function Bold2() {
- _classCallCheck(this, Bold2);
- return _possibleConstructorReturn(this, (Bold2.__proto__ || Object.getPrototypeOf(Bold2)).apply(this, arguments));
- }
- _createClass(Bold2, [{
- key: "optimize",
- value: function optimize(context) {
- _get(Bold2.prototype.__proto__ || Object.getPrototypeOf(Bold2.prototype), "optimize", this).call(this, context);
- if (this.domNode.tagName !== this.statics.tagName[0]) {
- this.replaceWith(this.statics.blotName);
- }
- }
- }], [{
- key: "create",
- value: function create() {
- return _get(Bold2.__proto__ || Object.getPrototypeOf(Bold2), "create", this).call(this);
- }
- }, {
- key: "formats",
- value: function formats() {
- return true;
- }
- }]);
- return Bold2;
- })(_inline2.default);
- Bold.blotName = "bold";
- Bold.tagName = ["STRONG", "B"];
- exports2.default = Bold;
- }),
- /* 57 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.addControls = exports2.default = void 0;
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _quillDelta = __webpack_require__(2);
- var _quillDelta2 = _interopRequireDefault(_quillDelta);
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _logger = __webpack_require__(10);
- var _logger2 = _interopRequireDefault(_logger);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var debug = (0, _logger2.default)("quill:toolbar");
- var Toolbar = (function(_Module) {
- _inherits(Toolbar2, _Module);
- function Toolbar2(quill, options) {
- _classCallCheck(this, Toolbar2);
- var _this = _possibleConstructorReturn(this, (Toolbar2.__proto__ || Object.getPrototypeOf(Toolbar2)).call(this, quill, options));
- if (Array.isArray(_this.options.container)) {
- var container = document.createElement("div");
- addControls(container, _this.options.container);
- quill.container.parentNode.insertBefore(container, quill.container);
- _this.container = container;
- } else if (typeof _this.options.container === "string") {
- _this.container = document.querySelector(_this.options.container);
- } else {
- _this.container = _this.options.container;
- }
- if (!(_this.container instanceof HTMLElement)) {
- var _ret;
- return _ret = debug.error("Container required for toolbar", _this.options), _possibleConstructorReturn(_this, _ret);
- }
- _this.container.classList.add("ql-toolbar");
- _this.controls = [];
- _this.handlers = {};
- Object.keys(_this.options.handlers).forEach(function(format) {
- _this.addHandler(format, _this.options.handlers[format]);
- });
- [].forEach.call(_this.container.querySelectorAll("button, select"), function(input) {
- _this.attach(input);
- });
- _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(type, range) {
- if (type === _quill2.default.events.SELECTION_CHANGE) {
- _this.update(range);
- }
- });
- _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
- var _this$quill$selection = _this.quill.selection.getRange(), _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), range = _this$quill$selection2[0];
- _this.update(range);
- });
- return _this;
- }
- _createClass(Toolbar2, [{
- key: "addHandler",
- value: function addHandler(format, handler) {
- this.handlers[format] = handler;
- }
- }, {
- key: "attach",
- value: function attach(input) {
- var _this2 = this;
- var format = [].find.call(input.classList, function(className) {
- return className.indexOf("ql-") === 0;
- });
- if (!format) return;
- format = format.slice("ql-".length);
- if (input.tagName === "BUTTON") {
- input.setAttribute("type", "button");
- }
- if (this.handlers[format] == null) {
- if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
- debug.warn("ignoring attaching to disabled format", format, input);
- return;
- }
- if (_parchment2.default.query(format) == null) {
- debug.warn("ignoring attaching to nonexistent format", format, input);
- return;
- }
- }
- var eventName = input.tagName === "SELECT" ? "change" : "click";
- input.addEventListener(eventName, function(e) {
- var value = void 0;
- if (input.tagName === "SELECT") {
- if (input.selectedIndex < 0) return;
- var selected = input.options[input.selectedIndex];
- if (selected.hasAttribute("selected")) {
- value = false;
- } else {
- value = selected.value || false;
- }
- } else {
- if (input.classList.contains("ql-active")) {
- value = false;
- } else {
- value = input.value || !input.hasAttribute("value");
- }
- e.preventDefault();
- }
- _this2.quill.focus();
- var _quill$selection$getR = _this2.quill.selection.getRange(), _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), range = _quill$selection$getR2[0];
- if (_this2.handlers[format] != null) {
- _this2.handlers[format].call(_this2, value);
- } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
- value = prompt("Enter " + format);
- if (!value) return;
- _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);
- } else {
- _this2.quill.format(format, value, _quill2.default.sources.USER);
- }
- _this2.update(range);
- });
- this.controls.push([format, input]);
- }
- }, {
- key: "update",
- value: function update(range) {
- var formats = range == null ? {} : this.quill.getFormat(range);
- this.controls.forEach(function(pair) {
- var _pair = _slicedToArray(pair, 2), format = _pair[0], input = _pair[1];
- if (input.tagName === "SELECT") {
- var option = void 0;
- if (range == null) {
- option = null;
- } else if (formats[format] == null) {
- option = input.querySelector("option[selected]");
- } else if (!Array.isArray(formats[format])) {
- var value = formats[format];
- if (typeof value === "string") {
- value = value.replace(/\"/g, '\\"');
- }
- option = input.querySelector('option[value="' + value + '"]');
- }
- if (option == null) {
- input.value = "";
- input.selectedIndex = -1;
- } else {
- option.selected = true;
- }
- } else {
- if (range == null) {
- input.classList.remove("ql-active");
- } else if (input.hasAttribute("value")) {
- var isActive = formats[format] === input.getAttribute("value") || formats[format] != null && formats[format].toString() === input.getAttribute("value") || formats[format] == null && !input.getAttribute("value");
- input.classList.toggle("ql-active", isActive);
- } else {
- input.classList.toggle("ql-active", formats[format] != null);
- }
- }
- });
- }
- }]);
- return Toolbar2;
- })(_module2.default);
- Toolbar.DEFAULTS = {};
- function addButton(container, format, value) {
- var input = document.createElement("button");
- input.setAttribute("type", "button");
- input.classList.add("ql-" + format);
- if (value != null) {
- input.value = value;
- }
- container.appendChild(input);
- }
- function addControls(container, groups) {
- if (!Array.isArray(groups[0])) {
- groups = [groups];
- }
- groups.forEach(function(controls) {
- var group = document.createElement("span");
- group.classList.add("ql-formats");
- controls.forEach(function(control) {
- if (typeof control === "string") {
- addButton(group, control);
- } else {
- var format = Object.keys(control)[0];
- var value = control[format];
- if (Array.isArray(value)) {
- addSelect(group, format, value);
- } else {
- addButton(group, format, value);
- }
- }
- });
- container.appendChild(group);
- });
- }
- function addSelect(container, format, values) {
- var input = document.createElement("select");
- input.classList.add("ql-" + format);
- values.forEach(function(value) {
- var option = document.createElement("option");
- if (value !== false) {
- option.setAttribute("value", value);
- } else {
- option.setAttribute("selected", "selected");
- }
- input.appendChild(option);
- });
- container.appendChild(input);
- }
- Toolbar.DEFAULTS = {
- container: null,
- handlers: {
- clean: function clean() {
- var _this3 = this;
- var range = this.quill.getSelection();
- if (range == null) return;
- if (range.length == 0) {
- var formats = this.quill.getFormat();
- Object.keys(formats).forEach(function(name) {
- if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {
- _this3.quill.format(name, false);
- }
- });
- } else {
- this.quill.removeFormat(range, _quill2.default.sources.USER);
- }
- },
- direction: function direction(value) {
- var align = this.quill.getFormat()["align"];
- if (value === "rtl" && align == null) {
- this.quill.format("align", "right", _quill2.default.sources.USER);
- } else if (!value && align === "right") {
- this.quill.format("align", false, _quill2.default.sources.USER);
- }
- this.quill.format("direction", value, _quill2.default.sources.USER);
- },
- indent: function indent(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- var indent2 = parseInt(formats.indent || 0);
- if (value === "+1" || value === "-1") {
- var modifier = value === "+1" ? 1 : -1;
- if (formats.direction === "rtl") modifier *= -1;
- this.quill.format("indent", indent2 + modifier, _quill2.default.sources.USER);
- }
- },
- link: function link(value) {
- if (value === true) {
- value = prompt("Enter link URL:");
- }
- this.quill.format("link", value, _quill2.default.sources.USER);
- },
- list: function list(value) {
- var range = this.quill.getSelection();
- var formats = this.quill.getFormat(range);
- if (value === "check") {
- if (formats["list"] === "checked" || formats["list"] === "unchecked") {
- this.quill.format("list", false, _quill2.default.sources.USER);
- } else {
- this.quill.format("list", "unchecked", _quill2.default.sources.USER);
- }
- } else {
- this.quill.format("list", value, _quill2.default.sources.USER);
- }
- }
- }
- };
- exports2.default = Toolbar;
- exports2.addControls = addControls;
- }),
- /* 58 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>';
- }),
- /* 59 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _picker = __webpack_require__(28);
- var _picker2 = _interopRequireDefault(_picker);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ColorPicker = (function(_Picker) {
- _inherits(ColorPicker2, _Picker);
- function ColorPicker2(select, label) {
- _classCallCheck(this, ColorPicker2);
- var _this = _possibleConstructorReturn(this, (ColorPicker2.__proto__ || Object.getPrototypeOf(ColorPicker2)).call(this, select));
- _this.label.innerHTML = label;
- _this.container.classList.add("ql-color-picker");
- [].slice.call(_this.container.querySelectorAll(".ql-picker-item"), 0, 7).forEach(function(item) {
- item.classList.add("ql-primary");
- });
- return _this;
- }
- _createClass(ColorPicker2, [{
- key: "buildItem",
- value: function buildItem(option) {
- var item = _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "buildItem", this).call(this, option);
- item.style.backgroundColor = option.getAttribute("value") || "";
- return item;
- }
- }, {
- key: "selectItem",
- value: function selectItem(item, trigger) {
- _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "selectItem", this).call(this, item, trigger);
- var colorLabel = this.label.querySelector(".ql-color-label");
- var value = item ? item.getAttribute("data-value") || "" : "";
- if (colorLabel) {
- if (colorLabel.tagName === "line") {
- colorLabel.style.stroke = value;
- } else {
- colorLabel.style.fill = value;
- }
- }
- }
- }]);
- return ColorPicker2;
- })(_picker2.default);
- exports2.default = ColorPicker;
- }),
- /* 60 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _picker = __webpack_require__(28);
- var _picker2 = _interopRequireDefault(_picker);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var IconPicker = (function(_Picker) {
- _inherits(IconPicker2, _Picker);
- function IconPicker2(select, icons) {
- _classCallCheck(this, IconPicker2);
- var _this = _possibleConstructorReturn(this, (IconPicker2.__proto__ || Object.getPrototypeOf(IconPicker2)).call(this, select));
- _this.container.classList.add("ql-icon-picker");
- [].forEach.call(_this.container.querySelectorAll(".ql-picker-item"), function(item) {
- item.innerHTML = icons[item.getAttribute("data-value") || ""];
- });
- _this.defaultItem = _this.container.querySelector(".ql-selected");
- _this.selectItem(_this.defaultItem);
- return _this;
- }
- _createClass(IconPicker2, [{
- key: "selectItem",
- value: function selectItem(item, trigger) {
- _get(IconPicker2.prototype.__proto__ || Object.getPrototypeOf(IconPicker2.prototype), "selectItem", this).call(this, item, trigger);
- item = item || this.defaultItem;
- this.label.innerHTML = item.innerHTML;
- }
- }]);
- return IconPicker2;
- })(_picker2.default);
- exports2.default = IconPicker;
- }),
- /* 61 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var Tooltip = (function() {
- function Tooltip2(quill, boundsContainer) {
- var _this = this;
- _classCallCheck(this, Tooltip2);
- this.quill = quill;
- this.boundsContainer = boundsContainer || document.body;
- this.root = quill.addContainer("ql-tooltip");
- this.root.innerHTML = this.constructor.TEMPLATE;
- if (this.quill.root === this.quill.scrollingContainer) {
- this.quill.root.addEventListener("scroll", function() {
- _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + "px";
- });
- }
- this.hide();
- }
- _createClass(Tooltip2, [{
- key: "hide",
- value: function hide() {
- this.root.classList.add("ql-hidden");
- }
- }, {
- key: "position",
- value: function position(reference) {
- var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;
- var top = reference.bottom + this.quill.root.scrollTop;
- this.root.style.left = left + "px";
- this.root.style.top = top + "px";
- this.root.classList.remove("ql-flip");
- var containerBounds = this.boundsContainer.getBoundingClientRect();
- var rootBounds = this.root.getBoundingClientRect();
- var shift = 0;
- if (rootBounds.right > containerBounds.right) {
- shift = containerBounds.right - rootBounds.right;
- this.root.style.left = left + shift + "px";
- }
- if (rootBounds.left < containerBounds.left) {
- shift = containerBounds.left - rootBounds.left;
- this.root.style.left = left + shift + "px";
- }
- if (rootBounds.bottom > containerBounds.bottom) {
- var height = rootBounds.bottom - rootBounds.top;
- var verticalShift = reference.bottom - reference.top + height;
- this.root.style.top = top - verticalShift + "px";
- this.root.classList.add("ql-flip");
- }
- return shift;
- }
- }, {
- key: "show",
- value: function show() {
- this.root.classList.remove("ql-editing");
- this.root.classList.remove("ql-hidden");
- }
- }]);
- return Tooltip2;
- })();
- exports2.default = Tooltip;
- }),
- /* 62 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _slicedToArray = /* @__PURE__ */ (function() {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = void 0;
- 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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function(arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if (Symbol.iterator in Object(arr)) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _emitter = __webpack_require__(8);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _base = __webpack_require__(43);
- var _base2 = _interopRequireDefault(_base);
- var _link = __webpack_require__(27);
- var _link2 = _interopRequireDefault(_link);
- var _selection = __webpack_require__(15);
- var _icons = __webpack_require__(41);
- var _icons2 = _interopRequireDefault(_icons);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var TOOLBAR_CONFIG = [[{ header: ["1", "2", "3", false] }], ["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]];
- var SnowTheme = (function(_BaseTheme) {
- _inherits(SnowTheme2, _BaseTheme);
- function SnowTheme2(quill, options) {
- _classCallCheck(this, SnowTheme2);
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
- var _this = _possibleConstructorReturn(this, (SnowTheme2.__proto__ || Object.getPrototypeOf(SnowTheme2)).call(this, quill, options));
- _this.quill.container.classList.add("ql-snow");
- return _this;
- }
- _createClass(SnowTheme2, [{
- key: "extendToolbar",
- value: function extendToolbar(toolbar) {
- toolbar.container.classList.add("ql-snow");
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
- this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
- if (toolbar.container.querySelector(".ql-link")) {
- this.quill.keyboard.addBinding({ key: "K", shortKey: true }, function(range, context) {
- toolbar.handlers["link"].call(toolbar, !context.format.link);
- });
- }
- }
- }]);
- return SnowTheme2;
- })(_base2.default);
- SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (value) {
- var range = this.quill.getSelection();
- if (range == null || range.length == 0) return;
- var preview = this.quill.getText(range);
- if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf("mailto:") !== 0) {
- preview = "mailto:" + preview;
- }
- var tooltip = this.quill.theme.tooltip;
- tooltip.edit("link", preview);
- } else {
- this.quill.format("link", false);
- }
- }
- }
- }
- }
- });
- var SnowTooltip = (function(_BaseTooltip) {
- _inherits(SnowTooltip2, _BaseTooltip);
- function SnowTooltip2(quill, bounds) {
- _classCallCheck(this, SnowTooltip2);
- var _this2 = _possibleConstructorReturn(this, (SnowTooltip2.__proto__ || Object.getPrototypeOf(SnowTooltip2)).call(this, quill, bounds));
- _this2.preview = _this2.root.querySelector("a.ql-preview");
- return _this2;
- }
- _createClass(SnowTooltip2, [{
- key: "listen",
- value: function listen() {
- var _this3 = this;
- _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "listen", this).call(this);
- this.root.querySelector("a.ql-action").addEventListener("click", function(event) {
- if (_this3.root.classList.contains("ql-editing")) {
- _this3.save();
- } else {
- _this3.edit("link", _this3.preview.textContent);
- }
- event.preventDefault();
- });
- this.root.querySelector("a.ql-remove").addEventListener("click", function(event) {
- if (_this3.linkRange != null) {
- var range = _this3.linkRange;
- _this3.restoreFocus();
- _this3.quill.formatText(range, "link", false, _emitter2.default.sources.USER);
- delete _this3.linkRange;
- }
- event.preventDefault();
- _this3.hide();
- });
- this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function(range, oldRange, source) {
- if (range == null) return;
- if (range.length === 0 && source === _emitter2.default.sources.USER) {
- var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), link = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
- if (link != null) {
- _this3.linkRange = new _selection.Range(range.index - offset, link.length());
- var preview = _link2.default.formats(link.domNode);
- _this3.preview.textContent = preview;
- _this3.preview.setAttribute("href", preview);
- _this3.show();
- _this3.position(_this3.quill.getBounds(_this3.linkRange));
- return;
- }
- } else {
- delete _this3.linkRange;
- }
- _this3.hide();
- });
- }
- }, {
- key: "show",
- value: function show() {
- _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "show", this).call(this);
- this.root.removeAttribute("data-mode");
- }
- }]);
- return SnowTooltip2;
- })(_base.BaseTooltip);
- SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join("");
- exports2.default = SnowTheme;
- }),
- /* 63 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _core = __webpack_require__(29);
- var _core2 = _interopRequireDefault(_core);
- var _align = __webpack_require__(36);
- var _direction = __webpack_require__(38);
- var _indent = __webpack_require__(64);
- var _blockquote = __webpack_require__(65);
- var _blockquote2 = _interopRequireDefault(_blockquote);
- var _header = __webpack_require__(66);
- var _header2 = _interopRequireDefault(_header);
- var _list = __webpack_require__(67);
- var _list2 = _interopRequireDefault(_list);
- var _background = __webpack_require__(37);
- var _color = __webpack_require__(26);
- var _font = __webpack_require__(39);
- var _size = __webpack_require__(40);
- var _bold = __webpack_require__(56);
- var _bold2 = _interopRequireDefault(_bold);
- var _italic = __webpack_require__(68);
- var _italic2 = _interopRequireDefault(_italic);
- var _link = __webpack_require__(27);
- var _link2 = _interopRequireDefault(_link);
- var _script = __webpack_require__(69);
- var _script2 = _interopRequireDefault(_script);
- var _strike = __webpack_require__(70);
- var _strike2 = _interopRequireDefault(_strike);
- var _underline = __webpack_require__(71);
- var _underline2 = _interopRequireDefault(_underline);
- var _image = __webpack_require__(72);
- var _image2 = _interopRequireDefault(_image);
- var _video = __webpack_require__(73);
- var _video2 = _interopRequireDefault(_video);
- var _code = __webpack_require__(13);
- var _code2 = _interopRequireDefault(_code);
- var _formula = __webpack_require__(74);
- var _formula2 = _interopRequireDefault(_formula);
- var _syntax = __webpack_require__(75);
- var _syntax2 = _interopRequireDefault(_syntax);
- var _toolbar = __webpack_require__(57);
- var _toolbar2 = _interopRequireDefault(_toolbar);
- var _icons = __webpack_require__(41);
- var _icons2 = _interopRequireDefault(_icons);
- var _picker = __webpack_require__(28);
- var _picker2 = _interopRequireDefault(_picker);
- var _colorPicker = __webpack_require__(59);
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
- var _iconPicker = __webpack_require__(60);
- var _iconPicker2 = _interopRequireDefault(_iconPicker);
- var _tooltip = __webpack_require__(61);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- var _bubble = __webpack_require__(108);
- var _bubble2 = _interopRequireDefault(_bubble);
- var _snow = __webpack_require__(62);
- var _snow2 = _interopRequireDefault(_snow);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- _core2.default.register({
- "attributors/attribute/direction": _direction.DirectionAttribute,
- "attributors/class/align": _align.AlignClass,
- "attributors/class/background": _background.BackgroundClass,
- "attributors/class/color": _color.ColorClass,
- "attributors/class/direction": _direction.DirectionClass,
- "attributors/class/font": _font.FontClass,
- "attributors/class/size": _size.SizeClass,
- "attributors/style/align": _align.AlignStyle,
- "attributors/style/background": _background.BackgroundStyle,
- "attributors/style/color": _color.ColorStyle,
- "attributors/style/direction": _direction.DirectionStyle,
- "attributors/style/font": _font.FontStyle,
- "attributors/style/size": _size.SizeStyle
- }, true);
- _core2.default.register({
- "formats/align": _align.AlignClass,
- "formats/direction": _direction.DirectionClass,
- "formats/indent": _indent.IndentClass,
- "formats/background": _background.BackgroundStyle,
- "formats/color": _color.ColorStyle,
- "formats/font": _font.FontClass,
- "formats/size": _size.SizeClass,
- "formats/blockquote": _blockquote2.default,
- "formats/code-block": _code2.default,
- "formats/header": _header2.default,
- "formats/list": _list2.default,
- "formats/bold": _bold2.default,
- "formats/code": _code.Code,
- "formats/italic": _italic2.default,
- "formats/link": _link2.default,
- "formats/script": _script2.default,
- "formats/strike": _strike2.default,
- "formats/underline": _underline2.default,
- "formats/image": _image2.default,
- "formats/video": _video2.default,
- "formats/list/item": _list.ListItem,
- "modules/formula": _formula2.default,
- "modules/syntax": _syntax2.default,
- "modules/toolbar": _toolbar2.default,
- "themes/bubble": _bubble2.default,
- "themes/snow": _snow2.default,
- "ui/icons": _icons2.default,
- "ui/picker": _picker2.default,
- "ui/icon-picker": _iconPicker2.default,
- "ui/color-picker": _colorPicker2.default,
- "ui/tooltip": _tooltip2.default
- }, true);
- exports2.default = _core2.default;
- }),
- /* 64 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.IndentClass = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var IdentAttributor = (function(_Parchment$Attributor) {
- _inherits(IdentAttributor2, _Parchment$Attributor);
- function IdentAttributor2() {
- _classCallCheck(this, IdentAttributor2);
- return _possibleConstructorReturn(this, (IdentAttributor2.__proto__ || Object.getPrototypeOf(IdentAttributor2)).apply(this, arguments));
- }
- _createClass(IdentAttributor2, [{
- key: "add",
- value: function add(node, value) {
- if (value === "+1" || value === "-1") {
- var indent = this.value(node) || 0;
- value = value === "+1" ? indent + 1 : indent - 1;
- }
- if (value === 0) {
- this.remove(node);
- return true;
- } else {
- return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "add", this).call(this, node, value);
- }
- }
- }, {
- key: "canAdd",
- value: function canAdd(node, value) {
- return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, value) || _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, parseInt(value));
- }
- }, {
- key: "value",
- value: function value(node) {
- return parseInt(_get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "value", this).call(this, node)) || void 0;
- }
- }]);
- return IdentAttributor2;
- })(_parchment2.default.Attributor.Class);
- var IndentClass = new IdentAttributor("indent", "ql-indent", {
- scope: _parchment2.default.Scope.BLOCK,
- whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
- });
- exports2.IndentClass = IndentClass;
- }),
- /* 65 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Blockquote = (function(_Block) {
- _inherits(Blockquote2, _Block);
- function Blockquote2() {
- _classCallCheck(this, Blockquote2);
- return _possibleConstructorReturn(this, (Blockquote2.__proto__ || Object.getPrototypeOf(Blockquote2)).apply(this, arguments));
- }
- return Blockquote2;
- })(_block2.default);
- Blockquote.blotName = "blockquote";
- Blockquote.tagName = "blockquote";
- exports2.default = Blockquote;
- }),
- /* 66 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Header = (function(_Block) {
- _inherits(Header2, _Block);
- function Header2() {
- _classCallCheck(this, Header2);
- return _possibleConstructorReturn(this, (Header2.__proto__ || Object.getPrototypeOf(Header2)).apply(this, arguments));
- }
- _createClass(Header2, null, [{
- key: "formats",
- value: function formats(domNode) {
- return this.tagName.indexOf(domNode.tagName) + 1;
- }
- }]);
- return Header2;
- })(_block2.default);
- Header.blotName = "header";
- Header.tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
- exports2.default = Header;
- }),
- /* 67 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.ListItem = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _block = __webpack_require__(4);
- var _block2 = _interopRequireDefault(_block);
- var _container = __webpack_require__(25);
- var _container2 = _interopRequireDefault(_container);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ListItem = (function(_Block) {
- _inherits(ListItem2, _Block);
- function ListItem2() {
- _classCallCheck(this, ListItem2);
- return _possibleConstructorReturn(this, (ListItem2.__proto__ || Object.getPrototypeOf(ListItem2)).apply(this, arguments));
- }
- _createClass(ListItem2, [{
- key: "format",
- value: function format(name, value) {
- if (name === List.blotName && !value) {
- this.replaceWith(_parchment2.default.create(this.statics.scope));
- } else {
- _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "format", this).call(this, name, value);
- }
- }
- }, {
- key: "remove",
- value: function remove() {
- if (this.prev == null && this.next == null) {
- this.parent.remove();
- } else {
- _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "remove", this).call(this);
- }
- }
- }, {
- key: "replaceWith",
- value: function replaceWith(name, value) {
- this.parent.isolate(this.offset(this.parent), this.length());
- if (name === this.parent.statics.blotName) {
- this.parent.replaceWith(name, value);
- return this;
- } else {
- this.parent.unwrap();
- return _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "replaceWith", this).call(this, name, value);
- }
- }
- }], [{
- key: "formats",
- value: function formats(domNode) {
- return domNode.tagName === this.tagName ? void 0 : _get(ListItem2.__proto__ || Object.getPrototypeOf(ListItem2), "formats", this).call(this, domNode);
- }
- }]);
- return ListItem2;
- })(_block2.default);
- ListItem.blotName = "list-item";
- ListItem.tagName = "LI";
- var List = (function(_Container) {
- _inherits(List2, _Container);
- _createClass(List2, null, [{
- key: "create",
- value: function create(value) {
- var tagName = value === "ordered" ? "OL" : "UL";
- var node = _get(List2.__proto__ || Object.getPrototypeOf(List2), "create", this).call(this, tagName);
- if (value === "checked" || value === "unchecked") {
- node.setAttribute("data-checked", value === "checked");
- }
- return node;
- }
- }, {
- key: "formats",
- value: function formats(domNode) {
- if (domNode.tagName === "OL") return "ordered";
- if (domNode.tagName === "UL") {
- if (domNode.hasAttribute("data-checked")) {
- return domNode.getAttribute("data-checked") === "true" ? "checked" : "unchecked";
- } else {
- return "bullet";
- }
- }
- return void 0;
- }
- }]);
- function List2(domNode) {
- _classCallCheck(this, List2);
- var _this2 = _possibleConstructorReturn(this, (List2.__proto__ || Object.getPrototypeOf(List2)).call(this, domNode));
- var listEventHandler = function listEventHandler2(e) {
- if (e.target.parentNode !== domNode) return;
- var format = _this2.statics.formats(domNode);
- var blot = _parchment2.default.find(e.target);
- if (format === "checked") {
- blot.format("list", "unchecked");
- } else if (format === "unchecked") {
- blot.format("list", "checked");
- }
- };
- domNode.addEventListener("touchstart", listEventHandler);
- domNode.addEventListener("mousedown", listEventHandler);
- return _this2;
- }
- _createClass(List2, [{
- key: "format",
- value: function format(name, value) {
- if (this.children.length > 0) {
- this.children.tail.format(name, value);
- }
- }
- }, {
- key: "formats",
- value: function formats() {
- return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));
- }
- }, {
- key: "insertBefore",
- value: function insertBefore(blot, ref2) {
- if (blot instanceof ListItem) {
- _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "insertBefore", this).call(this, blot, ref2);
- } else {
- var index = ref2 == null ? this.length() : ref2.offset(this);
- var after = this.split(index);
- after.parent.insertBefore(blot, after);
- }
- }
- }, {
- key: "optimize",
- value: function optimize(context) {
- _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "optimize", this).call(this, context);
- var next = this.next;
- if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute("data-checked") === this.domNode.getAttribute("data-checked")) {
- next.moveChildren(this);
- next.remove();
- }
- }
- }, {
- key: "replace",
- value: function replace(target) {
- if (target.statics.blotName !== this.statics.blotName) {
- var item = _parchment2.default.create(this.statics.defaultChild);
- target.moveChildren(item);
- this.appendChild(item);
- }
- _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "replace", this).call(this, target);
- }
- }]);
- return List2;
- })(_container2.default);
- List.blotName = "list";
- List.scope = _parchment2.default.Scope.BLOCK_BLOT;
- List.tagName = ["OL", "UL"];
- List.defaultChild = "list-item";
- List.allowedChildren = [ListItem];
- exports2.ListItem = ListItem;
- exports2.default = List;
- }),
- /* 68 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _bold = __webpack_require__(56);
- var _bold2 = _interopRequireDefault(_bold);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Italic = (function(_Bold) {
- _inherits(Italic2, _Bold);
- function Italic2() {
- _classCallCheck(this, Italic2);
- return _possibleConstructorReturn(this, (Italic2.__proto__ || Object.getPrototypeOf(Italic2)).apply(this, arguments));
- }
- return Italic2;
- })(_bold2.default);
- Italic.blotName = "italic";
- Italic.tagName = ["EM", "I"];
- exports2.default = Italic;
- }),
- /* 69 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Script = (function(_Inline) {
- _inherits(Script2, _Inline);
- function Script2() {
- _classCallCheck(this, Script2);
- return _possibleConstructorReturn(this, (Script2.__proto__ || Object.getPrototypeOf(Script2)).apply(this, arguments));
- }
- _createClass(Script2, null, [{
- key: "create",
- value: function create(value) {
- if (value === "super") {
- return document.createElement("sup");
- } else if (value === "sub") {
- return document.createElement("sub");
- } else {
- return _get(Script2.__proto__ || Object.getPrototypeOf(Script2), "create", this).call(this, value);
- }
- }
- }, {
- key: "formats",
- value: function formats(domNode) {
- if (domNode.tagName === "SUB") return "sub";
- if (domNode.tagName === "SUP") return "super";
- return void 0;
- }
- }]);
- return Script2;
- })(_inline2.default);
- Script.blotName = "script";
- Script.tagName = ["SUB", "SUP"];
- exports2.default = Script;
- }),
- /* 70 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Strike = (function(_Inline) {
- _inherits(Strike2, _Inline);
- function Strike2() {
- _classCallCheck(this, Strike2);
- return _possibleConstructorReturn(this, (Strike2.__proto__ || Object.getPrototypeOf(Strike2)).apply(this, arguments));
- }
- return Strike2;
- })(_inline2.default);
- Strike.blotName = "strike";
- Strike.tagName = "S";
- exports2.default = Strike;
- }),
- /* 71 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _inline = __webpack_require__(6);
- var _inline2 = _interopRequireDefault(_inline);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var Underline = (function(_Inline) {
- _inherits(Underline2, _Inline);
- function Underline2() {
- _classCallCheck(this, Underline2);
- return _possibleConstructorReturn(this, (Underline2.__proto__ || Object.getPrototypeOf(Underline2)).apply(this, arguments));
- }
- return Underline2;
- })(_inline2.default);
- Underline.blotName = "underline";
- Underline.tagName = "U";
- exports2.default = Underline;
- }),
- /* 72 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _link = __webpack_require__(27);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ATTRIBUTES = ["alt", "height", "width"];
- var Image = (function(_Parchment$Embed) {
- _inherits(Image2, _Parchment$Embed);
- function Image2() {
- _classCallCheck(this, Image2);
- return _possibleConstructorReturn(this, (Image2.__proto__ || Object.getPrototypeOf(Image2)).apply(this, arguments));
- }
- _createClass(Image2, [{
- key: "format",
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Image2.prototype.__proto__ || Object.getPrototypeOf(Image2.prototype), "format", this).call(this, name, value);
- }
- }
- }], [{
- key: "create",
- value: function create(value) {
- var node = _get(Image2.__proto__ || Object.getPrototypeOf(Image2), "create", this).call(this, value);
- if (typeof value === "string") {
- node.setAttribute("src", this.sanitize(value));
- }
- return node;
- }
- }, {
- key: "formats",
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function(formats2, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats2[attribute] = domNode.getAttribute(attribute);
- }
- return formats2;
- }, {});
- }
- }, {
- key: "match",
- value: function match(url) {
- return /\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url);
- }
- }, {
- key: "sanitize",
- value: function sanitize(url) {
- return (0, _link.sanitize)(url, ["http", "https", "data"]) ? url : "//:0";
- }
- }, {
- key: "value",
- value: function value(domNode) {
- return domNode.getAttribute("src");
- }
- }]);
- return Image2;
- })(_parchment2.default.Embed);
- Image.blotName = "image";
- Image.tagName = "IMG";
- exports2.default = Image;
- }),
- /* 73 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _block = __webpack_require__(4);
- var _link = __webpack_require__(27);
- var _link2 = _interopRequireDefault(_link);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var ATTRIBUTES = ["height", "width"];
- var Video = (function(_BlockEmbed) {
- _inherits(Video2, _BlockEmbed);
- function Video2() {
- _classCallCheck(this, Video2);
- return _possibleConstructorReturn(this, (Video2.__proto__ || Object.getPrototypeOf(Video2)).apply(this, arguments));
- }
- _createClass(Video2, [{
- key: "format",
- value: function format(name, value) {
- if (ATTRIBUTES.indexOf(name) > -1) {
- if (value) {
- this.domNode.setAttribute(name, value);
- } else {
- this.domNode.removeAttribute(name);
- }
- } else {
- _get(Video2.prototype.__proto__ || Object.getPrototypeOf(Video2.prototype), "format", this).call(this, name, value);
- }
- }
- }], [{
- key: "create",
- value: function create(value) {
- var node = _get(Video2.__proto__ || Object.getPrototypeOf(Video2), "create", this).call(this, value);
- node.setAttribute("frameborder", "0");
- node.setAttribute("allowfullscreen", true);
- node.setAttribute("src", this.sanitize(value));
- return node;
- }
- }, {
- key: "formats",
- value: function formats(domNode) {
- return ATTRIBUTES.reduce(function(formats2, attribute) {
- if (domNode.hasAttribute(attribute)) {
- formats2[attribute] = domNode.getAttribute(attribute);
- }
- return formats2;
- }, {});
- }
- }, {
- key: "sanitize",
- value: function sanitize(url) {
- return _link2.default.sanitize(url);
- }
- }, {
- key: "value",
- value: function value(domNode) {
- return domNode.getAttribute("src");
- }
- }]);
- return Video2;
- })(_block.BlockEmbed);
- Video.blotName = "video";
- Video.className = "ql-video";
- Video.tagName = "IFRAME";
- exports2.default = Video;
- }),
- /* 74 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.FormulaBlot = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _embed = __webpack_require__(35);
- var _embed2 = _interopRequireDefault(_embed);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var FormulaBlot = (function(_Embed) {
- _inherits(FormulaBlot2, _Embed);
- function FormulaBlot2() {
- _classCallCheck(this, FormulaBlot2);
- return _possibleConstructorReturn(this, (FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2)).apply(this, arguments));
- }
- _createClass(FormulaBlot2, null, [{
- key: "create",
- value: function create(value) {
- var node = _get(FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2), "create", this).call(this, value);
- if (typeof value === "string") {
- window.katex.render(value, node, {
- throwOnError: false,
- errorColor: "#f00"
- });
- node.setAttribute("data-value", value);
- }
- return node;
- }
- }, {
- key: "value",
- value: function value(domNode) {
- return domNode.getAttribute("data-value");
- }
- }]);
- return FormulaBlot2;
- })(_embed2.default);
- FormulaBlot.blotName = "formula";
- FormulaBlot.className = "ql-formula";
- FormulaBlot.tagName = "SPAN";
- var Formula = (function(_Module) {
- _inherits(Formula2, _Module);
- _createClass(Formula2, null, [{
- key: "register",
- value: function register() {
- _quill2.default.register(FormulaBlot, true);
- }
- }]);
- function Formula2() {
- _classCallCheck(this, Formula2);
- var _this2 = _possibleConstructorReturn(this, (Formula2.__proto__ || Object.getPrototypeOf(Formula2)).call(this));
- if (window.katex == null) {
- throw new Error("Formula module requires KaTeX.");
- }
- return _this2;
- }
- return Formula2;
- })(_module2.default);
- exports2.FormulaBlot = FormulaBlot;
- exports2.default = Formula;
- }),
- /* 75 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.CodeToken = exports2.CodeBlock = void 0;
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _parchment = __webpack_require__(0);
- var _parchment2 = _interopRequireDefault(_parchment);
- var _quill = __webpack_require__(5);
- var _quill2 = _interopRequireDefault(_quill);
- var _module = __webpack_require__(9);
- var _module2 = _interopRequireDefault(_module);
- var _code = __webpack_require__(13);
- var _code2 = _interopRequireDefault(_code);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var SyntaxCodeBlock = (function(_CodeBlock) {
- _inherits(SyntaxCodeBlock2, _CodeBlock);
- function SyntaxCodeBlock2() {
- _classCallCheck(this, SyntaxCodeBlock2);
- return _possibleConstructorReturn(this, (SyntaxCodeBlock2.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2)).apply(this, arguments));
- }
- _createClass(SyntaxCodeBlock2, [{
- key: "replaceWith",
- value: function replaceWith(block) {
- this.domNode.textContent = this.domNode.textContent;
- this.attach();
- _get(SyntaxCodeBlock2.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2.prototype), "replaceWith", this).call(this, block);
- }
- }, {
- key: "highlight",
- value: function highlight(_highlight) {
- var text = this.domNode.textContent;
- if (this.cachedText !== text) {
- if (text.trim().length > 0 || this.cachedText == null) {
- this.domNode.innerHTML = _highlight(text);
- this.domNode.normalize();
- this.attach();
- }
- this.cachedText = text;
- }
- }
- }]);
- return SyntaxCodeBlock2;
- })(_code2.default);
- SyntaxCodeBlock.className = "ql-syntax";
- var CodeToken = new _parchment2.default.Attributor.Class("token", "hljs", {
- scope: _parchment2.default.Scope.INLINE
- });
- var Syntax = (function(_Module) {
- _inherits(Syntax2, _Module);
- _createClass(Syntax2, null, [{
- key: "register",
- value: function register() {
- _quill2.default.register(CodeToken, true);
- _quill2.default.register(SyntaxCodeBlock, true);
- }
- }]);
- function Syntax2(quill, options) {
- _classCallCheck(this, Syntax2);
- var _this2 = _possibleConstructorReturn(this, (Syntax2.__proto__ || Object.getPrototypeOf(Syntax2)).call(this, quill, options));
- if (typeof _this2.options.highlight !== "function") {
- throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");
- }
- var timer = null;
- _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
- clearTimeout(timer);
- timer = setTimeout(function() {
- _this2.highlight();
- timer = null;
- }, _this2.options.interval);
- });
- _this2.highlight();
- return _this2;
- }
- _createClass(Syntax2, [{
- key: "highlight",
- value: function highlight() {
- var _this3 = this;
- if (this.quill.selection.composing) return;
- this.quill.update(_quill2.default.sources.USER);
- var range = this.quill.getSelection();
- this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function(code) {
- code.highlight(_this3.options.highlight);
- });
- this.quill.update(_quill2.default.sources.SILENT);
- if (range != null) {
- this.quill.setSelection(range, _quill2.default.sources.SILENT);
- }
- }
- }]);
- return Syntax2;
- })(_module2.default);
- Syntax.DEFAULTS = {
- highlight: (function() {
- if (window.hljs == null) return null;
- return function(text) {
- var result = window.hljs.highlightAuto(text);
- return result.value;
- };
- })(),
- interval: 1e3
- };
- exports2.CodeBlock = SyntaxCodeBlock;
- exports2.CodeToken = CodeToken;
- exports2.default = Syntax;
- }),
- /* 76 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>';
- }),
- /* 77 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>';
- }),
- /* 78 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>';
- }),
- /* 79 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>';
- }),
- /* 80 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>';
- }),
- /* 81 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>';
- }),
- /* 82 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>';
- }),
- /* 83 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>';
- }),
- /* 84 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>';
- }),
- /* 85 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>';
- }),
- /* 86 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>';
- }),
- /* 87 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>';
- }),
- /* 88 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>';
- }),
- /* 89 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>';
- }),
- /* 90 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>';
- }),
- /* 91 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>';
- }),
- /* 92 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>';
- }),
- /* 93 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>';
- }),
- /* 94 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>';
- }),
- /* 95 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>';
- }),
- /* 96 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>';
- }),
- /* 97 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>';
- }),
- /* 98 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>';
- }),
- /* 99 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>';
- }),
- /* 100 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>';
- }),
- /* 101 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>';
- }),
- /* 102 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>';
- }),
- /* 103 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>';
- }),
- /* 104 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>';
- }),
- /* 105 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>';
- }),
- /* 106 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>';
- }),
- /* 107 */
- /***/
- (function(module2, exports2) {
- module2.exports = '<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>';
- }),
- /* 108 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- exports2.default = exports2.BubbleTooltip = void 0;
- var _get = function get(object, property, receiver) {
- if (object === null) object = Function.prototype;
- var desc = Object.getOwnPropertyDescriptor(object, property);
- if (desc === void 0) {
- var parent = Object.getPrototypeOf(object);
- if (parent === null) {
- return void 0;
- } else {
- return get(parent, property, receiver);
- }
- } else if ("value" in desc) {
- return desc.value;
- } else {
- var getter = desc.get;
- if (getter === void 0) {
- return void 0;
- }
- return getter.call(receiver);
- }
- };
- var _createClass = /* @__PURE__ */ (function() {
- 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);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- })();
- var _extend = __webpack_require__(3);
- var _extend2 = _interopRequireDefault(_extend);
- var _emitter = __webpack_require__(8);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _base = __webpack_require__(43);
- var _base2 = _interopRequireDefault(_base);
- var _selection = __webpack_require__(15);
- var _icons = __webpack_require__(41);
- var _icons2 = _interopRequireDefault(_icons);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _possibleConstructorReturn(self2, call) {
- if (!self2) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return call && (typeof call === "object" || typeof call === "function") ? call : self2;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
- }
- var TOOLBAR_CONFIG = [["bold", "italic", "link"], [{ header: 1 }, { header: 2 }, "blockquote"]];
- var BubbleTheme = (function(_BaseTheme) {
- _inherits(BubbleTheme2, _BaseTheme);
- function BubbleTheme2(quill, options) {
- _classCallCheck(this, BubbleTheme2);
- if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
- options.modules.toolbar.container = TOOLBAR_CONFIG;
- }
- var _this = _possibleConstructorReturn(this, (BubbleTheme2.__proto__ || Object.getPrototypeOf(BubbleTheme2)).call(this, quill, options));
- _this.quill.container.classList.add("ql-bubble");
- return _this;
- }
- _createClass(BubbleTheme2, [{
- key: "extendToolbar",
- value: function extendToolbar(toolbar) {
- this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
- this.tooltip.root.appendChild(toolbar.container);
- this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
- this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
- }
- }]);
- return BubbleTheme2;
- })(_base2.default);
- BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
- modules: {
- toolbar: {
- handlers: {
- link: function link(value) {
- if (!value) {
- this.quill.format("link", false);
- } else {
- this.quill.theme.tooltip.edit();
- }
- }
- }
- }
- }
- });
- var BubbleTooltip = (function(_BaseTooltip) {
- _inherits(BubbleTooltip2, _BaseTooltip);
- function BubbleTooltip2(quill, bounds) {
- _classCallCheck(this, BubbleTooltip2);
- var _this2 = _possibleConstructorReturn(this, (BubbleTooltip2.__proto__ || Object.getPrototypeOf(BubbleTooltip2)).call(this, quill, bounds));
- _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function(type, range, oldRange, source) {
- if (type !== _emitter2.default.events.SELECTION_CHANGE) return;
- if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
- _this2.show();
- _this2.root.style.left = "0px";
- _this2.root.style.width = "";
- _this2.root.style.width = _this2.root.offsetWidth + "px";
- var lines = _this2.quill.getLines(range.index, range.length);
- if (lines.length === 1) {
- _this2.position(_this2.quill.getBounds(range));
- } else {
- var lastLine = lines[lines.length - 1];
- var index = _this2.quill.getIndex(lastLine);
- var length = Math.min(lastLine.length() - 1, range.index + range.length - index);
- var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));
- _this2.position(_bounds);
- }
- } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
- _this2.hide();
- }
- });
- return _this2;
- }
- _createClass(BubbleTooltip2, [{
- key: "listen",
- value: function listen() {
- var _this3 = this;
- _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "listen", this).call(this);
- this.root.querySelector(".ql-close").addEventListener("click", function() {
- _this3.root.classList.remove("ql-editing");
- });
- this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function() {
- setTimeout(function() {
- if (_this3.root.classList.contains("ql-hidden")) return;
- var range = _this3.quill.getSelection();
- if (range != null) {
- _this3.position(_this3.quill.getBounds(range));
- }
- }, 1);
- });
- }
- }, {
- key: "cancel",
- value: function cancel() {
- this.show();
- }
- }, {
- key: "position",
- value: function position(reference) {
- var shift = _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "position", this).call(this, reference);
- var arrow = this.root.querySelector(".ql-tooltip-arrow");
- arrow.style.marginLeft = "";
- if (shift === 0) return shift;
- arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + "px";
- }
- }]);
- return BubbleTooltip2;
- })(_base.BaseTooltip);
- BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join("");
- exports2.BubbleTooltip = BubbleTooltip;
- exports2.default = BubbleTheme;
- }),
- /* 109 */
- /***/
- (function(module2, exports2, __webpack_require__) {
- module2.exports = __webpack_require__(63);
- })
- /******/
- ])["default"]
- );
- });
- }
- });
- // node_modules/fast-diff/diff.js
- var require_diff = __commonJS({
- "node_modules/fast-diff/diff.js"(exports, module) {
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
- function diff_main(text1, text2, cursor_pos, _fix_unicode) {
- if (text1 === text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
- if (cursor_pos != null) {
- var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
- if (editdiff) {
- return editdiff;
- }
- }
- var commonlength = diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength);
- commonlength = diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength);
- var diffs = diff_compute_(text1, text2);
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- diff_cleanupMerge(diffs, _fix_unicode);
- return diffs;
- }
- function diff_compute_(text1, text2) {
- var diffs;
- if (!text1) {
- return [[DIFF_INSERT, text2]];
- }
- if (!text2) {
- return [[DIFF_DELETE, text1]];
- }
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i !== -1) {
- diffs = [
- [DIFF_INSERT, longtext.substring(0, i)],
- [DIFF_EQUAL, shorttext],
- [DIFF_INSERT, longtext.substring(i + shorttext.length)]
- ];
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
- if (shorttext.length === 1) {
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- var hm = diff_halfMatch_(text1, text2);
- if (hm) {
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4];
- var diffs_a = diff_main(text1_a, text2_a);
- var diffs_b = diff_main(text1_b, text2_b);
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
- return diff_bisect_(text1, text2);
- }
- function diff_bisect_(text1, text2) {
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length);
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length;
- var front = delta % 2 !== 0;
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1;
- if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- k1end += 2;
- } else if (y1 > text2_length) {
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var k2_offset = v_offset + k2;
- var x2;
- if (k2 === -d || k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
- x2 = v2[k2_offset + 1];
- } else {
- x2 = v2[k2_offset - 1] + 1;
- }
- var y2 = x2 - k2;
- while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)) {
- x2++;
- y2++;
- }
- v2[k2_offset] = x2;
- if (x2 > text1_length) {
- k2end += 2;
- } else if (y2 > text2_length) {
- k2start += 2;
- } else if (!front) {
- var k1_offset = v_offset + delta - k2;
- if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {
- var x1 = v1[k1_offset];
- var y1 = v_offset + x1 - k1_offset;
- x2 = text1_length - x2;
- if (x1 >= x2) {
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- }
- }
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- function diff_bisectSplit_(text1, text2, x, y) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y);
- var diffs = diff_main(text1a, text2a);
- var diffsb = diff_main(text1b, text2b);
- return diffs.concat(diffsb);
- }
- function diff_commonPrefix(text1, text2) {
- if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
- return 0;
- }
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
- pointermid--;
- }
- return pointermid;
- }
- function diff_commonSuffix(text1, text2) {
- if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
- return 0;
- }
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
- pointermid--;
- }
- return pointermid;
- }
- function diff_halfMatch_(text1, text2) {
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null;
- }
- function diff_halfMatchI_(longtext2, shorttext2, i) {
- var seed = longtext2.substring(i, i + Math.floor(longtext2.length / 4));
- var j = -1;
- var best_common = "";
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext2.indexOf(seed, j + 1)) !== -1) {
- var prefixLength = diff_commonPrefix(
- longtext2.substring(i),
- shorttext2.substring(j)
- );
- var suffixLength = diff_commonSuffix(
- longtext2.substring(0, i),
- shorttext2.substring(0, j)
- );
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext2.substring(
- j - suffixLength,
- j
- ) + shorttext2.substring(j, j + prefixLength);
- best_longtext_a = longtext2.substring(0, i - suffixLength);
- best_longtext_b = longtext2.substring(i + prefixLength);
- best_shorttext_a = shorttext2.substring(0, j - suffixLength);
- best_shorttext_b = shorttext2.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext2.length) {
- return [
- best_longtext_a,
- best_longtext_b,
- best_shorttext_a,
- best_shorttext_b,
- best_common
- ];
- } else {
- return null;
- }
- }
- var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));
- var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- }
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- }
- function diff_cleanupMerge(diffs, fix_unicode) {
- diffs.push([DIFF_EQUAL, ""]);
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = "";
- var text_insert = "";
- var commonlength;
- while (pointer < diffs.length) {
- if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
- diffs.splice(pointer, 1);
- continue;
- }
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- var previous_equality = pointer - count_insert - count_delete - 1;
- if (fix_unicode) {
- if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
- var stray = diffs[previous_equality][1].slice(-1);
- diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
- text_delete = stray + text_delete;
- text_insert = stray + text_insert;
- if (!diffs[previous_equality][1]) {
- diffs.splice(previous_equality, 1);
- pointer--;
- var k = previous_equality - 1;
- if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
- count_insert++;
- text_insert = diffs[k][1] + text_insert;
- k--;
- }
- if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
- count_delete++;
- text_delete = diffs[k][1] + text_delete;
- k--;
- }
- previous_equality = k;
- }
- }
- if (starts_with_pair_end(diffs[pointer][1])) {
- var stray = diffs[pointer][1].charAt(0);
- diffs[pointer][1] = diffs[pointer][1].slice(1);
- text_delete += stray;
- text_insert += stray;
- }
- }
- if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
- diffs.splice(pointer, 1);
- break;
- }
- if (text_delete.length > 0 || text_insert.length > 0) {
- if (text_delete.length > 0 && text_insert.length > 0) {
- commonlength = diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if (previous_equality >= 0) {
- diffs[previous_equality][1] += text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- }
- commonlength = diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length - commonlength);
- text_delete = text_delete.substring(0, text_delete.length - commonlength);
- }
- }
- var n = count_insert + count_delete;
- if (text_delete.length === 0 && text_insert.length === 0) {
- diffs.splice(pointer - n, n);
- pointer = pointer - n;
- } else if (text_delete.length === 0) {
- diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
- pointer = pointer - n + 1;
- } else if (text_insert.length === 0) {
- diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
- pointer = pointer - n + 1;
- } else {
- diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
- pointer = pointer - n + 2;
- }
- }
- if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = "";
- text_insert = "";
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === "") {
- diffs.pop();
- }
- var changes = false;
- pointer = 1;
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
- if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
- diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- }
- if (changes) {
- diff_cleanupMerge(diffs, fix_unicode);
- }
- }
- function is_surrogate_pair_start(charCode) {
- return charCode >= 55296 && charCode <= 56319;
- }
- function is_surrogate_pair_end(charCode) {
- return charCode >= 56320 && charCode <= 57343;
- }
- function starts_with_pair_end(str) {
- return is_surrogate_pair_end(str.charCodeAt(0));
- }
- function ends_with_pair_start(str) {
- return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
- }
- function remove_empty_tuples(tuples) {
- var ret = [];
- for (var i = 0; i < tuples.length; i++) {
- if (tuples[i][1].length > 0) {
- ret.push(tuples[i]);
- }
- }
- return ret;
- }
- function make_edit_splice(before, oldMiddle, newMiddle, after) {
- if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
- return null;
- }
- return remove_empty_tuples([
- [DIFF_EQUAL, before],
- [DIFF_DELETE, oldMiddle],
- [DIFF_INSERT, newMiddle],
- [DIFF_EQUAL, after]
- ]);
- }
- function find_cursor_edit_diff(oldText, newText, cursor_pos) {
- var oldRange = typeof cursor_pos === "number" ? { index: cursor_pos, length: 0 } : cursor_pos.oldRange;
- var newRange = typeof cursor_pos === "number" ? null : cursor_pos.newRange;
- var oldLength = oldText.length;
- var newLength = newText.length;
- if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
- var oldCursor = oldRange.index;
- var oldBefore = oldText.slice(0, oldCursor);
- var oldAfter = oldText.slice(oldCursor);
- var maybeNewCursor = newRange ? newRange.index : null;
- editBefore: {
- var newCursor = oldCursor + newLength - oldLength;
- if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
- break editBefore;
- }
- if (newCursor < 0 || newCursor > newLength) {
- break editBefore;
- }
- var newBefore = newText.slice(0, newCursor);
- var newAfter = newText.slice(newCursor);
- if (newAfter !== oldAfter) {
- break editBefore;
- }
- var prefixLength = Math.min(oldCursor, newCursor);
- var oldPrefix = oldBefore.slice(0, prefixLength);
- var newPrefix = newBefore.slice(0, prefixLength);
- if (oldPrefix !== newPrefix) {
- break editBefore;
- }
- var oldMiddle = oldBefore.slice(prefixLength);
- var newMiddle = newBefore.slice(prefixLength);
- return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
- }
- editAfter: {
- if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
- break editAfter;
- }
- var cursor = oldCursor;
- var newBefore = newText.slice(0, cursor);
- var newAfter = newText.slice(cursor);
- if (newBefore !== oldBefore) {
- break editAfter;
- }
- var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
- var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
- var newSuffix = newAfter.slice(newAfter.length - suffixLength);
- if (oldSuffix !== newSuffix) {
- break editAfter;
- }
- var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
- var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);
- return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);
- }
- }
- if (oldRange.length > 0 && newRange && newRange.length === 0) {
- replaceRange: {
- var oldPrefix = oldText.slice(0, oldRange.index);
- var oldSuffix = oldText.slice(oldRange.index + oldRange.length);
- var prefixLength = oldPrefix.length;
- var suffixLength = oldSuffix.length;
- if (newLength < prefixLength + suffixLength) {
- break replaceRange;
- }
- var newPrefix = newText.slice(0, prefixLength);
- var newSuffix = newText.slice(newLength - suffixLength);
- if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {
- break replaceRange;
- }
- var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);
- var newMiddle = newText.slice(prefixLength, newLength - suffixLength);
- return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);
- }
- }
- return null;
- }
- function diff(text1, text2, cursor_pos) {
- return diff_main(text1, text2, cursor_pos, true);
- }
- diff.INSERT = DIFF_INSERT;
- diff.DELETE = DIFF_DELETE;
- diff.EQUAL = DIFF_EQUAL;
- module.exports = diff;
- }
- });
- // node_modules/lodash.clonedeep/index.js
- var require_lodash = __commonJS({
- "node_modules/lodash.clonedeep/index.js"(exports, module) {
- var LARGE_ARRAY_SIZE = 200;
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var MAX_SAFE_INTEGER = 9007199254740991;
- var argsTag = "[object Arguments]";
- var arrayTag = "[object Array]";
- var boolTag = "[object Boolean]";
- var dateTag = "[object Date]";
- var errorTag = "[object Error]";
- var funcTag = "[object Function]";
- var genTag = "[object GeneratorFunction]";
- var mapTag = "[object Map]";
- var numberTag = "[object Number]";
- var objectTag = "[object Object]";
- var promiseTag = "[object Promise]";
- var regexpTag = "[object RegExp]";
- var setTag = "[object Set]";
- var stringTag = "[object String]";
- var symbolTag = "[object Symbol]";
- var weakMapTag = "[object WeakMap]";
- var arrayBufferTag = "[object ArrayBuffer]";
- var dataViewTag = "[object DataView]";
- var float32Tag = "[object Float32Array]";
- var float64Tag = "[object Float64Array]";
- var int8Tag = "[object Int8Array]";
- var int16Tag = "[object Int16Array]";
- var int32Tag = "[object Int32Array]";
- var uint8Tag = "[object Uint8Array]";
- var uint8ClampedTag = "[object Uint8ClampedArray]";
- var uint16Tag = "[object Uint16Array]";
- var uint32Tag = "[object Uint32Array]";
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- var reFlags = /\w*$/;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- function addMapEntry(map, pair) {
- map.set(pair[0], pair[1]);
- return map;
- }
- function addSetEntry(set, value) {
- set.add(value);
- return set;
- }
- function arrayEach(array, iteratee) {
- var index = -1, length = array ? array.length : 0;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayPush(array, values) {
- var index = -1, length = values.length, offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1, length = array ? array.length : 0;
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
- function baseTimes(n, iteratee) {
- var index = -1, result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- function getValue(object, key) {
- return object == null ? void 0 : object[key];
- }
- function isHostObject(value) {
- var result = false;
- if (value != null && typeof value.toString != "function") {
- try {
- result = !!(value + "");
- } catch (e) {
- }
- }
- return result;
- }
- function mapToArray(map) {
- var index = -1, result = Array(map.size);
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function setToArray(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
- var arrayProto = Array.prototype;
- var funcProto = Function.prototype;
- var objectProto = Object.prototype;
- var coreJsData = root["__core-js_shared__"];
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- })();
- var funcToString = funcProto.toString;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var objectToString = objectProto.toString;
- var reIsNative = RegExp(
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- var Buffer2 = moduleExports ? root.Buffer : void 0;
- var Symbol2 = root.Symbol;
- var Uint8Array = root.Uint8Array;
- var getPrototype = overArg(Object.getPrototypeOf, Object);
- var objectCreate = Object.create;
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- var splice = arrayProto.splice;
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
- var nativeKeys = overArg(Object.keys, Object);
- var DataView = getNative(root, "DataView");
- var Map2 = getNative(root, "Map");
- var Promise2 = getNative(root, "Promise");
- var Set2 = getNative(root, "Set");
- var WeakMap = getNative(root, "WeakMap");
- var nativeCreate = getNative(Object, "create");
- var dataViewCtorString = toSource(DataView);
- var mapCtorString = toSource(Map2);
- var promiseCtorString = toSource(Promise2);
- var setCtorString = toSource(Set2);
- var weakMapCtorString = toSource(WeakMap);
- var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
- var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
- function Hash(entries) {
- var index = -1, length = entries ? entries.length : 0;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- }
- function hashDelete(key) {
- return this.has(key) && delete this.__data__[key];
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? void 0 : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index = -1, length = entries ? entries.length : 0;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- }
- function listCacheDelete(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- return index < 0 ? void 0 : data[index][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index = -1, length = entries ? entries.length : 0;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map2 || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- return getMapData(this, key)["delete"](key);
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- getMapData(this, key).set(key, value);
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function Stack(entries) {
- this.__data__ = new ListCache(entries);
- }
- function stackClear() {
- this.__data__ = new ListCache();
- }
- function stackDelete(key) {
- return this.__data__["delete"](key);
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var cache = this.__data__;
- if (cache instanceof ListCache) {
- var pairs = cache.__data__;
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- return this;
- }
- cache = this.__data__ = new MapCache(pairs);
- }
- cache.set(key, value);
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
- var length = result.length, skipIndexes = !!length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
- }
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
- object[key] = value;
- }
- }
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
- function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
- var result;
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== void 0) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
- if (isHostObject(value)) {
- return object ? value : {};
- }
- result = initCloneObject(isFunc ? {} : value);
- if (!isDeep) {
- return copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, baseClone, isDeep);
- }
- }
- stack || (stack = new Stack());
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
- if (!isArr) {
- var props = isFull ? getAllKeys(value) : keys(value);
- }
- arrayEach(props || value, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value[key2];
- }
- assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
- });
- return result;
- }
- function baseCreate(proto) {
- return isObject(proto) ? objectCreate(proto) : {};
- }
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
- function baseGetTag(value) {
- return objectToString.call(value);
- }
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != "constructor") {
- result.push(key);
- }
- }
- return result;
- }
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var result = new buffer.constructor(buffer.length);
- buffer.copy(result);
- return result;
- }
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
- }
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- function cloneMap(map, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
- return arrayReduce(array, addMapEntry, new map.constructor());
- }
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
- function cloneSet(set, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
- return arrayReduce(array, addSetEntry, new set.constructor());
- }
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- function copyArray(source, array) {
- var index = -1, length = source.length;
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- function copyObject(source, props, object, customizer) {
- object || (object = {});
- var index = -1, length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
- assignValue(object, key, newValue === void 0 ? source[key] : newValue);
- }
- return object;
- }
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : void 0;
- }
- var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
- var getTag = baseGetTag;
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
- getTag = function(value) {
- var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result;
- };
- }
- function initCloneArray(array) {
- var length = array.length, result = array.constructor(length);
- if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
- function initCloneObject(object) {
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
- }
- function initCloneByTag(object, tag, cloneFunc, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return cloneDataView(object, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
- return cloneTypedArray(object, isDeep);
- case mapTag:
- return cloneMap(object, isDeep, cloneFunc);
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return cloneRegExp(object);
- case setTag:
- return cloneSet(object, isDeep, cloneFunc);
- case symbolTag:
- return cloneSymbol(object);
- }
- }
- function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {
- }
- try {
- return func + "";
- } catch (e) {
- }
- }
- return "";
- }
- function cloneDeep(value) {
- return baseClone(value, true, true);
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- function isArguments(value) {
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
- }
- var isArray = Array.isArray;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- var isBuffer = nativeIsBuffer || stubFalse;
- function isFunction(value) {
- var tag = isObject(value) ? objectToString.call(value) : "";
- return tag == funcTag || tag == genTag;
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject(value) {
- var type = typeof value;
- return !!value && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return !!value && typeof value == "object";
- }
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- module.exports = cloneDeep;
- }
- });
- // node_modules/lodash.isequal/index.js
- var require_lodash2 = __commonJS({
- "node_modules/lodash.isequal/index.js"(exports, module) {
- var LARGE_ARRAY_SIZE = 200;
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var COMPARE_PARTIAL_FLAG = 1;
- var COMPARE_UNORDERED_FLAG = 2;
- var MAX_SAFE_INTEGER = 9007199254740991;
- var argsTag = "[object Arguments]";
- var arrayTag = "[object Array]";
- var asyncTag = "[object AsyncFunction]";
- var boolTag = "[object Boolean]";
- var dateTag = "[object Date]";
- var errorTag = "[object Error]";
- var funcTag = "[object Function]";
- var genTag = "[object GeneratorFunction]";
- var mapTag = "[object Map]";
- var numberTag = "[object Number]";
- var nullTag = "[object Null]";
- var objectTag = "[object Object]";
- var promiseTag = "[object Promise]";
- var proxyTag = "[object Proxy]";
- var regexpTag = "[object RegExp]";
- var setTag = "[object Set]";
- var stringTag = "[object String]";
- var symbolTag = "[object Symbol]";
- var undefinedTag = "[object Undefined]";
- var weakMapTag = "[object WeakMap]";
- var arrayBufferTag = "[object ArrayBuffer]";
- var dataViewTag = "[object DataView]";
- var float32Tag = "[object Float32Array]";
- var float64Tag = "[object Float64Array]";
- var int8Tag = "[object Int8Array]";
- var int16Tag = "[object Int16Array]";
- var int32Tag = "[object Int32Array]";
- var uint8Tag = "[object Uint8Array]";
- var uint8ClampedTag = "[object Uint8ClampedArray]";
- var uint16Tag = "[object Uint16Array]";
- var uint32Tag = "[object Uint32Array]";
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && freeGlobal.process;
- var nodeUtil = (function() {
- try {
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e) {
- }
- })();
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
- function arrayFilter(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- function arrayPush(array, values) {
- var index = -1, length = values.length, offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- function arraySome(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
- function baseTimes(n, iteratee) {
- var index = -1, result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- function getValue(object, key) {
- return object == null ? void 0 : object[key];
- }
- function mapToArray(map) {
- var index = -1, result = Array(map.size);
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function setToArray(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
- var arrayProto = Array.prototype;
- var funcProto = Function.prototype;
- var objectProto = Object.prototype;
- var coreJsData = root["__core-js_shared__"];
- var funcToString = funcProto.toString;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- })();
- var nativeObjectToString = objectProto.toString;
- var reIsNative = RegExp(
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- var Buffer2 = moduleExports ? root.Buffer : void 0;
- var Symbol2 = root.Symbol;
- var Uint8Array = root.Uint8Array;
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- var splice = arrayProto.splice;
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
- var nativeKeys = overArg(Object.keys, Object);
- var DataView = getNative(root, "DataView");
- var Map2 = getNative(root, "Map");
- var Promise2 = getNative(root, "Promise");
- var Set2 = getNative(root, "Set");
- var WeakMap = getNative(root, "WeakMap");
- var nativeCreate = getNative(Object, "create");
- var dataViewCtorString = toSource(DataView);
- var mapCtorString = toSource(Map2);
- var promiseCtorString = toSource(Promise2);
- var setCtorString = toSource(Set2);
- var weakMapCtorString = toSource(WeakMap);
- var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
- var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
- function Hash(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? void 0 : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- function listCacheDelete(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- return index < 0 ? void 0 : data[index][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map2 || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- var result = getMapData(this, key)["delete"](key);
- this.size -= result ? 1 : 0;
- return result;
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- var data = getMapData(this, key), size = data.size;
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function SetCache(values) {
- var index = -1, length = values == null ? 0 : values.length;
- this.__data__ = new MapCache();
- while (++index < length) {
- this.add(values[index]);
- }
- }
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- function stackClear() {
- this.__data__ = new ListCache();
- this.size = 0;
- }
- function stackDelete(key) {
- var data = this.__data__, result = data["delete"](key);
- this.size = data.size;
- return result;
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
- isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
- }
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
- function baseGetTag(value) {
- if (value == null) {
- return value === void 0 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
- }
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack());
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack());
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- function baseIsTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != "constructor") {
- result.push(key);
- }
- }
- return result;
- }
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var stacked = stack.get(array);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
- stack.set(array, other);
- stack.set(other, array);
- while (++index < arrLength) {
- var arrValue = array[index], othValue = other[index];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== void 0) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- if (seen) {
- if (!arraySome(other, function(othValue2, othIndex) {
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- result = false;
- break;
- }
- }
- stack["delete"](array);
- stack["delete"](other);
- return result;
- }
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+object, +other);
- case errorTag:
- return object.name == other.name && object.message == other.message;
- case regexpTag:
- case stringTag:
- return object == other + "";
- case mapTag:
- var convert = mapToArray;
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- stack.set(object, other);
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack["delete"](object);
- return result;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var stacked = stack.get(object);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key], othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
- }
- if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == "constructor");
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack["delete"](object);
- stack["delete"](other);
- return result;
- }
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : void 0;
- }
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
- try {
- value[symToStringTag] = void 0;
- var unmasked = true;
- } catch (e) {
- }
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- var getTag = baseGetTag;
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
- getTag = function(value) {
- var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result;
- };
- }
- function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {
- }
- try {
- return func + "";
- } catch (e) {
- }
- }
- return "";
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
- return arguments;
- })()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArray = Array.isArray;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- var isBuffer = nativeIsBuffer || stubFalse;
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- module.exports = isEqual;
- }
- });
- // node_modules/quill-delta/dist/AttributeMap.js
- var require_AttributeMap = __commonJS({
- "node_modules/quill-delta/dist/AttributeMap.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var lodash_clonedeep_1 = __importDefault(require_lodash());
- var lodash_isequal_1 = __importDefault(require_lodash2());
- var AttributeMap;
- (function(AttributeMap2) {
- function compose(a, b, keepNull) {
- if (a === void 0) {
- a = {};
- }
- if (b === void 0) {
- b = {};
- }
- if (typeof a !== "object") {
- a = {};
- }
- if (typeof b !== "object") {
- b = {};
- }
- var attributes = lodash_clonedeep_1.default(b);
- if (!keepNull) {
- attributes = Object.keys(attributes).reduce(function(copy, key2) {
- if (attributes[key2] != null) {
- copy[key2] = attributes[key2];
- }
- return copy;
- }, {});
- }
- for (var key in a) {
- if (a[key] !== void 0 && b[key] === void 0) {
- attributes[key] = a[key];
- }
- }
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- }
- AttributeMap2.compose = compose;
- function diff(a, b) {
- if (a === void 0) {
- a = {};
- }
- if (b === void 0) {
- b = {};
- }
- if (typeof a !== "object") {
- a = {};
- }
- if (typeof b !== "object") {
- b = {};
- }
- var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function(attrs, key) {
- if (!lodash_isequal_1.default(a[key], b[key])) {
- attrs[key] = b[key] === void 0 ? null : b[key];
- }
- return attrs;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- }
- AttributeMap2.diff = diff;
- function invert(attr, base) {
- if (attr === void 0) {
- attr = {};
- }
- if (base === void 0) {
- base = {};
- }
- attr = attr || {};
- var baseInverted = Object.keys(base).reduce(function(memo, key) {
- if (base[key] !== attr[key] && attr[key] !== void 0) {
- memo[key] = base[key];
- }
- return memo;
- }, {});
- return Object.keys(attr).reduce(function(memo, key) {
- if (attr[key] !== base[key] && base[key] === void 0) {
- memo[key] = null;
- }
- return memo;
- }, baseInverted);
- }
- AttributeMap2.invert = invert;
- function transform(a, b, priority) {
- if (priority === void 0) {
- priority = false;
- }
- if (typeof a !== "object") {
- return b;
- }
- if (typeof b !== "object") {
- return void 0;
- }
- if (!priority) {
- return b;
- }
- var attributes = Object.keys(b).reduce(function(attrs, key) {
- if (a[key] === void 0) {
- attrs[key] = b[key];
- }
- return attrs;
- }, {});
- return Object.keys(attributes).length > 0 ? attributes : void 0;
- }
- AttributeMap2.transform = transform;
- })(AttributeMap || (AttributeMap = {}));
- exports.default = AttributeMap;
- }
- });
- // node_modules/quill-delta/dist/Iterator.js
- var require_Iterator = __commonJS({
- "node_modules/quill-delta/dist/Iterator.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var Op_1 = __importDefault(require_Op());
- var Iterator = (
- /** @class */
- (function() {
- function Iterator2(ops) {
- this.ops = ops;
- this.index = 0;
- this.offset = 0;
- }
- Iterator2.prototype.hasNext = function() {
- return this.peekLength() < Infinity;
- };
- Iterator2.prototype.next = function(length) {
- if (!length) {
- length = Infinity;
- }
- var nextOp = this.ops[this.index];
- if (nextOp) {
- var offset = this.offset;
- var opLength = Op_1.default.length(nextOp);
- if (length >= opLength - offset) {
- length = opLength - offset;
- this.index += 1;
- this.offset = 0;
- } else {
- this.offset += length;
- }
- if (typeof nextOp.delete === "number") {
- return { delete: length };
- } else {
- var retOp = {};
- if (nextOp.attributes) {
- retOp.attributes = nextOp.attributes;
- }
- if (typeof nextOp.retain === "number") {
- retOp.retain = length;
- } else if (typeof nextOp.insert === "string") {
- retOp.insert = nextOp.insert.substr(offset, length);
- } else {
- retOp.insert = nextOp.insert;
- }
- return retOp;
- }
- } else {
- return { retain: Infinity };
- }
- };
- Iterator2.prototype.peek = function() {
- return this.ops[this.index];
- };
- Iterator2.prototype.peekLength = function() {
- if (this.ops[this.index]) {
- return Op_1.default.length(this.ops[this.index]) - this.offset;
- } else {
- return Infinity;
- }
- };
- Iterator2.prototype.peekType = function() {
- if (this.ops[this.index]) {
- if (typeof this.ops[this.index].delete === "number") {
- return "delete";
- } else if (typeof this.ops[this.index].retain === "number") {
- return "retain";
- } else {
- return "insert";
- }
- }
- return "retain";
- };
- Iterator2.prototype.rest = function() {
- if (!this.hasNext()) {
- return [];
- } else if (this.offset === 0) {
- return this.ops.slice(this.index);
- } else {
- var offset = this.offset;
- var index = this.index;
- var next = this.next();
- var rest = this.ops.slice(this.index);
- this.offset = offset;
- this.index = index;
- return [next].concat(rest);
- }
- };
- return Iterator2;
- })()
- );
- exports.default = Iterator;
- }
- });
- // node_modules/quill-delta/dist/Op.js
- var require_Op = __commonJS({
- "node_modules/quill-delta/dist/Op.js"(exports) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var Iterator_1 = __importDefault(require_Iterator());
- var Op;
- (function(Op2) {
- function iterator(ops) {
- return new Iterator_1.default(ops);
- }
- Op2.iterator = iterator;
- function length(op) {
- if (typeof op.delete === "number") {
- return op.delete;
- } else if (typeof op.retain === "number") {
- return op.retain;
- } else {
- return typeof op.insert === "string" ? op.insert.length : 1;
- }
- }
- Op2.length = length;
- })(Op || (Op = {}));
- exports.default = Op;
- }
- });
- // node_modules/quill-delta/dist/Delta.js
- var require_Delta = __commonJS({
- "node_modules/quill-delta/dist/Delta.js"(exports, module) {
- "use strict";
- var __importDefault = exports && exports.__importDefault || function(mod) {
- return mod && mod.__esModule ? mod : { "default": mod };
- };
- var fast_diff_1 = __importDefault(require_diff());
- var lodash_clonedeep_1 = __importDefault(require_lodash());
- var lodash_isequal_1 = __importDefault(require_lodash2());
- var AttributeMap_1 = __importDefault(require_AttributeMap());
- var Op_1 = __importDefault(require_Op());
- var NULL_CHARACTER = String.fromCharCode(0);
- var Delta2 = (
- /** @class */
- (function() {
- function Delta3(ops) {
- if (Array.isArray(ops)) {
- this.ops = ops;
- } else if (ops != null && Array.isArray(ops.ops)) {
- this.ops = ops.ops;
- } else {
- this.ops = [];
- }
- }
- Delta3.prototype.insert = function(arg, attributes) {
- var newOp = {};
- if (typeof arg === "string" && arg.length === 0) {
- return this;
- }
- newOp.insert = arg;
- if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
- Delta3.prototype.delete = function(length) {
- if (length <= 0) {
- return this;
- }
- return this.push({ delete: length });
- };
- Delta3.prototype.retain = function(length, attributes) {
- if (length <= 0) {
- return this;
- }
- var newOp = { retain: length };
- if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
- newOp.attributes = attributes;
- }
- return this.push(newOp);
- };
- Delta3.prototype.push = function(newOp) {
- var index = this.ops.length;
- var lastOp = this.ops[index - 1];
- newOp = lodash_clonedeep_1.default(newOp);
- if (typeof lastOp === "object") {
- if (typeof newOp.delete === "number" && typeof lastOp.delete === "number") {
- this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };
- return this;
- }
- if (typeof lastOp.delete === "number" && newOp.insert != null) {
- index -= 1;
- lastOp = this.ops[index - 1];
- if (typeof lastOp !== "object") {
- this.ops.unshift(newOp);
- return this;
- }
- }
- if (lodash_isequal_1.default(newOp.attributes, lastOp.attributes)) {
- if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
- this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
- if (typeof newOp.attributes === "object") {
- this.ops[index - 1].attributes = newOp.attributes;
- }
- return this;
- } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
- this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
- if (typeof newOp.attributes === "object") {
- this.ops[index - 1].attributes = newOp.attributes;
- }
- return this;
- }
- }
- }
- if (index === this.ops.length) {
- this.ops.push(newOp);
- } else {
- this.ops.splice(index, 0, newOp);
- }
- return this;
- };
- Delta3.prototype.chop = function() {
- var lastOp = this.ops[this.ops.length - 1];
- if (lastOp && lastOp.retain && !lastOp.attributes) {
- this.ops.pop();
- }
- return this;
- };
- Delta3.prototype.filter = function(predicate) {
- return this.ops.filter(predicate);
- };
- Delta3.prototype.forEach = function(predicate) {
- this.ops.forEach(predicate);
- };
- Delta3.prototype.map = function(predicate) {
- return this.ops.map(predicate);
- };
- Delta3.prototype.partition = function(predicate) {
- var passed = [];
- var failed = [];
- this.forEach(function(op) {
- var target = predicate(op) ? passed : failed;
- target.push(op);
- });
- return [passed, failed];
- };
- Delta3.prototype.reduce = function(predicate, initialValue) {
- return this.ops.reduce(predicate, initialValue);
- };
- Delta3.prototype.changeLength = function() {
- return this.reduce(function(length, elem) {
- if (elem.insert) {
- return length + Op_1.default.length(elem);
- } else if (elem.delete) {
- return length - elem.delete;
- }
- return length;
- }, 0);
- };
- Delta3.prototype.length = function() {
- return this.reduce(function(length, elem) {
- return length + Op_1.default.length(elem);
- }, 0);
- };
- Delta3.prototype.slice = function(start, end) {
- if (start === void 0) {
- start = 0;
- }
- if (end === void 0) {
- end = Infinity;
- }
- var ops = [];
- var iter = Op_1.default.iterator(this.ops);
- var index = 0;
- while (index < end && iter.hasNext()) {
- var nextOp = void 0;
- if (index < start) {
- nextOp = iter.next(start - index);
- } else {
- nextOp = iter.next(end - index);
- ops.push(nextOp);
- }
- index += Op_1.default.length(nextOp);
- }
- return new Delta3(ops);
- };
- Delta3.prototype.compose = function(other) {
- var thisIter = Op_1.default.iterator(this.ops);
- var otherIter = Op_1.default.iterator(other.ops);
- var ops = [];
- var firstOther = otherIter.peek();
- if (firstOther != null && typeof firstOther.retain === "number" && firstOther.attributes == null) {
- var firstLeft = firstOther.retain;
- while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) {
- firstLeft -= thisIter.peekLength();
- ops.push(thisIter.next());
- }
- if (firstOther.retain - firstLeft > 0) {
- otherIter.next(firstOther.retain - firstLeft);
- }
- }
- var delta = new Delta3(ops);
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (otherIter.peekType() === "insert") {
- delta.push(otherIter.next());
- } else if (thisIter.peekType() === "delete") {
- delta.push(thisIter.next());
- } else {
- var length_1 = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length_1);
- var otherOp = otherIter.next(length_1);
- if (typeof otherOp.retain === "number") {
- var newOp = {};
- if (typeof thisOp.retain === "number") {
- newOp.retain = length_1;
- } else {
- newOp.insert = thisOp.insert;
- }
- var attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
- if (attributes) {
- newOp.attributes = attributes;
- }
- delta.push(newOp);
- if (!otherIter.hasNext() && lodash_isequal_1.default(delta.ops[delta.ops.length - 1], newOp)) {
- var rest = new Delta3(thisIter.rest());
- return delta.concat(rest).chop();
- }
- } else if (typeof otherOp.delete === "number" && typeof thisOp.retain === "number") {
- delta.push(otherOp);
- }
- }
- }
- return delta.chop();
- };
- Delta3.prototype.concat = function(other) {
- var delta = new Delta3(this.ops.slice());
- if (other.ops.length > 0) {
- delta.push(other.ops[0]);
- delta.ops = delta.ops.concat(other.ops.slice(1));
- }
- return delta;
- };
- Delta3.prototype.diff = function(other, cursor) {
- if (this.ops === other.ops) {
- return new Delta3();
- }
- var strings = [this, other].map(function(delta) {
- return delta.map(function(op) {
- if (op.insert != null) {
- return typeof op.insert === "string" ? op.insert : NULL_CHARACTER;
- }
- var prep = delta === other ? "on" : "with";
- throw new Error("diff() called " + prep + " non-document");
- }).join("");
- });
- var retDelta = new Delta3();
- var diffResult = fast_diff_1.default(strings[0], strings[1], cursor);
- var thisIter = Op_1.default.iterator(this.ops);
- var otherIter = Op_1.default.iterator(other.ops);
- diffResult.forEach(function(component) {
- var length = component[1].length;
- while (length > 0) {
- var opLength = 0;
- switch (component[0]) {
- case fast_diff_1.default.INSERT:
- opLength = Math.min(otherIter.peekLength(), length);
- retDelta.push(otherIter.next(opLength));
- break;
- case fast_diff_1.default.DELETE:
- opLength = Math.min(length, thisIter.peekLength());
- thisIter.next(opLength);
- retDelta.delete(opLength);
- break;
- case fast_diff_1.default.EQUAL:
- opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
- var thisOp = thisIter.next(opLength);
- var otherOp = otherIter.next(opLength);
- if (lodash_isequal_1.default(thisOp.insert, otherOp.insert)) {
- retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes));
- } else {
- retDelta.push(otherOp).delete(opLength);
- }
- break;
- }
- length -= opLength;
- }
- });
- return retDelta.chop();
- };
- Delta3.prototype.eachLine = function(predicate, newline) {
- if (newline === void 0) {
- newline = "\n";
- }
- var iter = Op_1.default.iterator(this.ops);
- var line = new Delta3();
- var i = 0;
- while (iter.hasNext()) {
- if (iter.peekType() !== "insert") {
- return;
- }
- var thisOp = iter.peek();
- var start = Op_1.default.length(thisOp) - iter.peekLength();
- var index = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1;
- if (index < 0) {
- line.push(iter.next());
- } else if (index > 0) {
- line.push(iter.next(index));
- } else {
- if (predicate(line, iter.next(1).attributes || {}, i) === false) {
- return;
- }
- i += 1;
- line = new Delta3();
- }
- }
- if (line.length() > 0) {
- predicate(line, {}, i);
- }
- };
- Delta3.prototype.invert = function(base) {
- var inverted = new Delta3();
- this.reduce(function(baseIndex, op) {
- if (op.insert) {
- inverted.delete(Op_1.default.length(op));
- } else if (op.retain && op.attributes == null) {
- inverted.retain(op.retain);
- return baseIndex + op.retain;
- } else if (op.delete || op.retain && op.attributes) {
- var length_2 = op.delete || op.retain;
- var slice = base.slice(baseIndex, baseIndex + length_2);
- slice.forEach(function(baseOp) {
- if (op.delete) {
- inverted.push(baseOp);
- } else if (op.retain && op.attributes) {
- inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes));
- }
- });
- return baseIndex + length_2;
- }
- return baseIndex;
- }, 0);
- return inverted.chop();
- };
- Delta3.prototype.transform = function(arg, priority) {
- if (priority === void 0) {
- priority = false;
- }
- priority = !!priority;
- if (typeof arg === "number") {
- return this.transformPosition(arg, priority);
- }
- var other = arg;
- var thisIter = Op_1.default.iterator(this.ops);
- var otherIter = Op_1.default.iterator(other.ops);
- var delta = new Delta3();
- while (thisIter.hasNext() || otherIter.hasNext()) {
- if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
- delta.retain(Op_1.default.length(thisIter.next()));
- } else if (otherIter.peekType() === "insert") {
- delta.push(otherIter.next());
- } else {
- var length_3 = Math.min(thisIter.peekLength(), otherIter.peekLength());
- var thisOp = thisIter.next(length_3);
- var otherOp = otherIter.next(length_3);
- if (thisOp.delete) {
- continue;
- } else if (otherOp.delete) {
- delta.push(otherOp);
- } else {
- delta.retain(length_3, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority));
- }
- }
- }
- return delta.chop();
- };
- Delta3.prototype.transformPosition = function(index, priority) {
- if (priority === void 0) {
- priority = false;
- }
- priority = !!priority;
- var thisIter = Op_1.default.iterator(this.ops);
- var offset = 0;
- while (thisIter.hasNext() && offset <= index) {
- var length_4 = thisIter.peekLength();
- var nextType = thisIter.peekType();
- thisIter.next();
- if (nextType === "delete") {
- index -= Math.min(length_4, index - offset);
- continue;
- } else if (nextType === "insert" && (offset < index || !priority)) {
- index += length_4;
- }
- offset += length_4;
- }
- return index;
- };
- Delta3.Op = Op_1.default;
- Delta3.AttributeMap = AttributeMap_1.default;
- return Delta3;
- })()
- );
- module.exports = Delta2;
- }
- });
- // node_modules/@vueup/vue-quill/dist/vue-quill.esm-bundler.js
- var import_quill = __toESM(require_quill());
- var import_quill2 = __toESM(require_quill());
- var import_quill_delta = __toESM(require_Delta());
- var import_quill_delta2 = __toESM(require_Delta());
- var toolbarOptions = {
- essential: [
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
- ["bold", "italic", "underline"],
- [{ list: "ordered" }, { list: "bullet" }, { align: [] }],
- ["blockquote", "code-block", "link"],
- [{ color: [] }, "clean"]
- ],
- minimal: [
- [{ header: 1 }, { header: 2 }],
- ["bold", "italic", "underline"],
- [{ list: "ordered" }, { list: "bullet" }, { align: [] }]
- ],
- full: [
- ["bold", "italic", "underline", "strike"],
- ["blockquote", "code-block"],
- [{ header: 1 }, { header: 2 }],
- [{ list: "ordered" }, { list: "bullet" }],
- [{ script: "sub" }, { script: "super" }],
- [{ indent: "-1" }, { indent: "+1" }],
- [{ direction: "rtl" }],
- [{ size: ["small", false, "large", "huge"] }],
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
- [{ color: [] }, { background: [] }],
- [{ font: [] }],
- [{ align: [] }],
- ["link", "video", "image"],
- ["clean"]
- // remove formatting button
- ]
- };
- var QuillEditor = defineComponent({
- name: "QuillEditor",
- inheritAttrs: false,
- props: {
- content: {
- type: [String, Object]
- },
- contentType: {
- type: String,
- default: "delta",
- validator: (value) => {
- return ["delta", "html", "text"].includes(value);
- }
- },
- enable: {
- type: Boolean,
- default: true
- },
- readOnly: {
- type: Boolean,
- default: false
- },
- placeholder: {
- type: String,
- required: false
- },
- theme: {
- type: String,
- default: "snow",
- validator: (value) => {
- return ["snow", "bubble", ""].includes(value);
- }
- },
- toolbar: {
- type: [String, Array, Object],
- required: false,
- validator: (value) => {
- if (typeof value === "string" && value !== "") {
- return value.charAt(0) === "#" ? true : Object.keys(toolbarOptions).indexOf(value) !== -1;
- }
- return true;
- }
- },
- modules: {
- type: Object,
- required: false
- },
- options: {
- type: Object,
- required: false
- },
- globalOptions: {
- type: Object,
- required: false
- }
- },
- emits: [
- "textChange",
- "selectionChange",
- "editorChange",
- "update:content",
- "focus",
- "blur",
- "ready"
- ],
- setup: (props, ctx) => {
- onMounted(() => {
- initialize();
- });
- onBeforeUnmount(() => {
- quill = null;
- });
- let quill;
- let options;
- const editor = ref();
- const initialize = () => {
- var _a;
- if (!editor.value)
- return;
- options = composeOptions();
- if (props.modules) {
- if (Array.isArray(props.modules)) {
- for (const module of props.modules) {
- import_quill.default.register(`modules/${module.name}`, module.module);
- }
- } else {
- import_quill.default.register(`modules/${props.modules.name}`, props.modules.module);
- }
- }
- quill = new import_quill.default(editor.value, options);
- setContents(props.content);
- quill.on("text-change", handleTextChange);
- quill.on("selection-change", handleSelectionChange);
- quill.on("editor-change", handleEditorChange);
- if (props.theme !== "bubble")
- editor.value.classList.remove("ql-bubble");
- if (props.theme !== "snow")
- editor.value.classList.remove("ql-snow");
- (_a = quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container.addEventListener("mousedown", (e) => {
- e.preventDefault();
- });
- ctx.emit("ready", quill);
- };
- const composeOptions = () => {
- const clientOptions = {};
- if (props.theme !== "")
- clientOptions.theme = props.theme;
- if (props.readOnly)
- clientOptions.readOnly = props.readOnly;
- if (props.placeholder)
- clientOptions.placeholder = props.placeholder;
- if (props.toolbar && props.toolbar !== "") {
- clientOptions.modules = {
- toolbar: (() => {
- if (typeof props.toolbar === "object") {
- return props.toolbar;
- } else if (typeof props.toolbar === "string") {
- const str = props.toolbar;
- return str.charAt(0) === "#" ? props.toolbar : toolbarOptions[props.toolbar];
- }
- return;
- })()
- };
- }
- if (props.modules) {
- const modules = (() => {
- var _a, _b;
- const modulesOption = {};
- if (Array.isArray(props.modules)) {
- for (const module of props.modules) {
- modulesOption[module.name] = (_a = module.options) !== null && _a !== void 0 ? _a : {};
- }
- } else {
- modulesOption[props.modules.name] = (_b = props.modules.options) !== null && _b !== void 0 ? _b : {};
- }
- return modulesOption;
- })();
- clientOptions.modules = Object.assign({}, clientOptions.modules, modules);
- }
- return Object.assign({}, props.globalOptions, props.options, clientOptions);
- };
- const maybeClone = (delta) => {
- return typeof delta === "object" && delta ? delta.slice() : delta;
- };
- const deltaHasValuesOtherThanRetain = (delta) => {
- return Object.values(delta.ops).some((v) => !v.retain || Object.keys(v).length !== 1);
- };
- let internalModel;
- const internalModelEquals = (against) => {
- if (typeof internalModel === typeof against) {
- if (against === internalModel) {
- return true;
- }
- if (typeof against === "object" && against && typeof internalModel === "object" && internalModel) {
- return !deltaHasValuesOtherThanRetain(internalModel.diff(against));
- }
- }
- return false;
- };
- const handleTextChange = (delta, oldContents, source) => {
- internalModel = maybeClone(getContents());
- if (!internalModelEquals(props.content)) {
- ctx.emit("update:content", internalModel);
- }
- ctx.emit("textChange", { delta, oldContents, source });
- };
- const isEditorFocus = ref();
- const handleSelectionChange = (range, oldRange, source) => {
- isEditorFocus.value = !!(quill === null || quill === void 0 ? void 0 : quill.hasFocus());
- ctx.emit("selectionChange", { range, oldRange, source });
- };
- watch(isEditorFocus, (focus2) => {
- if (focus2)
- ctx.emit("focus", editor);
- else
- ctx.emit("blur", editor);
- });
- const handleEditorChange = (...args) => {
- if (args[0] === "text-change")
- ctx.emit("editorChange", {
- name: args[0],
- delta: args[1],
- oldContents: args[2],
- source: args[3]
- });
- if (args[0] === "selection-change")
- ctx.emit("editorChange", {
- name: args[0],
- range: args[1],
- oldRange: args[2],
- source: args[3]
- });
- };
- const getEditor = () => {
- return editor.value;
- };
- const getToolbar = () => {
- var _a;
- return (_a = quill === null || quill === void 0 ? void 0 : quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container;
- };
- const getQuill = () => {
- if (quill)
- return quill;
- else
- throw `The quill editor hasn't been instantiated yet,
- make sure to call this method when the editor ready
- or use v-on:ready="onReady(quill)" event instead.`;
- };
- const getContents = (index, length) => {
- if (props.contentType === "html") {
- return getHTML();
- } else if (props.contentType === "text") {
- return getText(index, length);
- }
- return quill === null || quill === void 0 ? void 0 : quill.getContents(index, length);
- };
- const setContents = (content, source = "api") => {
- const normalizedContent = !content ? props.contentType === "delta" ? new import_quill_delta.default() : "" : content;
- if (props.contentType === "html") {
- setHTML(normalizedContent);
- } else if (props.contentType === "text") {
- setText(normalizedContent, source);
- } else {
- quill === null || quill === void 0 ? void 0 : quill.setContents(normalizedContent, source);
- }
- internalModel = maybeClone(normalizedContent);
- };
- const getText = (index, length) => {
- var _a;
- return (_a = quill === null || quill === void 0 ? void 0 : quill.getText(index, length)) !== null && _a !== void 0 ? _a : "";
- };
- const setText = (text, source = "api") => {
- quill === null || quill === void 0 ? void 0 : quill.setText(text, source);
- };
- const getHTML = () => {
- var _a;
- return (_a = quill === null || quill === void 0 ? void 0 : quill.root.innerHTML) !== null && _a !== void 0 ? _a : "";
- };
- const setHTML = (html) => {
- if (quill)
- quill.root.innerHTML = html;
- };
- const pasteHTML = (html, source = "api") => {
- const delta = quill === null || quill === void 0 ? void 0 : quill.clipboard.convert(html);
- if (delta)
- quill === null || quill === void 0 ? void 0 : quill.setContents(delta, source);
- };
- const focus = () => {
- quill === null || quill === void 0 ? void 0 : quill.focus();
- };
- const reinit = () => {
- nextTick(() => {
- var _a;
- if (!ctx.slots.toolbar && quill)
- (_a = quill.getModule("toolbar")) === null || _a === void 0 ? void 0 : _a.container.remove();
- initialize();
- });
- };
- watch(() => props.content, (newContent) => {
- if (!quill || !newContent || internalModelEquals(newContent))
- return;
- const selection = quill.getSelection();
- if (selection) {
- nextTick(() => quill === null || quill === void 0 ? void 0 : quill.setSelection(selection));
- }
- setContents(newContent);
- }, { deep: true });
- watch(() => props.enable, (newValue) => {
- if (quill)
- quill.enable(newValue);
- });
- return {
- editor,
- getEditor,
- getToolbar,
- getQuill,
- getContents,
- setContents,
- getHTML,
- setHTML,
- pasteHTML,
- focus,
- getText,
- setText,
- reinit
- };
- },
- render() {
- var _a, _b;
- return [
- (_b = (_a = this.$slots).toolbar) === null || _b === void 0 ? void 0 : _b.call(_a),
- h("div", { ref: "editor", ...this.$attrs })
- ];
- }
- });
- var export_Delta = import_quill_delta2.default;
- var export_Quill = import_quill2.default;
- export {
- export_Delta as Delta,
- export_Quill as Quill,
- QuillEditor
- };
- /*! Bundled license information:
- quill/dist/quill.js:
- (*!
- * Quill Editor v1.3.7
- * https://quilljs.com/
- * Copyright (c) 2014, Jason Chen
- * Copyright (c) 2013, salesforce.com
- *)
- @vueup/vue-quill/dist/vue-quill.esm-bundler.js:
- (*!
- * VueQuill @vueup/vue-quill v1.2.0
- * https://vueup.github.io/vue-quill/
- *
- * Includes quill v1.3.7
- * https://quilljs.com/
- *
- * Copyright (c) 2023 Ahmad Luthfi Masruri
- * Released under the MIT license
- * Date: 2023-05-12T08:44:03.742Z
- *)
- */
- //# sourceMappingURL=@vueup_vue-quill.js.map
|